Package org.hl7.fhir.dstu2.utils
Class BaseWorkerContext
- java.lang.Object
-
- org.hl7.fhir.utilities.i18n.I18nBase
-
- org.hl7.fhir.dstu2.utils.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 classes/interfaces inherited from interface org.hl7.fhir.dstu2.utils.IWorkerContext
IWorkerContext.ValidationResult
-
-
Field Summary
Fields Modifier and Type Field Description protected booleancacheValidationprotected Map<String,ValueSet>codeSystemsprotected ValueSetExpanderFactoryexpansionCacheprotected Map<String,ConceptMap>mapsprotected FHIRToolingClienttxServerprotected Map<String,Map<String,IWorkerContext.ValidationResult>>validationCacheprotected Map<String,ValueSet>valueSets
-
Constructor Summary
Constructors Constructor Description BaseWorkerContext()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ValueSet.ValueSetExpansionComponentexpandVS(ValueSet.ConceptSetComponent inc)Value set expanion inside the internal expansion engine - used for references to supported system (see "supportsSystem") for which there is no value set.ValueSetExpander.ValueSetExpansionOutcomeexpandVS(ValueSet vs, boolean cacheOk)ValueSet Expansion - see $expandValueSetfetchCodeSystem(String system)Find a value set for the nominated system uri.StructureDefinitionfetchTypeDefinition(String typeName)List<ConceptMap>findMapsForSource(String url)find concept maps for a sourcebooleansupportsSystem(String system)True if the underlying terminology service provider will do expansion and code validation for the terminology.IWorkerContext.ValidationResultvalidateCode(String system, String code, String display)Validation of a code - consult the terminology service to see whether it is known.IWorkerContext.ValidationResultvalidateCode(String system, String code, String display, ValueSet vs)Validation of a code - consult the terminology service to see whether it is known.IWorkerContext.ValidationResultvalidateCode(String system, String code, String display, ValueSet.ConceptSetComponent vsi)Validation of a code - consult the terminology service to see whether it is known.IWorkerContext.ValidationResultvalidateCode(CodeableConcept code, ValueSet vs)IWorkerContext.ValidationResultvalidateCode(Coding code, ValueSet vs)-
Methods inherited from class org.hl7.fhir.utilities.i18n.I18nBase
formatMessage, getLocale, isWarnAboutMissingMessages, setLocale, setValidationMessageLanguage, setWarnAboutMissingMessages
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.hl7.fhir.dstu2.utils.IWorkerContext
allStructures, fetchResource, formatMessage, getAbbreviation, getLocale, getNarrativeGenerator, getParser, getParser, getResourceNames, hasResource, newJsonParser, newValidator, newXmlParser, setLocale, setValidationMessageLanguage
-
-
-
-
Field Detail
-
codeSystems
protected Map<String,ValueSet> codeSystems
-
maps
protected Map<String,ConceptMap> maps
-
expansionCache
protected ValueSetExpanderFactory expansionCache
-
cacheValidation
protected boolean cacheValidation
-
validationCache
protected Map<String,Map<String,IWorkerContext.ValidationResult>> validationCache
-
txServer
protected FHIRToolingClient txServer
-
-
Constructor Detail
-
BaseWorkerContext
public BaseWorkerContext()
-
-
Method Detail
-
fetchCodeSystem
public ValueSet fetchCodeSystem(String system)
Description copied from interface:IWorkerContextFind a value set for the nominated system uri. return null if there isn't one (then the tool might try supportsSystem)- Specified by:
fetchCodeSystemin interfaceIWorkerContext- Returns:
-
supportsSystem
public boolean supportsSystem(String system)
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/conformance-supported-system in the Conformance resource- Specified by:
supportsSystemin interfaceIWorkerContext- Returns:
-
expandVS
public ValueSetExpander.ValueSetExpansionOutcome expandVS(ValueSet vs, boolean cacheOk)
Description copied from interface:IWorkerContextValueSet Expansion - see $expand- Specified by:
expandVSin interfaceIWorkerContext- Returns:
-
expandVS
public ValueSet.ValueSetExpansionComponent expandVS(ValueSet.ConceptSetComponent inc)
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:
-
validateCode
public IWorkerContext.ValidationResult validateCode(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- Returns:
-
validateCode
public IWorkerContext.ValidationResult validateCode(Coding code, ValueSet vs)
- Specified by:
validateCodein interfaceIWorkerContext
-
validateCode
public IWorkerContext.ValidationResult validateCode(CodeableConcept code, ValueSet vs)
- Specified by:
validateCodein interfaceIWorkerContext
-
validateCode
public IWorkerContext.ValidationResult validateCode(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- Returns:
-
validateCode
public IWorkerContext.ValidationResult validateCode(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- Returns:
-
findMapsForSource
public List<ConceptMap> findMapsForSource(String url)
Description copied from interface:IWorkerContextfind concept maps for a source- Specified by:
findMapsForSourcein interfaceIWorkerContext- Returns:
-
fetchTypeDefinition
public StructureDefinition fetchTypeDefinition(String typeName)
- Specified by:
fetchTypeDefinitionin interfaceIWorkerContext
-
-