Namespaces

ovok.questionnaires and ovok.questionnaireResponses

Pre-fill questionnaires, submit responses and extract observations.

  • Stable unknown
  • Release candidate since 0.4.49-rc.4
  • Development since 0.4.49-dev.517+4645a0a

ovok.questionnaires runs questionnaire operations on the FHIR server. ovok.questionnaireResponses saves and processes the answers. Patient apps call both for the signed-in user.

Pre-fill a questionnaire

populate runs $populate on a stored Questionnaire.

const filled = await ovok.questionnaires.populate('questionnaire-id');
  • Pass a Parameters resource as the second argument to give the server context. Without it, an empty one is sent.
  • It resolves to the Parameters the server returns.

Submit a response

const bundle = await ovok.questionnaireResponses.submit(response);
  • submit saves one QuestionnaireResponse in a transaction and resolves to the response bundle.
  • To save derived Observations with it, use submitWithObservations(response, observations). It is one transaction, so the response is never saved without its observations.

Extract observations

const extracted = await ovok.questionnaireResponses.extract(responseId);
  • It runs $extract on a stored response and resolves to Parameters.
  • A response that is not stored yet cannot be extracted: submit it first.

Reference

Last updated on

On this page