← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 12156: added back attributes to Person

 

------------------------------------------------------------
revno: 12156
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2013-09-19 09:57:50 +0200
message:
  added back attributes to Person
modified:
  dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/person/AbstractPersonService.java


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/person/AbstractPersonService.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/person/AbstractPersonService.java	2013-09-19 05:40:02 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/person/AbstractPersonService.java	2013-09-19 07:57:50 +0000
@@ -219,7 +219,18 @@
             Identifier identifier = new Identifier( identifierType, patientIdentifier.getIdentifier() );
             person.getIdentifiers().add( identifier );
         }
-        
+
+        Collection<PatientAttributeValue> patientAttributeValues = patientAttributeValueService.getPatientAttributeValues( patient );
+
+        for ( PatientAttributeValue patientAttributeValue : patientAttributeValues )
+        {
+            Attribute attribute = new Attribute();
+            attribute.setType( patientAttributeValue.getPatientAttribute().getUid() );
+            attribute.setValue( patientAttributeValue.getValue() );
+
+            person.getAttributes().add( attribute );
+        }
+
         return person;
     }