We are using OpenMRS API to integrate Bahmni EMR and Avni (another open source platform for community health).
I am using an API like this:
{{BASE_URL}}/ws/rest/v1/encounter/83837fc1-ae88-4df7-a161-d5c4cd7e755b?v=full
In the orders section, I do not see the voided field at all. While in the database we have some voided orders. Hence for integration, I need to be able to figure out which drug orders were voided and hence not sync them to the other system.
mozzy
(Moses Mutesasira)
April 29, 2021, 9:22am
2
By default the Rest API doesn’t return voided objects
Since you’re viewing Orders as a property of a given Encounter , youll only view minimal data about the orders Resource . thas is you’ll only see display ,uuid ,link
check here REPRESENTATION.REF ,
see more
REST Web Services API For Clients - Documentation - OpenMRS Wiki
This is what I am seeing. It has all the detailed fields not just display, uuid and link. But the voided field is missing as part of encounter response.
mozzy
(Moses Mutesasira)
April 29, 2021, 9:30am
4
which version of the rest module do you run ??
Rest Web Services OMOD 2.24.0.573609 OpenMRS
thanks for replying
mozzy
(Moses Mutesasira)
April 29, 2021, 9:46am
6
Are you requesting for the Full REP of the encounter resource ??
mozzy
(Moses Mutesasira)
April 29, 2021, 9:53am
7
The voided
property was removed from the order resource in version 1.10 but it existed for version 1.8
@dkayiwa was this intentional ??
ok, so this basically leaves anyone using the api in a bit of problem.
probably will delete the data from the database, as that may be the only option.
mozzy
(Moses Mutesasira)
April 29, 2021, 9:59am
10
I see , thats why you get the default REP for orders.
see reason why voided property is not included
1 Like
dkayiwa
(Daniel Kayiwa)
April 29, 2021, 10:05am
11
mozzy:
was this intentional ??
He is using the encounter resource. Not the order resource.
ok got it thanks.
if I use default I get the voided information for orders, fine.
thanks.
full gives the impression that is has everything that is there to see. default having more data that full, I hadn’t thought.
mozzy
(Moses Mutesasira)
April 29, 2021, 10:08am
13
@dkayiwa
we are talking about orders being returned as a property of an encounter Resource
dkayiwa
(Daniel Kayiwa)
April 29, 2021, 10:09am
14
The links you gave were for the order resource. Not the encounter resource which he is using.
mozzy
(Moses Mutesasira)
April 29, 2021, 10:10am
15
@dkayiwa i gave links to the Order Resource because the Encounter Resource return a representation of the Order Resource
see original post
petmongrels:
I am using an API like this: {{BASE_URL}}/ws/rest/v1/encounter/83837fc1-ae88-4df7-a161-d5c4cd7e755b?v=full
In the orders section, I do not see the voided field at all.
it works for encounter also.
it is suboptimal to use it this way though. to have to make two calls one for default and other with full.
just curious.
as per the code full representation should have also provided voided info by entering the first if and then entering the second else if.
it seems the code was intended that way but is not working like that.
I should have been looking at Order resource which is where the problem is. Full has voided but not in the result. Not sure what is happening.
/**
* This Source Code Form is subject to the terms of the Mozilla Public License,
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under
* the terms of the Healthcare Disclaimer located at http://openmrs.org/license.
*
* Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS
* graphic logo is a trademark of OpenMRS Inc.
*/
package org.openmrs.module.webservices.rest.web.v1_0.resource.openmrs1_8;
import java.util.List;
import io.swagger.models.Model;
import io.swagger.models.ModelImpl;
import io.swagger.models.properties.BooleanProperty;
import io.swagger.models.properties.DateProperty;
import io.swagger.models.properties.RefProperty;
import io.swagger.models.properties.StringProperty;
import org.openmrs.Order;
This file has been truncated. show original
mozzy
(Moses Mutesasira)
April 29, 2021, 10:27am
19
@petmongrels , i explained that in the above comment
The order Resource was Updated in version 1.10 and the voided property was removed.
@dkayiwa this is what i was asking whether it was intentional to remove the voided field
mozzy
(Moses Mutesasira)
April 29, 2021, 10:47am
20
@dkayiwa , is there some kind of Hibernate filter that filters out Voided order objects of an encounter ??
i cant seem to find it.
i