Got feedback or spotted a mistake?

Leave a comment at the end of this page or email contact@krishagni.com

How to fix corrupted specimen event forms?

Sometimes, non-system specimen event forms are corrupted, when they are edited using the form designer. This results in errors during data entry, query etc. This happens mostly to the specimen event forms that were created using OpenSpecimen v1.1. To fix the problem, follow the steps given below:

As a best practice, execute all the steps, first, on your test/dev/train instances before executing on the prod instance. Proceed to prod instance only when you are satisfied with the results obtained on the test instance.

  1. Run the query to get the digest and date when the form was last imported:

    MySQL: select l.form_id, l.md5_digest, l.executed_on from os_import_forms_log l inner join dyextn_containers f on f.identifier = l.form_id where f.name = '<corrupted event form name>' order by l.executed_on desc limit 1
    Oracle: select * from ( select tab.*, rownum rnum from ( select l.form_id, l.md5_digest, l.executed_on from os_import_forms_log l inner join dyextn_containers f on f.identifier = l.form_id where f.name = '<corrupted event form name>' order by l.executed_on desc ) tab where rownum <= 1 ) where rnum >= 1;
  2. Update the form digest so that it can be re-imported or restored to its working status:

    update os_import_forms_log set md5_digest = concat(md5_digest, '_updated') where md5_digest = '<first row of the query in step 1>'; commit;
  3. Trick the importer that the form was not modified since last import:

  4. Restart OpenSpecimen.

  5. Skip to step 8 if your database is MySQL.

  6. Oracle Only: Add a couple of helper functions to replace the contents of a BLOB column.

  7. Oracle Only:

  8. Make the default specimen event forms as user managed forms.

  9. On successful execution of all the above steps, restart OpenSpecimen.

  10. You should be now able to edit the specimen event forms using form designer.

 

Got feedback or spotted a mistake?

Leave a comment at the end of this page or email contact@krishagni.com