Form having brackets in the name does not save

Bahmni - Demo site

  1. Implementer Interface ->Create and publish 2 forms. One with “()” in the name and one without as shown:

  1. Registration->Patients->Start Visit
  2. Clinical->Active Patients->Select a patient->Consultation->Observation->Add Form->Add the above 2 forms and enter values->Save.
  3. Form name with brackets does not save whereas the other form save. We are yet to debug and identify the exact reason. Link for the video.

We also noticed that the second version of the form having bracket in the name has incorrect uuid in it’s respective json file in “/opt/bahmni-web/etc/bahmni_config/openmrs/apps/forms/translations”.

The uuid is for the earlier version of the form.

We are still trying to find the root cause of this issue. In the meantime following are the options to overcome the issue - A. Edit the form name to have : instead of bracket - This will create a new form with version 1. That means there will be 2 forms with similar names which may be confusing to the end user. B. Modify the related file names and also in the database tables to reflect new form name Following are the steps for this option - In this case the name of the form “ANC Exam (Twins)” that has been changed to “ANC Exam : Twins” in the file names and also in database tables:

  1. Change 4 file names: (note 3 _ in the first and note space before and after the : in second) /home/bahmni/clinical_forms/ANC_Exam__Twins__<version#>.json to /home/bahmni/clinical_forms/ANC_Exam___Twins__<version#>.json

    /opt/bahmni-web/etc/bahmni_config/openmrs/apps/forms/translations/ANC Exam (Twins)<version#>.json to /opt/bahmni-web/etc/bahmni_config/openmrs/apps/forms/translations/ANC Exam : Twins<version#>.json

  2. Get the required values of form_id, name, uuid for every version - Select form_id, name, version, uuid from form where name=‘ANC Exam (Twins)’;

  3. Set the new form name in form table for all versions of this form Update form Set name=‘ANC Exam : Twins’ where name=‘ANC Exam (Twins)’;

  4. Get form_resource_id, form_id, name, value_reference and confirm the name and value_reference to be changed in form_resouce table. Select form_resource_id, form_id, name, value_reference from form_resource where name = ‘ANC Exam (Twins)’;

  5. Update form_resource table to reflect the form name and value_reference for each version entry Update form_resource Set name=‘ANC Exam : Twins’, value_reference=’/home/bahmni/clinical_forms/ANC_Exam___Twins__<version#>.json’ where form_id=<form id of the version#>;

  6. Get uuid of each version Select form_id, name, version, uuid from form where name=‘ANC Exam : Twins’;

  1. Update/confirm this uuid at form level for each version of the form present in /home/bahmni/clinical_forms/