Skip to content

Commit 5176905

Browse files
committed
add poe_id to schema for prescriptions
1 parent 7101f2e commit 5176905

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

mimic-iv/buildmimic/duckdb/import_duckdb.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ fi
6868
# 1. Remove optional precision value from TIMESTAMP(NN) -> TIMESTAMP
6969
# duckdb does not support this.
7070
# 2. Remove NOT NULL constraint from mimic_hosp.microbiologyevents.spec_type_desc
71-
# as there is a null in the dataset.
71+
# as there is one (!) zero-length string which is treated as a NULL by the import.
7272
# 3. Remove NOT NULL constraint from mimic_hosp.prescriptions.drug
73-
# as there is a null in the dataset.
73+
# as there are zero-length strings which are treated as NULLs by the import.
7474
try duckdb "$OUTFILE" <<EOSQL
7575
-------------------------------------------
7676
-- Create the tables and MIMIC-IV schema --
@@ -378,6 +378,8 @@ CREATE TABLE mimic_hosp.prescriptions
378378
subject_id INTEGER NOT NULL,
379379
hadm_id INTEGER NOT NULL,
380380
pharmacy_id INTEGER NOT NULL,
381+
poe_id INTEGER,
382+
poe_seq INTEGER,
381383
starttime TIMESTAMP,
382384
stoptime TIMESTAMP,
383385
drug_type VARCHAR(20) NOT NULL,

0 commit comments

Comments
 (0)