From d54624d393986163280a3de58ae34ee15c0be95a Mon Sep 17 00:00:00 2001 From: Rein Krul Date: Sun, 1 Sep 2024 07:18:59 +0200 Subject: [PATCH] Support polymorphic types for nested fields (Task.input.value[x]), Add title function that outputs 'ID' instead of 'Id' --- fhir-models-gen/cmd/genResources.go | 22 +- fhir-models/fhir/auditEvent.go | 4 +- fhir-models/fhir/claim.go | 8 +- fhir-models/fhir/codeSystem.go | 14 +- fhir-models/fhir/communication.go | 6 +- fhir-models/fhir/communicationRequest.go | 6 +- fhir-models/fhir/composition.go | 4 +- fhir-models/fhir/contract.go | 36 +-- fhir-models/fhir/coverage.go | 4 +- fhir-models/fhir/deviceRequest.go | 4 +- fhir-models/fhir/elementDefinition.go | 106 ++++----- fhir-models/fhir/evidenceVariable.go | 36 +-- fhir-models/fhir/explanationOfBenefit.go | 8 +- fhir-models/fhir/group.go | 22 +- fhir-models/fhir/guidanceResponse.go | 6 +- fhir-models/fhir/immunization.go | 8 +- fhir-models/fhir/implementationGuide.go | 4 +- fhir-models/fhir/invoice.go | 4 +- fhir-models/fhir/medication.go | 14 +- fhir-models/fhir/medicationAdministration.go | 8 +- fhir-models/fhir/medicationDispense.go | 4 +- fhir-models/fhir/medicationKnowledge.go | 26 +-- fhir-models/fhir/medicationRequest.go | 8 +- fhir-models/fhir/medicationStatement.go | 4 +- .../fhir/medicinalProductContraindication.go | 12 +- .../fhir/medicinalProductIndication.go | 12 +- .../fhir/medicinalProductInteraction.go | 10 +- fhir-models/fhir/messageDefinition.go | 4 +- fhir-models/fhir/messageHeader.go | 4 +- fhir-models/fhir/questionnaire.go | 56 ++--- fhir-models/fhir/researchElementDefinition.go | 8 +- fhir-models/fhir/specimenDefinition.go | 10 +- fhir-models/fhir/structureMap.go | 10 +- fhir-models/fhir/structureMapTransform.go | 10 +- fhir-models/fhir/substance.go | 12 +- fhir-models/fhir/supplyRequest.go | 4 +- fhir-models/fhir/task.go | 216 +++++++++--------- fhir-models/fhir/task_test.go | 26 +++ fhir-models/fhir/usageContext.go | 14 +- 39 files changed, 404 insertions(+), 370 deletions(-) create mode 100644 fhir-models/fhir/task_test.go diff --git a/fhir-models-gen/cmd/genResources.go b/fhir-models-gen/cmd/genResources.go index f09cdfc2..aa6316b9 100644 --- a/fhir-models-gen/cmd/genResources.go +++ b/fhir-models-gen/cmd/genResources.go @@ -330,7 +330,7 @@ func appendFields(resources ResourceMap, requiredTypes map[string]bool, required pathParts := Split(element.Path, ".") if len(pathParts) == level+1 { // direct childs - name := Title(pathParts[level]) + name := title(pathParts[level]) // support contained resources later if name != "Contained" { @@ -347,7 +347,7 @@ func appendFields(resources ResourceMap, requiredTypes map[string]bool, required typeIdentifier := "" for _, pathPart := range Split((*element.ContentReference)[1:], ".") { - typeIdentifier = typeIdentifier + Title(pathPart) + typeIdentifier = typeIdentifier + title(pathPart) } statement.Id(typeIdentifier).Tag(map[string]string{"json": pathParts[level] + ",omitempty", "bson": pathParts[level] + ",omitempty"}) } @@ -362,7 +362,7 @@ func appendFields(resources ResourceMap, requiredTypes map[string]bool, required default: //polymorphic type name = Replace(pathParts[level], "[x]", "", -1) for _, eleType := range element.Type { - name := name + Title(eleType.Code) + name := name + title(eleType.Code) var err error i, err = addFieldStatement(resources, requiredTypes, requiredValueSetBindings, file, fields, @@ -395,15 +395,16 @@ func addFieldStatement( elementIndex, level int, elementType fhir.ElementDefinitionType, ) (idx int, err error) { - fieldName := Title(name) + fieldName := title(name) element := elementDefinitions[elementIndex] statement := fields.Id(fieldName) + isPolymorphic := HasSuffix(element.Path, "[x]") switch elementType.Code { case "code": if *element.Max == "*" { statement.Op("[]") - } else if *element.Min == 0 { + } else if *element.Min == 0 || isPolymorphic { statement.Op("*") } @@ -441,7 +442,7 @@ func addFieldStatement( default: if *element.Max == "*" { statement.Op("[]") - } else if *element.Min == 0 { + } else if *element.Min == 0 || isPolymorphic { statement.Op("*") } @@ -472,7 +473,7 @@ func addFieldStatement( } } - if *element.Min == 0 { + if *element.Min == 0 || isPolymorphic { statement.Tag(map[string]string{"json": name + ",omitempty", "bson": name + ",omitempty"}) } else { statement.Tag(map[string]string{"json": name, "bson": name}) @@ -491,6 +492,13 @@ func requiredValueSetBinding(elementDefinition fhir.ElementDefinition) *string { return nil } +func title(input string) string { + if EqualFold(input, "id") { + return "ID" + } + return Title(input) +} + func typeCodeToTypeIdentifier(typeCode string) string { switch typeCode { case "base64Binary": diff --git a/fhir-models/fhir/auditEvent.go b/fhir-models/fhir/auditEvent.go index 0230bf26..bf3c4a99 100644 --- a/fhir-models/fhir/auditEvent.go +++ b/fhir-models/fhir/auditEvent.go @@ -93,8 +93,8 @@ type AuditEventEntityDetail struct { Extension []Extension `bson:"extension,omitempty" json:"extension,omitempty"` ModifierExtension []Extension `bson:"modifierExtension,omitempty" json:"modifierExtension,omitempty"` Type string `bson:"type" json:"type"` - ValueString string `bson:"valueString" json:"valueString"` - ValueBase64Binary string `bson:"valueBase64Binary" json:"valueBase64Binary"` + ValueString *string `bson:"valueString,omitempty" json:"valueString,omitempty"` + ValueBase64Binary *string `bson:"valueBase64Binary,omitempty" json:"valueBase64Binary,omitempty"` } type OtherAuditEvent AuditEvent diff --git a/fhir-models/fhir/claim.go b/fhir-models/fhir/claim.go index 5f6d4dfd..08fb2955 100644 --- a/fhir-models/fhir/claim.go +++ b/fhir-models/fhir/claim.go @@ -105,8 +105,8 @@ type ClaimDiagnosis struct { Extension []Extension `bson:"extension,omitempty" json:"extension,omitempty"` ModifierExtension []Extension `bson:"modifierExtension,omitempty" json:"modifierExtension,omitempty"` Sequence int `bson:"sequence" json:"sequence"` - DiagnosisCodeableConcept CodeableConcept `bson:"diagnosisCodeableConcept" json:"diagnosisCodeableConcept"` - DiagnosisReference Reference `bson:"diagnosisReference" json:"diagnosisReference"` + DiagnosisCodeableConcept *CodeableConcept `bson:"diagnosisCodeableConcept,omitempty" json:"diagnosisCodeableConcept,omitempty"` + DiagnosisReference *Reference `bson:"diagnosisReference,omitempty" json:"diagnosisReference,omitempty"` Type []CodeableConcept `bson:"type,omitempty" json:"type,omitempty"` OnAdmission *CodeableConcept `bson:"onAdmission,omitempty" json:"onAdmission,omitempty"` PackageCode *CodeableConcept `bson:"packageCode,omitempty" json:"packageCode,omitempty"` @@ -118,8 +118,8 @@ type ClaimProcedure struct { Sequence int `bson:"sequence" json:"sequence"` Type []CodeableConcept `bson:"type,omitempty" json:"type,omitempty"` Date *string `bson:"date,omitempty" json:"date,omitempty"` - ProcedureCodeableConcept CodeableConcept `bson:"procedureCodeableConcept" json:"procedureCodeableConcept"` - ProcedureReference Reference `bson:"procedureReference" json:"procedureReference"` + ProcedureCodeableConcept *CodeableConcept `bson:"procedureCodeableConcept,omitempty" json:"procedureCodeableConcept,omitempty"` + ProcedureReference *Reference `bson:"procedureReference,omitempty" json:"procedureReference,omitempty"` Udi []Reference `bson:"udi,omitempty" json:"udi,omitempty"` } type ClaimInsurance struct { diff --git a/fhir-models/fhir/codeSystem.go b/fhir-models/fhir/codeSystem.go index c6d36e95..10b63f28 100644 --- a/fhir-models/fhir/codeSystem.go +++ b/fhir-models/fhir/codeSystem.go @@ -100,13 +100,13 @@ type CodeSystemConceptProperty struct { Extension []Extension `bson:"extension,omitempty" json:"extension,omitempty"` ModifierExtension []Extension `bson:"modifierExtension,omitempty" json:"modifierExtension,omitempty"` Code string `bson:"code" json:"code"` - ValueCode string `bson:"valueCode" json:"valueCode"` - ValueCoding Coding `bson:"valueCoding" json:"valueCoding"` - ValueString string `bson:"valueString" json:"valueString"` - ValueInteger int `bson:"valueInteger" json:"valueInteger"` - ValueBoolean bool `bson:"valueBoolean" json:"valueBoolean"` - ValueDateTime string `bson:"valueDateTime" json:"valueDateTime"` - ValueDecimal float64 `bson:"valueDecimal" json:"valueDecimal"` + ValueCode *string `bson:"valueCode,omitempty" json:"valueCode,omitempty"` + ValueCoding *Coding `bson:"valueCoding,omitempty" json:"valueCoding,omitempty"` + ValueString *string `bson:"valueString,omitempty" json:"valueString,omitempty"` + ValueInteger *int `bson:"valueInteger,omitempty" json:"valueInteger,omitempty"` + ValueBoolean *bool `bson:"valueBoolean,omitempty" json:"valueBoolean,omitempty"` + ValueDateTime *string `bson:"valueDateTime,omitempty" json:"valueDateTime,omitempty"` + ValueDecimal *float64 `bson:"valueDecimal,omitempty" json:"valueDecimal,omitempty"` } type OtherCodeSystem CodeSystem diff --git a/fhir-models/fhir/communication.go b/fhir-models/fhir/communication.go index 75368fd7..80784e20 100644 --- a/fhir-models/fhir/communication.go +++ b/fhir-models/fhir/communication.go @@ -59,9 +59,9 @@ type CommunicationPayload struct { ID *string `bson:"id,omitempty" json:"id,omitempty"` Extension []Extension `bson:"extension,omitempty" json:"extension,omitempty"` ModifierExtension []Extension `bson:"modifierExtension,omitempty" json:"modifierExtension,omitempty"` - ContentString string `bson:"contentString" json:"contentString"` - ContentAttachment Attachment `bson:"contentAttachment" json:"contentAttachment"` - ContentReference Reference `bson:"contentReference" json:"contentReference"` + ContentString *string `bson:"contentString,omitempty" json:"contentString,omitempty"` + ContentAttachment *Attachment `bson:"contentAttachment,omitempty" json:"contentAttachment,omitempty"` + ContentReference *Reference `bson:"contentReference,omitempty" json:"contentReference,omitempty"` } type OtherCommunication Communication diff --git a/fhir-models/fhir/communicationRequest.go b/fhir-models/fhir/communicationRequest.go index 40c7a13b..32a58fbd 100644 --- a/fhir-models/fhir/communicationRequest.go +++ b/fhir-models/fhir/communicationRequest.go @@ -59,9 +59,9 @@ type CommunicationRequestPayload struct { ID *string `bson:"id,omitempty" json:"id,omitempty"` Extension []Extension `bson:"extension,omitempty" json:"extension,omitempty"` ModifierExtension []Extension `bson:"modifierExtension,omitempty" json:"modifierExtension,omitempty"` - ContentString string `bson:"contentString" json:"contentString"` - ContentAttachment Attachment `bson:"contentAttachment" json:"contentAttachment"` - ContentReference Reference `bson:"contentReference" json:"contentReference"` + ContentString *string `bson:"contentString,omitempty" json:"contentString,omitempty"` + ContentAttachment *Attachment `bson:"contentAttachment,omitempty" json:"contentAttachment,omitempty"` + ContentReference *Reference `bson:"contentReference,omitempty" json:"contentReference,omitempty"` } type OtherCommunicationRequest CommunicationRequest diff --git a/fhir-models/fhir/composition.go b/fhir-models/fhir/composition.go index 6412f824..6e5097ee 100644 --- a/fhir-models/fhir/composition.go +++ b/fhir-models/fhir/composition.go @@ -60,8 +60,8 @@ type CompositionRelatesTo struct { Extension []Extension `bson:"extension,omitempty" json:"extension,omitempty"` ModifierExtension []Extension `bson:"modifierExtension,omitempty" json:"modifierExtension,omitempty"` Code DocumentRelationshipType `bson:"code" json:"code"` - TargetIdentifier Identifier `bson:"targetIdentifier" json:"targetIdentifier"` - TargetReference Reference `bson:"targetReference" json:"targetReference"` + TargetIdentifier *Identifier `bson:"targetIdentifier,omitempty" json:"targetIdentifier,omitempty"` + TargetReference *Reference `bson:"targetReference,omitempty" json:"targetReference,omitempty"` } type CompositionEvent struct { ID *string `bson:"id,omitempty" json:"id,omitempty"` diff --git a/fhir-models/fhir/contract.go b/fhir-models/fhir/contract.go index c07c49bc..c6626837 100644 --- a/fhir-models/fhir/contract.go +++ b/fhir-models/fhir/contract.go @@ -131,18 +131,18 @@ type ContractTermOfferAnswer struct { ID *string `bson:"id,omitempty" json:"id,omitempty"` Extension []Extension `bson:"extension,omitempty" json:"extension,omitempty"` ModifierExtension []Extension `bson:"modifierExtension,omitempty" json:"modifierExtension,omitempty"` - ValueBoolean bool `bson:"valueBoolean" json:"valueBoolean"` - ValueDecimal float64 `bson:"valueDecimal" json:"valueDecimal"` - ValueInteger int `bson:"valueInteger" json:"valueInteger"` - ValueDate string `bson:"valueDate" json:"valueDate"` - ValueDateTime string `bson:"valueDateTime" json:"valueDateTime"` - ValueTime string `bson:"valueTime" json:"valueTime"` - ValueString string `bson:"valueString" json:"valueString"` - ValueUri string `bson:"valueUri" json:"valueUri"` - ValueAttachment Attachment `bson:"valueAttachment" json:"valueAttachment"` - ValueCoding Coding `bson:"valueCoding" json:"valueCoding"` - ValueQuantity Quantity `bson:"valueQuantity" json:"valueQuantity"` - ValueReference Reference `bson:"valueReference" json:"valueReference"` + ValueBoolean *bool `bson:"valueBoolean,omitempty" json:"valueBoolean,omitempty"` + ValueDecimal *float64 `bson:"valueDecimal,omitempty" json:"valueDecimal,omitempty"` + ValueInteger *int `bson:"valueInteger,omitempty" json:"valueInteger,omitempty"` + ValueDate *string `bson:"valueDate,omitempty" json:"valueDate,omitempty"` + ValueDateTime *string `bson:"valueDateTime,omitempty" json:"valueDateTime,omitempty"` + ValueTime *string `bson:"valueTime,omitempty" json:"valueTime,omitempty"` + ValueString *string `bson:"valueString,omitempty" json:"valueString,omitempty"` + ValueUri *string `bson:"valueUri,omitempty" json:"valueUri,omitempty"` + ValueAttachment *Attachment `bson:"valueAttachment,omitempty" json:"valueAttachment,omitempty"` + ValueCoding *Coding `bson:"valueCoding,omitempty" json:"valueCoding,omitempty"` + ValueQuantity *Quantity `bson:"valueQuantity,omitempty" json:"valueQuantity,omitempty"` + ValueReference *Reference `bson:"valueReference,omitempty" json:"valueReference,omitempty"` } type ContractTermAsset struct { ID *string `bson:"id,omitempty" json:"id,omitempty"` @@ -239,22 +239,22 @@ type ContractFriendly struct { ID *string `bson:"id,omitempty" json:"id,omitempty"` Extension []Extension `bson:"extension,omitempty" json:"extension,omitempty"` ModifierExtension []Extension `bson:"modifierExtension,omitempty" json:"modifierExtension,omitempty"` - ContentAttachment Attachment `bson:"contentAttachment" json:"contentAttachment"` - ContentReference Reference `bson:"contentReference" json:"contentReference"` + ContentAttachment *Attachment `bson:"contentAttachment,omitempty" json:"contentAttachment,omitempty"` + ContentReference *Reference `bson:"contentReference,omitempty" json:"contentReference,omitempty"` } type ContractLegal struct { ID *string `bson:"id,omitempty" json:"id,omitempty"` Extension []Extension `bson:"extension,omitempty" json:"extension,omitempty"` ModifierExtension []Extension `bson:"modifierExtension,omitempty" json:"modifierExtension,omitempty"` - ContentAttachment Attachment `bson:"contentAttachment" json:"contentAttachment"` - ContentReference Reference `bson:"contentReference" json:"contentReference"` + ContentAttachment *Attachment `bson:"contentAttachment,omitempty" json:"contentAttachment,omitempty"` + ContentReference *Reference `bson:"contentReference,omitempty" json:"contentReference,omitempty"` } type ContractRule struct { ID *string `bson:"id,omitempty" json:"id,omitempty"` Extension []Extension `bson:"extension,omitempty" json:"extension,omitempty"` ModifierExtension []Extension `bson:"modifierExtension,omitempty" json:"modifierExtension,omitempty"` - ContentAttachment Attachment `bson:"contentAttachment" json:"contentAttachment"` - ContentReference Reference `bson:"contentReference" json:"contentReference"` + ContentAttachment *Attachment `bson:"contentAttachment,omitempty" json:"contentAttachment,omitempty"` + ContentReference *Reference `bson:"contentReference,omitempty" json:"contentReference,omitempty"` } type OtherContract Contract diff --git a/fhir-models/fhir/coverage.go b/fhir-models/fhir/coverage.go index 27b0ddb5..8546abb8 100644 --- a/fhir-models/fhir/coverage.go +++ b/fhir-models/fhir/coverage.go @@ -62,8 +62,8 @@ type CoverageCostToBeneficiary struct { Extension []Extension `bson:"extension,omitempty" json:"extension,omitempty"` ModifierExtension []Extension `bson:"modifierExtension,omitempty" json:"modifierExtension,omitempty"` Type *CodeableConcept `bson:"type,omitempty" json:"type,omitempty"` - ValueQuantity Quantity `bson:"valueQuantity" json:"valueQuantity"` - ValueMoney Money `bson:"valueMoney" json:"valueMoney"` + ValueQuantity *Quantity `bson:"valueQuantity,omitempty" json:"valueQuantity,omitempty"` + ValueMoney *Money `bson:"valueMoney,omitempty" json:"valueMoney,omitempty"` Exception []CoverageCostToBeneficiaryException `bson:"exception,omitempty" json:"exception,omitempty"` } type CoverageCostToBeneficiaryException struct { diff --git a/fhir-models/fhir/deviceRequest.go b/fhir-models/fhir/deviceRequest.go index 57f437d3..921a008c 100644 --- a/fhir-models/fhir/deviceRequest.go +++ b/fhir-models/fhir/deviceRequest.go @@ -40,8 +40,8 @@ type DeviceRequest struct { Status *RequestStatus `bson:"status,omitempty" json:"status,omitempty"` Intent RequestIntent `bson:"intent" json:"intent"` Priority *RequestPriority `bson:"priority,omitempty" json:"priority,omitempty"` - CodeReference Reference `bson:"codeReference" json:"codeReference"` - CodeCodeableConcept CodeableConcept `bson:"codeCodeableConcept" json:"codeCodeableConcept"` + CodeReference *Reference `bson:"codeReference,omitempty" json:"codeReference,omitempty"` + CodeCodeableConcept *CodeableConcept `bson:"codeCodeableConcept,omitempty" json:"codeCodeableConcept,omitempty"` Parameter []DeviceRequestParameter `bson:"parameter,omitempty" json:"parameter,omitempty"` Subject Reference `bson:"subject" json:"subject"` Encounter *Reference `bson:"encounter,omitempty" json:"encounter,omitempty"` diff --git a/fhir-models/fhir/elementDefinition.go b/fhir-models/fhir/elementDefinition.go index 97d83265..041a3044 100644 --- a/fhir-models/fhir/elementDefinition.go +++ b/fhir-models/fhir/elementDefinition.go @@ -251,59 +251,59 @@ type ElementDefinitionType struct { Versioning *ReferenceVersionRules `bson:"versioning,omitempty" json:"versioning,omitempty"` } type ElementDefinitionExample struct { - ID *string `bson:"id,omitempty" json:"id,omitempty"` - Extension []Extension `bson:"extension,omitempty" json:"extension,omitempty"` - Label string `bson:"label" json:"label"` - ValueBase64Binary string `bson:"valueBase64Binary" json:"valueBase64Binary"` - ValueBoolean bool `bson:"valueBoolean" json:"valueBoolean"` - ValueCanonical string `bson:"valueCanonical" json:"valueCanonical"` - ValueCode string `bson:"valueCode" json:"valueCode"` - ValueDate string `bson:"valueDate" json:"valueDate"` - ValueDateTime string `bson:"valueDateTime" json:"valueDateTime"` - ValueDecimal float64 `bson:"valueDecimal" json:"valueDecimal"` - ValueID string `bson:"valueID" json:"valueID"` - ValueInstant string `bson:"valueInstant" json:"valueInstant"` - ValueInteger int `bson:"valueInteger" json:"valueInteger"` - ValueMarkdown string `bson:"valueMarkdown" json:"valueMarkdown"` - ValueOid string `bson:"valueOid" json:"valueOid"` - ValuePositiveInt int `bson:"valuePositiveInt" json:"valuePositiveInt"` - ValueString string `bson:"valueString" json:"valueString"` - ValueTime string `bson:"valueTime" json:"valueTime"` - ValueUnsignedInt int `bson:"valueUnsignedInt" json:"valueUnsignedInt"` - ValueUri string `bson:"valueUri" json:"valueUri"` - ValueUrl string `bson:"valueUrl" json:"valueUrl"` - ValueUuid string `bson:"valueUuid" json:"valueUuid"` - ValueAddress Address `bson:"valueAddress" json:"valueAddress"` - ValueAge Age `bson:"valueAge" json:"valueAge"` - ValueAnnotation Annotation `bson:"valueAnnotation" json:"valueAnnotation"` - ValueAttachment Attachment `bson:"valueAttachment" json:"valueAttachment"` - ValueCodeableConcept CodeableConcept `bson:"valueCodeableConcept" json:"valueCodeableConcept"` - ValueCoding Coding `bson:"valueCoding" json:"valueCoding"` - ValueContactPoint ContactPoint `bson:"valueContactPoint" json:"valueContactPoint"` - ValueCount Count `bson:"valueCount" json:"valueCount"` - ValueDistance Distance `bson:"valueDistance" json:"valueDistance"` - ValueDuration Duration `bson:"valueDuration" json:"valueDuration"` - ValueHumanName HumanName `bson:"valueHumanName" json:"valueHumanName"` - ValueIdentifier Identifier `bson:"valueIdentifier" json:"valueIdentifier"` - ValueMoney Money `bson:"valueMoney" json:"valueMoney"` - ValuePeriod Period `bson:"valuePeriod" json:"valuePeriod"` - ValueQuantity Quantity `bson:"valueQuantity" json:"valueQuantity"` - ValueRange Range `bson:"valueRange" json:"valueRange"` - ValueRatio Ratio `bson:"valueRatio" json:"valueRatio"` - ValueReference Reference `bson:"valueReference" json:"valueReference"` - ValueSampledData SampledData `bson:"valueSampledData" json:"valueSampledData"` - ValueSignature Signature `bson:"valueSignature" json:"valueSignature"` - ValueTiming Timing `bson:"valueTiming" json:"valueTiming"` - ValueContactDetail ContactDetail `bson:"valueContactDetail" json:"valueContactDetail"` - ValueContributor Contributor `bson:"valueContributor" json:"valueContributor"` - ValueDataRequirement DataRequirement `bson:"valueDataRequirement" json:"valueDataRequirement"` - ValueExpression Expression `bson:"valueExpression" json:"valueExpression"` - ValueParameterDefinition ParameterDefinition `bson:"valueParameterDefinition" json:"valueParameterDefinition"` - ValueRelatedArtifact RelatedArtifact `bson:"valueRelatedArtifact" json:"valueRelatedArtifact"` - ValueTriggerDefinition TriggerDefinition `bson:"valueTriggerDefinition" json:"valueTriggerDefinition"` - ValueUsageContext UsageContext `bson:"valueUsageContext" json:"valueUsageContext"` - ValueDosage Dosage `bson:"valueDosage" json:"valueDosage"` - ValueMeta Meta `bson:"valueMeta" json:"valueMeta"` + ID *string `bson:"id,omitempty" json:"id,omitempty"` + Extension []Extension `bson:"extension,omitempty" json:"extension,omitempty"` + Label string `bson:"label" json:"label"` + ValueBase64Binary *string `bson:"valueBase64Binary,omitempty" json:"valueBase64Binary,omitempty"` + ValueBoolean *bool `bson:"valueBoolean,omitempty" json:"valueBoolean,omitempty"` + ValueCanonical *string `bson:"valueCanonical,omitempty" json:"valueCanonical,omitempty"` + ValueCode *string `bson:"valueCode,omitempty" json:"valueCode,omitempty"` + ValueDate *string `bson:"valueDate,omitempty" json:"valueDate,omitempty"` + ValueDateTime *string `bson:"valueDateTime,omitempty" json:"valueDateTime,omitempty"` + ValueDecimal *float64 `bson:"valueDecimal,omitempty" json:"valueDecimal,omitempty"` + ValueID *string `bson:"valueID,omitempty" json:"valueID,omitempty"` + ValueInstant *string `bson:"valueInstant,omitempty" json:"valueInstant,omitempty"` + ValueInteger *int `bson:"valueInteger,omitempty" json:"valueInteger,omitempty"` + ValueMarkdown *string `bson:"valueMarkdown,omitempty" json:"valueMarkdown,omitempty"` + ValueOid *string `bson:"valueOid,omitempty" json:"valueOid,omitempty"` + ValuePositiveInt *int `bson:"valuePositiveInt,omitempty" json:"valuePositiveInt,omitempty"` + ValueString *string `bson:"valueString,omitempty" json:"valueString,omitempty"` + ValueTime *string `bson:"valueTime,omitempty" json:"valueTime,omitempty"` + ValueUnsignedInt *int `bson:"valueUnsignedInt,omitempty" json:"valueUnsignedInt,omitempty"` + ValueUri *string `bson:"valueUri,omitempty" json:"valueUri,omitempty"` + ValueUrl *string `bson:"valueUrl,omitempty" json:"valueUrl,omitempty"` + ValueUuid *string `bson:"valueUuid,omitempty" json:"valueUuid,omitempty"` + ValueAddress *Address `bson:"valueAddress,omitempty" json:"valueAddress,omitempty"` + ValueAge *Age `bson:"valueAge,omitempty" json:"valueAge,omitempty"` + ValueAnnotation *Annotation `bson:"valueAnnotation,omitempty" json:"valueAnnotation,omitempty"` + ValueAttachment *Attachment `bson:"valueAttachment,omitempty" json:"valueAttachment,omitempty"` + ValueCodeableConcept *CodeableConcept `bson:"valueCodeableConcept,omitempty" json:"valueCodeableConcept,omitempty"` + ValueCoding *Coding `bson:"valueCoding,omitempty" json:"valueCoding,omitempty"` + ValueContactPoint *ContactPoint `bson:"valueContactPoint,omitempty" json:"valueContactPoint,omitempty"` + ValueCount *Count `bson:"valueCount,omitempty" json:"valueCount,omitempty"` + ValueDistance *Distance `bson:"valueDistance,omitempty" json:"valueDistance,omitempty"` + ValueDuration *Duration `bson:"valueDuration,omitempty" json:"valueDuration,omitempty"` + ValueHumanName *HumanName `bson:"valueHumanName,omitempty" json:"valueHumanName,omitempty"` + ValueIdentifier *Identifier `bson:"valueIdentifier,omitempty" json:"valueIdentifier,omitempty"` + ValueMoney *Money `bson:"valueMoney,omitempty" json:"valueMoney,omitempty"` + ValuePeriod *Period `bson:"valuePeriod,omitempty" json:"valuePeriod,omitempty"` + ValueQuantity *Quantity `bson:"valueQuantity,omitempty" json:"valueQuantity,omitempty"` + ValueRange *Range `bson:"valueRange,omitempty" json:"valueRange,omitempty"` + ValueRatio *Ratio `bson:"valueRatio,omitempty" json:"valueRatio,omitempty"` + ValueReference *Reference `bson:"valueReference,omitempty" json:"valueReference,omitempty"` + ValueSampledData *SampledData `bson:"valueSampledData,omitempty" json:"valueSampledData,omitempty"` + ValueSignature *Signature `bson:"valueSignature,omitempty" json:"valueSignature,omitempty"` + ValueTiming *Timing `bson:"valueTiming,omitempty" json:"valueTiming,omitempty"` + ValueContactDetail *ContactDetail `bson:"valueContactDetail,omitempty" json:"valueContactDetail,omitempty"` + ValueContributor *Contributor `bson:"valueContributor,omitempty" json:"valueContributor,omitempty"` + ValueDataRequirement *DataRequirement `bson:"valueDataRequirement,omitempty" json:"valueDataRequirement,omitempty"` + ValueExpression *Expression `bson:"valueExpression,omitempty" json:"valueExpression,omitempty"` + ValueParameterDefinition *ParameterDefinition `bson:"valueParameterDefinition,omitempty" json:"valueParameterDefinition,omitempty"` + ValueRelatedArtifact *RelatedArtifact `bson:"valueRelatedArtifact,omitempty" json:"valueRelatedArtifact,omitempty"` + ValueTriggerDefinition *TriggerDefinition `bson:"valueTriggerDefinition,omitempty" json:"valueTriggerDefinition,omitempty"` + ValueUsageContext *UsageContext `bson:"valueUsageContext,omitempty" json:"valueUsageContext,omitempty"` + ValueDosage *Dosage `bson:"valueDosage,omitempty" json:"valueDosage,omitempty"` + ValueMeta *Meta `bson:"valueMeta,omitempty" json:"valueMeta,omitempty"` } type ElementDefinitionConstraint struct { ID *string `bson:"id,omitempty" json:"id,omitempty"` diff --git a/fhir-models/fhir/evidenceVariable.go b/fhir-models/fhir/evidenceVariable.go index 71c5cfac..c4266ad2 100644 --- a/fhir-models/fhir/evidenceVariable.go +++ b/fhir-models/fhir/evidenceVariable.go @@ -60,24 +60,24 @@ type EvidenceVariable struct { Characteristic []EvidenceVariableCharacteristic `bson:"characteristic" json:"characteristic"` } type EvidenceVariableCharacteristic struct { - ID *string `bson:"id,omitempty" json:"id,omitempty"` - Extension []Extension `bson:"extension,omitempty" json:"extension,omitempty"` - ModifierExtension []Extension `bson:"modifierExtension,omitempty" json:"modifierExtension,omitempty"` - Description *string `bson:"description,omitempty" json:"description,omitempty"` - DefinitionReference Reference `bson:"definitionReference" json:"definitionReference"` - DefinitionCanonical string `bson:"definitionCanonical" json:"definitionCanonical"` - DefinitionCodeableConcept CodeableConcept `bson:"definitionCodeableConcept" json:"definitionCodeableConcept"` - DefinitionExpression Expression `bson:"definitionExpression" json:"definitionExpression"` - DefinitionDataRequirement DataRequirement `bson:"definitionDataRequirement" json:"definitionDataRequirement"` - DefinitionTriggerDefinition TriggerDefinition `bson:"definitionTriggerDefinition" json:"definitionTriggerDefinition"` - UsageContext []UsageContext `bson:"usageContext,omitempty" json:"usageContext,omitempty"` - Exclude *bool `bson:"exclude,omitempty" json:"exclude,omitempty"` - ParticipantEffectiveDateTime *string `bson:"participantEffectiveDateTime,omitempty" json:"participantEffectiveDateTime,omitempty"` - ParticipantEffectivePeriod *Period `bson:"participantEffectivePeriod,omitempty" json:"participantEffectivePeriod,omitempty"` - ParticipantEffectiveDuration *Duration `bson:"participantEffectiveDuration,omitempty" json:"participantEffectiveDuration,omitempty"` - ParticipantEffectiveTiming *Timing `bson:"participantEffectiveTiming,omitempty" json:"participantEffectiveTiming,omitempty"` - TimeFromStart *Duration `bson:"timeFromStart,omitempty" json:"timeFromStart,omitempty"` - GroupMeasure *GroupMeasure `bson:"groupMeasure,omitempty" json:"groupMeasure,omitempty"` + ID *string `bson:"id,omitempty" json:"id,omitempty"` + Extension []Extension `bson:"extension,omitempty" json:"extension,omitempty"` + ModifierExtension []Extension `bson:"modifierExtension,omitempty" json:"modifierExtension,omitempty"` + Description *string `bson:"description,omitempty" json:"description,omitempty"` + DefinitionReference *Reference `bson:"definitionReference,omitempty" json:"definitionReference,omitempty"` + DefinitionCanonical *string `bson:"definitionCanonical,omitempty" json:"definitionCanonical,omitempty"` + DefinitionCodeableConcept *CodeableConcept `bson:"definitionCodeableConcept,omitempty" json:"definitionCodeableConcept,omitempty"` + DefinitionExpression *Expression `bson:"definitionExpression,omitempty" json:"definitionExpression,omitempty"` + DefinitionDataRequirement *DataRequirement `bson:"definitionDataRequirement,omitempty" json:"definitionDataRequirement,omitempty"` + DefinitionTriggerDefinition *TriggerDefinition `bson:"definitionTriggerDefinition,omitempty" json:"definitionTriggerDefinition,omitempty"` + UsageContext []UsageContext `bson:"usageContext,omitempty" json:"usageContext,omitempty"` + Exclude *bool `bson:"exclude,omitempty" json:"exclude,omitempty"` + ParticipantEffectiveDateTime *string `bson:"participantEffectiveDateTime,omitempty" json:"participantEffectiveDateTime,omitempty"` + ParticipantEffectivePeriod *Period `bson:"participantEffectivePeriod,omitempty" json:"participantEffectivePeriod,omitempty"` + ParticipantEffectiveDuration *Duration `bson:"participantEffectiveDuration,omitempty" json:"participantEffectiveDuration,omitempty"` + ParticipantEffectiveTiming *Timing `bson:"participantEffectiveTiming,omitempty" json:"participantEffectiveTiming,omitempty"` + TimeFromStart *Duration `bson:"timeFromStart,omitempty" json:"timeFromStart,omitempty"` + GroupMeasure *GroupMeasure `bson:"groupMeasure,omitempty" json:"groupMeasure,omitempty"` } type OtherEvidenceVariable EvidenceVariable diff --git a/fhir-models/fhir/explanationOfBenefit.go b/fhir-models/fhir/explanationOfBenefit.go index 64daccfa..7f6a8a74 100644 --- a/fhir-models/fhir/explanationOfBenefit.go +++ b/fhir-models/fhir/explanationOfBenefit.go @@ -121,8 +121,8 @@ type ExplanationOfBenefitDiagnosis struct { Extension []Extension `bson:"extension,omitempty" json:"extension,omitempty"` ModifierExtension []Extension `bson:"modifierExtension,omitempty" json:"modifierExtension,omitempty"` Sequence int `bson:"sequence" json:"sequence"` - DiagnosisCodeableConcept CodeableConcept `bson:"diagnosisCodeableConcept" json:"diagnosisCodeableConcept"` - DiagnosisReference Reference `bson:"diagnosisReference" json:"diagnosisReference"` + DiagnosisCodeableConcept *CodeableConcept `bson:"diagnosisCodeableConcept,omitempty" json:"diagnosisCodeableConcept,omitempty"` + DiagnosisReference *Reference `bson:"diagnosisReference,omitempty" json:"diagnosisReference,omitempty"` Type []CodeableConcept `bson:"type,omitempty" json:"type,omitempty"` OnAdmission *CodeableConcept `bson:"onAdmission,omitempty" json:"onAdmission,omitempty"` PackageCode *CodeableConcept `bson:"packageCode,omitempty" json:"packageCode,omitempty"` @@ -134,8 +134,8 @@ type ExplanationOfBenefitProcedure struct { Sequence int `bson:"sequence" json:"sequence"` Type []CodeableConcept `bson:"type,omitempty" json:"type,omitempty"` Date *string `bson:"date,omitempty" json:"date,omitempty"` - ProcedureCodeableConcept CodeableConcept `bson:"procedureCodeableConcept" json:"procedureCodeableConcept"` - ProcedureReference Reference `bson:"procedureReference" json:"procedureReference"` + ProcedureCodeableConcept *CodeableConcept `bson:"procedureCodeableConcept,omitempty" json:"procedureCodeableConcept,omitempty"` + ProcedureReference *Reference `bson:"procedureReference,omitempty" json:"procedureReference,omitempty"` Udi []Reference `bson:"udi,omitempty" json:"udi,omitempty"` } type ExplanationOfBenefitInsurance struct { diff --git a/fhir-models/fhir/group.go b/fhir-models/fhir/group.go index 5eff761a..14d7ece1 100644 --- a/fhir-models/fhir/group.go +++ b/fhir-models/fhir/group.go @@ -43,17 +43,17 @@ type Group struct { Member []GroupMember `bson:"member,omitempty" json:"member,omitempty"` } type GroupCharacteristic struct { - ID *string `bson:"id,omitempty" json:"id,omitempty"` - Extension []Extension `bson:"extension,omitempty" json:"extension,omitempty"` - ModifierExtension []Extension `bson:"modifierExtension,omitempty" json:"modifierExtension,omitempty"` - Code CodeableConcept `bson:"code" json:"code"` - ValueCodeableConcept CodeableConcept `bson:"valueCodeableConcept" json:"valueCodeableConcept"` - ValueBoolean bool `bson:"valueBoolean" json:"valueBoolean"` - ValueQuantity Quantity `bson:"valueQuantity" json:"valueQuantity"` - ValueRange Range `bson:"valueRange" json:"valueRange"` - ValueReference Reference `bson:"valueReference" json:"valueReference"` - Exclude bool `bson:"exclude" json:"exclude"` - Period *Period `bson:"period,omitempty" json:"period,omitempty"` + ID *string `bson:"id,omitempty" json:"id,omitempty"` + Extension []Extension `bson:"extension,omitempty" json:"extension,omitempty"` + ModifierExtension []Extension `bson:"modifierExtension,omitempty" json:"modifierExtension,omitempty"` + Code CodeableConcept `bson:"code" json:"code"` + ValueCodeableConcept *CodeableConcept `bson:"valueCodeableConcept,omitempty" json:"valueCodeableConcept,omitempty"` + ValueBoolean *bool `bson:"valueBoolean,omitempty" json:"valueBoolean,omitempty"` + ValueQuantity *Quantity `bson:"valueQuantity,omitempty" json:"valueQuantity,omitempty"` + ValueRange *Range `bson:"valueRange,omitempty" json:"valueRange,omitempty"` + ValueReference *Reference `bson:"valueReference,omitempty" json:"valueReference,omitempty"` + Exclude bool `bson:"exclude" json:"exclude"` + Period *Period `bson:"period,omitempty" json:"period,omitempty"` } type GroupMember struct { ID *string `bson:"id,omitempty" json:"id,omitempty"` diff --git a/fhir-models/fhir/guidanceResponse.go b/fhir-models/fhir/guidanceResponse.go index 24e9b0a0..751fee4d 100644 --- a/fhir-models/fhir/guidanceResponse.go +++ b/fhir-models/fhir/guidanceResponse.go @@ -33,9 +33,9 @@ type GuidanceResponse struct { ModifierExtension []Extension `bson:"modifierExtension,omitempty" json:"modifierExtension,omitempty"` RequestIdentifier *Identifier `bson:"requestIdentifier,omitempty" json:"requestIdentifier,omitempty"` Identifier []Identifier `bson:"identifier,omitempty" json:"identifier,omitempty"` - ModuleUri string `bson:"moduleUri" json:"moduleUri"` - ModuleCanonical string `bson:"moduleCanonical" json:"moduleCanonical"` - ModuleCodeableConcept CodeableConcept `bson:"moduleCodeableConcept" json:"moduleCodeableConcept"` + ModuleUri *string `bson:"moduleUri,omitempty" json:"moduleUri,omitempty"` + ModuleCanonical *string `bson:"moduleCanonical,omitempty" json:"moduleCanonical,omitempty"` + ModuleCodeableConcept *CodeableConcept `bson:"moduleCodeableConcept,omitempty" json:"moduleCodeableConcept,omitempty"` Status GuidanceResponseStatus `bson:"status" json:"status"` Subject *Reference `bson:"subject,omitempty" json:"subject,omitempty"` Encounter *Reference `bson:"encounter,omitempty" json:"encounter,omitempty"` diff --git a/fhir-models/fhir/immunization.go b/fhir-models/fhir/immunization.go index c9791c78..038e5a5d 100644 --- a/fhir-models/fhir/immunization.go +++ b/fhir-models/fhir/immunization.go @@ -37,8 +37,8 @@ type Immunization struct { VaccineCode CodeableConcept `bson:"vaccineCode" json:"vaccineCode"` Patient Reference `bson:"patient" json:"patient"` Encounter *Reference `bson:"encounter,omitempty" json:"encounter,omitempty"` - OccurrenceDateTime string `bson:"occurrenceDateTime" json:"occurrenceDateTime"` - OccurrenceString string `bson:"occurrenceString" json:"occurrenceString"` + OccurrenceDateTime *string `bson:"occurrenceDateTime,omitempty" json:"occurrenceDateTime,omitempty"` + OccurrenceString *string `bson:"occurrenceString,omitempty" json:"occurrenceString,omitempty"` Recorded *string `bson:"recorded,omitempty" json:"recorded,omitempty"` PrimarySource *bool `bson:"primarySource,omitempty" json:"primarySource,omitempty"` ReportOrigin *CodeableConcept `bson:"reportOrigin,omitempty" json:"reportOrigin,omitempty"` @@ -92,8 +92,8 @@ type ImmunizationProtocolApplied struct { Series *string `bson:"series,omitempty" json:"series,omitempty"` Authority *Reference `bson:"authority,omitempty" json:"authority,omitempty"` TargetDisease []CodeableConcept `bson:"targetDisease,omitempty" json:"targetDisease,omitempty"` - DoseNumberPositiveInt int `bson:"doseNumberPositiveInt" json:"doseNumberPositiveInt"` - DoseNumberString string `bson:"doseNumberString" json:"doseNumberString"` + DoseNumberPositiveInt *int `bson:"doseNumberPositiveInt,omitempty" json:"doseNumberPositiveInt,omitempty"` + DoseNumberString *string `bson:"doseNumberString,omitempty" json:"doseNumberString,omitempty"` SeriesDosesPositiveInt *int `bson:"seriesDosesPositiveInt,omitempty" json:"seriesDosesPositiveInt,omitempty"` SeriesDosesString *string `bson:"seriesDosesString,omitempty" json:"seriesDosesString,omitempty"` } diff --git a/fhir-models/fhir/implementationGuide.go b/fhir-models/fhir/implementationGuide.go index b06e6c42..804d8dc2 100644 --- a/fhir-models/fhir/implementationGuide.go +++ b/fhir-models/fhir/implementationGuide.go @@ -100,8 +100,8 @@ type ImplementationGuideDefinitionPage struct { ID *string `bson:"id,omitempty" json:"id,omitempty"` Extension []Extension `bson:"extension,omitempty" json:"extension,omitempty"` ModifierExtension []Extension `bson:"modifierExtension,omitempty" json:"modifierExtension,omitempty"` - NameUrl string `bson:"nameUrl" json:"nameUrl"` - NameReference Reference `bson:"nameReference" json:"nameReference"` + NameUrl *string `bson:"nameUrl,omitempty" json:"nameUrl,omitempty"` + NameReference *Reference `bson:"nameReference,omitempty" json:"nameReference,omitempty"` Title string `bson:"title" json:"title"` Generation GuidePageGeneration `bson:"generation" json:"generation"` Page []ImplementationGuideDefinitionPage `bson:"page,omitempty" json:"page,omitempty"` diff --git a/fhir-models/fhir/invoice.go b/fhir-models/fhir/invoice.go index b1149f09..cafeb1aa 100644 --- a/fhir-models/fhir/invoice.go +++ b/fhir-models/fhir/invoice.go @@ -60,8 +60,8 @@ type InvoiceLineItem struct { Extension []Extension `bson:"extension,omitempty" json:"extension,omitempty"` ModifierExtension []Extension `bson:"modifierExtension,omitempty" json:"modifierExtension,omitempty"` Sequence *int `bson:"sequence,omitempty" json:"sequence,omitempty"` - ChargeItemReference Reference `bson:"chargeItemReference" json:"chargeItemReference"` - ChargeItemCodeableConcept CodeableConcept `bson:"chargeItemCodeableConcept" json:"chargeItemCodeableConcept"` + ChargeItemReference *Reference `bson:"chargeItemReference,omitempty" json:"chargeItemReference,omitempty"` + ChargeItemCodeableConcept *CodeableConcept `bson:"chargeItemCodeableConcept,omitempty" json:"chargeItemCodeableConcept,omitempty"` PriceComponent []InvoiceLineItemPriceComponent `bson:"priceComponent,omitempty" json:"priceComponent,omitempty"` } type InvoiceLineItemPriceComponent struct { diff --git a/fhir-models/fhir/medication.go b/fhir-models/fhir/medication.go index 9a79dd9a..667ba0cb 100644 --- a/fhir-models/fhir/medication.go +++ b/fhir-models/fhir/medication.go @@ -41,13 +41,13 @@ type Medication struct { Batch *MedicationBatch `bson:"batch,omitempty" json:"batch,omitempty"` } type MedicationIngredient struct { - ID *string `bson:"id,omitempty" json:"id,omitempty"` - Extension []Extension `bson:"extension,omitempty" json:"extension,omitempty"` - ModifierExtension []Extension `bson:"modifierExtension,omitempty" json:"modifierExtension,omitempty"` - ItemCodeableConcept CodeableConcept `bson:"itemCodeableConcept" json:"itemCodeableConcept"` - ItemReference Reference `bson:"itemReference" json:"itemReference"` - IsActive *bool `bson:"isActive,omitempty" json:"isActive,omitempty"` - Strength *Ratio `bson:"strength,omitempty" json:"strength,omitempty"` + ID *string `bson:"id,omitempty" json:"id,omitempty"` + Extension []Extension `bson:"extension,omitempty" json:"extension,omitempty"` + ModifierExtension []Extension `bson:"modifierExtension,omitempty" json:"modifierExtension,omitempty"` + ItemCodeableConcept *CodeableConcept `bson:"itemCodeableConcept,omitempty" json:"itemCodeableConcept,omitempty"` + ItemReference *Reference `bson:"itemReference,omitempty" json:"itemReference,omitempty"` + IsActive *bool `bson:"isActive,omitempty" json:"isActive,omitempty"` + Strength *Ratio `bson:"strength,omitempty" json:"strength,omitempty"` } type MedicationBatch struct { ID *string `bson:"id,omitempty" json:"id,omitempty"` diff --git a/fhir-models/fhir/medicationAdministration.go b/fhir-models/fhir/medicationAdministration.go index a819d4ae..56e311ed 100644 --- a/fhir-models/fhir/medicationAdministration.go +++ b/fhir-models/fhir/medicationAdministration.go @@ -37,13 +37,13 @@ type MedicationAdministration struct { Status string `bson:"status" json:"status"` StatusReason []CodeableConcept `bson:"statusReason,omitempty" json:"statusReason,omitempty"` Category *CodeableConcept `bson:"category,omitempty" json:"category,omitempty"` - MedicationCodeableConcept CodeableConcept `bson:"medicationCodeableConcept" json:"medicationCodeableConcept"` - MedicationReference Reference `bson:"medicationReference" json:"medicationReference"` + MedicationCodeableConcept *CodeableConcept `bson:"medicationCodeableConcept,omitempty" json:"medicationCodeableConcept,omitempty"` + MedicationReference *Reference `bson:"medicationReference,omitempty" json:"medicationReference,omitempty"` Subject Reference `bson:"subject" json:"subject"` Context *Reference `bson:"context,omitempty" json:"context,omitempty"` SupportingInformation []Reference `bson:"supportingInformation,omitempty" json:"supportingInformation,omitempty"` - EffectiveDateTime string `bson:"effectiveDateTime" json:"effectiveDateTime"` - EffectivePeriod Period `bson:"effectivePeriod" json:"effectivePeriod"` + EffectiveDateTime *string `bson:"effectiveDateTime,omitempty" json:"effectiveDateTime,omitempty"` + EffectivePeriod *Period `bson:"effectivePeriod,omitempty" json:"effectivePeriod,omitempty"` Performer []MedicationAdministrationPerformer `bson:"performer,omitempty" json:"performer,omitempty"` ReasonCode []CodeableConcept `bson:"reasonCode,omitempty" json:"reasonCode,omitempty"` ReasonReference []Reference `bson:"reasonReference,omitempty" json:"reasonReference,omitempty"` diff --git a/fhir-models/fhir/medicationDispense.go b/fhir-models/fhir/medicationDispense.go index a14fb3ae..52e9186a 100644 --- a/fhir-models/fhir/medicationDispense.go +++ b/fhir-models/fhir/medicationDispense.go @@ -37,8 +37,8 @@ type MedicationDispense struct { StatusReasonCodeableConcept *CodeableConcept `bson:"statusReasonCodeableConcept,omitempty" json:"statusReasonCodeableConcept,omitempty"` StatusReasonReference *Reference `bson:"statusReasonReference,omitempty" json:"statusReasonReference,omitempty"` Category *CodeableConcept `bson:"category,omitempty" json:"category,omitempty"` - MedicationCodeableConcept CodeableConcept `bson:"medicationCodeableConcept" json:"medicationCodeableConcept"` - MedicationReference Reference `bson:"medicationReference" json:"medicationReference"` + MedicationCodeableConcept *CodeableConcept `bson:"medicationCodeableConcept,omitempty" json:"medicationCodeableConcept,omitempty"` + MedicationReference *Reference `bson:"medicationReference,omitempty" json:"medicationReference,omitempty"` Subject *Reference `bson:"subject,omitempty" json:"subject,omitempty"` Context *Reference `bson:"context,omitempty" json:"context,omitempty"` SupportingInformation []Reference `bson:"supportingInformation,omitempty" json:"supportingInformation,omitempty"` diff --git a/fhir-models/fhir/medicationKnowledge.go b/fhir-models/fhir/medicationKnowledge.go index 121335f5..dd8c1e41 100644 --- a/fhir-models/fhir/medicationKnowledge.go +++ b/fhir-models/fhir/medicationKnowledge.go @@ -69,13 +69,13 @@ type MedicationKnowledgeMonograph struct { Source *Reference `bson:"source,omitempty" json:"source,omitempty"` } type MedicationKnowledgeIngredient struct { - ID *string `bson:"id,omitempty" json:"id,omitempty"` - Extension []Extension `bson:"extension,omitempty" json:"extension,omitempty"` - ModifierExtension []Extension `bson:"modifierExtension,omitempty" json:"modifierExtension,omitempty"` - ItemCodeableConcept CodeableConcept `bson:"itemCodeableConcept" json:"itemCodeableConcept"` - ItemReference Reference `bson:"itemReference" json:"itemReference"` - IsActive *bool `bson:"isActive,omitempty" json:"isActive,omitempty"` - Strength *Ratio `bson:"strength,omitempty" json:"strength,omitempty"` + ID *string `bson:"id,omitempty" json:"id,omitempty"` + Extension []Extension `bson:"extension,omitempty" json:"extension,omitempty"` + ModifierExtension []Extension `bson:"modifierExtension,omitempty" json:"modifierExtension,omitempty"` + ItemCodeableConcept *CodeableConcept `bson:"itemCodeableConcept,omitempty" json:"itemCodeableConcept,omitempty"` + ItemReference *Reference `bson:"itemReference,omitempty" json:"itemReference,omitempty"` + IsActive *bool `bson:"isActive,omitempty" json:"isActive,omitempty"` + Strength *Ratio `bson:"strength,omitempty" json:"strength,omitempty"` } type MedicationKnowledgeCost struct { ID *string `bson:"id,omitempty" json:"id,omitempty"` @@ -109,12 +109,12 @@ type MedicationKnowledgeAdministrationGuidelinesDosage struct { Dosage []Dosage `bson:"dosage" json:"dosage"` } type MedicationKnowledgeAdministrationGuidelinesPatientCharacteristics struct { - ID *string `bson:"id,omitempty" json:"id,omitempty"` - Extension []Extension `bson:"extension,omitempty" json:"extension,omitempty"` - ModifierExtension []Extension `bson:"modifierExtension,omitempty" json:"modifierExtension,omitempty"` - CharacteristicCodeableConcept CodeableConcept `bson:"characteristicCodeableConcept" json:"characteristicCodeableConcept"` - CharacteristicQuantity Quantity `bson:"characteristicQuantity" json:"characteristicQuantity"` - Value []string `bson:"value,omitempty" json:"value,omitempty"` + ID *string `bson:"id,omitempty" json:"id,omitempty"` + Extension []Extension `bson:"extension,omitempty" json:"extension,omitempty"` + ModifierExtension []Extension `bson:"modifierExtension,omitempty" json:"modifierExtension,omitempty"` + CharacteristicCodeableConcept *CodeableConcept `bson:"characteristicCodeableConcept,omitempty" json:"characteristicCodeableConcept,omitempty"` + CharacteristicQuantity *Quantity `bson:"characteristicQuantity,omitempty" json:"characteristicQuantity,omitempty"` + Value []string `bson:"value,omitempty" json:"value,omitempty"` } type MedicationKnowledgeMedicineClassification struct { ID *string `bson:"id,omitempty" json:"id,omitempty"` diff --git a/fhir-models/fhir/medicationRequest.go b/fhir-models/fhir/medicationRequest.go index 0deadf51..4af1c7dd 100644 --- a/fhir-models/fhir/medicationRequest.go +++ b/fhir-models/fhir/medicationRequest.go @@ -40,8 +40,8 @@ type MedicationRequest struct { DoNotPerform *bool `bson:"doNotPerform,omitempty" json:"doNotPerform,omitempty"` ReportedBoolean *bool `bson:"reportedBoolean,omitempty" json:"reportedBoolean,omitempty"` ReportedReference *Reference `bson:"reportedReference,omitempty" json:"reportedReference,omitempty"` - MedicationCodeableConcept CodeableConcept `bson:"medicationCodeableConcept" json:"medicationCodeableConcept"` - MedicationReference Reference `bson:"medicationReference" json:"medicationReference"` + MedicationCodeableConcept *CodeableConcept `bson:"medicationCodeableConcept,omitempty" json:"medicationCodeableConcept,omitempty"` + MedicationReference *Reference `bson:"medicationReference,omitempty" json:"medicationReference,omitempty"` Subject Reference `bson:"subject" json:"subject"` Encounter *Reference `bson:"encounter,omitempty" json:"encounter,omitempty"` SupportingInformation []Reference `bson:"supportingInformation,omitempty" json:"supportingInformation,omitempty"` @@ -89,8 +89,8 @@ type MedicationRequestSubstitution struct { ID *string `bson:"id,omitempty" json:"id,omitempty"` Extension []Extension `bson:"extension,omitempty" json:"extension,omitempty"` ModifierExtension []Extension `bson:"modifierExtension,omitempty" json:"modifierExtension,omitempty"` - AllowedBoolean bool `bson:"allowedBoolean" json:"allowedBoolean"` - AllowedCodeableConcept CodeableConcept `bson:"allowedCodeableConcept" json:"allowedCodeableConcept"` + AllowedBoolean *bool `bson:"allowedBoolean,omitempty" json:"allowedBoolean,omitempty"` + AllowedCodeableConcept *CodeableConcept `bson:"allowedCodeableConcept,omitempty" json:"allowedCodeableConcept,omitempty"` Reason *CodeableConcept `bson:"reason,omitempty" json:"reason,omitempty"` } type OtherMedicationRequest MedicationRequest diff --git a/fhir-models/fhir/medicationStatement.go b/fhir-models/fhir/medicationStatement.go index 2cfc8958..5b38675d 100644 --- a/fhir-models/fhir/medicationStatement.go +++ b/fhir-models/fhir/medicationStatement.go @@ -37,8 +37,8 @@ type MedicationStatement struct { Status string `bson:"status" json:"status"` StatusReason []CodeableConcept `bson:"statusReason,omitempty" json:"statusReason,omitempty"` Category *CodeableConcept `bson:"category,omitempty" json:"category,omitempty"` - MedicationCodeableConcept CodeableConcept `bson:"medicationCodeableConcept" json:"medicationCodeableConcept"` - MedicationReference Reference `bson:"medicationReference" json:"medicationReference"` + MedicationCodeableConcept *CodeableConcept `bson:"medicationCodeableConcept,omitempty" json:"medicationCodeableConcept,omitempty"` + MedicationReference *Reference `bson:"medicationReference,omitempty" json:"medicationReference,omitempty"` Subject Reference `bson:"subject" json:"subject"` Context *Reference `bson:"context,omitempty" json:"context,omitempty"` EffectiveDateTime *string `bson:"effectiveDateTime,omitempty" json:"effectiveDateTime,omitempty"` diff --git a/fhir-models/fhir/medicinalProductContraindication.go b/fhir-models/fhir/medicinalProductContraindication.go index e169efd7..6d66b458 100644 --- a/fhir-models/fhir/medicinalProductContraindication.go +++ b/fhir-models/fhir/medicinalProductContraindication.go @@ -40,12 +40,12 @@ type MedicinalProductContraindication struct { Population []Population `bson:"population,omitempty" json:"population,omitempty"` } type MedicinalProductContraindicationOtherTherapy struct { - ID *string `bson:"id,omitempty" json:"id,omitempty"` - Extension []Extension `bson:"extension,omitempty" json:"extension,omitempty"` - ModifierExtension []Extension `bson:"modifierExtension,omitempty" json:"modifierExtension,omitempty"` - TherapyRelationshipType CodeableConcept `bson:"therapyRelationshipType" json:"therapyRelationshipType"` - MedicationCodeableConcept CodeableConcept `bson:"medicationCodeableConcept" json:"medicationCodeableConcept"` - MedicationReference Reference `bson:"medicationReference" json:"medicationReference"` + ID *string `bson:"id,omitempty" json:"id,omitempty"` + Extension []Extension `bson:"extension,omitempty" json:"extension,omitempty"` + ModifierExtension []Extension `bson:"modifierExtension,omitempty" json:"modifierExtension,omitempty"` + TherapyRelationshipType CodeableConcept `bson:"therapyRelationshipType" json:"therapyRelationshipType"` + MedicationCodeableConcept *CodeableConcept `bson:"medicationCodeableConcept,omitempty" json:"medicationCodeableConcept,omitempty"` + MedicationReference *Reference `bson:"medicationReference,omitempty" json:"medicationReference,omitempty"` } type OtherMedicinalProductContraindication MedicinalProductContraindication diff --git a/fhir-models/fhir/medicinalProductIndication.go b/fhir-models/fhir/medicinalProductIndication.go index 15ccd899..fbb95aee 100644 --- a/fhir-models/fhir/medicinalProductIndication.go +++ b/fhir-models/fhir/medicinalProductIndication.go @@ -42,12 +42,12 @@ type MedicinalProductIndication struct { Population []Population `bson:"population,omitempty" json:"population,omitempty"` } type MedicinalProductIndicationOtherTherapy struct { - ID *string `bson:"id,omitempty" json:"id,omitempty"` - Extension []Extension `bson:"extension,omitempty" json:"extension,omitempty"` - ModifierExtension []Extension `bson:"modifierExtension,omitempty" json:"modifierExtension,omitempty"` - TherapyRelationshipType CodeableConcept `bson:"therapyRelationshipType" json:"therapyRelationshipType"` - MedicationCodeableConcept CodeableConcept `bson:"medicationCodeableConcept" json:"medicationCodeableConcept"` - MedicationReference Reference `bson:"medicationReference" json:"medicationReference"` + ID *string `bson:"id,omitempty" json:"id,omitempty"` + Extension []Extension `bson:"extension,omitempty" json:"extension,omitempty"` + ModifierExtension []Extension `bson:"modifierExtension,omitempty" json:"modifierExtension,omitempty"` + TherapyRelationshipType CodeableConcept `bson:"therapyRelationshipType" json:"therapyRelationshipType"` + MedicationCodeableConcept *CodeableConcept `bson:"medicationCodeableConcept,omitempty" json:"medicationCodeableConcept,omitempty"` + MedicationReference *Reference `bson:"medicationReference,omitempty" json:"medicationReference,omitempty"` } type OtherMedicinalProductIndication MedicinalProductIndication diff --git a/fhir-models/fhir/medicinalProductInteraction.go b/fhir-models/fhir/medicinalProductInteraction.go index 1a4bb6dc..fb93f7c7 100644 --- a/fhir-models/fhir/medicinalProductInteraction.go +++ b/fhir-models/fhir/medicinalProductInteraction.go @@ -40,11 +40,11 @@ type MedicinalProductInteraction struct { Management *CodeableConcept `bson:"management,omitempty" json:"management,omitempty"` } type MedicinalProductInteractionInteractant struct { - ID *string `bson:"id,omitempty" json:"id,omitempty"` - Extension []Extension `bson:"extension,omitempty" json:"extension,omitempty"` - ModifierExtension []Extension `bson:"modifierExtension,omitempty" json:"modifierExtension,omitempty"` - ItemReference Reference `bson:"itemReference" json:"itemReference"` - ItemCodeableConcept CodeableConcept `bson:"itemCodeableConcept" json:"itemCodeableConcept"` + ID *string `bson:"id,omitempty" json:"id,omitempty"` + Extension []Extension `bson:"extension,omitempty" json:"extension,omitempty"` + ModifierExtension []Extension `bson:"modifierExtension,omitempty" json:"modifierExtension,omitempty"` + ItemReference *Reference `bson:"itemReference,omitempty" json:"itemReference,omitempty"` + ItemCodeableConcept *CodeableConcept `bson:"itemCodeableConcept,omitempty" json:"itemCodeableConcept,omitempty"` } type OtherMedicinalProductInteraction MedicinalProductInteraction diff --git a/fhir-models/fhir/messageDefinition.go b/fhir-models/fhir/messageDefinition.go index 805e883d..52adb05a 100644 --- a/fhir-models/fhir/messageDefinition.go +++ b/fhir-models/fhir/messageDefinition.go @@ -49,8 +49,8 @@ type MessageDefinition struct { Copyright *string `bson:"copyright,omitempty" json:"copyright,omitempty"` Base *string `bson:"base,omitempty" json:"base,omitempty"` Parent []string `bson:"parent,omitempty" json:"parent,omitempty"` - EventCoding Coding `bson:"eventCoding" json:"eventCoding"` - EventUri string `bson:"eventUri" json:"eventUri"` + EventCoding *Coding `bson:"eventCoding,omitempty" json:"eventCoding,omitempty"` + EventUri *string `bson:"eventUri,omitempty" json:"eventUri,omitempty"` Category *MessageSignificanceCategory `bson:"category,omitempty" json:"category,omitempty"` Focus []MessageDefinitionFocus `bson:"focus,omitempty" json:"focus,omitempty"` ResponseRequired *string `bson:"responseRequired,omitempty" json:"responseRequired,omitempty"` diff --git a/fhir-models/fhir/messageHeader.go b/fhir-models/fhir/messageHeader.go index d811672b..cdeac190 100644 --- a/fhir-models/fhir/messageHeader.go +++ b/fhir-models/fhir/messageHeader.go @@ -31,8 +31,8 @@ type MessageHeader struct { Text *Narrative `bson:"text,omitempty" json:"text,omitempty"` Extension []Extension `bson:"extension,omitempty" json:"extension,omitempty"` ModifierExtension []Extension `bson:"modifierExtension,omitempty" json:"modifierExtension,omitempty"` - EventCoding Coding `bson:"eventCoding" json:"eventCoding"` - EventUri string `bson:"eventUri" json:"eventUri"` + EventCoding *Coding `bson:"eventCoding,omitempty" json:"eventCoding,omitempty"` + EventUri *string `bson:"eventUri,omitempty" json:"eventUri,omitempty"` Destination []MessageHeaderDestination `bson:"destination,omitempty" json:"destination,omitempty"` Sender *Reference `bson:"sender,omitempty" json:"sender,omitempty"` Enterer *Reference `bson:"enterer,omitempty" json:"enterer,omitempty"` diff --git a/fhir-models/fhir/questionnaire.go b/fhir-models/fhir/questionnaire.go index 2d228b02..b5ed38e5 100644 --- a/fhir-models/fhir/questionnaire.go +++ b/fhir-models/fhir/questionnaire.go @@ -81,45 +81,45 @@ type QuestionnaireItemEnableWhen struct { ModifierExtension []Extension `bson:"modifierExtension,omitempty" json:"modifierExtension,omitempty"` Question string `bson:"question" json:"question"` Operator QuestionnaireItemOperator `bson:"operator" json:"operator"` - AnswerBoolean bool `bson:"answerBoolean" json:"answerBoolean"` - AnswerDecimal float64 `bson:"answerDecimal" json:"answerDecimal"` - AnswerInteger int `bson:"answerInteger" json:"answerInteger"` - AnswerDate string `bson:"answerDate" json:"answerDate"` - AnswerDateTime string `bson:"answerDateTime" json:"answerDateTime"` - AnswerTime string `bson:"answerTime" json:"answerTime"` - AnswerString string `bson:"answerString" json:"answerString"` - AnswerCoding Coding `bson:"answerCoding" json:"answerCoding"` - AnswerQuantity Quantity `bson:"answerQuantity" json:"answerQuantity"` - AnswerReference Reference `bson:"answerReference" json:"answerReference"` + AnswerBoolean *bool `bson:"answerBoolean,omitempty" json:"answerBoolean,omitempty"` + AnswerDecimal *float64 `bson:"answerDecimal,omitempty" json:"answerDecimal,omitempty"` + AnswerInteger *int `bson:"answerInteger,omitempty" json:"answerInteger,omitempty"` + AnswerDate *string `bson:"answerDate,omitempty" json:"answerDate,omitempty"` + AnswerDateTime *string `bson:"answerDateTime,omitempty" json:"answerDateTime,omitempty"` + AnswerTime *string `bson:"answerTime,omitempty" json:"answerTime,omitempty"` + AnswerString *string `bson:"answerString,omitempty" json:"answerString,omitempty"` + AnswerCoding *Coding `bson:"answerCoding,omitempty" json:"answerCoding,omitempty"` + AnswerQuantity *Quantity `bson:"answerQuantity,omitempty" json:"answerQuantity,omitempty"` + AnswerReference *Reference `bson:"answerReference,omitempty" json:"answerReference,omitempty"` } type QuestionnaireItemAnswerOption struct { ID *string `bson:"id,omitempty" json:"id,omitempty"` Extension []Extension `bson:"extension,omitempty" json:"extension,omitempty"` ModifierExtension []Extension `bson:"modifierExtension,omitempty" json:"modifierExtension,omitempty"` - ValueInteger int `bson:"valueInteger" json:"valueInteger"` - ValueDate string `bson:"valueDate" json:"valueDate"` - ValueTime string `bson:"valueTime" json:"valueTime"` - ValueString string `bson:"valueString" json:"valueString"` - ValueCoding Coding `bson:"valueCoding" json:"valueCoding"` - ValueReference Reference `bson:"valueReference" json:"valueReference"` + ValueInteger *int `bson:"valueInteger,omitempty" json:"valueInteger,omitempty"` + ValueDate *string `bson:"valueDate,omitempty" json:"valueDate,omitempty"` + ValueTime *string `bson:"valueTime,omitempty" json:"valueTime,omitempty"` + ValueString *string `bson:"valueString,omitempty" json:"valueString,omitempty"` + ValueCoding *Coding `bson:"valueCoding,omitempty" json:"valueCoding,omitempty"` + ValueReference *Reference `bson:"valueReference,omitempty" json:"valueReference,omitempty"` InitialSelected *bool `bson:"initialSelected,omitempty" json:"initialSelected,omitempty"` } type QuestionnaireItemInitial struct { ID *string `bson:"id,omitempty" json:"id,omitempty"` Extension []Extension `bson:"extension,omitempty" json:"extension,omitempty"` ModifierExtension []Extension `bson:"modifierExtension,omitempty" json:"modifierExtension,omitempty"` - ValueBoolean bool `bson:"valueBoolean" json:"valueBoolean"` - ValueDecimal float64 `bson:"valueDecimal" json:"valueDecimal"` - ValueInteger int `bson:"valueInteger" json:"valueInteger"` - ValueDate string `bson:"valueDate" json:"valueDate"` - ValueDateTime string `bson:"valueDateTime" json:"valueDateTime"` - ValueTime string `bson:"valueTime" json:"valueTime"` - ValueString string `bson:"valueString" json:"valueString"` - ValueUri string `bson:"valueUri" json:"valueUri"` - ValueAttachment Attachment `bson:"valueAttachment" json:"valueAttachment"` - ValueCoding Coding `bson:"valueCoding" json:"valueCoding"` - ValueQuantity Quantity `bson:"valueQuantity" json:"valueQuantity"` - ValueReference Reference `bson:"valueReference" json:"valueReference"` + ValueBoolean *bool `bson:"valueBoolean,omitempty" json:"valueBoolean,omitempty"` + ValueDecimal *float64 `bson:"valueDecimal,omitempty" json:"valueDecimal,omitempty"` + ValueInteger *int `bson:"valueInteger,omitempty" json:"valueInteger,omitempty"` + ValueDate *string `bson:"valueDate,omitempty" json:"valueDate,omitempty"` + ValueDateTime *string `bson:"valueDateTime,omitempty" json:"valueDateTime,omitempty"` + ValueTime *string `bson:"valueTime,omitempty" json:"valueTime,omitempty"` + ValueString *string `bson:"valueString,omitempty" json:"valueString,omitempty"` + ValueUri *string `bson:"valueUri,omitempty" json:"valueUri,omitempty"` + ValueAttachment *Attachment `bson:"valueAttachment,omitempty" json:"valueAttachment,omitempty"` + ValueCoding *Coding `bson:"valueCoding,omitempty" json:"valueCoding,omitempty"` + ValueQuantity *Quantity `bson:"valueQuantity,omitempty" json:"valueQuantity,omitempty"` + ValueReference *Reference `bson:"valueReference,omitempty" json:"valueReference,omitempty"` } type OtherQuestionnaire Questionnaire diff --git a/fhir-models/fhir/researchElementDefinition.go b/fhir-models/fhir/researchElementDefinition.go index 18c5a607..10bf2cfc 100644 --- a/fhir-models/fhir/researchElementDefinition.go +++ b/fhir-models/fhir/researchElementDefinition.go @@ -70,10 +70,10 @@ type ResearchElementDefinitionCharacteristic struct { ID *string `bson:"id,omitempty" json:"id,omitempty"` Extension []Extension `bson:"extension,omitempty" json:"extension,omitempty"` ModifierExtension []Extension `bson:"modifierExtension,omitempty" json:"modifierExtension,omitempty"` - DefinitionCodeableConcept CodeableConcept `bson:"definitionCodeableConcept" json:"definitionCodeableConcept"` - DefinitionCanonical string `bson:"definitionCanonical" json:"definitionCanonical"` - DefinitionExpression Expression `bson:"definitionExpression" json:"definitionExpression"` - DefinitionDataRequirement DataRequirement `bson:"definitionDataRequirement" json:"definitionDataRequirement"` + DefinitionCodeableConcept *CodeableConcept `bson:"definitionCodeableConcept,omitempty" json:"definitionCodeableConcept,omitempty"` + DefinitionCanonical *string `bson:"definitionCanonical,omitempty" json:"definitionCanonical,omitempty"` + DefinitionExpression *Expression `bson:"definitionExpression,omitempty" json:"definitionExpression,omitempty"` + DefinitionDataRequirement *DataRequirement `bson:"definitionDataRequirement,omitempty" json:"definitionDataRequirement,omitempty"` UsageContext []UsageContext `bson:"usageContext,omitempty" json:"usageContext,omitempty"` Exclude *bool `bson:"exclude,omitempty" json:"exclude,omitempty"` UnitOfMeasure *CodeableConcept `bson:"unitOfMeasure,omitempty" json:"unitOfMeasure,omitempty"` diff --git a/fhir-models/fhir/specimenDefinition.go b/fhir-models/fhir/specimenDefinition.go index b5df7a28..7de506a4 100644 --- a/fhir-models/fhir/specimenDefinition.go +++ b/fhir-models/fhir/specimenDefinition.go @@ -66,11 +66,11 @@ type SpecimenDefinitionTypeTestedContainer struct { Preparation *string `bson:"preparation,omitempty" json:"preparation,omitempty"` } type SpecimenDefinitionTypeTestedContainerAdditive struct { - ID *string `bson:"id,omitempty" json:"id,omitempty"` - Extension []Extension `bson:"extension,omitempty" json:"extension,omitempty"` - ModifierExtension []Extension `bson:"modifierExtension,omitempty" json:"modifierExtension,omitempty"` - AdditiveCodeableConcept CodeableConcept `bson:"additiveCodeableConcept" json:"additiveCodeableConcept"` - AdditiveReference Reference `bson:"additiveReference" json:"additiveReference"` + ID *string `bson:"id,omitempty" json:"id,omitempty"` + Extension []Extension `bson:"extension,omitempty" json:"extension,omitempty"` + ModifierExtension []Extension `bson:"modifierExtension,omitempty" json:"modifierExtension,omitempty"` + AdditiveCodeableConcept *CodeableConcept `bson:"additiveCodeableConcept,omitempty" json:"additiveCodeableConcept,omitempty"` + AdditiveReference *Reference `bson:"additiveReference,omitempty" json:"additiveReference,omitempty"` } type SpecimenDefinitionTypeTestedHandling struct { ID *string `bson:"id,omitempty" json:"id,omitempty"` diff --git a/fhir-models/fhir/structureMap.go b/fhir-models/fhir/structureMap.go index 278ddb77..400b8c6c 100644 --- a/fhir-models/fhir/structureMap.go +++ b/fhir-models/fhir/structureMap.go @@ -172,11 +172,11 @@ type StructureMapGroupRuleTargetParameter struct { ID *string `bson:"id,omitempty" json:"id,omitempty"` Extension []Extension `bson:"extension,omitempty" json:"extension,omitempty"` ModifierExtension []Extension `bson:"modifierExtension,omitempty" json:"modifierExtension,omitempty"` - ValueID string `bson:"valueID" json:"valueID"` - ValueString string `bson:"valueString" json:"valueString"` - ValueBoolean bool `bson:"valueBoolean" json:"valueBoolean"` - ValueInteger int `bson:"valueInteger" json:"valueInteger"` - ValueDecimal float64 `bson:"valueDecimal" json:"valueDecimal"` + ValueID *string `bson:"valueID,omitempty" json:"valueID,omitempty"` + ValueString *string `bson:"valueString,omitempty" json:"valueString,omitempty"` + ValueBoolean *bool `bson:"valueBoolean,omitempty" json:"valueBoolean,omitempty"` + ValueInteger *int `bson:"valueInteger,omitempty" json:"valueInteger,omitempty"` + ValueDecimal *float64 `bson:"valueDecimal,omitempty" json:"valueDecimal,omitempty"` } type StructureMapGroupRuleDependent struct { ID *string `bson:"id,omitempty" json:"id,omitempty"` diff --git a/fhir-models/fhir/structureMapTransform.go b/fhir-models/fhir/structureMapTransform.go index 31cd5706..9d5b5bca 100644 --- a/fhir-models/fhir/structureMapTransform.go +++ b/fhir-models/fhir/structureMapTransform.go @@ -43,7 +43,7 @@ const ( StructureMapTransformCc StructureMapTransformC StructureMapTransformQty - StructureMapTransformID + StructureMapTransformId StructureMapTransformCp ) @@ -88,7 +88,7 @@ func (code *StructureMapTransform) UnmarshalJSON(json []byte) error { case "qty": *code = StructureMapTransformQty case "id": - *code = StructureMapTransformID + *code = StructureMapTransformId case "cp": *code = StructureMapTransformCp default: @@ -131,7 +131,7 @@ func (code StructureMapTransform) Code() string { return "c" case StructureMapTransformQty: return "qty" - case StructureMapTransformID: + case StructureMapTransformId: return "id" case StructureMapTransformCp: return "cp" @@ -170,7 +170,7 @@ func (code StructureMapTransform) Display() string { return "c" case StructureMapTransformQty: return "qty" - case StructureMapTransformID: + case StructureMapTransformId: return "id" case StructureMapTransformCp: return "cp" @@ -209,7 +209,7 @@ func (code StructureMapTransform) Definition() string { return "Create a Coding. Parameters = (system. Code[, display])." case StructureMapTransformQty: return "Create a quantity. Parameters = (text) or (value, unit, [system, code]) where text is the natural representation e.g. [comparator]value[space]unit." - case StructureMapTransformID: + case StructureMapTransformId: return "Create an identifier. Parameters = (system, value[, type]) where type is a code from the identifier type value set." case StructureMapTransformCp: return "Create a contact details. Parameters = (value) or (system, value). If no system is provided, the system should be inferred from the content of the value." diff --git a/fhir-models/fhir/substance.go b/fhir-models/fhir/substance.go index a6e080af..2cd3b62b 100644 --- a/fhir-models/fhir/substance.go +++ b/fhir-models/fhir/substance.go @@ -48,12 +48,12 @@ type SubstanceInstance struct { Quantity *Quantity `bson:"quantity,omitempty" json:"quantity,omitempty"` } type SubstanceIngredient struct { - ID *string `bson:"id,omitempty" json:"id,omitempty"` - Extension []Extension `bson:"extension,omitempty" json:"extension,omitempty"` - ModifierExtension []Extension `bson:"modifierExtension,omitempty" json:"modifierExtension,omitempty"` - Quantity *Ratio `bson:"quantity,omitempty" json:"quantity,omitempty"` - SubstanceCodeableConcept CodeableConcept `bson:"substanceCodeableConcept" json:"substanceCodeableConcept"` - SubstanceReference Reference `bson:"substanceReference" json:"substanceReference"` + ID *string `bson:"id,omitempty" json:"id,omitempty"` + Extension []Extension `bson:"extension,omitempty" json:"extension,omitempty"` + ModifierExtension []Extension `bson:"modifierExtension,omitempty" json:"modifierExtension,omitempty"` + Quantity *Ratio `bson:"quantity,omitempty" json:"quantity,omitempty"` + SubstanceCodeableConcept *CodeableConcept `bson:"substanceCodeableConcept,omitempty" json:"substanceCodeableConcept,omitempty"` + SubstanceReference *Reference `bson:"substanceReference,omitempty" json:"substanceReference,omitempty"` } type OtherSubstance Substance diff --git a/fhir-models/fhir/supplyRequest.go b/fhir-models/fhir/supplyRequest.go index 7540a8c6..b3fec266 100644 --- a/fhir-models/fhir/supplyRequest.go +++ b/fhir-models/fhir/supplyRequest.go @@ -35,8 +35,8 @@ type SupplyRequest struct { Status *SupplyRequestStatus `bson:"status,omitempty" json:"status,omitempty"` Category *CodeableConcept `bson:"category,omitempty" json:"category,omitempty"` Priority *RequestPriority `bson:"priority,omitempty" json:"priority,omitempty"` - ItemCodeableConcept CodeableConcept `bson:"itemCodeableConcept" json:"itemCodeableConcept"` - ItemReference Reference `bson:"itemReference" json:"itemReference"` + ItemCodeableConcept *CodeableConcept `bson:"itemCodeableConcept,omitempty" json:"itemCodeableConcept,omitempty"` + ItemReference *Reference `bson:"itemReference,omitempty" json:"itemReference,omitempty"` Quantity Quantity `bson:"quantity" json:"quantity"` Parameter []SupplyRequestParameter `bson:"parameter,omitempty" json:"parameter,omitempty"` OccurrenceDateTime *string `bson:"occurrenceDateTime,omitempty" json:"occurrenceDateTime,omitempty"` diff --git a/fhir-models/fhir/task.go b/fhir-models/fhir/task.go index 954c1ec9..48446e8d 100644 --- a/fhir-models/fhir/task.go +++ b/fhir-models/fhir/task.go @@ -72,116 +72,116 @@ type TaskRestriction struct { Recipient []Reference `bson:"recipient,omitempty" json:"recipient,omitempty"` } type TaskInput struct { - ID *string `bson:"id,omitempty" json:"id,omitempty"` - Extension []Extension `bson:"extension,omitempty" json:"extension,omitempty"` - ModifierExtension []Extension `bson:"modifierExtension,omitempty" json:"modifierExtension,omitempty"` - Type CodeableConcept `bson:"type" json:"type"` - ValueBase64Binary string `bson:"valueBase64Binary" json:"valueBase64Binary"` - ValueBoolean bool `bson:"valueBoolean" json:"valueBoolean"` - ValueCanonical string `bson:"valueCanonical" json:"valueCanonical"` - ValueCode string `bson:"valueCode" json:"valueCode"` - ValueDate string `bson:"valueDate" json:"valueDate"` - ValueDateTime string `bson:"valueDateTime" json:"valueDateTime"` - ValueDecimal float64 `bson:"valueDecimal" json:"valueDecimal"` - ValueID string `bson:"valueID" json:"valueID"` - ValueInstant string `bson:"valueInstant" json:"valueInstant"` - ValueInteger int `bson:"valueInteger" json:"valueInteger"` - ValueMarkdown string `bson:"valueMarkdown" json:"valueMarkdown"` - ValueOid string `bson:"valueOid" json:"valueOid"` - ValuePositiveInt int `bson:"valuePositiveInt" json:"valuePositiveInt"` - ValueString string `bson:"valueString" json:"valueString"` - ValueTime string `bson:"valueTime" json:"valueTime"` - ValueUnsignedInt int `bson:"valueUnsignedInt" json:"valueUnsignedInt"` - ValueUri string `bson:"valueUri" json:"valueUri"` - ValueUrl string `bson:"valueUrl" json:"valueUrl"` - ValueUuid string `bson:"valueUuid" json:"valueUuid"` - ValueAddress Address `bson:"valueAddress" json:"valueAddress"` - ValueAge Age `bson:"valueAge" json:"valueAge"` - ValueAnnotation Annotation `bson:"valueAnnotation" json:"valueAnnotation"` - ValueAttachment Attachment `bson:"valueAttachment" json:"valueAttachment"` - ValueCodeableConcept CodeableConcept `bson:"valueCodeableConcept" json:"valueCodeableConcept"` - ValueCoding Coding `bson:"valueCoding" json:"valueCoding"` - ValueContactPoint ContactPoint `bson:"valueContactPoint" json:"valueContactPoint"` - ValueCount Count `bson:"valueCount" json:"valueCount"` - ValueDistance Distance `bson:"valueDistance" json:"valueDistance"` - ValueDuration Duration `bson:"valueDuration" json:"valueDuration"` - ValueHumanName HumanName `bson:"valueHumanName" json:"valueHumanName"` - ValueIdentifier Identifier `bson:"valueIdentifier" json:"valueIdentifier"` - ValueMoney Money `bson:"valueMoney" json:"valueMoney"` - ValuePeriod Period `bson:"valuePeriod" json:"valuePeriod"` - ValueQuantity Quantity `bson:"valueQuantity" json:"valueQuantity"` - ValueRange Range `bson:"valueRange" json:"valueRange"` - ValueRatio Ratio `bson:"valueRatio" json:"valueRatio"` - ValueReference Reference `bson:"valueReference" json:"valueReference"` - ValueSampledData SampledData `bson:"valueSampledData" json:"valueSampledData"` - ValueSignature Signature `bson:"valueSignature" json:"valueSignature"` - ValueTiming Timing `bson:"valueTiming" json:"valueTiming"` - ValueContactDetail ContactDetail `bson:"valueContactDetail" json:"valueContactDetail"` - ValueContributor Contributor `bson:"valueContributor" json:"valueContributor"` - ValueDataRequirement DataRequirement `bson:"valueDataRequirement" json:"valueDataRequirement"` - ValueExpression Expression `bson:"valueExpression" json:"valueExpression"` - ValueParameterDefinition ParameterDefinition `bson:"valueParameterDefinition" json:"valueParameterDefinition"` - ValueRelatedArtifact RelatedArtifact `bson:"valueRelatedArtifact" json:"valueRelatedArtifact"` - ValueTriggerDefinition TriggerDefinition `bson:"valueTriggerDefinition" json:"valueTriggerDefinition"` - ValueUsageContext UsageContext `bson:"valueUsageContext" json:"valueUsageContext"` - ValueDosage Dosage `bson:"valueDosage" json:"valueDosage"` - ValueMeta Meta `bson:"valueMeta" json:"valueMeta"` + ID *string `bson:"id,omitempty" json:"id,omitempty"` + Extension []Extension `bson:"extension,omitempty" json:"extension,omitempty"` + ModifierExtension []Extension `bson:"modifierExtension,omitempty" json:"modifierExtension,omitempty"` + Type CodeableConcept `bson:"type" json:"type"` + ValueBase64Binary *string `bson:"valueBase64Binary,omitempty" json:"valueBase64Binary,omitempty"` + ValueBoolean *bool `bson:"valueBoolean,omitempty" json:"valueBoolean,omitempty"` + ValueCanonical *string `bson:"valueCanonical,omitempty" json:"valueCanonical,omitempty"` + ValueCode *string `bson:"valueCode,omitempty" json:"valueCode,omitempty"` + ValueDate *string `bson:"valueDate,omitempty" json:"valueDate,omitempty"` + ValueDateTime *string `bson:"valueDateTime,omitempty" json:"valueDateTime,omitempty"` + ValueDecimal *float64 `bson:"valueDecimal,omitempty" json:"valueDecimal,omitempty"` + ValueID *string `bson:"valueID,omitempty" json:"valueID,omitempty"` + ValueInstant *string `bson:"valueInstant,omitempty" json:"valueInstant,omitempty"` + ValueInteger *int `bson:"valueInteger,omitempty" json:"valueInteger,omitempty"` + ValueMarkdown *string `bson:"valueMarkdown,omitempty" json:"valueMarkdown,omitempty"` + ValueOid *string `bson:"valueOid,omitempty" json:"valueOid,omitempty"` + ValuePositiveInt *int `bson:"valuePositiveInt,omitempty" json:"valuePositiveInt,omitempty"` + ValueString *string `bson:"valueString,omitempty" json:"valueString,omitempty"` + ValueTime *string `bson:"valueTime,omitempty" json:"valueTime,omitempty"` + ValueUnsignedInt *int `bson:"valueUnsignedInt,omitempty" json:"valueUnsignedInt,omitempty"` + ValueUri *string `bson:"valueUri,omitempty" json:"valueUri,omitempty"` + ValueUrl *string `bson:"valueUrl,omitempty" json:"valueUrl,omitempty"` + ValueUuid *string `bson:"valueUuid,omitempty" json:"valueUuid,omitempty"` + ValueAddress *Address `bson:"valueAddress,omitempty" json:"valueAddress,omitempty"` + ValueAge *Age `bson:"valueAge,omitempty" json:"valueAge,omitempty"` + ValueAnnotation *Annotation `bson:"valueAnnotation,omitempty" json:"valueAnnotation,omitempty"` + ValueAttachment *Attachment `bson:"valueAttachment,omitempty" json:"valueAttachment,omitempty"` + ValueCodeableConcept *CodeableConcept `bson:"valueCodeableConcept,omitempty" json:"valueCodeableConcept,omitempty"` + ValueCoding *Coding `bson:"valueCoding,omitempty" json:"valueCoding,omitempty"` + ValueContactPoint *ContactPoint `bson:"valueContactPoint,omitempty" json:"valueContactPoint,omitempty"` + ValueCount *Count `bson:"valueCount,omitempty" json:"valueCount,omitempty"` + ValueDistance *Distance `bson:"valueDistance,omitempty" json:"valueDistance,omitempty"` + ValueDuration *Duration `bson:"valueDuration,omitempty" json:"valueDuration,omitempty"` + ValueHumanName *HumanName `bson:"valueHumanName,omitempty" json:"valueHumanName,omitempty"` + ValueIdentifier *Identifier `bson:"valueIdentifier,omitempty" json:"valueIdentifier,omitempty"` + ValueMoney *Money `bson:"valueMoney,omitempty" json:"valueMoney,omitempty"` + ValuePeriod *Period `bson:"valuePeriod,omitempty" json:"valuePeriod,omitempty"` + ValueQuantity *Quantity `bson:"valueQuantity,omitempty" json:"valueQuantity,omitempty"` + ValueRange *Range `bson:"valueRange,omitempty" json:"valueRange,omitempty"` + ValueRatio *Ratio `bson:"valueRatio,omitempty" json:"valueRatio,omitempty"` + ValueReference *Reference `bson:"valueReference,omitempty" json:"valueReference,omitempty"` + ValueSampledData *SampledData `bson:"valueSampledData,omitempty" json:"valueSampledData,omitempty"` + ValueSignature *Signature `bson:"valueSignature,omitempty" json:"valueSignature,omitempty"` + ValueTiming *Timing `bson:"valueTiming,omitempty" json:"valueTiming,omitempty"` + ValueContactDetail *ContactDetail `bson:"valueContactDetail,omitempty" json:"valueContactDetail,omitempty"` + ValueContributor *Contributor `bson:"valueContributor,omitempty" json:"valueContributor,omitempty"` + ValueDataRequirement *DataRequirement `bson:"valueDataRequirement,omitempty" json:"valueDataRequirement,omitempty"` + ValueExpression *Expression `bson:"valueExpression,omitempty" json:"valueExpression,omitempty"` + ValueParameterDefinition *ParameterDefinition `bson:"valueParameterDefinition,omitempty" json:"valueParameterDefinition,omitempty"` + ValueRelatedArtifact *RelatedArtifact `bson:"valueRelatedArtifact,omitempty" json:"valueRelatedArtifact,omitempty"` + ValueTriggerDefinition *TriggerDefinition `bson:"valueTriggerDefinition,omitempty" json:"valueTriggerDefinition,omitempty"` + ValueUsageContext *UsageContext `bson:"valueUsageContext,omitempty" json:"valueUsageContext,omitempty"` + ValueDosage *Dosage `bson:"valueDosage,omitempty" json:"valueDosage,omitempty"` + ValueMeta *Meta `bson:"valueMeta,omitempty" json:"valueMeta,omitempty"` } type TaskOutput struct { - ID *string `bson:"id,omitempty" json:"id,omitempty"` - Extension []Extension `bson:"extension,omitempty" json:"extension,omitempty"` - ModifierExtension []Extension `bson:"modifierExtension,omitempty" json:"modifierExtension,omitempty"` - Type CodeableConcept `bson:"type" json:"type"` - ValueBase64Binary string `bson:"valueBase64Binary" json:"valueBase64Binary"` - ValueBoolean bool `bson:"valueBoolean" json:"valueBoolean"` - ValueCanonical string `bson:"valueCanonical" json:"valueCanonical"` - ValueCode string `bson:"valueCode" json:"valueCode"` - ValueDate string `bson:"valueDate" json:"valueDate"` - ValueDateTime string `bson:"valueDateTime" json:"valueDateTime"` - ValueDecimal float64 `bson:"valueDecimal" json:"valueDecimal"` - ValueID string `bson:"valueID" json:"valueID"` - ValueInstant string `bson:"valueInstant" json:"valueInstant"` - ValueInteger int `bson:"valueInteger" json:"valueInteger"` - ValueMarkdown string `bson:"valueMarkdown" json:"valueMarkdown"` - ValueOid string `bson:"valueOid" json:"valueOid"` - ValuePositiveInt int `bson:"valuePositiveInt" json:"valuePositiveInt"` - ValueString string `bson:"valueString" json:"valueString"` - ValueTime string `bson:"valueTime" json:"valueTime"` - ValueUnsignedInt int `bson:"valueUnsignedInt" json:"valueUnsignedInt"` - ValueUri string `bson:"valueUri" json:"valueUri"` - ValueUrl string `bson:"valueUrl" json:"valueUrl"` - ValueUuid string `bson:"valueUuid" json:"valueUuid"` - ValueAddress Address `bson:"valueAddress" json:"valueAddress"` - ValueAge Age `bson:"valueAge" json:"valueAge"` - ValueAnnotation Annotation `bson:"valueAnnotation" json:"valueAnnotation"` - ValueAttachment Attachment `bson:"valueAttachment" json:"valueAttachment"` - ValueCodeableConcept CodeableConcept `bson:"valueCodeableConcept" json:"valueCodeableConcept"` - ValueCoding Coding `bson:"valueCoding" json:"valueCoding"` - ValueContactPoint ContactPoint `bson:"valueContactPoint" json:"valueContactPoint"` - ValueCount Count `bson:"valueCount" json:"valueCount"` - ValueDistance Distance `bson:"valueDistance" json:"valueDistance"` - ValueDuration Duration `bson:"valueDuration" json:"valueDuration"` - ValueHumanName HumanName `bson:"valueHumanName" json:"valueHumanName"` - ValueIdentifier Identifier `bson:"valueIdentifier" json:"valueIdentifier"` - ValueMoney Money `bson:"valueMoney" json:"valueMoney"` - ValuePeriod Period `bson:"valuePeriod" json:"valuePeriod"` - ValueQuantity Quantity `bson:"valueQuantity" json:"valueQuantity"` - ValueRange Range `bson:"valueRange" json:"valueRange"` - ValueRatio Ratio `bson:"valueRatio" json:"valueRatio"` - ValueReference Reference `bson:"valueReference" json:"valueReference"` - ValueSampledData SampledData `bson:"valueSampledData" json:"valueSampledData"` - ValueSignature Signature `bson:"valueSignature" json:"valueSignature"` - ValueTiming Timing `bson:"valueTiming" json:"valueTiming"` - ValueContactDetail ContactDetail `bson:"valueContactDetail" json:"valueContactDetail"` - ValueContributor Contributor `bson:"valueContributor" json:"valueContributor"` - ValueDataRequirement DataRequirement `bson:"valueDataRequirement" json:"valueDataRequirement"` - ValueExpression Expression `bson:"valueExpression" json:"valueExpression"` - ValueParameterDefinition ParameterDefinition `bson:"valueParameterDefinition" json:"valueParameterDefinition"` - ValueRelatedArtifact RelatedArtifact `bson:"valueRelatedArtifact" json:"valueRelatedArtifact"` - ValueTriggerDefinition TriggerDefinition `bson:"valueTriggerDefinition" json:"valueTriggerDefinition"` - ValueUsageContext UsageContext `bson:"valueUsageContext" json:"valueUsageContext"` - ValueDosage Dosage `bson:"valueDosage" json:"valueDosage"` - ValueMeta Meta `bson:"valueMeta" json:"valueMeta"` + ID *string `bson:"id,omitempty" json:"id,omitempty"` + Extension []Extension `bson:"extension,omitempty" json:"extension,omitempty"` + ModifierExtension []Extension `bson:"modifierExtension,omitempty" json:"modifierExtension,omitempty"` + Type CodeableConcept `bson:"type" json:"type"` + ValueBase64Binary *string `bson:"valueBase64Binary,omitempty" json:"valueBase64Binary,omitempty"` + ValueBoolean *bool `bson:"valueBoolean,omitempty" json:"valueBoolean,omitempty"` + ValueCanonical *string `bson:"valueCanonical,omitempty" json:"valueCanonical,omitempty"` + ValueCode *string `bson:"valueCode,omitempty" json:"valueCode,omitempty"` + ValueDate *string `bson:"valueDate,omitempty" json:"valueDate,omitempty"` + ValueDateTime *string `bson:"valueDateTime,omitempty" json:"valueDateTime,omitempty"` + ValueDecimal *float64 `bson:"valueDecimal,omitempty" json:"valueDecimal,omitempty"` + ValueID *string `bson:"valueID,omitempty" json:"valueID,omitempty"` + ValueInstant *string `bson:"valueInstant,omitempty" json:"valueInstant,omitempty"` + ValueInteger *int `bson:"valueInteger,omitempty" json:"valueInteger,omitempty"` + ValueMarkdown *string `bson:"valueMarkdown,omitempty" json:"valueMarkdown,omitempty"` + ValueOid *string `bson:"valueOid,omitempty" json:"valueOid,omitempty"` + ValuePositiveInt *int `bson:"valuePositiveInt,omitempty" json:"valuePositiveInt,omitempty"` + ValueString *string `bson:"valueString,omitempty" json:"valueString,omitempty"` + ValueTime *string `bson:"valueTime,omitempty" json:"valueTime,omitempty"` + ValueUnsignedInt *int `bson:"valueUnsignedInt,omitempty" json:"valueUnsignedInt,omitempty"` + ValueUri *string `bson:"valueUri,omitempty" json:"valueUri,omitempty"` + ValueUrl *string `bson:"valueUrl,omitempty" json:"valueUrl,omitempty"` + ValueUuid *string `bson:"valueUuid,omitempty" json:"valueUuid,omitempty"` + ValueAddress *Address `bson:"valueAddress,omitempty" json:"valueAddress,omitempty"` + ValueAge *Age `bson:"valueAge,omitempty" json:"valueAge,omitempty"` + ValueAnnotation *Annotation `bson:"valueAnnotation,omitempty" json:"valueAnnotation,omitempty"` + ValueAttachment *Attachment `bson:"valueAttachment,omitempty" json:"valueAttachment,omitempty"` + ValueCodeableConcept *CodeableConcept `bson:"valueCodeableConcept,omitempty" json:"valueCodeableConcept,omitempty"` + ValueCoding *Coding `bson:"valueCoding,omitempty" json:"valueCoding,omitempty"` + ValueContactPoint *ContactPoint `bson:"valueContactPoint,omitempty" json:"valueContactPoint,omitempty"` + ValueCount *Count `bson:"valueCount,omitempty" json:"valueCount,omitempty"` + ValueDistance *Distance `bson:"valueDistance,omitempty" json:"valueDistance,omitempty"` + ValueDuration *Duration `bson:"valueDuration,omitempty" json:"valueDuration,omitempty"` + ValueHumanName *HumanName `bson:"valueHumanName,omitempty" json:"valueHumanName,omitempty"` + ValueIdentifier *Identifier `bson:"valueIdentifier,omitempty" json:"valueIdentifier,omitempty"` + ValueMoney *Money `bson:"valueMoney,omitempty" json:"valueMoney,omitempty"` + ValuePeriod *Period `bson:"valuePeriod,omitempty" json:"valuePeriod,omitempty"` + ValueQuantity *Quantity `bson:"valueQuantity,omitempty" json:"valueQuantity,omitempty"` + ValueRange *Range `bson:"valueRange,omitempty" json:"valueRange,omitempty"` + ValueRatio *Ratio `bson:"valueRatio,omitempty" json:"valueRatio,omitempty"` + ValueReference *Reference `bson:"valueReference,omitempty" json:"valueReference,omitempty"` + ValueSampledData *SampledData `bson:"valueSampledData,omitempty" json:"valueSampledData,omitempty"` + ValueSignature *Signature `bson:"valueSignature,omitempty" json:"valueSignature,omitempty"` + ValueTiming *Timing `bson:"valueTiming,omitempty" json:"valueTiming,omitempty"` + ValueContactDetail *ContactDetail `bson:"valueContactDetail,omitempty" json:"valueContactDetail,omitempty"` + ValueContributor *Contributor `bson:"valueContributor,omitempty" json:"valueContributor,omitempty"` + ValueDataRequirement *DataRequirement `bson:"valueDataRequirement,omitempty" json:"valueDataRequirement,omitempty"` + ValueExpression *Expression `bson:"valueExpression,omitempty" json:"valueExpression,omitempty"` + ValueParameterDefinition *ParameterDefinition `bson:"valueParameterDefinition,omitempty" json:"valueParameterDefinition,omitempty"` + ValueRelatedArtifact *RelatedArtifact `bson:"valueRelatedArtifact,omitempty" json:"valueRelatedArtifact,omitempty"` + ValueTriggerDefinition *TriggerDefinition `bson:"valueTriggerDefinition,omitempty" json:"valueTriggerDefinition,omitempty"` + ValueUsageContext *UsageContext `bson:"valueUsageContext,omitempty" json:"valueUsageContext,omitempty"` + ValueDosage *Dosage `bson:"valueDosage,omitempty" json:"valueDosage,omitempty"` + ValueMeta *Meta `bson:"valueMeta,omitempty" json:"valueMeta,omitempty"` } type OtherTask Task diff --git a/fhir-models/fhir/task_test.go b/fhir-models/fhir/task_test.go new file mode 100644 index 00000000..0d6955e7 --- /dev/null +++ b/fhir-models/fhir/task_test.go @@ -0,0 +1,26 @@ +package fhir + +import ( + "encoding/json" + "testing" +) + +func TestTaskInput_ValuePolymorphism(t *testing.T) { + // Expected JSON: + // { + // "type": {}, + // "valueInteger": 5 + // } + + inputValue := 5 + taskInput := TaskInput{ValueInteger: &inputValue} + data, _ := json.MarshalIndent(taskInput, "", " ") + asMap := map[string]interface{}{} + _ = json.Unmarshal(data, &asMap) + if len(asMap) != 2 { + t.Errorf("expected 2 fields, got %d", len(asMap)) + } + if asMap["valueInteger"] != inputValue { + t.Errorf("expected %d, got %v", inputValue, asMap["valueInteger"]) + } +} diff --git a/fhir-models/fhir/usageContext.go b/fhir-models/fhir/usageContext.go index 230696a7..741041c2 100644 --- a/fhir-models/fhir/usageContext.go +++ b/fhir-models/fhir/usageContext.go @@ -19,11 +19,11 @@ package fhir // UsageContext is documented here http://hl7.org/fhir/StructureDefinition/UsageContext type UsageContext struct { - ID *string `bson:"id,omitempty" json:"id,omitempty"` - Extension []Extension `bson:"extension,omitempty" json:"extension,omitempty"` - Code Coding `bson:"code" json:"code"` - ValueCodeableConcept CodeableConcept `bson:"valueCodeableConcept" json:"valueCodeableConcept"` - ValueQuantity Quantity `bson:"valueQuantity" json:"valueQuantity"` - ValueRange Range `bson:"valueRange" json:"valueRange"` - ValueReference Reference `bson:"valueReference" json:"valueReference"` + ID *string `bson:"id,omitempty" json:"id,omitempty"` + Extension []Extension `bson:"extension,omitempty" json:"extension,omitempty"` + Code Coding `bson:"code" json:"code"` + ValueCodeableConcept *CodeableConcept `bson:"valueCodeableConcept,omitempty" json:"valueCodeableConcept,omitempty"` + ValueQuantity *Quantity `bson:"valueQuantity,omitempty" json:"valueQuantity,omitempty"` + ValueRange *Range `bson:"valueRange,omitempty" json:"valueRange,omitempty"` + ValueReference *Reference `bson:"valueReference,omitempty" json:"valueReference,omitempty"` }