
Package org.hl7.fhir.r4.context
Interface IWorkerContext
- All Known Implementing Classes:
- BaseWorkerContext,- HapiWorkerContext,- SimpleWorkerContext
public interface IWorkerContext
This is the standard interface used for access to underlying FHIR services
 through the tools and utilities provided by the reference implementation.
 
 The functionality it provides is - get access to parsers, validators,
 narrative builders etc (you can't create these directly because they need
 access to the right context for their information)
 
 - find resources that the tools need to carry out their tasks
 
 - provide access to terminology services they need. (typically, these
 terminology service requests are just passed through to the local
 implementation's terminology service)
- Author:
- Grahame
- 
Nested Class SummaryNested ClassesModifier and TypeInterfaceDescriptionstatic interfacestatic class
- 
Method SummaryModifier and TypeMethodDescriptionvoidcacheResource(Resource res) cache a resource for later retrieval using fetchResource.expandVS(ElementDefinition.ElementDefinitionBindingComponent binding, boolean cacheOk, boolean heiarchical) ValueSet Expansion - see $expand, but resolves the binding firstexpandVS(ValueSet.ConceptSetComponent inc, boolean heirarchical) 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 $expandfetchCodeSystem(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 sourceformatMessage(String theMessage, Object... theMessageArguments) formatMessagePlural(Integer pl, String theMessage, Object... theMessageArguments) voidgetAbbreviation(String name) returns the recommended tla for the typegetLinkForUrl(String corePath, String s) getNarrativeGenerator(String prefix, String basePath) Get a generator that can generate narrative for the instanceGet a parser to read/write instances.getParser(ParserType type) Get a parser to read/write instances.getTransform(String url) org.fhir.ucum.UcumServiceGet the versions of the definitions loaded in contextbooleanhasCache()<T extends Resource>
 booleanhasResource(Class<T> class_, String uri) find whether a resource is available.booleanbooleanisPrimitiveType(String code) Get a JSON parserGet a validator that can check whether a resource is validGet an XML parservoidsetExpansionProfile(Parameters expParameters) voidvoidvoidsetOverrideVersionNs(String value) voidsetUcumService(org.fhir.ucum.UcumService ucumService) voidsetValidationMessageLanguage(Locale locale) booleansupportsSystem(String system) True if the underlying terminology service provider will do expansion and code validation for the terminology.org.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) 
- 
Method Details- 
getVersionGet the versions of the definitions loaded in context- Returns:
 
- 
getUcumServiceorg.fhir.ucum.UcumService getUcumService()
- 
getParserGet a parser to read/write instances. Use the defined type (will be extended as further types are added, though the only currently anticipate type is RDF) XML/JSON - the standard renderers XHTML - render the narrative only (generate it if necessary)- Parameters:
- type-
- Returns:
 
- 
getParserGet a parser to read/write instances. Determine the type from the stated type. Supported value for type: - the recommended MIME types - variants of application/xml and application/json - _format values xml, json- Parameters:
- type-
- Returns:
 
- 
newJsonParserGet a JSON parser- Returns:
 
- 
newXmlParserGet an XML parser- Returns:
 
- 
getNarrativeGeneratorGet a generator that can generate narrative for the instance- Returns:
- a prepared generator
 
- 
newValidatorGet a validator that can check whether a resource is valid- Returns:
- a prepared generator
- Throws:
- org.hl7.fhir.exceptions.FHIRException- @
 
- 
fetchResourceFind 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- Parameters:
- resource-
- Reference-
- Returns:
- Throws:
- org.hl7.fhir.exceptions.FHIRException
- Exception
 
- 
fetchResource
- 
fetchResource
- 
fetchResourceWithException<T extends Resource> T fetchResourceWithException(Class<T> class_, String uri) throws org.hl7.fhir.exceptions.FHIRException - Throws:
- org.hl7.fhir.exceptions.FHIRException
 
- 
fetchResourcesByType
- 
fetchResourceByIdVariation 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- Parameters:
- type-
- uri-
- Returns:
 
- 
hasResourcefind whether a resource is available. Implementations of the interface can assume that if hasResource ruturns true, the resource will usually be fetched subsequently- Parameters:
- class_-
- uri-
- Returns:
 
- 
cacheResourcecache 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- Parameters:
- res-
- Throws:
- org.hl7.fhir.exceptions.FHIRException
 
- 
getResourceNames
- 
getResourceNamesAsSet
- 
getTypeNames
- 
allStructures
- 
getStructures
- 
allConformanceResources
- 
generateSnapshotvoid generateSnapshot(StructureDefinition p) throws org.hl7.fhir.exceptions.DefinitionException, org.hl7.fhir.exceptions.FHIRException - Throws:
- org.hl7.fhir.exceptions.DefinitionException
- org.hl7.fhir.exceptions.FHIRException
 
- 
getExpansionParameters
- 
setExpansionProfile
- 
fetchCodeSystemFind the code system definition for the nominated system uri. return null if there isn't one (then the tool might try supportsSystem)- Parameters:
- system-
- Returns:
 
- 
supportsSystemTrue 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- Parameters:
- system-
- Returns:
- Throws:
- Exception
- org.hl7.fhir.exceptions.TerminologyServiceException
 
- 
findMapsForSourcefind concept maps for a source- Parameters:
- url-
- Returns:
- Throws:
- org.hl7.fhir.exceptions.FHIRException
 
- 
expandVSValueSetExpander.ValueSetExpansionOutcome expandVS(ValueSet source, boolean cacheOk, boolean heiarchical) ValueSet Expansion - see $expand- Parameters:
- source-
- Returns:
 
- 
expandVSValueSetExpander.ValueSetExpansionOutcome expandVS(ElementDefinition.ElementDefinitionBindingComponent binding, boolean cacheOk, boolean heiarchical) throws org.hl7.fhir.exceptions.FHIRException ValueSet Expansion - see $expand, but resolves the binding first- Parameters:
- source-
- Returns:
- Throws:
- org.hl7.fhir.exceptions.FHIRException
 
- 
expandVSValueSetExpander.ValueSetExpansionOutcome expandVS(ValueSet.ConceptSetComponent inc, boolean heirarchical) throws org.hl7.fhir.exceptions.TerminologyServiceException Value set expanion inside the internal expansion engine - used for references to supported system (see "supportsSystem") for which there is no value set.- Parameters:
- inc-
- Returns:
- Throws:
- org.hl7.fhir.exceptions.FHIRException
- org.hl7.fhir.exceptions.TerminologyServiceException
 
- 
getLocale
- 
setLocale
- 
formatMessage
- 
formatMessagePlural
- 
setValidationMessageLanguage
- 
validateCodeIWorkerContext.ValidationResult validateCode(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. 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- Parameters:
- system-
- code-
- display-
- Returns:
 
- 
validateCodeIWorkerContext.ValidationResult 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. 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- Parameters:
- system-
- code-
- display-
- Returns:
 
- 
validateCodeIWorkerContext.ValidationResult validateCode(org.hl7.fhir.utilities.validation.ValidationOptions options, String code, ValueSet vs) 
- 
validateCodeIWorkerContext.ValidationResult validateCode(org.hl7.fhir.utilities.validation.ValidationOptions options, Coding code, ValueSet vs) 
- 
validateCodeIWorkerContext.ValidationResult validateCode(org.hl7.fhir.utilities.validation.ValidationOptions options, CodeableConcept code, ValueSet vs) 
- 
validateCodeIWorkerContext.ValidationResult 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. 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- Parameters:
- system-
- code-
- display-
- Returns:
 
- 
getAbbreviationreturns the recommended tla for the type- Parameters:
- name-
- Returns:
 
- 
typeTails
- 
oid2Uri
- 
hasCacheboolean hasCache()
- 
setLogger
- 
getLogger
- 
isNoTerminologyServerboolean isNoTerminologyServer()
- 
translatororg.hl7.fhir.utilities.TranslationServices translator()
- 
listTransforms
- 
getTransform
- 
getOverrideVersionNs
- 
setOverrideVersionNs
- 
fetchTypeDefinition
- 
fetchTypeDefinitions
- 
setUcumService
- 
getLinkForUrl
- 
isPrimitiveType
 
-