Enhancing O3 Forms: Dynamic Fields and Custom Widgets

I noticed that the community is interested in decoupling O3 Forms from encounters, as described in this discussion, to allow their use in other parts of the application. However, I see a lack of functionality in the current implementation.

For example, there is no support for dynamic fields that can interact with custom JavaScript code. A use case for this would be a PHQ-9 form that calculates the score automatically after the input fields are filled. As a physician and developer, I see the need for custom inputs that could be predefined widgets, as well as the ability to add functionality in the onSubmit event to interact with third-party applications.

Over the past few months, I’ve been studying OpenMRS to implement it in Brazil and realized that to achieve such functionality, we’d need to create a separate React module for each custom application.

Is there currently another way to achieve this?

Could this have been done with the older HTML Forms?

Adding these features could significantly enhance the flexibility and usability of O3 Forms (not AMPATH neither HTML Forms, but the JSON one), making them more adaptable to various needs and workflows.

Looking forward to feedback and discussion on this!

@mksd @grace Is that duplicated from O3: Proposing "Form Embeddable Widgets" ? Do I need to use AMPATH forms instead to achieve it and not the “native” O3 Form builder?