dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #38904
Re: API Datavalue Question
Thanks Knut,
That sounds like a great option! I fear, in this case, it may not help as
this instance is running 2.17, I think that parameterized SQL View was
introduced in 2.19 (please correct me though)? For instances on 2.19 and
above though, that sounds like it would be perfect.
Without this approach, am I stuck using SQL to get all the datavalues
associated with a particular OU (without knowing where exactly all of them
are)?
Timothy Harding
RPCV Vanuatu
Skype: hardingt@xxxxxxxxx
+1 (541) 632-6623
On Wed, Aug 12, 2015 at 7:03 AM, Knut Staring <knutst@xxxxxxxxx> wrote:
> You could do a mix of those approaches - create a parametrised SQL view
> that is available through the API.
>
> On Wed, Aug 12, 2015 at 3:33 PM, Timothy Harding <hardingt@xxxxxxxxx>
> wrote:
>
>> Hello Dev Group,
>>
>> Is it possible to get all the datavalues associated with an OU out of the
>> API?
>>
>> I'm getting the need more and more to remove org units which will
>> randomly have dependencies. I know the official position of DHIS2 is "don't
>> ever remove org units" but I'm embarking on this quest all the same :).
>>
>> So, I'm wondering about data values today. I started here:
>>
>>
>> https://www.dhis2.org/doc/snapshot/en/developer/html/dhis2_developer_manual_full.html#d5232e1433
>>
>> There is a phrase:
>> "The following query parameters are required" and a giant table, but even
>> the examples don't use more than 3 of the parameters from the table.
>>
>> I tried:
>> api/dataValueSets?orgUnit="KQfLafniynG"
>>
>> but received an error:
>> "Required Set parameter 'dataSet' is not present"
>>
>> What if the there are many, many datasets to go through, or the
>> dataelement/datavalue in question is no longer associated with a dataset?
>>
>> In the meantime, I will probably need to crack open PgAdmin to get this
>> done, but I prefer to use the API if I can. Thanks!
>>
>>
>> Timothy Harding
>> RPCV Vanuatu
>> Skype: hardingt@xxxxxxxxx
>> +1 (541) 632-6623
>>
>> _______________________________________________
>> Mailing list: https://launchpad.net/~dhis2-devs
>> Post to : dhis2-devs@xxxxxxxxxxxxxxxxxxx
>> Unsubscribe : https://launchpad.net/~dhis2-devs
>> More help : https://help.launchpad.net/ListHelp
>>
>>
>
>
> --
> Knut Staring
> Dept. of Informatics, University of Oslo
> Norway: +4791880522
> Skype: knutstar
> http://dhis2.org
>
Follow ups
References