How to include retired/ deleted identifiers?

Hey Everyone,

I have been trying to retrieve soft deleted identifiers which is currently working on the legacy model. I found information in the snippet below on the wiki, but this is not working as I still get only for those whose voided=false.

Including Retired and Deleted data A normal REST query will not include Retired metadata or Deleted/Voided data. You may send an includeAll=true query parameter to include retired/deleted data.

Can you give more details of what you are exactly doing? For instance, if you are making a REST call, can you share the url, together with the parameters you send if any? Being able to reproduce it on a public server like qa-refapp.openmrs.org will even go a long way in helping us see what is going on.

Using the api endpoint below for deleting an identifier, I am able to set voided to true for that specific identifier to that patient. ‘/ws/rest/v1/patient/{parentUuid}/identifier/{uuid}?!purge’ e.g testing it on Postman

DELETE http://localhost:3000/openmrs-standalone/ws/rest/v1/patient/4883b694-88f2-40ab-a91b-51045d5e8a61/identifier/5a18b891-af01-4184-a92b-41368f938cbe?!purge

To get all the identifiers where voided is true or false, I have tried using below endpoint. This however only retrieves the identifiers for that patient where voided is false thus those soft deleted are not retrieved. /ws/rest/v1/patient/{parentUuid}/identifier?includeAll=true

e.g GET http://localhost:3000/openmrs-standalone/ws/rest/v1/patient/4883b694-88f2-40ab-a91b-51045d5e8a61/identifier?includeAll=true

Are you able to reproduce on this server? qa-refapp.openmrs.org

Oh, I meant that its still not working on that server.

I can delete the identifier but then retrieving as I had done on the standalone still does not work. It still gives only for identifiers that have voided as false.

retrieves the specific voided identifier GET https://qa-refapp.openmrs.org/openmrs/ws/rest/v1/patient/d8e32a2c-57e5-49ec-a658-c86b45dc759b/identifier/fc6d7d3f-4591-4679-a5dd-7627a8ded496

retrieves only the voided=false identifier GET https://qa-refapp.openmrs.org/openmrs/ws/rest/v1/patient/d8e32a2c-57e5-49ec-a658-c86b45dc759b/identifier?includeAll=true

Does that mean it is working as expected on qa-refapp.openmrs.org?

Oh, I meant that its still not working on that server.

I can delete the identifier but then retrieving as I had done on the standalone still does not work. It still gives only for identifiers that have voided as false.

retrieves the specific voided identifier GET https://qa-refapp.openmrs.org/openmrs/ws/rest/v1/patient/d8e32a2c-57e5-49ec-a658-c86b45dc759b/identifier/fc6d7d3f-4591-4679-a5dd-7627a8ded496

retrieves only the voided=false identifier GET https://qa-refapp.openmrs.org/openmrs/ws/rest/v1/patient/d8e32a2c-57e5-49ec-a658-c86b45dc759b/identifier?includeAll=true

I have just looked here https://github.com/openmrs/openmrs-module-webservices.rest/blob/master/omod-1.8/src/main/java/org/openmrs/module/webservices/rest/web/v1_0/resource/openmrs1_8/PatientIdentifierResource1_8.java#L201 and noticed that the includeAll parameter is ignored. If you have the time, you can create a ticket and take care of this. It should be as simple as checking for context.getIncludeAll() to return even the non active identifiers.

Alright, I will do that.

Thanks.