Moving towards HTML5 and CSS3 compatibility. revision 2.
[openemr.git] / contrib / forms / soccer_injury / report.php
blob5440f2f509867a7b38f37461c5eefedd93131d5a
1 <?php
2 include_once("../../globals.php");
3 include_once($GLOBALS["srcdir"]."/api.inc");
5 $si_report_cols = 2;
6 $si_report_colno = 0;
8 // Helper function used by soccer_injury_report().
9 // Writes a title/value pair to a table cell.
11 function si_report_item($title, $value) {
12 global $si_report_cols, $si_report_colno;
13 if (!$value) return;
14 if (++$si_report_colno > $si_report_cols) {
15 $si_report_colno = 1;
16 echo " </tr>\n <tr>\n";
18 echo " <td valign='top'><span class='bold'>$title: </span>" .
19 "<span class='text'>$value &nbsp;</span></td>\n";
22 // This function is invoked from printPatientForms in report.inc
23 // when viewing a "comprehensive patient report". Also from
24 // interface/patient_file/encounter/forms.php.
26 function soccer_injury_report($pid, $encounter, $cols, $id) {
27 global $si_report_cols;
29 $arr_gameplay = array(
30 '1' => '1st Quarter',
31 '2' => '2nd Quarter',
32 '3' => '3rd Quarter',
33 '4' => '4th Quarter',
34 '5' => 'Warm Up',
35 '6' => 'Extra Time',
36 '7' => 'Cool Down',
37 '11' => 'Training Warm Up',
38 '12' => 'Training Session',
39 '13' => 'Training Cool Down',
42 $arr_activity = array(
43 '1' => 'Tackling',
44 '2' => 'Tackled',
45 '3' => 'Collision',
46 '4' => 'Kicked',
47 '5' => 'Use of Elbow',
48 '6' => 'Hit by Ball',
49 '7' => 'Other:',
50 '11' => 'Passing',
51 '12' => 'Shooting',
52 '13' => 'Running',
53 '14' => 'Dribbling',
54 '15' => 'Heading',
55 '16' => 'Jumping',
56 '17' => 'Landing',
57 '18' => 'Fall',
58 '19' => 'Stretching',
59 '20' => 'Twist/Turning',
60 '21' => 'Throwing',
61 '22' => 'Diving',
62 '23' => 'Other NC:',
65 $arr_surface = array(
66 '1' => 'Pitch' ,
67 '2' => 'Training' ,
68 '3' => 'Artificial' ,
69 '4' => 'All Weather',
70 '5' => 'Indoor' ,
71 '6' => 'Gym' ,
72 '7' => 'Other' ,
75 $arr_position = array(
76 '1' => 'Defender' ,
77 '2' => 'Midfield Offense',
78 '3' => 'Midfield Defense',
79 '4' => 'Wing Back' ,
80 '5' => 'Forward' ,
81 '6' => 'Striker' ,
82 '7' => 'Goal Keeper' ,
83 '8' => 'Starting Lineup' ,
84 '9' => 'Substitute' ,
87 $arr_footwear = array(
88 '1' => 'Molded Cleat' ,
89 '2' => 'Detachable Cleats',
90 '3' => 'Indoor Shoes' ,
91 '4' => 'Turf Shoes' ,
94 $arr_equip = array(
95 '1' => 'Shin Pads' ,
96 '2' => 'Gloves' ,
97 '3' => 'Ankle Strapping',
98 '4' => 'Knee Strapping' ,
99 '5' => 'Bracing' ,
100 '6' => 'Synthetic Cast' ,
103 $arr_side = array(
104 '1' => 'Left' ,
105 '2' => 'Right' ,
106 '3' => 'Bilateral' ,
107 '4' => 'Not Applicable',
110 $arr_removed = array(
111 '1' => 'Immediately',
112 '2' => 'Later' ,
113 '3' => 'Not at All' ,
116 $arr_treat = array(
117 '1' => 'Hospital A&amp;E Dept',
118 '2' => 'General Practitioner' ,
119 '3' => 'Physiotherapist' ,
120 '4' => 'Nurse' ,
121 '5' => 'Hospital Specialist' ,
122 '6' => 'Osteopath' ,
123 '7' => 'Chiropractor' ,
124 '8' => 'Sports Massage Th' ,
125 '9' => 'Sports Physician' ,
128 /****
129 $row = sqlQuery ("SELECT forms.date AS occdate, si.* " .
130 "FROM forms, form_soccer_injury AS si WHERE " .
131 "forms.formdir = 'soccer_injury' AND forms.form_id = '$id' AND " .
132 "si.id = '$id' AND si.activity = '1'");
133 ****/
135 $row = sqlQuery ("SELECT form_encounter.onset_date AS occdate, si.* " .
136 "FROM forms, form_encounter, form_soccer_injury AS si WHERE " .
137 "forms.formdir = 'soccer_injury' AND " .
138 "forms.form_id = '$id' AND " .
139 "si.id = '$id' AND si.activity = '1' AND " .
140 "form_encounter.encounter = forms.encounter AND " .
141 "form_encounter.pid = forms.pid");
143 if (!$row) return;
145 $si_report_cols = $cols;
147 echo "<table cellpadding='0' cellspacing='0'>\n";
148 echo " <tr>\n";
150 si_report_item("Occurred" , substr($row['occdate'], 0, 10) . " " . substr($row['siinjtime'], 0, 5));
151 si_report_item("During" , $arr_gameplay[$row['sigametime']]);
152 si_report_item("Mechanism", $arr_activity[$row['simechanism']] . ' ' . $row['simech_other']);
153 si_report_item("Surface" , $arr_surface[$row['sisurface']]);
154 si_report_item("Position" , $arr_position[$row['siposition']]);
155 si_report_item("Footwear" , $arr_footwear[$row['sifootwear']]);
156 foreach ($arr_equip as $key => $value) {
157 if ($row["siequip_$key"]) si_report_item("Equipment", $value);
159 si_report_item("Side" , $arr_side[$row['siside']]);
160 si_report_item("Removed" , $arr_removed[$row['siremoved']]);
161 foreach ($arr_treat as $key => $value) {
162 if ($row["sitreat_$key"]) si_report_item("Treatment", $value);
164 if ($row["sitreat_other"]) si_report_item("Treatment", $row["sitreat_other"]);
165 si_report_item("To Return", $row['sinoreturn'] ? "No" : "Yes");
167 echo " </tr>\n";
168 echo "</table>\n";