feature: Clinical Review Mode: Charts, Replay Controls & Alert Reasoning

This commit is contained in:
voltsrage
2026-06-20 14:17:58 +08:00
parent 2ca0078223
commit ebd53f2df6
19 changed files with 939 additions and 9 deletions
+28
View File
@@ -14,4 +14,32 @@ export function fetchSepsisBundle(encounterId) {
export function fetchOrders(encounterId) {
return api.get(`/api/v1/encounters/${encounterId}/orders`)
}
export async function fetchNews2History(encounterId, { limit = 100 } = {}) {
const all = []
let cursor = null
do {
const params = new URLSearchParams({ limit: String(limit) })
if (cursor) params.set('cursor', cursor)
const page = await api.get(`/api/v1/encounters/${encounterId}/news2/history?${params}`)
all.push(...(page.items ?? []))
cursor = page.hasMore ? page.nextCursor : null
} while (cursor)
return all
}
export async function fetchMedications(encounterId, { pageSize = 50, since } = {}) {
const all = []
let page = 1
let totalPages = 1
do {
const params = new URLSearchParams({ page: String(page), pageSize: String(pageSize) })
if (since) params.set('since', since)
const result = await api.get(`/api/v1/encounters/${encounterId}/medications?${params}`)
all.push(...(result.items ?? []))
totalPages = result.totalPages ?? 1
page++
} while (page <= totalPages)
return all
}