some questions about openEHR - AOM

Hi Rong, my name is Pablo Pazos and i’m working at the NIB with Rodrigo Filgueira.

We are trying to understand the openehr from the bottom, that’s the reason im implementing the AOM based on teh specification and taking your implementation as reference.

We based our implementation of AOM in OpenEHR AOM Release 1 Revision 2.0.1 and took the Branches Implementation Release 1.0 as a reference.

I have some questions and I’m sure you can help me with them. The questions are separated following the AOM package structure.

Primitive package:

  1. What’s the meaning of the standardRepresentation() method of CPrimitive class? What’s the use of the standardRepresentation of a CPrimitive object? How can I find the standardRepresentation of a CPrimitive class?

  2. The validValue() method of the CDuration class is not implemented. There is only one restriction on a Duration, the range, but: What do I need to do to say a Duration is valid with respect to the range constraint?

  3. If hasAssumedValue returns false, the assumedValue attribute is necesarilly null?

If so, let’s consider the invariant validValue ( assumedValue ), my question is: validValue ( null ) returns true? or have we to check that hasAssumedValue() is true before we call the validValue(..) operation.

  1. There is only one constraint for CDateTime in the specification, the range constraint. And there is the validityIsRange() operation that returns true if the constraint is range, but we have only one type of constraint, so the operation returns always true?

The implementation has more types of constraints: a pattern and a list, but those do not appear in the spec.

Constraint Package:

We found some not implemented operations:

isValid(): boolean

hasPath(): boolean

isSubsetOf( other: ArchetypeConstraint ): Boolean

  1. Why are they not implemented? Are there for future extensions of the model?

  2. What do we need to implement them?

  3. For isSubsetOf(..), how to compare the constraints in order to know what’s narrower?

Other questions:

  1. The CSingleAttribute has a list of alternative constraints, the question is: the alternatives are all the constraints for some object or we got the alternatives and have to choose only one of the alternatives? (the alternative word implies that an election should be done) If we have to choose only one of the alternatives, what criteria is used to choose one?

  2. Maybe a documentation bug. The diagram of page 18 shows an attribute named CDomainType.standard_equivalent, but on page 27 there is a CDomainType.standard_representation, what’s the correct name?

  3. The ArchetypeInternalRef has an invariant: ultimate_root.hasPath( targetPath ), my question is: how to find the ultimate root?, the ultimate root is the root of the archetype (the definition attribute of the Archetype class)?

Ontology Package:

There are some operations that can’t be implemented based on the attributes that appear in the spec., operations like hasLanguage(), termDefinition(), constraintDefinition() need a language but we haven’t got a lang. (your implementation has a list of languages).

  1. Why those operations are implemented with things that not appear on the spec?

  2. What are those operations for?

I cannot implement the “binding” operations either, because I don’t know where to find the bindings. Your implementation has some extra classes that don’t appear on the spec that may help with the binding, OntologyBinding, OntologyBindingItem, TermBindingItem and QueryBindingItem. What’s the need of those extra classes? Why don’t they appear on the spec? Why does the ArchetypeOntology.termBinding attribute, which is in your implementation, not appear on the spec?

Archetype Package:

  1. In Archetype.previousVersion() operation, how to find the previous version?, your implementation has a “todo” label with the same message.

  2. should Archetype.conceptName() return Archetype.ontology.termDefinition(lang, this.conceptCode).toString(); ? why have you not implemented it? what is/will it be used for?

  3. The Archetype.conceptName() operation has to return Archetype.ontology.termDefinition(lang, this.conceptCode).toString?

  4. The Archetype.isSpecialised() has to return parented != null?

Thank you

regards,

Pablo Pazos

NIB

Hi Rodrigo, Pablo,

Rong will probably answer some of the questions below. I will endeavour to do so as well (tomorrow;-). This is precisely the kind of feedback we need.

One thing I am unclear about: are you trying to use the existing Java implementation, or are you building another implementation? There is already a Java, C# and Eiffel implementation of the AOM semantics. The Eiffel one is probably the most advanced; it might be useful for you to download it and build it. See http://svn.openehr.org/ref_impl_eiffel/TRUNK/project_page.htm for info

Pablo Pazos wrote:

*From:* Pablo Pazos - simplewebportal.net <mailto:pazospablo@hotmail.com>
*To:* rong@acode.se <mailto:rong@acode.se>
*Cc:* Rodrigo Filgueira - IIE <mailto:rfilgue@fing.edu.uy> ; ppazos@fing.edu.uy <mailto:ppazos@fing.edu.uy>
*Sent:* Wednesday, June 28, 2006 2:35 PM
*Subject:* some questions about openEHR - AOM

Hi Rong, my name is Pablo Pazos and i'm working at the NIB with Rodrigo Filgueira.

We are trying to understand the openehr from the bottom, that's the reason im implementing the AOM based on teh specification and taking your implementation as reference.

We based our implementation of AOM in /OpenEHR AOM Release 1 Revision 2.0.1 /and took the /Branches Implementation Release 1.0 as a reference./

I have some questions and I’m sure you can help me with them. The questions are separated following the AOM package structure.

I will certainly try my best. But I also hope Thomas and others would participate the discussion.

Tell me if you think that is better to send this to the implemnters list.

*_Primitive package:_*

1) What’s the meaning of the standardRepresentation() method of CPrimitive class? What’s the use of the standardRepresentation of a CPrimitive object? How can I find the standardRepresentation of a CPrimitive class?

It seems that the method standardRepresentation() should be defined in CPrimitiveObject instead.

2) The validValue() method of the CDuration class is not implemented. There is only one restriction on a Duration, the range, but: What do I need to do to say a Duration is valid with respect to the range constraint?

It should return true if either the given value is the same as getValue() or within the interval returned by getInterval().

3) If hasAssumedValue returns false, the assumedValue attribute is necesarilly null?

If so, let’s consider the invariant validValue ( assumedValue ), my question is: validValue ( null ) returns true? or have we to check that hasAssumedValue() is true before we call the validValue(..) operation.

I think so.

4) There is only one constraint for CDateTime in the specification, the range constraint. And there is the validityIsRange() operation that returns true if the constraint is range, but we have only one type of constraint, so the operation returns always true?

The implementation has more types of constraints: a pattern and a list, but those do not appear in the spec.

The implementation is not up-to-date.

*_Constraint Package:_*

We found some not implemented operations:

isValid(): boolean

hasPath(): boolean

isSubsetOf( other: ArchetypeConstraint ): Boolean

1) Why are they not implemented? Are there for future extensions of the model?

Initially we implemented only the essential features of the AOM for us to finish our Pilot EHR based on openEHR design.

2) What do we need to implement them?

3) For isSubsetOf(..), how to compare the constraints in order to know what’s narrower?

Maybe Thomas can explain that.

Other questions:

1) The CSingleAttribute has a list of alternative constraints, the question is: the alternatives are all the constraints for some object or we got the alternatives and have to choose only one of the alternatives? (the alternative word implies that an election should be done) If we have to choose only one of the alternatives, what criteria is used to choose one?

Only one of the alternatives, hence the name "Single" attribute. The choice is up to the user of the archetype.

2) Maybe a documentation bug. The diagram of page 18 shows an attribute named CDomainType.standard_equivalent, but on page 27 there is a CDomainType.standard_representation, what’s the correct name?

I guess standard_representation() since it also appears in other place.

3) The ArchetypeInternalRef has an invariant: ultimate_root.hasPath( targetPath ), my question is: how to find the ultimate root?, the ultimate root is the root of the archetype (the definition attribute of the Archetype class)?

Not sure about this one.

*_Ontology Package:_*

There are some operations that can’t be implemented based on the attributes that appear in the spec., operations like hasLanguage(), termDefinition(), constraintDefinition() need a language but we haven’t got a lang. (your implementation has a list of languages).

The current implementation is not up-to-date. On the other hand, this package leaves lots of space for the implementor to explore too. Take a look at the ADL specs and see what to expect from archetypes.

1) Why those operations are implemented with things that not appear on the spec?

2) What are those operations for?

I cannot implement the “binding” operations either, because I don’t know where to find the bindings. Your implementation has some extra classes that don’t appear on the spec that may help with the binding, OntologyBinding, OntologyBindingItem, TermBindingItem and QueryBindingItem. What’s the need of those extra classes? Why don’t they appear on the spec? Why does the ArchetypeOntology.termBinding attribute, which is in your implementation, not appear on the spec?

*_Archetype Package:_*

1) In Archetype.previousVersion() operation, how to find the previous version?, your implementation has a “todo” label with the same message.

It could be from an archetype repository in a controlled environment or simply specified from ArchetypeDescription.

2) should Archetype.conceptName() return Archetype.ontology.termDefinition(lang, this.conceptCode).toString(); ? why have you not implemented it? what is/will it be used for?

That looks fine. It could be used for finding the name of the concept in the given language.

3) The Archetype.conceptName() operation has to return Archetype.ontology.termDefinition(lang, this.conceptCode).toString?

4) The Archetype.isSpecialised() has to return parented != null?

That's right.

Cheers,
Rong

4) There is only one constraint for CDateTime in the specification, the range constraint. And there is the validityIsRange() operation that returns true if the constraint is range, but we have only one type of constraint, so the operation returns always true?

The implementation has more types of constraints: a pattern and a list, but those do not appear in the spec.

The implementation is not up-to-date.

Ok, but the implementation is not the problem, because there is only one constraint type in the spec. and also the operation to check if the constraint type is range is in the spec.
This operation has sense when there are other constraint types like in the implementation.

thanks
Pablo Pazos
www.simplewebportal.net

Rong Chen wrote:

Pablo Pazos wrote:

*_Primitive package:_*

1) What’s the meaning of the standardRepresentation() method of CPrimitive class? What’s the use of the standardRepresentation of a CPrimitive object? How can I find the standardRepresentation of a CPrimitive class?

It seems that the method standardRepresentation() should be defined in CPrimitiveObject instead.

this is correct. Probably it should be defined on C_OBJECT, in which case the implementation for most of the subtypes is trivial. I am working on this area of the model at the moment, so will treat this as a request for change, and come back with a proposed change to the document. For now, following Rong's advice is sensible.

3) If hasAssumedValue returns false, the assumedValue attribute is necesarilly null?

If so, let’s consider the invariant validValue ( assumedValue ), my question is: validValue ( null ) returns true? or have we to check that hasAssumedValue() is true before we call the validValue(..) operation.

I think so.

good point. The assertion should read:

has_assumed_value implies valid_value(assumed_value).

This will also be a change to the spec

4) There is only one constraint for CDateTime in the specification, the range constraint. And there is the validityIsRange() operation that returns true if the constraint is range, but we have only one type of constraint, so the operation returns always true?

The implementation has more types of constraints: a pattern and a list, but those do not appear in the spec.

The implementation is not up-to-date.

Neither is the spec, so I see; there should be some boolean flags to indicate xx_allowed for each part of a duration, i.e.:

year_allowed: Boolean
month_allowed: Boolean
week_allowed: Boolean
day_allowed: Boolean
hour_allowed: Boolean
minute_allowed: Boolean
second_allowed: Boolean
fractional_second_allowed: boolean

*_Constraint Package:_*

We found some not implemented operations:

isValid(): boolean

hasPath(): boolean

isSubsetOf( other: ArchetypeConstraint ): Boolean

1) Why are they not implemented? Are there for future extensions of the model?

these are useful. hasPath() is implemented in the Eiffel version of the parser - it is used to find paths mentioned in ArchetypeInternalRefs for example

isValid() is a function that must be implemented for the kernel, i.e. to do archetype checking at runtime.

isSubsetOf() is needed to compare archetypes to specialised archetypes; specialised archetypes cannot introduce wider constraints when redefining existing constraints (like covariant redefinition in OO languages).

Initially we implemented only the essential features of the AOM for us to finish our Pilot EHR based on openEHR design.

2) What do we need to implement them?

3) For isSubsetOf(..), how to compare the constraints in order to know what’s narrower?

Maybe Thomas can explain that.

see above.

Other questions:

1) The CSingleAttribute has a list of alternative constraints, the question is: the alternatives are all the constraints for some object or we got the alternatives and have to choose only one of the alternatives? (the alternative word implies that an election should be done) If we have to choose only one of the alternatives, what criteria is used to choose one?

Only one of the alternatives, hence the name "Single" attribute. The choice is up to the user of the archetype.

yes, it is a 1 of N choice. Single attribute means something like name: String, whereas multiple attribute is names: List<String>

2) Maybe a documentation bug. The diagram of page 18 shows an attribute named CDomainType.standard_equivalent, but on page 27 there is a CDomainType.standard_representation, what’s the correct name?

I guess standard_representation() since it also appears in other place.

thanks - another typo fixed;-)

3) The ArchetypeInternalRef has an invariant: ultimate_root.hasPath( targetPath ), my question is: how to find the ultimate root?, the ultimate root is the root of the archetype (the definition attribute of the Archetype class)?

Not sure about this one.

correct; but I have to admit I have not implemented it. I would suggest that a better invariant would be one on the root object that says that all paths found in ArchetypeInternalRefs must be valid paths. In my implementation I don't have this as invariant, but I do have it implemented as a second pass check. See the function internal_references_valid in http://my.openehr.org/wsvn/ref_impl_eiffel/TRUNK/libraries/openehr/src/am/archetype/archetype.e?op=file&rev=0&sc=0

*_Ontology Package:_*

There are some operations that can’t be implemented based on the attributes that appear in the spec., operations like hasLanguage(), termDefinition(), constraintDefinition() need a language but we haven’t got a lang. (your implementation has a list of languages).

The current implementation is not up-to-date. On the other hand, this package leaves lots of space for the implementor to explore too. Take a look at the ADL specs and see what to expect from archetypes.

the Eiffel implementation may help - see http://my.openehr.org/wsvn/ref_impl_eiffel/TRUNK/libraries/openehr/src/am/archetype/ontology/archetype_ontology.e?op=file&rev=0&sc=0

1) Why those operations are implemented with things that not appear on the spec?

we only put things in the spec that needed to be standardised; possibly more functions from the Ontology class should go in the spec.

2) What are those operations for?

I cannot implement the “binding” operations either, because I don’t know where to find the bindings. Your implementation has some extra classes that don’t appear on the spec that may help with the binding, OntologyBinding, OntologyBindingItem, TermBindingItem and QueryBindingItem. What’s the need of those extra classes? Why don’t they appear on the spec? Why does the ArchetypeOntology.termBinding attribute, which is in your implementation, not appear on the spec?

have a look at the Eiffel version to get some ideas.

*_Archetype Package:_*

1) In Archetype.previousVersion() operation, how to find the previous version?, your implementation has a “todo” label with the same message.

It could be from an archetype repository in a controlled environment or simply specified from ArchetypeDescription.

it is the version of the parent archetype, extracted from the parent_archetype_id. We will make the documentation clearer about this....

2) should Archetype.conceptName() return Archetype.ontology.termDefinition(lang, this.conceptCode).toString(); ? why have you not implemented it? what is/will it be used for?

That looks fine. It could be used for finding the name of the concept in the given language.

correct.

3) The Archetype.conceptName() operation has to return Archetype.ontology.termDefinition(lang, this.conceptCode).toString?

4) The Archetype.isSpecialised() has to return parented != null?

That's right.

thanks for the feedback, that's how you get your name in the revision history;-)

- thomas beale

Thomas Beale wrote:

Rong Chen wrote:

Pablo Pazos wrote:

*_Primitive package:_*

1) What’s the meaning of the standardRepresentation() method of CPrimitive class? What’s the use of the standardRepresentation of a CPrimitive object? How can I find the standardRepresentation of a CPrimitive class?

It seems that the method standardRepresentation() should be defined in CPrimitiveObject instead.

this is correct. Probably it should be defined on C_OBJECT, in which case the implementation for most of the subtypes is trivial. I am working on this area of the model at the moment, so will treat this as a request for change, and come back with a proposed change to the document. For now, following Rong's advice is sensible.

Thomas,

The "Purpose" and "Use" of C_PRIMITIVE don't seem to be correct, most likely copy-and-pasted from those of C_BOOLEAN class. I found them on this version http://svn.openehr.org/specification/BRANCHES/Release-1.1-candidate/publishing/architecture/am/aom.pdf

Cheers,
Rong