-
Notifications
You must be signed in to change notification settings - Fork 1
Add documentation for laboratory service requests and their charge items #158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| # Laboratory Service Requests with Their Charge Items - SSMM | ||
|
|
||
| > Distinct laboratory service requests mapped to their linked charge items | ||
|
|
||
| ## Purpose | ||
|
|
||
| Lists each laboratory service request together with the charge item linked through the service request external id. | ||
|
|
||
| ## Parameters | ||
|
|
||
| | Parameter | Type | Description | Example | | ||
| |-----------|------|-------------|---------| | ||
| | *(none)* | - | Query runs as a static report with fixed filters | - | | ||
|
|
||
| --- | ||
|
|
||
| ## Query | ||
|
|
||
| ```sql | ||
| SELECT DISTINCT | ||
| emr_servicerequest.title AS service_title, | ||
| emr_servicerequest.category AS service_category, | ||
| emr_chargeitem.title AS charge_item_title | ||
| FROM emr_servicerequest | ||
| JOIN emr_chargeitem | ||
| ON emr_chargeitem.service_resource = 'service_request' | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [High]
Also, neither table filters |
||
| AND emr_chargeitem.service_resource_id = emr_servicerequest.external_id::text | ||
| WHERE emr_servicerequest.status != 'entered_in_error' | ||
| AND emr_servicerequest.category = 'laboratory' | ||
| ORDER BY emr_servicerequest.category, emr_servicerequest.title; | ||
| ``` | ||
|
|
||
| ## Notes | ||
|
|
||
| - **Lab-only filter:** `emr_servicerequest.category = 'laboratory'` limits the output to laboratory requests. | ||
| - Results are sorted by service category and service title. | ||
|
|
||
| *Last updated: 2026-08-31* | ||
Uh oh!
There was an error while loading. Please reload this page.