Añadir cálculo naloxona y guía peso RN

This commit is contained in:
planetazuzu 2026-01-19 09:43:28 +01:00
parent 09a507dc79
commit a6cf4adba2
2 changed files with 53 additions and 0 deletions

View file

@ -1,7 +1,10 @@
import { useEffect, useState } from 'react';
import { usePatient } from '@/clinical/patient';
import { Button } from '@/components/ui/button';
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
import { Checkbox } from '@/components/ui/checkbox';
import { Input } from '@/components/ui/input';
import { Label } from '@/components/ui/label';
import { formatDuration, getElapsedSeconds } from '../sepsis/timers';
import { intoxicacionesChecklistSteps } from './intoxicacionesChecklist.model';
@ -10,11 +13,13 @@ const STORAGE_KEY = 'checklist_intoxicaciones_v1';
interface IntoxicacionesChecklistState {
startedAt: number | null;
completed: Record<string, boolean>;
manualWeightKg?: number;
}
const initialState: IntoxicacionesChecklistState = {
startedAt: null,
completed: {},
manualWeightKg: undefined,
};
const loadState = (): IntoxicacionesChecklistState => {
@ -39,6 +44,7 @@ const saveState = (state: IntoxicacionesChecklistState) => {
};
const IntoxicacionesChecklist = () => {
const { state: patientState } = usePatient();
const [checklistState, setChecklistState] = useState<IntoxicacionesChecklistState>(initialState);
const [nowTick, setNowTick] = useState(Date.now());
@ -56,6 +62,8 @@ const IntoxicacionesChecklist = () => {
}, []);
const elapsedSeconds = getElapsedSeconds(checklistState.startedAt);
const weightKg = patientState.patient.weight ?? checklistState.manualWeightKg;
const naloxoneDoseMg = weightKg ? Math.min(0.1 * weightKg, 2) : null;
const toggleStep = (id: string, value: boolean) => {
setChecklistState((prev) => ({
@ -73,6 +81,14 @@ const IntoxicacionesChecklist = () => {
setChecklistState(initialState);
};
const handleManualWeight = (value: string) => {
const parsed = Number(value);
setChecklistState((prev) => ({
...prev,
manualWeightKg: Number.isFinite(parsed) ? parsed : undefined,
}));
};
return (
<div className="space-y-6">
<header className="space-y-2">
@ -104,6 +120,30 @@ const IntoxicacionesChecklist = () => {
</CardContent>
</Card>
<Card>
<CardHeader>
<CardTitle className="text-base">Naloxona (orientativo)</CardTitle>
</CardHeader>
<CardContent className="space-y-3">
<div className="rounded-md border border-border/60 bg-muted/30 p-3 space-y-2">
<Label>Peso (kg)</Label>
<Input
type="number"
inputMode="numeric"
value={weightKg ?? ''}
onChange={(event) => handleManualWeight(event.target.value)}
placeholder="Ej: 15"
/>
<div className="text-sm text-muted-foreground space-y-1">
<p>Adulto: dosis inicial 0.4 mg IV/IM/IN, titular según respuesta.</p>
{naloxoneDoseMg
? <p>Pediatría: {naloxoneDoseMg.toFixed(2)} mg (0.1 mg/kg, máx 2 mg).</p>
: <p>Pediatría: introduce peso para calcular 0.1 mg/kg (máx 2 mg).</p>}
</div>
</div>
</CardContent>
</Card>
{intoxicacionesChecklistSteps.map((step) => (
<Card key={step.id}>
<CardHeader className="flex flex-row items-center justify-between space-y-0">

View file

@ -104,6 +104,19 @@ const PartoChecklist = () => {
</CardContent>
</Card>
<Card>
<CardHeader>
<CardTitle className="text-base">Peso RN orientativo</CardTitle>
</CardHeader>
<CardContent className="space-y-2 text-sm text-muted-foreground">
<p>Referencia rápida si no se conoce el peso:</p>
<p> &lt;34 semanas: ~1.52.0 kg</p>
<p> 3436 semanas: ~2.02.5 kg</p>
<p> 37 semanas (a término): ~3.03.5 kg</p>
<p>Si no hay datos, asumir 3.2 kg para cálculos iniciales y ajustar según clínica.</p>
</CardContent>
</Card>
{partoChecklistSteps.map((step) => (
<Card key={step.id}>
<CardHeader className="flex flex-row items-center justify-between space-y-0">