Skip to content

Commit 255dd27

Browse files
committed
examples: move typescript-ccda to on-the-fly/ccda
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. - examples/typescript-ccda -> examples/on-the-fly/ccda; drop its redundant .gitignore (parent on-the-fly/.gitignore already ignores fhir-types/) and fix the depth-sensitive tsconfig extends + generate.ts import/output paths - Replace the test-typescript-ccda-example Makefile target with test-on-the-fly-ccda (generate -> typecheck -> test), folded into test-on-the-fly-example; drop the now-redundant unit-test line (covered by make test) - CI: remove the standalone ccda job; the on-the-fly job now covers it - Update README/examples README/.zed task references
1 parent 82be371 commit 255dd27

12 files changed

Lines changed: 25 additions & 45 deletions

File tree

‎.github/workflows/sdk-tests.yml‎

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -70,21 +70,6 @@ jobs:
7070
exit 1
7171
fi
7272
73-
test-typescript-ccda-example:
74-
runs-on: ubuntu-latest
75-
76-
steps:
77-
- uses: actions/checkout@v5
78-
79-
- name: Setup Bun
80-
uses: oven-sh/setup-bun@v2
81-
82-
- name: Install dependencies
83-
run: bun install --frozen-lockfile
84-
85-
- name: Run tests
86-
run: make test-typescript-ccda-example
87-
8873
test-python-sdk:
8974
runs-on: ubuntu-latest
9075

‎.zed/tasks.json‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
"command": "make test"
55
},
66
{
7-
"label": "test-ts-r4-example",
8-
"command": "make test-typescript-r4-example"
7+
"label": "test-ts-r4-us-core-example",
8+
"command": "make test-typescript-r4-us-core-example"
99
},
1010
{
1111
"label": "test-ts-ccda-example",
12-
"command": "make test-typescript-ccda-example"
12+
"command": "make test-on-the-fly-ccda"
1313
}
1414
]

‎Makefile‎

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ VERSION = $(shell cat package.json | grep version | sed -E 's/ *"version": "//'
77
.PHONY: all generate-types lint lint-fix lint-unsafe typecheck \
88
test test-multi-package \
99
prepare-aidbox-runme test-all-example-generation test-other-example-generation \
10-
test-on-the-fly-example test-on-the-fly-norge-r4 test-on-the-fly-kbv-r4 \
10+
test-on-the-fly-example test-on-the-fly-norge-r4 test-on-the-fly-kbv-r4 test-on-the-fly-ccda \
1111
test-typescript-r4-us-core-example test-typescript-custom-packages-example \
12-
test-typescript-ccda-example test-mustache-java-r4-example \
12+
test-mustache-java-r4-example \
1313
test-csharp-sdk generate-python-sdk generate-python-sdk-fhirpy generate-python-us-core-sdk \
1414
python-test-setup python-fhirpy-test-setup python-us-core-test-setup \
1515
test-python-sdk test-python-fhirpy-sdk test-python-us-core-example
1616

17-
all: test test-multi-package test-typescript-r4-us-core-example test-typescript-ccda-example test-typescript-custom-packages-example lint-unsafe test-all-example-generation
17+
all: test test-multi-package test-typescript-r4-us-core-example test-typescript-custom-packages-example lint-unsafe test-all-example-generation
1818

1919
generate-types:
2020
bun run scripts/generate-types.ts
@@ -60,12 +60,11 @@ test-all-example-generation: test-other-example-generation
6060
bun run examples/python-r4/generate.ts
6161
bun run examples/python-fhirpy/generate.ts
6262
bun run examples/python-us-core/generate.ts
63-
bun run examples/typescript-ccda/generate.ts
6463
bun run examples/typescript-r4-us-core/generate.ts
6564

6665
test-other-example-generation: test-on-the-fly-example
6766

68-
test-on-the-fly-example: test-on-the-fly-norge-r4 test-on-the-fly-kbv-r4
67+
test-on-the-fly-example: test-on-the-fly-norge-r4 test-on-the-fly-kbv-r4 test-on-the-fly-ccda
6968

7069
test-on-the-fly-norge-r4: typecheck
7170
bun run examples/on-the-fly/norge-r4/generate.ts
@@ -77,19 +76,16 @@ test-on-the-fly-kbv-r4: typecheck
7776
$(TYPECHECK) --project examples/on-the-fly/kbv-r4/tsconfig.json
7877
bun test ./examples/on-the-fly/kbv-r4/
7978

79+
test-on-the-fly-ccda: typecheck
80+
bun run examples/on-the-fly/ccda/generate.ts
81+
$(TYPECHECK) --project examples/on-the-fly/ccda/tsconfig.json
82+
bun test ./examples/on-the-fly/ccda/
83+
8084
test-typescript-r4-us-core-example: typecheck
8185
bun run examples/typescript-r4-us-core/generate.ts
8286
$(TYPECHECK) --project examples/typescript-r4-us-core/tsconfig.json
8387
bun test ./examples/typescript-r4-us-core/
8488

85-
test-typescript-ccda-example: typecheck
86-
bun test test/unit/typeschema/transformer/ccda.test.ts
87-
bun run examples/typescript-ccda/generate.ts
88-
$(TYPECHECK) --project examples/typescript-ccda/tsconfig.json
89-
bun test --project examples/typescript-ccda/tsconfig.json \
90-
./examples/typescript-ccda/demo-cda.test.ts \
91-
./examples/typescript-ccda/demo-ccda.test.ts
92-
9389
test-typescript-custom-packages-example: typecheck
9490
bun run examples/typescript-custom-packages/generate-local.ts
9591
bun run examples/typescript-custom-packages/generate-sql-on-fhir.ts

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ yarn add @atomic-ehr/codegen
117117
See the [examples/](examples/) directory for working demonstrations:
118118

119119
- **[typescript-r4-us-core/](examples/typescript-r4-us-core/)** - FHIR R4 core + US Core type generation with resource creation, profiles, and extensions
120-
- **[typescript-ccda/](examples/typescript-ccda/)** - C-CDA on FHIR type generation
120+
- **[on-the-fly/ccda/](examples/on-the-fly/ccda/)** - C-CDA on FHIR type generation (logical models, generated on the fly)
121121
- **[python/](examples/python/)** - Python/Pydantic model generation with simple requests-based client
122122
- **[python-fhirpy/](examples/python-fhirpy/)** - Python/Pydantic model generation with fhirpy async client
123123
- **[csharp/](examples/csharp/)** - C# class generation with namespace configuration

‎examples/README.md‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@ This directory contains working examples demonstrating the capabilities of Atomi
1111
- Resource creation, base R4 profiles (bodyweight, blood pressure), and bundle composition
1212
- US Core profiles with type-safe race/ethnicity/birth-sex extensions and observation slicing
1313

14-
- **[typescript-ccda/](typescript-ccda/)** - C-CDA on FHIR type generation
15-
- `generate.ts` - Generates types from HL7 CDA UV Core package (`hl7.cda.uv.core@2.0.1-sd`)
16-
- Exports TypeSchema files and dependency tree
17-
1814
### Multi-Language Generation
1915

2016
- **[python/](python/)** - Python/Pydantic model generation with simple requests-based client
@@ -60,6 +56,10 @@ These examples pull packages from the FHIR registry and generate types on-the-fl
6056
- `generate.ts` - Fetches KBV packages with `ignorePackageIndex: true` for corrupt package indices
6157
- `profile-patient.test.ts` - Regression test for `meta` merge in profiles with required `meta` (#137)
6258

59+
- **[on-the-fly/ccda/](on-the-fly/ccda/)** - C-CDA on FHIR type generation (HL7 CDA logical models)
60+
- `generate.ts` - Builds a `CanonicalManager` with `preprocessPackage` fixes and `promoteLogical` for CDA resources
61+
- `demo-cda.test.ts` / `demo-ccda.test.ts` - CDA ↔ FHIR R4 mapping demos
62+
6363
## Running Examples
6464

6565
Each example contains a `generate.ts` script that can be run with:
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ This example demonstrates how to generate TypeScript interfaces from the HL7 CDA
1616
To generate TypeScript types for CDA:
1717

1818
```bash
19-
bun run examples/typescript-ccda/generate.ts
19+
bun run examples/on-the-fly/ccda/generate.ts
2020
```
2121

22-
This will output to `./examples/typescript-ccda/fhir-types/` and create debug files.
22+
This will output to `./examples/on-the-fly/ccda/fhir-types/` (gitignored, regenerated on CI) and create debug files.
2323

2424
## Configuration
2525

File renamed without changes.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
import { CanonicalManager, type PreprocessContext } from "@atomic-ehr/fhir-canonical-manager";
55
import { registerFromManager } from "@root/typeschema/register";
6-
import { APIBuilder, prettyReport } from "../../src/api/builder";
6+
import { APIBuilder, prettyReport } from "../../../src/api/builder";
77

88
const preprocessPackage = (ctx: PreprocessContext): PreprocessContext => {
99
if (ctx.kind !== "resource") return ctx;
@@ -80,7 +80,7 @@ if (require.main === module) {
8080
.throwException()
8181
.typeSchema({ promoteLogical: { "hl7.cda.uv.core": cdaResources } })
8282
.typescript({ withDebugComment: false })
83-
.outputTo("./examples/typescript-ccda/fhir-types")
83+
.outputTo("./examples/on-the-fly/ccda/fhir-types")
8484
.introspection({
8585
typeSchemas: "TS",
8686
fhirSchemas: "FS",
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"extends": "../../../tsconfig.json",
3+
"include": ["."]
4+
}

0 commit comments

Comments
 (0)