Returns the distribution of number of times a person has been hospitalized where a certain condition was reported.
Sample query run:
||Condition concept identifier for 'Nausea'
The following is a sample run of the query. The input parameters are highlighted in blue
count(*) AS persons_freq
SELECT person_id, COUNT(*) AS number_of_hospitlizations
SELECT distinct condition_era_id, era.person_id
SELECT condition_start_date, condition_end_date, person_id
FROM (SELECT visit_occurrence_id, condition_start_date, condition_end_date, person_id
AND visit_occurrence_id IS NOT NULL) AS FROM_cond
JOIN (SELECT visit_occurrence_id, place_of_service_concept_id
WHERE place_of_service_concept_id=9201) AS FROM_visit
) AS occurr,
SELECT condition_era_id, person_id, condition_era_start_date, condition_era_end_date
) AS era
AND era.condition_era_start_date <= occurr.condition_end_date
AND (era.condition_era_end_date IS NULL OR era.condition_era_end_date >= occurr.condition_start_date)
GROUP BY person_id
ORDER BY number_of_hospitlizations desc
GROUP BY number_of_hospitlizations
ORDER BY persons_freq desc
Output field list:
||Number of times a person was reported to be hospitalized with a certain condition.
||Number of persons which were reported to have a certain number of hospilizations with a certain condition.
Sample output record: