WITH asthma AS (
SELECT DISTINCT c2.concept_id AS snomed_asthma
FROM @vocab.concept c1
JOIN @vocab.concept_relationship cr
ON c1.concept_id = cr.concept_id_1
AND cr.relationship_id = 'Maps to'
JOIN @vocab.concept c2
ON cr.concept_id_2 = c2.concept_id
JOIN @vocab.concept_ancestor ca
ON ca.ancestor_concept_id = c2.concept_id
WHERE c1.concept_code LIKE CONCAT($1::text,'%')
)
SELECT season, COUNT(*)::integer AS cases
FROM (
SELECT CASE WHEN date_part('month',ce.condition_era_start_date) IN (12,1,2)
THEN 'Winter'
WHEN date_part('month',ce.condition_era_start_date) IN (3,4,5)
THEN 'Spring'
WHEN date_part('month',ce.condition_era_start_date) IN (6,7,8)
THEN 'Summer'
WHEN date_part('month',ce.condition_era_start_date) IN (9,10,11)
THEN 'Fall'
END AS season
FROM @cdm.condition_era ce
JOIN asthma a
ON a.snomed_asthma = ce.condition_concept_id
) TMP
GROUP BY season;
| Parameter | Example | Mandatory | Notes | | --- | --- | --- | --- | | condition_code | 493.0 | YES | |
| Field | Description | | --- | --- | | season | | | cases | |
https://github.com/OHDSI/CommonDataModel/wiki/
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.