babelfhir-ts 1.0.30 → 1.0.31
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 +19 -10
- package/package.json +4 -5
package/README.md
CHANGED
|
@@ -58,7 +58,7 @@ Download and process a package directly from a registry (defaults to `https://pa
|
|
|
58
58
|
babelfhir-ts --package hl7.fhir.us.core@8.0.0
|
|
59
59
|
```
|
|
60
60
|
|
|
61
|
-
Download,
|
|
61
|
+
Download, process and install a processed package into your current project:
|
|
62
62
|
|
|
63
63
|
```bash
|
|
64
64
|
babelfhir-ts install hl7.fhir.us.core@8.0.0
|
|
@@ -132,7 +132,7 @@ babelfhir-ts [options] [<input> [output]]
|
|
|
132
132
|
|
|
133
133
|
- **Directory** – scan all `.tgz`, `.zip`, or `.json` files inside the folder
|
|
134
134
|
- **Archive** – process a FHIR NPM package in `.tgz` or `.zip` format
|
|
135
|
-
- **StructureDefinition JSON** – generate code for a single profile
|
|
135
|
+
- **StructureDefinition JSON** – generate code for a single profile definition
|
|
136
136
|
|
|
137
137
|
## Scripts for contributors
|
|
138
138
|
|
|
@@ -141,7 +141,7 @@ babelfhir-ts [options] [<input> [output]]
|
|
|
141
141
|
| `npm run generate` | Execute the CLI against the local `input/` folder and refresh `output/`. |
|
|
142
142
|
| `npm run generate:check` | End-to-end check: generate, type-check, and lint the emitted output. |
|
|
143
143
|
| `npm test` | Type-check and run all Vitest suites (coverage enabled). |
|
|
144
|
-
| `npm
|
|
144
|
+
| `npm test validatorParity` | Run validator parity tests against Firely .NET SDK validator. |
|
|
145
145
|
|
|
146
146
|
## Caching notes
|
|
147
147
|
|
|
@@ -165,12 +165,21 @@ BabelFHIR-TS is a code generation tool that parses FHIR StructureDefinitions and
|
|
|
165
165
|
|
|
166
166
|
### Validation Scope
|
|
167
167
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
- **
|
|
168
|
+
The generated `validate()` methods DO check:
|
|
169
|
+
- **FHIRPath constraints** from StructureDefinition invariants
|
|
170
|
+
- **Cardinality rules** (min/max occurrences)
|
|
171
|
+
- **Required fields** from profiles
|
|
172
|
+
- **Pattern constraints** (patternCodeableConcept, patternCoding)
|
|
173
|
+
- **Slice validation** for common patterns (coding arrays, BackboneElement slices)
|
|
174
|
+
- **Data type correctness** (string, number, boolean, etc.)
|
|
175
|
+
|
|
176
|
+
The generated validators DO NOT check:
|
|
177
|
+
- **Terminology validation** (ValueSet expansion, code system membership) - requires terminology server
|
|
178
|
+
- **Reference resolution** (checking that referenced resources exist) - requires FHIR server
|
|
179
|
+
- **Complex discriminator types** (type, profile, exists, position) - only pattern/value discriminators supported
|
|
180
|
+
- **Cross-resource business rules** - application-specific logic
|
|
181
|
+
|
|
182
|
+
For comprehensive conformance testing, use the official [HL7 FHIR Validator](https://confluence.hl7.org/display/FHIR/Using+the+FHIR+Validator) or [Firely .NET SDK](https://fire.ly/products/firely-net-sdk/).
|
|
174
183
|
|
|
175
184
|
### TypeScript Limitations
|
|
176
185
|
|
|
@@ -188,7 +197,7 @@ BabelFHIR-TS is a code generation tool that parses FHIR StructureDefinitions and
|
|
|
188
197
|
|
|
189
198
|
Use `random()` for development, testing, and prototyping, but always validate production data on the FHIR server side.
|
|
190
199
|
|
|
191
|
-
- **`validate()` parity**: The generated validation methods execute FHIRPath expressions and check constraints from StructureDefinitions, but are **only guaranteed to match** the Firely .NET SDK validator for scenarios covered by our test suite (see GitHub actions). Edge cases, complex slicing patterns, or profiles not in our test pipeline may produce different results. For production conformance testing, use the [HL7 FHIR Validator](https://
|
|
200
|
+
- **`validate()` parity**: The generated validation methods execute FHIRPath expressions and check constraints from StructureDefinitions, but are **only guaranteed to match** the Firely .NET SDK validator for scenarios covered by our test suite (see GitHub actions). Edge cases, complex slicing patterns, or profiles not in our test 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) or [Firely .NET SDK](https://fire.ly/products/firely-net-sdk/) as the source of truth.
|
|
192
201
|
|
|
193
202
|
### FHIR Version Support
|
|
194
203
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "babelfhir-ts",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.31",
|
|
4
4
|
"description": "BabelFHIR-TS: generate TypeScript interfaces, validators, and helper classes from FHIR R4 StructureDefinitions (profiles) directly inside package archives.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "out/main.js",
|
|
@@ -31,7 +31,6 @@
|
|
|
31
31
|
"generate": "tsx src/main.ts",
|
|
32
32
|
"generate:check": "npm run generate && npm run typecheck && npm run typecheck:output && npm run lint:output",
|
|
33
33
|
"generate:fhir-module": "node scripts/generate-fhir-r4-module.js",
|
|
34
|
-
"download-validator": "tsx scripts/download-validator.ts",
|
|
35
34
|
"prepublishOnly": "npm run build"
|
|
36
35
|
},
|
|
37
36
|
"keywords": [
|
|
@@ -50,12 +49,12 @@
|
|
|
50
49
|
"license": "ISC",
|
|
51
50
|
"repository": {
|
|
52
51
|
"type": "git",
|
|
53
|
-
"url": "https://github.com/quotentiroler/BabelFHIR-
|
|
52
|
+
"url": "https://github.com/quotentiroler/BabelFHIR-TS.git"
|
|
54
53
|
},
|
|
55
54
|
"bugs": {
|
|
56
|
-
"url": "https://github.com/quotentiroler/BabelFHIR-
|
|
55
|
+
"url": "https://github.com/quotentiroler/BabelFHIR-TS/issues"
|
|
57
56
|
},
|
|
58
|
-
"homepage": "https://github.com/quotentiroler/BabelFHIR-
|
|
57
|
+
"homepage": "https://github.com/quotentiroler/BabelFHIR-TS#readme",
|
|
59
58
|
"engines": {
|
|
60
59
|
"node": ">=18.0.0",
|
|
61
60
|
"npm": ">=9.0.0"
|