Commit da8aceac authored by Indra Raja's avatar Indra Raja

integrasi

parent 9f79eea5
......@@ -54,15 +54,8 @@ class AdminController extends \Application\Master\GlobalActionController
// echo "<pre>";
$id = $getpath[3];
// echo "<pre>";
// print_r($uri);die;
// $storage = \Application\Model\Param\Storage::factory($this->getDb(), $this->getConfig());
// $param = new \Application\Model\Param($storage);
// $curl = curl_init();
// curl_setopt_array($curl, array(
......@@ -74,7 +67,7 @@ class AdminController extends \Application\Master\GlobalActionController
// CURLOPT_FOLLOWLOCATION => true,
// CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
// CURLOPT_CUSTOMREQUEST => "POST",
// CURLOPT_POSTFIELDS => array('inoantrian' => '1','idok' => '74','istatus' => '30'),
// CURLOPT_POSTFIELDS => array('inoantrian' => '7','idok' => '74','istatus' => '40'),
// ));
// $response = curl_exec($curl);
......@@ -82,37 +75,11 @@ class AdminController extends \Application\Master\GlobalActionController
// curl_close($curl);
// echo $response;
// function curl($url, $data){
// $ch = curl_init();
// curl_setopt($ch, CURLOPT_URL, $url);
// curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
// curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
// curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
// $output = curl_exec($ch);
// curl_close($ch);
// return $output;
// }
// $data = json_decode(file_get_contents('php://input'),true);
// // Data Parameter yang Dikirim oleh cURL
// $data = array("inoantrian"=>"1","idok"=>"74","istatus"=>"40");
// echo $data;
// print_r($data);
// $send = curl("http://queue.indra/api/nextantrian/",json_encode($data));
// echo json_encode(array('respon'=>$send),JSON_UNESCAPED_SLASHES);
$arr = json_decode(file_get_contents("php://input"));
if (empty($arr->inoantrian) OR empty($arr->idok) OR empty($arr->istatus)){
echo "Submit gagal!";
} else {
echo "Submit berhasil!".$arr->inoantrian."</b><b>".$arr->idok."</b>.<b>".$arr->istatus."</b>.";
}
$this->headScript->appendScript(' var baseURL = "' . $baseurl . '"');
$this->headScript->appendScript(' var id = "' . $id . '"');
$this->headScript->appendFile('/action-js/antrian-js/action-admin.js');
......@@ -136,6 +103,8 @@ class AdminController extends \Application\Master\GlobalActionController
$this->layout("layout/layoutAdmin");
return $view;
}
public function antrianterlewatAction()
{
$this->isLoggedIn();
......
......@@ -24,7 +24,7 @@ class ApiController extends \Application\Master\GlobalActionController {
// generate token if valid user
$payload = ['email' => 'danirsdan@gmail.com', 'name' => 'dani'];
//print_r($payload);die;
$this->apiResponse['token'] = $this->generateJwtToken($payload);
......@@ -87,7 +87,7 @@ class ApiController extends \Application\Master\GlobalActionController {
'alamat' => $alamat,
'no_hp' => $no_hp,
'ktp' => $ktp,
'no_rekam_medis' => $norm
'no_rekam_medis' => $norm,
);
$param->saveGlobal( $dataArrayPasien, $table_pasien);
......@@ -172,7 +172,7 @@ class ApiController extends \Application\Master\GlobalActionController {
$array = array(
'datapasien'=> $cekpasien->data
'datapasien'=> $cekpasien->data,
);
// print_r( $cekpasien) ;die;
......@@ -190,64 +190,64 @@ class ApiController extends \Application\Master\GlobalActionController {
}
public function savedataAction(){
$result = new Result();
$request = $this->getRequest();
$post = $request->getPost();
if ($request->isPost()) {
$storage = \Application\Model\Param\Storage::factory($this->getDb(), $this->getConfig());
$param = new \Application\Model\Param($storage);
$result = new Result();
$request = $this->getRequest();
$post = $request->getPost();
try{
$id = $post->iid;
$nama = $post->inama;
$tempat_lahir = $post->itempat_lahir;
$tanggal_lahir = $post->itanggal_lahir;
$alamat = $post->ialamat;
$no_hp = $post->ino_hp;
$poli = $post->ipoli;
$dokter = $post->idokter;
$ktp = $post->iktp;
$no_antrian = $post->ino_antrian;
$no_rekam_medis = $post->ino_rekam_medis;
$sisa_antrian = $post->isisa_antrian;
// $counter= $param->getMaxCounter();
if ($request->isPost()) {
$dataArrayAntrianPasien = array (
'id_pasien' => $id,
'create_date' => gmdate("Y-m-d H:i:s", time()+60*60*7),
'nama' => $nama,
'tempat_lahir' => $tempat_lahir,
'tanggal_lahir' => $tanggal_lahir,
'alamat' => $alamat,
'no_rekam_medis'=> $no_rekam_medis,
'no_hp' => $no_hp,
'ktp' => $ktp,
'status_code' => 10,
'sisa_antrian' => $sisa_antrian,
);
$table_antrianpasien = 'antrian_pasien';
$where = 'id_dokter='.$dokter.' and no_antrian='.$no_antrian;
$storage = \Application\Model\Param\Storage::factory($this->getDb(), $this->getConfig());
$param = new \Application\Model\Param($storage);
$register = $param->loadregisterantrian($where);
try{
$id = $post->iid;
$nama = $post->inama;
$tempat_lahir = $post->itempat_lahir;
$tanggal_lahir = $post->itanggal_lahir;
$alamat = $post->ialamat;
$no_hp = $post->ino_hp;
$poli = $post->ipoli;
$dokter = $post->idokter;
$ktp = $post->iktp;
$no_antrian = $post->ino_antrian;
$no_rekam_medis = $post->ino_rekam_medis;
$sisa_antrian = $post->isisa_antrian;
$id_antrian = $register->data[0]['id_antrian'];
$whereidantrian = 'id_antrian='.$id_antrian;
// print_r($id_antrian);die;
// $counter= $param->getMaxCounter();
$param->updateGlobal($table_antrianpasien, $dataArrayAntrianPasien , $whereidantrian);
$result->code = 0;
$result->info = 'ok';
$result->data = $register->data;
}catch (\Exception $exc) {
$result = new Result(0,1,$exc->getMessage() .'-'.$exc->getTraceAsString());
}
$dataArrayAntrianPasien = array (
'id_pasien' => $id,
'create_date' => gmdate("Y-m-d H:i:s", time()+60*60*7),
'nama' => $nama,
'tempat_lahir' => $tempat_lahir,
'tanggal_lahir' => $tanggal_lahir,
'alamat' => $alamat,
'no_rekam_medis'=> $no_rekam_medis,
'no_hp' => $no_hp,
'ktp' => $ktp,
'status_code' => 10,
'sisa_antrian' => $sisa_antrian,
);
$table_antrianpasien = 'antrian_pasien';
$where = 'id_dokter='.$dokter.' and no_antrian='.$no_antrian;
$register = $param->loadregisterantrian($where);
$id_antrian = $register->data[0]['id_antrian'];
$whereidantrian = 'id_antrian='.$id_antrian;
// print_r($id_antrian);die;
$param->updateGlobal($table_antrianpasien, $dataArrayAntrianPasien , $whereidantrian);
$result->code = 0;
$result->info = 'ok';
$result->data = $register->data;
}catch (\Exception $exc) {
$result = new Result(0,1,$exc->getMessage() .'-'.$exc->getTraceAsString());
}
}
return $this->getOutput($result->toJson());
......@@ -295,7 +295,7 @@ class ApiController extends \Application\Master\GlobalActionController {
$seqBefore1 = $param->getLastSeqPostgree($tb_register_dokter ,'id_register');
$dataArrayRegisterDokter= array (
$dataArrayRegisterDokter= array (
'create_date' => gmdate("Y-m-d H:i:s", time()+60*60*7),
'id_ruang' => $ruang,
'id_poli' => $poli,
......@@ -307,28 +307,28 @@ class ApiController extends \Application\Master\GlobalActionController {
'id_condition' =>1,
'jam_mulai' => $jam_mulai,
);
);
$dataArrayRegisterAntrian= array (
$dataArrayRegisterAntrian= array (
'create_date' => gmdate("Y-m-d H:i:s", time()+60*60*7),
'antrian_all' => $antrian_all,
'antrian_awal' => $antrian_awal,
'antrian_akhir' => $antrian_akhir,
'waktu_antrian' => $waktu_antrian,
'jam_mulai' => $jam_mulai,
);
);
$dataArrayDokter = array(
$dataArrayDokter = array(
'id_condition' => 2,
);
);
$dataArrayRuang = array(
$dataArrayRuang = array(
'id_condition' => 2,
);
if($dokter){
if($dokter){
$array_merge = array_merge($dataArrayDokter, array('id_dokter=' => $dokter));
$where = 'id_dokter='.$dokter;
......@@ -338,9 +338,9 @@ class ApiController extends \Application\Master\GlobalActionController {
$result->code = $result::CODE_SUCCESS; // code 0
$result->info = $result::INFO_SUCCESS;
$result->data = $dokter;
}
}
if($ruang){
if($ruang){
$array_merge = array_merge($dataArrayDokter, array('id_ruang=' => $ruang));
$where = 'id_ruang='.$ruang;
......@@ -350,14 +350,14 @@ class ApiController extends \Application\Master\GlobalActionController {
$result->code = $result::CODE_SUCCESS; // code 0
$result->info = $result::INFO_SUCCESS;
$result->data = $ruang;
}
}
$param->saveGlobal($dataArrayRegisterDokter, $tb_register_dokter);
$param->saveGlobal($dataArrayRegisterAntrian, $tb_register_antrian);
$seqAfter1 = $param->getLastSeqPostgree($tb_register_dokter, 'id_register');
$param->saveGlobal($dataArrayRegisterDokter, $tb_register_dokter);
$param->saveGlobal($dataArrayRegisterAntrian, $tb_register_antrian);
$seqAfter1 = $param->getLastSeqPostgree($tb_register_dokter, 'id_register');
if($seqAfter1->data['total'] > $seqBefore1->data['total']){
$seqBefore2 = $param->getLastSeqPostgree($tb_antrian_pasien,'id_antrian');
......@@ -451,6 +451,7 @@ class ApiController extends \Application\Master\GlobalActionController {
$result->code = 1;
$result->info = 'gagal total';
}
// echo '<pre>';
//print_r($result->data['id_re']['ui']['k'] );die;
......@@ -468,9 +469,9 @@ class ApiController extends \Application\Master\GlobalActionController {
$result = new Result(0,1,$exc->getMessage() .'-'.$exc->getTraceAsString());
}
}
return $this->getOutput($result->toJson());
}
return $this->getOutput($result->toJson());
}
public function loadantrianregisterAction(){
$result = new Result();
......@@ -746,7 +747,7 @@ class ApiController extends \Application\Master\GlobalActionController {
if (move_uploaded_file($_FILES['fileupload']['tmp_name'],$alamatfile)){
/* jika upload berhasil ke folder sever */
$dataArrayPoli = array(
$dataArrayPoli = array (
'nama_poli' => $nama_poli,
'image_poli' => $ImageName,
......@@ -922,14 +923,7 @@ class ApiController extends \Application\Master\GlobalActionController {
$result->info = 'File tidak boleh kosong';
}
//print_r($poli);die;
//print_r($poli);die;
}catch (\Exception $exc) {
$result = new Result(0,1,$exc->getMessage() .'-'.$exc->getTraceAsString());
......@@ -1382,9 +1376,7 @@ class ApiController extends \Application\Master\GlobalActionController {
return $this->getOutput($result->toJson());
}
public function loadpasienAction(){
$result = new Result();
$request = $this->getRequest();
......@@ -1425,7 +1417,7 @@ class ApiController extends \Application\Master\GlobalActionController {
$listdata= array();
$listdata = array(
$listdata = array (
'poli' =>$load->data,
'condition' =>$loadc->data
);
......@@ -2052,4 +2044,4 @@ class ApiController extends \Application\Master\GlobalActionController {
return $this->getOutput($result->toJson());
}
}
\ No newline at end of file
}
\ No newline at end of file
......@@ -53,28 +53,8 @@ class UmumController extends \Application\Master\GlobalActionController
// echo "<pre>";
$decodeid = base64_decode($getpath[3]);
// $curl = curl_init();
// curl_setopt_array($curl, array(
// CURLOPT_URL => "http://queue.indra/api/loadantrian?id_poli=$decodeid",
// CURLOPT_RETURNTRANSFER => true,
// CURLOPT_ENCODING => "",
// CURLOPT_MAXREDIRS => 10,
// CURLOPT_TIMEOUT => 0,
// CURLOPT_FOLLOWLOCATION => true,
// CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
// CURLOPT_CUSTOMREQUEST => "POST",
// CURLOPT_POSTFIELDS => array('id_poli' => $decodeid),
// ));
// $response = curl_exec($curl);
// curl_close($curl);
// // echo $response;
$this->headScript->appendScript(' var baseURL = "' . $baseurl . '"');
$this->headScript->appendScript(' var id_poli = "' . $decodeid . '"');
......@@ -83,6 +63,7 @@ class UmumController extends \Application\Master\GlobalActionController
$this->layout("layout/layoutUmum");
return $view;
}
}
}
\ No newline at end of file
......@@ -440,9 +440,6 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton {
return $result;
}
public function loaddatapasien($id){
$result = new Result();
try {
public function loadsisaantrian($id,$no){
......@@ -486,7 +483,10 @@ class Mysql extends \Khansia\Db\Storage implements Skeleton {
}
return $result;
}
public function loaddatapasien($id){
$result = new Result();
try {
$sql = " SELECT * FROM pasien WHERE id_pasien = $id ";
......
......@@ -42,7 +42,7 @@ input::-webkit-inner-spin-button {
<div class="form-group">
<label> <h5>No Rekam Medis</h5></label><br>
<input type="number" id="no_rekam_medis" placeholder="No Rekam Medis" class="form-control" max="999999999999999" maxlength="8" ></input>
<input type="text" id="no_rekam_medis" placeholder="No Rekam Medis" class="form-control" ></input>
</div>
<!-- <div class="form-group">
......
const STATUS_QUEUE = 10;
const STATUS_NEXT = 20;
const STATUS_CALL = 30;
const STATUS_SERVED = 40;
const STATUS_DONE = 50;
const STATUS_MISSED = 60;
/* JS comes here */
/* JS comes here */
......@@ -35,7 +26,7 @@ function textToAudioRuang() {
var res = ruang.replace(".", " ");
document.getElementById("nama_ruang").innerHTML = res;
let voice = "silahkan masuk ke ruang " + res;
let voice = "silahkan menuju ke ruang " + res;
console.log(voice)
let speech = new SpeechSynthesisUtterance();
......
......@@ -26,6 +26,7 @@ function Loadpoli() {
let data = result.data;
let counter = 1;
for (x in data) {
// console.log(data);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment