dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #16697
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 6410: (patient) Don't add/update patient with age.
------------------------------------------------------------
revno: 6410
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2012-03-28 15:26:44 +0700
message:
(patient) Don't add/update patient with age.
modified:
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/AddPatientAction.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/ProgramEnrollmentSelectAction.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/UpdatePatientAction.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/addPatientForm.vm
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientForm.vm
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/updatePatientForm.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/programstage/AddProgramStageAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/META-INF/dhis/beans.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 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/AddPatientAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/AddPatientAction.java 2012-03-27 04:22:51 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/AddPatientAction.java 2012-03-28 08:26:44 +0000
@@ -126,7 +126,7 @@
Patient patient = new Patient();
- verified = ( verified == null ) ? false : true ;
+ verified = ( verified == null ) ? false : verified ;
// ---------------------------------------------------------------------
// Set FirstName, MiddleName, LastName by FullName
@@ -184,7 +184,7 @@
}
else
{
- patient.setBirthDateFromAge( age.intValue(), 'Y' );
+ patient.setBirthDateFromAge( age.intValue(), Patient.AGE_TYPE_YEAR );
}
patient.setDobType( dobType );
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/ProgramEnrollmentSelectAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/ProgramEnrollmentSelectAction.java 2012-03-28 07:10:48 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/ProgramEnrollmentSelectAction.java 2012-03-28 08:26:44 +0000
@@ -135,14 +135,11 @@
completedPrograms.add( programInstance.getProgram() );
}
}
-System.out.println("\n\n completedPrograms : " + completedPrograms.iterator().next().getName() );
+
// Get single-event programs by the selected orgunit
Collection<Program> singleProgramsByOrgunit = programService.getPrograms( true, false, orgunit );
-System.out.println("\n\n singleProgramsByOrgunit : " + singleProgramsByOrgunit.iterator().next().getName() );
singleProgramsByOrgunit.remove( completedPrograms );
-System.out.println("\n\n singlePrograms 2 : " + singleProgramsByOrgunit.iterator().next().getName() );
programs.addAll( singleProgramsByOrgunit );
-System.out.println("\n\n programs : " + singleProgramsByOrgunit.iterator().next().getName() );
return SUCCESS;
}
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/UpdatePatientAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/UpdatePatientAction.java 2012-03-27 04:22:51 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/UpdatePatientAction.java 2012-03-28 08:26:44 +0000
@@ -125,7 +125,7 @@
patient = patientService.getPatient( id );
- verified = ( verified == null ) ? false : true ;
+ verified = ( verified == null ) ? false : verified ;
// ---------------------------------------------------------------------
// Set FirstName, MiddleName, LastName by FullName
@@ -180,7 +180,7 @@
{
dobType = 'A';
}
-
+
if ( dobType == Patient.DOB_TYPE_VERIFIED || dobType == Patient.DOB_TYPE_DECLARED )
{
birthDate = birthDate.trim();
@@ -188,7 +188,7 @@
}
else
{
- patient.setBirthDateFromAge( age.intValue(), 'Y' );
+ patient.setBirthDateFromAge( age.intValue(), Patient.AGE_TYPE_YEAR );
}
patient.setDobType( dobType );
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties 2012-03-28 07:10:48 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties 2012-03-28 08:26:44 +0000
@@ -288,7 +288,7 @@
orgunit_hiererachy_included_on = Organisation unit hiererachy included on
level = Level
please_fill_out_only_one_of_these_fields = Please fill out at only one of these fields.
-age_year = Age year
+age_year = Age(year)
create = Create
migration_patient = Migration Beneficiary
patient_info = Beneficiary Information
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/addPatientForm.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/addPatientForm.vm 2012-03-27 04:22:51 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/addPatientForm.vm 2012-03-28 08:26:44 +0000
@@ -33,7 +33,7 @@
jQuery( '#validateBirthdate' ).removeClass( 'error').addClass('error valid');
$("#patientForm [id=memberValidator]").val("birthDate");
}
- else if ( age=='' )
+ else if ( age!='' )
{
jQuery( '#validateBirthdate' ).removeClass( 'error').addClass('error valid');
$("#patientForm [id=memberValidator]").val("age");
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientForm.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientForm.vm 2012-03-28 07:10:48 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientForm.vm 2012-03-28 08:26:44 +0000
@@ -43,7 +43,8 @@
<tr>
<td class='text-column'><label for="birthDate">$i18n.getString( "date_of_birth" )<em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
<td class="input-column">
- <input type="text" id="birthDate" name="birthDate" style='width:168px' />
+ <input type="text" id="birthDate" name="birthDate" style='width:110px' />
+ <input type='button' onclick='setFieldValue("birthDate","")' value='$i18n.getString("clear")'>
$i18n.getString( "verified" ) <input type='checkbox' id='verified' name='verified' onchange='verifiedOnchange();' value='true' checked >
$i18n.getString( "age_year" ) <input type="text" id="age" name="age" class="{validate:{number:true}}" style="width:50px" disabled />
</td>
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/updatePatientForm.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/updatePatientForm.vm 2012-03-27 07:20:28 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/updatePatientForm.vm 2012-03-28 08:26:44 +0000
@@ -39,6 +39,16 @@
jQuery( '#validateBirthdate' ).removeClass( 'error').addClass('error valid');
$("#patientForm [id=memberValidator]").val("");
}
+ else if ( birthDate != '' )
+ {
+ jQuery( '#validateBirthdate' ).removeClass( 'error').addClass('error valid');
+ $("#patientForm [id=memberValidator]").val("birthDate");
+ }
+ else if ( age!='' )
+ {
+ jQuery( '#validateBirthdate' ).removeClass( 'error').addClass('error valid');
+ $("#patientForm [id=memberValidator]").val("age");
+ }
hideById( 'validateBirthdate' );
}
@@ -97,8 +107,9 @@
<tr>
<td class='text-column'><label for="birthDate">$i18n.getString( "date_of_birth" )<em title="$i18n.getString( "required" )" class="required">*</em></label></td>
<td class="input-column" >
- <input type="text" id="birthDate" name="birthDate" value="$format.formatDate( $!patient.birthDate )" style='width:168px' >
- $i18n.getString( "verified" ) <input type='checkbox' id='verified' name='verified' onchange='verifiedOnchange();' #if($patient.dobType=='V') checked #end >
+ <input type="text" id="birthDate" name="birthDate" value="$format.formatDate( $!patient.birthDate )" style='width:110px' >
+ <input type='button' onclick='setFieldValue("birthDate","")' value='$i18n.getString("clear")'>
+ $i18n.getString( "verified" ) <input type='checkbox' id='verified' name='verified' onchange='verifiedOnchange();' value='true' #if($patient.dobType=='V') checked #end >
$i18n.getString( "age_year" )<input type="text" id="age" name="age" class="{validate:{number:true, alphanumeric: true}}" style="width:50px" #if($patient.dobType!='V') disable #end >
</td>
</tr>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/programstage/AddProgramStageAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/programstage/AddProgramStageAction.java 2012-03-27 08:52:53 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/programstage/AddProgramStageAction.java 2012-03-28 08:26:44 +0000
@@ -28,23 +28,16 @@
*/
import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Date;
import java.util.List;
import org.hisp.dhis.dataelement.DataElement;
import org.hisp.dhis.dataelement.DataElementService;
import org.hisp.dhis.program.Program;
-import org.hisp.dhis.program.ProgramInstance;
-import org.hisp.dhis.program.ProgramInstanceService;
import org.hisp.dhis.program.ProgramService;
import org.hisp.dhis.program.ProgramStage;
import org.hisp.dhis.program.ProgramStageDataElement;
import org.hisp.dhis.program.ProgramStageDataElementService;
-import org.hisp.dhis.program.ProgramStageInstance;
-import org.hisp.dhis.program.ProgramStageInstanceService;
import org.hisp.dhis.program.ProgramStageService;
-import org.hisp.dhis.system.util.DateUtils;
import com.opensymphony.xwork2.Action;
@@ -88,23 +81,6 @@
this.programStageDataElementService = programStageDataElementService;
}
-
-
-
- private ProgramInstanceService programInstanceService;
-
- public void setProgramInstanceService( ProgramInstanceService programInstanceService )
- {
- this.programInstanceService = programInstanceService;
- }
-
- private ProgramStageInstanceService programStageInstanceService;
-
- public void setProgramStageInstanceService( ProgramStageInstanceService programStageInstanceService )
- {
- this.programStageInstanceService = programStageInstanceService;
- }
-
// -------------------------------------------------------------------------
// Input/Output
// -------------------------------------------------------------------------
@@ -196,29 +172,6 @@
programStageDataElementService.addProgramStageDataElement( programStageDataElement );
}
- // ---------------------------------------------------------------------
- // Create program-stage-instances for the available patients enrolled
- // this program before
- // ---------------------------------------------------------------------
-
- Collection<ProgramInstance> programInstances = programInstanceService.getProgramInstances( program, false );
-
- for ( ProgramInstance programInstance : programInstances )
- {
- ProgramStageInstance programStageInstance = new ProgramStageInstance();
- programStageInstance.setProgramInstance( programInstance );
- programStageInstance.setProgramStage( programStage );
- programStageInstance.setStageInProgram( programStage.getStageInProgram() );
-
- Date dueDate = DateUtils.getDateAfterAddition( programInstance.getDateOfIncident(), programStage
- .getMinDaysFromStart() );
-
- programStageInstance.setDueDate( dueDate );
-
- programStageInstanceService.addProgramStageInstance( programStageInstance );
-
- }
-
return SUCCESS;
}
}
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/META-INF/dhis/beans.xml 2012-03-27 08:52:53 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/META-INF/dhis/beans.xml 2012-03-28 08:26:44 +0000
@@ -308,8 +308,6 @@
<property name="programService" ref="org.hisp.dhis.program.ProgramService" />
<property name="programStageDataElementService"
ref="org.hisp.dhis.program.ProgramStageDataElementService" />
- <property name="programInstanceService" ref="org.hisp.dhis.program.ProgramInstanceService" />
- <property name="programStageInstanceService" ref="org.hisp.dhis.program.ProgramStageInstanceService" />
</bean>
<bean