Examples: consolidate example dirs, dedup TS profile tests, move ccda to on-the-fly - #184
Merged
Conversation
…custom-packages Both demonstrate non-registry input sources, so combine them into one example: local StructureDefinitions from disk (.localStructureDefinitions) and a remote TGZ package by URL (.fromPackageRef), each writing to its own output dir.
…r4-us-core A single generate.ts pulls US Core 8.0.1 (which depends on R4 core), so one fhir-types tree holds both hl7-fhir-r4-core and hl7-fhir-us-core. The US Core bp/bodyweight tests are trimmed to only US-Core-specific scenarios; the base profile-class API stays demonstrated once against the R4 profiles.
ccda does not commit its fhir-types (generated on the fly), so it belongs with the other on-the-fly examples rather than the committed-types TS examples.
…ples - Makefile: test-typescript-r4-us-core-example, test-typescript-custom-packages-example, and test-on-the-fly-ccda (folded into test-on-the-fly-example) - CI: consolidate the two TS SDK jobs, drop the standalone ccda job (covered by on-the-fly) - Update README, examples README, design docs, CLAUDE.md, .zed tasks, and the multi-package test / python-us-core fixture paths
ryukzak
force-pushed
the
example-decouple
branch
from
June 18, 2026 11:39
9aee3c9 to
d6eb640
Compare
ryukzak
commented
Jun 18, 2026
Address review: merge generate-local.ts and generate-sql-on-fhir.ts into one generate.ts that runs both input mechanisms (local StructureDefinitions → fhir-types, remote TGZ → sql-on-fhir-types) in sequence. Update Makefile and READMEs.
Address review: the R4 profile tests were named profile-bodyweight/profile-bp while the US Core ones are profile-us-core-*; rename so the file names show they exercise the base R4 profiles. Update README/CLAUDE.md references.
- Give TypeScript, Python, and C# their own per-language sections (move typescript-custom-packages under TypeScript Generation) - Drop the stray Mustache snippet from Running Examples - Move the C# Aidbox integration-test instructions into the C# Generation section
- extension-profile.test.ts -> profile-r4-extension.test.ts (it exercises R4 extension *profile classes*, so it belongs in the profile-<pkg>-* group) - resource.test.ts -> resources.test.ts; raw-extension.test.ts -> raw-extensions.test.ts - Fix stale profile-bodyweight/profile-bp cross-references in the US Core test headers - Update README and root README references
ryukzak
force-pushed
the
example-decouple
branch
from
June 18, 2026 12:47
9e608aa to
4b14ee0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Consolidate and reorganize the
examples/directory: fewer top-level dirs, less duplication, clearer per-language structure, and a clean split between examples that commit their generated types and those generated on the fly.Directory changes
Before → after:
typescript-r4+typescript-us-core→typescript-r4-us-core— a singlegenerate.tspulls US Core 8.0.1 (which depends on R4 core), so onefhir-types/tree holds bothhl7-fhir-r4-coreandhl7-fhir-us-core.local-package-folder+typescript-sql-on-fhir→typescript-custom-packages— both demonstrate non-registry input sources; a singlegenerate.tsruns both in sequence: local StructureDefinitions via.localStructureDefinitions()→fhir-types, and a remote TGZ via.fromPackageRef()→sql-on-fhir-types.typescript-ccda→on-the-fly/ccda— ccda never commits itsfhir-types/(generated on the fly), so it belongs with the other on-the-fly examples. The parenton-the-fly/.gitignorealready coversfhir-types/, and the depth-sensitivetsconfig/generate.tspaths were fixed.Test dedup & naming
bp/bodyweighttests: the base profile-class API (create/apply/from/slice accessors, category auto-population) is already demonstrated against the R4 profiles, so the US Core files keep one self-contained create demo plus only US-Core-specific scenarios (constrainedvalue[x]validation, narrowed-choice mutual exclusion, a workingfrom()round-trip the R4 BP can't do, andBundle<T>+ multi-profileis()).typescript-r4-us-coretest files into a consistent scheme:resources.test.ts,raw-extensions.test.tsprofile-r4-{extension,bodyweight,bp}.test.ts,profile-us-core-{patient,bp,bodyweight}.test.tsBuild & CI
Makefile targets before → after:
sdk-tests.yml): consolidated the two TypeScript SDK jobs into onetest-typescript-r4-us-core-examplejob, renamed the local-package job totest-typescript-custom-packages-example, and removed the standalone ccda job (now covered by the on-the-fly job). Each on-the-fly example runs generate → typecheck → test.test-on-the-fly-ccdatarget drops a redundant unit-test invocation (test/unit/typeschema/transformer/ccda.test.tsis already covered bymake test).Docs
examples/README.mdrestructured into per-language sections (TypeScript / Python / C#), plus Template-Based and On-the-Fly; the C# Aidbox integration-test instructions moved into the C# section and a couple of stray snippets removed.README.md, design docs,CLAUDE.md, and.zed/tasks.jsonreferences.Notes
typescript-r4-us-core/fhir-typesis committed and CI verifies it matches a fresh generation; the trimmed/merged outputs were regenerated and confirmed deterministic.docs/posts/*blog archives still reference the old paths and were intentionally left untouched (they already point at since-removed files).