Could Form Builder be less tightly coupled to encounters?

As work on the O3 Form Builder and its schema progress, is there any chance we could start to loosen the tight coupling between forms and encounters?

It would be great to be able to use O3 Forms in other contexts. For example:

  • Order entry forms (eventually we’ll want to allow orderables to define additional orderable-specific details to be gathered when ordering)
  • Managing attributes (implementation-specific details on resources)
  • Custom fields in registration
  • etc.

The idea would be to move any patient- or encounter-specific references under a “model” property, so they could be provided by an EncounterFormModel. Calls like form.getEncounter() would become form.model.getEncounter().

Does this direction make sense? I’m happy to elaborate, but thought I’d get the general idea out here and see what others thought of this direction.

Part of the reason for this suggestion is my having witnessed Paul & my mentor, Dr. Clem McDonald, building one of the first order entry systems in the 1980s from a generic forms engine that we used for nearly every aspect of the application. The forms engine focused on translating a form definition into data collection, but abstracted the data model and pre- & post-form processing so it could be plugged into many contexts, which turned out to be extremely powerful. :slight_smile:

/cc @dennis @mogoodrich @grace

pinging @mseaton as well… and, yes, I do think this is worth pursuing…

Great timing @burke ! @ibacher and I were chatting about form entry and patient registration this morning, and I created this ticket right before you posted this to try to get a similar conversation started: [O3-2103] Leverage form entry functionality in patient registration - OpenMRS Issues . Would love to this discussed more and hope that we can try to move in this direction.