+
+
+ {
+ /* the patient record is reloaded on next lookup; nothing to refresh here */
+ }}
+ onOpenChange={setAddOpen}
+ open={addOpen}
+ patients={patients}
+ />
+
+ );
+}
diff --git a/frontend/lib/patients.ts b/frontend/lib/patients.ts
index 191fb9b..bec4938 100644
--- a/frontend/lib/patients.ts
+++ b/frontend/lib/patients.ts
@@ -113,6 +113,22 @@ export async function updatePatient(patient: Patient): Promise {
);
}
+// Append lab results to a patient's record without touching the rest of it.
+// Backed by POST /api/patients/:fileNumber/labs (gated by `lab:write`, so lab
+// staff can submit analyses without patient-edit rights).
+export async function appendLabs(
+ fileNumber: string,
+ labs: Lab[],
+): Promise {
+ return apiFetch(
+ `/api/patients/${encodeURIComponent(fileNumber.trim())}/labs`,
+ {
+ method: "POST",
+ body: JSON.stringify({ labs }),
+ },
+ );
+}
+
// Reassign a patient to another clinician (sets their primary provider + PCP).
export async function transferPatient(
fileNumber: string,