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
WITH dx_case_inclusion_criteria_1 AS ( | |
SELECT co.person_id, cohort.standard_code_set AS code_set | |
FROM | |
{database}.condition_occurrence co, | |
{database}.SYSTEMICLUPUSERYTHEMATOSUS_COHORT_VARS cohort | |
WHERE co.condition_concept_id = CAST(cohort.standard_concept_id AS int64) | |
AND cohort.phenotype_definition_number = 1 | |
AND cohort.standard_code_set = {code_set_group} | |
GROUP BY | |
co.person_id, code_set |
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
WITH dx_case_inclusion_criteria_1 AS ( | |
SELECT co.person_id, cohort.standard_code_set AS code_set | |
FROM | |
{database}.condition_occurrence co, | |
{database}.APPENDICITIS_COHORT_VARS cohort | |
WHERE | |
co.condition_concept_id = CAST(cohort.standard_concept_id AS int64) | |
AND cohort.phenotype_definition_number = 1 | |
AND cohort.standard_code_set = {code_set_group} | |
GROUP BY |
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
WITH dx_case_inclusion_criteria_1 AS ( | |
SELECT co.person_id, cohort.standard_code_set AS code_set | |
FROM | |
{database}.condition_occurrence co, | |
{database}.CROHNSDISEASE_COHORT_VARS cohort | |
WHERE | |
co.condition_concept_id = CAST(cohort.standard_concept_id AS int64) | |
AND cohort.phenotype_definition_number = 1 | |
AND cohort.standard_code_set = {code_set_group} | |
GROUP BY |
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
WITH dx_case_inclusion_criteria_1 AS ( | |
SELECT co.person_id, cohort.standard_code_set AS code_set | |
FROM | |
{database}.condition_occurrence co, | |
{database}.SLEEPAPNEA_COHORT_VARS cohort | |
WHERE co.condition_concept_id = CAST(cohort.standard_concept_id AS int64) | |
AND cohort.phenotype_definition_number = 1 | |
AND cohort.standard_code_set = {code_set_group} | |
GROUP BY | |
co.person_id, code_set |
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
WITH dx_case_inclusion_criteria_1 AS ( | |
SELECT co.person_id, cohort.standard_code_set AS code_set | |
FROM | |
{database}.condition_occurrence co, | |
{database}.SICKLECELLDISEASE_COHORT_VARS cohort | |
WHERE | |
co.condition_concept_id = CAST(cohort.standard_concept_id AS int64) | |
AND cohort.standard_code_set = {code_set_group} | |
GROUP BY co.person_id, cohort.standard_code_set | |
HAVING |
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
WITH age_criteria_1 AS ( | |
SELECT co.person_id, cohort.standard_code_set AS code_set | |
FROM | |
{database}.person p, | |
{database}.condition_occurrence co, | |
{database}.ADHD_COHORT_VARS cohort | |
WHERE p.person_id = co.person_id | |
AND co.condition_concept_id = CAST(cohort.standard_concept_id AS int64) | |
AND cohort.phenotype_definition_number = 1 | |
AND cohort.standard_code_set = {code_set_group} |
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
SELECT | |
DISTINCT CONCAT('"', c.concept_code, '"') AS standard_code, | |
c.concept_name AS standard_name, | |
c.domain_id AS standard_domain, | |
c.vocabulary_id AS standard_vocabulary, | |
COUNT(occ.{count_concept}_id) AS occ_count | |
FROM | |
{database}.concept c | |
JOIN {database}.{count_concept} occ ON occ.{concept}_concept_id = c.concept_id | |
WHERE |
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 |
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 descendants of OMOP standard terminology concepts | |
SELECT DISTINCT | |
CONCAT('"', c.concept_code, '"') AS source_code, | |
c.concept_name AS standard_name, | |
c.domain_id AS standard_domain, | |
c.vocabulary_id AS standard_vocabulary, | |
CONCAT('"', dc.concept_code, '"') AS desc_standard_code, | |
dc.concept_name AS desc_standard_name, | |
dc.domain_id AS desc_standard_domain, | |
dc.vocabulary_id AS desc_standard_vocabulary |
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 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 |