
Package org.hl7.fhir.r4.context
Class BaseWorkerContext
java.lang.Object
org.hl7.fhir.utilities.i18n.I18nBase
org.hl7.fhir.r4.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 ClassesNested classes/interfaces inherited from interface org.hl7.fhir.r4.context.IWorkerContext
IWorkerContext.ILoggingService, IWorkerContext.ValidationResult -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Parametersprotected Stringprotected booleanprotected Map<String, StructureMap> protected Stringprotected TerminologyCacheprotected TerminologyClientprotected HTMLClientLoggerprotected Map<String, Map<String, IWorkerContext.ValidationResult>> Fields inherited from class org.hl7.fhir.utilities.i18n.I18nBase
KEY_DELIMITER, uncontainedKeys -
Constructor Summary
ConstructorsConstructorDescriptionBaseWorkerContext(Map<String, CodeSystem> codeSystems, Map<String, ValueSet> valueSets, Map<String, ConceptMap> maps, Map<String, StructureDefinition> profiles, Map<String, ImplementationGuide> guides) -
Method Summary
Modifier and TypeMethodDescriptionvoidcache a resource for later retrieval using fetchResource.voidcacheVS(com.google.gson.JsonObject json, Map<String, IWorkerContext.ValidationResult> t) protected voidcopy(BaseWorkerContext other) doValidateCode(org.hl7.fhir.utilities.validation.ValidationOptions options, Coding code, ValueSet vs, boolean inferSystem) voiddropResource(String fhirType, String id) voidexpandVS(ElementDefinition.ElementDefinitionBindingComponent binding, boolean cacheOk, boolean heirarchical) ValueSet Expansion - see $expand, but resolves the binding firstexpandVS(ValueSet.ConceptSetComponent inc, boolean heirachical) Value set expanion inside the internal expansion engine - used for references to supported system (see "supportsSystem") for which there is no value set.ValueSet Expansion - see $expandexpandVS(ValueSet vs, boolean cacheOk, boolean heirarchical, Parameters p) fetchCodeSystem(String system) Find the code system definition for the nominated system uri. return null if there isn't one (then the tool might try supportsSystem)<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, Resource source) 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.fetchResourcesByType(Class<T> class_) <T extends Resource>
TfetchResourceWithException(Class<T> class_, String uri) fetchTypeDefinition(String typeName) findMapsForSource(String url) find concept maps for a sourceintgetLinkForUrl(String corePath, String url) Deprecated.getName()getSearchParameter(String code) getStructure(String code) getTransform(String code) org.fhir.ucum.UcumService<T extends Resource>
booleanhasResource(Class<T> class_, String uri) find whether a resource is available.voidbooleanbooleanbooleanisDataType(String type) booleanbooleanisPrimitiveType(String type) booleanlistMaps()voidreportStatus(com.google.gson.JsonObject json) protected <T extends MetadataResource>
voidseeMetadataResource(T r, Map<String, T> map, boolean addId) voidsetAllowLoadingDuplicates(boolean allowLoadingDuplicates) voidsetCanRunWithoutTerminology(boolean canRunWithoutTerminology) voidsetExpandCodesLimit(int expandCodesLimit) voidsetExpansionProfile(Parameters expParameters) voidDeprecated.voidvoidsetOverrideVersionNs(String value) voidsetTlogging(boolean tlogging) voidsetTranslator(org.hl7.fhir.utilities.TranslationServices translator) voidsetUcumService(org.fhir.ucum.UcumService ucumService) booleansupportsSystem(String system) True if the underlying terminology service provider will do expansion and code validation for the terminology.protected voidintorg.hl7.fhir.utilities.TranslationServicesvalidateCode(org.hl7.fhir.utilities.validation.ValidationOptions options, String system, String code, String display) Validation of a code - consult the terminology service to see whether it is known.validateCode(org.hl7.fhir.utilities.validation.ValidationOptions options, String system, String code, String display, ValueSet vs) Validation of a code - consult the terminology service to see whether it is known.validateCode(org.hl7.fhir.utilities.validation.ValidationOptions options, String system, String code, String display, ValueSet.ConceptSetComponent vsi) Validation of a code - consult the terminology service to see whether it is known.validateCode(org.hl7.fhir.utilities.validation.ValidationOptions options, String code, ValueSet vs) validateCode(org.hl7.fhir.utilities.validation.ValidationOptions options, CodeableConcept code, ValueSet vs) validateCode(org.hl7.fhir.utilities.validation.ValidationOptions options, Coding code, ValueSet vs) Methods inherited from class org.hl7.fhir.utilities.i18n.I18nBase
formatMessage, formatMessagePlural, getLocale, getMessages, getMessagesSourceFileName, getPluralKey, getPluralKeys, getPluralRules, getPluralSuffixes, getRootKeyFromPlural, isWarnAboutMissingMessages, logUncontainedMessage, messageKeyExistsForLocale, setLocale, 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.r4.context.IWorkerContext
allStructures, formatMessage, formatMessagePlural, generateSnapshot, getAbbreviation, getLocale, getNarrativeGenerator, getParser, getParser, getResourceNames, getTypeNames, getVersion, hasCache, newJsonParser, newValidator, newXmlParser, setLocale, setValidationMessageLanguage, typeTails
-
Field Details
-
transforms
-
validationCache
-
tsServer
-
name
-
txClient
-
txLog
-
noTerminologyServer
-
expParameters
-
txCache
-
-
Constructor Details
-
BaseWorkerContext
public BaseWorkerContext() throws FileNotFoundException, IOException, org.hl7.fhir.exceptions.FHIRException- Throws:
FileNotFoundExceptionIOExceptionorg.hl7.fhir.exceptions.FHIRException
-
BaseWorkerContext
public BaseWorkerContext(Map<String, CodeSystem> codeSystems, Map<String, throws FileNotFoundException, IOException, org.hl7.fhir.exceptions.FHIRExceptionValueSet> valueSets, Map<String, ConceptMap> maps, Map<String, StructureDefinition> profiles, Map<String, ImplementationGuide> guides) - 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- Specified by:
cacheResourcein interfaceIWorkerContext- Parameters:
r-- Throws:
org.hl7.fhir.exceptions.FHIRException
-
seeMetadataResource
protected <T extends MetadataResource> void seeMetadataResource(T r, Map<String, T> map, boolean addId) throws org.hl7.fhir.exceptions.FHIRException- Throws:
org.hl7.fhir.exceptions.FHIRException
-
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)- Specified by:
fetchCodeSystemin interfaceIWorkerContext- Parameters:
system-- Returns:
-
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- Specified by:
supportsSystemin interfaceIWorkerContext- Parameters:
system-- Returns:
- Throws:
org.hl7.fhir.exceptions.TerminologyServiceException
-
tlog
-
getExpandCodesLimit
-
setExpandCodesLimit
-
expandVS
public ValueSetExpander.ValueSetExpansionOutcome expandVS(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 ValueSetExpander.ValueSetExpansionOutcome expandVS(ValueSet.ConceptSetComponent inc, boolean heirachical) 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- Parameters:
inc-- Returns:
- Throws:
org.hl7.fhir.exceptions.TerminologyServiceException
-
expandVS
public ValueSetExpander.ValueSetExpansionOutcome expandVS(ValueSet vs, boolean cacheOk, boolean heirarchical) Description copied from interface:IWorkerContextValueSet Expansion - see $expand- Specified by:
expandVSin interfaceIWorkerContext- Parameters:
vs-- Returns:
-
expandVS
public ValueSetExpander.ValueSetExpansionOutcome expandVS(ValueSet vs, boolean cacheOk, boolean heirarchical, Parameters p) -
validateCode
public IWorkerContext.ValidationResult validateCode(org.hl7.fhir.utilities.validation.ValidationOptions options, String system, String code, String display) Description copied from interface:IWorkerContextValidation of a code - consult the terminology 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:
system-code-display-- Returns:
-
validateCode
public IWorkerContext.ValidationResult validateCode(org.hl7.fhir.utilities.validation.ValidationOptions options, String system, String code, String display, ValueSet vs) Description copied from interface:IWorkerContextValidation of a code - consult the terminology service to see whether it is known. If known, return a description of it Also, check whether it's in the provided value set note: always return a result, with either an error or a code description, or both (e.g. known code, but not in the value set) corresponds to 2 terminology service calls: $validate-code and $lookup- Specified by:
validateCodein interfaceIWorkerContext- Parameters:
system-code-display-- Returns:
-
validateCode
public IWorkerContext.ValidationResult validateCode(org.hl7.fhir.utilities.validation.ValidationOptions options, String code, ValueSet vs) - Specified by:
validateCodein interfaceIWorkerContext
-
validateCode
public IWorkerContext.ValidationResult validateCode(org.hl7.fhir.utilities.validation.ValidationOptions options, String system, String code, String display, ValueSet.ConceptSetComponent vsi) Description copied from interface:IWorkerContextValidation of a code - consult the terminology service to see whether it is known. If known, return a description of it Also, check whether it's in the provided value set fragment (for supported systems with no value set definition) note: always return a result, with either an error or a code description, or both (e.g. known code, but not in the value set) corresponds to 2 terminology service calls: $validate-code and $lookup- Specified by:
validateCodein interfaceIWorkerContext- Parameters:
system-code-display-- Returns:
-
validateCode
public IWorkerContext.ValidationResult validateCode(org.hl7.fhir.utilities.validation.ValidationOptions options, Coding code, ValueSet vs) - Specified by:
validateCodein interfaceIWorkerContext
-
doValidateCode
public IWorkerContext.ValidationResult doValidateCode(org.hl7.fhir.utilities.validation.ValidationOptions options, Coding code, ValueSet vs, boolean inferSystem) -
validateCode
public IWorkerContext.ValidationResult validateCode(org.hl7.fhir.utilities.validation.ValidationOptions options, CodeableConcept code, ValueSet vs) - Specified by:
validateCodein interfaceIWorkerContext
-
initTS
- Throws:
Exception
-
findMapsForSource
Description copied from interface:IWorkerContextfind concept maps for a source- Specified by:
findMapsForSourcein interfaceIWorkerContext- Parameters:
url-- Returns:
- Throws:
org.hl7.fhir.exceptions.FHIRException
-
isCanRunWithoutTerminology
-
setCanRunWithoutTerminology
-
setLogger
Deprecated.- Specified by:
setLoggerin interfaceIWorkerContext
-
getExpansionParameters
- Specified by:
getExpansionParametersin interfaceIWorkerContext
-
setExpansionProfile
- Specified by:
setExpansionProfilein interfaceIWorkerContext
-
isNoTerminologyServer
- Specified by:
isNoTerminologyServerin interfaceIWorkerContext
-
getName
-
setName
-
getResourceNamesAsSet
- Specified by:
getResourceNamesAsSetin interfaceIWorkerContext
-
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
-
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- Parameters:
type-uri-- Returns:
-
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 resouce, 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- Specified by:
fetchResourcein interfaceIWorkerContext- Returns:
-
fetchResource
- Specified by:
fetchResourcein interfaceIWorkerContext
-
fetchTypeDefinitions
- Specified by:
fetchTypeDefinitionsin 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- Parameters:
class_-uri-- Returns:
-
translator
- Specified by:
translatorin interfaceIWorkerContext
-
setTranslator
-
reportStatus
-
dropResource
- Throws:
org.hl7.fhir.exceptions.FHIRException
-
dropResource
-
allConformanceResources
- Specified by:
allConformanceResourcesin interfaceIWorkerContext
-
listSupportedSystems
-
totalCount
-
listMaps
-
listTransforms
- Specified by:
listTransformsin interfaceIWorkerContext
-
getTransform
- Specified by:
getTransformin interfaceIWorkerContext
-
listStructures
-
getStructure
-
oid2Uri
- Specified by:
oid2Uriin interfaceIWorkerContext
-
cacheVS
-
getSearchParameter
-
getOverrideVersionNs
- Specified by:
getOverrideVersionNsin interfaceIWorkerContext
-
setOverrideVersionNs
- Specified by:
setOverrideVersionNsin interfaceIWorkerContext
-
getLogger
Deprecated.- Specified by:
getLoggerin interfaceIWorkerContext
-
fetchTypeDefinition
- Specified by:
fetchTypeDefinitionin interfaceIWorkerContext
-
isPrimitiveType
- Specified by:
isPrimitiveTypein interfaceIWorkerContext
-
isDataType
-
isTlogging
-
setTlogging
-
getUcumService
- Specified by:
getUcumServicein interfaceIWorkerContext
-
setUcumService
- Specified by:
setUcumServicein interfaceIWorkerContext
-
getStructures
- Specified by:
getStructuresin interfaceIWorkerContext
-
getLinkForUrl
- Specified by:
getLinkForUrlin interfaceIWorkerContext
-
fetchResourcesByType
- Specified by:
fetchResourcesByTypein interfaceIWorkerContext
-