-
Notifications
You must be signed in to change notification settings - Fork 168
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c3c007c
commit aca171e
Showing
4 changed files
with
29 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 21 additions & 1 deletion
22
src/main/resources/resources/vocabulary/sql/getMappedSourcecodes.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,28 @@ | ||
-- get all of the concepts that were part of the list of concepts provided | ||
|
||
Select concept_id, concept_name, ISNULL(standard_concept, 'N') standard_concept, ISNULL(invalid_reason, 'V') INVALID_REASON, | ||
CONCEPT_CODE, CONCEPT_CLASS_ID, DOMAIN_ID, VOCABULARY_ID | ||
from concept | ||
where concept_id in (@identifiers) | ||
|
||
UNION | ||
|
||
--get all source codes that map to the list of concepts provided | ||
|
||
select CONCEPT_ID, CONCEPT_NAME, ISNULL(STANDARD_CONCEPT,'N') STANDARD_CONCEPT, ISNULL(c.INVALID_REASON,'V') INVALID_REASON, CONCEPT_CODE, CONCEPT_CLASS_ID, DOMAIN_ID, VOCABULARY_ID | ||
from @CDM_schema.concept_relationship cr | ||
join @CDM_schema.concept c on c.concept_id = cr.concept_id_1 | ||
where cr.concept_id_2 in (@identifiers) | ||
and cr.INVALID_REASON is null | ||
and relationship_id in ('Maps to') | ||
and standard_concept IS NULL | ||
|
||
UNION | ||
|
||
--get anything that may be stashed in the source-to-concept-map table | ||
|
||
select 0 as CONCEPT_ID, SOURCE_CODE_DESCRIPTION as CONCEPT_NAME, 'N' as STANDARD_CONCEPT, ISNULL(INVALID_REASON,'V') INVALID_REASON, | ||
SOURCE_CODE as CONCEPT_CODE, NULL as CONCEPT_CLASS_ID, NULL as DOMAIN_ID, SOURCE_VOCABULARY_ID as VOCABULARY_ID | ||
from @CDM_schema.SOURCE_TO_CONCEPT_MAP | ||
where TARGET_CONCEPT_ID in (@identifiers) | ||
and INVALID_REASON is null | ||
order by domain_id, vocabulary_id |