I had a short conversation with Paweł, Sebastian, Nick and Chongsun about this. The way you are doing it is fine. I know it means that your Java code in the Requisition service has to do a lot of queries to the Reference Data service and then do its own filtering and sorting. We want to do it that way for now. In the future, if it ever becomes a performance problem, then we can revisit how to handle it.
I also understand that Josh, Darius and Paweł Gesek were part of some previous conversations about this. Paweł has some ideas about storing some of the Reference Data database fields inside the Requisition database as a way of “caching” that data so you could use filtering and sorting at the database level. However, I have a concern that doing that would introduce problems about data inconsistency; it would also break down the separation between the services each being responsible for their own data.
There are also some other possible improvements, such as creating specific new API endpoints that would provide filtered and sorted lists of facilities, products, or requisitions. But for now we don’t want to create new API endpoints for this. We want to wait for a larger discussion about how to design our APIs so that they provide filtering, sorting and pagination in a consistent way.
So for now the way you are doing this is fine. If anyone else has a question or concern, they should reply and explain.
From: email@example.com on behalf of "firstname.lastname@example.org" email@example.com
Date: Monday, October 10, 2016 at 5:07 PM
To: OpenLMIS Dev firstname.lastname@example.org
Subject: [openlmis-dev] Sorting Requisitions by data stored in referencedata.
Recently I have been working on filtering requisitions (#988). I need to filter and sort requisitions by programName, facilityCode or facilityName. There is a liittle problem, because requisition-service’s database stores only UUIDs of program and facility so I cannot filter and sort at the db level. What do you think, what is prefered way to approach this?
For now, I send “filter value” (for example part of facility name) and “filter by” parameters to referencedata service which filters at db level and sends me back wanted Dto objects. Then from a Requisitions list and retrieved referencedata dtos I create RequisitionDtos list as a result of filtering. Later I use Java embedded sorting to sort this RequisitionDtos list using own Comparator.
Best regards, Leszek.
You received this message because you are subscribed to the Google Groups “OpenLMIS Dev” group.
To unsubscribe from this group and stop receiving emails from it, send an email to email@example.com.
To post to this group, send email to
To view this discussion on the web visit
For more options, visit https://groups.google.com/d/optout.