dhis2-users team mailing list archive
-
dhis2-users team
-
Mailing list archive
-
Message #12436
Re: Option Set - Update an option code
Hi Archana,
Thanks so much - this will work excellent for the first part of what I'm
trying to achieve.
Are you aware if using a put request and an updated JSON payload would
allow for option code updates?
(I'll test and let you know). I'm concerned as via the UI the option code
is grayed out and unavailable for updating.
I could avoid all this and potentially use the PK id of the item entry in
the eLIMS item table, however its 32-bit hex - given event charts display
the option code when the dataelements charted employ option sets, this
won't work either.
Thanks,
Kevin
On Wed, Feb 1, 2017 at 1:13 PM, Archana Chillala <archanac@xxxxxxxxxxxxxxxx>
wrote:
> Hi Kevin,
>
> You could use the optionSets API as follows, with required fields:
>
> http://localhost:8080/api/optionSets/<id>.json?fields=
> id,name,displayName,options[id,name,code]
>
>
> Here, for a given option Set ID, the required fields are fetched.
>
>
>
>
> Archana Chillala
> Application Developer
> Email archanac@xxxxxxxxxxxxxxxx
> Telephone +91 9100960533 <+91+9100960533>
> [image: ThoughtWorks]
> <http://www.thoughtworks.com/?utm_campaign=archana-chillala-signature&utm_medium=email&utm_source=thoughtworks-email-signature-generator>
>
> On Wed, Feb 1, 2017 at 10:46 AM, Kevin Bolger <kevin.bolger@xxxxxxxxx>
> wrote:
>
>> Hi Folks,
>>
>> I'm trying to build out some scripts to help with meta-data maintenance
>> and integrity between DHIS2 and a separate eLMIS system that I'm
>> integrating data from, into DHIS2.
>>
>> A tracker dataelement I created to handle stock items uses an option set,
>> each option being and product item from the eLMIS. The eLMIS items use a
>> unique code and item name combination which are aligned with the option
>> set's options, names and codes. A potential issue is that these item names
>> and codes can be updated on the eLIMS side.
>>
>> Is there any API feature I could use to regularly get a list of the
>> options names and codes from the option set?
>> I could then compare these to the eLMIS entries via an external matching
>> or translation list.....if I find an update on the eLIMS side I would then
>> want to update the code or name on the DHIS2 option while maintaining the
>> integrity of any existing events in DHIS2 using that option.
>>
>> Happy to explain it further with a detailed example if required.
>>
>> Many thanks,
>> Kevin
>>
>> _______________________________________________
>> 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
>>
>>
>
References