Skip to content

Commit

Permalink
Merge pull request #553 from OuhscBbmc/dev
Browse files Browse the repository at this point in the history
CoPH testing structure
  • Loading branch information
wibeasley authored Nov 6, 2024
2 parents 2cb7cab + f32c324 commit 0172ce0
Show file tree
Hide file tree
Showing 49 changed files with 6,872 additions and 319 deletions.
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ README.html$
project\.xml$
\.zip$
\.tar.xz$
inst/test-data/projects/super-wide-3/super-wide-3-dictionary\.csv


documentation-peek.pdf
documentation-for-developers/
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,5 @@ docs
inst/doc
/doc/
/Meta/

inst/test-data/projects/super-wide-3/super-wide-3-dictionary.csv
38 changes: 38 additions & 0 deletions inst/misc/coph.credentials
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# This is an example credential file for the REDCap API.
# Each record represents one accessible project for the current user.
# Make sure that the real file with the sensitive password-like tokens
# is stored securely.
#
redcap_uri,username,project_id,token,comment
"https://redcap.ouhsc.edu/redcap/api/","myusername","2298","6F37356C18D9A9F5E1248B6D1E7FAB9B","simple"
"https://redcap.ouhsc.edu/redcap/api/","myusername","2299","7AFF619FA04E66CF092F8472D508C6FF","longitudinal"
"https://redcap.ouhsc.edu/redcap/api/","myusername","2300","6FE8CDC56065D234A7CF2C65AA9106D3","simple-write"
"https://redcap.ouhsc.edu/redcap/api/","myusername","2301","0172DF46EE90004E567F55E2D1BCD3D5","russian"
"https://redcap.ouhsc.edu/redcap/api/","myusername","2302","D143A44FAD05FBEF5C35C797CE227D1E","empty-rows"
"https://redcap.ouhsc.edu/redcap/api/","myusername","2303","3F5E579FA2B611341D4A395C1A560EAA","single-column"
"https://redcap.ouhsc.edu/redcap/api/","myusername","2304","F783A553504660F85D532B75556575C0","super-wide-1"
"https://redcap.ouhsc.edu/redcap/api/","myusername","2305","14F771B245565F68CE312B3A7C1DFA74","survey"
"https://redcap.ouhsc.edu/redcap/api/","myusername","2306","B3469CB77B980CDEA5AFA15E9967564B","clinical-trial-1"
"https://redcap.ouhsc.edu/redcap/api/","myusername","","---","Clinical Trial (Fake) --read & write, contributed by @higgi13425"
"https://redcap.ouhsc.edu/redcap/api/","myusername","2307","F93F50EC97CE34BBAA8408F1033D6BD6","nonnumeric-record-id"
"https://redcap.ouhsc.edu/redcap/api/","myusername","2308","3C8363A38CF471D90AFC11DF4BC08AE7","dag"
"https://redcap.ouhsc.edu/redcap/api/","myusername","2309","48CD1D8660A55B5835CED8D9F2914A4C","potentially-problematic-values"
"https://redcap.ouhsc.edu/redcap/api/","myusername","2310","942B824E8BF8420E43A18166BB3B8F68","repeating-instruments"
"https://redcap.ouhsc.edu/redcap/api/","myusername","2311","E26AEBCCB2D8F726A58C5D6B37A31839","potentially-problematic-dictionary"
"https://redcap.ouhsc.edu/redcap/api/","myusername","2312","E030EAC2B318B0285F5A07A49687E9AA","metadata-write"
"https://redcap.ouhsc.edu/redcap/api/","admin" ,"2313","0CC0D062B9A98E9C09AA2086D0900BA4","dag-write --admin"
"https://redcap.ouhsc.edu/redcap/api/","user-dag1" ,"2313","6861DFE81C0D1B1C6060EDBFB4AB0C0B","dag-write --group A"
"https://redcap.ouhsc.edu/redcap/api/","myusername","2314","1D465018BFB8D36AF08A3E869A9906BB","super-wide-2"
"https://redcap.ouhsc.edu/redcap/api/","myusername","2315","BC2D824FCF936C80EEEDDDFC3D886043","super-wide-3"
"https://redcap.ouhsc.edu/redcap/api/","myusername","2316","1226D74DF3068D1749262E8557A597B8","repeating-instruments-sparse"
"https://redcap.ouhsc.edu/redcap/api/","myusername","2317","92D434EE7CB6D79D5C847D20DFA43979","arm-single-delete"
"https://redcap.ouhsc.edu/redcap/api/","myusername","2318","84E5DE832DDE291203295CDA09557A36","arm-multiple-delete"
"https://redcap.ouhsc.edu/redcap/api/","myusername","2319","6951EF3E34EB2CCDEE7F247362EB6B4F","arm-single-longitudinal"
"https://redcap.ouhsc.edu/redcap/api/","myusername","2320","6E3ED60D8C796B7AF347F219E8D3A03A","decimal-comma-and-dot"
"https://redcap.ouhsc.edu/redcap/api/","myusername","2321","0E837B14C3A3D13FDEE30E77258AA402","decimal-comma"
"https://redcap.ouhsc.edu/redcap/api/","myusername","2322","A6152E46E873F40343EC479B92CCF86E","decimal-dot"
"https://redcap.ouhsc.edu/redcap/api/","myusername","2323","E6157F94C420B330E8D968B9F8D3709B","validation-types-1"
"https://redcap.ouhsc.edu/redcap/api/","myusername","2324","20F33314E1B49AA3F21C663D459CAE93","blank-for-gray-status"
"https://redcap.ouhsc.edu/redcap/api/","myusername","2325","24A091AC6CE6A6949FA25BDF2B9F479F","checkboxes-1"
"https://redcap.ouhsc.edu/redcap/api/","myusername","2326","2B0DC445BBD06C42B07121C46D36F909","vignette-repeating"
"https://redcap.ouhsc.edu/redcap/api/","myusername","2327","9AF8502CD60F2B2F81BEF91F8FE1C482","file-repo"
8 changes: 8 additions & 0 deletions inst/misc/plugin-redirection.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,11 @@
- delete_arm_single : "https://redcap-dev-2.ouhsc.edu/redcap/plugins/redcapr/wipe-project-redcapr-arm-delete-single.php"
- delete_arm_multiple : "https://redcap-dev-2.ouhsc.edu/redcap/plugins/redcapr/wipe-project-redcapr-arm-delete-multiple.php"
- delete_dag : "https://redcap-dev-2.ouhsc.edu/redcap/plugins/redcapr/wipe-project-redcapr-dag-write.php"

-
instance: coph
plugins:
- delete_simple : "https://redcap.ouhsc.edu/redcap/plugins/redcapr/wipe-project-redcapr-simple.php"
- delete_arm_single : "https://redcap.ouhsc.edu/redcap/plugins/redcapr/wipe-project-redcapr-arm-delete-single.php"
- delete_arm_multiple : "https://redcap.ouhsc.edu/redcap/plugins/redcapr/wipe-project-redcapr-arm-delete-multiple.php"
- delete_dag : "https://redcap.ouhsc.edu/redcap/plugins/redcapr/wipe-project-redcapr-dag-write.php"
34 changes: 34 additions & 0 deletions inst/misc/project-redirection.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,37 @@
- checkboxes-1: 61
- vignette-repeating: 62
- file-repo: 63
-
instance: coph
credential_file: "misc/coph.credentials"
projects:
- simple: 2298
- longitudinal: 2299
- simple-write: 2300
- russian: 2301
- empty-rows: 2302
- single-column: 2303
- super-wide-1: 2304
- survey: 2305
- clinical-trial-1: 2306
- nonnumeric-record-id: 2307
- dag: 2308
- potentially-problematic-values: 2309
- repeating-instruments: 2310
- potentially-problematic-dictionary: 2311
- metadata-write: 2312
- dag-write: 2313
- super-wide-2: 2314
- super-wide-3: 2315
- repeating-instruments-sparse: 2316
- arm-single-delete: 2317
- arm-multiple-delete: 2318
- arm-single-longitudinal: 2319
- decimal-comma-and-dot: 2320
- decimal-comma: 2321
- decimal-dot: 2322
- validation-types-1: 2323
- blank-for-gray-status: 2324
- checkboxes-1: 2325
- vignette-repeating: 2326
- file-repo: 2327
11 changes: 6 additions & 5 deletions inst/test-data/projects/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,8 @@ Steps to recreate on a fresh server
Tests are case-sensitive.
1. 'unittestphifree': First name = "Unit Test"; Last name "Phi Free".
1. 'unittestphifree-dag1': First name = "Unit Test"; Last name "PHI Free DAG1"
1. Install plugins
1. Copy from [source](https://github.com/OuhscBbmc/REDCapR/tree/main/utility/plugins)
1. Change the `project_id` value at the bottom of each php file.
1. Move to destination directory
1. Update [plugin-redirection.yml](https://github.com/OuhscBbmc/REDCapR/blob/main/inst/misc/plugin-redirection.yml)
1. Copy all the projects to the new server
(I find it easier to walk down the credential file as I add them.)
1. Assign the user (created above) to the "api" user role for each project.
1. Add a token for each project
1. Create a credential file for the new project
Expand All @@ -24,3 +20,8 @@ Steps to recreate on a fresh server
1. Update the corresponding `token`
1. Leave `username` and `comment` untouched
1. Add new entries to [project-redirection.yml](https://github.com/OuhscBbmc/REDCapR/blob/main/inst/misc/project-redirection.yml)
1. Install plugins
1. Copy from [source](https://github.com/OuhscBbmc/REDCapR/tree/main/utility/plugins)
1. Change the `project_id` value at the bottom of each php file.
1. Move to destination directory
1. Update [plugin-redirection.yml](https://github.com/OuhscBbmc/REDCapR/blob/main/inst/misc/plugin-redirection.yml)
7 changes: 7 additions & 0 deletions inst/test-data/projects/arm-multiple-delete/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
arm-multiple-delete Setup
==============

In addition to the typical steps to establish a project,
make sure the plugin on your test server is updated to the correct `project_id` value in the delete sql.

The sql is in [wipe-project-redcapr-arm-delete-multiple.php](../../../../utility/plugins/wipe-project-redcapr-arm-delete-multiple.php).
18 changes: 10 additions & 8 deletions inst/test-data/projects/arm-multiple-delete/project.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<ODM xmlns="http://www.cdisc.org/ns/odm/v1.3" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:redcap="https://projectredcap.org" xsi:schemaLocation="http://www.cdisc.org/ns/odm/v1.3 schema/odm/ODM1-3-1.xsd" ODMVersion="1.3.1" FileOID="000-00-0000" FileType="Snapshot" Description="REDCapR Delete Multiple Arms" AsOfDateTime="2024-10-12T16:10:52" CreationDateTime="2024-10-12T16:10:52" SourceSystem="REDCap" SourceSystemVersion="14.6.11">
<Study OID="Project.REDCapRDeleteMultipleArms">
<ODM xmlns="http://www.cdisc.org/ns/odm/v1.3" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:redcap="https://projectredcap.org" xsi:schemaLocation="http://www.cdisc.org/ns/odm/v1.3 schema/odm/ODM1-3-1.xsd" ODMVersion="1.3.1" FileOID="000-00-0000" FileType="Snapshot" Description="REDCapR: arm-multiple-delete" AsOfDateTime="2024-11-05T15:26:45" CreationDateTime="2024-11-05T15:26:45" SourceSystem="REDCap" SourceSystemVersion="14.7.3">
<Study OID="Project.REDCapRArmmultipledelete">
<GlobalVariables>
<StudyName>REDCapR Delete Multiple Arms</StudyName>
<StudyDescription>This file contains the metadata, events, and data for REDCap project "REDCapR Delete Multiple Arms".</StudyDescription>
<ProtocolName>REDCapR Delete Multiple Arms</ProtocolName>
<StudyName>REDCapR: arm-multiple-delete</StudyName>
<StudyDescription>This file contains the metadata, events, and data for REDCap project "REDCapR: arm-multiple-delete".</StudyDescription>
<ProtocolName>REDCapR: arm-multiple-delete</ProtocolName>
<redcap:RecordAutonumberingEnabled>1</redcap:RecordAutonumberingEnabled>
<redcap:CustomRecordLabel></redcap:CustomRecordLabel>
<redcap:SecondaryUniqueField></redcap:SecondaryUniqueField>
Expand All @@ -13,15 +13,17 @@
<redcap:SchedulingEnabled>0</redcap:SchedulingEnabled>
<redcap:SurveysEnabled>1</redcap:SurveysEnabled>
<redcap:SurveyInvitationEmailField></redcap:SurveyInvitationEmailField>
<redcap:RandomizationEnabled>0</redcap:RandomizationEnabled>
<redcap:DisplayTodayNowButton>1</redcap:DisplayTodayNowButton>
<redcap:PreventBranchingEraseValues>0</redcap:PreventBranchingEraseValues>
<redcap:RequireChangeReason>0</redcap:RequireChangeReason>
<redcap:DataHistoryPopup>1</redcap:DataHistoryPopup>
<redcap:OrderRecordsByField></redcap:OrderRecordsByField>
<redcap:taskCompleteStatus>0</redcap:taskCompleteStatus>
<redcap:MyCapEnabled>0</redcap:MyCapEnabled>
<redcap:Purpose>4</redcap:Purpose>
<redcap:PurposeOther></redcap:PurposeOther>
<redcap:ProjectNotes>REDCapR Test Suite: delete records from a multiple-arm project</redcap:ProjectNotes>
<redcap:ProjectNotes></redcap:ProjectNotes>
<redcap:MissingDataCodes></redcap:MissingDataCodes>
<redcap:ProtectedEmailMode>0</redcap:ProtectedEmailMode>
<redcap:ProtectedEmailModeCustomText></redcap:ProtectedEmailModeCustomText>
Expand All @@ -31,7 +33,7 @@
<redcap:UserRoles role_name="api" unique_role_name="U-562XDAR84R" lock_record="0" lock_record_multiform="0" lock_record_customize="0" data_export_tool="" data_export_instruments="[demographics,1]" data_import_tool="0" data_comparison_tool="0" data_logging="0" email_logging="0" file_repository="0" double_data="0" user_rights="0" data_access_groups="0" graphical="0" reports="0" design="0" alerts="0" calendar="0" data_entry="[demographics,1]" api_export="1" api_import="1" api_modules="0" mobile_app="0" mobile_app_download_data="0" record_create="1" record_rename="0" record_delete="1" dts="0" participants="0" data_quality_design="0" data_quality_execute="0" data_quality_resolution="1" random_setup="0" random_dashboard="0" random_perform="0" realtime_webservice_mapping="0" realtime_webservice_adjudicate="0" external_module_config="" mycap_participants="1"/>
</redcap:UserRolesGroup>
</GlobalVariables>
<MetaDataVersion OID="Metadata.REDCapRDeleteMultipleArms_2024-10-12_1610" Name="REDCapR Delete Multiple Arms" redcap:RecordIdField="record_id">
<MetaDataVersion OID="Metadata.REDCapRArmmultipledelete_2024-11-05_1526" Name="REDCapR: arm-multiple-delete" redcap:RecordIdField="record_id">
<Protocol>
<StudyEventRef StudyEventOID="Event.event_1_arm_1" OrderNumber="1" Mandatory="No"/>
<StudyEventRef StudyEventOID="Event.event_1_arm_2" OrderNumber="2" Mandatory="No"/>
Expand Down Expand Up @@ -78,7 +80,7 @@
</CodeList>
</MetaDataVersion>
</Study>
<ClinicalData StudyOID="Project.REDCapRDeleteMultipleArms" MetaDataVersionOID="Metadata.REDCapRDeleteMultipleArms_2024-10-12_1610">
<ClinicalData StudyOID="Project.REDCapRArmmultipledelete" MetaDataVersionOID="Metadata.REDCapRArmmultipledelete_2024-11-05_1526">
<SubjectData SubjectKey="101" redcap:RecordIdField="record_id">
<StudyEventData StudyEventOID="Event.event_1_arm_1" StudyEventRepeatKey="1" redcap:UniqueEventName="event_1_arm_1">
<FormData FormOID="Form.demographics" FormRepeatKey="1">
Expand Down
7 changes: 7 additions & 0 deletions inst/test-data/projects/arm-single-delete/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
arm-single-delete Setup
==============

In addition to the typical steps to establish a project,
make sure the plugin on your test server is updated to the correct `project_id` value in the delete sql.

The sql is in [wipe-project-redcapr-arm-delete-single.php](../../../../utility/plugins/wipe-project-redcapr-arm-delete-single.php).
18 changes: 10 additions & 8 deletions inst/test-data/projects/arm-single-delete/project.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<ODM xmlns="http://www.cdisc.org/ns/odm/v1.3" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:redcap="https://projectredcap.org" xsi:schemaLocation="http://www.cdisc.org/ns/odm/v1.3 schema/odm/ODM1-3-1.xsd" ODMVersion="1.3.1" FileOID="000-00-0000" FileType="Snapshot" Description="REDCapR Delete Single Arm" AsOfDateTime="2024-10-12T15:56:42" CreationDateTime="2024-10-12T15:56:42" SourceSystem="REDCap" SourceSystemVersion="14.6.11">
<Study OID="Project.REDCapRDeleteSingleArm">
<ODM xmlns="http://www.cdisc.org/ns/odm/v1.3" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:redcap="https://projectredcap.org" xsi:schemaLocation="http://www.cdisc.org/ns/odm/v1.3 schema/odm/ODM1-3-1.xsd" ODMVersion="1.3.1" FileOID="000-00-0000" FileType="Snapshot" Description="REDCapR: arm-single-delete" AsOfDateTime="2024-11-05T13:23:22" CreationDateTime="2024-11-05T13:23:22" SourceSystem="REDCap" SourceSystemVersion="14.7.3">
<Study OID="Project.REDCapRArmsingledelete">
<GlobalVariables>
<StudyName>REDCapR Delete Single Arm</StudyName>
<StudyDescription>This file contains the metadata, events, and data for REDCap project "REDCapR Delete Single Arm".</StudyDescription>
<ProtocolName>REDCapR Delete Single Arm</ProtocolName>
<StudyName>REDCapR: arm-single-delete</StudyName>
<StudyDescription>This file contains the metadata, events, and data for REDCap project "REDCapR: arm-single-delete".</StudyDescription>
<ProtocolName>REDCapR: arm-single-delete</ProtocolName>
<redcap:RecordAutonumberingEnabled>1</redcap:RecordAutonumberingEnabled>
<redcap:CustomRecordLabel></redcap:CustomRecordLabel>
<redcap:SecondaryUniqueField></redcap:SecondaryUniqueField>
Expand All @@ -13,15 +13,17 @@
<redcap:SchedulingEnabled>0</redcap:SchedulingEnabled>
<redcap:SurveysEnabled>0</redcap:SurveysEnabled>
<redcap:SurveyInvitationEmailField></redcap:SurveyInvitationEmailField>
<redcap:RandomizationEnabled>0</redcap:RandomizationEnabled>
<redcap:DisplayTodayNowButton>1</redcap:DisplayTodayNowButton>
<redcap:PreventBranchingEraseValues>0</redcap:PreventBranchingEraseValues>
<redcap:RequireChangeReason>0</redcap:RequireChangeReason>
<redcap:DataHistoryPopup>1</redcap:DataHistoryPopup>
<redcap:OrderRecordsByField></redcap:OrderRecordsByField>
<redcap:taskCompleteStatus>0</redcap:taskCompleteStatus>
<redcap:MyCapEnabled>0</redcap:MyCapEnabled>
<redcap:Purpose>4</redcap:Purpose>
<redcap:PurposeOther></redcap:PurposeOther>
<redcap:ProjectNotes>REDCapR Test Suite: delete records from a single-arm project</redcap:ProjectNotes>
<redcap:ProjectNotes></redcap:ProjectNotes>
<redcap:MissingDataCodes></redcap:MissingDataCodes>
<redcap:ProtectedEmailMode>0</redcap:ProtectedEmailMode>
<redcap:ProtectedEmailModeCustomText></redcap:ProtectedEmailModeCustomText>
Expand All @@ -31,7 +33,7 @@
<redcap:UserRoles role_name="api" unique_role_name="U-154F4NHAAT" lock_record="0" lock_record_multiform="0" lock_record_customize="0" data_export_tool="" data_export_instruments="[demographics,1]" data_import_tool="0" data_comparison_tool="0" data_logging="0" email_logging="0" file_repository="0" double_data="0" user_rights="0" data_access_groups="0" graphical="0" reports="0" design="0" alerts="0" calendar="0" data_entry="[demographics,1]" api_export="1" api_import="1" api_modules="0" mobile_app="0" mobile_app_download_data="0" record_create="1" record_rename="0" record_delete="1" dts="0" participants="1" data_quality_design="0" data_quality_execute="0" data_quality_resolution="1" random_setup="0" random_dashboard="0" random_perform="0" realtime_webservice_mapping="0" realtime_webservice_adjudicate="0" external_module_config="" mycap_participants="1"/>
</redcap:UserRolesGroup>
</GlobalVariables>
<MetaDataVersion OID="Metadata.REDCapRDeleteSingleArm_2024-10-12_1556" Name="REDCapR Delete Single Arm" redcap:RecordIdField="record_id">
<MetaDataVersion OID="Metadata.REDCapRArmsingledelete_2024-11-05_1323" Name="REDCapR: arm-single-delete" redcap:RecordIdField="record_id">
<FormDef OID="Form.demographics" Name="demographics" Repeating="No" redcap:FormName="demographics">
<ItemGroupRef ItemGroupOID="demographics.record_id" Mandatory="No"/>
<ItemGroupRef ItemGroupOID="demographics.demographics_complete" Mandatory="No"/>
Expand Down Expand Up @@ -64,7 +66,7 @@
</CodeList>
</MetaDataVersion>
</Study>
<ClinicalData StudyOID="Project.REDCapRDeleteSingleArm" MetaDataVersionOID="Metadata.REDCapRDeleteSingleArm_2024-10-12_1556">
<ClinicalData StudyOID="Project.REDCapRArmsingledelete" MetaDataVersionOID="Metadata.REDCapRArmsingledelete_2024-11-05_1323">
<SubjectData SubjectKey="101" redcap:RecordIdField="record_id">
<FormData FormOID="Form.demographics" FormRepeatKey="1">
<ItemGroupData ItemGroupOID="demographics.record_id" ItemGroupRepeatKey="1">
Expand Down
Loading

0 comments on commit 0172ce0

Please sign in to comment.