Resources (latest)

Description

Purpose

This specification describes openEHR API resources.

Prerequisite documents for reading this document include:

Related documents include:

Status

This specification is in the STABLE state, and can be downloaded as OpenAPI specification file (in YAML format) for validation, or for code generators. 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 https://specifications.openehr.org/releases/ITS-REST/latest/resources.html.

EHR

This resource is formally specified in Reference Model as the EHR class.

object (HIER_OBJECT_ID)
object (HIER_OBJECT_ID)
object (OBJECT_REF)
object (OBJECT_REF)
object (DV_DATE_TIME)
{
  • "system_id": {
    },
  • "ehr_id": {
    },
  • "ehr_status": {
    },
  • "ehr_access": {
    },
  • "time_created": {
    }
}

EHR_STATUS

The following resources are formally specified in the Reference Model as EHR_STATUS and VERSIONED_EHR_STATUS classes.

The EHR_STATUS resource:

required
any (DV_TEXT)
archetype_node_id
required
string
any (UID_BASED_ID)
Array of objects (LINK)
object (ARCHETYPED)
object (FEEDER_AUDIT)
_type
string
Default: "EHR_STATUS"
required
any (PARTY_PROXY)
is_queryable
required
boolean
Default: true
is_modifiable
required
boolean
Default: true
other_details
object (ITEM_STRUCTURE)
{
  • "archetype_node_id": "openEHR-EHR-EHR_STATUS.generic.v1",
  • "name": {
    },
  • "uid": {
    },
  • "subject": {
    },
  • "is_queryable": true,
  • "is_modifiable": true
}

The VERSIONED_EHR_STATUS resource:

_type
string
Default: "VERSIONED_EHR_STATUS"
required
object (HIER_OBJECT_ID)
required
object (OBJECT_REF)
required
object (DV_DATE_TIME)
{
  • "uid": {
    },
  • "owner_id": {
    },
  • "time_created": {
    }
}

COMPOSITION

The following resources are formally specified in the Reference Model as COMPOSITION and VERSIONED_COMPOSITION classes.

The COMPOSITION resource:

required
any (DV_TEXT)
archetype_node_id
required
string
any (UID_BASED_ID)
Array of objects (LINK)
object (ARCHETYPED)
object (FEEDER_AUDIT)
_type
string
Default: "COMPOSITION"
required
object (CODE_PHRASE)
required
object (CODE_PHRASE)
required
object (DV_CODED_TEXT)
required
object (EVENT_CONTEXT)
required
any (PARTY_PROXY)
content
required
Array of objects (CONTENT_ITEM)
{
  • "archetype_node_id": "openEHR-EHR-COMPOSITION.encounter.v1",
  • "name": {
    },
  • "uid": {
    },
  • "archetype_details": {
    },
  • "language": {
    },
  • "territory": {
    },
  • "category": {
    },
  • "composer": {
    },
  • "context": {
    },
  • "content": [ ]
}

The abstract CONTENT_ITEM class, used in COMPOSITION:

required
any (DV_TEXT)
archetype_node_id
required
string
any (UID_BASED_ID)
Array of objects (LINK)
object (ARCHETYPED)
object (FEEDER_AUDIT)
required
object (CODE_PHRASE)
required
object (CODE_PHRASE)
Array of objects (PARTICIPATION)
object (OBJECT_REF)
required
any (PARTY_PROXY)
any (PARTY_PROXY)
_type
required
string
data
required
object (ITEM_STRUCTURE)
Example
{
  • "name": {
    },
  • "archetype_node_id": "string",
  • "uid": {
    },
  • "links": [
    ],
  • "archetype_details": {
    },
  • "feeder_audit": {
    },
  • "language": {
    },
  • "encoding": {
    },
  • "other_participations": [
    ],
  • "workflow_id": {
    },
  • "subject": {
    },
  • "provider": {
    },
  • "_type": "ADMIN_ENTRY",
  • "data": { }
}

The abstract ITEM_STRUCTURE class, used in CONTENT_ITEM:

required
any (DV_TEXT)
archetype_node_id
required
string
any (UID_BASED_ID)
Array of objects (LINK)
object (ARCHETYPED)
object (FEEDER_AUDIT)
_type
string
Default: "ITEM_SINGLE"
required
object (ELEMENT)
Example
{
  • "name": {
    },
  • "archetype_node_id": "string",
  • "uid": {
    },
  • "links": [
    ],
  • "archetype_details": {
    },
  • "feeder_audit": {
    },
  • "_type": "ITEM_SINGLE",
  • "item": {
    }
}

The VERSIONED_COMPOSITION resource:

_type
string
Default: "VERSIONED_COMPOSITION"
required
object (HIER_OBJECT_ID)
required
object (OBJECT_REF)
required
object (DV_DATE_TIME)
{
  • "uid": {
    },
  • "owner_id": {
    },
  • "time_created": {
    }
}

DIRECTORY

This resource is formally specified in Reference Model in the directory section, using FOLDER class.

required
any (DV_TEXT)
archetype_node_id
required
string
any (UID_BASED_ID)
Array of objects (LINK)
object (ARCHETYPED)
object (FEEDER_AUDIT)
_type
string
Default: "FOLDER"
Array of objects (OBJECT_REF)
folders
Array of objects (FOLDER)
details
object (ITEM_STRUCTURE)
{
  • "archetype_node_id": "openEHR-EHR-FOLDER.directory.v1",
  • "name": {
    },
  • "uid": {
    },
  • "items": [ ],
  • "folders": [ ]
}

CONTRIBUTION

The following resources are formally specified in the Reference Model as the CONTRIBUTION class.

A new CONTRIBUTION to be committed:

object (HIER_OBJECT_ID)
required
Array of objects (UPDATE_VERSION)
required
object (UPDATE_AUDIT)

The set of attributes required to document the committal of an information item to a repository. Used by the server to create an AUDIT_DETAILS object.

{
  • "uid": {
    },
  • "versions": [
    ],
  • "audit": {
    }
}

A retrieved CONTRIBUTION:

required
object (HIER_OBJECT_ID)
required
Array of objects (OBJECT_REF)
required
object (AUDIT_DETAILS)

The set of attributes required to document the committal of an information item to a repository.

{
  • "uid": {
    },
  • "versions": [
    ],
  • "audit": {
    }
}

Query Execute

The following resources are formally specified in the Archetype Query Language (AQL) and in the Query Service.

The AdhocQueryExecute resource:

q
required
string (AQL)

The given AQL query.

offset
integer <int32> (Offset)
Default: 0

The row number in result-set to start result-set from (0-based), default is 0.

fetch
integer <int32> (Fetch)

Number of rows to fetch (the default depends on the implementation).

object (QueryParameters)

A set of query parameters.

{
  • "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",
  • "offset": 10,
  • "fetch": 10,
  • "query_parameters": {
    }
}

The stored-query execute, known as the Query resource:

offset
required
integer <int32> (Offset)
Default: 0

The row number in result-set to start result-set from (0-based), default is 0.

fetch
required
integer <int32> (Fetch)

Number of rows to fetch (the default depends on the implementation).

required
object (QueryParameters)

A set of query parameters.

{
  • "offset": 10,
  • "fetch": 10,
  • "query_parameters": {
    }
}

RESULT_SET

This resource is formally specified in the Service Model as Query Result.

object (ResultSetMetadata)

RESULT_SET metadata.

name
string (QueryName)

The (fully qualified) name of the query (when is registered as a stored query), in a format of [{namespace}::]{query-name}. The namespace prefix is optional, and when used it should be in a form of a reverse domain name.

q
string (AQL)

The given AQL query.

Array of objects (RESULT_SET_COLUMN)

A set of AQL column specifications, defined in the given AQL.

rows
required
Array of any (RESULT_SET_ROW) [ items ]

An ordered set of RESULT_SET rows.

{
  • "meta": {
    },
  • "name": "org.openehr::compositions",
  • "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",
  • "columns": [
    ],
  • "rows": [
    ]
}

Template list

This resource represents the list of Template meta-information associated with uploaded templates - see also Service Model - Definition Package.

Array
template_id
required
string
version
string
concept
required
string
archetype_id
required
string
created_timestamp
required
string
[
  • {
    }
]

Template

The following resources are formally specified in the Archetype Model as AOM/ADL 1.4 Operational Templates (OPTs) and as AOM2 templates.

The AOM/ADL 1.4 OPERATIONAL_TEMPLATE resource:

object (OPERATIONAL_TEMPLATE)
{ }

The AOM/ADL 2 OPERATIONAL_TEMPLATE resource:

object (OPERATIONAL_TEMPLATE_V2)
{ }

The WebTemplate alternative resource:

templateId
required
string
version
required
string
defaultLanguage
required
string
languages
required
Array of strings
required
object (Tree)
{
  • "templateId": "string",
  • "version": "string",
  • "defaultLanguage": "string",
  • "languages": [
    ],
  • "tree": {
    }
}

Stored Query

This resource represents the definition of a stored Query and is formally specified in the Service Model as Registered Queries.

name
required
string (QueryName)

The (fully qualified) name of the query (when is registered as a stored query), in a format of [{namespace}::]{query-name}. The namespace prefix is optional, and when used it should be in a form of a reverse domain name.

type
required
string (QueryType)
Default: "AQL"

Query formalism type.

version
required
string (QueryVersion)

The SEMVER version number of the Stored Query.

saved
required
string <date-time>
q
required
string (AQL)

The given AQL query.

{
  • "name": "org.openehr::compositions",
  • "type": "aql",
  • "version": "1.0.1",
  • "saved": "2017-07-16T19:20:30.450+01:00",
  • "q": "SELECT c FROM EHR e[ehr_id/value=$ehr_id] CONTAINS COMPOSITION c[$compositionid] WHERE c/name/value = 'Vitals'"
}