Skip to content

Commit

Permalink
Merge pull request #2 from recare/qrago-address
Browse files Browse the repository at this point in the history
adding encrypted address field in fhir address
  • Loading branch information
bilalgulzar authored Nov 24, 2021
2 parents 6d6c5d8 + ce0a754 commit 6b668a9
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
16 changes: 16 additions & 0 deletions fhir-models/fhir/address.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,19 @@ type Address struct {
Country *string `bson:"country,omitempty" json:"country,omitempty"`
Period *Period `bson:"period,omitempty" json:"period,omitempty"`
}

type RecareAddress struct {
Id *string `bson:"id,omitempty" json:"id,omitempty"`
Extension []Extension `bson:"extension,omitempty" json:"extension,omitempty"`
Use *AddressUse `bson:"use,omitempty" json:"use,omitempty"`
Type *AddressType `bson:"type,omitempty" json:"type,omitempty"`
Text *string `bson:"text,omitempty" json:"text,omitempty"`
HouseNumber *EncryptedField `bson:"houseNumber,omitempty" json:"houseNumber,omitempty"`
Line []string `bson:"line,omitempty" json:"line,omitempty"`
City *string `bson:"city,omitempty" json:"city,omitempty"`
District *string `bson:"district,omitempty" json:"district,omitempty"`
State *string `bson:"state,omitempty" json:"state,omitempty"`
PostalCode *string `bson:"postalCode,omitempty" json:"postalCode,omitempty"`
Country *string `bson:"country,omitempty" json:"country,omitempty"`
Period *Period `bson:"period,omitempty" json:"period,omitempty"`
}
18 changes: 18 additions & 0 deletions fhir-models/fhir/addressUse.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ const (
AddressUseTemp
AddressUseOld
AddressUseBilling
AddressUseSearchLocation
AddressUseSearchDestination
)

func (code AddressUse) MarshalJSON() ([]byte, error) {
Expand All @@ -50,6 +52,10 @@ func (code *AddressUse) UnmarshalJSON(json []byte) error {
*code = AddressUseOld
case "billing":
*code = AddressUseBilling
case "searchLocation":
*code = AddressUseSearchLocation
case "searchDestination":
*code = AddressUseSearchDestination
default:
return fmt.Errorf("unknown AddressUse code `%s`", s)
}
Expand All @@ -70,6 +76,10 @@ func (code AddressUse) Code() string {
return "old"
case AddressUseBilling:
return "billing"
case AddressUseSearchLocation:
return "searchLocation"
case AddressUseSearchDestination:
return "searchDestination"
}
return "<unknown>"
}
Expand All @@ -85,6 +95,10 @@ func (code AddressUse) Display() string {
return "Old / Incorrect"
case AddressUseBilling:
return "Billing"
case AddressUseSearchLocation:
return "Search Location"
case AddressUseSearchDestination:
return "Search Destination"
}
return "<unknown>"
}
Expand All @@ -100,6 +114,10 @@ func (code AddressUse) Definition() string {
return "This address is no longer in use (or was never correct but retained for records)."
case AddressUseBilling:
return "An address to be used to send bills, invoices, receipts etc."
case AddressUseSearchLocation:
return "An address of search location (transport)."
case AddressUseSearchDestination:
return "An address of search destination (transport)."
}
return "<unknown>"
}

0 comments on commit 6b668a9

Please sign in to comment.