| Title: | Direct Medical Cost Extraction and Health Economics Costing on OMOP CDM |
|---|---|
| Description: | Links polymorphic Observational Medical Outcomes Partnership (OMOP) COST records to clinical events and tracks medical expenditures, unit cost tariffs, and healthcare price indices for OMOP Common Data Model (CDM) cohorts following DARWIN EU standards. |
| Authors: | Gabriel Maeztu [aut, cre] |
| Maintainer: | Gabriel Maeztu <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.7.3 |
| Built: | 2026-09-30 10:27:30 UTC |
| Source: | https://github.com/iomedhealth/omopheor |
Add Direct Medical Costs to a Cohort
addCosts( x, indexDate = "cohort_start_date", censorDate = NULL, window = list(c(-365, -1), c(0, 365)), costField = "total_paid", domains = c("Inpatient", "Outpatient", "Drug", "Procedure"), nameStyle = "cost_{domain}_{window_name}", name = NULL )addCosts( x, indexDate = "cohort_start_date", censorDate = NULL, window = list(c(-365, -1), c(0, 365)), costField = "total_paid", domains = c("Inpatient", "Outpatient", "Drug", "Procedure"), nameStyle = "cost_{domain}_{window_name}", name = NULL )
x |
A cohort table or cdm_table. |
indexDate |
Date variable in |
censorDate |
Optional date variable in |
window |
A named or unnamed list of 2-element numeric vectors. Default: |
costField |
Column name in |
domains |
Clinical domains to extract. Default: |
nameStyle |
Column naming pattern. Default: |
name |
Name of the new table in the write schema. If NULL, a temporary table is returned. |
The cohort table x with added direct medical cost columns.
Plot Summarised Direct Medical Costs
plotCosts(result, costColumn = "cost_total", plotType = "barplot")plotCosts(result, costColumn = "cost_total", plotType = "barplot")
result |
A |
costColumn |
Cost column name pattern to plot. Default: |
plotType |
Visualization type: |
A ggplot2 visualization object.
Summarise Direct Medical Costs for a Cohort
summariseCosts( cohort, group = list("cohort_name"), strata = list(), costColumns = NULL, estimates = c("mean", "sd", "median", "q25", "q75", "min", "max") )summariseCosts( cohort, group = list("cohort_name"), strata = list(), costColumns = NULL, estimates = c("mean", "sd", "median", "q25", "q75", "min", "max") )
cohort |
An enriched cohort table containing cost columns. |
group |
List of character vectors specifying grouping columns. Default: |
strata |
List of character vectors specifying stratification columns. Default: |
costColumns |
Character vector of cost columns to summarise. If NULL, selects all columns starting with |
estimates |
Summary estimators to compute. Default: |
An omopgenerics::summarised_result object.
Format Summarised Direct Costs as a Table
tableCosts( result, type = "gt", header = c("cdm_name", "cohort_name"), estimateName = c(N = "<count>", `Mean (SD)` = "<mean> (<sd>)", `Median (IQR)` = "<median> (<q25> - <q75>)", `Min - Max` = "<min> - <max>"), ... )tableCosts( result, type = "gt", header = c("cdm_name", "cohort_name"), estimateName = c(N = "<count>", `Mean (SD)` = "<mean> (<sd>)", `Median (IQR)` = "<median> (<q25> - <q75>)", `Min - Max` = "<min> - <max>"), ... )
result |
A |
type |
Output table format: |
header |
Character vector of columns to include in the header. Default: |
estimateName |
Named character vector mapping estimate names. |
... |
Additional arguments passed to |
A formatted table object (gt_tbl, flextable, or tibble).