Package ca.uhn.fhir.jpa.dao.data
Interface IMdmLinkDao
- All Superinterfaces:
org.springframework.data.repository.CrudRepository<MdmLink,Long>
,IHapiFhirJpaRepository
,org.springframework.data.jpa.repository.JpaRepository<MdmLink,Long>
,org.springframework.data.repository.PagingAndSortingRepository<MdmLink,Long>
,org.springframework.data.repository.query.QueryByExampleExecutor<MdmLink>
,org.springframework.data.repository.Repository<MdmLink,Long>
@Repository
public interface IMdmLinkDao
extends org.springframework.data.jpa.repository.JpaRepository<MdmLink,Long>, IHapiFhirJpaRepository
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionint
deleteWithAnyReferenceToPid(Long thePid)
int
deleteWithAnyReferenceToPidAndMatchResultNot(Long thePid, ca.uhn.fhir.mdm.api.MdmMatchResultEnum theMatchResult)
expandPidsByGoldenResourcePidAndMatchResult(Long theSourcePid, ca.uhn.fhir.mdm.api.MdmMatchResultEnum theMdmMatchResultEnum)
expandPidsBySourcePidAndMatchResult(Long theSourcePid, ca.uhn.fhir.mdm.api.MdmMatchResultEnum theMdmMatchResultEnum)
expandPidsFromGroupPidGivenMatchResult(Long theGroupPid, ca.uhn.fhir.mdm.api.MdmMatchResultEnum theMdmMatchResultEnum)
findPidByResourceNameAndThreshold(String theResourceName, Date theHighThreshold, org.springframework.data.domain.Pageable thePageable)
Methods inherited from interface org.springframework.data.repository.CrudRepository
count, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findById, save
Methods inherited from interface org.springframework.data.jpa.repository.JpaRepository
deleteAllByIdInBatch, deleteAllInBatch, deleteAllInBatch, deleteInBatch, findAll, findAll, findAll, findAll, findAllById, flush, getById, getOne, saveAll, saveAllAndFlush, saveAndFlush
Methods inherited from interface org.springframework.data.repository.PagingAndSortingRepository
findAll
Methods inherited from interface org.springframework.data.repository.query.QueryByExampleExecutor
count, exists, findAll, findOne
-
Method Details
-
deleteWithAnyReferenceToPid
@Modifying @Query("DELETE FROM MdmLink f WHERE myGoldenResourcePid = :pid OR mySourcePid = :pid") int deleteWithAnyReferenceToPid(@Param("pid") Long thePid) -
deleteWithAnyReferenceToPidAndMatchResultNot
@Modifying @Query("DELETE FROM MdmLink f WHERE (myGoldenResourcePid = :pid OR mySourcePid = :pid) AND myMatchResult <> :matchResult") int deleteWithAnyReferenceToPidAndMatchResultNot(@Param("pid") Long thePid, @Param("matchResult") ca.uhn.fhir.mdm.api.MdmMatchResultEnum theMatchResult) -
expandPidsFromGroupPidGivenMatchResult
@Query("SELECT ml2.myGoldenResourcePid as goldenPid, ml2.mySourcePid as sourcePid FROM MdmLink ml2 WHERE ml2.myMatchResult=:matchResult AND ml2.myGoldenResourcePid IN (SELECT ml.myGoldenResourcePid FROM MdmLink ml INNER JOIN ResourceLink hrl ON hrl.myTargetResourcePid=ml.mySourcePid AND hrl.mySourceResourcePid=:groupPid AND hrl.mySourcePath=\'Group.member.entity\' AND hrl.myTargetResourceType=\'Patient\')") List<IMdmLinkDao.MdmPidTuple> expandPidsFromGroupPidGivenMatchResult(@Param("groupPid") Long theGroupPid, @Param("matchResult") ca.uhn.fhir.mdm.api.MdmMatchResultEnum theMdmMatchResultEnum) -
expandPidsBySourcePidAndMatchResult
@Query("SELECT ml.myGoldenResourcePid as goldenPid, ml.mySourcePid as sourcePid FROM MdmLink ml INNER JOIN MdmLink ml2 on ml.myGoldenResourcePid=ml2.myGoldenResourcePid WHERE ml2.mySourcePid=:sourcePid AND ml2.myMatchResult=:matchResult AND ml.myMatchResult=:matchResult") List<IMdmLinkDao.MdmPidTuple> expandPidsBySourcePidAndMatchResult(@Param("sourcePid") Long theSourcePid, @Param("matchResult") ca.uhn.fhir.mdm.api.MdmMatchResultEnum theMdmMatchResultEnum) -
expandPidsByGoldenResourcePidAndMatchResult
@Query("SELECT ml.myGoldenResourcePid as goldenPid, ml.mySourcePid as sourcePid FROM MdmLink ml WHERE ml.myGoldenResourcePid = :goldenPid and ml.myMatchResult = :matchResult") List<IMdmLinkDao.MdmPidTuple> expandPidsByGoldenResourcePidAndMatchResult(@Param("goldenPid") Long theSourcePid, @Param("matchResult") ca.uhn.fhir.mdm.api.MdmMatchResultEnum theMdmMatchResultEnum) -
findPidByResourceNameAndThreshold
@Query("SELECT ml.myId FROM MdmLink ml WHERE ml.myMdmSourceType = :resourceName AND ml.myCreated <= :highThreshold ORDER BY ml.myCreated DESC") List<Long> findPidByResourceNameAndThreshold(@Param("resourceName") String theResourceName, @Param("highThreshold") Date theHighThreshold, org.springframework.data.domain.Pageable thePageable)
-