Exemple #1
0
 private function setInstructionsSection()
 {
     if (isset($this->encounter)) {
         $soap = $this->Encounter->getSoapByEid($this->encounter['eid']);
         $instructions = ['templateId' => ['@attributes' => ['root' => '2.16.840.1.113883.10.20.22.2.45']], 'code' => ['@attributes' => ['code' => '69730-0', 'codeSystem' => '2.16.840.1.113883.6.1', 'codeSystemName' => 'LOINC', 'displayName' => 'Instructions']], 'title' => 'Instructions', 'text' => $soap['instructions'], 'entry' => ['@attributes' => ['nullFlavor' => 'NA'], 'act' => ['@attributes' => ['classCode' => 'ACT', 'moodCode' => 'INT'], 'templateId' => ['@attributes' => ['root' => '2.16.840.1.113883.10.20.22.4.20']], 'code' => ['@attributes' => ['nullFlavor' => 'NA']], 'statusCode' => ['@attributes' => ['nullFlavor' => 'NA']]]]];
         $this->addSection(['section' => $instructions]);
     }
 }
Exemple #2
0
 public static function checkAnyEncounter(RsPatient $patient, $beginDate = null, $endDate = null, $options = null)
 {
     $encounters = Encounter::getEncounterTypes();
     foreach ($encounters as $encounter) {
         if (self::checkEncounter($encounter, $patient, $beginDate, $endDate, $options)) {
             return true;
         }
     }
     return false;
 }
Exemple #3
0
 public function createNewEmergency()
 {
     $patient = $this->patient->createNewPatientOnlyName('EMER');
     if ($patient['success']) {
         $this->pid = $patient['patient']['pid'];
         /**
          * send new patient to the emergency pool area
          */
         $params = new stdClass();
         $params->pid = $this->pid;
         $params->priority = $this->priority;
         $params->sendTo = 3;
         $this->poolArea->sendPatientToPoolArea($params);
         /**
          * create new encounter
          */
         $params = new stdClass();
         $params->pid = $this->pid;
         $params->brief_description = '***EMERGENCY***';
         $params->visit_category = 'Emergency';
         $params->priority = $this->priority;
         $params->service_date = Time::getLocalTime();
         $params->open_uid = $_SESSION['user']['id'];
         $encounter = $this->encounter->createEncounter($params);
         $this->eid = $encounter['encounter']['eid'];
         /**
          * log the emergency
          */
         $this->logEmergency();
         /*
          * update patient first name to EMERGENCY- encounter id
          */
         $data['fname'] = 'EMER-' . $this->emergencyId;
         $this->db->setSQL($this->db->sqlBind($data, 'patient', 'U', array('pid' => $this->pid)));
         $this->db->execOnly();
         return array('success' => true, 'emergency' => array('pid' => $this->pid, 'eid' => $this->eid, 'name' => 'EMER-' . $this->emergencyId, 'priority' => $params->priority));
     } else {
         return array('success' => false, 'error' => $patient['error']);
     }
 }
}
/* Load the visual signalling defined constants */
require_once $root_path . 'include/inc_visual_signalling_fx.php';
require_once $root_path . 'global_conf/inc_remoteservers_conf.php';
/* Retrieve the SIGNAL_COLOR_LEVEL_ZERO = for convenience purposes */
$z = SIGNAL_COLOR_LEVEL_ZERO;
/* Retrieve the SIGNAL_COLOR_LEVEL_FULL = for convenience purposes */
$f = SIGNAL_COLOR_LEVEL_FULL;
$HTTP_SESSION_VARS['sess_user_origin'] = 'nursing';
/* Create department object and load all medical depts */
require_once $root_path . 'include/care_api_classes/class_department.php';
$dept_obj = new Department();
$medical_depts = $dept_obj->getAllMedical();
/* Create encounter object */
require_once $root_path . 'include/care_api_classes/class_encounter.php';
$enc_obj = new Encounter();
/* Load global configs */
include_once $root_path . 'include/care_api_classes/class_globalconfig.php';
$GLOBAL_CONFIG = array();
$glob_obj = new GlobalConfig($GLOBAL_CONFIG);
$glob_obj->getConfig('patient_%');
/* Establish db connection */
if (!isset($db) || !$db) {
    include $root_path . 'include/inc_db_makelink.php';
}
if ($dblink_ok) {
    /* Load date formatter */
    include_once $root_path . 'include/inc_date_format_functions.php';
    $enc_obj->where = " encounter_nr={$pn}";
    if ($enc_obj->loadEncounterData($pn)) {
        /*			switch ($enc_obj->EncounterClass())
Exemple #5
0
error_reporting(E_COMPILE_ERROR | E_ERROR | E_CORE_ERROR);
require './roots.php';
require $root_path . 'include/inc_environment_global.php';
/**
* CARE2X Integrated Hospital Information System Deployment 2.1 - 2004-10-02
* GNU General Public License
* Copyright 2005 Robert Meggle based on the development of Elpidio Latorilla (2002,2003,2004,2005)
* elpidio@care2x.org, meggle@merotech.de
*
* See the file "copy_notice.txt" for the licence notice
*/
//define('NO_2LEVEL_CHK',1);
$thisfile = basename($_SERVER['PHP_SELF']);
$lang_tables[] = 'billing.php';
$lang_tables[] = 'aufnahme.php';
require $root_path . 'include/inc_front_chain_lang.php';
require $root_path . 'include/care_api_classes/class_person.php';
$person_obj = new Person();
require_once $root_path . 'include/care_api_classes/class_tz_insurance.php';
$insurance_tz = new Insurance_tz();
require_once $root_path . 'include/care_api_classes/class_encounter.php';
$enc_obj = new Encounter();
$hosp_address = $enc_obj->GetHospitalAddress();
$address_line = explode(",", $hosp_address);
$hosp_name = $address_line[0];
$hosp_address = $address_line[1];
$hosp_address_city = $address_line[2];
if ($mode == 'update') {
}
require "gui/gui_show_contract.php";
require_once $root_path . 'include/inc_front_chain_lang.php';
$thisfile = 'nursing-station-patientdaten-doconsil-patho.php';
$bgc1 = '#cde1ec';
//$konsil="patho";
$formtitle = $LDPathology;
$db_request_table = 'patho';
//$db->debug=1;
define('_BATCH_NR_INIT_', 20000000);
/*
*  The following are  batch nr inits for each type of test request
*   chemlabor = 10000000; patho = 20000000; baclabor = 30000000; blood = 40000000; generic = 50000000;
*/
/* Here begins the real work */
require_once $root_path . 'include/inc_date_format_functions.php';
require_once $root_path . 'include/care_api_classes/class_encounter.php';
$enc_obj = new Encounter();
/* Check for the patient number = $pn. If available get the patients data, otherwise set edit to 0 */
if (isset($pn) && $pn) {
    if ($enc_obj->loadEncounterData($pn)) {
        $full_en = $pn;
        if ($enc_obj->is_loaded) {
            $result =& $enc_obj->encounter;
        }
    } else {
        $edit = 0;
        $mode = '';
        $pn = '';
    }
}
if (!isset($mode)) {
    $mode = '';
$glob_obj->getConfig('pagin_patient_search_max_block_rows');
if (empty($GLOBAL_CONFIG['pagin_patient_search_max_block_rows'])) {
    $pagen->setMaxCount(MAX_BLOCK_ROWS);
} else {
    $pagen->setMaxCount($GLOBAL_CONFIG['pagin_patient_search_max_block_rows']);
}
if (($mode == 'search' || $mode == 'paginate') && !empty($searchkey)) {
    # Convert other wildcards
    $searchkey = strtr($searchkey, '*?', '%_');
    # Save the search keyword for eventual pagination routines
    if ($mode == 'search') {
        $_SESSION['sess_searchkey'] = $searchkey;
    }
    include_once $root_path . 'include/inc_date_format_functions.php';
    include_once $root_path . 'include/care_api_classes/class_encounter.php';
    $enc_obj = new Encounter();
    $encounter =& $enc_obj->searchLimitEncounterBasicInfo($searchkey, $pagen->MaxCount(), $pgx, $oitem, $odir);
    //echo $enc_obj->getLastQuery();
    # Get the resulting record count
    $linecount = $enc_obj->LastRecordCount();
    if ($linecount == 1 && $mode == 'search') {
        $row = $encounter->FetchRow();
        header("location:" . $root_path . "modules/nursing/nursing-station-patientdaten-doconsil-" . $target . ".php" . URL_REDIRECT_APPEND . "&pn=" . $row['encounter_nr'] . "&edit=1&status=" . $status . "&target=" . $target . "&user_origin=" . $user_origin . "&noresize=1&mode=");
        exit;
    }
    //$linecount=$address_obj->LastRecordCount();
    $pagen->setTotalBlockCount($linecount);
    # Count total available data
    if (isset($totalcount) && $totalcount) {
        $pagen->setTotalDataCount($totalcount);
    } else {
 function DisplayBillsInfo($bills, $view, $BGCOLOR)
 {
     global $db;
     $this->debug = false;
     $this->debug ? $db->debug = FALSE : ($db->debug = FALSE);
     $enc_obj = new Encounter();
     $bill_total = $this->DisplayArchivedBillAmount($bills['nr']);
     echo '<tr class="tr_content">';
     if ($view == "month") {
         echo '<td ' . $BGCOLOR . ' class="td_content"><div align="center" ><a href="billing_tz_archive.php?displaybill=true&bill_nr=' . $bills['nr'] . '&batch_nr=' . $bills['pid'] . '">' . $bills['nr'] . '</a></div></td>';
     } else {
         echo '<td ' . $BGCOLOR . ' class="td_content"><div align="center" ><a href="billing_tz_archive_date.php?displaybill=true&bill_nr=' . $bills['nr'] . '&batch_nr=' . $bills['pid'] . '">' . $bills['nr'] . '</a></div></td>';
     }
     echo '<td ' . $BGCOLOR . 'class="td_content"><div align="center" >' . date("j F Y", $bills['date_change']) . '</div></td>';
     echo '<td ' . $BGCOLOR . 'class="td_content"><div align="center" >' . $bill_total . '</div> </td>';
     echo '<td ' . $BGCOLOR . ' class="td_content"><div align="center" >' . $bills['selian_pid'] . '</div></td>';
     echo '<td ' . $BGCOLOR . ' class="td_content"><div align="center" >' . $enc_obj->ShowPID($bills['pid']) . '</div></td>';
     echo '<td ' . $BGCOLOR . 'class="td_content"><div align="center" >' . $bills['User_Id'] . '</div> </td>';
     echo '</tr>';
     return $bill_total;
 }
define('LANG_FILE', 'radio.php');
define('NO_2LEVEL_CHK', 1);
require_once $root_path . 'include/inc_front_chain_lang.php';
$thisfile = basename($_SERVER['PHP_SELF']);
if ($mode == 'search' && !empty($sk)) {
    if (!isset($db) || !$db) {
        include_once $root_path . 'include/inc_db_makelink.php';
    }
    if ($dblink_ok) {
        /* Load date formatter */
        include_once $root_path . 'include/inc_date_format_functions.php';
    } else {
        echo "{$LDDbNoLink}<br>";
    }
    include_once $root_path . 'include/care_api_classes/class_encounter.php';
    $enc_obj = new Encounter();
    $result = $enc_obj->searchEncounterBasicInfo($sk);
    include_once $root_path . 'include/care_api_classes/class_globalconfig.php';
    $GLOBAL_CONFIG = array();
    $glob_obj = new GlobalConfig($GLOBAL_CONFIG);
    $glob_obj->getConfig('patient_%');
}
html_rtl($lang);
?>
<head>
<?php 
echo setCharSet();
?>

 <style type="text/css" name="s2">
.v12{ font-family:verdana,arial; color:#000000; font-size:12;}
Exemple #10
0
//if(!isset($is_discharged)) $is_discharged=true;
if (!isset($edit)) {
    $edit = false;
}
# Check if person is currently admitted
$current_encounter = $person_obj->CurrentEncounter($pid);
if ($_SESSION['sess_parent_mod'] == 'admission') {
    # Resolve the encounter number
    if ((!isset($encounter_nr) || !$encounter_nr) && $_SESSION['sess_en']) {
        $encounter_nr = $_SESSION['sess_en'];
    } elseif (isset($encounter_nr) && $encounter_nr && !$_SESSION['sess_en']) {
        $_SESSION['sess_en'] = $encounter_nr;
    }
    $parent_admit = true;
    $page_title = $LDAdmission;
    # Get the overall status
    include_once $root_path . 'include/care_api_classes/class_encounter.php';
    $enc_obj = new Encounter();
    if ($stat =& $enc_obj->AllStatus($_SESSION['sess_en'])) {
        $enc_status = $stat->FetchRow();
    }
    # If current_encounter is this encounter nr
    if ($current_encounter == $_SESSION['sess_en']) {
        $is_discharged = false;
        $edit = true;
    }
    //echo " curr $current_encounter this ".$_SESSION['sess_en'];
} else {
    $parent_admit = false;
    $page_title = $LDPatientRegister;
}
$lang_tables[] = 'prompt.php';
define('LANG_FILE', 'nursing.php');
$local_user = '******';
require_once $root_path . 'include/inc_front_chain_lang.php';
if (!$encoder) {
    $encoder = $_SESSION['sess_user_name'];
}
//$breakfile="amb_clinic_patients.php".URL_APPEND."&edit=$edit&dept_nr=$dept_nr";
$breakfile = "javascript:window.close();";
//if($backpath) $breakfile=urldecode($backpath).URL_APPEND;
$thisfile = basename($_SERVER['PHP_SELF']);
# Load date formatter
require_once $root_path . 'include/inc_date_format_functions.php';
require_once $root_path . 'include/care_api_classes/class_encounter.php';
require_once $root_path . 'include/care_api_classes/class_tz_diagnostics.php';
$enc_obj = new Encounter();
if ($enc_obj->loadEncounterData($pn)) {
    //$db->debug=1;
    if ($mode == 'release' && !(isset($lock) || $lock)) {
        $date = empty($x_date) ? date('Y-m-d') : formatDate2STD($x_date, $date_format);
        $time = empty($x_time) ? date('H:i:s') : convertTimeToStandard($x_time);
        # Check the discharge type
        switch ($relart) {
            case 8:
                if ($released = $enc_obj->DischargeFromDept($pn, $relart, $date, $time)) {
                    # Reset current department
                    //$enc_obj->ResetAllCurrentPlaces($pn,0);
                }
                break;
            default:
                $released = $enc_obj->Discharge($pn, $relart, $date, $time);
//define('LANG_FILE','billing.php');
$lang_tables[] = 'billing.php';
$lang_tables[] = 'aufnahme.php';
//include($root_path.'include/inc_load_lang_tables.php');
require $root_path . 'include/inc_front_chain_lang.php';
require_once $root_path . 'include/care_api_classes/class_encounter.php';
require_once $root_path . 'include/care_api_classes/class_person.php';
require_once $root_path . 'include/care_api_classes/class_tz_billing.php';
//$billing_tz = new Bill();
require_once $root_path . 'include/care_api_classes/class_tz_insurance.php';
//$insurance_tz = new Insurance_tz();
require_once $root_path . 'include/care_api_classes/class_tz_drugsandservices.php';
//require_once($root_path.'include/care_api_classes/class_tz_insurance_reports.php');
//$insurance_tz_report = new Insurance_Reports_tz();
$per_obj = new Person();
$enc_obj = new Encounter();
$bill_obj = new Bill();
$insurance_obj = new Insurance_tz();
$drg_obj = new DrugsAndServices();
global $company_id;
$user_origin = 'quotation';
$clear_bill = $_POST['clear_bill'];
$balance = $_POST['balance'];
$debug = FALSE;
$debug ? $db->debug = TRUE : ($db->debug = FALSE);
if ($debug) {
    echo "task:" . $task . "<br>";
}
$IS_PATIENT_INSURED = $insurance_obj->is_patient_insured($pid);
//$enc_obj->LoadEncounterData();
//$IS_PATIENT_INSURED=$insurance_obj->is_patient_insured($enc_obj->ShowPID($bat_nr));
* CARE2X Integrated Hospital Information System beta 2.0.1 - 2004-07-04
* GNU General Public License
* Copyright 2002,2003,2004,2005 Elpidio Latorilla
* elpidio@care2x.org, 
*
* See the file "copy_notice.txt" for the licence notice
*/
$thisfile = basename($_SERVER['PHP_SELF']);
if (!isset($mode)) {
    $mode = 'show';
}
require './include/init_show.php';
# Get all encounter records  of this person
$list_obj =& $person_obj->EncounterList($pid);
$rows = $person_obj->LastRecordCount();
//echo $obj->getLastQuery();
# Create encounter object
require_once $root_path . 'include/care_api_classes/class_encounter.php';
$enc_obj = new Encounter();
# Get all encounter classes & load in array
if ($eclass_obj = $enc_obj->AllEncounterClassesObject()) {
    while ($ec_row = $eclass_obj->FetchRow()) {
        $enc_class[$ec_row['class_nr']] = $ec_row;
    }
}
$subtitle = $LDListEncounters;
$_SESSION['sess_file_return'] = $thisfile;
$buffer = str_replace('~tag~', $title . ' ' . $name_last, $LDNoRecordFor);
$norecordyet = str_replace('~obj~', strtolower($subtitle), $buffer);
/* Load GUI page */
require './gui_bridge/default/gui_show.php';
            break;
        case 'ward_mng':
            $breakfile = 'nursing-station-info.php' . URL_APPEND . '&ward_nr=' . $ward_nr . '&mode=show';
            break;
        case 'billing':
            $breakfile = '../modules/billing_tz/billing_tz_pending.php' . URL_APPEND;
    }
}
# Mark where we are
$_SESSION['sess_user_origin'] = 'amb';
# Load date formatter
require_once $root_path . 'include/inc_date_format_functions.php';
if ($mode == '' || $mode == 'fresh') {
    # Create encounter object
    include_once $root_path . 'include/care_api_classes/class_encounter.php';
    $enc_obj = new Encounter();
    # Get all outpatients for this dept
    if ($sort == '') {
        $sort = 'name_last';
    }
    $opat_obj =& $enc_obj->OutPatientsBasic($sort, false);
    //echo $enc_obj->getLastQuery();
    $rows = $enc_obj->LastRecordCount();
    /*
    # If dept name is empty, fetch by location nr
    if(!isset($dept)||empty($dept)){
    	# Create department object
    	include_once($root_path.'include/care_api_classes/class_department.php');
    	$dept_obj= new Department;
    	$deptLDvar=$dept_obj->LDvar($dept_nr);
    	if(isset($$deptLDvar)&&!empty($$deptLDvar)) $dept=$$deptLDvar;
}
require_once $root_path . 'include/inc_front_chain_lang.php';
/**
 * LOAD Smarty
 */
# Note: it is advisable to load this after the inc_front_chain_lang.php so
# that the smarty script can use the user configured template theme
require_once $root_path . 'gui/smarty_template/smarty_care.class.php';
$smarty = new smarty_care('nursing');
$thisfile = basename($_SERVER['PHP_SELF']);
$db_request_table = $target;
//$db->debug=1;
/* Check for the patietn number = $pn. If available get the patients data, */
if (isset($pn) && $pn) {
    include_once $root_path . 'include/care_api_classes/class_encounter.php';
    $enc_obj = new Encounter();
    if ($enc_obj->loadEncounterData($pn)) {
        $edit = true;
        include_once $root_path . 'include/care_api_classes/class_globalconfig.php';
        $GLOBAL_CONFIG = array();
        $glob_obj = new GlobalConfig($GLOBAL_CONFIG);
        $glob_obj->getConfig('patient_%');
        switch ($enc_obj->EncounterClass()) {
            case '1':
                $full_en = $pn + $GLOBAL_CONFIG['patient_inpatient_nr_adder'];
                break;
            case '2':
                $full_en = $pn + $GLOBAL_CONFIG['patient_outpatient_nr_adder'];
                break;
            default:
                $full_en = $pn + $GLOBAL_CONFIG['patient_inpatient_nr_adder'];
$lang_tables[] = 'prompt.php';
$lang_tables[] = 'person.php';
$lang_tables[] = 'departments.php';
define('LANG_FILE', 'aufnahme.php');
$local_user = '******';
require_once $root_path . 'include/inc_front_chain_lang.php';
require_once $root_path . 'include/care_api_classes/class_encounter.php';
require_once $root_path . 'include/care_api_classes/class_person.php';
require_once $root_path . 'include/care_api_classes/class_insurance.php';
require_once $root_path . 'include/care_api_classes/class_ward.php';
require_once $root_path . 'include/care_api_classes/class_globalconfig.php';
if (!$_SESSION['sess_parent_mod']) {
    $_SESSION['sess_parent_mod'];
}
# Create objects
$encounter_obj = new Encounter($encounter_nr);
$person_obj = new Person();
$insurance_obj = new Insurance();
$thisfile = basename($_SERVER['PHP_SELF']);
if ($_COOKIE['ck_login_logged' . $sid]) {
    $breakfile = $root_path . 'modules/news/start_page.php' . URL_APPEND;
} else {
    $breakfile = 'aufnahme_pass.php' . URL_APPEND . '&target=entry';
}
//$breakfile='aufnahme_pass.php'.URL_APPEND;
$GLOBAL_CONFIG = array();
$glob_obj = new GlobalConfig($GLOBAL_CONFIG);
/* Get the patient global configs */
$glob_obj->getConfig('patient_%');
$glob_obj->getConfig('person_foto_path');
$updatefile = 'aufnahme_start.php';
            if ($debug) {
                echo "User Origin is {$user_origin} and Breakfile is " . $breakfile . "<br>";
            }
        }
    }
}
$bgc1 = '#ffffff';
$edit = 1;
/* Assume to edit first */
$formtitle = $LDRadiologyDiagnostics;
$dept_nr = 19;
// 19 = department nr. of radiology
$db_request_table = $subtarget;
//$db->debug=1;
require_once $root_path . 'include/care_api_classes/class_encounter.php';
$enc_obj = new Encounter();
/* Here begins the real work */
require_once $root_path . 'include/inc_date_format_functions.php';
/* Check for the patient number = $pn. If available get the patients data, otherwise set edit to 0 */
if (isset($pn) && $pn) {
    if ($enc_obj->loadEncounterData($pn)) {
        include_once $root_path . 'include/care_api_classes/class_globalconfig.php';
        $GLOBAL_CONFIG = array();
        $glob_obj = new GlobalConfig($GLOBAL_CONFIG);
        $glob_obj->getConfig('patient_%');
        switch ($enc_obj->EncounterClass()) {
            case '1':
                $full_en = $pn + $GLOBAL_CONFIG['patient_inpatient_nr_adder'];
                break;
            case '2':
                $full_en = $pn + $GLOBAL_CONFIG['patient_outpatient_nr_adder'];
* See the file "copy_notice.txt" for the licence notice
*/
define('LANG_FILE', 'prompt.php');
define('NO_2LEVEL_CHK', 1);
$local_user = '******';
require_once $root_path . 'include/inc_front_chain_lang.php';
if (empty($_COOKIE[$local_user . $sid])) {
    $edit = 0;
    include $root_path . "language/" . $lang . "/lang_" . $lang . "_" . LANG_FILE;
}
$fileappend = "&dept_nr={$dept_nr}&edit={$edit}&mode=&pday={$pday}&pmonth={$pmonth}&pyear={$pyear}&station={$station}";
$breakfile = "location:amb_clinic_patients.php" . URL_APPEND . $fileappend;
$forwardfile = "location:amb_clinic_patients.php" . URL_REDIRECT_APPEND . $fileappend;
# Create ward object
require_once $root_path . 'include/care_api_classes/class_encounter.php';
$enc_obj = new Encounter();
if (isset($mode) && $mode == 'transferdept') {
    $date = date('Y-m-d');
    $time = date('H:i:s');
    # first discharge from current dept
    //echo "discharing patient $pn<br>";
    if ($enc_obj->DischargeFromDept($pn, 8, $date, $time)) {
        # discharge type nr 8 = change of department
        # Now we set new dept
        //echo "Patient dischared!<br> Now  $pn going to $tgt_nr  ";
        if ($enc_obj->setCurrentDept($pn, $tgt_nr)) {
            header($forwardfile);
            exit;
        }
        //echo "setCurrentDept person failed<br>";exit();
    }
Exemple #19
0
*
* See the file "copy_notice.txt" for the licence notice
*/
//$lang_tables[]='startframe.php';
$lang_tables[] = 'person.php';
$lang_tables[] = 'departments.php';
define('LANG_FILE', 'aufnahme.php');
//define('NO_2LEVEL_CHK',1);
//define('NO_CHAIN',TRUE);
$local_user = '******';
require_once $root_path . 'include/inc_front_chain_lang.php';
require_once $root_path . 'include/inc_date_format_functions.php';
require_once $root_path . 'include/care_api_classes/class_encounter.php';
include_once $root_path . 'include/inc_t1ps_ar2uni.php';
# Get the encouter data
$enc_obj = new Encounter($enc);
if ($enc_obj->loadEncounterData()) {
    $encounter = $enc_obj->getLoadedEncounterData();
    //extract($encounter);
}
# Fetch insurance and encounter classes
$encounter_class = $enc_obj->getEncounterClassInfo($encounter['encounter_class_nr']);
$insurance_class = $enc_obj->getInsuranceClassInfo($encounter['insurance_class_nr']);
# Resolve the encounter class name
if (isset(${$encounter_class}['LD_var']) && !empty(${$encounter_class}['LD_var'])) {
    $eclass = ${$encounter_class}['LD_var'];
} else {
    $eclass = $encounter_class['name'];
}
# Resolve the insurance class name
if (isset(${$insurance_class}['LD_var']) && !empty(${$insurance_class}['LD_var'])) {
 */
$debug = false;
$debug ? $db->debug = TRUE : ($db->debug = FALSE);
/* Here begins the real work */
require_once $root_path . 'include/inc_date_format_functions.php';
# Create a core object
//require_once($root_path.'include/inc_front_chain_lang.php');
$core = new Core();
/* Check for the patient number = $pn. If available get the patients data, otherwise set edit to 0 */
if (isset($pn) && $pn) {
    $sql = 'SELECT current_dept_nr FROM care_encounter WHERE encounter_nr=' . $pn;
    $result = $db->Execute($sql);
    $row = $result->FetchRow();
    $dept_nr = $row['current_dept_nr'];
    include_once $root_path . 'include/care_api_classes/class_encounter.php';
    $enc_obj = new Encounter();
    if ($enc_obj->loadEncounterData($pn)) {
        /*
        include_once($root_path.'include/care_api_classes/class_globalconfig.php');
        $GLOBAL_CONFIG=array();
        $glob_obj=new GlobalConfig($GLOBAL_CONFIG);
        $glob_obj->getConfig('patient_%');
        switch ($enc_obj->EncounterClass())
        {
        case '1': $full_en = ($pn + $GLOBAL_CONFIG['patient_inpatient_nr_adder']);
        break;
        case '2': $full_en = ($pn + $GLOBAL_CONFIG['patient_outpatient_nr_adder']);
        break;
        default: $full_en = ($pn + $GLOBAL_CONFIG['patient_inpatient_nr_adder']);
        }
        */
require_once $root_path . 'include/inc_date_format_functions.php';
$datum = date('Y-m-d');
$zeit = date('H:m:s');
$toggler = 0;
// init sql dbase
$dbtable = 'care_admission_patient';
$fieldname = array($LDPatListElements[4], $LDLastName, $LDName, $LDBirthDate);
if (!isset($searchkey)) {
    $searchkey = '';
}
if (!isset($mode)) {
    $mode = '';
}
if (isset($mode) && $mode == 'search' && !empty($searchkey)) {
    include_once $root_path . 'include/care_api_classes/class_encounter.php';
    $enc_obj = new Encounter();
    $admission = $enc_obj->searchInpatientNotInWardBasicInfo($searchkey);
    include_once $root_path . 'include/care_api_classes/class_globalconfig.php';
    $GLOBAL_CONFIG = array();
    $glob_obj = new GlobalConfig($GLOBAL_CONFIG);
    $glob_obj->getConfig('patient_%');
}
# Start Smarty templating here
/**
 * LOAD Smarty
 */
# Note: it is advisable to load this after the inc_front_chain_lang.php so
# that the smarty script can use the user configured template theme
require_once $root_path . 'gui/smarty_template/smarty_care.class.php';
$smarty = new smarty_care('nursing');
# Title in toolbar
            while ($buf = $patients_obj->FetchRow()) {
                $patient[$buf['room_nr']][$buf['bed_nr']] = $buf;
            }
            $patients_ok = true;
        } else {
            $patients_ok = false;
        }
        $ward_ok = true;
        # Load global person photo source path
        include_once $root_path . 'include/care_api_classes/class_globalconfig.php';
        $GLOBAL_CONFIG = array();
        $glob_obj = new GlobalConfig($GLOBAL_CONFIG);
        $glob_obj->getConfig('person_foto_path');
        $photo_path = is_dir($root_path . $GLOBAL_CONFIG['person_foto_path']) ? $GLOBAL_CONFIG['person_foto_path'] : $default_photo_path;
        #Create encounter object and load encounter info
        $enc_obj = new Encounter($pn);
        $enc_obj->loadEncounterData();
        if ($enc_obj->is_loaded) {
            $encounter =& $enc_obj->encounter;
        }
        # Set the foto filename
        $photo_filename = $encounter['photo_filename'];
        /* Prepare the photo filename */
        require_once $root_path . 'include/inc_photo_filename_resolve.php';
        # Get billing type
        $billing_type =& $enc_obj->getInsuranceClassInfo($encounter['insurance_class_nr']);
    } else {
        $ward_ok = false;
    }
}
if (isset($transfer) && $transfer) {
Exemple #23
0
 $v->byte_count += $parser->getBytes();
 if ($v->line % 100000 == 0) {
     $params['milestone'][] = $v->byte_count;
 }
 //Check if time rolled over.
 $v->ts = $parser->getSeconds();
 if ($v->ts < $v->ts_last) {
     $v->date += 86400;
 }
 $v->timestamp = $v->date + ($v->ts_last = $v->ts);
 //We want to see if this is a permitted action to start combat.
 $is_action = in_array($parser->type_id, $v->combat_actions);
 //Starting condition to get us in combat.
 if (!$v->combat && $is_action) {
     $v->combat = true;
     $encounter = new Encounter($v->timestamp, $v->line, $encounter, $v->killed_bosses);
 }
 //Handle mid-combat events.
 if ($v->combat) {
     if ($is_action && $encounter->actor($parser)) {
         $encounter->last_active = $v->timestamp;
         $encounter->last_line = $v->line;
         continue;
     }
     //Somebody died!
     if ($parser->type_id == 11) {
         $encounter->kill($parser->target_id);
     } elseif ($parser->type_id == 12) {
         $encounter->kill($parser->origin_id);
     }
     //Hostile action didn't happen, check for expiration of combat.
 }
 if (!$GLOBAL_CONFIG['patient_service_att_dr_hide']) {
     /* Get the attending doctor service classes */
     $att_dr_service = $encounter_obj->AllAttDrServiceClassesObject();
 }
 /* Check whether config path exists, else use default path */
 $photo_path = is_dir($root_path . $GLOBAL_CONFIG['person_foto_path']) ? $GLOBAL_CONFIG['person_foto_path'] : $default_photo_path;
 if ($pid) {
     if (isset($transFromOutp)) {
         //echo 'transFrom Outpatient';
         if ($encoder == '') {
             $encoder = $_SESSION['sess_user_name'];
         }
         # Load date formatter
         require_once $root_path . 'include/care_api_classes/class_encounter.php';
         $enc_obj = new Encounter();
         $pn = $_GET['pn'];
         if ($encounter_obj->loadEncounterData($pn)) {
             //$db->debug=1;
             $date = empty($x_date) ? date('Y-m-d') : formatDate2STD($x_date, $date_format);
             $time = empty($x_time) ? date('H:i:s') : convertTimeToStandard($x_time);
             # Check the discharge type
             if ($enc_obj->DischargeFromDeptForAdmission($pn, 8, $date, $time)) {
                 //echo 'discharge has been successfull';
             } else {
                 echo 'couldn\'t discharge outpatient';
             }
         } else {
             echo 'could not load encounter data';
         }
     } else {
    if ($_POST['prescribe_date']) {
        $_POST['prescribe_date'] = @formatDate2STD($_POST['prescribe_date'], $date_format);
    } else {
        $_POST['prescribe_date'] = date('Y-m-d');
    }
    $_POST['create_id'] = $_SESSION['sess_user_name'];
    //$db->debug=true;
    // Insert the prescription without other checks into the database. This should be dony be the doctor and
    // there was the requirement that there should be no restrictions given...
    //include('./include/save_admission_data.inc.php');
    include './include/save_prescription_data.inc.php';
}
/* For external call, there is no encounter number given. This can be determined if we have the encounter no in the $pn variable */
if (isset($pn)) {
    require_once $root_path . 'include/care_api_classes/class_encounter.php';
    $encounter_obj = new Encounter($pn);
    $pid = $encounter_obj->EncounterExists($pn);
    $_SESSION['sess_pid'] = $pid;
    $_SESSION['sess_en'] = $pn;
}
require './include/init_show.php';
if ($parent_admit) {
    if ($glob_obj->getConfigValue("restrict_unbilled_items") === "1" && $externalcall) {
        $sql = "SELECT pr.*, e.encounter_class_nr FROM care_encounter AS e, care_person AS p," . "care_encounter_prescription AS pr, care_tz_drugsandservices as service\r\n\t\tWHERE p.pid=" . $_SESSION['sess_pid'] . "\r\n\t\t\tAND p.pid=e.pid\r\n\t\t\tAND e.encounter_nr=" . $_SESSION['sess_en'] . "\r\n\t\t\tAND e.encounter_nr=pr.encounter_nr\r\n\t\t\tAND pr.prescribe_date = '" . $prescription_date . "'\r\n\t\t\tAND service.item_id=pr.article_item_number\r\n\t\t\tAND service.is_labtest=0\r\n                        AND (pr.bill_number >'0' OR e.encounter_class_nr = '1')\r\n\t\tORDER BY pr.modify_time DESC";
    } else {
        $sql = "SELECT pr.*, e.encounter_class_nr FROM care_encounter AS e, care_person AS p," . "care_encounter_prescription AS pr, care_tz_drugsandservices as service\r\n\t\tWHERE p.pid=" . $_SESSION['sess_pid'] . "\r\n\t\t\tAND p.pid=e.pid\r\n\t\t\tAND e.encounter_nr=" . $_SESSION['sess_en'] . "\r\n\t\t\tAND e.encounter_nr=pr.encounter_nr\r\n\t\t\tAND pr.prescribe_date = '" . $prescription_date . "'\r\n\t\t\tAND service.item_id=pr.article_item_number\r\n\t\t\tAND service.is_labtest=0\r\n\t\tORDER BY pr.modify_time DESC";
    }
} else {
    if ($ShowOnlyPharmacy) {
        if ($glob_obj->getConfigValue("restrict_unbilled_items") === "1" && $externalcall) {
            $sql = "SELECT pr.*, e.encounter_class_nr FROM care_encounter AS e, care_person AS p, care_encounter_prescription AS pr, care_tz_drugsandservices\r\n\t\t  WHERE p.pid=" . $_SESSION['sess_pid'] . " AND p.pid=e.pid AND e.encounter_nr=pr.encounter_nr \r\n                      AND pr.article_item_number=care_tz_drugsandservices.item_id \r\n                      AND (pr.bill_number > '0'  OR e.encounter_class_nr = '1') \r\n                      AND ( purchasing_class = 'drug_list' \r\n                      OR purchasing_class ='supplies' OR purchasing_class ='dental' OR purchasing_class ='special_others_list' \r\n                      OR purchasing_class ='drug_list_ctc' OR purchasing_class='drug_list_nhif')\r\n\t\t  ORDER BY pr.modify_time DESC";
Exemple #26
0
}
require_once $root_path . 'include/care_api_classes/class_globalconfig.php';
$glob_obj = new GlobalConfig($GLOBAL_CONFIG);
$glob_obj->getConfig('patient%');
$glob_obj->getConfig('person%');
$thisfile = basename($_SERVER['PHP_SELF']);
$breakfile = 'patient.php';
$newdata = 1;
$target = 'archiv';
if (!isset($rows) || !$rows) {
    require_once $root_path . 'include/care_api_classes/class_encounter.php';
    require_once $root_path . 'include/care_api_classes/class_ward.php';
    include_once $root_path . 'include/care_api_classes/class_insurance.php';
    require_once $root_path . 'include/care_api_classes/class_department.php';
    # Create encounter object
    $encounter_obj = new Encounter();
    # Load the wards info
    $ward_obj = new Ward();
    $items = 'nr,name';
    $ward_info =& $ward_obj->getAllWardsItemsObject($items);
    # Load the departments info
    $dept_obj = new Department();
    $medical_depts = $dept_obj->getAllMedical();
    # Get all encounter classes
    $encounter_classes = $encounter_obj->AllEncounterClassesObject();
    # Get the insurance classes */
    # Create new person�s insurance object */
    $insurance_obj = new Insurance();
    $insurance_classes =& $insurance_obj->getInsuranceClassInfoObject('class_nr,LD_var,name');
    /* Load the discharge types */
    $discharge_types =& $encounter_obj->getDischargeTypesData();
} else {
    $local_user = '******';
    $breakfile = $root_path . 'modules/laboratory/labor_datalist_noedit.php' . URL_APPEND . '&pn=' . $encounter_nr . '&user_origin=' . $user_origin . '&edit=' . $edit;
}
if (!$_COOKIE[$local_user . $sid]) {
    header("location:" . $root_path . "language/" . $lang . "/lang_" . $lang . "_invalid-access-warning.php");
    exit;
}
if (!$encounter_nr) {
    header("location:" . $root_path . "modules/laboratory/labor_data_patient_such.php?sid={$sid}&lang={$lang}");
}
require_once $root_path . 'include/inc_config_color.php';
$thisfile = basename($_SERVER['PHP_SELF']);
/* Create encounter object */
require_once $root_path . 'include/care_api_classes/class_lab.php';
$enc_obj = new Encounter($encounter_nr);
$lab_obj = new Lab($encounter_nr);
//gjergji :
//diff for the date of birth
function dateDiff($dformat, $endDate, $beginDate)
{
    $date_parts1 = explode($dformat, $beginDate);
    $date_parts2 = explode($dformat, $endDate);
    $start_date = gregoriantojd($date_parts1[1], $date_parts1[2], $date_parts1[0]);
    $end_date = gregoriantojd($date_parts2[1], $date_parts2[2], $date_parts2[0]);
    return $end_date - $start_date;
}
//gjergji
//display the median values
function medianValue($paramValue, $pName)
{
Exemple #28
0
 # Get the max nr of rows from global config
 $glob_obj->getConfig('pagin_patient_search_max_block_rows');
 if (empty($GLOBAL_CONFIG['pagin_patient_search_max_block_rows'])) {
     $pagen->setMaxCount(MAX_BLOCK_ROWS);
 } else {
     $pagen->setMaxCount($GLOBAL_CONFIG['pagin_patient_search_max_block_rows']);
 }
 # Convert other wildcards
 $searchkey = strtr($searchkey, '*?', '%_');
 # Save the search keyword for eventual pagination routines
 if ($mode == 'search') {
     $_SESSION['sess_searchkey'] = $searchkey;
 }
 include_once $root_path . 'include/inc_date_format_functions.php';
 include_once $root_path . 'include/care_api_classes/class_encounter.php';
 $enc_obj = new Encounter();
 $encounter =& $enc_obj->searchLimitEncounterBasicInfo($searchkey, $pagen->MaxCount(), $pgx, $oitem, $odir);
 //echo $enc_obj->getLastQuery();
 # Get the resulting record count
 $rows = $enc_obj->LastRecordCount();
 if ($rows == 1 && $mode == 'search') {
     $row = $encounter->FetchRow();
     header("location:op-doku-start.php?sid={$sid}&lang={$lang}&target={$target}&pn=" . $row['encounter_nr'] . "&dept_nr={$dept_nr}");
     exit;
 }
 //$linecount=$address_obj->LastRecordCount();
 $pagen->setTotalBlockCount($linecount);
 # Count total available data
 if (isset($totalcount) && $totalcount) {
     $pagen->setTotalDataCount($totalcount);
 } else {
}
/* Load the visual signalling defined constants */
require_once $root_path . 'include/inc_visual_signalling_fx.php';
require_once $root_path . 'global_conf/inc_remoteservers_conf.php';
/* Retrieve the SIGNAL_COLOR_LEVEL_ZERO = for convenience purposes */
$z = SIGNAL_COLOR_LEVEL_ZERO;
/* Retrieve the SIGNAL_COLOR_LEVEL_FULL = for convenience purposes */
$f = SIGNAL_COLOR_LEVEL_FULL;
$_SESSION['sess_user_origin'] = 'nursing';
/* Create department object and load all medical depts */
require_once $root_path . 'include/care_api_classes/class_department.php';
$dept_obj = new Department();
$medical_depts = $dept_obj->getAllMedical();
/* Create encounter object */
require_once $root_path . 'include/care_api_classes/class_encounter.php';
$enc_obj = new Encounter();
/* Load global configs */
include_once $root_path . 'include/care_api_classes/class_globalconfig.php';
$GLOBAL_CONFIG = array();
$glob_obj = new GlobalConfig($GLOBAL_CONFIG);
$glob_obj->getConfig('patient_%');
$_SESSION['logID'] = $_SESSION['sess_user_name'];
function Spacer()
{
    /*?>
    <TR bgColor=#dddddd height=1>
                    <TD colSpan=3><IMG height=1
                      src="../../gui/img/common/default/pixel.gif"
                      width=5></TD></TR>
    <?php
    */
*/
$lang_tables[] = 'prompt.php';
define('LANG_FILE', 'nursing.php');
$local_user = '******';
require_once $root_path . 'include/inc_front_chain_lang.php';
require_once $root_path . 'global_conf/inc_remoteservers_conf.php';
//$db->debug=true;
if (!$encoder) {
    $encoder = $_COOKIE[$local_user . $sid];
}
$breakfile = "nursing-station.php" . URL_APPEND . "&edit=1&station={$station}&ward_nr={$ward_nr}";
$thisfile = basename($_SERVER['PHP_SELF']);
# Load date formatter
require_once $root_path . 'include/inc_date_format_functions.php';
require_once $root_path . 'include/care_api_classes/class_encounter.php';
$enc_obj = new Encounter();
if ($enc_obj->loadEncounterData($pn)) {
    if ($mode == 'release' && !(isset($lock) || $lock)) {
        $date = empty($x_date) ? date('Y-m-d') : formatDate2STD($x_date, $date_format);
        $time = empty($x_time) ? date('H:i:s') : convertTimeToStandard($x_time);
        switch ($relart) {
            case 1:
            case 2:
            case 7:
            case 3:
                $released = $enc_obj->Discharge($pn, $relart, $date, $time);
                break;
            case 4:
                $released = $enc_obj->DischargeFromWard($pn, $relart, $date, $time);
                break;
            case 5: