fix(treatment): show only past plans in history rail and refresh after lab send.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -15,7 +15,6 @@ import type { TreatmentCatalogEntry } from '@/types/treatment-catalog';
|
||||
|
||||
interface PastTreatmentsPanelProps {
|
||||
items: PastTreatment[];
|
||||
currentDraft?: PastTreatment | null;
|
||||
patientName?: string;
|
||||
currentAppointmentId?: string | null;
|
||||
treatmentCatalog: TreatmentCatalogEntry[];
|
||||
@@ -33,7 +32,6 @@ function formatHistoryTimestamp(iso: string, locale: string): string {
|
||||
|
||||
export function PastTreatmentsPanel({
|
||||
items,
|
||||
currentDraft = null,
|
||||
patientName,
|
||||
currentAppointmentId,
|
||||
treatmentCatalog,
|
||||
@@ -54,11 +52,11 @@ export function PastTreatmentsPanel({
|
||||
|
||||
const displayedItems = useMemo(
|
||||
() =>
|
||||
filterTreatmentHistoryItems(items, currentDraft, labDependentCodes, {
|
||||
filterTreatmentHistoryItems(items, labDependentCodes, {
|
||||
notShippedOnly,
|
||||
date: filterDate,
|
||||
}),
|
||||
[items, currentDraft, labDependentCodes, notShippedOnly, filterDate],
|
||||
}, currentAppointmentId),
|
||||
[items, currentAppointmentId, labDependentCodes, notShippedOnly, filterDate],
|
||||
);
|
||||
|
||||
function clearFilters() {
|
||||
@@ -119,9 +117,6 @@ export function PastTreatmentsPanel({
|
||||
>
|
||||
{displayedItems.map((treatment) => {
|
||||
const isSelected = selectedPreviewId === treatment.id;
|
||||
const isCurrentAppointment =
|
||||
Boolean(currentAppointmentId) && treatment.appointmentId === currentAppointmentId;
|
||||
const isLiveDraft = treatment.id === 'current-draft';
|
||||
|
||||
return (
|
||||
<article
|
||||
@@ -152,15 +147,6 @@ export function PastTreatmentsPanel({
|
||||
>
|
||||
{formatHistoryTimestamp(treatment.treatmentAt, locale)}
|
||||
</time>
|
||||
{isLiveDraft ? (
|
||||
<span className="text-[10px] font-medium uppercase tracking-wide text-primary">
|
||||
{t('labAttentionCurrentDraft')}
|
||||
</span>
|
||||
) : isCurrentAppointment ? (
|
||||
<span className="text-[10px] font-medium uppercase tracking-wide text-primary">
|
||||
{t('historyCurrentAppointment')}
|
||||
</span>
|
||||
) : null}
|
||||
</div>
|
||||
|
||||
{treatment.details.length === 0 ? (
|
||||
|
||||
Reference in New Issue
Block a user