Restore deleted visits and specimens under the visit (MySQL only)

Pre-Requisites: The user needs to set up an external job in OpenSpecimen to restore the deleted visits and its specimens.

List of things a user can restore using the external job by providing the visit ID(s).

  1. Deleted visits and specimens along with custom form data, event data, etc.

  2. Only specimens

User needs to provide visit ID(s) even if they need to restore the deleted specimen data.

What is not restored:

Specimen locations

Steps to configure the external job.

  1. Connect to the OpenSpecimen database.

  2. Create the SQL procedures' restoreSpecimenByVisits' and 'restoreVisits' present here.

  3. Check the procedure <show create procedure 'procedureName'>

  4. Connect to the app server and copy the "restoreVisits.sh "shell script in openspecimen's data directory.

  5. Open the "restoreVisits.sh "and change the database connection details as needed

  6. Log into the OpenSpecimen application.

  7. Go to Jobs page, click on 'Create' and configure the job as shown below.

 

How to run the job?

  1. Go to the Jobs list page.

  2. Click on the run button from the right corner.

     

  3. A pop-up will be displayed after clicking on the button

     

  4. Enter the visits ID(s) separated by space or newline and click on ‘Run Job’.

  5. Click on ‘View Runs’ to check the status of job success or failure.

  6. An email notification is sent out to the user for the job.

The above steps restore the deleted visits and specimens.