# Error While posting composition

**URL:** https://discourse.openehr.org/t/error-while-posting-composition/1852
**Category:** Apps
**Tags:** aql, archetype, template, ehrbase
**Created:** [8 September 2021 08:09 UTC](https://discourse.openehr.org/t/error-while-posting-composition/1852 "2021-09-08T08:09:11Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Yash](https://discourse.openehr.org/user_avatar/discourse.openehr.org/yash/32/1308_2.png) [@Yash](https://discourse.openehr.org/u/Yash)
#### Post date: [8 September 2021 08:09 UTC](https://discourse.openehr.org/t/error-while-posting-composition/1852/1 "2021-09-08T08:09:11Z")

</div>

![image](https://discourse.openehr.org/uploads/default/original/2X/3/336ec0adf43fcc070eb7554d3b81f60744a93fc7.png)  
I am receiving this error while posting the composiiton to ehrbase server

I have posted the template first , created a blank ehr with ehr ID from OPT and I put the same EHR ID in the params while posting

---

<div class="post-metadata">

### Author: ![Yash](https://discourse.openehr.org/user_avatar/discourse.openehr.org/yash/32/1308_2.png) [@Yash](https://discourse.openehr.org/u/Yash)
#### Post date: [8 September 2021 08:13 UTC](https://discourse.openehr.org/t/error-while-posting-composition/1852/2 "2021-09-08T08:13:52Z")

</div>

1. error: “org.ehrbase.validation.constraints.wrappers.ValidationException: :-Validation error at /content[openEHR-EHR-SECTION.adhoc.v1]/items[openEHR-EHR-SECTION.adhoc.v1]/items[openEHR-EHR-OBSERVATION.pulse\_oximetry.v1]/data[at0001]/events[at0002]/data[at0003]/items[at0006]:Validation error at /content[openEHR-EHR-SECTION.adhoc.v1]/items[openEHR-EHR-SECTION.adhoc.v1]/items[openEHR-EHR-OBSERVATION.pulse\_oximetry.v1]/data[at0001]/events[at0002]/data[at0003]/items[at0006], ELT02:Validation error at /content[openEHR-EHR-SECTION.adhoc.v1]/items[openEHR-EHR-SECTION.adhoc.v1]/items[openEHR-EHR-OBSERVATION.pulse\_oximetry.v1]/data[at0001]/events[at0002]/data[at0003]/items[at0006], ELT01:Validation error at /content[openEHR-EHR-SECTION.adhoc.v1]/items[openEHR-EHR-SECTION.adhoc.v1]/items[openEHR-EHR-OBSERVATION.pulse\_oximetry.v1]/data[at0001]/events[at0002]/data[at0003]/items[at0006], Validation error at /content[openEHR-EHR-SECTION.adhoc.v1]/items[openEHR-EHR-SECTION.adhoc.v1]/items[openEHR-EHR-OBSERVATION.pulse\_oximetry.v1]/data[at0001]/events[at0002]/data[at0003]/items[at0006], ELT01:Validation error at /content[openEHR-EHR-SECTION.adhoc.v1]/items[openEHR-EHR-SECTION.adhoc.v1]/items[openEHR-EHR-OBSERVATION.pulse\_oximetry.v1]/data[at0001]/events[at0002]/data[at0003]/items[at0006], value is not within interval, expected:0.0 \<= 12312.0 \<= 100.0.\n\n”
2. status: “Internal Server Error”

Network Error

---

<div class="post-metadata">

### Author: ![ian.mcnicoll](https://discourse.openehr.org/user_avatar/discourse.openehr.org/ian.mcnicoll/32/4430_2.png) [@ian.mcnicoll](https://discourse.openehr.org/u/ian.mcnicoll)
#### Post date: [8 September 2021 11:37 UTC](https://discourse.openehr.org/t/error-while-posting-composition/1852/3 "2021-09-08T11:37:22Z")

</div>

Looks like you are sending a pulse oximetry value of 12312.0 when the archetype constrains this to between 0 and 100

---

<div class="post-metadata">

### Author: ![thomas.beale](https://discourse.openehr.org/user_avatar/discourse.openehr.org/thomas.beale/32/35_2.png) [@thomas.beale](https://discourse.openehr.org/u/thomas.beale)
#### Post date: [8 September 2021 16:17 UTC](https://discourse.openehr.org/t/error-while-posting-composition/1852/5 "2021-09-08T16:17:03Z")

</div>

Errors a bit painful to read, but it does seem like a simple limit violation…

> [@Yash](#):
>
> error:
> 
> ```auto
> org.ehrbase.validation.constraints.wrappers.ValidationException: :-
> 
> Validation error at /content[openEHR-EHR-SECTION.adhoc.v1]/items[openEHR-EHR-SECTION.adhoc.v1]/items[openEHR-EHR-OBSERVATION.pulse_oximetry.v1]/data[at0001]/events[at0002]/data[at0003]/items[at0006]:
> 
> Validation error at /content[openEHR-EHR-SECTION.adhoc.v1]/items[openEHR-EHR-SECTION.adhoc.v1]/items[openEHR-EHR-OBSERVATION.pulse_oximetry.v1]/data[at0001]/events[at0002]/data[at0003]/items[at0006], ELT02:
> 
> Validation error at /content[openEHR-EHR-SECTION.adhoc.v1]/items[openEHR-EHR-SECTION.adhoc.v1]/items[openEHR-EHR-OBSERVATION.pulse_oximetry.v1]/data[at0001]/events[at0002]/data[at0003]/items[at0006], ELT01:
> 
> Validation error at /content[openEHR-EHR-SECTION.adhoc.v1]/items[openEHR-EHR-SECTION.adhoc.v1]/items[openEHR-EHR-OBSERVATION.pulse_oximetry.v1]/data[at0001]/events[at0002]/data[at0003]/items[at0006], 
> 
> Validation error at /content[openEHR-EHR-SECTION.adhoc.v1]/items[openEHR-EHR-SECTION.adhoc.v1]/items[openEHR-EHR-OBSERVATION.pulse_oximetry.v1]/data[at0001]/events[at0002]/data[at0003]/items[at0006], ELT01:
> 
> Validation error at /content[openEHR-EHR-SECTION.adhoc.v1]/items[openEHR-EHR-SECTION.adhoc.v1]/items[openEHR-EHR-OBSERVATION.pulse_oximetry.v1]/data[at0001]/events[at0002]/data[at0003]/items[at0006], value is not within interval, expected:0.0 <= 12312.0 <= 100.0.
> 
> ```

```auto

```

---

<div class="post-metadata">

### Author: ![ian.mcnicoll](https://discourse.openehr.org/user_avatar/discourse.openehr.org/ian.mcnicoll/32/4430_2.png) [@ian.mcnicoll](https://discourse.openehr.org/u/ian.mcnicoll)
#### Post date: [8 September 2021 17:14 UTC](https://discourse.openehr.org/t/error-while-posting-composition/1852/6 "2021-09-08T17:14:58Z")

</div>

@Yash Can you post both the composition instance and the template you are using - ? maybe as a Gist which works pretty well.

---

<div class="post-metadata">

### Author: ![Yash](https://discourse.openehr.org/user_avatar/discourse.openehr.org/yash/32/1308_2.png) [@Yash](https://discourse.openehr.org/u/Yash)
#### Post date: [8 September 2021 18:41 UTC](https://discourse.openehr.org/t/error-while-posting-composition/1852/7 "2021-09-08T18:41:07Z")

</div>

The problem was not with the form or the server but with the script i used to automatiically fill the fields for testing

Thank You for your help

---

<div class="post-metadata">

### Author: ![ian.mcnicoll](https://discourse.openehr.org/user_avatar/discourse.openehr.org/ian.mcnicoll/32/4430_2.png) [@ian.mcnicoll](https://discourse.openehr.org/u/ian.mcnicoll)
#### Post date: [8 September 2021 19:01 UTC](https://discourse.openehr.org/t/error-while-posting-composition/1852/8 "2021-09-08T19:01:12Z")

</div>

Glad you figured it out!! We’ve all been there - in my case roughly every 2 weeks ☹
