dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #24223
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 11830: Remove Identifier tab; put person attributes and person identifiers into Data filter tab; Add mor...
------------------------------------------------------------
revno: 11830
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2013-08-29 16:34:09 +0700
message:
Remove Identifier tab; put person attributes and person identifiers into Data filter tab; Add more properties for Favorite tarbular report object.,,
removed:
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/LoadPatientPropertiesAction.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonPatientProperties.vm
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/patientreport/PatientTabularReport.java
dhis-2/dhis-services/dhis-service-eventreporting/src/main/resources/org/hisp/dhis/patientreport/hibernate/PatientTabularReport.hbm.xml
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/DeleteTabularReportAction.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GetTabularReportAction.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/LoadDataElementsAction.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/SaveTabularReportAction.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/struts.xml
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/app.js
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/defaultDataEntryForm.vm
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/jsonTabularInitialize.vm
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonTabularReport.vm
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonTabularReportList.vm
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/responseDataElements.vm
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/sectionDataEntryForm.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/patientreport/PatientTabularReport.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/patientreport/PatientTabularReport.java 2013-08-23 15:56:19 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/patientreport/PatientTabularReport.java 2013-08-29 09:34:09 +0000
@@ -38,6 +38,7 @@
import org.hisp.dhis.common.view.DetailedView;
import org.hisp.dhis.common.view.ExportView;
import org.hisp.dhis.organisationunit.OrganisationUnit;
+import org.hisp.dhis.program.Program;
import org.hisp.dhis.program.ProgramStage;
import org.hisp.dhis.user.User;
@@ -60,44 +61,45 @@
private static final long serialVersionUID = -2880334669266185058L;
public static String PREFIX_EXECUTION_DATE = "executiondate";
+
public static String PREFIX_ORGUNIT = "orgunit";
+
public static String PREFIX_META_DATA = "meta";
+
public static String PREFIX_IDENTIFIER_TYPE = "iden";
+
public static String PREFIX_FIXED_ATTRIBUTE = "fixedAttr";
+
public static String PREFIX_PATIENT_ATTRIBUTE = "attr";
+
public static String PREFIX_DATA_ELEMENT = "de";
+
public static String PREFIX_NUMBER_DATA_ELEMENT = "numberDe";
public static String VALUE_TYPE_OPTION_SET = "optionSet";
+ private Program program;
+
+ private ProgramStage programStage;
+
private Date startDate;
private Date endDate;
- private ProgramStage programStage;
-
private Set<OrganisationUnit> organisationUnits;
+ private List<String> items = new ArrayList<String>();
+
+ private String sortByAsc;
+
+ private String sortByDesc;
+
+ private User user;
+
private int level;
- private boolean sortedOrgunitAsc;
-
private String facilityLB;
- private User user;
-
- private Boolean useCompletedEvents;
-
- private Boolean userOrganisationUnit;
-
- private Boolean userOrganisationUnitChildren;
-
- private List<String> filterValues = new ArrayList<String>();
-
- private Boolean displayOrgunitCode;
-
- private Boolean useFormNameDataElement;
-
// -------------------------------------------------------------------------
// Constructors
// -------------------------------------------------------------------------
@@ -114,9 +116,9 @@
// -------------------------------------------------------------------------
// Getters && Setters
// -------------------------------------------------------------------------
-
+
@JsonProperty
- @JsonView( {DetailedView.class, ExportView.class} )
+ @JsonView( { DetailedView.class, ExportView.class } )
@JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
public Date getStartDate()
{
@@ -129,20 +131,7 @@
}
@JsonProperty
- @JsonView( {DetailedView.class, ExportView.class} )
- @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
- public Boolean getUseFormNameDataElement()
- {
- return useFormNameDataElement;
- }
-
- public void setUseFormNameDataElement( Boolean useFormNameDataElement )
- {
- this.useFormNameDataElement = useFormNameDataElement;
- }
-
- @JsonProperty
- @JsonView( {DetailedView.class, ExportView.class} )
+ @JsonView( { DetailedView.class, ExportView.class } )
@JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
public Date getEndDate()
{
@@ -170,21 +159,90 @@
}
@JsonProperty
- @JsonView( {DetailedView.class, ExportView.class} )
- @JacksonXmlElementWrapper( localName = "filterValues", namespace = DxfNamespaces.DXF_2_0)
- @JacksonXmlProperty( localName = "filterValue", namespace = DxfNamespaces.DXF_2_0)
- public List<String> getFilterValues()
- {
- return filterValues;
- }
-
- public void setFilterValues( List<String> filterValues )
- {
- this.filterValues = filterValues;
- }
-
- @JsonProperty
- @JsonView( {DetailedView.class, ExportView.class} )
+ @JsonView( { DetailedView.class, ExportView.class } )
+ @JacksonXmlElementWrapper( localName = "items", namespace = DxfNamespaces.DXF_2_0 )
+ @JacksonXmlProperty( localName = "items", namespace = DxfNamespaces.DXF_2_0 )
+ public List<String> getItems()
+ {
+ return items;
+ }
+
+ public void setItems( List<String> items )
+ {
+ this.items = items;
+ }
+
+ @JsonProperty
+ @JsonView( { DetailedView.class, ExportView.class } )
+ @JsonSerialize( as = BaseIdentifiableObject.class )
+ @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
+ public Program getProgram()
+ {
+ return program;
+ }
+
+ public void setProgram( Program program )
+ {
+ this.program = program;
+ }
+
+ @JsonProperty
+ @JsonView( { DetailedView.class, ExportView.class } )
+ @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
+ public String getSortByAsc()
+ {
+ return sortByAsc;
+ }
+
+ public void setSortByAsc( String sortByAsc )
+ {
+ this.sortByAsc = sortByAsc;
+ }
+
+ @JsonProperty
+ @JsonView( { DetailedView.class, ExportView.class } )
+ @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
+ public String getSortByDesc()
+ {
+ return sortByDesc;
+ }
+
+ public void setSortByDesc( String sortByDesc )
+ {
+ this.sortByDesc = sortByDesc;
+ }
+
+
+ @JsonProperty
+ @JsonView( { DetailedView.class, ExportView.class } )
+ @JacksonXmlElementWrapper( localName = "users", namespace = DxfNamespaces.DXF_2_0 )
+ @JacksonXmlProperty( localName = "user", namespace = DxfNamespaces.DXF_2_0 )
+ public User getUser()
+ {
+ return user;
+ }
+
+ public void setUser( User user )
+ {
+ this.user = user;
+ }
+
+ @JsonProperty
+ @JsonView( { DetailedView.class, ExportView.class } )
+ @JacksonXmlElementWrapper( localName = "programStages", namespace = DxfNamespaces.DXF_2_0 )
+ @JacksonXmlProperty( localName = "programStage", namespace = DxfNamespaces.DXF_2_0 )
+ public ProgramStage getProgramStage()
+ {
+ return programStage;
+ }
+
+ public void setProgramStage( ProgramStage programStage )
+ {
+ this.programStage = programStage;
+ }
+
+ @JsonProperty
+ @JsonView( { DetailedView.class, ExportView.class } )
@JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
public int getLevel()
{
@@ -197,20 +255,7 @@
}
@JsonProperty
- @JsonView( {DetailedView.class, ExportView.class} )
- @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
- public boolean isSortedOrgunitAsc()
- {
- return sortedOrgunitAsc;
- }
-
- public void setSortedOrgunitAsc( boolean sortedOrgunitAsc )
- {
- this.sortedOrgunitAsc = sortedOrgunitAsc;
- }
-
- @JsonProperty
- @JsonView( {DetailedView.class, ExportView.class} )
+ @JsonView( { DetailedView.class, ExportView.class } )
@JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
public String getFacilityLB()
{
@@ -222,83 +267,4 @@
this.facilityLB = facilityLB;
}
- @JsonProperty
- @JsonView( {DetailedView.class, ExportView.class} )
- @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
- public Boolean getUserOrganisationUnit()
- {
- return userOrganisationUnit;
- }
-
- public void setUserOrganisationUnit( Boolean userOrganisationUnit )
- {
- this.userOrganisationUnit = userOrganisationUnit;
- }
-
- @JsonProperty
- @JsonView( {DetailedView.class, ExportView.class} )
- @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
- public Boolean getUserOrganisationUnitChildren()
- {
- return userOrganisationUnitChildren;
- }
-
- public void setUserOrganisationUnitChildren( Boolean userOrganisationUnitChildren )
- {
- this.userOrganisationUnitChildren = userOrganisationUnitChildren;
- }
-
- @JsonProperty
- @JsonView( {DetailedView.class, ExportView.class} )
- @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
- public Boolean getUseCompletedEvents()
- {
- return useCompletedEvents;
- }
-
- public void setUseCompletedEvents( Boolean useCompletedEvents )
- {
- this.useCompletedEvents = useCompletedEvents;
- }
-
- @JsonProperty
- @JsonView({ DetailedView.class, ExportView.class })
- @JacksonXmlElementWrapper(localName = "users", namespace = DxfNamespaces.DXF_2_0)
- @JacksonXmlProperty(localName = "user", namespace = DxfNamespaces.DXF_2_0)
- public User getUser()
- {
- return user;
- }
-
- public void setUser( User user )
- {
- this.user = user;
- }
-
- @JsonProperty
- @JsonView({ DetailedView.class, ExportView.class })
- @JacksonXmlElementWrapper(localName = "programStages", namespace = DxfNamespaces.DXF_2_0)
- @JacksonXmlProperty(localName = "programStage", namespace = DxfNamespaces.DXF_2_0)
- public ProgramStage getProgramStage()
- {
- return programStage;
- }
-
- public void setProgramStage( ProgramStage programStage )
- {
- this.programStage = programStage;
- }
-
- @JsonProperty
- @JsonView( {DetailedView.class, ExportView.class} )
- @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
- public Boolean getDisplayOrgunitCode()
- {
- return displayOrgunitCode;
- }
-
- public void setDisplayOrgunitCode( Boolean displayOrgunitCode )
- {
- this.displayOrgunitCode = displayOrgunitCode;
- }
}
=== modified file 'dhis-2/dhis-services/dhis-service-eventreporting/src/main/resources/org/hisp/dhis/patientreport/hibernate/PatientTabularReport.hbm.xml'
--- dhis-2/dhis-services/dhis-service-eventreporting/src/main/resources/org/hisp/dhis/patientreport/hibernate/PatientTabularReport.hbm.xml 2013-08-21 12:29:12 +0000
+++ dhis-2/dhis-services/dhis-service-eventreporting/src/main/resources/org/hisp/dhis/patientreport/hibernate/PatientTabularReport.hbm.xml 2013-08-29 09:34:09 +0000
@@ -6,65 +6,62 @@
>
<hibernate-mapping>
- <class name="org.hisp.dhis.patientreport.PatientTabularReport"
- table="patienttabularreport">
-
- <id name="id" column="patienttabularreportid">
- <generator class="native" />
- </id>
- &identifiableProperties;
-
- <property name="name" column="name" not-null="true" unique="true" length="230" />
-
- <many-to-one name="programStage" class="org.hisp.dhis.program.ProgramStage"
- column="programstageid" foreign-key="fk_patientaggregatereport_programstage" />
-
- <property name="startDate" />
-
- <property name="endDate" />
-
- <set name="organisationUnits" table="patienttabularreport_organisationUnits">
- <cache usage="read-write" />
- <key column="patienttabularreportid" foreign-key="fk_patienttabularreport_organisationUnitid" />
- <many-to-many column="organisationunitid" class="org.hisp.dhis.organisationunit.OrganisationUnit"
- foreign-key="fk_patienttabularreportid_organisationunit" />
- </set>
-
- <property name="level" />
-
- <property name="sortedOrgunitAsc" />
-
- <property name="facilityLB" />
-
- <property name="useCompletedEvents" />
-
- <property name="userOrganisationUnit" />
-
- <property name="userOrganisationUnitChildren" />
-
- <list name="filterValues" table="patienttabularreport_filtervalues">
- <key column="patientaggregatereportid"
- foreign-key="fk_patienttabularreportid_filtervalues" />
- <list-index column="sort_order" base="1" />
- <element type="text" column="filtervalue" />
- </list>
-
- <property name="displayOrgunitCode" />
-
- <property name="useFormNameDataElement" />
-
- <!-- Access properties -->
+ <class name="org.hisp.dhis.patientreport.PatientTabularReport"
+ table="patienttabularreport">
+
+ <id name="id" column="patienttabularreportid">
+ <generator class="native" />
+ </id>
- <many-to-one name="user" class="org.hisp.dhis.user.User"
- column="userid" foreign-key="fk_patienttabularreport_userid" />
-
- <property name="publicAccess" length="8" />
-
- <set name="userGroupAccesses" table="patienttabularreportusergroupaccesses">
- <cache usage="read-write" />
- <key column="patienttabularreportid" />
- <many-to-many class="org.hisp.dhis.user.UserGroupAccess" column="usergroupaccessid" unique="true" />
- </set>
-
- </class>
+ &identifiableProperties;
+
+ <property name="name" column="name" not-null="true" unique="true"
+ length="230" />
+
+ <many-to-one name="program" class="org.hisp.dhis.program.Program"
+ column="programid" foreign-key="fk_patienttabularreport_program" />
+
+ <many-to-one name="programStage" class="org.hisp.dhis.program.ProgramStage"
+ column="programstageid" foreign-key="fk_patienttabularreport_programstage" />
+
+ <property name="startDate" />
+
+ <property name="endDate" />
+
+ <set name="organisationUnits" table="patienttabularreport_organisationUnits">
+ <cache usage="read-write" />
+ <key column="patienttabularreportid" foreign-key="fk_patienttabularreport_organisationUnitid" />
+ <many-to-many column="organisationunitid"
+ class="org.hisp.dhis.organisationunit.OrganisationUnit" foreign-key="fk_patienttabularreportid_organisationunit" />
+ </set>
+
+ <list name="items" table="patienttabularreport_filtervalues">
+ <key column="patientaggregatereportid" foreign-key="fk_patienttabularreportid_items" />
+ <list-index column="sort_order" base="1" />
+ <element type="text" column="itemvalue" />
+ </list>
+
+ <property name="sortByAsc" />
+
+ <property name="sortByDesc" />
+
+ <property name="level" />
+
+ <property name="facilityLB" />
+
+ <!-- Access properties -->
+
+ <many-to-one name="user" class="org.hisp.dhis.user.User"
+ column="userid" foreign-key="fk_patienttabularreport_userid" />
+
+ <property name="publicAccess" length="8" />
+
+ <set name="userGroupAccesses" table="patienttabularreportusergroupaccesses">
+ <cache usage="read-write" />
+ <key column="patienttabularreportid" />
+ <many-to-many class="org.hisp.dhis.user.UserGroupAccess"
+ column="usergroupaccessid" unique="true" />
+ </set>
+
+ </class>
</hibernate-mapping>
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/DeleteTabularReportAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/DeleteTabularReportAction.java 2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/DeleteTabularReportAction.java 2013-08-29 09:34:09 +0000
@@ -56,9 +56,9 @@
// Input
// -------------------------------------------------------------------------
- private Integer id;
+ private String id;
- public void setId( Integer id )
+ public void setId( String id )
{
this.id = id;
}
@@ -71,7 +71,7 @@
public String execute()
throws Exception
{
- PatientTabularReport tabularReport = tabularReportService.getPatientTabularReport( id );
+ PatientTabularReport tabularReport = tabularReportService.getPatientTabularReportByUid( id );
tabularReportService.deletePatientTabularReport( tabularReport );
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GetTabularReportAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GetTabularReportAction.java 2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GetTabularReportAction.java 2013-08-29 09:34:09 +0000
@@ -176,41 +176,41 @@
programStage = tabularReport.getProgramStage();
- for ( String filterValue : tabularReport.getFilterValues() )
- {
- String[] values = filterValue.split( "_" );
- String filter = "";
- if ( values.length == 5 )
- {
- filter = values[3] + "_" + values[4].trim().substring( 1, values[4].length() - 1 );
- }
-
- if ( values[0].equals( PatientTabularReport.PREFIX_FIXED_ATTRIBUTE ) )
- {
- selectedFixedAttributes.add( values[1] );
- fixedAttributeFilters.add( filter );
- }
- else
- {
- int id = Integer.parseInt( values[1] );
-
- if ( values[0].equals( PatientTabularReport.PREFIX_IDENTIFIER_TYPE ) )
- {
- selectedIdentifierTypes.add( patientIdentifierTypeService.getPatientIdentifierType( id ) );
- identifierTypeFilters.add( filter );
- }
- else if ( values[0].equals( PatientTabularReport.PREFIX_PATIENT_ATTRIBUTE ) )
- {
- selectedAttributes.add( patientAttributeService.getPatientAttribute( id ) );
- patientAttributeFilters.add( filter );
- }
- else if ( values[0].equals( PatientTabularReport.PREFIX_DATA_ELEMENT ) )
- {
- selectedDataElements.add( dataElementService.getDataElement( id ) );
- dataelementFilters.add( filter );
- }
- }
- }
+// for ( String filterValue : tabularReport.getItems() )
+// {
+// String[] values = filterValue.split( "_" );
+// String filter = "";
+// if ( values.length == 5 )
+// {
+// filter = values[3] + "_" + values[4].trim().substring( 1, values[4].length() - 1 );
+// }
+//
+// if ( values[0].equals( PatientTabularReport.PREFIX_FIXED_ATTRIBUTE ) )
+// {
+// selectedFixedAttributes.add( values[1] );
+// fixedAttributeFilters.add( filter );
+// }
+// else
+// {
+// int id = Integer.parseInt( values[1] );
+//
+// if ( values[0].equals( PatientTabularReport.PREFIX_IDENTIFIER_TYPE ) )
+// {
+// selectedIdentifierTypes.add( patientIdentifierTypeService.getPatientIdentifierType( id ) );
+// identifierTypeFilters.add( filter );
+// }
+// else if ( values[0].equals( PatientTabularReport.PREFIX_PATIENT_ATTRIBUTE ) )
+// {
+// selectedAttributes.add( patientAttributeService.getPatientAttribute( id ) );
+// patientAttributeFilters.add( filter );
+// }
+// else if ( values[0].equals( PatientTabularReport.PREFIX_DATA_ELEMENT ) )
+// {
+// selectedDataElements.add( dataElementService.getDataElement( id ) );
+// dataelementFilters.add( filter );
+// }
+// }
+// }
return SUCCESS;
}
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/LoadDataElementsAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/LoadDataElementsAction.java 2013-08-28 06:43:27 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/LoadDataElementsAction.java 2013-08-29 09:34:09 +0000
@@ -29,7 +29,15 @@
*/
import java.util.Collection;
+import java.util.HashSet;
+import org.hisp.dhis.common.BaseIdentifiableObject;
+import org.hisp.dhis.patient.PatientAttribute;
+import org.hisp.dhis.patient.PatientAttributeService;
+import org.hisp.dhis.patient.PatientIdentifierType;
+import org.hisp.dhis.patient.PatientIdentifierTypeService;
+import org.hisp.dhis.program.Program;
+import org.hisp.dhis.program.ProgramService;
import org.hisp.dhis.program.ProgramStageDataElement;
import org.hisp.dhis.program.ProgramStageSection;
import org.hisp.dhis.program.ProgramStageSectionService;
@@ -49,6 +57,13 @@
// Dependencies
// -------------------------------------------------------------------------
+ private ProgramService programService;
+
+ public void setProgramService( ProgramService programService )
+ {
+ this.programService = programService;
+ }
+
private ProgramStageService programStageService;
public void setProgramStageService( ProgramStageService programStageService )
@@ -63,10 +78,31 @@
this.programStageSectionService = programStageSectionService;
}
+ private PatientIdentifierTypeService identifierTypeService;
+
+ public void setIdentifierTypeService( PatientIdentifierTypeService identifierTypeService )
+ {
+ this.identifierTypeService = identifierTypeService;
+ }
+
+ private PatientAttributeService attributeService;
+
+ public void setAttributeService( PatientAttributeService attributeService )
+ {
+ this.attributeService = attributeService;
+ }
+
// -------------------------------------------------------------------------
// Input/output
// -------------------------------------------------------------------------
+ private String programId;
+
+ public void setProgramId( String programId )
+ {
+ this.programId = programId;
+ }
+
private String programStageId;
public void setProgramStageId( String programStageId )
@@ -81,6 +117,20 @@
this.sectionId = sectionId;
}
+ private Collection<PatientIdentifierType> identifierTypes = new HashSet<PatientIdentifierType>();
+
+ public Collection<PatientIdentifierType> getIdentifierTypes()
+ {
+ return identifierTypes;
+ }
+
+ private Collection<PatientAttribute> patientAttributes = new HashSet<PatientAttribute>();
+
+ public Collection<PatientAttribute> getPatientAttributes()
+ {
+ return patientAttributes;
+ }
+
private Collection<ProgramStageDataElement> psDataElements;
public Collection<ProgramStageDataElement> getPsDataElements()
@@ -96,16 +146,36 @@
public String execute()
throws Exception
{
+ if ( programId != null )
+ {
+ Program program = programService.getProgram( programId );
+ if ( program.isRegistration() )
+ {
+ Collection<PatientIdentifierType> identifierTypes = identifierTypeService
+ .getAllPatientIdentifierTypes();
+ Collection<PatientAttribute> patientAttributes = attributeService.getAllPatientAttributes();
+
+ Collection<Program> programs = programService.getAllPrograms();
+ programs.remove( program );
+
+ for ( Program _program : programs )
+ {
+ identifierTypes.removeAll( _program.getPatientIdentifierTypes() );
+ patientAttributes.removeAll( _program.getPatientAttributes() );
+ }
+ }
+ }
+
if ( programStageId != null )
{
psDataElements = programStageService.getProgramStage( programStageId ).getProgramStageDataElements();
}
- else if( sectionId != null )
+ else if ( sectionId != null )
{
ProgramStageSection section = programStageSectionService.getProgramStageSection( sectionId );
psDataElements = section.getProgramStageDataElements();
}
-
+
return SUCCESS;
}
}
=== removed file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/LoadPatientPropertiesAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/LoadPatientPropertiesAction.java 2013-08-28 06:43:27 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/LoadPatientPropertiesAction.java 1970-01-01 00:00:00 +0000
@@ -1,130 +0,0 @@
-package org.hisp.dhis.caseentry.action.report;
-
-/*
- * Copyright (c) 2004-2013, 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.
- */
-
-import java.util.Collection;
-import java.util.HashSet;
-
-import org.hisp.dhis.patient.PatientAttribute;
-import org.hisp.dhis.patient.PatientAttributeService;
-import org.hisp.dhis.patient.PatientIdentifierType;
-import org.hisp.dhis.patient.PatientIdentifierTypeService;
-import org.hisp.dhis.program.Program;
-import org.hisp.dhis.program.ProgramService;
-
-import com.opensymphony.xwork2.Action;
-
-/**
- * @author Chau Thu Tran
- *
- * @version $LoadPatientPropertiesAction.java Apr 5, 2012 7:27:52 PM$
- */
-public class LoadPatientPropertiesAction
- implements Action
-{
- // -------------------------------------------------------------------------
- // Dependencies
- // -------------------------------------------------------------------------
-
- private PatientIdentifierTypeService identifierTypeService;
-
- private ProgramService programService;
-
- private PatientAttributeService attributeService;
-
- // -------------------------------------------------------------------------
- // Input/Output
- // -------------------------------------------------------------------------
-
- private String programId;
-
- private Collection<PatientIdentifierType> identifierTypes = new HashSet<PatientIdentifierType>();
-
- private Collection<PatientAttribute> patientAttributes = new HashSet<PatientAttribute>();
-
- // -------------------------------------------------------------------------
- // Getter && Setters
- // -------------------------------------------------------------------------
-
- public void setProgramService( ProgramService programService )
- {
- this.programService = programService;
- }
-
- public void setIdentifierTypeService( PatientIdentifierTypeService identifierTypeService )
- {
- this.identifierTypeService = identifierTypeService;
- }
-
- public void setAttributeService( PatientAttributeService attributeService )
- {
- this.attributeService = attributeService;
- }
-
- public void setProgramId( String programId )
- {
- this.programId = programId;
- }
-
- public Collection<PatientIdentifierType> getIdentifierTypes()
- {
- return identifierTypes;
- }
-
- public Collection<PatientAttribute> getPatientAttributes()
- {
- return patientAttributes;
- }
-
- // -------------------------------------------------------------------------
- // Action implementation
- // -------------------------------------------------------------------------
-
- @Override
- public String execute()
- throws Exception
- {
- Program program = programService.getProgram( programId );
-
- identifierTypes = identifierTypeService.getAllPatientIdentifierTypes();
- patientAttributes = attributeService.getAllPatientAttributes();
-
- Collection<Program> programs = programService.getAllPrograms();
- programs.remove( program );
-
- for ( Program _program : programs )
- {
- identifierTypes.removeAll( _program.getPatientIdentifierTypes() );
- patientAttributes.removeAll( _program.getPatientAttributes() );
- }
-
- return SUCCESS;
- }
-
-}
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/SaveTabularReportAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/SaveTabularReportAction.java 2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/SaveTabularReportAction.java 2013-08-29 09:34:09 +0000
@@ -29,7 +29,6 @@
*/
import java.util.ArrayList;
-import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
@@ -39,6 +38,8 @@
import org.hisp.dhis.organisationunit.OrganisationUnitService;
import org.hisp.dhis.patientreport.PatientTabularReport;
import org.hisp.dhis.patientreport.PatientTabularReportService;
+import org.hisp.dhis.program.Program;
+import org.hisp.dhis.program.ProgramService;
import org.hisp.dhis.program.ProgramStage;
import org.hisp.dhis.program.ProgramStageService;
import org.hisp.dhis.user.CurrentUserService;
@@ -64,6 +65,13 @@
this.tabularReportService = tabularReportService;
}
+ private ProgramService programService;
+
+ public void setProgramService( ProgramService programService )
+ {
+ this.programService = programService;
+ }
+
private OrganisationUnitService organisationUnitService;
public void setOrganisationUnitService( OrganisationUnitService organisationUnitService )
@@ -98,32 +106,26 @@
private String name;
+ private String programId;
+
+ private String programStageId;
+
private String startDate;
private String endDate;
- private Integer programStageId;
-
- private List<String> filterValues = new ArrayList<String>();
-
- private Collection<Integer> orgunitIds;
-
- private boolean orderByOrgunitAsc;
-
- private Integer level;
+ private List<String> orgunitIds;
+
+ private List<String> item = new ArrayList<String>();
+
+ private String asc;
+
+ private String desc;
+
+ private int level;
private String facilityLB;
- private Boolean useCompletedEvents;
-
- private Boolean userOrganisationUnit;
-
- private Boolean userOrganisationUnitChildren;
-
- private Boolean displayOrgunitCode;
-
- private Boolean useFormNameDataElement;
-
// -------------------------------------------------------------------------
// Setters
// -------------------------------------------------------------------------
@@ -133,69 +135,54 @@
this.name = name;
}
- public void setLevel( Integer level )
- {
- this.level = level;
- }
-
- public void setFilterValues( List<String> filterValues )
- {
- this.filterValues = filterValues;
- }
-
- public void setFacilityLB( String facilityLB )
- {
- this.facilityLB = facilityLB;
- }
-
- public void setOrderByOrgunitAsc( boolean orderByOrgunitAsc )
- {
- this.orderByOrgunitAsc = orderByOrgunitAsc;
- }
-
- public void setEndDate( String endDate )
- {
- this.endDate = endDate;
- }
-
- public void setDisplayOrgunitCode( Boolean displayOrgunitCode )
- {
- this.displayOrgunitCode = displayOrgunitCode;
- }
-
public void setStartDate( String startDate )
{
this.startDate = startDate;
}
- public void setOrgunitIds( Collection<Integer> orgunitIds )
+ public void setOrgunitIds( List<String> orgunitIds )
{
this.orgunitIds = orgunitIds;
}
- public void setProgramStageId( Integer programStageId )
+ public void setProgramId( String programId )
+ {
+ this.programId = programId;
+ }
+
+ public void setProgramStageId( String programStageId )
{
this.programStageId = programStageId;
}
- public void setUseCompletedEvents( Boolean useCompletedEvents )
- {
- this.useCompletedEvents = useCompletedEvents;
- }
-
- public void setUserOrganisationUnit( Boolean userOrganisationUnit )
- {
- this.userOrganisationUnit = userOrganisationUnit;
- }
-
- public void setUserOrganisationUnitChildren( Boolean userOrganisationUnitChildren )
- {
- this.userOrganisationUnitChildren = userOrganisationUnitChildren;
- }
-
- public void setUseFormNameDataElement( Boolean useFormNameDataElement )
- {
- this.useFormNameDataElement = useFormNameDataElement;
+ public void setEndDate( String endDate )
+ {
+ this.endDate = endDate;
+ }
+
+ public void setItem( List<String> item )
+ {
+ this.item = item;
+ }
+
+ public void setAsc( String asc )
+ {
+ this.asc = asc;
+ }
+
+ public void setDesc( String desc )
+ {
+ this.desc = desc;
+ }
+
+ public void setLevel( int level )
+ {
+ this.level = level;
+ }
+
+ public void setFacilityLB( String facilityLB )
+ {
+ this.facilityLB = facilityLB;
}
// -------------------------------------------------------------------------
@@ -206,14 +193,10 @@
public String execute()
throws Exception
{
- userOrganisationUnit = (userOrganisationUnit == null) ? false : userOrganisationUnit;
- userOrganisationUnitChildren = (userOrganisationUnitChildren == null) ? false : userOrganisationUnitChildren;
- displayOrgunitCode = (displayOrgunitCode == null) ? false : displayOrgunitCode;
- ;
-
Set<OrganisationUnit> orgunits = new HashSet<OrganisationUnit>(
- organisationUnitService.getOrganisationUnits( orgunitIds ) );
+ organisationUnitService.getOrganisationUnitsByUid( orgunitIds ) );
+ Program program = programService.getProgram( programId );
ProgramStage programStage = programStageService.getProgramStage( programStageId );
// ---------------------------------------------------------------------
@@ -226,23 +209,16 @@
tabularReport.setOrganisationUnits( orgunits );
tabularReport.setLevel( level );
tabularReport.setFacilityLB( facilityLB );
- tabularReport.setSortedOrgunitAsc( orderByOrgunitAsc );
tabularReport.setUser( currentUserService.getCurrentUser() );
- tabularReport.setDisplayOrgunitCode( displayOrgunitCode );
- tabularReport.setUseFormNameDataElement( useFormNameDataElement );
-
- if ( useCompletedEvents != null )
- {
- tabularReport.setUseCompletedEvents( useCompletedEvents );
- }
-
- tabularReport.setUserOrganisationUnit( userOrganisationUnit );
- tabularReport.setUserOrganisationUnitChildren( userOrganisationUnitChildren );
- tabularReport.setFilterValues( filterValues );
+ tabularReport.setItems( item );
+ tabularReport.setSortByAsc( asc );
+ tabularReport.setSortByDesc( desc );
tabularReport.setProgramStage( programStage );
+ tabularReport.setProgram( program );
tabularReportService.saveOrUpdate( tabularReport );
return SUCCESS;
}
+
}
=== 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 2013-08-19 06:54:13 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml 2013-08-29 09:34:09 +0000
@@ -886,18 +886,7 @@
<property name="organisationUnitService"
ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
</bean>
-
- <bean
- id="org.hisp.dhis.caseentry.action.report.LoadPatientPropertiesAction"
- class="org.hisp.dhis.caseentry.action.report.LoadPatientPropertiesAction"
- scope="prototype">
- <property name="programService" ref="org.hisp.dhis.program.ProgramService" />
- <property name="identifierTypeService"
- ref="org.hisp.dhis.patient.PatientIdentifierTypeService" />
- <property name="attributeService"
- ref="org.hisp.dhis.patient.PatientAttributeService" />
- </bean>
-
+
<bean id="org.hisp.dhis.caseentry.action.report.LoadProgramStagesAction"
class="org.hisp.dhis.caseentry.action.report.LoadProgramStagesAction"
scope="prototype">
@@ -907,9 +896,14 @@
<bean id="org.hisp.dhis.caseentry.action.report.LoadDataElementsAction"
class="org.hisp.dhis.caseentry.action.report.LoadDataElementsAction"
scope="prototype">
+ <property name="programService" ref="org.hisp.dhis.program.ProgramService" />
<property name="programStageService" ref="org.hisp.dhis.program.ProgramStageService" />
<property name="programStageSectionService"
ref="org.hisp.dhis.program.ProgramStageSectionService" />
+ <property name="identifierTypeService"
+ ref="org.hisp.dhis.patient.PatientIdentifierTypeService" />
+ <property name="attributeService"
+ ref="org.hisp.dhis.patient.PatientAttributeService" />
</bean>
<bean
@@ -954,6 +948,7 @@
ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
<property name="programStageService" ref="org.hisp.dhis.program.ProgramStageService" />
<property name="currentUserService" ref="org.hisp.dhis.user.CurrentUserService" />
+ <property name="programService" ref="org.hisp.dhis.program.ProgramService" />
</bean>
<bean id="org.hisp.dhis.caseentry.action.report.GetTabularReportAction"
=== 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 2013-08-27 03:31:40 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml 2013-08-29 09:34:09 +0000
@@ -860,15 +860,7 @@
</result>
<param name="requiredAuthorities">F_GENERATE_BENEFICIARY_TABULAR_REPORT</param>
</action>
-
- <action name="loadPatientProperties"
- class="org.hisp.dhis.caseentry.action.report.LoadPatientPropertiesAction">
- <result name="success" type="velocity-json">
- /dhis-web-caseentry/jsonPatientProperties.vm
- </result>
- <param name="requiredAuthorities">F_GENERATE_BENEFICIARY_TABULAR_REPORT</param>
- </action>
-
+
<action name="loadReportProgramStages"
class="org.hisp.dhis.caseentry.action.report.LoadProgramStagesAction">
<result name="success" type="velocity-json">/dhis-web-caseentry/jsonProgramStages.vm
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/app.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/app.js 2013-08-28 08:42:25 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/app.js 2013-08-29 09:34:09 +0000
@@ -30,8 +30,6 @@
obj.system.level.push({value: r.levels[i].value, name: r.levels[i].name});
}
- obj.system.accessPatientAttributes = r.user.accessPatientAttributes;
-
obj.report={};
obj.report.id = r.id;
@@ -47,7 +45,6 @@
path_api: '../../api/',
path_images: 'images/',
initialize: 'tabularInitialize.action',
- patientproperties_get: 'loadPatientProperties.action',
programstages_get: '../api/programs/',
programstagesections_get: 'loadProgramStageSections.action',
dataelements_get: 'loadDataElements.action',
@@ -91,10 +88,6 @@
filter: TR.i18n.wm_multiple_filter_orgunit
}
},
- patientProperties: {
- value: 'patientProperties',
- rawvalue: TR.i18n.patientProperties
- },
programStage: {
value: 'programStage',
rawvalue: TR.i18n.program_stage
@@ -267,7 +260,6 @@
params: {
program:{},
programStage: {},
- patientProperty: {},
dataelement: {},
organisationunit: {},
relativeperiod: {
@@ -338,8 +330,7 @@
return ((screen.height/2)-((cmp.height/2)-100));
},
resizeParams: function() {
- var a = [TR.cmp.params.patientProperty.panel,
- TR.cmp.params.dataelement.panel,
+ var a = [TR.cmp.params.dataelement.panel,
TR.cmp.params.organisationunit.treepanel];
for (var i = 0; i < a.length; i++) {
if (!a[i].collapsed) {
@@ -358,7 +349,7 @@
var data = a.store.findExact('id', item);
var name = a.store.getAt(data).data.name;
var valueType = a.store.getAt(data).data.valueType;
- array.push({id: item, localid:a.store.getAt(data).data.localid, name:name, valueType:valueType});
+ array.push({id: item, name:name, valueType:valueType});
if(f!=undefined)
{
TR.util.multiselect.addFilterField( f, item, name, valueType );
@@ -376,11 +367,11 @@
{
if( elements[i].style.display != 'none' )
{
- var localid = a.store.getAt(i).data.localid;
+ var id = a.store.getAt(i).data.id;
var name = a.store.getAt(i).data.name;
var valueType = a.store.getAt(i).data.valueType;
- array.push({id: a.store.getAt(i).data.id, localid:localid, name: name, valueType: valueType});
+ array.push({id: a.store.getAt(i).data.id, name: name, valueType: valueType});
if(f!=undefined)
{
TR.util.multiselect.addFilterField( f, a.store.getAt(i).data.id, name, valueType );
@@ -491,7 +482,7 @@
var filter = "";
if( filterValue!=undefined && filterValue != "" )
{
- var arrFilter = filterValue.split("_");
+ var arrFilter = filterValue.split(";");
opt = arrFilter[0];
filter = arrFilter[1];
}
@@ -1114,65 +1105,12 @@
success: function(r) {
var f = Ext.JSON.decode(r.responseText);
- Ext.getCmp('programCombobox').setValue( f.programId );
- TR.store.programStage.removeAll();
- TR.store.programStage.add({'id': f.programStageId, 'localid': f.programStageLocalid, 'name': f.programStageName});
Ext.getCmp('startDate').setValue( f.startDate );
Ext.getCmp('endDate').setValue( f.endDate );
- Ext.getCmp('facilityLBCombobox').setValue( f.facilityLB );
- Ext.getCmp('levelCombobox').setValue( f.level );
- Ext.getCmp('userOrgunit').setValue( f.userOrganisationUnit );
- Ext.getCmp('userOrgunitChildren').setValue( f.userOrganisationUnitChildren );
- Ext.getCmp('completedEventsOpt').setValue(f.useCompletedEvents);
- Ext.getCmp('displayOrgunitCode').setValue(f.displayOrgunitCode);
-
- // Orgunits
-
- var treepanel = TR.cmp.params.organisationunit.treepanel;
- treepanel.getSelectionModel().deselectAll();
- TR.state.orgunitIds = [];
- var orgunitUids = [];
- for (var i = 0; i < f.orgunitIds.length; i++) {
- TR.state.orgunitIds.push( f.orgunitIds[i].localid );
- orgunitUids.push( f.orgunitIds[i].id );
- }
- treepanel.selectByIds(orgunitUids);
-
- // Patient properties
- Ext.getCmp('filterPropPanel').removeAll();
- Ext.getCmp('filterPropPanel').doLayout();
- TR.store.patientProperty.selected.removeAll();
-
- // programs with registration
- TR.cmp.params.patientProperty.objects = [];
- if (f.patientProperties && f.type != "3" ) {
- for (var i = 0; i < f.patientProperties.length; i++) {
- var name = TR.util.string.getEncodedString(f.patientProperties[i].name);
- TR.cmp.params.patientProperty.objects.push({id: f.patientProperties[i].id, name: name});
- TR.util.multiselect.addFilterField( 'filterPropPanel', f.patientProperties[i].id, name, f.patientProperties[i].valueType, f.patientProperties[i].filter );
- }
-
- TR.store.patientProperty.selected.add(TR.cmp.params.patientProperty.objects);
-
- var storePatientProperty = TR.store.patientProperty.available;
- storePatientProperty.parent = f.programId;
- if (TR.util.store.containsParent(storePatientProperty)) {
- TR.util.store.loadFromStorage(storePatientProperty);
- TR.util.multiselect.filterAvailable(TR.cmp.params.patientProperty.available, TR.cmp.params.patientProperty.selected);
- }
- else {
- storePatientProperty.load({params: {programId: f.programId}});
- }
- }
-
- // Program stage
-
- var storeProgramStage = TR.store.programStage;
- storeProgramStage.parent = f.programStageId;
- storeProgramStage.isLoadFromFavorite = true;
-
- TR.cmp.params.organisationunit.treepanel.getSelectionModel().deselectAll();
-
+
+ Ext.getCmp('programCombobox').setValue( f.programId );
+ TR.store.programStage.parent = f.programStageId;
+ TR.store.programStage.isLoadFromFavorite = true;
TR.store.programStage.removeAll();
for (var i = 0; i < f.programStages.length; i++)
{
@@ -1181,6 +1119,18 @@
);
}
Ext.getCmp('programStageCombobox').setValue( f.programStageId );
+ Ext.getCmp('facilityLBCombobox').setValue( f.facilityLB );
+ Ext.getCmp('levelCombobox').setValue( f.level );
+
+ // Orgunits
+
+ var treepanel = TR.cmp.params.organisationunit.treepanel;
+ treepanel.getSelectionModel().deselectAll();
+ TR.state.orgunitIds = [];
+ for (var i = 0; i < f.orgunitIds.length; i++) {
+ TR.state.orgunitIds.push( f.orgunitIds[i].id );
+ }
+ treepanel.selectByIds(TR.state.orgunitIds);
// Data element
@@ -1188,13 +1138,19 @@
Ext.getCmp('filterPanel').doLayout();
TR.store.dataelement.selected.removeAll();
- if (f.dataElements) {
- for (var i = 0; i < f.dataElements.length; i++) {
- var name = TR.util.string.getEncodedString(f.dataElements[i].name);
- var valueType = f.dataElements[i].valueType;
- var localid = f.dataElements[i].localid;
- TR.store.dataelement.selected.add({id: f.dataElements[i].id, name: name, valueType: valueType, localid:localid});
- TR.util.multiselect.addFilterField( 'filterPanel', f.dataElements[i].id, name, valueType, f.dataElements[i].filter );
+ if (f.items) {
+ for (var i = 0; i < f.items.length; i++) {
+ var filter = f.items[i].id.split(';');
+ var id = filter[0];
+ var filterVal = "";
+ if( filter.length == 3 ){
+ filterVal = filter[1] + ";" + filter[2];
+ }
+
+ var name = TR.util.string.getEncodedString(f.items[i].name);
+ var valueType = f.items[i].valueType;
+ TR.store.dataelement.selected.add({id: id, name: name, valueType: valueType});
+ TR.util.multiselect.addFilterField( 'filterPanel', id, name, valueType, filterVal );
}
if( f.singleEvent == 'false' )
@@ -1376,12 +1332,10 @@
var treepanel = TR.cmp.params.organisationunit.treepanel;
treepanel.getSelectionModel().deselectAll();
TR.state.orgunitIds = [];
- var orgunitUids = [];
for (var i = 0; i < f.orgunitIds.length; i++) {
- TR.state.orgunitIds.push( f.orgunitIds[i].localid );
- orgunitUids.push( f.orgunitIds[i].id );
+ TR.state.orgunitIds.push( f.orgunitIds[i].id );
}
- treepanel.selectByIds(orgunitUids);
+ treepanel.selectByIds(TR.state.orgunitIds);
// Selected data elements
@@ -1515,32 +1469,6 @@
}
}
}),
- patientProperty: {
- available: Ext.create('Ext.data.Store', {
- fields: ['id', 'name', 'valueType'],
- proxy: {
- type: 'ajax',
- url: TR.conf.finals.ajax.path_commons + TR.conf.finals.ajax.patientproperties_get,
- reader: {
- type: 'json',
- root: 'patientProperties'
- }
- },
- isloaded: false,
- storage: {},
- listeners: {
- load: function(s) {
- this.isloaded = true;
- TR.util.store.addToStorage(s);
- TR.util.multiselect.filterAvailable(TR.cmp.params.patientProperty.available, TR.cmp.params.patientProperty.selected);
- }
- }
- }),
- selected: Ext.create('Ext.data.Store', {
- fields: ['id', 'name'],
- data: []
- })
- },
programStage: Ext.create('Ext.data.Store', {
fields: ['id', 'name'],
proxy: {
@@ -1611,7 +1539,7 @@
}
}),
programStageSection: Ext.create('Ext.data.Store', {
- fields: ['id', 'name', 'localid'],
+ fields: ['id', 'name'],
proxy: {
type: 'ajax',
url: TR.conf.finals.ajax.path_commons + TR.conf.finals.ajax.programstagesections_get,
@@ -1645,13 +1573,13 @@
}),
dataelement: {
available: Ext.create('Ext.data.Store', {
- fields: ['id', 'name', 'valueType', 'localid'],
+ fields: ['id', 'name', 'valueType'],
proxy: {
type: 'ajax',
url: TR.conf.finals.ajax.path_commons + TR.conf.finals.ajax.dataelements_get,
reader: {
type: 'json',
- root: 'dataElements'
+ root: 'items'
}
},
isloaded: false,
@@ -1688,7 +1616,7 @@
}
}),
selected: Ext.create('Ext.data.Store', {
- fields: ['id', 'name', 'valueType', 'localid'],
+ fields: ['id', 'name', 'valueType'],
data: []
})
},
@@ -1853,7 +1781,6 @@
currentPage: 1,
total: 1,
totalRecords: 0,
- isFilter:false,
asc: "",
desc: "",
orgunitIds: [],
@@ -1971,6 +1898,9 @@
p.endDate = TR.cmp.settings.endDate.rawValue;
p.facilityLB = TR.cmp.settings.facilityLB.getValue();
p.level = Ext.getCmp('levelCombobox').getValue();
+ p.orgunitIds = TR.state.orgunitIds;
+ p.programStageId = TR.cmp.params.programStage.getValue();
+ p.programId = Ext.getCmp('programCombobox').getValue();
// order-by
@@ -1981,7 +1911,6 @@
p.desc= TR.state.desc;
}
- p.programStageId = TR.cmp.params.programStage.getValue();
p.currentPage = TR.state.currentPage;
// organisation unit
@@ -2018,56 +1947,7 @@
p.item = [];
- // Patient properties
-
- TR.cmp.params.patientProperty.selected.store.each( function(r) {
- var propId = r.data.id;
- var valueType = r.data.valueType;
- var length = Ext.getCmp('filterPropPanel_' + propId).items.length/4;
- var hidden = TR.state.caseBasedReport.isColHidden(propId);
-
- for(var idx=0;idx<length;idx++)
- {
- var id = propId + '_' + idx;
- var filterField = Ext.getCmp('filter_' + id);
- var filterValue = "";
- if( filterField.xtype == 'combobox' )
- {
- var values = Ext.getCmp('filter_' + id).getValue();
- for( var i in values ){
- filterValue += values[i] + ";";
- }
- filterValue = filterValue.substring(0,filterValue.length - 1 );
- }
- else{
- filterValue = filterField.rawValue;
- }
-
- var filter = propId;
- if( filterValue!=null && filterValue!=''){
- var filterOpt = Ext.getCmp('filter_opt_' + id).getValue();
- filter += ';' + filterOpt + ';';
- if( filterOpt == 'IN' )
- {
- var filterValues = filterValue.split(";");
- filter +="(";
- for(var i=0;i<filterValues.length;i++)
- {
- filter += "'"+ filterValues[i] +"',";
- }
- filter = filter.substr(0,filter.length - 1) + ")";
- }
- else
- {
- filter += filterValue;
- }
- }
- if( idx < length - 1 ){
- filter +=";"
- }
- p.item.push( filter );
- }
- });
+ // Filter
var idx = 0;
TR.cmp.params.dataelement.selected.store.each( function(r) {
@@ -2146,56 +2026,7 @@
var filterValueList = document.getElementById('item');
TR.util.list.clearList(filterValueList);
- // Patient properties
-
- TR.cmp.params.patientProperty.selected.store.each( function(r) {
- var propId = r.data.id;
- var valueType = r.data.valueType;
- var length = Ext.getCmp('filterPropPanel_' + propId).items.length/4;
- var hidden = TR.state.caseBasedReport.isColHidden(propId);
-
- for(var idx=0;idx<length;idx++)
- {
- var id = propId + '_' + idx;
- var filterField = Ext.getCmp('filter_' + id);
- var filterValue = "";
- if( filterField.xtype == 'combobox' )
- {
- var values = Ext.getCmp('filter_' + id).getValue();
- for( var i in values ){
- filterValue += values[i] + ";";
- }
- filterValue = filterValue.substring(0,filterValue.length - 1 );
- }
- else{
- filterValue = filterField.rawValue;
- }
-
- var filter = propId;
- if( filterValue!=null && filterValue!=''){
- var filterOpt = Ext.getCmp('filter_opt_' + id).getValue();
- filter += ';' + filterOpt + ';';
- if( filterOpt == 'IN' )
- {
- var filterValues = filterValue.split(";");
- filter +="(";
- for(var i=0;i<filterValues.length;i++)
- {
- filter += "'"+ filterValues[i] +"',";
- }
- filter = filter.substr(0,filter.length - 1) + ")";
- }
- else
- {
- filter += filterValue;
- }
- }
- if( idx < length - 1 ){
- filter +=";"
- }
- TR.util.list.addOptionToList(filterValueList, filter, '');
- }
- });
+ // Data filter
var idx = 0;
TR.cmp.params.dataelement.selected.store.each( function(r) {
@@ -2551,7 +2382,7 @@
var id = deId + '_' + idx;
var filterOpt = Ext.getCmp('filter_opt_' + id).rawValue;
var filterValue = Ext.getCmp('filter_' + id).rawValue;
- var filter = r.data.localid.split('_')[1] + "_" + filterOpt + '_';
+ var filter = r.data.id.split('_')[1] + "_" + filterOpt + '_';
if( filterValue!=TR.i18n.please_select)
{
@@ -3534,7 +3365,7 @@
element.addClsOnOver('link');
element.load = function() {
favoriteWindow.hide();
- TR.util.crud.favorite.run( record.data.uid );
+ TR.util.crud.favorite.run( record.data.id );
};
element.dom.setAttribute('onclick', 'Ext.get(this).load();');
}
@@ -4009,7 +3840,7 @@
if (record.data.access.manage) {
Ext.Ajax.request({
- url:TR.conf.finals.ajax.path_api + 'sharing?type=patientAggregateReport&id=' + record.data.uid,
+ url:TR.conf.finals.ajax.path_api + 'sharing?type=patientAggregateReport&id=' + record.data.id,
method: 'GET',
failure: function(r) {
TR.util.mask.hideMask();
@@ -5039,7 +4870,6 @@
if(nv)
{
// for case-based report
- dataElementTabTitle.innerHTML = TR.i18n.data_elements;
Ext.getCmp('limitOption').setVisible(false);
Ext.getCmp('dataElementGroupByCbx').setVisible(false);
Ext.getCmp('aggregateType').setVisible(false);
@@ -5059,10 +4889,6 @@
Ext.getCmp('levelCombobox').setValue('1');
}
Ext.getCmp('dateRangeDiv').setVisible(true);
- if( TR.init.system.accessPatientAttributes=='true')
- {
- Ext.getCmp('patientPropertiesDiv').setVisible(false);
- }
Ext.getCmp('relativePeriodsDiv').setVisible(false);
Ext.getCmp('fixedPeriodsDiv').setVisible(false);
Ext.getCmp('dateRangeDiv').expand();
@@ -5081,7 +4907,6 @@
if(nv)
{
// For aggregate report
- dataElementTabTitle.innerHTML = TR.i18n.data_filter;
Ext.getCmp('limitOption').setVisible(true);
Ext.getCmp('dataElementGroupByCbx').setVisible(true);
Ext.getCmp('aggregateType').setVisible(true);
@@ -5092,7 +4917,6 @@
Ext.getCmp('dateRangeDiv').setVisible(false);
Ext.getCmp('levelCombobox').setVisible(false);
Ext.getCmp('caseBasedFavoriteBtn').setVisible(false);
- Ext.getCmp('patientPropertiesDiv').setVisible(false);
Ext.getCmp('displayOrgunitCode').setVisible(false);
Ext.getCmp('datePeriodRangeDiv').setVisible(true);
@@ -5144,47 +4968,25 @@
TR.cmp.settings.program = this;
},
select: function(cb) {
- TR.state.isFilter = false;
var pid = cb.getValue();
- var pLocalid = cb.displayTplData[0].localid;
-
- // Registration programs
- if( cb.displayTplData[0].type !='3' )
- {
- // IDENTIFIER TYPE && PATIENT ATTRIBUTES
- var storePatientProperty = TR.store.patientProperty.available;
- TR.store.patientProperty.selected.removeAll();
- storePatientProperty.parent = pLocalid;
-
- if (TR.util.store.containsParent(storePatientProperty)) {
- TR.util.store.loadFromStorage(storePatientProperty);
- TR.util.multiselect.filterAvailable(TR.cmp.params.patientProperty.available, TR.cmp.params.patientProperty.selected);
- }
- else {
- storePatientProperty.load({params: {programId: pid}});
- }
- }
- else
- {
- TR.store.patientProperty.available.removeAll();
- TR.store.patientProperty.selected.removeAll();
- }
TR.store.programStageSection.loadData([],false);
- // PROGRAM-STAGE
+ // Program-stage
+
var storeProgramStage = TR.store.programStage;
+ storeProgramStage.parent = pid;
+
+ var url = storeProgramStage.getProxy().url + pid + ".json?viewClass=export";
+ storeProgramStage.load({url:url});
+
TR.store.dataelement.available.removeAll();
TR.store.dataelement.selected.removeAll();
- storeProgramStage.parent = pid;
TR.store.dataelement.isLoadFromFavorite = false;
- var url = storeProgramStage.getProxy().url + pid + ".json?viewClass=export";
- storeProgramStage.load({url:url});
+ // Filter value fields
- // FILTER-VALUES FIELDS
Ext.getCmp('filterPanel').removeAll();
- Ext.getCmp('filterPropPanel').removeAll();
}
}
},
@@ -5211,7 +5013,6 @@
TR.cmp.params.programStage = this;
},
select: function(cb) {
- var psLocalid = cb.displayTplData[0].id;
var psid = cb.getValue();
// Get section from the selected program stage
@@ -5229,7 +5030,6 @@
// Get data element from the selected program stage
- TR.state.isFilter = false;
var store = TR.store.dataelement.available;
TR.store.dataelement.selected.loadData([],false);
store.parent = psid;
@@ -5242,7 +5042,7 @@
store.load({params: {programStageId: psid}});
}
- // FILTER-VALUES FIELDS
+ // Filter value fields
Ext.getCmp('filterPanel').removeAll();
}
}
@@ -5775,7 +5575,7 @@
icon: 'images/arrowright.png',
width: 22,
handler: function() {
- TR.util.multiselect.select(TR.cmp.params.fixedperiod.available, TR.cmp.params.fixedperiod.selected,'filterPropPanel');
+ TR.util.multiselect.select(TR.cmp.params.fixedperiod.available, TR.cmp.params.fixedperiod.selected);
}
},
{
@@ -5783,7 +5583,7 @@
icon: 'images/arrowrightdouble.png',
width: 22,
handler: function() {
- TR.util.multiselect.selectAll(TR.cmp.params.fixedperiod.available, TR.cmp.params.fixedperiod.selected,'filterPropPanel');
+ TR.util.multiselect.selectAll(TR.cmp.params.fixedperiod.available, TR.cmp.params.fixedperiod.selected);
}
},
' '
@@ -6038,7 +5838,7 @@
this.getSelectionModel().select(this.recordsToSelect);
TR.state.orgunitIds = [];
for( var i in this.recordsToSelect){
- TR.state.orgunitIds.push( this.recordsToSelect[i].data.localid );
+ TR.state.orgunitIds.push( this.recordsToSelect[i].data.id );
}
this.recordsToSelect = [];
this.numberOfRecords = 0;
@@ -6135,7 +5935,7 @@
TR.state.orgunitIds = [];
var selectedNodes = TR.cmp.params.organisationunit.treepanel.getSelectionModel().getSelection();
for( var i=0; i<selectedNodes.length; i++ ){
- TR.state.orgunitIds.push( selectedNodes[i].data.localid);
+ TR.state.orgunitIds.push( selectedNodes[i].data.id);
}
},
itemcontextmenu: function(v, r, h, i, e) {
@@ -6160,7 +5960,7 @@
TR.state.orgunitIds = [];
for( var i in r.childNodes){
- TR.state.orgunitIds.push( r.childNodes[i].data.localid );
+ TR.state.orgunitIds.push( r.childNodes[i].data.id );
}
});
}
@@ -6186,192 +5986,6 @@
}
},
- // IDENTIFIER TYPE AND PATIENT-ATTRIBUTE
- {
- title: '<div style="height:17px;background-image:url(images/data.png); background-repeat:no-repeat; padding-left:20px">' + TR.i18n.identifiers_and_attributes + '</div>',
- id:'patientPropertiesDiv',
- hideCollapseTool: true,
- items: [
- {
- xtype: 'panel',
- layout: 'column',
- bodyStyle: 'border-style:none',
- items: [
- {
- xtype: 'multiselect',
- id: 'availablePatientProperties',
- name: 'availablePatientProperties',
- cls: 'tr-toolbar-multiselect-left',
- width: (TR.conf.layout.west_fieldset_width - TR.conf.layout.west_width_subtractor) / 2,
- height: TR.conf.layout.west_properties_multiselect,
- displayField: 'name',
- valueField: 'id',
- queryMode: 'local',
- store: TR.store.patientProperty.available,
- tbar: [
- {
- xtype: 'label',
- text: TR.i18n.available,
- cls: 'tr-toolbar-multiselect-left-label'
- },
- '->',
- {
- xtype: 'button',
- icon: 'images/arrowright.png',
- width: 22,
- handler: function() {
- TR.util.multiselect.select(TR.cmp.params.patientProperty.available, TR.cmp.params.patientProperty.selected,'filterPropPanel');
- }
- },
- {
- xtype: 'button',
- icon: 'images/arrowrightdouble.png',
- width: 22,
- handler: function() {
- TR.util.multiselect.selectAll(TR.cmp.params.patientProperty.available, TR.cmp.params.patientProperty.selected,'filterPropPanel');
- }
- },
- ' '
- ],
- listeners: {
- added: function() {
- TR.cmp.params.patientProperty.available = this;
- },
- afterrender: function() {
- this.boundList.on('itemdblclick', function() {
- TR.util.multiselect.select(this, TR.cmp.params.patientProperty.selected,'filterPropPanel');
- }, this);
- }
- }
- },
- {
- xtype: 'multiselect',
- id: 'selectedPatientProperties',
- name: 'selectedPatientProperties',
- cls: 'tr-toolbar-multiselect-right',
- width: (TR.conf.layout.west_fieldset_width - TR.conf.layout.west_width_subtractor) / 2,
- height: TR.conf.layout.west_properties_multiselect,
- displayField: 'name',
- valueField: 'id',
- ddReorder: true,
- queryMode: 'local',
- store: TR.store.patientProperty.selected,
- tbar: [
- ' ',
- {
- xtype: 'button',
- icon: 'images/arrowleftdouble.png',
- width: 22,
- handler: function() {
- TR.util.multiselect.unselectAll(TR.cmp.params.patientProperty.available, TR.cmp.params.patientProperty.selected,'filterPropPanel');
- }
- },
- {
- xtype: 'button',
- icon: 'images/arrowleft.png',
- width: 22,
- handler: function() {
- TR.util.multiselect.unselect(TR.cmp.params.patientProperty.available, TR.cmp.params.patientProperty.selected,'filterPropPanel');
- }
- },
- '->',
- {
- xtype: 'label',
- text: TR.i18n.selected,
- cls: 'tr-toolbar-multiselect-right-label'
- }
- ],
- listeners: {
- added: function() {
- TR.cmp.params.patientProperty.selected = this;
- },
- afterrender: function() {
- this.boundList.on('itemdblclick', function() {
- TR.util.multiselect.unselect(TR.cmp.params.patientProperty.available, this,'filterPropPanel');
- }, this);
- }
- }
- },
- {
- xtype: 'toolbar',
- width: (TR.conf.layout.west_fieldset_width - TR.conf.layout.west_width_subtractor),
- cls: 'tr-toolbar-multiselect-left',
- style: 'margin-top:10px;',
- items: [
- {
- xtype: 'label',
- text: TR.i18n.filter_values,
- cls: 'tr-toolbar-multiselect-left-label'
- },
- '->',
- {
- xtype: 'button',
- icon: 'images/arrowup.png',
- tooltip: TR.i18n.show_hide_filter_values,
- up: true,
- width: 22,
- handler: function() {
- if(this.up==true){
- Ext.getCmp('availablePatientProperties').setVisible(false);
- Ext.getCmp('selectedPatientProperties').setVisible(false);
- if(Ext.getCmp('reportTypeGroup').getValue().reportType=='true'){
- Ext.getCmp('filterPropPanel').setHeight(TR.conf.layout.west_properties_expand_filter_panel);
- }
- else{
- Ext.getCmp('filterPropPanel').setHeight(TR.conf.layout.west_properties_collapse_filter_panel);
- }
- this.setIcon('images/arrowdown.png');
- this.up = false;
- }
- else{
- Ext.getCmp('availablePatientProperties').setVisible(true);
- Ext.getCmp('selectedPatientProperties').setVisible(true);
- if(Ext.getCmp('reportTypeGroup').getValue().reportType=='true'){
- Ext.getCmp('filterPropPanel').setHeight(TR.conf.layout.west_properties_collapse_filter_panel);
- }
- else{
- Ext.getCmp('filterPropPanel').setHeight(TR.conf.layout.west_properties_expand_filter_panel);
- }
- this.setIcon('images/arrowup.png');
- this.up = true;
- }
- }
- }
- ]
- },
- {
- xtype: 'panel',
- layout: 'column',
- id: 'filterPropPanel',
- height: TR.conf.layout.west_properties_filter_panel,
- bodyStyle: 'background-color:transparent; padding:10px 10px 0px 3px',
- autoScroll: true,
- overflowX: 'hidden',
- overflowY: 'auto',
- width: (TR.conf.layout.west_fieldset_width - TR.conf.layout.west_width_subtractor) ,
- items: []
- }
- ]
- }
-
- ],
- listeners: {
- added: function() {
- TR.cmp.params.patientProperty.panel = this;
- },
- expand: function() {
- var programId = TR.cmp.settings.program.getValue();
- if( programId != null )
- {
- var programType = TR.cmp.settings.program.displayTplData[0].type;
- if (programId != null && !TR.store.patientProperty.available.isloaded && programType !='3') {
- TR.store.patientProperty.available.load({params: {programId: programId}});
- }
- }
- }
- }
- },
-
// DATA ELEMENTS
{
title: '<div id="dataElementTabTitle" style="height:17px;background-image:url(images/data.png); background-repeat:no-repeat; padding-left:20px;">' + TR.i18n.data_filter + '</div>',
@@ -6934,11 +6548,8 @@
TR.cmp.layoutWindow.window = TR.app.LayoutWindow();
TR.cmp.layoutWindow.window.hide();
- Ext.getCmp('patientPropertiesDiv').setVisible(TR.init.system.accessPatientAttributes);
Ext.getCmp('reportTypeGroup').setValue(true);
Ext.getCmp('limitOption').setVisible(false);
- dataElementTabTitle.innerHTML = TR.i18n.data_elements;
- Ext.getCmp('limitOption').setVisible(false);
Ext.getCmp('dataElementGroupByCbx').setVisible(false);
Ext.getCmp('deSumCbx').setVisible(false);
Ext.getCmp('aggregateType').setVisible(false);
@@ -6957,7 +6568,7 @@
TR.state.orgunitIds = [];
for( var i in TR.init.system.rootnodes){
- TR.state.orgunitIds.push( TR.init.system.rootnodes[i].localid );
+ TR.state.orgunitIds.push( TR.init.system.rootnodes[i].id );
}
if( TR.init.report.id != "")
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/defaultDataEntryForm.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/defaultDataEntryForm.vm 2013-08-28 08:14:59 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/defaultDataEntryForm.vm 2013-08-29 09:34:09 +0000
@@ -64,7 +64,7 @@
#end
</script>
#elseif($hasOptionSet=='true')
- <input name="entryfield" data-optionset-uid="$programStageDataElement.dataElement.optionSet.uid" options='$hasOptionSet' data="{compulsory: $programStageDataElement.compulsory, deName:'$programStageDataElement.dataElement.name', deType:'$programStageDataElement.dataElement.getDetailedNumberType()' }" id="$id" type="text" value="$!encoder.htmlEncode( $patientDataValue.value )" onkeypress="return keyPress(event, this)" tabindex="$tabIndex" class="auto-field optionset" />
+ <input name="entryfield" options='$hasOptionSet' data="{compulsory: $programStageDataElement.compulsory, deName:'$programStageDataElement.dataElement.name', deType:'$programStageDataElement.dataElement.getDetailedNumberType()' }" id="$id" type="text" value="$!encoder.htmlEncode( $patientDataValue.value )" onkeypress="return keyPress(event, this)" tabindex="$tabIndex" class="auto-field optionset" />
#elseif($programStageDataElement.dataElement.type=='username')
<input name="entryfield" username='true' class="auto-field optionset" data="{compulsory: $programStageDataElement.compulsory, deName:'$programStageDataElement.dataElement.name', deType:'$programStageDataElement.dataElement.getDetailedNumberType()' }" id="$id" type="text" value="$!encoder.htmlEncode( $patientDataValue.value )" onkeypress="return keyPress(event, this)" tabindex="$tabIndex" />
#else
=== 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 2013-08-28 08:14:59 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/entry.js 2013-08-29 09:34:09 +0000
@@ -997,14 +997,13 @@
{
var input = jQuery( "#" + idField );
input.parent().width( input.width() + 50 );
- var dataElementUid = input.attr('id').split('-')[1];
- var optionSetUid = input.data('optionset-uid');
-
+ var dataElementUid = input.attr('id').split('-')[1];
+
input.autocomplete({
delay: 0,
minLength: 0,
source: function( request, response ){
- searchOptionSet( optionSetUid, input.val(), response );
+ searchOptionSet( dataElementUid, input.val(), response );
},
minLength: 0,
select: function( event, ui ) {
@@ -1016,15 +1015,12 @@
}
input.val( fieldValue );
-
if ( !unSave ) {
saveVal( dataElementUid );
}
input.autocomplete( "close" );
},
change: function( event, ui ) {
- console.log(ui.item);
-
if ( !ui.item ) {
var matcher = new RegExp( "^" + $.ui.autocomplete.escapeRegex( $(this).val() ) + "$", "i" ),
valid = false;
=== removed file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonPatientProperties.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonPatientProperties.vm 2013-05-06 06:38:48 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonPatientProperties.vm 1970-01-01 00:00:00 +0000
@@ -1,66 +0,0 @@
-{ "patientProperties": [
-
- #if( $auth.hasAccess( "dhis-web-caseentry", "accessPatientAttributes" ) )
-
- {
- "id": "fixedAttr_firstName",
- "name": "$i18n.getString('first_name')",
- "valueType": "string"
- },
- {
- "id": "fixedAttr_middleName",
- "name": "$i18n.getString('middle_name')",
- "valueType": "string"
- },
- {
- "id": "fixedAttr_lastName",
- "name": "$i18n.getString('last_name')",
- "valueType": "string"
- },
- {
- "id": "fixedAttr_gender",
- "name": "$i18n.getString('gender')",
- "valueType": "list"
- },
- {
- "id": "fixedAttr_birthDate",
- "name": "$i18n.getString('date_of_birth')",
- "valueType": "date"
- },
- {
- "id": "fixedAttr_dobType",
- "name": "$i18n.getString('dob_type')",
- "valueType": "list"
- },
- {
- "id": "fixedAttr_phoneNumber",
- "name": "$i18n.getString('phone_number')",
- "valueType": "string"
- },
- {
- "id": "fixedAttr_deathdate",
- "name": "$i18n.getString('death_date')",
- "valueType": "date"
- },
- #foreach( ${identifierType} in $!{identifierTypes} )
- {
- "id": "iden_${identifierType.id}",
- "name": "$!encoder.jsonEncode( ${identifierType.displayName} )",
- "valueType": "$identifierType.type"
- },
- #end
- #set( $size = $!{patientAttributes.size()} )
- #foreach( $patientAttribute in $!{patientAttributes} )
- {
- "id": "attr_${patientAttribute.id}",
- "name": "$!encoder.jsonEncode( ${patientAttribute.displayName} )",
- "valueType": #if( $patientAttribute.valueType == 'combo')
- "list"
- #else
- "${patientAttribute.valueType}"
- #end
- }#if( $velocityCount < $size ),#end
- #end
- #end
- ]
-}
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonTabularInitialize.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonTabularInitialize.vm 2013-08-28 06:43:27 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonTabularInitialize.vm 2013-08-29 09:34:09 +0000
@@ -4,7 +4,6 @@
{
"id":"$!currentUser.id",
"name":"$!currentUser.name",
- "accessPatientAttributes":$auth.hasAccess( "dhis-web-caseentry", "accessPatientAttributes" ),
"isAdmin":$!currentUser.userCredentials.isSuper(),
"ous":[
#foreach( $orgunit in $currentUser.organisationUnits )
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonTabularReport.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonTabularReport.vm 2013-08-28 06:43:27 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonTabularReport.vm 2013-08-29 09:34:09 +0000
@@ -2,9 +2,9 @@
"id": "${tabularReport.id}",
"name": "$!encoder.jsonEncode( ${tabularReport.name} )",
"lastUpdated": "$!format.formatDate( ${tabularReport.lastUpdated} )",
- "programUid": "${programStage.program.uid}",
+ "programId": "${programStage.program.uid}",
"singleEvent":
- #if($programStage.program.programStages.size() == 1 )
+ #if($tabularReport.program.programStages.size() == 1 )
"true",
#else
"false",
@@ -14,15 +14,13 @@
#end
"type": "${programStage.program.type}",
- "programStageId": "${programStage.id}",
- "programStageUid": "${programStage.uid}",
- "programStageName": "$!encoder.jsonEncode( ${programStage.displayName} )",
+ "programStageId": "$!{tabularReport.programStage.uid}",
"programStages": [
- #set( $programStages = $programStage.program.programStages )
+ #set( $programStages = $tabularReport.program.programStages )
#set( $size = $programStages.size() )
#foreach( ${programStage} in $!{programStages} )
{
- "id": "$programStage.id",
+ "id": "$programStage.uid",
"name": "$programStage.name"
}
#if( $velocityCount < $size ),#end
@@ -30,14 +28,10 @@
],
"startDate": "$!format.formatDate( $tabularReport.startDate )",
"endDate": "$!format.formatDate( ${tabularReport.endDate} )",
+ "asc": "${tabularReport.sortByAsc}",
+ "desc": "${tabularReport.sortByDesc}",
"level": "${tabularReport.level}",
- "sortedOrgunitAsc": "${tabularReport.sortedOrgunitAsc}",
"facilityLB": "${tabularReport.facilityLB}",
- "displayOrgunitCode": "$!tabularReport.displayOrgunitCode",
- "useFormNameDataElement": "$!tabularReport.useFormNameDataElement",
- "useCompletedEvents": "$!tabularReport.useCompletedEvents",
- "userOrganisationUnit": "$!tabularReport.userOrganisationUnit",
- "userOrganisationUnitChildren": "$!tabularReport.userOrganisationUnitChildren",
"orgunitIds": [
#set( $size = $tabularReport.organisationUnits.size() )
#set( $organisationUnits = ${tabularReport.organisationUnits} )
@@ -50,59 +44,21 @@
#if( $velocityCount < $size ),#end
#end
],
- "patientProperties": [
- #set($idx=0)
- #foreach( ${fixedAttribute} in $!{selectedFixedAttributes} )
- {
- #set( $attr = $i18n.getString($fixedAttribute) )
- "id": "fixedAttr_${fixedAttribute}",
- "name": "$attr",
- "filter": "$fixedAttributeFilters.get($idx)"
- },
- #set($idx=$idx+1)
- #end
-
- #set($idx=0)
- #set( $size = ${selectedIdentifierTypes.size()} )
- #foreach( ${identifier} in $!{selectedIdentifierTypes} )
- {
- "id": "iden_${identifier.id}",
- "name": "${identifier.displayName}",
- "filter": "$identifierTypeFilters.get($idx)"
- }#if( $velocityCount < $size ),#end
- #set($idx=$idx+1)
- #end
-
- #set($idx=0)
- #set( $size = ${selectedAttributes.size()} )
- #foreach( ${attribute} in $!{selectedAttributes} )
- {
- "id": "attr_${attribute.id}",
- "name": "${attribute.displayName}",
- "filter": "$patientAttributeFilters.get($idx)"
- }
- #if( $velocityCount < $size ),#end
- #set($idx=$idx+1)
- #end
- ],
- "dataElements": [
- #set($idx=0)
- #set( $size = ${selectedDataElements.size()} )
- #foreach( ${dataElement} in $!{selectedDataElements} )
- {
- "id": "de_${dataElement.id}",
- "name": "${dataElement.name}",
- "uid": "${dataElement.uid}",
+ "items": [
+ #set( $size = $tabularReport.items.size() )
+ #foreach( $item in $!{tabularReport.items} )
+ {
+ "id": "$item",
+ "name": "",
"compulsory": "",
- "valueType": #if( $dataElement.optionSet )
+ "valueType": #if( $!dataElement.optionSet )
"list"
#else
- "${dataElement.type}"
- #end,
- "filter": "$dataelementFilters.get($idx)"
+ "${!dataElement.type}"
+ #end
}
#if( $velocityCount < $size ),#end
- #set($idx=$idx+1)
#end
+
]
}
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonTabularReportList.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonTabularReportList.vm 2013-08-27 06:15:02 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonTabularReportList.vm 2013-08-29 09:34:09 +0000
@@ -2,8 +2,8 @@
{ "tabularReports": [
#foreach( ${tabularReport} in $!{reports} )
{
- "id": "${tabularReport.id}",
- "uid": "${tabularReport.uid}",
+ "id": "${tabularReport.uid}",
+ "localid": "${tabularReport.id}",
"name": "$!encoder.jsonEncode( ${tabularReport.name} )",
"lastUpdated": "${tabularReport.lastUpdated}",
"access":
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/responseDataElements.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/responseDataElements.vm 2013-08-28 06:43:27 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/responseDataElements.vm 2013-08-29 09:34:09 +0000
@@ -1,17 +1,80 @@
-#set( $size = $psDataElements.size() )
-{ "dataElements": [
-#foreach( $psDataElement in $psDataElements )
- {
- "id": "$psDataElement.dataElement.uid",
- "localid": "de_$!{psDataElement.dataElement.id}",
- "name": "$encoder.xmlEncode(${psDataElement.dataElement.getFormNameFallback()} )",
- "compulsory": "${psDataElement.compulsory}",
- "displayInReports": "$psDataElement.displayInReports",
- "valueType": #if( $psDataElement.dataElement.optionSet )
+{ "items": [
+
+ #if( $auth.hasAccess( "dhis-web-caseentry", "accessPatientAttributes" ) )
+
+ {
+ "id": "fixedAttr_firstName",
+ "name": "$i18n.getString('first_name')",
+ "valueType": "string"
+ },
+ {
+ "id": "fixedAttr_middleName",
+ "name": "$i18n.getString('middle_name')",
+ "valueType": "string"
+ },
+ {
+ "id": "fixedAttr_lastName",
+ "name": "$i18n.getString('last_name')",
+ "valueType": "string"
+ },
+ {
+ "id": "fixedAttr_gender",
+ "name": "$i18n.getString('gender')",
+ "valueType": "list"
+ },
+ {
+ "id": "fixedAttr_birthDate",
+ "name": "$i18n.getString('date_of_birth')",
+ "valueType": "date"
+ },
+ {
+ "id": "fixedAttr_dobType",
+ "name": "$i18n.getString('dob_type')",
+ "valueType": "list"
+ },
+ {
+ "id": "fixedAttr_phoneNumber",
+ "name": "$i18n.getString('phone_number')",
+ "valueType": "string"
+ },
+ {
+ "id": "fixedAttr_deathdate",
+ "name": "$i18n.getString('death_date')",
+ "valueType": "date"
+ }
+ #foreach( ${identifierType} in $!{identifierTypes} )
+ ,{
+ "id": "iden_${identifierType.id}",
+ "name": "$!encoder.jsonEncode( ${identifierType.displayName} )",
+ "valueType": "$identifierType.type"
+ }
+ #end
+ #foreach( $patientAttribute in $!{patientAttributes} )
+ ,{
+ "id": "attr_${patientAttribute.id}",
+ "name": "$!encoder.jsonEncode( ${patientAttribute.displayName} )",
+ "valueType": #if( $patientAttribute.valueType == 'combo')
"list"
#else
- "${psDataElement.dataElement.type}"
+ "${patientAttribute.valueType}"
#end
- }#if( $velocityCount < $size ),#end
- #end]
-}
+ }
+ #end
+
+ #end
+
+
+ #foreach( $psDataElement in $psDataElements )
+ ,{
+ "id": "$psDataElement.dataElement.uid",
+ "name": "$encoder.xmlEncode(${psDataElement.dataElement.getFormNameFallback()} )",
+ "valueType": #if( $psDataElement.dataElement.optionSet )
+ "list"
+ #else
+ "${psDataElement.dataElement.type}"
+ #end
+ }
+ #end
+
+ ]
+}
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/sectionDataEntryForm.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/sectionDataEntryForm.vm 2013-08-28 08:14:59 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/sectionDataEntryForm.vm 2013-08-29 09:34:09 +0000
@@ -76,7 +76,7 @@
#end
</script>
#elseif($hasOptionSet=='true')
- <input name="entryfield" data-optionset-uid="$programStageDataElement.dataElement.optionSet.uid" options='$hasOptionSet' class="auto-field optionset" #if($hasOptionSet == 'true') #end data="{compulsory: $programStageDataElement.compulsory, deName:'$programStageDataElement.dataElement.name', deType:'$programStageDataElement.dataElement.getDetailedNumberType()' }" id="$id" type="text" value="$!encoder.htmlEncode( $patientDataValue.value )" onkeypress="return keyPress(event, this)" tabindex="$tabIndex" />
+ <input name="entryfield" options='$hasOptionSet' class="auto-field optionset" #if($hasOptionSet == 'true') #end data="{compulsory: $programStageDataElement.compulsory, deName:'$programStageDataElement.dataElement.name', deType:'$programStageDataElement.dataElement.getDetailedNumberType()' }" id="$id" type="text" value="$!encoder.htmlEncode( $patientDataValue.value )" onkeypress="return keyPress(event, this)" tabindex="$tabIndex" />
#elseif($programStageDataElement.dataElement.type=='username')
<input name="entryfield" username='true' class="auto-field optionset" data="{compulsory: $programStageDataElement.compulsory, deName:'$programStageDataElement.dataElement.name', deType:'$programStageDataElement.dataElement.getDetailedNumberType()' }" id="$id" type="text" value="$!encoder.htmlEncode( $patientDataValue.value )" onkeypress="return keyPress(event, this)" tabindex="$tabIndex" />
#else