2 include_once("../../globals.php");
3 include_once($GLOBALS["srcdir"]."/api.inc");
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;
14 if (++
$si_report_colno > $si_report_cols) {
16 echo " </tr>\n <tr>\n";
18 echo " <td valign='top'><span class='bold'>$title: </span>" .
19 "<span class='text'>$value </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(
37 '11' => 'Training Warm Up',
38 '12' => 'Training Session',
39 '13' => 'Training Cool Down',
42 $arr_activity = array(
47 '5' => 'Use of Elbow',
59 '20' => 'Twist/Turning',
75 $arr_position = array(
77 '2' => 'Midfield Offense',
78 '3' => 'Midfield Defense',
82 '7' => 'Goal Keeper' ,
83 '8' => 'Starting Lineup' ,
87 $arr_footwear = array(
88 '1' => 'Molded Cleat' ,
89 '2' => 'Detachable Cleats',
90 '3' => 'Indoor Shoes' ,
97 '3' => 'Ankle Strapping',
98 '4' => 'Knee Strapping' ,
100 '6' => 'Synthetic Cast' ,
107 '4' => 'Not Applicable',
110 $arr_removed = array(
111 '1' => 'Immediately',
113 '3' => 'Not at All' ,
117 '1' => 'Hospital A&E Dept',
118 '2' => 'General Practitioner' ,
119 '3' => 'Physiotherapist' ,
121 '5' => 'Hospital Specialist' ,
123 '7' => 'Chiropractor' ,
124 '8' => 'Sports Massage Th' ,
125 '9' => 'Sports Physician' ,
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'");
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");
145 $si_report_cols = $cols;
147 echo "<table cellpadding='0' cellspacing='0'>\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");