コード例 #1
0
/**
 *	This function creates a task as a record in the form_taskman DB_table.
 */
function make_task($ajax_req)
{
    global $send;
    $from_id = $ajax_req['from_id'];
    $to_id = $ajax_req['to_id'];
    $patient_id = $ajax_req['pid'];
    $doc_type = $ajax_req['doc_type'];
    $doc_id = $ajax_req['doc_id'];
    $enc = $ajax_req['enc'];
    $query = "SELECT * FROM users WHERE id=?";
    $to_data = sqlQuery($query, array($to_id));
    $filename = "Fax_" . $encounter . "_" . $to_data['lname'] . ".pdf";
    $query = "SELECT * FROM documents where encounter_id=? and foreign_id=? and url like ?";
    $doc = sqlQuery($query, array($encounter, $pid, '%' . $filename . '%'));
    $sql = "SELECT * from form_taskman where FROM_ID=? and TO_ID=? and PATIENT_ID=? and ENC_ID=?";
    $task = sqlQuery($sql, array($from_id, $to_id, $patient_id, $enc));
    if (!$doc['ID'] && $task['ID'] && $task['REQ_DATE'] < time() - 60) {
        // The task was requested more than a minute ago (prevents multi-clicks from "re-generating" the PDF),
        // but the document was deleted (to redo it)...
        // Delete the task, recreate the task, and send the newly made PDF.
        $sql = "DELETE from form_taskman where FROM_ID=? and TO_ID=? and PATIENT_ID=? and ENC_ID=?";
        $task = sqlQuery($sql, array($from_id, $to_id, $patient_id, $enc));
    }
    if ($task['ID'] && $task['COMPLETED'] == '2') {
        $send['comments'] = xlt('This fax has already been sent.') . " " . xlt('If you made changes and want to re-send it, delete the original (in Communications) and try again.') . " " . xlt('Filename') . ": " . $filename;
        echo json_encode($send);
        exit;
    } else {
        if ($task['ID'] && $task['COMPLETED'] == '1') {
            if ($task['DOC_TYPE'] == 'Fax') {
                $send['DOC_link'] = "<a href='" . $webroot . "/openemr/controller.php?document&view&patient_id=" . $task['PATIENT_ID'] . "&doc_id=" . $task['DOC_ID'] . "'\n\t\t\t\t\t\t\t\ttarget='_blank' title='" . xla('View the Summary Report sent to Fax Server.') . "'>\n\t\t\t\t\t\t\t\t<i class='fa fa-file-pdf-o fa-fw'></i></a>\n\t\t\t\t\t\t\t\t<i class='fa fa-repeat fa-fw' \n\t\t\t\t\t\t\t\t\tonclick=\"top.restoreSession(); create_task('" . attr($pat_data['ref_providerID']) . "','Fax-resend','ref'); return false;\">\n\t\t\t\t\t\t\t\t\t</i>\n\t\t\t\t\t\t\t";
                //add a resend option.
                $send['comments'] = xlt('This fax has already been sent.');
                echo json_encode($send);
                exit;
            } else {
                if ($task['DOC_TYPE'] == "Fax-resend") {
                    //we need to resend this fax????
                    //You can only resend from here once.
                    $send['comments'] = xlt('To resend, delete the file from Communications and try again.');
                    echo json_encode($send);
                    update_taskman($task, 'refaxed', '2');
                    exit;
                } else {
                    //DOC_TYPE is a Fax or Report
                    $send['comments'] = xlt('Currently working on making this document') . "...\n";
                }
            }
        } else {
            if (!$task['ID']) {
                $sql = "INSERT into form_taskman \n\t\t\t\t(REQ_DATE, FROM_ID,  TO_ID,  PATIENT_ID,  DOC_TYPE,  DOC_ID,  ENC_ID) VALUES\n\t\t\t\t(NOW(), '{$from_id}', '{$to_id}','{$patient_id}','{$doc_type}','{$doc_id}','{$enc}')";
                sqlQuery($sql);
            } else {
                $send['comments'] = xlt('Currently working on making this document') . "...\n";
            }
        }
    }
}
コード例 #2
0
ファイル: add_edit_lot.php プロジェクト: katopenzz/openemr
function genWarehouseList($tag_name, $currvalue, $title, $class = '')
{
    global $drug_id;
    $drow = sqlQuery("SELECT allow_multiple FROM drugs WHERE drug_id = ?", array($drug_id));
    $allow_multiple = $drow['allow_multiple'];
    $lres = sqlStatement("SELECT * FROM list_options " . "WHERE list_id = 'warehouse' ORDER BY seq, title");
    echo "<select name='" . attr($tag_name) . "' id='" . attr($tag_name) . "'";
    if ($class) {
        echo " class='" . attr($class) . "'";
    }
    echo " title='" . attr($title) . "'>";
    $got_selected = FALSE;
    $count = 0;
    if ($allow_multiple) {
        echo "<option value=''>" . xlt('Unassigned') . "</option>";
        ++$count;
    }
    while ($lrow = sqlFetchArray($lres)) {
        $whid = $lrow['option_id'];
        if ($whid != $currvalue && !$allow_multiple && checkWarehouseUsed($whid)) {
            continue;
        }
        echo "<option value='" . attr($whid) . "'";
        if (strlen($currvalue) == 0 && $lrow['is_default'] || strlen($currvalue) > 0 && $whid == $currvalue) {
            echo " selected";
            $got_selected = TRUE;
        }
        echo ">" . text($lrow['title']) . "</option>\n";
        ++$count;
    }
    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>";
    }
    return $count;
}
コード例 #3
0
ファイル: edit_list.php プロジェクト: mi-squared/openemr
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";
}
コード例 #4
0
   </table>

   </div>

  </td>

 </tr>

</table>

</div> <!-- end main content div -->

<div id="portal-buttons-bottom"> <!-- buttons bottom div -->
    <input type="button" style="text-align: right;" value="<?php 
echo xla('Log Out');
?>
" onclick="window.location = 'logout.php'"/>

    <input type="button" style="text-align: right;" value="<?php 
echo xla('Change Password');
?>
" onclick="window.location = '<?php 
echo $landingpage . "&password_update=1";
?>
'"/>
</div><!-- end buttons bottom div -->

</div>
</body>
</html>
コード例 #5
0
ファイル: common.php プロジェクト: mi-squared/openemr
    </div>
  </td>
 </tr>

 <tr>
  <td class='text' valign='top'>
   <textarea name='reason' cols='40' rows='12' wrap='virtual' style='width:96%'
    ><?php 
echo $viewmode ? text($result['reason']) : text($GLOBALS['default_chief_complaint']);
?>
</textarea>
  </td>
  <td class='text' valign='top'>
   <select multiple name='issues[]' size='8' style='width:100%'
    title='<?php 
echo xla('Hold down [Ctrl] for multiple selections or to unselect');
?>
'>
<?php 
while ($irow = sqlFetchArray($ires)) {
    $list_id = $irow['id'];
    $tcode = $irow['type'];
    if ($ISSUE_TYPES[$tcode]) {
        $tcode = $ISSUE_TYPES[$tcode][2];
    }
    echo "    <option value='" . attr($list_id) . "'";
    if ($viewmode) {
        $perow = sqlQuery("SELECT count(*) AS count FROM issue_encounter WHERE " . "pid = ? AND encounter = ? AND list_id = ?", array($pid, $encounter, $list_id));
        if ($perow['count']) {
            echo " selected";
        }
コード例 #6
0
	<table class='text'>
		<tr>
			<td class='label'>
			   <?php 
echo xlt('Patient ID');
?>
:
			</td>
			<td>
			   <input type='text' name='form_patient_id' size='10' maxlength='31' value='<?php 
echo attr($form_patient_id);
?>
'
				title='<?php 
echo xla('Patient ID');
?>
' />
			</td>
		</tr>
	</table>

	</div>

  </td>
  <td align='left' valign='middle' height="100%">
	<table style='border-left:1px solid; width:100%; height:100%' >
		<tr>
			<td>
				<div style='margin-left:15px'>
					<a href='#' class='css_button' onclick='$("#form_refresh").attr("value","true"); $("#theform").submit();'>
コード例 #7
0
                        <td class='label'>
                           <?php 
    echo xlt('To');
    ?>
:
                        </td>
                        <td>
                           <input type='text' name='form_to_date' id="form_to_date" size='10' value='<?php 
    echo attr($form_to_date);
    ?>
'
                                onkeyup='datekeyup(this,mypcc)' onblur='dateblur(this,mypcc)' title='yyyy-mm-dd'>
                           <img src='../pic/show_calendar.gif' align='absbottom' width='24' height='22'
                                id='img_to_date' border='0' alt='[?]' style='cursor:pointer'
                                title='<?php 
    echo xla("Click here to choose a date");
    ?>
'>
                        </td>
                        <td>
                           <input type='checkbox' name='form_details'<?php 
    if ($_POST['form_details']) {
        echo ' checked';
    }
    ?>
>
                           <?php 
    echo xlt('Important Codes');
    ?>
                        </td>
		</tr>
コード例 #8
0
ファイル: edit_layout.php プロジェクト: juggernautsei/openemr
function writeFieldLine($linedata)
{
    global $fld_line_no, $sources, $lbfonly, $extra_html, $validations;
    ++$fld_line_no;
    $checked = $linedata['default_value'] ? " checked" : "";
    //echo " <tr bgcolor='$bgcolor'>\n";
    echo " <tr id='fld[{$fld_line_no}]' class='" . ($fld_line_no % 2 ? 'even' : 'odd') . "'>\n";
    echo "  <td class='optcell' style='width:4%' nowrap>";
    // tuck the group_name INPUT in here
    echo "<input type='hidden' name='fld[{$fld_line_no}][group]' value='" . htmlspecialchars($linedata['group_name'], ENT_QUOTES) . "' class='optin' />";
    echo "<input type='checkbox' class='selectfield' " . "name='" . $linedata['group_name'] . "~" . $linedata['field_id'] . "' " . "id='" . $linedata['group_name'] . "~" . $linedata['field_id'] . "' " . "title='" . htmlspecialchars(xl('Select field', ENT_QUOTES)) . "'>";
    echo "<input type='text' name='fld[{$fld_line_no}][seq]' id='fld[{$fld_line_no}][seq]' value='" . htmlspecialchars($linedata['seq'], ENT_QUOTES) . "' size='2' maxlength='3' " . "class='optin' style='width:36pt' />";
    echo "</td>\n";
    echo "  <td align='center' class='optcell' {$lbfonly} style='width:3%'>";
    echo "<select name='fld[{$fld_line_no}][source]' class='optin noselect' {$lbfonly}>";
    foreach ($sources as $key => $value) {
        echo "<option value='" . attr($key) . "'";
        if ($key == $linedata['source']) {
            echo " selected";
        }
        echo ">" . text($value) . "</option>\n";
    }
    echo "</select>";
    echo "</td>\n";
    echo "  <td align='left' class='optcell' style='width:10%'>";
    echo "<input type='text' name='fld[{$fld_line_no}][id]' value='" . htmlspecialchars($linedata['field_id'], ENT_QUOTES) . "' size='15' maxlength='63'\n         class='optin noselect' style='width:100%' />";
    // class='optin noselect' onclick='FieldIDClicked(this)' />";
    /*
    echo "<input type='hidden' name='fld[$fld_line_no][id]' value='" .
         htmlspecialchars($linedata['field_id'], ENT_QUOTES) . "' />";
    echo htmlspecialchars($linedata['field_id'], ENT_QUOTES);
    */
    echo "</td>\n";
    echo "  <td align='center' class='optcell' style='width:12%'>";
    echo "<input type='text' id='fld[{$fld_line_no}][title]' name='fld[{$fld_line_no}][title]' value='" . htmlspecialchars($linedata['title'], ENT_QUOTES) . "' size='15' maxlength='63' class='optin' style='width:100%' />";
    echo "</td>\n";
    // if not english and set to translate layout labels, then show the translation
    if ($GLOBALS['translate_layout'] && $_SESSION['language_choice'] > 1) {
        echo "<td align='center' class='translation' style='width:10%'>" . htmlspecialchars(xl($linedata['title']), ENT_QUOTES) . "</td>\n";
    }
    echo "  <td align='center' class='optcell' style='width:4%'>";
    echo "<select name='fld[{$fld_line_no}][uor]' class='optin'>";
    foreach (array(0 => xl('Unused'), 1 => xl('Optional'), 2 => xl('Required')) as $key => $value) {
        echo "<option value='{$key}'";
        if ($key == $linedata['uor']) {
            echo " selected";
        }
        echo ">{$value}</option>\n";
    }
    echo "</select>";
    echo "</td>\n";
    echo "  <td align='center' class='optcell' style='width:8%'>";
    echo "<select name='fld[{$fld_line_no}][data_type]' id='fld[{$fld_line_no}][data_type]' onchange=NationNotesContext('" . $fld_line_no . "',this.value)>";
    echo "<option value=''></option>";
    global $datatypes;
    foreach ($datatypes as $key => $value) {
        if ($linedata['data_type'] == $key) {
            echo "<option value='{$key}' selected>{$value}</option>";
        } else {
            echo "<option value='{$key}'>{$value}</option>";
        }
    }
    echo "</select>";
    echo "  </td>";
    echo "  <td align='center' class='optcell' style='width:4%'>";
    if ($linedata['data_type'] == 2 || $linedata['data_type'] == 3 || $linedata['data_type'] == 21 || $linedata['data_type'] == 22 || $linedata['data_type'] == 23 || $linedata['data_type'] == 25 || $linedata['data_type'] == 27 || $linedata['data_type'] == 28 || $linedata['data_type'] == 32 || $linedata['data_type'] == 15 || $linedata['data_type'] == 40) {
        // Show the width field
        echo "<input type='text' name='fld[{$fld_line_no}][lengthWidth]' value='" . htmlspecialchars($linedata['fld_length'], ENT_QUOTES) . "' size='2' maxlength='10' class='optin' title='" . xla('Width') . "' />";
        if ($linedata['data_type'] == 3 || $linedata['data_type'] == 40) {
            // Show the height field
            echo "<input type='text' name='fld[{$fld_line_no}][lengthHeight]' value='" . htmlspecialchars($linedata['fld_rows'], ENT_QUOTES) . "' size='2' maxlength='10' class='optin' title='" . xla('Height') . "' />";
        } else {
            // Hide the height field
            echo "<input type='hidden' name='fld[{$fld_line_no}][lengthHeight]' value=''>";
        }
    } else {
        // all other data_types (hide both the width and height fields
        echo "<input type='hidden' name='fld[{$fld_line_no}][lengthWidth]' value=''>";
        echo "<input type='hidden' name='fld[{$fld_line_no}][lengthHeight]' value=''>";
    }
    echo "</td>\n";
    echo "  <td align='center' class='optcell' style='width:4%'>";
    echo "<input type='text' name='fld[{$fld_line_no}][maxSize]' value='" . htmlspecialchars($linedata['max_length'], ENT_QUOTES) . "' size='1' maxlength='10' class='optin' style='width:100%' " . "title='" . xla('Maximum Size (entering 0 will allow any size)') . "' />";
    echo "</td>\n";
    echo "  <td align='center' class='optcell' style='width:8%'>";
    if ($linedata['data_type'] == 1 || $linedata['data_type'] == 21 || $linedata['data_type'] == 22 || $linedata['data_type'] == 23 || $linedata['data_type'] == 25 || $linedata['data_type'] == 26 || $linedata['data_type'] == 27 || $linedata['data_type'] == 32 || $linedata['data_type'] == 33 || $linedata['data_type'] == 34 || $linedata['data_type'] == 36) {
        $type = "";
        $disp = "style='display:none'";
        if ($linedata['data_type'] == 34) {
            $type = "style='display:none'";
            $disp = "";
        }
        echo "<input type='text' name='fld[{$fld_line_no}][list_id]'  id='fld[{$fld_line_no}][list_id]' value='" . htmlspecialchars($linedata['list_id'], ENT_QUOTES) . "'" . $type . " size='6' maxlength='30' class='optin listid' style='width:100%;cursor:pointer'" . "title='" . xl('Choose list') . "' />";
        echo "<select name='fld[{$fld_line_no}][contextName]' id='fld[{$fld_line_no}][contextName]' " . $disp . ">";
        $res = sqlStatement("SELECT * FROM customlists WHERE cl_list_type=2 AND cl_deleted=0");
        while ($row = sqlFetchArray($res)) {
            $sel = '';
            if ($linedata['list_id'] == $row['cl_list_item_long']) {
                $sel = 'selected';
            }
            echo "<option value='" . htmlspecialchars($row['cl_list_item_long'], ENT_QUOTES) . "' " . $sel . ">" . htmlspecialchars($row['cl_list_item_long'], ENT_QUOTES) . "</option>";
        }
        echo "</select>";
    } else {
        // all other data_types
        echo "<input type='hidden' name='fld[{$fld_line_no}][list_id]' value=''>";
    }
    echo "</td>\n";
    //Backup List Begin
    echo "  <td align='center' class='optcell' style='width:4%'>";
    if ($linedata['data_type'] == 1 || $linedata['data_type'] == 26 || $linedata['data_type'] == 33 || $linedata['data_type'] == 36) {
        echo "<input type='text' name='fld[{$fld_line_no}][list_backup_id]' value='" . htmlspecialchars($linedata['list_backup_id'], ENT_QUOTES) . "' size='3' maxlength='10' class='optin listid' style='cursor:pointer; width:100%' />";
    } else {
        echo "<input type='hidden' name='fld[{$fld_line_no}][list_backup_id]' value=''>";
    }
    echo "</td>\n";
    //Backup List End
    echo "  <td align='center' class='optcell' style='width:4%'>";
    echo "<input type='text' name='fld[{$fld_line_no}][titlecols]' value='" . htmlspecialchars($linedata['titlecols'], ENT_QUOTES) . "' size='3' maxlength='10' class='optin' style='width:100%' />";
    echo "</td>\n";
    echo "  <td align='center' class='optcell' style='width:4%'>";
    echo "<input type='text' name='fld[{$fld_line_no}][datacols]' value='" . htmlspecialchars($linedata['datacols'], ENT_QUOTES) . "' size='3' maxlength='10' class='optin' style='width:100%' />";
    echo "</td>\n";
    echo "  <td align='center' class='optcell' style='width:5%' title='" . "A = " . xla('Age') . ", B = " . xla('Gestational Age') . ", C = " . xla('Capitalize') . ", D = " . xla('Dup Check') . ", G = " . xla('Graphable') . ", L = " . xla('Lab Order') . ", N = " . xla('New Patient Form') . ", O = " . xla('Order Processor') . ", P = " . xla('Default to previous value') . ", R = " . xla('Distributor') . ", T = " . xla('Description is default text') . ", U = " . xla('Capitalize all') . ", V = " . xla('Vendor') . ", 0 = " . xla('Read Only') . ", 1 = " . xla('Write Once') . ", 2 = " . xla('Billing Code Descriptions') . "'>";
    echo "<input type='text' name='fld[{$fld_line_no}][edit_options]' value='" . htmlspecialchars($linedata['edit_options'], ENT_QUOTES) . "' size='3' " . "maxlength='36' class='optin' style='width:100%' />";
    echo "</td>\n";
    /*****************************************************************
        echo "  <td align='center' class='optcell'>";
        if ($linedata['data_type'] == 2) {
          echo "<input type='text' name='fld[$fld_line_no][default]' value='" .
               htmlspecialchars($linedata['default_value'], ENT_QUOTES) . "' size='10' maxlength='63' class='optin' />";
        } else {
          echo "&nbsp;";
        }
        echo "</td>\n";
      
        echo "  <td align='center' class='optcell'>";
        echo "<input type='text' name='fld[$fld_line_no][desc]' value='" .
             htmlspecialchars($linedata['description'], ENT_QUOTES) . "' size='20' maxlength='63' class='optin' />";
        echo "</td>\n";
    
        // if not english and showing layout labels, then show the translation of Description
        if ($GLOBALS['translate_layout'] && $_SESSION['language_choice'] > 1) {
         echo "<td align='center' class='translation'>" . htmlspecialchars(xl($linedata['description']), ENT_QUOTES) . "</td>\n";
        }
        *****************************************************************/
    if ($linedata['data_type'] == 31) {
        echo "  <td align='center' class='optcell' style='width:24%'>";
        echo "<textarea name='fld[{$fld_line_no}][desc]' rows='3' cols='35' class='optin' style='width:100%'>" . $linedata['description'] . "</textarea>";
        echo "<input type='hidden' name='fld[{$fld_line_no}][default]' value='" . htmlspecialchars($linedata['default_value'], ENT_QUOTES) . "' />";
        echo "</td>\n";
    } else {
        echo "  <td align='center' class='optcell' style='width:24%'>";
        echo "<input type='text' name='fld[{$fld_line_no}][desc]' value='" . htmlspecialchars($linedata['description'], ENT_QUOTES) . "' size='30' class='optin' style='width:100%' />";
        echo "<input type='hidden' name='fld[{$fld_line_no}][default]' value='" . htmlspecialchars($linedata['default_value'], ENT_QUOTES) . "' />";
        echo "</td>\n";
        // if not english and showing layout labels, then show the translation of Description
        if ($GLOBALS['translate_layout'] && $_SESSION['language_choice'] > 1) {
            echo "<td align='center' class='translation' style='width:10%'>" . htmlspecialchars(xl($linedata['description']), ENT_QUOTES) . "</td>\n";
        }
    }
    // The "?" to click on for yet more field attributes.
    echo "  <td class='bold' id='querytd_{$fld_line_no}' style='cursor:pointer;";
    if (!empty($linedata['conditions']) || !empty($linedata['validation'])) {
        echo "background-color:#77ff77;";
    }
    echo "' onclick='extShow({$fld_line_no}, this)' align='center' ";
    echo "title='" . xla('Click here to view/edit more details') . "'>";
    echo "&nbsp;?&nbsp;";
    echo "</td>\n";
    echo " </tr>\n";
    // Create a floating div for the additional attributes of this field.
    $conditions = empty($linedata['conditions']) ? array(0 => array('id' => '', 'itemid' => '', 'operator' => '', 'value' => '')) : unserialize($linedata['conditions']);
    //
    $extra_html .= "<div id='ext_{$fld_line_no}' " . "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>\n" . "  <th colspan='3' align='left' class='bold'>\"" . text($linedata['field_id']) . "\" " . xlt('will be hidden if') . ":</th>\n" . "  <th colspan='2' align='right' class='text'><input type='button' " . "value='" . xla('Close') . "' onclick='extShow({$fld_line_no}, false)' />&nbsp;</th>\n" . " </tr>\n" . " <tr>\n" . "  <th align='left' class='bold'>" . xlt('Field ID') . "</th>\n" . "  <th align='left' class='bold'>" . xlt('List item ID') . "</th>\n" . "  <th align='left' class='bold'>" . xlt('Operator') . "</th>\n" . "  <th align='left' class='bold'>" . xlt('Value if comparing') . "</th>\n" . "  <th align='left' class='bold'>&nbsp;</th>\n" . " </tr>\n";
    // There may be multiple condition lines for each field.
    foreach ($conditions as $i => $condition) {
        $extra_html .= " <tr>\n" . "  <td align='left'>\n" . "   <select name='fld[{$fld_line_no}][condition_id][{$i}]' onchange='cidChanged({$fld_line_no}, {$i})'>" . genFieldOptionList($condition['id']) . " </select>\n" . "  </td>\n" . "  <td align='left'>\n" . "   <select name='fld[{$fld_line_no}][condition_itemid][{$i}]'><option value='" . attr($condition['itemid']) . "'>...</option></select>\n" . "  </td>\n" . "  <td align='left'>\n" . "   <select name='fld[{$fld_line_no}][condition_operator][{$i}]'>\n";
        foreach (array('eq' => xl('Equals'), 'ne' => xl('Does not equal'), 'se' => xl('Is selected'), 'ns' => xl('Is not selected')) as $key => $value) {
            $extra_html .= "    <option value='{$key}'";
            if ($key == $condition['operator']) {
                $extra_html .= " selected";
            }
            $extra_html .= ">" . text($value) . "</option>\n";
        }
        $extra_html .= "   </select>\n" . "  </td>\n" . "  <td align='left' title='" . xla('Only for comparisons') . "'>\n" . "   <input type='text' name='fld[{$fld_line_no}][condition_value][{$i}]' value='" . attr($condition['value']) . "' size='15' maxlength='63' />\n" . "  </td>\n";
        if (count($conditions) == $i + 1) {
            $extra_html .= "  <td align='right' title='" . xla('Add a condition') . "'>\n" . "   <input type='button' value='+' onclick='extAddCondition({$fld_line_no},this)' />\n" . "  </td>\n";
        } else {
            $extra_html .= "  <td align='right'>\n" . "   <select name='fld[{$fld_line_no}][condition_andor][{$i}]'>\n";
            foreach (array('and' => xl('And'), 'or' => xl('Or')) as $key => $value) {
                $extra_html .= "    <option value='{$key}'";
                if ($key == $condition['andor']) {
                    $extra_html .= " selected";
                }
                $extra_html .= ">" . text($value) . "</option>\n";
            }
            $extra_html .= "   </select>\n" . "  </td>\n";
        }
        $extra_html .= " </tr>\n";
    }
    $extra_html .= "</table>\n";
    $extra_html .= "<table width='100%'>\n" . " <tr>\n" . "  <td colspan='3' align='left' class='bold'>\"" . text($linedata['field_id']) . "\" " . xlt('will have the following validation rules') . ":</td>\n" . " </tr>\n" . " <tr>\n" . "  <td align='left' class='bold'>" . xlt('Validation rule  ') . "</td>\n" . " </tr>\n" . " <tr>\n" . "  <td align='left' title='" . xla('Select a validation rule') . "'>\n" . "   <select name='fld[{$fld_line_no}][validation]' onchange='valChanged({$fld_line_no})'>\n" . "   <option value=''";
    if (empty($linedata['validation'])) {
        $extra_html .= " selected";
    }
    $extra_html .= ">-- " . xlt('Please Select') . " --</option>";
    foreach ($validations as $key => $value) {
        $extra_html .= "    <option value='{$key}'";
        if ($key == $linedata['validation']) {
            $extra_html .= " selected";
        }
        $extra_html .= ">" . text($value) . "</option>\n";
    }
    $extra_html .= "</select>\n" . "  </td>\n";
    $extra_html .= "</table>\n" . "</div>\n";
}
コード例 #9
0
ファイル: edih_view.php プロジェクト: bradymiller/openemr
		e.stopPropagation();
		//
		jQuery.ajax({
            type: 'get',
            url: jQuery('#formlog').attr('action'), 
            data: { archivelog: 'yes' },
            dataType: "json",
            success: function(data) {
				var str = "<p><?php 
echo xla('Archive Log Files');
?>
</p><ul id='logarchlist'>";
				var fct = data.length;
				if (fct == 0) {
					str = str + "<li><?php 
echo xla('No logs older than 7 days');
?>
</li>";
				} else {
					for(var i = 0; i < fct; i++) {
						str = str + "<li>" + data[i] + "</li>";
					}
				};
				str = str + "</ul>";
				jQuery('#notesrsp').hide();
		        jQuery('#logrsp').html('');
		        jQuery('#logrsp').html(str);
		        jQuery('#logrsp').show();				
			},
		    error: function( xhr, status ) { alert( "<?php 
echo xls('Sorry, there was a problem!');
コード例 #10
0
ファイル: encounters.php プロジェクト: jatin-52/erm
function getDocListByEncID($encounter, $raw_encounter_date, $pid)
{
    global $ISSUE_TYPES, $auth_med;
    $documents = getDocumentsByEncounter($pid, $encounter);
    if (count($documents) > 0) {
        foreach ($documents as $documentrow) {
            if ($auth_med) {
                $irow = sqlQuery("SELECT type, title, begdate FROM lists WHERE id = ? LIMIT 1", array($documentrow['list_id']));
                if ($irow) {
                    $tcode = $irow['type'];
                    if ($ISSUE_TYPES[$tcode]) {
                        $tcode = $ISSUE_TYPES[$tcode][2];
                    }
                    echo text("{$tcode}: " . $irow['title']);
                }
            } else {
                echo "(" . xlt('No access') . ")";
            }
            // Get the notes for this document and display as title for the link.
            $queryString = "SELECT date,note FROM notes WHERE foreign_id = ? ORDER BY date";
            $noteResultSet = sqlStatement($queryString, array($documentrow['id']));
            $note = '';
            while ($row = sqlFetchArray($noteResultSet)) {
                $note .= oeFormatShortDate(date('Y-m-d', strtotime($row['date']))) . " : " . attr($row['note']) . "\n";
            }
            $docTitle = $note ? $note : xla("View document");
            $docHref = $GLOBALS['webroot'] . "/controller.php?document&view&patient_id=" . attr($pid) . "&doc_id=" . attr($documentrow['id']);
            echo "<div class='text docrow' id='" . attr($documentrow['id']) . "' title='" . $docTitle . "'>\n";
            echo "<a href='{$docHref}' onclick='top.restoreSession()' >" . xlt('Document') . ": " . text(basename($documentrow['url'])) . ' (' . text(xl_document_category($documentrow['name'])) . ')' . "</a>";
            echo "</div>";
        }
    }
}
コード例 #11
0
ファイル: custom_report.php プロジェクト: ekuiperemr/openemr
    }
    else{
      document.getElementById('alert_msg').innerHTML='';
      if(action == 'next'){
       next(w_count);
      }
      else if (action == 'prev'){
       prev(w_count);
      }
      var tot_res = res_array.length/w_count;
	  if(tot_res > 0){
		document.getElementById('alert_msg').innerHTML='<?php 
    echo xla('Showing result');
    ?>
 '+cur_res+' <?php 
    echo xla('of');
    ?>
 '+tot_res;
	  }
    }
    
  }
</script>
</head>
<body class="body_top" style="padding-top:95px;">
<?php 
}
?>
<div id="report_custom" style="width:100%;">  <!-- large outer DIV -->

<?php 
コード例 #12
0
ファイル: stats_full.php プロジェクト: katopenzz/openemr
        echo generate_display_field(array('data_type' => '1', 'list_id' => 'occurrence'), $row['occurrence']);
        echo "</td>\n";
        if ($focustype == "allergy") {
            echo "  <td>";
            echo generate_display_field(array('data_type' => '1', 'list_id' => 'reaction'), $row['reaction']);
            echo "</td>\n";
        }
        if ($GLOBALS['athletic_team']) {
            echo "  <td class='center'>" . $row['extrainfo'] . "</td>\n";
            // games missed
        } else {
            echo "  <td>" . text($row['referredby']) . "</td>\n";
        }
        echo "  <td>" . text($row['modifydate']) . "</td>\n";
        echo "  <td>" . text($row['comments']) . "</td>\n";
        echo "  <td id='e_{$rowid}' class='noclick center' title='" . xla('View related encounters') . "'>";
        echo "  <input type='button' value='" . attr($ierow['count']) . "' class='editenc' id='" . attr($rowid) . "' />";
        echo "  </td>";
        echo " </tr>\n";
    }
}
echo "</table>";
?>

</table>

</form>
</div> <!-- end patient_stats -->

</body>
コード例 #13
0
        if ($result['errmsg']) {
            die(text($result['errmsg']));
        }
        echo "<p>" . xlt('Report has been sent to the patient.') . "</p>\n";
        echo "</body></html>\n";
    }
} else {
    ?>
</body>
<?php 
    if (!$printable) {
        // Set up translated strings for use by interactive search
        ?>
<script type="text/javascript">
var xl_string = <?php 
        echo json_encode(array('spcl_chars' => xla('Special characters are not allowed') . '.', 'not_found' => xla('No results found') . '.', 'results' => xla('Showing result'), 'literal_of' => xla('of')));
        ?>
;
</script>
<script type="text/javascript" src="<?php 
        echo $GLOBALS['web_root'];
        ?>
/interface/patient_file/report/custom_report.js?v=<?php 
        echo $v_js_includes;
        ?>
"></script>
<?php 
    }
    ?>
</html>
<?php 
コード例 #14
0
ファイル: options.inc.php プロジェクト: hitechelp/openemr
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=''>&nbsp;</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) . "&nbsp;</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>&nbsp;</td><td class='bold'>" . htmlspecialchars(xl('N/A'), ENT_NOQUOTES) . "&nbsp;</td><td class='bold'>" . htmlspecialchars(xl('Nor'), ENT_NOQUOTES) . "&nbsp;</td>" . "<td class='bold'>" . htmlspecialchars(xl('Abn'), ENT_NOQUOTES) . "&nbsp;</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) . "&nbsp;</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) . "&nbsp;</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} />&nbsp;</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} />&nbsp;</td>";
                                                                                            echo "<td class='bold'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" . "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" . htmlspecialchars(xl('Status'), ENT_NOQUOTES) . ":&nbsp;&nbsp;</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} />&nbsp;</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'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" . xlt('Status') . ":&nbsp;&nbsp;</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') . "&nbsp;</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') . "&nbsp;</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 "&nbsp;</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') . "&nbsp;</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') . "&nbsp;</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);
                                                                                                    }
                                                                                                }
                                                                                            }
                                                                                        }
                                                                                    }
                                                                                }
                                                                            }
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
コード例 #15
0
ファイル: immunizations.php プロジェクト: katopenzz/openemr
echo htmlspecialchars(xl('Completion Status'), ENT_NOQUOTES);
?>
</th>
    <th><?php 
echo htmlspecialchars(xl('Error'), ENT_NOQUOTES);
?>
</th>
	<th>&nbsp;</th>
    </tr>
    
<?php 
$result = getImmunizationList($pid, $_GET['sortby'], true);
while ($row = sqlFetchArray($result)) {
    $isError = $row['added_erroneously'];
    if ($isError) {
        $tr_title = 'title="' . xla("Entered in Error") . '"';
    } else {
        $tr_title = "";
    }
    if ($row["id"] == $id) {
        echo "<tr " . $tr_title . " class='immrow text selected' id='" . htmlspecialchars($row["id"], ENT_QUOTES) . "'>";
    } else {
        echo "<tr " . $tr_title . " class='immrow text' id='" . htmlspecialchars($row["id"], ENT_QUOTES) . "'>";
    }
    // Figure out which name to use (ie. from cvx list or from the custom list)
    if ($GLOBALS['use_custom_immun_list']) {
        $vaccine_display = generate_display_field(array('data_type' => '1', 'list_id' => 'immunizations'), $row['immunization_id']);
    } else {
        if (!empty($row['code_text_short'])) {
            $vaccine_display = htmlspecialchars(xl($row['code_text_short']), ENT_NOQUOTES);
        } else {
コード例 #16
0
ファイル: billing_report.php プロジェクト: mi-squared/openemr
'
 title='<?php 
    echo xla('HCFA left margin in points');
    ?>
' />
&nbsp;<?php 
    echo xlt('Top');
    ?>
:
<input type='text' size='2' name='top_margin'
 value='<?php 
    echo attr($top_margin);
    ?>
'
 title='<?php 
    echo xla('HCFA top margin in points');
    ?>
' />
</span>
<?php 
}
?>

</center>
<input type='hidden' name='HiddenMarkAsCleared'  id='HiddenMarkAsCleared' value="" />
<input type='hidden' name='mode' value="bill" />
<input type='hidden' name='authorized' value="<?php 
echo attr($my_authorized);
?>
" />
<input type='hidden' name='unbilled' value="<?php 
コード例 #17
0
"><?php 
    echo xlt('Comments');
    ?>
</th>
 <?php 
    if ($check_sum) {
        ?>
  <th id="sortby_newchecksum" class="text" title="<?php 
        xla('Sort by New Checksum');
        ?>
"><?php 
        xlt('Tampered Checksum');
        ?>
</th>
  <th id="sortby_oldchecksum" class="text" title="<?php 
        xla('Sort by Old Checksum');
        ?>
"><?php 
        xlt('Original Checksum');
        ?>
</th>
  <?php 
    }
    ?>
 </tr>
<?php 
    $eventname = $_GET['eventname'];
    $type_event = $_GET['type_event'];
    ?>
<input type=hidden name=event value=<?php 
    echo attr($eventname) . "-" . attr($type_event);
コード例 #18
0
echo xlt('for');
?>
   <input type='text' name='searchdays' size='3' value='<?php 
echo attr($searchdays);
?>
'
    title='<?php 
echo xla('Number of days to search from the start date');
?>
' />
   <?php 
echo xlt('days');
?>
&nbsp;
   <input type='submit' value='<?php 
echo xla('Search');
?>
'>
</div>

<?php 
if (!empty($slots)) {
    ?>

<div id="searchResultsHeader">
<table>
 <tr>
  <th class="srDate"><?php 
    echo xlt('Day');
    ?>
</th>
コード例 #19
0
ファイル: new.php プロジェクト: bbgunmaster/openemr
function echoLine($lino, $codetype, $code, $modifier, $ndc_info = '', $auth = TRUE, $del = FALSE, $units = NULL, $fee = NULL, $id = NULL, $billed = FALSE, $code_text = NULL, $justify = NULL, $provider_id = 0, $notecodes = '')
{
    global $code_types, $ndc_applies, $ndc_uom_choices, $justinit, $pid;
    global $contraception, $usbillstyle, $hasCharges;
    // If using line item billing and user wishes to default to a selected provider, then do so.
    if ($GLOBALS['default_fee_sheet_line_item_provider'] == 1 && $GLOBALS['support_fee_sheet_line_item_provider'] == 1) {
        if ($provider_id == 0) {
            $provider_id = 0 + findProvider();
        }
    }
    if ($codetype == 'COPAY') {
        if (!$code_text) {
            $code_text = 'Cash';
        }
        if ($fee > 0) {
            $fee = 0 - $fee;
        }
    }
    if (!$code_text) {
        $sqlArray = array();
        $query = "select id, units, code_text from codes where code_type = ? " . " and " . "code = ? and ";
        array_push($sqlArray, $code_types[$codetype]['id'], $code);
        if ($modifier) {
            $query .= "modifier = ?";
            array_push($sqlArray, $modifier);
        } else {
            $query .= "(modifier is null or modifier = '')";
        }
        $result = sqlQuery($query, $sqlArray);
        $code_text = $result['code_text'];
        if (empty($units)) {
            $units = max(1, intval($result['units']));
        }
        if (!isset($fee)) {
            // Fees come from the prices table now.
            $query = "SELECT prices.pr_price " . "FROM patient_data, prices WHERE " . "patient_data.pid = ? AND " . "prices.pr_id = ? AND " . "prices.pr_selector = '' AND " . "prices.pr_level = patient_data.pricelevel " . "LIMIT 1";
            echo "\n<!-- {$query} -->\n";
            // debugging
            $prrow = sqlQuery($query, array($pid, $result['id']));
            $fee = empty($prrow) ? 0 : $prrow['pr_price'];
        }
    }
    $fee = sprintf('%01.2f', $fee);
    if (empty($units)) {
        $units = 1;
    }
    $units = max(1, intval($units));
    // We put unit price on the screen, not the total line item fee.
    $price = $fee / $units;
    $strike1 = $id && $del ? "<strike>" : "";
    $strike2 = $id && $del ? "</strike>" : "";
    echo " <tr>\n";
    echo "  <td class='billcell'>{$strike1}" . ($codetype == 'COPAY' ? xl($codetype) : $codetype) . $strike2;
    //if the line to ouput is copay, show the date here passed as $ndc_info,
    //since this variable is not applicable in the case of copay.
    if ($codetype == 'COPAY') {
        echo "(" . htmlspecialchars($ndc_info) . ")";
        $ndc_info = '';
    }
    if ($id) {
        echo "<input type='hidden' name='bill[" . attr($lino) . "][id]' value='{$id}'>";
    }
    echo "<input type='hidden' name='bill[" . attr($lino) . "][code_type]' value='" . attr($codetype) . "'>";
    echo "<input type='hidden' name='bill[" . attr($lino) . "][code]' value='" . attr($code) . "'>";
    echo "<input type='hidden' name='bill[" . attr($lino) . "][billed]' value='" . attr($billed) . "'>";
    echo "</td>\n";
    if ($codetype != 'COPAY') {
        echo "  <td class='billcell'>{$strike1}" . text($code) . "{$strike2}</td>\n";
    } else {
        echo "  <td class='billcell'>&nbsp;</td>\n";
    }
    if ($billed) {
        if (modifiers_are_used(true)) {
            echo "  <td class='billcell'>{$strike1}" . text($modifier) . "{$strike2}" . "<input type='hidden' name='bill[" . attr($lino) . "][mod]' value='" . attr($modifier) . "'></td>\n";
        }
        if (fees_are_used()) {
            echo "  <td class='billcell' align='right'>" . text(oeFormatMoney($price)) . "</td>\n";
            if ($codetype != 'COPAY') {
                echo "  <td class='billcell' align='center'>" . text($units) . "</td>\n";
            } else {
                echo "  <td class='billcell'>&nbsp;</td>\n";
            }
        }
        if (justifiers_are_used()) {
            echo "  <td class='billcell' align='center'{$usbillstyle}>" . text($justify) . "</td>\n";
        }
        // Show provider for this line (if using line item billing).
        if ($GLOBALS['support_fee_sheet_line_item_provider'] == 1) {
            echo "  <td class='billcell' align='center'>";
        } else {
            echo "  <td class='billcell' align='center' style='display: none'>";
        }
        genProviderSelect('', '-- ' . xl("Default") . ' --', $provider_id, true);
        echo "</td>\n";
        if ($code_types[$codetype]['claim'] && !$code_types[$codetype]['diag']) {
            echo "  <td class='billcell' align='center'{$usbillstyle}>" . htmlspecialchars($notecodes, ENT_NOQUOTES) . "</td>\n";
        } else {
            echo "  <td class='billcell' align='center'{$usbillstyle}></td>\n";
        }
        echo "  <td class='billcell' align='center'{$usbillstyle}><input type='checkbox'" . ($auth ? " checked" : "") . " disabled /></td>\n";
        echo "  <td class='billcell' align='center'><input type='checkbox'" . " disabled /></td>\n";
    } else {
        // not billed
        if (modifiers_are_used(true)) {
            if ($codetype != 'COPAY' && ($code_types[$codetype]['mod'] || $modifier)) {
                echo "  <td class='billcell'><input type='text' name='bill[" . attr($lino) . "][mod]' " . "value='" . attr($modifier) . "' " . "title='" . xla("Multiple modifiers can be separated by colons or spaces, maximum of 4 (M1:M2:M3:M4)") . "' " . "value='" . attr($modifier) . "' size='" . attr($code_types[$codetype]['mod']) . "'></td>\n";
            } else {
                echo "  <td class='billcell'>&nbsp;</td>\n";
            }
        }
        if (fees_are_used()) {
            if ($codetype == 'COPAY' || $code_types[$codetype]['fee'] || $fee != 0) {
                echo "  <td class='billcell' align='right'>" . "<input type='text' name='bill[" . attr($lino) . "][price]' " . "value='" . attr($price) . "' size='6'";
                if (acl_check('acct', 'disc')) {
                    echo " style='text-align:right'";
                } else {
                    echo " style='text-align:right;background-color:transparent' readonly";
                }
                echo "></td>\n";
                echo "  <td class='billcell' align='center'>";
                if ($codetype != 'COPAY') {
                    echo "<input type='text' name='bill[" . attr($lino) . "][units]' " . "value='" . attr($units) . "' size='2' style='text-align:right'>";
                } else {
                    echo "<input type='hidden' name='bill[" . attr($lino) . "][units]' value='" . attr($units) . "'>";
                }
                echo "</td>\n";
            } else {
                echo "  <td class='billcell'>&nbsp;</td>\n";
                echo "  <td class='billcell'>&nbsp;</td>\n";
            }
        }
        if (justifiers_are_used()) {
            if ($code_types[$codetype]['just'] || $justify) {
                echo "  <td class='billcell' align='center'{$usbillstyle} ";
                echo "title='" . xla("Select one or more diagnosis codes to justify the service") . "' >";
                echo "<select name='bill[" . attr($lino) . "][justify]' onchange='setJustify(this)'>";
                echo "<option value='" . attr($justify) . "'>" . text($justify) . "</option></select>";
                echo "</td>\n";
                $justinit .= "setJustify(f['bill[" . attr($lino) . "][justify]']);\n";
            } else {
                echo "  <td class='billcell'{$usbillstyle}>&nbsp;</td>\n";
            }
        }
        // Show provider for this line (if using line item billing)
        if ($GLOBALS['support_fee_sheet_line_item_provider'] == 1) {
            echo "  <td class='billcell' align='center'>";
        } else {
            echo "  <td class='billcell' align='center' style='display: none'>";
        }
        genProviderSelect("bill[{$lino}][provid]", '-- ' . xl("Default") . ' --', $provider_id);
        echo "</td>\n";
        if ($code_types[$codetype]['claim'] && !$code_types[$codetype]['diag']) {
            echo "  <td class='billcell' align='center'{$usbillstyle}><input type='text' name='bill[" . attr($lino) . "][notecodes]' " . "value='" . htmlspecialchars($notecodes, ENT_QUOTES) . "' maxlength='10' size='8' /></td>\n";
        } else {
            echo "  <td class='billcell' align='center'{$usbillstyle}></td>\n";
        }
        echo "  <td class='billcell' align='center'{$usbillstyle}><input type='checkbox' name='bill[" . attr($lino) . "][auth]' " . "value='1'" . ($auth ? " checked" : "") . " /></td>\n";
        echo "  <td class='billcell' align='center'><input type='checkbox' name='bill[" . attr($lino) . "][del]' " . "value='1'" . ($del ? " checked" : "") . " /></td>\n";
    }
    echo "  <td class='billcell'>{$strike1}" . text($code_text) . "{$strike2}</td>\n";
    echo " </tr>\n";
    // If NDC info exists or may be required, add a line for it.
    if ($codetype == 'HCPCS' && $ndc_applies && !$billed) {
        $ndcnum = '';
        $ndcuom = '';
        $ndcqty = '';
        if (preg_match('/^N4(\\S+)\\s+(\\S\\S)(.*)/', $ndc_info, $tmp)) {
            $ndcnum = $tmp[1];
            $ndcuom = $tmp[2];
            $ndcqty = $tmp[3];
        }
        echo " <tr>\n";
        echo "  <td class='billcell' colspan='2'>&nbsp;</td>\n";
        echo "  <td class='billcell' colspan='6'>&nbsp;NDC:&nbsp;";
        echo "<input type='text' name='bill[" . attr($lino) . "][ndcnum]' value='" . attr($ndcnum) . "' " . "size='11' style='background-color:transparent'>";
        echo " &nbsp;Qty:&nbsp;";
        echo "<input type='text' name='bill[" . attr($lino) . "][ndcqty]' value='" . attr($ndcqty) . "' " . "size='3' style='background-color:transparent;text-align:right'>";
        echo " ";
        echo "<select name='bill[" . attr($lino) . "][ndcuom]' style='background-color:transparent'>";
        foreach ($ndc_uom_choices as $key => $value) {
            echo "<option value='" . attr($key) . "'";
            if ($key == $ndcuom) {
                echo " selected";
            }
            echo ">" . text($value) . "</option>";
        }
        echo "</select>";
        echo "</td>\n";
        echo " </tr>\n";
    } else {
        if ($ndc_info) {
            echo " <tr>\n";
            echo "  <td class='billcell' colspan='2'>&nbsp;</td>\n";
            echo "  <td class='billcell' colspan='6'>&nbsp;" . xlt("NDC Data") . ": " . text($ndc_info) . "</td>\n";
            echo " </tr>\n";
        }
    }
    // For IPPF.  Track contraceptive services.
    if (!$del) {
        $contraception |= contraceptionClass($codetype, $code);
    }
    if ($fee != 0) {
        $hasCharges = true;
    }
}
コード例 #20
0
?>
:</td>
			<td><input type='text' name='form_to_doc_date' id="form_to_doc_date"
				size='10' value='<?php 
echo attr($form_to_doc_date);
?>
' readonly="readonly" title='<?php 
echo attr($title_tooltip);
?>
'> 
				<img alt="<?php 
xla("Date Selector");
?>
" src='../pic/show_calendar.gif' align='absbottom' width='24' height='22' id='img_to_doc_date'
				border='0' alt='[?]' style='cursor: pointer' title='<?php 
echo xla('Click here to choose a date');
?>
'></td> 
			<script>
				Calendar.setup({inputField:"form_to_doc_date", ifFormat:global_date_format, button:"img_to_doc_date"});
			</script>
			<td>
				<span style='float: left;' id="docrefresh">
					<a href='#' class='css_button'  onclick='return validateDate("form_from_doc_date","form_to_doc_date")'> <span><?php 
echo xlt('Refresh');
?>
 </span></a> 
				</span>
			</td>
		</tr>
	</table>	
コード例 #21
0
// login.php makes sure the session ID captured here is different for each
// new login.  We maintain it here because most browsers do not have separate
// cookie storage for different top-level windows.  This function should be
// called just prior to invoking any server script that requires correct
// session data.  onclick="top.restoreSession()" usually does the job.
//
var oemr_session_name = '<?php echo session_name(); ?>';
var oemr_session_id   = '<?php echo session_id(); ?>';
var oemr_dialog_close_msg = '<?php echo (function_exists('xla')) ? xla("OK to close this other popup window?") : "OK to close this other popup window?"; ?>';
//
function restoreSession() {
<?php if (!empty($GLOBALS['restore_sessions'])) { ?>
 var ca = document.cookie.split('; ');
 for (var i = 0; i < ca.length; ++i) {
  var c = ca[i].split('=');
  if (c[0] == oemr_session_name && c[1] != oemr_session_id) {
<?php if ($GLOBALS['restore_sessions'] == 2) { ?>
   alert('Changing session ID from\n"' + c[1] + '" to\n"' + oemr_session_id + '"');
<?php } ?>
   document.cookie = oemr_session_name + '=' + oemr_session_id + '; path=/';
  }
 }
<?php } ?>
 return true;
}

// Pages that have a Print button or link should call this to initialize it for logging.
// This is done at page load time in case we want to hide or disable the element.
// The second argument, if present, specifies a log message to be used instead of logging
// the entire document and will always prevent hiding of the button or link.
//
コード例 #22
0
>
   <img src='../pic/show_calendar.gif' align='absbottom' width='24' height='22'
    id='img_to_date' border='0' alt='[?]' style='cursor:pointer'
    title=<?php 
xl('Click here to choose a date', 'e', '\'', '\'');
?>
>

   &nbsp;
   <input type='submit' name='form_refresh' value=<?php 
xl('Refresh', 'e');
?>
>
   &nbsp;
   <input type='button' value='<?php 
echo xla('Print');
?>
' id='printbutton' />
  </td>
 </tr>

 <tr>
  <td height="1">
  </td>
 </tr>

</table>

<table border='0' cellpadding='1' cellspacing='2' width='98%'>
 <tr bgcolor="#dddddd">
  <td class='dehead'>
コード例 #23
0
ファイル: view.php プロジェクト: katopenzz/openemr
?>
'>
</td></tr>
</table>

<div style="margin: 10px;">
<input type="button" class="save" value="    <?php 
echo xla('Save');
?>
    "> &nbsp; 
<input type="button" class="dontsave" value="<?php 
echo xla('Don\'t Save');
?>
"> &nbsp; 
<input type="button" class="printform" value="<?php 
echo xla('View Printable Version');
?>
"> &nbsp; 
</div>

</form>

</body>

<script language="javascript">
/* required for popup calendar */
Calendar.setup({inputField:"date_of_signature", ifFormat:"%Y-%m-%d", button:"img_date_of_signature"});

// jQuery stuff to make the page a little easier to use

$(document).ready(function(){
コード例 #24
0
    ?>
<br />
<!----------------------------------------------------------------------------------------------------------------------------------------------------->  
      <?php 
    echo xlt('Start Date');
    ?>
 : <input id="sd" type="text" name="sd" value="" onkeyup='datekeyup(this,mypcc)' onblur='dateblur(this,mypcc)' title='<?php 
    echo xla('yyyy-mm-dd');
    ?>
' />   &nbsp;&nbsp;&nbsp;  
<!----------------------------------------------------------------------------------------------------------------------------------------------------->   
      <?php 
    echo xlt('End Date');
    ?>
 : <input id="ed" type="text" name="ed" value="" onkeyup='datekeyup(this,mypcc)' onblur='dateblur(this,mypcc)' title='<?php 
    echo xla('yyyy-mm-dd');
    ?>
' />   <br /><br />
<!----------------------------------------------------------------------------------------------------------------------------------------------------->   
      </blockquote>
      <p style="line-height:1.8em;">       
        <?php 
    echo xlt('Sent By, Leave Blank For All');
    ?>
 :                                     
        <select id="sentBy" name="sentBy[]" multiple="multiple">
          <option value="<?php 
    echo attr(intval($_SESSION['authId']));
    ?>
"><?php 
    echo xlt('Myself');
コード例 #25
0
ファイル: printed_fee_sheet.php プロジェクト: minggLu/openemr
            $html .= ":<br />\n</td>\n</tr>";
        }
        // end if last page
        $html .= "</table>\n</td>\n<td valign='top'>\n<table border='0' cellspacing='0' cellpadding='0' width='100%'>\n<tr>\n<td class='toprow' style='width:10%'></td>\n<td class='toprow' style='width:10%'></td>\n<td class='toprow' style='width:25%'></td>\n<td class='toprow' style='width:55%'></td>\n</tr>";
        $cindex = genColumn($cindex);
        // Column 3
        if ($pages == 0) {
            // if this is the last page
            $html .= "<tr>\n<td valign='top' colspan='4' class='fshead' style='height:" . $lheight * 6 . "pt;border-width:0 1px 0 0'>\n&nbsp;\n</td>\n</tr>\n<tr>\n<td valign='top' colspan='4' class='fshead' style='height:" . $lheight * 2 . "pt'>";
            $html .= xl('Signature', 'r');
            $html .= ":<br />\n</td>\n</tr>";
        }
        // end if last page
        $html .= "</table>\n</td>\n</tr>\n\n</table>";
        $html .= "</div>";
        //end of div.pageLetter
    }
    // end while
    $pages = $saved_pages;
    //RESET
}
// Common End Code
if ($form_fill != 2) {
    //use native browser 'print' for multipage
    $html .= "<div id='hideonprint'>\n<p>\n<input type='button' value='";
    $html .= xla('Print');
    $html .= "' id='printbutton' /> \n</div>";
}
$html .= "\n</form>\n</center>\n</body>\n</html>";
// Send final result to display
echo $html;
コード例 #26
0
ファイル: order_manifest.php プロジェクト: katopenzz/openemr
function generate_order_summary($orderid)
{
    // If requested, save checkbox selections as to which procedures are not sendable.
    if ($_POST['bn_save']) {
        sqlStatement("UPDATE procedure_order_code " . "SET do_not_send = 0 WHERE " . "procedure_order_id = ? AND " . "do_not_send != 0", array($orderid));
        if (!empty($_POST['form_omit'])) {
            foreach ($_POST['form_omit'] as $key) {
                sqlStatement("UPDATE procedure_order_code " . "SET do_not_send = 1 WHERE " . "procedure_order_id = ? AND " . "do_not_send = 0 AND " . "procedure_order_seq = ?", array($orderid, intval($key)));
            }
        }
    }
    $orow = sqlQuery("SELECT " . "po.procedure_order_id, po.patient_id, po.date_ordered, po.order_status, " . "po.date_collected, po.specimen_type, po.specimen_location, po.lab_id, po.clinical_hx, " . "pd.pubpid, pd.lname, pd.fname, pd.mname, pd.DOB, pd.sex, " . "pd.street, pd.city, pd.state, pd.postal_code, " . "fe.date, " . "pp.name AS labname, " . "u.lname AS ulname, u.fname AS ufname, u.mname AS umname, " . "ru.lname AS ref_lname, ru.fname AS ref_fname, ru.mname AS ref_mname, " . "ru.street AS ref_street, ru.city AS ref_city, ru.state AS ref_state, ru.zip AS ref_zip " . "FROM procedure_order AS po " . "LEFT JOIN patient_data AS pd ON pd.pid = po.patient_id " . "LEFT JOIN procedure_providers AS pp ON pp.ppid = po.lab_id " . "LEFT JOIN users AS u ON u.id = po.provider_id " . "LEFT JOIN users AS ru ON ru.id = pd.ref_providerID " . "LEFT JOIN form_encounter AS fe ON fe.pid = po.patient_id AND fe.encounter = po.encounter_id " . "WHERE po.procedure_order_id = ?", array($orderid));
    $lab_id = intval($orow['lab_id']);
    $patient_id = intval($orow['patient_id']);
    $encdate = substr($orow['date'], 0, 10);
    // Get insurance info.
    $ins_policy = '';
    $ins_group = '';
    $ins_name = '';
    $ins_addr = '';
    $ins_city = '';
    $ins_state = '';
    $ins_zip = '';
    $irow = getInsuranceDataByDate($patient_id, $encdate, 'primary', "insd.provider, insd.policy_number, insd.group_number");
    if (!empty($irow['provider'])) {
        $ins_policy = $irow['policy_number'];
        $ins_group = $irow['group_number'];
        $insco = new InsuranceCompany($irow['provider']);
        if (!empty($insco)) {
            $ins_name = $insco->get_name();
            $tmp = $insco->get_address();
            $ins_addr = $tmp->get_line1();
            $ins_city = $tmp->get_city();
            $ins_state = $tmp->get_state();
            $ins_zip = $tmp->get_zip();
        }
    }
    ?>

<style>

.ordsum tr.head   { font-size:10pt; background-color:#cccccc; text-align:center; }
.ordsum tr.detail { font-size:10pt; }
.ordsum a, .ordsum a:visited, .ordsum a:hover { color:#0000cc; }

.ordsum table {
 border-style: solid;
 border-width: 1px 0px 0px 1px;
 border-color: black;
}

.ordsum td, .ordsum th {
 border-style: solid;
 border-width: 0px 1px 1px 0px;
 border-color: black;
}

/* specifically exclude from printing */
@media print {
 .unprintable {
  visibility: hidden;
  display: none;
 }
}

</style>

<form method='post' action='order_manifest.php?orderid=<?php 
    echo $orderid;
    ?>
'>

<div class='ordsum'>

<table width='100%' cellpadding='2' cellspacing='0'>
 <tr bgcolor='#cccccc'>
  <td nowrap><?php 
    echo xlt('Patient Name');
    ?>
</td>
  <td><?php 
    echo myCellText($orow['lname'] . ', ' . $orow['fname'] . ' ' . $orow['mname']);
    ?>
</td>
  <td nowrap><?php 
    echo xlt('Ordered By');
    ?>
</td>
  <td><?php 
    echo myCellText($orow['ulname'] . ', ' . $orow['ufname'] . ' ' . $orow['umname']);
    ?>
</td>
 </tr>
 <tr bgcolor='#cccccc'>
  <td width='5%' nowrap><?php 
    echo xlt('MRN (pid)');
    ?>
</td>
  <td width='45%'><?php 
    echo myCellText($patient_id);
    ?>
</td>
  <td width='5%' nowrap><?php 
    echo xlt('Order ID');
    ?>
</td>
  <td width='45%'><?php 
    echo myCellText($orow['procedure_order_id']);
    ?>
</td>
 </tr>
 <tr bgcolor='#cccccc'>
  <td nowrap><?php 
    echo xlt('Encounter Date');
    ?>
</td>
  <td><?php 
    echo myCellText(oeFormatShortDate($encdate));
    ?>
</td>
  <td nowrap><?php 
    echo xlt('Order Date');
    ?>
</td>
  <td><?php 
    echo myCellText(oeFormatShortDate($orow['date_ordered']));
    ?>
</td>
 </tr>
 <tr bgcolor='#cccccc'>
  <td nowrap><?php 
    echo xlt('Birth Date');
    ?>
</td>
  <td><?php 
    echo myCellText(oeFormatShortDate($orow['DOB']));
    ?>
</td>
  <td nowrap><?php 
    echo xlt('Lab');
    ?>
</td>
  <td><?php 
    echo myCellText($orow['labname']);
    ?>
</td>
 </tr>
 <tr bgcolor='#cccccc'>
  <td nowrap><?php 
    echo xlt('Sex');
    ?>
</td>
  <td><?php 
    echo myCellText(getListItem('sex', $orow['sex']));
    ?>
</td>
  <td nowrap><?php 
    echo xlt('Specimen Type');
    ?>
</td>
  <td><?php 
    echo myCellText($orow['specimen_type']);
    ?>
</td>
 </tr>
 <tr bgcolor='#cccccc'>
  <td nowrap><?php 
    echo xlt('Address');
    ?>
</td>
  <td><?php 
    echo myCellText($orow['street'] . ', ' . $orow['city'] . ', ' . $orow['state'] . ' ' . $orow['postal_code']);
    ?>
</td>
  <td nowrap><?php 
    echo xlt('Collection Date');
    ?>
</td>
  <td><?php 
    echo myCellText(oeFormatShortDate($orow['date_collected']));
    ?>
</td>
 </tr>
 <tr bgcolor='#cccccc'>
  <td nowrap><?php 
    echo xlt('Ins Name');
    ?>
</td>
  <td><?php 
    echo myCellText($ins_name);
    ?>
</td>
  <td nowrap><?php 
    echo xlt('Clinical History');
    ?>
</td>
  <td><?php 
    echo myCellText($orow['clinical_hx']);
    ?>
</td>
 </tr>
 <tr bgcolor='#cccccc'>
  <td nowrap><?php 
    echo xlt('Ins Address');
    ?>
</td>
  <td><?php 
    echo myCellText("{$ins_addr}, {$ins_city}, {$ins_state} {$ins_zip}");
    ?>
</td>
  <td nowrap><?php 
    echo xlt('Order Status');
    ?>
</td>
  <td><?php 
    echo myCellText(getListItem('ord_status', $orow['order_status']));
    ?>
</td>
 </tr>
 <tr bgcolor='#cccccc'>
  <td nowrap><?php 
    echo xlt('Ins Policy');
    ?>
</td>
  <td><?php 
    echo myCellText($ins_policy);
    ?>
</td>
  <td nowrap><?php 
    echo xlt('Referrer');
    ?>
</td>
  <td><?php 
    echo myCellText($orow['ref_lname'] . ', ' . $orow['ref_fname'] . ' ' . $orow['ref_mname']);
    ?>
</td>
 </tr>
 <tr bgcolor='#cccccc'>
  <td nowrap><?php 
    echo xlt('Ins Group');
    ?>
</td>
  <td><?php 
    echo myCellText($ins_group);
    ?>
</td>
  <td nowrap><?php 
    echo xlt('Referrer Address');
    ?>
</td>
  <td><?php 
    echo myCellText($orow['ref_street'] . ', ' . $orow['ref_city'] . ', ' . $orow['ref_state'] . ' ' . $orow['ref_zip']);
    ?>
</td>
 </tr>
</table>

&nbsp;<br />

<table width='100%' cellpadding='2' cellspacing='0'>

 <tr class='head'>
  <td><?php 
    echo xlt('Omit');
    ?>
</td>
  <td><?php 
    echo xlt('Code');
    ?>
</td>
  <td><?php 
    echo xlt('Description');
    ?>
</td>
  <td><?php 
    echo xlt('Diagnoses');
    ?>
</td>
  <td><?php 
    echo xlt('Notes');
    ?>
</td>
 </tr>

<?php 
    $query = "SELECT " . "procedure_order_seq, procedure_code, procedure_name, diagnoses, do_not_send " . "FROM procedure_order_code WHERE " . "procedure_order_id =  ? ";
    if (!empty($_POST['bn_show_sendable'])) {
        $query .= "AND do_not_send = 0 ";
    }
    $query .= "ORDER BY procedure_order_seq";
    $res = sqlStatement($query, array($orderid));
    $encount = 0;
    while ($row = sqlFetchArray($res)) {
        $order_seq = empty($row['procedure_order_seq']) ? 0 : $row['procedure_order_seq'] + 0;
        $procedure_code = empty($row['procedure_code']) ? '' : $row['procedure_code'];
        $procedure_name = empty($row['procedure_name']) ? '' : $row['procedure_name'];
        $diagnoses = empty($row['diagnoses']) ? '' : $row['diagnoses'];
        // Create a string of HTML representing the procedure answers.
        // This code cloned from gen_hl7_order.inc.php.
        // Should maybe refactor it into something like a ProcedureAnswer class.
        $qres = sqlStatement("SELECT " . "a.question_code, a.answer, q.fldtype, q.question_text " . "FROM procedure_answers AS a " . "LEFT JOIN procedure_questions AS q ON " . "q.lab_id = ? " . "AND q.procedure_code = ? AND " . "q.question_code = a.question_code " . "WHERE " . "a.procedure_order_id = ? AND " . "a.procedure_order_seq = ? " . "ORDER BY q.seq, a.answer_seq", array($lab_id, $procedure_code, $orderid, $order_seq));
        $notes = '';
        while ($qrow = sqlFetchArray($qres)) {
            // Formatting of these answer values may be lab-specific and we'll figure
            // out how to deal with that as more labs are supported.
            $answer = trim($qrow['answer']);
            $fldtype = $qrow['fldtype'];
            if ($fldtype == 'G') {
                $weeks = intval($answer / 7);
                $days = $answer % 7;
                $answer = $weeks . 'wks ' . $days . 'days';
            }
            if ($notes) {
                $notes .= '<br />';
            }
            $notes .= text($qrow['question_text'] . ': ' . $answer);
        }
        if ($notes === '') {
            $notes = '&nbsp;';
        }
        ++$encount;
        $bgcolor = "#" . ($encount & 1 ? "ddddff" : "ffdddd");
        echo " <tr class='detail' bgcolor='{$bgcolor}'>\n";
        echo "  <td><input type='checkbox' name='form_omit[{$order_seq}]' value='1'";
        if (!empty($row['do_not_send'])) {
            echo " checked";
        }
        echo " /></td>\n";
        echo "  <td>" . myCellText("{$procedure_code}") . "</td>\n";
        echo "  <td>" . myCellText("{$procedure_name}") . "</td>\n";
        echo "  <td>" . myCellText("{$diagnoses}") . "</td>\n";
        echo "  <td>{$notes}</td>\n";
        echo " </tr>\n";
    }
    ?>

</table>
</div>

<center>
<p class='unprintable'>
<input type='submit' name='bn_save' value='<?php 
    echo xla('Save omission selections');
    ?>
' />
&nbsp;
<input type='submit' name='bn_show_all' value='<?php 
    echo xla('Show all procedures');
    ?>
' />
&nbsp;
<input type='submit' name='bn_show_sendable' value='<?php 
    echo xla('Show only procedures not omitted');
    ?>
' />
</p>
</center>

</form>

<?php 
}
コード例 #27
0
ファイル: pos_checkout.php プロジェクト: nitinkunte/openemr
    }
}
?>

 <tr>
  <td colspan='2' align='center'>
   &nbsp;<br>
   <input type='submit' name='form_save' value='<?php 
echo xla('Save');
?>
' /> &nbsp;
<?php 
if (empty($_GET['framed'])) {
    ?>
   <input type='button' value='<?php 
    echo xla('Cancel');
    ?>
' onclick='window.close()' />
<?php 
}
?>
   <input type='hidden' name='form_provider'  value='<?php 
echo attr($inv_provider);
?>
' />
   <input type='hidden' name='form_payer'     value='<?php 
echo attr($inv_payer);
?>
' />
   <input type='hidden' name='form_encounter' value='<?php 
echo attr($inv_encounter);
コード例 #28
0
ファイル: chart_tracker.php プロジェクト: katopenzz/openemr
   <?php 
echo xlt('New Patient ID');
?>
: &nbsp;
  </td>
  <td class='text'>
   <input type='text' name='form_newid' size='10' value=''
    class='inputtext' title='<?php 
echo xla("Type or scan the patient identifier here");
?>
' />
  </td>
 </tr>

 <tr>
  <td class='bold'>&nbsp;</td>
  <td class='text'>
   <input type='submit' class='button' name='form_lookup' value='<?php 
echo xla("Look Up");
?>
' />
  </td>
 </tr>

</table>

</form>
</center>
</body>
</html>
コード例 #29
0
ファイル: patient_form.php プロジェクト: mi-squared/openemr
        echo "</table>\n";
    }
} else {
    // Portal login name is already in openemr.
    echo "</table>\n";
}
?>

<p>
<input type='submit' name='bn_save' value='<?php 
echo xla('Save and Delete Request');
?>
' />
&nbsp;
<input type='button' value='<?php 
echo xla('Back');
?>
' onclick="window.history.back()" />
<!-- Was: onclick="myRestoreSession();location='list_requests.php'" -->
</p>

</form>

<script language="JavaScript">

// hard code validation for old validation, in the new validation possible to add match rules
<?php 
if ($GLOBALS['new_validate'] == 0) {
    ?>

// Fix inconsistently formatted phone numbers from the database.
コード例 #30
0
         }
         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 "&nbsp;?&nbsp;";
         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>";