예제 #1
0
        $rs3 = $this->pharmacy_model->get_admin_route2($admin_route_id);
        $num_rows3 = count($rs3);
        if ($num_rows3 > 0) {
            foreach ($rs3 as $key3) {
                $admin_route = $key3->drug_administration_route_name;
            }
        }
    }
} else {
    $service_charge_id = 0;
}
if (!empty($delete)) {
    $visit_charge_id = $_GET['visit_charge_id'];
    $del = new prescription();
    $del->delete_visit_charge($visit_charge_id);
    $del = new prescription();
    $del->delete_prescription($delete);
}
//if the update button is clicked
$rs_forms = $this->pharmacy_model->get_drug_forms();
$num_forms = count($rs_forms);
if ($num_forms > 0) {
    $xray = "'";
    $t = 0;
    foreach ($rs_forms as $key_forms) {
        if ($t == $num_forms - 1) {
            $xray = $xray . "" . $key_forms->drug_type_name . "'";
        } else {
            $xray = $xray . "" . $key_forms->drug_type_name . "','";
        }
        $t++;
예제 #2
0
 /**
  * Saves the encounter's room location.
  * @access public
  * @param int Encounter number
  * @param int Room number
  * @param int Ward number
  * @param string  Date
  * @param string Time
  * @return boolean
  */
 function assignInRoom($enr, $loc_nr, $group_nr, $date, $time)
 {
     global $db;
     $sql = 'select nr_of_beds from care_room where room_nr=' . $loc_nr . ' and ward_nr=' . $group_nr;
     $result = $db->Execute($sql);
     $row = $result->FetchRow();
     if ($row[0] == 1) {
         $bedcode = 'bed1';
     } else {
         if ($row[0] == 2) {
             $bedcode = 'bed2';
         } else {
             if ($row[0] == 3) {
                 $bedcode = 'bed3';
             } else {
                 $bedcode = 'bed4';
             }
         }
     }
     $sql = 'select item_id from care_tz_drugsandservices where partcode="' . $bedcode . '"';
     $result = $db->Execute($sql);
     $row = $result->FetchRow();
     $presc_obj = new prescription();
     $presc_obj->insert_prescription($enr, $row[0], 'service');
     return $this->_setLocation($enr, 4, $loc_nr, $group_nr, $date, $time);
     # loc. type 4 = room
 }