Package org.hl7.fhir.dstu3.hapi.ctx
Class HapiWorkerContext
java.lang.Object
org.hl7.fhir.utilities.i18n.I18nBase
org.hl7.fhir.dstu3.hapi.ctx.HapiWorkerContext
- All Implemented Interfaces:
IWorkerContext
public final class HapiWorkerContext
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
Fields inherited from class org.hl7.fhir.utilities.i18n.I18nBase
KEY_DELIMITER, locale, PLURAL_SUFFIX
-
Constructor Summary
ConstructorDescriptionHapiWorkerContext
(ca.uhn.fhir.context.FhirContext theCtx, ca.uhn.fhir.context.support.IValidationSupport theValidationSupport) -
Method Summary
Modifier and TypeMethodDescriptionstatic ca.uhn.fhir.context.support.ConceptValidationOptions
convertConceptValidationOptions
(org.hl7.fhir.utilities.validation.ValidationOptions theOptions) expandVS
(ValueSet.ConceptSetComponent theInc, boolean theHierarchical) 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 theSystem) Find the code system definition for the nominated system uri.<T extends Resource>
TfetchResource
(Class<T> theClass, String theUri) Find an identified resource.<T extends Resource>
TfetchResourceWithException
(Class<T> theClass_, String theUri) fetchTypeDefinition
(String theCode) findMapsForSource
(String theUrl) find concept maps for a sourcegetAbbreviation
(String theName) returns the recommended tla for the typegetNarrativeGenerator
(String thePrefix, String theBasePath) Get a generator that can generate narrative for the instanceGet a parser to read/write instances.getParser
(ParserType theType) Get a parser to read/write instances.Get the versions of the definitions loaded in contextboolean
hasCache()
<T extends Resource>
booleanhasResource
(Class<T> theClass_, String theUri) find whether a resource is available.boolean
Get a JSON parserGet a validator that can check whether a resource is validGet an XML parservoid
setExpansionProfile
(ExpansionProfile theExpProfile) void
setLogger
(IWorkerContext.ILoggingService theLogger) boolean
supportsSystem
(String theSystem) True if the underlying terminology service provider will do expansion and code validation for the terminology.validateCode
(String theSystem, String theCode, String theDisplay) Validation of a code - consult the terminology service to see whether it is known.validateCode
(String theSystem, String theCode, String theDisplay, ValueSet theVs) Validation of a code - consult the terminology service to see whether it is known.validateCode
(String theSystem, String theCode, String theDisplay, ValueSet.ConceptSetComponent theVsi) Validation of a code - consult the terminology service to see whether it is known.validateCode
(CodeableConcept theCode, ValueSet theVs) validateCode
(Coding theCode, ValueSet theVs) Methods inherited from class org.hl7.fhir.utilities.i18n.I18nBase
formatMessage, formatMessagePlural, getLocale, getMessagesSourceFileName, getPluralKey, getPluralKeys, getPluralSuffixes, getRootKeyFromPlural, isWarnAboutMissingMessages, messageKeyExistsForLocale, setLocale, setPluralRules, setValidationMessageLanguage, setWarnAboutMissingMessages, typeOfString
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
formatMessage, getLocale, setLocale, setValidationMessageLanguage
-
Constructor Details
-
HapiWorkerContext
public HapiWorkerContext(ca.uhn.fhir.context.FhirContext theCtx, ca.uhn.fhir.context.support.IValidationSupport theValidationSupport)
-
-
Method Details
-
allConformanceResources
- Specified by:
allConformanceResources
in interfaceIWorkerContext
-
allStructures
- Specified by:
allStructures
in interfaceIWorkerContext
-
expandVS
public ValueSet.ValueSetExpansionComponent expandVS(ValueSet.ConceptSetComponent theInc, boolean theHierarchical) Description copied from interface:IWorkerContext
Value set expanion inside the internal expansion engine - used for references to supported system (see "supportsSystem") for which there is no value set.- Specified by:
expandVS
in interfaceIWorkerContext
- Parameters:
theInc
-- Returns:
-
fetchTypeDefinition
- Specified by:
fetchTypeDefinition
in interfaceIWorkerContext
-
fetchCodeSystem
Description copied from interface:IWorkerContext
Find the code system definition for the nominated system uri. return null if there isn't one (then the tool might try supportsSystem)- Specified by:
fetchCodeSystem
in interfaceIWorkerContext
- Parameters:
theSystem
-- Returns:
-
fetchResource
Description copied from interface:IWorkerContext
Find 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:
fetchResource
in interfaceIWorkerContext
- Returns:
-
fetchResourceWithException
public <T extends Resource> T fetchResourceWithException(Class<T> theClass_, String theUri) throws org.hl7.fhir.exceptions.FHIRException - Specified by:
fetchResourceWithException
in interfaceIWorkerContext
- Throws:
org.hl7.fhir.exceptions.FHIRException
-
findMapsForSource
Description copied from interface:IWorkerContext
find concept maps for a source- Specified by:
findMapsForSource
in interfaceIWorkerContext
- Parameters:
theUrl
-- Returns:
-
expandVS
public ValueSetExpander.ValueSetExpansionOutcome expandVS(ValueSet source, boolean cacheOk, boolean heiarchical) Description copied from interface:IWorkerContext
ValueSet Expansion - see $expand- Specified by:
expandVS
in interfaceIWorkerContext
- Parameters:
source
-- Returns:
-
getAbbreviation
Description copied from interface:IWorkerContext
returns the recommended tla for the type- Specified by:
getAbbreviation
in interfaceIWorkerContext
- Parameters:
theName
-- Returns:
-
getExpansionProfile
- Specified by:
getExpansionProfile
in interfaceIWorkerContext
-
setExpansionProfile
- Specified by:
setExpansionProfile
in interfaceIWorkerContext
-
getNarrativeGenerator
Description copied from interface:IWorkerContext
Get a generator that can generate narrative for the instance- Specified by:
getNarrativeGenerator
in interfaceIWorkerContext
- Returns:
- a prepared generator
-
newValidator
Description copied from interface:IWorkerContext
Get a validator that can check whether a resource is valid- Specified by:
newValidator
in interfaceIWorkerContext
- Returns:
- a prepared generator
- Throws:
org.hl7.fhir.exceptions.FHIRException
-
getParser
Description copied from interface:IWorkerContext
Get 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)- Specified by:
getParser
in interfaceIWorkerContext
- Parameters:
theType
-- Returns:
-
getParser
Description copied from interface:IWorkerContext
Get 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- Specified by:
getParser
in interfaceIWorkerContext
- Parameters:
theType
-- Returns:
-
getResourceNames
- Specified by:
getResourceNames
in interfaceIWorkerContext
-
getResourceNamesAsSet
- Specified by:
getResourceNamesAsSet
in interfaceIWorkerContext
-
getTypeNames
- Specified by:
getTypeNames
in interfaceIWorkerContext
-
getVersion
Description copied from interface:IWorkerContext
Get the versions of the definitions loaded in context- Specified by:
getVersion
in interfaceIWorkerContext
- Returns:
-
hasCache
- Specified by:
hasCache
in interfaceIWorkerContext
-
hasResource
Description copied from interface:IWorkerContext
find 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:
hasResource
in interfaceIWorkerContext
- Parameters:
theClass_
-theUri
-- Returns:
-
isNoTerminologyServer
- Specified by:
isNoTerminologyServer
in interfaceIWorkerContext
-
newJsonParser
Description copied from interface:IWorkerContext
Get a JSON parser- Specified by:
newJsonParser
in interfaceIWorkerContext
- Returns:
-
newXmlParser
Description copied from interface:IWorkerContext
Get an XML parser- Specified by:
newXmlParser
in interfaceIWorkerContext
- Returns:
-
oid2Uri
- Specified by:
oid2Uri
in interfaceIWorkerContext
-
setLogger
- Specified by:
setLogger
in interfaceIWorkerContext
-
supportsSystem
Description copied from interface:IWorkerContext
True 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:
supportsSystem
in interfaceIWorkerContext
- Parameters:
theSystem
-- Returns:
-
typeTails
- Specified by:
typeTails
in interfaceIWorkerContext
-
validateCode
- Specified by:
validateCode
in interfaceIWorkerContext
-
validateCode
- Specified by:
validateCode
in interfaceIWorkerContext
-
validateCode
public IWorkerContext.ValidationResult validateCode(String theSystem, String theCode, String theDisplay) Description copied from interface:IWorkerContext
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- Specified by:
validateCode
in interfaceIWorkerContext
- Parameters:
theSystem
-theCode
-theDisplay
-- Returns:
-
convertConceptValidationOptions
public static ca.uhn.fhir.context.support.ConceptValidationOptions convertConceptValidationOptions(org.hl7.fhir.utilities.validation.ValidationOptions theOptions) -
validateCode
public IWorkerContext.ValidationResult validateCode(String theSystem, String theCode, String theDisplay, ValueSet.ConceptSetComponent theVsi) Description copied from interface:IWorkerContext
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- Specified by:
validateCode
in interfaceIWorkerContext
- Parameters:
theSystem
-theCode
-theDisplay
-- Returns:
-
validateCode
public IWorkerContext.ValidationResult validateCode(String theSystem, String theCode, String theDisplay, ValueSet theVs) Description copied from interface:IWorkerContext
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- Specified by:
validateCode
in interfaceIWorkerContext
- Parameters:
theSystem
-theCode
-theDisplay
-- Returns:
-