Lab Partner & Lab Partner Test

Introduction #

The LabPartner and LabPartnerTest models represent external lab partners and the tests they offer within Canvas.


LabPartner #

The LabPartner model stores information about a lab partner

Basic Usage #

To retrieve a lab partner by its unique identifier:

from canvas_sdk.v1.data.lab import LabPartner

lab_partner = LabPartner.objects.get(id="your-uuid-here")

You can also filter lab partners by attributes. For example, to list all active lab partners:

active_lab_partners = LabPartner.objects.filter(active=True)

LabPartnerTest #

The LabPartnerTest model represents a test offered by a lab partner. Each test is linked to a lab partner via a foreign key.

Basic Usage #

To retrieve tests for a given lab partner, you can access the related tests using the reverse relationship:

from canvas_sdk.v1.data.lab import LabPartner

lab_partner = LabPartner.objects.get(id="your-uuid-here")
tests = lab_partner.available_tests.all()

Alternatively, you can directly filter tests by attributes:

from canvas_sdk.v1.data.lab import LabPartnerTest

tests_with_code = LabPartnerTest.objects.filter(order_code="XYZ123")

Attributes #

LabPartner #

Field NameTypeDescription
idUUIDThe universally unique identifier for the lab partner.
dbidIntegerThe internal database identifier (primary key) for the lab partner.
nameStringThe name of the lab partner.
activeBooleanIndicates whether the lab partner is currently active.
electronic_ordering_enabledBooleanIndicates if electronic ordering is enabled for this lab partner.
keywordsTextKeywords associated with the lab partner.
default_lab_account_numberStringThe default lab account number used for orders.

LabPartnerTest Attributes #

Field NameTypeDescription
idUUIDThe universally unique identifier for the test record.
dbidIntegerThe internal database identifier (primary key) for the test record.
lab_partnerForeignKeyA reference to the related LabPartner (accessible via the related name available_tests).
order_codeStringA code used to identify the test order. May be blank.
order_nameTextThe name of the test order.
keywordsTextKeywords associated with the test. May be blank.
cpt_codeStringThe CPT code for the test, if available. Can be blank or null.