FHIR Chat · schema · implementers

Stream: implementers

Topic: schema


view this post on Zulip Soroush Atarod (Jun 03 2019 at 09:48):

Could you please help me out? In FHIR questionnaire schema, how could I declare that the boolean should be displayed as "buttons" in the UI? Because booleans are checkboxes in FHIR.

view this post on Zulip Vadim Peretokin (Jun 03 2019 at 09:50):

What leads you to think that booleans are checkboxes?

view this post on Zulip Soroush Atarod (Jun 03 2019 at 09:53):

thanks for reply.
I have checked this website https://lhcformbuilder.nlm.nih.gov/ and over here https://www.hl7.org/fhir/questionnaire-example.json when it comes to Yes, No its using an extension (my understanding yes, no are displayed as button). But, with using an extension I think the front end has to fetch the Schema from it and find out how to display it.

How can I instruct in the schema that this boolean should be displayed as Button or checkboxes? because in the questionnaire-item-control there is no button type

view this post on Zulip Vadim Peretokin (Jun 03 2019 at 09:58):

It would be an extension for that particular tool you're using (I'm not familiar with it). The questionnaire in FHIR itself doesn't dictate how to represent the data in the UI. So I think the question is to the authors of that form builder

view this post on Zulip Soroush Atarod (Jun 03 2019 at 09:59):

thanks alot!

view this post on Zulip Grahame Grieve (Jun 03 2019 at 10:04):

look at the SDC extensions that give you that degree of control over the presentation

view this post on Zulip John Silva (Jun 03 2019 at 10:05):

As Vadim said, it's up to your tool how you implement this in a UI. However, I believe checkbox would not be a good mechanism because usually checkboxes do not require either choice to be made (checked). Maybe a radio button with the Yes/No choice and maybe some code to ensure that at least one was chosen, might be needed. I suppose the advantage of using checkboxes is that you can use this for any 'multiple choice' answer in a questionnaire. (I'm not familiar with FHIR Questionnaire but does it convey the sense of 'required input' or not?)

view this post on Zulip Kenneth Myhra (Jun 03 2019 at 10:26):

@Soroush Atarod This might be what you are looking for http://hl7.org/fhir/extension-questionnaire-itemcontrol.html. It's what I have used in my implementation of Questionnaire to override my form fillers default behavior of how it represents the data types in the UI. It is also mentioned in the SDC extensions http://hl7.org/fhir/us/sdc/sdc-questionnaire.html

view this post on Zulip Brian Postlethwaite (Jun 03 2019 at 12:30):

@Kenneth Myhra , must show me your questionnaire rendering sometime, maybe at DevDays?

view this post on Zulip Soroush Atarod (Jun 03 2019 at 12:38):

@Brian Postlethwaite have a look at this tool https://lhcformbuilder.nlm.nih.gov/

view this post on Zulip Brian Postlethwaite (Jun 03 2019 at 12:42):

Yeah, we have one of our own, I just like to see what others have built.

view this post on Zulip Soroush Atarod (Jun 03 2019 at 12:46):

oh cool! we are in the process of implementing one. Eager to see few demos

view this post on Zulip Kenneth Myhra (Jun 03 2019 at 13:06):

@Brian Postlethwaite Definitely, must be Amsterdam then, not going to Seattle, unfortunately. We've made an npm-package of it, currently just using it in internal projects. I have had a hope of publish the npm-package and open source the code, but looks like that is not going to happen anytime soon.
Also, I am not the developer, just the architect, React and Javascript is not of my strong capabilities.

Was looking for an open url to show a demo, but all our test systems are locked down.

view this post on Zulip Yuriy Khamzyaev (Jun 03 2019 at 16:09):

@Kenneth Myhra Hi Kenneth, are you using lforms schema in your app?

view this post on Zulip Kenneth Myhra (Jun 03 2019 at 16:31):

@Yuriy Khamzyaev I am not quite sure what is meant by schema in this context, but we are not using anything from lforms. We did though look at lforms for inspiration and SDC for conformance.

view this post on Zulip Kenneth Myhra (Jun 03 2019 at 16:37):

As far as I know, lforms are at least implementing parts of what is defined in SDC

view this post on Zulip Yuriy Khamzyaev (Jun 03 2019 at 17:11):

Thanks @Kenneth Myhra, yeah I meant schema for describing forms.
Do you render forms directly from FHIR schema or produce some intermediate schema before rendering actual forms?

view this post on Zulip Kenneth Myhra (Jun 03 2019 at 17:14):

@Yuriy Khamzyaev directly from the FHIR schema, my first requirement was to have no intermediary. Based on the data types we default to a set of UI controls, then using the extension mentioned above we can override those defaults. It has so far worked out quite nicely

view this post on Zulip Kenneth Myhra (Jun 03 2019 at 17:21):

We also had some additional rules for the choice type were it would render as radio buttons if there were less than 5 or 6 items and if above it would render as a drop down

view this post on Zulip Brian Postlethwaite (Jun 04 2019 at 02:58):

In our implementation we have an extension to work that one out, as when number of items is large, need to fall back to an autocomplete style control, think country codes, or list of towns...
And you don't want to call the terminology to work that out during rendering...

view this post on Zulip Kenneth Myhra (Jun 04 2019 at 07:20):

Agree, we will have to optimize that part


Last updated: Apr 12 2022 at 19:14 UTC