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); }
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); }
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); }