← Back to team overview

dhis2-users team mailing list archive

Re: Can we select a date range through the Web API

 

To answer your question, in

criteria=Type:Health

Type refers to the column  name, and Health to the filter value. So you
need to make sure that the column name in the URL matches exactly the
column name in the SQL view response. You can find the name in the headers
part of the response.

regards,

Lars




On Tue, Aug 25, 2015 at 6:02 PM, Lars Helge Øverland <larshelge@xxxxxxxxx>
wrote:

> Hi Randy,
>
> this sounds like a good fit for the new sql view variables feature in 2.20:
>
> https://www.dhis2.org/doc/snapshot/en/developer/html/ch01s24.html#d5e3146
>
> You can also use criteria (slightly less performant), see documentation on
> how to define the query + url parameters in the docs:
>
> https://www.dhis2.org/doc/snapshot/en/developer/html/ch01s24.html#d5e3139
>
>
> regards,
>
> Lars
>
>
>
>
> On Tue, Aug 25, 2015 at 5:56 PM, Wilson, Randy <rwilson@xxxxxxx> wrote:
>
>> Hi All,
>>
>> We're trying to synch facility data between DHIS-2 and a new Provider
>> Registry linked to iHRIS using the API.  I've created a SQL view that works
>> nicely to pull all of the data and I am able to filter for exact matches
>> (e.g.).  (I can't seem to get the FRED API to work in version 2.20).
>>
>>
>> https://hmis.moh.gov.rw/hmis/api/sqlViews/LQ83r2JDHKw/data.xml?criteria=Type:Health
>> Center
>>
>> but we would also like to filter by a date range fore example:
>> lastupdated>2015-01-01.  This does not seem to work .... not even sure
>> where to put the > sign, should it be criteria>lastupudated:2015-01-01?
>>
>> Also, have we fixed the issue where Analytics tries to drop and rebuild
>> all resource tables and SQL views before running.  My SQL view refers to
>> _orgunitstructure in order to select only level 6 facilities.  In the past
>> it could not drop _orgunitstructure because it was referred to in a view
>> and analytics failed.
>>
>> Any suggestions?
>>
>> --
>> *Randy Wilson*
>> *Team Leader: **Knowledge Management, Data Use and Research*
>> Rwanda Health System Strengthening Activity
>> Management Sciences for Health
>> Rwanda-Kigali
>> Direct: +250 788308835
>> E-mail: rwilson@xxxxxxx
>> Skype: wilsonrandy_us
>> <http://www.msh.org/>
>> Stronger health systems. Greater health impact.
>> <https://www.facebook.com/ManagementSciencesForHealth>
>> <https://twitter.com/MSHHealthImpact>
>> <https://www.youtube.com/user/MSHHealthImpact>
>> www.msh.org
>>
>> *This message and its attachments are confidential and solely for the
>> intended recipients. If received in error, please delete them and notify
>> the sender via reply e-mail immediately.*
>> _______________________________________________
>> Mailing list: https://launchpad.net/~dhis2-users
>> Post to     : dhis2-users@xxxxxxxxxxxxxxxxxxx
>> Unsubscribe : https://launchpad.net/~dhis2-users
>> More help   : https://help.launchpad.net/ListHelp
>>
>>
>
>
> --
> Lars Helge Øverland
> Lead developer, DHIS 2
> University of Oslo
> Skype: larshelgeoverland
> http://www.dhis2.org <https://www.dhis2.org>
>
>


-- 
Lars Helge Øverland
Lead developer, DHIS 2
University of Oslo
Skype: larshelgeoverland
http://www.dhis2.org <https://www.dhis2.org>

Follow ups

References