babelfhir-ts 1.1.3 → 1.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.
- package/README.md +92 -26
- package/out/fhir-r4.d.ts +4 -0
- package/out/fhir-r4b.d.ts +700 -0
- package/out/src/generator/core/constants.js +77 -2
- package/out/src/generator/core/fhirTypes.js +8 -0
- package/out/src/generator/core/sdDiagnostics.js +108 -0
- package/out/src/generator/core/utils.js +22 -2
- package/out/src/generator/emitters/class/classGenerator.js +120 -258
- package/out/src/generator/emitters/class/classGeneratorHelpers.js +122 -0
- package/out/src/generator/emitters/class/classGeneratorTypes.js +4 -0
- package/out/src/generator/emitters/class/classHeuristics.js +19 -0
- package/out/src/generator/emitters/class/classTemplate.js +121 -0
- package/out/src/generator/emitters/class/enrichResourceBundleHandler.js +256 -0
- package/out/src/generator/emitters/class/enrichResourceFixers.js +184 -0
- package/out/src/generator/emitters/class/enrichResourceHandlers.js +84 -151
- package/out/src/generator/emitters/class/enrichResourceObservationHandler.js +254 -0
- package/out/src/generator/emitters/class/enrichResourceTemplate.js +110 -327
- package/out/src/generator/emitters/class/fieldPatternExtractor.js +103 -18
- package/out/src/generator/emitters/class/randomSupportGenerator.js +2 -1
- package/out/src/generator/emitters/class/randomUtilitiesTemplate.js +22 -1
- package/out/src/generator/emitters/class/sliceElementDefaults.js +467 -0
- package/out/src/generator/emitters/class/sliceElementGenerator.js +131 -367
- package/out/src/generator/emitters/interface/importManager.js +3 -0
- package/out/src/generator/emitters/interface/interfaceFieldProcessor.js +6 -77
- package/out/src/generator/emitters/interface/interfaceFieldUtils.js +52 -0
- package/out/src/generator/emitters/interface/interfaceGenerator.js +41 -3
- package/out/src/generator/emitters/interface/postProcessExtensions.js +16 -10
- package/out/src/generator/emitters/interface/processFlatField.js +4 -2
- package/out/src/generator/emitters/interface/processNestedField.js +19 -3
- package/out/src/generator/emitters/validator/fhirpathStubInstaller.js +46 -0
- package/out/src/generator/emitters/validator/sliceBackboneValidation.js +370 -0
- package/out/src/generator/emitters/validator/sliceExtensionValidation.js +244 -0
- package/out/src/generator/emitters/validator/sliceValidatorGenerator.js +197 -194
- package/out/src/generator/emitters/validator/sliceValidatorUtils.js +95 -0
- package/out/src/generator/emitters/validator/validatorBindingBuilder.js +304 -0
- package/out/src/generator/emitters/validator/validatorBindingLeafEmitters.js +303 -0
- package/out/src/generator/emitters/validator/validatorConstraintBuilders.js +374 -0
- package/out/src/generator/emitters/validator/validatorFieldBuilders.js +265 -0
- package/out/src/generator/emitters/validator/validatorGenerator.js +90 -382
- package/out/src/generator/emitters/validator/validatorTemplates.js +106 -0
- package/out/src/generator/emitters/validator/validatorTypes.js +1 -0
- package/out/src/generator/emitters/zod/zodRefinementBuilder.js +151 -0
- package/out/src/generator/emitters/zod/zodSchemaGenerator.js +133 -182
- package/out/src/generator/fhir/corePackageResolver.js +288 -0
- package/out/src/generator/fhir/corePackageResolver.ts +371 -0
- package/out/src/generator/fhir/createRules.js +158 -0
- package/out/src/generator/fhir/createRules.ts +188 -0
- package/out/src/generator/fhir/fallback/r4.json +15468 -0
- package/out/src/generator/fhir/fallback/r4b.json +15287 -0
- package/out/src/generator/fhir/r4/base/well-known-system-codes.json +46 -1
- package/out/src/generator/fhir/types.js +55 -12
- package/out/src/generator/fhir/types.ts +71 -16
- package/out/src/generator/fhir/versionRegistry.js +28 -0
- package/out/src/generator/fhir/versionRegistry.ts +45 -0
- package/out/src/generator/generationHelpers.js +202 -0
- package/out/src/generator/index.js +112 -285
- package/out/src/generator/parser/packageParser.js +267 -0
- package/out/src/generator/parser/sdFetcher.js +39 -1
- package/out/src/generator/parser/sdParser.js +65 -6
- package/out/src/generator/parser/sliceAggregator.js +203 -161
- package/out/src/generator/parser/sliceAggregatorComposition.js +194 -0
- package/out/src/generator/parser/vsParser.js +8 -2
- package/out/src/generator/sdProcessor.js +104 -302
- package/out/src/generator/sdProcessorHelpers.js +98 -0
- package/out/src/generator/sdProcessorRequiredFields.js +129 -0
- package/out/src/main.js +38 -247
- package/package.json +7 -6
- package/out/src/generator/fhir/r4/base/Bundle.json +0 -2154
- package/out/src/generator/fhir/r4/base/Composition.json +0 -3346
- package/out/src/generator/fhir/r4/base/Endpoint.json +0 -1051
- package/out/src/generator/fhir/r4/base/README.md +0 -28
- package/out/src/generator/fhir/r4/base/Subscription.json +0 -1072
- package/out/src/generator/fhir/r4/base/ValueSet.json +0 -4021
- package/out/src/generator/fhir/r4/context.js +0 -21
- package/out/src/generator/fhir/r4/context.ts +0 -24
- package/out/src/generator/fhir/r4/dataTypes.json +0 -858
- package/out/src/generator/fhir/r4/interfaces.json +0 -664
- package/out/src/generator/fhir/r4/resources.json +0 -150
- package/out/src/generator/fhir/r4/rules.js +0 -207
- package/out/src/generator/fhir/r4/rules.ts +0 -226
- package/out/src/generator/fhir/r4b/context.js +0 -21
- package/out/src/generator/fhir/r4b/context.ts +0 -24
- package/out/src/generator/fhir/r4b/dataTypes.json +0 -860
- package/out/src/generator/fhir/r4b/interfaces.json +0 -684
- package/out/src/generator/fhir/r4b/resources.json +0 -145
- package/out/src/generator/fhir/r4b/rules.js +0 -171
- package/out/src/generator/fhir/r4b/rules.ts +0 -190
package/README.md
CHANGED
|
@@ -35,38 +35,104 @@ Every pull request runs two independent CI pipelines that validate generated cod
|
|
|
35
35
|
4. Generates `empty()` and `random()` test resources for every profile
|
|
36
36
|
5. Validates those resources against two external FHIR validators
|
|
37
37
|
|
|
38
|
-
### Tested Implementation Guides
|
|
38
|
+
### Tested Implementation Guides (28 packages)
|
|
39
39
|
|
|
40
|
-
| Implementation Guide | Package |
|
|
40
|
+
| Category | Implementation Guide | Package |
|
|
41
41
|
|---|---|---|
|
|
42
|
-
| US Core | `hl7.fhir.us.core@8.0.0` |
|
|
43
|
-
|
|
|
44
|
-
|
|
|
45
|
-
|
|
|
46
|
-
|
|
|
47
|
-
|
|
|
42
|
+
| US | US Core | `hl7.fhir.us.core@8.0.0` |
|
|
43
|
+
| US | QI-Core | `hl7.fhir.us.qicore@6.0.0` |
|
|
44
|
+
| US | mCODE | `hl7.fhir.us.mcode@4.0.0` |
|
|
45
|
+
| US | SDOH Clinical Care | `hl7.fhir.us.sdoh-clinicalcare@2.2.0` |
|
|
46
|
+
| US | NDH (National Directory) | `hl7.fhir.us.ndh@1.0.0` |
|
|
47
|
+
| US | CARIN BB | `hl7.fhir.us.carin-bb@2.1.0` |
|
|
48
|
+
| US | CQF Measures | `hl7.fhir.us.cqfmeasures@4.0.0` |
|
|
49
|
+
| US | Physical Activity | `hl7.fhir.us.physical-activity@1.0.0` |
|
|
50
|
+
| DaVinci | PAS | `hl7.fhir.us.davinci-pas@2.0.1` |
|
|
51
|
+
| DaVinci | CDex | `hl7.fhir.us.davinci-cdex@2.1.0` |
|
|
52
|
+
| DaVinci | PDex | `hl7.fhir.us.davinci-pdex@2.1.0` |
|
|
53
|
+
| DaVinci | DTR | `hl7.fhir.us.davinci-dtr@2.1.0` |
|
|
54
|
+
| DaVinci | Alerts | `hl7.fhir.us.davinci-alerts@1.0.0` |
|
|
55
|
+
| DaVinci | DEQM | `hl7.fhir.us.davinci-deqm@4.0.0` |
|
|
56
|
+
| DaVinci | Drug Formulary | `hl7.fhir.us.davinci-drug-formulary@2.1.0` |
|
|
57
|
+
| Universal | IPS | `hl7.fhir.uv.ips@2.0.0` |
|
|
58
|
+
| Universal | SMART App Launch | `hl7.fhir.uv.smart-app-launch@2.2.0` |
|
|
59
|
+
| Universal | SDC (Structured Data Capture) | `hl7.fhir.uv.sdc@3.0.0` |
|
|
60
|
+
| Universal | Genomics Reporting | `hl7.fhir.uv.genomics-reporting@3.0.0` |
|
|
61
|
+
| Universal | CPG (Clinical Practice Guidelines) | `hl7.fhir.uv.cpg@2.0.0` |
|
|
62
|
+
| DE | ISiK Basis | `de.gematik.isik-basismodul@4.0.3` |
|
|
63
|
+
| DE | ISiK Medikation | `de.gematik.isik-medikation@4.0.1` |
|
|
64
|
+
| DE | KBV eRezept | `kbv.ita.erp@1.1.1` |
|
|
65
|
+
| DE | DE Basisprofil | `de.basisprofil.r4@1.5.0` |
|
|
66
|
+
| CH | CH Core (Switzerland) | `ch.fhir.ig.ch-core@5.0.0` |
|
|
67
|
+
| AU | AU Core (Australia) | `hl7.fhir.au.core@1.0.0` |
|
|
68
|
+
| IHE | PIXm | `ihe.iti.pixm@3.0.4` |
|
|
69
|
+
| IHE | MHD | `ihe.iti.mhd@4.2.2` |
|
|
48
70
|
|
|
49
71
|
### Validation with Firely .NET SDK
|
|
50
72
|
|
|
51
|
-
The first pipeline validates generated resources using the [Firely .NET SDK validator](https://docs.fire.ly/projects/Firely-NET-SDK/) (v3.1.
|
|
52
|
-
|
|
53
|
-
 (Firely.Fhir.Validation.R4 v3.1.1). Results are published as live badges:
|
|
74
|
+
|
|
75
|
+

|
|
76
|
+

|
|
77
|
+

|
|
78
|
+

|
|
79
|
+

|
|
80
|
+

|
|
81
|
+

|
|
82
|
+

|
|
83
|
+

|
|
84
|
+

|
|
85
|
+

|
|
86
|
+

|
|
87
|
+

|
|
88
|
+

|
|
89
|
+

|
|
90
|
+

|
|
91
|
+

|
|
92
|
+

|
|
93
|
+

|
|
94
|
+

|
|
95
|
+

|
|
96
|
+

|
|
97
|
+

|
|
98
|
+

|
|
99
|
+

|
|
100
|
+

|
|
101
|
+

|
|
102
|
+

|
|
59
103
|
|
|
60
104
|
### Validation with HL7 Java Validator
|
|
61
105
|
|
|
62
|
-
The second pipeline validates using the [official HL7 FHIR Validator](https://confluence.hl7.org/display/FHIR/Using+the+FHIR+Validator) (v6.9.
|
|
63
|
-
|
|
64
|
-
 (v6.9.4), the reference implementation for FHIR conformance checking:
|
|
107
|
+
|
|
108
|
+

|
|
109
|
+

|
|
110
|
+

|
|
111
|
+

|
|
112
|
+

|
|
113
|
+

|
|
114
|
+

|
|
115
|
+

|
|
116
|
+

|
|
117
|
+

|
|
118
|
+

|
|
119
|
+

|
|
120
|
+

|
|
121
|
+

|
|
122
|
+

|
|
123
|
+

|
|
124
|
+

|
|
125
|
+

|
|
126
|
+

|
|
127
|
+

|
|
128
|
+

|
|
129
|
+

|
|
130
|
+

|
|
131
|
+

|
|
132
|
+

|
|
133
|
+

|
|
134
|
+

|
|
135
|
+

|
|
70
136
|
|
|
71
137
|
> Terminology validation requires a tx server. The pipeline uses `--tx-server https://tx.fhir.org/r4` during generation to expand ValueSets and produce valid codes.
|
|
72
138
|
|
|
@@ -136,7 +202,7 @@ Options:
|
|
|
136
202
|
--no-classes Only generate interfaces and types (skip class generation)
|
|
137
203
|
--no-client Skip FHIR client generation (client generated by default)
|
|
138
204
|
--schema <format> Generate schema files alongside outputs (supported: zod)
|
|
139
|
-
--fhir-version <ver> FHIR version to target: r4 (
|
|
205
|
+
--fhir-version <ver> FHIR version to target: r4 or r4b (auto-detected from package if omitted)
|
|
140
206
|
--package <pkg@version> Download FHIR package from registry and process it
|
|
141
207
|
--registry <url> FHIR package registry URL (default: https://packages.simplifier.net)
|
|
142
208
|
--tx-server <url> Terminology server URL for ValueSet expansion (e.g., https://tx.fhir.org/r4)
|
|
@@ -194,4 +260,4 @@ For security issues, please see [SECURITY.md](SECURITY.md) for our security poli
|
|
|
194
260
|
- [GitHub repository](https://github.com/Max-Health-Inc/BabelFHIR-TS)
|
|
195
261
|
- [Validation report](https://max-health-inc.github.io/BabelFHIR-TS/)
|
|
196
262
|
- [Issue tracker](https://github.com/Max-Health-Inc/BabelFHIR-TS/issues)
|
|
197
|
-
- [Changelog](
|
|
263
|
+
- [Changelog / Releases](https://github.com/Max-Health-Inc/BabelFHIR-TS/releases)
|
package/out/fhir-r4.d.ts
CHANGED
|
@@ -673,4 +673,8 @@ declare module 'fhir/r4' {
|
|
|
673
673
|
export type VisionPrescription = fhir4.VisionPrescription;
|
|
674
674
|
export type VisionPrescriptionLensSpecification = fhir4.VisionPrescriptionLensSpecification;
|
|
675
675
|
export type VisionPrescriptionLensSpecificationPrism = fhir4.VisionPrescriptionLensSpecificationPrism;
|
|
676
|
+
/** Constraint profile on Quantity — missing from @types/fhir */
|
|
677
|
+
export type MoneyQuantity = fhir4.Quantity;
|
|
678
|
+
/** Constraint profile on Quantity — missing from @types/fhir */
|
|
679
|
+
export type SimpleQuantity = fhir4.Quantity;
|
|
676
680
|
}
|