Type: New Feature
Affects Version/s: None
Fix Version/s: OpenMRS 1.5.0
A number of discussions seem to have concluded that it would be a nice feature to refactor some base interfaces and objects out of our core API. This would allow us to act consistently across our object model, and create some useful services that can be re-usable across objects.
As a starting point, I am proposing the following changes, which can be viewed in the attached patch. Once we come to a consensus on this, we can implement it (or whatever we decide upon) across our model objects.
4 core interfaces:
- OpenmrsObject - get/set id
- Voidable - get/set voided, voidedBy, dateVoided, voidReason
- Retireable - get/set retired, retiredBy, dateRetired, retireReason
- Auditable - get/set creator, dateCreated, changedBy, dateChanged
2 abstract implementations (with property getters and setters implemented):
- implements OpenmrsObject, Auditable, Voidable
- Patient, Obs, Encounter, etc would inherit from this
- OpenmrsMetadata (abstract)
- implements OpenmrsObject, Auditable, Retireable
- get/set name, description (localize these later?)
- EncounterType, OrderType, etc would inherit from this.
Useful utilities could later be discussed for generally setting the relevent properties on a Retireable, Auditable, Voidable, etc., rather than having every service handle this same code repeatedly...
Feedback / thoughts / discussion?