| Title: | Direct Medical Cost Extraction and Health Economics Costing on OMOP CDM |
| Version: | 0.6.1 |
| 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. |
| License: | MIT + file LICENSE |
| Copyright: | IOMED, S.L. |
| URL: | https://www.iomed.health/, https://github.com/iomedhealth/omopHeor |
| BugReports: | https://github.com/iomedhealth/omopHeor/issues |
| Depends: | R (≥ 4.1.0) |
| Imports: | CDMConnector (≥ 1.4.0), omopgenerics (≥ 0.3.0), dbplyr (≥ 2.4.0), dplyr (≥ 1.1.0), ggplot2, rlang, cli, glue |
| Suggests: | DBI, tibble, gt, PatientProfiles (≥ 1.2.0), visOmopResults, duckdb, testthat (≥ 3.0.0), withr |
| Config/testthat/edition: | 3 |
| Config/roxygen2/version: | 8.1.0 |
| Encoding: | UTF-8 |
| NeedsCompilation: | no |
| Packaged: | 2026-08-21 11:20:23 UTC; gabriel.maeztu |
| Author: | Gabriel Maeztu [aut, cre] |
| Maintainer: | Gabriel Maeztu <gabriel@iomed.health> |
| Repository: | CRAN |
| Date/Publication: | 2026-08-30 09:00:07 UTC |
CohortCosts: 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.
Author(s)
Maintainer: Gabriel Maeztu gabriel@iomed.health
Authors:
Gabriel Maeztu gabriel@iomed.health
See Also
Useful links:
Report bugs at https://github.com/iomedhealth/omopHeor/issues
Add Direct Medical Costs to a Cohort
Description
Add Direct Medical Costs to a Cohort
Usage
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
)
Arguments
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. |
Value
The cohort table x with added direct medical cost columns.
Plot Summarised Direct Medical Costs
Description
Plot Summarised Direct Medical Costs
Usage
plotCosts(result, costColumn = "cost_total", plotType = "barplot")
Arguments
result |
A |
costColumn |
Cost column name pattern to plot. Default: |
plotType |
Visualization type: |
Value
A ggplot2 visualization object.
Summarise Direct Medical Costs for a Cohort
Description
Summarise Direct Medical Costs for a Cohort
Usage
summariseCosts(
cohort,
group = list("cohort_name"),
strata = list(),
costColumns = NULL,
estimates = c("mean", "sd", "median", "q25", "q75", "min", "max")
)
Arguments
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: |
Value
An omopgenerics::summarised_result object.
Format Summarised Direct Costs as a Table
Description
Format Summarised Direct Costs as a Table
Usage
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>"),
...
)
Arguments
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 |
Value
A formatted table object (gt_tbl, flextable, or tibble).