Querying jobs
Use job to fetch a single job and jobConnection to list and search jobs.
A single job
query GetJob($id: String!) {
job(id: $id) {
id
status
startTime
endTime
jobTypes { name description requirements }
address { street1 street2 city state zipCode }
patient { uid name { first last } phone email preferredLanguage }
assignee { id externalUID name { first last } }
availability { startTime endTime }
attachments { id mimeType uploadStatus url }
schedulingModifiers { minDate maxDate }
}
}
Some fields are only available on job, not on the ConnectionJob type that jobConnection returns:
attachmentsschedulingModifierspatient, which is deprecated onConnectionJob
Listing jobs
jobConnection returns your vendor's jobs plus any AVAILABLE jobs in your network that you haven't declined.
query ListJobs($after: String) {
jobConnection(
first: 50
after: $after
statuses: [ASSIGNED, SCHEDULED]
sortBy: STARTTIME
sortDir: ASC
) {
totalCount
pageInfo { hasNextPage endCursor }
edges {
cursor
node { id status startTime assignee { id } }
}
}
}
Filters
| Argument | Description |
|---|---|
statuses | Only return jobs in these JobStatuses. |
ids | Only return these job IDs. |
from / until | Filter on the job's startTime. Jobs without a start time are excluded when either argument is set. |
assigneeID | Technician id or externalUID. |
assigneeName | Technician name. |
patient | Match on patient fields. |
search | Free-text search. See below. |
sortBy / sortDir | Sort order. See JobSortBy and SortDir. Defaults to DEFAULT / DESC. |
search matches job and order identifiers, patient uid, patient name, assignee name or email, and the service address. It uses prefix matching, so "Jan" matches "Jane".
Pagination
jobConnection uses cursor pagination:
- Request a page with
first(1–50, default 25). Values outside that range returnVALIDATION_ERROR. - If
pageInfo.hasNextPageistrue, request the next page withafter: pageInfo.endCursor. - Repeat until
hasNextPageisfalse.
totalCount is the total number of matching jobs across all pages.
technicianConnection paginates the same way.