Skip to main content

Job lifecycle

A job is one blood draw for one patient. Each job moves through a series of JobStatuses, and your integration drives most of those transitions with mutations.

Statuses​

StatusMeaning
AVAILABLEThe job is open to vendors in its network.
PUBLISHEDThe job belongs to a vendor and has been published to that vendor's network of phlebotomists, but no technician is assigned yet. Natera can also publish a job directly to a vendor.
ASSIGNEDThe job has been assigned to a technician.
SCHEDULEDThe patient has confirmed an appointment time.
ON_THE_WAYThe technician has started traveling.
ON_SITEThe technician has arrived at the job site.
IN_PROGRESSThe draw is in progress.
COMPLETEDThe job has been completed and the sample shipped.
CANCELLEDThe job no longer needs to be completed.

Typical flow​

  1. Take the job. You learn about an AVAILABLE job from the JOB_AVAILABLE webhook or from jobConnection. From AVAILABLE, a job goes one of two ways:

    • Assign it directly. Call assignJob with one of your technicians. The job becomes yours and moves straight to ASSIGNED.
    • Publish it to your phlebotomists. Publish the job to your network, which moves it to PUBLISHED. Then call assignJob once a technician picks it up. Publishing is done from the MPX dashboard; the Vendor API doesn't have a publish mutation yet.

    Natera can also publish a job directly to your vendor. When that happens you receive a JOB_PUBLISHED webhook and assign it the same way.

  2. Schedule. Once you've agreed a time with the patient, call scheduleJob with a startTime and an optional endTime. When rescheduling, you can include a reason (RescheduleJobReasons) and a note.

  3. Report progress. Call onTheWayJob, onSiteJob and inProgressJob as the technician progresses.

  4. Complete. Call completeJob with a CompletedJobReasons value and, optionally, shipping tracking. A note is required for every reason except Sample_Completely_Obtained_and_Shipped.

Other actions​

  • declineJob: decline an AVAILABLE job you don't want, with a JobDeclineReasons value. Declined jobs no longer appear in your jobConnection results while they remain available. You can't decline a job that already belongs to your vendor.
  • unassignJob: remove the technician but keep the job with your vendor. The job returns to PUBLISHED.
  • unclaimJob: give the job up. It returns to AVAILABLE.
  • cancelJob: cancel with a CancelledJobReasons value. A note is required when the reason is Other.
  • addNoteJob: add a note of a given JobNoteType.
  • addJobTrackingNumber: add a shipment tracking number. When carrier is OTHER, other must name the carrier.

Allowed states per mutation​

If you call a mutation while the job is in a status it doesn't support, it fails with INVALID_JOB_STATE.

MutationFails when the job is
assignJobanything other than AVAILABLE or PUBLISHED
scheduleJobAVAILABLE, PUBLISHED, CANCELLED or COMPLETED
onTheWayJobAVAILABLE, PUBLISHED or ASSIGNED
onSiteJobAVAILABLE, PUBLISHED or ASSIGNED
inProgressJobAVAILABLE, PUBLISHED or ASSIGNED
completeJobAVAILABLE, PUBLISHED or ASSIGNED
cancelJobAVAILABLE
unclaimJobCOMPLETED or CANCELLED
addNoteJobAVAILABLE
addJobTrackingNumberAVAILABLE
Attachment uploadAVAILABLE

unassignJob has no status restriction, but fails with INVALID_JOB_ERROR if the job has no assignee.

Visibility​

You can see and act on:

  • jobs that belong to your vendor, and
  • AVAILABLE jobs whose network includes your vendor.

A job owned by another vendor returns JOB_NOT_FOUND from mutations. The job query returns INVALID_VENDOR_ERROR for it instead. See Error codes.