Failure to update 'preferred' field for a patient's address

Hi guys, we are working on the Obsadmin owa and one of the features is to enable updating of a patient’s address. We have realised that a POST request to the /person/{parent-uuid}/attribute/{uuid} endpoint manages to update all the other fields but fails to update the preferred field which indicates a patient’s preferred address.

Can anyone help us get around this? Thanks. -Jackson

The patient must have a preferred address, so just changing the preferred address to preferred=false shouldn’t really work.

Maybe the way to do this is to set some other address to preferred=true? (I don’t know if this will work either, give it a try.)

2 Likes

Thanks @darius, I had previously tried that with three addresses, one of them being preferred, it still did not change to make another address preferred.

1 Like

This may be a bug in the REST API then. Please create a ticket for this, describing the expected behavior and giving steps to reproduce on some public OpenMRS server.

-Darius (by phone)

1 Like

I will do that. cc @dkayiwa

1 Like

Ticket raised: https://issues.openmrs.org/browse/RESTWS-677 @darius @dkayiwa

1 Like

Hello,

I’m sorry to re-open this issue after 7 years but today I ran with this issue but just trying to update the name of a person. With the addresses works correctly, but not with names. The issue says that is solved for names, but I could not change the preferred to true of a new name or update an existing one. With addresses if I change to true one address the previous preferred change automatically to false. This behavior does not happen with the names.

I reopened the issue in JIRA. As I’m not an expert in these systems I hope I’ve done it correctly.

Thank you.