Commit d226a35c authored by Azy Mushofy Anwary's avatar Azy Mushofy Anwary

Kondisi

parent 10fccefe
<style>
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}
</style>
<hr>
<hr>
<hr>
<hr>
<section class="breadcrumb_part breadcrumb_bg">
<div class="container">
<div class="row">
<div class="col-lg-12">
<div class="breadcrumb_iner">
<div class="breadcrumb_iner_item">
<h2>Registrasi</h2>
<h2>Pasien</h2>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- breadcrumb start-->
<div class="container">
<div class="card" >
<div class="card-header">
<h2> Silahkan Isi No Rekam Medis</h2>
</div>
<div class="card-body">
<form id="myForm">
<input type="hidden" id="iInput" class="form-control" /></input>
<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" style="width: 950px;display:inline;"></input>
</div>
<p class="card-text" style="display:inline">Jika belum mempunyai no rekam medis, </p>
<a class="card-text" href="<?php echo $this->basePath('queue/daftarpasien') ?>" style="display:inline">Klik disini !</a>
</form>
</div>
<div class="card-footer" >
<p class="card-text"></p>
<button type="button" class="btn btn-primary" id="cekdata" style="float: right;">Daftar Antrian</button>
</div>
</div>
</div>
<br>
<style>
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}
</style>
<hr>
<hr>
<hr>
<hr>
<section class="breadcrumb_part breadcrumb_bg">
<div class="container">
<div class="row">
<div class="col-lg-12">
<div class="breadcrumb_iner">
<div class="breadcrumb_iner_item">
<h2>Daftar </h2>
<h2>Pasien</h2>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- breadcrumb start-->
<div class="container">
<div class="card" >
<div class="card-header">
<h2> Silahkan Isi Data Diri Pasien</h2>
</div>
<div class="card-body">
<form id="myForm">
<input type="hidden" id="iInput" class="form-control" /></input>
<div class="form-group">
<label><h5>No Induk KTP</h5></label>
<input type="number" id="ktp" class="form-control" placeholder="No Induk KTP" max="9999999999999999" maxlength="16"></input>
</div>
<div class="form-group">
<label><h5>Nama Pasien</h5></label>
<input type="text" id="nama" class="form-control" placeholder="Nama Lengkap" ></input>
</div>
<div class="form-group ">
<label><h5>Tempat Lahir</h5></label>
<textarea type="text" id="tempat_lahir" class="form-control " placeholder="Tempat Lahir" ></textarea >
</div>
<div class="form-group">
<label><h5>Tanggal Lahir</h5></label>
<input type="date" id="tanggal_lahir" class="form-control" /></input>
</div>
<div class="form-group" >
<label><h5>Alamat</h5></label>
<textarea type="text" id="alamat" rows="3" class="form-control" placeholder="Alamat"/></textarea >
</div>
<div class="form-group">
<label><h5>No HP</h5></label>
<input type="number" id="no_hp" class="form-control " placeholder="No Handphone" maxlength="13" /></input>
</div>
</form>
</div>
<div class="card-footer" >
<p class="card-text"></p>
<button type="button" class="btn btn-primary" id="tambahdata" style="float: right;"> Daftar Pasien</button>
</div>
</div>
</div>
<br>
<style>
/* Chrome, Safari, Edge, Opera */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}
/* Firefox */
input[type=number] {
-moz-appearance: textfield;
}
.buttons input[type="radio"] {
display: none;
}
.buttons input[type="picked"] {
display: none;
}
.buttons input[type="done"] {
display: none;
}
input[type="radio"]:checked + label {
padding: 15px;
color: #fff;
font-size: 25px;
background: #7FFF00;
width : 55px;
text-align:center;
}
input[type="radioo"] + label {
padding: 15px;
background: #fff;
color: black;
font-size: 25px;
width: 1080px;
text-align: center;
}
input[type="radio"] + label {
padding: 15px;
background: #007bff;
color: #fff;
font-size: 25px;
width : 55px;
text-align:center;
}
input[type="picked"] + label {
padding: 15px;
background: #FF0000;
color: #fff;
font-size: 25px;
width : 55px;
cursor:not-allowed;
text-align:center;
}
input[type="done"] + label {
padding: 15px;
background: #808080;
color: #fff;
font-size: 25px;
width : 55px;
cursor:not-allowed;
text-align:center;
}
.table1 tr th{
background: #007bff;
color: #fff;
}
.table1, th, td {
padding: 10px 20px;
text-align: center;
}
.table2 tr th{
background: #7FFF00;
color: #fff;
}
.table2, th, td {
padding: 10px 20px;
text-align: center;
}
.table3 tr th{
background: #FF0000;
color: #fff;
}
.table3, th, td {
padding: 10px 20px;
text-align: center;
}
.table4 tr th{
background: #808080;
color: #fff;
}
.table4, th, td {
padding: 10px 20px;
text-align: center;
}
</style>
<hr>
<hr>
<hr>
<hr>
<section class="breadcrumb_part breadcrumb_bg">
<div class="container">
<div class="row">
<div class="col-lg-12">
<div class="breadcrumb_iner">
<div class="breadcrumb_iner_item">
<h2>Data</h2>
<h2>Pasien</h2>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- breadcrumb start-->
<div class="container">
<div class="card" >
<div class="card-header">
<h2> Silahkan Pilih Poli dan Dokter</h2>
</div>
<div class="card-body">
<form id="myForm">
<input type="hidden" id="id_pasien" class="form-control" disabled/></input>
<div class="form-group">
<label> <h5>No Rekam Medis</h5></label>
<input type="text" id="no_rekam_medis" class="form-control" disabled/></input>
</div>
<div class="form-group">
<label> <h5>KTP</h5></label>
<input type="text" id="ktp" class="form-control" disabled /></input>
</div>
<div class="form-group">
<label> <h5>Nama pasien</h5></label>
<input type="text" id="nama" class="form-control" disabled/></input>
</div>
<div class="form-group ">
<input type="hidden" id="tempat_lahir" class="form-control "disabled ></input>
</div>
<div class="form-group">
<input type="hidden" id="tanggal_lahir" class="form-control"disabled /></input>
</div>
<div class="form-group" >
<input type="hidden" id="alamat" rows="3" class="form-control"disabled ></input>
</div>
<div class="form-group">
<input type="hidden" id="no_hp" class="form-control "disabled ></input>
</div>
<div class="form-group">
<label> <h5>Pilih Poli </h5></label>
<select name="nama_poli" id="poli" class="form-control">
<option disabled selected> Pilih </option>
</select>
</div>
<div class="form-group">
<label> <h5>Pilih Dokter </h5></label>
<select id="dokter" name="nama_dokter" class="form-control">
<option disabled selected> Pilih </option>
</select>
</div>
</form>
</div>
<div class="card-footer" >
<p class="card-text"></p>
<button type="button" id="pilihno" class="btn btn-primary" data-toggle="modal" data-target="#pilihantrian" style="float: right;"> Daftar Antrian</button>
</div>
</div>
</div>
<br>
<!-- Trigger the modal with a button -->
<!-- Modal -->
<div class="modal fade modalPalingesar" id="pilihantrian" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-xl">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="-close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">Daftar Antrian</h4>
</div>
<div class="modal-body">
<div class="row col-lg-12 antrian" id="seat">
</div>
<div class="modal-footer">
<div class="container" >
<div class="row col-lg-12">
<div class="col-sm-3">
<h6>Antrian Belum Dipilih</h6>
</div>
<div class="col-sm-1">
<h6>:</h6>
</div>
<div>
<table class="table1"><tr><th></th></tr></table>
</div>
</div>
<div class="row col-lg-12">
<div class="col-sm-3">
<h6>Antrian Yang Dipilih</h6>
</div>
<div class="col-sm-1">
<h6>:</h6>
</div>
<div>
<table class="table2"><tr><th></th></tr></table>
</div>
</div>
<div class="row col-lg-12">
<div class="col-sm-3">
<h6>Antrian Telah Diisi</h6>
</div>
<div class="col-sm-1">
<h6>:</h6>
</div>
<div>
<table class="table3"><tr><th></th></tr></table>
</div>
</div>
<div class="row col-lg-12">
<div class="col-sm-3">
<h6>Antrian Telah Selesai</h6>
</div>
<div class="col-sm-1">
<h6>:</h6>
</div>
<div>
<table class="table4"><tr><th></th></tr></table>
</div>
</div>
</div>
<button button type="button" class="btn btn-primary" id="tambah">Selesai</button>
<button type="button" id="close" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<style>
/* Chrome, Safari, Edge, Opera */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}
/* Firefox */
input[type=number] {
-moz-appearance: textfield;
}
.buttons input[type="radio"] {
display: none;
}
.buttons input[type="picked"] {
display: none;
}
.buttons input[type="done"] {
display: none;
}
input[type="radio"]:checked + label {
padding: 15px;
color: #fff;
font-size: 25px;
background: #7FFF00;
width : 55px;
text-align:center;
}
input[type="radioo"] + label {
padding: 15px;
background: #fff;
color: black;
font-size: 25px;
width: 1080px;
text-align: center;
}
input[type="radio"] + label {
padding: 15px;
background: #007bff;
color: #fff;
font-size: 25px;
width : 55px;
text-align:center;
}
input[type="picked"] + label {
padding: 15px;
background: #FF0000;
color: #fff;
font-size: 25px;
width : 55px;
cursor:not-allowed;
text-align:center;
}
input[type="done"] + label {
padding: 15px;
background: #808080;
color: #fff;
font-size: 25px;
width : 55px;
cursor:not-allowed;
text-align:center;
}
.table1 tr th{
background: #007bff;
color: #fff;
}
.table1, th, td {
padding: 10px 20px;
text-align: center;
}
.table2 tr th{
background: #7FFF00;
color: #fff;
}
.table2, th, td {
padding: 10px 20px;
text-align: center;
}
.table3 tr th{
background: #FF0000;
color: #fff;
}
.table3, th, td {
padding: 10px 20px;
text-align: center;
}
.table4 tr th{
background: #808080;
color: #fff;
}
.table4, th, td {
padding: 10px 20px;
text-align: center;
}
</style>
<hr>
<hr>
<hr>
<hr>
<section class="breadcrumb_part breadcrumb_bg">
<div class="container">
<div class="row">
<div class="col-lg-12">
<div class="breadcrumb_iner">
<div class="breadcrumb_iner_item">
<h2>Pilih</h2>
<h2>Antrian</h2>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- breadcrumb start-->
<div class="container">
<div class="card" >
<div class="card-header">
<h2> Silahkan Pilih Poli dan Dokter</h2>
</div>
<div class="card-body">
<form id="myForm">
<input type="hidden" id="id_pasien" class="form-control" disabled/></input>
<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" style="width: 950px;display:inline;"></input>
<button type="button" class="btn btn-primary" style="float: right;" id="cekdata"> Cek Daata Pasien</button>
</div>
<div class="form-group">
<label> <h5>KTP</h5></label>
<input type="text" id="ktp" class="form-control" disabled /></input>
</div>
<div class="form-group">
<label> <h5>Nama pasien</h5></label>
<input type="text" id="nama" class="form-control" disabled/></input>
</div>
<div class="form-group ">
<input type="hidden" id="tempat_lahir" class="form-control "disabled ></input>
</div>
<div class="form-group">
<label> <h5>Tanggal Lahir</h5></label>
<input type="text" id="tanggal_lahir" class="form-control"disabled /></input>
</div>
<div class="form-group" >
<input type="hidden" id="alamat" rows="3" class="form-control"disabled ></input>
</div>
<div class="form-group">
<input type="hidden" id="no_hp" class="form-control "disabled ></input>
</div>
<div class="form-group">
<label> <h5>Pilih Poli </h5></label>
<select name="nama_poli" id="poli" class="form-control">
<option disabled selected> Pilih </option>
</select>
</div>
<div class="form-group">
<label> <h5>Pilih Dokter </h5></label>
<select id="dokter" name="nama_dokter" class="form-control">
<option disabled selected> Pilih </option>
</select>
</div>
</form>
</div>
<div class="card-footer" >
<p class="card-text"></p>
<button type="button" id="pilihno" class="btn btn-primary" data-toggle="modal" data-target="#pilihantrian" style="float: right;"> Daftar Antrian</button>
</div>
</div>
</div>
<br>
<!-- Trigger the modal with a button -->
<!-- Modal -->
<div class="modal fade modalPalingesar" id="pilihantrian" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-xl">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="-close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">Daftar Antrian</h4>
</div>
<div class="modal-body">
<div class="row col-lg-12 antrian" id="seat">
</div>
<div class="modal-footer">
<div class="container" >
<div class="row col-lg-12">
<div class="col-sm-3">
<h6>Antrian Belum Dipilih</h6>
</div>
<div class="col-sm-1">
<h6>:</h6>
</div>
<div>
<table class="table1"><tr><th></th></tr></table>
</div>
</div>
<div class="row col-lg-12">
<div class="col-sm-3">
<h6>Antrian Yang Dipilih</h6>
</div>
<div class="col-sm-1">
<h6>:</h6>
</div>
<div>
<table class="table2"><tr><th></th></tr></table>
</div>
</div>
<div class="row col-lg-12">
<div class="col-sm-3">
<h6>Antrian Telah Diisi</h6>
</div>
<div class="col-sm-1">
<h6>:</h6>
</div>
<div>
<table class="table3"><tr><th></th></tr></table>
</div>
</div>
<div class="row col-lg-12">
<div class="col-sm-3">
<h6>Antrian Telah Selesai</h6>
</div>
<div class="col-sm-1">
<h6>:</h6>
</div>
<div>
<table class="table4"><tr><th></th></tr></table>
</div>
</div>
</div>
<button button type="button" class="btn btn-primary" id="tambah">Selesai</button>
<button type="button" id="close" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
$('#cekdata').on('click', function () {
let no_rekam_medis = $('#no_rekam_medis').val();
cekpasien(no_rekam_medis);
})
function cekpasien() {
let no_rekam_medis = $('#no_rekam_medis').val();
// alert(no_rekam_medis);
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/cekpasien',
data: {
ino_rekam_medis: no_rekam_medis,
},
success: function (result) {
if (result.code == 0) {
console.log(result.data);
if (result.data[0]['no_rekam_medis'] == null) {
let $id = result.data[0]['id_pasien'];
let $encodedId = btoa($id);
window.location.href = ("datapasien/" + $encodedId);
}
if (result.data[0]['no_rekam_medis'] != null && (result.data[0]['status_code'] == 10)) {
let $idantrian = result.data[0]['id_antrian'];
let $encodedIdantrian = btoa($idantrian)
let no_rekam_medis = result.data[0]['no_rekam_medis'];
let nama = result.data[0]['nama'];
swal({
title: " Nama pasien '" + nama + "' sedang dalam antrian. \n Apakah anda ingin mencetak no antrian lagi ? ",
type: "error",
confirmButtonClass: "success",
confirmButtonText: "Yes!",
showCancelButton: true,
}, function () {
window.location = (baseURL + "/queue/cetakantrian/" + $encodedIdantrian);
});
} else if (result.data[0]['status_code'] == 20) {
bootbox.alert({ message: "Pasien Sedang Dalam Antrian", centerVertical: true });
} else if (result.data[0]['status_code'] == 30) {
bootbox.alert({ message: "Pasien Sedang Dalam Panggilan Antrian", centerVertical: true });
} else if (result.data[0]['status_code'] == 40) {
bootbox.alert({ message: "Pasien Sedang Diperika Dokter", centerVertical: true });
} else if (result.data[0]['status_code'] == 50) {
bootbox.alert({ message: "Pasien Telah Selesai Diperiksa", centerVertical: true });
} else if (result.data[0]['status_code'] == 60) {
bootbox.alert({ message: "Pasien Sedang Telah Terlewat Silahkan Hubungi Petugas", centerVertical: true });
}
// $('#id_pasien').val(data[0].id_pasien);
// $('#no_rekam_medis').val(data[0].no_rekam_medis);
// $('#ktp').val(data[0].ktp);
// $('#nama').val(data[0].nama);
// $('#tempat_lahir').val(data[0].tempat_lahir);
// $('#tanggal_lahir').val(data[0].tanggal_lahir);
// $('#alamat').val(data[0].alamat);
// $('#no_hp').val(data[0].no_hp);
} else {
bootbox.alert({ message: "Pasien Tidak Terdaftar <br> Silahkan Daftar Terlebih Dahulu", centerVertical: true });
}
},
error: function (xhr) {
alert(xhr.status + '-' + xhr.statusText);
}
});
}
$(document).ready(function () {
$("#tanggal_lahir").change(function () {
//console.log("berubah nih!");
var x = new Date($("#tanggal_lahir").val());
var Cnow = new Date();
if (Cnow.getFullYear() < x.getFullYear()) {
bootbox.alert({
title: "<span min-height='100px'></span>",
message: "Tanggal Lahir tidak Boleh Melebihi Tanggal Hari ini!",
callback: function () {
console.log('This was logged in the callback!');
},
centerVertical: true
})
//$("#tanggal_lahir").val('');
}
});
});
$('#tambahdata').on('click', function () {
SaveDataAja();
})
function SaveDataAja() {
let id_pasien = $('#nama').val();
let no_rekam_medis = $('#nama').val();
let nama = $('#nama').val();
let tempat_lahir = $('#tempat_lahir').val();
let tanggal_lahir = $('#tanggal_lahir').val();
let alamat = $('#alamat').val();
let no_hp = $('#no_hp').val();
let ktp = $('#ktp').val();
// console.log(no_antrian);
/* save data */
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/savedatapasien',
data: {
id_pasien: id_pasien,
ino_rekam_medis: no_rekam_medis,
iktp: ktp,
inama: nama,
itempat_lahir: tempat_lahir,
itanggal_lahir: tanggal_lahir,
ialamat: alamat,
ino_hp: no_hp,
},
success: function (response) {
// alert("success");
// response[data];
// if (ktp == null || ktp == "") {
// bootbox.alert({ message: 'Ktp tidak boleh kosong', centerVertical: true });
// return false;
// }
// else if (nama == null || nama == "") {
// bootbox.alert({ message: 'Nama tidak boleh kosong', centerVertical: true });
// return false;
// } else if (tempat_lahir == null || tempat_lahir == "") {
// bootbox.alert({ message: 'Tempat lahir tidak boleh kosong', centerVertical: true });
// return false;
// } else if (tanggal_lahir == null || tanggal_lahir == "") {
// bootbox.alert({ message: 'Tanggal lahir tidak boleh kosong', centerVertical: true });
// return false;
// } else if (alamat == null || alamat == "") {
// bootbox.alert({ message: 'Alamat tidak boleh kosong', centerVertical: true });
// return false;
// } else if (no_hp == null || no_hp == "") {
// bootbox.alert({ message: 'No hp tidak boleh kosong', centerVertical: true });
// return false;
// } else if (ktp.toString().length > 16) {
// bootbox.alert({ message: 'KTP tidak boleh lebih dari 16 angka', centerVertical: true });
// return false;
// } else if (ktp.toString().length < 16) {
// bootbox.alert({ message: 'KTP tidak boleh kurang dari 16 angka', centerVertical: true });
// return false;
// } else if (no_hp.toString().length > 13) {
// bootbox.alert({ message: 'No HP tidak boleh lebih dari 13 angka', centerVertical: true });
// return false;
// }
if (response['code'] == 0) {
console.log(response);
let $id = response.data['id_pasien'];
let $encodedId = btoa($id);
window.location.href = ("datapasien/" + $encodedId);
} else {
bootbox.alert({ message: ' gagal', centerVertical: true });
}
}, error: function (xhr) {
if (xhr.status != 200) {
//bootbox.alert(xhr.status + "-" + xhr.statusText + " <br>Silahkan coba kembali :) ");
} else {
alert('dadas');
}
}
});
}
// alert('this');
var inputQuantity = [];
$(function () {
$("#ktp").each(function (i) {
inputQuantity[i] = this.defaultValue;
$(this).data("idx", i); // save this field's index to access later
});
$("#ktp").on("keyup", function (e) {
var $field = $(this),
val = this.value,
$thisIndex = parseInt($field.data("idx"), 10); // retrieve the index
// window.console && console.log($field.is(":invalid"));
// $field.is(":invalid") is for Safari, it must be the last to not error in IE8
if (this.validity && this.validity.badInput || isNaN(val) || $field.is(":invalid")) {
this.value = inputQuantity[$thisIndex];
return;
}
if (val.length > Number($field.attr("maxlength"))) {
val = val.slice(0, 16);
$field.val(val);
}
inputQuantity[$thisIndex] = val;
});
});
\ No newline at end of file
This diff is collapsed.
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