Getting voided encounters and orders when calling visit from Openmrs Rest API

Hello, I have got stuck when trying to access the visit API. I need to get all attributes including voided ones such as voided encounters and voided orders inside the visit payload. I have tried to use include all but it has brought voided visits but still not voided encounters and orders in the payload. Is there any other way???

Hi @jmwambimbi welcome, could you refer to the OpenMRS rest API documentation here for the supported functionality… You might want to query those particular endpoints whose voided records you want and associate them at the point where you need them using a filtering algorithm that satisfies your requirements.

Hello @ruhanga, this didn’t work for me either. The rest API was bringing results but only those with voided = false although I used includeAll parameter when querying

@jmwambimbi, could you define your specific use case requiring the above type of api calls you are interested in? This could provide some clear background so one can get a solution that could work for you.

I void a certain encounter and then I call all encounters so I can filter them and group them based on their voided value. These are for a specific patient. I tried to use includeAll when getting all encounters but couldn’t. @ruhanga

Thanks for reporting your observation @jmwambimbi. Could you open a ticket here capturing your observations for this to be resolved? It could have a title such as Encounter Resource to process includeAll parameter for example.