
Package org.hl7.fhir.r5.hapi.ctx
Class HapiWorkerContext
java.lang.Object
org.hl7.fhir.utilities.i18n.I18nBase
org.hl7.fhir.r5.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.r5.context.IWorkerContext
IWorkerContext.SystemSupportInformation -
Field Summary
Fields inherited from class org.hl7.fhir.utilities.i18n.I18nBase
KEY_DELIMITER, uncontainedKeys -
Constructor Summary
ConstructorsConstructorDescriptionHapiWorkerContext(ca.uhn.fhir.context.FhirContext theCtx, ca.uhn.fhir.context.support.IValidationSupport theValidationSupport) -
Method Summary
Modifier and TypeMethodDescriptionorg.hl7.fhir.utilities.TimeTrackerclock()static ca.uhn.fhir.context.support.ConceptValidationOptionsconvertConceptValidationOptions(org.hl7.fhir.utilities.validation.ValidationOptions theOptions) expandVS(ExpansionOptions options, String uri) ValueSet Expansion - see $expand Note that caching makes a real performance difference, so turn it off with care.expandVS(ExpansionOptions options, ValueSet source) ValueSet Expansion - see $expand Note that caching makes a real performance difference, so turn it off with care.expandVS(Resource src, ElementDefinition.ElementDefinitionBindingComponent theBinding, boolean theCacheOk, boolean theHierarchical) ValueSet Expansion - see $expand, but resolves the binding firstValueSet Expansion - see $expand Note that caching makes a real performance difference, so turn it off with care.ValueSet Expansion - see $expand Note that caching makes a real performance difference, so turn it off with care.fetchCodeSystem(String theSystem) Find the code system definition for the nominated system uri.fetchCodeSystem(String theSystem, String version, Resource sourceOfReference) Find the code system definition for the nominated system uri.<T extends Resource>
TfetchResource(Class<T> theClass, String theUri) Fetch (load if necessary) an identified resource.<T extends Resource>
TfetchResource(Class<T> theClass, String theUri, String theVersion, Resource sourceOfReference) Fetch (load if necessary) an identified resource.<T extends Resource>
TfetchResource(Class<T> class_, String uri, org.hl7.fhir.utilities.FhirPublication fhirVersion) fetchResourceById(String theType, String theUri) Fetch (load if necessary) an identified resource.<T extends Resource>
TfetchResourceRaw(Class<T> class_, String uri) Find an identified resource, but do not do any processing on it.fetchResourcesByType(Class<T> theClass) Fetch all the resources of a particular type. if class == (null | Resource | DomainResource | CanonicalResource) return everything Note: this forces every resource to be loaded; this might take a very long time.fetchResourceVersions(Class<T> class_, String url) Fetch all the versions of a resource.<T extends Resource>
TfetchResourceWithException(Class<T> theClass, String theUri) Fetch (load if necessary) an identified resource.<T extends Resource>
TfetchResourceWithException(Class<T> theClass, String uri, String version, Resource sourceOfReference) Fetch (load if necessary) an identified resource.Like fetchCodeSystem, except that the context will find any CodeSysetm supplements and merge them into the definition that's returnedfetchSupplementedCodeSystem(String system, String version, Resource sourceOfReference) Like fetchCodeSystem, except that the context will find any CodeSysetm supplements and merge them into the definition that's returnedfetchTypeDefinition(String typeName) This is a short cut for fetchResource(StructureDefinition.class, ...)This finds all the structure definitions that have the given typeName<T extends Resource>
TfindTxResource(Class<T> class_, String canonical) this first does a fetch resource, and if nothing is found, looks in the terminology eco-system for a matching definition for the resource<T extends Resource>
TfindTxResource(Class<T> class_, String canonical, String version, Resource sourceOfReference) this first does a fetch resource, and if nothing is found, looks in the terminology eco-system for a matching definition for the resourcebyte[]Returns the binary for the keyReturns a set of keys that can be used to get binaries from this context.intGet a copy of the expansion parameters to be passed through the terminology server when txServer calls are made You can change these - it's not setting the underlying expansion parameters (see IWorkerContextManager) Note that the Validation Options override these when they are specified on validateCodeif this returns null, the context is frozen (usually for threading concerns on the server) If you're considering not providing this service, the context can't load stuff on the fly so you need to take care to load everything in advance.getPackage(String id, String ver) Note: take care with this method - there are multiple packages with the same canonical (different sub-packages, different versions)getProfiledElementBuilder(PEBuilder.PEElementPropertiesPolicy thePEElementPropertiesPolicy, boolean theB) getTxSupportInfo(String system, String version) return the System Support Information for the server that serves the specified code systemorg.fhir.ucum.UcumServiceThe version loaded *does not* have to be 5.0 (R5) - the context can load other versions, though the definitions need to be converted to R5 first Note that more than one version might be loaded at once, but one version is always the default / masterbooleanReturns true if this worker context contains a binary for this key.booleanhasPackage(String id, String ver) booleanhasPackage(PackageInformation packageVersion) <T extends Resource>
booleanhasResource(Class<T> theClass_, String theUri) find whether a resource is available. the principal use of this method is to find whether a resource is known without actually loading it.<T extends Resource>
booleanhasResource(Class<T> class_, String uri, String version, Resource sourceOfReference) find whether a resource is available. the principal use of this method is to find whether a resource is known without actually loading it.booleanisDataType(String s) return whether type is data type.booleanbooleanbooleanreturn whether type is primitive type.Get a validator that can check whether a resource is valid this is deprecated because there's lots of properties to set on the validator; the functions using this need to be changed to use the validator directlysetClientRetryCount(int value) voidsetExpansionProfile(Parameters theExpParameters) voidsetForPublication(boolean b) voidsetPackageTracker(IWorkerContextManager.IPackageLoadingTracker theIPackageLoadingTracker) subsumes(org.hl7.fhir.utilities.validation.ValidationOptions optionsArg, Coding parent, Coding child) ask the terminology system whether parent subsumes child.validateCode(org.hl7.fhir.utilities.validation.ValidationOptions theOptions, String theSystem, String theVersion, String theCode, String theDisplay) Validation of a code - consult the terminology infrstructure and/or service to see whether it is known.validateCode(org.hl7.fhir.utilities.validation.ValidationOptions theOptions, String theSystem, String theVersion, String theCode, String theDisplay, ValueSet theVs) Validation of a code - consult the terminology infrstructure and/or service to see whether it is known.validateCode(org.hl7.fhir.utilities.validation.ValidationOptions theOptions, String code, ValueSet vs) Validation of a code - consult the terminology infrstructure and/or service to see whether it is known.validateCode(org.hl7.fhir.utilities.validation.ValidationOptions theOptions, CodeableConcept theCode, ValueSet theVs) Validation of a code - consult the terminology infrstructure and/or service to see whether it is known.validateCode(org.hl7.fhir.utilities.validation.ValidationOptions theOptions, Coding theCode, ValueSet theVs) Validation of a code - consult the terminology infrstructure and/or service to see whether it is known.validateCode(org.hl7.fhir.utilities.validation.ValidationOptions options, Coding code, ValueSet vs, ValidationContextCarrier ctxt) See comments in ValidationContextCarrier.voidvalidateCodeBatch(org.hl7.fhir.utilities.validation.ValidationOptions options, List<? extends CodingValidationRequest> codes, ValueSet vs, boolean passVS) Batch validate code - reduce latency and do a bunch of codes in a single server call.validateTxResource(org.hl7.fhir.utilities.validation.ValidationOptions options, Resource resource) Validate the actual terminology resource itself on the appropriate terminology server (used for ECL validation)Methods inherited from class org.hl7.fhir.utilities.i18n.I18nBase
formatMessage, formatMessagePlural, getMessages, getMessagesSourceFileName, getPluralKey, getPluralKeys, getPluralRules, getPluralSuffixes, getRootKeyFromPlural, isWarnAboutMissingMessages, logUncontainedMessage, messageKeyExistsForLocale, 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.r5.context.IWorkerContext
formatMessage, formatMessagePlural
-
Constructor Details
-
HapiWorkerContext
public HapiWorkerContext(ca.uhn.fhir.context.FhirContext theCtx, ca.uhn.fhir.context.support.IValidationSupport theValidationSupport)
-
-
Method Details
-
fetchCodeSystem
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) This is a short cut for fetchResource(CodeSystem.class, system)- Specified by:
fetchCodeSystemin interfaceIWorkerContext- Parameters:
theSystem-- Returns:
-
fetchCodeSystem
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) This is a short cut for fetchResource(CodeSystem.class, system, version, sourceOfReference)- Specified by:
fetchCodeSystemin interfaceIWorkerContext
-
fetchSupplementedCodeSystem
Description copied from interface:IWorkerContextLike fetchCodeSystem, except that the context will find any CodeSysetm supplements and merge them into the definition that's returned- Specified by:
fetchSupplementedCodeSystemin interfaceIWorkerContext
-
fetchSupplementedCodeSystem
public CodeSystem fetchSupplementedCodeSystem(String system, String version, Resource sourceOfReference) Description copied from interface:IWorkerContextLike fetchCodeSystem, except that the context will find any CodeSysetm supplements and merge them into the definition that's returned- Specified by:
fetchSupplementedCodeSystemin interfaceIWorkerContext
-
getResourceNames
- Specified by:
getResourceNamesin interfaceIWorkerContext- Returns:
- a list of the resource names defined for this version (sorted alphabetically)
-
newValidator
Description copied from interface:IWorkerContextGet a validator that can check whether a resource is valid this is deprecated because there's lots of properties to set on the validator; the functions using this need to be changed to use the validator directly- Specified by:
newValidatorin interfaceIWorkerContext- Returns:
- a prepared generator
-
getNSUrlMap
- Specified by:
getNSUrlMapin interfaceIWorkerContext
-
getTxSupportInfo
Description copied from interface:IWorkerContextreturn the System Support Information for the server that serves the specified code system- Specified by:
getTxSupportInfoin interfaceIWorkerContext- Parameters:
system-version-- Returns:
-
validateCode
public ValidationResult validateCode(org.hl7.fhir.utilities.validation.ValidationOptions theOptions, CodeableConcept theCode, ValueSet theVs) 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 Note that this doesn't validate binding strength (e.g. is just text allowed?)- Specified by:
validateCodein interfaceIWorkerContext- Parameters:
theOptions- - validation options (required)theCode- - CodeableConcept to validatetheVs- the applicable valueset (optional)- Returns:
-
validateCode
public ValidationResult validateCode(org.hl7.fhir.utilities.validation.ValidationOptions theOptions, Coding theCode, ValueSet theVs) 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- Specified by:
validateCodein interfaceIWorkerContext- Parameters:
theOptions- - validation options (required)theCode- - Coding to validatetheVs- the applicable valueset (optional)- Returns:
-
validateCode
public ValidationResult validateCode(org.hl7.fhir.utilities.validation.ValidationOptions options, Coding code, ValueSet vs, ValidationContextCarrier ctxt) Description copied from interface:IWorkerContextSee comments in ValidationContextCarrier. This is called when there might be additional value sets etc available in the context, but we don't want to pre-process them.- Specified by:
validateCodein interfaceIWorkerContext- Parameters:
options-code-vs-ctxt-- Returns:
-
validateCodeBatch
public void validateCodeBatch(org.hl7.fhir.utilities.validation.ValidationOptions options, List<? extends CodingValidationRequest> codes, ValueSet vs, boolean passVS) Description copied from interface:IWorkerContextBatch validate code - reduce latency and do a bunch of codes in a single server call. Each is the same as a validateCode- Specified by:
validateCodeBatchin interfaceIWorkerContext- Parameters:
options-codes-vs-
-
validateCode
public ValidationResult validateCode(org.hl7.fhir.utilities.validation.ValidationOptions theOptions, String theSystem, String theVersion, String theCode, String theDisplay) 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 corresponds to 2 terminology service calls: $validate-code and $lookup- Specified by:
validateCodein interfaceIWorkerContext- Parameters:
theOptions- - validation options (required)theSystem- - equals Coding.system (required)theCode- - equals Coding.code (required)theDisplay- - equals Coding.display (optional)- Returns:
-
validateCode
public ValidationResult validateCode(org.hl7.fhir.utilities.validation.ValidationOptions theOptions, String theSystem, String theVersion, String theCode, String theDisplay, ValueSet theVs) 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- Specified by:
validateCodein interfaceIWorkerContext- Parameters:
theOptions- - validation options (required)theSystem- - equals Coding.system (required)theCode- - equals Coding.code (required)theDisplay- - equals Coding.display (optional)theVs- the applicable valueset (optional)- Returns:
-
validateCode
public ValidationResult validateCode(org.hl7.fhir.utilities.validation.ValidationOptions theOptions, 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 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:
theOptions- - validation options (required)code- The code to validate (required)vs- the applicable valueset (required)- Returns:
-
getExpansionParameters
Description copied from interface:IWorkerContextGet a copy of the expansion parameters to be passed through the terminology server when txServer calls are made You can change these - it's not setting the underlying expansion parameters (see IWorkerContextManager) Note that the Validation Options override these when they are specified on validateCode- Specified by:
getExpansionParametersin interfaceIWorkerContext
-
setExpansionProfile
-
expandVS
public ValueSetExpansionOutcome expandVS(ValueSet theSource, boolean theCacheOk, boolean theHierarchical) Description copied from interface:IWorkerContextValueSet Expansion - see $expand Note that caching makes a real performance difference, so turn it off with care.- Specified by:
expandVSin interfaceIWorkerContext- Parameters:
theSource- - the valueset to expandtheCacheOk- - whether to look in the cache for an expansiontheHierarchical- - whether to accept a heirarchical expansion- Returns:
- the expansion, or information about how the expansion failed
-
expandVS
Description copied from interface:IWorkerContextValueSet Expansion - see $expand Note that caching makes a real performance difference, so turn it off with care.- Specified by:
expandVSin interfaceIWorkerContext- Parameters:
options- - controls the expansion process (overrides expansion parameters)source- - the valueset to expand- Returns:
- the expansion, or information about how the expansion failed
-
expandVS
public ValueSetExpansionOutcome expandVS(ValueSet theSource, boolean theCacheOk, boolean theHierarchical, int i) Description copied from interface:IWorkerContextValueSet Expansion - see $expand Note that caching makes a real performance difference, so turn it off with care.- Specified by:
expandVSin interfaceIWorkerContext- Parameters:
theSource- - the valueset to expandtheCacheOk- - whether to look in the cache for an expansiontheHierarchical- - whether to accept a heirarchical expansioni- - maximum concepts to return- Returns:
- the expansion, or information about how the expansion failed
-
expandVS
Description copied from interface:IWorkerContextValueSet Expansion - see $expand Note that caching makes a real performance difference, so turn it off with care. This isn't quite the same as findTxResource+expand because if the uri can't be resolved, it'll be passed to the terminology service directly, and some terminology servers will expand value sets that they won't return.- Specified by:
expandVSin interfaceIWorkerContext- Parameters:
options- - controls the expansion process (overrides expansion parameters)uri- - valueset uri.- Returns:
- the expansion, or information about how the expansion failed
-
getLocale
- Specified by:
getLocalein interfaceIWorkerContext- Overrides:
getLocalein classorg.hl7.fhir.utilities.i18n.I18nBase- Returns:
- the locale used when creating messages and invoking the terminology server
-
setLocale
- Overrides:
setLocalein classorg.hl7.fhir.utilities.i18n.I18nBase
-
getLogger
- Specified by:
getLoggerin interfaceIWorkerContext- Returns:
- the logging service configured for the context
-
getVersion
Description copied from interface:IWorkerContextThe version loaded *does not* have to be 5.0 (R5) - the context can load other versions, though the definitions need to be converted to R5 first Note that more than one version might be loaded at once, but one version is always the default / master- Specified by:
getVersionin interfaceIWorkerContext- Returns:
- the version of the base definitions loaded in context
-
getUcumService
- Specified by:
getUcumServicein interfaceIWorkerContext- Returns:
- Get the UCUM service that provides access to units of measure reasoning services (if available)
-
oidServices
- Specified by:
oidServicesin interfaceIWorkerContext- Returns:
- a handle to provide information about OIDs known to the context (if available)
-
getManager
Description copied from interface:IWorkerContextif this returns null, the context is frozen (usually for threading concerns on the server) If you're considering not providing this service, the context can't load stuff on the fly so you need to take care to load everything in advance. In particular, pay attention to cross-version packages Also, beware of the impact of lazy-loading on thread safety- Specified by:
getManagerin interfaceIWorkerContext- Returns:
- the manager that can be used to load / unload content from the context
-
isNoTerminologyServer
- Specified by:
isNoTerminologyServerin interfaceIWorkerContext- Returns:
- true if there is a terminology server supporting the context
-
getCodeSystemsUsed
- Specified by:
getCodeSystemsUsedin interfaceIWorkerContext- Returns:
- a list of all the code systems used by the functions above
-
fetchTypeDefinition
Description copied from interface:IWorkerContextThis is a short cut for fetchResource(StructureDefinition.class, ...) but it accepts a typename - that is, it resolves based on StructureDefinition.type or StructureDefinition.url. This only resolves to http://hl7.org/fhir/StructureDefinition/{typename}- Specified by:
fetchTypeDefinitionin interfaceIWorkerContext- Parameters:
typeName-- Returns:
- type (or exception if there is multiple candidates
-
isPrimitiveType
Description copied from interface:IWorkerContextreturn whether type is primitive type. This is called a lot, and needs a high performance implementation- Specified by:
isPrimitiveTypein interfaceIWorkerContext- Parameters:
s-- Returns:
-
isDataType
Description copied from interface:IWorkerContextreturn whether type is data type. This is called a lot, and needs a high performance implementation- Specified by:
isDataTypein interfaceIWorkerContext- Parameters:
s-- Returns:
-
fetchTypeDefinitions
Description copied from interface:IWorkerContextThis finds all the structure definitions that have the given typeName- Specified by:
fetchTypeDefinitionsin interfaceIWorkerContext- Parameters:
n-- Returns:
-
fetchResourceRaw
Description copied from interface:IWorkerContextFind an identified resource, but do not do any processing on it. The usual processing that happens is ensuring that the snapshot is generated before returning it; This routine is used in the snapshot generation routines to avoid circular dependency challenges generating snapshots. 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 class can be Resource, DomainResource or CanonicalResource, which means resource of all kinds- Specified by:
fetchResourceRawin interfaceIWorkerContext- Parameters:
class_- the type of resourceuri- the URL of the resource, optionally with a |version suffix- Returns:
- the resource if known (or an exception will be thrown)
-
fetchResource
Description copied from interface:IWorkerContextFetch (load if necessary) an identified resource. The most common use of this is to access the standard conformance resources that are part of the standard - structure definitions, value sets, concept maps, etc. 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 class can be Resource, DomainResource or CanonicalResource, which means resource of all kinds- Specified by:
fetchResourcein interfaceIWorkerContext- Parameters:
theClass- the type of resourcetheUri- the URL of the resource, optionally with a |version suffix- Returns:
- the resource if known (or null)
-
fetchResource
public <T extends Resource> T fetchResource(Class<T> class_, String uri, org.hl7.fhir.utilities.FhirPublication fhirVersion) -
fetchResourceWithException
public <T extends Resource> T fetchResourceWithException(Class<T> theClass, String theUri) throws org.hl7.fhir.exceptions.FHIRException Description copied from interface:IWorkerContextFetch (load if necessary) an identified resource. The most common use of this is to access the standard conformance resources that are part of the standard - structure definitions, value sets, concept maps, etc. 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 class can be Resource, DomainResource or CanonicalResource, which means resource of all kinds- Specified by:
fetchResourceWithExceptionin interfaceIWorkerContext- Parameters:
theClass- the type of resourcetheUri- the URL of the resource, optionally with a |version suffix- Returns:
- the resource if known (or an exception will be thrown)
- Throws:
org.hl7.fhir.exceptions.FHIRException
-
fetchResourceWithException
public <T extends Resource> T fetchResourceWithException(Class<T> theClass, String uri, String version, Resource sourceOfReference) throws org.hl7.fhir.exceptions.FHIRException Description copied from interface:IWorkerContextFetch (load if necessary) an identified resource. The most common use of this is to access the standard conformance resources that are part of the standard - structure definitions, value sets, concept maps, etc. 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 class can be Resource, DomainResource or CanonicalResource, which means resource of all kinds- Specified by:
fetchResourceWithExceptionin interfaceIWorkerContext- Parameters:
theClass- the type of resourceuri- the URL of the resource, optionally with a |version suffixversion- the version. Don't provide both a version and a |version suffixsourceOfReference- where the reference was found (if the reference is in a resource)- Returns:
- if the resource is known. Will throw an exception if the resource is not known
- Throws:
org.hl7.fhir.exceptions.FHIRException
-
fetchResource
public <T extends Resource> T fetchResource(Class<T> theClass, String theUri, String theVersion, Resource sourceOfReference) Description copied from interface:IWorkerContextFetch (load if necessary) an identified resource. The most common use of this is to access the standard conformance resources that are part of the standard - structure definitions, value sets, concept maps, etc. 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 class can be Resource, DomainResource or CanonicalResource, which means resource of all kinds- Specified by:
fetchResourcein interfaceIWorkerContext- Parameters:
theClass- the type of resourcetheUri- the URL of the resource, optionally with a |version suffixtheVersion- the version. Don't provide both a version and a |version suffixsourceOfReference- where the reference was found (if the reference is in a resource)- Returns:
- if the resource is known
-
fetchResourceById
Description copied from interface:IWorkerContextFetch (load if necessary) an identified resource. The most common use of this is to access the standard conformance resources that are part of the standard - structure definitions, value sets, concept maps, etc. This is the non-generic version, but the functionality is otherwise the same 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 class can be Resource, DomainResource or CanonicalResource, which means resource of all kinds- Specified by:
fetchResourceByIdin interfaceIWorkerContext- Parameters:
theType- the type of resourcetheUri- the URL of the resource, optionally with a |version suffix- Returns:
- the resource if known (or null)
-
hasResource
Description copied from interface:IWorkerContextfind whether a resource is available. the principal use of this method is to find whether a resource is known without actually loading it.- Specified by:
hasResourcein interfaceIWorkerContext- Parameters:
theClass_- the type of resourcetheUri- the URL of the resource, optionally with a |version suffix- Returns:
- if the resource is known
-
hasResource
public <T extends Resource> boolean hasResource(Class<T> class_, String uri, String version, Resource sourceOfReference) Description copied from interface:IWorkerContextfind whether a resource is available. the principal use of this method is to find whether a resource is known without actually loading it.- Specified by:
hasResourcein interfaceIWorkerContext- Parameters:
class_- the type of resourceuri- the URL of the resource, optionally with a |version suffixversion- the version. Don't provide both a version and a |version suffixsourceOfReference- where the reference was found (if the reference is in a resource)- Returns:
- if the resource is known
-
getResourceNamesAsSet
- Specified by:
getResourceNamesAsSetin interfaceIWorkerContext- Returns:
- a set of the resource names defined for this version
-
expandVS
public ValueSetExpansionOutcome expandVS(Resource src, 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 interfaceIWorkerContext- Parameters:
src-- Returns:
- Throws:
org.hl7.fhir.exceptions.FHIRException
-
getBinaryKeysAsSet
Description copied from interface:IWorkerContextReturns a set of keys that can be used to get binaries from this context. In general, the binaries come from the loaded packages (mostly the pubpack)- Specified by:
getBinaryKeysAsSetin interfaceIWorkerContext- Returns:
- a set of binaries or null
-
hasBinaryKey
Description copied from interface:IWorkerContextReturns true if this worker context contains a binary for this key.- Specified by:
hasBinaryKeyin interfaceIWorkerContext- Parameters:
s-- Returns:
- true if binary is available for this key
-
getBinaryForKey
Description copied from interface:IWorkerContextReturns the binary for the key- Specified by:
getBinaryForKeyin interfaceIWorkerContext- Parameters:
s-- Returns:
-
hasPackage
- Specified by:
hasPackagein interfaceIWorkerContext- Returns:
- true if the nominated package has been loaded
-
hasPackage
- Specified by:
hasPackagein interfaceIWorkerContext- Returns:
- true if the nominated package has been loaded (by id and version)
-
getPackage
- Specified by:
getPackagein interfaceIWorkerContext- Returns:
- package information for nominated package
-
getClientRetryCount
- Specified by:
getClientRetryCountin interfaceIWorkerContext
-
setClientRetryCount
- Specified by:
setClientRetryCountin interfaceIWorkerContext
-
clock
- Specified by:
clockin interfaceIWorkerContext- Returns:
- time tracker for when the context is being loaded (0 = start of loading)
-
getPackageTracker
- Specified by:
getPackageTrackerin interfaceIWorkerContext
-
getPackageForUrl
Description copied from interface:IWorkerContextNote: take care with this method - there are multiple packages with the same canonical (different sub-packages, different versions)- Specified by:
getPackageForUrlin interfaceIWorkerContext- Parameters:
s- - canonical URL- Returns:
- - package information for the most recent package with the given canonical
-
convertConceptValidationOptions
public static ca.uhn.fhir.context.support.ConceptValidationOptions convertConceptValidationOptions(org.hl7.fhir.utilities.validation.ValidationOptions theOptions) -
fetchResourcesByType
Description copied from interface:IWorkerContextFetch all the resources of a particular type. if class == (null | Resource | DomainResource | CanonicalResource) return everything Note: this forces every resource to be loaded; this might take a very long time. Some implementations require some flag to be set elsewhere to allow this method to be called for some types to prevent the method from accidentally being called (ValueSets can take minutes to load, since there are so many in scope)- Specified by:
fetchResourcesByTypein interfaceIWorkerContext- Parameters:
theClass- the type of resource to load- Returns:
- all the resources
-
fetchResourceVersions
Description copied from interface:IWorkerContextFetch all the versions of a resource.- Specified by:
fetchResourceVersionsin interfaceIWorkerContext- Parameters:
class_- the type of resource to load- Returns:
- all the resources
-
setPackageTracker
public IWorkerContext setPackageTracker(IWorkerContextManager.IPackageLoadingTracker theIPackageLoadingTracker) - Specified by:
setPackageTrackerin interfaceIWorkerContext
-
getSpecUrl
- Specified by:
getSpecUrlin interfaceIWorkerContext- Returns:
- The URL that points to the specification for the version loaded
-
getProfiledElementBuilder
public PEBuilder getProfiledElementBuilder(PEBuilder.PEElementPropertiesPolicy thePEElementPropertiesPolicy, boolean theB) - Specified by:
getProfiledElementBuilderin interfaceIWorkerContext
-
isForPublication
- Specified by:
isForPublicationin interfaceIWorkerContext
-
setForPublication
- Specified by:
setForPublicationin interfaceIWorkerContext
-
findTxResource
public <T extends Resource> T findTxResource(Class<T> class_, String canonical, String version, Resource sourceOfReference) Description copied from interface:IWorkerContextthis first does a fetch resource, and if nothing is found, looks in the terminology eco-system for a matching definition for the resource- Specified by:
findTxResourcein interfaceIWorkerContext
-
findTxResource
Description copied from interface:IWorkerContextthis first does a fetch resource, and if nothing is found, looks in the terminology eco-system for a matching definition for the resource- Specified by:
findTxResourcein interfaceIWorkerContext
-
subsumes
public Boolean subsumes(org.hl7.fhir.utilities.validation.ValidationOptions optionsArg, Coding parent, Coding child) Description copied from interface:IWorkerContextask the terminology system whether parent subsumes child.- Specified by:
subsumesin interfaceIWorkerContext- Returns:
- true if it does, false if it doesn't, and null if it's not know whether it does
-
validateTxResource
public OperationOutcome validateTxResource(org.hl7.fhir.utilities.validation.ValidationOptions options, Resource resource) Description copied from interface:IWorkerContextValidate the actual terminology resource itself on the appropriate terminology server (used for ECL validation)- Specified by:
validateTxResourcein interfaceIWorkerContext- Parameters:
options-resource-- Returns:
-