Skip to content

fix(ts-profile): preserve fixed CodeableConcept codings#165

Merged
ryukzak merged 1 commit into
atomic-ehr:mainfrom
cognovis:fix/codegen-vwd
Jun 1, 2026
Merged

fix(ts-profile): preserve fixed CodeableConcept codings#165
ryukzak merged 1 commit into
atomic-ehr:mainfrom
cognovis:fix/codegen-vwd

Conversation

@sussdorff
Copy link
Copy Markdown
Contributor

@sussdorff sussdorff commented May 23, 2026

Summary

  • generated TypeScript profile apply() methods now use a fixed-value merge helper instead of replacing fixed fields with Object.assign
  • fixed CodeableConcept codings preserve compatible caller-provided secondary codings while adding missing fixed codings
  • placeholder-only ValueSet expansions such as a sole UNK code no longer generate enum validation constraints
  • the R4 bodyweight example now asserts factory equivalence with an apply() input that does not include extra preserved text

Validation

  • bun test test/api/write-generator/typescript.test.ts
  • bun run typecheck
  • bun run lint (passes with existing warnings in profile-validation.ts and utils.ts)
  • bunx biome check touched files
  • bun examples/typescript-r4/generate.ts
  • bun examples/typescript-us-core/generate.ts
  • make test-typescript-r4-example
  • bun run build
  • attempted bun test; Bun 1.2.18 segfaulted after ~165s in the multi-package test run, with no assertion failure before the runtime crash

Context

This fixes the downstream FPDECoveragePrivatProfile/VWD failure mode generically in codegen rather than patching generated output.

Add a generic fixed-value merge helper for generated TypeScript profile apply() methods so fixed CodeableConcept codings are applied without dropping compatible caller-provided codings. Skip placeholder-only UNK ValueSet expansions when generating enum constraints.

Bead: codegen-vwd
sussdorff added a commit to cognovis/codegen that referenced this pull request May 24, 2026
Replants cognovis/mira-adapters onto cognovis/next + committed dist/.

Includes:
- Consolidated canonical-resolver fix (codegen-vrq + codegen-pkt)
- Inherited-required validate() emission (codegen-8iw, upstream PR atomic-ehr#166)
- Preserve fixed CodeableConcept codings (codegen-vwd, upstream PR atomic-ehr#165)
- COGNOVIS strategy doc + bd init infrastructure
- KBV newer-deps repro script
@sussdorff sussdorff marked this pull request as ready for review May 25, 2026 06:07
@ryukzak
Copy link
Copy Markdown
Collaborator

ryukzak commented Jun 1, 2026

Looks good, thank you!

Will be in a release in a few days.

@ryukzak ryukzak merged commit c09ba63 into atomic-ehr:main Jun 1, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants