Skip to content

Show $validate errors in the write-back dialog #2134

Open

Description

@oliveregger

Is your feature request related to a problem? Please describe.

With enable-bundle-validation set in the SMART launch, Save as Final calls $validate for each extracted bundle entry. An entry with errors gets a red border and a disabled checkbox in the write-back dialog, and the alert says "1 entry has validation errors and will not be written back."

The dialog doesn't say what the errors are. The OperationOutcome is only logged with console.warn, so a user can't tell what to fix in the form, and whoever maintains the questionnaire has to open the browser console to find out which profile rule failed.

This is most noticeable when the extract produces one large resource. Our Swiss CH EKM questionnaires extract a whole document Bundle from one template. A single failing invariant (e.g. a birth date before 1900) blocks the write-back, and the dialog shows only a red "Bundle" entry.

Describe the solution you'd like

  • List the error and fatal issues of the OperationOutcome under the failing entry: diagnostics (or details.text), plus expression where the server provides it.
  • A "Copy JSON" button on a failing entry that copies its resource, so it can be pasted into a validator.

Warnings and information issues stay hidden, as they don't block the write-back.

Describe alternatives you've considered

  • Showing the full OperationOutcome as JSON. It is too long to read in the dialog: a matchbox outcome for one document Bundle has about 20 issues, most of them informational.
  • Leaving it in the console. That works for developers, not for the users who see the dialog.

Additional context

Follow-up to #1983, whose option 1 was to "surface issues in the write-back dialog". I have a PR ready for this.

Activity

  1. oliveregger commented on Oct 3, 2026

    @oliveregger
    ContributorAuthor

    Does validation messages should probably never be shown to a "real" user, but we would like to have do it to demo our setup ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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