-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
PY 2024 QI-Core Conversion for CMS 135
-
QI Core/CQL
-
CMS0135v12
-
Bug/Issue Bug Task
-
-
MADiE
A calculation issue occurs when a filter is used for a MedicationRequest profile retrieval in QI-Core. The MedicationRequest resource cannot be found even though the test case JSON contains the MedicationRequest resource, relevant meta.profile and uses the medication element either as a CodeableConcept or referenced Medication resource. For example, when provided the following CQL and correct test case JSON, the case passes:
CQL
exists ( [MedicationRequest] ACEIOrARBOrARNIOrdered where ( ( ACEIOrARBOrARNIOrdered.medication as Concept ) in "ACE Inhibitor or ARB or ARNI" or ( ACEIOrARBOrARNIOrdered.medication as Reference ).reference.getId() in ( [Medication: "ACE Inhibitor or ARB or ARNI"] ACEIOrARBOrARNI return ACEIOrARBOrARNI.id ) ) and ACEIOrARBOrARNIOrdered.isOrderedDuringHeartFailureOutpatientEncounter() )
However, when the CQL is updated to use the primary code path for the MedicationRequest, the test case that was passing now fails:
updated CQL
exists (
[MedicationRequest: "ACE Inhibitor or ARB or ARNI"] ACEIOrARBOrARNIOrdered
where ACEIOrARBOrARNIOrdered.isOrderedDuringHeartFailureOutpatientEncounter()
)
Based on a brief review of the QI-Core 4.1.1 Model Info file, I'm speculating that the issue is stemming from it. The primary code path for MedicationRequest is provided as 'medication', but medication is a choice type:
<typeInfo xsi:type="ClassInfo" baseType="QICore.DomainResource" namespace="QICore" name="MedicationRequest" identifier="http://hl7.org/fhir/us/qicore/StructureDefinition/qicore-medicationrequest" label="MedicationRequest" retrievable="true" primaryCodePath="medication"> ..... <element name="medication" target="FHIRHelpers.ToValue(%value)" description="..." mustSupport="true"> <elementTypeSpecifier xsi:type="ChoiceTypeSpecifier"> <choice namespace="System" name="Concept" xsi:type="NamedTypeSpecifier"/> <choice namespace="QICore" name="Reference" xsi:type="NamedTypeSpecifier"/> </elementTypeSpecifier> <binding description="Prescribable medications" strength="Extensible"/> </element>