← Back to team overview

dhis2-devs team mailing list archive

Re: API to get dataset section order

 

This have now been added to trunk

--
Morten

On Wed, Mar 18, 2015 at 6:18 PM, Mahendra Kariya <
mahendra.kariya@xxxxxxxxxxxxxxxx> wrote:

> Hi Lars,
>
> Thanks for the info. We noticed that the dataset.sections array is ordered
> as per sections sort order. What we are looking for is a separate field in
> section object.
>
> Let me clarify the requirements. While POSTing sections to /api/metadata,
> we want to post the sortOrder of the section and while GETting, we expect
> that field to be returned. So, the payload should look something like this.
>
> {
>   "sections": [
>     {
>       "id": "d1a1ws2ffc5",
>       "sortOrder": 5,
>       "name": "Admission",
>       "dataElements": [
>         {
>           "name": "New admission",
>           "id": "o7yh2f63b02"
>         }
>       ],
>       "dataSet": {
>         "id": "c03bwsa0e1a",
>         "name": "Admission Service"
>       }
>     }
>   ]
> }
>
>
>
> Thanks,
> Mahendra
>
> On Wed, Mar 18, 2015 at 4:14 PM, Lars Helge Øverland <larshelge@xxxxxxxxx>
> wrote:
>
>> Hi Mahendra,
>>
>> you should be able to get this by navigating the API to the data set,
>> then further to its sections.
>>
>> E.g. this could work, sections are listed in the json array in correct
>> order:
>>
>>
>> https://apps.dhis2.org/demo/api/dataSets/QX4ZTUbOt3a.json?fields=id,name,sections
>>
>>
>> regards,
>>
>> Lars
>>
>> On Wed, Mar 18, 2015 at 7:00 AM, Mahendra Kariya <
>> mahendra.kariya@xxxxxxxxxxxxxxxx> wrote:
>>
>>> Hi,
>>>
>>> We want to get the sort order of dataset sections.
>>>
>>> We tried /api/sections, but there is no such information.
>>>
>>> We also tried /api/dataSets. The only related information we have is the
>>> ordering in the dataset.sections array.
>>>
>>> What we are looking for is an explicit field which has the sort order of
>>> sections. Is there any API to get this info?
>>>
>>>
>>>
>>> Thanks,
>>> Mahendra
>>>
>>
>>
>

References