Skip to content

Commit

Permalink
Start to integrate YAIB configs
Browse files Browse the repository at this point in the history
  • Loading branch information
manuelburger committed Mar 26, 2024
1 parent 640d4d2 commit 5f0a684
Show file tree
Hide file tree
Showing 7 changed files with 493 additions and 10 deletions.
11 changes: 6 additions & 5 deletions inst/extdata/config/concept-dict/chemistry.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
],
"miiv": [
{
"ids": 50862,
"ids": [50862, 53085],
"table": "labevents",
"sub_var": "itemid"
}
Expand Down Expand Up @@ -127,7 +127,7 @@
],
"miiv": [
{
"ids": 50863,
"ids": [50863, 53086],
"table": "labevents",
"sub_var": "itemid"
}
Expand Down Expand Up @@ -454,7 +454,7 @@
],
"miiv": [
{
"ids": 50885,
"ids": [50885, 53089],
"table": "labevents",
"sub_var": "itemid"
}
Expand Down Expand Up @@ -506,7 +506,7 @@
"ids": 6812,
"table": "numericitems",
"sub_var": "itemid",
"callback": "convert_unit(binary_op(`*`, 0.058467), 'mg/dL')"
"callback": "convert_unit(binary_op(`*`, 1.), 'mg/dL')"
}
],
"eicu": [
Expand Down Expand Up @@ -825,7 +825,8 @@
{
"ids": 6824,
"table": "numericitems",
"sub_var": "itemid"
"sub_var": "itemid",
"callback": "convert_unit(binary_op(`*`, 0.2), 'ng/mL')"
}
],
"eicu": [
Expand Down
19 changes: 19 additions & 0 deletions inst/extdata/config/concept-dict/circulatory.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"mech_circ": {
"description": "mechanical circulatory support",
"class": "lgl_cncpt",
"target": "id_tbl",
"category": "circulatory",
"sources": {
"mimic": [
{
"ids": ["3752", "3760", "3765", "3766", "3768"],
"table": "procedures_icd",
"sub_var": "icd9_code",
"val_var": "seq_num",
"callback": "transform_fun(set_val(TRUE))"
}
]
}
}
}
83 changes: 82 additions & 1 deletion inst/extdata/config/concept-dict/demographics.json
Original file line number Diff line number Diff line change
Expand Up @@ -419,5 +419,86 @@
}
]
}
}
},
"ethnic": {
"target": "id_tbl",
"levels": ["asian", "black", "white", "other"],
"class": "fct_cncpt",
"description": "ethnicity",
"category": "demographics",
"sources": {
"eicu": [
{
"table": "patient",
"val_var": "ethnicity",
"callback": "apply_map(c(`African American` = 'black', Asian = 'asian', Caucasian = 'white', Hispanic = 'other', `Native American` = 'other', `Other/Unknown` = 'other'))",
"class": "col_itm"
}
],
"eicu_demo": [
{
"table": "patient",
"val_var": "ethnicity",
"callback": "apply_map(c(`African American` = 'black', Asian = 'asian', Caucasian = 'white', Hispanic = 'other', `Native American` = 'other', `Other/Unknown` = 'other'))",
"class": "col_itm"
}
],
"miiv": [
{
"table": "admissions",
"val_var": "race",
"callback": "apply_map(c(`AMERICAN INDIAN/ALASKA NATIVE` = 'other', ASIAN = 'asian', `ASIAN - ASIAN INDIAN` = 'asian', `ASIAN - CHINESE` = 'asian', `ASIAN - KOREAN` = 'asian', `ASIAN - SOUTH EAST ASIAN` = 'asian', `BLACK/AFRICAN` = 'black', `BLACK/AFRICAN AMERICAN` = 'black', `BLACK/CAPE VERDEAN` = 'black', `BLACK/CARIBBEAN ISLAND` = 'black', `HISPANIC OR LATINO` = 'other', `HISPANIC/LATINO - CENTRAL AMERICAN` = 'other', `HISPANIC/LATINO - COLUMBIAN` = 'other', `HISPANIC/LATINO - CUBAN` = 'other', `HISPANIC/LATINO - DOMINICAN` = 'other', `HISPANIC/LATINO - GUATEMALAN` = 'other', `HISPANIC/LATINO - HONDURAN` = 'other', `HISPANIC/LATINO - MEXICAN` = 'other', `HISPANIC/LATINO - PUERTO RICAN` = 'other', `HISPANIC/LATINO - SALVADORAN` = 'other', `MULTIPLE RACE/ETHNICITY NATIVE HAWAIIAN OR OTHER PACIFIC ISLANDER` = 'other', `OTHER` = 'other', `PATIENT DECLINED TO ANSWER` = NA, `PORTUGUESE` = 'white', `SOUTH AMERICAN` = 'other', `UNABLE TO OBTAIN` = NA, `UNKNOWN` = NA, `WHITE` = 'white', `WHITE - BRAZILIAN` = 'white', `WHITE - EASTERN EUROPEAN` = 'white', `WHITE - OTHER EUROPEAN` = 'white', `WHITE - RUSSIAN` = 'white'))",
"class": "col_itm"
}
],
"mimic": [
{
"table": "admissions",
"val_var": "ethnicity",
"callback": "apply_map(c(`AMERICAN INDIAN/ALASKA NATIVE` = 'other', `AMERICAN INDIAN/ALASKA NATIVE FEDERALLY RECOGNIZED TRIBE` = 'other', ASIAN = 'asian', `ASIAN - ASIAN INDIAN` = 'asian', `ASIAN - CAMBODIAN` = 'asian', `ASIAN - CHINESE` = 'asian', `ASIAN - FILIPINO` = 'asian', `ASIAN - JAPANESE` = 'asian', `ASIAN - KOREAN` = 'asian', `ASIAN - OTHER` = 'asian', `ASIAN - THAI` = 'asian', `ASIAN - VIETNAMESE` = 'asian',`BLACK/AFRICAN` = 'black', `BLACK/AFRICAN AMERICAN` = 'black', `BLACK/CAPE VERDEAN` = 'black', `BLACK/HAITIAN` = 'black', `CARIBBEAN ISLAND` = 'black', `HISPANIC OR LATINO` = 'other', `HISPANIC/LATINO - CENTRAL AMERICAN (OTHER)` = 'other', `HISPANIC/LATINO - COLOMBIAN` = 'other', `HISPANIC/LATINO - CUBAN` = 'other', `HISPANIC/LATINO - DOMINICAN` = 'other', `HISPANIC/LATINO - GUATEMALAN` = 'other', `HISPANIC/LATINO - HONDURAN` = 'other', `HISPANIC/LATINO - MEXICAN` = 'other', `HISPANIC/LATINO - PUERTO RICAN` = 'other', `HISPANIC/LATINO - SALVADORAN` = 'other', `MIDDLE EASTERN` = 'other', `MULTI RACE ETHNICITY` = 'other', `NATIVE HAWAIIAN OR OTHER PACIFIC ISLANDER` = 'other', `OTHER` = 'other', `PATIENT DECLINED TO ANSWER` = NA, `PORTUGUESE` = 'white', `SOUTH AMERICAN` = 'other', `UNABLE TO OBTAIN` = NA, `UNKNOWN/NOT SPECIFIED` = NA, `WHITE` = 'white', `WHITE - BRAZILIAN` = 'white', `WHITE - EASTERN EUROPEAN` = 'white', `WHITE - OTHER EUROPEAN` = 'white', `WHITE - RUSSIAN` = 'white'))",
"class": "col_itm"
}
],
"mimic_demo": [
{
"table": "admissions",
"val_var": "ethnicity",
"callback": "apply_map(c(`AMERICAN INDIAN/ALASKA NATIVE` = 'other', `AMERICAN INDIAN/ALASKA NATIVE FEDERALLY RECOGNIZED TRIBE` = 'other', ASIAN = 'asian', `ASIAN - ASIAN INDIAN` = 'asian', `ASIAN - CAMBODIAN` = 'asian', `ASIAN - CHINESE` = 'asian', `ASIAN - FILIPINO` = 'asian', `ASIAN - JAPANESE` = 'asian', `ASIAN - KOREAN` = 'asian', `ASIAN - OTHER` = 'asian', `ASIAN - THAI` = 'asian', `ASIAN - VIETNAMESE` = 'asian',`BLACK/AFRICAN` = 'black', `BLACK/AFRICAN AMERICAN` = 'black', `BLACK/CAPE VERDEAN` = 'black', `BLACK/HAITIAN` = 'black', `CARIBBEAN ISLAND` = 'black', `HISPANIC OR LATINO` = 'other', `HISPANIC/LATINO - CENTRAL AMERICAN (OTHER)` = 'other', `HISPANIC/LATINO - COLOMBIAN` = 'other', `HISPANIC/LATINO - CUBAN` = 'other', `HISPANIC/LATINO - DOMINICAN` = 'other', `HISPANIC/LATINO - GUATEMALAN` = 'other', `HISPANIC/LATINO - HONDURAN` = 'other', `HISPANIC/LATINO - MEXICAN` = 'other', `HISPANIC/LATINO - PUERTO RICAN` = 'other', `HISPANIC/LATINO - SALVADORAN` = 'other', `MIDDLE EASTERN` = 'other', `MULTI RACE ETHNICITY` = 'other', `NATIVE HAWAIIAN OR OTHER PACIFIC ISLANDER` = 'other', `OTHER` = 'other', `PATIENT DECLINED TO ANSWER` = NA, `PORTUGUESE` = 'white', `SOUTH AMERICAN` = 'other', `UNABLE TO OBTAIN` = NA, `UNKNOWN/NOT SPECIFIED` = NA, `WHITE` = 'white', `WHITE - BRAZILIAN` = 'white', `WHITE - EASTERN EUROPEAN` = 'white', `WHITE - OTHER EUROPEAN` = 'white', `WHITE - RUSSIAN` = 'white'))",
"class": "col_itm"
}
],
"picdb": [
{
"table": "admissions",
"val_var": "ethnicity",
"callback": "apply_map(c(`Hui ethnic` = 'asian', `Buyei ethnic` = 'asian', `Han ethnic` = 'asian', `Yi ethnic` = 'asian', `Miao ethnic` = 'asian', `Others` = 'other', `Tujia ethnic` = 'asian'))",
"class": "col_itm"
}
]
}
},
"insurance": {
"target": "id_tbl",
"levels": ["Government", "Medicaid", "Medicare", "Private", "Self Pay"],
"class": "fct_cncpt",
"description": "insurance",
"category": "demographics",
"sources": {
"mimic": [{
"table": "admissions",
"val_var": "insurance",
"class": "col_itm"
}],
"mimic_demo": [{
"table": "admissions",
"val_var": "insurance",
"class": "col_itm"
}],
"miiv": [{
"table": "admissions",
"val_var": "insurance",
"class": "col_itm"
}]
}
}
}
9 changes: 5 additions & 4 deletions inst/extdata/config/concept-dict/hematology.json
Original file line number Diff line number Diff line change
Expand Up @@ -825,9 +825,9 @@
"ids": 24000170,
"table": "observations",
"sub_var": "variableid",
"callback": "convert_unit(binary_op(`*`, 0.16114), '%')",
"callback": "convert_unit(binary_op(`*`, 0.1), '%')",
"class": "hrd_itm"
}
}
],
"miiv": [
{
Expand Down Expand Up @@ -990,8 +990,9 @@
"ids": 24000550,
"table": "observations",
"sub_var": "variableid",
"class": "hrd_itm"
}
"class": "hrd_itm",
"callback": "blood_cell_ratio"
}
],
"miiv": [
{
Expand Down
168 changes: 168 additions & 0 deletions inst/extdata/config/concept-dict/medications.json
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,102 @@
"picdb": []
}
},
"abx_cont": {
"description": "continuous antibiotic administration",
"concepts": ["abx_duration", "death_icu"],
"category": "medications",
"callback": "abx_cont",
"class": "rec_cncpt"
},
"abx_duration": {
"description": "duration of administered antibiotics",
"category": "medications",
"target": "win_tbl",
"class": "lgl_cncpt",
"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",
"dur_var": "stop",
"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",
"target": "ts_tbl",
"callback": "combine_callbacks(transform_fun(set_val(TRUE)), ricu:::ts_to_win_tbl(mins(1L)))",
"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",
"dur_var": "drugstopoffset",
"class": "rgx_itm",
"callback": "transform_fun(set_val(TRUE))"
}
],
"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",
"target": "ts_tbl",
"callback": "combine_callbacks(transform_fun(set_val(TRUE)), ricu:::ts_to_win_tbl(mins(1L)))",
"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",
"dur_var": "drugstopoffset",
"class": "rgx_itm",
"callback": "transform_fun(set_val(TRUE))"
}
],
"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",
"target": "ts_tbl",
"callback": "combine_callbacks(transform_fun(set_val(TRUE)), ricu:::ts_to_win_tbl(mins(1L)))"
}
],
"miiv": [
{
"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",
"dur_var": "endtime",
"callback": "transform_fun(set_val(TRUE))"
}
],
"mimic": [
{
"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",
"dur_var": "endtime",
"callback": "transform_fun(set_val(TRUE))"
}
],
"mimic_demo": [
{
"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",
"dur_var": "endtime",
"callback": "transform_fun(set_val(TRUE))"
}
]
}
},
"adh_rate": {
"unit": [
"units/min",
Expand Down Expand Up @@ -510,6 +606,22 @@
"picdb": []
}
},
"adh_dur": {
"description": "vasopressin duration",
"category": "medications",
"aggregate": "max",
"sources": {
"hirid": [
{
"ids": [112, 113],
"table": "pharma",
"sub_var": "pharmaid",
"grp_var": "infusionid",
"callback": "hirid_duration"
}
]
}
},
"cort": {
"class": "lgl_cncpt",
"description": "corticosteroids",
Expand Down Expand Up @@ -1745,6 +1857,54 @@
"picdb": []
}
},
"levo_dur": {
"description": "levosimendan duration",
"category": "medications",
"aggregate": "max",
"sources": {
"hirid": [
{
"ids": 1000606,
"table": "pharma",
"sub_var": "pharmaid",
"grp_var": "infusionid",
"callback": "hirid_duration"
}
]
}
},
"milrin_dur": {
"description": "milrinone duration",
"category": "medications",
"aggregate": "max",
"sources": {
"hirid": [
{
"ids": 1000441,
"table": "pharma",
"sub_var": "pharmaid",
"grp_var": "infusionid",
"callback": "hirid_duration"
}
]
}
},
"teophyllin_dur": {
"description": "theophyllin duration",
"category": "medications",
"aggregate": "max",
"sources": {
"hirid": [
{
"ids": [1000706, 1000707, 1000698, 1000267],
"table": "pharma",
"sub_var": "pharmaid",
"grp_var": "infusionid",
"callback": "hirid_duration"
}
]
}
},
"phn_rate": {
"unit": "mcg/kg/min",
"description": "phenylephrine rate",
Expand Down Expand Up @@ -1841,5 +2001,13 @@
"category": "medications",
"callback": "vaso_ind",
"class": "rec_cncpt"
},
"cf_treat": {
"description": "treatment for circulatory failure (vasopressors/inotropes)",
"category": "medications",
"concepts": ["epi_dur", "norepi_dur", "dopa_dur", "dobu_dur", "adh_dur",
"phn_dur", "levo_dur", "milrin_dur", "teophyllin_dur"],
"callback": "cf_treat",
"class": "rec_cncpt"
}
}
Loading

0 comments on commit 5f0a684

Please sign in to comment.