export interface ChoiceTypeCastResolution { /** Skip the constraint entirely (fail open) — concrete type matches no cast. */ skip: boolean; /** Expression to evaluate (cast may be stripped when it is a verified no-op). */ expression: string; } /** * Resolve how a constraint that narrows a polymorphic `value[x]` via * `as`/`ofType` should be handled, given the instance's concrete type. * * fhirpath.js cannot type a bare choice value without a model annotation, so * `($this as dateTime)` returns empty even when the instance *is* a dateTime, * silently dropping the check. Two outcomes: * * - Concrete type matches none of the cast targets → skip (Java does the same; * evaluating would turn a type-guard into a spurious violation). * - Concrete type matches the single cast target → strip the cast (it is a * verified no-op: `$this as dateTime` ≡ `$this` when `$this` is a dateTime), * so the rest of the expression actually evaluates. * * Mixed-target expressions (`(value as Quantity) or (value as string)`) are * left untouched to avoid unsafe rewrites. */ export declare function resolveChoiceTypeCast(expression: string, matched: any): ChoiceTypeCastResolution; /** * Derive the concrete choice type from the matched element's resource path. * The element matcher records the concrete property (`Observation.valueQuantity`) * as `resourcePath` while the SD path stays polymorphic (`Observation.value[x]`), * so the suffix is an unambiguous type discriminator — robust where the * structural `inferChoiceRuntimeType` heuristic is blind (primitives, Coding, * Identifier, Range, Money, …). */ export declare function deriveChoiceTypeFromConcretePath(matched: any): string | null; export declare function prepareElementContext(context: any, expression: string): any; //# sourceMappingURL=sd-fhirpath-choice-utils.d.ts.map