Details
-
Question/Guidance
-
Resolution: Resolved
-
Major
-
None
-
None
-
This change is slated to be a CRP ticket during CRP Round 3. We need to know this logic will work before submitting the ticket.
Description
The Estimated Delivery Date is reported as date only. However, the QDM, does not allow the "date" attribute for Assessment, Performed, but only "datetime". Based on feedback received from Bryn at 6/2/2022 at eCQM Workgroup, we added "as DateTime" to the LastEstimatedDeliveryDate function result (see below). Bonnie test case, (DENOMPass EDD is Date Only), we specified the Assessment, Performed: Delivery Date Estimated attribute of result to be "Date". In doing so, the case does not meet the denominator as it should. If specified, as DateTime, the denominator is met as it should be. Please note, that we tried adding "date from" logic in front of "LastEstimatedDeliveryDate" in the "CalculatedGestationalAge" function below, and it did not pass the test case either.
{{define function "LastEstimatedDeliveryDate"(Encounter "Encounter, Performed" ):
//This function identifies the last time the Estimated Delivery Date was assessed 42 weeks or less prior to or on delivery and stores the result of that assessment.
Last(["Assessment, Performed": "Delivery date Estimated"] EstimatedDateOfDelivery
where Global."EarliestOf"(EstimatedDateOfDelivery.relevantDatetime, EstimatedDateOfDelivery.relevantPeriod)42 weeks or less before or on "LastTimeOfDelivery"(Encounter)
and EstimatedDateOfDelivery.result is not null
sort by Global."EarliestOf"(relevantDatetime, relevantPeriod)
).result as DateTime}}
{{}}
{{{}define function "CalculatedGestationalAge"(Encounter "Encounter, Performed" ):
// Age = (280-(Estimated Delivery Date minus Reference Date/Delivery Date))/7
( 280 - ( difference in days between "LastTimeOfDelivery"(Encounter)and "LastEstimatedDeliveryDate"(Encounter)) ) div 7{}}}{}