Class ResourceIdentifierCacheSvcImpl

java.lang.Object
ca.uhn.fhir.jpa.cache.ResourceIdentifierCacheSvcImpl
All Implemented Interfaces:
IResourceIdentifierCacheSvc

  • Constructor Details

  • Method Details

    • getOrCreateResourceIdentifierSystem

      public long getOrCreateResourceIdentifierSystem(ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails, RequestPartitionId theRequestPartitionId, String theSystem)
      Description copied from interface: IResourceIdentifierCacheSvc
      Retrieves (and creates if necessary) the PID associated with the given identifier system URL.

      Thread-safety: This method is designed to be thread-safe, including in cases where multiple threads are attempting to create a new FHIR ID for the same identifier system. It will internally retry automatically if multiple threads attempt to create a new identifier system and will not fail in this case.

      Transactionality: This method will open a new transaction if one is not already open.

      Specified by:
      getOrCreateResourceIdentifierSystem in interface IResourceIdentifierCacheSvc
      Parameters:
      theRequestDetails - The request details associated with the current request
      theRequestPartitionId - The partition ID associated with the current request
      theSystem - The Identifier.system value
      Returns:
      Returns a PID associated with the given identifier system URL.
    • getFhirIdAssociatedWithUniquePatientIdentifier

      @Nonnull public String getFhirIdAssociatedWithUniquePatientIdentifier(ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails, RequestPartitionId theRequestPartitionId, String theSystem, String theValue, Supplier<String> theNewIdSupplier)
      Description copied from interface: IResourceIdentifierCacheSvc
      Retrieves the FHIR ID associated with the given Patient identifier, creating a new record using the given Supplier if no existing record is found. This method enforces uniqueness on the identifier using a database constraint and will therefore only allow one FHIR ID to be associated with one Identifier. No uniqueness is enforced on the FHIR ID.

      Thread safety: This method will fail with a constraint error if multiple threads attempt to assign a FHIR ID for the same system+value combination concurrently.

      Transactionality: This method will open a new transaction if one is not already open.

      Specified by:
      getFhirIdAssociatedWithUniquePatientIdentifier in interface IResourceIdentifierCacheSvc
      Parameters:
      theSystem - The Identifier.system value
      theValue - The Identifier.value value
      theNewIdSupplier - If no existing FHIR ID is found, a new entry will be created using this ID supplier
      Returns:
      The FHIR ID associated with this identifier