CONDITION ERA‎ > ‎

CE06: Conditions most likely to result in death

Most prevalent conditions within thirty days of death

Input:
 Parameter  Example  Mandatory  Notes
Number of days since condition era end 30  Yes  

Sample query run:
The following is a sample run of the query. The input parameters are highlighted in blue
SELECT concept_name, count(*) conditions_count
  FROM /* person's condition 30 days prior to death */
     ( SELECT death.person_id, concept_name
         FROM death
         JOIN condition_era condition 
           ON condition.person_id = death.person_id
          AND death_date - condition_era_end_date <= 30
         JOIN vocabulary.concept ON concept_id = condition_concept_id
     )
 GROUP BY concept_name
 ORDER BY conditions_count DESC;

Output:
Output field list:
 Field  Description
concept_name An unambiguous, meaningful and descriptive name for the concept
person_id A system-generated unique identifier for each person.
condition_concept_id A foreign key that refers to a standard condition concept identifier in the vocabulary.

Sample output record:
 Field  Description
concept_name  
person_id  
condition_concept_id  
Comments