Querying Resources
This page outlines best practices for querying resources efficiently and effectively using the Halaxy API
Basic Query Parameters
All resources include the following filters and query parameters to fetch the desired subset of data required.
Parameter | Usage | Examples |
---|---|---|
_id | Search by ID or IDs | Search a single ID
Search multiple IDs at once
|
_lastUpdated | Search by most recent time of modification | Find all patients updated on a single day Find all patients updated after a certain date Find all patients between a date range |
_summary | Return a subset of the resource | Must contain one of the following values:
Sample format: |
_total | Return the total number of resources that match the search parameters | Only Tip: Adding |
_include | Return one or more related resources in the return bundle | Include the patient resource with the appointment |
iterate | Return a related resource to an included resource | Return the practitioner resource with the included practitioner role resource from the appointment search |
_sort | Return the resource in a specific order | Sort patient names in ascending order Sort patient names in descending order Applies to string, number, integer, date, or date-time values |
Common Query Parameter Types
String
Parameter | Usage | Description |
---|---|---|
[base]/Patient?given=eve | Search start of a string | Any patients with a name containing a given part with "eve" at the start of the name. This would include patients with the given name "Eve", "Evelyn". |
[base]/Patient?given:contains=eve | Search part of a string | Any patients with a name with a given part containing "eve" at any position. This would include patients with the given name "Eve", "Evelyn", and also "Severine". |
[base]/Patient?given:exact=Eve | Search exact string | Any patients with a name with a given part that is exactly "Eve". This would not include patients with the given name "eve" or "EVE". |
Number
Parameter | Usage |
---|---|
[parameter]=100 | Search values that equal 100 to 3 significant figures precision. This includes the range [99.5 ... 100.5) |
[parameter]=100.00 | Search values that equal 100 to 5 significant figures precision. The includes the range [99.995 ... 100.005) |
[parameter]=1e2 | Search values that equal 100 to 1 significant figures precision. The includes the range [95 ... 105) |
[parameter]=lt100 | Search values that are less than exactly 100 |
[parameter]=le100 | Search values that are less or equal to exactly 100 |
[parameter]=gt100 | Search values that are greater than exactly 100 |
[parameter]=ge100 | Search values that are greater or equal to exactly 100 |
[parameter]=ne100 | Search values that are not equal to 100 |
Date/ Date Time
Parameter | Usage | Examples |
---|---|---|
| Return records that fall within the specified date |
|
| Return records that are outside of the specified date |
|
| Return records that are older than the specified date |
|
| Return records that are newer than the specified date |
|
| Return records from the specified date and onwards |
|
| Return records from the specified date and earlier |
|
References
Parameter | Description | Examples |
---|---|---|
| The logical [id] of a resource using a local reference (i.e. a relative reference) | Find patients managed by Practitioner with a specific ID
|
| The logical [id] of a resource of a specified type using a local reference (i.e. a relative reference), for when the reference can point to different types of resources (e.g. Observation.subject Note: Some resources (such asPractitioner, PractitionerRole or Organization) may require a prefix to the ID. | Find patients managed by either one of the practitioners
Find patients that are managed by both practitioners
|
| Where the [url] is an absolute URL - a reference to a resource by its absolute location, or by it's canonical URL | Find patients are managed by a specific practitioner
|
Token
Parameter | Description |
---|---|
| The value of Find all patients where status is active
|
Pagination Parameters
Parameter | Type | Description |
---|---|---|
page |
| The page number of the search results to return |
_count |
| The number of results to return on a single page, not including resources added from include statements |
pagination |
| Defines whether to disable pagination for the route |
Updated about 1 month ago