opensafely / hypertension-sro

Hypertension (HYP) targets in the Quality and Outcomes Framework (QOF)
MIT License
0 stars 0 forks source link

fix register numerator #46

Closed milanwiedemann closed 2 years ago

milanwiedemann commented 2 years ago

problem: currently our numerator is much larger than we would expect. we think this is because:

(hypertension_resolved_date <= hypertension_date)

in the hypertension_register variable could return True for patients that dont have either: hypertension diagnosis or hypertension resolved code. this would mean that I'm currently including everyone who never had a hypertension diagnosis or resolved code and might result in the large numerator I get in the results.

adding a new check ensures that the date comparison is only applied to patients where we have both hypertension AND hypertension_resolved:

(hypertension AND hypertension_resolved) AND
(hypertension_resolved_date <= hypertension_date) 
gitpod-io[bot] commented 2 years ago

milanwiedemann commented 2 years ago

thanks @ccunningham101 :)