Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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]
Contract.term.action.occurrence[x]
DeviceRequest.occurrence[x]
DeviceUseStatement.timing[x]
ServiceRequest.occurrence[x]
SupplyDelivery.occurrence[x]
SupplyRequest.occurrence[x]]

7

dateTime

Period

Timing

instant

Observation.effective[x]

1

dateTime

Period





BiologicallyDerivedProduct.collection.collected[x]
BiologicallyDerivedProduct.processing.time[x]
BiologicallyDerivedProduct.manipulation.time[x]
ClinicalImpression.effective[x]
CommunicationRequest.occurrence[x]
DetectedIssue.identified[x], DiagnosticReport.effective[x]
Media.created[x]
MedicationAdministration.effective[x]
MedicationStatement.effective[x]
MedicinalProductAuthorization.procedure.date[x]
Provenance.occurred[x]
RiskAssessment.occurrence[x]
Specimen.collection.collected[x]
Specimen.processing.time[x]]

15

date

Period





Claim.supportingInfo.timing[x]
Claim.item.serviced[x]
ClaimResponse.addItem.serviced[x]
CoverageEligibilityRequest.serviced[x]
CoverageEligibilityResponse.serviced[x]
ExplanationOfBenefit.supportingInfo.timing[x]
ExplanationOfBenefit.item.serviced[x]
ExplanationOfBenefit.addItem.serviced[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]
Condition.onset[x]
Condition.abatement[x]
Procedure.performed[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

  • Q: What use is the string here?

Period

Timing

Range

dateTime

Duration

Age

ActivityDefinition.timing[x]
PlanDefinition.action.timing[x]
RequestGroup.action.timing[x]

3

  • Q: Are there really any systems containing Ranges (2 x SimpleQuantity) representing timing?

  • Q: how does Duration make sense here?

Timing

date
dateTime

Reference

TriggerDefinition.timing[x]

1

  • Q: Why no Period?

date

CodeableConcept

Goal.start[x]

1

...

Data types

Resource . location

SimpleQuantity

Ratio

MedicationAdministration.dosage.rate[x]
NutritionOrder.enteralFormula.administration.rate[x]

2

Quantity

string

SubstanceSpecification.moiety.amount[x]
SubstanceSpecification.property.amount[x]

2

Quantity

Range

string

SubstanceAmount.amount[x]
SubstanceReferenceInformation.target.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]
CoverageEligibilityResponse.insurance.item.benefit.used[x]
ExplanationOfBenefit.benefitBalance.financial.allowed[x]

3

  • PK: Why is string here?

...

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
dateTime

Period
SampledData

string

Observation.value[x]
Observation.component.value[x]

2

Coding
code

boolean

integer
decimal

dateTime


string

CodeSystem.concept.property.value[x]

1

code




boolean

integer
decimal

dateTime

string

uri

ValueSet.expansion.parameter.value[x]

1

Coding

Quantity



boolean

integer
decimal

date
time
dateTime


string

uri

Attachment

Reference

Contract.term.offer.answer.value[x]
Questionnaire.item.initial.value[x]
QuestionnaireResponse.item.answer.value[x]

3

Coding





integer

date
time


string

Reference

Questionnaire.item.answerOption.value[x]

1

Coding

Quantity



boolean

integer
decimal

date
time
dateTime


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]
SupplyRequest.parameter.value[x]

2


Quantity



boolean




string

Reference

Attachment

Claim.supportingInfo.value[x]
ExplanationOfBenefit.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]
Task.input.value[x]
Task.output.value[x]

3

...

Data types

Resource . location

Notes

canonical
uri

ConceptMap.source[x]
ConceptMap.target[x]
PlanDefinition.action.definition[x]

3

Reference
url

ImplementationGuide.definition.page.name[x]

1

Identifier
Reference

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
(Consent | DocumentReference | Contract | QuestionnaireResponse)

Reference
(Composition | DocumentReference | QuestionnaireResponse)

etc

Attachment


Consent.source[x]

Contract.friendly.content[x]
Contract.legal.content[x]
Contract.rule.content[x]
Contract.legallyBinding[x]

5

The Reference() could be generalised to Reference(Document), where Document is established as an ancestor to various document types.

Reference
(Practitioner | Patient | RelatedPerson | Organization)

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]
CommunicationRequest.payload.content[x]

2

Reference(Location)



Address

Claim.accident.location[x]
ExplanationOfBenefit.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

  • why complicate things with a coded age range? If it exists, convert it to a Range

CodeableConcept

Duration

Specimen.collection.fastingStatus[x]

1

  • Probably should not be a choice[x] but a required code and an optional Duration

CodeableConcept






canonical

DataRequirement
Expression

ResearchElementDefinition.characteristic.definition[x]

1

CodeableConcept






canonical

Reference

DataRequirement
Expression
TriggerDefinition

EvidenceVariable.characteristic.definition[x]

1

CodeableConcept




boolean




Dosage.asNeeded[x]
MedicationRequest.substitution.allowed[x]
ServiceRequest.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]
ActivityDefinition.subject[x]
ActivityDefinition.product[x]
CarePlan.activity.detail.product[x]
ChargeItem.product[x]
Claim.diagnosis.diagnosis[x]
Claim.procedure.procedure[x]
Contract.topic[x]
Contract.term.topic[x]
Contract.term.asset.valuedItem.entity[x]
CoverageEligibilityRequest.item.diagnosis.diagnosis[x]
DeviceRequest.code[x]
EventDefinition.subject[x]
ExplanationOfBenefit.diagnosis.diagnosis[x]
ExplanationOfBenefit.procedure.procedure[x]
Invoice.lineItem.chargeItem[x]
Library.subject[x]
Measure.subject[x]
Medication.ingredient.item[x]
MedicationAdministration.medication[x]
MedicationDispense.statusReason[x]
MedicationDispense.medication[x]
MedicationKnowledge.ingredient.item[x]
MedicationKnowledge.administrationGuidelines.indication[x]
MedicationRequest.medication[x]
MedicationStatement.medication[x]
MedicinalProduct.specialDesignation.indication[x]
MedicinalProductContraindication.otherTherapy.medication[x]
MedicinalProductIndication.otherTherapy.medication[x]
MedicinalProductInteraction.interactant.item[x]
PlanDefinition.subject[x]
PlanDefinition.action.subject[x]
ResearchDefinition.subject[x]
ResearchElementDefinition.subject[x]
Specimen.container.additive[x]
SpecimenDefinition.typeTested.container.additive.additive[x]
Substance.ingredient.substance[x]
SubstanceSpecification.property.definingSubstance[x]
SubstanceSpecification.relationship.substance[x]
SupplyDelivery.suppliedItem.item[x]
SupplyRequest.item[x]

41

CodeableConcept

Reference

Address

Claim.item.location[x]
ClaimResponse.addItem.location[x]
ExplanationOfBenefit.item.location[x]
ExplanationOfBenefit.addItem.location[x]

4

Coding

uri


MessageDefinition.event[x]
MessageHeader.event[x]

2

...