FHIR Chat · get questionnaire user input · questionnaire

Stream: questionnaire

Topic: get questionnaire user input


view this post on Zulip Japheth Kiprotich (Jan 27 2022 at 12:04):

Hi @all I have the following questionnaire: When I submit the data it only validates the first entry while it accepts null for the other
c.png b.png a.png

view this post on Zulip Lloyd McKenzie (Jan 27 2022 at 18:18):

I'm not clear on what a, b and c represent with respect to your question. Can you show example QuestionnaireResponses that have the trouble? I'm not sure what it means when you say "it accepts null".

view this post on Zulip Brian Postlethwaite (Jan 28 2022 at 00:02):

I'm expecting that you're wondering why a server would not reject without an answer to 1.0.1?
That would be because the group parent 1.0.0 is not required, and thus if that wasn't in there, it's valid.
If you want the group to also be mandatory, you'd need to require that too.

view this post on Zulip Paul Lynch (Feb 04 2022 at 18:07):

Brian Postlethwaite said:

I'm expecting that you're wondering why a server would not reject without an answer to 1.0.1?
That would be because the group parent 1.0.0 is not required, and thus if that wasn't in there, it's valid.
If you want the group to also be mandatory, you'd need to require that too.

Marking an item "required" doesn't require it unless all the ancestor items are also required? I don't see that stated at https://www.hl7.org/fhir/questionnaire-definitions.html#Questionnaire.item.required. @Lloyd McKenzie

view this post on Zulip Lloyd McKenzie (Feb 04 2022 at 18:12):

A required element is only required in context. If a question is required and the parent group is optional, if you don't include the group, the fact the question was required is irrelevant.

view this post on Zulip Lloyd McKenzie (Feb 04 2022 at 18:16):

If you think more clarification is needed, feel free to submit a tracker

view this post on Zulip Paul Lynch (Feb 04 2022 at 18:23):

Lloyd McKenzie said:

A required element is only required in context. If a question is required and the parent group is optional, if you don't include the group, the fact the question was required is irrelevant.

I also don't see that stated at https://build.fhir.org/ig/HL7/sdc/behavior.html#required, which might be the place to edit first. I will file a tracker item. It is not what I would have expected.

view this post on Zulip Lloyd McKenzie (Feb 04 2022 at 18:32):

It's the same rule for cardinality everywhere. Cardinality reflects what's needed in context. Having a 1..1 element inside a 0..1 element doesn't matter if you exclude the parent element.

view this post on Zulip Paul Lynch (Feb 04 2022 at 18:38):

I do understand the parallel between repeats/required and cardinality, but it does not feel the same. "required" is just a boolean flag which does not even need to be stated on each element, and the description says if you mark an item required=true, then it must appear in the QR. The fact that you also need to go up the chain of parents and set required=true on those is not expected or suggested. Certainly people writing Questionnaire by hand would not be likely to think of that, and one does not to think too hard to imagine some form filler developers might not think of it either.

view this post on Zulip Paul Lynch (Feb 04 2022 at 18:49):

FHIR-35957

view this post on Zulip Lloyd McKenzie (Feb 04 2022 at 19:38):

Required is simply a light-weight way of specifying cardinality. required=true means minOccurs >0.

view this post on Zulip Lloyd McKenzie (Feb 04 2022 at 19:38):

If you're filling out a form and a section is optional, the fact a question is required within the section doesn't matter.


Last updated: Apr 12 2022 at 19:14 UTC