Remove unused files
This commit is contained in:
@@ -1,119 +0,0 @@
|
||||
/**
|
||||
* Deviation List Component
|
||||
*
|
||||
* Tracks and manages deviations from the planned medication schedule.
|
||||
* Supports adding, editing, and deleting deviations with automatic or
|
||||
* manual timestamps. Each deviation can be marked as planned or actual.
|
||||
*
|
||||
* @author Andreas Weyer
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { FormTimeInput } from './ui/form-time-input';
|
||||
import { FormNumericInput } from './ui/form-numeric-input';
|
||||
import { Card, CardContent, CardHeader, CardTitle } from './ui/card';
|
||||
import { Button } from './ui/button';
|
||||
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from './ui/select';
|
||||
import { Switch } from './ui/switch';
|
||||
import { Label } from './ui/label';
|
||||
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from './ui/tooltip';
|
||||
import { X } from 'lucide-react';
|
||||
|
||||
const DeviationList = ({
|
||||
deviations,
|
||||
doseIncrement,
|
||||
simulationDays,
|
||||
onAddDeviation,
|
||||
onRemoveDeviation,
|
||||
onDeviationChange,
|
||||
t
|
||||
}: any) => {
|
||||
return (
|
||||
<Card className="bg-amber-50/50 border-amber-200">
|
||||
<CardHeader>
|
||||
<CardTitle>{t.deviationsFromPlan}</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent className="space-y-2">
|
||||
{deviations.map((dev: any, index: number) => (
|
||||
<div key={index} className="relative flex items-start gap-3 p-3 bg-card rounded-lg border flex-wrap">
|
||||
<div className="flex items-center gap-3 flex-1 flex-wrap">
|
||||
<Select
|
||||
value={String(dev.dayOffset || 0)}
|
||||
onValueChange={val => onDeviationChange(index, 'dayOffset', parseInt(val, 10))}
|
||||
>
|
||||
<SelectTrigger className="w-28">
|
||||
<SelectValue />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
{[...Array(parseInt(simulationDays, 10) || 1).keys()].map(day => (
|
||||
<SelectItem key={day} value={String(day)}>
|
||||
{t.day} {day + 1}
|
||||
</SelectItem>
|
||||
))}
|
||||
</SelectContent>
|
||||
</Select>
|
||||
|
||||
<FormTimeInput
|
||||
value={dev.time}
|
||||
onChange={newTime => onDeviationChange(index, 'time', newTime)}
|
||||
required={true}
|
||||
errorMessage={t.timeRequired || 'Time is required'}
|
||||
/>
|
||||
|
||||
<FormNumericInput
|
||||
value={dev.dose}
|
||||
onChange={newDose => onDeviationChange(index, 'dose', newDose)}
|
||||
increment={doseIncrement}
|
||||
min={0}
|
||||
unit={t.mg}
|
||||
required={true}
|
||||
errorMessage={t.doseRequired || 'Dose is required'}
|
||||
/>
|
||||
|
||||
<TooltipProvider>
|
||||
<Tooltip>
|
||||
<TooltipTrigger asChild>
|
||||
<div className="flex items-center gap-2">
|
||||
<Switch
|
||||
id={`add_dose_${index}`}
|
||||
checked={dev.isAdditional}
|
||||
onCheckedChange={checked => onDeviationChange(index, 'isAdditional', checked)}
|
||||
/>
|
||||
<Label htmlFor={`add_dose_${index}`} className="text-xs whitespace-nowrap">
|
||||
{t.additional}
|
||||
</Label>
|
||||
</div>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent>
|
||||
<p>{t.additionalTooltip}</p>
|
||||
</TooltipContent>
|
||||
</Tooltip>
|
||||
</TooltipProvider>
|
||||
</div>
|
||||
|
||||
<Button
|
||||
type="button"
|
||||
variant="outline"
|
||||
size="icon"
|
||||
onClick={() => onRemoveDeviation(index)}
|
||||
className="absolute top-3 right-3 text-destructive hover:bg-destructive hover:text-destructive-foreground border-destructive/30"
|
||||
>
|
||||
<X className="h-4 w-4" />
|
||||
</Button>
|
||||
</div>
|
||||
))}
|
||||
|
||||
<Button
|
||||
type="button"
|
||||
onClick={onAddDeviation}
|
||||
className="w-full bg-amber-500 hover:bg-amber-600 text-white"
|
||||
>
|
||||
{t.addDeviation}
|
||||
</Button>
|
||||
</CardContent>
|
||||
</Card>
|
||||
);
|
||||
};
|
||||
|
||||
export default DeviationList;
|
||||
@@ -1,48 +0,0 @@
|
||||
/**
|
||||
* Dose Schedule Component
|
||||
*
|
||||
* Manages up to 5 daily dose time slots with time and dose amount inputs.
|
||||
* Provides validation and allows empty entries for flexible scheduling.
|
||||
*
|
||||
* @author Andreas Weyer
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { FormTimeInput } from './ui/form-time-input';
|
||||
import { FormNumericInput } from './ui/form-numeric-input';
|
||||
import { Card, CardContent, CardHeader, CardTitle } from './ui/card';
|
||||
|
||||
const DoseSchedule = ({ doses, doseIncrement, onUpdateDoses, t }: any) => {
|
||||
return (
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle>{t.myPlan}</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent className="space-y-3">
|
||||
{doses.map((dose: any, index: number) => (
|
||||
<div key={index} className="flex items-center gap-3">
|
||||
<FormTimeInput
|
||||
value={dose.time}
|
||||
onChange={newTime => onUpdateDoses(doses.map((d: any, i: number) => i === index ? {...d, time: newTime} : d))}
|
||||
required={true}
|
||||
errorMessage={t.timeRequired || 'Time is required'}
|
||||
/>
|
||||
<FormNumericInput
|
||||
value={dose.dose}
|
||||
onChange={newDose => onUpdateDoses(doses.map((d: any, i: number) => i === index ? {...d, dose: newDose} : d))}
|
||||
increment={doseIncrement}
|
||||
min={0}
|
||||
unit={t.mg}
|
||||
required={true}
|
||||
errorMessage={t.doseRequired || 'Dose is required'}
|
||||
/>
|
||||
<span className="text-sm text-muted-foreground flex-1">{t[dose.label] || dose.label}</span>
|
||||
</div>
|
||||
))}
|
||||
</CardContent>
|
||||
</Card>
|
||||
);
|
||||
};
|
||||
|
||||
export default DoseSchedule;
|
||||
@@ -1,44 +0,0 @@
|
||||
/**
|
||||
* Suggestion Panel Component
|
||||
*
|
||||
* Displays dose correction suggestions based on deviations from the plan.
|
||||
* Shows recommended time and dose adjustments with apply button.
|
||||
*
|
||||
* @author Andreas Weyer
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { Card, CardContent, CardHeader, CardTitle } from './ui/card';
|
||||
import { Button } from './ui/button';
|
||||
|
||||
const SuggestionPanel = ({ suggestion, onApplySuggestion, t }: any) => {
|
||||
if (!suggestion) return null;
|
||||
|
||||
return (
|
||||
<Card className="bg-sky-50/50 border-l-4 border-sky-500">
|
||||
<CardHeader>
|
||||
<CardTitle className="text-lg">{t.whatIf}</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
{suggestion.dose ? (
|
||||
<div className="space-y-3">
|
||||
<p className="text-sm text-sky-800">
|
||||
{t.suggestion}: <span className="font-bold">{suggestion.dose}{t.mg}</span> ({t.instead} {suggestion.originalDose}{t.mg}) {t.at} <span className="font-bold">{suggestion.time}</span>.
|
||||
</p>
|
||||
<Button
|
||||
onClick={onApplySuggestion}
|
||||
className="w-full bg-sky-600 hover:bg-sky-700"
|
||||
>
|
||||
{t.applySuggestion}
|
||||
</Button>
|
||||
</div>
|
||||
) : (
|
||||
<p className="text-sm text-sky-800">{suggestion.text}</p>
|
||||
)}
|
||||
</CardContent>
|
||||
</Card>
|
||||
);
|
||||
};
|
||||
|
||||
export default SuggestionPanel;
|
||||
@@ -1,38 +0,0 @@
|
||||
/**
|
||||
* Dose Correction Suggestion Engine
|
||||
*
|
||||
* Generates dose correction suggestions when deviations occur from the planned
|
||||
* medication schedule. Calculates required dose adjustments and optimal timing
|
||||
* to maintain therapeutic concentrations.
|
||||
*
|
||||
* @author Andreas Weyer
|
||||
* @license MIT
|
||||
*/
|
||||
|
||||
import { timeToMinutes } from './timeUtils';
|
||||
import { calculateCombinedProfile } from './calculations';
|
||||
import type { DayGroup, SteadyStateConfig, PkParams } from '../constants/defaults';
|
||||
|
||||
interface SuggestionResult {
|
||||
text?: string;
|
||||
time?: string;
|
||||
dose?: string;
|
||||
isAdditional?: boolean;
|
||||
originalDose?: string;
|
||||
dayOffset?: number;
|
||||
}
|
||||
|
||||
interface Translations {
|
||||
noSuitableNextDose: string;
|
||||
noSignificantCorrection: string;
|
||||
}
|
||||
|
||||
export const generateSuggestion = (
|
||||
days: DayGroup[],
|
||||
steadyStateConfig: SteadyStateConfig,
|
||||
pkParams: PkParams
|
||||
): SuggestionResult | null => {
|
||||
// Suggestion feature is deprecated in day-based system
|
||||
// This function is kept for backward compatibility but returns null
|
||||
return null;
|
||||
};
|
||||
Reference in New Issue
Block a user