Using Data Answers from Submitted HTML Form Entries

I’m using OpenMRS Ref App 2.5

I made some custom HTML forms using the HTML Form Entry Module, and I’ve added these to the patient dashboard under “Current Visits”

I’m just a bit confused now on how I can get the data per patient for various purposes.

For example, I made forms for details of each rehabilitation session. I am getting data such as the program type the patient is enrolled to, the exercise settings, the vital signs for that session, etc. The idea is that the provider will be the one to fill it out and submit it, nothing special.

I want to do the following:

  1. Be able to keep track of how many sessions the patient has undergone. For example when creating a new session through the HTML form, it should automatically detect that it’s now the patient’s 4th session out of a total of 24 required sessions.
  2. I want to be able to view the inputted data to the form in a separate page, like viewing the vital signs logged for that session. I understand that it can be viewed under “current visits” but it’s not user-friendly and not comprehensive.
  3. I want to be able to use all the submitted data per session of the rehab program, so after the program, I can make a summary of all the data for that patient.

I’m not quite sure on how to do this. Is there a way to do this with the Ref App, just customizing or modifying it? Or would I have to make a new app / module altogether? Any suggestions?

My programming background: My expertise is microcontroller programming, C / C++. I’m only starting to explore Java using various online tutorials.

Thank you so much!

@giasantos, welcome to the OpenMRS community.

Your first item seems like something that you could do with JavaScript on the HTML Form. Specifically, look into the <lookup> tag.

For your second and 3rd points/questions you’d be best to either create a custom report or write a custom module. There isn’t any easy out-of-the-box method for pulling the info out for a specific patient. I’ve created a custom report to pull the info together. See the instructions at…

I hope this can serve as a starting point for you.

@giasantos after you have done what James suggests, i will give you a module that exports it to PDF.

Thanks so much for your help! Looks like the tag is perfect!

As for your suggestion for pulling the info out, I’ll be checking that module and instructions. Will let you know what happens. :slight_smile: Thanks!

@dkayiwa Sounds great! Thanks!

Just some additional questions:

  1. Would it be possible to graph the data using the Reporting Module also?
  2. Is there any way for me to link forms to each other? For example after submitting one form, it should automatically redirect to the page for another form (or another page in general). I’m trying to create a workaround for a workflow, since Programs aren’t available yet in OpenMRS Reference App.

Thanks so much for your help!!

I’m glad you found the information useful!

1.) There is currently no graphing capability in the Reporting Module that I am aware of. You could use an Excel Template with a graph in it as a work around. See REPORT-105. 2.) You can look into the <redirectOnSave> tag which can be used in your HTML forms. See here for more info and syntax.

@arbaughj Thanks James!

I managed to successfully use the lookup and redirectOnSave tags to do my intended functions!

As for the reporting module, I’m still trying it out. I’m already on the “Running the Patient Summary Part” but when I input the patient’s name and click “Request Report”, nothing is happening. The page just refreshes. I followed everything on the link you provided. What could be the problem?

And on another question, I got an “aha” moment when it was showed in the link how to create an “Empty App” on the homepage of the Ref App. I’m trying to figure out if it’s possible to add a new simple tab / box / app on the patient’s dashboard as well using that method? I would like to embed (if possible) the report summary on the patient dashboard, as well as make separate boxes to categorize the different forms / links. I was thinking that I would just have to change the extensionPointId but I couldn’t figure out the name of the ID for the patient dashboard.

Oh and one more thing.

I just accidentally figured out that one of the things I’ve been looking for to view form submissions are actually available through the Legacy UI (Administration) part of the Reference App.

Thing is I just want to view the submitted form answers like this in the LegacyUI (answers filled out in the same format as the form):

Instead of like this in the Reference App Patient Dashboard under “Visits” wherein data is messy and just clumped:

Is there another way I can work around this? I was thinking if it’s possible to create a new box / app on the Patient Dashboard which will automatically create links to the encounters on the LegacyUI format? But not sure how to do that.

@giasantos are you looking for the view icon which you can see at this dashboard just before the edit pencil icon?

Oh I didn’t know those icons existed. Because I don’t have those icons on my dashboard (as you can see on the screenshot). How do I make those icons appear on mine? :confused:

They are in the snapshot versions of the coreapps and htmlformentryui modules which can be found here

I’m not sure why your report is not able to run. Does the preview of your data set work? What about the preview of the report? If not, than something isn’t right with your data set or report.

There has been some work done with the Reporting Module which will allow you to specify parameters via the URL. This is an important step to being able to put your report somewhere on the patient dashboard.

I’ve added some additional documentation to the How to create a Patient Clinical Summary page to take advantage of that fix. This allows you to run the report immediately when the HTML form is submitted. Of course, this is still in a snapshot version of Reporting that hasn’t been released yet.

I don’t know how you would go about adding a simple tab/box/app on the patient’s dashboard. It would probably a custom module, based on my understanding.

Let us know how things work out for you.

I installed those versions you mentioned (I used Manage Modules in case this info is relevant) but for some reason the icons still aren’t appearing. I also already restarted OpenMRS, tried to create a new patient and submit new forms for that new patient, but icons aren’t there still. :confused: Do you have any thoughts on this on why it may be? :confused: Thanks so much for the help!

I will look into this and update you if anything significant shows up! Thanks so much for the help!