
Package ca.uhn.fhir.jpa.dao.index
Class DaoResourceLinkResolver<T extends ca.uhn.fhir.rest.api.server.storage.IResourcePersistentId<?>>
java.lang.Object
ca.uhn.fhir.jpa.dao.index.DaoResourceLinkResolver<T>
- All Implemented Interfaces:
IResourceLinkResolver
public class DaoResourceLinkResolver<T extends ca.uhn.fhir.rest.api.server.storage.IResourcePersistentId<?>>
extends Object
implements IResourceLinkResolver
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T extends org.hl7.fhir.instance.model.api.IBaseResource>
Optional<IBasePersistedResource> createPlaceholderTargetIfConfiguredToDoSo(Class<T> theType, org.hl7.fhir.instance.model.api.IBaseReference theReference, String theIdToAssignToPlaceholder, ca.uhn.fhir.rest.api.server.RequestDetails theRequest, ca.uhn.fhir.rest.api.server.storage.TransactionDetails theTransactionDetails) protected List<CanonicalIdentifier> extractIdentifierFromUrl(String theValue) Extracts the identifier(s) from a query URL.findTargetResource(RequestPartitionId theRequestPartitionId, String theSourceResourceName, PathAndRef thePathAndRef, ca.uhn.fhir.rest.api.server.RequestDetails theRequest, ca.uhn.fhir.rest.api.server.storage.TransactionDetails theTransactionDetails) org.hl7.fhir.instance.model.api.IBaseResourceloadTargetResource(RequestPartitionId theRequestPartitionId, String theSourceResourceName, PathAndRef thePathAndRef, ca.uhn.fhir.rest.api.server.RequestDetails theRequest, ca.uhn.fhir.rest.api.server.storage.TransactionDetails theTransactionDetails) voidvalidateTypeOrThrowException(Class<? extends org.hl7.fhir.instance.model.api.IBaseResource> theType) protected voidverifyPlaceholderCanBeCreated(Class<? extends org.hl7.fhir.instance.model.api.IBaseResource> theType, String theIdToAssignToPlaceholder, org.hl7.fhir.instance.model.api.IBaseReference theReference, IBasePersistedResource theStoredEntity) Subclasses may override
-
Constructor Details
-
DaoResourceLinkResolver
public DaoResourceLinkResolver()
-
-
Method Details
-
findTargetResource
public IResourceLookup findTargetResource(@Nonnull RequestPartitionId theRequestPartitionId, String theSourceResourceName, PathAndRef thePathAndRef, ca.uhn.fhir.rest.api.server.RequestDetails theRequest, ca.uhn.fhir.rest.api.server.storage.TransactionDetails theTransactionDetails) - Specified by:
findTargetResourcein interfaceIResourceLinkResolver
-
loadTargetResource
@Nullable public org.hl7.fhir.instance.model.api.IBaseResource loadTargetResource(@Nonnull RequestPartitionId theRequestPartitionId, String theSourceResourceName, PathAndRef thePathAndRef, ca.uhn.fhir.rest.api.server.RequestDetails theRequest, ca.uhn.fhir.rest.api.server.storage.TransactionDetails theTransactionDetails) - Specified by:
loadTargetResourcein interfaceIResourceLinkResolver
-
createPlaceholderTargetIfConfiguredToDoSo
public <T extends org.hl7.fhir.instance.model.api.IBaseResource> Optional<IBasePersistedResource> createPlaceholderTargetIfConfiguredToDoSo(Class<T> theType, org.hl7.fhir.instance.model.api.IBaseReference theReference, @Nullable String theIdToAssignToPlaceholder, ca.uhn.fhir.rest.api.server.RequestDetails theRequest, ca.uhn.fhir.rest.api.server.storage.TransactionDetails theTransactionDetails) - Parameters:
theIdToAssignToPlaceholder- If specified, the placeholder resource created will be given a specific ID
-
verifyPlaceholderCanBeCreated
protected void verifyPlaceholderCanBeCreated(Class<? extends org.hl7.fhir.instance.model.api.IBaseResource> theType, String theIdToAssignToPlaceholder, org.hl7.fhir.instance.model.api.IBaseReference theReference, IBasePersistedResource theStoredEntity) Subclasses may override -
extractIdentifierFromUrl
Extracts the identifier(s) from a query URL. This method is quite strict, as it is intended only for use when creatingauto-created placeholder reference targets. As such, it will:- Ignore any
_tag:notparameters - Add an entry to the returned list for each
identifierparameter containing a single valid value - Return an empty list if any
identifierparameters have modifiers or multiple OR values in a single parameter instance - Return an empty list if any other parameters are found
- Parameters:
theValue- Part of the URL to extract identifiers from
- Ignore any
-
validateTypeOrThrowException
public void validateTypeOrThrowException(Class<? extends org.hl7.fhir.instance.model.api.IBaseResource> theType) - Specified by:
validateTypeOrThrowExceptionin interfaceIResourceLinkResolver
-