[OpenVPMS Developers] [JIRA] (ARCH-56) Add party:setPatientInactive() xpath function

Message from Tim Anderson (Created) (JIRA) jira@openvpms.org

Add party:setPatientInactive() xpath function ---------------------------------------------

Key: ARCH-56 URL: https://openvpms.atlassian.net/browse/ARCH-56 Project: Archetypes Issue Type: New Feature Affects Versions: 1.5 Reporter: Tim Anderson Assignee: Tim Anderson Priority: Minor Fix For: 1.6

Originally from: http://www.openvpms.org/forum/new-patient-rules-demographic-updates

{quote} 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

{code}

/** * Marks a patient as being inactive. * * @param patient the patient */ public void setPatientInactive(Party patient) { getPatientRules().setInactive(patient); }

{code} svn://svn.openvpms.org/openvpms/archetypes/trunk/src/java/org/openvpms/archetype/rules/patient/PatientRules.java

changes:

Addition at Line 320

{code} /** * 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(); } } {code}

adding patient testcase

svn://svn.openvpms.org/openvpms/archetypes/trunk/src/test/java/org/openvpms/archetype/rules/patient/PatientRulesTestCase.java

{code} /** * 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")); } {code}

added to base.xml in svn://svn.openvpms.org/openvpms/release/trunk/src/import/data/base.xml

{code} {code}

{quote}

-- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://openvpms.atlassian.net/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira

_______________________________________________ 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

Syndicate content