Skip to content

Instantly share code, notes, and snippets.

@mdestafadilah
Created February 22, 2025 21:28
Show Gist options
  • Save mdestafadilah/2b715b80897852b260abcf5547e10ce8 to your computer and use it in GitHub Desktop.
Save mdestafadilah/2b715b80897852b260abcf5547e10ce8 to your computer and use it in GitHub Desktop.
BPJS-AKTIF-CEK
function checkStatusAktifBpjs() {
var jenis_identitas = $('.jenis_identitas').val();
if(jenis_identitas=='NIK'){
var jml_karakter = 16;
var jenis_identitas = 'nik';
var nomor_asuransi = $('.ktp').val();
}else{
var jml_karakter = 13;
var jenis_identitas = 'nomor_kartu';
var nomor_asuransi = $('.nomor_asuransi').val();
}
if (nomor_asuransi.length == jml_karakter) {
$.ajax({
url: "/bpjs-peserta/",
type: "GET",
data: {
nomor_asuransi: nomor_asuransi,
jenis:jenis_identitas,
x_session:'fb6036a29cee08dfbdbf9f5c30c2d74a'
},
beforeSend: function() {
//$("#loaderDiv").show();
//$("#overlay").fadeIn(300);
},
success: function (response) {
console.log(response);
// setTimeout(function(){
// $("#overlay").fadeOut(300);
// },500);
if(response.status_code==50000){
swal({
title: "GAGAL MENGAKSES SERVER BPJS",
text: "Silahkan Cek Username Atau Password Pcare Anda",
icon: "warning",
buttons: {
cancel: {
text: "Tutup",
value: null,
visible: true,
className: "btn btn-secondary",
closeModal: true,
},
confirm: {
text: "Cek Setting Sekarang",
value: true,
visible: true,
className: "btn btn-primary",
},
},
customClass: 'sweet-alert',
}).then((willCheck) => {
if (willCheck) {
window.location.href = "/setting?tab=briging_bpjs";
}
});
}
if (response.status_code != 200 && response.status_code !=50000) {
} else {
$('.nomor_hp').val(response.response.noHP);
$('.nomor_bpjs').val(response.response.noKartu);
$('.nama_pasien').val(response.response.nama);
$('.tanggal_lahir').val(response.response.tglLahir);
$('.tanggal_lahir').trigger('change');
if(jenis_identitas=='nomor_kartu'){
$('.ktp').val(response.response.noKTP);
}
cek_ihs();
}
},
fail: function (xhr, textStatus, errorThrown) {
alert('terjadi error');
}
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment