Skip to content

Commit 7ab5580

Browse files
committed
Add documentation for laboratory service requests and their charge items
1 parent b4cd03e commit 7ab5580

1 file changed

Lines changed: 38 additions & 0 deletions

File tree

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Laboratory Service Requests with Their Charge Items - SSMM
2+
3+
> Distinct laboratory service requests mapped to their linked charge items
4+
5+
## Purpose
6+
7+
Lists each laboratory service request together with the charge item linked through the service request external id.
8+
9+
## Parameters
10+
11+
| Parameter | Type | Description | Example |
12+
|-----------|------|-------------|---------|
13+
| *(none)* | - | Query runs as a static report with fixed filters | - |
14+
15+
---
16+
17+
## Query
18+
19+
```sql
20+
SELECT DISTINCT
21+
emr_servicerequest.title AS service_title,
22+
emr_servicerequest.category AS service_category,
23+
emr_chargeitem.title AS charge_item_title
24+
FROM emr_servicerequest
25+
JOIN emr_chargeitem
26+
ON emr_chargeitem.service_resource = 'service_request'
27+
AND emr_chargeitem.service_resource_id = emr_servicerequest.external_id::text
28+
WHERE emr_servicerequest.status != 'entered_in_error'
29+
AND emr_servicerequest.category = 'laboratory'
30+
ORDER BY emr_servicerequest.category, emr_servicerequest.title;
31+
```
32+
33+
## Notes
34+
35+
- **Lab-only filter:** `emr_servicerequest.category = 'laboratory'` limits the output to laboratory requests.
36+
- Results are sorted by service category and service title.
37+
38+
*Last updated: 2026-08-31*

0 commit comments

Comments
 (0)