Skip to content

Commit

Permalink
Addresses cdm proposal #84
Browse files Browse the repository at this point in the history
  • Loading branch information
clairblacketer committed Jul 14, 2017
1 parent 17d0bfc commit 19150d2
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 6 deletions.
4 changes: 3 additions & 1 deletion Impala/OMOP_CDM_ddl_Impala.sql
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,9 @@ CREATE TABLE condition_occurrence (
provider_id INTEGER,
visit_occurrence_id INTEGER,
condition_source_value VARCHAR(50),
condition_source_concept_id INTEGER
condition_source_concept_id INTEGER,
condition_status_source_value VARCHAR(50),
condition_status_concept_id INTEGER
)
ROW FORMAT DELIMITED FIELDS TERMINATED BY ','
TBLPROPERTIES ("skip.header.line.count"="1")
Expand Down
4 changes: 3 additions & 1 deletion Impala/OMOP_Parquet_v5.2.sql
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,9 @@ SELECT
provider_id,
visit_occurrence_id,
condition_source_value,
condition_source_concept_id
condition_source_concept_id,
condition_status_source_value,
condition_status_concept_id
FROM omop_cdm.condition_occurrence;

CREATE TABLE omop_cdm_parquet.measurement
Expand Down
2 changes: 2 additions & 0 deletions Oracle/OMOP CDM constraints - Oracle.sql
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,8 @@ ALTER TABLE condition_occurrence ADD CONSTRAINT fpk_condition_visit FOREIGN KEY

ALTER TABLE condition_occurrence ADD CONSTRAINT fpk_condition_concept_s FOREIGN KEY (condition_source_concept_id) REFERENCES concept (concept_id);

ALTER TABLE condition_occurrence ADD CONSTRAINT fpk_condition_status_concept FOREIGN KEY (condition_status_concept_id) REFERENCES concept (concept_id);


ALTER TABLE measurement ADD CONSTRAINT fpk_measurement_person FOREIGN KEY (person_id) REFERENCES person (person_id);

Expand Down
4 changes: 3 additions & 1 deletion Oracle/OMOP CDM ddl - Oracle.sql
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,9 @@ CREATE TABLE condition_occurrence
provider_id INTEGER NULL ,
visit_occurrence_id INTEGER NULL ,
condition_source_value VARCHAR(50) NULL ,
condition_source_concept_id INTEGER NULL
condition_source_concept_id INTEGER NULL ,
condition_status_source_value VARCHAR(50) NULL ,
condition_status_concept_id INTEGER NULL
)
;

Expand Down
2 changes: 2 additions & 0 deletions PostgreSQL/OMOP CDM constraints - PostgreSQL.sql
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,8 @@ ALTER TABLE condition_occurrence ADD CONSTRAINT fpk_condition_visit FOREIGN KEY

ALTER TABLE condition_occurrence ADD CONSTRAINT fpk_condition_concept_s FOREIGN KEY (condition_source_concept_id) REFERENCES concept (concept_id);

ALTER TABLE condition_occurrence ADD CONSTRAINT fpk_condition_status_concept FOREIGN KEY (condition_status_concept_id) REFERENCES concept (concept_id);


ALTER TABLE measurement ADD CONSTRAINT fpk_measurement_person FOREIGN KEY (person_id) REFERENCES person (person_id);

Expand Down
4 changes: 3 additions & 1 deletion PostgreSQL/OMOP CDM ddl - PostgreSQL.sql
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,9 @@ CREATE TABLE condition_occurrence
provider_id INTEGER NULL ,
visit_occurrence_id INTEGER NULL ,
condition_source_value VARCHAR(50) NULL ,
condition_source_concept_id INTEGER NULL
condition_source_concept_id INTEGER NULL ,
condition_status_source_value VARCHAR(50) NULL ,
condition_status_concept_id INTEGER NULL
)
;

Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,16 @@ 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
* [#75] (https://github.com/OHDSI/CommonDataModel/issues/75) Adds the field BOX_SIZE to DRUG_STRENGTH
* [#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
* [#84](https://github.com/OHDSI/CommonDataModel/issues/84) Adds the following fields to CONDITION_OCCURRENCE:
* CONDITION_STATUS_CONCEPT_ID
* CONDITION_STATUS_SOURCE_VALUE

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:

Expand Down
2 changes: 2 additions & 0 deletions Sql Server/OMOP CDM constraints - SQL Server.sql
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,8 @@ ALTER TABLE condition_occurrence ADD CONSTRAINT fpk_condition_visit FOREIGN KEY

ALTER TABLE condition_occurrence ADD CONSTRAINT fpk_condition_concept_s FOREIGN KEY (condition_source_concept_id) REFERENCES concept (concept_id);

ALTER TABLE condition_occurrence ADD CONSTRAINT fpk_condition_status_concept FOREIGN KEY (condition_status_concept_id) REFERENCES concept (concept_id);


ALTER TABLE measurement ADD CONSTRAINT fpk_measurement_person FOREIGN KEY (person_id) REFERENCES person (person_id);

Expand Down
4 changes: 3 additions & 1 deletion Sql Server/OMOP CDM ddl - SQL Server.sql
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,9 @@ CREATE TABLE condition_occurrence
provider_id INTEGER NULL ,
visit_occurrence_id INTEGER NULL ,
condition_source_value VARCHAR(50) NULL ,
condition_source_concept_id INTEGER NULL
condition_source_concept_id INTEGER NULL ,
condition_status_source_value VARCHAR(50) NULL ,
condition_status_concept_id INTEGER NULL
)
;

Expand Down

0 comments on commit 19150d2

Please sign in to comment.