Merge branch 'master' of github.com:SpectrumHealthResearch/REDCapRITS

This commit is contained in:
Egeler, Paul W 2018-06-01 18:07:53 -04:00
commit 3bcc7f9482
3 changed files with 10 additions and 8 deletions

View File

@ -52,7 +52,7 @@ records, so no pre-processing of metadata csv is needed.
THIS LINE: THIS LINE:
```format redcap_repeat_instrument redcap_repeat_instrument_.;``` ```format redcap_repeat_instrument redcap_repeat_instrument_.;```
1. Run the RECapRITS macro definitions in the source editor or using `%include`. 1. Run the RECapRITS macro definitions in the source editor or using `%include`.
1. Run the macro call `%REDCAP_READ_DATA_DICT()` to load the data dictionry into your SAS session, pointing to the file location of your REDCap data dictionary. 1. Run the macro call `%REDCAP_READ_DATA_DICT()` to load the data dictionary into your SAS session, pointing to the file location of your REDCap data dictionary.
1. Run the macro call `%REDCAP_SPLIT()`. You will have an output dataset for 1. Run the macro call `%REDCAP_SPLIT()`. You will have an output dataset for
your main table as well as for each repeating instrument. your main table as well as for each repeating instrument.

View File

@ -4,8 +4,8 @@
#' and give individual tables for each repeating instrument. Metadata #' and give individual tables for each repeating instrument. Metadata
#' is used to determine which fields should be included in each resultant table. #' is used to determine which fields should be included in each resultant table.
#' #'
#' @param records data.frame containing the records #' @param records \code{data.frame} containing project records
#' @param metadata data.frame containing the metadata #' @param metadata \code{data.frame} containing project metadata (the data dictionary)
#' @author Paul W. Egeler, M.S., GStat #' @author Paul W. Egeler, M.S., GStat
#' @examples #' @examples
#' \dontrun{ #' \dontrun{
@ -29,9 +29,11 @@
#' returnFormat = 'json' #' returnFormat = 'json'
#' ) #' )
#' #'
#' # Convert JSON to data.frames
#' records <- fromJSON(result.record) #' records <- fromJSON(result.record)
#' metadata <- fromJSON(result.meta) #' metadata <- fromJSON(result.meta)
#' #'
#' # Split the data.frame into a list of data.frames
#' REDCap_split(records, metadata) #' REDCap_split(records, metadata)
#' } #' }
#' @return a list of data.frames #' @return a list of data.frames

View File

@ -21,13 +21,13 @@
* format redcap_repeat_instrument redcap_repeat_instrument_.; * format redcap_repeat_instrument redcap_repeat_instrument_.;
* *
* 2. Download the data dictionary for your project. * 2. Download the data dictionary for your project.
*
* 3. Run the macro definitions REDCAP_READ_DATA_DICT and REDCAP_SPLIT * 3. Run the macro definitions REDCAP_READ_DATA_DICT and REDCAP_SPLIT
* *
* 3. Run the macro call for REDCAP_READ_DATA_DICT to load in the data dictionry. * 4. Run the macro call for REDCAP_READ_DATA_DICT to load in the data dictionry.
* This is necessary to split the tables correctly. * This is necessary to split the tables correctly.
* *
* 4. Run the macro call for REDCAP_SPLIT. You will have an output dataset for * 5. Run the macro call for REDCAP_SPLIT. You will have an output dataset for
* your main table as well as for each repeating instrument. * your main table as well as for each repeating instrument.
* *
********************************************************************************/ ********************************************************************************/
@ -44,7 +44,7 @@
IF FIELD_TYPE EQ "descriptive" THEN DELETE; IF FIELD_TYPE EQ "descriptive" THEN DELETE;
DROP SECTION_HEADER X1-X14; DROP SECTION_HEADER FIELD_TYPE X1-X14;
RUN; RUN;
@ -53,7 +53,7 @@
%MACRO REDCAP_SPLIT( %MACRO REDCAP_SPLIT(
DATA_DICTIONARY = REDCAP_DATA_DICTIONARY /* The name of the SAS dataset of the data dictionary */, DATA_DICTIONARY = REDCAP_DATA_DICTIONARY /* The name of the SAS dataset of the data dictionary */,
DATA_SET = REDCAP/* The name of the SAS dataset created by REDCap */, DATA_SET = REDCAP /* The name of the SAS dataset created by REDCap */,
KEY = RECORD_ID /* Variable that links base table with other tables */ KEY = RECORD_ID /* Variable that links base table with other tables */
); );