← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2056: Redirected to EnrollmentPage once added new Patient

 

------------------------------------------------------------
revno: 2056
committer: HISP <HISP@HISP-PC>
branch nick: trunk
timestamp: Tue 2010-06-29 19:03:33 +0530
message:
  Redirected to EnrollmentPage once added new Patient
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientService.java
  dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/DefaultPatientService.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patient/AddPatientAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/struts.xml
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addPatientForm.vm
  local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dashboard/ta/action/GenerateTabularAnalysisFormAction.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-api/src/main/java/org/hisp/dhis/patient/PatientService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientService.java	2010-04-06 06:38:04 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientService.java	2010-06-29 13:33:33 +0000
@@ -95,7 +95,7 @@
 
     int countnGetPatientsByNames( String name );
 
-    void createPatient( Patient patient, OrganisationUnit orgUnit, Integer representativeId,
+    int createPatient( Patient patient, OrganisationUnit orgUnit, Integer representativeId,
         Integer relationshipTypeId, List<PatientAttributeValue> patientAttributeValues );
 
     public void updatePatient( Patient patient, OrganisationUnit orgUnit, Integer representativeId,

=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/DefaultPatientService.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/DefaultPatientService.java	2010-05-27 08:42:06 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/DefaultPatientService.java	2010-06-29 13:33:33 +0000
@@ -330,11 +330,11 @@
         return patientStore.getPatientsByNames( name, min, max );
     }
    
-    public void createPatient( Patient patient, OrganisationUnit orgUnit, Integer representativeId,
+    public int createPatient( Patient patient, OrganisationUnit orgUnit, Integer representativeId,
         Integer relationshipTypeId,  List<PatientAttributeValue> patientAttributeValues ) 
     {
         
-        savePatient( patient );
+        int patientid = savePatient( patient );
 
         for( PatientAttributeValue pav : patientAttributeValues )
         {
@@ -370,6 +370,8 @@
             }
         }
         
+        return patientid;
+        
     }
     
     public void updatePatient( Patient patient, OrganisationUnit orgUnit, Integer representativeId,

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patient/AddPatientAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patient/AddPatientAction.java	2010-06-16 12:16:35 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patient/AddPatientAction.java	2010-06-29 13:33:33 +0000
@@ -110,7 +110,18 @@
     private String gender;
 
     private String bloodGroup;
+
+    // -------------------------------------------------------------------------
+    // OutPut
+    // -------------------------------------------------------------------------
     
+    private Integer id;
+
+    public Integer getId()
+    {
+        return id;
+    }
+
 
     // -------------------------------------------------------------------------
     // Input - others
@@ -298,7 +309,7 @@
         // Save patient
         //-------------------------------------------------------------------------
         
-            patientService.createPatient( patient, organisationUnit, representativeId,
+        id =  patientService.createPatient( patient, organisationUnit, representativeId,
                 relationshipTypeId,  patientAttributeValues );
 
         return SUCCESS;

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/struts.xml	2010-06-24 13:28:26 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/struts.xml	2010-06-29 13:33:33 +0000
@@ -405,7 +405,7 @@
 
 		<action name="addPatient"
 			class="org.hisp.dhis.patient.action.patient.AddPatientAction">
-			<result name="success" type="redirect">patientform.action</result>
+			<result name="success" type="chain">showProgramEnrollmentForm</result>
 			<param name="requiredAuthorities">F_PATIENT_ADD</param>
 		</action>
 

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addPatientForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addPatientForm.vm	2010-06-19 09:48:40 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addPatientForm.vm	2010-06-29 13:33:33 +0000
@@ -131,10 +131,15 @@
             #if($organisationUnit.code == "null")
                 #set($organisationUnit.code = "" );
             #end
-            <input type="text" id="orgunitcode" name="orgunitcode" disabled="disabled" value="$organisationUnit.code" maxlength="9" size="10"/>
-            -<input type="text" id="progcode" name="progcode" maxlength="1" size="1" class='idfield  #validate( "default"  $identifierType.mandatory ) '/>
-            -<input type="text" id="yearcode" name="yearcode" maxlength="2" size="2" value="$year" class="{validate:{required:true,minlength:2}}"/>
-            -<input type="text" id="benicode" name="benicode" maxlength="4" size="4" class="{validate:{required:true,minlength:4}}"/>
+				<table>
+					<tr align="center" valign="top">
+						<td><input type="text" id="orgunitcode" name="orgunitcode" disabled="disabled" value="$organisationUnit.code" maxlength="9" size="10"/> <br/> <font color="red">OrgUnit<br>Code</font></td>
+						<td> - <input type="text" id="progcode" name="progcode" maxlength="1" size="1" class='idfield  #validate( "default"  $identifierType.mandatory ) '/> <br/> <font color="red">Prg<br>Code</font></td>
+						<td> - <input type="text" id="yearcode" name="yearcode" maxlength="2" size="2" value="$year" class="{validate:{required:true,minlength:2}}"/> <br/> <font color="red">Year</font></td>
+						<td> - <input type="text" id="benicode" name="benicode" maxlength="4" size="4" class="{validate:{required:true,minlength:4}}"/> <br/> <font color="red">Benificiary<br>Code</font></td>
+						
+					</tr>
+				</table>
             </td>
         #else
             <td class="input-column"><input type="text" id="iden$identifierType.id" name="iden$identifierType.id"  data="{related:$identifierType.related}"  class='idfield  #validate( "default"  $identifierType.mandatory ) '/></td>

=== modified file 'local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dashboard/ta/action/GenerateTabularAnalysisFormAction.java'
--- local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dashboard/ta/action/GenerateTabularAnalysisFormAction.java	2010-06-04 11:50:05 +0000
+++ local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dashboard/ta/action/GenerateTabularAnalysisFormAction.java	2010-06-29 13:33:33 +0000
@@ -29,7 +29,6 @@
 
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
-import java.util.Collection;
 import java.util.Collections;
 import java.util.Date;
 import java.util.Iterator;
@@ -53,7 +52,6 @@
 import org.hisp.dhis.period.PeriodService;
 import org.hisp.dhis.period.PeriodType;
 import org.hisp.dhis.period.QuarterlyPeriodType;
-import org.hisp.dhis.period.RelativePeriodType;
 import org.hisp.dhis.period.SixMonthlyPeriodType;
 import org.hisp.dhis.period.TwoYearlyPeriodType;
 import org.hisp.dhis.period.WeeklyPeriodType;
@@ -224,7 +222,6 @@
             String pTName = ptIterator.next().getName();
             if ( pTName.equalsIgnoreCase( DailyPeriodType.NAME ) || pTName.equalsIgnoreCase( TwoYearlyPeriodType.NAME )
                 || pTName.equalsIgnoreCase( OnChangePeriodType.NAME )
-                || pTName.equalsIgnoreCase( RelativePeriodType.NAME )
                 || pTName.equalsIgnoreCase( WeeklyPeriodType.NAME ) )
             {
                 ptIterator.remove();