Custom Rest Resources within modules

So currently the web services module allows querying for specified and known resources, I was wondering what the process is for adding custom resources within custom modules, to simplify querying.

I know this can be done via multiple rest calls but can I get a single rest call to provide multiple known pre-determined data points in Java which would simplify the javascript processing

@ssmusoke may be it’s just me but do you mind rephrasing your question please? And what exactly are you trying to achieve? Because it’s unclear to me

I would like to get 5 data items for a patient in a single call instead of having to make 5 different obs calls

Something like /patient/uuid/currentstatus/ can the /currentstatus parameter be processed in my custom module?

You could create a custom resource in a module with the supported type being a custom java class that encapsulates all the data points you wish to include.

This is an example of a custom resource that merges together various pieces of data:

Thanks @darius for adding an example, as a by the way I dislike the fact that the supported class is OrderService on that resource, we should consider creating a new class named OrderEntryConfig and make it the supported type

It’s an unfortunate side-effect of the way I designed the base classes and annotations many years ago.

Personally I would prefer that we not make developers jump through hoops and introduce an artificial class just to be able to return a composition.