[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 13159: context-menus in maint-patient module, wip

2013-12-06 Thread noreply

revno: 13159
committer: Morten Olav Hansen 
branch nick: dhis2
timestamp: Fri 2013-12-06 09:54:56 +0100
message:
  context-menus in maint-patient module, wip
modified:
  
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/program.js
  
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/programStage.js
  
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/patientRegistrationForm.vm
  
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programList.vm
  
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/programStage.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-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/program.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/program.js	2013-09-27 17:04:23 +
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/program.js	2013-12-06 08:54:56 +
@@ -1,456 +1,454 @@
+$(function() {
+  dhis2.contextmenu.makeContextMenu({
+menuId: 'contextMenu',
+menuItemActiveClass: 'contextMenuItemActive'
+  });
+});
+
 // -
 // View details
 // -
 
-function showProgramDetails( programId )
-{
-	jQuery.getJSON( "getProgram.action", {
-		id:programId
-	}, function(json){
-		setInnerHTML( 'nameField', json.program.name );
-		setInnerHTML( 'descriptionField', json.program.description );
-		
-		var type = i18n_multiple_events_with_registration;
-		if( json.program.type == "2" )
-			type = i18n_single_event_with_registration;
-		else if( json.program.type == "3"  )
-			type = i18n_single_event_without_registration;
-		setInnerHTML( 'typeField', type ); 
-		
-		var displayIncidentDate = ( json.program.displayIncidentDate == 'true') ? i18n_yes : i18n_no;
-		setInnerHTML( 'displayIncidentDateField', displayIncidentDate );   	
-		
-		var ignoreOverdueEvents = ( json.program.ignoreOverdueEvents == 'true') ? i18n_yes : i18n_no;
-		setInnerHTML( 'ignoreOverdueEventsField', ignoreOverdueEvents );   	
-		
-		var onlyEnrollOnce = ( json.program.onlyEnrollOnce == 'true') ? i18n_yes : i18n_no;
-		setInnerHTML( 'onlyEnrollOnceField', onlyEnrollOnce );   	
-		
-		var displayOnAllOrgunit= ( json.program.displayOnAllOrgunit == 'true') ? i18n_yes : i18n_no;
-		setInnerHTML( 'displayOnAllOrgunitField', displayOnAllOrgunit );   	
-		
-		var useBirthDateAsIncidentDate = ( json.program.useBirthDateAsIncidentDate == 'true') ? i18n_yes : i18n_no;
-		setInnerHTML( 'useBirthDateAsIncidentDateField', useBirthDateAsIncidentDate );   	
-		
-		var useBirthDateAsEnrollmentDate = ( json.program.useBirthDateAsEnrollmentDate == 'true') ? i18n_yes : i18n_no;
-		setInnerHTML( 'useBirthDateAsEnrollmentDateField', useBirthDateAsEnrollmentDate );   	
-		
-		var selectEnrollmentDatesInFuture= ( json.program.selectEnrollmentDatesInFuture == 'true') ? i18n_yes : i18n_no;
-		setInnerHTML( 'selectEnrollmentDatesInFutureField', selectEnrollmentDatesInFuture );   	
-		
-		var selectIncidentDatesInFuture= ( json.program.selectIncidentDatesInFuture == 'true') ? i18n_yes : i18n_no;
-		setInnerHTML( 'selectIncidentDatesInFutureField', selectIncidentDatesInFuture );   	
-		
-		var dataEntryMethod= ( json.program.dataEntryMethod == 'true') ? i18n_yes : i18n_no;
-		setInnerHTML( 'dataEntryMethodField', dataEntryMethod );   	
-		
-		setInnerHTML( 'dateOfEnrollmentDescriptionField', json.program.dateOfEnrollmentDescription );   
-		setInnerHTML( 'dateOfIncidentDescriptionField', json.program.dateOfIncidentDescription );   		
-		setInnerHTML( 'programStageCountField',  json.program.programStageCount );
-		setInnerHTML( 'noAttributesField', json.program.noAttributes );
-		setInnerHTML( 'noIdentifierTypesField', json.program.noIdentifierTypes );
-		
-		showDetails();
-	});   
+function programIndicatorManagementForm( context ) {
+  location.href = 'programIndicator.action?programId=' + context.id;
+}
+
+function showProgramUserRoleForm( context ) {
+  location.href = 'showProgramUserroleForm.action?id=' + context.id;
+}
+
+function showUpdateProgramForm( context ) {
+  location.href = 'showUpdateProgramForm.action?id=' + context.id;
+}
+
+function programStageManagemen

Re: [Dhis2-devs] [Dhis2-users] Homologous periods for indicators

2013-12-06 Thread Rodolfo Melia
Hi - I just want to echo the need of more complex logic for doing
indicators.

The way that we are addressing this at PSI is by creating 'Calculated Data
Elements'. That's basically a Data Element that doesn't have data entry,
and instead we populate it via a SQL procedure that we run every night. A
cron job currently does the job, but we are moving them into PgAgent. Our
current use cases:

1. Copy the previous months 'Closing Balance' into the 'Opening Balance' of
this month
2. Average distribution across the last 3 months (rather than the whole
series)

Another similar need that we currently plan to address via iReports is
giving improvement over time: variation (increase/ decrease)
- Option a: Q2 this year vs Q2 last year
- Option b: This Quarter (Q2 2013) vs Previous Quarter (Q1 2013)

In my mind, a potential implementation is to be able to define time ranges
(default - all periods) when creating the numerator/ denominator of an
indicator.

R

*Rodolfo Meliá*
*Principal*
rme...@knowming.com
www.knowming.com
+1 708 872 7636
+44 777 576 4090
Skype: rod.melia


On Fri, Dec 6, 2013 at 7:55 AM, Ola Hodne Titlestad wrote:

> Would be great if we could somehow combine the logic and calculations of
> the surveillance rules with the analytics tables and make this data
> available in the analysis tools. Sounds like a good approach to try that in
> an app first.
>
> Ola
> --
>
> --
> Ola Hodne Titlestad (Mr)
> HISP
> Department of Informatics
> University of Oslo
>
> Mobile: +47 48069736
> Home address: Eftasåsen 68, 0687 Oslo, Norway. Googlemaps 
> link
>
>
> On 5 December 2013 14:53, Knut Staring  wrote:
>
>> Thanks a lot, Jim.
>>
>> We are in fact already developing a powerful time series app for which
>> this is the main missing thing, however we may have to change to a
>> different javascript graphing library (because of the license).
>>
>> Knut
>>
>>
>> On Thu, Dec 5, 2013 at 12:59 PM, Jim Grace  wrote:
>>
>>> Hi all,
>>>
>>> By all means tell anyone requesting this type of analysis about the new
>>> surveillance-type validation rules. They do exactly this type of analysis,
>>> for example the calculation Knut mentioned, comparing this year's weekly
>>> data with the average of the three previous years (e.g. week 48),
>>> multiplied by 1.5. Surveillance rule features also include:
>>>
>>> - You can average not only just over the same period in a number of
>>> previous years, but over a bounded set of weeks surrounding the week in
>>> question, or a combination of both (e.g. comparing week 48 this year with
>>> the average of weeks 47,48 and 49 in the previous two years, and week 47
>>> this year.)
>>>
>>> - You can throw out a configurable number of high and/or low outliers
>>> from previous data before doing the average, so you're not comparing the
>>> new data data against previous outbreaks and/or unusually low values.
>>>
>>> - You can analyze the data automatically as it comes in from data entry
>>> each day, for any data elements (singly or in a formula) in all
>>> organisation units at whatever levels you like, with customized formulas at
>>> each different organizational unit level (e.g. an alarming district-wide
>>> increase may be a lower percent than what could be random variation at
>>> individual sites.) And be notified automatically through DHIS messaging (by
>>> email if you like) of any outliers.
>>>
>>> If they want the data for display, this would have to be added whether
>>> in the visualizer or a new app. But if they want the data for outbreak
>>> detection, by all means also tell them about the new surveillance rules.
>>>
>>> Cheers,
>>> Jim
>>>
>>>
>>>
>>> On Thu, Dec 5, 2013 at 2:17 AM, Bram Piot  wrote:
>>>
 Hi all,

 Surprisingly, yesterday I had exactly the same request from one of our
 users in Uganda: they'd like to see monthly data for current and past year
 as separate lines on the same chart, very similar to Knut's example. I can
 imagine that this would be rather complex to handle in the visualiser -
 maybe this needs a separate app?

 bram piot



 On 5 December 2013 10:08, Knut Staring  wrote:

> Thanks Ola, it's a good idea to have this also available as part of
> validation rules. However, my immediate need and what organizations 
> dealing
> with seasonal epidemics such as WHO and CDC would like to see are charts
> with two lines:
>
> The trend of cases and deaths for the current year as compared to the
> trend lines for a) the previous year or b) some kind of average for 
> several
> previous years. See the attached example.
>
> Knut
>
>
> On Thursday, December 5, 2013, Ola Hodne Titlestad

[Dhis2-devs] [Bug 1258479] [NEW] sharing error not clearly defined in PT

2013-12-06 Thread Adebusoye Anifalaje
Public bug reported:

I set the sharing properties of a data element so that the  public
cannot see it.

In the pivot table, the data element is visible to the public but they
cannot generate any report. However, instead of a permissions error of
some sort, there is an undefined html browser error (file attached). The
error dialogue window there is an entry stating that "Access to the
specified resource has been forbidden". For the lay user, I don't think
they will get that far.

It would actually be better for the data element to be hidden if users
do not have at a least view permission. Will suggest this in blueprint.

Version: 2.13

Build: 12794

** Affects: dhis2
 Importance: Undecided
 Status: New

** Attachment added: "Sharing Permissions - Error Not clearly defined in 
PT.tiff"
   
https://bugs.launchpad.net/bugs/1258479/+attachment/3924221/+files/Sharing%20Permissions%20-%20Error%20Not%20clearly%20defined%20in%20PT.tiff

-- 
You received this bug notification because you are a member of DHIS 2
developers, which is subscribed to DHIS.
https://bugs.launchpad.net/bugs/1258479

Title:
  sharing error not clearly defined in PT

Status in DHIS 2:
  New

Bug description:
  I set the sharing properties of a data element so that the  public
  cannot see it.

  In the pivot table, the data element is visible to the public but they
  cannot generate any report. However, instead of a permissions error of
  some sort, there is an undefined html browser error (file attached).
  The error dialogue window there is an entry stating that "Access to
  the specified resource has been forbidden". For the lay user, I don't
  think they will get that far.

  It would actually be better for the data element to be hidden if users
  do not have at a least view permission. Will suggest this in
  blueprint.

  Version: 2.13

  Build: 12794

To manage notifications about this bug go to:
https://bugs.launchpad.net/dhis2/+bug/1258479/+subscriptions

___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 13161: minor fix

2013-12-06 Thread noreply

revno: 13161
committer: Morten Olav Hansen 
branch nick: dhis2
timestamp: Fri 2013-12-06 12:34:43 +0100
message:
  minor fix
modified:
  
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/patientRegistrationForm.vm
  
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/validationCriteria.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-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/patientRegistrationForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/patientRegistrationForm.vm	2013-12-06 08:54:56 +
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/patientRegistrationForm.vm	2013-12-06 11:34:43 +
@@ -1,3 +1,9 @@
+
+  .listTable > tbody > tr > td {
+padding: 8px 0 8px 5px;
+  }
+
+
 $i18n.getString( "patient_registration_form_management" ) #openHelp( "person_registration_form" )
 
 

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/validationCriteria.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/validationCriteria.vm	2013-12-06 11:18:39 +
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/validationCriteria.vm	2013-12-06 11:34:43 +
@@ -1,13 +1,5 @@
 $i18n.getString( "validation_criteria_management" ) #openHelp( "validation_criteria" )
 
-
-
 
   
   $i18n.getString( "assign_validation_for_programs" )

___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


[Dhis2-devs] API for pulling Multilingual Labels?

2013-12-06 Thread Rodolfo Melia
Hi - as part of some of the apps that we are coding, as well as 7 complex
custom forms that we are about to build (they will have some JScript for
logic), we will need both (apps and forms) in 3 languages (total 21 forms
if we use the current way of doing things).

Does the current metadata API has a function to retrieve multilingual
values?
What we are looking is the possibility to retrieve the Name, Form Name or
Short Name of a DataElement, Category or Option Set  in the current-user
language by passing the UID or Code.

If this functionality doesn't exist at the moment:
- Should it be added to the metadata api?
- Should it be part of the Categories/ Data Elements/ api?

PSI will be happy to contribute on the development of this under your
guidance.

Rodolfo
___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 13162: context-menus for report module

2013-12-06 Thread noreply

revno: 13162
committer: Morten Olav Hansen 
branch nick: dhis2
timestamp: Fri 2013-12-06 14:03:52 +0100
message:
  context-menus for report module
modified:
  
dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/document.js
  
dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/report.js
  
dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/table.js
  
dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewDocumentForm.vm
  
dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewReportForm.vm
  
dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewTableForm.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-reporting/src/main/webapp/dhis-web-reporting/javascript/document.js'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/document.js	2013-07-24 17:28:39 +
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/document.js	2013-12-06 13:03:52 +
@@ -1,26 +1,36 @@
-function removeDocument( id )
-{
-removeItem( id, "", i18n_confirm_remove_report, "removeDocument.action" );
+
+function removeDocument( context ) {
+  removeItem(context.id, context.name, i18n_confirm_remove_report, "removeDocument.action");
 }
 
-function toggleExternal()
-{
-var external = getListValue( "external" );
+function toggleExternal() {
+  var external = getListValue("external");
 
-if ( external == "true" )
-{
-document.getElementById( "fileDiv" ).style.display = "none";
-document.getElementById( "urlDiv" ).style.display = "block";
-$( '#url' ).attr( 'class', '{validate:{required:true}}' );
-$( '#upload' ).attr( 'class', '' );
-} else
-{
-document.getElementById( "fileDiv" ).style.display = "block";
-document.getElementById( "urlDiv" ).style.display = "none";
-if ( byId( 'id' ).value == "" )
-{
-$( '#upload' ).attr( 'class', '{validate:{required:true}}' );
-$( '#url' ).attr( 'class', '' );
-}
+  if( external == "true" ) {
+document.getElementById("fileDiv").style.display = "none";
+document.getElementById("urlDiv").style.display = "block";
+$('#url').attr('class', '{validate:{required:true}}');
+$('#upload').attr('class', '');
+  } else {
+document.getElementById("fileDiv").style.display = "block";
+document.getElementById("urlDiv").style.display = "none";
+if( byId('id').value == "" ) {
+  $('#upload').attr('class', '{validate:{required:true}}');
+  $('#url').attr('class', '');
 }
+  }
+}
+
+function displayAddDocumentForm( context ) {
+  location.href = 'displayAddDocumentForm.action?id=' + context.id;
+}
+
+function runDocument( context ) {
+  console.log(context);
+
+  if( context.external ) {
+location.href = context.url;
+  } else {
+location.href = '../api/documents/' + context.uid + '/data';
+  }
 }

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/report.js'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/report.js	2013-07-24 17:28:39 +
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/report.js	2013-12-06 13:03:52 +
@@ -1,65 +1,64 @@
-function addReport()
-{
-if ( $( "#reportForm #name" ).val().trim().length == 0  )
-   	{
-	setHeaderDelayMessage( i18n_specify_name );
-   		return false;
-   	}
-
-if ( $( "#reportForm #id" ).val().trim().length == 0 && !hasText( "upload" ) )
-   	{
-	setHeaderDelayMessage( i18n_please_specify_file );
-   		return false;
-   	}
-
-$( "#reportForm" ).submit();
-}
-
-function removeReport( id )
-{
-removeItem( id, "", i18n_confirm_remove_report, "removeReport.action" );
-}
-
-function setReportType()
-{
-	var type = $( "#type :selected" ).val();
-	
-	if ( "jasperReportTable" == type )
-	{
-		$( ".jasperJdbcDataSource" ).hide();
-		$( ".htmlDataSource" ).hide();
-		$( ".jasperReportTableDataSource" ).show();
-	}
-	else if ( "jasperJdbc" == type )
-	{
-		$( ".jasperReportTableDataSource" ).hide();
-		$( ".htmlDataSource" ).hide();
-		$( ".jasperJdbcDataSource" ).show();
-	}
-	else if ( "html" == type )
-	{
-		$( ".jasperReportTableDataSource" ).hide();
-		$( ".jasperJdbcDataSource" ).hide();
-		$( ".htmlDataSource" ).show();
-	}
+function addReport() {
+  if( $("#reportForm #name").val().trim().length == 0 ) {
+setHeaderDelayMessage(i18n_specify_name);
+return false;
+  }
+
+  if( $("#reportForm #id").val().trim().length == 0 && !hasText("upload") ) {
+s

[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 13163: context-menus for validation module

2013-12-06 Thread noreply

revno: 13163
committer: Morten Olav Hansen 
branch nick: dhis2
timestamp: Fri 2013-12-06 14:37:28 +0100
message:
  context-menus for validation module
modified:
  
dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/javascript/general.js
  
dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/javascript/validationRule.js
  
dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/javascript/validationRuleGroup.js
  
dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/validationRule.vm
  
dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/validationRuleGroup.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-validationrule/src/main/webapp/dhis-web-validationrule/javascript/general.js'
--- dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/javascript/general.js	2013-10-28 15:49:09 +
+++ dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/javascript/general.js	2013-12-06 13:37:28 +
@@ -1,6 +1,11 @@
-function showValidationRuleDetails( validationId )
+
+function showUpdateValidationRuleForm( context ) {
+  location.href = 'showUpdateValidationRuleForm.action?id=' + context.id;
+}
+
+function showValidationRuleDetails( context )
 {
-jQuery.post( 'getValidationRule.action', { id: validationId }, function ( json ) {
+jQuery.post( 'getValidationRule.action', { id: context.id }, function ( json ) {
 		setText( 'nameField', json.validationRule.name );
 		
 		var description = json.validationRule.description;
@@ -123,7 +128,6 @@
 return null;
 }
 
-function removeValidationRule( ruleId, ruleName )
-{
-	removeItem( ruleId, ruleName, i18n_confirm_delete, 'removeValidationRule.action' );
+function removeValidationRule( context ) {
+	removeItem( context.id, context.name, i18n_confirm_delete, 'removeValidationRule.action' );
 }

=== modified file 'dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/javascript/validationRule.js'
--- dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/javascript/validationRule.js	2013-10-28 15:49:09 +
+++ dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/javascript/validationRule.js	2013-12-06 13:37:28 +
@@ -1,31 +1,27 @@
-function changeRuleType()
-{
-	var ruleType = $( '#ruleType' ).val();
-	
-	if ( ruleType == 'validation' )
-	{
-		hideById( 'organisationUnitLevelTR' );
-		hideById( 'sequentialSampleCountTR' );
-		hideById( 'annualSampleCountTR' );
-		hideById( 'highOutliersTR' );
-		hideById( 'lowOutliersTR' );
-
-		showById( 'compulsory_pair' );
-	} 
-	else
-	{
-		showById( 'organisationUnitLevelTR' );
-		showById( 'sequentialSampleCountTR' );
-		showById( 'annualSampleCountTR' );
-		showById( 'highOutliersTR' );
-		showById( 'lowOutliersTR' );
-
-		var op = document.getElementById( 'operator' );
-		if ( 'compulsory_pair' == op.value )
-		{
-			showById( 'select_operator' );
-			op.selectedIndex = 0;
-		}
-		hideById( 'compulsory_pair' );
+function changeRuleType() {
+  var ruleType = $('#ruleType').val();
+
+  if( ruleType == 'validation' ) {
+hideById('organisationUnitLevelTR');
+hideById('sequentialSampleCountTR');
+hideById('annualSampleCountTR');
+hideById('highOutliersTR');
+hideById('lowOutliersTR');
+
+showById('compulsory_pair');
+  }
+  else {
+showById('organisationUnitLevelTR');
+showById('sequentialSampleCountTR');
+showById('annualSampleCountTR');
+showById('highOutliersTR');
+showById('lowOutliersTR');
+
+var op = document.getElementById('operator');
+if( 'compulsory_pair' == op.value ) {
+  showById('select_operator');
+  op.selectedIndex = 0;
 }
+hideById('compulsory_pair');
+  }
 }

=== modified file 'dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/javascript/validationRuleGroup.js'
--- dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/javascript/validationRuleGroup.js	2013-10-13 18:35:46 +
+++ dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/javascript/validationRuleGroup.js	2013-12-06 13:37:28 +
@@ -1,201 +1,179 @@
+
+function showUpdateValidationRuleGroupForm( context ) {
+  location.href = 'showUpdateValidationRuleGroupForm.action?id=' + context.id;
+}
+
 // -
 // View details
 // -
 
-function showValidationRuleGroupDetails( id )
-{
-	jQuery.post( 'g

[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 13164: Event analytics, centralized some sql filtering code. Renamed PersonQueryParams to TrackedEntityQ...

2013-12-06 Thread noreply
Merge authors:
  Lars Helge Øverland (larshelge)

revno: 13164 [merge]
committer: Lars Helge Øverland 
branch nick: dhis2
timestamp: Fri 2013-12-06 16:16:51 +0100
message:
  Event analytics, centralized some sql filtering code. Renamed 
PersonQueryParams to TrackedEntityQueryParams.
renamed:
  
dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/PersonQueryParams.java
 => 
dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/TrackedEntityQueryParams.java
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/QueryItem.java
  
dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/JdbcEventAnalyticsManager.java
  
dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/hibernate/HibernatePatientStore.java
  
dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/TrackedEntityQueryParams.java


--
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/common/QueryItem.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/QueryItem.java	2013-10-14 20:58:12 +
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/QueryItem.java	2013-12-06 15:16:51 +
@@ -31,13 +31,13 @@
 import java.util.HashMap;
 import java.util.Map;
 
-import org.hisp.dhis.common.IdentifiableObject;
-
 /**
  * @author Lars Helge Overland
  */
 public class QueryItem
 {
+public static final String OPTION_SEP = ";";
+
 public static final Map OPERATOR_MAP = new HashMap() { {
 put( "eq", "=" );
 put( "gt", ">" );
@@ -90,6 +90,34 @@
 return OPERATOR_MAP.get( operator.toLowerCase() );
 }
 
+public String getSqlFilter( String encodedFilter )
+{
+if ( operator == null || encodedFilter == null )
+{
+return null;
+}
+
+if ( operator.equalsIgnoreCase( "like" ) )
+{
+return "'%" + encodedFilter + "%'";
+}
+else if ( operator.equalsIgnoreCase( "in" ) )
+{
+String[] split = encodedFilter.split( OPTION_SEP );
+
+final StringBuffer buffer = new StringBuffer( "(" );
+
+for ( String el : split )
+{
+buffer.append( "'" ).append( el.toString() ).append( "'," );
+}
+
+return buffer.deleteCharAt( buffer.length() - 1 ).append( ")" ).toString();
+}
+
+return "'" + encodedFilter + "'";
+}
+
 @Override
 public String toString()
 {

=== modified file 'dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/JdbcEventAnalyticsManager.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/JdbcEventAnalyticsManager.java	2013-12-04 14:42:51 +
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/JdbcEventAnalyticsManager.java	2013-12-06 14:42:43 +
@@ -36,11 +36,8 @@
 import static org.hisp.dhis.system.util.TextUtils.removeLast;
 import static org.hisp.dhis.system.util.TextUtils.trimEnd;
 
-import java.util.Arrays;
-
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.hisp.dhis.analytics.DataQueryParams;
 import org.hisp.dhis.analytics.event.EventAnalyticsManager;
 import org.hisp.dhis.analytics.event.EventQueryParams;
 import org.hisp.dhis.common.DimensionalObject;
@@ -400,28 +397,8 @@
  */
 private String getSqlFilter( QueryItem item )
 {
-String operator = item.getOperator();
-String filter = item.getFilter();
-
-if ( operator == null || filter == null )
-{
-return null;
-}
-
-operator = operator.toLowerCase();
-filter = statementBuilder.encode( filter, false );
-
-if ( operator.equals( "like" ) )
-{
-return "'%" + filter + "%'";
-}
-else if ( operator.equals( "in" ) )
-{
-String[] split = filter.split( DataQueryParams.OPTION_SEP );
-
-return "(" + getQuotedCommaDelimitedString( Arrays.asList( split ) ) + ")";
-}
-
-return "'" + filter + "'";
+String encodedFilter = statementBuilder.encode( item.getFilter(), false );
+
+return item.getSqlFilter( encodedFilter );
 }
 }

=== renamed file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/PersonQueryParams.java' => 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/d

[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 13165: context-menus for usergroups

2013-12-06 Thread noreply

revno: 13165
committer: Morten Olav Hansen 
branch nick: dhis2
timestamp: Fri 2013-12-06 16:29:45 +0100
message:
  context-menus for usergroups
modified:
  
dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/javascript/usergroup.js
  
dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/userGroupList.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-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/javascript/usergroup.js'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/javascript/usergroup.js	2013-03-12 09:27:40 +
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/javascript/usergroup.js	2013-12-06 15:29:45 +
@@ -1,20 +1,28 @@
+$(function() {
+  dhis2.contextmenu.makeContextMenu({
+menuId: 'contextMenu',
+menuItemActiveClass: 'contextMenuItemActive'
+  });
+});
+
+function editUserGroupForm( context ) {
+  location.href = 'editUserGroupForm.action?userGroupId=' + context.id;
+}
 
 // -
 // Usergroup functionality
 // -
 
-function showUserGroupDetails( userGroupId )
-{
-jQuery.post( 'getUserGroup.action', { userGroupId: userGroupId },
-		function ( json ) {
-			setInnerHTML( 'nameField', json.userGroup.name );
-			setInnerHTML( 'noOfGroupField', json.userGroup.noOfUsers );
+function showUserGroupDetails( context ) {
+  jQuery.post('getUserGroup.action', { userGroupId: context.id },
+function( json ) {
+  setInnerHTML('nameField', json.userGroup.name);
+  setInnerHTML('noOfGroupField', json.userGroup.noOfUsers);
 
-			showDetails();
-	});
+  showDetails();
+});
 }
 
-function removeUserGroup( userGroupId, userGroupName )
-{
-removeItem( userGroupId, userGroupName, i18n_confirm_delete, 'removeUserGroup.action' );
+function removeUserGroup( context ) {
+  removeItem(context.id, context.name, i18n_confirm_delete, 'removeUserGroup.action');
 }

=== modified file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/userGroupList.vm'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/userGroupList.vm	2013-09-04 11:32:31 +
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/userGroupList.vm	2013-12-06 15:29:45 +
@@ -2,84 +2,70 @@
 #sharingDialog()
 
 
-var i18n_confirm_delete = '$encoder.jsEscape( $i18n.getString( "confirm_delete" ) , "'" )';
+  var i18n_confirm_delete = '$encoder.jsEscape( $i18n.getString( "confirm_delete" ) , "'" )';
 
 
 $i18n.getString( "user_group_management" ) #openHelp( "user_group_management" )
 
+
+  
+  $i18n.getString( "sharing_settings" )
+  $i18n.getString( "edit" )
+  $i18n.getString( "remove" )
+  $i18n.getString( "show_details" )
+  
+
+
 
   
 
 
-
-#filterDiv( "getAllUserGroups" )
-
-
-
-
+  
+#filterDiv( "getAllUserGroups" )
+
+  
+
+  
 
 
 
 
-  
   
   
 $i18n.getString( "name" )
-$i18n.getString( "operations" )
   
   
   
 #foreach( $userGroup in $userGroupList )
-  
-$encoder.htmlEncode( $userGroup.name )
-
-
-  #if ( $security.canManage( $userGroup ) )
-  
-  #else
-  
-  #end
-
-  #if( $security.canUpdate( $userGroup ) )
-  
-  #else
-  
-  #end
-
-  #if( $security.canDelete( $userGroup ) )
-  
-  #else
-  
-  #end
-
-  
-
-
+  
+  $encoder.htmlEncode( $!userGroup.displayName )
   
 #end
   
 
-		
-		#parse( "/dhis-web-commons/paging/paging.vm" )
+
+#parse( "/dhis-web-commons/paging/paging.vm" )
 
   
+
   
-  	
-  
-  
-  
-  
-  $i18n.getString( "name" ):
-  $i18n.getString( "no_of_Users" ):
-  
-  
-  
-  
-

Re: [Dhis2-devs] API for pulling Multilingual Labels?

2013-12-06 Thread Morten Olav Hansen
Hi Rodolfo,

We already have a blueprint for this (for 2.14, but it has not been
assigned yet). You can see it at [1].

Do you need multiple translation for a single user, or is it enough that
data-element names etc returned are in the users db-locale?

[1] https://blueprints.launchpad.net/dhis2/+spec/i18n-in-web-api

--
Morten


On Fri, Dec 6, 2013 at 12:55 PM, Rodolfo Melia  wrote:

> Hi - as part of some of the apps that we are coding, as well as 7 complex
> custom forms that we are about to build (they will have some JScript for
> logic), we will need both (apps and forms) in 3 languages (total 21 forms
> if we use the current way of doing things).
>
> Does the current metadata API has a function to retrieve multilingual
> values?
> What we are looking is the possibility to retrieve the Name, Form Name or
> Short Name of a DataElement, Category or Option Set  in the current-user
> language by passing the UID or Code.
>
> If this functionality doesn't exist at the moment:
> - Should it be added to the metadata api?
> - Should it be part of the Categories/ Data Elements/ api?
>
> PSI will be happy to contribute on the development of this under your
> guidance.
>
> Rodolfo
>
> ___
> Mailing list: https://launchpad.net/~dhis2-devs
> Post to : dhis2-devs@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~dhis2-devs
> More help   : https://help.launchpad.net/ListHelp
>
>
___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 13166: Event analytics, case sensitive issue fixed

2013-12-06 Thread noreply

revno: 13166
committer: Lars Helge Øverland 
branch nick: dhis2
timestamp: Fri 2013-12-06 16:47:52 +0100
message:
  Event analytics, case sensitive issue fixed
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/QueryItem.java
  
dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/DefaultEventAnalyticsService.java
  
dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/JdbcEventAnalyticsManager.java


--
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/common/QueryItem.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/QueryItem.java	2013-12-06 15:16:51 +
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/QueryItem.java	2013-12-06 15:47:52 +
@@ -54,6 +54,8 @@
 private String operator;
 
 private String filter;
+
+private boolean numeric;
 
 // -
 // Constructors
@@ -64,11 +66,12 @@
 this.item = item;
 }
 
-public QueryItem( IdentifiableObject item, String operator, String filter )
+public QueryItem( IdentifiableObject item, String operator, String filter, boolean numeric )
 {
 this.item = item;
 this.operator = operator;
 this.filter = filter;
+this.numeric = numeric;
 }
 
 // -
@@ -157,4 +160,14 @@
 {
 this.filter = filter;
 }
+
+public boolean isNumeric()
+{
+return numeric;
+}
+
+public void setNumeric( boolean numeric )
+{
+this.numeric = numeric;
+}
 }

=== modified file 'dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/DefaultEventAnalyticsService.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/DefaultEventAnalyticsService.java	2013-12-06 15:16:51 +
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/DefaultEventAnalyticsService.java	2013-12-06 15:47:52 +
@@ -488,21 +488,21 @@
 
 if ( de != null && program.getAllDataElements().contains( de ) )
 {
-return new QueryItem( de, operator, filter );
+return new QueryItem( de, operator, filter, de.isNumericType() );
 }
 
 PatientAttribute at = attributeService.getPatientAttribute( item );
 
 if ( at != null && program.getPatientAttributes().contains( at ) )
 {
-return new QueryItem( at, operator, filter );
+return new QueryItem( at, operator, filter, at.isNumericType() );
 }
 
 PatientIdentifierType it = identifierTypeService.getPatientIdentifierType( item );
 
 if ( it != null && program.getPatientIdentifierTypes().contains( it ) )
 {
-return new QueryItem( it, operator, filter );
+return new QueryItem( it, operator, filter, false );
 }
 
 throw new IllegalQueryException( "Item identifier does not reference any item part of the program: " + item );   

=== modified file 'dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/JdbcEventAnalyticsManager.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/JdbcEventAnalyticsManager.java	2013-12-06 14:42:43 +
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/JdbcEventAnalyticsManager.java	2013-12-06 15:47:52 +
@@ -376,16 +376,16 @@
 for ( QueryItem item : params.getItems() )
 {
 if ( item.hasFilter() )
-{
-sql += "and " + statementBuilder.columnQuote( item.getItem().getUid() ) + " " + item.getSqlOperator() + " " + getSqlFilter( item ) + " ";
+{
+sql += "and " + getColumn( item ) + " " + item.getSqlOperator() + " " + getSqlFilter( item ) + " ";
 }
 }
 
 for ( QueryItem filter : params.getItemFilters() )
 {
 if ( filter.hasFilter() )
-{
-sql += "and " + statementBuilder.columnQuote( filter.getItem().getUid() ) + " " + filter.getSqlOperator() + " " + getSqlFilter( filter ) + " ";
+{
+sql += "and " + getColumn( filter ) + " " + filter.getSqlOperator() + " " + getSqlFilter( filter ) + " ";
 }
 }
 
@@ -393,6 +393,16 @@
 }
 
 /**
+ * Returns 

[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 13167: Moved TrackedEntityQueryParams to api

2013-12-06 Thread noreply

revno: 13167
committer: Lars Helge Øverland 
branch nick: dhis2
timestamp: Fri 2013-12-06 17:26:51 +0100
message:
  Moved TrackedEntityQueryParams to api
renamed:
  
dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/TrackedEntityQueryParams.java
 => 
dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/TrackedEntityQueryParams.java
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/QueryItem.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientStore.java
  
dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/hibernate/HibernatePatientStore.java
  
dhis-2/dhis-services/dhis-service-patient/src/test/java/org/hisp/dhis/patient/PatientStoreTest.java
  
dhis-2/dhis-services/dhis-service-patient/src/test/java/org/hisp/dhis/patientdatavalue/PatientDataValueServiceTest.java


--
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/common/QueryItem.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/QueryItem.java	2013-12-06 15:47:52 +
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/QueryItem.java	2013-12-06 16:26:51 +
@@ -121,6 +121,11 @@
 return "'" + encodedFilter + "'";
 }
 
+public String getItemId()
+{
+return item.getUid();
+}
+
 @Override
 public String toString()
 {

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientStore.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientStore.java	2013-11-05 08:07:19 +
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientStore.java	2013-12-06 16:26:51 +
@@ -109,6 +109,8 @@
 Collection getByOrgUnitProgram( OrganisationUnit organisationUnit, Program program, Integer min,
 Integer max );
 
+List query( TrackedEntityQueryParams params );
+
 /**
  * Search patient who has the same representative
  * 

=== renamed file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/TrackedEntityQueryParams.java' => 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/TrackedEntityQueryParams.java'
=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/hibernate/HibernatePatientStore.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/hibernate/HibernatePatientStore.java	2013-12-06 13:29:05 +
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/hibernate/HibernatePatientStore.java	2013-12-06 16:26:51 +
@@ -191,18 +191,22 @@
 {
 SqlHelper hlp = new SqlHelper();
 
-String hql = 
-"select pt from Patient pt " +
-"inner join PatientAttributeValue av " +
-"inner join PatientAttribute at ";
+String hql = "select pt from Patient pt left join pt.attributeValues av";
 
 for ( QueryItem at : params.getAttributes() )
 {
-hlp.whereAnd();
+hql += " " + hlp.whereAnd();
+hql += " (av.patientAttribute = :attr" + at.getItemId() + " and av.value = :filt" + at.getItemId() + ")";
 }
 
 Query query = getQuery( hql );
 
+for ( QueryItem at : params.getAttributes() )
+{
+query.setEntity( "attr" + at.getItemId(), at.getItem() );
+query.setString( "filt" + at.getItemId(), at.getFilter() );
+}
+
 return query.list();
 }
 

=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/test/java/org/hisp/dhis/patient/PatientStoreTest.java'
--- dhis-2/dhis-services/dhis-service-patient/src/test/java/org/hisp/dhis/patient/PatientStoreTest.java	2013-11-28 06:19:32 +
+++ dhis-2/dhis-services/dhis-service-patient/src/test/java/org/hisp/dhis/patient/PatientStoreTest.java	2013-12-06 16:26:51 +
@@ -373,4 +373,20 @@
 assertEquals( 0, validatePatientA1 );
 assertEquals( 2, validatePatientB1 );
 }
+
+@Test
+public void testQuery()
+{
+patientStore.save( patientA1 );
+patientStore.save( patientA2 );
+patientStore.save( patientA3 );
+patientStore.save( patientB1 );
+patientStore.save( patientB2 );
+
+TrackedEntityQueryParams params = new TrackedEntityQueryParams();
+
+List list = patientStore.query( params );
+
+assertEquals( 5, list.size() );
+}
 }

=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/test/java/org/hisp/dhis/patientdatavalue/PatientDataValueServiceTest.java'
--- dhis-2/dhis-services/dhis-service-patient/src/test/java/org/hisp/dhis/patientdataval

[Dhis2-devs] Legend Options Setup

2013-12-06 Thread Prosper BT
Dear Developers,

Since Legends are now being used also in Pivot tables and have to also be
applied at setting up indicators, can I suggest we create them in Data
Administration?

Most of the time when training you encounter them in Setting up indicators
and Pivot tables which are always done before GIS and tempted to first to
go GIS.

Regards

-- 
Prosper Behumbiize, MPH
Phone:+256 414 320076
Cell: +256 772 139037
 +256 752 751776
___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


Re: [Dhis2-devs] API for pulling Multilingual Labels?

2013-12-06 Thread Rodolfo Melia
Hi Morten. We just need the labels to be returned in the user language. If 
James can do this, please assign it to him.

Rodolfo Meliá
+44 777 576 4090 | +1 708 872-7636

Please ignore any typos on this email sent from my mobile, probably written 
while I was at the park with the kids, at the airport walking to the gate, or 
sleepless (although exhausted). Grammatical faults? I'm sorry- I do my best

> On 6 Dec 2013, at 15:35, Morten Olav Hansen  wrote:
> 
> Hi Rodolfo,
> 
> We already have a blueprint for this (for 2.14, but it has not been assigned 
> yet). You can see it at [1].
> 
> Do you need multiple translation for a single user, or is it enough that 
> data-element names etc returned are in the users db-locale?
> 
> [1] https://blueprints.launchpad.net/dhis2/+spec/i18n-in-web-api
> 
> --
> Morten
> 
> 
>> On Fri, Dec 6, 2013 at 12:55 PM, Rodolfo Melia  wrote:
>> Hi - as part of some of the apps that we are coding, as well as 7 complex 
>> custom forms that we are about to build (they will have some JScript for 
>> logic), we will need both (apps and forms) in 3 languages (total 21 forms if 
>> we use the current way of doing things).
>> 
>> Does the current metadata API has a function to retrieve multilingual values?
>> What we are looking is the possibility to retrieve the Name, Form Name or 
>> Short Name of a DataElement, Category or Option Set  in the current-user 
>> language by passing the UID or Code.
>> 
>> If this functionality doesn't exist at the moment:
>> - Should it be added to the metadata api?
>> - Should it be part of the Categories/ Data Elements/ api?
>> 
>> PSI will be happy to contribute on the development of this under your 
>> guidance.
>> 
>> Rodolfo
>> 
>> ___
>> Mailing list: https://launchpad.net/~dhis2-devs
>> Post to : dhis2-devs@lists.launchpad.net
>> Unsubscribe : https://launchpad.net/~dhis2-devs
>> More help   : https://help.launchpad.net/ListHelp
>> 
> 
___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


Re: [Dhis2-devs] Legend Options Setup

2013-12-06 Thread Lars Helge Øverland
Hi Prosper,

I do agree with that. The reason why we have it in GIS at the moment is
simply pragmatic - Jan made such a nice UI for it in GIS and it will take
time to re-develop it. We can put it on the list.

cheers

Lars



On Fri, Dec 6, 2013 at 5:38 PM, Prosper BT  wrote:

> Dear Developers,
>
> Since Legends are now being used also in Pivot tables and have to also be
> applied at setting up indicators, can I suggest we create them in Data
> Administration?
>
> Most of the time when training you encounter them in Setting up indicators
> and Pivot tables which are always done before GIS and tempted to first to
> go GIS.
>
> Regards
>
> --
> Prosper Behumbiize, MPH
> Phone:+256 414 320076
> Cell: +256 772 139037
>  +256 752 751776
>
>
> ___
> Mailing list: https://launchpad.net/~dhis2-devs
> Post to : dhis2-devs@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~dhis2-devs
> More help   : https://help.launchpad.net/ListHelp
>
>
___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp