Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Twitter


In this Discussion

El fin de este foro es dar soporte gratuito y comercial a los distintos productos y servicios de El soporte gratuito se brinda en los foros de acceso público y no tiene garantía de tiempo mínimo de respuesta. El soporte comercial se brinda en foros privados donde se garantiza una respuesta dentro de las 24 horas.

Composition commit

edited October 2017 in EHRServer
I create composition with $ opt source.opt . 1

when I send POST request to
curl -H 'Content-type: application/xml; Authorization: Bearer ...' -d @openEHR-EHR-COMPOSITION.common_examination.v1_20171009114038_1.xml -X POST ''

I'm getting mysql error com.mysql.jdbc.MysqlDataTruncationMessageData truncation: Data too long for column 'params_elt' at row 1

I've done
mysql> alter table commit_params modify params_elt VARCHAR(20844);
so now I can see request in this column.

I now i've got 402.1 error
< message >versions should have one or more items and has none< /message >
< code >EHR_SERVER::API::RESPONSE_CODES::402.1< /code >
How properly create composition with 'versions' tag?

thanks in advance,


  • edited October 2017
    It seems the XML is being send as a parameter, not in the request body, because the error on the table is because the Commit saves the requests params and those should be < 255 in length (format, auditSystemId, auditCommitter).

    The other error is telling me the XML is not on the body. The body of the request should be <versions ...">
    <version xsi:type="ORIGINAL_VERSION">

    That is mentioned on the guide for the commit endpoint. and there is a sample XML.

    Also the new Insomnia script has an example, check the /api folder of the EHRServer project in the master branch.

    This curl is generated from Insomnia:

    curl --request POST \
      --url ' House, MD.&amp;auditSystemId=my.emr' \
      --header 'authorization: Bearer eyJhb...fD2zb33z4=' \
      --header 'content-type: application/xml' \
      --cookie JSESSIONID=88090161A4DE67885AC6F7AD6E7C026B \
      --data '<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    <versions xmlns="" xmlns:xsi="">
    <version xsi:type="ORIGINAL_VERSION">
        <id xsi:type="HIER_OBJECT_ID">
        <committer xsi:type="PARTY_IDENTIFIED">
          <name>Dr. Pablo Pazos</name>
      <data xsi:type="COMPOSITION" archetype_node_id="openEHR-EHR-COMPOSITION.test_all_datatypes.v1">
       <content xsi:type="OBSERVATION" archetype_node_id="openEHR-EHR-OBSERVATION.test_all_datatypes.v1">
            <value>Blood Pressure</value>
          <subject xsi:type="PARTY_SELF"/>
          <data xsi:type="HISTORY" archetype_node_id="at0001">
            <events xsi:type="POINT_EVENT" archetype_node_id="at0002">
                <value>any event</value>
              <data xsi:type="ITEM_TREE" archetype_node_id="at0003">
                <items xsi:type="ELEMENT" archetype_node_id="at0011">
                  <value xsi:type="DV_COUNT">

  • vigvig
    edited October 2017
    Is it possible to properly create composition (XML) with 'versions' tag with opt script?
    how do you make composition with 'versions' tag?
  • The goal of openEHR-OPT is to generate valid versions and compositions, not commits to the EHRServer, but that can be added easily since it is just one extra tag. What I do is adding the versions tag manually while testing, this requires just a couple of seconds to do.
  • Thanks, Pablo!
  • In the future we might change that to commit multiple "version" as multi-part, need to test that, but that change won't be on the next release.
Sign In or Register to comment.