cqframework / draft-measures

Draft Measures Working Content Repository
9 stars 19 forks source link

"Prevalence Period" in MatGlobalCommon will produce an open null interval #66

Open matthewtiller opened 3 years ago

matthewtiller commented 3 years ago

"Prevalence Period" produces intervals with an open end. If the input ends with a closed null, then "Prevalence Period" would change it to an open null.

An initial fix was attempted with https://github.com/cqframework/draft-measures/pull/57. However, that fix is insufficient, I think, because of "Normalize Abatement", which is used in "Prevalence Period," is inconsistent with how it closes intervals as well. Care must be taken to track all of the interactions between "Prevalence Period" and other functions to ensure that the intent of the original input interval is preserved.

dkwasny-ibm commented 3 years ago

I hit this problem when attempting to run EXM122, which is an in-progress measure so I understand issues may crop up. The measure uses the Prevalence Period function on diabetes records, of which many will not have abatement dates.

I'm only using these measures for testing, so I have no pressing need for the measure to be 100% medically relevant. In the meantime, I switched the interval returned from Prevalence Period to closed/closed to exercise more logic in the CQL engine. I understand that this change may not be the correct one.