GuidesModules

Questionnaire forms

Render and submit FHIR Questionnaires with the SDK form components

  • Stable unknown
  • Release candidate since 1.16.1-rc.3
  • Development since 1.16.1-dev.2111+9796905

Use QuestionnaireForm to render a FHIR Questionnaire as a form. The module supports paged navigation, conditional items, defaults, validation, and submission callbacks. It does not choose which questionnaire a patient may complete or decide how your application stores the response.

import { QuestionnaireForm } from "@ovok/native/questionnaire-response-form";

<QuestionnaireForm
  questionnaire={questionnaire}
  onSubmit={async (values) => saveResponse(values)}
>
  <QuestionnaireForm.Header>
    <QuestionnaireForm.Header.Title />
    <QuestionnaireForm.Header.Subtitle />
  </QuestionnaireForm.Header>
  <QuestionnaireForm.Content>
    <QuestionnaireForm.Content.Item />
    <QuestionnaireForm.Content.Error />
  </QuestionnaireForm.Content>
  <QuestionnaireForm.Navigation>
    <QuestionnaireForm.Navigation.PreviousButton />
    <QuestionnaireForm.Navigation.NextButton />
    <QuestionnaireForm.Navigation.SubmitButton />
  </QuestionnaireForm.Navigation>
</QuestionnaireForm>

Use the validation and navigation components that match the questionnaire flow, and handle submission errors at the screen boundary. If the SDK is configured to create a FHIR QuestionnaireResponse, review that behavior and the resulting resource before using it as the persisted clinical record. Do not treat hidden conditional questions as answered.

After a required-field or answer-validation message appears, it clears when the enabled questionnaire items become valid. If saving then fails, the save error takes precedence and QuestionnaireForm.Content.Error shows its retry button; retrying submits the current form values again.

References

API reference

Every export of @ovok/native/questionnaire-response-form, with signatures, props and types, is in the questionnaire-response-form API reference.

Last updated on

On this page