
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
FieldsModifier and TypeFieldDescriptionprotected IIdHelperServiceprotected ITermDeferredStorageSvcprotected ITermCodeSystemStorageSvcFields inherited from class ca.uhn.fhir.jpa.dao.BaseHapiFhirResourceDao
BASE_RESOURCE_NAME, myInterceptorBroadcaster, myPlatformTransactionManager, mySearchDao, myTransactionServiceFields inherited from class ca.uhn.fhir.jpa.dao.BaseHapiFhirDao
cacheTagDefinitionDao, myCodingSpy, myDeleteConflictService, myEntityManager, myInMemoryResourceMatcher, myJpaStorageResourceParser, myPartitionSettings, myResourceHistoryCalculator, myResourceHistoryTableDao, myResourceLinkDao, myResourceTableDao, myResourceTagDao, myResourceTypeCacheSvc, mySearchCoordinatorSvc, myTerminologySvc, NS_JPA_PROFILEFields inherited from class ca.uhn.fhir.jpa.dao.BaseStorageResourceDao
STRICT_ERROR_HANDLERFields 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_ISSUE_CODE_INFORMATIONAL, OO_SEVERITY_ERROR, OO_SEVERITY_INFO, OO_SEVERITY_WARNFields inherited from interface ca.uhn.fhir.jpa.api.dao.IDao
CURRENTLY_REINDEXING, RESOURCE_PID, RESOURCE_PID_KEY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringcreateVersionedSystemIfVersionIsPresent(String theCodeSystemUrl, String theVersion) static ca.uhn.fhir.context.support.IValidationSupport.LookupCodeResultdoLookupCode(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.LookupCodeResultlookupCode(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.LookupCodeResultlookupCode(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.LookupCodeResultlookupCode(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 voidpreDelete(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).voidstart()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.CodeValidationResultvalidateCode(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, fetchAllVersionsOfResources, forceExpungeInExistingTransaction, getDeleteExpungeJobSubmitter, getMatchResourceUrlService, getMatchUrlService, getMessageSanitized, getRequestPartitionHelperService, getResourceName, getResourceType, getStorageResourceParser, getTransactionService, history, history, history, invokeStoragePreAccessResources, invokeStoragePreShowResources, isPagingProviderDatabaseBacked, isResourceIdServerAssigned, 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, validatePartitionIdMatchMethods inherited from class ca.uhn.fhir.jpa.dao.BaseHapiFhirDao
addPidToResource, decodeResource, getApplicationContext, getContext, getInterceptorBroadcaster, getStorageSettings, isLogicalReference, parseContentTextIntoWords, populateResourceIntoEntity, postDelete, postPersist, postUpdate, setApplicationContext, setContext, setDaoSearchParamSynchronizer, setDisableIncrementOnUpdateForUnitTest, setEntityManager, setExternallyStoredResourceServiceRegistryForUnitTest, setInterceptorBroadcasterForUnitTest, setJpaStorageResourceParserForUnitTest, setPartitionSettingsForUnitTest, setResourceHistoryCalculator, setResourceHistoryTableDao, setResourceTypeCacheSvc, setSearchParamPresenceSvc, setSearchParamWithInlineReferencesExtractor, setStorageSettingsForUnitTest, setValidationDisabledForUnitTest, shouldDroppedTagBeRemovedOnUpdate, updateHistoryEntity, updateInternal, updateTags, validateMetaCount, validateResourceForStorageMethods inherited from class ca.uhn.fhir.jpa.dao.BaseStorageResourceDao
deleteExpunge, patch, patchInTransaction, validateResourceTypeMethods inherited from class ca.uhn.fhir.jpa.dao.BaseStorageDao
addIssueToOperationOutcomeForAutoCreatedPlaceholder, clearRequestAsProcessingSubRequest, createErrorOperationOutcome, createInfoOperationOutcome, createInfoOperationOutcome, createMethodOutcomeForResourceId, createResourceGoneException, createWarnOperationOutcome, doCallHooks, extractReferencesToAutoVersion, extractReferencesToAvoidReplacement, markRequestAsProcessingSubRequest, populateOperationOutcomeForUpdate, preProcessResourceForStorage, preProcessResourceForStorage, setMyMetaTagSorter, setSearchParamRegistry, toMethodOutcome, toMethodOutcomeLazy, translateRawParameters, verifyResourceIdIsValidMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ca.uhn.fhir.jpa.api.dao.IDao
getContextMethods 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, fetchAllVersionsOfResources, 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:
startin 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:
findCodeSystemIdsContainingSystemAndCodein 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:
lookupCodein 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:
lookupCodein 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:
lookupCodein 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:
subsumesin 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:BaseHapiFhirResourceDaoSubclasses may override to provide behaviour. Invoked within a delete transaction with the resource that is about to be deleted.- Overrides:
preDeletein 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:
reindexin interfaceIFhirResourceDao<T extends org.hl7.fhir.instance.model.api.IBaseResource>- Overrides:
reindexin classBaseHapiFhirResourceDao<T extends org.hl7.fhir.instance.model.api.IBaseResource>
-
getReindexJobStatus
- Specified by:
getReindexJobStatusin 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:
updateEntityin interfaceIJpaDao<T extends org.hl7.fhir.instance.model.api.IBaseResource>- Overrides:
updateEntityin 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:
validateCodein 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)
-