**Test Group Member Management:**
- Refactor member data structure from simple ID array to object array with sequence numbers
- Update member objects to include both TestSiteID and Member (sequence) fields
- Fix addMember() to assign sequential Member numbers automatically
- Fix removeMember() to re-sequence remaining members after removal
- Fix moveMember() to properly swap and re-sequence members
- Add sorting by sequence number in members list display
- Update payload builder in tests.js to use proper object structure for API
- Update TestFormModal.svelte member mapping for edit mode
**Documentation:**
- Add TypeScript Types section to AGENTS.md with TestType and TestSummary examples
- Reorganize TODO.md with new test type categories and backend notes
**Cleanup:**
- Remove deprecated OpenSpec skills from .opencode/ directory:
- opsx-apply.md, opsx-archive.md, opsx-explore.md, opsx-propose.md
- openspec-apply-change/SKILL.md, openspec-archive-change/SKILL.md
- openspec-explore/SKILL.md, openspec-propose/SKILL.md
**New Files:**
- Add .serena/memories/ for code style conventions and task tracking
- Add orders API module with CRUD operations (src/lib/api/orders.js)
- Create orders page with search, list, form, and detail modals
- Add patient visits ADT form modal for admission/discharge/transfer
- Update test management: add Requestable field to BasicInfoTab
- Add API documentation for orders and patient visits endpoints
- Update visits page to integrate with orders functionality
Features:
- Order creation with auto-grouped specimens by container type
- Order status tracking (ORD, SCH, ANA, VER, REV, REP)
- Priority levels (Routine, Stat, Urgent)
- Order detail view with specimens and tests
- ADT (Admission/Discharge/Transfer) management for visits
- Change API endpoints from /api/tests to /api/test (singular form)
- Refactor search: split single search field into separate code and name inputs
- Add new ThresholdTab.svelte component for threshold management
- Update TestFormModal to include threshold configuration
- Refactor RefNumTab, RefTxtTab, and TechDetailsTab for improved UX
- Update tests page to use separate TestSiteCode and TestSiteName search params
- Improve test data table with better pagination and search handling
- Consolidate fragmented test modal components into unified TestFormModal.svelte
- Reorganize reference range components into organized tabs (RefNumTab, RefTxtTab)
- Add new tab components: BasicInfoTab, TechDetailsTab, CalcDetailsTab, MappingsTab, GroupMembersTab
- Move test-related type definitions to src/lib/types/test.types.ts for better type organization
- Delete old component files: TestModal.svelte and 10+ sub-components
- Add backup directory for old component preservation
- Update AGENTS.md with coding guidelines and project conventions
- Update tests.js API client with improved structure
- Add documentation for frontend test management architecture
- 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
- Update API documentation to remove SpecimenType from examples
- Remove SpecimenType from tests API client
- Remove specimen type dropdown and handling from tests page
- Add VisitADTHistoryModal for ADT tracking
- Create specimens API client
- Add HelpTooltip component
- Enhance all master data pages with improved UI
- Update patient pages and visit management
- Add implementation plans and API docs