0.2.2 • Published 5 months ago

@iguhealth/questionnaire-component v0.2.2

Weekly downloads
-
License
BSL 1.1 refer [ht...
Repository
-
Last release
5 months ago

Questionnaire Component

Installation

Install via npm i @iguhealth/questionnaire-component

Usage

import "@iguhealth/questionnaire-component/css/antd.min.css";
import "@iguhealth/questionnaire-component/css/custom.css";
import { QuestionnaireReact } from "@iguhealth/questionnaire-component";

<QuestionnaireReact
    id="unique-identifier"
    expand={async (valueset) => {
            // Use whatever method to derive expanded valueset
            // whether fetch or inline here.
          }}
    onChange={(qr) => console.log(qr)}
    questionnaire={prepare} />

Properties

PropertyDescriptionrequired?
idUnique identifier for the Questionnaire (note this is distinct from Questionnaire.id as you could have multiple instances of the same Questionnaire.yes
expandAsynchronous function used during valueset expansion (choice, open-choice items).depends
onChangeOn change handler used as a callback that returns QuestionnaireResponse resource when any changes occur.no
questionnaireQuestionnaire to be rendered.yes