FHIR Chat · enableWhen and repeating elements · questionnaire

Stream: questionnaire

Topic: enableWhen and repeating elements


view this post on Zulip Kenneth Myhra (Feb 17 2020 at 15:06):

Can a question outside a repeating group have an enableWhen referring a linkId within that repeating group?

The definition at http://hl7.org/fhir/questionnaire-definitions.html#Questionnaire.item.enableWhen.question seems not to handle that case.

We have looked at this in our Form Filler and is considering "isolating" repeating groups such that an enableWhen can only refer to items within the repeating group, if itself is within that group. Thereby disallowing a question outside a repeating group to have an enableWhen referring a linkId within that repeating group

view this post on Zulip Lloyd McKenzie (Feb 17 2020 at 15:57):

Certainly we should have some clarity around the behavior here. Care to submit a change request?

As currently defined, I believe the enableWhen would be driven by the 'nearest' repetition (first for a following group, last for a preceding group), but that's rather odd behavior and probably not too useful.

view this post on Zulip Kenneth Myhra (Feb 17 2020 at 16:29):

That’s the same conclusion we came to. I’ll submit a change request

view this post on Zulip Kenneth Myhra (Feb 17 2020 at 18:05):

FHIR-26312

view this post on Zulip Brian Postlethwaite (Feb 18 2020 at 00:47):

Would a case where you have a follow up group after a repeating section that checks inside for the presence of a specific question answer/combination of answers to enable it to ask?
(I don't have a need for it, but was just considering possibilities that might make sense)

view this post on Zulip Kenneth Myhra (Feb 18 2020 at 08:20):

We actually went briefly through the use case you're suggesting. I was a bit wary of the level of complexity it could add, but looking at your definition it might not be that complicated. I'm also thinking that it does not necessarily need to physically come after the repeating section although that would probably make sense from UX level.

view this post on Zulip Kenneth Myhra (Feb 19 2020 at 12:01):

Does this sound like a possible rule set that could work for my original question and Brian's suggested additional use case?

  • An enableWhen within a repeating group can only refer to items within one instance of the repeating group, effectively isolating its context
  • An enableWhen that lives outside a repeating section, but refers to items in a repeating section will be enabled if the presence of a specific answer or combination of answers exists

view this post on Zulip Lloyd McKenzie (Feb 19 2020 at 16:05):

My preference is that if we're going to talk about pointing into repeating things, you should use enableWhenExpression - that allows you to define very concretely what your expectations are (all of, at least one of, etc.)

view this post on Zulip Kenneth Myhra (Feb 19 2020 at 17:24):

Agree, I was not aware of that one

view this post on Zulip Brian Postlethwaite (Feb 20 2020 at 09:53):

Agree with using expression there.


Last updated: Apr 12 2022 at 19:14 UTC