dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #17960
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 7369: Re-organize advanced search form in patient management and data entry.
------------------------------------------------------------
revno: 7369
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2012-06-25 09:11:55 +0700
message:
Re-organize advanced search form in patient management and data entry.
added:
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/searchPatientCriteria.vm
modified:
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/SearchPatientAction.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/anonymousRegistration.vm
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/anonymousRegistration.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/javascript/form.js
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/patient.js
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/relationshipPatient.js
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonProgramStageDataElements.vm
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programStageInstancesList.vm
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/select.vm
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/selectPatient.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/SearchPatientAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/SearchPatientAction.java 2012-05-24 13:53:25 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/SearchPatientAction.java 2012-06-25 02:11:55 +0000
@@ -70,7 +70,7 @@
private Boolean listAll;
- private List<Integer> searchingAttributeId = new ArrayList<Integer>();
+ private List<Integer> searchObjectId = new ArrayList<Integer>();
private Boolean searchBySelectedOrgunit;
@@ -142,9 +142,9 @@
return listAll;
}
- public void setSearchingAttributeId( List<Integer> searchingAttributeId )
+ public void setSearchObjectId( List<Integer> searchObjectId )
{
- this.searchingAttributeId = searchingAttributeId;
+ this.searchObjectId = searchObjectId;
}
public Collection<Patient> getPatients()
@@ -186,7 +186,7 @@
// Search patients by attributes
// ---------------------------------------------------------------------
- for ( Integer attributeId : searchingAttributeId )
+ for ( Integer attributeId : searchObjectId )
{
if ( attributeId != null && attributeId > 0 )
{
@@ -194,7 +194,7 @@
}
}
searchBySelectedOrgunit = (searchBySelectedOrgunit == null) ? false : searchBySelectedOrgunit;
- searchPatientByAttributes( searchingAttributeId, searchText, selectOrgunit, searchBySelectedOrgunit );
+ searchPatientByAttributes( searchObjectId, searchText, selectOrgunit, searchBySelectedOrgunit );
return SUCCESS;
}
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/anonymousRegistration.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/anonymousRegistration.vm 2012-06-23 15:48:45 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/anonymousRegistration.vm 2012-06-25 02:11:55 +0000
@@ -76,10 +76,10 @@
<tbody>
<tr id='advSearchBox0'>
<td id='searchingAttributeIdTD' >
- <select id="dataElementId" name="dataElementId" style='margin-right:18px;'></select>
+ <select id="searchObjectId" name="searchObjectId" style='margin-right:18px;' onchange='dataElementOnChange(this);'></select>
</td>
- <td>
- <input type="text" id="searchText" name="searchText" value="$!searchText" style='margin-right:30px;'>
+ <td style='padding-right:30px;'>
+ <input type="text" id="searchText" name="searchText" value="$!searchText">
</td>
<td><input type="button" id='addSearchOptionBtn' name='addSearchOptionBtn' class='small-button' value='+' onclick='addAttributeOption();'> </td>
</tr>
@@ -97,8 +97,10 @@
<div id='dataEntryInfor' class='hidden'>
<h4 id='programName' name='programName'></h4>
- <input type="button" class='large-button' id='backBtn' value="$i18n.getString( 'back' )" onclick="javascript:backEventList();" >
- <input type="button" onclick="doComplete()" value="Complete data entry" id="completeBtn">
+ <p>
+ <input type="button" class='large-button' id='backBtn' value="$i18n.getString( 'back' )" onclick="javascript:backEventList();" >
+ <input type="button" onclick="doComplete()" value="Complete data entry" id="completeBtn">
+ </p>
<div id='dataEntryFormDiv'></div>
</div>
@@ -134,6 +136,8 @@
var i18n_report_date = '$encoder.jsEscape( $i18n.getString( "report_date" ) , "'")';
var i18n_search_events_by_dataelements = '$encoder.jsEscape( $i18n.getString( "search_events_by_dataelements" ) , "'")';
var i18n_list_all_events = '$encoder.jsEscape( $i18n.getString( "list_all_events" ) , "'")';
+ var i18n_yes = '$encoder.jsEscape( $i18n.getString( "yes" ) , "'")';
+ var i18n_no = '$encoder.jsEscape( $i18n.getString( "no" ) , "'")';
isAjax = true;
contentDiv = '';
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/anonymousRegistration.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/anonymousRegistration.js 2012-06-24 14:49:04 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/anonymousRegistration.js 2012-06-25 02:11:55 +0000
@@ -13,7 +13,7 @@
{
hideById('dataEntryInfor');
hideById('listDiv');
- clearListById('dataElementId');
+ clearListById('searchObjectId');
programStageId = jQuery('#programId option:selected').attr('programStageId');
setFieldValue('programStageId', programStageId );
@@ -39,9 +39,9 @@
clearListById('dataElementId');
clearListById('compulsoryDE');
- jQuery( '#dataElementId').append( '<option value="">[' + i18n_please_select + ']</option>' );
+ jQuery( '#searchObjectId').append( '<option value="">[' + i18n_please_select + ']</option>' );
for ( i in json.programStageDataElements ) {
- jQuery( '#dataElementId').append( '<option value="' + json.programStageDataElements[i].id + '">' + json.programStageDataElements[i].name + '</option>' );
+ jQuery( '#searchObjectId').append( '<option value="' + json.programStageDataElements[i].id + '" type="' + json.programStageDataElements[i].type +'">' + json.programStageDataElements[i].name + '</option>' );
if( json.programStageDataElements[i].compulsory=='true' ){
jQuery( '#compulsoryDE').append( '<option value="' + json.programStageDataElements[i].id + '"></option>');
@@ -54,6 +54,64 @@
});
}
+function dataElementOnChange( this_ )
+{
+ var container = jQuery(this_).parent().parent().attr('id');
+ var element = jQuery('#' + container + ' [id=searchText]');
+ var valueType = jQuery('#' + container+ ' [id=searchObjectId] option:selected').attr('type');
+
+ if( valueType == 'date' ){
+ element.replaceWith( getDateField( container ) );
+ datePickerValid( 'searchText_' + container );
+ return;
+ }
+ else
+ {
+ $( '#searchText_' + container ).datepicker("destroy");
+ $('#' + container + ' [id=dateOperator]').replaceWith("");
+
+ if( valueType == 'bool' ){
+ element.replaceWith( getTrueFalseBox() );
+ }
+ else if ( valueType=='optionset' ){
+ element.replaceWith( searchTextBox );
+ autocompletedFilterField( container + " [id=searchText]" , jQuery(this_).val() );
+ }
+ else{
+ element.replaceWith( searchTextBox );
+ }
+ }
+}
+
+function autocompletedFilterField( idField, dataElementId )
+{
+ var input = jQuery( "#" + idField );
+ input.autocomplete({
+ delay: 0,
+ minLength: 0,
+ source: function( request, response ){
+ $.ajax({
+ url: "getOptions.action?id=" + dataElementId + "&query=" + input.val(),
+ dataType: "json",
+ success: function(data) {
+ response($.map(data.options, function(item) {
+ return {
+ label: item.o,
+ id: item.o
+ };
+ }));
+ }
+ });
+ },
+ minLength: 2,
+ select: function( event, ui ) {
+ input.val(ui.item.value);
+ input.autocomplete( "close" );
+ }
+ })
+ .addClass( "ui-widget" );
+}
+
function removeAllAttributeOption()
{
jQuery( '#advancedSearchTB tbody tr' ).each( function( i, item )
@@ -105,8 +163,9 @@
else{
params += '&startDate=' + getFieldValue('startDate');
params += '&endDate=' + getFieldValue('endDate');
+ var value = '';
+ var searchingValue = '';
jQuery( '#advancedSearchTB tbody tr' ).each( function(){
- var searchingValue = '';
jQuery( this ).find(':input').each( function( idx, item ){
var input = jQuery( item );
if( input.attr('type') != 'button' ){
@@ -114,11 +173,17 @@
searchingValue = 'de_' + input.val() + '_false_';
}
else if( input.val()!='' ){
- searchingValue += getValueFormula(input.val().toLowerCase());
+ value += input.val().toLowerCase();
}
}
});
+
+ if( value !=''){
+ searchingValue += getValueFormula(value);
+ }
params += '&searchingValues=' + searchingValue;
+ searchingValue = '';
+ value = '';
})
}
@@ -247,117 +312,3 @@
}
});
}
-
-function loadEventRegistrationForm()
-{
- hideById('selectDiv');
- hideById('searchDiv');
- hideById('listDiv');
- showLoader();
- $( '#dataEntryFormDiv' ).load( "dataentryform.action",
- {
- programStageInstanceId:getFieldValue('programStageInstanceId')
- },function( )
- {
- hideById('loaderDiv');
- showById('dataEntryFormDiv');
-
- var programStageInstanceId = getFieldValue('programStageInstanceId');
- if( programStageInstanceId == '' )
- {
- enable('createEventBtn');
- disable('deleteCurrentEventBtn');
- disable('completeBtn');
- enable( 'executionDate' );
- $('#executionDate').bind('change');
- }
- else
- {
- enable( 'executionDate' );
- if( getFieldValue('completed') == 'true')
- {
- enable('createEventBtn');
- disable('deleteCurrentEventBtn');
- disable('completeBtn');
- jQuery('#executionDate').unbind('change');
- }
- else
- {
- disable('createEventBtn');
- enable('deleteCurrentEventBtn');
- enable('completeBtn');
- jQuery('#executionDate').bind('change');
- }
- }
-
- } );
-}
-
-function loadEventForm()
-{
- hideById('dataEntryFormDiv');
- setFieldValue('executionDate', '');
- disable( 'executionDate' );
- disable('createEventBtn');
- disable('deleteCurrentEventBtn');
-
- var programId = getFieldValue('programId');
- if( programId == '' )
- {
- $('#executionDate').unbind('change');
- return;
- }
-
- showLoader();
-
- jQuery.getJSON( "loadProgramStageInstances.action",
- {
- programId: programId
- },
- function( json )
- {
- if( json.programStageInstances.length > 0 )
- {
- setFieldValue( 'programStageInstanceId', json.programStageInstances[0].id );
- setFieldValue( 'selectedProgramId', programId );
- $('#executionDate').bind('change');
- loadEventRegistrationForm();
- }
- else
- {
- enable( 'executionDate' );
- enable('createEventBtn');
- disable('deleteCurrentEventBtn');
- disable('completeBtn');
- hideById('loaderDiv');
- }
- });
-}
-
-function createNewEvent()
-{
- jQuery.postJSON( "createAnonymousEncounter.action",
- {
- programInstanceId: jQuery('select[id=programId] option:selected').attr('programInstanceId'),
- executionDate: getFieldValue('executionDate')
- },
- function( json )
- {
- selection.enable();
-
- if(json.response=='success')
- {
- disable('createEventBtn');
- enable('deleteCurrentEventBtn');
- setFieldValue('programStageInstanceId', json.message );
-
- selection.disable();
-
- loadEventRegistrationForm();
- }
- else
- {
- showWarningMessage( json.message );
- }
- });
-}
=== 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-06-23 15:48:45 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js 2012-06-25 02:11:55 +0000
@@ -61,7 +61,7 @@
function addAttributeOption()
{
- var rowId = 'advSearchBox' + jQuery('#advancedSearchTB select[name=searchingAttributeId]').length + 1;
+ var rowId = 'advSearchBox' + jQuery('#advancedSearchTB select[name=searchObjectId]').length + 1;
var contend = '<td>' + getInnerHTML('searchingAttributeIdTD') + '</td>';
contend += '<td>' + searchTextBox ;
contend += '<input type="button" class="small-button" value="-" onclick="removeAttributeOption(' + "'" + rowId + "'" + ');"></td>';
@@ -79,12 +79,12 @@
// Search patients by selected attribute
//------------------------------------------------------------------------------
-function searchingAttributeOnChange( this_ )
+function searchObjectOnChange( this_ )
{
var container = jQuery(this_).parent().parent().attr('id');
- var attributeId = jQuery('#' + container + ' [id=searchingAttributeId]').val();
+ var attributeId = jQuery('#' + container + ' [id=searchObjectId]').val();
var element = jQuery('#' + container + ' [id=searchText]');
- var valueType = jQuery('#' + container+ ' [id=searchingAttributeId] option:selected').attr('valueType');
+ var valueType = jQuery('#' + container+ ' [id=searchObjectId] option:selected').attr('valueType');
if( attributeId == '-1' )
{
@@ -116,7 +116,7 @@
function getDateField( container )
{
var dateField = '<select id="dateOperator" style="width:30px;" name="dateOperator" ><option value=">"> > </option><option value="="> = </option><option value="<"> < </option></select>';
- dateField += '<input type="text" id="searchText_' + container + '" name="searchText" maxlength="30" style="width:210px;" onkeyup="searchPatientsOnKeyUp( event );">';
+ dateField += '<input type="text" id="searchText_' + container + '" name="searchText" style="width:210px;">';
return dateField;
}
@@ -165,43 +165,45 @@
var flag = true;
var params = '';
var dateOperator = '';
- jQuery("#searchPatientDiv :input").each( function( i, item )
+ jQuery("#searchDiv :input").each( function( i, item )
{
- if( jQuery( item ).val() == '' )
+ var elementName = $(this).attr('name');
+ if( elementName=='searchText' && jQuery( item ).val() == '' )
{
showWarningMessage( i18n_specify_search_criteria );
flag = false;
}
-
- var elementId = $(this).attr('id');
- var elementName = $(this).attr('name');
- if( elementId =='dateOperator' )
- {
- dateOperator = jQuery(this).val();
- }
- else if( jQuery(this).val()!= null && jQuery(this).val() != '' )
- {
- var value =jQuery(this).val();
- if( dateOperator != '' )
+ });
+
+ if(flag){
+ jQuery("#searchDiv :input").each( function( i, item )
+ {
+ var elementId = $(this).attr('id');
+ var elementName = $(this).attr('name');
+ if( elementId =='dateOperator' )
{
- value = dateOperator + "'" + value + "'";
- dateOperator = "";
+ dateOperator = jQuery(this).val();
}
- if( elementName=='searchText')
- params += "searchText=";
else
- params += elementId + "=";
-
- params += htmlEncode(value) + "&";
- }
- });
-
- if(!flag) return;
-
- contentDiv = 'listPatientDiv';
- jQuery( "#loaderDiv" ).show();
- searchAdvancedPatient( params );
-
+ {
+ var value =jQuery(this).val();
+ if( dateOperator != '' )
+ {
+ value = dateOperator + "'" + value + "'";
+ dateOperator = "";
+ }
+ if( elementName=='searchText')
+ params += "searchText=";
+ else
+ params += elementId + "=";
+
+ params += htmlEncode(value) + "&";
+ }
+ });
+ contentDiv = 'listPatientDiv';
+ jQuery( "#loaderDiv" ).show();
+ searchAdvancedPatient( params );
+ }
}
// ----------------------------------------------------------------------------
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/form.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/form.js 2012-06-20 09:46:37 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/form.js 2012-06-25 02:11:55 +0000
@@ -7,9 +7,9 @@
hideById('dataEntryFormDiv');
hideById('dataRecordingSelectDiv');
- showById('searchPatientDiv');
+ showById('searchDiv');
- enable('searchingAttributeId');
+ enable('searchObjectId');
jQuery('#searchText').removeAttr('readonly');
enable('searchBtn');
enable('listPatientBtn');
@@ -23,7 +23,7 @@
{
hideById('dataRecordingSelectDiv');
hideById('dataEntryFormDiv');
- showById('searchPatientDiv');
+ showById('searchDiv');
showById('contentDiv');
jQuery('#createNewEncounterDiv').dialog('close');
}
@@ -41,7 +41,7 @@
{
hideById('dataRecordingSelectDiv');
hideById('dataEntryFormDiv');
- showById('searchPatientDiv');
+ showById('searchDiv');
hideLoader();
});
}
@@ -53,7 +53,7 @@
function showSelectedDataRecoding( patientId )
{
showLoader();
- hideById('searchPatientDiv');
+ hideById('searchDiv');
hideById('dataEntryFormDiv');
jQuery('#dataRecordingSelectDiv').load( 'selectDataRecording.action',
{
@@ -107,13 +107,13 @@
hideById('dataRecordingSelectDiv');
$('#contentDiv').load( 'searchPatient.action',
{
- searchingAttributeId: getFieldValue('searchingAttributeId'),
+ searchObjectId: getFieldValue('searchObjectId'),
searchText: getFieldValue('searchText'),
searchBySelectedOrgunit: byId('searchBySelectedOrgunit').checked
},
function()
{
- showById('searchPatientDiv');
+ showById('searchDiv');
hideLoader();
});
}
@@ -134,7 +134,7 @@
function showSelectedDataRecoding( patientId )
{
showLoader();
- hideById('searchPatientDiv');
+ hideById('searchDiv');
hideById('dataEntryFormDiv');
jQuery('#dataRecordingSelectDiv').load( 'selectDataRecording.action',
{
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/patient.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/patient.js 2012-06-24 01:28:50 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/patient.js 2012-06-25 02:11:55 +0000
@@ -8,7 +8,7 @@
function organisationUnitSelected( orgUnits, orgUnitNames )
{
showById('selectDiv');
- showById('searchPatientDiv');
+ showById('searchDiv');
hideById('listPatientDiv');
hideById('editPatientDiv');
hideById('enrollmentDiv');
@@ -294,7 +294,7 @@
{
hideById('listPatientDiv');
hideById('selectDiv');
- hideById('searchPatientDiv');
+ hideById('searchDiv');
hideById('migrationPatientDiv');
jQuery('#loaderDiv').show();
@@ -335,7 +335,7 @@
hideById('listPatientDiv');
setInnerHTML('editPatientDiv', '');
hideById('selectDiv');
- hideById('searchPatientDiv');
+ hideById('searchDiv');
hideById('migrationPatientDiv');
jQuery('#loaderDiv').show();
@@ -373,7 +373,7 @@
hideById('listPatientDiv');
hideById('editPatientDiv');
hideById('selectDiv');
- hideById('searchPatientDiv');
+ hideById('searchDiv');
hideById('migrationPatientDiv');
jQuery('#loaderDiv').show();
@@ -418,6 +418,7 @@
}
else
{
+ showEnrolmentField();
var type = jQuery('#programEnrollmentSelectDiv [name=programId] option:selected').attr('type');
if( type=='2')
@@ -484,7 +485,7 @@
hideById('listPatientDiv');
hideById('editPatientDiv');
hideById('selectDiv');
- hideById('searchPatientDiv');
+ hideById('searchDiv');
hideById('migrationPatientDiv');
jQuery('#loaderDiv').show();
@@ -575,7 +576,7 @@
if ( getFieldValue('isShowPatientList') == 'false' )
{
hideById('selectDiv');
- hideById('searchPatientDiv');
+ hideById('searchDiv');
hideById('listPatientDiv');
jQuery('#loaderDiv').show();
@@ -601,7 +602,7 @@
function onClickBackBtn()
{
showById('selectDiv');
- showById('searchPatientDiv');
+ showById('searchDiv');
showById('listPatientDiv');
hideById('editPatientDiv');
@@ -622,11 +623,11 @@
hideById('migrationPatientDiv');
showById('selectDiv');
- showById('searchPatientDiv');
+ showById('searchDiv');
if( statusSearching == 0)
{
- loadAllPatients();
+ loadAllPatient();
}
else if( statusSearching == 1 )
{
@@ -638,7 +639,7 @@
// Load all patients
// -----------------------------------------------------------------------------
-function loadAllPatients()
+function loadAllPatient()
{
hideById('listPatientDiv');
hideById('editPatientDiv');
@@ -795,7 +796,7 @@
function showSelectedDataRecoding( patientId )
{
showLoader();
- hideById('searchPatientDiv');
+ hideById('searchDiv');
hideById('dataEntryFormDiv');
hideById('migrationPatientDiv');
jQuery('#dataRecordingSelectDiv').load( 'selectDataRecording.action',
@@ -841,7 +842,7 @@
{
hideById('listPatientDiv');
hideById('selectDiv');
- hideById('searchPatientDiv');
+ hideById('searchDiv');
jQuery('#loaderDiv').show();
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/relationshipPatient.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/relationshipPatient.js 2012-06-15 07:11:51 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/relationshipPatient.js 2012-06-25 02:11:55 +0000
@@ -25,7 +25,7 @@
function showAddRelationshipPatient( patientId, isShowPatientList )
{
hideById( 'selectDiv' );
- hideById( 'searchPatientDiv' );
+ hideById( 'searchDiv' );
hideById( 'listPatientDiv' );
hideById( 'listRelationshipDiv' );
setInnerHTML('editPatientDiv', '');
@@ -93,7 +93,7 @@
success: function( json ) {
hideById('addRelationshipDiv');
showById('selectDiv');
- showById('searchPatientDiv');
+ showById('searchDiv');
showById('listPatientDiv');
jQuery('#loaderDiv').hide();
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonProgramStageDataElements.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonProgramStageDataElements.vm 2012-06-23 11:05:13 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonProgramStageDataElements.vm 2012-06-25 02:11:55 +0000
@@ -4,6 +4,12 @@
{
"id": "${programStageDataElement.dataElement.id}",
"name": "$!encoder.jsonEncode( ${programStageDataElement.dataElement.name} )",
+ "type":
+ #if( $!programStageDataElement.dataElement.optionSet )
+ "optionset",
+ #else
+ "${programStageDataElement.dataElement.type}",
+ #end
"compulsory": "${programStageDataElement.compulsory}"
}#if( $velocityCount < $size ),#end
#end
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programStageInstancesList.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programStageInstancesList.vm 2012-06-24 12:54:56 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programStageInstancesList.vm 2012-06-25 02:11:55 +0000
@@ -1,72 +1,78 @@
<table>
- <tr>
- <td class='text-column' >$i18n.getString( "search_result_matching_the_search_criteria" ):</td>
- <td> </td>
- <td> </td>
- <td id='searchInforTD'></td>
- </tr>
- <tr>
- <td class='text-column'>$i18n.getString( "total_result" )</td>
- <td> </td>
- <td> </td>
- <td>$!total</td>
- </tr>
+ <tr>
+ <td class='text-column' >$i18n.getString( "search_result_matching_the_search_criteria" ):</td>
+ <td> </td>
+ <td> </td>
+ <td id='searchInforTD'></td>
+ </tr>
+
+ <tr>
+ <td class='text-column'>$i18n.getString( "total_result" )</td>
+ <td> </td>
+ <td> </td>
+ <td>$!total</td>
+ </tr>
</table>
<table class="mainPageTable">
-<tr>
- <td>
- <table class="listTable">
- <thead>
- <tr>
- <th>#</th>
- #set($index = 0)
- #foreach( $col in $grid.getHeaders() )
- #if( $index > 0 )
- <th>$col.name</th>
- #end
- #set($index = $index + 1)
- #end
- <th>$i18n.getString( "operations" )</th>
+ <tr>
+ <td>
+ <table class="listTable">
+ <thead>
+ <tr>
+ <th>#</th>
+ #set($index = 0)
+ #foreach( $col in $grid.getHeaders() )
+ #if( $index > 0 )
+ <th>$col.name</th>
+ #end
+ #set($index = $index + 1)
+ #end
+ <th>$i18n.getString( "operations" )</th>
+ </tr>
+ </thead>
+
+ <tbody id="list">
+ #set($noCols = $grid.getHeaders().size())
+ #foreach( $row in $grid.getRows() )
+ #set($index = 0)
+ <tr id="row" #alternate( $mark )>
+ <td>
+ #set( $nr = ( ( $paging.getCurrentPage() - 1 ) * $paging.pageSize ) + $velocityCount )
+ $nr
+ </td>
+
+ #foreach( $col in $row )
+ #if( $index == 0 )
+ #set($psid = $col)
+ #elseif( $index < $noCols )
+ <td>$!col</td>
+ #end
+ #set($index = $index + 1)
+ #end
+
+ <td>
+ <a href="javascript:showUpdateEvent( $psid )" title='$i18n.getString( "edit_profile" )'><img src="../images/edit.png" alt='$i18n.getString( "edit_profile" )'></a>
+ <a href="javascript:removeEvent( $psid )" title='$i18n.getString( "remove" )'><img src="../images/delete.png" alt='$i18n.getString( "remove" )'></a>
+ </td>
+ #set( $mark = !$mark)
+ <script>
+ jQuery('#row').attr('id','tr' + "$psid");
+ </script>
+ </tr>
+ #end
+ </tbody>
+ </table>
+ </td>
</tr>
- </thead>
-
- <tbody id="list">
- #set($noCols = $grid.getHeaders().size())
- #foreach( $row in $grid.getRows() )
- #set($index = 0)
- <tr id="row" #alternate( $mark )>
- <td>
- #set( $nr = ( ( $paging.getCurrentPage() - 1 ) * $paging.pageSize ) + $velocityCount )${nr}</td>
- #foreach( $col in $row )
- #if( $index == 0 )
- #set($psid = $col)
- #elseif( $index < $noCols )
- <td>$!col</td>
- #end
- #set($index = $index + 1)
- #end
- <td>
- <a href="javascript:showUpdateEvent( $psid )" title='$i18n.getString( "edit_profile" )'><img src="../images/edit.png" alt='$i18n.getString( "edit_profile" )'></a>
- <a href="javascript:removeEvent( $psid )" title='$i18n.getString( "remove" )'><img src="../images/delete.png" alt='$i18n.getString( "remove" )'></a>
+ <tr>
+ #set( $noCol = $grid.getHeaders().size() + 3 )
+ <td colspan="$noCol">
+ <p></p>
+ <div class="paging-container">
+ #parse( "/dhis-web-commons/paging/paging.vm" )
+ </div>
</td>
- #set( $mark = !$mark)
- <script>jQuery('#row').attr('id','tr' + "$psid");</script>
- </tr>
- #end
- </tbody>
- </table>
- </td>
-</tr>
-
-<tr>
- #set( $noCol = $grid.getHeaders().size() + 3 )
- <td colspan="$noCol">
- <p></p>
- <div class="paging-container">
- #parse( "/dhis-web-commons/paging/paging.vm" )
- </div>
- </td>
- <td></td>
-</tr>
+ <td></td>
+ </tr>
</table>
=== added file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/searchPatientCriteria.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/searchPatientCriteria.vm 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/searchPatientCriteria.vm 2012-06-25 02:11:55 +0000
@@ -0,0 +1,47 @@
+<table style="margin-bottom:8px">
+ <tr>
+ <td>
+ <label>$i18n.getString( "registering_unit" )</label>
+ </td>
+ <td>
+ <input type="text" id='orgunitName' readonly="readonly" #if( $organisationUnit ) value="$encoder.htmlEncode( $organisationUnit.name )" #else value="[$i18n.getString( "please_select_village" )]" #end style="min-width:350px">
+ </td>
+ <td>
+ <input type="button" class='large-button' id='listPatientBtn' value="$i18n.getString( 'list_all_patients' )" onclick="javascript:listAllPatient();" #if($organisationUnit) #else disabled #end>
+ </td>
+ </tr>
+</table>
+
+<table id='advancedSearchTB'>
+ <tbody>
+ <tr id='advSearchBox0'>
+ <td id='searchingAttributeIdTD'>
+ <select id="searchObjectId" name="searchObjectId" #if( $patientAttributes.size() == 0 ) disabled="disabled" #end onchange="searchObjectOnChange(this)">
+ <option value="">$i18n.getString( "search_by_name_identifier" )</option>
+ <option value="0">$i18n.getString( "search_by_program" )</option>
+ <option value="-1">$i18n.getString( "date_of_birth" )</option>
+ <option value="-2">$i18n.getString( "gender" )</option>
+ <!-- option value="-3">$i18n.getString( "age" )</option -->
+ <option value="-4">$i18n.getString( "phone_number" )</option>
+ #foreach( $attribute in $patientAttributes )
+ <option value="$attribute.id" valueType='$attribute.valueType'>$encoder.htmlEncode( $attribute.name )</option>
+ #end
+ </select>
+ <em title="$i18n.getString( "required" )" class="required">*</em></label>
+ </td>
+ <td>
+ <input type="text" id="searchText" name="searchText" value="$!searchText" onkeyup='searchPatientsOnKeyUp( event );' style='margin-right:30px;'>
+ </td>
+ <td></td>
+ <td><input type="button" class='small-button' value='+' onclick='addAttributeOption();'>
+ <td>
+ $i18n.getString('search_by_selected_unit')
+ <input type='checkbox' id='searchBySelectedOrgunit' name='searchBySelectedOrgunit' value='true' />
+ </td>
+ <td>
+ <input type="button" class='large-button' value='$i18n.getString( "search" )' onclick='validateAdvancedPatients();'>
+ </td>
+ </td>
+ </tr>
+ </tbody>
+</table>
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/select.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/select.vm 2012-06-23 15:48:45 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/select.vm 2012-06-25 02:11:55 +0000
@@ -1,58 +1,9 @@
<h3>$i18n.getString( "name_based_data_entry" ) #openHelp('name_based_data_entry')</h3>
-<div id='searchPatientDiv'>
- <table style="margin-bottom:8px">
- <tr>
- <td>
- <label>$i18n.getString( "registering_unit" )</label>
- </td>
- <td>
- <input type="text" id='orgunitName' readonly="readonly" #if( $organisationUnit ) value="$encoder.htmlEncode( $organisationUnit.name )" #else value="[$i18n.getString( "please_select_village" )]" #end style="min-width:350px">
- </td>
- <td>
- <input type="button" class='large-button' id='listPatientBtn' value="$i18n.getString( 'list_all_patients' )" onclick="javascript:listAllPatient();" #if($organisationUnit) #else disabled #end>
- </td>
- </tr>
- </table>
-
-
- <div id='searchPatientDiv'>
- <table id='advancedSearchTB'>
- <tbody>
- <tr id='advSearchBox0'>
- <td id='searchingAttributeIdTD'>
- <select id="searchingAttributeId" name="searchingAttributeId" #if( $patientAttributes.size() == 0 ) disabled="disabled" #end onchange="searchingAttributeOnChange(this)">
- <option value="">$i18n.getString( "search_by_name_identifier" )</option>
- <option value="0">$i18n.getString( "search_by_program" )</option>
- <option value="-1">$i18n.getString( "date_of_birth" )</option>
- <option value="-2">$i18n.getString( "gender" )</option>
- <!-- option value="-3">$i18n.getString( "age" )</option -->
- <option value="-4">$i18n.getString( "phone_number" )</option>
- #foreach( $attribute in $patientAttributes )
- <option value="$attribute.id" valueType='$attribute.valueType'>$encoder.htmlEncode( $attribute.name )</option>
- #end
- </select>
- <em title="$i18n.getString( "required" )" class="required">*</em></label>
- </td>
- <td>
- <input type="text" id="searchText" name="searchText" value="$!searchText" onkeyup='searchPatientsOnKeyUp( event );'>
-
- </td>
- <td></td>
- <td><input type="button" class='small-button' value='+' onclick='addAttributeOption();'>
- <td>
- $i18n.getString('search_by_selected_unit')
- <input type='checkbox' id='searchBySelectedOrgunit' name='searchBySelectedOrgunit' value='true' />
- </td>
- <td>
- <input type="button" class='large-button' value='$i18n.getString( "search" )' onclick='validateAdvancedPatients();'>
- </td>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
+<div id='searchDiv'>
+ #parse( "dhis-web-caseentry/searchPatientCriteria.vm" )
</div>
+
<span id='message'></span>
<div id='contentDiv'></div>
<div id='dataRecordingSelectDiv'></div>
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/selectPatient.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/selectPatient.vm 2012-06-23 15:48:45 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/selectPatient.vm 2012-06-25 02:11:55 +0000
@@ -1,54 +1,7 @@
-<div id='selectDiv'>
- <h3>$i18n.getString( "patient_management" ) #openHelp( "patient" )</h3>
-
- <input type="hidden" id="isShowPatientList" name="isShowPatientList" />
- <table>
- <tr>
- <td><label>$i18n.getString( "registering_unit" )</label></td>
- <td style="padding-right:5px"><input type="text" id='selectedOrgunitText' readonly style="min-width:16em"></td>
- <td style="padding-right:5px">
- <input type="button" class='large-button' id='listPatientBtn' value="$i18n.getString( 'list_all_patients' )" onclick='loadAllPatients();'>
- </td>
- <td><input type="button" class='large-button' value='$i18n.getString( "add_new" )' onclick="showAddPatientForm();"></td>
- </tr>
- </table>
-</div>
+<h3>$i18n.getString( "patient_management" ) #openHelp( "patient" )</h3>
-<div id='searchPatientDiv'>
- <table id='advancedSearchTB'>
- <tbody>
- <tr id='advSearchBox0'>
- <td id='searchingAttributeIdTD'>
- <select id="searchingAttributeId" name="searchingAttributeId" #if( $patientAttributes.size() == 0 ) disabled="disabled" #end onchange="searchingAttributeOnChange(this)">
- <option value="">$i18n.getString( "search_by_name_identifier" )</option>
- <option value="0">$i18n.getString( "search_by_program" )</option>
- <option value="-1">$i18n.getString( "date_of_birth" )</option>
- <option value="-2">$i18n.getString( "gender" )</option>
- <!-- option value="-3">$i18n.getString( "age" )</option -->
- <option value="-4">$i18n.getString( "phone_number" )</option>
- #foreach( $attribute in $patientAttributes )
- <option value="$attribute.id" valueType='$attribute.valueType'>$encoder.htmlEncode( $attribute.name )</option>
- #end
- </select>
- <em title="$i18n.getString( "required" )" class="required">*</em></label>
- </td>
- <td>
- <input type="text" id="searchText" name="searchText" value="$!searchText" onkeyup='searchPatientsOnKeyUp( event );'>
-
- </td>
- <td></td>
- <td><input type="button" class='small-button' value='+' onclick='addAttributeOption();'> </td>
- <td>
- $i18n.getString('search_by_selected_unit')
- <input type='checkbox' id='searchBySelectedOrgunit' name='searchBySelectedOrgunit' value='true' />
- </td>
- <td>
- <input type="button" class='large-button' value='$i18n.getString( "search" )' onclick='validateAdvancedPatients();'>
- </td>
- <td> </td>
- </tr>
- </tbody>
- </table>
+<div id='searchDiv'>
+ #parse( "dhis-web-caseentry/searchPatientCriteria.vm" )
</div>
<div id='listPatientDiv'></div> <!-- List searching patients -->
@@ -159,7 +112,7 @@
setFieldValue('selectedOrgunitText', '$organisationUnit.name' );
#else
setFieldValue('selectedOrgunitText', '$organisationUnit.name' );
- showById('searchPatientDiv');
+ showById('searchDiv');
#end
</script>
\ No newline at end of file