/** * Recursive unknown-property walker for `detectUnknownElements`. * * The structural executor has long emitted `structural-unknown-element` * for top-level resource keys that aren't in the SD snapshot. Real-world * typos almost always sit deeper (Patient.contact[0].relationshp, * Bundle.entry[0].requst, …), so this walker descends through the * snapshot's BackboneElement paths and flags unknown keys at any depth. * * Phase 2 (this revision): also loads complex datatype SDs on demand * (HumanName, Address, CodeableConcept, ContactPoint, …) so typos * inside those types — `name[0].familly` — are caught too. * * Scope: * - Walks BackboneElement children directly enumerated in the * snapshot. * - Walks complex-datatype children by loading the type's SD via * `SDLoader` and building a sub-index. Sub-indices are cached per * type code so multiple resources sharing HumanName don't pay the * load cost twice in the same validation run. * - Skips primitive types (string, code, uri, …) and Resource / * DomainResource children. Resources nested inside Bundles or * `contained[]` are validated independently by the engine * recursion against their own resourceType's SD. * - Choice-type properties expand `value[x]` to the concrete suffixed * form (`valueString`, `valueQuantity`, …). */ import type { ValidationIssue } from '../../types'; import type { StructureDefinition } from '../structure-definition-types'; import type { StructureDefinitionLoader } from '../structure-definition-loader'; interface PathInfo { type?: string; } export interface SnapshotIndex { knownPaths: Set; byPath: Map; } export interface WalkerDeps { sdLoader: StructureDefinitionLoader; fhirVersion: 'R4' | 'R5' | 'R6'; typeIndexCache: Map; } export declare function buildSnapshotIndex(sd: StructureDefinition | undefined): SnapshotIndex; export declare function makeWalkerDeps(sdLoader: StructureDefinitionLoader, fhirVersion?: 'R4' | 'R5' | 'R6', typeIndexCache?: Map): WalkerDeps; /** * Walk `resource` recursively against `index` and return one issue per * unrecognised key, descending through BackboneElement children and — * when a `WalkerDeps` is provided — into complex datatype children too. */ export declare function detectUnknownProperties(resource: any, index: SnapshotIndex, resourceType: string, sdUrl: string | undefined, deps?: WalkerDeps): Promise; export {}; //# sourceMappingURL=unknown-property-walker.d.ts.map