First, connect to the database.
In the DrugExposureDiagnostics package, all the diagnostics are conducted on ingredient level. We will use “acetaminophen” as an example. Here is a brief look at this ingredient.
|Concept Class ID||Ingredient|
We can run all available checks at the same time using the ´executeChecks()´ function. This will return a list which contains the results of each check.
executeChecks(cdm, ingredients = c(1125315), subsetToConceptId = NULL, checks = c("missing", "exposureDuration", "type", "route", "sourceConcept", "daysSupply", "verbatimEndDate", "dose", "sig", "quantity", "ingredientOverview", "ingredientPresence", "histogram", "diagnosticsSummary"), minCellCount = 5, sample = 10000, verbose = FALSE )
cdm is the database reference of the OMOP CDM using
ingredients is a list of ingredients of interests, by
default it is 1125315 for acetaminophen. The
subsetToConceptId is a vector of drug concept ID’s to
subset down to.
checks allows to select the checks to be
executed, by default the missing values, the exposure duration and the
quantity checks will be run.
sample is the number of samples, by default, 10.000 drug
record samples will be used.
minCellCount is minimum number of events to report,
numbers lower than this will be obscured.
We can then check what results available from ´executeChecks()´ by
Let’s take a look at the results.
contains information on the concept ids that are used in the database
for a given ingredient. So in the case of acetaminophen, the following
drugs contain the acetaminophen as an ingredient.
After running the checks, we can write the CSV files into a zip file
to disk using the