Update PelayananPasienServiceImpl.java
Perbaikan aturan visit, monitoring intervensi, dan monitoring hemodinamik gagal organ di logbook dokter remun baru
This commit is contained in:
parent
3a49154f40
commit
cf2e00a3b8
@ -484,6 +484,9 @@ public class PelayananPasienServiceImpl extends BaseVoServiceImpl implements Pel
|
||||
List<Integer> idsPenunjangBukanAnestesi = splitDataSettingDatafixed("pr_penunjang_nonanestesi");
|
||||
List<Integer> idsDokterBPJSffs = splitDataSettingDatafixed("dokterBPJSffs");
|
||||
List<Integer> idsDokterPediatrikGD = splitDataSettingDatafixed("pr_dokter_pediatrik_gd");
|
||||
List<Integer> idsMonitoringIntervensi = splitDataSettingDatafixed("idMonitoringIntervensi");
|
||||
List<Integer> idsMonitoringHemodinamikGagalOrgan = splitDataSettingDatafixed(
|
||||
"idMonitoringHemodinamikGagalOrgan");
|
||||
if (pegawaiDao.getDokterByKelompokKerja(Master.SubUnitKerja.KK_PATOLOGI_ANATOMI).contains(idPegawai)) {
|
||||
listDetailJenisProduk = idsRegDJPPenunjangPA;
|
||||
} else if (pegawaiDao.getDokterByKelompokKerja(Master.SubUnitKerja.KK_PATOLOGI_KLINIK).contains(idPegawai)) {
|
||||
@ -604,7 +607,7 @@ public class PelayananPasienServiceImpl extends BaseVoServiceImpl implements Pel
|
||||
}
|
||||
/*
|
||||
* Filter visite untuk pasien BPJS hanya diambil maksimal 1 kali per
|
||||
* registrasi pasien di luar dokter-dokter kk eria
|
||||
* pasien di luar dokter-dokter kk eria
|
||||
*/
|
||||
List<Map<String, Object>> rawDataBpjs2 = new ArrayList<>();
|
||||
if (!drKkPediatrikGDList.contains(idPegawai)) {
|
||||
@ -617,11 +620,13 @@ public class PelayananPasienServiceImpl extends BaseVoServiceImpl implements Pel
|
||||
if (Master.GolonganProduk.VISIT.equals(d.get("idGolonganProduk"))) {
|
||||
boolean existEpisode = false;
|
||||
for (Map<String, Object> e : listEpisode)
|
||||
if (e.get("id").toString().equals(d.get("idPasienDaftar")))
|
||||
if (e.get("id").toString().equals(d.get("idPasienDaftar"))
|
||||
&& e.get("idProduk").toString().equals(d.get("idProduk")))
|
||||
existEpisode = true;
|
||||
if (!existEpisode) {
|
||||
Map<String, Object> episode = new HashMap<>();
|
||||
episode.put("id", d.get("idPasienDaftar"));
|
||||
episode.put("idProduk", d.get("idProduk"));
|
||||
episode.put("count", 1);
|
||||
listEpisode.add(episode);
|
||||
}
|
||||
@ -635,7 +640,8 @@ public class PelayananPasienServiceImpl extends BaseVoServiceImpl implements Pel
|
||||
int count = 1;
|
||||
for (Map<String, Object> e : listEpisode)
|
||||
if (Master.GolonganProduk.VISIT.equals(d.get("idGolonganProduk"))) {
|
||||
if (d.get("idPasienDaftar").equals(e.get("id")) && e.get("count").equals(maxVisit)) {
|
||||
if (d.get("idPasienDaftar").equals(e.get("id")) && d.get("idProduk").equals(e.get("idProduk"))
|
||||
&& Integer.parseInt(e.get("count").toString()) <= maxVisit) {
|
||||
rawDataBpjs2.add(d);
|
||||
count = Integer.parseInt(e.get("count").toString());
|
||||
count++;
|
||||
@ -653,49 +659,175 @@ public class PelayananPasienServiceImpl extends BaseVoServiceImpl implements Pel
|
||||
}
|
||||
/*
|
||||
* Filter visite untuk pasien BPJS hanya diambil maksimal 2 kali per
|
||||
* hari per dokter kk eria
|
||||
* hari per dokter per pasien kk eria
|
||||
*/
|
||||
List<Map<String, Object>> rawDataBpjs3 = new ArrayList<>();
|
||||
if (drKkPediatrikGDList.contains(idPegawai)) {
|
||||
List<Map<String, Object>> visitBpjs = rawDataBpjs2.stream()
|
||||
.filter(d -> (Master.Ruangan.ICU_PICU.equals(d.get("idRuangan"))
|
||||
|| Master.Ruangan.NICU.equals(d.get("idRuangan")))
|
||||
&& Master.GolonganProduk.VISIT.equals(d.get("idGolonganProduk")))
|
||||
.sorted(Comparator.comparing(o -> (Date) o.get("tglPelayanan"),
|
||||
Comparator.nullsLast(Comparator.naturalOrder())))
|
||||
.collect(Collectors.toList());
|
||||
List<String> listIdPelayananPasien = new ArrayList<>();
|
||||
List<LocalDate> listLocalDate = new ArrayList<>();
|
||||
LocalDate startDate = tglAwal.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
|
||||
LocalDate endDate = tglAkhir.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
|
||||
for (LocalDate dateDay = startDate; dateDay.isBefore(endDate); dateDay = dateDay.plusDays(1)) {
|
||||
int count = 1;
|
||||
for (Map<String, Object> b : visitBpjs) {
|
||||
if (CommonUtil.isNotNullOrEmpty(b.get("tglPelayanan"))) {
|
||||
LocalDate sDate = ((Date) b.get("tglPelayanan")).toInstant().atZone(ZoneId.systemDefault())
|
||||
.toLocalDate();
|
||||
if (dateDay.equals(sDate) && !listLocalDate.contains(sDate) && count <= 2) {
|
||||
listLocalDate.add(sDate);
|
||||
listIdPelayananPasien.add(b.get("idPelayananPasien").toString());
|
||||
count++;
|
||||
}
|
||||
/*
|
||||
* Dapatkan semua pendaftaran BPJS untuk visite dokter-dokter kk
|
||||
* eria
|
||||
*/
|
||||
List<Map<String, Object>> listEpisode = new ArrayList<>();
|
||||
for (Map<String, Object> d : rawDataBpjs2) {
|
||||
if ((Master.Ruangan.ICU_PICU.equals(d.get("idRuangan"))
|
||||
|| Master.Ruangan.NICU.equals(d.get("idRuangan")))
|
||||
&& Master.GolonganProduk.VISIT.equals(d.get("idGolonganProduk"))) {
|
||||
boolean existEpisode = false;
|
||||
for (Map<String, Object> e : listEpisode)
|
||||
if (e.get("id").toString().equals(d.get("idPasienDaftar"))
|
||||
&& e.get("idProduk").toString().equals(d.get("idProduk")))
|
||||
existEpisode = true;
|
||||
if (!existEpisode) {
|
||||
Map<String, Object> episode = new HashMap<>();
|
||||
episode.put("id", d.get("idPasienDaftar"));
|
||||
episode.put("idProduk", d.get("idProduk"));
|
||||
episode.put("count", 1);
|
||||
listEpisode.add(episode);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (Map<String, Object> d : rawDataBpjs2)
|
||||
if ((Master.Ruangan.ICU_PICU.equals(d.get("idRuangan"))
|
||||
|| Master.Ruangan.NICU.equals(d.get("idRuangan")))
|
||||
&& Master.GolonganProduk.VISIT.equals(d.get("idGolonganProduk"))
|
||||
&& listIdPelayananPasien.contains(d.get("idPelayananPasien").toString())) {
|
||||
rawDataBpjs3.add(d);
|
||||
} else if ((!Master.Ruangan.ICU_PICU.equals(d.get("idRuangan"))
|
||||
/*
|
||||
* Assign to next new collection
|
||||
*/
|
||||
int maxVisit = 2;
|
||||
for (Map<String, Object> d : rawDataBpjs2) {
|
||||
int count = 1;
|
||||
for (Map<String, Object> e : listEpisode)
|
||||
if ((Master.Ruangan.ICU_PICU.equals(d.get("idRuangan"))
|
||||
|| Master.Ruangan.NICU.equals(d.get("idRuangan")))
|
||||
&& Master.GolonganProduk.VISIT.equals(d.get("idGolonganProduk"))) {
|
||||
if (d.get("idPasienDaftar").equals(e.get("id")) && d.get("idProduk").equals(e.get("idProduk"))
|
||||
&& Integer.parseInt(e.get("count").toString()) <= maxVisit) {
|
||||
rawDataBpjs3.add(d);
|
||||
count = Integer.parseInt(e.get("count").toString());
|
||||
count++;
|
||||
e.put("count", count);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
if ((!Master.Ruangan.ICU_PICU.equals(d.get("idRuangan"))
|
||||
&& !Master.Ruangan.NICU.equals(d.get("idRuangan")))
|
||||
|| !Master.GolonganProduk.VISIT.equals(d.get("idGolonganProduk"))) {
|
||||
|| !Master.GolonganProduk.VISIT.equals(d.get("idGolonganProduk")) && count == 1)
|
||||
rawDataBpjs3.add(d);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
rawDataBpjs3.addAll(rawDataBpjs2);
|
||||
}
|
||||
/*
|
||||
* Filter monitoring hemodinamik gagal organ untuk pasien BPJS hanya
|
||||
* diambil maksimal 2 kali per hari per pasien per dokter kk eria
|
||||
*/
|
||||
List<Map<String, Object>> rawDataBpjs4 = new ArrayList<>();
|
||||
if (drKkPediatrikGDList.contains(idPegawai)) {
|
||||
/*
|
||||
* Dapatkan semua pendaftaran BPJS untuk monitoring hemodinamik
|
||||
* gagal organ dokter-dokter kk eria
|
||||
*/
|
||||
List<Map<String, Object>> listEpisode = new ArrayList<>();
|
||||
for (Map<String, Object> d : rawDataBpjs3) {
|
||||
if ((Master.Ruangan.ICU_PICU.equals(d.get("idRuangan"))
|
||||
|| Master.Ruangan.NICU.equals(d.get("idRuangan")))
|
||||
&& idsMonitoringHemodinamikGagalOrgan.contains(d.get("idProduk"))) {
|
||||
boolean existEpisode = false;
|
||||
for (Map<String, Object> e : listEpisode)
|
||||
if (e.get("id").toString().equals(d.get("idPasienDaftar"))
|
||||
&& e.get("idProduk").toString().equals(d.get("idProduk")))
|
||||
existEpisode = true;
|
||||
if (!existEpisode) {
|
||||
Map<String, Object> episode = new HashMap<>();
|
||||
episode.put("id", d.get("idPasienDaftar"));
|
||||
episode.put("idProduk", d.get("idProduk"));
|
||||
episode.put("count", 1);
|
||||
listEpisode.add(episode);
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Assign to next new collection
|
||||
*/
|
||||
int maxMonitoring = 2;
|
||||
for (Map<String, Object> d : rawDataBpjs3) {
|
||||
int count = 1;
|
||||
for (Map<String, Object> e : listEpisode)
|
||||
if ((Master.Ruangan.ICU_PICU.equals(d.get("idRuangan"))
|
||||
|| Master.Ruangan.NICU.equals(d.get("idRuangan")))
|
||||
&& idsMonitoringHemodinamikGagalOrgan.contains(d.get("idProduk"))) {
|
||||
if (d.get("idPasienDaftar").equals(e.get("id")) && d.get("idProduk").equals(e.get("idProduk"))
|
||||
&& Integer.parseInt(e.get("count").toString()) <= maxMonitoring) {
|
||||
rawDataBpjs4.add(d);
|
||||
count = Integer.parseInt(e.get("count").toString());
|
||||
count++;
|
||||
e.put("count", count);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
if ((!Master.Ruangan.ICU_PICU.equals(d.get("idRuangan"))
|
||||
&& !Master.Ruangan.NICU.equals(d.get("idRuangan")))
|
||||
|| !idsMonitoringHemodinamikGagalOrgan.contains(d.get("idProduk")) && count == 1)
|
||||
rawDataBpjs4.add(d);
|
||||
}
|
||||
} else {
|
||||
rawDataBpjs4.addAll(rawDataBpjs3);
|
||||
}
|
||||
/*
|
||||
* Filter monitoring intervensi untuk pasien BPJS hanya diambil maksimal
|
||||
* 2 kali per hari per pasien per dokter kk perinatologi
|
||||
*/
|
||||
List<Map<String, Object>> rawDataBpjs5 = new ArrayList<>();
|
||||
if (drKkPerinatologiList.contains(idPegawai)) {
|
||||
/*
|
||||
* Dapatkan semua pendaftaran BPJS untuk monitoring intervensi
|
||||
* dokter-dokter kk perinatologi
|
||||
*/
|
||||
List<Map<String, Object>> listEpisode = new ArrayList<>();
|
||||
for (Map<String, Object> d : rawDataBpjs4) {
|
||||
if (Master.Ruangan.NICU.equals(d.get("idRuangan"))
|
||||
&& idsMonitoringIntervensi.contains(d.get("idProduk"))) {
|
||||
boolean existEpisode = false;
|
||||
for (Map<String, Object> e : listEpisode)
|
||||
if (e.get("id").toString().equals(d.get("idPasienDaftar"))
|
||||
&& e.get("idProduk").toString().equals(d.get("idProduk")))
|
||||
existEpisode = true;
|
||||
if (!existEpisode) {
|
||||
Map<String, Object> episode = new HashMap<>();
|
||||
episode.put("id", d.get("idPasienDaftar"));
|
||||
episode.put("idProduk", d.get("idProduk"));
|
||||
episode.put("count", 1);
|
||||
listEpisode.add(episode);
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Assign to next new collection
|
||||
*/
|
||||
int maxMonitoring = 2;
|
||||
for (Map<String, Object> d : rawDataBpjs4) {
|
||||
int count = 1;
|
||||
for (Map<String, Object> e : listEpisode)
|
||||
if (Master.Ruangan.NICU.equals(d.get("idRuangan"))
|
||||
&& idsMonitoringIntervensi.contains(d.get("idProduk"))) {
|
||||
if (d.get("idPasienDaftar").equals(e.get("id")) && d.get("idProduk").equals(e.get("idProduk"))
|
||||
&& Integer.parseInt(e.get("count").toString()) <= maxMonitoring) {
|
||||
rawDataBpjs5.add(d);
|
||||
count = Integer.parseInt(e.get("count").toString());
|
||||
count++;
|
||||
e.put("count", count);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
if ((!Master.Ruangan.NICU.equals(d.get("idRuangan"))
|
||||
|| !idsMonitoringIntervensi.contains(d.get("idProduk"))) && count == 1)
|
||||
rawDataBpjs5.add(d);
|
||||
}
|
||||
} else {
|
||||
rawDataBpjs5.addAll(rawDataBpjs4);
|
||||
}
|
||||
/*
|
||||
* Dapatkan semua pendaftaran non-jkn
|
||||
*/
|
||||
@ -705,11 +837,13 @@ public class PelayananPasienServiceImpl extends BaseVoServiceImpl implements Pel
|
||||
&& Master.Departemen.BEDAH_SENTRAL.equals(d.get("idDepartemen"))) {
|
||||
boolean existEpisode = false;
|
||||
for (Map<String, Object> e : listEpisode)
|
||||
if (e.get("id").toString().equals(d.get("idPasienDaftar")))
|
||||
if (e.get("id").toString().equals(d.get("idPasienDaftar"))
|
||||
&& e.get("idProduk").toString().equals(d.get("idProduk")))
|
||||
existEpisode = true;
|
||||
if (!existEpisode) {
|
||||
Map<String, Object> episode = new HashMap<>();
|
||||
episode.put("id", d.get("idPasienDaftar"));
|
||||
episode.put("idProduk", d.get("idProduk"));
|
||||
episode.put("count", 1);
|
||||
listEpisode.add(episode);
|
||||
}
|
||||
@ -723,7 +857,7 @@ public class PelayananPasienServiceImpl extends BaseVoServiceImpl implements Pel
|
||||
for (Map<String, Object> e : listEpisode) {
|
||||
if (!Arrays.asList(Master.KelompokPasien.KELOMPOK_BPJS).contains(d.get("idKelompokPasien"))
|
||||
&& Master.Departemen.BEDAH_SENTRAL.equals(d.get("idDepartemen"))
|
||||
&& d.get("idPasienDaftar").equals(e.get("id"))) {
|
||||
&& d.get("idPasienDaftar").equals(e.get("id")) && d.get("idProduk").equals(e.get("idProduk"))) {
|
||||
if (e.get("count").equals(1)) {
|
||||
/*
|
||||
* Mendapatkan 100% dari tarif
|
||||
@ -920,7 +1054,7 @@ public class PelayananPasienServiceImpl extends BaseVoServiceImpl implements Pel
|
||||
* Offer data yang sudah diurutkan dalam queue
|
||||
*/
|
||||
Queue<Map<String, Object>> queuePelayanan = new ArrayDeque<>();
|
||||
rawDataBpjs3.forEach(pelayanan -> {
|
||||
rawDataBpjs5.forEach(pelayanan -> {
|
||||
queuePelayanan.offer(pelayanan);
|
||||
});
|
||||
listDataJamKerja.forEach(pelayanan -> {
|
||||
@ -1601,11 +1735,13 @@ public class PelayananPasienServiceImpl extends BaseVoServiceImpl implements Pel
|
||||
&& Master.Departemen.BEDAH_SENTRAL.equals(d.get("idDepartemen"))) {
|
||||
boolean existEpisode = false;
|
||||
for (Map<String, Object> e : listEpisode)
|
||||
if (e.get("id").toString().equals(d.get("idPasienDaftar")))
|
||||
if (e.get("id").toString().equals(d.get("idPasienDaftar"))
|
||||
&& e.get("idProduk").toString().equals(d.get("idProduk")))
|
||||
existEpisode = true;
|
||||
if (!existEpisode) {
|
||||
Map<String, Object> episode = new HashMap<>();
|
||||
episode.put("id", d.get("idPasienDaftar"));
|
||||
episode.put("idProduk", d.get("idProduk"));
|
||||
episode.put("count", 1);
|
||||
listEpisode.add(episode);
|
||||
}
|
||||
@ -1619,7 +1755,7 @@ public class PelayananPasienServiceImpl extends BaseVoServiceImpl implements Pel
|
||||
for (Map<String, Object> e : listEpisode) {
|
||||
if (!Arrays.asList(Master.KelompokPasien.KELOMPOK_BPJS).contains(d.get("idKelompokPasien"))
|
||||
&& Master.Departemen.BEDAH_SENTRAL.equals(d.get("idDepartemen"))
|
||||
&& d.get("idPasienDaftar").equals(e.get("id"))) {
|
||||
&& d.get("idPasienDaftar").equals(e.get("id")) && d.get("idProduk").equals(e.get("idProduk"))) {
|
||||
if (e.get("count").equals(1)) {
|
||||
/*
|
||||
* Mendapatkan 100% dari tarif
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user