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

2015-02-17 Thread noreply

revno: 18291
committer: Morten Olav Hansen 
branch nick: dhis2
timestamp: Tue 2015-02-17 15:00:44 +0700
message:
  minor fix
modified:
  
dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/common/IdentifiableObjectManagerTest.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-services/dhis-service-core/src/test/java/org/hisp/dhis/common/IdentifiableObjectManagerTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/common/IdentifiableObjectManagerTest.java	2015-02-17 05:01:28 +
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/common/IdentifiableObjectManagerTest.java	2015-02-17 08:00:44 +
@@ -586,6 +586,7 @@
 identifiableObjectManager.save( dataElementD );
 
 Property property = new Property( DataElement.class, null, null );
+property.setSimple( true );
 property.setPersisted( true );
 property.setFieldName( "name" );
 
@@ -616,6 +617,7 @@
 identifiableObjectManager.save( dataElementD );
 
 Property property = new Property( DataElement.class, null, null );
+property.setSimple( true );
 property.setPersisted( true );
 property.setFieldName( "name" );
 

___
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] Error Creating An SQL View through DHIS2 Front End

2015-02-17 Thread Jason Pickering
Not surprising.

The thing is, all of this should happen anyway at startup,but for some
reason isn't. I think you will need to get a full log when the server
starts up. If you are lucky,you will see some errors there. If not,you may
need to get statement level logs from the postgresql server to see exactly
why the table alteration scripts are not able to complete upon startup.

Once you can get that information,maybe we can help further.

Regards,
Jason
On Feb 17, 2015 4:50 PM, "Arthur Gwatidzo"  wrote:

> Hi Jason Pickering,
>
>
>
> On using your two statements to resolve my issue:
>
> update sqlview set sqlviewid=viewid;
>
> alter table sqlview drop column viewid;
>
>
>
>
>
>
>
> For some reason on dropping the viewed column from the sqlview table ,
> another error
>
>
>
>
>
> Error:
>
> ERROR:  cannot drop table sqlview column viewid because other objects
> depend on it
>
> DETAIL:  constraint fk39f92993428ceacc on table sqlviewusergroupaccesses
> depends on table sqlview column viewid
>
> HINT:  Use DROP ... CASCADE to drop the dependent objects too.
>
>
>
> ** Error **
>
>
>
> ERROR: cannot drop table sqlview column viewid because other objects
> depend on it
>
> SQL state: 2BP01
>
> Detail: constraint fk39f92993428ceacc on table sqlviewusergroupaccesses
> depends on table sqlview column viewid
>
> Hint: Use DROP ... CASCADE to drop the dependent objects too.
>
>
>
>
>
> Regards,
>
>
>
> Arthur
>
>
>
> *From:* Arthur Gwatidzo [mailto:arthu...@hisp.org]
> *Sent:* 17 February 2015 08:02 AM
> *To:* 'Jason Pickering'; 'Adebusoye Anifalaje'
> *Cc:* 'dhis2-devs'
> *Subject:* RE: [Dhis2-devs] Error Creating An SQL View through DHIS2
> Front End
>
>
>
> Noted.
>
>
>
> Thanks Jason for helping.
>
>
>
> *From:* Jason Pickering [mailto:jason.p.picker...@gmail.com
> ]
> *Sent:* 17 February 2015 12:36 AM
> *To:* Adebusoye Anifalaje
> *Cc:* Arthur Gwatidzo; dhis2-devs
> *Subject:* Re: [Dhis2-devs] Error Creating An SQL View through DHIS2
> Front End
>
>
>
> Actually not, have a nice early morning with a cup of coffee, but thanks
> for the concern, but maybe should have laid off that second cup as it seems
> I sent out another email to quickly. Lets try again
>
>
>
> I am just taking the statements from the TableAlteror.java, so you can use
> that for reference in case I get it wrong again
>
>
>
> update sqlview set sqlviewid=viweid";
>
> alter table sqlview drop column viewid;
>
>
>
>
>
> Best regards,
>
> Jason
>
>
>
>
>
> On Tue, Feb 17, 2015 at 6:13 AM, Adebusoye Anifalaje 
> wrote:
>
> Hi
>
> Jason you must be having a long night as you probably meant
>
> update sqlview set sqlviewid=viewid;
>
>
>
> Cheers
>
> Busoye
>
>
>
>
>
> Sent from my Samsung Galaxy smartphone.
>
>
>
>  Original message 
> From: Jason Pickering 
> Date:16/02/2015 9:48 pm (GMT+00:00)
> To: Arthur Gwatidzo 
> Cc: dhis2-devs 
> Subject: Re: [Dhis2-devs] Error Creating An SQL View through DHIS2 Front
> End
>
> Sorry..send that one too fast
>
> Here  was the SQL you need
>
>
>
> update sqlview set sqlviewid=viweid;
>
> update sqlview set sqlviewid=viweid;
>
>
>
> Best regards,
>
> Jason
>
>
>
>
>
> On Tue, Feb 17, 2015 at 5:47 AM, Jason Pickering <
> jason.p.picker...@gmail.com> wrote:
>
> Hi Arthur,
>
>
>
> Here is the problem.
>
>
>
> Caused by: org.postgresql.util.PSQLException: ERROR: null value in column
> "viewid" violates not-null constraint Detail: Failing row contains (null,
> RidpdaReportSQL, a0rnEhRIhG3, null, 2015-02-16
>
>
>
> viewid has been renamed to "sqlviewid" but looks like your version of the
> database was either not upgraded or something else happened. If you have a
> "sqlviewid" column, it is probably safe to drop the "viewid" column.
>
>
>
> Otherwise, you should execute
>
>
>
>
>
> On Mon, Feb 16, 2015 at 10:17 PM, Arthur Gwatidzo 
> wrote:
>
> Hi Devs,
>
>
>
>
>
> I am encountering an error when creating an SQL View using the front-end
> (Data Administration Utility of DHIS2).
>
> I tested this query in Postgre SQL and everything is okay.
>
>
>
> *Simple SQL View*
>
> SELECT de.name AS dataelementname,dv.value as Value,dv.comment, ou.uid As
> OrgUnitUID, ou.name,dv.periodid,pe.startdate,pe.enddate
>
>
>
> FROM datavalue dv INNER JOIN dataelement de
>
>
>
> ON(dv.dataelementid = de.dataelementid) AND ((de.uid='tATNxcPszv6' OR
> de.uid='zdShnywRyRP' OR de.uid='p33CeJ0tlE2' OR de.uid='ZEhUXlEjQoY' OR
> de.uid='Sgfn0Bw3OmZ' OR de.uid='MeHrnx6ypja' OR de.uid='EiHR3DtgJn9' OR
> de.uid='Xix3M7SHKCf' OR de.uid='Tlv3LImxRoW' OR de.uid='p6GJqwbCXqf'))
>
>
>
>
>
> INNER JOIN organisationunit ou
>
>
>
> ON( dv.sourceid = ou.organisationunitid)
>
>
>
> INNER JOIN period pe
>
>
>
> ON(dv.periodid = pe.periodid)
>
>
>
> ORDER BY OrgUnitUID;
>
>
>
>
>
> *Error in DHIS2 *
>
> *An exception occurred*
>
> Sorry! The system failed to execute the operation. Usually, no data is
> lost and you can continue working by going back to the previous page.
>
>
>
>
>
> I have attached a snapshot of the tomcat logs.

Re: [Dhis2-devs] Request by SMS

2015-02-17 Thread Souleymane Ousmane
No solution for me?

2015-02-15 11:47 GMT+01:00 Souleymane Ousmane 
:

> Dear all.
>
>
> Is there any DHIS2 functionality, to request the value of a data element
> or indicator by SMS (like rapidsms for example)?
>
>
> Thank you for your assistance.
>
___
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] Rebuilding resource tables on org unit changes

2015-02-17 Thread Lars Helge Øverland
Hi Mahendra,

thanks for the patch. Applied to trunk now in r 18292.

regards,

Lars


On Tue, Feb 17, 2015 at 5:44 AM, Mahendra Kariya <
mahendra.kar...@thoughtworks.com> wrote:

> Hi Lars,
>
> As discussed, find attached the patch. Please review and apply to trunk.
>
> We have added the option "Every 15 mins" to resource table generation
> scheduling.
>
> One thing which is yet to be done is to add the translations for this new
> option for all the languages. None of us here have enough knowledge to do
> the translations. Can the DHIS team take care of it?
>
>
> Thanks,
> Mahendra
>
>
>
>
> On Mon, Feb 16, 2015 at 3:41 PM, Lars Helge Øverland 
> wrote:
>
>> Okay thanls I think that is a good idea to build in.
>>
>>
>>
>> On Mon, Feb 16, 2015 at 11:06 AM, Mahendra Kariya <
>> mahendra.kar...@thoughtworks.com> wrote:
>>
>>> Hi Lars,
>>>
>>> On DHIS, we can schedule the generation of resource tables on a daily
>>> basis. But we want this job to run much more frequently. So we are changing
>>> DHIS code to add "Every 15 mins" options to schedule resource tables.
>>>
>>> We will be submitting a patch soon. Please let us know if there is any
>>> issue.
>>>
>>>
>>>
>>> Thanks,
>>> Mahendra
>>>
>>> On Fri, Feb 13, 2015 at 1:28 AM, Lars Helge Øverland <
>>> larshe...@gmail.com> wrote:
>>>
 Hi Simanta,

 the problem with updating resource tables based on user action is that
 this process takes some time and is not "thread-safe", meaning you only
 want this process to run sequentially (one at the time).

 My best recommendation would be to set up a sync script (e.g. curl,
 bash, cron) that runs these tables once every 15 minutes or so. That way
 your system will be reasonably up to date.

 Lars


___
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 18292: Applied patch from TW. Adds support for 15min interval resource table scheduling

2015-02-17 Thread noreply

revno: 18292
committer: Lars Helge Overland 
branch nick: dhis2
timestamp: Tue 2015-02-17 14:27:11 +0100
message:
  Applied patch from TW. Adds support for 15min interval resource table 
scheduling
modified:
  
dhis-2/dhis-services/dhis-service-administration/src/main/resources/META-INF/dhis/beans.xml
  
dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/scheduling/SchedulingManager.java
  
dhis-2/dhis-services/dhis-service-reporting/src/main/resources/META-INF/dhis/beans.xml
  
dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/scheduling/Scheduler.java
  
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/scheduling/ScheduleTasksAction.java
  
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/resources/org/hisp/dhis/dataadmin/i18n_module.properties
  
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/webapp/dhis-web-maintenance-dataadmin/viewScheduledTasks.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-services/dhis-service-administration/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-services/dhis-service-administration/src/main/resources/META-INF/dhis/beans.xml	2015-02-12 09:28:20 +
+++ dhis-2/dhis-services/dhis-service-administration/src/main/resources/META-INF/dhis/beans.xml	2015-02-17 13:27:11 +
@@ -102,5 +102,7 @@
   
   
   
-  
+
+  
+
 

=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/scheduling/SchedulingManager.java'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/scheduling/SchedulingManager.java	2015-01-17 07:41:26 +
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/scheduling/SchedulingManager.java	2015-02-17 13:27:11 +
@@ -28,16 +28,17 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+import org.hisp.dhis.common.ListMap;
+
 import java.util.Set;
 
-import org.hisp.dhis.common.ListMap;
-
 /**
  * @author Lars Helge Overland
  */
 public interface SchedulingManager
 {
 final String TASK_RESOURCE_TABLE = "resourceTableTask";
+final String TASK_RESOURCE_TABLE_15_MINS = "resourceTable15MinTask";
 final String TASK_DATAMART_LAST_YEAR = "dataMartLastYearTask";
 final String TASK_ANALYTICS_ALL = "analyticsAllTask";
 final String TASK_ANALYTICS_LAST_3_YEARS = "analyticsLast3YearsTask";

=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/resources/META-INF/dhis/beans.xml	2014-12-04 06:39:46 +
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/resources/META-INF/dhis/beans.xml	2015-02-17 13:27:11 +
@@ -188,6 +188,7 @@
 
   
 
+
 
 
 

=== modified file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/scheduling/Scheduler.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/scheduling/Scheduler.java	2015-01-17 07:41:26 +
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/scheduling/Scheduler.java	2015-02-17 13:27:11 +
@@ -35,6 +35,7 @@
 {
 final String CRON_DAILY_0AM = "0 0 0 * * ?";
 final String CRON_EVERY_MIN = "0 0/1 * * * ?";
+final String CRON_EVERY_15MIN = "0 0/15 * * * ?";
 final String CRON_TEST = "0 * * * * ?";
 
 final String STATUS_RUNNING = "running";

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/scheduling/ScheduleTasksAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/scheduling/ScheduleTasksAction.java	2015-01-17 07:41:26 +
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/scheduling/ScheduleTasksAction.java	2015-02-17 13:27:11 +
@@ -28,24 +28,7 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import static org.hisp.dhis.scheduling.SchedulingManager.TASK_ANALYTICS_ALL;
-import static org.hisp.dhis.scheduling.SchedulingManager.TASK_ANALYTICS_LAST_3_YEARS;
-import static org.hisp.dhis.scheduling.SchedulingManager.TASK_DATAMART_LAST_YEAR;
-import static org.hisp.dhis.scheduling.SchedulingManager.TASK_RESOURCE_TABLE;
-import static org.hisp.dhis.scheduling.SchedulingManager.TASK_MONITORING_LAST_DAY;
-import static org.hisp.dhis.scheduling.SchedulingManager.TASK_DATA_SYNCH;
-import static org.hisp.dhis.setting.SystemSetting

Re: [Dhis2-devs] Request by SMS

2015-02-17 Thread Steffen Tengesdal
Hello Souleymane,

For the SMS, it’s purely for data entry.  There are alerts that can be sent 
out, but no query ability for a particular data element.  I think I’m 
understanding your question, but I’m also not familiar w/ the capabilities in 
rapidsms.  

-Steffen Tengesdal

> On Feb 17, 2015, at 4:52 AM, Souleymane Ousmane 
>  wrote:
> 
> No solution for me?
> 
> 
> 2015-02-15 11:47 GMT+01:00 Souleymane Ousmane  >:
> Dear all.
> 
> 
> 
> Is there any DHIS2 functionality, to request the value of a data element or 
> indicator by SMS (like rapidsms for example)?
> 
> 
> 
> Thank you for your assistance.
> 
> 
> ___
> 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] Issue with events import via Web API with json format

2015-02-17 Thread Alex Tumwesigye
Dear Dev Team,

I am trying to import events using the Web API (via curl).

However, this is the response I get.
 * Connection #0 to host localhost left intact
{"imported":0,"updated":0,"ignored":0,"importSummaries":[{"status":"ERROR","description":"There
is no program instance for program
y9LMXyKYXSI","dataValueCount":{"imported":0,"updated":0,"ignored":0,"deleted":0},"importCount":{"imported":0,"updated":0,"ignored":0,"deleted":0}}]}Done

Here is the structure of my json. It is a single event with no registration
created in 2.16. (tried with programStage too but still failed)

{"program":"y9LMXyKYXSI","storedBy":"System","orgUnit":"o5Gxx8zOilJ","eventDate":"2015-02-16","status":"ACTIVE","dataValues":[{"dataElement":"AV9WEhlUhX3","value":"0"},{"dataElement":"Ut0gvAjKAVN","value":"1900-01-01"},{"dataElement":"J3eoixEr9qu","value":"2015-02-16"},{"dataElement":"b3pUScaaxK9","value":"Byumba
DH"},{"dataElement":"KrZZcRgZFZ3","value":"Rabies"},{"dataElement":"QeU5nY1HhXz","value":"2015W713022210"},{"dataElement":"s9HlcTDBHQw","value":"Probable"},{"dataElement":"Gqprct6P5as","value":"1
Cases
Threshold"},{"dataElement":"DwUPWwOebPX","value":"0"},{"dataElement":"qa2bWueSi3x","value":"System"},{"dataElement":"KHCEtIgAK4z","value":"2"}]}


I am using ver 2.17 build 17754

-- 
Alex Tumwesigye

Technical Advisor - DHIS2 (Consultant),
Ministry of Health/AFENET
Kampala
Uganda

IT Consultant - BarefootPower Uganda Ltd, SmartSolar, Kenya

IT Specialist (Servers, Networks and Security, Health Information Systems -
DHIS2 ) & Solar Consultant

+256 774149 775, + 256 759 800161

"I don't want to be anything other than what I have been - one tree hill "
___
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] SMS Not finding Users Associated with Phones

2015-02-17 Thread Ocaya Stephen
Hello, I upgraded to 2.18 But seems the SMS functionality in this version
(Build 18177)  does not get the users associated with the phone. See Logs
below and Help

* INFO  2015-02-17 18:04:45,962 Login success for user: 'dhis', ip:
'127.0.0.1' (DefaultUserAuditService.java [http-bio-8080-exec-11])
* INFO  2015-02-17 18:04:46,168 Received SMS: MCD C0 (SmsPublisher.java
[Thread-14])
* WARN  2015-02-17 18:04:46,179 Cannot get users with disjoint roles as
user does not have any user roles (DefaultUserService.java [Thread-14])
* ERROR 2015-02-17 18:04:46,187 org.hisp.dhis.sms.parse.SMSParserException:
No user associated with this phone number. Please contact your supervisor.
(SmsPublisher.java
[Thread-14])
org.hisp.dhis.sms.parse.SMSParserException: No user associated with this
phone number. Please contact your supervisor.
at
org.hisp.dhis.sms.listener.DataValueSMSListener.receive(DataValueSMSListener.java:194)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at
org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at
org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
at
org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281)
at
org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)
at com.sun.proxy.$Proxy66.receive(Unknown Source)
at
org.hisp.dhis.sms.SmsPublisher$SMSConsumerThread.fetchAndParseSMS(SmsPublisher.java:119)
at
org.hisp.dhis.sms.SmsPublisher$SMSConsumerThread.run(SmsPublisher.java:89)
* INFO  2015-02-17 18:04:46,189 Sending message OutboundSMS
[recipients=256788713957, message=DHIS: No user associated with this phone
number. Please contact your supervi
sor.] (DefaultOutboundSmsTransportService.java [Thread-14])
* INFO  2015-02-17 18:04:46,189 RequestURL:
http://cvs.rapidsms.org:9090/gw?sender=256788713957&text=DHIS%3A+No+user+associated+with+this+phone+number.+Please+contact+you
r+supervisor.&username=dhis&password=dHiStwo mTrac
(SimplisticHttpGetGateWay.java [Thread-14])

Stephen Ocaya
--META Project

-- 

*You can do anything, but not everything.*
___
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 18294: Event analytics. Added support for value dimesion and aggregation type.

2015-02-17 Thread noreply

revno: 18294
committer: Lars Helge Overland 
branch nick: dhis2
timestamp: Tue 2015-02-17 17:50:34 +0100
message:
  Event analytics. Added support for value dimesion and aggregation type.
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/analytics/AggregationType.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/eventchart/EventChart.java
  
dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/DataQueryParams.java
  
dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/EventAnalyticsService.java
  
dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/EventQueryParams.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/DefaultEventQueryPlanner.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-analytics/src/test/java/org/hisp/dhis/analytics/event/data/EventAnalyticsServiceTest.java
  
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/AbstractCrudController.java
  
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/EventAnalyticsController.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/analytics/AggregationType.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/analytics/AggregationType.java	2015-01-17 07:41:26 +
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/analytics/AggregationType.java	2015-02-17 16:50:34 +
@@ -38,7 +38,8 @@
 AVERAGE_SUM_INT_DISAGGREGATION( "avg_sum_int_disaggregation" ), // Sum in organisation unit hierarchy
 AVERAGE_INT( "avg_int" ),
 AVERAGE_INT_DISAGGREGATION( "avg_int_disaggregation" ),
-AVERAGE_BOOL( "avg" ), 
+AVERAGE_BOOL( "avg" ),
+AVERAGE( "average" ), // General average
 COUNT( "count" ), 
 STDDEV( "stddev" ), 
 VARIANCE( "variance" ),

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/eventchart/EventChart.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/eventchart/EventChart.java	2015-02-16 14:25:40 +
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/eventchart/EventChart.java	2015-02-17 16:50:34 +
@@ -28,12 +28,9 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonView;
-import com.fasterxml.jackson.databind.annotation.JsonSerialize;
-import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
-import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
-import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
 
 import org.hisp.dhis.analytics.EventOutputType;
 import org.hisp.dhis.chart.BaseChart;
@@ -54,11 +51,13 @@
 import org.hisp.dhis.program.Program;
 import org.hisp.dhis.program.ProgramStage;
 import org.hisp.dhis.user.User;
-import org.hisp.dhis.analytics.EventOutputType;
 
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonView;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
 
 /**
  * @author Jan Henrik Overland

=== modified file 'dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/DataQueryParams.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/DataQueryParams.java	2015-02-03 14:33:39 +
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/DataQueryParams.java	2015-02-17 16:50:34 +
@@ -636,6 +636,14 @@
 {
 return this.aggregationType != null && this.aggregationType.equals( aggregationType );
 }
+
+/**
+ * Indicates whether an aggregation type is specified.
+ */
+public boolean hasAggregationType()
+{
+return this.aggregationType != null;
+}
 
 /**
  * Creates a mapping between the data periods, based on the data period type

=== modified file 'dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/

[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 18293: Typo

2015-02-17 Thread noreply

revno: 18293
committer: Lars Helge Overland 
branch nick: dhis2
timestamp: Tue 2015-02-17 16:46:42 +0100
message:
  Typo
modified:
  
dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/DefaultEventAnalyticsService.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-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	2015-02-15 17:50:12 +
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/DefaultEventAnalyticsService.java	2015-02-17 15:46:42 +
@@ -537,7 +537,7 @@
 throw new IllegalQueryException( "Query item or filter is invalid: " + dimensionString );
 }
 
-QueryItem queryItem = getQuryItemFromUid( split[0] );
+QueryItem queryItem = getQueryItemFromUid( split[0] );
 
 if ( split.length > 1 ) // Filters specified
 {   
@@ -646,7 +646,7 @@
 return item;
 }
 
-private QueryItem getQuryItemFromUid( String item )
+private QueryItem getQueryItemFromUid( String item )
 {
 DataElement de = dataElementService.getDataElement( item );
 

___
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] Is it possible to change the passwd of the users using the API??

2015-02-17 Thread Jose Garcia Muñoz
Sorry guys but do you have any news from your end? It will be useful to
know if the problem is because something that I m not doing properly or due
to some bug in the backend...

Thank you!

On Sun, Feb 15, 2015 at 2:04 PM, Jose Garcia Muñoz 
wrote:

>
> Thank you Morten,
>
> Now I called the Sierra Leone API as follows
>
> curl.exe -d @user.json https://apps.dhis2.org/demo/api/users/OYLGMiazHtW
> -H "Content-Type:application/json" -u admin:district -v
>
> the payload is the user profile (as I get with
> https://apps.dhis2.org/demo/api/users/OYLGMiazHtW.json), but adding
> "password":"Mypass10" under userCredentials
>
> userCredentials":{"id":"MZJhAQOrlJ9","name":"Kevin Boateng",
> "password":"Mypass10","code":"boateng","created":"2013-03-11T16:43:05.690+","lastUpdated":"2015-02-15T12:19:45.469+"}
>
> But still I am having the same error...
>
>
>
> On Thu, Feb 12, 2015 at 10:20 AM, Morten Olav Hansen 
> wrote:
>
>> Hi Jose
>>
>> This is partly due to our current implementation of PATCH, and partly due
>> to our somewhat strange User/UserCredentials model.
>>
>> I will not be able to fix this right now, but will try and have a fix in
>> for our 2.19 release (together with proper PATCH support).
>>
>> For now, you can still update the password by sending the FULL payload of
>> the user.
>>
>> --
>> Morten
>>
>> On Thu, Feb 12, 2015 at 12:35 PM, Morten Olav Hansen 
>> wrote:
>>
>>> Hi Jose
>>>
>>> I've been looking at this for a while now, and its not related to PATCH
>>> at all, but there is something weird that is happening with
>>> userCredentials.. I will continue looking into it, and hopefully provide a
>>> fix today
>>>
>>> --
>>> Morten
>>>
>>> On Thu, Feb 12, 2015 at 4:33 AM, Jose Garcia Muñoz 
>>> wrote:
>>>

 Hi again,

 I tried in the Sierra Leone demo, with the following curl command:

 curl.exe -X PATCH -d @c:\file.json -u admin:district "
 https://apps.dhis2.org/demo/api/users/OYLGMiazHtW/userCredentials"; -H
 "Content-Type: application/json"

 with the following payload

 {
  "userCredentials":
  {"password": "Mypass10",
   "id": "HHk49Soqbec",
   "username": "boateng",
   "created": "2014-11-27T18:24:05.888+",
   "lastUpdated": "2015-02-11T11:57:58.116+"}
 }

 I am getting the same error as before. Any ideas? :)

 The only thing I can think of, is the "id": "HHk49Soqbec", I am getting
 this id from the userCredentials of this user, but I don´t know if I need
 to introduce that information or the dates.

 Many thanks
 Jose

 On Wed, Feb 11, 2015 at 5:13 PM, Jose Garcia Muñoz 
 wrote:

>
> Thanks Jason,
>
> but it is still not working. This is the curl command I am using:
>
> curl.exe -X PATCH -d @c:\file.json -u devapp:thepasswd "
> http://localhost:8080/dhis/api/users/zNdlm77vil8/userCredentials"; -H
> "Content-Type: application/json"
>
> And the payload
>
> {
>  "userCredentials":
>  {"password": "newpasswd",
>   "id": "AMuabF1Lrct",
>   "username": "user_name",
>   "created": "2014-11-27T18:24:05.888+",
>   "lastUpdated": "2015-02-11T11:57:58.116+"}
> }
>
> (I don´t know if the dates are necessary or not).
>
> I can try with the Sierra Leone database
>
> What I am getting from the curl is:
>
> {color : black;}HR {color : #525D76;}-->
> Estado HTTP 500 - Request processing failed; nested 
> excepti
> on is java.lang.NullPointerException noshade="noshade">type Informe de Excepci├│nmensaje
>  Request processing failed; nested exception is
> java.lang.NullPointerExceptiondescripci├│n El ser
> vidor encontr├│ un error interno que hizo que no pudiera rellenar este
> requerimiento.excepci├│n org.sp
> ringframework.web.util.NestedServletException: Request processing
> failed; nested exception is java.lang.NullPointerException
>
> org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:978)
>
> org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:839)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
>
> org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
>
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
>
> org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118
> )
>
> org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:8
> 4)
>
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
>
> org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
>

[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 18295: Event analytics, validation

2015-02-17 Thread noreply

revno: 18295
committer: Lars Helge Overland 
branch nick: dhis2
timestamp: Tue 2015-02-17 18:45:07 +0100
message:
  Event analytics, validation
modified:
  
dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/DefaultEventQueryPlanner.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-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/DefaultEventQueryPlanner.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/DefaultEventQueryPlanner.java	2015-02-17 16:50:34 +
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/DefaultEventQueryPlanner.java	2015-02-17 17:45:07 +
@@ -113,6 +113,11 @@
 violation = "Value dimension cannot also be specified as an item or item filter";
 }
 
+if ( params.hasAggregationType() && !params.hasValueDimension() )
+{
+violation = "Value dimension must be specified when aggregation type is specified";
+}
+
 if ( !params.hasPeriods() && ( params.getStartDate() == null || params.getEndDate() == null ) )
 {
 violation = "Start and end date or at least one period must be specified";

___
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 18296: Minor

2015-02-17 Thread noreply

revno: 18296
committer: Lars Helge Overland 
branch nick: dhis2
timestamp: Tue 2015-02-17 18:51:08 +0100
message:
  Minor
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/eventreport/EventReport.java
  
dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/DefaultEventAnalyticsService.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/eventreport/EventReport.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/eventreport/EventReport.java	2015-02-16 14:25:40 +
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/eventreport/EventReport.java	2015-02-17 17:51:08 +
@@ -84,7 +84,7 @@
  * End date.
  */
 private Date endDate;
-
+
 /**
  * Type of data, can be aggregated values and individual cases.
  */

=== 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	2015-02-17 16:50:34 +
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/DefaultEventAnalyticsService.java	2015-02-17 17:51:08 +
@@ -513,6 +513,7 @@
 params.setProgramStage( object.getProgramStage() );
 params.setStartDate( object.getStartDate() );
 params.setEndDate( object.getEndDate() );
+params.setOutputType( object.getOutputType() );
 
 return params;
 }

___
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 18297: ER aggregation types, work in progress.

2015-02-17 Thread noreply
Merge authors:
  Jan Henrik Øverland (janhenrik-overland)

revno: 18297 [merge]
committer: Jan Henrik Overland 
branch nick: dhis2
timestamp: Tue 2015-02-17 20:18:25 +0100
message:
  ER aggregation types, work in progress.
modified:
  
dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-reports/i18n/i18n_app.properties
  
dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-reports/scripts/app.js
  
dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-reports/scripts/core.js
  
dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-reports/styles/style.css


--
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-apps/src/main/webapp/dhis-web-event-reports/i18n/i18n_app.properties'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-reports/i18n/i18n_app.properties	2015-02-16 14:25:40 +
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-reports/i18n/i18n_app.properties	2015-02-17 18:12:44 +
@@ -1,7 +1,4 @@
 dimensions=Dimensions
-row=Row
-column=Column
-filter=Filter
 table_layout=Table layout
 show_totals=Show totals
 show_subtotals=Show sub-totals
@@ -177,3 +174,14 @@
 event=Event
 tracked_entity_instance=Tracked entity instance
 enrollment=Enrollment
+column_dimensions=Column dimensions
+row_dimensions=Row dimensions
+report_filter=Report filter
+average=Average
+count=Count
+sum=Sum
+by_data_element=By data element
+stddev=Std Dev
+variance=Variance
+min=Min
+max=Max

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-reports/scripts/app.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-reports/scripts/app.js	2015-02-16 14:25:40 +
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-reports/scripts/app.js	2015-02-17 19:16:48 +
@@ -1006,7 +1006,9 @@
 fixedFilterStore,
 			filter,
 			filterStore,
+onValueSelect,
 			value,
+aggregationType,
 
 			getStore,
 			getStoreKeys,
@@ -1023,7 +1025,7 @@
 			window,
 
 			margin = 1,
-			defaultWidth = 160,
+			defaultWidth = 200,
 			defaultHeight = 220,
 			maxHeight = (ns.app.viewport.getHeight() - 100) / 2,
 
@@ -1068,6 +1070,27 @@
 		rowStore = getStore();
 fixedFilterStore = getStore();
 filterStore = getStore();
+valueStore = getStore();
+
+// store listeners
+valueStore.on('add', function(store, records) {
+if (!value.getValue()) {
+value.setValue(records[0].data.id);
+}
+});
+
+valueStore.on('remove', function(store, record) {
+if (value.getValue() === record.data.id) {
+value.clearValue();
+}
+
+if (store.getRange().length) {
+var id = store.getRange()[0].data.id;
+
+value.setValue(id);
+onValueSelect(id);
+}
+});
 
 fixedFilterStore.setListHeight = function() {
 var fixedFilterHeight = 26 + (this.getRange().length * 21) + 1;
@@ -1089,7 +1112,7 @@
 height: 25,
 items: {
 	xtype: 'label',
-	text: NS.i18n.column,
+	text: NS.i18n.column_dimensions,
 	cls: 'ns-toolbar-multiselect-leftright-label'
 }
 			},
@@ -1113,7 +1136,7 @@
 			cls: 'ns-toolbar-multiselect-leftright',
 			width: defaultWidth,
 			height: defaultHeight,
-			style: 'margin-bottom:0px',
+			style: 'margin-right:' + margin + 'px; margin-bottom:0px',
 			valueField: 'id',
 			displayField: 'name',
 			dragGroup: 'layoutDD',
@@ -1123,7 +1146,7 @@
 height: 25,
 items: {
 	xtype: 'label',
-	text: NS.i18n.row,
+	text: NS.i18n.row_dimensions,
 	cls: 'ns-toolbar-multiselect-leftright-label'
 }
 			},
@@ -1155,7 +1178,7 @@
 height: 25,
 items: {
 	xtype: 'label',
-	text: NS.i18n.filter,
+	text: NS.i18n.report_filter,
 	cls: 'ns-toolbar-multiselect-leftright-label'
 }
 			},
@@ -1181,7 +1204,6 @@
 			store: filterStore,
 			listeners: {
 afterrender: function(ms) {
-
 	ms.store.on('add', function() {
 		Ext.defer( function() {
 			ms.boundList.getSelectionModel().deselectAll();
@@ -1191,6 +1213,60 @@
 			}
 		});
 
+aggregationType = Ext.create('Ext.form.field.ComboBox', {
+			cls: 'ns-combo h22',
+			width: 80,
+			height: 22,
+			style: 'margin: 0',
+fieldStyle: 'height: 22px',
+			queryMode: 'local',
+			valueField: 'id',
+			editable: false,
+value: 'AVERAGE',
+			store: Ext.create('Ext.data.Store', {
+fields: ['id', 'text'],
+data: [
+	{id: 'AVERAGE', text: NS.i18n.average},
+	{id: 'SUM', text: NS.i18n.sum},
+	{id: 'COUNT', text: NS.i18n.count},
+	{id: 'S

[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 18298: Minor

2015-02-17 Thread noreply

revno: 18298
committer: Lars Helge Overland 
branch nick: dhis2
timestamp: Tue 2015-02-17 20:23:09 +0100
message:
  Minor
modified:
  tools/dhis-adhoc/pom.xml


--
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 'tools/dhis-adhoc/pom.xml'
--- tools/dhis-adhoc/pom.xml	2014-10-02 09:36:06 +
+++ tools/dhis-adhoc/pom.xml	2015-02-17 19:23:09 +
@@ -6,7 +6,7 @@
   
 org.hisp.dhis
 dhis-services
-2.17-SNAPSHOT
+2.19-SNAPSHOT
   
   
   dhis-adhoc

___
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] Completeness in Reporting Rate Summary and Analytics based tools

2015-02-17 Thread Dapo Adejumo
Hi Devs,

The reporting rate summary currently pulls data from tables different from
the analytics which often gives a variance to what is pulled off the
analytics based tools like the pivot table and GIS .

I remember that  dropping the tables used by the reporting rate summary and
replacing with the analytics had been discussed before and was going to be
implemented? Any idea when this will be done? - didn't find in any of the
near future milestones . Hopefully this will also make it  possible to query
timeliness via the analytics tables.

Thanks.

 

...

Regards,

Dapo Adejumo

+2348033683677

Skype : dapojorge

 

___
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 18299: Added adhoc command RandomEventPopulator

2015-02-17 Thread noreply

revno: 18299
committer: Lars Helge Overland 
branch nick: dhis2
timestamp: Tue 2015-02-17 22:39:32 +0100
message:
  Added adhoc command RandomEventPopulator
added:
  
tools/dhis-adhoc/src/main/java/org/hisp/dhis/adhoc/command/RandomEventPopulator.java
modified:
  tools/dhis-adhoc/pom.xml
  tools/dhis-adhoc/src/main/java/org/hisp/dhis/adhoc/RunMe.java
  tools/dhis-adhoc/src/main/resources/META-INF/dhis/beans.xml


--
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 'tools/dhis-adhoc/pom.xml'
--- tools/dhis-adhoc/pom.xml	2015-02-17 19:23:09 +
+++ tools/dhis-adhoc/pom.xml	2015-02-17 21:39:32 +
@@ -27,6 +27,10 @@
 
 
   org.hisp.dhis
+  dhis-service-dxf2
+
+
+  org.hisp.dhis
   dhis-service-reporting
 
 

=== modified file 'tools/dhis-adhoc/src/main/java/org/hisp/dhis/adhoc/RunMe.java'
--- tools/dhis-adhoc/src/main/java/org/hisp/dhis/adhoc/RunMe.java	2014-10-23 07:27:29 +
+++ tools/dhis-adhoc/src/main/java/org/hisp/dhis/adhoc/RunMe.java	2015-02-17 21:39:32 +
@@ -35,7 +35,7 @@
  */
 public static List commands()
 {
-return Arrays.asList( "exampleCommand" );
+return Arrays.asList( "randomEventPopulator" );
 }
 
 public static void main( String[] args )

=== added file 'tools/dhis-adhoc/src/main/java/org/hisp/dhis/adhoc/command/RandomEventPopulator.java'
--- tools/dhis-adhoc/src/main/java/org/hisp/dhis/adhoc/command/RandomEventPopulator.java	1970-01-01 00:00:00 +
+++ tools/dhis-adhoc/src/main/java/org/hisp/dhis/adhoc/command/RandomEventPopulator.java	2015-02-17 21:39:32 +
@@ -0,0 +1,76 @@
+package org.hisp.dhis.adhoc.command;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Random;
+
+import org.hisp.dhis.adhoc.Command;
+import org.hisp.dhis.dxf2.common.ImportOptions;
+import org.hisp.dhis.dxf2.events.event.DataValue;
+import org.hisp.dhis.dxf2.events.event.Event;
+import org.hisp.dhis.dxf2.events.event.EventService;
+import org.hisp.dhis.event.EventStatus;
+import org.hisp.dhis.option.Option;
+import org.hisp.dhis.option.OptionService;
+import org.hisp.dhis.organisationunit.OrganisationUnit;
+import org.hisp.dhis.organisationunit.OrganisationUnitService;
+import org.hisp.dhis.program.ProgramService;
+import org.hisp.dhis.system.util.DateUtils;
+import org.joda.time.DateTime;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+
+public class RandomEventPopulator
+implements Command
+{
+private static final int EVENT_NO = 1000;
+private static final List OPT_GENDER = Arrays.asList( "male", "female" );
+
+@Autowired
+private ProgramService programService;
+
+@Autowired
+private EventService eventService;
+
+@Autowired
+private OptionService optionService;
+
+@Autowired
+private OrganisationUnitService organisationUnitService;
+
+@Override
+@Transactional
+public void execute()
+throws Exception
+{
+List events = new ArrayList();
+
+List modeDischargeOptionSet = optionService.getOptionSet( "iDFPKpFTiVw" ).getOptions();
+List icd10OptionSet = optionService.getOptionSet( "eUZ79clX7y1" ).getOptions();
+List ous = new ArrayList( organisationUnitService.getOrganisationUnitsAtLevel( 4 ) );
+
+for ( int i = 0; i < EVENT_NO; i++ )
+{
+DateTime date = new DateTime( 2015, 1, 1, 12, 5 ).plusDays( new Random().nextInt( 363 ) );
+
+Event event = new Event();
+event.setStatus( EventStatus.COMPLETED );
+event.setProgram( "eBAyeGv0exc" ); // In-patient
+event.setProgramStage( "Zj7UnCAulEk" );
+event.setOrgUnit( ous.get( new Random().nextInt( ous.size() ) ).getUid() );
+event.setEventDate( DateUtils.getLongDateString( date.toDate() ) );
+
+event.getDataValues().add( new DataValue( "qrur9Dvnyt5", String.valueOf( new Random().nextInt( 89 ) ) ) );
+event.getDataValues().add( new DataValue( "oZg33kd9taw", OPT_GENDER.get( new Random().nextInt( 2 ) ) ) );
+event.getDataValues().add( new DataValue( "eMyVanycQSC", DateUtils.getMediumDateString( new DateTime( date ).minusDays( 14 ).toDate() ) ) );
+event.getDataValues().add( new DataValue( "msodh3rEMJa", DateUtils.getMediumDateString( new DateTime( date ).toDate() ) ) );
+event.getDataValues().add( new DataValue( "fWIAEtYVEGk", modeDischargeOptionSet.get( new Random().nextInt( 4 ) ).getCode() ) );
+event.getDataValues().add( new DataValue( "K6uUAvq500H", 

[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 18300: Event analytics, rounding of values, added support for skipRounding parameter

2015-02-17 Thread noreply

revno: 18300
committer: Lars Helge Overland 
branch nick: dhis2
timestamp: Tue 2015-02-17 22:46:41 +0100
message:
  Event analytics, rounding of values, added support for skipRounding parameter
modified:
  
dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/DataQueryParams.java
  
dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/EventAnalyticsService.java
  
dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/EventQueryParams.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
  
dhis-2/dhis-services/dhis-service-analytics/src/test/java/org/hisp/dhis/analytics/event/data/EventAnalyticsServiceTest.java
  
dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/mapping/hibernate/MapLegend.hbm.xml
  
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/EventAnalyticsController.java
  
tools/dhis-adhoc/src/main/java/org/hisp/dhis/adhoc/command/RandomEventPopulator.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-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/DataQueryParams.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/DataQueryParams.java	2015-02-17 16:50:34 +
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/DataQueryParams.java	2015-02-17 21:46:41 +
@@ -121,7 +121,7 @@
 /**
  * Indicates that full precision should be provided for values.
  */
-private boolean skipRounding;
+protected boolean skipRounding;
 
 /**
  * Indicates i) if the names of all ancestors of the organisation units part

=== modified file 'dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/EventAnalyticsService.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/EventAnalyticsService.java	2015-02-17 16:50:34 +
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/EventAnalyticsService.java	2015-02-17 21:46:41 +
@@ -62,6 +62,7 @@
  * @param value the value dimension identifier.
  * @param aggregationType the aggregation type for the value dimension.
  * @param skipMeta whether to skip meta-data in response.
+ * @param skipRounding whether to skip rounding of values in response.
  * @param hierarchyMeta whether to include hierarchy meta-data in the response.
  * @param sortOrder the sort order of the aggregate values.
  * @param limit the max limit of records to return.
@@ -71,7 +72,7 @@
  */
 EventQueryParams getFromUrl( String program, String stage, String startDate, String endDate, 
 Set dimension, Set filter, String value, AggregationType aggregationType, 
-boolean skipMeta, boolean hierarchyMeta, SortOrder sortOrder, Integer limit, 
+boolean skipMeta, boolean skipRounding, boolean hierarchyMeta, SortOrder sortOrder, Integer limit, 
 EventOutputType outputType, DisplayProperty displayProperty, I18nFormat format );
 
 /**

=== modified file 'dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/EventQueryParams.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/EventQueryParams.java	2015-02-17 16:50:34 +
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/EventQueryParams.java	2015-02-17 21:46:41 +
@@ -112,6 +112,7 @@
 params.filters = new ArrayList<>( this.filters );
 params.displayProperty = this.displayProperty;
 params.aggregationType = this.aggregationType;
+params.skipRounding = this.skipRounding;
 
 params.partitions = new Partitions( this.partitions );
 params.periodType = this.periodType;

=== 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	2015-02-17 17:51:08 +
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/event/data/DefaultEventAnalyticsService.java	2015-02-17 21:46:41 +
@@ -344,14 +344,15 @@
 
 @Override
 public EventQueryParams getFromUrl( String program, String stage, String startDate, String endDa

[Dhis2-devs] [Branch ~dhis2-devs-core/dhis2/trunk] Rev 18301: SQL view, regex fix

2015-02-17 Thread noreply

revno: 18301
committer: Lars Helge Overland 
branch nick: dhis2
timestamp: Wed 2015-02-18 00:04:46 +0100
message:
  SQL view, regex fix
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/sqlview/SqlView.java
  
dhis-2/dhis-services/dhis-service-administration/src/test/java/org/hisp/dhis/sqlview/SqlViewServiceTest.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/sqlview/SqlView.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/sqlview/SqlView.java	2015-02-12 19:37:50 +
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/sqlview/SqlView.java	2015-02-17 23:04:46 +
@@ -141,7 +141,7 @@
 
 public static String getProtectedTablesRegex()
 {
-StringBuffer regex = new StringBuffer( "^.*?(" );
+StringBuffer regex = new StringBuffer( "^.*?(\"|'|`|\\s|^)(" );
 
 for ( String table : PROTECTED_TABLES )
 {
@@ -150,12 +150,12 @@
 
 regex.delete( regex.length() - 1, regex.length() );
 
-return regex.append( ").*$" ).toString();
+return regex.append( ")(\"|'|`|\\s|$).*$" ).toString();
 }
 
 public static String getIllegalKeywordsRegex()
 {
-StringBuffer regex = new StringBuffer( "^.*?(" );
+StringBuffer regex = new StringBuffer( "^.*?(\\s|^)(" );
 
 for ( String word : ILLEGAL_KEYWORDS )
 {
@@ -164,7 +164,7 @@
 
 regex.delete( regex.length() - 1, regex.length() );
 
-return regex.append( ").*$" ).toString();
+return regex.append( ")(\\s|$).*$" ).toString();
 }
 
 public SqlView cleanSqlQuery()

=== modified file 'dhis-2/dhis-services/dhis-service-administration/src/test/java/org/hisp/dhis/sqlview/SqlViewServiceTest.java'
--- dhis-2/dhis-services/dhis-service-administration/src/test/java/org/hisp/dhis/sqlview/SqlViewServiceTest.java	2015-02-12 19:37:50 +
+++ dhis-2/dhis-services/dhis-service-administration/src/test/java/org/hisp/dhis/sqlview/SqlViewServiceTest.java	2015-02-17 23:04:46 +
@@ -233,7 +233,7 @@
 @Test( expected = IllegalQueryException.class )
 public void testValidateProtectedTables()
 {
-SqlView sqlView = new SqlView( "Name", "select * from userinfo", true );
+SqlView sqlView = new SqlView( "Name", "select * from userinfo where userinfoid=1", true );
 
 sqlViewService.validateSqlView( sqlView, null, null );
 }
@@ -266,7 +266,7 @@
 }
 
 @Test
-public void testValidateSuccess()
+public void testValidateSuccessA()
 {
 SqlView sqlView = new SqlView( "Name", "select * from dataelement where valueType = '${valueType}'", true );
 
@@ -275,4 +275,12 @@
 
 sqlViewService.validateSqlView( sqlView, null, variables );
 }
+
+@Test
+public void testValidateSuccessB()
+{
+SqlView sqlView = new SqlView( "Name", "select ug.name from usergroup ug where ug.name ~* '^OU\\s(\\w.*)\\sAgency\\s(\\w.*)\\susers$'", false );
+
+sqlViewService.validateSqlView( sqlView, null, null );
+}
 }

___
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 18302: remove unused method

2015-02-17 Thread noreply

revno: 18302
committer: Morten Olav Hansen 
branch nick: dhis2
timestamp: Wed 2015-02-18 09:48:51 +0700
message:
  remove unused method
modified:
  
dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentityattributevalue/TrackedEntityAttributeValue.java
  
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/AbstractCrudController.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/trackedentityattributevalue/TrackedEntityAttributeValue.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentityattributevalue/TrackedEntityAttributeValue.java	2015-01-17 07:41:26 +
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentityattributevalue/TrackedEntityAttributeValue.java	2015-02-18 02:48:51 +
@@ -190,5 +190,4 @@
 {
 this.value = value;
 }
-
 }

=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/AbstractCrudController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/AbstractCrudController.java	2015-02-17 16:50:34 +
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/AbstractCrudController.java	2015-02-18 02:48:51 +
@@ -378,12 +378,6 @@
 }
 
 private RootNode getObjectInternal( String uid, Map parameters,
-List filters, List fields ) throws Exception
-{
-return getObjectInternal( uid, parameters, filters, fields, null );
-}
-
-private RootNode getObjectInternal( String uid, Map parameters,
 List filters, List fields, TranslateOptions translateOptions ) throws Exception
 {
 WebOptions options = new WebOptions( parameters );

___
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 18303: expose TEI attribute values as json/xml

2015-02-17 Thread noreply

revno: 18303
committer: Morten Olav Hansen 
branch nick: dhis2
timestamp: Wed 2015-02-18 09:52:52 +0700
message:
  expose TEI attribute values as json/xml
modified:
  
dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityInstance.java
  
dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentityattributevalue/TrackedEntityAttributeValue.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/trackedentity/TrackedEntityInstance.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityInstance.java	2015-01-17 07:41:26 +
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentity/TrackedEntityInstance.java	2015-02-18 02:52:52 +
@@ -111,6 +111,10 @@
 this.organisationUnit = organisationUnit;
 }
 
+@JsonProperty( "trackedEntityAttributeValues" )
+@JsonView( { DetailedView.class, ExportView.class } )
+@JacksonXmlElementWrapper( localName = "trackedEntityAttributeValues", namespace = DxfNamespaces.DXF_2_0 )
+@JacksonXmlProperty( localName = "trackedEntityAttributeValue", namespace = DxfNamespaces.DXF_2_0 )
 public Set getAttributeValues()
 {
 return attributeValues;
@@ -121,6 +125,10 @@
 this.attributeValues = attributeValues;
 }
 
+@JsonProperty
+@JsonView( { DetailedView.class, ExportView.class } )
+@JacksonXmlElementWrapper( localName = "programInstances", namespace = DxfNamespaces.DXF_2_0 )
+@JacksonXmlProperty( localName = "programInstance", namespace = DxfNamespaces.DXF_2_0 )
 public Set getProgramInstances()
 {
 return programInstances;

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentityattributevalue/TrackedEntityAttributeValue.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentityattributevalue/TrackedEntityAttributeValue.java	2015-02-18 02:48:51 +
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/trackedentityattributevalue/TrackedEntityAttributeValue.java	2015-02-18 02:52:52 +
@@ -28,16 +28,26 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.io.Serializable;
-
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonView;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
+import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
+import org.hisp.dhis.common.BaseIdentifiableObject;
+import org.hisp.dhis.common.DxfNamespaces;
+import org.hisp.dhis.common.view.DetailedView;
+import org.hisp.dhis.common.view.ExportView;
 import org.hisp.dhis.trackedentity.TrackedEntityAttribute;
 import org.hisp.dhis.trackedentity.TrackedEntityInstance;
 
+import java.io.Serializable;
+
 /**
  * TODO index on attribute and instance
- * 
+ *
  * @author Abyot Asalefew
  */
+@JacksonXmlRootElement( localName = "trackedEntityAttributeValue", namespace = DxfNamespaces.DXF_2_0 )
 public class TrackedEntityAttributeValue
 implements Serializable
 {
@@ -161,11 +171,23 @@
 // Getters and setters
 // -
 
+@JsonProperty
+@JsonView( { DetailedView.class, ExportView.class } )
+@JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
 public String getValue()
 {
 return value;
 }
 
+public void setValue( String value )
+{
+this.value = value;
+}
+
+@JsonProperty
+@JsonSerialize( as = BaseIdentifiableObject.class )
+@JsonView( { DetailedView.class, ExportView.class } )
+@JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
 public TrackedEntityAttribute getAttribute()
 {
 return attribute;
@@ -176,6 +198,10 @@
 this.attribute = attribute;
 }
 
+@JsonProperty
+@JsonSerialize( as = BaseIdentifiableObject.class )
+@JsonView( { DetailedView.class, ExportView.class } )
+@JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
 public TrackedEntityInstance getEntityInstance()
 {
 return entityInstance;
@@ -185,9 +211,4 @@
 {
 this.entityInstance = entityInstance;
 }
-
-public void setValue( String value )
-{
-this.value = value;
-}
 }

___
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] Fwd: If-then in indicator formula?

2015-02-17 Thread Knut Staring
Hello Joven,

Please allow me to forward your question to our developer list.

Unfortunately, I don't think the current indicator implementation supports
such conditional expressions, though I've seen this question come up before
and the need for it is certainly there. Maybe this is something that could
be added in the near future, or others may have suggestions on how to work
around this limitation.

You could use the Web API to get the raw data into an HTML report and then
process them in the client, using Javascript. Alternatively, you could also
extract the data, process it using an external script (e.g. Python, R) and
inject the result back into DHIS2 (again preferably using the WebAPI).

Knut

-- Forwarded message --
From: 
Date: Wed, Feb 18, 2015 at 9:18 AM
Subject: If-then in indicator formula?
To: knu...@gmail.com


 Hi Knut!



I hope you’re doing well.  Wherever you are. J



I was wondering if it’s currently possible to do an if-then in the
indicator formula?  I need to be able to count the “Yes”, “Partial” and
“No”-s (from an option set) in one of the datasets that I have.



Thanks in advance.



Regards,

-joven



*Joven Larin*
Informatics Assistant
Health Intelligence and Innovation
Division of Health Sector Development

World Health Organization | Regional Office for the Western Pacific |
Manila, Philippines
Tel: +63 2 5289967 | E-mail: lar...@wpro.who.int | Web:
http://www.wpro.who.int







 --

This message was scanned for viruses with Trend Micro ScanMail, GFI
MailSecurity and GFI MailEssentials by the World Health Organization
Regional Office for the Western Pacific. However, the recipient is advised
to scan this e-mail and any attached files for viruses.

Disclaimer:

This e-mail, together with any attachments, is intended for the named
recipients only and is confidential. It may also be privileged or otherwise
protected by law.

If you have received it in error, please notify the sender immediately by
reply e-mail and delete it and any attachments from your system. You may
not copy or disclose its contents to anyone.
 <#14b9b36440597c73_14b9a95f6db13469_>



-- 
Knut Staring
Dept. of Informatics, University of Oslo
Norway: +4791880522
Skype: knutstar
http://dhis2.org
___
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] Fwd: If-then in indicator formula?

2015-02-17 Thread Abyot Gizaw
Hi,

Forgive me if I fail to see something here.

But I see two things: if-then in Indicators and counting the "Yes",
"Partial", and "No"s

If the intention is on the counting, that for me is a simple aggregation
which the DHIS2 supports. Using options, category and combination of DHIS2
- it is also possible to use the aggregated result in indicators.


---
Thank you,
Abyot.

On Wed, Feb 18, 2015 at 6:45 AM, Knut Staring  wrote:

> Hello Joven,
>
> Please allow me to forward your question to our developer list.
>
> Unfortunately, I don't think the current indicator implementation supports
> such conditional expressions, though I've seen this question come up before
> and the need for it is certainly there. Maybe this is something that could
> be added in the near future, or others may have suggestions on how to work
> around this limitation.
>
> You could use the Web API to get the raw data into an HTML report and then
> process them in the client, using Javascript. Alternatively, you could also
> extract the data, process it using an external script (e.g. Python, R) and
> inject the result back into DHIS2 (again preferably using the WebAPI).
>
> Knut
>
> -- Forwarded message --
> From: 
> Date: Wed, Feb 18, 2015 at 9:18 AM
> Subject: If-then in indicator formula?
> To: knu...@gmail.com
>
>
>  Hi Knut!
>
>
>
> I hope you’re doing well.  Wherever you are. J
>
>
>
> I was wondering if it’s currently possible to do an if-then in the
> indicator formula?  I need to be able to count the “Yes”, “Partial” and
> “No”-s (from an option set) in one of the datasets that I have.
>
>
>
> Thanks in advance.
>
>
>
> Regards,
>
> -joven
>
>
>
> *Joven Larin*
> Informatics Assistant
> Health Intelligence and Innovation
> Division of Health Sector Development
>
> World Health Organization | Regional Office for the Western Pacific |
> Manila, Philippines
> Tel: +63 2 5289967 | E-mail: lar...@wpro.who.int | Web:
> http://www.wpro.who.int
>
>
>
>
>
>
>
>  --
>
> This message was scanned for viruses with Trend Micro ScanMail, GFI
> MailSecurity and GFI MailEssentials by the World Health Organization
> Regional Office for the Western Pacific. However, the recipient is advised
> to scan this e-mail and any attached files for viruses.
>
> Disclaimer:
>
> This e-mail, together with any attachments, is intended for the named
> recipients only and is confidential. It may also be privileged or otherwise
> protected by law.
>
> If you have received it in error, please notify the sender immediately by
> reply e-mail and delete it and any attachments from your system. You may
> not copy or disclose its contents to anyone.
>  <#14b9b390d2e7b5ea_14b9b36440597c73_14b9a95f6db13469_>
>
>
>
> --
> Knut Staring
> Dept. of Informatics, University of Oslo
> Norway: +4791880522
> Skype: knutstar
> http://dhis2.org
>
> ___
> 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] [Dhis2-users] SMS Not finding Users Associated with Phones

2015-02-17 Thread Guy Ekani
hi Ocaya,
Which type of gateway do you use? I raised the same problem last time.
I think M. Long Should help us = EKANI Guy 
 



  

 Le Mardi 17 février 2015 16h13, Ocaya Stephen  a 
écrit :
   

 Hello, I upgraded to 2.18 But seems the SMS functionality in this version 
(Build 18177)  does not get the users associated with the phone. See Logs below 
and Help
* INFO  2015-02-17 18:04:45,962 Login success for user: 'dhis', ip: '127.0.0.1' 
(DefaultUserAuditService.java [http-bio-8080-exec-11])* INFO  2015-02-17 
18:04:46,168 Received SMS: MCD C0 (SmsPublisher.java [Thread-14])* WARN  
2015-02-17 18:04:46,179 Cannot get users with disjoint roles as user does not 
have any user roles (DefaultUserService.java [Thread-14])* ERROR 2015-02-17 
18:04:46,187 org.hisp.dhis.sms.parse.SMSParserException: No user associated 
with this phone number. Please contact your supervisor. 
(SmsPublisher.java[Thread-14])org.hisp.dhis.sms.parse.SMSParserException: No 
user associated with this phone number. Please contact your supervisor.        
at 
org.hisp.dhis.sms.listener.DataValueSMSListener.receive(DataValueSMSListener.java:194)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)        
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)   
     at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)        at 
org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
        at 
org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
        at 
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
        at 
org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
        at 
org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281)
        at 
org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
        at 
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
        at 
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)
        at com.sun.proxy.$Proxy66.receive(Unknown Source)        at 
org.hisp.dhis.sms.SmsPublisher$SMSConsumerThread.fetchAndParseSMS(SmsPublisher.java:119)
        at 
org.hisp.dhis.sms.SmsPublisher$SMSConsumerThread.run(SmsPublisher.java:89)* 
INFO  2015-02-17 18:04:46,189 Sending message OutboundSMS 
[recipients=256788713957, message=DHIS: No user associated with this phone 
number. Please contact your supervisor.] 
(DefaultOutboundSmsTransportService.java [Thread-14])* INFO  2015-02-17 
18:04:46,189 RequestURL: 
http://cvs.rapidsms.org:9090/gw?sender=256788713957&text=DHIS%3A+No+user+associated+with+this+phone+number.+Please+contact+your+supervisor.&username=dhis&password=dHiStwo
 mTrac (SimplisticHttpGetGateWay.java [Thread-14])
Stephen Ocaya--META Project
-- 



You can do anything, but not everything.


___
Mailing list: https://launchpad.net/~dhis2-users
Post to    : dhis2-us...@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-users
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