Example #1
0
 public function get_visit_list()
 {
     $items = $this->input->post('items');
     $cid = $items['cid'];
     $visit_date = to_mysql_date_dash($items['visit_date']);
     $rs = $this->audit->get_visit_list($cid, $visit_date);
     $arr_result = array();
     foreach ($rs as $r) {
         $obj = new stdClass();
         $obj->date_serv = to_thai_date($r->DATE_SERV);
         $obj->off_name = $this->basic->get_off_name($r->HOSPCODE);
         $obj->age = $r->AGE . " ปี " . $r->month . " เดือน";
         $obj->seq = $r->SEQ;
         $obj->diagcode = $r->DIAGCODE;
         $obj->diseasename = $this->basic->get_diseasename($r->DIAGCODE);
         $obj->diag = $this->basic->get_diag_visit($r->HOSPCODE, $r->SEQ);
         $obj->drug = $this->basic->get_drug_visit($r->HOSPCODE, $r->SEQ);
         $obj->proced = $this->basic->get_proced_visit($r->HOSPCODE, $r->SEQ);
         $obj->bp1 = $r->SBP . "/" . $r->DBP;
         $obj->price = $r->PRICE;
         $arr_result[] = $obj;
     }
     $rows = json_encode($arr_result);
     $json = '{"success": true, "rows": ' . $rows . '}';
     render_json($json);
 }
Example #2
0
 public function search()
 {
     $query = $this->input->post('q');
     if (empty($query) || strlen($query) < 2) {
         $json = '{"success": false, "msg": "กรุณาระบุคำค้นหา"}';
     } else {
         $rs = $this->patient->search($this->hospcode, $query);
         if ($rs) {
             $arr_result = array();
             foreach ($rs as $r) {
                 $obj = new stdClass();
                 $obj->e0 = $r->e0_hosp;
                 $obj->e1 = $r->e1_hosp;
                 $obj->id = $r->id;
                 $obj->name = $r->name;
                 $obj->hn = $r->hn;
                 $obj->cid = $r->cid;
                 $obj->datesick = to_thai_date($r->datesick);
                 $obj->address = $r->address . ' ' . get_address($r->addrcode);
                 $obj->diag = $r->icd10 . ' ' . $this->basic->get_diagname($r->icd10);
                 $obj->code506 = $r->disease . ' ' . $this->basic->get_code506name($r->disease);
                 $obj->nation = get_nation_nhso_name($r->nation);
                 $obj->ptstatus = $r->result;
                 $arr_result[] = $obj;
             }
             $rows = json_encode($arr_result);
             $json = '{"success": true, "rows": ' . $rows . '}';
         } else {
             $json = '{"success": false, "msg": "ไม่มีข้อมูล."}';
         }
     }
     render_json($json);
 }
Example #3
0
 public function get_person()
 {
     $cid = $this->input->post('cid');
     $rs = $this->basic->get_person($cid);
     $arr_result = array();
     foreach ($rs as $r) {
         $obj = new stdClass();
         $obj->name = $r->PTNAME;
         $obj->off_name = $this->basic->get_off_name($r->HOSPCODE);
         $obj->typearea = $r->TYPEAREA;
         $obj->cid = $r->CID;
         $obj->address = $this->basic->get_address($r->HOSPCODE, $obj->cid);
         $obj->birth = to_thai_date($r->BIRTH);
         $obj->age = $r->AGE;
         $arr_result[] = $obj;
     }
     $rows = json_encode($arr_result);
     $json = '{"success": true, "rows": ' . $rows . '}';
     render_json($json);
 }
Example #4
0
<ul class="breadcrumb">
    <li><a href="<?php 
echo site_url();
?>
">หน้าหลัก </a></li>
    <li class="active"><a href="<?php 
echo site_url() . "/audit/";
?>
">Audit </a></li>
   </ul>
รายชื่อสถานบริการที่ได้รับ การ Audit 2557
<table class="table table-bordered ">
    <thead>
    <tr>
        <th> ลำดับที่</th>
        <th> หน่วยบริการ</th>
        <th> อำเภอ</th>
        <th> วันที่</th>
        <th> หมายเหตุ</th>
    </tr>
    </thead>
    <tbody>
    <?php 
$no = 1;
foreach ($audit as $r) {
    echo '<tr><td>' . $no . '</td><td>' . $r->off_id . ':' . $r->off_name . '</td><td>' . $r->distname . '</td><td>' . to_thai_date($r->event_date) . '</td><td>' . $r->memo . '</td></tr>';
    $no++;
}
?>
    </tbody>
</table>
Example #5
0
 public function get_individual()
 {
     $items = $this->input->post('items');
     $s = to_mysql_date_dash($items['date_start']);
     $e = to_mysql_date_dash($items['date_end']);
     $hospcode = $items['hospcode'];
     $rs = $this->reports->get_individual_hospcode($hospcode, $s, $e);
     $arr_result = array();
     foreach ($rs as $r) {
         $obj = new stdClass();
         $obj->hospname = $r->hospcode;
         $obj->ptname = $r->ptname;
         $obj->hn = $r->pid;
         //$obj->pname     = $this->basic->get_diseasename($r->code);
         $obj->date_serv = to_thai_date($r->date_serv);
         $obj->disease = $this->basic->get_diseasename($r->diag_principle);
         $obj->disease_env = $r->diagcode;
         $obj->occ = $this->basic->get_occupa($r->occupa);
         $obj->age = $r->age;
         $obj->sex = $r->sex;
         $arr_result[] = $obj;
     }
     $rows = json_encode($arr_result);
     $json = '{"success": true, "rows": ' . $rows . '}';
     render_json($json);
 }
Example #6
0
 public function get_message()
 {
     $status = $this->input->post('status');
     $sys_id = $this->session->userdata('sys_id');
     $start = $this->input->post('start');
     $stop = $this->input->post('stop');
     $start = empty($start) ? 0 : $start;
     $stop = empty($stop) ? 25 : $stop;
     $limit = (int) $stop - (int) $start;
     if ($status == '1') {
         $rs = $this->users->get_message($sys_id, $start, $stop);
     } else {
         if ($status == '2') {
             $rs = $this->users->get_message_out($sys_id, $start, $stop);
         }
     }
     if ($rs) {
         $arr_result = array();
         foreach ($rs as $r) {
             $obj = new stdClass();
             $obj->id = $r->id;
             $obj->datesend = to_thai_date_time($r->datesend);
             $obj->title = $r->title;
             $obj->message = $r->message;
             $obj->sender = $this->users->get_username($r->sender);
             $obj->reciver = $this->users->get_username($r->reciver);
             $obj->daterecive = to_thai_date($r->reciver);
             $obj->read = $r->read;
             $arr_result[] = $obj;
         }
         $rows = json_encode($arr_result);
         $json = '{"success": true, "rows": ' . $rows . '}';
     } else {
         $json = '{"success": false, "msg": "ไม่มีข้อมูล."}';
     }
     render_json($json);
 }
Example #7
0
 public function get_service()
 {
     $items = $this->input->post('items');
     $cid = $items['cid'];
     $s = to_mysql_date_dash($items['date_start']);
     $e = to_mysql_date_dash($items['date_end']);
     $op = $items['op'];
     $rs = $this->patient->get_service($cid, $s, $e);
     $arr_result = array();
     foreach ($rs as $r) {
         $obj = new stdClass();
         $obj->date_serv = to_thai_date($r->DATE_SERV);
         $obj->hospname = $this->basic->get_off_name($r->HOSPCODE);
         $arr_result[] = $obj;
     }
     $rows = json_encode($arr_result);
     $json = '{"success": true, "rows": ' . $rows . '}';
     render_json($json);
 }