Cleans REDCap data for the Save Access to Maternal Medicines study. Will outpuot clean data files ready for processing
- Inputs the csv from REDCap, and structures the output into an easy file for data processing
Stable Release: pip install samm_rdp
Development Head: pip install git+https://github.com/mollyblank/samm_rdp.git
To prepare the csv as input:
- Download the csv with labels from REDCap
- Replace the labels with the label row from 'INTERVENTION_interim_LABELS.csv'
- Save to a directory of choice
You must do the raw data preparation described above. Once you have the csv file ready and its file name/location, here are the steps to run this code:
from samm_rdp import process
csv_path = "Path to csv prepared raw data file"
timepoints_out_path = "Path to output timepoints file"
patients_out_path = "Path to output patients file"
process.process(csv_path=csv_path, timepoints_out_path=timepoints_out_path, patients_out_path=patients_out_path))
# This will take a little bit of time
Alternatively you can run this from the command line with:
samm_rdp \
--csv_path "D:\Dropbox (Shift Labs)\Shift Labs Team folder (1)\Grants\SLAB USAID\DATA - Study summary reports - data - analysis\Data processing\SAMM_CONTROL_HEADERS.csv" \
--timepoints_out_path "timepoints.csv" \
--patients_out_path "patients.csv"