| 105 | | |
| | 106 | === CRC Cell: DDL for Table observation_fact === |
| | 107 | The fact table of the i2b2 star schema: represents |
| | 108 | the intersection of the dimension tables. Each row describes one observation about a |
| | 109 | patient made during a visit. Most queries in the i2b2 database require joining the |
| | 110 | observation_fact table with one or more dimension tables together. |
| | 111 | {{{ |
| | 112 | -- ORACLE -- |
| | 113 | CREATE TABLE OBSERVATION_FACT ( |
| | 114 | ENCOUNTER_NUM NUMBER(38,0) NOT NULL, |
| | 115 | PATIENT_NUM NUMBER(38,0) NOT NULL, |
| | 116 | CONCEPT_CD VARCHAR2(50) NOT NULL, |
| | 117 | PROVIDER_ID VARCHAR2(50) NOT NULL, |
| | 118 | START_DATE DATE NOT NULL, |
| | 119 | MODIFIER_CD VARCHAR2(100) NOT NULL, |
| | 120 | VALTYPE_CD VARCHAR2(50) NULL, |
| | 121 | TVAL_CHAR VARCHAR2(255) NULL, |
| | 122 | NVAL_NUM NUMBER(18,5) NULL, |
| | 123 | VALUEFLAG_CD VARCHAR2(50) NULL, |
| | 124 | QUANTITY_NUM NUMBER(18,5) NULL, |
| | 125 | INSTANCE_NUM NUMBER(18,0) NULL, |
| | 126 | UNITS_CD VARCHAR2(50) NULL, |
| | 127 | END_DATE DATE NULL, |
| | 128 | LOCATION_CD VARCHAR2(50) NULL, |
| | 129 | CONFIDENCE_NUM NUMBER(18,5) NULL, |
| | 130 | OBSERVATION_BLOB CLOB NULL, |
| | 131 | UPDATE_DATE DATE NULL, |
| | 132 | DOWNLOAD_DATE DATE NULL, |
| | 133 | IMPORT_DATE DATE NULL, |
| | 134 | SOURCESYSTEM_CD VARCHAR2(50) NULL, |
| | 135 | UPLOAD_ID NUMBER(38,0) NULL, |
| | 136 | CONSTRAINT OBSERVATION_FACT_PK PRIMARY KEY(ENCOUNTER_NUM,CONCEPT_CD,PROVIDER_ID,START_DATE,MODIFIER_CD) |
| | 137 | ) ; |
| | 138 | }}} |