dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #27541
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 13711: csd: add providerDirectory, add fake data for codedType/orgnization for now (to make it validate ...
------------------------------------------------------------
revno: 13711
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2014-01-14 16:03:54 +0700
message:
csd: add providerDirectory, add fake data for codedType/orgnization for now (to make it validate with CSD.xsd)
added:
dhis-2/dhis-web/dhis-web-api-fred/src/main/java/org/hisp/dhis/web/csd/domain/csd/ProviderDirectory.java
modified:
dhis-2/dhis-web/dhis-web-api-fred/src/main/java/org/hisp/dhis/web/csd/domain/csd/CodedType.java
dhis-2/dhis-web/dhis-web-api-fred/src/main/java/org/hisp/dhis/web/csd/domain/csd/Csd.java
dhis-2/dhis-web/dhis-web-api-fred/src/main/java/org/hisp/dhis/web/csd/domain/csd/Organization.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/CodedType.java'
--- dhis-2/dhis-web/dhis-web-api-fred/src/main/java/org/hisp/dhis/web/csd/domain/csd/CodedType.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/CodedType.java 2014-01-14 09:03:54 +0000
@@ -54,6 +54,13 @@
{
}
+ public CodedType( String code, String codingSchema, String value )
+ {
+ this.code = code;
+ this.codingSchema = codingSchema;
+ this.value = value;
+ }
+
public String getCode()
{
return code;
=== modified file 'dhis-2/dhis-web/dhis-web-api-fred/src/main/java/org/hisp/dhis/web/csd/domain/csd/Csd.java'
--- dhis-2/dhis-web/dhis-web-api-fred/src/main/java/org/hisp/dhis/web/csd/domain/csd/Csd.java 2014-01-14 04:30:06 +0000
+++ dhis-2/dhis-web/dhis-web-api-fred/src/main/java/org/hisp/dhis/web/csd/domain/csd/Csd.java 2014-01-14 09:03:54 +0000
@@ -49,6 +49,9 @@
@XmlElement( name = "facilityDirectory", namespace = "urn:ihe:iti:csd:2013" )
private FacilityDirectory facilityDirectory = new FacilityDirectory();
+ @XmlElement( name = "providerDirectory", namespace = "urn:ihe:iti:csd:2013" )
+ private ProviderDirectory providerDirectory = new ProviderDirectory();
+
public Csd()
{
}
@@ -82,4 +85,14 @@
{
this.facilityDirectory = facilityDirectory;
}
+
+ public ProviderDirectory getProviderDirectory()
+ {
+ return providerDirectory;
+ }
+
+ public void setProviderDirectory( ProviderDirectory providerDirectory )
+ {
+ this.providerDirectory = providerDirectory;
+ }
}
=== modified file 'dhis-2/dhis-web/dhis-web-api-fred/src/main/java/org/hisp/dhis/web/csd/domain/csd/Organization.java'
--- dhis-2/dhis-web/dhis-web-api-fred/src/main/java/org/hisp/dhis/web/csd/domain/csd/Organization.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/Organization.java 2014-01-14 09:03:54 +0000
@@ -71,6 +71,11 @@
{
}
+ public Organization( String oid )
+ {
+ this.oid = oid;
+ }
+
public String getOid()
{
return oid;
=== added file 'dhis-2/dhis-web/dhis-web-api-fred/src/main/java/org/hisp/dhis/web/csd/domain/csd/ProviderDirectory.java'
--- dhis-2/dhis-web/dhis-web-api-fred/src/main/java/org/hisp/dhis/web/csd/domain/csd/ProviderDirectory.java 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-api-fred/src/main/java/org/hisp/dhis/web/csd/domain/csd/ProviderDirectory.java 2014-01-14 09:03:54 +0000
@@ -0,0 +1,42 @@
+package org.hisp.dhis.web.csd.domain.csd;
+
+/*
+ * Copyright (c) 2004-2013, University of Oslo
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * Neither the name of the HISP project nor the names of its contributors may
+ * be used to endorse or promote products derived from this software without
+ * specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRootElement;
+
+/**
+ * @author Morten Olav Hansen <mortenoh@xxxxxxxxx>
+ */
+@XmlAccessorType( XmlAccessType.FIELD )
+@XmlRootElement( name = "providerDirectory", namespace = "urn:ihe:iti:csd:2013" )
+public class ProviderDirectory
+{
+}
=== 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 08:45:43 +0000
+++ dhis-2/dhis-web/dhis-web-api-fred/src/main/java/org/hisp/dhis/web/csd/webapi/CsdController.java 2014-01-14 09:03:54 +0000
@@ -31,8 +31,10 @@
import org.hisp.dhis.organisationunit.OrganisationUnit;
import org.hisp.dhis.organisationunit.OrganisationUnitService;
import org.hisp.dhis.web.csd.domain.Envelope;
+import org.hisp.dhis.web.csd.domain.csd.CodedType;
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.Organization;
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;
@@ -90,7 +92,7 @@
for ( OrganisationUnit organisationUnit : organisationUnits )
{
Facility facility = new Facility();
- facility.setOid( organisationUnit.getUid() ); // TODO use code for OID?
+ facility.setOid( "1.3.6.1.4.1.21367.200.99.11" ); // TODO use code for OID?
facility.getOtherID().add( new OtherID( organisationUnit.getUid(), "dhis2-uid" ) );
@@ -99,8 +101,14 @@
facility.getOtherID().add( new OtherID( organisationUnit.getCode(), "dhis2-code" ) );
}
+ CodedType fakeCodedType = new CodedType( "103-110", "1.3.6.1.4.1.21367.100.1", "Radiology - Imaging Services" );
+ facility.getCodedTypes().add( fakeCodedType );
+
facility.setPrimaryName( organisationUnit.getDisplayName() );
+ Organization organization = new Organization("1.3.6.1.4.1.21367.200.99.1");
+ facility.getOrganizations().add( organization );
+
Record record = new Record();
record.setCreated( organisationUnit.getCreated() );
record.setUpdated( organisationUnit.getLastUpdated() );