From 93b3978b4f9aade3d108bd47818ce05a0fdc04a7 Mon Sep 17 00:00:00 2001 From: sunsetsystems Date: Tue, 5 Apr 2005 13:30:18 +0000 Subject: [PATCH] highlight patient name in red if there is no primary insurance subscriber --- interface/billing/billing_report.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/interface/billing/billing_report.php b/interface/billing/billing_report.php index e45de0184..25cf874c7 100644 --- a/interface/billing/billing_report.php +++ b/interface/billing/billing_report.php @@ -295,7 +295,6 @@ if ($ret = getBillsBetween($from_date,$to_date,$my_authorized,$unbilled,"%")) { $skipping = FALSE; foreach ($ret as $iter) { - $name = getPatientData($iter['pid']); $this_encounter_id = $iter['pid'] . "-" . $iter['encounter']; if ($last_encounter_id != $this_encounter_id) { @@ -328,6 +327,19 @@ if ($ret = getBillsBetween($from_date,$to_date,$my_authorized,$unbilled,"%")) { } } + $name = getPatientData($iter['pid'], "fname, mname, lname"); + + # Check if patient has primary insurance and a subscriber exists for it. + # If not we will highlight their name in red. + # TBD: more checking here. + # + $res = sqlQuery("select count(*) as count from insurance_data where " . + "pid = " . $iter['pid'] . " and " . + "type='primary' and " . + "subscriber_lname is not null and " . + "subscriber_lname != '' limit 1"); + $namecolor = ($res['count'] > 0) ? "black" : "#ff7777"; + ++$encount; $bgcolor = "#" . (($encount & 1) ? "ddddff" : "ffdddd"); echo "\n"; @@ -335,7 +347,7 @@ if ($ret = getBillsBetween($from_date,$to_date,$my_authorized,$unbilled,"%")) { $rcount = 0; $oldcode = ""; - $lhtml .= " ". $name['fname'] . " " . $name['lname'] . " (" . $iter['pid'] . "-" . $iter['encounter'] . ")"; + $lhtml .= " ". $name['fname'] . " " . $name['lname'] . " (" . $iter['pid'] . "-" . $iter['encounter'] . ")"; $lhtml .= "   [To Encounter]"; $lhtml .= "   [To Demographics]"; $lhtml .= "
\n"; -- 2.11.4.GIT