# FLAT example of a DV\_INTERVAL\<DV\_COUNT\>

**URL:** <https://discourse.openehr.org/t/flat-example-of-a-dv-interval-dv-count/6324>\
**Category:** Platform\
**Created:** [12 February 2025 12:04 UTC](https://discourse.openehr.org/t/flat-example-of-a-dv-interval-dv-count/6324 "2025-02-12T12:04:04Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![surfer](https://discourse.openehr.org/user_avatar/discourse.openehr.org/surfer/32/2326_2.png) [@surfer](https://discourse.openehr.org/u/surfer)\
**Post date:** [12 February 2025 12:04 UTC](https://discourse.openehr.org/t/flat-example-of-a-dv-interval-dv-count/6324/1 "2025-02-12T12:04:04Z")

</div>

Does anyone have an example of a DV\_INTERVAL\<DV\_COUNT\> in flat format (for EHRBase)? Also an interval of something else (e.g. DV\_INTERVAL\<DV\_DATE\>) would be good too.

---

<div class="post-metadata">

**Author:** ![jake.smolka](https://discourse.openehr.org/user_avatar/discourse.openehr.org/jake.smolka/32/2870_2.png) [@jake.smolka](https://discourse.openehr.org/u/jake.smolka)\
**Post date:** [12 February 2025 12:30 UTC](https://discourse.openehr.org/t/flat-example-of-a-dv-interval-dv-count/6324/2 "2025-02-12T12:30:31Z")

</div>

I created a set of dummy test archetypes and used them in a dummy template, to create an example FLAT JSON via EHRbase. Is that what you are looking for?

```json
{
  "intervalltesttemplate.v0.1.0/category|code" : "433",
  "intervalltesttemplate.v0.1.0/category|value" : "event",
  "intervalltesttemplate.v0.1.0/category|terminology" : "openehr",
  "intervalltesttemplate.v0.1.0/context/start_time" : "2022-02-03T04:05:06",
  "intervalltesttemplate.v0.1.0/context/setting|code" : "225",
  "intervalltesttemplate.v0.1.0/context/setting|terminology" : "openehr",
  "intervalltesttemplate.v0.1.0/context/setting|value" : "home",
  "intervalltesttemplate.v0.1.0/context/_end_time" : "2022-02-03T04:05:06",
  "intervalltesttemplate.v0.1.0/context/_health_care_facility|name" : "DOE, John",
  "intervalltesttemplate.v0.1.0/single_intervall_count_test_archetype/any_event:0/intervallcountitem/lower" : 42,
  "intervalltesttemplate.v0.1.0/single_intervall_count_test_archetype/any_event:0/intervallcountitem/upper" : 42,
  "intervalltesttemplate.v0.1.0/single_intervall_count_test_archetype/any_event:0/intervallcountitem|lower_included" : false,
  "intervalltesttemplate.v0.1.0/single_intervall_count_test_archetype/any_event:0/intervallcountitem|upper_included" : false,
  "intervalltesttemplate.v0.1.0/single_intervall_count_test_archetype/any_event:0/time" : "2022-02-03T04:05:06",
  "intervalltesttemplate.v0.1.0/single_intervall_count_test_archetype/any_event:0/width" : "PT42H",
  "intervalltesttemplate.v0.1.0/single_intervall_count_test_archetype/any_event:0/math_function|terminology" : "openehr",
  "intervalltesttemplate.v0.1.0/single_intervall_count_test_archetype/any_event:0/math_function|code" : "145",
  "intervalltesttemplate.v0.1.0/single_intervall_count_test_archetype/any_event:0/math_function|value" : "minimum",
  "intervalltesttemplate.v0.1.0/single_intervall_count_test_archetype/any_event:1/intervallcountitem/lower" : 42,
  "intervalltesttemplate.v0.1.0/single_intervall_count_test_archetype/any_event:1/intervallcountitem/upper" : 42,
  "intervalltesttemplate.v0.1.0/single_intervall_count_test_archetype/any_event:1/intervallcountitem|lower_included" : false,
  "intervalltesttemplate.v0.1.0/single_intervall_count_test_archetype/any_event:1/intervallcountitem|upper_included" : false,
  "intervalltesttemplate.v0.1.0/single_intervall_count_test_archetype/any_event:1/time" : "2022-02-03T04:05:06",
  "intervalltesttemplate.v0.1.0/single_intervall_count_test_archetype/any_event:2/intervallcountitem/lower" : 42,
  "intervalltesttemplate.v0.1.0/single_intervall_count_test_archetype/any_event:2/intervallcountitem/upper" : 42,
  "intervalltesttemplate.v0.1.0/single_intervall_count_test_archetype/any_event:2/intervallcountitem|lower_included" : false,
  "intervalltesttemplate.v0.1.0/single_intervall_count_test_archetype/any_event:2/intervallcountitem|upper_included" : false,
  "intervalltesttemplate.v0.1.0/single_intervall_count_test_archetype/any_event:2/time" : "2022-02-03T04:05:06",
  "intervalltesttemplate.v0.1.0/single_intervall_count_test_archetype/any_event:2/width" : "PT42H",
  "intervalltesttemplate.v0.1.0/single_intervall_count_test_archetype/any_event:2/math_function|terminology" : "openehr",
  "intervalltesttemplate.v0.1.0/single_intervall_count_test_archetype/any_event:2/math_function|code" : "145",
  "intervalltesttemplate.v0.1.0/single_intervall_count_test_archetype/any_event:2/math_function|value" : "minimum",
  "intervalltesttemplate.v0.1.0/single_intervall_count_test_archetype/language|code" : "en",
  "intervalltesttemplate.v0.1.0/single_intervall_count_test_archetype/language|terminology" : "ISO_639-1",
  "intervalltesttemplate.v0.1.0/single_intervall_count_test_archetype/encoding|terminology" : "IANA_character-sets",
  "intervalltesttemplate.v0.1.0/single_intervall_count_test_archetype/encoding|code" : "UTF-8",
  "intervalltesttemplate.v0.1.0/single_intervall_count_test_archetype/_work_flow_id|id" : "3f28ef8c-5936-3b76-ad27-fd3260964644",
  "intervalltesttemplate.v0.1.0/single_intervall_count_test_archetype/_work_flow_id|id_scheme" : "scheme",
  "intervalltesttemplate.v0.1.0/single_intervall_count_test_archetype/_work_flow_id|namespace" : "unknown",
  "intervalltesttemplate.v0.1.0/single_intervall_count_test_archetype/_work_flow_id|type" : "ANY",
  "intervalltesttemplate.v0.1.0/single_intervall_count_test_archetype/_guideline_id|id" : "7d4471de-fd25-3b30-a35b-015fc9421e39",
  "intervalltesttemplate.v0.1.0/single_intervall_count_test_archetype/_guideline_id|id_scheme" : "scheme",
  "intervalltesttemplate.v0.1.0/single_intervall_count_test_archetype/_guideline_id|namespace" : "unknown",
  "intervalltesttemplate.v0.1.0/single_intervall_count_test_archetype/_guideline_id|type" : "ANY",
  "intervalltesttemplate.v0.1.0/single_intervall_date_test_archetype/any_event:0/intervalldateitem/lower" : "2022-02-03",
  "intervalltesttemplate.v0.1.0/single_intervall_date_test_archetype/any_event:0/intervalldateitem/upper" : "2022-02-03",
  "intervalltesttemplate.v0.1.0/single_intervall_date_test_archetype/any_event:0/intervalldateitem|lower_included" : false,
  "intervalltesttemplate.v0.1.0/single_intervall_date_test_archetype/any_event:0/intervalldateitem|upper_included" : false,
  "intervalltesttemplate.v0.1.0/single_intervall_date_test_archetype/any_event:0/time" : "2022-02-03T04:05:06",
  "intervalltesttemplate.v0.1.0/single_intervall_date_test_archetype/any_event:0/width" : "PT42H",
  "intervalltesttemplate.v0.1.0/single_intervall_date_test_archetype/any_event:0/math_function|terminology" : "openehr",
  "intervalltesttemplate.v0.1.0/single_intervall_date_test_archetype/any_event:0/math_function|value" : "minimum",
  "intervalltesttemplate.v0.1.0/single_intervall_date_test_archetype/any_event:0/math_function|code" : "145",
  "intervalltesttemplate.v0.1.0/single_intervall_date_test_archetype/any_event:1/intervalldateitem/lower" : "2022-02-03",
  "intervalltesttemplate.v0.1.0/single_intervall_date_test_archetype/any_event:1/intervalldateitem/upper" : "2022-02-03",
  "intervalltesttemplate.v0.1.0/single_intervall_date_test_archetype/any_event:1/intervalldateitem|lower_included" : false,
  "intervalltesttemplate.v0.1.0/single_intervall_date_test_archetype/any_event:1/intervalldateitem|upper_included" : false,
  "intervalltesttemplate.v0.1.0/single_intervall_date_test_archetype/any_event:1/time" : "2022-02-03T04:05:06",
  "intervalltesttemplate.v0.1.0/single_intervall_date_test_archetype/any_event:2/intervalldateitem/lower" : "2022-02-03",
  "intervalltesttemplate.v0.1.0/single_intervall_date_test_archetype/any_event:2/intervalldateitem/upper" : "2022-02-03",
  "intervalltesttemplate.v0.1.0/single_intervall_date_test_archetype/any_event:2/intervalldateitem|lower_included" : false,
  "intervalltesttemplate.v0.1.0/single_intervall_date_test_archetype/any_event:2/intervalldateitem|upper_included" : false,
  "intervalltesttemplate.v0.1.0/single_intervall_date_test_archetype/any_event:2/time" : "2022-02-03T04:05:06",
  "intervalltesttemplate.v0.1.0/single_intervall_date_test_archetype/any_event:2/width" : "PT42H",
  "intervalltesttemplate.v0.1.0/single_intervall_date_test_archetype/any_event:2/math_function|code" : "145",
  "intervalltesttemplate.v0.1.0/single_intervall_date_test_archetype/any_event:2/math_function|terminology" : "openehr",
  "intervalltesttemplate.v0.1.0/single_intervall_date_test_archetype/any_event:2/math_function|value" : "minimum",
  "intervalltesttemplate.v0.1.0/single_intervall_date_test_archetype/language|code" : "en",
  "intervalltesttemplate.v0.1.0/single_intervall_date_test_archetype/language|terminology" : "ISO_639-1",
  "intervalltesttemplate.v0.1.0/single_intervall_date_test_archetype/encoding|code" : "UTF-8",
  "intervalltesttemplate.v0.1.0/single_intervall_date_test_archetype/encoding|terminology" : "IANA_character-sets",
  "intervalltesttemplate.v0.1.0/single_intervall_date_test_archetype/_work_flow_id|id" : "e59bca52-0b5b-3faa-9e1e-61a001b083dc",
  "intervalltesttemplate.v0.1.0/single_intervall_date_test_archetype/_work_flow_id|id_scheme" : "scheme",
  "intervalltesttemplate.v0.1.0/single_intervall_date_test_archetype/_work_flow_id|namespace" : "unknown",
  "intervalltesttemplate.v0.1.0/single_intervall_date_test_archetype/_work_flow_id|type" : "ANY",
  "intervalltesttemplate.v0.1.0/single_intervall_date_test_archetype/_guideline_id|id" : "da4d6650-34c9-3de7-b659-1c1400a9e4d4",
  "intervalltesttemplate.v0.1.0/single_intervall_date_test_archetype/_guideline_id|id_scheme" : "scheme",
  "intervalltesttemplate.v0.1.0/single_intervall_date_test_archetype/_guideline_id|namespace" : "unknown",
  "intervalltesttemplate.v0.1.0/single_intervall_date_test_archetype/_guideline_id|type" : "ANY",
  "intervalltesttemplate.v0.1.0/language|terminology" : "ISO_639-1",
  "intervalltesttemplate.v0.1.0/language|code" : "en",
  "intervalltesttemplate.v0.1.0/territory|code" : "DE",
  "intervalltesttemplate.v0.1.0/territory|terminology" : "ISO_3166-1",
  "intervalltesttemplate.v0.1.0/composer|name" : "Max Mustermann"
}

```

---

<div class="post-metadata">

**Author:** ![surfer](https://discourse.openehr.org/user_avatar/discourse.openehr.org/surfer/32/2326_2.png) [@surfer](https://discourse.openehr.org/u/surfer)\
**Post date:** [12 February 2025 12:33 UTC](https://discourse.openehr.org/t/flat-example-of-a-dv-interval-dv-count/6324/3 "2025-02-12T12:33:31Z")

</div>

yes, just a confirmation.  
intervallcountitem in your webtemplate is the id of the leaf with rm type DV\_INTERVAL\<DV\_COUNT\> isn’t it?

---

<div class="post-metadata">

**Author:** ![jake.smolka](https://discourse.openehr.org/user_avatar/discourse.openehr.org/jake.smolka/32/2870_2.png) [@jake.smolka](https://discourse.openehr.org/u/jake.smolka)\
**Post date:** [12 February 2025 12:37 UTC](https://discourse.openehr.org/t/flat-example-of-a-dv-interval-dv-count/6324/4 "2025-02-12T12:37:36Z")

</div>

Yes, that’s how I would interpret it too.

---

<div class="post-metadata">

**Author:** ![surfer](https://discourse.openehr.org/user_avatar/discourse.openehr.org/surfer/32/2326_2.png) [@surfer](https://discourse.openehr.org/u/surfer)\
**Post date:** [12 February 2025 12:40 UTC](https://discourse.openehr.org/t/flat-example-of-a-dv-interval-dv-count/6324/5 "2025-02-12T12:40:53Z")

</div>

thanks @jake.smolka

---

<div class="post-metadata">

**Author:** ![surfer](https://discourse.openehr.org/user_avatar/discourse.openehr.org/surfer/32/2326_2.png) [@surfer](https://discourse.openehr.org/u/surfer)\
**Post date:** [12 February 2025 12:54 UTC](https://discourse.openehr.org/t/flat-example-of-a-dv-interval-dv-count/6324/6 "2025-02-12T12:54:47Z")

</div>

in my webtemplate I have the id=“interval\<dv\_count\>\_value” (if I create a composition in Better Designer the same leaf is called interval\_count\_value) but this is not recognized instantiating as you do,  
i.e.

```auto
 "interhealth_cancer_registry/laboratory_tests/laboratory_test_result/any_event:0/laboratory_analyte_result/analyte_result:16/interval<dv_count>_value|upper_unbounded": false,
 "interhealth_cancer_registry/laboratory_tests/laboratory_test_result/any_event:0/laboratory_analyte_result/analyte_result:16/interval<dv_count>_value|lower": 14,  
 "interhealth_cancer_registry/laboratory_tests/laboratory_test_result/any_event:0/laboratory_analyte_result/analyte_result:16/interval<dv_count>_value|upper": 19,
 "interhealth_cancer_registry/laboratory_tests/laboratory_test_result/any_event:0/laboratory_analyte_result/analyte_result:16/interval<dv_count>_value|lower_included": true,  
 "interhealth_cancer_registry/laboratory_tests/laboratory_test_result/any_event:0/laboratory_analyte_result/analyte_result:16/interval<dv_count>_value|upper_included": true,

```

any idea why it fails with Bad Request and message=Could not consume Parts ?

---

<div class="post-metadata">

**Author:** ![borut.jures](https://discourse.openehr.org/user_avatar/discourse.openehr.org/borut.jures/32/1391_2.png) [@borut.jures](https://discourse.openehr.org/u/borut.jures)\
**Post date:** [12 February 2025 12:57 UTC](https://discourse.openehr.org/t/flat-example-of-a-dv-interval-dv-count/6324/7 "2025-02-12T12:57:30Z")

</div>

@jake.smolka In your example, `/` is used for `lower/upper` but `|` for `lower_included/upper_included`. However in the @surfer example the `|` is used for all 4.

```auto
"intervalldateitem/lower" : "2022-02-03",
"intervalldateitem/upper" : "2022-02-03",
"intervalldateitem|lower_included" : false,
"intervalldateitem|upper_included" : false,

```

---

<div class="post-metadata">

**Author:** ![surfer](https://discourse.openehr.org/user_avatar/discourse.openehr.org/surfer/32/2326_2.png) [@surfer](https://discourse.openehr.org/u/surfer)\
**Post date:** [12 February 2025 13:03 UTC](https://discourse.openehr.org/t/flat-example-of-a-dv-interval-dv-count/6324/8 "2025-02-12T13:03:02Z")

</div>

using the / for lower/upper the result is the same. All the paths are not considered valid by EHRBase. Maybe what’s shown as id in the EHRBase webtemplate does not reflect what is considered valid inside the EHRBase code. @stefanspiska is that possible?

(I’m now using the webtemplate created by version 0.32 to avoid the issue @stefanspiska signalled for recent EHRBase versions)

---

<div class="post-metadata">

**Author:** ![stefanspiska](https://discourse.openehr.org/user_avatar/discourse.openehr.org/stefanspiska/32/819_2.png) [@stefanspiska](https://discourse.openehr.org/u/stefanspiska)\
**Post date:** [12 February 2025 14:20 UTC](https://discourse.openehr.org/t/flat-example-of-a-dv-interval-dv-count/6324/9 "2025-02-12T14:20:27Z")

</div>

Its `/lower `

and `<` is not a valid flat id. so something went wrong there.

---

<div class="post-metadata">

**Author:** ![surfer](https://discourse.openehr.org/user_avatar/discourse.openehr.org/surfer/32/2326_2.png) [@surfer](https://discourse.openehr.org/u/surfer)\
**Post date:** [12 February 2025 15:16 UTC](https://discourse.openehr.org/t/flat-example-of-a-dv-interval-dv-count/6324/10 "2025-02-12T15:16:50Z")

</div>

do you know how an interval of something is translated into an id? we are talking about a path where multiple rm types are allowed so they are distinguished by an id, generated by the code I suppose.

---

<div class="post-metadata">

**Author:** ![stefanspiska](https://discourse.openehr.org/user_avatar/discourse.openehr.org/stefanspiska/32/819_2.png) [@stefanspiska](https://discourse.openehr.org/u/stefanspiska)\
**Post date:** [12 February 2025 15:34 UTC](https://discourse.openehr.org/t/flat-example-of-a-dv-interval-dv-count/6324/11 "2025-02-12T15:34:58Z")

</div>

The id are generated from the names of the elements in the Rm model.  
There are some complex comer cases when you have reputing names or choice elements.

If you OPT generated a web template with `<` then there was an error somewhere so please create an issue in github with the opt.

If you just want to try out stuff create an archetype yourself with fixed rm type and ensure that the names do not contain a-x.

---

<div class="post-metadata">

**Author:** ![surfer](https://discourse.openehr.org/user_avatar/discourse.openehr.org/surfer/32/2326_2.png) [@surfer](https://discourse.openehr.org/u/surfer)\
**Post date:** [12 February 2025 15:37 UTC](https://discourse.openehr.org/t/flat-example-of-a-dv-interval-dv-count/6324/12 "2025-02-12T15:37:32Z")

</div>

ok, will do. thank you

---

<div class="post-metadata">

**Author:** ![surfer](https://discourse.openehr.org/user_avatar/discourse.openehr.org/surfer/32/2326_2.png) [@surfer](https://discourse.openehr.org/u/surfer)\
**Post date:** [13 February 2025 12:36 UTC](https://discourse.openehr.org/t/flat-example-of-a-dv-interval-dv-count/6324/13 "2025-02-13T12:36:57Z")

</div>

I created an archetype with a leaf with only the rm dv\_interval\<dv\_count\> and a template to contain the data and it worked.  
So the problem seems associated to the coexistence of multiple rm types at the same path and/or to that specific template.

P.S I created the issue in github
