feature: Sepsis Engine Refactor: Remove SIRS, Rewire qSOFA + Bundle

Frontend: GCS Entry, SOFA Display, Sepsis UI Refactor
This commit is contained in:
voltsrage
2026-06-21 03:56:27 +08:00
parent 93ea473d2b
commit bf46e6554a
48 changed files with 2686 additions and 714 deletions
@@ -5,10 +5,12 @@ import { storeToRefs } from 'pinia'
import { usePolling } from '@/composables/usePolling'
import { useReplayControls } from '@/composables/useReplayControls'
import { useAlertStore } from '@/stores/alerts'
import { useScoringStore } from '@/stores/scoring'
import * as encountersApi from '@/api/encounters'
import * as clinicalApi from '@/api/clinical'
import VitalsPanel from '@/components/patient/VitalsPanel.vue'
import ScoresPanel from '@/components/patient/ScoresPanel.vue'
import SofaScorePanel from '@/components/patient/SofaScorePanel.vue'
import AlertsList from '@/components/patient/AlertsList.vue'
import OrdersPanel from '@/components/patient/OrdersPanel.vue'
import SepsisBundlePanel from '@/components/patient/SepsisBundlePanel.vue'
@@ -20,7 +22,9 @@ import Skeleton from '@/components/ui/Skeleton.vue'
const route = useRoute()
const alertStore = useAlertStore()
const scoringStore = useScoringStore()
const { alerts } = storeToRefs(alertStore)
const { qsofa, sofa } = storeToRefs(scoringStore)
const {
isPaused,
speed,
@@ -42,7 +46,6 @@ const {
const encounter = ref(null)
const loading = ref(true)
const observations = ref([])
const news2 = ref(null)
const news2History = ref([])
const medications = ref([])
const sepsisBundle = ref(null)
@@ -85,10 +88,9 @@ async function loadAll() {
const id = route.params.encounterId
loading.value = true
try {
const [enc, obs, n2, history, meds, bundle, ord] = await Promise.all([
const [enc, obs, history, meds, bundle, ord] = await Promise.all([
encountersApi.fetchEncounter(id),
encountersApi.fetchObservations(id),
clinicalApi.fetchCurrentNews2(id).catch(() => null),
clinicalApi.fetchNews2History(id).catch(() => []),
clinicalApi.fetchMedications(id).catch(() => []),
clinicalApi.fetchSepsisBundle(id).catch(() => null),
@@ -97,11 +99,11 @@ async function loadAll() {
await alertStore.loadAlerts(id)
encounter.value = enc
observations.value = obs
news2.value = n2
news2History.value = history
medications.value = meds
sepsisBundle.value = bundle
orders.value = ord.items ?? ord
scoringStore.startPolling(id)
syncReplayBounds()
} finally {
loading.value = false
@@ -134,6 +136,7 @@ watch(() => route.params.encounterId, () => {
selectedAlert.value = null
nextAlertIndex = 0
pause()
scoringStore.stopPolling()
loadAll()
})
@@ -146,7 +149,10 @@ watch(openAlerts, (list) => {
watch([observations, news2History, alerts], syncReplayBounds, { deep: true })
onBeforeUnmount(() => stopPlayback())
onBeforeUnmount(() => {
stopPlayback()
scoringStore.stopPolling()
})
</script>
<template>
@@ -162,7 +168,7 @@ onBeforeUnmount(() => stopPlayback())
</div>
<div class="grid min-w-0 gap-4 sm:grid-cols-2 lg:grid-cols-3">
<ScoresPanel :news2="news2" :encounter="encounter" />
<ScoresPanel />
<VitalsPanel :observations="replayObservations" />
<AlertsList
:encounter-id="route.params.encounterId"
@@ -178,10 +184,16 @@ onBeforeUnmount(() => stopPlayback())
/>
<div class="grid min-w-0 gap-4 lg:grid-cols-2">
<SofaScorePanel :encounter-id="route.params.encounterId" />
<OrdersPanel :orders="orders" />
<SepsisBundlePanel v-if="sepsisBundle" :bundle="sepsisBundle" />
</div>
<SepsisBundlePanel
:bundle="sepsisBundle"
:qsofa="qsofa"
:sofa="sofa"
/>
<div id="clinical-review" class="w-full min-w-0 space-y-8">
<TrendsGrid :observations="replayObservations" />
<News2History v-if="replayNews2History.length" :history="replayNews2History" />
@@ -198,4 +210,4 @@ onBeforeUnmount(() => stopPlayback())
/>
</div>
</div>
</template>
</template>