Proposed Solution:

//Before

/*@description: Returns the equivalent daily frequency (as a decimal) of the given code

@comment: Note that for ranges, the upper range is used. E.g. `Every two to four hours` results in `6.0` and `One to two` times a day results in `2.0`.*/

define function "CodeToDaily"(Frequency Code ):

case

when Frequency ~ "Once daily (qualifier value)" then 1.0

[…]

when Frequency ~ "Every seventy two hours (qualifier value)" then 0.34

when Frequency ~ "Every forty eight hours (qualifier value)" then 0.5

when Frequency ~ "Every eight to twelve hours (qualifier value)" then 2.0

when Frequency ~ "Every six to eight hours (qualifier value)" then 3.0

when Frequency ~ "Every three to four hours (qualifier value)" then 6.0

when Frequency ~ "Every three to six hours (qualifier value)" then 4.0

when Frequency ~ "Every two to four hours (qualifier value)" then 6.0

[…]

end

//After

/*@description: Returns the equivalent daily frequency (as a decimal) of the given code

@comment: Note that for ranges, the boundary resulting in the highest frequency result is used. E.g. `Every two to four hours` results in `12.0` and `One to two` times a day results in `2.0`.*/

define function "CodeToDaily"(Frequency Code ):

case

when Frequency ~ "Once daily (qualifier value)" then 1.0

[…]

when Frequency ~ "Every seventy two hours (qualifier value)" then 0.33

when Frequency ~ "Every forty eight hours (qualifier value)" then 0.5

when Frequency ~ "Every eight to twelve hours (qualifier value)" then 3.0

when Frequency ~ "Every six to eight hours (qualifier value)" then 4.0

when Frequency ~ "Every three to four hours (qualifier value)" then 8.0

when Frequency ~ "Every three to six hours (qualifier value)" then 8.0

when Frequency ~ "Every two to four hours (qualifier value)" then 12.0

[…]

end

Rationale for Change:

This issue was discussed with and supported by the eCQM Work Group community and QDM standards team on 4/21/2022. The recommendation is to update the function logic so that maximum frequency, hence highest dose, is consistently calculated; this would also align with the Morphine Milligram Equivalent (MME) calculation logic:

http://fhir.org/guides/cdc/opioid-mme-r4/3.0.0/. The other recommendation is to update the description to “for ranges, the boundary resulting in the highest frequency is used” and correct a calculation that was incorrectly rounded up instead of down, i.e., “every 72 hours” results in 0.33 instead of 0.34.