Exemple #1
0
 public function getSex()
 {
     return get_sex($this->b_sex);
 }
Exemple #2
0
 public function get_audit_hosp()
 {
     $items = $this->input->post('items');
     $hospcode = $items['hospcode'];
     $s = to_mysql_date_dash($items['date_start']);
     $e = to_mysql_date_dash($items['date_end']);
     $type = $this->input->post('type');
     if ($type == 'op') {
         $rs = $this->audit->get_audit_hosp_op($hospcode, $s, $e);
     } else {
         if ($type == 'dent') {
             $rs = $this->audit->get_audit_hosp_dent($hospcode, $s, $e);
         } else {
             if ($type == 'dm') {
                 $rs = $this->audit->get_audit_hosp_dm($hospcode, $s, $e);
             } else {
                 if ($type == 'ht') {
                     $rs = $this->audit->get_audit_hosp_ht($hospcode, $s, $e);
                 } else {
                     if ($type == 'thaimed') {
                         $rs = $this->audit->get_audit_hosp_thaimed($hospcode, $s, $e);
                     } else {
                         if ($type == 'thaidrug') {
                             $rs = $this->audit->get_audit_hosp_thaidrug($hospcode, $s, $e);
                         } else {
                             if ($type == 'epi1') {
                                 $rs = $this->audit->get_audit_hosp_epi1($hospcode, $s, $e);
                             } else {
                                 if ($type == 'epi2') {
                                     $rs = $this->audit->get_audit_hosp_epi2($hospcode, $s, $e);
                                 } else {
                                     if ($type == 'epi3') {
                                         $rs = $this->audit->get_audit_hosp_epi3($hospcode, $s, $e);
                                     } else {
                                         if ($type == 'epi5') {
                                             $rs = $this->audit->get_audit_hosp_epi5($hospcode, $s, $e);
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
     $arr_result = array();
     foreach ($rs as $r) {
         $obj = new stdClass();
         $obj->ptname = $r->PTNAME;
         $obj->off_name = $this->basic->get_off_name($r->HOSPCODE);
         $obj->cid = $r->CID;
         $obj->birth = to_thai_date($r->BIRTH);
         $obj->pid = $r->pid;
         $obj->sex = get_sex($r->SEX);
         $obj->age = $r->AGE;
         $obj->address = $this->basic->get_address($r->HOSPCODE, $obj->cid);
         $obj->total = $r->total_service;
         $obj->type = $type;
         $arr_result[] = $obj;
     }
     $rows = json_encode($arr_result);
     $json = '{"success": true, "rows": ' . $rows . '}';
     render_json($json);
 }
Exemple #3
0
 public static function validateSex($sex)
 {
     return get_sex($sex) ? false : 'required';
 }