Custom view on a Collection


I was wondering if there is a way to create a custom view for the REST web services that filters by Collections. I didn’t want to return all the data when I am loading up Concepts for things like the ConceptSet list. I can filter it a bit like this:


but I would really like to filter it like this:

https://localhost/openmrs/ws/rest/v1/concept/3c9a5a8c-1e0c-4697-92e1-0313c99311b6?v=custom:(uuid,name:(display),setMembers(concept.uuid, concept.display))

Is this even possible? I’ve tried a few things and looked at the code and I don’t think that it is, but I just wanted to verify. The first option will work, but I would prefer the second one :slight_smile:



Yes, this is possible. I’ve never done it myself but if you search in github in org:openmrs and org:bahmni for something like “ws/rest/v1 custom:” you should be able to find some examples.

Offhand I believe it should be: custom:(uuid,name:(display),setMembers:(uuid,display))


Thanks that worked perfect!

I’ll take a look at the code, if I have any more questions.