feature: Sepsis Engine Refactor: Remove SIRS, Rewire qSOFA + Bundle
Frontend: GCS Entry, SOFA Display, Sepsis UI Refactor
This commit is contained in:
@@ -8,6 +8,14 @@ export function fetchCurrentQsofa(encounterId) {
|
||||
return api.get(`/api/v1/encounters/${encounterId}/qsofa/current`)
|
||||
}
|
||||
|
||||
export function fetchCurrentGcs(encounterId) {
|
||||
return api.get(`/api/v1/encounters/${encounterId}/gcs`)
|
||||
}
|
||||
|
||||
export function fetchCurrentSofa(encounterId) {
|
||||
return api.get(`/api/v1/encounters/${encounterId}/sofa`)
|
||||
}
|
||||
|
||||
export function fetchSepsisBundle(encounterId) {
|
||||
return api.get(`/api/v1/encounters/${encounterId}/sepsis-bundle/current`)
|
||||
}
|
||||
@@ -16,6 +24,35 @@ export function fetchOrders(encounterId) {
|
||||
return api.get(`/api/v1/encounters/${encounterId}/orders`)
|
||||
}
|
||||
|
||||
export async function submitGcsObservations(encounterId, eye, verbal, motor) {
|
||||
const recordedAt = new Date().toISOString()
|
||||
return api.post(`/api/v1/encounters/${encounterId}/observations`, {
|
||||
observations: [
|
||||
{
|
||||
observationCode: 'GCS_EYE',
|
||||
value: eye,
|
||||
unit: 'score',
|
||||
source: 'Manual',
|
||||
recordedAt,
|
||||
},
|
||||
{
|
||||
observationCode: 'GCS_VERBAL',
|
||||
value: verbal,
|
||||
unit: 'score',
|
||||
source: 'Manual',
|
||||
recordedAt,
|
||||
},
|
||||
{
|
||||
observationCode: 'GCS_MOTOR',
|
||||
value: motor,
|
||||
unit: 'score',
|
||||
source: 'Manual',
|
||||
recordedAt,
|
||||
},
|
||||
],
|
||||
})
|
||||
}
|
||||
|
||||
export async function fetchNews2History(encounterId, { limit = 100 } = {}) {
|
||||
const all = []
|
||||
let cursor = null
|
||||
|
||||
@@ -1,7 +1,60 @@
|
||||
// Map API PascalCase alert types to display labels (e.g. WarningHeartRate → WARNING_HEART_RATE)
|
||||
const ALERT_TYPE_LABELS = {
|
||||
SepsisWarning: 'Sepsis Warning (SIRS — Legacy)',
|
||||
QsofaWarning: 'qSOFA Alert (Legacy)',
|
||||
QsofaScreen: 'qSOFA Screen',
|
||||
SofaSepsis: 'Sepsis Alert (SOFA)',
|
||||
SofaWarning: 'SOFA Warning',
|
||||
GcsCritical: 'GCS Critical (≤ 8)',
|
||||
GcsWarning: 'GCS Warning (9–12)',
|
||||
News2Warning: 'NEWS2 Warning',
|
||||
News2Emergency: 'NEWS2 Emergency',
|
||||
RapidDeterioration: 'Rapid Deterioration',
|
||||
CriticalHeartRate: 'Critical Heart Rate',
|
||||
CriticalTempC: 'Critical Temperature',
|
||||
CriticalPotassiumMeqL: 'Critical Potassium',
|
||||
CriticalSpo2: 'Critical SpO₂',
|
||||
CriticalRespRate: 'Critical Respiratory Rate',
|
||||
CriticalWbcKUl: 'Critical WBC',
|
||||
CriticalSystolicBp: 'Critical Systolic BP',
|
||||
CriticalDiastolicBp: 'Critical Diastolic BP',
|
||||
CriticalLactateMmolL: 'Critical Lactate',
|
||||
CriticalAvpu: 'Critical AVPU',
|
||||
CriticalGlucoseMgDl: 'Critical Glucose',
|
||||
WarningHeartRate: 'Warning Heart Rate',
|
||||
WarningTempC: 'Warning Temperature',
|
||||
WarningPotassiumMeqL: 'Warning Potassium',
|
||||
WarningSpo2: 'Warning SpO₂',
|
||||
WarningRespRate: 'Warning Respiratory Rate',
|
||||
WarningWbcKUl: 'Warning WBC',
|
||||
WarningSystolicBp: 'Warning Systolic BP',
|
||||
WarningDiastolicBp: 'Warning Diastolic BP',
|
||||
WarningLactateMmolL: 'Warning Lactate',
|
||||
WarningGlucoseMgDl: 'Warning Glucose',
|
||||
CriticalPao2MmHg: 'Critical PaO₂',
|
||||
WarningPao2MmHg: 'Warning PaO₂',
|
||||
CriticalPlateletKUl: 'Critical Platelets',
|
||||
WarningPlateletKUl: 'Warning Platelets',
|
||||
CriticalBilirubinMgDl: 'Critical Bilirubin',
|
||||
WarningBilirubinMgDl: 'Warning Bilirubin',
|
||||
CriticalCreatinineMgDl: 'Critical Creatinine',
|
||||
WarningCreatinineMgDl: 'Warning Creatinine',
|
||||
}
|
||||
|
||||
const BUNDLE_TRIGGER_LABELS = {
|
||||
SOFA_SEPSIS: 'SOFA delta ≥ 2',
|
||||
SEPSIS_WARNING: 'SIRS criteria (Legacy)',
|
||||
QSOFA_WARNING: 'qSOFA alert (Legacy)',
|
||||
}
|
||||
|
||||
export function alertTypeLabel(type) {
|
||||
if (!type) return ''
|
||||
return type.replace(/([A-Z])/g, '_$1').slice(1).toUpperCase()
|
||||
return ALERT_TYPE_LABELS[type]
|
||||
?? type.replace(/([A-Z])/g, '_$1').slice(1).toUpperCase()
|
||||
}
|
||||
|
||||
export function bundleTriggerLabel(triggerType) {
|
||||
if (!triggerType) return ''
|
||||
return BUNDLE_TRIGGER_LABELS[triggerType] ?? triggerType.replace(/_/g, ' ')
|
||||
}
|
||||
|
||||
export function alertStatusToApiFilter(status) {
|
||||
@@ -23,6 +76,9 @@ const OBSERVATION_LABELS = {
|
||||
AVPU: 'AVPU',
|
||||
SUPPLEMENTAL_O2: 'Supplemental O₂',
|
||||
WBC_K_UL: 'WBC',
|
||||
GCS_EYE: 'GCS Eye',
|
||||
GCS_VERBAL: 'GCS Verbal',
|
||||
GCS_MOTOR: 'GCS Motor',
|
||||
}
|
||||
|
||||
export function observationCodeLabel(code) {
|
||||
|
||||
Reference in New Issue
Block a user