NOTE: this page will move to an HL7 wiki when a location is found for it.
Introduction
This page contains a reversed and re-arranged version of the FHIR page listing occurrences of the choice[x] construct in the FHIR DSTU4 resources. The original reversed form was created by Grahame Grieve. Here the rows are re-arranged and somewhat sorted in an attempt to find errors, patterns and opportunities for refactoring and simplification of FHIR, particularly a great reduction if not removal of the choice construct from the base resources.
...
value or status boolean: either a value is supplied or a boolean, indicating that the event / entity in question exists, had occurred etc; for these, the boolean value is marked in red;
these probably should be 2 data points in all cases, because the general case is a Boolean + a data structure if the Boolean is True.
structured value(s) or string: in many cases, it is assumed that the value will be supplied in one or more structured forms, OR a string (marked in grey);
this should be dealt with in a generic way across all the data types;
reference to X versus inline X versus attachment of X versus uri: various concrete representation alternatives; these are shown in some of the tables lower down;
generally a single type should be constructed to deal with this situation
coded versus value: where a coded category (e.g. ‘normal’) and/or a quantitative point or range (e.g. ‘4.5-12’ - Thyroxine T4) is available;
in many cases, both coded and quantitative data points should be used.
...
Data types | Resource . location | ||||||
---|---|---|---|---|---|---|---|
dateTime | Period | Timing | ChargeItem.occurrence[x] | 7 | |||
dateTime | Period | Timing | instant | Observation.effective[x] | 1 | ||
dateTime | Period | BiologicallyDerivedProduct.collection.collected[x] | 15 | ||||
date | Period | Claim.supportingInfo.timing[x] | 8 | ||||
date | Period | string | FamilyMemberHistory.born[x] | 1 | |||
dateTime | string | Immunization.occurrence[x] | 1 | ||||
dateTime | boolean | Patient.deceased[x] | 1 |
Notes
...
Data types | Resource . location | ||||||
---|---|---|---|---|---|---|---|
Age | dateTime | Range | Period | string | AllergyIntolerance.onset[x] | 4 | |
Range | Period | RiskAssessment.prediction.when[x] | 1 | ||||
Age | Range | Period | string | FamilyMemberHistory.condition.onset[x] | 1 | ||
Age | Range | string | FamilyMemberHistory.age[x] | 1 | |||
Age | date | Range | string | boolean | FamilyMemberHistory.deceased[x] | 1 |
...
The main challenge here is to deal with the usual problem of wanting to enter an age or a date at which something happened. This can be solved with a model like the following (note: as above, the exact HL7 data types are not used, as I don’t have a UML model of FHIR; thus for e.g. Iso8601_duration, assume Duration etc):
...
Age is specified either:
...
Date types | Resource . location | Notes | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Period | Timing | string | CarePlan.activity.detail.scheduled[x] | 1 |
| ||||||
Period | Timing | Range | dateTime | Duration | Age | ActivityDefinition.timing[x] | 3 |
| |||
Timing | date | Reference | TriggerDefinition.timing[x] | 1 |
| ||||||
date | CodeableConcept | Goal.start[x] | 1 |
...
Data types | Resource . location | ||||
---|---|---|---|---|---|
SimpleQuantity | Ratio | MedicationAdministration.dosage.rate[x] | 2 | ||
Quantity | string | SubstanceSpecification.moiety.amount[x] | 2 | ||
Quantity | Range | string | SubstanceAmount.amount[x] | 2 | |
SimpleQuantity | Range | Dosage.doseAndRate.dose[x] | 1 | ||
SimpleQuantity | Range | Ratio | Dosage.doseAndRate.rate[x] | 1 | |
Quantity | Range | Ratio | ServiceRequest.quantity[x] | 1 | |
Quantity | Range | Ratio | string | SubstanceSpecification.relationship.amount[x] | 1 |
SimpleQuantity | string | SpecimenDefinition.typeTested.container.minimumVolume[x] | 1 |
...
Data types | Resource . location | |||||
---|---|---|---|---|---|---|
Money | unsignedInt | ExplanationOfBenefit.benefitBalance.financial.used[x] | 1 | |||
Money | SimpleQuantity | Coverage.costToBeneficiary.value[x] | 1 | |||
Money | unsignedInt | string | CoverageEligibilityResponse.insurance.item.benefit.allowed[x] | 3 |
|
...
Data types | Resource . location | |||
---|---|---|---|---|
decimal | Range | RiskAssessment.prediction.probability[x] | 1 | |
integer | boolean | Patient.multipleBirth[x] | 1 |
...
Data types | Resource . location | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
CodeableConcept | Quantity | Range | Ratio | boolean | integer | time | Period | string | Observation.value[x] | 2 | |
Coding | boolean | integer | dateTime | string | CodeSystem.concept.property.value[x] | 1 | |||||
code | boolean | integer | dateTime | string | uri | ValueSet.expansion.parameter.value[x] | 1 | ||||
Coding | Quantity | boolean | integer | date | string | uri Attachment Reference | Contract.term.offer.answer.value[x] | 3 | |||
Coding | integer | date | string | Reference | Questionnaire.item.answerOption.value[x] | 1 | |||||
Coding | Quantity | boolean | integer | date | string | Reference | Questionnaire.item.enableWhen.answer[x] | 1 | |||
CodeableConcept | Quantity | Range | Ratio | boolean | integer | string | Goal.target.detail[x] | 1 | |||
CodeableConcept | Quantity | Range | boolean | Reference | Group.characteristic.value[x] | 1 | |||||
CodeableConcept | Quantity | Range | boolean | DeviceRequest.parameter.value[x] | 2 | ||||||
Quantity | boolean | string | Reference Attachment | Claim.supportingInfo.value[x] | 2 | ||||||
boolean | integer decimal | string | id | StructureMap.group.rule.target.parameter.value[x] | 1 | ||||||
Base64Binary string | AuditEvent.entity.detail.value[x] | 1 | |||||||||
CodeableConcept | Quantity | Range | PlanDefinition.goal.target.detail[x] | 1 | |||||||
CodeableConcept | Quantity | Range | Reference | ||||||||
* | StructureMap.group.rule.source.defaultValue[x] | 3 |
...
Data types | Resource . location | Notes | ||
---|---|---|---|---|
canonical | ConceptMap.source[x] | 3 | ||
Reference | 1 | |||
Identifier | Composition.relatesTo.target[x] | 1 | ||
canonical | boolean | ImplementationGuide.definition.resource.example[x] ImplementationGuide.manifest.resource.example[x] | 2 | This looks like bad modelling. It’s not clear why the boolean is there. |
Reference | boolean | MedicationRequest.reported[x] | 1 |
...
Data types | Resource . location | Notes | ||||
---|---|---|---|---|---|---|
Reference Reference etc | Attachment | Consent.source[x] Contract.friendly.content[x] | 5 | The Reference() could be generalised to Reference(Document), where Document is established as an ancestor to various document types. | ||
Reference Reference(Organization) | string | Annotation.author[x] DeviceDefinition.manufacturer[x] | 2 | The Reference() could be generalised to Reference(Party), where Party is established as an ancestor to various party types. | ||
Reference(Any) | Attachment | string | Communication.payload.content[x] | 2 | ||
Reference(Location) | Address | Claim.accident.location[x] | 2 |
...
Data types | Resource . location | Notes | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
CodeableConcept | canonical uri | GuidanceResponse.module[x] | 1 | |||||||
CodeableConcept | SimpleQuantity | MedicationKnowledge.administrationGuidelines.patientCharacteristics.characteristic[x] | 1 | |||||||
CodeableConcept | SimpleQuantity | base64Binary string | MedicationKnowledge.drugCharacteristic.value[x] | 1 | ||||||
CodeableConcept | Range | Population.age[x] | 1 |
| ||||||
CodeableConcept | Duration | Specimen.collection.fastingStatus[x] | 1 |
| ||||||
CodeableConcept | canonical | DataRequirement | ResearchElementDefinition.characteristic.definition[x] | 1 | ||||||
CodeableConcept | canonical Reference | DataRequirement | EvidenceVariable.characteristic.definition[x] | 1 | ||||||
CodeableConcept | boolean | Dosage.asNeeded[x] | 3 | Should be modelled with either 2 data points, not a choice, or just coded, with any ‘any substitution’ code being available. |
...
Data types | Resource . location | |||
---|---|---|---|---|
CodeableConcept | Reference | DataRequirement.subject[x] | 41 | |
CodeableConcept | Reference | Address | Claim.item.location[x] | 4 |
Coding | uri | MessageDefinition.event[x] | 2 |
...