 DROP TABLE IF EXISTS mimic_ed.pyxis CASCADE;
 CREATE TABLE mimic_ed.pyxis
 (
-  subject_id INT NOT NULL,
-  stay_id INT NOT NULL,
-  charttime TIMESTAMP(0) NOT NULL,
-  med_rn INT NOT NULL,
-  name VARCHAR(255) NOT NULL,
-  gsn_rn INT NOT NULL,
-  gsn VARCHAR(6)
+  subject_id INTEGER NOT NULL,
+  stay_id INTEGER NOT NULL,
+  charttime TIMESTAMP(0),
+  med_rn SMALLINT NOT NULL,
+  name VARCHAR(255),
+  gsn_rn SMALLINT NOT NULL,
+  gsn VARCHAR(10)
 ) ;
 
 --------------------------------------------------------

DROP TABLE IF EXISTS mimic_ed.diagnosis CASCADE;
CREATE TABLE mimic_ed.diagnosis
(
  subject_id INT NOT NULL,
  stay_id INT NOT NULL,
  seq_num INT NOT NULL,
  icd_code VARCHAR(10) NOT NULL,
  icd_version INT NOT NULL,
  icd_title VARCHAR(255) NOT NULL
) ;

--------------------------------------------------------

DROP TABLE IF EXISTS mimic_ed.vitalsign CASCADE;
CREATE TABLE mimic_ed.vitalsign
(
  subject_id INTEGER NOT NULL,
  stay_id INTEGER NOT NULL,
  charttime TIMESTAMP(0),
  temperature NUMERIC,
  heartrate NUMERIC,
  resprate NUMERIC(10, 4),
  o2sat NUMERIC,
  sbp INTEGER,
  dbp INTEGER,
  rhythm TEXT,
  pain TEXT
);
