Skip to content

Commit

Permalink
Merge pull request #410 from OHDSI/OMOP_Extension_release
Browse files Browse the repository at this point in the history
OMOP Extension release
  • Loading branch information
hardhouse authored Nov 2, 2020
2 parents a23c999 + d679c70 commit 8987bfe
Showing 2 changed files with 102 additions and 0 deletions.
53 changes: 53 additions & 0 deletions OMOP Extension/load_stage.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/**************************************************************************
* Copyright 2016 Observational Health Data Sciences and Informatics (OHDSI)
*
* 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.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Authors: Medical team
* Date: 2020
**************************************************************************/

DO $_$
BEGIN
PERFORM VOCABULARY_PACK.SetLatestUpdate(
pVocabularyName =>'OMOP Extension',
pVocabularyDate => CURRENT_DATE,
pVocabularyVersion => 'OMOP Extension '||TO_CHAR(CURRENT_DATE,'YYYYMMDD'),
pVocabularyDevSchema => 'DEV_OMOPEXT'
);
END $_$;

-- 2. Truncate all working tables
TRUNCATE TABLE concept_stage;
TRUNCATE TABLE concept_relationship_stage;
TRUNCATE TABLE concept_synonym_stage;
TRUNCATE TABLE pack_content_stage;
TRUNCATE TABLE drug_strength_stage;

--3. Manual concepts
DO $_$
BEGIN
PERFORM VOCABULARY_PACK.ProcessManualConcepts();
END $_$;

--4. Manual mappings
DO $_$
BEGIN
PERFORM VOCABULARY_PACK.ProcessManualRelationships();
END $_$;

--5. Manual synonyms
DO $_$
BEGIN
PERFORM VOCABULARY_PACK.ProcessManualSynonyms();
END $_$;
49 changes: 49 additions & 0 deletions OMOP Extension/manual_work/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
### Manual content processing:
1.Extract the following csv file into the concept_manual table: https://drive.google.com/file/d/1j5AlnUzvpNrCf9dMdol4gRq5QImGkegY/view?usp=sharing

File is generated using the query:

`SELECT concept_name,
domain_id,
vocabulary_id,
concept_class_id,
standard_concept,
concept_code,
valid_start_date,
valid_end_date,
invalid_reason
FROM concept_manual
ORDER BY vocabulary_id, concept_code, invalid_reason, valid_start_date, valid_end_date, concept_name`

2.Extract the following csv file into the concept_synonym_manual table: https://drive.google.com/file/d/1AdzCBO-hc_l2udDrM-I52pYZLlFbzR73/view?usp=sharing

`SELECT synonym_name,
synonym_concept_code,
synonym_vocabulary_id,
language_concept_id
FROM concept_synonym_manual
ORDER BY synonym_vocabulary_id, synonym_concept_code, language_concept_id, synonym_name`

3.Extract the following csv file into the concept_relationship_manual table: https://drive.google.com/file/d/1gMqPAl2TimE-6T5Zf45TzYit1jHiV_Ju/view?usp=sharing

`SELECT concept_code_1,
concept_code_2,
vocabulary_id_1,
vocabulary_id_2,
relationship_id,
valid_start_date,
valid_end_date,
invalid_reason
FROM concept_relationship_manual
ORDER BY vocabulary_id_1, vocabulary_id_2, relationship_id, concept_code_1, concept_code_2, invalid_reason, valid_start_date, valid_end_date
;`


##### csv format:
- delimiter: ','
- encoding: 'UTF8'
- header: ON
- decimal symbol: '.'
- quote escape: with backslash \
- quote always: FALSE
- NULL string: empty

0 comments on commit 8987bfe

Please sign in to comment.