fhir-runtime 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (124) hide show
  1. package/CHANGELOG.md +211 -0
  2. package/LICENSE +21 -0
  3. package/README.md +261 -0
  4. package/dist/cjs/index.cjs +7368 -0
  5. package/dist/cjs/index.cjs.map +7 -0
  6. package/dist/cjs/index.d.ts +4224 -0
  7. package/dist/cjs/package.json +5 -0
  8. package/dist/esm/index.d.ts +4224 -0
  9. package/dist/esm/index.mjs +7250 -0
  10. package/dist/esm/index.mjs.map +7 -0
  11. package/dist/esm/package.json +5 -0
  12. package/dist/index.d.ts +4224 -0
  13. package/dist/lib/context/bundle-loader.d.ts +124 -0
  14. package/dist/lib/context/bundle-loader.d.ts.map +1 -0
  15. package/dist/lib/context/core-definitions/index.d.ts +72 -0
  16. package/dist/lib/context/core-definitions/index.d.ts.map +1 -0
  17. package/dist/lib/context/errors.d.ts +114 -0
  18. package/dist/lib/context/errors.d.ts.map +1 -0
  19. package/dist/lib/context/fhir-context.d.ts +72 -0
  20. package/dist/lib/context/fhir-context.d.ts.map +1 -0
  21. package/dist/lib/context/index.d.ts +21 -0
  22. package/dist/lib/context/index.d.ts.map +1 -0
  23. package/dist/lib/context/inheritance-resolver.d.ts +98 -0
  24. package/dist/lib/context/inheritance-resolver.d.ts.map +1 -0
  25. package/dist/lib/context/inner-type-extractor.d.ts +80 -0
  26. package/dist/lib/context/inner-type-extractor.d.ts.map +1 -0
  27. package/dist/lib/context/loaders/composite-loader.d.ts +47 -0
  28. package/dist/lib/context/loaders/composite-loader.d.ts.map +1 -0
  29. package/dist/lib/context/loaders/file-loader.d.ts +47 -0
  30. package/dist/lib/context/loaders/file-loader.d.ts.map +1 -0
  31. package/dist/lib/context/loaders/index.d.ts +11 -0
  32. package/dist/lib/context/loaders/index.d.ts.map +1 -0
  33. package/dist/lib/context/loaders/memory-loader.d.ts +42 -0
  34. package/dist/lib/context/loaders/memory-loader.d.ts.map +1 -0
  35. package/dist/lib/context/registry.d.ts +116 -0
  36. package/dist/lib/context/registry.d.ts.map +1 -0
  37. package/dist/lib/context/types.d.ts +266 -0
  38. package/dist/lib/context/types.d.ts.map +1 -0
  39. package/dist/lib/fhirpath/atoms.d.ts +228 -0
  40. package/dist/lib/fhirpath/atoms.d.ts.map +1 -0
  41. package/dist/lib/fhirpath/cache.d.ts +79 -0
  42. package/dist/lib/fhirpath/cache.d.ts.map +1 -0
  43. package/dist/lib/fhirpath/date.d.ts +17 -0
  44. package/dist/lib/fhirpath/date.d.ts.map +1 -0
  45. package/dist/lib/fhirpath/functions.d.ts +28 -0
  46. package/dist/lib/fhirpath/functions.d.ts.map +1 -0
  47. package/dist/lib/fhirpath/index.d.ts +20 -0
  48. package/dist/lib/fhirpath/index.d.ts.map +1 -0
  49. package/dist/lib/fhirpath/lexer/parse.d.ts +100 -0
  50. package/dist/lib/fhirpath/lexer/parse.d.ts.map +1 -0
  51. package/dist/lib/fhirpath/lexer/tokenize.d.ts +80 -0
  52. package/dist/lib/fhirpath/lexer/tokenize.d.ts.map +1 -0
  53. package/dist/lib/fhirpath/parse.d.ts +101 -0
  54. package/dist/lib/fhirpath/parse.d.ts.map +1 -0
  55. package/dist/lib/fhirpath/tokenize.d.ts +20 -0
  56. package/dist/lib/fhirpath/tokenize.d.ts.map +1 -0
  57. package/dist/lib/fhirpath/types.d.ts +111 -0
  58. package/dist/lib/fhirpath/types.d.ts.map +1 -0
  59. package/dist/lib/fhirpath/utils.d.ts +81 -0
  60. package/dist/lib/fhirpath/utils.d.ts.map +1 -0
  61. package/dist/lib/index.d.ts +24 -0
  62. package/dist/lib/index.d.ts.map +1 -0
  63. package/dist/lib/model/canonical-profile.d.ts +381 -0
  64. package/dist/lib/model/canonical-profile.d.ts.map +1 -0
  65. package/dist/lib/model/element-definition.d.ts +503 -0
  66. package/dist/lib/model/element-definition.d.ts.map +1 -0
  67. package/dist/lib/model/index.d.ts +14 -0
  68. package/dist/lib/model/index.d.ts.map +1 -0
  69. package/dist/lib/model/primitives.d.ts +464 -0
  70. package/dist/lib/model/primitives.d.ts.map +1 -0
  71. package/dist/lib/model/structure-definition.d.ts +263 -0
  72. package/dist/lib/model/structure-definition.d.ts.map +1 -0
  73. package/dist/lib/parser/choice-type-parser.d.ts +182 -0
  74. package/dist/lib/parser/choice-type-parser.d.ts.map +1 -0
  75. package/dist/lib/parser/index.d.ts +16 -0
  76. package/dist/lib/parser/index.d.ts.map +1 -0
  77. package/dist/lib/parser/json-parser.d.ts +171 -0
  78. package/dist/lib/parser/json-parser.d.ts.map +1 -0
  79. package/dist/lib/parser/parse-error.d.ts +146 -0
  80. package/dist/lib/parser/parse-error.d.ts.map +1 -0
  81. package/dist/lib/parser/primitive-parser.d.ts +136 -0
  82. package/dist/lib/parser/primitive-parser.d.ts.map +1 -0
  83. package/dist/lib/parser/serializer.d.ts +64 -0
  84. package/dist/lib/parser/serializer.d.ts.map +1 -0
  85. package/dist/lib/parser/structure-definition-parser.d.ts +63 -0
  86. package/dist/lib/parser/structure-definition-parser.d.ts.map +1 -0
  87. package/dist/lib/profile/canonical-builder.d.ts +87 -0
  88. package/dist/lib/profile/canonical-builder.d.ts.map +1 -0
  89. package/dist/lib/profile/constraint-merger.d.ts +100 -0
  90. package/dist/lib/profile/constraint-merger.d.ts.map +1 -0
  91. package/dist/lib/profile/element-merger.d.ts +80 -0
  92. package/dist/lib/profile/element-merger.d.ts.map +1 -0
  93. package/dist/lib/profile/element-sorter.d.ts +81 -0
  94. package/dist/lib/profile/element-sorter.d.ts.map +1 -0
  95. package/dist/lib/profile/errors.d.ts +150 -0
  96. package/dist/lib/profile/errors.d.ts.map +1 -0
  97. package/dist/lib/profile/index.d.ts +27 -0
  98. package/dist/lib/profile/index.d.ts.map +1 -0
  99. package/dist/lib/profile/path-utils.d.ts +180 -0
  100. package/dist/lib/profile/path-utils.d.ts.map +1 -0
  101. package/dist/lib/profile/slicing-handler.d.ts +121 -0
  102. package/dist/lib/profile/slicing-handler.d.ts.map +1 -0
  103. package/dist/lib/profile/snapshot-generator.d.ts +73 -0
  104. package/dist/lib/profile/snapshot-generator.d.ts.map +1 -0
  105. package/dist/lib/profile/types.d.ts +220 -0
  106. package/dist/lib/profile/types.d.ts.map +1 -0
  107. package/dist/lib/validator/errors.d.ts +83 -0
  108. package/dist/lib/validator/errors.d.ts.map +1 -0
  109. package/dist/lib/validator/index.d.ts +23 -0
  110. package/dist/lib/validator/index.d.ts.map +1 -0
  111. package/dist/lib/validator/invariant-validator.d.ts +62 -0
  112. package/dist/lib/validator/invariant-validator.d.ts.map +1 -0
  113. package/dist/lib/validator/path-extractor.d.ts +123 -0
  114. package/dist/lib/validator/path-extractor.d.ts.map +1 -0
  115. package/dist/lib/validator/slicing-validator.d.ts +119 -0
  116. package/dist/lib/validator/slicing-validator.d.ts.map +1 -0
  117. package/dist/lib/validator/structure-validator.d.ts +74 -0
  118. package/dist/lib/validator/structure-validator.d.ts.map +1 -0
  119. package/dist/lib/validator/types.d.ts +288 -0
  120. package/dist/lib/validator/types.d.ts.map +1 -0
  121. package/dist/lib/validator/validation-rules.d.ts +198 -0
  122. package/dist/lib/validator/validation-rules.d.ts.map +1 -0
  123. package/dist/tsdoc-metadata.json +11 -0
  124. package/package.json +76 -0
@@ -0,0 +1,503 @@
1
+ /**
2
+ * FHIR R4 ElementDefinition Model
3
+ *
4
+ * Defines the complete ElementDefinition complex type as per the FHIR R4
5
+ * specification, including all sub-types (Slicing, Discriminator, Base,
6
+ * Type, Constraint, Binding, Example, Mapping).
7
+ *
8
+ * ElementDefinition is the most complex data type in FHIR. It appears inside
9
+ * StructureDefinition.snapshot.element and StructureDefinition.differential.element,
10
+ * and carries all constraint information for a single element path.
11
+ *
12
+ * @see https://hl7.org/fhir/R4/elementdefinition.html
13
+ * @module fhir-model
14
+ */
15
+ import type { FhirBoolean, FhirCanonical, FhirCode, FhirId, FhirInteger, FhirMarkdown, FhirString, FhirUnsignedInt, FhirUri, PropertyRepresentation, SlicingRules, DiscriminatorType, AggregationMode, ReferenceVersionRules, ConstraintSeverity, BindingStrength, BackboneElement, Coding, Element } from './primitives.js';
16
+ /**
17
+ * How an element is sliced — defines the discriminator(s) and rules
18
+ * for matching slices in an instance.
19
+ * @see https://hl7.org/fhir/R4/elementdefinition-definitions.html#ElementDefinition.slicing
20
+ */
21
+ export interface ElementDefinitionSlicing extends Element {
22
+ /**
23
+ * Element values that are used to distinguish the slices (0..*)
24
+ *
25
+ * Each discriminator specifies a path and a type that together
26
+ * identify which slice a given element instance belongs to.
27
+ */
28
+ discriminator?: SlicingDiscriminator[];
29
+ /** Text description of how slicing works (or in profile determine how slicing is used) (0..1) */
30
+ description?: FhirString;
31
+ /** If elements must be in same order as slices (0..1) */
32
+ ordered?: FhirBoolean;
33
+ /**
34
+ * closed | open | openAtEnd (1..1)
35
+ *
36
+ * - `closed`: no additional content allowed beyond the defined slices
37
+ * - `open`: additional content allowed anywhere
38
+ * - `openAtEnd`: additional content allowed, but only at the end
39
+ * @see https://hl7.org/fhir/R4/valueset-resource-slicing-rules.html
40
+ */
41
+ rules: SlicingRules;
42
+ }
43
+ /**
44
+ * Designates a discriminator to differentiate between slices.
45
+ * @see https://hl7.org/fhir/R4/elementdefinition-definitions.html#ElementDefinition.slicing.discriminator
46
+ */
47
+ export interface SlicingDiscriminator extends Element {
48
+ /**
49
+ * value | exists | pattern | type | profile (1..1)
50
+ * @see https://hl7.org/fhir/R4/valueset-discriminator-type.html
51
+ */
52
+ type: DiscriminatorType;
53
+ /**
54
+ * Path to element value (1..1)
55
+ *
56
+ * A FHIRPath expression that identifies the element within the
57
+ * resource/type to be used as the discriminator.
58
+ */
59
+ path: FhirString;
60
+ }
61
+ /**
62
+ * Information about the base definition of the element, provided to
63
+ * make it unnecessary for tools to trace the deviation of the element
64
+ * through the derived and related profiles.
65
+ * @see https://hl7.org/fhir/R4/elementdefinition-definitions.html#ElementDefinition.base
66
+ */
67
+ export interface ElementDefinitionBase extends Element {
68
+ /** Path that identifies the base element (1..1) */
69
+ path: FhirString;
70
+ /** Min cardinality of the base element (1..1) */
71
+ min: FhirUnsignedInt;
72
+ /**
73
+ * Max cardinality of the base element (1..1)
74
+ *
75
+ * A string value, either a number or "*" for unbounded.
76
+ */
77
+ max: FhirString;
78
+ }
79
+ /**
80
+ * The data type or resource that is a permitted type for the element.
81
+ * @see https://hl7.org/fhir/R4/elementdefinition-definitions.html#ElementDefinition.type
82
+ */
83
+ export interface ElementDefinitionType extends Element {
84
+ /**
85
+ * Data type or Resource (name) (1..1)
86
+ *
87
+ * The URI of the data type or resource, e.g., `http://hl7.org/fhirpath/System.String`
88
+ * for primitives or a simple name like `string`, `Patient`, `Reference`.
89
+ * @see https://hl7.org/fhir/R4/elementdefinition-definitions.html#ElementDefinition.type.code
90
+ */
91
+ code: FhirUri;
92
+ /**
93
+ * Profiles (StructureDefinition or IG) — one of which this type must
94
+ * conform to (0..*)
95
+ * @see https://hl7.org/fhir/R4/elementdefinition-definitions.html#ElementDefinition.type.profile
96
+ */
97
+ profile?: FhirCanonical[];
98
+ /**
99
+ * Profile (StructureDefinition or IG) on the Reference target —
100
+ * one of which the reference must conform to (0..*)
101
+ *
102
+ * Only meaningful when `code` is `Reference` or `canonical`.
103
+ * @see https://hl7.org/fhir/R4/elementdefinition-definitions.html#ElementDefinition.type.targetProfile
104
+ */
105
+ targetProfile?: FhirCanonical[];
106
+ /**
107
+ * contained | referenced | bundled (0..*)
108
+ *
109
+ * How resource references are aggregated. Only meaningful when
110
+ * `code` is `Reference`.
111
+ * @see https://hl7.org/fhir/R4/valueset-resource-aggregation-mode.html
112
+ */
113
+ aggregation?: AggregationMode[];
114
+ /**
115
+ * either | independent | specific (0..1)
116
+ *
117
+ * Whether references need to be version-specific.
118
+ * @see https://hl7.org/fhir/R4/valueset-reference-version-rules.html
119
+ */
120
+ versioning?: ReferenceVersionRules;
121
+ }
122
+ /**
123
+ * Formal constraints (invariants) on the element that must be satisfied
124
+ * for the element to be valid.
125
+ * @see https://hl7.org/fhir/R4/elementdefinition-definitions.html#ElementDefinition.constraint
126
+ */
127
+ export interface ElementDefinitionConstraint extends Element {
128
+ /**
129
+ * Target of 'condition' reference (1..1)
130
+ *
131
+ * Unique identifier for the constraint, used by `condition` fields
132
+ * to reference which constraints apply.
133
+ */
134
+ key: FhirId;
135
+ /** Why this constraint is necessary or appropriate (0..1) */
136
+ requirements?: FhirString;
137
+ /**
138
+ * error | warning (1..1)
139
+ * @see https://hl7.org/fhir/R4/valueset-constraint-severity.html
140
+ */
141
+ severity: ConstraintSeverity;
142
+ /** Human description of constraint (1..1) */
143
+ human: FhirString;
144
+ /**
145
+ * FHIRPath expression of constraint (0..1)
146
+ *
147
+ * A FHIRPath expression that must evaluate to `true` when
148
+ * tested against the element and its children.
149
+ */
150
+ expression?: FhirString;
151
+ /**
152
+ * XPath expression of constraint (0..1)
153
+ *
154
+ * Deprecated in favor of `expression` (FHIRPath), but retained
155
+ * for backward compatibility with older profiles.
156
+ */
157
+ xpath?: FhirString;
158
+ /**
159
+ * Reference to original source of constraint (0..1)
160
+ *
161
+ * Canonical URL of the StructureDefinition where this constraint
162
+ * was originally defined.
163
+ */
164
+ source?: FhirCanonical;
165
+ }
166
+ /**
167
+ * Binds an element to a specific value set, indicating the degree of
168
+ * conformance expectation.
169
+ * @see https://hl7.org/fhir/R4/elementdefinition-definitions.html#ElementDefinition.binding
170
+ */
171
+ export interface ElementDefinitionBinding extends Element {
172
+ /**
173
+ * required | extensible | preferred | example (1..1)
174
+ *
175
+ * Indicates the degree of conformance expectations associated with
176
+ * this binding. Only `required` means mandatory in FHIR.
177
+ * @see https://hl7.org/fhir/R4/valueset-binding-strength.html
178
+ */
179
+ strength: BindingStrength;
180
+ /** Human explanation of the value set (0..1) */
181
+ description?: FhirString;
182
+ /**
183
+ * Source of value set (0..1)
184
+ *
185
+ * Canonical URL reference to the value set bound to this element.
186
+ */
187
+ valueSet?: FhirCanonical;
188
+ }
189
+ /**
190
+ * A sample value for the element, providing an example for implementers.
191
+ * @see https://hl7.org/fhir/R4/elementdefinition-definitions.html#ElementDefinition.example
192
+ */
193
+ export interface ElementDefinitionExample extends Element {
194
+ /** Describes the purpose of this example (1..1) */
195
+ label: FhirString;
196
+ /**
197
+ * Value of Example (1..1)
198
+ *
199
+ * Choice type [x] — the actual property name in JSON will be
200
+ * `valueString`, `valueBoolean`, `valueCoding`, etc.
201
+ * Can be any FHIR data type.
202
+ *
203
+ * Stage-1: represented as `unknown`; fhir-parser will handle
204
+ * concrete dispatch in Phase 2.
205
+ */
206
+ value: unknown;
207
+ }
208
+ /**
209
+ * Identifies a concept from an external specification that roughly
210
+ * corresponds to this element.
211
+ * @see https://hl7.org/fhir/R4/elementdefinition-definitions.html#ElementDefinition.mapping
212
+ */
213
+ export interface ElementDefinitionMapping extends Element {
214
+ /**
215
+ * Reference to mapping declaration (1..1)
216
+ *
217
+ * An internal reference to the StructureDefinition.mapping.identity
218
+ * that this element mapping refers to.
219
+ */
220
+ identity: FhirId;
221
+ /** Computable language of mapping (0..1) */
222
+ language?: FhirCode;
223
+ /** Details of the mapping (1..1) */
224
+ map: FhirString;
225
+ /** Comments about the mapping (0..1) */
226
+ comment?: FhirString;
227
+ }
228
+ /**
229
+ * Captures constraints on each element within a resource, data type,
230
+ * or extension.
231
+ *
232
+ * ElementDefinition is the most complex data type in FHIR. Each instance
233
+ * describes a single element path (e.g., `Patient.name`, `Patient.name.given`)
234
+ * and carries all constraint information: cardinality, types, bindings,
235
+ * invariants, slicing, flags, and documentation.
236
+ *
237
+ * ElementDefinition appears in:
238
+ * - `StructureDefinition.snapshot.element` (complete, flattened)
239
+ * - `StructureDefinition.differential.element` (delta only)
240
+ *
241
+ * This interface extends BackboneElement (has `id`, `extension`,
242
+ * `modifierExtension`).
243
+ *
244
+ * @see https://hl7.org/fhir/R4/elementdefinition.html
245
+ */
246
+ export interface ElementDefinition extends BackboneElement {
247
+ /**
248
+ * Path of the element in the hierarchy of elements (1..1)
249
+ *
250
+ * The path is dot-separated, e.g., `Patient.name.given`.
251
+ * The first element in a snapshot always has a path equal to the
252
+ * resource/type name (e.g., `Patient`).
253
+ * @see https://hl7.org/fhir/R4/elementdefinition-definitions.html#ElementDefinition.path
254
+ */
255
+ path: FhirString;
256
+ /**
257
+ * How this element is represented in instances (0..*)
258
+ *
259
+ * Controls serialization format (mainly relevant for XML).
260
+ * @see https://hl7.org/fhir/R4/valueset-property-representation.html
261
+ */
262
+ representation?: PropertyRepresentation[];
263
+ /**
264
+ * Name for this particular element (in a set of slices) (0..1)
265
+ *
266
+ * Unique within the context of the containing element. Used to
267
+ * identify slices in a slicing definition.
268
+ * @see https://hl7.org/fhir/R4/elementdefinition-definitions.html#ElementDefinition.sliceName
269
+ */
270
+ sliceName?: FhirString;
271
+ /**
272
+ * If this slice definition constrains an inherited slice definition
273
+ * (or not) (0..1)
274
+ * @see https://hl7.org/fhir/R4/elementdefinition-definitions.html#ElementDefinition.sliceIsConstraining
275
+ */
276
+ sliceIsConstraining?: FhirBoolean;
277
+ /**
278
+ * Name for element to display with or prompt for element (0..1)
279
+ * @see https://hl7.org/fhir/R4/elementdefinition-definitions.html#ElementDefinition.label
280
+ */
281
+ label?: FhirString;
282
+ /**
283
+ * Corresponding codes in terminologies (0..*)
284
+ *
285
+ * Codes that define the meaning of this element, e.g., LOINC or
286
+ * SNOMED CT codes. Used for mapping and search.
287
+ * @see https://hl7.org/fhir/R4/elementdefinition-definitions.html#ElementDefinition.code
288
+ */
289
+ code?: Coding[];
290
+ /**
291
+ * This element is sliced — slices follow (0..1)
292
+ *
293
+ * Defines how this element can be divided into a set of slices.
294
+ * Only appears on the "slicing root" element; individual slices
295
+ * are identified by `sliceName`.
296
+ * @see https://hl7.org/fhir/R4/elementdefinition-definitions.html#ElementDefinition.slicing
297
+ */
298
+ slicing?: ElementDefinitionSlicing;
299
+ /**
300
+ * Concise definition for space-constrained presentations (0..1)
301
+ * @see https://hl7.org/fhir/R4/elementdefinition-definitions.html#ElementDefinition.short
302
+ */
303
+ short?: FhirString;
304
+ /**
305
+ * Full formal definition of the element (0..1)
306
+ * @see https://hl7.org/fhir/R4/elementdefinition-definitions.html#ElementDefinition.definition
307
+ */
308
+ definition?: FhirMarkdown;
309
+ /**
310
+ * Comments about the use of this element (0..1)
311
+ * @see https://hl7.org/fhir/R4/elementdefinition-definitions.html#ElementDefinition.comment
312
+ */
313
+ comment?: FhirMarkdown;
314
+ /**
315
+ * Why this resource has been created (0..1)
316
+ * @see https://hl7.org/fhir/R4/elementdefinition-definitions.html#ElementDefinition.requirements
317
+ */
318
+ requirements?: FhirMarkdown;
319
+ /**
320
+ * Other names (0..*)
321
+ * @see https://hl7.org/fhir/R4/elementdefinition-definitions.html#ElementDefinition.alias
322
+ */
323
+ alias?: FhirString[];
324
+ /**
325
+ * Minimum cardinality (0..1)
326
+ * @see https://hl7.org/fhir/R4/elementdefinition-definitions.html#ElementDefinition.min
327
+ */
328
+ min?: FhirUnsignedInt;
329
+ /**
330
+ * Maximum cardinality (number or "*") (0..1)
331
+ *
332
+ * A string value: either a non-negative integer or `"*"` for unbounded.
333
+ * @see https://hl7.org/fhir/R4/elementdefinition-definitions.html#ElementDefinition.max
334
+ */
335
+ max?: FhirString;
336
+ /**
337
+ * Base definition information for tools (0..1)
338
+ *
339
+ * Records the cardinality and path from the base StructureDefinition,
340
+ * so tools can show what has changed in a derived profile without
341
+ * needing to trace the full inheritance chain.
342
+ * @see https://hl7.org/fhir/R4/elementdefinition-definitions.html#ElementDefinition.base
343
+ */
344
+ base?: ElementDefinitionBase;
345
+ /**
346
+ * Reference to definition of content for the element (0..1)
347
+ *
348
+ * A URI that points to another element within the same
349
+ * StructureDefinition, in the form `#<elementId>`. Indicates that
350
+ * this element has the same meaning and constraints as the
351
+ * referenced element.
352
+ * @see https://hl7.org/fhir/R4/elementdefinition-definitions.html#ElementDefinition.contentReference
353
+ */
354
+ contentReference?: FhirUri;
355
+ /**
356
+ * Data type and profile for this element (0..*)
357
+ *
358
+ * Defines the allowed types for this element. Multiple entries
359
+ * indicate a choice type (e.g., value[x] can be valueString,
360
+ * valueInteger, etc.).
361
+ * @see https://hl7.org/fhir/R4/elementdefinition-definitions.html#ElementDefinition.type
362
+ */
363
+ type?: ElementDefinitionType[];
364
+ /**
365
+ * Specified value if missing from instance (0..1)
366
+ *
367
+ * Choice type [x] — the actual JSON property will be
368
+ * `defaultValueString`, `defaultValueBoolean`, etc.
369
+ * Can be any FHIR data type.
370
+ *
371
+ * Stage-1: represented as `unknown`; fhir-parser will handle
372
+ * concrete dispatch in Phase 2.
373
+ * @see https://hl7.org/fhir/R4/elementdefinition-definitions.html#ElementDefinition.defaultValue_x_
374
+ */
375
+ defaultValue?: unknown;
376
+ /**
377
+ * Implicit meaning when this element is missing (0..1)
378
+ * @see https://hl7.org/fhir/R4/elementdefinition-definitions.html#ElementDefinition.meaningWhenMissing
379
+ */
380
+ meaningWhenMissing?: FhirMarkdown;
381
+ /**
382
+ * What the order of the elements means (0..1)
383
+ * @see https://hl7.org/fhir/R4/elementdefinition-definitions.html#ElementDefinition.orderMeaning
384
+ */
385
+ orderMeaning?: FhirString;
386
+ /**
387
+ * Value must be exactly this (0..1)
388
+ *
389
+ * Choice type [x] — `fixedString`, `fixedCoding`, etc.
390
+ * If present, the element value in instances MUST match exactly.
391
+ *
392
+ * Stage-1: represented as `unknown`; fhir-parser will handle
393
+ * concrete dispatch in Phase 2.
394
+ * @see https://hl7.org/fhir/R4/elementdefinition-definitions.html#ElementDefinition.fixed_x_
395
+ */
396
+ fixed?: unknown;
397
+ /**
398
+ * Value must have at least these property values (0..1)
399
+ *
400
+ * Choice type [x] — `patternCodeableConcept`, `patternString`, etc.
401
+ * More lenient than `fixed`: the instance value must contain at least
402
+ * the properties and values specified by the pattern.
403
+ *
404
+ * Stage-1: represented as `unknown`; fhir-parser will handle
405
+ * concrete dispatch in Phase 2.
406
+ * @see https://hl7.org/fhir/R4/elementdefinition-definitions.html#ElementDefinition.pattern_x_
407
+ */
408
+ pattern?: unknown;
409
+ /**
410
+ * Example value (as defined for type) (0..*)
411
+ * @see https://hl7.org/fhir/R4/elementdefinition-definitions.html#ElementDefinition.example
412
+ */
413
+ example?: ElementDefinitionExample[];
414
+ /**
415
+ * Minimum allowed value (for some types) (0..1)
416
+ *
417
+ * Choice type [x] — `minValueDate`, `minValueInteger`, etc.
418
+ * Only applicable to: date, dateTime, instant, time, decimal,
419
+ * integer, positiveInt, unsignedInt, Quantity.
420
+ *
421
+ * Stage-1: represented as `unknown`; fhir-parser will handle
422
+ * concrete dispatch in Phase 2.
423
+ * @see https://hl7.org/fhir/R4/elementdefinition-definitions.html#ElementDefinition.minValue_x_
424
+ */
425
+ minValue?: unknown;
426
+ /**
427
+ * Maximum allowed value (for some types) (0..1)
428
+ *
429
+ * Choice type [x] — `maxValueDate`, `maxValueInteger`, etc.
430
+ * Same type restrictions as `minValue`.
431
+ *
432
+ * Stage-1: represented as `unknown`; fhir-parser will handle
433
+ * concrete dispatch in Phase 2.
434
+ * @see https://hl7.org/fhir/R4/elementdefinition-definitions.html#ElementDefinition.maxValue_x_
435
+ */
436
+ maxValue?: unknown;
437
+ /**
438
+ * Max length for strings (0..1)
439
+ * @see https://hl7.org/fhir/R4/elementdefinition-definitions.html#ElementDefinition.maxLength
440
+ */
441
+ maxLength?: FhirInteger;
442
+ /**
443
+ * Reference to invariant about presence (0..*)
444
+ *
445
+ * A list of constraint keys (`ElementDefinitionConstraint.key`) that
446
+ * are conditions on this element. When a constraint evaluates to false,
447
+ * the element is not valid.
448
+ * @see https://hl7.org/fhir/R4/elementdefinition-definitions.html#ElementDefinition.condition
449
+ */
450
+ condition?: FhirId[];
451
+ /**
452
+ * Condition that must evaluate to true (0..*)
453
+ *
454
+ * Formal constraints (invariants) that must be met for the element
455
+ * to be valid. Expressed as FHIRPath expressions.
456
+ * @see https://hl7.org/fhir/R4/elementdefinition-definitions.html#ElementDefinition.constraint
457
+ */
458
+ constraint?: ElementDefinitionConstraint[];
459
+ /**
460
+ * If the element must be supported (0..1)
461
+ *
462
+ * When `true`, implementations claiming conformance to this profile
463
+ * MUST "meaningfully support" this element. The exact meaning of
464
+ * mustSupport is defined per implementation guide.
465
+ * @see https://hl7.org/fhir/R4/elementdefinition-definitions.html#ElementDefinition.mustSupport
466
+ */
467
+ mustSupport?: FhirBoolean;
468
+ /**
469
+ * If this modifies the meaning of other elements (0..1)
470
+ *
471
+ * Modifier elements can change the interpretation of the containing
472
+ * resource or element. Implementations MUST understand modifier elements.
473
+ * @see https://hl7.org/fhir/R4/elementdefinition-definitions.html#ElementDefinition.isModifier
474
+ */
475
+ isModifier?: FhirBoolean;
476
+ /**
477
+ * Reason that this element is marked as a modifier (0..1)
478
+ * @see https://hl7.org/fhir/R4/elementdefinition-definitions.html#ElementDefinition.isModifierReason
479
+ */
480
+ isModifierReason?: FhirString;
481
+ /**
482
+ * Include when _summary = true? (0..1)
483
+ * @see https://hl7.org/fhir/R4/elementdefinition-definitions.html#ElementDefinition.isSummary
484
+ */
485
+ isSummary?: FhirBoolean;
486
+ /**
487
+ * ValueSet details if this is coded (0..1)
488
+ *
489
+ * Binds this element to a specific value set. The `strength`
490
+ * determines how strictly the binding applies.
491
+ * @see https://hl7.org/fhir/R4/elementdefinition-definitions.html#ElementDefinition.binding
492
+ */
493
+ binding?: ElementDefinitionBinding;
494
+ /**
495
+ * Map element to another set of definitions (0..*)
496
+ *
497
+ * Identifies a concept from an external specification (e.g., v2,
498
+ * CDA, or a custom mapping) that corresponds to this element.
499
+ * @see https://hl7.org/fhir/R4/elementdefinition-definitions.html#ElementDefinition.mapping
500
+ */
501
+ mapping?: ElementDefinitionMapping[];
502
+ }
503
+ //# sourceMappingURL=element-definition.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"element-definition.d.ts","sourceRoot":"","sources":["../../../src/model/element-definition.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EACV,WAAW,EACX,aAAa,EACb,QAAQ,EACR,MA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;;OAOG;IACH,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IAErB;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,2BAA2B,EAAE,CAAC;IAI3C;;;;;;;OAOG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;IAE1B;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,WAAW,CAAC;IAEzB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,UAAU,CAAC;IAE9B;;;OAGG;IACH,SAAS,CAAC,EAAE,WAAW,CAAC;IAIxB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,wBAAwB,CAAC;IAInC;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,wBAAwB,EAAE,CAAC;CACtC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * fhir-model — Unified exports for all FHIR R4 type definitions
3
+ *
4
+ * This barrel file re-exports every public type from the model layer.
5
+ * Import order follows the dependency chain:
6
+ * primitives → element-definition → structure-definition → canonical-profile
7
+ *
8
+ * @module fhir-model
9
+ */
10
+ export type { FhirBoolean, FhirInteger, FhirString, FhirDecimal, FhirUri, FhirUrl, FhirCanonical, FhirBase64Binary, FhirInstant, FhirDate, FhirDateTime, FhirTime, FhirCode, FhirOid, FhirId, FhirMarkdown, FhirUnsignedInt, FhirPositiveInt, FhirUuid, FhirXhtml, PublicationStatus, StructureDefinitionKind, TypeDerivationRule, ExtensionContextType, FhirVersionCode, PropertyRepresentation, SlicingRules, DiscriminatorType, AggregationMode, ReferenceVersionRules, ConstraintSeverity, BindingStrength, NarrativeStatus, Element, Extension, Coding, CodeableConcept, Identifier, Period, Reference, ContactDetail, ContactPoint, UsageContext, Quantity, Narrative, Meta, Resource, DomainResource, BackboneElement, } from './primitives.js';
11
+ export type { ElementDefinition, ElementDefinitionSlicing, SlicingDiscriminator, ElementDefinitionBase, ElementDefinitionType, ElementDefinitionConstraint, ElementDefinitionBinding, ElementDefinitionExample, ElementDefinitionMapping, } from './element-definition.js';
12
+ export type { StructureDefinition, StructureDefinitionMapping, StructureDefinitionContext, StructureDefinitionSnapshot, StructureDefinitionDifferential, } from './structure-definition.js';
13
+ export type { CanonicalProfile, CanonicalElement, TypeConstraint, BindingConstraint, Invariant, SlicingDefinition, SlicingDiscriminatorDef, } from './canonical-profile.js';
14
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/model/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,YAAY,EAEV,WAAW,EACX,WAAW,EACX,UAAU,EACV,WAAW,EACX,OAAO,EACP,OAAO,EACP,aAAa,EACb,gBAAgB,EAChB,WAAW,EACX,QAAQ,EACR,YAAY,EACZ,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,MAAM,EACN,YAAY,EACZ,eAAe,EACf,eAAe,EACf,QAAQ,EACR,SAAS,EAGT,iBAAiB,EACjB,uBAAuB,EACvB,kBAAkB,EAClB,oBAAoB,EACpB,eAAe,EACf,sBAAsB,EACtB,YAAY,EACZ,iBAAiB,EACjB,eAAe,EACf,qBAAqB,EACrB,kBAAkB,EAClB,eAAe,EACf,eAAe,EAGf,OAAO,EACP,SAAS,EACT,MAAM,EACN,eAAe,EACf,UAAU,EACV,MAAM,EACN,SAAS,EACT,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,SAAS,EACT,IAAI,EACJ,QAAQ,EACR,cAAc,EACd,eAAe,GAChB,MAAM,iBAAiB,CAAC;AAGzB,YAAY,EACV,iBAAiB,EACjB,wBAAwB,EACxB,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,EACrB,2BAA2B,EAC3B,wBAAwB,EACxB,wBAAwB,EACxB,wBAAwB,GACzB,MAAM,yBAAyB,CAAC;AAGjC,YAAY,EACV,mBAAmB,EACnB,0BAA0B,EAC1B,0BAA0B,EAC1B,2BAA2B,EAC3B,+BAA+B,GAChC,MAAM,2BAA2B,CAAC;AAGnC,YAAY,EACV,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,SAAS,EACT,iBAAiB,EACjB,uBAAuB,GACxB,MAAM,wBAAwB,CAAC"}