18 lines
459 B
JavaScript
18 lines
459 B
JavaScript
export function calculateGcs(eye, verbal, motor) {
|
|
var total = eye + verbal + motor;
|
|
var severity, color, bg;
|
|
if (total <= 8) {
|
|
severity = 'Severe (Coma)';
|
|
color = '#ef4444';
|
|
bg = '#fee2e2';
|
|
} else if (total <= 12) {
|
|
severity = 'Moderate';
|
|
color = '#f59e0b';
|
|
bg = '#fef3c7';
|
|
} else {
|
|
severity = 'Mild';
|
|
color = '#10b981';
|
|
bg = '#d1fae5';
|
|
}
|
|
return { total: total, severity: severity, color: color, bg: bg };
|
|
}
|