From 8be1708769bce6fbd11aaa362ed632397b403b74 Mon Sep 17 00:00:00 2001 From: clairblacketer Date: Thu, 16 Nov 2017 12:19:22 -0500 Subject: [PATCH] Small changes to align documentation and DDL --- .../sql/sql_server/OMOP CDM constraints.sql | 42 ++++++++++++++++++ .../inst/sql/sql_server/OMOP CDM ddl.sql | 2 +- .../sql_server/OMOP CDM indexes required.sql | 33 +++++++------- .../StandardizedClinicalDataTables/NOTE.md | 23 +++++----- .../NOTE_NLP.md | 28 ++++++------ .../OBSERVATION.md | 6 +-- .../VISIT_DETAIL.md | 36 +++++++-------- .../VISIT_DETAIL_CB.md | 32 -------------- .../VISIT_OCCURRENCE.md | 8 ++-- .../COST.md | 44 +++++++++---------- .../PAYER_PLAN_PERIOD.md | 27 ++++++++---- .../PROVIDER.md | 2 +- 12 files changed, 153 insertions(+), 130 deletions(-) delete mode 100644 Documentation/CommonDataModel_Wiki_Files/StandardizedClinicalDataTables/VISIT_DETAIL_CB.md diff --git a/DDLGeneratr/inst/sql/sql_server/OMOP CDM constraints.sql b/DDLGeneratr/inst/sql/sql_server/OMOP CDM constraints.sql index f7c9552..0fb138b 100644 --- a/DDLGeneratr/inst/sql/sql_server/OMOP CDM constraints.sql +++ b/DDLGeneratr/inst/sql/sql_server/OMOP CDM constraints.sql @@ -114,6 +114,8 @@ ALTER TABLE death ADD CONSTRAINT xpk_death PRIMARY KEY NONCLUSTERED ( person_id ALTER TABLE visit_occurrence ADD CONSTRAINT xpk_visit_occurrence PRIMARY KEY NONCLUSTERED ( visit_occurrence_id ) ; +ALTER TABLE visit_detail ADD CONSTRAINT xpk_visit_detail PRIMARY KEY NONCLUSTERED ( visit_detail_id ) ; + ALTER TABLE procedure_occurrence ADD CONSTRAINT xpk_procedure_occurrence PRIMARY KEY NONCLUSTERED ( procedure_occurrence_id ) ; ALTER TABLE drug_exposure ADD CONSTRAINT xpk_drug_exposure PRIMARY KEY NONCLUSTERED ( drug_exposure_id ) ; @@ -328,6 +330,31 @@ ALTER TABLE visit_occurrence ADD CONSTRAINT fpk_visit_admitting_s FOREIGN KEY (a ALTER TABLE visit_occurrence ADD CONSTRAINT fpk_visit_discharge FOREIGN KEY (discharge_to_concept_id) REFERENCES concept (concept_id); +ALTER TABLE visit_occurrence ADD CONSTRAINT fpk_visit_preceding FOREIGN KEY (preceding_visit_occurrence_id) REFERENCES visit_occurrence (visit_occurrence_id); + + +ALTER TABLE visit_detail ADD CONSTRAINT fpk_v_detail_person FOREIGN KEY (person_id) REFERENCES person (person_id); + +ALTER TABLE visit_detail ADD CONSTRAINT fpk_v_detail_concept FOREIGN KEY (visit_concept_id) REFERENCES concept (concept_id); + +ALTER TABLE visit_detail ADD CONSTRAINT fpk_v_detail_type_concept FOREIGN KEY (visit_type_concept_id) REFERENCES concept (concept_id); + +ALTER TABLE visit_detail ADD CONSTRAINT fpk_v_detail_provider FOREIGN KEY (provider_id) REFERENCES provider (provider_id); + +ALTER TABLE visit_detail ADD CONSTRAINT fpk_v_detail_care_site FOREIGN KEY (care_site_id) REFERENCES care_site (care_site_id); + +ALTER TABLE visit_detail ADD CONSTRAINT fpk_v_detail_concept_s FOREIGN KEY (visit_source_concept_id) REFERENCES concept (concept_id); + +ALTER TABLE visit_detail ADD CONSTRAINT fpk_v_detail_admitting_s FOREIGN KEY (admitting_source_concept_id) REFERENCES concept (concept_id); + +ALTER TABLE visit_detail ADD CONSTRAINT fpk_v_detail_discharge FOREIGN KEY (discharge_to_concept_id) REFERENCES concept (concept_id); + +ALTER TABLE visit_detail ADD CONSTRAINT fpk_v_detail_preceding FOREIGN KEY (preceding_visit_detail_id) REFERENCES visit_detail (visit_detail_id); + +ALTER TABLE visit_detail ADD CONSTRAINT fpk_v_detail_parent FOREIGN KEY (visit_detail_parent_id) REFERENCES visit_detail (visit_detail_id); + +ALTER TABLE visit_detail ADD CONSTRAINT fpd_v_detail_visit FOREIGN KEY (visit_occurrence_id) REFERENCES visit_occurrence (visit_occurrence_id); + ALTER TABLE procedure_occurrence ADD CONSTRAINT fpk_procedure_person FOREIGN KEY (person_id) REFERENCES person (person_id); @@ -526,3 +553,18 @@ ALTER TABLE dose_era ADD CONSTRAINT fpk_dose_era_unit_concept FOREIGN KEY (unit_ ALTER TABLE condition_era ADD CONSTRAINT fpk_condition_era_person FOREIGN KEY (person_id) REFERENCES person (person_id); ALTER TABLE condition_era ADD CONSTRAINT fpk_condition_era_concept FOREIGN KEY (condition_concept_id) REFERENCES concept (concept_id); + + +/************************ +************************* +************************* +************************* + +Unique constraints + +************************* +************************* +************************* +************************/ + +ALTER TABLE concept_synonym ADD CONSTRAINT uq_concept_synonym UNIQUE (concept_id, concept_synonym_name, language_concept_id); diff --git a/DDLGeneratr/inst/sql/sql_server/OMOP CDM ddl.sql b/DDLGeneratr/inst/sql/sql_server/OMOP CDM ddl.sql index 08e5e35..adb97df 100644 --- a/DDLGeneratr/inst/sql/sql_server/OMOP CDM ddl.sql +++ b/DDLGeneratr/inst/sql/sql_server/OMOP CDM ddl.sql @@ -676,9 +676,9 @@ CREATE TABLE cohort CREATE TABLE cohort_attribute ( cohort_definition_id INTEGER NOT NULL , + subject_id INTEGER NOT NULL , cohort_start_date DATE NOT NULL , cohort_end_date DATE NOT NULL , - subject_id INTEGER NOT NULL , attribute_definition_id INTEGER NOT NULL , value_as_number FLOAT NULL , value_as_concept_id INTEGER NULL diff --git a/DDLGeneratr/inst/sql/sql_server/OMOP CDM indexes required.sql b/DDLGeneratr/inst/sql/sql_server/OMOP CDM indexes required.sql index 14d49ee..7ed41c2 100644 --- a/DDLGeneratr/inst/sql/sql_server/OMOP CDM indexes required.sql +++ b/DDLGeneratr/inst/sql/sql_server/OMOP CDM indexes required.sql @@ -1,13 +1,13 @@ /********************************************************************************* # Copyright 2014 Observational Health Data Sciences and Informatics # -# +# # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at -# +# # http://www.apache.org/licenses/LICENSE-2.0 -# +# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -17,16 +17,16 @@ /************************ - ####### # # ####### ###### ##### ###### # # ####### ##### ### - # # ## ## # # # # # # # # ## ## # # # # # # # # ##### ###### # # ###### #### - # # # # # # # # # # # # # # # # # # # # # # ## # # # # # # # # - # # # # # # # ###### # # # # # # # # ###### ##### # # # # # # ##### ## ##### #### - # # # # # # # # # # # # # # # ### # # # # # # # # ## # # - # # # # # # # # # # # # # # # # # ### # # # # ## # # # # # # # # - ####### # # ####### # ##### ###### # # ## ##### ### ##### ### # # ##### ###### # # ###### #### - + ####### # # ####### ###### ##### ###### # # ####### ##### ### + # # ## ## # # # # # # # # ## ## # # # # # # # # ##### ###### # # ###### #### + # # # # # # # # # # # # # # # # # # # # # # ## # # # # # # # # + # # # # # # # ###### # # # # # # # # ###### ##### # # # # # # ##### ## ##### #### + # # # # # # # # # # # # # # # ### # # # # # # # # ## # # + # # # # # # # # # # # # # # # # # ### # # # # ## # # # # # # # # + ####### # # ####### # ##### ###### # # ## ##### ### ##### ### # # ##### ###### # # ###### #### -@targetdialect script to create the required indexes within OMOP common data model, version 5.3 + +@targetdialect script to create the required indexes within OMOP common data model, version 5.3 last revised: 14-November-2017 @@ -55,9 +55,9 @@ CREATE UNIQUE CLUSTERED INDEX idx_domain_domain_id ON domain (domain_id ASC); CREATE UNIQUE CLUSTERED INDEX idx_concept_class_class_id ON concept_class (concept_class_id ASC); -CREATE INDEX idx_concept_relationship_id_1 ON concept_relationship (concept_id_1 ASC); -CREATE INDEX idx_concept_relationship_id_2 ON concept_relationship (concept_id_2 ASC); -CREATE INDEX idx_concept_relationship_id_3 ON concept_relationship (relationship_id ASC); +CREATE INDEX idx_concept_relationship_id_1 ON concept_relationship (concept_id_1 ASC); +CREATE INDEX idx_concept_relationship_id_2 ON concept_relationship (concept_id_2 ASC); +CREATE INDEX idx_concept_relationship_id_3 ON concept_relationship (relationship_id ASC); CREATE UNIQUE CLUSTERED INDEX idx_relationship_rel_id ON relationship (relationship_id ASC); @@ -107,6 +107,9 @@ CREATE CLUSTERED INDEX idx_death_person_id ON death (person_id ASC); CREATE CLUSTERED INDEX idx_visit_person_id ON visit_occurrence (person_id ASC); CREATE INDEX idx_visit_concept_id ON visit_occurrence (visit_concept_id ASC); +CREATE CLUSTERED INDEX idx_visit_detail_person_id ON visit_detail (person_id ASC); +CREATE INDEX idx_visit_detail_concept_id ON visit_detail (visit_detail_concept_id ASC); + CREATE CLUSTERED INDEX idx_procedure_person_id ON procedure_occurrence (person_id ASC); CREATE INDEX idx_procedure_concept_id ON procedure_occurrence (procedure_concept_id ASC); CREATE INDEX idx_procedure_visit_id ON procedure_occurrence (visit_occurrence_id ASC); diff --git a/Documentation/CommonDataModel_Wiki_Files/StandardizedClinicalDataTables/NOTE.md b/Documentation/CommonDataModel_Wiki_Files/StandardizedClinicalDataTables/NOTE.md index d03178d..e639113 100644 --- a/Documentation/CommonDataModel_Wiki_Files/StandardizedClinicalDataTables/NOTE.md +++ b/Documentation/CommonDataModel_Wiki_Files/StandardizedClinicalDataTables/NOTE.md @@ -2,19 +2,20 @@ The NOTE table captures unstructured information that was recorded by a provider Field|Required|Type|Description :--------------------|:--------|:------------|:-------------------------------------------------------- -|note_id|Yes|integer|A unique identifier for each note.| -|person_id|Yes|integer|A foreign key identifier to the Person about whom the Note was recorded. The demographic details of that Person are stored in the PERSON table.| -|note_date |Yes|date|The date the note was recorded.| -|note_datetime|No|datetime|The date and time the note was recorded.| -|note_type_concept_id|Yes|integer|A foreign key to the predefined Concept in the Standardized Vocabularies reflecting the type, origin or provenance of the Note.| -|note_class_concept_id| Yes| integer| A foreign key to the predefined Concept in the Standardized Vocabularies reflecting the HL7 LOINC Document Type Vocabulary classification of the note.| -|note_title |No| varchar(250)| The title of the Note as it appears in the source.| -|note_text|Yes|RBDMS dependent text|The content of the Note.| +|note_id |Yes|integer|A unique identifier for each note.| +|person_id |Yes|integer|A foreign key identifier to the Person about whom the Note was recorded. The demographic details of that Person are stored in the PERSON table.| +|note_date |Yes|date|The date the note was recorded.| +|note_datetime |No|datetime|The date and time the note was recorded.| +|note_type_concept_id |Yes|integer|A foreign key to the predefined Concept in the Standardized Vocabularies reflecting the type, origin or provenance of the Note.| +|note_class_concept_id |Yes| integer| A foreign key to the predefined Concept in the Standardized Vocabularies reflecting the HL7 LOINC Document Type Vocabulary classification of the note.| +|note_title |No| varchar(250)| The title of the Note as it appears in the source.| +|note_text |Yes|varchar(MAX)|The content of the Note.| |encoding_concept_id |Yes |integer| A foreign key to the predefined Concept in the Standardized Vocabularies reflecting the note character encoding type| |language_concept_id |Yes |integer |A foreign key to the predefined Concept in the Standardized Vocabularies reflecting the language of the note| -|provider_id|No|integer|A foreign key to the Provider in the PROVIDER table who took the Note.| -|note_source_value|No|varchar(50)|The source value associated with the origin of the note| -|visit_occurrence_id|No|integer|Foreign key to the Visit in the VISIT_OCCURRENCE table when the Note was taken.| +|provider_id |No|integer|A foreign key to the Provider in the PROVIDER table who took the Note.| +|visit_occurrence_id |No|integer|A foreign key to the Visit in the VISIT_OCCURRENCE table when the Note was taken.| +|visit_detail_id |No|integer|A foreign key to the Visit in the VISIT_DETAIL table when the Note was taken.| +|note_source_value |No|varchar(50)|The source value associated with the origin of the Note| ### Conventions * The NOTE table contains free text (in ASCII, or preferably in UTF8 format) taken by a healthcare Provider. diff --git a/Documentation/CommonDataModel_Wiki_Files/StandardizedClinicalDataTables/NOTE_NLP.md b/Documentation/CommonDataModel_Wiki_Files/StandardizedClinicalDataTables/NOTE_NLP.md index cf53f30..0d7523f 100644 --- a/Documentation/CommonDataModel_Wiki_Files/StandardizedClinicalDataTables/NOTE_NLP.md +++ b/Documentation/CommonDataModel_Wiki_Files/StandardizedClinicalDataTables/NOTE_NLP.md @@ -2,20 +2,20 @@ The NOTE_NLP table will encode all output of NLP on clinical notes. Each row rep Field | Required | Type | Description :------------------------------- | :-------- | :------------ | :--------------------------------------------------- -note_nlp_id | Yes | Big Integer | A unique identifier for each term extracted from a note. -note_id | Yes | integer | A foreign key to the Note table note the term was extracted from. -section_concept_id | No | integer | A foreign key to the predefined Concept in the Standardized Vocabularies representing the section of the extracted term. -snippet | No | varchar(250) | A small window of text surrounding the term. -offset | No | varchar(50) | Character offset of the extracted term in the input note. -lexical_variant | Yes | varchar(250) | Raw text extracted from the NLP tool. -note_nlp_concept_id | No | integer | A foreign key to the predefined Concept in the Standardized Vocabularies reflecting the normalized concept for the extracted term. Domain of the term is represented as part of the Concept table. -note_nlp_source_concept_id | no | integer | A foreign key to a Concept that refers to the code in the source vocabulary used by the NLP system -nlp_system | No | varchar(250) | Name and version of the NLP system that extracted the term.Useful for data provenance. -nlp_date | Yes | date | The date of the note processing.Useful for data provenance. -nlp_date_time | No | datetime | The date and time of the note processing. Useful for data provenance. -term_exists | No | varchar(1) | A summary modifier that signifies presence or absence of the term for a given patient. Useful for quick querying. * -term_temporal | No | varchar(50) | An optional time modifier associated with the extracted term. (for now “past” or “present” only). Standardize it later. -term_modifiers | No | varchar(2000) | A compact description of all the modifiers of the specific term extracted by the NLP system. (e.g. “son has rash” ? “negated=no,subject=family, certainty=undef,conditional=false,general=false”). +note_nlp_id | Yes | integer | A unique identifier for each term extracted from a note. +note_id | Yes | integer | A foreign key to the Note table note the term was extracted from. +section_concept_id | No | integer | A foreign key to the predefined Concept in the Standardized Vocabularies representing the section of the extracted term. +snippet | No | varchar(250) | A small window of text surrounding the term. +offset | No | varchar(50) | Character offset of the extracted term in the input note. +lexical_variant | Yes | varchar(250) | Raw text extracted from the NLP tool. +note_nlp_concept_id | No | integer | A foreign key to the predefined Concept in the Standardized Vocabularies reflecting the normalized concept for the extracted term. Domain of the term is represented as part of the Concept table. +note_nlp_source_concept_id | No | integer | A foreign key to a Concept that refers to the code in the source vocabulary used by the NLP system +nlp_system | No | varchar(250) | Name and version of the NLP system that extracted the term.Useful for data provenance. +nlp_date | Yes | date | The date of the note processing.Useful for data provenance. +nlp_date_time | No | datetime | The date and time of the note processing. Useful for data provenance. +term_exists | No | varchar(1) | A summary modifier that signifies presence or absence of the term for a given patient. Useful for quick querying. * +term_temporal | No | varchar(50) | An optional time modifier associated with the extracted term. (for now “past” or “present” only). Standardize it later. +term_modifiers | No | varchar(2000) | A compact description of all the modifiers of the specific term extracted by the NLP system. (e.g. “son has rash” ? “negated=no,subject=family, certainty=undef,conditional=false,general=false”). ### Conventions diff --git a/Documentation/CommonDataModel_Wiki_Files/StandardizedClinicalDataTables/OBSERVATION.md b/Documentation/CommonDataModel_Wiki_Files/StandardizedClinicalDataTables/OBSERVATION.md index ef62a5a..45c4d15 100644 --- a/Documentation/CommonDataModel_Wiki_Files/StandardizedClinicalDataTables/OBSERVATION.md +++ b/Documentation/CommonDataModel_Wiki_Files/StandardizedClinicalDataTables/OBSERVATION.md @@ -2,9 +2,9 @@ The OBSERVATION table captures clinical facts about a Person obtained in the con Field|Required|Type|Description :----------------------------------|:--------|:------------|:------------------------------------ -|observation_id|Yes|integer|A unique identifier for each observation.| -|person_id|Yes|integer|A foreign key identifier to the Person about whom the observation was recorded. The demographic details of that Person are stored in the PERSON table.| -|observation_concept_id|Yes|integer|A foreign key to the standard observation concept identifier in the Standardized Vocabularies.| +|observation_id |Yes|integer|A unique identifier for each observation.| +|person_id |Yes|integer|A foreign key identifier to the Person about whom the observation was recorded. The demographic details of that Person are stored in the PERSON table.| +|observation_concept_id |Yes|integer|A foreign key to the standard observation concept identifier in the Standardized Vocabularies.| |observation_date|Yes|date|The date of the observation.| |observation_datetime|No|datetime|The date and time of the observation.| |observation_type_concept_id|Yes|integer|A foreign key to the predefined concept identifier in the Standardized Vocabularies reflecting the type of the observation.| diff --git a/Documentation/CommonDataModel_Wiki_Files/StandardizedClinicalDataTables/VISIT_DETAIL.md b/Documentation/CommonDataModel_Wiki_Files/StandardizedClinicalDataTables/VISIT_DETAIL.md index b3e9b31..e44c751 100644 --- a/Documentation/CommonDataModel_Wiki_Files/StandardizedClinicalDataTables/VISIT_DETAIL.md +++ b/Documentation/CommonDataModel_Wiki_Files/StandardizedClinicalDataTables/VISIT_DETAIL.md @@ -3,25 +3,25 @@ The VISIT_DETAIL table is an optional table used to represents details of each r Field|Required|Type|Description :------------------------|:--------|:-----|:------------------------------------------------- -|visit_detail_id|Yes|integer|A unique identifier for each Person's visit or encounter at a healthcare provider.| -|person_id|Yes|integer|A foreign key identifier to the Person for whom the visit is recorded. The demographic details of that Person are stored in the PERSON table.| -|visit_concept_id|Yes|integer|A foreign key that refers to a visit Concept identifier in the Standardized Vocabularies.| -|visit_start_date|Yes|date|The start date of the visit.| -|visit_start_datetime|No|datetime|The date and time of the visit started.| -|visit_end_date|Yes|date|The end date of the visit. If this is a one-day visit the end date should match the start date.| -|visit_end_datetime|No|datetime|The date and time of the visit end.| -|visit_type_concept_id|Yes|Integer|A foreign key to the predefined Concept identifier in the Standardized Vocabularies reflecting the type of source data from which the visit record is derived.| -|provider_id|No|integer|A foreign key to the provider in the provider table who was associated with the visit.| -|care_site_id|No|integer|A foreign key to the care site in the care site table that was visited.| -|visit_source_value|No|string(50)|The source code for the visit as it appears in the source data.| -|visit_source_concept_id|No|Integer|A foreign key to a Concept that refers to the code used in the source.| -|admitting_source_value |Varchar(50)| No| The source code for the admitting source as it appears in the source data.| -|admitting_source_concept_id| |Integer |No |A foreign key to the predefined concept in the Place of Service Vocabulary reflecting the admitting source for a visit.| -|discharge_to_source_value| Varchar(50)| No| The source code for the discharge disposition as it appears in the source data.| -|discharge_to_concept_id| Integer |No |A foreign key to the predefined concept in the Place of Service Vocabulary reflecting the discharge disposition for a visit.| +|visit_detail_id |Yes|integer|A unique identifier for each Person's visit or encounter at a healthcare provider.| +|person_id |Yes|integer|A foreign key identifier to the Person for whom the visit is recorded. The demographic details of that Person are stored in the PERSON table.| +|visit_concept_id |Yes|integer|A foreign key that refers to a visit Concept identifier in the Standardized Vocabularies.| +|visit_start_date |Yes|date|The start date of the visit.| +|visit_start_datetime |No|datetime|The date and time of the visit started.| +|visit_end_date |Yes|date|The end date of the visit. If this is a one-day visit the end date should match the start date.| +|visit_end_datetime |No|datetime|The date and time of the visit end.| +|visit_type_concept_id |Yes|Integer|A foreign key to the predefined Concept identifier in the Standardized Vocabularies reflecting the type of source data from which the visit record is derived.| +|provider_id |No|integer|A foreign key to the provider in the provider table who was associated with the visit.| +|care_site_id |No|integer|A foreign key to the care site in the care site table that was visited.| +|visit_source_value |No|string(50)|The source code for the visit as it appears in the source data.| +|visit_source_concept_id |No|Integer|A foreign key to a Concept that refers to the code used in the source.| +|admitting_source_value |Varchar(50)| No| The source code for the admitting source as it appears in the source data.| +|admitting_source_concept_id |Integer |No |A foreign key to the predefined concept in the Place of Service Vocabulary reflecting the admitting source for a visit.| +|discharge_to_source_value | Varchar(50)| No| The source code for the discharge disposition as it appears in the source data.| +|discharge_to_concept_id | Integer |No |A foreign key to the predefined concept in the Place of Service Vocabulary reflecting the discharge disposition for a visit.| |preceding_visit_detail_id |Integer| No |A foreign key to the VISIT_DETAIL table of the visit immediately preceding this visit| -|visit_detail_parent_id |Integer| No |A foreign key to the VISIT_DETAIL table record to represent the immediate parent visit-detail record.| -|visit_occurrence_id |Integer| Yes |A foreign key that refers to the record in the VISIT_OCCURRENCE table. This is a required field, because for every visit_detail is a child of visit_occurrence and cannot exist without a corresponding parent record in visit_occurrence.| +|visit_detail_parent_id |Integer| No |A foreign key to the VISIT_DETAIL table record to represent the immediate parent visit-detail record.| +|visit_occurrence_id |Integer| Yes |A foreign key that refers to the record in the VISIT_OCCURRENCE table. This is a required field, because for every visit_detail is a child of visit_occurrence and cannot exist without a corresponding parent record in visit_occurrence.| ### Conventions diff --git a/Documentation/CommonDataModel_Wiki_Files/StandardizedClinicalDataTables/VISIT_DETAIL_CB.md b/Documentation/CommonDataModel_Wiki_Files/StandardizedClinicalDataTables/VISIT_DETAIL_CB.md deleted file mode 100644 index c3da792..0000000 --- a/Documentation/CommonDataModel_Wiki_Files/StandardizedClinicalDataTables/VISIT_DETAIL_CB.md +++ /dev/null @@ -1,32 +0,0 @@ -The VISIT_DETAIL table contains detail information about a record in the VISIT_OCCURRENCE table. - -Field|Required|Type|Description -:------------------------|:--------|:-----|:------------------------------------------------- -| visit_detail_id| Yes| integer| A unique identifier for each Person's visit-detail at a healthcare provider.| -| person_id | Yes | integer | A foreign key identifier to the Person for whom the visit is recorded. The demographic details of that Person are stored in the PERSON table.| -| visit_detail_concept_id| Yes | integer | A foreign key that refers to a visit Concept identifier in the Standardized Vocabularies. | -| visit_start_date| Yes | date | The start date of the visit.| -| visit_start_datetime | Yes | datetime | The date and time of the visit-detail started.| -| visit_end_date| Yes | date | The end date of the visit.| -| visit_end_datetime | No | datetime | The date and time of the visit end.| -| visit_type_concept_id | Yes | integer | A foreign key to the predefined Concept identifier in the Standardized Vocabularies reflecting the type of source data from which the visit record is derived. | -| provider_id | No | integer | A foreign key to the provider in the provider table who was associated with the visit. | -| care_site_id | No | integer |A foreign key to the care site in the care site table where visit occurred | -| admitting_source_concept_id | No | integer | A foreign key to the predefined concept in the Place of Service Vocabulary reflecting the admitting source for a visit. | -| discharge_to_concept_id | No | integer | A foreign key to the predefined concept in the Place of Service Vocabulary reflecting the discharge disposition (destination) for a visit.| -| preceding_visit_detail_id | No | integer | A foreign key to the visit_occurrence table record of the visit immediately preceding this visit. | -| visit_source_value | No | string | The source code for the visit as it appears in the source data. | -| visit_source_concept_id | No | Integer | A foreign key to a Concept that refers to the code used in the source. | -| admitting_source_value | No | string | The source code for the admitting source as it appears in the source data. | -| discharge_to_source_value | No | string | The source code for the discharge disposition as it appears in the source data.| -| visit_detail_parent_id | No | integer | A foreign key to the visit_detail table record to represent the immediate parent visit-detail record. | -| visit_occurrence_id | Yes | integer | A foreign key that refers to the record in the visit_occurrence table | - -### Conventions - - * For every record in VISIT_OCCURRENCE there may be 0 or more records in VISIT_DETAIL. - * Records in VISIT_DETAIL will be related to each other sequentially or hierarchically AND will be related to the VISIT_OCCURRENCE table - -**Example:** -An entire inpatient stay is represented as one record in the VISIT_OCCURRENCE table. The one inpatient stay is comprised of movements within the hospital, such as to the ER, ICU or medical floor. Each of the visit details may have different start -and end datetimes and would each end up as one record in the VISIT_DETAIL table with the same VISIT_OCCURRENCE_ID, related to each other sequentially by using the PRECEDING_VISIT_DETAIL_ID. \ No newline at end of file diff --git a/Documentation/CommonDataModel_Wiki_Files/StandardizedClinicalDataTables/VISIT_OCCURRENCE.md b/Documentation/CommonDataModel_Wiki_Files/StandardizedClinicalDataTables/VISIT_OCCURRENCE.md index 47acae7..9d26a36 100644 --- a/Documentation/CommonDataModel_Wiki_Files/StandardizedClinicalDataTables/VISIT_OCCURRENCE.md +++ b/Documentation/CommonDataModel_Wiki_Files/StandardizedClinicalDataTables/VISIT_OCCURRENCE.md @@ -14,10 +14,10 @@ Field|Required|Type|Description |care_site_id|No|integer|A foreign key to the care site in the care site table that was visited.| |visit_source_value|No|varchar(50)|The source code for the visit as it appears in the source data.| |visit_source_concept_id|No|integer|A foreign key to a Concept that refers to the code used in the source.| -|admitting_source_concept_id| |integer |No |A foreign key to the predefined concept in the Place of Service Vocabulary reflecting the admitting source for a visit.| -|admitting_source_value |varchar(50)| No| The source code for the admitting source as it appears in the source data.| -|discharge_to_concept_id| integer |No |A foreign key to the predefined concept in the Place of Service Vocabulary reflecting the discharge disposition for a visit.| -|discharge_to_source_value| varchar(50)| No| The source code for the discharge disposition as it appears in the source data.| +|admitting_source_concept_id |integer |No |A foreign key to the predefined concept in the Place of Service Vocabulary reflecting the admitting source for a visit.| +|admitting_source_value |varchar(50)| No| The source code for the admitting source as it appears in the source data.| +|discharge_to_concept_id | integer |No |A foreign key to the predefined concept in the Place of Service Vocabulary reflecting the discharge disposition for a visit.| +|discharge_to_source_value | varchar(50)| No| The source code for the discharge disposition as it appears in the source data.| |preceding_visit_occurrence_id |integer| No |A foreign key to the VISIT_OCCURRENCE table of the visit immediately preceding this visit| ### Conventions diff --git a/Documentation/CommonDataModel_Wiki_Files/StandardizedHealthEconomicsDataTables/COST.md b/Documentation/CommonDataModel_Wiki_Files/StandardizedHealthEconomicsDataTables/COST.md index 5e98c1a..a426a42 100644 --- a/Documentation/CommonDataModel_Wiki_Files/StandardizedHealthEconomicsDataTables/COST.md +++ b/Documentation/CommonDataModel_Wiki_Files/StandardizedHealthEconomicsDataTables/COST.md @@ -4,28 +4,28 @@ The information about the cost is defined by the amount of money paid by the Per Field|Required|Type|Description :-----------------------------|:--------|:------------|:---------------------------------------------------- -|cost_id|Yes|integer|A unique identifier for each COST record.| -|cost_event_id|Yes|integer|A foreign key identifier to the event (e.g. Measurement, Procedure, Visit, Drug Exposure, etc) record for which cost data are recorded.| -|cost_domain_id|Yes|string(20)|The concept representing the domain of the cost event, from which the corresponding table can be inferred that contains the entity for which cost information is recorded.| -|cost_type_concept_id|Yes|integer|A foreign key identifier to a concept in the CONCEPT table for the provenance or the source of the COST data: Calculated from insurance claim information, provider revenue, calculated from cost-to-charge ratio, reported from accounting database, etc.| -|currency_concept_id|No|integer|A foreign key identifier to the concept representing the 3-letter code used to delineate international currencies, such as USD for US Dollar.| -|total_charge|No|float|The total amount charged by some provider of goods or services (e.g. hospital, physician pharmacy, dme provider) to payers (insurance companies, the patient).| -|total_cost|No|float|The cost incurred by the provider of goods or services.| -|total_paid|No|float|The total amount actually paid from all payers for goods or services of the provider.| -|paid_by_payer|No|float|The amount paid by the Payer for the goods or services.| -|paid_by_patient|No|float|The total amount paid by the Person as a share of the expenses.| -|paid_patient_copay|No|float|The amount paid by the Person as a fixed contribution to the expenses.| -|paid_patient_coinsurance|No|float|The amount paid by the Person as a joint assumption of risk. Typically, this is a percentage of the expenses defined by the Payer Plan after the Person's deductible is exceeded.| -|paid_patient_deductible|No|float|The amount paid by the Person that is counted toward the deductible defined by the Payer Plan. paid_patient_deductible does contribute to the paid_by_patient variable.| -|paid_by_primary|No|float|The amount paid by a primary Payer through the coordination of benefits.| -|paid_ingredient_cost|No|float|The amount paid by the Payer to a pharmacy for the drug, excluding the amount paid for dispensing the drug. paid_ingredient_cost contributes to the paid_by_payer field if this field is populated with a nonzero value.| -|paid_dispensing_fee|No|float|The amount paid by the Payer to a pharmacy for dispensing a drug, excluding the amount paid for the drug ingredient. paid_dispensing_fee contributes to the paid_by_payer field if this field is populated with a nonzero value.| -|payer_plan_period_id|No|integer|A foreign key to the PAYER_PLAN_PERIOD table, where the details of the Payer, Plan and Family are stored. Record the payer_plan_id that relates to the payer who contributed to the paid_by_payer field.| -|amount_allowed|No|float|The contracted amount agreed between the payer and provider.| -|revenue_code_concept_id|No|integer|A foreign key referring to a Standard Concept ID in the Standardized Vocabularies for Revenue codes.| -|revenue_code_source_value|No|string(50)|The source code for the Revenue code as it appears in the source data, stored here for reference.| -|drg_concept_id| integer| No |A foreign key to the predefined concept in the DRG Vocabulary reflecting the DRG for a visit.| -|drg_source_value| varchar(3)| No| The 3-digit DRG source code as it appears in the source data.| +|cost_id |Yes|integer|A unique identifier for each COST record.| +|cost_event_id |Yes|integer|A foreign key identifier to the event (e.g. Measurement, Procedure, Visit, Drug Exposure, etc) record for which cost data are recorded.| +|cost_domain_id |Yes|varchar(20)|The concept representing the domain of the cost event, from which the corresponding table can be inferred that contains the entity for which cost information is recorded.| +|cost_type_concept_id |Yes|integer|A foreign key identifier to a concept in the CONCEPT table for the provenance or the source of the COST data: Calculated from insurance claim information, provider revenue, calculated from cost-to-charge ratio, reported from accounting database, etc.| +|currency_concept_id |No|integer|A foreign key identifier to the concept representing the 3-letter code used to delineate international currencies, such as USD for US Dollar.| +|total_charge |No|float|The total amount charged by some provider of goods or services (e.g. hospital, physician pharmacy, dme provider) to payers (insurance companies, the patient).| +|total_cost |No|float|The cost incurred by the provider of goods or services.| +|total_paid |No|float|The total amount actually paid from all payers for goods or services of the provider.| +|paid_by_payer |No|float|The amount paid by the Payer for the goods or services.| +|paid_by_patient |No|float|The total amount paid by the Person as a share of the expenses.| +|paid_patient_copay |No|float|The amount paid by the Person as a fixed contribution to the expenses.| +|paid_patient_coinsurance |No|float|The amount paid by the Person as a joint assumption of risk. Typically, this is a percentage of the expenses defined by the Payer Plan after the Person's deductible is exceeded.| +|paid_patient_deductible |No|float|The amount paid by the Person that is counted toward the deductible defined by the Payer Plan. paid_patient_deductible does contribute to the paid_by_patient variable.| +|paid_by_primary |No|float|The amount paid by a primary Payer through the coordination of benefits.| +|paid_ingredient_cost |No|float|The amount paid by the Payer to a pharmacy for the drug, excluding the amount paid for dispensing the drug. paid_ingredient_cost contributes to the paid_by_payer field if this field is populated with a nonzero value.| +|paid_dispensing_fee |No|float|The amount paid by the Payer to a pharmacy for dispensing a drug, excluding the amount paid for the drug ingredient. paid_dispensing_fee contributes to the paid_by_payer field if this field is populated with a nonzero value.| +|payer_plan_period_id |No|integer|A foreign key to the PAYER_PLAN_PERIOD table, where the details of the Payer, Plan and Family are stored. Record the payer_plan_id that relates to the payer who contributed to the paid_by_payer field.| +|amount_allowed |No|float|The contracted amount agreed between the payer and provider.| +|revenue_code_concept_id |No|integer|A foreign key referring to a Standard Concept ID in the Standardized Vocabularies for Revenue codes.| +|revenue_code_source_value |No|varchar(50)|The source code for the Revenue code as it appears in the source data, stored here for reference.| +|drg_concept_id |No|integer|A foreign key to the predefined concept in the DRG Vocabulary reflecting the DRG for a visit.| +|drg_source_value |No|varchar(3)| The 3-digit DRG source code as it appears in the source data.| ### Conventions The COST table will store information reporting money or currency amounts. There are three types of cost data, defined in the cost_type_concept_id: 1) paid or reimbursed amounts, 2) charges or list prices (such as Average Wholesale Prices), and 3) costs or expenses incurred by the provider. The defined fields are variables found in almost all U.S.-based claims data sources, which is the most common data source for researchers. Non-U.S.-based data holders are encouraged to engage with OHDSI to adjust these tables to their needs. diff --git a/Documentation/CommonDataModel_Wiki_Files/StandardizedHealthEconomicsDataTables/PAYER_PLAN_PERIOD.md b/Documentation/CommonDataModel_Wiki_Files/StandardizedHealthEconomicsDataTables/PAYER_PLAN_PERIOD.md index 8afc419..b16c6b9 100644 --- a/Documentation/CommonDataModel_Wiki_Files/StandardizedHealthEconomicsDataTables/PAYER_PLAN_PERIOD.md +++ b/Documentation/CommonDataModel_Wiki_Files/StandardizedHealthEconomicsDataTables/PAYER_PLAN_PERIOD.md @@ -2,15 +2,24 @@ The PAYER_PLAN_PERIOD table captures details of the period of time that a Person Field|Required|Type|Description :------------------------------|:--------|:------------|:---------------------------------------------- -|payer_plan_period_id|Yes|integer|A identifier for each unique combination of payer, plan, family code and time span.| -|person_id|Yes|integer|A foreign key identifier to the Person covered by the payer. The demographic details of that Person are stored in the PERSON table.| -|payer_plan_period_start_date|Yes|date|The start date of the payer plan period.| -|payer_plan_period_end_date|Yes|date|The end date of the payer plan period.| -|payer_source_value|No|varchar(50)|The source code for the payer as it appears in the source data.| -|plan_source_value|No|varchar(50)|The source code for the Person's health benefit plan as it appears in the source data.| -|family_source_value|No|varchar(50)|The source code for the Person's family as it appears in the source data.| +|payer_plan_period_id |Yes|integer|A identifier for each unique combination of payer, plan, family code and time span.| +|person_id |Yes|integer|A foreign key identifier to the Person covered by the payer. The demographic details of that Person are stored in the PERSON table.| +|payer_plan_period_start_date |Yes|date|The start date of the payer plan period.| +|payer_plan_period_end_date |Yes|date|The end date of the payer plan period.| +|payer_concept_id |No|integer|A foreign key that refers to a standard Payer concept identifier in the Standarized Vocabularies| +|payer_source_value |No|varchar(50)|The source code for the payer as it appears in the source data.| +|payer_source_concept_id |No|integer|A foreign key to a payer concept that refers to the code used in the source.| +|plan_concept_id |No|integer|A foreign key that refers to a standard plan concept identifier that represents the health benefit plan in the Standardized Vocabularies| +|plan_source_value |No|varchar(50)|The source code for the Person's health benefit plan as it appears in the source data.| +|plan_source_concept_id |No|integer|A foreign key to a plan concept that refers to the plan code used in the source data.| +|sponsor_concept_id |No|integer|A foreign key that refers to a concept identifier that represents the sponsor in the Standardized Vocabularies.| +|sponsor_source_value |No|varchar(50)|The source code for the Person's sponsor of the health plan as it appears in the source data.| +|sponsor_source_concept_id |No|integer|A foreign key to a sponsor concept that refers to the sponsor code used in the source data.| +|family_source_value |No|varchar(50)|The source code for the Person's family as it appears in the source data.| +|stop_reason_concept_id |No|integer|A foreign key that refers to a standard termination reason that represents the reason for the termination in the Standardized Vocabularies.| +|stop_reason_source_value |No|varchar(50)|The reason for stop-coverage as it appears in the source data.| +|stop_reason_source_concept_id |No|integer|A foreign key to a stop-coverage concept that refers to the code used in the source.| ### Conventions * Different Payers have different designs for their health benefit Plans. The PAYER_PLAN_PERIOD table does not capture all details of the plan design or the relationship between Plans or the cost of healthcare triggering a change from one Plan to another. However, it allows identifying the unique combination of Payer (insurer), Plan (determining healthcare benefits and limits) and Person. Typically, depending on healthcare utilization, a Person may have one or many subsequent Plans during coverage by a single Payer. - * Payer or Plan information is not normalized or recorded as part of the Standard Vocabularies. Instead, they are referred to only by their source_value. - * Typically, family members are covered under the same Plan as the Person. In those cases, the payer_source_value, plan_source_value and family_source_value are identical. \ No newline at end of file + * Typically, family members are covered under the same Plan as the Person. In those cases, the payer_source_value, plan_source_value and family_source_value are identical. \ No newline at end of file diff --git a/Documentation/CommonDataModel_Wiki_Files/StandardizedHealthSystemDataTables/PROVIDER.md b/Documentation/CommonDataModel_Wiki_Files/StandardizedHealthSystemDataTables/PROVIDER.md index 83c728f..2fe2e62 100644 --- a/Documentation/CommonDataModel_Wiki_Files/StandardizedHealthSystemDataTables/PROVIDER.md +++ b/Documentation/CommonDataModel_Wiki_Files/StandardizedHealthSystemDataTables/PROVIDER.md @@ -3,7 +3,7 @@ The PROVIDER table contains a list of uniquely identified healthcare providers. Field|Required|Type|Description :-------------------------|:--------|:------------|:------------------------------------- |provider_id|Yes|integer|A unique identifier for each Provider.| -|provider_name|No|varchar(50)|A description of the Provider.| +|provider_name|No|varchar(255)|A description of the Provider.| |npi|No|varchar(20)|The National Provider Identifier (NPI) of the provider.| |dea|No|varchar(20)|The Drug Enforcement Administration (DEA) number of the provider.| |specialty_concept_id|No|integer|A foreign key to a Standard Specialty Concept ID in the Standardized Vocabularies.|