HTML Form Entry Module and REST

Tags: #<Tag:0x00007fe2ede16450> #<Tag:0x00007fe2ede16090> #<Tag:0x00007fe2ede15c58> #<Tag:0x00007fe2ede15988> #<Tag:0x00007fe2ede15758>

How can I populate the fields in a form created using the html form entry module by REST web services?

I don’t think this is possible, and I’m not sure the use case makes sense. Can you describe what you are trying to do? You might just be able to post to the obs resource.

EDIT: The form resource might also be useful.

I have created a html form with a few fields to fill in when a patient visit ends. Just seen that the fields in the form are saved as encounters. So I guess I can use the REST Api to save them as encounters.

In general, most patient data is stored as observations (obs) wrapped in encounters. Here are some resources about the OpenMRS information and data models:

1 Like

Not sure if this is helpful with your question at all, but:

The HTML Form Entry module pre-dates the REST API, so it just used a typical HTML Form Submission process to create and edit encounters and obs.

It would be cool, in the future, if HTML Form Entry could submit form data RESTful, but this currently isn’t on the roadmap.

Take care, Mark

Hi Mark! What is the basic difference between form and html form entry.Is there any possibility that html entry form will support Rest API in near future?

Naveed,

It’s possible, but it’s not on the roadmap on this time.

Take care, Mark

Also, for reference, the Html Form Entry UI module provides a way to RESTfully fetch the HTML that the Html Form Entry module generates, but not the the individual obs, etc. The fragment to fetch this can be found here… see the “getAsHtml” method:

On @ivange94’s suggestion, this has been added as a project idea for GSoC 2018:

RESTful Submission of Forms in HTML Form Entry

If there’s any interest in mentoring this project, or adding to the project objectives, please feel free to update the page. The objectives could use some work to try define what this could look like for a 6-8 week student project.

@danfuterman your use case makes perfect sense. I think this should be mentored. If there isn’t someone already mentoring, then I’ll be more than happy to.

2 Likes

Thanks for volunteering @owais.hussain, that would be great! I’ve listed you as the primary mentor on the project page - please feel free to add more detail and/or expand on the objectives.

This would be very valuable… I don’t know if I will have time to “offiically” mentor but keep in the loop and I will hopefully be able to do some initial design work as the project approaches.

Take care, Mark

2 Likes

Thanks @mogoodrich, will keep you in the loop as things progress. Otherwise, it could be valuable to have you listed as the backup mentor, if your schedule allows.

Generally the backup mentor doesn’t have much of a time commitment, but I don’t know if I’d have the time to fill in as the primary mentor if the primary ends up being unavailable, so I guess that means I shouldn’t be the backup? :slight_smile:

Good point, thanks :slight_smile:

As primary mentor, I will be able to spend 4-8 hours a week. Not sure if that’s sufficient.

I don’t remember 100%, but I think 4 hours is the required commitment.

@owais.hussain That sounds (more than) sufficient, the expectation for mentors is a minimum of 4 hours a week, and there’s usually support from other mentors when needed.

Hello @owais.hussain, i am interested to work on this feature. i believe now all the form fields are sent to the backend when the form is submitted. What i understand is we need to create a CRUD endpoints which can be accessible from any where. and we are talking about this https://demo.openmrs.org/openmrs/module/htmlformentry/htmlForms.list , am i right? also about the use case of html-form-entry: i think it might be helpful if someone wants to enter patient details some other way rather than by just simply using the Reference application ui, did i get it right?

Hi Piyush,

Glad to know you’re interested in this project.

You’re right. The objective is to make this module to be made usable RESTfully, and build an Open Web App as proof of concept. To get a technical overview, please visit here.

1 Like