REST query for full version of object references?

With Angular, I can use the OrderService to retrieve a list of orders:

OrderService.getOrders({
   	v: 'full',
   	patient: $scope.config.patient.uuid,
   	careSetting: $scope.careSetting.uuid
}).then(function(orders) {
	$scope.allOrders = orders;
});

The ‘orders’ array returned contains a number of Order objects. Each object is, as expected, a ‘full’ representation of an Order, such as described in the Doc

Among other fields, this Order object contains a reference to the Encounter associated to it (just a reference, not its full representation):

Is there a way to retrieve the full ‘encounter’, directly from my first call, instead of just the ‘ref’ version of it ? Something like a query option that would let me say “Retrieve full version of ‘encounter’ references” or “Retrieve full versions of all depth=1 object references”

Thanks.

You’ll need to define a custom representation. See Custom Representations at https://wiki.openmrs.org/display/docs/REST+Web+Services+API+For+Clients

Example: ?v=custom:(uuid,encounter:full)

1 Like

That simple ! OK thanks @raff.