GEMINI-Medicine / Rgemini

A custom R package that provides a variety of functions to perform data analyses with GEMINI data
https://gemini-medicine.github.io/Rgemini/
Other
3 stars 0 forks source link

Apply `check_input` in other `Rgemini` functions #56

Open loffleraSMH opened 9 months ago

loffleraSMH commented 9 months ago

We have a new utility function check_input that checks whether user-provided inputs into a given function are correct. The function is currently applied in readmission and daily_census, which can serve as examples on what/how to check user inputs. Ideally, we apply similar, relevant checks in other functions and remove any previously hard-coded checks with check_input() (where possible).

For example, any cohort or ipadmdad inputs should be checked for correct type (data.frame or data.table) and whether they contain a genc_id column (and other relevant columns like admission_date_time etc.). Similarly, all DB connection inputs dbcon should be checked for correct type (see implementation of check in readmission).