Hi Thomas,
I am implementing Date_types.basic package and trying to create a test
C_DV_STATE with the medication order sample on p11 of openEHR Archetype
Profile document, rev1.0.
What I found is it is not possible to create the last state 'COMPLETED'
if the invariant of STATE class "Transitions_valid: transitions /= Void
and then not transitions.is_empty" is in place. Since it is the end
state, there is no more transition for that state. Should the invariant
be changed to "Transitions_valid: transitions /= Void *implies* not
transitions.is_empty"? Or I misunderstood something??
Regards,
Rong
Rong Chen wrote:
Hi Thomas,
I am implementing Date_types.basic package and trying to create a test
C_DV_STATE with the medication order sample on p11 of openEHR Archetype
Profile document, rev1.0.
What I found is it is not possible to create the last state 'COMPLETED'
if the invariant of STATE class "Transitions_valid: transitions /= Void
and then not transitions.is_empty" is in place. Since it is the end
state, there is no more transition for that state. Should the invariant
be changed to "Transitions_valid: transitions /= Void *implies* not
transitions.is_empty"? Or I misunderstood something??
yes - that is what it should read....thanks for the fix....
- thomas
Rong Chen wrote:
Hi Thomas,
I am implementing Date_types.basic package and trying to create a test
C_DV_STATE with the medication order sample on p11 of openEHR Archetype
Profile document, rev1.0.
What I found is it is not possible to create the last state 'COMPLETED'
if the invariant of STATE class "Transitions_valid: transitions /= Void
and then not transitions.is_empty" is in place. Since it is the end
state, there is no more transition for that state. Should the invariant
be changed to "Transitions_valid: transitions /= Void *implies* not
transitions.is_empty"? Or I misunderstood something??
actually, a better model would be to have an abstract class STATE, and
two concrete classes: TERMINAL_STATE and NON_TERMINAL_STATE. Then the
model falls out cleanly. Or we can remain with the current model and
change "transitions" to being 0..* and change the invariant to allow this.
- thomas
Thomas Beale wrote:
Rong Chen wrote:
Hi Thomas,
I am implementing Date_types.basic package and trying to create a test
C_DV_STATE with the medication order sample on p11 of openEHR Archetype
Profile document, rev1.0.
What I found is it is not possible to create the last state 'COMPLETED'
if the invariant of STATE class "Transitions_valid: transitions /= Void
and then not transitions.is_empty" is in place. Since it is the end
state, there is no more transition for that state. Should the invariant
be changed to "Transitions_valid: transitions /= Void *implies* not
transitions.is_empty"? Or I misunderstood something??
actually, a better model would be to have an abstract class STATE, and
two concrete classes: TERMINAL_STATE and NON_TERMINAL_STATE. Then the
model falls out cleanly. Or we can remain with the current model and
change "transitions" to being 0..* and change the invariant to allow this.
The specification looks much better now. Thanks for the quick update!
There is a minor detail though, both classes inherit STATE now (as shown
in the UML), but it's not clear in the class description.
Cheers,
Rong