3 //////////////////////////////////////////////////////////////////////
4 // ------------------ DO NOT MODIFY VIEW.PHP !!! ---------------------
5 // View.php is an exact duplicate of new.php. If you wish to make
6 // any changes, then change new.php and either (recommended) make
7 // view.php a symbolic link to new.php, or copy new.php to view.php.
9 // And if you check in a change to either module, be sure to check
10 // in the other (identical) module also.
12 // This nonsense will go away if we ever move to subversion.
13 //////////////////////////////////////////////////////////////////////
15 // Copyright (C) 2005 Rod Roark <rod@sunsetsystems.com>
17 // This program is free software; you can redistribute it and/or
18 // modify it under the terms of the GNU General Public License
19 // as published by the Free Software Foundation; either version 2
20 // of the License, or (at your option) any later version.
22 require_once("../../globals.php");
23 require_once("$srcdir/api.inc.php");
24 require_once("$srcdir/forms.inc.php");
26 use OpenEMR\Core\Header
;
30 if (! $encounter) { // comes from globals.php
31 die("Internal error: we do not seem to be in an encounter!");
34 function rbvalue($rbname)
36 $tmp = $_POST[$rbname];
44 function cbvalue($cbname)
46 return $_POST[$cbname] ?
'1' : '0';
49 function rbinput($name, $value, $desc, $colname)
52 $ret = "<input type='radio' name='" . attr($name) . "' value='" . attr($value) . "'";
53 if ($row[$colname] == $value) {
57 $ret .= " />" . text($desc);
61 function rbcell($name, $value, $desc, $colname)
63 return "<td width='25%' nowrap>" . rbinput($name, $value, $desc, $colname) . "</td>\n";
66 function cbinput($name, $colname)
69 $ret = "<input type='checkbox' name='" . attr($name) . "' value='1'";
78 function cbcell($name, $desc, $colname)
80 return "<td width='25%' nowrap>" . cbinput($name, $colname) . "$desc</td>\n";
83 $formid = $_GET['id'];
85 // If Save was clicked, save the info.
87 if ($_POST['bn_save']) {
88 $tmp = strtotime($_POST['time'] . $_POST['timeampm']);
90 die("Time is not valid!");
93 $siinjtime = date("H:i:s", $tmp);
96 if ($_POST['activity'] == '7') {
97 $simech_other = $_POST['activity_other'];
98 } elseif ($_POST['activity'] == '23') {
99 $simech_other = $_POST['activity_nc_other'];
103 if ($_POST['treat_10']) {
104 $sitreat_other = $_POST['treat_other'];
107 // If updating an existing form...
110 $query = "UPDATE form_soccer_injury SET
139 sqlStatement($query, array( $siinjtime, rbvalue('gameplay'), rbvalue('activity'), $simech_other, rbvalue('surface'), rbvalue('position'), rbvalue('footwear'), cbvalue('equip_1'),
140 cbvalue('equip_2'), cbvalue('equip_3'), cbvalue('equip_4'), cbvalue('equip_5'), cbvalue('equip_6'), rbvalue('side'), rbvalue('removed'), cbvalue('treat_1'), cbvalue('treat_2'),
141 cbvalue('treat_3'), cbvalue('treat_4'), cbvalue('treat_5'), cbvalue('treat_6'), cbvalue('treat_7'), cbvalue('treat_8'), cbvalue('treat_9'), cbvalue('treat_10'), $sistreat_other, cbvalue('noreturn'),
143 } else { // If adding a new form...
144 $query = "INSERT INTO form_soccer_injury ( " .
145 "siinjtime, sigametime, simechanism, simech_other, sisurface, " .
146 "siposition, sifootwear, " .
147 "siequip_1, siequip_2, siequip_3, siequip_4, siequip_5, siequip_6, " .
148 "siside, siremoved, " .
149 "sitreat_1, sitreat_2, sitreat_3, sitreat_4, sitreat_5, " .
150 "sitreat_6, sitreat_7, sitreat_8, sitreat_9, sitreat_10, " .
151 "sitreat_other, sinoreturn " .
152 ") VALUES ( ?,?,?,?,?,?,?,?,?,?,?,?,
153 ?,?,?,?,?,?,?,?,?,?,?,?,
156 $newid = sqlInsert($query, array($siinjtime, rbvalue('gameplay'), rbvalue('activity'), $simech_other, rbvalue('surface'), rbvalue('position'), rbvalue('footwear'), cbvalue('equip_1'),
157 cbvalue('equip_2'), cbvalue('equip_3'), cbvalue('equip_4'), cbvalue('equip_5'), cbvalue('equip_6'), rbvalue('side'), rbvalue('removed'), cbvalue('treat_1'), cbvalue('treat_2'),
158 cbvalue('treat_3'), cbvalue('treat_4'), cbvalue('treat_5'), cbvalue('treat_6'), cbvalue('treat_7'), cbvalue('treat_8'), cbvalue('treat_9'), cbvalue('treat_10'), $sistreat_other, cbvalue('noreturn')));
160 addForm($encounter, "Football Injury", $newid, "soccer_injury", $pid, $userauthorized);
163 formHeader("Redirecting....");
172 $row = sqlQuery("SELECT * FROM form_soccer_injury WHERE " .
173 "id = ? AND activity = '1'", array($formid));
174 $siinjtime = substr($row['siinjtime'], 0, 5);
176 $siinjhour = substr($siinjtime, 0, 2);
177 if ($siinjhour > 12) {
179 $siinjtime = substr($siinjhour +
500 - 12, 1, 2) . substr($siinjtime, 2);
185 <?php Header
::setupHeader(); ?
>
187 .billcell
{ font
-family
: sans
-serif
; font
-size
: 10pt
}
194 <body
class="body_top">
195 <form method
="post" action
="<?php echo $rootdir ?>/forms/soccer_injury/new.php?id=<?php echo attr_url($formid); ?>" onsubmit
="return top.restoreSession()">
199 <p
class='title' style
='margin-top:8px;margin-bottom:8px'>Football Injury Statistics
</p
>
203 <tr bgcolor
='#dddddd'>
204 <td colspan
='2' align
='center'><b
>Time of Injury
</b
></td
>
210 <input type
='text' name
='time' size
='5' title
='Hour or hh:mm' value
='<?php echo attr($siinjtime); ?>' /> 
;
211 <input type
='radio' name
='timeampm' value
='am'<?php
if ($siampm == 'am') {
214 <input type
='radio' name
='timeampm' value
='pm'<?php
if ($siampm == 'pm') {
221 <td nowrap
>Game Play
</td
>
225 <?php
echo rbcell('gameplay', '1', '1st Quarter', 'sigametime') ?
>
226 <?php
echo rbcell('gameplay', '2', '2nd Quarter', 'sigametime') ?
>
227 <?php
echo rbcell('gameplay', '3', '3rd Quarter', 'sigametime') ?
>
228 <?php
echo rbcell('gameplay', '4', '4th Quarter', 'sigametime') ?
>
231 <?php
echo rbcell('gameplay', '5', 'Warm Up', 'sigametime') ?
>
232 <?php
echo rbcell('gameplay', '6', 'Extra Time', 'sigametime') ?
>
233 <?php
echo rbcell('gameplay', '7', 'Cool Down', 'sigametime') ?
>
234 <td width
='25%'> 
;</td
>
241 <td nowrap
>Training
</td
>
245 <?php
echo rbcell('gameplay', '11', 'Warm Up', 'sigametime') ?
>
246 <?php
echo rbcell('gameplay', '12', 'During Session', 'sigametime') ?
>
247 <?php
echo rbcell('gameplay', '13', 'Cool Down', 'sigametime') ?
>
248 <td width
='25%'> 
;</td
>
254 <tr bgcolor
='#dddddd'>
255 <td colspan
='2' align
='center'><b
>Mechanism of Injury
</b
></td
>
259 <td nowrap
>Contact
</td
>
263 <?php
echo rbcell('activity', '1', 'Tackling', 'simechanism') ?
>
264 <?php
echo rbcell('activity', '2', 'Tackled', 'simechanism') ?
>
265 <?php
echo rbcell('activity', '3', 'Collision', 'simechanism') ?
>
266 <?php
echo rbcell('activity', '4', 'Kicked', 'simechanism') ?
>
269 <?php
echo rbcell('activity', '5', 'Use of Elbow', 'simechanism') ?
>
270 <?php
echo rbcell('activity', '6', 'Hit by Ball', 'simechanism') ?
>
271 <td colspan
='2' nowrap
>
272 <?php
echo rbinput('activity', '7', 'Other:', 'simechanism') ?
>
273 <input type
='text' name
='activity_other' size
='10'
274 title
='Describe other'
275 value
='<?php echo attr($row['simech_other
']); ?>' />
283 <td nowrap
>Non Contact
</td
>
287 <?php
echo rbcell('activity', '11', 'Passing', 'simechanism') ?
>
288 <?php
echo rbcell('activity', '12', 'Shooting', 'simechanism') ?
>
289 <?php
echo rbcell('activity', '13', 'Running', 'simechanism') ?
>
290 <?php
echo rbcell('activity', '14', 'Dribbling', 'simechanism') ?
>
293 <?php
echo rbcell('activity', '15', 'Heading', 'simechanism') ?
>
294 <?php
echo rbcell('activity', '16', 'Jumping', 'simechanism') ?
>
295 <?php
echo rbcell('activity', '17', 'Landing', 'simechanism') ?
>
296 <?php
echo rbcell('activity', '18', 'Fall', 'simechanism') ?
>
299 <?php
echo rbcell('activity', '19', 'Stretching', 'simechanism') ?
>
300 <?php
echo rbcell('activity', '20', 'Twist/Turning', 'simechanism') ?
>
301 <?php
echo rbcell('activity', '21', 'Throwing', 'simechanism') ?
>
302 <?php
echo rbcell('activity', '22', 'Diving', 'simechanism') ?
>
305 <td colspan
='4' nowrap
>
306 <?php
echo rbinput('activity', '23', 'Other:', 'simechanism') ?
>
307 <input type
='text' name
='activity_nc_other' size
='10'
308 title
='Describe other'
309 value
='<?php echo attr($row['simech_other
']) ?>' />
316 <tr bgcolor
='#dddddd'>
317 <td colspan
='2' align
='center'><b
>Conditions
</b
></td
>
321 <td nowrap
>Surface
</td
>
325 <?php
echo rbcell('surface', '1', 'Pitch', 'sisurface') ?
>
326 <?php
echo rbcell('surface', '2', 'Training', 'sisurface') ?
>
327 <?php
echo rbcell('surface', '3', 'Artificial', 'sisurface') ?
>
328 <?php
echo rbcell('surface', '4', 'All Weather', 'sisurface') ?
>
331 <?php
echo rbcell('surface', '5', 'Indoor', 'sisurface') ?
>
332 <?php
echo rbcell('surface', '6', 'Gym', 'sisurface') ?
>
333 <?php
echo rbcell('surface', '7', 'Other', 'sisurface') ?
>
334 <td width
='25%'> 
;</td
>
341 <td nowrap
>Position
</td
>
345 <?php
echo rbcell('position', '1', 'Defender', 'siposition') ?
>
346 <?php
echo rbcell('position', '2', 'Midfield Offense', 'siposition') ?
>
347 <?php
echo rbcell('position', '3', 'Midfield Defense', 'siposition') ?
>
348 <?php
echo rbcell('position', '4', 'Wing Back', 'siposition') ?
>
351 <?php
echo rbcell('position', '5', 'Forward', 'siposition') ?
>
352 <?php
echo rbcell('position', '6', 'Striker', 'siposition') ?
>
353 <?php
echo rbcell('position', '7', 'Goal Keeper', 'siposition') ?
>
354 <?php
echo rbcell('position', '8', 'Starting Lineup', 'siposition') ?
>
357 <?php
echo rbcell('position', '9', 'Substitute', 'siposition') ?
>
358 <td width
='25%'> 
;</td
>
359 <td width
='25%'> 
;</td
>
360 <td width
='25%'> 
;</td
>
367 <td nowrap
>Footwear
</td
>
371 <?php
echo rbcell('footwear', '1', 'Molded Cleat', 'sifootwear') ?
>
372 <?php
echo rbcell('footwear', '2', 'Detachable Cleats', 'sifootwear') ?
>
373 <?php
echo rbcell('footwear', '3', 'Indoor Shoes', 'sifootwear') ?
>
374 <?php
echo rbcell('footwear', '4', 'Turf Shoes', 'sifootwear') ?
>
381 <td nowrap
>Other Equipment
</td
>
385 <?php
echo cbcell('equip_1', 'Shin Pads', 'siequip_1') ?
>
386 <?php
echo cbcell('equip_2', 'Gloves', 'siequip_2') ?
>
387 <?php
echo cbcell('equip_3', 'Ankle Strapping', 'siequip_3') ?
>
388 <?php
echo cbcell('equip_4', 'Knee Strapping', 'siequip_4') ?
>
391 <?php
echo cbcell('equip_5', 'Bracing', 'siequip_5') ?
>
392 <?php
echo cbcell('equip_6', 'Synthetic Cast', 'siequip_6') ?
>
393 <td width
='25%'> 
;</td
>
394 <td width
='25%'> 
;</td
>
401 <td nowrap
>Side of Injury
</td
>
405 <?php
echo rbcell('side', '1', 'Left', 'siside') ?
>
406 <?php
echo rbcell('side', '2', 'Right', 'siside') ?
>
407 <?php
echo rbcell('side', '3', 'Bilateral', 'siside') ?
>
408 <?php
echo rbcell('side', '4', 'Not Applicable', 'siside') ?
>
414 <tr bgcolor
='#dddddd'>
415 <td colspan
='2' align
='center'><b
>Post Injury Sequelae
</b
></td
>
419 <td nowrap
>Removed from
<br
/>Play
/Training
<br
/>after Injury
</td
>
423 <?php
echo rbcell('removed', '1', 'Immediately', 'siremoved') ?
>
424 <?php
echo rbcell('removed', '2', 'Later', 'siremoved') ?
>
425 <?php
echo rbcell('removed', '3', 'Not at All', 'siremoved') ?
>
426 <td width
='25%'> 
;</td
>
433 <td nowrap
>Medical Treatment
<br
/>Sought from
</td
>
437 <?php
echo cbcell('treat_1', 'Hospital A&E Dept', 'sitreat_1') ?
>
438 <?php
echo cbcell('treat_2', 'General Practitioner', 'sitreat_2') ?
>
439 <?php
echo cbcell('treat_3', 'Physiotherapist', 'sitreat_3') ?
>
440 <?php
echo cbcell('treat_4', 'Nurse', 'sitreat_4') ?
>
443 <?php
echo cbcell('treat_5', 'Hospital Specialist', 'sitreat_5') ?
>
444 <?php
echo cbcell('treat_6', 'Osteopath', 'sitreat_6') ?
>
445 <?php
echo cbcell('treat_7', 'Chiropractor', 'sitreat_7') ?
>
446 <?php
echo cbcell('treat_8', 'Sports Massage Th', 'sitreat_8') ?
>
449 <?php
echo cbcell('treat_9', 'Sports Physician', 'sitreat_9') ?
>
450 <td colspan
='3' nowrap
>
451 <?php
echo cbinput('treat_10', 'sitreat_10') ?
>Other
:
452 <input type
='text' name
='treat_other' size
='10'
453 title
='Describe other'
454 value
='<?php echo attr($row['sitreat_other
']) ?>' />
462 <td colspan
='2' nowrap
>
463 If player is unlikely to
return to play please check here
:
464 <?php
echo cbinput('noreturn', 'sinoreturn') ?
>
471 <input type
='submit' name
='bn_save' value
='Save' />
473 <input type
='button' value
='Cancel' onclick
="parent.closeTab(window.name, false)" />
481 // TBD: If $alertmsg, display it with a JavaScript alert().