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

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 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

Hi,

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

Cheers
Sebastian

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).

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 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
dummy_archetype_AsConforming.xml (25.5 KB)
dummy_archetype_AsExported.xml (25.5 KB)