$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']; break; default: $full_en = $pn + $GLOBAL_CONFIG['patient_inpatient_nr_adder']; } $result =& $enc_obj->encounter; } else { $edit = 0; $mode = ''; $pn = ''; }
function insert_prescription($encounter_nr, $drug_list_id, $type) { global $db; global $is_transmit_to_weberp_enable; $enc_obj = new Encounter(); $diag_obj_sub = new Diagnostics(); $diag_obj = new Diagnostics(); $drg_obj = new DrugsAndServices(); $debug = true; $debug ? $db->debug = TRUE : ($db->debug = FALSE); if ($debug) { echo "class prescription::insert_prescription({$encounter_nr}, {$drug_list_id}, {$type})<br>"; } $enc_class = $enc_obj->EncounterClass($encounter_nr); if ($enc_class == 2) { $class = 1; } else { $class = 0; } $this->sql = "INSERT INTO `care_encounter_prescription` ( " . "\t\t\t" . "\t\t\t`encounter_nr` , " . "\t\t\t`prescription_type_nr` , " . "\t\t\t`article` , " . "\t\t\t`article_item_number` , " . "\t\t\t`price` , " . "\t\t\t`drug_class` , " . "\t\t\t`order_nr` , " . "\t\t\t`dosage` , " . "\t\t\t`times_per_day` , " . "\t\t\t`days` , " . "\t\t\t`application_type_nr` , " . "\t\t\t`notes` , " . "\t\t\t`prescribe_date` , " . "\t\t\t`prescriber` , " . "\t\t\t`color_marker` , " . "\t\t\t`is_stopped` , " . "\t\t\t`is_outpatient_prescription` , " . "\t\t\t`is_disabled` , " . "\t\t\t`stop_date` , " . "\t\t\t`status` , " . "\t\t\t`history` , " . "\t\t\t`bill_number` , " . "\t\t\t`bill_status` , " . "\t\t\t`modify_id` , " . "\t\t\t`modify_time` , " . "\t\t\t`create_id` , " . "\t\t\t`create_time` )" . "VALUES (" . "\t\t\t" . "\t\t\t'" . $encounter_nr . "', " . "\t\t\t'" . $this->GetClassOfItem($this->GetItemNumberByID($drug_list_id)) . "', " . "\t\t\t'" . $this->GetNameOfItem($this->GetItemNumberByID($drug_list_id)) . "', " . "\t\t\t'" . $drug_list_id . "', " . "\t\t\t'" . $this->GetPriceOfItem($this->GetItemNumberByID($drug_list_id)) . "', " . "\t\t\t'" . $this_obj->GetClassOfItem($this->getItemNumberByID($drug_list_id)) . "', " . "\t\t\t'01', " . "\t\t\t'1', " . "\t\t\t'1', " . "\t\t\t'1', " . "\t\t\t'01', " . "\t\t\t'0', " . "\t\t\tNOW(), " . "\t\t\t'" . $enc_obj->ConsultingDr($encounter_nr) . "', " . "\t\t\t'1', " . "\t\t\t'0', " . "\t\t\t'" . $class . "', " . "\t\t\tNULL , " . "\t\t\tNULL , " . "\t\t\t'pending', " . "\t\t\t'Create: '" . date('Y-m-d H:i:s') . "' = '" . $_SESSION['sess_user_name'] . "'\n' , " . "\t\t\t'0', " . "\t\t\t'', " . "\t\t\t'', " . "\t\t\t'0000-00-00 00:00:00', " . "\t\t\t'" . $_SESSION['sess_user_name'] . "', " . "\t\t\t NOW() )"; if ($debug) { echo $this->sql; } $db->Execute($this->sql); if ($is_transmit_to_weberp_enable == 1) { $this->sql = 'select max(nr) from care_encounter_prescription where encounter_nr="' . $encounter_nr . '"'; $result = $db->Execute($this->sql); $WONumberArray = $result->FetchRow(); $WONumber = $WONumberArray[0]; $weberp_obj = new_weberp(); $weberp_obj->make_patient_workorder_in_webERP($WONumber); // $weberp_obj->issue_to_patient_workorder_in_weberp($WONumber, $StockID, $Location, $Quantity, $Batch); weberp_destroy($weberp_obj); } return TRUE; }
function insert_prescription_Radio($encounter_nr, $drug_list_id, $number_of_tests) { global $db; global $is_transmit_to_weberp_enable; $debug = FALSE; $debug ? $db->debug = TRUE : ($db->debug = FALSE); $enc_obj = new Encounter(); if ($debug) { echo "class prescription::insert_prescription_Radio({$encounter_nr}, {$drug_list_id},{$number_of_tests})<br>"; } $enc_class = $enc_obj->EncounterClass($encounter_nr); if ($enc_class == 2) { $class = 1; } else { $class = 0; } $this->sql = "INSERT INTO `care_encounter_prescription` ( " . "\t\t\t" . "\t\t\t`encounter_nr` , " . "\t\t\t`prescription_type_nr` , " . "\t\t\t`article` , " . "\t\t\t`article_item_number` , " . "\t\t\t`price` , " . "\t\t\t`drug_class` , " . "\t\t\t`order_nr` , " . "\t\t\t`dosage` , " . " `times_per_day` , " . " `days` , " . " `total_dosage` , " . "\t\t\t`application_type_nr` , " . "\t\t\t`notes` , " . "\t\t\t`prescribe_date` , " . "\t\t\t`prescriber` , " . "\t\t\t`color_marker` , " . "\t\t\t`is_stopped` , " . "\t\t\t`is_outpatient_prescription` , " . "\t\t\t`is_disabled` , " . "\t\t\t`stop_date` , " . "\t\t\t`status` , " . "\t\t\t`history` , " . "\t\t\t`bill_number` , " . "\t\t\t`bill_status` , " . "\t\t\t`modify_id` , " . "\t\t\t`modify_time` , " . "\t\t\t`create_id` , " . "\t\t\t`create_time` )" . "VALUES (" . "\t\t\t" . "\t\t\t'" . $encounter_nr . "', " . "\t\t\t'0', " . "\t\t\t'" . $this->GetNameOfItem($drug_list_id) . "', " . "\t\t\t'" . $drug_list_id . "', " . "\t\t\t'" . $this->GetPriceOfItem($drug_list_id) . "', " . "\t\t\t'xray', " . "\t\t\t'01', " . "\t\t\t'1', " . "\t\t\t'1', " . "\t\t\t'1', " . "\t\t\t'" . $number_of_tests . "', " . "\t\t\t'01', " . "\t\t\t'1', " . "\t\t\tNOW(), " . "\t\t\t'" . $_SESSION['sess_user_name'] . "', " . "\t\t\t'1', " . "\t\t\t'0', " . "\t\t\t'" . $class . "', " . "\t\t\tNULL , " . "\t\t\tNULL , " . "\t\t\t'', " . "\t\t\t'', " . "\t\t\t'0', " . "\t\t\t'', " . "\t\t\t'', " . "\t\t\tNOW( ), " . "\t\t\t'', " . "\t\t\tNOW() )"; if ($debug) { echo $this->sql; } $db->Execute($this->sql); return TRUE; }
$_POST['notes'] = $_POST['text_therapy']; $_POST['type_nr'] = 13; // 13 = text_therapy $_POST['short_notes'] = ''; $_POST['aux_notes'] = ''; $redirect = true; include './include/save_admission_data.inc.php'; } require './include/init_show.php'; $page_title = $LDMedocs; # Load the entire encounter data require_once $root_path . 'include/care_api_classes/class_encounter.php'; $enc_obj = new Encounter($encounter_nr); $enc_obj->loadEncounterData(); # Get encounter class $enc_class = $enc_obj->EncounterClass(); /*if($enc_class==2) $_SESSION['sess_full_en']=$GLOBAL_CONFIG['patient_outpatient_nr_adder']+$encounter_nr; else $_SESSION['sess_full_en']=$GLOBAL_CONFIG['patient_inpatient_nr_adder']+$encounter_nr; */ $_SESSION['sess_full_en'] = $encounter_nr; if (empty($encounter_nr) && !empty($_SESSION['sess_en'])) { $encounter_nr = $_SESSION['sess_en']; } elseif ($encounter_nr) { $_SESSION['sess_en'] = $encounter_nr; } if ($mode == 'show') { $sql = "SELECT e.encounter_nr,e.is_discharged,nd.nr, nd.notes AS diagnosis,nd.short_notes, nd.date,nd.personell_nr,nd.personell_name, nt.notes AS therapy\n\t\tFROM \tcare_encounter AS e,\n\t\t\t\t\tcare_encounter_notes AS nd\n\t\t\t\t\tLEFT JOIN care_encounter_notes AS nt ON nt.ref_notes_nr=nd.nr\n\t\tWHERE e.encounter_nr=" . $encounter_nr . "\n\t\t\tAND e.encounter_nr=nd.encounter_nr \n\t\t\tAND nd.type_nr=12\n\t\t\tORDER BY nd.create_time DESC"; /* 12 = text_diagnosis type of notes * 13 = text_therapy type of notes */ if ($result = $db->Execute($sql)) {
$pcols = COL_MAX / 2; reset($requestData); //print_r($requestData); $collimit = 0; while (list($group, $pm) = each($requestData)) { $gName = $lab_obj->getGroupName($group); echo ' <tr>'; echo '<td colspan="' . COL_MAX . '" bgcolor="#ffffee" class="a10_a"><b>'; echo $gName->fields['name']; echo '</b></td></tr><tr>'; while (list($pId, $not) = each($pm)) { // echo $enc_obj->EncounterClass(); //Get the encounter class //Check if item is billed if ($glob_obj->getConfigValue("restrict_unbilled_items") === "1" && $enc_obj->EncounterClass() === "2") { //Check the restriction status if ($lab_obj->getLabBillNoByBatch($job_id, $pId) > 0) { $pName = $lab_obj->TestParamsDetails($pId); echo '<td bgcolor="#ffffee" class="a10_b"><b>'; echo $pName->fields['name'] . '</b></td>'; echo '<td>'; //it's a dropdown if ($pName->fields['field_type'] == 'drop_down') { $inputValue = '<select name="' . $pId . '" size="1">'; do { $inputValue .= '<option value=' . $pDropDown['input_value']; if ($pDropDown['input_value'] == $pdata[$pId]['value']) { $inputValue .= ' selected="selected" '; } $inputValue .= '>' . $pDropDown['input_value'] . '</option>';