forked from openemr/openemr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
football_injury.inc.php
578 lines (536 loc) · 15.3 KB
/
football_injury.inc.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
<?php
$arr_injtime = array(
'1' => 'Warm Up',
'2' => 'Extra Time',
'3' => 'Cool Down',
'4' => 'Training Warm Up (deprecated)',
'5' => 'Training Session (deprecated)',
'6' => 'Training Cool Down (deprecated)',
'7' => 'Training Rehab (deprecated)',
);
// This is the number of leading entries in $arr_activity that are for
// injuries due to contact with a player or object.
$arr_activity_contact_count = 12;
$arr_activity = array(
'blocked' => 'Blocked', // new
'hitbyball' => 'Hit by Ball', // new
'goalpost' => 'Collision with Goal Post', // new
'ground' => 'Collision with Ground', // new
'kicked' => 'Collision with Other Player',
'collother' => 'Collision with Other Object', // new
'collision' => 'Collision Non Specified',
'tackled' => 'Tackled from Front',
'tackside' => 'Tackled from Side', // new
'tackback' => 'Tackled from Back', // new
'tackling' => 'Tackling Other Player',
'elbow' => 'Use of Arm/Elbow',
// 12 Contact entries, see $arr_activity_contact_count.
'running' => 'Running/Sprinting',
'turning' => 'Twisting/Turning',
'shooting' => 'Shooting',
'passing' => 'Passing/Crossing',
'dribbling' => 'Dribbling',
'jumping' => 'Jumping/Landing',
'fall' => 'Falling/Diving',
'stretching' => 'Stretching',
'sliding' => 'Sliding', // new
'throwing' => 'Throwing',
'heading' => 'Heading',
'landing' => 'Landing (deprecated)', // change to jumping
'diving' => 'Diving (deprecated)', // change to fall
'overuse' => 'Overuse (deprecated)', // s/b recorded in Classification
);
$arr_sanction = array(
'nofoul' => 'No Foul',
'oppfoul' => 'Opponent Foul',
'ownfoul' => 'Own Foul',
'yellow' => 'Yellow Card',
'red' => 'Red Card',
);
$arr_surface = array(
'7' => 'Grass' ,
'3' => 'Outdoor Artificial' ,
'4' => 'Indoor Artificial' ,
'8' => 'Wooden' ,
'9' => 'Concrete' ,
'10' => 'Carpet' ,
'6' => 'Other' ,
'1' => 'Pitch (deprecated)' ,
'2' => 'Training (deprecated)',
'5' => 'Gym (deprecated)' ,
);
$arr_condition = array(
'1' => 'Hard' ,
'2' => 'Firm' ,
'3' => 'Soft' ,
'4' => 'Slippery/Wet',
'5' => 'Uneven' ,
'6' => 'Good' ,
'7' => 'Poor' ,
);
$arr_weather = array(
'sunny' => 'Sunny' ,
'rainy' => 'Rainy' ,
'windy' => 'Windy' ,
'dry' => 'Dry' ,
'sleet' => 'Sleet/Snow',
'overcast' => 'Overcast' ,
);
$arr_position = array(
'5' => 'Goal Keeper' ,
'1' => 'Defender' ,
'7' => 'Midfielder' ,
'4' => 'Forward' ,
'2' => 'Midfield Offensive (deprecated)',
'3' => 'Midfield Defensive (deprecated)',
'6' => 'Substitute (deprecated)' ,
);
$arr_footwear = array(
'4' => 'Blades' ,
'1' => 'Molded Studs' ,
'2' => 'Detachable Studs',
'3' => 'Indoor Shoes' ,
'5' => 'Trainers' ,
);
/*********************************************************************
$arr_side = array(
'1' => 'Left' ,
'2' => 'Right' ,
'3' => 'Bilateral' ,
'4' => 'Not Applicable',
);
*********************************************************************/
$arr_removed = array(
'1' => 'Immediately',
'2' => 'Later' ,
'3' => 'Not at All' ,
);
$arr_match_type = array(
'1' => 'Premiership (deprecated)',
'2' => 'FA Cup (deprecated)',
'3' => 'League Cup (deprecated)',
'4' => 'Champions League Cup (deprecated)',
'5' => 'Championship Match (deprecated)',
'6' => 'League One Match (deprecated)',
'7' => 'League Two Match (deprecated)',
'8' => 'International Match (deprecated)',
'9' => 'Friendly',
'10' => 'League Match',
'11' => 'UEFA Champtions League Match',
'12' => 'UEFA Europa League Match',
'13' => 'Carling Cup Match',
'14' => 'Other Cup Match',
'15' => 'National Match',
'16' => 'Reserve Match',
'17' => 'Youth Team Match',
);
$arr_training_type = array(
'51' => 'Football',
'52' => 'Other',
'53' => 'Mixed i.e. Football + Other',
'54' => 'Endurance',
'55' => 'Speed Agility Quickness',
'56' => 'Strength',
'57' => 'Injury Prevention F-mark 11',
'58' => 'Injury Prevention Squad Own',
'59' => 'Recovery',
);
$firow = array();
function rbfiinput($name, $value, $desc, $colname) {
global $firow;
$ret = "<input type='radio' name='$name' value='$value'";
if ($firow[$colname] == $value) $ret .= " checked";
$ret .= " />$desc";
return $ret;
}
function rbficell($name, $value, $desc, $colname) {
return "<td width='25%' nowrap>" . rbfiinput($name, $value, $desc, $colname) . "</td>\n";
}
function cbfiinput($name, $colname) {
global $firow;
$ret = "<input type='checkbox' name='$name' value='1'";
if ($firow[$colname]) $ret .= " checked";
$ret .= " />";
return $ret;
}
function cbficell($name, $desc, $colname) {
return "<td width='25%' nowrap>" . cbfiinput($name, $colname) . "$desc</td>\n";
}
function issue_football_injury_newtype() {
echo " var fiadisp = (aitypes[index] == 2) ? '' : 'none';\n";
echo " document.getElementById('football_injury').style.display = fiadisp;\n";
}
function issue_football_injury_save($issue) {
global $arr_activity, $arr_sanction, $arr_weather;
$query = "REPLACE INTO lists_football_injury ( " .
"id, fiinjmin, fiinjtime, fimatchtype, ";
foreach ($arr_activity as $key => $value)
$query .= "fimech_$key, ";
foreach ($arr_sanction as $key => $value)
$query .= "fimech_$key, ";
foreach ($arr_weather as $key => $value)
$query .= "fiweather_$key, ";
$query .= "fimech_othercon, fimech_othernon, fiweather_temperature, " .
"fisurface, fiposition, fifootwear, firemoved, ficondition " .
") VALUES ( " .
$issue . ", " .
invalue('form_injmin') . ", " .
rbvalue('form_injtime') . ", " .
rbvalue('form_matchtype') . ", ";
foreach ($arr_activity as $key => $value)
$query .= cbvalue("form_mech_$key") . ", ";
foreach ($arr_sanction as $key => $value)
$query .= cbvalue("form_mech_$key") . ", ";
foreach ($arr_weather as $key => $value)
$query .= cbvalue("form_weather_$key") . ", ";
$query .=
txvalue('form_mech_othercon') . ", " .
txvalue('form_mech_othernon') . ", " .
txvalue('form_weather_temperature') . ", " .
rbvalue('form_surface') . ", " .
rbvalue('form_position') . ", " .
rbvalue('form_footwear') . ", " .
// rbvalue('form_side') . ", " .
rbvalue('form_removed') . ", " .
rbvalue('form_condition') . " " .
")";
sqlStatement($query);
}
function issue_football_injury_form($issue) {
global $firow, $arr_match_type, $arr_injtime, $arr_training_type;
global $arr_activity, $arr_activity_contact_count, $arr_position;
global $arr_surface, $arr_condition, $arr_weather, $arr_footwear;
if ($issue) {
$firow = sqlQuery ("SELECT * FROM lists_football_injury WHERE id = '$issue'");
} else {
$firow = array();
}
?>
<table border='1' width='98%' id='football_injury' style='display:none;margin-top:6pt;'>
<tr bgcolor='#dddddd'>
<td colspan='2' align='center'><b>Timing of Injury</b></td>
</tr>
<tr>
<td nowrap>Match Play</td>
<td nowrap>
<table width='100%'>
<tr>
<td nowrap>
Min of Injury
<input type='text' name='form_injmin' size='4'
value='<?php echo addslashes($firow['fiinjmin']) ?>' />
</td>
<?php
$i = 1;
foreach ($arr_injtime as $key => $value) {
// Skip deprecated values except if currently selected.
if (stristr($value, 'deprecated') && $firow['fiinjtime'] != $key) continue;
//
if ($i % 4 == 0) echo " <tr>\n";
echo " " . rbficell('form_injtime', $key, $value, 'fiinjtime');
++$i;
if ($i % 4 == 0) echo " </tr>\n";
}
while ($i % 4 > 0) {
echo " <td width='25%'> </td>\n";
++$i;
if ($i % 4 == 0) echo " </tr>\n";
}
?>
</tr>
</table>
</td>
</tr>
<!-- Training Type and Match Type are all a single set of radio buttons. -->
<tr>
<td nowrap>Training Type</td>
<td nowrap>
<table width='100%'>
<?php
$i = 0;
foreach ($arr_training_type as $key => $value) {
if ($i % 4 == 0) echo " <tr>\n";
echo " " . rbficell('form_matchtype', $key, $value, 'fimatchtype');
++$i;
if ($i % 4 == 0) echo " </tr>\n";
}
while ($i % 4 > 0) {
echo " <td width='25%'> </td>\n";
++$i;
if ($i % 4 == 0) echo " </tr>\n";
}
?>
</table>
</td>
</tr>
<tr>
<td nowrap>Match Type</td>
<td nowrap>
<table width='100%'>
<?php
$i = 0;
foreach ($arr_match_type as $key => $value) {
// Skip deprecated values except if currently selected.
if (stristr($value, 'deprecated') && $firow['fimatchtype'] != $key) continue;
//
if ($i % 4 == 0) echo " <tr>\n";
echo " " . rbficell('form_matchtype', $key, $value, 'fimatchtype');
++$i;
if ($i % 4 == 0) echo " </tr>\n";
}
while ($i % 4 > 0) {
echo " <td width='25%'> </td>\n";
++$i;
if ($i % 4 == 0) echo " </tr>\n";
}
?>
</table>
</td>
</tr>
<tr bgcolor='#dddddd'>
<td colspan='2' align='center'><b>Injury Mechanism</b></td>
</tr>
<tr>
<td nowrap>Contact</td>
<td nowrap>
<table width='100%'>
<?php
$i = 0;
$index = 0;
foreach ($arr_activity as $key => $value) {
if (++$index > $arr_activity_contact_count) break;
// Skip deprecated values except if currently selected.
if (stristr($value, 'deprecated') && empty($firow["fimech_$key"])) continue;
//
if ($i % 4 == 0) echo " <tr>\n";
echo " " . cbficell("form_mech_$key", $value, "fimech_$key");
++$i;
if ($i % 4 == 0) echo " </tr>\n";
}
?>
<td nowrap>
Other:
<input type='text' name='form_mech_othercon' size='8'
title='Describe other'
value='<?php echo addslashes($firow['fimech_othercon']) ?>' />
</td>
<?php
++$i;
if ($i % 4 == 0) echo " </tr>\n";
while ($i % 4 > 0) {
echo " <td width='25%'> </td>\n";
++$i;
if ($i % 4 == 0) echo " </tr>\n";
}
?>
</table>
</td>
</tr>
<tr>
<td nowrap>Non Contact</td>
<td nowrap>
<table width='100%'>
<?php
$i = 0;
$index = 0;
foreach ($arr_activity as $key => $value) {
if (++$index <= $arr_activity_contact_count) continue;
// Skip deprecated values except if currently selected.
if (stristr($value, 'deprecated') && empty($firow["fimech_$key"])) continue;
//
if ($i % 4 == 0) echo " <tr>\n";
echo " " . cbficell("form_mech_$key", $value, "fimech_$key");
++$i;
if ($i % 4 == 0) echo " </tr>\n";
}
?>
<td nowrap>
Other:
<input type='text' name='form_mech_othernon' size='8'
title='Describe other'
value='<?php echo addslashes($firow['fimech_othernon']) ?>' />
</td>
<?php
++$i;
if ($i % 4 == 0) echo " </tr>\n";
while ($i % 4 > 0) {
echo " <td width='25%'> </td>\n";
++$i;
if ($i % 4 == 0) echo " </tr>\n";
}
?>
</table>
</td>
</tr>
<tr bgcolor='#dddddd'>
<td colspan='2' align='center'><b>Additional Factors</b></td>
</tr>
<tr>
<td nowrap>Playing Position</td>
<td nowrap>
<table width='100%'>
<?php
$i = 0;
foreach ($arr_position as $key => $value) {
// Skip deprecated values except if currently selected.
if (stristr($value, 'deprecated') && $firow['fiposition'] != $key) continue;
//
if ($i % 4 == 0) echo " <tr>\n";
echo " " . rbficell('form_position', $key, $value, 'fiposition');
++$i;
if ($i % 4 == 0) echo " </tr>\n";
}
while ($i % 4 > 0) {
echo " <td width='25%'> </td>\n";
++$i;
if ($i % 4 == 0) echo " </tr>\n";
}
?>
</table>
</td>
</tr>
<tr>
<td nowrap>Surface</td>
<td nowrap>
<table width='100%'>
<?php
$i = 0;
foreach ($arr_surface as $key => $value) {
// Skip deprecated values except if currently selected.
if (stristr($value, 'deprecated') && $firow['fisurface'] != $key) continue;
//
if ($i % 4 == 0) echo " <tr>\n";
echo " " . rbficell('form_surface', $key, $value, 'fisurface');
++$i;
if ($i % 4 == 0) echo " </tr>\n";
}
while ($i % 4 > 0) {
echo " <td width='25%'> </td>\n";
++$i;
if ($i % 4 == 0) echo " </tr>\n";
}
?>
</table>
</td>
</tr>
<tr>
<td nowrap>Condition of Grass/Pitch</td>
<td nowrap>
<table width='100%'>
<?php
$i = 0;
foreach ($arr_condition as $key => $value) {
// Skip deprecated values except if currently selected.
if (stristr($value, 'deprecated') && $firow['ficondition'] != $key) continue;
//
if ($i % 4 == 0) echo " <tr>\n";
echo " " . rbficell('form_condition', $key, $value, 'ficondition');
++$i;
if ($i % 4 == 0) echo " </tr>\n";
}
while ($i % 4 > 0) {
echo " <td width='25%'> </td>\n";
++$i;
if ($i % 4 == 0) echo " </tr>\n";
}
?>
</table>
</td>
</tr>
<tr>
<td nowrap>Weather Conditions</td>
<td nowrap>
<table width='100%'>
<?php
$i = 0;
foreach ($arr_weather as $key => $value) {
if ($i % 4 == 0) echo " <tr>\n";
echo " " . cbficell("form_weather_$key", $value, "fiweather_$key");
++$i;
if ($i % 4 == 0) echo " </tr>\n";
}
?>
<td nowrap>
Temperature:
<input type='text' name='form_weather_temperature' size='3'
title='Ambient temperature in degrees Celsius'
value='<?php echo addslashes($firow['fiweather_temperature']) ?>' />
</td>
<?php
++$i;
if ($i % 4 == 0) echo " </tr>\n";
while ($i % 4 > 0) {
echo " <td width='25%'> </td>\n";
++$i;
if ($i % 4 == 0) echo " </tr>\n";
}
?>
</table>
</td>
</tr>
<tr>
<td nowrap>Footwear</td>
<td nowrap>
<table width='100%'>
<?php
$i = 0;
foreach ($arr_footwear as $key => $value) {
// Skip deprecated values except if currently selected.
if (stristr($value, 'deprecated') && $firow['fifootwear'] != $key) continue;
//
if ($i % 4 == 0) echo " <tr>\n";
echo " " . rbficell('form_footwear', $key, $value, 'fifootwear');
++$i;
if ($i % 4 == 0) echo " </tr>\n";
}
while ($i % 4 > 0) {
echo " <td width='25%'> </td>\n";
++$i;
if ($i % 4 == 0) echo " </tr>\n";
}
?>
</table>
</td>
</tr>
<tr bgcolor='#dddddd'>
<td colspan='2' align='center'><b>Referee's Sanction</b></td>
</tr>
<tr>
<td nowrap>Referee's Sanction</td>
<td nowrap>
<table width='100%'>
<tr>
<?php echo cbficell('form_mech_nofoul' , 'No Foul' , 'fimech_nofoul' ) ?>
<?php echo cbficell('form_mech_oppfoul', 'Opponent Foul', 'fimech_oppfoul') ?>
<?php echo cbficell('form_mech_ownfoul', 'Own Foul' , 'fimech_ownfoul') ?>
<td width='25%'> </td>
</tr>
<tr>
<?php echo cbficell('form_mech_yellow' , 'Yellow Card' , 'fimech_yellow' ) ?>
<?php echo cbficell('form_mech_red' , 'Red Card' , 'fimech_red' ) ?>
<td width='25%'> </td>
<td width='25%'> </td>
</tr>
</table>
</td>
</tr>
<tr bgcolor='#dddddd'>
<td colspan='2' align='center'><b>Post Injury Sequelae</b></td>
</tr>
<tr>
<td nowrap>Removed from<br>Play/Training<br>after Injury</td>
<td nowrap>
<table width='100%'>
<tr>
<?php echo rbficell('form_removed', '1', 'Immediately', 'firemoved') ?>
<?php echo rbficell('form_removed', '2', 'Later' , 'firemoved') ?>
<?php echo rbficell('form_removed', '3', 'Not at All' , 'firemoved') ?>
<td width='25%'> </td>
</tr>
</table>
</td>
</tr>
</table>
<?php
}
?>