
Interface IResourceIdentifierCacheSvc
- All Known Implementing Classes:
ResourceIdentifierCacheSvcImpl
- Since:
- 8.6.0
-
Method Summary
Modifier and TypeMethodDescriptiongetFhirIdAssociatedWithUniquePatientIdentifier(ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails, RequestPartitionId theRequestPartitionId, String theSystem, String theValue) Retrieves the FHIR ID previously associated with the given Patient identifier, if one exists, and returnsOptional.empty()otherwise.getFhirIdAssociatedWithUniquePatientIdentifier(ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails, RequestPartitionId theRequestPartitionId, String theSystem, String theValue, Supplier<String> theNewIdSupplier) Retrieves the FHIR ID associated with the given Patient identifier, creating a new record using the given Supplier if no existing record is found.longgetOrCreateResourceIdentifierSystem(ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails, RequestPartitionId theRequestPartitionId, String theSystem) Retrieves (and creates if necessary) the PID associated with the given identifier system URL.
-
Method Details
-
getOrCreateResourceIdentifierSystem
long getOrCreateResourceIdentifierSystem(ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails, RequestPartitionId theRequestPartitionId, String theSystem) 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.
- Parameters:
theRequestDetails- The request details associated with the current requesttheRequestPartitionId- The partition ID associated with the current requesttheSystem- TheIdentifier.systemvalue- Returns:
- Returns a PID associated with the given identifier system URL.
-
getFhirIdAssociatedWithUniquePatientIdentifier
@Nonnull String getFhirIdAssociatedWithUniquePatientIdentifier(ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails, RequestPartitionId theRequestPartitionId, String theSystem, String theValue, Supplier<String> theNewIdSupplier) 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.
- Parameters:
theSystem- TheIdentifier.systemvaluetheValue- TheIdentifier.valuevaluetheNewIdSupplier- 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
-
getFhirIdAssociatedWithUniquePatientIdentifier
@Nonnull Optional<String> getFhirIdAssociatedWithUniquePatientIdentifier(ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails, RequestPartitionId theRequestPartitionId, String theSystem, String theValue) Retrieves the FHIR ID previously associated with the given Patient identifier, if one exists, and returnsOptional.empty()otherwise.Thread safety: This method is always thread safe, as it reads without writing.
Transactionality: This method will open a new transaction if one is not already open.
- Parameters:
theSystem- TheIdentifier.systemvaluetheValue- TheIdentifier.valuevalue- Returns:
- The FHIR ID associated with this identifier, if one already exists
-