@Patch public DaoMethodOutcome patch(HttpServletRequest theRequest, @IdParam IIdType theId, RequestDetails theRequestDetails, @ResourceParam String theBody, PatchTypeEnum thePatchType) { startRequest(theRequest); try { return myDao.patch(theId, thePatchType, theBody, theRequestDetails); } finally { endRequest(theRequest); } }
public PatchMethodBinding(Method theMethod, FhirContext theContext, Object theProvider) { super(theMethod, theContext, theProvider, Patch.class, theMethod.getAnnotation(Patch.class).type()); for (ListIterator<Class<?>> iter = Arrays.asList(theMethod.getParameterTypes()).listIterator(); iter.hasNext();) { int nextIndex = iter.nextIndex(); Class<?> next = iter.next(); if (next.equals(PatchTypeEnum.class)) { myPatchTypeParameterIndex = nextIndex; } for (Annotation nextAnnotation : theMethod.getParameterAnnotations()[nextIndex]) { if (nextAnnotation instanceof ResourceParam) { myResourceParamIndex = nextIndex; } } } if (myPatchTypeParameterIndex == -1) { throw new ConfigurationException("Method has no parameter of type " + PatchTypeEnum.class.getName() + " - " + theMethod.toString()); } if (myResourceParamIndex == -1) { throw new ConfigurationException("Method has no parameter with @" + ResourceParam.class.getSimpleName() + " annotation - " + theMethod.toString()); } }
public PatchMethodBinding(Method theMethod, FhirContext theContext, Object theProvider) { super(theMethod, theContext, theProvider, Patch.class, theMethod.getAnnotation(Patch.class).type()); for (ListIterator<Class<?>> iter = Arrays.asList(theMethod.getParameterTypes()).listIterator(); iter.hasNext();) { int nextIndex = iter.nextIndex(); Class<?> next = iter.next(); if (next.equals(PatchTypeEnum.class)) { myPatchTypeParameterIndex = nextIndex; } for (Annotation nextAnnotation : theMethod.getParameterAnnotations()[nextIndex]) { if (nextAnnotation instanceof ResourceParam) { myResourceParamIndex = nextIndex; } } } if (myPatchTypeParameterIndex == -1) { throw new ConfigurationException("Method has no parameter of type " + PatchTypeEnum.class.getName() + " - " + theMethod.toString()); } if (myResourceParamIndex == -1) { throw new ConfigurationException("Method has no parameter with @" + ResourceParam.class.getSimpleName() + " annotation - " + theMethod.toString()); } }
@Patch public OperationOutcome patientPatch(@IdParam IdType theId, PatchTypeEnum thePatchType, @ResourceParam String theBody) { if (thePatchType == PatchTypeEnum.JSON_PATCH) { // do something } if (thePatchType == PatchTypeEnum.XML_PATCH) { // do something } OperationOutcome retVal = new OperationOutcome(); retVal.getText().setDivAsString("<div>OK</div>"); return retVal; } //END SNIPPET: patch
returnTypeFromAnnotation = delete.type(); } else if (patch != null) { returnTypeFromAnnotation = patch.type(); } else if (create != null) { returnTypeFromAnnotation = create.type();
@Patch public DaoMethodOutcome patch(HttpServletRequest theRequest, @IdParam IIdType theId, RequestDetails theRequestDetails, @ResourceParam String theBody, PatchTypeEnum thePatchType) { startRequest(theRequest); try { return myDao.patch(theId, thePatchType, theBody, theRequestDetails); } finally { endRequest(theRequest); } }
returnTypeFromAnnotation = delete.type(); } else if (patch != null) { returnTypeFromAnnotation = patch.type(); } else if (create != null) { returnTypeFromAnnotation = create.type();
public PatchMethodBinding(Method theMethod, FhirContext theContext, Object theProvider) { super(theMethod, theContext, theProvider, Patch.class, theMethod.getAnnotation(Patch.class).type()); for (ListIterator<Class<?>> iter = Arrays.asList(theMethod.getParameterTypes()).listIterator(); iter.hasNext();) { int nextIndex = iter.nextIndex(); Class<?> next = iter.next(); if (next.equals(PatchTypeEnum.class)) { myPatchTypeParameterIndex = nextIndex; } for (Annotation nextAnnotation : theMethod.getParameterAnnotations()[nextIndex]) { if (nextAnnotation instanceof ResourceParam) { myResourceParamIndex = nextIndex; } } } if (myPatchTypeParameterIndex == -1) { throw new ConfigurationException("Method has no parameter of type " + PatchTypeEnum.class.getName() + " - " + theMethod.toString()); } if (myResourceParamIndex == -1) { throw new ConfigurationException("Method has no parameter with @" + ResourceParam.class.getSimpleName() + " annotation - " + theMethod.toString()); } }
public PatchMethodBinding(Method theMethod, FhirContext theContext, Object theProvider) { super(theMethod, theContext, theProvider, Patch.class, theMethod.getAnnotation(Patch.class).type()); for (ListIterator<Class<?>> iter = Arrays.asList(theMethod.getParameterTypes()).listIterator(); iter.hasNext();) { int nextIndex = iter.nextIndex(); Class<?> next = iter.next(); if (next.equals(PatchTypeEnum.class)) { myPatchTypeParameterIndex = nextIndex; } for (Annotation nextAnnotation : theMethod.getParameterAnnotations()[nextIndex]) { if (nextAnnotation instanceof ResourceParam) { myResourceParamIndex = nextIndex; } } } if (myPatchTypeParameterIndex == -1) { throw new ConfigurationException("Method has no parameter of type " + PatchTypeEnum.class.getName() + " - " + theMethod.toString()); } if (myResourceParamIndex == -1) { throw new ConfigurationException("Method has no parameter with @" + ResourceParam.class.getSimpleName() + " annotation - " + theMethod.toString()); } }
returnTypeFromAnnotation = delete.type(); } else if (patch != null) { returnTypeFromAnnotation = patch.type(); } else if (create != null) { returnTypeFromAnnotation = create.type();
returnTypeFromAnnotation = delete.type(); } else if (patch != null) { returnTypeFromAnnotation = patch.type(); } else if (create != null) { returnTypeFromAnnotation = create.type();