oship-dev team mailing list archive
-
oship-dev team
-
Mailing list archive
-
Message #01172
[Bug 606361] [NEW] several issues in class Element
Public bug reported:
Method __eq__ is not implemented correctly. It should return if two Element objects are equal according to some criterion and not whether an object is of type Element. The java implementers used equality of two elements based on the value attribute. I would prefer to use the attributes name and value.
It is advisable to use in the __hash__ method the same attributes used in __eq__. There are two hash(self.uid) in the method body. I'd rather remove both and use only name and value.
There are three invariants that are not enforced in the initializer:
Is_null_valid: is_null = (value = Void)
Null_flavour_indicated: is_null xor null_flavour = Void
Null_flavour_valid: is_null implies terminology(Terminology_id_openehr).has_code_for_group_id
(Group_id_null_flavour, null_flavour.defining_code)
Here we will have to use the internal openehr terminology service.
In the initializer, why no call the initializer of the superclass ?
** Affects: oship
Importance: High
Status: New
** Changed in: oship
Importance: Undecided => High
** Changed in: oship
Milestone: None => 1.5
--
several issues in class Element
https://bugs.launchpad.net/bugs/606361
You received this bug notification because you are a member of OSHIP
Development Team, which is subscribed to Open Source Health Information
Platform.
Status in Open Source Health Information Platform (OSHIP): New
Bug description:
Method __eq__ is not implemented correctly. It should return if two Element objects are equal according to some criterion and not whether an object is of type Element. The java implementers used equality of two elements based on the value attribute. I would prefer to use the attributes name and value.
It is advisable to use in the __hash__ method the same attributes used in __eq__. There are two hash(self.uid) in the method body. I'd rather remove both and use only name and value.
There are three invariants that are not enforced in the initializer:
Is_null_valid: is_null = (value = Void)
Null_flavour_indicated: is_null xor null_flavour = Void
Null_flavour_valid: is_null implies terminology(Terminology_id_openehr).has_code_for_group_id
(Group_id_null_flavour, null_flavour.defining_code)
Here we will have to use the internal openehr terminology service.
In the initializer, why no call the initializer of the superclass ?
Follow ups
References