Download OpenAPI specification:Download
This document outlines the API endpoints available to integrators using Halo Connect's Cloud APIs. It includes endpoints for the SQL Passthrough and FHIR API products, plus meta endpoints for fetching information about sites.
This API reference is defined using the OpenAPI Specification.
You can find out more about Halo Connect on our website and blog.
For in-depth documentation and guides, see our main docs. The following is only a quick reference guide.
Retrieve the list of Halo GUIDs for Halo Connect sites that match all of the supplied query parameters. This endpoint allows integrators to exchange a known PMS ID (e.g. Best Practice Site ID) for the corresponding Halo GUID which can then be used to query the site.
practiceManagementSiteId required | string Filters by the PMS Site Id. |
practiceManagementName required | string (PracticeManagementName) Enum: "Best Practice" "Zedmed" "D4w" Filters by the name of the Practice Management Software used by the site. |
{- "sites": [
- {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "pmsType": "BestPractice",
- "availability": "online",
- "status": "initialising",
- "haloLinkVersion": "22.1207.209",
- "enrichedAt": "2019-08-24T14:15:22Z",
- "catalogue": [
- {
- "name": "Patients",
- "isDefault": true
}
], - "practiceMetadata": {
- "pmsType": "BestPractice",
- "practiceName": "Halo Clinic South",
- "practiceManagementSiteId": "12345",
- "practiceManagementVersion": "3.4.1"
}, - "name": "Halo Clinic",
- "practiceManagementSiteId": "string",
- "practiceManagementName": "Best Practice",
- "practiceManagementVersion": "3.4.1",
- "createdAt": "2019-08-24T14:15:22Z",
- "authoritative": true,
- "clientTimestampUTC": "2022-12-25T12:25:01Z",
- "heartbeatTimestampUTC": "2022-12-25T12:25:01Z"
}
]
}
Check the status of a site using its Halo GUID.
siteId required | string Halo GUID of the site. |
{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "pmsType": "BestPractice",
- "availability": "online",
- "status": "initialising",
- "haloLinkVersion": "22.1207.209",
- "enrichedAt": "2019-08-24T14:15:22Z",
- "catalogue": [
- {
- "name": "Patients",
- "isDefault": true
}
], - "practiceMetadata": {
- "pmsType": "BestPractice",
- "practiceName": "Halo Clinic South",
- "practiceManagementSiteId": "12345",
- "practiceManagementVersion": "3.4.1"
}, - "name": "Halo Clinic",
- "practiceManagementSiteId": "string",
- "practiceManagementName": "Best Practice",
- "practiceManagementVersion": "3.4.1",
- "createdAt": "2019-08-24T14:15:22Z",
- "authoritative": true,
- "clientTimestampUTC": "2022-12-25T12:25:01Z",
- "heartbeatTimestampUTC": "2022-12-25T12:25:01Z"
}
Send SQL queries to practices as either immediate or async queries.
Immediate queries are small, time-sensitive queries that return a result in seconds. Response size is limited to 1MB.
Async queries get queued for execution, and integrators can retrieve the results later. Async queries have three endpoints:
This resource allows you to send an immediate query to a site, and receive a result or error in the POST response. The site to be queried is specified by its Halo GUID.
You can also get the status of an immediate query using the GET Query status endpoint listed under Async queries.
siteId required | string Halo GUID of the site. |
maxTimeInQueue | number <milli-seconds> (ImmediateMaxTimeInQueue) [ 0 .. 60000 ] Default: 30000 |
required | object (Command) |
catalogue | string (Catalogue) Indicates which database to run against. If no catalogue is specified a default catalogue will be chosen instead. Currently only supported for Zedmed, if querying other PMS select the database in the query itself. Database catalogues can be identified from a site's database.name property and are consistent across all sites of a single PMS type. |
{- "maxTimeInQueue": 15000,
- "command": {
- "text": "GetPatientID",
- "executionMode": "reader",
- "type": "text",
- "parameters": [
- {
- "name": "@siteid",
- "direction": "output",
- "type": "BigInt",
- "value": "66",
- "size": 43
}
]
}, - "catalogue": "Patients"
}
{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "integratorId": "1acd5efb-e960-4c96-8a84-ca37f187f58b",
- "siteId": "60189e9c-7d12-438c-b9ca-6998d9c364b1",
- "mode": "immediate",
- "maxTimeInQueue": 15000,
- "sqlQuerySize": 46,
- "commandSize": 98,
- "requestSize": 98,
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z",
- "status": "successful",
- "statusTiming": {
- "initialising": {
- "startTime": "2019-08-24T14:15:22Z"
}, - "executing": {
- "startTime": "2019-08-24T14:15:22Z"
}, - "downloading": {
- "startTime": "2019-08-24T14:15:22Z"
}, - "uploading": {
- "startTime": "2019-08-24T14:15:22Z"
}
}, - "metrics": {
- "sqlExecutionDuration": 1000
}, - "result": {
- "rows": 30,
- "size": 25,
- "data": "e2lkIjogNDIsaW5mbyI6IHsgIm5hbWUiOiAiSmFuZSIsICJzdXJuYW1lIjogIlNtaXRoIiB9LGRvYiI6ICIzMDIyLTExLTA0VDEyOjAwOjAwfQ==",
- "parameters": [
- {
- "name": "@siteid",
- "direction": "output",
- "type": "BigInt",
- "value": "66",
- "size": 43
}
]
}, - "resultSize": 98,
- "completedAt": "2019-08-24T14:15:22Z"
}
This resource allows you to send an async query to a site to be queued for execution. The site to be queried is specified by its Halo GUID.
siteId required | string Halo GUID of the site. |
maxTimeInQueue | number <milli-seconds> (AsyncMaxTimeInQueue) [ 0 .. 7200000 ] Default: 3600000 |
required | object (Command) |
catalogue | string (Catalogue) Indicates which database to run against. If no catalogue is specified a default catalogue will be chosen instead. Currently only supported for Zedmed, if querying other PMS select the database in the query itself. Database catalogues can be identified from a site's database.name property and are consistent across all sites of a single PMS type. |
{- "maxTimeInQueue": 900000,
- "command": {
- "text": "GetPatientID",
- "executionMode": "reader",
- "type": "text",
- "parameters": [
- {
- "name": "@siteid",
- "direction": "output",
- "type": "BigInt",
- "value": "66",
- "size": 43
}
]
}, - "catalogue": "Patients"
}
{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "integratorId": "1acd5efb-e960-4c96-8a84-ca37f187f58b",
- "siteId": "60189e9c-7d12-438c-b9ca-6998d9c364b1",
- "mode": "async",
- "status": "initialising",
- "maxTimeInQueue": 900000,
- "sqlQuerySize": 46,
- "commandSize": 98,
- "requestSize": 98,
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z",
- "statusTiming": {
- "initialising": {
- "startTime": "2019-08-24T14:15:22Z"
}
}
}
Check the status of a query.
The same endpoint is used for both immediate and async queries, though it returns a different response with successful async queries returning a "results" object which includes pagination details for GET Result Page.
Also be aware immediate queries retrieved using this endpoint will not include a results object indicating pages since it is returned with the initial request unlike async queries.
siteId required | string Halo GUID of the site. |
queryId required | string Id of the query. |
{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "integratorId": "1acd5efb-e960-4c96-8a84-ca37f187f58b",
- "siteId": "60189e9c-7d12-438c-b9ca-6998d9c364b1",
- "mode": "async",
- "status": "successful",
- "maxTimeInQueue": 900000,
- "sqlQuerySize": 46,
- "commandSize": 98,
- "requestSize": 98,
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z",
- "statusTiming": {
- "initialising": {
- "startTime": "2019-08-24T14:15:22Z",
- "endTime": "2019-08-24T14:15:22Z"
}, - "queued": {
- "startTime": "2019-08-24T14:15:22Z",
- "endTime": "2019-08-24T14:15:22Z"
}, - "executing": {
- "startTime": "2019-08-24T14:15:22Z",
- "endTime": "2019-08-24T14:15:22Z"
}, - "uploading": {
- "startTime": "2019-08-24T14:15:22Z"
}
}, - "metrics": {
- "sqlExecutionDuration": 1000
}, - "result": {
- "rows": 30,
- "size": 25,
- "pages": [
- {
- "pageNumber": 1,
- "status": "queued",
- "size": 0,
- "rows": {
- "count": 10,
- "rangeStart": 1,
- "rangeEnd": 11
}
}
]
}, - "resultSize": 98,
- "completedAt": "2019-08-24T14:15:22Z"
}
Get a result page from a successful async query.
siteId required | string Halo GUID of the site. |
queryId required | string Id of the query. |
pageNumber required | number >= 1 Page number of the results for a query. |
{- "data": "e2lkIjogNDIsaW5mbyI6IHsgIm5hbWUiOiAiSmFuZSIsICJzdXJuYW1lIjogIlNtaXRoIiB9LGRvYiI6ICIzMDIyLTExLTA0VDEyOjAwOjAwfQ==",
- "parameters": [
- {
- "name": "@siteid",
- "direction": "output",
- "type": "BigInt",
- "value": "66",
- "size": 43
}
]
}
This endpoint allows you to send a FHIR query to a site, and receive a result or error in the REST response. The site to be queried is specified by its Halo GUID.
See the FHIR API docs for more information about how to use the FHIR API and what it supports.
Resource names and search parameters should be included as fhirParameters
. For example: sites/{siteId}/fhir/R4/Patient?given=John
siteId required | string Halo GUID of the site. |
fhirParameters required | string Resource names and search parameters per the R4 FHIR specification for using RESTful APIs and search. |
{- "application/json": {
- "resourceType": "Patient",
- "id": "1",
- "name": [
- {
- "use": "official",
- "text": "Mr John Smith",
- "family": "Smith",
- "given": [
- "John"
], - "prefix": [
- "Mr"
]
}
]
}
}
This resource allows you to send a FHIR query to a site, and receive a result or error in the REST response. The site to be queried is specified by its Halo GUID.
See the FHIR API docs for more information about how to use the FHIR API and what it supports.
Search parameters should be included in the body of the request. Using POST is recommended for sensitive and complex queries, particularly those that include PII. Putting the parameters in the request body increases security and reliability, and the length limitations of a GET request URL do not apply.
Errors may be a HTTP error or a FHIR OperationOutcome, depending on whether the error occurred in the FHIR engine or elsewhere.
siteId required | string Halo GUID of the site. |
resource required | string The name of the FHIR resource to search for. |
FHIR search parameters.
property name* additional property | any |
given:exact=John&birthdate=gt1900-01-01&_sort=birthdate
{- "application/json": {
- "resourceType": "Bundle",
- "type": "searchset",
- "total": 0
}
}
List all registered queries that are currently active and queued for execution.
siteId required | string Halo GUID of the site. |
{- "queries": [
- {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "name": "string",
- "status": "initialisationFailedCacheError",
- "frequency": 300,
- "duration": 43200,
- "lastHash": "string",
- "errorDetails": {
- "errorType": "http",
- "errorCode": 0,
- "errorMessage": "string"
}, - "metrics": {
- "lastSucceededAt": "string",
- "lastFailedAt": "string",
- "lastExecutionDuration": 0,
- "executionSucceededCount": 0,
- "executionFailedCount": 0,
- "resultSizeSum": 0,
- "requestSize": 0
}, - "createdAt": "2019-08-24T14:15:22Z",
- "completedAt": "2019-08-24T14:15:22Z"
}
]
}
Create a registered query to be queued for execution.
siteId required | string Halo GUID of the site. |
name required | string Customer set identifier for this registered query. |
registeredQueryType required | string Value: "query" |
frequency required | number Seconds between each query execution. |
duration required | number Duration in seconds the query will run for. Up to 86400 seconds (24 hours). |
required | object Command to be executed by the registered query. |
{- "name": "string",
- "registeredQueryType": "query",
- "frequency": 300,
- "duration": 43200,
- "registerCommand": {
- "command": {
- "text": "GetPatientID",
- "executionMode": "reader",
- "type": "text",
- "parameters": [
- {
- "name": "@siteid",
- "direction": "output",
- "type": "BigInt",
- "value": "66",
- "size": 43
}
]
}
}
}
{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "name": "string",
- "status": "initialisationFailedCacheError",
- "frequency": 300,
- "duration": 43200,
- "lastHash": "string",
- "errorDetails": {
- "errorType": "http",
- "errorCode": 0,
- "errorMessage": "string"
}, - "metrics": {
- "lastSucceededAt": "string",
- "lastFailedAt": "string",
- "lastExecutionDuration": 0,
- "executionSucceededCount": 0,
- "executionFailedCount": 0,
- "resultSizeSum": 0,
- "requestSize": 0
}, - "createdAt": "2019-08-24T14:15:22Z",
- "completedAt": "2019-08-24T14:15:22Z"
}
Get the details of a registered query.
siteId required | string Halo GUID of the site. |
queryId required | string Id of the query. |
{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "name": "string",
- "status": "initialisationFailedCacheError",
- "frequency": 300,
- "duration": 43200,
- "lastHash": "string",
- "errorDetails": {
- "errorType": "http",
- "errorCode": 0,
- "errorMessage": "string"
}, - "metrics": {
- "lastSucceededAt": "string",
- "lastFailedAt": "string",
- "lastExecutionDuration": 0,
- "executionSucceededCount": 0,
- "executionFailedCount": 0,
- "resultSizeSum": 0,
- "requestSize": 0
}, - "createdAt": "2019-08-24T14:15:22Z",
- "completedAt": "2019-08-24T14:15:22Z"
}
Cancel a registered query that is currently queued for execution.
siteId required | string Halo GUID of the site. |
queryId required | string Id of the query. |
{- "status": 400,
- "statusText": "Bad Request",
- "message": "Malformed SQL"
}
Get the result of a registered query that has completed execution.
siteId required | string Halo GUID of the site. |
queryId required | string Id of the query. |
{- "data": "e2lkIjogNDIsaW5mbyI6IHsgIm5hbWUiOiAiSmFuZSIsICJzdXJuYW1lIjogIlNtaXRoIiB9LGRvYiI6ICIzMDIyLTExLTA0VDEyOjAwOjAwfQ==",
- "parameters": [
- {
- "name": "@siteid",
- "direction": "output",
- "type": "BigInt",
- "value": "66",
- "size": 43
}
], - "rows": 12,
- "size": 25
}