dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #27019
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 13396: removed fixed contact from Person model
------------------------------------------------------------
revno: 13396
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2013-12-23 11:11:55 +0100
message:
removed fixed contact from Person model
removed:
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/person/Contact.java
modified:
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/Person.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-12-23 10:01:36 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/person/AbstractPersonService.java 2013-12-23 10:11:55 +0000
@@ -202,13 +202,6 @@
person.setName( patient.getName() );
- Contact contact = new Contact();
-
- if ( contact.getPhoneNumber() != null )
- {
- person.setContact( contact );
- }
-
Collection<Relationship> relationshipsForPatient = relationshipService.getRelationshipsForPatient( patient );
for ( Relationship relationshipPatient : relationshipsForPatient )
=== removed file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/person/Contact.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/person/Contact.java 2013-09-17 12:15:39 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/person/Contact.java 1970-01-01 00:00:00 +0000
@@ -1,86 +0,0 @@
-package org.hisp.dhis.dxf2.events.person;
-
-/*
- * 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 com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
-import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
-import org.hisp.dhis.common.DxfNamespaces;
-
-/**
- * @author Morten Olav Hansen <mortenoh@xxxxxxxxx>
- */
-@JacksonXmlRootElement( localName = "contact", namespace = DxfNamespaces.DXF_2_0 )
-public class Contact
-{
- private String phoneNumber;
-
- public Contact()
- {
- }
-
- @JsonProperty( required = true )
- @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
- public String getPhoneNumber()
- {
- return phoneNumber;
- }
-
- public void setPhoneNumber( String phoneNumber )
- {
- this.phoneNumber = phoneNumber;
- }
-
- @Override
- public boolean equals( Object o )
- {
- if ( this == o ) return true;
- if ( o == null || getClass() != o.getClass() ) return false;
-
- Contact contact = (Contact) o;
-
- if ( phoneNumber != null ? !phoneNumber.equals( contact.phoneNumber ) : contact.phoneNumber != null ) return false;
-
- return true;
- }
-
- @Override
- public int hashCode()
- {
- return phoneNumber != null ? phoneNumber.hashCode() : 0;
- }
-
- @Override
- public String toString()
- {
- return "Contact{" +
- "phoneNumber='" + phoneNumber + '\'' +
- '}';
- }
-}
=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/person/Person.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/person/Person.java 2013-12-16 04:27:26 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/person/Person.java 2013-12-23 10:11:55 +0000
@@ -49,8 +49,6 @@
private String name;
- private Contact contact;
-
private List<Relationship> relationships = new ArrayList<Relationship>();
private List<Identifier> identifiers = new ArrayList<Identifier>();
@@ -99,18 +97,6 @@
@JsonProperty
@JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
- public Contact getContact()
- {
- return contact;
- }
-
- public void setContact( Contact contact )
- {
- this.contact = contact;
- }
-
- @JsonProperty
- @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
public List<Relationship> getRelationships()
{
return relationships;
@@ -156,8 +142,6 @@
Person person1 = (Person) o;
if ( attributes != null ? !attributes.equals( person1.attributes ) : person1.attributes != null )
return false;
- if ( contact != null ? !contact.equals( person1.contact ) : person1.contact != null )
- return false;
if ( identifiers != null ? !identifiers.equals( person1.identifiers ) : person1.identifiers != null )
return false;
if ( name != null ? !name.equals( person1.name ) : person1.name != null )
@@ -178,7 +162,6 @@
int result = person != null ? person.hashCode() : 0;
result = 31 * result + (orgUnit != null ? orgUnit.hashCode() : 0);
result = 31 * result + (name != null ? name.hashCode() : 0);
- result = 31 * result + (contact != null ? contact.hashCode() : 0);
result = 31 * result + (relationships != null ? relationships.hashCode() : 0);
result = 31 * result + (identifiers != null ? identifiers.hashCode() : 0);
result = 31 * result + (attributes != null ? attributes.hashCode() : 0);
@@ -188,8 +171,13 @@
@Override
public String toString()
{
- return "Person{" + "person='" + person + '\'' + ", orgUnit='" + orgUnit + '\'' + ", name='" + name + '\''
- + ", contact=" + contact + ", relationships=" + relationships + ", identifiers=" + identifiers
- + ", attributes=" + attributes + '}';
+ return "Person{" +
+ "person='" + person + '\'' +
+ ", orgUnit='" + orgUnit + '\'' +
+ ", name='" + name + '\'' +
+ ", relationships=" + relationships +
+ ", identifiers=" + identifiers +
+ ", attributes=" + attributes +
+ '}';
}
}