← Back to team overview

dhis2-users team mailing list archive

Re: Web API to get options for a specific optionSet

 

Dear all
I am one of the DHIS2 user I need to

Using the DHIS2 source code and API develop an Android app with the following features:

·         A standalone application for collecting data and analyzing data of one single health facility.

·         Be connected to DHIS2 backend.

·         Forms and user interfaces for data collection and data entry.

·         Support offline data entry.

·         Store data locally when there is no network connection to the server and synchronize with the Server when connected.

·         Provide instant reports off of the data entered offline.

·         Provide a dashboard that provides real time reports from DHIS2 server.

·         Provide analytic reporting of the data for the health facility.
The app is bound to a single facility. Its data is sent out to a centralized DHIS2 Server where all the data across facilities are stored. Reporting and   analytics of all facilities are done on the centralized DHIS2 database.

Pleas assesse me in this regards

Thanks

Azimi

From: Dhis2-users [mailto:dhis2-users-bounces+mahmood.azimi=jhpiego.org@xxxxxxxxxxxxxxxxxxx] On Behalf Of Knut Staring
Sent: Sunday, April 17, 2016 1:05 AM
To: Iuri Fanti <iuri.fanti@xxxxxxxxx>
Cc: dhis1-users <dhis2-users@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Dhis2-users] Web API to get options for a specific optionSet

You can first add a new option by creating a simple file like this, which I called 100years.json:

{
"name": "Over 100"
}

Then add it:
curl -d @100years.json "https://play.dhis2.org/demo/api/options"; -X POST -H "Content-Type: application/json" -u admin:district

Then add the new option to the optionSet:
curl  "https://play.dhis2.org/demo/api/optionSets/VQ2lai3OfVG/options/UVBgmarFGFb"; -X POST -H "Content-Type: application/json" -u admin:district

Finally, inspect the optionSet. It should now have 5 members instead of 4:
https://play.dhis2.org/demo/api/optionSets/VQ2lai3OfVG.json?fields=name,options[:all]<https://play.dhis2.org/demo/api/optionSets/VQ2lai3OfVG.json?fields=name,options%5b:all%5d>



On Sat, Apr 16, 2016 at 9:51 PM, Knut Staring <knutst@xxxxxxxxx<mailto:knutst@xxxxxxxxx>> wrote:
Hi Luri,

Please see section 1.10.4. Adding and removing objects to/from collections here:

http://dhis2.github.io/dhis2-docs/master/en/developer/html/ch01s10.html

Knut

On Sat, Apr 16, 2016 at 2:37 AM, Iuri Fanti <iuri.fanti@xxxxxxxxx<mailto:iuri.fanti@xxxxxxxxx>> wrote:
And what if I needed to put/create a specific option into a specific optionSet?

2016-04-15 19:46 GMT+02:00 Iuri Fanti <iuri.fanti@xxxxxxxxx<mailto:iuri.fanti@xxxxxxxxx>>:
> Great Knut, it's exactly what I needed! :)
>
> Thank you so much!
>
> Iuri
>
> 2016-04-15 19:28 GMT+02:00 Knut Staring <knutst@xxxxxxxxx<mailto:knutst@xxxxxxxxx>>:
>> Something along these lines?
>>
>> https://play.dhis2.org/demo/api/optionSets/VQ2lai3OfVG.json?fields=name,options[:all]<https://play.dhis2.org/demo/api/optionSets/VQ2lai3OfVG.json?fields=name,options%5b:all%5d>
>>
>> On Fri, Apr 15, 2016 at 7:15 PM, Iuri Fanti <iuri.fanti@xxxxxxxxx<mailto:iuri.fanti@xxxxxxxxx>> wrote:
>>>
>>> Hi all,
>>>
>>> is there a Web API call to get the option values for a specific
>>> optionSet? I have a lot of option values, and it's not reasonable to
>>> download all of them. I need to filter by the parent optionSet,
>>> somehow. Is it possibile?
>>>
>>> Thanks,
>>>
>>> Iuri
>>>
>>> --
>>> @-`-,--
>>>
>>> _______________________________________________
>>> Mailing list: https://launchpad.net/~dhis2-users
>>> Post to     : dhis2-users@xxxxxxxxxxxxxxxxxxx<mailto:dhis2-users@xxxxxxxxxxxxxxxxxxx>
>>> Unsubscribe : https://launchpad.net/~dhis2-users
>>> More help   : https://help.launchpad.net/ListHelp
>>
>>
>>
>>
>> --
>> Knut Staring
>> Dept. of Informatics, University of Oslo
>> Norway: +4791880522<tel:%2B4791880522>
>> Skype: knutstar
>> http://dhis2.org
>
>
>
> --
> @-`-,--



--
@-`-,--

_______________________________________________
Mailing list: https://launchpad.net/~dhis2-users
Post to     : dhis2-users@xxxxxxxxxxxxxxxxxxx<mailto:dhis2-users@xxxxxxxxxxxxxxxxxxx>
Unsubscribe : https://launchpad.net/~dhis2-users
More help   : https://help.launchpad.net/ListHelp



--
Knut Staring
Dept. of Informatics, University of Oslo
Norway: +4791880522<tel:%2B4791880522>
Skype: knutstar
http://dhis2.org



--
Knut Staring
Dept. of Informatics, University of Oslo
Norway: +4791880522
Skype: knutstar
http://dhis2.org

Follow ups

References