[OpenVPMS Developers] New Patient Rules / Demographic u pdates
I'm not familiar enough with eclipse and following the developer docs I get build fails of the unmodified latest revision , so I wasnt sure how to go about suggesting some additions. That being said I am quite comfortable with code.
I didnt try committing changes because I wasnt able to testbuild.
I wanted to add a new demographic update that would set a patient as inactive.
My reasons for requiring such a change are as follows.
In some cases a patient will be set as inactive following a visit and charge.
1. The patient has completed a course of treatment and is returning to his regular vet.
2. The patient is undergoing export to another country and is undergoing a final export check. In this instance the update would occur as the patient was charged the final export visit.
Having a demographic update to set patients as inactive would support this.
my additions to code were as follows:
/note:I wasnt sure whether a testcase was needed for invoice creation I didnt see one for setDeceased/
------------------------------------------------------------------------------ svn://svn.openvpms.org/openvpms/archetypes/trunk/src/java/org/openvpms/archetype/function/party/PartyFunctions.java
changes
Addition at Line 273
> /** * Marks a patient as being inactive. * * >@param patient the patient */ public void >setPatientInactive(Party patient) { >getPatientRules().setInactive(patient); } ------------------------------------------------------------------------------ svn://svn.openvpms.org/openvpms/archetypes/trunk/src/java/org/openvpms/archetype/rules/patient/PatientRules.java
changes:
Addition at Line 320
>/** * Marks a patient as being inactive. * * @param >patient the patient * @throws ArchetypeServiceException for any >archetype service error */ public void setInactive(Party >patient) { IMObjectBean bean = factory.createBean(patient); > if (bean.getBoolean("active")) { >bean.setValue("active", false); bean.save(); } > }
------------------------------------------------------------------------------ /adding patient testcase / svn://svn.openvpms.org/openvpms/archetypes/trunk/src/test/java/org/openvpms/archetype/rules/patient/PatientRulesTestCase.java /** * Tests the {@link PatientRules#setInactive(Party)} methods. */ public void testInactive() { Party patient = TestHelper.createPatient(false); assertTrue(bean.getBoolean("active")); rules.setInactive(patient); assertTrue(bean.getBoolean("active")); } ------------------------------------------------------------------------------ added to base.xml in svn://svn.openvpms.org/openvpms/release/trunk/src/import/data/base.xml
name="Patient Inactive" expression="party:setPatientInactive(.)" nodeName="party.entity" />
_______________________________________________ OpenVPMS Developers Mailing List developers@lists.openvpms.org To unsubscribe or change your subscription visit: http://lists.openvpms.org/listinfo/developers Posts from this mailing list can be viewed online and replied to in the OpenVPMS Developer's forum- http://tinyurl.com/openvdf