示例#1
0
文件: report.php 项目: gidsil/openemr
function lbf_report($pid, $encounter, $cols, $id, $formname)
{
    require_once $GLOBALS["srcdir"] . "/options.inc.php";
    $arr = array();
    $shrow = getHistoryData($pid);
    $fres = sqlStatement("SELECT * FROM layout_options " . "WHERE form_id = ? AND uor > 0 " . "ORDER BY group_name, seq", array($formname));
    while ($frow = sqlFetchArray($fres)) {
        $field_id = $frow['field_id'];
        $currvalue = '';
        if ($frow['edit_options'] == 'H') {
            if (isset($shrow[$field_id])) {
                $currvalue = $shrow[$field_id];
            }
        } else {
            $currvalue = lbf_current_value($frow, $id, $encounter);
            if ($currvalue === FALSE) {
                continue;
            }
            // should not happen
        }
        // For brevity, skip fields without a value.
        if ($currvalue === '') {
            continue;
        }
        // $arr[$field_id] = $currvalue;
        // A previous change did this instead of the above, not sure if desirable? -- Rod
        $arr[$field_id] = wordwrap($currvalue, 30, "\n", true);
    }
    echo "<table>\n";
    display_layout_rows($formname, $arr);
    echo "</table>\n";
}
示例#2
0
 public function doPatientCheck(RsPatient $patient, $beginDate = null, $endDate = null, $options = null)
 {
     $return = false;
     if ($this->getOptionId() == self::TERMINAL_ILLNESS) {
         // TODO check for terminal illness
     } else {
         if ($this->getOptionId() == self::TOBACCO_USER) {
             $tobaccoHistory = getHistoryData($patient->id, "tobacco", $beginDate, $endDate);
             if (isset($tobaccoHistory['tobacco'])) {
                 $tmp = explode('|', $tobaccoHistory['tobacco']);
                 $tobaccoStatus = $tmp[1];
                 if ($tobaccoStatus == 'currenttobacco') {
                     $return = true;
                 } else {
                     if ($tobaccoStatus == 'quittobacco') {
                         $quitDate = $tmp[2];
                         if (strtotime($quitDate) > strtotime($beginDate)) {
                             $return = true;
                         }
                     }
                 }
             }
         } else {
             if ($this->getOptionId() == self::TOBACCO_NON_USER) {
                 $tobaccoHistory = getHistoryData($patient->id, "tobacco", $beginDate, $endDate);
                 if (isset($tobaccoHistory['tobacco'])) {
                     $tmp = explode('|', $tobaccoHistory['tobacco']);
                     $tobaccoStatus = $tmp[1];
                     if ($tobaccoStatus == 'quittobacco') {
                         $quitDate = $tmp[2];
                         if (strtotime($quitDate) < strtotime($beginDate)) {
                             $return = true;
                         }
                     } else {
                         if ($tobaccoStatus == 'nevertobacco') {
                             $return = true;
                         }
                     }
                 }
             }
         }
     }
     return $return;
 }
示例#3
0
<link rel="stylesheet" href="<?php 
echo $css_header;
?>
" type="text/css">
<link rel="stylesheet" href="../../acog.css" type="text/css">
<script language="JavaScript" src="../../acog.js" type="text/JavaScript"></script>
<script language="JavaScript" type="text/JavaScript">
  window.onload = initialize;
</script>
</head>
<?php 
$fres = sqlStatement("select * from patient_data where pid=" . $_SESSION["pid"]);
if ($fres) {
    $patient = sqlFetchArray($fres);
}
$history = getHistoryData($_SESSION["pid"]);
?>
<body class="body_top">

<form action="<?php 
echo $rootdir;
?>
/forms/plist/save.php?mode=new" method="post" enctype="multipart/form-data" name="my_form">
<?php 
include "../../acog_menu.inc";
?>
  <table width="70%"  border="0" cellspacing="0" cellpadding="4">
  <tr>
    <td width="120" align="left" valign="bottom" class="srvCaption">Patient name:</td>
    <td align="left" valign="bottom"><input name="pname" type="text" class="fullin" id="pname" value="<?php 
echo $patient['fname'] . ' ' . $patient['mname'] . ' ' . $patient['lname'];
/**
 * Function to check for existance of data for a patient in lifestyle section
 *
 * @param  string  $patient_id  pid of selected patient.
 * @param  string  $lifestyle   selected label of mysql column of patient history
 * @param  string  $status      specific status of selected lifestyle element
 * @param  string  $dateTarget  target date(format Y-m-d H:i:s). blank is current date.
 * @return boolean              true if check passed, otherwise false
 */
function exist_lifestyle_item($patient_id, $lifestyle, $status, $dateTarget)
{
    // Set date to current if not set
    $dateTarget = $dateTarget ? $dateTarget : date('Y-m-d H:i:s');
    // Collect pertinent history data
    $history = getHistoryData($patient_id, $lifestyle, '', $dateTarget);
    // See if match
    $stringFlag = strstr($history[$lifestyle], "|" . $status);
    if (empty($status)) {
        // Only ensuring any data has been entered into the field
        $stringFlag = true;
    }
    if ($history[$lifestyle] && $history[$lifestyle] != '|0|' && $stringFlag) {
        return true;
    } else {
        return false;
    }
}
示例#5
0
if (acl_check('patients', 'med')) {
    $tmp = getPatientData($pid, "squad");
    if ($tmp['squad'] && !acl_check('squads', $tmp['squad'])) {
        echo "<p>(" . htmlspecialchars(xl('History not authorized'), ENT_NOQUOTES) . ")</p>\n";
        echo "</body>\n</html>\n";
        exit;
    }
} else {
    echo "<p>(" . htmlspecialchars(xl('History not authorized'), ENT_NOQUOTES) . ")</p>\n";
    echo "</body>\n</html>\n";
    exit;
}
$result = getHistoryData($pid);
if (!is_array($result)) {
    newHistoryData($pid);
    $result = getHistoryData($pid);
}
?>

<?php 
if (acl_check('patients', 'med', '', array('write', 'addonly'))) {
    ?>
<div>
    <span class="title"><?php 
    echo htmlspecialchars(xl('Patient History / Lifestyle'), ENT_NOQUOTES);
    ?>
</span>
</div>
<div id='namecontainer_history' class='namecontainer_history' style='float:left;margin-right:10px'>
<?php 
    echo htmlspecialchars(xl('for'), ENT_NOQUOTES);
示例#6
0
    echo "document.location.href = 'list_requests.php';\n";
    echo "</script></body></html>\n";
    exit;
}
// Get the portal request data.
if (!$postid) {
    die(xlt('Request ID is missing!'));
}
$result = cms_portal_call(array('action' => 'getpost', 'postid' => $postid));
if ($result['errmsg']) {
    die(text($result['errmsg']));
}
// Look up the patient in OpenEMR.
$ptid = lookup_openemr_patient($result['post']['user']);
// Get patient's current history data in OpenEMR.
$hyrow = getHistoryData($ptid, "*");
?>
<html>
<head>
<?php 
html_header_show();
?>
<link rel=stylesheet href="<?php 
echo $css_header;
?>
" type="text/css">

<style type="text/css">@import url(../../library/dynarch_calendar.css);</style>
<style>

tr.head   { font-size:10pt; background-color:#cccccc; text-align:center; }
 } else {
     $xml_array['Patient']['demographics']['ethnicityvalue'] = '';
 }
 $p_insurance = getInsuranceData($p_id);
 $s_insurance = getInsuranceData($p_id, 'secondary');
 $o_insurance = getInsuranceData($p_id, 'tertiary');
 if ($p_insurance || $s_insurance) {
     $xml_array['Patient']['insurancelist']['status'] = 0;
     $xml_array['Patient']['insurancelist']['insuranceitem-1'] = $p_insurance;
     $xml_array['Patient']['insurancelist']['insuranceitem-2'] = $s_insurance;
     $xml_array['Patient']['insurancelist']['insuranceitem-3'] = $o_insurance;
 } else {
     $xml_array['Patient']['insurancelist']['status'] = 1;
     $xml_array['Patient']['insurancelist']['reason'] = 'No insurance data found';
 }
 $patient_hisory = getHistoryData($p_id);
 if ($patient_hisory) {
     $xml_array['Patient']['history']['status'] = 0;
     $xml_array['Patient']['history'] = $patient_hisory;
 } else {
     $xml_array['Patient']['history']['status'] = 1;
     $xml_array['Patient']['history']['reason'] = 'No history data found';
 }
 $list_data_mp = getListByType($p_id, 'medical_problem');
 if ($list_data_mp) {
     $xml_array['Patient']['problemlist']['status'] = 0;
     foreach ($list_data_mp as $key => $list_data1) {
         $xml_array['Patient']['problemlist']['problem-' . $key] = $list_data1;
         $diagnosis_title = getDrugTitle($list_data1['diagnosis'], $db);
         $xml_array['Patient']['problemlist']['problem-' . $key]['diagnosis_title'] = $diagnosis_title;
     }
示例#8
0
文件: new.php 项目: richsiy/openemr
<?php 
if (empty($is_lbf)) {
    $enrow = sqlQuery("SELECT p.fname, p.mname, p.lname, fe.date FROM " . "form_encounter AS fe, forms AS f, patient_data AS p WHERE " . "p.pid = '{$pid}' AND f.pid = '{$pid}' AND f.encounter = '{$encounter}' AND " . "f.formdir = 'newpatient' AND f.deleted = 0 AND " . "fe.id = f.form_id LIMIT 1");
    echo "<p class='title' style='margin-top:8px;margin-bottom:8px;text-align:center'>\n";
    echo "{$formtitle} " . xl('for') . ' ';
    echo $enrow['fname'] . ' ' . $enrow['mname'] . ' ' . $enrow['lname'];
    echo ' ' . htmlspecialchars(xl('on')) . ' ' . substr($enrow['date'], 0, 10);
    echo "</p>\n";
}
?>

<!-- This is where a chart might display. -->
<div id="chart"></div>

<?php 
$shrow = getHistoryData($pid);
$fres = sqlStatement("SELECT * FROM layout_options " . "WHERE form_id = '{$formname}' AND uor > 0 " . "ORDER BY group_name, seq");
$last_group = '';
$cell_count = 0;
$item_count = 0;
$display_style = 'block';
// This is an array keyed on forms.form_id for other occurrences of this
// form type.  The maximum number of such other occurrences to display is
// in list_options.option_value for this form's list item.  Values in this
// array are work areas for building the ending HTML for each displayed row.
//
$historical_ids = array();
// True if any data items in this form can be graphed.
$form_is_graphable = false;
while ($frow = sqlFetchArray($fres)) {
    $this_group = $frow['group_name'];
示例#9
0
    private function getIncudes($val)
    {
        global $pid;
        if ($val == "demographics") {
            ?>
	    <hr />
	    <div class='text demographics' id='DEM'>
	    <?php 
            // printRecDataOne($patient_data_array, getRecPatientData ($pid), $N);
            $result1 = getPatientData($pid);
            $result2 = getEmployerData($pid);
            ?>
	    <table>
	    <tr><td><h6><?php 
            echo htmlspecialchars(xl('Patient Data') . ":", ENT_QUOTES);
            ?>
</h6></td></tr>
	    <?php 
            display_layout_rows('DEM', $result1, $result2);
            ?>
	    </table>
	    </div>
	    <?php 
        } elseif ($val == "history") {
            ?>
	    <hr />
	    <div class='text history' id='HIS'>
		<?php 
            $result1 = getHistoryData($pid);
            ?>
		<table>
		<tr><td><h6><?php 
            echo htmlspecialchars(xl('History Data') . ":", ENT_QUOTES);
            ?>
</h6></td></tr>
		<?php 
            display_layout_rows('HIS', $result1);
            ?>
		</table>
		</div>
	<?php 
        } elseif ($val == "insurance") {
            ?>
	    <hr />
	    <div class='text insurance'>";
	    <h6><?php 
            echo htmlspecialchars(xl('Insurance Data') . ":", ENT_QUOTES);
            ?>
</h6>
	    <br><span class=bold><?php 
            echo htmlspecialchars(xl('Primary Insurance Data') . ":", ENT_QUOTES);
            ?>
</span><br>
	    <?php 
            printRecDataOne($insurance_data_array, getRecInsuranceData($pid, "primary"), $N);
            ?>
	    <span class=bold><?php 
            echo htmlspecialchars(xl('Secondary Insurance Data') . ":", ENT_QUOTES);
            ?>
</span><br>
	    <?php 
            printRecDataOne($insurance_data_array, getRecInsuranceData($pid, "secondary"), $N);
            ?>
	    <span class=bold><?php 
            echo htmlspecialchars(xl('Tertiary Insurance Data') . ":", ENT_QUOTES);
            ?>
</span><br>
	    <?php 
            printRecDataOne($insurance_data_array, getRecInsuranceData($pid, "tertiary"), $N);
            ?>
	    </div>
	    <?php 
        } elseif ($val == "billing") {
            ?>
	    <hr />
	    <div class='text billing'>
	    <h6><?php 
            echo htmlspecialchars(xl('Billing Information') . ":", ENT_QUOTES);
            ?>
</h6>
	    <?php 
            if (count($ar['newpatient']) > 0) {
                $billings = array();
                ?>
		<table>
		<tr><td width='400' class='bold'><?php 
                echo htmlspecialchars(xl('Code'), ENT_QUOTES);
                ?>
</td><td class='bold'><?php 
                echo htmlspecialchars(xl('Fee'), ENT_QUOTES);
                ?>
</td></tr>
		<?php 
                $total = 0.0;
                $copays = 0.0;
                foreach ($ar['newpatient'] as $be) {
                    $ta = split(":", $be);
                    $billing = getPatientBillingEncounter($pid, $ta[1]);
                    $billings[] = $billing;
                    foreach ($billing as $b) {
                        ?>
			<tr>
			<td class=text>
			<?php 
                        echo htmlspecialchars($b['code_type'], ENT_QUOTES) . ":\t" . htmlspecialchars($b['code'], ENT_QUOTES) . "&nbsp;" . htmlspecialchars($b['modifier'], ENT_QUOTES) . "&nbsp;&nbsp;&nbsp;" . htmlspecialchars($b['code_text'], ENT_QUOTES) . "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
                        ?>
			</td>
			<td class=text>
			<?php 
                        echo htmlspecialchars(oeFormatMoney($b['fee']), ENT_QUOTES);
                        ?>
			</td>
			</tr>
			<?php 
                        $total += $b['fee'];
                        if ($b['code_type'] == "COPAY") {
                            $copays += $b['fee'];
                        }
                    }
                }
                echo "<tr><td>&nbsp;</td></tr>";
                echo "<tr><td class=bold>" . htmlspecialchars(xl('Sub-Total'), ENT_QUOTES) . "</td><td class=text>" . htmlspecialchars(oeFormatMoney($total + abs($copays)), ENT_QUOTES) . "</td></tr>";
                echo "<tr><td class=bold>" . htmlspecialchars(xl('Paid'), ENT_QUOTES) . "</td><td class=text>" . htmlspecialchars(oeFormatMoney(abs($copays)), ENT_QUOTES) . "</td></tr>";
                echo "<tr><td class=bold>" . htmlspecialchars(xl('Total'), ENT_QUOTES) . "</td><td class=text>" . htmlspecialchars(oeFormatMoney($total), ENT_QUOTES) . "</td></tr>";
                echo "</table>";
                echo "<pre>";
                //print_r($billings);
                echo "</pre>";
            } else {
                printPatientBilling($pid);
            }
            echo "</div>\n";
            // end of billing DIV
        } elseif ($val == "immunizations") {
            ?>
		<hr />
		<div class='text immunizations'>
		<h6><?php 
            echo htmlspecialchars(xl('Patient Immunization') . ":", ENT_QUOTES);
            ?>
</h6>
		<?php 
            $sql = "select i1.immunization_id as immunization_id, if(i1.administered_date,concat(i1.administered_date,' - ') ,substring(i1.note,1,20) ) as immunization_data from immunizations i1 where i1.patient_id = ? order by administered_date desc";
            $result = sqlStatement($sql, array($pid));
            while ($row = sqlFetchArray($result)) {
                echo htmlspecialchars($row['immunization_data'], ENT_QUOTES);
                echo generate_display_field(array('data_type' => '1', 'list_id' => 'immunizations'), $row['immunization_id']);
                ?>
		      <br>
		    <?php 
            }
            ?>
		</div>
		<?php 
        } elseif ($val == "batchcom") {
            ?>
	    <hr />
	    <div class='text transactions'>
	    <h6><?php 
            htmlspecialchars(xl('Patient Communication sent') . ":", ENT_QUOTES);
            ?>
</h6>
	    <?php 
            $sql = "SELECT concat( 'Messsage Type: ', batchcom.msg_type, ', Message Subject: ', batchcom.msg_subject, ', Sent on:', batchcom.msg_date_sent ) AS batchcom_data, batchcom.msg_text, concat( users.fname, users.lname ) AS user_name FROM `batchcom` JOIN `users` ON users.id = batchcom.sent_by WHERE batchcom.patient_id=?";
            $result = sqlStatement($sql, array($pid));
            while ($row = sqlFetchArray($result)) {
                echo htmlspecialchars($row['batchcom_data'] . ", " . xl('By') . ": " . $row['user_name'], ENT_QUOTES);
                ?>
		<br><?php 
                echo htmlspecialchars(xl('Text'), ENT_QUOTES);
                ?>
:<br><?php 
                echo htmlspecialchars($row['msg_txt'], ENT_QUOTES);
                ?>
<br>
		<?php 
            }
            ?>
	    </div>
	    <?php 
        } elseif ($val == "notes") {
            ?>
	    <hr />
	    <div class='text notes'>
	    <h6><?php 
            echo htmlspecialchars(xl('Patient Notes') . ":", ENT_QUOTES);
            ?>
</h6>
	    <?php 
            printPatientNotes($pid);
            ?>
	    </div>
	    <?php 
        } elseif ($val == "transactions") {
            ?>
	    <hr />
	    <div class='text transactions'>
	    <h6><?php 
            echo htmlspecialchars(xl('Patient Transactions') . ":", ENT_QUOTES);
            ?>
</h6>
	    <?php 
            printPatientTransactions($pid);
            ?>
	    </div>
	    <?php 
        }
    }
示例#10
0
function issue_ippf_con_form($issue, $thispid)
{
    global $pprow, $item_count, $cell_count, $last_group;
    $shrow = getHistoryData($thispid);
    if ($issue) {
        $pprow = sqlQuery("SELECT * FROM lists_ippf_con WHERE id = '{$issue}'");
    } else {
        $pprow = array();
    }
    echo "<div id='ippf_con' style='display:none'>\n";
    $fres = sqlStatement("SELECT * FROM layout_options " . "WHERE form_id = 'CON' AND uor > 0 " . "ORDER BY group_name, seq");
    $last_group = '';
    $cell_count = 0;
    $item_count = 0;
    $display_style = 'block';
    while ($frow = sqlFetchArray($fres)) {
        $this_group = $frow['group_name'];
        $titlecols = $frow['titlecols'];
        $datacols = $frow['datacols'];
        $data_type = $frow['data_type'];
        $field_id = $frow['field_id'];
        $list_id = $frow['list_id'];
        $currvalue = '';
        if ($frow['edit_options'] == 'H') {
            // This data comes from static history
            if (isset($shrow[$field_id])) {
                $currvalue = $shrow[$field_id];
            }
        } else {
            if (isset($pprow[$field_id])) {
                $currvalue = $pprow[$field_id];
            }
        }
        // Handle a data category (group) change.
        if (strcmp($this_group, $last_group) != 0) {
            end_group();
            $group_seq = 'con' . substr($this_group, 0, 1);
            $group_name = substr($this_group, 1);
            $last_group = $this_group;
            echo "<br /><span class='bold'><input type='checkbox' name='form_cb_{$group_seq}' value='1' " . "onclick='return divclick(this,\"div_{$group_seq}\");'";
            if ($display_style == 'block') {
                echo " checked";
            }
            echo " /><b>{$group_name}</b></span>\n";
            echo "<div id='div_{$group_seq}' class='section' style='display:{$display_style};'>\n";
            echo " <table border='0' cellpadding='0' width='100%'>\n";
            $display_style = 'none';
        }
        // Handle starting of a new row.
        if ($titlecols > 0 && $cell_count >= $CPR || $cell_count == 0) {
            end_row();
            echo " <tr>";
        }
        if ($item_count == 0 && $titlecols == 0) {
            $titlecols = 1;
        }
        // Handle starting of a new label cell.
        if ($titlecols > 0) {
            end_cell();
            echo "<td valign='top' colspan='{$titlecols}' width='1%' nowrap";
            echo $frow['uor'] == 2 ? " class='required'" : " class='bold'";
            if ($cell_count == 2) {
                echo " style='padding-left:10pt'";
            }
            echo ">";
            $cell_count += $titlecols;
        }
        ++$item_count;
        echo "<b>";
        if ($frow['title']) {
            echo $frow['title'] . ":";
        } else {
            echo "&nbsp;";
        }
        echo "</b>";
        // Handle starting of a new data cell.
        if ($datacols > 0) {
            end_cell();
            echo "<td valign='top' colspan='{$datacols}' class='text'";
            if ($cell_count > 0) {
                echo " style='padding-left:5pt'";
            }
            echo ">";
            $cell_count += $datacols;
        }
        ++$item_count;
        if ($frow['edit_options'] == 'H') {
            echo generate_display_field($frow, $currvalue);
        } else {
            generate_form_field($frow, $currvalue);
        }
    }
    end_group();
    echo "</div>\n";
}
示例#11
0
     if (!empty($_POST['user']) && !empty($_POST['password']) && $_POST['user'] == "tom" && $_POST['password'] == "19880620") {
         $rst = getReleaseData();
         $html = "<table>";
         while ($row = $rst->fetch_object()) {
             $html .= "<tr><td>" . $row->pid . '</td><td>' . $row->time . '</td></tr>';
         }
         $html .= "</table>";
         echo $html;
         return;
     } else {
         echo '你的输入有误';
     }
 } else {
     if ($postOp == "seehistory") {
         if (!empty($_POST['user']) && !empty($_POST['password']) && $_POST['user'] == "andi" && $_POST['password'] == "andiisagirl") {
             $rst = getHistoryData();
             $html = "<table border=2 >";
             $isTH = false;
             while ($row = $rst->fetch_object()) {
                 if (!$isTH) {
                     $html .= "<tr>";
                     foreach ($row as $key => $val) {
                         $html .= '<th>' . $key . '</th>';
                     }
                     $html .= "</tr>";
                     $isTH = true;
                 }
                 $html .= "<tr>";
                 foreach ($row as $val) {
                     $html .= '<td>' . $val . '</td>';
                 }
示例#12
0
<?php

//laen funktsiooni faili
require_once "../functions.php";
require_once "../header.php";
//kontrollin, kas kasutaja ei ole sisseloginud
if (!isset($_SESSION["id_from_db"])) {
    header("Location: login.php");
}
//login välja
if (isset($_GET["logout"])) {
    session_destroy();
    header("Location: login.php");
}
$park_list = getParkData();
$game_php = getHistoryData();
?>





			<div class="parksinfo">
				<h1>ALL DISC GOLF PARKS</h1>
				<table class="center" border= 1>
					<tr>
						
						<th>Park name</th>
						<th>Number of baskets</th>
					</tr>