Construct a new instance from a questionnaire and possible a response object.
If you don't pass a response object, the status will always be initialized with in-progress.
Optional
response: QuestionnaireResponse_2_0_0Builds the final response objects from all the answers.
This basically iterates over everything and excludes the disabled questions.
After this call the this.errors and this.validationErrors will contain the errors that happened while iterating.
Get an answer from the response object by this linkId searching the passed response items.
Note: The FHIR standard requires a certain search order when searching for a value based on the link id e.g. inside enableWhen evaluations. This search order makes a difference when a questionnaire uses the same linkId multiple times. (Apparently it doesn't have to be unique) The workflow is roughly this, but have a look at the documentation: 1) Search the hierarchy upwards (from the current element) 2) Search the questions before 3) Search the questions after At the moment we assume, that we have unique linkIds, so we do not use this approach and just search from top to bottom (depth first).
The link of the question / response item
Iterates over all questions of the questionnaire.
After this call the this.errors and this.validationErrors will contain the errors that happened while iterating.
Optional
options: QuestionnaireResponseBuilderIteratorOptionsChecks whether the current answers are valid.
This happens by iterating over all items and checking whether they produce any validation errors.
After this call the this.errors and this.validationErrors will contain the errors that happened while iterating.
This is a utility class that makes it easy to implement rendering questionnaires.
It provides an iterator that you can use to simultaneously iterate over questionnaires and a response object. It also calculates the enabled state the current value etc.