Re: [Dhis2-users] Connect to data

2012-05-23 Thread Jason Pickering
The proxy can be rather easily set by setting the curl options with
something like...

curl - getCurlHandle()
curlSetOpt(.opts = list(proxy = 'address:port'), curl = curl)
response- getURL('http://mydhis',..., curl = curl)

Depends a bit on your proxy of course, so you may have to experiment a bit.

Regards,
Jason



On Wed, May 23, 2012 at 7:58 AM, hia...@wpro.who.int wrote:

 Wow, you’ve saved me like a week’s worth of life!



 I’m having proxy issues here at work, but I’ll try it when I get home. I’ll 
 try and get it to work first, then take on the connection issues.



 Thanks!

 Tom



 

 From: Jason Pickering [mailto:jason.p.picker...@gmail.com]
 Sent: 23 May 2012 12:48


 To: Hiatt, Mr Tom (WPRO)
 Cc: larshe...@gmail.com; dhis2-users@lists.launchpad.net

 Subject: Re: [Dhis2-users] Connect to data



 Hi Tom and Lars,



 The following R code will retrieve the data as per Lars example, and place 
 this into  an R data frame. Maybe this will help to get you started.



 Best Regards,

 Jason





 library(RCurl)

 h = basicTextGatherer()

 response-getURL(http://apps.dhis2.org/dev/api/reportTables/data.csv?de=fbfJHSPpUQDde=cYeuwXTCPkUin=Uvn6LCg7dVUou=O6uvpzGd5pulast12Months=true

 ,userpwd=admin:district,httpauth = 1L,

 header=TRUE,headerfunction=h$update)

 #Ugly hack to get ride of the header

 stripme-paste(HTTP/1.1 200 OK\r\n,paste(h$value(NULL)[-1], 
 collapse=),sep=)

 data-gsub(stripme,,response)

 #Unquote the data

 data-noquote(data)

 #here is the data.

 foo-read.table(textConnection(data),sep=,,header=T)





 On Wed, May 23, 2012 at 5:17 AM, hia...@wpro.who.int wrote:

 Thanks, Lars. This is great and very useful! Now I just have to figure out 
 how to have R pass those parameters to the URL and then return the CSV file 
 into R.



 Thanks again,

 Tom





 

 From: Lars Helge Øverland [mailto:larshe...@gmail.com]
 Sent: 23 May 2012 06:03


 To: Hiatt, Mr Tom (WPRO)

 Cc: jason.p.picker...@gmail.com; dhis2-users@lists.launchpad.net


 Subject: Re: [Dhis2-users] Connect to data



 Hi Tom,



 if you refer to aggregated data (from the aggregated* tables) there is a way 
 to do this - unfortunately it is in trunk only and not documented yet - will 
 try a quick explanation here:



 To get the aggregated data you can interact with the reportTables resource. 
 First you need to look up the ids (uids) of the data elements, indicators, 
 org units you need using the api starting here (from the snapshot demo in 
 this example):



 http://apps.dhis2.org/dev/api/resources



 You can then retrieve the data like this :



 http://apps.dhis2.org/dev/api/reportTables/data.xml?de=fbfJHSPpUQDde=cYeuwXTCPkUin=Uvn6LCg7dVUou=O6uvpzGd5pulast12Months=true



 You can substitute .xml with any of .json, .jsonp, .csv, .pdf, 
 .xls, .html.



 You can repeat the de, in and ou query params as many times you want to get 
 data for multiple meta-data objects.



 Valid params for periods are





 reportingMonth

 reportingBimonth

 reportingQuarter

 lastSixMonth

 monthsThisYear

 quartersThisYear

 thisYear

 monthsLastYear

 quartersLastYear

 lastYear

 last5Years

 last12Months

 last6BiMonths

 last4Quarters

 last2SixMonths

 thisFinancialYear

 lastFinancialYear

 last5FinancialYears

 last52Weeks







 Let me know it this helps. Lars





 

 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.







 

 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.

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

[Dhis2-users] How to disable modules in DHIS2

2012-05-23 Thread John Ojo
Dear Lars,

I have an urgent need to disable two modules from our implementation of DHIS2. 
The modules are: 

     'Beneficiaries and Programs' under the Maintenance menu and

     'Named-Based Data Records' under the Services menu.

Please, what do I need to do to achieve this?  I have attached a screenshot 
from the 'About DHIS 2'
We currently use DHIS2 version 2.5 on a Windows platform with MySQL as the 
backend. 


Can the ability to disable modules (that one does not need) be incorporated 
into systems settings in the future?

Thank you so much and looking forward to hearing from you.

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


Re: [Dhis2-users] [Dhis2-devs] How to disable modules in DHIS2

2012-05-23 Thread Knut Staring
John, you can change the permissions for the user role so that users cannot
see those modules.

Sent from my mobile
On May 23, 2012 6:51 PM, John Ojo jn...@yahoo.com wrote:

 Dear Lars,

 I have an urgent need to disable two modules from our implementation of
 DHIS2. The modules are:

  'Beneficiaries and Programs' under the Maintenance menu and

  'Named-Based Data Records' under the Services menu.

 Please, what do I need to do to achieve this?  I have attached a
 screenshot from the 'About DHIS 2'
 We currently use DHIS2 version 2.5 on a Windows platform with MySQL as the
 backend.

 Can the ability to disable modules (that one does not need) be
 incorporated into systems settings in the future?

 Thank you so much and looking forward to hearing from you.

 John
 *
 *
 http://www.corridor-sida.org/

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


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


Re: [Dhis2-users] [Dhis2-devs] How to disable modules in DHIS2

2012-05-23 Thread John Ojo
Knut, this is excellent.
Thank you so much. It worked!
John 




 From: Knut Staring knu...@gmail.com
To: John Ojo jn...@yahoo.com 
Cc: DHIS developers dhis2-d...@lists.launchpad.net; Lars Helge Øverland 
larshe...@gmail.com; dhis1-users dhis2-users@lists.launchpad.net 
Sent: Wednesday, May 23, 2012 6:06 PM
Subject: Re: [Dhis2-devs] How to disable modules in DHIS2
 

John, you can change the permissions for the user role so that users cannot see 
those modules. 
Sent from my mobile
On May 23, 2012 6:51 PM, John Ojo jn...@yahoo.com wrote:

Dear Lars,


I have an urgent need to disable two modules from our implementation of DHIS2. 
The modules are: 


     'Beneficiaries and Programs' under the Maintenance menu and


     'Named-Based Data Records' under the Services menu.


Please, what do I need to do to achieve this?  I have attached a screenshot 
from the 'About DHIS 2'
We currently use DHIS2 version 2.5 on a Windows platform with MySQL as the 
backend. 



Can the ability to disable modules (that one does not need) be incorporated 
into systems settings in the future?


Thank you so much and looking forward to hearing from you.


John 


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

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