Problem in Saving Implementer Interface forms

Description

Problem:
Issue in Bahmni-Connect both app and the PWA when using Forms made using Implementer interface.
The problem is when the Bahmni connect android tablet internet is disconnected

When you fill an Observation Form and save the first form,it saves.Same goes for the second form.If you fill a 3rd form and save it ,The 1st form goes away from the left side panel.Even if you sync it, the 1st form’s data is not visible in the online server.
If you click on Add New Form,the the previously filled form(the one that vanished) is available to add.If you add that form,its empty and you have to fill the form details again.

But if I fill 5-6 forms and then save it in the end,then all the forms are saved.Only when I fill one form at a time and save , the problem occurs.

Also If I keep on clicking Save continuously , the forms seem to vanish one by one,until only the last filled form remains.

the observation form data of 1st form that has gone away from the left side panel and than when the app gets internet and we sync the data then the data only for two forms is saved and the rest data (data for the first form) is lost.

There seems to be no problems when using the CSV forms,only when using the forms created using implementer interface.

Reference:
https://talk.openmrs.org/t/problem-in-saving-implementer-interface-forms/17411/2

Tech Notes
The reason the forms are disappearing (along with data) is that Connect stores the data on offline database for the encounter. Unlike Forms 1.0 (conceptSetUI), the Forms 2.0 (React) based observation forms do not load up till its required (rendering). When the "Save" button is clicked, then the observation data for the encounter gets overridden with only the loaded forms' data. This can be easily simulated

  • for a patient, capture multiple observational data using multiple forms (more than 1)

  • navigate to another patient, and then come back to the previous patient. The side panel will show the captured forms. DO NOT click on any (or more) captured form, and just click the "SAVE" button. The forms (Forms 2) would have disappeared.

Issue to be fixed: in ConsultationController (consultationController.js), function addFormObservations() clears up all the Form 2 based observation data. But unless a form was rendered, it would not have fetched and loaded the data, hence it escapes the subsequent check - if (observationForm.component)

Attachments

2
  • 19 Apr 2018, 05:13 AM
  • 19 Apr 2018, 05:13 AM

Gliffy Diagrams

Activity

Show:

krishnanspace June 25, 2018 at 6:56 AM

Problem is fixed.Forms are getting saved without losing data

Done
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Labels

UAT Assignee

Dev Pair

Sprint

Fix versions

Priority

Created April 19, 2018 at 5:18 AM
Updated June 25, 2018 at 6:57 AM
Resolved June 25, 2018 at 6:57 AM

Flag notifications