bruigtp / REDCapDM

R package to perform data management of REDCap datasets in R
https://bruigtp.github.io/REDCapDM/
Other
4 stars 0 forks source link

Formats of the different data sources fetched from redcap_data are not consistent #1

Closed a-vizoso closed 1 year ago

a-vizoso commented 1 year ago

Hello,

redcap_data function seems to return a dictionary with a different format depending on the method chosen to retrieve the data from. The columns

[1] "choices_calculations_or_slider_labels" [2] "branching_logic_show_field_only_if"

that are obtained when reading data through a .csv file are not avaliable when reading through API communication. The information stored in these columns when using the API method seems to be now at the columns

[1] "select_choices_or_calculations" [2] "branching_logic"

that do not have the same name neither the same format

These differences lead to bugs in the rd_transform function at the following points of the code:

https://github.com/ubidi/REDCapDM/blob/48bcc90d6067da4262cb793f326bab0e280d388a/R/utils-transform.R#L22

https://github.com/ubidi/REDCapDM/blob/48bcc90d6067da4262cb793f326bab0e280d388a/R/utils-transform.R#L143-L146

I don't know if am I missing any functionality or there is any parameter in the rd_transformfunction that allows to indicate that the data was read from whether one data source or another. So far I have managed to get rid of the issue when fetching data from API by creating new columns with the same format. However, I would appreciate if you could change the function in order to avoid further errors.

Thanks,

Adrian

jcarmezim commented 1 year ago

Hello Adrian, Thank you for your input. We will fix it in a new package update due to be released this Friday.

Best regards, João