mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-17 23:52:24 +00:00
Merge remote-tracking branch 'origin/main' into fix/settings-ekg-polish
This commit is contained in:
commit
4c2dfa57b4
138 files changed
+12046
-137
No files matched your search
@@ -22,6 +22,8 @@ export interface DocumentVaultFilters {
|
||||
kinds?: InboundDocumentKindValue[];
|
||||
/** Only documents linked to this illness/condition episode. */
|
||||
episodeId?: string;
|
||||
/** Only documents linked to this visit. Arrives by deep link from it. */
|
||||
encounterId?: string;
|
||||
/** Only documents whose filing date falls in this calendar year. */
|
||||
year?: number;
|
||||
}
|
||||
|
||||
@@ -31,9 +31,29 @@ export const encounterKeys = {
|
||||
* year at a time, and two windows are two different answers rather than one
|
||||
* answer that overwrites the other.
|
||||
*/
|
||||
encounterList: (from: string | null, to: string | null, status?: string) =>
|
||||
["encounters", "list", from, to, status ?? null] as const,
|
||||
encounterList: (
|
||||
from: string | null,
|
||||
to: string | null,
|
||||
status?: string,
|
||||
episodeId?: string,
|
||||
) =>
|
||||
[
|
||||
"encounters",
|
||||
"list",
|
||||
from,
|
||||
to,
|
||||
status ?? null,
|
||||
episodeId ?? null,
|
||||
] as const,
|
||||
encounter: (id: string) => ["encounters", "detail", id] as const,
|
||||
/**
|
||||
* The "which visit does this belong to" verdict for one anchor date. The
|
||||
* anchor is part of the key because it IS the question: a document dated the
|
||||
* 3rd and one dated the 20th get different answers, and one overwriting the
|
||||
* other would pre-select the wrong visit on the second review step.
|
||||
*/
|
||||
encounterSuggestion: (anchor: string) =>
|
||||
["encounters", "suggest", anchor] as const,
|
||||
/**
|
||||
* The address book. Under its own root rather than nested beneath
|
||||
* `["encounters"]`: a practitioner outlives the visits that name it, and a
|
||||
@@ -43,4 +63,13 @@ export const encounterKeys = {
|
||||
practitionerList: (q?: string) =>
|
||||
["practitioners", "list", q ?? null] as const,
|
||||
practitioner: (id: string) => ["practitioners", "detail", id] as const,
|
||||
|
||||
/* ── mutation keys ──────────────────────────────────────────────── */
|
||||
|
||||
encounterCreate: () => ["encounters", "create"] as const,
|
||||
encounterUpdate: () => ["encounters", "update"] as const,
|
||||
encounterDelete: () => ["encounters", "delete"] as const,
|
||||
practitionerCreate: () => ["practitioners", "create"] as const,
|
||||
practitionerUpdate: () => ["practitioners", "update"] as const,
|
||||
practitionerDelete: () => ["practitioners", "delete"] as const,
|
||||
};
|
||||
@@ -238,6 +238,25 @@ export const medicationDependentKeys = [
|
||||
*/
|
||||
export const cycleDependentKeys = [queryKeys.cycle(), queryKeys.insightsRoot()];
|
||||
|
||||
/**
|
||||
* Keys invalidated when a visit or an address-book entry changes.
|
||||
*
|
||||
* Both roots ride together in one bundle rather than two, because the two
|
||||
* writes reach each other: renaming a practice changes the label every visit
|
||||
* that names it renders, and deleting one nulls the reference on visits that
|
||||
* stay. A bundle that evicted only the surface being written would leave the
|
||||
* other showing the pre-write name.
|
||||
*
|
||||
* `useEncounterMutations` and `usePractitionerMutations` are its consumers.
|
||||
* It briefly had none — the roots landed a release before the surfaces that
|
||||
* read them — and was removed on trunk for that reason; it is back here
|
||||
* together with the writes that need it.
|
||||
*/
|
||||
export const encounterDependentKeys = [
|
||||
queryKeys.encounters(),
|
||||
queryKeys.practitioners(),
|
||||
];
|
||||
|
||||
/**
|
||||
* Invalidate every key in the bundle in parallel. Use this from mutation
|
||||
* `onSuccess` handlers so the call site stays a one-liner instead of repeating
|
||||
|
||||
@@ -58,6 +58,18 @@ export const moodKeys = {
|
||||
moodLinkedContext: (date: string, tz: string) =>
|
||||
["mood-linked-context", date, tz] as const,
|
||||
|
||||
/**
|
||||
* v1.38 — the day's two readings: the person's own rating and what their
|
||||
* past days imply, with the band and the case count.
|
||||
*
|
||||
* Under the `["mood-entries"]` prefix so `moodDependentKeys` reaches it: the
|
||||
* self-assessment half of the payload comes straight off a mood row, and an
|
||||
* edit to today's entry changes the deviation the card shows. The forecast
|
||||
* half does not move until the nightly job runs again, which is why the read
|
||||
* is cheap enough to refetch on a mood write.
|
||||
*/
|
||||
moodPrognosis: () => ["mood-entries", "prognosis"] as const,
|
||||
|
||||
moodAnalytics: () => ["mood-analytics"] as const,
|
||||
/**
|
||||
* v1.8.5 — pre-computed mood-insights aggregates (heatmap, distribution,
|
||||
|
||||
Reference in new issue
Block a user