Package ca.uhn.fhir.jpa.term
Class TermReadSvcImpl
java.lang.Object
ca.uhn.fhir.jpa.term.TermReadSvcImpl
- All Implemented Interfaces:
ca.uhn.fhir.context.support.IValidationSupport
,ca.uhn.fhir.jpa.model.sched.IHasScheduledJobs
,ITermReadSvc
public class TermReadSvcImpl
extends Object
implements ITermReadSvc, ca.uhn.fhir.jpa.model.sched.IHasScheduledJobs
-
Nested Class Summary
Nested classes/interfaces inherited from interface ca.uhn.fhir.context.support.IValidationSupport
ca.uhn.fhir.context.support.IValidationSupport.BaseConceptProperty, ca.uhn.fhir.context.support.IValidationSupport.CodeValidationIssue, ca.uhn.fhir.context.support.IValidationSupport.CodeValidationIssueCode, ca.uhn.fhir.context.support.IValidationSupport.CodeValidationIssueCoding, ca.uhn.fhir.context.support.IValidationSupport.CodeValidationIssueDetails, ca.uhn.fhir.context.support.IValidationSupport.CodeValidationResult, ca.uhn.fhir.context.support.IValidationSupport.CodingConceptProperty, ca.uhn.fhir.context.support.IValidationSupport.ConceptDesignation, ca.uhn.fhir.context.support.IValidationSupport.GroupConceptProperty, ca.uhn.fhir.context.support.IValidationSupport.IssueSeverity, ca.uhn.fhir.context.support.IValidationSupport.LookupCodeResult, ca.uhn.fhir.context.support.IValidationSupport.StringConceptProperty, ca.uhn.fhir.context.support.IValidationSupport.TranslateCodeRequest, ca.uhn.fhir.context.support.IValidationSupport.ValueSetExpansionOutcome
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
static final int
static final int
protected ITermCodeSystemDao
protected ITermConceptDao
protected ITermConceptDesignationDao
protected ITermConceptPropertyDao
protected ca.uhn.fhir.context.FhirContext
protected DaoRegistry
protected jakarta.persistence.EntityManager
protected ITermValueSetDao
protected ITermValueSetConceptDao
protected ITermValueSetConceptDesignationDao
Fields inherited from interface ca.uhn.fhir.context.support.IValidationSupport
TYPE_CODING, TYPE_GROUP, TYPE_STRING, URL_PREFIX_VALUE_SET
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
applyFilter
(String theDisplay, String theFilterDisplay) void
deleteValueSetAndChildren
(ResourceTable theResourceTable) deleteValueSetForResource
(ResourceTable theResourceTable) ca.uhn.fhir.context.support.IValidationSupport.ValueSetExpansionOutcome
expandValueSet
(ca.uhn.fhir.context.support.ValidationSupportContext theValidationSupportContext, ca.uhn.fhir.context.support.ValueSetExpansionOptions theExpansionOptions, org.hl7.fhir.instance.model.api.IBaseResource theValueSetToExpand) org.hl7.fhir.r4.model.ValueSet
expandValueSet
(ca.uhn.fhir.context.support.ValueSetExpansionOptions theExpansionOptions, String theValueSetCanonicalUrl) org.hl7.fhir.instance.model.api.IBaseResource
expandValueSet
(ca.uhn.fhir.context.support.ValueSetExpansionOptions theExpansionOptions, org.hl7.fhir.instance.model.api.IBaseResource theInput) Version independentvoid
expandValueSet
(ca.uhn.fhir.context.support.ValueSetExpansionOptions theExpansionOptions, org.hl7.fhir.instance.model.api.IBaseResource theValueSetToExpand, IValueSetConceptAccumulator theValueSetCodeAccumulator) org.hl7.fhir.r4.model.ValueSet
expandValueSet
(ca.uhn.fhir.context.support.ValueSetExpansionOptions theExpansionOptions, org.hl7.fhir.r4.model.ValueSet theValueSetToExpand) void
expandValueSet
(ca.uhn.fhir.context.support.ValueSetExpansionOptions theExpansionOptions, org.hl7.fhir.r4.model.ValueSet theValueSetToExpand, IValueSetConceptAccumulator theValueSetCodeAccumulator) expandValueSetIntoConceptList
(ca.uhn.fhir.context.support.ValueSetExpansionOptions theExpansionOptions, String theValueSetCanonicalUrl) org.hl7.fhir.r4.model.CodeSystem
org.hl7.fhir.r4.model.ValueSet
fetchCanonicalValueSetFromCompleteContext
(String theSystem) org.hl7.fhir.instance.model.api.IBaseResource
fetchValueSet
(String theValueSetUrl) findCodesAbove
(Long theCodeSystemResourcePid, Long theCodeSystemVersionPid, String theCode) findCodesAbove
(String theSystem, String theCode) findCodesAboveUsingBuiltInSystems
(String theSystem, String theCode) findCodesBelow
(Long theCodeSystemResourcePid, Long theCodeSystemVersionPid, String theCode) findCodesBelow
(String theSystem, String theCode) findCodesBelowUsingBuiltInSystems
(String theSystem, String theCode) findCurrentTermValueSet
(String theUrl) When the search is for unversioned loinc system it uses the forcedId to obtain the current version, as it is not necessarily the last one anymore.ca.uhn.fhir.context.FhirContext
void
invalidatePreCalculatedExpansion
(org.hl7.fhir.instance.model.api.IIdType theValueSetId, ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails) boolean
isCodeSystemSupported
(ca.uhn.fhir.context.support.ValidationSupportContext theValidationSupportContext, String theSystem) boolean
isValueSetPreExpandedForCodeValidation
(org.hl7.fhir.instance.model.api.IBaseResource theValueSet) Version independentboolean
isValueSetPreExpandedForCodeValidation
(org.hl7.fhir.r4.model.ValueSet theValueSet) boolean
isValueSetSupported
(ca.uhn.fhir.context.support.ValidationSupportContext theValidationSupportContext, String theValueSetUrl) ca.uhn.fhir.context.support.IValidationSupport.LookupCodeResult
lookupCode
(ca.uhn.fhir.context.support.ValidationSupportContext theValidationSupportContext, ca.uhn.fhir.context.support.LookupCodeRequest theLookupCodeRequest) void
protected ca.uhn.fhir.context.support.IValidationSupport
Optional
<org.hl7.fhir.instance.model.api.IBaseResource> readCodeSystemByForcedId
(String theForcedId) Version independentVersion independent Recreates freetext indexes for TermConcept and nested TermConceptPropertyvoid
scheduleJobs
(ca.uhn.fhir.jpa.model.sched.ISchedulerService theSchedulerService) static void
setForceDisableHibernateSearchForUnitTest
(boolean theForceDisableHibernateSearchForUnitTest) static void
setInvokeOnNextCallForUnitTest
(Runnable theInvokeOnNextCallForUnitTest) void
start()
void
storeTermValueSet
(ResourceTable theResourceTable, org.hl7.fhir.r4.model.ValueSet theValueSet) 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.context.support.IValidationSupport.CodeValidationResult
validateCode
(ca.uhn.fhir.context.support.ValidationSupportContext theValidationSupportContext, ca.uhn.fhir.context.support.ConceptValidationOptions theOptions, String theCodeSystemUrl, String theCode, String theDisplay, String theValueSetUrl) ca.uhn.fhir.context.support.IValidationSupport.CodeValidationResult
validateCodeInValueSet
(ca.uhn.fhir.context.support.ValidationSupportContext theValidationSupportContext, ca.uhn.fhir.context.support.ConceptValidationOptions theOptions, String theCodeSystem, String theCode, String theDisplay, org.hl7.fhir.instance.model.api.IBaseResource theValueSet) ca.uhn.fhir.context.support.IValidationSupport.CodeValidationResult
validateCodeIsInPreExpandedValueSet
(ca.uhn.fhir.context.support.ValidationSupportContext theValidationSupportContext, ca.uhn.fhir.context.support.ConceptValidationOptions theOptions, org.hl7.fhir.instance.model.api.IBaseResource theValueSet, String theSystem, String theCode, String theDisplay, org.hl7.fhir.instance.model.api.IBaseDatatype theCoding, org.hl7.fhir.instance.model.api.IBaseDatatype theCodeableConcept) Version independentprotected ca.uhn.fhir.context.support.IValidationSupport.CodeValidationResult
validateCodeIsInPreExpandedValueSet
(ca.uhn.fhir.context.support.ValidationSupportContext theValidationSupportContext, ca.uhn.fhir.context.support.ConceptValidationOptions theValidationOptions, org.hl7.fhir.r4.model.ValueSet theValueSet, String theSystem, String theCode, String theDisplay, org.hl7.fhir.r4.model.Coding theCoding, org.hl7.fhir.r4.model.CodeableConcept theCodeableConcept) 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.context.support.IValidationSupport
expandValueSet, fetchAllConformanceResources, fetchAllNonBaseStructureDefinitions, fetchAllSearchParameters, fetchAllStructureDefinitions, fetchBinary, fetchCodeSystem, fetchResource, fetchStructureDefinition, generateSnapshot, getName, isCodeableConceptValidationSuccessfulIfNotAllCodingsAreValid, isRemoteTerminologyServiceConfigured, lookupCode, lookupCode, translateConcept
-
Field Details
-
DEFAULT_FETCH_SIZE
- See Also:
-
DEFAULT_MASS_INDEXER_OBJECT_LOADING_THREADS
- See Also:
-
MAX_MASS_INDEXER_OBJECT_LOADING_THREADS
- See Also:
-
myDaoRegistry
-
myCodeSystemDao
-
myConceptDao
-
myConceptPropertyDao
-
myConceptDesignationDao
-
myTermValueSetDao
-
myValueSetConceptDao
-
myValueSetConceptDesignationDao
-
myContext
-
myEntityManager
-
-
Constructor Details
-
TermReadSvcImpl
public TermReadSvcImpl()
-
-
Method Details
-
isCodeSystemSupported
public boolean isCodeSystemSupported(ca.uhn.fhir.context.support.ValidationSupportContext theValidationSupportContext, String theSystem) - Specified by:
isCodeSystemSupported
in interfaceca.uhn.fhir.context.support.IValidationSupport
-
isValueSetSupported
public boolean isValueSetSupported(ca.uhn.fhir.context.support.ValidationSupportContext theValidationSupportContext, String theValueSetUrl) - Specified by:
isValueSetSupported
in interfaceca.uhn.fhir.context.support.IValidationSupport
-
deleteValueSetForResource
-
deleteValueSetAndChildren
- Specified by:
deleteValueSetAndChildren
in interfaceITermReadSvc
-
expandValueSetIntoConceptList
@Transactional public List<FhirVersionIndependentConcept> expandValueSetIntoConceptList(@Nullable ca.uhn.fhir.context.support.ValueSetExpansionOptions theExpansionOptions, @Nonnull String theValueSetCanonicalUrl) - Specified by:
expandValueSetIntoConceptList
in interfaceITermReadSvc
-
expandValueSet
public org.hl7.fhir.r4.model.ValueSet expandValueSet(@Nullable ca.uhn.fhir.context.support.ValueSetExpansionOptions theExpansionOptions, @Nonnull String theValueSetCanonicalUrl) - Specified by:
expandValueSet
in interfaceITermReadSvc
-
expandValueSet
public org.hl7.fhir.r4.model.ValueSet expandValueSet(@Nullable ca.uhn.fhir.context.support.ValueSetExpansionOptions theExpansionOptions, @Nonnull org.hl7.fhir.r4.model.ValueSet theValueSetToExpand) - Specified by:
expandValueSet
in interfaceITermReadSvc
-
applyFilter
-
expandValueSet
public void expandValueSet(ca.uhn.fhir.context.support.ValueSetExpansionOptions theExpansionOptions, org.hl7.fhir.r4.model.ValueSet theValueSetToExpand, IValueSetConceptAccumulator theValueSetCodeAccumulator) - Specified by:
expandValueSet
in interfaceITermReadSvc
-
invalidatePreCalculatedExpansion
@Transactional public String invalidatePreCalculatedExpansion(org.hl7.fhir.instance.model.api.IIdType theValueSetId, ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails) - Specified by:
invalidatePreCalculatedExpansion
in interfaceITermReadSvc
-
isValueSetPreExpandedForCodeValidation
@Transactional(readOnly=true) public boolean isValueSetPreExpandedForCodeValidation(org.hl7.fhir.r4.model.ValueSet theValueSet) - Specified by:
isValueSetPreExpandedForCodeValidation
in interfaceITermReadSvc
-
validateCodeIsInPreExpandedValueSet
protected ca.uhn.fhir.context.support.IValidationSupport.CodeValidationResult validateCodeIsInPreExpandedValueSet(ca.uhn.fhir.context.support.ValidationSupportContext theValidationSupportContext, ca.uhn.fhir.context.support.ConceptValidationOptions theValidationOptions, org.hl7.fhir.r4.model.ValueSet theValueSet, String theSystem, String theCode, String theDisplay, org.hl7.fhir.r4.model.Coding theCoding, org.hl7.fhir.r4.model.CodeableConcept theCodeableConcept) -
findCode
- Specified by:
findCode
in interfaceITermReadSvc
-
findCodes
- Specified by:
findCodes
in interfaceITermReadSvc
-
findCodesAbove
@Transactional(propagation=REQUIRED, readOnly=true) public Set<TermConcept> findCodesAbove(Long theCodeSystemResourcePid, Long theCodeSystemVersionPid, String theCode) - Specified by:
findCodesAbove
in interfaceITermReadSvc
-
findCodesAbove
@Transactional(readOnly=true) public List<FhirVersionIndependentConcept> findCodesAbove(String theSystem, String theCode) - Specified by:
findCodesAbove
in interfaceITermReadSvc
-
findCodesBelow
@Transactional(propagation=REQUIRED, readOnly=true) public Set<TermConcept> findCodesBelow(Long theCodeSystemResourcePid, Long theCodeSystemVersionPid, String theCode) - Specified by:
findCodesBelow
in interfaceITermReadSvc
-
findCodesBelow
@Transactional(readOnly=true) public List<FhirVersionIndependentConcept> findCodesBelow(String theSystem, String theCode) - Specified by:
findCodesBelow
in interfaceITermReadSvc
-
start
-
scheduleJobs
- Specified by:
scheduleJobs
in interfaceca.uhn.fhir.jpa.model.sched.IHasScheduledJobs
-
preExpandDeferredValueSetsToTerminologyTables
- Specified by:
preExpandDeferredValueSetsToTerminologyTables
in interfaceITermReadSvc
-
invalidateCaches
- Specified by:
invalidateCaches
in interfaceca.uhn.fhir.context.support.IValidationSupport
-
storeTermValueSet
@Transactional public void storeTermValueSet(ResourceTable theResourceTable, org.hl7.fhir.r4.model.ValueSet theValueSet) - Specified by:
storeTermValueSet
in interfaceITermReadSvc
-
subsumes
@Transactional 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) - Specified by:
subsumes
in interfaceITermReadSvc
-
lookupCode
public ca.uhn.fhir.context.support.IValidationSupport.LookupCodeResult lookupCode(ca.uhn.fhir.context.support.ValidationSupportContext theValidationSupportContext, @Nonnull ca.uhn.fhir.context.support.LookupCodeRequest theLookupCodeRequest) - Specified by:
lookupCode
in interfaceca.uhn.fhir.context.support.IValidationSupport
-
validateCodeInValueSet
@Transactional public ca.uhn.fhir.context.support.IValidationSupport.CodeValidationResult validateCodeInValueSet(ca.uhn.fhir.context.support.ValidationSupportContext theValidationSupportContext, ca.uhn.fhir.context.support.ConceptValidationOptions theOptions, String theCodeSystem, String theCode, String theDisplay, @Nonnull org.hl7.fhir.instance.model.api.IBaseResource theValueSet) - Specified by:
validateCodeInValueSet
in interfaceca.uhn.fhir.context.support.IValidationSupport
-
validateCode
public ca.uhn.fhir.context.support.IValidationSupport.CodeValidationResult validateCode(@Nonnull ca.uhn.fhir.context.support.ValidationSupportContext theValidationSupportContext, @Nonnull ca.uhn.fhir.context.support.ConceptValidationOptions theOptions, String theCodeSystemUrl, String theCode, String theDisplay, String theValueSetUrl) - Specified by:
validateCode
in interfaceca.uhn.fhir.context.support.IValidationSupport
-
fetchCanonicalCodeSystemFromCompleteContext
public org.hl7.fhir.r4.model.CodeSystem fetchCanonicalCodeSystemFromCompleteContext(String theSystem) - Specified by:
fetchCanonicalCodeSystemFromCompleteContext
in interfaceITermReadSvc
-
provideValidationSupport
-
fetchCanonicalValueSetFromCompleteContext
-
fetchValueSet
- Specified by:
fetchValueSet
in interfaceca.uhn.fhir.context.support.IValidationSupport
-
getFhirContext
- Specified by:
getFhirContext
in interfaceca.uhn.fhir.context.support.IValidationSupport
-
findCodesAboveUsingBuiltInSystems
public List<FhirVersionIndependentConcept> findCodesAboveUsingBuiltInSystems(String theSystem, String theCode) - Specified by:
findCodesAboveUsingBuiltInSystems
in interfaceITermReadSvc
-
findCodesBelowUsingBuiltInSystems
public List<FhirVersionIndependentConcept> findCodesBelowUsingBuiltInSystems(String theSystem, String theCode) - Specified by:
findCodesBelowUsingBuiltInSystems
in interfaceITermReadSvc
-
findCurrentTermValueSet
When the search is for unversioned loinc system it uses the forcedId to obtain the current version, as it is not necessarily the last one anymore. For other cases it keeps on considering the last uploaded as the current- Specified by:
findCurrentTermValueSet
in interfaceITermReadSvc
-
readCodeSystemByForcedId
public Optional<org.hl7.fhir.instance.model.api.IBaseResource> readCodeSystemByForcedId(String theForcedId) Description copied from interface:ITermReadSvc
Version independent- Specified by:
readCodeSystemByForcedId
in interfaceITermReadSvc
-
reindexTerminology
Description copied from interface:ITermReadSvc
Version independent Recreates freetext indexes for TermConcept and nested TermConceptProperty- Specified by:
reindexTerminology
in interfaceITermReadSvc
- Throws:
InterruptedException
-
expandValueSet
public ca.uhn.fhir.context.support.IValidationSupport.ValueSetExpansionOutcome expandValueSet(ca.uhn.fhir.context.support.ValidationSupportContext theValidationSupportContext, ca.uhn.fhir.context.support.ValueSetExpansionOptions theExpansionOptions, @Nonnull org.hl7.fhir.instance.model.api.IBaseResource theValueSetToExpand) - Specified by:
expandValueSet
in interfaceca.uhn.fhir.context.support.IValidationSupport
-
expandValueSet
public org.hl7.fhir.instance.model.api.IBaseResource expandValueSet(ca.uhn.fhir.context.support.ValueSetExpansionOptions theExpansionOptions, org.hl7.fhir.instance.model.api.IBaseResource theInput) Description copied from interface:ITermReadSvc
Version independent- Specified by:
expandValueSet
in interfaceITermReadSvc
-
expandValueSet
public void expandValueSet(ca.uhn.fhir.context.support.ValueSetExpansionOptions theExpansionOptions, org.hl7.fhir.instance.model.api.IBaseResource theValueSetToExpand, IValueSetConceptAccumulator theValueSetCodeAccumulator) - Specified by:
expandValueSet
in interfaceITermReadSvc
-
validateCodeIsInPreExpandedValueSet
public ca.uhn.fhir.context.support.IValidationSupport.CodeValidationResult validateCodeIsInPreExpandedValueSet(ca.uhn.fhir.context.support.ValidationSupportContext theValidationSupportContext, ca.uhn.fhir.context.support.ConceptValidationOptions theOptions, org.hl7.fhir.instance.model.api.IBaseResource theValueSet, String theSystem, String theCode, String theDisplay, org.hl7.fhir.instance.model.api.IBaseDatatype theCoding, org.hl7.fhir.instance.model.api.IBaseDatatype theCodeableConcept) Description copied from interface:ITermReadSvc
Version independent- Specified by:
validateCodeIsInPreExpandedValueSet
in interfaceITermReadSvc
-
isValueSetPreExpandedForCodeValidation
public boolean isValueSetPreExpandedForCodeValidation(org.hl7.fhir.instance.model.api.IBaseResource theValueSet) Description copied from interface:ITermReadSvc
Version independent- Specified by:
isValueSetPreExpandedForCodeValidation
in interfaceITermReadSvc
-
setForceDisableHibernateSearchForUnitTest
public static void setForceDisableHibernateSearchForUnitTest(boolean theForceDisableHibernateSearchForUnitTest) -
setInvokeOnNextCallForUnitTest
-