124 lines
4.3 KiB
Java
124 lines
4.3 KiB
Java
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;
|
|
import org.springframework.data.repository.query.Param;
|
|
import org.springframework.stereotype.Repository;
|
|
import com.jasamedika.medifirst2000.entities.DiagnosaKeperawatan;
|
|
|
|
@Repository("DiagnosaKeperawatanDao")
|
|
public interface DiagnosaKeperawatanDao extends PagingAndSortingRepository<DiagnosaKeperawatan, Integer>{
|
|
|
|
@Query("select NEW Map ("
|
|
+ "a.id as id, "
|
|
+ "a.namaDiagnosaKep as namaDiagnosaKep) "
|
|
+ "from DiagnosaKeperawatan a ")
|
|
List<Map<String, Object>> getAllDiagnosaKeperawatan();
|
|
|
|
@Query("select NEW Map ("
|
|
+ "a.id as id, "
|
|
+ "a.namaDiagnosaKep as namaDiagnosaKep) "
|
|
+ "from DiagnosaKeperawatan a where a.id=:id")
|
|
Map<String, Object> getOneDiagnosaKeperawatan(@Param("id") Integer id);
|
|
|
|
@Query("select NEW Map ("
|
|
+ "a.id as id, "
|
|
+ "a.name as name) "
|
|
+ "from Intervensi a "
|
|
+ "left join a.diagnosaKeperawatan b "
|
|
+ "where b.id=:id")
|
|
List<Map<String, Object>> getIntervensiDetailByDiagnosa(@Param("id") Integer id);
|
|
|
|
@Query("select NEW Map ("
|
|
+ "a.id as id, "
|
|
+ "a.name as name) "
|
|
+ "from Implementasi a "
|
|
+ "left join a.diagnosaKeperawatan b "
|
|
+ "where b.id=:id")
|
|
List<Map<String, Object>> getImplementasiDetailByDiagnosa(@Param("id") Integer id);
|
|
|
|
@Query("select NEW Map ("
|
|
+ "a.id as id, "
|
|
+ "a.name as name) "
|
|
+ "from Evaluasi a "
|
|
+ "left join a.diagnosaKeperawatan b "
|
|
+ "where b.id=:id")
|
|
List<Map<String, Object>> getEvaluasiDetailByDiagnosa(@Param("id") Integer id);
|
|
|
|
// @Query("select distinct NEW Map ("
|
|
// + "a.tglDitemukan as tglDitemukan,"
|
|
// + "a.tglTeratasi as tglTeratasi,"
|
|
// + "a.tglInput as tglInput,"
|
|
// + "f.namaDiagnosaKep as namaDiagnosaKep,"
|
|
// + "f.id as diagnosaKepId,"
|
|
// + "g.namaLengkap as namaPegawai,"
|
|
// + "g.id as pegawaiId,"
|
|
// + "h.namaRuangan as namaRuangan,"
|
|
// + "h.id as ruanganId) "
|
|
// + "from DiagnosaKeperawatanTransaksi a "
|
|
// + "left join a.pasienDaftar b "
|
|
// + "left join a.diagnosaKeperawatan f "
|
|
// + "left join a.pegawai g "
|
|
// + "left join a.ruangan h "
|
|
// + "where b.noRec=:noRec and a.tglTeratasi is null")
|
|
// Map<String, Object> getDetailDiagnosaKeperawatanTransaction(@Param("noRec") String noRec);
|
|
|
|
@Query("select NEW Map ("
|
|
+ "a.tglDitemukan as tglDitemukan,"
|
|
+ "a.tglTeratasi as tglTeratasi,"
|
|
+ "a.tglInput as tglInput,"
|
|
+ "g.namaLengkap as namaPegawai,"
|
|
+ "g.id as pegawaiId,"
|
|
+ "h.namaRuangan as namaRuangan,"
|
|
+ "h.id as ruanganId) "
|
|
+ "from DiagnosaKeperawatanTransaksi a "
|
|
+ "left join a.pasienDaftar b "
|
|
+ "left join a.pegawai g "
|
|
+ "left join a.ruangan h "
|
|
+ "where b.noRec=:noRec and a.tglTeratasi is null")
|
|
Map<String, Object> header(@Param("noRec") String noRec);
|
|
|
|
@Query("select NEW Map ("
|
|
+ "f.namaDiagnosaKep as namaDiagnosaKep,"
|
|
+ "f.id as diagnosaKepId,"
|
|
+ "a.noRec as noRec,"
|
|
+ "c.id as id,"
|
|
+ "c.name as name) "
|
|
+ "from DiagnosaKeperawatanTransaksi a "
|
|
+ "left join a.pasienDaftar b "
|
|
+ "left join a.implementasi c "
|
|
+ "left join a.diagnosaKeperawatan f "
|
|
+ "where b.noRec=:noRec and a.tglTeratasi is null")
|
|
List<Map<String, Object>> getDetailDiagnosaKeperawatanTransactionImplementasi(@Param("noRec") String noRec);
|
|
|
|
@Query("select NEW Map ("
|
|
+ "f.namaDiagnosaKep as namaDiagnosaKep,"
|
|
+ "f.id as diagnosaKepId,"
|
|
+ "a.noRec as noRec,"
|
|
+ "d.id as id,"
|
|
+ "d.name as name) "
|
|
+ "from DiagnosaKeperawatanTransaksi a "
|
|
+ "left join a.pasienDaftar b "
|
|
+ "left join a.intervensi d "
|
|
+ "left join a.diagnosaKeperawatan f "
|
|
+ "where b.noRec=:noRec and a.tglTeratasi is null")
|
|
List<Map<String, Object>> getDetailDiagnosaKeperawatanTransactionIntervensi(@Param("noRec") String noRec);
|
|
|
|
@Query("select NEW Map ("
|
|
+ "f.namaDiagnosaKep as namaDiagnosaKep,"
|
|
+ "f.id as diagnosaKepId,"
|
|
+ "a.noRec as noRec,"
|
|
+ "e.id as id,"
|
|
+ "e.name as name) "
|
|
+ "from DiagnosaKeperawatanTransaksi a "
|
|
+ "left join a.pasienDaftar b "
|
|
+ "left join a.evaluasi e "
|
|
+ "left join a.diagnosaKeperawatan f "
|
|
+ "where b.noRec=:noRec and a.tglTeratasi is null")
|
|
List<Map<String, Object>> getDetailDiagnosaKeperawatanTransactionEvaluasi(@Param("noRec") String noRec);
|
|
|
|
}
|