FhirWorkerContext class

The engine's worker: type metadata (StructureDefinitions and the binding's type table), canonical resources, and terminology, over any model. A binding package subclasses it to supply its FhirModelBinding and keep its WorkerContext() constructor.

Implemented types

Constructors

FhirWorkerContext({required FhirModelBinding binding, FhirToolingClient? txClient, ResourceCache? resourceCache})

Properties

binding → FhirModelBinding
What the model supplies.
final
cached → Set<String>
final
cacheId ↔ String?
getter/setter pair
codeSystemsUsed → Set<String>
final
expParameters ↔ Map<String, dynamic>?
The expansion profile sent to a terminology server, as Parameters JSON.
getter/setter pair
hashCode → int
The hash code for this object.
no setterinherited
isTxCaching ↔ bool
getter/setter pair
locator → ValidatorFetcher
final
logger → LoggingService?
final
noTerminologyServer ↔ bool
getter/setter pair
resourceCache → ResourceCache
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
tlogging ↔ bool
getter/setter pair
txCache → TerminologyCache
final
txClient → FhirToolingClient?
final
txLog → ClientLogger
final
ucumService → UcumService
The UCUM service used for Quantity arithmetic/comparison canonicals.
final
valueFactory → IFhirValueFactory
The binding's value factory — how the engine constructs the FHIR-typed values it yields as results.
no setteroverride

Methods

addDependentResources(Map<String, dynamic> oldPin, FhirNode vs) → Future<(bool, Map<String, dynamic>)>
addDependentResourcesForComponent(Map<String, dynamic> oldPin, FhirNode inc) → Future<(bool, Map<String, dynamic>)>
addTypeAndDescendents(List<FhirNode> sdl, FhirNode dt, List<FhirNode> types) → void
allStructures() → Future<List<FhirNode>>
fetchCodeSystem(String? system) → Future<FhirNode?>
fetchCodeSystemWithVersion(String system, String version) → Future<FhirNode?>
fetchResource({String? uri, String? version, String? type}) → Future<FhirNode?>
The canonical resource at uri (and version), of type when given.
fetchTypeDefinition(String typeName) → Future<FhirNode?>
The StructureDefinition that type code typeName names, at the one canonical typeCodeCanonical gives it. This tried the bare name and then a terminology.hl7.org address as well; the spec resolves a relative code against http://hl7.org/fhir/StructureDefinition only, and the terminology.hl7.org address found an extension, never a type.
fetchTypeDefinitionByUrl(String url) → Future<FhirNode?>
The StructureDefinition resource with canonical URL url as an opaque node (handed back to resolveContextTypeDetails), or null.
override
fetchValueSet(String? url) → Future<FhirNode?>
The ValueSet resource for url as an opaque node, or null.
override
formatMessage(String theMessage, List theMessageArguments) → String
Formats the message-catalog entry theMessage with theMessageArguments (engine error texts).
override
formatMessagePlural(int pl, String theMessage, List theMessageArguments) → String
As formatMessage, with a plural count.
override
getChildTypesByName(String? type, String name, TypeDetails result, ExpressionNode expr, {required bool allowPolymorphicNames}) → Future<void>
Accumulates into result the types reachable by navigating name from type (static type analysis).
override
getClassInfoChildTypesByName(String name, TypeDetails result) → void
getElementDefinition(FhirNode sd, String path, bool allowTypedName, ExpressionNode expr) → Future<ElementDefinitionMatch?>
getElementDefinitionById(FhirNode sd, String ref) → ElementDefinitionMatch?
getOverrideVersionNs() → String
getResourceNames() → Future<List<String>>
getSimpleTypeChildTypesByName(String name, TypeDetails result) → void
getStructures() → Future<List<FhirNode>>
getVersion() → String
The FHIR publication version of the bound model (e.g. '4.0.1').
override
hasDataType(FhirNode ed) → bool
Whether ed declares a concrete data type (not Element or BackboneElement). Java ed.hasType() is "has a type"; the earlier port asked the element whether its own type name was in an empty list, which was always false, so this branch had never run.
hasDelimiter(String s1, String s2, String delimiter) → bool
isAbstractType(List<FhirNode> list) → bool
isKnownType(String typeName) → Future<bool>
Whether typeName names a known FHIR type: the binding's own type lists and table first (so the check needs no definitions loaded), then a StructureDefinition in the cache.
override
isSubtypeOf(String type, String superType) → Future<bool>
Whether type is superType or descends from it. The walk does NOT stop at primitive-type definitions (Java funcIs / isAncestor): this is what makes Patient.gender.is(string) true for a code.
override
isValueOfType(FhirNode node, String ns, String name) → Future<bool>
The FHIRPath type-membership test shared by the is operator and the is() function: does node belong to the type named name in namespace ns ('System' or 'FHIR')? A resource is never a System value; a System value is one the binding marks as outside the element tree or a bare primitive, matched by its capitalised type name (plus the Date→DateTime lattice rule); a FHIR test walks the subtype chain. Matches the Java reference FHIRPathEngine.funcIs.
override
laterDelimitedVersion(String newVersion, String oldVersion, String delimiter) → bool
laterVersion(String newVersion, String oldVersion) → bool
loadResource(FhirNode resource) → Future<void>
Keeps resource, a canonical resource node with an id or a version id.
loadStructureDefinition(FhirNode sd) → Future<void>
Keeps sd, a StructureDefinition node with a name and a url.
loadStructureDefinitions(List<FhirNode> sds) → Future<void>
matchesOfType(FhirNode node, String tn) → Future<bool>
The ofType() filter for node against the type specifier tn (System.X or FHIR.X), matching the Java reference funcOfType / funcAs: System values match by exact type name; FHIR values match through the subtype hierarchy, but the ofType walk STOPS at primitive-type definitions (so gender.ofType(string) is false for a code even though gender.is(string) is true).
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
primitiveTypeNames() → Future<Set<String>>
Names of the model's primitive types.
override
processValidationResponse(Map<String, dynamic> response) → ValidationResult
processValidationResult(Map<String, dynamic> pOut) → ValidationResult
The ValidationResult a server's $validate-code Parameters answer means.
resolveContextTypeDetails(FhirNode structureDefinition, String context, String abstractTypePrefix, ExpressionNode expr) → Future<TypeDetails?>
Resolves the type details of element context within the StructureDefinition node structureDefinition (engine check() API).
override
setTerminologyOptions(ValidationOptions options, Map<String, dynamic> pIn) → Map<String, dynamic>
pIn with the parameters the validation options add.
specializedTypeNames() → Future<List<String>>
Names of every specialization (non-logical) type of the bound model.
override
tlog(String msg) → void
toString() → String
A string representation of this object.
inherited
typeAncestry(String uri) → Future<List<(String, String)>>
The canonical-URL ancestry chain of the type at uri: this type, then each successive baseDefinition, as (url, typeName) pairs. Mirrors the walk in the Java reference's TypeDetails.hasType, including its uri → string redirect.
override
typeCanonicalUrl(String type) → Future<String?>
The canonical URL of the type named type, or null when unknown.
override
validateCode(ValidationOptions options, String? system, String? version, String code, String? display) → Future<ValidationResult>
validateCodeForCodeableConceptValue(ValidationOptions options, FhirNode node, FhirNode valueSet) → Future<ValidationResult>
As validateCodeForCodingValue, for a CodeableConcept-typed value.
override
validateCodeForCodingValue(ValidationOptions options, FhirNode node, FhirNode? valueSet) → Future<ValidationResult>
Validates a code-carrying value (what the binding reads as a Coding) against valueSet.
override
validateCodeOnServer(ValidationOptions options, CodingValue coding, FhirNode? valueSet) → ValidationResult
validateCodeWithCodeableConcept(ValidationOptions options, ConceptValue code, FhirNode vs) → Future<ValidationResult>
validateCodeWithCoding(ValidationOptions options, CodingValue coding, FhirNode? valueSet) → Future<ValidationResult>
Validates coding against valueSet (a ValueSet node, or null for the code system alone), on the client when the options allow it.
validateOnServer(FhirNode? vs, Map<String, dynamic> pin, ValidationOptions options) → ValidationResult
Prepares pin (Parameters JSON) for a server validation of vs. The server call itself is not yet implemented.

Operators

operator ==(Object other) → bool
The equality operator.
inherited