FHIR Chat · Custom operation with @RequiredParam · hapi

Stream: hapi

Topic: Custom operation with @RequiredParam


view this post on Zulip Roshan (Dec 01 2020 at 06:01):

Hi @James Agnew,
I have created custom operation with one required param. But it's not throwing an error while calling this custom operation without require param.

@Operation(name="$docref",idempotent = true, bundleType = BundleTypeEnum.SEARCHSET)
public IBundleProvider getResourcesByOperation(
@RequiredParam(name = DocumentReference.SP_PATIENT) ReferenceAndListParam patient,
@OperationParam(name = DocumentReference.SP_TYPE) TokenAndListParam type) throws Exception{
.......
}

This is how I have created the custom operation. Where patient is mandatory but still it's not throwing an exception in absence of this param.
Is there any other changes that I need to do?

Thanks


Last updated: Apr 12 2022 at 19:14 UTC