openapi: 3.0.3 info: title: Definition API version: latest x-status: STABLE x-spec: definition contact: name: Specifications Editorial Committee openEHR url: https://specifications.openehr.org/ email: info@openehr.org license: name: Creative Commons Attribution-NoDerivs 3.0 Unported url: https://creativecommons.org/licenses/by-nd/3.0/ description: | ## Description ### Purpose This specification describes service endpoints, resources and operations as well as details of requests and responses that interact with the openEHR Definition API in a RESTful manner. ### Related Documents Prerequisite documents for reading this document include: - The [Operational Template 2](https://specifications.openehr.org/releases/AM/latest/OPT2.html) - The [Archetype Query Language (AQL)](https://specifications.openehr.org/releases/QUERY/latest/AQL.html) Related documents include: - The [openEHR Architecture Overview](https://specifications.openehr.org/releases/BASE/latest/architecture_overview.html) - The [Archetype Technology Overview](https://specifications.openehr.org/releases/AM/latest/Overview.html) - The [openEHR Global Class Index](https://specifications.openehr.org/classes) - The [XML-Schemas (XSD)](https://specifications.openehr.org/releases/ITS-XML/latest) - The [JSON-Schemas](https://specifications.openehr.org/releases/ITS-JSON/latest) and [Simplified Formats](simplified_formats.html) ### Status This specification is in the `STABLE` state, and can be downloaded as [OpenAPI specification](https://spec.openapis.org/oas/v3.0.3) file (in YAML format) [for validation](computable/OAS/definition-validation.openapi.yaml), or [for code generators](computable/OAS/definition-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 . servers: - url: https://{baseUrl}/v1 description: An example openEHR server URL. variables: baseUrl: default: openEHRSys.example.com description: The (example) server base URL prefix providing openEHR services. This may contain server name, port and base path prefix. security: [] tags: - name: ADL1.4 x-displayName: ADL1.4 TEMPLATE description: | Management of [AOM and ADL 1.4](https://specifications.openehr.org/releases/AM/latest) Operational Templates (OPTs). These templates can be created using [modelling tools](https://www.openehr.org/downloads/modellingtools) such as the Template Designer and the Archetype Designer. Operational templates simplify the creation of openEHR-based input or storage implementations by, for a specific COMPOSITION template (use case), collecting all labels, requirements and constraints from all contained archetypes and sub-templates into a single easily parsed file. This file can be a basis for UI-generation/creation and for data validation. - name: ADL2 x-displayName: ADL2 TEMPLATE description: | Management of [AOM2](https://specifications.openehr.org/releases/AM/latest/AOM2.html#_templates) templates. See also [ADL2 Template specifications](https://specifications.openehr.org/releases/AM/latest/ADL2.html#_templates). - name: Query x-displayName: Stored Query description: | Management of stored (registered) queries in the system, including creation of new versions and retrieval by qualified name and version. These endpoints enable registration and lifecycle management of reusable queries available for later execution. Stored queries are identified by their [qualified name and version](query.html#tag/Qualified_query_name). They can be executed using the [query endpoint](query.html#tag/Query/operation/query_execute_stored_query_body). - name: TemplateList_schema x-displayName: Template list description: | This resource represents the list of `Template` meta-information associated with uploaded templates, including identifiers, names, versions and related attributes that help clients discover available templates. - name: Template_schema x-displayName: Template description: | The following resources are formally specified in the [Archetype Model](https://specifications.openehr.org/releases/AM/latest) as AOM/ADL 1.4 Operational Templates (OPTs) and as [AOM2 templates](https://specifications.openehr.org/releases/AM/latest/AOM2.html#_templates).
The AOM/ADL 1.4 `OPERATIONAL_TEMPLATE` resource: The AOM/ADL 2 `OPERATIONAL_TEMPLATE` resource: The `WebTemplate` alternative resource: - name: StoredQuery_schema x-displayName: Stored Query description: | This resource represents the definition of a stored query, including its qualified name, versioning and parameter declarations. Stored queries provide a reusable, immutable way to identify a specific AQL statement that can be executed later. paths: /definition/template/adl1.4: post: operationId: definition_template_adl1.4_upload summary: Upload a template description: | Upload a new ADL 1.4 operational template (OPT). tags: - ADL1.4 parameters: - $ref: '#/components/parameters/Prefer' - $ref: '#/components/parameters/Accept_Template' - name: Content-Type in: header style: simple schema: type: string enum: - application/xml requestBody: description: '' content: application/xml: schema: oneOf: - $ref: '#/components/schemas/OperationalTemplate' example: |-