
Package org.hl7.fhir.r4.hapi.ctx
Class HapiWorkerContext
java.lang.Object
org.hl7.fhir.utilities.i18n.I18nBase
org.hl7.fhir.r4.hapi.ctx.HapiWorkerContext
- All Implemented Interfaces:
- IWorkerContext
public final class HapiWorkerContext
extends org.hl7.fhir.utilities.i18n.I18nBase
implements IWorkerContext
- 
Nested Class SummaryNested classes/interfaces inherited from interface org.hl7.fhir.r4.context.IWorkerContextIWorkerContext.ILoggingService, IWorkerContext.ValidationResult
- 
Field SummaryFields inherited from class org.hl7.fhir.utilities.i18n.I18nBaseKEY_DELIMITER, uncontainedKeys
- 
Constructor SummaryConstructorsConstructorDescriptionHapiWorkerContext(ca.uhn.fhir.context.FhirContext theCtx, ca.uhn.fhir.context.support.IValidationSupport theValidationSupport) 
- 
Method SummaryModifier and TypeMethodDescriptionvoidcacheResource(Resource theRes) cache a resource for later retrieval using fetchResource.static ca.uhn.fhir.context.support.ConceptValidationOptionsconvertConceptValidationOptions(org.hl7.fhir.utilities.validation.ValidationOptions theOptions) expandVS(ElementDefinition.ElementDefinitionBindingComponent theBinding, boolean theCacheOk, boolean theHierarchical) ValueSet Expansion - see $expand, but resolves the binding firstexpandVS(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. return null if there isn't one (then the tool might try supportsSystem)<T extends Resource>
 TfetchResource(Class<T> theClass, String theUri) Find an identified resource.<T extends Resource>
 TfetchResource(Class<T> theClass, String theUri, String theVersion) <T extends Resource>
 TfetchResource(Class<T> theClass, String theUri, Resource resource) fetchResourceById(String theType, String theUri) 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> aClass) <T extends Resource>
 TfetchResourceWithException(Class<T> theClass, String theUri) fetchTypeDefinition(String theTypeName) fetchTypeDefinitions(String input) findMapsForSource(String theUrl) find concept maps for a sourcevoidgetAbbreviation(String theName) returns the recommended tla for the typegetLinkForUrl(String corePath, String url) getNarrativeGenerator(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.getTransform(String url) org.fhir.ucum.UcumServiceGet the versions of the definitions loaded in contextbooleanhasCache()<T extends Resource>
 booleanhasResource(Class<T> theClass_, String theUri) find whether a resource is available.booleanbooleanisPrimitiveType(String theType) Get a JSON parserGet a validator that can check whether a resource is validGet an XML parservoidsetExpansionProfile(Parameters theExpParameters) voidsetLogger(IWorkerContext.ILoggingService theLogger) voidsetOverrideVersionNs(String value) voidsetUcumService(org.fhir.ucum.UcumService ucumService) booleansupportsSystem(String theSystem) 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 theOptions, String theSystem, String theCode, String theDisplay) Validation of a code - consult the terminology service to see whether it is known.validateCode(org.hl7.fhir.utilities.validation.ValidationOptions theOptions, String theSystem, String theCode, String theDisplay, ValueSet theVs) Validation of a code - consult the terminology service to see whether it is known.validateCode(org.hl7.fhir.utilities.validation.ValidationOptions theOptions, String theSystem, String theCode, String theDisplay, ValueSet.ConceptSetComponent theVsi) Validation of a code - consult the terminology service to see whether it is known.validateCode(org.hl7.fhir.utilities.validation.ValidationOptions theOptions, String code, ValueSet vs) validateCode(org.hl7.fhir.utilities.validation.ValidationOptions theOptions, CodeableConcept theCode, ValueSet theVs) validateCode(org.hl7.fhir.utilities.validation.ValidationOptions theOptions, Coding theCode, ValueSet theVs) Methods inherited from class org.hl7.fhir.utilities.i18n.I18nBaseformatMessage, formatMessagePlural, getLocale, getMessages, getMessagesSourceFileName, getPluralKey, getPluralKeys, getPluralRules, getPluralSuffixes, getRootKeyFromPlural, isWarnAboutMissingMessages, logUncontainedMessage, messageKeyExistsForLocale, setLocale, setValidationMessageLanguage, setWarnAboutMissingMessages, typeOfStringMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.hl7.fhir.r4.context.IWorkerContextformatMessage, formatMessagePlural, getLocale, setLocale, setValidationMessageLanguage
- 
Constructor Details- 
HapiWorkerContextpublic HapiWorkerContext(ca.uhn.fhir.context.FhirContext theCtx, ca.uhn.fhir.context.support.IValidationSupport theValidationSupport) 
 
- 
- 
Method Details- 
allStructures- Specified by:
- allStructuresin interface- IWorkerContext
 
- 
getStructures- Specified by:
- getStructuresin interface- IWorkerContext
 
- 
fetchCodeSystemDescription 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 interface- IWorkerContext
- Parameters:
- theSystem-
- Returns:
 
- 
findMapsForSourceDescription copied from interface:IWorkerContextfind concept maps for a source- Specified by:
- findMapsForSourcein interface- IWorkerContext
- Parameters:
- theUrl-
- Returns:
 
- 
getAbbreviationDescription copied from interface:IWorkerContextreturns the recommended tla for the type- Specified by:
- getAbbreviationin interface- IWorkerContext
- Parameters:
- theName-
- Returns:
 
- 
getNarrativeGeneratorDescription copied from interface:IWorkerContextGet a generator that can generate narrative for the instance- Specified by:
- getNarrativeGeneratorin interface- IWorkerContext
- Returns:
- a prepared generator
 
- 
getParserDescription copied from interface:IWorkerContextGet 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:
- getParserin interface- IWorkerContext
- Parameters:
- theType-
- Returns:
 
- 
getParserDescription copied from interface:IWorkerContextGet 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:
- getParserin interface- IWorkerContext
- Parameters:
- theType-
- Returns:
 
- 
getResourceNames- Specified by:
- getResourceNamesin interface- IWorkerContext
 
- 
newJsonParserDescription copied from interface:IWorkerContextGet a JSON parser- Specified by:
- newJsonParserin interface- IWorkerContext
- Returns:
 
- 
newValidatorDescription copied from interface:IWorkerContextGet a validator that can check whether a resource is valid- Specified by:
- newValidatorin interface- IWorkerContext
- Returns:
- a prepared generator
 
- 
newXmlParserDescription copied from interface:IWorkerContextGet an XML parser- Specified by:
- newXmlParserin interface- IWorkerContext
- Returns:
 
- 
oid2Uri- Specified by:
- oid2Uriin interface- IWorkerContext
 
- 
supportsSystemDescription 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 interface- IWorkerContext
- Parameters:
- theSystem-
- Returns:
 
- 
typeTails- Specified by:
- typeTailsin interface- IWorkerContext
 
- 
validateCodepublic IWorkerContext.ValidationResult validateCode(org.hl7.fhir.utilities.validation.ValidationOptions theOptions, CodeableConcept theCode, ValueSet theVs) - Specified by:
- validateCodein interface- IWorkerContext
 
- 
validateCodepublic IWorkerContext.ValidationResult validateCode(org.hl7.fhir.utilities.validation.ValidationOptions theOptions, Coding theCode, ValueSet theVs) - Specified by:
- validateCodein interface- IWorkerContext
 
- 
validateCodepublic IWorkerContext.ValidationResult validateCode(org.hl7.fhir.utilities.validation.ValidationOptions theOptions, String theSystem, String theCode, String theDisplay) 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 interface- IWorkerContext
- Parameters:
- theSystem-
- theCode-
- theDisplay-
- Returns:
 
- 
validateCodepublic IWorkerContext.ValidationResult validateCode(org.hl7.fhir.utilities.validation.ValidationOptions theOptions, String theSystem, String theCode, String theDisplay, ValueSet.ConceptSetComponent theVsi) 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 interface- IWorkerContext
- Parameters:
- theSystem-
- theCode-
- theDisplay-
- Returns:
 
- 
validateCodepublic IWorkerContext.ValidationResult validateCode(org.hl7.fhir.utilities.validation.ValidationOptions theOptions, String theSystem, String theCode, String theDisplay, ValueSet theVs) 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 interface- IWorkerContext
- Parameters:
- theSystem-
- theCode-
- theDisplay-
- Returns:
 
- 
validateCodepublic IWorkerContext.ValidationResult validateCode(org.hl7.fhir.utilities.validation.ValidationOptions theOptions, String code, ValueSet vs) - Specified by:
- validateCodein interface- IWorkerContext
 
- 
allConformanceResources- Specified by:
- allConformanceResourcesin interface- IWorkerContext
 
- 
generateSnapshot- Specified by:
- generateSnapshotin interface- IWorkerContext
- Throws:
- org.hl7.fhir.exceptions.FHIRException
 
- 
getExpansionParameters- Specified by:
- getExpansionParametersin interface- IWorkerContext
 
- 
setExpansionProfile- Specified by:
- setExpansionProfilein interface- IWorkerContext
 
- 
hasCache- Specified by:
- hasCachein interface- IWorkerContext
 
- 
expandVSpublic ValueSetExpander.ValueSetExpansionOutcome expandVS(ValueSet theSource, boolean theCacheOk, boolean theHierarchical) Description copied from interface:IWorkerContextValueSet Expansion - see $expand- Specified by:
- expandVSin interface- IWorkerContext
- Parameters:
- theSource-
- Returns:
 
- 
expandVSpublic ValueSetExpander.ValueSetExpansionOutcome expandVS(ValueSet.ConceptSetComponent theInc, boolean theHierarchical) 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 interface- IWorkerContext
- Parameters:
- theInc-
- Returns:
- Throws:
- org.hl7.fhir.exceptions.TerminologyServiceException
 
- 
getLogger- Specified by:
- getLoggerin interface- IWorkerContext
 
- 
setLogger- Specified by:
- setLoggerin interface- IWorkerContext
 
- 
getVersionDescription copied from interface:IWorkerContextGet the versions of the definitions loaded in context- Specified by:
- getVersionin interface- IWorkerContext
- Returns:
 
- 
getUcumService- Specified by:
- getUcumServicein interface- IWorkerContext
 
- 
setUcumService- Specified by:
- setUcumServicein interface- IWorkerContext
 
- 
isNoTerminologyServer- Specified by:
- isNoTerminologyServerin interface- IWorkerContext
 
- 
translator- Specified by:
- translatorin interface- IWorkerContext
 
- 
listTransforms- Specified by:
- listTransformsin interface- IWorkerContext
 
- 
getTransform- Specified by:
- getTransformin interface- IWorkerContext
 
- 
getOverrideVersionNs- Specified by:
- getOverrideVersionNsin interface- IWorkerContext
 
- 
setOverrideVersionNs- Specified by:
- setOverrideVersionNsin interface- IWorkerContext
 
- 
fetchTypeDefinition- Specified by:
- fetchTypeDefinitionin interface- IWorkerContext
 
- 
fetchTypeDefinitions- Specified by:
- fetchTypeDefinitionsin interface- IWorkerContext
 
- 
getLinkForUrl- Specified by:
- getLinkForUrlin interface- IWorkerContext
 
- 
getTypeNames- Specified by:
- getTypeNamesin interface- IWorkerContext
 
- 
fetchResourceDescription 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 interface- IWorkerContext
- Returns:
 
- 
fetchResource- Specified by:
- fetchResourcein interface- IWorkerContext
 
- 
fetchResource- Specified by:
- fetchResourcein interface- IWorkerContext
 
- 
fetchResourceWithExceptionpublic <T extends Resource> T fetchResourceWithException(Class<T> theClass, String theUri) throws org.hl7.fhir.exceptions.FHIRException - Specified by:
- fetchResourceWithExceptionin interface- IWorkerContext
- Throws:
- org.hl7.fhir.exceptions.FHIRException
 
- 
fetchResourcesByType- Specified by:
- fetchResourcesByTypein interface- IWorkerContext
 
- 
fetchResourceByIdDescription 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 interface- IWorkerContext
- Parameters:
- theType-
- theUri-
- Returns:
 
- 
hasResourceDescription 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 interface- IWorkerContext
- Parameters:
- theClass_-
- theUri-
- Returns:
 
- 
cacheResourceDescription 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- Specified by:
- cacheResourcein interface- IWorkerContext
- Parameters:
- theRes-
- Throws:
- org.hl7.fhir.exceptions.FHIRException
 
- 
getResourceNamesAsSet- Specified by:
- getResourceNamesAsSetin interface- IWorkerContext
 
- 
expandVSpublic ValueSetExpander.ValueSetExpansionOutcome expandVS(ElementDefinition.ElementDefinitionBindingComponent theBinding, boolean theCacheOk, boolean theHierarchical) throws org.hl7.fhir.exceptions.FHIRException Description copied from interface:IWorkerContextValueSet Expansion - see $expand, but resolves the binding first- Specified by:
- expandVSin interface- IWorkerContext
- Returns:
- Throws:
- org.hl7.fhir.exceptions.FHIRException
 
- 
convertConceptValidationOptionspublic static ca.uhn.fhir.context.support.ConceptValidationOptions convertConceptValidationOptions(org.hl7.fhir.utilities.validation.ValidationOptions theOptions) 
- 
isPrimitiveType- Specified by:
- isPrimitiveTypein interface- IWorkerContext
 
 
-