docs(ipd): pharmacy clearance APIs + move IPD routes off /appointments (PRO-738) - #662
Open
jainkuniya wants to merge 2 commits into
Open
docs(ipd): pharmacy clearance APIs + move IPD routes off /appointments (PRO-738)#662jainkuniya wants to merge 2 commits into
jainkuniya wants to merge 2 commits into
Conversation
PRO-738.
The two existing IPD endpoints move with the service:
/appointments/v1/ipd/admission/{admission_id} → /ipd/v1/admissions/{admission_id}
/appointments/v1/ipd/admission → /ipd/v1/admissions
IPD is its own module, not a sub-resource of appointments. Their `.mdx` pages
reference operations by method+path, so leaving them would have broken both
pages the moment the service PR merged.
Adds the three pharmacy-clearance endpoints — notify on discharge, resend to the
pharmacies that failed, and withdraw when a discharge is cancelled — plus shared
schemas for the request and the per-pharmacy response.
The docs lead with the parts that are easy to get wrong: recipients are resolved
server-side from the admission's orders and cannot be chosen by the caller; an
unreachable pharmacy is still a 200 because the round did run and erroring would
discard the results for the pharmacies that succeeded; `skipped` marks a
deliberate no-op rather than a failure; `UNSUPPORTED` means nothing was
attempted and nothing needs fixing; and cancel must be called BEFORE the
discharge workflow reset, which deletes the pharmacy list it needs.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
jainkuniya
marked this pull request as draft
August 5, 2026 04:20
Contributor
Author
|
Moved to v2, alongside eka-care/doctor-suite-js#9 — drafting. This PR both documents the new endpoints and rewrites the two existing IPD pages onto |
Documents POST /ipd/v1/admissions/{id}/discharge/initiate — the whole discharge
flow over the API, not just the pharmacy notification.
The description leads with why an integrator should use this rather than the
standalone notify: firing the notification on its own tells chemists a patient
is leaving while the admission is still UNDER_CARE. And with why a pharmacy
failure returns 200 — the status commits before any chemist is contacted, so by
the time one fails the discharge has already happened.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
jainkuniya
marked this pull request as ready for review
August 5, 2026 14:59
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Docs for PRO-738, and the answer to @jainkuniya's "we have to update docs as well dost then" on eka-care/doctor-suite-js#9.
The two existing IPD pages reference operations by method + path:
doctor-suite-js#9 moves those routes to
/ipd/v1/admissions/..., so both pages would have broken the moment that PR merged. Updated here:/appointments/v1/ipd/admission/{admission_id}/ipd/v1/admissions/{admission_id}/appointments/v1/ipd/admission/ipd/v1/admissionsMerge this together with doctor-suite-js#9, not before — until the service ships, these paths don't exist yet.
New endpoints
Three pharmacy-clearance operations, added to
doc-tool.yamlwith shared request/response schemas and registered under the existing IPD API nav group:POST …/pharmacy-clearance-notify— on Initiate DischargePOST …/pharmacy-clearance-notify/retry— the "Resend" actionPOST …/pharmacy-clearance-notify/cancel— when a discharge is called offThe descriptions lead with what's easy to get wrong:
targets.skippedis a deliberate no-op, not a failure (no-ipid,no-targets).UNSUPPORTED≠ failed — nothing was attempted, nothing to retry.Note on the auto-sync
doctor-suite-js has a workflow that syncs its generated spec into
api-reference/medical-history/openapi.json. That path only covers the medical-history surface, so it does not pick up these IPD endpoints — hence the hand-maintained entries indoc-tool.yaml, where the existing IPD endpoints already live. Worth deciding separately whether that sync should cover the whole suite.Verification
doc-tool.yamlparses as YAML anddocs.jsonas JSON; all five IPD paths and the three new schemas resolve, and no/appointments/v1/ipdreference remains.🤖 Generated with Claude Code