Optionset api not returning the name and code v2.26

Hi

We have a dropdown list of comment options linked to the dataelements as option set comments but the drop down populates as undefined.

Upon checking the api (/api/optionSets/) to confirm what is returned, I see it only returns the id not the other values.

this is what is returned in v2.26:

options:

[

  • {

    • id: “AMrXb7wAiKV”

    },

  • {

    • id: “yCLGIfdYbQ4”

    },

this is what is returned in v2.20:

options:

[

  • {

    • id: “AMrXb7wAiKV”,

    • name: “#{1} No evidence”,

    • code: “#{1} No evidence”,

    • created: “2015-03-09T19:33:15.000+0000”,

    • lastUpdated: “2015-03-09T19:33:15.000+0000”,

    • href: “url …”

    },

  • {

    • id: “yCLGIfdYbQ4”,

    • name: “#{2} Evidence not valid/irrelevant”,

    • code: “#{2} Evidence not valid/irrelevant”,

    • created: “2015-03-09T19:33:15.000+0000”,

    • lastUpdated: “2015-03-09T19:33:15.000+0000”,

    • href: “url …”

    },

Is there a script that was neglected in the upgrade process or some other setting that needs to be changed?

Regards

Pooben

This message and any attachments are subject to a disclaimer published at http://www.hisp.org/policies.html#comms_disclaimer. Please read the disclaimer before opening any attachment or taking any other action in terms of this electronic transmission. If you cannot access the disclaimer, kindly send an email to disclaimer@hisp.org and a copy will be provided to you. By replying to this e-mail or opening any attachment you agree to be bound by the provisions of the disclaimer.

Hi Pooben

Yes, this was changed some time back. Please have a look at our field filter docs [1]. For collections list this, the default field filter is just the id, but you can easily get more by doing options[:all] or by being more specific options[id,displayName].

[1] https://docs.dhis2.org/master/en/developer/html/webapi_metadata_field_filter.html

···

On Thu, Jun 15, 2017 at 2:28 PM, Pooben Dass pooben@hisp.org wrote:

Hi

We have a dropdown list of comment options linked to the dataelements as option set comments but the drop down populates as undefined.

Upon checking the api (/api/optionSets/) to confirm what is returned, I see it only returns the id not the other values.

this is what is returned in v2.26:

options:

[

  • {
    • id: “AMrXb7wAiKV”

},

  • {
    • id: “yCLGIfdYbQ4”

},

this is what is returned in v2.20:

options:

[

  • {
    • id: “AMrXb7wAiKV”,
  • name: “#{1} No evidence”,
  • code: “#{1} No evidence”,
  • created: “2015-03-09T19:33:15.000+0000”,
  • lastUpdated: “2015-03-09T19:33:15.000+0000”,
  • href: “url …”

},

  • {
    • id: “yCLGIfdYbQ4”,
  • name: “#{2} Evidence not valid/irrelevant”,
  • code: “#{2} Evidence not valid/irrelevant”,
  • created: “2015-03-09T19:33:15.000+0000”,
  • lastUpdated: “2015-03-09T19:33:15.000+0000”,
  • href: “url …”

},

Is there a script that was neglected in the upgrade process or some other setting that needs to be changed?

Regards

Pooben

This message and any attachments are subject to a disclaimer published at http://www.hisp.org/policies.html#comms_disclaimer. Please read the disclaimer before opening any attachment or taking any other action in terms of this electronic transmission. If you cannot access the disclaimer, kindly send an email to disclaimer@hisp.org and a copy will be provided to you. By replying to this e-mail or opening any attachment you agree to be bound by the provisions of the disclaimer.


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

Hi Morton

Thanks for the update but the issue is happening when I try to add a comment on the DataEntry form.(I used the api call to confirm the response)

.

From what you saying then this needs to be changed on the from.js on the DataEntry in this piece of the code from line 3040

/**

  • Retrieves options from server. Provides result as jquery ui structure to the

  • given jquery ui success callback.

*/

dhis2.de.getOptions = function( uid, query, success )

{

return $.ajax( {

url: ‘…/api/optionSets/’ + uid + ‘.json?links=false&q=’ + query,

dataType: “json”,

cache: false,

type: ‘GET’,

success: function ( data ) {

success( $.map( data.options, function ( item ) {

return {

label: item.name,

id: item.code

};

} ) );

}

} );

Regards

Pooben

This message and any attachments are subject to a disclaimer published at http://www.hisp.org/policies.html#comms_disclaimer. Please read the disclaimer before opening any attachment or taking any other action in terms of this electronic transmission. If you cannot access the disclaimer, kindly send an email to disclaimer@hisp.org and a copy will be provided to you. By replying to this e-mail or opening any attachment you agree to be bound by the provisions of the disclaimer.

···

On Thu, Jun 15, 2017 at 9:39 AM, Morten Olav Hansen morten@dhis2.org wrote:

Hi Pooben

Yes, this was changed some time back. Please have a look at our field filter docs [1]. For collections list this, the default field filter is just the id, but you can easily get more by doing options[:all] or by being more specific options[id,displayName].

[1] https://docs.dhis2.org/master/en/developer/html/webapi_metadata_field_filter.html

Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

On Thu, Jun 15, 2017 at 2:28 PM, Pooben Dass pooben@hisp.org wrote:

Hi

We have a dropdown list of comment options linked to the dataelements as option set comments but the drop down populates as undefined.

Upon checking the api (/api/optionSets/) to confirm what is returned, I see it only returns the id not the other values.

this is what is returned in v2.26:

options:

[

  • {
    • id: “AMrXb7wAiKV”

},

  • {
    • id: “yCLGIfdYbQ4”

},

this is what is returned in v2.20:

options:

[

  • {
    • id: “AMrXb7wAiKV”,
  • name: “#{1} No evidence”,
  • code: “#{1} No evidence”,
  • created: “2015-03-09T19:33:15.000+0000”,
  • lastUpdated: “2015-03-09T19:33:15.000+0000”,
  • href: “url …”

},

  • {
    • id: “yCLGIfdYbQ4”,
  • name: “#{2} Evidence not valid/irrelevant”,
  • code: “#{2} Evidence not valid/irrelevant”,
  • created: “2015-03-09T19:33:15.000+0000”,
  • lastUpdated: “2015-03-09T19:33:15.000+0000”,
  • href: “url …”

},

Is there a script that was neglected in the upgrade process or some other setting that needs to be changed?

Regards

Pooben

This message and any attachments are subject to a disclaimer published at http://www.hisp.org/policies.html#comms_disclaimer. Please read the disclaimer before opening any attachment or taking any other action in terms of this electronic transmission. If you cannot access the disclaimer, kindly send an email to disclaimer@hisp.org and a copy will be provided to you. By replying to this e-mail or opening any attachment you agree to be bound by the provisions of the disclaimer.


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Hi Morten,

Do you mean the comments dialog in data entry is not doing correctly the call to the API? I tested this in 2.25 build c12aa62 and the dropdown is not populated with the options form the option set.

JM

···

On Thu, Jun 15, 2017 at 2:28 PM, Pooben Dass pooben@hisp.org wrote:

Hi

We have a dropdown list of comment options linked to the dataelements as option set comments but the drop down populates as undefined.

Upon checking the api (/api/optionSets/) to confirm what is returned, I see it only returns the id not the other values.

this is what is returned in v2.26:

options:

[

  • {
    • id: “AMrXb7wAiKV”

},

  • {
    • id: “yCLGIfdYbQ4”

},

this is what is returned in v2.20:

options:

[

  • {
    • id: “AMrXb7wAiKV”,
  • name: “#{1} No evidence”,
  • code: “#{1} No evidence”,
  • created: “2015-03-09T19:33:15.000+0000”,
  • lastUpdated: “2015-03-09T19:33:15.000+0000”,
  • href: “url …”

},

  • {
    • id: “yCLGIfdYbQ4”,
  • name: “#{2} Evidence not valid/irrelevant”,
  • code: “#{2} Evidence not valid/irrelevant”,
  • created: “2015-03-09T19:33:15.000+0000”,
  • lastUpdated: “2015-03-09T19:33:15.000+0000”,
  • href: “url …”

},

Is there a script that was neglected in the upgrade process or some other setting that needs to be changed?

Regards

Pooben

This message and any attachments are subject to a disclaimer published at http://www.hisp.org/policies.html#comms_disclaimer. Please read the disclaimer before opening any attachment or taking any other action in terms of this electronic transmission. If you cannot access the disclaimer, kindly send an email to disclaimer@hisp.org and a copy will be provided to you. By replying to this e-mail or opening any attachment you agree to be bound by the provisions of the disclaimer.


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

No. I was talking from the web-api side of things. If the comments are not showing up in data entry, please report an issue and we will look into it soon (seems like Pooben is pointing in the right direction)

···

On Thu, Jun 15, 2017 at 3:14 PM, JM Alcantara jmalcantara1@gmail.com wrote:

Hi Morten,
Do you mean the comments dialog in data entry is not doing correctly the call to the API? I tested this in 2.25 build c12aa62 and the dropdown is not populated with the options form the option set.

JM

El 15/06/2017, a las 02:39, Morten Olav Hansen morten@dhis2.org escribió:

Hi Pooben

Yes, this was changed some time back. Please have a look at our field filter docs [1]. For collections list this, the default field filter is just the id, but you can easily get more by doing options[:all] or by being more specific options[id,displayName].

[1] https://docs.dhis2.org/master/en/developer/html/webapi_metadata_field_filter.html


Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help : https://help.launchpad.net/ListHelp

Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

On Thu, Jun 15, 2017 at 2:28 PM, Pooben Dass pooben@hisp.org wrote:

Hi

We have a dropdown list of comment options linked to the dataelements as option set comments but the drop down populates as undefined.

Upon checking the api (/api/optionSets/) to confirm what is returned, I see it only returns the id not the other values.

this is what is returned in v2.26:

options:

[

  • {
    • id: “AMrXb7wAiKV”

},

  • {
    • id: “yCLGIfdYbQ4”

},

this is what is returned in v2.20:

options:

[

  • {
    • id: “AMrXb7wAiKV”,
  • name: “#{1} No evidence”,
  • code: “#{1} No evidence”,
  • created: “2015-03-09T19:33:15.000+0000”,
  • lastUpdated: “2015-03-09T19:33:15.000+0000”,
  • href: “url …”

},

  • {
    • id: “yCLGIfdYbQ4”,
  • name: “#{2} Evidence not valid/irrelevant”,
  • code: “#{2} Evidence not valid/irrelevant”,
  • created: “2015-03-09T19:33:15.000+0000”,
  • lastUpdated: “2015-03-09T19:33:15.000+0000”,
  • href: “url …”

},

Is there a script that was neglected in the upgrade process or some other setting that needs to be changed?

Regards

Pooben

This message and any attachments are subject to a disclaimer published at http://www.hisp.org/policies.html#comms_disclaimer. Please read the disclaimer before opening any attachment or taking any other action in terms of this electronic transmission. If you cannot access the disclaimer, kindly send an email to disclaimer@hisp.org and a copy will be provided to you. By replying to this e-mail or opening any attachment you agree to be bound by the provisions of the disclaimer.


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp