Skip to content

feat(fields): adds new features for FHIR Support capability + Minor Enhancements#88

Open
lattln wants to merge 6 commits into
mainfrom
feature/add-fhir-requirements
Open

feat(fields): adds new features for FHIR Support capability + Minor Enhancements#88
lattln wants to merge 6 commits into
mainfrom
feature/add-fhir-requirements

Conversation

@lattln

@lattln lattln commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

Overview

This PR adds FHIR-required questionnaire support for file upload and open-choice responses.

It introduces two new field types, file and openchoice, and wires them through the core type system, field registry, builder, renderer, condition logic, response hydration, validation, and FHIR adapter. These changes allow questionnaires to capture attachment-based answers and choice answers that can include user-entered custom values.

What Changed

  • Added a new FileField component for single or multiple file uploads.

  • Added a new OpenChoiceField component for predefined options with custom user-entered values.

  • Extended core field definitions, Zod schemas, and field type metadata for file and openchoice.

  • Added fileData response support for attachment answers.

  • Updated the field registry with metadata for the new field types.

  • Registered the new fields across the builder and renderer default field sets.

  • Added icons and exports for the new field components.

  • Updated condition evaluation to support:

    • open-choice selected values
    • custom open-choice values
    • file count expressions
    • file attachment values in condition checks
  • Updated validation so uploaded files are treated as non-empty responses.

  • Improved response hydration for file/media attachment answers.

  • Updated the FHIR adapter to map:

    • file responses to FHIR valueAttachment
    • open-choice responses to coding answers, including custom values
  • Added expanded test coverage for condition behavior and adapter conversion.

How to Test

  1. Create a questionnaire with a file field.
  2. Verify the file field renders correctly in the builder and renderer.
  3. Upload a single file and confirm the response stores the attachment metadata.
  4. Configure the file field for multiple files and verify multiple attachments are stored correctly.
  5. Add validation constraints such as accepted file types or maximum file size and verify the UI behavior.
  6. Create a questionnaire with an openchoice field.
  7. Select a predefined option and confirm the selected value is stored correctly.
  8. Enter a custom open-choice value and confirm it is stored and hydrated correctly.
  9. Add conditional logic that depends on an open-choice response and verify it evaluates correctly.
  10. Add conditional logic that depends on uploaded file count and verify it evaluates correctly.
  11. Convert a questionnaire with file and open-choice fields through the FHIR adapter.
  12. Verify file responses map to FHIR attachment answers.
  13. Verify open-choice responses map to coding answers, including custom user-entered values.
  14. Run the affected core logic and FHIR adapter test suites.

Breaking Changes

No breaking changes.

lattln added 3 commits July 1, 2026 16:05
+ added Open Choice Field, with Radio Field functionality + an additional "other" field that can have custom input.
+ Added File Field Type (which includes, max file, max file size, accepted file type) + stores as base64.
+ Remove selection / highlighting from occuring when double clicking on all field Options
+ fix response handling for fileField
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.

Feature Request: Auto-generate field IDs from question text New Field : File Upload Field New Field : Open Choice Field

1 participant