openEMR 7.0.3(4)
Windows/xampp 3.3.0
php 8.1.6
Hi all.
I noticed that for some of the original rules that were manually added to the database, there is no target_interval defined in the rule_target table. Examples: rule_cs_colon, rule_blood_pressure, and rule_cs_prostate (there are others as well). For these rules, the targets always evaluate to true, so these rules always show as “not due”.
If you use the rule builder GUI to add/edit a rule target, the GUI always creates a target_interval row in the rule_target table.
When you add a target in the GUI, it shows a default interval of 1 month.
The logic in database_check() in library\clinical_rules.php does not similarly assume 1 month, and instead defaults to empty strings for $intervalValue and $intervalType, causing the targets to always evaluate to true. If these defaults are changed to ‘1’ and ‘month’, appropriate rule evaluation is observed.
I will try to roll a patch that has this change (might take me a while to get my git environment back up and running). In the meantime, folks might consider making these changes in database_check() themselves.
– Hank