Package org.hl7.fhir.dstu3.context
Class BaseWorkerContext
- java.lang.Object
-
- org.hl7.fhir.utilities.i18n.I18nBase
-
- org.hl7.fhir.dstu3.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 classes/interfaces inherited from interface org.hl7.fhir.dstu3.context.IWorkerContext
IWorkerContext.ILoggingService, IWorkerContext.ValidationResult
-
-
Field Summary
-
Constructor Summary
Constructors Constructor Description BaseWorkerContext()
-
Method Summary
-
Methods inherited from class org.hl7.fhir.utilities.i18n.I18nBase
formatMessage, formatMessagePlural, getLocale, getPluralKey, isWarnAboutMissingMessages, setLocale, setPluralRules, 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.dstu3.context.IWorkerContext
allConformanceResources, allStructures, fetchResource, fetchResourceWithException, formatMessage, getAbbreviation, getLocale, getNarrativeGenerator, getParser, getParser, getResourceNames, getTypeNames, getVersion, hasCache, hasResource, newJsonParser, newValidator, newXmlParser, oid2Uri, setLocale, setValidationMessageLanguage, typeTails
-
-
-
-
Field Detail
-
codeSystems
protected Map<String,CodeSystem> codeSystems
-
nonSupportedCodeSystems
protected Set<String> nonSupportedCodeSystems
-
maps
protected Map<String,ConceptMap> maps
-
transforms
protected Map<String,StructureMap> transforms
-
dataElements
protected Map<String,DataElement> dataElements
-
profiles
protected Map<String,StructureDefinition> profiles
-
searchParameters
protected Map<String,SearchParameter> searchParameters
-
extensionDefinitions
protected Map<String,StructureDefinition> extensionDefinitions
-
questionnaires
protected Map<String,Questionnaire> questionnaires
-
operations
protected Map<String,OperationDefinition> operations
-
expansionCache
protected ValueSetExpanderFactory expansionCache
-
cacheValidation
protected boolean cacheValidation
-
validationCache
protected Map<String,Map<String,IWorkerContext.ValidationResult>> validationCache
-
validationCachePath
protected String validationCachePath
-
txServer
protected FHIRToolingClient txServer
-
allowLoadingDuplicates
protected boolean allowLoadingDuplicates
-
noTerminologyServer
protected boolean noTerminologyServer
-
logger
protected IWorkerContext.ILoggingService logger
-
expProfile
protected ExpansionProfile expProfile
-
-
Constructor Detail
-
BaseWorkerContext
public BaseWorkerContext()
-
-
Method Detail
-
getCodeSystems
public Map<String,CodeSystem> getCodeSystems()
-
getDataElements
public Map<String,DataElement> getDataElements()
-
getValueSets
public Map<String,ValueSet> getValueSets()
-
getMaps
public Map<String,ConceptMap> getMaps()
-
getProfiles
public Map<String,StructureDefinition> getProfiles()
-
getExtensionDefinitions
public Map<String,StructureDefinition> getExtensionDefinitions()
-
getQuestionnaires
public Map<String,Questionnaire> getQuestionnaires()
-
getOperations
public Map<String,OperationDefinition> getOperations()
-
seeExtensionDefinition
public void seeExtensionDefinition(String url, StructureDefinition ed) throws Exception
- Throws:
Exception
-
dropExtensionDefinition
public void dropExtensionDefinition(String id)
-
seeQuestionnaire
public void seeQuestionnaire(String url, Questionnaire theQuestionnaire) throws Exception
- Throws:
Exception
-
seeOperation
public void seeOperation(OperationDefinition opd) throws Exception
- Throws:
Exception
-
seeValueSet
public void seeValueSet(String url, ValueSet vs) throws Exception
- Throws:
Exception
-
dropValueSet
public void dropValueSet(String id)
-
seeCodeSystem
public void seeCodeSystem(String url, CodeSystem cs) throws org.hl7.fhir.exceptions.FHIRException
- Throws:
org.hl7.fhir.exceptions.FHIRException
-
dropCodeSystem
public void dropCodeSystem(String id)
-
seeProfile
public void seeProfile(String url, StructureDefinition p) throws Exception
- Throws:
Exception
-
dropProfile
public void dropProfile(String id)
-
fetchCodeSystem
public CodeSystem fetchCodeSystem(String system)
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- 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- 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- Returns:
-
expandOnServer
public ValueSetExpander.ValueSetExpansionOutcome expandOnServer(ValueSet vs, String fn) throws Exception
- Throws:
Exception
-
expandVS
public ValueSet.ValueSetExpansionComponent 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- Returns:
- Throws:
org.hl7.fhir.exceptions.TerminologyServiceException
-
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:
-
loadValidationCache
protected void loadValidationCache() throws com.google.gson.JsonSyntaxException, Exception
- Throws:
com.google.gson.JsonSyntaxExceptionException
-
findMapsForSource
public List<ConceptMap> findMapsForSource(String url)
Description copied from interface:IWorkerContextfind concept maps for a source- Specified by:
findMapsForSourcein interfaceIWorkerContext- Returns:
-
getNonSupportedCodeSystems
public Set<String> getNonSupportedCodeSystems()
-
isCanRunWithoutTerminology
public boolean isCanRunWithoutTerminology()
-
setCanRunWithoutTerminology
public void setCanRunWithoutTerminology(boolean canRunWithoutTerminology)
-
getExpandCodesLimit
public int getExpandCodesLimit()
-
setExpandCodesLimit
public void setExpandCodesLimit(int expandCodesLimit)
-
setLogger
public void setLogger(IWorkerContext.ILoggingService logger)
- Specified by:
setLoggerin interfaceIWorkerContext
-
getExpansionProfile
public ExpansionProfile getExpansionProfile()
- Specified by:
getExpansionProfilein interfaceIWorkerContext
-
setExpansionProfile
public void setExpansionProfile(ExpansionProfile expProfile)
- Specified by:
setExpansionProfilein interfaceIWorkerContext
-
isNoTerminologyServer
public boolean isNoTerminologyServer()
- Specified by:
isNoTerminologyServerin interfaceIWorkerContext
-
getResourceNamesAsSet
public Set<String> getResourceNamesAsSet()
- Specified by:
getResourceNamesAsSetin interfaceIWorkerContext
-
reportStatus
public void reportStatus(com.google.gson.JsonObject json)
-
cacheResource
public void cacheResource(Resource r) throws Exception
- Throws:
Exception
-
dropResource
public void dropResource(String type, String id) throws org.hl7.fhir.exceptions.FHIRException
- Throws:
org.hl7.fhir.exceptions.FHIRException
-
isAllowLoadingDuplicates
public boolean isAllowLoadingDuplicates()
-
setAllowLoadingDuplicates
public void setAllowLoadingDuplicates(boolean allowLoadingDuplicates)
-
fetchTypeDefinition
public StructureDefinition fetchTypeDefinition(String typeName)
- Specified by:
fetchTypeDefinitionin interfaceIWorkerContext
-
-