new encounter form for football injuries, a popup version of the fee sheet, and abili...
[openemr.git] / contrib / forms / football_injury_audit / report.php
blobe96975b2a6da93e4bb399b418c1030c84de23b80
1 <?php
3 // Copyright (C) 2006 Rod Roark <rod@sunsetsystems.com>
4 //
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License
7 // as published by the Free Software Foundation; either version 2
8 // of the License, or (at your option) any later version.
10 include_once("../../globals.php");
11 include_once($GLOBALS["srcdir"] . "/api.inc");
13 $fi_report_cols = 2;
14 $fi_report_colno = 0;
16 // Helper function used by football_injury_audit_report().
17 // Writes a title/value pair to a table cell.
19 function fi_report_item($title, $value) {
20 global $fi_report_cols, $fi_report_colno;
21 if (!$value) return;
22 if (++$fi_report_colno > $fi_report_cols) {
23 $fi_report_colno = 1;
24 echo " </tr>\n <tr>\n";
26 echo " <td valign='top'><span class='bold'>$title: </span>" .
27 "<span class='text'>$value &nbsp;</span></td>\n";
30 // This function is invoked from printPatientForms in report.inc
31 // when viewing a "comprehensive patient report". Also from
32 // interface/patient_file/encounter/forms.php.
34 function football_injury_audit_report($pid, $encounter, $cols, $id) {
35 global $fi_report_cols;
37 $arr_injtime = array(
38 '1' => 'Warm Up',
39 '2' => 'Extra Time',
40 '3' => 'Cool Down',
41 '4' => 'Training Warm Up',
42 '5' => 'Training Session',
43 '6' => 'Training Cool Down',
44 '7' => 'Training Rehab',
47 $arr_activity = array(
48 'tackling' => 'Tackling',
49 'tackled' => 'Tackled',
50 'collision' => 'Collision',
51 'kicked' => 'Kicked',
52 'elbow' => 'Use of Elbow',
53 'nofoul' => 'No Foul',
54 'oppfoul' => 'Opponent Foul',
55 'ownfoul' => 'Own Foul',
56 'yellow' => 'Yellow Card',
57 'red' => 'Red Card',
58 'passing' => 'Passing',
59 'shooting' => 'Shooting',
60 'running' => 'Running',
61 'dribbling' => 'Dribbling',
62 'heading' => 'Heading',
63 'jumping' => 'Jumping',
64 'landing' => 'Landing',
65 'fall' => 'Fall',
66 'stretching' => 'Stretching',
67 'turning' => 'Twist/Turning',
68 'throwing' => 'Throwing',
69 'diving' => 'Diving',
70 'overuse' => 'Overuse',
73 $arr_surface = array(
74 '1' => 'Pitch' ,
75 '2' => 'Training' ,
76 '3' => 'Artificial' ,
77 '4' => 'Indoor' ,
78 '5' => 'Gym' ,
79 '6' => 'Other' ,
82 $arr_position = array(
83 '1' => 'Defender' ,
84 '2' => 'Midfield Offensive',
85 '3' => 'Midfield Defensive',
86 '4' => 'Forward' ,
87 '5' => 'Goal Keeper' ,
88 '6' => 'Substitute' ,
91 $arr_footwear = array(
92 '1' => 'Molded Stud' ,
93 '2' => 'Detachable Stud' ,
94 '3' => 'Indoor Shoes' ,
95 '4' => 'Blades' ,
98 $arr_side = array(
99 '1' => 'Left' ,
100 '2' => 'Right' ,
101 '3' => 'Bilateral' ,
102 '4' => 'Not Applicable',
105 $arr_removed = array(
106 '1' => 'Immediately',
107 '2' => 'Later' ,
108 '3' => 'Not at All' ,
111 $row = sqlQuery ("SELECT form_encounter.onset_date AS occdate, fi.* " .
112 "FROM forms, form_encounter, form_football_injury_audit AS fi WHERE " .
113 "forms.formdir = 'football_injury_audit' AND " .
114 "forms.form_id = '$id' AND " .
115 "fi.id = '$id' AND fi.activity = '1' AND " .
116 "form_encounter.encounter = forms.encounter AND " .
117 "form_encounter.pid = forms.pid");
119 if (!$row) return;
121 $fi_report_cols = $cols;
123 echo "<table cellpadding='0' cellspacing='0'>\n";
124 echo " <tr>\n";
126 if ($row['fiinjmin'] ) fi_report_item("Min of Injury", $row['fiinjmin']);
127 if ($row['fiinjtime']) fi_report_item("During", $arr_injtime[$row['fiinjtime']]);
128 foreach ($arr_activity as $key => $value) {
129 if ($row["fimech_$key"]) fi_report_item("Mechanism", $value);
131 if ($row["fimech_othercon"]) fi_report_item("Other Contact", $row["fimech_othercon"]);
132 if ($row["fimech_othernon"]) fi_report_item("Other Noncontact", $row["fimech_othernon"]);
133 fi_report_item("Surface" , $arr_surface[$row['fisurface']]);
134 fi_report_item("Position" , $arr_position[$row['fiposition']]);
135 fi_report_item("Footwear" , $arr_footwear[$row['fifootwear']]);
136 fi_report_item("Side" , $arr_side[$row['fiside']]);
137 fi_report_item("Removed" , $arr_removed[$row['firemoved']]);
139 echo " </tr>\n";
140 echo "</table>\n";