Stream: questionnaire
Topic: Why must QR structure match Q?
Eric Haas (May 30 2018 at 01:51):
In re to this guidance, I am curious why. if you have the link_id your are good to go....
"The QuestionnaireResponse structure must be consistent with the Questionnaire (i.e. questions must be organized into the same groups, nested questions must still be nested, etc."
Lloyd McKenzie (May 30 2018 at 02:57):
Link id won't help with repeating groups. And seeing as nesting is essential some of the time, it's easiest on implementers to be consistent and require it all the time.
Eric Haas (May 30 2018 at 04:55):
'Link id won't help with repeating groups.' I don't understand this, each item has a unique id so you can always trace back to the item. I certainly think flatter is easier so I'm not sure its easier. Maybe the guidance is overly prescriptive?
Brian Postlethwaite (May 30 2018 at 09:01):
The grouped linkid and nesting keeps associated responses together, like rows in a table.
Lloyd McKenzie (May 30 2018 at 13:22):
Scenario: You have a repeating group for each relative (linkId=1). You then have questions about the relative's age, gender, conditions(1.1, 1.2, 1.3, etc.) If you capture everything as a flat list, how do you tell which 1.1 and 1.2 go together? You'd just have a whole bunch of 1.1s and 1.2s with nothing collecting them.
Eric Haas (May 30 2018 at 14:42):
OK thanks for the explanation.
Lloyd McKenzie (May 30 2018 at 14:59):
np
Eric Haas (Jun 08 2018 at 21:10):
Why not append an index to the linkId (1.1[0], 1.2[0], 1.3[0]) so QR is flat. linkIdRepeat type int 0..1
Grahame Grieve (Jun 08 2018 at 21:12):
that's how we do structure definition. For me, the primary reason there is a difference between the two cases is because structure definition has internal nesting references. So with SD, you effectively need a flat view and a nested view. Most of us who work with SD have the nesting as a view in memory. I've seen no such complexity with QR. So while what you suggest could be made to work, I'm not seeing any benefits
Eric Haas (Jun 08 2018 at 21:29):
To me making qr flat seems like a benefit. But I haven't done it either way yet.
Lloyd McKenzie (Jun 08 2018 at 21:53):
Nesting makes it much easier to work with and render the QuestionnaireResponse alone. It's also easier for implementers to wrap their heads around it when the response mirrors the Questionnaire. Given that it's easier for implementers and we have no need to do it the other way, why would we?
Eric Haas (Jun 10 2018 at 15:20):
Because its not easier for me to wrap my head around it, otherwise I would not have raised the question.
Eric Haas (Jun 10 2018 at 15:21):
Flatter is better for me.
Grahame Grieve (Jun 10 2018 at 22:24):
why?
Alex Goel (Jun 11 2018 at 18:09):
Nesting makes it easier for maintaining clinical context within our questionnaire
Geoff Low (Jun 11 2018 at 22:21):
Ditto from the Electronic Data Capture World; we have our own model (the ODM) that allows us to manage shared context through nesting. It helps for presentation and model; it's easier to flatten a nested model for your purposes than vice versa in my experience.
Eric Haas (Jun 11 2018 at 23:24):
FYI I was referring to QR not Q. No problems with Q being nested.
Lloyd McKenzie (Jun 12 2018 at 12:28):
@Eric Haas Can you answer Grahame's question of "why" you prefer a flat model?
Eric Haas (Jun 12 2018 at 19:03):
I'm trying to implement it before answering. For now is just my Zen of Python belief that its an inherently simpler approach.
Eric Haas (Jun 13 2018 at 15:17):
OK, Now that I've tried it out using a simple Flask application, I'm sticking to my guns and thinking that a flat QR is easier at least for the simple forms - especially if you render them on a single page. I think the rendering is key here if you flatten your rendering and use the out of the box request .form object you get a list of objects and so I'm haveing to indicate the index the id's anyway (or inspect the Q directly to mimic it structure) to try to reproduce the Q structure . I 'd like to understand the inherent advantage of nesting the QR vs indexed linkIds. To me its a trade-off design decision to make it harder for the easy stuff to make it easier for the harder stuff.
Eric Haas (Jun 13 2018 at 15:18):
converting to spreadsheets are another reason flatter is better :-)
Lloyd McKenzie (Jun 13 2018 at 15:22):
The solution has to work for all forms, not just the simple ones. Have you tested it where you have repeating groups of questions?
Lloyd McKenzie (Jun 13 2018 at 15:23):
Particularly where you have multiple nested repeating groups
Eric Haas (Jun 13 2018 at 16:53):
nope
Lloyd McKenzie (Jun 13 2018 at 17:17):
Try that before suggesting changes :)
Alex Goel (Jun 13 2018 at 20:29):
FYI I was referring to QR not Q. No problems with Q being nested.
But then it becomes more difficult to understand the data when the context is lost in the QR
Eric Haas (Jun 13 2018 at 20:36):
I haven't suggested a change, I'm challenging the requirement and the premise that nesting is better. QR has no context without the Q anyway. Why is nesting better?
Grahame Grieve (Jun 13 2018 at 21:54):
Right. Eric is not suggesting losing the context, but moving the context from the structure to the link instead.
Grahame Grieve (Jun 13 2018 at 21:55):
I think that we are talking about a bi-directional transform here. In fact, Eric, I can't see what rule in the existing QR stops you from doing what you're doing....
Lloyd McKenzie (Jun 14 2018 at 00:37):
QuestionnaireResponse can be rendered on its own. There's no need for the Questionnaire for a clinician to review the content. Nor is there a need for it to simply aggregate responses. It's only needed if you care about what's in Questionnaire.item.definition (and there's actually something there) or if you want to validate that the answers are valid based on the Questionnaire definition.
Lloyd McKenzie (Jun 14 2018 at 00:37):
I don't understand how you could represent the answers to a Questionnaire with nesting repeating groups in QuestionnaireResponse without replicating the same hierarchy.
Lloyd McKenzie (Jun 14 2018 at 00:38):
And if you have to do it in some cases, then it should be done in all cases to ensure consistent processing - and to allow for evolution of the associated Questionnaires.
Grahame Grieve (Jun 14 2018 at 00:53):
of course you can because you put the nested structure in the link id.
Grahame Grieve (Jun 14 2018 at 00:54):
a.b.c.d
Grahame Grieve (Jun 14 2018 at 00:54):
can interconvert the forms and right now there's nothing to say not to do that
Lloyd McKenzie (Jun 14 2018 at 01:05):
If I've got 20 a.b.c.d entries, how do I know which of the 5 a.b.c entries they go with?
Lloyd McKenzie (Jun 14 2018 at 01:06):
Or are you expecting ordered lists with paths like StructureDefinition?
Lloyd McKenzie (Jun 14 2018 at 01:06):
That's ugly for anyone who wants to expand and collapse parts of the questionnaire response when they're rendering it.
Grahame Grieve (Jun 14 2018 at 01:07):
yes that's what it would mean. I'm not particular arguing that I like this; just that as things stand right now I can't see why that's not valid
Grahame Grieve (Jun 14 2018 at 01:07):
and it's what Eric wants.
Grahame Grieve (Jun 14 2018 at 01:07):
I don't know how ugly it is ....
Lloyd McKenzie (Jun 14 2018 at 01:07):
Right now, link ids have no hierarchical meaning.
Lloyd McKenzie (Jun 14 2018 at 01:07):
So it's not safe to infer one
Grahame Grieve (Jun 14 2018 at 01:07):
they have no assigned meaning other than that they refer to the question.
Lloyd McKenzie (Jun 14 2018 at 01:08):
We can discuss it on SDC if Eric puts together a change request. We certainly need to clarify one way or the other.
Grahame Grieve (Jun 14 2018 at 01:09):
I think clarification is definitely called for
Lloyd McKenzie (Jun 14 2018 at 01:19):
Alex Goel (Jun 14 2018 at 17:52):
I haven't suggested a change, I'm challenging the requirement and the premise that nesting is better. QR has no context without the Q anyway. Why is nesting better?
OK, I see. It's up to the implementer to make sure the Q and QR are relatable. Could be difficult if you get a new Q and have old QRs. Will need to carefully maintain versions
Last updated: Apr 12 2022 at 19:14 UTC