Skip to content

Commit

Permalink
prep for image downloads
Browse files Browse the repository at this point in the history
ref #530
  • Loading branch information
wibeasley committed Sep 5, 2024
1 parent 5606071 commit 361ea2f
Show file tree
Hide file tree
Showing 2 changed files with 286 additions and 2 deletions.
4 changes: 2 additions & 2 deletions inst/test-data/vignette-repeating/data.csv
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
record_id,redcap_repeat_instrument,redcap_repeat_instance,height,weight,bmi,demographics_complete,sbp,dbp,blood_pressure_complete,lab,conc,laboratory_complete
record_id,redcap_repeat_instrument,redcap_repeat_instance,height,weight,bmi,intake_complete,sbp,dbp,blood_pressure_complete,lab,conc,laboratory_complete
1,,,1.0,11.0,111.0,2,,,,,,
1,blood_pressure,1,,,,,1.1,11.1,2,,,
1,blood_pressure,2,,,,,1.2,11.2,2,,,
1,blood_pressure,3,,,,,1.3,11.3,2,,,
1,laboratory,1,,,,,,,,aa1,"1.1 ppm",2
1,laboratory,2,,,,,,,,aa2,"11.2 ppm",2
1,laboratory,2,,,,,,,,aa2,"1.2 ppm",2
2,,,2.0,22.0,222.0,2,,,,,,
2,blood_pressure,1,,,,,2.1,22.1,2,,,
2,blood_pressure,2,,,,,2.2,22.2,2,,,
Expand Down
284 changes: 284 additions & 0 deletions inst/test-data/vignette-repeating/project.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,284 @@
<?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 Vignette: Reading Repeating Measures" AsOfDateTime="2024-09-05T16:14:08" CreationDateTime="2024-09-05T16:14:08" SourceSystem="REDCap" SourceSystemVersion="14.6.4">
<Study OID="Project.REDCapRVignetteReadingRepeatin">
<GlobalVariables>
<StudyName>REDCapR Vignette: Reading Repeating Measures</StudyName>
<StudyDescription>This file contains the metadata, events, and data for REDCap project "REDCapR Vignette: Reading Repeating Measures".</StudyDescription>
<ProtocolName>REDCapR Vignette: Reading Repeating Measures</ProtocolName>
<redcap:RecordAutonumberingEnabled>1</redcap:RecordAutonumberingEnabled>
<redcap:CustomRecordLabel>[height]; [weight]; [bmi]</redcap:CustomRecordLabel>
<redcap:SecondaryUniqueField></redcap:SecondaryUniqueField>
<redcap:SecondaryUniqueFieldDisplayValue>0</redcap:SecondaryUniqueFieldDisplayValue>
<redcap:SecondaryUniqueFieldDisplayLabel>0</redcap:SecondaryUniqueFieldDisplayLabel>
<redcap:SchedulingEnabled>0</redcap:SchedulingEnabled>
<redcap:SurveysEnabled>0</redcap:SurveysEnabled>
<redcap:SurveyInvitationEmailField></redcap:SurveyInvitationEmailField>
<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:MyCapEnabled>0</redcap:MyCapEnabled>
<redcap:Purpose>3</redcap:Purpose>
<redcap:PurposeOther></redcap:PurposeOther>
<redcap:ProjectNotes>https://github.com/OuhscBbmc/REDCapR/blob/main/vignettes/longitudinal-and-repeating.Rmd</redcap:ProjectNotes>
<redcap:MissingDataCodes></redcap:MissingDataCodes>
<redcap:ProtectedEmailMode>0</redcap:ProtectedEmailMode>
<redcap:ProtectedEmailModeCustomText>REDCap Secure Messaging</redcap:ProtectedEmailModeCustomText>
<redcap:ProtectedEmailModeTrigger>ALL</redcap:ProtectedEmailModeTrigger>
<redcap:ProtectedEmailModeLogo></redcap:ProtectedEmailModeLogo>
<redcap:RepeatingInstrumentsAndEvents>
<redcap:RepeatingInstruments>
<redcap:RepeatingInstrument redcap:UniqueEventName="event_1_arm_1" redcap:RepeatInstrument="blood_pressure" redcap:CustomLabel="[sbp] / [dbp]"/>
<redcap:RepeatingInstrument redcap:UniqueEventName="event_1_arm_1" redcap:RepeatInstrument="laboratory" redcap:CustomLabel="[lab] @ [conc]"/>
</redcap:RepeatingInstruments>
</redcap:RepeatingInstrumentsAndEvents>
</GlobalVariables>
<MetaDataVersion OID="Metadata.REDCapRVignetteReadingRepeatin_2024-09-05_1614" Name="REDCapR Vignette: Reading Repeating Measures" redcap:RecordIdField="record_id">
<FormDef OID="Form.intake" Name="intake" Repeating="No" redcap:FormName="intake">
<ItemGroupRef ItemGroupOID="intake.record_id" Mandatory="No"/>
<ItemGroupRef ItemGroupOID="intake.intake_complete" Mandatory="No"/>
</FormDef>
<FormDef OID="Form.blood_pressure" Name="blood_pressure" Repeating="No" redcap:FormName="blood_pressure">
<ItemGroupRef ItemGroupOID="blood_pressure.sbp" Mandatory="No"/>
<ItemGroupRef ItemGroupOID="blood_pressure.blood_pressure_complete" Mandatory="No"/>
</FormDef>
<FormDef OID="Form.laboratory" Name="laboratory" Repeating="No" redcap:FormName="laboratory">
<ItemGroupRef ItemGroupOID="laboratory.lab" Mandatory="No"/>
<ItemGroupRef ItemGroupOID="laboratory.laboratory_complete" Mandatory="No"/>
</FormDef>
<ItemGroupDef OID="intake.record_id" Name="intake" Repeating="No">
<ItemRef ItemOID="record_id" Mandatory="No" redcap:Variable="record_id"/>
<ItemRef ItemOID="height" Mandatory="Yes" redcap:Variable="height"/>
<ItemRef ItemOID="weight" Mandatory="Yes" redcap:Variable="weight"/>
<ItemRef ItemOID="bmi" Mandatory="Yes" redcap:Variable="bmi"/>
</ItemGroupDef>
<ItemGroupDef OID="intake.intake_complete" Name="Form Status" Repeating="No">
<ItemRef ItemOID="intake_complete" Mandatory="No" redcap:Variable="intake_complete"/>
</ItemGroupDef>
<ItemGroupDef OID="blood_pressure.sbp" Name="blood_pressure" Repeating="No">
<ItemRef ItemOID="sbp" Mandatory="Yes" redcap:Variable="sbp"/>
<ItemRef ItemOID="dbp" Mandatory="Yes" redcap:Variable="dbp"/>
</ItemGroupDef>
<ItemGroupDef OID="blood_pressure.blood_pressure_complete" Name="Form Status" Repeating="No">
<ItemRef ItemOID="blood_pressure_complete" Mandatory="No" redcap:Variable="blood_pressure_complete"/>
</ItemGroupDef>
<ItemGroupDef OID="laboratory.lab" Name="laboratory" Repeating="No">
<ItemRef ItemOID="lab" Mandatory="No" redcap:Variable="lab"/>
<ItemRef ItemOID="conc" Mandatory="No" redcap:Variable="conc"/>
</ItemGroupDef>
<ItemGroupDef OID="laboratory.laboratory_complete" Name="Form Status" Repeating="No">
<ItemRef ItemOID="laboratory_complete" Mandatory="No" redcap:Variable="laboratory_complete"/>
</ItemGroupDef>
<ItemDef OID="record_id" Name="record_id" DataType="text" Length="999" redcap:Variable="record_id" redcap:FieldType="text">
<Question><TranslatedText>Record ID</TranslatedText></Question>
</ItemDef>
<ItemDef OID="height" Name="height" DataType="float" Length="999" redcap:Variable="height" redcap:FieldType="text" redcap:TextValidationType="number_1dp" redcap:RequiredField="y">
<Question><TranslatedText>patient height</TranslatedText></Question>
<RangeCheck Comparator="GE" SoftHard="Soft">
<CheckValue>1</CheckValue>
<ErrorMessage><TranslatedText>The value you provided is outside the suggested range (1 - 100). This value is admissible, but you may wish to double check it.</TranslatedText></ErrorMessage>
</RangeCheck>
<RangeCheck Comparator="LE" SoftHard="Soft">
<CheckValue>100</CheckValue>
<ErrorMessage><TranslatedText>The value you provided is outside the suggested range (1 - 100). This value is admissible, but you may wish to double check it.</TranslatedText></ErrorMessage>
</RangeCheck>
</ItemDef>
<ItemDef OID="weight" Name="weight" DataType="float" Length="999" redcap:Variable="weight" redcap:FieldType="text" redcap:TextValidationType="number_1dp" redcap:RequiredField="y">
<Question><TranslatedText>patient weight</TranslatedText></Question>
<RangeCheck Comparator="GE" SoftHard="Soft">
<CheckValue>1</CheckValue>
<ErrorMessage><TranslatedText>The value you provided is outside the suggested range (1 - 300). This value is admissible, but you may wish to double check it.</TranslatedText></ErrorMessage>
</RangeCheck>
<RangeCheck Comparator="LE" SoftHard="Soft">
<CheckValue>300</CheckValue>
<ErrorMessage><TranslatedText>The value you provided is outside the suggested range (1 - 300). This value is admissible, but you may wish to double check it.</TranslatedText></ErrorMessage>
</RangeCheck>
</ItemDef>
<ItemDef OID="bmi" Name="bmi" DataType="float" Length="999" redcap:Variable="bmi" redcap:FieldType="text" redcap:TextValidationType="number_1dp" redcap:RequiredField="y">
<Question><TranslatedText>patient bmi</TranslatedText></Question>
<RangeCheck Comparator="GE" SoftHard="Soft">
<CheckValue>0</CheckValue>
<ErrorMessage><TranslatedText>The value you provided is outside the suggested range (0 - 300). This value is admissible, but you may wish to double check it.</TranslatedText></ErrorMessage>
</RangeCheck>
<RangeCheck Comparator="LE" SoftHard="Soft">
<CheckValue>300</CheckValue>
<ErrorMessage><TranslatedText>The value you provided is outside the suggested range (0 - 300). This value is admissible, but you may wish to double check it.</TranslatedText></ErrorMessage>
</RangeCheck>
</ItemDef>
<ItemDef OID="intake_complete" Name="intake_complete" DataType="text" Length="1" redcap:Variable="intake_complete" redcap:FieldType="select" redcap:SectionHeader="Form Status">
<Question><TranslatedText>Complete?</TranslatedText></Question>
<CodeListRef CodeListOID="intake_complete.choices"/>
</ItemDef>
<ItemDef OID="sbp" Name="sbp" DataType="float" Length="999" SignificantDigits="1" redcap:Variable="sbp" redcap:FieldType="text" redcap:TextValidationType="float" redcap:RequiredField="y">
<Question><TranslatedText>systolic blood pressure</TranslatedText></Question>
<RangeCheck Comparator="GE" SoftHard="Soft">
<CheckValue>1</CheckValue>
<ErrorMessage><TranslatedText>The value you provided is outside the suggested range (1 - 300). This value is admissible, but you may wish to double check it.</TranslatedText></ErrorMessage>
</RangeCheck>
<RangeCheck Comparator="LE" SoftHard="Soft">
<CheckValue>300</CheckValue>
<ErrorMessage><TranslatedText>The value you provided is outside the suggested range (1 - 300). This value is admissible, but you may wish to double check it.</TranslatedText></ErrorMessage>
</RangeCheck>
</ItemDef>
<ItemDef OID="dbp" Name="dbp" DataType="float" Length="999" SignificantDigits="1" redcap:Variable="dbp" redcap:FieldType="text" redcap:TextValidationType="float" redcap:RequiredField="y">
<Question><TranslatedText>diastolic blood pressure</TranslatedText></Question>
<RangeCheck Comparator="GE" SoftHard="Soft">
<CheckValue>1</CheckValue>
<ErrorMessage><TranslatedText>The value you provided is outside the suggested range (1 - 300). This value is admissible, but you may wish to double check it.</TranslatedText></ErrorMessage>
</RangeCheck>
<RangeCheck Comparator="LE" SoftHard="Soft">
<CheckValue>300</CheckValue>
<ErrorMessage><TranslatedText>The value you provided is outside the suggested range (1 - 300). This value is admissible, but you may wish to double check it.</TranslatedText></ErrorMessage>
</RangeCheck>
</ItemDef>
<ItemDef OID="blood_pressure_complete" Name="blood_pressure_complete" DataType="text" Length="1" redcap:Variable="blood_pressure_complete" redcap:FieldType="select" redcap:SectionHeader="Form Status">
<Question><TranslatedText>Complete?</TranslatedText></Question>
<CodeListRef CodeListOID="blood_pressure_complete.choices"/>
</ItemDef>
<ItemDef OID="lab" Name="lab" DataType="text" Length="999" redcap:Variable="lab" redcap:FieldType="text">
<Question><TranslatedText>lab value</TranslatedText></Question>
</ItemDef>
<ItemDef OID="conc" Name="conc" DataType="text" Length="999" redcap:Variable="conc" redcap:FieldType="text">
<Question><TranslatedText>concentration</TranslatedText></Question>
</ItemDef>
<ItemDef OID="laboratory_complete" Name="laboratory_complete" DataType="text" Length="1" redcap:Variable="laboratory_complete" redcap:FieldType="select" redcap:SectionHeader="Form Status">
<Question><TranslatedText>Complete?</TranslatedText></Question>
<CodeListRef CodeListOID="laboratory_complete.choices"/>
</ItemDef>
<CodeList OID="intake_complete.choices" Name="intake_complete" DataType="text" redcap:Variable="intake_complete">
<CodeListItem CodedValue="0"><Decode><TranslatedText>Incomplete</TranslatedText></Decode></CodeListItem>
<CodeListItem CodedValue="1"><Decode><TranslatedText>Unverified</TranslatedText></Decode></CodeListItem>
<CodeListItem CodedValue="2"><Decode><TranslatedText>Complete</TranslatedText></Decode></CodeListItem>
</CodeList>
<CodeList OID="blood_pressure_complete.choices" Name="blood_pressure_complete" DataType="text" redcap:Variable="blood_pressure_complete">
<CodeListItem CodedValue="0"><Decode><TranslatedText>Incomplete</TranslatedText></Decode></CodeListItem>
<CodeListItem CodedValue="1"><Decode><TranslatedText>Unverified</TranslatedText></Decode></CodeListItem>
<CodeListItem CodedValue="2"><Decode><TranslatedText>Complete</TranslatedText></Decode></CodeListItem>
</CodeList>
<CodeList OID="laboratory_complete.choices" Name="laboratory_complete" DataType="text" redcap:Variable="laboratory_complete">
<CodeListItem CodedValue="0"><Decode><TranslatedText>Incomplete</TranslatedText></Decode></CodeListItem>
<CodeListItem CodedValue="1"><Decode><TranslatedText>Unverified</TranslatedText></Decode></CodeListItem>
<CodeListItem CodedValue="2"><Decode><TranslatedText>Complete</TranslatedText></Decode></CodeListItem>
</CodeList>
</MetaDataVersion>
</Study>
<ClinicalData StudyOID="Project.REDCapRVignetteReadingRepeatin" MetaDataVersionOID="Metadata.REDCapRVignetteReadingRepeatin_2024-09-05_1614">
<SubjectData SubjectKey="1" redcap:RecordIdField="record_id">
<FormData FormOID="Form.intake" FormRepeatKey="1">
<ItemGroupData ItemGroupOID="intake.record_id" ItemGroupRepeatKey="1">
<ItemData ItemOID="record_id" Value="1"/>
<ItemData ItemOID="height" Value="1.0"/>
<ItemData ItemOID="weight" Value="11.0"/>
<ItemData ItemOID="bmi" Value="111.0"/>
</ItemGroupData>
<ItemGroupData ItemGroupOID="intake.intake_complete" ItemGroupRepeatKey="1">
<ItemData ItemOID="intake_complete" Value="2"/>
</ItemGroupData>
</FormData>
<FormData FormOID="Form.blood_pressure" FormRepeatKey="1">
<ItemGroupData ItemGroupOID="blood_pressure.sbp" ItemGroupRepeatKey="1">
<ItemData ItemOID="sbp" Value="1.1"/>
<ItemData ItemOID="dbp" Value="11.1"/>
</ItemGroupData>
<ItemGroupData ItemGroupOID="blood_pressure.blood_pressure_complete" ItemGroupRepeatKey="1">
<ItemData ItemOID="blood_pressure_complete" Value="2"/>
</ItemGroupData>
</FormData>
<FormData FormOID="Form.blood_pressure" FormRepeatKey="2">
<ItemGroupData ItemGroupOID="blood_pressure.sbp" ItemGroupRepeatKey="1">
<ItemData ItemOID="sbp" Value="1.2"/>
<ItemData ItemOID="dbp" Value="11.2"/>
</ItemGroupData>
<ItemGroupData ItemGroupOID="blood_pressure.blood_pressure_complete" ItemGroupRepeatKey="1">
<ItemData ItemOID="blood_pressure_complete" Value="2"/>
</ItemGroupData>
</FormData>
<FormData FormOID="Form.blood_pressure" FormRepeatKey="3">
<ItemGroupData ItemGroupOID="blood_pressure.sbp" ItemGroupRepeatKey="1">
<ItemData ItemOID="sbp" Value="1.3"/>
<ItemData ItemOID="dbp" Value="11.3"/>
</ItemGroupData>
<ItemGroupData ItemGroupOID="blood_pressure.blood_pressure_complete" ItemGroupRepeatKey="1">
<ItemData ItemOID="blood_pressure_complete" Value="2"/>
</ItemGroupData>
</FormData>
<FormData FormOID="Form.laboratory" FormRepeatKey="1">
<ItemGroupData ItemGroupOID="laboratory.lab" ItemGroupRepeatKey="1">
<ItemData ItemOID="lab" Value="aa1"/>
<ItemData ItemOID="conc" Value="1.1 ppm"/>
</ItemGroupData>
<ItemGroupData ItemGroupOID="laboratory.laboratory_complete" ItemGroupRepeatKey="1">
<ItemData ItemOID="laboratory_complete" Value="2"/>
</ItemGroupData>
</FormData>
<FormData FormOID="Form.laboratory" FormRepeatKey="2">
<ItemGroupData ItemGroupOID="laboratory.lab" ItemGroupRepeatKey="1">
<ItemData ItemOID="lab" Value="aa2"/>
<ItemData ItemOID="conc" Value="1.2 ppm"/>
</ItemGroupData>
<ItemGroupData ItemGroupOID="laboratory.laboratory_complete" ItemGroupRepeatKey="1">
<ItemData ItemOID="laboratory_complete" Value="2"/>
</ItemGroupData>
</FormData>
</SubjectData>
<SubjectData SubjectKey="2" redcap:RecordIdField="record_id">
<FormData FormOID="Form.intake" FormRepeatKey="1">
<ItemGroupData ItemGroupOID="intake.record_id" ItemGroupRepeatKey="1">
<ItemData ItemOID="record_id" Value="2"/>
<ItemData ItemOID="height" Value="2.0"/>
<ItemData ItemOID="weight" Value="22.0"/>
<ItemData ItemOID="bmi" Value="222.0"/>
</ItemGroupData>
<ItemGroupData ItemGroupOID="intake.intake_complete" ItemGroupRepeatKey="1">
<ItemData ItemOID="intake_complete" Value="2"/>
</ItemGroupData>
</FormData>
<FormData FormOID="Form.blood_pressure" FormRepeatKey="1">
<ItemGroupData ItemGroupOID="blood_pressure.sbp" ItemGroupRepeatKey="1">
<ItemData ItemOID="sbp" Value="2.1"/>
<ItemData ItemOID="dbp" Value="22.1"/>
</ItemGroupData>
<ItemGroupData ItemGroupOID="blood_pressure.blood_pressure_complete" ItemGroupRepeatKey="1">
<ItemData ItemOID="blood_pressure_complete" Value="2"/>
</ItemGroupData>
</FormData>
<FormData FormOID="Form.blood_pressure" FormRepeatKey="2">
<ItemGroupData ItemGroupOID="blood_pressure.sbp" ItemGroupRepeatKey="1">
<ItemData ItemOID="sbp" Value="2.2"/>
<ItemData ItemOID="dbp" Value="22.2"/>
</ItemGroupData>
<ItemGroupData ItemGroupOID="blood_pressure.blood_pressure_complete" ItemGroupRepeatKey="1">
<ItemData ItemOID="blood_pressure_complete" Value="2"/>
</ItemGroupData>
</FormData>
<FormData FormOID="Form.blood_pressure" FormRepeatKey="3">
<ItemGroupData ItemGroupOID="blood_pressure.sbp" ItemGroupRepeatKey="1">
<ItemData ItemOID="sbp" Value="2.3"/>
<ItemData ItemOID="dbp" Value="22.3"/>
</ItemGroupData>
<ItemGroupData ItemGroupOID="blood_pressure.blood_pressure_complete" ItemGroupRepeatKey="1">
<ItemData ItemOID="blood_pressure_complete" Value="2"/>
</ItemGroupData>
</FormData>
<FormData FormOID="Form.laboratory" FormRepeatKey="1">
<ItemGroupData ItemGroupOID="laboratory.lab" ItemGroupRepeatKey="1">
<ItemData ItemOID="lab" Value="bb1"/>
<ItemData ItemOID="conc" Value="2.1 ppm"/>
</ItemGroupData>
<ItemGroupData ItemGroupOID="laboratory.laboratory_complete" ItemGroupRepeatKey="1">
<ItemData ItemOID="laboratory_complete" Value="2"/>
</ItemGroupData>
</FormData>
<FormData FormOID="Form.laboratory" FormRepeatKey="2">
<ItemGroupData ItemGroupOID="laboratory.lab" ItemGroupRepeatKey="1">
<ItemData ItemOID="lab" Value="bb2"/>
<ItemData ItemOID="conc" Value="2.2 ppm"/>
</ItemGroupData>
<ItemGroupData ItemGroupOID="laboratory.laboratory_complete" ItemGroupRepeatKey="1">
<ItemData ItemOID="laboratory_complete" Value="2"/>
</ItemGroupData>
</FormData>
</SubjectData>
</ClinicalData>
</ODM>

0 comments on commit 361ea2f

Please sign in to comment.