install.packages("DrugUtilisation")
Conduct Drug Utilisation Studies in OMOP CDM
2025-06-26
Drug utilisation studies (DUS) were defined by the World Health Organization as studying the marketing, distribution, prescription, and use of medicinal products in a society, with special emphasis on the resulting medical and socioeconomic consequences (WHO, 2003).
This package aims to standardise and provide the tools to conduct Drug Utilisation studies as of the Darwin-EU Catalogue of Standard Analytics.
install.packages("DrugUtilisation")
For this example we are going to use a synthetic test database:
library(omock)
library(duckdb)
library(CDMConnector)
library(dplyr)
library(CodelistGenerator)
library(DrugUtilisation)
library(CohortConstructor)
cdm <- mockCdmFromDataset(datasetName = "synthea-covid19-10k")
cdm$drug_exposure <- cdm$drug_exposure |>
mutate(quantity = sample(c(0, 1, 5, 10, 30, 100), size = dplyr::n(), replace = TRUE))
con <- dbConnect(drv = duckdb())
src <- dbSource(con = con, writeSchema = "main")
cdm <- insertCdmTo(cdm = cdm, to = src)
For this example we are going to use all records of acteaminophen
:
codelist <- getDrugIngredientCodes(cdm = cdm, name = "acetaminophen", nameStyle = "{concept_name}")
cdm$dus_cohort <- conceptCohort(
cdm = cdm,
name = "dus_cohort",
conceptSet = codelist
)
The results is the cdm object with the new cohort instantiated.
cdm
── # OMOP CDM reference (duckdb) of synthea-covid19-10k ────────────────────────────────────────────────────────────────
• omop tables: person, observation_period, visit_occurrence, visit_detail, condition_occurrence, drug_exposure,
procedure_occurrence, device_exposure, measurement, observation, death, note, note_nlp, specimen, fact_relationship,
location, care_site, provider, payer_plan_period, cost, drug_era, dose_era, condition_era, metadata, cdm_source,
concept, vocabulary, domain, concept_class, concept_relationship, relationship, concept_synonym, concept_ancestor,
source_to_concept_map, drug_strength, cohort_definition, attribute_definition
• cohort tables: dus_cohort
• achilles tables: -
• other tables: cohort_count, cohort_set, cohort
The cohort objects have some attributes:
class(cdm$dus_cohort)
[1] "cohort_table" "GeneratedCohortSet" "cdm_table" "tbl_duckdb_connection"
[5] "tbl_dbi" "tbl_sql" "tbl_lazy" "tbl"
names(attributes(cdm$dus_cohort))
[1] "names" "class" "tbl_source" "tbl_name" "cohort_set" "cohort_attrition"
[7] "cohort_codelist" "cdm_reference"
Settings:
settings(cdm$dus_cohort)
# A tibble: 1 × 4
cohort_definition_id cohort_name cdm_version vocabulary_version
<int> <chr> <chr> <chr>
1 1 acetaminophen 5.3 v5.0 22-JUN-22
Cohort counts:
cohortCount(cdm$dus_cohort)
# A tibble: 1 × 3
cohort_definition_id number_records number_subjects
<int> <int> <int>
1 1 2600 595
Cohort attrition:
attrition(cdm$dus_cohort)
# A tibble: 6 × 7
cohort_definition_id number_records number_subjects reason_id reason excluded_records excluded_subjects
<int> <int> <int> <int> <chr> <int> <int>
1 1 2645 595 1 Initial qualifying e… 0 0
2 1 2645 595 2 Record start <= reco… 0 0
3 1 2645 595 3 Record in observation 0 0
4 1 2645 595 4 Non-missing sex 0 0
5 1 2645 595 5 Non-missing year of … 0 0
6 1 2600 595 6 Merge overlapping re… 45 0
Cohort codelist:
cohortCodelist(cdm$dus_cohort, cohortId = 1)
- acetaminophen (25747 codes)
gapEra
parameter can be used to concatenate different records.
Number of days between two continuous exposures to be considered in the same era. Records that have fewer days between them than this gap will be concatenated into the same cohort record.
cdm$dus_cohort <- cdm$dus_cohort |>
collapseCohorts(gap = 30)
Let’s check the settings again:
settings(cdm$dus_cohort)
# A tibble: 1 × 4
cohort_definition_id cohort_name cdm_version vocabulary_version
<int> <chr> <chr> <chr>
1 1 acetaminophen 5.3 v5.0 22-JUN-22
Four functions to add inclusion criteria to our cohort:
requirePriorDrugWashout()
(requireConceptIntersect
)requireIsFirstDrugEntry()
(requireIsFirstEntry
)requireObservationBeforeDrug()
(requirePriorObservation
)requireDrugInDateRange()
(requireInDateRange
)Not all inclusion criteria are commutable operations (A + B != B + A):
Not commutable:
prior washout
+ prior observation
!= prior observation
+ prior washout
prior washout
+ first
!= first
+ prior washout
prior washout
+ date range
!= date range
+ prior washout
first
+ prior observation
!= prior observation
+ first
first
+ date range
!= date range
+ first
Commutable:
date range
+ prior observation
== prior observation
+ date range
Having all this into account the recommended order to apply criteria would be:
Require a prior drug washout or require first drug entry (particular case).
Require a prior observation before the drug episode.
Require the drugs to be in a certain date range.
https://darwin-eu-dev.github.io/DrugUtilisation/articles/create_cohorts.html
Can you create a cohort with all the records of ‘simvastatin’ concatenating records separated by 90 days or less and the following inclusion criteria:
First record ever
At least 365 days of prior observation
Cohort start date between ‘2010-01-01’ and ‘2021-12-31’.
# A tibble: 1 × 3
cohort_definition_id number_records number_subjects
<int> <int> <int>
1 1 366 366
codelist <- getDrugIngredientCodes(cdm = cdm, name = "simvastatin")
cdm$simvastatin_cohort <- conceptCohort(
cdm = cdm,
conceptSet = codelist,
name = "simvastatin_cohort"
) |>
collapseCohorts(gap = 90) |>
requireIsFirstEntry() |>
requirePriorObservation(minPriorObservation = 365) |>
requireInDateRange(dateRange = as.Date(c('2010-01-01', '2021-12-31')))
cohortCount(cdm$simvastatin_cohort)
# A tibble: 1 × 3
cohort_definition_id number_records number_subjects
<int> <int> <int>
1 1 366 366
result <- cdm$dus_cohort |>
summariseDrugUtilisation(
ingredientConceptId = 1361711,
conceptSet = codelist,
indexDate = "cohort_start_date",
censorDate = "cohort_end_date",
restrictIncident = TRUE,
gapEra = 30,
numberExposures = TRUE,
numberEras = TRUE,
daysExposed = TRUE,
daysPrescribed = TRUE,
timeToExposure = FALSE,
initialQuantity = TRUE,
cumulativeQuantity = TRUE,
initialDailyDose = TRUE,
cumulativeDose = TRUE,
estimates = c("q25", "median", "q75")
)
result |>
suppress(minCellCount = 5) |>
tableDrugUtilisation()
Concept set | Variable name | Estimate name |
CDM name
|
---|---|---|---|
synthea-covid19-10k | |||
acetaminophen | |||
overall | number records | N | 609 |
number subjects | N | 595 | |
36567_simvastatin | number exposures | Median (Q25 - Q75) | 0 (0 - 0) |
cumulative quantity | Median (Q25 - Q75) | 0.00 (0.00 - 0.00) | |
initial quantity | Median (Q25 - Q75) | 0.00 (0.00 - 0.00) | |
initial exposure duration | Median (Q25 - Q75) | 1 (1 - 1) | |
number eras | Median (Q25 - Q75) | 0 (0 - 0) | |
days exposed | Median (Q25 - Q75) | 0 (0 - 0) | |
days prescribed | Median (Q25 - Q75) | 0 (0 - 0) |
To summarise mutually exclusive indications.
Define a window respect to the ‘cohort_start_date’.
Indications must be instantiated beforehand as cohorts.
Unknown indication (check a table to see if there is a record).
Let’s instantiate the cohorts of interest:
cdm$indications <- conceptCohort(
cdm = cdm,
conceptSet = list(
arteriosclerosis = 317576,
myocardial_infarction = 4329847,
pain = getCandidateCodes(cdm = cdm, keywords = "pain")$concept_id
),
name = "indications"
)
result <- cdm$dus_cohort |>
summariseIndication(
indicationCohortName = "indications",
indicationWindow = list(c(0, 0), c(-30, 7)),
unknownIndicationTable = "condition_occurrence"
)
result |>
glimpse()
Rows: 40
Columns: 13
$ result_id <int> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, …
$ cdm_name <chr> "synthea-covid19-10k", "synthea-covid19-10k", "synthea-covid19-10k", "synthea-covid19-10k", "…
$ group_name <chr> "cohort_name", "cohort_name", "cohort_name", "cohort_name", "cohort_name", "cohort_name", "co…
$ group_level <chr> "acetaminophen", "acetaminophen", "acetaminophen", "acetaminophen", "acetaminophen", "acetami…
$ strata_name <chr> "overall", "overall", "overall", "overall", "overall", "overall", "overall", "overall", "over…
$ strata_level <chr> "overall", "overall", "overall", "overall", "overall", "overall", "overall", "overall", "over…
$ variable_name <chr> "Indication on index date", "Indication on index date", "Indication on index date", "Indicati…
$ variable_level <chr> "arteriosclerosis", "arteriosclerosis", "myocardial_infarction", "myocardial_infarction", "pa…
$ estimate_name <chr> "count", "percentage", "count", "percentage", "count", "percentage", "count", "percentage", "…
$ estimate_type <chr> "integer", "percentage", "integer", "percentage", "integer", "percentage", "integer", "percen…
$ estimate_value <chr> "0", "0", "408", "66.9950738916256", "60", "9.85221674876847", "2", "0.328407224958949", "0",…
$ additional_name <chr> "window_name", "window_name", "window_name", "window_name", "window_name", "window_name", "wi…
$ additional_level <chr> "0 to 0", "0 to 0", "0 to 0", "0 to 0", "0 to 0", "0 to 0", "0 to 0", "0 to 0", "0 to 0", "0 …
result |>
suppress() |>
tableIndication()
CDM name
|
||
---|---|---|
synthea-covid19-10k
|
||
Indication | Estimate name |
Cohort name
|
acetaminophen | ||
Indication on index date | ||
arteriosclerosis | N (%) | 0 (0.00 %) |
myocardial_infarction | N (%) | 408 (67.00 %) |
pain | N (%) | 60 (9.85 %) |
arteriosclerosis and myocardial_infarction | N (%) | <5 |
arteriosclerosis and pain | N (%) | 0 (0.00 %) |
myocardial_infarction and pain | N (%) | 0 (0.00 %) |
arteriosclerosis and myocardial_infarction and pain | N (%) | 0 (0.00 %) |
unknown | N (%) | 104 (17.08 %) |
none | N (%) | 35 (5.75 %) |
not in observation | N (%) | 0 (0.00 %) |
Indication from 30 days before to 7 days after the index date | ||
arteriosclerosis | N (%) | 0 (0.00 %) |
myocardial_infarction | N (%) | 413 (67.82 %) |
pain | N (%) | 63 (10.34 %) |
arteriosclerosis and myocardial_infarction | N (%) | <5 |
arteriosclerosis and pain | N (%) | 0 (0.00 %) |
myocardial_infarction and pain | N (%) | 0 (0.00 %) |
arteriosclerosis and myocardial_infarction and pain | N (%) | 0 (0.00 %) |
unknown | N (%) | 101 (16.58 %) |
none | N (%) | 30 (4.93 %) |
not in observation | N (%) | 0 (0.00 %) |
plotIndication(result)
Output of ploting functions are ggplot2 objects.
plotIndication(result) +
ggplot2::theme(legend.position = "none")
Currently considering to add support for plotly.
plotIndication(result) |>
plotly::ggplotly()
To analyse treatment persistence and adherence there are two standard pipelines:
Survival analysis (implemented in the CohortSurvival package)
Proportion of patients covered
Proportion of treated individuals between index date and followUpDays
. Percentages will be reported daily.
result <- cdm$dus_cohort |>
summariseProportionOfPatientsCovered(followUpDays = 90)
tableProportionOfPatientsCovered(result)
Time | Estimate name |
Cohort name
|
---|---|---|
acetaminophen | ||
synthea-covid19-10k | ||
0 | PPC (95%CI) | 100.00% [99.36% - 100.00%] |
1 | PPC (95%CI) | 27.61% [24.17% - 31.34%] |
2 | PPC (95%CI) | 27.61% [24.17% - 31.34%] |
3 | PPC (95%CI) | 27.61% [24.17% - 31.34%] |
4 | PPC (95%CI) | 27.61% [24.17% - 31.34%] |
5 | PPC (95%CI) | 27.61% [24.17% - 31.34%] |
6 | PPC (95%CI) | 26.94% [23.53% - 30.64%] |
7 | PPC (95%CI) | 26.60% [23.20% - 30.29%] |
8 | PPC (95%CI) | 74.76% [68.48% - 80.16%] |
9 | PPC (95%CI) | 74.64% [68.33% - 80.06%] |
10 | PPC (95%CI) | 66.83% [60.17% - 72.87%] |
11 | PPC (95%CI) | 53.85% [47.06% - 60.49%] |
12 | PPC (95%CI) | 44.23% [37.65% - 51.02%] |
13 | PPC (95%CI) | 31.88% [25.92% - 38.51%] |
14 | PPC (95%CI) | 22.33% [17.18% - 28.49%] |
15 | PPC (95%CI) | 14.15% [10.03% - 19.58%] |
16 | PPC (95%CI) | 11.27% [7.63% - 16.35%] |
17 | PPC (95%CI) | 10.34% [6.87% - 15.30%] |
18 | PPC (95%CI) | 6.44% [3.80% - 10.70%] |
19 | PPC (95%CI) | 2.49% [1.07% - 5.69%] |
20 | PPC (95%CI) | 2.54% [1.09% - 5.80%] |
21 | PPC (95%CI) | 1.02% [0.28% - 3.64%] |
22 | PPC (95%CI) | 0.51% [0.09% - 2.85%] |
23 | PPC (95%CI) | 0.00% [0.00% - 1.94%] |
24 | PPC (95%CI) | 0.00% [0.00% - 1.97%] |
25 | PPC (95%CI) | 0.00% [0.00% - 2.01%] |
26 | PPC (95%CI) | 0.00% [0.00% - 2.06%] |
27 | PPC (95%CI) | 0.00% [0.00% - 2.09%] |
28 | PPC (95%CI) | 0.00% [0.00% - 2.12%] |
29 | PPC (95%CI) | 0.00% [0.00% - 2.17%] |
30 | PPC (95%CI) | 0.00% [0.00% - 2.24%] |
31 | PPC (95%CI) | 0.00% [0.00% - 2.25%] |
32 | PPC (95%CI) | 0.00% [0.00% - 2.30%] |
33 | PPC (95%CI) | 0.00% [0.00% - 2.32%] |
34 | PPC (95%CI) | 0.00% [0.00% - 2.33%] |
35 | PPC (95%CI) | 0.00% [0.00% - 2.33%] |
36 | PPC (95%CI) | 0.00% [0.00% - 2.36%] |
37 | PPC (95%CI) | 0.00% [0.00% - 2.36%] |
38 | PPC (95%CI) | 0.00% [0.00% - 2.36%] |
39 | PPC (95%CI) | 0.00% [0.00% - 2.36%] |
40 | PPC (95%CI) | 0.00% [0.00% - 2.36%] |
41 | PPC (95%CI) | 0.00% [0.00% - 2.36%] |
42 | PPC (95%CI) | 0.00% [0.00% - 2.36%] |
43 | PPC (95%CI) | 0.00% [0.00% - 2.37%] |
44 | PPC (95%CI) | 0.00% [0.00% - 2.37%] |
45 | PPC (95%CI) | 0.00% [0.00% - 2.37%] |
46 | PPC (95%CI) | 0.00% [0.00% - 2.37%] |
47 | PPC (95%CI) | 0.00% [0.00% - 2.37%] |
48 | PPC (95%CI) | 0.00% [0.00% - 2.37%] |
49 | PPC (95%CI) | 0.00% [0.00% - 2.37%] |
50 | PPC (95%CI) | 0.00% [0.00% - 2.37%] |
51 | PPC (95%CI) | 0.00% [0.00% - 2.37%] |
52 | PPC (95%CI) | 0.00% [0.00% - 2.37%] |
53 | PPC (95%CI) | 0.00% [0.00% - 2.37%] |
54 | PPC (95%CI) | 0.00% [0.00% - 2.37%] |
55 | PPC (95%CI) | 0.00% [0.00% - 2.37%] |
56 | PPC (95%CI) | 0.00% [0.00% - 2.37%] |
57 | PPC (95%CI) | 0.00% [0.00% - 2.39%] |
58 | PPC (95%CI) | 0.00% [0.00% - 2.39%] |
59 | PPC (95%CI) | 0.00% [0.00% - 2.39%] |
60 | PPC (95%CI) | 0.00% [0.00% - 2.40%] |
61 | PPC (95%CI) | 0.00% [0.00% - 2.40%] |
62 | PPC (95%CI) | 0.00% [0.00% - 2.40%] |
63 | PPC (95%CI) | 0.00% [0.00% - 2.40%] |
64 | PPC (95%CI) | 0.00% [0.00% - 2.42%] |
65 | PPC (95%CI) | 0.00% [0.00% - 2.42%] |
66 | PPC (95%CI) | 0.00% [0.00% - 2.42%] |
67 | PPC (95%CI) | 0.00% [0.00% - 2.42%] |
68 | PPC (95%CI) | 0.00% [0.00% - 2.42%] |
69 | PPC (95%CI) | 0.00% [0.00% - 2.42%] |
70 | PPC (95%CI) | 0.00% [0.00% - 2.42%] |
71 | PPC (95%CI) | 0.00% [0.00% - 2.42%] |
72 | PPC (95%CI) | 0.00% [0.00% - 2.42%] |
73 | PPC (95%CI) | 0.00% [0.00% - 2.42%] |
74 | PPC (95%CI) | 0.00% [0.00% - 2.42%] |
75 | PPC (95%CI) | 0.00% [0.00% - 2.42%] |
76 | PPC (95%CI) | 0.00% [0.00% - 2.42%] |
77 | PPC (95%CI) | 0.00% [0.00% - 2.42%] |
78 | PPC (95%CI) | 0.00% [0.00% - 2.42%] |
79 | PPC (95%CI) | 0.00% [0.00% - 2.42%] |
80 | PPC (95%CI) | 0.00% [0.00% - 2.42%] |
81 | PPC (95%CI) | 0.00% [0.00% - 2.43%] |
82 | PPC (95%CI) | 0.00% [0.00% - 2.43%] |
83 | PPC (95%CI) | 0.00% [0.00% - 2.43%] |
84 | PPC (95%CI) | 0.00% [0.00% - 2.43%] |
85 | PPC (95%CI) | 0.00% [0.00% - 2.43%] |
86 | PPC (95%CI) | 0.00% [0.00% - 2.43%] |
87 | PPC (95%CI) | 0.00% [0.00% - 2.43%] |
88 | PPC (95%CI) | 0.00% [0.00% - 2.43%] |
89 | PPC (95%CI) | 0.00% [0.00% - 2.43%] |
90 | PPC (95%CI) | 0.00% [0.00% - 2.43%] |
plotProportionOfPatientsCovered(result)
gapEra
parameter can have a big impact in survival analysis, whereas it does not have such big impact on proportion of patients covered.
Can you create a cohort of a certain ingredient and analyse its persistence in the following year?
suggestions: ‘clopidogrel’, ‘nitroglycerin’, ‘simvastatin’, ‘amlodipine’, ‘verapamil’ are the 5 most common ingredients in this database
codelist <- getDrugIngredientCodes(
cdm = cdm,
name = c('clopidogrel', 'nitroglycerin', 'simvastatin', 'amlodipine', 'verapamil')
)
cdm$persistence <- conceptCohort(
cdm = cdm,
name = "persistence",
conceptSet = codelist
)
result <- summariseProportionOfPatientsCovered(cohort = cdm$persistence, followUpDays = 365)
plotProportionOfPatientsCovered(result = result, colour = "cohort_name")
We have the ability to study drug restart or drug switching after a discontinuation:
Switching cohorts must be defined in advance.
We have to define the windows of interest.
Index date will be the date of discontinuation.
Reported percentages in each window will be:
Restart: individuals that restarted and not switched.
Switch: individuals that switched and not restarted.
Restart and switch: individuals that restarted and switched.
Untreated: individuals that did not restart or switch.
Let’s define the cohorts of interest for switching:
codelist <- getDrugIngredientCodes(
cdm = cdm,
name = c("clopidogrel", "simvastatin", "warfarin")
)
cdm$switch <- conceptCohort(
cdm = cdm,
name = "switch",
conceptSet = codelist
)
We have to be careful with the inclusion criteria of the input cohort, as restart is derived from it.
result <- cdm$dus_cohort |>
summariseDrugRestart(
switchCohortTable = "switch",
followUpDays = c(90, 180, 270, 360),
restrictToFirstDiscontinuation = TRUE
)
result |>
glimpse()
Rows: 32
Columns: 13
$ result_id <int> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
$ cdm_name <chr> "synthea-covid19-10k", "synthea-covid19-10k", "synthea-covid19-10k", "synthea-covid19-10k", "…
$ group_name <chr> "cohort_name", "cohort_name", "cohort_name", "cohort_name", "cohort_name", "cohort_name", "co…
$ group_level <chr> "acetaminophen", "acetaminophen", "acetaminophen", "acetaminophen", "acetaminophen", "acetami…
$ strata_name <chr> "overall", "overall", "overall", "overall", "overall", "overall", "overall", "overall", "over…
$ strata_level <chr> "overall", "overall", "overall", "overall", "overall", "overall", "overall", "overall", "over…
$ variable_name <chr> "Drug restart in 90 days", "Drug restart in 90 days", "Drug restart in 90 days", "Drug restar…
$ variable_level <chr> "restart", "restart", "switch", "switch", "restart and switch", "restart and switch", "untrea…
$ estimate_name <chr> "count", "percentage", "count", "percentage", "count", "percentage", "count", "percentage", "…
$ estimate_type <chr> "integer", "percentage", "integer", "percentage", "integer", "percentage", "integer", "percen…
$ estimate_value <chr> "0", "0", "43", "7.22689075630252", "0", "0", "552", "92.7731092436975", "0", "0", "51", "8.5…
$ additional_name <chr> "follow_up_days", "follow_up_days", "follow_up_days", "follow_up_days", "follow_up_days", "fo…
$ additional_level <chr> "90 days", "90 days", "90 days", "90 days", "90 days", "90 days", "90 days", "90 days", "180 …
tableDrugRestart(result)
CDM name
|
||
---|---|---|
synthea-covid19-10k
|
||
Treatment | Estimate name |
Cohort name
|
acetaminophen | ||
Drug restart in 90 days | ||
restart | N (%) | 0 (0.00 %) |
switch | N (%) | 43 (7.23 %) |
restart and switch | N (%) | 0 (0.00 %) |
untreated | N (%) | 552 (92.77 %) |
Drug restart in 180 days | ||
restart | N (%) | 0 (0.00 %) |
switch | N (%) | 51 (8.57 %) |
restart and switch | N (%) | 0 (0.00 %) |
untreated | N (%) | 544 (91.43 %) |
Drug restart in 270 days | ||
restart | N (%) | 0 (0.00 %) |
switch | N (%) | 59 (9.92 %) |
restart and switch | N (%) | 1 (0.17 %) |
untreated | N (%) | 535 (89.92 %) |
Drug restart in 360 days | ||
restart | N (%) | 0 (0.00 %) |
switch | N (%) | 65 (10.92 %) |
restart and switch | N (%) | 3 (0.50 %) |
untreated | N (%) | 527 (88.57 %) |
plotDrugRestart(result)
summariseTreatment()
is a general function to analyse presence of treatments (cohorts) after an index date. This can be used with many different purposes:
Summarise treatments after a certain condition
Analyse comedications
Analyse treatments after discontinuation
…
You have to instantiate the treatments that you are interested in a cohort:
codelist <- getDrugIngredientCodes(
cdm = cdm,
name = c("clopidogrel", "simvastatin", "warfarin", "nitroglycerin")
)
cdm$treatments <- conceptCohort(
cdm = cdm,
name = "treatments",
conceptSet = codelist
)
result <- cdm$dus_cohort |>
summariseTreatment(
window = list(c(1, 90), c(91, 180), c(181, 270), c(271, 360)),
treatmentCohortName = "treatments",
indexDate = "cohort_end_date",
censorDate = NULL
)
result |>
glimpse()
Rows: 48
Columns: 13
$ result_id <int> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, …
$ cdm_name <chr> "synthea-covid19-10k", "synthea-covid19-10k", "synthea-covid19-10k", "synthea-covid19-10k", "…
$ group_name <chr> "cohort_name", "cohort_name", "cohort_name", "cohort_name", "cohort_name", "cohort_name", "co…
$ group_level <chr> "acetaminophen", "acetaminophen", "acetaminophen", "acetaminophen", "acetaminophen", "acetami…
$ strata_name <chr> "overall", "overall", "overall", "overall", "overall", "overall", "overall", "overall", "over…
$ strata_level <chr> "overall", "overall", "overall", "overall", "overall", "overall", "overall", "overall", "over…
$ variable_name <chr> "Medication from 1 day after to 90 days after the index date", "Medication from 1 day after t…
$ variable_level <chr> "11289_warfarin", "11289_warfarin", "32968_clopidogrel", "32968_clopidogrel", "36567_simvasta…
$ estimate_name <chr> "count", "percentage", "count", "percentage", "count", "percentage", "count", "percentage", "…
$ estimate_type <chr> "integer", "percentage", "integer", "percentage", "integer", "percentage", "integer", "percen…
$ estimate_value <chr> "0", "0", "19", "3.11986863711002", "1", "0.164203612479475", "18", "2.95566502463054", "586"…
$ additional_name <chr> "window_name", "window_name", "window_name", "window_name", "window_name", "window_name", "wi…
$ additional_level <chr> "1 to 90", "1 to 90", "1 to 90", "1 to 90", "1 to 90", "1 to 90", "1 to 90", "1 to 90", "1 to…
tableTreatment(result)
CDM name
|
||
---|---|---|
synthea-covid19-10k
|
||
Treatment | Estimate name |
Cohort name
|
acetaminophen | ||
Medication from 1 day after to 90 days after the index date | ||
11289_warfarin | N (%) | 0 (0.00 %) |
32968_clopidogrel | N (%) | 19 (3.12 %) |
36567_simvastatin | N (%) | 1 (0.16 %) |
4917_nitroglycerin | N (%) | 18 (2.96 %) |
untreated | N (%) | 586 (96.22 %) |
not in observation | N (%) | 4 (0.66 %) |
Medication from 91 days after to 180 days after the index date | ||
11289_warfarin | N (%) | 1 (0.16 %) |
32968_clopidogrel | N (%) | 13 (2.13 %) |
36567_simvastatin | N (%) | 0 (0.00 %) |
4917_nitroglycerin | N (%) | 11 (1.81 %) |
untreated | N (%) | 142 (23.32 %) |
not in observation | N (%) | 452 (74.22 %) |
Medication from 181 days after to 270 days after the index date | ||
11289_warfarin | N (%) | 0 (0.00 %) |
32968_clopidogrel | N (%) | 20 (3.28 %) |
36567_simvastatin | N (%) | 1 (0.16 %) |
4917_nitroglycerin | N (%) | 20 (3.28 %) |
untreated | N (%) | 133 (21.84 %) |
not in observation | N (%) | 454 (74.55 %) |
Medication from 271 days after to 360 days after the index date | ||
11289_warfarin | N (%) | 0 (0.00 %) |
32968_clopidogrel | N (%) | 18 (2.96 %) |
36567_simvastatin | N (%) | 0 (0.00 %) |
4917_nitroglycerin | N (%) | 17 (2.79 %) |
untreated | N (%) | 131 (21.51 %) |
not in observation | N (%) | 458 (75.21 %) |
plotTreatment(result)