2026-02-13 16:07:59 +07:00
|
|
|
|
<script>
|
2026-02-20 13:51:54 +07:00
|
|
|
|
import { onMount } from 'svelte';
|
refactor(tests): Move TestModal to route folder and add technical config support
- Move TestModal from lib/components to routes/(app)/master-data/tests
- Add technical configuration form (ResultType, RefType, SpcType, units, etc.)
- Add GroupMembersTab for managing group test members
- Enhance reference ranges with refvset and refthold support
- Update API to handle new test fields (ReqQty, Factor, Decimal, TAT, etc.)
- Add database schema documentation (DBML format)
- Remove old test-types-reference.md documentation
- UI improvements: compact design, updated sidebar, modal sizing
- Update DataTable, Modal, SelectDropdown components for compact style
- Enhance patient and visit modals with compact layout
2026-02-18 16:31:20 +07:00
|
|
|
|
import { fetchTests, fetchTest, createTest, updateTest, deleteTest } from '$lib/api/tests.js';
|
2026-02-13 16:07:59 +07:00
|
|
|
|
import { fetchDisciplines, fetchDepartments } from '$lib/api/organization.js';
|
2026-02-18 07:12:58 +07:00
|
|
|
|
import { success as toastSuccess, error as toastError } from '$lib/utils/toast.js';
|
2026-02-13 16:07:59 +07:00
|
|
|
|
import DataTable from '$lib/components/DataTable.svelte';
|
|
|
|
|
|
import Modal from '$lib/components/Modal.svelte';
|
2026-02-20 13:51:54 +07:00
|
|
|
|
import TestFormModal from './test-modal/TestFormModal.svelte';
|
2026-02-20 16:49:34 +07:00
|
|
|
|
import TestTypePickerModal from './test-modal/modals/TestTypePickerModal.svelte';
|
2026-02-20 13:51:54 +07:00
|
|
|
|
import { Plus, Edit2, Trash2, ArrowLeft, Search, Microscope, Variable, Calculator, Box, Layers, Loader2, Users } from 'lucide-svelte';
|
2026-02-18 07:12:58 +07:00
|
|
|
|
|
2026-02-20 13:51:54 +07:00
|
|
|
|
let loading = $state(false);
|
|
|
|
|
|
let tests = $state([]);
|
|
|
|
|
|
let disciplines = $state([]);
|
|
|
|
|
|
let departments = $state([]);
|
|
|
|
|
|
let searchQuery = $state('');
|
|
|
|
|
|
let modalOpen = $state(false);
|
|
|
|
|
|
let modalMode = $state('create');
|
|
|
|
|
|
let selectedTestId = $state(null);
|
2026-02-20 16:49:34 +07:00
|
|
|
|
let selectedTestType = $state('TEST');
|
2026-02-20 13:51:54 +07:00
|
|
|
|
let deleteConfirmOpen = $state(false);
|
|
|
|
|
|
let deleteItem = $state(null);
|
|
|
|
|
|
let deleting = $state(false);
|
2026-02-20 16:49:34 +07:00
|
|
|
|
let testTypePickerOpen = $state(false);
|
2026-02-18 07:12:58 +07:00
|
|
|
|
|
2026-02-20 13:51:54 +07:00
|
|
|
|
const testTypeConfig = {
|
|
|
|
|
|
TEST: { label: 'Test', badgeClass: 'badge-primary', icon: Microscope, color: '#0066CC', bgColor: '#E6F2FF' },
|
|
|
|
|
|
PARAM: { label: 'Parameter', badgeClass: 'badge-secondary', icon: Variable, color: '#3399FF', bgColor: '#F0F8FF' },
|
|
|
|
|
|
CALC: { label: 'Calculated', badgeClass: 'badge-accent', icon: Calculator, color: '#9933CC', bgColor: '#F5E6FF' },
|
|
|
|
|
|
GROUP: { label: 'Panel', badgeClass: 'badge-info', icon: Box, color: '#00AA44', bgColor: '#E6F9EE' },
|
|
|
|
|
|
TITLE: { label: 'Header', badgeClass: 'badge-ghost', icon: Layers, color: '#666666', bgColor: '#F5F5F5' }
|
|
|
|
|
|
};
|
2026-02-18 07:12:58 +07:00
|
|
|
|
|
2026-02-20 13:51:54 +07:00
|
|
|
|
const columns = [
|
|
|
|
|
|
{ key: 'TestSiteCode', label: 'Code', class: 'font-medium w-24' },
|
|
|
|
|
|
{ key: 'TestSiteName', label: 'Name', class: 'min-w-[200px]' },
|
|
|
|
|
|
{ key: 'TestType', label: 'Type', class: 'w-28' },
|
|
|
|
|
|
{ key: 'DisciplineName', label: 'Discipline', class: 'w-32' },
|
|
|
|
|
|
{ key: 'DepartmentName', label: 'Department', class: 'w-32' },
|
|
|
|
|
|
{ key: 'Visible', label: 'Visible', class: 'w-24 text-center' },
|
|
|
|
|
|
{ key: 'actions', label: 'Actions', class: 'w-24 text-center' }
|
|
|
|
|
|
];
|
2026-02-18 07:12:58 +07:00
|
|
|
|
|
2026-02-20 13:51:54 +07:00
|
|
|
|
const filteredTests = $derived.by(() => {
|
|
|
|
|
|
if (!searchQuery.trim()) return tests;
|
|
|
|
|
|
const query = searchQuery.toLowerCase().trim();
|
|
|
|
|
|
return tests.filter(test => {
|
|
|
|
|
|
const code = (test.TestSiteCode || '').toLowerCase();
|
|
|
|
|
|
const name = (test.TestSiteName || '').toLowerCase();
|
|
|
|
|
|
return code.includes(query) || name.includes(query);
|
|
|
|
|
|
});
|
|
|
|
|
|
});
|
2026-02-19 07:12:11 +07:00
|
|
|
|
|
2026-02-20 13:51:54 +07:00
|
|
|
|
onMount(async () => {
|
|
|
|
|
|
await Promise.all([loadTests(), loadDisciplines(), loadDepartments()]);
|
|
|
|
|
|
});
|
2026-02-19 07:12:11 +07:00
|
|
|
|
|
2026-02-20 13:51:54 +07:00
|
|
|
|
async function loadTests() {
|
|
|
|
|
|
loading = true;
|
|
|
|
|
|
try {
|
|
|
|
|
|
const response = await fetchTests();
|
|
|
|
|
|
tests = Array.isArray(response.data) ? response.data.filter(t => t.IsActive !== '0' && t.IsActive !== 0) : [];
|
|
|
|
|
|
} catch (err) {
|
|
|
|
|
|
toastError(err.message || 'Failed to load tests');
|
|
|
|
|
|
tests = [];
|
|
|
|
|
|
} finally {
|
|
|
|
|
|
loading = false;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
refactor(tests): Move TestModal to route folder and add technical config support
- Move TestModal from lib/components to routes/(app)/master-data/tests
- Add technical configuration form (ResultType, RefType, SpcType, units, etc.)
- Add GroupMembersTab for managing group test members
- Enhance reference ranges with refvset and refthold support
- Update API to handle new test fields (ReqQty, Factor, Decimal, TAT, etc.)
- Add database schema documentation (DBML format)
- Remove old test-types-reference.md documentation
- UI improvements: compact design, updated sidebar, modal sizing
- Update DataTable, Modal, SelectDropdown components for compact style
- Enhance patient and visit modals with compact layout
2026-02-18 16:31:20 +07:00
|
|
|
|
|
2026-02-20 13:51:54 +07:00
|
|
|
|
async function loadDisciplines() {
|
|
|
|
|
|
try {
|
|
|
|
|
|
const response = await fetchDisciplines();
|
|
|
|
|
|
disciplines = Array.isArray(response.data) ? response.data : [];
|
|
|
|
|
|
} catch (err) {
|
|
|
|
|
|
console.error('Failed to load disciplines:', err);
|
|
|
|
|
|
disciplines = [];
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
refactor(tests): Move TestModal to route folder and add technical config support
- Move TestModal from lib/components to routes/(app)/master-data/tests
- Add technical configuration form (ResultType, RefType, SpcType, units, etc.)
- Add GroupMembersTab for managing group test members
- Enhance reference ranges with refvset and refthold support
- Update API to handle new test fields (ReqQty, Factor, Decimal, TAT, etc.)
- Add database schema documentation (DBML format)
- Remove old test-types-reference.md documentation
- UI improvements: compact design, updated sidebar, modal sizing
- Update DataTable, Modal, SelectDropdown components for compact style
- Enhance patient and visit modals with compact layout
2026-02-18 16:31:20 +07:00
|
|
|
|
|
2026-02-20 13:51:54 +07:00
|
|
|
|
async function loadDepartments() {
|
|
|
|
|
|
try {
|
|
|
|
|
|
const response = await fetchDepartments();
|
|
|
|
|
|
departments = Array.isArray(response.data) ? response.data : [];
|
|
|
|
|
|
} catch (err) {
|
|
|
|
|
|
console.error('Failed to load departments:', err);
|
|
|
|
|
|
departments = [];
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
refactor(tests): Move TestModal to route folder and add technical config support
- Move TestModal from lib/components to routes/(app)/master-data/tests
- Add technical configuration form (ResultType, RefType, SpcType, units, etc.)
- Add GroupMembersTab for managing group test members
- Enhance reference ranges with refvset and refthold support
- Update API to handle new test fields (ReqQty, Factor, Decimal, TAT, etc.)
- Add database schema documentation (DBML format)
- Remove old test-types-reference.md documentation
- UI improvements: compact design, updated sidebar, modal sizing
- Update DataTable, Modal, SelectDropdown components for compact style
- Enhance patient and visit modals with compact layout
2026-02-18 16:31:20 +07:00
|
|
|
|
|
2026-02-20 13:51:54 +07:00
|
|
|
|
function openCreateModal() {
|
2026-02-20 16:49:34 +07:00
|
|
|
|
testTypePickerOpen = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function handleTestTypeSelect(type) {
|
|
|
|
|
|
selectedTestType = type;
|
2026-02-20 13:51:54 +07:00
|
|
|
|
modalMode = 'create';
|
|
|
|
|
|
selectedTestId = null;
|
refactor(tests): Move TestModal to route folder and add technical config support
- Move TestModal from lib/components to routes/(app)/master-data/tests
- Add technical configuration form (ResultType, RefType, SpcType, units, etc.)
- Add GroupMembersTab for managing group test members
- Enhance reference ranges with refvset and refthold support
- Update API to handle new test fields (ReqQty, Factor, Decimal, TAT, etc.)
- Add database schema documentation (DBML format)
- Remove old test-types-reference.md documentation
- UI improvements: compact design, updated sidebar, modal sizing
- Update DataTable, Modal, SelectDropdown components for compact style
- Enhance patient and visit modals with compact layout
2026-02-18 16:31:20 +07:00
|
|
|
|
modalOpen = true;
|
|
|
|
|
|
}
|
2026-02-15 17:58:42 +07:00
|
|
|
|
|
2026-02-20 13:51:54 +07:00
|
|
|
|
async function openEditModal(row) {
|
|
|
|
|
|
modalMode = 'edit';
|
|
|
|
|
|
selectedTestId = row.TestSiteID;
|
|
|
|
|
|
modalOpen = true;
|
|
|
|
|
|
}
|
refactor(tests): Move TestModal to route folder and add technical config support
- Move TestModal from lib/components to routes/(app)/master-data/tests
- Add technical configuration form (ResultType, RefType, SpcType, units, etc.)
- Add GroupMembersTab for managing group test members
- Enhance reference ranges with refvset and refthold support
- Update API to handle new test fields (ReqQty, Factor, Decimal, TAT, etc.)
- Add database schema documentation (DBML format)
- Remove old test-types-reference.md documentation
- UI improvements: compact design, updated sidebar, modal sizing
- Update DataTable, Modal, SelectDropdown components for compact style
- Enhance patient and visit modals with compact layout
2026-02-18 16:31:20 +07:00
|
|
|
|
|
2026-02-20 13:51:54 +07:00
|
|
|
|
function getTestTypeConfig(type) {
|
|
|
|
|
|
return testTypeConfig[type] || testTypeConfig.TEST;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function confirmDelete(row) {
|
|
|
|
|
|
deleteItem = row;
|
|
|
|
|
|
deleteConfirmOpen = true;
|
|
|
|
|
|
}
|
refactor(tests): Move TestModal to route folder and add technical config support
- Move TestModal from lib/components to routes/(app)/master-data/tests
- Add technical configuration form (ResultType, RefType, SpcType, units, etc.)
- Add GroupMembersTab for managing group test members
- Enhance reference ranges with refvset and refthold support
- Update API to handle new test fields (ReqQty, Factor, Decimal, TAT, etc.)
- Add database schema documentation (DBML format)
- Remove old test-types-reference.md documentation
- UI improvements: compact design, updated sidebar, modal sizing
- Update DataTable, Modal, SelectDropdown components for compact style
- Enhance patient and visit modals with compact layout
2026-02-18 16:31:20 +07:00
|
|
|
|
|
2026-02-20 13:51:54 +07:00
|
|
|
|
async function handleDelete() {
|
|
|
|
|
|
deleting = true;
|
|
|
|
|
|
try {
|
|
|
|
|
|
await deleteTest(deleteItem.TestSiteID);
|
|
|
|
|
|
toastSuccess('Test deleted successfully');
|
|
|
|
|
|
deleteConfirmOpen = false;
|
refactor(tests): Move TestModal to route folder and add technical config support
- Move TestModal from lib/components to routes/(app)/master-data/tests
- Add technical configuration form (ResultType, RefType, SpcType, units, etc.)
- Add GroupMembersTab for managing group test members
- Enhance reference ranges with refvset and refthold support
- Update API to handle new test fields (ReqQty, Factor, Decimal, TAT, etc.)
- Add database schema documentation (DBML format)
- Remove old test-types-reference.md documentation
- UI improvements: compact design, updated sidebar, modal sizing
- Update DataTable, Modal, SelectDropdown components for compact style
- Enhance patient and visit modals with compact layout
2026-02-18 16:31:20 +07:00
|
|
|
|
await loadTests();
|
|
|
|
|
|
} catch (err) {
|
2026-02-20 13:51:54 +07:00
|
|
|
|
toastError(err.message || 'Failed to delete test');
|
refactor(tests): Move TestModal to route folder and add technical config support
- Move TestModal from lib/components to routes/(app)/master-data/tests
- Add technical configuration form (ResultType, RefType, SpcType, units, etc.)
- Add GroupMembersTab for managing group test members
- Enhance reference ranges with refvset and refthold support
- Update API to handle new test fields (ReqQty, Factor, Decimal, TAT, etc.)
- Add database schema documentation (DBML format)
- Remove old test-types-reference.md documentation
- UI improvements: compact design, updated sidebar, modal sizing
- Update DataTable, Modal, SelectDropdown components for compact style
- Enhance patient and visit modals with compact layout
2026-02-18 16:31:20 +07:00
|
|
|
|
} finally {
|
2026-02-20 13:51:54 +07:00
|
|
|
|
deleting = false;
|
refactor(tests): Move TestModal to route folder and add technical config support
- Move TestModal from lib/components to routes/(app)/master-data/tests
- Add technical configuration form (ResultType, RefType, SpcType, units, etc.)
- Add GroupMembersTab for managing group test members
- Enhance reference ranges with refvset and refthold support
- Update API to handle new test fields (ReqQty, Factor, Decimal, TAT, etc.)
- Add database schema documentation (DBML format)
- Remove old test-types-reference.md documentation
- UI improvements: compact design, updated sidebar, modal sizing
- Update DataTable, Modal, SelectDropdown components for compact style
- Enhance patient and visit modals with compact layout
2026-02-18 16:31:20 +07:00
|
|
|
|
}
|
2026-02-18 07:12:58 +07:00
|
|
|
|
}
|
2026-02-13 16:07:59 +07:00
|
|
|
|
</script>
|
|
|
|
|
|
|
refactor(tests): Move TestModal to route folder and add technical config support
- Move TestModal from lib/components to routes/(app)/master-data/tests
- Add technical configuration form (ResultType, RefType, SpcType, units, etc.)
- Add GroupMembersTab for managing group test members
- Enhance reference ranges with refvset and refthold support
- Update API to handle new test fields (ReqQty, Factor, Decimal, TAT, etc.)
- Add database schema documentation (DBML format)
- Remove old test-types-reference.md documentation
- UI improvements: compact design, updated sidebar, modal sizing
- Update DataTable, Modal, SelectDropdown components for compact style
- Enhance patient and visit modals with compact layout
2026-02-18 16:31:20 +07:00
|
|
|
|
<div class="p-4">
|
2026-02-13 16:07:59 +07:00
|
|
|
|
<div class="flex items-center gap-4 mb-6">
|
2026-02-20 13:51:54 +07:00
|
|
|
|
<a href="/master-data" class="btn btn-ghost btn-circle">
|
|
|
|
|
|
<ArrowLeft class="w-5 h-5" />
|
|
|
|
|
|
</a>
|
2026-02-13 16:07:59 +07:00
|
|
|
|
<div class="flex-1">
|
2026-02-19 16:30:41 +07:00
|
|
|
|
<h1 class="text-xl font-bold text-gray-800">Test Definitions</h1>
|
|
|
|
|
|
<p class="text-sm text-gray-600">Manage laboratory tests, panels, and calculated values</p>
|
2026-02-13 16:07:59 +07:00
|
|
|
|
</div>
|
2026-02-20 13:51:54 +07:00
|
|
|
|
<button class="btn btn-primary" onclick={openCreateModal}>
|
|
|
|
|
|
<Plus class="w-4 h-4 mr-2" />
|
|
|
|
|
|
Add Test
|
|
|
|
|
|
</button>
|
2026-02-13 16:07:59 +07:00
|
|
|
|
</div>
|
|
|
|
|
|
|
2026-02-20 13:51:54 +07:00
|
|
|
|
<div class="mb-4">
|
feat(equipment,organization): add equipment API client and complete organization module structure
- Add equipment.js API client with full CRUD operations
- Add organization sub-routes: account, department, discipline, instrument, site, workstation
- Create EquipmentModal and DeleteConfirmModal components
- Update master-data navigation and sidebar
- Update tests, containers, counters, geography, locations, occupations, specialties, testmap, and valuesets pages
- Add COMPONENT_ORGANIZATION.md documentation
2026-02-24 16:53:04 +07:00
|
|
|
|
<div class="max-w-md">
|
|
|
|
|
|
<label class="input input-sm input-bordered w-full flex items-center gap-2">
|
|
|
|
|
|
<Search class="w-5 h-5 text-gray-400" />
|
|
|
|
|
|
<input
|
|
|
|
|
|
type="text"
|
|
|
|
|
|
class="grow"
|
|
|
|
|
|
placeholder="Search by code or name..."
|
|
|
|
|
|
bind:value={searchQuery}
|
|
|
|
|
|
/>
|
|
|
|
|
|
{#if searchQuery}
|
|
|
|
|
|
<button
|
|
|
|
|
|
class="btn btn-ghost btn-xs btn-circle"
|
|
|
|
|
|
onclick={() => searchQuery = ''}
|
|
|
|
|
|
>
|
|
|
|
|
|
×
|
|
|
|
|
|
</button>
|
|
|
|
|
|
{/if}
|
|
|
|
|
|
</label>
|
2026-02-13 16:07:59 +07:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="bg-base-100 rounded-lg shadow border border-base-200">
|
2026-02-20 13:51:54 +07:00
|
|
|
|
{#if loading}
|
|
|
|
|
|
<div class="flex items-center justify-center py-16">
|
|
|
|
|
|
<Loader2 class="w-8 h-8 animate-spin text-primary mr-3" />
|
|
|
|
|
|
<span class="text-gray-600">Loading tests...</span>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
{:else if filteredTests.length === 0}
|
|
|
|
|
|
<div class="flex flex-col items-center justify-center py-16 px-4">
|
|
|
|
|
|
<div class="bg-base-200 rounded-full p-6 mb-4">
|
|
|
|
|
|
<Microscope class="w-12 h-12 text-gray-400" />
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<h3 class="text-base font-semibold text-gray-700 mb-1">
|
|
|
|
|
|
{searchQuery ? 'No tests found' : 'No tests yet'}
|
|
|
|
|
|
</h3>
|
|
|
|
|
|
<p class="text-xs text-gray-500 text-center max-w-sm mb-4">
|
|
|
|
|
|
{searchQuery
|
|
|
|
|
|
? `No tests matching "${searchQuery}". Try a different search term.`
|
|
|
|
|
|
: 'Get started by adding your first laboratory test.'}
|
|
|
|
|
|
</p>
|
|
|
|
|
|
{#if !searchQuery}
|
|
|
|
|
|
<button class="btn btn-primary" onclick={openCreateModal}>
|
|
|
|
|
|
<Plus class="w-4 h-4 mr-2" />
|
|
|
|
|
|
Add First Test
|
|
|
|
|
|
</button>
|
|
|
|
|
|
{/if}
|
|
|
|
|
|
</div>
|
|
|
|
|
|
{:else}
|
|
|
|
|
|
<DataTable
|
|
|
|
|
|
{columns}
|
|
|
|
|
|
data={filteredTests}
|
|
|
|
|
|
loading={false}
|
|
|
|
|
|
emptyMessage="No tests found"
|
|
|
|
|
|
hover={true}
|
|
|
|
|
|
bordered={false}
|
|
|
|
|
|
>
|
|
|
|
|
|
{#snippet cell({ column, row, value })}
|
|
|
|
|
|
{@const typeConfig = getTestTypeConfig(row.TestType)}
|
|
|
|
|
|
{@const IconComponent = typeConfig.icon}
|
|
|
|
|
|
{#if column.key === 'TestType'}
|
|
|
|
|
|
<span class="badge gap-1" style="background-color: {typeConfig.bgColor}; color: {typeConfig.color}; border-color: {typeConfig.color};">
|
|
|
|
|
|
<IconComponent class="w-3 h-3" />
|
|
|
|
|
|
{typeConfig.label}
|
|
|
|
|
|
</span>
|
|
|
|
|
|
{:else if column.key === 'Visible'}
|
|
|
|
|
|
<div class="flex justify-center gap-2">
|
|
|
|
|
|
<span class="badge {row.VisibleScr === '1' || row.VisibleScr === 1 ? 'badge-success' : 'badge-ghost'} badge-sm">S</span>
|
|
|
|
|
|
<span class="badge {row.VisibleRpt === '1' || row.VisibleRpt === 1 ? 'badge-success' : 'badge-ghost'} badge-sm">R</span>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
{:else if column.key === 'actions'}
|
|
|
|
|
|
<div class="flex justify-center gap-2">
|
|
|
|
|
|
<button class="btn btn-sm btn-ghost" onclick={() => openEditModal(row)} title="Edit test">
|
|
|
|
|
|
<Edit2 class="w-4 h-4" />
|
|
|
|
|
|
</button>
|
|
|
|
|
|
<button class="btn btn-sm btn-ghost text-error" onclick={() => confirmDelete(row)} title="Delete test">
|
|
|
|
|
|
<Trash2 class="w-4 h-4" />
|
|
|
|
|
|
</button>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
{:else}
|
|
|
|
|
|
{value || '-'}
|
|
|
|
|
|
{/if}
|
|
|
|
|
|
{/snippet}
|
|
|
|
|
|
</DataTable>
|
|
|
|
|
|
{/if}
|
2026-02-13 16:07:59 +07:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
2026-02-20 16:49:34 +07:00
|
|
|
|
<TestTypePickerModal
|
|
|
|
|
|
bind:open={testTypePickerOpen}
|
|
|
|
|
|
onselect={handleTestTypeSelect}
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
2026-02-20 13:51:54 +07:00
|
|
|
|
<TestFormModal
|
refactor(tests): Move TestModal to route folder and add technical config support
- Move TestModal from lib/components to routes/(app)/master-data/tests
- Add technical configuration form (ResultType, RefType, SpcType, units, etc.)
- Add GroupMembersTab for managing group test members
- Enhance reference ranges with refvset and refthold support
- Update API to handle new test fields (ReqQty, Factor, Decimal, TAT, etc.)
- Add database schema documentation (DBML format)
- Remove old test-types-reference.md documentation
- UI improvements: compact design, updated sidebar, modal sizing
- Update DataTable, Modal, SelectDropdown components for compact style
- Enhance patient and visit modals with compact layout
2026-02-18 16:31:20 +07:00
|
|
|
|
bind:open={modalOpen}
|
|
|
|
|
|
mode={modalMode}
|
2026-02-20 13:51:54 +07:00
|
|
|
|
testId={selectedTestId}
|
2026-02-20 16:49:34 +07:00
|
|
|
|
initialTestType={selectedTestType}
|
2026-02-20 13:51:54 +07:00
|
|
|
|
{disciplines}
|
|
|
|
|
|
{departments}
|
|
|
|
|
|
{tests}
|
|
|
|
|
|
onsave={async () => {
|
|
|
|
|
|
modalOpen = false;
|
|
|
|
|
|
await loadTests();
|
|
|
|
|
|
}}
|
refactor(tests): Move TestModal to route folder and add technical config support
- Move TestModal from lib/components to routes/(app)/master-data/tests
- Add technical configuration form (ResultType, RefType, SpcType, units, etc.)
- Add GroupMembersTab for managing group test members
- Enhance reference ranges with refvset and refthold support
- Update API to handle new test fields (ReqQty, Factor, Decimal, TAT, etc.)
- Add database schema documentation (DBML format)
- Remove old test-types-reference.md documentation
- UI improvements: compact design, updated sidebar, modal sizing
- Update DataTable, Modal, SelectDropdown components for compact style
- Enhance patient and visit modals with compact layout
2026-02-18 16:31:20 +07:00
|
|
|
|
/>
|
2026-02-15 17:58:42 +07:00
|
|
|
|
|
2026-02-20 13:51:54 +07:00
|
|
|
|
<Modal bind:open={deleteConfirmOpen} title="Confirm Delete" size="sm">
|
2026-02-15 17:58:42 +07:00
|
|
|
|
<div class="py-2">
|
2026-02-20 13:51:54 +07:00
|
|
|
|
<p class="text-base-content/80">
|
|
|
|
|
|
Are you sure you want to delete <strong class="text-base-content">{deleteItem?.TestSiteName}</strong>?
|
|
|
|
|
|
</p>
|
|
|
|
|
|
{#if deleteItem?.TestSiteCode}
|
|
|
|
|
|
<p class="text-sm text-gray-500 mt-1">Code: {deleteItem.TestSiteCode}</p>
|
|
|
|
|
|
{/if}
|
|
|
|
|
|
<p class="text-sm text-error mt-3">This action cannot be undone.</p>
|
2026-02-15 17:58:42 +07:00
|
|
|
|
</div>
|
2026-02-20 13:51:54 +07:00
|
|
|
|
{#snippet footer()}
|
|
|
|
|
|
<button class="btn btn-ghost" onclick={() => (deleteConfirmOpen = false)} type="button" disabled={deleting}>Cancel</button>
|
|
|
|
|
|
<button class="btn btn-error" onclick={handleDelete} disabled={deleting} type="button">
|
|
|
|
|
|
{#if deleting}
|
|
|
|
|
|
<span class="loading loading-spinner loading-sm mr-2"></span>
|
|
|
|
|
|
{/if}
|
|
|
|
|
|
{deleting ? 'Deleting...' : 'Delete'}
|
|
|
|
|
|
</button>
|
|
|
|
|
|
{/snippet}
|
|
|
|
|
|
</Modal>
|