inst/QueryLibrary/Aggregate/care_site/CS02.md

CS02: Patient count per care site place of service.

Description

This query is used to count patients per care site place of service.

Query

SELECT
    cs.place_of_service_concept_id,
    COUNT(*)::integer AS num_patients
FROM @cdm.care_site AS cs
    JOIN @cdm.person AS p ON p.care_site_id = cs.care_site_id
GROUP BY cs.place_of_service_concept_id
ORDER BY cs.place_of_service_concept_id
;

Input

None

Output

| Field | Description | | --- | --- | | place_of_service_concept_id | A foreign key that refers to a place of service concept identifier in the vocabulary. | | num_patients | Number of patients assigned to the particular place_of_service_concept_id |

Example output record

| Field | Description | | --- | --- | | place_of_service_concept_id | 8546 | | num_patients | 55 |

Documentation

https://github.com/OHDSI/CommonDataModel/wiki/CARE_SITE



sib-swiss/dsQueryLibraryServer documentation built on Feb. 13, 2025, 8:07 p.m.