Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This page explains how to clean up the study before syncing data from OC freshly. Before you sync any OC freshly data, you will need to delete the entries for existing synced CRFs, patients, visits, and records in CRFs.

  • To delete the existing visits in the CP.

...

  • To update the older deleted records name in the CRFs table, use the below SQL.

Expand
titleClick to expand

Code Block
update dyextn_containers set deleted_on = now(), name = concat(name, '_deleted_20210225')
where identifier in (select container_id from catissue_form_context where cp_id = ?) 

cp_id will be the collection protocol identifier to which the deleted CRF records belong.

  • To delete the CRFs records of existing CRFs, use the below SQL.

Expand
titleClick to expand

Code Block
delete from catissue_form_record_entry where form_ctxt_id in
      (select identifier from catissue_form_context where cp_id = ?)

cp_id will be the collection protocol identifier to which the CRF records belong.

  • To avoid the duplicate form context id error, you will need to delete the existing CRFs. To delete those CRFs, you need to delete their context identifiers.

...