informedica / informedica/GenPRES

feat(api): patient data change with order contexts in the plan

Open
#672 1 comment 0 reactions 1 assignee View on GitHub

@halcwb is already working on this.

Since Sep 16, 2026.

business-logic enhancement
Dominant language
F#
Stars
47
Forks
12
Avg merge
4h 51m
Merged PRs (30d)
285

Description

Is your feature request related to a problem? Please describe.

Follow-up of #667. Once the plan is its order contexts and every context carries the patient it was created for (plan 667), a change of the patient data in the panel leaves the contexts as they are: the plan's patient and its totals follow the edit, as today (UpdatePatient rewrites the plan's patient and sends Recalculate), while each order stays calculated for the patient its context was created with. Nothing re-evaluates a context for another patient, and nothing may: the patient attached to a signed order context cannot change.

Describe the solution you'd like

Recalculating a signed order context for new patient data is removing that context and creating a new one from the old one with the patient data applied: a new context id, the old filter and selection, evaluated for the new patient, the stepped values re-applied where they still fit and reported where they do not. The old context and its order leave the plan; the new one takes its place. This needs its own plan: what triggers it (an explicit action on the plan, or every patient edit while the plan holds contexts), whether a context not yet signed is treated the same, what the page says about values that no longer fit, and the feeding-and-supplements rule under replacement.

Describe alternatives you've considered

  • Re-evaluating the context in place for the new patient. Rejected: the order was calculated within its context for the patient of that moment, and a signed context is immutable.
  • Refusing a patient edit while the plan holds contexts. Rejected: a weight edit during a session is ordinary; the totals must follow it even before the orders are replaced.

Additional context

Plan 667 records the rule (the plan's patient as shown and signed, a context's patient fixed at creation, an order always calculated within its context) and leaves the replacement to this issue.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Q228qLAaCzuK9Bhq2pEBGc

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.