Adaptive questionnaire next question

Hi there,
I am building a proof of concept of SDC\Adaptive questionnaire next question - FHIR v3.5.0 and can’t find good examples describing the workflow of the REST API calls.

My understanding is:

  • start the questionnaire: send an empty QuestionnaireResponse with contained only. then gets the updated Questionnaire, with the first question only.
  • sends the next QuestionnaireResponse with value for the first question, then receives the updated Questionnaire with the next question only
  • rinse and repeat until the Questionnaire.status is marked as complete

Questions:

  • should the request be POST? got this fun error from the server
    { "resourceType": "OperationOutcome", "text": { "status": "generated", "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><h1>Operation Outcome</h1><table border=\"0\"><tr><td style=\"font-weight: bold;\">ERROR</td><td>[]</td><td><pre>Invalid request: The FHIR endpoint on this server does not know how to handle POST operation[Questionnaire/$next-question] with parameters [[_format]]</pre></td>\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t</tr>\n\t\t</table>\n\t</div>" }, "issue": [ { "severity": "error", "code": "processing", "diagnostics": "Invalid request: The FHIR endpoint on this server does not know how to handle POST operation[Questionnaire/$next-question] with parameters [[_format]]" } ] }

  • as the questionnaire will be updated during the operations what will keep the relation between each step? Questionnaire.id?

You will send the QuestionnaireResponse and get back the QuestionnaireResponse. The QuestionnaireResponse will have all answers to date and the Questionnaire will contain all questions to date. When you’re done, the QuestionnaireResponse will be marked as ‘complete’, will have all answers and will have a contained QuestionnaireResponse that contains all questions.

The QuestionnaireResponse will refer to the URL of the contained Questionnaire.