/** * SD Element Matcher * * Matches resource data to StructureDefinition elements. * Critical for deep SD traversal - ensures constraints are * evaluated on the correct elements even for complex types. * * Key Features: * - Match resource paths to SD element definitions * - Handle polymorphic types (value[x]) * - Support slicing discriminators * - Resolve element inheritance */ import type { StructureDefinition, ElementDefinition } from '../core/structure-definition-types'; export interface MatchedElement { /** The SD element definition */ element: ElementDefinition; /** The actual data from the resource */ data: any; /** Full path in the resource (with indices) */ resourcePath: string; /** Path in the SD */ sdPath: string; /** Whether this is an array item */ isArrayItem: boolean; /** Index if array item */ index?: number; } export interface MatchResult { /** All matched elements */ matches: MatchedElement[]; /** Elements with constraints */ constraintElements: MatchedElement[]; /** Unmatched paths in resource (potential unknown elements) */ unmatchedPaths: string[]; } export declare class SDElementMatcher { private elementMapCache; /** * Match all resource data to SD elements */ match(resource: any, structureDef: StructureDefinition): MatchResult; /** * Build a map of SD elements by path */ private getElementMap; private buildElementMap; /** * Recursively traverse resource and match to SD elements */ private traverseAndMatch; /** * Find matching SD element for a resource path */ private findMatchingElement; /** * Get all elements that need constraint evaluation */ getConstraintTargets(resource: any, structureDef: StructureDefinition): MatchedElement[]; } export declare const sdElementMatcher: SDElementMatcher; //# sourceMappingURL=sd-element-matcher.d.ts.map