dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #13032
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 4103: Improve Case Entry form ( Patient module ).
------------------------------------------------------------
revno: 4103
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2011-07-08 14:22:42 +0700
message:
Improve Case Entry form ( Patient module ).
modified:
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/DataRecordingSelectAction.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/GetProgramsByOrgunitAction.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/LoadProgramStagesAction.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/SaveDateValueAction.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/SaveExecutionDateAction.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/SaveProvidingFacilityAction.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/SaveValueAction.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/ValidateProgramInstanceAction.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/state/DefaultSelectedStateManager.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/state/SelectedStateManager.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/webapp/dhis-web-caseentry/dataEntryForm.vm
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataRecordingSelect.vm
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/dataEntry.js
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programStageDataEntryForm.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/caseentry/DataRecordingSelectAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/DataRecordingSelectAction.java 2011-05-10 07:25:28 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/DataRecordingSelectAction.java 2011-07-08 07:22:42 +0000
@@ -29,6 +29,7 @@
import java.util.ArrayList;
import java.util.Collection;
+import org.hisp.dhis.caseentry.state.SelectedStateManager;
import org.hisp.dhis.patient.Patient;
import org.hisp.dhis.patient.PatientService;
import org.hisp.dhis.program.Program;
@@ -52,7 +53,14 @@
{
this.patientService = patientService;
}
+
+ private SelectedStateManager selectedStateManager;
+ public void setSelectedStateManager( SelectedStateManager selectedStateManager )
+ {
+ this.selectedStateManager = selectedStateManager;
+ }
+
// -------------------------------------------------------------------------
// Input/Output
// -------------------------------------------------------------------------
@@ -86,7 +94,8 @@
throws Exception
{
patient = patientService.getPatient( patientId );
-
+ selectedStateManager.setSelectedPatient( patient );
+
for ( Program program : patient.getPrograms() )
{
programs.add( program );
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/GetProgramsByOrgunitAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/GetProgramsByOrgunitAction.java 2011-05-20 09:23:01 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/GetProgramsByOrgunitAction.java 2011-07-08 07:22:42 +0000
@@ -30,8 +30,8 @@
import java.util.ArrayList;
import java.util.Collection;
+import org.hisp.dhis.caseentry.state.SelectedStateManager;
import org.hisp.dhis.organisationunit.OrganisationUnit;
-import org.hisp.dhis.ouwt.manager.OrganisationUnitSelectionManager;
import org.hisp.dhis.program.Program;
import org.hisp.dhis.program.ProgramService;
@@ -49,13 +49,6 @@
// Dependencies
// -------------------------------------------------------------------------
- private OrganisationUnitSelectionManager selectionManager;
-
- public void setSelectionManager( OrganisationUnitSelectionManager selectionManager )
- {
- this.selectionManager = selectionManager;
- }
-
private ProgramService programService;
public void setProgramService( ProgramService programService )
@@ -63,6 +56,13 @@
this.programService = programService;
}
+ private SelectedStateManager selectedStateManager;
+
+ public void setSelectedStateManager( SelectedStateManager selectedStateManager )
+ {
+ this.selectedStateManager = selectedStateManager;
+ }
+
// -------------------------------------------------------------------------
// Input/output
// -------------------------------------------------------------------------
@@ -88,10 +88,14 @@
public String execute()
throws Exception
{
- organisationUnit = selectionManager.getSelectedOrganisationUnit();
+ organisationUnit = selectedStateManager.getSelectedOrganisationUnit();
programs = programService.getPrograms( organisationUnit );
+ selectedStateManager.clearSelectedPatient();
+ selectedStateManager.clearSelectedProgramInstance();
+ selectedStateManager.clearSelectedProgramStageInstance();
+
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 2011-07-07 08:49:30 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/LoadDataEntryAction.java 2011-07-08 07:22:42 +0000
@@ -34,6 +34,7 @@
import java.util.List;
import java.util.Map;
+import org.hisp.dhis.caseentry.state.SelectedStateManager;
import org.hisp.dhis.dataelement.DataElement;
import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
import org.hisp.dhis.dataentryform.DataEntryForm;
@@ -71,28 +72,22 @@
private ProgramStageService programStageService;
- private ProgramInstanceService programInstanceService;
-
private ProgramDataEntryService programDataEntryService;
private PatientDataValueService patientDataValueService;
private ProgramStageInstanceService programStageInstanceService;
- private PatientService patientService;
-
- private OrganisationUnitSelectionManager selectionManager;
-
private ProgramStageDataElementService programStageDataElementService;
+ private SelectedStateManager selectedStateManager;
+
// -------------------------------------------------------------------------
// Input && Output
// -------------------------------------------------------------------------
private Integer programStageId;
- private Integer patientId;
-
private boolean useDefaultForm;
private ProgramStageInstance programStageInstance;
@@ -123,19 +118,14 @@
this.programStageDataElementService = programStageDataElementService;
}
- public void setPatientService( PatientService patientService )
- {
- this.patientService = patientService;
- }
-
public void setProgramStageService( ProgramStageService programStageService )
{
this.programStageService = programStageService;
}
- public void setProgramInstanceService( ProgramInstanceService programInstanceService )
+ public void setSelectedStateManager( SelectedStateManager selectedStateManager )
{
- this.programInstanceService = programInstanceService;
+ this.selectedStateManager = selectedStateManager;
}
public void setProgramDataEntryService( ProgramDataEntryService programDataEntryService )
@@ -148,11 +138,6 @@
this.patientDataValueService = patientDataValueService;
}
- public void setSelectionManager( OrganisationUnitSelectionManager selectionManager )
- {
- this.selectionManager = selectionManager;
- }
-
public Map<Integer, Collection<DataElementCategoryOptionCombo>> getOptionMap()
{
return optionMap;
@@ -173,11 +158,6 @@
return programStageInstance;
}
- public void setPatientId( Integer patientId )
- {
- this.patientId = patientId;
- }
-
public void setUseDefaultForm( boolean useDefaultForm )
{
this.useDefaultForm = useDefaultForm;
@@ -219,14 +199,11 @@
// Get program-stage-instance
// ---------------------------------------------------------------------
- Patient patient = patientService.getPatient( patientId );
-
ProgramStage programStage = programStageService.getProgramStage( programStageId );
- ProgramInstance programInstance = programInstanceService.getProgramInstances( patient,
- programStage.getProgram(), false ).iterator().next();
+ ProgramInstance programInstance = selectedStateManager.getSelectedProgramInstance();
- organisationUnit = selectionManager.getSelectedOrganisationUnit();
+ organisationUnit = selectedStateManager.getSelectedOrganisationUnit();
programStageDataElements = new ArrayList<ProgramStageDataElement>( programStage.getProgramStageDataElements() );
@@ -236,6 +213,8 @@
if ( programStageInstance != null )
{
+ selectedStateManager.setSelectedProgramStageInstance( programStageInstance );
+
// ---------------------------------------------------------------------
// Get CategoryOptions
// ---------------------------------------------------------------------
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/LoadProgramStagesAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/LoadProgramStagesAction.java 2011-05-10 07:25:28 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/LoadProgramStagesAction.java 2011-07-08 07:22:42 +0000
@@ -32,8 +32,8 @@
import java.util.Map;
import java.util.Set;
+import org.hisp.dhis.caseentry.state.SelectedStateManager;
import org.hisp.dhis.patient.Patient;
-import org.hisp.dhis.patient.PatientService;
import org.hisp.dhis.program.Program;
import org.hisp.dhis.program.ProgramInstance;
import org.hisp.dhis.program.ProgramInstanceService;
@@ -55,13 +55,6 @@
// Dependencies
// -------------------------------------------------------------------------
- private PatientService patientService;
-
- public void setPatientService( PatientService patientService )
- {
- this.patientService = patientService;
- }
-
private ProgramService programService;
public void setProgramService( ProgramService programService )
@@ -83,17 +76,17 @@
this.programStageInstanceService = programStageInstanceService;
}
+ private SelectedStateManager selectedStateManager;
+
+ public void setSelectedStateManager( SelectedStateManager selectedStateManager )
+ {
+ this.selectedStateManager = selectedStateManager;
+ }
+
// -------------------------------------------------------------------------
// Input && Output
// -------------------------------------------------------------------------
- private Integer patientId;
-
- public void setPatientId( Integer patientId )
- {
- this.patientId = patientId;
- }
-
private Integer programId;
public void setProgramId( Integer programId )
@@ -129,12 +122,13 @@
public String execute()
throws Exception
{
- Patient patient = patientService.getPatient( patientId );
+ Patient patient = selectedStateManager.getSelectedPatient( );
Program program = programService.getProgram( programId );
programInstance = programInstanceService.getProgramInstances( patient, program, false ).iterator().next();
-
+ selectedStateManager.setSelectedProgramInstance( programInstance);
+
colorMap = programStageInstanceService.colorProgramStageInstances( programInstance.getProgramStageInstances() );
programStages = program.getProgramStages();
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/SaveDateValueAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/SaveDateValueAction.java 2011-05-27 01:09:01 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/SaveDateValueAction.java 2011-07-08 07:22:42 +0000
@@ -26,29 +26,22 @@
*/
package org.hisp.dhis.caseentry.action.caseentry;
-import java.util.Collection;
import java.util.Date;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.hisp.dhis.caseentry.state.SelectedStateManager;
import org.hisp.dhis.dataelement.DataElement;
import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
import org.hisp.dhis.dataelement.DataElementService;
import org.hisp.dhis.i18n.I18n;
import org.hisp.dhis.i18n.I18nFormat;
import org.hisp.dhis.organisationunit.OrganisationUnit;
-import org.hisp.dhis.organisationunit.OrganisationUnitService;
-import org.hisp.dhis.patient.Patient;
-import org.hisp.dhis.patient.PatientService;
import org.hisp.dhis.patientdatavalue.PatientDataValue;
import org.hisp.dhis.patientdatavalue.PatientDataValueService;
import org.hisp.dhis.program.Program;
-import org.hisp.dhis.program.ProgramInstance;
-import org.hisp.dhis.program.ProgramInstanceService;
-import org.hisp.dhis.program.ProgramStage;
import org.hisp.dhis.program.ProgramStageInstance;
import org.hisp.dhis.program.ProgramStageInstanceService;
-import org.hisp.dhis.program.ProgramStageService;
import com.opensymphony.xwork2.Action;
@@ -65,34 +58,6 @@
// Dependencies
// -------------------------------------------------------------------------
- private OrganisationUnitService organisationUnitService;
-
- public void setOrganisationUnitService( OrganisationUnitService organisationUnitService )
- {
- this.organisationUnitService = organisationUnitService;
- }
-
- private PatientService patientService;
-
- public void setPatientService( PatientService patientService )
- {
- this.patientService = patientService;
- }
-
- private ProgramStageService programStageService;
-
- public void setProgramStageService( ProgramStageService programStageService )
- {
- this.programStageService = programStageService;
- }
-
- private ProgramInstanceService programInstanceService;
-
- public void setProgramInstanceService( ProgramInstanceService programInstanceService )
- {
- this.programInstanceService = programInstanceService;
- }
-
private ProgramStageInstanceService programStageInstanceService;
public void setProgramStageInstanceService( ProgramStageInstanceService programStageInstanceService )
@@ -114,6 +79,13 @@
this.patientDataValueService = patientDataValueService;
}
+ private SelectedStateManager selectedStateManager;
+
+ public void setSelectedStateManager( SelectedStateManager selectedStateManager )
+ {
+ this.selectedStateManager = selectedStateManager;
+ }
+
private I18nFormat format;
public void setFormat( I18nFormat format )
@@ -151,27 +123,6 @@
return dataElementId;
}
- private Integer orgunitId;
-
- public void setOrgunitId( Integer orgunitId )
- {
- this.orgunitId = orgunitId;
- }
-
- private Integer patientId;
-
- public void setPatientId( Integer patientId )
- {
- this.patientId = patientId;
- }
-
- private Integer programStageId;
-
- public void setProgramStageId( Integer programStageId )
- {
- this.programStageId = programStageId;
- }
-
private int statusCode;
public int getStatusCode()
@@ -209,21 +160,11 @@
// Get program-stage-instance
// ---------------------------------------------------------------------
- OrganisationUnit organisationUnit = organisationUnitService.getOrganisationUnit( orgunitId );
-
- Patient patient = patientService.getPatient( patientId );
-
- ProgramStage programStage = programStageService.getProgramStage( programStageId );
-
- Program program = programStage.getProgram();
-
- Collection<ProgramInstance> progamInstances = programInstanceService.getProgramInstances( patient, programStage
- .getProgram(), false );
-
- ProgramInstance programInstance = progamInstances.iterator().next();
-
- ProgramStageInstance programStageInstance = programStageInstanceService.getProgramStageInstance(
- programInstance, programStage );
+ OrganisationUnit organisationUnit = selectedStateManager.getSelectedOrganisationUnit();
+
+ ProgramStageInstance programStageInstance = selectedStateManager.getSelectedProgramStageInstance();
+
+ Program program = programStageInstance.getProgramInstance().getProgram();
DataElement dataElement = dataElementService.getDataElement( dataElementId );
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/SaveExecutionDateAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/SaveExecutionDateAction.java 2011-05-19 01:11:43 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/SaveExecutionDateAction.java 2011-07-08 07:22:42 +0000
@@ -31,6 +31,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.hisp.dhis.caseentry.state.SelectedStateManager;
import org.hisp.dhis.i18n.I18nFormat;
import org.hisp.dhis.program.ProgramStageInstance;
import org.hisp.dhis.program.ProgramStageInstanceService;
@@ -57,6 +58,13 @@
this.programStageInstanceService = programStageInstanceService;
}
+ private SelectedStateManager selectedStateManager;
+
+ public void setSelectedStateManager( SelectedStateManager selectedStateManager )
+ {
+ this.selectedStateManager = selectedStateManager;
+ }
+
private I18nFormat format;
public void setFormat( I18nFormat format )
@@ -75,18 +83,6 @@
this.executionDate = executionDate;
}
- private int programStageInstanceId;
-
- public void setProgramStageInstanceId( int programStageInstanceId )
- {
- this.programStageInstanceId = programStageInstanceId;
- }
-
- public int getProgramStageInstanceId()
- {
- return programStageInstanceId;
- }
-
private int statusCode;
public int getStatusCode()
@@ -101,8 +97,7 @@
public String execute()
throws Exception
{
- ProgramStageInstance programStageInstance = programStageInstanceService
- .getProgramStageInstance( programStageInstanceId );
+ ProgramStageInstance programStageInstance = selectedStateManager.getSelectedProgramStageInstance();
if ( executionDate != null )
{
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/SaveProvidingFacilityAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/SaveProvidingFacilityAction.java 2011-05-20 03:35:47 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/SaveProvidingFacilityAction.java 2011-07-08 07:22:42 +0000
@@ -27,25 +27,15 @@
package org.hisp.dhis.caseentry.action.caseentry;
-import java.util.Collection;
-
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hisp.dhis.caseentry.state.SelectedStateManager;
import org.hisp.dhis.dataelement.DataElement;
import org.hisp.dhis.dataelement.DataElementService;
import org.hisp.dhis.organisationunit.OrganisationUnit;
-import org.hisp.dhis.patient.Patient;
-import org.hisp.dhis.patient.PatientService;
import org.hisp.dhis.patientdatavalue.PatientDataValue;
import org.hisp.dhis.patientdatavalue.PatientDataValueService;
-import org.hisp.dhis.program.Program;
-import org.hisp.dhis.program.ProgramInstance;
-import org.hisp.dhis.program.ProgramInstanceService;
-import org.hisp.dhis.program.ProgramStage;
import org.hisp.dhis.program.ProgramStageInstance;
-import org.hisp.dhis.program.ProgramStageInstanceService;
-import org.hisp.dhis.program.ProgramStageService;
import com.opensymphony.xwork2.Action;
@@ -69,20 +59,6 @@
this.selectedStateManager = selectedStateManager;
}
- private ProgramInstanceService programInstanceService;
-
- public void setProgramInstanceService( ProgramInstanceService programInstanceService )
- {
- this.programInstanceService = programInstanceService;
- }
-
- private ProgramStageInstanceService programStageInstanceService;
-
- public void setProgramStageInstanceService( ProgramStageInstanceService programStageInstanceService )
- {
- this.programStageInstanceService = programStageInstanceService;
- }
-
private DataElementService dataElementService;
public void setDataElementService( DataElementService dataElementService )
@@ -97,38 +73,10 @@
this.patientDataValueService = patientDataValueService;
}
- private PatientService patientService;
-
- public void setPatientService( PatientService patientService )
- {
- this.patientService = patientService;
- }
-
- private ProgramStageService programStageService;
-
- public void setProgramStageService( ProgramStageService programStageService )
- {
- this.programStageService = programStageService;
- }
-
// -------------------------------------------------------------------------
// Input/Output
// -------------------------------------------------------------------------
- private Integer patientId;
-
- public void setPatientId( Integer patientId )
- {
- this.patientId = patientId;
- }
-
- private Integer programStageId;
-
- public void setProgramStageId( Integer programStageId )
- {
- this.programStageId = programStageId;
- }
-
private boolean providedByAnotherFacility;
public void setProvidedByAnotherFacility( boolean providedByAnotherFacility )
@@ -164,19 +112,7 @@
{
OrganisationUnit organisationUnit = selectedStateManager.getSelectedOrganisationUnit();
- Patient patient = patientService.getPatient( patientId );
-
- ProgramStage programStage = programStageService.getProgramStage( programStageId );
-
- Program program = programStage.getProgram();
-
- Collection<ProgramInstance> progamInstances = programInstanceService.getProgramInstances( patient, program,
- false );
-
- ProgramInstance programInstance = progamInstances.iterator().next();
-
- ProgramStageInstance programStageInstance = programStageInstanceService.getProgramStageInstance(
- programInstance, programStage );
+ ProgramStageInstance programStageInstance = selectedStateManager.getSelectedProgramStageInstance();
DataElement dataElement = dataElementService.getDataElement( dataElementId );
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/SaveValueAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/SaveValueAction.java 2011-05-27 01:09:01 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/SaveValueAction.java 2011-07-08 07:22:42 +0000
@@ -27,28 +27,21 @@
package org.hisp.dhis.caseentry.action.caseentry;
-import java.util.Collection;
import java.util.Date;
import java.util.Set;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.hisp.dhis.caseentry.state.SelectedStateManager;
import org.hisp.dhis.dataelement.DataElement;
import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
import org.hisp.dhis.dataelement.DataElementCategoryService;
import org.hisp.dhis.dataelement.DataElementService;
import org.hisp.dhis.organisationunit.OrganisationUnit;
-import org.hisp.dhis.organisationunit.OrganisationUnitService;
-import org.hisp.dhis.patient.Patient;
-import org.hisp.dhis.patient.PatientService;
import org.hisp.dhis.patientdatavalue.PatientDataValue;
import org.hisp.dhis.patientdatavalue.PatientDataValueService;
-import org.hisp.dhis.program.ProgramInstance;
-import org.hisp.dhis.program.ProgramInstanceService;
-import org.hisp.dhis.program.ProgramStage;
import org.hisp.dhis.program.ProgramStageInstance;
import org.hisp.dhis.program.ProgramStageInstanceService;
-import org.hisp.dhis.program.ProgramStageService;
import com.opensymphony.xwork2.Action;
@@ -66,34 +59,6 @@
// Dependencies
// -------------------------------------------------------------------------
- private OrganisationUnitService organisationUnitService;
-
- public void setOrganisationUnitService( OrganisationUnitService organisationUnitService )
- {
- this.organisationUnitService = organisationUnitService;
- }
-
- private PatientService patientService;
-
- public void setPatientService( PatientService patientService )
- {
- this.patientService = patientService;
- }
-
- private ProgramStageService programStageService;
-
- public void setProgramStageService( ProgramStageService programStageService )
- {
- this.programStageService = programStageService;
- }
-
- private ProgramInstanceService programInstanceService;
-
- public void setProgramInstanceService( ProgramInstanceService programInstanceService )
- {
- this.programInstanceService = programInstanceService;
- }
-
private ProgramStageInstanceService programStageInstanceService;
public void setProgramStageInstanceService( ProgramStageInstanceService programStageInstanceService )
@@ -122,6 +87,13 @@
this.dataElementCategoryService = dataElementCategoryService;
}
+ private SelectedStateManager selectedStateManager;
+
+ public void setSelectedStateManager( SelectedStateManager selectedStateManager )
+ {
+ this.selectedStateManager = selectedStateManager;
+ }
+
// -------------------------------------------------------------------------
// Input/Output
// -------------------------------------------------------------------------
@@ -171,27 +143,6 @@
this.optionComboId = optionComboId;
}
- private Integer orgunitId;
-
- public void setOrgunitId( Integer orgunitId )
- {
- this.orgunitId = orgunitId;
- }
-
- private Integer patientId;
-
- public void setPatientId( Integer patientId )
- {
- this.patientId = patientId;
- }
-
- private Integer programStageId;
-
- public void setProgramStageId( Integer programStageId )
- {
- this.programStageId = programStageId;
- }
-
// -------------------------------------------------------------------------
// Implementation Action
// -------------------------------------------------------------------------
@@ -203,20 +154,10 @@
// Get program-stage-instance
// ---------------------------------------------------------------------
- OrganisationUnit organisationUnit = organisationUnitService.getOrganisationUnit( orgunitId );
-
- Patient patient = patientService.getPatient( patientId );
-
- ProgramStage programStage = programStageService.getProgramStage( programStageId );
-
- Collection<ProgramInstance> progamInstances = programInstanceService.getProgramInstances( patient, programStage
- .getProgram(), false );
-
- ProgramInstance programInstance = progamInstances.iterator().next();
-
- ProgramStageInstance programStageInstance = programStageInstanceService.getProgramStageInstance(
- programInstance, programStage );
-
+ OrganisationUnit organisationUnit = selectedStateManager.getSelectedOrganisationUnit();
+
+ ProgramStageInstance programStageInstance = selectedStateManager.getSelectedProgramStageInstance();
+
// ---------------------------------------------------------------------
// Save value
// ---------------------------------------------------------------------
@@ -272,7 +213,7 @@
programStageInstance.setExecutionDate( new Date() );
programStageInstanceService.updateProgramStageInstance( programStageInstance );
}
-
+
if ( patientDataValue == null )
{
LOG.debug( "Adding PatientDataValue, value added" );
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/ValidateProgramInstanceAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/ValidateProgramInstanceAction.java 2011-05-10 07:25:28 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/ValidateProgramInstanceAction.java 2011-07-08 07:22:42 +0000
@@ -38,19 +38,13 @@
import org.hisp.dhis.dataelement.DataElement;
import org.hisp.dhis.i18n.I18n;
import org.hisp.dhis.organisationunit.OrganisationUnit;
-import org.hisp.dhis.organisationunit.OrganisationUnitService;
-import org.hisp.dhis.patient.Patient;
-import org.hisp.dhis.patient.PatientService;
import org.hisp.dhis.patientdatavalue.PatientDataValue;
import org.hisp.dhis.patientdatavalue.PatientDataValueService;
-import org.hisp.dhis.program.Program;
import org.hisp.dhis.program.ProgramInstance;
-import org.hisp.dhis.program.ProgramInstanceService;
import org.hisp.dhis.program.ProgramStage;
import org.hisp.dhis.program.ProgramStageDataElement;
import org.hisp.dhis.program.ProgramStageInstance;
import org.hisp.dhis.program.ProgramStageInstanceService;
-import org.hisp.dhis.program.ProgramStageService;
import org.hisp.dhis.program.ProgramValidation;
import org.hisp.dhis.program.ProgramValidationService;
@@ -69,28 +63,15 @@
private SelectedStateManager selectedStateManager;
- private ProgramInstanceService programInstanceService;
-
private ProgramStageInstanceService programStageInstanceService;
private PatientDataValueService patientDataValueService;
private ProgramValidationService programValidationService;
-
- private OrganisationUnitService orgunitService;
-
- private PatientService patientService;
- private ProgramStageService programStageService;
// -------------------------------------------------------------------------
// Input
// -------------------------------------------------------------------------
-
- private Integer orgunitId;
-
- private Integer patientId;
-
- private Integer programStageId;
private I18n i18n;
@@ -110,37 +91,7 @@
{
this.selectedStateManager = selectedStateManager;
}
-
- public void setOrgunitService( OrganisationUnitService orgunitService )
- {
- this.orgunitService = orgunitService;
- }
-
- public void setPatientService( PatientService patientService )
- {
- this.patientService = patientService;
- }
-
- public void setProgramStageService( ProgramStageService programStageService )
- {
- this.programStageService = programStageService;
- }
-
- public void setOrgunitId( Integer orgunitId )
- {
- this.orgunitId = orgunitId;
- }
-
- public void setPatientId( Integer patientId )
- {
- this.patientId = patientId;
- }
-
- public void setProgramStageId( Integer programStageId )
- {
- this.programStageId = programStageId;
- }
-
+
public List<ProgramValidation> getProgramValidations()
{
return programValidations;
@@ -156,11 +107,6 @@
this.programStageInstanceService = programStageInstanceService;
}
- public void setProgramInstanceService( ProgramInstanceService programInstanceService )
- {
- this.programInstanceService = programInstanceService;
- }
-
public void setPatientDataValueService( PatientDataValueService patientDataValueService )
{
this.patientDataValueService = patientDataValueService;
@@ -198,22 +144,12 @@
// Get selected objects
// ---------------------------------------------------------------------
- OrganisationUnit organisationUnit = orgunitService.getOrganisationUnit( orgunitId );
-
- Patient patient = patientService.getPatient( patientId );
-
- ProgramStage programStage = programStageService.getProgramStage( programStageId );
-
- Program program = programStage.getProgram();
-
- Collection<ProgramInstance> progamInstances = programInstanceService.getProgramInstances( patient, program,
- false );
-
- ProgramInstance programInstance = progamInstances.iterator().next();
-
- ProgramStageInstance programStageInstance = programStageInstanceService.getProgramStageInstance(
- programInstance, programStage );
-
+ OrganisationUnit organisationUnit = selectedStateManager.getSelectedOrganisationUnit( );
+
+ ProgramStageInstance programStageInstance = selectedStateManager.getSelectedProgramStageInstance();
+
+ ProgramStage programStage = programStageInstance.getProgramStage();
+
// ---------------------------------------------------------------------
// Get selected objects
// ---------------------------------------------------------------------
@@ -231,8 +167,8 @@
// Check validations for dataelement into multi-stages
// ---------------------------------------------------------------------
- runProgramValidation( programValidationService.getProgramValidation( programInstance.getProgram() ),
- programInstance );
+ runProgramValidation( programValidationService.getProgramValidation( programStageInstance.getProgramInstance().getProgram() ),
+ programStageInstance.getProgramInstance() );
return SUCCESS;
}
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/state/DefaultSelectedStateManager.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/state/DefaultSelectedStateManager.java 2011-05-01 09:07:35 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/state/DefaultSelectedStateManager.java 2011-07-08 07:22:42 +0000
@@ -34,8 +34,12 @@
import org.hisp.dhis.patient.Patient;
import org.hisp.dhis.patient.PatientService;
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;
import org.hisp.dhis.program.ProgramStageService;
import com.opensymphony.xwork2.ActionContext;
@@ -48,10 +52,19 @@
implements SelectedStateManager
{
public static final String SESSION_KEY_SELECTED_PATIENT_ID = "selected_patient_id";
+
+ public static final String SESSION_KEY_SELECTED_PROGRAM_INSTANCE_ID = "selected_program_instance_id";
+
+ public static final String SESSION_KEY_SELECTED_PROGRAM_STAGE_INSTANCE_ID = "selected_program_stage_instance_id";
+
public static final String SESSION_KEY_SELECTED_PROGRAM_ID = "selected_program_id";
+
public static final String SESSION_KEY_SELECTED_PROGRAMSTAGE_ID = "selected_program_stage_id";
+
public static final String SESSION_KEY_LISTALL = "list_all_value";
+
public static final String SESSION_KEY_SELECTED_SEARCHING_ATTRIBUTE_ID = "selected_searching_attribute_id";
+
public static final String SESSION_KEY_SPECIFIED_SEARCH_TEXT = "specified_search_text";
// -------------------------------------------------------------------------
@@ -86,6 +99,20 @@
this.programStageService = programStageService;
}
+ private ProgramInstanceService programInstanceService;
+
+ public void setProgramInstanceService( ProgramInstanceService programInstanceService )
+ {
+ this.programInstanceService = programInstanceService;
+ }
+
+ private ProgramStageInstanceService programStageInstanceService;
+
+ public void setProgramStageInstanceService( ProgramStageInstanceService programStageInstanceService )
+ {
+ this.programStageInstanceService = programStageInstanceService;
+ }
+
// -------------------------------------------------------------------------
// Implementation methods
// -------------------------------------------------------------------------
@@ -117,6 +144,50 @@
getSession().remove( SESSION_KEY_SELECTED_PATIENT_ID );
}
+ public void setSelectedProgramInstance( ProgramInstance programInstance )
+ {
+ getSession().put( SESSION_KEY_SELECTED_PROGRAM_INSTANCE_ID, programInstance.getId() );
+ }
+
+ public ProgramInstance getSelectedProgramInstance()
+ {
+ Integer id = (Integer) getSession().get( SESSION_KEY_SELECTED_PROGRAM_INSTANCE_ID );
+
+ if ( id == null )
+ {
+ return null;
+ }
+
+ return programInstanceService.getProgramInstance( id );
+ }
+
+ public void clearSelectedProgramInstance()
+ {
+ getSession().remove( SESSION_KEY_SELECTED_PROGRAM_INSTANCE_ID );
+ }
+
+ public void setSelectedProgramStageInstance( ProgramStageInstance programStageInstance )
+ {
+ getSession().put( SESSION_KEY_SELECTED_PROGRAM_STAGE_INSTANCE_ID, programStageInstance.getId() );
+ }
+
+ public ProgramStageInstance getSelectedProgramStageInstance()
+ {
+ Integer id = (Integer) getSession().get( SESSION_KEY_SELECTED_PROGRAM_STAGE_INSTANCE_ID );
+
+ if ( id == null )
+ {
+ return null;
+ }
+
+ return programStageInstanceService.getProgramStageInstance( id );
+ }
+
+ public void clearSelectedProgramStageInstance()
+ {
+ getSession().remove( SESSION_KEY_SELECTED_PROGRAM_STAGE_INSTANCE_ID );
+ }
+
public void setSelectedProgram( Program program )
{
getSession().put( SESSION_KEY_SELECTED_PROGRAM_ID, program.getId() );
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/state/SelectedStateManager.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/state/SelectedStateManager.java 2011-03-31 01:49:21 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/state/SelectedStateManager.java 2011-07-08 07:22:42 +0000
@@ -30,7 +30,9 @@
import org.hisp.dhis.organisationunit.OrganisationUnit;
import org.hisp.dhis.patient.Patient;
import org.hisp.dhis.program.Program;
+import org.hisp.dhis.program.ProgramInstance;
import org.hisp.dhis.program.ProgramStage;
+import org.hisp.dhis.program.ProgramStageInstance;
/**
* @author Abyot Asalefew
@@ -40,12 +42,39 @@
{
OrganisationUnit getSelectedOrganisationUnit();
+ // -------------------------------------------------------------------------
+ // Patient
+ // -------------------------------------------------------------------------
+
void setSelectedPatient( Patient patient );
Patient getSelectedPatient();
void clearSelectedPatient();
+ // -------------------------------------------------------------------------
+ // Program-instance
+ // -------------------------------------------------------------------------
+
+ void setSelectedProgramInstance( ProgramInstance programInstance );
+
+ ProgramInstance getSelectedProgramInstance();
+
+ void clearSelectedProgramInstance();
+
+ // -------------------------------------------------------------------------
+ // Program-stage-instance
+ // -------------------------------------------------------------------------
+
+ void setSelectedProgramStageInstance( ProgramStageInstance programStageInstance );
+
+ ProgramStageInstance getSelectedProgramStageInstance();
+
+ void clearSelectedProgramStageInstance();
+
+
+
+
void setSelectedProgram( Program program );
Program getSelectedProgram();
=== 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 2011-06-23 14:44:17 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml 2011-07-08 07:22:42 +0000
@@ -10,6 +10,8 @@
<property name="programService" ref="org.hisp.dhis.program.ProgramService" />
<property name="programStageService" ref="org.hisp.dhis.program.ProgramStageService" />
<property name="selectionManager" ref="org.hisp.dhis.ouwt.manager.OrganisationUnitSelectionManager" />
+ <property name="programInstanceService" ref="org.hisp.dhis.program.ProgramInstanceService" />
+ <property name="programStageInstanceService" ref="org.hisp.dhis.program.ProgramStageInstanceService" />
</bean>
<!-- Data Entry -->
@@ -49,33 +51,28 @@
<bean id="org.hisp.dhis.caseentry.action.caseentry.DataRecordingSelectAction" class="org.hisp.dhis.caseentry.action.caseentry.DataRecordingSelectAction"
scope="prototype">
<property name="patientService" ref="org.hisp.dhis.patient.PatientService" />
+ <property name="selectedStateManager" ref="org.hisp.dhis.caseentry.state.SelectedStateManager" />
</bean>
<bean id="org.hisp.dhis.caseentry.action.caseentry.SaveExecutionDateAction" class="org.hisp.dhis.caseentry.action.caseentry.SaveExecutionDateAction"
scope="prototype">
<property name="programStageInstanceService" ref="org.hisp.dhis.program.ProgramStageInstanceService" />
+ <property name="selectedStateManager" ref="org.hisp.dhis.caseentry.state.SelectedStateManager" />
</bean>
<bean id="org.hisp.dhis.caseentry.action.caseentry.SaveValueAction" class="org.hisp.dhis.caseentry.action.caseentry.SaveValueAction"
scope="prototype">
- <property name="organisationUnitService" ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
- <property name="patientService" ref="org.hisp.dhis.patient.PatientService" />
- <property name="programStageService" ref="org.hisp.dhis.program.ProgramStageService" />
<property name="dataElementService" ref="org.hisp.dhis.dataelement.DataElementService" />
<property name="dataElementCategoryService" ref="org.hisp.dhis.dataelement.DataElementCategoryService" />
- <property name="programInstanceService" ref="org.hisp.dhis.program.ProgramInstanceService" />
<property name="programStageInstanceService" ref="org.hisp.dhis.program.ProgramStageInstanceService" />
<property name="patientDataValueService" ref="org.hisp.dhis.patientdatavalue.PatientDataValueService" />
+ <property name="selectedStateManager" ref="org.hisp.dhis.caseentry.state.SelectedStateManager" />
</bean>
<bean id="org.hisp.dhis.caseentry.action.caseentry.SaveDateValueAction" class="org.hisp.dhis.caseentry.action.caseentry.SaveDateValueAction"
scope="prototype">
- <property name="organisationUnitService" ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
- <property name="patientService" ref="org.hisp.dhis.patient.PatientService" />
- <property name="programStageService" ref="org.hisp.dhis.program.ProgramStageService" />
<property name="dataElementService" ref="org.hisp.dhis.dataelement.DataElementService" />
<property name="programInstanceService" ref="org.hisp.dhis.program.ProgramInstanceService" />
- <property name="programStageInstanceService" ref="org.hisp.dhis.program.ProgramStageInstanceService" />
<property name="patientDataValueService" ref="org.hisp.dhis.patientdatavalue.PatientDataValueService" />
</bean>
@@ -83,11 +80,7 @@
scope="prototype">
<property name="selectedStateManager" ref="org.hisp.dhis.caseentry.state.SelectedStateManager" />
<property name="dataElementService" ref="org.hisp.dhis.dataelement.DataElementService" />
- <property name="programInstanceService" ref="org.hisp.dhis.program.ProgramInstanceService" />
- <property name="programStageInstanceService" ref="org.hisp.dhis.program.ProgramStageInstanceService" />
<property name="patientDataValueService" ref="org.hisp.dhis.patientdatavalue.PatientDataValueService" />
- <property name="patientService" ref="org.hisp.dhis.patient.PatientService" />
- <property name="programStageService" ref="org.hisp.dhis.program.ProgramStageService" />
</bean>
<bean id="org.hisp.dhis.caseentry.screen.DataEntryScreenManager" class="org.hisp.dhis.caseentry.screen.DefaultDataEntryScreenManager"
@@ -107,22 +100,20 @@
<bean id="org.hisp.dhis.caseentry.action.caseentry.LoadProgramStagesAction" class="org.hisp.dhis.caseentry.action.caseentry.LoadProgramStagesAction"
scope="prototype">
- <property name="patientService" ref="org.hisp.dhis.patient.PatientService" />
<property name="programService" ref="org.hisp.dhis.program.ProgramService" />
<property name="programInstanceService" ref="org.hisp.dhis.program.ProgramInstanceService" />
<property name="programStageInstanceService" ref="org.hisp.dhis.program.ProgramStageInstanceService" />
+ <property name="selectedStateManager" ref="org.hisp.dhis.caseentry.state.SelectedStateManager" />
</bean>
<bean id="org.hisp.dhis.caseentry.action.caseentry.LoadDataEntryAction" class="org.hisp.dhis.caseentry.action.caseentry.LoadDataEntryAction"
scope="prototype">
<property name="programStageService" ref="org.hisp.dhis.program.ProgramStageService" />
- <property name="programInstanceService" ref="org.hisp.dhis.program.ProgramInstanceService" />
<property name="programDataEntryService" ref="org.hisp.dhis.program.ProgramDataEntryService" />
<property name="patientDataValueService" ref="org.hisp.dhis.patientdatavalue.PatientDataValueService" />
<property name="programStageInstanceService" ref="org.hisp.dhis.program.ProgramStageInstanceService" />
- <property name="patientService" ref="org.hisp.dhis.patient.PatientService" />
- <property name="selectionManager" ref="org.hisp.dhis.ouwt.manager.OrganisationUnitSelectionManager" />
<property name="programStageDataElementService" ref="org.hisp.dhis.program.ProgramStageDataElementService" />
+ <property name="selectedStateManager" ref="org.hisp.dhis.caseentry.state.SelectedStateManager" />
</bean>
<bean id="org.hisp.dhis.caseentry.action.caseentry.CompleteDataEntryAction" class="org.hisp.dhis.caseentry.action.caseentry.CompleteDataEntryAction"
@@ -142,8 +133,8 @@
<bean id="org.hisp.dhis.caseentry.action.caseentry.GetProgramsByOrgunitAction" class="org.hisp.dhis.caseentry.action.caseentry.GetProgramsByOrgunitAction"
scope="prototype">
- <property name="selectionManager" ref="org.hisp.dhis.ouwt.manager.OrganisationUnitSelectionManager" />
<property name="programService" ref="org.hisp.dhis.program.ProgramService" />
+ <property name="selectedStateManager" ref="org.hisp.dhis.caseentry.state.SelectedStateManager" />
</bean>
<bean id="org.hisp.dhis.caseentry.action.caseentry.GetDataRecordsAction" class="org.hisp.dhis.caseentry.action.caseentry.GetDataRecordsAction"
@@ -281,13 +272,9 @@
<bean id="org.hisp.dhis.caseentry.action.caseentry.ValidateProgramInstanceAction" class="org.hisp.dhis.caseentry.action.caseentry.ValidateProgramInstanceAction"
scope="prototype">
<property name="selectedStateManager" ref="org.hisp.dhis.caseentry.state.SelectedStateManager" />
- <property name="programInstanceService" ref="org.hisp.dhis.program.ProgramInstanceService" />
<property name="programStageInstanceService" ref="org.hisp.dhis.program.ProgramStageInstanceService" />
<property name="patientDataValueService" ref="org.hisp.dhis.patientdatavalue.PatientDataValueService" />
<property name="programValidationService" ref="org.hisp.dhis.program.ProgramValidationService" />
- <property name="orgunitService" ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
- <property name="patientService" ref="org.hisp.dhis.patient.PatientService" />
- <property name="programStageService" ref="org.hisp.dhis.program.ProgramStageService" />
</bean>
</beans>
=== 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 2011-06-01 05:14:19 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataEntryForm.vm 2011-07-08 07:22:42 +0000
@@ -16,11 +16,8 @@
</script>
</p>
-<input type='hidden' id='programStageInstanceId' value='$programStageInstance.id'>
-<input type='hidden' id='programStageInstanceName' value='$programStageInstance.name'>
<input type='hidden' id='incidentDate' value='$!format.formatDate($programStageInstance.programInstance.dateOfIncident)'>
-<input type='hidden' id='orgunitId' value='$organisationUnit.id'>
-
+
<hr style="clear:both">
<span id="startMsg" style="font-style:italic; color:blue; display: #if($programStageInstance.executionDate) none #else block #end">$i18n.getString( "report_date_warning" )</span>
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataRecordingSelect.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataRecordingSelect.vm 2011-06-01 05:14:19 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataRecordingSelect.vm 2011-07-08 07:22:42 +0000
@@ -51,5 +51,3 @@
</td>
</tr>
</table>
-
-<input type='hidden' id='patientId' name='patientId' value='$patient.id'>
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/dataEntry.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/dataEntry.js 2011-07-08 06:15:48 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/dataEntry.js 2011-07-08 07:22:42 +0000
@@ -90,7 +90,6 @@
}
jQuery.postJSON( "loadProgramStages.action",
{
- patientId: getFieldValue('patientId'),
programId: getFieldValue('programId')
},
function( json )
@@ -140,7 +139,6 @@
jQuery('#dataEntryFormDiv').load("dataentryform.action",
{
programStageId:getFieldValue('programStageId'),
- patientId: getFieldValue('patientId'),
useDefaultForm : useDefaultForm
},
function( )
@@ -327,7 +325,7 @@
request.setCallbackSuccess( handleResponse );
request.setCallbackError( handleHttpError );
request.setResponseTypeXML( 'status' );
- request.send( 'saveExecutionDate.action?programStageInstanceId=' + programStageInstanceId + '&executionDate=' + executionDate );
+ request.send( 'saveExecutionDate.action?executionDate=' + executionDate );
};
function handleResponse( rootElement )
@@ -402,10 +400,7 @@
{
var params = 'dataElementId=' + dataElementId
params += '&value=' + value
- params += '&providedByAnotherFacility=' + providedByAnotherFacility
- params += '&orgunitId=' + getFieldValue('orgunitId');
- params += '&patientId=' + getFieldValue('patientId');
- params += '&programStageId=' + getFieldValue('programStageId');
+ params += '&providedByAnotherFacility=' + providedByAnotherFacility;
var request = new Request();
request.setCallbackSuccess( handleResponse );
@@ -490,10 +485,7 @@
{
var params = 'dataElementId=' + dataElementId
params += '&value=' + value
- params += '&providedByAnotherFacility=' + providedByAnotherFacility
- params += '&orgunitId=' + getFieldValue('orgunitId');
- params += '&patientId=' + getFieldValue('patientId');
- params += '&programStageId=' + getFieldValue('programStageId');
+ params += '&providedByAnotherFacility=' + providedByAnotherFacility;
var request = new Request();
request.setCallbackSuccess( handleResponse );
@@ -582,10 +574,7 @@
request.setCallbackError( handleHttpErrorCheckBox );
request.setResponseTypeXML( 'status' );
request.send( 'saveProvidingFacility.action?dataElementId=' + dataElementId
- + '&patientId=' + getFieldValue('patientId')
- + '&programStageId=' + getFieldValue('programStageId')
- + '&providedByAnotherFacility=' + providedByAnotherFacility
- );
+ + '&providedByAnotherFacility=' + providedByAnotherFacility );
};
function handleResponseCheckBox( rootElement )
@@ -633,8 +622,6 @@
request.setCallbackError( handleHttpErrorCheckBox );
request.setResponseTypeXML( 'status' );
request.send( 'saveProvidingFacility.action?dataElementId=' + dataElementId
- + '&patientId=' + getFieldValue('patientId')
- + '&programStageId=' + programStageId
+'&providedByAnotherFacility=' + providedByAnotherFacility );
};
@@ -820,10 +807,7 @@
var params = 'dataElementId=' + dataElementId;
params += '&value=' + value;
params += '&providedByAnotherFacility=' + providedByAnotherFacility;
- params += '&orgunitId=' + getFieldValue('orgunitId');
- params += '&patientId=' + getFieldValue('patientId');
- params += '&programStageId=' + getFieldValue('programStageId');
-
+
var request = new Request();
request.setCallbackSuccess( handleResponse );
request.setCallbackError( handleHttpError );
@@ -930,9 +914,6 @@
params += '&optionComboId=' + optionComboId;
params += '&value=' + value;
params += '&providedByAnotherFacility=' + providedByAnotherFacility;
- params += '&orgunitId=' + getFieldValue('orgunitId');
- params += '&patientId=' + getFieldValue('patientId');
- params += '&programStageId=' + getFieldValue('programStageId');
request.sendAsPost( params );
@@ -944,9 +925,6 @@
var params = 'dataElementId=' + dataElementId;
params += '&value=' + value;
params += '&providedByAnotherFacility=' + providedByAnotherFacility;
- params += '&orgunitId=' + getFieldValue('orgunitId');
- params += '&patientId=' + getFieldValue('patientId');
- params += '&programStageId=' + getFieldValue('programStageId');
request.sendAsPost( params );
if( type == 'date' ) request.send( 'saveDateValue.action' );
@@ -1229,7 +1207,6 @@
function saveValueWithOptionComboId( this_ )
{
-
var data = jQuery( this_ ).metadata({
type:'attr',
name:'data'
@@ -1389,9 +1366,7 @@
function runValidation()
{
- window.open( 'validateProgram.action?orgunitId=' + getFieldValue('orgunitId')
- + '&patientId=' + getFieldValue('patientId')
- + '&programStageId=' + getFieldValue('programStageId') );
+ window.open( 'validateProgram.action' );
}
@@ -1425,8 +1400,7 @@
addOptionById( 'programId', json.programs[i].id, json.programs[i].name );
}
}
- setFieldValue( 'orgunitName', json.organisationUnit );
- setFieldValue( 'orgunitId', json.organisationUnitId );
+ setFieldValue( 'orgunitName', json.organisationUnit );
});
}
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programStageDataEntryForm.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programStageDataEntryForm.vm 2011-05-26 08:25:21 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programStageDataEntryForm.vm 2011-07-08 07:22:42 +0000
@@ -7,10 +7,6 @@
<form id="dataEntryFormDiv" name="dataEntryFormDiv" method="post" action="selectDataRecording.action">
-<input type="hidden" id="patientId" name="patientId" value="$patient.id">
-<input type="hidden" id="programStageId" name="programStageId" value="$programStageInstance.programStage.id">
-<input type="hidden" id="programStageInstanceId" name="programStageInstanceId" value="$programStageInstance.id">
-
<table class="mainPageTable">
<tr>
<td>