FHIR Chat · item.required · questionnaire

Stream: questionnaire

Topic: item.required


view this post on Zulip Yunwei Wang (Apr 02 2020 at 19:04):

Assume I have a group Item 1 and subItem 1.1. I want to mandate item 1.1 is required. Do I also need to set container group Item 1 as required?

view this post on Zulip Lloyd McKenzie (Apr 02 2020 at 19:50):

Yes

view this post on Zulip Paul Lynch (Apr 02 2020 at 19:57):

I don't see that statement in the specification, and I am not sure why it should be so. Obviously, the containing group must be present in the QR, but that is by necessity due to the structure of the QR for the required sub-item.

view this post on Zulip Lloyd McKenzie (Apr 02 2020 at 20:03):

If the parent is optional, then if you exclude the parent, the child won't be included. If you want to force inclusion of the child, you must force the inclusion of the parent

view this post on Zulip Paul Lynch (Apr 02 2020 at 20:06):

What I am saying is that if you require the child, you do not need to say anything about the parent. It might be an error to set require=false on the parent, but if you you say nothing, then it is implicitly required by the child.

view this post on Zulip Lloyd McKenzie (Apr 02 2020 at 20:20):

If require=false on the parent, then it's fine to have a questionnaire response that omits the parent and thus omits the child. "required" is only evaluated within the scope of the parent, not the overall questionnaire.

view this post on Zulip Paul Lynch (Apr 02 2020 at 20:47):

You are saying it would "fine "to have required=false on the parent, and required = true about the child? So, setting 'false' on the parent overrides the setting on the child?

view this post on Zulip Lloyd McKenzie (Apr 02 2020 at 20:50):

Totally fine to have false on the parent and true on the child. What that says is that if the parent is present, the child must be present. It's not an override, it's that 'required' is always contextual

view this post on Zulip Paul Lynch (Apr 02 2020 at 20:54):

The specification says required means, "An indication, if true, that the item must be present in a "completed" QuestionnaireResponse." If you apply to the child item, then if the child item says it is required, then it must be present. There is no mention of a dependency of the required status of parent items.

view this post on Zulip Lloyd McKenzie (Apr 02 2020 at 22:10):

Then we need to clarify the language. It's absolutely intended to mean in the context of the parent. Otherwise, the parent's cardinality would be irrelevant.

view this post on Zulip Lloyd McKenzie (Apr 02 2020 at 22:10):

Can you submit a change request?

view this post on Zulip Paul Lynch (Apr 03 2020 at 01:07):

J#26684

view this post on Zulip Yunwei Wang (Apr 03 2020 at 13:44):

Wait. I thought without required means required=false. Is that not?

view this post on Zulip Lloyd McKenzie (Apr 03 2020 at 14:41):

If you omit 'required', the meaning if missing is the same as if it was false

view this post on Zulip Paul Lynch (Apr 03 2020 at 19:29):

"generally"

view this post on Zulip Lloyd McKenzie (Apr 03 2020 at 19:29):

I can't think of any exceptions...

view this post on Zulip Paul Lynch (Apr 03 2020 at 19:43):

I would have said that if an item is a group and has a child item that is required, then that group is "required" (i.e. it will show up in the QR) even if "required" is not explicitly set. I think that is LHC-Forms' (lforms) behavior. I think there is currently enough ambiguity in the spec to allow such an interpretation.

view this post on Zulip Lloyd McKenzie (Apr 03 2020 at 19:46):

That's absolutely not true. If the group isn't marked as required, it's not required - regardless of the required values of the children. How would you expect a questionnaire to behave where the group explicitly says required=false when a child question is required=true?

view this post on Zulip Lloyd McKenzie (Apr 03 2020 at 19:46):

required is definitely only in the context of the parent.

view this post on Zulip Paul Lynch (Apr 03 2020 at 19:51):

I am really not sure what it means to say that a group is required, unless you mean the that items in the group are required. I think "required" applies to items that are questions.

view this post on Zulip Lloyd McKenzie (Apr 03 2020 at 19:54):

A group being required means that the group must have at least one repetition in the QR - and the group must have at least one child item in the QR. It also means than any expectations around items contained within the group would come into play.

view this post on Zulip Lloyd McKenzie (Apr 03 2020 at 19:54):

(i.e. required items)

view this post on Zulip Paul Lynch (Apr 03 2020 at 19:58):

What if a group is required and no child items are required?

view this post on Zulip Lloyd McKenzie (Apr 03 2020 at 20:41):

One of the child items must be present

view this post on Zulip Paul Lynch (May 06 2021 at 17:23):

If you have two question of type "text", A and B, with B a child item of A, and with A "required", then if the user fills out B but leaves A blank, should the form validate?

view this post on Zulip Lloyd McKenzie (May 06 2021 at 17:35):

No. A required question means "must have an answer"

view this post on Zulip Paul Lynch (May 06 2021 at 17:36):

I am glad you think that. However, the documentation for required says, " if true, ... the item must be present in a "completed" QuestionnaireResponse." In this case, A would appear in the QR because its child item (B) has an answer.

view this post on Zulip Lloyd McKenzie (May 06 2021 at 17:39):

Sounds like clarification is needed for items that are a 'question' - care to submit a change request?

view this post on Zulip Paul Lynch (May 06 2021 at 17:48):

Sure. FHIR-32151

view this post on Zulip Brian Postlethwaite (May 11 2021 at 22:25):

In my implementation, we've relaxed all the conditional stuff to warnings if the status in InProgress.

view this post on Zulip Jing Tang (May 19 2021 at 11:31):

Paul Lynch said:

I am glad you think that. However, the documentation for required says, " if true, ... the item must be present in a "completed" QuestionnaireResponse." In this case, A would appear in the QR because its child item (B) has an answer.

Late to the party... but I would say this scenario is not possible. In the QR, we can't have question A of type text with a child question B of type text, where A has no answer and B has an answer. In a previous discussion on nested items, Lloyd clarified that if a question is nested under another question (as opposed to nested under a group), then the corresponding answer(s) in the QR needs to be nested under the answer(s) to the parent question.

view this post on Zulip Lloyd McKenzie (May 19 2021 at 16:19):

That is correct. You can't have a child question of a question with no answer because child questions are always children of an answer.

view this post on Zulip Paul Lynch (May 20 2021 at 13:10):

I am not saying Jing is wrong, but I don't follow Lloyd's reasoning. Structurally, you could have item.answer.item.answer.valueString, without having item.answer.valueString. But maybe some constraint was added to prevent that?

view this post on Zulip Paul Lynch (May 20 2021 at 13:18):

Also, if that were the case, then I think item.answer.value[x] should be 1..1.

view this post on Zulip Lloyd McKenzie (May 20 2021 at 13:23):

I agree. I don't know why it's not. Can you submit a change request?

view this post on Zulip Paul Lynch (May 20 2021 at 13:26):

Sure, but I would like to understand better why that should be required. Does it make something easier? One can imagine a form where the main field for an item can be left blank, as long as one of the child fields is filled in, although I don't know whether it would be necessary to design a form that way.

view this post on Zulip Lloyd McKenzie (May 20 2021 at 13:29):

Nesting happens beneath each answer. What would a nesting mean if there wasn't actually an answer?

view this post on Zulip Paul Lynch (May 20 2021 at 13:49):

item.answer.item says it is for collecting "additional details" about an answer. But suppose you had a form with item.text = "Practitioner name", an then item.answer.items for phone number and address. Maybe for one practitioner, the user cannot quite remember the name but does remember the practice name, address, and a phone number. That would be useful information to collect, even without the answer to main item. Of course, one could rearrange the form with the top level item being a group that said, "Practitioner", and then all the answers (including "name") are together under that.

view this post on Zulip Lloyd McKenzie (May 20 2021 at 13:52):

If the first is a repeating question, how do you know what the address and phone number are for? If it's not, why are they nested questions?

view this post on Zulip Lloyd McKenzie (May 20 2021 at 13:53):

A better example would be "which of these conditions have you had?" (answers are diabetes, hypertension, etc.) and child questions might be "date diagnosed? still active?"

view this post on Zulip Lloyd McKenzie (May 20 2021 at 13:54):

That's really what 'child' questions are for. And they'd be meaningless if there wasn't an answer for the parent.

view this post on Zulip Paul Lynch (May 20 2021 at 17:33):

It sounds like you are saying child questions are for the cases where the child question answers would be meaningless without an answer to the parent. I don't have a reason to object to that, although I don't think it is a necessary to define it that way. Anyway, it should be clarified in the specification.

view this post on Zulip Lloyd McKenzie (May 20 2021 at 17:39):

Agree. Are you willing to create a tracker item or do you want me to?

view this post on Zulip Paul Lynch (May 20 2021 at 17:45):

FHIR-32665


Last updated: Apr 12 2022 at 19:14 UTC