- perbaikan service pengecekan data duplikat saat entri skoring tindakan medis ikut menggunakan tanggal berlaku
- perbaikan service pengecekan data duplikat saat entri skoring tindakan perawat ikut menggunakan tanggal berlaku - perbaikan service tampilan daftar skoring tindakan medis dengan distict juga tanggal berlaku - perbaikan service tampilan daftar skoring tindakan perawat dengan distict juga tanggal berlaku
This commit is contained in:
parent
c3ff8b0f35
commit
e5ef9e41a7
@ -363,6 +363,7 @@ public class Master {
|
||||
public static final Integer[] MEDIS = { 38, 30, 35, 31, 32, 34, 33, 71, 36 };
|
||||
|
||||
public static final Integer BAG_SDM = 24;
|
||||
public static final Integer BID_WAT = 21;
|
||||
public static final Integer KSM_UMUM = 62;
|
||||
public static final Integer DIREKSI = 65;
|
||||
}
|
||||
|
||||
@ -102,19 +102,35 @@ public interface SkoringTindakanMedisDao extends PagingAndSortingRepository<Skor
|
||||
+ "and stm.kelompokKerjaId = :kelompokKerjaId " + "and stm.skor = :skor "
|
||||
+ "and lower(regexp_replace(stm.detailProduk,:patternText,'','g')) = :detailProduk";
|
||||
|
||||
String tglBerlaku = " and to_char(stm.tanggalMulaiBerlaku,'yyyy-MM-dd') = :tglMulaiBerlaku";
|
||||
|
||||
String idSkoring = " and stm.noRec <> :noRec";
|
||||
|
||||
@Query(strCekDupSkoring)
|
||||
List<String> findDupSkoring(@Param("namaProduk") String namaProduk,
|
||||
String sortTglBerlaku = " order by stm.tanggalMulaiBerlaku desc";
|
||||
|
||||
@Query(strCekDupSkoring + sortTglBerlaku)
|
||||
List<String> findLastDupSkoring(@Param("namaProduk") String namaProduk,
|
||||
@Param("kelompokKerjaId") Integer idKelompokKerja, @Param("skor") Double skor,
|
||||
@Param("patternText") String patternText, @Param("detailProduk") String detailProduk);
|
||||
|
||||
@Query(strCekDupSkoring + idSkoring)
|
||||
@Query(strCekDupSkoring + tglBerlaku)
|
||||
List<String> findDupSkoring(@Param("namaProduk") String namaProduk,
|
||||
@Param("kelompokKerjaId") Integer idKelompokKerja, @Param("skor") Double skor,
|
||||
@Param("tglMulaiBerlaku") String tglMulaiBerlaku, @Param("patternText") String patternText,
|
||||
@Param("detailProduk") String detailProduk);
|
||||
|
||||
@Query(strCekDupSkoring + idSkoring + sortTglBerlaku)
|
||||
List<String> findLastDupSkoring(@Param("namaProduk") String namaProduk,
|
||||
@Param("kelompokKerjaId") Integer idKelompokKerja, @Param("skor") Double skor,
|
||||
@Param("patternText") String patternText, @Param("detailProduk") String detailProduk,
|
||||
@Param("noRec") String noRec);
|
||||
|
||||
@Query(strCekDupSkoring + tglBerlaku + idSkoring)
|
||||
List<String> findDupSkoring(@Param("namaProduk") String namaProduk,
|
||||
@Param("kelompokKerjaId") Integer idKelompokKerja, @Param("skor") Double skor,
|
||||
@Param("tglMulaiBerlaku") String tglMulaiBerlaku, @Param("patternText") String patternText,
|
||||
@Param("detailProduk") String detailProduk, @Param("noRec") String noRec);
|
||||
|
||||
@Query("select new Map(stm.noRec as noRec,stm.detailProduk as detailProduk) " + "from SkoringTindakanMedis stm "
|
||||
+ "where stm.statusEnabled is true " + "and stm.noRec in (:listNorec)")
|
||||
List<Map<String, Object>> findAllDup(@Param("listNorec") List<String> listNorec);
|
||||
|
||||
@ -63,16 +63,29 @@ public interface SkoringTindakanPerawatDao extends PagingAndSortingRepository<Sk
|
||||
+ "where stp.statusEnabled is true "
|
||||
+ "and lower(regexp_replace(prp.namaProduk,:patternText,'','g')) = :namaProduk " + "and stp.skor = :skor";
|
||||
|
||||
String tglBerlaku = " and to_char(stp.tanggalMulaiBerlaku,'yyyy-MM-dd') = :tglMulaiBerlaku";
|
||||
|
||||
String idSkoring = " and stp.noRec <> :noRec";
|
||||
|
||||
@Query(strCekDupSkoring)
|
||||
List<String> findDupSkoring(@Param("namaProduk") String namaProduk, @Param("skor") Double skor,
|
||||
String sortTglBerlaku = " order by stp.tanggalMulaiBerlaku desc";
|
||||
|
||||
@Query(strCekDupSkoring + sortTglBerlaku)
|
||||
List<String> findLastDupSkoring(@Param("namaProduk") String namaProduk, @Param("skor") Double skor,
|
||||
@Param("patternText") String patternText);
|
||||
|
||||
@Query(strCekDupSkoring + idSkoring)
|
||||
@Query(strCekDupSkoring + tglBerlaku)
|
||||
List<String> findDupSkoring(@Param("namaProduk") String namaProduk, @Param("skor") Double skor,
|
||||
@Param("tglMulaiBerlaku") String tglMulaiBerlaku, @Param("patternText") String patternText);
|
||||
|
||||
@Query(strCekDupSkoring + idSkoring + sortTglBerlaku)
|
||||
List<String> findLastDupSkoring(@Param("namaProduk") String namaProduk, @Param("skor") Double skor,
|
||||
@Param("patternText") String patternText, @Param("noRec") String noRec);
|
||||
|
||||
@Query(strCekDupSkoring + tglBerlaku + idSkoring)
|
||||
List<String> findDupSkoring(@Param("namaProduk") String namaProduk, @Param("skor") Double skor,
|
||||
@Param("tglMulaiBerlaku") String tglMulaiBerlaku, @Param("patternText") String patternText,
|
||||
@Param("noRec") String noRec);
|
||||
|
||||
@Query("select new Map(stp.noRec as noRec,stp.skor as skor," + "prp.namaProduk as namaProduk) "
|
||||
+ "from SkoringTindakanPerawat stp " + "inner join stp.produk prp " + "where stp.statusEnabled is true "
|
||||
+ "and stp.noRec in (:listNorec)")
|
||||
|
||||
@ -17,7 +17,7 @@ public interface SkoringTindakanMedisService
|
||||
List<Map<String, Object>> findDaftarInputTindakanByRuanganKelas(Integer idRuangan) throws JpaSystemException;
|
||||
|
||||
List<Map<String, Object>> findDuplicateSkoring(String namaProduk, Integer idKelompokKerja, Double skor,
|
||||
String detailProduk, String noRec) throws JpaSystemException;
|
||||
String detailProduk, Long tglMulaiBerlaku, String noRec) throws JpaSystemException;
|
||||
|
||||
Map<String, Object> findAkses(Integer idPegawai) throws JpaSystemException;
|
||||
|
||||
|
||||
@ -14,7 +14,7 @@ public interface SkoringTindakanPerawatService
|
||||
List<Map<String, Object>> findAllEnabled(String namaProduk, Boolean isVerif, Short kdKlasif)
|
||||
throws JpaSystemException;
|
||||
|
||||
List<Map<String, Object>> findDuplicateSkoring(String namaProduk, Double skor, String noRec)
|
||||
List<Map<String, Object>> findDuplicateSkoring(String namaProduk, Double skor, Long tglMulaiBerlaku, String noRec)
|
||||
throws JpaSystemException;
|
||||
|
||||
Map<String, Object> findAkses(Integer idPegawai) throws JpaSystemException;
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
package com.jasamedika.medifirst2000.service.impl;
|
||||
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
@ -233,7 +235,8 @@ public class SkoringTindakanMedisServiceImpl extends BaseVoServiceImpl implement
|
||||
boolean isContained = false;
|
||||
for (Map<String, Object> mapFilter : filter) {
|
||||
if (mapData.get("produkId").equals(mapFilter.get("produkId"))
|
||||
&& mapData.get("kelompokKerjaId").equals(mapFilter.get("kelompokKerjaId"))) {
|
||||
&& mapData.get("kelompokKerjaId").equals(mapFilter.get("kelompokKerjaId"))
|
||||
&& mapData.get("tglMulaiBerlaku").equals(mapFilter.get("tglMulaiBerlaku"))) {
|
||||
isContained = true;
|
||||
break;
|
||||
}
|
||||
@ -242,6 +245,7 @@ public class SkoringTindakanMedisServiceImpl extends BaseVoServiceImpl implement
|
||||
Map<String, Object> mapFilter = new HashMap<>();
|
||||
mapFilter.put("produkId", mapData.get("produkId"));
|
||||
mapFilter.put("kelompokKerjaId", mapData.get("kelompokKerjaId"));
|
||||
mapFilter.put("tglMulaiBerlaku", mapData.get("tglMulaiBerlaku"));
|
||||
filter.add(mapFilter);
|
||||
}
|
||||
}
|
||||
@ -249,7 +253,8 @@ public class SkoringTindakanMedisServiceImpl extends BaseVoServiceImpl implement
|
||||
for (Map<String, Object> mapFilter : filter) {
|
||||
for (Map<String, Object> mapData : data) {
|
||||
if (mapFilter.get("produkId").equals(mapData.get("produkId"))
|
||||
&& mapFilter.get("kelompokKerjaId").equals(mapData.get("kelompokKerjaId"))) {
|
||||
&& mapFilter.get("kelompokKerjaId").equals(mapData.get("kelompokKerjaId"))
|
||||
&& mapFilter.get("tglMulaiBerlaku").equals(mapData.get("tglMulaiBerlaku"))) {
|
||||
result.add(mapData);
|
||||
break;
|
||||
}
|
||||
@ -269,19 +274,29 @@ public class SkoringTindakanMedisServiceImpl extends BaseVoServiceImpl implement
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> findDuplicateSkoring(String namaProduk, Integer idKelompokKerja, Double skor,
|
||||
String detailProduk, String noRec) throws JpaSystemException {
|
||||
String detailProduk, Long tglMulaiBerlaku, String noRec) throws JpaSystemException {
|
||||
List<Map<String, Object>> result = new ArrayList<>();
|
||||
List<String> listNorec = new ArrayList<>();
|
||||
|
||||
DateFormat df = new SimpleDateFormat("yyyy-MM-dd");
|
||||
|
||||
String patternText = settingDataFixedDao.getSettingDataFixed("patternTextDuplicate");
|
||||
String replacedNamaProduk = namaProduk.replaceAll(patternText, "").toLowerCase();
|
||||
String replacedDetailProduk = detailProduk.replaceAll(patternText, "").toLowerCase();
|
||||
if (CommonUtil.isNotNullOrEmpty(noRec)) {
|
||||
listNorec = skoringTindakanMedisDao.findDupSkoring(replacedNamaProduk, idKelompokKerja, skor, patternText,
|
||||
replacedDetailProduk, noRec);
|
||||
listNorec = skoringTindakanMedisDao.findLastDupSkoring(replacedNamaProduk, idKelompokKerja, skor,
|
||||
patternText, replacedDetailProduk, noRec);
|
||||
if (CommonUtil.isNullOrEmpty(listNorec)) {
|
||||
listNorec = skoringTindakanMedisDao.findDupSkoring(replacedNamaProduk, idKelompokKerja, skor,
|
||||
df.format(new Date(tglMulaiBerlaku)), patternText, replacedDetailProduk, noRec);
|
||||
}
|
||||
} else {
|
||||
listNorec = skoringTindakanMedisDao.findDupSkoring(replacedNamaProduk, idKelompokKerja, skor, patternText,
|
||||
replacedDetailProduk);
|
||||
listNorec = skoringTindakanMedisDao.findLastDupSkoring(replacedNamaProduk, idKelompokKerja, skor,
|
||||
patternText, replacedDetailProduk);
|
||||
if (CommonUtil.isNullOrEmpty(listNorec)) {
|
||||
listNorec = skoringTindakanMedisDao.findDupSkoring(replacedNamaProduk, idKelompokKerja, skor,
|
||||
df.format(new Date(tglMulaiBerlaku)), patternText, replacedDetailProduk);
|
||||
}
|
||||
}
|
||||
|
||||
if (CommonUtil.isNotNullOrEmpty(listNorec)) {
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
package com.jasamedika.medifirst2000.service.impl;
|
||||
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
@ -190,7 +192,8 @@ public class SkoringTindakanPerawatServiceImpl extends BaseVoServiceImpl impleme
|
||||
for (Map<String, Object> mapData : data) {
|
||||
boolean isContained = false;
|
||||
for (Map<String, Object> mapFilter : filter) {
|
||||
if (mapData.get("produkId").equals(mapFilter.get("produkId"))) {
|
||||
if (mapData.get("produkId").equals(mapFilter.get("produkId"))
|
||||
&& mapData.get("tglMulaiBerlaku").equals(mapFilter.get("tglMulaiBerlaku"))) {
|
||||
isContained = true;
|
||||
break;
|
||||
}
|
||||
@ -198,13 +201,18 @@ public class SkoringTindakanPerawatServiceImpl extends BaseVoServiceImpl impleme
|
||||
if (!isContained) {
|
||||
Map<String, Object> mapFilter = new HashMap<>();
|
||||
mapFilter.put("produkId", mapData.get("produkId"));
|
||||
mapFilter.put("tglMulaiBerlaku", mapData.get("tglMulaiBerlaku"));
|
||||
filter.add(mapFilter);
|
||||
}
|
||||
}
|
||||
|
||||
for (Map<String, Object> mapFilter : filter) {
|
||||
for (Map<String, Object> mapData : data) {
|
||||
if (mapFilter.get("produkId").equals(mapData.get("produkId"))) {
|
||||
if (mapFilter.get("produkId").equals(mapData.get("produkId"))
|
||||
&& mapFilter.get("tglMulaiBerlaku").equals(mapData.get("tglMulaiBerlaku"))) {
|
||||
// data hanya untuk diakses oleh bidang keperawatan
|
||||
mapData.put("unitKerjaId", Master.UnitKerja.BID_WAT);
|
||||
|
||||
result.add(mapData);
|
||||
break;
|
||||
}
|
||||
@ -215,17 +223,27 @@ public class SkoringTindakanPerawatServiceImpl extends BaseVoServiceImpl impleme
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> findDuplicateSkoring(String namaProduk, Double skor, String noRec)
|
||||
throws JpaSystemException {
|
||||
public List<Map<String, Object>> findDuplicateSkoring(String namaProduk, Double skor, Long tglMulaiBerlaku,
|
||||
String noRec) throws JpaSystemException {
|
||||
List<Map<String, Object>> result = new ArrayList<>();
|
||||
List<String> listNorec = new ArrayList<>();
|
||||
|
||||
DateFormat df = new SimpleDateFormat("yyyy-MM-dd");
|
||||
|
||||
String patternText = settingDataFixedDao.getSettingDataFixed("patternTextDuplicate");
|
||||
String replacedNamaProduk = namaProduk.replaceAll(patternText, "").toLowerCase();
|
||||
if (CommonUtil.isNotNullOrEmpty(noRec)) {
|
||||
listNorec = skoringTindakanDao.findDupSkoring(replacedNamaProduk, skor, patternText, noRec);
|
||||
listNorec = skoringTindakanDao.findLastDupSkoring(replacedNamaProduk, skor, patternText, noRec);
|
||||
if (CommonUtil.isNullOrEmpty(listNorec)) {
|
||||
listNorec = skoringTindakanDao.findDupSkoring(replacedNamaProduk, skor,
|
||||
df.format(new Date(tglMulaiBerlaku)), patternText, noRec);
|
||||
}
|
||||
} else {
|
||||
listNorec = skoringTindakanDao.findDupSkoring(replacedNamaProduk, skor, patternText);
|
||||
listNorec = skoringTindakanDao.findLastDupSkoring(replacedNamaProduk, skor, patternText);
|
||||
if (CommonUtil.isNullOrEmpty(listNorec)) {
|
||||
listNorec = skoringTindakanDao.findDupSkoring(replacedNamaProduk, skor,
|
||||
df.format(new Date(tglMulaiBerlaku)), patternText);
|
||||
}
|
||||
}
|
||||
|
||||
if (CommonUtil.isNotNullOrEmpty(listNorec)) {
|
||||
@ -242,7 +260,7 @@ public class SkoringTindakanPerawatServiceImpl extends BaseVoServiceImpl impleme
|
||||
List<Integer> listIdUnitKerja = new ArrayList<>();
|
||||
List<Integer> listUnitKerjaSuperuser = new ArrayList<>();
|
||||
|
||||
listIdUnitKerja.addAll(Arrays.asList(Master.UnitKerja.MEDIS));
|
||||
listIdUnitKerja.add(Master.UnitKerja.BID_WAT);
|
||||
listUnitKerjaSuperuser.add(Master.UnitKerja.BAG_SDM);
|
||||
|
||||
List<Map<String, Object>> listSuperuser = mappingJabatanDao.findAksesPegawaiPenilai(listIdUnitKerja, idPegawai);
|
||||
|
||||
@ -672,10 +672,11 @@ public class IkiDanRemunerasiController extends LocaleController<IkiDanRemuneras
|
||||
@RequestParam(value = "namaProduk", required = true) String namaProduk,
|
||||
@RequestParam(value = "kelompokKerjaId", required = true) Integer idKelompokKerja,
|
||||
@RequestParam(value = "detailProduk", required = true) String detailProduk,
|
||||
@RequestParam(value = "skor", required = true) Double skor) throws ParseException {
|
||||
@RequestParam(value = "skor", required = true) Double skor,
|
||||
@RequestParam(value = "tglBerlaku", required = true) Long tglMulaiBerlaku) throws ParseException {
|
||||
try {
|
||||
List<Map<String, Object>> result = skoringTindakanMedisService.findDuplicateSkoring(namaProduk,
|
||||
idKelompokKerja, skor, detailProduk, noRec);
|
||||
idKelompokKerja, skor, detailProduk, tglMulaiBerlaku, noRec);
|
||||
mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_SUCCESS,
|
||||
getMessage(MessageResource.LABEL_SUCCESS, request));
|
||||
return RestUtil.getJsonResponse(result, HttpStatus.OK, mapHeaderMessage);
|
||||
@ -1455,10 +1456,11 @@ public class IkiDanRemunerasiController extends LocaleController<IkiDanRemuneras
|
||||
public ResponseEntity<List<Map<String, Object>>> getDuplikatSkoringTindakanPerawat(HttpServletRequest request,
|
||||
@RequestParam(value = "noRec", required = false) String noRec,
|
||||
@RequestParam(value = "namaProduk", required = true) String namaProduk,
|
||||
@RequestParam(value = "skor", required = true) Double skor) throws ParseException {
|
||||
@RequestParam(value = "skor", required = true) Double skor,
|
||||
@RequestParam(value = "tglBerlaku", required = true) Long tglMulaiBerlaku) throws ParseException {
|
||||
try {
|
||||
List<Map<String, Object>> result = skoringTindakanPerawatService.findDuplicateSkoring(namaProduk, skor,
|
||||
noRec);
|
||||
tglMulaiBerlaku, noRec);
|
||||
mapHeaderMessage.put(WebConstants.HttpHeaderInfo.LABEL_SUCCESS,
|
||||
getMessage(MessageResource.LABEL_SUCCESS, request));
|
||||
return RestUtil.getJsonResponse(result, HttpStatus.OK, mapHeaderMessage);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user