We have CQL that is attempting to access the MedicationRequest.dosageInstruction.doseAndRate.dose element. The dose element in this case is a Choice<SimpleQuantity, Range>, but the actual element in the JSON is spelled doseQuantity, so when the choice selection code looks for the JSON property:
|
const choiceProperty = choicePropertyName(element, choice); |
It's actually looking for doseSimpleQuantity, which doesn't exist, so returns null.
We are trying to workaround this particular case by sneakily modifying the ModelInfo, but this is a general problem with the subtyped elements (when they are part of a choice) in FHIR.
We have CQL that is attempting to access the
MedicationRequest.dosageInstruction.doseAndRate.doseelement. The dose element in this case is aChoice<SimpleQuantity, Range>, but the actual element in the JSON is spelleddoseQuantity, so when the choice selection code looks for the JSON property:cql-exec-fhir/src/fhir.js
Line 173 in f175661
It's actually looking for
doseSimpleQuantity, which doesn't exist, so returns null.We are trying to workaround this particular case by sneakily modifying the ModelInfo, but this is a general problem with the subtyped elements (when they are part of a choice) in FHIR.