diff --git a/Impala/OMOP_CDM_ddl_Impala.sql b/Impala/OMOP_CDM_ddl_Impala.sql index d442a6d..6f2a881 100644 --- a/Impala/OMOP_CDM_ddl_Impala.sql +++ b/Impala/OMOP_CDM_ddl_Impala.sql @@ -330,7 +330,12 @@ CREATE TABLE visit_occurrence ( provider_id INTEGER, care_site_id INTEGER, visit_source_value VARCHAR(50), - visit_source_concept_id INTEGER + visit_source_concept_id INTEGER, + admitting_source_concept_id INTEGER, + admitting_source_value VARCHAR(50), + discharge_to_concept_id INTEGER(50), + discharge_to_source_value VARCHAR(50), + preceding_visit_occurrence_id INTEGER ) ROW FORMAT DELIMITED FIELDS TERMINATED BY ',' TBLPROPERTIES ("skip.header.line.count"="1") diff --git a/Impala/OMOP_Parquet_v5.2.sql b/Impala/OMOP_Parquet_v5.2.sql index d84a36b..83c17e5 100644 --- a/Impala/OMOP_Parquet_v5.2.sql +++ b/Impala/OMOP_Parquet_v5.2.sql @@ -213,7 +213,12 @@ SELECT provider_id, care_site_id, visit_source_value, - visit_source_concept_id + visit_source_concept_id, + admitting_source_concept_id, + admitting_source_value, + discharge_to_concept_id, + discharge_to_source_value, + preceding_visit_occurrence_id FROM omop_cdm.visit_occurrence; CREATE TABLE omop_cdm_parquet.procedure_occurrence diff --git a/Oracle/OMOP CDM constraints - Oracle.sql b/Oracle/OMOP CDM constraints - Oracle.sql index 2617a69..b211730 100644 --- a/Oracle/OMOP CDM constraints - Oracle.sql +++ b/Oracle/OMOP CDM constraints - Oracle.sql @@ -323,6 +323,10 @@ ALTER TABLE visit_occurrence ADD CONSTRAINT fpk_visit_care_site FOREIGN KEY (car ALTER TABLE visit_occurrence ADD CONSTRAINT fpk_visit_concept_s FOREIGN KEY (visit_source_concept_id) REFERENCES concept (concept_id); +ALTER TABLE visit_occurrence ADD CONSTRAINT fpk_visit_admitting_s FOREIGN KEY (admitting_source_concept_id) REFERENCES concept (concept_id); + +ALTER TABLE visit_occurrence ADD CONSTRAINT fpk_visit_discharge FOREIGN KEY (discharge_to_concept_id) REFERENCES concept (concept_id); + ALTER TABLE procedure_occurrence ADD CONSTRAINT fpk_procedure_person FOREIGN KEY (person_id) REFERENCES person (person_id); diff --git a/Oracle/OMOP CDM ddl - Oracle.sql b/Oracle/OMOP CDM ddl - Oracle.sql index 2a6d434..d8cc713 100644 --- a/Oracle/OMOP CDM ddl - Oracle.sql +++ b/Oracle/OMOP CDM ddl - Oracle.sql @@ -312,7 +312,12 @@ CREATE TABLE visit_occurrence provider_id INTEGER NULL, care_site_id INTEGER NULL, visit_source_value VARCHAR(50) NULL, - visit_source_concept_id INTEGER NULL + visit_source_concept_id INTEGER NULL, + admitting_source_concept_id INTEGER NULL , + admitting_source_value VARCHAR(50) NULL , + discharge_to_concept_id INTEGER(50) NULL , + discharge_to_source_value VARCHAR(50) NULL , + preceding_visit_occurrence_id INTEGER NULL ) ; diff --git a/PostgreSQL/OMOP CDM constraints - PostgreSQL.sql b/PostgreSQL/OMOP CDM constraints - PostgreSQL.sql index bb960a6..d5405d9 100644 --- a/PostgreSQL/OMOP CDM constraints - PostgreSQL.sql +++ b/PostgreSQL/OMOP CDM constraints - PostgreSQL.sql @@ -322,6 +322,10 @@ ALTER TABLE visit_occurrence ADD CONSTRAINT fpk_visit_care_site FOREIGN KEY (car ALTER TABLE visit_occurrence ADD CONSTRAINT fpk_visit_concept_s FOREIGN KEY (visit_source_concept_id) REFERENCES concept (concept_id); +ALTER TABLE visit_occurrence ADD CONSTRAINT fpk_visit_admitting_s FOREIGN KEY (admitting_source_concept_id) REFERENCES concept (concept_id); + +ALTER TABLE visit_occurrence ADD CONSTRAINT fpk_visit_discharge FOREIGN KEY (discharge_to_concept_id) REFERENCES concept (concept_id); + ALTER TABLE procedure_occurrence ADD CONSTRAINT fpk_procedure_person FOREIGN KEY (person_id) REFERENCES person (person_id); diff --git a/PostgreSQL/OMOP CDM ddl - PostgreSQL.sql b/PostgreSQL/OMOP CDM ddl - PostgreSQL.sql index 790ce1a..39cc4cd 100644 --- a/PostgreSQL/OMOP CDM ddl - PostgreSQL.sql +++ b/PostgreSQL/OMOP CDM ddl - PostgreSQL.sql @@ -305,14 +305,19 @@ CREATE TABLE visit_occurrence person_id INTEGER NOT NULL , visit_concept_id INTEGER NOT NULL , visit_start_date DATE NOT NULL , - visit_start_datetime TIMESTAMP NULL , + visit_start_datetime TIMESTAMP NULL , visit_end_date DATE NOT NULL , - visit_end_datetime TIMESTAMP NULL , + visit_end_datetime TIMESTAMP NULL , visit_type_concept_id INTEGER NOT NULL , provider_id INTEGER NULL, care_site_id INTEGER NULL, visit_source_value VARCHAR(50) NULL, - visit_source_concept_id INTEGER NULL + visit_source_concept_id INTEGER NULL , + admitting_source_concept_id INTEGER NULL , + admitting_source_value VARCHAR(50) NULL , + discharge_to_concept_id INTEGER(50) NULL , + discharge_to_source_value VARCHAR(50) NULL , + preceding_visit_occurrence_id INTEGER NULL ) ; diff --git a/README.md b/README.md index 0d54b9c..087ec34 100644 --- a/README.md +++ b/README.md @@ -7,11 +7,17 @@ See full CDM specification file on our github [wiki](https://github.com/OHDSI/Co Release Notes for v5.2.0 ============= This version is based on the CDM working group proposals: -* [#71](https://github.com/OHDSI/CommonDataModel/issues/71) - * Adds the field VERBATIM_END_DATE to DRUG_EXPOSURE and makes DRUG_EXPOSURE_END_DATE a required field -* [#73](https://github.com/OHDSI/CommonDataModel/issues/73) - * Removes EFFECTIVE_DRUG_DOSE and DOSE_UNIT_CONCEPT_ID from DRUG_EXPOSURE -and is **backwards compatibile with v5.0.1**. The proposed and accepted changes include adding a datetime field to every table that had a date column and adding field DENOMINATOR_VALUE to the DRUG_STRENGTH table. These were the new columns added: +* [#71](https://github.com/OHDSI/CommonDataModel/issues/71) Adds the field VERBATIM_END_DATE to DRUG_EXPOSURE and makes DRUG_EXPOSURE_END_DATE a required field +* [#73](https://github.com/OHDSI/CommonDataModel/issues/73) Removes EFFECTIVE_DRUG_DOSE and DOSE_UNIT_CONCEPT_ID from DRUG_EXPOSURE +* [#75] (https://github.com/OHDSI/CommonDataModel/issues/75) Adds the field BOX_SIZE to DRUG_STRENGTH +* [#83](https://github.com/OHDSI/CommonDataModel/issues/83) Adds the following fields to VISIT_OCCURRENCE: + * ADMITTING_SOURCE_CONCEPT_ID + * ADMITTING_SOURCE_VALUE + * DISCHARGE_TO_CONCEPT_ID + * DISCHARGE_TO_SOURCE_VALUE + * PRECEDING_VISIT_OCCURRENCE_ID + + and is **backwards compatibile with v5.0.1**. The proposed and accepted changes include adding a datetime field to every table that had a date column and adding field DENOMINATOR_VALUE to the DRUG_STRENGTH table. These were the new columns added: --------- diff --git a/Sql Server/OMOP CDM constraints - SQL Server.sql b/Sql Server/OMOP CDM constraints - SQL Server.sql index 90c3378..b0c5754 100644 --- a/Sql Server/OMOP CDM constraints - SQL Server.sql +++ b/Sql Server/OMOP CDM constraints - SQL Server.sql @@ -322,6 +322,10 @@ ALTER TABLE visit_occurrence ADD CONSTRAINT fpk_visit_care_site FOREIGN KEY (car ALTER TABLE visit_occurrence ADD CONSTRAINT fpk_visit_concept_s FOREIGN KEY (visit_source_concept_id) REFERENCES concept (concept_id); +ALTER TABLE visit_occurrence ADD CONSTRAINT fpk_visit_admitting_s FOREIGN KEY (admitting_source_concept_id) REFERENCES concept (concept_id); + +ALTER TABLE visit_occurrence ADD CONSTRAINT fpk_visit_discharge FOREIGN KEY (discharge_to_concept_id) REFERENCES concept (concept_id); + ALTER TABLE procedure_occurrence ADD CONSTRAINT fpk_procedure_person FOREIGN KEY (person_id) REFERENCES person (person_id); diff --git a/Sql Server/OMOP CDM ddl - SQL Server.sql b/Sql Server/OMOP CDM ddl - SQL Server.sql index 67f2109..16e5e4a 100644 --- a/Sql Server/OMOP CDM ddl - SQL Server.sql +++ b/Sql Server/OMOP CDM ddl - SQL Server.sql @@ -313,6 +313,11 @@ CREATE TABLE visit_occurrence care_site_id INTEGER NULL, visit_source_value VARCHAR(50) NULL, visit_source_concept_id INTEGER NULL + admitting_source_concept_id INTEGER NULL , + admitting_source_value VARCHAR(50) NULL , + discharge_to_concept_id INTEGER(50) NULL , + discharge_to_source_value VARCHAR(50) NULL , + preceding_visit_occurrence_id INTEGER NULL ) ;