Downloads Documentation Community Contribute Demo






Show Sidebar
Login | Register

Changeset 4931

Show
Ignore:
Timestamp:
07/15/08 09:58:46 (4 months ago)
Author:
catullus
Message:

child-vct-report: fix to handle patients w/ unknown addresses

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • openmrs-modules/childvctreport2/.classpath

    r4497 r4931  
    66        <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> 
    77        <classpathentry kind="lib" path="metadata"/> 
    8         <classpathentry kind="lib" path="lib-common/junit-3.8.1.jar"/> 
    9         <classpathentry kind="lib" path="lib-common/commons-logging-1.0.4.jar"/> 
    10         <classpathentry kind="lib" path="lib-common/spring-2.0.jar"/> 
    11         <classpathentry kind="lib" path="lib-common/servlet-api.jar"/> 
    12         <classpathentry kind="lib" path="lib-common/hibernate3.jar"/> 
    13         <classpathentry kind="lib" path="lib-common/openmrs-api-1.2.04.4191.jar" sourcepath="/openmrs-sync"/> 
    14         <classpathentry kind="lib" path="lib-common/web-openmrs-api-1.2.04.4191.jar"/> 
     8        <classpathentry kind="lib" path="/openmrs-sync/lib/junit/junit-3.8.1.jar"/> 
     9        <classpathentry kind="lib" path="/openmrs-sync/lib/commons-logging/commons-logging-1.0.4.jar"/> 
     10        <classpathentry kind="lib" path="/openmrs-sync/lib/spring-framework/spring-2.5.1.jar"/> 
     11        <classpathentry kind="lib" path="/openmrs-sync/lib/tomcat/servlet-api.jar"/> 
     12        <classpathentry kind="lib" path="/openmrs-sync/lib/hibernate/hibernate325.jar"/> 
     13        <classpathentry kind="lib" path="/openmrs-sync/lib/spring-framework/spring-webmvc.jar" sourcepath="/openmrs-source/spring-webmvc-sources.zip"/> 
     14        <classpathentry kind="lib" path="/openmrs-sync/dist/openmrs-api-1.3.0.01.4866.jar"/> 
     15        <classpathentry kind="lib" path="/openmrs-sync/dist/web-openmrs-api-1.3.0.01.4866.jar"/> 
    1516        <classpathentry kind="output" path="build"/> 
    1617</classpath> 
  • openmrs-modules/childvctreport2/src/org/openmrs/module/childvctreportmodule/ChildVCTReportItem.java

    r4497 r4931  
    164164         
    165165        private void fillAddress(Patient parent) { 
    166                 PersonAddress address = parent.getAddresses().iterator().next(); 
    167                 reportColumns[DISTRICT_INDEX] = nullToUnknown(address.getCountyDistrict()); 
    168                 reportColumns[SECTOR_INDEX] = nullToUnknown(address.getCityVillage()); 
    169                 reportColumns[CELL_INDEX] = nullToUnknown(address.getNeighborhoodCell()); 
    170                 reportColumns[UMUDUGUDU_INDEX] = nullToUnknown(address.getAddress1()); 
     166                if (parent.getAddresses() != null && parent.getAddresses().iterator().hasNext()) { 
     167                        PersonAddress address = parent.getAddresses().iterator().next(); 
     168                        reportColumns[DISTRICT_INDEX] = nullToUnknown(address 
     169                                        .getCountyDistrict()); 
     170                        reportColumns[SECTOR_INDEX] = nullToUnknown(address 
     171                                        .getCityVillage()); 
     172                        reportColumns[CELL_INDEX] = nullToUnknown(address 
     173                                        .getNeighborhoodCell()); 
     174                        reportColumns[UMUDUGUDU_INDEX] = nullToUnknown(address 
     175                                        .getAddress1()); 
     176                } else { 
     177                        reportColumns[DISTRICT_INDEX] = "unknown"; 
     178                        reportColumns[SECTOR_INDEX] = "unknown"; 
     179                        reportColumns[CELL_INDEX] = "unknown"; 
     180                        reportColumns[UMUDUGUDU_INDEX] = "unknown"; 
     181                } 
    171182        } 
    172183