Folks, Suranga K again. Its been ~3 years? Pleased to talk to you again.
We’re operationalizing OpenMRS for some high priority COVID work in the US.
We need to trigger an ADT message generation from a HTML form submission.
What is the best way to do this?
Do we have any production ready ADT generation code? is there functionality to trigger this on form submission?
I’m told that @wyclif worked on this, but was unable to find anything online. We would be happy to re-purpose anything you may have to offer.
@suranga, we’ve used the post-submission action for an admission/discharge use-case. To use the same for the ADT generation, you will implement org.openmrs.module.htmlformentry.CustomFormSubmissionAction probably in a custom module then provide the full qualified class name in a postSubmissionAction tag, in the form. The FormEntrySession would provide you with all the collected and saved info on the form.
Code Snippet:
package org.openmrs.module.custom.htmlformentry.action;
import org.openmrs.module.htmlformentry.CustomFormSubmissionAction;
import org.openmrs.module.htmlformentry.FormEntrySession;
public class AdtGeneration implements CustomFormSubmissionAction {
@Override
public void applyAction(FormEntrySession session) {
// ADT generation logic
}
}