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”.
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:
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
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)’;
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)’;
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)’;
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#>;
Get uuid of each version
Select form_id, name, version, uuid from form where name=‘ANC Exam : Twins’;
Update/confirm this uuid at form level for each version of the form present in /home/bahmni/clinical_forms/