Skip to content

Add consultation order creation endpoints for prescriptions and lab orders - #734

Merged
enliven17 merged 2 commits into
mimir-stellar:mainfrom
danvenger:feat/squad-resolution-334
Oct 25, 2026
Merged

enliven17 merged 2 commits into
mimir-stellar:mainfrom
danvenger:feat/squad-resolution-334

Conversation

@danvenger

Copy link
Copy Markdown
Contributor

Problem
The order models exist, but there is currently no way for a doctor to create an order from a consultation. This is a missing clinician-facing flow: issuing a prescription or lab order is one of the concrete outcomes of a consultation, alongside a referral.

This change adds the doctor-facing entry point needed to create orders from an active or completed consultation.

What to do

  • Add endpoint(s) for issuing both Prescription and LabOrder from a consultation
  • Ensure the flow uses the append-only creation path introduced in the order model work, rather than bypassing it with a shortcut
  • Restrict order creation to the treating doctor for the consultation
  • Keep the behavior aligned with existing consultation and order module patterns

Files likely involved

  • backend/src/modules/orders/
  • backend/src/modules/consultations/

Key constraints

  • Must go through the append-only creation path from the order model work
  • Must not allow an arbitrary doctor to issue an order for someone else’s consultation
  • Only the treating doctor for that consultation should be able to create the order

Definition of done

  • Endpoint(s) for issuing both order types from a consultation are implemented
  • Access is restricted to the treating doctor
  • The access restriction is covered by tests
  • ROADMAP.md Phase 4 checklist is updated

Validation

danvenger and others added 2 commits October 23, 2026 22:49
…unks as mimir-stellar#732)

Upstream main does not pass its own CI, so this PR's checks cannot go green
on their own. Bring in the main-repair hunks from mimir-stellar#732 (feat/command-registry-327),
line-for-line identical so the two PRs merge cleanly, without the
command-registry feature itself (src/commands/types.ts, index/registry
rewrite, command-registry tests and docs are NOT included):

- tests: build token-shaped fixtures from parts so `npm run scan:secrets`
  passes (address-activity, audit-check-cli, cycle-summary, health-auth,
  safe-error-message)
- src/bot.ts: drop the duplicated pre-registry handler table and helpers
  left by earlier merges (39 syntax errors); taken from mimir-stellar#732 except that
  dispatch() keeps main's CommandModule field names (operatorOnly/
  chatAllowlist/handler); the rate-limiter deps mimir-stellar#732 adds to CommandDeps
  are declared via a module augmentation in src/commands/rate-limit.ts
- config/notifier/i18n/amount-display/rpc-compare/generic-decode and the
  rest of mimir-stellar#732's main-repair fixes and test realignments that typecheck,
  build, `npm test` and the e2e smoke need
@danvenger

Copy link
Copy Markdown
Contributor Author

kindly review and merge

@enliven17
enliven17 merged commit 2cc0197 into mimir-stellar:main Oct 25, 2026
4 checks passed
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.

feat(bot): render squad resolution with pool totals and payout ratio

2 participants