Download presentation
Presentation is loading. Please wait.
Published byVernon Anderson Modified over 6 years ago
1
+ SAS/R Reporting REDCapCon New York City August 14-17, 2017
2
REDCap and SAS/R Reporting
Exporting options Importing options SAS/R operations Automation What do you do?
3
REDCap and SAS/R Reporting
Exporting options: Manual from REDCap raw data vs labels full data vs form-specific file naming: REDCap default vs “save as” API plus cURL (or other) create form-specific files control archiving and file naming scheduled (chron job) or ad hoc
4
REDCap and SAS/R Reporting
Importing options: REDCap SAS/R syntax Custom-written syntax Other code generator
5
REDCap and SAS Reporting
%macro removeOldFile(bye); %if %sysfunc(exist(&bye.)) %then %do; proc delete data=&bye.; run; %end; %mend removeOldFile; %removeOldFile(work.redcap); data REDCAP; %let _EFIERR_ = 0; infile 'CTSIWorkshopProject_DATA_NOHDRS_ _0816.csv' delimiter = ',' MISSOVER DSD lrecl=32767 firstobs=1 ; informat redcap_num best32. ; informat redcap_event_name $500. ; informat clinic $500. ; informat id $500. ; informat age best32. ; informat asthma best32. ; informat language best32. ; informat imm best32. ; informat medhx best32. ; informat othstudy best32. ; informat elig best32. ; informat consent best32. ; informat el_eligibility_complete best32. ; informat sex best32. ; informat dob yymmdd10. ; informat marital best32. ; informat ethnic best32. ; informat race___1 best32. ; informat race___2 best32. ; informat race___3 best32. ; informat race___4 best32. ; informat race___5 best32. ; informat race___6 best32. ; informat oracesp $500. ; informat dem_demographics_complete best32. ; informat hamd_hamilton_depres_v_0 best32. ; informat cssrs_suicide_rating_v_1 best32. ; informat scidip_psychotic_scr_v_2 best32. ; informat mphx_medicalpsychiat_v_3 best32. ; informat life_longitudinal_in_v_4 best32. ; format redcap_num best12. ; format redcap_event_name $500. ; format clinic $500. ; format id $500. ; format age best12. ; format asthma best12. ; format language best12. ; format imm best12. ; format medhx best12. ; format othstudy best12. ; format elig best12. ; format consent best12. ; format el_eligibility_complete best12. ; format sex best12. ; format dob yymmdd10. ; format marital best12. ; format ethnic best12. ; format race___1 best12. ; format race___2 best12. ; format race___3 best12. ; format race___4 best12. ; format race___5 best12. ; format race___6 best12. ; format oracesp $500. ; format dem_demographics_complete best12. ; format hamd_hamilton_depres_v_0 best12. ; format cssrs_suicide_rating_v_1 best12. ; format scidip_psychotic_scr_v_2 best12. ; format mphx_medicalpsychiat_v_3 best12. ; format life_longitudinal_in_v_4 best12. ; input redcap_num redcap_event_name $ clinic $ id $ age asthma language imm medhx othstudy elig consent el_eligibility_complete sex dob marital ethnic race___1 race___2 race___3 data redcap; set redcap; label redcap_num='REDCap Number'; label redcap_event_name='Event Name'; label clinic='Clinical Site'; label id='Participant ID'; label age='Age< 18'; label asthma='Diagnosed with asthma'; label language='English or Spanish speaking'; label imm='Immunocompromised'; label medhx='History of diabetes or kidney disease'; label othstudy='Enrolled in another research study'; label elig='Eligibility, calculated from inclusion and exclusion criteria'; label consent='Did patient sign informed consent?'; label el_eligibility_complete='Complete?'; label sex='1. Gender'; label dob='2. Date of Birth'; label marital='3. Marital status'; label ethnic='4. Ethnicity'; label race___1='5. Race (choice=White)'; label race___2='5. Race (choice=Black)'; label race___3='5. Race (choice=Asian)'; label race___4='5. Race (choice=Native American)'; label race___5='5. Race (choice=Hawaiian or Pacific Islander)'; label race___6='5. Race (choice=Other race)'; label oracesp='5.1 Other race, specify'; label dem_demographics_complete='Complete?'; label hamd_hamilton_depres_v_0='Complete?'; label cssrs_suicide_rating_v_1='Complete?'; label scidip_psychotic_scr_v_2='Complete?'; label mphx_medicalpsychiat_v_3='Complete?'; label life_longitudinal_in_v_4='Complete?'; run; proc format; value $redcap_event_name_ eval_1_arm_1='Eval 1' eval_2_arm_1='Eval 2' eval_3_arm_1='Eval 3' week_4_arm_1='Week 4' week_8_arm_1='Week 8' week_16_arm_1='Week 16'; value $clinic_ A='(A) Farmer''s Urgicare' B='(B) Holloway Family Practice' C='(C) Patients Best Choice' D='(D) Smallville Pediatrics'; value age_ 1='Yes' 0='No'; value asthma_ 1='Yes' 0='No'; value language_ 1='Yes' 0='No'; value imm_ 1='Yes' 0='No'; value medhx_ 1='Yes' 0='No'; value othstudy_ 1='Yes' 0='No'; value consent_ 1='Yes' 0='No' REDCap SAS syntax informat redcap_num best32. ; informat redcap_event_name $500. ; informat clinic $500. ; informat id $500. ; informat age best32. ; informat race___1 best32. ; informat race___2 best32. ; informat race___3 best32. ; informat race___4 best32. ; informat race___5 best32. ; informat race___6 best32. ;
6
REDCap and SAS Reporting
%macro removeOldFile(bye); %if %sysfunc(exist(&bye.)) %then %do; proc delete data=&bye.; run; %end; %mend removeOldFile; %removeOldFile(work.redcap); data REDCAP; %let _EFIERR_ = 0; infile 'CTSIWorkshopProject_DATA_NOHDRS_ _0816.csv' delimiter = ',' MISSOVER DSD lrecl=32767 firstobs=1 ; informat redcap_num best32. ; informat redcap_event_name $500. ; informat clinic $500. ; informat id $500. ; informat age best32. ; informat asthma best32. ; informat language best32. ; informat imm best32. ; informat medhx best32. ; informat othstudy best32. ; informat elig best32. ; informat consent best32. ; informat el_eligibility_complete best32. ; informat sex best32. ; informat dob yymmdd10. ; informat marital best32. ; informat ethnic best32. ; informat race___1 best32. ; informat race___2 best32. ; informat race___3 best32. ; informat race___4 best32. ; informat race___5 best32. ; informat race___6 best32. ; informat oracesp $500. ; informat dem_demographics_complete best32. ; informat hamd_hamilton_depres_v_0 best32. ; informat cssrs_suicide_rating_v_1 best32. ; informat scidip_psychotic_scr_v_2 best32. ; informat mphx_medicalpsychiat_v_3 best32. ; informat life_longitudinal_in_v_4 best32. ; format redcap_num best12. ; format redcap_event_name $500. ; format clinic $500. ; format id $500. ; format age best12. ; format asthma best12. ; format language best12. ; format imm best12. ; format medhx best12. ; format othstudy best12. ; format elig best12. ; format consent best12. ; format el_eligibility_complete best12. ; format sex best12. ; format dob yymmdd10. ; format marital best12. ; format ethnic best12. ; format race___1 best12. ; format race___2 best12. ; format race___3 best12. ; format race___4 best12. ; format race___5 best12. ; format race___6 best12. ; format oracesp $500. ; format dem_demographics_complete best12. ; format hamd_hamilton_depres_v_0 best12. ; format cssrs_suicide_rating_v_1 best12. ; format scidip_psychotic_scr_v_2 best12. ; format mphx_medicalpsychiat_v_3 best12. ; format life_longitudinal_in_v_4 best12. ; input redcap_num redcap_event_name $ clinic $ id $ age asthma language imm medhx othstudy elig consent el_eligibility_complete sex dob marital ethnic race___1 race___2 race___3 data redcap; set redcap; label redcap_num='REDCap Number'; label redcap_event_name='Event Name'; label clinic='Clinical Site'; label id='Participant ID'; label age='Age< 18'; label asthma='Diagnosed with asthma'; label language='English or Spanish speaking'; label imm='Immunocompromised'; label medhx='History of diabetes or kidney disease'; label othstudy='Enrolled in another research study'; label elig='Eligibility, calculated from inclusion and exclusion criteria'; label consent='Did patient sign informed consent?'; label el_eligibility_complete='Complete?'; label sex='1. Gender'; label dob='2. Date of Birth'; label marital='3. Marital status'; label ethnic='4. Ethnicity'; label race___1='5. Race (choice=White)'; label race___2='5. Race (choice=Black)'; label race___3='5. Race (choice=Asian)'; label race___4='5. Race (choice=Native American)'; label race___5='5. Race (choice=Hawaiian or Pacific Islander)'; label race___6='5. Race (choice=Other race)'; label oracesp='5.1 Other race, specify'; label dem_demographics_complete='Complete?'; label hamd_hamilton_depres_v_0='Complete?'; label cssrs_suicide_rating_v_1='Complete?'; label scidip_psychotic_scr_v_2='Complete?'; label mphx_medicalpsychiat_v_3='Complete?'; label life_longitudinal_in_v_4='Complete?'; run; proc format; value $redcap_event_name_ eval_1_arm_1='Eval 1' eval_2_arm_1='Eval 2' eval_3_arm_1='Eval 3' week_4_arm_1='Week 4' week_8_arm_1='Week 8' week_16_arm_1='Week 16'; value $clinic_ A='(A) Farmer''s Urgicare' B='(B) Holloway Family Practice' C='(C) Patients Best Choice' D='(D) Smallville Pediatrics'; value age_ 1='Yes' 0='No'; value asthma_ 1='Yes' 0='No'; value language_ 1='Yes' 0='No'; value imm_ 1='Yes' 0='No'; value medhx_ 1='Yes' 0='No'; value othstudy_ 1='Yes' 0='No'; value consent_ 1='Yes' 0='No' REDCap SAS syntax informat redcap_num 8. redcap_event_name $15. clinic $12. id $10. age 8. ; informat race___1 best32. ; informat race___2 best32. ; informat race___3 best32. ; informat race___4 best32. ; informat race___5 best32. ; informat race___6 best32. ;
7
REDCap and SAS Reporting
%macro removeOldFile(bye); %if %sysfunc(exist(&bye.)) %then %do; proc delete data=&bye.; run; %end; %mend removeOldFile; %removeOldFile(work.redcap); data REDCAP; %let _EFIERR_ = 0; infile 'CTSIWorkshopProject_DATA_NOHDRS_ _0816.csv' delimiter = ',' MISSOVER DSD lrecl=32767 firstobs=1 ; informat redcap_num best32. ; informat redcap_event_name $500. ; informat clinic $500. ; informat id $500. ; informat age best32. ; informat asthma best32. ; informat language best32. ; informat imm best32. ; informat medhx best32. ; informat othstudy best32. ; informat elig best32. ; informat consent best32. ; informat el_eligibility_complete best32. ; informat sex best32. ; informat dob yymmdd10. ; informat marital best32. ; informat ethnic best32. ; informat race___1 best32. ; informat race___2 best32. ; informat race___3 best32. ; informat race___4 best32. ; informat race___5 best32. ; informat race___6 best32. ; informat oracesp $500. ; informat dem_demographics_complete best32. ; informat hamd_hamilton_depres_v_0 best32. ; informat cssrs_suicide_rating_v_1 best32. ; informat scidip_psychotic_scr_v_2 best32. ; informat mphx_medicalpsychiat_v_3 best32. ; informat life_longitudinal_in_v_4 best32. ; format redcap_num best12. ; format redcap_event_name $500. ; format clinic $500. ; format id $500. ; format age best12. ; format asthma best12. ; format language best12. ; format imm best12. ; format medhx best12. ; format othstudy best12. ; format elig best12. ; format consent best12. ; format el_eligibility_complete best12. ; format sex best12. ; format dob yymmdd10. ; format marital best12. ; format ethnic best12. ; format race___1 best12. ; format race___2 best12. ; format race___3 best12. ; format race___4 best12. ; format race___5 best12. ; format race___6 best12. ; format oracesp $500. ; format dem_demographics_complete best12. ; format hamd_hamilton_depres_v_0 best12. ; format cssrs_suicide_rating_v_1 best12. ; format scidip_psychotic_scr_v_2 best12. ; format mphx_medicalpsychiat_v_3 best12. ; format life_longitudinal_in_v_4 best12. ; input redcap_num redcap_event_name $ clinic $ id $ age asthma language imm medhx othstudy elig consent el_eligibility_complete sex dob marital ethnic race___1 race___2 race___3 data redcap; set redcap; label redcap_num='REDCap Number'; label redcap_event_name='Event Name'; label clinic='Clinical Site'; label id='Participant ID'; label age='Age< 18'; label asthma='Diagnosed with asthma'; label language='English or Spanish speaking'; label imm='Immunocompromised'; label medhx='History of diabetes or kidney disease'; label othstudy='Enrolled in another research study'; label elig='Eligibility, calculated from inclusion and exclusion criteria'; label consent='Did patient sign informed consent?'; label el_eligibility_complete='Complete?'; label sex='1. Gender'; label dob='2. Date of Birth'; label marital='3. Marital status'; label ethnic='4. Ethnicity'; label race___1='5. Race (choice=White)'; label race___2='5. Race (choice=Black)'; label race___3='5. Race (choice=Asian)'; label race___4='5. Race (choice=Native American)'; label race___5='5. Race (choice=Hawaiian or Pacific Islander)'; label race___6='5. Race (choice=Other race)'; label oracesp='5.1 Other race, specify'; label dem_demographics_complete='Complete?'; label hamd_hamilton_depres_v_0='Complete?'; label cssrs_suicide_rating_v_1='Complete?'; label scidip_psychotic_scr_v_2='Complete?'; label mphx_medicalpsychiat_v_3='Complete?'; label life_longitudinal_in_v_4='Complete?'; run; proc format; value $redcap_event_name_ eval_1_arm_1='Eval 1' eval_2_arm_1='Eval 2' eval_3_arm_1='Eval 3' week_4_arm_1='Week 4' week_8_arm_1='Week 8' week_16_arm_1='Week 16'; value $clinic_ A='(A) Farmer''s Urgicare' B='(B) Holloway Family Practice' C='(C) Patients Best Choice' D='(D) Smallville Pediatrics'; value age_ 1='Yes' 0='No'; value asthma_ 1='Yes' 0='No'; value language_ 1='Yes' 0='No'; value imm_ 1='Yes' 0='No'; value medhx_ 1='Yes' 0='No'; value othstudy_ 1='Yes' 0='No'; value consent_ 1='Yes' 0='No' REDCap SAS syntax informat redcap_num 8. redcap_event_name $15. clinic $12. id $10. age 8. ; informat white black asian amerind hawaipac other 8.;
8
REDCap and SAS Reporting
REDCap SAS syntax value sq_trblfall_ 1='No, not in the last 4 weeks' 2='Yes, less than once a week' 3='Yes, 1 or 2 times a week' 4='Yes, 3 or 4 times a week' 5='Yes, 5 or more times a week' ; value sq_wakesvrl_ value sq_wakeearl_ 3='Yes, 1 or 2 times a week‘ proc format; value sq_trblfall_ 1='No, not in the last 4 weeks' 2='Yes, less than once a week' 3='Yes, 1 or 2 times a week' 4='Yes, 3 or 4 times a week' 5='Yes, 5 or more times a week' ; value sq_wakesvrl_ value sq_wakeearl_ value sq_trblbck_
9
REDCap and SAS Reporting
REDCap SAS syntax proc format; value sq_trblfall_ 1='No, not in the last 4 weeks' 2='Yes, less than once a week' 3='Yes, 1 or 2 times a week' 4='Yes, 3 or 4 times a week' 5='Yes, 5 or more times a week' ; value sq_wakesvrl_ value sq_wakeearl_ value sq_trblbck_ value sleepfrq 1='No, not in the last 4 weeks' 2='Yes, less than once a week' 3='Yes, 1 or 2 times a week' 4='Yes, 3 or 4 times a week' 5='Yes, 5 or more times a week' ;
10
REDCap and SAS Reporting
Custom code generator: SASGEN.sas reads from data dictionary writes single informat, input, label, and format statements renames checklist vars to choice-names consolidates formats to unique set creates uniform set of SAS programs for database loading
11
REDCap and SAS/R Reporting
SAS/R operations: Combine exported data with other data laboratory results health record extractions related data from other REDCap projects
12
REDCap and SAS/R Reporting
SAS/R operations: Quality control checks confirm REDCap validations (range, etc.) complex longitudinal checks logical checks with data from other sources create reports for study personnel to make corrections in REDCap
13
REDCap and SAS/R Reporting
SAS/R operations: Administrative reporting accrual and retention reports visit and forms completeness database status - outstanding QC checks Dissemination of reports post to study website / shared server directed , e.g QC to coordinator archive reports
14
REDCap and SAS/R Reporting
Automation: Nightly batch file API + cURL export SAS import (overwrite, not append) SAS reporting - quality control - administrative reports (weekly) - dissemination driver (post or ) LogScan: to DM daily - program execution errors/warnings - all is well
15
REDCap and SAS/R Reporting
What do you do?
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.