Package ca.uhn.fhir.jpa.dao
Class JpaResourceDaoCodeSystem<T extends org.hl7.fhir.instance.model.api.IBaseResource>
java.lang.Object
ca.uhn.fhir.jpa.dao.BaseStorageDao
ca.uhn.fhir.jpa.dao.BaseStorageResourceDao<T>
ca.uhn.fhir.jpa.dao.BaseHapiFhirDao<T>
ca.uhn.fhir.jpa.dao.BaseHapiFhirResourceDao<T>
ca.uhn.fhir.jpa.dao.JpaResourceDaoCodeSystem<T>
- All Implemented Interfaces:
IDao
,IFhirResourceDao<T>
,IFhirResourceDaoCodeSystem<T>
,IJpaDao<T>
,org.springframework.beans.factory.Aware
,org.springframework.context.ApplicationContextAware
public class JpaResourceDaoCodeSystem<T extends org.hl7.fhir.instance.model.api.IBaseResource>
extends BaseHapiFhirResourceDao<T>
implements IFhirResourceDaoCodeSystem<T>
-
Nested Class Summary
Nested classes/interfaces inherited from interface ca.uhn.fhir.jpa.api.dao.IFhirResourceDaoCodeSystem
IFhirResourceDaoCodeSystem.SubsumesResult
-
Field Summary
Modifier and TypeFieldDescriptionprotected IIdHelperService
protected ITermDeferredStorageSvc
protected ITermCodeSystemStorageSvc
Fields inherited from class ca.uhn.fhir.jpa.dao.BaseHapiFhirResourceDao
BASE_RESOURCE_NAME, myInterceptorBroadcaster, myPlatformTransactionManager, mySearchDao, myTransactionService
Fields inherited from class ca.uhn.fhir.jpa.dao.BaseHapiFhirDao
cacheTagDefinitionDao, INDEX_STATUS_INDEXED, INDEX_STATUS_INDEXING_FAILED, myCodingSpy, myDeleteConflictService, myEntityManager, myInMemoryResourceMatcher, myJpaStorageResourceParser, myPartitionSettings, myResourceHistoryCalculator, myResourceHistoryTableDao, myResourceLinkDao, myResourceTableDao, myResourceTagDao, mySearchCoordinatorSvc, myTerminologySvc, NS_JPA_PROFILE
Fields inherited from class ca.uhn.fhir.jpa.dao.BaseStorageResourceDao
STRICT_ERROR_HANDLER
Fields inherited from class ca.uhn.fhir.jpa.dao.BaseStorageDao
MESSAGE_KEY_DELETE_RESOURCE_ALREADY_DELETED, MESSAGE_KEY_DELETE_RESOURCE_NOT_EXISTING, myMetaTagSorter, myResourceVersionSvc, mySearchParamRegistry, myStorageSettings, OO_SEVERITY_ERROR, OO_SEVERITY_INFO, OO_SEVERITY_WARN
Fields inherited from interface ca.uhn.fhir.jpa.api.dao.IDao
CURRENTLY_REINDEXING, RESOURCE_PID, RESOURCE_PID_KEY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
createVersionedSystemIfVersionIsPresent
(String theCodeSystemUrl, String theVersion) static ca.uhn.fhir.context.support.IValidationSupport.LookupCodeResult
doLookupCode
(ca.uhn.fhir.context.FhirContext theFhirContext, FhirTerser theFhirTerser, ca.uhn.fhir.context.support.IValidationSupport theValidationSupport, org.hl7.fhir.instance.model.api.IPrimitiveType<String> theCode, org.hl7.fhir.instance.model.api.IPrimitiveType<String> theSystem, org.hl7.fhir.instance.model.api.IBaseCoding theCoding, org.hl7.fhir.instance.model.api.IPrimitiveType<String> theDisplayLanguage, Collection<org.hl7.fhir.instance.model.api.IPrimitiveType<String>> thePropertyNames) List
<org.hl7.fhir.instance.model.api.IIdType> findCodeSystemIdsContainingSystemAndCode
(String theCode, String theSystem, ca.uhn.fhir.rest.api.server.RequestDetails theRequest) ca.uhn.fhir.context.support.IValidationSupport.LookupCodeResult
lookupCode
(org.hl7.fhir.instance.model.api.IPrimitiveType<String> theCode, org.hl7.fhir.instance.model.api.IPrimitiveType<String> theSystem, org.hl7.fhir.instance.model.api.IBaseCoding theCoding, ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails) ca.uhn.fhir.context.support.IValidationSupport.LookupCodeResult
lookupCode
(org.hl7.fhir.instance.model.api.IPrimitiveType<String> theCode, org.hl7.fhir.instance.model.api.IPrimitiveType<String> theSystem, org.hl7.fhir.instance.model.api.IBaseCoding theCoding, org.hl7.fhir.instance.model.api.IPrimitiveType<String> theDisplayLanguage, ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails) ca.uhn.fhir.context.support.IValidationSupport.LookupCodeResult
lookupCode
(org.hl7.fhir.instance.model.api.IPrimitiveType<String> theCode, org.hl7.fhir.instance.model.api.IPrimitiveType<String> theSystem, org.hl7.fhir.instance.model.api.IBaseCoding theCoding, org.hl7.fhir.instance.model.api.IPrimitiveType<String> theDisplayLanguage, Collection<org.hl7.fhir.instance.model.api.IPrimitiveType<String>> thePropertyNames, ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails) protected void
preDelete
(T theResourceToDelete, ResourceTable theEntityToDelete, ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails) Subclasses may override to provide behaviour.reindex
(ca.uhn.fhir.rest.api.server.storage.IResourcePersistentId thePid, ReindexParameters theReindexParameters, ca.uhn.fhir.rest.api.server.RequestDetails theRequest, ca.uhn.fhir.rest.api.server.storage.TransactionDetails theTransactionDetails) If there are more code systems to process thanJpaStorageSettings.getDeferIndexingForCodesystemsOfSize()
, then these codes will have their processing deferred (for a later time).void
start()
subsumes
(org.hl7.fhir.instance.model.api.IPrimitiveType<String> theCodeA, org.hl7.fhir.instance.model.api.IPrimitiveType<String> theCodeB, org.hl7.fhir.instance.model.api.IPrimitiveType<String> theSystem, org.hl7.fhir.instance.model.api.IBaseCoding theCodingA, org.hl7.fhir.instance.model.api.IBaseCoding theCodingB, ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails) updateEntity
(ca.uhn.fhir.rest.api.server.RequestDetails theRequest, org.hl7.fhir.instance.model.api.IBaseResource theResource, IBasePersistedResource theEntity, Date theDeletedTimestampOrNull, boolean thePerformIndexing, boolean theUpdateVersion, ca.uhn.fhir.rest.api.server.storage.TransactionDetails theTransactionDetails, boolean theForceUpdate, boolean theCreateNewHistoryEntry) ca.uhn.fhir.context.support.IValidationSupport.CodeValidationResult
validateCode
(org.hl7.fhir.instance.model.api.IIdType theCodeSystemId, org.hl7.fhir.instance.model.api.IPrimitiveType<String> theCodeSystemUrl, org.hl7.fhir.instance.model.api.IPrimitiveType<String> theVersion, org.hl7.fhir.instance.model.api.IPrimitiveType<String> theCode, org.hl7.fhir.instance.model.api.IPrimitiveType<String> theDisplay, org.hl7.fhir.instance.model.api.IBaseCoding theCoding, org.hl7.fhir.instance.model.api.IBaseDatatype theCodeableConcept, ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails) Methods inherited from class ca.uhn.fhir.jpa.dao.BaseHapiFhirResourceDao
create, create, create, create, create, delete, delete, delete, deleteByUrl, deleteByUrl, deletePidList, doCreateForPost, doMetaAddOperation, doMetaDeleteOperation, doUpdateForUpdateOrPatch, expunge, expunge, expunge, forceExpungeInExistingTransaction, getDeleteExpungeJobSubmitter, getMatchResourceUrlService, getMessageSanitized, getResourceName, getResourceType, getStorageResourceParser, getTransactionService, history, history, history, invokeStoragePreAccessResources, invokeStoragePreShowResources, isPagingProviderDatabaseBacked, metaAddOperation, metaDeleteOperation, metaGetOperation, metaGetOperation, postUpdateTransaction, read, read, read, readByPid, readByPid, readEntity, readEntityLatestVersion, readEntityLatestVersion, reindex, removeTag, removeTag, requestReindexForRelatedResources, search, search, search, searchForIds, searchForIdStream, searchForResourceIds, searchForResources, setIdHelperSvcForUnitTest, setOffsetAndCount, setRequestPartitionHelperService, setResourceType, setTransactionService, shouldSkipReindex, toMetaDt, update, update, update, update, update, update, updateEntityForDelete, validate, validateCriteriaAndReturnResourceDefinition
Methods inherited from class ca.uhn.fhir.jpa.dao.BaseHapiFhirDao
addPidToResource, decodeResource, getApplicationContext, getContext, getInterceptorBroadcaster, getStorageSettings, isLogicalReference, parseContentTextIntoWords, populateFullTextFields, populateResourceIntoEntity, postDelete, postPersist, postUpdate, setApplicationContext, setContext, setDaoSearchParamSynchronizer, setDisableIncrementOnUpdateForUnitTest, setEntityManager, setExternallyStoredResourceServiceRegistryForUnitTest, setJpaStorageResourceParserForUnitTest, setPartitionSettingsForUnitTest, setResourceHistoryCalculator, setResourceHistoryTableDao, setSearchParamPresenceSvc, setSearchParamWithInlineReferencesExtractor, setStorageSettingsForUnitTest, setValidationDisabledForUnitTest, shouldDroppedTagBeRemovedOnUpdate, updateHistoryEntity, updateInternal, validateMetaCount, validateResourceForStorage
Methods inherited from class ca.uhn.fhir.jpa.dao.BaseStorageResourceDao
deleteExpunge, patch, patchInTransaction, validateResourceType
Methods inherited from class ca.uhn.fhir.jpa.dao.BaseStorageDao
clearRequestAsProcessingSubRequest, createErrorOperationOutcome, createInfoOperationOutcome, createInfoOperationOutcome, createMethodOutcomeForResourceId, createOperationOutcome, createResourceGoneException, doCallHooks, extractReferencesToAutoVersion, markRequestAsProcessingSubRequest, populateOperationOutcomeForUpdate, preProcessResourceForStorage, preProcessResourceForStorage, setMyMetaTagSorter, setSearchParamRegistry, toMethodOutcome, toMethodOutcomeLazy, translateRawParameters
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface ca.uhn.fhir.jpa.api.dao.IDao
getContext
Methods inherited from interface ca.uhn.fhir.jpa.api.dao.IFhirResourceDao
create, create, create, create, create, delete, delete, delete, deleteByUrl, deleteByUrl, deletePidList, deletePidList, expunge, expunge, expunge, forceExpungeInExistingTransaction, getCurrentVersionId, getResourceType, history, history, history, metaAddOperation, metaDeleteOperation, metaGetOperation, metaGetOperation, patch, patchInTransaction, read, read, read, readByPid, readByPid, readEntity, reindex, removeTag, removeTag, search, search, search, searchForIds, searchForIds, searchForIdStream, searchForResourceIds, searchForResources, translateRawParameters, update, update, update, update, update, update, validate, validateCriteriaAndReturnResourceDefinition
-
Field Details
-
myTerminologyCodeSystemStorageSvc
-
myIdHelperService
-
myTermDeferredStorageSvc
-
-
Constructor Details
-
JpaResourceDaoCodeSystem
public JpaResourceDaoCodeSystem()
-
-
Method Details
-
start
- Overrides:
start
in classBaseHapiFhirResourceDao<T extends org.hl7.fhir.instance.model.api.IBaseResource>
-
findCodeSystemIdsContainingSystemAndCode
public List<org.hl7.fhir.instance.model.api.IIdType> findCodeSystemIdsContainingSystemAndCode(String theCode, String theSystem, ca.uhn.fhir.rest.api.server.RequestDetails theRequest) - Specified by:
findCodeSystemIdsContainingSystemAndCode
in interfaceIFhirResourceDaoCodeSystem<T extends org.hl7.fhir.instance.model.api.IBaseResource>
-
lookupCode
@Nonnull public ca.uhn.fhir.context.support.IValidationSupport.LookupCodeResult lookupCode(org.hl7.fhir.instance.model.api.IPrimitiveType<String> theCode, org.hl7.fhir.instance.model.api.IPrimitiveType<String> theSystem, org.hl7.fhir.instance.model.api.IBaseCoding theCoding, ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails) - Specified by:
lookupCode
in interfaceIFhirResourceDaoCodeSystem<T extends org.hl7.fhir.instance.model.api.IBaseResource>
-
lookupCode
@Nonnull public ca.uhn.fhir.context.support.IValidationSupport.LookupCodeResult lookupCode(org.hl7.fhir.instance.model.api.IPrimitiveType<String> theCode, org.hl7.fhir.instance.model.api.IPrimitiveType<String> theSystem, org.hl7.fhir.instance.model.api.IBaseCoding theCoding, org.hl7.fhir.instance.model.api.IPrimitiveType<String> theDisplayLanguage, ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails) - Specified by:
lookupCode
in interfaceIFhirResourceDaoCodeSystem<T extends org.hl7.fhir.instance.model.api.IBaseResource>
-
lookupCode
@Nonnull public ca.uhn.fhir.context.support.IValidationSupport.LookupCodeResult lookupCode(org.hl7.fhir.instance.model.api.IPrimitiveType<String> theCode, org.hl7.fhir.instance.model.api.IPrimitiveType<String> theSystem, org.hl7.fhir.instance.model.api.IBaseCoding theCoding, org.hl7.fhir.instance.model.api.IPrimitiveType<String> theDisplayLanguage, Collection<org.hl7.fhir.instance.model.api.IPrimitiveType<String>> thePropertyNames, ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails) - Specified by:
lookupCode
in interfaceIFhirResourceDaoCodeSystem<T extends org.hl7.fhir.instance.model.api.IBaseResource>
-
subsumes
public IFhirResourceDaoCodeSystem.SubsumesResult subsumes(org.hl7.fhir.instance.model.api.IPrimitiveType<String> theCodeA, org.hl7.fhir.instance.model.api.IPrimitiveType<String> theCodeB, org.hl7.fhir.instance.model.api.IPrimitiveType<String> theSystem, org.hl7.fhir.instance.model.api.IBaseCoding theCodingA, org.hl7.fhir.instance.model.api.IBaseCoding theCodingB, ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails) - Specified by:
subsumes
in interfaceIFhirResourceDaoCodeSystem<T extends org.hl7.fhir.instance.model.api.IBaseResource>
-
preDelete
protected void preDelete(T theResourceToDelete, ResourceTable theEntityToDelete, ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails) Description copied from class:BaseHapiFhirResourceDao
Subclasses may override to provide behaviour. Invoked within a delete transaction with the resource that is about to be deleted.- Overrides:
preDelete
in classBaseHapiFhirResourceDao<T extends org.hl7.fhir.instance.model.api.IBaseResource>
-
reindex
public ReindexOutcome reindex(ca.uhn.fhir.rest.api.server.storage.IResourcePersistentId thePid, ReindexParameters theReindexParameters, ca.uhn.fhir.rest.api.server.RequestDetails theRequest, ca.uhn.fhir.rest.api.server.storage.TransactionDetails theTransactionDetails) If there are more code systems to process thanJpaStorageSettings.getDeferIndexingForCodesystemsOfSize()
, then these codes will have their processing deferred (for a later time). This can result in future reindex steps *skipping* these code systems (if they're still deferred) and thus incorrect expansions resulting. So we override the reindex method for CodeSystems specifically to force reindex batch jobs to wait until all code systems are processed before moving on.- Specified by:
reindex
in interfaceIFhirResourceDao<T extends org.hl7.fhir.instance.model.api.IBaseResource>
- Overrides:
reindex
in classBaseHapiFhirResourceDao<T extends org.hl7.fhir.instance.model.api.IBaseResource>
-
getReindexJobStatus
- Specified by:
getReindexJobStatus
in interfaceIFhirResourceDao<T extends org.hl7.fhir.instance.model.api.IBaseResource>
-
updateEntity
public ResourceTable updateEntity(ca.uhn.fhir.rest.api.server.RequestDetails theRequest, org.hl7.fhir.instance.model.api.IBaseResource theResource, IBasePersistedResource theEntity, Date theDeletedTimestampOrNull, boolean thePerformIndexing, boolean theUpdateVersion, ca.uhn.fhir.rest.api.server.storage.TransactionDetails theTransactionDetails, boolean theForceUpdate, boolean theCreateNewHistoryEntry) - Specified by:
updateEntity
in interfaceIJpaDao<T extends org.hl7.fhir.instance.model.api.IBaseResource>
- Overrides:
updateEntity
in classBaseHapiFhirDao<T extends org.hl7.fhir.instance.model.api.IBaseResource>
-
validateCode
@Nonnull public ca.uhn.fhir.context.support.IValidationSupport.CodeValidationResult validateCode(org.hl7.fhir.instance.model.api.IIdType theCodeSystemId, org.hl7.fhir.instance.model.api.IPrimitiveType<String> theCodeSystemUrl, org.hl7.fhir.instance.model.api.IPrimitiveType<String> theVersion, org.hl7.fhir.instance.model.api.IPrimitiveType<String> theCode, org.hl7.fhir.instance.model.api.IPrimitiveType<String> theDisplay, org.hl7.fhir.instance.model.api.IBaseCoding theCoding, org.hl7.fhir.instance.model.api.IBaseDatatype theCodeableConcept, ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails) - Specified by:
validateCode
in interfaceIFhirResourceDaoCodeSystem<T extends org.hl7.fhir.instance.model.api.IBaseResource>
-
doLookupCode
public static ca.uhn.fhir.context.support.IValidationSupport.LookupCodeResult doLookupCode(ca.uhn.fhir.context.FhirContext theFhirContext, FhirTerser theFhirTerser, ca.uhn.fhir.context.support.IValidationSupport theValidationSupport, org.hl7.fhir.instance.model.api.IPrimitiveType<String> theCode, org.hl7.fhir.instance.model.api.IPrimitiveType<String> theSystem, org.hl7.fhir.instance.model.api.IBaseCoding theCoding, org.hl7.fhir.instance.model.api.IPrimitiveType<String> theDisplayLanguage, Collection<org.hl7.fhir.instance.model.api.IPrimitiveType<String>> thePropertyNames) -
createVersionedSystemIfVersionIsPresent
public static String createVersionedSystemIfVersionIsPresent(String theCodeSystemUrl, String theVersion)
-