← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2055: Activity plan mp customization added

 

------------------------------------------------------------
revno: 2055
committer: Namrata
branch nick: trunk
timestamp: Tue 2010-06-29 16:32:28 +0530
message:
  Activity plan mp customization added
modified:
  local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/activeplan/action/ActivePlanReportsResultAction.java
  local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/portal/action/PortalReportsResultAction.java
  local/in/dhis-web-reports-national/src/main/resources/META-INF/dhis/beans.xml
  local/in/dhis-web-reports-national/src/main/resources/struts.xml


--
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 'local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/activeplan/action/ActivePlanReportsResultAction.java'
--- local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/activeplan/action/ActivePlanReportsResultAction.java	2010-06-23 10:34:50 +0000
+++ local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/activeplan/action/ActivePlanReportsResultAction.java	2010-06-29 11:02:28 +0000
@@ -70,11 +70,16 @@
 import com.opensymphony.xwork2.Action;
 import java.util.HashSet;
 import jxl.write.Label;
-import jxl.write.Number;
 import jxl.write.WritableCell;
 import org.hisp.dhis.dataelement.DataElement;
+import org.hisp.dhis.patient.PatientIdentifier;
+import org.hisp.dhis.patient.PatientIdentifierType;
+import org.hisp.dhis.patient.PatientIdentifierTypeService;
 import org.hisp.dhis.patientattributevalue.PatientAttributeValue;
 import org.hisp.dhis.patientdatavalue.PatientDataValue;
+import org.hisp.dhis.relationship.Relationship;
+import org.hisp.dhis.relationship.RelationshipService;
+import org.hisp.dhis.relationship.RelationshipTypeService;
 
 public class ActivePlanReportsResultAction implements Action
 {
@@ -84,6 +89,20 @@
     // Dependencies
     // -------------------------------------------------------------------------
 
+    private RelationshipService relationshipService;
+
+    public void setRelationshipService( RelationshipService relationshipService )
+    {
+        this.relationshipService = relationshipService;
+    }
+
+    RelationshipTypeService relationshipTypeService;
+
+    public void setRelationshipTypeService( RelationshipTypeService relationshipTypeService )
+    {
+        this.relationshipTypeService = relationshipTypeService;
+    }
+
     private StatementManager statementManager;
 
     public void setStatementManager( StatementManager statementManager )
@@ -163,12 +182,12 @@
 
     private ProgramService programService;
 
-    public void setProgramService(ProgramService programService) 
+    public void setProgramService( ProgramService programService )
     {
-		this.programService = programService;
-	}
+        this.programService = programService;
+    }
 
-	private ProgramInstanceService programInstanceService;
+    private ProgramInstanceService programInstanceService;
 
     public void setProgramInstanceService( ProgramInstanceService programInstanceService )
     {
@@ -196,6 +215,13 @@
         this.patientIdentifierService = patientIdentifierService;
     }
 
+    private PatientIdentifierTypeService patientIdentifierTypeService;
+
+    public void setPatientIdentifierTypeService( PatientIdentifierTypeService patientIdentifierTypeService )
+    {
+        this.patientIdentifierTypeService = patientIdentifierTypeService;
+    }
+
     private PatientAttributeValueService patientAttributeValueService;
 
     public void setPatientAttributeValueService( PatientAttributeValueService patientAttributeValueService )
@@ -424,12 +450,12 @@
         colList = new ArrayList<Integer>();
         System.out.println( "startDate = " + startDate + " endDate = " + endDate + " reportname  = " + reportFileNameTB );
         Calendar c = Calendar.getInstance();
-        c.setTime(format.parseDate(startDate));
-        c.add(Calendar.DATE, -1);  // number of days to add
-        startDate = format.formatDate(c.getTime());  // dt is now the new date
-        c.setTime(format.parseDate(endDate));
-        c.add(Calendar.DATE, 1);  // number of days to add
-        endDate = format.formatDate(c.getTime());  // dt is now the new date
+        c.setTime( format.parseDate( startDate ) );
+        c.add( Calendar.DATE, -1 );  // number of days to add
+        startDate = format.formatDate( c.getTime() );  // dt is now the new date
+        c.setTime( format.parseDate( endDate ) );
+        c.add( Calendar.DATE, 1 );  // number of days to add
+        endDate = format.formatDate( c.getTime() );  // dt is now the new date
         sDate = format.parseDate( startDate );
         eDate = format.parseDate( endDate );
         inputTemplatePath = System.getenv( "DHIS2_HOME" ) + File.separator + raFolderName + File.separator + "template" + File.separator + reportFileNameTB;
@@ -462,7 +488,7 @@
 
         // OrgUnit Related Info
         selectedOrgUnit = new OrganisationUnit();
-       // System.out.println("______________ " + reportLevelTB);
+        // System.out.println("______________ " + reportLevelTB);
         selectedOrgUnit = organisationUnitService.getOrganisationUnit( ouIDTB );
 
         //Collection<PatientIdentifier> patientIdentifiers = patientIdentifierService.getPatientIdentifiersByOrgUnit( selectedOrgUnit );
@@ -473,7 +499,7 @@
         // Getting Programs
         rowCount = 0;
         List<String> deCodesList = getDECodes( deCodesXMLFileName );
-        Program curProgram = programService.getProgram( Integer.parseInt( reportLevelTB ));
+        Program curProgram = programService.getProgram( Integer.parseInt( reportLevelTB ) );
 //		/System.out.println( "curProgram = " + curProgram.getName() );
         String tempStr = "";
 
@@ -496,12 +522,10 @@
                 if ( sType.equalsIgnoreCase( "rowStart" ) )
                 {
                     rowStart = Integer.parseInt( deCodeString );
-                }
-                else if ( deCodeString.equalsIgnoreCase( "FACILITY" ) )
+                } else if ( deCodeString.equalsIgnoreCase( "FACILITY" ) )
                 {
                     tempStr = selectedOrgUnit.getShortName();
-                }
-                else if ( deCodeString.equalsIgnoreCase( "FACILITYP" ) )
+                } else if ( deCodeString.equalsIgnoreCase( "FACILITYP" ) )
                 {
                     OrganisationUnit orgUnitP = new OrganisationUnit();
                     orgUnitP = selectedOrgUnit.getParent();
@@ -509,8 +533,7 @@
                     {
                         tempStr = orgUnitP.getName();
                     }
-                } 
-                else if ( deCodeString.equalsIgnoreCase( "FACILITYPP" ) )
+                } else if ( deCodeString.equalsIgnoreCase( "FACILITYPP" ) )
                 {
                     OrganisationUnit orgUnitP = new OrganisationUnit();
                     OrganisationUnit orgUnitPP = new OrganisationUnit();
@@ -523,28 +546,23 @@
                             tempStr = orgUnitPP.getName();
                         }
                     }
-                } 
-                else if ( deCodeString.equalsIgnoreCase( "NA" ) )
+                } else if ( deCodeString.equalsIgnoreCase( "NA" ) )
                 {
                     tempStr = " ";
-                }
-                else if ( deCodeString.equalsIgnoreCase( "PERIOD-MONTH" ) )
+                } else if ( deCodeString.equalsIgnoreCase( "PERIOD-MONTH" ) )
                 {
                     //sheet0.addCell(new Label(tempColNo, tempRowNo, simpleDateFormat.format(startDate.getStartDate()), wCellformat));
-                }
-                else if ( sType.equalsIgnoreCase( "programStages" ) )
+                } else if ( sType.equalsIgnoreCase( "programStages" ) )
                 {
                     String[] stages = deCodeString.split( "," );
                     for ( String stage : stages )
                     {
                         programStagesList.add( programStageService.getProgramStage( Integer.parseInt( stage ) ) );
                     }
-                }
-                else if ( sType.equalsIgnoreCase( "immunizationPS" ) )
+                } else if ( sType.equalsIgnoreCase( "immunizationPS" ) )
                 {
                     psDeIds = deCodeString;
-                } 
-                else if ( sType.equalsIgnoreCase( "caseAttributeVillage" ) )
+                } else if ( sType.equalsIgnoreCase( "caseAttributeVillage" ) )
                 {
                     villageAttrId = Integer.parseInt( deCodeString );
                 }
@@ -664,13 +682,12 @@
             int mergeRowStart = 9 + rowCount;
             PatientAttribute villageAttribute = patientAttributeService.getPatientAttribute( villageAttrId );
 
-            if( villageAttribute != null && patientList != null && patientList.size() > 0 )
+            if ( villageAttribute != null && patientList != null && patientList.size() > 0 )
             {
                 sortedPatientList = patientService.sortPatientsByAttribute( patientList, villageAttribute );
-            }
-            else
+            } else
             {
-                sortedPatientList =  patientList;
+                sortedPatientList = patientList;
             }
 
             for ( Patient patient : sortedPatientList )
@@ -686,24 +703,30 @@
                 String deNotCollectedNames = "";
                 int ifaCount = 0;
                 int rowNo = rowStart + rowCount;
+                //System.out.println( "______________________________________________________________" +patient.getFullName() );
                 for ( ProgramStageInstance programStageInstance : psiList )
                 {
+                    //System.out.println( "*************************" +patient.getFullName() );
                     count1 = 0;
                     for ( String deCodeString : deCodesList )
                     {
+                        
                         tempStr = "";
                         String sType = (String) serviceType.get( count1 );
                         if ( sType.equalsIgnoreCase( "dataelement" ) )
                         {
-                            DataElement d1e = dataElementService.getDataElement( Integer.parseInt( deCodeString ) );
+                            if ( !deCodeString.equals( "NA" ) )
+                            {
+                                DataElement d1e = dataElementService.getDataElement( Integer.parseInt( deCodeString ) );
 
-                            PatientDataValue patientDataValue1 = patientDataValueService.getPatientDataValue( programStageInstance, d1e, selectedOrgUnit );
-                            if ( patientDataValue1 == null )
-                            {
-                                tempStr = " ";
-                            } else
-                            {
-                                tempStr = patientDataValue1.getValue();
+                                PatientDataValue patientDataValue1 = patientDataValueService.getPatientDataValue( programStageInstance, d1e, selectedOrgUnit );
+                                if ( patientDataValue1 == null )
+                                {
+                                    tempStr = " ";
+                                } else
+                                {
+                                    tempStr = patientDataValue1.getValue();
+                                }
                             }
 
                         } else if ( sType.equalsIgnoreCase( "caseProperty" ) )
@@ -712,22 +735,23 @@
                             if ( deCodeString.equalsIgnoreCase( "Name" ) )
                             {
                                 tempStr = patient.getFullName();
-                            }
-                            else if ( deCodeString.equalsIgnoreCase( "DOB" ) )
+                            } else if ( deCodeString.equalsIgnoreCase( "DOB" ) )
                             {
-                                        //_______________________DateOfBirth_______________________
-                                        Date patientDate = patient.getBirthDate();
-                                        SimpleDateFormat simpleDateFormat1 = new SimpleDateFormat( "yyyy-MM-dd" );
-                                        tempStr = simpleDateFormat1.format( patientDate );
+                                //_______________________DateOfBirth_______________________
+                                Date patientDate = patient.getBirthDate();
+                                SimpleDateFormat simpleDateFormat1 = new SimpleDateFormat( "yyyy-MM-dd" );
+                                tempStr = simpleDateFormat1.format( patientDate );
 
-                            } 
-                            else if ( deCodeString.equalsIgnoreCase( "Sex" ) )
-                            {
-                                            //______________________Sex_______________________
-                                            tempStr = patient.getGender();
+                            } else if ( deCodeString.equalsIgnoreCase( "Sex" ) )
+                            {
+                                //______________________Sex_______________________
+                                tempStr = patient.getGender();
+                            } else if ( deCodeString.equalsIgnoreCase( "Age" ) )
+                            {
+                                //______________________Sex_______________________
+                                tempStr = patient.getAge();
                             }
-                        } 
-                        else if ( sType.equalsIgnoreCase( "caseAttribute" ) )
+                        } else if ( sType.equalsIgnoreCase( "caseAttribute" ) )
                         {
                             int deCodeInt = Integer.parseInt( deCodeString );
 
@@ -736,49 +760,82 @@
                             if ( patientAttributeValue != null )
                             {
                                 tempStr = patientAttributeValue.getValue();
-                            }
-                            else
+                            } else
                             {
                                 tempStr = " ";
                             }
-                        }
-                        else if ( sType.equalsIgnoreCase( "caseAttributeMFName" ) || sType.equalsIgnoreCase( "caseAttributePN" ) )
-                        {
-                            int deCodeInt = Integer.parseInt( deCodeString );
+                        } else if ( sType.equalsIgnoreCase( "identifiertype" ) )
+                        {
+                            int deCodeInt = Integer.parseInt( deCodeString );
+                            //_______________________Id. no._______________________
+                            PatientIdentifierType patientIdentifierType = patientIdentifierTypeService.getPatientIdentifierType( deCodeInt );
+                            if ( patientIdentifierType != null )
+                            {
+                                PatientIdentifier patientIdentifier = patientIdentifierService.getPatientIdentifier( patientIdentifierType, patient );
+                                if ( patientIdentifier != null )
+                                {
+                                    tempStr = patientIdentifier.getIdentifier();
+                                } else
+                                {
+                                    tempStr = " ";
+                                }
+                            }
+                        } else if ( sType.equalsIgnoreCase( "relationshipType" ) )
+                        {
+                            int deCodeInt = Integer.parseInt( deCodeString );
+                            Patient representative = patient.getRepresentative();
+                            if ( representative != null )
+                            {
+                                System.out.println( representative + " " + patient + " " + relationshipTypeService.getRelationshipType( deCodeInt ) );
+                                Relationship parentRelationship = relationshipService.getRelationship( representative, patient, relationshipTypeService.getRelationshipType( deCodeInt ) );
+                                if ( parentRelationship != null )
+                                {
+                                    tempStr = representative.getFullName();
+                                }
+                                //System.out.println("Gender = "+gender + " temStr = "+tempStr);
+                            }
 
-                            PatientAttribute patientAttribute = patientAttributeService.getPatientAttribute( deCodeInt );
-                            PatientAttributeValue patientAttributeValue = patientAttributeValueService.getPatientAttributeValue( patient, patientAttribute );
-                            String mFname = "";
-                            if ( sType.equalsIgnoreCase( "caseAttributePN" ) )
-                            {
-                                mFname = patientAttributeValue.getValue();
-                                cAPhoneNumberName = mFname;
-                                            //System.out.println("name = "+name + " cAPhoneNumberName = "+cAPhoneNumberName);
-                            }
-                            else
-                            {
-                                mFname = patientAttributeValue.getValue();
-                                if ( cAPhoneNumberName.equals( "Mother" ) || cAPhoneNumberName.equals( "Father" ) )
-                                {
-                                    tempStr = mFname;
-                                }
-                            }
                         }// ended if of caseAttributeMFName
-                        else if ( sType.equalsIgnoreCase( "dataelementDueDate" ) )
+                        else if ( sType.equalsIgnoreCase( "HusbandPhoneNumber" ) || sType.equalsIgnoreCase( "HusbandName" ) )
+                        {
+                            int deCodeInt = Integer.parseInt( deCodeString );
+                            tempStr = patient.getMiddleName() + " " + patient.getLastName();
+                            if ( tempStr == null || tempStr.equals( "" ) )
+                            {
+                                PatientAttribute patientAttribute = patientAttributeService.getPatientAttribute( deCodeInt );
+                                PatientAttributeValue patientAttributeValue = patientAttributeValueService.getPatientAttributeValue( patient, patientAttribute );
+                                String husbandName = "";
+                                if ( patientAttributeValue != null )
+                                {
+                                    if ( patientAttributeValue.getValue() != null )
+                                    {
+                                        husbandName = patientAttributeValue.getValue();
+                                        cAPhoneNumberName = husbandName;
+                                        //System.out.println( " cAPhoneNumberName = " + cAPhoneNumberName );
+                                    }
+                                    if ( sType.equalsIgnoreCase( "caseAttributeHusband" ) )
+                                    {
+                                        husbandName = patientAttributeValue.getValue();
+                                        if ( cAPhoneNumberName.equals( "Husband" ) )
+                                        {
+                                            tempStr = husbandName;
+                                        }
+                                    }
+                                }
+                            }
+                        } else if ( sType.equalsIgnoreCase( "dataelementDueDate" ) )
                         {
                             Date dueDate = programStageInstance.getDueDate();
                             SimpleDateFormat simpleDateFormat1 = new SimpleDateFormat( "yyyy-MM-dd" );
                             tempStr = simpleDateFormat1.format( dueDate );
-                        }
-                        else if ( sType.equalsIgnoreCase( "srno" ) )
+                        } else if ( sType.equalsIgnoreCase( "srno" ) )
                         {
                             int tempNum = 1 + rowCount;
                             tempStr = String.valueOf( tempNum );
                             // System.out.println( "srno = " + tempNum + " " + tempStr );
-                        }
-                        else if ( sType.equalsIgnoreCase( "dataelementTT" ) || sType.equalsIgnoreCase( "dataelementTest" ) )
+                        } else if ( sType.equalsIgnoreCase( "dataelementTT" ) || sType.equalsIgnoreCase( "dataelementTest" ) )
                         {
-                            if(!deCodeString.equals( "NA"))
+                            if ( !deCodeString.equals( "NA" ) )
                             {
                                 tempStr = "";
                                 if ( deCodeString.contains( "," ) )
@@ -812,17 +869,15 @@
                                             if ( !tempStr.trim().equals( "" ) )
                                             {
                                                 tempStr = tempStr + " + " + dename;
-                                            }
-                                            else
+                                            } else
                                             {
                                                 tempStr = dename;
                                             }
 
                                         }
-                                     //System.out.println( "tempStr = " + tempStr );
+                                        //System.out.println( "tempStr = " + tempStr );
                                     }
-                                }
-                                else
+                                } else
                                 {
                                     DataElement d1e = dataElementService.getDataElement( Integer.parseInt( deCodeString ) );
                                     Collection<ProgramStageInstance> psisList = patientCompletedPSIList.get( patient );
@@ -848,25 +903,21 @@
                                         if ( !tempStr.trim().equals( "" ) )
                                         {
                                             tempStr = tempStr + " + " + dename;
-                                        }
-                                        else
+                                        } else
                                         {
                                             tempStr = dename;
                                         }
 
                                     }
                                 }
-                            }
-                            else
+                            } else
                             {
                                 tempStr = "";
                             }
-                        }
-                        else if ( sType.equalsIgnoreCase( "dataelementVisit" ) )
+                        } else if ( sType.equalsIgnoreCase( "dataelementVisit" ) )
                         {
                             tempStr = programStageInstance.getProgramStage().getName();
-                        }
-                        else if ( sType.equalsIgnoreCase( "dataelementIFA" ) )
+                        } else if ( sType.equalsIgnoreCase( "dataelementIFA" ) )
                         {
                             DataElement d1e = dataElementService.getDataElement( Integer.parseInt( deCodeString ) );
                             Collection<ProgramStageInstance> psisList = patientCompletedPSIList.get( patient );
@@ -886,22 +937,20 @@
                                         }
                                     }
                                 }
-                           }
+                            }
 
-                           if ( deCollectedNames.contains( dename ) )
-                           {
+                            if ( deCollectedNames.contains( dename ) )
+                            {
                                 //System.out.println( "ifaCount = " + ifaCount );
                                 if ( ifaCount <= 100 )
                                 {
                                     tempStr = String.valueOf( 100 - ifaCount );
-                                }
-                                else
+                                } else
                                 {
                                     tempStr = "";
                                 }
-                             }
-                        }
-                        else if ( sType.equalsIgnoreCase( "immunizationPS" ) )
+                            }
+                        } else if ( sType.equalsIgnoreCase( "immunizationPS" ) )
                         {
                             tempStr = "";
                             Set<DataElement> deList = programStageDEs.get( programStageInstance.getProgramStage() );
@@ -911,15 +960,13 @@
                                 if ( !tempStr.trim().equals( "" ) )
                                 {
                                     tempStr = tempStr + " + " + dename;
-                                }
-                                else
+                                } else
                                 {
                                     tempStr = dename;
                                 }
                             }
 
-                        } 
-                        else if ( sType.equalsIgnoreCase( "dataelementDueDate" ) )
+                        } else if ( sType.equalsIgnoreCase( "dataelementDueDate" ) )
                         {
                             SimpleDateFormat simpleDateFormat = new SimpleDateFormat( "yyyy-MM-dd" );
                             tempStr = simpleDateFormat.format( programStageInstance.getDueDate() );
@@ -932,13 +979,15 @@
                             int sheetNo = sheetList.get( count1 );
                             sheet0 = outputReportWorkbook.getSheet( sheetNo );
                             WritableCell cell = sheet0.getWritableCell( tempColNo, rowNo );
-                            //System.out.println( "tempColNo = " + tempColNo + " rowNo = " + rowNo + " value = " + tempStr );
+
+//                            /System.out.println( "tempColNo = " + tempColNo + " rowNo = " + rowNo + " value = " + tempStr );
                             sheet0.addCell( new Label( tempColNo, rowNo, tempStr, wCellformat ) );
                         }
                         count1++;
                     }//end of decodelist for loop
                     rowCount++;
                     rowNo++;
+                    //System.out.println( "______________________________________________________________" );
                 }
 
                 count2++;
@@ -956,14 +1005,18 @@
                         sheet0.mergeCells( 7, mergeRowStart, 7, mergeRowEnd );
 
                         //System.out.println( "______________________________________________________________" );
-                        System.out.println( "mergeRowStart = " + mergeRowStart + " merge row end = " + mergeRowEnd );
+                        //System.out.println( "mergeRowStart = " + mergeRowStart + " merge row end = " + mergeRowEnd );
                     } else
                     {
                         sheet0.mergeCells( 1, mergeRowStart, 1, mergeRowEnd );
                         sheet0.mergeCells( 2, mergeRowStart, 2, mergeRowEnd );
                         sheet0.mergeCells( 3, mergeRowStart, 3, mergeRowEnd );
+                        sheet0.mergeCells( 4, mergeRowStart, 4, mergeRowEnd );
+                        sheet0.mergeCells( 5, mergeRowStart, 5, mergeRowEnd );
+                        sheet0.mergeCells( 6, mergeRowStart, 6, mergeRowEnd );
+                        sheet0.mergeCells( 7, mergeRowStart, 7, mergeRowEnd );
                         //System.out.println( "______________________________________________________________" );
-                        System.out.println( "mergeRowStart = " + mergeRowStart + " merge row end = " + mergeRowEnd );
+                        //System.out.println( "mergeRowStart = " + mergeRowStart + " merge row end = " + mergeRowEnd );
                     }
                 }
                 mergeRowStart = mergeRowEnd + 1;

=== modified file 'local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/portal/action/PortalReportsResultAction.java'
--- local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/portal/action/PortalReportsResultAction.java	2010-06-23 10:34:50 +0000
+++ local/in/dhis-web-reports-national/src/main/java/org/hisp/dhis/reports/portal/action/PortalReportsResultAction.java	2010-06-29 11:02:28 +0000
@@ -73,6 +73,7 @@
 import com.opensymphony.xwork2.Action;
 import jxl.write.Label;
 import jxl.write.WritableCell;
+import org.dom4j.io.SAXReader;
 import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
 import org.hisp.dhis.patient.PatientIdentifier;
@@ -445,7 +446,7 @@
                     programStagesList = curProgram.getProgramStages();
                     int count1 = 0;
 
-                    // System.out.println( "Program = " + curProgram + " Program stages = " + programStagesList.size() );
+
                     Map<String, String> childPhoneNo = new HashMap<String, String>();
                     childPhoneNo.put( "Others", "Immediate Relations" );
                     childPhoneNo.put( "Neighbor", "Neighbor" );
@@ -461,6 +462,7 @@
                     dhisPortalMap.put( "Mother", "Relative" );
                     dhisPortalMap.put( "Father", "Relative" );
                     dhisPortalMap.put( "Husband", "Relative" );
+                    dhisPortalMap.put( "Self", "Self" );
 
                     //putting jsy beneficiary / rti/sti / complication / pnc checkup / breast feeded in map
                     dhisPortalMap.put( "true", "Yes" );
@@ -486,7 +488,7 @@
                     dhisPortalMap.put( "(Home non SBA)", "Non SBA" );
                     dhisPortalMap.put( "(Home SBA)", "SBA" );
                     //place of delivery public
-                    dhisPortalMap.put( "(Subcentre)", "Sub Centre" );
+                    dhisPortalMap.put( "(Sub Centre)", "Sub Centre" );
                     dhisPortalMap.put( "(PHC.)", "PHC" );
                     dhisPortalMap.put( "(CHC.)", "CH" );
                     dhisPortalMap.put( "(SDH.)", "SDH" );
@@ -518,7 +520,7 @@
                     dhisPortalMap.put( "(None)", "None" );
                     //pnc visit
                     dhisPortalMap.put( "(with in 7 days)", "Within 7 days" );
-                    dhisPortalMap.put( "(With in 48 hrs)", "Within 7 days" );
+                    dhisPortalMap.put( "(With in 48 hrs)", "Within 48 hours" );
                     //pnc complications
                     dhisPortalMap.put( "(None.)", "None" );
                     dhisPortalMap.put( "(Sepsis)", "Sepsis" );
@@ -548,6 +550,37 @@
                     mFNameMap.put( "Father", "Father's" );
                     mFNameMap.put( "Mother", "Mother's" );
 
+                    // <editor-fold defaultstate="collapsed" desc="Get all Maps">
+                  /*  File allMaps = new File( System.getProperty( "user.home" ) + File.separator + "dhis" + File.separator + raFolderName
+            + File.separator + "\\DhisPortalMap.xml");
+          if (allMaps.exists()) {
+                SAXReader reader = new SAXReader();
+                org.dom4j.Document document = reader.read(allMaps.toURI().toURL());
+                org.dom4j.Element root = document.getRootElement();
+                org.dom4j.XPath xpathSelector = new Dom4jXPath("//patientIDs/available");
+                List list = xpathSelector.selectNodes(document);
+                if (list.size() > 0) {
+                    if (list.size() < 50) {
+                        registerPatientModel.setMessage("Very Few IDs (" + list.size() + ") Left. Please Upload New IDs");
+                    }
+                    registerPatientModel.setIdentifierString(((Element) list.get(0)).getText());
+                    Element usedNode = (Element) list.get(0);
+                    String usedIdentifier = usedNode.getText();
+                    root.remove(usedNode);
+                    root.addElement("locked").addText(usedIdentifier);
+                    FileWriter fw = new FileWriter(availableIDs);
+                    OutputFormat format = OutputFormat.createPrettyPrint();
+                    XMLWriter writer = new XMLWriter(fw, format);
+                    writer.write(document);
+                    writer.close();
+                } else {
+                    registerPatientModel.setMessage("No Identifiers Left. Please Upload New IDs");
+                }
+            } else {
+                registerPatientModel.setMessage("AvailableIDs File Not Found. Please Upload Generated File from Options Page");
+            }*/
+            // </editor-fold>
+                    
                     //Checking whether there is stages or not.
                     if ( programStagesList == null || programStagesList.isEmpty() )
                     {

=== modified file 'local/in/dhis-web-reports-national/src/main/resources/META-INF/dhis/beans.xml'
--- local/in/dhis-web-reports-national/src/main/resources/META-INF/dhis/beans.xml	2010-06-23 10:34:50 +0000
+++ local/in/dhis-web-reports-national/src/main/resources/META-INF/dhis/beans.xml	2010-06-29 11:02:28 +0000
@@ -1532,8 +1532,7 @@
             <ref bean="org.hisp.dhis.patientdatavalue.PatientDataValueService"/>
         </property>
         <property name="patientAttributeValueService">
-            <ref
-        bean="org.hisp.dhis.patientattributevalue.PatientAttributeValueService"/>
+            <ref bean="org.hisp.dhis.patientattributevalue.PatientAttributeValueService"/>
         </property>
         <property name="patientAttributeService">
             <ref bean="org.hisp.dhis.patient.PatientAttributeService"/>
@@ -1553,6 +1552,15 @@
         <property name="programStageDataElementService">
             <ref bean="org.hisp.dhis.program.ProgramStageDataElementService"/>
         </property>
+        <property name="patientIdentifierTypeService">
+            <ref bean="org.hisp.dhis.patient.PatientIdentifierTypeService"/>
+        </property>
+        <property name="relationshipService">
+            <ref bean="org.hisp.dhis.relationship.RelationshipService"/>
+        </property>
+        <property name="relationshipTypeService">
+            <ref bean="org.hisp.dhis.relationship.RelationshipTypeService"/>
+        </property>
     </bean>
   
   <!-- NBITS : Portal Reports -->

=== modified file 'local/in/dhis-web-reports-national/src/main/resources/struts.xml'
--- local/in/dhis-web-reports-national/src/main/resources/struts.xml	2010-06-19 09:47:35 +0000
+++ local/in/dhis-web-reports-national/src/main/resources/struts.xml	2010-06-29 11:02:28 +0000
@@ -63,7 +63,7 @@
 			<result name="success" type="velocity">/main.vm</result>
 			<param name="page">/dhis-web-reports/activePlanReportsForm.vm</param>
 			<param name="menu">/dhis-web-reports/menuWithTreeForActivePlan.vm</param>
-			<param name="javascripts">../dhis-web-commons/ouwt/ouwt.js,../dhis-web-commons/lists/lists.js,javascript/reports.js,javascript/hashtable.js</param>
+			<param name="javascripts">../dhis-web-commons/ouwt/ouwt.js,../dhis-web-commons/calendar/calendar.js,../dhis-web-commons/calendar/calendar-lang.js,../dhis-web-commons/calendar/calendar-setup.js,../dhis-web-commons/lists/lists.js,javascript/reports.js,javascript/hashtable.js</param>
 			<param name="stylesheets">css/StylesForTags.css</param>
 		    <interceptor-ref name="organisationUnitTreeStack"/>
 	</action>