Skip to content

Commit

Permalink
Patient metadata (#75)
Browse files Browse the repository at this point in the history
  • Loading branch information
fterrag authored Feb 7, 2025
1 parent 142acdc commit 7f27272
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
9 changes: 8 additions & 1 deletion patient.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ type Patient struct {
MasterPatient *int64 `json:"master_patient"`
Employer *PatientEmployer `json:"employer"`
Consents []*PatientConsent `json:"consents"`
Metadata any `json:"metadata"`
Metadata *PatientMetadata `json:"metadata"`
CreatedDate time.Time `json:"created_date"`
DeletedDate *time.Time `json:"deleted_date"`
MergedIntoChart int64 `json:"merged_into_chart"`
Expand Down Expand Up @@ -169,6 +169,12 @@ type PatientInsurance struct {
EndDate *civil.Date `json:"end_date"`
}

type PatientMetadata struct {
Data *map[string]string `json:"data"`
ObjectID *string `json:"object_id"`
ObjectWebLink *string `json:"object_web_link"`
}

type PatientStatus struct {
DeceasedDate string `json:"deceased_date"`
InactiveReason string `json:"inactive_reason"`
Expand Down Expand Up @@ -273,6 +279,7 @@ type PatientUpdate struct {
Insurances *[]*PatientInsuranceUpdate `json:"insurances,omitempty"`
LastName *string `json:"last_name,omitempty"`
LegalGenderMarker *string `json:"legal_gender_marker,omitempty"`
Metadata *PatientMetadata `json:"metadata,omitempty"`
MiddleName *string `json:"middle_name,omitempty"`
Notes *string `json:"notes,omitempty"`
PatientStatus *PatientStatusUpdate `json:"patient_status,omitempty"`
Expand Down
11 changes: 9 additions & 2 deletions patient_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,15 @@ func TestPatientService_Update(t *testing.T) {
}),
LastName: Ptr("last name"),
LegalGenderMarker: Ptr("legal gender marker"),
MiddleName: Ptr("middle name"),
Notes: Ptr("notes"),
Metadata: &PatientMetadata{
Data: Ptr(map[string]string{
"foo": "bar",
}),
ObjectID: Ptr("object-id"),
ObjectWebLink: Ptr("object-web-link"),
},
MiddleName: Ptr("middle name"),
Notes: Ptr("notes"),
PatientStatus: &PatientStatusUpdate{
InactiveReason: Ptr("other"),
Status: Ptr("inactive"),
Expand Down

0 comments on commit 7f27272

Please sign in to comment.