</td> </tr> <tr<?php if (!$GLOBALS['athletic_team']) { echo " style='display:none;'"; } ?> id='row_medical_type'> <td valign='top' nowrap><b><?php xl('Medical Type', 'e'); ?> :</b></td> <td> <?php echo generate_select_list('form_medical_type', 'medical_type', $irow['injury_type'], ''); ?> </td> </tr> <!-- End For Athletic Teams --> <tr> <td valign='top' nowrap><b><?php xl('Begin Date', 'e'); ?> :</b></td> <td> <input type='text' size='10' name='form_begin' id='form_begin' value='<?php
?> </tr> <tr<?php if (!$GLOBALS['gbl_visit_referral_source']) { echo " style='visibility:hidden;'"; } ?> > <td class='bold' nowrap><?php echo xlt('Referral Source'); ?> :</td> <td class='text'> <?php echo generate_select_list('form_referral_source', 'refsource', $viewmode ? $result['referral_source'] : '', ''); ?> </td> </tr> <tr> <td class='bold' nowrap><?php echo xlt('Date of Service:'); ?> </td> <td class='text' nowrap> <input type='text' size='10' name='form_date' id='form_date' <?php echo $disabled; ?> value='<?php echo $viewmode ? substr($result['date'], 0, 10) : date('Y-m-d');
<td class="text"><?php xl('Default Warehouse', 'e'); ?> : </td> <td class='text'> <?php echo generate_select_list('default_warehouse', 'warehouse', '', ''); ?> </td> <td class="text"><?php xl('Invoice Refno Pool', 'e'); ?> : </td> <td class='text'> <?php echo generate_select_list('irnpool', 'irnpool', '', xl('Invoice reference number pool, if used')); ?> </td> </tr> <?php } ?> <?php // List the access control groups if phpgacl installed if (isset($phpgacl_location) && acl_check('admin', 'acl')) { ?> <tr> <td class='text'><?php xl('Access Control', 'e'); ?>
?> '> <!-- no restoreSession() on submit because session data are not relevant --> <center> <table border='0' width='100%'> <tr> <td width='1%' nowrap><b><?php echo xlt('Procedure Type'); ?> :</b></td> <td> <?php echo generate_select_list('form_procedure_type', 'proc_type', $row['procedure_type'], xl('The type of this entity'), ' ', '', 'proc_type_changed()'); ?> </td> </tr> <tr> <td nowrap><b><?php echo xlt('Name'); ?> :</b></td> <td> <input type='text' size='40' name='form_name' maxlength='63' value='<?php echo htmlspecialchars($row['name'], ENT_QUOTES); ?> '
</tr> <tr> <td class='label'><?php echo htmlspecialchars(xl('Race'), ENT_NOQUOTES); ?> :</td> <td><?php echo generate_select_list('race', 'race', $sql_race, 'Select Race', 'Unassigned', '', ''); ?> </td> <td class='label'><?php echo htmlspecialchars(xl('Ethnicity'), ENT_NOQUOTES); ?> :</td> <td><?php echo generate_select_list('ethnicity', 'ethnicity', $sql_ethnicity, 'Select Ethnicity', 'Unassigned', '', ''); ?> </td> </tr> <tr> <td class='label' width='100'><?php echo htmlspecialchars(xl('Lab Result'), ENT_NOQUOTES); ?> :</td> <td width='100'><input type='text' name='form_lab_results' size='13' maxlength='250' value='<?php echo htmlspecialchars($form_lab_results, ENT_QUOTES); ?> ' title='<?php echo htmlspecialchars(xl('Result, use % as a wildcard'), ENT_QUOTES); ?>
function generate_form_field($frow, $currvalue) { global $rootdir, $date_init; $currescaped = htmlspecialchars($currvalue, ENT_QUOTES); $data_type = $frow['data_type']; $field_id = $frow['field_id']; $list_id = $frow['list_id']; // escaped variables to use in html $field_id_esc = htmlspecialchars($field_id, ENT_QUOTES); $list_id_esc = htmlspecialchars($list_id, ENT_QUOTES); // Added 5-09 by BM - Translate description if applicable $description = htmlspecialchars(xl_layout_label($frow['description']), ENT_QUOTES); // added 5-2009 by BM to allow modification of the 'empty' text title field. // Can pass $frow['empty_title'] with this variable, otherwise // will default to 'Unassigned'. // modified 6-2009 by BM to allow complete skipping of the 'empty' text title // if make $frow['empty_title'] equal to 'SKIP' $showEmpty = true; if (isset($frow['empty_title'])) { if ($frow['empty_title'] == "SKIP") { //do not display an 'empty' choice $showEmpty = false; $empty_title = "Unassigned"; } else { $empty_title = $frow['empty_title']; } } else { $empty_title = "Unassigned"; } // generic single-selection list if ($data_type == 1) { echo generate_select_list("form_{$field_id}", $list_id, $currvalue, $description, $showEmpty ? $empty_title : ''); } else { if ($data_type == 2) { $fldlength = htmlspecialchars($frow['fld_length'], ENT_QUOTES); $maxlength = htmlspecialchars($frow['max_length'], ENT_QUOTES); echo "<input type='text'" . " name='form_{$field_id_esc}'" . " id='form_{$field_id_esc}'" . " size='{$fldlength}'" . " maxlength='{$maxlength}'" . " title='{$description}'" . " value='{$currescaped}'"; if (strpos($frow['edit_options'], 'C') !== FALSE) { echo " onchange='capitalizeMe(this)'"; } $tmp = htmlspecialchars($GLOBALS['gbl_mask_patient_id'], ENT_QUOTES); if ($field_id == 'pubpid' && strlen($tmp) > 0) { echo " onkeyup='maskkeyup(this,\"{$tmp}\")'"; echo " onblur='maskblur(this,\"{$tmp}\")'"; } echo " />"; } else { if ($data_type == 3) { $textCols = htmlspecialchars($frow['fld_length'], ENT_QUOTES); $textRows = htmlspecialchars($frow['max_length'], ENT_QUOTES); echo "<textarea" . " name='form_{$field_id_esc}'" . " id='form_{$field_id_esc}'" . " title='{$description}'" . " cols='{$textCols}'" . " rows='{$textRows}'>" . $currescaped . "</textarea>"; } else { if ($data_type == 4) { echo "<input type='text' size='10' name='form_{$field_id_esc}' id='form_{$field_id_esc}'" . " value='{$currescaped}'" . " title='{$description}'" . " onkeyup='datekeyup(this,mypcc)' onblur='dateblur(this,mypcc)' />" . "<img src='{$rootdir}/pic/show_calendar.gif' align='absbottom' width='24' height='22'" . " id='img_{$field_id_esc}' border='0' alt='[?]' style='cursor:pointer'" . " title='" . htmlspecialchars(xl('Click here to choose a date'), ENT_QUOTES) . "' />"; $date_init .= " Calendar.setup({inputField:'form_{$field_id}', ifFormat:'%Y-%m-%d', button:'img_{$field_id}'});\n"; } else { if ($data_type == 10) { $ures = sqlStatement("SELECT id, fname, lname, specialty FROM users " . "WHERE active = 1 AND ( info IS NULL OR info NOT LIKE '%Inactive%' ) " . "AND authorized = 1 " . "ORDER BY lname, fname"); echo "<select name='form_{$field_id_esc}' id='form_{$field_id_esc}' title='{$description}'>"; echo "<option value=''>" . htmlspecialchars(xl('Unassigned'), ENT_NOQUOTES) . "</option>"; while ($urow = sqlFetchArray($ures)) { $uname = htmlspecialchars($urow['fname'] . ' ' . $urow['lname'], ENT_NOQUOTES); $optionId = htmlspecialchars($urow['id'], ENT_QUOTES); echo "<option value='{$optionId}'"; if ($urow['id'] == $currvalue) { echo " selected"; } echo ">{$uname}</option>"; } echo "</select>"; } else { if ($data_type == 11) { $ures = sqlStatement("SELECT id, fname, lname, specialty FROM users " . "WHERE active = 1 AND ( info IS NULL OR info NOT LIKE '%Inactive%' ) " . "AND ( authorized = 1 OR ( username = '' AND npi != '' ) ) " . "ORDER BY lname, fname"); echo "<select name='form_{$field_id_esc}' id='form_{$field_id_esc}' title='{$description}'>"; echo "<option value=''>" . htmlspecialchars(xl('Unassigned'), ENT_NOQUOTES) . "</option>"; while ($urow = sqlFetchArray($ures)) { $uname = htmlspecialchars($urow['fname'] . ' ' . $urow['lname'], ENT_NOQUOTES); $optionId = htmlspecialchars($urow['id'], ENT_QUOTES); echo "<option value='{$optionId}'"; if ($urow['id'] == $currvalue) { echo " selected"; } echo ">{$uname}</option>"; } echo "</select>"; } else { if ($data_type == 12) { echo "<select name='form_{$field_id_esc}' id='form_{$field_id_esc}' title='{$description}'>"; echo "<option value='0'></option>"; $pres = get_pharmacies(); while ($prow = sqlFetchArray($pres)) { $key = $prow['id']; $optionValue = htmlspecialchars($key, ENT_QUOTES); $optionLabel = htmlspecialchars($prow['name'] . ' ' . $prow['area_code'] . '-' . $prow['prefix'] . '-' . $prow['number'] . ' / ' . $prow['line1'] . ' / ' . $prow['city'], ENT_NOQUOTES); echo "<option value='{$optionValue}'"; if ($currvalue == $key) { echo " selected"; } echo ">{$optionLabel}</option>"; } echo "</select>"; } else { if ($data_type == 13) { echo "<select name='form_{$field_id_esc}' id='form_{$field_id_esc}' title='{$description}'>"; echo "<option value=''> </option>"; $squads = acl_get_squads(); if ($squads) { foreach ($squads as $key => $value) { $optionValue = htmlspecialchars($key, ENT_QUOTES); $optionLabel = htmlspecialchars($value[3], ENT_NOQUOTES); echo "<option value='{$optionValue}'"; if ($currvalue == $key) { echo " selected"; } echo ">{$optionLabel}</option>\n"; } } echo "</select>"; } else { if ($data_type == 14) { if (strpos($frow['edit_options'], 'O') !== FALSE) { $tmp = "abook_type LIKE 'ord\\_%'"; } else { if (strpos($frow['edit_options'], 'V') !== FALSE) { $tmp = "abook_type LIKE 'vendor%'"; } else { $tmp = "( username = '' OR authorized = 1 )"; } } $ures = sqlStatement("SELECT id, fname, lname, organization, username FROM users " . "WHERE active = 1 AND ( info IS NULL OR info NOT LIKE '%Inactive%' ) " . "AND {$tmp} " . "ORDER BY organization, lname, fname"); echo "<select name='form_{$field_id_esc}' id='form_{$field_id_esc}' title='{$description}'>"; echo "<option value=''>" . htmlspecialchars(xl('Unassigned'), ENT_NOQUOTES) . "</option>"; while ($urow = sqlFetchArray($ures)) { $uname = $urow['organization']; if (empty($uname) || substr($uname, 0, 1) == '(') { $uname = $urow['lname']; if ($urow['fname']) { $uname .= ", " . $urow['fname']; } } $optionValue = htmlspecialchars($urow['id'], ENT_QUOTES); $optionLabel = htmlspecialchars($uname, ENT_NOQUOTES); echo "<option value='{$optionValue}'"; $title = $urow['username'] ? xl('Local') : xl('External'); $optionTitle = htmlspecialchars($title, ENT_QUOTES); echo " title='{$optionTitle}'"; if ($urow['id'] == $currvalue) { echo " selected"; } echo ">{$optionLabel}</option>"; } echo "</select>"; } else { if ($data_type == 15) { $fldlength = htmlspecialchars($frow['fld_length'], ENT_QUOTES); $maxlength = htmlspecialchars($frow['max_length'], ENT_QUOTES); echo "<input type='text'" . " name='form_{$field_id_esc}'" . " id='form_related_code'" . " size='{$fldlength}'" . " maxlength='{$maxlength}'" . " title='{$description}'" . " value='{$currescaped}'" . " onclick='sel_related(this)' readonly" . " />"; } else { if ($data_type == 21) { // In this special case, fld_length is the number of columns generated. $cols = max(1, $frow['fld_length']); $avalue = explode('|', $currvalue); $lres = sqlStatement("SELECT * FROM list_options " . "WHERE list_id = ? ORDER BY seq, title", array($list_id)); echo "<table cellpadding='0' cellspacing='0' width='100%'>"; $tdpct = (int) (100 / $cols); for ($count = 0; $lrow = sqlFetchArray($lres); ++$count) { $option_id = $lrow['option_id']; $option_id_esc = htmlspecialchars($option_id, ENT_QUOTES); // if ($count) echo "<br />"; if ($count % $cols == 0) { if ($count) { echo "</tr>"; } echo "<tr>"; } echo "<td width='{$tdpct}%'>"; echo "<input type='checkbox' name='form_{$field_id_esc}[{$option_id_esc}]' id='form_{$field_id_esc}[{$option_id_esc}]' value='1'"; if (in_array($option_id, $avalue)) { echo " checked"; } // Added 5-09 by BM - Translate label if applicable echo ">" . htmlspecialchars(xl_list_label($lrow['title']), ENT_NOQUOTES); echo "</td>"; } if ($count) { echo "</tr>"; if ($count > $cols) { // Add some space after multiple rows of checkboxes. $cols = htmlspecialchars($cols, ENT_QUOTES); echo "<tr><td colspan='{$cols}' style='height:0.7em'></td></tr>"; } } echo "</table>"; } else { if ($data_type == 22) { $tmp = explode('|', $currvalue); $avalue = array(); foreach ($tmp as $value) { if (preg_match('/^([^:]+):(.*)$/', $value, $matches)) { $avalue[$matches[1]] = $matches[2]; } } $lres = sqlStatement("SELECT * FROM list_options " . "WHERE list_id = ? ORDER BY seq, title", array($list_id)); echo "<table cellpadding='0' cellspacing='0'>"; while ($lrow = sqlFetchArray($lres)) { $option_id = $lrow['option_id']; $option_id_esc = htmlspecialchars($option_id, ENT_QUOTES); $maxlength = empty($frow['max_length']) ? 255 : $frow['max_length']; $fldlength = empty($frow['fld_length']) ? 20 : $frow['fld_length']; // Added 5-09 by BM - Translate label if applicable echo "<tr><td>" . htmlspecialchars(xl_list_label($lrow['title']), ENT_NOQUOTES) . " </td>"; $fldlength = htmlspecialchars($fldlength, ENT_QUOTES); $maxlength = htmlspecialchars($maxlength, ENT_QUOTES); $optionValue = htmlspecialchars($avalue[$option_id], ENT_QUOTES); echo "<td><input type='text'" . " name='form_{$field_id_esc}[{$option_id_esc}]'" . " id='form_{$field_id_esc}[{$option_id_esc}]'" . " size='{$fldlength}'" . " maxlength='{$maxlength}'" . " value='{$optionValue}'"; echo " /></td></tr>"; } echo "</table>"; } else { if ($data_type == 23) { $tmp = explode('|', $currvalue); $avalue = array(); foreach ($tmp as $value) { if (preg_match('/^([^:]+):(.*)$/', $value, $matches)) { $avalue[$matches[1]] = $matches[2]; } } $maxlength = empty($frow['max_length']) ? 255 : $frow['max_length']; $fldlength = empty($frow['fld_length']) ? 20 : $frow['fld_length']; $lres = sqlStatement("SELECT * FROM list_options " . "WHERE list_id = ? ORDER BY seq, title", array($list_id)); echo "<table cellpadding='0' cellspacing='0'>"; echo "<tr><td> </td><td class='bold'>" . htmlspecialchars(xl('N/A'), ENT_NOQUOTES) . " </td><td class='bold'>" . htmlspecialchars(xl('Nor'), ENT_NOQUOTES) . " </td>" . "<td class='bold'>" . htmlspecialchars(xl('Abn'), ENT_NOQUOTES) . " </td><td class='bold'>" . htmlspecialchars(xl('Date/Notes'), ENT_NOQUOTES) . "</td></tr>"; while ($lrow = sqlFetchArray($lres)) { $option_id = $lrow['option_id']; $option_id_esc = htmlspecialchars($option_id, ENT_QUOTES); $restype = substr($avalue[$option_id], 0, 1); $resnote = substr($avalue[$option_id], 2); // Added 5-09 by BM - Translate label if applicable echo "<tr><td>" . htmlspecialchars(xl_list_label($lrow['title']), ENT_NOQUOTES) . " </td>"; for ($i = 0; $i < 3; ++$i) { $inputValue = htmlspecialchars($i, ENT_QUOTES); echo "<td><input type='radio'" . " name='radio_{$field_id_esc}[{$option_id_esc}]'" . " id='radio_{$field_id_esc}[{$option_id_esc}]'" . " value='{$inputValue}'"; if ($restype === "{$i}") { echo " checked"; } echo " /></td>"; } $fldlength = htmlspecialchars($fldlength, ENT_QUOTES); $maxlength = htmlspecialchars($maxlength, ENT_QUOTES); $resnote = htmlspecialchars($resnote, ENT_QUOTES); echo "<td><input type='text'" . " name='form_{$field_id_esc}[{$option_id_esc}]'" . " id='form_{$field_id_esc}[{$option_id_esc}]'" . " size='{$fldlength}'" . " maxlength='{$maxlength}'" . " value='{$resnote}' /></td>"; echo "</tr>"; } echo "</table>"; } else { if ($data_type == 24) { $query = "SELECT title, comments FROM lists WHERE " . "pid = ? AND type = 'allergy' AND enddate IS NULL " . "ORDER BY begdate"; // echo "<!-- $query -->\n"; // debugging $lres = sqlStatement($query, array($GLOBALS['pid'])); $count = 0; while ($lrow = sqlFetchArray($lres)) { if ($count++) { echo "<br />"; } echo htmlspecialchars($lrow['title'], ENT_NOQUOTES); if ($lrow['comments']) { echo ' (' . htmlspecialchars($lrow['comments'], ENT_NOQUOTES) . ')'; } } } else { if ($data_type == 25) { $tmp = explode('|', $currvalue); $avalue = array(); foreach ($tmp as $value) { if (preg_match('/^([^:]+):(.*)$/', $value, $matches)) { $avalue[$matches[1]] = $matches[2]; } } $maxlength = empty($frow['max_length']) ? 255 : $frow['max_length']; $fldlength = empty($frow['fld_length']) ? 20 : $frow['fld_length']; $lres = sqlStatement("SELECT * FROM list_options " . "WHERE list_id = ? ORDER BY seq, title", array($list_id)); echo "<table cellpadding='0' cellspacing='0'>"; while ($lrow = sqlFetchArray($lres)) { $option_id = $lrow['option_id']; $option_id_esc = htmlspecialchars($option_id, ENT_QUOTES); $restype = substr($avalue[$option_id], 0, 1); $resnote = substr($avalue[$option_id], 2); // Added 5-09 by BM - Translate label if applicable echo "<tr><td>" . htmlspecialchars(xl_list_label($lrow['title']), ENT_NOQUOTES) . " </td>"; $option_id = htmlspecialchars($option_id, ENT_QUOTES); echo "<td><input type='checkbox' name='check_{$field_id_esc}[{$option_id_esc}]' id='check_{$field_id_esc}[{$option_id_esc}]' value='1'"; if ($restype) { echo " checked"; } echo " /> </td>"; $fldlength = htmlspecialchars($fldlength, ENT_QUOTES); $maxlength = htmlspecialchars($maxlength, ENT_QUOTES); $resnote = htmlspecialchars($resnote, ENT_QUOTES); echo "<td><input type='text'" . " name='form_{$field_id_esc}[{$option_id_esc}]'" . " id='form_{$field_id_esc}[{$option_id_esc}]'" . " size='{$fldlength}'" . " maxlength='{$maxlength}'" . " value='{$resnote}' /></td>"; echo "</tr>"; } echo "</table>"; } else { if ($data_type == 26) { echo "<select class='addtolistclass_{$list_id_esc}' name='form_{$field_id_esc}' id='form_{$field_id_esc}' title='{$description}'>"; if ($showEmpty) { echo "<option value=''>" . htmlspecialchars(xl($empty_title), ENT_QUOTES) . "</option>"; } $lres = sqlStatement("SELECT * FROM list_options " . "WHERE list_id = ? ORDER BY seq, title", array($list_id)); $got_selected = FALSE; while ($lrow = sqlFetchArray($lres)) { $optionValue = htmlspecialchars($lrow['option_id'], ENT_QUOTES); echo "<option value='{$optionValue}'"; if (strlen($currvalue) == 0 && $lrow['is_default'] || strlen($currvalue) > 0 && $lrow['option_id'] == $currvalue) { echo " selected"; $got_selected = TRUE; } // Added 5-09 by BM - Translate label if applicable echo ">" . htmlspecialchars(xl_list_label($lrow['title']), ENT_NOQUOTES) . "</option>\n"; } if (!$got_selected && strlen($currvalue) > 0) { echo "<option value='{$currescaped}' selected>* {$currescaped} *</option>"; echo "</select>"; $fontTitle = htmlspecialchars(xl('Please choose a valid selection from the list.'), ENT_NOQUOTES); $fontText = htmlspecialchars(xl('Fix this'), ENT_NOQUOTES); echo " <font color='red' title='{$fontTitle}'>{$fontText}!</font>"; } else { echo "</select>"; } // show the add button if user has access to correct list $inputValue = htmlspecialchars(xl('Add'), ENT_QUOTES); $outputAddButton = "<input type='button' id='addtolistid_" . $list_id_esc . "' fieldid='form_" . $field_id_esc . "' class='addtolist' value='{$inputValue}'>"; if (aco_exist('lists', $list_id)) { // a specific aco exist for this list, so ensure access if (acl_check('lists', $list_id)) { echo $outputAddButton; } } else { // no specific aco exist for this list, so check for access to 'default' list if (acl_check('lists', 'default')) { echo $outputAddButton; } } } else { if ($data_type == 27) { // In this special case, fld_length is the number of columns generated. $cols = max(1, $frow['fld_length']); $lres = sqlStatement("SELECT * FROM list_options " . "WHERE list_id = ? ORDER BY seq, title", array($list_id)); echo "<table cellpadding='0' cellspacing='0' width='100%'>"; $tdpct = (int) (100 / $cols); $got_selected = FALSE; for ($count = 0; $lrow = sqlFetchArray($lres); ++$count) { $option_id = $lrow['option_id']; $option_id_esc = htmlspecialchars($option_id, ENT_QUOTES); if ($count % $cols == 0) { if ($count) { echo "</tr>"; } echo "<tr>"; } echo "<td width='{$tdpct}%'>"; echo "<input type='radio' name='form_{$field_id_esc}' id='form_{$field_id_esc}[{$option_id_esc}]' value='{$option_id_esc}'"; if (strlen($currvalue) == 0 && $lrow['is_default'] || strlen($currvalue) > 0 && $option_id == $currvalue) { echo " checked"; $got_selected = TRUE; } echo ">" . htmlspecialchars(xl_list_label($lrow['title']), ENT_NOQUOTES); echo "</td>"; } if ($count) { echo "</tr>"; if ($count > $cols) { // Add some space after multiple rows of radio buttons. $cols = htmlspecialchars($cols, ENT_QUOTES); echo "<tr><td colspan='{$cols}' style='height:0.7em'></td></tr>"; } } echo "</table>"; if (!$got_selected && strlen($currvalue) > 0) { $fontTitle = htmlspecialchars(xl('Please choose a valid selection.'), ENT_QUOTES); $fontText = htmlspecialchars(xl('Fix this'), ENT_NOQUOTES); echo "{$currescaped} <font color='red' title='{$fontTitle}'>{$fontText}!</font>"; } } else { if ($data_type == 28) { $tmp = explode('|', $currvalue); switch (count($tmp)) { case "3": $resnote = $tmp[0]; $restype = $tmp[1]; $resdate = $tmp[2]; break; case "2": $resnote = $tmp[0]; $restype = $tmp[1]; $resdate = ""; break; case "1": $resnote = $tmp[0]; $resdate = $restype = ""; break; default: $restype = $resdate = $resnote = ""; break; } $maxlength = empty($frow['max_length']) ? 255 : $frow['max_length']; $fldlength = empty($frow['fld_length']) ? 20 : $frow['fld_length']; $fldlength = htmlspecialchars($fldlength, ENT_QUOTES); $maxlength = htmlspecialchars($maxlength, ENT_QUOTES); $resnote = htmlspecialchars($resnote, ENT_QUOTES); $resdate = htmlspecialchars($resdate, ENT_QUOTES); echo "<table cellpadding='0' cellspacing='0'>"; echo "<tr>"; // input text echo "<td><input type='text'" . " name='form_{$field_id_esc}'" . " id='form_{$field_id_esc}'" . " size='{$fldlength}'" . " maxlength='{$maxlength}'" . " value='{$resnote}' /> </td>"; echo "<td class='bold'> " . htmlspecialchars(xl('Status'), ENT_NOQUOTES) . ": </td>"; // current echo "<td><input type='radio'" . " name='radio_{$field_id_esc}'" . " id='radio_{$field_id_esc}[current]'" . " value='current" . $field_id_esc . "'"; if ($restype == "current" . $field_id) { echo " checked"; } echo "/>" . htmlspecialchars(xl('Current'), ENT_NOQUOTES) . " </td>"; // quit echo "<td><input type='radio'" . " name='radio_{$field_id_esc}'" . " id='radio_{$field_id_esc}[quit]'" . " value='quit" . $field_id_esc . "'"; if ($restype == "quit" . $field_id) { echo " checked"; } echo "/>" . htmlspecialchars(xl('Quit'), ENT_NOQUOTES) . " </td>"; // quit date echo "<td><input type='text' size='6' name='date_{$field_id_esc}' id='date_{$field_id_esc}'" . " value='{$resdate}'" . " title='{$description}'" . " onkeyup='datekeyup(this,mypcc)' onblur='dateblur(this,mypcc)' />" . "<img src='{$rootdir}/pic/show_calendar.gif' align='absbottom' width='24' height='22'" . " id='img_{$field_id_esc}' border='0' alt='[?]' style='cursor:pointer'" . " title='" . htmlspecialchars(xl('Click here to choose a date'), ENT_QUOTES) . "' /> </td>"; $date_init .= " Calendar.setup({inputField:'date_{$field_id}', ifFormat:'%Y-%m-%d', button:'img_{$field_id}'});\n"; // never echo "<td><input type='radio'" . " name='radio_{$field_id_esc}'" . " id='radio_{$field_id_esc}[never]'" . " value='never" . $field_id_esc . "'"; if ($restype == "never" . $field_id) { echo " checked"; } echo " />" . htmlspecialchars(xl('Never'), ENT_NOQUOTES) . " </td>"; // Not Applicable echo "<td><input type='radio'" . " name='radio_{$field_id}'" . " id='radio_{$field_id}[not_applicable]'" . " value='not_applicable" . $field_id . "'"; if ($restype == "not_applicable" . $field_id) { echo " checked"; } echo " />" . htmlspecialchars(xl('N/A'), ENT_QUOTES) . " </td>"; echo "</tr>"; echo "</table>"; } else { if ($data_type == 31) { echo nl2br($frow['description']); } } } } } } } } } } } } } } } } } } } }
echo " <option value='" . attr($date1) . "'>" . xlt('This visit begins new contraceptive use') . "</option>\n"; echo " <option value='" . attr($date0) . "'>" . xlt('Contraceptive services previously started') . "</option>\n"; echo " <option value=''>" . xlt('None of the above') . "</option>\n"; echo " </select>\n"; echo " \n"; } } } // If there is a choice of warehouses, allow override of user default. if ($prod_lino > 0) { // if any products are in this form $trow = sqlQuery("SELECT count(*) AS count FROM list_options WHERE list_id = 'warehouse'"); if ($trow['count'] > 1) { $trow = sqlQuery("SELECT default_warehouse FROM users WHERE username = ?", array($_SESSION['authUser'])); echo " <span class='billcell'><b>" . xlt('Warehouse') . ":</b></span>\n"; echo generate_select_list('default_warehouse', 'warehouse', $trow['default_warehouse'], ''); echo " \n"; } } // Allow the patient price level to be fixed here. $plres = sqlStatement("SELECT option_id, title FROM list_options " . "WHERE list_id = 'pricelevel' ORDER BY seq"); if (true) { $trow = sqlQuery("SELECT pricelevel FROM patient_data WHERE " . "pid = ? LIMIT 1", array($pid)); $pricelevel = $trow['pricelevel']; echo " <span class='billcell'><b>" . xlt('Price Level') . ":</b></span>\n"; echo " <select name='pricelevel'"; if ($isBilled) { echo " disabled"; } echo ">\n"; while ($plrow = sqlFetchArray($plres)) {
echo $screen == 'new_payment' ? htmlspecialchars('0.00') : htmlspecialchars($PayTotal); ?> " style="text-align:right" class="class1 text " /></td> <td align="left" ></td> <td align="left" ></td> <td align="left" class="text"><?php echo htmlspecialchars(xl('Paying Entity'), ENT_QUOTES) . ':'; ?> </td> <td align="left"><?php if ($PaymentType == '' && $screen == 'edit_payment') { $blankValue = ' '; } else { $blankValue = ''; } echo generate_select_list("type_name", "payment_type", "{$PaymentType}", "Paying Entity", "{$blankValue}", "class1 text", 'PayingEntityAction()'); ?> </td> <td align="left" ></td> <td align="left" ></td> <td align="left" class="text"><?php echo htmlspecialchars(xl('Payment Category'), ENT_QUOTES) . ':'; ?> </td> <td align="left"><?php if ($AdjustmentCode == '' && $screen == 'edit_payment') { $blankValue = ' '; } else { $blankValue = ''; } echo generate_list_payment_category("adjustment_code", "payment_adjustment_code", "{$AdjustmentCode}", "Payment Category", "{$blankValue}", "class1 text", 'FilterSelection(this)', "{$PaymentType}", "{$screen}");
echo attr($age_from); ?> " size='3' maxlength='3' /> <?php echo xlt('To{{range}}'); ?> <input name='age_to' class="numeric_only" type='text' id="age_to" value="<?php echo attr($age_to); ?> " size='3' maxlength='3' /></td> <td class='label'><?php echo xlt('Gender'); ?> :</td> <td colspan="2"><?php echo generate_select_list('gender', 'sex', $sql_gender, 'Select Gender', 'Unassigned', '', ''); ?> </td> </tr> </table> </div></td> <td height="100%" valign='middle' width="175"><table style='border-left:1px solid; width:100%; height:100%'> <tr> <td width="130px"><div style='margin-left:15px'> <a href='#' class='css_button' onclick='submitForm();'> <span> <?php echo xlt('Submit'); ?> </span> </a> </div>
/** * Function to display the fields for a currently worn glasses/spectacle Rx. * @param $W - the Rx number, in order of documentation */ function generate_specRx($W) { global $pid, $form_id, $encounter, $display_W_width; $query = "select * from form_eye_mag_wearing where PID=? and FORM_ID=? and ENCOUNTER=? and RX_NUMBER =?"; $wear = sqlQuery($query, array($pid, $form_id, $encounter, $W)); if ($wear) { $RX_VALUE = '1'; @extract($wear); } else { $RX_VALUE = ''; $display_W = 'nodisplay'; } ob_start(); ?> <input type="hidden" id="W_<?php echo attr($W); ?> " name="W_<?php echo attr($W); ?> " value="<?php echo attr($RX_VALUE); ?> "> <div id="LayerVision_W_<?php echo attr($W); ?> " name="currentRX" class="refraction current_W borderShadow <?php echo attr($display_W); ?> <?php echo $display_W_width; ?> "> <i class="closeButton fa fa-close" id="Close_W_<?php echo attr($W); ?> " name="Close_W_<?php echo attr($W); ?> " title="<?php echo xla('Close this panel and delete this Rx'); ?> "></i> <i class="closeButton2 fa fa-arrows-h " id="W_width_display_<?php echo attr($W); ?> " name="W_width_display" title="<?php echo xla("Rx Details"); ?> " ></i> <i onclick="top.restoreSession(); doscript('W','<?php echo attr($pid); ?> ','<?php echo attr($encounter); ?> ','<?php echo attr($W); ?> '); return false;" title="<?php echo xla("Dispense Rx"); ?> " class="closeButton3 fa fa-print"></i> <i onclick="top.restoreSession(); dispensed('<?php echo attr($pid); ?> ');return false;" title="<?php echo xla("List of previously dispensed Spectacle and Contact Lens Rxs"); ?> " class="closeButton4 fa fa-list-ul"></i> <table id="wearing_<?php echo attr($W); ?> " > <tr> <th colspan="7"><?php echo xlt('Current Glasses'); ?> : #<?php echo attr($W); ?> </th> </tr> <tr> <td></td> <td><i class="fa fa-gamepad" name="reverseme" title="<?php echo xla('Convert between plus and minus cylinder'); ?> "aria-hidden="true" id="revW<?php echo attr($W); ?> " ></i></td> <td><?php echo xlt('Sph{{Sphere}}'); ?> </td> <td><?php echo xlt('Cyl{{Cylinder}}'); ?> </td> <td><?php echo xlt('Axis{{Axis of a glasses prescription}}'); ?> </td> <td><?php echo xlt('Acuity'); ?> </td> <td name="W_wide"></td> <td name="W_wide" title="<?php echo xla('Horizontal Prism Power'); ?> "><?php echo xlt('HP{{abbreviation for Horizontal Prism Power}}'); ?> </td> <td name="W_wide" title="<?php echo xla('Horizontal Prism Base'); ?> "><?php echo xlt('HB{{abbreviation for Horizontal Prism Base}}'); ?> </td> <td name="W_wide" title="<?php echo xla('Vertical Prism Power'); ?> "><?php echo xlt('VP{{abbreviation for Vertical Prism Power}}'); ?> </td> <td name="W_wide" title="<?php echo xla('Vertical Prism Base'); ?> "><?php echo xlt('VB{{abbreviation for Vertical Prism Base}}'); ?> </td> <td name="W_wide" title="<?php echo xla('Slab Off'); ?> "><?php echo xlt('Slab Off'); ?> </td> <td name="W_wide" title="<?php echo xla('Vertex Distance'); ?> "><?php echo xlt('VD{{abbreviation for Vertex Distance}}'); ?> </td> <td name="W_wide" title="<?php echo xla('Monocular Pupillary Diameter - Distance'); ?> "><?php echo xlt('MPD-D{{abbreviation for Monocular Pupillary Diameter - Distance}}'); ?> </td> <td name="W_wide" title="<?php echo xla('Monocular Pupillary Diameter - Near'); ?> "><?php echo xlt('MPD-N{{abbreviation for Monocular Pupillary Diameter - Near}}'); ?> </td> <td rowspan="6" class="right"> <?php echo xlt('Rx Type{{Type of glasses prescription}}'); ?> </span><br /> <label for="Single_<?php echo attr($W); ?> " class="input-helper input-helper--checkbox"><?php echo xlt('Single'); ?> </label> <input type="radio" value="0" id="Single_<?php echo attr($W); ?> " name="RX_TYPE_<?php echo attr($W); ?> " <?php if ($RX_TYPE == '0') { echo 'checked="checked"'; } ?> /></span><br /><br /> <label for="Bifocal_<?php echo attr($W); ?> " class="input-helper input-helper--checkbox"><?php echo xlt('Bifocal'); ?> </label> <input type="radio" value="1" id="Bifocal_<?php echo attr($W); ?> " name="RX_TYPE_<?php echo attr($W); ?> " <?php if ($RX_TYPE == '1') { echo 'checked="checked"'; } ?> /></span><br /><br /> <label for="Trifocal_<?php echo attr($W); ?> " class="input-helper input-helper--checkbox"><?php echo xlt('Trifocal'); ?> </label> <input type="radio" value="2" id="Trifocal_<?php echo attr($W); ?> " name="RX_TYPE_<?php echo attr($W); ?> " <?php if ($RX_TYPE == '2') { echo 'checked="checked"'; } ?> /></span><br /><br /> <label for="Progressive_<?php echo attr($W); ?> " class="input-helper input-helper--checkbox"><?php echo xlt('Prog.{{Progressive lenses}}'); ?> </label> <input type="radio" value="3" id="Progressive_<?php echo attr($W); ?> " name="RX_TYPE_<?php echo attr($W); ?> " <?php if ($RX_TYPE == '3') { echo 'checked="checked"'; } ?> /></span><br /> </td> </tr> <tr> <td rowspan="2"><?php echo xlt('Dist{{distance}}'); ?> </td> <td><b><?php echo xlt('OD{{right eye}}'); ?> :</b></td> <td><?php echo ${"ODSPH_{$W}"}; ?> <input type="text" class="sphere" id="ODSPH_<?php echo attr($W); ?> " name="ODSPH_<?php echo attr($W); ?> " value="<?php echo attr($ODSPH); ?> " tabindex="<?php echo attr($W); ?> 0100"></td> <td><input type="text" class="cylinder" id="ODCYL_<?php echo attr($W); ?> " name="ODCYL_<?php echo attr($W); ?> " value="<?php echo attr($ODCYL); ?> " tabindex="<?php echo attr($W); ?> 0101"></td> <td><input type="text" class="axis" id="ODAXIS_<?php echo attr($W); ?> " name="ODAXIS_<?php echo attr($W); ?> " value="<?php echo attr($ODAXIS); ?> " tabindex="<?php echo attr($W); ?> 0102"></td> <td><input type="text" class="acuity" id="ODVA_<?php echo attr($W); ?> " name="ODVA_<?php echo attr($W); ?> " value="<?php echo attr($ODVA); ?> " tabindex="<?php echo attr($W); ?> 0108"></td> <td name="W_wide"></td> <td name="W_wide"><input type="text" class="prism" id="ODHPD_<?php echo attr($W); ?> " name="ODHPD_<?php echo attr($W); ?> " value="<?php echo attr($ODHPD); ?> " tabindex="<?php echo attr($W); ?> 0112"></td> <td name="W_wide"><input type="text" class="prism" id="ODHBASE_<?php echo attr($W); ?> " name="ODHBASE_<?php echo attr($W); ?> " value="<?php echo attr($ODHBASE); ?> " tabindex="<?php echo attr($W); ?> 0114"></td> <td name="W_wide"><input type="text" class="prism" id="ODVPD_<?php echo attr($W); ?> " name="ODVPD_<?php echo attr($W); ?> " value="<?php echo attr($ODVPD); ?> " tabindex="<?php echo attr($W); ?> 0116"></td> <td name="W_wide"><input type="text" class="prism" id="ODVBASE_<?php echo attr($W); ?> " name="ODVBASE_<?php echo attr($W); ?> " value="<?php echo attr($ODVBASE); ?> " tabindex="<?php echo attr($W); ?> 0118"></td> <td name="W_wide"><input type="text" class="prism" id="ODSLABOFF_<?php echo attr($W); ?> " name="ODSLABOFF_<?php echo attr($W); ?> " value="<?php echo attr($ODSLABOFF); ?> " tabindex="<?php echo attr($W); ?> 0120"></td> <td name="W_wide"><input type="text" class="prism" id="ODVERTEXDIST_<?php echo attr($W); ?> " name="ODVERTEXDIST_<?php echo attr($W); ?> " value="<?php echo attr($ODVERTEXDIST); ?> " tabindex="<?php echo attr($W); ?> 0122"></td> <td name="W_wide"><input type="text" class="prism" id="ODMPDD_<?php echo attr($W); ?> " name="ODMPDD_<?php echo attr($W); ?> " value="<?php echo attr($ODMPDD); ?> " tabindex="<?php echo attr($W); ?> 0124"></td> <td name="W_wide"><input type="text" class="prism" id="ODMPDN_<?php echo attr($W); ?> " name="ODMPDN_<?php echo attr($W); ?> " value="<?php echo attr($ODMPDN); ?> " tabindex="<?php echo attr($W); ?> 0126"></td> </tr> <tr> <td><b><?php echo xlt('OS{{left eye}}'); ?> :</b></td> <td><input type="text" class="sphere" id="OSSPH_<?php echo attr($W); ?> " name="OSSPH_<?php echo attr($W); ?> " value="<?php echo attr($OSSPH); ?> " tabindex="<?php echo attr($W); ?> 0103"></td> <td><input type="text" class="cylinder" id="OSCYL_<?php echo attr($W); ?> " name="OSCYL_<?php echo attr($W); ?> " value="<?php echo attr($OSCYL); ?> " tabindex="<?php echo attr($W); ?> 0104"></td> <td><input type="text" class="axis" id="OSAXIS_<?php echo attr($W); ?> " name="OSAXIS_<?php echo attr($W); ?> " value="<?php echo attr($OSAXIS); ?> " tabindex="<?php echo attr($W); ?> 0105"></td> <td><input type="text" class="acuity" id="OSVA_<?php echo attr($W); ?> " name="OSVA_<?php echo attr($W); ?> " value="<?php echo attr($OSVA); ?> " tabindex="<?php echo attr($W); ?> 0109"></td> <td name="W_wide"></td> <td name="W_wide"><input type="text" class="prism" id="OSHPD_<?php echo attr($W); ?> " name="OSHPD_<?php echo attr($W); ?> " value="<?php echo attr($OSHPD); ?> " tabindex="<?php echo attr($W); ?> 0113"></td> <td name="W_wide"><input type="text" class="prism" id="OSHBASE_<?php echo attr($W); ?> " name="OSHBASE_<?php echo attr($W); ?> " value="<?php echo attr($OSHBASE); ?> " tabindex="<?php echo attr($W); ?> 0115"></td> <td name="W_wide"><input type="text" class="prism" id="OSVPD_<?php echo attr($W); ?> " name="OSVPD_<?php echo attr($W); ?> " value="<?php echo attr($OSVPD); ?> " tabindex="<?php echo attr($W); ?> 0117"></td> <td name="W_wide"><input type="text" class="prism" id="OSVBASE_<?php echo attr($W); ?> " name="OSVBASE_<?php echo attr($W); ?> " value="<?php echo attr($OSVBASE); ?> " tabindex="<?php echo attr($W); ?> 0119"></td> <td name="W_wide"><input type="text" class="prism" id="OSSLABOFF_<?php echo attr($W); ?> " name="OSSLABOFF_<?php echo attr($W); ?> " value="<?php echo attr($OSSLABOFF); ?> " tabindex="<?php echo attr($W); ?> 0121"></td> <td name="W_wide"><input type="text" class="prism" id="OSVERTEXDIST_<?php echo attr($W); ?> " name="OSVERTEXDIST_<?php echo attr($W); ?> " value="<?php echo attr($OSVERTEXDIST); ?> " tabindex="<?php echo attr($W); ?> 0123"></td> <td name="W_wide"><input type="text" class="prism" id="OSMPDD_<?php echo attr($W); ?> " name="OSMPDD_<?php echo attr($W); ?> " value="<?php echo attr($OSMPDD); ?> " tabindex="<?php echo attr($W); ?> 0125"></td> <td name="W_wide"><input type="text" class="prism" id="OSMPDN_<?php echo attr($W); ?> " name="OSMPDN_<?php echo attr($W); ?> " value="<?php echo attr($OSMPDN); ?> " tabindex="<?php echo attr($W); ?> 0127"></td> </tr> <tr class="WNEAR"> <td rowspan=2><?php echo xlt('Mid{{middle Rx strength}}'); ?> /<br /><?php echo xlt('Near'); ?> </td> <td><b><?php echo xlt('OD{{right eye}}'); ?> :</b></td> <?php echo '<input type="hidden" name="RXStart_' . $W . ' id="RXStart_' . $W . '" value="' . attr($RX_TYPE) . '">'; ?> <td class="WMid"><input type="text" class="presbyopia" id="ODMIDADD_<?php echo attr($W); ?> " name="ODMIDADD_<?php echo attr($W); ?> " value="<?php echo attr($ODMIDADD); ?> "></td> <td class="WAdd2"><input type="text" class="presbyopia" id="ODADD_<?php echo attr($W); ?> " name="ODADD_<?php echo attr($W); ?> " value="<?php echo attr($ODADD); ?> " tabindex="<?php echo attr($W); ?> 0106"></td> <td></td> <td><input class="jaeger" type="text" id="NEARODVA_<?php echo attr($W); ?> " name="NEARODVA_<?php echo attr($W); ?> " value="<?php echo attr($NEARODVA); ?> " tabindex="<?php echo attr($W); ?> 0110"></td> <td name="W_wide"></td> <td name="W_wide" title="<?php echo xla('Binocular Pupillary Diameter - Distance'); ?> "><?php echo xlt('PD-D{{abbreviation for Binocular Pupillary Diameter - Distance}}'); ?> </td> <td name="W_wide" title="<?php echo xla('Binocular Pupillary Diameter - Near'); ?> "><?php echo xlt('PD-N{{abbreviation for Binocular Pupillary Diameter - Near}}'); ?> </td> <td name="W_wide" title="<?php echo xla('Lens Material'); ?> " colspan="2"> <a href="<?php echo $GLOBALS['webroot']; ?> /interface/super/edit_list.php?list_id=Eye_Lens_Material" target="RTop" title="<?php echo xla('Click here to edit list of available Lens Materials'); ?> " name="Lens_mat"><span class="underline"><?php echo xlt('Lens Material'); ?> </span> <i class="fa fa-pencil fa-fw"></i> </a> </td> <td name="W_wide2" colspan="4" rowspan="4"> <a href="<?php echo $GLOBALS['webroot']; ?> /interface/super/edit_list.php?list_id=Eye_Lens_Treatments" target="RTop" title="<?php echo xla('Click here to edit list of available Lens Treatment Options'); ?> " name="Lens_txs"><span class="underline"><?php echo xlt('Lens Treatments'); ?> </span> <i class="fa fa-pencil fa-fw"></i> </a> <br /> <?php echo generate_lens_treatments($W, $LENS_TREATMENTS); ?> </td> </tr> <tr class="WNEAR"> <td><b><?php echo xlt('OS{{left eye}}'); ?> :</b></td> <td class="WMid"><input type="text" class="presbyopia" id="OSMIDADD_<?php echo attr($W); ?> " name="OSMIDADD_<?php echo attr($W); ?> " value="<?php echo attr($OSMIDADD); ?> "></td> <td class="WAdd2"><input type="text" class="presbyopia" id="OSADD_<?php echo attr($W); ?> " name="OSADD_<?php echo attr($W); ?> " value="<?php echo attr($OSADD); ?> " tabindex="<?php echo attr($W); ?> 0107"></td> <td></td> <td><input class="jaeger" type="text" id="NEAROSVA_<?php echo attr($W); ?> " name="NEAROSVA_<?php echo attr($W); ?> " value="<?php echo attr($NEAROSVA); ?> " tabindex="<?php echo attr($W); ?> 0111"></td> <td name="W_wide"></td> <td name="W_wide"><input type="text" class="prism" id="BPDD_<?php echo attr($W); ?> " name="BPDD_<?php echo attr($W); ?> " value="<?php echo attr($BPDD); ?> " tabindex="<?php echo attr($W); ?> 0128"></td> <td name="W_wide"><input type="text" class="prism" id="BPDN_<?php echo attr($W); ?> " name="BPDN_<?php echo attr($W); ?> " value="<?php echo attr($BPDN); ?> " tabindex="<?php echo attr($W); ?> 0129"></td> <td name="W_wide" title="<?php echo xla('Lens Material Options'); ?> " colspan="2"> <?php echo generate_select_list("LENS_MATERIAL_" . $W, "Eye_Lens_Material", "{$LENS_MATERIAL}", '', ' ', '', 'restoreSession;submit_form();', '', array('style' => 'width:120px', 'tabindex' => $W . '0130')); ?> </td> </tr> <tr> <td colspan="2"><b><?php echo xlt('Comments'); ?> :</b> </td> <td colspan="4" class="up"></td> </tr> <tr> <td colspan="6"> <textarea id="COMMENTS_<?php echo attr($W); ?> " name="COMMENTS_W" tabindex="<?php echo attr($W); ?> 0110"><?php echo text($COMMENTS); ?> </textarea> </td> <td colspan="2"> </td> </tr> </table> </div> <?php $output = ob_get_contents(); ob_end_clean(); return $output; }
<?php echo xlt('Specialty'); ?> : <input type='text' name='form_specialty' size='10' value='<?php echo attr($_POST['form_specialty']); ?> ' class='inputtext' title='<?php echo xla("Any part of the desired specialty"); ?> ' /> <?php echo xlt('Type') . ": "; // Generates a select list named form_abook_type: echo generate_select_list("form_abook_type", "abook_type", $_REQUEST['form_abook_type'], '', 'All'); ?> <input type='checkbox' name='form_external' value='1'<?php if ($form_external) { echo ' checked'; } ?> title='<?php echo xla("Omit internal users?"); ?> ' /> <?php echo xlt('External Only'); ?> <input type='submit' title='<?php
<td name="W_wide"></td> <td name="W_wide"><input type="text" class="prism" id="BPDD_1" name="BPDD_1" value="<?php echo attr($BPDD_1); ?> " tabindex="138"></td> <td name="W_wide"><input type="text" class="prism" id="BPDN_1" name="BPDN_1" value="<?php echo attr($BPDN_1); ?> " tabindex="140"></td> <td name="W_wide" title="<?php echo xla('Lens Material Options'); ?> " colspan="2" tabindex="142"> <?php echo generate_select_list("LENS_MATERIAL_1", "Eye_Lens_Material", "{$LENS_MATERIAL_1}", '', '--Lens Material--', '', 'restoreSession;submit_form();', '', array('style' => 'width:120px')); ?> </td> </tr> <tr> <td colspan="2"><b><?php echo xlt('Comments'); ?> :</b> </td> <td colspan="4" class="up"></td> </tr> <tr> <td colspan="6"> <textarea id="COMMENTS_1" name="COMMENTS_W" tabindex="111"><?php echo text($COMMENTS_1);
echo text($amendment_desc); } else { echo ""; } ?> </textarea></td> </tr> <tr> <td><span class=text ><?php echo xlt('Request Status'); ?> </span></td> <td> <?php echo generate_select_list("form_amendment_status", "amendment_status", $amendment_status, 'Amendment Status', ' ', '', '', '', $customAttributes); ?> </td> </tr> <tr> <td><span class=text ><?php echo xlt('Comments'); ?> </span></td> <td><textarea <?php echo $onlyRead ? "readonly" : ""; ?> id="note" name="note" rows="4" cols="30"><?php if ($amendment_id) { echo "";
echo htmlspecialchars(xl('Cancel'), ENT_NOQUOTES); ?> </span> </a> </td> </tr> </table> <table class="text"> <tr><td> <?php echo htmlspecialchars(xl('Transaction Type'), ENT_NOQUOTES); ?> : </td><td> <?php echo generate_select_list('title', 'transactions', $form_id, '', '', '', 'titleChanged()'); ?> </td></tr> </table> <div id='referdiv'> <?php if ($GLOBALS['enable_amc_prompting'] && 'LBTref' == $form_id) { ?> <div style='float:right;margin-right:25px;border-style:solid;border-width:1px;'> <div style='float:left;margin:5px 5px 5px 5px;'> <?php // Display the send records checkbox (AMC prompting) $itemAMC = amcCollect("send_sum_amc", $pid, 'transactions', $transid); ?>
?> )" type="text" style="width:60px;text-align:right; font-size:12px" /></td> <td align="left" class="<?php echo $StringClass; ?> " ><input name="HiddenReasonCode<?php echo $CountIndex; ?> " id="HiddenReasonCode<?php echo $CountIndex; ?> " value="<?php echo htmlspecialchars($ReasonCodeDB); ?> " type="hidden"/><?php echo generate_select_list("ReasonCode{$CountIndex}", "msp_remit_codes", "{$ReasonCodeDB}", "MSP Code"); ?> </td> <td align="center" class="<?php echo $StringClass; ?> " ><input type="checkbox" id="FollowUp<?php echo $CountIndex; ?> " name="FollowUp<?php echo $CountIndex; ?> " value="y" onClick="ActionFollowUp(<?php echo $CountIndex; ?> )" <?php
?> </td> </tr> <?php if ($_GET['prov'] != true) { ?> <tr> <td nowrap> <b><?php echo xlt('Room Number'); ?> :</b> </td> <td colspan='4' nowrap> <?php echo generate_select_list('form_room', 'patient_flow_board_rooms', $pcroom, xl('Room Number')); ?> </td> </tr> <?php } ?> <tr> <td nowrap> <b><?php echo xlt('Comments'); ?> :</b> </td> <td colspan='4' nowrap> <input type='text' size='40' name='form_comments' style='width:100%' value='<?php
public static function batch_despatch($var, $func, $data_credentials) { global $pid; if (UserService::valid($data_credentials)) { require_once "../../library/invoice_summary.inc.php"; require_once "../../library/options.inc.php"; require_once "../../library/acl.inc"; require_once "../../library/patient.inc"; if ($func == 'ar_responsible_party') { $patient_id = $pid; $encounter_id = $var['encounter']; $x['ar_responsible_party'] = ar_responsible_party($patient_id, $encounter_id); return UserService::function_return_to_xml($x); } elseif ($func == 'getInsuranceData') { $type = $var['type']; $given = $var['given']; $x = getInsuranceData($pid, $type, $given); return UserService::function_return_to_xml($x); } elseif ($func == 'generate_select_list') { $tag_name = $var['tag_name']; $list_id = $var['list_id']; $currvalue = $var['currvalue']; $title = $var['title']; $empty_name = $var['empty_name']; $class = $var['class']; $onchange = $var['onchange']; $x['generate_select_list'] = generate_select_list($tag_name, $list_id, $currvalue, $title, $empty_name, $class, $onchange); return UserService::function_return_to_xml($x); } elseif ($func == 'xl_layout_label') { $constant = $var['constant']; $x['xl_layout_label'] = xl_layout_label($constant); return UserService::function_return_to_xml($x); } elseif ($func == 'generate_form_field') { $frow = $var['frow']; $currvalue = $var['currvalue']; ob_start(); generate_form_field($frow, $currvalue); $x['generate_form_field'] = ob_get_contents(); ob_end_clean(); return UserService::function_return_to_xml($x); } elseif ($func == 'getInsuranceProviders') { $i = $var['i']; $provider = $var['provider']; $insurancei = getInsuranceProviders(); $x = $insurancei; return $x; } elseif ($func == 'get_layout_form_value') { $frow = $var['frow']; $_POST = $var['post_array']; $x['get_layout_form_value'] = get_layout_form_value($frow); return UserService::function_return_to_xml($x); } elseif ($func == 'updatePatientData') { $patient_data = $var['patient_data']; $create = $var['create']; updatePatientData($pid, $patient_data, $create); $x['ok'] = 'ok'; return UserService::function_return_to_xml($x); } elseif ($func == 'updateEmployerData') { $employer_data = $var['employer_data']; $create = $var['create']; updateEmployerData($pid, $employer_data, $create); $x['ok'] = 'ok'; return UserService::function_return_to_xml($x); } elseif ($func == 'newHistoryData') { newHistoryData($pid); $x['ok'] = 'ok'; return UserService::function_return_to_xml($x); } elseif ($func == 'newInsuranceData') { $_POST = $var[0]; foreach ($var as $key => $value) { if ($key >= 3) { $var[$key] = formData($value); } if ($key >= 1) { $parameters[$key] = $var[$key]; } } $parameters[12] = fixDate($parameters[12]); $parameters[27] = fixDate($parameters[27]); call_user_func_array('newInsuranceData', $parameters); $x['ok'] = 'ok'; return UserService::function_return_to_xml($x); } elseif ($func == 'generate_layout_validation') { $form_id = $var['form_id']; ob_start(); generate_layout_validation($form_id); $x = ob_get_clean(); return $x; } } else { throw new SoapFault("Server", "credentials failed"); } }
function generate_form_field($frow, $currvalue) { global $rootdir, $date_init, $ISSUE_TYPES, $code_types,$condition_str; $currescaped = htmlspecialchars($currvalue, ENT_QUOTES); $data_type = $frow['data_type']; $field_id = $frow['field_id']; $list_id = $frow['list_id']; $backup_list = $frow['list_backup_id']; $condition_str = get_conditions_str($condition_str,$frow); // escaped variables to use in html $field_id_esc= htmlspecialchars( $field_id, ENT_QUOTES); $list_id_esc = htmlspecialchars( $list_id, ENT_QUOTES); // Added 5-09 by BM - Translate description if applicable $description = (isset($frow['description']) ? htmlspecialchars(xl_layout_label($frow['description']), ENT_QUOTES) : ''); // Support edit option T which assigns the (possibly very long) description as // the default value. if (strpos($frow['edit_options'], 'T') !== FALSE) { if (strlen($currescaped) == 0) $currescaped = $description; // Description used in this way is not suitable as a title. $description = ''; } // added 5-2009 by BM to allow modification of the 'empty' text title field. // Can pass $frow['empty_title'] with this variable, otherwise // will default to 'Unassigned'. // modified 6-2009 by BM to allow complete skipping of the 'empty' text title // if make $frow['empty_title'] equal to 'SKIP' $showEmpty = true; if (isset($frow['empty_title'])) { if ($frow['empty_title'] == "SKIP") { //do not display an 'empty' choice $showEmpty = false; $empty_title = "Unassigned"; } else { $empty_title = $frow['empty_title']; } } else { $empty_title = "Unassigned"; } $disabled = strpos($frow['edit_options'], '0') === FALSE ? '' : 'disabled'; $lbfchange = (strpos($frow['form_id'], 'LBF') === 0 || strpos($frow['form_id'], 'LBT') === 0) ? "checkSkipConditions();" : ""; $lbfonchange = $lbfchange ? "onchange='$lbfchange'" : ""; // generic single-selection list or Race and Ethnicity. // These data types support backup lists. if ($data_type == 1 || $data_type == 33) { echo generate_select_list("form_$field_id", $list_id, $currvalue, $description, ($showEmpty ? $empty_title : ''), '', $lbfchange, '', ($disabled ? array('disabled' => 'disabled') : null), false, $backup_list); } // simple text field else if ($data_type == 2) { $fldlength = htmlspecialchars( $frow['fld_length'], ENT_QUOTES); $maxlength = $frow['max_length']; $string_maxlength = ""; // if max_length is set to zero, then do not set a maxlength if ($maxlength) $string_maxlength = "maxlength='".attr($maxlength)."'"; echo "<input type='text'" . " name='form_$field_id_esc'" . " id='form_$field_id_esc'" . " size='$fldlength'" . " $string_maxlength" . " title='$description'" . " value='$currescaped'"; $tmp = $lbfchange; if (strpos($frow['edit_options'], 'C') !== FALSE) $tmp .= "capitalizeMe(this);"; else if (strpos($frow['edit_options'], 'U') !== FALSE) $tmp .= "this.value = this.value.toUpperCase();"; if ($tmp) echo " onchange='$tmp'"; $tmp = htmlspecialchars( $GLOBALS['gbl_mask_patient_id'], ENT_QUOTES); if ($field_id == 'pubpid' && strlen($tmp) > 0) { echo " onkeyup='maskkeyup(this,\"$tmp\")'"; echo " onblur='maskblur(this,\"$tmp\")'"; } if (strpos($frow['edit_options'], '1') !== FALSE && strlen($currescaped) > 0) { echo " readonly"; } if ($disabled) echo ' disabled'; echo " />"; } // long or multi-line text field else if ($data_type == 3) { $textCols = htmlspecialchars( $frow['fld_length'], ENT_QUOTES); $textRows = htmlspecialchars( $frow['fld_rows'], ENT_QUOTES); echo "<textarea" . " name='form_$field_id_esc'" . " id='form_$field_id_esc'" . " title='$description'" . " cols='$textCols'" . " rows='$textRows' $lbfonchange $disabled" . ">" . $currescaped . "</textarea>"; } // date else if ($data_type == 4) { $age_asof_date = ''; // optionalAge() sets this $age_format = strpos($frow['edit_options'], 'A') === FALSE ? 3 : 0; $agestr = optionalAge($frow, $currvalue, $age_asof_date); if ($agestr) { echo "<table cellpadding='0' cellspacing='0'><tr><td class='text'>"; } echo "<input type='text' size='10' name='form_$field_id_esc' id='form_$field_id_esc'" . " value='" . substr($currescaped, 0, 10) . "'"; if (!$agestr) echo " title='$description'"; echo " $lbfonchange onkeyup='datekeyup(this,mypcc)' onblur='dateblur(this,mypcc)' $disabled />"; if (!$disabled) { echo "<img src='$rootdir/pic/show_calendar.gif' align='absbottom' width='24' height='22'" . " id='img_$field_id_esc' border='0' alt='[?]' style='cursor:pointer'" . " title='" . htmlspecialchars( xl('Click here to choose a date'), ENT_QUOTES) . "' />"; $date_init .= " Calendar.setup({" . "inputField:'form_$field_id', " . "ifFormat:'%Y-%m-%d', "; if ($agestr) { $date_init .= "onUpdate: function() {" . "if (typeof(updateAgeString) == 'function') updateAgeString('$field_id','$age_asof_date', $age_format);" . "}, "; } $date_init .= "button:'img_$field_id'})\n"; } // Optional display of age or gestational age. if ($agestr) { echo "</td></tr><tr><td id='span_$field_id' class='text'>" . text($agestr) . "</td></tr></table>"; } } // provider list, local providers only else if ($data_type == 10) { $ures = sqlStatement("SELECT id, fname, lname, specialty FROM users " . "WHERE active = 1 AND ( info IS NULL OR info NOT LIKE '%Inactive%' ) " . "AND authorized = 1 " . "ORDER BY lname, fname"); echo "<select name='form_$field_id_esc' id='form_$field_id_esc' title='$description' $lbfonchange $disabled>"; echo "<option value=''>" . xlt($empty_title) . "</option>"; $got_selected = false; while ($urow = sqlFetchArray($ures)) { $uname = text($urow['fname'] . ' ' . $urow['lname']); $optionId = attr($urow['id']); echo "<option value='$optionId'"; if ($urow['id'] == $currvalue) { echo " selected"; $got_selected = true; } echo ">$uname</option>"; } if (!$got_selected && $currvalue) { echo "<option value='" . attr($currvalue) . "' selected>* " . text($currvalue) . " *</option>"; echo "</select>"; echo " <font color='red' title='" . xla('Please choose a valid selection from the list.') . "'>" . xlt('Fix this') . "!</font>"; } else { echo "</select>"; } } // provider list, including address book entries with an NPI number else if ($data_type == 11) { $ures = sqlStatement("SELECT id, fname, lname, specialty FROM users " . "WHERE active = 1 AND ( info IS NULL OR info NOT LIKE '%Inactive%' ) " . "AND ( authorized = 1 OR ( username = '' AND npi != '' ) ) " . "ORDER BY lname, fname"); echo "<select name='form_$field_id_esc' id='form_$field_id_esc' title='$description'"; echo " $lbfonchange $disabled>"; echo "<option value=''>" . xlt('Unassigned') . "</option>"; $got_selected = false; while ($urow = sqlFetchArray($ures)) { $uname = text($urow['fname'] . ' ' . $urow['lname']); $optionId = attr($urow['id']); echo "<option value='$optionId'"; if ($urow['id'] == $currvalue) { echo " selected"; $got_selected = true; } echo ">$uname</option>"; } if (!$got_selected && $currvalue) { echo "<option value='" . attr($currvalue) . "' selected>* " . text($currvalue) . " *</option>"; echo "</select>"; echo " <font color='red' title='" . xla('Please choose a valid selection from the list.') . "'>" . xlt('Fix this') . "!</font>"; } else { echo "</select>"; } } // pharmacy list else if ($data_type == 12) { echo "<select name='form_$field_id_esc' id='form_$field_id_esc' title='$description'"; echo " $lbfonchange $disabled>"; echo "<option value='0'></option>"; $pres = get_pharmacies(); $got_selected = false; while ($prow = sqlFetchArray($pres)) { $key = $prow['id']; $optionValue = htmlspecialchars( $key, ENT_QUOTES); $optionLabel = htmlspecialchars( $prow['name'] . ' ' . $prow['area_code'] . '-' . $prow['prefix'] . '-' . $prow['number'] . ' / ' . $prow['line1'] . ' / ' . $prow['city'], ENT_NOQUOTES); echo "<option value='$optionValue'"; if ($currvalue == $key) { echo " selected"; $got_selected = true; } echo ">$optionLabel</option>"; } if (!$got_selected && $currvalue) { echo "<option value='" . attr($currvalue) . "' selected>* " . text($currvalue) . " *</option>"; echo "</select>"; echo " <font color='red' title='" . xla('Please choose a valid selection from the list.') . "'>" . xlt('Fix this') . "!</font>"; } else { echo "</select>"; } } // squads else if ($data_type == 13) { echo "<select name='form_$field_id_esc' id='form_$field_id_esc' title='$description'"; echo " $lbfonchange $disabled>"; echo "<option value=''> </option>"; $squads = acl_get_squads(); if ($squads) { foreach ($squads as $key => $value) { $optionValue = htmlspecialchars( $key, ENT_QUOTES); $optionLabel = htmlspecialchars( $value[3], ENT_NOQUOTES); echo "<option value='$optionValue'"; if ($currvalue == $key) echo " selected"; echo ">$optionLabel</option>\n"; } } echo "</select>"; } // Address book, preferring organization name if it exists and is not in // parentheses, and excluding local users who are not providers. // Supports "referred to" practitioners and facilities. // Alternatively the letter L in edit_options means that abook_type // must be "ord_lab", indicating types used with the procedure // lab ordering system. // Alternatively the letter O in edit_options means that abook_type // must begin with "ord_", indicating types used with the procedure // ordering system. // Alternatively the letter V in edit_options means that abook_type // must be "vendor", indicating the Vendor type. // Alternatively the letter R in edit_options means that abook_type // must be "dist", indicating the Distributor type. else if ($data_type == 14) { if (strpos($frow['edit_options'], 'L') !== FALSE) $tmp = "abook_type = 'ord_lab'"; else if (strpos($frow['edit_options'], 'O') !== FALSE) $tmp = "abook_type LIKE 'ord\\_%'"; else if (strpos($frow['edit_options'], 'V') !== FALSE) $tmp = "abook_type LIKE 'vendor%'"; else if (strpos($frow['edit_options'], 'R') !== FALSE) $tmp = "abook_type LIKE 'dist'"; else $tmp = "( username = '' OR authorized = 1 )"; $ures = sqlStatement("SELECT id, fname, lname, organization, username FROM users " . "WHERE active = 1 AND ( info IS NULL OR info NOT LIKE '%Inactive%' ) " . "AND $tmp " . "ORDER BY organization, lname, fname"); echo "<select name='form_$field_id_esc' id='form_$field_id_esc' title='$description'"; echo " $lbfonchange $disabled>"; echo "<option value=''>" . htmlspecialchars( xl('Unassigned'), ENT_NOQUOTES) . "</option>"; while ($urow = sqlFetchArray($ures)) { $uname = $urow['organization']; if (empty($uname) || substr($uname, 0, 1) == '(') { $uname = $urow['lname']; if ($urow['fname']) $uname .= ", " . $urow['fname']; } $optionValue = htmlspecialchars( $urow['id'], ENT_QUOTES); $optionLabel = htmlspecialchars( $uname, ENT_NOQUOTES); echo "<option value='$optionValue'"; $title = $urow['username'] ? xl('Local') : xl('External'); $optionTitle = htmlspecialchars( $title, ENT_QUOTES); echo " title='$optionTitle'"; if ($urow['id'] == $currvalue) echo " selected"; echo ">$optionLabel</option>"; } echo "</select>"; } // A billing code. If description matches an existing code type then that type is used. else if ($data_type == 15) { $fldlength = htmlspecialchars( $frow['fld_length'], ENT_QUOTES); $maxlength = $frow['max_length']; $string_maxlength = ""; // if max_length is set to zero, then do not set a maxlength if ($maxlength) $string_maxlength = "maxlength='".attr($maxlength)."'"; // if (strpos($frow['edit_options'], '2') !== FALSE && substr($frow['form_id'], 0, 3) == 'LBF') { // Option "2" generates a hidden input for the codes, and a matching visible field // displaying their descriptions. First step is computing the description string. $currdescstring = ''; if (!empty($currvalue)) { $relcodes = explode(';', $currvalue); foreach ($relcodes as $codestring) { if ($codestring === '') continue; $code_text = lookup_code_descriptions($codestring); if ($currdescstring !== '') $currdescstring .= '; '; if (!empty($code_text)) { $currdescstring .= $code_text; } else { $currdescstring .= $codestring; } } } $currdescstring = attr($currdescstring); // echo "<input type='text'" . " name='form_$field_id_esc'" . " id='form_related_code'" . " size='$fldlength'" . " value='$currescaped'" . " style='display:none'" . " $lbfonchange readonly $disabled />"; // Extra readonly input field for optional display of code description(s). echo "<input type='text'" . " name='form_$field_id_esc" . "__desc'" . " size='$fldlength'" . " title='$description'" . " value='$currdescstring'"; if (!$disabled) { echo " onclick='sel_related(this,\"$codetype\")'"; } echo " readonly $disabled />"; } else { echo "<input type='text'" . " name='form_$field_id_esc'" . " id='form_related_code'" . " size='$fldlength'" . " $string_maxlength" . " title='$description'" . " value='$currescaped'"; if (!$disabled) { echo " onclick='sel_related(this,\"$codetype\")'"; } echo " $lbfonchange readonly $disabled />"; } } // insurance company list else if ($data_type == 16) { echo "<select name='form_$field_id_esc' id='form_$field_id_esc' title='$description'>"; echo "<option value='0'></option>"; $insprovs = getInsuranceProviders(); $got_selected = false; foreach ($insprovs as $key => $ipname) { $optionValue = htmlspecialchars($key, ENT_QUOTES); $optionLabel = htmlspecialchars($ipname, ENT_NOQUOTES); echo "<option value='$optionValue'"; if ($currvalue == $key) { echo " selected"; $got_selected = true; } echo ">$optionLabel</option>"; } if (!$got_selected && $currvalue) { echo "<option value='" . attr($currvalue) . "' selected>* " . text($currvalue) . " *</option>"; echo "</select>"; echo " <font color='red' title='" . xla('Please choose a valid selection from the list.') . "'>" . xlt('Fix this') . "!</font>"; } else { echo "</select>"; } } // issue types else if ($data_type == 17) { echo "<select name='form_$field_id_esc' id='form_$field_id_esc' title='$description'>"; echo "<option value='0'></option>"; $got_selected = false; foreach ($ISSUE_TYPES as $key => $value) { $optionValue = htmlspecialchars($key, ENT_QUOTES); $optionLabel = htmlspecialchars($value[1], ENT_NOQUOTES); echo "<option value='$optionValue'"; if ($currvalue == $key) { echo " selected"; $got_selected = true; } echo ">$optionLabel</option>"; } if (!$got_selected && strlen($currvalue) > 0) { echo "<option value='" . attr($currvalue) . "' selected>* " . text($currvalue) . " *</option>"; echo "</select>"; echo " <font color='red' title='" . xla('Please choose a valid selection from the list.') . "'>" . xlt('Fix this') . "!</font>"; } else { echo "</select>"; } } // Visit categories. else if ($data_type == 18) { $cres = sqlStatement("SELECT pc_catid, pc_catname " . "FROM openemr_postcalendar_categories ORDER BY pc_catname"); echo "<select name='form_$field_id_esc' id='form_$field_id_esc' title='$description'" . " $lbfonchange $disabled>"; echo "<option value=''>" . xlt($empty_title) . "</option>"; $got_selected = false; while ($crow = sqlFetchArray($cres)) { $catid = $crow['pc_catid']; if (($catid < 9 && $catid != 5) || $catid == 11) continue; echo "<option value='" . attr($catid) . "'"; if ($catid == $currvalue) { echo " selected"; $got_selected = true; } echo ">" . text(xl_appt_category($crow['pc_catname'])) . "</option>"; } if (!$got_selected && $currvalue) { echo "<option value='" . attr($currvalue) . "' selected>* " . text($currvalue) . " *</option>"; echo "</select>"; echo " <font color='red' title='" . xla('Please choose a valid selection from the list.') . "'>" . xlt('Fix this') . "!</font>"; } else { echo "</select>"; } } // a set of labeled checkboxes else if ($data_type == 21) { // In this special case, fld_length is the number of columns generated. $cols = max(1, $frow['fld_length']); $avalue = explode('|', $currvalue); $lres = sqlStatement("SELECT * FROM list_options " . "WHERE list_id = ? AND activity = 1 ORDER BY seq, title", array($list_id) ); echo "<table cellpadding='0' cellspacing='0' width='100%'>"; $tdpct = (int) (100 / $cols); for ($count = 0; $lrow = sqlFetchArray($lres); ++$count) { $option_id = $lrow['option_id']; $option_id_esc = htmlspecialchars( $option_id, ENT_QUOTES); // if ($count) echo "<br />"; if ($count % $cols == 0) { if ($count) echo "</tr>"; echo "<tr>"; } echo "<td width='$tdpct%'>"; echo "<input type='checkbox' name='form_{$field_id_esc}[$option_id_esc]'" . "id='form_{$field_id_esc}[$option_id_esc]' value='1' $lbfonchange"; if (in_array($option_id, $avalue)) echo " checked"; // Added 5-09 by BM - Translate label if applicable echo " $disabled />" . htmlspecialchars( xl_list_label($lrow['title']), ENT_NOQUOTES); echo "</td>"; } if ($count) { echo "</tr>"; if ($count > $cols) { // Add some space after multiple rows of checkboxes. $cols = htmlspecialchars( $cols, ENT_QUOTES); echo "<tr><td colspan='$cols' style='height:0.7em'></td></tr>"; } } echo "</table>"; } // a set of labeled text input fields else if ($data_type == 22) { $tmp = explode('|', $currvalue); $avalue = array(); foreach ($tmp as $value) { if (preg_match('/^([^:]+):(.*)$/', $value, $matches)) { $avalue[$matches[1]] = $matches[2]; } } $lres = sqlStatement("SELECT * FROM list_options " . "WHERE list_id = ? AND activity = 1 ORDER BY seq, title", array($list_id) ); echo "<table cellpadding='0' cellspacing='0'>"; while ($lrow = sqlFetchArray($lres)) { $option_id = $lrow['option_id']; $option_id_esc = htmlspecialchars( $option_id, ENT_QUOTES); $maxlength = $frow['max_length']; $string_maxlength = ""; // if max_length is set to zero, then do not set a maxlength if ($maxlength) $string_maxlength = "maxlength='".attr($maxlength)."'"; $fldlength = empty($frow['fld_length']) ? 20 : $frow['fld_length']; // Added 5-09 by BM - Translate label if applicable echo "<tr><td>" . htmlspecialchars( xl_list_label($lrow['title']), ENT_NOQUOTES) . " </td>"; $fldlength = htmlspecialchars( $fldlength, ENT_QUOTES); $optionValue = htmlspecialchars( $avalue[$option_id], ENT_QUOTES); echo "<td><input type='text'" . " name='form_{$field_id_esc}[$option_id_esc]'" . " id='form_{$field_id_esc}[$option_id_esc]'" . " size='$fldlength'" . " $string_maxlength" . " value='$optionValue'"; echo " $lbfonchange $disabled /></td></tr>"; } echo "</table>"; } // a set of exam results; 3 radio buttons and a text field: else if ($data_type == 23) { $tmp = explode('|', $currvalue); $avalue = array(); foreach ($tmp as $value) { if (preg_match('/^([^:]+):(.*)$/', $value, $matches)) { $avalue[$matches[1]] = $matches[2]; } } $maxlength = $frow['max_length']; $string_maxlength = ""; // if max_length is set to zero, then do not set a maxlength if ($maxlength) $string_maxlength = "maxlength='".attr($maxlength)."'"; $fldlength = empty($frow['fld_length']) ? 20 : $frow['fld_length']; $lres = sqlStatement("SELECT * FROM list_options " . "WHERE list_id = ? AND activity = 1 ORDER BY seq, title", array($list_id) ); echo "<table cellpadding='0' cellspacing='0'>"; echo "<tr><td> </td><td class='bold'>" . htmlspecialchars( xl('N/A'), ENT_NOQUOTES) . " </td><td class='bold'>" . htmlspecialchars( xl('Nor'), ENT_NOQUOTES) . " </td>" . "<td class='bold'>" . htmlspecialchars( xl('Abn'), ENT_NOQUOTES) . " </td><td class='bold'>" . htmlspecialchars( xl('Date/Notes'), ENT_NOQUOTES) . "</td></tr>"; while ($lrow = sqlFetchArray($lres)) { $option_id = $lrow['option_id']; $option_id_esc = htmlspecialchars( $option_id, ENT_QUOTES); $restype = substr($avalue[$option_id], 0, 1); $resnote = substr($avalue[$option_id], 2); // Added 5-09 by BM - Translate label if applicable echo "<tr><td>" . htmlspecialchars( xl_list_label($lrow['title']), ENT_NOQUOTES) . " </td>"; for ($i = 0; $i < 3; ++$i) { $inputValue = htmlspecialchars( $i, ENT_QUOTES); echo "<td><input type='radio'" . " name='radio_{$field_id_esc}[$option_id_esc]'" . " id='radio_{$field_id_esc}[$option_id_esc]'" . " value='$inputValue' $lbfonchange"; if ($restype === "$i") echo " checked"; echo " $disabled /></td>"; } $fldlength = htmlspecialchars( $fldlength, ENT_QUOTES); $resnote = htmlspecialchars( $resnote, ENT_QUOTES); echo "<td><input type='text'" . " name='form_{$field_id_esc}[$option_id_esc]'" . " id='form_{$field_id_esc}[$option_id_esc]'" . " size='$fldlength'" . " $string_maxlength" . " value='$resnote' $disabled /></td>"; echo "</tr>"; } echo "</table>"; } // the list of active allergies for the current patient // this is read-only! else if ($data_type == 24) { $query = "SELECT title, comments FROM lists WHERE " . "pid = ? AND type = 'allergy' AND enddate IS NULL " . "ORDER BY begdate"; // echo "<!-- $query -->\n"; // debugging $lres = sqlStatement($query, array($GLOBALS['pid'])); $count = 0; while ($lrow = sqlFetchArray($lres)) { if ($count++) echo "<br />"; echo htmlspecialchars( $lrow['title'], ENT_NOQUOTES); if ($lrow['comments']) echo ' (' . htmlspecialchars( $lrow['comments'], ENT_NOQUOTES) . ')'; } } // a set of labeled checkboxes, each with a text field: else if ($data_type == 25) { $tmp = explode('|', $currvalue); $avalue = array(); foreach ($tmp as $value) { if (preg_match('/^([^:]+):(.*)$/', $value, $matches)) { $avalue[$matches[1]] = $matches[2]; } } $maxlength = $frow['max_length']; $string_maxlength = ""; // if max_length is set to zero, then do not set a maxlength if ($maxlength) $string_maxlength = "maxlength='".attr($maxlength)."'"; $fldlength = empty($frow['fld_length']) ? 20 : $frow['fld_length']; $lres = sqlStatement("SELECT * FROM list_options " . "WHERE list_id = ? AND activity = 1 ORDER BY seq, title", array($list_id) ); echo "<table cellpadding='0' cellspacing='0'>"; while ($lrow = sqlFetchArray($lres)) { $option_id = $lrow['option_id']; $option_id_esc = htmlspecialchars( $option_id, ENT_QUOTES); $restype = substr($avalue[$option_id], 0, 1); $resnote = substr($avalue[$option_id], 2); // Added 5-09 by BM - Translate label if applicable echo "<tr><td>" . htmlspecialchars( xl_list_label($lrow['title']), ENT_NOQUOTES) . " </td>"; $option_id = htmlspecialchars( $option_id, ENT_QUOTES); echo "<td><input type='checkbox' name='check_{$field_id_esc}[$option_id_esc]'" . " id='check_{$field_id_esc}[$option_id_esc]' value='1' $lbfonchange"; if ($restype) echo " checked"; echo " $disabled /> </td>"; $fldlength = htmlspecialchars( $fldlength, ENT_QUOTES); $resnote = htmlspecialchars( $resnote, ENT_QUOTES); echo "<td><input type='text'" . " name='form_{$field_id_esc}[$option_id_esc]'" . " id='form_{$field_id_esc}[$option_id_esc]'" . " size='$fldlength'" . " $string_maxlength" . " value='$resnote' $disabled /></td>"; echo "</tr>"; } echo "</table>"; } // single-selection list with ability to add to it else if ($data_type == 26) { echo generate_select_list("form_$field_id", $list_id, $currvalue, $description, ($showEmpty ? $empty_title : ''), 'addtolistclass_'.$list_id, $lbfchange, '', ($disabled ? array('disabled' => 'disabled') : null), false, $backup_list); // show the add button if user has access to correct list $inputValue = htmlspecialchars( xl('Add'), ENT_QUOTES); $outputAddButton = "<input type='button' id='addtolistid_" . $list_id_esc . "' fieldid='form_" . $field_id_esc . "' class='addtolist' value='$inputValue' $disabled />"; if (aco_exist('lists', $list_id)) { // a specific aco exist for this list, so ensure access if (acl_check('lists', $list_id)) echo $outputAddButton; } else { // no specific aco exist for this list, so check for access to 'default' list if (acl_check('lists', 'default')) echo $outputAddButton; } } // a set of labeled radio buttons else if ($data_type == 27) { // In this special case, fld_length is the number of columns generated. $cols = max(1, $frow['fld_length']); $lres = sqlStatement("SELECT * FROM list_options " . "WHERE list_id = ? AND activity = 1 ORDER BY seq, title", array($list_id) ); echo "<table cellpadding='0' cellspacing='0' width='100%'>"; $tdpct = (int) (100 / $cols); $got_selected = FALSE; for ($count = 0; $lrow = sqlFetchArray($lres); ++$count) { $option_id = $lrow['option_id']; $option_id_esc = htmlspecialchars( $option_id, ENT_QUOTES); if ($count % $cols == 0) { if ($count) echo "</tr>"; echo "<tr>"; } echo "<td width='$tdpct%'>"; echo "<input type='radio' name='form_{$field_id_esc}' id='form_{$field_id_esc}[$option_id_esc]'" . " value='$option_id_esc' $lbfonchange"; if ((strlen($currvalue) == 0 && $lrow['is_default']) || (strlen($currvalue) > 0 && $option_id == $currvalue)) { echo " checked"; $got_selected = TRUE; } echo " $disabled />" . htmlspecialchars(xl_list_label($lrow['title']), ENT_NOQUOTES); echo "</td>"; } if ($count) { echo "</tr>"; if ($count > $cols) { // Add some space after multiple rows of radio buttons. $cols = htmlspecialchars($cols, ENT_QUOTES); echo "<tr><td colspan='$cols' style='height:0.7em'></td></tr>"; } } echo "</table>"; if (!$got_selected && strlen($currvalue) > 0) { $fontTitle = htmlspecialchars( xl('Please choose a valid selection.'), ENT_QUOTES); $fontText = htmlspecialchars( xl('Fix this'), ENT_NOQUOTES); echo "$currescaped <font color='red' title='$fontTitle'>$fontText!</font>"; } } // special case for history of lifestyle status; 3 radio buttons and a date text field: // VicarePlus :: A selection list box for smoking status: else if ($data_type == 28 || $data_type == 32) { $tmp = explode('|', $currvalue); switch(count($tmp)) { case "4": { $resnote = $tmp[0]; $restype = $tmp[1]; $resdate = $tmp[2]; $reslist = $tmp[3]; } break; case "3": { $resnote = $tmp[0]; $restype = $tmp[1]; $resdate = $tmp[2]; } break; case "2": { $resnote = $tmp[0]; $restype = $tmp[1]; $resdate = ""; } break; case "1": { $resnote = $tmp[0]; $resdate = $restype = ""; } break; default: { $restype = $resdate = $resnote = ""; } break; } $maxlength = $frow['max_length']; $string_maxlength = ""; // if max_length is set to zero, then do not set a maxlength if ($maxlength) $string_maxlength = "maxlength='".attr($maxlength)."'"; $fldlength = empty($frow['fld_length']) ? 20 : $frow['fld_length']; $fldlength = htmlspecialchars( $fldlength, ENT_QUOTES); $resnote = htmlspecialchars( $resnote, ENT_QUOTES); $resdate = htmlspecialchars( $resdate, ENT_QUOTES); echo "<table cellpadding='0' cellspacing='0'>"; echo "<tr>"; if ($data_type == 28) { // input text echo "<td><input type='text'" . " name='form_$field_id_esc'" . " id='form_$field_id_esc'" . " size='$fldlength'" . " $string_maxlength" . " value='$resnote' $disabled /> </td>"; echo "<td class='bold'> ". " ". htmlspecialchars( xl('Status'), ENT_NOQUOTES).": </td>"; } else if($data_type == 32) { // input text echo "<tr><td><input type='text'" . " name='form_text_$field_id_esc'" . " id='form_text_$field_id_esc'" . " size='$fldlength'" . " $string_maxlength" . " value='$resnote' $disabled /> </td></tr>"; echo "<td>"; //Selection list for smoking status $onchange = 'radioChange(this.options[this.selectedIndex].value)';//VicarePlus :: The javascript function for selection list. echo generate_select_list("form_$field_id", $list_id, $reslist, $description, ($showEmpty ? $empty_title : ''), '', $onchange, '', ($disabled ? array('disabled' => 'disabled') : null)); echo "</td>"; echo "<td class='bold'> " . xlt('Status') . ": </td>"; } // current echo "<td class='text' ><input type='radio'" . " name='radio_{$field_id_esc}'" . " id='radio_{$field_id_esc}[current]'" . " value='current" . $field_id_esc . "' $lbfonchange"; if ($restype == "current" . $field_id) echo " checked"; if ($data_type == 32) echo " onClick='smoking_statusClicked(this)'"; echo " />" . xlt('Current') . " </td>"; // quit echo "<td class='text'><input type='radio'" . " name='radio_{$field_id_esc}'" . " id='radio_{$field_id_esc}[quit]'" . " value='quit".$field_id_esc."' $lbfonchange"; if ($restype == "quit" . $field_id) echo " checked"; if($data_type == 32) echo " onClick='smoking_statusClicked(this)'"; echo " $disabled />" . xlt('Quit') . " </td>"; // quit date echo "<td class='text'><input type='text' size='6' name='date_$field_id_esc' id='date_$field_id_esc'" . " value='$resdate'" . " title='$description'" . " onkeyup='datekeyup(this,mypcc)' onblur='dateblur(this,mypcc)' $disabled />"; if (!$disabled) { echo "<img src='$rootdir/pic/show_calendar.gif' align='absbottom' width='24' height='22'" . " id='img_$field_id_esc' border='0' alt='[?]' style='cursor:pointer'" . " title='" . htmlspecialchars( xl('Click here to choose a date'), ENT_QUOTES) . "' />"; $date_init .= " Calendar.setup({inputField:'date_$field_id', ifFormat:'%Y-%m-%d', button:'img_$field_id'});\n"; } echo " </td>"; // never echo "<td class='text'><input type='radio'" . " name='radio_{$field_id_esc}'" . " id='radio_{$field_id_esc}[never]'" . " value='never" . $field_id_esc . "' $lbfonchange"; if ($restype == "never" . $field_id) echo " checked"; if($data_type == 32) echo " onClick='smoking_statusClicked(this)'"; echo " />" . xlt('Never') . " </td>"; // Not Applicable echo "<td class='text'><input type='radio'" . " name='radio_{$field_id}'" . " id='radio_{$field_id}[not_applicable]'" . " value='not_applicable" . $field_id . "' $lbfonchange"; if ($restype == "not_applicable" . $field_id) echo " checked"; if($data_type == 32) echo " onClick='smoking_statusClicked(this)'"; echo " $disabled />" . xlt('N/A') . " </td>"; // //Added on 5-jun-2k14 (regarding 'Smoking Status - display SNOMED code description') echo "<td class='text' ><div id='smoke_code'></div></td>"; echo "</tr>"; echo "</table>"; } // static text. read-only, of course. else if ($data_type == 31) { echo nl2br($frow['description']); } //$data_type == 33 // Race and Ethnicity. After added support for backup lists, this is now the same as datatype 1; so have migrated it there. //$data_type == 33 else if($data_type == 34){ $arr = explode("|*|*|*|",$currvalue); echo "<a href='../../../library/custom_template/custom_template.php?type=form_{$field_id}&contextName=".htmlspecialchars($list_id_esc,ENT_QUOTES)."' class='iframe_medium' style='text-decoration:none;color:black;'>"; echo "<div id='form_{$field_id}_div' class='text-area'>".htmlspecialchars($arr[0],ENT_QUOTES)."</div>"; echo "<div style='display:none'><textarea name='form_{$field_id}' id='form_{$field_id}' style='display:none' $lbfonchange $disabled>" . $currvalue . "</textarea></div>"; echo "</a>"; } //facilities drop-down list else if ($data_type == 35) { if (empty($currvalue)){ $currvalue = 0; } dropdown_facility($selected = $currvalue, $name = "form_$field_id_esc", $allow_unspecified = true, $allow_allfacilities = false, $disabled, $lbfchange); } //multiple select // supports backup list else if ($data_type == 36) { echo generate_select_list("form_$field_id", $list_id, $currvalue, $description, $showEmpty ? $empty_title : '', '', $onchange, '', null, true, $backup_list); } // Canvas and related elements for browser-side image drawing. // Note you must invoke lbf_canvas_head() (below) to use this field type in a form. else if ($data_type == 40) { // Unlike other field types, width and height are in pixels. $canWidth = intval($frow['fld_length']); $canHeight = intval($frow['fld_rows']); if (empty($currvalue)) { if (preg_match('/\\bimage=([a-zA-Z0-9._-]*)/', $frow['description'], $matches)) { // If defined this is the filename of the default starting image. $currvalue = $GLOBALS['web_root'] . '/sites/' . $_SESSION['site_id'] . '/images/' . $matches[1]; } } echo "<div id='form_$field_id_esc'></div>"; // Hidden form field exists to send updated data to the server at submit time. echo "<input type='hidden' name='form_$field_id_esc' value='' />"; // Hidden image exists to support initialization of the canvas. echo "<img src='" . attr($currvalue) . "' id='form_{$field_id_esc}_img' style='display:none'>"; // $date_init is a misnomer but it's the place for browser-side setup logic. $date_init .= " lbfCanvasSetup('form_$field_id_esc', $canWidth, $canHeight);\n"; } }
} echo "</td>\n"; echo " <td>"; echo "<input type='text' size='4' name='form_result_units[{$lino}]'" . " class='celltext' value='" . attr($result_units) . "' " . " title='" . xl('Units applicable to the result value') . "'" . " />"; echo "</td>\n"; echo " <td>"; echo "<input type='text' size='8' name='form_result_range[{$lino}]'" . " class='celltext' value='" . attr($result_range) . "' " . " title='" . xl('Reference range of results') . "'" . " />"; // Include a hidden form field containing all IDs for this line. echo "<input type='hidden' name='form_line[{$lino}]' " . "value='{$order_id}:{$order_seq}:{$report_id}:{$result_id}' />"; echo "</td>\n"; echo " <td class='bold' style='cursor:pointer' " . "onclick='extShow({$lino}, this)' align='center' " . "title='" . xl('Click here to view/edit more details') . "'>"; echo " ? "; echo "</td>\n"; echo " </tr>\n"; // Create a floating div for additional attributes of this result. $extra_html .= "<div id='ext_{$lino}' " . "style='position:absolute;width:750px;border:1px solid black;" . "padding:2px;background-color:#cccccc;visibility:hidden;" . "z-index:1000;left:-1000px;top:0px;font-size:9pt;'>\n" . "<table width='100%'>\n" . "<tr><td class='bold' align='center' colspan='2' style='padding:4pt 0 4pt 0'>" . htmlspecialchars($result_text) . "</td></tr>\n" . "<tr><td class='bold' width='1%' nowrap>" . xlt('Status') . ": </td>" . "<td>" . generate_select_list("form_result_status[{$lino}]", 'proc_res_status', $result_status, xl('Result Status'), '') . "</td></tr>\n" . "<tr><td class='bold' nowrap>" . xlt('Facility') . ": </td>" . "<td><input type='text' size='15' name='form_facility[{$lino}]'" . " value='{$result_facility}' " . " title='" . xla('Supplier facility name') . "'" . " style='width:100%' /></td></tr>\n" . "<tr><td class='bold' nowrap>" . xlt('Comments') . ": </td>" . "<td><textarea rows='3' cols='15' name='form_comments[{$lino}]'" . " title='" . xla('Comments for this result or recommendation') . "'" . " style='width:100%' />" . htmlspecialchars($result_comments) . "</textarea></td></tr>\n" . "<tr><td class='bold' nowrap>" . xlt('Notes') . ": </td>" . "<td><textarea rows='4' cols='15' name='form_notes[{$lino}]'" . " title='" . xla('Additional notes for this result or recommendation') . "'" . " style='width:100%' />" . htmlspecialchars($result_notes) . "</textarea></td></tr>\n" . "</table>\n" . "<p><center><input type='button' value='" . xla('Close') . "' " . "onclick='extShow({$lino}, false)' /></center></p>\n" . "</div>"; $lastpoid = $order_id; $lastpcid = $order_seq; $lastprid = $report_id; ++$lino; } } if (!empty($facilities)) { // display facility information $extra_html .= "<table>"; $extra_html .= "<tr><th>" . xl('Performing Laboratory Facility') . "</th></tr>"; foreach ($facilities as $facilityID) { foreach (explode(":", $facilityID) as $lab_facility) { $facility_array = getFacilityInfo($lab_facility); if ($facility_array) { $extra_html .= "<tr><td><hr></td></tr>" . "<tr><td>" . htmlspecialchars($facility_array['fname']) . " " . htmlspecialchars($facility_array['lname']) . ", " . htmlspecialchars($facility_array['title']) . "</td></tr>" . "<tr><td>" . htmlspecialchars($facility_array['organization']) . "</td></tr>" . "<tr><td>" . htmlspecialchars($facility_array['street']) . " " . htmlspecialchars($facility_array['city']) . " " . htmlspecialchars($facility_array['state']) . "</td></tr>" . "<tr><td>" . htmlspecialchars(formatPhone($facility_array['phone'])) . "</td></tr>";
<body class="body_top"> <center> <form id="form_note" method="post" action="patient_tracker_status.php?tracker_id=<?php echo attr($tracker_id) ?>" enctype="multipart/form-data" > <table> <h2><?php echo xlt('Change Status for'). " " . text($row['fname']) . " " . text($row['lname']); ?></h2> <span class=text><?php echo xlt('Status Type'); ?>: </span><br> <?php # Generate drop down list for status. echo generate_select_list('statustype', 'apptstat',$trow['laststatus'], xl('Status Type')); ?> <br><br> <span class=text><?php echo xlt('Exam Room Number'); ?>: </span><br> <?php # Generate drop down list for room number. echo generate_select_list('roomnum', 'patient_flow_board_rooms',$trow['lastroom'], xl('Exam Room Number')); ?> <br><br> <tr> <td> <a href='javascript:;' class='css_button_small' style='color:gray' onclick='document.getElementById("form_note").submit();'><span><?php echo xla('Save')?></span></a> <a href='javascript:;' class='css_button_small' style='color:gray' onclick="window.close().submit();" ><span><?php echo xla('Cancel'); ?></span></a> </td> </tr> </table> </td> </form> </center> </body> </html>
echo htmlspecialchars(xl('Cancel'), ENT_NOQUOTES); ?> </span> </a> </td> </tr> </table> <table class="text"> <tr><td> <?php echo htmlspecialchars(xl('Transaction Type'), ENT_NOQUOTES); ?> : </td><td> <?php echo generate_select_list('title', 'transactions', $_REQUEST['title'], '', '', '', 'titleChanged()'); ?> </td></tr> </table> <div id='referdiv'> <div id="DEM"> <ul class="tabNav"> <?php $fres = sqlStatement("SELECT * FROM layout_options " . "WHERE form_id = 'REF' AND uor > 0 " . "ORDER BY group_name, seq"); $last_group = ''; $cell_count = 0; $item_count = 0; $display_style = 'block'; while ($frow = sqlFetchArray($fres)) {
</td> <td> <textarea class='text' name="note" id="note" rows=5 cols=25><?php echo htmlspecialchars($note, ENT_NOQUOTES); ?> </textarea> </td> </tr> <tr> <td align="right" class='text'> <?php echo htmlspecialchars(xl('Completion Status'), ENT_NOQUOTES); ?> </td> <td> <?php echo generate_select_list('immuniz_completion_status', 'Immunization_Completion_Status', $immuniz_completion_status, 'Select Completion Status', ' '); ?> </td> </tr> <tr> <td colspan="3" align="center"> <input type="button" name="save" id="save" value="<?php echo htmlspecialchars(xl('Save Immunization'), ENT_QUOTES); ?> "> <input type="button" name="print" id="print" value="<?php echo htmlspecialchars(xl('Print Record') . xl('PDF', '', ' (', ')'), ENT_QUOTES); ?> ">
</td> </tr> <tr<?php if ($GLOBALS['athletic_team'] || $GLOBALS['ippf_specific']) { echo " style='display:none;'"; } ?> > <td valign='top' nowrap><b><?php xl('Outcome', 'e'); ?> :</b></td> <td> <?php echo generate_select_list('form_outcome', 'outcome', $irow['outcome'], '', '', '', 'outcomeClicked(this);'); ?> </td> </tr> <tr<?php if ($GLOBALS['athletic_team'] || $GLOBALS['ippf_specific']) { echo " style='display:none;'"; } ?> > <td valign='top' nowrap><b><?php xl('Destination', 'e'); ?> :</b></td> <td>
function generate_form_field($frow, $currvalue) { global $rootdir, $date_init, $ISSUE_TYPES, $code_types; $currescaped = htmlspecialchars($currvalue, ENT_QUOTES); $data_type = $frow['data_type']; $field_id = $frow['field_id']; $list_id = $frow['list_id']; $backup_list = $frow['list_backup_id']; // escaped variables to use in html $field_id_esc = htmlspecialchars($field_id, ENT_QUOTES); $list_id_esc = htmlspecialchars($list_id, ENT_QUOTES); // Added 5-09 by BM - Translate description if applicable $description = isset($frow['description']) ? htmlspecialchars(xl_layout_label($frow['description']), ENT_QUOTES) : ''; // Support edit option T which assigns the (possibly very long) description as // the default value. if (strpos($frow['edit_options'], 'T') !== FALSE) { if (strlen($currescaped) == 0) { $currescaped = $description; } // Description used in this way is not suitable as a title. $description = ''; } // added 5-2009 by BM to allow modification of the 'empty' text title field. // Can pass $frow['empty_title'] with this variable, otherwise // will default to 'Unassigned'. // modified 6-2009 by BM to allow complete skipping of the 'empty' text title // if make $frow['empty_title'] equal to 'SKIP' $showEmpty = true; if (isset($frow['empty_title'])) { if ($frow['empty_title'] == "SKIP") { //do not display an 'empty' choice $showEmpty = false; $empty_title = "Unassigned"; } else { $empty_title = $frow['empty_title']; } } else { $empty_title = "Unassigned"; } $disabled = strpos($frow['edit_options'], '0') === FALSE ? '' : 'disabled'; $lbfchange = strpos($frow['form_id'], 'LBF') === 0 ? "checkSkipConditions();" : ""; $lbfonchange = $lbfchange ? "onchange='{$lbfchange}'" : ""; // generic single-selection list or Race and Ethnicity. // These data types support backup lists. if ($data_type == 1 || $data_type == 33) { echo generate_select_list("form_{$field_id}", $list_id, $currvalue, $description, $showEmpty ? $empty_title : '', '', $lbfchange, '', $disabled ? array('disabled' => 'disabled') : null, false, $backup_list); } else { if ($data_type == 2) { $fldlength = htmlspecialchars($frow['fld_length'], ENT_QUOTES); $maxlength = $frow['max_length']; $string_maxlength = ""; // if max_length is set to zero, then do not set a maxlength if ($maxlength) { $string_maxlength = "maxlength='" . attr($maxlength) . "'"; } echo "<input type='text'" . " name='form_{$field_id_esc}'" . " id='form_{$field_id_esc}'" . " size='{$fldlength}'" . " {$string_maxlength}" . " title='{$description}'" . " value='{$currescaped}'"; $tmp = $lbfchange; if (strpos($frow['edit_options'], 'C') !== FALSE) { $tmp .= "capitalizeMe(this);"; } else { if (strpos($frow['edit_options'], 'U') !== FALSE) { $tmp .= "this.value = this.value.toUpperCase();"; } } if ($tmp) { echo " onchange='{$tmp}'"; } $tmp = htmlspecialchars($GLOBALS['gbl_mask_patient_id'], ENT_QUOTES); if ($field_id == 'pubpid' && strlen($tmp) > 0) { echo " onkeyup='maskkeyup(this,\"{$tmp}\")'"; echo " onblur='maskblur(this,\"{$tmp}\")'"; } if (strpos($frow['edit_options'], '1') !== FALSE && strlen($currescaped) > 0) { echo " readonly"; } if ($disabled) { echo ' disabled'; } echo " />"; } else { if ($data_type == 3) { $textCols = htmlspecialchars($frow['fld_length'], ENT_QUOTES); $textRows = htmlspecialchars($frow['fld_rows'], ENT_QUOTES); echo "<textarea" . " name='form_{$field_id_esc}'" . " id='form_{$field_id_esc}'" . " title='{$description}'" . " cols='{$textCols}'" . " rows='{$textRows}' {$lbfonchange} {$disabled}" . ">" . $currescaped . "</textarea>"; } else { if ($data_type == 4) { $age_asof_date = ''; // optionalAge() sets this $age_format = strpos($frow['edit_options'], 'A') === FALSE ? 3 : 0; $agestr = optionalAge($frow, $currvalue, $age_asof_date); if ($agestr) { echo "<table cellpadding='0' cellspacing='0'><tr><td class='text'>"; } echo "<input type='text' size='10' name='form_{$field_id_esc}' id='form_{$field_id_esc}'" . " value='" . substr($currescaped, 0, 10) . "'"; if (!$agestr) { echo " title='{$description}'"; } echo " {$lbfonchange} onkeyup='datekeyup(this,mypcc)' onblur='dateblur(this,mypcc)' {$disabled} />"; if (!$disabled) { echo "<img src='{$rootdir}/pic/show_calendar.gif' align='absbottom' width='24' height='22'" . " id='img_{$field_id_esc}' border='0' alt='[?]' style='cursor:pointer'" . " title='" . htmlspecialchars(xl('Click here to choose a date'), ENT_QUOTES) . "' />"; $date_init .= " Calendar.setup({" . "inputField:'form_{$field_id}', " . "ifFormat:'%Y-%m-%d', "; if ($agestr) { $date_init .= "onUpdate: function() {" . "if (typeof(updateAgeString) == 'function') updateAgeString('{$field_id}','{$age_asof_date}', {$age_format});" . "}, "; } $date_init .= "button:'img_{$field_id}'})\n"; } // Optional display of age or gestational age. if ($agestr) { echo "</td></tr><tr><td id='span_{$field_id}' class='text'>" . text($agestr) . "</td></tr></table>"; } } else { if ($data_type == 10) { $ures = sqlStatement("SELECT id, fname, lname, specialty FROM users " . "WHERE active = 1 AND ( info IS NULL OR info NOT LIKE '%Inactive%' ) " . "AND authorized = 1 " . "ORDER BY lname, fname"); echo "<select name='form_{$field_id_esc}' id='form_{$field_id_esc}' title='{$description}' {$lbfonchange} {$disabled}>"; echo "<option value=''>" . xlt($empty_title) . "</option>"; $got_selected = false; while ($urow = sqlFetchArray($ures)) { $uname = text($urow['fname'] . ' ' . $urow['lname']); $optionId = attr($urow['id']); echo "<option value='{$optionId}'"; if ($urow['id'] == $currvalue) { echo " selected"; $got_selected = true; } echo ">{$uname}</option>"; } if (!$got_selected && $currvalue) { echo "<option value='" . attr($currvalue) . "' selected>* " . text($currvalue) . " *</option>"; echo "</select>"; echo " <font color='red' title='" . xla('Please choose a valid selection from the list.') . "'>" . xlt('Fix this') . "!</font>"; } else { echo "</select>"; } } else { if ($data_type == 11) { $ures = sqlStatement("SELECT id, fname, lname, specialty FROM users " . "WHERE active = 1 AND ( info IS NULL OR info NOT LIKE '%Inactive%' ) " . "AND ( authorized = 1 OR ( username = '' AND npi != '' ) ) " . "ORDER BY lname, fname"); echo "<select name='form_{$field_id_esc}' id='form_{$field_id_esc}' title='{$description}'"; echo " {$lbfonchange} {$disabled}>"; echo "<option value=''>" . xlt('Unassigned') . "</option>"; $got_selected = false; while ($urow = sqlFetchArray($ures)) { $uname = text($urow['fname'] . ' ' . $urow['lname']); $optionId = attr($urow['id']); echo "<option value='{$optionId}'"; if ($urow['id'] == $currvalue) { echo " selected"; $got_selected = true; } echo ">{$uname}</option>"; } if (!$got_selected && $currvalue) { echo "<option value='" . attr($currvalue) . "' selected>* " . text($currvalue) . " *</option>"; echo "</select>"; echo " <font color='red' title='" . xla('Please choose a valid selection from the list.') . "'>" . xlt('Fix this') . "!</font>"; } else { echo "</select>"; } } else { if ($data_type == 12) { echo "<select name='form_{$field_id_esc}' id='form_{$field_id_esc}' title='{$description}'"; echo " {$lbfonchange} {$disabled}>"; echo "<option value='0'></option>"; $pres = get_pharmacies(); $got_selected = false; while ($prow = sqlFetchArray($pres)) { $key = $prow['id']; $optionValue = htmlspecialchars($key, ENT_QUOTES); $optionLabel = htmlspecialchars($prow['name'] . ' ' . $prow['area_code'] . '-' . $prow['prefix'] . '-' . $prow['number'] . ' / ' . $prow['line1'] . ' / ' . $prow['city'], ENT_NOQUOTES); echo "<option value='{$optionValue}'"; if ($currvalue == $key) { echo " selected"; $got_selected = true; } echo ">{$optionLabel}</option>"; } if (!$got_selected && $currvalue) { echo "<option value='" . attr($currvalue) . "' selected>* " . text($currvalue) . " *</option>"; echo "</select>"; echo " <font color='red' title='" . xla('Please choose a valid selection from the list.') . "'>" . xlt('Fix this') . "!</font>"; } else { echo "</select>"; } } else { if ($data_type == 13) { echo "<select name='form_{$field_id_esc}' id='form_{$field_id_esc}' title='{$description}'"; echo " {$lbfonchange} {$disabled}>"; echo "<option value=''> </option>"; $squads = acl_get_squads(); if ($squads) { foreach ($squads as $key => $value) { $optionValue = htmlspecialchars($key, ENT_QUOTES); $optionLabel = htmlspecialchars($value[3], ENT_NOQUOTES); echo "<option value='{$optionValue}'"; if ($currvalue == $key) { echo " selected"; } echo ">{$optionLabel}</option>\n"; } } echo "</select>"; } else { if ($data_type == 14) { if (strpos($frow['edit_options'], 'L') !== FALSE) { $tmp = "abook_type = 'ord_lab'"; } else { if (strpos($frow['edit_options'], 'O') !== FALSE) { $tmp = "abook_type LIKE 'ord\\_%'"; } else { if (strpos($frow['edit_options'], 'V') !== FALSE) { $tmp = "abook_type LIKE 'vendor%'"; } else { if (strpos($frow['edit_options'], 'R') !== FALSE) { $tmp = "abook_type LIKE 'dist'"; } else { $tmp = "( username = '' OR authorized = 1 )"; } } } } $ures = sqlStatement("SELECT id, fname, lname, organization, username FROM users " . "WHERE active = 1 AND ( info IS NULL OR info NOT LIKE '%Inactive%' ) " . "AND {$tmp} " . "ORDER BY organization, lname, fname"); echo "<select name='form_{$field_id_esc}' id='form_{$field_id_esc}' title='{$description}'"; echo " {$lbfonchange} {$disabled}>"; echo "<option value=''>" . htmlspecialchars(xl('Unassigned'), ENT_NOQUOTES) . "</option>"; while ($urow = sqlFetchArray($ures)) { $uname = $urow['organization']; if (empty($uname) || substr($uname, 0, 1) == '(') { $uname = $urow['lname']; if ($urow['fname']) { $uname .= ", " . $urow['fname']; } } $optionValue = htmlspecialchars($urow['id'], ENT_QUOTES); $optionLabel = htmlspecialchars($uname, ENT_NOQUOTES); echo "<option value='{$optionValue}'"; $title = $urow['username'] ? xl('Local') : xl('External'); $optionTitle = htmlspecialchars($title, ENT_QUOTES); echo " title='{$optionTitle}'"; if ($urow['id'] == $currvalue) { echo " selected"; } echo ">{$optionLabel}</option>"; } echo "</select>"; } else { if ($data_type == 15) { $fldlength = htmlspecialchars($frow['fld_length'], ENT_QUOTES); $maxlength = $frow['max_length']; $string_maxlength = ""; // if max_length is set to zero, then do not set a maxlength if ($maxlength) { $string_maxlength = "maxlength='" . attr($maxlength) . "'"; } // if (strpos($frow['edit_options'], '2') !== FALSE && substr($frow['form_id'], 0, 3) == 'LBF') { // Option "2" generates a hidden input for the codes, and a matching visible field // displaying their descriptions. First step is computing the description string. $currdescstring = ''; if (!empty($currvalue)) { $relcodes = explode(';', $currvalue); foreach ($relcodes as $codestring) { if ($codestring === '') { continue; } $code_text = lookup_code_descriptions($codestring); if ($currdescstring !== '') { $currdescstring .= '; '; } if (!empty($code_text)) { $currdescstring .= $code_text; } else { $currdescstring .= $codestring; } } } $currdescstring = attr($currdescstring); // echo "<input type='text'" . " name='form_{$field_id_esc}'" . " id='form_related_code'" . " size='{$fldlength}'" . " value='{$currescaped}'" . " style='display:none'" . " {$lbfonchange} readonly {$disabled} />"; // Extra readonly input field for optional display of code description(s). echo "<input type='text'" . " name='form_{$field_id_esc}" . "__desc'" . " size='{$fldlength}'" . " title='{$description}'" . " value='{$currdescstring}'"; if (!$disabled) { echo " onclick='sel_related(this,\"{$codetype}\")'"; } echo " readonly {$disabled} />"; } else { echo "<input type='text'" . " name='form_{$field_id_esc}'" . " id='form_related_code'" . " size='{$fldlength}'" . " {$string_maxlength}" . " title='{$description}'" . " value='{$currescaped}'"; if (!$disabled) { echo " onclick='sel_related(this,\"{$codetype}\")'"; } echo " {$lbfonchange} readonly {$disabled} />"; } } else { if ($data_type == 16) { echo "<select name='form_{$field_id_esc}' id='form_{$field_id_esc}' title='{$description}'>"; echo "<option value='0'></option>"; $insprovs = getInsuranceProviders(); $got_selected = false; foreach ($insprovs as $key => $ipname) { $optionValue = htmlspecialchars($key, ENT_QUOTES); $optionLabel = htmlspecialchars($ipname, ENT_NOQUOTES); echo "<option value='{$optionValue}'"; if ($currvalue == $key) { echo " selected"; $got_selected = true; } echo ">{$optionLabel}</option>"; } if (!$got_selected && $currvalue) { echo "<option value='" . attr($currvalue) . "' selected>* " . text($currvalue) . " *</option>"; echo "</select>"; echo " <font color='red' title='" . xla('Please choose a valid selection from the list.') . "'>" . xlt('Fix this') . "!</font>"; } else { echo "</select>"; } } else { if ($data_type == 17) { echo "<select name='form_{$field_id_esc}' id='form_{$field_id_esc}' title='{$description}'>"; echo "<option value='0'></option>"; $got_selected = false; foreach ($ISSUE_TYPES as $key => $value) { $optionValue = htmlspecialchars($key, ENT_QUOTES); $optionLabel = htmlspecialchars($value[1], ENT_NOQUOTES); echo "<option value='{$optionValue}'"; if ($currvalue == $key) { echo " selected"; $got_selected = true; } echo ">{$optionLabel}</option>"; } if (!$got_selected && strlen($currvalue) > 0) { echo "<option value='" . attr($currvalue) . "' selected>* " . text($currvalue) . " *</option>"; echo "</select>"; echo " <font color='red' title='" . xla('Please choose a valid selection from the list.') . "'>" . xlt('Fix this') . "!</font>"; } else { echo "</select>"; } } else { if ($data_type == 18) { $cres = sqlStatement("SELECT pc_catid, pc_catname " . "FROM openemr_postcalendar_categories ORDER BY pc_catname"); echo "<select name='form_{$field_id_esc}' id='form_{$field_id_esc}' title='{$description}'" . " {$lbfonchange} {$disabled}>"; echo "<option value=''>" . xlt($empty_title) . "</option>"; $got_selected = false; while ($crow = sqlFetchArray($cres)) { $catid = $crow['pc_catid']; if ($catid < 9 && $catid != 5 || $catid == 11) { continue; } echo "<option value='" . attr($catid) . "'"; if ($catid == $currvalue) { echo " selected"; $got_selected = true; } echo ">" . text(xl_appt_category($crow['pc_catname'])) . "</option>"; } if (!$got_selected && $currvalue) { echo "<option value='" . attr($currvalue) . "' selected>* " . text($currvalue) . " *</option>"; echo "</select>"; echo " <font color='red' title='" . xla('Please choose a valid selection from the list.') . "'>" . xlt('Fix this') . "!</font>"; } else { echo "</select>"; } } else { if ($data_type == 21) { // In this special case, fld_length is the number of columns generated. $cols = max(1, $frow['fld_length']); $avalue = explode('|', $currvalue); $lres = sqlStatement("SELECT * FROM list_options " . "WHERE list_id = ? ORDER BY seq, title", array($list_id)); echo "<table cellpadding='0' cellspacing='0' width='100%'>"; $tdpct = (int) (100 / $cols); for ($count = 0; $lrow = sqlFetchArray($lres); ++$count) { $option_id = $lrow['option_id']; $option_id_esc = htmlspecialchars($option_id, ENT_QUOTES); // if ($count) echo "<br />"; if ($count % $cols == 0) { if ($count) { echo "</tr>"; } echo "<tr>"; } echo "<td width='{$tdpct}%'>"; echo "<input type='checkbox' name='form_{$field_id_esc}[{$option_id_esc}]'" . "id='form_{$field_id_esc}[{$option_id_esc}]' value='1' {$lbfonchange}"; if (in_array($option_id, $avalue)) { echo " checked"; } // Added 5-09 by BM - Translate label if applicable echo " {$disabled} />" . htmlspecialchars(xl_list_label($lrow['title']), ENT_NOQUOTES); echo "</td>"; } if ($count) { echo "</tr>"; if ($count > $cols) { // Add some space after multiple rows of checkboxes. $cols = htmlspecialchars($cols, ENT_QUOTES); echo "<tr><td colspan='{$cols}' style='height:0.7em'></td></tr>"; } } echo "</table>"; } else { if ($data_type == 22) { $tmp = explode('|', $currvalue); $avalue = array(); foreach ($tmp as $value) { if (preg_match('/^([^:]+):(.*)$/', $value, $matches)) { $avalue[$matches[1]] = $matches[2]; } } $lres = sqlStatement("SELECT * FROM list_options " . "WHERE list_id = ? ORDER BY seq, title", array($list_id)); echo "<table cellpadding='0' cellspacing='0'>"; while ($lrow = sqlFetchArray($lres)) { $option_id = $lrow['option_id']; $option_id_esc = htmlspecialchars($option_id, ENT_QUOTES); $maxlength = $frow['max_length']; $string_maxlength = ""; // if max_length is set to zero, then do not set a maxlength if ($maxlength) { $string_maxlength = "maxlength='" . attr($maxlength) . "'"; } $fldlength = empty($frow['fld_length']) ? 20 : $frow['fld_length']; // Added 5-09 by BM - Translate label if applicable echo "<tr><td>" . htmlspecialchars(xl_list_label($lrow['title']), ENT_NOQUOTES) . " </td>"; $fldlength = htmlspecialchars($fldlength, ENT_QUOTES); $optionValue = htmlspecialchars($avalue[$option_id], ENT_QUOTES); echo "<td><input type='text'" . " name='form_{$field_id_esc}[{$option_id_esc}]'" . " id='form_{$field_id_esc}[{$option_id_esc}]'" . " size='{$fldlength}'" . " {$string_maxlength}" . " value='{$optionValue}'"; echo " {$lbfonchange} {$disabled} /></td></tr>"; } echo "</table>"; } else { if ($data_type == 23) { $tmp = explode('|', $currvalue); $avalue = array(); foreach ($tmp as $value) { if (preg_match('/^([^:]+):(.*)$/', $value, $matches)) { $avalue[$matches[1]] = $matches[2]; } } $maxlength = $frow['max_length']; $string_maxlength = ""; // if max_length is set to zero, then do not set a maxlength if ($maxlength) { $string_maxlength = "maxlength='" . attr($maxlength) . "'"; } $fldlength = empty($frow['fld_length']) ? 20 : $frow['fld_length']; $lres = sqlStatement("SELECT * FROM list_options " . "WHERE list_id = ? ORDER BY seq, title", array($list_id)); echo "<table cellpadding='0' cellspacing='0'>"; echo "<tr><td> </td><td class='bold'>" . htmlspecialchars(xl('N/A'), ENT_NOQUOTES) . " </td><td class='bold'>" . htmlspecialchars(xl('Nor'), ENT_NOQUOTES) . " </td>" . "<td class='bold'>" . htmlspecialchars(xl('Abn'), ENT_NOQUOTES) . " </td><td class='bold'>" . htmlspecialchars(xl('Date/Notes'), ENT_NOQUOTES) . "</td></tr>"; while ($lrow = sqlFetchArray($lres)) { $option_id = $lrow['option_id']; $option_id_esc = htmlspecialchars($option_id, ENT_QUOTES); $restype = substr($avalue[$option_id], 0, 1); $resnote = substr($avalue[$option_id], 2); // Added 5-09 by BM - Translate label if applicable echo "<tr><td>" . htmlspecialchars(xl_list_label($lrow['title']), ENT_NOQUOTES) . " </td>"; for ($i = 0; $i < 3; ++$i) { $inputValue = htmlspecialchars($i, ENT_QUOTES); echo "<td><input type='radio'" . " name='radio_{$field_id_esc}[{$option_id_esc}]'" . " id='radio_{$field_id_esc}[{$option_id_esc}]'" . " value='{$inputValue}' {$lbfonchange}"; if ($restype === "{$i}") { echo " checked"; } echo " {$disabled} /></td>"; } $fldlength = htmlspecialchars($fldlength, ENT_QUOTES); $resnote = htmlspecialchars($resnote, ENT_QUOTES); echo "<td><input type='text'" . " name='form_{$field_id_esc}[{$option_id_esc}]'" . " id='form_{$field_id_esc}[{$option_id_esc}]'" . " size='{$fldlength}'" . " {$string_maxlength}" . " value='{$resnote}' {$disabled} /></td>"; echo "</tr>"; } echo "</table>"; } else { if ($data_type == 24) { $query = "SELECT title, comments FROM lists WHERE " . "pid = ? AND type = 'allergy' AND enddate IS NULL " . "ORDER BY begdate"; // echo "<!-- $query -->\n"; // debugging $lres = sqlStatement($query, array($GLOBALS['pid'])); $count = 0; while ($lrow = sqlFetchArray($lres)) { if ($count++) { echo "<br />"; } echo htmlspecialchars($lrow['title'], ENT_NOQUOTES); if ($lrow['comments']) { echo ' (' . htmlspecialchars($lrow['comments'], ENT_NOQUOTES) . ')'; } } } else { if ($data_type == 25) { $tmp = explode('|', $currvalue); $avalue = array(); foreach ($tmp as $value) { if (preg_match('/^([^:]+):(.*)$/', $value, $matches)) { $avalue[$matches[1]] = $matches[2]; } } $maxlength = $frow['max_length']; $string_maxlength = ""; // if max_length is set to zero, then do not set a maxlength if ($maxlength) { $string_maxlength = "maxlength='" . attr($maxlength) . "'"; } $fldlength = empty($frow['fld_length']) ? 20 : $frow['fld_length']; $lres = sqlStatement("SELECT * FROM list_options " . "WHERE list_id = ? ORDER BY seq, title", array($list_id)); echo "<table cellpadding='0' cellspacing='0'>"; while ($lrow = sqlFetchArray($lres)) { $option_id = $lrow['option_id']; $option_id_esc = htmlspecialchars($option_id, ENT_QUOTES); $restype = substr($avalue[$option_id], 0, 1); $resnote = substr($avalue[$option_id], 2); // Added 5-09 by BM - Translate label if applicable echo "<tr><td>" . htmlspecialchars(xl_list_label($lrow['title']), ENT_NOQUOTES) . " </td>"; $option_id = htmlspecialchars($option_id, ENT_QUOTES); echo "<td><input type='checkbox' name='check_{$field_id_esc}[{$option_id_esc}]'" . " id='check_{$field_id_esc}[{$option_id_esc}]' value='1' {$lbfonchange}"; if ($restype) { echo " checked"; } echo " {$disabled} /> </td>"; $fldlength = htmlspecialchars($fldlength, ENT_QUOTES); $resnote = htmlspecialchars($resnote, ENT_QUOTES); echo "<td><input type='text'" . " name='form_{$field_id_esc}[{$option_id_esc}]'" . " id='form_{$field_id_esc}[{$option_id_esc}]'" . " size='{$fldlength}'" . " {$string_maxlength}" . " value='{$resnote}' {$disabled} /></td>"; echo "</tr>"; } echo "</table>"; } else { if ($data_type == 26) { echo generate_select_list("form_{$field_id}", $list_id, $currvalue, $description, $showEmpty ? $empty_title : '', 'addtolistclass_' . $list_id, $lbfchange, '', $disabled ? array('disabled' => 'disabled') : null, false, $backup_list); // show the add button if user has access to correct list $inputValue = htmlspecialchars(xl('Add'), ENT_QUOTES); $outputAddButton = "<input type='button' id='addtolistid_" . $list_id_esc . "' fieldid='form_" . $field_id_esc . "' class='addtolist' value='{$inputValue}' {$disabled} />"; if (aco_exist('lists', $list_id)) { // a specific aco exist for this list, so ensure access if (acl_check('lists', $list_id)) { echo $outputAddButton; } } else { // no specific aco exist for this list, so check for access to 'default' list if (acl_check('lists', 'default')) { echo $outputAddButton; } } } else { if ($data_type == 27) { // In this special case, fld_length is the number of columns generated. $cols = max(1, $frow['fld_length']); $lres = sqlStatement("SELECT * FROM list_options " . "WHERE list_id = ? ORDER BY seq, title", array($list_id)); echo "<table cellpadding='0' cellspacing='0' width='100%'>"; $tdpct = (int) (100 / $cols); $got_selected = FALSE; for ($count = 0; $lrow = sqlFetchArray($lres); ++$count) { $option_id = $lrow['option_id']; $option_id_esc = htmlspecialchars($option_id, ENT_QUOTES); if ($count % $cols == 0) { if ($count) { echo "</tr>"; } echo "<tr>"; } echo "<td width='{$tdpct}%'>"; echo "<input type='radio' name='form_{$field_id_esc}' id='form_{$field_id_esc}[{$option_id_esc}]'" . " value='{$option_id_esc}' {$lbfonchange}"; if (strlen($currvalue) == 0 && $lrow['is_default'] || strlen($currvalue) > 0 && $option_id == $currvalue) { echo " checked"; $got_selected = TRUE; } echo " {$disabled} />" . htmlspecialchars(xl_list_label($lrow['title']), ENT_NOQUOTES); echo "</td>"; } if ($count) { echo "</tr>"; if ($count > $cols) { // Add some space after multiple rows of radio buttons. $cols = htmlspecialchars($cols, ENT_QUOTES); echo "<tr><td colspan='{$cols}' style='height:0.7em'></td></tr>"; } } echo "</table>"; if (!$got_selected && strlen($currvalue) > 0) { $fontTitle = htmlspecialchars(xl('Please choose a valid selection.'), ENT_QUOTES); $fontText = htmlspecialchars(xl('Fix this'), ENT_NOQUOTES); echo "{$currescaped} <font color='red' title='{$fontTitle}'>{$fontText}!</font>"; } } else { if ($data_type == 28 || $data_type == 32) { $tmp = explode('|', $currvalue); switch (count($tmp)) { case "4": $resnote = $tmp[0]; $restype = $tmp[1]; $resdate = $tmp[2]; $reslist = $tmp[3]; break; case "3": $resnote = $tmp[0]; $restype = $tmp[1]; $resdate = $tmp[2]; break; case "2": $resnote = $tmp[0]; $restype = $tmp[1]; $resdate = ""; break; case "1": $resnote = $tmp[0]; $resdate = $restype = ""; break; default: $restype = $resdate = $resnote = ""; break; } $maxlength = $frow['max_length']; $string_maxlength = ""; // if max_length is set to zero, then do not set a maxlength if ($maxlength) { $string_maxlength = "maxlength='" . attr($maxlength) . "'"; } $fldlength = empty($frow['fld_length']) ? 20 : $frow['fld_length']; $fldlength = htmlspecialchars($fldlength, ENT_QUOTES); $resnote = htmlspecialchars($resnote, ENT_QUOTES); $resdate = htmlspecialchars($resdate, ENT_QUOTES); echo "<table cellpadding='0' cellspacing='0'>"; echo "<tr>"; if ($data_type == 28) { // input text echo "<td><input type='text'" . " name='form_{$field_id_esc}'" . " id='form_{$field_id_esc}'" . " size='{$fldlength}'" . " {$string_maxlength}" . " value='{$resnote}' {$disabled} /> </td>"; echo "<td class='bold'> " . " " . htmlspecialchars(xl('Status'), ENT_NOQUOTES) . ": </td>"; } else { if ($data_type == 32) { // input text echo "<tr><td><input type='text'" . " name='form_text_{$field_id_esc}'" . " id='form_text_{$field_id_esc}'" . " size='{$fldlength}'" . " {$string_maxlength}" . " value='{$resnote}' {$disabled} /> </td></tr>"; echo "<td>"; //Selection list for smoking status $onchange = 'radioChange(this.options[this.selectedIndex].value)'; //VicarePlus :: The javascript function for selection list. echo generate_select_list("form_{$field_id}", $list_id, $reslist, $description, $showEmpty ? $empty_title : '', '', $onchange, '', $disabled ? array('disabled' => 'disabled') : null); echo "</td>"; echo "<td class='bold'> " . xlt('Status') . ": </td>"; } } // current echo "<td class='text' ><input type='radio'" . " name='radio_{$field_id_esc}'" . " id='radio_{$field_id_esc}[current]'" . " value='current" . $field_id_esc . "' {$lbfonchange}"; if ($restype == "current" . $field_id) { echo " checked"; } if ($data_type == 32) { echo " onClick='smoking_statusClicked(this)'"; } echo " />" . xlt('Current') . " </td>"; // quit echo "<td class='text'><input type='radio'" . " name='radio_{$field_id_esc}'" . " id='radio_{$field_id_esc}[quit]'" . " value='quit" . $field_id_esc . "' {$lbfonchange}"; if ($restype == "quit" . $field_id) { echo " checked"; } if ($data_type == 32) { echo " onClick='smoking_statusClicked(this)'"; } echo " {$disabled} />" . xlt('Quit') . " </td>"; // quit date echo "<td class='text'><input type='text' size='6' name='date_{$field_id_esc}' id='date_{$field_id_esc}'" . " value='{$resdate}'" . " title='{$description}'" . " onkeyup='datekeyup(this,mypcc)' onblur='dateblur(this,mypcc)' {$disabled} />"; if (!$disabled) { echo "<img src='{$rootdir}/pic/show_calendar.gif' align='absbottom' width='24' height='22'" . " id='img_{$field_id_esc}' border='0' alt='[?]' style='cursor:pointer'" . " title='" . htmlspecialchars(xl('Click here to choose a date'), ENT_QUOTES) . "' />"; $date_init .= " Calendar.setup({inputField:'date_{$field_id}', ifFormat:'%Y-%m-%d', button:'img_{$field_id}'});\n"; } echo " </td>"; // never echo "<td class='text'><input type='radio'" . " name='radio_{$field_id_esc}'" . " id='radio_{$field_id_esc}[never]'" . " value='never" . $field_id_esc . "' {$lbfonchange}"; if ($restype == "never" . $field_id) { echo " checked"; } if ($data_type == 32) { echo " onClick='smoking_statusClicked(this)'"; } echo " />" . xlt('Never') . " </td>"; // Not Applicable echo "<td class='text'><input type='radio'" . " name='radio_{$field_id}'" . " id='radio_{$field_id}[not_applicable]'" . " value='not_applicable" . $field_id . "' {$lbfonchange}"; if ($restype == "not_applicable" . $field_id) { echo " checked"; } if ($data_type == 32) { echo " onClick='smoking_statusClicked(this)'"; } echo " {$disabled} />" . xlt('N/A') . " </td>"; // //Added on 5-jun-2k14 (regarding 'Smoking Status - display SNOMED code description') echo "<td class='text' ><div id='smoke_code'></div></td>"; echo "</tr>"; echo "</table>"; } else { if ($data_type == 31) { echo nl2br($frow['description']); } else { if ($data_type == 34) { $arr = explode("|*|*|*|", $currvalue); echo "<a href='../../../library/custom_template/custom_template.php?type=form_{$field_id}&contextName=" . htmlspecialchars($list_id_esc, ENT_QUOTES) . "' class='iframe_medium' style='text-decoration:none;color:black;'>"; echo "<div id='form_{$field_id}_div' class='text-area'>" . htmlspecialchars($arr[0], ENT_QUOTES) . "</div>"; echo "<div style='display:none'><textarea name='form_{$field_id}' id='form_{$field_id}' style='display:none' {$lbfonchange} {$disabled}>" . $currvalue . "</textarea></div>"; echo "</a>"; } else { if ($data_type == 35) { if (empty($currvalue)) { $currvalue = 0; } dropdown_facility($selected = $currvalue, $name = "form_{$field_id_esc}", $allow_unspecified = true, $allow_allfacilities = false, $disabled, $lbfchange); } else { if ($data_type == 36) { echo generate_select_list("form_{$field_id}", $list_id, $currvalue, $description, $showEmpty ? $empty_title : '', '', $onchange, '', null, true, $backup_list); } } } } } } } } } } } } } } } } } } } } } } } } } }
<center> <table border='0' width='100%'> <?php if (acl_check('admin', 'practice')) { // allow choose type option if have admin access ?> <tr> <td width='1%' nowrap><b><?php xl('Type', 'e'); ?> :</b></td> <td> <?php echo generate_select_list('form_abook_type', 'abook_type', $row['abook_type'], '', 'Unassigned', '', 'typeSelect(this.value)'); ?> </td> </tr> <?php } // end of if has admin access ?> <tr id="nameRow"> <td width='1%' nowrap><b><?php xl('Name', 'e'); ?> :</b></td> <td> <?php
function timeunit_select($args) { require_once $GLOBALS["srcdir"] . "/options.inc.php"; return generate_select_list($args['name'], $args['context'], $args['value']->code, $args['name'], '', '', '', $args['id'], array("data-grp-tgt" => $args['target'])); }
<div id='ajax_div_insurance_error'> </div> <div id="ajax_div_insurance" style="display:none;"></div> </div> </div> </td> <td width="50" style="padding-left:5px;"><div name="div_insurance_or_patient" id="div_insurance_or_patient" class="text" style="border:1px solid black; padding-left:5px; width:50px; height:17px;"><?php echo htmlspecialchars(formData('hidden_type_code')); ?> </div><input type="hidden" name="description" id="description" /><input type="text" name="deposit_date" id="deposit_date" style="display:none"/></td> </tr> </table> </td> <td align="left" class="text"><?php echo htmlspecialchars(xl('Sort Result by'), ENT_QUOTES) . ':'; ?> </td> <td align="left" class="text"><?php echo generate_select_list("PaymentSortBy", "payment_sort_by", "{$PaymentSortBy}", "Sort Result by", " ", "class1 text"); ?> </td> <td align="left" class="text"></td> <td align="left" class="text"><table border="0" cellspacing="0" cellpadding="0"> <tr> <td><a href="#" class="css_button" onClick="javascript:return SearchPayment();" ><span><?php echo htmlspecialchars(xl('Search'), ENT_QUOTES); ?> </span></a></td> </tr> </table></td> <td align="left"></td> </tr> <tr height="5"> <td colspan="12" align="left" ></td>
?> " type="hidden"/></td> <td align="left" class="<?php echo $StringClass; ?> " ><input name="HiddenIns<?php echo $CountIndex; ?> " id="HiddenIns<?php echo $CountIndex; ?> " value="<?php echo htmlspecialchars($Ins); ?> " type="hidden"/><?php echo generate_select_list("payment_ins{$CountIndex}", "payment_ins", "{$Ins}", "Insurance/Patient", '', '', 'ActionOnInsPat("' . $CountIndex . '")'); ?> </td> <td class="<?php echo $StringClass; ?> " ><?php echo htmlspecialchars($ServiceDate); ?> </td> <td align="right" class="<?php echo $StringClass; ?> " ><input name="HiddenEncounter<?php echo $CountIndex; ?>
function writeOptionLine($option_id, $title, $seq, $default, $value, $mapping = '', $notes = '', $codes = '', $tog1 = '', $tog2 = '', $active = '', $subtype = '') { global $opt_line_no, $list_id; ++$opt_line_no; $bgcolor = "#" . ($opt_line_no & 1 ? "ddddff" : "ffdddd"); $checked = $default ? " checked" : ""; $checked_tog1 = $tog1 ? " checked" : ""; $checked_tog2 = $tog2 ? " checked" : ""; $checked_active = $active ? " checked" : ""; echo " <tr bgcolor='{$bgcolor}'>\n"; echo " <td align='center' class='optcell'>"; echo "<input type='text' name='opt[{$opt_line_no}][id]' value='" . htmlspecialchars($option_id, ENT_QUOTES) . "' size='12' maxlength='63' class='optin' />"; echo "</td>\n"; echo " <td align='center' class='optcell'>"; echo "<input type='text' name='opt[{$opt_line_no}][title]' value='" . htmlspecialchars($title, ENT_QUOTES) . "' size='20' maxlength='63' class='optin' />"; echo "</td>\n"; // if not english and translating lists then show the translation if ($GLOBALS['translate_lists'] && $_SESSION['language_choice'] > 1) { echo " <td align='center' class='translation'>" . htmlspecialchars(xl($title), ENT_QUOTES) . "</td>\n"; } echo " <td align='center' class='optcell'>"; echo "<input type='text' name='opt[{$opt_line_no}][seq]' value='" . htmlspecialchars($seq, ENT_QUOTES) . "' size='4' maxlength='10' class='optin' />"; echo "</td>\n"; echo " <td align='center' class='optcell'>"; echo "<input type='checkbox' name='opt[{$opt_line_no}][default]' value='1' " . "onclick='defClicked({$opt_line_no})' class='optin'{$checked} />"; echo "</td>\n"; echo " <td align='center' class='optcell'>"; echo "<input type='checkbox' name='opt[{$opt_line_no}][activity]' value='1' " . " class='optin'{$checked_active} />"; echo "</td>\n"; // Tax rates, contraceptive methods and LBF names have an additional attribute. // if ($list_id == 'taxrate' || $list_id == 'contrameth' || $list_id == 'lbfnames' || $list_id == 'transactions') { echo " <td align='center' class='optcell'>"; echo "<input type='text' name='opt[{$opt_line_no}][value]' value='" . htmlspecialchars($value, ENT_QUOTES) . "' size='8' maxlength='15' class='optin' />"; echo "</td>\n"; } else { if ($list_id == 'adjreason') { echo " <td align='center' class='optcell'>"; echo "<select name='opt[{$opt_line_no}][value]' class='optin'>"; foreach (array(1 => xl('Charge adjustment'), 2 => xl('Coinsurance'), 3 => xl('Deductible'), 4 => xl('Other pt resp'), 5 => xl('Comment')) as $key => $desc) { echo "<option value='{$key}'"; if ($key == $value) { echo " selected"; } echo ">" . htmlspecialchars($desc) . "</option>"; } echo "</select>"; echo "</td>\n"; } else { if ($list_id == 'abook_type') { echo " <td align='center' class='optcell'>"; echo "<select name='opt[{$opt_line_no}][value]' class='optin'>"; foreach (array(1 => xl('Unassigned'), 2 => xl('Person'), 3 => xl('Company')) as $key => $desc) { echo "<option value='{$key}'"; if ($key == $value) { echo " selected"; } echo ">" . htmlspecialchars($desc) . "</option>"; } echo "</select>"; echo "</td>\n"; } else { if ($list_id == 'immunizations') { echo " <td align='center' class='optcell'>"; echo "<input type='text' size='10' name='opt[{$opt_line_no}][value]' " . "value='" . htmlspecialchars($value, ENT_QUOTES) . "' onclick='sel_cvxcode(this)' " . "title='" . htmlspecialchars(xl('Click to select or change CVX code'), ENT_QUOTES) . "'/>"; echo "</td>\n"; } } } } // IPPF includes the ability to map each list item to a "master" identifier. // Sports teams use this for some extra info for fitness levels. // if ($GLOBALS['ippf_specific'] || $list_id == 'fitness') { echo " <td align='center' class='optcell'>"; echo "<input type='text' name='opt[{$opt_line_no}][mapping]' value='" . htmlspecialchars($mapping, ENT_QUOTES) . "' size='12' maxlength='15' class='optin' />"; echo "</td>\n"; } else { if ($list_id == 'apptstat') { list($apptstat_color, $apptstat_timealert) = explode("|", $notes); echo " <td align='center' class='optcell'>"; echo "<input type='text' class='color' name='opt[{$opt_line_no}][apptstat_color]' value='" . htmlspecialchars($apptstat_color, ENT_QUOTES) . "' size='6' maxlength='6' class='optin' />"; echo "</td>\n"; echo " <td align='center' class='optcell'>"; echo "<input type='text' name='opt[{$opt_line_no}][apptstat_timealert]' value='" . htmlspecialchars($apptstat_timealert, ENT_QUOTES) . "' size='2' maxlength='2' class='optin' />"; echo "</td>\n"; } else { echo " <td align='center' class='optcell'>"; echo "<input type='text' name='opt[{$opt_line_no}][notes]' value='" . htmlspecialchars($notes, ENT_QUOTES) . "' size='25' maxlength='255' class='optin' />"; echo "</td>\n"; } } if ($list_id == 'apptstat') { echo " <td align='center' class='optcell'>"; echo "<input type='checkbox' name='opt[{$opt_line_no}][toggle_setting_1]' value='1' " . "onclick='defClicked({$opt_line_no})' class='optin'{$checked_tog1} />"; echo "</td>\n"; echo " <td align='center' class='optcell'>"; echo "<input type='checkbox' name='opt[{$opt_line_no}][toggle_setting_2]' value='1' " . "onclick='defClicked({$opt_line_no})' class='optin'{$checked_tog2} />"; echo "</td>\n"; } echo " <td align='center' class='optcell'>"; echo "<input type='text' name='opt[{$opt_line_no}][codes]' title='" . xla('Clinical Term Code(s)') . "' value='" . htmlspecialchars($codes, ENT_QUOTES) . "' onclick='select_clin_term_code(this)' size='25' maxlength='255' class='optin' />"; echo "</td>\n"; if (preg_match('/_issue_list$/', $list_id)) { echo " <td align='center' class='optcell'>"; echo generate_select_list("opt[{$opt_line_no}][subtype]", 'issue_subtypes', $subtype, 'Subtype', ' ', 'optin'); echo "</td>\n"; } echo " </tr>\n"; }
<td><br/><?php echo $cat; ?> </td> </tr> <tr> <td> select Building: </td> <td> <?php $q = "select buildingName from Building"; $x = "buildingName"; $query4 = "select Building.buildingName from Room,Building where roomId=" . $id . " and Room.buildingName=Building.buildId"; $result4 = execute($query4); $b = ""; while ($roww4 = mysql_fetch_row($result4)) { $b = $roww4[0]; } $st = generate_select_list($q, $x, $b); echo $st; ?> </td> </tr> <tr><td> </td><td> <input type='submit' name='submit' id='submit' value='Edit Room'/><button type='reset' value='Reset'/>Reset</td></tr> </table></form> <?php } require_once "footer.php";