You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am considering writing support for repeating instruments and events to redcap_delete to meet a local need. REDCap supports the deletion of repeats via the API, but VUMC's implementation raises some questions.
Looking at REDCap 14.1.3, API/record/delete.php, the function delRecords() will iterate over an array of record IDs, but it treats event, instrument, and repeat_instance as scalars. So a deletion of a vector of n repeats of an instrument for one record would require n API calls. You could delete a vector of record IDs for a single repeat of a single instrument, but you would have to build that data structure from the dataset of records and repeats you plan to delete.
It would be nice to ignore the capabilities of the Delete Records API method. I'd prefer to name the repeats I want to delete by record_id, instrument name(s), and repeating instance numbers and let the delete function manage that complexity. This code generates a dataframe of repeats of a form to delete, then transforms them into a data structure that aligns with the capabilities of the REDCap Delete Records API method
This method works well with multiple instruments as well. I just simplified the above data for readability. It does not address repeating events, but it could with modifications.
With such a data frame, one could call the function like this:
I am considering writing support for repeating instruments and events to redcap_delete to meet a local need. REDCap supports the deletion of repeats via the API, but VUMC's implementation raises some questions.
Looking at REDCap 14.1.3,
API/record/delete.php
, the functiondelRecords()
will iterate over an array of record IDs, but it treatsevent
,instrument
, andrepeat_instance
as scalars. So a deletion of a vector ofn
repeats of an instrument for one record would requiren
API calls. You could delete a vector of record IDs for a single repeat of a single instrument, but you would have to build that data structure from the dataset of records and repeats you plan to delete.It would be nice to ignore the capabilities of the Delete Records API method. I'd prefer to name the repeats I want to delete by record_id, instrument name(s), and repeating instance numbers and let the delete function manage that complexity. This code generates a dataframe of repeats of a form to delete, then transforms them into a data structure that aligns with the capabilities of the REDCap Delete Records API method
e.g.
This method works well with multiple instruments as well. I just simplified the above data for readability. It does not address repeating events, but it could with modifications.
With such a data frame, one could call the function like this:
I'm curious to get feedback on which data transformations to put into redcap_delete's scope and how best to pass the data.
The text was updated successfully, but these errors were encountered: