Unmatched Lab Results Integration Guide
The Unmatched Results API lets you review a lab result that could not be safely attached to an order automatically. You can accept a proposed match, reject the result, or ask the Junction operations team to review it. This guide covers:- receiving review notifications by webhook;
- listing and retrieving unmatched results;
- accepting, rejecting, or escalating a result; and
- understanding the available match cases.
Recommended integration flow
- Subscribe your webhook endpoint to
labtest.match_review.created. - When the webhook arrives, store its
data.idas the unmatched-result ID. - Fetch the full item with
GET /v3/unmatched_result/{id}. - Present the result, patient context, and candidate orders to a reviewer.
- Display only the actions listed in
allowed_actions. - Call the accept or resolve endpoint with the reviewer’s decision.
- Use the returned resource as the source of truth for the final state and store its
order_transaction.idto track related orders.
Webhook
Event type
data.id from the API before displaying or resolving the item.
Example payload:
API endpoints
List unmatched results
Without a
status filter, the endpoint returns actionable customer items and items that you escalated with unsure. Resolved items are excluded by default.
Response:
next_cursor unchanged into the next request. Do not parse or construct cursor values in your application.
Get one unmatched result
Candidate confidence and reason codes are review aids; they do not replace human confirmation. A
provenance_order is the order associated with the incoming sample or result history. An order_option is another order that may be a valid target.
Accept a match
accept only when it appears in allowed_actions.
Request fields:
If both
user_id and order_id are supplied, the order must belong to that user. Send an empty object only when accepting the system’s unambiguous default target. For ambiguous demographic or no-match cases, explicitly select an order_id or user_id.
Example:
Track related orders with an order transaction
An order transaction groups orders that belong to the same order lifecycle. For example, an original order and an order created to replace it can have different order IDs while sharing one order transaction ID. The candidate records exposeorder_transaction_id when one is available. The order returned by accept includes the authoritative order_transaction. An abridged response looks like:
order_transaction.id as the grouping key in your system and keep each individual order ID as a member of that group. Use parent_id to identify the direct predecessor and low_level_status to determine what happened to each order. Do not overwrite the original order ID with the replacement order ID or assume that a candidate order remains the active order after acceptance.
You can retrieve all orders in the group with:
accept. If acceptance creates an order for a different patient, its transaction may differ from the candidate transaction shown before review.
Reject or escalate a result
Example escalation:
unsure, its status is pending_ops_review and allowed_actions is empty. After reject, its status is resolved and allowed_actions is empty.
Review statuses
Available decision cases
Thedecision_code describes why automatic matching stopped. Use the API’s reason, candidates, and allowed_actions together when presenting a case.
Candidate reason codes
Each candidate may include one or more machine-readable reasons:Error handling
Because another reviewer may act on an item first, re-fetch the item after a failed action before prompting the user to retry. Never attempt to work around a
404 by using an ID from another team.
Integration checklist
- Enable the unmatched-results review queue for the correct environment and team.
- Subscribe the existing webhook destination to
labtest.match_review.created. - Verify webhook signatures and handle repeated deliveries safely.
- Fetch the full item from the API after receiving a webhook.
- Use
allowed_actionsto control available review actions. - Require an explicit patient/order selection for ambiguous cases.
- Store the order and
order_transaction.idreturned byaccept. - Group related orders by transaction ID while retaining each individual order ID.
- Reconcile outstanding items periodically with the list endpoint.