forked from samply/golang-fhir-models
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from lifebox-healthcare/CI-1-extension-value-uri
Merge support for polymorphic types
- Loading branch information
Showing
455 changed files
with
4,855 additions
and
1,569 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// Copyright 2019 The Samply Development Community | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
package fhir | ||
|
||
// THIS FILE IS GENERATED BY https://github.com/lifebox-healthcare/golang-fhir-models | ||
// PLEASE DO NOT EDIT BY HAND | ||
|
||
// Address is documented here http://hl7.org/fhir/StructureDefinition/Address | ||
type Address 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"` | ||
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"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
// Copyright 2019 The Samply Development Community | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
package fhir | ||
|
||
import ( | ||
"encoding/json" | ||
"fmt" | ||
"strings" | ||
) | ||
|
||
// THIS FILE IS GENERATED BY https://github.com/lifebox-healthcare/golang-fhir-models | ||
// PLEASE DO NOT EDIT BY HAND | ||
|
||
// AddressType is documented here http://hl7.org/fhir/ValueSet/address-type | ||
type AddressType int | ||
|
||
const ( | ||
AddressTypePostal AddressType = iota | ||
AddressTypePhysical | ||
AddressTypeBoth | ||
) | ||
|
||
func (code AddressType) MarshalJSON() ([]byte, error) { | ||
return json.Marshal(code.Code()) | ||
} | ||
func (code *AddressType) UnmarshalJSON(json []byte) error { | ||
s := strings.Trim(string(json), "\"") | ||
switch s { | ||
case "postal": | ||
*code = AddressTypePostal | ||
case "physical": | ||
*code = AddressTypePhysical | ||
case "both": | ||
*code = AddressTypeBoth | ||
default: | ||
return fmt.Errorf("unknown AddressType code `%s`", s) | ||
} | ||
return nil | ||
} | ||
func (code AddressType) String() string { | ||
return code.Code() | ||
} | ||
func (code AddressType) Code() string { | ||
switch code { | ||
case AddressTypePostal: | ||
return "postal" | ||
case AddressTypePhysical: | ||
return "physical" | ||
case AddressTypeBoth: | ||
return "both" | ||
} | ||
return "<unknown>" | ||
} | ||
func (code AddressType) Display() string { | ||
switch code { | ||
case AddressTypePostal: | ||
return "Postal" | ||
case AddressTypePhysical: | ||
return "Physical" | ||
case AddressTypeBoth: | ||
return "Postal & Physical" | ||
} | ||
return "<unknown>" | ||
} | ||
func (code AddressType) Definition() string { | ||
switch code { | ||
case AddressTypePostal: | ||
return "Mailing addresses - PO Boxes and care-of addresses." | ||
case AddressTypePhysical: | ||
return "A physical address that can be visited." | ||
case AddressTypeBoth: | ||
return "An address that is both physical and postal." | ||
} | ||
return "<unknown>" | ||
} |
Oops, something went wrong.