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 Classes Modifier and Type Class Description classBaseWorkerContext.MetadataResourceVersionComparator<T extends CanonicalResource>classBaseWorkerContext.NullTranslatorclassBaseWorkerContext.ResourceProxy-
Nested classes/interfaces inherited from interface org.hl7.fhir.r5.context.IWorkerContext
IWorkerContext.CodingValidationRequest, IWorkerContext.ICanonicalResourceLocator, IWorkerContext.IContextResourceLoader, IWorkerContext.ILoggingService, IWorkerContext.PackageDetails, IWorkerContext.PackageVersion, IWorkerContext.ValidationResult
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,byte[]>binariesprotected org.hl7.fhir.utilities.TimeTrackerclockprotected ParametersexpParametersprotected IWorkerContext.ILoggingServiceloggerprotected Stringnameprotected booleannoTerminologyServerprotected Map<String,String>oidCacheprotected CanonicalResourceManager<StructureMap>transformsprotected StringtsServerprotected TerminologyCachetxCacheprotected TerminologyClienttxClientprotected org.hl7.fhir.utilities.ToolingClientLoggertxLogprotected StringuserAgentprotected Map<String,Map<String,IWorkerContext.ValidationResult>>validationCacheprotected Stringversion
-
Constructor Summary
Constructors Constructor Description BaseWorkerContext()BaseWorkerContext(Locale locale)BaseWorkerContext(CanonicalResourceManager<CodeSystem> codeSystems, CanonicalResourceManager<ValueSet> valueSets, CanonicalResourceManager<ConceptMap> maps, CanonicalResourceManager<StructureDefinition> profiles, CanonicalResourceManager<ImplementationGuide> guides)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<CanonicalResource>allConformanceResources()List<ImplementationGuide>allImplementationGuides()voidcacheResource(Resource r)cache a resource for later retrieval using fetchResource.voidcacheResourceFromPackage(Resource r, IWorkerContext.PackageVersion packageInfo)cache a resource for later retrieval using fetchResource.voidcacheVS(com.google.gson.JsonObject json, Map<String,IWorkerContext.ValidationResult> t)voidclearTS()voidclearTSCache(String url)org.hl7.fhir.utilities.TimeTrackerclock()protected voidcopy(BaseWorkerContext other)intcountAllCaches()voiddropResource(String fhirType, String id)voiddropResource(Resource r)ValueSetExpander.ValueSetExpansionOutcomeexpandVS(ElementDefinition.ElementDefinitionBindingComponent binding, boolean cacheOk, boolean heirarchical)ValueSet Expansion - see $expand, but resolves the binding firstValueSetExpander.ValueSetExpansionOutcomeexpandVS(ValueSet.ConceptSetComponent inc, boolean hierarchical)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, boolean heirarchical)ValueSet Expansion - see $expandValueSetExpander.ValueSetExpansionOutcomeexpandVS(ValueSet vs, boolean cacheOk, boolean heirarchical, boolean incompleteOk)ValueSet Expansion - see $expandValueSetExpander.ValueSetExpansionOutcomeexpandVS(ValueSet vs, boolean cacheOk, boolean heirarchical, boolean incompleteOk, Parameters p)CodeSystemfetchCodeSystem(String system)Find the code system definition for the nominated system uri.CodeSystemfetchCodeSystem(String system, String version)<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, CanonicalResource source)has the same functionality as fetchResource, but passes in information about the source of the reference (this may affect resolution of version)ResourcefetchResourceById(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.<T extends Resource>
TfetchResourceWithException(Class<T> class_, String uri)<T extends Resource>
TfetchResourceWithException(Class<T> class_, String uri, String version, CanonicalResource source)<T extends Resource>
TfetchResourceWithException(Class<T> class_, String uri, CanonicalResource source)<T extends Resource>
TfetchResourceWithException(String cls, String uri)<T extends Resource>
TfetchResourceWithException(String cls, String uri, CanonicalResource source)StructureDefinitionfetchTypeDefinition(String typeName)List<ConceptMap>findMapsForSource(String url)find concept maps for a sourcevoidfinishLoading()voidfixOldSD(StructureDefinition sd)Map<String,byte[]>getBinaries()StringgetCacheId()intgetClientRetryCount()Set<String>getCodeSystemsUsed()intgetExpandCodesLimit()ParametersgetExpansionParameters()Set 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 validateCodeStringgetLinkForUrl(String corePath, String url)IWorkerContext.ICanonicalResourceLocatorgetLocator()IWorkerContext.ILoggingServicegetLogger()StringgetName()StringgetOverrideVersionNs()IWorkerContext.PackageVersiongetPackageForUrl(String uri)Set<String>getResourceNamesAsSet()SearchParametergetSearchParameter(String code)StringgetSpecUrl()return the link to the base of the specification for the loaded version e.g.StructureDefinitiongetStructure(String code)List<StructureDefinition>getStructures()StructureMapgetTransform(String code)StringgetTxCache()TerminologyCapabilitiesgetTxCaps()TerminologyClientgetTxClient()org.fhir.ucum.UcumServicegetUcumService()StringgetUserAgent()<T extends Resource>
booleanhasResource(Class<T> class_, String uri)find whether a resource is available.<T extends Resource>
booleanhasResource(String cls, String uri)voidinitTS(String cachePath)booleanisAllowLoadingDuplicates()booleanisCanRunWithoutTerminology()booleanisNoTerminologyServer()booleanisTlogging()List<ConceptMap>listMaps()List<StructureDefinition>listStructures()StringlistSupportedSystems()List<StructureMap>listTransforms()Stringoid2Uri(String oid)translate an OID to a URI (look through known NamingSystems)IWorkerContext.ValidationResultprocessValidationResult(Parameters pOut)voidregisterResourceFromPackage(CanonicalResourceManager.CanonicalResourceProxy r, IWorkerContext.PackageVersion 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)voidsetCacheId(String cacheId)voidsetCanRunWithoutTerminology(boolean canRunWithoutTerminology)IWorkerContextsetClientRetryCount(int value)voidsetExpandCodesLimit(int expandCodesLimit)voidsetExpansionProfile(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 validateCodevoidsetLocator(IWorkerContext.ICanonicalResourceLocator locator)voidsetLogger(IWorkerContext.ILoggingService logger)voidsetName(String name)voidsetNoTerminologyServer(boolean noTerminologyServer)voidsetOverrideVersionNs(String value)voidsetTlogging(boolean tlogging)voidsetTranslator(org.hl7.fhir.utilities.TranslationServices translator)voidsetTxCaps(TerminologyCapabilities txCaps)voidsetUcumService(org.fhir.ucum.UcumService ucumService)voidsetUserAgent(String userAgent)booleansupportsSystem(String system)True if the underlying terminology service provider will do expansion and code validation for the terminology.protected Stringtail(String url)protected voidtlog(String msg)inttotalCount()org.hl7.fhir.utilities.TranslationServicestranslator()IWorkerContext.ValidationResultvalidateCode(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.IWorkerContext.ValidationResultvalidateCode(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.IWorkerContext.ValidationResultvalidateCode(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.IWorkerContext.ValidationResultvalidateCode(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.IWorkerContext.ValidationResultvalidateCode(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.IWorkerContext.ValidationResultvalidateCode(org.hl7.fhir.utilities.validation.ValidationOptions options, Coding code, ValueSet vs, ValidationContextCarrier ctxt)voidvalidateCodeBatch(org.hl7.fhir.utilities.validation.ValidationOptions options, List<? extends IWorkerContext.CodingValidationRequest> codes, 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.r5.context.IWorkerContext
allStructures, cachePackage, fetchRawProfile, formatMessage, generateSnapshot, generateSnapshot, getAbbreviation, getLocale, getPackage, getParser, getParser, getResourceNames, getTypeNames, getVersion, hasCache, hasPackage, hasPackage, loadFromPackage, loadFromPackage, loadFromPackageAndDependencies, newJsonParser, newValidator, newXmlParser, setLocale, setValidationMessageLanguage
-
-
-
-
Field Detail
-
transforms
protected CanonicalResourceManager<StructureMap> transforms
-
validationCache
protected Map<String,Map<String,IWorkerContext.ValidationResult>> validationCache
-
txClient
protected TerminologyClient txClient
-
txLog
protected org.hl7.fhir.utilities.ToolingClientLogger txLog
-
noTerminologyServer
protected boolean noTerminologyServer
-
logger
protected IWorkerContext.ILoggingService logger
-
expParameters
protected Parameters expParameters
-
txCache
protected TerminologyCache txCache
-
clock
protected org.hl7.fhir.utilities.TimeTracker clock
-
-
Constructor Detail
-
BaseWorkerContext
public BaseWorkerContext() throws FileNotFoundException, IOException, org.hl7.fhir.exceptions.FHIRException
- Throws:
FileNotFoundExceptionIOExceptionorg.hl7.fhir.exceptions.FHIRException
-
BaseWorkerContext
public BaseWorkerContext(Locale locale) throws FileNotFoundException, IOException, org.hl7.fhir.exceptions.FHIRException
- Throws:
FileNotFoundExceptionIOExceptionorg.hl7.fhir.exceptions.FHIRException
-
BaseWorkerContext
public 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 Detail
-
copy
protected void copy(BaseWorkerContext other)
-
cacheResource
public void cacheResource(Resource r) throws org.hl7.fhir.exceptions.FHIRException
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, IWorkerContext.PackageVersion packageInfo) throws org.hl7.fhir.exceptions.FHIRException
- Throws:
org.hl7.fhir.exceptions.FHIRException
-
cacheResourceFromPackage
public void cacheResourceFromPackage(Resource r, IWorkerContext.PackageVersion 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
-
fixOldSD
public void fixOldSD(StructureDefinition sd)
-
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)
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:
-
fetchCodeSystem
public CodeSystem fetchCodeSystem(String system, String version)
- Specified by:
fetchCodeSystemin interfaceIWorkerContext
-
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
-
getExpandCodesLimit
public int getExpandCodesLimit()
-
setExpandCodesLimit
public void setExpandCodesLimit(int expandCodesLimit)
-
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 hierarchical) 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
public ValueSetExpander.ValueSetExpansionOutcome expandVS(ValueSet vs, boolean cacheOk, boolean heirarchical)
Description copied from interface:IWorkerContextValueSet Expansion - see $expand- Specified by:
expandVSin interfaceIWorkerContext- Returns:
-
expandVS
public ValueSetExpander.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 ValueSetExpander.ValueSetExpansionOutcome expandVS(ValueSet vs, boolean cacheOk, boolean heirarchical, boolean incompleteOk, Parameters p)
-
validateCode
public IWorkerContext.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 IWorkerContext.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 IWorkerContext.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 IWorkerContext.CodingValidationRequest> codes, ValueSet vs)
- Specified by:
validateCodeBatchin interfaceIWorkerContext
-
validateCode
public IWorkerContext.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 IWorkerContext.ValidationResult validateCode(org.hl7.fhir.utilities.validation.ValidationOptions options, Coding code, ValueSet vs, ValidationContextCarrier ctxt)
- Specified by:
validateCodein interfaceIWorkerContext
-
validateCode
public IWorkerContext.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:
-
processValidationResult
public IWorkerContext.ValidationResult processValidationResult(Parameters pOut)
-
clearTSCache
public void clearTSCache(String url) throws Exception
- Throws:
Exception
-
clearTS
public void clearTS()
-
findMapsForSource
public List<ConceptMap> findMapsForSource(String url) throws org.hl7.fhir.exceptions.FHIRException
Description copied from interface:IWorkerContextfind concept maps for a source- Specified by:
findMapsForSourcein interfaceIWorkerContext- Returns:
- Throws:
org.hl7.fhir.exceptions.FHIRException
-
isCanRunWithoutTerminology
public boolean isCanRunWithoutTerminology()
-
setCanRunWithoutTerminology
public void setCanRunWithoutTerminology(boolean canRunWithoutTerminology)
-
setLogger
public void setLogger(IWorkerContext.ILoggingService logger)
- Specified by:
setLoggerin interfaceIWorkerContext
-
getExpansionParameters
public Parameters 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
-
setExpansionProfile
public void setExpansionProfile(Parameters expParameters)
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:
setExpansionProfilein interfaceIWorkerContext
-
isNoTerminologyServer
public boolean isNoTerminologyServer()
- Specified by:
isNoTerminologyServerin interfaceIWorkerContext
-
setNoTerminologyServer
public void setNoTerminologyServer(boolean noTerminologyServer)
-
getResourceNamesAsSet
public Set<String> getResourceNamesAsSet()
- Specified by:
getResourceNamesAsSetin interfaceIWorkerContext- Returns:
- a set of the resource names defined for this version
-
isAllowLoadingDuplicates
public boolean isAllowLoadingDuplicates()
-
setAllowLoadingDuplicates
public void setAllowLoadingDuplicates(boolean allowLoadingDuplicates)
-
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, CanonicalResource source) throws org.hl7.fhir.exceptions.FHIRException
- Throws:
org.hl7.fhir.exceptions.FHIRException
-
fetchResourceWithException
public <T extends Resource> T fetchResourceWithException(Class<T> class_, String uri, String version, CanonicalResource source) throws org.hl7.fhir.exceptions.FHIRException
- Throws:
org.hl7.fhir.exceptions.FHIRException
-
getPackageForUrl
public IWorkerContext.PackageVersion getPackageForUrl(String uri)
- Specified by:
getPackageForUrlin interfaceIWorkerContext
-
fetchResourceWithException
public <T extends Resource> T fetchResourceWithException(String cls, String uri, CanonicalResource source) throws org.hl7.fhir.exceptions.FHIRException
- Throws:
org.hl7.fhir.exceptions.FHIRException
-
fetchResourceById
public Resource fetchResourceById(String type, String uri)
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, CanonicalResource source)
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)
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
public <T extends Resource> T fetchResource(Class<T> class_, String uri, String version)
- Specified by:
fetchResourcein interfaceIWorkerContext
-
hasResource
public <T extends Resource> boolean hasResource(Class<T> class_, String uri)
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
public <T extends Resource> boolean hasResource(String cls, String uri)
-
translator
public org.hl7.fhir.utilities.TranslationServices translator()
- Specified by:
translatorin interfaceIWorkerContext
-
setTranslator
public void setTranslator(org.hl7.fhir.utilities.TranslationServices translator)
-
reportStatus
public void reportStatus(com.google.gson.JsonObject json)
-
dropResource
public void dropResource(Resource r) throws org.hl7.fhir.exceptions.FHIRException
- Throws:
org.hl7.fhir.exceptions.FHIRException
-
dropResource
public void dropResource(String fhirType, String id)
-
allConformanceResources
public List<CanonicalResource> allConformanceResources()
- Specified by:
allConformanceResourcesin interfaceIWorkerContext- Returns:
- a list of all conformance resources
-
listSupportedSystems
public String listSupportedSystems()
-
totalCount
public int totalCount()
-
listMaps
public List<ConceptMap> listMaps()
-
listTransforms
public List<StructureMap> listTransforms()
- Specified by:
listTransformsin interfaceIWorkerContext
-
getTransform
public StructureMap getTransform(String code)
- Specified by:
getTransformin interfaceIWorkerContext
-
listStructures
public List<StructureDefinition> listStructures()
-
getStructure
public StructureDefinition getStructure(String code)
-
oid2Uri
public String oid2Uri(String oid)
Description copied from interface:IWorkerContexttranslate an OID to a URI (look through known NamingSystems)- Specified by:
oid2Uriin interfaceIWorkerContext- Returns:
-
cacheVS
public void cacheVS(com.google.gson.JsonObject json, Map<String,IWorkerContext.ValidationResult> t)
-
getSearchParameter
public SearchParameter getSearchParameter(String code)
-
getOverrideVersionNs
public String getOverrideVersionNs()
- Specified by:
getOverrideVersionNsin interfaceIWorkerContext
-
setOverrideVersionNs
public void setOverrideVersionNs(String value)
- Specified by:
setOverrideVersionNsin interfaceIWorkerContext
-
getLogger
public IWorkerContext.ILoggingService getLogger()
- Specified by:
getLoggerin interfaceIWorkerContext
-
fetchTypeDefinition
public StructureDefinition fetchTypeDefinition(String typeName)
- Specified by:
fetchTypeDefinitionin interfaceIWorkerContext
-
isTlogging
public boolean isTlogging()
-
setTlogging
public void setTlogging(boolean tlogging)
-
getUcumService
public org.fhir.ucum.UcumService getUcumService()
- Specified by:
getUcumServicein interfaceIWorkerContext
-
setUcumService
public void setUcumService(org.fhir.ucum.UcumService ucumService)
- Specified by:
setUcumServicein interfaceIWorkerContext
-
getStructures
public List<StructureDefinition> getStructures()
- Specified by:
getStructuresin interfaceIWorkerContext- Returns:
- a list of all structure definitions, without trying to generate snapshots
-
getLinkForUrl
public String getLinkForUrl(String corePath, String url)
- Specified by:
getLinkForUrlin interfaceIWorkerContext
-
allImplementationGuides
public List<ImplementationGuide> allImplementationGuides()
-
getBinaries
public Map<String,byte[]> getBinaries()
- Specified by:
getBinariesin interfaceIWorkerContext
-
finishLoading
public void finishLoading()
-
getClientRetryCount
public int getClientRetryCount()
- Specified by:
getClientRetryCountin interfaceIWorkerContext
-
setClientRetryCount
public IWorkerContext setClientRetryCount(int value)
- Specified by:
setClientRetryCountin interfaceIWorkerContext
-
getTxCache
public String getTxCache()
-
getTxClient
public TerminologyClient getTxClient()
-
getCacheId
public String getCacheId()
-
setCacheId
public void setCacheId(String cacheId)
-
getTxCaps
public TerminologyCapabilities getTxCaps()
-
setTxCaps
public void setTxCaps(TerminologyCapabilities txCaps)
-
clock
public org.hl7.fhir.utilities.TimeTracker clock()
- Specified by:
clockin interfaceIWorkerContext
-
countAllCaches
public int countAllCaches()
-
getCodeSystemsUsed
public Set<String> getCodeSystemsUsed()
- Specified by:
getCodeSystemsUsedin interfaceIWorkerContext
-
getSpecUrl
public String getSpecUrl()
Description copied from interface:IWorkerContextreturn the link to the base of the specification for the loaded version e.g. http://hl7.org/fhir/R4- Specified by:
getSpecUrlin interfaceIWorkerContext
-
getLocator
public IWorkerContext.ICanonicalResourceLocator getLocator()
-
setLocator
public void setLocator(IWorkerContext.ICanonicalResourceLocator locator)
-
getUserAgent
public String getUserAgent()
-
setUserAgent
public void setUserAgent(String userAgent)
-
-