We are modeling a questionnaire where one of the answers will be a “rating” (set of five stars where the user will select only one of them). We believe that this answer will have type=‘choice’ and repeats=‘false’, but we already use this pair of attributes to render the answer as a “radio-button”.
I’ve read the documentation of the extensions available, but none of them seemed to be appropriated for this case. Is there an official recommended way to do that?
Thanks in advance.
You have lots of options:
- integer: “Out of 5, with 5 being the highest, what is your rating?”
- integer, with slider control
- choice, with choices of 1 start, 2 stars, 3 stars, 4 stars, etc.
- choice with the same choices, but using an extension to convey a different image (presumably with the desired number of stars for each)
- choice with a drop-down
- choice where the display names are UTF emojis for stars
There are probably a few options I haven’t thought of.
Hello, thank you for the reply.
Sorry, maybe I wasn’t clear about the step I am having trouble with. I would like to know hot to tell the front end render how to render this type of question.
We have an implicit map based in the ‘type’ and ‘repeats’ attribute of the items to decide how to render them, for example:
type:string → render as input type text;
type:date → render as input type date (with datepicker)
type:choice and repeats:true → render as checkbox
type:choice and repeats:false → render as radio
The problem is that we need that the same pair “type:choice and repeats:false” can be rendered in a different way, but we don’t know how to represent this information, besides using an extension. We already have a desired way to render, we are not sure how to tell that to our frontend.
Why “besides using an extension”? Extension is absolutely the correct mechanism. There’s a standard extension that does exactly what you’re wanting to do. That’s what it’s for…
I supose you are talking about Valueset-questionnaire-item-control - FHIR v4.0.1, is it correct?
I think that what would be appropriated would be a code named “rating”, but it doesn’t exist, so what I meant to say in the previous answer is that we will have to have a custom valueSet to use this code.
If this is the intended way, I’m okay with that. I just want to make sure that this concept is not being mapped in another part, since I’m not familiar with representing render aspects in resources.
If you want a distinct ‘rating’ widget (e.g. one that allows you to click on a particular star and have it automatically color that star and those to the left and clear the stars to the right, with the value captured as an integer, then we would indeed need to add a new code to the extension. Feel free to submit a change request asking for that. Otherwise, you could use existing controls (drop-down, radio button, etc.) to allow choosing from a list of star choices.