Package ca.uhn.fhir.jpa.dao.data
Interface IMdmLinkJpaRepository
- 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> org.springframework.data.repository.history.RevisionRepository<MdmLink,Long, Long>
@Repository
public interface IMdmLinkJpaRepository
extends org.springframework.data.repository.history.RevisionRepository<MdmLink,Long,Long>, org.springframework.data.jpa.repository.JpaRepository<MdmLink,Long>, IHapiFhirJpaRepository
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionvoiddeleteLinksWithAnyReferenceToPids(List<Long> theResourcePids) intdeleteWithAnyReferenceToPid(Long thePid) intdeleteWithAnyReferenceToPidAndMatchResultNot(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) findBySourcePidAndMatchResult(Long theSourcePid, ca.uhn.fhir.mdm.api.MdmMatchResultEnum theMatch) findLinksAssociatedWithGoldenResourceOfSourceResourceExcludingMatchResult(Long theSourcePid, ca.uhn.fhir.mdm.api.MdmMatchResultEnum theMdmMatchResultEnumToExclude) findPidByResourceNameAndThreshold(String theResourceName, Date theHighThreshold, org.springframework.data.domain.Pageable thePageable) findPidByResourceNameAndThresholdAndPartitionId(String theResourceName, Date theHighThreshold, List<Integer> thePartitionIds, org.springframework.data.domain.Pageable thePageable) Methods inherited from interface org.springframework.data.repository.CrudRepository
count, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findById, saveMethods inherited from interface org.springframework.data.jpa.repository.JpaRepository
deleteAllByIdInBatch, deleteAllInBatch, deleteAllInBatch, deleteInBatch, findAll, findAll, findAll, findAll, findAllById, flush, getById, getOne, getReferenceById, saveAll, saveAllAndFlush, saveAndFlushMethods inherited from interface org.springframework.data.repository.PagingAndSortingRepository
findAllMethods inherited from interface org.springframework.data.repository.query.QueryByExampleExecutor
count, exists, findAll, findBy, findOneMethods inherited from interface org.springframework.data.repository.history.RevisionRepository
findLastChangeRevision, findRevision, findRevisions, findRevisions
-
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) -
deleteLinksWithAnyReferenceToPids
@Modifying @Query("DELETE FROM MdmLink f WHERE myGoldenResourcePid IN (:goldenPids) OR mySourcePid IN (:goldenPids)") void deleteLinksWithAnyReferenceToPids(@Param("goldenPids") List<Long> theResourcePids) -
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<IMdmLinkJpaRepository.MdmPidTuple> expandPidsFromGroupPidGivenMatchResult(@Param("groupPid") Long theGroupPid, @Param("matchResult") ca.uhn.fhir.mdm.api.MdmMatchResultEnum theMdmMatchResultEnum) -
findBySourcePidAndMatchResult
@Query("SELECT ml FROM MdmLink ml WHERE ml.mySourcePid = :sourcePid AND ml.myMatchResult = :matchResult") Optional<MdmLink> findBySourcePidAndMatchResult(@Param("sourcePid") Long theSourcePid, @Param("matchResult") ca.uhn.fhir.mdm.api.MdmMatchResultEnum theMatch) -
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<IMdmLinkJpaRepository.MdmPidTuple> expandPidsBySourcePidAndMatchResult(@Param("sourcePid") Long theSourcePid, @Param("matchResult") ca.uhn.fhir.mdm.api.MdmMatchResultEnum theMdmMatchResultEnum) -
findLinksAssociatedWithGoldenResourceOfSourceResourceExcludingMatchResult
@Query("SELECT ml FROM MdmLink ml INNER JOIN MdmLink ml2 on ml.myGoldenResourcePid=ml2.myGoldenResourcePid WHERE ml2.mySourcePid=:sourcePid AND ml2.myMatchResult!=:matchResult") List<MdmLink> findLinksAssociatedWithGoldenResourceOfSourceResourceExcludingMatchResult(@Param("sourcePid") Long theSourcePid, @Param("matchResult") ca.uhn.fhir.mdm.api.MdmMatchResultEnum theMdmMatchResultEnumToExclude) -
expandPidsByGoldenResourcePidAndMatchResult
@Query("SELECT ml.myGoldenResourcePid as goldenPid, ml.mySourcePid as sourcePid FROM MdmLink ml WHERE ml.myGoldenResourcePid = :goldenPid and ml.myMatchResult = :matchResult") List<IMdmLinkJpaRepository.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) -
findPidByResourceNameAndThresholdAndPartitionId
@Query("SELECT ml.myId FROM MdmLink ml WHERE ml.myMdmSourceType = :resourceName AND ml.myCreated <= :highThreshold AND ml.myPartitionIdValue IN :partitionId ORDER BY ml.myCreated DESC") List<Long> findPidByResourceNameAndThresholdAndPartitionId(@Param("resourceName") String theResourceName, @Param("highThreshold") Date theHighThreshold, @Param("partitionId") List<Integer> thePartitionIds, org.springframework.data.domain.Pageable thePageable)
-