You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
update README and plan to reflect v0.23.0–v0.42.0 phases shipped
Spec Coverage table now matches reality: every Phase 1–5 box is green,
plus 7.x CLI commands, 2.1/2.2/2.3 IG fidelity, and the MCP server
skeleton. Adds documentation for the new fhir-gen subcommands
(capability/validate/scaffold-ig/diff), the FHIRPath invariant
evaluator, and the @fhir-dsl/mcp server with quickstart code. The
plan's tracking section gets a shipped/remaining ledger so the next
contributor can pick up cleanly.
@@ -34,12 +34,15 @@ Working with FHIR APIs in TypeScript typically means dealing with untyped JSON,
34
34
35
35
| Package | Description | When to Install |
36
36
|---|---|---|
37
-
|[`@fhir-dsl/core`](./packages/core)| Query builder DSL (search, read, batch, transactions) | Always — this is the query builder |
38
-
|[`@fhir-dsl/runtime`](./packages/runtime)| HTTP executor with pagination and error handling | Always — provides the HTTP executor |
39
-
|[`@fhir-dsl/cli`](./packages/cli)| CLI for generating types from FHIR specs | Dev dependency — generates types for your project |
40
-
|[`@fhir-dsl/types`](./packages/types)| Base FHIR R4/R5 type definitions | Automatically installed as a dependency of `@fhir-dsl/core`|
41
-
|[`@fhir-dsl/generator`](./packages/generator)| Code generation engine | Only if building custom tooling on top of the generator |
42
-
|[`@fhir-dsl/fhirpath`](./packages/fhirpath)| Type-safe FHIRPath expression builder | When working with FHIRPath expressions |
37
+
|[`@fhir-dsl/core`](./packages/core)| Query builder DSL (search, read, batch, transactions, terminology ops, capability guard) | Always — this is the query builder |
38
+
|[`@fhir-dsl/runtime`](./packages/runtime)| HTTP executor with pagination, error handling, bundle resolution, slice helpers | Always — provides the HTTP executor |
39
+
|[`@fhir-dsl/cli`](./packages/cli)|`fhir-gen` CLI: `generate`, `capability`, `validate`, `scaffold-ig`, `diff`| Dev dependency — generates types for your project |
40
+
|[`@fhir-dsl/types`](./packages/types)| Branded FHIR R4/R5 primitives + base datatypes + parsers | Automatically installed as a dependency of `@fhir-dsl/core`|
41
+
|[`@fhir-dsl/generator`](./packages/generator)| Code generation engine (resources, profiles, slices, typed extensions, layers, IG manifests) | Only if building custom tooling on top of the generator |
42
+
|[`@fhir-dsl/fhirpath`](./packages/fhirpath)| Type-safe FHIRPath expression builder + invariant evaluator | When working with FHIRPath expressions or compiling invariants |
43
+
|[`@fhir-dsl/terminology`](./packages/terminology)| CodeSystem hierarchy + ValueSet filter engine (`is-a`, `descendent-of`, `regex`) | Used internally by the generator; also usable standalone |
44
+
|[`@fhir-dsl/smart`](./packages/smart)| SMART on FHIR v2 — PKCE-S256, backend services, scope DSL | Only when integrating with SMART-secured FHIR servers |
45
+
|[`@fhir-dsl/mcp`](./packages/mcp)| MCP server: ~10 generic FHIR verbs as tools, pluggable auth/audit | When exposing a FHIR endpoint to an LLM agent |
43
46
|[`@fhir-dsl/utils`](./packages/utils)| Shared utilities | Only if building custom tooling |
44
47
45
48
For detailed installation instructions, see the [Installation Guide](https://awbx.github.io/fhir-dsl/docs/getting-started/installation).
@@ -196,24 +199,28 @@ fhir-dsl is audited against the FHIR architectural overview (https://build.fhir.
196
199
| Pillar | Status | Notes |
197
200
|---|---|---|
198
201
| Information Model — base classes & datatypes | ✅ |`Element`, `Resource`, `DomainResource`, `BackboneElement`, all complex datatypes typed. |
199
-
| Information Model — primitives | 🟡 | All 19 FHIR primitives present; branded types ship in Phase 1.1. |
200
-
| Information Model — choice types `value[x]`| 🟡 | Flattened to optional siblings today; discriminated unions in Phase 1.2. |
201
-
| Information Model — primitive `_field` siblings | ❌ | Round-trip-safe in Phase 1.3. |
202
+
| Information Model — primitives | ✅ | All 19 FHIR primitives, branded with `unique symbol` markers (Phase 1.1, v0.23.0). |
203
+
| Information Model — choice types `value[x]`| ✅ | Discriminated `ChoiceOf<T, Prefix>` + `choiceOf()` runtime helper (Phase 1.2, v0.24.0). |
204
+
| Information Model — primitive `_field` siblings | ✅ |`_id`, `_extension`, etc. round-trip via `Element` siblings (Phase 1.3, v0.25.0). |
205
+
| Information Model — full `Extension.value[x]` union | ✅ | All 49 value variants (Phase 1.4, v0.25.0). |
Drift between this table and the code is caught by `pnpm audit:export-surface` — every PR that changes the public surface must refresh `.surface-snapshot.json`.
219
226
@@ -255,22 +262,104 @@ Mapping of [FHIR R5 search features](https://fhir.hl7.org/fhir/search.html) to t
255
262
| POST `_search` (long URLs / sensitive params) |`.usePost()` (auto-switch over ~1900 chars) |
`@fhir-dsl/fhirpath` exposes a runtime invariant evaluator that compiles `ElementDefinition.constraint[*].expression` strings into predicates and surfaces results as `OperationOutcome` issues. The supported subset covers the patterns FHIR core invariants actually use:
268
+
269
+
- Identifiers and member access (`name.given`, `extension.url`)
|`--out <dir>`| Output directory for generated files | Yes |
268
-
|`--ig <packages...>`| Implementation Guide packages to include| No |
338
+
|`--ig <packages...>`| Implementation Guide packages (`hl7.fhir.us.core@6.1.0`)| No |
269
339
|`--resources <list>`| Comma-separated list of resource names to generate | No |
270
340
|`--src <path>`| Local FHIR definitions directory (skips download) | No |
271
341
|`--cache <dir>`| Cache directory for downloaded specs | No |
272
342
|`--validator <target>`| Emit Standard Schema validators: `native` or `zod`| No |
273
343
|`--strict-extensible`| Treat extensible bindings as closed enums (validator only) | No |
344
+
|`--expand-valuesets`| Generate typed unions from FHIR ValueSet bindings | No |
345
+
|`--resolve-codesystems`| Generate CodeSystem namespace objects for IntelliSense | No |
346
+
|`--include-spec`| Emit markdown spec files alongside types for AI/LLM context | No |
347
+
348
+
### `fhir-gen capability <baseUrl>`
349
+
350
+
Fetches `<baseUrl>/metadata` and prints a table of supported interactions, formats, search params, and conditional-* flags. `--out <file>` dumps the raw JSON, `--json` prints it to stdout. (Phase 7.2, v0.32.0.)
351
+
352
+
### `fhir-gen validate <file>`
353
+
354
+
Structural sanity-check on a FHIR JSON resource: parses, validates the `resourceType` is known, checks basic invariants (string `id`, `Bundle.entry` is an array, no NaN/Infinity in numbers). Designed for CI gates around LLM-generated payloads. `--quiet` suppresses warnings on success. (Phase 7.1, v0.35.0.)
355
+
356
+
### `fhir-gen scaffold-ig <pkg>`
357
+
358
+
Initialises a starter project with the IG pre-wired. Writes `package.json`, `tsconfig.json`, `fhir-dsl.config.json`, and `src/client.ts` calling the generator's emitted `createClient`. `--out <dir>` (default cwd), `--version <ver>` (default `r4`), `--name <project>`, `--force` to overwrite. (Phase 7.3, v0.36.0.)
359
+
360
+
### `fhir-gen diff <oldDir> <newDir>`
361
+
362
+
Compares two generated outputs and reports added/removed resources, removed fields, optional→required changes, and type narrowing. Exits 2 when breaking changes are detected — wire it into CI to gate FHIR version bumps. `--json` for a machine-readable report. (Phase 7.4, v0.37.0.)
274
363
275
364
For full CLI details and examples, see the [CLI Usage Guide](https://awbx.github.io/fhir-dsl/docs/cli/usage).
0 commit comments