/**
 *	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";
            }
        }
    }
}
Example #2
0
function getOrganize($state, $name, $attr)
{
    $OBJ =& get_instance();
    if ($state === '') {
        $state = 1;
    }
    $s = option(1, $OBJ->lang->word('chronological'), $state, 1);
    $s .= option(2, $OBJ->lang->word('sectional'), $state, 2);
    return select($name, attr($attr), $s);
}
Example #3
0
function generateDateQualifierSelect($name, $options, $obj)
{
    echo "<select name='" . attr($name) . "'>";
    for ($idx = 0; $idx < count($options); $idx++) {
        echo "<option value='" . attr($options[$idx][1]) . "'";
        if ($obj[$name] == $options[$idx][1]) {
            echo " selected";
        }
        echo ">" . text($options[$idx][0]) . "</option>";
    }
    echo "</select>";
}
function input_multiselect($name, $options, $value, $opt = array())
{
    $opt['type'] = 'multiselect';
    $input = input_merge_opt($name, $value, $opt);
    $attr = attr(array_diff_key(clean_opt($input), array_fill_keys(array('name', 'value'), 0)));
    foreach ($options as $val => $label) {
        $label = lang($val);
        if ($label) {
            $options[$val] = $label;
        }
    }
    $input['form_input'] = form_multiselect($input['name'], $options, explode('|', $input['value']), $attr);
    return input_markup($input);
}
Example #5
0
function attr_class()
{
    $classes = array();
    $args = func_get_args();
    foreach ($args as $arg) {
        if (empty($arg) || is_array($arg) && count($arg) == 0) {
            continue;
        }
        $classes = array_merge($classes, is_array($arg) ? $arg : array($arg));
    }
    $classes = array_filter($classes);
    if (count($classes) > 0) {
        attr('class', join(' ', $classes));
    }
}
Example #6
0
 /**
  * Create a class declaration from the given array and class name.
  *
  * @param array	the array map containing the keys and values.
  * @param 		the class name.
  * @return		string.	 
  */
 static function classDeclaration(array $array, $className)
 {
     function serializeValue($value)
     {
         $type = gettype($value);
         if ('string' == $type) {
             return '"' . $value . '"';
         }
         if ('integer' == $type || 'double' == $type) {
             return $value;
         }
         if ('boolean' == $type) {
             return $value ? 'true' : 'false';
         }
         if ('array' == $type && (array) $value === $value) {
             $str = '';
             foreach ($value as $k => $v) {
                 $str .= '' == $str ? 'array( ' : ', ';
                 if (is_numeric($k)) {
                     $str .= " '{$k}' => " . serializeValue($v);
                 } else {
                     $str .= " {$k} => " . serializeValue($v);
                 }
             }
             $str .= ' )';
             return $str;
         }
         return '';
     }
     function attr($value)
     {
         return ' = ' . serializeValue($value);
     }
     $class = "class {$className} { \n";
     foreach ($array as $key => $value) {
         if (is_numeric($key)) {
             $class .= "public \$unknown{$key}" . attr($value) . ";\n";
         } else {
             $class .= "public \${$key}" . attr($value) . ";\n";
         }
     }
     $class .= "\n}";
     return $class;
 }
function icon($icon, $url = FALSE, $attr = array(), $state = '', $type = 'icon')
{
    if (!isset($attr['class'])) {
        $attr['class'] = '';
    }
    $attr['class'] .= ' ' . $type;
    if ($type == 'icon') {
        $attr['class'] .= '-' . $icon;
        $content = '  ';
    } else {
        $content = 'text';
    }
    if ($state) {
        $attr['class'] .= ' ' . $type . '-' . $state;
    }
    $content = $type != 'icon' ? $icon : ' ';
    $attr['class'] = ltrim($attr['class']);
    return $url ? anchor($url, $content, $attr) : '<i ' . attr($attr) . '>' . $content . '</i>';
}
Example #8
0
function short($code, $return = false)
{
    function attr($attr, $place)
    {
        if (!empty($attr[$place])) {
            return $attr[$place];
        }
    }
    preg_match_all("/\\((?:[^()]|(?R))+\\)|'[^']*'|[^(),\\s]+/", $code, $matches);
    $attr = $matches[0];
    $attr[1] = str_replace('(', '', $attr[1]);
    $attr[1] = str_replace(')', '', $attr[1]);
    $shorts = array('image' => '<img src="' . attr($attr, 1) . '" width="' . attr($attr, 2) . '" height="' . attr($attr, 3) . '" />', 'bold' => '<b>' . attr($attr, 1) . '</b>', 'div' => '<div>' . attr($attr, 1) . '</div>', 'italic' => '<i>' . attr($attr, 1) . '</i>', 'paragraph' => '<p>' . attr($attr, 1) . '</p>');
    if ($return == false) {
        return $shorts[$attr[0]];
    }
    if ($return == true) {
        print $shorts[$attr[0]];
    }
}
Example #9
0
function genProviderSelect($selname, $toptext, $default = 0, $disabled = false)
{
    $query = "SELECT id, lname, fname FROM users WHERE " . "( authorized = 1 OR info LIKE '%provider%' ) AND username != '' " . "AND active = 1 AND ( info IS NULL OR info NOT LIKE '%Inactive%' ) " . "ORDER BY lname, fname";
    $res = sqlStatement($query);
    echo "   <select name='" . attr($selname) . "'";
    if ($disabled) {
        echo " disabled";
    }
    echo ">\n";
    echo "    <option value=''>" . text($toptext) . "\n";
    while ($row = sqlFetchArray($res)) {
        $provid = $row['id'];
        echo "    <option value='" . attr($provid) . "'";
        if ($provid == $default) {
            echo " selected";
        }
        echo ">" . text($row['lname'] . ", " . $row['fname']) . "\n";
    }
    echo text($provid);
    echo "   </select>\n";
}
Example #10
0
function echoLine($iname, $date, $charges, $ptpaid, $inspaid, $duept, $encounter = 0, $copay = 0, $patcopay = 0)
{
    global $var_index;
    $var_index++;
    $balance = bucks($charges - $ptpaid - $inspaid);
    $balance = round($duept, 2) != 0 ? 0 : $balance;
    //if balance is due from patient, then insurance balance is displayed as zero
    $encounter = $encounter ? $encounter : '';
    echo " <tr id='tr_" . attr($var_index) . "' >\n";
    echo "  <td class='detail'>" . text(oeFormatShortDate($date)) . "</td>\n";
    echo "  <td class='detail' id='" . attr($date) . "' align='center'>" . htmlspecialchars($encounter, ENT_QUOTES) . "</td>\n";
    echo "  <td class='detail' align='center' id='td_charges_{$var_index}' >" . htmlspecialchars(bucks($charges), ENT_QUOTES) . "</td>\n";
    echo "  <td class='detail' align='center' id='td_inspaid_{$var_index}' >" . htmlspecialchars(bucks($inspaid * -1), ENT_QUOTES) . "</td>\n";
    echo "  <td class='detail' align='center' id='td_ptpaid_{$var_index}' >" . htmlspecialchars(bucks($ptpaid * -1), ENT_QUOTES) . "</td>\n";
    echo "  <td class='detail' align='center' id='td_patient_copay_{$var_index}' >" . htmlspecialchars(bucks($patcopay), ENT_QUOTES) . "</td>\n";
    echo "  <td class='detail' align='center' id='td_copay_{$var_index}' >" . htmlspecialchars(bucks($copay), ENT_QUOTES) . "</td>\n";
    echo "  <td class='detail' align='center' id='balance_{$var_index}'>" . htmlspecialchars(bucks($balance), ENT_QUOTES) . "</td>\n";
    echo "  <td class='detail' align='center' id='duept_{$var_index}'>" . htmlspecialchars(bucks(round($duept, 2) * 1), ENT_QUOTES) . "</td>\n";
    echo "  <td class='detail' align='right'><input type='text' name='" . attr($iname) . "'  id='paying_" . attr($var_index) . "' " . " value='" . '' . "' onchange='coloring();calctotal()'  autocomplete='off' " . "onkeyup='calctotal()'  style='width:50px'/></td>\n";
    echo " </tr>\n";
}
Example #11
0
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;
}
Example #12
0
function parseFlickrFeed($id, $n, $perrow)
{
    $url = "http://api.flickr.com/services/feeds/photos_public.gne?id={$id}&lang=it-it&format=rss_200";
    $s = url2_get_contents($url);
    preg_match_all('#<item>(.*)</item>#Us', $s, $items);
    $out = "";
    for ($i = 0; $i < count($items[1]); $i++) {
        if ($i >= $n) {
            return $out;
        }
        $item = $items[1][$i];
        preg_match_all('#<link>(.*)</link>#Us', $item, $temp);
        $link = $temp[1][0];
        preg_match_all('#<title>(.*)</title>#Us', $item, $temp);
        $title = $temp[1][0];
        preg_match_all('#<media:content([^>]*)>#Us', $item, $temp);
        $imglink = attr($temp[0][0], "url");
        preg_match_all('#<media:thumbnail([^>]*)>#Us', $item, $temp);
        $thumb = attr($temp[0][0], "url");
        $out .= "<li class=\"" . ($i % $perrow == $perrow - 1 ? 'last' : "") . "\"><a href=\"" . $imglink . "\" target='_blank' data-rel=\"prettyPhoto[flickr]\" title=\"" . str_replace('"', '', $title) . "\"><img src='{$thumb}'/></a></li>";
    }
    return $out;
}
Example #13
0
function writeTemplateLine($selector, $dosage, $period, $quantity, $refills, $prices, $taxrates)
{
    global $tmpl_line_no;
    ++$tmpl_line_no;
    echo " <tr>\n";
    echo "  <td class='tmplcell drugsonly'>";
    echo "<input type='text' name='form_tmpl[{$tmpl_line_no}][selector]' value='" . attr($selector) . "' size='8' maxlength='100'>";
    echo "</td>\n";
    echo "  <td class='tmplcell drugsonly'>";
    echo "<input type='text' name='form_tmpl[{$tmpl_line_no}][dosage]' value='" . attr($dosage) . "' size='6' maxlength='10'>";
    echo "</td>\n";
    echo "  <td class='tmplcell drugsonly'>";
    generate_form_field(array('data_type' => 1, 'field_id' => 'tmpl[' . $tmpl_line_no . '][period]', 'list_id' => 'drug_interval', 'empty_title' => 'SKIP'), $period);
    echo "</td>\n";
    echo "  <td class='tmplcell drugsonly'>";
    echo "<input type='text' name='form_tmpl[{$tmpl_line_no}][quantity]' value='" . attr($quantity) . "' size='3' maxlength='7'>";
    echo "</td>\n";
    echo "  <td class='tmplcell drugsonly'>";
    echo "<input type='text' name='form_tmpl[{$tmpl_line_no}][refills]' value='" . attr($refills) . "' size='3' maxlength='5'>";
    echo "</td>\n";
    foreach ($prices as $pricelevel => $price) {
        echo "  <td class='tmplcell'>";
        echo "<input type='text' name='form_tmpl[{$tmpl_line_no}][price][" . attr($pricelevel) . "]' value='" . attr($price) . "' size='6' maxlength='12'>";
        echo "</td>\n";
    }
    $pres = sqlStatement("SELECT option_id FROM list_options " . "WHERE list_id = 'taxrate' ORDER BY seq");
    while ($prow = sqlFetchArray($pres)) {
        echo "  <td class='tmplcell'>";
        echo "<input type='checkbox' name='form_tmpl[{$tmpl_line_no}][taxrate][" . attr($prow['option_id']) . "]' value='1'";
        if (strpos(":{$taxrates}", $prow['option_id']) !== false) {
            echo " checked";
        }
        echo " /></td>\n";
    }
    echo " </tr>\n";
}
<table>
 <tr>
  <td width='200px'>
	<div style='float:left'>

	<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%' >
Example #15
0
/**
 * Generate HTML for the QOE form suitable for insertion into a <div>.
 * This HTML may contain single quotes but not unescaped double quotes.
 *
 * @param  integer $ptid     Value matching a procedure_type_id in the procedure_types table.
 * @param  integer $orderid  Procedure order ID, if there is an existing order.
 * @param  integer $dbseq    Procedure order item sequence number, if there is an existing procedure.
 * @param  string  $formseq  Zero-relative occurrence number in the form.
 * @return string            The generated HTML.
 */
function generate_qoe_html($ptid = 0, $orderid = 0, $dbseq = 0, $formseq = 0)
{
    global $rootdir, $qoe_init_javascript;
    $s = "";
    $qoe_init_javascript = '';
    $prefix = 'ans' . $formseq . '_';
    if (empty($ptid)) {
        return $s;
    }
    $s .= "<table>";
    // Get all the questions for the given procedure order type.
    $qres = sqlStatement("SELECT " . "q.question_code, q.question_text, q.options, q.required, q.maxsize, " . "q.fldtype, q.tips " . "FROM procedure_type AS t " . "JOIN procedure_questions AS q ON q.lab_id = t.lab_id " . "AND q.procedure_code = t.procedure_code AND q.activity = 1 " . "WHERE t.procedure_type_id = ? " . "ORDER BY q.seq, q.question_text", array($ptid));
    while ($qrow = sqlFetchArray($qres)) {
        $options = trim($qrow['options']);
        $qfieldid = $prefix . attr(trim($qrow['question_code']));
        $fldtype = $qrow['fldtype'];
        $maxsize = 0 + $qrow['maxsize'];
        // Get answer value(s) to this question, if any.
        $answers = array();
        if ($orderid && $dbseq > 0) {
            $ares = sqlStatement("SELECT answer FROM procedure_answers WHERE " . "procedure_order_id = ? AND procedure_order_seq = ? AND question_code = ? " . "ORDER BY answer_seq", array($orderid, $dbseq, $qrow['question_code']));
            while ($arow = sqlFetchArray($ares)) {
                $answers[] = $arow['answer'];
            }
        }
        $s .= "<tr>";
        $s .= "<td width='1%' valign='top' nowrap";
        if ($qrow['required']) {
            $s .= " style='color:#880000'";
        }
        // TBD: move to stylesheet
        $s .= ">" . attr($qrow['question_text']) . "</td>";
        $s .= "<td valign='top'>";
        if ($fldtype == 'T') {
            // Text Field.
            $s .= "<input type='text' name='{$qfieldid}' size='50'";
            $s .= " maxlength='" . ($maxsize ? $maxsize : 255) . "'";
            if (!empty($answers)) {
                $s .= " value='" . attr($answers[0]) . "'";
            }
            $s .= " />";
            $s .= "&nbsp;" . text($qrow['tips']);
        } else {
            if ($fldtype == 'N') {
                // Numeric text Field.
                // TBD: Add some JavaScript validation for this.
                $s .= "<input type='text' name='{$qfieldid}' maxlength='8'";
                if (!empty($answers)) {
                    $s .= " value='" . attr($answers[0]) . "'";
                }
                $s .= " />";
                $s .= "&nbsp;" . text($qrow['tips']);
            } else {
                if ($fldtype == 'D') {
                    // Date Field.
                    $s .= "<input type='text' size='10' name='{$qfieldid}' id='{$qfieldid}'";
                    if (!empty($answers)) {
                        $s .= " value='" . attr($answers[0]) . "'";
                    }
                    $s .= " onkeyup='datekeyup(this,mypcc)' onblur='dateblur(this,mypcc)' />";
                    $s .= "<img src='{$rootdir}/pic/show_calendar.gif' align='absbottom' width='24' height='22'" . " id='img_{$qfieldid}' border='0' alt='[?]' style='cursor:pointer'" . " title='" . htmlspecialchars(xl('Click here to choose a date'), ENT_QUOTES) . "' />";
                    $qoe_init_javascript .= " Calendar.setup({inputField:'{$qfieldid}', ifFormat:'%Y-%m-%d', button:'img_{$qfieldid}'});";
                } else {
                    if ($fldtype == 'G') {
                        // Gestational age in weeks and days.
                        $currweeks = -1;
                        $currdays = -1;
                        if (!empty($answers)) {
                            $currweeks = intval($answers[0] / 7);
                            $currdays = $answers[0] % 7;
                        }
                        $s .= "<select name='G1_{$qfieldid}'>";
                        $s .= "<option value=''></option>";
                        for ($i = 5; $i <= 21; ++$i) {
                            $s .= "<option value='{$i}'";
                            if ($i == $currweeks) {
                                $s .= " selected";
                            }
                            $s .= ">{$i}</option>";
                        }
                        $s .= "</select>";
                        $s .= " " . xlt('weeks') . " &nbsp;";
                        $s .= "<select name='G2_{$qfieldid}'>";
                        $s .= "<option value=''></option>";
                        for ($i = 0; $i <= 6; ++$i) {
                            $s .= "<option value='{$i}'";
                            if ($i == $currdays) {
                                $s .= " selected";
                            }
                            $s .= ">{$i}</option>";
                        }
                        $s .= "</select>";
                        $s .= " " . xlt('days');
                    } else {
                        if ($fldtype == 'M') {
                            // List of checkboxes.
                            $a = explode(';', $qrow['options']);
                            $i = 0;
                            foreach ($a as $aval) {
                                list($desc, $code) = explode(':', $aval);
                                if (empty($code)) {
                                    $code = $desc;
                                }
                                if ($i) {
                                    $s .= "<br />";
                                }
                                $s .= "<input type='checkbox' name='{$qfieldid[$i]}' value='" . attr($code) . "'";
                                if (in_array($code, $answers)) {
                                    $s .= " checked";
                                }
                                $s .= " />" . text($desc);
                                ++$i;
                            }
                        } else {
                            // Radio buttons or drop-list, depending on the number of choices.
                            $a = explode(';', $qrow['options']);
                            if (count($a) > 5) {
                                $s .= "<select name='{$qfieldid}'";
                                $s .= ">";
                                foreach ($a as $aval) {
                                    list($desc, $code) = explode(':', $aval);
                                    if (empty($code)) {
                                        $code = $desc;
                                    }
                                    $s .= "<option value='" . attr($code) . "'";
                                    if (in_array($code, $answers)) {
                                        $s .= " selected";
                                    }
                                    $s .= ">" . text($desc) . "</option>";
                                }
                                $s .= "</select>";
                            } else {
                                $i = 0;
                                foreach ($a as $aval) {
                                    list($desc, $code) = explode(':', $aval);
                                    if (empty($code)) {
                                        $code = $desc;
                                    }
                                    if ($i) {
                                        $s .= "<br />";
                                    }
                                    $s .= "<input type='radio' name='{$qfieldid}' value='" . attr($code) . "'";
                                    if (in_array($code, $answers)) {
                                        $s .= " checked";
                                    }
                                    $s .= " />" . text($desc);
                                    ++$i;
                                }
                            }
                        }
                    }
                }
            }
        }
        $s .= '</td>';
        $s .= '</tr>';
    }
    $s .= '</table>';
    return $s;
}
                           <img src='../pic/show_calendar.gif' align='absbottom' width='24' height='22'
                                id='img_from_date' border='0' alt='[?]' style='cursor:pointer'
                                title='<?php 
    echo xla("Click here to choose a date");
    ?>
'>
                        </td>
                        <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';
    }
Example #17
0
 </tr>

 <tr class='ordonly'>
  <td width='1%' nowrap><b><?php 
echo xlt('Order From');
?>
:</b></td>
  <td>
   <select name='form_lab_id' title='<?php 
echo xla('The entity performing this procedure');
?>
'>
 <?php 
$ppres = sqlStatement("SELECT ppid, name FROM procedure_providers " . "ORDER BY name, ppid");
while ($pprow = sqlFetchArray($ppres)) {
    echo "<option value='" . attr($pprow['ppid']) . "'";
    if ($pprow['ppid'] == $row['lab_id']) {
        echo " selected";
    }
    echo ">" . text($pprow['name']) . "</option>";
}
?>
   </select>
  </td>
 </tr>

 <tr class='ordonly resonly'>
  <td nowrap><b><?php 
echo xlt('Identifying Code');
?>
:</b></td>
Example #18
0
function write_form_line($code_type, $code, $id, $date, $description, $amount, $units, $taxrates)
{
    global $lino;
    $amount = sprintf("%01.2f", $amount);
    if (empty($units)) {
        $units = 1;
    }
    $price = $amount / $units;
    // should be even cents, but ok here if not
    if ($code_type == 'COPAY' && !$description) {
        $description = xl('Payment');
    }
    echo " <tr>\n";
    echo "  <td>" . text(oeFormatShortDate($date));
    echo "<input type='hidden' name='line[{$lino}][code_type]' value='" . attr($code_type) . "'>";
    echo "<input type='hidden' name='line[{$lino}][code]' value='" . attr($code) . "'>";
    echo "<input type='hidden' name='line[{$lino}][id]' value='" . attr($id) . "'>";
    echo "<input type='hidden' name='line[{$lino}][description]' value='" . attr($description) . "'>";
    echo "<input type='hidden' name='line[{$lino}][taxrates]' value='" . attr($taxrates) . "'>";
    echo "<input type='hidden' name='line[{$lino}][price]' value='" . attr($price) . "'>";
    echo "<input type='hidden' name='line[{$lino}][units]' value='" . attr($units) . "'>";
    echo "</td>\n";
    echo "  <td>" . text($description) . "</td>";
    echo "  <td align='right'>" . text($units) . "</td>";
    echo "  <td align='right'><input type='text' name='line[{$lino}][amount]' " . "value='" . attr($amount) . "' size='6' maxlength='8'";
    // Modifying prices requires the acct/disc permission.
    // if ($code_type == 'TAX' || ($code_type != 'COPAY' && !acl_check('acct','disc')))
    echo " style='text-align:right;background-color:transparent' readonly";
    // else echo " style='text-align:right' onkeyup='computeTotals()'";
    echo "></td>\n";
    echo " </tr>\n";
    ++$lino;
}
Example #19
0
 </tr>
<?php 
if (is_array($result['uploads'])) {
    foreach ($result['uploads'] as $upload) {
        $id = intval($upload['id']);
        echo " <tr class='detail'>\n";
        // MIME type and view link
        echo "  <td><a href='upload_form_show.php?id={$id}&messageid={$messageid}'>" . text($upload['mimetype']) . "</a></td>\n";
        // Desired file name
        echo "  <td><input type='text' name='form_filename[{$id}]' value='" . attr($upload['filename']) . "' size='20' /></td>";
        // Desired document category with option to discard the file
        echo "  <td><select name='form_category[{$id}]'>\n";
        echo "<option value='0'>-- " . xlt('Discard') . " --</option>\n";
        $i = 0;
        foreach ($categories as $catkey => $catname) {
            echo "<option value='" . attr($catkey) . "'";
            if (++$i == 1) {
                echo " selected";
            }
            echo ">" . text($catname) . "</option>\n";
        }
        echo "</select></td>\n";
        //
        echo " </tr>\n";
    }
}
?>
</table>

<p>
<input type='submit' name='bn_save' value='<?php 
Example #20
0
<tr><td>
<span class=text><?php 
echo xlt('Doctor:');
?>
 </span><input type=text name="doctor" value="<?php 
echo attr($obj["doctor"]);
?>
">
</td><td>
<span class="text"><?php 
echo xlt('Date');
?>
</span>
   <input type='text' size='10' name='date_of_signature' id='date_of_signature'
    value='<?php 
echo attr($obj['date_of_signature']);
?>
'
    />
</td></tr>
</table>

</form>

</body>

<script language="javascript">
// jQuery stuff to make the page a little easier to use

$(document).ready(function(){
    window.print();
Example #21
0
</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";
        }
    } else {
        // For new encounters the invoker may pass an issue ID.
        if (!empty($_REQUEST['issue']) && $_REQUEST['issue'] == $list_id) {
            echo " selected";
        }
    }
    echo ">" . text($tcode) . ": " . text($irow['begdate']) . " " . text(substr($irow['title'], 0, 40)) . "</option>\n";
}
?>
   </select>
Example #22
0
        } else {
            echo '<tr title="' . xl('Edit form') . '" ' . 'id="' . $formdir . '~' . $iter['form_id'] . '" class="text onerow">';
        }
        $user = getNameFromUsername($iter['user']);
        $form_name = $formdir == 'newpatient' ? xl('Patient Encounter') : xl_form_title($iter['form_name']);
        // Create the ESign instance for this form
        $esign = $esignApi->createFormESign($iter['id'], $formdir, $encounter);
        echo "<tr>";
        echo "<td style='border-bottom:1px solid'>";
        // a link to edit the form
        echo "<div class='form_header_controls'>";
        // If the form is locked, it is no longer editable
        if ($esign->isLocked()) {
            echo "<a href=# class='css_button_small form-edit-button-locked' id='form-edit-button-" . attr($formdir) . "-" . attr($iter['id']) . "'><span>" . xlt('Locked') . "</span></a>";
        } else {
            echo "<a class='css_button_small form-edit-button' id='form-edit-button-" . attr($formdir) . "-" . attr($iter['id']) . "' target='" . "_parent" . "' href='{$rootdir}/patient_file/encounter/view_form.php?" . "formname=" . attr($formdir) . "&id=" . attr($iter['form_id']) . "' onclick='top.restoreSession()'>";
            echo "<span>" . xlt('Edit') . "</span></a>";
        }
        if ($esign->isButtonViewable()) {
            echo $esign->buttonHtml();
        }
        if (acl_check('admin', 'super')) {
            if ($formdir != 'newpatient') {
                // a link to delete the form from the encounter
                echo "<a target='_parent'" . " href='{$rootdir}/patient_file/encounter/delete_form.php?" . "formname=" . $formdir . "&id=" . $iter['id'] . "&encounter=" . $encounter . "&pid=" . $pid . "' class='css_button_small' title='" . xl('Delete this form') . "' onclick='top.restoreSession()'><span>" . xl('Delete') . "</span></a>";
            } else {
                ?>
<a href='javascript:;' class='css_button_small' style='color:gray'><span><?php 
                xl('Delete', 'e');
                ?>
</span></a><?php 
Example #23
0
			<th style="width:15%" align="left"><?php 
    echo xlt('Request Status');
    ?>
</th>
		</tr>
	
		<?php 
    while ($row = sqlFetchArray($resultSet)) {
        $amendmentLink = "<a href=add_edit_amendments.php?id=" . attr($row['amendment_id']) . ">" . oeFormatShortDate($row['amendment_date']) . "</a>";
        ?>
			<tr class="amendmentrow" id="<?php 
        echo attr($row['amendment_id']);
        ?>
">
				<td><input id="check_list[]" name="check_list[]" type="checkbox" value="<?php 
        echo attr($row['amendment_id']);
        ?>
"></td>
				<td class=text><?php 
        echo $amendmentLink;
        ?>
 </td>
				<td class=text><?php 
        echo text($row['amendment_desc']);
        ?>
 </td>
				<td class=text><?php 
        echo generate_display_field(array('data_type' => '1', 'list_id' => 'amendment_from'), $row['amendment_by']);
        ?>
 </td>
				<td class=text><?php 
Example #24
0
    echo "</script>\n</body>\n</html>\n";
    exit;
}
?>

<center>

<p><b>Upload Image File</b></p>

</center>

<form method="post" name="main" action="upload_dialog.php?patientid=<?php 
echo attr($patientid);
?>
&file=<?php 
echo attr($what);
?>
" enctype="multipart/form-data">
<input type="hidden" name="MAX_FILE_SIZE" value="4000000">

<center>

<!-- Table required so input field does not start on a new line -->
<table border="0">
 <tr>
  <td style="font-size:11pt">
   Send this file:
  </td>
  <td>
   <input type="file" name="userfile" />
  </td>
Example #25
0
function ctSelector($opt_line_no, $data_array, $name, $option_array, $title = '')
{
    $value = isset($data_array[$name]) ? $data_array[$name] : '';
    $s = "  <td title='" . attr($title) . "' align='center' class='optcell'>";
    $s .= "<select name='opt[{$opt_line_no}][{$name}]' class='optin'>";
    foreach ($option_array as $key => $desc) {
        $s .= "<option value='" . attr($key) . "'";
        if ($key == $value) {
            $s .= " selected";
        }
        $s .= ">" . text($desc) . "</option>";
    }
    $s .= "</select>";
    $s .= "</td>\n";
    return $s;
}
Example #26
0
    echo "</td><td valign='top'>\n";
    echo "<b>" . xlt('Lists') . "</b><br />\n";
    echo "<select multiple name='form_sel_lists[]' size='15'>";
    $lres = sqlStatement("SELECT option_id, title FROM list_options WHERE " . "list_id = 'lists' ORDER BY title, seq");
    while ($lrow = sqlFetchArray($lres)) {
        echo "<option value='" . attr($lrow['option_id']) . "'";
        echo ">" . text(xl_list_label($lrow['title'])) . "</option>\n";
    }
    echo "</select>\n";
    // Multi-select for layouts.
    echo "</td><td valign='top'>\n";
    echo "<b>" . xlt('Layouts') . "</b><br />\n";
    echo "<select multiple name='form_sel_layouts[]' size='15'>";
    $lres = sqlStatement("SELECT option_id, title FROM list_options WHERE " . "list_id = 'lbfnames' ORDER BY title, seq");
    while ($lrow = sqlFetchArray($lres)) {
        echo "<option value='" . attr($lrow['option_id']) . "'";
        echo ">" . text(xl_layout_label($lrow['title'])) . "</option>\n";
    }
    echo "</select>\n";
    echo "</td>\n</tr>\n</table>\n";
    echo "&nbsp;<br /><input type='submit' value='" . xl('Continue') . "' />\n";
}
if ($form_step == 102) {
    $tables = '';
    if ($_POST['form_cb_services']) {
        $tables .= ' codes';
    }
    if ($_POST['form_cb_products']) {
        $tables .= ' drugs drug_templates';
    }
    if ($_POST['form_cb_prices']) {
Example #27
0
}

</script>
</head>

<body class="body_top">
<center>

<form method='post' action='insurance_form.php' onsubmit='return validate()'>

<input type='hidden' name='ptid'   value='<?php 
echo attr($ptid);
?>
' />
<input type='hidden' name='postid' value='<?php 
echo attr($postid);
?>
' />

<table width='100%' cellpadding='1' cellspacing='2'>
 <tr class='head'>
  <th align='left'><?php 
echo xlt('Field');
?>
</th>
  <th align='left'><?php 
echo xlt('Current Value');
?>
</th>
  <th align='left'><?php 
echo xlt('New Value');
Example #28
0
$query = "SELECT * FROM users WHERE username != '' ";
if (!$form_inactive) {
    $query .= "AND active = '1' ";
}
$query .= "ORDER BY username";
$res = sqlStatement($query);
for ($iter = 0; $row = sqlFetchArray($res); $iter++) {
    $result4[$iter] = $row;
}
foreach ($result4 as $iter) {
    if ($iter["authorized"]) {
        $iter["authorized"] = xl('yes');
    } else {
        $iter["authorized"] = "";
    }
    print "<tr height=20  class='text' style='border-bottom: 1px dashed;'>\n\t\t<td class='text'><b><a href='user_admin.php?id=" . $iter["id"] . "' class='iframe_medium' onclick='top.restoreSession()'><span>" . $iter["username"] . "</span></a></b>" . "&nbsp;</td>\n\t<td><span class='text'>" . attr($iter["fname"]) . ' ' . attr($iter["lname"]) . "</span>&nbsp;</td>\n\t<td><span class='text'>" . attr($iter["info"]) . "</span>&nbsp;</td>\n\t<td align='left'><span class='text'>" . $iter["authorized"] . "</span>&nbsp;</td>";
    print "<td><!--<a href='usergroup_admin.php?mode=delete&id=" . $iter["id"] . "' class='link_submit'>[Delete]</a>--></td>";
    print "</tr>\n";
}
?>
	</tbody></table>
<?php 
if (empty($GLOBALS['disable_non_default_groups'])) {
    $res = sqlStatement("select * from groups order by name");
    for ($iter = 0; $row = sqlFetchArray($res); $iter++) {
        $result5[$iter] = $row;
    }
    foreach ($result5 as $iter) {
        $grouplist[$iter["name"]] .= $iter["user"] . "(<a class='link_submit' href='usergroup_admin.php?mode=delete_group&id=" . $iter["id"] . "' onclick='top.restoreSession()'>Remove</a>), ";
    }
    foreach ($grouplist as $groupname => $list) {
Example #29
0
$field_id = 'cmsportal_login';
if (empty($ptrow[$field_id])) {
    if ($result['post']['user'] !== '') {
        // Registered in portal but still need to record that in openemr.
        echo "</table>\n";
        echo "<input type='hidden' name='form_{$field_id}' value='" . attr($result['post']['user']) . "' />\n";
    } else {
        // Portal registration is needed.
        $newvalue = isset($result['fields']['email']) ? trim($result['fields']['email']) : '';
        echo " <tr class='detail'>\n";
        echo "  <td class='bold' style='color:red;'>" . xlt('New Portal Login') . "</td>\n";
        echo "  <td>&nbsp;</td>\n";
        echo "  <td>";
        echo "<input type='text' name='form_{$field_id}' size='10' maxlength='60' value='" . attr($newvalue) . "' />";
        echo "&nbsp;&nbsp;" . xlt('Password') . ": ";
        echo "<input type='text' name='form_" . attr($field_id) . "_pass' size='10' maxlength='60' />";
        echo "<input type='button' value='" . xla('Generate') . "' onclick='randompass()' />";
        echo "</td>\n";
        echo " </tr>\n";
        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');
?>
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<?php 
html_header_show();
?>
<link rel='stylesheet' href="<?php 
echo $css_header;
?>
" type="text/css">
</head>
<body class="body_bottom">

<br/><br/><br/><span class="pwdalert <?php 
echo attr($case);
?>
">
<table align="center" >

  <tr valign="top">
    <td>&nbsp;</td>
    <td rowspan="3"><?php 
echo xlt("Welcome");
echo " " . text($username);
?>
,<br>
      <br>
      <?php 
echo text($msg_alert);
?>