Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re: Customising the UI for the Lforms #115

Open
nikhil-ht-el opened this issue Dec 19, 2022 · 11 comments
Open

Re: Customising the UI for the Lforms #115

nikhil-ht-el opened this issue Dec 19, 2022 · 11 comments

Comments

@nikhil-ht-el
Copy link

Hi I am rendering the lform using the fhir questionnaire response. It is currently displaying in the form structure on UI.
Is their any provision where we can change the UI of the lforms to show up in the table format.

Please help around this.

Thanks
Nikhil

@plynchnlm
Copy link
Member

If you mean having a group presented as a table where the questions are column headings like this:
image
then you can set the questionnaire-itemControl extension to 'gtable'. (https://hl7.org/fhir/uv/sdc/STU3/rendering.html#control-appearance)

@boxwala
Copy link

boxwala commented Dec 19, 2022

Hi Paul, specifically, in this case, the gtable solution comes close, but I am not sure it is a perfect fit. All the items in our Questionnaire have the same structure - a parent item with three subitems. All parents and subitems have the same datatypes. So, a grid structure could work. But the items are not "repeating".

Generally, we are looking to have more control over the layout of item for other applications too. One possibility may be to allow the questionnaire or application developer to supply an HTML table with mappings from cells in the table to the item (linkids).

@plynchnlm
Copy link
Member

I am having trouble imagining what you have in mind. Maybe you could share a screenshot or drawing?

You can set repeats=false if you don't want the gtable repeating, in which case it would have just one row.

Have you had a look at the itemControl options at http://hl7.org/fhir/R4/valueset-questionnaire-item-control.html? Not that we support them all yet, but I would prefer to implement something that was part of the standard.

@boxwala
Copy link

boxwala commented Dec 21, 2022

I have attached a sample questionnaire. We'd like to display them somewhat like in the image below.
image

It is similar to gtable, except the list of items is predefined. The user will not add more items but they can edit the existing items. In other words, the questions all have a similar pattern (kind of like PHQ-9) and the list of items is fixed. In our questionnaire response, we defined child items too. We can change the structure of the questionnaire if we need to do so.
pain_demo_qr.json.txt

@plynchnlm
Copy link
Member

I think this would be supported by itemControl type='grid' (https://build.fhir.org/valueset-questionnaire-item-control.html)-- but lforms does not yet support grid, though it is on our list of things to add.

@boxwala
Copy link

boxwala commented Dec 22, 2022

could we contribute it as a pull request?

@plynchnlm
Copy link
Member

Sure-- pull requests are welcome. Please include some tests. The basic idea is that you mark a group with itemControl='grid', and then the subgroups are rows (groups, with sub-items for the column questions). In your case the items in the sub-groups would be the same (the same questions) for each row, but each row could contain different (or partially different) questions, in which case the the columns would contain headers for all of the different questions, but not all rows would have answer fields for each question.

@boxwala
Copy link

boxwala commented Dec 22, 2022

How would you distinguish that two questions are the same or different? Based on the relative linkId/text?

@plynchnlm
Copy link
Member

The linkId will have be different for every cell in the grid, but I would suggest looking at item.text. I suppose you could have two different questions with the same text, but then there would be two columns with the same text, which would be confusing, so I am not sure there is a need to support that. Implementation questions like this are better asked on chat.fhir.org ("questionnaire" stream). There is already a thread about the "grid" type (https://chat.fhir.org/#narrow/stream/179255-questionnaire/topic/Grid.20Question). I think this question about how implementations regard questions as distinct between rows should be asked there, so the answer can get into the itemControl specification. If you don't mind, please ask there, and we will see what others think.

@annabel-uzl
Copy link

annabel-uzl commented Jun 11, 2024

Is the use of gtable something we can implement using the formbuilder? Because at https://lhcformbuilder.nlm.nih.gov/ I don't see how... (I now we can just edit the json but our doctors cannot).
If so, how and can you also make tables in tables?
EDIT: I adapted the json of my questionnaire to have nested tables but they don't appear in the UI. Can this be correct? If so, can I make a seperate issue for this to fix this?

@plynchnlm
Copy link
Member

Is the use of gtable something we can implement using the formbuilder?

Sorry for the delayed reply; I was away last week. I think this question would be better off in its own issue. However, it is a good question. There is no way to specify gtable from within the form builder, which I think is an urgent problem. LHC-Forms already supports gtable. We will try to give this priority.

I now we can just edit the json but our doctors cannot

Yes, that is a good argument.

If so, how and can you also make tables in tables? EDIT: I adapted the json of my questionnaire to have nested tables but they don't appear in the UI. Can this be correct? If so, can I make a seperate issue for this to fix this?

That will require some discussion. Please make a separate issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants