I’ve started to dig into the current React Form functionality provided by O3, and doing a gap analysis for the features needed for PIH to be able to adopt React Form, so apologies in advance, but there will likely be a fire-hose of questions coming from me in the near future. I can start to ticket the missing features, but thought it would be good to confirm here first.
First, a bit of a blocker, there appears to a problem saving forms via Form Builder that I’ve ticketed here: [O3-2124] Form Builder: Unable to Save a form after initial save - OpenMRS Issues
Also, as I start making tickets in the O3 project in Jira for features we will need to add, is there any component/epic/label/etc we are using to track form-related feature requests? (@grace @dkigen )
Here are some of the missing features from my rudimentary testing that I’m going to start to ticket, please let me know if any of these features are already implemented and I’m missing them.
Referencing concept by mapping: Am I correct that concepts can only be referenced by uuid in the form schema? For usability, we will want to add the ability to reference a concept by a concept source/mapping pair, as we do in HTML Form Entry (HFE). For instance “CIEL:1234” to refer to the concept with the CIEL mapping 1234.
Translations: Is there any provision yet for localizing “label” text provided as part of the form schema? We often have forms in multiple languages.
Default labels: when rendering a question or answer of type obs, if you don’t provide a label field for that question or answer, the label should default to the preferred name for that concept in the current locale
Default answers: if you don’t provide a list of answers for a question and the question concept is of type “question”, the system should render all the answer concepts associated with that concept in the concept dictionary
Now a couple higher-level questions:
It appears that the form schema is stored in the clob_datatype_storage field. In HTML Form Entry, although form schemas are also stored in the database (in the “htmlformentry_html_form” table) we provide a means where forms can be loaded from the file system. This provides several benefits, most importantly 1) the ability to work on a form within an IDE, 2) the ability to commit forms to version control and collaborate on them, and 3) the ability to deploy and update forms easily to multiple servers as part of the server configuration package. Is there any existing or planned support for this? If not, I’d like to start to spearhead thoughts around this.
Right now, if I’m understanding, the form schema primarily provides a way to define the schema and questions to display on a form, but there’s not much control over the actual layout of the form. This is a departure from HTML Form Entry, which basically just added special form tabs to HTML while still supporting all the basic HTML layout. so basically if you could do it via HTML and CSS you could lay out a form any way you like. Thoughts on how/if we want to support custom layouts in React Forms? Honestly, in some ways I do like the fact that React Forms is opinionated and it’s layout is fairly simply (and trying to support layout could get myy), but it will be a bit of a paradigm shift from what we currently do, and people’s desire to have a form look a specific way.
Okay, I’ve probably already included too many questions in single Talk post, that’s all for now… I’m excited to get this working!
fyi @dkigen @ibacher @grace @ball @mseaton @fiona @ddesimone
Take care, Mark