
Package org.hl7.fhir.r4.context
Class SimpleWorkerContext
java.lang.Object
org.hl7.fhir.utilities.i18n.I18nBase
org.hl7.fhir.r4.context.BaseWorkerContext
org.hl7.fhir.r4.context.SimpleWorkerContext
- All Implemented Interfaces:
ProfileUtilities.ProfileKnowledgeProvider,IWorkerContext
public class SimpleWorkerContext
extends BaseWorkerContext
implements IWorkerContext, ProfileUtilities.ProfileKnowledgeProvider
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic interfaceNested classes/interfaces inherited from class org.hl7.fhir.r4.context.BaseWorkerContext
BaseWorkerContext.NullTranslatorNested classes/interfaces inherited from interface org.hl7.fhir.r4.context.IWorkerContext
IWorkerContext.ILoggingService, IWorkerContext.ValidationResultNested classes/interfaces inherited from interface org.hl7.fhir.r4.conformance.ProfileUtilities.ProfileKnowledgeProvider
ProfileUtilities.ProfileKnowledgeProvider.BindingResolution -
Field Summary
Fields inherited from class org.hl7.fhir.r4.context.BaseWorkerContext
expParameters, name, noTerminologyServer, transforms, tsServer, txCache, txClient, txLog, validationCacheFields inherited from class org.hl7.fhir.utilities.i18n.I18nBase
KEY_DELIMITER, uncontainedKeys -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconnectToTSServer(TerminologyClient client, String log) protected voidcopy(SimpleWorkerContext other) <T extends Resource>
TfetchResource(Class<T> class_, String uri) Find an identified resource.static SimpleWorkerContextstatic SimpleWorkerContextfromClassPath(String name) static SimpleWorkerContextfromDefinitions(Map<String, byte[]> source) static SimpleWorkerContextfromDefinitions(Map<String, byte[]> source, SimpleWorkerContext.IContextResourceLoader loader) static SimpleWorkerContextstatic SimpleWorkerContextLoad the working context from the validation packstatic SimpleWorkerContextstatic SimpleWorkerContextfromPack(String path, SimpleWorkerContext.IContextResourceLoader loader) static SimpleWorkerContextfromPackage(org.hl7.fhir.utilities.npm.NpmPackage pi) static SimpleWorkerContextfromPackage(org.hl7.fhir.utilities.npm.NpmPackage pi, boolean allowDuplicates) static SimpleWorkerContextfromPackage(org.hl7.fhir.utilities.npm.NpmPackage pi, SimpleWorkerContext.IContextResourceLoader loader) voidgetAbbreviation(String name) returns the recommended tla for the typegetLinkFor(String corePath, String typeSimple) getLinkForProfile(StructureDefinition profile, String url) 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.Get the versions of the definitions loaded in contextbooleanhasCache()booleanhasLinkFor(String typeSimple) booleanisDatatype(String typeSimple) booleanbooleanisResource(String t) voidloadBinariesFromFolder(String folder) voidloadBinariesFromFolder(org.hl7.fhir.utilities.npm.NpmPackage pi) voidloadFromFile(InputStream stream, String name, SimpleWorkerContext.IContextResourceLoader loader) voidloadFromFile(String file, SimpleWorkerContext.IContextResourceLoader loader) voidloadFromFolder(String folder) voidloadFromPackage(org.hl7.fhir.utilities.npm.NpmPackage pi, SimpleWorkerContext.IContextResourceLoader loader, String... types) Get a JSON parserGet a validator that can check whether a resource is validGet an XML parserbooleanresolveBinding(StructureDefinition profile, String url, String path) resolveBinding(StructureDefinition profile, ElementDefinition.ElementDefinitionBindingComponent binding, String path) voidsetIgnoreProfileErrors(boolean ignoreProfileErrors) voidsetQuestionnaire(Questionnaire questionnaire) voidsetValidatorFactory(SimpleWorkerContext.IValidatorFactory validatorFactory) Methods inherited from class org.hl7.fhir.r4.context.BaseWorkerContext
allConformanceResources, cacheResource, cacheVS, copy, doValidateCode, dropResource, dropResource, expandVS, expandVS, expandVS, expandVS, fetchCodeSystem, fetchResource, fetchResource, fetchResourceById, fetchResourcesByType, fetchResourceWithException, fetchTypeDefinition, fetchTypeDefinitions, findMapsForSource, getExpandCodesLimit, getExpansionParameters, getLinkForUrl, getLogger, getName, getOverrideVersionNs, getResourceNamesAsSet, getSearchParameter, getStructure, getStructures, getTransform, getUcumService, hasResource, initTS, isAllowLoadingDuplicates, isCanRunWithoutTerminology, isDataType, isNoTerminologyServer, isPrimitiveType, isTlogging, listMaps, listStructures, listSupportedSystems, listTransforms, oid2Uri, reportStatus, seeMetadataResource, setAllowLoadingDuplicates, setCanRunWithoutTerminology, setExpandCodesLimit, setExpansionProfile, setLogger, setName, setOverrideVersionNs, setTlogging, setTranslator, setUcumService, supportsSystem, tlog, totalCount, translator, validateCode, validateCode, validateCode, validateCode, validateCode, validateCodeMethods inherited from class org.hl7.fhir.utilities.i18n.I18nBase
formatMessage, formatMessagePlural, getLocale, getMessages, getMessagesSourceFileName, getPluralKey, getPluralKeys, getPluralRules, getPluralSuffixes, getRootKeyFromPlural, isWarnAboutMissingMessages, logUncontainedMessage, messageKeyExistsForLocale, setLocale, setValidationMessageLanguage, setWarnAboutMissingMessages, typeOfStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.hl7.fhir.r4.context.IWorkerContext
allConformanceResources, cacheResource, expandVS, expandVS, expandVS, fetchCodeSystem, fetchResource, fetchResource, fetchResourceById, fetchResourcesByType, fetchResourceWithException, fetchTypeDefinition, fetchTypeDefinitions, findMapsForSource, formatMessage, formatMessagePlural, getExpansionParameters, getLinkForUrl, getLocale, getLogger, getOverrideVersionNs, getResourceNamesAsSet, getStructures, getTransform, getUcumService, hasResource, isNoTerminologyServer, isPrimitiveType, listTransforms, oid2Uri, setExpansionProfile, setLocale, setLogger, setOverrideVersionNs, setUcumService, setValidationMessageLanguage, supportsSystem, translator, validateCode, validateCode, validateCode, validateCode, validateCode, validateCodeMethods inherited from interface org.hl7.fhir.r4.conformance.ProfileUtilities.ProfileKnowledgeProvider
getLinkForUrl, isPrimitiveType
-
Constructor Details
-
SimpleWorkerContext
public SimpleWorkerContext() throws FileNotFoundException, IOException, org.hl7.fhir.exceptions.FHIRException- Throws:
FileNotFoundExceptionIOExceptionorg.hl7.fhir.exceptions.FHIRException
-
SimpleWorkerContext
public SimpleWorkerContext(SimpleWorkerContext other) throws FileNotFoundException, IOException, org.hl7.fhir.exceptions.FHIRException - Throws:
FileNotFoundExceptionIOExceptionorg.hl7.fhir.exceptions.FHIRException
-
-
Method Details
-
copy
-
fromPack
public static SimpleWorkerContext fromPack(String path) throws FileNotFoundException, IOException, org.hl7.fhir.exceptions.FHIRException Load the working context from the validation pack- Parameters:
path- filename of the validation pack- Returns:
- Throws:
IOExceptionFileNotFoundExceptionorg.hl7.fhir.exceptions.FHIRExceptionException
-
fromNothing
public static SimpleWorkerContext fromNothing() throws FileNotFoundException, IOException, org.hl7.fhir.exceptions.FHIRException- Throws:
FileNotFoundExceptionIOExceptionorg.hl7.fhir.exceptions.FHIRException
-
fromPackage
public static SimpleWorkerContext fromPackage(org.hl7.fhir.utilities.npm.NpmPackage pi, boolean allowDuplicates) throws FileNotFoundException, IOException, org.hl7.fhir.exceptions.FHIRException - Throws:
FileNotFoundExceptionIOExceptionorg.hl7.fhir.exceptions.FHIRException
-
fromPackage
public static SimpleWorkerContext fromPackage(org.hl7.fhir.utilities.npm.NpmPackage pi) throws FileNotFoundException, IOException, org.hl7.fhir.exceptions.FHIRException - Throws:
FileNotFoundExceptionIOExceptionorg.hl7.fhir.exceptions.FHIRException
-
fromPackage
public static SimpleWorkerContext fromPackage(org.hl7.fhir.utilities.npm.NpmPackage pi, SimpleWorkerContext.IContextResourceLoader loader) throws FileNotFoundException, IOException, org.hl7.fhir.exceptions.FHIRException - Throws:
FileNotFoundExceptionIOExceptionorg.hl7.fhir.exceptions.FHIRException
-
fromPack
public static SimpleWorkerContext fromPack(String path, boolean allowDuplicates) throws FileNotFoundException, IOException, org.hl7.fhir.exceptions.FHIRException - Throws:
FileNotFoundExceptionIOExceptionorg.hl7.fhir.exceptions.FHIRException
-
fromPack
public static SimpleWorkerContext fromPack(String path, SimpleWorkerContext.IContextResourceLoader loader) throws FileNotFoundException, IOException, org.hl7.fhir.exceptions.FHIRException - Throws:
FileNotFoundExceptionIOExceptionorg.hl7.fhir.exceptions.FHIRException
-
fromClassPath
public static SimpleWorkerContext fromClassPath() throws IOException, org.hl7.fhir.exceptions.FHIRException- Throws:
IOExceptionorg.hl7.fhir.exceptions.FHIRException
-
fromClassPath
public static SimpleWorkerContext fromClassPath(String name) throws IOException, org.hl7.fhir.exceptions.FHIRException - Throws:
IOExceptionorg.hl7.fhir.exceptions.FHIRException
-
fromDefinitions
public static SimpleWorkerContext fromDefinitions(Map<String, byte[]> source) throws IOException, org.hl7.fhir.exceptions.FHIRException- Throws:
IOExceptionorg.hl7.fhir.exceptions.FHIRException
-
fromDefinitions
public static SimpleWorkerContext fromDefinitions(Map<String, byte[]> source, SimpleWorkerContext.IContextResourceLoader loader) throws FileNotFoundException, IOException, org.hl7.fhir.exceptions.FHIRException- Throws:
FileNotFoundExceptionIOExceptionorg.hl7.fhir.exceptions.FHIRException
-
connectToTSServer
public String connectToTSServer(TerminologyClient client, String log) throws URISyntaxException, org.hl7.fhir.exceptions.FHIRException, IOException - Throws:
URISyntaxExceptionorg.hl7.fhir.exceptions.FHIRExceptionIOException
-
loadFromFile
public void loadFromFile(InputStream stream, String name, SimpleWorkerContext.IContextResourceLoader loader) throws IOException, org.hl7.fhir.exceptions.FHIRException - Throws:
IOExceptionorg.hl7.fhir.exceptions.FHIRException
-
loadFromPackage
public void loadFromPackage(org.hl7.fhir.utilities.npm.NpmPackage pi, SimpleWorkerContext.IContextResourceLoader loader, String... types) throws FileNotFoundException, IOException, org.hl7.fhir.exceptions.FHIRException - Throws:
FileNotFoundExceptionIOExceptionorg.hl7.fhir.exceptions.FHIRException
-
loadFromFile
public void loadFromFile(String file, SimpleWorkerContext.IContextResourceLoader loader) throws IOException, org.hl7.fhir.exceptions.FHIRException - Throws:
IOExceptionorg.hl7.fhir.exceptions.FHIRException
-
getParser
Description 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 interfaceIWorkerContext- Parameters:
type-- Returns:
-
getParser
Description 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 interfaceIWorkerContext- Parameters:
type-- Returns:
-
newJsonParser
Description copied from interface:IWorkerContextGet a JSON parser- Specified by:
newJsonParserin interfaceIWorkerContext- Returns:
-
newXmlParser
Description copied from interface:IWorkerContextGet an XML parser- Specified by:
newXmlParserin interfaceIWorkerContext- Returns:
-
getNarrativeGenerator
Description copied from interface:IWorkerContextGet a generator that can generate narrative for the instance- Specified by:
getNarrativeGeneratorin interfaceIWorkerContext- Returns:
- a prepared generator
-
newValidator
Description copied from interface:IWorkerContextGet a validator that can check whether a resource is valid- Specified by:
newValidatorin interfaceIWorkerContext- Returns:
- a prepared generator
- Throws:
org.hl7.fhir.exceptions.FHIRException- @
-
getResourceNames
- Specified by:
getResourceNamesin interfaceIWorkerContext
-
getTypeNames
- Specified by:
getTypeNamesin interfaceIWorkerContext
-
getAbbreviation
Description copied from interface:IWorkerContextreturns the recommended tla for the type- Specified by:
getAbbreviationin interfaceIWorkerContext- Parameters:
name-- Returns:
-
isDatatype
- Specified by:
isDatatypein interfaceProfileUtilities.ProfileKnowledgeProvider
-
isResource
- Specified by:
isResourcein interfaceProfileUtilities.ProfileKnowledgeProvider
-
hasLinkFor
- Specified by:
hasLinkForin interfaceProfileUtilities.ProfileKnowledgeProvider
-
getLinkFor
- Specified by:
getLinkForin interfaceProfileUtilities.ProfileKnowledgeProvider
-
resolveBinding
public ProfileUtilities.ProfileKnowledgeProvider.BindingResolution resolveBinding(StructureDefinition profile, ElementDefinition.ElementDefinitionBindingComponent binding, String path) - Specified by:
resolveBindingin interfaceProfileUtilities.ProfileKnowledgeProvider
-
resolveBinding
public ProfileUtilities.ProfileKnowledgeProvider.BindingResolution resolveBinding(StructureDefinition profile, String url, String path) - Specified by:
resolveBindingin interfaceProfileUtilities.ProfileKnowledgeProvider
-
getLinkForProfile
- Specified by:
getLinkForProfilein interfaceProfileUtilities.ProfileKnowledgeProvider
-
getQuestionnaire
-
setQuestionnaire
-
typeTails
- Specified by:
typeTailsin interfaceIWorkerContext
-
allStructures
- Specified by:
allStructuresin interfaceIWorkerContext
-
loadBinariesFromFolder
- Throws:
FileNotFoundExceptionException
-
loadBinariesFromFolder
public void loadBinariesFromFolder(org.hl7.fhir.utilities.npm.NpmPackage pi) throws FileNotFoundException, Exception - Throws:
FileNotFoundExceptionException
-
loadFromFolder
- Throws:
FileNotFoundExceptionException
-
getBinaries
-
prependLinks
- Specified by:
prependLinksin interfaceProfileUtilities.ProfileKnowledgeProvider
-
hasCache
- Specified by:
hasCachein interfaceIWorkerContext
-
getVersion
Description copied from interface:IWorkerContextGet the versions of the definitions loaded in context- Specified by:
getVersionin interfaceIWorkerContext- Returns:
-
findTransformsforSource
-
getValidatorFactory
-
setValidatorFactory
-
fetchResource
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- Overrides:
fetchResourcein classBaseWorkerContext- Returns:
-
generateSnapshot
public void generateSnapshot(StructureDefinition p) throws org.hl7.fhir.exceptions.DefinitionException, org.hl7.fhir.exceptions.FHIRException - Specified by:
generateSnapshotin interfaceIWorkerContext- Throws:
org.hl7.fhir.exceptions.DefinitionExceptionorg.hl7.fhir.exceptions.FHIRException
-
isIgnoreProfileErrors
-
setIgnoreProfileErrors
-
listMapUrls
-