Test Order Modification API

AoeResponse

value
​string · minLength: 1 · maxLength: 75 · required

The response value for the AOE question. Format depends on the question's response type:

  • TEXT: Free-text string (max 75 characters).
  • NUMBER: Numeric string value.
  • DATE: ISO-8601 date string.
  • PICK: Must match one of the question's defined pick list values.

Aoe

id
​string · minLength: 1 · maxLength: 15 · required

AOE question identifier as defined in the test compendium.

​AoeResponse[] · minItems: 1 · required

One or more response values for this AOE question. Most questions require exactly one response; PICK-type questions with multi-select may have multiple.

responseTime
​string

ISO-8601 timestamp indicating when the AOE response was collected from the patient. Supports date-only (YYYY-MM-DD) or full datetime with optional fractional seconds (up to 9 digits) and timezone offset.

AddTestCommand

Add a test code to the existing order. Valid for both accessioned and non-accessioned orders. Accessioned add-ons undergo additional validation before submission.
type
​string · const · required

Discriminator for command type.

Const value: add-test
testCode
​string · minLength: 1 · maxLength: 6 · required

Labcorp test code to add to the order. Must exist in the compendium.

​Aoe[]

Ask at Order Entry responses for this test code. Required when the test has mandatory AOE questions defined in the compendium.

CancelTestCommand

Cancel a single test code from the existing order with a cancellation reason. Only permitted for non-accessioned orders. This is not checked while the request is validated — a cancel against an accessioned order is reported `rejected` during submission. It therefore returns **422** when no earlier command was submitted, and **207** when one was, in which case those earlier commands have already been applied. Cancellation applies only to specimens collected by Labcorp at a Patient Service Center (PSC). It does not apply to orders whose specimens are collected in-house. This API does not determine where a specimen was collected and does not enforce this restriction — a cancel for an in-house collection is accepted and reported `submitted`, then declined by Labcorp during later processing. A `submitted` status confirms the cancellation was transmitted, not that it will be honored.
type
​string · const · required

Discriminator for command type.

Const value: cancel-test
testCode
​string · minLength: 1 · maxLength: 6 · required

Labcorp test code to cancel from the order. Must exist in the compendium; an unknown code fails the command.

reason
​string · minLength: 1 · maxLength: 150 · required

Free-text justification for the cancellation. Must not be empty or whitespace-only.

The limit is 150 bytes when UTF-8 encoded (not 150 characters): a multibyte character occupies more than one byte, so a string of <=150 code points can still exceed the cap. An over-cap reason fails request validation and returns 400 (the request is rejected; the reason is never truncated). The byte-length check is enforced in the service; the maxLength below is an approximate code-point bound for documentation only.

Command

oneOf
Exactly one variant must match.
Decision Table
VariantMatching Criteria
type = object · type="add-test" · requires: testCode
type = object · type="cancel-test" · requires: testCode, reason
Properties for Variant 1:
Add a test code to the existing order. Valid for both accessioned and non-accessioned orders. Accessioned add-ons undergo additional validation before submission.
type
​string · const · required

Discriminator for command type.

Const value: add-test
testCode
​string · minLength: 1 · maxLength: 6 · required

Labcorp test code to add to the order. Must exist in the compendium.

​Aoe[]

Ask at Order Entry responses for this test code. Required when the test has mandatory AOE questions defined in the compendium.

OrderModificationRequest

controlNumber
​string · minLength: 1 · required

Unique identifier for the original order to be modified.

accountNumber
​string · minLength: 1 · maxLength: 8 · required

The account number associated with the order. Must match the account number on the order record for the lookup to succeed.

sendingFacility
​string · minLength: 1 · maxLength: 10 · required

The sending facility, also known as the Client Site Identifier (CSID). Must match an active service subscription in the partner's profile and the sendingFacility on the original order.

sendingApplication
​string · minLength: 1 · maxLength: 15 · required

Vendor mnemonic. Must match an active service subscription in the partner's profile and the sendingApplication on the original order.

​object · required

The ordering provider for the modification. Supplied by the caller and treated as authoritative once validated. ASCII characters expected excluding &, \, ^, and |.

​Command[] · minItems: 1 · required

Ordered list of modification commands to execute. Commands are processed sequentially and coalesced into batches of up to 40 test codes sharing one command type. Any mix of add-test and cancel-test commands is allowed.

CommandResult

Self-describing outcome of a single command. Echoes the command's identifying field (the single `testCode` it acted on) plus a status.
type
​string · enum · required

The kind of command this result describes.

Enum values:
add-test
cancel-test
testCode
​string · required

The Labcorp test code this command acted on.

status
​string · enum · required

Outcome status for this command.

  • submitted: The command was published to an internal system and accepted.

  • rejected: The service declined the command on its own merits — a validation failure (e.g. an unknown test code) or a business rule (e.g. a cancel against an accessioned order). Deterministic: re-sending the same command will be rejected again; correct the command.

  • failed: The command was sent to an internal system but the publish failed. This is an operational failure and may be retryable.

  • not-submitted: The command was never attempted because a prior command stopped processing. Re-submitting the request may let it through.

Enum values:
submitted
rejected
failed
not-submitted
reason
​string

Human-readable explanation of the outcome. Present when status is rejected, failed, or not-submitted.

messages
​string[] · minItems: 1

Informational notes about a test that was added — for example, that the specimen is old and will be pulled from storage, or that the test was already on the order. A note is not a refusal or a problem to correct: the test was accepted and submitted, and no action is required for the addition to take effect. Treat these as notifications about how the addition will be handled.

Present only when status is submitted and at least one note applies. Absent otherwise, including for any command that was not submitted: a note describes a test that was actually added, so it is never returned for one that was not. Notes are returned in the order they were produced, since a sequence of notes may read as one explanation.

OrderModificationResponse

Response body for successful or partially successful order modification requests. Contains an ordered array of per-command results preserving the original command order.
​CommandResult[] · required

One result object per command, in the same order as the request. Each entry includes the command identifiers and its status.

ValidationIssue

id
​string · required

Machine-readable error identifier for programmatic handling.

path
​string · required

JSONPath-relative expression identifying the field that caused the issue. An empty string indicates a request-level error not attributable to a specific field.

message
​string · required

Human-readable description of the issue.