darwin-eu-dev / TreatmentPatterns

An R package to analyze treatment patterns of a study population of interest 
https://darwin-eu-dev.github.io/TreatmentPatterns/
7 stars 5 forks source link

Default parameters functions #9

Closed mvankessel-EMC closed 1 year ago

mvankessel-EMC commented 1 year ago

Describe the bug Not really a bug, but a lot, if not all functions have defaults for their parameters. This suggests that the functions can be run as is, even though this is not true at all.

To Reproduce Documentation:

createDataSettings(
  OMOP_CDM = "TRUE",
  connectionDetails = NULL,
  cdmDatabaseSchema = NULL,
  cohortDatabaseSchema = NULL,
  cohortTable = "treatmentpatterns_cohorts",
  cohortLocation = NULL
)
TreatmentPatterns::createDataSettings()
Error in `checkIfDbmsIsSupported()`:
! DBMS '' not supported. Please use one of these values: 'oracle', 'hive', 'postgresql', 'redshift', 'sql server', 'pdw', 'netezza', 'impala', 'bigquery', 'sqlite', 'sqlite extended', 'spark', 'hive'
Run `rlang::last_error()` to see where the error occurred.

Expected behavior Because of the default parameters, the documentation suggests the function can be run as is. However the following parameters are minimally required:

createDataSettings(
  connectionDetails = Eunomia::getEunomiaConnectionDetails(),
  cdmDatabaseSchema = "main",
  cohortDatabaseSchema = "main")
mvankessel-EMC commented 1 year ago

Done with Function Review #72