added game type to football injury audit, and classification and additional occurrenc...
[openemr.git] / contrib / forms / football_injury_audit / view.php
blobd1337a21ad2ffc378f9df0cb5e33ca5c8456c4b4
1 <?php
2 //////////////////////////////////////////////////////////////////////
3 // ------------------ DO NOT MODIFY VIEW.PHP !!! ---------------------
4 // View.php is an exact duplicate of new.php. If you wish to make
5 // any changes, then change new.php and either (recommended) make
6 // view.php a symbolic link to new.php, or copy new.php to view.php.
7 //
8 // And if you check in a change to either module, be sure to check
9 // in the other (identical) module also.
11 // This nonsense will go away if we ever move to subversion.
12 //////////////////////////////////////////////////////////////////////
14 // Copyright (C) 2006-2007 Rod Roark <rod@sunsetsystems.com>
16 // This program is free software; you can redistribute it and/or
17 // modify it under the terms of the GNU General Public License
18 // as published by the Free Software Foundation; either version 2
19 // of the License, or (at your option) any later version.
21 include_once("../../globals.php");
22 include_once("$srcdir/api.inc");
23 include_once("$srcdir/forms.inc");
25 $row = array();
27 if (! $encounter) { // comes from globals.php
28 die("Internal error: we do not seem to be in an encounter!");
31 function rbvalue($rbname) {
32 $tmp = $_POST[$rbname];
33 if (! $tmp) $tmp = '0';
34 return "'$tmp'";
37 function cbvalue($cbname) {
38 return $_POST[$cbname] ? '1' : '0';
41 function invalue($inname) {
42 return (int) trim($_POST[$inname]);
45 function txvalue($txname) {
46 return "'" . trim($_POST[$txname]) . "'";
49 function rbinput($name, $value, $desc, $colname) {
50 global $row;
51 $ret = "<input type='radio' name='$name' value='$value'";
52 if ($row[$colname] == $value) $ret .= " checked";
53 $ret .= " />$desc";
54 return $ret;
57 function rbcell($name, $value, $desc, $colname) {
58 return "<td width='25%' nowrap>" . rbinput($name, $value, $desc, $colname) . "</td>\n";
61 function cbinput($name, $colname) {
62 global $row;
63 $ret = "<input type='checkbox' name='$name' value='1'";
64 if ($row[$colname]) $ret .= " checked";
65 $ret .= " />";
66 return $ret;
69 function cbcell($name, $desc, $colname) {
70 return "<td width='25%' nowrap>" . cbinput($name, $colname) . "$desc</td>\n";
73 $formid = $_GET['id'];
75 // If Save was clicked, save the info.
77 if ($_POST['bn_save']) {
78 $fiinjmin = (int) $_POST['form_injmin'];
80 // If updating an existing form...
82 if ($formid) {
83 $query = "UPDATE form_football_injury_audit SET " .
84 "fiinjmin = " . invalue('form_injmin') . ", " .
85 "fiinjtime = " . rbvalue('form_injtime') . ", " .
86 "fimatchtype = " . rbvalue('form_matchtype') . ", " .
87 "fimech_tackling = " . cbvalue('form_mech_tackling') . ", " .
88 "fimech_tackled = " . cbvalue('form_mech_tackled') . ", " .
89 "fimech_collision = " . cbvalue('form_mech_collision') . ", " .
90 "fimech_kicked = " . cbvalue('form_mech_kicked') . ", " .
91 "fimech_elbow = " . cbvalue('form_mech_elbow') . ", " .
92 "fimech_nofoul = " . cbvalue('form_mech_nofoul') . ", " .
93 "fimech_oppfoul = " . cbvalue('form_mech_oppfoul') . ", " .
94 "fimech_ownfoul = " . cbvalue('form_mech_ownfoul') . ", " .
95 "fimech_yellow = " . cbvalue('form_mech_yellow') . ", " .
96 "fimech_red = " . cbvalue('form_mech_red') . ", " .
97 "fimech_passing = " . cbvalue('form_mech_passing') . ", " .
98 "fimech_shooting = " . cbvalue('form_mech_shooting') . ", " .
99 "fimech_running = " . cbvalue('form_mech_running') . ", " .
100 "fimech_dribbling = " . cbvalue('form_mech_dribbling') . ", " .
101 "fimech_heading = " . cbvalue('form_mech_heading') . ", " .
102 "fimech_jumping = " . cbvalue('form_mech_jumping') . ", " .
103 "fimech_landing = " . cbvalue('form_mech_landing') . ", " .
104 "fimech_fall = " . cbvalue('form_mech_fall') . ", " .
105 "fimech_stretching = " . cbvalue('form_mech_stretching') . ", " .
106 "fimech_turning = " . cbvalue('form_mech_turning') . ", " .
107 "fimech_throwing = " . cbvalue('form_mech_throwing') . ", " .
108 "fimech_diving = " . cbvalue('form_mech_diving') . ", " .
109 "fimech_overuse = " . cbvalue('form_mech_overuse') . ", " .
110 "fimech_othercon = " . txvalue('form_mech_othercon') . ", " .
111 "fimech_othernon = " . txvalue('form_mech_othernon') . ", " .
112 "fisurface = " . rbvalue('form_surface') . ", " .
113 "fiposition = " . rbvalue('form_position') . ", " .
114 "fifootwear = " . rbvalue('form_footwear') . ", " .
115 "fiside = " . rbvalue('form_side') . ", " .
116 "firemoved = " . rbvalue('form_removed') . " " .
117 "WHERE id = '$formid'";
118 sqlStatement($query);
121 // If adding a new form...
123 else {
124 $query = "INSERT INTO form_football_injury_audit ( " .
125 "fiinjmin, fiinjtime, fimatchtype, " .
126 "fimech_tackling, fimech_tackled, fimech_collision, " .
127 "fimech_kicked, fimech_elbow, fimech_nofoul, fimech_oppfoul, " .
128 "fimech_ownfoul, fimech_yellow, fimech_red, fimech_passing, " .
129 "fimech_shooting, fimech_running, fimech_dribbling, fimech_heading, " .
130 "fimech_jumping, fimech_landing, fimech_fall, fimech_stretching, " .
131 "fimech_turning, fimech_throwing, fimech_diving, fimech_overuse, " .
132 "fimech_othercon, fimech_othernon, fisurface, fiposition, fifootwear, " .
133 "fiside, firemoved " .
134 ") VALUES ( " .
135 invalue('form_injmin') . ", " .
136 rbvalue('form_injtime') . ", " .
137 rbvalue('form_matchtype') . ", " .
138 cbvalue('form_mech_tackling') . ", " .
139 cbvalue('form_mech_tackled') . ", " .
140 cbvalue('form_mech_collision') . ", " .
141 cbvalue('form_mech_kicked') . ", " .
142 cbvalue('form_mech_elbow') . ", " .
143 cbvalue('form_mech_nofoul') . ", " .
144 cbvalue('form_mech_oppfoul') . ", " .
145 cbvalue('form_mech_ownfoul') . ", " .
146 cbvalue('form_mech_yellow') . ", " .
147 cbvalue('form_mech_red') . ", " .
148 cbvalue('form_mech_passing') . ", " .
149 cbvalue('form_mech_shooting') . ", " .
150 cbvalue('form_mech_running') . ", " .
151 cbvalue('form_mech_dribbling') . ", " .
152 cbvalue('form_mech_heading') . ", " .
153 cbvalue('form_mech_jumping') . ", " .
154 cbvalue('form_mech_landing') . ", " .
155 cbvalue('form_mech_fall') . ", " .
156 cbvalue('form_mech_stretching') . ", " .
157 cbvalue('form_mech_turning') . ", " .
158 cbvalue('form_mech_throwing') . ", " .
159 cbvalue('form_mech_diving') . ", " .
160 cbvalue('form_mech_overuse') . ", " .
161 txvalue('form_mech_othercon') . ", " .
162 txvalue('form_mech_othernon') . ", " .
163 rbvalue('form_surface') . ", " .
164 rbvalue('form_position') . ", " .
165 rbvalue('form_footwear') . ", " .
166 rbvalue('form_side') . ", " .
167 rbvalue('form_removed') . " " .
168 ")";
169 $newid = sqlInsert($query);
170 addForm($encounter, "Football Injury Audit", $newid, "football_injury_audit", $pid, $userauthorized);
173 formHeader("Redirecting....");
174 formJump();
175 formFooter();
176 exit;
179 if ($formid) {
180 $row = sqlQuery ("SELECT * FROM form_football_injury_audit WHERE " .
181 "id = '$formid' AND activity = '1'") ;
184 <html>
185 <head>
186 <link rel=stylesheet href="<?echo $css_header;?>" type="text/css">
187 <style>
188 .billcell { font-family: sans-serif; font-size: 10pt }
189 </style>
191 <script type="text/javascript" src="../../../library/dialog.js"></script>
193 <script language="JavaScript">
195 // Pop up the coding window.
196 function docoding() {
197 var width = screen.width - 50;
198 if (!isNaN(top.screenX)) {
199 width -= top.screenX;
200 } else if (!isNaN(top.screenLeft)) {
201 width -= top.screenLeft;
203 if (width > 1000) width = 1000;
204 dlgopen('../../patient_file/encounter/coding_popup.php', '_blank', width, 550);
207 </script>
208 </head>
210 <body <?echo $top_bg_line;?> topmargin="0" rightmargin="0" leftmargin="2" bottommargin="0" marginwidth="2" marginheight="0">
211 <form method="post" action="<? echo $rootdir ?>/forms/football_injury_audit/new.php?id=<? echo $formid ?>">
213 <center>
215 <p class='title' style='margin-top:8px;margin-bottom:8px'>Football Injury Statistics</p>
217 <table border='1' width='98%'>
219 <tr bgcolor='#dddddd'>
220 <td colspan='2' align='center'><b>Time of Injury</b></td>
221 </tr>
223 <tr>
224 <td nowrap>Match Play</td>
225 <td nowrap>
226 <table width='100%'>
227 <tr>
228 <td nowrap>
229 Min of Injury
230 <input type='text' name='form_injmin' size='4'
231 value='<? echo addslashes($row['fiinjmin']) ?>' />
232 </td>
233 <? echo rbcell('form_injtime', '1', 'Warm Up' , 'fiinjtime') ?>
234 <? echo rbcell('form_injtime', '2', 'Extra Time', 'fiinjtime') ?>
235 <? echo rbcell('form_injtime', '3', 'Cool Down' , 'fiinjtime') ?>
236 </tr>
237 </table>
238 </td>
239 </tr>
241 <tr>
242 <td nowrap>Training</td>
243 <td nowrap>
244 <table width='100%'>
245 <tr>
246 <? echo rbcell('form_injtime', '4', 'Warm Up' , 'fiinjtime') ?>
247 <? echo rbcell('form_injtime', '5', 'During Session', 'fiinjtime') ?>
248 <? echo rbcell('form_injtime', '6', 'Cool Down' , 'fiinjtime') ?>
249 <? echo rbcell('form_injtime', '7', 'Rehabilitation', 'fiinjtime') ?>
250 </tr>
251 </table>
252 </td>
253 </tr>
255 <tr>
256 <td nowrap>Match Type</td>
257 <td nowrap>
258 <table width='100%'>
259 <tr>
260 <? echo rbcell('form_matchtype', '1', 'Premiership' , 'fimatchtype') ?>
261 <? echo rbcell('form_matchtype', '2', 'FA Cup' , 'fimatchtype') ?>
262 <? echo rbcell('form_matchtype', '3', 'League Cup' , 'fimatchtype') ?>
263 <? echo rbcell('form_matchtype', '4', 'Champions League Cup', 'fimatchtype') ?>
264 </tr>
265 <tr>
266 <? echo rbcell('form_matchtype', '5', 'Championship Match' , 'fimatchtype') ?>
267 <? echo rbcell('form_matchtype', '6', 'League One Match' , 'fimatchtype') ?>
268 <? echo rbcell('form_matchtype', '7', 'League Two Match' , 'fimatchtype') ?>
269 <? echo rbcell('form_matchtype', '8', 'International Match' , 'fimatchtype') ?>
270 </tr>
271 <tr>
272 <? echo rbcell('form_matchtype', '9', 'Friendly' , 'fimatchtype') ?>
273 <td width='25%'>&nbsp;</td>
274 <td width='25%'>&nbsp;</td>
275 <td width='25%'>&nbsp;</td>
276 </tr>
277 </table>
278 </td>
279 </tr>
281 <tr bgcolor='#dddddd'>
282 <td colspan='2' align='center'><b>Mechanism of Injury</b></td>
283 </tr>
285 <tr>
286 <td nowrap>Contact</td>
287 <td nowrap>
288 <table width='100%'>
289 <tr>
290 <? echo cbcell('form_mech_tackling' , 'Tackling' , 'fimech_tackling' ) ?>
291 <? echo cbcell('form_mech_tackled' , 'Tackled' , 'fimech_tackled' ) ?>
292 <? echo cbcell('form_mech_collision', 'Collision', 'fimech_collision') ?>
293 <? echo cbcell('form_mech_kicked' , 'Kicked' , 'fimech_kicked' ) ?>
294 </tr>
295 <tr>
296 <? echo cbcell('form_mech_elbow' , 'Use of Elbow' , 'fimech_elbow' ) ?>
297 <td colspan='3' nowrap>
298 Other:
299 <input type='text' name='form_mech_othercon' size='10'
300 title='Describe other'
301 value='<? echo addslashes($row['fimech_othercon']) ?>' />
302 </td>
303 </tr>
304 </table>
305 </td>
306 </tr>
308 <tr>
309 <td nowrap>Referee's Sanction</td>
310 <td nowrap>
311 <table width='100%'>
312 <tr>
313 <? echo cbcell('form_mech_nofoul' , 'No Foul' , 'fimech_nofoul' ) ?>
314 <? echo cbcell('form_mech_oppfoul', 'Opponent Foul', 'fimech_oppfoul') ?>
315 <? echo cbcell('form_mech_ownfoul', 'Own Foul' , 'fimech_ownfoul') ?>
316 <td width='25%'>&nbsp;</td>
317 </tr>
318 <tr>
319 <? echo cbcell('form_mech_yellow' , 'Yellow Card' , 'fimech_yellow' ) ?>
320 <? echo cbcell('form_mech_red' , 'Red Card' , 'fimech_red' ) ?>
321 <td width='25%'>&nbsp;</td>
322 <td width='25%'>&nbsp;</td>
323 </tr>
324 </table>
325 </td>
326 </tr>
328 <tr>
329 <td nowrap>Non Contact</td>
330 <td nowrap>
331 <table width='100%'>
332 <tr>
333 <? echo cbcell('form_mech_passing' , 'Passing' , 'fimech_passing' ) ?>
334 <? echo cbcell('form_mech_shooting' , 'Shooting' , 'fimech_shooting' ) ?>
335 <? echo cbcell('form_mech_running' , 'Running' , 'fimech_running' ) ?>
336 <? echo cbcell('form_mech_dribbling', 'Dribbling', 'fimech_dribbling') ?>
337 </tr>
338 <tr>
339 <? echo cbcell('form_mech_heading' , 'Heading' , 'fimech_heading' ) ?>
340 <? echo cbcell('form_mech_jumping' , 'Jumping' , 'fimech_jumping' ) ?>
341 <? echo cbcell('form_mech_landing' , 'Landing' , 'fimech_landing' ) ?>
342 <? echo cbcell('form_mech_fall' , 'Fall' , 'fimech_fall' ) ?>
343 </tr>
344 <tr>
345 <? echo cbcell('form_mech_stretching', 'Stretching' , 'fimech_stretching') ?>
346 <? echo cbcell('form_mech_turning' , 'Twisting/Turning', 'fimech_turning' ) ?>
347 <? echo cbcell('form_mech_throwing' , 'Throwing' , 'fimech_throwing' ) ?>
348 <? echo cbcell('form_mech_diving' , 'Diving' , 'fimech_diving' ) ?>
349 </tr>
350 <tr>
351 <? echo cbcell('form_mech_overuse', 'Overuse', 'fimech_overuse' ) ?>
352 <td colspan='3' nowrap>
353 Other:
354 <input type='text' name='form_mech_othernon' size='10'
355 title='Describe other'
356 value='<? echo addslashes($row['fimech_othernon']) ?>' />
357 </td>
358 </tr>
359 </table>
360 </td>
361 </tr>
363 <tr bgcolor='#dddddd'>
364 <td colspan='2' align='center'><b>Conditions</b></td>
365 </tr>
367 <tr>
368 <td nowrap>Surface</td>
369 <td nowrap>
370 <table width='100%'>
371 <tr>
372 <? echo rbcell('form_surface', '1', 'Pitch' , 'fisurface') ?>
373 <? echo rbcell('form_surface', '2', 'Training' , 'fisurface') ?>
374 <? echo rbcell('form_surface', '3', 'Artificial' , 'fisurface') ?>
375 <? echo rbcell('form_surface', '4', 'Indoor' , 'fisurface') ?>
376 </tr>
377 <tr>
378 <? echo rbcell('form_surface', '5', 'Gym' , 'fisurface') ?>
379 <? echo rbcell('form_surface', '6', 'Other' , 'fisurface') ?>
380 <td width='25%'>&nbsp;</td>
381 <td width='25%'>&nbsp;</td>
382 </tr>
383 </table>
384 </td>
385 </tr>
387 <tr>
388 <td nowrap>Position</td>
389 <td nowrap>
390 <table width='100%'>
391 <tr>
392 <? echo rbcell('form_position', '1', 'Defender' , 'fiposition') ?>
393 <? echo rbcell('form_position', '2', 'Midfield Offensive', 'fiposition') ?>
394 <? echo rbcell('form_position', '3', 'Midfield Defensive', 'fiposition') ?>
395 <? echo rbcell('form_position', '4', 'Forward' , 'fiposition') ?>
396 </tr>
397 <tr>
398 <? echo rbcell('form_position', '5', 'Goal Keeper' , 'fiposition') ?>
399 <? echo rbcell('form_position', '6', 'Substitute' , 'fiposition') ?>
400 <td width='25%'>&nbsp;</td>
401 <td width='25%'>&nbsp;</td>
402 </tr>
403 </table>
404 </td>
405 </tr>
407 <tr>
408 <td nowrap>Footwear</td>
409 <td nowrap>
410 <table width='100%'>
411 <tr>
412 <? echo rbcell('form_footwear', '1', 'Molded Stud' , 'fifootwear') ?>
413 <? echo rbcell('form_footwear', '2', 'Detachable Stud', 'fifootwear') ?>
414 <? echo rbcell('form_footwear', '3', 'Indoor Shoes' , 'fifootwear') ?>
415 <? echo rbcell('form_footwear', '4', 'Blades' , 'fifootwear') ?>
416 </tr>
417 </table>
418 </td>
419 </tr>
421 <tr>
422 <td nowrap>Side of Injury</td>
423 <td nowrap>
424 <table width='100%'>
425 <tr>
426 <? echo rbcell('form_side', '1', 'Left' , 'fiside') ?>
427 <? echo rbcell('form_side', '2', 'Right' , 'fiside') ?>
428 <? echo rbcell('form_side', '3', 'Bilateral' , 'fiside') ?>
429 <? echo rbcell('form_side', '4', 'Not Applicable', 'fiside') ?>
430 </tr>
431 </table>
432 </td>
433 </tr>
435 <tr bgcolor='#dddddd'>
436 <td colspan='2' align='center'><b>Post Injury Sequelae</b></td>
437 </tr>
439 <tr>
440 <td nowrap>Removed from<br>Play/Training<br>after Injury</td>
441 <td nowrap>
442 <table width='100%'>
443 <tr>
444 <? echo rbcell('form_removed', '1', 'Immediately', 'firemoved') ?>
445 <? echo rbcell('form_removed', '2', 'Later' , 'firemoved') ?>
446 <? echo rbcell('form_removed', '3', 'Not at All' , 'firemoved') ?>
447 <td width='25%'>&nbsp;</td>
448 </tr>
449 </table>
450 </td>
451 </tr>
453 </table>
456 <input type='submit' name='bn_save' value='Save' />
457 &nbsp;
458 <input type='button' value='Cancel' onclick="location='<?php echo $GLOBALS['form_exit_url']; ?>'" />
459 &nbsp;
460 <input type='button' value='Add Injury Diagnosis...' onclick='docoding();'
461 title='Add or change coding for this encounter'
462 style='background-color:#ffff00;' />
463 </p>
465 </center>
467 </form>
468 <?php
470 // TBD: If $alertmsg, display it with a JavaScript alert().
473 </body>
474 </html>