Heydoc GraphQL API Reference

Welcome to the Heydoc GraphQL API!

Contact

Heydoc support
support@heydoc.co.uk

Terms of Service: https://www.heydoc.co.uk/terms-service

API Endpoints
Production Server:
https://open.heydoc.co.uk/graphql
Version: 1.0.0
What is GraphQL?

GraphQL is a query language for APIs that allows clients to request exactly the data they need, making it possible to get all required data in a limited number of requests.

The GraphQL data (fields) can be described in the form of types, allowing clients to use client-side GraphQL libraries to consume the API and avoid manual parsing.

Since there’s no fixed endpoints and data model, new abilities can be added to the API without creating breaking changes. This allows us to have a versionless API as described in the GraphQL documentation.

Authentication

You will need to generate a token to use the API. A token is valid for 12 hours. You can request a token by using the singIn mutation.

Example

curl --request POST
     --url https://open.heydoc.co.uk/graphql 
     --header 'content-type: application/json' 
     --data '{"query":"mutation {\n signIn (apiKey: \"API_KEY\", password: \"ACCOUNT_PASSWORD\")\n {\n token\n }\n}"}'

Assuming that API_KEY and ACCOUNT_PASSWORD are correct, the following response will be returned:

  { 
    "data": { 
    "signIn": { 
      "token": TOKEN_ID 
      } 
    } 
  }
Authenticated requests

To use the token you will need to include "x-token: YOUR_TOKEN" in a header

Example

curl --request POST
     --url https://open.heydoc.co.uk/graphql 
     --header 'x-token: TOKEN_ID 
     --data '{...}'

Queries

accountStatement

This query is for fetching a specific financial AccountStatement by it's unique idenfier.
Returns an AccountStatement

Name Description
id - ID!

Example

Query
query accountStatement($id: ID!) {
  accountStatement(id: $id) {
    id
    statementType
    date
    start
    end
    header
    accountReferenceNumber
    comments
    account
    invoices {
      ...InvoiceFragment
    }
    totalPaid
    totalPrice
    totalOutstanding
    createdAt
    updatedAt
    deleted
  }
}
Variables
{"id": ID}
Response
{
  "data": {
    "accountStatement": {
      "id": ID,
      "statementType": AccountStatementType,
      "date": "2022-05-20T14:01:10.746Z",
      "start": "2022-05-20T14:01:10.746Z",
      "end": "2022-05-20T14:01:10.746Z",
      "header": "xyz789",
      "accountReferenceNumber": "abc123",
      "comments": "abc123",
      "account": Account,
      "invoices": [Invoice],
      "totalPaid": 123.45,
      "totalPrice": 987.65,
      "totalOutstanding": 123.45,
      "createdAt": "2022-05-20T14:01:10.746Z",
      "updatedAt": "2021-11-20T14:01:10.746Z",
      "deleted": false
    }
  }
}

accountStatements

This query is for fetching a collection of AccountStatements within the given DateRange.
Returns an AccountStatementData

Name Description
dateRange - DateRange!
pagination - CursorPagination
options - QueryOptions

Example

Query
query accountStatements($dateRange: DateRange!, $pagination: CursorPagination, $options: QueryOptions) {
  accountStatements(dateRange: $dateRange, pagination: $pagination, options: $options) {
    data {
      ...AccountStatementFragment
    }
    pageInfo {
      ...PageInfoForCursorPaginationFragment
    }
  }
}
Variables
{
  "dateRange": DateRange,
  "pagination": CursorPagination,
  "options": QueryOptions
}
Response
{
  "data": {
    "accountStatements": {
      "data": [AccountStatement],
      "pageInfo": PageInfoForCursorPagination
    }
  }
}

bookings

This query is for fetching data about patient bookings held in the system.
Returns a BookingData

Name Description
dateRange - DateRange
pagination - Pagination
options - QueryOptions

Example

Query
query bookings($dateRange: DateRange, $pagination: Pagination, $options: QueryOptions) {
  bookings(dateRange: $dateRange, pagination: $pagination, options: $options) {
    data {
      ...BookingFragment
    }
    pageInfo {
      ...PageInfoFragment
    }
  }
}
Variables
{
  "dateRange": DateRange,
  "pagination": Pagination,
  "options": QueryOptions
}
Response
{
  "data": {
    "bookings": {
      "data": [Booking],
      "pageInfo": PageInfo
    }
  }
}

contact

This query fetches the contact with the specified identifier.
Returns a Contact

Name Description
id - ID!

Example

Query
query contact($id: ID!) {
  contact(id: $id) {
    id
    title
    status
    firstName
    lastName
    fullName
    email
    phones {
      ...PhoneFragment
    }
    address {
      ...AddressFragment
    }
    numbers {
      ...PatientNumberFragment
    }
    medicalSpecialty
    company
    createdAt
    updatedAt
  }
}
Variables
{"id": ID}
Response
{
  "data": {
    "contact": {
      "id": ID,
      "title": "abc123",
      "status": "abc123",
      "firstName": "abc123",
      "lastName": "xyz789",
      "fullName": "abc123",
      "email": "xyz789",
      "phones": [Phone],
      "address": Address,
      "numbers": [PatientNumber],
      "medicalSpecialty": "abc123",
      "company": "xyz789",
      "createdAt": "2021-11-20T14:01:10.746Z",
      "updatedAt": "2022-05-20T14:01:10.746Z"
    }
  }
}

contacts

This query fetches a collection of contacts that match the requested search text. The requested search text is compared against the contacts name, email address, telephone number(s), medical specialisation and numbers (such as NHS Number).
Returns a ContactData

Name Description
search - String
pagination - Pagination
options - QueryOptions

Example

Query
query contacts($search: String, $pagination: Pagination, $options: QueryOptions) {
  contacts(search: $search, pagination: $pagination, options: $options) {
    data {
      ...ContactFragment
    }
    pageInfo {
      ...PageInfoFragment
    }
  }
}
Variables
{
  "search": "abc123",
  "pagination": Pagination,
  "options": QueryOptions
}
Response
{
  "data": {
    "contacts": {
      "data": [Contact],
      "pageInfo": PageInfo
    }
  }
}

invoice

This query fetches the invoice with the specified identifier.
Returns an Invoice

Name Description
id - ID!

Example

Query
query invoice($id: ID!) {
  invoice(id: $id) {
    id
    status
    paidOrOutstanding
    invoiceNumber
    paymentReference
    date
    patientId
    patient {
      ...PatientFragment
    }
    payeeDetails
    doctorId
    doctor {
      ...UserFragment
    }
    location
    lineItems {
      ...LineItemFragment
    }
    payments {
      ...InvoicePaymentFragment
    }
    tax
    total
    outstanding
    comments
    extraInfo
    type
    createdAt
    updatedAt
  }
}
Variables
{"id": ID}
Response
{
  "data": {
    "invoice": {
      "id": ID,
      "status": "abc123",
      "paidOrOutstanding": "abc123",
      "invoiceNumber": 987,
      "paymentReference": "abc123",
      "date": "2022-05-20T14:01:10.746Z",
      "patientId": ID,
      "patient": Patient,
      "payeeDetails": "xyz789",
      "doctorId": ID,
      "doctor": User,
      "location": "xyz789",
      "lineItems": [LineItem],
      "payments": [InvoicePayment],
      "tax": 987.65,
      "total": 123.45,
      "outstanding": 123.45,
      "comments": "xyz789",
      "extraInfo": "abc123",
      "type": "xyz789",
      "createdAt": "2021-11-20T14:01:10.746Z",
      "updatedAt": "2021-11-20T14:01:10.746Z"
    }
  }
}

invoices

This query fetches a collection of invoices where the invoice date falls within the requested range. The query can be further refined through the use of QueryOptions to only fetch invoices that were created or modified (or both) within specified dates.
Returns an InvoiceData

Name Description
dateRange - DateRange!
pagination - Pagination
options - QueryOptions

Example

Query
query invoices($dateRange: DateRange!, $pagination: Pagination, $options: QueryOptions) {
  invoices(dateRange: $dateRange, pagination: $pagination, options: $options) {
    data {
      ...InvoiceFragment
    }
    pageInfo {
      ...PageInfoFragment
    }
  }
}
Variables
{
  "dateRange": DateRange,
  "pagination": Pagination,
  "options": QueryOptions
}
Response
{
  "data": {
    "invoices": {
      "data": [Invoice],
      "pageInfo": PageInfo
    }
  }
}

lab

This query fetches the pathology request with the specified identifier.
Returns a Lab

Name Description
id - ID!

Example

Query
query lab($id: ID!) {
  lab(id: $id) {
    id
    status
    patient {
      ...PatientFragment
    }
    doctor {
      ...UserFragment
    }
    requestDate
    sampleDate
    fasting
    orderNumber
    parsedResults
    resultsReceivedAt
    testList
    createdAt
    updatedAt
  }
}
Variables
{"id": ID}
Response
{
  "data": {
    "lab": {
      "id": ID,
      "status": "xyz789",
      "patient": Patient,
      "doctor": User,
      "requestDate": "2021-11-20T14:01:10.746Z",
      "sampleDate": "2022-05-20T14:01:10.746Z",
      "fasting": false,
      "orderNumber": "xyz789",
      "parsedResults": "abc123",
      "resultsReceivedAt": "2021-11-20T14:01:10.746Z",
      "testList": "xyz789",
      "createdAt": "2021-11-20T14:01:10.746Z",
      "updatedAt": "2021-11-20T14:01:10.746Z"
    }
  }
}

labels

This query is for fetching label data.
Returns a LabelData

Name Description
pagination - Pagination

Example

Query
query labels($pagination: Pagination) {
  labels(pagination: $pagination) {
    data {
      ...LabelFragment
    }
    pageInfo {
      ...PageInfoFragment
    }
  }
}
Variables
{"pagination": Pagination}
Response
{
  "data": {
    "labels": {
      "data": [Label],
      "pageInfo": PageInfo
    }
  }
}

labs

This query fetches a collection of pathology requests that where submitted to the processing lab within the specified date range. The collection can be furter refined through the use of LabQueryOptions.
Returns a LabData

Name Description
dateRange - DateRange!
pagination - Pagination
options - LabQueryOptions

Example

Query
query labs($dateRange: DateRange!, $pagination: Pagination, $options: LabQueryOptions) {
  labs(dateRange: $dateRange, pagination: $pagination, options: $options) {
    data {
      ...LabFragment
    }
    pageInfo {
      ...PageInfoFragment
    }
  }
}
Variables
{
  "dateRange": DateRange,
  "pagination": Pagination,
  "options": LabQueryOptions
}
Response
{
  "data": {
    "labs": {
      "data": [Lab],
      "pageInfo": PageInfo
    }
  }
}

letter

This query is for fetching the letter with the specified identifier.
Returns a Letter

Name Description
id - ID!

Example

Query
query letter($id: ID!) {
  letter(id: $id) {
    id
    deleted
    reviewStatus
    patient {
      ...PatientFragment
    }
    doctor {
      ...UserFragment
    }
    date
    title
    body
    contact {
      ...LetterContactFragment
    }
    createdAt
    updatedAt
  }
}
Variables
{"id": ID}
Response
{
  "data": {
    "letter": {
      "id": ID,
      "deleted": true,
      "reviewStatus": ReviewStatus,
      "patient": Patient,
      "doctor": User,
      "date": "2021-11-20T14:01:10.746Z",
      "title": "xyz789",
      "body": "xyz789",
      "contact": LetterContact,
      "createdAt": "2022-05-20T14:01:10.746Z",
      "updatedAt": "2021-11-20T14:01:10.746Z"
    }
  }
}

letters

This query fetches the letters created? sent? written? posted? read? what? within the specified DateRange.
Returns a LetterData

Name Description
dateRange - DateRange!
pagination - Pagination
options - QueryOptions

Example

Query
query letters($dateRange: DateRange!, $pagination: Pagination, $options: QueryOptions) {
  letters(dateRange: $dateRange, pagination: $pagination, options: $options) {
    data {
      ...LetterFragment
    }
    pageInfo {
      ...PageInfoFragment
    }
  }
}
Variables
{
  "dateRange": DateRange,
  "pagination": Pagination,
  "options": QueryOptions
}
Response
{
  "data": {
    "letters": {
      "data": [Letter],
      "pageInfo": PageInfo
    }
  }
}

patient

This query fetches patient data for the patient with the specified identifier.
Returns a Patient

Name Description
id - ID!

Example

Query
query patient($id: ID!) {
  patient(id: $id) {
    id
    title
    status
    firstName
    lastName
    fullName
    dob
    gender
    sex
    email
    googleClientId
    paymentReference
    phones {
      ...PhoneFragment
    }
    occupation
    address {
      ...AddressFragment
    }
    membershipName
    membershipStartDate
    sharingToken {
      ...SharingTokenFragment
    }
    numbers {
      ...PatientNumberFragment
    }
    customAttributes {
      ...CustomAttributeFragment
    }
    communicationPreferences {
      ...CommunicationPreferencesFragment
    }
    relatedAccounts {
      ...PatientRelationshipFragment
    }
    bookings {
      ...BookingFragment
    }
    invoices {
      ...InvoiceFragment
    }
    letters {
      ...LetterFragment
    }
    labs {
      ...LabFragment
    }
    labels {
      ...PatientLabelFragment
    }
    prescriptions {
      ...PrescriptionDataFragment
    }
    records {
      ...RecordDataFragment
    }
    createdAt
    updatedAt
    accessGroups {
      ...PatientAccessGroupFragment
    }
  }
}
Variables
{"id": ID}
Response
{
  "data": {
    "patient": {
      "id": ID,
      "title": "abc123",
      "status": "abc123",
      "firstName": "xyz789",
      "lastName": "abc123",
      "fullName": "abc123",
      "dob": "2022-05-20T14:01:10.746Z",
      "gender": "abc123",
      "sex": "abc123",
      "email": "xyz789",
      "googleClientId": "abc123",
      "paymentReference": "xyz789",
      "phones": [Phone],
      "occupation": "xyz789",
      "address": Address,
      "membershipName": "xyz789",
      "membershipStartDate": "xyz789",
      "sharingToken": SharingToken,
      "numbers": [PatientNumber],
      "customAttributes": [CustomAttribute],
      "communicationPreferences": CommunicationPreferences,
      "relatedAccounts": [PatientRelationship],
      "bookings": [Booking],
      "invoices": [Invoice],
      "letters": [Letter],
      "labs": [Lab],
      "labels": [PatientLabel],
      "prescriptions": PrescriptionData,
      "records": RecordData,
      "createdAt": "2022-05-20T14:01:10.746Z",
      "updatedAt": "2021-11-20T14:01:10.746Z",
      "accessGroups": [PatientAccessGroup]
    }
  }
}

patientDocument

This query fetches the patient document with the requested identifier.
Returns a PatientDocument

Name Description
id - ID!

Example

Query
query patientDocument($id: ID!) {
  patientDocument(id: $id) {
    id
    title
    patientId
    patient {
      ...PatientFragment
    }
    path
    name
    type
    url
    parent
    deleted
    dateCreated
    dateModified
    uploadUrl
  }
}
Variables
{"id": ID}
Response
{
  "data": {
    "patientDocument": {
      "id": ID,
      "title": "abc123",
      "patientId": ID,
      "patient": Patient,
      "path": "xyz789",
      "name": "abc123",
      "type": "abc123",
      "url": "xyz789",
      "parent": ID,
      "deleted": true,
      "dateCreated": "2021-11-20T14:01:10.746Z",
      "dateModified": "2022-05-20T14:01:10.746Z",
      "uploadUrl": "xyz789"
    }
  }
}

patientDocuments

This query fetches a collection of patient documents held in the system.
Returns a PatientDocumentData

Name Description
search - String
pagination - Pagination
options - QueryOptions

Example

Query
query patientDocuments($search: String, $pagination: Pagination, $options: QueryOptions) {
  patientDocuments(search: $search, pagination: $pagination, options: $options) {
    data {
      ...PatientDocumentFragment
    }
    pageInfo {
      ...PageInfoFragment
    }
  }
}
Variables
{
  "search": "xyz789",
  "pagination": Pagination,
  "options": QueryOptions
}
Response
{
  "data": {
    "patientDocuments": {
      "data": [PatientDocument],
      "pageInfo": PageInfo
    }
  }
}

patientRelationships

Fetches a collection of all PatientRelationships held by a Patient.
Returns a PatientRelationshipData

Name Description
patientId - ID!
relationshipType - PatientRelationshipType If specified, only PatientRelationships with the chosen PatientRelationshipType will be returned

Example

Query
query patientRelationships($patientId: ID!, $relationshipType: PatientRelationshipType) {
  patientRelationships(patientId: $patientId, relationshipType: $relationshipType) {
    data {
      ...PatientRelationshipFragment
    }
  }
}
Variables
{
  "patientId": ID,
  "relationshipType": PatientRelationshipType
}
Response
{
  "data": {
    "patientRelationships": {
      "data": [PatientRelationship]
    }
  }
}

patients

This query fetches a collection of patients that match the supplied search criteria.
Returns a PatientData

Name Description
search - String
pagination - Pagination
options - QueryOptions

Example

Query
query patients($search: String, $pagination: Pagination, $options: QueryOptions) {
  patients(search: $search, pagination: $pagination, options: $options) {
    data {
      ...PatientFragment
    }
    pageInfo {
      ...PageInfoFragment
    }
  }
}
Variables
{
  "search": "xyz789",
  "pagination": Pagination,
  "options": QueryOptions
}
Response
{
  "data": {
    "patients": {
      "data": [Patient],
      "pageInfo": PageInfo
    }
  }
}

practice

This query returns the current API user's practice.
Returns a Practice!

Example

Query
query practice {
  practice {
    id
    locations {
      ...PracticeLocationFragment
    }
    appointmentTypes {
      ...AppointmentTypeFragment
    }
    paymentTypes {
      ...PracticePaymentTypeFragment
    }
    accessGroups {
      ...PracticeAccessGroupsFragment
    }
    practiceNumbers {
      ...PracticeNumbersFragment
    }
  }
}
Response
{
  "data": {
    "practice": {
      "id": ID,
      "locations": [PracticeLocation],
      "appointmentTypes": [AppointmentType],
      "paymentTypes": [PracticePaymentType],
      "accessGroups": [PracticeAccessGroups],
      "practiceNumbers": [PracticeNumbers]
    }
  }
}

practiceTemplateDocument

This query fetches the document template with the requested identifier.
Returns a PracticeTemplateDocument

Name Description
id - ID!

Example

Query
query practiceTemplateDocument($id: ID!) {
  practiceTemplateDocument(id: $id) {
    id
    patientId
    path
    name
    type
    url
    deleted
    dateCreated
    dateModified
    uploadUrl
    downloadUrl
  }
}
Variables
{"id": ID}
Response
{
  "data": {
    "practiceTemplateDocument": {
      "id": ID,
      "patientId": ID,
      "path": "abc123",
      "name": "abc123",
      "type": "xyz789",
      "url": "abc123",
      "deleted": false,
      "dateCreated": "2021-11-20T14:01:10.746Z",
      "dateModified": "2022-05-20T14:01:10.746Z",
      "uploadUrl": "xyz789",
      "downloadUrl": "abc123"
    }
  }
}

practiceTemplateDocuments

This query fetches a collection of document templates.
Returns a PracticeTemplateDocumentData

Name Description
search - String
pagination - Pagination
options - QueryOptions

Example

Query
query practiceTemplateDocuments($search: String, $pagination: Pagination, $options: QueryOptions) {
  practiceTemplateDocuments(search: $search, pagination: $pagination, options: $options) {
    data {
      ...PracticeTemplateDocumentFragment
    }
    pageInfo {
      ...PageInfoFragment
    }
  }
}
Variables
{
  "search": "xyz789",
  "pagination": Pagination,
  "options": QueryOptions
}
Response
{
  "data": {
    "practiceTemplateDocuments": {
      "data": [PracticeTemplateDocument],
      "pageInfo": PageInfo
    }
  }
}

prescription

This query fetches a prescription with the specified identifier.
Returns a Prescription

Name Description
id - ID!

Example

Query
query prescription($id: ID!) {
  prescription(id: $id) {
    patient {
      ...PatientFragment
    }
    doctor {
      ...UserFragment
    }
    date
    status
    drugs {
      ...PrescriptionDrugFragment
    }
  }
}
Variables
{"id": ID}
Response
{
  "data": {
    "prescription": {
      "patient": Patient,
      "doctor": User,
      "date": "2022-05-20T14:01:10.746Z",
      "status": "abc123",
      "drugs": [PrescriptionDrug]
    }
  }
}

prescriptions

This query fetches a collection of perscriptions that were issued within the specified DateRange. The query can be further refined through the use of QueryOptions to only fetch prescriptions that were created or modified (or both) within specified dates.
Returns a PrescriptionData

Name Description
dateRange - DateRange
pagination - Pagination
options - QueryOptions

Example

Query
query prescriptions($dateRange: DateRange, $pagination: Pagination, $options: QueryOptions) {
  prescriptions(dateRange: $dateRange, pagination: $pagination, options: $options) {
    data {
      ...PrescriptionFragment
    }
    pageInfo {
      ...PageInfoFragment
    }
  }
}
Variables
{
  "dateRange": DateRange,
  "pagination": Pagination,
  "options": QueryOptions
}
Response
{
  "data": {
    "prescriptions": {
      "data": [Prescription],
      "pageInfo": PageInfo
    }
  }
}

product

This query fetches the product with the specfifed identifier.
Returns a Product

Name Description
id - ID!

Example

Query
query product($id: ID!) {
  product(id: $id) {
    id
    status
    productType
    labels {
      ...ProductLabelFragment
    }
    itemCode
    name
    serialNumber
    tax {
      ...TaxFragment
    }
    stockLevel
    price
    cost
    supplierName
    comments
    appointments {
      ...ProductFragment
    }
    isBookable
    duration
    color
    isVideoConsultation
    requiresPayment
    requiresConfirmation
    createdAt
    updatedAt
  }
}
Variables
{"id": ID}
Response
{
  "data": {
    "product": {
      "id": ID,
      "status": "xyz789",
      "productType": ProductType,
      "labels": [ProductLabel],
      "itemCode": "xyz789",
      "name": "abc123",
      "serialNumber": "abc123",
      "tax": Tax,
      "stockLevel": 987,
      "price": 123.45,
      "cost": 987.65,
      "supplierName": "xyz789",
      "comments": "abc123",
      "appointments": [Product],
      "isBookable": false,
      "duration": 123,
      "color": "abc123",
      "isVideoConsultation": false,
      "requiresPayment": true,
      "requiresConfirmation": true,
      "createdAt": "2021-11-20T14:01:10.746Z",
      "updatedAt": "2021-11-20T14:01:10.746Z"
    }
  }
}

products

This query returns a collection of products where the product code or product name matches the supplied search text.
Returns a ProductData

Name Description
search - String
pagination - Pagination
options - QueryOptions

Example

Query
query products($search: String, $pagination: Pagination, $options: QueryOptions) {
  products(search: $search, pagination: $pagination, options: $options) {
    data {
      ...ProductFragment
    }
    pageInfo {
      ...PageInfoFragment
    }
  }
}
Variables
{
  "search": "xyz789",
  "pagination": Pagination,
  "options": QueryOptions
}
Response
{
  "data": {
    "products": {
      "data": [Product],
      "pageInfo": PageInfo
    }
  }
}

record

This query fetches the record with the requested identifier.
Returns a Record

Name Description
id - ID!

Example

Query
query record($id: ID!) {
  record(id: $id) {
    id
    consultationId
    sectionId
    sectionTitle
    recordType
    patient
    doctorName
    term
    title
    date
    start
    snomed {
      ...SnomedFragment
    }
    observation
    dosage
    quantity
    batchNumber
    expiryDate
    repeat
    sampleDate
    injectionDate
    fasting
    comments
    createdAt
    updatedAt
  }
}
Variables
{"id": ID}
Response
{
  "data": {
    "record": {
      "id": ID,
      "consultationId": "xyz789",
      "sectionId": "abc123",
      "sectionTitle": "abc123",
      "recordType": "abc123",
      "patient": ID,
      "doctorName": "abc123",
      "term": "abc123",
      "title": "xyz789",
      "date": "2021-11-20T14:01:10.746Z",
      "start": "2022-05-20T14:01:10.746Z",
      "snomed": Snomed,
      "observation": "xyz789",
      "dosage": "abc123",
      "quantity": "xyz789",
      "batchNumber": "abc123",
      "expiryDate": "abc123",
      "repeat": 987,
      "sampleDate": "2022-05-20T14:01:10.746Z",
      "injectionDate": "2022-05-20T14:01:10.746Z",
      "fasting": true,
      "comments": "abc123",
      "createdAt": "2022-05-20T14:01:10.746Z",
      "updatedAt": "2022-05-20T14:01:10.746Z"
    }
  }
}

records

This query fetches a collection of records held in the system.
Returns a RecordData

Name Description
dateRange - DateRange
pagination - Pagination
options - QueryOptions

Example

Query
query records($dateRange: DateRange, $pagination: Pagination, $options: QueryOptions) {
  records(dateRange: $dateRange, pagination: $pagination, options: $options) {
    data {
      ...RecordFragment
    }
    pageInfo {
      ...PageInfoFragment
    }
  }
}
Variables
{
  "dateRange": DateRange,
  "pagination": Pagination,
  "options": QueryOptions
}
Response
{
  "data": {
    "records": {
      "data": [Record],
      "pageInfo": PageInfo
    }
  }
}

user

This query fetches the user with the specified identifier if that user belongs to the same practice as the API user making the request.
Returns a User

Name Description
id - ID!

Example

Query
query user($id: ID!) {
  user(id: $id) {
    id
    firstName
    lastName
    email
    fullName
    isDoctor
    accessGroups {
      ...UserAccessGroupFragment
    }
    bookings {
      ...BookingDataFragment
    }
    letters {
      ...LetterDataFragment
    }
  }
}
Variables
{"id": ID}
Response
{
  "data": {
    "user": {
      "id": ID,
      "firstName": "abc123",
      "lastName": "xyz789",
      "email": "xyz789",
      "fullName": "abc123",
      "isDoctor": true,
      "accessGroups": [UserAccessGroup],
      "bookings": BookingData,
      "letters": LetterData
    }
  }
}

users

This query fetches a collection of users that belong to the same practice as the API user making the request. The results are paginated depending on the requested paging parameters.
Returns a UserData

Name Description
pagination - Pagination

Example

Query
query users($pagination: Pagination) {
  users(pagination: $pagination) {
    data {
      ...UserFragment
    }
    pageInfo {
      ...PageInfoFragment
    }
  }
}
Variables
{"pagination": Pagination}
Response
{
  "data": {
    "users": {
      "data": [User],
      "pageInfo": PageInfo
    }
  }
}

Mutations

addContactPhoneNumber

This mutation adds a phone number to a contact.
Returns a ContactResponsePayload

Name Description
contactId - ID!
phoneData - AddContactPhoneData!

Example

Query
mutation addContactPhoneNumber($contactId: ID!, $phoneData: AddContactPhoneData!) {
  addContactPhoneNumber(contactId: $contactId, phoneData: $phoneData) {
    data {
      ...ContactFragment
    }
    error
  }
}
Variables
{
  "contactId": ID,
  "phoneData": AddContactPhoneData
}
Response
{
  "data": {
    "addContactPhoneNumber": {
      "data": Contact,
      "error": "xyz789"
    }
  }
}

addInvoicePayment

This mutation is for recording payment made against an invoice.
Returns a NewInvoiceResponsePayload

Name Description
invoiceId - ID!
paymentData - NewInvoicePaymentDataInput

Example

Query
mutation addInvoicePayment($invoiceId: ID!, $paymentData: NewInvoicePaymentDataInput) {
  addInvoicePayment(invoiceId: $invoiceId, paymentData: $paymentData) {
    data {
      ...InvoiceFragment
    }
    error
  }
}
Variables
{
  "invoiceId": ID,
  "paymentData": NewInvoicePaymentDataInput
}
Response
{
  "data": {
    "addInvoicePayment": {
      "data": Invoice,
      "error": "abc123"
    }
  }
}

addLineItem

This mutation is for adding a line item to an exising invoice.
Returns a NewInvoiceResponsePayload

Name Description
invoiceId - ID!
lineItemData - NewLineItemDataInput

Example

Query
mutation addLineItem($invoiceId: ID!, $lineItemData: NewLineItemDataInput) {
  addLineItem(invoiceId: $invoiceId, lineItemData: $lineItemData) {
    data {
      ...InvoiceFragment
    }
    error
  }
}
Variables
{
  "invoiceId": ID,
  "lineItemData": NewLineItemDataInput
}
Response
{
  "data": {
    "addLineItem": {"data": Invoice, "error": "abc123"}
  }
}

addPatientAccessGroup

This mutation adds a patient to an access group.
Returns a PatientResponsePayload

Name Description
patientId - ID!
accessGroupId - ID!

Example

Query
mutation addPatientAccessGroup($patientId: ID!, $accessGroupId: ID!) {
  addPatientAccessGroup(patientId: $patientId, accessGroupId: $accessGroupId) {
    data {
      ...PatientFragment
    }
    error
  }
}
Variables
{
  "patientId": ID,
  "accessGroupId": ID
}
Response
{
  "data": {
    "addPatientAccessGroup": {
      "data": Patient,
      "error": "abc123"
    }
  }
}

addPatientAttribute

This mutation is for adding a patient attribute.
Returns a PatientResponsePayload

Name Description
patientId - ID!
attributeData - AddCustomAttributeData!

Example

Query
mutation addPatientAttribute($patientId: ID!, $attributeData: AddCustomAttributeData!) {
  addPatientAttribute(patientId: $patientId, attributeData: $attributeData) {
    data {
      ...PatientFragment
    }
    error
  }
}
Variables
{
  "patientId": ID,
  "attributeData": AddCustomAttributeData
}
Response
{
  "data": {
    "addPatientAttribute": {
      "data": Patient,
      "error": "abc123"
    }
  }
}

addPatientLabel

This mutation is for adding a patient label.
Returns a PatientResponsePayload

Name Description
patientId - ID!
labelReferenceId - ID!

Example

Query
mutation addPatientLabel($patientId: ID!, $labelReferenceId: ID!) {
  addPatientLabel(patientId: $patientId, labelReferenceId: $labelReferenceId) {
    data {
      ...PatientFragment
    }
    error
  }
}
Variables
{
  "patientId": ID,
  "labelReferenceId": ID
}
Response
{
  "data": {
    "addPatientLabel": {
      "data": Patient,
      "error": "xyz789"
    }
  }
}

addPatientNumber

This mutation is for adding a patient number (such as NHS number).
Returns a PatientResponsePayload

Name Description
patientId - ID!
patientNumber - AddPatientNumberData!

Example

Query
mutation addPatientNumber($patientId: ID!, $patientNumber: AddPatientNumberData!) {
  addPatientNumber(patientId: $patientId, patientNumber: $patientNumber) {
    data {
      ...PatientFragment
    }
    error
  }
}
Variables
{
  "patientId": ID,
  "patientNumber": AddPatientNumberData
}
Response
{
  "data": {
    "addPatientNumber": {
      "data": Patient,
      "error": "abc123"
    }
  }
}

addPatientPhoneNumber

This mutation is for adding a patient phone number.
Returns a PatientResponsePayload

Name Description
patientId - ID!
phoneData - AddPhoneData!

Example

Query
mutation addPatientPhoneNumber($patientId: ID!, $phoneData: AddPhoneData!) {
  addPatientPhoneNumber(patientId: $patientId, phoneData: $phoneData) {
    data {
      ...PatientFragment
    }
    error
  }
}
Variables
{
  "patientId": ID,
  "phoneData": AddPhoneData
}
Response
{
  "data": {
    "addPatientPhoneNumber": {
      "data": Patient,
      "error": "xyz789"
    }
  }
}

addPatientRelationship

Returns a PatientResponsePayload

Name Description
patientId - ID!
relationshipType - PatientRelationshipType! Note there are a limited number of options for this field, see PatientRelationshipType
relationshipLabel - String Label displayed for the new PatientRelationship if the relationshipType is set to OTHER; for different values, label is automatically generated and this field is ignored
contact - PatientRelationshipContactInput! Details of the Patient/ Contact this PatientRelationship links to

Example

Query
mutation addPatientRelationship($patientId: ID!, $relationshipType: PatientRelationshipType!, $relationshipLabel: String, $contact: PatientRelationshipContactInput!) {
  addPatientRelationship(patientId: $patientId, relationshipType: $relationshipType, relationshipLabel: $relationshipLabel, contact: $contact) {
    data {
      ...PatientFragment
    }
    error
  }
}
Variables
{
  "patientId": ID,
  "relationshipType": PatientRelationshipType,
  "relationshipLabel": "abc123",
  "contact": PatientRelationshipContactInput
}
Response
{
  "data": {
    "addPatientRelationship": {
      "data": Patient,
      "error": "xyz789"
    }
  }
}

addProductLabel

This mutation is for adding a digital label to a specific product.
Returns a ProductResponsePayload

Name Description
productId - ID!
labelReferenceId - ID!

Example

Query
mutation addProductLabel($productId: ID!, $labelReferenceId: ID!) {
  addProductLabel(productId: $productId, labelReferenceId: $labelReferenceId) {
    data {
      ...ProductFragment
    }
    error
  }
}
Variables
{
  "productId": ID,
  "labelReferenceId": ID
}
Response
{
  "data": {
    "addProductLabel": {
      "data": Product,
      "error": "xyz789"
    }
  }
}

createBooking

This mutation creates a new booking.
Returns a BookingResponsePayload

Name Description
patient - ID Deprecated. Use bookingData instead.
location - ID Deprecated. Use bookingData instead.
bookingType - ID Deprecated. Use bookingData instead.
doctor - ID Deprecated. Use bookingData instead.
comments - String Deprecated. Use bookingData instead.
start - Date Deprecated. Use bookingData instead.
end - Date Deprecated. Use bookingData instead.
bookingData - BookingDataInput If you use bookingData, you may not use other fields.

Example

Query
mutation createBooking($patient: ID, $location: ID, $bookingType: ID, $doctor: ID, $comments: String, $start: Date, $end: Date, $bookingData: BookingDataInput) {
  createBooking(patient: $patient, location: $location, bookingType: $bookingType, doctor: $doctor, comments: $comments, start: $start, end: $end, bookingData: $bookingData) {
    data {
      ...BookingFragment
    }
    error
  }
}
Variables
{
  "patient": ID,
  "location": ID,
  "bookingType": ID,
  "doctor": ID,
  "comments": "abc123",
  "start": "2022-05-20T14:01:10.746Z",
  "end": "2022-05-20T14:01:10.746Z",
  "bookingData": BookingDataInput
}
Response
{
  "data": {
    "createBooking": {"data": Booking, "error": "xyz789"}
  }
}

createContact

This mutation is for creating a new external contact in Heydoc.
Returns a NewContactPayload

Name Description
title - String
first - String
last - String
company - String
email - String
address - String
city - String
postcode - String
country - String
phoneType - String
phoneNumber - String

Example

Query
mutation createContact($title: String, $first: String, $last: String, $company: String, $email: String, $address: String, $city: String, $postcode: String, $country: String, $phoneType: String, $phoneNumber: String) {
  createContact(title: $title, first: $first, last: $last, company: $company, email: $email, address: $address, city: $city, postcode: $postcode, country: $country, phoneType: $phoneType, phoneNumber: $phoneNumber) {
    data {
      ...ContactFragment
    }
    error
  }
}
Variables
{
  "title": "xyz789",
  "first": "abc123",
  "last": "abc123",
  "company": "xyz789",
  "email": "xyz789",
  "address": "abc123",
  "city": "abc123",
  "postcode": "abc123",
  "country": "xyz789",
  "phoneType": "xyz789",
  "phoneNumber": "abc123"
}
Response
{
  "data": {
    "createContact": {"data": Contact, "error": "xyz789"}
  }
}

createInvoice

This mutation is for creating a new invoice.
Returns a NewInvoiceResponsePayload

Name Description
invoiceData - NewInvoiceDataInput

Example

Query
mutation createInvoice($invoiceData: NewInvoiceDataInput) {
  createInvoice(invoiceData: $invoiceData) {
    data {
      ...InvoiceFragment
    }
    error
  }
}
Variables
{"invoiceData": NewInvoiceDataInput}
Response
{
  "data": {
    "createInvoice": {"data": Invoice, "error": "abc123"}
  }
}

createLabel

This mutation is for creating a new label.
Returns a NewLabelPayload

Name Description
labelData - CreateLabelData

Example

Query
mutation createLabel($labelData: CreateLabelData) {
  createLabel(labelData: $labelData) {
    data {
      ...LabelFragment
    }
    error
  }
}
Variables
{"labelData": CreateLabelData}
Response
{
  "data": {
    "createLabel": {"data": Label, "error": "abc123"}
  }
}

createLetter

This mutation is for creating a new letter.
Returns a LetterResponsePayload

Name Description
letterData - CreateLetterDataInput!

Example

Query
mutation createLetter($letterData: CreateLetterDataInput!) {
  createLetter(letterData: $letterData) {
    data {
      ...LetterFragment
    }
    error
  }
}
Variables
{"letterData": CreateLetterDataInput}
Response
{
  "data": {
    "createLetter": {"data": Letter, "error": "abc123"}
  }
}

createPatient

This mutation is for creating a new patient.
Returns a PatientResponsePayload

Name Description
title - String Deprecated. Use patientData instead.
first - String Deprecated. Use patientData instead.
last - String Deprecated. Use patientData instead.
email - String Deprecated. Use patientData instead.
dob - Date Deprecated. Use patientData instead.
gender - String Deprecated. Use patientData instead.
sex - String Deprecated. Use patientData instead.
address - String Deprecated. Use patientData instead.
city - String Deprecated. Use patientData instead.
postcode - String Deprecated. Use patientData instead.
country - String Deprecated. Use patientData instead.
phoneType - String Deprecated. Use patientData instead.
phoneNumber - String Deprecated. Use patientData instead.
patientData - CreatePatientDataInput If you use patientData, you may not use other params.

Example

Query
mutation createPatient($title: String, $first: String, $last: String, $email: String, $dob: Date, $gender: String, $sex: String, $address: String, $city: String, $postcode: String, $country: String, $phoneType: String, $phoneNumber: String, $patientData: CreatePatientDataInput) {
  createPatient(title: $title, first: $first, last: $last, email: $email, dob: $dob, gender: $gender, sex: $sex, address: $address, city: $city, postcode: $postcode, country: $country, phoneType: $phoneType, phoneNumber: $phoneNumber, patientData: $patientData) {
    data {
      ...PatientFragment
    }
    error
  }
}
Variables
{
  "title": "abc123",
  "first": "xyz789",
  "last": "xyz789",
  "email": "xyz789",
  "dob": "2022-05-20T14:01:10.746Z",
  "gender": "xyz789",
  "sex": "abc123",
  "address": "xyz789",
  "city": "abc123",
  "postcode": "xyz789",
  "country": "xyz789",
  "phoneType": "abc123",
  "phoneNumber": "xyz789",
  "patientData": CreatePatientDataInput
}
Response
{
  "data": {
    "createPatient": {"data": Patient, "error": "abc123"}
  }
}

createPatientDocument

This mutation is for creating a new patient document.
Returns a NewPatientDocumentPayload

Name Description
patient - ID!
name - String!
type - String!

Example

Query
mutation createPatientDocument($patient: ID!, $name: String!, $type: String!) {
  createPatientDocument(patient: $patient, name: $name, type: $type) {
    data {
      ...PatientDocumentFragment
    }
    error
  }
}
Variables
{"patient": ID, "name": "abc123", "type": "abc123"}
Response
{
  "data": {
    "createPatientDocument": {
      "data": PatientDocument,
      "error": "abc123"
    }
  }
}

createPracticeTemplateDocument

This mutation creates a practice template document.
Returns a NewPracticeTemplateDocumentPayload

Name Description
name - String!
type - String!

Example

Query
mutation createPracticeTemplateDocument($name: String!, $type: String!) {
  createPracticeTemplateDocument(name: $name, type: $type) {
    data {
      ...PracticeTemplateDocumentFragment
    }
    error
  }
}
Variables
{"name": "abc123", "type": "xyz789"}
Response
{
  "data": {
    "createPracticeTemplateDocument": {
      "data": PracticeTemplateDocument,
      "error": "xyz789"
    }
  }
}

createProduct

This mutation creates a new product.
Returns a ProductResponsePayload

Name Description
productData - ProductDataInput!

Example

Query
mutation createProduct($productData: ProductDataInput!) {
  createProduct(productData: $productData) {
    data {
      ...ProductFragment
    }
    error
  }
}
Variables
{"productData": ProductDataInput}
Response
{
  "data": {
    "createProduct": {"data": Product, "error": "xyz789"}
  }
}

deleteBooking

This mutation deletes an existing booking.
Returns a BookingResponsePayload

Name Description
id - ID!

Example

Query
mutation deleteBooking($id: ID!) {
  deleteBooking(id: $id) {
    data {
      ...BookingFragment
    }
    error
  }
}
Variables
{"id": ID}
Response
{
  "data": {
    "deleteBooking": {"data": Booking, "error": "xyz789"}
  }
}

deleteContact

This mutation deletes a contact.
Returns a ContactResponsePayload

Name Description
id - ID!

Example

Query
mutation deleteContact($id: ID!) {
  deleteContact(id: $id) {
    data {
      ...ContactFragment
    }
    error
  }
}
Variables
{"id": ID}
Response
{
  "data": {
    "deleteContact": {"data": Contact, "error": "xyz789"}
  }
}

deleteInvoice

This mutation is for deleting an exising invoice.
Returns a NewInvoiceResponsePayload

Name Description
invoiceId - ID!

Example

Query
mutation deleteInvoice($invoiceId: ID!) {
  deleteInvoice(invoiceId: $invoiceId) {
    data {
      ...InvoiceFragment
    }
    error
  }
}
Variables
{"invoiceId": ID}
Response
{
  "data": {
    "deleteInvoice": {"data": Invoice, "error": "abc123"}
  }
}

deleteInvoicePayment

This mutation is for deleting the record of a payment made against an invoice.
Returns a NewInvoiceResponsePayload

Name Description
invoiceId - ID!
invoicePaymentId - ID!

Example

Query
mutation deleteInvoicePayment($invoiceId: ID!, $invoicePaymentId: ID!) {
  deleteInvoicePayment(invoiceId: $invoiceId, invoicePaymentId: $invoicePaymentId) {
    data {
      ...InvoiceFragment
    }
    error
  }
}
Variables
{
  "invoiceId": ID,
  "invoicePaymentId": ID
}
Response
{
  "data": {
    "deleteInvoicePayment": {
      "data": Invoice,
      "error": "abc123"
    }
  }
}

deleteLetter

This mutation is for deleting an existing letter.
Returns a LetterResponsePayload

Name Description
id - ID!

Example

Query
mutation deleteLetter($id: ID!) {
  deleteLetter(id: $id) {
    data {
      ...LetterFragment
    }
    error
  }
}
Variables
{"id": ID}
Response
{
  "data": {
    "deleteLetter": {"data": Letter, "error": "abc123"}
  }
}

deleteLineItem

This mutation is for deleting a line item from an exising invoice.
Returns a NewInvoiceResponsePayload

Name Description
invoiceId - ID!
lineItemId - ID!

Example

Query
mutation deleteLineItem($invoiceId: ID!, $lineItemId: ID!) {
  deleteLineItem(invoiceId: $invoiceId, lineItemId: $lineItemId) {
    data {
      ...InvoiceFragment
    }
    error
  }
}
Variables
{"invoiceId": ID, "lineItemId": ID}
Response
{
  "data": {
    "deleteLineItem": {"data": Invoice, "error": "abc123"}
  }
}

deletePatient

This mutation deletes a patient.
Returns a PatientResponsePayload

Name Description
id - ID!

Example

Query
mutation deletePatient($id: ID!) {
  deletePatient(id: $id) {
    data {
      ...PatientFragment
    }
    error
  }
}
Variables
{"id": ID}
Response
{
  "data": {
    "deletePatient": {"data": Patient, "error": "xyz789"}
  }
}

deleteProduct

This mutation deletes a product.
Returns a ProductResponsePayload

Name Description
id - ID!

Example

Query
mutation deleteProduct($id: ID!) {
  deleteProduct(id: $id) {
    data {
      ...ProductFragment
    }
    error
  }
}
Variables
{"id": ID}
Response
{
  "data": {
    "deleteProduct": {"data": Product, "error": "xyz789"}
  }
}

removeContactPhoneNumber

This mutation removes a phone number from a contact.
Returns a ContactResponsePayload

Name Description
contactId - ID!
phoneId - ID!

Example

Query
mutation removeContactPhoneNumber($contactId: ID!, $phoneId: ID!) {
  removeContactPhoneNumber(contactId: $contactId, phoneId: $phoneId) {
    data {
      ...ContactFragment
    }
    error
  }
}
Variables
{"contactId": ID, "phoneId": ID}
Response
{
  "data": {
    "removeContactPhoneNumber": {
      "data": Contact,
      "error": "xyz789"
    }
  }
}

removePatientAccessGroup

This mutation removes a patient from an access group.
Returns a PatientResponsePayload

Name Description
patientId - ID!
accessGroupId - ID!

Example

Query
mutation removePatientAccessGroup($patientId: ID!, $accessGroupId: ID!) {
  removePatientAccessGroup(patientId: $patientId, accessGroupId: $accessGroupId) {
    data {
      ...PatientFragment
    }
    error
  }
}
Variables
{
  "patientId": ID,
  "accessGroupId": ID
}
Response
{
  "data": {
    "removePatientAccessGroup": {
      "data": Patient,
      "error": "xyz789"
    }
  }
}

removePatientAttribute

This mutation is for removing a patient attribute.
Returns a PatientResponsePayload

Name Description
patientId - ID!
attributeId - ID!

Example

Query
mutation removePatientAttribute($patientId: ID!, $attributeId: ID!) {
  removePatientAttribute(patientId: $patientId, attributeId: $attributeId) {
    data {
      ...PatientFragment
    }
    error
  }
}
Variables
{"patientId": ID, "attributeId": ID}
Response
{
  "data": {
    "removePatientAttribute": {
      "data": Patient,
      "error": "xyz789"
    }
  }
}

removePatientLabel

This mutation is for removing a patient label.
Returns a PatientResponsePayload

Name Description
patientId - ID!
labelId - ID!

Example

Query
mutation removePatientLabel($patientId: ID!, $labelId: ID!) {
  removePatientLabel(patientId: $patientId, labelId: $labelId) {
    data {
      ...PatientFragment
    }
    error
  }
}
Variables
{"patientId": ID, "labelId": ID}
Response
{
  "data": {
    "removePatientLabel": {
      "data": Patient,
      "error": "xyz789"
    }
  }
}

removePatientNumber

This mutation is for removing a patient number (such as NHS number).
Returns a PatientResponsePayload

Name Description
patientId - ID!
patientNumberId - ID!

Example

Query
mutation removePatientNumber($patientId: ID!, $patientNumberId: ID!) {
  removePatientNumber(patientId: $patientId, patientNumberId: $patientNumberId) {
    data {
      ...PatientFragment
    }
    error
  }
}
Variables
{
  "patientId": ID,
  "patientNumberId": ID
}
Response
{
  "data": {
    "removePatientNumber": {
      "data": Patient,
      "error": "xyz789"
    }
  }
}

removePatientPhoneNumber

This mutation is for removing a patient phone number.
Returns a PatientResponsePayload

Name Description
patientId - ID!
phoneId - ID!

Example

Query
mutation removePatientPhoneNumber($patientId: ID!, $phoneId: ID!) {
  removePatientPhoneNumber(patientId: $patientId, phoneId: $phoneId) {
    data {
      ...PatientFragment
    }
    error
  }
}
Variables
{"patientId": ID, "phoneId": ID}
Response
{
  "data": {
    "removePatientPhoneNumber": {
      "data": Patient,
      "error": "xyz789"
    }
  }
}

removePatientRelationship

Removes an existing PatientRelationship from a Patient.
Returns a PatientResponsePayload

Name Description
patientId - ID!
relationshipId - ID! The ID of the specific PatientRelationship associated with the Patient that should be removed

Example

Query
mutation removePatientRelationship($patientId: ID!, $relationshipId: ID!) {
  removePatientRelationship(patientId: $patientId, relationshipId: $relationshipId) {
    data {
      ...PatientFragment
    }
    error
  }
}
Variables
{
  "patientId": ID,
  "relationshipId": ID
}
Response
{
  "data": {
    "removePatientRelationship": {
      "data": Patient,
      "error": "xyz789"
    }
  }
}

removeProductLabel

This mutation removes a digital label from a specific product.
Returns a ProductResponsePayload

Name Description
productId - ID!
labelId - ID!

Example

Query
mutation removeProductLabel($productId: ID!, $labelId: ID!) {
  removeProductLabel(productId: $productId, labelId: $labelId) {
    data {
      ...ProductFragment
    }
    error
  }
}
Variables
{"productId": ID, "labelId": ID}
Response
{
  "data": {
    "removeProductLabel": {
      "data": Product,
      "error": "xyz789"
    }
  }
}

signIn

This mutation generates an authentication token used for signing into the API.
Returns a Token!

Name Description
apiKey - String
email - String
password - String!

Example

Query
mutation signIn($apiKey: String, $email: String, $password: String!) {
  signIn(apiKey: $apiKey, email: $email, password: $password) {
    token
    user {
      ...UserFragment
    }
  }
}
Variables
{"apiKey": "abc123", "email": "abc123", "password": "xyz789"}
Response
{"data": {"signIn": {"token": "xyz789", "user": User}}}

updateBooking

This mutation updates an existing booking.
Returns a BookingResponsePayload

Name Description
id - ID!
bookingData - BookingDataInput

Example

Query
mutation updateBooking($id: ID!, $bookingData: BookingDataInput) {
  updateBooking(id: $id, bookingData: $bookingData) {
    data {
      ...BookingFragment
    }
    error
  }
}
Variables
{
  "id": ID,
  "bookingData": BookingDataInput
}
Response
{
  "data": {
    "updateBooking": {"data": Booking, "error": "abc123"}
  }
}

updateBookingJourney

This mutation updates the journey of a patient for a booking.
Returns a BookingResponsePayload

Name Description
id - ID!
bookingJourneyInput - BookingJourneyInput

Example

Query
mutation updateBookingJourney($id: ID!, $bookingJourneyInput: BookingJourneyInput) {
  updateBookingJourney(id: $id, bookingJourneyInput: $bookingJourneyInput) {
    data {
      ...BookingFragment
    }
    error
  }
}
Variables
{
  "id": ID,
  "bookingJourneyInput": BookingJourneyInput
}
Response
{
  "data": {
    "updateBookingJourney": {
      "data": Booking,
      "error": "xyz789"
    }
  }
}

updateContact

This mutation updates the details of a contact.
Returns a ContactResponsePayload

Name Description
id - ID!
contactData - UpdateContactDataInput!

Example

Query
mutation updateContact($id: ID!, $contactData: UpdateContactDataInput!) {
  updateContact(id: $id, contactData: $contactData) {
    data {
      ...ContactFragment
    }
    error
  }
}
Variables
{
  "id": ID,
  "contactData": UpdateContactDataInput
}
Response
{
  "data": {
    "updateContact": {"data": Contact, "error": "abc123"}
  }
}

updateContactPhoneNumber

This mutation updates a contact's phone number.
Returns a ContactResponsePayload

Name Description
contactId - ID!
phoneId - ID!
phoneData - UpdateContactPhoneData

Example

Query
mutation updateContactPhoneNumber($contactId: ID!, $phoneId: ID!, $phoneData: UpdateContactPhoneData) {
  updateContactPhoneNumber(contactId: $contactId, phoneId: $phoneId, phoneData: $phoneData) {
    data {
      ...ContactFragment
    }
    error
  }
}
Variables
{
  "contactId": ID,
  "phoneId": ID,
  "phoneData": UpdateContactPhoneData
}
Response
{
  "data": {
    "updateContactPhoneNumber": {
      "data": Contact,
      "error": "xyz789"
    }
  }
}

updateInvoice

This mutation is for updating an exising invoice.
Returns a NewInvoiceResponsePayload

Name Description
invoiceId - ID!
invoiceData - UpdateInvoiceDataInput

Example

Query
mutation updateInvoice($invoiceId: ID!, $invoiceData: UpdateInvoiceDataInput) {
  updateInvoice(invoiceId: $invoiceId, invoiceData: $invoiceData) {
    data {
      ...InvoiceFragment
    }
    error
  }
}
Variables
{
  "invoiceId": ID,
  "invoiceData": UpdateInvoiceDataInput
}
Response
{
  "data": {
    "updateInvoice": {"data": Invoice, "error": "xyz789"}
  }
}

updateInvoicePayment

This mutation is for updating the record of a payment made against an invoice.
Returns a NewInvoiceResponsePayload

Name Description
invoiceId - ID!
invoicePaymentId - ID!
paymentData - UpdateInvoicePaymentDataInput

Example

Query
mutation updateInvoicePayment($invoiceId: ID!, $invoicePaymentId: ID!, $paymentData: UpdateInvoicePaymentDataInput) {
  updateInvoicePayment(invoiceId: $invoiceId, invoicePaymentId: $invoicePaymentId, paymentData: $paymentData) {
    data {
      ...InvoiceFragment
    }
    error
  }
}
Variables
{
  "invoiceId": ID,
  "invoicePaymentId": ID,
  "paymentData": UpdateInvoicePaymentDataInput
}
Response
{
  "data": {
    "updateInvoicePayment": {
      "data": Invoice,
      "error": "xyz789"
    }
  }
}

updateLetter

This mutation is for updating an existing letter.
Returns a LetterResponsePayload

Name Description
id - ID!
letterData - UpdateLetterDataInput!

Example

Query
mutation updateLetter($id: ID!, $letterData: UpdateLetterDataInput!) {
  updateLetter(id: $id, letterData: $letterData) {
    data {
      ...LetterFragment
    }
    error
  }
}
Variables
{
  "id": ID,
  "letterData": UpdateLetterDataInput
}
Response
{
  "data": {
    "updateLetter": {"data": Letter, "error": "abc123"}
  }
}

updateLineItem

Returns a NewInvoiceResponsePayload

Name Description
invoiceId - ID!
lineItemId - ID!
lineItemData - UpdateLineItemDataInput

Example

Query
mutation updateLineItem($invoiceId: ID!, $lineItemId: ID!, $lineItemData: UpdateLineItemDataInput) {
  updateLineItem(invoiceId: $invoiceId, lineItemId: $lineItemId, lineItemData: $lineItemData) {
    data {
      ...InvoiceFragment
    }
    error
  }
}
Variables
{
  "invoiceId": ID,
  "lineItemId": ID,
  "lineItemData": UpdateLineItemDataInput
}
Response
{
  "data": {
    "updateLineItem": {"data": Invoice, "error": "abc123"}
  }
}

updatePatient

This mutation updates the details of an existing patient.
Returns a PatientResponsePayload

Name Description
id - ID!
patientData - UpdatePatientDataInput!

Example

Query
mutation updatePatient($id: ID!, $patientData: UpdatePatientDataInput!) {
  updatePatient(id: $id, patientData: $patientData) {
    data {
      ...PatientFragment
    }
    error
  }
}
Variables
{
  "id": ID,
  "patientData": UpdatePatientDataInput
}
Response
{
  "data": {
    "updatePatient": {"data": Patient, "error": "xyz789"}
  }
}

updatePatientAttribute

This mutation is for updating a patient attribute.
Returns a PatientResponsePayload

Name Description
patientId - ID!
attributeId - ID!
attributeData - UpdateCustomAttributeData!

Example

Query
mutation updatePatientAttribute($patientId: ID!, $attributeId: ID!, $attributeData: UpdateCustomAttributeData!) {
  updatePatientAttribute(patientId: $patientId, attributeId: $attributeId, attributeData: $attributeData) {
    data {
      ...PatientFragment
    }
    error
  }
}
Variables
{
  "patientId": ID,
  "attributeId": ID,
  "attributeData": UpdateCustomAttributeData
}
Response
{
  "data": {
    "updatePatientAttribute": {
      "data": Patient,
      "error": "xyz789"
    }
  }
}

updatePatientNumber

This mutation is for updating a patient number (such as NHS number).
Returns a PatientResponsePayload

Name Description
patientId - ID!
patientNumberId - ID!
value - String

Example

Query
mutation updatePatientNumber($patientId: ID!, $patientNumberId: ID!, $value: String) {
  updatePatientNumber(patientId: $patientId, patientNumberId: $patientNumberId, value: $value) {
    data {
      ...PatientFragment
    }
    error
  }
}
Variables
{
  "patientId": ID,
  "patientNumberId": ID,
  "value": "xyz789"
}
Response
{
  "data": {
    "updatePatientNumber": {
      "data": Patient,
      "error": "xyz789"
    }
  }
}

updatePatientPhoneNumber

This mutation is for updating a patient phone number.
Returns a PatientResponsePayload

Name Description
patientId - ID!
phoneId - ID!
phoneData - UpdatePhoneData

Example

Query
mutation updatePatientPhoneNumber($patientId: ID!, $phoneId: ID!, $phoneData: UpdatePhoneData) {
  updatePatientPhoneNumber(patientId: $patientId, phoneId: $phoneId, phoneData: $phoneData) {
    data {
      ...PatientFragment
    }
    error
  }
}
Variables
{
  "patientId": ID,
  "phoneId": ID,
  "phoneData": UpdatePhoneData
}
Response
{
  "data": {
    "updatePatientPhoneNumber": {
      "data": Patient,
      "error": "xyz789"
    }
  }
}

updatePatientRelationship

Updates an existing PatientRelationship held by a Patient. Note that the relationshipType and relationshipLabel fields cannot be updated using this mutation.
Returns a PatientResponsePayload

Name Description
patientId - ID!
relationshipId - ID! The ID of the specific PatientRelationship associated with the Patient that should be updated
contact - PatientRelationshipContactInput! Details of the Patient/ Contact this PatientRelationship links to

Example

Query
mutation updatePatientRelationship($patientId: ID!, $relationshipId: ID!, $contact: PatientRelationshipContactInput!) {
  updatePatientRelationship(patientId: $patientId, relationshipId: $relationshipId, contact: $contact) {
    data {
      ...PatientFragment
    }
    error
  }
}
Variables
{
  "patientId": ID,
  "relationshipId": ID,
  "contact": PatientRelationshipContactInput
}
Response
{
  "data": {
    "updatePatientRelationship": {
      "data": Patient,
      "error": "abc123"
    }
  }
}

updateProduct

This mutation updates the details of a product.
Returns a ProductResponsePayload

Name Description
id - ID!
productData - ProductDataInput!

Example

Query
mutation updateProduct($id: ID!, $productData: ProductDataInput!) {
  updateProduct(id: $id, productData: $productData) {
    data {
      ...ProductFragment
    }
    error
  }
}
Variables
{
  "id": ID,
  "productData": ProductDataInput
}
Response
{
  "data": {
    "updateProduct": {"data": Product, "error": "xyz789"}
  }
}

Types

Account

Union Types

Patient

Contact

AccountStatement

This type allows you to display the output of a query for a patient's account statement.

Field Name Description
id - ID!
statementType - AccountStatementType
date - Date
start - Date
end - Date
header - String
accountReferenceNumber - String
comments - String
account - Account
invoices - [Invoice]
totalPaid - Float
totalPrice - Float
totalOutstanding - Float
createdAt - Date
updatedAt - Date
deleted - Boolean
Example
{
  "id": ID,
  "statementType": AccountStatementType,
  "date": "2021-11-20T14:01:10.746Z",
  "start": "2022-05-20T14:01:10.746Z",
  "end": "2021-11-20T14:01:10.746Z",
  "header": "xyz789",
  "accountReferenceNumber": "abc123",
  "comments": "xyz789",
  "account": Account,
  "invoices": [Invoice],
  "totalPaid": 123.45,
  "totalPrice": 123.45,
  "totalOutstanding": 123.45,
  "createdAt": "2021-11-20T14:01:10.746Z",
  "updatedAt": "2022-05-20T14:01:10.746Z",
  "deleted": false
}

AccountStatementData

This type encompasses a collection of AccountStatement and Pagination information.

Field Name Description
data - [AccountStatement]
pageInfo - PageInfoForCursorPagination
Example
{
  "data": [AccountStatement],
  "pageInfo": PageInfoForCursorPagination
}

AccountStatementType

Allowed statement types.

Enum Value Description

ACTIVITY

OUTSTANDING

AddContactPhoneData

Used to add a telephone number to a contact.

Input Field Description
phoneNumber - String!
phoneType - PhoneType!
Example
{"phoneNumber": "xyz789", "phoneType": PhoneType}

AddCustomAttributeData

The data defining the custom attribute to be added.

Input Field Description
title - String!
text - String!
response - String!
Example
{"title": "abc123", "text": "abc123", "response": "abc123"}

AddPatientNumberData

A number that is to be added to a patient. NHS number as an example.

Input Field Description
numberId - ID!
value - String!
Example
{"numberId": ID, "value": "xyz789"}

AddPhoneData

The data defining the phone number to be added.

Input Field Description
phoneNumber - String!
phoneType - String!
Example
{"phoneNumber": "abc123", "phoneType": "xyz789"}

Address

An address.

Field Name Description
address - String
city - String
postcode - String
country - String
Example
{
  "address": "abc123",
  "city": "xyz789",
  "postcode": "abc123",
  "country": "abc123"
}

Appointment

An appointment.

Field Name Description
title - String
duration - Int
price - Int
id - ID
Example
{
  "title": "abc123",
  "duration": 987,
  "price": 123,
  "id": ID
}

AppointmentType

The type of an appointment.

Field Name Description
id - ID
title - String
Example
{"id": ID, "title": "xyz789"}

Booking

A booking.

Field Name Description
id - ID!
deleted - Boolean
cancellationReason - String
doctorName - String
doctor - User
location - BookingLocation
appointment - Appointment
start - Date
end - Date
patient - Patient
patientId - ID
bookingJourney - Journey
createdAt - Date
updatedAt - Date
videoUrl - String
comments - String
reference - String
Example
{
  "id": ID,
  "deleted": true,
  "cancellationReason": "abc123",
  "doctorName": "xyz789",
  "doctor": User,
  "location": BookingLocation,
  "appointment": Appointment,
  "start": "2021-11-20T14:01:10.746Z",
  "end": "2022-05-20T14:01:10.746Z",
  "patient": Patient,
  "patientId": ID,
  "bookingJourney": Journey,
  "createdAt": "2022-05-20T14:01:10.746Z",
  "updatedAt": "2022-05-20T14:01:10.746Z",
  "videoUrl": "abc123",
  "comments": "abc123",
  "reference": "abc123"
}

BookingAddress

Physical location of the booking.

Field Name Description
address - String
city - String
postcode - String
country - String
Example
{
  "address": "abc123",
  "city": "abc123",
  "postcode": "abc123",
  "country": "xyz789"
}

BookingData

A collection of bookings and the associated pagination information.

Field Name Description
data - [Booking]
pageInfo - PageInfo
Example
{
  "data": [Booking],
  "pageInfo": PageInfo
}

BookingDataInput

Data representing a new booking.

Input Field Description
patient - ID
location - ID
bookingType - ID
doctor - ID
comments - String
start - Date
end - Date
Example
{
  "patient": ID,
  "location": ID,
  "bookingType": ID,
  "doctor": ID,
  "comments": "xyz789",
  "start": "2022-05-20T14:01:10.746Z",
  "end": "2021-11-20T14:01:10.746Z"
}

BookingJourneyInput

Input Field Description
journeyStage - JourneyStage
date - Date
Example
{
  "journeyStage": JourneyStage,
  "date": "2022-05-20T14:01:10.746Z"
}

BookingLocation

The place the booking takes place.

Field Name Description
id - ID!
header - String
name - String
address - BookingAddress
Example
{
  "id": ID,
  "header": "xyz789",
  "name": "xyz789",
  "address": BookingAddress
}

BookingResponsePayload

The requested/resulting booking or the error associated with the operation.

Field Name Description
data - Booking
error - String
Example
{"data": Booking, "error": "xyz789"}

Boolean

The Boolean scalar type represents true or false.

Example
false

CommunicationPreferences

A patients communication preferences.

Field Name Description
receiveEmail - Boolean
receiveSMS - Boolean
promotionalMarketing - Boolean
privacyPolicy - PrivacyPolicy
Example
{
  "receiveEmail": false,
  "receiveSMS": false,
  "promotionalMarketing": true,
  "privacyPolicy": PrivacyPolicy
}

Contact

A contact.

Field Name Description
id - ID!
title - String
status - String
firstName - String
lastName - String
fullName - String
email - String
phones - [Phone]
address - Address
numbers - [PatientNumber]
medicalSpecialty - String
company - String
createdAt - Date
updatedAt - Date
Example
{
  "id": ID,
  "title": "xyz789",
  "status": "abc123",
  "firstName": "abc123",
  "lastName": "xyz789",
  "fullName": "xyz789",
  "email": "abc123",
  "phones": [Phone],
  "address": Address,
  "numbers": [PatientNumber],
  "medicalSpecialty": "xyz789",
  "company": "xyz789",
  "createdAt": "2021-11-20T14:01:10.746Z",
  "updatedAt": "2021-11-20T14:01:10.746Z"
}

ContactData

A collection of contacts and the associated pagination information.

Field Name Description
data - [Contact]
pageInfo - PageInfo
Example
{
  "data": [Contact],
  "pageInfo": PageInfo
}

ContactResponsePayload

A contact in the application or the error related to the operation on the contact.

Field Name Description
data - Contact
error - String
Example
{"data": Contact, "error": "xyz789"}

CreateLabelData

Used to define a new label.

Input Field Description
color - String!
title - String!
Example
{"color": "abc123", "title": "xyz789"}

CreateLetterDataInput

Data defining a new letter.

Input Field Description
patient - String!
contact - String
location - String
doctor - String
title - String!
body - String!
date - Date
reviewStatus - ReviewStatus
Example
{
  "patient": "abc123",
  "contact": "xyz789",
  "location": "xyz789",
  "doctor": "xyz789",
  "title": "xyz789",
  "body": "abc123",
  "date": "2022-05-20T14:01:10.746Z",
  "reviewStatus": ReviewStatus
}

CreatePatientDataInput

The data used to create a new patient.

Field Name Description
title - String
first - String
last - String
email - String
dob - Date
gender - String
sex - String
address - String
city - String
postcode - String
country - String
phoneType - String
phoneNumber - String
paymentReference - String
communicationPreferences - PatientCommunicationPreferencesInput
labels - [ID!]
customAttributes - [AddCustomAttributeData]
Example
{
  "title": "abc123",
  "first": "abc123",
  "last": "xyz789",
  "email": "xyz789",
  "dob": "2022-05-20T14:01:10.746Z",
  "gender": "xyz789",
  "sex": "abc123",
  "address": "xyz789",
  "city": "abc123",
  "postcode": "abc123",
  "country": "abc123",
  "phoneType": "xyz789",
  "phoneNumber": "xyz789",
  "paymentReference": "abc123",
  "communicationPreferences": PatientCommunicationPreferencesInput,
  "labels": [ID],
  "customAttributes": [AddCustomAttributeData]
}

CursorPagination

For pagination that is cursor-based.

Input Field Description
cursor - String

The starting element for the next page. A typical usecase would be identifier of the last object received.

direction - CursorPaginationDirection

Used to provide a direction of travel through the result set.

pageSize - Int

How many objects to retrieve

Example
{
  "cursor": "abc123",
  "direction": CursorPaginationDirection,
  "pageSize": 123
}

CursorPaginationDirection

The subsequent page to fetch.

Enum Value Description

PREVIOUS

NEXT

CustomAttribute

Defines a custom attribute.

Field Name Description
id - ID
title - String
text - String
response - String
Example
{
  "id": ID,
  "title": "abc123",
  "text": "abc123",
  "response": "xyz789"
}

Date

Example
2022-05-20T14:01:10.746Z

DateRange

A date range used when considering the relevance of results. No assumptions or adjustments are made to the times in the supplied dates, most cases will require the user to define the times as appropriate.

Input Field Description
start - Date
end - Date
Example
{"start": "2021-11-20T14:01:10.746Z", "end": "2021-11-20T14:01:10.746Z"}

Float

The Float scalar type represents signed double-precision fractional values as specified by IEEE 754.

Example
987.65

ID

The ID scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as "4") or integer (such as 4) input value will be accepted as an ID.

Example
object

IdType

Enum Value Description

SYSTEM

USER

COMPUCARE

NHS_UK

Int

The Int scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.

Example
123

Invoice

Field Name Description
id - ID
status - String
paidOrOutstanding - String
invoiceNumber - Int
paymentReference - String
date - Date
patientId - ID
patient - Patient
payeeDetails - String
doctorId - ID
doctor - User
location - String
lineItems - [LineItem]
payments - [InvoicePayment]
tax - Float
total - Float
outstanding - Float
comments - String Internal Notes.
extraInfo - String Notes.
type - String
createdAt - Date
updatedAt - Date
Example
{
  "id": ID,
  "status": "xyz789",
  "paidOrOutstanding": "abc123",
  "invoiceNumber": 123,
  "paymentReference": "abc123",
  "date": "2022-05-20T14:01:10.746Z",
  "patientId": ID,
  "patient": Patient,
  "payeeDetails": "xyz789",
  "doctorId": ID,
  "doctor": User,
  "location": "abc123",
  "lineItems": [LineItem],
  "payments": [InvoicePayment],
  "tax": 987.65,
  "total": 987.65,
  "outstanding": 123.45,
  "comments": "xyz789",
  "extraInfo": "xyz789",
  "type": "xyz789",
  "createdAt": "2022-05-20T14:01:10.746Z",
  "updatedAt": "2021-11-20T14:01:10.746Z"
}

InvoiceData

A collection of invoices and the associated pagination information.

Field Name Description
data - [Invoice]
pageInfo - PageInfo
Example
{
  "data": [Invoice],
  "pageInfo": PageInfo
}

InvoicePayment

A payment made against an invoice.

Field Name Description
id - ID!
paymentAmmount - Float
paymentSource - String!
paymentDate - Date!
comment - String
Example
{
  "id": ID,
  "paymentAmmount": 987.65,
  "paymentSource": "abc123",
  "paymentDate": "2022-05-20T14:01:10.746Z",
  "comment": "xyz789"
}

Journey

The progression of a booking.

Field Name Description
arrived - Date
consultation - Date
departed - Date
dna - Date
Example
{
  "arrived": "2021-11-20T14:01:10.746Z",
  "consultation": "2021-11-20T14:01:10.746Z",
  "departed": "2022-05-20T14:01:10.746Z",
  "dna": "2021-11-20T14:01:10.746Z"
}

JourneyStage

Allowed stages in the booking journey.

Enum Value Description

arrived

consultation

departed

dna

Lab

Representation of a pathology request for sending to a lab.

Field Name Description
id - ID!
status - String
patient - Patient
doctor - User
requestDate - Date
sampleDate - Date
fasting - Boolean
orderNumber - String
parsedResults - String
resultsReceivedAt - Date
testList - String
createdAt - Date
updatedAt - Date
Example
{
  "id": ID,
  "status": "xyz789",
  "patient": Patient,
  "doctor": User,
  "requestDate": "2022-05-20T14:01:10.746Z",
  "sampleDate": "2022-05-20T14:01:10.746Z",
  "fasting": false,
  "orderNumber": "abc123",
  "parsedResults": "xyz789",
  "resultsReceivedAt": "2022-05-20T14:01:10.746Z",
  "testList": "xyz789",
  "createdAt": "2022-05-20T14:01:10.746Z",
  "updatedAt": "2022-05-20T14:01:10.746Z"
}

LabComments

Comments relating to a pathology request.

Field Name Description
doctor - User
comments - String
signature - String
Example
{
  "doctor": User,
  "comments": "abc123",
  "signature": "abc123"
}

LabData

A collection of pathology requests and the related pagination information.

Field Name Description
data - [Lab]
pageInfo - PageInfo
Example
{
  "data": [Lab],
  "pageInfo": PageInfo
}

LabQueryOptions

Used for further refining lab search results.

Input Field Description
includeDeleted - Boolean
createdAt - DateRange
updatedAt - DateRange
resultsReceivedAt - DateRange
Example
{
  "includeDeleted": true,
  "createdAt": DateRange,
  "updatedAt": DateRange,
  "resultsReceivedAt": DateRange
}

Label

A digital label.

Field Name Description
id - ID!
color - String
title - String
Example
{"id": ID, "color": "xyz789", "title": "abc123"}

LabelData

A collection of existing labels and the related pagination information.

Field Name Description
data - [Label]
pageInfo - PageInfo
Example
{
  "data": [Label],
  "pageInfo": PageInfo
}

Letter

A letter in the system.

Field Name Description
id - ID!
deleted - Boolean
reviewStatus - ReviewStatus
patient - Patient
doctor - User
date - Date
title - String
body - String
contact - LetterContact
createdAt - Date
updatedAt - Date
Example
{
  "id": ID,
  "deleted": true,
  "reviewStatus": ReviewStatus,
  "patient": Patient,
  "doctor": User,
  "date": "2021-11-20T14:01:10.746Z",
  "title": "abc123",
  "body": "xyz789",
  "contact": LetterContact,
  "createdAt": "2021-11-20T14:01:10.746Z",
  "updatedAt": "2021-11-20T14:01:10.746Z"
}

LetterContact

The letter contact.

Field Name Description
name - String
email - String
Example
{"name": "abc123", "email": "xyz789"}

LetterData

A collection of letters and the related pagination information.

Field Name Description
data - [Letter]
pageInfo - PageInfo
Example
{
  "data": [Letter],
  "pageInfo": PageInfo
}

LetterResponsePayload

The requested letter or error message related to it's retrieval.

Field Name Description
data - Letter
error - String
Example
{"data": Letter, "error": "abc123"}

LineItem

An entry in an invoice.

Field Name Description
id - ID
date - Date
title - String
productType - String
itemCode - String
cost - Float
price - Float
quantity - Float
taxRate - Float
total - Float
Example
{
  "id": ID,
  "date": "2021-11-20T14:01:10.746Z",
  "title": "xyz789",
  "productType": "abc123",
  "itemCode": "abc123",
  "cost": 123.45,
  "price": 123.45,
  "quantity": 987.65,
  "taxRate": 987.65,
  "total": 987.65
}

NewContactPayload

The type representing the contact to create.

Field Name Description
data - Contact
error - String
Example
{"data": Contact, "error": "xyz789"}

NewInvoiceDataInput

Used for creating a new invoice.

Field Name Description
date - Date!
patientId - ID!
doctorId - ID!
locationId - ID!
comments - String
extraInfo - String
lineItems - [NewLineItemDataInput]
payments - [NewInvoicePaymentDataInput]
Example
{
  "date": "2022-05-20T14:01:10.746Z",
  "patientId": ID,
  "doctorId": ID,
  "locationId": ID,
  "comments": "abc123",
  "extraInfo": "xyz789",
  "lineItems": [NewLineItemDataInput],
  "payments": [NewInvoicePaymentDataInput]
}

NewInvoicePaymentDataInput

Used for recording a new payment against an invoice.

Input Field Description
paymentAmount - Float!
paymentTypeId - ID!
paymentDate - Date!
comment - String
Example
{
  "paymentAmount": 987.65,
  "paymentTypeId": ID,
  "paymentDate": "2021-11-20T14:01:10.746Z",
  "comment": "xyz789"
}

NewInvoiceResponsePayload

The newly created invoice or an error related to the failed creation of the invoice.

Field Name Description
data - Invoice
error - String
Example
{"data": Invoice, "error": "xyz789"}

NewLabelPayload

Used when creating a new label.

Field Name Description
data - Label
error - String
Example
{"data": Label, "error": "abc123"}

NewLineItemDataInput

Used for creating a new line item in an invoice.

Input Field Description
date - Date!
productId - ID!
quantity - Int!
price - Float
referenceId - ID

A booking ID

Example
{
  "date": "2021-11-20T14:01:10.746Z",
  "productId": ID,
  "quantity": 123,
  "price": 123.45,
  "referenceId": ID
}

NewPatientDocumentPayload

The type representing the patient document to create.

Field Name Description
data - PatientDocument
error - String
Example
{"data": PatientDocument, "error": "abc123"}

NewPracticeTemplateDocumentPayload

Type type representing the practice document template to create.

Field Name Description
data - PracticeTemplateDocument
error - String
Example
{"data": PracticeTemplateDocument, "error": "abc123"}

PageInfo

Information regarding how the requested data is paginated. This type is soon to phased out in preferece for the better performing PageInfoForCursorPagination.

Field Name Description
page - Int
pageSize - Int
hasMore - Boolean
Example
{"page": 987, "pageSize": 123, "hasMore": true}

PageInfoForCursorPagination

Information regarding how the requested data is paginated.

Field Name Description
pageSize - Int
hasMore - Boolean
Example
{"pageSize": 987, "hasMore": true}

Pagination

Infomation regarding how requested data has been paginated.

Input Field Description
page - Int
pageSize - Int
Example
{"page": 123, "pageSize": 987}

Patient

The data defining a patient.

Field Name Description
id - ID
title - String
status - String
firstName - String
lastName - String
fullName - String
dob - Date
gender - String
sex - String
email - String
googleClientId - String
paymentReference - String
phones - [Phone]
occupation - String
address - Address
membershipName - String
membershipStartDate - String
sharingToken - SharingToken
numbers - [PatientNumber]
customAttributes - [CustomAttribute]
communicationPreferences - CommunicationPreferences
relatedAccounts - [PatientRelationship]
bookings - [Booking]

Arguments

start - Date!

end - Date!

invoices - [Invoice]

Arguments

start - Date!

end - Date!

letters - [Letter]
labs - [Lab]
labels - [PatientLabel]
prescriptions - PrescriptionData

Arguments

page - Int

pageSize - Int

records - RecordData

Arguments

page - Int

pageSize - Int

createdAt - Date
updatedAt - Date
accessGroups - [PatientAccessGroup]
Example
{
  "id": ID,
  "title": "xyz789",
  "status": "abc123",
  "firstName": "xyz789",
  "lastName": "abc123",
  "fullName": "xyz789",
  "dob": "2021-11-20T14:01:10.746Z",
  "gender": "xyz789",
  "sex": "abc123",
  "email": "abc123",
  "googleClientId": "xyz789",
  "paymentReference": "xyz789",
  "phones": [Phone],
  "occupation": "xyz789",
  "address": Address,
  "membershipName": "xyz789",
  "membershipStartDate": "xyz789",
  "sharingToken": SharingToken,
  "numbers": [PatientNumber],
  "customAttributes": [CustomAttribute],
  "communicationPreferences": CommunicationPreferences,
  "relatedAccounts": [PatientRelationship],
  "bookings": [Booking],
  "invoices": [Invoice],
  "letters": [Letter],
  "labs": [Lab],
  "labels": [PatientLabel],
  "prescriptions": PrescriptionData,
  "records": RecordData,
  "createdAt": "2022-05-20T14:01:10.746Z",
  "updatedAt": "2021-11-20T14:01:10.746Z",
  "accessGroups": [PatientAccessGroup]
}

PatientAccessGroup

An access group to which the patient belongs.

Field Name Description
id - ID!
name - String!
label - String!
Example
{"id": ID, "name": "abc123", "label": "abc123"}

PatientCommunicationPreferencesInput

The data defining patient communication options.

Input Field Description
receiveEmail - Boolean
receiveSMS - Boolean
promotionalMarketing - Boolean
privacyPolicy - String
Example
{
  "receiveEmail": false,
  "receiveSMS": false,
  "promotionalMarketing": false,
  "privacyPolicy": "abc123"
}

PatientData

A collection of patient data and how this data is paginated.

Field Name Description
data - [Patient]
pageInfo - PageInfo
Example
{
  "data": [Patient],
  "pageInfo": PageInfo
}

PatientDocument

A document that is associated to a patient.

Field Name Description
id - ID!
title - String
patientId - ID
patient - Patient
path - String
name - String
type - String
url - String
parent - ID
deleted - Boolean
dateCreated - Date
dateModified - Date
uploadUrl - String
Example
{
  "id": ID,
  "title": "xyz789",
  "patientId": ID,
  "patient": Patient,
  "path": "xyz789",
  "name": "abc123",
  "type": "abc123",
  "url": "xyz789",
  "parent": ID,
  "deleted": true,
  "dateCreated": "2022-05-20T14:01:10.746Z",
  "dateModified": "2022-05-20T14:01:10.746Z",
  "uploadUrl": "abc123"
}

PatientDocumentData

A collection of patient documents and the related pagination information.

Field Name Description
data - [PatientDocument]
pageInfo - PageInfo
Example
{
  "data": [PatientDocument],
  "pageInfo": PageInfo
}

PatientLabel

The data defining a label applied to a patient.

Field Name Description
color - String
text - String
id - ID!
labelReferenceId - ID!
Example
{
  "color": "xyz789",
  "text": "abc123",
  "id": ID,
  "labelReferenceId": ID
}

PatientNumber

A number that belongs to the patient.

Field Name Description
id - ID!
name - String
value - String
Example
{"id": ID, "name": "abc123", "value": "abc123"}

PatientRelationship

A patient relationship held by a Patient.

Field Name Description
relationshipId - ID
relationshipType - PatientRelationshipType
relationshipLabel - String Label displayed for this relationship if the relationshipType has been set to OTHER; for different values, label is automatically generated and this field is ignored
deleted - Boolean Returns true if there is a related Patient/ Contact that has been deleted, and false otherwise
contactDetails - PatientRelationshipContact
Example
{
  "relationshipId": ID,
  "relationshipType": PatientRelationshipType,
  "relationshipLabel": "xyz789",
  "deleted": false,
  "contactDetails": PatientRelationshipContact
}

PatientRelationshipContact

Details for a Patient/ Contact that has been linked to in a PatientRelationship.

Field Name Description
name - String
contactInfo - String Additional information that should be displayed alongside the parent PatientRelationship
relatedAccountId - ID The ID of the related Patient/ Contact if there is one
policyNumber - String Included only when related Patient/ Contact has a PatientRelationshipType of INSURER
authorizationCode - String Included only when related Patient/ Contact has a PatientRelationshipType of INSURER
Example
{
  "name": "xyz789",
  "contactInfo": "xyz789",
  "relatedAccountId": ID,
  "policyNumber": "abc123",
  "authorizationCode": "xyz789"
}

PatientRelationshipContactInput

Used to specify details for a Patient/ Contact that is being linked to in a PatientRelationship.

Input Field Description
name - String

Value can only be specified if a relatedAccountId is NOT specified

contactInfo - String

Additional information that should be displayed alongside the parent PatientRelationship

relatedAccountId - ID

The ID of the related Patient/`Contact; only specify if applicable

policyNumber - String

Can only be included when the PatientRelationshipType is set to INSURER

authorizationCode - String

Can only be included when the PatientRelationshipType is set to INSURER

Example
{
  "name": "xyz789",
  "contactInfo": "abc123",
  "relatedAccountId": ID,
  "policyNumber": "abc123",
  "authorizationCode": "abc123"
}

PatientRelationshipData

A collection of PatientRelationships

Field Name Description
data - [PatientRelationship]
Example
{"data": [PatientRelationship]}

PatientRelationshipType

Allowed PatientRelationship types.

Enum Value Description

FAMILY

EMERGENCY_CONTACT

NEXT_OF_KIN

INSURER

PRACTITIONER

PAYER

REFERRING_CLINICIAN

OTHER

PatientResponsePayload

The response receieved when querying for patient information.

Field Name Description
data - Patient
error - String
Example
{"data": Patient, "error": "xyz789"}

Phone

A telephone number.

Field Name Description
phoneId - ID
phoneType - String
phoneNumber - String
Example
{
  "phoneId": ID,
  "phoneType": "xyz789",
  "phoneNumber": "xyz789"
}

PhoneType

Allowed telephone types.

Enum Value Description

Mobile

Office

Home

Fax

Other

Practice

Information about your practice.

Field Name Description
id - ID!
locations - [PracticeLocation] A room.
appointmentTypes - [AppointmentType]
paymentTypes - [PracticePaymentType]
accessGroups - [PracticeAccessGroups]
practiceNumbers - [PracticeNumbers]
Example
{
  "id": ID,
  "locations": [PracticeLocation],
  "appointmentTypes": [AppointmentType],
  "paymentTypes": [PracticePaymentType],
  "accessGroups": [PracticeAccessGroups],
  "practiceNumbers": [PracticeNumbers]
}

PracticeAccessGroups

Field Name Description
id - ID!
name - String!
label - String!
Example
{"id": ID, "name": "xyz789", "label": "abc123"}

PracticeLocation

Field Name Description
id - ID!
name - String!
groupName - String!
Example
{"id": ID, "name": "abc123", "groupName": "xyz789"}

PracticeNumbers

Field Name Description
id - ID!
name - String!
primary - Boolean!
deleted - Boolean!
idType - IdType!
Example
{
  "id": ID,
  "name": "xyz789",
  "primary": false,
  "deleted": true,
  "idType": IdType
}

PracticePaymentType

Field Name Description
id - ID!
name - String!
Example
{"id": ID, "name": "xyz789"}

PracticeTemplateDocument

A document template used by the practice.

Field Name Description
id - ID!
patientId - ID
path - String
name - String
type - String
url - String
deleted - Boolean
dateCreated - Date
dateModified - Date
uploadUrl - String
downloadUrl - String
Example
{
  "id": ID,
  "patientId": ID,
  "path": "abc123",
  "name": "xyz789",
  "type": "xyz789",
  "url": "abc123",
  "deleted": true,
  "dateCreated": "2021-11-20T14:01:10.746Z",
  "dateModified": "2022-05-20T14:01:10.746Z",
  "uploadUrl": "abc123",
  "downloadUrl": "xyz789"
}

PracticeTemplateDocumentData

A collection of document templates and the related pagination information.

Field Name Description
data - [PracticeTemplateDocument]
pageInfo - PageInfo
Example
{
  "data": [PracticeTemplateDocument],
  "pageInfo": PageInfo
}

Prescription

A prescription for a patient.

Field Name Description
patient - Patient
doctor - User
date - Date
status - String
drugs - [PrescriptionDrug]
Example
{
  "patient": Patient,
  "doctor": User,
  "date": "2022-05-20T14:01:10.746Z",
  "status": "abc123",
  "drugs": [PrescriptionDrug]
}

PrescriptionData

A collection of prescriptions and the related pagination information.

Field Name Description
data - [Prescription]
pageInfo - PageInfo
Example
{
  "data": [Prescription],
  "pageInfo": PageInfo
}

PrescriptionDrug

An entry in a prescription.

Field Name Description
drug - String
dosage - String
quantity - String
repeat - Int
comments - String
Example
{
  "drug": "xyz789",
  "dosage": "abc123",
  "quantity": "xyz789",
  "repeat": 987,
  "comments": "abc123"
}

PrivacyPolicy

A privacy policy.

Field Name Description
response - String
Example
{"response": "abc123"}

Product

The representation of a product.

Field Name Description
id - ID!
status - String
productType - ProductType
labels - [ProductLabel]
itemCode - String
name - String
serialNumber - String
tax - Tax
stockLevel - Int
price - Float
cost - Float
supplierName - String
comments - String
appointments - [Product]
isBookable - Boolean
duration - Int
color - String
isVideoConsultation - Boolean
requiresPayment - Boolean
requiresConfirmation - Boolean
createdAt - Date
updatedAt - Date
Example
{
  "id": ID,
  "status": "xyz789",
  "productType": ProductType,
  "labels": [ProductLabel],
  "itemCode": "abc123",
  "name": "abc123",
  "serialNumber": "xyz789",
  "tax": Tax,
  "stockLevel": 123,
  "price": 123.45,
  "cost": 123.45,
  "supplierName": "abc123",
  "comments": "abc123",
  "appointments": [Product],
  "isBookable": true,
  "duration": 987,
  "color": "abc123",
  "isVideoConsultation": false,
  "requiresPayment": true,
  "requiresConfirmation": true,
  "createdAt": "2021-11-20T14:01:10.746Z",
  "updatedAt": "2021-11-20T14:01:10.746Z"
}

ProductData

A collection of products and the relevant pagination information.

Field Name Description
data - [Product]
pageInfo - PageInfo
Example
{
  "data": [Product],
  "pageInfo": PageInfo
}

ProductDataInput

The data used to define a new product.

Input Field Description
productType - ProductType
name - String
price - Float
itemCode - String
membershipFrequency - String
supplierName - String
duration - Int
color - String
isBookable - Boolean
serialNumber - String
stockLevel - Int
cost - Float
comments - String
isVideoConsultation - Boolean
requiresPayment - Boolean
requiresConfirmation - Boolean
Example
{
  "productType": ProductType,
  "name": "xyz789",
  "price": 123.45,
  "itemCode": "xyz789",
  "membershipFrequency": "abc123",
  "supplierName": "abc123",
  "duration": 123,
  "color": "abc123",
  "isBookable": true,
  "serialNumber": "xyz789",
  "stockLevel": 123,
  "cost": 987.65,
  "comments": "xyz789",
  "isVideoConsultation": true,
  "requiresPayment": true,
  "requiresConfirmation": false
}

ProductLabel

A digital label that is applied to the product for tagging/grouping purposes.

Field Name Description
color - String
text - String
id - ID!
referenceId - ID!
Example
{
  "color": "abc123",
  "text": "xyz789",
  "id": ID,
  "referenceId": ID
}

ProductResponsePayload

The requested product or a related error.

Field Name Description
data - Product
error - String
Example
{"data": Product, "error": "xyz789"}

ProductType

The type of product.

Enum Value Description

appointment

medication

vaccine

lab

membership

pathway

other

QueryOptions

Additional filtering options used in some queries to refine results.

Input Field Description
includeDeleted - Boolean
createdAt - DateRange
updatedAt - DateRange
Example
{
  "includeDeleted": false,
  "createdAt": DateRange,
  "updatedAt": DateRange
}

Record

An entry in a consultation.

Field Name Description
id - ID
consultationId - String
sectionId - String
sectionTitle - String
recordType - String
patient - ID
doctorName - String
term - String
title - String
date - Date
start - Date
snomed - Snomed
observation - String
dosage - String
quantity - String
batchNumber - String
expiryDate - String
repeat - Int
sampleDate - Date
injectionDate - Date
fasting - Boolean
comments - String
createdAt - Date
updatedAt - Date
Example
{
  "id": ID,
  "consultationId": "xyz789",
  "sectionId": "xyz789",
  "sectionTitle": "xyz789",
  "recordType": "xyz789",
  "patient": ID,
  "doctorName": "abc123",
  "term": "xyz789",
  "title": "abc123",
  "date": "2022-05-20T14:01:10.746Z",
  "start": "2022-05-20T14:01:10.746Z",
  "snomed": Snomed,
  "observation": "abc123",
  "dosage": "xyz789",
  "quantity": "xyz789",
  "batchNumber": "xyz789",
  "expiryDate": "xyz789",
  "repeat": 987,
  "sampleDate": "2022-05-20T14:01:10.746Z",
  "injectionDate": "2022-05-20T14:01:10.746Z",
  "fasting": false,
  "comments": "xyz789",
  "createdAt": "2021-11-20T14:01:10.746Z",
  "updatedAt": "2022-05-20T14:01:10.746Z"
}

RecordData

Multiple records and information regarding pagination.

Field Name Description
data - [Record]
pageInfo - PageInfo
Example
{
  "data": [Record],
  "pageInfo": PageInfo
}

ReviewStatus

The review status of a letter.

Enum Value Description

NONE

AWAITING_REVIEW

AWAITING_CORRECTION

COMPLETED

SharingToken

Field Name Description
token - String
Example
{"token": "abc123"}

Snomed

An entry in the Snomed dataset.

Field Name Description
conceptId - String
term - String
Example
{"conceptId": "xyz789", "term": "abc123"}

String

The String scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.

Tax

A tax that is applied to a product.

Field Name Description
taxName - String
taxRate - Int
taxCode - String
Example
{"taxName": "xyz789", "taxRate": 123, "taxCode": "xyz789"}

Token

Field Name Description
token - String!
user - User
Example
{"token": "xyz789", "user": User}

UpdateContactDataAddressInput

Used to update the address of an existing contact.

Input Field Description
address - String
city - String
postcode - String
country - String
Example
{
  "address": "xyz789",
  "city": "abc123",
  "postcode": "abc123",
  "country": "abc123"
}

UpdateContactDataInput

Data representing the updated contact.

Field Name Description
title - String
first - String
last - String
email - String
phones - [UpdateContactDataPhoneInput]
address - UpdateContactDataAddressInput
medicalSpecialty - String
company - String
Example
{
  "title": "abc123",
  "first": "abc123",
  "last": "abc123",
  "email": "abc123",
  "phones": [UpdateContactDataPhoneInput],
  "address": UpdateContactDataAddressInput,
  "medicalSpecialty": "xyz789",
  "company": "abc123"
}

UpdateContactDataPhoneInput

Used to update an exising phone number for a contact.

Input Field Description
phoneNumber - String
phoneType - PhoneType
Example
{"phoneNumber": "xyz789", "phoneType": PhoneType}

UpdateContactPhoneData

Used to update an exising phone number for a contact.

Input Field Description
phoneNumber - String
phoneType - PhoneType
Example
{"phoneNumber": "abc123", "phoneType": PhoneType}

UpdateCustomAttributeData

The data defining the custom attribute to be updated.

Input Field Description
title - String
text - String
response - String
Example
{"title": "abc123", "text": "xyz789", "response": "xyz789"}

UpdateInvoiceDataInput

Used for updated an existing invoice.

Input Field Description
date - Date
doctorId - ID
locationId - ID
comments - String
extraInfo - String
Example
{
  "date": "2022-05-20T14:01:10.746Z",
  "doctorId": ID,
  "locationId": ID,
  "comments": "xyz789",
  "extraInfo": "xyz789"
}

UpdateInvoicePaymentDataInput

Used for updating a payment already made against an invoice.

Input Field Description
paymentAmount - Float
paymentTypeId - ID
paymentDate - Date
comment - String
Example
{
  "paymentAmount": 123.45,
  "paymentTypeId": ID,
  "paymentDate": "2021-11-20T14:01:10.746Z",
  "comment": "abc123"
}

UpdateLetterDataInput

Data defining how an existing letter should be updated.

Input Field Description
patient - String
contact - String
location - String
doctor - String
title - String
body - String
date - Date
reviewStatus - ReviewStatus
Example
{
  "patient": "abc123",
  "contact": "xyz789",
  "location": "abc123",
  "doctor": "abc123",
  "title": "xyz789",
  "body": "xyz789",
  "date": "2021-11-20T14:01:10.746Z",
  "reviewStatus": ReviewStatus
}

UpdateLineItemDataInput

Used for updating an already existing invoice line item.

Input Field Description
date - Date
productId - ID
quantity - Int
price - Float
referenceId - ID

A booking ID

Example
{
  "date": "2022-05-20T14:01:10.746Z",
  "productId": ID,
  "quantity": 987,
  "price": 987.65,
  "referenceId": ID
}

UpdatePatientDataInput

The data used to update a patient.

Input Field Description
title - String
first - String
last - String
email - String
dob - Date
gender - String
sex - String
address - String
city - String
postcode - String
country - String
paymentReference - String
communicationPreferences - PatientCommunicationPreferencesInput
Example
{
  "title": "abc123",
  "first": "abc123",
  "last": "xyz789",
  "email": "abc123",
  "dob": "2021-11-20T14:01:10.746Z",
  "gender": "xyz789",
  "sex": "abc123",
  "address": "abc123",
  "city": "xyz789",
  "postcode": "xyz789",
  "country": "abc123",
  "paymentReference": "xyz789",
  "communicationPreferences": PatientCommunicationPreferencesInput
}

UpdatePhoneData

The data defining the phone number to be added.

Input Field Description
phoneNumber - String
phoneType - String
Example
{"phoneNumber": "xyz789", "phoneType": "xyz789"}

User

A user in the application.

Field Name Description
id - ID!
firstName - String!
lastName - String!
email - String!
fullName - String!
isDoctor - Boolean
accessGroups - [UserAccessGroup]
bookings - BookingData

Arguments

start - Date!

end - Date!

page - Int

pageSize - Int

letters - LetterData

Arguments

page - Int

pageSize - Int

Example
{
  "id": ID,
  "firstName": "xyz789",
  "lastName": "abc123",
  "email": "xyz789",
  "fullName": "xyz789",
  "isDoctor": true,
  "accessGroups": [UserAccessGroup],
  "bookings": BookingData,
  "letters": LetterData
}

UserAccessGroup

The access group for a user.

Field Name Description
id - ID!
name - String!
label - String!
Example
{"id": ID, "name": "abc123", "label": "xyz789"}

UserData

A collection of users and information regarding how the colllection is paginated.

Field Name Description
data - [User]
pageInfo - PageInfo
Example
{
  "data": [User],
  "pageInfo": PageInfo
}