babelfhir-ts 1.0.34 → 1.0.36
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 +43 -8
- package/out/src/generator/base-r4/Bundle.json +2154 -0
- package/out/src/generator/base-r4/Composition.json +3346 -0
- package/out/src/generator/base-r4/Endpoint.json +1051 -0
- package/out/src/generator/base-r4/Subscription.json +1072 -0
- package/out/src/generator/base-r4/ValueSet.json +4021 -0
- package/out/src/generator/base-r4/backport-subscription.json +1555 -0
- package/out/{generator → src/generator}/classGenerator.js +41 -21
- package/out/{generator → src/generator}/fhirR4Rules.js +35 -1
- package/out/{generator → src/generator}/index.js +90 -10
- package/out/{generator → src/generator}/interfaceGenerator.js +138 -16
- package/out/{generator → src/generator}/randomSupportGenerator.js +129 -49
- package/out/{generator → src/generator}/sdParser.js +99 -6
- package/out/src/generator/txClient.js +189 -0
- package/out/{generator → src/generator}/utils.js +0 -4
- package/out/{generator → src/generator}/validatorGenerator.js +108 -6
- package/out/src/generator/valueSetGenerator.js +193 -0
- package/out/{generator → src/generator}/vsParser.js +81 -2
- package/out/{main.js → src/main.js} +53 -26
- package/package.json +17 -11
- package/bin/babelfhir-ts.js +0 -29
- package/out/generator/valueSetGenerator.js +0 -98
- /package/out/{generator → src/generator}/cacheConfig.js +0 -0
- /package/out/{generator → src/generator}/clientGenerator.js +0 -0
- /package/out/{generator → src/generator}/fetchUtils.js +0 -0
- /package/out/{generator → src/generator}/fhirDataTypes.json +0 -0
- /package/out/{generator → src/generator}/fhirInterfaces.json +0 -0
- /package/out/{generator → src/generator}/importManager.js +0 -0
- /package/out/{generator → src/generator}/packageManager.js +0 -0
- /package/out/{generator → src/generator}/packageParser.js +0 -0
- /package/out/{generator → src/generator}/postProcessExtensions.js +0 -0
- /package/out/{logger.js → src/logger.js} +0 -0
package/README.md
CHANGED
|
@@ -23,9 +23,30 @@
|
|
|
23
23
|
- **Install any FHIR profile as a node module**—use `babelfhir-ts install` to add Implementation Guides directly to your project
|
|
24
24
|
|
|
25
25
|
<!-- PARITY-BADGES:START - Do not remove or modify this section -->
|
|
26
|
-
##
|
|
26
|
+
## Continuous Validation
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
Every pull request runs two independent CI pipelines that validate generated code against real-world FHIR Implementation Guides. For each IG, the pipeline:
|
|
29
|
+
|
|
30
|
+
1. Downloads the FHIR package from a registry
|
|
31
|
+
2. Generates TypeScript interfaces, validators, and classes
|
|
32
|
+
3. Compiles the output with `tsc` (zero errors required)
|
|
33
|
+
4. Generates `empty()` and `random()` test resources for every profile
|
|
34
|
+
5. Validates those resources against two external FHIR validators
|
|
35
|
+
|
|
36
|
+
### Tested Implementation Guides
|
|
37
|
+
|
|
38
|
+
| Implementation Guide | Package | Profiles |
|
|
39
|
+
|---|---|---|
|
|
40
|
+
| US Core | `hl7.fhir.us.core@8.0.0` | Patient, Condition, Observation, Encounter, … |
|
|
41
|
+
| ISiK Basis (Germany) | `de.gematik.isik-basismodul@4.0.3` | ISiKPatient, ISiKDiagnose, … |
|
|
42
|
+
| IPS (International Patient Summary) | `hl7.fhir.uv.ips@2.0.0` | Composition, MedicationStatement, … |
|
|
43
|
+
| SMART App Launch | `hl7.fhir.uv.smart-app-launch@2.2.0` | WellKnown endpoints |
|
|
44
|
+
| CH Core (Switzerland) | `ch.fhir.ig.ch-core@5.0.0` | CHCorePatient, CHCoreEncounter, … |
|
|
45
|
+
| DaVinci PAS | `hl7.fhir.us.davinci-pas@2.0.1` | PASClaim, PASClaimResponse, … |
|
|
46
|
+
|
|
47
|
+
### Validation with Firely .NET SDK
|
|
48
|
+
|
|
49
|
+
The first pipeline validates generated resources using the [Firely .NET SDK validator](https://docs.fire.ly/projects/Firely-NET-SDK/) (v3.0.1). Results are published as live badges:
|
|
29
50
|
|
|
30
51
|

|
|
31
52
|

|
|
@@ -33,9 +54,22 @@ BabelFHIR-TS validators achieve **100% parity** with the Firely .NET SDK validat
|
|
|
33
54
|

|
|
34
55
|

|
|
35
56
|
|
|
36
|
-
>
|
|
57
|
+
> 11 profiles are excluded from this pipeline due to schema loading issues in the Firely SDK. These profiles validate successfully with the HL7 Java Validator below. Details in [docs/FIRELY-VALIDATOR-BUGS.md](./docs/FIRELY-VALIDATOR-BUGS.md).
|
|
58
|
+
|
|
59
|
+
### Validation with HL7 Java Validator
|
|
60
|
+
|
|
61
|
+
The second pipeline validates using the [official HL7 FHIR Validator](https://confluence.hl7.org/display/FHIR/Using+the+FHIR+Validator) (v6.3.11), the reference implementation for FHIR conformance checking:
|
|
62
|
+
|
|
63
|
+

|
|
64
|
+

|
|
65
|
+

|
|
66
|
+

|
|
67
|
+

|
|
68
|
+
|
|
69
|
+
> 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.
|
|
37
70
|
|
|
38
|
-
📊 **[Full Report](https://gist.github.com/quotentiroler/e9bc625cfe88a0a67a73abc06660f40f)**
|
|
71
|
+
📊 **[Full Report & Badge Data](https://gist.github.com/quotentiroler/e9bc625cfe88a0a67a73abc06660f40f)**
|
|
72
|
+
<!-- HL7-PARITY-BADGES:END -->
|
|
39
73
|
<!-- PARITY-BADGES:END -->
|
|
40
74
|
|
|
41
75
|
## Installation
|
|
@@ -138,6 +172,7 @@ babelfhir-ts [options] [<input> [output]]
|
|
|
138
172
|
| `install` | Downloads, processes, and installs a package as a project dependency. |
|
|
139
173
|
| `--package <pkg@version>` | Fetch a package from a registry and process it without manual download. |
|
|
140
174
|
| `--registry <url>` | Custom registry base URL (default:`https://packages.simplifier.net`). |
|
|
175
|
+
| `--tx-server <url>` | Terminology server URL for ValueSet expansion (e.g., `https://tx.fhir.org/r4`). When set, expands ValueSets without explicit codes using the `$expand` operation. |
|
|
141
176
|
| `--log <level>` | Control logging output:`none` (default), `console`, or `file`. |
|
|
142
177
|
| `--no-cache` | Remove the `.cache` directory once generation completes. |
|
|
143
178
|
| `--no-classes` | Skip emitting helper classes (interfaces & validators only). |
|
|
@@ -216,7 +251,7 @@ For comprehensive conformance testing, use the official [HL7 FHIR Validator](htt
|
|
|
216
251
|
- Reference integrity constraints
|
|
217
252
|
|
|
218
253
|
Use `random()` for development, testing, and prototyping, but always validate production data on the FHIR server side.
|
|
219
|
-
- **`validate()`
|
|
254
|
+
- **`validate()` coverage**: The generated validation methods execute FHIRPath expressions and check constraints from StructureDefinitions. They are tested against the HL7 Java Validator and the Firely .NET SDK for the Implementation Guides listed in the [Continuous Validation](#continuous-validation) section. Edge cases, complex slicing patterns, or profiles not in the CI pipeline may produce different results. For production conformance testing, use the official [HL7 FHIR Validator](https://confluence.hl7.org/display/FHIR/Using+the+FHIR+Validator) as the source of truth.
|
|
220
255
|
|
|
221
256
|
### FHIR Version Support
|
|
222
257
|
|
|
@@ -225,7 +260,7 @@ For comprehensive conformance testing, use the official [HL7 FHIR Validator](htt
|
|
|
225
260
|
|
|
226
261
|
### Reporting Issues
|
|
227
262
|
|
|
228
|
-
If you encounter an Implementation Guide that doesn't generate correctly, please [open an issue](https://github.com/
|
|
263
|
+
If you encounter an Implementation Guide that doesn't generate correctly, please [open an issue](https://github.com/Max-Health-Inc/BabelFHIR-TS/issues) with:
|
|
229
264
|
|
|
230
265
|
- The package name and version
|
|
231
266
|
- The specific StructureDefinition URL
|
|
@@ -249,6 +284,6 @@ For security issues, please see [SECURITY.md](SECURITY.md) for our security poli
|
|
|
249
284
|
## Links
|
|
250
285
|
|
|
251
286
|
- [npm package](https://www.npmjs.com/package/babelfhir-ts)
|
|
252
|
-
- [GitHub repository](https://github.com/
|
|
253
|
-
- [Issue tracker](https://github.com/
|
|
287
|
+
- [GitHub repository](https://github.com/Max-Health-Inc/BabelFHIR-TS)
|
|
288
|
+
- [Issue tracker](https://github.com/Max-Health-Inc/BabelFHIR-TS/issues)
|
|
254
289
|
- [Changelog](CHANGELOG.md)
|