Leave a comment at the end of this page or email contact@krishagni.com
How to move forms from all CPs to the CP group?
Introduction
This page explains how to delink forms attachment from ‘All current and future collection protocols’ and link to specific protocols or collection protocol group(CPG). If data is already entered, and if form attachment is changed via UI, data is lost. Follow the below steps to do it without losing data.
Steps
Scenario: The form is attached at the ‘Visit Forms’ level to 'all CPs’ and needs to be moved under ‘Common workflow’ CPG.
1. Log in to the database and run the below SQL to get the context id of the form which is attached to all CPs.
You can get the form name from the UI. Form list view → click on the form name → Copy form name.
The user will get the form context id(identifier) of the form as shown in the below image.
2. Delete the form attachment from all CPs.
Form list view → click on the setting icon → click on delete icon → Done.
3. Attach the form at the CPG.
Go to the CPG → Form Tab → Visit → Forms +Add → select the form(attached to all CPs).
4. Run the below SQL for CP ids in the CPG to get the new context ID of the form which is attached at the CPG.
You will get the new context ids and CP ids as shown in the below image.
You can see the three entries of IDENTIFIER and CP_ID, which means the CPG contains these three CPs to which the form is attached.
5. Run the SQL for the count of records under each CPs. This is the count of record (data entry) in each CP. Once you run the update SQL from #6 you will get a count of affected rows. The count from #6 step should match with the count of this step.
If the form is attached at the specimen form level, you need use below SQL.
6. Run the SQL for updating the context id with a comparison of old context id.
You will get the new context id, CP id from #4 step, and old context id from #1 steps. You can check the rows affected after running the SQL and cross verify the count from #5 step.
Go back to the UI; You can see the form is attached to only specific CPs which are part of CPG.
Also, you can verify the data in each CP to which the form is attached.
For more details about the DB, table refer to http://dbschema.openspecimen.org/.
Leave a comment at the end of this page or email contact@krishagni.com