dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #17590
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 7051: (patient) Minor fix for tabular report and others.
------------------------------------------------------------
revno: 7051
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Sun 2012-05-27 00:38:10 +0700
message:
(patient) Minor fix for tabular report and others.
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/UpdatePatientAction.java
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/app/app.js
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonTabularReportResult.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/programEnrollmentSelectForm.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/resources/org/hisp/dhis/patient/i18n_module.properties
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramStageForm.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programStageList.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramStageForm.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-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-04-17 04:39:03 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/AddPatientAction.java 2012-05-26 17:38:10 +0000
@@ -106,6 +106,8 @@
private String registrationDate;
+ private Character dobType;
+
private boolean underAge;
private Integer representativeId;
@@ -324,6 +326,11 @@
this.verified = verified;
}
+ public void setDobType( Character dobType )
+ {
+ this.dobType = dobType;
+ }
+
public void setPatientIdentifierTypeService( PatientIdentifierTypeService patientIdentifierTypeService )
{
this.patientIdentifierTypeService = patientIdentifierTypeService;
=== 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-04-17 04:39:03 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/UpdatePatientAction.java 2012-05-26 17:38:10 +0000
@@ -110,6 +110,8 @@
private Integer relationshipTypeId;
+ private Character dobType;
+
// -------------------------------------------------------------------------
// Output
// -------------------------------------------------------------------------
@@ -177,13 +179,6 @@
patient.setUnderAge( underAge );
patient.setOrganisationUnit( organisationUnit );
- Character dobType = (verified) ? 'V' : 'D';
-
- if ( !verified && age != null )
- {
- dobType = 'A';
- }
-
if ( dobType == Patient.DOB_TYPE_VERIFIED || dobType == Patient.DOB_TYPE_DECLARED )
{
birthDate = birthDate.trim();
@@ -339,6 +334,11 @@
this.patientIdentifierTypeService = patientIdentifierTypeService;
}
+ public void setDobType( Character dobType )
+ {
+ this.dobType = dobType;
+ }
+
public void setFormat( I18nFormat format )
{
this.format = format;
=== 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-30 01:28:12 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/addPatientForm.vm 2012-05-26 17:38:10 +0000
@@ -4,49 +4,32 @@
currentDiv = 'patientForm';
checkedDuplicate = false;
- isSubmit = true;
jQuery("#patientForm").validate({
meta:"validate"
,errorElement:"span"
,submitHandler: function(form)
{
- if( isSubmit )
- {
- validateAddPatient();
- }
+ validateAddPatient();
}
,beforeValidateHandler: function(form)
{
- var checked = byId( 'verified' ).checked;
+ var dobType = $('#patientForm [id=dobType]').val();
- var birthDate = $('#patientForm [id=birthDate]').val();
- var age = $('#patientForm [id=age]').val();
- if( birthDate != '' && age!='' )
- {
- $("#patientForm [id=memberValidator]").val("birthDate");
- showById( 'validateBirthdate' );
- jQuery('#age').focus();
- isSubmit = false;
- return;
- }
- else if( birthDate == '' && age == '' ) {
- $("#patientForm [id=memberValidator]").val("");
- }
- else if ( birthDate != '' )
- {
- $("#patientForm [id=memberValidator]").val("birthDate");
- }
- else if ( age!='' )
- {
- $("#patientForm [id=memberValidator]").val("age");
- }
- isSubmit = true;
+ if( dobType=='V' || dobType=='D' )
+ {
+ var birthDate = $('#patientForm [id=birthDate]').val();
+ if( birthDate != '' ){
+ $("#patientForm [id=memberValidator]").val(birthDate);
+ }
+ }else{
+ var age = $('#patientForm [id=age]').val();
+ $("#patientForm [id=memberValidator]").val(age);
+ }
}
});
datePickerValid( 'patientForm [id=registrationDate]' );
- datePickerValid( 'patientForm [id=birthDate]' );
addEventForPatientForm( 'patientForm' );
});
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/app.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/app.js 2012-05-26 09:18:15 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/app.js 2012-05-26 17:38:10 +0000
@@ -716,19 +716,12 @@
},
datatable: null,
getDataTableStore: function() {
-
- this.datatable = Ext.create('Ext.data.Store', {
+
+ this.datatable = Ext.create('Ext.data.ArrayStore', {
fields: TR.value.fields,
data: TR.value.values,
remoteSort:true,
autoLoad: false,
- proxy: {
- type: 'memory',
- reader: {
- type: 'json',
- root: 'items'
- }
- },
storage: {}
});
},
@@ -797,11 +790,18 @@
success: function(r) {
var json = Ext.JSON.decode(r.responseText);
TR.state.total = json.total;
- TR.value.valueTypes = json.valueTypes;
- TR.value.fields = json.fields;
- TR.value.hidden= json.hidden;
TR.value.columns = json.columns;
- TR.value.values = json.items;
+ TR.value.values=json.items;
+
+ var fields = [];
+ fields[0] = "id";
+ for( var index=0; index < TR.value.columns.length; index++ )
+ {
+ var i = index + 1;
+ fields[i] = 'col' + i;
+ }
+
+ TR.value.fields = fields;
if ( json.items.length > 1 )
{
@@ -997,27 +997,9 @@
};
TR.value = {
- valueTypes: [],
columns: [],
fields: [],
- hidden: [],
- values: [],
- getValueType: function( index )
- {
- if( TR.value.valueTypes[index] == null )
- {
- return 'textfield';
- }
- return TR.value.valueTypes[index].valueType;
- },
- getSuggestedValues: function( index )
- {
- if( TR.value.valueTypes[index] == null )
- {
- return [];
- }
- return TR.value.valueTypes[index].suggestedValues;
- }
+ values: []
};
TR.datatable = {
@@ -1030,7 +1012,7 @@
var paramsLen = TR.cmp.params.identifierType.selected.store.data.length
+ TR.cmp.params.patientAttribute.selected.store.data.length
+ TR.cmp.params.dataelement.selected.store.data.length;
- var metaDatatColsLen = TR.value.columns.length - paramsLen ;
+ var metaDatatColsLen = TR.value.columns.length - paramsLen;
// column
var cols = [];
@@ -1045,97 +1027,87 @@
menuDisabled: true
};
- cols[1] = {
- header: TR.value.columns[1],
- dataIndex: 'col1',
- height: TR.conf.layout.east_gridcolumn_height,
- sortable: false,
- draggable: false,
- hideable: false
- };
-
- index = 2;
- for( index=2; index < metaDatatColsLen; index++ )
+ // report-date && orgunits
+ var index=0;
+ for( index=0; index < paramsLen; index++ )
{
- cols[index] = {
- header: TR.value.columns[index],
- dataIndex: 'col' + index,
+ cols[index + 1] = {
+ header: TR.value.columns[index].name,
+ dataIndex: 'col' + eval(index + 1),
height: TR.conf.layout.east_gridcolumn_height,
name:"meta_" + index + "_",
sortable: false,
draggable: false,
- hidden: eval(TR.value.hidden['col' + index])
+ hidden: eval(TR.value.columns[index].hidden )
}
}
+ // identifier
TR.cmp.params.identifierType.selected.store.each( function(r) {
var dataIndex = "col" + index;
- cols[index] = {
- header: r.data.name,
- dataIndex: dataIndex,
+ cols[index + 1] = {
+ header: TR.value.columns[index].name,
+ dataIndex: 'col' + eval(index + 1),
height: TR.conf.layout.east_gridcolumn_height,
name: "iden_"+ r.data.id + "_",
- hidden: eval(TR.value.hidden['col' + index]),
sortable: false,
- draggable: true,
- editor: {
- xtype: 'textfield',
- allowBlank: true
- }
- };
+ draggable: false,
+ hidden: eval(TR.value.columns[index].hidden )
+ }
index++;
});
+ // patient-attributes
TR.cmp.params.patientAttribute.selected.store.each( function(r) {
- var dataIndex = "col" + index;
- cols[index] = {
- header: r.data.name,
+ var dataIndex = "col" + eval(index + 1);
+ cols[index + 1] = {
+ header: TR.value.columns[index].name,
dataIndex: dataIndex,
height: TR.conf.layout.east_gridcolumn_height,
name: "attr_"+ r.data.id + "_",
- hidden: eval(TR.value.hidden['col' + index]),
- flex:1,
+ hidden: eval(TR.value.columns[index].hidden ),
sortable: false,
draggable: true,
emptyText: TR.i18n.et_no_data,
editor: {
- xtype: TR.value.getValueType(index),
- queryMode: 'local',
- editable: true,
- valueField: 'name',
- displayField: 'name',
- allowBlank: true,
- store: new Ext.data.ArrayStore({
- fields: ['name'],
- data: TR.value.getSuggestedValues(index)
- })
- }
- };
+ xtype: TR.value.columns[index].valueType,
+ queryMode: 'local',
+ editable: true,
+ valueField: 'name',
+ displayField: 'name',
+ allowBlank: true,
+ store: new Ext.data.ArrayStore({
+ fields: ['name'],
+ data: TR.value.columns[index].suggested
+ })
+ }
+ };
index++;
});
+ // Dataelements
TR.cmp.params.dataelement.selected.store.each( function(r) {
- var dataIndex = "col" + index;
- cols[index] = {
- header: r.data.name,
+ var dataIndex = "col" + eval(index + 1);
+ cols[index + 1] = {
+ header: TR.value.columns[index].name,
dataIndex: dataIndex,
height: TR.conf.layout.east_gridcolumn_height,
name: "de_"+ r.data.id + "_",
- hidden: eval(TR.value.hidden['col' + index]),
- flex:1,
+ hidden: eval(TR.value.columns[index].hidden ),
sortable: false,
draggable: true,
+ emptyText: TR.i18n.et_no_data,
editor: {
- xtype: TR.value.getValueType(index),
- queryMode: 'local',
- editable: true,
- valueField: 'name',
- displayField: 'name',
- allowBlank: true,
- store: new Ext.data.ArrayStore({
- fields: ['name'],
- data: TR.value.getSuggestedValues(index)
- })
+ xtype: TR.value.columns[index].valueType,
+ queryMode: 'local',
+ editable: true,
+ valueField: 'name',
+ displayField: 'name',
+ allowBlank: true,
+ store: new Ext.data.ArrayStore({
+ fields: ['name'],
+ data: TR.value.columns[index].suggested
+ })
}
};
index++;
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js 2012-05-24 16:51:34 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js 2012-05-26 17:38:10 +0000
@@ -1,14 +1,25 @@
-function verifiedOnchange( container ){
+function dobTypeOnChange( container ){
- var checked = byId( 'verified' ).checked;
- if( checked )
- {
- disable( 'age' );
- }
- else
- {
- enable( 'age' );
+ var type = jQuery('#' + container + ' [id=dobType]').val();
+ if(type == 'V' || type == 'D'){
+ jQuery('#' + container + ' [id=age]').rules("remove","required");
+ jQuery('#' + container + ' [id=birthDate]').rules("add",{required:true});
+ datePickerValid( container + ' [id=birthDate]' );
+ jQuery('#' + container + ' [id=birthDate]').css("display","");
+ jQuery('#' + container + ' [id=age]').css("display","none");
+ }else if(type == 'A'){
+ jQuery('#' + container + ' [id=birthDate]').rules("remove","required");
+ jQuery('#' + container + ' [id=age]').rules("add",{required:true});
+ $('#' + container+ ' [id=birthDate]').datepicker("destroy");
+ jQuery('#' + container + ' [id=birthDate]').css("display","none");
+ jQuery('#' + container + ' [id=age]').css("display","");
+ }else {
+ jQuery('#' + container + ' [id=age]').rules("remove","required");
+ jQuery('#' + container + ' [id=birthDate]').rules("remove","required");
+ $('#' + container+ ' [id=birthDate]').datepicker("destroy");
+ jQuery('#' + container + ' [id=birthDate]').css("display","none");
+ jQuery('#' + container + ' [id=age]').css("display","");
}
}
@@ -120,7 +131,7 @@
if ( key==13 )// Enter
{
- searchAdvancedPatients()();
+ searchAdvancedPatients();
}
}
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonTabularReportResult.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonTabularReportResult.vm 2012-05-24 14:30:38 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonTabularReportResult.vm 2012-05-26 17:38:10 +0000
@@ -1,89 +1,44 @@
+
#set( $noRows = $grid.getRows().size() )
{
-#if( $grid && $noRows > 0)
#set( $noHeader = $grid.getHeaders().size() )
-#set( $metaData = $noHeader - $valueTypes.size() )
+#set ( $metaData = $noHeader - $valueTypes.size() )
"total": "$total",
-"valueTypes":[
-#foreach( $col in $grid.getHeaders() )
-#if ($velocityCount <= $metaData + 1)
-{
- "valueType": "textfield",
- "suggestedValues": []
-},
-#end
-#end
-#set($index = 0)
-#foreach( $valueType in $valueTypes )
-{
- "valueType":
- #if( $valueType == 'number' || $valueType == 'NUMBER' )
- "textfield"
- #elseif( $valueType == 'bool' || $valueType == 'YES/NO' || $valueType =='optionSet' )
- "combobox"
- #elseif( $valueType == 'date' || $valueType == 'DATE' )
- "textfield"
- #else
- "textfield"
- #end,
- #set( $suggestedValues = $mapSuggestedValues.get($index) )
- "suggestedValues":[
- #foreach( $suggestedValue in $suggestedValues )
- ["$!encoder.jsonEncode( ${suggestedValue} )"]#if( $velocityCount < $suggestedValues.size() ),#end
- #end
- ] }#if( $velocityCount < $valueTypes.size() ),#end
- #set( $index = $index + 1 )
- #end
- ],
- "columns":[
- "id",
- #foreach( $colName in $grid.getHeaders() )
- "$colName.name"#if( $velocityCount < $noHeader ),#end
- #end
- ],
- "fields":[
- "id",
- #foreach( $col in $grid.getHeaders() )
- "col${velocityCount}"#if( $velocityCount < $noHeader ),#end
- #end
- ],
- "hidden":[
- #set( $index = 2 )
- #set($col="col" + $index )
- #foreach( $header in $grid.getHeaders() )
- {"$col":"$header.hidden"}#if( $velocityCount < $noHeader ),#end
- #set( $index = $index + 1 )
- #end
- ],
- "items":[
- {
- "id":"$i18n.getString( 'filter' )",
- #foreach( $col in $grid.getHeaders() )
- #if ($velocityCount <= $metaData )
- "col${velocityCount}": "",
- #end
- #end
- #set( $index = $metaData + 1 )
- #foreach( $value in $values )
- "col${index}": "${value}"#if( $velocityCount < $values.size() ),#end
- #set( $index = $index + 1 )
- #end
- },
+"columns":[
+ #set($index = 0)
+ #foreach( $col in $grid.getHeaders() )
+ {
+ #set( $mapIndx = $index - $metaData )
+ "valueType": #if( $index > $metaData && $mapSuggestedValues.get($mapIndx).size() > 0 )
+ "combobox"
+ #else
+ "textfield"
+ #end,
+ "suggested": [#set( $suggestedValues = $mapSuggestedValues.get($mapIndx) )
+ #foreach( $suggestedValue in $suggestedValues )
+ ["$!encoder.jsonEncode( ${suggestedValue} )"]
+ #if( $velocityCount < $suggestedValues.size() ),#end
+ #end],
+ "name": "$col.name",
+ "hidden": "$col.hidden"
+ }#if( $velocityCount < $noHeader ),#end
+ #set($index = $index + 1)
+ #end
+],
+"items":[
+ [
+ "$i18n.getString( 'filter' )",
+ #foreach( $col in $grid.getHeaders() )"",#end
+ ],
#foreach( $row in $grid.getRows() )
- {
+ [
#set( $nr = ( ( $paging.getCurrentPage() - 1 ) * $paging.pageSize ) + $velocityCount )
- "id": ${nr},
+ ${nr},
#foreach( $col in $row )
- "col${velocityCount}": "$!encoder.htmlEncode( $col )"#if( $velocityCount < $noHeader ),#end
+ #set($colName = "col"+ $velocityCount)
+ "$!encoder.htmlEncode( $col )"#if( $velocityCount < $noHeader ),#end
#end
- }#if( $velocityCount < $noRows ),#end
- #end ]
-#else
- "total": 0,
- "valueTypes":[],
- "columns":[],
- "fields":[],
- "hidden":[],
- "items":[]
-#end
+ ]#if( $velocityCount < $noRows ),#end
+ #end
+ ]
}
\ No newline at end of file
=== 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-05-24 16:56:31 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientForm.vm 2012-05-26 17:38:10 +0000
@@ -9,7 +9,7 @@
<tr>
<td class='text-column'><label for="registration_date">$i18n.getString( "registration_date" )<em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
- <td class="input-column">
+ <td class="input-column" colspan='2'>
<input type="text" id="registrationDate" name="registrationDate" class="{validate:{required:true}}"/>
<script type="text/javascript">
datePickerValid( 'registrationDate', true );
@@ -18,11 +18,11 @@
</tr>
<tr>
- <th colspan="2" class="heading-column">$i18n.getString( "demographics" )</th>
+ <th colspan="3" class="heading-column">$i18n.getString( "demographics" )</th>
</tr>
<tr>
- <td class='text-column'><label for="fullName">$i18n.getString( "full_name" )</label></td>
- <td class="input-column" >
+ <td class='text-column'><label for="fullName">$i18n.getString( "full_name" )<em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
+ <td class="input-column" colspan='2'>
<input type="text" id="fullName" name="fullName" class="{validate:{required:true, unicodechars:true, rangelength:[7,50]}}"/>
<img src='../images/search.png' id="searchPatientByNameBtn" name="searchPatientByNameBtn" class="imgButton"/>
</td>
@@ -30,7 +30,7 @@
<tr>
<td class='text-column'><label for="gender">$i18n.getString( "gender" )<em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
- <td class="input-column">
+ <td class="input-column" colspan='2'>
<select id="gender" name="gender" class="{validate:{required:true}}">
<option value="" selected="selected">[$i18n.getString( "please_select" )]</option>
<option value="M" >$i18n.getString( "male" )</option>
@@ -41,19 +41,23 @@
</tr>
<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: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' >
- $i18n.getString( "age_year" ) <input type="text" id="age" name="age" class="{validate:{number:true}}" style="width:50px" />
- </td>
- <td></td>
+ <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" style='width:100px'>
+ <select id='dobType' name="dobType" style='width:100px' onchange='dobTypeOnChange("patientForm")' >
+ <option value="A" selected >$i18n.getString( "approximated" )</option>
+ <option value="D" >$i18n.getString( "declared" )</option>
+ <option value="V" >$i18n.getString( "verified" )</option>
+ </select>
+ </td>
+ <td style='width:240px'>
+ <input type="text" id="birthDate" name="birthDate" style='width:250px;display:none'/>
+ <input type="text" id="age" name="age" class="{validate:{required:true, number:true}}" style="width:250px" />
+ </td>
</tr>
<tr>
<td></td>
- <td class="input-column" >
+ <td class="input-column" colspan='2'>
<span id='validateBirthdate' class="hidden" style='color:red'><i>$i18n.getString('please_fill_out_only_one_of_these_fields')</i></span>
<input id="memberValidator" class="hidden {validate:{required:true}}"/>
</td>
@@ -61,7 +65,7 @@
<tr>
<td class='text-column'><label for="bloodGroup">$i18n.getString( "blood_group" )</label></td>
- <td class="input-column">
+ <td class="input-column" colspan='2'>
<select id="bloodGroup" name="bloodGroup">
<option value="">[$i18n.getString( "please_select" )]</option>
<option value="A+">A+</option>
@@ -78,17 +82,17 @@
<tr>
<td class='text-column'><label for="phoneNumber">$i18n.getString( "phone_number" )</label></td>
- <td class="input-column">
+ <td class="input-column" colspan='2'>
<input type="text" id="phoneNumber" name="phoneNumber" />
</td>
</tr>
-<tr><td colspan="2"> </td></tr>
+<tr><td> </td></tr>
<tr>
<td></td>
- <td><input type="button" class='button' id='checkDuplicateBtn' name='checkDuplicateBtn' value="$i18n.getString('check_duplicate')" /></td>
+ <td colspan='2'><input type="button" class='button' id='checkDuplicateBtn' name='checkDuplicateBtn' value="$i18n.getString('check_duplicate')" /></td>
</tr>
-<tr><td colspan="2"> </td></tr>
+<tr><td colspan="3"> </td></tr>
<!-- UNDERAGE -->
<tr id='underAgeDiv'>
@@ -97,17 +101,19 @@
<input type="checkbox" name="underAge" id="underAge" onclick="toggleUnderAge(this);" value="true"/>
</td>
</tr>
+
<!--IDENTIFIERS -->
#if( $identifierTypes.size() > 0)
- <tr><td colspan="2"> </td></tr>
- <tr><th colspan="2" class="heading-column">$i18n.getString( "patient_identifiers" )</th></tr>
+ <tr><td colspan="3"> </td></tr>
+ <tr><th colspan="3" class="heading-column">$i18n.getString( "patient_identifiers" )</th></tr>
#foreach ($identifierType in $identifierTypes)
#if( $identifierType && $identifierType.program )
#else
<tr>
<td class='text-column'><label>$identifierType.name #if($identifierType.mandatory == true )<em title="$i18n.getString( 'required' )" class="required">*</em> #end</label></td>
- <td class="input-column">
- <input type="text" id="iden$identifierType.id" name="iden$identifierType.id" data="{related:$identifierType.related}" class="{validate:{required:$identifierType.mandatory, #if($!identifierType.noChars) maxlength:$identifierType.noChars, #end #if($identifierType.type=='number') number:true #elseif($!identifierType.type=='letter') lettersonly:true #end }}" /></td>
+ <td class="input-column" colspan='2'>
+ <input type="text" id="iden$identifierType.id" name="iden$identifierType.id" data="{related:$identifierType.related}" class="{validate:{required:$identifierType.mandatory, #if($!identifierType.noChars) maxlength:$identifierType.noChars, #end #if($identifierType.type=='number') number:true #elseif($!identifierType.type=='letter') lettersonly:true #end }}" />
+ </td>
</tr>
#end
#end
@@ -116,13 +122,13 @@
<!-- ATTRIBUTES IN GROUPS -->
#foreach ($attributeGroup in $attributeGroups )
<tr><td> </td></tr>
- <tr><th colspan="2" class="heading-column">$attributeGroup.name</th></tr>
+ <tr><th colspan="3" class="heading-column">$attributeGroup.name</th></tr>
#foreach($attribute in $attributeGroup.attributes )
#if( $!attribute && $attribute.program )
#else
<tr>
<td class='text-column'><label>$attribute.name #if($attribute.mandatory)<em title="$i18n.getString( 'required' )" class="required">*</em> #end</label></td>
- <td class="input-column">
+ <td class="input-column" colspan='2'>
#if( $attribute.valueType == "YES/NO" )
<select id="attr$attribute.id" name="attr$attribute.id">
<option value="" selected="selected">[$i18n.getString( "please_select" )]</option>
@@ -154,15 +160,15 @@
<tr><td> </td></tr>
#if ( $noGroupAttributes && $noGroupAttributes.size() > 0)
- <tr><th colspan="2" class="heading-column">$i18n.getString( "other_details" )</th></tr>
+ <tr><th colspan="3" class="heading-column">$i18n.getString( "other_details" )</th></tr>
#foreach($attribute in $noGroupAttributes )
#if( $!attribute && $attribute.program )
#else
<tr>
<td class='text-column'><label>$attribute.name #if($attribute.mandatory)<em title="$i18n.getString( 'required' )" class="required">*</em> #end</label></td>
- <td class="input-column">
+ <td class="input-column" colspan='2'>
#if( $attribute.valueType == "YES/NO" )
- <select id="attr$attribute.id" name="attr$attribute.id" >
+ <select id="attr$attribute.id" name="attr$attribute.id" colspan='2' >
<option value="" >[$i18n.getString( "please_select" )]</option>
<option value="true">$i18n.getString( "yes" )</option>
<option value="false" >$i18n.getString( "no" )</option>
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programEnrollmentSelectForm.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programEnrollmentSelectForm.vm 2012-05-23 15:02:50 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programEnrollmentSelectForm.vm 2012-05-26 17:38:10 +0000
@@ -92,7 +92,8 @@
<script>
var i18n_enroll_to_program = '$encoder.jsEscape( $i18n.getString( "enroll_to_program" ) , "'")';
-
+ var i18n_program_stage = '$encoder.jsEscape( $i18n.getString( "program_stage" ) , "'")';
+
jQuery('#programEnrollmentSelectDiv').ready(function()
{
validation( 'programEnrollmentSelectDiv', function(form){
=== 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-05-24 16:56:31 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/updatePatientForm.vm 2012-05-26 17:38:10 +0000
@@ -12,56 +12,43 @@
jQuery(document).ready( function(){
- datePickerValid( 'patientForm [id=birthDate]' );
datePickerValid( 'patientForm [id=deathDate]' );
addEventForPatientForm('patientForm');
- isSubmit = true;
jQuery("#patientForm").validate({
- meta:"validate"
- ,errorElement:"span"
- ,submitHandler: function(form)
- {
- if( isSubmit )
- {
- validateUpdatePatient();
- }
- }
- ,beforeValidateHandler: function(form)
- {
- var checked = byId( 'verified' ).checked;
-
+ meta:"validate"
+ ,errorElement:"span"
+ ,submitHandler: function(form)
+ {
+ validateUpdatePatient();
+ }
+ ,beforeValidateHandler: function(form)
+ {
+ var dobType = $('#patientForm [id=dobType]').val();
+
+ if( dobType=='V' || dobType=='D' )
+ {
var birthDate = $('#patientForm [id=birthDate]').val();
+ if( birthDate != '' ){
+ $("#patientForm [id=memberValidator]").val(birthDate);
+ }
+ }else{
var age = $('#patientForm [id=age]').val();
- if( birthDate != '' && age!='' )
- {
- $("#patientForm [id=memberValidator]").val("birthDate");
- showById( 'validateBirthdate' );
- jQuery('#age').focus();
- isSubmit = false;
- return;
- }
- else if( birthDate == '' && age == '' ) {
- $("#patientForm [id=memberValidator]").val("");
- }
- else if ( birthDate != '' )
- {
- $("#patientForm [id=memberValidator]").val("birthDate");
- }
- else if ( age!='' )
- {
- $("#patientForm [id=memberValidator]").val("age");
- }
- isSubmit = true;
+ $("#patientForm [id=memberValidator]").val(age);
}
- });
+ }
+ });
- verifiedOnchange( 'patientForm' );
checkedDuplicate = false;
if("$!patient.dobType" == 'A'){
var i18n_please_select_relationshipType = '$encoder.jsEscape( $i18n.getString( "please_verify_birthday" ) , "'")';
+ jQuery('#patientForm [id=birthDate]').css("display","none");
alert(i18n_please_select_relationshipType);
- }
+ }
+ else{
+ datePickerValid( 'patientForm [id=birthDate]' );
+ jQuery('#patientForm [id=age]').css("display","none");
+ }
});
</script>
@@ -69,7 +56,7 @@
<h3>$i18n.getString( "update_patient" )</h3>
<p>
<form id="patientForm" name="patientForm" action="updatePatient.action" method="post" >
-<input type="hidden" id="representativeId" name="representativeId" value='$!patient.representative.id'' />
+<input type="hidden" id="representativeId" name="representativeId" value='$!patient.representative.id' />
<input type="hidden" id="relationshipTypeId" name="relationshipTypeId"/>
<div>
<input type="hidden" id="id" name="id" value="$patient.id">
@@ -78,7 +65,7 @@
<table>
<tr>
- <th colspan="2" class="heading-column">$i18n.getString( "system_identifier" )</th>
+ <th colspan="3" class="heading-column">$i18n.getString( "system_identifier" )</th>
</tr>
<tr>
<td></td>
@@ -89,36 +76,41 @@
</tr>
<tr>
- <th colspan="2" class="heading-column">$i18n.getString( "demographics" )</th>
+ <th colspan="3" class="heading-column">$i18n.getString( "demographics" )</th>
</tr>
<tr>
<td class='text-column'><label for="fullName">$i18n.getString( "full_name" )</label></td>
- <td class="input-column" ><input type="text" id="fullName" name="fullName" value="$!patient.getFullName()" class="{validate:{required:true, unicodechars:true, rangelength:[7,50]}}"></td>
+ <td class="input-column" colspan='2'><input type="text" id="fullName" name="fullName" value="$!patient.getFullName()" class="{validate:{required:true, unicodechars:true, rangelength:[7,50]}}"></td>
</tr>
<tr>
<td class='text-column'><label for="gender">$i18n.getString( "gender" )<em title="$i18n.getString( "required" )" class="required">*</em></label></td>
- <td class="input-column" >
+ <td class="input-column" colspan='2' >
<select id="gender" name="gender">
<option value="M" #if( $!patient.gender == 'M' ) selected="selected" #end>$i18n.getString( "male" )</option>
<option value="F" #if( $!patient.gender == 'F' ) selected="selected" #end>$i18n.getString( "female" )</option>
<option value="T" #if( $!patient.gender == 'T' ) selected="selected" #end>$i18n.getString( "transgender" )</option>
</select>
</td>
- </tr>
+ </tr>
+
+ <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" style='width:100px'>
+ <select id='dobType' name="dobType" style='width:100px' onchange='dobTypeOnChange("patientForm")' >
+ <option value="A" #if($patient.dobType=='A') checked #end >$i18n.getString( "approximated" )</option>
+ <option value="D" #if($patient.dobType=='D') checked #end >$i18n.getString( "declared" )</option>
+ <option value="V" #if($patient.dobType=='V') checked #end >$i18n.getString( "verified" )</option>
+ </select>
+ </td>
+ <td style='width:240px'>
+ <input type="text" id="birthDate" name="birthDate" value='$format.formatDate($!patient.birthDate)' style='width:242px;' />
+ <input type="text" id="age" name="age" value='$!patient.getAge()' class="{validate:{required:true, number:true}}" style='width:250px' />
+ </td>
+ </tr>
<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: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>
-
- <tr>
<td></td>
- <td class="input-column" >
+ <td class="input-column" colspan='2'>
<span id='validateBirthdate' class="hidden" style='color:red'><i>$i18n.getString('please_fill_out_only_one_of_these_fields')</i></span>
<input id="memberValidator" class="hidden {validate:{required:true}}"/>
</td>
@@ -126,7 +118,7 @@
<tr>
<td class='text-column'><label for="bloodGroup">$i18n.getString( "blood_group" )</label></td>
- <td class="input-column" >
+ <td class="input-column" colspan='2'>
<select type="text" id="bloodGroup" name="bloodGroup">
<option value="">[$i18n.getString( "please_select" )]</option>
<option value="A+" #if($!patient.bloodGroup == "A+") selected="selected" #end>A+</option>
@@ -143,7 +135,7 @@
<tr>
<td class='text-column'><label for="phoneNumber">$i18n.getString( "phone_number" )</label></td>
- <td class="input-column">
+ <td class="input-column" colspan='2'>
<input type="text" id="phoneNumber" name="phoneNumber" value="$!patient.phoneNumber" />
</td>
</tr>
@@ -170,7 +162,7 @@
<tr id='deathDateTR' class="hidden" >
<td class='text-column'><label for="deathDate">$i18n.getString("death_date")</label></td>
- <td class="input-column" >
+ <td class="input-column" colspan='2'>
<input type="text" name="deathDate" id="deathDate" #if($!patient.deathDate) value="$format.formatDate( $!patient.deathDate )" #end>
</td>
</tr>
@@ -181,7 +173,7 @@
#set( $representative = $!patient.representative )
<tr>
<td class='text-column'>$i18n.getString("representative")</td>
- <td>
+ <td colspan='2'>
$!patient.representative.getFullName() <img src="../images/information.png" alt="$i18n.getString( 'show_details' )" onclick='showRepresentativeInfo()' class='imgButton'>
</td>
</tr>
@@ -189,14 +181,15 @@
#if( $identifierTypes.size() > 0)
<!--IDENTIFIERS -->
- <tr><th colspan="2" class="heading-column">$i18n.getString("patient_identifiers")</th></tr>
+ <tr><th colspan="3" class="heading-column">$i18n.getString("patient_identifiers")</th></tr>
#foreach ($identifierType in $identifierTypes)
#if( $identifierType.program )
#else
+ ##set( $identifier = '' )
#set( $identifier = $identiferMap.get( $identifierType.id ) )
<tr>
<td class='text-column'><label for="bloodGroup">$identifierType.name #if($identifierType.mandatory)<em title="$i18n.getString( "required" )" class="required">*</em> #end</label></td>
- <td class="input-column" ><input type="text" id="iden$identifierType.id" name="iden$identifierType.id" value="$identifier" data="{related:$identifierType.related}" #if($identifierType.related && $!patient.underAge) disabled="disabled" #end class="{validate:{required:$identifierType.mandatory, #if($!identifierType.noChars) maxlength:$identifierType.noChars, #end #if($identifierType.type=='number') number:true #elseif($!identifierType.type=='letter') lettersonly:true #end }}" /></td>
+ <td class="input-column" colspan='2'><input type="text" id="iden$identifierType.id" name="iden$identifierType.id" value="$!identifier" data="{related:$identifierType.related}" #if($identifierType.related && $!patient.underAge) disabled="disabled" #end class="{validate:{required:$identifierType.mandatory, #if($!identifierType.noChars) maxlength:$identifierType.noChars, #end #if($identifierType.type=='number') number:true #elseif($!identifierType.type=='letter') lettersonly:true #end }}" /></td>
</tr>
#end
#end
@@ -206,14 +199,14 @@
#foreach ($attributeGroup in $attributeGroups )
<tr><td> </td></tr>
- <tr><th colspan="2" class="heading-column">$attributeGroup.name</th></tr>
+ <tr><th colspan="3" class="heading-column">$attributeGroup.name</th></tr>
#foreach($attribute in $attributeGroup.attributes)
#if( $attribute.program )
#else
#set( $attributeValue = $!patientAttributeValueMap.get( $attribute.id ) )
<tr>
<td class='text-column'><label>$attribute.name #if($attribute.mandatory)<em title="$i18n.getString( "required" )" class="required">*</em> #end</label></td>
- <td class="input-column" >
+ <td class="input-column" colspan='2' >
#if( $attribute.valueType == "YES/NO" )
<select id="attr$attribute.id" name="attr$attribute.id" >
<option value="">[$i18n.getString( "please_select" )]</option>
@@ -245,13 +238,13 @@
<!-- ATTRIBUTES NOT IN GROUPS -->
#if ( $noGroupAttributes && $noGroupAttributes.size() > 0)
- <tr><th colspan="2" class="heading-column">$i18n.getString( "Other details" )</th></tr>
+ <tr><th colspan="3" class="heading-column">$i18n.getString( "Other details" )</th></tr>
#foreach($attribute in $noGroupAttributes )
#set( $attributeValue = "" )
#set( $attributeValue = $!patientAttributeValueMap.get( $attribute.id ) )
<tr>
<td class='text-column'><label>$attribute.name #if($attribute.mandatory)<em title="$i18n.getString( "required" )" class="required">*</em> #end</label></td>
- <td class="input-column" >
+ <td class="input-column" colspan='2' >
#if( $attribute.valueType == "YES/NO" )
<select id="attr$attribute.id" name="attr$attribute.id" >
<option value="">[$i18n.getString( "please_select" )]</option>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/patient/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/patient/i18n_module.properties 2012-05-24 05:13:57 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/patient/i18n_module.properties 2012-05-26 17:38:10 +0000
@@ -255,4 +255,4 @@
single_event_with_registration = Single event with registration
single_event_without_registration = Single event without registration
for = for
-standard_interval = Standard interval
\ No newline at end of file
+standard_interval_days = Standard interval days
\ 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/addProgramStageForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramStageForm.vm 2012-05-23 18:02:21 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramStageForm.vm 2012-05-26 17:38:10 +0000
@@ -22,7 +22,7 @@
</tr>
<tr>
- <td><label>$i18n.getString( "min_days_from_start" )</label></td>
+ <td><label>$i18n.getString( "scheduled_days_from_start" )</label></td>
<td><input type="text" id="minDaysFromStart" name="minDaysFromStart" class="{validate:{number:true,min:0}}"/></td>
</tr>
@@ -32,7 +32,7 @@
</tr>
<tr>
- <td><label>$i18n.getString( "standard_interval" )</label></td>
+ <td><label>$i18n.getString( "standard_interval_days" )</label></td>
<td><input type="text" id="standardInterval" name="standardInterval" class="{validate:{required:true,number:true}}" disabled /></td>
</tr>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programStageList.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programStageList.vm 2012-05-23 16:19:55 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programStageList.vm 2012-05-26 17:38:10 +0000
@@ -60,7 +60,7 @@
<p><label class="bold">$i18n.getString( "stage_in_program" ):</label><br><span id="stageInProgramField"></span></p>
<p><label class="bold">$i18n.getString( "scheduled_days_from_start" ):</label><br><span id="scheduledDaysFromStartField"></span></p>
<p><label class="bold">$i18n.getString( "irregular" ):</label><br><span id="irregularField"></span></p>
- <p><label class="bold">$i18n.getString( "standard_interval" ):</label><br><span id="standardIntervalField"></span></p>
+ <p><label class="bold">$i18n.getString( "standard_interval_days" ):</label><br><span id="standardIntervalField"></span></p>
<p><label class="bold">$i18n.getString( "no_of_dataelements" ):</label><br><span id="dataElementCountField"></span></p>
</div>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramStageForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramStageForm.vm 2012-05-23 18:02:21 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramStageForm.vm 2012-05-26 17:38:10 +0000
@@ -31,7 +31,7 @@
</tr>
<tr>
- <td><label>$i18n.getString( "standard_interval" )</label></td>
+ <td><label>$i18n.getString( "standard_interval_days" )</label></td>
<td><input type="text" id="standardInterval" name="standardInterval" value='$!programStage.standardInterval' class="{validate:{required:true,number:true}}" #if( $programStage.irregular=='false' ) disabled #end /></td>
</tr>
<tr><td> </td></tr>