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:[email protected]]
Sent: 23 May 2012 06:03
To: Hiatt, Mr Tom (WPRO)
Cc: [email protected]; [email protected]
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=fbfJHSPpUQD&de=cYeuwXTCPkU&in=Uvn6LCg7dVU&ou=O6uvpzGd5pu&last12Months=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.

_______________________________________________
Mailing list: https://launchpad.net/~dhis2-users
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~dhis2-users
More help   : https://help.launchpad.net/ListHelp

Reply via email to