-
Other
-
Resolution: Answered
-
Critical
-
None
-
None
-
-
CMS0128v12
Hello
Following question is for ECQM128V12
1)
As per the below stopdate calculation function, first preference is given for stopdate calculation using supply value and dose data and second preference is given for direct stopdate present in the file.
CMD.MedicationDispensedPeriod(MedDispense "Medication, Dispensed")
{{MedDispense Dispense let startDate: date from Coalesce(Dispense.relevantPeriod.low, Dispense.relevantDatetime, Dispense.authorDatetime),
totalDaysSupplied: Coalesce(Dispense.supply.value /(Dispense.dosage.value * ToDaily(Dispense.frequency)), Dispense.daysSupplied)
return if startDate is null then null
else if totalDaysSupplied is not null then Interval[startDate, startDate + Quantity
]
else if Dispense.relevantPeriod.high is not null then Interval[startDate, date from end of Dispense.relevantPeriod]
else null}}
*else if totalDaysSupplied is not null then Interval[startDate, startDate + Quantity
]*
In above mentioned line of code, we are doing -1 and the add the days in start date.
Below data is present for patient “Ramon Townsend“ from product P5.
low value='20230925163500' , high value='20240109170000'
period value='24' unit='h'
doseQuantity value="1.0"
quantity value="106.0"
Formula : totalDaysSupplied = Dispense.supply.value /(Dispense.dosage.value * ToDaily(Dispense.frequency)
startDate + Quantity { value: totalDaysSupplied - 1, unit: 'day' }
Stopdate calculation :
106.0/(1*(24/24)) = 106
2023-09-25 + (106 - 1) = 2024-01-08
Using above data if we calculate stopdate then that will be 2024-01-08 and actually high value is 2024-01-09 in patient xml file. One day difference is there. is it correct ?