Coverage for src/lumen/derivation/models.py: 100%
10 statements
« prev ^ index » next coverage.py v7.16.0, created at 2026-08-31 18:46 +0000
« prev ^ index » next coverage.py v7.16.0, created at 2026-08-31 18:46 +0000
1"""
2This file defines the data representation for a single derivation rule.
3"""
5from __future__ import annotations
7from dataclasses import dataclass
10@dataclass(frozen=True)
11class DerivationRuleDef:
12 resource_type: str
13 target_path: str # top-level element to fill in, e.g. "category"
14 source_path: str # FHIRPath evaluated for Coding values, e.g. "type.coding"
15 concept_map_url: str # canonical URL of the ConceptMap to translate through
16 description: str = ""
17 # True when target_path is a FHIR collection (max cardinality > 1, e.g.
18 # DocumentReference.category): the engine appends a CodeableConcept to the
19 # list instead of assigning a single one.
20 target_is_list: bool = False