openEHR Query API
Description Purpose This specification describes the service endpoints and data-models used when querying an openEHR system. The [Archetype Query Language…
Fork copies the collection into your workspace, without the publisher's secrets, so you can add your own key and send requests. Star saves it to your starred APIs (Account › Marketplace) and helps others find it.
Overview
Description
Purpose
This specification describes the service endpoints and data-models used when querying an openEHR system.
The Archetype Query Language (AQL) is the primary query language.
Related Documents
Prerequisite documents for reading this document include:
Related documents include:
- The openEHR Architecture Overview
- The openEHR Global Class Index
- The XML-Schemas (XSD)
- The JSON-Schemas and [Simplified Formats](simplified_formats.html)
Status
This specification is in the STABLE state, and can be downloaded as OpenAPI specification file (in YAML format) [for validation](computable/OAS/query-validation.openapi.yaml), or [for code generators](computable/OAS/query-codegen.openapi.yaml).
Users are encouraged to comment on and/or advise on these paragraphs as well as the main content.
The development version of this document can be found at .
Endpoints 6
Query
- GETExecute ad-hoc AQL
/query/aql?q=SELECT e/ehr_id/value, c/context/start_time/value as startTime, obs/data[at0001]/events[at0006]/data[at0003]/items[at0004]/value/magnitude AS systolic, c/uid/value AS cid, c/name FROM EHR e CONTAINS COMPOSITION c[openEHR-EHR-COMPOSITION.encounter.v1] CONTAINS OBSERVATION obs[openEHR-EHR-OBSERVATION.blood_pressure.v1] WHERE obs/data[at0001]/events[at0006]/data[at0003]/items[at0004]/value/magnitude >= $systolic_bpExecute a given ad-hoc AQL query, supplied by q parameter, fetching fetch numbers of rows from offset and passing query_parameters to the underlying query… - POSTExecute ad-hoc AQL (POST)
/query/aqlExecute a given ad-hoc AQL query, supplied by q attribute, fetching fetch numbers of rows from offset and passing query_parameters to the underlying query… - GETExecute stored AQL
/query/:qualified_query_nameExecute a stored query, identified by the supplied qualified_query_name (at latest version), fetching fetch numbers of rows from offset and passing… - POSTExecute stored AQL (POST)
/query/:qualified_query_nameExecute a stored query, identified by the supplied qualified_query_name (at latest version). See also details on usage of query parameters. Queries can be… - GETExecute stored AQL version
/query/:qualified_query_name/:versionExecute a stored query, identified by the supplied qualified_query_name (at specified version), fetching fetch numbers of rows from offset and passing… - POSTExecute stored AQL version (POST)
/query/:qualified_query_name/:versionExecute a stored query, identified by the supplied qualified_query_name (at specified version). See also details on usage of query parameters. Queries can be…
API details
- Base URL
https://{baseUrl}/v1- Authentication
- None declared in the description
- Operations
- 6 operations on 3 pathsGET 3POST 3
- Main resources
- Query 6
- Description format
- OpenAPI 3.0.3, API version
latest - Links
- OpenAPI document · Support
- Listed from
- openEHR's published OpenAPI description (openEHR/specifications-ITS-REST) (Apache-2.0)
How to test the openEHR Query API in Swastik Codes
- Open the APISelect “Fork & run in Swastik Codes” on this page. Sign in or create a free account if asked.
- Fork it into your workspaceChoose a workspace. You get your own copy of the openEHR Query API collection, without the publisher's secrets.
- Add your credentialsOpen the collection's variables or an environment and enter your API key or token, if the API needs one.
- Send a requestPick an endpoint, for example “Execute ad-hoc AQL” (GET /query/aql?q=SELECT e/ehr_id/value, c/context/start_time/value as startTime, obs/data[at0001]/events[at0006]/data[at0003]/items[at0004]/value/magnitude AS systolic, c/uid/value AS cid, c/name FROM EHR e CONTAINS COMPOSITION c[openEHR-EHR-COMPOSITION.encounter.v1] CONTAINS OBSERVATION obs[openEHR-EHR-OBSERVATION.blood_pressure.v1] WHERE obs/data[at0001]/events[at0006]/data[at0003]/items[at0004]/value/magnitude >= $systolic_bp), and press Send. Check the response, add tests and run the whole collection with the runner.
Frequently asked questions
What is the openEHR Query API?
Description Purpose This specification describes the service endpoints and data-models used when querying an openEHR system. The [Archetype Query Language… It is listed under Healthcare and has 6 endpoints.
Who publishes the openEHR Query API?
It is listed from openEHR's public API description (an OpenAPI document), not published by openEHR on Swastik Codes. Anyone who controls openehr.org can claim the profile by adding a DNS TXT record.
What is the base URL of the openEHR Query API?
Requests go to https://{baseUrl}/v1. Endpoint paths are added to this base URL.
How do I authenticate with the openEHR Query API?
Its OpenAPI description does not declare an authentication scheme. Some endpoints may be open; check the provider's documentation before relying on that.
How many endpoints does the openEHR Query API have?
6 operations on 3 paths (3 GET, 3 POST). The largest groups are Query.
Is forking the openEHR Query API free?
Yes. Forking copies the collection into your workspace for free. It has been starred 0 times and forked 0 times.