From 1cf8e9d2b54a1dc1b2d63a28f874b74bfcfafe38 Mon Sep 17 00:00:00 2001 From: sunsetsystems Date: Tue, 2 Aug 2005 23:48:24 +0000 Subject: [PATCH] new reports --- interface/reports/absences_report.php | 165 ++++++++++++++++++++++ interface/reports/insurance_allocation_report.php | 130 +++++++++++++++++ templates/report/general_default.html | 6 +- 3 files changed, 300 insertions(+), 1 deletion(-) create mode 100644 interface/reports/absences_report.php create mode 100644 interface/reports/insurance_allocation_report.php diff --git a/interface/reports/absences_report.php b/interface/reports/absences_report.php new file mode 100644 index 000000000..012a515e4 --- /dev/null +++ b/interface/reports/absences_report.php @@ -0,0 +1,165 @@ + + + +Absences by Diagnosis + + + + + + + + + + + +
+ +

Days and Games Missed

+ +
+ + + + + + + + + + + +
+ By: + />Diagnosis  + />Player   + From: + + +  To: + + +   + +
+
+ + + + + + + + + + + + + + += '$from_date') AND lists.begdate <= '$to_date' AND " . + "patient_data.pid = lists.pid " . + "GROUP BY lname, fname, mname"; + } + else { + $query = "SELECT lists.diagnosis, codes.code_text, count(*) AS count, " . + "SUM(lists.extrainfo) AS gmissed, " . + "SUM(TO_DAYS(LEAST(IFNULL(lists.enddate,CURRENT_DATE),'$to_date')) - TO_DAYS(GREATEST(lists.begdate,'$from_date'))) AS dmissed " . + "FROM lists " . + "LEFT OUTER JOIN codes " . + "ON codes.code = lists.diagnosis AND " . + "(codes.code_type = 2 OR codes.code_type = 4 OR codes.code_type = 5) " . + "WHERE " . + "(lists.enddate IS NULL OR lists.enddate >= '$from_date') AND lists.begdate <= '$to_date' " . + "GROUP BY lists.diagnosis"; + } + + echo "\n"; // debugging + + $res = sqlStatement($query); + + while ($row = sqlFetchArray($res)) { +?> + + + + + + + + + + + + + + +
+ Name + + Code + + Description + + Issues + + Days + + Games +
+ + + + + + + + + + + +
+
+
+ + diff --git a/interface/reports/insurance_allocation_report.php b/interface/reports/insurance_allocation_report.php new file mode 100644 index 000000000..62c955817 --- /dev/null +++ b/interface/reports/insurance_allocation_report.php @@ -0,0 +1,130 @@ + + + +Patient Insurance Distribution + + + + + + + + + + + +
+ +

Patient Insurance Distribution

+ +
+ + + + + + + + + + + +
+ From: + + +  To: + + +   + +
+
+ + + + + + + + += '$from_date' AND " . + "billing.date <= '$to_date' " . + "ORDER BY insurance_companies.name, billing.pid"; + + // echo "\n"; // debugging + $res = sqlStatement($query); + $insarr = array(); + + while ($row = sqlFetchArray($res)) { + // echo "\n"; // debugging + $plan = $row['name'] ? $row['name'] : '-- No Insurance --'; + $insarr[$plan] += 1; + $inscount += 1; + } + + while (list($key, $val) = each($insarr)) { +?> + + + + + + + +
+ Primary Insurance + + Patients + + Percent +
+ + + + + +
+
+
+ + diff --git a/templates/report/general_default.html b/templates/report/general_default.html index 646d47f87..7f260a246 100644 --- a/templates/report/general_default.html +++ b/templates/report/general_default.html @@ -23,7 +23,7 @@ function clear_vars() { } function dopopup(aurl) { - window.open(aurl, '_blank', 'width=750,height=550,resizable=1'); + window.open(aurl, '_blank', 'width=750,height=550,resizable=1,scrollbars=1'); } @@ -35,10 +35,14 @@ function dopopup(aurl) { Superbill Report
Appointments-Encounters Report +
+Patient Insurance Distribution Report {php} if ($GLOBALS['athletic_team']) { echo "
\n"; echo "Team Roster\n"; + echo "
\n"; + echo "Days and Games Missed\n"; } {/php}
-- 2.11.4.GIT