Skip to content

Commit

Permalink
Add support for updating patient status
Browse files Browse the repository at this point in the history
  • Loading branch information
fterrag committed Jan 5, 2024
1 parent c0c23db commit d5f6fc5
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 21 deletions.
48 changes: 27 additions & 21 deletions patient.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,27 +260,33 @@ func (s *PatientService) Get(ctx context.Context, id int64) (*Patient, *http.Res
}

type PatientUpdate struct {
FirstName *string `json:"first_name,omitempty"`
MiddleName *string `json:"middle_name,omitempty"`
LastName *string `json:"last_name,omitempty"`
ActualName *string `json:"actual_name,omitempty"`
GenderIdentity *string `json:"gender_identity,omitempty"`
LegalGenderMarker *string `json:"legal_gender_marker,omitempty"`
Pronouns *string `json:"pronouns,omitempty"`
Sex *string `json:"sex,omitempty"`
SexualOrientation *string `json:"sexual_orientation,omitempty"`
PrimaryPhysician *int64 `json:"primary_physician,omitempty"`
DOB *string `json:"dob,omitempty"`
SSN *string `json:"ssn,omitempty"`
Race *string `json:"race,omitempty"`
PreferredLanguage *string `json:"preferred_language,omitempty"`
Ethnicity *string `json:"ethnicity,omitempty"`
Notes *string `json:"notes,omitempty"`
Address *PatientAddress `json:"address,omitempty"`
Phones []*PatientPhone `json:"phones,omitempty"`
Emails []*PatientEmail `json:"emails,omitempty"`
Insurances []*PatientInsurance `json:"insurances,omitempty"`
Consents []*PatientConsent `json:"consents,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 []*PatientInsurance `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 *UpdatePatientStatus `json:"patient_status"`
Phones []*PatientPhone `json:"phones,omitempty"`
PreferredLanguage *string `json:"preferred_language,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 UpdatePatientStatus struct {
InactiveReason *string `json:"inactive_reason,omitempty"`
Status *string `json:"status,omitempty"`
}

func (s *PatientService) Update(ctx context.Context, id int64, update *PatientUpdate) (*Patient, *http.Response, error) {
Expand Down
4 changes: 4 additions & 0 deletions patient_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,10 @@ func TestPatientService_Update(t *testing.T) {
Expiration: "expiration",
},
},
PatientStatus: &UpdatePatientStatus{
InactiveReason: Ptr("other"),
Status: Ptr("inactive"),
},
}

srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
Expand Down

0 comments on commit d5f6fc5

Please sign in to comment.