Update LogbookKinerjaServiceImpl.java
Penambahan hitung real-time capaian indikator jumlah skor tindakan KTKL
This commit is contained in:
parent
4705b4d248
commit
82658466f5
@ -1,7 +1,6 @@
|
||||
package com.jasamedika.medifirst2000.dao;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
import org.springframework.data.repository.PagingAndSortingRepository;
|
||||
@ -17,15 +16,8 @@ import com.jasamedika.medifirst2000.entities.PelayananNakes;
|
||||
@Repository("pelayananNakesDao")
|
||||
public interface PelayananNakesDao extends PagingAndSortingRepository<PelayananNakes, String> {
|
||||
|
||||
@Query("select new Map(pp.noRec as noRec," + "pr.id as produkId,pr.namaProduk as namaProduk,"
|
||||
+ "pfs.id as profesiId,pfs.namaProfesi as namaProfesi,"
|
||||
+ "pp.tglPelayanan as tglPelayanan,to_char(pp.tglPelayanan,'dd-MM-yyyy HH24:MI:ss') as tglPelayananFormatted,"
|
||||
+ "pp.jumlah as jumlah,pp.skor as skor,(pp.jumlah*pp.skor) as tSkor,pp.catatan as catatan,"
|
||||
+ "pg.id as pegawaiId,pg.namaLengkap as namaLengkap) " + "from PelayananNakes pp "
|
||||
+ "inner join pp.produk pr " + "inner join pr.profesi pfs " + "left join pp.pegawai pg "
|
||||
+ "where pp.statusEnabled is true " + "and pr.kdProduk = 2 "
|
||||
+ "and to_char(pp.tglPelayanan,'yyyy-MM') = :bulan " + "and pg.id = :pegawaiId "
|
||||
+ "order by pp.tglPelayanan")
|
||||
List<Map<String, Object>> findDetailLogbook(@Param("bulan") String bulan, @Param("pegawaiId") Integer idPegawai);
|
||||
@Query("select pn from PelayananNakes pn " + "where pn.statusEnabled is true "
|
||||
+ "and to_char(pn.tglPelayanan,'yyyy-MM') = :bulan " + "and pn.pegawaiId = :pegawaiId")
|
||||
List<PelayananNakes> findAllByKontrak(@Param("bulan") String bulan, @Param("pegawaiId") Integer idPegawai);
|
||||
|
||||
}
|
||||
|
||||
@ -25,4 +25,9 @@ public interface PelayananPasienNakesDao extends PagingAndSortingRepository<Pela
|
||||
List<Map<String, Object>> findByAntrianPasienDiperiksa(@Param("norecAPD") String noRec,
|
||||
@Param("pegawaiId") Integer idPegawai);
|
||||
|
||||
@Query("select ppn from PelayananPasienNakes ppn " + "where ppn.statusEnabled is true "
|
||||
+ "and to_char(ppn.tglPelayanan,'yyyy-MM') = :bulan " + "and ppn.pegawaiId = :pegawaiId")
|
||||
List<PelayananPasienNakes> findAllPelayananByKontrak(@Param("bulan") String bulan,
|
||||
@Param("pegawaiId") Integer idPegawai);
|
||||
|
||||
}
|
||||
|
||||
@ -39,6 +39,8 @@ import com.jasamedika.medifirst2000.dao.LogbookKinerjaDokterDao;
|
||||
import com.jasamedika.medifirst2000.dao.MapPegawaiJabatanToUnitKerjaDao;
|
||||
import com.jasamedika.medifirst2000.dao.MapPegawaiLaboratRadiologiDao;
|
||||
import com.jasamedika.medifirst2000.dao.PegawaiDao;
|
||||
import com.jasamedika.medifirst2000.dao.PelayananNakesDao;
|
||||
import com.jasamedika.medifirst2000.dao.PelayananPasienNakesDao;
|
||||
import com.jasamedika.medifirst2000.dao.PelayananPasienPetugasDao;
|
||||
import com.jasamedika.medifirst2000.dao.ShiftKerjaDao;
|
||||
import com.jasamedika.medifirst2000.dao.SkoringTindakanMedisDao;
|
||||
@ -51,6 +53,8 @@ import com.jasamedika.medifirst2000.entities.Kalender;
|
||||
import com.jasamedika.medifirst2000.entities.LogbookKinerja;
|
||||
import com.jasamedika.medifirst2000.entities.LogbookKinerjaDokter;
|
||||
import com.jasamedika.medifirst2000.entities.Pegawai;
|
||||
import com.jasamedika.medifirst2000.entities.PelayananNakes;
|
||||
import com.jasamedika.medifirst2000.entities.PelayananPasienNakes;
|
||||
import com.jasamedika.medifirst2000.entities.SatuanIndikator;
|
||||
import com.jasamedika.medifirst2000.exception.ServiceVOException;
|
||||
import com.jasamedika.medifirst2000.service.CatatanPerkembanganPasienTerintegrasiService;
|
||||
@ -139,6 +143,12 @@ public class LogbookKinerjaServiceImpl extends BaseVoServiceImpl implements Logb
|
||||
@Autowired
|
||||
private PelayananPasienPetugasDao pelayananPasienPetugasDao;
|
||||
|
||||
@Autowired
|
||||
private PelayananPasienNakesDao pelayananPasienNakesDao;
|
||||
|
||||
@Autowired
|
||||
private PelayananNakesDao pelayananNakesDao;
|
||||
|
||||
@Override
|
||||
public LogbookKinerjaVO add(LogbookKinerjaVO vo) throws JpaSystemException, ServiceVOException {
|
||||
Pegawai pegawai = pegawaiConverter.transferVOToModel(vo.getPegawai(), new Pegawai());
|
||||
@ -651,9 +661,11 @@ public class LogbookKinerjaServiceImpl extends BaseVoServiceImpl implements Logb
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// TODO inserted by ITI-14 [Nov 19, 2021,
|
||||
// 5:14:28 PM] : Detail Indikator Kinerja
|
||||
// lainnya
|
||||
/**
|
||||
* TODO inserted by salmanoe [Nov 19, 2021,
|
||||
* 5:14:28 PM] : Detail Indikator Kinerja
|
||||
* lainnya
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
@ -670,6 +682,28 @@ public class LogbookKinerjaServiceImpl extends BaseVoServiceImpl implements Logb
|
||||
new BigDecimal(Double.valueOf(map.get("fragCapaian").toString())).setScale(2,
|
||||
RoundingMode.HALF_UP));
|
||||
data.add(map);
|
||||
} else if (Master.IndikatorKinerja.PELAYANAN_NAKES.equals(map.get("idIndikator"))) {
|
||||
List<PelayananPasienNakes> listPelayananPasien = pelayananPasienNakesDao
|
||||
.findAllPelayananByKontrak(mf.format(new Date(bulan)), idPegawai);
|
||||
List<PelayananNakes> listPelayananNonpasien = pelayananNakesDao
|
||||
.findAllByKontrak(mf.format(new Date(bulan)), idPegawai);
|
||||
|
||||
double capaian = 0.0;
|
||||
for (PelayananPasienNakes pelayananPasien : listPelayananPasien) {
|
||||
capaian += pelayananPasien.getJumlah() * pelayananPasien.getSkor();
|
||||
}
|
||||
for (PelayananNakes pelayananNonpasien : listPelayananNonpasien) {
|
||||
capaian += pelayananNonpasien.getJumlah() * pelayananNonpasien.getSkor();
|
||||
}
|
||||
|
||||
String fragCapaian = df.format(capaian / Double.valueOf(map.get("target").toString()));
|
||||
hasil += capaian / Double.valueOf(map.get("target").toString())
|
||||
* Double.valueOf(map.get("bobot").toString());
|
||||
map.put("fragCapaian", Double.parseDouble(fragCapaian));
|
||||
map.put("persenCapaianDibulatkan",
|
||||
new BigDecimal(Double.valueOf(map.get("fragCapaian").toString()) * 100).setScale(2,
|
||||
RoundingMode.HALF_UP));
|
||||
data.add(map);
|
||||
} else {
|
||||
hasil += Double.parseDouble(df.format(Double.valueOf(map.get("fragCapaian").toString())))
|
||||
* Double.valueOf(map.get("bobot").toString());
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user