Skip to content

[ENG-986] Include facility identifiers in dispense order patient - #3750

Merged
vigneshhari merged 1 commit into
developfrom
bodhi/dispense-order-facility-identifiers
Sep 2, 2026
Merged

[ENG-986] Include facility identifiers in dispense order patient#3750
vigneshhari merged 1 commit into
developfrom
bodhi/dispense-order-facility-identifiers

Conversation

@bodhish

@bodhish bodhish commented Sep 2, 2026

Copy link
Copy Markdown
Member

Summary

MedicationDispenseOrderRetrieveSpec serialized the patient with PatientRetrieveSpec.serialize(obj.patient) and no facility in context, so facility_identifiers was always empty on the dispense order retrieve payload. Every other facility-scoped serializer that embeds a patient (encounter, account, diagnostic report, service request, token booking, payment reconciliation) already passes facility=. This passes obj.facility so the dispense order view and print can show facility-level patient identifiers.

Companion frontend PR: ohcnetwork/care_fe#16765

Verification

care.emr.tests.test_dispense_order_api — 33 tests OK.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Medication dispense order details now serialize patient information using the correct facility context, improving the accuracy and consistency of displayed patient data.

The dispense order retrieve serializer rendered the patient without a
facility in context, so facility-level patient identifiers were always
empty in that payload while every other facility-scoped serializer
(encounter, account, diagnostic report, service request, booking)
already passed one.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@bodhish
bodhish requested a review from a team as a code owner September 2, 2026 18:35
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 2, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-02T18:39:20.245862Z b328e61 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Team

Run ID: 6dbb3738-49e9-4e7b-bb0a-9bb4789431bb

📥 Commits

Reviewing files that changed from the base of the PR and between 6e51e8f and b328e61.

📒 Files selected for processing (1)
  • care/emr/resources/medication/dispense/dispense_order.py

Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review.


📝 Walkthrough

Walkthrough

Medication dispense order retrieval now passes the order facility to patient serialization.

Changes

Medication dispense retrieval

Layer / File(s) Summary
Facility-aware patient serialization
care/emr/resources/medication/dispense/dispense_order.py
MedicationDispenseOrderRetrieveSpec passes facility=obj.facility to PatientRetrieveSpec.serialize.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Merge Risk: ⚪ Minimal · up to b328e

This change supplies facility context when serializing dispense-order patients so facility-level identifiers appear in the view and print; no actionable merge-blocking risk remains beyond normal checks and review.

Suggested reviewers: vigneshhari

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly identifies the primary change: including facility identifiers in the dispense order patient payload.
Description check ✅ Passed The description explains the root cause, the proposed fix, the affected behavior, related frontend work, and test verification. It does not use the template headings or include the merge checklist, bu…
Full details: Description check

Explanation

The description explains the root cause, the proposed fix, the affected behavior, related frontend work, and test verification. It does not use the template headings or include the merge checklist, but it provides the critical information needed for review.

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch bodhi/dispense-order-facility-identifiers

Comment @coderabbitai help to get the list of available commands.

@vigneshhari

Copy link
Copy Markdown
Member

Need JIRA ticket before merging

@bodhish

bodhish commented Sep 2, 2026

Copy link
Copy Markdown
Member Author

@bodhish bodhish changed the title Include facility identifiers in dispense order patient [ENG-986] Include facility identifiers in dispense order patient Sep 2, 2026
@vigneshhari
vigneshhari merged commit 5c703bc into develop Sep 2, 2026
10 of 14 checks passed
@vigneshhari
vigneshhari deleted the bodhi/dispense-order-facility-identifiers branch September 2, 2026 18:44
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.

2 participants