Skip to content

Commit

Permalink
fix: add date_end to query for getEffectiveInsurances
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenwaite committed Jun 17, 2024
1 parent e873bb6 commit 70cb3b0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions library/patient.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -1549,8 +1549,8 @@ function getEffectiveInsurances($patient_id, $encdate)
$tmp = sqlQuery(
"SELECT * FROM insurance_data " .
"WHERE pid = ? AND type = ? " .
"AND (date <= ? OR date IS NULL) ORDER BY date DESC LIMIT 1",
array($patient_id, $instype, $encdate)
"AND (date <= ? OR date IS NULL) AND (date_end >= ? OR date_end IS NULL) ORDER BY date DESC LIMIT 1",
array($patient_id, $instype, $encdate, $encdate)
);
if (empty($tmp['provider'])) {
break;
Expand Down

0 comments on commit 70cb3b0

Please sign in to comment.