Skip to content

Sleep Apnea

Tiffany J. Callahan edited this page Jul 19, 2021 · 13 revisions

Documentation


See the SQL query to identify the cohort below and note that the mapping between the bolded words at the beginning of each of the case criteria and the named query chunks

Cohort Criteria

Case Criteria:

  • Presence of >= 1 specific sleep apnea codes (ICD9 codes - criteria # 1)

"The computable phenotype can be cross-referenced against the following to increase specificity: AHI (sleep lab report) >= 5 or HCPCS code E0601 (CPAP) or E0470 or E0471 (BIPAP) or A7034 (CPAP mask) or HCPCS A9270 or E)486 (Mandibular devices) or CPT 95811 (CPAP titration) or CPT 95811 (Split night CPAP titration)" Phenotype Definition.

GitHub issue #13:

Do not use CPT codes in cohort selection, instead use them for performing a sensitivity analysis looking at requiring the HCPCS codes with the goal of improving the phenotype for subsequent users


Control Criteria:

  • No control group defined

Covariates

  • No provided covariates

SQL Query

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
   HAVING
     COUNT(DISTINCT co.condition_concept_id) >= 1
)
  
SELECT person_id, code_set, 'SLEEPAPNEA_CASE' AS cohort_type FROM (
  SELECT * FROM dx_case_inclusion_criteria_1)
;

This query can can also be accessed via a GitHub Gist here