Last active
April 9, 2019 04:23
-
-
Save callahantiff/2e9558064f62c29cbad5a75b684ae175 to your computer and use it in GitHub Desktop.
PheKnowVec_Source_String_Query
This file contains hidden or 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 OMOP concept codes with a label that partially matches a source string | |
SELECT | |
source_string, | |
CONCAT('"', source_code, '"') AS source_code, | |
source_name, | |
source_domain, | |
source_vocabulary | |
FROM | |
(SELECT DISTINCT | |
concept_code AS source_code, | |
concept_name AS source_name, | |
domain_id AS source_domain, | |
vocabulary_id AS source_vocabulary, | |
standard_concept, | |
CASE | |
{0} | |
ELSE "NOT A MATCH TO SOURCE STRING" | |
END AS source_string | |
FROM CHCO_DeID_Oct2018.concept | |
WHERE domain_id IN ({1})) | |
WHERE source_string != "NOT A MATCH TO SOURCE STRING" | |
ORDER BY source_vocabulary, source_code; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment