Skip to content

v0.0.10

Choose a tag to compare

@ryukzak ryukzak released this 27 Mar 09:18
· 154 commits to main since this release

Features

TypeSchema: Auto-collect extension dependencies during tree shake (#103)

  • Extension definitions used by profiles are now included automatically — no need to list them manually in tree shake config
  • Add ignoreExtensions tree shake rule for excluding specific extensions by canonical URL

TypeSchema/TS: Choice type narrowing and validation for profiles (#105)

  • Restrict ChoiceFieldDeclaration.choices to only the variants declared by the most derived constraint
  • Emit validateExcluded for disallowed choice variants in profile validation (e.g. body weight only permits valueQuantity, 10 others are excluded)

TypeSchema/API: Collision resolution config (#106)

  • When multiple FHIR schemas produce a binding enum with the same name (e.g. ObservationCategory from Observation and DiagnosticReport), the generator must pick one — previously it auto-selected the most common source and emitted a warning
  • Add resolveCollisions option to .typeSchema() for explicit control over which source wins
  • IR report now shows (selected) / (auto) marks and suggests config snippets for unresolved collisions

TS: Type discriminator support for slicing (#108)

  • Support type discriminator in slicing — match slices by resourceType field
  • Generate typed getters/setters for type-discriminated slices (e.g. getPatientEntry() / setPatientEntry())
  • Example: Bundle Profile SD, profile-typed-bundle.test.ts.

TS: Generic type-family fields (#109)

  • Emit generic type parameters for fields typed as a resource base type (Resource, DomainResource)
  • BundleEntry<T extends Resource = Resource>, DomainResource<T> — unparameterized usage is unchanged
  • Profile slices use narrowed generics: BundleEntry<Patient>, BundleEntry<Organization>

TypeSchema refactoring

  • Renames (#114, #117):
    • RegularTypeSchemaSpecializationTypeSchema
    • IdentifierTypeIdentifier
    • NestedTypeSchemaNestedType
  • Remove generated profile override interface (#104)
  • Narrow FieldSlicing discriminator type from string to literal union (#110)
  • Add typeFamily.complexTypes, remove resourceChildren (#111)
  • Make SpecializationTypeSchema a discriminated union: ResourceTypeSchema | ComplexTypeTypeSchema | LogicalTypeSchema (#113)
  • Split resolve into resolve(Identifier) and resolveType(TypeIdentifier) (#113)
  • Split dependency types: Identifier[] for specializations, TypeIdentifier[] for profiles (#118)

Maintenance

  • Update @atomic-ehr/fhirschema to 0.0.9 (#119)
  • Remove dead code found by knip (#120)

Full Changelog: v0.0.9...v0.0.10