Skip to content

Commit ac3b991

Browse files
committed
Remove REDCap XML files
1 parent 1bb49a5 commit ac3b991

File tree

4 files changed

+4
-551
lines changed

4 files changed

+4
-551
lines changed

src/request.jl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#TODO: add something to automatically break files into < 500kb chunks?
2-
#There's also a new batchProcess parameter
2+
#Wasn't there a new batchProcess parameter? I can't find any documentation
33

44
function request(; url, data=nothing, odm=nothing, kwargs)
55

@@ -46,7 +46,7 @@ function generate_request_body(; data=nothing, odm=nothing, kwargs)
4646
#and if that variable contains a file name, even by mistake, the contents of that file get sent.
4747
#but this is so convenient, and any actual issue it could cause seems far-fetched
4848
#TODO: improve this syntax?
49-
append_as_redcap_pair!(html_request_body, :data, as_redcap_data(data))
49+
append_as_redcap_pair!(html_request_body, :data, read_file_or_string(data))
5050
end
5151
return html_request_body
5252
end
@@ -67,7 +67,8 @@ function append_as_redcap_pair!(d::Dict, parameter::Symbol, value)
6767
end
6868
end
6969

70-
function as_redcap_data(data)
70+
# For convenience, certain string arguments can be either file names and direct values
71+
function read_file_or_string(data)
7172
if !istoolong(data) && isfile(data)
7273
return read(data,String)
7374
else

src/utils.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#TODO: Add conversion functions (maybe functinos can accept a sink
21
function get_token()
32
if !haskey(ENV, "REDCAP_API_TOKEN")
43
@error("No REDCap API token found")

test/data/project_files/BasicDemography.REDCap.xml

Lines changed: 0 additions & 160 deletions
This file was deleted.

0 commit comments

Comments
 (0)