← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 13710: csd: minor fix

 

------------------------------------------------------------
revno: 13710
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2014-01-14 15:45:43 +0700
message:
  csd: minor fix
modified:
  dhis-2/dhis-web/dhis-web-api-fred/src/main/java/org/hisp/dhis/web/csd/domain/csd/AddressLine.java
  dhis-2/dhis-web/dhis-web-api-fred/src/main/java/org/hisp/dhis/web/csd/webapi/CsdController.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-web/dhis-web-api-fred/src/main/java/org/hisp/dhis/web/csd/domain/csd/AddressLine.java'
--- dhis-2/dhis-web/dhis-web-api-fred/src/main/java/org/hisp/dhis/web/csd/domain/csd/AddressLine.java	2014-01-14 08:36:11 +0000
+++ dhis-2/dhis-web/dhis-web-api-fred/src/main/java/org/hisp/dhis/web/csd/domain/csd/AddressLine.java	2014-01-14 08:45:43 +0000
@@ -30,7 +30,7 @@
 
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlAttribute;
 import javax.xml.bind.annotation.XmlRootElement;
 import javax.xml.bind.annotation.XmlValue;
 
@@ -41,11 +41,11 @@
 @XmlRootElement( name = "addressLine", namespace = "urn:ihe:iti:csd:2013" )
 public class AddressLine
 {
-    @XmlElement( name = "component", namespace = "urn:ihe:iti:csd:2013" )
+    @XmlAttribute( name = "component" )
     private String component;
 
     @XmlValue
-    private String body;
+    private String value;
 
     public AddressLine()
     {
@@ -60,4 +60,14 @@
     {
         this.component = component;
     }
+
+    public String getValue()
+    {
+        return value;
+    }
+
+    public void setValue( String value )
+    {
+        this.value = value;
+    }
 }

=== modified file 'dhis-2/dhis-web/dhis-web-api-fred/src/main/java/org/hisp/dhis/web/csd/webapi/CsdController.java'
--- dhis-2/dhis-web/dhis-web-api-fred/src/main/java/org/hisp/dhis/web/csd/webapi/CsdController.java	2014-01-14 04:30:06 +0000
+++ dhis-2/dhis-web/dhis-web-api-fred/src/main/java/org/hisp/dhis/web/csd/webapi/CsdController.java	2014-01-14 08:45:43 +0000
@@ -33,6 +33,7 @@
 import org.hisp.dhis.web.csd.domain.Envelope;
 import org.hisp.dhis.web.csd.domain.csd.Csd;
 import org.hisp.dhis.web.csd.domain.csd.Facility;
+import org.hisp.dhis.web.csd.domain.csd.OtherID;
 import org.hisp.dhis.web.csd.domain.csd.Record;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpStatus;
@@ -89,7 +90,15 @@
         for ( OrganisationUnit organisationUnit : organisationUnits )
         {
             Facility facility = new Facility();
-            facility.setOid( organisationUnit.getUid() );
+            facility.setOid( organisationUnit.getUid() ); // TODO use code for OID?
+
+            facility.getOtherID().add( new OtherID( organisationUnit.getUid(), "dhis2-uid" ) );
+
+            if ( organisationUnit.getCode() != null )
+            {
+                facility.getOtherID().add( new OtherID( organisationUnit.getCode(), "dhis2-code" ) );
+            }
+
             facility.setPrimaryName( organisationUnit.getDisplayName() );
 
             Record record = new Record();