Last active
April 9, 2019 01:40
-
-
Save callahantiff/63eb95d2fbc0af33335586925ec719d6 to your computer and use it in GitHub Desktop.
PheKnowVec_Source_String_Synonym_Query
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
-- Query Template: find synonyms between source strings and an OMOP terminology concept codes | |
SELECT DISTINCT | |
lower(source_string) AS source_code, | |
lower(concept_synonym_name) AS source_name, | |
"String" AS input_type, | |
domain_id AS source_domain, | |
"None" AS source_vocabulary | |
FROM | |
(SELECT DISTINCT | |
cs.concept_synonym_name, | |
c.domain_id, | |
CASE | |
{0} | |
ELSE "NOT A MATCH TO SOURCE STRING" END AS source_string | |
FROM CHCO_DeID_Oct2018.concept c | |
JOIN CHCO_DeID_Oct2018.concept_synonym cs | |
ON cs.concept_id = c.concept_id | |
WHERE c.domain_id IN ("Drug")) | |
WHERE source_string != "NOT A MATCH TO SOURCE STRING"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment