dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #28030
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 13969: Remove system-identifier from trackedentity.
------------------------------------------------------------
revno: 13969
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2014-02-10 12:42:16 +0700
message:
Remove system-identifier from trackedentity.
modified:
dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/ProgramTrackedEntityAttribute.hbm.xml
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/GetTrackedEntityInstanceLocationAction.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/SaveAttributeAction.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/underage.js
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/trackedentity/action/program/ShowUpdateProgramFormAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/trackedentity/i18n_module.properties
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/index.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/menu.vm
resources/sql/rename-patient-to-trackedentity-in-database.sql
--
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-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/ProgramTrackedEntityAttribute.hbm.xml'
--- dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/ProgramTrackedEntityAttribute.hbm.xml 2014-02-07 20:25:49 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/ProgramTrackedEntityAttribute.hbm.xml 2014-02-10 05:42:16 +0000
@@ -6,7 +6,7 @@
<hibernate-mapping>
<class name="org.hisp.dhis.program.ProgramTrackedEntityAttribute" table="program_attributes">
- <id name="id" column="programattributeid">
+ <id name="id" column="programtrackedentityattributeid">
<generator class="native" />
</id>
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/GetTrackedEntityInstanceLocationAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/GetTrackedEntityInstanceLocationAction.java 2014-02-07 20:25:49 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/GetTrackedEntityInstanceLocationAction.java 2014-02-10 05:42:16 +0000
@@ -76,13 +76,6 @@
return entityInstanceId;
}
- private String systemIdentifier;
-
- public String getSystemIdentifier()
- {
- return systemIdentifier;
- }
-
private TrackedEntityInstance entityInstance;
public TrackedEntityInstance getEntityInstance()
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/SaveAttributeAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/SaveAttributeAction.java 2014-02-07 20:25:49 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/trackedentity/SaveAttributeAction.java 2014-02-10 05:42:16 +0000
@@ -177,16 +177,14 @@
if ( attributes != null && attributes.size() > 0 )
{
- // entityInstance.getAttributes().clear();
-
for ( TrackedEntityAttribute attribute : attributes )
{
value = request.getParameter( AddTrackedEntityInstanceAction.PREFIX_ATTRIBUTE + attribute.getId() );
-
+
+ attributeValue = attributeValueService.getTrackedEntityAttributeValue( entityInstance, attribute );
+
if ( StringUtils.isNotBlank( value ) )
{
- attributeValue = attributeValueService.getTrackedEntityAttributeValue( entityInstance, attribute );
-
if ( attributeValue == null )
{
attributeValue = new TrackedEntityAttributeValue();
@@ -196,7 +194,8 @@
if ( attribute.getValueType().equals( TrackedEntityAttribute.TYPE_AGE ) )
{
- value = format.formatDate( TrackedEntityAttribute.getDateFromAge( Integer.parseInt( value ) ) );
+ value = format
+ .formatDate( TrackedEntityAttribute.getDateFromAge( Integer.parseInt( value ) ) );
}
if ( TrackedEntityAttribute.TYPE_COMBO.equalsIgnoreCase( attribute.getValueType() ) )
@@ -217,8 +216,8 @@
{
if ( TrackedEntityAttribute.TYPE_COMBO.equalsIgnoreCase( attribute.getValueType() ) )
{
- TrackedEntityAttributeOption option = attributeOptionService.get( NumberUtils.toInt(
- value, 0 ) );
+ TrackedEntityAttributeOption option = attributeOptionService.get( NumberUtils.toInt( value,
+ 0 ) );
if ( option != null )
{
attributeValue.setAttributeOption( option );
@@ -235,6 +234,7 @@
}
else if ( attributeValue != null )
{
+ entityInstance.getAttributeValues().remove( attributeValue );
attributeValueService.deleteTrackedEntityAttributeValue( attributeValue );
}
}
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/underage.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/underage.js 2014-02-07 20:25:49 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/underage.js 2014-02-10 05:42:16 +0000
@@ -101,17 +101,6 @@
$( entityInstances ).each( function( i, entityInstance )
{
sEntityInstance += "<hr style='margin:5px 0px;'><table>";
- sEntityInstance += "<tr><td class='bold'>" + i18n_tracked_entity_instance_system_id + "</td><td>" + $( entityInstance ).find('systemIdentifier').text() + "</td></tr>" ;
-
- var identifiers = $( entityInstance ).find('identifier');
- $( identifiers ).each( function( i, identifier )
- {
- sEntityInstance +="<tr class='identifierRow" + $(identifier).find('id').text() + "' id='iden" + $(identifier).find('id' ).text() + "'>"
- +"<td class='bold'>" + $(identifier).find('name').text() + "</td>"
- +"<td class='value'>" + $(identifier).find('value').text() + "</td> "
- +"</tr>";
- });
-
var attributes = $( entityInstance ).find('attribute');
$( attributes ).each( function( i, attribute )
{
@@ -120,10 +109,8 @@
+ "<td>" + $(attribute).find('value').text() + "</td> "
+ "</tr>";
});
-
sEntityInstance += "<tr><td colspan='2'><input type='button' id='" + $(entityInstance).find('id' ).first().text() +"' value='" + i18n_choose_this_tracked_entity_instance + "' onclick='choosePerson(this)'/></td></tr>";
sEntityInstance += "</table>";
-
container.append(i18n_duplicate_warning + "<br>" + sEntityInstance);
} );
}
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/trackedentity/action/program/ShowUpdateProgramFormAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/trackedentity/action/program/ShowUpdateProgramFormAction.java 2014-02-07 20:25:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/trackedentity/action/program/ShowUpdateProgramFormAction.java 2014-02-10 05:42:16 +0000
@@ -38,6 +38,7 @@
import org.hisp.dhis.organisationunit.OrganisationUnitLevel;
import org.hisp.dhis.program.Program;
import org.hisp.dhis.program.ProgramService;
+import org.hisp.dhis.program.ProgramTrackedEntityAttribute;
import org.hisp.dhis.relationship.RelationshipType;
import org.hisp.dhis.relationship.RelationshipTypeService;
import org.hisp.dhis.trackedentity.TrackedEntityAttribute;
@@ -85,7 +86,7 @@
{
this.relationshipTypeService = relationshipTypeService;
}
-
+
// -------------------------------------------------------------------------
// Input/Output
// -------------------------------------------------------------------------
@@ -183,9 +184,12 @@
throws Exception
{
program = programService.getProgram( id );
-
+
availableAttributes = attributeService.getAllTrackedEntityAttributes();
- availableAttributes.removeAll( program.getAttributes() );
+ for ( ProgramTrackedEntityAttribute programAttribue : program.getAttributes() )
+ {
+ availableAttributes.remove( programAttribue.getAttribute() );
+ }
programs = new ArrayList<Program>( programService.getAllPrograms() );
programs.removeAll( programService.getPrograms( Program.SINGLE_EVENT_WITHOUT_REGISTRATION ) );
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/trackedentity/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/trackedentity/i18n_module.properties 2014-02-09 02:56:41 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/trackedentity/i18n_module.properties 2014-02-10 05:42:16 +0000
@@ -391,7 +391,7 @@
view_all = View all
tracked_entity_attribute_visit_schedule = Attribute Visit Schedule
tracked_entity_attribute_visit_schedule_form = Tracked entity attribute visit schedule
-intro_attribute_visit_schedule = Configure which tracked entity attributes are added to the visit schedule. Gives better overview when used for tracking.
+intro_tracked_entity_attribute_visit_schedule = Configure which tracked entity attributes are added to the visit schedule. Gives better overview when used for tracking.
selected_program_stages = Selected program stages
tracked_entity = Tracked entity
orgunit_registered = Organisation unit phone number
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/index.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/index.vm 2014-02-07 20:25:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/index.vm 2014-02-10 05:42:16 +0000
@@ -3,9 +3,9 @@
<ul class="introList">
#introListImgItem( "attribute.action" "attribute" "patient" )
#introListImgItem( "attributeVisitSchedule.action" "attribute_visit_schedule" "patient" )
- #introListImgItem( "attributeGroup.action" "attribute_group" "patient" )
+ #introListImgItem( "attributeGroup.action" "tracked_entity_attribute_group" "patient" )
#introListImgItem( "relationshipType.action" "relationship_type" "patient" )
- #introListImgItem( "trackedEntityForm.action" "registration_form" "pivottable" )
+ #introListImgItem( "trackedEntityForm.action" "tracked_entity_form" "pivottable" )
#introListImgItem( "program.action" "program" "program" )
#introListImgItem( "caseAggregation.action" "aggregation_query_builder" "caseaggregationmapping" )
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/menu.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/menu.vm 2014-02-07 20:25:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/menu.vm 2014-02-10 05:42:16 +0000
@@ -10,7 +10,7 @@
<h2>$i18n.getString( "programs" )</h2>
<ul>
<li><a href="program.action">$i18n.getString( "program" )</a></li>
- <li><a href="caseAggregation.action">$i18n.getString( "tracked_entity_aggregation_query_builder" )</a></li>
+ <li><a href="caseAggregation.action">$i18n.getString( "aggregation_query_builder" )</a></li>
</ul>
#if( $auth.hasAccess( "dhis-web-maintenance-patient", "viewScheduleTasks" ) || $auth.hasAccess( "dhis-web-maintenance-patient", "viewScheduledCaseAggCondTasks" ) )
=== modified file 'resources/sql/rename-patient-to-trackedentity-in-database.sql'
--- resources/sql/rename-patient-to-trackedentity-in-database.sql 2014-02-09 02:56:41 +0000
+++ resources/sql/rename-patient-to-trackedentity-in-database.sql 2014-02-10 05:42:16 +0000
@@ -142,9 +142,8 @@
ALTER TABLE dashboarditem_trackedentitytabularreports RENAME CONSTRAINT fk_dashboarditem_patienttabularreports_dashboardid TO fk_dashboarditem_tabularreports_dashboardid;
-
+ALTER TABLE program_attributes RENAME COLUMN programattributeid TO programtrackedentityattributeid;
ALTER TABLE program_attributes RENAME COLUMN attributeid TO trackedentityattributeid;
-ALTER TABLE program_attributes RENAME COLUMN patientattributeid TO trackedentityattributeid;
ALTER TABLE programinstance RENAME COLUMN patientcommentid TO trackedentitycommentid;
@@ -158,11 +157,13 @@
ALTER TABLE trackedentityattribute RENAME COLUMN patientmobilesettingid TO trackedentitymobilesettingid;
ALTER TABLE trackedentityattribute RENAME COLUMN sort_order_patientattributename TO sort_order_trackedentityattributename;
-
-ALTER TABLE patientaggregatereportmembers RENAME COLUMN patientaggregatereportid TO trackedentityaggregatereportid;
+ALTER TABLE patientaggregatereportmembers RENAME TO trackedentityaggregatereportmembers;
+ALTER TABLE trackedentityaggregatereportmembers RENAME COLUMN patientaggregatereportid TO trackedentityaggregatereportid;
ALTER TABLE trackedentityaudit RENAME COLUMN patientid TO trackedentityinstanceid;
-ALTER TABLE patienttabularreportmembers RENAME COLUMN patienttabularreportid TO trackedentitytabularreportid;
+ALTER TABLE patienttabularreportmembers RENAME TO trackedentitytabularreportmembers;
+ALTER TABLE trackedentitytabularreportmembers RENAME COLUMN patienttabularreportid TO trackedentitytabularreportid;
ALTER TABLE programstageinstance_patients RENAME COLUMN patientid TO trackedentityinstanceid;
ALTER TABLE programinstance RENAME COLUMN patientid TO trackedentityinstanceid;
ALTER TABLE programinstance RENAME COLUMN patientcommentid TO trackedentitycommentid;
+