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' ,
128 $row = sqlQuery ("SELECT forms.date AS occdate, si.* " .
129 "FROM forms, form_soccer_injury AS si WHERE " .
130 "forms.formdir = 'soccer_injury' AND forms.form_id = '$id' AND " .
131 "si.id = '$id' AND si.activity = '1'");
135 $si_report_cols = $cols;
137 echo "<table cellpadding='0' cellspacing='0'>\n";
140 si_report_item("Occurred" , substr($row['occdate'], 0, 10) . " " . substr($row['siinjtime'], 0, 5));
141 si_report_item("During" , $arr_gameplay[$row['sigametime']]);
142 si_report_item("Mechanism", $arr_gameplay[$row['simechanism']] . ' ' . $row['simech_other']);
143 si_report_item("Surface" , $arr_surface[$row['sisurface']]);
144 si_report_item("Position" , $arr_position[$row['siposition']]);
145 si_report_item("Footwear" , $arr_footwear[$row['sifootwear']]);
146 foreach ($arr_equip as $key => $value) {
147 if ($row["siequip_$key"]) si_report_item("Equipment", $value);
149 si_report_item("Side" , $arr_side[$row['siside']]);
150 si_report_item("Removed" , $arr_removed[$row['siremoved']]);
151 foreach ($arr_treat as $key => $value) {
152 if ($row["sitreat_$key"]) si_report_item("Treatment", $value);
154 if ($row["sitreat_other"]) si_report_item("Treatment", $row["sitreat_other"]);
155 si_report_item("To Return", $row['sinoreturn'] ?
"No" : "Yes");