3 * add or edit a medical problem.
5 * Copyright (C) 2005-2011 Rod Roark <rod@sunsetsystems.com>
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
13 * @author Rod Roark <rod@sunsetsystems.com>
14 * @link http://www.open-emr.org
17 //SANITIZE ALL ESCAPES
18 $sanitize_all_escapes=true;
21 //STOP FAKE REGISTER GLOBALS
22 $fake_register_globals=false;
25 require_once('../../globals.php');
26 require_once($GLOBALS['srcdir'].'/lists.inc');
27 require_once($GLOBALS['srcdir'].'/patient.inc');
28 require_once($GLOBALS['srcdir'].'/acl.inc');
29 require_once($GLOBALS['srcdir'].'/options.inc.php');
30 require_once($GLOBALS['fileroot'].'/custom/code_types.inc.php');
31 require_once($GLOBALS['srcdir'].'/csv_like_join.php');
32 require_once($GLOBALS['srcdir'].'/htmlspecialchars.inc.php');
33 require_once($GLOBALS['srcdir'].'/formdata.inc.php');
35 if (isset($ISSUE_TYPES['football_injury'])) {
36 if ($ISSUE_TYPES['football_injury']) {
37 // Most of the logic for the "football injury" issue type comes from this
38 // included script. We might eventually refine this approach to support
39 // a plug-in architecture for custom issue types.
40 require_once($GLOBALS['srcdir'].'/football_injury.inc.php');
43 if (isset($ISSUE_TYPES['ippf_gcac'])) {
44 if ($ISSUE_TYPES['ippf_gcac']) {
45 // Similarly for IPPF issues.
46 require_once($GLOBALS['srcdir'].'/ippf_issues.inc.php');
50 $issue = $_REQUEST['issue'];
51 $thispid = 0 +
(empty($_REQUEST['thispid']) ?
$pid : $_REQUEST['thispid']);
54 // A nonempty thisenc means we are to link the issue to the encounter.
55 $thisenc = 0 +
(empty($_REQUEST['thisenc']) ?
0 : $_REQUEST['thisenc']);
57 // A nonempty thistype is an issue type to be forced for a new issue.
58 $thistype = empty($_REQUEST['thistype']) ?
'' : $_REQUEST['thistype'];
60 if ($issue && !acl_check('patients','med','','write') ) die(xlt("Edit is not authorized!"));
61 if ( !acl_check('patients','med','',array('write','addonly') )) die(xlt("Add is not authorized!"));
63 $tmp = getPatientData($thispid, "squad");
64 if ($tmp['squad'] && ! acl_check('squads', $tmp['squad']))
65 die(xlt("Not authorized for this squad!"));
67 function QuotedOrNull($fld) {
68 if ($fld) return "'".add_escape_custom($fld)."'";
73 // Do not use this function since quotes are added in query escaping mechanism
74 // Only keeping since used in the football injury code football_injury.inc.php that is included.
75 // If start using this function, then incorporate the add_escape_custom() function into it
76 function rbvalue($rbname) {
77 $tmp = $_POST[$rbname];
78 if (! $tmp) $tmp = '0';
82 function cbvalue($cbname) {
83 return $_POST[$cbname] ?
'1' : '0';
86 function invalue($inname) {
87 return (int) trim($_POST[$inname]);
90 // Do not use this function since quotes are added in query escaping mechanism
91 // Only keeping since used in the football injury code football_injury.inc.php that is included.
92 // If start using this function, then incorporate the add_escape_custom() function into it
93 function txvalue($txname) {
94 return "'" . trim($_POST[$txname]) . "'";
97 function rbinput($name, $value, $desc, $colname) {
99 $ret = "<input type='radio' name='".attr($name)."' value='".attr($value)."'";
100 if ($irow[$colname] == $value) $ret .= " checked";
101 $ret .= " />".text($desc);
105 function rbcell($name, $value, $desc, $colname) {
106 return "<td width='25%' nowrap>" . rbinput($name, $value, $desc, $colname) . "</td>\n";
109 // Given an issue type as a string, compute its index.
110 function issueTypeIndex($tstr) {
113 foreach ($ISSUE_TYPES as $key => $value) {
114 if ($key == $tstr) break;
120 // If we are saving, then save and close the window.
122 if ($_POST['form_save']) {
125 $text_type = "unknown";
126 foreach ($ISSUE_TYPES as $key => $value) {
127 if ($i++
== $_POST['form_type']) $text_type = $key;
130 $form_begin = fixDate($_POST['form_begin'], '');
131 $form_end = fixDate($_POST['form_end'], '');
133 if ($text_type == 'football_injury') {
134 $form_injury_part = $_POST['form_injury_part'];
135 $form_injury_type = $_POST['form_injury_type'];
138 $form_injury_part = $_POST['form_medical_system'];
139 $form_injury_type = $_POST['form_medical_type'];
144 $query = "UPDATE lists SET " .
145 "type = '" . add_escape_custom($text_type) . "', " .
146 "title = '" . add_escape_custom($_POST['form_title']) . "', " .
147 "comments = '" . add_escape_custom($_POST['form_comments']) . "', " .
148 "begdate = " . QuotedOrNull($form_begin) . ", " .
149 "enddate = " . QuotedOrNull($form_end) . ", " .
150 "returndate = " . QuotedOrNull($form_return) . ", " .
151 "diagnosis = '" . add_escape_custom($_POST['form_diagnosis']) . "', " .
152 "occurrence = '" . add_escape_custom($_POST['form_occur']) . "', " .
153 "classification = '" . add_escape_custom($_POST['form_classification']) . "', " .
154 "reinjury_id = '" . add_escape_custom($_POST['form_reinjury_id']) . "', " .
155 "referredby = '" . add_escape_custom($_POST['form_referredby']) . "', " .
156 "injury_grade = '" . add_escape_custom($_POST['form_injury_grade']) . "', " .
157 "injury_part = '" . add_escape_custom($form_injury_part) . "', " .
158 "injury_type = '" . add_escape_custom($form_injury_type) . "', " .
159 "outcome = '" . add_escape_custom($_POST['form_outcome']) . "', " .
160 "destination = '" . add_escape_custom($_POST['form_destination']) . "', " .
161 "reaction ='" . add_escape_custom($_POST['form_reaction']) . "', " .
162 "erx_uploaded = '0', " .
163 "modifydate = NOW() " .
164 "WHERE id = '" . add_escape_custom($issue) . "'";
165 sqlStatement($query);
166 if ($text_type == "medication" && enddate
!= '') {
167 sqlStatement('UPDATE prescriptions SET '
168 . 'medication = 0 where patient_id = ? '
169 . " and upper(trim(drug)) = ? "
170 . ' and medication = 1', array($thispid,strtoupper($_POST['form_title'])) );
175 $issue = sqlInsert("INSERT INTO lists ( " .
176 "date, pid, type, title, activity, comments, begdate, enddate, returndate, " .
177 "diagnosis, occurrence, classification, referredby, user, groupname, " .
178 "outcome, destination, reinjury_id, injury_grade, injury_part, injury_type, " .
182 "'" . add_escape_custom($thispid) . "', " .
183 "'" . add_escape_custom($text_type) . "', " .
184 "'" . add_escape_custom($_POST['form_title']) . "', " .
186 "'" . add_escape_custom($_POST['form_comments']) . "', " .
187 QuotedOrNull($form_begin) . ", " .
188 QuotedOrNull($form_end) . ", " .
189 QuotedOrNull($form_return) . ", " .
190 "'" . add_escape_custom($_POST['form_diagnosis']) . "', " .
191 "'" . add_escape_custom($_POST['form_occur']) . "', " .
192 "'" . add_escape_custom($_POST['form_classification']) . "', " .
193 "'" . add_escape_custom($_POST['form_referredby']) . "', " .
194 "'" . add_escape_custom($
$_SESSION['authUser']) . "', " .
195 "'" . add_escape_custom($
$_SESSION['authProvider']) . "', " .
196 "'" . add_escape_custom($_POST['form_outcome']) . "', " .
197 "'" . add_escape_custom($_POST['form_destination']) . "', " .
198 "'" . add_escape_custom($_POST['form_reinjury_id']) . "', " .
199 "'" . add_escape_custom($_POST['form_injury_grade']) . "', " .
200 "'" . add_escape_custom($form_injury_part) . "', " .
201 "'" . add_escape_custom($form_injury_type) . "', " .
202 "'" . add_escape_custom($_POST['form_reaction']) . "' " .
207 // For record/reporting purposes, place entry in lists_touch table.
208 setListTouch($thispid,$text_type);
210 if ($text_type == 'football_injury') issue_football_injury_save($issue);
211 if ($text_type == 'ippf_gcac' ) issue_ippf_gcac_save($issue);
212 if ($text_type == 'contraceptive' ) issue_ippf_con_save($issue);
214 // If requested, link the issue to a specified encounter.
216 $query = "INSERT INTO issue_encounter ( " .
217 "pid, list_id, encounter " .
218 ") VALUES ( ?,?,? )";
219 sqlStatement($query, array($thispid,$issue,$thisenc));
222 $tmp_title = addslashes($ISSUE_TYPES[$text_type][2] . ": $form_begin " .
223 substr($_POST['form_title'], 0, 40));
225 // Close this window and redisplay the updated list of issues.
227 echo "<html><body><script language='JavaScript'>\n";
228 if ($info_msg) echo " alert('$info_msg');\n";
230 echo " var myboss = opener ? opener : parent;\n";
231 echo " if (myboss.refreshIssue) myboss.refreshIssue($issue,'$tmp_title');\n";
232 echo " else if (myboss.reloadIssues) myboss.reloadIssues();\n";
233 echo " else myboss.location.reload();\n";
234 echo " if (parent.$ && parent.$.fancybox) parent.$.fancybox.close();\n";
235 echo " else window.close();\n";
237 echo "</script></body></html>\n";
243 $irow = sqlQuery("SELECT * FROM lists WHERE id = ?",array($issue));
245 $irow['type'] = $thistype;
249 if (!empty($irow['type'])) {
250 foreach ($ISSUE_TYPES as $key => $value) {
251 if ($key == $irow['type']) break;
258 <?php
html_header_show();?
>
259 <title
><?php
echo $issue ?
xlt('Edit') : xlt('Add New'); ?
><?php
echo " ".xlt('Issue'); ?
></title
>
260 <link rel
="stylesheet" href
='<?php echo $css_header ?>' type
='text/css'>
264 td
, input
, select
, textarea
{
265 font
-family
: Arial
, Helvetica
, sans
-serif
;
272 border
-color
: #0000ff;
279 <style type
="text/css">@import
url(<?php
echo $GLOBALS['webroot']; ?
>/library
/dynarch_calendar
.css
);</style
>
280 <script type
="text/javascript" src
="<?php echo $GLOBALS['webroot']; ?>/library/dynarch_calendar.js"></script
>
281 <?php
require_once($GLOBALS['srcdir'].'/dynarch_calendar_en.inc.php'); ?
>
282 <script type
="text/javascript" src
="<?php echo $GLOBALS['webroot']; ?>/library/dynarch_calendar_setup.js"></script
>
283 <script type
="text/javascript" src
="<?php echo $GLOBALS['webroot']; ?>/library/textformat.js"></script
>
284 <script type
="text/javascript" src
="<?php echo $GLOBALS['webroot']; ?>/library/dialog.js"></script
>
286 <script language
="JavaScript">
288 var mypcc
= '<?php echo $GLOBALS['phone_country_code
'] ?>';
290 var aitypes
= new Array(); // issue type attributes
291 var aopts
= new Array(); // Option objects
294 foreach ($ISSUE_TYPES as $key => $value) {
295 echo " aitypes[$i] = " . attr($value[3]) . ";\n";
296 echo " aopts[$i] = new Array();\n";
297 $qry = sqlStatement("SELECT * FROM list_options WHERE list_id = ?",array($key."_issue_list"));
298 while($res = sqlFetchArray($qry)){
299 echo " aopts[$i][aopts[$i].length] = new Option('".attr(trim($res['option_id']))."', '".attr(xl_list_label(trim($res['title'])))."', false, false);\n";
305 <?php
require($GLOBALS['srcdir'] . "/restoreSession.php"); ?
>
307 // React to selection of an issue type. This loads the associated
308 // shortcuts into the selection list of titles, and determines which
309 // rows are displayed or hidden.
310 function newtype(index
) {
311 var f
= document
.forms
[0];
312 var theopts
= f
.form_titles
.options
;
315 for (i
= 0; i
< aopts
[index
].length
; ++i
) {
316 theopts
[i
] = aopts
[index
][i
];
318 document
.getElementById('row_titles').style
.display
= i ?
'' : 'none';
319 // Show or hide various rows depending on issue type, except do not
320 // hide the comments or referred-by fields if they have data.
321 var comdisp
= (aitypes
[index
] == 1) ?
'none' : '';
322 var revdisp
= (aitypes
[index
] == 1) ?
'' : 'none';
323 var injdisp
= (aitypes
[index
] == 2) ?
'' : 'none';
324 var nordisp
= (aitypes
[index
] == 0) ?
'' : 'none';
325 // reaction row should be displayed only for medication allergy.
326 var alldisp
= (index
== <?php
echo issueTypeIndex('allergy'); ?
>) ?
'' : 'none';
327 document
.getElementById('row_enddate' ).style
.display
= comdisp
;
328 // Note that by default all the issues will not show the active row
329 // (which is desired functionality, since then use the end date
330 // to inactivate the item.)
331 document
.getElementById('row_active' ).style
.display
= revdisp
;
332 document
.getElementById('row_diagnosis' ).style
.display
= comdisp
;
333 document
.getElementById('row_occurrence' ).style
.display
= comdisp
;
334 document
.getElementById('row_classification').style
.display
= injdisp
;
335 document
.getElementById('row_reinjury_id' ).style
.display
= injdisp
;
336 document
.getElementById('row_reaction' ).style
.display
= alldisp
;
337 document
.getElementById('row_referredby' ).style
.display
= (f
.form_referredby
.value
) ?
'' : comdisp
;
338 document
.getElementById('row_comments' ).style
.display
= (f
.form_comments
.value
) ?
'' : revdisp
;
339 <?php
if ($GLOBALS['athletic_team']) { ?
>
340 document
.getElementById('row_returndate' ).style
.display
= comdisp
;
341 document
.getElementById('row_injury_grade' ).style
.display
= injdisp
;
342 document
.getElementById('row_injury_part' ).style
.display
= injdisp
;
343 document
.getElementById('row_injury_type' ).style
.display
= injdisp
;
344 document
.getElementById('row_medical_system').style
.display
= nordisp
;
345 document
.getElementById('row_medical_type' ).style
.display
= nordisp
;
346 // Change label text of 'title' row depending on issue type:
347 document
.getElementById('title_diagnosis').innerHTML
= '<b>' +
348 (index
== <?php
echo issueTypeIndex('allergy'); ?
> ?
349 '<?php echo xla('Allergy
') ?>' :
350 (index
== <?php
echo issueTypeIndex('general'); ?
> ?
351 '<?php echo xla('Title
') ?>' :
352 '<?php echo xla('Text Diagnosis
') ?>')) +
355 document
.getElementById('row_referredby' ).style
.display
= (f
.form_referredby
.value
) ?
'' : comdisp
;
358 if ($ISSUE_TYPES['football_injury']) {
359 // Generate more of these for football injury fields.
360 issue_football_injury_newtype();
362 if ($ISSUE_TYPES['ippf_gcac'] && !$_POST['form_save']) {
363 // Generate more of these for gcac and contraceptive fields.
364 if (empty($issue) ||
$irow['type'] == 'ippf_gcac' ) issue_ippf_gcac_newtype();
365 if (empty($issue) ||
$irow['type'] == 'contraceptive') issue_ippf_con_newtype();
370 // If a clickoption title is selected, copy it to the title field.
371 function set_text() {
372 var f
= document
.forms
[0];
373 f
.form_title
.value
= f
.form_titles
.options
[f
.form_titles
.selectedIndex
].text
;
374 f
.form_titles
.selectedIndex
= -1;
377 // Process click on Delete link.
378 function deleteme() {
379 dlgopen('../deleter.php?issue=<?php echo attr($issue) ?>', '_blank', 500, 450);
383 // Called by the deleteme.php window on a successful delete.
384 function imdeleted() {
389 if (parent
.$
) parent
.$
.fancybox
.close();
393 // Called when the Active checkbox is clicked. For consistency we
394 // use the existence of an end date to indicate inactivity, even
395 // though the simple verion of the form does not show an end date.
396 function activeClicked(cb
) {
397 var f
= document
.forms
[0];
399 f
.form_end
.value
= '';
401 var today
= new Date();
402 f
.form_end
.value
= '' +
(today
.getYear() +
1900) +
'-' +
403 (today
.getMonth() +
1) +
'-' + today
.getDate();
407 // Called when resolved outcome is chosen and the end date is entered.
408 function outcomeClicked(cb
) {
409 var f
= document
.forms
[0];
410 if (cb
.value
== '1'){
411 var today
= new Date();
412 f
.form_end
.value
= '' +
(today
.getYear() +
1900) +
'-' +
413 ("0" +
(today
.getMonth() +
1)).slice(-2) +
'-' +
("0" + today
.getDate()).slice(-2);
418 // This is for callback by the find-code popup.
419 // Appends to or erases the current list of diagnoses.
420 function set_related(codetype
, code
, selector
, codedesc
) {
421 var f
= document
.forms
[0];
422 var s
= f
.form_diagnosis
.value
;
423 var title
= f
.form_title
.value
;
425 if (s
.length
> 0) s +
= ';';
426 s +
= codetype +
':' + code
;
430 f
.form_diagnosis
.value
= s
;
431 if(title
== '') f
.form_title
.value
= codedesc
;
434 // This invokes the find-code popup.
435 function sel_diagnosis() {
437 if($irow['type'] == 'medical_problem')
440 dlgopen('../encounter/find_code_popup.php?codetype=<?php echo attr(collect_codetypes("medical_problem","csv")) ?>', '_blank', 500, 400);
445 dlgopen('../encounter/find_code_popup.php?codetype=<?php echo attr(collect_codetypes("diagnosis","csv")) ?>', '_blank', 500, 400);
451 // Check for errors when the form is submitted.
452 function validate() {
453 var f
= document
.forms
[0];
454 if(f
.form_begin
.value
> f
.form_end
.value
&& (f
.form_end
.value
)) {
455 alert("<?php echo addslashes(xl('Please Enter End Date greater than Begin Date!')); ?>");
458 if (! f
.form_title
.value
) {
459 alert("<?php echo addslashes(xl('Please enter a title!')); ?>");
462 top
.restoreSession();
466 // Supports customizable forms (currently just for IPPF).
467 function divclick(cb
, divid
) {
468 var divstyle
= document
.getElementById(divid
).style
;
470 divstyle
.display
= 'block';
472 divstyle
.display
= 'none';
481 <body
class="body_top" style
="padding-right:0.5em">
483 <form method
='post' name
='theform'
484 action
='add_edit_issue.php?issue=<?php echo attr($issue); ?>&thispid=<?php echo attr($thispid); ?>&thisenc=<?php echo attr($thisenc); ?>'
485 onsubmit
='return validate()'>
487 <table border
='0' width
='100%'>
490 <td valign
='top' width
='1%' nowrap
><b
><?php
echo xlt('Type'); ?
>:</b
></td
>
494 foreach ($ISSUE_TYPES as $value) {
495 if ($issue ||
$thistype) {
496 if ($index == $type_index) {
497 echo text($value[1]);
498 echo "<input type='hidden' name='form_type' value='".attr($index)."'>\n";
501 echo " <input type='radio' name='form_type' value='".attr($index)."' onclick='newtype($index)'";
502 if ($index == $type_index) echo " checked";
503 echo " />" . text($value[1]) . " \n";
512 <td valign
='top' nowrap
> 
;</td
>
514 <select name
='form_titles' size
='<?php echo $GLOBALS['athletic_team
'] ? 10 : 4; ?>' onchange
='set_text()'>
515 </select
> <?php
echo xlt('(Select one of these, or type your own title)'); ?
>
520 <td valign
='top' id
='title_diagnosis' nowrap
><b
><?php
echo $GLOBALS['athletic_team'] ?
xlt('Text Diagnosis') : xlt('Title'); ?
>:</b
></td
>
522 <input type
='text' size
='40' name
='form_title' value
='<?php echo attr($irow['title
']) ?>' style
='width:100%' />
526 <tr id
='row_diagnosis'>
527 <td valign
='top' nowrap
><b
><?php
echo xlt('Diagnosis Code'); ?
>:</b
></td
>
529 <input type
='text' size
='50' name
='form_diagnosis'
530 value
='<?php echo attr($irow['diagnosis
']) ?>' onclick
='sel_diagnosis()'
531 title
='<?php echo xla('Click to select
or change diagnoses
'); ?>'
532 style
='width:100%' readonly
/>
536 <!-- For Athletic Teams
-->
538 <tr
<?php
if (! $GLOBALS['athletic_team']) echo " style='display:none;'"; ?
> id
='row_injury_grade'>
539 <td valign
='top' nowrap
><b
><?php
echo xlt('Grade of Injury'); ?
>:</b
></td
>
542 echo generate_select_list('form_injury_grade', 'injury_grade', $irow['injury_grade'], '');
547 <tr
<?php
if (! $GLOBALS['athletic_team']) echo " style='display:none;'"; ?
> id
='row_injury_part'>
548 <td valign
='top' nowrap
><b
><?php
echo xlt('Injured Body Part'); ?
>:</b
></td
>
551 echo generate_select_list('form_injury_part', 'injury_part', $irow['injury_part'], '');
556 <tr
<?php
if (! $GLOBALS['athletic_team']) echo " style='display:none;'"; ?
> id
='row_injury_type'>
557 <td valign
='top' nowrap
><b
><?php
echo xlt('Injury Type'); ?
>:</b
></td
>
560 echo generate_select_list('form_injury_type', 'injury_type', $irow['injury_type'], '');
565 <tr
<?php
if (! $GLOBALS['athletic_team']) echo " style='display:none;'"; ?
> id
='row_medical_system'>
566 <td valign
='top' nowrap
><b
><?php
echo xlt('Medical System'); ?
>:</b
></td
>
569 echo generate_select_list('form_medical_system', 'medical_system', $irow['injury_part'], '');
574 <tr
<?php
if (! $GLOBALS['athletic_team']) echo " style='display:none;'"; ?
> id
='row_medical_type'>
575 <td valign
='top' nowrap
><b
><?php
echo xlt('Medical Type'); ?
>:</b
></td
>
578 echo generate_select_list('form_medical_type', 'medical_type', $irow['injury_type'], '');
583 <!-- End
For Athletic Teams
-->
586 <td valign
='top' nowrap
><b
><?php
echo xlt('Begin Date'); ?
>:</b
></td
>
589 <input type
='text' size
='10' name
='form_begin' id
='form_begin'
590 value
='<?php echo attr($irow['begdate
']) ?>'
591 onkeyup
='datekeyup(this,mypcc)' onblur
='dateblur(this,mypcc)'
592 title
='<?php echo xla('yyyy
-mm
-dd date of onset
, surgery
or start of medication
'); ?>' />
593 <img src
='../../pic/show_calendar.gif' align
='absbottom' width
='24' height
='22'
594 id
='img_begin' border
='0' alt
='[?]' style
='cursor:pointer'
595 title
='<?php echo xla('Click here to choose a date
'); ?>' />
599 <tr id
='row_enddate'>
600 <td valign
='top' nowrap
><b
><?php
echo xlt('End Date'); ?
>:</b
></td
>
602 <input type
='text' size
='10' name
='form_end' id
='form_end'
603 value
='<?php echo attr($irow['enddate
']) ?>'
604 onkeyup
='datekeyup(this,mypcc)' onblur
='dateblur(this,mypcc)'
605 title
='<?php echo xla('yyyy
-mm
-dd date of recovery
or end of medication
'); ?>' />
606 <img src
='../../pic/show_calendar.gif' align
='absbottom' width
='24' height
='22'
607 id
='img_end' border
='0' alt
='[?]' style
='cursor:pointer'
608 title
='<?php echo xla('Click here to choose a date
'); ?>' />
609  
;(<?php
echo xlt('leave blank if still active'); ?
>)
614 <td valign
='top' nowrap
><b
><?php
echo xlt('Active'); ?
>:</b
></td
>
616 <input type
='checkbox' name
='form_active' value
='1' <?php
echo attr($irow['enddate']) ?
"" : "checked"; ?
>
617 onclick
='activeClicked(this);'
618 title
='<?php echo xla('Indicates
if this issue is currently active
'); ?>' />
622 <tr
<?php
if (! $GLOBALS['athletic_team']) echo " style='display:none;'"; ?
> id
='row_returndate'>
623 <td valign
='top' nowrap
><b
><?php
echo xlt('Returned to Play'); ?
>:</b
></td
>
625 <input type
='text' size
='10' name
='form_return' id
='form_return'
626 value
='<?php echo attr($irow['returndate
']) ?>'
627 onkeyup
='datekeyup(this,mypcc)' onblur
='dateblur(this,mypcc)'
628 title
='<?php echo xla('yyyy
-mm
-dd date returned to play
'); ?>' />
629 <img src
='../../pic/show_calendar.gif' align
='absbottom' width
='24' height
='22'
630 id
='img_return' border
='0' alt
='[?]' style
='cursor:pointer'
631 title
='<?php echo xla('Click here to choose a date
'); ?>' />
632  
;(<?php
echo xlt('leave blank if still active'); ?
>)
636 <tr id
='row_occurrence'>
637 <td valign
='top' nowrap
><b
><?php
echo xlt('Occurrence'); ?
>:</b
></td
>
640 // Modified 6/2009 by BM to incorporate the occurrence items into the list_options listings
641 generate_form_field(array('data_type'=>1,'field_id'=>'occur','list_id'=>'occurrence','empty_title'=>'SKIP'), $irow['occurrence']);
646 <tr id
='row_classification'>
647 <td valign
='top' nowrap
><b
><?php
echo xlt('Classification'); ?
>:</b
></td
>
649 <select name
='form_classification'>
651 foreach ($ISSUE_CLASSIFICATIONS as $key => $value) {
652 echo " <option value='".attr($key)."'";
653 if ($key == $irow['classification']) echo " selected";
654 echo ">".text($value)."\n";
661 <tr
<?php
if (! $GLOBALS['athletic_team']) echo " style='display:none;'"; ?
> id
='row_reinjury_id'>
662 <td valign
='top' nowrap
><b
><?php
echo xlt('Re-Injury?'); ?
>:</b
></td
>
664 <select name
='form_reinjury_id'>
665 <option value
='0'><?php
echo xlt('No'); ?
></option
>
667 $pres = sqlStatement(
668 "SELECT id, begdate, title " .
669 "FROM lists WHERE " .
671 "type = 'football_injury' AND " .
673 "ORDER BY begdate DESC", array($thispid)
675 while ($prow = sqlFetchArray($pres)) {
676 echo " <option value='" . attr($prow['id']) . "'";
677 if ($prow['id'] == $irow['reinjury_id']) echo " selected";
678 echo ">" . text($prow['begdate']) . " " . text($prow['title']) . "\n";
684 <!-- Reaction
For Medication Allergy
-->
685 <tr id
='row_reaction'>
686 <td valign
='top' nowrap
><b
><?php
echo xlt('Reaction'); ?
>:</b
></td
>
688 <input type
='text' size
='40' name
='form_reaction' value
='<?php echo attr($irow['reaction
']) ?>'
689 style
='width:100%' title
='<?php echo xla('Allergy Reaction
'); ?>' />
692 <!-- End of reaction
-->
694 <tr
<?php
if ($GLOBALS['athletic_team']) echo " style='display:none;'"; ?
> id
='row_referredby'>
695 <td valign
='top' nowrap
><b
><?php
echo xlt('Referred by'); ?
>:</b
></td
>
697 <input type
='text' size
='40' name
='form_referredby' value
='<?php echo attr($irow['referredby
']) ?>'
698 style
='width:100%' title
='<?php echo xla('Referring physician
and practice
'); ?>' />
702 <tr id
='row_comments'>
703 <td valign
='top' nowrap
><b
><?php
echo xlt('Comments'); ?
>:</b
></td
>
705 <textarea name
='form_comments' rows
='4' cols
='40' wrap
='virtual' style
='width:100%'><?php
echo text($irow['comments']) ?
></textarea
>
709 <tr
<?php
if ($GLOBALS['athletic_team'] ||
$GLOBALS['ippf_specific']) echo " style='display:none;'"; ?
>>
710 <td valign
='top' nowrap
><b
><?php
echo xlt('Outcome'); ?
>:</b
></td
>
713 echo generate_select_list('form_outcome', 'outcome', $irow['outcome'], '', '', '', 'outcomeClicked(this);');
718 <tr
<?php
if ($GLOBALS['athletic_team'] ||
$GLOBALS['ippf_specific']) echo " style='display:none;'"; ?
>>
719 <td valign
='top' nowrap
><b
><?php
echo xlt('Destination'); ?
>:</b
></td
>
722 <input type
='text' size
='40' name
='form_destination' value
='<?php echo attr($irow['destination
']) ?>'
723 style
='width:100%' title
='GP, Secondary care specialist, etc.' />
724 <?php
} else { // leave this here for now, please -- Rod ?>
725 <?php
echo rbinput('form_destination', '1', 'GP' , 'destination') ?
> 
;
726 <?php
echo rbinput('form_destination', '2', 'Secondary care spec', 'destination') ?
> 
;
727 <?php
echo rbinput('form_destination', '3', 'GP via physio' , 'destination') ?
> 
;
728 <?php
echo rbinput('form_destination', '4', 'GP via podiatry' , 'destination') ?
>
736 if ($ISSUE_TYPES['football_injury']) {
737 issue_football_injury_form($issue);
739 if ($ISSUE_TYPES['ippf_gcac']) {
740 if (empty($issue) ||
$irow['type'] == 'ippf_gcac')
741 issue_ippf_gcac_form($issue, $thispid);
742 if (empty($issue) ||
$irow['type'] == 'contraceptive')
743 issue_ippf_con_form($issue, $thispid);
750 <input type
='submit' name
='form_save' value
='<?php echo xla('Save
'); ?>' />
752 <?php
if ($issue && acl_check('admin', 'super')) { ?
>
754 <input type
='button' value
='<?php echo xla('Delete
'); ?>' style
='color:red' onclick
='deleteme()' />
758 <input type
='button' value
='<?php echo xla('Cancel
'); ?>' onclick
='closeme();' />
764 <script language
='JavaScript'>
765 newtype(<?php
echo $type_index ?
>);
766 Calendar
.setup({inputField
:"form_begin", ifFormat
:"%Y-%m-%d", button
:"img_begin"});
767 Calendar
.setup({inputField
:"form_end", ifFormat
:"%Y-%m-%d", button
:"img_end"});
768 Calendar
.setup({inputField
:"form_return", ifFormat
:"%Y-%m-%d", button
:"img_return"});