Package org.hl7.fhir.r5.context
Class BaseWorkerContext
java.lang.Object
org.hl7.fhir.utilities.i18n.I18nBase
org.hl7.fhir.r5.context.BaseWorkerContext
- All Implemented Interfaces:
IWorkerContext
- Direct Known Subclasses:
SimpleWorkerContext
public abstract class BaseWorkerContext
extends org.hl7.fhir.utilities.i18n.I18nBase
implements IWorkerContext
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassclassclassstatic interfaceclassstatic classNested classes/interfaces inherited from interface org.hl7.fhir.r5.context.IWorkerContext
IWorkerContext.ILoggingService, IWorkerContext.ITerminologyOperationDetails, IWorkerContext.OIDDefinition, IWorkerContext.OIDDefinitionComparer, IWorkerContext.OIDSummary -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Map<String,BaseWorkerContext.IByteProvider> protected booleanprotected org.hl7.fhir.utilities.TimeTrackerprotected Parametersprotected ILoggingServiceprotected Stringprotected booleanprotected Map<String,Set<IWorkerContext.OIDDefinition>> protected List<org.hl7.fhir.r5.context.BaseWorkerContext.OIDSource>protected final TerminologyClientManagerprotected CanonicalResourceManager<StructureMap>protected TerminologyCacheprotected org.hl7.fhir.utilities.ToolingClientLoggerprotected Stringprotected Map<String,Map<String, ValidationResult>> protected StringFields inherited from class org.hl7.fhir.utilities.i18n.I18nBase
KEY_DELIMITER, locale, PLURAL_SUFFIX -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedprotectedBaseWorkerContext(Locale locale) protectedBaseWorkerContext(CanonicalResourceManager<CodeSystem> codeSystems, CanonicalResourceManager<ValueSet> valueSets, CanonicalResourceManager<ConceptMap> maps, CanonicalResourceManager<StructureDefinition> profiles, CanonicalResourceManager<ImplementationGuide> guides) -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddDependentCodeSystem(IWorkerContext.ITerminologyOperationDetails opCtxt, TerminologyClientContext tc, Parameters pin, String sys, Resource src) protected voidaddServerValidationParameters(IWorkerContext.ITerminologyOperationDetails opCtxt, TerminologyClientContext terminologyClientContext, ValueSet vs, Parameters pin, org.hl7.fhir.utilities.validation.ValidationOptions options) protected voidaddServerValidationParameters(IWorkerContext.ITerminologyOperationDetails opCtxt, TerminologyClientContext terminologyClientContext, ValueSet vs, Parameters pin, org.hl7.fhir.utilities.validation.ValidationOptions options, Set<String> systems) voidcache a resource for later retrieval using fetchResource.voidcacheResourceFromPackage(Resource r, PackageInformation packageInfo) cache a resource for later retrieval using fetchResource.voidcacheVS(com.google.gson.JsonObject json, Map<String, ValidationResult> t) voidclearTSCache(String url) org.hl7.fhir.utilities.TimeTrackerclock()protected ParametersconstructParameters(IWorkerContext.ITerminologyOperationDetails opCtxt, TerminologyClientContext tcd, ValueSet vs, boolean hierarchical) protected ParametersconstructParameters(org.hl7.fhir.utilities.validation.ValidationOptions options, CodeableConcept codeableConcept) protected ParametersconstructParameters(org.hl7.fhir.utilities.validation.ValidationOptions options, Coding coding) protected ParametersconstructParameters(org.hl7.fhir.utilities.validation.ValidationOptions options, CodingValidationRequest codingValidationRequest, String vsUrl) protected ParametersconstructParameters(org.hl7.fhir.utilities.validation.ValidationOptions options, CodingValidationRequest codingValidationRequest, ValueSet valueSet) protected ValueSetValidatorconstructValueSetCheckerSimple(org.hl7.fhir.utilities.validation.ValidationOptions options, ValueSet vs) protected ValueSetValidatorconstructValueSetCheckerSimple(org.hl7.fhir.utilities.validation.ValidationOptions options, ValueSet vs, ValidationContextCarrier ctxt) protected ValueSetExpanderconstructValueSetExpanderSimple(org.hl7.fhir.utilities.validation.ValidationOptions options) protected voidcopy(BaseWorkerContext other) intvoiddropResource(String fhirType, String id) voidexpandVS(IWorkerContext.ITerminologyOperationDetails opCtxt, ValueSet.ConceptSetComponent inc, boolean hierarchical, boolean noInactive) Value set expanion inside the internal expansion engine - used for references to supported system (see "supportsSystem") for which there is no value set.expandVS(Resource src, ElementDefinition.ElementDefinitionBindingComponent binding, boolean cacheOk, boolean heirarchical) ValueSet Expansion - see $expand, but resolves the binding firstValueSet Expansion - see $expandValueSet Expansion - see $expandexpandVS(ValueSet vs, boolean cacheOk, boolean hierarchical, boolean incompleteOk, Parameters pIn) expandVS(ValueSet vs, boolean cacheOk, boolean hierarchical, boolean incompleteOk, Parameters pIn, boolean noLimits) fetchCodeSystem(String system) Find the code system definition for the nominated system uri.fetchCodeSystem(String system, String version) fetchCodeSystem(String system, String version, org.hl7.fhir.utilities.FhirPublication fhirVersion) fetchCodeSystem(String system, org.hl7.fhir.utilities.FhirPublication fhirVersion) <T extends Resource>
TfetchResource(Class<T> class_, String uri) Find an identified resource.<T extends Resource>
TfetchResource(Class<T> class_, String uri, String version) <T extends Resource>
TfetchResource(Class<T> class_, String uri, String version, org.hl7.fhir.utilities.FhirPublication fhirVersion) <T extends Resource>
TfetchResource(Class<T> class_, String uri, Resource sourceForReference) has the same functionality as fetchResource, but passes in information about the source of the reference (this may affect resolution of version)<T extends Resource>
TfetchResource(Class<T> class_, String uri, org.hl7.fhir.utilities.FhirPublication fhirVersion) fetchResourceById(String type, String uri) Variation of fetchResource when you have a string type, and don't need the right class The URI can have one of 3 formats: - a full URL e.g.fetchResourceById(String type, String uri, org.hl7.fhir.utilities.FhirPublication fhirVersion) fetchResourcesByType(Class<T> class_) fetchResourcesByType(Class<T> class_, org.hl7.fhir.utilities.FhirPublication fhirVersion) Fetch all the resources of a particular type.fetchResourcesByUrl(Class<T> class_, String uri) Fetch all the resources for the given URL - all matching versions<T extends Resource>
TfetchResourceWithException(Class<T> class_, String uri) <T extends Resource>
TfetchResourceWithException(Class<T> class_, String uri, Resource sourceForReference) <T extends Resource>
TfetchResourceWithException(String cls, String uri) <T extends Resource>
TfetchResourceWithExceptionByVersion(Class<T> class_, String uri, String version, Resource sourceForReference) <T extends Resource>
TfetchResourceWithExceptionByVersion(String cls, String uri, String version, CanonicalResource source) fetchSupplementedCodeSystem(String system) Like fetchCodeSystem, except that the context will find any CodeSysetm supplements and merge them into thefetchSupplementedCodeSystem(String system, String version) fetchSupplementedCodeSystem(String system, String version, org.hl7.fhir.utilities.FhirPublication fhirVersion) fetchSupplementedCodeSystem(String system, org.hl7.fhir.utilities.FhirPublication fhirVersion) fetchTypeDefinition(String typeName) This is a short cut for fetchResource(StructureDefinition.class, ...) but it accepts a typename - that is, it resolves based on StructureDefinition.type or StructureDefinition.url.fetchTypeDefinition(String typeName, org.hl7.fhir.utilities.FhirPublication fhirVersion) fetchTypeDefinitions(String typeName) This finds all the structure definitions that have the given typeNamefetchTypeDefinitions(String typeName, org.hl7.fhir.utilities.FhirPublication fhirVersion) <T extends Resource>
TfindTxResource(Class<T> class_, String canonical) <T extends Resource>
TfindTxResource(Class<T> class_, String canonical, String version) <T extends Resource>
TfindTxResource(Class<T> class_, String canonical, Resource sourceOfReference) this first does a fetch resource, and if nothing is found, looks in the terminology eco-system for a matching definition for the resource usually used (and so far only tested with) ValueSet.classvoidfinishLoading(boolean genSnapshots) voidbyte[]getBinaryForKey(String binaryKey) Returns the binary for the keyReturns a set of keys that can be used to get binaries from this context.intintSet the expansion parameters passed through the terminology server when txServer calls are made Note that the Validation Options override these when they are specified on validateCodegetLinkForUrl(String corePath, String url) getName()getPackageForUrl(String uri) getProfiledElementBuilder(PEBuilder.PEElementPropertiesPolicy elementProps, boolean fixedProps) getResourceNames(org.hl7.fhir.utilities.FhirPublication fhirVersion) getResourceNamesAsSet(org.hl7.fhir.utilities.FhirPublication fhirVersion) getSearchParameter(String code) getStructure(String code) org.fhir.ucum.UcumServiceGet the UCUM service that provides access to units of measure reasoning services This service might not be availablebooleanhasBinaryKey(String binaryKey) Returns true if this worker context contains a binary for this key.<T extends Resource>
booleanhasResource(Class<T> class_, String uri) find whether a resource is available.<T extends Resource>
booleanhasResource(Class<T> class_, String uri, Resource sourceOfReference) <T extends Resource>
booleanhasResource(Class<T> class_, String uri, org.hl7.fhir.utilities.FhirPublication fhirVersion) <T extends Resource>
booleanhasResource(String cls, String uri) <T extends Resource>
booleanhasResource(String cls, String uri, org.hl7.fhir.utilities.FhirPublication fhirVersion) <T extends Resource>
booleanhasResourceVersion(Class<T> class_, String uri, String version) <T extends Resource>
booleanhasResourceVersion(Class<T> class_, String uri, String version, org.hl7.fhir.utilities.FhirPublication fhirVersion) <T extends Resource>
booleanhasResourceVersion(String cls, String uri, String version) <T extends Resource>
booleanhasResourceVersion(String cls, String uri, String version, org.hl7.fhir.utilities.FhirPublication fhirVersion) voidinitTxCache(String cachePath) voidinitTxCache(TerminologyCache cache) booleanbooleanbooleanbooleanisDataType(String type) return whether type is data type.booleanbooleanbooleanisPrimitiveType(String type) return whether type is primitive type.booleanisServerSideSystem(String url) booleanlistMaps()processSubsumesResult(Parameters pOut, String server) processValidationResult(Parameters pOut, String vs, String server) voidregisterResourceFromPackage(CanonicalResourceManager.CanonicalResourceProxy r, PackageInformation packageInfo) voidreportStatus(com.google.gson.JsonObject json) protected <T extends CanonicalResource>
voidseeMetadataResource(T r, Map<String, T> map, List<T> list, boolean addId) voidsetAllowLoadingDuplicates(boolean allowLoadingDuplicates) voidsetCachingAllowed(boolean cachingAllowed) voidsetCanRunWithoutTerminology(boolean canRunWithoutTerminology) setClientRetryCount(int value) voidsetExpandCodesLimit(int expandCodesLimit) voidsetExpansionParameters(Parameters expParameters) Get the expansion parameters passed through the terminology server when txServer calls are made Note that the Validation Options override these when they are specified on validateCodevoidsetForPublication(boolean value) voidvoidvoidsetLogger(ILoggingService logger) voidvoidsetNoTerminologyServer(boolean noTerminologyServer) setPackageTracker(IWorkerContextManager.IPackageLoadingTracker packageTracker) voidsetTlogging(boolean tlogging) voidsetUcumService(org.fhir.ucum.UcumService ucumService) protected voidsetUserAgent(String userAgent) subsumes(org.hl7.fhir.utilities.validation.ValidationOptions optionsArg, Coding parent, Coding child) ask the terminology system whether parent subsumes child.booleansupportsSystem(String system) True if the underlying terminology service provider will do expansion and code validation for the terminology.booleansupportsSystem(String system, org.hl7.fhir.utilities.FhirPublication fhirVersion) protected Stringintprotected voidvoidunload()urlsForOid(String oid, String resourceType) urlsForOid(String oid, String resourceType, boolean retired) validateCode(org.hl7.fhir.utilities.validation.ValidationOptions options, String system, String version, String code, String display) Validation of a code - consult the terminology infrstructure and/or service to see whether it is known.validateCode(org.hl7.fhir.utilities.validation.ValidationOptions options, String system, String version, String code, String display, ValueSet vs) Validation of a code - consult the terminology infrstructure and/or service to see whether it is known.validateCode(org.hl7.fhir.utilities.validation.ValidationOptions options, String path, Coding code, ValueSet vs) validateCode(org.hl7.fhir.utilities.validation.ValidationOptions optionsArg, String path, Coding code, ValueSet vs, ValidationContextCarrier ctxt) validateCode(org.hl7.fhir.utilities.validation.ValidationOptions options, String code, ValueSet vs) Validation of a code - consult the terminology infrstructure and/or service to see whether it is known.validateCode(org.hl7.fhir.utilities.validation.ValidationOptions options, CodeableConcept code, ValueSet vs) Validation of a code - consult the terminology infrstructure and/or service to see whether it is known.validateCode(org.hl7.fhir.utilities.validation.ValidationOptions options, Coding code, ValueSet vs) Validation of a code - consult the terminology infrstructure and/or service to see whether it is known.validateCode(org.hl7.fhir.utilities.validation.ValidationOptions optionsArg, Coding code, ValueSet vs, ValidationContextCarrier ctxt) See comments in ValidationContextCarrier.voidvalidateCodeBatch(org.hl7.fhir.utilities.validation.ValidationOptions options, List<? extends CodingValidationRequest> codes, ValueSet vs) Batch validate code - reduce latency and do a bunch of codes in a single server call.voidvalidateCodeBatchByRef(org.hl7.fhir.utilities.validation.ValidationOptions options, List<? extends CodingValidationRequest> codes, String vsUrl) protected ValidationResultvalidateOnServer(TerminologyClientContext tc, ValueSet vs, Parameters pin, org.hl7.fhir.utilities.validation.ValidationOptions options) protected ValidationResultvalidateOnServer2(TerminologyClientContext tc, ValueSet vs, Parameters pin, org.hl7.fhir.utilities.validation.ValidationOptions options, Set<String> systems) Methods inherited from class org.hl7.fhir.utilities.i18n.I18nBase
formatMessage, formatMessagePlural, getLocale, getMessagesSourceFileName, getPluralKey, getPluralKeys, getPluralSuffixes, getRootKeyFromPlural, isWarnAboutMissingMessages, messageKeyExistsForLocale, setPluralRules, setValidationMessageLanguage, setWarnAboutMissingMessages, typeOfStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.hl7.fhir.r5.context.IWorkerContext
cachePackage, fetchResourceRaw, formatMessage, formatMessagePlural, getLocale, getPackage, getResourceNames, getSpecUrl, getVersion, hasPackage, hasPackage, loadFromPackage, loadFromPackage, loadFromPackageAndDependencies, newValidator, setValidationMessageLanguage
-
Field Details
-
version
-
transforms
-
binaries
-
oidCacheManual
-
oidSources
-
validationCache
-
name
-
txLog
-
canRunWithoutTerminology
-
noTerminologyServer
-
logger
-
terminologyClientManager
-
expParameters
-
txCache
-
clock
-
userAgent
-
packageTracker
-
-
Constructor Details
-
BaseWorkerContext
protected BaseWorkerContext() throws FileNotFoundException, IOException, org.hl7.fhir.exceptions.FHIRException- Throws:
FileNotFoundExceptionIOExceptionorg.hl7.fhir.exceptions.FHIRException
-
BaseWorkerContext
protected BaseWorkerContext(Locale locale) throws FileNotFoundException, IOException, org.hl7.fhir.exceptions.FHIRException - Throws:
FileNotFoundExceptionIOExceptionorg.hl7.fhir.exceptions.FHIRException
-
BaseWorkerContext
protected BaseWorkerContext(CanonicalResourceManager<CodeSystem> codeSystems, CanonicalResourceManager<ValueSet> valueSets, CanonicalResourceManager<ConceptMap> maps, CanonicalResourceManager<StructureDefinition> profiles, CanonicalResourceManager<ImplementationGuide> guides) throws FileNotFoundException, IOException, org.hl7.fhir.exceptions.FHIRException - Throws:
FileNotFoundExceptionIOExceptionorg.hl7.fhir.exceptions.FHIRException
-
-
Method Details
-
copy
-
cacheResource
Description copied from interface:IWorkerContextcache a resource for later retrieval using fetchResource. Note that various context implementations will have their own ways of loading rseources, and not all need implement cacheResource. If the resource is loaded out of a package, call cacheResourceFromPackage instead- Specified by:
cacheResourcein interfaceIWorkerContext- Throws:
org.hl7.fhir.exceptions.FHIRException
-
registerResourceFromPackage
public void registerResourceFromPackage(CanonicalResourceManager.CanonicalResourceProxy r, PackageInformation packageInfo) throws org.hl7.fhir.exceptions.FHIRException - Throws:
org.hl7.fhir.exceptions.FHIRException
-
cacheResourceFromPackage
public void cacheResourceFromPackage(Resource r, PackageInformation packageInfo) throws org.hl7.fhir.exceptions.FHIRException Description copied from interface:IWorkerContextcache a resource for later retrieval using fetchResource. The package information is used to help manage the cache internally, and to help with reference resolution. Packages should be define using cachePackage (but don't have to be) Note that various context implementations will have their own ways of loading rseources, and not all need implement cacheResource- Specified by:
cacheResourceFromPackagein interfaceIWorkerContext- Throws:
org.hl7.fhir.exceptions.FHIRException
-
getNSUrlMap
- Specified by:
getNSUrlMapin interfaceIWorkerContext
-
fixOldSD
-
seeMetadataResource
protected <T extends CanonicalResource> void seeMetadataResource(T r, Map<String, T> map, List<T> list, boolean addId) throws org.hl7.fhir.exceptions.FHIRException- Throws:
org.hl7.fhir.exceptions.FHIRException
-
fetchCodeSystem
public CodeSystem fetchCodeSystem(String system, org.hl7.fhir.utilities.FhirPublication fhirVersion) - Specified by:
fetchCodeSystemin interfaceIWorkerContext
-
fetchCodeSystem
Description copied from interface:IWorkerContextFind the code system definition for the nominated system uri. return null if there isn't one (then the tool might try supportsSystem) This is a short cut for fetchResource(CodeSystem.class...)- Specified by:
fetchCodeSystemin interfaceIWorkerContext- Returns:
-
fetchCodeSystem
public CodeSystem fetchCodeSystem(String system, String version, org.hl7.fhir.utilities.FhirPublication fhirVersion) - Specified by:
fetchCodeSystemin interfaceIWorkerContext
-
fetchCodeSystem
- Specified by:
fetchCodeSystemin interfaceIWorkerContext
-
fetchSupplementedCodeSystem
public CodeSystem fetchSupplementedCodeSystem(String system, org.hl7.fhir.utilities.FhirPublication fhirVersion) - Specified by:
fetchSupplementedCodeSystemin interfaceIWorkerContext
-
fetchSupplementedCodeSystem
public CodeSystem fetchSupplementedCodeSystem(String system, String version, org.hl7.fhir.utilities.FhirPublication fhirVersion) - Specified by:
fetchSupplementedCodeSystemin interfaceIWorkerContext
-
fetchSupplementedCodeSystem
Description copied from interface:IWorkerContextLike fetchCodeSystem, except that the context will find any CodeSysetm supplements and merge them into the- Specified by:
fetchSupplementedCodeSystemin interfaceIWorkerContext- Returns:
-
fetchSupplementedCodeSystem
- Specified by:
fetchSupplementedCodeSystemin interfaceIWorkerContext
-
supportsSystem
public boolean supportsSystem(String system, org.hl7.fhir.utilities.FhirPublication fhirVersion) throws org.hl7.fhir.exceptions.TerminologyServiceException - Specified by:
supportsSystemin interfaceIWorkerContext- Throws:
org.hl7.fhir.exceptions.TerminologyServiceException
-
supportsSystem
public boolean supportsSystem(String system) throws org.hl7.fhir.exceptions.TerminologyServiceException Description copied from interface:IWorkerContextTrue if the underlying terminology service provider will do expansion and code validation for the terminology. Corresponds to the extension http://hl7.org/fhir/StructureDefinition/capabilitystatement-supported-system in the Conformance resource Not that not all supported code systems have an available CodeSystem resource- Specified by:
supportsSystemin interfaceIWorkerContext- Returns:
- Throws:
org.hl7.fhir.exceptions.TerminologyServiceException
-
isServerSideSystem
- Specified by:
isServerSideSystemin interfaceIWorkerContext
-
txLog
-
getExpandCodesLimit
-
setExpandCodesLimit
-
expandVS
public ValueSetExpansionOutcome expandVS(Resource src, ElementDefinition.ElementDefinitionBindingComponent binding, boolean cacheOk, boolean heirarchical) throws org.hl7.fhir.exceptions.FHIRException Description copied from interface:IWorkerContextValueSet Expansion - see $expand, but resolves the binding first- Specified by:
expandVSin interfaceIWorkerContext- Returns:
- Throws:
org.hl7.fhir.exceptions.FHIRException
-
expandVS
public ValueSetExpansionOutcome expandVS(IWorkerContext.ITerminologyOperationDetails opCtxt, ValueSet.ConceptSetComponent inc, boolean hierarchical, boolean noInactive) throws org.hl7.fhir.exceptions.TerminologyServiceException Description copied from interface:IWorkerContextValue set expanion inside the internal expansion engine - used for references to supported system (see "supportsSystem") for which there is no value set.- Specified by:
expandVSin interfaceIWorkerContext- Returns:
- Throws:
org.hl7.fhir.exceptions.TerminologyServiceException
-
expandVS
Description copied from interface:IWorkerContextValueSet Expansion - see $expand- Specified by:
expandVSin interfaceIWorkerContext- Returns:
-
expandVS
public ValueSetExpansionOutcome expandVS(ValueSet vs, boolean cacheOk, boolean heirarchical, int count) - Specified by:
expandVSin interfaceIWorkerContext
-
expandVS
public ValueSetExpansionOutcome expandVS(String url, boolean cacheOk, boolean hierarchical, int count) - Specified by:
expandVSin interfaceIWorkerContext
-
expandVS
public ValueSetExpansionOutcome expandVS(ValueSet vs, boolean cacheOk, boolean heirarchical, boolean incompleteOk) Description copied from interface:IWorkerContextValueSet Expansion - see $expand- Specified by:
expandVSin interfaceIWorkerContext- Returns:
-
expandVS
public ValueSetExpansionOutcome expandVS(ValueSet vs, boolean cacheOk, boolean hierarchical, boolean incompleteOk, Parameters pIn) -
expandVS
public ValueSetExpansionOutcome expandVS(ValueSet vs, boolean cacheOk, boolean hierarchical, boolean incompleteOk, Parameters pIn, boolean noLimits) -
validateCode
public ValidationResult validateCode(org.hl7.fhir.utilities.validation.ValidationOptions options, String system, String version, String code, String display) Description copied from interface:IWorkerContextValidation of a code - consult the terminology infrstructure and/or service to see whether it is known. If known, return a description of it note: always return a result, with either an error or a code description corresponds to 2 terminology service calls: $validate-code and $lookup- Specified by:
validateCodein interfaceIWorkerContext- Parameters:
options- - validation options (required)system- - equals Coding.system (required)code- - equals Coding.code (required)display- - equals Coding.display (optional)- Returns:
-
validateCode
public ValidationResult validateCode(org.hl7.fhir.utilities.validation.ValidationOptions options, String system, String version, String code, String display, ValueSet vs) Description copied from interface:IWorkerContextValidation of a code - consult the terminology infrstructure and/or service to see whether it is known. If known, return a description of it note: always return a result, with either an error or a code description corresponds to 2 terminology service calls: $validate-code and $lookup- Specified by:
validateCodein interfaceIWorkerContext- Parameters:
options- - validation options (required)system- - equals Coding.system (required)code- - equals Coding.code (required)display- - equals Coding.display (optional)vs- the applicable valueset (optional)- Returns:
-
validateCode
public ValidationResult validateCode(org.hl7.fhir.utilities.validation.ValidationOptions options, String code, ValueSet vs) Description copied from interface:IWorkerContextValidation of a code - consult the terminology infrstructure and/or service to see whether it is known. If known, return a description of it note: always return a result, with either an error or a code description corresponds to 2 terminology service calls: $validate-code and $lookup in this case, the system will be inferred from the value set. It's an error to call this one without the value set- Specified by:
validateCodein interfaceIWorkerContext- Parameters:
options- - validation options (required)code- he code to validate (required)vs- the applicable valueset (required)- Returns:
-
validateCodeBatch
public void validateCodeBatch(org.hl7.fhir.utilities.validation.ValidationOptions options, List<? extends CodingValidationRequest> codes, ValueSet vs) Description copied from interface:IWorkerContextBatch validate code - reduce latency and do a bunch of codes in a single server call. Each is the same as a validateCode- Specified by:
validateCodeBatchin interfaceIWorkerContext
-
validateCodeBatchByRef
public void validateCodeBatchByRef(org.hl7.fhir.utilities.validation.ValidationOptions options, List<? extends CodingValidationRequest> codes, String vsUrl) - Specified by:
validateCodeBatchByRefin interfaceIWorkerContext
-
validateCode
public ValidationResult validateCode(org.hl7.fhir.utilities.validation.ValidationOptions options, Coding code, ValueSet vs) Description copied from interface:IWorkerContextValidation of a code - consult the terminology infrstructure and/or service to see whether it is known. If known, return a description of it note: always return a result, with either an error or a code description corresponds to 2 terminology service calls: $validate-code and $lookup in this case, the system will be inferred from the value set. It's an error to call this one without the value set- Specified by:
validateCodein interfaceIWorkerContext- Parameters:
options- - validation options (required)code- - Coding to validatevs- the applicable valueset (optional)- Returns:
-
validateCode
public ValidationResult validateCode(org.hl7.fhir.utilities.validation.ValidationOptions options, String path, Coding code, ValueSet vs) -
validateCode
public ValidationResult validateCode(org.hl7.fhir.utilities.validation.ValidationOptions optionsArg, Coding code, ValueSet vs, ValidationContextCarrier ctxt) Description copied from interface:IWorkerContextSee comments in ValidationContextCarrier. This is called when there might be additional value sets etc available in the context, but we don't want to pre-process them.- Specified by:
validateCodein interfaceIWorkerContext- Returns:
-
validateCode
public ValidationResult validateCode(org.hl7.fhir.utilities.validation.ValidationOptions optionsArg, String path, Coding code, ValueSet vs, ValidationContextCarrier ctxt) -
subsumes
public Boolean subsumes(org.hl7.fhir.utilities.validation.ValidationOptions optionsArg, Coding parent, Coding child) ask the terminology system whether parent subsumes child.- Specified by:
subsumesin interfaceIWorkerContext- Returns:
- true if it does, false if it doesn't, and null if it's not know whether it does
-
processSubsumesResult
-
constructValueSetExpanderSimple
protected ValueSetExpander constructValueSetExpanderSimple(org.hl7.fhir.utilities.validation.ValidationOptions options) -
constructValueSetCheckerSimple
protected ValueSetValidator constructValueSetCheckerSimple(org.hl7.fhir.utilities.validation.ValidationOptions options, ValueSet vs, ValidationContextCarrier ctxt) -
constructValueSetCheckerSimple
protected ValueSetValidator constructValueSetCheckerSimple(org.hl7.fhir.utilities.validation.ValidationOptions options, ValueSet vs) -
constructParameters
protected Parameters constructParameters(IWorkerContext.ITerminologyOperationDetails opCtxt, TerminologyClientContext tcd, ValueSet vs, boolean hierarchical) -
constructParameters
protected Parameters constructParameters(org.hl7.fhir.utilities.validation.ValidationOptions options, Coding coding) -
constructParameters
protected Parameters constructParameters(org.hl7.fhir.utilities.validation.ValidationOptions options, CodeableConcept codeableConcept) -
constructParameters
protected Parameters constructParameters(org.hl7.fhir.utilities.validation.ValidationOptions options, CodingValidationRequest codingValidationRequest, ValueSet valueSet) -
constructParameters
protected Parameters constructParameters(org.hl7.fhir.utilities.validation.ValidationOptions options, CodingValidationRequest codingValidationRequest, String vsUrl) -
validateCode
public ValidationResult validateCode(org.hl7.fhir.utilities.validation.ValidationOptions options, CodeableConcept code, ValueSet vs) Description copied from interface:IWorkerContextValidation of a code - consult the terminology infrstructure and/or service to see whether it is known. If known, return a description of it note: always return a result, with either an error or a code description corresponds to 2 terminology service calls: $validate-code and $lookup Note that this doesn't validate binding strength (e.g. is just text allowed?)- Specified by:
validateCodein interfaceIWorkerContext- Parameters:
options- - validation options (required)code- - CodeableConcept to validatevs- the applicable valueset (optional)- Returns:
-
validateOnServer
protected ValidationResult validateOnServer(TerminologyClientContext tc, ValueSet vs, Parameters pin, org.hl7.fhir.utilities.validation.ValidationOptions options) throws org.hl7.fhir.exceptions.FHIRException - Throws:
org.hl7.fhir.exceptions.FHIRException
-
validateOnServer2
protected ValidationResult validateOnServer2(TerminologyClientContext tc, ValueSet vs, Parameters pin, org.hl7.fhir.utilities.validation.ValidationOptions options, Set<String> systems) throws org.hl7.fhir.exceptions.FHIRException - Throws:
org.hl7.fhir.exceptions.FHIRException
-
addServerValidationParameters
protected void addServerValidationParameters(IWorkerContext.ITerminologyOperationDetails opCtxt, TerminologyClientContext terminologyClientContext, ValueSet vs, Parameters pin, org.hl7.fhir.utilities.validation.ValidationOptions options) -
addServerValidationParameters
protected void addServerValidationParameters(IWorkerContext.ITerminologyOperationDetails opCtxt, TerminologyClientContext terminologyClientContext, ValueSet vs, Parameters pin, org.hl7.fhir.utilities.validation.ValidationOptions options, Set<String> systems) -
addDependentCodeSystem
public boolean addDependentCodeSystem(IWorkerContext.ITerminologyOperationDetails opCtxt, TerminologyClientContext tc, Parameters pin, String sys, Resource src) -
processValidationResult
-
initTxCache
public void initTxCache(String cachePath) throws FileNotFoundException, org.hl7.fhir.exceptions.FHIRException, IOException - Throws:
FileNotFoundExceptionorg.hl7.fhir.exceptions.FHIRExceptionIOException
-
initTxCache
-
clearTSCache
- Throws:
Exception
-
isCanRunWithoutTerminology
-
setCanRunWithoutTerminology
-
setLogger
- Specified by:
setLoggerin interfaceIWorkerContext
-
getExpansionParameters
Description copied from interface:IWorkerContextSet the expansion parameters passed through the terminology server when txServer calls are made Note that the Validation Options override these when they are specified on validateCode- Specified by:
getExpansionParametersin interfaceIWorkerContext
-
setExpansionParameters
Description copied from interface:IWorkerContextGet the expansion parameters passed through the terminology server when txServer calls are made Note that the Validation Options override these when they are specified on validateCode- Specified by:
setExpansionParametersin interfaceIWorkerContext
-
isNoTerminologyServer
- Specified by:
isNoTerminologyServerin interfaceIWorkerContext
-
setNoTerminologyServer
-
getName
-
setName
-
getResourceNames
- Specified by:
getResourceNamesin interfaceIWorkerContext
-
getResourceNamesAsSet
- Specified by:
getResourceNamesAsSetin interfaceIWorkerContext
-
getResourceNamesAsSet
- Specified by:
getResourceNamesAsSetin interfaceIWorkerContext- Returns:
- a set of the resource names defined for this version
-
isAllowLoadingDuplicates
-
setAllowLoadingDuplicates
-
fetchResourceWithException
public <T extends Resource> T fetchResourceWithException(Class<T> class_, String uri) throws org.hl7.fhir.exceptions.FHIRException - Specified by:
fetchResourceWithExceptionin interfaceIWorkerContext- Throws:
org.hl7.fhir.exceptions.FHIRException
-
fetchResourceWithException
public <T extends Resource> T fetchResourceWithException(String cls, String uri) throws org.hl7.fhir.exceptions.FHIRException - Throws:
org.hl7.fhir.exceptions.FHIRException
-
fetchResourceWithException
public <T extends Resource> T fetchResourceWithException(Class<T> class_, String uri, Resource sourceForReference) throws org.hl7.fhir.exceptions.FHIRException - Specified by:
fetchResourceWithExceptionin interfaceIWorkerContext- Throws:
org.hl7.fhir.exceptions.FHIRException
-
fetchResourceWithExceptionByVersion
public <T extends Resource> T fetchResourceWithExceptionByVersion(Class<T> class_, String uri, String version, Resource sourceForReference) throws org.hl7.fhir.exceptions.FHIRException - Throws:
org.hl7.fhir.exceptions.FHIRException
-
getPackageForUrl
- Specified by:
getPackageForUrlin interfaceIWorkerContext
-
fetchResourceWithExceptionByVersion
public <T extends Resource> T fetchResourceWithExceptionByVersion(String cls, String uri, String version, CanonicalResource source) throws org.hl7.fhir.exceptions.FHIRException - Throws:
org.hl7.fhir.exceptions.FHIRException
-
fetchResourcesByType
public <T extends Resource> List<T> fetchResourcesByType(Class<T> class_, org.hl7.fhir.utilities.FhirPublication fhirVersion) Description copied from interface:IWorkerContextFetch all the resources of a particular type. if class == (null | Resource | DomainResource | CanonicalResource) return everything- Specified by:
fetchResourcesByTypein interfaceIWorkerContext- Returns:
-
fetchResourcesByType
- Specified by:
fetchResourcesByTypein interfaceIWorkerContext
-
fetchResourceById
public Resource fetchResourceById(String type, String uri, org.hl7.fhir.utilities.FhirPublication fhirVersion) - Specified by:
fetchResourceByIdin interfaceIWorkerContext
-
fetchResourceById
Description copied from interface:IWorkerContextVariation of fetchResource when you have a string type, and don't need the right class The URI can have one of 3 formats: - a full URL e.g. http://acme.org/fhir/ValueSet/[id] - a relative URL e.g. ValueSet/[id] - a logical id e.g. [id] if type == null, the URI can't be a simple logical id- Specified by:
fetchResourceByIdin interfaceIWorkerContext- Returns:
-
fetchResource
public <T extends Resource> T fetchResource(Class<T> class_, String uri, Resource sourceForReference) Description copied from interface:IWorkerContexthas the same functionality as fetchResource, but passes in information about the source of the reference (this may affect resolution of version)- Specified by:
fetchResourcein interfaceIWorkerContext- Returns:
-
fetchResource
public <T extends Resource> T fetchResource(Class<T> class_, String uri, org.hl7.fhir.utilities.FhirPublication fhirVersion) - Specified by:
fetchResourcein interfaceIWorkerContext
-
fetchResource
Description copied from interface:IWorkerContextFind an identified resource. The most common use of this is to access the the standard conformance resources that are part of the standard - structure definitions, value sets, concept maps, etc. Also, the narrative generator uses this, and may access any kind of resource The URI is called speculatively for things that might exist, so not finding a matching resource, return null, not an error The URI can have one of 3 formats: - a full URL e.g. http://acme.org/fhir/ValueSet/[id] - a relative URL e.g. ValueSet/[id] - a logical id e.g. [id] It's an error if the second form doesn't agree with class_. It's an error if class_ is null for the last form class can be Resource, DomainResource or CanonicalResource, which means resource of all kinds- Specified by:
fetchResourcein interfaceIWorkerContext- Returns:
-
fetchResource
public <T extends Resource> T fetchResource(Class<T> class_, String uri, String version, org.hl7.fhir.utilities.FhirPublication fhirVersion) - Specified by:
fetchResourcein interfaceIWorkerContext
-
fetchResource
- Specified by:
fetchResourcein interfaceIWorkerContext
-
hasResource
Description copied from interface:IWorkerContextfind whether a resource is available. Implementations of the interface can assume that if hasResource ruturns true, the resource will usually be fetched subsequently- Specified by:
hasResourcein interfaceIWorkerContext- Returns:
-
hasResource
-
hasResourceVersion
-
hasResourceVersion
-
hasResource
public <T extends Resource> boolean hasResource(Class<T> class_, String uri, org.hl7.fhir.utilities.FhirPublication fhirVersion) - Specified by:
hasResourcein interfaceIWorkerContext
-
hasResource
public <T extends Resource> boolean hasResource(String cls, String uri, org.hl7.fhir.utilities.FhirPublication fhirVersion) -
hasResourceVersion
public <T extends Resource> boolean hasResourceVersion(Class<T> class_, String uri, String version, org.hl7.fhir.utilities.FhirPublication fhirVersion) -
hasResourceVersion
public <T extends Resource> boolean hasResourceVersion(String cls, String uri, String version, org.hl7.fhir.utilities.FhirPublication fhirVersion) -
hasResource
public <T extends Resource> boolean hasResource(Class<T> class_, String uri, Resource sourceOfReference) - Specified by:
hasResourcein interfaceIWorkerContext
-
reportStatus
-
dropResource
- Throws:
org.hl7.fhir.exceptions.FHIRException
-
dropResource
-
listSupportedSystems
-
totalCount
-
listMaps
-
listStructures
-
getStructure
-
cacheVS
-
getSearchParameter
-
getLogger
- Specified by:
getLoggerin interfaceIWorkerContext
-
fetchTypeDefinition
public StructureDefinition fetchTypeDefinition(String typeName, org.hl7.fhir.utilities.FhirPublication fhirVersion) - Specified by:
fetchTypeDefinitionin interfaceIWorkerContext
-
fetchTypeDefinition
Description copied from interface:IWorkerContextThis is a short cut for fetchResource(StructureDefinition.class, ...) but it accepts a typename - that is, it resolves based on StructureDefinition.type or StructureDefinition.url. This only resolves to http://hl7.org/fhir/StructureDefinition/{typename}- Specified by:
fetchTypeDefinitionin interfaceIWorkerContext- Returns:
-
fetchTypeDefinitions
Description copied from interface:IWorkerContextThis finds all the structure definitions that have the given typeName- Specified by:
fetchTypeDefinitionsin interfaceIWorkerContext- Returns:
-
fetchTypeDefinitions
public List<StructureDefinition> fetchTypeDefinitions(String typeName, org.hl7.fhir.utilities.FhirPublication fhirVersion) - Specified by:
fetchTypeDefinitionsin interfaceIWorkerContext
-
isPrimitiveType
Description copied from interface:IWorkerContextreturn whether type is primitive type. This is called a lot, and needs a high performance implementation- Specified by:
isPrimitiveTypein interfaceIWorkerContext- Returns:
-
isDataType
Description copied from interface:IWorkerContextreturn whether type is data type. This is called a lot, and needs a high performance implementation- Specified by:
isDataTypein interfaceIWorkerContext- Returns:
-
isTlogging
-
setTlogging
-
getUcumService
Description copied from interface:IWorkerContextGet the UCUM service that provides access to units of measure reasoning services This service might not be available- Specified by:
getUcumServicein interfaceIWorkerContext- Returns:
-
setUcumService
- Specified by:
setUcumServicein interfaceIWorkerContext
-
getLinkForUrl
-
allImplementationGuides
-
getBinaryKeysAsSet
Description copied from interface:IWorkerContextReturns a set of keys that can be used to get binaries from this context. The binaries come from the loaded packages (mostly the pubpack)- Specified by:
getBinaryKeysAsSetin interfaceIWorkerContext- Returns:
- a set of binaries or null
-
hasBinaryKey
Description copied from interface:IWorkerContextReturns true if this worker context contains a binary for this key.- Specified by:
hasBinaryKeyin interfaceIWorkerContext- Returns:
- true if binary is available for this key
-
getBinaryForKey
Description copied from interface:IWorkerContextReturns the binary for the key- Specified by:
getBinaryForKeyin interfaceIWorkerContext- Returns:
-
finishLoading
-
tail
-
getClientRetryCount
- Specified by:
getClientRetryCountin interfaceIWorkerContext
-
setClientRetryCount
- Specified by:
setClientRetryCountin interfaceIWorkerContext
-
getTxClientManager
-
getCacheId
-
clock
- Specified by:
clockin interfaceIWorkerContext
-
countAllCaches
-
getCodeSystemsUsed
- Specified by:
getCodeSystemsUsedin interfaceIWorkerContext
-
getLocator
-
setLocator
-
getUserAgent
-
setUserAgent
-
getPackageTracker
- Specified by:
getPackageTrackerin interfaceIWorkerContext
-
setPackageTracker
public IWorkerContext setPackageTracker(IWorkerContextManager.IPackageLoadingTracker packageTracker) - Specified by:
setPackageTrackerin interfaceIWorkerContext
-
getProfiledElementBuilder
public PEBuilder getProfiledElementBuilder(PEBuilder.PEElementPropertiesPolicy elementProps, boolean fixedProps) - Specified by:
getProfiledElementBuilderin interfaceIWorkerContext
-
isForPublication
- Specified by:
isForPublicationin interfaceIWorkerContext
-
setForPublication
- Specified by:
setForPublicationin interfaceIWorkerContext
-
isCachingAllowed
-
setCachingAllowed
-
urlsForOid
- Specified by:
urlsForOidin interfaceIWorkerContextresourceType- - null to search on all resource types- Returns:
-
urlsForOid
-
unload
-
findTxResource
public <T extends Resource> T findTxResource(Class<T> class_, String canonical, Resource sourceOfReference) Description copied from interface:IWorkerContextthis first does a fetch resource, and if nothing is found, looks in the terminology eco-system for a matching definition for the resource usually used (and so far only tested with) ValueSet.class- Specified by:
findTxResourcein interfaceIWorkerContext- Returns:
-
findTxResource
- Specified by:
findTxResourcein interfaceIWorkerContext
-
findTxResource
- Specified by:
findTxResourcein interfaceIWorkerContext
-
fetchResourcesByUrl
Description copied from interface:IWorkerContextFetch all the resources for the given URL - all matching versions- Specified by:
fetchResourcesByUrlin interfaceIWorkerContext- Returns:
-
setLocale
- Specified by:
setLocalein interfaceIWorkerContext- Overrides:
setLocalein classorg.hl7.fhir.utilities.i18n.I18nBase
-