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).
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 inreadmission
anddaily_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 withcheck_input()
(where possible).For example, any
cohort
oripadmdad
inputs should be checked for correct type (data.frame
ordata.table
) and whether they contain agenc_id
column (and other relevant columns likeadmission_date_time
etc.). Similarly, all DB connection inputsdbcon
should be checked for correct type (see implementation of check inreadmission
).