Añadir cálculo naloxona y guía peso RN
This commit is contained in:
parent
09a507dc79
commit
a6cf4adba2
|
|
@ -1,7 +1,10 @@
|
||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
|
import { usePatient } from '@/clinical/patient';
|
||||||
import { Button } from '@/components/ui/button';
|
import { Button } from '@/components/ui/button';
|
||||||
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
|
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
|
||||||
import { Checkbox } from '@/components/ui/checkbox';
|
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 { formatDuration, getElapsedSeconds } from '../sepsis/timers';
|
||||||
import { intoxicacionesChecklistSteps } from './intoxicacionesChecklist.model';
|
import { intoxicacionesChecklistSteps } from './intoxicacionesChecklist.model';
|
||||||
|
|
||||||
|
|
@ -10,11 +13,13 @@ const STORAGE_KEY = 'checklist_intoxicaciones_v1';
|
||||||
interface IntoxicacionesChecklistState {
|
interface IntoxicacionesChecklistState {
|
||||||
startedAt: number | null;
|
startedAt: number | null;
|
||||||
completed: Record<string, boolean>;
|
completed: Record<string, boolean>;
|
||||||
|
manualWeightKg?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
const initialState: IntoxicacionesChecklistState = {
|
const initialState: IntoxicacionesChecklistState = {
|
||||||
startedAt: null,
|
startedAt: null,
|
||||||
completed: {},
|
completed: {},
|
||||||
|
manualWeightKg: undefined,
|
||||||
};
|
};
|
||||||
|
|
||||||
const loadState = (): IntoxicacionesChecklistState => {
|
const loadState = (): IntoxicacionesChecklistState => {
|
||||||
|
|
@ -39,6 +44,7 @@ const saveState = (state: IntoxicacionesChecklistState) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const IntoxicacionesChecklist = () => {
|
const IntoxicacionesChecklist = () => {
|
||||||
|
const { state: patientState } = usePatient();
|
||||||
const [checklistState, setChecklistState] = useState<IntoxicacionesChecklistState>(initialState);
|
const [checklistState, setChecklistState] = useState<IntoxicacionesChecklistState>(initialState);
|
||||||
const [nowTick, setNowTick] = useState(Date.now());
|
const [nowTick, setNowTick] = useState(Date.now());
|
||||||
|
|
||||||
|
|
@ -56,6 +62,8 @@ const IntoxicacionesChecklist = () => {
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const elapsedSeconds = getElapsedSeconds(checklistState.startedAt);
|
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) => {
|
const toggleStep = (id: string, value: boolean) => {
|
||||||
setChecklistState((prev) => ({
|
setChecklistState((prev) => ({
|
||||||
|
|
@ -73,6 +81,14 @@ const IntoxicacionesChecklist = () => {
|
||||||
setChecklistState(initialState);
|
setChecklistState(initialState);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const handleManualWeight = (value: string) => {
|
||||||
|
const parsed = Number(value);
|
||||||
|
setChecklistState((prev) => ({
|
||||||
|
...prev,
|
||||||
|
manualWeightKg: Number.isFinite(parsed) ? parsed : undefined,
|
||||||
|
}));
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="space-y-6">
|
<div className="space-y-6">
|
||||||
<header className="space-y-2">
|
<header className="space-y-2">
|
||||||
|
|
@ -104,6 +120,30 @@ const IntoxicacionesChecklist = () => {
|
||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</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) => (
|
{intoxicacionesChecklistSteps.map((step) => (
|
||||||
<Card key={step.id}>
|
<Card key={step.id}>
|
||||||
<CardHeader className="flex flex-row items-center justify-between space-y-0">
|
<CardHeader className="flex flex-row items-center justify-between space-y-0">
|
||||||
|
|
|
||||||
|
|
@ -104,6 +104,19 @@ const PartoChecklist = () => {
|
||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</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>• <34 semanas: ~1.5–2.0 kg</p>
|
||||||
|
<p>• 34–36 semanas: ~2.0–2.5 kg</p>
|
||||||
|
<p>• ≥37 semanas (a término): ~3.0–3.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) => (
|
{partoChecklistSteps.map((step) => (
|
||||||
<Card key={step.id}>
|
<Card key={step.id}>
|
||||||
<CardHeader className="flex flex-row items-center justify-between space-y-0">
|
<CardHeader className="flex flex-row items-center justify-between space-y-0">
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue