Query Reference List

A list of the queries currently available with the Heydoc API

Jessica Magri avatar
Written by Jessica Magri
Updated over a week ago

This article gives a current list of queries that are available with the Heydoc API. For general information about queries, see here.

Note: Data types that have an exclamation mark ( ! ) after them are required for the query or mutation that you want to perform.

Note: Before you attempt to query the Heydoc API, make sure you have signed in.


Account Statement

This query is for fetching the ID of a specific financial account statement of a patient.

Query

Response

Arguments - Data Type

accountStatement

Returns a AccountStatement type

id - ID!

Example:

query accountStatement($id: ID!) { 
accountStatement(id: $id) {
id statementType date start end header accountReferenceNumber comments account invoices {
...InvoiceFragment
} totalPaid totalPrice totalOutstanding createdAt updatedAt deleted
}
}

Account Statement Data

This query is for fetching the data of a specific account statement of a patient.

Query

Response

Arguments - Data Type

accountStatements

Returns an AccountStatementData type

dateRange - DateRange!

pagination - CursorPagination

options - QueryOptions

Example:

query accountStatements($dateRange: DateRange!, $pagination: CursorPagination, $options: QueryOptions) {
accountStatements(dateRange: $dateRange, pagination: $pagination, options: $options) {
data {
...AccountStatementFragment
}
pageInfo {
...PageInfoForCursorPaginationFragment
}
}
}

Bookings

This query is for fetching data about patient bookings made in Heydoc.

Query

Response

Arguments - Data Type

bookings

Returns a BookingData type

dateRange - DateRange

pagination - Pagination

options - QueryOptions

Example:

query bookings($dateRange: DateRange, $pagination: Pagination, $options: QueryOptions) { 
bookings(dateRange: $dateRange, pagination:
$pagination, options: $options) {
data {
...BookingFragment
}
pageInfo {
...PageInfoFragment
}
}
}

Contact

This query is for fetching the ID of a specific external contact in Heydoc.

Query

Response

Arguments - Data Type

contact

Returns a Contact type

id - ID!

Example:

query contact($id: ID!) { 
contact(id: $id) { id title status firstName lastName fullName email phones {
...PhoneFragment
}
address {
...AddressFragment
}
numbers {
...PatientNumberFragment
}
medicalSpecialty company createdAt updatedAt
}
}

Contact Data

This query is for fetching external contact data from Heydoc.

Query

Response

Arguments - Data Type

contacts

Returns a ContactData type

search - String

pagination - Pagination

options - QueryOptions

Example:

query contacts($search: String, $pagination: Pagination, $options: QueryOptions) { 
contacts(search: $search, pagination: $pagination,
options: $options) {
data {
...ContactFragment
} pageInfo {
...PageInfoFragment
}
}
}

Invoice

This query is for fetching the ID of a specific existing invoice from Heydoc.

Query

Response

Arguments - Data Type

invoice

Returns an Invoice type

id - ID!

Example:

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
}
}

Invoice Data

This query is for fetching invoice data from Heydoc.

Query

Response

Arguments - Data Type

invoices

Returns an InvoiceData type

dateRange - DateRange!

pagination - Pagination

options - QueryOptions

Example:

query invoices($dateRange: DateRange!, $pagination: Pagination, $options: QueryOptions) { 
invoices(dateRange: $dateRange, pagination: $pagination, options: $options) {
data {
...InvoiceFragment
}
pageInfo {
...PageInfoFragment
}
}
}

Lab

This query is for fetching the ID of a specific lab request from Heydoc.

Query

Response

Arguments - Data Type

lab

Returns a Lab type

id - ID!

Example:

query lab($id: ID!) { 
lab(id: $id) {
id status patient {
...PatientFragment
}
doctor {
...UserFragment
}
requestDate sampleDate fasting orderNumber parsedResults resultsReceivedAt testList createdAt updatedAt
}
}

Lab Data

This query is for fetching lab result data from Heydoc.

Query

Response

Arguments - Data Type

labs

Returns a LabData type

dateRange - DateRange!

pagination - Pagination

options - LabQueryOptions

Example:

query labs($dateRange: DateRange!, $pagination: Pagination, $options: LabQueryOptions) { 
labs(dateRange: $dateRange, pagination: $pagination, options: $options) {
data {
...LabFragment
}
pageInfo {
...PageInfoFragment
}
}
}

Label Data

This query is for fetching label data from Heydoc.

Query

Response

Arguments - Data Type

labels

Returns a LabelData type

pagination - Pagination

Example:

query labels($pagination: Pagination) {
labels(pagination: $pagination) {
data {
...LabelFragment
}
pageInfo {
...PageInfoFragment
}
}
}

Letter

This query is for fetching the ID of an existing letter from Heydoc.

Query

Response

Arguments - Data Type

letter

Returns a Letter type

id - ID!

Example:

query letter($id: ID!) { 
letter(id: $id) {
id deleted reviewStatus patient {
...PatientFragment
}
doctor {
...UserFragment
} date title body contact {
...LetterContactFragment
} createdAt updatedAt
}
}

Letter Data

This query is for fetching letter data from Heydoc.

Query

Response

Arguments - Data Type

letters

Returns a LetterData type

dateRange - DateRange!

pagination - Pagination

options - QueryOptions

Example:

query letters($dateRange: DateRange!, $pagination: Pagination, $options: QueryOptions) {
letters(dateRange: $dateRange, pagination: $pagination, options: $options) {
data {
...LetterFragment
}
pageInfo {
...PageInfoFragment
}
}
}

Patient

This query is for fetching the ID of a specific patient from Heydoc.

Query

Response

Arguments - Data Type

patient

Returns a Patient type

id - ID!

Example:

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
}
bookings {
...BookingFragment
}
invoices {
...InvoiceFragment
}
letters {
...LetterFragment
}
labs {
...LabFragment
}
labels {
...PatientLabelFragment
}
prescriptions {
...PrescriptionDataFragment
}
records {
...RecordDataFragment
} createdAt updatedAt accessGroups {
...PatientAccessGroupFragment
}
}
}

Patient Data

This query is for fetching patient data from Heydoc.

Query

Response

Arguments - Data Type

patients

Returns a PatientData type

search - String

pagination - Pagination

options - QueryOptions

Example:

query patients($search: String, $pagination: Pagination, $options: QueryOptions) { 
patients(search: $search, pagination: $pagination, options: $options) {
data {
...PatientFragment
}
pageInfo {
...PageInfoFragment
}
}
}

Patient Document

This query is for fetching the ID of a specific patient document from Heydoc.

Query

Response

Arguments - Data Type

patientDocument

Returns a PatientDocument type

id - ID!

Example:

query patientDocument($id: ID!) { 
patientDocument(id: $id) {
id title patientId patient {
...PatientFragment
} path name type url parent deleted dateCreated dateModified uploadUrl
}
}

Patient Document Data

This query is for fetching patient document data from Heydoc.

Query

Response

Arguments - Data Type

patientDocuments

Returns a PatientDocumentData type

search - String

pagination - Pagination

options - QueryOptions

Example:

query patientDocuments($search: String, $pagination: Pagination, $options: QueryOptions) { 
patientDocuments(search: $search, pagination: $pagination, options: $options) {
data {
...PatientDocumentFragment
} pageInfo {
...PageInfoFragment
}
}
}

Practice

This query is for fetching the locations and rooms that a practice has.

Query

Response

Arguments - Data Type

practice

Returns a Practice! type

id - ID!

Example:

query practice { 
practice {
id locations {
...PracticeLocationFragment
}
appointmentTypes {
...AppointmentTypeFragment
}
paymentTypes {
...PracticePaymentTypeFragment
}
accessGroups {
...PracticeAccessGroupsFragment
}
practiceNumbers {
...PracticeNumbersFragment
}
}
}

Practice Template Document

This query is for fetching the ID of a particular practice template document from Heydoc.

Query

Response

Arguments - Data Type

practiceTemplateDocument

Returns a PracticeTemplateDocument type

id - ID!

Example:

query practiceTemplateDocument($id: ID!) {
practiceTemplateDocument(id: $id) {
id patientId path name type url deleted dateCreated dateModified uploadUrl downloadUrl
}
}

Practice Template Document Data

This query is for fetching practice template document data from Heydoc.

Query

Response

Arguments - Data Type

practiceTemplateDocuments

Returns a PracticeTemplateDocumentData type

search - String

pagination - Pagination

options - QueryOptions

Example:

query practiceTemplateDocuments($search: String, $pagination: Pagination, $options: QueryOptions) {
practiceTemplateDocuments(search: $search, pagination: $pagination, options: $options) {
data {
...PracticeTemplateDocumentFragment
}
pageInfo {
...PageInfoFragment
}
}
}

Prescription

This query is for fetching the ID of a specific prescription from Heydoc.

Query

Response

Arguments - Data Type

prescription

Returns a Prescription type

id - ID!

Example:

query prescription($id: ID!) { 
prescription(id: $id) {
patient {
...PatientFragment
}
doctor {
...UserFragment
} date status drugs {
...PrescriptionDrugFragment
}
}
}

Prescription Data

This query is for fetching prescription data from Heydoc.

Query

Response

Arguments - Data Type

prescriptions

Returns a PrescriptionData type

dateRange - DateRange!

pagination - Pagination

options - QueryOptions

Example:

query prescriptions($dateRange: DateRange, $pagination: Pagination, $options: QueryOptions) { 
prescriptions(dateRange: $dateRange, pagination: $pagination, options: $options) {
data {
...PrescriptionFragment
}
pageInfo {
...PageInfoFragment
}
}
}

Product

This query is for fetching the ID of a specific product from Heydoc.

Query

Response

Arguments - Data Type

product

Returns a Product type

id - ID!

Example:

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
}
}

Product Data

This query is for fetching product data from Heydoc.

Query

Response

Arguments - Data Type

products

Returns a ProductData type

search - String

pagination - Pagination

options - QueryOptions

Example:

query products($search: String, $pagination: Pagination, $options: QueryOptions) { 
products(search: $search, pagination: $pagination, options: $options) {
data {
...ProductFragment
}
pageInfo {
...PageInfoFragment
}
}
}

Record

This query is for fetching the ID of a specific record from Heydoc.

Query

Response

Arguments - Data Type

record

Returns a Record type

id - ID!

Example:

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
}
}

Record Data

This query is for fetching record data from Heydoc.

Query

Response

Arguments - Data Type

records

Returns a RecordData type

dateRange - DateRange!

pagination - Pagination

options - QueryOptions

Example:

query records($dateRange: DateRange, $pagination: Pagination, $options: QueryOptions) { 
records(dateRange: $dateRange, pagination: $pagination, options: $options) {
data {
...RecordFragment
}
pageInfo {
...PageInfoFragment
}
}
}

User

This query is for fetching the ID of a specific use from Heydoc.

Query

Response

Arguments - Data Type

user

Returns a User type

id - ID!

Example:

query user($id: ID!) { 
user(id: $id) {
id firstName lastName email fullName isDoctor accessGroups {
...UserAccessGroupFragment
}
bookings {
...BookingDataFragment
}
letters {
...LetterDataFragment
}
}
}

User Data

This query is for fetching user data from Heydoc.

Query

Response

Arguments - Data Type

users

Returns a UserData type

pagination - Pagination

Example:

query users($pagination: Pagination) { 
users(pagination: $pagination) {
data {
...UserFragment
}
pageInfo {
...PageInfoFragment
}
}
}
Did this answer your question?