diff --git a/R/callback-itm.R b/R/callback-itm.R index 89bd1abe..941470b7 100644 --- a/R/callback-itm.R +++ b/R/callback-itm.R @@ -43,6 +43,25 @@ mimic_sampling <- function(x, val_var, aux_time, ...) { set(x, j = val_var, value = !is.na(x[[val_var]])) } +picdb_sampling <- function(x, val_var, aux_time, ...) { + x <- combine_date_time(x, aux_time, hours(12L)) + + # These identifiers indicate that the culture showed no growth + # of the respective organism + no_growth_identifiers <- c('MIC1008', 'MIC2123', 'MIC2287', 'MIC2291', 'MIC2293', + 'MIC2370', 'MIC2408', 'MIC2421', 'MIC575', + 'MIC585', 'MIC593', 'MIC629', 'MIC631', + 'MIC635', 'MIC637', 'MIC645', 'MIC648', + 'MIC874', 'MIC941', 'MIC979' + ) + + # Assign: + # - 0 if NA or in no_growth_identifiers + # - 1 otherwise, indicating growth + bool_value <- !is.na(x[[val_var]]) & !(x[[val_var]] %in% no_growth_identifiers) + set(x, j = val_var, value = bool_value) +} + #' Item callback utilities #' #' For concept loading, item callback functions are used in order to handle @@ -610,18 +629,24 @@ aumc_rate_units <- function(mcg_to_units) { } sic_dur <- function (x, val_var, stop_var, grp_var = NULL, ...) { - calc_dur(x, val_var, index_var(x), stop_var, grp_var) } -sic_rate_kg <- function (x, val_var, stop_var, env, ...) { - - res <- add_weight(x, env, "weight") - wgh_var <- "weight" - res[, c(val_var) := get(val_var) * 10^3 / get(wgh_var)] - expand(res, index_var(x), stop_var, keep_vars = c(id_vars(x), val_var)) +sic_rate_kg <- function(x, val_var, unit_var, stop_var, env, ...) { + + g_to_mcg <- convert_unit(binary_op(`*`, 1000000), "mcg", "g") + + res <- g_to_mcg(x, val_var, unit_var) + res <- add_weight(res, env, "weight") + + res <- res[, c(val_var) := get(val_var) / get("weight")] + res <- res[, c(unit_var) := paste(get(unit_var), "min", sep = "/kg/")] + + expand(res, index_var(x), stop_var, + keep_vars = c(id_vars(x), val_var, unit_var)) } + eicu_duration <- function(gap_length) { assert_that(is_interval(gap_length), is_scalar(gap_length)) @@ -643,6 +668,15 @@ aumc_dur <- function(x, val_var, stop_var, grp_var, ...) { calc_dur(x, val_var, index_var(x), stop_var, grp_var) } +default_duration <- function(x, val_var, stop_var, grp_var, ...) { + calc_dur(x, val_var, index_var(x), stop_var, grp_var) +} + +no_duration <- function(x, val_var, grp_var, ...) { + calc_dur(x, val_var, index_var(x), index_var(x), grp_var) +} + + #' Used for determining vasopressor durations, `calc_dur()` will calculate #' durations by taking either per ID or per combination of ID and `grp_var` #' the minimum for `min_var` and the maximum of `max_var` and returning the @@ -759,6 +793,13 @@ aumc_death <- function(x, val_var, ...) { x } +sic_death <- function(x, val_var, adm_time, ...) { + idx <- index_var(x) + + x <- x[, c(val_var) := is_true(get(idx) - (get(adm_time) + secs(get(val_var))) < hours(72L))] + x +} + aumc_bxs <- function(x, val_var, dir_var, ...) { x <- x[get(dir_var) == "-", c(val_var) := -1L * get(val_var)] x diff --git a/R/callback-tbl.R b/R/callback-tbl.R new file mode 100644 index 00000000..6088230b --- /dev/null +++ b/R/callback-tbl.R @@ -0,0 +1,36 @@ + +sic_data_float_h <- function(dat, ...) { + + hexstring_to_float <- function(x) { + if (is.na(x)) { + return(NA_real_) + } + hexstring <- substring(x, seq(1, 482, 2), seq(2, 482, 2)) + bytes <- as.raw(strtoi(hexstring[-1], base = 16)) + floats <- readBin(bytes, numeric(), length(bytes) %/% 4, 4, endian = "little") + ifelse(floats == 0, NA_real_, floats) + } + + setDT(dat) + + # TODO: remove hard coding of rawdata and derive from JSON config + dat[, c("rawdata") := lapply(get("rawdata"), hexstring_to_float)] + dat <- dat[, .( + Offset = Offset + 60 * (0:(sapply(rawdata, length)-1)), + Val = Val, + cnt = cnt, + rawdata = unlist(rawdata), + rawdata_present = !is.na(rawdata) + ), + by = .(id, CaseID, DataID) + ] + + # Fix measurements that only have one value + dat[rawdata_present == FALSE, rawdata := Val] + dat[, rawdata_present := NULL] + + return(dat) + +} + + diff --git a/R/concept-utils.R b/R/concept-utils.R index 47f7d96b..734ff707 100644 --- a/R/concept-utils.R +++ b/R/concept-utils.R @@ -199,6 +199,30 @@ get_hirid_ids <- function(x, ids) { load_id("variables", x, .data$id %in% .env$ids, cols = "unit", id_var = "id") } +#' @rdname data_items +#' @export +init_itm.sic_itm <- function(x, table, sub_var, ids, + callback = "identity_callback", ...) { + + assert_that(is.string(table), has_length(ids), + is.character(ids) || is_intish(ids)) + + x[["table"]] <- table + + units <- get_sic_ids(x, ids) + units <- rename_cols(rm_na(units), sub_var, "referenceglobalid") + + todo <- c("ids", "units") + x[todo] <- mget(todo) + + complete_tbl_itm(x, callback, sub_var, ...) +} + +get_sic_ids <- function(x, ids) { + load_id("d_references", x, .data$referenceglobalid %in% .env$ids, cols = "referenceunit", id_var = "referenceglobalid") +} + + #' @param unit_val String valued unit to be used in case no `unit_var` is #' available for the given table #' @@ -330,6 +354,10 @@ prepare_query.sel_itm <- prep_sel #' @export prepare_query.hrd_itm <- prep_sel +#' @keywords internal +#' @export +prepare_query.sic_itm <- prep_sel + #' @keywords internal #' @export prepare_query.rgx_itm <- function(x) { @@ -546,6 +574,28 @@ do_callback.hrd_itm <- function(x, ...) { NextMethod() } +#' @keywords internal + #' @export + do_callback.sic_itm <- function(x, ...) { + # TODO: generalise and combine with do_callback.hrd_itm + if (is.null(get_itm_var(x, "unit_var"))) { + x <- try_add_vars(x, unit_var = "referenceunit") + } + + NextMethod() +} + +#' @keywords internal +#' @export +do_callback.sic_itm <- function(x, ...) { + # TODO: generalise and combine with do_callback.hrd_itm + if (is.null(get_itm_var(x, "unit_var"))) { + x <- try_add_vars(x, unit_var = "referenceunit") + } + + NextMethod() +} + #' @keywords internal #' @export do_callback.col_itm <- function(x, ...) { @@ -604,6 +654,19 @@ do_itm_load.hrd_itm <- function(x, id_type = "icustay", interval = hours(1L)) { res } +#' @export +do_itm_load.sic_itm <- function(x, id_type = "icustay", interval = hours(1L)) { + + res <- NextMethod() + + if (is.null(get_itm_var(x, "unit_var"))) { + unt <- x[["units"]] + res <- merge(res, unt, by = get_itm_var(x, "sub_var"), all.x = TRUE) + } + + res +} + #' @export do_itm_load.col_itm <- function(x, id_type = "icustay", interval = hours(1L)) { diff --git a/R/config-utils.R b/R/config-utils.R index ca9e6a49..4b036943 100644 --- a/R/config-utils.R +++ b/R/config-utils.R @@ -386,6 +386,34 @@ partition_col <- function(x, orig_names = FALSE) { col } +tbl_callback <- function(x){ + x <- as_tbl_cfg(x) + assert_that(length(x) == 1L) + + if (!("callback" %in% vctrs::fields(x))) { + return(identity_callback) + } + + callback_field <- vctrs::field(x, "callback") + if (is.character(callback_field)) { + msg_ricu(paste("[tbl_callback] Using callback function: ", callback_field)) + return(str_to_fun(callback_field)) + } + + if (!is.null(callback_field) && !is.list(callback_field)) { + return(identity_callback) + } + + callback_value <- callback_field[[1]] + if (is.character(callback_value)) { + msg_ricu(paste("[tbl_callback] Using callback function: ", callback_value)) + return(str_to_fun(callback_value)) + } + + return(identity_callback) + } + + #' @export n_tick.tbl_cfg <- function(x) { diff --git a/R/data-load.R b/R/data-load.R index 80b57ee4..113b32dc 100644 --- a/R/data-load.R +++ b/R/data-load.R @@ -178,6 +178,17 @@ load_difftime.sic_tbl <- function(x, rows, cols = colnames(x), load_eiau(x, {{ rows }}, cols, id_hint, time_vars, sec_as_mins) } +#' @rdname load_src +#' @export +# copy-pasted from mimic_tbl +load_difftime.picdb_tbl <- function(x, rows, cols = colnames(x), + id_hint = id_vars(x), + time_vars = ricu::time_vars(x), ...) { + + warn_dots(...) + load_mihi(x, {{ rows }}, cols, id_hint, time_vars) +} + #' @rdname load_src #' @export load_difftime.character <- function(x, src, ...) { diff --git a/R/data-utils.R b/R/data-utils.R index 0d2b73cc..d3941c0f 100644 --- a/R/data-utils.R +++ b/R/data-utils.R @@ -128,6 +128,28 @@ id_orig_helper.miiv_env <- function(x, id) { as_id_tbl(res, id, by_ref = TRUE) } +#' @rdname data_utils +#' @export +id_orig_helper.sic_env <- function(x, id) { + + if (!identical(id, "patientid")) { + return(NextMethod()) + } + + cfg <- as_id_cfg(x)[id == id_var_opts(x)] + + assert_that(length(cfg) == 1L) + + sta <- field(cfg, "start") + age <- "admissionyear" + + res <- as_src_tbl(x, field(cfg, "table")) + res <- res[, c(id, sta, age)] + res <- res[, c(sta, age) := shift_year(get(sta), get(age))] + + as_id_tbl(res, id, by_ref = TRUE) +} + #' @export id_orig_helper.default <- function(x, ...) stop_generic(x, .Generic) @@ -228,33 +250,32 @@ id_win_helper.eicu_env <- function(x) { order_rename(res, ids, sta, end) } -#' @rdname data_utils -#' @export -id_win_helper.sic_env <- function(x) { - - sec_as_mins <- function(x) min_as_mins(as.integer(x / 60)) - + + #' @rdname data_utils + #' @export + id_win_helper.sic_env <- function(x) { cfg <- sort(as_id_cfg(x), decreasing = TRUE) - + ids <- field(cfg, "id") - sta <- c(unique(field(cfg, "start")), "HospAdmTime") + sta <- field(cfg, "start") end <- field(cfg, "end") - + tbl <- as_src_tbl(x, unique(field(cfg, "table"))) - + mis <- setdiff(sta, colnames(tbl)) - + res <- load_src(tbl, cols = c(ids, intersect(sta, colnames(tbl)), end)) - - if (length(mis) > 0L) { - res[, c(mis) := 0L] - } - - res <- res[, c(sta, end) := lapply(.SD, sec_as_mins), .SDcols = c(sta, end)] + + assert_that(length(mis) == 1L) + res[, firstadmission := 0L] + + res <- res[, c(sta, end) := lapply(.SD, s_as_mins), .SDcols = c(sta, end)] + res[, timeofstay := offsetafterfirstadmission + timeofstay] + res <- setcolorder(res, c(ids, sta, end)) res <- rename_cols(res, c(ids, paste0(ids, "_start"), paste0(ids, "_end")), by_ref = TRUE) - + as_id_tbl(res, ids[2L], by_ref = TRUE) } @@ -361,6 +382,35 @@ id_win_helper.miiv_env <- function(x) { order_rename(res, ids, sta, end) } +#' @rdname data_utils +#' @export +# copy-pasted from mimic +id_win_helper.picdb_env <- function(x) { + + merge_inter <- function(x, y) { + merge(x, y, by = intersect(colnames(x), colnames(y))) + } + + get_id_tbl <- function(tbl, id, start, end, aux) { + as_src_tbl(x, tbl)[, c(id, start, end, aux)] + } + + cfg <- sort(as_id_cfg(x), decreasing = TRUE) + + ids <- field(cfg, "id") + sta <- field(cfg, "start") + end <- field(cfg, "end") + + res <- Map(get_id_tbl, field(cfg, "table"), ids, sta, + end, c(as.list(ids[-1L]), list(NULL))) + res <- Reduce(merge_inter, res) + + res <- res[, c(sta, end) := lapply(.SD, as_dt_min, get(sta[1L])), + .SDcols = c(sta, end)] + + order_rename(res, ids, sta, end) +} + #' @export id_win_helper.default <- function(x) stop_generic(x, .Generic) diff --git a/R/setup-import.R b/R/setup-import.R index 0d2e536d..ab6388ec 100644 --- a/R/setup-import.R +++ b/R/setup-import.R @@ -184,6 +184,8 @@ import_tbl.tbl_cfg <- function(x, data_dir = src_data_dir(x), progress = NULL, assert_that(is.dir(data_dir), is.flag(cleanup)) + msg_ricu(paste("[import_tbl] Import table ", tbl_name(x))) + msg_ricu(paste("[import_tbl] Number of parts: ", n_part(x))) if (n_part(x) > 1L) { partition_table(x, data_dir, progress, ...) } else { @@ -218,8 +220,8 @@ merge_fst_chunks <- function(src, targ, new, old, sort_col, prog, nme, tick) { fst::write_fst(dat, new_file, compress = 100L) - progress_tick(paste(nme, "part", part_no), prog, - coalesce(tick, floor(nrow(dat) / 2))) + # progress_tick(paste(nme, "part", part_no), prog, + # coalesce(tick, floor(nrow(dat) / 2))) invisible(NULL) } @@ -227,7 +229,7 @@ merge_fst_chunks <- function(src, targ, new, old, sort_col, prog, nme, tick) { split_write <- function(x, part_fun, dir, chunk_no, prog, nme, tick) { n_row <- nrow(x) - + x <- split(x, part_fun(x)) tmp_nme <- file.path(dir, paste0("part_", names(x)), @@ -238,16 +240,21 @@ split_write <- function(x, part_fun, dir, chunk_no, prog, nme, tick) { Map(fst::write_fst, x, tmp_nme) - progress_tick(paste(nme, "chunk", chunk_no), prog, - coalesce(tick, floor(n_row / 2))) + # progress_tick(paste(nme, "chunk", chunk_no), prog, + # coalesce(tick, floor(n_row / 2))) invisible(NULL) } -partition_table <- function(x, dir, progress = NULL, chunk_length = 10 ^ 7, +partition_table <- function(x, dir, progress = NULL, chunk_length = 10 ^ 7, tempdir = NULL, ...) { - tempdir <- ensure_dirs(tempfile()) + # tempdir <- ensure_dirs(tempfile()) + if (is.null(tempdir)) { + # tempdir <- ensure_dirs(file.path(dir, "tempdir")) + tempdir <- ensure_dirs(tempfile()) + } + msg_ricu(paste("[partition_table] tempdir: ", tempdir)) on.exit(unlink(tempdir, recursive = TRUE)) spec <- col_spec(x) @@ -257,6 +264,8 @@ partition_table <- function(x, dir, progress = NULL, chunk_length = 10 ^ 7, file <- file.path(dir, rawf) name <- tbl_name(x) + callback <- tbl_callback(x) + exp_row <- n_row(x) if (is.na(exp_row)) { @@ -267,17 +276,18 @@ partition_table <- function(x, dir, progress = NULL, chunk_length = 10 ^ 7, if (length(file) == 1L) { - callback <- function(x, pos, ...) { - report_problems(x, rawf) - split_write(x, pfun, tempdir, ((pos - 1L) / chunk_length) + 1L, - progress, name, tick) - } + process_chunk <- function(x, pos, ...) { + report_problems(x, rawf) + split_write(callback(x), pfun, tempdir, ((pos - 1L) / chunk_length) + 1L, + progress, name, tick) + } if (grepl("\\.gz$", file)) { + msg_ricu(paste("[partition_table] gunzip: ", file)) file <- gunzip(file, tempdir) } - readr::read_csv_chunked(file, callback, chunk_length, col_types = spec, + readr::read_csv_chunked(file, process_chunk, chunk_length, col_types = spec, progress = FALSE, ...) if (is.na(exp_row)) { @@ -287,11 +297,9 @@ partition_table <- function(x, dir, progress = NULL, chunk_length = 10 ^ 7, } else { for (i in seq_along(file)) { - dat <- readr::read_csv(file[i], col_types = spec, progress = FALSE, ...) report_problems(dat, rawf[i]) - - split_write(dat, pfun, tempdir, i, progress, name, tick) + split_write(callback(data), pfun, tempdir, i, progress, name, tick) } } @@ -350,11 +358,12 @@ gunzip <- function(file, exdir) { return(dest) } -csv_to_fst <- function(x, dir, progress = NULL, ...) { +csv_to_fst <- function(x, dir, progress = NULL, tempdir = NULL, ...) { raw <- raw_file_name(x) src <- file.path(dir, raw) dst <- file.path(dir, fst_file_name(x)) + callback <- tbl_callback(x) assert_that(length(x) == 1L, length(src) == 1L, length(dst) == 1L) @@ -364,6 +373,7 @@ csv_to_fst <- function(x, dir, progress = NULL, ...) { report_problems(dat, raw) + dat <- callback(dat) dat <- rename_cols(setDT(dat), ricu_cols(x), orig_cols(x)) fst::write_fst(dat, dst, compress = 100L) @@ -421,25 +431,3 @@ report_problems <- function(x, file) { invisible(NULL) } - -report_problems <- function(x, file) { - - prob_to_str <- function(x) { - paste0("[", x[1L], ", ", x[2L], "]: got '", x[4L], "' instead of ", x[3L]) - } - - probs <- readr::problems(x) - - if (nrow(probs)) { - - probs <- bullet(apply(probs, 1L, prob_to_str)) - - warn_ricu( - c("Encountered parsing problems for file {basename(file)}:", probs), - class = "csv_parsing_error", indent = c(0L, rep_along(2L, probs)), - exdent = c(0L, rep_along(2L, probs)) - ) - } - - invisible(NULL) -} diff --git a/R/utils-file.R b/R/utils-file.R index 18c49cba..e83393a1 100644 --- a/R/utils-file.R +++ b/R/utils-file.R @@ -193,7 +193,7 @@ auto_attach_srcs <- function() { res <- sys_env("RICU_SRC_LOAD", unset = NA_character_) if (is.na(res)) { - c("mimic", "mimic_demo", "eicu", "eicu_demo", "hirid", "aumc", "miiv", "sic") + c("mimic", "mimic_demo", "eicu", "eicu_demo", "hirid", "aumc", "miiv", "sic", "picdb") } else { strsplit(res, ",")[[1L]] } diff --git a/R/utils-misc.R b/R/utils-misc.R index 0a708290..18481bb9 100644 --- a/R/utils-misc.R +++ b/R/utils-misc.R @@ -244,6 +244,8 @@ cat_line <- function(...) { ms_as_mins <- function(x) min_as_mins(as.integer(x / 6e4)) +s_as_mins <- function(x) min_as_mins(as.integer(x / 60)) + min_as_mins <- function(x) as.difftime(x, units = "mins") digest_lst <- function(x) as.character(openssl::md5(serialize(x, NULL))) diff --git a/environment.yaml b/environment.yaml new file mode 100644 index 00000000..f8cb700d --- /dev/null +++ b/environment.yaml @@ -0,0 +1,21 @@ +name: ricu +channels: + - nodefaults + - conda-forge +dependencies: + - r-base + - r-data.table + - r-curl + - r-assertthat + - r-fst + - r-readr + - r-jsonlite + - r-prt>=0.1.2 + - r-tibble + - r-backports + - r-rlang + - r-vctrs + - r-cli>=2.1.0 + - r-fansi + - r-openssl + - r-utils \ No newline at end of file diff --git a/inst/extdata/config/concept-dict.R b/inst/extdata/config/concept-dict.R deleted file mode 100644 index 5a51be41..00000000 --- a/inst/extdata/config/concept-dict.R +++ /dev/null @@ -1,3275 +0,0 @@ - -strip_ws <- function(x) gsub("\\s+", " ", x) - -cfg <- list( - hr = list( - unit = c("bpm", "/min"), - min = 0, - max = 300, - description = "heart rate", - omopid = 4239408L, - category = "vitals", - sources = list( - mimic = list( - list(ids = c(211L, 220045L), table = "chartevents", sub_var = "itemid") - ), - eicu = list( - list(table = "vitalperiodic", val_var = "heartrate", - class = "col_itm") - ), - hirid = list( - list(ids = 200L, table = "observations", sub_var = "variableid", - class = "hrd_itm") - ), - aumc = list( - list(ids = 6640L, table = "numericitems", sub_var = "itemid") - ), - miiv = list( - list(ids = 220045L, table = "chartevents", sub_var = "itemid") - ), - sic = list( - list(ids = 708L, table = "data_float_h", sub_var = "DataID") - ) - ) - ), - sbp = list( - unit = c("mmHg", "mm Hg"), - min = 0, - max = 300, - description = "systolic blood pressure", - omopid = 4152194L, - category = "vitals", - sources = list( - mimic = list( - list(ids = c(51L, 455L, 6701L, 220050L, 220179L), - table = "chartevents", sub_var = "itemid") - ), - eicu = list( - list(table = "vitalperiodic", val_var = "systemicsystolic", - class = "col_itm") - ), - hirid = list( - list(ids = 100L, table = "observations", sub_var = "variableid", - class = "hrd_itm") - ), - aumc = list( - list(ids = 6641L, table = "numericitems", sub_var = "itemid") - ), - miiv = list( - list(ids = c(220050L, 220179L), table = "chartevents", - sub_var = "itemid") - ), - sic = list( - list(ids = c(701L, 704L), table = "data_float_h", sub_var = "DataID") - ) - ) - ), - dbp = list( - unit = c("mmHg", "mm Hg"), - min = 0, - max = 200, - description = "diastolic blood pressure", - omopid = 4154790L, - category = "vitals", - sources = list( - mimic = list( - list(ids = c(8368L, 8441L, 8555L, 220051L, 220180L), - table = "chartevents", sub_var = "itemid") - ), - eicu = list( - list(table = "vitalperiodic", val_var = "systemicdiastolic", - class = "col_itm") - ), - hirid = list( - list(ids = 120L, table = "observations", sub_var = "variableid", - class = "hrd_itm") - ), - aumc = list( - list(ids = 6643L, table = "numericitems", sub_var = "itemid") - ), - miiv = list( - list(ids = c(220051L, 220180L), table = "chartevents", - sub_var = "itemid") - ), - sic = list( - list(ids = c(702L, 705L), table = "data_float_h", sub_var = "DataID") - ) - ) - ), - map = list( - unit = c("mmHg", "mm Hg"), - min = 0, - max = 250, - description = "mean arterial pressure", - omopid = 4239021L, - category = "vitals", - sources = list( - mimic = list( - list(ids = c(52L, 443L, 456L, 6072L, 220052L, 220181L, 225312L), - table = "chartevents", sub_var = "itemid") - ), - eicu = list( - list(table = "vitalperiodic", val_var = "systemicmean", - class = "col_itm"), - list(table = "vitalaperiodic", val_var = "noninvasivemean", - class = "col_itm") - ), - hirid = list( - list(ids = c(110L, 610L), table = "observations", - sub_var = "variableid", class = "hrd_itm") - ), - aumc = list( - list(ids = 6642L, table = "numericitems", sub_var = "itemid") - ), - miiv = list( - list(ids = c(220052L, 220181L, 225312L), table = "chartevents", - sub_var = "itemid") - ), - sic = list( - list(ids = c(703L, 706L), table = "data_float_h", sub_var = "DataID") - ) - ) - ), - resp = list( - unit = c("insp/min", "/min"), - min = 0, - max = 120, - description = "respiratory rate", - omopid = 4313591L, - category = "respiratory", - sources = list( - mimic = list( - list(ids = c(618L, 619L, 220210L, 224688L, 224689L, 224690L), - table = "chartevents", sub_var = "itemid") - ), - eicu = list( - list(table = "vitalperiodic", val_var = "respiration", - class = "col_itm") - ), - hirid = list( - list(ids = c(300L, 310L), table = "observations", - sub_var = "variableid", class = "hrd_itm") - ), - aumc = list( - list(ids = c(8874L, 12266L), table = "numericitems", - sub_var = "itemid") - ), - miiv = list( - list(ids = c(220210L, 224688L, 224689L, 224690L), - table = "chartevents", sub_var = "itemid") - ), - sic = list( - list(ids = 719L, table = "data_float_h", sub_var = "DataID") - ) - ) - ), - o2sat = list( - unit = c("%", "% Sat."), - min = 50, - max = 100, - description = "oxygen saturation", - omopid = 40483579L, - category = "respiratory", - sources = list( - mimic = list( - list(ids = c(646L, 220277L, 226253L, 50817L), table = "chartevents", - sub_var = "itemid") - ), - eicu = list( - list(table = "vitalperiodic", val_var = "sao2", unit_val = "%", - class = "col_itm"), - list(ids = "O2 Sat (%)", table = "lab", sub_var = "labname") - ), - hirid = list( - list(ids = c(4000L, 8280L, 20000800L), table = "observations", - sub_var = "variableid", class = "hrd_itm") - ), - aumc = list( - list(ids = c(6709L, 8903L), table = "numericitems", - sub_var = "itemid"), - list(ids = 12311L, table = "numericitems", sub_var = "itemid", - callback = "transform_fun(binary_op(`*`, 100))") - ), - miiv = list( - list(ids = c(220277L, 226253L, 50817L), table = "chartevents", - sub_var = "itemid") - ), - sic = list( - list(ids = 710L, table = "data_float_h", sub_var = "DataID") - ) - ) - ), - fio2 = list( - unit = "%", - min = 21, - max = 100, - description = "fraction of inspired oxygen", - omopid = 4353936L, - category = "blood gas", - sources = list( - mimic = list( - list(ids = c(3420L, 223835L), table = "chartevents", - sub_var = "itemid"), - list(ids = 50816L, table = "labevents", sub_var = "itemid") - ), - eicu = list( - list(ids = "FiO2", table = "respiratorycharting", - sub_var = "respchartvaluelabel", - callback = "transform_fun(percent_as_numeric)"), - list(ids = "FiO2", table = "lab", sub_var = "labname", - callback = "convert_unit(set_val(NA), '%', 'mm\\\\(hg\\\\)')") - ), - hirid = list( - list(ids = 2010L, table = "observations", sub_var = "variableid", - class = "hrd_itm") - ), - aumc = list( - list(ids = 12279L, table = "numericitems", sub_var = "itemid") - ), - miiv = list( - list(ids = 223835L, table = "chartevents", sub_var = "itemid"), - list(ids = 50816L, table = "labevents", sub_var = "itemid") - ), - sic = list( - list(ids = 2283L, table = "data_float_h", sub_var = "DataID") - ) - ) - ), - tco2 = list( - unit = "mEq/L", - min = 5, - max = 60, - description = "totcal CO2", - omopid = 4193415L, - category = "blood gas", - sources = list( - mimic = list( - list(ids = 50804L, table = "labevents", sub_var = "itemid") - ), - eicu = list( - list(ids = "Total CO2", table = "lab", sub_var = "labname", - callback = "convert_unit(set_val(NA), 'mEq/L', 'lpm')") - ), - miiv = list( - list(ids = 50804L, table = "labevents", sub_var = "itemid") - ) - ) - ), - alt = list( - unit = c("IU/L", "U/l"), - min = 0, - description = "alanine aminotransferase", - omopid = 4146380L, - category = "chemistry", - sources = list( - mimic = list( - list(ids = 50861L, table = "labevents", sub_var = "itemid") - ), - eicu = list( - list(ids = "ALT (SGPT)", table = "lab", sub_var = "labname") - ), - hirid = list( - list(ids = 20002600L, table = "observations", sub_var = "variableid", - class = "hrd_itm") - ), - aumc = list( - list(ids = c(6800L, 11978L), table = "numericitems", - sub_var = "itemid") - ), - miiv = list( - list(ids = 50861L, table = "labevents", sub_var = "itemid") - ), - sic = list( - list(ids = 617L, table = "laboratory", sub_var = "LaboratoryID") - ) - ) - ), - ast = list( - unit = c("IU/L", "U/l"), - min = 0, - description = "aspartate aminotransferase", - omopid = 4263457L, - category = "chemistry", - sources = list( - mimic = list( - list(ids = 50878L, table = "labevents", sub_var = "itemid") - ), - eicu = list( - list(ids = "AST (SGOT)", table = "lab", sub_var = "labname") - ), - hirid = list( - list(ids = 24000330L, table = "observations", sub_var = "variableid", - class = "hrd_itm") - ), - aumc = list( - list(ids = c(6806L, 11990L), table = "numericitems", - sub_var = "itemid") - ), - miiv = list( - list(ids = 50878L, table = "labevents", sub_var = "itemid") - ), - sic = list( - list(ids = 616L, table = "laboratory", sub_var = "LaboratoryID") - ) - ) - ), - phos = list( - unit = "mg/dL", - min = 0, - max = 40, - description = "phosphate", - omopid = 4017907L, - category = "chemistry", - sources = list( - mimic = list( - list(ids = 50970L, table = "labevents", sub_var = "itemid") - ), - eicu = list( - list(ids = "phosphate", table = "lab", sub_var = "labname") - ), - hirid = list( - list(ids = 20002500L, table = "observations", sub_var = "variableid", - callback = "convert_unit(binary_op(`*`, 3.097521), 'mg/dL')", - class = "hrd_itm") - ), - aumc = list( - list(ids = c(6828L, 9935L), table = "numericitems", - sub_var = "itemid", - callback = "convert_unit(binary_op(`*`, 3.097521), 'mg/dL')") - ), - miiv = list( - list(ids = 50970L, table = "labevents", sub_var = "itemid") - ), - sic = list( - list(ids = 471L, table = "laboratory", sub_var = "LaboratoryID", - callback = "transform_fun(binary_op(`*`, 3.097521))") - ) - ) - ), - bun = list( - unit = "mg/dL", - min = 0, - max = 200, - description = "blood urea nitrogen", - omopid = 4017361L, - category = "chemistry", - sources = list( - mimic = list( - list(ids = 51006L, table = "labevents", sub_var = "itemid") - ), - eicu = list( - list(ids = "BUN", table = "lab", sub_var = "labname") - ), - hirid = list( - list(ids = 20004100L, table = "observations", sub_var = "variableid", - callback = "convert_unit(binary_op(`*`, 2.8), 'mg/dL')", - class = "hrd_itm") - ), - aumc = list( - list(ids = c(6850L, 9943L), table = "numericitems", - sub_var = "itemid", - callback = "convert_unit(binary_op(`*`, 2.8), 'mg/dL')") - ), - miiv = list( - list(ids = 51006L, table = "labevents", sub_var = "itemid") - ), - sic = list( - list(ids = 355L, table = "laboratory", sub_var = "LaboratoryID", - callback = "transform_fun(binary_op(`*`, 2.14))") - ) - ) - ), - ph = list( - min = 6.8, - max = 8, - description = "pH of blood", - omopid = 4097822L, - category = "blood gas", - sources = list( - mimic = list( - list(ids = 50820L, table = "labevents", sub_var = "itemid") - ), - eicu = list( - list(ids = "pH", table = "lab", sub_var = "labname") - ), - hirid = list( - list(ids = 20000300L, table = "observations", sub_var = "variableid", - class = "hrd_itm") - ), - aumc = list( - list(ids = c(6848L, 12310L), table = "numericitems", - sub_var = "itemid") - ), - miiv = list( - list(ids = 50820L, table = "labevents", sub_var = "itemid") - ), - sic = list( - list(ids = 688L, table = "laboratory", sub_var = "LaboratoryID") - ) - ) - ), - bili = list( - unit = "mg/dL", - min = 0, - max = 100, - description = "total bilirubin", - omopid = 4118986L, - category = "chemistry", - sources = list( - mimic = list( - list(ids = 50885L, table = "labevents", sub_var = "itemid") - ), - eicu = list( - list(ids = "total bilirubin", table = "lab", sub_var = "labname") - ), - hirid = list( - list(ids = 20004300L, table = "observations", sub_var = "variableid", - callback = "convert_unit(binary_op(`*`, 0.058467), 'mg/dL')", - class = "hrd_itm") - ), - aumc = list( - list(ids = c(6813L, 9945L), table = "numericitems", - sub_var = "itemid", - callback = "convert_unit(binary_op(`*`, 0.058467), 'mg/dL')") - ), - miiv = list( - list(ids = 50885L, table = "labevents", sub_var = "itemid") - ), - sic = list( - list(ids = 333L, table = "laboratory", sub_var = "LaboratoryID") - ) - ) - ), - inr_pt = list( - description = "prothrombin time/international normalized ratio", - omopid = 4306239L, - category = "hematology", - sources = list( - mimic = list( - list(ids = 51237L, table = "labevents", sub_var = "itemid") - ), - eicu = list( - list(ids = "PT - INR", table = "lab", sub_var = "labname") - ), - hirid = list( - list(ids = 24000567L, table = "observations", sub_var = "variableid", - class = "hrd_itm") - ), - aumc = list( - list(ids = 11893L, table = "numericitems", sub_var = "itemid") - ), - miiv = list( - list(ids = 51237L, table = "labevents", sub_var = "itemid") - ) - ) - ), - plt = list( - unit = c("K/uL", "G/l"), - min = 5, - max = 1200, - description = "platelet count", - omopid = 4267147L, - category = "hematology", - sources = list( - mimic = list( - list(ids = 51265L, table = "labevents", sub_var = "itemid") - ), - eicu = list( - list(ids = "platelets x 1000", table = "lab", sub_var = "labname") - ), - hirid = list( - list(ids = 20000110L, table = "observations", sub_var = "variableid", - class = "hrd_itm") - ), - aumc = list( - list(ids = c(6797L, 9964L, 10409L, 14252L), table = "numericitems", - sub_var = "itemid") - ), - miiv = list( - list(ids = 51265L, table = "labevents", sub_var = "itemid") - ), - sic = list( - list(ids = 314L, table = "laboratory", sub_var = "LaboratoryID") - ) - ) - ), - lact = list( - unit = "mmol/L", - min = 0, - max = 50, - description = "lactate", - omopid = 4191725L, - category = "blood gas", - sources = list( - mimic = list( - list(ids = 50813L, table = "labevents", sub_var = "itemid") - ), - eicu = list( - list(ids = "lactate", table = "lab", sub_var = "labname") - ), - hirid = list( - list(ids = 24000524L, table = "observations", sub_var = "variableid", - class = "hrd_itm") - ), - aumc = list( - list(ids = c(6837L, 9580L, 10053L), table = "numericitems", - sub_var = "itemid") - ), - miiv = list( - list(ids = 50813L, table = "labevents", sub_var = "itemid") - ), - sic = list( - list(ids = c(657L, 454L), table = "laboratory", sub_var = "LaboratoryID") - ) - ) - ), - lymph = list( - unit = "%", - min = 0, - max = 100, - description = "lymphocytes", - omopid = 4254663L, - category = "hematology", - sources = list( - mimic = list( - list(ids = 51244L, table = "labevents", sub_var = "itemid") - ), - eicu = list( - list(ids = "-lymphs", table = "lab", sub_var = "labname") - ), - hirid = list( - list(ids = 24000480L, table = "observations", sub_var = "variableid", - callback = "blood_cell_ratio", class = "hrd_itm") - ), - aumc = list( - list(ids = 11846L, table = "numericitems", sub_var = "itemid"), - list(ids = 14258L, table = "numericitems", sub_var = "itemid", - callback = "blood_cell_ratio") - ), - miiv = list( - list(ids = 51244L, table = "labevents", sub_var = "itemid") - ), - sic = list( - list(ids = 223L, table = "laboratory", sub_var = "LaboratoryID") - ) - ) - ), - bicar = list( - unit = c("mEq/L", "mmol/l"), - min = 5, - max = 50, - description = "bicarbonate", - omopid = 4194291L, - category = "chemistry", - sources = list( - mimic = list( - list(ids = 50882L, table = "labevents", sub_var = "itemid") - ), - eicu = list( - list(ids = "bicarbonate", table = "lab", sub_var = "labname") - ), - hirid = list( - list(ids = 20004200L, table = "observations", sub_var = "variableid", - class = "hrd_itm") - ), - aumc = list( - list(ids = c(6810L, 9992L), table = "numericitems", - sub_var = "itemid") - ), - miiv = list( - list(ids = 50882L, table = "labevents", sub_var = "itemid") - ), - sic = list( - list(ids = 456L, table = "laboratory", sub_var = "LaboratoryID") - ) - ) - ), - crea = list( - unit = "mg/dL", - min = 0, - max = 15, - description = "creatinine", - omopid = 4013964L, - category = "chemistry", - sources = list( - mimic = list( - list(ids = 50912L, table = "labevents", sub_var = "itemid") - ), - eicu = list( - list(ids = "creatinine", table = "lab", sub_var = "labname") - ), - hirid = list( - list(ids = 20000600L, table = "observations", sub_var = "variableid", - callback = "convert_unit(binary_op(`*`, 0.011312), 'mg/dL')", - class = "hrd_itm") - ), - aumc = list( - list(ids = c(6836L, 9941L, 14216L), table = "numericitems", - sub_var = "itemid", - callback = "convert_unit(binary_op(`*`, 0.011309), 'mg/dL')") - ), - miiv = list( - list(ids = 50912L, table = "labevents", sub_var = "itemid") - ), - sic = list( - list(ids = 367L, table = "laboratory", sub_var = "LaboratoryID") - ) - ) - ), - pt = list( - unit = "sec", - min = 0, - description = "prothrombine time", - omopid = 4245261L, - category = "hematology", - sources = list( - mimic = list( - list(ids = 51274L, table = "labevents", sub_var = "itemid") - ), - eicu = list( - list(ids = "PT", table = "lab", sub_var = "labname") - ), - aumc = list( - list(ids = 6789L, table = "numericitems", sub_var = "itemid") - ), - miiv = list( - list(ids = 51274L, table = "labevents", sub_var = "itemid") - ), - sic = list( - list(ids = 598L, table = "laboratory", sub_var = "LaboratoryID") - ) - ) - ), - rdw = list( - unit = "%", - min = 0, - max = 100, - description = "erythrocyte distribution width", - omopid = 4281085L, - category = "hematology", - sources = list( - mimic = list( - list(ids = 51277L, table = "labevents", sub_var = "itemid") - ), - eicu = list( - list(ids = "RDW", table = "lab", sub_var = "labname") - ), - aumc = list( - list(ids = 18952L, table = "numericitems", sub_var = "itemid") - ), - miiv = list( - list(ids = 51277L, table = "labevents", sub_var = "itemid") - ), - sic = list( - list(ids = 3319L, table = "laboratory", sub_var = "LaboratoryID") - ) - ) - ), - alp = list( - unit = c("IU/L", "U/l"), - min = 0, - description = "alkaline phosphatase", - omopid = 4275206L, - category = "chemistry", - sources = list( - mimic = list( - list(ids = 50863L, table = "labevents", sub_var = "itemid") - ), - eicu = list( - list(ids = "alkaline phos.", table = "lab", sub_var = "labname") - ), - hirid = list( - list(ids = 20002700L, table = "observations", sub_var = "variableid", - class = "hrd_itm") - ), - aumc = list( - list(ids = c(6803L, 11984L), table = "numericitems", - sub_var = "itemid") - ), - miiv = list( - list(ids = 50863L, table = "labevents", sub_var = "itemid") - ), - sic = list( - list(ids = 609L, table = "laboratory", sub_var = "LaboratoryID") - ) - ) - ), - wbc = list( - unit = c("K/uL", "G/l"), - min = 0, - description = "white blood cell count", - omopid = 4298431L, - category = "hematology", - sources = list( - mimic = list( - list(ids = 51301L, table = "labevents", sub_var = "itemid") - ), - eicu = list( - list(ids = "WBC x 1000", table = "lab", sub_var = "labname") - ), - hirid = list( - list(ids = 20000700L, table = "observations", sub_var = "variableid", - class = "hrd_itm") - ), - aumc = list( - list(ids = c(6779L, 9965L), table = "numericitems", - sub_var = "itemid") - ), - miiv = list( - list(ids = 51301L, table = "labevents", sub_var = "itemid") - ), - sic = list( - list(ids = 301L, table = "laboratory", sub_var = "LaboratoryID") - ) - ) - ), - hgb = list( - unit = "g/dL", - min = 4, - max = 18, - description = "hemoglobin", - omopid = 4118981L, - category = "hematology", - sources = list( - mimic = list( - list(ids = 51222L, table = "labevents", sub_var = "itemid") - ), - eicu = list( - list(ids = "Hgb", table = "lab", sub_var = "labname") - ), - hirid = list( - list(ids = c(24000548L, 24000836L, 20000900L), table = "observations", - sub_var = "variableid", - callback = "convert_unit(binary_op(`*`, 0.1), 'g/dL', 'g/l')", - class = "hrd_itm") - ), - aumc = list( - list(ids = c(6778L, 9553L, 9960L, 10286L, 19703L), - table = "numericitems", sub_var = "itemid", - callback = "convert_unit(binary_op(`*`, 1.611344), 'g/dL')") - ), - miiv = list( - list(ids = 51222L, table = "labevents", sub_var = "itemid") - ), - sic = list( - list(ids = c(658L, 289L), table = "laboratory", sub_var = "LaboratoryID") - ) - ) - ), - hct = list( - unit = "%", - min = 15, - max = 60, - description = "hematocrit", - omopid = 4151358L, - category = "hematology", - sources = list( - mimic = list( - list(ids = 51221L, table = "labevents", sub_var = "itemid") - ), - eicu = list( - list(ids = "Hct", table = "lab", sub_var = "labname") - ), - aumc = list( - list(ids = c(6777L, 11423L, 11545L), table = "numericitems", - sub_var = "itemid", - callback = "transform_fun(binary_op(`*`, 100))") - ), - miiv = list( - list(ids = 51221L, table = "labevents", sub_var = "itemid") - ), - sic = list( - list(ids = c(217L, 682L), table = "laboratory", sub_var = "LaboratoryID") - ) - ) - ), - pco2 = list( - unit = c("mmHg", "mm Hg"), - min = 10, - max = 150, - description = "CO2 partial pressure", - omopid = 4097882L, - category = "blood gas", - sources = list( - mimic = list( - list(ids = 50818L, table = "labevents", sub_var = "itemid") - ), - eicu = list( - list(ids = "paCO2", table = "lab", sub_var = "labname") - ), - hirid = list( - list(ids = 20001200L, table = "observations", sub_var = "variableid", - class = "hrd_itm") - ), - aumc = list( - list(ids = c(6846L, 9990L, 21213L), table = "numericitems", - sub_var = "itemid") - ), - miiv = list( - list(ids = 50818L, table = "labevents", sub_var = "itemid") - ), - sic = list( - list(ids = 687L, table = "laboratory", sub_var = "LaboratoryID") - ) - ) - ), - po2 = list( - unit = c("mmHg", "mm Hg"), - min = 40, - max = 600, - description = "O2 partial pressure", - omopid = 4094581L, - category = "blood gas", - sources = list( - mimic = list( - list(ids = 50821L, table = "labevents", sub_var = "itemid") - ), - eicu = list( - list(ids = "paO2", table = "lab", sub_var = "labname") - ), - hirid = list( - list(ids = 20000200L, table = "observations", sub_var = "variableid", - class = "hrd_itm") - ), - aumc = list( - list(ids = c(7433L, 9996L, 21214L), table = "numericitems", - sub_var = "itemid") - ), - miiv = list( - list(ids = 50821L, table = "labevents", sub_var = "itemid") - ), - sic = list( - list(ids = c(664L, 689L), table = "laboratory", sub_var = "LaboratoryID") - ) - ) - ), - mch = list( - unit = "pg", - min = 0, - description = "mean corpuscular hemoglobin", - omopid = 4182871L, - category = "hematology", - sources = list( - mimic = list( - list(ids = 51248L, table = "labevents", sub_var = "itemid") - ), - eicu = list( - list(ids = "MCH", table = "lab", sub_var = "labname") - ), - hirid = list( - list(ids = 24000160L, table = "observations", sub_var = "variableid", - class = "hrd_itm") - ), - aumc = list( - list(ids = 11679L, table = "numericitems", sub_var = "itemid", - callback = "convert_unit(binary_op(`*`, 0.016113), 'pg')") - ), - miiv = list( - list(ids = 51248L, table = "labevents", sub_var = "itemid") - ), - sic = list( - list(ids = 566L, table = "laboratory", sub_var = "LaboratoryID") - ) - ) - ), - mchc = list( - unit = "%", - min = 20, - max = 50, - description = "mean corpuscular hemoglobin concentration", - omopid = 4290193L, - category = "hematology", - sources = list( - mimic = list( - list(ids = 51249L, table = "labevents", sub_var = "itemid") - ), - eicu = list( - list(ids = "MCHC", table = "lab", sub_var = "labname") - ), - hirid = list( - list(ids = 24000170L, table = "observations", sub_var = "variableid", - callback = "convert_unit(binary_op(`*`, 0.16114), '%')", - class = "hrd_itm") - ), - aumc = list( - list(ids = 18666L, table = "numericitems", sub_var = "itemid", - callback = "convert_unit(binary_op(`*`, 1.611), '%')") - ), - miiv = list( - list(ids = 51249L, table = "labevents", sub_var = "itemid") - ), - sic = list( - list(ids = 290L, table = "laboratory", sub_var = "LaboratoryID") - ) - ) - ), - mcv = list( - unit = "fL", - min = 50, - max = 150, - description = "mean corpuscular volume", - omopid = 4016239L, - category = "hematology", - sources = list( - mimic = list( - list(ids = 51250L, table = "labevents", sub_var = "itemid") - ), - eicu = list( - list(ids = "MCV", table = "lab", sub_var = "labname") - ), - hirid = list( - list(ids = 24000150L, table = "observations", sub_var = "variableid", - class = "hrd_itm") - ), - aumc = list( - list(ids = 9968L, table = "numericitems", sub_var = "itemid") - ), - miiv = list( - list(ids = 51250L, table = "labevents", sub_var = "itemid") - ), - sic = list( - list(ids = 286L, table = "laboratory", sub_var = "LaboratoryID") - ) - ) - ), - ptt = list( - unit = "sec", - min = 0, - description = "partial thromboplastin time", - omopid = 4175016L, - category = "hematology", - sources = list( - mimic = list( - list(ids = 51275L, table = "labevents", sub_var = "itemid") - ), - eicu = list( - list(ids = "PTT", table = "lab", sub_var = "labname") - ), - hirid = list( - list(ids = 20004410L, table = "observations", sub_var = "variableid", - class = "hrd_itm") - ), - aumc = list( - list(ids = 17982L, table = "numericitems", sub_var = "itemid") - ), - miiv = list( - list(ids = 51275L, table = "labevents", sub_var = "itemid") - ), - sic = list( - list(ids = 597L, table = "laboratory", sub_var = "LaboratoryID") - ) - ) - ), - ca = list( - unit = "mg/dL", - min = 4, - max = 20, - description = "calcium", - omopid = 4216722L, - category = "chemistry", - sources = list( - mimic = list( - list(ids = 50893L, table = "labevents", sub_var = "itemid") - ), - eicu = list( - list(ids = "calcium", table = "lab", sub_var = "labname", - callback = "convert_unit(binary_op(`*`, 4), 'mg/dL', 'mmol/l')") - ), - hirid = list( - list(ids = 20005100L, table = "observations", sub_var = "variableid", - callback = "convert_unit(binary_op(`*`, 4.008), 'mg/dL')", - class = "hrd_itm") - ), - aumc = list( - list(ids = c(6817L, 9933L), table = "numericitems", sub_var = "itemid", - callback = "convert_unit(binary_op(`*`, 4.008), 'mg/dL')") - ), - miiv = list( - list(ids = 50893L, table = "labevents", sub_var = "itemid") - ), - sic = list( - list(ids = 457L, table = "laboratory", sub_var = "LaboratoryID", - callback = "transform_fun(binary_op(`*`, 4.008))") - ) - ) - ), - cl = list( - unit = c("mEq/L", "mmol/l"), - min = 80, - max = 130, - description = "chloride", - omopid = 4188066L, - category = "chemistry", - sources = list( - mimic = list( - list(ids = 50902L, table = "labevents", sub_var = "itemid") - ), - eicu = list( - list(ids = "chloride", table = "lab", sub_var = "labname") - ), - hirid = list( - list(ids = c(24000439L, 24000521L), table = "observations", - sub_var = "variableid", class = "hrd_itm") - ), - aumc = list( - list(ids = 9930L, table = "numericitems", sub_var = "itemid") - ), - miiv = list( - list(ids = 50902L, table = "labevents", sub_var = "itemid") - ), - sic = list( - list(ids = c(683L, 450L), table = "laboratory", sub_var = "LaboratoryID") - ) - ) - ), - mg = list( - unit = "mg/dL", - min = 0.5, - max = 5, - description = "magnesium", - omopid = 4243005L, - category = "chemistry", - sources = list( - mimic = list( - list(ids = 50960L, table = "labevents", sub_var = "itemid") - ), - eicu = list( - list(ids = "magnesium", table = "lab", sub_var = "labname", - callback = "convert_unit(binary_op(`/`, 1.215), 'mg/dL', 'mEq/L')" - ) - ), - hirid = list( - list(ids = 24000230L, table = "observations", sub_var = "variableid", - callback = "convert_unit(binary_op(`*`, 2.431), 'mg/dL')", - class = "hrd_itm") - ), - aumc = list( - list(ids = c(6839L, 9952L), table = "numericitems", sub_var = "itemid", - callback = "convert_unit(binary_op(`*`, 2.431), 'mg/dL')") - ), - miiv = list( - list(ids = 50960L, table = "labevents", sub_var = "itemid") - ), - sic = list( - list(ids = 468L, table = "laboratory", sub_var = "LaboratoryID", - callback = "transform_fun(binary_op(`*`, 2.431))") - ) - ) - ), - k = list( - unit = c("mEq/L", "mmol/l"), - min = 0, - max = 10, - description = "potassium", - omopid = 4207483L, - category = "chemistry", - sources = list( - mimic = list( - list(ids = 50971L, table = "labevents", sub_var = "itemid") - ), - eicu = list( - list(ids = "potassium", table = "lab", sub_var = "labname") - ), - hirid = list( - list(ids = c(20000500L, 24000520L, 24000833L, 24000867L), - table = "observations", sub_var = "variableid", class = "hrd_itm") - ), - aumc = list( - list(ids = c(6835, 9556, 9927, 10285), table = "numericitems", - sub_var = "itemid") - ), - miiv = list( - list(ids = 50971L, table = "labevents", sub_var = "itemid") - ), - sic = list( - list(ids = c(463L, 685L), table = "laboratory", sub_var = "LaboratoryID") - ) - ) - ), - na = list( - unit = c("mEq/L", "mmol/l"), - min = 110, - max = 165, - description = "sodium", - omopid = 4208938L, - category = "chemistry", - sources = list( - mimic = list( - list(ids = 50983L, table = "labevents", sub_var = "itemid") - ), - eicu = list( - list(ids = "sodium", table = "lab", sub_var = "labname") - ), - hirid = list( - list(ids = c(20000400L, 24000519L, 24000658L, 24000835L, 24000866L), - table = "observations", sub_var = "variableid", class = "hrd_itm") - ), - aumc = list( - list(ids = c(6840, 9555, 9924, 10284), table = "numericitems", - sub_var = "itemid") - ), - miiv = list( - list(ids = 50983L, table = "labevents", sub_var = "itemid") - ), - sic = list( - list(ids = c(469L, 686L), table = "laboratory", sub_var = "LaboratoryID") - ) - ) - ), - basos = list( - unit = "%", - min = 0, - max = 50, - description = "basophils", - omopid = 4172647L, - category = "hematology", - sources = list( - mimic = list( - list(ids = 51146L, table = "labevents", sub_var = "itemid") - ), - eicu = list( - list(ids = "-basos", table = "lab", sub_var = "labname") - ), - aumc = list( - list(ids = 11710L, table = "numericitems", sub_var = "itemid"), - list(ids = 14256L, table = "numericitems", sub_var = "itemid", - callback = "blood_cell_ratio") - ), - miiv = list( - list(ids = 51146L, table = "labevents", sub_var = "itemid") - ), - sic = list( - list(ids = 174L, table = "laboratory", sub_var = "LaboratoryID") - ) - ) - ), - eos = list( - unit = "%", - min = 0, - max = 50, - description = "eosinophils", - omopid = 4216098L, - category = "hematology", - sources = list( - mimic = list( - list(ids = 51200L, table = "labevents", sub_var = "itemid") - ), - eicu = list( - list(ids = "-eos", table = "lab", sub_var = "labname") - ), - aumc = list( - list(ids = 6773L, table = "numericitems", sub_var = "itemid"), - list(ids = 9967L, table = "numericitems", sub_var = "itemid", - callback = "blood_cell_ratio") - ), - miiv = list( - list(ids = 51200L, table = "labevents", sub_var = "itemid") - ), - sic = list( - list(ids = 197L, table = "laboratory", sub_var = "LaboratoryID") - ) - ) - ), - neut = list( - unit = "%", - min = 0, - max = 100, - description = "neutrophils", - omopid = 4148615L, - category = "hematology", - sources = list( - mimic = list( - list(ids = 51256L, table = "labevents", sub_var = "itemid") - ), - eicu = list( - list(ids = "-polys", table = "lab", sub_var = "labname") - ), - hirid = list( - list(ids = 24000550L, table = "observations", sub_var = "variableid", - class = "hrd_itm") - ), - aumc = list( - list(ids = c(6786L, 11856L), table = "numericitems", - sub_var = "itemid"), - list(ids = 14254L, table = "numericitems", sub_var = "itemid", - callback = "blood_cell_ratio") - ), - miiv = list( - list(ids = 51256L, table = "labevents", sub_var = "itemid") - ), - sic = list( - list(ids = 230L, table = "laboratory", sub_var = "LaboratoryID") - ) - ) - ), - glu = list( - unit = "mg/dL", - min = 0, - max = 1000, - description = "glucose", - omopid = 4144235L, - category = "chemistry", - sources = list( - mimic = list( - list(ids = c(50809L, 50931L), table = "labevents", sub_var = "itemid") - ), - eicu = list( - list(ids = "glucose", table = "lab", sub_var = "labname"), - list(ids = "bedside glucose", table = "lab", sub_var = "labname") - ), - hirid = list( - list(ids = c(20005110L, 24000523L, 24000585L), table = "observations", - sub_var = "variableid", - callback = "convert_unit(binary_op(`*`, 18.016), 'mg/dL')", - class = "hrd_itm") - ), - aumc = list( - list(ids = c(6833L, 9557L, 9947L), table = "numericitems", - sub_var = "itemid", - callback = "convert_unit(binary_op(`*`, 18.016), 'mg/dL')") - ), - miiv = list( - list(ids = c(50809L, 50931L), table = "labevents", sub_var = "itemid") - ), - sic = list( - list(ids = c(348L, 656L), table = "laboratory", sub_var = "LaboratoryID") - ) - ) - ), - cai = list( - unit = "mmol/L", - min = 0.5, - max = 2, - description = "calcium ionized", - omopid = 46272910L, - category = "blood gas", - sources = list( - mimic = list( - list(ids = 50808L, table = "labevents", sub_var = "itemid") - ), - eicu = list( - list(ids = "ionized calcium", table = "lab", sub_var = "labname") - ), - hirid = list( - list(ids = 24000522L, table = "observations", sub_var = "variableid", - class = "hrd_itm") - ), - aumc = list( - list(ids = c(6815L, 8915L, 9560L, 9561L, 10267L), - table = "numericitems", sub_var = "itemid") - ), - miiv = list( - list(ids = 50808L, table = "labevents", sub_var = "itemid") - ), - sic = list( - list(ids = 655L, table = "laboratory", sub_var = "LaboratoryID") - ) - ) - ), - crp = list( - unit = "mg/L", - min = 0, - description = "C-reactive protein", - omopid = 4208414L, - category = "chemistry", - sources = list( - mimic = list( - list(ids = 50889L, table = "labevents", sub_var = "itemid", - callback = "convert_unit(binary_op(`*`, 10), 'mg/L', 'mg/dl')") - ), - eicu = list( - list(ids = "CRP", table = "lab", sub_var = "labname", - callback = "convert_unit(binary_op(`*`, 10), 'mg/L', 'mg/dl')") - ), - hirid = list( - list(ids = 20002200L, table = "observations", sub_var = "variableid", - class = "hrd_itm") - ), - aumc = list( - list(ids = c(6825L, 10079L), table = "numericitems", - sub_var = "itemid") - ), - miiv = list( - list(ids = 50889L, table = "labevents", sub_var = "itemid", - callback = "convert_unit(binary_op(`*`, 10), 'mg/L', 'mg/dl')") - ) - ) - ), - esr = list( - unit = c("mm/hr", "mm/1h"), - min = 0, - max = 200, - description = "erythrocyte sedimentation rate", - omopid = 4212065L, - category = "hematology", - sources = list( - mimic = list( - list(ids = 51288L, table = "labevents", sub_var = "itemid") - ), - hirid = list( - list(ids = 24000668L, table = "observations", sub_var = "variableid", - class = "hrd_itm") - ), - aumc = list( - list(ids = c(6808L, 11902L), table = "numericitems", - sub_var = "itemid") - ), - miiv = list( - list(ids = 51288L, table = "labevents", sub_var = "itemid") - ) - ) - ), - hbco = list( - description = "carboxyhemoglobin", - omopid = 4056787L, - category = "blood gas", - sources = list( - eicu = list( - list(ids = "Carboxyhemoglobin", table = "lab", sub_var = "labname") - ), - hirid = list( - list(ids = 24000526L, table = "observations", sub_var = "variableid", - class = "hrd_itm") - ), - aumc = list( - list(ids = 11690L, table = "numericitems", sub_var = "itemid") - ) - ) - ), - methb = list( - unit = "%", - min = 0, - max = 100, - description = "methemoglobin", - omopid = 4204561L, - category = "blood gas", - sources = list( - mimic = list( - list(ids = 50814L, table = "labevents", sub_var = "itemid") - ), - eicu = list( - list(ids = "Methemoglobin", table = "lab", sub_var = "labname") - ), - hirid = list( - list(ids = 24000549L, table = "observations", sub_var = "variableid", - class = "hrd_itm") - ), - aumc = list( - list(ids = 11692L, table = "numericitems", sub_var = "itemid") - ), - miiv = list( - list(ids = 50814L, table = "labevents", sub_var = "itemid") - ) - ) - ), - tnt = list( - unit = "ng/mL", - min = 0, - description = "troponin t", - omopid = 4005525L, - category = "chemistry", - sources = list( - mimic = list( - list(ids = 51003L, table = "labevents", sub_var = "itemid") - ), - eicu = list( - list(ids = "troponin - T", table = "lab", sub_var = "labname") - ), - hirid = list( - list(ids = 24000806L, table = "observations", sub_var = "variableid", - callback = "convert_unit(binary_op(`/`, 1000), 'ng/mL')", - class = "hrd_itm") - ), - aumc = list( - list(ids = 10407L, table = "numericitems", sub_var = "itemid") - ), - miiv = list( - list(ids = 51003L, table = "labevents", sub_var = "itemid") - ), - sic = list( - list(ids = 481L, table = "laboratory", sub_var = "LaboratoryID", - callback = "transform_fun(binary_op(`/`, 1000))") - ) - ) - ), - alb = list( - unit = "g/dL", - min = 0, - max = 6, - description = "albumin", - omopid = 4017497L, - category = "chemistry", - sources = list( - mimic = list( - list(ids = 50862L, table = "labevents", sub_var = "itemid") - ), - eicu = list( - list(ids = "albumin", table = "lab", sub_var = "labname") - ), - hirid = list( - list(ids = 24000605L, table = "observations", sub_var = "variableid", - callback = "convert_unit(binary_op(`*`, 0.1), 'g/dL')", - class = "hrd_itm") - ), - aumc = list( - list(ids = c(6801L, 9937L), table = "numericitems", - sub_var = "itemid", - callback = "convert_unit(binary_op(`*`, 0.1), 'g/dL')") - ), - miiv = list( - list(ids = 50862L, table = "labevents", sub_var = "itemid") - ), - sic = list( - list(ids = 287L, table = "laboratory", sub_var = "LaboratoryID") - ) - ) - ), - fgn = list( - unit = "mg/dL", - min = 0, - max = 1500, - description = "fibrinogen", - omopid = 4094436L, - category = "hematology", - sources = list( - mimic = list( - list(ids = 51214L, table = "labevents", sub_var = "itemid") - ), - eicu = list( - list(ids = "fibrinogen", table = "lab", sub_var = "labname") - ), - hirid = list( - list(ids = 24000536L, table = "observations", sub_var = "variableid", - callback = "convert_unit(binary_op(`*`, 100), 'mg/dL')", - class = "hrd_itm") - ), - aumc = list( - list(ids = c(6776L, 9989L, 10175L), table = "numericitems", - sub_var = "itemid", - callback = "convert_unit(binary_op(`*`, 100), 'mg/dL')") - ), - miiv = list( - list(ids = 51214L, table = "labevents", sub_var = "itemid") - ), - sic = list( - list(ids = 344L, table = "laboratory", sub_var = "LaboratoryID") - ) - ) - ), - be = list( - unit = c("mEq/L", "mmol/l"), - min = -25, - max = 25, - description = "base excess", - omopid = 4284393L, - category = "blood gas", - sources = list( - mimic = list( - list(ids = 50802L, table = "labevents", sub_var = "itemid") - ), - eicu = list( - list(ids = "Base Excess", table = "lab", sub_var = "labname") - ), - hirid = list( - list(ids = 20001300L, table = "observations", sub_var = "variableid", - class = "hrd_itm") - ), - aumc = list( - list(ids = c(6807L, 9994L), table = "numericitems", - sub_var = "itemid", dir_var = "tag", callback = "aumc_bxs") - ), - miiv = list( - list(ids = 50802L, table = "labevents", sub_var = "itemid") - ), - sic = list( - list(ids = 668L, table = "laboratory", sub_var = "LaboratoryID") - ) - ) - ), - rbc = list( - unit = "m/uL", - min = 0, - max = 20, - description = "red blood cell count", - omopid = 4030871L, - category = "hematology", - sources = list( - mimic = list( - list(ids = 51279L, table = "labevents", sub_var = "itemid") - ), - eicu = list( - list(ids = "RBC", table = "lab", sub_var = "labname") - ), - aumc = list( - list(ids = c(6774L, 9962L), table = "numericitems", sub_var = "itemid") - ), - miiv = list( - list(ids = 51279L, table = "labevents", sub_var = "itemid") - ), - sic = list( - list(ids = 599L, table = "laboratory", sub_var = "LaboratoryID") - ) - ) - ), - ck = list( - unit = c("IU/L", "U/l"), - min = 0, - description = "creatine kinase", - omopid = 4265595L, - category = "chemistry", - sources = list( - mimic = list( - list(ids = 50910L, table = "labevents", sub_var = "itemid") - ), - eicu = list( - list(ids = "CPK", table = "lab", sub_var = "labname") - ), - hirid = list( - list(ids = 24000210L, table = "observations", sub_var = "variableid", - class = "hrd_itm") - ), - aumc = list( - list(ids = c(6822L, 11998L), table = "numericitems", - sub_var = "itemid") - ), - miiv = list( - list(ids = 50910L, table = "labevents", sub_var = "itemid") - ), - sic = list( - list(ids = 611L, table = "laboratory", sub_var = "LaboratoryID") - ) - ) - ), - ckmb = list( - unit = "ng/mL", - min = 0, - description = "creatine kinase MB", - omopid = 4017058L, - category = "chemistry", - sources = list( - mimic = list( - list(ids = 50911L, table = "labevents", sub_var = "itemid") - ), - eicu = list( - list(ids = "CPK-MB", table = "lab", sub_var = "labname") - ), - hirid = list( - list(ids = 24000220L, table = "observations", sub_var = "variableid", - class = "hrd_itm") - ), - aumc = list( - list(ids = 6824L, table = "numericitems", sub_var = "itemid") - ), - miiv = list( - list(ids = 50911L, table = "labevents", sub_var = "itemid") - ), - sic = list( - list(ids = 253L, table = "laboratory", sub_var = "LaboratoryID") - ) - ) - ), - egcs = list( - min = 1, - max = 4, - description = "GCS eye", - omopid = 4084277L, - category = "neurological", - sources = list( - mimic = list( - list(ids = c(184L, 220739L), table = "chartevents", sub_var = "itemid") - ), - eicu = list( - list(ids = "Eyes", table = "nursecharting", - sub_var = "nursingchartcelltypevalname") - ), - hirid = list( - list(ids = 10000300L, table = "observations", sub_var = "variableid", - class = "hrd_itm") - ), - aumc = list( - list(ids = 6732L, table = "listitems", sub_var = "itemid", - callback = strip_ws("apply_map( - c(`Geen reactie` = 1, - `Reactie op pijnprikkel` = 2, - `Reactie op verbale prikkel` = 3, - `Spontane reactie` = 4) - )")), - list(ids = 13077L, table = "listitems", sub_var = "itemid", - callback = strip_ws("apply_map( - c(`Niet` = 1, - `Op pijn` = 2, - `Op aanspreken` = 3, - `Spontaan` = 4) - )")) - ), - miiv = list( - list(ids = 220739L, table = "chartevents", sub_var = "itemid") - ) - ) - ), - vgcs = list( - min = 1, - max = 5, - description = "GCS verbal", - omopid = 4084912L, - category = "neurological", - sources = list( - mimic = list( - list(ids = c(723L, 223900L), table = "chartevents", sub_var = "itemid") - ), - eicu = list( - list(ids = "Verbal", table = "nursecharting", - sub_var = "nursingchartcelltypevalname") - ), - hirid = list( - list(ids = 10000100L, table = "observations", sub_var = "variableid", - class = "hrd_itm") - ), - aumc = list( - list(ids = 6735L, table = "listitems", sub_var = "itemid", - callback = strip_ws("apply_map( - c(`Geen reactie (geen zichtbare poging tot praten)` = 1, - `Onbegrijpelijke geluiden` = 2, - `Onduidelijke woorden (pogingen tot communicatie, - maar onduidelijk)` = 3, - `Verwarde conversatie` = 4, - `Helder en adequaat (communicatie mogelijk)` = 5) - )")), - list(ids = 13066L, table = "listitems", sub_var = "itemid", - callback = strip_ws("apply_map( - c(`Geen geluid` = 1, - `Onverstaanbare woorden` = 2, - `Onjuiste woorden` = 3, - `Verwarde taal` = 4, - `Georiënteerd` = 5) - )")) - ), - miiv = list( - list(ids = 223900L, table = "chartevents", sub_var = "itemid") - ) - ) - ), - mgcs = list( - min = 1, - max = 6, - description = "GCS motor", - omopid = 4083352L, - category = "neurological", - sources = list( - mimic = list( - list(ids = c(454L, 223901L), table = "chartevents", sub_var = "itemid") - ), - eicu = list( - list(ids = "Motor", table = "nursecharting", - sub_var = "nursingchartcelltypevalname") - ), - hirid = list( - list(ids = 10000200L, table = "observations", sub_var = "variableid", - class = "hrd_itm") - ), - aumc = list( - list(ids = 6734L, table = "listitems", sub_var = "itemid", - callback = strip_ws("apply_map( - c(`Geen reactie` = 1, - `Strekken` = 2, - `Decortatie reflex (abnormaal buigen)` = 3, - `Spastische reactie (terugtrekken)` = 4, - `Localiseert pijn` = 5, - `Volgt verbale commando's op` = 6) - )")), - list(ids = 13072L, table = "listitems", sub_var = "itemid", - callback = strip_ws("apply_map( - c(`Geen reactie` = 1, - `Strekken op pijn` = 2, - `Abnormaal buigen bij pijn` = 3, - `Terugtrekken bij pijn` = 4, - `Localiseren pijn` = 5, - `Voert opdrachten uit` = 6) - )")) - ), - miiv = list( - list(ids = 223901L, table = "chartevents", sub_var = "itemid") - ) - ) - ), - tgcs = list( - min = 3, - max = 15, - description = "GCS total", - omopid = 4093836L, - category = "neurological", - sources = list( - mimic = list( - list(ids = 198L, table = "chartevents", sub_var = "itemid") - ), - eicu = list( - list(ids = "GCS Total", table = "nursecharting", - sub_var = "nursingchartcelltypevalname") - ) - ) - ), - urine = list( - unit = "mL", - min = 0, - max = 2000, - aggregate = "sum", - description = "urine output", - omopid = 4264378L, - category = "output", - sources = list( - mimic = list( - list(ids = c(40055L, 40056L, 40057L, 40065L, 40069L, 40085L, - 40086L, 40094L, 40096L, 40405L, 40428L, 40473L, - 40715L, 43175L, 226557L, 226558L, 226559L, 226560L, - 226561L, 226563L, 226564L, 226565L, 226566L, 226567L, - 226584L, 227510L), - table = "outputevents", sub_var = "itemid") - ), - eicu = list( - list(ids = c("Urine", "URINE CATHETER"), table = "intakeoutput", - sub_var = "celllabel"), - list(regex = c("catheter.+output|output.+catheter"), - table = "intakeoutput", sub_var = "celllabel", class = "rgx_itm") - ), - hirid = list( - list(ids = 30005110L, table = "observations", sub_var = "variableid", - callback = "hirid_urine", class = "hrd_itm") - ), - aumc = list( - list(ids = 8794L, table = "numericitems", sub_var = "itemid") - ), - miiv = list( - list(ids = c(226557L, 226558L, 226559L, 226560L, 226561L, 226563L, - 226564L, 226565L, 226566L, 226567L, 226584L, 227510L), - table = "outputevents", sub_var = "itemid") - ), - sic = list( - list(ids = 725L, table = "data_float_h", sub_var = "DataID") - ) - ) - ), - dobu_rate = list( - unit = c("mcg/kg/min", "mcgkgmin"), - min = 0, - max = 50, - description = "dobutamine rate", - omopid = 1337720L, - category = "medications", - sources = list( - mimic = list( - list(ids = c(30042L, 30306L), table = "inputevents_cv", - sub_var = "itemid", grp_var = "linkorderid", - callback = "mimic_rate_cv"), - list(ids = 221653L, table = "inputevents_mv", sub_var = "itemid", - stop_var = "endtime", callback = "mimic_rate_mv") - ), - eicu = list( - list(regex = "^dobu.*\\(.+\\)$", table = "infusiondrug", - sub_var = "drugname", weight_var = "patientweight", - callback = "eicu_rate_kg(ml_to_mcg = 2000)", class = "rgx_itm") - ), - hirid = list( - list(ids = 426L, table = "pharma", sub_var = "pharmaid", - grp_var = "infusionid", callback = "hirid_rate_kg") - ), - aumc = list( - list(ids = 7178L, table = "drugitems", sub_var = "itemid", - rel_weight = "doserateperkg", rate_uom = "doserateunit", - stop_var = "stop", callback = "aumc_rate_kg") - ), - miiv = list( - list(ids = 221653L, table = "inputevents", sub_var = "itemid", - stop_var = "endtime", callback = "mimic_rate_mv") - ), - sic = list( - list(ids = 1559L, table = "medication", sub_var = "DrugID", - val_var = "AmountPerMinute", stop_var = "OffsetDrugEnd", - callback = "sic_rate_kg") - ) - ) - ), - dobu_dur = list( - description = "dobutamine duration", - category = "medications", - aggregate = "max", - sources = list( - mimic = list( - list(ids = c(30042L, 30306L), table = "inputevents_cv", - sub_var = "itemid", grp_var = "linkorderid", - callback = "mimic_dur_incv"), - list(ids = 221653L, table = "inputevents_mv", sub_var = "itemid", - stop_var = "endtime", grp_var = "linkorderid", - callback = "mimic_dur_inmv") - ), - eicu = list( - list(regex = "^dobu", table = "infusiondrug", sub_var = "drugname", - callback = "eicu_duration(gap_length = hours(5L))", - class = "rgx_itm") - ), - hirid = list( - list(ids = 426L, table = "pharma", sub_var = "pharmaid", - grp_var = "infusionid", callback = "hirid_duration") - ), - aumc = list( - list(ids = 7178L, table = "drugitems", sub_var = "itemid", - stop_var = "stop", grp_var = "orderid", callback = "aumc_dur") - ), - miiv = list( - list(ids = 221653L, table = "inputevents", sub_var = "itemid", - stop_var = "endtime", grp_var = "linkorderid", - callback = "mimic_dur_inmv") - ), - sic = list( - list(ids = list(1559L), table = "medication", - sub_var = "DrugID", stop_var = "OffsetDrugEnd", - callback = "sic_dur") - ) - ) - ), - dobu60 = list( - concepts = c("dobu_rate", "dobu_dur"), - description = "dobutamine administration for min 1h", - category = "medications", - interval = "00:01:00", - callback = "vaso60", - class = "rec_cncpt" - ), - dopa_rate = list( - unit = c("mcg/kg/min", "mcgkgmin"), - min = 0, - max = 50, - description = "dopamine rate", - omopid = 1337860L, - category = "medications", - sources = list( - mimic = list( - list(ids = c(30043L, 30125L, 30307L), table = "inputevents_cv", - sub_var = "itemid", grp_var = "linkorderid", - callback = "mimic_rate_cv"), - list(ids = 221662L, table = "inputevents_mv", sub_var = "itemid", - stop_var = "endtime", callback = "mimic_rate_mv") - ), - eicu = list( - list(regex = "^dopa.*\\(.+\\)$", table = "infusiondrug", - sub_var = "drugname", weight_var = "patientweight", - callback = "eicu_rate_kg(ml_to_mcg = 1600)", class = "rgx_itm") - ), - aumc = list( - list(ids = 7179L, table = "drugitems", sub_var = "itemid", - rel_weight = "doserateperkg", rate_uom = "doserateunit", - stop_var = "stop", callback = "aumc_rate_kg") - ), - miiv = list( - list(ids = 221662L, table = "inputevents", sub_var = "itemid", - stop_var = "endtime", callback = "mimic_rate_mv") - ), - sic = list( - list(ids = 1618L, table = "medication", sub_var = "DrugID", - val_var = "AmountPerMinute", stop_var = "OffsetDrugEnd", - callback = "sic_rate_kg") - ) - ) - ), - dopa_dur = list( - description = "dopamine duration", - category = "medications", - aggregate = "max", - sources = list( - mimic = list( - list(ids = c(30043L, 30125L, 30307L), table = "inputevents_cv", - sub_var = "itemid", grp_var = "linkorderid", - callback = "mimic_dur_incv"), - list(ids = 221662L, table = "inputevents_mv", sub_var = "itemid", - stop_var = "endtime", grp_var = "linkorderid", - callback = "mimic_dur_inmv") - ), - eicu = list( - list(regex = "^dopa", table = "infusiondrug", sub_var = "drugname", - callback = "eicu_duration(gap_length = hours(5L))", - class = "rgx_itm") - ), - aumc = list( - list(ids = 7179L, table = "drugitems", sub_var = "itemid", - stop_var = "stop", grp_var = "orderid", callback = "aumc_dur") - ), - miiv = list( - list(ids = 221662L, table = "inputevents", sub_var = "itemid", - stop_var = "endtime", grp_var = "linkorderid", - callback = "mimic_dur_inmv") - ), - sic = list( - list(ids = 1618L, table = "medication", - sub_var = "DrugID", stop_var = "OffsetDrugEnd", - callback = "sic_dur") - ) - ) - ), - dopa60 = list( - concepts = c("dopa_rate", "dopa_dur"), - description = "dopamine administration for min 1h", - category = "outcome", - interval = "00:01:00", - callback = "vaso60", - class = "rec_cncpt" - ), - norepi_rate = list( - unit = c("mcg/kg/min", "mcgkgmin"), - min = 0, - max = 3, - description = "norepinephrine rate", - omopid = 1321341, - category = "medications", - sources = list( - mimic = list( - list(ids = c(30047L, 30120L), table = "inputevents_cv", - sub_var = "itemid", grp_var = "linkorderid", - callback = "mimic_rate_cv"), - list(ids = 221906L, table = "inputevents_mv", sub_var = "itemid", - stop_var = "endtime", callback = "mimic_rate_mv") - ), - eicu = list( - list(regex = "^norepi.*\\(.+\\)$", table = "infusiondrug", - sub_var = "drugname", weight_var = "patientweight", - callback = "eicu_rate_kg(ml_to_mcg = 32)", class = "rgx_itm") - ), - hirid = list( - list(ids = c(1000462L, 1000656L, 1000657L, 1000658L), table = "pharma", - sub_var = "pharmaid", grp_var = "infusionid", - callback = "hirid_rate_kg") - ), - aumc = list( - list(ids = 7229L, table = "drugitems", sub_var = "itemid", - rel_weight = "doserateperkg", rate_uom = "doserateunit", - stop_var = "stop", callback = "aumc_rate_kg") - ), - miiv = list( - list(ids = 221906L, table = "inputevents", sub_var = "itemid", - stop_var = "endtime", callback = "mimic_rate_mv") - ), - sic = list( - list(ids = 1562L, table = "medication", sub_var = "DrugID", - val_var = "AmountPerMinute", stop_var = "OffsetDrugEnd", - callback = "sic_rate_kg") - ) - ) - ), - norepi_dur = list( - description = "norepinephrine duration", - category = "medications", - aggregate = "max", - sources = list( - mimic = list( - list(ids = c(30047L, 30120L), table = "inputevents_cv", - sub_var = "itemid", grp_var = "linkorderid", - callback = "mimic_dur_incv"), - list(ids = 221906L, table = "inputevents_mv", sub_var = "itemid", - stop_var = "endtime", grp_var = "linkorderid", - callback = "mimic_dur_inmv") - ), - eicu = list( - list(regex = "^norepi", table = "infusiondrug", sub_var = "drugname", - callback = "eicu_duration(gap_length = hours(5L))", - class = "rgx_itm") - ), - hirid = list( - list(ids = c(1000462L, 1000656L, 1000657L, 1000658L), table = "pharma", - sub_var = "pharmaid", grp_var = "infusionid", - callback = "hirid_duration") - ), - aumc = list( - list(ids = 7229L, table = "drugitems", sub_var = "itemid", - stop_var = "stop", grp_var = "orderid", callback = "aumc_dur") - ), - miiv = list( - list(ids = 221906L, table = "inputevents", sub_var = "itemid", - stop_var = "endtime", grp_var = "linkorderid", - callback = "mimic_dur_inmv") - ), - sic = list( - list(ids = list(1562L), table = "medication", - sub_var = "DrugID", stop_var = "OffsetDrugEnd", - callback = "sic_dur") - ) - ) - ), - norepi60 = list( - concepts = c("norepi_rate", "norepi_dur"), - description = "norepinephrine administration for min 1h", - category = "outcome", - interval = "00:01:00", - callback = "vaso60", - class = "rec_cncpt" - ), - epi_rate = list( - unit = c("mcg/kg/min", "mcgkgmin"), - min = 0, - max = 1.5, - description = "epinephrine rate", - omopid = 1343916L, - category = "medications", - sources = list( - mimic = list( - list(ids = c(30044L, 30119L, 30309L), table = "inputevents_cv", - sub_var = "itemid", grp_var = "linkorderid", - callback = "mimic_rate_cv"), - list(ids = 221289L, table = "inputevents_mv", sub_var = "itemid", - stop_var = "endtime", callback = "mimic_rate_mv") - ), - eicu = list( - list(regex = "^epi( |n).*\\(.+\\)$", table = "infusiondrug", - sub_var = "drugname", weight_var = "patientweight", - callback = "eicu_rate_kg(ml_to_mcg = 40)", class = "rgx_itm") - ), - hirid = list( - list(ids = c(71L, 1000649L, 1000650L, 1000655L, 1000750L), - table = "pharma", sub_var = "pharmaid", - grp_var = "infusionid", callback = "hirid_rate_kg") - ), - aumc = list( - list(ids = 6818L, table = "drugitems", sub_var = "itemid", - rel_weight = "doserateperkg", rate_uom = "doserateunit", - stop_var = "stop", callback = "aumc_rate_kg") - ), - miiv = list( - list(ids = 221289L, table = "inputevents", sub_var = "itemid", - stop_var = "endtime", callback = "mimic_rate_mv") - ), - sic = list( - list(ids = 1502L, table = "medication", sub_var = "DrugID", - val_var = "AmountPerMinute", stop_var = "OffsetDrugEnd", - callback = "sic_rate_kg") - ) - ) - ), - epi_dur = list( - description = "epinephrine duration", - category = "medications", - aggregate = "max", - sources = list( - mimic = list( - list(ids = c(30044L, 30119L, 30309L), table = "inputevents_cv", - sub_var = "itemid", grp_var = "linkorderid", - callback = "mimic_dur_incv"), - list(ids = 221289L, table = "inputevents_mv", sub_var = "itemid", - stop_var = "endtime", grp_var = "linkorderid", - callback = "mimic_dur_inmv") - ), - eicu = list( - list(regex = "^epi( |n)", table = "infusiondrug", sub_var = "drugname", - callback = "eicu_duration(gap_length = hours(5L))", - class = "rgx_itm") - ), - hirid = list( - list(ids = c(71L, 1000649L, 1000650L, 1000655L, 1000750L), - table = "pharma", sub_var = "pharmaid", grp_var = "infusionid", - callback = "hirid_duration") - ), - aumc = list( - list(ids = 6818L, table = "drugitems", sub_var = "itemid", - stop_var = "stop", grp_var = "orderid", callback = "aumc_dur") - ), - miiv = list( - list(ids = 221289L, table = "inputevents", sub_var = "itemid", - stop_var = "endtime", grp_var = "linkorderid", - callback = "mimic_dur_inmv") - ), - sic = list( - list(ids = list(1502L), table = "medication", - sub_var = "DrugID", stop_var = "OffsetDrugEnd", - callback = "sic_dur") - ) - ) - ), - epi60 = list( - concepts = c("epi_rate", "epi_dur"), - description = "epinephrine administration for min 1h", - category = "outcome", - interval = "00:01:00", - callback = "vaso60", - class = "rec_cncpt" - ), - vent_start = list( - class = "lgl_cncpt", - description = "ventilation start", - category = "respiratory", - sources = list( - mimic = list( - list( - ids = c( - 1L, 60L, 218L, 221L, 223L, 436L, 437L, - 444L, 445L, 448L, 449L, 450L, 459L, 501L, - 502L, 503L, 505L, 506L, 535L, 543L, 639L, - 654L, 667L, 668L, 669L, 670L, 671L, 672L, - 681L, 682L, 683L, 684L, 686L, 1211L, 1340L, - 1486L, 1600L, 1655L, 2000L, 3459L, 5865L, 5866L, - 220339L, 223848L, 223849L, 224419L, 224684L, 224685L, 224686L, - 224687L, 224695L, 224696L, 224697L, 224700L, 224701L, 224702L, - 224703L, 224704L, 224705L, 224706L, 224707L, 224709L, 224738L, - 224746L, 224747L, 224750L, 226873L, 227187L), - table = "chartevents", sub_var = "itemid", - callback = "transform_fun(set_val(TRUE))" - ) - ), - eicu = list( - list(table = "respiratorycare", val_var = "ventstartoffset", - callback = "vent_flag", class = "col_itm"), - list(table = "respiratorycare", val_var = "priorventstartoffset", - callback = "vent_flag", class = "col_itm"), - list(ids = c("Start", "Continued", "respFlowPtVentData"), - table = "respiratorycharting", sub_var = "respcharttypecat", - callback = "transform_fun(set_val(TRUE))") - ) - ) - ), - vent_end = list( - class = "lgl_cncpt", - description = "ventilation end", - category = "respiratory", - sources = list( - mimic = list( - list(ids = c(225468L, 225477L, 227194L), table = "procedureevents_mv", - sub_var = "itemid", callback = "transform_fun(set_val(TRUE))"), - list(ids = c(467L, 469L, 226732L), table = "chartevents", - sub_var = "itemid", callback = "transform_fun(set_val(TRUE))") - ), - eicu = list( - list(table = "respiratorycare", val_var = "ventendoffset", - callback = "vent_flag", class = "col_itm"), - list(table = "respiratorycare", val_var = "priorventendoffset", - callback = "vent_flag", class = "col_itm"), - list(ids = c("off", "Off", "Suspended"), table = "respiratorycharting", - sub_var = "respchartvalue", val_var = "respchartvaluelabel", - callback = "transform_fun(set_val(TRUE))") - ) - ) - ), - mech_vent = list( - class = "fct_cncpt", - target = "win_tbl", - levels = c("invasive", "noninvasive"), - description = "mechanical ventilation windows", - omopid = 4230167L, - category = "respiratory", - sources = list( - aumc = list( - list(ids = c(9328L, 10740L, 12635L), table = "processitems", - sub_var = "itemid", dur_var = "stop", - callback = "apply_map(c(`Beademen` = 'invasive', - `Beademen non-invasief` = 'noninvasive', - `Tracheostoma` = 'invasive'))" - ) - ), - miiv = list( - list(ids = c(225792L, 225794L), table = "procedureevents", - sub_var = "itemid", dur_var = "endtime", - callback = "apply_map(c(`225792` = 'invasive', - `225794` = 'noninvasive'), - var = 'sub_var')") - ), - hirid = list( - list(ids = 15001552L, table = "observations", sub_var = "variableid", - target = "ts_tbl", interval = "00:01:00", class = "hrd_itm", - callback = "combine_callbacks(hirid_vent, - apply_map(c(`1` = 'invasive', - `2` = 'invasive', - `3` = 'noninvasive', - `4` = 'noninvasive', - `5` = 'noninvasive', - `6` = 'noninvasive')))") - ) - ) - ), - ett_gcs = list( - class = "lgl_cncpt", - description = "tracheostomy", - omopid = 4097216L, - category = "respiratory", - target = "win_tbl", - sources = list( - mimic = list( - list(ids = c("1.0 ET/Trach", "No Response-ETT"), table = "chartevents", - sub_var = "value", target = "ts_tbl", - callback = "combine_callbacks( - transform_fun(set_val(TRUE)), - ts_to_win_tbl(mins(1L)) - )") - ), - hirid = list( - list(class = "fun_itm", callback = "combine_callbacks( - fwd_concept('mech_vent'), - transform_fun(comp_na(`==`, 'invasive')) - )") - ), - aumc = list( - list(ids = 6735L, table = "listitems", sub_var = "itemid", - target = "ts_tbl", callback = "combine_callbacks( - transform_fun(comp_na(`==`, 'Geïntubeerd')), - ts_to_win_tbl(mins(1L)) - )") - ), - miiv = list( - list(ids = "No Response-ETT", table = "chartevents", sub_var = "value", - target = "ts_tbl", callback = "combine_callbacks( - transform_fun(set_val(TRUE)), - ts_to_win_tbl(mins(1L)) - )") - ), - eicu = list( - list(class = "fun_itm", callback = "combine_callbacks( - fwd_concept('rass'), - transform_fun(comp_na(`<=`, -3)), - ts_to_win_tbl(mins(360L)) - )") - ) - ) - ), - rass = list( - min = -5, - max = 4, - description = "Richmond agitation sedation scale", - omopid = 36684829L, - category = "neurological", - sources = list( - mimic = list( - list(ids = 228096L, table = "chartevents", sub_var = "itemid") - ), - eicu = list( - list(ids = "Sedation Score", table = "nursecharting", - sub_var = "nursingchartcelltypevalname") - ), - hirid = list( - list(ids = 15001565L, table = "observations", sub_var = "variableid", - callback = "transform_fun(floor)", class = "hrd_itm") - ), - aumc = list( - list(ids = 14444L, sub_var = "itemid", table = "listitems", - callback = "transform_fun(aumc_rass)") - ), - miiv = list( - list(ids = 228096L, table = "chartevents", sub_var = "itemid") - ) - ) - ), - abx = list( - class = "lgl_cncpt", - description = "antibiotics", - omopid = 4085730L, - category = "medications", - sources = list( - mimic = list( - list(regex = paste( - "aztreonam", "bactrim", "cephalexin", "chloramphenicol", "cipro", - "flagyl", "metronidazole", "nitrofurantoin", "tazobactam", - "rifampin", "sulfadiazine", "timentin", "trimethoprim", "(amika", - "gentami", "vanco)cin", "(amoxi", "ampi", "dicloxa", "naf", "oxa", - "peni", "pipera)cillin", "(azithro", "clarithro", "erythro", - "clinda", "strepto", "tobra", "vanco)mycin", "cef(azolin", - "tazidime", "adroxil", "epime", "otetan", "otaxime", "podoxime", - "uroxime)", "(doxy", "mino", "tetra)cycline", "(levofl", "moxifl", - "ofl)oxacin", "macro(bid", "dantin)", "(una", "zo)syn", sep = "|"), - table = "prescriptions", sub_var = "drug", interval = "00:01:00", - callback = "mimic_abx_presc", class = "rgx_itm" - ), - list(ids = c( - 225798L, 225837L, 225838L, 225840L, 225842L, 225843L, 225844L, - 225845L, 225847L, 225848L, 225850L, 225851L, 225853L, 225855L, - 225857L, 225859L, 225860L, 225862L, 225863L, 225865L, 225866L, - 225868L, 225869L, 225871L, 225873L, 225875L, 225876L, 225877L, - 225879L, 225881L, 225882L, 225883L, 225884L, 225885L, 225886L, - 225888L, 225889L, 225890L, 225892L, 225893L, 225895L, 225896L, - 225897L, 225898L, 225899L, 225900L, 225902L, 225903L, 225905L, - 227691L, 228003L), table = "inputevents_mv", sub_var = "itemid", - callback = "transform_fun(set_val(TRUE))" - ) - ), - eicu = list( - list(regex = paste( - "bactrim", "cipro", "flagyl", "metronidazole", "zithromax", "zosyn", - "(((amika", "cleo", "ofloxa)", "(azithro", "clinda", "tobra", - "vanco)my)c", "(ampi", "oxa", "peni", "pipera)cill", "cefazol", - "levaqu", "rifamp)in", sep = "|"), table = "infusiondrug", - sub_var = "drugname", callback = "transform_fun(set_val(TRUE))", - class = "rgx_itm" - ), - list(regex = paste( - "cipro", "flagyl", "maxipime", "metronidazole", "tazobactam", - "zosyn", "cef(azolin", "epime)", "(((azithro", "clinda", "vanco)my", - "ofloxa", "vanco)c", "levaqu", "piperacill", "roceph)in", sep = "|"), - table = "medication", sub_var = "drugname", - callback = "transform_fun(set_val(TRUE))", class = "rgx_itm" - ) - ), - hirid = list( - list(ids = c( - 163L, 176L, 181L, 186L, 189L, 300L, 326L, - 331L, 351L, 405L, 1000234L, 1000272L, 1000273L, 1000274L, - 1000284L, 1000299L, 1000300L, 1000302L, 1000304L, 1000305L, 1000306L, - 1000315L, 1000317L, 1000318L, 1000320L, 1000321L, 1000322L, 1000335L, - 1000348L, 1000352L, 1000363L, 1000365L, 1000390L, 1000407L, 1000408L, - 1000424L, 1000425L, 1000426L, 1000437L, 1000483L, 1000507L, 1000508L, - 1000518L, 1000519L, 1000549L, 1000601L, 1000648L, 1000666L, 1000670L, - 1000671L, 1000760L, 1000781L, 1000791L, 1000797L, 1000812L, 1000825L, - 1000829L, 1000830L, 1000837L, 1000838L, 1000854L, 1000855L, 1000893L, - 1000894L, 1001005L, 1001068L, 1001075L, 1001079L, 1001084L, 1001086L, - 1001095L, 1001096L, 1001097L, 1001098L, 1001168L, 1001169L, 1001170L, - 1001171L, 1001173L, 1001193L, 1001198L), table = "pharma", - sub_var = "pharmaid", callback = "transform_fun(set_val(TRUE))") - ), - aumc = list( - list(ids = c( - 2L, 13L, 19L, 24L, 28L, 29L, 57L, 59L, - 82L, 103L, 240L, 247L, 333L, 1133L, 1199L, 1300L, - 1371L, 1795L, 2284L, 2834L, 3237L, 3741L, 5576L, 6834L, - 6847L, 6871L, 6919L, 6948L, 6953L, 6958L, 7044L, 7064L, - 7185L, 7187L, 7208L, 7227L, 7235L, 8064L, 8394L, 8942L, - 9029L, 9030L, 9052L, 9070L, 9117L, 9128L, 9133L, 9142L, - 9151L, 9152L, 12262L, 12389L, 12398L, 12956L, 12997L, 13057L, - 13094L, 13102L, 15591L, 18860L, 19137L, 19773L, 20563L, 23166L, - 24241L, 25776L, 27617L, 29321L), table = "drugitems", - sub_var = "itemid", callback = "transform_fun(set_val(TRUE))") - ), - miiv = list( - list(regex = paste( - "aztreonam", "bactrim", "cephalexin", "chloramphenicol", "cipro", - "flagyl", "metronidazole", "nitrofurantoin", "tazobactam", - "rifampin", "sulfadiazine", "timentin", "trimethoprim", "(amika", - "gentami", "vanco)cin", "(amoxi", "ampi", "dicloxa", "naf", "oxa", - "peni", "pipera)cillin", "(azithro", "clarithro", "erythro", - "clinda", "strepto", "tobra", "vanco)mycin", "cef(azolin", - "tazidime", "adroxil", "epime", "otetan", "otaxime", "podoxime", - "uroxime)", "(doxy", "mino", "tetra)cycline", "(levofl", "moxifl", - "ofl)oxacin", "macro(bid", "dantin)", "(una", "zo)syn", sep = "|"), - table = "prescriptions", sub_var = "drug", - callback = "transform_fun(set_val(TRUE))", class = "rgx_itm" - ), - list(ids = c( - 225798L, 225837L, 225838L, 225840L, 225842L, 225843L, 225844L, - 225845L, 225847L, 225848L, 225850L, 225851L, 225853L, 225855L, - 225857L, 225859L, 225860L, 225862L, 225863L, 225865L, 225866L, - 225868L, 225869L, 225871L, 225873L, 225875L, 225876L, 225877L, - 225879L, 225881L, 225882L, 225883L, 225884L, 225885L, 225886L, - 225888L, 225889L, 225890L, 225892L, 225893L, 225895L, 225896L, - 225897L, 225898L, 225899L, 225900L, 225902L, 225903L, 225905L, - 227691L, 228003L), table = "inputevents", sub_var = "itemid", - callback = "transform_fun(set_val(TRUE))" - ) - ), - sic = list( - list(ids = c( - 1406L, 1408L, 1410L, 1418L, 1421L, 1422L, - 1423L, 1428L, 1431L, 1433L, 1436L, 1449L, 1454L, - 1457L, 1458L, 1459L, 1460L, 1461L, 1603L, 1795L, - 1913L, 1927L), table = "medication", sub_var = "DrugID", - callback = "transform_fun(set_val(TRUE))" - ) - ) - ) - ), - samp = list( - class = "lgl_cncpt", - category = "microbiology", - description = "body fluid sampling", - omopid = 4133843L, - sources = list( - mimic = list( - list(table = "microbiologyevents", val_var = "org_itemid", - callback = "mimic_sampling", aux_time = "charttime", - class = "col_itm") - ), - eicu = list( - list(table = "microlab", val_var = "organism", - callback = "transform_fun(comp_na(`!=`, 'no growth'))", - class = "col_itm") - ), - aumc = list( - list(ids = c( - 8097L, 8418L, 8588L, 9189L, 9190L, 9191L, 9192L, 9193L, 9194L, - 9195L, 9197L, 9198L, 9200L, 9202L, 9203L, 9204L, 9205L, 13024L, - 19663L, 19664L), table = "procedureorderitems", sub_var = "itemid", - callback = "transform_fun(set_val(TRUE))") - ), - miiv = list( - list(table = "microbiologyevents", val_var = "org_itemid", - callback = "mimic_sampling", aux_time = "charttime", - class = "col_itm") - ) - ) - ), - tri = list( - unit = "ng/mL", - min = 0, - description = "troponin I", - omopid = 4007805L, - category = "chemistry", - sources = list( - mimic = list( - list(ids = 51002L, table = "labevents", sub_var = "itemid") - ), - eicu = list( - list(ids = "troponin - I", table = "lab", sub_var = "labname") - ), - miiv = list( - list(ids = 51002L, table = "labevents", sub_var = "itemid") - ), - sic = list( - list(ids = 270L, table = "laboratory", sub_var = "LaboratoryID") - ) - ) - ), - bili_dir = list( - unit = "mg/dL", - min = 0, - max = 50, - description = "bilirubin direct", - omopid = 4216632L, - category = "chemistry", - sources = list( - mimic = list( - list(ids = 50883L, table = "labevents", sub_var = "itemid") - ), - eicu = list( - list(ids = "direct bilirubin", table = "lab", sub_var = "labname") - ), - hirid = list( - list(ids = 24000560L, table = "observations", sub_var = "variableid", - callback = "convert_unit(binary_op(`*`, 0.058467), 'mg/dL')", - class = "hrd_itm") - ), - aumc = list( - list(ids = 6812L, table = "numericitems", sub_var = "itemid", - callback = "convert_unit(binary_op(`*`, 0.058467), 'mg/dL')") - ), - miiv = list( - list(ids = 50883L, table = "labevents", sub_var = "itemid") - ), - sic = list( - list(ids = 332L, table = "laboratory", sub_var = "LaboratoryID") - ) - ) - ), - temp = list( - unit = c("C", "°C"), - min = 32, - max = 42, - description = "temperature", - omopid = 4302666L, - category = "vitals", - sources = list( - mimic = list( - list(ids = c(676L, 677L, 223762L), table = "chartevents", - sub_var = "itemid"), - list(ids = c(678L, 679L, 223761L, 224027L), table = "chartevents", - sub_var = "itemid", - callback = "convert_unit(fahr_to_cels, 'C', 'f')") - ), - eicu = list( - list(table = "vitalperiodic", val_var = "temperature", - class = "col_itm") - ), - hirid = list( - list(ids = c(410L, 400L, 7100L), table = "observations", - sub_var = "variableid", class = "hrd_itm") - ), - aumc = list( - list(ids = c(8658L, 13952L, 16110L), table = "numericitems", - sub_var = "itemid") - ), - miiv = list( - list(ids = 223762L, table = "chartevents", sub_var = "itemid"), - list(ids = c(223761L, 224027L), table = "chartevents", - sub_var = "itemid", - callback = "convert_unit(fahr_to_cels, 'C', 'f')") - ), - sic = list( - list(ids = 709L, table = "data_float_h", sub_var = "DataID") - ) - ) - ), - etco2 = list( - unit = c("mmHg", "mm Hg"), - min = 10, - max = 60, - description = "endtidal CO2", - omopid = 4353940L, - category = "vitals", - sources = list( - mimic = list( - list(ids = c(1817L, 228640L), table = "chartevents", - sub_var = "itemid") - ), - hirid = list( - list(ids = c(2200L, 8290L, 30010009L), table = "observations", - sub_var = "variableid", class = "hrd_itm") - ), - aumc = list( - list( - ids = c(6707L, 8884L, 8885L, 9658L, 12805L, 12356L), - table = "numericitems", sub_var = "itemid", - callback = "convert_unit(binary_op(`*`, 7.6), 'mmHg', 'None|Geen')" - ) - ), - miiv = list( - list(ids = 228640L, table = "chartevents", sub_var = "itemid") - ) - ) - ), - ins = list( - unit = "units/hr", - min = 0, - description = "insulin", - omopid = 42537007L, - category = "medications", - sources = list( - mimic = list( - list(ids = c(30045L, 30100L), table = "inputevents_cv", - sub_var = "itemid"), - list(ids = c(223258L, 223260L), table = "inputevents_mv", - sub_var = "itemid", val_var = "amount", end_var = "endtime", - callback = "distribute_amount") - ), - eicu = list( - list(regex = "^insulin (250.+)?\\(((ml|units)/hr)?\\)$", - table = "infusiondrug", sub_var = "drugname", class = "rgx_itm") - ), - hirid = list( - list(ids = c(15L, 1000724L), table = "pharma", sub_var = "pharmaid", - callback = "aggregate_fun('sum', 'units')") - ), - aumc = list( - list(ids = c(7624L, 9014L, 19129L), sub_var = "itemid", - table = "drugitems") - ), - miiv = list( - list(ids = c(223258L, 223260L), table = "inputevents", - sub_var = "itemid", val_var = "amount", end_var = "endtime", - callback = "distribute_amount") - ) - ) - ), - sex = list( - target = "id_tbl", - levels = c("Female", "Male"), - class = "fct_cncpt", - description = "patient sex", - omopid = 37116947L, - category = "demographics", - sources = list( - mimic = list( - list(table = "patients", val_var = "gender", - callback = "apply_map(c(M = 'Male', F = 'Female'))", - class = "col_itm") - ), - eicu = list( - list(table = "patient", val_var = "gender", class = "col_itm") - ), - hirid = list( - list(table = "general", val_var = "sex", - callback = "apply_map(c(M = 'Male', F = 'Female'))", - class = "col_itm") - ), - aumc = list( - list(val_var = "gender", table = "admissions", - callback = strip_ws("apply_map(c(Vrouw = 'Female', - Man = 'Male'))"), - class = "col_itm") - ), - miiv = list( - list(table = "patients", val_var = "gender", - callback = "apply_map(c(M = 'Male', F = 'Female'))", - class = "col_itm") - ), - sic = list( - list(table = "cases", val_var = "Sex", - callback = "apply_map(c(`735` = 'Male', `736` = 'Female'))", - class = "col_itm") - ) - ) - ), - age = list( - unit = "years", - min = 0, - max = 100, - target = "id_tbl", - description = "patient age", - omopid = 4314456L, - category = "demographics", - sources = list( - mimic = list( - list(table = "patients", val_var = "dob", - callback = "transform_fun(mimic_age)", class = "col_itm") - ), - eicu = list( - list(table = "patient", val_var = "age", - callback = "transform_fun(eicu_age)", class = "col_itm") - ), - hirid = list( - list(table = "general", val_var = "age", class = "col_itm") - ), - aumc = list( - list(val_var = "agegroup", table = "admissions", - callback = strip_ws("apply_map(c(`18-39` = 30, - `40-49` = 45, - `50-59` = 55, - `60-69` = 65, - `70-79` = 75, - `80+` = 90))"), - class = "col_itm") - ), - miiv = list( - list(table = "patients", val_var = "anchor_age", class = "col_itm") - ), - sic = list( - list(table = "cases", val_var = "AgeOnAdmission", class = "col_itm") - ) - ) - ), - weight = list( - unit = "kg", - min = 1, - max = 500, - target = "id_tbl", - description = "patient weight", - omopid = 4099154L, - category = "demographics", - sources = list( - mimic = list( - list(ids = c(762L, 4183L, 226512L), table = "chartevents", - sub_var = "itemid") - ), - eicu = list( - list(table = "patient", val_var = "admissionweight", - class = "col_itm") - ), - hirid = list( - list(ids = 10000400L, table = "observations", - sub_var = "variableid", class = "hrd_itm") - ), - aumc = list( - list(val_var = "weightgroup", table = "admissions", - callback = strip_ws("apply_map(c(`59-` = 50, - `60-69` = 65, - `70-79` = 75, - `80-89` = 85, - `90-99` = 95, - `100-109` = 105, - `110+` = 120))"), - class = "col_itm") - ), - miiv = list( - list(ids = 226512L, table = "chartevents", sub_var = "itemid") - ), - sic = list( - list(table = "cases", val_var = "WeightOnAdmission", class = "col_itm", - callback = "transform_fun(binary_op(`/`, 1000))") - ) - ) - ), - height = list( - unit = "cm", - min = 10, - max = 230, - target = "id_tbl", - description = "patient height", - omopid = 607590L, - category = "demographics", - sources = list( - mimic = list( - list(ids = c(920L, 1394L, 3485L, 4187L, 4188L, 3486L, 226707L), - table = "chartevents", sub_var = "itemid", - callback = "convert_unit(binary_op(`*`, 2.54), 'cm', '^in')") - ), - eicu = list( - list(table = "patient", val_var = "admissionheight", - class = "col_itm") - ), - hirid = list( - list(ids = 10000450L, table = "observations", - sub_var = "variableid", class = "hrd_itm") - ), - aumc = list( - list(val_var = "heightgroup", table = "admissions", - callback = strip_ws("apply_map(c(`159-` = 150, - `160-169` = 165, - `170-179` = 175, - `180-189` = 185, - `190+` = 200))"), - class = "col_itm") - ), - miiv = list( - list(ids = 226707L, table = "chartevents", sub_var = "itemid", - callback = "convert_unit(binary_op(`*`, 2.54), 'cm', '^in')") - ), - sic = list( - list(table = "cases", val_var = "HeightOnAdmission", class = "col_itm") - ) - ) - ), - death = list( - class = "lgl_cncpt", - description = "in hospital mortality", - omopid = 4306655L, - category = "outcome", - sources = list( - mimic = list( - list(table = "admissions", index_var = "deathtime", - val_var = "hospital_expire_flag", - callback = "transform_fun(comp_na(`==`, 1L))", class = "col_itm") - ), - eicu = list( - list(table = "patient", index_var = "unitdischargeoffset", - val_var = "hospitaldischargestatus", - callback = "transform_fun(comp_na(`==`, 'Expired'))", - class = "col_itm") - ), - hirid = list( - list(ids = c(110L, 200L), table = "observations", - sub_var = "variableid", callback = "hirid_death", - class = "hrd_itm") - ), - aumc = list( - list(table = "admissions", index_var = "dateofdeath", - val_var = "dischargedat", callback = "aumc_death", - class = "col_itm") - ), - miiv = list( - list(table = "admissions", index_var = "deathtime", - val_var = "hospital_expire_flag", - callback = "transform_fun(comp_na(`==`, 1L))", class = "col_itm") - ) - ) - ), - adm = list( - target = "id_tbl", - levels = c("med", "surg", "other"), - class = "fct_cncpt", - description = "patient admission type", - category = "demographics", - sources = list( - mimic = list( - list(table = "services", val_var = "curr_service", - callback = "apply_map( - c(MED = 'med', SURG = 'surg', CMED = 'med', CSURG = 'surg', - VSURG = 'surg', NSURG = 'surg', NB = 'other', NMED = 'med', - ORTHO = 'surg', TRAUM = 'surg', OMED = 'med', GU = 'other', - NBB = 'other', TSURG = 'surg', GYN = 'other', PSURG = 'surg', - OBS = 'other', ENT = 'surg', DENT = 'surg', PSYCH = 'other') - )", - class = "col_itm" - ) - ), - eicu = list( - list(table = "admissiondx", val_var = "admitdxpath", - callback = "eicu_adx", class = "col_itm") - ), - aumc = list( - list(val_var = "specialty", table = "admissions", - callback = strip_ws("apply_map( - c(Cardiochirurgie = 'surg', - Cardiologie = 'med', - ders = 'other', - Gynaecologie = 'other', - `Heelkunde Gastro-enterologie` = 'surg', - `Heelkunde Longen/Oncologie` = 'surg', - `Heelkunde Oncologie` = 'surg', - Hematologie = 'med', - `Intensive Care Volwassenen` = 'other', - Inwendig = 'med', - `Keel, Neus & Oorarts` = 'surg', - Longziekte = 'med', - `Maag-,Darm-,Leverziekten` = 'med', - Mondheelkunde = 'surg', - Nefrologie = 'med', - Neurochirurgie = 'surg', - Neurologie = 'med', - Obstetrie = 'other', - `Oncologie Inwendig` = 'med', - Oogheelkunde = 'surg', - Orthopedie = 'surg', - `Plastische chirurgie` = 'surg', - Reumatologie = 'med', - Traumatologie = 'surg', - Urologie = 'surg', - Vaatchirurgie = 'surg', - Verloskunde = 'other'))"), - class = "col_itm") - ), - miiv = list( - list(table = "services", val_var = "curr_service", - callback = "apply_map( - c(MED = 'med', SURG = 'surg', CMED = 'med', CSURG = 'surg', - VSURG = 'surg', NSURG = 'surg', NB = 'other', NMED = 'med', - ORTHO = 'surg', TRAUM = 'surg', OMED = 'med', GU = 'other', - NBB = 'other', TSURG = 'surg', GYN = 'other', PSURG = 'surg', - OBS = 'other', ENT = 'surg', DENT = 'surg', PSYCH = 'other') - )", - class = "col_itm" - ) - ) - ) - ), - los_icu = list( - unit = "days", - min = 0, - target = "id_tbl", - description = "ICU length of stay", - category = "outcome", - sources = list( - mimic = list( - list(callback = "los_callback", win_type = "icustay", - class = "fun_itm") - ), - eicu = list( - list(callback = "los_callback", win_type = "icustay", - class = "fun_itm") - ), - hirid = list( - list(callback = "los_callback", win_type = "icustay", - class = "fun_itm") - ), - aumc = list( - list(callback = "los_callback", win_type = "icustay", - class = "fun_itm") - ), - miiv = list( - list(callback = "los_callback", win_type = "icustay", - class = "fun_itm") - ) - ) - ), - los_hosp = list( - unit = "days", - min = 0, - target = "id_tbl", - description = "hospital length of stay", - omopid = 462369952L, - category = "outcome", - sources = list( - mimic = list( - list(callback = "los_callback", win_type = "hadm", class = "fun_itm") - ), - eicu = list( - list(callback = "los_callback", win_type = "hadm", class = "fun_itm") - ), - miiv = list( - list(callback = "los_callback", win_type = "hadm", class = "fun_itm") - ) - ) - ), - pafi = list( - concepts = c("po2", "fio2"), - description = "Horowitz index", - omopid = 4233883L, - category = "respiratory", - aggregate = c("min", "max"), - callback = "pafi", - class = "rec_cncpt" - ), - safi = list( - concepts = c("o2sat", "fio2"), - description = "SaO2/FiO2", - category = "respiratory", - aggregate = c("min", "max"), - callback = "safi", - class = "rec_cncpt" - ), - vent_ind = list( - concepts = c("vent_start", "vent_end", "mech_vent"), - description = "ventilation durations", - omopid = 4230167L, - category = "respiratory", - interval = "00:01:00", - callback = "vent_ind", - target = "win_tbl", - class = "rec_cncpt" - ), - vaso_ind = list( - concepts = c("dopa_dur", "norepi_dur", "dobu_dur", "epi_dur"), - description = "vasopressor indicator", - omopid = 3655896L, - category = "medications", - callback = "vaso_ind", - class = "rec_cncpt" - ), - gcs = list( - concepts = c("egcs", "mgcs", "vgcs", "tgcs", "ett_gcs"), - description = "Glasgow coma scale (non-sedated)", - omopid = 4093836L, - category = "neurological", - aggregate = c("min", "min", "min", "min", "any"), - callback = "gcs", - class = "rec_cncpt" - ), - urine24 = list( - concepts = "urine", - description = "urine output per 24h", - omopid = 4191836L, - category = "output", - callback = "urine24", - class = "rec_cncpt" - ), - sofa_resp = list( - concepts = c("pafi", "vent_ind"), - description = "SOFA respiratory component", - omopid = 1616907L, - category = "outcome", - callback = "sofa_resp", - class = "rec_cncpt" - ), - sofa_coag = list( - concepts = "plt", - description = "SOFA coagulation component", - omopid = 1616896L, - category = "outcome", - aggregate = "min", - callback = "sofa_coag", - class = "rec_cncpt" - ), - sofa_liver = list( - concepts = "bili", - description = "SOFA liver component", - omopid = 1617043L, - category = "outcome", - aggregate = "max", - callback = "sofa_liver", - class = "rec_cncpt" - ), - sofa_cardio = list( - concepts = c("map", "dopa60", "norepi60", "dobu60", "epi60"), - description = "SOFA cardiovascular component", - omopid = 1617534L, - category = "outcome", - aggregate = c("min", "max", "max", "max", "max"), - callback = "sofa_cardio", - class = "rec_cncpt" - ), - sofa_cns = list( - concepts = "gcs", - description = "SOFA central nervous system component", - omopid = 1616439L, - category = "outcome", - callback = "sofa_cns", - class = "rec_cncpt" - ), - sofa_renal = list( - concepts = c("crea", "urine24"), - description = "SOFA renal component", - omopid = 1616355L, - category = "outcome", - aggregate = c("max", NA), - callback = "sofa_renal", - class = "rec_cncpt" - ), - sofa = list( - concepts = c("sofa_resp", "sofa_coag", "sofa_liver", "sofa_cardio", - "sofa_cns", "sofa_renal"), - description = "sequential organ failure assessment score", - omopid = 1616852L, - category = "outcome", - callback = "sofa_score", - class = "rec_cncpt" - ), - qsofa = list( - concepts = c("gcs", "sbp", "resp"), - description = "quick SOFA score", - omopid = 1616732L, - category = "outcome", - callback = "qsofa_score", - class = "rec_cncpt" - ), - susp_inf = list( - concepts = c("abx", "samp"), - description = "suspected infection", - omopid = 43021378L, - category = "outcome", - aggregate = lapply(list("sum", FALSE), list), - callback = "susp_inf", - class = "rec_cncpt" - ), - sep3 = list( - concepts = c("sofa", "susp_inf"), - description = "sepsis-3 criterion", - omopid = 132797L, - category = "outcome", - callback = "sep3", - keep_components = c(FALSE, TRUE), - class = "rec_cncpt" - ), - bnd = list( - unit = "%", - description = "band form neutrophils", - omopid = 4100147L, - category = "hematology", - sources = list( - mimic = list( - list(ids = 51144L, table = "labevents", sub_var = "itemid") - ), - eicu = list( - list(ids = "-bands", table = "lab", sub_var = "labname") - ), - hirid = list( - list(ids = 24000557L, table = "observations", sub_var = "variableid", - class = "hrd_itm") - ), - aumc = list( - list(ids = c(6796L, 11586L), table = "numericitems", - sub_var = "itemid") - ), - miiv = list( - list(ids = 51144L, table = "labevents", sub_var = "itemid") - ) - ) - ), - sirs = list( - concepts = c("temp", "hr", "resp", "pco2", "wbc", "bnd"), - description = "systemic inflammatory response syndrome score", - omopid = 4140444L, - category = "outcome", - callback = "sirs_score", - class = "rec_cncpt" - ), - supp_o2 = list( - concepts = c("vent_ind", "fio2"), - description = "supplemental oxygen", - omopid = 36304401L, - category = "respiratory", - callback = "supp_o2", - class = "rec_cncpt" - ), - avpu = list( - concepts = "gcs", - description = "AVPU scale", - omopid = 40493498L, - category = "neurological", - callback = "avpu", - class = "rec_cncpt" - ), - news = list( - concepts = c("resp", "o2sat", "supp_o2", "temp", "sbp", "hr", "avpu"), - description = "national early warning score", - omopid = 44808550, - category = "outcome", - callback = "news_score", - class = "rec_cncpt" - ), - mews = list( - concepts = c("sbp", "hr", "resp", "temp","avpu"), - description = "modified early warning score", - omopid = 40484211L, - category = "outcome", - callback = "mews_score", - class = "rec_cncpt" - ), - hba1c = list( - unit = "%", - description = "Hemoglobin A1C", - omopid = 4184637L, - category = "hematology", - sources = list( - mimic = list( - list(ids = 50852L, table = "labevents", sub_var = "itemid") - ), - aumc = list( - list(ids = c(11812L, 16166L), table = "numericitems", - sub_var = "itemid") - ), - miiv = list( - list(ids = 50852L, table = "labevents", sub_var = "itemid") - ) - ) - ), - bmi = list( - concepts = c("weight", "height"), - description = "patient body mass index", - omopid = 4245997L, - category = "demographics", - callback = "bmi", - target = "id_tbl", - class = "rec_cncpt" - ), - adh_rate = list( - unit = c("units/min", "U/min"), - description = "vasopressin rate", - omopid = 1507835L, - category = "medications", - sources = list( - mimic = list( - list(ids = 30051L, table = "inputevents_cv", sub_var = "itemid", - grp_var = "linkorderid", callback = "combine_callbacks( - convert_unit(binary_op(`/`, 60), 'units/min', 'Uhr'), - mimic_rate_cv - )"), - list(ids = 222315L, table = "inputevents_mv", sub_var = "itemid", - stop_var = "endtime", callback = "combine_callbacks( - convert_unit(binary_op(`/`, 60), 'units/min', 'units/hour'), - mimic_rate_mv - )") - ), - eicu = list( - list(regex = "^vasopressin.*\\(.+/.+\\)$", - table = "infusiondrug", sub_var = "drugname", - callback = "eicu_rate_units(2.65, 0.53)", - class = "rgx_itm") - ), - hirid = list( - list(ids = c(112L, 113L), table = "pharma", sub_var = "pharmaid", - grp_var = "infusionid", callback = "hirid_rate") - ), - aumc = list( - list(ids = 12467L, table = "drugitems", sub_var = "itemid", - rate_uom = "doserateunit", stop_var = "stop", - callback = "aumc_rate_units(0.53)") - ), - miiv = list( - list(ids = 222315L, table = "inputevents", sub_var = "itemid", - stop_var = "endtime", callback = "combine_callbacks( - convert_unit(binary_op(`/`, 60), 'units/min', 'units/hour'), - mimic_rate_mv - )") - ) - ) - ), - phn_rate = list( - unit = "mcg/kg/min", - description = "phenylephrine rate", - omopid = 1135766L, - category = "medications", - sources = list( - mimic = list( - list(ids = 30127L, table = "inputevents_cv", sub_var = "itemid", - grp_var = "linkorderid", callback = "combine_callbacks( - mimic_kg_rate, mimic_rate_cv) - "), - list(ids = 30128L, table = "inputevents_cv", sub_var = "itemid", - grp_var = "linkorderid", callback = "mimic_rate_cv"), - list(ids = 221749L, table = "inputevents_mv", sub_var = "itemid", - stop_var = "endtime", callback = "mimic_rate_mv") - ), - eicu = list( - list(regex = "^phenylephrine.*\\(.+\\)$", table = "infusiondrug", - sub_var = "drugname", weight_var = "patientweight", - callback = "eicu_rate_kg(ml_to_mcg = 200)", class = "rgx_itm") - ), - miiv = list( - list(ids = 221749L, table = "inputevents", sub_var = "itemid", - stop_var = "endtime", callback = "mimic_rate_mv") - ) - ) - ), - norepi_equiv = list( - description = "norepinephrine equivalents", - category = "medications", - concepts = c("epi_rate", "norepi_rate", "dopa_rate", "adh_rate", - "phn_rate"), - callback = "norepi_equiv", - class = "rec_cncpt" - ), - cort = list( - class = "lgl_cncpt", - description = "corticosteroids", - omopid = 304275008L, - category = "medications", - sources = list( - hirid = list( - list(ids = c( 146L, 151L, 1000325L, 1000383L, 1000431L, - 1000432L, 1000433L, 1000434L, 1000435L, 1000486L, - 1000487L, 1000488L, 1000769L, 1000770L, 1000929L), - table = "pharma", sub_var = "pharmaid", - callback = "transform_fun(set_val(TRUE))") - ), - aumc = list( - list(ids = c(6922L, 6995L, 7106L, 8132L, 9042L, 9130L, 10628L), - table = "drugitems", sub_var = "itemid", - callback = "transform_fun(set_val(TRUE))") - ) - ) - ), - dex = list( - min = 0, - unit = "ml/hr", - description = "dextrose (as D10)", - omopid = 4197597L, - category = "medications", - target = "win_tbl", - sources = list( - mimic = list( - list(ids = c(220950L, 228140L, 220952L), table = "inputevents_mv", - sub_var = "itemid", dur_var = "endtime", amount_var = "amount", - auom_var = "amountuom", callback = "combine_callbacks( - mimv_rate, - dex_to_10(c(228140L, 220952L), c(2, 5)) - )"), - list(ids = c(30016L, 30017L), table = "inputevents_cv", - sub_var = "itemid", grp_var = "linkorderid", val_var = "amount", - unit_var = "amountuom", target = "ts_tbl", interval = "00:01:00", - callback = "combine_callbacks( - grp_mount_to_rate(mins(1L), hours(1L)), - dex_to_10(30017L, 2) - )") - ), - eicu = list( - list(regex = "(d50|dextrose.+50 ?%)", table = "medication", - sub_var = "drugname", dur_var = "drugstopoffset", - callback = "eicu_dex_med", class = "rgx_itm"), - list(regex = "(d10|dextrose.+10 ?%).+ml/hr", table = "infusiondrug", - sub_var = "drugname", callback = "eicu_dex_inf", target = "ts_tbl", - class = "rgx_itm") - ), - hirid = list( - list(ids = c(1000022L, 1000690L, 1000689L, 1000544L, 1000746L, - 1000835L, 1000060L, 1000545L, 1000567L), - table = "pharma", sub_var = "pharmaid", grp_var = "infusionid", - target = "ts_tbl", interval = "00:01:00", - callback = "combine_callbacks( - grp_mount_to_rate(mins(1L), hours(1L)), - dex_to_10(list(c(1000689L, 1000544L, 1000746L, 1000835L), - 1000060L, 1000545L, 1000567L), c(2, 3, 4, 5)) - )") - ), - aumc = list( - list(ids = c(7254L, 7255L, 7256L, 8940L, 9571L), table = "drugitems", - sub_var = "itemid", dur_var = "stop", rate_var = "doserateunit", - callback = "combine_callbacks( - aumc_rate, - dex_to_10(list(7255L, 7256L, c(8940L, 9571L)), - c(2, 3, 4)) - )" - ) - ), - miiv = list( - list(ids = c(220950L, 228140L, 220952L), table = "inputevents", - sub_var = "itemid", dur_var = "endtime", amount_var = "amount", - auom_var = "amountuom", callback = "combine_callbacks( - mimv_rate, - dex_to_10(c(228140L, 220952L), c(2, 5)) - )") - ) - ), - class = c("unt_cncpt", "num_cncpt") - ) -) - -cfg <- lapply(cfg, function(x) { - - if ("sources" %in% names(x)) { - - if ("mimic" %in% names(x[["sources"]])) - x[["sources"]] <- c(x[["sources"]], - mimic_demo = list(x[["sources"]][["mimic"]])) - - if ("eicu" %in% names(x[["sources"]])) - x[["sources"]] <- c(x[["sources"]], - eicu_demo = list(x[["sources"]][["eicu"]])) - - x[["sources"]] <- x[["sources"]][order(names(x[["sources"]]))] - } - - x -}) - - -pkg_dir <- rprojroot::find_root(rprojroot::is_r_package) -cfg_dir <- file.path(pkg_dir, "inst", "extdata", "config") - -ricu::set_config(cfg[order(names(cfg))], "concept-dict", cfg_dir) - -devtools::install(pkg_dir) diff --git a/inst/extdata/config/concept-dict.json b/inst/extdata/config/concept-dict.json deleted file mode 100644 index 09084942..00000000 --- a/inst/extdata/config/concept-dict.json +++ /dev/null @@ -1,6591 +0,0 @@ -{ - "abx": { - "class": "lgl_cncpt", - "description": "antibiotics", - "omopid": 4085730, - "category": "medications", - "sources": { - "aumc": [ - { - "ids": [2, 13, 19, 24, 28, 29, 57, 59, 82, 103, 240, 247, 333, 1133, 1199, 1300, 1371, 1795, 2284, 2834, 3237, 3741, 5576, 6834, 6847, 6871, 6919, 6948, 6953, 6958, 7044, 7064, 7185, 7187, 7208, 7227, 7235, 8064, 8394, 8942, 9029, 9030, 9052, 9070, 9117, 9128, 9133, 9142, 9151, 9152, 12262, 12389, 12398, 12956, 12997, 13057, 13094, 13102, 15591, 18860, 19137, 19773, 20563, 23166, 24241, 25776, 27617, 29321], - "table": "drugitems", - "sub_var": "itemid", - "callback": "transform_fun(set_val(TRUE))" - } - ], - "eicu": [ - { - "regex": "bactrim|cipro|flagyl|metronidazole|zithromax|zosyn|(((amika|cleo|ofloxa)|(azithro|clinda|tobra|vanco)my)c|(ampi|oxa|peni|pipera)cill|cefazol|levaqu|rifamp)in", - "table": "infusiondrug", - "sub_var": "drugname", - "callback": "transform_fun(set_val(TRUE))", - "class": "rgx_itm" - }, - { - "regex": "cipro|flagyl|maxipime|metronidazole|tazobactam|zosyn|cef(azolin|epime)|(((azithro|clinda|vanco)my|ofloxa|vanco)c|levaqu|piperacill|roceph)in", - "table": "medication", - "sub_var": "drugname", - "callback": "transform_fun(set_val(TRUE))", - "class": "rgx_itm" - } - ], - "eicu_demo": [ - { - "regex": "bactrim|cipro|flagyl|metronidazole|zithromax|zosyn|(((amika|cleo|ofloxa)|(azithro|clinda|tobra|vanco)my)c|(ampi|oxa|peni|pipera)cill|cefazol|levaqu|rifamp)in", - "table": "infusiondrug", - "sub_var": "drugname", - "callback": "transform_fun(set_val(TRUE))", - "class": "rgx_itm" - }, - { - "regex": "cipro|flagyl|maxipime|metronidazole|tazobactam|zosyn|cef(azolin|epime)|(((azithro|clinda|vanco)my|ofloxa|vanco)c|levaqu|piperacill|roceph)in", - "table": "medication", - "sub_var": "drugname", - "callback": "transform_fun(set_val(TRUE))", - "class": "rgx_itm" - } - ], - "hirid": [ - { - "ids": [163, 176, 181, 186, 189, 300, 326, 331, 351, 405, 1000234, 1000272, 1000273, 1000274, 1000284, 1000299, 1000300, 1000302, 1000304, 1000305, 1000306, 1000315, 1000317, 1000318, 1000320, 1000321, 1000322, 1000335, 1000348, 1000352, 1000363, 1000365, 1000390, 1000407, 1000408, 1000424, 1000425, 1000426, 1000437, 1000483, 1000507, 1000508, 1000518, 1000519, 1000549, 1000601, 1000648, 1000666, 1000670, 1000671, 1000760, 1000781, 1000791, 1000797, 1000812, 1000825, 1000829, 1000830, 1000837, 1000838, 1000854, 1000855, 1000893, 1000894, 1001005, 1001068, 1001075, 1001079, 1001084, 1001086, 1001095, 1001096, 1001097, 1001098, 1001168, 1001169, 1001170, 1001171, 1001173, 1001193, 1001198], - "table": "pharma", - "sub_var": "pharmaid", - "callback": "transform_fun(set_val(TRUE))" - } - ], - "miiv": [ - { - "regex": "aztreonam|bactrim|cephalexin|chloramphenicol|cipro|flagyl|metronidazole|nitrofurantoin|tazobactam|rifampin|sulfadiazine|timentin|trimethoprim|(amika|gentami|vanco)cin|(amoxi|ampi|dicloxa|naf|oxa|peni|pipera)cillin|(azithro|clarithro|erythro|clinda|strepto|tobra|vanco)mycin|cef(azolin|tazidime|adroxil|epime|otetan|otaxime|podoxime|uroxime)|(doxy|mino|tetra)cycline|(levofl|moxifl|ofl)oxacin|macro(bid|dantin)|(una|zo)syn", - "table": "prescriptions", - "sub_var": "drug", - "callback": "transform_fun(set_val(TRUE))", - "class": "rgx_itm" - }, - { - "ids": [225798, 225837, 225838, 225840, 225842, 225843, 225844, 225845, 225847, 225848, 225850, 225851, 225853, 225855, 225857, 225859, 225860, 225862, 225863, 225865, 225866, 225868, 225869, 225871, 225873, 225875, 225876, 225877, 225879, 225881, 225882, 225883, 225884, 225885, 225886, 225888, 225889, 225890, 225892, 225893, 225895, 225896, 225897, 225898, 225899, 225900, 225902, 225903, 225905, 227691, 228003], - "table": "inputevents", - "sub_var": "itemid", - "callback": "transform_fun(set_val(TRUE))" - } - ], - "mimic": [ - { - "regex": "aztreonam|bactrim|cephalexin|chloramphenicol|cipro|flagyl|metronidazole|nitrofurantoin|tazobactam|rifampin|sulfadiazine|timentin|trimethoprim|(amika|gentami|vanco)cin|(amoxi|ampi|dicloxa|naf|oxa|peni|pipera)cillin|(azithro|clarithro|erythro|clinda|strepto|tobra|vanco)mycin|cef(azolin|tazidime|adroxil|epime|otetan|otaxime|podoxime|uroxime)|(doxy|mino|tetra)cycline|(levofl|moxifl|ofl)oxacin|macro(bid|dantin)|(una|zo)syn", - "table": "prescriptions", - "sub_var": "drug", - "interval": "00:01:00", - "callback": "mimic_abx_presc", - "class": "rgx_itm" - }, - { - "ids": [225798, 225837, 225838, 225840, 225842, 225843, 225844, 225845, 225847, 225848, 225850, 225851, 225853, 225855, 225857, 225859, 225860, 225862, 225863, 225865, 225866, 225868, 225869, 225871, 225873, 225875, 225876, 225877, 225879, 225881, 225882, 225883, 225884, 225885, 225886, 225888, 225889, 225890, 225892, 225893, 225895, 225896, 225897, 225898, 225899, 225900, 225902, 225903, 225905, 227691, 228003], - "table": "inputevents_mv", - "sub_var": "itemid", - "callback": "transform_fun(set_val(TRUE))" - } - ], - "mimic_demo": [ - { - "regex": "aztreonam|bactrim|cephalexin|chloramphenicol|cipro|flagyl|metronidazole|nitrofurantoin|tazobactam|rifampin|sulfadiazine|timentin|trimethoprim|(amika|gentami|vanco)cin|(amoxi|ampi|dicloxa|naf|oxa|peni|pipera)cillin|(azithro|clarithro|erythro|clinda|strepto|tobra|vanco)mycin|cef(azolin|tazidime|adroxil|epime|otetan|otaxime|podoxime|uroxime)|(doxy|mino|tetra)cycline|(levofl|moxifl|ofl)oxacin|macro(bid|dantin)|(una|zo)syn", - "table": "prescriptions", - "sub_var": "drug", - "interval": "00:01:00", - "callback": "mimic_abx_presc", - "class": "rgx_itm" - }, - { - "ids": [225798, 225837, 225838, 225840, 225842, 225843, 225844, 225845, 225847, 225848, 225850, 225851, 225853, 225855, 225857, 225859, 225860, 225862, 225863, 225865, 225866, 225868, 225869, 225871, 225873, 225875, 225876, 225877, 225879, 225881, 225882, 225883, 225884, 225885, 225886, 225888, 225889, 225890, 225892, 225893, 225895, 225896, 225897, 225898, 225899, 225900, 225902, 225903, 225905, 227691, 228003], - "table": "inputevents_mv", - "sub_var": "itemid", - "callback": "transform_fun(set_val(TRUE))" - } - ], - "sic": [ - { - "ids": [1406, 1408, 1410, 1418, 1421, 1422, 1423, 1428, 1431, 1433, 1436, 1449, 1454, 1457, 1458, 1459, 1460, 1461, 1603, 1795, 1913, 1927], - "table": "medication", - "sub_var": "DrugID", - "callback": "transform_fun(set_val(TRUE))" - } - ] - } - }, - "adh_rate": { - "unit": ["units/min", "U/min"], - "description": "vasopressin rate", - "omopid": 1507835, - "category": "medications", - "sources": { - "aumc": [ - { - "ids": 12467, - "table": "drugitems", - "sub_var": "itemid", - "rate_uom": "doserateunit", - "stop_var": "stop", - "callback": "aumc_rate_units(0.53)" - } - ], - "eicu": [ - { - "regex": "^vasopressin.*\\(.+/.+\\)$", - "table": "infusiondrug", - "sub_var": "drugname", - "callback": "eicu_rate_units(2.65, 0.53)", - "class": "rgx_itm" - } - ], - "eicu_demo": [ - { - "regex": "^vasopressin.*\\(.+/.+\\)$", - "table": "infusiondrug", - "sub_var": "drugname", - "callback": "eicu_rate_units(2.65, 0.53)", - "class": "rgx_itm" - } - ], - "hirid": [ - { - "ids": [112, 113], - "table": "pharma", - "sub_var": "pharmaid", - "grp_var": "infusionid", - "callback": "hirid_rate" - } - ], - "miiv": [ - { - "ids": 222315, - "table": "inputevents", - "sub_var": "itemid", - "stop_var": "endtime", - "callback": "combine_callbacks(\n convert_unit(binary_op(`/`, 60), 'units/min', 'units/hour'),\n mimic_rate_mv\n )" - } - ], - "mimic": [ - { - "ids": 30051, - "table": "inputevents_cv", - "sub_var": "itemid", - "grp_var": "linkorderid", - "callback": "combine_callbacks(\n convert_unit(binary_op(`/`, 60), 'units/min', 'Uhr'),\n mimic_rate_cv\n )" - }, - { - "ids": 222315, - "table": "inputevents_mv", - "sub_var": "itemid", - "stop_var": "endtime", - "callback": "combine_callbacks(\n convert_unit(binary_op(`/`, 60), 'units/min', 'units/hour'),\n mimic_rate_mv\n )" - } - ], - "mimic_demo": [ - { - "ids": 30051, - "table": "inputevents_cv", - "sub_var": "itemid", - "grp_var": "linkorderid", - "callback": "combine_callbacks(\n convert_unit(binary_op(`/`, 60), 'units/min', 'Uhr'),\n mimic_rate_cv\n )" - }, - { - "ids": 222315, - "table": "inputevents_mv", - "sub_var": "itemid", - "stop_var": "endtime", - "callback": "combine_callbacks(\n convert_unit(binary_op(`/`, 60), 'units/min', 'units/hour'),\n mimic_rate_mv\n )" - } - ] - } - }, - "adm": { - "target": "id_tbl", - "levels": ["med", "surg", "other"], - "class": "fct_cncpt", - "description": "patient admission type", - "category": "demographics", - "sources": { - "aumc": [ - { - "val_var": "specialty", - "table": "admissions", - "callback": "apply_map( c(Cardiochirurgie = 'surg', Cardiologie = 'med', ders = 'other', Gynaecologie = 'other', `Heelkunde Gastro-enterologie` = 'surg', `Heelkunde Longen/Oncologie` = 'surg', `Heelkunde Oncologie` = 'surg', Hematologie = 'med', `Intensive Care Volwassenen` = 'other', Inwendig = 'med', `Keel, Neus & Oorarts` = 'surg', Longziekte = 'med', `Maag-,Darm-,Leverziekten` = 'med', Mondheelkunde = 'surg', Nefrologie = 'med', Neurochirurgie = 'surg', Neurologie = 'med', Obstetrie = 'other', `Oncologie Inwendig` = 'med', Oogheelkunde = 'surg', Orthopedie = 'surg', `Plastische chirurgie` = 'surg', Reumatologie = 'med', Traumatologie = 'surg', Urologie = 'surg', Vaatchirurgie = 'surg', Verloskunde = 'other'))", - "class": "col_itm" - } - ], - "eicu": [ - { - "table": "admissiondx", - "val_var": "admitdxpath", - "callback": "eicu_adx", - "class": "col_itm" - } - ], - "eicu_demo": [ - { - "table": "admissiondx", - "val_var": "admitdxpath", - "callback": "eicu_adx", - "class": "col_itm" - } - ], - "miiv": [ - { - "table": "services", - "val_var": "curr_service", - "callback": "apply_map(\n c(MED = 'med', SURG = 'surg', CMED = 'med', CSURG = 'surg',\n VSURG = 'surg', NSURG = 'surg', NB = 'other', NMED = 'med',\n ORTHO = 'surg', TRAUM = 'surg', OMED = 'med', GU = 'other',\n NBB = 'other', TSURG = 'surg', GYN = 'other', PSURG = 'surg',\n OBS = 'other', ENT = 'surg', DENT = 'surg', PSYCH = 'other')\n )", - "class": "col_itm" - } - ], - "mimic": [ - { - "table": "services", - "val_var": "curr_service", - "callback": "apply_map(\n c(MED = 'med', SURG = 'surg', CMED = 'med', CSURG = 'surg',\n VSURG = 'surg', NSURG = 'surg', NB = 'other', NMED = 'med',\n ORTHO = 'surg', TRAUM = 'surg', OMED = 'med', GU = 'other',\n NBB = 'other', TSURG = 'surg', GYN = 'other', PSURG = 'surg',\n OBS = 'other', ENT = 'surg', DENT = 'surg', PSYCH = 'other')\n )", - "class": "col_itm" - } - ], - "mimic_demo": [ - { - "table": "services", - "val_var": "curr_service", - "callback": "apply_map(\n c(MED = 'med', SURG = 'surg', CMED = 'med', CSURG = 'surg',\n VSURG = 'surg', NSURG = 'surg', NB = 'other', NMED = 'med',\n ORTHO = 'surg', TRAUM = 'surg', OMED = 'med', GU = 'other',\n NBB = 'other', TSURG = 'surg', GYN = 'other', PSURG = 'surg',\n OBS = 'other', ENT = 'surg', DENT = 'surg', PSYCH = 'other')\n )", - "class": "col_itm" - } - ] - } - }, - "age": { - "unit": "years", - "min": 0, - "max": 100, - "target": "id_tbl", - "description": "patient age", - "omopid": 4314456, - "category": "demographics", - "sources": { - "aumc": [ - { - "val_var": "agegroup", - "table": "admissions", - "callback": "apply_map(c(`18-39` = 30, `40-49` = 45, `50-59` = 55, `60-69` = 65, `70-79` = 75, `80+` = 90))", - "class": "col_itm" - } - ], - "eicu": [ - { - "table": "patient", - "val_var": "age", - "callback": "transform_fun(eicu_age)", - "class": "col_itm" - } - ], - "eicu_demo": [ - { - "table": "patient", - "val_var": "age", - "callback": "transform_fun(eicu_age)", - "class": "col_itm" - } - ], - "hirid": [ - { - "table": "general", - "val_var": "age", - "class": "col_itm" - } - ], - "miiv": [ - { - "table": "patients", - "val_var": "anchor_age", - "class": "col_itm" - } - ], - "mimic": [ - { - "table": "patients", - "val_var": "dob", - "callback": "transform_fun(mimic_age)", - "class": "col_itm" - } - ], - "mimic_demo": [ - { - "table": "patients", - "val_var": "dob", - "callback": "transform_fun(mimic_age)", - "class": "col_itm" - } - ], - "sic": [ - { - "table": "cases", - "val_var": "AgeOnAdmission", - "class": "col_itm" - } - ] - } - }, - "alb": { - "unit": "g/dL", - "min": 0, - "max": 6, - "description": "albumin", - "omopid": 4017497, - "category": "chemistry", - "sources": { - "aumc": [ - { - "ids": [6801, 9937], - "table": "numericitems", - "sub_var": "itemid", - "callback": "convert_unit(binary_op(`*`, 0.1), 'g/dL')" - } - ], - "eicu": [ - { - "ids": "albumin", - "table": "lab", - "sub_var": "labname" - } - ], - "eicu_demo": [ - { - "ids": "albumin", - "table": "lab", - "sub_var": "labname" - } - ], - "hirid": [ - { - "ids": 24000605, - "table": "observations", - "sub_var": "variableid", - "callback": "convert_unit(binary_op(`*`, 0.1), 'g/dL')", - "class": "hrd_itm" - } - ], - "miiv": [ - { - "ids": 50862, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic": [ - { - "ids": 50862, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic_demo": [ - { - "ids": 50862, - "table": "labevents", - "sub_var": "itemid" - } - ], - "sic": [ - { - "ids": 287, - "table": "laboratory", - "sub_var": "LaboratoryID" - } - ] - } - }, - "alp": { - "unit": ["IU/L", "U/l"], - "min": 0, - "description": "alkaline phosphatase", - "omopid": 4275206, - "category": "chemistry", - "sources": { - "aumc": [ - { - "ids": [6803, 11984], - "table": "numericitems", - "sub_var": "itemid" - } - ], - "eicu": [ - { - "ids": "alkaline phos.", - "table": "lab", - "sub_var": "labname" - } - ], - "eicu_demo": [ - { - "ids": "alkaline phos.", - "table": "lab", - "sub_var": "labname" - } - ], - "hirid": [ - { - "ids": 20002700, - "table": "observations", - "sub_var": "variableid", - "class": "hrd_itm" - } - ], - "miiv": [ - { - "ids": 50863, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic": [ - { - "ids": 50863, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic_demo": [ - { - "ids": 50863, - "table": "labevents", - "sub_var": "itemid" - } - ], - "sic": [ - { - "ids": 609, - "table": "laboratory", - "sub_var": "LaboratoryID" - } - ] - } - }, - "alt": { - "unit": ["IU/L", "U/l"], - "min": 0, - "description": "alanine aminotransferase", - "omopid": 4146380, - "category": "chemistry", - "sources": { - "aumc": [ - { - "ids": [6800, 11978], - "table": "numericitems", - "sub_var": "itemid" - } - ], - "eicu": [ - { - "ids": "ALT (SGPT)", - "table": "lab", - "sub_var": "labname" - } - ], - "eicu_demo": [ - { - "ids": "ALT (SGPT)", - "table": "lab", - "sub_var": "labname" - } - ], - "hirid": [ - { - "ids": 20002600, - "table": "observations", - "sub_var": "variableid", - "class": "hrd_itm" - } - ], - "miiv": [ - { - "ids": 50861, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic": [ - { - "ids": 50861, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic_demo": [ - { - "ids": 50861, - "table": "labevents", - "sub_var": "itemid" - } - ], - "sic": [ - { - "ids": 617, - "table": "laboratory", - "sub_var": "LaboratoryID" - } - ] - } - }, - "ast": { - "unit": ["IU/L", "U/l"], - "min": 0, - "description": "aspartate aminotransferase", - "omopid": 4263457, - "category": "chemistry", - "sources": { - "aumc": [ - { - "ids": [6806, 11990], - "table": "numericitems", - "sub_var": "itemid" - } - ], - "eicu": [ - { - "ids": "AST (SGOT)", - "table": "lab", - "sub_var": "labname" - } - ], - "eicu_demo": [ - { - "ids": "AST (SGOT)", - "table": "lab", - "sub_var": "labname" - } - ], - "hirid": [ - { - "ids": 24000330, - "table": "observations", - "sub_var": "variableid", - "class": "hrd_itm" - } - ], - "miiv": [ - { - "ids": 50878, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic": [ - { - "ids": 50878, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic_demo": [ - { - "ids": 50878, - "table": "labevents", - "sub_var": "itemid" - } - ], - "sic": [ - { - "ids": 616, - "table": "laboratory", - "sub_var": "LaboratoryID" - } - ] - } - }, - "avpu": { - "concepts": "gcs", - "description": "AVPU scale", - "omopid": 40493498, - "category": "neurological", - "callback": "avpu", - "class": "rec_cncpt" - }, - "basos": { - "unit": "%", - "min": 0, - "max": 50, - "description": "basophils", - "omopid": 4172647, - "category": "hematology", - "sources": { - "aumc": [ - { - "ids": 11710, - "table": "numericitems", - "sub_var": "itemid" - }, - { - "ids": 14256, - "table": "numericitems", - "sub_var": "itemid", - "callback": "blood_cell_ratio" - } - ], - "eicu": [ - { - "ids": "-basos", - "table": "lab", - "sub_var": "labname" - } - ], - "eicu_demo": [ - { - "ids": "-basos", - "table": "lab", - "sub_var": "labname" - } - ], - "miiv": [ - { - "ids": 51146, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic": [ - { - "ids": 51146, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic_demo": [ - { - "ids": 51146, - "table": "labevents", - "sub_var": "itemid" - } - ], - "sic": [ - { - "ids": 174, - "table": "laboratory", - "sub_var": "LaboratoryID" - } - ] - } - }, - "be": { - "unit": ["mEq/L", "mmol/l"], - "min": -25, - "max": 25, - "description": "base excess", - "omopid": 4284393, - "category": "blood gas", - "sources": { - "aumc": [ - { - "ids": [6807, 9994], - "table": "numericitems", - "sub_var": "itemid", - "dir_var": "tag", - "callback": "aumc_bxs" - } - ], - "eicu": [ - { - "ids": "Base Excess", - "table": "lab", - "sub_var": "labname" - } - ], - "eicu_demo": [ - { - "ids": "Base Excess", - "table": "lab", - "sub_var": "labname" - } - ], - "hirid": [ - { - "ids": 20001300, - "table": "observations", - "sub_var": "variableid", - "class": "hrd_itm" - } - ], - "miiv": [ - { - "ids": 50802, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic": [ - { - "ids": 50802, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic_demo": [ - { - "ids": 50802, - "table": "labevents", - "sub_var": "itemid" - } - ], - "sic": [ - { - "ids": 668, - "table": "laboratory", - "sub_var": "LaboratoryID" - } - ] - } - }, - "bicar": { - "unit": ["mEq/L", "mmol/l"], - "min": 5, - "max": 50, - "description": "bicarbonate", - "omopid": 4194291, - "category": "chemistry", - "sources": { - "aumc": [ - { - "ids": [6810, 9992], - "table": "numericitems", - "sub_var": "itemid" - } - ], - "eicu": [ - { - "ids": "bicarbonate", - "table": "lab", - "sub_var": "labname" - } - ], - "eicu_demo": [ - { - "ids": "bicarbonate", - "table": "lab", - "sub_var": "labname" - } - ], - "hirid": [ - { - "ids": 20004200, - "table": "observations", - "sub_var": "variableid", - "class": "hrd_itm" - } - ], - "miiv": [ - { - "ids": 50882, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic": [ - { - "ids": 50882, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic_demo": [ - { - "ids": 50882, - "table": "labevents", - "sub_var": "itemid" - } - ], - "sic": [ - { - "ids": 456, - "table": "laboratory", - "sub_var": "LaboratoryID" - } - ] - } - }, - "bili": { - "unit": "mg/dL", - "min": 0, - "max": 100, - "description": "total bilirubin", - "omopid": 4118986, - "category": "chemistry", - "sources": { - "aumc": [ - { - "ids": [6813, 9945], - "table": "numericitems", - "sub_var": "itemid", - "callback": "convert_unit(binary_op(`*`, 0.058467), 'mg/dL')" - } - ], - "eicu": [ - { - "ids": "total bilirubin", - "table": "lab", - "sub_var": "labname" - } - ], - "eicu_demo": [ - { - "ids": "total bilirubin", - "table": "lab", - "sub_var": "labname" - } - ], - "hirid": [ - { - "ids": 20004300, - "table": "observations", - "sub_var": "variableid", - "callback": "convert_unit(binary_op(`*`, 0.058467), 'mg/dL')", - "class": "hrd_itm" - } - ], - "miiv": [ - { - "ids": 50885, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic": [ - { - "ids": 50885, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic_demo": [ - { - "ids": 50885, - "table": "labevents", - "sub_var": "itemid" - } - ], - "sic": [ - { - "ids": 333, - "table": "laboratory", - "sub_var": "LaboratoryID" - } - ] - } - }, - "bili_dir": { - "unit": "mg/dL", - "min": 0, - "max": 50, - "description": "bilirubin direct", - "omopid": 4216632, - "category": "chemistry", - "sources": { - "aumc": [ - { - "ids": 6812, - "table": "numericitems", - "sub_var": "itemid", - "callback": "convert_unit(binary_op(`*`, 0.058467), 'mg/dL')" - } - ], - "eicu": [ - { - "ids": "direct bilirubin", - "table": "lab", - "sub_var": "labname" - } - ], - "eicu_demo": [ - { - "ids": "direct bilirubin", - "table": "lab", - "sub_var": "labname" - } - ], - "hirid": [ - { - "ids": 24000560, - "table": "observations", - "sub_var": "variableid", - "callback": "convert_unit(binary_op(`*`, 0.058467), 'mg/dL')", - "class": "hrd_itm" - } - ], - "miiv": [ - { - "ids": 50883, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic": [ - { - "ids": 50883, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic_demo": [ - { - "ids": 50883, - "table": "labevents", - "sub_var": "itemid" - } - ], - "sic": [ - { - "ids": 332, - "table": "laboratory", - "sub_var": "LaboratoryID" - } - ] - } - }, - "bmi": { - "concepts": ["weight", "height"], - "description": "patient body mass index", - "omopid": 4245997, - "category": "demographics", - "callback": "bmi", - "target": "id_tbl", - "class": "rec_cncpt" - }, - "bnd": { - "unit": "%", - "description": "band form neutrophils", - "omopid": 4100147, - "category": "hematology", - "sources": { - "aumc": [ - { - "ids": [6796, 11586], - "table": "numericitems", - "sub_var": "itemid" - } - ], - "eicu": [ - { - "ids": "-bands", - "table": "lab", - "sub_var": "labname" - } - ], - "eicu_demo": [ - { - "ids": "-bands", - "table": "lab", - "sub_var": "labname" - } - ], - "hirid": [ - { - "ids": 24000557, - "table": "observations", - "sub_var": "variableid", - "class": "hrd_itm" - } - ], - "miiv": [ - { - "ids": 51144, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic": [ - { - "ids": 51144, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic_demo": [ - { - "ids": 51144, - "table": "labevents", - "sub_var": "itemid" - } - ] - } - }, - "bun": { - "unit": "mg/dL", - "min": 0, - "max": 200, - "description": "blood urea nitrogen", - "omopid": 4017361, - "category": "chemistry", - "sources": { - "aumc": [ - { - "ids": [6850, 9943], - "table": "numericitems", - "sub_var": "itemid", - "callback": "convert_unit(binary_op(`*`, 2.8), 'mg/dL')" - } - ], - "eicu": [ - { - "ids": "BUN", - "table": "lab", - "sub_var": "labname" - } - ], - "eicu_demo": [ - { - "ids": "BUN", - "table": "lab", - "sub_var": "labname" - } - ], - "hirid": [ - { - "ids": 20004100, - "table": "observations", - "sub_var": "variableid", - "callback": "convert_unit(binary_op(`*`, 2.8), 'mg/dL')", - "class": "hrd_itm" - } - ], - "miiv": [ - { - "ids": 51006, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic": [ - { - "ids": 51006, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic_demo": [ - { - "ids": 51006, - "table": "labevents", - "sub_var": "itemid" - } - ], - "sic": [ - { - "ids": 355, - "table": "laboratory", - "sub_var": "LaboratoryID", - "callback": "transform_fun(binary_op(`*`, 2.14))" - } - ] - } - }, - "ca": { - "unit": "mg/dL", - "min": 4, - "max": 20, - "description": "calcium", - "omopid": 4216722, - "category": "chemistry", - "sources": { - "aumc": [ - { - "ids": [6817, 9933], - "table": "numericitems", - "sub_var": "itemid", - "callback": "convert_unit(binary_op(`*`, 4.008), 'mg/dL')" - } - ], - "eicu": [ - { - "ids": "calcium", - "table": "lab", - "sub_var": "labname", - "callback": "convert_unit(binary_op(`*`, 4), 'mg/dL', 'mmol/l')" - } - ], - "eicu_demo": [ - { - "ids": "calcium", - "table": "lab", - "sub_var": "labname", - "callback": "convert_unit(binary_op(`*`, 4), 'mg/dL', 'mmol/l')" - } - ], - "hirid": [ - { - "ids": 20005100, - "table": "observations", - "sub_var": "variableid", - "callback": "convert_unit(binary_op(`*`, 4.008), 'mg/dL')", - "class": "hrd_itm" - } - ], - "miiv": [ - { - "ids": 50893, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic": [ - { - "ids": 50893, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic_demo": [ - { - "ids": 50893, - "table": "labevents", - "sub_var": "itemid" - } - ], - "sic": [ - { - "ids": 457, - "table": "laboratory", - "sub_var": "LaboratoryID", - "callback": "transform_fun(binary_op(`*`, 4.008))" - } - ] - } - }, - "cai": { - "unit": "mmol/L", - "min": 0.5, - "max": 2, - "description": "calcium ionized", - "omopid": 46272910, - "category": "blood gas", - "sources": { - "aumc": [ - { - "ids": [6815, 8915, 9560, 9561, 10267], - "table": "numericitems", - "sub_var": "itemid" - } - ], - "eicu": [ - { - "ids": "ionized calcium", - "table": "lab", - "sub_var": "labname" - } - ], - "eicu_demo": [ - { - "ids": "ionized calcium", - "table": "lab", - "sub_var": "labname" - } - ], - "hirid": [ - { - "ids": 24000522, - "table": "observations", - "sub_var": "variableid", - "class": "hrd_itm" - } - ], - "miiv": [ - { - "ids": 50808, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic": [ - { - "ids": 50808, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic_demo": [ - { - "ids": 50808, - "table": "labevents", - "sub_var": "itemid" - } - ], - "sic": [ - { - "ids": 655, - "table": "laboratory", - "sub_var": "LaboratoryID" - } - ] - } - }, - "ck": { - "unit": ["IU/L", "U/l"], - "min": 0, - "description": "creatine kinase", - "omopid": 4265595, - "category": "chemistry", - "sources": { - "aumc": [ - { - "ids": [6822, 11998], - "table": "numericitems", - "sub_var": "itemid" - } - ], - "eicu": [ - { - "ids": "CPK", - "table": "lab", - "sub_var": "labname" - } - ], - "eicu_demo": [ - { - "ids": "CPK", - "table": "lab", - "sub_var": "labname" - } - ], - "hirid": [ - { - "ids": 24000210, - "table": "observations", - "sub_var": "variableid", - "class": "hrd_itm" - } - ], - "miiv": [ - { - "ids": 50910, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic": [ - { - "ids": 50910, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic_demo": [ - { - "ids": 50910, - "table": "labevents", - "sub_var": "itemid" - } - ], - "sic": [ - { - "ids": 611, - "table": "laboratory", - "sub_var": "LaboratoryID" - } - ] - } - }, - "ckmb": { - "unit": "ng/mL", - "min": 0, - "description": "creatine kinase MB", - "omopid": 4017058, - "category": "chemistry", - "sources": { - "aumc": [ - { - "ids": 6824, - "table": "numericitems", - "sub_var": "itemid" - } - ], - "eicu": [ - { - "ids": "CPK-MB", - "table": "lab", - "sub_var": "labname" - } - ], - "eicu_demo": [ - { - "ids": "CPK-MB", - "table": "lab", - "sub_var": "labname" - } - ], - "hirid": [ - { - "ids": 24000220, - "table": "observations", - "sub_var": "variableid", - "class": "hrd_itm" - } - ], - "miiv": [ - { - "ids": 50911, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic": [ - { - "ids": 50911, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic_demo": [ - { - "ids": 50911, - "table": "labevents", - "sub_var": "itemid" - } - ], - "sic": [ - { - "ids": 253, - "table": "laboratory", - "sub_var": "LaboratoryID" - } - ] - } - }, - "cl": { - "unit": ["mEq/L", "mmol/l"], - "min": 80, - "max": 130, - "description": "chloride", - "omopid": 4188066, - "category": "chemistry", - "sources": { - "aumc": [ - { - "ids": 9930, - "table": "numericitems", - "sub_var": "itemid" - } - ], - "eicu": [ - { - "ids": "chloride", - "table": "lab", - "sub_var": "labname" - } - ], - "eicu_demo": [ - { - "ids": "chloride", - "table": "lab", - "sub_var": "labname" - } - ], - "hirid": [ - { - "ids": [24000439, 24000521], - "table": "observations", - "sub_var": "variableid", - "class": "hrd_itm" - } - ], - "miiv": [ - { - "ids": 50902, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic": [ - { - "ids": 50902, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic_demo": [ - { - "ids": 50902, - "table": "labevents", - "sub_var": "itemid" - } - ], - "sic": [ - { - "ids": [683, 450], - "table": "laboratory", - "sub_var": "LaboratoryID" - } - ] - } - }, - "cort": { - "class": "lgl_cncpt", - "description": "corticosteroids", - "omopid": 304275008, - "category": "medications", - "sources": { - "aumc": [ - { - "ids": [6922, 6995, 7106, 8132, 9042, 9130, 10628], - "table": "drugitems", - "sub_var": "itemid", - "callback": "transform_fun(set_val(TRUE))" - } - ], - "hirid": [ - { - "ids": [146, 151, 1000325, 1000383, 1000431, 1000432, 1000433, 1000434, 1000435, 1000486, 1000487, 1000488, 1000769, 1000770, 1000929], - "table": "pharma", - "sub_var": "pharmaid", - "callback": "transform_fun(set_val(TRUE))" - } - ] - } - }, - "crea": { - "unit": "mg/dL", - "min": 0, - "max": 15, - "description": "creatinine", - "omopid": 4013964, - "category": "chemistry", - "sources": { - "aumc": [ - { - "ids": [6836, 9941, 14216], - "table": "numericitems", - "sub_var": "itemid", - "callback": "convert_unit(binary_op(`*`, 0.011309), 'mg/dL')" - } - ], - "eicu": [ - { - "ids": "creatinine", - "table": "lab", - "sub_var": "labname" - } - ], - "eicu_demo": [ - { - "ids": "creatinine", - "table": "lab", - "sub_var": "labname" - } - ], - "hirid": [ - { - "ids": 20000600, - "table": "observations", - "sub_var": "variableid", - "callback": "convert_unit(binary_op(`*`, 0.011312), 'mg/dL')", - "class": "hrd_itm" - } - ], - "miiv": [ - { - "ids": 50912, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic": [ - { - "ids": 50912, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic_demo": [ - { - "ids": 50912, - "table": "labevents", - "sub_var": "itemid" - } - ], - "sic": [ - { - "ids": 367, - "table": "laboratory", - "sub_var": "LaboratoryID" - } - ] - } - }, - "crp": { - "unit": "mg/L", - "min": 0, - "description": "C-reactive protein", - "omopid": 4208414, - "category": "chemistry", - "sources": { - "aumc": [ - { - "ids": [6825, 10079], - "table": "numericitems", - "sub_var": "itemid" - } - ], - "eicu": [ - { - "ids": "CRP", - "table": "lab", - "sub_var": "labname", - "callback": "convert_unit(binary_op(`*`, 10), 'mg/L', 'mg/dl')" - } - ], - "eicu_demo": [ - { - "ids": "CRP", - "table": "lab", - "sub_var": "labname", - "callback": "convert_unit(binary_op(`*`, 10), 'mg/L', 'mg/dl')" - } - ], - "hirid": [ - { - "ids": 20002200, - "table": "observations", - "sub_var": "variableid", - "class": "hrd_itm" - } - ], - "miiv": [ - { - "ids": 50889, - "table": "labevents", - "sub_var": "itemid", - "callback": "convert_unit(binary_op(`*`, 10), 'mg/L', 'mg/dl')" - } - ], - "mimic": [ - { - "ids": 50889, - "table": "labevents", - "sub_var": "itemid", - "callback": "convert_unit(binary_op(`*`, 10), 'mg/L', 'mg/dl')" - } - ], - "mimic_demo": [ - { - "ids": 50889, - "table": "labevents", - "sub_var": "itemid", - "callback": "convert_unit(binary_op(`*`, 10), 'mg/L', 'mg/dl')" - } - ] - } - }, - "dbp": { - "unit": ["mmHg", "mm Hg"], - "min": 0, - "max": 200, - "description": "diastolic blood pressure", - "omopid": 4154790, - "category": "vitals", - "sources": { - "aumc": [ - { - "ids": 6643, - "table": "numericitems", - "sub_var": "itemid" - } - ], - "eicu": [ - { - "table": "vitalperiodic", - "val_var": "systemicdiastolic", - "class": "col_itm" - } - ], - "eicu_demo": [ - { - "table": "vitalperiodic", - "val_var": "systemicdiastolic", - "class": "col_itm" - } - ], - "hirid": [ - { - "ids": 120, - "table": "observations", - "sub_var": "variableid", - "class": "hrd_itm" - } - ], - "miiv": [ - { - "ids": [220051, 220180], - "table": "chartevents", - "sub_var": "itemid" - } - ], - "mimic": [ - { - "ids": [8368, 8441, 8555, 220051, 220180], - "table": "chartevents", - "sub_var": "itemid" - } - ], - "mimic_demo": [ - { - "ids": [8368, 8441, 8555, 220051, 220180], - "table": "chartevents", - "sub_var": "itemid" - } - ], - "sic": [ - { - "ids": [702, 705], - "table": "data_float_h", - "sub_var": "DataID" - } - ] - } - }, - "death": { - "class": "lgl_cncpt", - "description": "in hospital mortality", - "omopid": 4306655, - "category": "outcome", - "sources": { - "aumc": [ - { - "table": "admissions", - "index_var": "dateofdeath", - "val_var": "dischargedat", - "callback": "aumc_death", - "class": "col_itm" - } - ], - "eicu": [ - { - "table": "patient", - "index_var": "unitdischargeoffset", - "val_var": "hospitaldischargestatus", - "callback": "transform_fun(comp_na(`==`, 'Expired'))", - "class": "col_itm" - } - ], - "eicu_demo": [ - { - "table": "patient", - "index_var": "unitdischargeoffset", - "val_var": "hospitaldischargestatus", - "callback": "transform_fun(comp_na(`==`, 'Expired'))", - "class": "col_itm" - } - ], - "hirid": [ - { - "ids": [110, 200], - "table": "observations", - "sub_var": "variableid", - "callback": "hirid_death", - "class": "hrd_itm" - } - ], - "miiv": [ - { - "table": "admissions", - "index_var": "deathtime", - "val_var": "hospital_expire_flag", - "callback": "transform_fun(comp_na(`==`, 1L))", - "class": "col_itm" - } - ], - "mimic": [ - { - "table": "admissions", - "index_var": "deathtime", - "val_var": "hospital_expire_flag", - "callback": "transform_fun(comp_na(`==`, 1L))", - "class": "col_itm" - } - ], - "mimic_demo": [ - { - "table": "admissions", - "index_var": "deathtime", - "val_var": "hospital_expire_flag", - "callback": "transform_fun(comp_na(`==`, 1L))", - "class": "col_itm" - } - ] - } - }, - "dex": { - "min": 0, - "unit": "ml/hr", - "description": "dextrose (as D10)", - "omopid": 4197597, - "category": "medications", - "target": "win_tbl", - "sources": { - "aumc": [ - { - "ids": [7254, 7255, 7256, 8940, 9571], - "table": "drugitems", - "sub_var": "itemid", - "dur_var": "stop", - "rate_var": "doserateunit", - "callback": "combine_callbacks(\n aumc_rate,\n dex_to_10(list(7255L, 7256L, c(8940L, 9571L)),\n c(2, 3, 4))\n )" - } - ], - "eicu": [ - { - "regex": "(d50|dextrose.+50 ?%)", - "table": "medication", - "sub_var": "drugname", - "dur_var": "drugstopoffset", - "callback": "eicu_dex_med", - "class": "rgx_itm" - }, - { - "regex": "(d10|dextrose.+10 ?%).+ml/hr", - "table": "infusiondrug", - "sub_var": "drugname", - "callback": "eicu_dex_inf", - "target": "ts_tbl", - "class": "rgx_itm" - } - ], - "eicu_demo": [ - { - "regex": "(d50|dextrose.+50 ?%)", - "table": "medication", - "sub_var": "drugname", - "dur_var": "drugstopoffset", - "callback": "eicu_dex_med", - "class": "rgx_itm" - }, - { - "regex": "(d10|dextrose.+10 ?%).+ml/hr", - "table": "infusiondrug", - "sub_var": "drugname", - "callback": "eicu_dex_inf", - "target": "ts_tbl", - "class": "rgx_itm" - } - ], - "hirid": [ - { - "ids": [1000022, 1000690, 1000689, 1000544, 1000746, 1000835, 1000060, 1000545, 1000567], - "table": "pharma", - "sub_var": "pharmaid", - "grp_var": "infusionid", - "target": "ts_tbl", - "interval": "00:01:00", - "callback": "combine_callbacks(\n grp_mount_to_rate(mins(1L), hours(1L)),\n dex_to_10(list(c(1000689L, 1000544L, 1000746L, 1000835L),\n 1000060L, 1000545L, 1000567L), c(2, 3, 4, 5))\n )" - } - ], - "miiv": [ - { - "ids": [220950, 228140, 220952], - "table": "inputevents", - "sub_var": "itemid", - "dur_var": "endtime", - "amount_var": "amount", - "auom_var": "amountuom", - "callback": "combine_callbacks(\n mimv_rate,\n dex_to_10(c(228140L, 220952L), c(2, 5))\n )" - } - ], - "mimic": [ - { - "ids": [220950, 228140, 220952], - "table": "inputevents_mv", - "sub_var": "itemid", - "dur_var": "endtime", - "amount_var": "amount", - "auom_var": "amountuom", - "callback": "combine_callbacks(\n mimv_rate,\n dex_to_10(c(228140L, 220952L), c(2, 5))\n )" - }, - { - "ids": [30016, 30017], - "table": "inputevents_cv", - "sub_var": "itemid", - "grp_var": "linkorderid", - "val_var": "amount", - "unit_var": "amountuom", - "target": "ts_tbl", - "interval": "00:01:00", - "callback": "combine_callbacks(\n grp_mount_to_rate(mins(1L), hours(1L)),\n dex_to_10(30017L, 2)\n )" - } - ], - "mimic_demo": [ - { - "ids": [220950, 228140, 220952], - "table": "inputevents_mv", - "sub_var": "itemid", - "dur_var": "endtime", - "amount_var": "amount", - "auom_var": "amountuom", - "callback": "combine_callbacks(\n mimv_rate,\n dex_to_10(c(228140L, 220952L), c(2, 5))\n )" - }, - { - "ids": [30016, 30017], - "table": "inputevents_cv", - "sub_var": "itemid", - "grp_var": "linkorderid", - "val_var": "amount", - "unit_var": "amountuom", - "target": "ts_tbl", - "interval": "00:01:00", - "callback": "combine_callbacks(\n grp_mount_to_rate(mins(1L), hours(1L)),\n dex_to_10(30017L, 2)\n )" - } - ] - }, - "class": ["unt_cncpt", "num_cncpt"] - }, - "dobu_dur": { - "description": "dobutamine duration", - "category": "medications", - "aggregate": "max", - "sources": { - "aumc": [ - { - "ids": 7178, - "table": "drugitems", - "sub_var": "itemid", - "stop_var": "stop", - "grp_var": "orderid", - "callback": "aumc_dur" - } - ], - "eicu": [ - { - "regex": "^dobu", - "table": "infusiondrug", - "sub_var": "drugname", - "callback": "eicu_duration(gap_length = hours(5L))", - "class": "rgx_itm" - } - ], - "eicu_demo": [ - { - "regex": "^dobu", - "table": "infusiondrug", - "sub_var": "drugname", - "callback": "eicu_duration(gap_length = hours(5L))", - "class": "rgx_itm" - } - ], - "hirid": [ - { - "ids": 426, - "table": "pharma", - "sub_var": "pharmaid", - "grp_var": "infusionid", - "callback": "hirid_duration" - } - ], - "miiv": [ - { - "ids": 221653, - "table": "inputevents", - "sub_var": "itemid", - "stop_var": "endtime", - "grp_var": "linkorderid", - "callback": "mimic_dur_inmv" - } - ], - "mimic": [ - { - "ids": [30042, 30306], - "table": "inputevents_cv", - "sub_var": "itemid", - "grp_var": "linkorderid", - "callback": "mimic_dur_incv" - }, - { - "ids": 221653, - "table": "inputevents_mv", - "sub_var": "itemid", - "stop_var": "endtime", - "grp_var": "linkorderid", - "callback": "mimic_dur_inmv" - } - ], - "mimic_demo": [ - { - "ids": [30042, 30306], - "table": "inputevents_cv", - "sub_var": "itemid", - "grp_var": "linkorderid", - "callback": "mimic_dur_incv" - }, - { - "ids": 221653, - "table": "inputevents_mv", - "sub_var": "itemid", - "stop_var": "endtime", - "grp_var": "linkorderid", - "callback": "mimic_dur_inmv" - } - ], - "sic": [ - { - "ids": [ - 1559 - ], - "table": "medication", - "sub_var": "DrugID", - "stop_var": "OffsetDrugEnd", - "callback": "sic_dur" - } - ] - } - }, - "dobu_rate": { - "unit": ["mcg/kg/min", "mcgkgmin"], - "min": 0, - "max": 50, - "description": "dobutamine rate", - "omopid": 1337720, - "category": "medications", - "sources": { - "aumc": [ - { - "ids": 7178, - "table": "drugitems", - "sub_var": "itemid", - "rel_weight": "doserateperkg", - "rate_uom": "doserateunit", - "stop_var": "stop", - "callback": "aumc_rate_kg" - } - ], - "eicu": [ - { - "regex": "^dobu.*\\(.+\\)$", - "table": "infusiondrug", - "sub_var": "drugname", - "weight_var": "patientweight", - "callback": "eicu_rate_kg(ml_to_mcg = 2000)", - "class": "rgx_itm" - } - ], - "eicu_demo": [ - { - "regex": "^dobu.*\\(.+\\)$", - "table": "infusiondrug", - "sub_var": "drugname", - "weight_var": "patientweight", - "callback": "eicu_rate_kg(ml_to_mcg = 2000)", - "class": "rgx_itm" - } - ], - "hirid": [ - { - "ids": 426, - "table": "pharma", - "sub_var": "pharmaid", - "grp_var": "infusionid", - "callback": "hirid_rate_kg" - } - ], - "miiv": [ - { - "ids": 221653, - "table": "inputevents", - "sub_var": "itemid", - "stop_var": "endtime", - "callback": "mimic_rate_mv" - } - ], - "mimic": [ - { - "ids": [30042, 30306], - "table": "inputevents_cv", - "sub_var": "itemid", - "grp_var": "linkorderid", - "callback": "mimic_rate_cv" - }, - { - "ids": 221653, - "table": "inputevents_mv", - "sub_var": "itemid", - "stop_var": "endtime", - "callback": "mimic_rate_mv" - } - ], - "mimic_demo": [ - { - "ids": [30042, 30306], - "table": "inputevents_cv", - "sub_var": "itemid", - "grp_var": "linkorderid", - "callback": "mimic_rate_cv" - }, - { - "ids": 221653, - "table": "inputevents_mv", - "sub_var": "itemid", - "stop_var": "endtime", - "callback": "mimic_rate_mv" - } - ], - "sic": [ - { - "ids": 1559, - "table": "medication", - "sub_var": "DrugID", - "val_var": "AmountPerMinute", - "stop_var": "OffsetDrugEnd", - "callback": "sic_rate_kg" - } - ] - } - }, - "dobu60": { - "concepts": ["dobu_rate", "dobu_dur"], - "description": "dobutamine administration for min 1h", - "category": "medications", - "interval": "00:01:00", - "callback": "vaso60", - "class": "rec_cncpt" - }, - "dopa_dur": { - "description": "dopamine duration", - "category": "medications", - "aggregate": "max", - "sources": { - "aumc": [ - { - "ids": 7179, - "table": "drugitems", - "sub_var": "itemid", - "stop_var": "stop", - "grp_var": "orderid", - "callback": "aumc_dur" - } - ], - "eicu": [ - { - "regex": "^dopa", - "table": "infusiondrug", - "sub_var": "drugname", - "callback": "eicu_duration(gap_length = hours(5L))", - "class": "rgx_itm" - } - ], - "eicu_demo": [ - { - "regex": "^dopa", - "table": "infusiondrug", - "sub_var": "drugname", - "callback": "eicu_duration(gap_length = hours(5L))", - "class": "rgx_itm" - } - ], - "miiv": [ - { - "ids": 221662, - "table": "inputevents", - "sub_var": "itemid", - "stop_var": "endtime", - "grp_var": "linkorderid", - "callback": "mimic_dur_inmv" - } - ], - "mimic": [ - { - "ids": [30043, 30125, 30307], - "table": "inputevents_cv", - "sub_var": "itemid", - "grp_var": "linkorderid", - "callback": "mimic_dur_incv" - }, - { - "ids": 221662, - "table": "inputevents_mv", - "sub_var": "itemid", - "stop_var": "endtime", - "grp_var": "linkorderid", - "callback": "mimic_dur_inmv" - } - ], - "mimic_demo": [ - { - "ids": [30043, 30125, 30307], - "table": "inputevents_cv", - "sub_var": "itemid", - "grp_var": "linkorderid", - "callback": "mimic_dur_incv" - }, - { - "ids": 221662, - "table": "inputevents_mv", - "sub_var": "itemid", - "stop_var": "endtime", - "grp_var": "linkorderid", - "callback": "mimic_dur_inmv" - } - ], - "sic": [ - { - "ids": 1618, - "table": "medication", - "sub_var": "DrugID", - "stop_var": "OffsetDrugEnd", - "callback": "sic_dur" - } - ] - } - }, - "dopa_rate": { - "unit": ["mcg/kg/min", "mcgkgmin"], - "min": 0, - "max": 50, - "description": "dopamine rate", - "omopid": 1337860, - "category": "medications", - "sources": { - "aumc": [ - { - "ids": 7179, - "table": "drugitems", - "sub_var": "itemid", - "rel_weight": "doserateperkg", - "rate_uom": "doserateunit", - "stop_var": "stop", - "callback": "aumc_rate_kg" - } - ], - "eicu": [ - { - "regex": "^dopa.*\\(.+\\)$", - "table": "infusiondrug", - "sub_var": "drugname", - "weight_var": "patientweight", - "callback": "eicu_rate_kg(ml_to_mcg = 1600)", - "class": "rgx_itm" - } - ], - "eicu_demo": [ - { - "regex": "^dopa.*\\(.+\\)$", - "table": "infusiondrug", - "sub_var": "drugname", - "weight_var": "patientweight", - "callback": "eicu_rate_kg(ml_to_mcg = 1600)", - "class": "rgx_itm" - } - ], - "miiv": [ - { - "ids": 221662, - "table": "inputevents", - "sub_var": "itemid", - "stop_var": "endtime", - "callback": "mimic_rate_mv" - } - ], - "mimic": [ - { - "ids": [30043, 30125, 30307], - "table": "inputevents_cv", - "sub_var": "itemid", - "grp_var": "linkorderid", - "callback": "mimic_rate_cv" - }, - { - "ids": 221662, - "table": "inputevents_mv", - "sub_var": "itemid", - "stop_var": "endtime", - "callback": "mimic_rate_mv" - } - ], - "mimic_demo": [ - { - "ids": [30043, 30125, 30307], - "table": "inputevents_cv", - "sub_var": "itemid", - "grp_var": "linkorderid", - "callback": "mimic_rate_cv" - }, - { - "ids": 221662, - "table": "inputevents_mv", - "sub_var": "itemid", - "stop_var": "endtime", - "callback": "mimic_rate_mv" - } - ], - "sic": [ - { - "ids": 1618, - "table": "medication", - "sub_var": "DrugID", - "val_var": "AmountPerMinute", - "stop_var": "OffsetDrugEnd", - "callback": "sic_rate_kg" - } - ] - } - }, - "dopa60": { - "concepts": ["dopa_rate", "dopa_dur"], - "description": "dopamine administration for min 1h", - "category": "outcome", - "interval": "00:01:00", - "callback": "vaso60", - "class": "rec_cncpt" - }, - "egcs": { - "min": 1, - "max": 4, - "description": "GCS eye", - "omopid": 4084277, - "category": "neurological", - "sources": { - "aumc": [ - { - "ids": 6732, - "table": "listitems", - "sub_var": "itemid", - "callback": "apply_map( c(`Geen reactie` = 1, `Reactie op pijnprikkel` = 2, `Reactie op verbale prikkel` = 3, `Spontane reactie` = 4) )" - }, - { - "ids": 13077, - "table": "listitems", - "sub_var": "itemid", - "callback": "apply_map( c(`Niet` = 1, `Op pijn` = 2, `Op aanspreken` = 3, `Spontaan` = 4) )" - } - ], - "eicu": [ - { - "ids": "Eyes", - "table": "nursecharting", - "sub_var": "nursingchartcelltypevalname" - } - ], - "eicu_demo": [ - { - "ids": "Eyes", - "table": "nursecharting", - "sub_var": "nursingchartcelltypevalname" - } - ], - "hirid": [ - { - "ids": 10000300, - "table": "observations", - "sub_var": "variableid", - "class": "hrd_itm" - } - ], - "miiv": [ - { - "ids": 220739, - "table": "chartevents", - "sub_var": "itemid" - } - ], - "mimic": [ - { - "ids": [184, 220739], - "table": "chartevents", - "sub_var": "itemid" - } - ], - "mimic_demo": [ - { - "ids": [184, 220739], - "table": "chartevents", - "sub_var": "itemid" - } - ] - } - }, - "eos": { - "unit": "%", - "min": 0, - "max": 50, - "description": "eosinophils", - "omopid": 4216098, - "category": "hematology", - "sources": { - "aumc": [ - { - "ids": 6773, - "table": "numericitems", - "sub_var": "itemid" - }, - { - "ids": 9967, - "table": "numericitems", - "sub_var": "itemid", - "callback": "blood_cell_ratio" - } - ], - "eicu": [ - { - "ids": "-eos", - "table": "lab", - "sub_var": "labname" - } - ], - "eicu_demo": [ - { - "ids": "-eos", - "table": "lab", - "sub_var": "labname" - } - ], - "miiv": [ - { - "ids": 51200, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic": [ - { - "ids": 51200, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic_demo": [ - { - "ids": 51200, - "table": "labevents", - "sub_var": "itemid" - } - ], - "sic": [ - { - "ids": 197, - "table": "laboratory", - "sub_var": "LaboratoryID" - } - ] - } - }, - "epi_dur": { - "description": "epinephrine duration", - "category": "medications", - "aggregate": "max", - "sources": { - "aumc": [ - { - "ids": 6818, - "table": "drugitems", - "sub_var": "itemid", - "stop_var": "stop", - "grp_var": "orderid", - "callback": "aumc_dur" - } - ], - "eicu": [ - { - "regex": "^epi( |n)", - "table": "infusiondrug", - "sub_var": "drugname", - "callback": "eicu_duration(gap_length = hours(5L))", - "class": "rgx_itm" - } - ], - "eicu_demo": [ - { - "regex": "^epi( |n)", - "table": "infusiondrug", - "sub_var": "drugname", - "callback": "eicu_duration(gap_length = hours(5L))", - "class": "rgx_itm" - } - ], - "hirid": [ - { - "ids": [71, 1000649, 1000650, 1000655, 1000750], - "table": "pharma", - "sub_var": "pharmaid", - "grp_var": "infusionid", - "callback": "hirid_duration" - } - ], - "miiv": [ - { - "ids": 221289, - "table": "inputevents", - "sub_var": "itemid", - "stop_var": "endtime", - "grp_var": "linkorderid", - "callback": "mimic_dur_inmv" - } - ], - "mimic": [ - { - "ids": [30044, 30119, 30309], - "table": "inputevents_cv", - "sub_var": "itemid", - "grp_var": "linkorderid", - "callback": "mimic_dur_incv" - }, - { - "ids": 221289, - "table": "inputevents_mv", - "sub_var": "itemid", - "stop_var": "endtime", - "grp_var": "linkorderid", - "callback": "mimic_dur_inmv" - } - ], - "mimic_demo": [ - { - "ids": [30044, 30119, 30309], - "table": "inputevents_cv", - "sub_var": "itemid", - "grp_var": "linkorderid", - "callback": "mimic_dur_incv" - }, - { - "ids": 221289, - "table": "inputevents_mv", - "sub_var": "itemid", - "stop_var": "endtime", - "grp_var": "linkorderid", - "callback": "mimic_dur_inmv" - } - ], - "sic": [ - { - "ids": [ - 1502 - ], - "table": "medication", - "sub_var": "DrugID", - "stop_var": "OffsetDrugEnd", - "callback": "sic_dur" - } - ] - } - }, - "epi_rate": { - "unit": ["mcg/kg/min", "mcgkgmin"], - "min": 0, - "max": 1.5, - "description": "epinephrine rate", - "omopid": 1343916, - "category": "medications", - "sources": { - "aumc": [ - { - "ids": 6818, - "table": "drugitems", - "sub_var": "itemid", - "rel_weight": "doserateperkg", - "rate_uom": "doserateunit", - "stop_var": "stop", - "callback": "aumc_rate_kg" - } - ], - "eicu": [ - { - "regex": "^epi( |n).*\\(.+\\)$", - "table": "infusiondrug", - "sub_var": "drugname", - "weight_var": "patientweight", - "callback": "eicu_rate_kg(ml_to_mcg = 40)", - "class": "rgx_itm" - } - ], - "eicu_demo": [ - { - "regex": "^epi( |n).*\\(.+\\)$", - "table": "infusiondrug", - "sub_var": "drugname", - "weight_var": "patientweight", - "callback": "eicu_rate_kg(ml_to_mcg = 40)", - "class": "rgx_itm" - } - ], - "hirid": [ - { - "ids": [71, 1000649, 1000650, 1000655, 1000750], - "table": "pharma", - "sub_var": "pharmaid", - "grp_var": "infusionid", - "callback": "hirid_rate_kg" - } - ], - "miiv": [ - { - "ids": 221289, - "table": "inputevents", - "sub_var": "itemid", - "stop_var": "endtime", - "callback": "mimic_rate_mv" - } - ], - "mimic": [ - { - "ids": [30044, 30119, 30309], - "table": "inputevents_cv", - "sub_var": "itemid", - "grp_var": "linkorderid", - "callback": "mimic_rate_cv" - }, - { - "ids": 221289, - "table": "inputevents_mv", - "sub_var": "itemid", - "stop_var": "endtime", - "callback": "mimic_rate_mv" - } - ], - "mimic_demo": [ - { - "ids": [30044, 30119, 30309], - "table": "inputevents_cv", - "sub_var": "itemid", - "grp_var": "linkorderid", - "callback": "mimic_rate_cv" - }, - { - "ids": 221289, - "table": "inputevents_mv", - "sub_var": "itemid", - "stop_var": "endtime", - "callback": "mimic_rate_mv" - } - ], - "sic": [ - { - "ids": 1502, - "table": "medication", - "sub_var": "DrugID", - "val_var": "AmountPerMinute", - "stop_var": "OffsetDrugEnd", - "callback": "sic_rate_kg" - } - ] - } - }, - "epi60": { - "concepts": ["epi_rate", "epi_dur"], - "description": "epinephrine administration for min 1h", - "category": "outcome", - "interval": "00:01:00", - "callback": "vaso60", - "class": "rec_cncpt" - }, - "esr": { - "unit": ["mm/hr", "mm/1h"], - "min": 0, - "max": 200, - "description": "erythrocyte sedimentation rate", - "omopid": 4212065, - "category": "hematology", - "sources": { - "aumc": [ - { - "ids": [6808, 11902], - "table": "numericitems", - "sub_var": "itemid" - } - ], - "hirid": [ - { - "ids": 24000668, - "table": "observations", - "sub_var": "variableid", - "class": "hrd_itm" - } - ], - "miiv": [ - { - "ids": 51288, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic": [ - { - "ids": 51288, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic_demo": [ - { - "ids": 51288, - "table": "labevents", - "sub_var": "itemid" - } - ] - } - }, - "etco2": { - "unit": ["mmHg", "mm Hg"], - "min": 10, - "max": 60, - "description": "endtidal CO2", - "omopid": 4353940, - "category": "vitals", - "sources": { - "aumc": [ - { - "ids": [6707, 8884, 8885, 9658, 12805, 12356], - "table": "numericitems", - "sub_var": "itemid", - "callback": "convert_unit(binary_op(`*`, 7.6), 'mmHg', 'None|Geen')" - } - ], - "hirid": [ - { - "ids": [2200, 8290, 30010009], - "table": "observations", - "sub_var": "variableid", - "class": "hrd_itm" - } - ], - "miiv": [ - { - "ids": 228640, - "table": "chartevents", - "sub_var": "itemid" - } - ], - "mimic": [ - { - "ids": [1817, 228640], - "table": "chartevents", - "sub_var": "itemid" - } - ], - "mimic_demo": [ - { - "ids": [1817, 228640], - "table": "chartevents", - "sub_var": "itemid" - } - ] - } - }, - "ett_gcs": { - "class": "lgl_cncpt", - "description": "tracheostomy", - "omopid": 4097216, - "category": "respiratory", - "target": "win_tbl", - "sources": { - "aumc": [ - { - "ids": 6735, - "table": "listitems", - "sub_var": "itemid", - "target": "ts_tbl", - "callback": "combine_callbacks(\n transform_fun(comp_na(`==`, 'Geïntubeerd')),\n ts_to_win_tbl(mins(1L))\n )" - } - ], - "eicu": [ - { - "class": "fun_itm", - "callback": "combine_callbacks(\n fwd_concept('rass'),\n transform_fun(comp_na(`<=`, -3)),\n ts_to_win_tbl(mins(360L))\n )" - } - ], - "eicu_demo": [ - { - "class": "fun_itm", - "callback": "combine_callbacks(\n fwd_concept('rass'),\n transform_fun(comp_na(`<=`, -3)),\n ts_to_win_tbl(mins(360L))\n )" - } - ], - "hirid": [ - { - "class": "fun_itm", - "callback": "combine_callbacks(\n fwd_concept('mech_vent'),\n transform_fun(comp_na(`==`, 'invasive'))\n )" - } - ], - "miiv": [ - { - "ids": "No Response-ETT", - "table": "chartevents", - "sub_var": "value", - "target": "ts_tbl", - "callback": "combine_callbacks(\n transform_fun(set_val(TRUE)),\n ts_to_win_tbl(mins(1L))\n )" - } - ], - "mimic": [ - { - "ids": ["1.0 ET/Trach", "No Response-ETT"], - "table": "chartevents", - "sub_var": "value", - "target": "ts_tbl", - "callback": "combine_callbacks(\n transform_fun(set_val(TRUE)),\n ts_to_win_tbl(mins(1L))\n )" - } - ], - "mimic_demo": [ - { - "ids": ["1.0 ET/Trach", "No Response-ETT"], - "table": "chartevents", - "sub_var": "value", - "target": "ts_tbl", - "callback": "combine_callbacks(\n transform_fun(set_val(TRUE)),\n ts_to_win_tbl(mins(1L))\n )" - } - ] - } - }, - "fgn": { - "unit": "mg/dL", - "min": 0, - "max": 1500, - "description": "fibrinogen", - "omopid": 4094436, - "category": "hematology", - "sources": { - "aumc": [ - { - "ids": [6776, 9989, 10175], - "table": "numericitems", - "sub_var": "itemid", - "callback": "convert_unit(binary_op(`*`, 100), 'mg/dL')" - } - ], - "eicu": [ - { - "ids": "fibrinogen", - "table": "lab", - "sub_var": "labname" - } - ], - "eicu_demo": [ - { - "ids": "fibrinogen", - "table": "lab", - "sub_var": "labname" - } - ], - "hirid": [ - { - "ids": 24000536, - "table": "observations", - "sub_var": "variableid", - "callback": "convert_unit(binary_op(`*`, 100), 'mg/dL')", - "class": "hrd_itm" - } - ], - "miiv": [ - { - "ids": 51214, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic": [ - { - "ids": 51214, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic_demo": [ - { - "ids": 51214, - "table": "labevents", - "sub_var": "itemid" - } - ], - "sic": [ - { - "ids": 344, - "table": "laboratory", - "sub_var": "LaboratoryID" - } - ] - } - }, - "fio2": { - "unit": "%", - "min": 21, - "max": 100, - "description": "fraction of inspired oxygen", - "omopid": 4353936, - "category": "blood gas", - "sources": { - "aumc": [ - { - "ids": 12279, - "table": "numericitems", - "sub_var": "itemid" - } - ], - "eicu": [ - { - "ids": "FiO2", - "table": "respiratorycharting", - "sub_var": "respchartvaluelabel", - "callback": "transform_fun(percent_as_numeric)" - }, - { - "ids": "FiO2", - "table": "lab", - "sub_var": "labname", - "callback": "convert_unit(set_val(NA), '%', 'mm\\\\(hg\\\\)')" - } - ], - "eicu_demo": [ - { - "ids": "FiO2", - "table": "respiratorycharting", - "sub_var": "respchartvaluelabel", - "callback": "transform_fun(percent_as_numeric)" - }, - { - "ids": "FiO2", - "table": "lab", - "sub_var": "labname", - "callback": "convert_unit(set_val(NA), '%', 'mm\\\\(hg\\\\)')" - } - ], - "hirid": [ - { - "ids": 2010, - "table": "observations", - "sub_var": "variableid", - "class": "hrd_itm" - } - ], - "miiv": [ - { - "ids": 223835, - "table": "chartevents", - "sub_var": "itemid" - }, - { - "ids": 50816, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic": [ - { - "ids": [3420, 223835], - "table": "chartevents", - "sub_var": "itemid" - }, - { - "ids": 50816, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic_demo": [ - { - "ids": [3420, 223835], - "table": "chartevents", - "sub_var": "itemid" - }, - { - "ids": 50816, - "table": "labevents", - "sub_var": "itemid" - } - ], - "sic": [ - { - "ids": 2283, - "table": "data_float_h", - "sub_var": "DataID" - } - ] - } - }, - "gcs": { - "concepts": ["egcs", "mgcs", "vgcs", "tgcs", "ett_gcs"], - "description": "Glasgow coma scale (non-sedated)", - "omopid": 4093836, - "category": "neurological", - "aggregate": ["min", "min", "min", "min", "any"], - "callback": "gcs", - "class": "rec_cncpt" - }, - "glu": { - "unit": "mg/dL", - "min": 0, - "max": 1000, - "description": "glucose", - "omopid": 4144235, - "category": "chemistry", - "sources": { - "aumc": [ - { - "ids": [6833, 9557, 9947], - "table": "numericitems", - "sub_var": "itemid", - "callback": "convert_unit(binary_op(`*`, 18.016), 'mg/dL')" - } - ], - "eicu": [ - { - "ids": "glucose", - "table": "lab", - "sub_var": "labname" - }, - { - "ids": "bedside glucose", - "table": "lab", - "sub_var": "labname" - } - ], - "eicu_demo": [ - { - "ids": "glucose", - "table": "lab", - "sub_var": "labname" - }, - { - "ids": "bedside glucose", - "table": "lab", - "sub_var": "labname" - } - ], - "hirid": [ - { - "ids": [20005110, 24000523, 24000585], - "table": "observations", - "sub_var": "variableid", - "callback": "convert_unit(binary_op(`*`, 18.016), 'mg/dL')", - "class": "hrd_itm" - } - ], - "miiv": [ - { - "ids": [50809, 50931], - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic": [ - { - "ids": [50809, 50931], - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic_demo": [ - { - "ids": [50809, 50931], - "table": "labevents", - "sub_var": "itemid" - } - ], - "sic": [ - { - "ids": [348, 656], - "table": "laboratory", - "sub_var": "LaboratoryID" - } - ] - } - }, - "hba1c": { - "unit": "%", - "description": "Hemoglobin A1C", - "omopid": 4184637, - "category": "hematology", - "sources": { - "aumc": [ - { - "ids": [11812, 16166], - "table": "numericitems", - "sub_var": "itemid" - } - ], - "miiv": [ - { - "ids": 50852, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic": [ - { - "ids": 50852, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic_demo": [ - { - "ids": 50852, - "table": "labevents", - "sub_var": "itemid" - } - ] - } - }, - "hbco": { - "description": "carboxyhemoglobin", - "omopid": 4056787, - "category": "blood gas", - "sources": { - "aumc": [ - { - "ids": 11690, - "table": "numericitems", - "sub_var": "itemid" - } - ], - "eicu": [ - { - "ids": "Carboxyhemoglobin", - "table": "lab", - "sub_var": "labname" - } - ], - "eicu_demo": [ - { - "ids": "Carboxyhemoglobin", - "table": "lab", - "sub_var": "labname" - } - ], - "hirid": [ - { - "ids": 24000526, - "table": "observations", - "sub_var": "variableid", - "class": "hrd_itm" - } - ] - } - }, - "hct": { - "unit": "%", - "min": 15, - "max": 60, - "description": "hematocrit", - "omopid": 4151358, - "category": "hematology", - "sources": { - "aumc": [ - { - "ids": [6777, 11423, 11545], - "table": "numericitems", - "sub_var": "itemid", - "callback": "transform_fun(binary_op(`*`, 100))" - } - ], - "eicu": [ - { - "ids": "Hct", - "table": "lab", - "sub_var": "labname" - } - ], - "eicu_demo": [ - { - "ids": "Hct", - "table": "lab", - "sub_var": "labname" - } - ], - "miiv": [ - { - "ids": 51221, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic": [ - { - "ids": 51221, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic_demo": [ - { - "ids": 51221, - "table": "labevents", - "sub_var": "itemid" - } - ], - "sic": [ - { - "ids": [217, 682], - "table": "laboratory", - "sub_var": "LaboratoryID" - } - ] - } - }, - "height": { - "unit": "cm", - "min": 10, - "max": 230, - "target": "id_tbl", - "description": "patient height", - "omopid": 607590, - "category": "demographics", - "sources": { - "aumc": [ - { - "val_var": "heightgroup", - "table": "admissions", - "callback": "apply_map(c(`159-` = 150, `160-169` = 165, `170-179` = 175, `180-189` = 185, `190+` = 200))", - "class": "col_itm" - } - ], - "eicu": [ - { - "table": "patient", - "val_var": "admissionheight", - "class": "col_itm" - } - ], - "eicu_demo": [ - { - "table": "patient", - "val_var": "admissionheight", - "class": "col_itm" - } - ], - "hirid": [ - { - "ids": 10000450, - "table": "observations", - "sub_var": "variableid", - "class": "hrd_itm" - } - ], - "miiv": [ - { - "ids": 226707, - "table": "chartevents", - "sub_var": "itemid", - "callback": "convert_unit(binary_op(`*`, 2.54), 'cm', '^in')" - } - ], - "mimic": [ - { - "ids": [920, 1394, 3485, 4187, 4188, 3486, 226707], - "table": "chartevents", - "sub_var": "itemid", - "callback": "convert_unit(binary_op(`*`, 2.54), 'cm', '^in')" - } - ], - "mimic_demo": [ - { - "ids": [920, 1394, 3485, 4187, 4188, 3486, 226707], - "table": "chartevents", - "sub_var": "itemid", - "callback": "convert_unit(binary_op(`*`, 2.54), 'cm', '^in')" - } - ], - "sic": [ - { - "table": "cases", - "val_var": "HeightOnAdmission", - "class": "col_itm" - } - ] - } - }, - "hgb": { - "unit": "g/dL", - "min": 4, - "max": 18, - "description": "hemoglobin", - "omopid": 4118981, - "category": "hematology", - "sources": { - "aumc": [ - { - "ids": [6778, 9553, 9960, 10286, 19703], - "table": "numericitems", - "sub_var": "itemid", - "callback": "convert_unit(binary_op(`*`, 1.611344), 'g/dL')" - } - ], - "eicu": [ - { - "ids": "Hgb", - "table": "lab", - "sub_var": "labname" - } - ], - "eicu_demo": [ - { - "ids": "Hgb", - "table": "lab", - "sub_var": "labname" - } - ], - "hirid": [ - { - "ids": [24000548, 24000836, 20000900], - "table": "observations", - "sub_var": "variableid", - "callback": "convert_unit(binary_op(`*`, 0.1), 'g/dL', 'g/l')", - "class": "hrd_itm" - } - ], - "miiv": [ - { - "ids": 51222, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic": [ - { - "ids": 51222, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic_demo": [ - { - "ids": 51222, - "table": "labevents", - "sub_var": "itemid" - } - ], - "sic": [ - { - "ids": [658, 289], - "table": "laboratory", - "sub_var": "LaboratoryID" - } - ] - } - }, - "hr": { - "unit": ["bpm", "/min"], - "min": 0, - "max": 300, - "description": "heart rate", - "omopid": 4239408, - "category": "vitals", - "sources": { - "aumc": [ - { - "ids": 6640, - "table": "numericitems", - "sub_var": "itemid" - } - ], - "eicu": [ - { - "table": "vitalperiodic", - "val_var": "heartrate", - "class": "col_itm" - } - ], - "eicu_demo": [ - { - "table": "vitalperiodic", - "val_var": "heartrate", - "class": "col_itm" - } - ], - "hirid": [ - { - "ids": 200, - "table": "observations", - "sub_var": "variableid", - "class": "hrd_itm" - } - ], - "miiv": [ - { - "ids": 220045, - "table": "chartevents", - "sub_var": "itemid" - } - ], - "mimic": [ - { - "ids": [211, 220045], - "table": "chartevents", - "sub_var": "itemid" - } - ], - "mimic_demo": [ - { - "ids": [211, 220045], - "table": "chartevents", - "sub_var": "itemid" - } - ], - "sic": [ - { - "ids": 708, - "table": "data_float_h", - "sub_var": "DataID" - } - ] - } - }, - "inr_pt": { - "description": "prothrombin time/international normalized ratio", - "omopid": 4306239, - "category": "hematology", - "sources": { - "aumc": [ - { - "ids": 11893, - "table": "numericitems", - "sub_var": "itemid" - } - ], - "eicu": [ - { - "ids": "PT - INR", - "table": "lab", - "sub_var": "labname" - } - ], - "eicu_demo": [ - { - "ids": "PT - INR", - "table": "lab", - "sub_var": "labname" - } - ], - "hirid": [ - { - "ids": 24000567, - "table": "observations", - "sub_var": "variableid", - "class": "hrd_itm" - } - ], - "miiv": [ - { - "ids": 51237, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic": [ - { - "ids": 51237, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic_demo": [ - { - "ids": 51237, - "table": "labevents", - "sub_var": "itemid" - } - ] - } - }, - "ins": { - "unit": "units/hr", - "min": 0, - "description": "insulin", - "omopid": 42537007, - "category": "medications", - "sources": { - "aumc": [ - { - "ids": [7624, 9014, 19129], - "sub_var": "itemid", - "table": "drugitems" - } - ], - "eicu": [ - { - "regex": "^insulin (250.+)?\\(((ml|units)/hr)?\\)$", - "table": "infusiondrug", - "sub_var": "drugname", - "class": "rgx_itm" - } - ], - "eicu_demo": [ - { - "regex": "^insulin (250.+)?\\(((ml|units)/hr)?\\)$", - "table": "infusiondrug", - "sub_var": "drugname", - "class": "rgx_itm" - } - ], - "hirid": [ - { - "ids": [15, 1000724], - "table": "pharma", - "sub_var": "pharmaid", - "callback": "aggregate_fun('sum', 'units')" - } - ], - "miiv": [ - { - "ids": [223258, 223260], - "table": "inputevents", - "sub_var": "itemid", - "val_var": "amount", - "end_var": "endtime", - "callback": "distribute_amount" - } - ], - "mimic": [ - { - "ids": [30045, 30100], - "table": "inputevents_cv", - "sub_var": "itemid" - }, - { - "ids": [223258, 223260], - "table": "inputevents_mv", - "sub_var": "itemid", - "val_var": "amount", - "end_var": "endtime", - "callback": "distribute_amount" - } - ], - "mimic_demo": [ - { - "ids": [30045, 30100], - "table": "inputevents_cv", - "sub_var": "itemid" - }, - { - "ids": [223258, 223260], - "table": "inputevents_mv", - "sub_var": "itemid", - "val_var": "amount", - "end_var": "endtime", - "callback": "distribute_amount" - } - ] - } - }, - "k": { - "unit": ["mEq/L", "mmol/l"], - "min": 0, - "max": 10, - "description": "potassium", - "omopid": 4207483, - "category": "chemistry", - "sources": { - "aumc": [ - { - "ids": [6835, 9556, 9927, 10285], - "table": "numericitems", - "sub_var": "itemid" - } - ], - "eicu": [ - { - "ids": "potassium", - "table": "lab", - "sub_var": "labname" - } - ], - "eicu_demo": [ - { - "ids": "potassium", - "table": "lab", - "sub_var": "labname" - } - ], - "hirid": [ - { - "ids": [20000500, 24000520, 24000833, 24000867], - "table": "observations", - "sub_var": "variableid", - "class": "hrd_itm" - } - ], - "miiv": [ - { - "ids": 50971, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic": [ - { - "ids": 50971, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic_demo": [ - { - "ids": 50971, - "table": "labevents", - "sub_var": "itemid" - } - ], - "sic": [ - { - "ids": [463, 685], - "table": "laboratory", - "sub_var": "LaboratoryID" - } - ] - } - }, - "lact": { - "unit": "mmol/L", - "min": 0, - "max": 50, - "description": "lactate", - "omopid": 4191725, - "category": "blood gas", - "sources": { - "aumc": [ - { - "ids": [6837, 9580, 10053], - "table": "numericitems", - "sub_var": "itemid" - } - ], - "eicu": [ - { - "ids": "lactate", - "table": "lab", - "sub_var": "labname" - } - ], - "eicu_demo": [ - { - "ids": "lactate", - "table": "lab", - "sub_var": "labname" - } - ], - "hirid": [ - { - "ids": 24000524, - "table": "observations", - "sub_var": "variableid", - "class": "hrd_itm" - } - ], - "miiv": [ - { - "ids": 50813, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic": [ - { - "ids": 50813, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic_demo": [ - { - "ids": 50813, - "table": "labevents", - "sub_var": "itemid" - } - ], - "sic": [ - { - "ids": [657, 454], - "table": "laboratory", - "sub_var": "LaboratoryID" - } - ] - } - }, - "los_hosp": { - "unit": "days", - "min": 0, - "target": "id_tbl", - "description": "hospital length of stay", - "omopid": 462369952, - "category": "outcome", - "sources": { - "eicu": [ - { - "callback": "los_callback", - "win_type": "hadm", - "class": "fun_itm" - } - ], - "eicu_demo": [ - { - "callback": "los_callback", - "win_type": "hadm", - "class": "fun_itm" - } - ], - "miiv": [ - { - "callback": "los_callback", - "win_type": "hadm", - "class": "fun_itm" - } - ], - "mimic": [ - { - "callback": "los_callback", - "win_type": "hadm", - "class": "fun_itm" - } - ], - "mimic_demo": [ - { - "callback": "los_callback", - "win_type": "hadm", - "class": "fun_itm" - } - ] - } - }, - "los_icu": { - "unit": "days", - "min": 0, - "target": "id_tbl", - "description": "ICU length of stay", - "category": "outcome", - "sources": { - "aumc": [ - { - "callback": "los_callback", - "win_type": "icustay", - "class": "fun_itm" - } - ], - "eicu": [ - { - "callback": "los_callback", - "win_type": "icustay", - "class": "fun_itm" - } - ], - "eicu_demo": [ - { - "callback": "los_callback", - "win_type": "icustay", - "class": "fun_itm" - } - ], - "hirid": [ - { - "callback": "los_callback", - "win_type": "icustay", - "class": "fun_itm" - } - ], - "miiv": [ - { - "callback": "los_callback", - "win_type": "icustay", - "class": "fun_itm" - } - ], - "mimic": [ - { - "callback": "los_callback", - "win_type": "icustay", - "class": "fun_itm" - } - ], - "mimic_demo": [ - { - "callback": "los_callback", - "win_type": "icustay", - "class": "fun_itm" - } - ] - } - }, - "lymph": { - "unit": "%", - "min": 0, - "max": 100, - "description": "lymphocytes", - "omopid": 4254663, - "category": "hematology", - "sources": { - "aumc": [ - { - "ids": 11846, - "table": "numericitems", - "sub_var": "itemid" - }, - { - "ids": 14258, - "table": "numericitems", - "sub_var": "itemid", - "callback": "blood_cell_ratio" - } - ], - "eicu": [ - { - "ids": "-lymphs", - "table": "lab", - "sub_var": "labname" - } - ], - "eicu_demo": [ - { - "ids": "-lymphs", - "table": "lab", - "sub_var": "labname" - } - ], - "hirid": [ - { - "ids": 24000480, - "table": "observations", - "sub_var": "variableid", - "callback": "blood_cell_ratio", - "class": "hrd_itm" - } - ], - "miiv": [ - { - "ids": 51244, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic": [ - { - "ids": 51244, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic_demo": [ - { - "ids": 51244, - "table": "labevents", - "sub_var": "itemid" - } - ], - "sic": [ - { - "ids": 223, - "table": "laboratory", - "sub_var": "LaboratoryID" - } - ] - } - }, - "map": { - "unit": ["mmHg", "mm Hg"], - "min": 0, - "max": 250, - "description": "mean arterial pressure", - "omopid": 4239021, - "category": "vitals", - "sources": { - "aumc": [ - { - "ids": 6642, - "table": "numericitems", - "sub_var": "itemid" - } - ], - "eicu": [ - { - "table": "vitalperiodic", - "val_var": "systemicmean", - "class": "col_itm" - }, - { - "table": "vitalaperiodic", - "val_var": "noninvasivemean", - "class": "col_itm" - } - ], - "eicu_demo": [ - { - "table": "vitalperiodic", - "val_var": "systemicmean", - "class": "col_itm" - }, - { - "table": "vitalaperiodic", - "val_var": "noninvasivemean", - "class": "col_itm" - } - ], - "hirid": [ - { - "ids": [110, 610], - "table": "observations", - "sub_var": "variableid", - "class": "hrd_itm" - } - ], - "miiv": [ - { - "ids": [220052, 220181, 225312], - "table": "chartevents", - "sub_var": "itemid" - } - ], - "mimic": [ - { - "ids": [52, 443, 456, 6072, 220052, 220181, 225312], - "table": "chartevents", - "sub_var": "itemid" - } - ], - "mimic_demo": [ - { - "ids": [52, 443, 456, 6072, 220052, 220181, 225312], - "table": "chartevents", - "sub_var": "itemid" - } - ], - "sic": [ - { - "ids": [703, 706], - "table": "data_float_h", - "sub_var": "DataID" - } - ] - } - }, - "mch": { - "unit": "pg", - "min": 0, - "description": "mean corpuscular hemoglobin", - "omopid": 4182871, - "category": "hematology", - "sources": { - "aumc": [ - { - "ids": 11679, - "table": "numericitems", - "sub_var": "itemid", - "callback": "convert_unit(binary_op(`*`, 0.016113), 'pg')" - } - ], - "eicu": [ - { - "ids": "MCH", - "table": "lab", - "sub_var": "labname" - } - ], - "eicu_demo": [ - { - "ids": "MCH", - "table": "lab", - "sub_var": "labname" - } - ], - "hirid": [ - { - "ids": 24000160, - "table": "observations", - "sub_var": "variableid", - "class": "hrd_itm" - } - ], - "miiv": [ - { - "ids": 51248, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic": [ - { - "ids": 51248, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic_demo": [ - { - "ids": 51248, - "table": "labevents", - "sub_var": "itemid" - } - ], - "sic": [ - { - "ids": 566, - "table": "laboratory", - "sub_var": "LaboratoryID" - } - ] - } - }, - "mchc": { - "unit": "%", - "min": 20, - "max": 50, - "description": "mean corpuscular hemoglobin concentration", - "omopid": 4290193, - "category": "hematology", - "sources": { - "aumc": [ - { - "ids": 18666, - "table": "numericitems", - "sub_var": "itemid", - "callback": "convert_unit(binary_op(`*`, 1.611), '%')" - } - ], - "eicu": [ - { - "ids": "MCHC", - "table": "lab", - "sub_var": "labname" - } - ], - "eicu_demo": [ - { - "ids": "MCHC", - "table": "lab", - "sub_var": "labname" - } - ], - "hirid": [ - { - "ids": 24000170, - "table": "observations", - "sub_var": "variableid", - "callback": "convert_unit(binary_op(`*`, 0.16114), '%')", - "class": "hrd_itm" - } - ], - "miiv": [ - { - "ids": 51249, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic": [ - { - "ids": 51249, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic_demo": [ - { - "ids": 51249, - "table": "labevents", - "sub_var": "itemid" - } - ], - "sic": [ - { - "ids": 290, - "table": "laboratory", - "sub_var": "LaboratoryID" - } - ] - } - }, - "mcv": { - "unit": "fL", - "min": 50, - "max": 150, - "description": "mean corpuscular volume", - "omopid": 4016239, - "category": "hematology", - "sources": { - "aumc": [ - { - "ids": 9968, - "table": "numericitems", - "sub_var": "itemid" - } - ], - "eicu": [ - { - "ids": "MCV", - "table": "lab", - "sub_var": "labname" - } - ], - "eicu_demo": [ - { - "ids": "MCV", - "table": "lab", - "sub_var": "labname" - } - ], - "hirid": [ - { - "ids": 24000150, - "table": "observations", - "sub_var": "variableid", - "class": "hrd_itm" - } - ], - "miiv": [ - { - "ids": 51250, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic": [ - { - "ids": 51250, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic_demo": [ - { - "ids": 51250, - "table": "labevents", - "sub_var": "itemid" - } - ], - "sic": [ - { - "ids": 286, - "table": "laboratory", - "sub_var": "LaboratoryID" - } - ] - } - }, - "mech_vent": { - "class": "fct_cncpt", - "target": "win_tbl", - "levels": ["invasive", "noninvasive"], - "description": "mechanical ventilation windows", - "omopid": 4230167, - "category": "respiratory", - "sources": { - "aumc": [ - { - "ids": [9328, 10740, 12635], - "table": "processitems", - "sub_var": "itemid", - "dur_var": "stop", - "callback": "apply_map(c(`Beademen` = 'invasive',\n `Beademen non-invasief` = 'noninvasive',\n `Tracheostoma` = 'invasive'))" - } - ], - "hirid": [ - { - "ids": 15001552, - "table": "observations", - "sub_var": "variableid", - "target": "ts_tbl", - "interval": "00:01:00", - "class": "hrd_itm", - "callback": "combine_callbacks(hirid_vent,\n apply_map(c(`1` = 'invasive',\n `2` = 'invasive',\n `3` = 'noninvasive',\n `4` = 'noninvasive',\n `5` = 'noninvasive',\n `6` = 'noninvasive')))" - } - ], - "miiv": [ - { - "ids": [225792, 225794], - "table": "procedureevents", - "sub_var": "itemid", - "dur_var": "endtime", - "callback": "apply_map(c(`225792` = 'invasive',\n `225794` = 'noninvasive'),\n var = 'sub_var')" - } - ] - } - }, - "methb": { - "unit": "%", - "min": 0, - "max": 100, - "description": "methemoglobin", - "omopid": 4204561, - "category": "blood gas", - "sources": { - "aumc": [ - { - "ids": 11692, - "table": "numericitems", - "sub_var": "itemid" - } - ], - "eicu": [ - { - "ids": "Methemoglobin", - "table": "lab", - "sub_var": "labname" - } - ], - "eicu_demo": [ - { - "ids": "Methemoglobin", - "table": "lab", - "sub_var": "labname" - } - ], - "hirid": [ - { - "ids": 24000549, - "table": "observations", - "sub_var": "variableid", - "class": "hrd_itm" - } - ], - "miiv": [ - { - "ids": 50814, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic": [ - { - "ids": 50814, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic_demo": [ - { - "ids": 50814, - "table": "labevents", - "sub_var": "itemid" - } - ] - } - }, - "mews": { - "concepts": ["sbp", "hr", "resp", "temp", "avpu"], - "description": "modified early warning score", - "omopid": 40484211, - "category": "outcome", - "callback": "mews_score", - "class": "rec_cncpt" - }, - "mg": { - "unit": "mg/dL", - "min": 0.5, - "max": 5, - "description": "magnesium", - "omopid": 4243005, - "category": "chemistry", - "sources": { - "aumc": [ - { - "ids": [6839, 9952], - "table": "numericitems", - "sub_var": "itemid", - "callback": "convert_unit(binary_op(`*`, 2.431), 'mg/dL')" - } - ], - "eicu": [ - { - "ids": "magnesium", - "table": "lab", - "sub_var": "labname", - "callback": "convert_unit(binary_op(`/`, 1.215), 'mg/dL', 'mEq/L')" - } - ], - "eicu_demo": [ - { - "ids": "magnesium", - "table": "lab", - "sub_var": "labname", - "callback": "convert_unit(binary_op(`/`, 1.215), 'mg/dL', 'mEq/L')" - } - ], - "hirid": [ - { - "ids": 24000230, - "table": "observations", - "sub_var": "variableid", - "callback": "convert_unit(binary_op(`*`, 2.431), 'mg/dL')", - "class": "hrd_itm" - } - ], - "miiv": [ - { - "ids": 50960, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic": [ - { - "ids": 50960, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic_demo": [ - { - "ids": 50960, - "table": "labevents", - "sub_var": "itemid" - } - ], - "sic": [ - { - "ids": 468, - "table": "laboratory", - "sub_var": "LaboratoryID", - "callback": "transform_fun(binary_op(`*`, 2.431))" - } - ] - } - }, - "mgcs": { - "min": 1, - "max": 6, - "description": "GCS motor", - "omopid": 4083352, - "category": "neurological", - "sources": { - "aumc": [ - { - "ids": 6734, - "table": "listitems", - "sub_var": "itemid", - "callback": "apply_map( c(`Geen reactie` = 1, `Strekken` = 2, `Decortatie reflex (abnormaal buigen)` = 3, `Spastische reactie (terugtrekken)` = 4, `Localiseert pijn` = 5, `Volgt verbale commando's op` = 6) )" - }, - { - "ids": 13072, - "table": "listitems", - "sub_var": "itemid", - "callback": "apply_map( c(`Geen reactie` = 1, `Strekken op pijn` = 2, `Abnormaal buigen bij pijn` = 3, `Terugtrekken bij pijn` = 4, `Localiseren pijn` = 5, `Voert opdrachten uit` = 6) )" - } - ], - "eicu": [ - { - "ids": "Motor", - "table": "nursecharting", - "sub_var": "nursingchartcelltypevalname" - } - ], - "eicu_demo": [ - { - "ids": "Motor", - "table": "nursecharting", - "sub_var": "nursingchartcelltypevalname" - } - ], - "hirid": [ - { - "ids": 10000200, - "table": "observations", - "sub_var": "variableid", - "class": "hrd_itm" - } - ], - "miiv": [ - { - "ids": 223901, - "table": "chartevents", - "sub_var": "itemid" - } - ], - "mimic": [ - { - "ids": [454, 223901], - "table": "chartevents", - "sub_var": "itemid" - } - ], - "mimic_demo": [ - { - "ids": [454, 223901], - "table": "chartevents", - "sub_var": "itemid" - } - ] - } - }, - "na": { - "unit": ["mEq/L", "mmol/l"], - "min": 110, - "max": 165, - "description": "sodium", - "omopid": 4208938, - "category": "chemistry", - "sources": { - "aumc": [ - { - "ids": [6840, 9555, 9924, 10284], - "table": "numericitems", - "sub_var": "itemid" - } - ], - "eicu": [ - { - "ids": "sodium", - "table": "lab", - "sub_var": "labname" - } - ], - "eicu_demo": [ - { - "ids": "sodium", - "table": "lab", - "sub_var": "labname" - } - ], - "hirid": [ - { - "ids": [20000400, 24000519, 24000658, 24000835, 24000866], - "table": "observations", - "sub_var": "variableid", - "class": "hrd_itm" - } - ], - "miiv": [ - { - "ids": 50983, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic": [ - { - "ids": 50983, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic_demo": [ - { - "ids": 50983, - "table": "labevents", - "sub_var": "itemid" - } - ], - "sic": [ - { - "ids": [469, 686], - "table": "laboratory", - "sub_var": "LaboratoryID" - } - ] - } - }, - "neut": { - "unit": "%", - "min": 0, - "max": 100, - "description": "neutrophils", - "omopid": 4148615, - "category": "hematology", - "sources": { - "aumc": [ - { - "ids": [6786, 11856], - "table": "numericitems", - "sub_var": "itemid" - }, - { - "ids": 14254, - "table": "numericitems", - "sub_var": "itemid", - "callback": "blood_cell_ratio" - } - ], - "eicu": [ - { - "ids": "-polys", - "table": "lab", - "sub_var": "labname" - } - ], - "eicu_demo": [ - { - "ids": "-polys", - "table": "lab", - "sub_var": "labname" - } - ], - "hirid": [ - { - "ids": 24000550, - "table": "observations", - "sub_var": "variableid", - "class": "hrd_itm" - } - ], - "miiv": [ - { - "ids": 51256, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic": [ - { - "ids": 51256, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic_demo": [ - { - "ids": 51256, - "table": "labevents", - "sub_var": "itemid" - } - ], - "sic": [ - { - "ids": 230, - "table": "laboratory", - "sub_var": "LaboratoryID" - } - ] - } - }, - "news": { - "concepts": ["resp", "o2sat", "supp_o2", "temp", "sbp", "hr", "avpu"], - "description": "national early warning score", - "omopid": 44808550, - "category": "outcome", - "callback": "news_score", - "class": "rec_cncpt" - }, - "norepi_dur": { - "description": "norepinephrine duration", - "category": "medications", - "aggregate": "max", - "sources": { - "aumc": [ - { - "ids": 7229, - "table": "drugitems", - "sub_var": "itemid", - "stop_var": "stop", - "grp_var": "orderid", - "callback": "aumc_dur" - } - ], - "eicu": [ - { - "regex": "^norepi", - "table": "infusiondrug", - "sub_var": "drugname", - "callback": "eicu_duration(gap_length = hours(5L))", - "class": "rgx_itm" - } - ], - "eicu_demo": [ - { - "regex": "^norepi", - "table": "infusiondrug", - "sub_var": "drugname", - "callback": "eicu_duration(gap_length = hours(5L))", - "class": "rgx_itm" - } - ], - "hirid": [ - { - "ids": [1000462, 1000656, 1000657, 1000658], - "table": "pharma", - "sub_var": "pharmaid", - "grp_var": "infusionid", - "callback": "hirid_duration" - } - ], - "miiv": [ - { - "ids": 221906, - "table": "inputevents", - "sub_var": "itemid", - "stop_var": "endtime", - "grp_var": "linkorderid", - "callback": "mimic_dur_inmv" - } - ], - "mimic": [ - { - "ids": [30047, 30120], - "table": "inputevents_cv", - "sub_var": "itemid", - "grp_var": "linkorderid", - "callback": "mimic_dur_incv" - }, - { - "ids": 221906, - "table": "inputevents_mv", - "sub_var": "itemid", - "stop_var": "endtime", - "grp_var": "linkorderid", - "callback": "mimic_dur_inmv" - } - ], - "mimic_demo": [ - { - "ids": [30047, 30120], - "table": "inputevents_cv", - "sub_var": "itemid", - "grp_var": "linkorderid", - "callback": "mimic_dur_incv" - }, - { - "ids": 221906, - "table": "inputevents_mv", - "sub_var": "itemid", - "stop_var": "endtime", - "grp_var": "linkorderid", - "callback": "mimic_dur_inmv" - } - ], - "sic": [ - { - "ids": [ - 1562 - ], - "table": "medication", - "sub_var": "DrugID", - "stop_var": "OffsetDrugEnd", - "callback": "sic_dur" - } - ] - } - }, - "norepi_equiv": { - "description": "norepinephrine equivalents", - "category": "medications", - "concepts": ["epi_rate", "norepi_rate", "dopa_rate", "adh_rate", "phn_rate"], - "callback": "norepi_equiv", - "class": "rec_cncpt" - }, - "norepi_rate": { - "unit": ["mcg/kg/min", "mcgkgmin"], - "min": 0, - "max": 3, - "description": "norepinephrine rate", - "omopid": 1321341, - "category": "medications", - "sources": { - "aumc": [ - { - "ids": 7229, - "table": "drugitems", - "sub_var": "itemid", - "rel_weight": "doserateperkg", - "rate_uom": "doserateunit", - "stop_var": "stop", - "callback": "aumc_rate_kg" - } - ], - "eicu": [ - { - "regex": "^norepi.*\\(.+\\)$", - "table": "infusiondrug", - "sub_var": "drugname", - "weight_var": "patientweight", - "callback": "eicu_rate_kg(ml_to_mcg = 32)", - "class": "rgx_itm" - } - ], - "eicu_demo": [ - { - "regex": "^norepi.*\\(.+\\)$", - "table": "infusiondrug", - "sub_var": "drugname", - "weight_var": "patientweight", - "callback": "eicu_rate_kg(ml_to_mcg = 32)", - "class": "rgx_itm" - } - ], - "hirid": [ - { - "ids": [1000462, 1000656, 1000657, 1000658], - "table": "pharma", - "sub_var": "pharmaid", - "grp_var": "infusionid", - "callback": "hirid_rate_kg" - } - ], - "miiv": [ - { - "ids": 221906, - "table": "inputevents", - "sub_var": "itemid", - "stop_var": "endtime", - "callback": "mimic_rate_mv" - } - ], - "mimic": [ - { - "ids": [30047, 30120], - "table": "inputevents_cv", - "sub_var": "itemid", - "grp_var": "linkorderid", - "callback": "mimic_rate_cv" - }, - { - "ids": 221906, - "table": "inputevents_mv", - "sub_var": "itemid", - "stop_var": "endtime", - "callback": "mimic_rate_mv" - } - ], - "mimic_demo": [ - { - "ids": [30047, 30120], - "table": "inputevents_cv", - "sub_var": "itemid", - "grp_var": "linkorderid", - "callback": "mimic_rate_cv" - }, - { - "ids": 221906, - "table": "inputevents_mv", - "sub_var": "itemid", - "stop_var": "endtime", - "callback": "mimic_rate_mv" - } - ], - "sic": [ - { - "ids": 1562, - "table": "medication", - "sub_var": "DrugID", - "val_var": "AmountPerMinute", - "stop_var": "OffsetDrugEnd", - "callback": "sic_rate_kg" - } - ] - } - }, - "norepi60": { - "concepts": ["norepi_rate", "norepi_dur"], - "description": "norepinephrine administration for min 1h", - "category": "outcome", - "interval": "00:01:00", - "callback": "vaso60", - "class": "rec_cncpt" - }, - "o2sat": { - "unit": ["%", "% Sat."], - "min": 50, - "max": 100, - "description": "oxygen saturation", - "omopid": 40483579, - "category": "respiratory", - "sources": { - "aumc": [ - { - "ids": [6709, 8903], - "table": "numericitems", - "sub_var": "itemid" - }, - { - "ids": 12311, - "table": "numericitems", - "sub_var": "itemid", - "callback": "transform_fun(binary_op(`*`, 100))" - } - ], - "eicu": [ - { - "table": "vitalperiodic", - "val_var": "sao2", - "unit_val": "%", - "class": "col_itm" - }, - { - "ids": "O2 Sat (%)", - "table": "lab", - "sub_var": "labname" - } - ], - "eicu_demo": [ - { - "table": "vitalperiodic", - "val_var": "sao2", - "unit_val": "%", - "class": "col_itm" - }, - { - "ids": "O2 Sat (%)", - "table": "lab", - "sub_var": "labname" - } - ], - "hirid": [ - { - "ids": [4000, 8280, 20000800], - "table": "observations", - "sub_var": "variableid", - "class": "hrd_itm" - } - ], - "miiv": [ - { - "ids": [220277, 226253, 50817], - "table": "chartevents", - "sub_var": "itemid" - } - ], - "mimic": [ - { - "ids": [646, 220277, 226253, 50817], - "table": "chartevents", - "sub_var": "itemid" - } - ], - "mimic_demo": [ - { - "ids": [646, 220277, 226253, 50817], - "table": "chartevents", - "sub_var": "itemid" - } - ], - "sic": [ - { - "ids": 710, - "table": "data_float_h", - "sub_var": "DataID" - } - ] - } - }, - "pafi": { - "concepts": ["po2", "fio2"], - "description": "Horowitz index", - "omopid": 4233883, - "category": "respiratory", - "aggregate": ["min", "max"], - "callback": "pafi", - "class": "rec_cncpt" - }, - "pco2": { - "unit": ["mmHg", "mm Hg"], - "min": 10, - "max": 150, - "description": "CO2 partial pressure", - "omopid": 4097882, - "category": "blood gas", - "sources": { - "aumc": [ - { - "ids": [6846, 9990, 21213], - "table": "numericitems", - "sub_var": "itemid" - } - ], - "eicu": [ - { - "ids": "paCO2", - "table": "lab", - "sub_var": "labname" - } - ], - "eicu_demo": [ - { - "ids": "paCO2", - "table": "lab", - "sub_var": "labname" - } - ], - "hirid": [ - { - "ids": 20001200, - "table": "observations", - "sub_var": "variableid", - "class": "hrd_itm" - } - ], - "miiv": [ - { - "ids": 50818, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic": [ - { - "ids": 50818, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic_demo": [ - { - "ids": 50818, - "table": "labevents", - "sub_var": "itemid" - } - ], - "sic": [ - { - "ids": 687, - "table": "laboratory", - "sub_var": "LaboratoryID" - } - ] - } - }, - "ph": { - "min": 6.8, - "max": 8, - "description": "pH of blood", - "omopid": 4097822, - "category": "blood gas", - "sources": { - "aumc": [ - { - "ids": [6848, 12310], - "table": "numericitems", - "sub_var": "itemid" - } - ], - "eicu": [ - { - "ids": "pH", - "table": "lab", - "sub_var": "labname" - } - ], - "eicu_demo": [ - { - "ids": "pH", - "table": "lab", - "sub_var": "labname" - } - ], - "hirid": [ - { - "ids": 20000300, - "table": "observations", - "sub_var": "variableid", - "class": "hrd_itm" - } - ], - "miiv": [ - { - "ids": 50820, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic": [ - { - "ids": 50820, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic_demo": [ - { - "ids": 50820, - "table": "labevents", - "sub_var": "itemid" - } - ], - "sic": [ - { - "ids": 688, - "table": "laboratory", - "sub_var": "LaboratoryID" - } - ] - } - }, - "phn_rate": { - "unit": "mcg/kg/min", - "description": "phenylephrine rate", - "omopid": 1135766, - "category": "medications", - "sources": { - "eicu": [ - { - "regex": "^phenylephrine.*\\(.+\\)$", - "table": "infusiondrug", - "sub_var": "drugname", - "weight_var": "patientweight", - "callback": "eicu_rate_kg(ml_to_mcg = 200)", - "class": "rgx_itm" - } - ], - "eicu_demo": [ - { - "regex": "^phenylephrine.*\\(.+\\)$", - "table": "infusiondrug", - "sub_var": "drugname", - "weight_var": "patientweight", - "callback": "eicu_rate_kg(ml_to_mcg = 200)", - "class": "rgx_itm" - } - ], - "miiv": [ - { - "ids": 221749, - "table": "inputevents", - "sub_var": "itemid", - "stop_var": "endtime", - "callback": "mimic_rate_mv" - } - ], - "mimic": [ - { - "ids": 30127, - "table": "inputevents_cv", - "sub_var": "itemid", - "grp_var": "linkorderid", - "callback": "combine_callbacks(\n mimic_kg_rate, mimic_rate_cv)\n " - }, - { - "ids": 30128, - "table": "inputevents_cv", - "sub_var": "itemid", - "grp_var": "linkorderid", - "callback": "mimic_rate_cv" - }, - { - "ids": 221749, - "table": "inputevents_mv", - "sub_var": "itemid", - "stop_var": "endtime", - "callback": "mimic_rate_mv" - } - ], - "mimic_demo": [ - { - "ids": 30127, - "table": "inputevents_cv", - "sub_var": "itemid", - "grp_var": "linkorderid", - "callback": "combine_callbacks(\n mimic_kg_rate, mimic_rate_cv)\n " - }, - { - "ids": 30128, - "table": "inputevents_cv", - "sub_var": "itemid", - "grp_var": "linkorderid", - "callback": "mimic_rate_cv" - }, - { - "ids": 221749, - "table": "inputevents_mv", - "sub_var": "itemid", - "stop_var": "endtime", - "callback": "mimic_rate_mv" - } - ] - } - }, - "phos": { - "unit": "mg/dL", - "min": 0, - "max": 40, - "description": "phosphate", - "omopid": 4017907, - "category": "chemistry", - "sources": { - "aumc": [ - { - "ids": [6828, 9935], - "table": "numericitems", - "sub_var": "itemid", - "callback": "convert_unit(binary_op(`*`, 3.097521), 'mg/dL')" - } - ], - "eicu": [ - { - "ids": "phosphate", - "table": "lab", - "sub_var": "labname" - } - ], - "eicu_demo": [ - { - "ids": "phosphate", - "table": "lab", - "sub_var": "labname" - } - ], - "hirid": [ - { - "ids": 20002500, - "table": "observations", - "sub_var": "variableid", - "callback": "convert_unit(binary_op(`*`, 3.097521), 'mg/dL')", - "class": "hrd_itm" - } - ], - "miiv": [ - { - "ids": 50970, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic": [ - { - "ids": 50970, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic_demo": [ - { - "ids": 50970, - "table": "labevents", - "sub_var": "itemid" - } - ], - "sic": [ - { - "ids": 471, - "table": "laboratory", - "sub_var": "LaboratoryID", - "callback": "transform_fun(binary_op(`*`, 3.097521))" - } - ] - } - }, - "plt": { - "unit": ["K/uL", "G/l"], - "min": 5, - "max": 1200, - "description": "platelet count", - "omopid": 4267147, - "category": "hematology", - "sources": { - "aumc": [ - { - "ids": [6797, 9964, 10409, 14252], - "table": "numericitems", - "sub_var": "itemid" - } - ], - "eicu": [ - { - "ids": "platelets x 1000", - "table": "lab", - "sub_var": "labname" - } - ], - "eicu_demo": [ - { - "ids": "platelets x 1000", - "table": "lab", - "sub_var": "labname" - } - ], - "hirid": [ - { - "ids": 20000110, - "table": "observations", - "sub_var": "variableid", - "class": "hrd_itm" - } - ], - "miiv": [ - { - "ids": 51265, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic": [ - { - "ids": 51265, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic_demo": [ - { - "ids": 51265, - "table": "labevents", - "sub_var": "itemid" - } - ], - "sic": [ - { - "ids": 314, - "table": "laboratory", - "sub_var": "LaboratoryID" - } - ] - } - }, - "po2": { - "unit": ["mmHg", "mm Hg"], - "min": 40, - "max": 600, - "description": "O2 partial pressure", - "omopid": 4094581, - "category": "blood gas", - "sources": { - "aumc": [ - { - "ids": [7433, 9996, 21214], - "table": "numericitems", - "sub_var": "itemid" - } - ], - "eicu": [ - { - "ids": "paO2", - "table": "lab", - "sub_var": "labname" - } - ], - "eicu_demo": [ - { - "ids": "paO2", - "table": "lab", - "sub_var": "labname" - } - ], - "hirid": [ - { - "ids": 20000200, - "table": "observations", - "sub_var": "variableid", - "class": "hrd_itm" - } - ], - "miiv": [ - { - "ids": 50821, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic": [ - { - "ids": 50821, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic_demo": [ - { - "ids": 50821, - "table": "labevents", - "sub_var": "itemid" - } - ], - "sic": [ - { - "ids": [664, 689], - "table": "laboratory", - "sub_var": "LaboratoryID" - } - ] - } - }, - "pt": { - "unit": "sec", - "min": 0, - "description": "prothrombine time", - "omopid": 4245261, - "category": "hematology", - "sources": { - "aumc": [ - { - "ids": 6789, - "table": "numericitems", - "sub_var": "itemid" - } - ], - "eicu": [ - { - "ids": "PT", - "table": "lab", - "sub_var": "labname" - } - ], - "eicu_demo": [ - { - "ids": "PT", - "table": "lab", - "sub_var": "labname" - } - ], - "miiv": [ - { - "ids": 51274, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic": [ - { - "ids": 51274, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic_demo": [ - { - "ids": 51274, - "table": "labevents", - "sub_var": "itemid" - } - ], - "sic": [ - { - "ids": 598, - "table": "laboratory", - "sub_var": "LaboratoryID" - } - ] - } - }, - "ptt": { - "unit": "sec", - "min": 0, - "description": "partial thromboplastin time", - "omopid": 4175016, - "category": "hematology", - "sources": { - "aumc": [ - { - "ids": 17982, - "table": "numericitems", - "sub_var": "itemid" - } - ], - "eicu": [ - { - "ids": "PTT", - "table": "lab", - "sub_var": "labname" - } - ], - "eicu_demo": [ - { - "ids": "PTT", - "table": "lab", - "sub_var": "labname" - } - ], - "hirid": [ - { - "ids": 20004410, - "table": "observations", - "sub_var": "variableid", - "class": "hrd_itm" - } - ], - "miiv": [ - { - "ids": 51275, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic": [ - { - "ids": 51275, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic_demo": [ - { - "ids": 51275, - "table": "labevents", - "sub_var": "itemid" - } - ], - "sic": [ - { - "ids": 597, - "table": "laboratory", - "sub_var": "LaboratoryID" - } - ] - } - }, - "qsofa": { - "concepts": ["gcs", "sbp", "resp"], - "description": "quick SOFA score", - "omopid": 1616732, - "category": "outcome", - "callback": "qsofa_score", - "class": "rec_cncpt" - }, - "rass": { - "min": -5, - "max": 4, - "description": "Richmond agitation sedation scale", - "omopid": 36684829, - "category": "neurological", - "sources": { - "aumc": [ - { - "ids": 14444, - "sub_var": "itemid", - "table": "listitems", - "callback": "transform_fun(aumc_rass)" - } - ], - "eicu": [ - { - "ids": "Sedation Score", - "table": "nursecharting", - "sub_var": "nursingchartcelltypevalname" - } - ], - "eicu_demo": [ - { - "ids": "Sedation Score", - "table": "nursecharting", - "sub_var": "nursingchartcelltypevalname" - } - ], - "hirid": [ - { - "ids": 15001565, - "table": "observations", - "sub_var": "variableid", - "callback": "transform_fun(floor)", - "class": "hrd_itm" - } - ], - "miiv": [ - { - "ids": 228096, - "table": "chartevents", - "sub_var": "itemid" - } - ], - "mimic": [ - { - "ids": 228096, - "table": "chartevents", - "sub_var": "itemid" - } - ], - "mimic_demo": [ - { - "ids": 228096, - "table": "chartevents", - "sub_var": "itemid" - } - ] - } - }, - "rbc": { - "unit": "m/uL", - "min": 0, - "max": 20, - "description": "red blood cell count", - "omopid": 4030871, - "category": "hematology", - "sources": { - "aumc": [ - { - "ids": [6774, 9962], - "table": "numericitems", - "sub_var": "itemid" - } - ], - "eicu": [ - { - "ids": "RBC", - "table": "lab", - "sub_var": "labname" - } - ], - "eicu_demo": [ - { - "ids": "RBC", - "table": "lab", - "sub_var": "labname" - } - ], - "miiv": [ - { - "ids": 51279, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic": [ - { - "ids": 51279, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic_demo": [ - { - "ids": 51279, - "table": "labevents", - "sub_var": "itemid" - } - ], - "sic": [ - { - "ids": 599, - "table": "laboratory", - "sub_var": "LaboratoryID" - } - ] - } - }, - "rdw": { - "unit": "%", - "min": 0, - "max": 100, - "description": "erythrocyte distribution width", - "omopid": 4281085, - "category": "hematology", - "sources": { - "aumc": [ - { - "ids": 18952, - "table": "numericitems", - "sub_var": "itemid" - } - ], - "eicu": [ - { - "ids": "RDW", - "table": "lab", - "sub_var": "labname" - } - ], - "eicu_demo": [ - { - "ids": "RDW", - "table": "lab", - "sub_var": "labname" - } - ], - "miiv": [ - { - "ids": 51277, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic": [ - { - "ids": 51277, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic_demo": [ - { - "ids": 51277, - "table": "labevents", - "sub_var": "itemid" - } - ], - "sic": [ - { - "ids": 3319, - "table": "laboratory", - "sub_var": "LaboratoryID" - } - ] - } - }, - "resp": { - "unit": ["insp/min", "/min"], - "min": 0, - "max": 120, - "description": "respiratory rate", - "omopid": 4313591, - "category": "respiratory", - "sources": { - "aumc": [ - { - "ids": [8874, 12266], - "table": "numericitems", - "sub_var": "itemid" - } - ], - "eicu": [ - { - "table": "vitalperiodic", - "val_var": "respiration", - "class": "col_itm" - } - ], - "eicu_demo": [ - { - "table": "vitalperiodic", - "val_var": "respiration", - "class": "col_itm" - } - ], - "hirid": [ - { - "ids": [300, 310], - "table": "observations", - "sub_var": "variableid", - "class": "hrd_itm" - } - ], - "miiv": [ - { - "ids": [220210, 224688, 224689, 224690], - "table": "chartevents", - "sub_var": "itemid" - } - ], - "mimic": [ - { - "ids": [618, 619, 220210, 224688, 224689, 224690], - "table": "chartevents", - "sub_var": "itemid" - } - ], - "mimic_demo": [ - { - "ids": [618, 619, 220210, 224688, 224689, 224690], - "table": "chartevents", - "sub_var": "itemid" - } - ], - "sic": [ - { - "ids": 719, - "table": "data_float_h", - "sub_var": "DataID" - } - ] - } - }, - "safi": { - "concepts": ["o2sat", "fio2"], - "description": "SaO2/FiO2", - "category": "respiratory", - "aggregate": ["min", "max"], - "callback": "safi", - "class": "rec_cncpt" - }, - "samp": { - "class": "lgl_cncpt", - "category": "microbiology", - "description": "body fluid sampling", - "omopid": 4133843, - "sources": { - "aumc": [ - { - "ids": [8097, 8418, 8588, 9189, 9190, 9191, 9192, 9193, 9194, 9195, 9197, 9198, 9200, 9202, 9203, 9204, 9205, 13024, 19663, 19664], - "table": "procedureorderitems", - "sub_var": "itemid", - "callback": "transform_fun(set_val(TRUE))" - } - ], - "eicu": [ - { - "table": "microlab", - "val_var": "organism", - "callback": "transform_fun(comp_na(`!=`, 'no growth'))", - "class": "col_itm" - } - ], - "eicu_demo": [ - { - "table": "microlab", - "val_var": "organism", - "callback": "transform_fun(comp_na(`!=`, 'no growth'))", - "class": "col_itm" - } - ], - "miiv": [ - { - "table": "microbiologyevents", - "val_var": "org_itemid", - "callback": "mimic_sampling", - "aux_time": "charttime", - "class": "col_itm" - } - ], - "mimic": [ - { - "table": "microbiologyevents", - "val_var": "org_itemid", - "callback": "mimic_sampling", - "aux_time": "charttime", - "class": "col_itm" - } - ], - "mimic_demo": [ - { - "table": "microbiologyevents", - "val_var": "org_itemid", - "callback": "mimic_sampling", - "aux_time": "charttime", - "class": "col_itm" - } - ] - } - }, - "sbp": { - "unit": ["mmHg", "mm Hg"], - "min": 0, - "max": 300, - "description": "systolic blood pressure", - "omopid": 4152194, - "category": "vitals", - "sources": { - "aumc": [ - { - "ids": 6641, - "table": "numericitems", - "sub_var": "itemid" - } - ], - "eicu": [ - { - "table": "vitalperiodic", - "val_var": "systemicsystolic", - "class": "col_itm" - } - ], - "eicu_demo": [ - { - "table": "vitalperiodic", - "val_var": "systemicsystolic", - "class": "col_itm" - } - ], - "hirid": [ - { - "ids": 100, - "table": "observations", - "sub_var": "variableid", - "class": "hrd_itm" - } - ], - "miiv": [ - { - "ids": [220050, 220179], - "table": "chartevents", - "sub_var": "itemid" - } - ], - "mimic": [ - { - "ids": [51, 455, 6701, 220050, 220179], - "table": "chartevents", - "sub_var": "itemid" - } - ], - "mimic_demo": [ - { - "ids": [51, 455, 6701, 220050, 220179], - "table": "chartevents", - "sub_var": "itemid" - } - ], - "sic": [ - { - "ids": [701, 704], - "table": "data_float_h", - "sub_var": "DataID" - } - ] - } - }, - "sep3": { - "concepts": ["sofa", "susp_inf"], - "description": "sepsis-3 criterion", - "omopid": 132797, - "category": "outcome", - "callback": "sep3", - "keep_components": [false, true], - "class": "rec_cncpt" - }, - "sex": { - "target": "id_tbl", - "levels": ["Female", "Male"], - "class": "fct_cncpt", - "description": "patient sex", - "omopid": 37116947, - "category": "demographics", - "sources": { - "aumc": [ - { - "val_var": "gender", - "table": "admissions", - "callback": "apply_map(c(Vrouw = 'Female', Man = 'Male'))", - "class": "col_itm" - } - ], - "eicu": [ - { - "table": "patient", - "val_var": "gender", - "class": "col_itm" - } - ], - "eicu_demo": [ - { - "table": "patient", - "val_var": "gender", - "class": "col_itm" - } - ], - "hirid": [ - { - "table": "general", - "val_var": "sex", - "callback": "apply_map(c(M = 'Male', F = 'Female'))", - "class": "col_itm" - } - ], - "miiv": [ - { - "table": "patients", - "val_var": "gender", - "callback": "apply_map(c(M = 'Male', F = 'Female'))", - "class": "col_itm" - } - ], - "mimic": [ - { - "table": "patients", - "val_var": "gender", - "callback": "apply_map(c(M = 'Male', F = 'Female'))", - "class": "col_itm" - } - ], - "mimic_demo": [ - { - "table": "patients", - "val_var": "gender", - "callback": "apply_map(c(M = 'Male', F = 'Female'))", - "class": "col_itm" - } - ], - "sic": [ - { - "table": "cases", - "val_var": "Sex", - "callback": "apply_map(c(`735` = 'Male', `736` = 'Female'))", - "class": "col_itm" - } - ] - } - }, - "sirs": { - "concepts": ["temp", "hr", "resp", "pco2", "wbc", "bnd"], - "description": "systemic inflammatory response syndrome score", - "omopid": 4140444, - "category": "outcome", - "callback": "sirs_score", - "class": "rec_cncpt" - }, - "sofa": { - "concepts": ["sofa_resp", "sofa_coag", "sofa_liver", "sofa_cardio", "sofa_cns", "sofa_renal"], - "description": "sequential organ failure assessment score", - "omopid": 1616852, - "category": "outcome", - "callback": "sofa_score", - "class": "rec_cncpt" - }, - "sofa_cardio": { - "concepts": ["map", "dopa60", "norepi60", "dobu60", "epi60"], - "description": "SOFA cardiovascular component", - "omopid": 1617534, - "category": "outcome", - "aggregate": ["min", "max", "max", "max", "max"], - "callback": "sofa_cardio", - "class": "rec_cncpt" - }, - "sofa_cns": { - "concepts": "gcs", - "description": "SOFA central nervous system component", - "omopid": 1616439, - "category": "outcome", - "callback": "sofa_cns", - "class": "rec_cncpt" - }, - "sofa_coag": { - "concepts": "plt", - "description": "SOFA coagulation component", - "omopid": 1616896, - "category": "outcome", - "aggregate": "min", - "callback": "sofa_coag", - "class": "rec_cncpt" - }, - "sofa_liver": { - "concepts": "bili", - "description": "SOFA liver component", - "omopid": 1617043, - "category": "outcome", - "aggregate": "max", - "callback": "sofa_liver", - "class": "rec_cncpt" - }, - "sofa_renal": { - "concepts": ["crea", "urine24"], - "description": "SOFA renal component", - "omopid": 1616355, - "category": "outcome", - "aggregate": ["max", null], - "callback": "sofa_renal", - "class": "rec_cncpt" - }, - "sofa_resp": { - "concepts": ["pafi", "vent_ind"], - "description": "SOFA respiratory component", - "omopid": 1616907, - "category": "outcome", - "callback": "sofa_resp", - "class": "rec_cncpt" - }, - "supp_o2": { - "concepts": ["vent_ind", "fio2"], - "description": "supplemental oxygen", - "omopid": 36304401, - "category": "respiratory", - "callback": "supp_o2", - "class": "rec_cncpt" - }, - "susp_inf": { - "concepts": ["abx", "samp"], - "description": "suspected infection", - "omopid": 43021378, - "category": "outcome", - "aggregate": [ - [ - "sum" - ], - [ - false - ] - ], - "callback": "susp_inf", - "class": "rec_cncpt" - }, - "tco2": { - "unit": "mEq/L", - "min": 5, - "max": 60, - "description": "totcal CO2", - "omopid": 4193415, - "category": "blood gas", - "sources": { - "eicu": [ - { - "ids": "Total CO2", - "table": "lab", - "sub_var": "labname", - "callback": "convert_unit(set_val(NA), 'mEq/L', 'lpm')" - } - ], - "eicu_demo": [ - { - "ids": "Total CO2", - "table": "lab", - "sub_var": "labname", - "callback": "convert_unit(set_val(NA), 'mEq/L', 'lpm')" - } - ], - "miiv": [ - { - "ids": 50804, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic": [ - { - "ids": 50804, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic_demo": [ - { - "ids": 50804, - "table": "labevents", - "sub_var": "itemid" - } - ] - } - }, - "temp": { - "unit": ["C", "°C"], - "min": 32, - "max": 42, - "description": "temperature", - "omopid": 4302666, - "category": "vitals", - "sources": { - "aumc": [ - { - "ids": [8658, 13952, 16110], - "table": "numericitems", - "sub_var": "itemid" - } - ], - "eicu": [ - { - "table": "vitalperiodic", - "val_var": "temperature", - "class": "col_itm" - } - ], - "eicu_demo": [ - { - "table": "vitalperiodic", - "val_var": "temperature", - "class": "col_itm" - } - ], - "hirid": [ - { - "ids": [410, 400, 7100], - "table": "observations", - "sub_var": "variableid", - "class": "hrd_itm" - } - ], - "miiv": [ - { - "ids": 223762, - "table": "chartevents", - "sub_var": "itemid" - }, - { - "ids": [223761, 224027], - "table": "chartevents", - "sub_var": "itemid", - "callback": "convert_unit(fahr_to_cels, 'C', 'f')" - } - ], - "mimic": [ - { - "ids": [676, 677, 223762], - "table": "chartevents", - "sub_var": "itemid" - }, - { - "ids": [678, 679, 223761, 224027], - "table": "chartevents", - "sub_var": "itemid", - "callback": "convert_unit(fahr_to_cels, 'C', 'f')" - } - ], - "mimic_demo": [ - { - "ids": [676, 677, 223762], - "table": "chartevents", - "sub_var": "itemid" - }, - { - "ids": [678, 679, 223761, 224027], - "table": "chartevents", - "sub_var": "itemid", - "callback": "convert_unit(fahr_to_cels, 'C', 'f')" - } - ], - "sic": [ - { - "ids": 709, - "table": "data_float_h", - "sub_var": "DataID" - } - ] - } - }, - "tgcs": { - "min": 3, - "max": 15, - "description": "GCS total", - "omopid": 4093836, - "category": "neurological", - "sources": { - "eicu": [ - { - "ids": "GCS Total", - "table": "nursecharting", - "sub_var": "nursingchartcelltypevalname" - } - ], - "eicu_demo": [ - { - "ids": "GCS Total", - "table": "nursecharting", - "sub_var": "nursingchartcelltypevalname" - } - ], - "mimic": [ - { - "ids": 198, - "table": "chartevents", - "sub_var": "itemid" - } - ], - "mimic_demo": [ - { - "ids": 198, - "table": "chartevents", - "sub_var": "itemid" - } - ] - } - }, - "tnt": { - "unit": "ng/mL", - "min": 0, - "description": "troponin t", - "omopid": 4005525, - "category": "chemistry", - "sources": { - "aumc": [ - { - "ids": 10407, - "table": "numericitems", - "sub_var": "itemid" - } - ], - "eicu": [ - { - "ids": "troponin - T", - "table": "lab", - "sub_var": "labname" - } - ], - "eicu_demo": [ - { - "ids": "troponin - T", - "table": "lab", - "sub_var": "labname" - } - ], - "hirid": [ - { - "ids": 24000806, - "table": "observations", - "sub_var": "variableid", - "callback": "convert_unit(binary_op(`/`, 1000), 'ng/mL')", - "class": "hrd_itm" - } - ], - "miiv": [ - { - "ids": 51003, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic": [ - { - "ids": 51003, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic_demo": [ - { - "ids": 51003, - "table": "labevents", - "sub_var": "itemid" - } - ], - "sic": [ - { - "ids": 481, - "table": "laboratory", - "sub_var": "LaboratoryID", - "callback": "transform_fun(binary_op(`/`, 1000))" - } - ] - } - }, - "tri": { - "unit": "ng/mL", - "min": 0, - "description": "troponin I", - "omopid": 4007805, - "category": "chemistry", - "sources": { - "eicu": [ - { - "ids": "troponin - I", - "table": "lab", - "sub_var": "labname" - } - ], - "eicu_demo": [ - { - "ids": "troponin - I", - "table": "lab", - "sub_var": "labname" - } - ], - "miiv": [ - { - "ids": 51002, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic": [ - { - "ids": 51002, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic_demo": [ - { - "ids": 51002, - "table": "labevents", - "sub_var": "itemid" - } - ], - "sic": [ - { - "ids": 270, - "table": "laboratory", - "sub_var": "LaboratoryID" - } - ] - } - }, - "urine": { - "unit": "mL", - "min": 0, - "max": 2000, - "aggregate": "sum", - "description": "urine output", - "omopid": 4264378, - "category": "output", - "sources": { - "aumc": [ - { - "ids": 8794, - "table": "numericitems", - "sub_var": "itemid" - } - ], - "eicu": [ - { - "ids": ["Urine", "URINE CATHETER"], - "table": "intakeoutput", - "sub_var": "celllabel" - }, - { - "regex": "catheter.+output|output.+catheter", - "table": "intakeoutput", - "sub_var": "celllabel", - "class": "rgx_itm" - } - ], - "eicu_demo": [ - { - "ids": ["Urine", "URINE CATHETER"], - "table": "intakeoutput", - "sub_var": "celllabel" - }, - { - "regex": "catheter.+output|output.+catheter", - "table": "intakeoutput", - "sub_var": "celllabel", - "class": "rgx_itm" - } - ], - "hirid": [ - { - "ids": 30005110, - "table": "observations", - "sub_var": "variableid", - "callback": "hirid_urine", - "class": "hrd_itm" - } - ], - "miiv": [ - { - "ids": [226557, 226558, 226559, 226560, 226561, 226563, 226564, 226565, 226566, 226567, 226584, 227510], - "table": "outputevents", - "sub_var": "itemid" - } - ], - "mimic": [ - { - "ids": [40055, 40056, 40057, 40065, 40069, 40085, 40086, 40094, 40096, 40405, 40428, 40473, 40715, 43175, 226557, 226558, 226559, 226560, 226561, 226563, 226564, 226565, 226566, 226567, 226584, 227510], - "table": "outputevents", - "sub_var": "itemid" - } - ], - "mimic_demo": [ - { - "ids": [40055, 40056, 40057, 40065, 40069, 40085, 40086, 40094, 40096, 40405, 40428, 40473, 40715, 43175, 226557, 226558, 226559, 226560, 226561, 226563, 226564, 226565, 226566, 226567, 226584, 227510], - "table": "outputevents", - "sub_var": "itemid" - } - ], - "sic": [ - { - "ids": 725, - "table": "data_float_h", - "sub_var": "DataID" - } - ] - } - }, - "urine24": { - "concepts": "urine", - "description": "urine output per 24h", - "omopid": 4191836, - "category": "output", - "callback": "urine24", - "class": "rec_cncpt" - }, - "vaso_ind": { - "concepts": ["dopa_dur", "norepi_dur", "dobu_dur", "epi_dur"], - "description": "vasopressor indicator", - "omopid": 3655896, - "category": "medications", - "callback": "vaso_ind", - "class": "rec_cncpt" - }, - "vent_end": { - "class": "lgl_cncpt", - "description": "ventilation end", - "category": "respiratory", - "sources": { - "eicu": [ - { - "table": "respiratorycare", - "val_var": "ventendoffset", - "callback": "vent_flag", - "class": "col_itm" - }, - { - "table": "respiratorycare", - "val_var": "priorventendoffset", - "callback": "vent_flag", - "class": "col_itm" - }, - { - "ids": ["off", "Off", "Suspended"], - "table": "respiratorycharting", - "sub_var": "respchartvalue", - "val_var": "respchartvaluelabel", - "callback": "transform_fun(set_val(TRUE))" - } - ], - "eicu_demo": [ - { - "table": "respiratorycare", - "val_var": "ventendoffset", - "callback": "vent_flag", - "class": "col_itm" - }, - { - "table": "respiratorycare", - "val_var": "priorventendoffset", - "callback": "vent_flag", - "class": "col_itm" - }, - { - "ids": ["off", "Off", "Suspended"], - "table": "respiratorycharting", - "sub_var": "respchartvalue", - "val_var": "respchartvaluelabel", - "callback": "transform_fun(set_val(TRUE))" - } - ], - "mimic": [ - { - "ids": [225468, 225477, 227194], - "table": "procedureevents_mv", - "sub_var": "itemid", - "callback": "transform_fun(set_val(TRUE))" - }, - { - "ids": [467, 469, 226732], - "table": "chartevents", - "sub_var": "itemid", - "callback": "transform_fun(set_val(TRUE))" - } - ], - "mimic_demo": [ - { - "ids": [225468, 225477, 227194], - "table": "procedureevents_mv", - "sub_var": "itemid", - "callback": "transform_fun(set_val(TRUE))" - }, - { - "ids": [467, 469, 226732], - "table": "chartevents", - "sub_var": "itemid", - "callback": "transform_fun(set_val(TRUE))" - } - ] - } - }, - "vent_ind": { - "concepts": ["vent_start", "vent_end", "mech_vent"], - "description": "ventilation durations", - "omopid": 4230167, - "category": "respiratory", - "interval": "00:01:00", - "callback": "vent_ind", - "target": "win_tbl", - "class": "rec_cncpt" - }, - "vent_start": { - "class": "lgl_cncpt", - "description": "ventilation start", - "category": "respiratory", - "sources": { - "eicu": [ - { - "table": "respiratorycare", - "val_var": "ventstartoffset", - "callback": "vent_flag", - "class": "col_itm" - }, - { - "table": "respiratorycare", - "val_var": "priorventstartoffset", - "callback": "vent_flag", - "class": "col_itm" - }, - { - "ids": ["Start", "Continued", "respFlowPtVentData"], - "table": "respiratorycharting", - "sub_var": "respcharttypecat", - "callback": "transform_fun(set_val(TRUE))" - } - ], - "eicu_demo": [ - { - "table": "respiratorycare", - "val_var": "ventstartoffset", - "callback": "vent_flag", - "class": "col_itm" - }, - { - "table": "respiratorycare", - "val_var": "priorventstartoffset", - "callback": "vent_flag", - "class": "col_itm" - }, - { - "ids": ["Start", "Continued", "respFlowPtVentData"], - "table": "respiratorycharting", - "sub_var": "respcharttypecat", - "callback": "transform_fun(set_val(TRUE))" - } - ], - "mimic": [ - { - "ids": [1, 60, 218, 221, 223, 436, 437, 444, 445, 448, 449, 450, 459, 501, 502, 503, 505, 506, 535, 543, 639, 654, 667, 668, 669, 670, 671, 672, 681, 682, 683, 684, 686, 1211, 1340, 1486, 1600, 1655, 2000, 3459, 5865, 5866, 220339, 223848, 223849, 224419, 224684, 224685, 224686, 224687, 224695, 224696, 224697, 224700, 224701, 224702, 224703, 224704, 224705, 224706, 224707, 224709, 224738, 224746, 224747, 224750, 226873, 227187], - "table": "chartevents", - "sub_var": "itemid", - "callback": "transform_fun(set_val(TRUE))" - } - ], - "mimic_demo": [ - { - "ids": [1, 60, 218, 221, 223, 436, 437, 444, 445, 448, 449, 450, 459, 501, 502, 503, 505, 506, 535, 543, 639, 654, 667, 668, 669, 670, 671, 672, 681, 682, 683, 684, 686, 1211, 1340, 1486, 1600, 1655, 2000, 3459, 5865, 5866, 220339, 223848, 223849, 224419, 224684, 224685, 224686, 224687, 224695, 224696, 224697, 224700, 224701, 224702, 224703, 224704, 224705, 224706, 224707, 224709, 224738, 224746, 224747, 224750, 226873, 227187], - "table": "chartevents", - "sub_var": "itemid", - "callback": "transform_fun(set_val(TRUE))" - } - ] - } - }, - "vgcs": { - "min": 1, - "max": 5, - "description": "GCS verbal", - "omopid": 4084912, - "category": "neurological", - "sources": { - "aumc": [ - { - "ids": 6735, - "table": "listitems", - "sub_var": "itemid", - "callback": "apply_map( c(`Geen reactie (geen zichtbare poging tot praten)` = 1, `Onbegrijpelijke geluiden` = 2, `Onduidelijke woorden (pogingen tot communicatie, maar onduidelijk)` = 3, `Verwarde conversatie` = 4, `Helder en adequaat (communicatie mogelijk)` = 5) )" - }, - { - "ids": 13066, - "table": "listitems", - "sub_var": "itemid", - "callback": "apply_map( c(`Geen geluid` = 1, `Onverstaanbare woorden` = 2, `Onjuiste woorden` = 3, `Verwarde taal` = 4, `Georiënteerd` = 5) )" - } - ], - "eicu": [ - { - "ids": "Verbal", - "table": "nursecharting", - "sub_var": "nursingchartcelltypevalname" - } - ], - "eicu_demo": [ - { - "ids": "Verbal", - "table": "nursecharting", - "sub_var": "nursingchartcelltypevalname" - } - ], - "hirid": [ - { - "ids": 10000100, - "table": "observations", - "sub_var": "variableid", - "class": "hrd_itm" - } - ], - "miiv": [ - { - "ids": 223900, - "table": "chartevents", - "sub_var": "itemid" - } - ], - "mimic": [ - { - "ids": [723, 223900], - "table": "chartevents", - "sub_var": "itemid" - } - ], - "mimic_demo": [ - { - "ids": [723, 223900], - "table": "chartevents", - "sub_var": "itemid" - } - ] - } - }, - "wbc": { - "unit": ["K/uL", "G/l"], - "min": 0, - "description": "white blood cell count", - "omopid": 4298431, - "category": "hematology", - "sources": { - "aumc": [ - { - "ids": [6779, 9965], - "table": "numericitems", - "sub_var": "itemid" - } - ], - "eicu": [ - { - "ids": "WBC x 1000", - "table": "lab", - "sub_var": "labname" - } - ], - "eicu_demo": [ - { - "ids": "WBC x 1000", - "table": "lab", - "sub_var": "labname" - } - ], - "hirid": [ - { - "ids": 20000700, - "table": "observations", - "sub_var": "variableid", - "class": "hrd_itm" - } - ], - "miiv": [ - { - "ids": 51301, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic": [ - { - "ids": 51301, - "table": "labevents", - "sub_var": "itemid" - } - ], - "mimic_demo": [ - { - "ids": 51301, - "table": "labevents", - "sub_var": "itemid" - } - ], - "sic": [ - { - "ids": 301, - "table": "laboratory", - "sub_var": "LaboratoryID" - } - ] - } - }, - "weight": { - "unit": "kg", - "min": 1, - "max": 500, - "target": "id_tbl", - "description": "patient weight", - "omopid": 4099154, - "category": "demographics", - "sources": { - "aumc": [ - { - "val_var": "weightgroup", - "table": "admissions", - "callback": "apply_map(c(`59-` = 50, `60-69` = 65, `70-79` = 75, `80-89` = 85, `90-99` = 95, `100-109` = 105, `110+` = 120))", - "class": "col_itm" - } - ], - "eicu": [ - { - "table": "patient", - "val_var": "admissionweight", - "class": "col_itm" - } - ], - "eicu_demo": [ - { - "table": "patient", - "val_var": "admissionweight", - "class": "col_itm" - } - ], - "hirid": [ - { - "ids": 10000400, - "table": "observations", - "sub_var": "variableid", - "class": "hrd_itm" - } - ], - "miiv": [ - { - "ids": 226512, - "table": "chartevents", - "sub_var": "itemid" - } - ], - "mimic": [ - { - "ids": [762, 4183, 226512], - "table": "chartevents", - "sub_var": "itemid" - } - ], - "mimic_demo": [ - { - "ids": [762, 4183, 226512], - "table": "chartevents", - "sub_var": "itemid" - } - ], - "sic": [ - { - "table": "cases", - "val_var": "WeightOnAdmission", - "class": "col_itm", - "callback": "transform_fun(binary_op(`/`, 1000))" - } - ] - } - } -} diff --git a/inst/extdata/config/concept-dict/blood_gas.json b/inst/extdata/config/concept-dict/blood_gas.json new file mode 100644 index 00000000..2b536a4c --- /dev/null +++ b/inst/extdata/config/concept-dict/blood_gas.json @@ -0,0 +1,810 @@ +{ + "be": { + "unit": [ + "mEq/L", + "mmol/l" + ], + "min": -25, + "max": 25, + "description": "base excess", + "omopid": 4284393, + "category": "blood gas", + "sources": { + "aumc": [ + { + "ids": [ + 6807, + 9994 + ], + "table": "numericitems", + "sub_var": "itemid", + "dir_var": "tag", + "callback": "aumc_bxs" + } + ], + "eicu": [ + { + "ids": "Base Excess", + "table": "lab", + "sub_var": "labname" + } + ], + "eicu_demo": [ + { + "ids": "Base Excess", + "table": "lab", + "sub_var": "labname" + } + ], + "hirid": [ + { + "ids": 20001300, + "table": "observations", + "sub_var": "variableid", + "class": "hrd_itm" + } + ], + "miiv": [ + { + "ids": 50802, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic": [ + { + "ids": 50802, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic_demo": [ + { + "ids": 50802, + "table": "labevents", + "sub_var": "itemid" + } + ], + "sic": [ + { + "ids": [668, 449], + "table": "laboratory", + "sub_var": "laboratoryid", + "class": "sic_itm" + } + ], + "picdb": [ + { + "table": "labevents", + "ids": [ + 5211, + 5249 + ], + "sub_var": "itemid" + } + ] + } + }, + "cai": { + "unit": "mmol/L", + "min": 0.5, + "max": 2, + "description": "calcium ionized", + "omopid": 46272910, + "category": "blood gas", + "sources": { + "aumc": [ + { + "ids": [ + 6815, + 8915, + 9560, + 9561, + 10267 + ], + "table": "numericitems", + "sub_var": "itemid" + } + ], + "eicu": [ + { + "ids": "ionized calcium", + "table": "lab", + "sub_var": "labname" + } + ], + "eicu_demo": [ + { + "ids": "ionized calcium", + "table": "lab", + "sub_var": "labname" + } + ], + "hirid": [ + { + "ids": 24000522, + "table": "observations", + "sub_var": "variableid", + "class": "hrd_itm" + } + ], + "miiv": [ + { + "ids": 50808, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic": [ + { + "ids": 50808, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic_demo": [ + { + "ids": 50808, + "table": "labevents", + "sub_var": "itemid" + } + ], + "sic": [ + { + "ids": [655, 452], + "table": "laboratory", + "sub_var": "laboratoryid", + "class": "sic_itm" + } + ], + "picdb": [ + { + "ids": 5215, + "table": "labevents", + "sub_var": "itemid" + } + ] + } + }, + "fio2": { + "unit": "%", + "min": 21, + "max": 100, + "description": "fraction of inspired oxygen", + "omopid": 4353936, + "category": "blood gas", + "sources": { + "aumc": [ + { + "ids": 12279, + "table": "numericitems", + "sub_var": "itemid" + } + ], + "eicu": [ + { + "ids": "FiO2", + "table": "respiratorycharting", + "sub_var": "respchartvaluelabel", + "callback": "transform_fun(percent_as_numeric)" + }, + { + "ids": "FiO2", + "table": "lab", + "sub_var": "labname", + "callback": "convert_unit(set_val(NA), '%', 'mm\\\\(hg\\\\)')" + } + ], + "eicu_demo": [ + { + "ids": "FiO2", + "table": "respiratorycharting", + "sub_var": "respchartvaluelabel", + "callback": "transform_fun(percent_as_numeric)" + }, + { + "ids": "FiO2", + "table": "lab", + "sub_var": "labname", + "callback": "convert_unit(set_val(NA), '%', 'mm\\\\(hg\\\\)')" + } + ], + "hirid": [ + { + "ids": 2010, + "table": "observations", + "sub_var": "variableid", + "class": "hrd_itm" + } + ], + "miiv": [ + { + "ids": 223835, + "table": "chartevents", + "sub_var": "itemid" + }, + { + "ids": 50816, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic": [ + { + "ids": [ + 3420, + 223835 + ], + "table": "chartevents", + "sub_var": "itemid" + }, + { + "ids": 50816, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic_demo": [ + { + "ids": [ + 3420, + 223835 + ], + "table": "chartevents", + "sub_var": "itemid" + }, + { + "ids": 50816, + "table": "labevents", + "sub_var": "itemid" + } + ], + "sic": [ + { + "ids": 2283, + "table": "data_float_h", + "val_var": "rawdata", + "sub_var": "dataid", + "class": "sic_itm" + }, + { + "ids": 684, + "table": "laboratory", + "sub_var": "laboratoryid", + "class": "sic_itm" + } + ], + "picdb": [ + { + "ids": 5222, + "table": "labevents", + "sub_var": "itemid" + } + + ] + } + }, + "hbco": { + "description": "carboxyhemoglobin", + "omopid": 4056787, + "category": "blood gas", + "sources": { + "aumc": [ + { + "ids": 11690, + "table": "numericitems", + "sub_var": "itemid" + } + ], + "eicu": [ + { + "ids": "Carboxyhemoglobin", + "table": "lab", + "sub_var": "labname" + } + ], + "eicu_demo": [ + { + "ids": "Carboxyhemoglobin", + "table": "lab", + "sub_var": "labname" + } + ], + "hirid": [ + { + "ids": 24000526, + "table": "observations", + "sub_var": "variableid", + "class": "hrd_itm" + } + ], + "sic": [ + { + "ids": [196, 660], + "table": "laboratory", + "sub_var": "laboratoryid", + "class": "sic_itm" + } + ], + "picdb": [ + { + "table": "labevents", + "ids": [ + 5219 + ], + "sub_var": "itemid" + } + ] + } + }, + "lact": { + "unit": "mmol/L", + "min": 0, + "max": 50, + "description": "lactate", + "omopid": 4191725, + "category": "blood gas", + "sources": { + "aumc": [ + { + "ids": [ + 6837, + 9580, + 10053 + ], + "table": "numericitems", + "sub_var": "itemid" + } + ], + "eicu": [ + { + "ids": "lactate", + "table": "lab", + "sub_var": "labname" + } + ], + "eicu_demo": [ + { + "ids": "lactate", + "table": "lab", + "sub_var": "labname" + } + ], + "hirid": [ + { + "ids": 24000524, + "table": "observations", + "sub_var": "variableid", + "class": "hrd_itm" + } + ], + "miiv": [ + { + "ids": 50813, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic": [ + { + "ids": 50813, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic_demo": [ + { + "ids": 50813, + "table": "labevents", + "sub_var": "itemid" + } + ], + "sic": [ + { + "ids": [ + 657, + 465, + 454 + ], + "table": "laboratory", + "sub_var": "laboratoryid", + "class": "sic_itm" + } + ], + "picdb": [ + { + "table": "labevents", + "ids": [ + 5227 + ], + "sub_var": "itemid" + } + ] + } + }, + "methb": { + "unit": "%", + "min": 0, + "max": 100, + "description": "methemoglobin", + "omopid": 4204561, + "category": "blood gas", + "sources": { + "aumc": [ + { + "ids": 11692, + "table": "numericitems", + "sub_var": "itemid" + } + ], + "eicu": [ + { + "ids": "Methemoglobin", + "table": "lab", + "sub_var": "labname" + } + ], + "eicu_demo": [ + { + "ids": "Methemoglobin", + "table": "lab", + "sub_var": "labname" + } + ], + "hirid": [ + { + "ids": 24000549, + "table": "observations", + "sub_var": "variableid", + "class": "hrd_itm" + } + ], + "miiv": [ + { + "ids": 50814, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic": [ + { + "ids": 50814, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic_demo": [ + { + "ids": 50814, + "table": "labevents", + "sub_var": "itemid" + } + ], + "sic": [ + { + "ids": 661, + "table": "laboratory", + "sub_var": "laboratoryid", + "class": "sic_itm" + } + ], + "picdb": [ + { + "table": "labevents", + "ids": [ + 5228 + ], + "sub_var": "itemid" + } + ] + } + }, + "pco2": { + "unit": [ + "mmHg", + "mm Hg" + ], + "min": 10, + "max": 150, + "description": "CO2 partial pressure", + "omopid": 4097882, + "category": "blood gas", + "sources": { + "aumc": [ + { + "ids": [ + 6846, + 9990, + 21213 + ], + "table": "numericitems", + "sub_var": "itemid" + } + ], + "eicu": [ + { + "ids": "paCO2", + "table": "lab", + "sub_var": "labname" + } + ], + "eicu_demo": [ + { + "ids": "paCO2", + "table": "lab", + "sub_var": "labname" + } + ], + "hirid": [ + { + "ids": 20001200, + "table": "observations", + "sub_var": "variableid", + "class": "hrd_itm" + } + ], + "miiv": [ + { + "ids": 50818, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic": [ + { + "ids": 50818, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic_demo": [ + { + "ids": 50818, + "table": "labevents", + "sub_var": "itemid" + } + ], + "sic": [ + { + "ids": 687, + "table": "laboratory", + "sub_var": "laboratoryid", + "class": "sic_itm" + } + ], + "picdb": [ + { + "table": "labevents", + "ids": [ + 5235, + 5236 + ], + "sub_var": "itemid" + } + ] + } + }, + "ph": { + "min": 6.8, + "max": 8, + "description": "pH of blood", + "omopid": 4097822, + "category": "blood gas", + "sources": { + "aumc": [ + { + "ids": [ + 6848, + 12310 + ], + "table": "numericitems", + "sub_var": "itemid" + } + ], + "eicu": [ + { + "ids": "pH", + "table": "lab", + "sub_var": "labname" + } + ], + "eicu_demo": [ + { + "ids": "pH", + "table": "lab", + "sub_var": "labname" + } + ], + "hirid": [ + { + "ids": 20000300, + "table": "observations", + "sub_var": "variableid", + "class": "hrd_itm" + } + ], + "miiv": [ + { + "ids": 50820, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic": [ + { + "ids": 50820, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic_demo": [ + { + "ids": 50820, + "table": "labevents", + "sub_var": "itemid" + } + ], + "sic": [ + { + "ids": 688, + "table": "laboratory", + "sub_var": "laboratoryid", + "class": "sic_itm" + } + ], + "picdb": [ + { + "table": "labevents", + "ids": [ + 5237, + 5238 + ], + "sub_var": "itemid" + } + ] + } + }, + "po2": { + "unit": [ + "mmHg", + "mm Hg" + ], + "min": 40, + "max": 600, + "description": "O2 partial pressure", + "omopid": 4094581, + "category": "blood gas", + "sources": { + "aumc": [ + { + "ids": [ + 7433, + 9996, + 21214 + ], + "table": "numericitems", + "sub_var": "itemid" + } + ], + "eicu": [ + { + "ids": "paO2", + "table": "lab", + "sub_var": "labname" + } + ], + "eicu_demo": [ + { + "ids": "paO2", + "table": "lab", + "sub_var": "labname" + } + ], + "hirid": [ + { + "ids": 20000200, + "table": "observations", + "sub_var": "variableid", + "class": "hrd_itm" + } + ], + "miiv": [ + { + "ids": 50821, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic": [ + { + "ids": 50821, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic_demo": [ + { + "ids": 50821, + "table": "labevents", + "sub_var": "itemid" + } + ], + "sic": [ + { + "ids": [ + 664, + 689 + ], + "table": "laboratory", + "sub_var": "laboratoryid", + "class": "sic_itm" + } + ], + "picdb": [ + { + "table": "labevents", + "ids": [ + 5239, + 5244, + 5242 + ], + "sub_var": "itemid" + } + ] + } + }, + "tco2": { + "unit": "mEq/L", + "min": 5, + "max": 60, + "description": "totcal CO2", + "omopid": 4193415, + "category": "blood gas", + "sources": { + "eicu": [ + { + "ids": "Total CO2", + "table": "lab", + "sub_var": "labname", + "callback": "convert_unit(set_val(NA), 'mEq/L', 'lpm')" + } + ], + "eicu_demo": [ + { + "ids": "Total CO2", + "table": "lab", + "sub_var": "labname", + "callback": "convert_unit(set_val(NA), 'mEq/L', 'lpm')" + } + ], + "miiv": [ + { + "ids": 50804, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic": [ + { + "ids": 50804, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic_demo": [ + { + "ids": 50804, + "table": "labevents", + "sub_var": "itemid" + } + ], + "picdb": [ + { + "ids": 5256, + "table": "labevents", + "sub_var": "itemid" + } + ] + } + } +} \ No newline at end of file diff --git a/inst/extdata/config/concept-dict/chemistry.json b/inst/extdata/config/concept-dict/chemistry.json new file mode 100644 index 00000000..12e92d91 --- /dev/null +++ b/inst/extdata/config/concept-dict/chemistry.json @@ -0,0 +1,1767 @@ +{ + "alb": { + "unit": "g/dL", + "min": 0, + "max": 6, + "description": "albumin", + "omopid": 4017497, + "category": "chemistry", + "sources": { + "aumc": [ + { + "ids": [ + 6801, + 9937 + ], + "table": "numericitems", + "sub_var": "itemid", + "callback": "convert_unit(binary_op(`*`, 0.1), 'g/dL')" + } + ], + "eicu": [ + { + "ids": "albumin", + "table": "lab", + "sub_var": "labname" + } + ], + "eicu_demo": [ + { + "ids": "albumin", + "table": "lab", + "sub_var": "labname" + } + ], + "hirid": [ + { + "ids": 24000605, + "table": "observations", + "sub_var": "variableid", + "callback": "convert_unit(binary_op(`*`, 0.1), 'g/dL')", + "class": "hrd_itm" + } + ], + "miiv": [ + { + "ids": 50862, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic": [ + { + "ids": 50862, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic_demo": [ + { + "ids": 50862, + "table": "labevents", + "sub_var": "itemid" + } + ], + "sic": [ + { + "ids": 287, + "table": "laboratory", + "sub_var": "laboratoryid", + "class": "sic_itm" + } + ], + "picdb": [ + { + "table": "labevents", + "ids": [ + 5024, + 6465 + ], + "sub_var": "itemid", + "callback": "convert_unit(binary_op(`*`, 0.1), 'g/dL')" + } + ] + } + }, + "alp": { + "unit": [ + "IU/L", + "U/l" + ], + "min": 0, + "description": "alkaline phosphatase", + "omopid": 4275206, + "category": "chemistry", + "sources": { + "aumc": [ + { + "ids": [ + 6803, + 11984 + ], + "table": "numericitems", + "sub_var": "itemid" + } + ], + "eicu": [ + { + "ids": "alkaline phos.", + "table": "lab", + "sub_var": "labname" + } + ], + "eicu_demo": [ + { + "ids": "alkaline phos.", + "table": "lab", + "sub_var": "labname" + } + ], + "hirid": [ + { + "ids": 20002700, + "table": "observations", + "sub_var": "variableid", + "class": "hrd_itm" + } + ], + "miiv": [ + { + "ids": 50863, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic": [ + { + "ids": 50863, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic_demo": [ + { + "ids": 50863, + "table": "labevents", + "sub_var": "itemid" + } + ], + "sic": [ + { + "ids": 609, + "table": "laboratory", + "sub_var": "laboratoryid", + "class": "sic_itm" + } + ], + "picdb": [ + { + "table": "labevents", + "ids": [ + 5025 + ], + "sub_var": "itemid" + } + ] + } + }, + "alt": { + "unit": [ + "IU/L", + "U/l" + ], + "min": 0, + "description": "alanine aminotransferase", + "omopid": 4146380, + "category": "chemistry", + "sources": { + "aumc": [ + { + "ids": [ + 6800, + 11978 + ], + "table": "numericitems", + "sub_var": "itemid" + } + ], + "eicu": [ + { + "ids": "ALT (SGPT)", + "table": "lab", + "sub_var": "labname" + } + ], + "eicu_demo": [ + { + "ids": "ALT (SGPT)", + "table": "lab", + "sub_var": "labname" + } + ], + "hirid": [ + { + "ids": 20002600, + "table": "observations", + "sub_var": "variableid", + "class": "hrd_itm" + } + ], + "miiv": [ + { + "ids": 50861, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic": [ + { + "ids": 50861, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic_demo": [ + { + "ids": 50861, + "table": "labevents", + "sub_var": "itemid" + } + ], + "sic": [ + { + "ids": 617, + "table": "laboratory", + "sub_var": "laboratoryid", + "class": "sic_itm" + } + ], + "picdb": [ + { + "ids": [5026, 5195], + "table": "labevents", + "sub_var": "itemid" + } + ] + } + }, + "ast": { + "unit": [ + "IU/L", + "U/l" + ], + "min": 0, + "description": "aspartate aminotransferase", + "omopid": 4263457, + "category": "chemistry", + "sources": { + "aumc": [ + { + "ids": [ + 6806, + 11990 + ], + "table": "numericitems", + "sub_var": "itemid" + } + ], + "eicu": [ + { + "ids": "AST (SGOT)", + "table": "lab", + "sub_var": "labname" + } + ], + "eicu_demo": [ + { + "ids": "AST (SGOT)", + "table": "lab", + "sub_var": "labname" + } + ], + "hirid": [ + { + "ids": 24000330, + "table": "observations", + "sub_var": "variableid", + "class": "hrd_itm" + } + ], + "miiv": [ + { + "ids": 50878, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic": [ + { + "ids": 50878, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic_demo": [ + { + "ids": 50878, + "table": "labevents", + "sub_var": "itemid" + } + ], + "sic": [ + { + "ids": 616, + "table": "laboratory", + "sub_var": "laboratoryid", + "class": "sic_itm" + } + ], + "picdb": [ + { + "table": "labevents", + "ids": [ + 5031 + ], + "sub_var": "itemid" + } + ] + } + }, + "bicar": { + "unit": [ + "mEq/L", + "mmol/l" + ], + "min": 5, + "max": 50, + "description": "bicarbonate", + "omopid": 4194291, + "category": "chemistry", + "sources": { + "aumc": [ + { + "ids": [ + 6810, + 9992 + ], + "table": "numericitems", + "sub_var": "itemid" + } + ], + "eicu": [ + { + "ids": "bicarbonate", + "table": "lab", + "sub_var": "labname" + } + ], + "eicu_demo": [ + { + "ids": "bicarbonate", + "table": "lab", + "sub_var": "labname" + } + ], + "hirid": [ + { + "ids": 20004200, + "table": "observations", + "sub_var": "variableid", + "class": "hrd_itm" + } + ], + "miiv": [ + { + "ids": 50882, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic": [ + { + "ids": 50882, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic_demo": [ + { + "ids": 50882, + "table": "labevents", + "sub_var": "itemid" + } + ], + "sic": [ + { + "ids": 456, + "table": "laboratory", + "sub_var": "laboratoryid", + "class": "sic_itm" + } + ], + "picdb": [ + { + "table": "labevents", + "ids": [ + 5248 + ], + "sub_var": "itemid" + } + ] + } + }, + "bili": { + "unit": "mg/dL", + "min": 0, + "max": 100, + "description": "total bilirubin", + "omopid": 4118986, + "category": "chemistry", + "sources": { + "aumc": [ + { + "ids": [ + 6813, + 9945 + ], + "table": "numericitems", + "sub_var": "itemid", + "callback": "convert_unit(binary_op(`*`, 0.058467), 'mg/dL')" + } + ], + "eicu": [ + { + "ids": "total bilirubin", + "table": "lab", + "sub_var": "labname" + } + ], + "eicu_demo": [ + { + "ids": "total bilirubin", + "table": "lab", + "sub_var": "labname" + } + ], + "hirid": [ + { + "ids": 20004300, + "table": "observations", + "sub_var": "variableid", + "callback": "convert_unit(binary_op(`*`, 0.058467), 'mg/dL')", + "class": "hrd_itm" + } + ], + "miiv": [ + { + "ids": 50885, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic": [ + { + "ids": 50885, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic_demo": [ + { + "ids": 50885, + "table": "labevents", + "sub_var": "itemid" + } + ], + "sic": [ + { + "ids": 333, + "table": "laboratory", + "sub_var": "laboratoryid", + "class": "sic_itm" + } + ], + "picdb": [ + { + "table": "labevents", + "ids": [ + 5075 + ], + "sub_var": "itemid", + "callback": "convert_unit(binary_op(`*`, 0.058467), 'mg/dL')" + } + ] + } + }, + "bili_dir": { + "unit": "mg/dL", + "min": 0, + "max": 50, + "description": "bilirubin direct", + "omopid": 4216632, + "category": "chemistry", + "sources": { + "aumc": [ + { + "ids": 6812, + "table": "numericitems", + "sub_var": "itemid", + "callback": "convert_unit(binary_op(`*`, 0.058467), 'mg/dL')" + } + ], + "eicu": [ + { + "ids": "direct bilirubin", + "table": "lab", + "sub_var": "labname" + } + ], + "eicu_demo": [ + { + "ids": "direct bilirubin", + "table": "lab", + "sub_var": "labname" + } + ], + "hirid": [ + { + "ids": 24000560, + "table": "observations", + "sub_var": "variableid", + "callback": "convert_unit(binary_op(`*`, 0.058467), 'mg/dL')", + "class": "hrd_itm" + } + ], + "miiv": [ + { + "ids": 50883, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic": [ + { + "ids": 50883, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic_demo": [ + { + "ids": 50883, + "table": "labevents", + "sub_var": "itemid" + } + ], + "sic": [ + { + "ids": 332, + "table": "laboratory", + "sub_var": "laboratoryid", + "class": "sic_itm" + } + ], + "picdb": [ + { + "table": "labevents", + "ids": [ + 5042 + ], + "sub_var": "itemid", + "callback": "convert_unit(binary_op(`*`, 0.058467), 'mg/dL')" + } + ] + } + }, + "bun": { + "unit": "mg/dL", + "min": 0, + "max": 200, + "description": "blood urea nitrogen", + "omopid": 4017361, + "category": "chemistry", + "sources": { + "aumc": [ + { + "ids": [ + 6850, + 9943 + ], + "table": "numericitems", + "sub_var": "itemid", + "callback": "convert_unit(binary_op(`*`, 2.8), 'mg/dL')" + } + ], + "eicu": [ + { + "ids": "BUN", + "table": "lab", + "sub_var": "labname" + } + ], + "eicu_demo": [ + { + "ids": "BUN", + "table": "lab", + "sub_var": "labname" + } + ], + "hirid": [ + { + "ids": 20004100, + "table": "observations", + "sub_var": "variableid", + "callback": "convert_unit(binary_op(`*`, 2.8), 'mg/dL')", + "class": "hrd_itm" + } + ], + "miiv": [ + { + "ids": 51006, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic": [ + { + "ids": 51006, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic_demo": [ + { + "ids": 51006, + "table": "labevents", + "sub_var": "itemid" + } + ], + "picdb": [ + { + "table": "labevents", + "ids": [ + 5224 + ], + "sub_var": "itemid", + "callback": "convert_unit(binary_op(`*`, 2.8), 'mg/dL')" + } + ] + } + }, + "ca": { + "unit": "mg/dL", + "min": 4, + "max": 20, + "description": "calcium", + "omopid": 4216722, + "category": "chemistry", + "sources": { + "aumc": [ + { + "ids": [ + 6817, + 9933 + ], + "table": "numericitems", + "sub_var": "itemid", + "callback": "convert_unit(binary_op(`*`, 4.008), 'mg/dL')" + } + ], + "eicu": [ + { + "ids": "calcium", + "table": "lab", + "sub_var": "labname", + "callback": "convert_unit(binary_op(`*`, 4), 'mg/dL', 'mmol/l')" + } + ], + "eicu_demo": [ + { + "ids": "calcium", + "table": "lab", + "sub_var": "labname", + "callback": "convert_unit(binary_op(`*`, 4), 'mg/dL', 'mmol/l')" + } + ], + "hirid": [ + { + "ids": 20005100, + "table": "observations", + "sub_var": "variableid", + "callback": "convert_unit(binary_op(`*`, 4.008), 'mg/dL')", + "class": "hrd_itm" + } + ], + "miiv": [ + { + "ids": 50893, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic": [ + { + "ids": 50893, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic_demo": [ + { + "ids": 50893, + "table": "labevents", + "sub_var": "itemid" + } + ], + "sic": [ + { + "ids": 457, + "table": "laboratory", + "sub_var": "laboratoryid", + "callback": "convert_unit(binary_op(`*`, 4.008), 'mg/dL', 'mmol/l')", + "class": "sic_itm" + } + ], + "picdb": [ + { + "ids": 5034, + "table": "labevents", + "sub_var": "itemid", + "callback": "convert_unit(binary_op(`*`, 4), 'mg/dL', 'mmol/L')" + } + ] + } + }, + "ck": { + "unit": [ + "IU/L", + "U/l" + ], + "min": 0, + "description": "creatine kinase", + "omopid": 4265595, + "category": "chemistry", + "sources": { + "aumc": [ + { + "ids": [ + 6822, + 11998 + ], + "table": "numericitems", + "sub_var": "itemid" + } + ], + "eicu": [ + { + "ids": "CPK", + "table": "lab", + "sub_var": "labname" + } + ], + "eicu_demo": [ + { + "ids": "CPK", + "table": "lab", + "sub_var": "labname" + } + ], + "hirid": [ + { + "ids": 24000210, + "table": "observations", + "sub_var": "variableid", + "class": "hrd_itm" + } + ], + "miiv": [ + { + "ids": 50910, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic": [ + { + "ids": 50910, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic_demo": [ + { + "ids": 50910, + "table": "labevents", + "sub_var": "itemid" + } + ], + "sic": [ + { + "ids": 611, + "table": "laboratory", + "sub_var": "laboratoryid", + "class": "sic_itm" + } + ], + "picdb": [ + { + "table": "labevents", + "ids": [ + 5038 + ], + "sub_var": "itemid" + } + ] + } + }, + "ckmb": { + "unit": "ng/mL", + "min": 0, + "description": "creatine kinase MB", + "omopid": 4017058, + "category": "chemistry", + "sources": { + "aumc": [ + { + "ids": 6824, + "table": "numericitems", + "sub_var": "itemid" + } + ], + "eicu": [ + { + "ids": "CPK-MB", + "table": "lab", + "sub_var": "labname" + } + ], + "eicu_demo": [ + { + "ids": "CPK-MB", + "table": "lab", + "sub_var": "labname" + } + ], + "hirid": [ + { + "ids": 24000220, + "table": "observations", + "sub_var": "variableid", + "class": "hrd_itm" + } + ], + "miiv": [ + { + "ids": 50911, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic": [ + { + "ids": 50911, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic_demo": [ + { + "ids": 50911, + "table": "labevents", + "sub_var": "itemid" + } + ], + "sic": [ + { + "ids": 253, + "table": "laboratory", + "sub_var": "laboratoryid", + "class": "sic_itm", + "callback": "convert_unit(identity_callback, 'ng/mL', 'µg/l')" + } + ], + "picdb": [ + { + "table": "labevents", + "ids": [ + 5039 + ], + "sub_var": "itemid", + "callback": "convert_unit(binary_op(`*`, 0.1893), 'ng/mL', 'U/L')" + } + ] + } + }, + "cl": { + "unit": [ + "mEq/L", + "mmol/l" + ], + "min": 80, + "max": 130, + "description": "chloride", + "omopid": 4188066, + "category": "chemistry", + "sources": { + "aumc": [ + { + "ids": 9930, + "table": "numericitems", + "sub_var": "itemid" + } + ], + "eicu": [ + { + "ids": "chloride", + "table": "lab", + "sub_var": "labname" + } + ], + "eicu_demo": [ + { + "ids": "chloride", + "table": "lab", + "sub_var": "labname" + } + ], + "hirid": [ + { + "ids": [ + 24000439, + 24000521 + ], + "table": "observations", + "sub_var": "variableid", + "class": "hrd_itm" + } + ], + "miiv": [ + { + "ids": 50902, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic": [ + { + "ids": 50902, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic_demo": [ + { + "ids": 50902, + "table": "labevents", + "sub_var": "itemid" + } + ], + "sic": [ + { + "ids": [ + 683, + 450 + ], + "table": "laboratory", + "sub_var": "laboratoryid", + "class": "sic_itm" + } + ], + "picdb": [ + { + "table": "labevents", + "ids": [ + 5218 + ], + "sub_var": "itemid" + } + ] + } + }, + "crea": { + "unit": "mg/dL", + "min": 0, + "max": 15, + "description": "creatinine", + "omopid": 4013964, + "category": "chemistry", + "sources": { + "aumc": [ + { + "ids": [ + 6836, + 9941, + 14216 + ], + "table": "numericitems", + "sub_var": "itemid", + "callback": "convert_unit(binary_op(`*`, 0.011309), 'mg/dL')" + } + ], + "eicu": [ + { + "ids": "creatinine", + "table": "lab", + "sub_var": "labname" + } + ], + "eicu_demo": [ + { + "ids": "creatinine", + "table": "lab", + "sub_var": "labname" + } + ], + "hirid": [ + { + "ids": 20000600, + "table": "observations", + "sub_var": "variableid", + "callback": "convert_unit(binary_op(`*`, 0.011312), 'mg/dL')", + "class": "hrd_itm" + } + ], + "miiv": [ + { + "ids": 50912, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic": [ + { + "ids": 50912, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic_demo": [ + { + "ids": 50912, + "table": "labevents", + "sub_var": "itemid" + } + ], + "sic": [ + { + "ids": 367, + "table": "laboratory", + "sub_var": "laboratoryid", + "class": "sic_itm" + } + ], + "picdb": [ + { + "table": "labevents", + "ids": [ + 5032, + 5041, + 6954 + ], + "sub_var": "itemid", + "callback": "convert_unit(binary_op(`*`, 0.011312), 'mg/dL')" + } + ] + } + }, + "crp": { + "unit": "mg/L", + "min": 0, + "description": "C-reactive protein", + "omopid": 4208414, + "category": "chemistry", + "sources": { + "aumc": [ + { + "ids": [ + 6825, + 10079 + ], + "table": "numericitems", + "sub_var": "itemid" + } + ], + "eicu": [ + { + "ids": "CRP", + "table": "lab", + "sub_var": "labname", + "callback": "convert_unit(binary_op(`*`, 10), 'mg/L', 'mg/dl')" + } + ], + "eicu_demo": [ + { + "ids": "CRP", + "table": "lab", + "sub_var": "labname", + "callback": "convert_unit(binary_op(`*`, 10), 'mg/L', 'mg/dl')" + } + ], + "hirid": [ + { + "ids": 20002200, + "table": "observations", + "sub_var": "variableid", + "class": "hrd_itm" + } + ], + "miiv": [ + { + "ids": 50889, + "table": "labevents", + "sub_var": "itemid", + "callback": "convert_unit(binary_op(`*`, 10), 'mg/L', 'mg/dl')" + } + ], + "mimic": [ + { + "ids": 50889, + "table": "labevents", + "sub_var": "itemid", + "callback": "convert_unit(binary_op(`*`, 10), 'mg/L', 'mg/dl')" + } + ], + "mimic_demo": [ + { + "ids": 50889, + "table": "labevents", + "sub_var": "itemid", + "callback": "convert_unit(binary_op(`*`, 10), 'mg/L', 'mg/dl')" + } + ], + "sic": [ + { + "ids": 341, + "table": "laboratory", + "sub_var": "laboratoryid", + "class": "sic_itm", + "callback": "convert_unit(binary_op(`*`, 10), 'mg/L', 'mg/dl')" + } + ], + "picdb": [ + { + "table": "labevents", + "ids": [ + 5626, + 5821 + ], + "sub_var": "itemid" + } + ] + } + }, + "glu": { + "unit": "mg/dL", + "min": 0, + "max": 1000, + "description": "glucose", + "omopid": 4144235, + "category": "chemistry", + "sources": { + "aumc": [ + { + "ids": [ + 6833, + 9557, + 9947 + ], + "table": "numericitems", + "sub_var": "itemid", + "callback": "convert_unit(binary_op(`*`, 18.016), 'mg/dL')" + } + ], + "eicu": [ + { + "ids": "glucose", + "table": "lab", + "sub_var": "labname" + }, + { + "ids": "bedside glucose", + "table": "lab", + "sub_var": "labname" + } + ], + "eicu_demo": [ + { + "ids": "glucose", + "table": "lab", + "sub_var": "labname" + }, + { + "ids": "bedside glucose", + "table": "lab", + "sub_var": "labname" + } + ], + "hirid": [ + { + "ids": [ + 20005110, + 24000523, + 24000585 + ], + "table": "observations", + "sub_var": "variableid", + "callback": "convert_unit(binary_op(`*`, 18.016), 'mg/dL')", + "class": "hrd_itm" + } + ], + "miiv": [ + { + "ids": [ + 50809, + 50931 + ], + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic": [ + { + "ids": [ + 50809, + 50931 + ], + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic_demo": [ + { + "ids": [ + 50809, + 50931 + ], + "table": "labevents", + "sub_var": "itemid" + } + ], + "sic": [ + { + "ids": [ + 348, + 656 + ], + "table": "laboratory", + "sub_var": "laboratoryid", + "class": "sic_itm" + } + ], + "picdb": [ + { + "table": "labevents", + "ids": [ + 5047, + 5223 + ], + "sub_var": "itemid", + "callback": "convert_unit(binary_op(`*`, 18.016), 'mg/dL')" + } + ] + } + }, + "k": { + "unit": [ + "mEq/L", + "mmol/l" + ], + "min": 0, + "max": 10, + "description": "potassium", + "omopid": 4207483, + "category": "chemistry", + "sources": { + "aumc": [ + { + "ids": [ + 6835, + 9556, + 9927, + 10285 + ], + "table": "numericitems", + "sub_var": "itemid" + } + ], + "eicu": [ + { + "ids": "potassium", + "table": "lab", + "sub_var": "labname" + } + ], + "eicu_demo": [ + { + "ids": "potassium", + "table": "lab", + "sub_var": "labname" + } + ], + "hirid": [ + { + "ids": [ + 20000500, + 24000520, + 24000833, + 24000867 + ], + "table": "observations", + "sub_var": "variableid", + "class": "hrd_itm" + } + ], + "miiv": [ + { + "ids": 50971, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic": [ + { + "ids": 50971, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic_demo": [ + { + "ids": 50971, + "table": "labevents", + "sub_var": "itemid" + } + ], + "sic": [ + { + "ids": [463, 685], + "table": "laboratory", + "sub_var": "laboratoryid", + "class": "sic_itm" + } + ], + "picdb": [ + { + "table": "labevents", + "ids": [ + 5226 + ], + "sub_var": "itemid" + } + ] + } + }, + "mg": { + "unit": "mg/dL", + "min": 0.5, + "max": 5, + "description": "magnesium", + "omopid": 4243005, + "category": "chemistry", + "sources": { + "aumc": [ + { + "ids": [ + 6839, + 9952 + ], + "table": "numericitems", + "sub_var": "itemid", + "callback": "convert_unit(binary_op(`*`, 2.431), 'mg/dL')" + } + ], + "eicu": [ + { + "ids": "magnesium", + "table": "lab", + "sub_var": "labname", + "callback": "convert_unit(binary_op(`/`, 1.215), 'mg/dL', 'mEq/L')" + } + ], + "eicu_demo": [ + { + "ids": "magnesium", + "table": "lab", + "sub_var": "labname", + "callback": "convert_unit(binary_op(`/`, 1.215), 'mg/dL', 'mEq/L')" + } + ], + "hirid": [ + { + "ids": 24000230, + "table": "observations", + "sub_var": "variableid", + "callback": "convert_unit(binary_op(`*`, 2.431), 'mg/dL')", + "class": "hrd_itm" + } + ], + "miiv": [ + { + "ids": 50960, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic": [ + { + "ids": 50960, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic_demo": [ + { + "ids": 50960, + "table": "labevents", + "sub_var": "itemid" + } + ], + "sic": [ + { + "ids": 468, + "table": "laboratory", + "sub_var": "laboratoryid", + "callback": "convert_unit(binary_op(`*`, 2.431), 'mg/dL')", + "class": "sic_itm" + } + ], + "picdb": [ + { + "table": "labevents", + "ids": [ + 5059 + ], + "sub_var": "itemid", + "callback": "convert_unit(binary_op(`*`, 2.431), 'mg/dL')" + } + ] + } + }, + "na": { + "unit": [ + "mEq/L", + "mmol/l" + ], + "min": 110, + "max": 165, + "description": "sodium", + "omopid": 4208938, + "category": "chemistry", + "sources": { + "aumc": [ + { + "ids": [ + 6840, + 9555, + 9924, + 10284 + ], + "table": "numericitems", + "sub_var": "itemid" + } + ], + "eicu": [ + { + "ids": "sodium", + "table": "lab", + "sub_var": "labname" + } + ], + "eicu_demo": [ + { + "ids": "sodium", + "table": "lab", + "sub_var": "labname" + } + ], + "hirid": [ + { + "ids": [ + 20000400, + 24000519, + 24000658, + 24000835, + 24000866 + ], + "table": "observations", + "sub_var": "variableid", + "class": "hrd_itm" + } + ], + "miiv": [ + { + "ids": 50983, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic": [ + { + "ids": 50983, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic_demo": [ + { + "ids": 50983, + "table": "labevents", + "sub_var": "itemid" + } + ], + "sic": [ + { + "ids": [ + 469, + 686 + ], + "table": "laboratory", + "sub_var": "laboratoryid", + "class": "sic_itm" + } + ], + "picdb": [ + { + "table": "labevents", + "ids": [ + 5230 + ], + "sub_var": "itemid" + } + ] + } + }, + "phos": { + "unit": "mg/dL", + "min": 0, + "max": 40, + "description": "phosphate", + "omopid": 4017907, + "category": "chemistry", + "sources": { + "aumc": [ + { + "ids": [ + 6828, + 9935 + ], + "table": "numericitems", + "sub_var": "itemid", + "callback": "convert_unit(binary_op(`*`, 3.097521), 'mg/dL')" + } + ], + "eicu": [ + { + "ids": "phosphate", + "table": "lab", + "sub_var": "labname" + } + ], + "eicu_demo": [ + { + "ids": "phosphate", + "table": "lab", + "sub_var": "labname" + } + ], + "hirid": [ + { + "ids": 20002500, + "table": "observations", + "sub_var": "variableid", + "callback": "convert_unit(binary_op(`*`, 3.097521), 'mg/dL')", + "class": "hrd_itm" + } + ], + "miiv": [ + { + "ids": 50970, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic": [ + { + "ids": 50970, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic_demo": [ + { + "ids": 50970, + "table": "labevents", + "sub_var": "itemid" + } + ], + "sic": [ + { + "ids": 471, + "table": "laboratory", + "sub_var": "laboratoryid", + "callback": "convert_unit(binary_op(`*`, 3.097521), 'mg/dL')", + "class": "sic_itm" + } + ], + "picdb": [ + { + "table": "labevents", + "ids": [ + 5072 + ], + "sub_var": "itemid", + "callback": "convert_unit(binary_op(`*`, 3.097521), 'mg/dL')" + } + ] + } + }, + "tnt": { + "unit": "ng/mL", + "min": 0, + "description": "troponin t", + "omopid": 4005525, + "category": "chemistry", + "sources": { + "aumc": [ + { + "ids": 10407, + "table": "numericitems", + "sub_var": "itemid" + } + ], + "eicu": [ + { + "ids": "troponin - T", + "table": "lab", + "sub_var": "labname" + } + ], + "eicu_demo": [ + { + "ids": "troponin - T", + "table": "lab", + "sub_var": "labname" + } + ], + "hirid": [ + { + "ids": 24000806, + "table": "observations", + "sub_var": "variableid", + "callback": "convert_unit(binary_op(`/`, 1000), 'ng/mL')", + "class": "hrd_itm" + } + ], + "miiv": [ + { + "ids": 51003, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic": [ + { + "ids": 51003, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic_demo": [ + { + "ids": 51003, + "table": "labevents", + "sub_var": "itemid" + } + ], + "sic": [ + { + "ids": 481, + "table": "laboratory", + "sub_var": "laboratoryid", + "callback": "convert_unit(binary_op(`/`, 1000), 'ng/mL', 'ng/L')", + "class": "sic_itm" + } + ], + "picdb": [ + { + "table": "labevents", + "ids": [ + 6525 + ], + "sub_var": "itemid", + "callback": "convert_unit(binary_op(`/`, 1000), 'ng/mL', 'pg/m')" + }, + { + "table": "labevents", + "ids": [ + 6525 + ], + "sub_var": "itemid", + "val_var": "value", + "callback": "apply_map(c(`<0.003` = 0.003))" + } + ] + } + }, + "tri": { + "unit": "ng/mL", + "min": 0, + "description": "troponin I", + "omopid": 4007805, + "category": "chemistry", + "sources": { + "eicu": [ + { + "ids": "troponin - I", + "table": "lab", + "sub_var": "labname" + } + ], + "eicu_demo": [ + { + "ids": "troponin - I", + "table": "lab", + "sub_var": "labname" + } + ], + "miiv": [ + { + "ids": 51002, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic": [ + { + "ids": 51002, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic_demo": [ + { + "ids": 51002, + "table": "labevents", + "sub_var": "itemid" + } + ], + "sic": [ + { + "ids": 270, + "table": "laboratory", + "sub_var": "laboratoryid", + "class": "sic_itm" + } + ], + "picdb": [ + { + "table": "labevents", + "ids": [ + 6192 + ], + "sub_var": "itemid" + } + ] + } + } +} \ No newline at end of file diff --git a/inst/extdata/config/concept-dict/demographics.json b/inst/extdata/config/concept-dict/demographics.json new file mode 100644 index 00000000..f4723d6d --- /dev/null +++ b/inst/extdata/config/concept-dict/demographics.json @@ -0,0 +1,423 @@ +{ + "adm": { + "target": "id_tbl", + "levels": [ + "med", + "surg", + "other" + ], + "class": "fct_cncpt", + "description": "patient admission type", + "category": "demographics", + "sources": { + "aumc": [ + { + "val_var": "specialty", + "table": "admissions", + "callback": "apply_map( c(Cardiochirurgie = 'surg', Cardiologie = 'med', ders = 'other', Gynaecologie = 'other', `Heelkunde Gastro-enterologie` = 'surg', `Heelkunde Longen/Oncologie` = 'surg', `Heelkunde Oncologie` = 'surg', Hematologie = 'med', `Intensive Care Volwassenen` = 'other', Inwendig = 'med', `Keel, Neus & Oorarts` = 'surg', Longziekte = 'med', `Maag-,Darm-,Leverziekten` = 'med', Mondheelkunde = 'surg', Nefrologie = 'med', Neurochirurgie = 'surg', Neurologie = 'med', Obstetrie = 'other', `Oncologie Inwendig` = 'med', Oogheelkunde = 'surg', Orthopedie = 'surg', `Plastische chirurgie` = 'surg', Reumatologie = 'med', Traumatologie = 'surg', Urologie = 'surg', Vaatchirurgie = 'surg', Verloskunde = 'other'))", + "class": "col_itm" + } + ], + "eicu": [ + { + "table": "admissiondx", + "val_var": "admitdxpath", + "callback": "eicu_adx", + "class": "col_itm" + } + ], + "eicu_demo": [ + { + "table": "admissiondx", + "val_var": "admitdxpath", + "callback": "eicu_adx", + "class": "col_itm" + } + ], + "miiv": [ + { + "table": "services", + "val_var": "curr_service", + "callback": "apply_map(\n c(MED = 'med', SURG = 'surg', CMED = 'med', CSURG = 'surg',\n VSURG = 'surg', NSURG = 'surg', NB = 'other', NMED = 'med',\n ORTHO = 'surg', TRAUM = 'surg', OMED = 'med', GU = 'other',\n NBB = 'other', TSURG = 'surg', GYN = 'other', PSURG = 'surg',\n OBS = 'other', ENT = 'surg', DENT = 'surg', PSYCH = 'other')\n )", + "class": "col_itm" + } + ], + "mimic": [ + { + "table": "services", + "val_var": "curr_service", + "callback": "apply_map(\n c(MED = 'med', SURG = 'surg', CMED = 'med', CSURG = 'surg',\n VSURG = 'surg', NSURG = 'surg', NB = 'other', NMED = 'med',\n ORTHO = 'surg', TRAUM = 'surg', OMED = 'med', GU = 'other',\n NBB = 'other', TSURG = 'surg', GYN = 'other', PSURG = 'surg',\n OBS = 'other', ENT = 'surg', DENT = 'surg', PSYCH = 'other')\n )", + "class": "col_itm" + } + ], + "mimic_demo": [ + { + "table": "services", + "val_var": "curr_service", + "callback": "apply_map(\n c(MED = 'med', SURG = 'surg', CMED = 'med', CSURG = 'surg',\n VSURG = 'surg', NSURG = 'surg', NB = 'other', NMED = 'med',\n ORTHO = 'surg', TRAUM = 'surg', OMED = 'med', GU = 'other',\n NBB = 'other', TSURG = 'surg', GYN = 'other', PSURG = 'surg',\n OBS = 'other', ENT = 'surg', DENT = 'surg', PSYCH = 'other')\n )", + "class": "col_itm" + } + ], + "picdb": [] + } + }, + "age": { + "unit": "years", + "min": 0, + "max": 100, + "target": "id_tbl", + "description": "patient age", + "omopid": 4314456, + "category": "demographics", + "sources": { + "aumc": [ + { + "val_var": "agegroup", + "table": "admissions", + "callback": "apply_map(c(`18-39` = 30, `40-49` = 45, `50-59` = 55, `60-69` = 65, `70-79` = 75, `80+` = 90))", + "class": "col_itm" + } + ], + "eicu": [ + { + "table": "patient", + "val_var": "age", + "callback": "transform_fun(eicu_age)", + "class": "col_itm" + } + ], + "eicu_demo": [ + { + "table": "patient", + "val_var": "age", + "callback": "transform_fun(eicu_age)", + "class": "col_itm" + } + ], + "hirid": [ + { + "table": "general", + "val_var": "age", + "class": "col_itm" + } + ], + "miiv": [ + { + "table": "patients", + "val_var": "anchor_age", + "class": "col_itm" + } + ], + "mimic": [ + { + "table": "patients", + "val_var": "dob", + "callback": "transform_fun(mimic_age)", + "class": "col_itm" + } + ], + "mimic_demo": [ + { + "table": "patients", + "val_var": "dob", + "callback": "transform_fun(mimic_age)", + "class": "col_itm" + } + ], + "sic": [ + { + "table": "cases", + "val_var": "ageonadmission", + "class": "col_itm" + } + ], + "picdb": [ + { + "table": "patients", + "val_var": "dob", + "callback": "transform_fun(mimic_age)", + "class": "col_itm" + } + ] + } + }, + "bmi": { + "concepts": [ + "weight", + "height" + ], + "description": "patient body mass index", + "omopid": 4245997, + "category": "demographics", + "callback": "bmi", + "target": "id_tbl", + "class": "rec_cncpt" + }, + "height": { + "unit": "cm", + "min": 10, + "max": 230, + "target": "id_tbl", + "description": "patient height", + "omopid": 607590, + "category": "demographics", + "sources": { + "aumc": [ + { + "val_var": "heightgroup", + "table": "admissions", + "callback": "apply_map(c(`159-` = 150, `160-169` = 165, `170-179` = 175, `180-189` = 185, `190+` = 200))", + "class": "col_itm" + } + ], + "eicu": [ + { + "table": "patient", + "val_var": "admissionheight", + "class": "col_itm" + } + ], + "eicu_demo": [ + { + "table": "patient", + "val_var": "admissionheight", + "class": "col_itm" + } + ], + "hirid": [ + { + "ids": 10000450, + "table": "observations", + "sub_var": "variableid", + "class": "hrd_itm" + } + ], + "miiv": [ + { + "ids": 226707, + "table": "chartevents", + "sub_var": "itemid", + "callback": "convert_unit(binary_op(`*`, 2.54), 'cm', '^in')" + } + ], + "mimic": [ + { + "ids": [ + 920, + 1394, + 3485, + 4187, + 4188, + 3486, + 226707 + ], + "table": "chartevents", + "sub_var": "itemid", + "callback": "convert_unit(binary_op(`*`, 2.54), 'cm', '^in')" + } + ], + "mimic_demo": [ + { + "ids": [ + 920, + 1394, + 3485, + 4187, + 4188, + 3486, + 226707 + ], + "table": "chartevents", + "sub_var": "itemid", + "callback": "convert_unit(binary_op(`*`, 2.54), 'cm', '^in')" + } + ], + "sic": [ + { + "table": "cases", + "val_var": "heightonadmission", + "class": "col_itm" + } + ], + "picdb": [ + { + "table": "chartevents", + "ids": [ + 1013 + ], + "sub_var": "itemid" + } + ] + } + }, + "sex": { + "target": "id_tbl", + "levels": [ + "Female", + "Male" + ], + "class": "fct_cncpt", + "description": "patient sex", + "omopid": 37116947, + "category": "demographics", + "sources": { + "aumc": [ + { + "val_var": "gender", + "table": "admissions", + "callback": "apply_map(c(Vrouw = 'Female', Man = 'Male'))", + "class": "col_itm" + } + ], + "eicu": [ + { + "table": "patient", + "val_var": "gender", + "class": "col_itm" + } + ], + "eicu_demo": [ + { + "table": "patient", + "val_var": "gender", + "class": "col_itm" + } + ], + "hirid": [ + { + "table": "general", + "val_var": "sex", + "callback": "apply_map(c(M = 'Male', F = 'Female'))", + "class": "col_itm" + } + ], + "miiv": [ + { + "table": "patients", + "val_var": "gender", + "callback": "apply_map(c(M = 'Male', F = 'Female'))", + "class": "col_itm" + } + ], + "mimic": [ + { + "table": "patients", + "val_var": "gender", + "callback": "apply_map(c(M = 'Male', F = 'Female'))", + "class": "col_itm" + } + ], + "mimic_demo": [ + { + "table": "patients", + "val_var": "gender", + "callback": "apply_map(c(M = 'Male', F = 'Female'))", + "class": "col_itm" + } + ], + "sic": [ + { + "table": "cases", + "val_var": "sex", + "class": "col_itm", + "callback": "apply_map(c(`735` = 'Male', `736` = 'Female'))" + } + ], + "picdb": [ + { + "table": "patients", + "val_var": "gender", + "class": "col_itm", + "callback": "apply_map(c(M = 'Male', F = 'Female'))" + } + ] + } + }, + "weight": { + "unit": "kg", + "min": 1, + "max": 500, + "target": "id_tbl", + "description": "patient weight", + "omopid": 4099154, + "category": "demographics", + "sources": { + "aumc": [ + { + "val_var": "weightgroup", + "table": "admissions", + "callback": "apply_map(c(`59-` = 50, `60-69` = 65, `70-79` = 75, `80-89` = 85, `90-99` = 95, `100-109` = 105, `110+` = 120))", + "class": "col_itm" + } + ], + "eicu": [ + { + "table": "patient", + "val_var": "admissionweight", + "class": "col_itm" + } + ], + "eicu_demo": [ + { + "table": "patient", + "val_var": "admissionweight", + "class": "col_itm" + } + ], + "hirid": [ + { + "ids": 10000400, + "table": "observations", + "sub_var": "variableid", + "class": "hrd_itm" + } + ], + "miiv": [ + { + "ids": 226512, + "table": "chartevents", + "sub_var": "itemid" + } + ], + "mimic": [ + { + "ids": [ + 762, + 4183, + 226512 + ], + "table": "chartevents", + "sub_var": "itemid" + } + ], + "mimic_demo": [ + { + "ids": [ + 762, + 4183, + 226512 + ], + "table": "chartevents", + "sub_var": "itemid" + } + ], + "sic": [ + { + "table": "cases", + "val_var": "weightonadmission", + "class": "col_itm", + "callback": "transform_fun(binary_op(`/`, 1000))" + } + ], + "picdb": [ + { + "table": "chartevents", + "ids": [ + 1014 + ], + "sub_var": "itemid" + } + ] + } + } +} \ No newline at end of file diff --git a/inst/extdata/config/concept-dict/hematology.json b/inst/extdata/config/concept-dict/hematology.json new file mode 100644 index 00000000..735e071b --- /dev/null +++ b/inst/extdata/config/concept-dict/hematology.json @@ -0,0 +1,1491 @@ +{ + "basos": { + "unit": "%", + "min": 0, + "max": 50, + "description": "basophils", + "omopid": 4172647, + "category": "hematology", + "sources": { + "aumc": [ + { + "ids": 11710, + "table": "numericitems", + "sub_var": "itemid" + }, + { + "ids": 14256, + "table": "numericitems", + "sub_var": "itemid", + "callback": "blood_cell_ratio" + } + ], + "eicu": [ + { + "ids": "-basos", + "table": "lab", + "sub_var": "labname" + } + ], + "eicu_demo": [ + { + "ids": "-basos", + "table": "lab", + "sub_var": "labname" + } + ], + "miiv": [ + { + "ids": 51146, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic": [ + { + "ids": 51146, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic_demo": [ + { + "ids": 51146, + "table": "labevents", + "sub_var": "itemid" + } + ], + "sic": [ + { + "ids": 174, + "table": "laboratory", + "sub_var": "laboratoryid", + "class": "sic_itm" + }, + { + "ids": 295, + "table": "laboratory", + "sub_var": "laboratoryid", + "callback": "blood_cell_ratio", + "class": "sic_itm" + } + ], + "picdb": [ + { + "table": "labevents", + "ids": [ + 5492 + ], + "sub_var": "itemid" + } + ] + } + }, + "bnd": { + "unit": "%", + "description": "band form neutrophils", + "omopid": 4100147, + "category": "hematology", + "sources": { + "aumc": [ + { + "ids": [ + 6796, + 11586 + ], + "table": "numericitems", + "sub_var": "itemid" + } + ], + "eicu": [ + { + "ids": "-bands", + "table": "lab", + "sub_var": "labname" + } + ], + "eicu_demo": [ + { + "ids": "-bands", + "table": "lab", + "sub_var": "labname" + } + ], + "hirid": [ + { + "ids": 24000557, + "table": "observations", + "sub_var": "variableid", + "class": "hrd_itm" + } + ], + "miiv": [ + { + "ids": 51144, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic": [ + { + "ids": 51144, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic_demo": [ + { + "ids": 51144, + "table": "labevents", + "sub_var": "itemid" + } + ], + "picdb": [] + } + }, + "eos": { + "unit": "%", + "min": 0, + "max": 50, + "description": "eosinophils", + "omopid": 4216098, + "category": "hematology", + "sources": { + "aumc": [ + { + "ids": 6773, + "table": "numericitems", + "sub_var": "itemid" + }, + { + "ids": 9967, + "table": "numericitems", + "sub_var": "itemid", + "callback": "blood_cell_ratio" + } + ], + "eicu": [ + { + "ids": "-eos", + "table": "lab", + "sub_var": "labname" + } + ], + "eicu_demo": [ + { + "ids": "-eos", + "table": "lab", + "sub_var": "labname" + } + ], + "miiv": [ + { + "ids": 51200, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic": [ + { + "ids": 51200, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic_demo": [ + { + "ids": 51200, + "table": "labevents", + "sub_var": "itemid" + } + ], + "sic": [ + { + "ids": 197, + "table": "laboratory", + "sub_var": "laboratoryid", + "class": "sic_itm" + }, + { + "ids": 299, + "table": "laboratory", + "sub_var": "laboratoryid", + "callback": "blood_cell_ratio", + "class": "sic_itm" + } + ], + "picdb": [ + { + "table": "labevents", + "ids": [ + 5002 + ], + "sub_var": "itemid" + } + ] + } + }, + "esr": { + "unit": [ + "mm/hr", + "mm/1h" + ], + "min": 0, + "max": 200, + "description": "erythrocyte sedimentation rate", + "omopid": 4212065, + "category": "hematology", + "sources": { + "aumc": [ + { + "ids": [ + 6808, + 11902 + ], + "table": "numericitems", + "sub_var": "itemid" + } + ], + "hirid": [ + { + "ids": 24000668, + "table": "observations", + "sub_var": "variableid", + "class": "hrd_itm" + } + ], + "miiv": [ + { + "ids": 51288, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic": [ + { + "ids": 51288, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic_demo": [ + { + "ids": 51288, + "table": "labevents", + "sub_var": "itemid" + } + ], + "picdb": [] + } + }, + "fgn": { + "unit": "mg/dL", + "min": 0, + "max": 1500, + "description": "fibrinogen", + "omopid": 4094436, + "category": "hematology", + "sources": { + "aumc": [ + { + "ids": [ + 6776, + 9989, + 10175 + ], + "table": "numericitems", + "sub_var": "itemid", + "callback": "convert_unit(binary_op(`*`, 100), 'mg/dL')" + } + ], + "eicu": [ + { + "ids": "fibrinogen", + "table": "lab", + "sub_var": "labname" + } + ], + "eicu_demo": [ + { + "ids": "fibrinogen", + "table": "lab", + "sub_var": "labname" + } + ], + "hirid": [ + { + "ids": 24000536, + "table": "observations", + "sub_var": "variableid", + "callback": "convert_unit(binary_op(`*`, 100), 'mg/dL')", + "class": "hrd_itm" + } + ], + "miiv": [ + { + "ids": 51214, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic": [ + { + "ids": 51214, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic_demo": [ + { + "ids": 51214, + "table": "labevents", + "sub_var": "itemid" + } + ], + "sic": [ + { + "ids": 344, + "table": "laboratory", + "sub_var": "laboratoryid", + "class": "sic_itm" + } + ], + "picdb": [] + } + }, + "hba1c": { + "unit": "%", + "description": "Hemoglobin A1C", + "omopid": 4184637, + "category": "hematology", + "sources": { + "aumc": [ + { + "ids": [ + 11812, + 16166 + ], + "table": "numericitems", + "sub_var": "itemid" + } + ], + "miiv": [ + { + "ids": 50852, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic": [ + { + "ids": 50852, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic_demo": [ + { + "ids": 50852, + "table": "labevents", + "sub_var": "itemid" + } + ], + "sic": [ + { + "ids": 214, + "table": "laboratory", + "sub_var": "laboratoryid", + "class": "sic_itm" + } + ], + "picdb": [] + } + }, + "hct": { + "unit": "%", + "min": 15, + "max": 60, + "description": "hematocrit", + "omopid": 4151358, + "category": "hematology", + "sources": { + "aumc": [ + { + "ids": [ + 6777, + 11423, + 11545 + ], + "table": "numericitems", + "sub_var": "itemid", + "callback": "transform_fun(binary_op(`*`, 100))" + } + ], + "eicu": [ + { + "ids": "Hct", + "table": "lab", + "sub_var": "labname" + } + ], + "eicu_demo": [ + { + "ids": "Hct", + "table": "lab", + "sub_var": "labname" + } + ], + "miiv": [ + { + "ids": 51221, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic": [ + { + "ids": 51221, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic_demo": [ + { + "ids": 51221, + "table": "labevents", + "sub_var": "itemid" + } + ], + "sic": [ + { + "ids": [ + 217, + 682 + ], + "table": "laboratory", + "sub_var": "laboratoryid", + "class": "sic_itm" + } + ], + "picdb": [ + { + "table": "labevents", + "ids": [ + 5097, + 5225 + ], + "sub_var": "itemid" + } + ] + } + }, + "hgb": { + "unit": "g/dL", + "min": 4, + "max": 18, + "description": "hemoglobin", + "omopid": 4118981, + "category": "hematology", + "sources": { + "aumc": [ + { + "ids": [ + 6778, + 9553, + 9960, + 10286, + 19703 + ], + "table": "numericitems", + "sub_var": "itemid", + "callback": "convert_unit(binary_op(`*`, 1.611344), 'g/dL')" + } + ], + "eicu": [ + { + "ids": "Hgb", + "table": "lab", + "sub_var": "labname" + } + ], + "eicu_demo": [ + { + "ids": "Hgb", + "table": "lab", + "sub_var": "labname" + } + ], + "hirid": [ + { + "ids": [ + 24000548, + 24000836, + 20000900 + ], + "table": "observations", + "sub_var": "variableid", + "callback": "convert_unit(binary_op(`*`, 0.1), 'g/dL', 'g/l')", + "class": "hrd_itm" + } + ], + "miiv": [ + { + "ids": 51222, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic": [ + { + "ids": 51222, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic_demo": [ + { + "ids": 51222, + "table": "labevents", + "sub_var": "itemid" + } + ], + "sic": [ + { + "ids": [ + 658, + 289 + ], + "table": "laboratory", + "sub_var": "laboratoryid", + "class": "sic_itm" + } + ], + "picdb": [ + { + "table": "labevents", + "ids": [ + 5099, + 5257 + ], + "sub_var": "itemid" + } + ] + } + }, + "inr_pt": { + "description": "prothrombin time/international normalized ratio", + "omopid": 4306239, + "category": "hematology", + "sources": { + "aumc": [ + { + "ids": 11893, + "table": "numericitems", + "sub_var": "itemid" + } + ], + "eicu": [ + { + "ids": "PT - INR", + "table": "lab", + "sub_var": "labname" + } + ], + "eicu_demo": [ + { + "ids": "PT - INR", + "table": "lab", + "sub_var": "labname" + } + ], + "hirid": [ + { + "ids": 24000567, + "table": "observations", + "sub_var": "variableid", + "class": "hrd_itm" + } + ], + "miiv": [ + { + "ids": 51237, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic": [ + { + "ids": 51237, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic_demo": [ + { + "ids": 51237, + "table": "labevents", + "sub_var": "itemid" + } + ], + "picdb": [] + } + }, + "lymph": { + "unit": "%", + "min": 0, + "max": 100, + "description": "lymphocytes", + "omopid": 4254663, + "category": "hematology", + "sources": { + "aumc": [ + { + "ids": 11846, + "table": "numericitems", + "sub_var": "itemid" + }, + { + "ids": 14258, + "table": "numericitems", + "sub_var": "itemid", + "callback": "blood_cell_ratio" + } + ], + "eicu": [ + { + "ids": "-lymphs", + "table": "lab", + "sub_var": "labname" + } + ], + "eicu_demo": [ + { + "ids": "-lymphs", + "table": "lab", + "sub_var": "labname" + } + ], + "hirid": [ + { + "ids": 24000480, + "table": "observations", + "sub_var": "variableid", + "callback": "blood_cell_ratio", + "class": "hrd_itm" + } + ], + "miiv": [ + { + "ids": 51244, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic": [ + { + "ids": 51244, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic_demo": [ + { + "ids": 51244, + "table": "labevents", + "sub_var": "itemid" + } + ], + "sic": [ + { + "ids": 223, + "table": "laboratory", + "sub_var": "laboratoryid", + "class": "sic_itm" + }, + { + "ids": 302, + "table": "laboratory", + "sub_var": "laboratoryid", + "callback": "blood_cell_ratio", + "class": "sic_itm" + } + ], + "picdb": [] + } + }, + "mch": { + "unit": "pg", + "min": 0, + "description": "mean corpuscular hemoglobin", + "omopid": 4182871, + "category": "hematology", + "sources": { + "aumc": [ + { + "ids": 11679, + "table": "numericitems", + "sub_var": "itemid", + "callback": "convert_unit(binary_op(`*`, 0.016113), 'pg')" + } + ], + "eicu": [ + { + "ids": "MCH", + "table": "lab", + "sub_var": "labname" + } + ], + "eicu_demo": [ + { + "ids": "MCH", + "table": "lab", + "sub_var": "labname" + } + ], + "hirid": [ + { + "ids": 24000160, + "table": "observations", + "sub_var": "variableid", + "class": "hrd_itm" + } + ], + "miiv": [ + { + "ids": 51248, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic": [ + { + "ids": 51248, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic_demo": [ + { + "ids": 51248, + "table": "labevents", + "sub_var": "itemid" + } + ], + "sic": [ + { + "ids": 566, + "table": "laboratory", + "sub_var": "laboratoryid", + "class": "sic_itm" + } + ], + "picdb": [ + { + "table": "labevents", + "ids": [ + 5113 + ], + "sub_var": "itemid" + } + ] + } + }, + "mchc": { + "unit": "%", + "min": 20, + "max": 50, + "description": "mean corpuscular hemoglobin concentration", + "omopid": 4290193, + "category": "hematology", + "sources": { + "aumc": [ + { + "ids": 18666, + "table": "numericitems", + "sub_var": "itemid", + "callback": "convert_unit(binary_op(`*`, 1.611), '%')" + } + ], + "eicu": [ + { + "ids": "MCHC", + "table": "lab", + "sub_var": "labname" + } + ], + "eicu_demo": [ + { + "ids": "MCHC", + "table": "lab", + "sub_var": "labname" + } + ], + "hirid": [ + { + "ids": 24000170, + "table": "observations", + "sub_var": "variableid", + "callback": "convert_unit(binary_op(`*`, 0.16114), '%')", + "class": "hrd_itm" + } + ], + "miiv": [ + { + "ids": 51249, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic": [ + { + "ids": 51249, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic_demo": [ + { + "ids": 51249, + "table": "labevents", + "sub_var": "itemid" + } + ], + "sic": [ + { + "ids": 290, + "table": "laboratory", + "sub_var": "laboratoryid", + "callback": "convert_unit(identity_callback, '%', 'g/dl')", + "class": "sic_itm" + } + ], + "picdb": [ + { + "table": "labevents", + "ids": [ + 5114 + ], + "sub_var": "itemid" + } + ] + } + }, + "mcv": { + "unit": "fL", + "min": 50, + "max": 150, + "description": "mean corpuscular volume", + "omopid": 4016239, + "category": "hematology", + "sources": { + "aumc": [ + { + "ids": 9968, + "table": "numericitems", + "sub_var": "itemid" + } + ], + "eicu": [ + { + "ids": "MCV", + "table": "lab", + "sub_var": "labname" + } + ], + "eicu_demo": [ + { + "ids": "MCV", + "table": "lab", + "sub_var": "labname" + } + ], + "hirid": [ + { + "ids": 24000150, + "table": "observations", + "sub_var": "variableid", + "class": "hrd_itm" + } + ], + "miiv": [ + { + "ids": 51250, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic": [ + { + "ids": 51250, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic_demo": [ + { + "ids": 51250, + "table": "labevents", + "sub_var": "itemid" + } + ], + "sic": [ + { + "ids": 286, + "table": "laboratory", + "sub_var": "laboratoryid", + "class": "sic_itm" + } + ], + "picdb": [ + { + "table": "labevents", + "ids": [ + 5115 + ], + "sub_var": "itemid" + } + ] + } + }, + "neut": { + "unit": "%", + "min": 0, + "max": 100, + "description": "neutrophils", + "omopid": 4148615, + "category": "hematology", + "sources": { + "aumc": [ + { + "ids": [ + 6786, + 11856 + ], + "table": "numericitems", + "sub_var": "itemid" + }, + { + "ids": 14254, + "table": "numericitems", + "sub_var": "itemid", + "callback": "blood_cell_ratio" + } + ], + "eicu": [ + { + "ids": "-polys", + "table": "lab", + "sub_var": "labname" + } + ], + "eicu_demo": [ + { + "ids": "-polys", + "table": "lab", + "sub_var": "labname" + } + ], + "hirid": [ + { + "ids": 24000550, + "table": "observations", + "sub_var": "variableid", + "class": "hrd_itm" + } + ], + "miiv": [ + { + "ids": 51256, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic": [ + { + "ids": 51256, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic_demo": [ + { + "ids": 51256, + "table": "labevents", + "sub_var": "itemid" + } + ], + "sic": [ + { + "ids": 230, + "table": "laboratory", + "sub_var": "laboratoryid", + "class": "sic_itm" + }, + { + "ids": 308, + "table": "laboratory", + "sub_var": "laboratoryid", + "callback": "blood_cell_ratio", + "class": "sic_itm" + } + ], + "picdb": [ + { + "table": "labevents", + "ids": [ + 5094 + ], + "sub_var": "itemid" + } + ] + } + }, + "plt": { + "unit": [ + "K/uL", + "G/l" + ], + "min": 5, + "max": 1200, + "description": "platelet count", + "omopid": 4267147, + "category": "hematology", + "sources": { + "aumc": [ + { + "ids": [ + 6797, + 9964, + 10409, + 14252 + ], + "table": "numericitems", + "sub_var": "itemid" + } + ], + "eicu": [ + { + "ids": "platelets x 1000", + "table": "lab", + "sub_var": "labname" + } + ], + "eicu_demo": [ + { + "ids": "platelets x 1000", + "table": "lab", + "sub_var": "labname" + } + ], + "hirid": [ + { + "ids": 20000110, + "table": "observations", + "sub_var": "variableid", + "class": "hrd_itm" + } + ], + "miiv": [ + { + "ids": 51265, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic": [ + { + "ids": 51265, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic_demo": [ + { + "ids": 51265, + "table": "labevents", + "sub_var": "itemid" + } + ], + "sic": [ + { + "ids": 314, + "table": "laboratory", + "sub_var": "laboratoryid", + "class": "sic_itm" + } + ], + "picdb": [ + { + "table": "labevents", + "ids": [ + 5129 + ], + "sub_var": "itemid" + } + ] + } + }, + "pt": { + "unit": "sec", + "min": 0, + "description": "prothrombine time", + "omopid": 4245261, + "category": "hematology", + "sources": { + "aumc": [ + { + "ids": 6789, + "table": "numericitems", + "sub_var": "itemid" + } + ], + "eicu": [ + { + "ids": "PT", + "table": "lab", + "sub_var": "labname" + } + ], + "eicu_demo": [ + { + "ids": "PT", + "table": "lab", + "sub_var": "labname" + } + ], + "miiv": [ + { + "ids": 51274, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic": [ + { + "ids": 51274, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic_demo": [ + { + "ids": 51274, + "table": "labevents", + "sub_var": "itemid" + } + ], + "sic": [ + { + "ids": 598, + "table": "laboratory", + "sub_var": "laboratoryid", + "class": "sic_itm" + } + ], + "picdb": [ + { + "table": "labevents", + "ids": [ + 5186, + 6890 + ], + "sub_var": "itemid" + } + ] + } + }, + "ptt": { + "unit": "sec", + "min": 0, + "description": "partial thromboplastin time", + "omopid": 4175016, + "category": "hematology", + "sources": { + "aumc": [ + { + "ids": 17982, + "table": "numericitems", + "sub_var": "itemid" + } + ], + "eicu": [ + { + "ids": "PTT", + "table": "lab", + "sub_var": "labname" + } + ], + "eicu_demo": [ + { + "ids": "PTT", + "table": "lab", + "sub_var": "labname" + } + ], + "hirid": [ + { + "ids": 20004410, + "table": "observations", + "sub_var": "variableid", + "class": "hrd_itm" + } + ], + "miiv": [ + { + "ids": 51275, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic": [ + { + "ids": 51275, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic_demo": [ + { + "ids": 51275, + "table": "labevents", + "sub_var": "itemid" + } + ], + "sic": [ + { + "ids": 597, + "table": "laboratory", + "sub_var": "laboratoryid", + "class": "sic_itm" + } + ], + "picdb": [ + { + "table": "labevents", + "ids": [ + 5161 + ], + "sub_var": "itemid" + } + ] + } + }, + "rbc": { + "unit": "m/uL", + "min": 0, + "max": 20, + "description": "red blood cell count", + "omopid": 4030871, + "category": "hematology", + "sources": { + "aumc": [ + { + "ids": [ + 6774, + 9962 + ], + "table": "numericitems", + "sub_var": "itemid" + } + ], + "eicu": [ + { + "ids": "RBC", + "table": "lab", + "sub_var": "labname" + } + ], + "eicu_demo": [ + { + "ids": "RBC", + "table": "lab", + "sub_var": "labname" + } + ], + "miiv": [ + { + "ids": 51279, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic": [ + { + "ids": 51279, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic_demo": [ + { + "ids": 51279, + "table": "labevents", + "sub_var": "itemid" + } + ], + "sic": [ + { + "ids": 599, + "table": "laboratory", + "sub_var": "laboratoryid", + "class": "sic_itm", + "callback": "convert_unit(identity_callback, 'm/uL', 'T/L.')" + } + ], + "picdb": [ + { + "table": "labevents", + "ids": [ + 5379, + 5381, + 6515 + ], + "sub_var": "itemid" + } + ] + } + }, + "rdw": { + "unit": "%", + "min": 0, + "max": 100, + "description": "erythrocyte distribution width", + "omopid": 4281085, + "category": "hematology", + "sources": { + "aumc": [ + { + "ids": 18952, + "table": "numericitems", + "sub_var": "itemid" + } + ], + "eicu": [ + { + "ids": "RDW", + "table": "lab", + "sub_var": "labname" + } + ], + "eicu_demo": [ + { + "ids": "RDW", + "table": "lab", + "sub_var": "labname" + } + ], + "miiv": [ + { + "ids": 51277, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic": [ + { + "ids": 51277, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic_demo": [ + { + "ids": 51277, + "table": "labevents", + "sub_var": "itemid" + } + ], + "picdb": [ + { + "table": "labevents", + "ids": [ + 5136 + ], + "sub_var": "itemid" + } + ] + } + }, + "wbc": { + "unit": [ + "K/uL", + "G/l" + ], + "min": 0, + "description": "white blood cell count", + "omopid": 4298431, + "category": "hematology", + "sources": { + "aumc": [ + { + "ids": [ + 6779, + 9965 + ], + "table": "numericitems", + "sub_var": "itemid" + } + ], + "eicu": [ + { + "ids": "WBC x 1000", + "table": "lab", + "sub_var": "labname" + } + ], + "eicu_demo": [ + { + "ids": "WBC x 1000", + "table": "lab", + "sub_var": "labname" + } + ], + "hirid": [ + { + "ids": 20000700, + "table": "observations", + "sub_var": "variableid", + "class": "hrd_itm" + } + ], + "miiv": [ + { + "ids": 51301, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic": [ + { + "ids": 51301, + "table": "labevents", + "sub_var": "itemid" + } + ], + "mimic_demo": [ + { + "ids": 51301, + "table": "labevents", + "sub_var": "itemid" + } + ], + "sic": [ + { + "ids": 301, + "table": "laboratory", + "sub_var": "laboratoryid", + "class": "sic_itm" + } + ], + "picdb": [ + { + "table": "labevents", + "ids": [ + 6516 + ], + "sub_var": "itemid" + } + ] + } + } +} \ No newline at end of file diff --git a/inst/extdata/config/concept-dict/medications.json b/inst/extdata/config/concept-dict/medications.json new file mode 100644 index 00000000..770deb8f --- /dev/null +++ b/inst/extdata/config/concept-dict/medications.json @@ -0,0 +1,1845 @@ +{ + "abx": { + "class": "lgl_cncpt", + "description": "antibiotics", + "omopid": 4085730, + "category": "medications", + "sources": { + "aumc": [ + { + "ids": [ + 2, + 13, + 19, + 24, + 28, + 29, + 57, + 59, + 82, + 103, + 240, + 247, + 333, + 1133, + 1199, + 1300, + 1371, + 1795, + 2284, + 2834, + 3237, + 3741, + 5576, + 6834, + 6847, + 6871, + 6919, + 6948, + 6953, + 6958, + 7044, + 7064, + 7185, + 7187, + 7208, + 7227, + 7235, + 8064, + 8394, + 8942, + 9029, + 9030, + 9052, + 9070, + 9117, + 9128, + 9133, + 9142, + 9151, + 9152, + 12262, + 12389, + 12398, + 12956, + 12997, + 13057, + 13094, + 13102, + 15591, + 18860, + 19137, + 19773, + 20563, + 23166, + 24241, + 25776, + 27617, + 29321 + ], + "table": "drugitems", + "sub_var": "itemid", + "callback": "transform_fun(set_val(TRUE))" + } + ], + "eicu": [ + { + "regex": "bactrim|cipro|flagyl|metronidazole|zithromax|zosyn|(((amika|cleo|ofloxa)|(azithro|clinda|tobra|vanco)my)c|(ampi|oxa|peni|pipera)cill|cefazol|levaqu|rifamp)in", + "table": "infusiondrug", + "sub_var": "drugname", + "callback": "transform_fun(set_val(TRUE))", + "class": "rgx_itm" + }, + { + "regex": "cipro|flagyl|maxipime|metronidazole|tazobactam|zosyn|cef(azolin|epime)|(((azithro|clinda|vanco)my|ofloxa|vanco)c|levaqu|piperacill|roceph)in", + "table": "medication", + "sub_var": "drugname", + "callback": "transform_fun(set_val(TRUE))", + "class": "rgx_itm" + } + ], + "eicu_demo": [ + { + "regex": "bactrim|cipro|flagyl|metronidazole|zithromax|zosyn|(((amika|cleo|ofloxa)|(azithro|clinda|tobra|vanco)my)c|(ampi|oxa|peni|pipera)cill|cefazol|levaqu|rifamp)in", + "table": "infusiondrug", + "sub_var": "drugname", + "callback": "transform_fun(set_val(TRUE))", + "class": "rgx_itm" + }, + { + "regex": "cipro|flagyl|maxipime|metronidazole|tazobactam|zosyn|cef(azolin|epime)|(((azithro|clinda|vanco)my|ofloxa|vanco)c|levaqu|piperacill|roceph)in", + "table": "medication", + "sub_var": "drugname", + "callback": "transform_fun(set_val(TRUE))", + "class": "rgx_itm" + } + ], + "hirid": [ + { + "ids": [ + 163, + 176, + 181, + 186, + 189, + 300, + 326, + 331, + 351, + 405, + 1000234, + 1000272, + 1000273, + 1000274, + 1000284, + 1000299, + 1000300, + 1000302, + 1000304, + 1000305, + 1000306, + 1000315, + 1000317, + 1000318, + 1000320, + 1000321, + 1000322, + 1000335, + 1000348, + 1000352, + 1000363, + 1000365, + 1000390, + 1000407, + 1000408, + 1000424, + 1000425, + 1000426, + 1000437, + 1000483, + 1000507, + 1000508, + 1000518, + 1000519, + 1000549, + 1000601, + 1000648, + 1000666, + 1000670, + 1000671, + 1000760, + 1000781, + 1000791, + 1000797, + 1000812, + 1000825, + 1000829, + 1000830, + 1000837, + 1000838, + 1000854, + 1000855, + 1000893, + 1000894, + 1001005, + 1001068, + 1001075, + 1001079, + 1001084, + 1001086, + 1001095, + 1001096, + 1001097, + 1001098, + 1001168, + 1001169, + 1001170, + 1001171, + 1001173, + 1001193, + 1001198 + ], + "table": "pharma", + "sub_var": "pharmaid", + "callback": "transform_fun(set_val(TRUE))" + } + ], + "miiv": [ + { + "regex": "aztreonam|bactrim|cephalexin|chloramphenicol|cipro|flagyl|metronidazole|nitrofurantoin|tazobactam|rifampin|sulfadiazine|timentin|trimethoprim|(amika|gentami|vanco)cin|(amoxi|ampi|dicloxa|naf|oxa|peni|pipera)cillin|(azithro|clarithro|erythro|clinda|strepto|tobra|vanco)mycin|cef(azolin|tazidime|adroxil|epime|otetan|otaxime|podoxime|uroxime)|(doxy|mino|tetra)cycline|(levofl|moxifl|ofl)oxacin|macro(bid|dantin)|(una|zo)syn", + "table": "prescriptions", + "sub_var": "drug", + "callback": "transform_fun(set_val(TRUE))", + "class": "rgx_itm" + }, + { + "ids": [ + 225798, + 225837, + 225838, + 225840, + 225842, + 225843, + 225844, + 225845, + 225847, + 225848, + 225850, + 225851, + 225853, + 225855, + 225857, + 225859, + 225860, + 225862, + 225863, + 225865, + 225866, + 225868, + 225869, + 225871, + 225873, + 225875, + 225876, + 225877, + 225879, + 225881, + 225882, + 225883, + 225884, + 225885, + 225886, + 225888, + 225889, + 225890, + 225892, + 225893, + 225895, + 225896, + 225897, + 225898, + 225899, + 225900, + 225902, + 225903, + 225905, + 227691, + 228003 + ], + "table": "inputevents", + "sub_var": "itemid", + "callback": "transform_fun(set_val(TRUE))" + } + ], + "mimic": [ + { + "regex": "aztreonam|bactrim|cephalexin|chloramphenicol|cipro|flagyl|metronidazole|nitrofurantoin|tazobactam|rifampin|sulfadiazine|timentin|trimethoprim|(amika|gentami|vanco)cin|(amoxi|ampi|dicloxa|naf|oxa|peni|pipera)cillin|(azithro|clarithro|erythro|clinda|strepto|tobra|vanco)mycin|cef(azolin|tazidime|adroxil|epime|otetan|otaxime|podoxime|uroxime)|(doxy|mino|tetra)cycline|(levofl|moxifl|ofl)oxacin|macro(bid|dantin)|(una|zo)syn", + "table": "prescriptions", + "sub_var": "drug", + "interval": "00:01:00", + "callback": "mimic_abx_presc", + "class": "rgx_itm" + }, + { + "ids": [ + 225798, + 225837, + 225838, + 225840, + 225842, + 225843, + 225844, + 225845, + 225847, + 225848, + 225850, + 225851, + 225853, + 225855, + 225857, + 225859, + 225860, + 225862, + 225863, + 225865, + 225866, + 225868, + 225869, + 225871, + 225873, + 225875, + 225876, + 225877, + 225879, + 225881, + 225882, + 225883, + 225884, + 225885, + 225886, + 225888, + 225889, + 225890, + 225892, + 225893, + 225895, + 225896, + 225897, + 225898, + 225899, + 225900, + 225902, + 225903, + 225905, + 227691, + 228003 + ], + "table": "inputevents_mv", + "sub_var": "itemid", + "callback": "transform_fun(set_val(TRUE))" + } + ], + "mimic_demo": [ + { + "regex": "aztreonam|bactrim|cephalexin|chloramphenicol|cipro|flagyl|metronidazole|nitrofurantoin|tazobactam|rifampin|sulfadiazine|timentin|trimethoprim|(amika|gentami|vanco)cin|(amoxi|ampi|dicloxa|naf|oxa|peni|pipera)cillin|(azithro|clarithro|erythro|clinda|strepto|tobra|vanco)mycin|cef(azolin|tazidime|adroxil|epime|otetan|otaxime|podoxime|uroxime)|(doxy|mino|tetra)cycline|(levofl|moxifl|ofl)oxacin|macro(bid|dantin)|(una|zo)syn", + "table": "prescriptions", + "sub_var": "drug", + "interval": "00:01:00", + "callback": "mimic_abx_presc", + "class": "rgx_itm" + }, + { + "ids": [ + 225798, + 225837, + 225838, + 225840, + 225842, + 225843, + 225844, + 225845, + 225847, + 225848, + 225850, + 225851, + 225853, + 225855, + 225857, + 225859, + 225860, + 225862, + 225863, + 225865, + 225866, + 225868, + 225869, + 225871, + 225873, + 225875, + 225876, + 225877, + 225879, + 225881, + 225882, + 225883, + 225884, + 225885, + 225886, + 225888, + 225889, + 225890, + 225892, + 225893, + 225895, + 225896, + 225897, + 225898, + 225899, + 225900, + 225902, + 225903, + 225905, + 227691, + 228003 + ], + "table": "inputevents_mv", + "sub_var": "itemid", + "callback": "transform_fun(set_val(TRUE))" + } + ], + "sic": [ + { + "ids": [1401, 1406, 1408, 1410, 1418, 1421, 1422, 1423, 1428, 1431, 1433, 1436, 1439, 1446, 1449, 1451, 1454, 1455, 1456, 1457, 1458, 1459, 1460, 1461, 1462, 1577, 1603, 1628, 1605, 1997, 1693, 1606, 1813, 1913, 1927, 1819], + "table": "medication", + "sub_var": "drugid" + } + ], + "picdb": [] + } + }, + "adh_rate": { + "unit": [ + "units/min", + "U/min" + ], + "description": "vasopressin rate", + "omopid": 1507835, + "category": "medications", + "sources": { + "aumc": [ + { + "ids": 12467, + "table": "drugitems", + "sub_var": "itemid", + "rate_uom": "doserateunit", + "stop_var": "stop", + "callback": "aumc_rate_units(0.53)" + } + ], + "eicu": [ + { + "regex": "^vasopressin.*\\(.+/.+\\)$", + "table": "infusiondrug", + "sub_var": "drugname", + "callback": "eicu_rate_units(2.65, 0.53)", + "class": "rgx_itm" + } + ], + "eicu_demo": [ + { + "regex": "^vasopressin.*\\(.+/.+\\)$", + "table": "infusiondrug", + "sub_var": "drugname", + "callback": "eicu_rate_units(2.65, 0.53)", + "class": "rgx_itm" + } + ], + "hirid": [ + { + "ids": [ + 112, + 113 + ], + "table": "pharma", + "sub_var": "pharmaid", + "grp_var": "infusionid", + "callback": "hirid_rate" + } + ], + "miiv": [ + { + "ids": 222315, + "table": "inputevents", + "sub_var": "itemid", + "stop_var": "endtime", + "callback": "combine_callbacks(\n convert_unit(binary_op(`/`, 60), 'units/min', 'units/hour'),\n mimic_rate_mv\n )" + } + ], + "mimic": [ + { + "ids": 30051, + "table": "inputevents_cv", + "sub_var": "itemid", + "grp_var": "linkorderid", + "callback": "combine_callbacks(\n convert_unit(binary_op(`/`, 60), 'units/min', 'Uhr'),\n mimic_rate_cv\n )" + }, + { + "ids": 222315, + "table": "inputevents_mv", + "sub_var": "itemid", + "stop_var": "endtime", + "callback": "combine_callbacks(\n convert_unit(binary_op(`/`, 60), 'units/min', 'units/hour'),\n mimic_rate_mv\n )" + } + ], + "mimic_demo": [ + { + "ids": 30051, + "table": "inputevents_cv", + "sub_var": "itemid", + "grp_var": "linkorderid", + "callback": "combine_callbacks(\n convert_unit(binary_op(`/`, 60), 'units/min', 'Uhr'),\n mimic_rate_cv\n )" + }, + { + "ids": 222315, + "table": "inputevents_mv", + "sub_var": "itemid", + "stop_var": "endtime", + "callback": "combine_callbacks(\n convert_unit(binary_op(`/`, 60), 'units/min', 'units/hour'),\n mimic_rate_mv\n )" + } + ], + "picdb": [] + } + }, + "cort": { + "class": "lgl_cncpt", + "description": "corticosteroids", + "omopid": 304275008, + "category": "medications", + "sources": { + "aumc": [ + { + "ids": [ + 6922, + 6995, + 7106, + 8132, + 9042, + 9130, + 10628 + ], + "table": "drugitems", + "sub_var": "itemid", + "callback": "transform_fun(set_val(TRUE))" + } + ], + "hirid": [ + { + "ids": [ + 146, + 151, + 1000325, + 1000383, + 1000431, + 1000432, + 1000433, + 1000434, + 1000435, + 1000486, + 1000487, + 1000488, + 1000769, + 1000770, + 1000929 + ], + "table": "pharma", + "sub_var": "pharmaid", + "callback": "transform_fun(set_val(TRUE))" + } + ], + "sic": [ + { + "ids": [1397, 1506, 1524, 1525, 1751, 1977], + "table": "medication", + "sub_var": "drugid", + "callback": "transform_fun(set_val(TRUE))" + } + ], + "picdb": [] + } + }, + "dex": { + "min": 0, + "unit": "ml/hr", + "description": "dextrose (as D10)", + "omopid": 4197597, + "category": "medications", + "target": "win_tbl", + "sources": { + "aumc": [ + { + "ids": [ + 7254, + 7255, + 7256, + 8940, + 9571 + ], + "table": "drugitems", + "sub_var": "itemid", + "dur_var": "stop", + "rate_var": "doserateunit", + "callback": "combine_callbacks(\n aumc_rate,\n dex_to_10(list(7255L, 7256L, c(8940L, 9571L)),\n c(2, 3, 4))\n )" + } + ], + "eicu": [ + { + "regex": "(d50|dextrose.+50 ?%)", + "table": "medication", + "sub_var": "drugname", + "dur_var": "drugstopoffset", + "callback": "eicu_dex_med", + "class": "rgx_itm" + }, + { + "regex": "(d10|dextrose.+10 ?%).+ml/hr", + "table": "infusiondrug", + "sub_var": "drugname", + "callback": "eicu_dex_inf", + "target": "ts_tbl", + "class": "rgx_itm" + } + ], + "eicu_demo": [ + { + "regex": "(d50|dextrose.+50 ?%)", + "table": "medication", + "sub_var": "drugname", + "dur_var": "drugstopoffset", + "callback": "eicu_dex_med", + "class": "rgx_itm" + }, + { + "regex": "(d10|dextrose.+10 ?%).+ml/hr", + "table": "infusiondrug", + "sub_var": "drugname", + "callback": "eicu_dex_inf", + "target": "ts_tbl", + "class": "rgx_itm" + } + ], + "hirid": [ + { + "ids": [ + 1000022, + 1000690, + 1000689, + 1000544, + 1000746, + 1000835, + 1000060, + 1000545, + 1000567 + ], + "table": "pharma", + "sub_var": "pharmaid", + "grp_var": "infusionid", + "target": "ts_tbl", + "interval": "00:01:00", + "callback": "combine_callbacks(\n grp_mount_to_rate(mins(1L), hours(1L)),\n dex_to_10(list(c(1000689L, 1000544L, 1000746L, 1000835L),\n 1000060L, 1000545L, 1000567L), c(2, 3, 4, 5))\n )" + } + ], + "miiv": [ + { + "ids": [ + 220950, + 228140, + 220952 + ], + "table": "inputevents", + "sub_var": "itemid", + "dur_var": "endtime", + "amount_var": "amount", + "auom_var": "amountuom", + "callback": "combine_callbacks(\n mimv_rate,\n dex_to_10(c(228140L, 220952L), c(2, 5))\n )" + } + ], + "mimic": [ + { + "ids": [ + 220950, + 228140, + 220952 + ], + "table": "inputevents_mv", + "sub_var": "itemid", + "dur_var": "endtime", + "amount_var": "amount", + "auom_var": "amountuom", + "callback": "combine_callbacks(\n mimv_rate,\n dex_to_10(c(228140L, 220952L), c(2, 5))\n )" + }, + { + "ids": [ + 30016, + 30017 + ], + "table": "inputevents_cv", + "sub_var": "itemid", + "grp_var": "linkorderid", + "val_var": "amount", + "unit_var": "amountuom", + "target": "ts_tbl", + "interval": "00:01:00", + "callback": "combine_callbacks(\n grp_mount_to_rate(mins(1L), hours(1L)),\n dex_to_10(30017L, 2)\n )" + } + ], + "mimic_demo": [ + { + "ids": [ + 220950, + 228140, + 220952 + ], + "table": "inputevents_mv", + "sub_var": "itemid", + "dur_var": "endtime", + "amount_var": "amount", + "auom_var": "amountuom", + "callback": "combine_callbacks(\n mimv_rate,\n dex_to_10(c(228140L, 220952L), c(2, 5))\n )" + }, + { + "ids": [ + 30016, + 30017 + ], + "table": "inputevents_cv", + "sub_var": "itemid", + "grp_var": "linkorderid", + "val_var": "amount", + "unit_var": "amountuom", + "target": "ts_tbl", + "interval": "00:01:00", + "callback": "combine_callbacks(\n grp_mount_to_rate(mins(1L), hours(1L)),\n dex_to_10(30017L, 2)\n )" + } + ], + "picdb": [] + }, + "class": [ + "unt_cncpt", + "num_cncpt" + ] + }, + "dobu_dur": { + "description": "dobutamine duration", + "category": "medications", + "aggregate": "max", + "sources": { + "aumc": [ + { + "ids": 7178, + "table": "drugitems", + "sub_var": "itemid", + "stop_var": "stop", + "grp_var": "orderid", + "callback": "aumc_dur" + } + ], + "eicu": [ + { + "regex": "^dobu", + "table": "infusiondrug", + "sub_var": "drugname", + "callback": "eicu_duration(gap_length = hours(5L))", + "class": "rgx_itm" + } + ], + "eicu_demo": [ + { + "regex": "^dobu", + "table": "infusiondrug", + "sub_var": "drugname", + "callback": "eicu_duration(gap_length = hours(5L))", + "class": "rgx_itm" + } + ], + "hirid": [ + { + "ids": 426, + "table": "pharma", + "sub_var": "pharmaid", + "grp_var": "infusionid", + "callback": "hirid_duration" + } + ], + "miiv": [ + { + "ids": 221653, + "table": "inputevents", + "sub_var": "itemid", + "stop_var": "endtime", + "grp_var": "linkorderid", + "callback": "mimic_dur_inmv" + } + ], + "mimic": [ + { + "ids": [ + 30042, + 30306 + ], + "table": "inputevents_cv", + "sub_var": "itemid", + "grp_var": "linkorderid", + "callback": "mimic_dur_incv" + }, + { + "ids": 221653, + "table": "inputevents_mv", + "sub_var": "itemid", + "stop_var": "endtime", + "grp_var": "linkorderid", + "callback": "mimic_dur_inmv" + } + ], + "mimic_demo": [ + { + "ids": [ + 30042, + 30306 + ], + "table": "inputevents_cv", + "sub_var": "itemid", + "grp_var": "linkorderid", + "callback": "mimic_dur_incv" + }, + { + "ids": 221653, + "table": "inputevents_mv", + "sub_var": "itemid", + "stop_var": "endtime", + "grp_var": "linkorderid", + "callback": "mimic_dur_inmv" + } + ], + "sic": [ + { + "ids": [ + 1559 + ], + "table": "medication", + "sub_var": "drugid", + "stop_var": "offsetdrugend", + "grp_var": "id", + "callback": "default_duration" + } + ], + "picdb": [] + } + }, + "dobu_rate": { + "unit": [ + "mcg/kg/min", + "mcgkgmin" + ], + "min": 0, + "max": 50, + "description": "dobutamine rate", + "omopid": 1337720, + "category": "medications", + "sources": { + "aumc": [ + { + "ids": 7178, + "table": "drugitems", + "sub_var": "itemid", + "rel_weight": "doserateperkg", + "rate_uom": "doserateunit", + "stop_var": "stop", + "callback": "aumc_rate_kg" + } + ], + "eicu": [ + { + "regex": "^dobu.*\\(.+\\)$", + "table": "infusiondrug", + "sub_var": "drugname", + "weight_var": "patientweight", + "callback": "eicu_rate_kg(ml_to_mcg = 2000)", + "class": "rgx_itm" + } + ], + "eicu_demo": [ + { + "regex": "^dobu.*\\(.+\\)$", + "table": "infusiondrug", + "sub_var": "drugname", + "weight_var": "patientweight", + "callback": "eicu_rate_kg(ml_to_mcg = 2000)", + "class": "rgx_itm" + } + ], + "hirid": [ + { + "ids": 426, + "table": "pharma", + "sub_var": "pharmaid", + "grp_var": "infusionid", + "callback": "hirid_rate_kg" + } + ], + "miiv": [ + { + "ids": 221653, + "table": "inputevents", + "sub_var": "itemid", + "stop_var": "endtime", + "callback": "mimic_rate_mv" + } + ], + "mimic": [ + { + "ids": [ + 30042, + 30306 + ], + "table": "inputevents_cv", + "sub_var": "itemid", + "grp_var": "linkorderid", + "callback": "mimic_rate_cv" + }, + { + "ids": 221653, + "table": "inputevents_mv", + "sub_var": "itemid", + "stop_var": "endtime", + "callback": "mimic_rate_mv" + } + ], + "mimic_demo": [ + { + "ids": [ + 30042, + 30306 + ], + "table": "inputevents_cv", + "sub_var": "itemid", + "grp_var": "linkorderid", + "callback": "mimic_rate_cv" + }, + { + "ids": 221653, + "table": "inputevents_mv", + "sub_var": "itemid", + "stop_var": "endtime", + "callback": "mimic_rate_mv" + } + ], + "sic": [ + { + "ids": 1559, + "table": "medication", + "sub_var": "drugid", + "val_var": "amountperminute", + "stop_var": "offsetdrugend", + "class": "sic_itm", + "callback": "sic_rate_kg" + } + ], + "picdb": [] + } + }, + "dobu60": { + "concepts": [ + "dobu_rate", + "dobu_dur" + ], + "description": "dobutamine administration for min 1h", + "category": "medications", + "interval": "00:01:00", + "callback": "vaso60", + "class": "rec_cncpt" + }, + "dopa_dur": { + "description": "dopamine duration", + "category": "medications", + "aggregate": "max", + "sources": { + "aumc": [ + { + "ids": 7179, + "table": "drugitems", + "sub_var": "itemid", + "stop_var": "stop", + "grp_var": "orderid", + "callback": "aumc_dur" + } + ], + "eicu": [ + { + "regex": "^dopa", + "table": "infusiondrug", + "sub_var": "drugname", + "callback": "eicu_duration(gap_length = hours(5L))", + "class": "rgx_itm" + } + ], + "eicu_demo": [ + { + "regex": "^dopa", + "table": "infusiondrug", + "sub_var": "drugname", + "callback": "eicu_duration(gap_length = hours(5L))", + "class": "rgx_itm" + } + ], + "miiv": [ + { + "ids": 221662, + "table": "inputevents", + "sub_var": "itemid", + "stop_var": "endtime", + "grp_var": "linkorderid", + "callback": "mimic_dur_inmv" + } + ], + "mimic": [ + { + "ids": [ + 30043, + 30125, + 30307 + ], + "table": "inputevents_cv", + "sub_var": "itemid", + "grp_var": "linkorderid", + "callback": "mimic_dur_incv" + }, + { + "ids": 221662, + "table": "inputevents_mv", + "sub_var": "itemid", + "stop_var": "endtime", + "grp_var": "linkorderid", + "callback": "mimic_dur_inmv" + } + ], + "mimic_demo": [ + { + "ids": [ + 30043, + 30125, + 30307 + ], + "table": "inputevents_cv", + "sub_var": "itemid", + "grp_var": "linkorderid", + "callback": "mimic_dur_incv" + }, + { + "ids": 221662, + "table": "inputevents_mv", + "sub_var": "itemid", + "stop_var": "endtime", + "grp_var": "linkorderid", + "callback": "mimic_dur_inmv" + } + ], + "sic": [ + { + "ids": 1618, + "table": "medication", + "sub_var": "drugid", + "stop_var": "offsetdrugend", + "grp_var": "id", + "callback": "default_duration" + } + ], + "picdb": [] + } + }, + "dopa_rate": { + "unit": [ + "mcg/kg/min", + "mcgkgmin" + ], + "min": 0, + "max": 50, + "description": "dopamine rate", + "omopid": 1337860, + "category": "medications", + "sources": { + "aumc": [ + { + "ids": 7179, + "table": "drugitems", + "sub_var": "itemid", + "rel_weight": "doserateperkg", + "rate_uom": "doserateunit", + "stop_var": "stop", + "callback": "aumc_rate_kg" + } + ], + "eicu": [ + { + "regex": "^dopa.*\\(.+\\)$", + "table": "infusiondrug", + "sub_var": "drugname", + "weight_var": "patientweight", + "callback": "eicu_rate_kg(ml_to_mcg = 1600)", + "class": "rgx_itm" + } + ], + "eicu_demo": [ + { + "regex": "^dopa.*\\(.+\\)$", + "table": "infusiondrug", + "sub_var": "drugname", + "weight_var": "patientweight", + "callback": "eicu_rate_kg(ml_to_mcg = 1600)", + "class": "rgx_itm" + } + ], + "miiv": [ + { + "ids": 221662, + "table": "inputevents", + "sub_var": "itemid", + "stop_var": "endtime", + "callback": "mimic_rate_mv" + } + ], + "mimic": [ + { + "ids": [ + 30043, + 30125, + 30307 + ], + "table": "inputevents_cv", + "sub_var": "itemid", + "grp_var": "linkorderid", + "callback": "mimic_rate_cv" + }, + { + "ids": 221662, + "table": "inputevents_mv", + "sub_var": "itemid", + "stop_var": "endtime", + "callback": "mimic_rate_mv" + } + ], + "mimic_demo": [ + { + "ids": [ + 30043, + 30125, + 30307 + ], + "table": "inputevents_cv", + "sub_var": "itemid", + "grp_var": "linkorderid", + "callback": "mimic_rate_cv" + }, + { + "ids": 221662, + "table": "inputevents_mv", + "sub_var": "itemid", + "stop_var": "endtime", + "callback": "mimic_rate_mv" + } + ], + "sic": [ + { + "ids": 1618, + "table": "medication", + "sub_var": "drugid", + "val_var": "amountperminute", + "stop_var": "offsetdrugend", + "class": "sic_itm", + "callback": "sic_rate_kg" + } + ], + "picdb": [] + } + }, + "epi_dur": { + "description": "epinephrine duration", + "category": "medications", + "aggregate": "max", + "sources": { + "aumc": [ + { + "ids": 6818, + "table": "drugitems", + "sub_var": "itemid", + "stop_var": "stop", + "grp_var": "orderid", + "callback": "aumc_dur" + } + ], + "eicu": [ + { + "regex": "^epi( |n)", + "table": "infusiondrug", + "sub_var": "drugname", + "callback": "eicu_duration(gap_length = hours(5L))", + "class": "rgx_itm" + } + ], + "eicu_demo": [ + { + "regex": "^epi( |n)", + "table": "infusiondrug", + "sub_var": "drugname", + "callback": "eicu_duration(gap_length = hours(5L))", + "class": "rgx_itm" + } + ], + "hirid": [ + { + "ids": [ + 71, + 1000649, + 1000650, + 1000655, + 1000750 + ], + "table": "pharma", + "sub_var": "pharmaid", + "grp_var": "infusionid", + "callback": "hirid_duration" + } + ], + "miiv": [ + { + "ids": 221289, + "table": "inputevents", + "sub_var": "itemid", + "stop_var": "endtime", + "grp_var": "linkorderid", + "callback": "mimic_dur_inmv" + } + ], + "mimic": [ + { + "ids": [ + 30044, + 30119, + 30309 + ], + "table": "inputevents_cv", + "sub_var": "itemid", + "grp_var": "linkorderid", + "callback": "mimic_dur_incv" + }, + { + "ids": 221289, + "table": "inputevents_mv", + "sub_var": "itemid", + "stop_var": "endtime", + "grp_var": "linkorderid", + "callback": "mimic_dur_inmv" + } + ], + "mimic_demo": [ + { + "ids": [ + 30044, + 30119, + 30309 + ], + "table": "inputevents_cv", + "sub_var": "itemid", + "grp_var": "linkorderid", + "callback": "mimic_dur_incv" + }, + { + "ids": 221289, + "table": "inputevents_mv", + "sub_var": "itemid", + "stop_var": "endtime", + "grp_var": "linkorderid", + "callback": "mimic_dur_inmv" + } + ], + "sic": [ + { + "ids": 1502, + "table": "medication", + "sub_var": "drugid", + "stop_var": "offsetdrugend", + "grp_var": "id", + "callback": "default_duration" + } + ], + "picdb": [] + } + }, + "epi_rate": { + "unit": [ + "mcg/kg/min", + "mcgkgmin" + ], + "min": 0, + "max": 1.5, + "description": "epinephrine rate", + "omopid": 1343916, + "category": "medications", + "sources": { + "aumc": [ + { + "ids": 6818, + "table": "drugitems", + "sub_var": "itemid", + "rel_weight": "doserateperkg", + "rate_uom": "doserateunit", + "stop_var": "stop", + "callback": "aumc_rate_kg" + } + ], + "eicu": [ + { + "regex": "^epi( |n).*\\(.+\\)$", + "table": "infusiondrug", + "sub_var": "drugname", + "weight_var": "patientweight", + "callback": "eicu_rate_kg(ml_to_mcg = 40)", + "class": "rgx_itm" + } + ], + "eicu_demo": [ + { + "regex": "^epi( |n).*\\(.+\\)$", + "table": "infusiondrug", + "sub_var": "drugname", + "weight_var": "patientweight", + "callback": "eicu_rate_kg(ml_to_mcg = 40)", + "class": "rgx_itm" + } + ], + "hirid": [ + { + "ids": [ + 71, + 1000649, + 1000650, + 1000655, + 1000750 + ], + "table": "pharma", + "sub_var": "pharmaid", + "grp_var": "infusionid", + "callback": "hirid_rate_kg" + } + ], + "miiv": [ + { + "ids": 221289, + "table": "inputevents", + "sub_var": "itemid", + "stop_var": "endtime", + "callback": "mimic_rate_mv" + } + ], + "mimic": [ + { + "ids": [ + 30044, + 30119, + 30309 + ], + "table": "inputevents_cv", + "sub_var": "itemid", + "grp_var": "linkorderid", + "callback": "mimic_rate_cv" + }, + { + "ids": 221289, + "table": "inputevents_mv", + "sub_var": "itemid", + "stop_var": "endtime", + "callback": "mimic_rate_mv" + } + ], + "mimic_demo": [ + { + "ids": [ + 30044, + 30119, + 30309 + ], + "table": "inputevents_cv", + "sub_var": "itemid", + "grp_var": "linkorderid", + "callback": "mimic_rate_cv" + }, + { + "ids": 221289, + "table": "inputevents_mv", + "sub_var": "itemid", + "stop_var": "endtime", + "callback": "mimic_rate_mv" + } + ], + "sic": [ + { + "ids": 1502, + "table": "medication", + "sub_var": "drugid", + "val_var": "amountperminute", + "stop_var": "offsetdrugend", + "class": "sic_itm", + "callback": "sic_rate_kg" + } + ], + "picdb": [] + } + }, + "ins": { + "unit": "units/hr", + "min": 0, + "description": "insulin", + "omopid": 42537007, + "category": "medications", + "sources": { + "aumc": [ + { + "ids": [ + 7624, + 9014, + 19129 + ], + "sub_var": "itemid", + "table": "drugitems" + } + ], + "eicu": [ + { + "regex": "^insulin (250.+)?\\(((ml|units)/hr)?\\)$", + "table": "infusiondrug", + "sub_var": "drugname", + "class": "rgx_itm" + } + ], + "eicu_demo": [ + { + "regex": "^insulin (250.+)?\\(((ml|units)/hr)?\\)$", + "table": "infusiondrug", + "sub_var": "drugname", + "class": "rgx_itm" + } + ], + "hirid": [ + { + "ids": [ + 15, + 1000724 + ], + "table": "pharma", + "sub_var": "pharmaid", + "callback": "aggregate_fun('sum', 'units')" + } + ], + "miiv": [ + { + "ids": [ + 223258, + 223260 + ], + "table": "inputevents", + "sub_var": "itemid", + "val_var": "amount", + "end_var": "endtime", + "callback": "distribute_amount" + } + ], + "mimic": [ + { + "ids": [ + 30045, + 30100 + ], + "table": "inputevents_cv", + "sub_var": "itemid" + }, + { + "ids": [ + 223258, + 223260 + ], + "table": "inputevents_mv", + "sub_var": "itemid", + "val_var": "amount", + "end_var": "endtime", + "callback": "distribute_amount" + } + ], + "mimic_demo": [ + { + "ids": [ + 30045, + 30100 + ], + "table": "inputevents_cv", + "sub_var": "itemid" + }, + { + "ids": [ + 223258, + 223260 + ], + "table": "inputevents_mv", + "sub_var": "itemid", + "val_var": "amount", + "end_var": "endtime", + "callback": "distribute_amount" + } + ], + "picdb": [ + { + "table": "labevents", + "ids": [ + 6172 + ], + "sub_var": "itemid" + } + ] + } + }, + "norepi_dur": { + "description": "norepinephrine duration", + "category": "medications", + "aggregate": "max", + "sources": { + "aumc": [ + { + "ids": 7229, + "table": "drugitems", + "sub_var": "itemid", + "stop_var": "stop", + "grp_var": "orderid", + "callback": "aumc_dur" + } + ], + "eicu": [ + { + "regex": "^norepi", + "table": "infusiondrug", + "sub_var": "drugname", + "callback": "eicu_duration(gap_length = hours(5L))", + "class": "rgx_itm" + } + ], + "eicu_demo": [ + { + "regex": "^norepi", + "table": "infusiondrug", + "sub_var": "drugname", + "callback": "eicu_duration(gap_length = hours(5L))", + "class": "rgx_itm" + } + ], + "hirid": [ + { + "ids": [ + 1000462, + 1000656, + 1000657, + 1000658 + ], + "table": "pharma", + "sub_var": "pharmaid", + "grp_var": "infusionid", + "callback": "hirid_duration" + } + ], + "miiv": [ + { + "ids": 221906, + "table": "inputevents", + "sub_var": "itemid", + "stop_var": "endtime", + "grp_var": "linkorderid", + "callback": "mimic_dur_inmv" + } + ], + "mimic": [ + { + "ids": [ + 30047, + 30120 + ], + "table": "inputevents_cv", + "sub_var": "itemid", + "grp_var": "linkorderid", + "callback": "mimic_dur_incv" + }, + { + "ids": 221906, + "table": "inputevents_mv", + "sub_var": "itemid", + "stop_var": "endtime", + "grp_var": "linkorderid", + "callback": "mimic_dur_inmv" + } + ], + "mimic_demo": [ + { + "ids": [ + 30047, + 30120 + ], + "table": "inputevents_cv", + "sub_var": "itemid", + "grp_var": "linkorderid", + "callback": "mimic_dur_incv" + }, + { + "ids": 221906, + "table": "inputevents_mv", + "sub_var": "itemid", + "stop_var": "endtime", + "grp_var": "linkorderid", + "callback": "mimic_dur_inmv" + } + ], + "sic": [ + { + "ids": 1562, + "table": "medication", + "sub_var": "drugid", + "stop_var": "offsetdrugend", + "grp_var": "id", + "callback": "default_duration" + } + ], + "picdb": [] + } + }, + "norepi_equiv": { + "description": "norepinephrine equivalents", + "category": "medications", + "concepts": [ + "epi_rate", + "norepi_rate", + "dopa_rate", + "adh_rate", + "phn_rate" + ], + "callback": "norepi_equiv", + "class": "rec_cncpt" + }, + "norepi_rate": { + "unit": [ + "mcg/kg/min", + "mcgkgmin" + ], + "min": 0, + "max": 3, + "description": "norepinephrine rate", + "omopid": 1321341, + "category": "medications", + "sources": { + "aumc": [ + { + "ids": 7229, + "table": "drugitems", + "sub_var": "itemid", + "rel_weight": "doserateperkg", + "rate_uom": "doserateunit", + "stop_var": "stop", + "callback": "aumc_rate_kg" + } + ], + "eicu": [ + { + "regex": "^norepi.*\\(.+\\)$", + "table": "infusiondrug", + "sub_var": "drugname", + "weight_var": "patientweight", + "callback": "eicu_rate_kg(ml_to_mcg = 32)", + "class": "rgx_itm" + } + ], + "eicu_demo": [ + { + "regex": "^norepi.*\\(.+\\)$", + "table": "infusiondrug", + "sub_var": "drugname", + "weight_var": "patientweight", + "callback": "eicu_rate_kg(ml_to_mcg = 32)", + "class": "rgx_itm" + } + ], + "hirid": [ + { + "ids": [ + 1000462, + 1000656, + 1000657, + 1000658 + ], + "table": "pharma", + "sub_var": "pharmaid", + "grp_var": "infusionid", + "callback": "hirid_rate_kg" + } + ], + "miiv": [ + { + "ids": 221906, + "table": "inputevents", + "sub_var": "itemid", + "stop_var": "endtime", + "callback": "mimic_rate_mv" + } + ], + "mimic": [ + { + "ids": [ + 30047, + 30120 + ], + "table": "inputevents_cv", + "sub_var": "itemid", + "grp_var": "linkorderid", + "callback": "mimic_rate_cv" + }, + { + "ids": 221906, + "table": "inputevents_mv", + "sub_var": "itemid", + "stop_var": "endtime", + "callback": "mimic_rate_mv" + } + ], + "mimic_demo": [ + { + "ids": [ + 30047, + 30120 + ], + "table": "inputevents_cv", + "sub_var": "itemid", + "grp_var": "linkorderid", + "callback": "mimic_rate_cv" + }, + { + "ids": 221906, + "table": "inputevents_mv", + "sub_var": "itemid", + "stop_var": "endtime", + "callback": "mimic_rate_mv" + } + ], + "sic": [ + { + "ids": 1562, + "table": "medication", + "sub_var": "drugid", + "val_var": "amountperminute", + "stop_var": "offsetdrugend", + "class": "sic_itm", + "callback": "sic_rate_kg" + } + ], + "picdb": [] + } + }, + "phn_rate": { + "unit": "mcg/kg/min", + "description": "phenylephrine rate", + "omopid": 1135766, + "category": "medications", + "sources": { + "eicu": [ + { + "regex": "^phenylephrine.*\\(.+\\)$", + "table": "infusiondrug", + "sub_var": "drugname", + "weight_var": "patientweight", + "callback": "eicu_rate_kg(ml_to_mcg = 200)", + "class": "rgx_itm" + } + ], + "eicu_demo": [ + { + "regex": "^phenylephrine.*\\(.+\\)$", + "table": "infusiondrug", + "sub_var": "drugname", + "weight_var": "patientweight", + "callback": "eicu_rate_kg(ml_to_mcg = 200)", + "class": "rgx_itm" + } + ], + "miiv": [ + { + "ids": 221749, + "table": "inputevents", + "sub_var": "itemid", + "stop_var": "endtime", + "callback": "mimic_rate_mv" + } + ], + "mimic": [ + { + "ids": 30127, + "table": "inputevents_cv", + "sub_var": "itemid", + "grp_var": "linkorderid", + "callback": "combine_callbacks(\n mimic_kg_rate, mimic_rate_cv)\n " + }, + { + "ids": 30128, + "table": "inputevents_cv", + "sub_var": "itemid", + "grp_var": "linkorderid", + "callback": "mimic_rate_cv" + }, + { + "ids": 221749, + "table": "inputevents_mv", + "sub_var": "itemid", + "stop_var": "endtime", + "callback": "mimic_rate_mv" + } + ], + "mimic_demo": [ + { + "ids": 30127, + "table": "inputevents_cv", + "sub_var": "itemid", + "grp_var": "linkorderid", + "callback": "combine_callbacks(\n mimic_kg_rate, mimic_rate_cv)\n " + }, + { + "ids": 30128, + "table": "inputevents_cv", + "sub_var": "itemid", + "grp_var": "linkorderid", + "callback": "mimic_rate_cv" + }, + { + "ids": 221749, + "table": "inputevents_mv", + "sub_var": "itemid", + "stop_var": "endtime", + "callback": "mimic_rate_mv" + } + ], + "picdb": [] + } + }, + "vaso_ind": { + "concepts": [ + "dopa_dur", + "norepi_dur", + "dobu_dur", + "epi_dur" + ], + "description": "vasopressor indicator", + "omopid": 3655896, + "category": "medications", + "callback": "vaso_ind", + "class": "rec_cncpt" + } +} \ No newline at end of file diff --git a/inst/extdata/config/concept-dict/microbiology.json b/inst/extdata/config/concept-dict/microbiology.json new file mode 100644 index 00000000..7a380e64 --- /dev/null +++ b/inst/extdata/config/concept-dict/microbiology.json @@ -0,0 +1,91 @@ +{ + "samp": { + "class": "lgl_cncpt", + "category": "microbiology", + "description": "body fluid sampling", + "omopid": 4133843, + "sources": { + "aumc": [ + { + "ids": [ + 8097, + 8418, + 8588, + 9189, + 9190, + 9191, + 9192, + 9193, + 9194, + 9195, + 9197, + 9198, + 9200, + 9202, + 9203, + 9204, + 9205, + 13024, + 19663, + 19664 + ], + "table": "procedureorderitems", + "sub_var": "itemid", + "callback": "transform_fun(set_val(TRUE))" + } + ], + "eicu": [ + { + "table": "microlab", + "val_var": "organism", + "callback": "transform_fun(comp_na(`!=`, 'no growth'))", + "class": "col_itm" + } + ], + "eicu_demo": [ + { + "table": "microlab", + "val_var": "organism", + "callback": "transform_fun(comp_na(`!=`, 'no growth'))", + "class": "col_itm" + } + ], + "miiv": [ + { + "table": "microbiologyevents", + "val_var": "org_itemid", + "callback": "mimic_sampling", + "aux_time": "charttime", + "class": "col_itm" + } + ], + "mimic": [ + { + "table": "microbiologyevents", + "val_var": "org_itemid", + "callback": "mimic_sampling", + "aux_time": "charttime", + "class": "col_itm" + } + ], + "mimic_demo": [ + { + "table": "microbiologyevents", + "val_var": "org_itemid", + "callback": "mimic_sampling", + "aux_time": "charttime", + "class": "col_itm" + } + ], + "picdb": [ + { + "table": "microbiologyevents", + "val_var": "org_itemid", + "callback": "picdb_sampling", + "aux_time": "charttime", + "class": "col_itm" + } + ] + } + } +} \ No newline at end of file diff --git a/inst/extdata/config/concept-dict/neurological.json b/inst/extdata/config/concept-dict/neurological.json new file mode 100644 index 00000000..22a714b6 --- /dev/null +++ b/inst/extdata/config/concept-dict/neurological.json @@ -0,0 +1,350 @@ +{ + "avpu": { + "concepts": "gcs", + "description": "AVPU scale", + "omopid": 40493498, + "category": "neurological", + "callback": "avpu", + "class": "rec_cncpt" + }, + "egcs": { + "min": 1, + "max": 4, + "description": "GCS eye", + "omopid": 4084277, + "category": "neurological", + "sources": { + "aumc": [ + { + "ids": 6732, + "table": "listitems", + "sub_var": "itemid", + "callback": "apply_map( c(`Geen reactie` = 1, `Reactie op pijnprikkel` = 2, `Reactie op verbale prikkel` = 3, `Spontane reactie` = 4) )" + }, + { + "ids": 13077, + "table": "listitems", + "sub_var": "itemid", + "callback": "apply_map( c(`Niet` = 1, `Op pijn` = 2, `Op aanspreken` = 3, `Spontaan` = 4) )" + } + ], + "eicu": [ + { + "ids": "Eyes", + "table": "nursecharting", + "sub_var": "nursingchartcelltypevalname" + } + ], + "eicu_demo": [ + { + "ids": "Eyes", + "table": "nursecharting", + "sub_var": "nursingchartcelltypevalname" + } + ], + "hirid": [ + { + "ids": 10000300, + "table": "observations", + "sub_var": "variableid", + "class": "hrd_itm" + } + ], + "miiv": [ + { + "ids": 220739, + "table": "chartevents", + "sub_var": "itemid" + } + ], + "mimic": [ + { + "ids": [ + 184, + 220739 + ], + "table": "chartevents", + "sub_var": "itemid" + } + ], + "mimic_demo": [ + { + "ids": [ + 184, + 220739 + ], + "table": "chartevents", + "sub_var": "itemid" + } + ], + "picdb": [] + } + }, + "gcs": { + "concepts": [ + "egcs", + "mgcs", + "vgcs", + "tgcs", + "ett_gcs" + ], + "description": "Glasgow coma scale (non-sedated)", + "omopid": 4093836, + "category": "neurological", + "aggregate": [ + "min", + "min", + "min", + "min", + "any" + ], + "callback": "gcs", + "class": "rec_cncpt" + }, + "mgcs": { + "min": 1, + "max": 6, + "description": "GCS motor", + "omopid": 4083352, + "category": "neurological", + "sources": { + "aumc": [ + { + "ids": 6734, + "table": "listitems", + "sub_var": "itemid", + "callback": "apply_map( c(`Geen reactie` = 1, `Strekken` = 2, `Decortatie reflex (abnormaal buigen)` = 3, `Spastische reactie (terugtrekken)` = 4, `Localiseert pijn` = 5, `Volgt verbale commando's op` = 6) )" + }, + { + "ids": 13072, + "table": "listitems", + "sub_var": "itemid", + "callback": "apply_map( c(`Geen reactie` = 1, `Strekken op pijn` = 2, `Abnormaal buigen bij pijn` = 3, `Terugtrekken bij pijn` = 4, `Localiseren pijn` = 5, `Voert opdrachten uit` = 6) )" + } + ], + "eicu": [ + { + "ids": "Motor", + "table": "nursecharting", + "sub_var": "nursingchartcelltypevalname" + } + ], + "eicu_demo": [ + { + "ids": "Motor", + "table": "nursecharting", + "sub_var": "nursingchartcelltypevalname" + } + ], + "hirid": [ + { + "ids": 10000200, + "table": "observations", + "sub_var": "variableid", + "class": "hrd_itm" + } + ], + "miiv": [ + { + "ids": 223901, + "table": "chartevents", + "sub_var": "itemid" + } + ], + "mimic": [ + { + "ids": [ + 454, + 223901 + ], + "table": "chartevents", + "sub_var": "itemid" + } + ], + "mimic_demo": [ + { + "ids": [ + 454, + 223901 + ], + "table": "chartevents", + "sub_var": "itemid" + } + ], + "picdb": [] + } + }, + "rass": { + "min": -5, + "max": 4, + "description": "Richmond agitation sedation scale", + "omopid": 36684829, + "category": "neurological", + "sources": { + "aumc": [ + { + "ids": 14444, + "sub_var": "itemid", + "table": "listitems", + "callback": "transform_fun(aumc_rass)" + } + ], + "eicu": [ + { + "ids": "Sedation Score", + "table": "nursecharting", + "sub_var": "nursingchartcelltypevalname" + } + ], + "eicu_demo": [ + { + "ids": "Sedation Score", + "table": "nursecharting", + "sub_var": "nursingchartcelltypevalname" + } + ], + "hirid": [ + { + "ids": 15001565, + "table": "observations", + "sub_var": "variableid", + "callback": "transform_fun(floor)", + "class": "hrd_itm" + } + ], + "miiv": [ + { + "ids": 228096, + "table": "chartevents", + "sub_var": "itemid" + } + ], + "mimic": [ + { + "ids": 228096, + "table": "chartevents", + "sub_var": "itemid" + } + ], + "mimic_demo": [ + { + "ids": 228096, + "table": "chartevents", + "sub_var": "itemid" + } + ], + "picdb": [] + } + }, + "tgcs": { + "min": 3, + "max": 15, + "description": "GCS total", + "omopid": 4093836, + "category": "neurological", + "sources": { + "eicu": [ + { + "ids": "GCS Total", + "table": "nursecharting", + "sub_var": "nursingchartcelltypevalname" + } + ], + "eicu_demo": [ + { + "ids": "GCS Total", + "table": "nursecharting", + "sub_var": "nursingchartcelltypevalname" + } + ], + "mimic": [ + { + "ids": 198, + "table": "chartevents", + "sub_var": "itemid" + } + ], + "mimic_demo": [ + { + "ids": 198, + "table": "chartevents", + "sub_var": "itemid" + } + ], + "picdb": [] + } + }, + "vgcs": { + "min": 1, + "max": 5, + "description": "GCS verbal", + "omopid": 4084912, + "category": "neurological", + "sources": { + "aumc": [ + { + "ids": 6735, + "table": "listitems", + "sub_var": "itemid", + "callback": "apply_map( c(`Geen reactie (geen zichtbare poging tot praten)` = 1, `Onbegrijpelijke geluiden` = 2, `Onduidelijke woorden (pogingen tot communicatie, maar onduidelijk)` = 3, `Verwarde conversatie` = 4, `Helder en adequaat (communicatie mogelijk)` = 5) )" + }, + { + "ids": 13066, + "table": "listitems", + "sub_var": "itemid", + "callback": "apply_map( c(`Geen geluid` = 1, `Onverstaanbare woorden` = 2, `Onjuiste woorden` = 3, `Verwarde taal` = 4, `Geori\u00ebnteerd` = 5) )" + } + ], + "eicu": [ + { + "ids": "Verbal", + "table": "nursecharting", + "sub_var": "nursingchartcelltypevalname" + } + ], + "eicu_demo": [ + { + "ids": "Verbal", + "table": "nursecharting", + "sub_var": "nursingchartcelltypevalname" + } + ], + "hirid": [ + { + "ids": 10000100, + "table": "observations", + "sub_var": "variableid", + "class": "hrd_itm" + } + ], + "miiv": [ + { + "ids": 223900, + "table": "chartevents", + "sub_var": "itemid" + } + ], + "mimic": [ + { + "ids": [ + 723, + 223900 + ], + "table": "chartevents", + "sub_var": "itemid" + } + ], + "mimic_demo": [ + { + "ids": [ + 723, + 223900 + ], + "table": "chartevents", + "sub_var": "itemid" + } + ], + "picdb": [] + } + } +} \ No newline at end of file diff --git a/inst/extdata/config/concept-dict/outcome.json b/inst/extdata/config/concept-dict/outcome.json new file mode 100644 index 00000000..95009c78 --- /dev/null +++ b/inst/extdata/config/concept-dict/outcome.json @@ -0,0 +1,420 @@ +{ + "death": { + "class": "lgl_cncpt", + "description": "in hospital mortality", + "omopid": 4306655, + "category": "outcome", + "sources": { + "aumc": [ + { + "table": "admissions", + "index_var": "dateofdeath", + "val_var": "dischargedat", + "callback": "aumc_death", + "class": "col_itm" + } + ], + "eicu": [ + { + "table": "patient", + "index_var": "unitdischargeoffset", + "val_var": "hospitaldischargestatus", + "callback": "transform_fun(comp_na(`==`, 'Expired'))", + "class": "col_itm" + } + ], + "eicu_demo": [ + { + "table": "patient", + "index_var": "unitdischargeoffset", + "val_var": "hospitaldischargestatus", + "callback": "transform_fun(comp_na(`==`, 'Expired'))", + "class": "col_itm" + } + ], + "hirid": [ + { + "ids": [ + 110, + 200 + ], + "table": "observations", + "sub_var": "variableid", + "callback": "hirid_death", + "class": "hrd_itm" + } + ], + "miiv": [ + { + "table": "admissions", + "index_var": "deathtime", + "val_var": "hospital_expire_flag", + "callback": "transform_fun(comp_na(`==`, 1L))", + "class": "col_itm" + } + ], + "mimic": [ + { + "table": "admissions", + "index_var": "deathtime", + "val_var": "hospital_expire_flag", + "callback": "transform_fun(comp_na(`==`, 1L))", + "class": "col_itm" + } + ], + "mimic_demo": [ + { + "table": "admissions", + "index_var": "deathtime", + "val_var": "hospital_expire_flag", + "callback": "transform_fun(comp_na(`==`, 1L))", + "class": "col_itm" + } + ], + "picdb": [ + { + "table": "admissions", + "index_var": "deathtime", + "val_var": "hospital_expire_flag", + "callback": "transform_fun(comp_na(`==`, 1L))", + "class": "col_itm" + } + ], + "sic": [ + { + "table": "cases", + "index_var": "offsetofdeath", + "adm_time": "offsetafterfirstadmission", + "val_var": "timeofstay", + "callback": "sic_death", + "class": "col_itm" + } + ] + } + }, + "dopa60": { + "concepts": [ + "dopa_rate", + "dopa_dur" + ], + "description": "dopamine administration for min 1h", + "category": "outcome", + "interval": "00:01:00", + "callback": "vaso60", + "class": "rec_cncpt" + }, + "epi60": { + "concepts": [ + "epi_rate", + "epi_dur" + ], + "description": "epinephrine administration for min 1h", + "category": "outcome", + "interval": "00:01:00", + "callback": "vaso60", + "class": "rec_cncpt" + }, + "los_hosp": { + "unit": "days", + "min": 0, + "target": "id_tbl", + "description": "hospital length of stay", + "omopid": 462369952, + "category": "outcome", + "sources": { + "eicu": [ + { + "callback": "los_callback", + "win_type": "hadm", + "class": "fun_itm" + } + ], + "eicu_demo": [ + { + "callback": "los_callback", + "win_type": "hadm", + "class": "fun_itm" + } + ], + "miiv": [ + { + "callback": "los_callback", + "win_type": "hadm", + "class": "fun_itm" + } + ], + "mimic": [ + { + "callback": "los_callback", + "win_type": "hadm", + "class": "fun_itm" + } + ], + "mimic_demo": [ + { + "callback": "los_callback", + "win_type": "hadm", + "class": "fun_itm" + } + ], + "picdb": [] + } + }, + "los_icu": { + "unit": "days", + "min": 0, + "target": "id_tbl", + "description": "ICU length of stay", + "category": "outcome", + "sources": { + "aumc": [ + { + "callback": "los_callback", + "win_type": "icustay", + "class": "fun_itm" + } + ], + "eicu": [ + { + "callback": "los_callback", + "win_type": "icustay", + "class": "fun_itm" + } + ], + "eicu_demo": [ + { + "callback": "los_callback", + "win_type": "icustay", + "class": "fun_itm" + } + ], + "hirid": [ + { + "callback": "los_callback", + "win_type": "icustay", + "class": "fun_itm" + } + ], + "miiv": [ + { + "callback": "los_callback", + "win_type": "icustay", + "class": "fun_itm" + } + ], + "mimic": [ + { + "callback": "los_callback", + "win_type": "icustay", + "class": "fun_itm" + } + ], + "mimic_demo": [ + { + "callback": "los_callback", + "win_type": "icustay", + "class": "fun_itm" + } + ], + "sic": [ + { + "table": "cases", + "val_var": "timeofstay", + "callback": "transform_fun(binary_op(`/`, 60 * 60 * 24))", + "class": "col_itm" + } + ], + "picdb": [] + } + }, + "mews": { + "concepts": [ + "sbp", + "hr", + "resp", + "temp", + "avpu" + ], + "description": "modified early warning score", + "omopid": 40484211, + "category": "outcome", + "callback": "mews_score", + "class": "rec_cncpt" + }, + "news": { + "concepts": [ + "resp", + "o2sat", + "supp_o2", + "temp", + "sbp", + "hr", + "avpu" + ], + "description": "national early warning score", + "omopid": 44808550, + "category": "outcome", + "callback": "news_score", + "class": "rec_cncpt" + }, + "norepi60": { + "concepts": [ + "norepi_rate", + "norepi_dur" + ], + "description": "norepinephrine administration for min 1h", + "category": "outcome", + "interval": "00:01:00", + "callback": "vaso60", + "class": "rec_cncpt" + }, + "qsofa": { + "concepts": [ + "gcs", + "sbp", + "resp" + ], + "description": "quick SOFA score", + "omopid": 1616732, + "category": "outcome", + "callback": "qsofa_score", + "class": "rec_cncpt" + }, + "sep3": { + "concepts": [ + "sofa", + "susp_inf" + ], + "description": "sepsis-3 criterion", + "omopid": 132797, + "category": "outcome", + "callback": "sep3", + "keep_components": [ + false, + true + ], + "class": "rec_cncpt" + }, + "sirs": { + "concepts": [ + "temp", + "hr", + "resp", + "pco2", + "wbc", + "bnd" + ], + "description": "systemic inflammatory response syndrome score", + "omopid": 4140444, + "category": "outcome", + "callback": "sirs_score", + "class": "rec_cncpt" + }, + "sofa": { + "concepts": [ + "sofa_resp", + "sofa_coag", + "sofa_liver", + "sofa_cardio", + "sofa_cns", + "sofa_renal" + ], + "description": "sequential organ failure assessment score", + "omopid": 1616852, + "category": "outcome", + "callback": "sofa_score", + "class": "rec_cncpt" + }, + "sofa_cardio": { + "concepts": [ + "map", + "dopa60", + "norepi60", + "dobu60", + "epi60" + ], + "description": "SOFA cardiovascular component", + "omopid": 1617534, + "category": "outcome", + "aggregate": [ + "min", + "max", + "max", + "max", + "max" + ], + "callback": "sofa_cardio", + "class": "rec_cncpt" + }, + "sofa_cns": { + "concepts": "gcs", + "description": "SOFA central nervous system component", + "omopid": 1616439, + "category": "outcome", + "callback": "sofa_cns", + "class": "rec_cncpt" + }, + "sofa_coag": { + "concepts": "plt", + "description": "SOFA coagulation component", + "omopid": 1616896, + "category": "outcome", + "aggregate": "min", + "callback": "sofa_coag", + "class": "rec_cncpt" + }, + "sofa_liver": { + "concepts": "bili", + "description": "SOFA liver component", + "omopid": 1617043, + "category": "outcome", + "aggregate": "max", + "callback": "sofa_liver", + "class": "rec_cncpt" + }, + "sofa_renal": { + "concepts": [ + "crea", + "urine24" + ], + "description": "SOFA renal component", + "omopid": 1616355, + "category": "outcome", + "aggregate": [ + "max", + null + ], + "callback": "sofa_renal", + "class": "rec_cncpt" + }, + "sofa_resp": { + "concepts": [ + "pafi", + "vent_ind" + ], + "description": "SOFA respiratory component", + "omopid": 1616907, + "category": "outcome", + "callback": "sofa_resp", + "class": "rec_cncpt" + }, + "susp_inf": { + "concepts": [ + "abx", + "samp" + ], + "description": "suspected infection", + "omopid": 43021378, + "category": "outcome", + "aggregate": [ + [ + "sum" + ], + [ + false + ] + ], + "callback": "susp_inf", + "class": "rec_cncpt" + } +} \ No newline at end of file diff --git a/inst/extdata/config/concept-dict/output.json b/inst/extdata/config/concept-dict/output.json new file mode 100644 index 00000000..73953d48 --- /dev/null +++ b/inst/extdata/config/concept-dict/output.json @@ -0,0 +1,175 @@ +{ + "urine": { + "unit": "mL", + "min": 0, + "max": 2000, + "aggregate": "sum", + "description": "urine output", + "omopid": 4264378, + "category": "output", + "sources": { + "aumc": [ + { + "ids": 8794, + "table": "numericitems", + "sub_var": "itemid" + } + ], + "eicu": [ + { + "ids": [ + "Urine", + "URINE CATHETER" + ], + "table": "intakeoutput", + "sub_var": "celllabel" + }, + { + "regex": "catheter.+output|output.+catheter", + "table": "intakeoutput", + "sub_var": "celllabel", + "class": "rgx_itm" + } + ], + "eicu_demo": [ + { + "ids": [ + "Urine", + "URINE CATHETER" + ], + "table": "intakeoutput", + "sub_var": "celllabel" + }, + { + "regex": "catheter.+output|output.+catheter", + "table": "intakeoutput", + "sub_var": "celllabel", + "class": "rgx_itm" + } + ], + "hirid": [ + { + "ids": 30005110, + "table": "observations", + "sub_var": "variableid", + "callback": "hirid_urine", + "class": "hrd_itm" + } + ], + "miiv": [ + { + "ids": [ + 226557, + 226558, + 226559, + 226560, + 226561, + 226563, + 226564, + 226565, + 226566, + 226567, + 226584, + 227510 + ], + "table": "outputevents", + "sub_var": "itemid" + } + ], + "mimic": [ + { + "ids": [ + 40055, + 40056, + 40057, + 40065, + 40069, + 40085, + 40086, + 40094, + 40096, + 40405, + 40428, + 40473, + 40715, + 43175, + 226557, + 226558, + 226559, + 226560, + 226561, + 226563, + 226564, + 226565, + 226566, + 226567, + 226584, + 227510 + ], + "table": "outputevents", + "sub_var": "itemid" + } + ], + "mimic_demo": [ + { + "ids": [ + 40055, + 40056, + 40057, + 40065, + 40069, + 40085, + 40086, + 40094, + 40096, + 40405, + 40428, + 40473, + 40715, + 43175, + 226557, + 226558, + 226559, + 226560, + 226561, + 226563, + 226564, + 226565, + 226566, + 226567, + 226584, + 227510 + ], + "table": "outputevents", + "sub_var": "itemid" + } + ], + "sic": [ + { + "ids": 725, + "table": "data_float_h", + "val_var": "rawdata", + "sub_var": "dataid", + "class": "sic_itm" + } + ], + "picdb": [ + { + "table": "chartevents", + "ids": [ + "1008" + ], + "sub_var": "itemid" + } + ] + } + }, + "urine24": { + "concepts": "urine", + "description": "urine output per 24h", + "omopid": 4191836, + "category": "output", + "callback": "urine24", + "class": "rec_cncpt" + } +} \ No newline at end of file diff --git a/inst/extdata/config/concept-dict/respiratory.json b/inst/extdata/config/concept-dict/respiratory.json new file mode 100644 index 00000000..5e64f8fe --- /dev/null +++ b/inst/extdata/config/concept-dict/respiratory.json @@ -0,0 +1,721 @@ +{ + "ett_gcs": { + "class": "lgl_cncpt", + "description": "tracheostomy", + "omopid": 4097216, + "category": "respiratory", + "target": "win_tbl", + "sources": { + "aumc": [ + { + "ids": 6735, + "table": "listitems", + "sub_var": "itemid", + "target": "ts_tbl", + "callback": "combine_callbacks(\n transform_fun(comp_na(`==`, 'Ge\u00efntubeerd')),\n ts_to_win_tbl(mins(1L))\n )" + } + ], + "eicu": [ + { + "class": "fun_itm", + "callback": "combine_callbacks(\n fwd_concept('rass'),\n transform_fun(comp_na(`<=`, -3)),\n ts_to_win_tbl(mins(360L))\n )" + } + ], + "eicu_demo": [ + { + "class": "fun_itm", + "callback": "combine_callbacks(\n fwd_concept('rass'),\n transform_fun(comp_na(`<=`, -3)),\n ts_to_win_tbl(mins(360L))\n )" + } + ], + "hirid": [ + { + "class": "fun_itm", + "callback": "combine_callbacks(\n fwd_concept('mech_vent'),\n transform_fun(comp_na(`==`, 'invasive'))\n )" + } + ], + "miiv": [ + { + "ids": "No Response-ETT", + "table": "chartevents", + "sub_var": "value", + "target": "ts_tbl", + "callback": "combine_callbacks(\n transform_fun(set_val(TRUE)),\n ts_to_win_tbl(mins(1L))\n )" + } + ], + "mimic": [ + { + "ids": [ + "1.0 ET/Trach", + "No Response-ETT" + ], + "table": "chartevents", + "sub_var": "value", + "target": "ts_tbl", + "callback": "combine_callbacks(\n transform_fun(set_val(TRUE)),\n ts_to_win_tbl(mins(1L))\n )" + } + ], + "mimic_demo": [ + { + "ids": [ + "1.0 ET/Trach", + "No Response-ETT" + ], + "table": "chartevents", + "sub_var": "value", + "target": "ts_tbl", + "callback": "combine_callbacks(\n transform_fun(set_val(TRUE)),\n ts_to_win_tbl(mins(1L))\n )" + } + ], + "picdb": [] + } + }, + "mech_vent": { + "class": "fct_cncpt", + "target": "win_tbl", + "levels": [ + "invasive", + "noninvasive" + ], + "description": "mechanical ventilation windows", + "omopid": 4230167, + "category": "respiratory", + "sources": { + "aumc": [ + { + "ids": [ + 9328, + 10740, + 12635 + ], + "table": "processitems", + "sub_var": "itemid", + "dur_var": "stop", + "callback": "apply_map(c(`Beademen` = 'invasive',\n `Beademen non-invasief` = 'noninvasive',\n `Tracheostoma` = 'invasive'))" + } + ], + "hirid": [ + { + "ids": 15001552, + "table": "observations", + "sub_var": "variableid", + "target": "ts_tbl", + "interval": "00:01:00", + "class": "hrd_itm", + "callback": "combine_callbacks(hirid_vent,\n apply_map(c(`1` = 'invasive',\n `2` = 'invasive',\n `3` = 'noninvasive',\n `4` = 'noninvasive',\n `5` = 'noninvasive',\n `6` = 'noninvasive')))" + } + ], + "miiv": [ + { + "ids": [ + 225792, + 225794 + ], + "table": "procedureevents", + "sub_var": "itemid", + "dur_var": "endtime", + "callback": "apply_map(c(`225792` = 'invasive',\n `225794` = 'noninvasive'),\n var = 'sub_var')" + } + ], + "picdb": [] + } + }, + "o2sat": { + "unit": [ + "%", + "% Sat." + ], + "min": 50, + "max": 100, + "description": "oxygen saturation", + "omopid": 40483579, + "category": "respiratory", + "sources": { + "aumc": [ + { + "ids": [ + 6709, + 8903 + ], + "table": "numericitems", + "sub_var": "itemid" + }, + { + "ids": 12311, + "table": "numericitems", + "sub_var": "itemid", + "callback": "transform_fun(binary_op(`*`, 100))" + } + ], + "eicu": [ + { + "table": "vitalperiodic", + "val_var": "sao2", + "unit_val": "%", + "class": "col_itm" + }, + { + "ids": "O2 Sat (%)", + "table": "lab", + "sub_var": "labname" + } + ], + "eicu_demo": [ + { + "table": "vitalperiodic", + "val_var": "sao2", + "unit_val": "%", + "class": "col_itm" + }, + { + "ids": "O2 Sat (%)", + "table": "lab", + "sub_var": "labname" + } + ], + "hirid": [ + { + "ids": [ + 4000, + 8280, + 20000800 + ], + "table": "observations", + "sub_var": "variableid", + "class": "hrd_itm" + } + ], + "miiv": [ + { + "ids": [ + 220277, + 226253, + 50817 + ], + "table": "chartevents", + "sub_var": "itemid" + } + ], + "mimic": [ + { + "ids": [ + 646, + 220277, + 226253, + 50817 + ], + "table": "chartevents", + "sub_var": "itemid" + } + ], + "mimic_demo": [ + { + "ids": [ + 646, + 220277, + 226253, + 50817 + ], + "table": "chartevents", + "sub_var": "itemid" + } + ], + "sic": [ + { + "ids": 710, + "table": "data_float_h", + "val_var": "rawdata", + "sub_var": "dataid", + "class": "sic_itm" + } + ], + "picdb": [ + { + "table": "chartevents", + "ids": [ + "1006" + ], + "sub_var": "itemid" + }, + { + "table": "labevents", + "ids": [ + 5252 + ], + "sub_var": "itemid" + } + ] + } + }, + "pafi": { + "concepts": [ + "po2", + "fio2" + ], + "description": "Horowitz index", + "omopid": 4233883, + "category": "respiratory", + "aggregate": [ + "min", + "max" + ], + "callback": "pafi", + "class": "rec_cncpt" + }, + "resp": { + "unit": [ + "insp/min", + "/min" + ], + "min": 0, + "max": 120, + "description": "respiratory rate", + "omopid": 4313591, + "category": "respiratory", + "sources": { + "aumc": [ + { + "ids": [ + 8874, + 12266 + ], + "table": "numericitems", + "sub_var": "itemid" + } + ], + "eicu": [ + { + "table": "vitalperiodic", + "val_var": "respiration", + "class": "col_itm" + } + ], + "eicu_demo": [ + { + "table": "vitalperiodic", + "val_var": "respiration", + "class": "col_itm" + } + ], + "hirid": [ + { + "ids": [ + 300, + 310 + ], + "table": "observations", + "sub_var": "variableid", + "class": "hrd_itm" + } + ], + "miiv": [ + { + "ids": [ + 220210, + 224688, + 224689, + 224690 + ], + "table": "chartevents", + "sub_var": "itemid" + } + ], + "mimic": [ + { + "ids": [ + 618, + 619, + 220210, + 224688, + 224689, + 224690 + ], + "table": "chartevents", + "sub_var": "itemid" + } + ], + "mimic_demo": [ + { + "ids": [ + 618, + 619, + 220210, + 224688, + 224689, + 224690 + ], + "table": "chartevents", + "sub_var": "itemid" + } + ], + "sic": [ + { + "ids": 719, + "table": "data_float_h", + "val_var": "rawdata", + "sub_var": "dataid", + "class": "sic_itm" + } + ], + "picdb": [ + { + "table": "chartevents", + "ids": [ + "1004" + ], + "sub_var": "itemid" + } + ] + } + }, + "safi": { + "concepts": [ + "o2sat", + "fio2" + ], + "description": "SaO2/FiO2", + "category": "respiratory", + "aggregate": [ + "min", + "max" + ], + "callback": "safi", + "class": "rec_cncpt" + }, + "supp_o2": { + "concepts": [ + "vent_ind", + "fio2" + ], + "description": "supplemental oxygen", + "omopid": 36304401, + "category": "respiratory", + "callback": "supp_o2", + "class": "rec_cncpt" + }, + "vent_end": { + "class": "lgl_cncpt", + "description": "ventilation end", + "category": "respiratory", + "sources": { + "eicu": [ + { + "table": "respiratorycare", + "val_var": "ventendoffset", + "callback": "vent_flag", + "class": "col_itm" + }, + { + "table": "respiratorycare", + "val_var": "priorventendoffset", + "callback": "vent_flag", + "class": "col_itm" + }, + { + "ids": [ + "off", + "Off", + "Suspended" + ], + "table": "respiratorycharting", + "sub_var": "respchartvalue", + "val_var": "respchartvaluelabel", + "callback": "transform_fun(set_val(TRUE))" + } + ], + "eicu_demo": [ + { + "table": "respiratorycare", + "val_var": "ventendoffset", + "callback": "vent_flag", + "class": "col_itm" + }, + { + "table": "respiratorycare", + "val_var": "priorventendoffset", + "callback": "vent_flag", + "class": "col_itm" + }, + { + "ids": [ + "off", + "Off", + "Suspended" + ], + "table": "respiratorycharting", + "sub_var": "respchartvalue", + "val_var": "respchartvaluelabel", + "callback": "transform_fun(set_val(TRUE))" + } + ], + "mimic": [ + { + "ids": [ + 225468, + 225477, + 227194 + ], + "table": "procedureevents_mv", + "sub_var": "itemid", + "callback": "transform_fun(set_val(TRUE))" + }, + { + "ids": [ + 467, + 469, + 226732 + ], + "table": "chartevents", + "sub_var": "itemid", + "callback": "transform_fun(set_val(TRUE))" + } + ], + "mimic_demo": [ + { + "ids": [ + 225468, + 225477, + 227194 + ], + "table": "procedureevents_mv", + "sub_var": "itemid", + "callback": "transform_fun(set_val(TRUE))" + }, + { + "ids": [ + 467, + 469, + 226732 + ], + "table": "chartevents", + "sub_var": "itemid", + "callback": "transform_fun(set_val(TRUE))" + } + ], + "picdb": [] + } + }, + "vent_ind": { + "concepts": [ + "vent_start", + "vent_end", + "mech_vent" + ], + "description": "ventilation durations", + "omopid": 4230167, + "category": "respiratory", + "interval": "00:01:00", + "callback": "vent_ind", + "target": "win_tbl", + "class": "rec_cncpt" + }, + "vent_start": { + "class": "lgl_cncpt", + "description": "ventilation start", + "category": "respiratory", + "sources": { + "eicu": [ + { + "table": "respiratorycare", + "val_var": "ventstartoffset", + "callback": "vent_flag", + "class": "col_itm" + }, + { + "table": "respiratorycare", + "val_var": "priorventstartoffset", + "callback": "vent_flag", + "class": "col_itm" + }, + { + "ids": [ + "Start", + "Continued", + "respFlowPtVentData" + ], + "table": "respiratorycharting", + "sub_var": "respcharttypecat", + "callback": "transform_fun(set_val(TRUE))" + } + ], + "eicu_demo": [ + { + "table": "respiratorycare", + "val_var": "ventstartoffset", + "callback": "vent_flag", + "class": "col_itm" + }, + { + "table": "respiratorycare", + "val_var": "priorventstartoffset", + "callback": "vent_flag", + "class": "col_itm" + }, + { + "ids": [ + "Start", + "Continued", + "respFlowPtVentData" + ], + "table": "respiratorycharting", + "sub_var": "respcharttypecat", + "callback": "transform_fun(set_val(TRUE))" + } + ], + "mimic": [ + { + "ids": [ + 1, + 60, + 218, + 221, + 223, + 436, + 437, + 444, + 445, + 448, + 449, + 450, + 459, + 501, + 502, + 503, + 505, + 506, + 535, + 543, + 639, + 654, + 667, + 668, + 669, + 670, + 671, + 672, + 681, + 682, + 683, + 684, + 686, + 1211, + 1340, + 1486, + 1600, + 1655, + 2000, + 3459, + 5865, + 5866, + 220339, + 223848, + 223849, + 224419, + 224684, + 224685, + 224686, + 224687, + 224695, + 224696, + 224697, + 224700, + 224701, + 224702, + 224703, + 224704, + 224705, + 224706, + 224707, + 224709, + 224738, + 224746, + 224747, + 224750, + 226873, + 227187 + ], + "table": "chartevents", + "sub_var": "itemid", + "callback": "transform_fun(set_val(TRUE))" + } + ], + "mimic_demo": [ + { + "ids": [ + 1, + 60, + 218, + 221, + 223, + 436, + 437, + 444, + 445, + 448, + 449, + 450, + 459, + 501, + 502, + 503, + 505, + 506, + 535, + 543, + 639, + 654, + 667, + 668, + 669, + 670, + 671, + 672, + 681, + 682, + 683, + 684, + 686, + 1211, + 1340, + 1486, + 1600, + 1655, + 2000, + 3459, + 5865, + 5866, + 220339, + 223848, + 223849, + 224419, + 224684, + 224685, + 224686, + 224687, + 224695, + 224696, + 224697, + 224700, + 224701, + 224702, + 224703, + 224704, + 224705, + 224706, + 224707, + 224709, + 224738, + 224746, + 224747, + 224750, + 226873, + 227187 + ], + "table": "chartevents", + "sub_var": "itemid", + "callback": "transform_fun(set_val(TRUE))" + } + ], + "picdb": [] + } + } +} \ No newline at end of file diff --git a/inst/extdata/config/concept-dict/vitals.json b/inst/extdata/config/concept-dict/vitals.json new file mode 100644 index 00000000..75967e5e --- /dev/null +++ b/inst/extdata/config/concept-dict/vitals.json @@ -0,0 +1,609 @@ +{ + "dbp": { + "unit": [ + "mmHg", + "mm Hg" + ], + "min": 0, + "max": 200, + "description": "diastolic blood pressure", + "omopid": 4154790, + "category": "vitals", + "sources": { + "aumc": [ + { + "ids": 6643, + "table": "numericitems", + "sub_var": "itemid" + } + ], + "eicu": [ + { + "table": "vitalperiodic", + "val_var": "systemicdiastolic", + "class": "col_itm" + } + ], + "eicu_demo": [ + { + "table": "vitalperiodic", + "val_var": "systemicdiastolic", + "class": "col_itm" + } + ], + "hirid": [ + { + "ids": 120, + "table": "observations", + "sub_var": "variableid", + "class": "hrd_itm" + } + ], + "miiv": [ + { + "ids": [ + 220051, + 220180 + ], + "table": "chartevents", + "sub_var": "itemid" + } + ], + "mimic": [ + { + "ids": [ + 8368, + 8441, + 8555, + 220051, + 220180 + ], + "table": "chartevents", + "sub_var": "itemid" + } + ], + "mimic_demo": [ + { + "ids": [ + 8368, + 8441, + 8555, + 220051, + 220180 + ], + "table": "chartevents", + "sub_var": "itemid" + } + ], + "sic": [ + { + "ids": [ + 702, + 705 + ], + "table": "data_float_h", + "val_var": "rawdata", + "sub_var": "dataid", + "class": "sic_itm" + } + ], + "picdb": [ + { + "table": "chartevents", + "ids": [ + 1015 + ], + "sub_var": "itemid" + } + ] + } + }, + "etco2": { + "unit": [ + "mmHg", + "mm Hg" + ], + "min": 10, + "max": 60, + "description": "endtidal CO2", + "omopid": 4353940, + "category": "vitals", + "sources": { + "aumc": [ + { + "ids": [ + 6707, + 8884, + 8885, + 9658, + 12805, + 12356 + ], + "table": "numericitems", + "sub_var": "itemid", + "callback": "convert_unit(binary_op(`*`, 7.6), 'mmHg', 'None|Geen')" + } + ], + "hirid": [ + { + "ids": [ + 2200, + 8290, + 30010009 + ], + "table": "observations", + "sub_var": "variableid", + "class": "hrd_itm" + } + ], + "miiv": [ + { + "ids": 228640, + "table": "chartevents", + "sub_var": "itemid" + } + ], + "mimic": [ + { + "ids": [ + 1817, + 228640 + ], + "table": "chartevents", + "sub_var": "itemid" + } + ], + "mimic_demo": [ + { + "ids": [ + 1817, + 228640 + ], + "table": "chartevents", + "sub_var": "itemid" + } + ], + "sic": [ + { + "ids": 716, + "table": "laboratory", + "sub_var": "laboratoryid", + "class": "sic_itm" + } + ], + "picdb": [ + ] + } + }, + "hr": { + "unit": [ + "bpm", + "/min" + ], + "min": 0, + "max": 300, + "description": "heart rate", + "omopid": 4239408, + "category": "vitals", + "sources": { + "aumc": [ + { + "ids": 6640, + "table": "numericitems", + "sub_var": "itemid" + } + ], + "eicu": [ + { + "table": "vitalperiodic", + "val_var": "heartrate", + "class": "col_itm" + } + ], + "eicu_demo": [ + { + "table": "vitalperiodic", + "val_var": "heartrate", + "class": "col_itm" + } + ], + "hirid": [ + { + "ids": 200, + "table": "observations", + "sub_var": "variableid", + "class": "hrd_itm" + } + ], + "miiv": [ + { + "ids": 220045, + "table": "chartevents", + "sub_var": "itemid" + } + ], + "mimic": [ + { + "ids": [ + 211, + 220045 + ], + "table": "chartevents", + "sub_var": "itemid" + } + ], + "mimic_demo": [ + { + "ids": [ + 211, + 220045 + ], + "table": "chartevents", + "sub_var": "itemid" + } + ], + "sic": [ + { + "ids": [708, 724], + "table": "data_float_h", + "val_var": "rawdata", + "sub_var": "dataid", + "class": "sic_itm" + } + ], + "picdb": [ + { + "table": "chartevents", + "ids": [ + 1003, 1002 + ], + "sub_var": "itemid" + } + ] + } + }, + "map": { + "unit": [ + "mmHg", + "mm Hg" + ], + "min": 0, + "max": 250, + "description": "mean arterial pressure", + "omopid": 4239021, + "category": "vitals", + "sources": { + "aumc": [ + { + "ids": 6642, + "table": "numericitems", + "sub_var": "itemid" + } + ], + "eicu": [ + { + "table": "vitalperiodic", + "val_var": "systemicmean", + "class": "col_itm" + }, + { + "table": "vitalaperiodic", + "val_var": "noninvasivemean", + "class": "col_itm" + } + ], + "eicu_demo": [ + { + "table": "vitalperiodic", + "val_var": "systemicmean", + "class": "col_itm" + }, + { + "table": "vitalaperiodic", + "val_var": "noninvasivemean", + "class": "col_itm" + } + ], + "hirid": [ + { + "ids": [ + 110, + 610 + ], + "table": "observations", + "sub_var": "variableid", + "class": "hrd_itm" + } + ], + "miiv": [ + { + "ids": [ + 220052, + 220181, + 225312 + ], + "table": "chartevents", + "sub_var": "itemid" + } + ], + "mimic": [ + { + "ids": [ + 52, + 443, + 456, + 6072, + 220052, + 220181, + 225312 + ], + "table": "chartevents", + "sub_var": "itemid" + } + ], + "mimic_demo": [ + { + "ids": [ + 52, + 443, + 456, + 6072, + 220052, + 220181, + 225312 + ], + "table": "chartevents", + "sub_var": "itemid" + } + ], + "sic": [ + { + "ids": [ + 703, + 706 + ], + "table": "data_float_h", + "val_var": "rawdata", + "sub_var": "dataid", + "class": "sic_itm" + } + ], + "picdb": [ + ] + } + }, + "sbp": { + "unit": [ + "mmHg", + "mm Hg" + ], + "min": 0, + "max": 300, + "description": "systolic blood pressure", + "omopid": 4152194, + "category": "vitals", + "sources": { + "aumc": [ + { + "ids": 6641, + "table": "numericitems", + "sub_var": "itemid" + } + ], + "eicu": [ + { + "table": "vitalperiodic", + "val_var": "systemicsystolic", + "class": "col_itm" + } + ], + "eicu_demo": [ + { + "table": "vitalperiodic", + "val_var": "systemicsystolic", + "class": "col_itm" + } + ], + "hirid": [ + { + "ids": 100, + "table": "observations", + "sub_var": "variableid", + "class": "hrd_itm" + } + ], + "miiv": [ + { + "ids": [ + 220050, + 220179 + ], + "table": "chartevents", + "sub_var": "itemid" + } + ], + "mimic": [ + { + "ids": [ + 51, + 455, + 6701, + 220050, + 220179 + ], + "table": "chartevents", + "sub_var": "itemid" + } + ], + "mimic_demo": [ + { + "ids": [ + 51, + 455, + 6701, + 220050, + 220179 + ], + "table": "chartevents", + "sub_var": "itemid" + } + ], + "sic": [ + { + "ids": [ + 701, + 704 + ], + "table": "data_float_h", + "val_var": "rawdata", + "sub_var": "dataid", + "class": "sic_itm" + } + ], + "picdb": [ + { + "table": "chartevents", + "ids": [ + 1016 + ], + "sub_var": "itemid" + } + ] + } + }, + "temp": { + "unit": [ + "C", + "\u00b0C" + ], + "min": 30, + "max": 44, + "description": "temperature", + "omopid": 4302666, + "category": "vitals", + "sources": { + "aumc": [ + { + "ids": [ + 8658, + 13952, + 16110 + ], + "table": "numericitems", + "sub_var": "itemid" + } + ], + "eicu": [ + { + "table": "vitalperiodic", + "val_var": "temperature", + "class": "col_itm" + } + ], + "eicu_demo": [ + { + "table": "vitalperiodic", + "val_var": "temperature", + "class": "col_itm" + } + ], + "hirid": [ + { + "ids": [ + 410, + 400, + 7100 + ], + "table": "observations", + "sub_var": "variableid", + "class": "hrd_itm" + } + ], + "miiv": [ + { + "ids": 223762, + "table": "chartevents", + "sub_var": "itemid" + }, + { + "ids": [ + 223761, + 224027 + ], + "table": "chartevents", + "sub_var": "itemid", + "callback": "convert_unit(fahr_to_cels, 'C', 'f')" + } + ], + "mimic": [ + { + "ids": [ + 676, + 677, + 223762 + ], + "table": "chartevents", + "sub_var": "itemid" + }, + { + "ids": [ + 678, + 679, + 223761, + 224027 + ], + "table": "chartevents", + "sub_var": "itemid", + "callback": "convert_unit(fahr_to_cels, 'C', 'f')" + } + ], + "mimic_demo": [ + { + "ids": [ + 676, + 677, + 223762 + ], + "table": "chartevents", + "sub_var": "itemid" + }, + { + "ids": [ + 678, + 679, + 223761, + 224027 + ], + "table": "chartevents", + "sub_var": "itemid", + "callback": "convert_unit(fahr_to_cels, 'C', 'f')" + } + ], + "sic": [ + { + "ids": 709, + "table": "data_float_h", + "val_var": "rawdata", + "sub_var": "dataid", + "class": "sic_itm" + } + ], + "picdb": [ + { + "table": "chartevents", + "ids": [ + 1001 + ], + "sub_var": "itemid" + }, + { + "table": "labevents", + "ids": [ + 5253 + ], + "sub_var": "itemid" + } + ] + } + } +} \ No newline at end of file diff --git a/inst/extdata/config/data-sources.R b/inst/extdata/config/data-sources.R deleted file mode 100644 index 1a578b1e..00000000 --- a/inst/extdata/config/data-sources.R +++ /dev/null @@ -1,1791 +0,0 @@ - -download_pysionet_schema <- function(url) { - - dat <- ricu:::download_pysionet_file( - url, dest = NULL, user = NULL, pass = NULL - ) - - message("downloading schema at ", url) - - xml2::as_list(xml2::read_xml(rawToChar(dat))) -} - -get_table_info <- function(url) { - - res <- download_pysionet_schema(url) - res <- res[["database"]][["tables"]] - - res <- lapply(res, function(x) { - cols <- names(x) == "column" - names <- vapply(x[cols], attr, character(1L), "name") - types <- vapply(x[cols], attr, character(1L), "type") - list( - table_name = tolower(attr(x, "name")), - num_rows = as.integer(attr(x, "numRows")), - cols = as_col_spec(names, types) - ) - }) - - unname(res) -} - -col_spec_map <- function(type) { - switch(type, - bool = list(spec = "col_logical"), - int2 = , - int4 = list(spec = "col_integer"), - int8 = , - numeric = , - float8 = list(spec = "col_double"), - bpchar = , - text = , - varchar = list(spec = "col_character"), - timestamp = list(spec = "col_datetime", format = "%Y-%m-%d %H:%M:%S"), - stop("unknown type") - ) -} - -as_col_spec <- function(names, types) { - Map(c, Map(list, name = tolower(names), col = names), - lapply(types, col_spec_map)) -} - -as_tbl_spec <- function(files, defaults, time_vars, tbl_info, partitioning) { - - mod_col <- function(x) { - x[["name"]] <- x[["col"]] - x[["col"]] <- NULL - x - } - - do_as <- function(file, default, time, tbl, part) { - - all_cols <- vapply(tbl[["cols"]], `[[`, character(1L), "name") - - stopifnot(all(vapply(default, `%in%`, logical(1L), all_cols))) - - if (length(time)) { - default <- c(default, list(time_vars = unname(time))) - } - - tbl <- c(list(files = file, defaults = default), tbl) - - tbl[["table_name"]] <- NULL - tbl[["cols"]] <- setNames(lapply(tbl[["cols"]], mod_col), all_cols) - - if (!is.null(part)) { - stopifnot(isTRUE(names(part) %in% all_cols)) - tbl <- c(tbl, list(partitioning = list(col = names(part), - breaks = part[[1L]]))) - } - - tbl - } - - tbls <- vapply(tbl_info, `[[`, character(1L), "table_name") - - res <- Map(do_as, files[tbls], defaults[tbls], time_vars[tbls], tbl_info, - partitioning[tbls]) - names(res) <- tolower(tbls) - - res -} - -as_minimal_tbl_spec <- function(x) { - x[setdiff(names(x), c("files", "num_rows", "cols"))] -} - -eicu_tbl_cfg <- function(info, is_demo = FALSE) { - - files <- c("admissionDrug.csv.gz", - "admissionDx.csv.gz", - "allergy.csv.gz", - "apacheApsVar.csv.gz", - "apachePatientResult.csv.gz", - "apachePredVar.csv.gz", - "carePlanCareProvider.csv.gz", - "carePlanEOL.csv.gz", - "carePlanGeneral.csv.gz", - "carePlanGoal.csv.gz", - "carePlanInfectiousDisease.csv.gz", - "customLab.csv.gz", - "diagnosis.csv.gz", - "hospital.csv.gz", - "infusionDrug.csv.gz", - "intakeOutput.csv.gz", - "lab.csv.gz", - "medication.csv.gz", - "microLab.csv.gz", - "note.csv.gz", - "nurseAssessment.csv.gz", - "nurseCare.csv.gz", - "nurseCharting.csv.gz", - "pastHistory.csv.gz", - "patient.csv.gz", - "physicalExam.csv.gz", - "respiratoryCare.csv.gz", - "respiratoryCharting.csv.gz", - "treatment.csv.gz", - "vitalAperiodic.csv.gz", - "vitalPeriodic.csv.gz") - names(files) <- sub("\\.csv\\.gz", "", tolower(files)) - - if (is_demo) { - files <- sub("Drug\\.csv\\.gz", "drug.csv.gz", files) - } - - defaults <- list( - admissiondrug = list( - index_var = "drugoffset", - val_var = "drugdosage", - unit_var = "drugunit" - ), - admissiondx = list( - index_var = "admitdxenteredoffset", - val_var = "admitdxtext" - ), - allergy = list( - index_var = "allergyoffset", - val_var = "allergyname" - ), - apacheapsvar = list(), - apachepatientresult = list( - val_var = "apachescore" - ), - apachepredvar = list(), - careplancareprovider = list( - index_var = "careprovidersaveoffset", - val_var = "specialty" - ), - careplaneol = list( - index_var = "cpleoldiscussionoffset" - ), - careplangeneral = list( - index_var = "cplitemoffset", - val_var = "cplitemvalue" - ), - careplangoal = list( - index_var = "cplgoaloffset", - val_var = "cplgoalvalue" - ), - careplaninfectiousdisease = list( - index_var = "cplinfectdiseaseoffset", - val_var = "infectdiseasesite" - ), - customlab = list( - index_var = "labotheroffset", - val_var = "labotherresult" - ), - diagnosis = list( - index_var = "diagnosisoffset", - val_var = "icd9code" - ), - hospital = list( - id_var = "hospitalid", - val_var = "numbedscategory" - ), - infusiondrug = list( - index_var = "infusionoffset", - val_var = "drugrate" - ), - intakeoutput = list( - index_var = "intakeoutputoffset", - val_var = "cellvaluenumeric" - ), - lab = list( - index_var = "labresultoffset", - val_var = "labresult", - unit_var = "labmeasurenameinterface" - ), - medication = list( - index_var = "drugstartoffset", - val_var = "dosage" - ), - microlab = list( - index_var = "culturetakenoffset", - val_var = "organism" - ), - note = list( - index_var = "noteoffset", - val_var = "notetext" - ), - nurseassessment = list( - index_var = "nurseassessoffset", - val_var = "cellattributevalue" - ), - nursecare = list( - index_var = "nursecareoffset", - val_var = "cellattributevalue" - ), - nursecharting = list( - index_var = "nursingchartoffset", - val_var = "nursingchartvalue" - ), - pasthistory = list( - index_var = "pasthistoryoffset", - val_var = "pasthistoryvalue" - ), - patient = list( - val_var = "unitdischargestatus" - ), - physicalexam = list( - index_var = "physicalexamoffset", - val_var = "physicalexamvalue" - ), - respiratorycare = list( - index_var = "respcarestatusoffset" - ), - respiratorycharting = list( - index_var = "respchartoffset", - val_var = "respchartvalue" - ), - treatment = list( - index_var = "treatmentoffset", - val_var = "treatmentstring" - ), - vitalaperiodic = list( - index_var = "observationoffset" - ), - vitalperiodic = list( - index_var = "observationoffset" - ) - ) - - part <- list( - nursecharting = list( - patientunitstayid = `if`(is_demo, - 1775421L, - c(514528L, 1037072L, 1453997L, 1775421L, 2499831L, 2937948L, 3213286L) - ) - ), - vitalperiodic = list( - patientunitstayid = `if`(is_demo, - 1775421L, - c(514528L, 1037072L, 1453997L, 1775421L, 2499831L, 2937948L, 3213286L) - ) - ) - ) - - if (is_demo) { - - info <- lapply(info, `[[<-`, "num_rows", NULL) - - } else { - - tbl <- vapply(info, `[[`, character(1L), "table_name") == "respiratorycare" - new <- info[[which(tbl)]][["cols"]] - col <- vapply(new, `[[`, character(1L), "col") == "apneaparams" - - new[[which(col)]][["col"]] <- "apneaparms" - info[[which(tbl)]][["cols"]] <- new - } - - time_vars <- lapply(info, function(x) { - nme <- vapply(x[["cols"]], `[[`, character(1L), "name") - typ <- vapply(x[["cols"]], `[[`, character(1L), "spec") - nme[typ == "col_integer" & grepl("offset$", nme)] - }) - - names(time_vars) <- vapply(info, `[[`, character(1L), "table_name") - - as_tbl_spec(files, defaults, time_vars, info, part) -} - -mimic_tbl_cfg <- function(info, is_demo = FALSE) { - - find_entry <- function(x, what, name) { - which(vapply(x, `[[`, character(1L), what) == name) - } - - files <- c("ADMISSIONS.csv.gz", - "CALLOUT.csv.gz", - "CAREGIVERS.csv.gz", - "CHARTEVENTS.csv.gz", - "CPTEVENTS.csv.gz", - "DATETIMEEVENTS.csv.gz", - "DIAGNOSES_ICD.csv.gz", - "DRGCODES.csv.gz", - "D_CPT.csv.gz", - "D_ICD_DIAGNOSES.csv.gz", - "D_ICD_PROCEDURES.csv.gz", - "D_ITEMS.csv.gz", - "D_LABITEMS.csv.gz", - "ICUSTAYS.csv.gz", - "INPUTEVENTS_CV.csv.gz", - "INPUTEVENTS_MV.csv.gz", - "LABEVENTS.csv.gz", - "MICROBIOLOGYEVENTS.csv.gz", - "NOTEEVENTS.csv.gz", - "OUTPUTEVENTS.csv.gz", - "PATIENTS.csv.gz", - "PRESCRIPTIONS.csv.gz", - "PROCEDUREEVENTS_MV.csv.gz", - "PROCEDURES_ICD.csv.gz", - "SERVICES.csv.gz", - "TRANSFERS.csv.gz") - names(files) <- sub("\\.csv\\.gz", "", tolower(files)) - - if (is_demo) { - files <- sub("\\.gz$", "", files) - } - - defaults <- list( - admissions = list( - val_var = "admission_type" - ), - callout = list( - index_var = "outcometime", - val_var = "callout_outcome" - ), - caregivers = list( - id_var = "cgid", - val_var = "label" - ), - chartevents = list( - index_var = "charttime", - val_var = "valuenum", - unit_var = "valueuom" - ), - cptevents = list( - index_var = "chartdate", - val_var = "cpt_cd" - ), - d_cpt = list( - id_var = "subsectionrange", - val_var = "subsectionheader" - ), - d_icd_diagnoses = list( - id_var = "icd9_code", - val_var = "short_title" - ), - d_icd_procedures = list( - id_var = "icd9_code", - val_var = "short_title" - ), - d_items = list( - id_var = "itemid", - val_var = "label" - ), - d_labitems = list( - id_var = "itemid", - val_var = "label" - ), - datetimeevents = list( - index_var = "charttime", - val_var = "itemid" - ), - diagnoses_icd = list( - val_var = "icd9_code" - ), - drgcodes = list( - val_var = "drg_code" - ), - icustays = list( - index_var = "intime", - val_var = "last_careunit" - ), - inputevents_cv = list( - index_var = "charttime", - val_var = "rate", - unit_var = "rateuom" - ), - inputevents_mv = list( - index_var = "starttime", - val_var = "rate", - unit_var = "rateuom" - ), - labevents = list( - index_var = "charttime", - val_var = "valuenum", - unit_var = "valueuom" - ), - microbiologyevents = list( - index_var = "chartdate", - val_var = "isolate_num" - ), - noteevents = list( - index_var = "chartdate", - val_var = "text" - ), - outputevents = list( - index_var = "charttime", - val_var = "value", - unit_var = "valueuom" - ), - patients = list( - val_var = "expire_flag" - ), - prescriptions = list( - index_var = "startdate", - val_var = "dose_val_rx", - unit_var = "dose_unit_rx" - ), - procedureevents_mv = list( - index_var = "starttime", - val_var = "value", - unit_var = "valueuom" - ), - procedures_icd = list( - val_var = "icd9_code" - ), - services = list( - index_var = "transfertime", - val_var = "curr_service" - ), - transfers = list( - index_var = "intime", - val_var = "curr_careunit" - ) - ) - - part <- list( - chartevents = list( - itemid = `if`(is_demo, - 100000L, - c( 127L, 210L, 425L, 549L, 643L, 741L, 1483L, - 3458L, 3695L, 8440L, 8553L, 220274L, 223921L, 224085L, - 224859L, 227629L - ) - ) - ) - ) - - info <- info[ - !grepl("^chartevents_", vapply(info, `[[`, character(1L), "table_name")) - ] - - if (is_demo) { - - info <- lapply(info, `[[<-`, "num_rows", NULL) - - info <- info[ - vapply(info, `[[`, character(1L), "table_name") != "noteevents" - ] - - } else { - - info <- lapply(info, function(x) { - x[["cols"]] <- Map(`[[<-`, x[["cols"]], "col", - toupper(vapply(x[["cols"]], `[[`, character(1L), "col")) - ) - x - }) - - icd_diag <- find_entry(info, "table_name", "d_icd_diagnoses") - info[[icd_diag]]$num_rows <- 14567L - - icd_proc <- find_entry(info, "table_name", "d_icd_procedures") - info[[icd_proc]]$num_rows <- 3882L - - note <- find_entry(info, "table_name", "noteevents") - date <- find_entry(info[[note]]$cols, "name", "chartdate") - info[[note]]$cols[[date]]$format <- "%Y-%m-%d" - } - - time_vars <- lapply(info, function(x) { - nme <- vapply(x[["cols"]], `[[`, character(1L), "name") - typ <- vapply(x[["cols"]], `[[`, character(1L), "spec") - nme[typ == "col_datetime"] - }) - - names(time_vars) <- vapply(info, `[[`, character(1L), "table_name") - - as_tbl_spec(files, defaults, time_vars, info, part) -} - -hirid_tbl_cfg <- function() { - - info <- list( - general = list( - patientid = list(spec = "col_integer"), - admissiontime = list(spec = "col_datetime", - format = "%Y-%m-%d %H:%M:%S"), - sex = list(spec = "col_character"), - age = list(spec = "col_integer"), - discharge_status = list(spec = "col_character") - ), - observations = list( - patientid = list(spec = "col_integer"), - datetime = list(spec = "col_datetime", format = "%Y-%m-%d %H:%M:%S"), - entertime = list(spec = "col_datetime", format = "%Y-%m-%d %H:%M:%S"), - status = list(spec = "col_integer"), - stringvalue = list(spec = "col_character"), - type = list(spec = "col_character"), - value = list(spec = "col_double"), - variableid = list(spec = "col_integer") - ), - ordinal = list( - variableid = list(spec = "col_integer"), - code = list(spec = "col_integer"), - stringvalue = list(spec = "col_character") - ), - pharma = list( - patientid = list(spec = "col_integer"), - pharmaid = list(spec = "col_integer"), - givenat = list(spec = "col_datetime", format = "%Y-%m-%d %H:%M:%S"), - enteredentryat = list(spec = "col_datetime", - format = "%Y-%m-%d %H:%M:%S"), - givendose = list(spec = "col_double"), - cumulativedose = list(spec = "col_double"), - fluidamount_calc = list(spec = "col_double"), - cumulfluidamount_calc = list(spec = "col_double"), - doseunit = list(spec = "col_character"), - route = list(spec = "col_character"), - infusionid = list(spec = "col_integer"), - typeid = list(spec = "col_integer"), - subtypeid = list(spec = "col_double"), - recordstatus = list(spec = "col_integer") - ), - variables = list( - `Source Table` = list(spec = "col_character"), - ID = list(spec = "col_integer"), - `Variable Name` = list(spec = "col_character"), - Unit = list(spec = "col_character"), - `Additional information` = list(spec = "col_character") - ) - ) - - files <- list( - general = "general_table.csv", - observations = file.path( - "observation_tables", "csv", paste0("part-", 0L:249L, ".csv") - ), - ordinal = "ordinal_vars_ref.csv", - pharma = file.path( - "pharma_records", "csv", paste0("part-", 0L:249L, ".csv") - ), - variables = "hirid_variable_reference.csv" - ) - - defaults <- list( - general = list( - index_var = "admissiontime" - ), - observations = list( - index_var = "datetime", - val_var = "value" - ), - ordinal = list( - id_var = "variableid" - ), - pharma = list( - index_var = "givenat", - val_var = "givendose", - unit_var = "doseunit" - ), - variables = list( - id_var = "id" - ) - ) - - n_row <- list( - general = 33905L, - variables = 712L, - ordinal = 72L, - pharma = 16270399L, - observations = 776921131L - ) - - zip_files <- list( - general = "reference_data.tar.gz", - variables = "reference_data.tar.gz", - ordinal = "reference_data.tar.gz", - pharma = "raw_stage/pharma_records_csv.tar.gz", - observations = "raw_stage/observation_tables_csv.tar.gz" - ) - - part <- list( - observations = list(variableid = c( - 110L, 120L, 200L, 210L, 211L, 300L, 620L, - 2010L, 2610L, 3110L, 4000L, 5685L, 15001565L, 30005075L) - ), - pharma = list(pharmaid = 431L) - ) - - info <- lapply(info, function(x) { - Map(c, Map(list, name = sub(" ", "_", tolower(names(x))), - col = names(x)), x) - }) - - info <- Map(list, table_name = names(info), cols = info, - num_rows = n_row[names(info)], - zip_file = zip_files[names(info)]) - - time_vars <- lapply(info, function(x) { - nme <- vapply(x[["cols"]], `[[`, character(1L), "name") - typ <- vapply(x[["cols"]], `[[`, character(1L), "spec") - nme[typ == "col_datetime"] - }) - - names(time_vars) <- vapply(info, `[[`, character(1L), "table_name") - - as_tbl_spec(files, defaults, time_vars, info, part) -} - -aumc_tbl_cfg <- function() { - - info <- list( - admissions = list( - patientid = list(spec = "col_integer"), - admissionid = list(spec = "col_integer"), - admissioncount = list(spec = "col_integer"), - location = list(spec = "col_character"), - urgency = list(spec = "col_logical"), - origin = list(spec = "col_character"), - admittedat = list(spec = "col_double"), - admissionyeargroup = list(spec = "col_character"), - dischargedat = list(spec = "col_double"), - lengthofstay = list(spec = "col_integer"), - destination = list(spec = "col_character"), - gender = list(spec = "col_character"), - agegroup = list(spec = "col_character"), - dateofdeath = list(spec = "col_double"), - weightgroup = list(spec = "col_character"), - weightsource = list(spec = "col_character"), - specialty = list(spec = "col_character") - ), - drugitems = list( - admissionid = list(spec = "col_integer"), - orderid = list(spec = "col_integer"), - ordercategoryid = list(spec = "col_integer"), - ordercategory = list(spec = "col_character"), - itemid = list(spec = "col_integer"), - item = list(spec = "col_character"), - isadditive = list(spec = "col_logical"), - isconditional = list(spec = "col_logical"), - rate = list(spec = "col_double"), - rateunit = list(spec = "col_character"), - rateunitid = list(spec = "col_integer"), - ratetimeunitid = list(spec = "col_integer"), - doserateperkg = list(spec = "col_logical"), - dose = list(spec = "col_double"), - doseunit = list(spec = "col_character"), - doserateunit = list(spec = "col_character"), - doseunitid = list(spec = "col_integer"), - doserateunitid = list(spec = "col_integer"), - administered = list(spec = "col_double"), - administeredunit = list(spec = "col_character"), - administeredunitid = list(spec = "col_integer"), - action = list(spec = "col_character"), - start = list(spec = "col_double"), - stop = list(spec = "col_double"), - duration = list(spec = "col_integer"), - solutionitemid = list(spec = "col_integer"), - solutionitem = list(spec = "col_character"), - solutionadministered = list(spec = "col_double"), - solutionadministeredunit = list(spec = "col_character"), - fluidin = list(spec = "col_double"), - iscontinuous = list(spec = "col_logical") - ), - freetextitems = list( - admissionid = list(spec = "col_integer"), - itemid = list(spec = "col_integer"), - item = list(spec = "col_character"), - value = list(spec = "col_character"), - comment = list(spec = "col_character"), - measuredat = list(spec = "col_double"), - registeredat = list(spec = "col_double"), - registeredby = list(spec = "col_character"), - updatedat = list(spec = "col_double"), - updatedby = list(spec = "col_character"), - islabresult = list(spec = "col_logical") - ), - listitems = list( - admissionid = list(spec = "col_integer"), - itemid = list(spec = "col_integer"), - item = list(spec = "col_character"), - valueid = list(spec = "col_integer"), - value = list(spec = "col_character"), - measuredat = list(spec = "col_double"), - registeredat = list(spec = "col_double"), - registeredby = list(spec = "col_character"), - updatedat = list(spec = "col_double"), - updatedby = list(spec = "col_character"), - islabresult = list(spec = "col_logical") - ), - numericitems = list( - admissionid = list(spec = "col_integer"), - itemid = list(spec = "col_integer"), - item = list(spec = "col_character"), - tag = list(spec = "col_character"), - value = list(spec = "col_double"), - unitid = list(spec = "col_integer"), - unit = list(spec = "col_character"), - comment = list(spec = "col_character"), - measuredat = list(spec = "col_double"), - registeredat = list(spec = "col_double"), - registeredby = list(spec = "col_character"), - updatedat = list(spec = "col_double"), - updatedby = list(spec = "col_character"), - islabresult = list(spec = "col_logical"), - fluidout = list(spec = "col_double") - ), - procedureorderitems = list( - admissionid = list(spec = "col_integer"), - orderid = list(spec = "col_integer"), - ordercategoryid = list(spec = "col_integer"), - ordercategoryname = list(spec = "col_character"), - itemid = list(spec = "col_integer"), - item = list(spec = "col_character"), - registeredat = list(spec = "col_double"), - registeredby = list(spec = "col_character") - ), - processitems = list( - admissionid = list(spec = "col_integer"), - itemid = list(spec = "col_integer"), - item = list(spec = "col_character"), - start = list(spec = "col_double"), - stop = list(spec = "col_double"), - duration = list(spec = "col_integer") - ) - ) - - tables <- names(info) - - cols <- lapply(info, function(tbl) { - Map(function(name, spec) c(list(name = name), spec), names(tbl), tbl) - }) - - defaults <- list( - admissions = list( - index_var = "admittedat", - time_vars = c("admittedat", "dischargedat", "dateofdeath") - ), - drugitems = list( - index_var = "start", - val_var = "dose", - unit_var = "doseunit", - time_vars = c("start", "stop") - ), - freetextitems = list( - index_var = "measuredat", - id_var = "value", - time_vars = c("measuredat", "registeredat", "updatedat") - ), - listitems = list( - index_var = "measuredat", - val_var = "value", - time_vars = c("measuredat", "registeredat", "updatedat") - ), - numericitems = list( - index_var = "measuredat", - val_var = "value", - unit_var = "unit", - time_vars = c("measuredat", "registeredat", "updatedat") - ), - procedureorderitems = list( - index_var = "registeredat", - val_var = "item", - time_vars = "registeredat" - ), - processitems = list( - index_var = "start", - val_var = "item", - time_vars = c("start", "stop") - ) - ) - - n_row <- list( - admissions = 23106L, - drugitems = 4907269L, - freetextitems = 651248L, - listitems = 30744065L, - numericitems = 977625612L, - procedureorderitems = 2188626L, - processitems = 256715L - ) - - part <- list( - listitems = list(col = "itemid", breaks = 12290L), - numericitems = list(col = "itemid", breaks = c( - 6641L, 6642L, 6643L, 6664L, 6666L, 6667L, 6669L, 6672L, 6673L, - 6675L, 6707L, 6709L, 8874L, 12270L, 12275L, 12278L, 12281L, 12286L, - 12303L, 12561L, 12576L, 12804L, 14841L) - ) - ) - - tables <- Map(list, files = setNames(paste0(tables, ".csv"), tables), - defaults = defaults[tables], num_rows = n_row[tables], - cols = cols[tables]) - - tables[names(part)] <- Map(`[[<-`, tables[names(part)], "partitioning", part) - - tables -} - -miiv_tbl_cfg <- function() { - - info <- list( - admissions = list( - subject_id = list(spec = "col_integer"), - hadm_id = list(spec = "col_integer"), - admittime = list(spec = "col_datetime", format = "%Y-%m-%d %H:%M:%S"), - dischtime = list(spec = "col_datetime", format = "%Y-%m-%d %H:%M:%S"), - deathtime = list(spec = "col_datetime", format = "%Y-%m-%d %H:%M:%S"), - admission_type = list(spec = "col_character"), - admission_location = list(spec = "col_character"), - discharge_location = list(spec = "col_character"), - insurance = list(spec = "col_character"), - language = list(spec = "col_character"), - marital_status = list(spec = "col_character"), - ethnicity = list(spec = "col_character"), - edregtime = list(spec = "col_datetime", format = "%Y-%m-%d %H:%M:%S"), - edouttime = list(spec = "col_datetime", format = "%Y-%m-%d %H:%M:%S"), - hospital_expire_flag = list(spec = "col_integer") - ), - patients = list( - subject_id = list(spec = "col_integer"), - gender = list(spec = "col_character"), - anchor_age = list(spec = "col_integer"), - anchor_year = list(spec = "col_integer"), - anchor_year_group = list(spec = "col_character"), - dod = list(spec = "col_datetime", format = "%Y-%m-%d") - ), - transfers = list( - subject_id = list(spec = "col_integer"), - hadm_id = list(spec = "col_integer"), - transfer_id = list(spec = "col_integer"), - eventtype = list(spec = "col_character"), - careunit = list(spec = "col_character"), - intime = list(spec = "col_datetime", format = "%Y-%m-%d %H:%M:%S"), - outtime = list(spec = "col_datetime", format = "%Y-%m-%d %H:%M:%S") - ), - d_hcpcs = list( - code = list(spec = "col_character"), - category = list(spec = "col_integer"), - long_description = list(spec = "col_character"), - short_description = list(spec = "col_character") - ), - diagnoses_icd = list( - subject_id = list(spec = "col_integer"), - hadm_id = list(spec = "col_integer"), - seq_num = list(spec = "col_integer"), - icd_code = list(spec = "col_character"), - icd_version = list(spec = "col_integer") - ), - d_icd_diagnoses = list( - icd_code = list(spec = "col_character"), - icd_version = list(spec = "col_integer"), - long_title = list(spec = "col_character") - ), - d_icd_procedures = list( - icd_code = list(spec = "col_character"), - icd_version = list(spec = "col_integer"), - long_title = list(spec = "col_character") - ), - d_labitems = list( - itemid = list(spec = "col_integer"), - label = list(spec = "col_character"), - fluid = list(spec = "col_character"), - category = list(spec = "col_character"), - loinc_code = list(spec = "col_character") - ), - drgcodes = list( - subject_id = list(spec = "col_integer"), - hadm_id = list(spec = "col_integer"), - drg_type = list(spec = "col_character"), - drg_code = list(spec = "col_character"), - description = list(spec = "col_character"), - drg_severity = list(spec = "col_integer"), - drg_mortality = list(spec = "col_integer") - ), - emar_detail = list( - subject_id = list(spec = "col_integer"), - emar_id = list(spec = "col_character"), - emar_seq = list(spec = "col_integer"), - parent_field_ordinal = list(spec = "col_double"), - administration_type = list(spec = "col_character"), - pharmacy_id = list(spec = "col_integer"), - barcode_type = list(spec = "col_character"), - reason_for_no_barcode = list(spec = "col_character"), - complete_dose_not_given = list(spec = "col_character"), - dose_due = list(spec = "col_character"), - dose_due_unit = list(spec = "col_character"), - dose_given = list(spec = "col_character"), - dose_given_unit = list(spec = "col_character"), - will_remainder_of_dose_be_given = list(spec = "col_character"), - product_amount_given = list(spec = "col_character"), - product_unit = list(spec = "col_character"), - product_code = list(spec = "col_character"), - product_description = list(spec = "col_character"), - product_description_other = list(spec = "col_character"), - prior_infusion_rate = list(spec = "col_character"), - infusion_rate = list(spec = "col_character"), - infusion_rate_adjustment = list(spec = "col_character"), - infusion_rate_adjustment_amount = list(spec = "col_character"), - infusion_rate_unit = list(spec = "col_character"), - route = list(spec = "col_character"), - infusion_complete = list(spec = "col_character"), - completion_interval = list(spec = "col_character"), - new_iv_bag_hung = list(spec = "col_character"), - continued_infusion_in_other_location = list(spec = "col_character"), - restart_interval = list(spec = "col_character"), - side = list(spec = "col_character"), - site = list(spec = "col_character"), - non_formulary_visual_verification = list(spec = "col_character") - ), - emar = list( - subject_id = list(spec = "col_integer"), - hadm_id = list(spec = "col_integer"), - emar_id = list(spec = "col_character"), - emar_seq = list(spec = "col_integer"), - poe_id = list(spec = "col_character"), - pharmacy_id = list(spec = "col_integer"), - charttime = list(spec = "col_datetime", format = "%Y-%m-%d %H:%M:%S"), - medication = list(spec = "col_character"), - event_txt = list(spec = "col_character"), - scheduletime = list(spec = "col_datetime", format = "%Y-%m-%d %H:%M:%S"), - storetime = list(spec = "col_datetime", format = "%Y-%m-%d %H:%M:%S") - ), - hcpcsevents = list( - subject_id = list(spec = "col_integer"), - hadm_id = list(spec = "col_integer"), - chartdate = list(spec = "col_datetime", format = "%Y-%m-%d"), - hcpcs_cd = list(spec = "col_character"), - seq_num = list(spec = "col_integer"), - short_description = list(spec = "col_character") - ), - labevents = list( - labevent_id = list(spec = "col_integer"), - subject_id = list(spec = "col_integer"), - hadm_id = list(spec = "col_integer"), - specimen_id = list(spec = "col_integer"), - itemid = list(spec = "col_integer"), - charttime = list(spec = "col_datetime", format = "%Y-%m-%d %H:%M:%S"), - storetime = list(spec = "col_datetime", format = "%Y-%m-%d %H:%M:%S"), - value = list(spec = "col_character"), - valuenum = list(spec = "col_double"), - valueuom = list(spec = "col_character"), - ref_range_lower = list(spec = "col_double"), - ref_range_upper = list(spec = "col_double"), - flag = list(spec = "col_character"), - priority = list(spec = "col_character"), - comments = list(spec = "col_character") - ), - microbiologyevents = list( - microevent_id = list(spec = "col_integer"), - subject_id = list(spec = "col_integer"), - hadm_id = list(spec = "col_integer"), - micro_specimen_id = list(spec = "col_integer"), - chartdate = list(spec = "col_datetime", format = "%Y-%m-%d %H:%M:%S"), - charttime = list(spec = "col_datetime", format = "%Y-%m-%d %H:%M:%S"), - spec_itemid = list(spec = "col_integer"), - spec_type_desc = list(spec = "col_character"), - test_seq = list(spec = "col_integer"), - storedate = list(spec = "col_datetime", format = "%Y-%m-%d %H:%M:%S"), - storetime = list(spec = "col_datetime", format = "%Y-%m-%d %H:%M:%S"), - test_itemid = list(spec = "col_integer"), - test_name = list(spec = "col_character"), - org_itemid = list(spec = "col_integer"), - org_name = list(spec = "col_character"), - isolate_num = list(spec = "col_integer"), - quantity = list(spec = "col_character"), - ab_itemid = list(spec = "col_integer"), - ab_name = list(spec = "col_character"), - dilution_text = list(spec = "col_character"), - dilution_comparison = list(spec = "col_character"), - dilution_value = list(spec = "col_double"), - interpretation = list(spec = "col_character"), - comments = list(spec = "col_character") - ), - pharmacy = list( - subject_id = list(spec = "col_integer"), - hadm_id = list(spec = "col_integer"), - pharmacy_id = list(spec = "col_integer"), - poe_id = list(spec = "col_character"), - starttime = list(spec = "col_datetime", format = "%Y-%m-%d %H:%M:%S"), - stoptime = list(spec = "col_datetime", format = "%Y-%m-%d %H:%M:%S"), - medication = list(spec = "col_character"), - proc_type = list(spec = "col_character"), - status = list(spec = "col_character"), - entertime = list(spec = "col_datetime", format = "%Y-%m-%d %H:%M:%S"), - verifiedtime = list(spec = "col_datetime", format = "%Y-%m-%d %H:%M:%S"), - route = list(spec = "col_character"), - frequency = list(spec = "col_character"), - disp_sched = list(spec = "col_character"), - infusion_type = list(spec = "col_character"), - sliding_scale = list(spec = "col_character"), - lockout_interval = list(spec = "col_character"), - basal_rate = list(spec = "col_double"), - one_hr_max = list(spec = "col_character"), - doses_per_24_hrs = list(spec = "col_double"), - duration = list(spec = "col_double"), - duration_interval = list(spec = "col_character"), - expiration_value = list(spec = "col_integer"), - expiration_unit = list(spec = "col_character"), - expirationdate = list(spec = "col_datetime", - format = "%Y-%m-%d %H:%M:%S"), - dispensation = list(spec = "col_character"), - fill_quantity = list(spec = "col_character") - ), - poe_detail = list( - poe_id = list(spec = "col_character"), - poe_seq = list(spec = "col_integer"), - subject_id = list(spec = "col_integer"), - field_name = list(spec = "col_character"), - field_value = list(spec = "col_character") - ), - poe = list( - poe_id = list(spec = "col_character"), - poe_seq = list(spec = "col_integer"), - subject_id = list(spec = "col_integer"), - hadm_id = list(spec = "col_integer"), - ordertime = list(spec = "col_datetime", format = "%Y-%m-%d %H:%M:%S"), - order_type = list(spec = "col_character"), - order_subtype = list(spec = "col_character"), - transaction_type = list(spec = "col_character"), - discontinue_of_poe_id = list(spec = "col_character"), - discontinued_by_poe_id = list(spec = "col_character"), - order_status = list(spec = "col_character") - ), - prescriptions = list( - subject_id = list(spec = "col_integer"), - hadm_id = list(spec = "col_integer"), - pharmacy_id = list(spec = "col_integer"), - starttime = list(spec = "col_datetime", format = "%Y-%m-%d %H:%M:%S"), - stoptime = list(spec = "col_datetime", format = "%Y-%m-%d %H:%M:%S"), - drug_type = list(spec = "col_character"), - drug = list(spec = "col_character"), - gsn = list(spec = "col_character"), - ndc = list(spec = "col_character"), - prod_strength = list(spec = "col_character"), - form_rx = list(spec = "col_character"), - dose_val_rx = list(spec = "col_character"), - dose_unit_rx = list(spec = "col_character"), - form_val_disp = list(spec = "col_character"), - form_unit_disp = list(spec = "col_character"), - doses_per_24_hrs = list(spec = "col_double"), - route = list(spec = "col_character") - ), - procedures_icd = list( - subject_id = list(spec = "col_integer"), - hadm_id = list(spec = "col_integer"), - seq_num = list(spec = "col_integer"), - chartdate = list(spec = "col_datetime", format = "%Y-%m-%d"), - icd_code = list(spec = "col_character"), - icd_version = list(spec = "col_integer") - ), - services = list( - subject_id = list(spec = "col_integer"), - hadm_id = list(spec = "col_integer"), - transfertime = list(spec = "col_datetime", format = "%Y-%m-%d %H:%M:%S"), - prev_service = list(spec = "col_character"), - curr_service = list(spec = "col_character") - ), - chartevents = list( - subject_id = list(spec = "col_integer"), - hadm_id = list(spec = "col_integer"), - stay_id = list(spec = "col_integer"), - charttime = list(spec = "col_datetime", format = "%Y-%m-%d %H:%M:%S"), - storetime = list(spec = "col_datetime", format = "%Y-%m-%d %H:%M:%S"), - itemid = list(spec = "col_integer"), - value = list(spec = "col_character"), - valuenum = list(spec = "col_double"), - valueuom = list(spec = "col_character"), - warning = list(spec = "col_integer") - ), - datetimeevents = list( - subject_id = list(spec = "col_integer"), - hadm_id = list(spec = "col_integer"), - stay_id = list(spec = "col_integer"), - charttime = list(spec = "col_datetime", format = "%Y-%m-%d %H:%M:%S"), - storetime = list(spec = "col_datetime", format = "%Y-%m-%d %H:%M:%S"), - itemid = list(spec = "col_integer"), - value = list(spec = "col_datetime", format = "%Y-%m-%d %H:%M:%S"), - valueuom = list(spec = "col_character"), - warning = list(spec = "col_integer") - ), - d_items = list( - itemid = list(spec = "col_integer"), - label = list(spec = "col_character"), - abbreviation = list(spec = "col_character"), - linksto = list(spec = "col_character"), - category = list(spec = "col_character"), - unitname = list(spec = "col_character"), - param_type = list(spec = "col_character"), - lownormalvalue = list(spec = "col_double"), - highnormalvalue = list(spec = "col_double") - ), - icustays = list( - subject_id = list(spec = "col_integer"), - hadm_id = list(spec = "col_integer"), - stay_id = list(spec = "col_integer"), - first_careunit = list(spec = "col_character"), - last_careunit = list(spec = "col_character"), - intime = list(spec = "col_datetime", format = "%Y-%m-%d %H:%M:%S"), - outtime = list(spec = "col_datetime", format = "%Y-%m-%d %H:%M:%S"), - los = list(spec = "col_double") - ), - inputevents = list( - subject_id = list(spec = "col_integer"), - hadm_id = list(spec = "col_integer"), - stay_id = list(spec = "col_integer"), - starttime = list(spec = "col_datetime", format = "%Y-%m-%d %H:%M:%S"), - endtime = list(spec = "col_datetime", format = "%Y-%m-%d %H:%M:%S"), - storetime = list(spec = "col_datetime", format = "%Y-%m-%d %H:%M:%S"), - itemid = list(spec = "col_integer"), - amount = list(spec = "col_double"), - amountuom = list(spec = "col_character"), - rate = list(spec = "col_double"), - rateuom = list(spec = "col_character"), - orderid = list(spec = "col_integer"), - linkorderid = list(spec = "col_integer"), - ordercategoryname = list(spec = "col_character"), - secondaryordercategoryname = list(spec = "col_character"), - ordercomponenttypedescription = list(spec = "col_character"), - ordercategorydescription = list(spec = "col_character"), - patientweight = list(spec = "col_double"), - totalamount = list(spec = "col_double"), - totalamountuom = list(spec = "col_character"), - isopenbag = list(spec = "col_integer"), - continueinnextdept = list(spec = "col_integer"), - cancelreason = list(spec = "col_integer"), - statusdescription = list(spec = "col_character"), - originalamount = list(spec = "col_double"), - originalrate = list(spec = "col_double") - ), - outputevents = list( - subject_id = list(spec = "col_integer"), - hadm_id = list(spec = "col_integer"), - stay_id = list(spec = "col_integer"), - charttime = list(spec = "col_datetime", format = "%Y-%m-%d %H:%M:%S"), - storetime = list(spec = "col_datetime", format = "%Y-%m-%d %H:%M:%S"), - itemid = list(spec = "col_integer"), - value = list(spec = "col_double"), - valueuom = list(spec = "col_character") - ), - procedureevents = list( - subject_id = list(spec = "col_integer"), - hadm_id = list(spec = "col_integer"), - stay_id = list(spec = "col_integer"), - starttime = list(spec = "col_datetime", format = "%Y-%m-%d %H:%M:%S"), - endtime = list(spec = "col_datetime", format = "%Y-%m-%d %H:%M:%S"), - storetime = list(spec = "col_datetime", format = "%Y-%m-%d %H:%M:%S"), - itemid = list(spec = "col_integer"), - value = list(spec = "col_double"), - valueuom = list(spec = "col_character"), - location = list(spec = "col_character"), - locationcategory = list(spec = "col_character"), - orderid = list(spec = "col_integer"), - linkorderid = list(spec = "col_integer"), - ordercategoryname = list(spec = "col_character"), - secondaryordercategoryname = list(spec = "col_character"), - ordercategorydescription = list(spec = "col_character"), - patientweight = list(spec = "col_double"), - totalamount = list(spec = "col_double"), - totalamountuom = list(spec = "col_character"), - isopenbag = list(spec = "col_integer"), - continueinnextdept = list(spec = "col_integer"), - cancelreason = list(spec = "col_integer"), - statusdescription = list(spec = "col_character"), - comments_date = list(spec = "col_datetime", - format = "%Y-%m-%d %H:%M:%S"), - originalamount = list(spec = "col_double"), - originalrate = list(spec = "col_double") - ), - omr = list( - subject_id = list(spec = "col_integer"), - chartdate = list(spec = "col_datetime", format = "%Y-%m-%d"), - seq_num = list(spec = "col_integer"), - result_name = list(spec = "col_character"), - result_value = list(spec = "col_character") - ), - caregiver = list( - caregiver_id = list(spec = "col_integer") - ), - provider = list( - provider_id = list(spec = "col_character") - ), - ingredientevents = list( - subject_id = list(spec = "col_integer"), - hadm_id = list(spec = "col_integer"), - stay_id = list(spec = "col_integer"), - starttime = list(spec = "col_datetime", format = "%Y-%m-%d %H:%M:%S"), - endtime = list(spec = "col_datetime", format = "%Y-%m-%d %H:%M:%S"), - storetime = list(spec = "col_datetime", format = "%Y-%m-%d %H:%M:%S"), - itemid = list(spec = "col_integer"), - amount = list(spec = "col_double"), - amountuom = list(spec = "col_character"), - rate = list(spec = "col_double"), - rateuom = list(spec = "col_character"), - orderid = list(spec = "col_integer"), - linkorderid = list(spec = "col_integer"), - statusdescription = list(spec = "col_character"), - originalamount = list(spec = "col_double"), - originalrate = list(spec = "col_double") - ) - ) - - tables <- names(info) - - cols <- lapply(info, function(tbl) { - Map(function(name, spec) c(list(name = name), spec), names(tbl), tbl) - }) - - defaults <- list( - admissions = list( - val_var = "admission_type" - ), - d_hcpcs = list( - id_var = "code", - val_var = "short_description" - ), - d_icd_diagnoses = list( - id_var = "icd_code", - val_var = "long_title" - ), - d_icd_procedures = list( - id_var = "icd_code", - val_var = "long_title" - ), - d_labitems = list( - id_var = "itemid", - val_var = "label" - ), - diagnoses_icd = list( - val_var = "icd_code" - ), - drgcodes = list( - val_var = "drg_code" - ), - emar_detail = list( - id_var = "emar_id" - ), - emar = list( - index_var = "charttime" - ), - hcpcsevents = list( - index_var = "chartdate" - ), - labevents = list( - index_var = "charttime", - val_var = "valuenum", - unit_var = "valueuom" - ), - microbiologyevents = list( - index_var = "chartdate", - val_var = "isolate_num" - ), - pharmacy = list( - id_var = "pharmacy_id", - index_var = "starttime", - val_var = "duration", - unit_var = "duration_interval" - ), - poe_detail = list( - id_var = "poe_id" - ), - poe = list( - index_var = "ordertime" - ), - prescriptions = list( - index_var = "starttime", - val_var = "dose_val_rx", - unit_var = "dose_unit_rx" - ), - procedures_icd = list( - index_var = "chartdate", - val_var = "icd_code" - ), - services = list( - index_var = "transfertime", - val_var = "curr_service" - ), - chartevents = list( - index_var = "charttime", - val_var = "valuenum", - unit_var = "valueuom" - ), - d_items = list( - id_var = "itemid", - val_var = "label" - ), - datetimeevents = list( - index_var = "charttime", - val_var = "itemid" - ), - icustays = list( - index_var = "intime", - val_var = "last_careunit" - ), - inputevents = list( - index_var = "starttime", - val_var = "rate", - unit_var = "rateuom" - ), - outputevents = list( - index_var = "charttime", - val_var = "value", - unit_var = "valueuom" - ), - procedureevents = list( - index_var = "starttime", - val_var = "value", - unit_var = "valueuom" - ), - omr = list( - index_var = "chartdate", - val_var = "result_value" - ), - caregiver = list(), - provider = list(), - ingredientevents = list( - index_var = "starttime", - val_var = "rate", - unit_var = "rateuom" - ) - ) - - defaults <- Map(function(cl, df) { - nme <- vapply(cl, `[[`, character(1L), "name") - typ <- vapply(cl, `[[`, character(1L), "spec") - tim <- nme[typ == "col_datetime"] - if (length(tim)) c(df, list(time_vars = tim)) else df - }, cols[tables], defaults[tables]) - - n_row <- c( - admissions = 431231L, - patients = 299712L, - transfers = 1890972L, - d_hcpcs = 89200L, - d_icd_diagnoses = 109775L, - d_icd_procedures = 85257L, - d_labitems = 1622L, - diagnoses_icd = 4756326L, - drgcodes = 604377L, - emar_detail = 54744789L, - emar = 26850359L, - hcpcsevents = 150771L, - labevents = 118171367L, - microbiologyevents = 3228713L, - pharmacy = 13584514L, - poe_detail = 3879418L, - poe = 39366291L, - prescriptions = 15416708L, - procedures_icd = 669186L, - services = 468029L, - chartevents = 313645063L, - d_items = 4014L, - datetimeevents = 7112999L, - icustays = 73181L, - inputevents = 8978893L, - outputevents = 4234967L, - procedureevents = 696092L, - omr = 6439169L, - caregiver = 15468L, - provider = 40508L, - ingredientevents = 11627821L - ) - - files <- c( - admissions = "hosp/admissions.csv.gz", - patients = "hosp/patients.csv.gz", - transfers = "hosp/transfers.csv.gz", - d_hcpcs = "hosp/d_hcpcs.csv.gz", - d_icd_diagnoses = "hosp/d_icd_diagnoses.csv.gz", - d_icd_procedures = "hosp/d_icd_procedures.csv.gz", - d_labitems = "hosp/d_labitems.csv.gz", - diagnoses_icd = "hosp/diagnoses_icd.csv.gz", - drgcodes = "hosp/drgcodes.csv.gz", - emar_detail = "hosp/emar_detail.csv.gz", - emar = "hosp/emar.csv.gz", - hcpcsevents = "hosp/hcpcsevents.csv.gz", - labevents = "hosp/labevents.csv.gz", - microbiologyevents = "hosp/microbiologyevents.csv.gz", - pharmacy = "hosp/pharmacy.csv.gz", - poe_detail = "hosp/poe_detail.csv.gz", - poe = "hosp/poe.csv.gz", - prescriptions = "hosp/prescriptions.csv.gz", - procedures_icd = "hosp/procedures_icd.csv.gz", - services = "hosp/services.csv.gz", - chartevents = "icu/chartevents.csv.gz", - d_items = "icu/d_items.csv.gz", - datetimeevents = "icu/datetimeevents.csv.gz", - icustays = "icu/icustays.csv.gz", - inputevents = "icu/inputevents.csv.gz", - outputevents = "icu/outputevents.csv.gz", - procedureevents = "icu/procedureevents.csv.gz", - omr = "hosp/omr.csv.gz", - caregiver = "hosp/caregiver.csv.gz", - provider = "hosp/provider.csv.gz", - ingredientevents = "icu/ingredientevents.csv.gz" - ) - - part <- list( - labevents = list( - col = "itemid", - breaks = c( - 50868L, 50902L, 50943L, 50983L, 51146L, 51248L, 51256L, 51279L, - 51491L - ) - ), - chartevents = list( - col = "itemid", - breaks = c( - 220048L, 220059L, 220181L, 220228L, 220615L, 223782L, 223835L, - 223905L, 223962L, 223990L, 224015L, 224055L, 224082L, 224093L, - 224328L, 224650L, 224701L, 224850L, 225072L, 226104L, 227240L, - 227467L, 227950L, 227960L, 228004L, 228397L, 228594L, 228924L, - 229124L - ) - ), - poe = list( - col = "subject_id", - breaks = c(12017899L, 13999829L, 15979442L, 17994364L) - ) - ) - - tables <- Map(list, files = files[tables], - defaults = defaults[tables], num_rows = n_row[tables], - cols = cols[tables]) - - tables[names(part)] <- Map(`[[<-`, tables[names(part)], "partitioning", part) - - tables -} - -sic_tbl_cfg <- function() { - - info <- list( - cases = list( - caseid = list(name = "CaseID", spec = "col_integer"), - patientid = list(name = "PatientID", spec = "col_integer"), - admissionyear = list(name = "AdmissionYear", spec = "col_integer"), - timeofstay = list(name = "TimeOfStay", spec = "col_integer"), - icuoffset = list(name = "ICUOffset", spec = "col_integer"), - saps3 = list(name = "saps3", spec = "col_double"), - hospitaldischargetype = list(name = "HospitalDischargeType", - spec = "col_integer"), - dischargestate = list(name = "DischargeState", - spec = "col_integer"), - dischargeunit = list(name = "DischargeUnit", - spec = "col_integer"), - offsetofdeath = list(name = "OffsetOfDeath", - spec = "col_integer"), - estimatedsurvivalobservationtime = list(name = "EstimatedSurvivalObservationTime", - spec = "col_integer"), - sex = list(name = "Sex", spec = "col_integer"), - weightonadmission = list(name = "WeightOnAdmission", spec = "col_double"), - heightonadmission = list(name = "HeightOnAdmission", spec = "col_double"), - ageonadmission = list(name = "AgeOnAdmission", spec = "col_integer"), - hospitalunit = list(name = "HospitalUnit", spec = "col_integer"), - referringunit = list(name = "ReferringUnit", spec = "col_integer"), - icd10main = list(name = "ICD10Main", spec = "col_character"), - icd10maintext = list(name = "ICD10MainText", spec = "col_character"), - diagnosist2 = list(name = "DiagnosisT2", spec = "col_character"), - surgicalsite = list(name = "SurgicalSite", spec = "col_integer"), - hoursofcrrt = list(name = "HoursOfCRRT", spec = "col_integer"), - admissionformhassepsis = list(name = "AdmissionFormHasSepsis", spec = "col_integer"), - orbisdataavailable = list(name = "OrbisDataAvailable", spec = "col_character"), - heartsurgeryadditionaldata = list(name = "HeartSurgeryAdditionalData", - spec = "col_integer"), - heartsurgerycrossclamptime = list(name = "HeartSurgeryCrossClampTime", - spec = "col_integer"), - heartsurgerybeginoffset = list(name = "HeartSurgeryBeginOffset", - spec = "col_integer"), - heartsurgeryendoffset = list(name = "HeartSurgeryEndOffset", - spec = "col_integer"), - offsetafterfirstadmission = list(name = "OffsetAfterFirstAdmission", - spec = "col_integer") - ), - d_references = list( - referenceglobalid = list(name = "ReferenceGlobalID", - spec = "col_integer"), - referencevalue = list(name = "ReferenceValue", - spec = "col_character"), - referencename = list(name = "ReferenceName", - spec = "col_character"), - referencedescription = list(name = "ReferenceDescription", spec = "col_character"), - referenceunit = list(name = "ReferenceUnit", spec = "col_character"), - referenceorder = list(name = "ReferenceOrder", spec = "col_integer"), - referencetype = list(name = "ReferenceType", spec = "col_integer"), - data = list(name = "Data", spec = "col_character") - ), - data_float_h = list( - id = list(name = "id", spec = "col_integer"), - caseid = list(name = "CaseID", - spec = "col_integer"), - dataid = list(name = "DataID", - spec = "col_integer"), - offset = list(name = "Offset", - spec = "col_integer"), - val = list(name = "Val", spec = "col_double"), - cnt = list(name = "cnt", spec = "col_integer"), - rawdata = list(name = "rawdata", spec = "col_double") - ), - data_ref = list( - id = list(name = "id", spec = "col_integer"), - caseid = list(name = "CaseID", spec = "col_integer"), - refid = list(name = "RefID", spec = "col_integer"), - customfieldid = list(name = "CustomFieldID", spec = "col_integer") - ), - laboratory = list( - id = list(name = "id", spec = "col_integer"), - caseid = list(name = "CaseID", spec = "col_integer"), - laboratoryid = list(name = "LaboratoryID", spec = "col_integer"), - offset = list(name = "Offset", spec = "col_integer"), - laboratoryvalue = list(name = "LaboratoryValue", spec = "col_double"), - laboratorytype = list(name = "LaboratoryType", spec = "col_integer") - ), - medication = list( - id = list(name = "id", spec = "col_integer"), - caseid = list(name = "CaseID", - spec = "col_integer"), - patientid = list(name = "PatientID", - spec = "col_integer"), - drugid = list(name = "DrugID", - spec = "col_integer"), - offset = list(name = "Offset", - spec = "col_integer"), - offsetdrugend = list(name = "OffsetDrugEnd", - spec = "col_integer"), - issingledose = list(name = "IsSingleDose", - spec = "col_logical"), - amount = list(name = "Amount", - spec = "col_double"), - amountperminute = list(name = "AmountPerMinute", - spec = "col_double"), - givenstate = list(name = "GivenState", - spec = "col_integer") - ), - data_range = list( - id = list(name = "id", - spec = "col_integer"), - caseid = list(name = "CaseID", - spec = "col_integer"), - dataid = list(name = "DataID", - spec = "col_integer"), - offset = list(name = "Offset", - spec = "col_integer"), - offsetend = list(name = "OffsetEnd", - spec = "col_integer"), - data = list(name = "Data", - spec = "col_character") - ), - unitlog = list( - id = list(name = "id", - spec = "col_integer"), - caseid = list(name = "CaseID", - spec = "col_integer"), - patientid = list(name = "PatientID", - spec = "col_integer"), - logstate = list(name = "LogState", - spec = "col_integer"), - offset = list(name = "Offset", - spec = "col_integer"), - hospitalunit = list(name = "HospitalUnit", - spec = "col_integer") - ) - ) - - tables <- names(info) - cols <- info - - defaults <- list( - cases = list( - index_var = "ICUOffset" - ), - d_references = list(), - data_float_h = list( - index_var = "Offset", - val_var = "Val" - ), - data_ref = list( - index_var = "OffsetAfterFirstAdmission" - ), - laboratory = list( - index_var = "Offset", - val_var = "LaboratoryValue" - ), - medication = list( - index_var = "Offset", - val_var = "Amount" - ), - data_range = list( - index_var = "Offset" - ), - unitlog = list( - index_var = "Offset" - ) - ) - - defaults <- Map(function(cl, df) { - nme <- vapply(cl, `[[`, character(1L), "name") - typ <- vapply(cl, `[[`, character(1L), "spec") - tim <- nme[grep("offset", names(nme), ignore.case = TRUE)] - if (length(tim)) c(df, list(time_vars = tim)) else df - }, cols[tables], defaults[tables]) - - n_row <- c( - cases = 27386L, - d_references = 1608L, - data_float_h = 36785241L, - data_range = 183339L, - data_ref = 354157L, - laboratory = 17572279L, - medication = 5141346L, - unitlog = 139968L - ) - - files <- c( - cases = "cases.csv.gz", - d_references = "d_references.csv.gz", - data_float_h = "data_float_h.csv.gz", - data_range = "data_range.csv.gz", - data_ref = "data_ref.csv.gz", - laboratory = "laboratory.csv.gz", - medication = "medication.csv.gz", - unitlog = "unitlog.csv.gz" - ) - - part <- list( - data_float_h = list( - col = "dataid", - breaks = c( - 1L, 2L, 3L, 4L, 7L, 28L, 29L, 702L, 703L, 705L, 708L, 709L, 710L, 715L, - 717L, 719L, 724L, 725L, 731L, 773L, 2018L, 2274L, 2278L, 2280L, 2283L, - 2290L, 3056L, 3059L, 3071L - ) - ) - ) - - tables <- Map(list, files = files[tables], - defaults = defaults[tables], num_rows = n_row[tables], - cols = cols[tables]) - - tables[names(part)] <- Map(`[[<-`, tables[names(part)], "partitioning", part) - - tables -} - -pkg_dir <- rprojroot::find_root(rprojroot::is_r_package) -cfg_dir <- file.path(pkg_dir, "inst", "extdata", "config") - -eicu_id_cfg <- list( - hadm = list(id = "patienthealthsystemstayid", position = 1L, - start = "hospitaladmitoffset", - end = "hospitaldischargeoffset", table = "patient"), - icustay = list(id = "patientunitstayid", position = 2L, - start = "unitadmitoffset", end = "unitdischargeoffset", - table = "patient") -) - -mimic_id_cfg <- list( - patient = list(id = "subject_id", position = 1L, start = "dob", - end = "dod", table = "patients"), - hadm = list(id = "hadm_id", position = 2L, start = "admittime", - end = "dischtime", table = "admissions"), - icustay = list(id = "icustay_id", position = 3L, start = "intime", - end = "outtime", table = "icustays") -) - -eicu <- get_table_info( - "https://mit-lcp.github.io/eicu-schema-spy/eicu.eicu_crd.xml" -) - -mimic <- get_table_info( - "https://mit-lcp.github.io/mimic-schema-spy/mimic.mimiciii.xml" -) - -eicu_demo_tbls <- eicu_tbl_cfg(eicu, is_demo = TRUE) -mimic_demo_tbls <- mimic_tbl_cfg(mimic, is_demo = TRUE) - -cfg <- list( - list( - name = "eicu", - url = "https://physionet.org/files/eicu-crd/2.0", - id_cfg = eicu_id_cfg, - tables = eicu_tbl_cfg(eicu, is_demo = FALSE) - ), - list( - name = "eicu_demo", - class_prefix = c("eicu_demo", "eicu"), - url = "https://physionet.org/files/eicu-crd-demo/2.0.1", - id_cfg = eicu_id_cfg, - tables = eicu_demo_tbls - ), - list( - name = "mimic", - url = "https://physionet.org/files/mimiciii/1.4", - id_cfg = mimic_id_cfg, - tables = mimic_tbl_cfg(mimic, is_demo = FALSE) - ), - list( - name = "mimic_demo", - class_prefix = c("mimic_demo", "mimic"), - url = "https://physionet.org/files/mimiciii-demo/1.4", - id_cfg = mimic_id_cfg, - tables = mimic_demo_tbls - ), - list( - name = "miiv", - url = "https://physionet.org/files/mimiciv/2.2", - id_cfg = list( - patient = list(id = "subject_id", position = 1L, start = "anchor_year", - end = "dod", table = "patients"), - hadm = list(id = "hadm_id", position = 2L, start = "admittime", - end = "dischtime", table = "admissions"), - icustay = list(id = "stay_id", position = 3L, start = "intime", - end = "outtime", table = "icustays") - ), - tables = miiv_tbl_cfg() - ), - list( - name = "hirid", - url = "https://physionet.org/files/hirid/1.1.1", - id_cfg = list( - icustay = list(id = "patientid", position = 1L, start = "admissiontime", - table = "general") - ), - tables = hirid_tbl_cfg() - ), - list( - name = "aumc", - id_cfg = list( - patient = list(id = "patientid", position = 1L, - start = "firstadmittedat", end = "dateofdeath", - table = "admissions"), - icustay = list(id = "admissionid", position = 2L, start = "admittedat", - end = "dischargedat", table = "admissions") - ), - unit_mapping = list( - list(symbol = "uur", def = "1 hour"), - list(symbol = "dag", def = "1 day") - ), - tables = aumc_tbl_cfg() - ), - list( - name = "sic", - url = "https://physionet.org/files/sicdb/1.0.6", - id_cfg = list( - patient = list(id = "PatientID", position = 1L, - start = "ICUOffset", end = "OffsetOfDeath", - table = "cases"), - icustay = list(id = "CaseID", position = 2L, start = "ICUOffset", - end = "TimeOfStay", - table = "cases") - ), - tables = sic_tbl_cfg() - ) -) - -ricu::set_config(cfg, "data-sources", cfg_dir) - -cfg <- list( - list( - name = "eicu_test", - class_prefix = c("eicu_test", "eicu_demo", "eicu"), - id_cfg = eicu_id_cfg, - tables = lapply(eicu_demo_tbls, as_minimal_tbl_spec) - ), - list( - name = "mimic_test", - class_prefix = c("mimic_test", "mimic_demo", "mimic"), - id_cfg = mimic_id_cfg, - tables = lapply(mimic_demo_tbls, as_minimal_tbl_spec) - ) -) - -ricu::set_config(cfg, "data-sources", file.path(pkg_dir, "inst", "testdata")) - -devtools::install(pkg_dir) diff --git a/inst/extdata/config/data-sources/picdb.json b/inst/extdata/config/data-sources/picdb.json new file mode 100644 index 00000000..adce0b71 --- /dev/null +++ b/inst/extdata/config/data-sources/picdb.json @@ -0,0 +1,847 @@ +[ + { + "name": "picdb", + "url": "https://physionet.org/files/picdb/1.1.0", + "id_cfg": { + "patient": { + "id": "subject_id", + "position": 1, + "start": "dob", + "end": "dod", + "table": "patients" + }, + "hadm": { + "id": "hadm_id", + "position": 2, + "start": "admittime", + "end": "dischtime", + "table": "admissions" + }, + "icustay": { + "id": "icustay_id", + "position": 3, + "start": "intime", + "end": "outtime", + "table": "icustays" + } + }, + "tables": { + "admissions": { + "files": "V1.1.0/ADMISSIONS.csv", + "defaults": { + "time_vars": [ + "admittime", + "dischtime", + "deathtime", + "edregtime", + "edouttime" + ] + }, + "num_rows": 13449, + "cols": { + "row_id": { + "name": "ROW_ID", + "spec": "col_integer" + }, + "subject_id": { + "name": "SUBJECT_ID", + "spec": "col_integer" + }, + "hadm_id": { + "name": "HADM_ID", + "spec": "col_integer" + }, + "admittime": { + "name": "ADMITTIME", + "spec": "col_datetime", + "format": "%Y-%m-%d %H:%M:%S" + }, + "dischtime": { + "name": "DISCHTIME", + "spec": "col_datetime", + "format": "%Y-%m-%d %H:%M:%S" + }, + "deathtime": { + "name": "DEATHTIME", + "spec": "col_datetime", + "format": "%Y-%m-%d %H:%M:%S" + }, + "admission_department": { + "name": "ADMISSION_DEPARTMENT", + "spec": "col_character" + }, + "discharge_department": { + "name": "DISCHARGE_DEPARTMENT", + "spec": "col_character" + }, + "insurance": { + "name": "INSURANCE", + "spec": "col_character" + }, + "language": { + "name": "LANGUAGE", + "spec": "col_character" + }, + "religion": { + "name": "RELIGION", + "spec": "col_character" + }, + "marital_status": { + "name": "MARITAL_STATUS", + "spec": "col_character" + }, + "ethnicity": { + "name": "ETHNICITY", + "spec": "col_character" + }, + "edregtime": { + "name": "EDREGTIME", + "spec": "col_datetime", + "format": "%Y-%m-%d %H:%M:%S" + }, + "edouttime": { + "name": "EDOUTTIME", + "spec": "col_datetime", + "format": "%Y-%m-%d %H:%M:%S" + }, + "diagnosis": { + "name": "DIAGNOSIS", + "spec": "col_character" + }, + "icd10_code_cn": { + "name": "ICD10_CODE_CN", + "spec": "col_character" + }, + "hospital_expire_flag": { + "name": "HOSPITAL_EXPIRE_FLAG", + "spec": "col_integer" + }, + "has_chartevents_data": { + "name": "HAS_CHARTEVENTS_DATA", + "spec": "col_integer" + } + } + }, + "chartevents": { + "files": "V1.1.0/CHARTEVENTS.csv", + "defaults": { + "time_vars": [ + "charttime", + "storetime" + ], + "index_var": "charttime", + "val_var": "valuenum", + "unit_var": "valueuom" + }, + "num_rows": 2278978, + "cols": { + "row_id": { + "name": "ROW_ID", + "spec": "col_integer" + }, + "subject_id": { + "name": "SUBJECT_ID", + "spec": "col_integer" + }, + "hadm_id": { + "name": "HADM_ID", + "spec": "col_integer" + }, + "icustay_id": { + "name": "ICUSTAY_ID", + "spec": "col_double" + }, + "itemid": { + "name": "ITEMID", + "spec": "col_integer" + }, + "charttime": { + "name": "CHARTTIME", + "spec": "col_datetime", + "format": "%Y-%m-%d %H:%M:%S" + }, + "storetime": { + "name": "STORETIME", + "spec": "col_datetime", + "format": "%Y-%m-%d %H:%M:%S" + }, + "value": { + "name": "VALUE", + "spec": "col_double" + }, + "valuenum": { + "name": "VALUENUM", + "spec": "col_double" + }, + "valueuom": { + "name": "VALUEUOM", + "spec": "col_character" + } + } + }, + "diagnoses_icd": { + "files": "V1.1.0/DIAGNOSES_ICD.csv", + "defaults": { + "val_var": "ICD10_CODE_CN" + }, + "num_rows": 22712, + "cols": { + "row_id": { + "name": "ROW_ID", + "spec": "col_integer" + }, + "subject_id": { + "name": "SUBJECT_ID", + "spec": "col_integer" + }, + "hadm_id": { + "name": "HADM_ID", + "spec": "col_integer" + }, + "seq_num": { + "name": "SEQ_NUM", + "spec": "col_integer" + }, + "icd10_code_cn": { + "name": "ICD10_CODE_CN", + "spec": "col_character" + }, + "diag_category": { + "name": "Diag_Category", + "spec": "col_character" + } + } + }, + "d_icd_diagnoses": { + "files": "V1.1.0/D_ICD_DIAGNOSES.csv", + "defaults": { + }, + "num_rows": 25379, + "cols": { + "row_id": { + "name": "ROW_ID", + "spec": "col_integer" + }, + "icd10_code_cn": { + "name": "ICD10_CODE_CN", + "spec": "col_character" + }, + "icd10_code": { + "name": "ICD10_CODE", + "spec": "col_character" + }, + "title_cn": { + "name": "TITLE_CN", + "spec": "col_character" + }, + "title": { + "name": "TITLE", + "spec": "col_character" + } + } + }, + "d_items": { + "files": "V1.1.0/D_ITEMS.csv", + "defaults": { + }, + "num_rows": 479, + "cols": { + "row_id": { + "name": "ROW_ID", + "spec": "col_integer" + }, + "itemid": { + "name": "ITEMID", + "spec": "col_character" + }, + "label_cn": { + "name": "LABEL_CN", + "spec": "col_character" + }, + "label": { + "name": "LABEL", + "spec": "col_character" + }, + "linksto": { + "name": "LINKSTO", + "spec": "col_character" + }, + "category": { + "name": "CATEGORY", + "spec": "col_character" + }, + "unitname": { + "name": "UNITNAME", + "spec": "col_character" + } + } + }, + "d_labitems": { + "files": "V1.1.0/D_LABITEMS.csv", + "defaults": { + }, + "num_rows": 832, + "cols": { + "row_id": { + "name": "ROW_ID", + "spec": "col_integer" + }, + "itemid": { + "name": "ITEMID", + "spec": "col_integer" + }, + "label_cn": { + "name": "LABEL_CN", + "spec": "col_character" + }, + "label": { + "name": "LABEL", + "spec": "col_character" + }, + "fluid": { + "name": "FLUID", + "spec": "col_character" + }, + "category": { + "name": "CATEGORY", + "spec": "col_character" + }, + "loinc_code": { + "name": "LOINC_CODE", + "spec": "col_character" + } + } + }, + "emr_symptoms": { + "files": "V1.1.0/EMR_SYMPTOMS.csv", + "defaults": { + "time_vars": [ + "recordtime" + ] + }, + "num_rows": 402142, + "cols": { + "row_id": { + "name": "ROW_ID", + "spec": "col_integer" + }, + "subject_id": { + "name": "SUBJECT_ID", + "spec": "col_integer" + }, + "hadm_id": { + "name": "HADM_ID", + "spec": "col_integer" + }, + "emr_id": { + "name": "EMR_ID", + "spec": "col_integer" + }, + "recordtime": { + "name": "RECORDTIME", + "spec": "col_datetime", + "format": "%Y-%m-%d %H:%M:%S" + }, + "symptom_name_cn": { + "name": "SYMPTOM_NAME_CN", + "spec": "col_character" + }, + "symptom_name": { + "name": "SYMPTOM_NAME", + "spec": "col_character" + }, + "symptom_attribute": { + "name": "SYMPTOM_ATTRIBUTE", + "spec": "col_character" + } + } + }, + "icustays": { + "files": "V1.1.0/ICUSTAYS.csv", + "defaults": { + "time_vars": [ + "intime", + "outtime" + ], + "index_var": "intime", + "val_var": "last_careunit" + }, + "num_rows": 13941, + "cols": { + "row_id": { + "name": "ROW_ID", + "spec": "col_integer" + }, + "subject_id": { + "name": "SUBJECT_ID", + "spec": "col_integer" + }, + "hadm_id": { + "name": "HADM_ID", + "spec": "col_integer" + }, + "icustay_id": { + "name": "ICUSTAY_ID", + "spec": "col_integer" + }, + "first_careunit": { + "name": "FIRST_CAREUNIT", + "spec": "col_character" + }, + "last_careunit": { + "name": "LAST_CAREUNIT", + "spec": "col_character" + }, + "first_wardid": { + "name": "FIRST_WARDID", + "spec": "col_integer" + }, + "last_wardid": { + "name": "LAST_WARDID", + "spec": "col_integer" + }, + "intime": { + "name": "INTIME", + "spec": "col_datetime", + "format": "%Y-%m-%d %H:%M:%S" + }, + "outtime": { + "name": "OUTTIME", + "spec": "col_datetime", + "format": "%Y-%m-%d %H:%M:%S" + }, + "los": { + "name": "LOS", + "spec": "col_double" + } + } + }, + "inputevents": { + "files": "V1.1.0/INPUTEVENTS.csv", + "defaults": { + "time_vars": [ + "charttime", + "storetime" + ], + "index_var": "charttime", + "val_var": "amount", + "unit_var": "amountuom" + }, + "num_rows": 26884, + "cols": { + "row_id": { + "name": "ROW_ID", + "spec": "col_integer" + }, + "subject_id": { + "name": "SUBJECT_ID", + "spec": "col_integer" + }, + "hadm_id": { + "name": "HADM_ID", + "spec": "col_integer" + }, + "icustay_id": { + "name": "ICUSTAY_ID", + "spec": "col_double" + }, + "charttime": { + "name": "CHARTTIME", + "spec": "col_datetime", + "format": "%Y-%m-%d %H:%M:%S" + }, + "amount": { + "name": "AMOUNT", + "spec": "col_double" + }, + "amountuom": { + "name": "AMOUNTUOM", + "spec": "col_character" + }, + "storetime": { + "name": "STORETIME", + "spec": "col_datetime", + "format": "%Y-%m-%d %H:%M:%S" + } + } + }, + "labevents": { + "files": "V1.1.0/LABEVENTS.csv", + "defaults": { + "time_vars": [ + "charttime" + ], + "index_var": "charttime", + "val_var": "valuenum", + "unit_var": "valueuom" + }, + "num_rows": 10094117, + "cols": { + "row_id": { + "name": "ROW_ID", + "spec": "col_integer" + }, + "subject_id": { + "name": "SUBJECT_ID", + "spec": "col_integer" + }, + "hadm_id": { + "name": "HADM_ID", + "spec": "col_integer" + }, + "itemid": { + "name": "ITEMID", + "spec": "col_integer" + }, + "charttime": { + "name": "CHARTTIME", + "spec": "col_datetime", + "format": "%Y-%m-%d %H:%M:%S" + }, + "value": { + "name": "VALUE", + "spec": "col_character" + }, + "valuenum": { + "name": "VALUENUM", + "spec": "col_double" + }, + "valueuom": { + "name": "VALUEUOM", + "spec": "col_character" + }, + "flag": { + "name": "FLAG", + "spec": "col_character" + } + } + }, + "microbiologyevents": { + "files": "V1.1.0/MICROBIOLOGYEVENTS.csv", + "defaults": { + "time_vars": [ + "charttime" + ], + "index_var": "charttime" + }, + "num_rows": 183869, + "cols": { + "row_id": { + "name": "ROW_ID", + "spec": "col_integer" + }, + "subject_id": { + "name": "SUBJECT_ID", + "spec": "col_integer" + }, + "hadm_id": { + "name": "HADM_ID", + "spec": "col_integer" + }, + "charttime": { + "name": "CHARTTIME", + "spec": "col_datetime", + "format": "%Y-%m-%d %H:%M:%S" + }, + "spec_itemid": { + "name": "SPEC_ITEMID", + "spec": "col_character" + }, + "spec_type_desc": { + "name": "SPEC_TYPE_DESC", + "spec": "col_character" + }, + "org_itemid": { + "name": "ORG_ITEMID", + "spec": "col_character" + }, + "org_name": { + "name": "ORG_NAME", + "spec": "col_character" + }, + "ab_itemid": { + "name": "AB_ITEMID", + "spec": "col_character" + }, + "ab_name": { + "name": "AB_NAME", + "spec": "col_character" + }, + "dilution_text": { + "name": "DILUTION_TEXT", + "spec": "col_character" + }, + "dilution_comparison": { + "name": "DILUTION_COMPARISON", + "spec": "col_character" + }, + "dilution_value": { + "name": "DILUTION_VALUE", + "spec": "col_double" + }, + "interpretation": { + "name": "INTERPRETATION", + "spec": "col_character" + } + } + }, + "or_exam_reports": { + "files": "V1.1.0/OR_EXAM_REPORTS.csv", + "defaults": { + "time_vars": [ + "examtime", + "reporttime" + ] + }, + "num_rows": 183809, + "cols": { + "row_id": { + "name": "ROW_ID", + "spec": "col_integer" + }, + "subject_id": { + "name": "SUBJECT_ID", + "spec": "col_integer" + }, + "hadm_id": { + "name": "HADM_ID", + "spec": "col_integer" + }, + "examtime": { + "name": "EXAMTIME", + "spec": "col_datetime", + "format": "%Y-%m-%d %H:%M:%S" + }, + "reporttime": { + "name": "REPORTTIME", + "spec": "col_datetime", + "format": "%Y-%m-%d %H:%M:%S" + }, + "exam_item_type_name": { + "name": "EXAM_ITEM_TYPE_NAME", + "spec": "col_character" + }, + "exam_item_name": { + "name": "EXAM_ITEM_NAME", + "spec": "col_character" + }, + "exam_part_name": { + "name": "EXAM_PART_NAME", + "spec": "col_character" + } + } + }, + "outputevents": { + "files": "V1.1.0/OUTPUTEVENTS.csv", + "defaults": { + "time_vars": [ + "charttime", + "storetime" + ], + "index_var": "charttime", + "val_var": "value", + "unit_var": "valueuom" + }, + "num_rows": 39891, + "cols": { + "row_id": { + "name": "ROW_ID", + "spec": "col_integer" + }, + "subject_id": { + "name": "SUBJECT_ID", + "spec": "col_integer" + }, + "hadm_id": { + "name": "HADM_ID", + "spec": "col_integer" + }, + "icustay_id": { + "name": "ICUSTAY_ID", + "spec": "col_double" + }, + "charttime": { + "name": "CHARTTIME", + "spec": "col_datetime", + "format": "%Y-%m-%d %H:%M:%S" + }, + "itemid": { + "name": "ITEMID", + "spec": "col_integer" + }, + "value": { + "name": "VALUE", + "spec": "col_double" + }, + "valueuom": { + "name": "VALUEUOM", + "spec": "col_character" + }, + "storetime": { + "name": "STORETIME", + "spec": "col_datetime", + "format": "%Y-%m-%d %H:%M:%S" + } + } + }, + "patients": { + "files": "V1.1.0/PATIENTS.csv", + "defaults": { + "time_vars": [ + "dob", + "dod" + ], + "val_var": "expire_flag" + }, + "num_rows": 12881, + "cols": { + "row_id": { + "name": "ROW_ID", + "spec": "col_integer" + }, + "subject_id": { + "name": "SUBJECT_ID", + "spec": "col_integer" + }, + "gender": { + "name": "GENDER", + "spec": "col_character" + }, + "dob": { + "name": "DOB", + "spec": "col_datetime", + "format": "%Y-%m-%d %H:%M:%S" + }, + "dod": { + "name": "DOD", + "spec": "col_datetime", + "format": "%Y-%m-%d %H:%M:%S" + }, + "expire_flag": { + "name": "EXPIRE_FLAG", + "spec": "col_integer" + } + } + }, + "prescriptions": { + "files": "V1.1.0/PRESCRIPTIONS.csv", + "defaults": { + "time_vars": [ + "startdate", + "enddate" + ], + "index_var": "startdate", + "val_var": "dose_val_rx", + "unit_var": "dose_unit_rx" + }, + "num_rows": 1256591, + "cols": { + "row_id": { + "name": "ROW_ID", + "spec": "col_integer" + }, + "subject_id": { + "name": "SUBJECT_ID", + "spec": "col_integer" + }, + "hadm_id": { + "name": "HADM_ID", + "spec": "col_integer" + }, + "icustay_id": { + "name": "ICUSTAY_ID", + "spec": "col_double" + }, + "startdate": { + "name": "STARTDATE", + "spec": "col_datetime", + "format": "%Y-%m-%d %H:%M:%S" + }, + "enddate": { + "name": "ENDDATE", + "spec": "col_datetime", + "format": "%Y-%m-%d %H:%M:%S" + }, + "drug_name": { + "name": "DRUG_NAME", + "spec": "col_character" + }, + "drug_name_en": { + "name": "DRUG_NAME_EN", + "spec": "col_character" + }, + "prod_strength": { + "name": "PROD_STRENGTH", + "spec": "col_character" + }, + "drug_name_generic": { + "name": "DRUG_NAME_GENERIC", + "spec": "col_character" + }, + "dose_val_rx": { + "name": "DOSE_VAL_RX", + "spec": "col_double" + }, + "dose_unit_rx": { + "name": "DOSE_UNIT_RX", + "spec": "col_character" + }, + "drug_form": { + "name": "DRUG_FORM", + "spec": "col_character" + } + } + }, + "surgery_vital_signs": { + "files": "V1.1.0/SURGERY_VITAL_SIGNS.csv", + "defaults": { + "time_vars": [ + "monitor_time" + ], + "index_var": "oper_id", + "val_var": "value" + }, + "num_rows": 1944187, + "cols": { + "row_id": { + "name": "ROW_ID", + "spec": "col_integer" + }, + "subject_id": { + "name": "SUBJECT_ID", + "spec": "col_integer" + }, + "hadm_id": { + "name": "HADM_ID", + "spec": "col_integer" + }, + "visit_id": { + "name": "VISIT_ID", + "spec": "col_integer" + }, + "oper_id": { + "name": "OPER_ID", + "spec": "col_integer" + }, + "item_no": { + "name": "ITEM_NO", + "spec": "col_integer" + }, + "monitor_time": { + "name": "MONITOR_TIME", + "spec": "col_datetime", + "format": "%Y-%m-%d %H:%M:%S" + }, + "itemid": { + "name": "ITEMID", + "spec": "col_character" + }, + "value": { + "name": "VALUE", + "spec": "col_double" + } + } + } + } + } +] \ No newline at end of file diff --git a/inst/extdata/config/data-sources/sic.json b/inst/extdata/config/data-sources/sic.json index 760b50fc..5d527e36 100644 --- a/inst/extdata/config/data-sources/sic.json +++ b/inst/extdata/config/data-sources/sic.json @@ -4,17 +4,17 @@ "url": "https://physionet.org/files/sicdb/1.0.6", "id_cfg": { "patient": { - "id": "PatientID", + "id": "patientid", "position": 1, - "start": "ICUOffset", - "end": "OffsetOfDeath", + "start": "firstadmission", + "end": "offsetofdeath", "table": "cases" }, "icustay": { - "id": "CaseID", + "id": "caseid", "position": 2, - "start": "ICUOffset", - "end": "TimeOfStay", + "start": "offsetafterfirstadmission", + "end": "timeofstay", "table": "cases" } }, @@ -22,13 +22,13 @@ "cases": { "files": "cases.csv.gz", "defaults": { - "index_var": "ICUOffset", + "index_var": "icuoffset", "time_vars": [ - "ICUOffset", - "OffsetOfDeath", - "HeartSurgeryBeginOffset", - "HeartSurgeryEndOffset", - "OffsetAfterFirstAdmission" + "icuoffset", + "heartsurgerybeginoffset", + "heartsurgeryendoffset", + "offsetafterfirstadmission", + "offsetofdeath" ] }, "num_rows": 27386, @@ -193,16 +193,12 @@ "data_float_h": { "files": "data_float_h.csv.gz", "defaults": { - "index_var": "Offset", - "val_var": "Val", - "time_vars": "Offset" + "index_var": "offset", + "val_var": "val", + "time_vars": "offset" }, "num_rows": 36785241, "cols": { - "id": { - "name": "id", - "spec": "col_integer" - }, "caseid": { "name": "CaseID", "spec": "col_integer" @@ -225,48 +221,22 @@ }, "rawdata": { "name": "rawdata", - "spec": "col_double" + "spec": "col_character" } }, "partitioning": { "col": "dataid", "breaks": [ - 1, - 2, - 3, - 4, - 7, - 28, - 29, - 702, - 703, - 705, - 708, - 709, - 710, - 715, - 717, - 719, - 724, - 725, - 731, - 773, - 2018, - 2274, - 2278, - 2280, - 2283, - 2290, - 3056, - 3059, - 3071 - ] - } + 702, 703, 705, 708, 709, 710, 715, 717, 719, 724, 725, + 731, 773, 2018, 2274, 2278, 2280, 2283, 2290, 3056, 3059, 3071] + }, + "callback": "sic_data_float_h" }, "data_ref": { "files": "data_ref.csv.gz", "defaults": { - "index_var": "OffsetAfterFirstAdmission" + "index_var": "offsetafterfirstadmission", + "time_vars": ["offsetafterfirstadmission"] }, "num_rows": 354157, "cols": { @@ -282,8 +252,8 @@ "name": "RefID", "spec": "col_integer" }, - "customfieldid": { - "name": "CustomFieldID", + "fieldid": { + "name": "FieldID", "spec": "col_integer" } } @@ -291,9 +261,9 @@ "laboratory": { "files": "laboratory.csv.gz", "defaults": { - "index_var": "Offset", - "val_var": "LaboratoryValue", - "time_vars": "Offset" + "index_var": "offset", + "val_var": "laboratoryvalue", + "time_vars": "offset" }, "num_rows": 17572279, "cols": { @@ -326,11 +296,11 @@ "medication": { "files": "medication.csv.gz", "defaults": { - "index_var": "Offset", + "index_var": "offset", "val_var": "Amount", "time_vars": [ - "Offset", - "OffsetDrugEnd" + "offset", + "offsetdrugend" ] }, "num_rows": 5141346, @@ -380,10 +350,10 @@ "data_range": { "files": "data_range.csv.gz", "defaults": { - "index_var": "Offset", + "index_var": "offset", "time_vars": [ - "Offset", - "OffsetEnd" + "offset", + "offsetend" ] }, "num_rows": 183339, @@ -417,8 +387,8 @@ "unitlog": { "files": "unitlog.csv.gz", "defaults": { - "index_var": "Offset", - "time_vars": "Offset" + "index_var": "offset", + "time_vars": "offset" }, "num_rows": 139968, "cols": { diff --git a/man/change_id.Rd b/man/change_id.Rd index 8c3fa01e..6193adf5 100644 --- a/man/change_id.Rd +++ b/man/change_id.Rd @@ -57,34 +57,19 @@ and \code{downgrade_id()} when the target ID system is of lower cardinality } \details{ In order to provide ID system conversion for a data source, the (internal) -function \code{\link[=id_map]{id_map()}} must be able to construct an ID mapping for that data +function [id_map()] must be able to construct an ID mapping for that data source. Constructing such a mapping can be expensive w.r.t. the frequency -it might be re-used and therefore, \code{\link[=id_map]{id_map()}} provides caching +it might be re-used and therefore, [id_map()] provides caching infrastructure. The mapping itself is constructed by the (internal) -function \code{\link[=id_map_helper]{id_map_helper()}}, which is expected to provide source and +function [id_map_helper()], which is expected to provide source and destination ID columns as well as start and end columns corresponding to the destination ID, relative to the source ID system. In the following -example, we request for \code{mimic_demo}, with ICU stay IDs as source and +example, we request for `mimic_demo`, with ICU stay IDs as source and hospital admissions as destination IDs. -\if{html}{\out{
}}\preformatted{id_map_helper(mimic_demo, "icustay_id", "hadm_id") -#> # An `id_tbl`: 136 x 4 -#> # Id var: `icustay_id` -#> icustay_id hadm_id hadm_id_start hadm_id_end -#> -#> 1 201006 198503 -3290 mins 9114 mins -#> 2 201204 114648 -2 mins 6949 mins -#> 3 203766 126949 -1336 mins 8818 mins -#> 4 204132 157609 -1 mins 10103 mins -#> 5 204201 177678 -368 mins 9445 mins -#> ... -#> 132 295043 170883 -10413 mins 31258 mins -#> 133 295741 176805 -1 mins 3153 mins -#> 134 296804 110244 -1294 mins 4599 mins -#> 135 297782 167612 -1 mins 207 mins -#> 136 298685 151323 -1 mins 19082 mins -#> # i 131 more rows -}\if{html}{\out{
}} +```{r, eval = is_data_avail("mimic_demo")} +id_map_helper(mimic_demo, "icustay_id", "hadm_id") +``` Both start and end columns encode the hospital admission windows relative to each corresponding ICU stay start time. It therefore comes as no @@ -93,21 +78,22 @@ occurs before ICU stay start time), while end times are often days in the future (as hospital discharge typically occurs several days after ICU admission). -In order to use the ID conversion infrastructure offered by \code{ricu} for a -new dataset, it typically suffices to provide an \code{id_cfg} entry in the -source configuration (see \code{\link[=load_src_cfg]{load_src_cfg()}}), outlining the available ID +In order to use the ID conversion infrastructure offered by `ricu` for a +new dataset, it typically suffices to provide an `id_cfg` entry in the +source configuration (see [load_src_cfg()]), outlining the available ID systems alongside an ordering, as well as potentially a class specific -implementation of \code{\link[=id_map_helper]{id_map_helper()}} for the given source class, specifying +implementation of [id_map_helper()] for the given source class, specifying the corresponding time windows in 1 minute resolution (for every possible pair of IDs). -While both up- and downgrades for \code{id_tbl} objects, as well as downgrades -for \code{ts_tbl} objects are simple merge operations based on the ID mapping -provided by \code{\link[=id_map]{id_map()}}, ID upgrades for \code{ts_tbl} objects are slightly more -involved. As an example, consider the following setting: we have \code{data} -associated with \code{hadm_id} IDs and times relative to hospital admission: +While both up- and downgrades for `id_tbl` objects, as well as downgrades +for `ts_tbl` objects are simple merge operations based on the ID mapping +provided by [id_map()], ID upgrades for `ts_tbl` objects are slightly more +involved. As an example, consider the following setting: we have `data` +associated with `hadm_id` IDs and times relative to hospital admission: -\if{html}{\out{
}}\preformatted{ 1 2 3 4 5 6 7 8 +``` + 1 2 3 4 5 6 7 8 data ---*------*-------*--------*-------*-------*--------*------*--- 3h 10h 18h 27h 35h 43h 52h 59h @@ -117,17 +103,17 @@ hadm_id |-------------------------------------------------------------| icustay_id |------------------| |---------------| 0h 19h 0h 16h ICU_1 ICU_2 -}\if{html}{\out{
}} +``` -The mapping of data points from \code{hadm_id} to \code{icustay_id} is created as +The mapping of data points from `hadm_id` to `icustay_id` is created as follows: ICU stay end times mark boundaries and all data that is recorded after the last ICU stay ended is assigned to the last ICU stay. Therefore -data points 1-3 are assigned to \code{ICU_1}, while 4-8 are assigned to \code{ICU_2}. +data points 1-3 are assigned to `ICU_1`, while 4-8 are assigned to `ICU_2`. Times have to be shifted as well, as timestamps are expected to be relative to the current ID system. Data points 1-3 therefore are assigned to time stamps -4h, 3h and 11h, while data points 4-8 are assigned to -10h, -2h, 6h, 15h and 22h. Implementation-wise, the mapping is computed using an -efficient \code{data.table} rolling join. +efficient `data.table` rolling join. } \examples{ if (require(mimic.demo)) { diff --git a/man/data_env.Rd b/man/data_env.Rd index 542831df..1e4e4430 100644 --- a/man/data_env.Rd +++ b/man/data_env.Rd @@ -43,98 +43,57 @@ hosted data source is available as well. As with the PhysioNet datasets, access is public but has to be granted by the data collectors. } \details{ -Setting up a dataset for use with \code{ricu} requires a configuration object. +Setting up a dataset for use with `ricu` requires a configuration object. For the included datasets, configuration can be loaded from -\if{html}{\out{
}}\preformatted{system.file("extdata", "config", "data-sources.json", package = "ricu") -}\if{html}{\out{
}} +``` +system.file("extdata", "config", "data-sources.json", package = "ricu") +``` -by calling \code{\link[=load_src_cfg]{load_src_cfg()}} and for dataset that are external to \code{ricu}, +by calling [load_src_cfg()] and for dataset that are external to `ricu`, additional configuration can be made available by setting the environment -variable \code{RICU_CONFIG_PATH} (for more information, refer to -\code{\link[=load_src_cfg]{load_src_cfg()}}). Using the dataset configuration object, data can be -downloaded (\code{\link[=download_src]{download_src()}}), imported (\code{\link[=import_src]{import_src()}}) and attached -(\code{\link[=attach_src]{attach_src()}}). While downloading and importing are one-time procedures, +variable `RICU_CONFIG_PATH` (for more information, refer to +[load_src_cfg()]). Using the dataset configuration object, data can be +downloaded ([download_src()]), imported ([import_src()]) and attached +([attach_src()]). While downloading and importing are one-time procedures, attaching of the dataset is repeated every time the package is loaded. Briefly, downloading loads the raw dataset from the internet (most likely -in \code{.csv} format), importing consists of some preprocessing to make the -data available more efficiently (by converting it to \code{\link[fst:fst]{.fst}} +in `.csv` format), importing consists of some preprocessing to make the +data available more efficiently (by converting it to [`.fst`][fst::fst()] format) and attaching sets up the data for use by the package. For more information on the individual steps, refer to the respective documentation pages. A dataset that has been successfully made available can interactively be explored by typing its name into the console and individual tables can be -inspected using the \code{$} function. For example for the MIMIC-III demo -dataset and the \code{icustays} table, this gives +inspected using the `$` function. For example for the MIMIC-III demo +dataset and the `icustays` table, this gives -\if{html}{\out{
}}\preformatted{mimic_demo -#> -#> admissions callout caregivers chartevents -#> [129 x 19] [77 x 24] [7,567 x 4] [758,355 x 15] -#> cptevents d_cpt d_icd_diagnoses d_icd_procedures -#> [1,579 x 12] [134 x 9] [14,567 x 4] [3,882 x 4] -#> d_items d_labitems datetimeevents diagnoses_icd -#> [12,487 x 10] [753 x 6] [15,551 x 14] [1,761 x 5] -#> drgcodes icustays inputevents_cv inputevents_mv -#> [297 x 8] [136 x 12] [34,799 x 22] [13,224 x 31] -#> labevents microbiologyevents outputevents patients -#> [76,074 x 9] [2,003 x 16] [11,320 x 13] [100 x 8] -#> prescriptions procedureevents_mv procedures_icd services -#> [10,398 x 19] [753 x 25] [506 x 5] [163 x 6] -#> transfers -#> [524 x 13] +```{r, eval = is_data_avail("mimic_demo")} +mimic_demo mimic_demo$icustays -#> # : [136 x 12] -#> # ID options: subject_id (patient) < hadm_id (hadm) < icustay_id (icustay) -#> # Defaults: `intime` (index), `last_careunit` (val) -#> # Time vars: `intime`, `outtime` -#> row_id subject_id hadm_id icustay_id dbsource first_careunit last_careunit -#> -#> 1 12742 10006 142345 206504 carevue MICU MICU -#> 2 12747 10011 105331 232110 carevue MICU MICU -#> 3 12749 10013 165520 264446 carevue MICU MICU -#> 4 12754 10017 199207 204881 carevue CCU CCU -#> 5 12755 10019 177759 228977 carevue MICU MICU -#> ... -#> 132 42676 44083 198330 286428 metavision CCU CCU -#> 133 42691 44154 174245 217724 metavision MICU MICU -#> 134 42709 44212 163189 239396 metavision MICU MICU -#> 135 42712 44222 192189 238186 metavision CCU CCU -#> 136 42714 44228 103379 217992 metavision SICU SICU -#> # i 131 more rows -#> # i 5 more variables: first_wardid , last_wardid , intime , -#> # outtime , los -}\if{html}{\out{
}} +``` Table subsets can be loaded into memory for example using the -\code{\link[base:subset]{base::subset()}} function, which uses non-standard evaluation (NSE) to +[base::subset()] function, which uses non-standard evaluation (NSE) to determine a row-subsetting. This design choice stems form the fact that some tables can have on the order of 10^8 rows, which makes loading full tables into memory an expensive operation. Table subsets loaded into -memory are represented as \code{\link[data.table:data.table]{data.table}} objects. +memory are represented as [`data.table`][data.table::data.table()] objects. Extending the above example, if only ICU stays corresponding to the patient -with \code{subject_id == 10124} are of interest, the respective data can be +with `subject_id == 10124` are of interest, the respective data can be loaded as -\if{html}{\out{
}}\preformatted{subset(mimic_demo$icustays, subject_id == 10124) -#> row_id subject_id hadm_id icustay_id dbsource first_careunit last_careunit -#> 1: 12863 10124 182664 261764 carevue MICU MICU -#> 2: 12864 10124 170883 222779 carevue MICU MICU -#> 3: 12865 10124 170883 295043 carevue CCU CCU -#> 4: 12866 10124 170883 237528 carevue MICU MICU -#> first_wardid last_wardid intime outtime los -#> 1: 23 23 2192-03-29 10:46:51 2192-04-01 06:36:00 2.8258 -#> 2: 50 50 2192-04-16 20:58:32 2192-04-20 08:51:28 3.4951 -#> 3: 7 7 2192-04-24 02:29:49 2192-04-26 23:59:45 2.8958 -#> 4: 23 23 2192-04-30 14:50:44 2192-05-15 23:34:21 15.3636 -}\if{html}{\out{
}} +```{r, eval = is_data_avail("mimic_demo")} +subset(mimic_demo$icustays, subject_id == 10124) +``` -Much care has been taken to make \code{ricu} extensible to new datasets. For -example the publicly available ICU database \href{https://amsterdammedicaldatascience.nl/amsterdamumcdb/}{AmsterdamUMCdb } +Much care has been taken to make `ricu` extensible to new datasets. For +example the publicly available ICU database [AmsterdamUMCdb +](https://amsterdammedicaldatascience.nl/amsterdamumcdb/) provided by the Amsterdam University Medical Center, currently is not part -of the core datasets of \code{ricu}, but code for integrating this dataset is -available on \href{https://github.com/eth-mds/aumc}{github}. +of the core datasets of `ricu`, but code for integrating this dataset is +available on [github](https://github.com/eth-mds/aumc). } \section{MIMIC-III}{ diff --git a/test_environment.yaml b/test_environment.yaml new file mode 100644 index 00000000..9c0c12a8 --- /dev/null +++ b/test_environment.yaml @@ -0,0 +1,32 @@ +name: ricu-test +channels: + - nodefaults + - conda-forge +dependencies: + - r-base + - r-data.table + - r-curl + - r-assertthat + - r-fst + - r-readr + - r-jsonlite + - r-prt>=0.1.2 + - r-tibble + - r-backports + - r-rlang + - r-vctrs + - r-cli>=2.1.0 + - r-fansi + - r-openssl + - r-units + # optional + - r-rticles + - r-forestmodel + - r-ggplot2 + - r-survival + - r-kableExtra + - r-magick + - r-cowplot + - r-knitr + - r-pdftools + - r-covr \ No newline at end of file