Skip to content

Commit

Permalink
Allow array fields on Patient to be empty (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
gffking authored Feb 3, 2025
1 parent 477f644 commit bc25044
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 31 deletions.
46 changes: 23 additions & 23 deletions patient.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,29 +261,29 @@ func (s *PatientService) Get(ctx context.Context, id int64) (*Patient, *http.Res
}

type PatientUpdate struct {
ActualName *string `json:"actual_name,omitempty"`
Address *PatientAddress `json:"address,omitempty"`
Consents []*PatientConsent `json:"consents,omitempty"`
DOB *string `json:"dob,omitempty"`
Emails []*PatientEmail `json:"emails,omitempty"`
Ethnicity *string `json:"ethnicity,omitempty"`
FirstName *string `json:"first_name,omitempty"`
GenderIdentity *string `json:"gender_identity,omitempty"`
Insurances []*PatientInsuranceUpdate `json:"insurances,omitempty"`
LastName *string `json:"last_name,omitempty"`
LegalGenderMarker *string `json:"legal_gender_marker,omitempty"`
MiddleName *string `json:"middle_name,omitempty"`
Notes *string `json:"notes,omitempty"`
PatientStatus *PatientStatusUpdate `json:"patient_status,omitempty"`
Phones []*PatientPhone `json:"phones,omitempty"`
PreferredLanguage *string `json:"preferred_language,omitempty"`
PrimaryCareProviderNPI *string `json:"primary_care_provider_npi,omitempty"`
PrimaryPhysician *int64 `json:"primary_physician,omitempty"`
Pronouns *string `json:"pronouns,omitempty"`
Race *string `json:"race,omitempty"`
Sex *string `json:"sex,omitempty"`
SexualOrientation *string `json:"sexual_orientation,omitempty"`
SSN *string `json:"ssn,omitempty"`
ActualName *string `json:"actual_name,omitempty"`
Address *PatientAddress `json:"address,omitempty"`
Consents *[]*PatientConsent `json:"consents,omitempty"`
DOB *string `json:"dob,omitempty"`
Emails *[]*PatientEmail `json:"emails,omitempty"`
Ethnicity *string `json:"ethnicity,omitempty"`
FirstName *string `json:"first_name,omitempty"`
GenderIdentity *string `json:"gender_identity,omitempty"`
Insurances *[]*PatientInsuranceUpdate `json:"insurances,omitempty"`
LastName *string `json:"last_name,omitempty"`
LegalGenderMarker *string `json:"legal_gender_marker,omitempty"`
MiddleName *string `json:"middle_name,omitempty"`
Notes *string `json:"notes,omitempty"`
PatientStatus *PatientStatusUpdate `json:"patient_status,omitempty"`
Phones *[]*PatientPhone `json:"phones,omitempty"`
PreferredLanguage *string `json:"preferred_language,omitempty"`
PrimaryCareProviderNPI *string `json:"primary_care_provider_npi,omitempty"`
PrimaryPhysician *int64 `json:"primary_physician,omitempty"`
Pronouns *string `json:"pronouns,omitempty"`
Race *string `json:"race,omitempty"`
Sex *string `json:"sex,omitempty"`
SexualOrientation *string `json:"sexual_orientation,omitempty"`
SSN *string `json:"ssn,omitempty"`
}

type PatientInsuranceUpdate struct {
Expand Down
16 changes: 8 additions & 8 deletions patient_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -247,22 +247,22 @@ func TestPatientService_Update(t *testing.T) {
State: "state",
Zip: "zip",
},
Consents: []*PatientConsent{
Consents: Ptr([]*PatientConsent{
{
ConsentType: "consent type",
Expiration: "expiration",
},
},
}),
DOB: Ptr("dob"),
Emails: []*PatientEmail{
Emails: Ptr([]*PatientEmail{
{
Email: "email",
},
},
}),
Ethnicity: Ptr("ethnicity"),
FirstName: Ptr("first name"),
GenderIdentity: Ptr("gender identity name"),
Insurances: []*PatientInsuranceUpdate{
Insurances: Ptr([]*PatientInsuranceUpdate{
{
InsuranceCompany: Ptr[int64](1),
InsurancePlan: Ptr[int64](2),
Expand Down Expand Up @@ -296,7 +296,7 @@ func TestPatientService_Update(t *testing.T) {
EndDate: &civil.Date{Year: 3000, Month: 1, Day: 1},
},
{},
},
}),
LastName: Ptr("last name"),
LegalGenderMarker: Ptr("legal gender marker"),
MiddleName: Ptr("middle name"),
Expand All @@ -305,12 +305,12 @@ func TestPatientService_Update(t *testing.T) {
InactiveReason: Ptr("other"),
Status: Ptr("inactive"),
},
Phones: []*PatientPhone{
Phones: Ptr([]*PatientPhone{
{
Phone: "phone",
PhoneType: "phone type",
},
},
}),
PreferredLanguage: Ptr("preferred language"),
PrimaryCareProviderNPI: Ptr("primary care provider NPI"),
PrimaryPhysician: Ptr[int64](1),
Expand Down

0 comments on commit bc25044

Please sign in to comment.