El fin de este foro es dar soporte gratuito y comercial a los distintos productos y servicios de CaboLabs.com. 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.
Comments
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 'http://192.168.1.105:8090/ehr/api/v1/ehrs/11111111-1111-1111-1111-111111111111/compositions?auditCommitter=Gregory House, MD.&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="http://schemas.openehr.org/v1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<version xsi:type="ORIGINAL_VERSION">
<contribution>
<id xsi:type="HIER_OBJECT_ID">
<value>893f9cf3-fb32-4f12-a11c-c148b450db82</value>
</id>
<namespace>EHR::COMMON</namespace>
<type>CONTRIBUTION</type>
</contribution>
<commit_audit>
<system_id>CABOLABS_EHR</system_id>
<committer xsi:type="PARTY_IDENTIFIED">
<name>Dr. Pablo Pazos</name>
</committer>
<time_committed>
<value>2017-10-12T23:18:24.953Z</value>
</time_committed>
<change_type>
<value>creation</value>
<defining_code>
<terminology_id>
<value>openehr</value>
</terminology_id>
<code_string>249</code_string>
</defining_code>
</change_type>
</commit_audit>
<uid>
<value>bbdfea95-794d-4e3b-96dd-fcbbb5250f35::EMR_APP::1</value>
</uid>
<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">
<name>
<value>Blood Pressure</value>
</name>
<language>
<terminology_id>
<value>ISO_639-1</value>
</terminology_id>
<code_string>es</code_string>
</language>
<encoding>
<terminology_id>
<value>UNICODE</value>
</terminology_id>
<code_string>UTF-8</code_string>
</encoding>
<subject xsi:type="PARTY_SELF"/>
<data xsi:type="HISTORY" archetype_node_id="at0001">
<name>
<value>history</value>
</name>
<origin>
<value>2017-10-12T23:18:24.954Z</value>
</origin>
<events xsi:type="POINT_EVENT" archetype_node_id="at0002">
<name>
<value>any event</value>
</name>
<time><value>2017-10-12T23:18:24.954Z</value></time>
<data xsi:type="ITEM_TREE" archetype_node_id="at0003">
<name>
<value>Arbol</value>
</name>
<items xsi:type="ELEMENT" archetype_node_id="at0011">
<name>
<value>Count</value>
</name>
<value xsi:type="DV_COUNT">
<magnitude>3</magnitude>
</value>
</items>
</data>
</events>
</data>
</content>
</data>
<lifecycle_state>
<value>completed</value>
<defining_code>
<terminology_id>
<value>openehr</value>
</terminology_id>
<code_string>532</code_string>
</defining_code>
</lifecycle_state>
</version>
</versions>'
how do you make composition with 'versions' tag?