From b15719d55a8ef99c60ba63339a5d3b4678367322 Mon Sep 17 00:00:00 2001 From: markleeds Date: Wed, 9 Jan 2008 19:20:52 +0000 Subject: [PATCH] Added new information to this screen. --- interface/main/finder/patient_select.php | 310 +++++++++++++++---------------- 1 file changed, 147 insertions(+), 163 deletions(-) rewrite interface/main/finder/patient_select.php (60%) diff --git a/interface/main/finder/patient_select.php b/interface/main/finder/patient_select.php dissimilarity index 60% index ff2e89d65..8826b9a2a 100644 --- a/interface/main/finder/patient_select.php +++ b/interface/main/finder/patient_select.php @@ -1,163 +1,147 @@ - - - - - - - - - topmargin='0' rightmargin='0' leftmargin='2' - bottommargin='0' marginwidth='2' marginheight='0'> - - - - -
- - - - - -= $M) break; - // For the old layout we load a frameset that also sets up the new pid. - // The new layout loads just the demographics frame here, which in turn - // will set the pid and load all the other frames. - if ($GLOBALS['concurrent_layout']) { - $anchor = ""; - } else { - $anchor = ""; - } - print "\n"; - print ""; - if ($iter{"DOB"} != "0000-00-00 00:00:00") { - print ""; - } else { - print ""; - } - print ""; - $total++; - } -} - - -/**** -if ($findBy == "Last" && $result = getPatientLnames("$patient","*, DATE_FORMAT(DOB,'%m/%d/%Y') as DOB_TS") ) { - foreach ($result as $iter) { - - if ($total >= $M) { - break; - } - print "\n"; - print ""; - if ($iter{"DOB"} != "0000-00-00 00:00:00") { - print ""; - } else { - print ""; - } - print ""; - - $total++; - } -} - -if ($findBy == "ID" && $result = getPatientId("$patient","*, DATE_FORMAT(DOB,'%m/%d/%Y') as DOB_TS") ) { - foreach ($result as $iter) { - - if ($total >= $M) { - break; - } - print "\n"; - print ""; - if ($iter{"DOB"} != "0000-00-00 00:00:00") { - print ""; - } else { - print ""; - } - print ""; - - $total++; - } -} - -if ($findBy == "DOB" && $result = getPatientDOB("$patient","*, DATE_FORMAT(DOB,'%m/%d/%Y') as DOB_TS") ) { - foreach ($result as $iter) { - - if ($total >= $M) { - break; - } - print "\n"; - print ""; - if ($iter{"DOB"} != "0000-00-00 00:00:00") { - print ""; - } else { - print ""; - } - print ""; - - $total++; - } -} - -if ($findBy == "SSN" && $result = getPatientSSN("$patient","*, DATE_FORMAT(DOB,'%m/%d/%Y') as DOB_TS") ) { - foreach ($result as $iter) { - - if ($total >= $M) { - break; - } - print "\n"; - print ""; - if ($iter{"DOB"} != "0000-00-00 00:00:00") { - print ""; - } else { - print ""; - } - print ""; - - $total++; - } -} - -****/ - - -?> -
- - - - - - - -
$anchor" . $iter['lname'] . ", " . $iter['fname'] . "$anchor" . $iter['ss'] . "$anchor" . $iter['DOB_TS'] . "$anchor $anchor" . $iter['pubpid'] . "
".$iter{"lname"}.", ".$iter{"fname"}."".$iter{"ss"}."".$iter["DOB_TS"]." ".$iter{"pubpid"}."
".$iter{"lname"}.", ".$iter{"fname"}."".$iter{"ss"}."".$iter["DOB_TS"]." ".$iter{"pubpid"}."
".$iter{"lname"}.", ".$iter{"fname"}."".$iter{"ss"}."".$iter["DOB_TS"]." ".$iter{"pubpid"}."
".$iter{"lname"}.", ".$iter{"fname"}."".$iter{"ss"}."".$iter["DOB_TS"]." ".$iter{"pubpid"}."
- - - + + + + + + + + + topmargin='0' rightmargin='0' leftmargin='2' + bottommargin='0' marginwidth='2' marginheight='0'> +[Help]  + + + + +
+ + + + + += $M) break; + // For the old layout we load a frameset that also sets up the new pid. + // The new layout loads just the demographics frame here, which in turn + // will set the pid and load all the other frames. + if ($GLOBALS['concurrent_layout']) { + $anchor = ""; + } else { + $anchor = ""; + } + print "\n"; + //other phone number display setup for tooltip + $phone_biz = ''; + if ($iter{"phone_biz"} != "") { + $phone_biz = " [business phone ".$iter{"phone_biz"}."] "; + } + $phone_contact = ''; + if ($iter{"phone_contact"} != "") { + $phone_contact = " [contact phone ".$iter{"phone_contact"}."] "; + } + $phone_cell = ''; + if ($iter{"phone_cell"} != "") { + $phone_cell = " [cell phone ".$iter{"phone_cell"}."] "; + } + $all_other_phones = $phone_biz.$phone_contact.$phone_cell; + if ($all_other_phones == '') {$all_other_phones = 'No other phone numbers listed';} + //end of phone number display setup, now display the phone number(s) + print "\n"; + print ""; + if ($iter{"DOB"} != "0000-00-00 00:00:00") { + print ""; + } else { + print ""; + } + print ""; + //setup for display of encounter date info + $encounter_count = 0; + $day_diff = ''; + $last_date_seen = ''; + $next_appt_date= ''; + $pid = ''; + //calculate date differences based on date of last cpt4 entry + $query = "select DATE_FORMAT(date(max(date)),'%m/%d/%y') as mydate," . + " (to_days(current_date())-to_days(max(date))) as day_diff," . + " DATE_FORMAT(date(max(date)) + interval " . $add_days . + " day,'%m/%d/%y') as next_appt, dayname(max(date) + interval " . + $add_days." day) as next_appt_day from billing where code_type". + " like 'CPT4' and pid=" . $iter{"pid"}; + $statement= sqlStatement($query); + if ($results = mysql_fetch_array($statement, MYSQL_ASSOC)) { + $last_date_seen = $results['mydate']; + $day_diff = $results['day_diff']; + $next_appt_date= $results['next_appt_day'].', '.$results['next_appt']; + } + //calculate count of encounters by distinct billing dates with cpt4 + //entries + $query = "select count(distinct date) as encounter_count " . + "from billing where code_type like 'CPT4' and activity=1 " . + "and pid=".$iter{"pid"}; + $statement= sqlStatement($query); + if ($results = mysql_fetch_array($statement, MYSQL_ASSOC)) { + $encounter_count = $results['encounter_count']; + } + print ""; + print ""; + print ""; + print ""; + $total++; + } +} +?> +
+ + + + + + + + + + + + + + + + + 0) { + $add_days = $matches[1]; + $patient = $matches[2]; +} +?> +[ Days From Last Encounter] +
$anchor" . $iter['lname'] . ", " . $iter['fname'] . "$anchor" . $iter['phone_home']. "$anchor" . $iter['ss'] . "$anchor" . $iter['DOB_TS'] . "$anchor $anchor" . $iter['pubpid'] . "$encounter_count" . "$day_diff" . "$last_date_seen" . "$next_appt_date" . "
+ + -- 2.11.4.GIT