Interface IResourceLinkDao

All Superinterfaces:
org.springframework.data.repository.CrudRepository<ResourceLink,Long>, IHapiFhirJpaRepository, org.springframework.data.jpa.repository.JpaRepository<ResourceLink,Long>, org.springframework.data.repository.ListCrudRepository<ResourceLink,Long>, org.springframework.data.repository.ListPagingAndSortingRepository<ResourceLink,Long>, org.springframework.data.repository.PagingAndSortingRepository<ResourceLink,Long>, org.springframework.data.repository.query.QueryByExampleExecutor<ResourceLink>, org.springframework.data.repository.Repository<ResourceLink,Long>

public interface IResourceLinkDao extends org.springframework.data.jpa.repository.JpaRepository<ResourceLink,Long>, IHapiFhirJpaRepository
  • Method Summary

    Modifier and Type
    Method
    Description
    countResourcesTargetingFhirTypeAndFhirId(String theTargetResourceType, String theTargetResourceFhirId)
    Count the number of resources that have a reference to the provided resource id
    void
    deleteByResourceId(JpaPid theResourcePid)
     
     
    Loads a collection of ResourceLink entities by PID, but also eagerly fetches the target resources and their forced IDs
     
    Stream<ca.uhn.fhir.model.primitive.IdDt>
    streamSourceIdsForTargetFhirId(String theTargetResourceType, String theTargetResourceFhirId)
    Stream Resource Ids of all resources that have a reference to the provided resource id

    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, flush, getById, getOne, getReferenceById, saveAllAndFlush, saveAndFlush

    Methods inherited from interface org.springframework.data.repository.ListCrudRepository

    findAll, findAllById, saveAll

    Methods inherited from interface org.springframework.data.repository.ListPagingAndSortingRepository

    findAll

    Methods inherited from interface org.springframework.data.repository.PagingAndSortingRepository

    findAll

    Methods inherited from interface org.springframework.data.repository.query.QueryByExampleExecutor

    count, exists, findAll, findBy, findOne
  • Method Details

    • deleteByResourceId

      @Modifying @Query("DELETE FROM ResourceLink t WHERE t.mySourceResource.myPid = :resId") void deleteByResourceId(@Param("resId") JpaPid theResourcePid)
    • findAllForSourceResourceId

      @Query("SELECT t FROM ResourceLink t WHERE t.mySourceResource.myPid = :resId") List<ResourceLink> findAllForSourceResourceId(@Param("resId") JpaPid thePatientId)
    • findWithTargetPidIn

      @Query("SELECT t FROM ResourceLink t WHERE t.myTargetResource.myPid in :resIds") List<ResourceLink> findWithTargetPidIn(@Param("resIds") List<JpaPid> thePids)
    • findByPidAndFetchTargetDetails

      @Query("SELECT t FROM ResourceLink t LEFT JOIN FETCH t.myTargetResource tr WHERE t.myId in :pids") List<ResourceLink> findByPidAndFetchTargetDetails(@Param("pids") List<Long> thePids)
      Loads a collection of ResourceLink entities by PID, but also eagerly fetches the target resources and their forced IDs
    • streamSourceIdsForTargetFhirId

      @Query("SELECT DISTINCT new ca.uhn.fhir.model.primitive.IdDt(t.mySourceResourceType, t.mySourceResource.myFhirId) FROM ResourceLink t WHERE t.myTargetResourceType = :resourceType AND t.myTargetResource.myFhirId = :resourceFhirId") Stream<ca.uhn.fhir.model.primitive.IdDt> streamSourceIdsForTargetFhirId(@Param("resourceType") String theTargetResourceType, @Param("resourceFhirId") String theTargetResourceFhirId)
      Stream Resource Ids of all resources that have a reference to the provided resource id
      Parameters:
      theTargetResourceType - the resource type part of the id
      theTargetResourceFhirId - the value part of the id
      Returns:
    • countResourcesTargetingFhirTypeAndFhirId

      @Query("SELECT COUNT(DISTINCT t.mySourceResourcePid) FROM ResourceLink t WHERE t.myTargetResourceType = :resourceType AND t.myTargetResource.myFhirId = :resourceFhirId") Integer countResourcesTargetingFhirTypeAndFhirId(@Param("resourceType") String theTargetResourceType, @Param("resourceFhirId") String theTargetResourceFhirId)
      Count the number of resources that have a reference to the provided resource id
      Parameters:
      theTargetResourceType - the resource type part of the id
      theTargetResourceFhirId - the value part of the id
      Returns: