Skip to content

TS: validate() should check required fields inside slice elements #123

@ryukzak

Description

@ryukzak

The generated validate() method checks slice cardinality (e.g. systolic and diastolic slices exist) but does not validate required fields within slice elements.

Example

The BP profile requires component.valueQuantity (min: 1) for both systolic and diastolic slices. After create(), auto-populated stubs have only the discriminator code but no valueQuantity:

const profile = bpProfile.create({
    status: "final",
    subject: { reference: "Patient/pt-1" },
});

// Only reports missing effective[x], but should also report
// missing valueQuantity in systolic and diastolic component stubs
profile.validate().errors
// Actual:   ["at least one of effectiveDateTime, effectivePeriod is required"]
// Expected: should also include errors about missing component.valueQuantity

Scope

  • Affects src/api/writer-generator/typescript/profile-validation.ts
  • Needs to iterate slice elements and check required fields within each matched slice
  • Applies to all profiles with required fields inside slices (BP components, etc.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions