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 |
|
| Returns a |
|
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 |
|
| Returns an |
|
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 |
|
| Returns a |
|
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 |
|
| Returns a |
|
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 |
|
| Returns a |
|
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 |
|
invoice | Returns an |
|
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 |
|
| Returns an |
|
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 |
|
| Returns a |
|
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 |
|
| Returns a |
|
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 |
|
| Returns a |
|
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 |
|
| Returns a |
|
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 |
|
| Returns a |
|
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 |
|
| Returns a |
|
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 |
|
| Returns a |
|
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 |
|
| Returns a |
|
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 |
|
| Returns a |
|
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 |
|
| Returns a | |
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 |
|
| Returns a |
|
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 |
|
| Returns a |
|
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 |
|
| Returns a |
|
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 |
|
| Returns a |
|
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 |
|
| Returns a |
|
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 |
|
| Returns a |
|
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 |
|
| Returns a |
|
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 |
|
| Returns a |
|
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 |
|
| Returns a |
|
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 |
|
| Returns a |
|
Example:
query users($pagination: Pagination) {
users(pagination: $pagination) {
data {
...UserFragment
}
pageInfo {
...PageInfoFragment
}
}
}