Skip to content

v0.0.11

Choose a tag to compare

@ryukzak ryukzak released this 08 Apr 12:29
· 55 commits to main since this release

Highlights

This release focuses on the TypeScript Profile API — making generated profile classes more type-safe, more complete in validation, and easier to use with slices.

Python: Extension support (#107)

Extension support for the Python/Pydantic code generator.

TypeScript Profile API

Profile apply() / create() fixes (#121)

  • apply() now sets fixed-value fields and auto-populates discriminator-only slice stubs, matching create() behavior
  • Fixed-value fields get a getter but no setter
  • Extension apply() sets URL, uses upsert for single extensions

Remove buildResource, fix type safety (#126)

  • Remove buildResource<T>() helper — createResource now uses plain object literals for better type checking
  • Generate Reference<string /* Resource */> for family type references so narrower references like Reference<"Patient"> are assignable to base type fields
  • Fix tryPromoteChoice to correctly resolve reference targets with generic params

SliceFlat / SliceFlatAll type split (#127)

Slice flat types are now split into two:

  • SliceFlat — setter input, discriminator fields omitted (auto-applied)
  • SliceFlatAll — getter return, includes readonly discriminator literal types
setVSCat(input?: VSCatSliceFlat): this              // no discriminators needed
getVSCat(): VSCatSliceFlatAll | undefined            // includes { coding: [...] }

Array API for unbounded slices (#129)

Slices with max: * now use array-based setters/getters instead of single-element API:

// Before — second call replaces first
bundle.setOrganizationEntry({ resource: org1 });
bundle.setOrganizationEntry({ resource: org2 });

// After — set all at once
bundle.setOrganizationEntry([{ resource: org1 }, { resource: org2 }]);

Slice field validation (#130)

validate() now checks required fields inside matched slice elements. For example, BP profile reports missing valueQuantity in component slices:

profile.validate().errors
// [
//   "component[SystolicBP].valueQuantity is required",
//   "component[DiastolicBP].valueQuantity is required",
// ]

Cleanup (#131)

  • Remove dead stripMatchKeys export
  • Document Profile API in CLAUDE.md

Contributors

Full Changelog: v0.0.10...v0.0.11