Correct rules in Patient Rules to cover the Patient Location relationship

Description

This patch corrects the PatientRules to allow JxPath to retrieve patient location information for reports.

Additional it corrects the methods used to retrieve references to customers (it was originally designed on the basis there would only ever be 1 active customer - relationship per patient)

It adds the following public methods to patientRules:

  • getLocation(Party patient) returns a Party Customer

  • getCurrentLocation(Act act) returns a Party Customer

  • getLocation(Party patient, Date startTime, boolean active) returns a Party Customer for a specific date.

  • isLocation(Party customer) returns a boolean that tests if a party patient has a customer as a location.

  • getLocationReference(Party patient) returns a refernence to a Party customer.

This is effectively a replication of the available public methods of patientOwner.

Can we please review the change in method for returning a reference the previous one would fail if a patient had a the Location or Owner reference declared earlier than the expected reference.

The patch includes changes to the tests.

Environment

None

Attachments

2
  • 26 May 2015, 03:50 AM
  • 13 Nov 2014, 07:48 AM

Activity

Show:

Tim Anderson May 27, 2015 at 3:31 AM

Thanks for the contribution.

Changes applied in revision 6610.

Ben Charlton May 26, 2015 at 3:52 AM

I removed the 2 functions that were not required but still changed the getOwnerReference function to exclude location refs.

Updated patch attached

Tim Anderson April 18, 2015 at 7:28 AM

Do you actually need the methods?

  • isLocation(Party customer)

  • getLocationReference(Party patient)

I realise they mirror the Owner methods, but if you don't use them, there's no point in their inclusion.

Ben Charlton November 13, 2014 at 7:48 AM

This adds

party:getPatientLocation(patient)
party:getPatientLocation(act)
party:getPatientCurrentLocation(act)

as well as adjusting the
getOwnerReference function in patientrules

Ben Charlton November 13, 2014 at 7:45 AM
Edited

I just meant we should add methods to access location. through jxpathh

Also the function

getOwnerReference in patient rules fails if the patient has a reference to location added before they have a reference to owner.

I added tests to show that failure.

I have changed the patch now to add the party functions

Fixed

Details

Assignee

Reporter

Labels

Time tracking

1.75h logged

Components

Fix versions

Affects versions

Priority

Who's Looking?

Open Who's Looking?

Created October 21, 2014 at 1:16 PM
Updated July 7, 2015 at 12:18 AM
Resolved May 27, 2015 at 3:31 AM
Who's Looking?