Test Definitions

Manage laboratory tests and panels

e.key === 'Enter' && handleSearch()} />
({ ...t, DisciplineName: disciplines.find(d => d.DisciplineID === t.DisciplineID)?.DisciplineName || '-', DepartmentName: departments.find(d => d.DepartmentID === t.DepartmentID)?.DepartmentName || '-' }))} {loading} emptyMessage="No tests found" hover={true} bordered={false} > {#snippet cell({ column, row, value })} {#if column.key === 'TestType'} {testTypeLabels[value] || value} {:else if column.key === 'actions'}
{:else} {value || '-'} {/if} {/snippet}
{#if totalPages > 1}
Showing {(currentPage - 1) * perPage + 1} - {Math.min(currentPage * perPage, totalItems)} of {totalItems}
Page {currentPage} of {totalPages}
{/if}
{#if canHaveRefRange} {/if}
{#if activeTab === 'basic'}
{ e.preventDefault(); handleSave(); }}>
{#if canHaveUnit}
{#if canHaveFormula}
Use test codes with operators: +, -, *, /
{/if}
{/if}
Visibility
{:else if activeTab === 'refrange' && canHaveRefRange}

Reference Range Type

{#if formData.refRangeType === 'numeric'}

Numeric Reference Ranges

{#if formData.refnum.length === 0}

No numeric ranges defined

{/if} {#each formData.refnum as ref, index (index)} {@const validationErrors = validateNumericRange(ref, index)}
Range {index + 1} {#if validationErrors.length > 0} Invalid {/if}

1 Patient Demographics

Range Type
Sex
Age From (years) ref.AgeEnd} />
Age To (years) ref.AgeEnd} />
{#if ref.AgeStart !== null && ref.AgeEnd !== null && ref.AgeStart > ref.AgeEnd}

Age start cannot be greater than age end

{/if}

2 Range Values

Lower Bound
{signOptions.find(o => o.value === ref.LowSign)?.description}
Upper Bound
{signOptions.find(o => o.value === ref.HighSign)?.description}
{#if ref.Low !== null && ref.High !== null} {@const lowLabel = getSignLabel(ref.LowSign)} {@const highLabel = getSignLabel(ref.HighSign)}
Preview: {lowLabel} {ref.Low} and {highLabel} {ref.High} {#if ref.Low > ref.High} ⚠ Low value exceeds High value {/if}
{/if}

3 Result Interpretation

Flag
Interpretation
{/each}
{/if} {#if formData.refRangeType === 'text'}

Text Reference Ranges

{#if formData.reftxt.length === 0}

No text ranges defined

{/if} {#each formData.reftxt as ref, index (index)} {@const validationErrors = validateTextRange(ref, index)}
Range {index + 1} {#if validationErrors.length > 0} Invalid {/if}

1 Patient Demographics

Reference Type
Sex
Age From (years) ref.AgeEnd} />
Age To (years) ref.AgeEnd} />
{#if ref.AgeStart !== null && ref.AgeEnd !== null && ref.AgeStart > ref.AgeEnd}

Age start cannot be greater than age end

{/if}

2 Reference Text

{#if ref.TxtRefType === 'VSET'} Format: CODE=Description;CODE2=Description2 {:else} Enter descriptive text for the reference range {/if}

3 Result Flag

{/each}
{/if}
{/if} {#snippet footer()} {/snippet}

Are you sure you want to delete this test?

Code: {testToDelete?.TestSiteCode}
Name: {testToDelete?.TestSiteName}

This will deactivate the test. It will no longer appear in test lists but historical data will be preserved.

{#snippet footer()} {/snippet}