This topic needs a title

Hi,

I think this is a bug in the archetype parser, what do you think?

I’ve an archetype with this node:

ELEMENT[at0002] occurrences matches {0..1} matches { – Exploracion clinica cervical anormal
value matches {
DV_BOOLEAN matches {
value matches {True, False; True}
}
}
}

So, with the specs of ADL (adl.pdf page 70: assumed values), True is the assumed value for the CPrimitiveObject that hodls the DV_BOOLEAN constraint.

When I printout this node I get (assumed value “false”):

org.openehr.am.archetype.constraintmodel.CPrimitiveObject@1a4ab42[
  item=org.openehr.am.archetype.constraintmodel.primitive.CBoolean@1e7aa15
  assumedValue=false
  rmTypeName=DvBoolean
  occurrences=org.openehr.rm.support.basic.Interval@a7607a[lower=1,lowerIncluded=true,upper=1,upperIncluded=true]
  nodeID=
  parent=
  anyAllowed=false
  path=/data[at0001]/items[at0002]/value/value
]

Any ideas?

Cheers,
Pablo Pazos Gutierrez
www.simplewebportal.net

Hi Pablo,

the result you get sounds wrong, but I cannot reproduce it.
I created the test archetype below and got the correct results for both DV_BOOLEANs in it.

Can you share your archetype that fails (and also make sure you are using the latest Parser)?

Cheers
Sebastian

org.openehr.am.archetype.constraintmodel.CComplexObject@8f4fb3[
attributes=[org.openehr.am.archetype.constraintmodel.CSingleAttribute@29428e[
rmAttributeName=value
existence=REQUIRED
children=[org.openehr.am.archetype.constraintmodel.CPrimitiveObject@1d04653[
item=org.openehr.am.archetype.constraintmodel.primitive.CBoolean@1ad77a7
assumedValue=true
rmTypeName=DvBoolean
occurrences=org.openehr.rm.support.basic.Interval@126804e[lower=1,lowerInclude
d=true,upper=1,upperIncluded=true]
nodeID=
parent=
anyAllowed=false
path=/data[at0001]/events[at0002]/data[at0003]/items[at0004]/value/value
]]
anyAllowed=false
path=/data[at0001]/events[at0002]/data[at0003]/items[at0004]/value/value
]]
assumedValue=
rmTypeName=DV_BOOLEAN
occurrences=org.openehr.rm.support.basic.Interval@d2906a[lower=1,lowerIncluded
=true,upper=1,upperIncluded=true]
nodeID=
parent=
anyAllowed=false
path=/data[at0001]/events[at0002]/data[at0003]/items[at0004]/value
]
org.openehr.am.archetype.constraintmodel.CComplexObject@72ffb[
attributes=[org.openehr.am.archetype.constraintmodel.CSingleAttribute@1df38fd[

rmAttributeName=value
existence=REQUIRED
children=[org.openehr.am.archetype.constraintmodel.CPrimitiveObject@16a786[
item=org.openehr.am.archetype.constraintmodel.primitive.CBoolean@1507fb2
assumedValue=true
rmTypeName=DvBoolean
occurrences=org.openehr.rm.support.basic.Interval@1efb836[lower=1,lowerInclude
d=true,upper=1,upperIncluded=true]
nodeID=
parent=
anyAllowed=false
path=/data[at0001]/events[at0002]/state[at0005]/items[at0006]/value/value
]]
anyAllowed=false
path=/data[at0001]/events[at0002]/state[at0005]/items[at0006]/value/value
]]
assumedValue=
rmTypeName=DV_BOOLEAN
occurrences=org.openehr.rm.support.basic.Interval@126e85f[lower=1,lowerInclude
d=true,upper=1,upperIncluded=true]
nodeID=
parent=
anyAllowed=false
path=/data[at0001]/events[at0002]/state[at0005]/items[at0006]/value
]

Archetype:

archetype (adl_version=1.4)
openEHR-EHR-OBSERVATION.testassumedvalue.v1

concept
[at0000] – Test assumed value
language
original_language = <[ISO_639-1::en]>
description
original_author = <
[“name”] = <“”>

details = <
[“en”] = <
language = <[ISO_639-1::en]>
purpose = <“test”>
use = <“”>
misuse = <“”>

lifecycle_state = <“Initial”>
other_contributors = <>
other_details = <
[“references”] = <“”>
[“MD5-CAM-1.0.1”] = <“0B09C5A77713C376B458BDB09F83F018”>

definition
OBSERVATION[at0000] matches { – Test assumed value
data matches {
HISTORY[at0001] matches { – Event Series
events cardinality matches {1..; unordered} matches {
EVENT[at0002] occurrences matches {0..1} matches { – Any event
data matches {
ITEM_TREE[at0003] matches { – Tree
items cardinality matches {0..
; unordered} matches {
ELEMENT[at0004] occurrences matches {0..1} matches { – New element
value matches {
DV_BOOLEAN matches {
value matches {True, False; True}
}
}
}
}
}
}
state matches {
ITEM_TREE[at0005] matches { – Tree
items cardinality matches {0..*; unordered} matches {
ELEMENT[at0006] occurrences matches {0..1} matches { – New element
value matches {
DV_BOOLEAN matches {
value matches {True, False; True}
}
}
}
}
}
}
}
}
}
}
}

ontology
term_definitions = <
[“en”] = <
items = <
[“at0000”] = <
text = <“Test assumed value”>
description = <“unknown”>

[“at0001”] = <
text = <“Event Series”>
description = <“@ internal @”>

[“at0002”] = <
text = <“Any event”>
description = <“*”>

[“at0003”] = <
text = <“Tree”>
description = <“@ internal @”>

[“at0004”] = <
text = <“New element”>
description = <“*”>

[“at0005”] = <
text = <“Tree”>
description = <“@ internal @”>

[“at0006”] = <
text = <“New element”>
description = <“*”>

pablo pazos wrote:

(attachments)

oceanlogo.png

Hi Sebastian,

Of course, here’s the archetype.

The parser I’m using is: adl-parser-1.0.2-SNAPSHOT.jar, I don’t know if it’s the latest.

I’ll try to parse your archetype to see what happens.

Cheers,
Pablo Pazos Gutierrez.

(attachments)

oceanlogo.png
openEHR-EHR-EVALUATION.columna_vertebral.v1.adl (1.99 KB)

Hi Pablo,

your archetype gives me this output below which I believe is correct.
If you are building it from the source make sure you have updated all files before using maven.
Otherwise try to download the jar from here: http://www.openehr.org/wiki/display/projects/Java+Project+Download

Rong, the Integration server at http://openehr.cambiosys.org/continuum (linked from http://www.openehr.org/projects/java.html ) doesn’t seem to be available at present?

Cheers
Sebastian

org.openehr.am.archetype.constraintmodel.CComplexObject@8f4fb3[
attributes=[org.openehr.am.archetype.constraintmodel.CSingleAttribute@29428e[
rmAttributeName=value
existence=REQUIRED
children=[org.openehr.am.archetype.constraintmodel.CPrimitiveObject@1d04653[
item=org.openehr.am.archetype.constraintmodel.primitive.CBoolean@1ad77a7
assumedValue=true
rmTypeName=DvBoolean
occurrences=org.openehr.rm.support.basic.Interval@126804e[lower=1,lowerInclude
d=true,upper=1,upperIncluded=true]
nodeID=
parent=
anyAllowed=false
path=/data[at0001]/items[at0002]/value/value
]]
anyAllowed=false
path=/data[at0001]/items[at0002]/value/value
]]
assumedValue=
rmTypeName=DV_BOOLEAN
occurrences=org.openehr.rm.support.basic.Interval@d2906a[lower=1,lowerIncluded
=true,upper=1,upperIncluded=true]
nodeID=
parent=
anyAllowed=false
path=/data[at0001]/items[at0002]/value
]

pablo pazos wrote:

(attachments)

oceanlogo.png

Hi Sebastian,

Thanks for helping out.

Yes, I am aware of the issue with the integration server. Will look into this.

Cheers,
Rong

2009/9/22 Sebastian Garde <sebastian.garde@oceaninformatics.com>

Hi Sebastian,

Thanks for testing this issue.
I have all files updated from http://www.openehr.org/svn/ref_impl_java/TRUNK/, and the maven build generates the XXX.1.0.2-SNAPSHOT.jar that I’m using.
So I think this may be a new bug, because in the XXX.1.0.1.jar version of the java ref impl you get the correct value.

For now I’ll grab the 1.0.1 jars to continue with my implementation.

Thanks a lot!

Cheers,
Pablo Pazos Gutierrez
http://pablo.swp.googlepages.com/

(attachments)

oceanlogo.png
oceanlogo.png

Hi,

I have another problem with assumedValue of the DvBoolean, may be you can help me out.

If I’ve this (I mean “no assumed value”):

DV_BOOLEAN matches {
value matches {True, False}
}

The assumed value of this node in the AOM instance is “false” and I think it must be a “null” assumed value.

Is it the spected behavior?
Is correct to have a null assumed value for a CBoolean constraint?
Any ideas?

Thanks a lot,
Pablo Pazos Gutiérrez.

(attachments)

oceanlogo.png
oceanlogo.png

2009/10/17 pablo pazos <pazospablo@hotmail.com>

Hi,

I have another problem with assumedValue of the DvBoolean, may be you can help me out.

If I’ve this (I mean “no assumed value”):

DV_BOOLEAN matches {
value matches {True, False}
}

The assumed value of this node in the AOM instance is “false” and I think it must be a “null” assumed value.

Is it the spected behavior?
Is correct to have a null assumed value for a CBoolean constraint?
Any ideas?

Thanks a lot,
Pablo Pazos Gutiérrez.


Hi Pablo,

The assumedValue attribute of CBoolean is a primitive boolean so it can’t return null. In the case you provided, it’s better to check if hasAssumedValue returns true before proceed to take assumedValue.

By the way, please in the future try not to reply to lengthy posts directly since the response mail can be too big to pass the list server.

Cheers,
Rong

Hi Rong,

hasAssumedValue work fine if I do something like: cPrimitiveObject.item.hasAssumedValue()
but if I do: cPrimitiveObject.hasAssumedValue() it always return true, I think if the item of the CPrimitiveObject
don’t have an asssumed value, cPrimitiveObject.hasAssumedValue() must return false, is it correct?

Thanks!

Pablo.