Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

...

Archie can serialize RM Objects to XML using the standard openEHR RM XSD, or it can be used to serialize to JSON. The format we have now is very similar that the one Marand uses: snake_cased attribute names, type names as the same notation as the RM specs. Our EHR is still in the prototype phase, so the format is still subject to change, and no results from AQL queries yet.

The code to configure Jackson (XML serialization library) to serialize to /from this exact format is not yet or parse it to RM Objects is present in Archie starting from version 0.2.1

Code Block
languagejs
 "data" : {
      "type@type" : "HISTORY",
      "name" : {
        "type@type" : "DV_TEXT",
        "value" : "history"
      },
      "archetype_node_id" : "id2",
      "events" : [ {
        "type@type" : "POINT_EVENT",
        "name" : {
          "type@type" : "DV_TEXT",
          "value" : "any event"
        },
        "archetype_node_id" : "id7",
        "time" : {
          "type@type" : "DV_DATE_TIME",
          "magnitude" : 1466427403,
          "value" : "2016-06-20T14:56:43.702+02:00"
        },    
		"data" : {
          "type@type" : "ITEM_TREE",
          "name" : {
            "type" : "DV_TEXT"
          },
          "archetype_node_id" : "id4",
          "items" : [ {
            "type@type" : "ELEMENT",
            "name" : {
              "type@type" : "DV_TEXT",
              "value" : "Systolic"
            },
            "archetype_node_id" : "id5",
            "value" : {
              "type@type" : "DV_QUANTITY",
              "magnitude" : 120.0,
              "precision" : 0,
              "units" : "mm[Hg]"
            },
            "path" : "/data[id2]/event[id7]/data[id4]/item[id5]"
          }, {
            "type@type" : "ELEMENT",
            "name" : {
              "type@type" : "DV_TEXT",
              "value" : "Diastolic"
            },
            "archetype_node_id" : "id6",
            "value" : {
              "type@type" : "DV_QUANTITY",
              "magnitude" : 80.0,
              "precision" : 0,
              "units" : "mm[Hg]"
            },
            "path" : "/data[id2]/event[id7]/data[id4]/item[id6]"
          },







...

Code Block
languagejs
firstline1
titlenot grouped
[
  {
    "archetypeId": "openEHR-EHR-OBSERVATION.blood_pressure.v1",
    "archetypePath": "/data[at0001]/events[at0006]/data[at0003]/items[at0004at0005]/value": {
    "type": "DV_QUANTITY",
    "namemagnitude": "Sistólica"69,
    "serieowner": [
      {
      "uid":  "magnitude123123123-...":
140,    },
    "unitspath": "mm[Hg]",
        "date": "2016-04-23 03:12:20"
      },
      {
        "magnitude": 121,
        "units": "mm[Hg]",
        "date": "2016-04-30 06:58:05"
      },
      {
        "magnitude": 180,
        "units": "mm[Hg]",
        "date": "2016-05-02 21:45:26"
      },
      {
        "magnitude": 107,
        "units": "mm[Hg]",
        "date": "2016-05-23 22:52:34"
      }
    ]
  },
  "openEHR-EHR-OBSERVATION.blood_pressure.v1/data[at0001]/events[at0006]/data[at0003]/items[at0005]/value": {
    "type": "DV_QUANTITY",
    "name": "Diastólica",
    "serie": [
      {
        "magnitude": 76,
        "units": "mm[Hg]",
        "date": "2016-04-23 03:12:20"
      },
      {
        "magnitude": 54,
        "units": "mm[Hg]",
        "date": "2016-04-30 06:58:05"
      },
      {
        "magnitude": 92,
        "units": "mm[Hg]",
        "date": "2016-05-02 21:45:26"
      },
      {
        "magnitude": 69,
        "units": "mm[Hg]",
        "date": "2016-05-23 22:52:34"
      }
    ]
  },
  "openEHR-EHR-OBSERVATION.body_temperature.v1/data[at0002]/events[at0003]/data[at0001]/items[at0004]/value": {
    "type": "DV_QUANTITY",
    "name": "Temperature",
    "serie": [
      {
        "magnitude": 36,
        "units": "°C",
        "date": "2016-04-23 03:12:20"
      },
      {
        "magnitude": 39,
        "units": "°C",
        "date": "2016-04-30 06:58:05"
      },
      {
        "magnitude": 39,
        "units": "°C",
        "date": "2016-05-02 21:45:26"
      },
      {
        "magnitude": 38,
        "units": "°C",
        "date": "2016-05-23 22:52:34"
      }
    ]
  },
  "openEHR-EHR-OBSERVATION.body_weight.v1/data[at0002]/events[at0003]/data[at0001]/items[at0004]/value": {
    "type": "DV_QUANTITY",
    "name": "Peso",
    "serie": [
      {
        "magnitude": 81,
        "units": "kg",
        "date": "2016-04-23 03:12:20"
      },
      {
        "magnitude": 75,
        "units": "kg",
        "date": "2016-04-30 06:58:05"
      },
      {
        "magnitude": 48,
        "units": "kg",
        "date": "2016-05-02 21:45:26"
      },
      {
        "magnitude": 44,
        "units": "kg",
        "date": "2016-05-23 22:52:34"
      }
    ]
  },
  "openEHR-EHR-OBSERVATION.respiration.v1/data[at0001]/events[at0002]/data[at0003]/items[at0004]/value": {
    "type": "DV_QUANTITY",
    "name": "Rate",
    "serie": [
      {
        "magnitude": 50,
        "units": "/min",
        "date": "2016-04-23 03:12:20"
      },
      {
        "magnitude": 41,
        "units": "/min",
        "date": "2016-04-30 06:58:05"
      },
      {
        "magnitude": 66,
        "units": "/min",
        "date": "2016-05-02 21:45:26"
      },
      {
        "magnitude": 61,
        "units": "/min",
        "date": "2016-05-23 22:52:34"
      }
    ]
  },
  "openEHR-EHR-OBSERVATION.pulse.v1/data[at0002]/events[at0003]/data[at0001]/items[at0004]/value": {
    "type": "DV_QUANTITY",
    "name": "Frecuencia",
    "serie": [
      {
        "magnitude": 91,
        "units": "/min",
        "date": "2016-04-23 03:12:20"
      },
      {
        "magnitude": 47,
        "units": "/min",
        "date": "2016-04-30 06:58:05"
      },
      {
   /content[archetype_id=openEHR-EHR-OBSERVATION.blood_pressure.v1]/data[at0001]/events[at0006]/data[at0003]/items[at0005]/value",
    "templateId": "Signos",
    "units": "mm[Hg]"
  },
  {
    "archetypeId": "openEHR-EHR-OBSERVATION.blood_pressure.v1",
    "archetypePath": "/data[at0001]/events[at0006]/data[at0003]/items[at0004]/value",
    "magnitude": 107,
    "owner": {
      "uid": "123123123-..."
    },
    "path": "/content[archetype_id=openEHR-EHR-OBSERVATION.blood_pressure.v1]/data[at0001]/events[at0006]/data[at0003]/items[at0004]/value",
    "templateId": "Signos",
    "units": "mm[Hg]"
  },
  {
    "archetypeId": "openEHR-EHR-OBSERVATION.body_temperature.v1",
    "archetypePath": "/data[at0002]/events[at0003]/data[at0001]/items[at0004]/value",
    "magnitude": 6538,
   
    "unitsowner": "/min",
 {
      "dateuid": "2016-05-02 21:45:26123123123-..."
      },
      {
   
    "magnitudepath": 42"/content[archetype_id=openEHR-EHR-OBSERVATION.body_temperature.v1]/data[at0002]/events[at0003]/data[at0001]/items[at0004]/value",
        "unitstemplateId": "/minSignos",
   
    "dateunits": "2016-05-23 22:52:34"
 °C"
    },
  ...
 ]
  }
}

 

 

Code Block
languagejs
firstline1
titlegrouped by path
{
  "openEHR-EHR-OBSERVATION.blood_pressure.v1/data[at0001]/events[at0006]/data[at0003]/items[at0004]/value": {
    "type": "DV_QUANTITY",
    "name": "Sistólica",
    "serie": [
      {
        "magnitude": 140,
        "units": "mm[Hg]",
        "date": "2016-04-23 03:12:20"
      },
      {
        "magnitude": 121,
        "units": "mm[Hg]",
        "date": "2016-04-30 06:58:05"
      },
      {
        "magnitude": 180,
        "units": "mm[Hg]",
        "date": "2016-05-02 21:45:26"
      },
      {
        "magnitude": 107,
        "units": "mm[Hg]",
        "date": "2016-05-23 22:52:34"
      }
    ]
  },
  "openEHR-EHR-OBSERVATION.blood_pressure.v1/data[at0001]/events[at0006]/data[at0003]/items[at0005]/value": {
    "type": "DV_QUANTITY",
    "name": "Diastólica",
    "serie": [
      {
        "magnitude": 76,
        "units": "mm[Hg]",
        "date": "2016-04-23 03:12:20"
      },
      {
        "magnitude": 54,
        "units": "mm[Hg]",
        "date": "2016-04-30 06:58:05"
      },
      {
        "magnitude": 92,
        "units": "mm[Hg]",
        "date": "2016-05-02 21:45:26"
      },
      {
        "magnitude": 69,
        "units": "mm[Hg]",
        "date": "2016-05-23 22:52:34"
      }
    ]
  },
  "openEHR-EHR-OBSERVATION.body_temperature.v1/data[at0002]/events[at0003]/data[at0001]/items[at0004]/value": {
    "type": "DV_QUANTITY",
    "name": "Temperature",
    "serie": [
      {
        "magnitude": 36,
        "units": "°C",
        "date": "2016-04-23 03:12:20"
      },
      {
        "magnitude": 39,
        "units": "°C",
        "date": "2016-04-30 06:58:05"
      },
      {
        "magnitude": 39,
        "units": "°C",
        "date": "2016-05-02 21:45:26"
      },
      {
        "magnitude": 38,
        "units": "°C",
        "date": "2016-05-23 22:52:34"
      }
    ]
  },
  "openEHR-EHR-OBSERVATION.body_weight.v1/data[at0002]/events[at0003]/data[at0001]/items[at0004]/value": {
    "type": "DV_QUANTITY",
    "name": "Peso",
    "serie": [
      {
        "magnitude": 81,
        "units": "kg",
        "date": "2016-04-23 03:12:20"
      },
      {
        "magnitude": 75,
        "units": "kg",
        "date": "2016-04-30 06:58:05"
      },
      {
        "magnitude": 48,
        "units": "kg",
        "date": "2016-05-02 21:45:26"
      },
      {
        "magnitude": 44,
        "units": "kg",
        "date": "2016-05-23 22:52:34"
      }
    ]
  },
  "openEHR-EHR-OBSERVATION.respiration.v1/data[at0001]/events[at0002]/data[at0003]/items[at0004]/value": {
    "type": "DV_QUANTITY",
    "name": "Rate",
    "serie": [
      {
        "magnitude": 50,
        "units": "/min",
        "date": "2016-04-23 03:12:20"
      },
      {
        "magnitude": 41,
        "units": "/min",
        "date": "2016-04-30 06:58:05"
      },
      {
        "magnitude": 66,
        "units": "/min",
        "date": "2016-05-02 21:45:26"
      },
      {
        "magnitude": 61,
        "units": "/min",
        "date": "2016-05-23 22:52:34"
      }
    ]
  },
  "openEHR-EHR-OBSERVATION.pulse.v1/data[at0002]/events[at0003]/data[at0001]/items[at0004]/value": {
    "type": "DV_QUANTITY",
    "name": "Frecuencia",
    "serie": [
      {
        "magnitude": 91,
        "units": "/min",
        "date": "2016-04-23 03:12:20"
      },
      {
        "magnitude": 47,
        "units": "/min",
        "date": "2016-04-30 06:58:05"
      },
      {
        "magnitude": 65,
        "units": "/min",
        "date": "2016-05-02 21:45:26"
      },
      {
        "magnitude": 42,
        "units": "/min",
        "date": "2016-05-23 22:52:34"
      }
    ]
  }
}

...