# NOT RUN {
> #*** Note: I cannot provide working examples without
> #*** compromising security. Instead, I will try to
> #*** offer up sample code with the matching results
>
>
> #*** Create the connection object
> rcon <- redcapConnection(url=[YOUR_REDCAP_URL], token=[API_TOKEN])
>
>
> #*** Import a record for a new patient
> NewScan <- data.frame(patient_id = 1022,
+ redcap_event_name = "entry_arm_1",
+ bmi = 24.689,
+ patient_characteristics_complete = 1)
>
> importRecords(rcon, NewScan)
REDCap Data Import Log: 2014-06-20 16:08:31
The following (if any) conditions were noted about the data.
1
> ## No conditions were noted, 1 record was uploaded
>
>
>
>
>
> #*** Import a record for a new patient with an erroneous BMI value
> NewScan <- data.frame(patient_id = 1022,
+ redcap_event_name = "entry_arm_1",
+ bmi = 244.689,
+ patient_characteristics_complete = 4)
>
> importRecords(rcon, NewScan)
REDCap Data Import Log: 2014-06-20 16:08:33
The following (if any) conditions were noted about the data.
1022 entry_arm_1 244.689 Entry for 'bmi' is larger than
the acceptable maximum. Please confirm.
1
> ## One condition was noted. Notice that the BMI value was still
> ## uploaded to REDCap.
# }
Run the code above in your browser using DataLab