Skip to content

Add Medication Dispense Summary - Pallium#108

Open
sonzsara wants to merge 1 commit into
mainfrom
ENG-502
Open

Add Medication Dispense Summary - Pallium#108
sonzsara wants to merge 1 commit into
mainfrom
ENG-502

Conversation

@sonzsara

@sonzsara sonzsara commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Provides medication dispense summary by medicine with total quantity dispensed and total revenue

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new Metabase query documentation page to report aggregated medication dispense totals for Pallium, grouped by medicine, including total quantity dispensed and billed amount.

Changes:

  • Introduces a new “Medication Dispense Summary - Pallium” markdown query doc.
  • Provides a parameterized (optional) Metabase date filter and an aggregation query over completed dispenses with billed/paid charge items.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +21 to +24
SELECT
pk.name AS medicine_name,
SUM(ci.total_price) AS total_price,
SUM(md.quantity) AS total_quantity_dispensed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 4 comments.


## Purpose

Summary view of completed medication dispenses at Pallium, grouped by medicine. Each row shows the total quantity dispensed and total billed amount for a medicine.
Comment on lines +22 to +24
pk.name AS medicine_name,
SUM(ci.total_price) AS total_price,
SUM(md.quantity) AS total_quantity_dispensed
Comment on lines +30 to +32
WHERE md.status = 'completed'
AND ci.status IN ('billed','paid')
--[[AND {{created_date}}]]
Comment on lines +39 to +41
- **Metabase filters:**
- `[[AND {{created_date}}]]` is a field filter — bind it to `md.created_date` in the Metabase variable settings.
- Only dispenses with `status = 'completed'` are included.

@abhimanyurajeesh abhimanyurajeesh left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM just update the notes to include the charge item status also

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants