This PR introduces a few fixes and improvements in QuestionnaireController class.
Fixes only rendering nested questionnaire items that were a child of a QuestionnaireItem of type group. In FHIR any QuestionnaireItem can have child items. eg a QuestionnaireItem of type text, group, questions can have child items of any type. or any QuestionnaireItem can have a child display item with extension coding of help acting as the help text of the parent item. (Also done the same for generating QuestionnaireResponseItem objects)
Updates the onGenerateItemResponse callback method to also provide the generated QuestionnaireResponseItem as an argument of this callback. This way when this callback is being implemented it is also possible to just modify the QuestionnaireResponseItem and return it. Many times it is only desired to modify a field or add an extra extension to a generated QuestionnaireResponseItem of certain type and just return it. Other than that it is required, since each generated QuestionnaireResponseItem can have generated children items. So by simply not providing the generated QuestionnaireResponseItem, its children are not being provided as well in the callback.
Converts onBuildItemBundle to onBuildItemView since almost always it is just desired to render a custom item view to be rendered for a type of questionnaireItem. To delegate the entire generation of QuestionnaireBundleItem in the callback will be much harder for the implementors, If all they want is to just custom render a questionnaire item, the responsibility to also generate children and groupIds shouldn't fall to them.
Fixes the enableWhen not working when the enable.question was not in the same group
This PR introduces a few fixes and improvements in
QuestionnaireController
class.group
. In FHIR anyQuestionnaireItem
can have child items. eg aQuestionnaireItem
of type text, group, questions can have child items of any type. or anyQuestionnaireItem
can have a child display item with extension coding ofhelp
acting as the help text of the parent item. (Also done the same for generating QuestionnaireResponseItem objects)onGenerateItemResponse
callback method to also provide the generatedQuestionnaireResponseItem
as an argument of this callback. This way when this callback is being implemented it is also possible to just modify theQuestionnaireResponseItem
and return it. Many times it is only desired to modify a field or add an extra extension to a generatedQuestionnaireResponseItem
of certain type and just return it. Other than that it is required, since each generatedQuestionnaireResponseItem
can have generated children items. So by simply not providing the generated QuestionnaireResponseItem, its children are not being provided as well in the callback.onBuildItemBundle
toonBuildItemView
since almost always it is just desired to render a custom item view to be rendered for a type of questionnaireItem. To delegate the entire generation ofQuestionnaireBundleItem
in the callback will be much harder for the implementors, If all they want is to just custom render a questionnaire item, the responsibility to also generate children and groupIds shouldn't fall to them.enable.question
was not in the same group