Editing the code in the option sets

Hi guys,

When update the DHIS2 version to 2.17, the new ‘code’ field in optionsets is filled with the value of the name. However, we find out that sometimes the name was wrong introduced by the users, so we would need to change it. Right now we can not change the code for optionsets, do you have in mind to allow that? (we can certainly change the name, but it is going to be quite confused to have the code not synchronized with the name)

In the event reports, the results are being filtered by its name (no with the code), right?

Thank you

Jose

Following with this thread…

I have tested changing the name of the option sets…

We had the following option ‘4A03 - Meidy Mazariegos’ in the 2.16, when we upgrade to the 2.17 the name and the code of the option were filled both with the same text ‘4A03 - Meidy Mazariegos’. However, we realized that there were some mistakes in the data entry, so we need to change the text of the option. As it is not possible to change the code right now, we had to change just the name value (as showed in the next figure). So first question, is it going to be possible to edit the code in the coming future?

image

The next figure represents a data entry screen capture… (please note that in fact the value of the option appears updated)

image

However, after running the analytics, in the event reports we are getting:

image

So it is taking the code not the text. However, doesn’t it make more sense showing the text instead? (or least let the user choose?)

Any thoughts on this? This is quite urgent for us as we have many cases in which we have to change the text of different options. Right now it seems it is not possible to show those changes in the reports.

Many thanks

Jose

···

On Thu, Feb 19, 2015 at 1:06 PM, Jose Garcia Muñoz josemp10@gmail.com wrote:

Hi guys,

When update the DHIS2 version to 2.17, the new ‘code’ field in optionsets is filled with the value of the name. However, we find out that sometimes the name was wrong introduced by the users, so we would need to change it. Right now we can not change the code for optionsets, do you have in mind to allow that? (we can certainly change the name, but it is going to be quite confused to have the code not synchronized with the name)

In the event reports, the results are being filtered by its name (no with the code), right?

Thank you

Jose

Hi Jose

I tested this in DEV, where we have options that have a code that is different than the text. I changed the value of one option and checked the result in an event report, I kept getting the old text until I cleared the server cache.

Best regards,

JM

···

On Thu, Feb 19, 2015 at 1:06 PM, Jose Garcia Muñoz josemp10@gmail.com wrote:

Hi guys,

When update the DHIS2 version to 2.17, the new ‘code’ field in optionsets is filled with the value of the name. However, we find out that sometimes the name was wrong introduced by the users, so we would need to change it. Right now we can not change the code for optionsets, do you have in mind to allow that? (we can certainly change the name, but it is going to be quite confused to have the code not synchronized with the name)

In the event reports, the results are being filtered by its name (no with the code), right?

Thank you

Jose

Hi Juan,

yes you are right. It was the cache! :slight_smile: So, yep, it is getting the name of the optionsets. Thank you!

Dhis2 devs, is it going to be possible to edit the codes as well?

Thanks

···

On Tue, Feb 24, 2015 at 4:44 AM, Juan Manuel Alcantara Acosta jmalcantara1@gmail.com wrote:

Hi Jose
I tested this in DEV, where we have options that have a code that is different than the text. I changed the value of one option and checked the result in an event report, I kept getting the old text until I cleared the server cache.

Best regards,

JM

El 23/02/2015, a las 17:31, Jose Garcia Muñoz josemp10@gmail.com escribió:

Following with this thread…

I have tested changing the name of the option sets…

We had the following option ‘4A03 - Meidy Mazariegos’ in the 2.16, when we upgrade to the 2.17 the name and the code of the option were filled both with the same text ‘4A03 - Meidy Mazariegos’. However, we realized that there were some mistakes in the data entry, so we need to change the text of the option. As it is not possible to change the code right now, we had to change just the name value (as showed in the next figure). So first question, is it going to be possible to edit the code in the coming future?

<image.png>

The next figure represents a data entry screen capture… (please note that in fact the value of the option appears updated)

<image.png>

However, after running the analytics, in the event reports we are getting:

<image.png>

So it is taking the code not the text. However, doesn’t it make more sense showing the text instead? (or least let the user choose?)

Any thoughts on this? This is quite urgent for us as we have many cases in which we have to change the text of different options. Right now it seems it is not possible to show those changes in the reports.

Many thanks

Jose


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

On Thu, Feb 19, 2015 at 1:06 PM, Jose Garcia Muñoz josemp10@gmail.com wrote:

Hi guys,

When update the DHIS2 version to 2.17, the new ‘code’ field in optionsets is filled with the value of the name. However, we find out that sometimes the name was wrong introduced by the users, so we would need to change it. Right now we can not change the code for optionsets, do you have in mind to allow that? (we can certainly change the name, but it is going to be quite confused to have the code not synchronized with the name)

In the event reports, the results are being filtered by its name (no with the code), right?

Thank you

Jose

Hi Jose,

we actually don't plan to allow this.

As you said, earlier we use name both as the saved value in the database
and the display property. This did not work out so well, since people
wanted to have multiple names pointing to the same database value (code),
translation of names, be able to change the name after you had captured
data and so on. So we introduced a code. The only viable automatic upgrade
path was to set code = name.

The reason for not allowing edits to codes is that data which is already
captured using that code will the "disappear".

Now the way to do this is through SQL directly against the database. First
you change the code, then you change existing data values in the database
to match the new code. This requires some care not to mess things up;) I am
sure we can help you with this.

regards,

Lars