Details
Description
When printing a label for a patient that has multiple patient-owner relationships, the owner shown on the drug label may not be the current or most recent relationship.
eg, If Pateint A has 2 relationships;
a) To Mr B Started 1/1/08 Ended 1/2/08
b) To Mrs C Started 2/2/08 to present
Mr B details are shown on label.
The issue seems to be due to the use of PatientRules.getOwner(Party patient) method instead of PatientRules.getOwner(Act act) method in the drug label template.
The former will pick up the incorrect relationship record (including location relationships that have valid dates). The later will pick up the correct owner relationship for the specified date
Need to refactor getOwner(Party) method to work correctly.
Fixed in archetype version 3202