← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2533: Add Description for a condition and add Enrollment-date and Incident-date properties into Benific...

 

------------------------------------------------------------
revno: 2533
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2011-01-12 09:26:26 +0700
message:
  Add Description for a condition and add Enrollment-date and Incident-date properties into Benificiary Aggregation Engine function.
added:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/caseaggregation/GetAggConditionDescriptionAction.java
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/caseaggregation/CaseAggregationConditionService.java
  dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/caseaggregation/DefaultCaseAggregationConditionService.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/caseaggregation/GetAggDataElementsAction.java
  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/struts.xml
  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/addRelationshipPatientForm.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/index.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/commons.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/underAgeForm.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updatePatientForm.vm


--
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/caseaggregation/CaseAggregationConditionService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/caseaggregation/CaseAggregationConditionService.java	2011-01-07 11:37:47 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/caseaggregation/CaseAggregationConditionService.java	2011-01-12 02:26:26 +0000
@@ -59,4 +59,5 @@
         
     Collection<PatientDataValue> getPatientDataValues( CaseAggregationCondition aggregationCondition, OrganisationUnit orgunit, Period period );
     
+    String getConditionDescription( String condition );
 }

=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/caseaggregation/DefaultCaseAggregationConditionService.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/caseaggregation/DefaultCaseAggregationConditionService.java	2011-01-07 11:37:47 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/caseaggregation/DefaultCaseAggregationConditionService.java	2011-01-12 02:26:26 +0000
@@ -44,7 +44,9 @@
 import java.util.regex.Pattern;
 
 import org.hisp.dhis.dataelement.DataElement;
+import org.hisp.dhis.dataelement.DataElementCategory;
 import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
+import org.hisp.dhis.dataelement.DataElementCategoryService;
 import org.hisp.dhis.dataelement.DataElementService;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.patient.Patient;
@@ -52,6 +54,8 @@
 import org.hisp.dhis.patientdatavalue.PatientDataValue;
 import org.hisp.dhis.patientdatavalue.PatientDataValueService;
 import org.hisp.dhis.period.Period;
+import org.hisp.dhis.program.ProgramStage;
+import org.hisp.dhis.program.ProgramStageService;
 import org.hisp.dhis.system.util.DateUtils;
 import org.nfunk.jep.JEP;
 import org.springframework.transaction.annotation.Transactional;
@@ -83,6 +87,10 @@
 
     private PatientDataValueService dataValueService;
 
+    private ProgramStageService programStageService;
+
+    private DataElementCategoryService categoryService;
+
     // -------------------------------------------------------------------------
     // Getters && Setters
     // -------------------------------------------------------------------------
@@ -92,6 +100,16 @@
         this.aggregationConditionStore = aggregationConditionStore;
     }
 
+    public void setProgramStageService( ProgramStageService programStageService )
+    {
+        this.programStageService = programStageService;
+    }
+
+    public void setCategoryService( DataElementCategoryService categoryService )
+    {
+        this.categoryService = categoryService;
+    }
+
     public void setDataElementService( DataElementService dataElementService )
     {
         this.dataElementService = dataElementService;
@@ -154,7 +172,7 @@
         Period period )
     {
         String sql = createSQL( aggregationCondition, orgunit, period );
-
+        
         Collection<Integer> patientIds = aggregationConditionStore.executeSQL( sql );
 
         return calValue( patientIds, aggregationCondition.getOperator() );
@@ -168,7 +186,7 @@
 
         String sql = createSQL( aggregationCondition, orgunit, period );
 
-        Collection<DataElement> dataElements = getDataElementsInExpression( aggregationCondition
+        Collection<DataElement> dataElements = getDataElementsInCondition( aggregationCondition
             .getAggregationExpression() );
 
         Collection<Integer> patientIds = aggregationConditionStore.executeSQL( sql );
@@ -186,6 +204,47 @@
         return result;
     }
 
+    public String getConditionDescription( String condition )
+    {
+        StringBuffer decription = new StringBuffer();
+
+        String regExp = "\\[" + OBJECT_PROGRAM_STAGE_DATAELEMENT + SEPARATOR_OBJECT + "[0-9]+" + SEPARATOR_ID
+            + "[0-9]+" + SEPARATOR_ID + "[0-9]+" + "\\]";
+        
+        // ---------------------------------------------------------------------
+        // parse expressions
+        // ---------------------------------------------------------------------
+
+        Pattern pattern = Pattern.compile( regExp );
+
+        Matcher matcher = pattern.matcher( condition );
+
+        while ( matcher.find() )
+        {
+            String match = matcher.group();
+            match = match.replaceAll( "[\\[\\]]", "" );
+
+            String[] info = match.split( SEPARATOR_OBJECT );
+            String[] ids = info[1].split( SEPARATOR_ID );
+
+            int programStageId = Integer.parseInt( ids[0] );
+            ProgramStage programStage = programStageService.getProgramStage( programStageId );
+
+            int dataElementId = Integer.parseInt( ids[1] );
+            DataElement dataElement = dataElementService.getDataElement( dataElementId );
+
+            int categoryOptionId = Integer.parseInt( ids[2] );
+            DataElementCategory category = categoryService.getDataElementCategory( categoryOptionId );
+
+            matcher.appendReplacement( decription, "[" + programStage.getName() + SEPARATOR_ID +
+                dataElement.getName() + SEPARATOR_ID + category.getName() + "]" );
+        }
+
+        matcher.appendTail( decription );
+        
+        return decription.toString();
+    }
+
     // -------------------------------------------------------------------------
     // Support Methods
     // -------------------------------------------------------------------------
@@ -316,7 +375,7 @@
 
     }
 
-    private Collection<DataElement> getDataElementsInExpression( String aggregationExpression )
+    private Collection<DataElement> getDataElementsInCondition( String aggregationExpression )
     {
         String regExp = "\\[" + OBJECT_PROGRAM_STAGE_DATAELEMENT + SEPARATOR_OBJECT + "[0-9]+" + SEPARATOR_ID
             + "[0-9]+" + SEPARATOR_ID + "[0-9]+" + "\\]";

=== added file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/caseaggregation/GetAggConditionDescriptionAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/caseaggregation/GetAggConditionDescriptionAction.java	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/caseaggregation/GetAggConditionDescriptionAction.java	2011-01-12 02:26:26 +0000
@@ -0,0 +1,86 @@
+/*
+ * Copyright (c) 2004-2010, 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.
+ */
+package org.hisp.dhis.patient.action.caseaggregation;
+
+import org.hisp.dhis.caseaggregation.CaseAggregationConditionService;
+
+import com.opensymphony.xwork2.Action;
+
+/**
+ * @author Chau Thu Tran
+ * @version $ID : GetAggConditionDescriptionAction.java Jan 11, 2011 9:14:19 PM
+ *          $
+ */
+public class GetAggConditionDescriptionAction
+    implements Action
+{
+    // -------------------------------------------------------------------------
+    // Dependency
+    // -------------------------------------------------------------------------
+
+    private CaseAggregationConditionService aggregationConditionService;
+
+    // -------------------------------------------------------------------------
+    // Getters && Setters
+    // -------------------------------------------------------------------------
+
+    private String condition;
+
+    private String description;
+
+    // -------------------------------------------------------------------------
+    // Getters && Setters
+    // -------------------------------------------------------------------------
+
+    public void setAggregationConditionService( CaseAggregationConditionService aggregationConditionService )
+    {
+        this.aggregationConditionService = aggregationConditionService;
+    }
+
+    public String getDescription()
+    {
+        return description;
+    }
+
+    public void setCondition( String condition )
+    {
+        this.condition = condition;
+    }
+
+    // -------------------------------------------------------------------------
+    // Implementation Action
+    // -------------------------------------------------------------------------
+
+    @Override
+    public String execute()
+        throws Exception
+    {
+        description = aggregationConditionService.getConditionDescription( condition );
+
+        return SUCCESS;
+    }
+}

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/caseaggregation/GetAggDataElementsAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/caseaggregation/GetAggDataElementsAction.java	2010-11-25 22:22:10 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/caseaggregation/GetAggDataElementsAction.java	2011-01-12 02:26:26 +0000
@@ -97,7 +97,7 @@
 
         dataElementList = new ArrayList<DataElement>( dataElementService.getDataElementGroup( dataElementGroupId )
             .getMembers() );
-
+        
         Iterator<DataElement> deIterator = dataElementList.iterator();
 
         while ( deIterator.hasNext() )
@@ -108,6 +108,7 @@
             {
                 deIterator.remove();
             }
+            
         }
 
         if ( dataElementList != null && !dataElementList.isEmpty() )

=== 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	2011-01-11 10:06:47 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/META-INF/dhis/beans.xml	2011-01-12 02:26:26 +0000
@@ -1118,6 +1118,15 @@
 		</property>
 	</bean>
 	
+	<bean
+		id="org.hisp.dhis.patient.action.caseaggregation.GetAggConditionDescriptionAction"
+		class="org.hisp.dhis.patient.action.caseaggregation.GetAggConditionDescriptionAction"
+		scope="prototype">
+		<property name="aggregationConditionService">
+			<ref bean="org.hisp.dhis.caseaggregation.CaseAggregationConditionService" />
+		</property>
+	</bean>
+	
 	<!-- Validation - PatientValidationCriteria -->
 
 	<bean

=== 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	2011-01-11 07:06:28 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/struts.xml	2011-01-12 02:26:26 +0000
@@ -1077,6 +1077,13 @@
 			<param name="onExceptionReturn">plainTextError</param>
 		</action>
 		
+		<action name="getCaseAggregationDescription"
+			class="org.hisp.dhis.patient.action.caseaggregation.GetAggConditionDescriptionAction">
+			<result name="success" type="velocity">
+				/dhis-web-maintenance-patient/responseCaseAggDescription.vm</result>
+			<param name="onExceptionReturn">plainTextError</param>
+		</action>
+		
 		<!-- Validation - PatientValidationCriteria -->
 
 		<action name="validationCriteria"

=== 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	2011-01-11 07:06:28 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addPatientForm.vm	2011-01-12 02:26:26 +0000
@@ -60,7 +60,7 @@
 	<tr>
 		<td><label for="fullName">$i18n.getString( "full_name" )</label></td>
 		<td class="input-column" >
-			<input type="text" id="fullName" name="fullName" style="width:28em" class="{validate:{required:true, unicodechars:true, rangelength:[2,30]}}" onchange="startSearch(event)">
+			<input type="text" id="fullName" name="fullName" style="width:28em" class="{validate:{required:true, unicodechars:true, rangelength:[2,30]}}" onkeyup="startSearch(event)">
 			<span id='searchIcon' style="display:none"><img src="../images/loader.gif"></span>
 		</td>
 	</tr>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addRelationshipPatientForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addRelationshipPatientForm.vm	2011-01-11 07:06:28 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addRelationshipPatientForm.vm	2011-01-12 02:26:26 +0000
@@ -57,7 +57,7 @@
 	<tr>
 		<td><label for="fullName">$i18n.getString( "full_name" )</label></td>
 		<td class="input-column" >
-			<input type="text" id="fullName" name="fullName" style="width:28em" class="{validate:{required:true, unicodechars:true, rangelength:[2,30]}}" onchange="startSearch(event)">
+			<input type="text" id="fullName" name="fullName" style="width:28em" class="{validate:{required:true, unicodechars:true, rangelength:[2,30]}}" onkeyup="startSearch(event)">
 			<span id='searchIcon' style="display:none"><img src="../images/loader.gif"></span>
 		</td>
 	</tr>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/index.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/index.vm	2011-01-11 16:52:46 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/index.vm	2011-01-12 02:26:26 +0000
@@ -1,7 +1,7 @@
 
 <h3>$i18n.getString( "dhis-web-maintenance-patient" )</h3>
 
-<ul id="introList">
+<ul class="introList">
     #introListImgItem( "patient.action" "patient" "patient" )
     #introListImgItem( "patientAttribute.action" "patient_attribute" "patient" )
     #introListImgItem( "patientAttributeGroup.action" "patient_attribute_group" "patient" )
@@ -11,7 +11,7 @@
 	#introListImgItem( "programAttribute.action" "program_attribute" "program" )
     #introListImgItem( "caseAggregation.action" "case_aggregation_mapping" "caseaggregationmapping" )
 	#introListImgItem( "validationCriteria.action" "validation_criteria" "validationcriteria" )
-	#introListImgItem( "patientMobileSetting.action" "patient_mobile_setting" "systemsettings" )
+	#introListImgItem( "patientMobileSetting.action" "patientMobileSetting" "systemsettings" )
 	#introListImgItem( "configuration.action" "configuration" "systemsettings" )
 	#introListImgItem( "importPatientForm.action" "import_data" "excel" )
 </ul>
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/commons.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/commons.js	2011-01-11 01:56:03 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/commons.js	2011-01-12 02:26:26 +0000
@@ -55,4 +55,17 @@
 function showSearchPatients()
 {
 	tb_show( i18n_child_representative, "#TB_inline?height=350&width=580&inlineId=searchResults",null);	
+}
+
+function isDeathOnChange()
+{
+	var isDeath = byId('isDead').checked;
+	if(isDeath)
+	{
+		showById('deathDateTR');
+	}
+	else
+	{
+		hideById('deathDateTR');
+	}
 }
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/underAgeForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/underAgeForm.vm	2011-01-11 07:06:28 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/underAgeForm.vm	2011-01-12 02:26:26 +0000
@@ -166,7 +166,7 @@
 	<tr>
 		<td><label for="required">$i18n.getString( "full_name" )</label></td>
 		<td class="input-column" >
-			<input type="text" id="fullName" name="fullName" style="width:15em" class="{validate:{required:true, unicodechars:true, rangelength:[2,30]}}" onchange="startSearch(event)">
+			<input type="text" id="fullName" name="fullName" style="width:15em" class="{validate:{required:true, unicodechars:true, rangelength:[2,30]}}" onkeyup="startSearch(event)">
 			<span id='searchIcon' style="display:none"><img src="../images/loader.gif"></span>
 		</td>
 	</tr>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updatePatientForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updatePatientForm.vm	2011-01-11 07:06:28 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updatePatientForm.vm	2011-01-12 02:26:26 +0000
@@ -12,7 +12,8 @@
 	
 	jQuery(document).ready(	function(){
 
-		datePickerValid( 'birthDate' );	
+		datePickerValid( 'birthDate' );
+		datePickerValid( 'deathDate' );
 		jQuery("#btnRepresentativeInfo").cluetip({local:"#representativeInfo"});
 		
 		jQuery("#updatePatientForm").validate({
@@ -97,9 +98,8 @@
 	<tr id='birthdaySpan' style="display:none" >
 		<td><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:26.5em" onchange="bdOnchange()" value="$format.formatDate( $patient.birthDate )" >
+			<input type="text" id="birthDate" name="birthDate" style="width:28em" onchange="bdOnchange()" value="$format.formatDate( $patient.birthDate )" >
 		</td>
-		<td></td>
 	</tr>
 	
 	<tr id='ageSpan' style="display:none" >
@@ -112,7 +112,6 @@
 			</select>
 			<input type="text" id="age" name="age" value="$patient.getIntegerValueOfAge()" style="width:14.5em"  style="width:12em" onchange="ageOnchange()" class="{validate:{number:true, alphanumeric: true}}">
 		</td>
-		<td></td>
 	</tr>
 	
 	<tr>
@@ -142,10 +141,29 @@
 	
 	<tr>
 		<td>$i18n.getString("is_underage")</td>
-		<td class="input-column" >
+		<td>
 			<input type="checkbox" name="underAge" id="underAge" onclick="toggleUnderAge(this);" value="true" #if($patient.underAge) checked="checked" #end/>
 		</td>
 	</tr>
+	
+	<!-- DEAD -->
+	
+	<tr>
+		<td>$i18n.getString("is_dead")</td>
+		<td>
+			<input type="checkbox" name="isDead" id="isDead" value="true" #if($!patient.isDead) checked="checked" #end onchange='isDeathOnChange();'/>
+		</td>
+	</tr>
+	
+	<tr id='deathDateTR' style="display:none" >
+		<td><label for="deathDate">$i18n.getString("death_date")</label></td>
+		<td class="input-column" >
+			<input type="text" name="deathDate" id="deathDate" style="width:28em" #if($!patient.deathDate) value="$format.formatDate( $!patient.deathDate )" #end>
+		</td>
+	</tr>
+	
+	<tr><td>&nbsp;</td></tr>
+	
 	#if($patient.underAge)
 		#set( $representative = $patient.representative ) 
 		<tr>
@@ -333,4 +351,5 @@
 		var i18n_please_select_relationshipType = '$encoder.jsEscape( $i18n.getString( "please_verify_birthday" ) , "'")';
 		alert(i18n_please_select_relationshipType);
 	}
+	
 </script>
\ No newline at end of file