General Description

Warning

WIP (Work In Progress)

The Flat format offers a simplified representation of an openEHR Composition. Data is represented as a map of human readable paths to values.

{
 "ctx/language": "de",
 "ctx/territory": "US",
 "ctx/time": "2021-04-01T12:40:31.418954+02:00",
 "ctx/composer_name": "Silvia Blake",
 "conformance-ehrbase.de.v0/context/start_time": "2021-12-21T14:19:31.649613+01:00",
 "conformance-ehrbase.de.v0/context/setting|code": "238",
 "conformance-ehrbase.de.v0/context/setting|value": "other care",
 "conformance-ehrbase.de.v0/context/setting|terminology": "openehr",
 "conformance-ehrbase.de.v0/conformance_section/conformance_observation/any_event:0/dv_quantity|magnitude": 65.9,
 "conformance-ehrbase.de.v0/conformance_section/conformance_observation/any_event:0/dv_quantity|unit": "unit"
 }

Web-Template

The Flat format is based on a simplified representation of a template, the so called Web-Template.

To get one from a template, call the get Web-template Endpoint.

{
   GET http://localhost:8080/ehrbase/rest/ecis/v1/template/{templateId}
}

Or alternatively export from Archetype Designer (https://tools.openehr.org/) by selecting “Export Web Template” in the export button dropdown.

The result will look something like this:

 1 {
 2  "templateId": "conformance-ehrbase.de.v0",
 3  "semVer": "1.0.0",
 4  "version": "2.3",
 5  "defaultLanguage": "en",
 6  "languages": [
 7    "en"
 8  ],
 9  "tree": {
10    "id": "conformance-ehrbase.de.v0",
11    "name": "conformance-ehrbase.de.v0",
12    "localizedName": "conformance-ehrbase.de.v0",
13    "rmType": "COMPOSITION",
14    "nodeId": "openEHR-EHR-COMPOSITION.conformance_composition_.v0",
15    "min": 1,
16    "max": 1,
17    "aqlPath": "",
18    "children": [
19      {
20        "id": "conformance_section",
21        "name": "conformance section",
22        "localizedName": "conformance section",
23        "rmType": "SECTION",
24        "nodeId": "openEHR-EHR-SECTION.conformance_section.v0",
25        "min": 0,
26        "max": 1,
27        "aqlPath": "/content[openEHR-EHR-SECTION.conformance_section.v0]",
28        "children": [
29          {
30            "id": "conformance_observation",
31            "name": "Conformance Observation",
32            "localizedName": "Conformance Observation",
33            "rmType": "OBSERVATION",
34            "nodeId": "openEHR-EHR-OBSERVATION.conformance_observation.v0",
35            "min": 0,
36            "max": 1,
37            "aqlPath": "/content[openEHR-EHR-SECTION.conformance_section.v0]/items[openEHR-EHR-OBSERVATION.conformance_observation.v0]",
38            "children": [
39              {
40                "id": "any_event",
41                "name": "Any event",
42                "localizedName": "Any event",
43                "rmType": "EVENT",
44                "nodeId": "at0002",
45                "min": 0,
46                "max": -1,
47                "aqlPath": "/content[openEHR-EHR-SECTION.conformance_section.v0]/items[openEHR-EHR-OBSERVATION.conformance_observation.v0]/data[at0001]/events[at0002]",
48                "children": [
49                  {
50                    "id": "dv_quantity",
51                    "name": "DV_QUANTITY",
52                    "localizedName": "DV_QUANTITY",
53                    "rmType": "DV_QUANTITY",
54                    "nodeId": "at0008",
55                    "min": 0,
56                    "max": 1,
57                    "aqlPath": "/content[openEHR-EHR-SECTION.conformance_section.v0]/items[openEHR-EHR-OBSERVATION.conformance_observation.v0]/data[at0001]/events[at0002]/data[at0003]/items[at0008]/value",
58                    "inputs": [
59                      {
60                        "suffix": "magnitude",
61                        "type": "DECIMAL"
62                      },
63                      {
64                        "suffix": "unit",
65                        "type": "CODED_TEXT"
66                      }
67                    ]
68                  }
69                ]
70              }
71            ]
72          }
73        ]
74      }
75    ]
76  }
77 }

Flat Path

To build a Flat Path:

  • concatenate the content from the id fields from the Web-Template hierarchy together

  • if an element is multi-valued, add an index to the path, e.g. :0

  • once at a data value leaf node, use “|” to select the appropriate attribute

{
 "conformance-ehrbase.de.v0/conformance_section/conformance_observation/any_event:0/dv_quantity|magnitude": 65.9,
 "conformance-ehrbase.de.v0/conformance_section/conformance_observation/any_event:0/dv_quantity|unit": "unit"
 }

RM-Attributes

Some attributes are not defined by the template, but by the Reference Model. If those are optional they are not part of the Web-Template and are selected by “_attributeName”

{
 "conformance-ehrbase.de.v0/conformance_section/conformance_observation/any_event:0/dv_quantity|magnitude": 65.9,
 "conformance-ehrbase.de.v0/conformance_section/conformance_observation/any_event:0/dv_quantity|unit": "unit",
 "conformance-ehrbase.de.v0/conformance_section/conformance_observation/any_event:0/dv_quantity/_normal_range/lower|magnitude": 20.5,
 "conformance-ehrbase.de.v0/conformance_section/conformance_observation/any_event:0/dv_quantity/_normal_range/lower|unit": "unit",
 "conformance-ehrbase.de.v0/conformance_section/conformance_observation/any_event:0/dv_quantity/_normal_range/upper|magnitude": 66.6,
 "conformance-ehrbase.de.v0/conformance_section/conformance_observation/any_event:0/dv_quantity/_normal_range/upper|unit": "unit"
 }

See RM-Mappings for details.

Context

To simplify the input, the flat formate offers the option to set context values, which set default values in the rm-tree.

{
 "ctx/language": "de",
 "ctx/territory": "US",
 "ctx/time": "2021-04-01T12:40:31.418954+02:00",
 "ctx/composer_name": "Silvia Blake"
 }

See Context Information for details.