-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: cdr fix to correctly show actions that are due, due soon, past due in expanded listings #7211
fix: cdr fix to correctly show actions that are due, due soon, past due in expanded listings #7211
Conversation
@bradymiller , sorry but your change does not correctly solve the issue Original block of code (with added indenting of the top half):
` You wrapped the code that executes if $passTarget is true (except for the final break;) with a check for $dateCounter == 1 The $passTarget test is called during each of the passes through the I haven't studied what reminder_results_integrate() does. I'm assuming that if it executes on a failure pass (one or more times, for $dateCounter == 1 and $dateCounter == 2), it does not need to execute if the target passes when $dateCounter == 3 Hope this makes sense. |
I posted this comment in #7160. Entering it here as well |
hi @hanksterr7 , sorry for the delay on replying to this. Planning to research this more over next couple days and will get back to you. |
85071b4
to
1aa48b7
Compare
hi @hanksterr7 , And plan to analyze the reminder_results_integrate() a bit since something seems to be off there (or i just don't remember what i was doing there). One of objectives of the CDR engine was to support the same action from different rules without duplicating them, but i don't see how that function will do this correctly (quite possible i was supporting this somewhere else but something doesn't seem right). |
…ue in expanded listings
3ef19ee
to
6318002
Compare
hi @hanksterr7 , |
hi @hanksterr7 , This is testing well in the patient summary screen and the reports. If you are ok with this fix, then let me know and I'll bring it into the codebase (and you can incorporate it into your PR). |
Hi @bradymiller |
hi @hanksterr7 , |
…ue in expanded listings (openemr#7211)
Hi @bradymiller Here is the block of code in question // Check if pass target
$passTarget = test_targets($rowPatient['pid'], $rowRule['id'], '', $dateFocus);
if ($passTarget) {
(old) // increment pass target counter
(new) // increment pass target counter (used for reporting)
$pass_target++;
// If report itemization is turned on, then record the "passed" item and set the flag
if (!empty($GLOBALS['report_itemizing_temp_flag_and_id'])) {
insertItemReportTracker($GLOBALS['report_itemizing_temp_flag_and_id'], $GLOBALS['report_itemized_test_id_iterator'], 1, $rowPatient['pid']);
$temp_track_pass = 1;
}
(old) // send to reminder results
(old) if ($mode == "reminders-all") {
(new) // send to reminder results for reminders-all when not_due (ie. $dateCounter == 1)
(new) if (($mode == "reminders-all") && ($dateCounter == 1)) {
// place the completed actions into the reminder return array
$actionArray = resolve_action_sql($rowRule['id'], '1');
foreach ($actionArray as $action) {
$action_plus = $action;
$action_plus['due_status'] = "not_due";
$action_plus['pid'] = $rowPatient['pid'];
$action_plus['rule_id'] = $rowRule['id'];
$results = reminder_results_integrate($results, $action_plus);
}
}
break;
} else { You are replacing So, as the comment says, you will "send to reminder results for reminders-all when not_due" My question is: does it also make sense if to send to reminder results if "due soon"? If a target passes when $dateCounter == 2 (which means the target did not pass when $dateCounter == 1), then the target is "due soon". If sending to reminder results if either "not due" or "due soon" is desired behavior, then you need to test for $dateCounter == 1 or $dateCounter == 2 I would think "due soon" means the rule criteria have been satisfied, but won't be for much longer. So it is still appropriate to include the rule in success reports. If you really don't want to send to reminder results if "due soon", and instead only if "not due", then the current code is fine Thanks for pondering |
Hi @hanksterr7 , Note the due_soon gets set when $datecounter == 1 if do not pass via the reminder_results_integrate() call in the else block below your code highlighted above. Then when it passes during $datecounter == 2, nothing else happens and it keeps the due_soon status. I agree this is super confusing though and I don't know what I was thinking 10 years ago when did this. Also note the reports are not using this stuff (it only runs through the loop once with the target date and either passes or fails ie, not due or due). I just made the code more clear in a PR I just posted: |
…_new * 'master' of https://github.com/openemr/openemr: fix: cdr fix to correctly show actions that are due, due soon, past due in expanded listings (openemr#7211) fix: skip empty insurance for claim validation in billing manager (openemr#7264)
cdr fix to correctly show actions that are due, due soon, past due in expanded listings
Reported by @hanksterr7
Note that the code change here is very minimal (just ensuring
$dateCounter == 1
before running the code that states it is Not Due). This link will show the code changes without whitespace to show this:https://github.com/openemr/openemr/pull/7211/files?w=1
Testing well in both reminder and report mode.