Skip to content

Commit c839ccb

Browse files
committed
add poe_id/poe_seq to prescriptions schema
1 parent 5176905 commit c839ccb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

mimic-iv/buildmimic/mysql/load.sql

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -860,6 +860,8 @@ CREATE TABLE prescriptions ( -- rows=17021399
860860
subject_id INT UNSIGNED NOT NULL,
861861
hadm_id INT UNSIGNED NOT NULL,
862862
pharmacy_id INT UNSIGNED NOT NULL,
863+
poe_id INT UNSIGNED,
864+
poe_seq INT UNSIGNED,
863865
starttime DATETIME,
864866
stoptime DATETIME,
865867
drug_type VARCHAR(255) NOT NULL, -- max=8
@@ -882,11 +884,13 @@ LOAD DATA LOCAL INFILE 'prescriptions.csv' INTO TABLE prescriptions
882884
FIELDS TERMINATED BY ',' ESCAPED BY '' OPTIONALLY ENCLOSED BY '"'
883885
LINES TERMINATED BY '\n'
884886
IGNORE 1 LINES
885-
(@subject_id,@hadm_id,@pharmacy_id,@starttime,@stoptime,@drug_type,@drug,@formulary_drug_cd,@gsn,@ndc,@prod_strength,@form_rx,@dose_val_rx,@dose_unit_rx,@form_val_disp,@form_unit_disp,@doses_per_24_hrs,@route)
887+
(@subject_id,@hadm_id,@pharmacy_id,@poe_id,@poe_seq,@starttime,@stoptime,@drug_type,@drug,@formulary_drug_cd,@gsn,@ndc,@prod_strength,@form_rx,@dose_val_rx,@dose_unit_rx,@form_val_disp,@form_unit_disp,@doses_per_24_hrs,@route)
886888
SET
887889
subject_id = trim(@subject_id),
888890
hadm_id = trim(@hadm_id),
889891
pharmacy_id = trim(@pharmacy_id),
892+
poe_id = trim(@poe_id),
893+
poe_seq = trim(@poe_seq),
890894
starttime = IF(@starttime='', NULL, trim(@starttime)),
891895
stoptime = IF(@stoptime='', NULL, trim(@stoptime)),
892896
drug_type = trim(@drug_type),

0 commit comments

Comments
 (0)