Unnecessary data is being sent as part of the Observation Model while saving the Obs Forms

Description

The Android sqlite db only supports a cursor of size ~1 MB. We have a form where we have a dropdown with around 480 concepts as answers. After choosing any one of them and saving the form , we noticed that the Observation model was sending an object called possibleAnswers containing all the 480 concepts along with it which is unnecessary. If we add the same obs again (Using the Add section config) and select a answer for the new section , it adds the possibleAnswers to again. So thats 480 + 480, so if you keep on repeating the section which is our requirement it keeps on adding unncessary data.

Repeating the section twice itself crosses the 1 MB limit and the obs form does not save and throws a JAVA exception. After some investigation we found out that the possbileAnswers are being added over here : https://github.com/Bahmni/bahmni-connect/blob/2131d452213a0b68c0fe9f1b26310f5e1b6c815d/ui/app/common/concept-set/mappers/observationMapper.js#L156 1

Removing that line solved the problem and the form data now does not exceed 20 kB.

Status

Assignee

krishnanspace

Reporter

krishnanspace

Labels

None

Units

None

PercentDone

None

DueTime

None

Clients

None

External issue ID

None

UAT Assignee

None

Reviewer

None

Components

Fix versions

Configure