Skip to contents

[Experimental]

Usage

tableDoseCoverage(
  result,
  header = c("variable", "estimate"),
  splitStrata = TRUE,
  ingridientName = TRUE,
  cdmName = TRUE,
  groupColumn = NULL,
  type = "gt",
  formatEstimateName = c(`N (%)` = "<count_missing> (<percentage_missing> %)", N =
    "<count>", `Mean (SD)` = "<mean> (<sd>)", `Median (Q25 - Q75)` =
    "<median> (<q25> - <q75>)"),
  .options = list()
)

Arguments

result

A summarised_result object with results from summariseDoseCoverage().

header

A vector containing which elements should go into the header in order. Allowed are: cdm_name, group, strata, variable, and estimate.

splitStrata

If TRUE strata columns will be split.

ingridientName

If TRUE cohort names will be displayed.

cdmName

If TRUE database names will be displayed.

groupColumn

Column to use as group labels.

type

Type of desired formatted table, possibilities: "gt", "flextable", "tibble".

formatEstimateName

Named list of estimate name's to join, sorted by computation order. Indicate estimate_name's between <...>.

.options

Named list with additional formatting options. DrugUtilisation::defaultTableOptions() shows allowed arguments and their default values.

Value

A table with a formatted version of summariseDrugCoverage() results.

Examples

# \donttest{
library(DrugUtilisation)

cdm <- mockDrugUtilisation()
#> Warning: ! 6 column in person do not match expected column type:
#>  `gender_concept_id` is numeric but expected integer
#>  `race_concept_id` is numeric but expected integer
#>  `ethnicity_concept_id` is numeric but expected integer
#>  `location_id` is numeric but expected integer
#>  `provider_id` is numeric but expected integer
#>  `care_site_id` is numeric but expected integer
#> Warning: ! 1 column in observation_period do not match expected column type:
#>  `period_type_concept_id` is numeric but expected integer
#> Warning: ! 2 column in visit_occurrence do not match expected column type:
#>  `visit_concept_id` is numeric but expected integer
#>  `visit_type_concept_id` is numeric but expected integer
#> Warning: ! 10 column in condition_occurrence do not match expected column type:
#>  `condition_concept_id` is numeric but expected integer
#>  `condition_type_concept_id` is numeric but expected integer
#>  `condition_status_concept_id` is numeric but expected integer
#>  `stop_reason` is logical but expected character
#>  `provider_id` is logical but expected integer
#>  `visit_occurrence_id` is logical but expected integer
#>  `visit_detail_id` is logical but expected integer
#>  `condition_source_value` is logical but expected character
#>  `condition_source_concept_id` is logical but expected integer
#>  `condition_status_source_value` is logical but expected character
#> Warning: ! 2 column in drug_exposure do not match expected column type:
#>  `drug_concept_id` is numeric but expected integer
#>  `drug_type_concept_id` is numeric but expected integer
#> Warning: ! 2 column in observation do not match expected column type:
#>  `observation_concept_id` is numeric but expected integer
#>  `observation_type_concept_id` is numeric but expected integer
#> Warning: ! 4 column in concept do not match expected column type:
#>  `concept_id` is numeric but expected integer
#>  `valid_start_date` is character but expected date
#>  `valid_end_date` is character but expected date
#>  `invalid_reason` is logical but expected character
#> Warning: ! 2 column in concept_relationship do not match expected column type:
#>  `concept_id_1` is numeric but expected integer
#>  `concept_id_2` is numeric but expected integer
#> Warning: ! 4 column in concept_ancestor do not match expected column type:
#>  `ancestor_concept_id` is numeric but expected integer
#>  `descendant_concept_id` is numeric but expected integer
#>  `min_levels_of_separation` is numeric but expected integer
#>  `max_levels_of_separation` is numeric but expected integer
#> Warning: ! 9 column in drug_strength do not match expected column type:
#>  `drug_concept_id` is numeric but expected integer
#>  `ingredient_concept_id` is numeric but expected integer
#>  `amount_unit_concept_id` is numeric but expected integer
#>  `numerator_unit_concept_id` is numeric but expected integer
#>  `denominator_unit_concept_id` is numeric but expected integer
#>  `box_size` is logical but expected integer
#>  `valid_start_date` is character but expected date
#>  `valid_end_date` is character but expected date
#>  `invalid_reason` is logical but expected character
#> Warning: ! 6 column in person do not match expected column type:
#>  `gender_concept_id` is numeric but expected integer
#>  `race_concept_id` is numeric but expected integer
#>  `ethnicity_concept_id` is numeric but expected integer
#>  `location_id` is numeric but expected integer
#>  `provider_id` is numeric but expected integer
#>  `care_site_id` is numeric but expected integer
#> Warning: ! 1 column in observation_period do not match expected column type:
#>  `period_type_concept_id` is numeric but expected integer

result <- summariseDoseCoverage(cdm, 1125315)
#>  The following estimates will be computed:
#>  daily_dose: count_missing, percentage_missing, mean, sd, q25, median, q75
#> ! Table is collected to memory as not all requested estimates are supported on
#>   the database side
#> → Start summary of data, at 2024-11-04 09:26:05.433457
#>  Summary finished, at 2024-11-04 09:26:05.724242

tableDoseCoverage(result)
#> ! Results have not been suppressed.
Variable
number records
Missing dose
daily_dose
Database name Ingredient name Unit Route Pattern id
Estimate name
N N (%) Mean (SD) Median (Q25 - Q75)
DUS MOCK acetaminophen overall overall overall 7 0 (0.00 %) 2,033.24 (3,216.97) 543.14 (91.55 - 2,614.90)
milligram overall overall 7 0 (0.00 %) 2,033.24 (3,216.97) 543.14 (91.55 - 2,614.90)
oral overall 1 0 (0.00 %) - 117.65 (117.65 - 117.65)
topical overall 6 0 (0.00 %) 2,352.51 (3,400.36) 545.01 (184.87 - 3,648.91)
oral 9 1 0 (0.00 %) - 117.65 (117.65 - 117.65)
topical 18 3 0 (0.00 %) 4,500.64 (3,869.58) 4,682.93 (2,613.03 - 6,479.39)
9 3 0 (0.00 %) 204.37 (298.37) 65.45 (33.12 - 306.16)
# }