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-vendorsWho can access:
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/newRequired Fields
Optional Fields
Identity:
Contact Information:
Location:
Accreditation and Quality:
Service Details:
Contract Details:
Status:
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 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:
Sidebar → Test Reports → Add Test Report
In the Lab Vendor field, search for and select the vendor
Complete the rest of the test report form
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:
Sidebar → Inventory → Edit the item
In the Supplier ID field, search for and select the vendor
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_idto 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
An index is set on name for fast search performance.
Relationship to Other Modules
Workflow Examples
Adding a new lab vendor when starting a contract:
Sidebar → Lab Vendors → Add Vendor
Enter vendor name and code
Fill in contact details — contact person, email, phone
Add accreditations and license number
Set turnaround hours based on contract SLA
Set tier (Primary, Secondary, etc.)
Enter contract start and end dates
Set rating to initial value (e.g. 3.0 until performance is established)
Save — vendor is now available in test reports
Sending a test to an external lab:
Collect sample from patient
Send to vendor per their collection instructions
When results arrive, go to Sidebar → Test Reports → Add Test Report
Select the patient and doctor
In Lab Vendor field, select the vendor
Enter results, reference values, and interpretation
Set status to
recordedDoctor reviews and sets status to
verified
Quarterly vendor performance review:
Run the test volume query above to see report counts per vendor
Review turnaround time adherence — compare
turnaround_hoursagainst actual report datesUpdate vendor Rating based on performance
Update Notes with review summary and date
Check Contract End Date — initiate renegotiation if expiring within 90 days
Switching primary vendors:
Set the current primary vendor tier to
SecondarySet the new preferred vendor tier to
PrimaryUpdate contract dates on both vendors
New test reports will reference the new primary vendor
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.viewpermission 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.