Help understanding how DataDelegatingCrudResource

The RadiologyReportResource extends DataDelegatingCrudResource. I’m trying to figure out how different REST calls are been handled by the resource. Say a I make GET /radiologyreport/{uuid} I’m guessing the method RadiologyReportResource.getByUniqueId tells which element to get. Now the the resource has a newDelegate() and a save(RadiologyReport delegate) method. Currently these two methods throw a ResourceDoesNotSupportOperationException() exception which means currently the radiology module does not support creating and updating reports via REST. But I want to change that since we’ll be creating new radiology reports via REST and I’m not sure what to put in the newDelegate() method. I checked with the location resource and it’s newDelegate() just returns a new Location(). But the only public constructor in RadiologyReport is RadiologyReport(RadiologyOrder order).

What do I need to do to support POST to /radiologyreport/ for creating a new radiologyreport whose json body will probably have the uuid of a radiology order and another POST to /radiologyreport/{uuid} for updating an existing report.

Another thing is when I visit the rest documentations via /openmrs/module/webservices/rest/apiDocs.htm, I noticed that there is no POST documentation for these URLs like with other resources. RadiologyReportResource

You might want to consider adding a default constructor to RadiologyReport