Test Collection Methods
AT_HOME vs GO_TO_LAB orders: which address fields each requires, how lab routing works, and how to find nearby lab draw sites.
Overview
Depending on the supplier and the product, a test can support multiple collection methods - ways for the end user to provide the sample. A variant advertises what it supports in available_collection_types; every order picks one via collection_type.
collection_type
Meaning
AT_HOME
Kits are sent to the end user's home. They follow the kit instructions to self-collect.
GO_TO_LAB
The end user visits a lab draw site (Patient Service Center), where a professional collects the sample.
The collection type determines which address field the order requires:
AT_HOME→shipping_address(where to ship the kit)GO_TO_LAB→requested_lab_address(used to route the order to the closest available lab)
Where a test can be ordered
Every variant advertises the countries it can be ordered in as supported_ship_to_countries (ISO-3166 alpha-2 codes) — for AT_HOME this is the kit's shipping destination; for GO_TO_LAB, the country of the requested lab:
{
"id": 100011,
"variant_name": "Standard Kit",
"available_collection_types": ["AT_HOME"],
"supported_ship_to_countries": ["GB"]
}Gate your address form (or country picker) on this list. Orders outside it are rejected with a 400 you can map straight onto the form — the invalid_fields entry carries the tag unsupported_ship_to_country and the field that failed (shipping_address.country_code or requested_lab_address.country_code), and the problem detail includes the allowed codes:
AT_HOME orders
GO_TO_LAB orders
For GO_TO_LAB, send the address the end user would like to be near as requested_lab_address. Terra uses it as a proxy to route the order to the closest available lab. To let the user pick a specific draw site up front, list nearby locations first (see Finding nearby lab draw sites):
Finding nearby lab draw sites
To let your end user choose a convenient location before placing a GO_TO_LAB order, list nearby Patient Service Centers for a US zip code:
distance is in miles from the requested zip code; scheduling indicates whether online scheduling is open at that site.
Letting the user pick a draw site
To bind a GO_TO_LAB order to the site your user chose (instead of the automatic nearest-site resolution), pass the chosen row's code and address.postal_code as requested_lab when creating the order:
Both values come verbatim from the GET /labs row (ZIP+4 is fine - it is normalized server-side). The outcomes:
Bound - the order response (and any later
GET /orders/{id}) carriesconfirmed_lab(the full site: code, name, address, phone, hours) andconfirmed_lab_address. Render it as "your draw site".Unknown code -
400with aninvalid_fieldsentry onrequested_lab.codetaggedunknown_lab_code. The site list may have changed: re-fetchGET /labsand let the user re-select. Nothing was created, so retrying is safe.Lookup temporarily unavailable - the order is accepted unbound (
confirmed_labisnull). The requisition is typically valid at any of the network's sites, so a brief outage never fails an order.GET /orders/{id}echoes yourrequested_labso you can tell this case apart from "no selection was made".
Without requested_lab, Terra falls back to resolving the nearest site to requested_lab_address (best-effort).
Last updated
Was this helpful?