Lab Vendors

A complete guide to the Lab Vendors module — managing external laboratory suppliers, contracts, accreditations, and linking vendors to test reports and inventory.

Written By Dev010

Last updated 19 days ago

The Lab Vendors module manages external laboratory suppliers that your clinic works with for diagnostic testing. Vendors can be linked to test reports when samples are sent externally and to inventory items when supplies are purchased from a specific supplier. This gives you a centralized record of every external lab relationship the clinic maintains.

Accessing the Module

Sidebar → Lab Vendors

Direct URL:

https://yourdomain.com/dashboard/lab-vendors

Who can access:

Action

Admin

Doctor

Receptionist

Nurse

View lab vendors

Create lab vendor

Edit lab vendor

Delete lab vendor

Lab Vendors is an Admin-only module. It is not visible in the sidebar for Doctor, Receptionist, or Nurse roles. Adjust in Dashboard → Permissions if other roles need access.

Lab Vendors List

The main lab vendors page shows a complete list of all external lab suppliers.

Each row displays:

  • Vendor name

  • Vendor code

  • Lab type

  • Contact person

  • Phone

  • Email

  • Rating

  • Tier

  • Status badge (active / inactive)

  • Action buttons (edit, delete)

Search

The search bar filters vendors by:

  • Vendor name

  • Contact person

  • City

Results update as you type.

Creating a Lab Vendor

Click the Add Vendor button on the lab vendors list page.

Direct URL:

https://yourdomain.com/dashboard/lab-vendors/new

Required Fields

Field

Notes

Name

Vendor or laboratory name

Optional Fields

Identity:

Field

Notes

Code

Short vendor identifier (e.g. LAB001, BIOXCEL)

Lab Type

Type of laboratory (e.g. Clinical, Pathology, Microbiology, Radiology)

Contact Information:

Field

Notes

Contact Person

Primary point of contact at the lab

Email

Vendor contact email

Phone

Vendor contact phone

Website

Lab website URL

Location:

Field

Notes

Address

Street address

City

City

State

State or region

Zip Code

Postal code

Accreditation and Quality:

Field

Notes

License Number

Official lab operating license number

Accreditations

Certifications and accreditations (e.g. ISO 15189, CAP, CLIA)

Rating

Numeric rating from 0.0 to 5.0 — your internal quality rating

Service Details:

Field

Notes

Specialties

Areas of laboratory specialization

Turnaround Hours

Typical result delivery time in hours

Tier

Vendor tier classification (e.g. Primary, Secondary, Emergency)

Contract Details:

Field

Notes

Contract Start Date

When the service agreement began

Contract End Date

When the agreement expires

Contract Terms

Key contract terms and conditions

Status:

Field

Notes

Active

Toggle — inactive vendors are hidden from test report dropdowns

Status

active by default

Notes

Additional notes about the vendor relationship

Saving the Vendor

Click Create Vendor to save. The vendor appears immediately in the lab vendors list and becomes available for selection when creating test reports and linking inventory items.

Editing a Lab Vendor

Click the Edit button on any vendor row. An edit sheet slides in with all existing values pre-filled.

All fields are editable. Common edit operations include:

  • Updating contract dates on renewal

  • Updating turnaround hours based on recent performance

  • Adjusting the rating after quality review

  • Adding new accreditations

Vendor Tiers

The Tier field classifies vendors by their role in your lab network:

Tier

Description

Primary

Main vendor for routine tests

Secondary

Backup vendor used when primary is unavailable

Emergency

Used exclusively for urgent or STAT requests

Specialized

Used only for specific test types

Reference

Reference laboratory for complex or rare tests

Tier assignment helps staff know which vendor to use for different types of test requests without needing to check contracts manually.

Vendor Rating

The Rating field stores a numeric quality rating from 0.0 to 5.0. This is your clinic's internal assessment of the vendor based on:

  • Result accuracy

  • Turnaround time adherence

  • Communication quality

  • Sample handling

  • Report format quality

Update ratings periodically after quality reviews to keep them meaningful. Higher rated vendors should generally be preferred for routine work.

Contract Management

Lab vendors often operate under formal service agreements. Record contract details to keep track of:

Contract Start Date — When the current agreement became active.

Contract End Date — When the agreement expires. Review vendors with upcoming contract end dates to renegotiate or switch vendors before expiry.

Contract Terms — Key terms such as pricing commitments, volume requirements, SLA penalties, or exclusivity clauses.

Finding Vendors With Expiring Contracts

Run this query in Supabase SQL Editor to identify contracts expiring in the next 60 days:

SELECT name, contact_person, email,
       contract_end_date, tier
FROM lab_vendors
WHERE contract_end_date <= now() + interval '60 days'
  AND contract_end_date >= now()
  AND is_active = 1
ORDER BY contract_end_date ASC;

Linking Vendors to Test Reports

When a patient sample is sent to an external lab, link the test report to the vendor:

  1. Sidebar → Test Reports → Add Test Report

  2. In the Lab Vendor field, search for and select the vendor

  3. Complete the rest of the test report form

  4. Save

This creates a traceable link between the test result and the external lab that produced it — useful for audit purposes and for investigating result quality issues back to specific vendors.

Reviewing Test Volume Per Vendor

To see how many test reports have been sent to each vendor:

SELECT lv.name, lv.tier, lv.rating,
       COUNT(tr.id) as total_reports,
       COUNT(CASE WHEN tr.status = 'verified' 
             THEN 1 END) as verified_reports
FROM lab_vendors lv
LEFT JOIN test_reports tr 
  ON tr.lab_vendor_id = lv.id
GROUP BY lv.id, lv.name, lv.tier, lv.rating
ORDER BY total_reports DESC;

Linking Vendors to Inventory

Lab vendors can also act as suppliers for inventory items. When an inventory item is purchased from a vendor that exists in the Lab Vendors module, link them:

  1. Sidebar → Inventory → Edit the item

  2. In the Supplier ID field, search for and select the vendor

  3. Save

This connects the financial cost of purchasing supplies to the specific vendor supplying them — useful for supplier performance reviews and spend analysis.

Deactivating a Vendor

If a vendor relationship ends but historical test reports reference the vendor, deactivate rather than delete.

Edit the vendor → toggle Active to off → Save.

Deactivated vendors:

  • Are hidden from test report and inventory dropdowns

  • Preserve all historical links to test reports and inventory items

  • Can be reactivated if the relationship resumes

Deleting a Vendor

Click the Delete option from the vendor row action menu.

A confirmation dialog appears before deletion.

⚠️ Deleting a lab vendor sets lab_vendor_id to null on all linked test reports and inventory items (ON DELETE SET NULL). The linked records are preserved but lose the vendor reference. Deactivate instead of delete when historical records exist.

Database Schema Reference

lab_vendors

Column

Type

Description

id

uuid

Unique vendor ID

name

text

Vendor name

code

text

Short vendor code

lab_type

text

Type of laboratory

contact_person

text

Primary contact name

email

text

Contact email

phone

text

Contact phone

address

text

Street address

city

text

City

state

text

State or region

zip_code

text

Postal code

website

text

Website URL

license_number

text

Operating license number

accreditations

text

Certifications held

rating

numeric

Quality rating 0.0–5.0

specialties

text

Lab specialization areas

turnaround_hours

integer

Typical result hours

tier

text

Vendor tier classification

contract_start_date

date

Agreement start date

contract_end_date

date

Agreement end date

contract_terms

text

Key contract terms

is_active

integer

1 = active, 0 = inactive

status

text

active / inactive

notes

text

Additional notes

created_at

timestamptz

Creation timestamp

updated_at

timestamptz

Last updated timestamp

An index is set on name for fast search performance.

Relationship to Other Modules

Module

Relationship

Test Reports

Reports linked to the vendor that processed the sample

Inventory

Inventory items sourced from the vendor

Test Categories

Lab test categories can reference vendor specialties

Workflow Examples

Adding a new lab vendor when starting a contract:

  1. Sidebar → Lab Vendors → Add Vendor

  2. Enter vendor name and code

  3. Fill in contact details — contact person, email, phone

  4. Add accreditations and license number

  5. Set turnaround hours based on contract SLA

  6. Set tier (Primary, Secondary, etc.)

  7. Enter contract start and end dates

  8. Set rating to initial value (e.g. 3.0 until performance is established)

  9. Save — vendor is now available in test reports

Sending a test to an external lab:

  1. Collect sample from patient

  2. Send to vendor per their collection instructions

  3. When results arrive, go to Sidebar → Test Reports → Add Test Report

  4. Select the patient and doctor

  5. In Lab Vendor field, select the vendor

  6. Enter results, reference values, and interpretation

  7. Set status to recorded

  8. Doctor reviews and sets status to verified

Quarterly vendor performance review:

  1. Run the test volume query above to see report counts per vendor

  2. Review turnaround time adherence — compare turnaround_hours against actual report dates

  3. Update vendor Rating based on performance

  4. Update Notes with review summary and date

  5. Check Contract End Date — initiate renegotiation if expiring within 90 days

Switching primary vendors:

  1. Set the current primary vendor tier to Secondary

  2. Set the new preferred vendor tier to Primary

  3. Update contract dates on both vendors

  4. New test reports will reference the new primary vendor

  5. Historical reports retain their original vendor link

Troubleshooting

Lab Vendors not visible in sidebar:

  • Lab Vendors is Admin-only by default

  • Confirm your role is Admin or that test_reports.view permission is granted to your role in Dashboard → Permissions

Vendor not appearing in test report dropdown:

  • Confirm the vendor is set to Active — inactive vendors are hidden from dropdowns

  • Hard refresh the browser after activating a vendor

  • Confirm the vendor record was saved — check Supabase → Table Editor → lab_vendors

Cannot link vendor to inventory item:

  • Confirm the vendor exists and is active in Lab Vendors

  • Go to Sidebar → Inventory → edit the item and search for the vendor in the Supplier ID field

  • If the vendor is not appearing, confirm it is set to active

Cannot create or edit vendors:

  • Lab vendor management is restricted to Admin role only

  • Confirm you are logged in with an Admin account

Vendor rating not saving:

  • Confirm the value is between 0.0 and 5.0 — values outside this range may fail validation

  • Check browser console for form validation errors

Next Step

Continue to the Invoices & Billing module guide to learn how to create and manage patient invoices in CareNova.