# "Missing Element Error" on a subset of archetypes available from the CKM

**URL:** https://discourse.openehr.org/t/missing-element-error-on-a-subset-of-archetypes-available-from-the-ckm/15172
**Category:** Reference Implementation: Java (archive)
**Created:** [14 May 2012 17:12 UTC](https://discourse.openehr.org/t/missing-element-error-on-a-subset-of-archetypes-available-from-the-ckm/15172 "2012-05-14T17:12:52Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![ANASTASIOU\_A1](https://discourse.openehr.org/letter_avatar_proxy/v4/letter/a/ee59a6/32.png) [@ANASTASIOU\_A1](https://discourse.openehr.org/u/ANASTASIOU_A1)
#### Post date: [14 May 2012 17:12 UTC](https://discourse.openehr.org/t/missing-element-error-on-a-subset-of-archetypes-available-from-the-ckm/15172/1 "2012-05-14T17:12:52Z")

</div>

Hello everyone

While i was putting together this small list of some issues i have encountered with the published XML / XSDs at [http://www.openehr.org/wiki/display/dev/Development+test+base](http://www.openehr.org/wiki/display/dev/Development+test+base) i was reminded of this problem i came across and according to Sebastian Garde's advice as well, i thought i'd post it here:

A few weeks ago i went through every XML available to the CKM (until 18/04/2012) and discovered that out of the 288 files, 41 (attached at the end of this message) were failing to be parsed with:

"Missing element error" on DV\_CODED\_TEXT elements (cannot accept wildcard content CODE\_PHRASE)

(An earlier suggestion by Sebastian was to use openehrprofile.xsd as the top level xsd which i was at the time.)

Any ideas as to why this error might be occurring?

Looking forward to hearing from you  
Athanasios Anastasiou

List Of Archetypes with the aforementioned problem:  
openEHR-EHR-EVALUATION.problem-diagnosis.v1.xml  
openEHR-EHR-OBSERVATION.barthel.v1.xml  
openEHR-EHR-CLUSTER.exam-ears.v1.xml  
openEHR-EHR-CLUSTER.symptom.v1.xml  
openEHR-DEMOGRAPHIC-CLUSTER.provider\_identifier.v1.xml  
openEHR-EHR-CLUSTER.exam-mouth.v1.xml  
openEHR-EHR-OBSERVATION.braden\_scale-child.v1.xml  
openEHR-EHR-OBSERVATION.glasgow\_coma.v1.xml  
openEHR-EHR-OBSERVATION.apgar.v1.xml  
openEHR-EHR-CLUSTER.clubbing.v1.xml  
openEHR-EHR-CLUSTER.microscopy\_prostate\_carcinoma.v1.xml  
openEHR-EHR-CLUSTER.move.v1.xml  
openEHR-EHR-EVALUATION.triage.v1.xml  
openEHR-EHR-OBSERVATION.intravascular\_pressure-jvp.v1.xml  
openEHR-EHR-CLUSTER.exam-uterine\_cervix.v1.xml  
openEHR-DEMOGRAPHIC-CLUSTER.identifier\_other\_details.v1.xml  
openEHR-EHR-CLUSTER.microscopy\_breast\_carcinoma.v1.xml  
openEHR-EHR-OBSERVATION.infant\_feeding.v1.xml  
openEHR-EHR-CLUSTER.exam-chest.v1.xml  
openEHR-EHR-OBSERVATION.urinalysis.v1.xml  
openEHR-EHR-CLUSTER.palpation-joint.v1.xml  
openEHR-EHR-CLUSTER.inspection-skin-wound.v1.xml  
openEHR-EHR-OBSERVATION.uterine\_contractions.v1.xml  
openEHR-EHR-EVALUATION.risk-family\_history.v1.xml  
openEHR-EHR-OBSERVATION.faeces.v1.xml  
openEHR-EHR-OBSERVATION.intravascular\_pressure-cvp.v1.xml  
openEHR-EHR-OBSERVATION.global.v1.xml  
openEHR-EHR-CLUSTER.coordination.v1.xml  
openEHR-EHR-CLUSTER.exam-uterus.v1.xml  
openEHR-EHR-CLUSTER.inspection-ear\_canal.v1.xml  
openEHR-EHR-CLUSTER.oedema.v1.xml  
openEHR-EHR-OBSERVATION.waterlow\_score.v1.xml  
openEHR-EHR-OBSERVATION.braden\_scale.v1.xml  
openEHR-EHR-CLUSTER.inspection-tympanic\_membrane.v1.xml  
openEHR-EHR-OBSERVATION.braden\_scale\_neonate.v1.xml  
openEHR-EHR-OBSERVATION.intravascular\_pressure.v1.xml  
openEHR-EHR-CLUSTER.symptom-pain.v1.xml  
openEHR-EHR-OBSERVATION.tendon\_babinski\_reflexes.v1.xml  
openEHR-EHR-CLUSTER.move-joint.v1.xml  
openEHR-EHR-CLUSTER.move-spine.v1.xml  
openEHR-EHR-CLUSTER.auscultation-chest.v1.xml

---

<div class="post-metadata">

### Author: ![system](https://discourse.openehr.org/uploads/default/original/2X/f/f0a1dedb20c42747bddcafd6c7df9db5f34f003c.svg) [@system](https://discourse.openehr.org/u/system)
#### Post date: [14 May 2012 19:52 UTC](https://discourse.openehr.org/t/missing-element-error-on-a-subset-of-archetypes-available-from-the-ckm/15172/2 "2012-05-14T19:52:56Z")

</div>

Hi,

I should add that CKM uses the Java XML generator to generate the xml archetypes.

Cheers  
Sebastian

---

<div class="post-metadata">

### Author: ![ANASTASIOU\_A1](https://discourse.openehr.org/letter_avatar_proxy/v4/letter/a/ee59a6/32.png) [@ANASTASIOU\_A1](https://discourse.openehr.org/u/ANASTASIOU_A1)
#### Post date: [17 May 2012 17:36 UTC](https://discourse.openehr.org/t/missing-element-error-on-a-subset-of-archetypes-available-from-the-ckm/15172/3 "2012-05-17T17:36:44Z")

</div>

Hello everyone

With reference to my earlier email and because this bug kept coming back annoyingly, i decided to devote a bit more time on it and i think that i have managed to track the problem down.

The short version is this:

Certain ARCHETYPE.definition might contain some C\_DV\_ORDINAL which contains a list of DV\_ORDINALs with the .value and .symbol fields. The .symbol is a DV\_CODED\_TEXT and is supposed to contain just a .defining\_code.

So far, so good...However, DV\_CODED\_TEXT descends from DV\_TEXT which amongst other (optional) fields, contains a .value with no multiplicity definition. As such, it is considered mandatory ([http://www.w3.org/TR/xmlschema-0/#OccurrenceConstraints](http://www.w3.org/TR/xmlschema-0/#OccurrenceConstraints)).

This makes a valid \<symbol\> to look like:  
\<symbol\>\<defining\_code/\>\<value/\>\</symbol\>  
instead of:  
\<symbol\>\<defining\_code/\>\</symbol\>  
Which is what appears in the output so far.

In support of this, i am attaching 3 files:

openEHR\_CODED\_TEXT\_modrend.jpg:  
A quick screenshot showing in parallel fragments of the RM as expressed in the XSD schema and RM model to show that the XSD schema reflects the absence of multiplicity in DV\_TEXT value which is correct according to the specifications ([http://www.openehr.org/svn/specification/TRUNK/publishing/architecture/rm/data\_types\_im.pdf](http://www.openehr.org/svn/specification/TRUNK/publishing/architecture/rm/data_types_im.pdf) p-29)

dummy\_archetype\_AsExported.xml:  
Is a fragment of the "Glasgow Coma Scale" which was one of the archetypes in the list in my previous email. Its definition IS NOT COMPLETE, it just contains the essential elements so that someone can replicate the problem.

dummy\_archetype\_AsConforming.xml:  
Is the same fragment but with the added \<value\> element.

In my setup, "dummy\_archetype\_AsExported.xml" is the one that produces the error, while "dummy\_archetype\_AsExported.xml" is parsed and loaded correctly.

Of course, this not only affects loading the archetypes but also trying to create an RM or fragments of it.

Could this be a bug in the CKM?

Looking forward to hearing from you  
Athanasios Anastasiou

> **(attachments)**
>
> ![openEHRCODEDTEXTmodrend.jpg](https://discourse.openehr.org/images/transparent.png)  
> [dummy\_archetype\_AsConforming.xml](https://discourse.openehr.org/404) (25.5 KB)  
> [dummy\_archetype\_AsExported.xml](https://discourse.openehr.org/404) (25.5 KB)
