Skip to main content

Questionnaire workflows

The SDK wraps Ovok's Questionnaire operations and helps keep a response and its extracted clinical observations in one workflow.

Populate a response​

const response = await client.populateQuestionnaire(questionnaireId);

The operation asks the backend to prefill a response for the authenticated patient. The patient, project, and access policy determine which data can be used. See Populate a Questionnaire for request and response details.

Submit the response and observations​

const result = await client.submitQuestionnaireResponse(
questionnaireResponse,
observations,
);

Use this helper when the app has a QuestionnaireResponse plus Observation resources represented by its answers. The SDK submits the related writes as one transaction so the response and extracted observations do not drift apart after a partial save.

Extract from a saved response​

const observations = await client.extractQuestionnaireObservations(responseId);

Extraction returns the Observation resources derived by the backend from the saved response. See Extract a QuestionnaireResponse for the operation's behavior and returned FHIR resources.

Use the FHIR reference for resource shapes and FHIR elements for the fields used by your questionnaire.