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?
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 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.