Skip to content

Attempting to access dose of a Medication Request returns null #14

Description

@brynrhodes

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions