dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #17948
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 7357: Add function to list / edit / add events into Anonymous entry form.
------------------------------------------------------------
revno: 7357
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Sat 2012-06-23 18:05:13 +0700
message:
Add function to list / edit / add events into Anonymous entry form.
added:
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/GetProgramStageDataElementsAction.java
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
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstanceService.java
dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramStageInstanceStore.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/CreateAnonymousEncounterAction.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/LoadAnonymousProgramsAction.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/LoadDataEntryAction.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/RemoveCurrentEncounterAction.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/RegisterPatientLocationAction.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml
dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties
dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml
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/dataEntryForm.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/entry.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/patientForm.vm
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/style/style.css
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/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/program/ProgramStageInstanceService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstanceService.java 2012-06-14 13:07:22 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstanceService.java 2012-06-23 11:05:13 +0000
@@ -94,5 +94,4 @@
Collection<Integer> organisationUnits, int level, Date startDate, Date endDate );
List<Grid> getProgramStageInstancesReport( ProgramInstance programInstance, I18nFormat format, I18n i18n );
-
}
=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramStageInstanceStore.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramStageInstanceStore.java 2012-06-20 08:18:00 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramStageInstanceStore.java 2012-06-23 11:05:13 +0000
@@ -292,13 +292,14 @@
return jdbcTemplate.queryForInt( sql );
}
+ // -------------------------------------------------------------------------
+ // Supportive methods
+ // -------------------------------------------------------------------------
+
private String getTabularReportSql( boolean count, ProgramStage programStage, List<String> searchingKeys,
Collection<Integer> orgUnits, int level, int maxLevel, Date startDate, Date endDate, boolean descOrder,
Integer min, Integer max )
{
- String sDate = DateUtils.getMediumDateString( startDate );
- String eDate = DateUtils.getMediumDateString( endDate );
-
String selector = count ? "count(*) " : "* ";
String sql = "select " + selector + "from ( select psi.programstageinstanceid, psi.executiondate,";
@@ -382,9 +383,16 @@
sql += "join _orgunitstructure ous on (psi.organisationunitid=ous.organisationunitid) ";
sql += "where psi.programstageid=" + programStage.getId() + " ";
- sql += "and psi.executiondate >= '" + sDate + "' ";
- sql += "and psi.executiondate < '" + eDate + "' ";
-
+
+ if ( startDate != null && endDate != null )
+ {
+ String sDate = DateUtils.getMediumDateString( startDate );
+ String eDate = DateUtils.getMediumDateString( endDate );
+
+ sql += "and psi.executiondate >= '" + sDate + "' ";
+ sql += "and psi.executiondate < '" + eDate + "' ";
+ }
+
if ( orgUnits != null )
{
sql += "and ou.organisationunitid in (" + TextUtils.getCommaDelimitedString( orgUnits ) + ") ";
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/CreateAnonymousEncounterAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/CreateAnonymousEncounterAction.java 2012-06-07 04:23:40 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/CreateAnonymousEncounterAction.java 2012-06-23 11:05:13 +0000
@@ -32,8 +32,10 @@
import org.hisp.dhis.caseentry.state.SelectedStateManager;
import org.hisp.dhis.i18n.I18n;
import org.hisp.dhis.i18n.I18nFormat;
+import org.hisp.dhis.program.Program;
import org.hisp.dhis.program.ProgramInstance;
import org.hisp.dhis.program.ProgramInstanceService;
+import org.hisp.dhis.program.ProgramService;
import org.hisp.dhis.program.ProgramStage;
import org.hisp.dhis.program.ProgramStageInstance;
import org.hisp.dhis.program.ProgramStageInstanceService;
@@ -51,14 +53,21 @@
// -------------------------------------------------------------------------
// Dependencies
// -------------------------------------------------------------------------
-
+
private SelectedStateManager selectedStateManager;
public void setSelectedStateManager( SelectedStateManager selectedStateManager )
{
this.selectedStateManager = selectedStateManager;
}
-
+
+ private ProgramService programService;
+
+ public void setProgramService( ProgramService programService )
+ {
+ this.programService = programService;
+ }
+
private ProgramInstanceService programInstanceService;
public void setProgramInstanceService( ProgramInstanceService programInstanceService )
@@ -86,17 +95,16 @@
{
this.i18n = i18n;
}
-
+
// -------------------------------------------------------------------------
// Input/Output
// -------------------------------------------------------------------------
-
- private Integer programInstanceId;
-
- public void setProgramInstanceId( Integer programInstanceId )
+ private Integer programId;
+
+ public void setProgramId( Integer programId )
{
- this.programInstanceId = programInstanceId;
+ this.programId = programId;
}
public String executionDate;
@@ -123,9 +131,15 @@
{
Date date = format.parseDate( executionDate );
- if ( date != null )
- {
- ProgramInstance programInstance = programInstanceService.getProgramInstance( programInstanceId );
+ if ( date == null )
+ {
+ message = i18n.getString( "please_enter_report_date" );
+ }
+ else
+ {
+ Program program = programService.getProgram( programId );
+
+ ProgramInstance programInstance = programInstanceService.getProgramInstances( program ).iterator().next();
ProgramStageInstance programStageInstance = new ProgramStageInstance();
programStageInstance.setProgramInstance( programInstance );
@@ -139,14 +153,10 @@
programStageInstance.setOrganisationUnit( selectedStateManager.getSelectedOrganisationUnit() );
int id = programStageInstanceService.addProgramStageInstance( programStageInstance );
-
+
message = id + "";
-
- return SUCCESS;
}
- message = i18n.getString("please_enter_report_date");
-
- return INPUT;
+ return (date != null) ? SUCCESS : INPUT;
}
}
=== added file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/GetProgramStageDataElementsAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/GetProgramStageDataElementsAction.java 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/GetProgramStageDataElementsAction.java 2012-06-23 11:05:13 +0000
@@ -0,0 +1,88 @@
+/*
+ * Copyright (c) 2004-2012, 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.caseentry.action.caseentry;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.hisp.dhis.program.ProgramStageDataElement;
+import org.hisp.dhis.program.ProgramStageService;
+
+import com.opensymphony.xwork2.Action;
+
+/**
+ * @author Chau Thu Tran
+ *
+ * @version $GetProgramStageDataElementsAction.java Jun 21, 2012 9:43:56 PM$
+ */
+public class GetProgramStageDataElementsAction
+ implements Action
+{
+ // -------------------------------------------------------------------------
+ // Dependencies
+ // -------------------------------------------------------------------------
+
+ private ProgramStageService programStageService;
+
+ public void setProgramStageService( ProgramStageService programStageService )
+ {
+ this.programStageService = programStageService;
+ }
+
+ // -------------------------------------------------------------------------
+ // Input/Output
+ // -------------------------------------------------------------------------
+
+ private Integer programStageId;
+
+ public void setProgramStageId( Integer programStageId )
+ {
+ this.programStageId = programStageId;
+ }
+
+ private List<ProgramStageDataElement> programStageDataElements;
+
+ public List<ProgramStageDataElement> getProgramStageDataElements()
+ {
+ return programStageDataElements;
+ }
+
+ // -------------------------------------------------------------------------
+ // Implementation Action
+ // -------------------------------------------------------------------------
+
+ @Override
+ public String execute()
+ throws Exception
+ {
+ programStageDataElements = new ArrayList<ProgramStageDataElement>( programStageService.getProgramStage(
+ programStageId ).getProgramStageDataElements() );
+
+ return SUCCESS;
+ }
+}
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/LoadAnonymousProgramsAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/LoadAnonymousProgramsAction.java 2012-05-23 15:02:50 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/LoadAnonymousProgramsAction.java 2012-06-23 11:05:13 +0000
@@ -27,14 +27,14 @@
package org.hisp.dhis.caseentry.action.caseentry;
-import java.util.ArrayList;
import java.util.Collection;
+import java.util.List;
import org.hisp.dhis.organisationunit.OrganisationUnit;
+import org.hisp.dhis.organisationunit.OrganisationUnitLevel;
+import org.hisp.dhis.organisationunit.OrganisationUnitService;
import org.hisp.dhis.ouwt.manager.OrganisationUnitSelectionManager;
import org.hisp.dhis.program.Program;
-import org.hisp.dhis.program.ProgramInstance;
-import org.hisp.dhis.program.ProgramInstanceService;
import org.hisp.dhis.program.ProgramService;
import com.opensymphony.xwork2.Action;
@@ -58,6 +58,13 @@
this.selectionManager = selectionManager;
}
+ private OrganisationUnitService organisationUnitService;
+
+ public void setOrganisationUnitService( OrganisationUnitService organisationUnitService )
+ {
+ this.organisationUnitService = organisationUnitService;
+ }
+
private ProgramService programService;
public void setProgramService( ProgramService programService )
@@ -65,22 +72,29 @@
this.programService = programService;
}
- private ProgramInstanceService programInstanceService;
-
- public void setProgramInstanceService( ProgramInstanceService programInstanceService )
- {
- this.programInstanceService = programInstanceService;
- }
-
// -------------------------------------------------------------------------
// Output
// -------------------------------------------------------------------------
- private Collection<ProgramInstance> programInstances = new ArrayList<ProgramInstance>();
-
- public Collection<ProgramInstance> getProgramInstances()
- {
- return programInstances;
+ private OrganisationUnit orgunit;
+
+ public OrganisationUnit getOrgunit()
+ {
+ return orgunit;
+ }
+
+ private Collection<Program> programs;
+
+ public Collection<Program> getPrograms()
+ {
+ return programs;
+ }
+
+ private List<OrganisationUnitLevel> levels;
+
+ public List<OrganisationUnitLevel> getLevels()
+ {
+ return levels;
}
// -------------------------------------------------------------------------
@@ -90,17 +104,11 @@
public String execute()
throws Exception
{
- OrganisationUnit orgunit = selectionManager.getSelectedOrganisationUnit();
-
- if ( orgunit != null )
- {
- Collection<Program> programs = programService.getPrograms( Program.SINGLE_EVENT_WITHOUT_REGISTRATION, orgunit );
-
- if ( programs != null && programs.size() > 0 )
- {
- programInstances = programInstanceService.getProgramInstances( programs );
- }
- }
+ orgunit = selectionManager.getSelectedOrganisationUnit();
+
+ programs = programService.getPrograms( Program.SINGLE_EVENT_WITHOUT_REGISTRATION, orgunit );
+
+ levels = organisationUnitService.getFilledOrganisationUnitLevels();
return SUCCESS;
}
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/LoadDataEntryAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/LoadDataEntryAction.java 2012-06-14 04:41:08 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/LoadDataEntryAction.java 2012-06-23 11:05:13 +0000
@@ -170,12 +170,7 @@
programStageInstance = programStageInstanceService.getProgramStageInstance( programStageInstanceId );
program = programStageInstance.getProgramStage().getProgram();
-
- if ( !program.isRegistration() && programStageInstance.isCompleted() )
- {
- return SUCCESS;
- }
-
+
selectedStateManager.setSelectedProgramStageInstance( programStageInstance );
// ---------------------------------------------------------------------
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/RemoveCurrentEncounterAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/RemoveCurrentEncounterAction.java 2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/RemoveCurrentEncounterAction.java 2012-06-23 11:05:13 +0000
@@ -57,11 +57,11 @@
// Input
// -------------------------------------------------------------------------
- private int programStageInstanceId;
+ private int id;
- public void setProgramStageInstanceId( int programStageInstanceId )
+ public void setId( int id )
{
- this.programStageInstanceId = programStageInstanceId;
+ this.id = id;
}
private I18n i18n;
@@ -91,7 +91,7 @@
{
try
{
- ProgramStageInstance programStageInstance = programStageInstanceService.getProgramStageInstance( programStageInstanceId );
+ ProgramStageInstance programStageInstance = programStageInstanceService.getProgramStageInstance( id );
programStageInstanceService.deleteProgramStageInstance( programStageInstance );
}
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/RegisterPatientLocationAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/RegisterPatientLocationAction.java 2012-03-27 14:19:09 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/RegisterPatientLocationAction.java 2012-06-23 11:05:13 +0000
@@ -61,7 +61,7 @@
}
// -------------------------------------------------------------------------
- // Action implementation
+ // Setter
// -------------------------------------------------------------------------
private Integer patientId;
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml 2012-06-15 04:41:31 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml 2012-06-23 11:05:13 +0000
@@ -367,8 +367,8 @@
scope="prototype">
<property name="selectionManager"
ref="org.hisp.dhis.ouwt.manager.OrganisationUnitSelectionManager" />
+ <property name="organisationUnitService" ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
<property name="programService" ref="org.hisp.dhis.program.ProgramService" />
- <property name="programInstanceService" ref="org.hisp.dhis.program.ProgramInstanceService" />
</bean>
<bean
@@ -386,9 +386,17 @@
<property name="selectedStateManager"
ref="org.hisp.dhis.caseentry.state.SelectedStateManager" />
<property name="programInstanceService" ref="org.hisp.dhis.program.ProgramInstanceService" />
+ <property name="programService" ref="org.hisp.dhis.program.ProgramService" />
<property name="programStageInstanceService"
ref="org.hisp.dhis.program.ProgramStageInstanceService" />
</bean>
+
+ <bean
+ id="org.hisp.dhis.caseentry.action.caseentry.GetProgramStageDataElementsAction"
+ class="org.hisp.dhis.caseentry.action.caseentry.GetProgramStageDataElementsAction"
+ scope="prototype">
+ <property name="programStageService" ref="org.hisp.dhis.program.ProgramStageService" />
+ </bean>
<!-- Patient -->
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties 2012-06-18 07:02:55 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties 2012-06-23 11:05:13 +0000
@@ -65,7 +65,7 @@
intro_visit_plan=View the visit plan to get an overview of outstanding, pending and completed visits.
other_facility=Private facility
error_required_field=Please enter value for all data element in red color.
-complete_confirm_message=Are you sure this Program stage is completed ? You can not change its data after it is completed.
+complete_confirm_message=Are you sure this event is completed ?
complete=Complete data entry
case_aggregation_form=Person aggregation form
dataset_list=Dataset List
@@ -218,13 +218,13 @@
representative_info=Representative's information
relationship_for=Relationship for
date_of_edit=Date of edit
-anonymous_events=Anonymous events
-intro_anonymous_events=Register anonymous events. The data to register is defined by a single event anonymous program.
+anonymous_events=Single events without registration
+intro_anonymous_events=Register Single events without registration. The data to register is defined by a single event without registration program.
create_new_event=Create new event
delete_current_event=Delete current event
-delete_current_event_success=Delete current event successfully
+delete_event_success=Delete event successfully
please_enter_report_date=Please enter report date
-comfirm_delete_current_event=Are you sure you want to delete the current event?
+comfirm_delete_event=Are you sure you want to delete the event?
registered_by_orgunit=Registered by facility
event_information=Event information
history_events=History events
@@ -361,3 +361,7 @@
set_as_representative_and_copy_attributes_for_the_person = Set as representative and copy attributes for the person
is_not_representative = Is not representative ?
save_all = Save all
+list_all_events = List All Events
+search_events_by_dataelements = Search events by data elements
+list_all_events = List all events
+specify_data_element = Please specify a data element
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml 2012-06-18 08:38:51 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml 2012-06-23 11:05:13 +0000
@@ -151,6 +151,18 @@
<result name="success" type="velocity-json">/dhis-web-caseentry/jsonOptions.vm</result>
</action>
+ <action name="getProgramStageDataElementList"
+ class="org.hisp.dhis.caseentry.action.caseentry.GetProgramStageDataElementsAction">
+ <result name="success" type="velocity-json">/dhis-web-caseentry/jsonProgramStageDataElements.vm</result>
+ </action>
+
+ <action name="searchProgramStageInstances"
+ class="org.hisp.dhis.caseentry.action.report.GenerateTabularReportAction">
+ <result name="success" type="velocity">/content.vm</result>
+ <param name="page">/dhis-web-caseentry/programStageInstancesList.vm</param>
+ <param name="requiredAuthorities">F_NAME_BASED_DATA_ENTRY</param>
+ </action>
+
<!-- save value -->
<action name="saveValue"
=== 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-13 08:22:35 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/anonymousRegistration.vm 2012-06-23 11:05:13 +0000
@@ -1,45 +1,111 @@
-<h3>$i18n.getString( "anonymous_events" )</h3>
+<script type="text/javascript">
+ jQuery(document).ready( function(){
+ datePickerInRange( 'startDate' , 'endDate' );
+
+ jQuery('#criteriaDiv :input').each( function( idx, item ){
+ disable(this.id);
+ });
+ enable('orgunitName');
+ enable('programId');
+ });
+</script>
+
+<h3>$i18n.getString( "anonymous_events" ) #openHelp( "patient" )</h3>
+<input type='hidden' id='orgunitId' name='orgunitId' value='$orgunit.id'>
+<input type='hidden' id='programStageInstanceId' name='programStageInstanceIdrgunitId'>
+<input type='hidden' id='programStageId' name='programStageId'>
+<select multiple id='compulsoryDE' name='compulsoryDE' class='hidden'></select>
-<div class="actions">
- <input type="button" class='button' id="createEventBtn" value="$i18n.getString('create_new_event')" onClick="javascript: createNewEvent();" disabled="disabled">
- <input type="button" class='button' id="completeBtn" value="$i18n.getString('complete')" onClick="doComplete();" disabled="disabled" style="margin-bottom:10px">
- <input type="button" class='button' id="deleteCurrentEventBtn" value="$i18n.getString('delete_current_event')" onClick="javascript: deleteCurrentEvent();" disabled="disabled" >
-</div>
-
-<div id="dataRecordingSelectDiv" class="inputCriteria" style="width:480px;height:75px;">
- <input type='hidden' id="programStageInstanceId">
- <input type='hidden' id="programStageId">
- <input type='hidden' id='selectedProgramId'>
- <table>
- <tr>
- <td class='text-column'>$i18n.getString('program')</td>
- <td>
- <select id='programId' name='programId' onchange='loadEventForm();'>
- <option value="">[ $i18n.getString('please_select') ]</option>
- #foreach( $programInstance in $programInstances)
- <option value="$programInstance.program.id" type='$programInstance.program.type' programInstanceId='$programInstance.id'>$programInstance.program.name</option>
- #end
- </select>
- </td>
- </tr>
- <tr>
- <td class='text-column'><label for="executionDate">$i18n.getString( "report_date" ) </label></td>
- <td><input type="text" id="executionDate" name="executionDate" value="$!format.formatDate( $programStageInstance.executionDate )" >
- <script type="text/javascript">
- datePickerValid( 'executionDate', false );
- disable( 'executionDate' );
- </script>
- </td>
- </tr>
- </table>
+<div id='criteriaDiv'>
+ <div id='selectDiv'>
+ <table>
+ <tr>
+ <td><label>$i18n.getString( "registering_unit" )</label></td>
+ <td><input type="text" id='orgunitName' name='orgunitName' value='$orgunit.name' readonly></td>
+ </tr>
+ <tr>
+ <td>
+ $i18n.getString("program") <em title="$i18n.getString( "required" )" class="required">*</em></label>
+ </td>
+ <td>
+ <select type="text" id="programId" name="programId" onchange='getDataElements();' >
+ <option value='' programStageId='' >[$i18n.getString("please_select")]</option>
+ #foreach( $program in $programs )
+ #foreach( $programStage in $program.programStages )
+ <option value='$program.id' programStageId='$programStage.id'>$program.name</option>
+ #end
+ #end
+ </select>
+ <input type="button" id='listBtn' value="$i18n.getString( 'list_all_events' )" onclick='validateSearchEvents( true );'>
+ <input type="button" id='addBtn' value='$i18n.getString( "add_new" )' onclick="showAddEventForm();">
+ </td>
+ </tr>
+ <tr><td> </td></tr>
+ <tr>
+ <td>$i18n.getString('use_data_from_level')</td>
+ <td colspan='2'>
+ <input type="radio" id='facilityLB1' name="facilityLB" value="selected" checked> $i18n.getString('selected')
+ <input type="radio" id='facilityLB2' name="facilityLB" value="childrenOnly"> $i18n.getString('children_only')
+ <input type="radio" id='facilityLB3' name="facilityLB" value="all"> $i18n.getString('all')
+ </td>
+ </tr>
+ <tr>
+ <td>$i18n.getString('show_hierachy_from_level')</td>
+ <td colspan='2'>
+ #foreach( $level in $levels )
+ <input type="radio" id='level${level.level}' name="level" value="${level.level}" checked> $level.name
+ #end
+ <td>
+ </tr>
+ <tr>
+ <td>$i18n.getString('report_date')</td>
+ <td><input type="text" id='startDate' name='startDate' style='width:238px;'>
+ $i18n.getString('to')
+ <input type="text" id='endDate' name='endDate' style='width:238px;'>
+ </td>
+ <td><input type="button" id='searchBtn' class='large-button' value='$i18n.getString( "search" )' onclick='validateSearchEvents( false )'></td>
+ </tr>
+ <tr>
+ <td valign="top">$i18n.getString('data_elements')</td>
+ <td colspan='2'>
+ <table id='advancedSearchTB'>
+ <tbody>
+ <tr id='advSearchBox0'>
+ <td id='searchingAttributeIdTD' >
+ <select id="dataElementId" name="dataElementId" style='margin-right:15px;'></select>
+ </td>
+ <td>
+ <input type="text" id="searchText" name="searchText" value="$!searchText" style='margin-right:30px;'>
+ </td>
+ <td><input type="button" id='addSearchOptionBtn' name='addSearchOptionBtn' class='small-button' value='+' onclick='addAttributeOption();'> </td>
+ </tr>
+ </tbody>
+ </table>
+ </td>
+ </tr>
+ </table>
+ </div>
</div>
#parse( "dhis-web-commons/loader/loader.vm" )
-<div id="dataEntryFormDiv"> </div>
+<div id='listDiv'></div>
+
+<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">
+ <div id='dataEntryFormDiv'></div>
+</div>
+
+<div class='hidden'>
+ <input id='executionDateNewEvent' name='executionDateNewEvent'>
+</div>
<script>
- var i18n_please_select = '[ ' + '$encoder.jsEscape( $i18n.getString( "please_select" ) , "'" )' + ' ]';
+ datePickerValid( 'executionDateNewEvent', true );
+
+ var i18n_please_select = '$encoder.jsEscape( $i18n.getString( "please_select" ) , "'")';
var i18n_value_must_integer = '$encoder.jsEscape( $i18n.getString( "value_must_integer" ) , "'")';
var i18n_value_must_number = '$encoder.jsEscape( $i18n.getString( "value_must_number" ) , "'")';
@@ -57,11 +123,15 @@
var i18n_date_is_greater_then_or_equals_due_date = '$encoder.jsEscape( $i18n.getString( "date_is_greater_then_or_equals_due_date" ) , "'")';
var i18n_violate_validation = '$encoder.jsEscape( $i18n.getString( "violate_validation" ) , "'")';
-
- var i18n_delete_current_event_success = '$encoder.jsEscape( $i18n.getString( "delete_current_event_success" ) , "'")';
- var i18n_please_enter_report_date = '$encoder.jsEscape( $i18n.getString( "please_enter_report_date" ) , "'")';
- var i18n_comfirm_delete_current_event = '$encoder.jsEscape( $i18n.getString( "comfirm_delete_current_event" ) , "'")';
- var i18n_history_events = '$encoder.jsEscape( $i18n.getString( "history_events" ) , "'")';
- var i18n_event_information = '$encoder.jsEscape( $i18n.getString( "event_information" ) , "'")';
var i18n_show_all_items = '$encoder.jsEscape( $i18n.getString( "show_all_items" ) , "'")';
+ var i18n_specify_data_element = '$encoder.jsEscape( $i18n.getString( "specify_data_element" ) , "'")';
+ var i18n_comfirm_delete_event = '$encoder.jsEscape( $i18n.getString( "comfirm_delete_event" ) , "'")';
+ var i18n_delete_event_success = '$encoder.jsEscape( $i18n.getString( "delete_event_success" ) , "'")';
+ var i18n_report_date = '$encoder.jsEscape( $i18n.getString( "report_date" ) , "'")';
+
+ isAjax = true;
+ contentDiv = '';
+
+ var searchTextBox = '<input type="text" id="searchText" name="searchText">';
+
</script>
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataEntryForm.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataEntryForm.vm 2012-06-18 09:40:23 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataEntryForm.vm 2012-06-23 11:05:13 +0000
@@ -82,7 +82,7 @@
<script type="text/javascript">
datePicker($programStageDataElement.programStage.id + '-' + $programStageDataElement.dataElement.id + '-val', false);
</script>
- #elseif($hasOptionSet)
+ #elseif($hasOptionSet=='true')
<input name="entryfield" options='$hasOptionSet' #if($hasOptionSet == 'true') #end dataElementId='$programStageDataElement.dataElement.id' data="{compulsory: $programStageDataElement.compulsory, deName:'$programStageDataElement.dataElement.name', deType:'$programStageDataElement.dataElement.getDetailedNumberType()' }" id="$id" type="text" value="$!encoder.htmlEncode( $patientDataValue.value )" >
#else
<input name="entryfield" dataElementId='$programStageDataElement.dataElement.id' data="{compulsory: $programStageDataElement.compulsory, deName:'$programStageDataElement.dataElement.name', deType:'$programStageDataElement.dataElement.getDetailedNumberType()' }" id="$id" type="text" value="$!encoder.htmlEncode( $patientDataValue.value )" onchange="saveVal( $programStageDataElement.dataElement.id )" onkeypress="return keyPress(event, this)" tabindex="$tabIndex">
=== 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-15 04:55:20 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/anonymousRegistration.js 2012-06-23 11:05:13 +0000
@@ -1,87 +1,265 @@
-function organisationUnitSelected( orgUnits )
+function organisationUnitSelected( orgUnits, orgUnitNames )
{
- hideById('dataEntryFormDiv');
- disable( 'executionDate' );
- setFieldValue('executionDate', '');
- $('#executionDate').unbind('change');
-
- disable('createEventBtn');
- disable('deleteCurrentEventBtn');
-
- $.getJSON( 'loadAnonymousPrograms.action',{}
- , function( json )
- {
- clearListById( 'programId' );
- addOptionById( 'programId', '', i18n_please_select );
-
- var preSelectedProgramId = getFieldValue('selectedProgramId');
- for ( i in json.programInstances )
- {
- if( preSelectedProgramId == json.programInstances[i].id )
- {
- $('#programId').append('<option selected value=' + json.programInstances[i].id + ' type="3" programInstanceId=' + json.programInstances[i].programInstanceId + '>' + json.programInstances[i].name + '</option>');
- }
- else
- {
- $('#programId').append('<option value=' + json.programInstances[i].id + ' type="3" programInstanceId=' + json.programInstances[i].programInstanceId + '>' + json.programInstances[i].name + '</option>');
- }
- }
-
- if( byId('programId').selectedIndex > 0 )
- {
- loadEventForm();
- }
- } );
+ setFieldValue( 'orgunitId', orgUnits[0] );
+ setFieldValue( 'orgunitName', orgUnitNames[0] );
+ hideById('listDiv');
+ hideById('dataEntryInfor');
}
selection.setListenerFunction( organisationUnitSelected );
-
-function loadEventForm()
+function getDataElements()
+{
+ hideById('dataEntryInfor');
+ hideById('listDiv');
+ clearListById('dataElementId');
+ programStageId = jQuery('#programId option:selected').attr('programStageId');
+ setFieldValue('programStageId', programStageId );
+
+ if( programStageId == '')
+ {
+ removeAllAttributeOption();
+ jQuery('#criteriaDiv :input').each( function( idx, item ){
+ disable(this.id);
+ });
+ enable('orgunitName');
+ enable('programId');
+ hideById('listDiv');
+ setFieldValue('searchText');
+ return;
+ }
+
+ jQuery.getJSON( "getProgramStageDataElementList.action",
+ {
+ programStageId: getFieldValue('programStageId')
+ },
+ function( json )
+ {
+ jQuery( '#dataElementId').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>' );
+
+ if( json.programStageDataElements[i].compulsory=='true' ){
+ jQuery( '#compulsoryDE').append( '<option value="' + json.programStageDataElements[i].id + '"></option>');
+ }
+ }
+
+ jQuery('#criteriaDiv :input').each( function( idx, item ){
+ enable(this.id);
+ });
+ });
+}
+
+function removeAllAttributeOption()
+{
+ jQuery( '#advancedSearchTB tbody tr' ).each( function( i, item )
+ {
+ if(i>0){
+ jQuery( item ).remove();
+ }
+ })
+}
+
+function validateSearchEvents( listAll )
{
- hideById('dataEntryFormDiv');
- setFieldValue('executionDate', '');
- disable( 'executionDate' );
- disable('createEventBtn');
- disable('deleteCurrentEventBtn');
+ var flag = true;
+ if( listAll && jQuery( '#compulsoryDE option' ).length == 0 ){
+ flag = false;
+ }
+ else if( !listAll )
+ {
+ jQuery( '#advancedSearchTB tbody tr' ).each( function( i, row ){
+ jQuery( this ).find(':input').each( function( idx, item ){
+ var input = jQuery( item );
+ if( input.attr('type') != 'button' && idx==0 && input.val()=='' ){
+ showWarningMessage( i18n_specify_data_element );
+ flag = false;
+ }
+ })
+ });
+ }
+
+ if(flag){
+ searchEvents( listAll );
+ }
+}
+
+function searchEvents( listAll )
+{
+ hideById('dataEntryInfor');
+ hideById('listDiv');
- var programId = getFieldValue('programId');
- if( programId == '' )
- {
- $('#executionDate').unbind('change');
- return;
- }
-
- showLoader();
-
- jQuery.getJSON( "loadProgramStageInstances.action",
- {
- programId: programId
+ var params = '';
+ if(listAll){
+ params += '&startDate=';
+ params += '&endDate=';
+ jQuery( '#compulsoryDE option' ).each( function( i, item ){
+ var input = jQuery( item );
+ params += '&searchingValues=de_' + input.val() + '_false_';
+ });
+ }
+ else{
+ params += '&startDate=' + getFieldValue('startDate');
+ params += '&endDate=' + getFieldValue('endDate');
+ 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' ){
+ if( idx==0 && input.val()!=''){
+ searchingValue = 'de_' + input.val() + '_false_';
+ }
+ else if( input.val()!='' ){
+ searchingValue += getValueFormula(input.val().toLowerCase());
+ }
+ }
+ });
+ params += '&searchingValues=' + searchingValue;
+ })
+ }
+
+
+
+ params += '&facilityLB=' + $('input[name=facilityLB]:checked').val();
+ params += '&level=' + $('input[name=level]:checked').val();
+ params += '&orgunitIds=' + getFieldValue('orgunitId');
+ params += '&programStageId=' + getFieldValue('programStageId');
+ params += '&orderByOrgunitAsc=' + true;
+
+ contentDiv = 'listDiv';
+ showLoader();
+
+ $.ajax({
+ type: "POST",
+ url: 'searchProgramStageInstances.action',
+ data: params,
+ success: function( html ){
+ hideById('loaderDiv');
+ hideById('dataEntryInfor');
+ setInnerHTML( 'listDiv', html );
+ showById('listDiv');
+ }
+ });
+}
+
+function getValueFormula( value )
+{
+ if( value.indexOf('"') != value.lastIndexOf('"') )
+ {
+ value = value.replace(/"/g,"'");
+ }
+ // if key is [xyz] && [=xyz]
+ if( value.indexOf("'")==-1 ){
+ var flag = value.match(/[>|>=|<|<=|=|!=]+[ ]*/);
+
+ if( flag == null )
+ {
+ value = "='"+ value + "'";
+ }
+ else
+ {
+ value = value.replace( flag, flag + "'");
+ value += "'";
+ }
+ }
+ // if key is ['xyz'] && [='xyz']
+ // if( value.indexOf("'") != value.lastIndexOf("'") )
+ else
+ {
+ var flag = value.match(/[>|>=|<|<=|=|!=]+[ ]*/);
+
+ if( flag == null )
+ {
+ value = "="+ value;
+ }
+ }
+
+ return value;
+}
+
+function removeEvent( psId )
+{
+ removeItem( psId, '', i18n_comfirm_delete_event, 'removeCurrentEncounter.action' );
+}
+
+function showUpdateEvent( psId )
+{
+ hideById('selectDiv');
+ hideById('searchDiv');
+ hideById('listDiv');
+ setFieldValue('programStageInstanceId', psId);
+ showLoader();
+
+ $( '#dataEntryFormDiv' ).load( "dataentryform.action",
+ {
+ programStageInstanceId: psId
+ },function( )
+ {
+ var programName = jQuery('#programId option:selected').text();
+ programName += ' - ' + i18n_report_date + ' : ' + jQuery('#incidentDate').val();
+
+ setInnerHTML('programName', programName );
+
+ if( getFieldValue('completed')=='true' ){
+ disable('completeBtn');
+ }
+ else{
+ enable('completeBtn');
+ }
+
+ hideById('loaderDiv');
+ showById('dataEntryInfor');
+ showById('entryFormContainer');
+ } );
+}
+
+function backEventList()
+{
+ hideById('dataEntryInfor');
+ showById('selectDiv');
+ showById('searchDiv');
+ showById('listDiv');
+}
+
+function showAddEventForm()
+{
+ jQuery.postJSON( "createAnonymousEncounter.action",
+ {
+ programId: jQuery('#programId option:selected').val(),
+ executionDate: getFieldValue('executionDateNewEvent')
},
function( json )
{
- if( json.programStageInstances.length > 0 )
+ if(json.response=='success')
{
- setFieldValue( 'programStageInstanceId', json.programStageInstances[0].id );
- setFieldValue( 'selectedProgramId', programId );
- $('#executionDate').bind('change');
- loadEventRegistrationForm();
+ setFieldValue('programStageInstanceId', json.message );
+ showUpdateEvent( json.message )
}
else
{
- enable( 'executionDate' );
- enable('createEventBtn');
- disable('deleteCurrentEventBtn');
- disable('completeBtn');
- hideById('loaderDiv');
+ showWarningMessage( json.message );
}
-
- });
+ });
}
+
+
+
+
+
+
+
+
+
+
+
function loadEventRegistrationForm()
{
+ hideById('selectDiv');
+ hideById('searchDiv');
+ hideById('listDiv');
+ showLoader();
$( '#dataEntryFormDiv' ).load( "dataentryform.action",
{
programStageInstanceId:getFieldValue('programStageInstanceId')
@@ -121,6 +299,55 @@
} );
}
+
+
+
+
+
+
+
+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",
@@ -150,40 +377,3 @@
});
}
-function deleteCurrentEvent()
-{
- var result = window.confirm( i18n_comfirm_delete_current_event );
-
- if ( result )
- {
- jQuery.postJSON( "removeCurrentEncounter.action",
- {
- programStageInstanceId: getFieldValue('programStageInstanceId')
- },
- function( json )
- {
- var type = json.response;
-
- if( type == 'success' )
- {
- hideById('dataEntryFormDiv');
- byId('programId').selectedIndex = 0;
-
- disable('deleteCurrentEventBtn');
- enable('createEventBtn');
-
- setFieldValue('executionDate','');
- enable( 'executionDate' );
- $('#executionDate').unbind('change');
-
- selection.enable();
-
- showSuccessMessage( i18n_delete_current_event_success );
- }
- else if( type == 'input' )
- {
- showWarningMessage( json.message );
- }
- });
- }
-}
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/entry.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/entry.js 2012-06-20 06:32:51 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/entry.js 2012-06-23 11:05:13 +0000
@@ -619,16 +619,24 @@
var flag = false;
jQuery("#dataEntryFormDiv input[name='entryfield'],select[name='entryselect']").each(function(){
jQuery(this).parent().removeClass("errorCell");
- if( jQuery(this).metadata({
- "type":"attr",
- "name":"data"
- }).compulsory ){
- if( !jQuery(this).val() || jQuery(this).val() == "undifined" ){
+
+ var arrData = jQuery( this ).attr('data').replace('{','').replace('}','').replace(/'/g,"").split(',');
+ var data = new Array();
+ for( var i in arrData )
+ {
+ var values = arrData[i].split(':');
+ var key = jQuery.trim( values[0] );
+ var value = jQuery.trim( values[1] )
+ data[key] = value;
+ }
+ var compulsory = data['compulsory'];
+ if( compulsory == 'true' &&
+ ( !jQuery(this).val() || jQuery(this).val() == "undifined" ) ){
flag = true;
jQuery(this).parent().addClass("errorCell");
}
- }
});
+
if( flag ){
alert(i18n_error_required_field);
return;
=== 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-20 09:46:37 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/patient.js 2012-06-23 11:05:13 +0000
@@ -38,8 +38,7 @@
jQuery('#listPatientDiv').load("searchRegistrationPatient.action",
{
sortPatientAttributeId: getFieldValue('sortPatientAttributeId')
- }
- , function(){
+ }, function(){
showById('listPatientDiv');
jQuery( "#loaderDiv" ).hide();
});
@@ -57,7 +56,7 @@
url: 'validatePatient.action',
data: getParamsForDiv('editPatientDiv'),
success:addValidationCompleted
- });
+ });
}
function addValidationCompleted( data )
@@ -632,7 +631,7 @@
}
else if( statusSearching == 1 )
{
- searchAdvancedPatients();
+ searchAdvancedPatient();
}
}
=== added 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 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonProgramStageDataElements.vm 2012-06-23 11:05:13 +0000
@@ -0,0 +1,11 @@
+#set( $size = ${programStageDataElements.size()} )
+{ "programStageDataElements": [
+ #foreach( ${programStageDataElement} in $!{programStageDataElements} )
+ {
+ "id": "${programStageDataElement.dataElement.id}",
+ "name": "$!encoder.jsonEncode( ${programStageDataElement.dataElement.name} )",
+ "compulsory": "${programStageDataElement.compulsory}"
+ }#if( $velocityCount < $size ),#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-06-14 03:58:46 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientForm.vm 2012-06-23 11:05:13 +0000
@@ -48,8 +48,8 @@
<option value="D" >$i18n.getString( "declared" )</option>
<option value="V" >$i18n.getString( "verified" )</option>
</select>
- <input type="text" id="age" name="age" class="{validate:{number:true}}" style="width:145px" />
- <input type="text" id="birthDate" name="birthDate" style='width:145px;display:none;' />
+ <input type="text" id="age" name="age" class="{validate:{number:true}}" style="width:150px" />
+ <input type="text" id="birthDate" name="birthDate" style='width:150px;display:none;' />
<input id="memberValidator" class="hidden {validate:{required:true}}"/>
</td>
</tr>
=== added 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 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programStageInstancesList.vm 2012-06-23 11:05:13 +0000
@@ -0,0 +1,84 @@
+<table>
+ <tr>
+ <td class='text-column' >$i18n.getString( "search_result_matching_the_search_criteria" ):</td>
+ <td> </td>
+ <td> </td>
+ <td>
+ #if($!listAll)
+ $i18n.getString( "list_all_events" )
+ #else
+ $i18n.getString( "search_events_by_dataelements" )
+ #end
+ </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>
+ </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>
+ <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>
+</table>
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/style/style.css'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/style/style.css 2012-06-20 06:32:51 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/style/style.css 2012-06-23 11:05:13 +0000
@@ -15,14 +15,13 @@
}
input[type="text"] {
- width: 250px;
+ width: 255px;
}
select {
- width: 253px;
+ width: 265px;
}
-
.button-list
{
text-align:right;
@@ -67,6 +66,8 @@
text-align: left;
}
+.errorCell{background-color: #FFCFCF}
+
/*----------------------------------------------------------------------------*/
/* button list
/*----------------------------------------------------------------------------*/
@@ -78,7 +79,6 @@
width:100%;
}
-
div.actions
{
float: right;
=== 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-06-14 13:19:46 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/updatePatientForm.vm 2012-06-23 11:05:13 +0000
@@ -99,8 +99,8 @@
<option value="D" #if($patient.dobType=='D') selected #end >$i18n.getString( "declared" )</option>
<option value="V" #if($patient.dobType=='V') selected #end >$i18n.getString( "verified" )</option>
</select>
- <input type="text" id="birthDate" name="birthDate" value='$format.formatDate($!patient.birthDate)' style='width:145px;' />
- <input type="text" id="age" name="age" value='$!patient.getIntegerValueOfAge()' class="{validate:{number:true}}" style='width:145px;' />
+ <input type="text" id="birthDate" name="birthDate" value='$format.formatDate($!patient.birthDate)' style='width:150px;' />
+ <input type="text" id="age" name="age" value='$!patient.getIntegerValueOfAge()' class="{validate:{number:true}}" style='width:150px;' />
</td>
</tr>