-
Question/Guidance
-
Resolution: Resolved
-
Moderate
-
None
-
None
library MATGlobalCommonFunctions version '6.2.000' has the following function:
/*Given a datetime and a period, returns the period (if a period is provided) or the interval beginning and ending on the datetime (if a datetime is provided)*/ define function "NormalizeInterval"(pointInTime DateTime, period Interval<DateTime> ): if pointInTime is not null then Interval[pointInTime, pointInTime] else if period is not null then period else null as Interval<DateTime>
In the above function, the CQL logic does not match the description in the comment. "Given a datetime and a period, returns the period" is not true since given a datetime and a period, NormalizeInterval will return the datetime as an interval.
QRDA Known Issue Tracker issue QKI-2 describes the interpretation of RelevantPeriod's Low value as the Relevant Datetime.
Measure CMS 154v10 uses the following logic:
define "Encounter with Upper Respiratory Infection and Antibiotics Active 30 Days Prior": "Encounter with Upper Respiratory Infection" EncounterWithURI with ["Medication, Active": "Antibiotic Medications for Pharyngitis"] ActiveAntibiotic such that Global."NormalizeInterval" ( ActiveAntibiotic.relevantDatetime, ActiveAntibiotic.relevantPeriod ) overlaps Interval[Global."ToDate" ( ( start of EncounterWithURI.relevantPeriod ) - 30 days ), start of EncounterWithURI.relevantPeriod] return EncounterWithURI
If the relevantPeriod for ActiveAntibiotic has already been interpreted as ActiveAntibiotic.relevantDatetime as described in QKI-2, NormalizeInterval would create an interval including only the Low value of the period. This would cause the overlaps operator to return False in cases where it should return True.