-
Notifications
You must be signed in to change notification settings - Fork 56
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
Comments
If you mean having a group presented as a table where the questions are column headings like this: |
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). |
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. |
I have attached a sample questionnaire. We'd like to display them somewhat like in the image below. 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. |
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. |
could we contribute it as a pull request? |
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. |
How would you distinguish that two questions are the same or different? Based on the relative linkId/text? |
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. |
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). |
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.
Yes, that is a good argument.
That will require some discussion. Please make a separate issue. |
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
The text was updated successfully, but these errors were encountered: