feature: Clinical Review Mode: Charts, Replay Controls & Alert Reasoning
This commit is contained in:
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user