How do I delete a single Participant entry in Opal^

15 views
Skip to first unread message

Francoi...@dti.ulaval.ca

unread,
Feb 17, 2021, 10:50:09 AM2/17/21
to obiba-users
Hi,

We encountered a situation where we must hard delete all the data linked to a specific Opal Participant.

Looking at both the UI, the "opal" command and the REST API, I couldn't find any way to delete a Participant, other than manually deleting the entry from the underlying database table (with the inherent risk of corrupting my system).

Could-you please confirm that Opal does not offer any tool to delete a single Participant?

Thanks,

Ramin H.A.

unread,
Feb 17, 2021, 10:58:16 AM2/17/21
to obiba...@googlegroups.com
Hi François,

Try to export that table as a CSV, remove the participant and re-import the modified CSV onto the same table without selecting the Incremental option. You may want to keep the original CSV as a backup.

You can also test drive the above by importing the CSV as a new table and double check that the participant is no longer present.

Best,

--
You received this message because you are subscribed to the Google Groups "obiba-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to obiba-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/obiba-users/3c5340df-a468-4ce7-97c3-642915d62b3en%40googlegroups.com.

Yannick Marcon

unread,
Feb 17, 2021, 12:12:03 PM2/17/21
to obiba...@googlegroups.com
Hi François,

There is no such functionality exposed because our users have always claimed that participant data should be marked as being withdrawn (soft removal, using a specific variable) and not hard removed. But still, it is possible to do it using web services, though it requires some gymnastics.

First you can get all the tables where a participant has values, as an example for Participant with ID 1013:

opal rest -o https://opal-demo.obiba.org -u administrator -p password -m GET /entity/1013/type/Participant/tables -j

Then you can remove the values (value set) from each table (that is not a view, otherwise the call will fail):

opal rest -o https://opal-demo.obiba.org -u administrator -p password -m DELETE /datasource/CNSIM/table/CNSIM1/valueSet/1013

The following can be used to verify the values were removed from the table (404 if not found):

opal rest -o https://opal-demo.obiba.org -u administrator -p password -m GET /datasource/CNSIM/table/CNSIM1/valueSet/1013

It would not be much effort to wrap it in a single web service call...

Regards,
Yannick



Francoi...@dti.ulaval.ca

unread,
Feb 18, 2021, 8:34:56 AM2/18/21
to obiba-users
Thanks Yannick, it works.

One more question: Ideally, I would like to call the Opal Rest service directly.

Could you please tell me what would be the equivalent curl call for the following command:


opal rest -o https://opal-demo.obiba.org -u administrator -p password -m GET /entity/1013/type/Participant/tables -j

For example:

curl --user administrator:password https://opal-demo.obiba.org/entity/1013/type/Participant/tables

Thanks.

Yannick Marcon

unread,
Feb 18, 2021, 8:55:36 AM2/18/21
to obiba...@googlegroups.com
Like this:

curl -H "Accept: application/json" -H "Authorization: X-Opal-Auth `echo -n 'administrator:password'|base64`" -X GET https://opal-demo.obiba.org/ws/entity/1013/type/Participant/tables

Yannick


Reply all
Reply to author
Forward
0 new messages