File tree Expand file tree Collapse file tree
src/Component/FHIRPath/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ namespace Ardenexal \FHIRTools \Component \FHIRPath \Exception ;
6+
7+ /**
8+ * Exception thrown when a FHIRPath expression is semantically invalid.
9+ *
10+ * Raised during strict-mode evaluation for type errors that can only be
11+ * detected at runtime, such as accessing an undefined property on a typed
12+ * FHIR model, mismatched resource-type filters, or order-sensitive functions
13+ * applied to unordered collections.
14+ *
15+ * Extends FHIRPathException so existing catch blocks continue to work.
16+ *
17+ * @author FHIR Tools Contributors
18+ */
19+ class FHIRPathSemanticException extends FHIRPathException
20+ {
21+ }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ namespace Ardenexal \FHIRTools \Component \FHIRPath \Type ;
6+
7+ /**
8+ * Wraps a raw FHIR data array with its canonical FHIR type name.
9+ *
10+ * Raw PHP arrays from FHIR resource deserialization lose their FHIR type context
11+ * when accessed via property navigation. This wrapper preserves that context so
12+ * that ofType(), is(), and type() can correctly identify complex FHIR types
13+ * (e.g. HumanName, Extension, Age) even when the underlying value is a plain array.
14+ *
15+ * FHIRPath navigation delegates through the underlying array transparently:
16+ * navigateProperty(FHIRTypedCollection, 'family') → navigateProperty($value->value, 'family')
17+ *
18+ * Consumers that need the underlying data call normalizeValue() or access
19+ * the public $value property directly.
20+ */
21+ final class FHIRTypedCollection
22+ {
23+ /**
24+ * @param array<array-key, mixed> $value The raw FHIR data array
25+ * @param string $fhirType The canonical FHIR type name (e.g. 'HumanName', 'Extension', 'Age')
26+ */
27+ public function __construct (
28+ public readonly array $ value ,
29+ public readonly string $ fhirType ,
30+ ) {
31+ }
32+ }
You can’t perform that action at this time.
0 commit comments