FHIR Chat · choice item rendering · questionnaire

Stream: questionnaire

Topic: choice item rendering


view this post on Zulip Brian Postlethwaite (Jun 25 2020 at 01:14):

Grahame is implementing a rough converter to HTML for the IG Publisher and has noted that for a choice type, there is no definition of what the default control type to use is.
We have the extension to permit the designer to be explicit about it, but should we have anything to say here about it?

view this post on Zulip Brian Postlethwaite (Jun 25 2020 at 01:14):

"Question with a Coding drawn from a list of possible answers" http://hl7.org/fhir/valueset-item-type.html
The extension and valueset are these for the control type when being explicit about it
http://hl7.org/fhir/extension-questionnaire-itemcontrol.html
http://hl7.org/fhir/valueset-questionnaire-item-control.html

view this post on Zulip Lloyd McKenzie (Jun 25 2020 at 01:19):

The control depends on whether it's a repeating question and also on how many choices there are. Radio buttons or drop-downs work for non-repeating, check-boxes or multi-select drop-downs for repeating. If the set gets too large, then you need a drop-down control that allows free-text search

view this post on Zulip Paul Lynch (Jun 25 2020 at 19:27):

The very large sets would be item control = "autocomplete". But, if there is no hint via the itemcontrol extension, how does one determine the number of items in the answerValueSet to decide whether the list is small or large or huge? In the latter case, $expand probably would not return the full list.

view this post on Zulip Lloyd McKenzie (Jun 25 2020 at 20:46):

The expansion should indicate it isn't complete

view this post on Zulip Paul Lynch (Jun 25 2020 at 21:10):

Via expansion.total being less than the number of expansion.contains nodes?

view this post on Zulip Brian Postlethwaite (Jun 25 2020 at 21:52):

Yes, and I always provide a value for the count, ensuring that I don't kill the browser downloading an entire 80k set of codes...
But if the item has the hint, the designer is indicating that they thought about it.

view this post on Zulip Michael Lawley (Jun 27 2020 at 01:47):

$expand?count=0 and then look at expansion.total if you need to make a UI rendering choice in advance. Otherwise, user ?count=[n] where n is your threshold for switching over to autocomplete

view this post on Zulip Kashyap Jois (Jan 29 2021 at 11:41):

Value set item type defines choice as "Question with a Coding drawn from a list of possible answers (specified in either the answerOption property, or via the valueset referenced in the answerValueSet property) as an answer (valueCoding)." Where as in the questionnaire definition, answerOption can be of type Value[x] where [x] belongs to ["Integer", "String", "Coding", "Reference", "Date", "Time"] . Are these two definitions contradictory?

view this post on Zulip Lloyd McKenzie (Jan 29 2021 at 20:57):

I don't know that they're contradictory, but they're confusing. In R5, we're dropping 'choice' and 'open-choice' entirely and adding 'Coding' as a type and making the question of whether a question is open or closed a coded element. That will both be more flexible and more clear. In R4, a type of 'choice' means that the data will be captured using valueCoding. It's still possible to have options constrain the allowed choices for questions of type integer, string, Reference, Date or Time.

view this post on Zulip Brian Postlethwaite (Jan 30 2021 at 09:42):

I'm still confused what you need to do to have a question that could have a coding or a string as the response.
Do we have an example of this yet?

view this post on Zulip Lloyd McKenzie (Jan 30 2021 at 14:37):

In R4 or R5?

view this post on Zulip Lloyd McKenzie (Jan 30 2021 at 14:38):

In R4, you use open-choice. In R5, you use type of Coding and declare the question to be open, allowing string.

view this post on Zulip John Manning (Jan 30 2021 at 15:21):

Good to know. That R4/R5 difference is very helpful for some of the Questionnaire planning on the work @Grey Faulkenberry and I are doing w/ open-choice questions.

view this post on Zulip Kashyap Jois (Feb 01 2021 at 13:15):

Lloyd McKenzie said:

I don't know that they're contradictory, but they're confusing. In R5, we're dropping 'choice' and 'open-choice' entirely and adding 'Coding' as a type and making the question of whether a question is open or closed a coded element. That will both be more flexible and more clear. In R4, a type of 'choice' means that the data will be captured using valueCoding. It's still possible to have options constrain the allowed choices for questions of type integer, string, Reference, Date or Time.

Oh that is interesting, but Questionnaire.item.answerOption Definition : mentions that answerOption is

One of the permitted answers for a "choice" or "open-choice" question.

view this post on Zulip Kashyap Jois (Feb 02 2021 at 07:04):

Is it safe to say that for a "choice" type question we can write the rendering code assuming that only valueCoding will be in the answer options?

view this post on Zulip Jose Costa Teixeira (Feb 02 2021 at 13:01):

I don't think that is always true. You can have a dropdown with strings (not necessarily a code)

view this post on Zulip Paul Lynch (Feb 02 2021 at 13:20):

Kashyap Jois said:

Oh that is interesting, but Questionnaire.item.answerOption Definition : mentions that answerOption is

One of the permitted answers for a "choice" or "open-choice" question.

@Lloyd McKenzie That looks contradictory to me. answerOption's definition says it only for "choice" or "openChoice", but then the structure shows answerOption.valueInteger, etc.

view this post on Zulip Lloyd McKenzie (Feb 02 2021 at 14:34):

It is contradictory and wrong. We opened the set of options that can be restricted but didn't update the wording. Can you submit a change request for us to fix this?

view this post on Zulip Kashyap Jois (Feb 02 2021 at 14:47):

I do not have a HL7 Jira/Confluence account to do this. I can apply for one, unless someone here would like to submit the change request :)

view this post on Zulip Lloyd McKenzie (Feb 02 2021 at 15:09):

One of my secret missions is to encourage as many people as possible to get Jira/Confluence accounts to lower the level of friction for people submitting change requests whenever they see something that's wrong/could be better.

view this post on Zulip Paul Lynch (Feb 02 2021 at 22:23):

@Kashyap Jois Please post a link to the Jira item here when you are able to create it.

view this post on Zulip Kashyap Jois (Feb 04 2021 at 09:37):

https://jira.hl7.org/browse/FHIR-30922 do let me know if it clearly describes the problem

view this post on Zulip Johannes Oehm (May 27 2021 at 07:30):

Hello everybody,

When I have a choice-Item with multiple predefined answerOptions with valueCoding linked to an existing terminology, but I want to rename these elements for the user, should I just switch the value of Coding.display or is there an extension for this?

Kind regards
Johannes

view this post on Zulip Lloyd McKenzie (May 27 2021 at 09:23):

ValueSet allows you to define alternate display names. No need for an extension

view this post on Zulip Brian Postlethwaite (Jun 06 2021 at 09:33):

Since we collapsed choice and open-choice into coding (with asnwerConstraint), should we have done the same thing with string and text? just have one of them and make the control formatting go into the itemControl too?
(and should itemControl come into the core definition?)

view this post on Zulip Lloyd McKenzie (Jun 06 2021 at 13:11):

I don't think those two things are correlated. We could certainly talk about merging them, though my leaning is to put some invariants on string content and length instead. I think it's a question of distinct data constraints, not just entry controls.


Last updated: Apr 12 2022 at 19:14 UTC