diff --git a/inst/extdata/config/concept-dict.R b/inst/extdata/config/concept-dict.R index c8d15cb..f56d6f4 100644 --- a/inst/extdata/config/concept-dict.R +++ b/inst/extdata/config/concept-dict.R @@ -3322,6 +3322,175 @@ cfg <- list( ) ), class = c("unt_cncpt", "num_cncpt") + ), + viewposition = list( + levels = c("frontal", "lateral", "decubitus", "oblique", "special", "unknown"), + class = "fct_cncpt", + description = "Grouped X-ray view positions", + category = "imaging", + sources = list( + miiv = list( + list( + table = "cxrmetadata", + val_var = "viewposition", + callback = "apply_map( + c( + 'PA' = 'frontal', 'AP' = 'frontal', 'AP AXIAL' = 'frontal', + 'LATERAL' = 'lateral', 'LL' = 'lateral', 'XTABLE LATERAL' = 'lateral', + 'PA LLD' = 'decubitus', 'AP LLD' = 'decubitus', 'AP RLD' = 'decubitus', 'PA RLD' = 'decubitus', + 'LAO' = 'oblique', 'RAO' = 'oblique', 'LPO' = 'oblique', + 'SWIMMERS' = 'special' + ) + )", + class = "col_itm" + ) + ) + ) + ), + study_id = list( + description = "unique identifier for the subject", + category = "imaging", + sources = list( + miiv = list( + list(table = "cxrmetadata", val_var = "study_id", class = "col_itm") + ) + ) + ), + dicom_id = list( + description = "unique identifier for the image", + category = "imaging", + sources = list( + miiv = list( + list(table = "cxrmetadata", sub_var = "dicom_id", regex = "^.*$", + class = "rgx_itm") + ) + ) + ), + atelectasis = list( + description = "Atelectasis", + category = "imaging", + sources = list( + miiv = list( + list(table = "cxrchexpert", val_var = "atelectasis", class = "col_itm") + ) + ) + ), + cardiomegaly = list( + description = "Cardiomegaly", + category = "imaging", + sources = list( + miiv = list( + list(table = "cxrchexpert", val_var = "cardiomegaly", class = "col_itm") + ) + ) + ), + consolidation = list( + description = "Consolidation", + category = "imaging", + sources = list( + miiv = list( + list(table = "cxrchexpert", val_var = "consolidation", class = "col_itm") + ) + ) + ), + edema = list( + description = "Edema", + category = "imaging", + sources = list( + miiv = list( + list(table = "cxrchexpert", val_var = "edema", class = "col_itm") + ) + ) + ), + enlarged_cardiomediastinum = list( + description = "Enlarged Cardiomediastinum", + category = "imaging", + sources = list( + miiv = list( + list(table = "cxrchexpert", val_var = "enlarged_cardiomediastinum", class = "col_itm") + ) + ) + ), + fracture = list( + description = "Fracture", + category = "imaging", + sources = list( + miiv = list( + list(table = "cxrchexpert", val_var = "fracture", class = "col_itm") + ) + ) + ), + lung_lesion = list( + description = "Lung Lesion", + category = "imaging", + sources = list( + miiv = list( + list(table = "cxrchexpert", val_var = "lung_lesion", class = "col_itm") + ) + ) + ), + lung_opacity = list( + description = "Lung Opacity", + category = "imaging", + sources = list( + miiv = list( + list(table = "cxrchexpert", val_var = "lung_opacity", class = "col_itm") + ) + ) + ), + no_finding = list( + description = "If all other chexpert labels are 0 or -1, no finding is 1", + category = "imaging", + sources = list( + miiv = list( + list(table = "cxrchexpert", val_var = "no_finding", class = "col_itm") + ) + ) + ), + pleural_effusion = list( + description = "Pleural Effusion", + category = "imaging", + sources = list( + miiv = list( + list(table = "cxrchexpert", val_var = "pleural_effusion", class = "col_itm") + ) + ) + ), + pleural_other = list( + description = "Pleural Other", + category = "imaging", + sources = list( + miiv = list( + list(table = "cxrchexpert", val_var = "pleural_other", class = "col_itm") + ) + ) + ), + pneumonia = list( + description = "Pneumonia", + category = "imaging", + sources = list( + miiv = list( + list(table = "cxrchexpert", val_var = "pneumonia", class = "col_itm") + ) + ) + ), + pneumothorax = list( + description = "Pneumothorax", + category = "imaging", + sources = list( + miiv = list( + list(table = "cxrchexpert", val_var = "pneumothorax", class = "col_itm") + ) + ) + ), + support_devices = list( + description = "Support Devices", + category = "imaging", + sources = list( + miiv = list( + list(table = "cxrchexpert", val_var = "support_devices", class = "col_itm") + ) + ) ) ) diff --git a/inst/extdata/config/concept-dict.json b/inst/extdata/config/concept-dict.json index 1c8ea24..ffe02d9 100644 --- a/inst/extdata/config/concept-dict.json +++ b/inst/extdata/config/concept-dict.json @@ -592,6 +592,19 @@ ] } }, + "atelectasis": { + "description": "Atelectasis", + "category": "imaging", + "sources": { + "miiv": [ + { + "table": "cxrchexpert", + "val_var": "atelectasis", + "class": "col_itm" + } + ] + } + }, "avpu": { "concepts": "gcs", "description": "AVPU scale", @@ -1215,6 +1228,19 @@ ] } }, + "cardiomegaly": { + "description": "Cardiomegaly", + "category": "imaging", + "sources": { + "miiv": [ + { + "table": "cxrchexpert", + "val_var": "cardiomegaly", + "class": "col_itm" + } + ] + } + }, "ck": { "unit": ["IU/L", "U/l"], "min": 0, @@ -1414,6 +1440,19 @@ ] } }, + "consolidation": { + "description": "Consolidation", + "category": "imaging", + "sources": { + "miiv": [ + { + "table": "cxrchexpert", + "val_var": "consolidation", + "class": "col_itm" + } + ] + } + }, "cort": { "class": "lgl_cncpt", "description": "corticosteroids", @@ -1832,6 +1871,20 @@ }, "class": ["unt_cncpt", "num_cncpt"] }, + "dicom_id": { + "description": "unique identifier for the image", + "category": "imaging", + "sources": { + "miiv": [ + { + "table": "cxrmetadata", + "sub_var": "dicom_id", + "regex": "^.*$", + "class": "rgx_itm" + } + ] + } + }, "dobu_dur": { "description": "dobutamine duration", "category": "medications", @@ -2228,6 +2281,19 @@ "callback": "vaso60", "class": "rec_cncpt" }, + "edema": { + "description": "Edema", + "category": "imaging", + "sources": { + "miiv": [ + { + "table": "cxrchexpert", + "val_var": "edema", + "class": "col_itm" + } + ] + } + }, "egcs": { "min": 1, "max": 4, @@ -2294,6 +2360,19 @@ ] } }, + "enlarged_cardiomediastinum": { + "description": "Enlarged Cardiomediastinum", + "category": "imaging", + "sources": { + "miiv": [ + { + "table": "cxrchexpert", + "val_var": "enlarged_cardiomediastinum", + "class": "col_itm" + } + ] + } + }, "eos": { "unit": "%", "min": 0, @@ -2888,6 +2967,19 @@ ] } }, + "fracture": { + "description": "Fracture", + "category": "imaging", + "sources": { + "miiv": [ + { + "table": "cxrchexpert", + "val_var": "fracture", + "class": "col_itm" + } + ] + } + }, "gcs": { "concepts": ["egcs", "mgcs", "vgcs", "tgcs", "ett_gcs"], "description": "Glasgow coma scale (non-sedated)", @@ -3690,6 +3782,32 @@ ] } }, + "lung_lesion": { + "description": "Lung Lesion", + "category": "imaging", + "sources": { + "miiv": [ + { + "table": "cxrchexpert", + "val_var": "lung_lesion", + "class": "col_itm" + } + ] + } + }, + "lung_opacity": { + "description": "Lung Opacity", + "category": "imaging", + "sources": { + "miiv": [ + { + "table": "cxrchexpert", + "val_var": "lung_opacity", + "class": "col_itm" + } + ] + } + }, "lymph": { "unit": "%", "min": 0, @@ -4437,6 +4555,19 @@ "callback": "news_score", "class": "rec_cncpt" }, + "no_finding": { + "description": "If all other chexpert labels are 0 or -1, no finding is 1", + "category": "imaging", + "sources": { + "miiv": [ + { + "table": "cxrchexpert", + "val_var": "no_finding", + "class": "col_itm" + } + ] + } + }, "norepi_dur": { "description": "norepinephrine duration", "category": "medications", @@ -5052,6 +5183,32 @@ ] } }, + "pleural_effusion": { + "description": "Pleural Effusion", + "category": "imaging", + "sources": { + "miiv": [ + { + "table": "cxrchexpert", + "val_var": "pleural_effusion", + "class": "col_itm" + } + ] + } + }, + "pleural_other": { + "description": "Pleural Other", + "category": "imaging", + "sources": { + "miiv": [ + { + "table": "cxrchexpert", + "val_var": "pleural_other", + "class": "col_itm" + } + ] + } + }, "plt": { "unit": ["K/uL", "G/l"], "min": 5, @@ -5119,6 +5276,32 @@ ] } }, + "pneumonia": { + "description": "Pneumonia", + "category": "imaging", + "sources": { + "miiv": [ + { + "table": "cxrchexpert", + "val_var": "pneumonia", + "class": "col_itm" + } + ] + } + }, + "pneumothorax": { + "description": "Pneumothorax", + "category": "imaging", + "sources": { + "miiv": [ + { + "table": "cxrchexpert", + "val_var": "pneumothorax", + "class": "col_itm" + } + ] + } + }, "po2": { "unit": ["mmHg", "mm Hg"], "min": 40, @@ -5999,6 +6182,19 @@ ] } }, + "study_id": { + "description": "unique identifier for the subject", + "category": "imaging", + "sources": { + "miiv": [ + { + "table": "cxrmetadata", + "val_var": "study_id", + "class": "col_itm" + } + ] + } + }, "supp_o2": { "concepts": ["vent_ind", "fio2"], "description": "supplemental oxygen", @@ -6007,6 +6203,19 @@ "callback": "supp_o2", "class": "rec_cncpt" }, + "support_devices": { + "description": "Support Devices", + "category": "imaging", + "sources": { + "miiv": [ + { + "table": "cxrchexpert", + "val_var": "support_devices", + "class": "col_itm" + } + ] + } + }, "susp_inf": { "concepts": ["abx", "samp"], "description": "suspected infection", @@ -6624,6 +6833,22 @@ ] } }, + "viewposition": { + "levels": ["frontal", "lateral", "decubitus", "oblique", "special", "unknown"], + "class": "fct_cncpt", + "description": "Grouped X-ray view positions", + "category": "imaging", + "sources": { + "miiv": [ + { + "table": "cxrmetadata", + "val_var": "viewposition", + "callback": "apply_map(\n c(\n 'PA' = 'frontal', 'AP' = 'frontal', 'AP AXIAL' = 'frontal',\n 'LATERAL' = 'lateral', 'LL' = 'lateral', 'XTABLE LATERAL' = 'lateral',\n 'PA LLD' = 'decubitus', 'AP LLD' = 'decubitus', 'AP RLD' = 'decubitus', 'PA RLD' = 'decubitus',\n 'LAO' = 'oblique', 'RAO' = 'oblique', 'LPO' = 'oblique',\n 'SWIMMERS' = 'special'\n )\n )", + "class": "col_itm" + } + ] + } + }, "wbc": { "unit": ["K/uL", "G/l"], "min": 0, diff --git a/inst/extdata/config/data-sources.R b/inst/extdata/config/data-sources.R index fcf5963..bfaff16 100644 --- a/inst/extdata/config/data-sources.R +++ b/inst/extdata/config/data-sources.R @@ -1226,6 +1226,38 @@ miiv_tbl_cfg <- function() { statusdescription = list(spec = "col_character"), originalamount = list(spec = "col_double"), originalrate = list(spec = "col_double") + ), + cxrmetadata = list( + dicom_id = list(spec = "col_character"), + subject_id = list(spec = "col_integer"), + study_id = list(spec = "col_integer"), + performedprocedurestepdescription = list(spec = "col_character"), + viewposition = list(spec = "col_character"), + rows = list(spec = "col_integer"), + columns = list(spec = "col_integer"), + studytime = list(spec = "col_datetime", format = "%Y-%m-%d %H:%M:%S"), + procedurecodesequence_codemeaning = list(spec = "col_character"), + viewcodesequence_codemeaning = list(spec = "col_character"), + patientorientationcodesequence_codemeaning = list(spec = "col_character") + ), + cxrchexpert = list( + subject_id = list(spec = "col_integer"), + study_id = list(spec = "col_integer"), + atelectasis = list(spec = "col_double"), + cardiomegaly = list(spec = "col_double"), + consolidation = list(spec = "col_double"), + edema = list(spec = "col_double"), + enlarged_cardiomediastinum = list(spec = "col_double"), + fracture = list(spec = "col_double"), + lung_lesion = list(spec = "col_double"), + lung_opacity = list(spec = "col_double"), + no_finding = list(spec = "col_double"), + pleural_effusion = list(spec = "col_double"), + pleural_other = list(spec = "col_double"), + pneumonia = list(spec = "col_double"), + pneumothorax = list(spec = "col_double"), + support_devices = list(spec = "col_double"), + studytime = list(spec = "col_datetime", format = "%Y-%m-%d %H:%M:%S") ) ) @@ -1346,6 +1378,14 @@ miiv_tbl_cfg <- function() { index_var = "starttime", val_var = "rate", unit_var = "rateuom" + ), + cxrmetadata = list( + id_var = "subject_id", + index_var = "studytime" + ), + cxrchexpert = list( + id_var = "subject_id", + index_var = "studytime" ) ) @@ -1387,7 +1427,9 @@ miiv_tbl_cfg <- function() { omr = 6439169L, caregiver = 15468L, provider = 40508L, - ingredientevents = 11627821L + ingredientevents = 11627821L, + cxrmetadata = 377110L, + cxrchexpert = 227827L ) files <- c( @@ -1421,7 +1463,9 @@ miiv_tbl_cfg <- function() { omr = "hosp/omr.csv.gz", caregiver = "icu/caregiver.csv.gz", provider = "hosp/provider.csv.gz", - ingredientevents = "icu/ingredientevents.csv.gz" + ingredientevents = "icu/ingredientevents.csv.gz", + cxrmetadata = "cxr/cxrmetadata.csv.gz", + cxrchexpert = "cxr/cxrchexpert.csv.gz" ) part <- list( diff --git a/inst/extdata/config/data-sources.json b/inst/extdata/config/data-sources.json index e31b323..07d645d 100644 --- a/inst/extdata/config/data-sources.json +++ b/inst/extdata/config/data-sources.json @@ -8832,6 +8832,142 @@ "spec": "col_double" } } + }, + "cxrmetadata": { + "files": "cxr/cxrmetadata.csv.gz", + "defaults": { + "id_var": "subject_id", + "index_var": "studytime", + "time_vars": "studytime" + }, + "num_rows": 377110, + "cols": { + "dicom_id": { + "name": "dicom_id", + "spec": "col_character" + }, + "subject_id": { + "name": "subject_id", + "spec": "col_integer" + }, + "study_id": { + "name": "study_id", + "spec": "col_integer" + }, + "performedprocedurestepdescription": { + "name": "performedprocedurestepdescription", + "spec": "col_character" + }, + "viewposition": { + "name": "viewposition", + "spec": "col_character" + }, + "rows": { + "name": "rows", + "spec": "col_integer" + }, + "columns": { + "name": "columns", + "spec": "col_integer" + }, + "studytime": { + "name": "studytime", + "spec": "col_datetime", + "format": "%Y-%m-%d %H:%M:%S" + }, + "procedurecodesequence_codemeaning": { + "name": "procedurecodesequence_codemeaning", + "spec": "col_character" + }, + "viewcodesequence_codemeaning": { + "name": "viewcodesequence_codemeaning", + "spec": "col_character" + }, + "patientorientationcodesequence_codemeaning": { + "name": "patientorientationcodesequence_codemeaning", + "spec": "col_character" + } + } + }, + "cxrchexpert": { + "files": "cxr/cxrchexpert.csv.gz", + "defaults": { + "id_var": "subject_id", + "index_var": "studytime", + "time_vars": "studytime" + }, + "num_rows": 227827, + "cols": { + "subject_id": { + "name": "subject_id", + "spec": "col_integer" + }, + "study_id": { + "name": "study_id", + "spec": "col_integer" + }, + "atelectasis": { + "name": "atelectasis", + "spec": "col_double" + }, + "cardiomegaly": { + "name": "cardiomegaly", + "spec": "col_double" + }, + "consolidation": { + "name": "consolidation", + "spec": "col_double" + }, + "edema": { + "name": "edema", + "spec": "col_double" + }, + "enlarged_cardiomediastinum": { + "name": "enlarged_cardiomediastinum", + "spec": "col_double" + }, + "fracture": { + "name": "fracture", + "spec": "col_double" + }, + "lung_lesion": { + "name": "lung_lesion", + "spec": "col_double" + }, + "lung_opacity": { + "name": "lung_opacity", + "spec": "col_double" + }, + "no_finding": { + "name": "no_finding", + "spec": "col_double" + }, + "pleural_effusion": { + "name": "pleural_effusion", + "spec": "col_double" + }, + "pleural_other": { + "name": "pleural_other", + "spec": "col_double" + }, + "pneumonia": { + "name": "pneumonia", + "spec": "col_double" + }, + "pneumothorax": { + "name": "pneumothorax", + "spec": "col_double" + }, + "support_devices": { + "name": "support_devices", + "spec": "col_double" + }, + "studytime": { + "name": "studytime", + "spec": "col_datetime", + "format": "%Y-%m-%d %H:%M:%S" + } + } } } },