@Validate public MethodOutcome validate(@ResourceParam T theResource, @ResourceParam String theRawResource, @ResourceParam EncodingEnum theEncoding, @Validate.Mode ValidationModeEnum theMode, @Validate.Profile String theProfile, RequestDetails theRequestDetails) { return validate(theResource, null, theRawResource, theEncoding, theMode, theProfile, theRequestDetails); }
public ValidateMethodBindingDstu2Plus(Class<?> theReturnResourceType, Class<? extends IBaseResource> theReturnTypeFromRp, Method theMethod, FhirContext theContext, Object theProvider, Validate theAnnotation) { super(null, theReturnTypeFromRp, theMethod, theContext, theProvider, true, Constants.EXTOP_VALIDATE, theAnnotation.type(), new OperationParam[0], BundleTypeEnum.COLLECTION); List<IParameter> newParams = new ArrayList<IParameter>(); int idx = 0; for (IParameter next : getParameters()) { if (next instanceof ResourceParameter) { if (IBaseResource.class.isAssignableFrom(((ResourceParameter) next).getResourceType())) { Class<?> parameterType = theMethod.getParameterTypes()[idx]; if (String.class.equals(parameterType) || EncodingEnum.class.equals(parameterType)) { newParams.add(next); } else { OperationParameter parameter = new OperationParameter(theContext, Constants.EXTOP_VALIDATE, Constants.EXTOP_VALIDATE_RESOURCE, 0, 1); parameter.initializeTypes(theMethod, null, null, parameterType); newParams.add(parameter); } } else { newParams.add(next); } } else { newParams.add(next); } idx++; } setParameters(newParams); }
@Validate public MethodOutcome validate(@ResourceParam T theResource, @ResourceParam String theRawResource, @ResourceParam EncodingEnum theEncoding, @Validate.Mode ValidationModeEnum theMode, @Validate.Profile String theProfile, RequestDetails theRequestDetails) { return validate(theResource, null, theRawResource, theEncoding, theMode, theProfile, theRequestDetails); }
public ValidateMethodBindingDstu2Plus(Class<?> theReturnResourceType, Class<? extends IBaseResource> theReturnTypeFromRp, Method theMethod, FhirContext theContext, Object theProvider, Validate theAnnotation) { super(theReturnResourceType, theReturnTypeFromRp, theMethod, theContext, theProvider, true, Constants.EXTOP_VALIDATE, theAnnotation.type(), new OperationParam[0], BundleTypeEnum.COLLECTION); List<IParameter> newParams = new ArrayList<IParameter>(); int idx = 0; for (IParameter next : getParameters()) { if (next instanceof ResourceParameter) { if (IBaseResource.class.isAssignableFrom(((ResourceParameter) next).getResourceType())) { Class<?> parameterType = theMethod.getParameterTypes()[idx]; if (String.class.equals(parameterType) || EncodingEnum.class.equals(parameterType)) { newParams.add(next); } else { OperationParameter parameter = new OperationParameter(theContext, Constants.EXTOP_VALIDATE, Constants.EXTOP_VALIDATE_RESOURCE, 0, 1); parameter.initializeTypes(theMethod, null, null, parameterType); newParams.add(parameter); } } else { newParams.add(next); } } else { newParams.add(next); } idx++; } setParameters(newParams); }
@Validate public MethodOutcome validate(@ResourceParam T theResource, @ResourceParam String theRawResource, @ResourceParam EncodingEnum theEncoding, @Validate.Mode ValidationModeEnum theMode, @Validate.Profile String theProfile, RequestDetails theRequestDetails) { return validate(theResource, null, theRawResource, theEncoding, theMode, theProfile, theRequestDetails); }
returnTypeFromAnnotation = update.type(); } else if (validate != null) { returnTypeFromAnnotation = validate.type(); } else if (addTags != null) { returnTypeFromAnnotation = addTags.type();
@Validate public MethodOutcome validate(@ResourceParam T theResource, @IdParam IdType theId, @ResourceParam String theRawResource, @ResourceParam EncodingEnum theEncoding, @Validate.Mode ValidationModeEnum theMode, @Validate.Profile String theProfile, RequestDetails theRequestDetails) { return getDao().validate(theResource, theId, theRawResource, theEncoding, theMode, theProfile, theRequestDetails); }
returnTypeFromAnnotation = update.type(); } else if (validate != null) { returnTypeFromAnnotation = validate.type(); } else if (addTags != null) { returnTypeFromAnnotation = addTags.type();
@Validate public MethodOutcome validate(@ResourceParam T theResource, @IdParam IdType theId, @ResourceParam String theRawResource, @ResourceParam EncodingEnum theEncoding, @Validate.Mode ValidationModeEnum theMode, @Validate.Profile String theProfile, RequestDetails theRequestDetails) { return getDao().validate(theResource, theId, theRawResource, theEncoding, theMode, theProfile, theRequestDetails); }
public ValidateMethodBindingDstu2Plus(Class<?> theReturnResourceType, Class<? extends IBaseResource> theReturnTypeFromRp, Method theMethod, FhirContext theContext, Object theProvider, Validate theAnnotation) { super(null, theReturnTypeFromRp, theMethod, theContext, theProvider, true, Constants.EXTOP_VALIDATE, theAnnotation.type(), new OperationParam[0], BundleTypeEnum.COLLECTION); List<IParameter> newParams = new ArrayList<IParameter>(); int idx = 0; for (IParameter next : getParameters()) { if (next instanceof ResourceParameter) { if (IBaseResource.class.isAssignableFrom(((ResourceParameter) next).getResourceType())) { Class<?> parameterType = theMethod.getParameterTypes()[idx]; if (String.class.equals(parameterType) || EncodingEnum.class.equals(parameterType)) { newParams.add(next); } else { OperationParameter parameter = new OperationParameter(theContext, Constants.EXTOP_VALIDATE, Constants.EXTOP_VALIDATE_RESOURCE, 0, 1); parameter.initializeTypes(theMethod, null, null, parameterType); newParams.add(parameter); } } else { newParams.add(next); } } else { newParams.add(next); } idx++; } setParameters(newParams); }
@Validate public MethodOutcome validate(@ResourceParam T theResource, @IdParam IdDt theId, @ResourceParam String theRawResource, @ResourceParam EncodingEnum theEncoding, @Validate.Mode ValidationModeEnum theMode, @Validate.Profile String theProfile, RequestDetails theRequestDetails) { return getDao().validate(theResource, theId, theRawResource, theEncoding, theMode, theProfile, theRequestDetails); }
public ValidateMethodBindingDstu2Plus(Class<?> theReturnResourceType, Class<? extends IBaseResource> theReturnTypeFromRp, Method theMethod, FhirContext theContext, Object theProvider, Validate theAnnotation) { super(theReturnResourceType, theReturnTypeFromRp, theMethod, theContext, theProvider, true, Constants.EXTOP_VALIDATE, theAnnotation.type(), new OperationParam[0], BundleTypeEnum.COLLECTION); List<IParameter> newParams = new ArrayList<IParameter>(); int idx = 0; for (IParameter next : getParameters()) { if (next instanceof ResourceParameter) { if (IBaseResource.class.isAssignableFrom(((ResourceParameter) next).getResourceType())) { Class<?> parameterType = theMethod.getParameterTypes()[idx]; if (String.class.equals(parameterType) || EncodingEnum.class.equals(parameterType)) { newParams.add(next); } else { OperationParameter parameter = new OperationParameter(theContext, Constants.EXTOP_VALIDATE, Constants.EXTOP_VALIDATE_RESOURCE, 0, 1); parameter.initializeTypes(theMethod, null, null, parameterType); newParams.add(parameter); } } else { newParams.add(next); } } else { newParams.add(next); } idx++; } setParameters(newParams); }
@Validate public MethodOutcome validatePatient(@ResourceParam Patient thePatient, @Validate.Mode ValidationModeEnum theMode, @Validate.Profile String theProfile) { // Actually do our validation: The UnprocessableEntityException // results in an HTTP 422, which is appropriate for business rule failure if (thePatient.getIdentifierFirstRep().isEmpty()) { /* It is also possible to pass an OperationOutcome resource * to the UnprocessableEntityException if you want to return * a custom populated OperationOutcome. Otherwise, a simple one * is created using the string supplied below. */ throw new UnprocessableEntityException("No identifier supplied"); } // This method returns a MethodOutcome object MethodOutcome retVal = new MethodOutcome(); // You may also add an OperationOutcome resource to return // This part is optional though: OperationOutcome outcome = new OperationOutcome(); outcome.addIssue().setSeverity(IssueSeverity.WARNING).setDiagnostics("One minor issue detected"); retVal.setOperationOutcome(outcome); return retVal; } //END SNIPPET: validate
returnTypeFromAnnotation = update.type(); } else if (validate != null) { returnTypeFromAnnotation = validate.type(); } else if (addTags != null) { returnTypeFromAnnotation = addTags.type();
@Validate public MethodOutcome validate(@ResourceParam T theResource, @ResourceParam String theRawResource, @ResourceParam EncodingEnum theEncoding, @Validate.Mode ValidationModeEnum theMode, @Validate.Profile String theProfile, RequestDetails theRequestDetails) { return validate(theResource, null, theRawResource, theEncoding, theMode, theProfile, theRequestDetails); }
returnTypeFromAnnotation = update.type(); } else if (validate != null) { returnTypeFromAnnotation = validate.type(); } else if (addTags != null) { returnTypeFromAnnotation = addTags.type();
@Validate public MethodOutcome validate(@ResourceParam T theResource, @ResourceParam String theRawResource, @ResourceParam EncodingEnum theEncoding, @Validate.Mode ValidationModeEnum theMode, @Validate.Profile String theProfile, RequestDetails theRequestDetails) { return validate(theResource, null, theRawResource, theEncoding, theMode, theProfile, theRequestDetails); }
@Validate public MethodOutcome validate(@ResourceParam T theResource, @ResourceParam String theRawResource, @ResourceParam EncodingEnum theEncoding, @Validate.Mode ValidationModeEnum theMode, @Validate.Profile String theProfile, RequestDetails theRequestDetails) { return validate(theResource, null, theRawResource, theEncoding, theMode, theProfile, theRequestDetails); }
@Validate public MethodOutcome validate(@ResourceParam T theResource, @IdParam IdDt theId, @ResourceParam String theRawResource, @ResourceParam EncodingEnum theEncoding, @Validate.Mode ValidationModeEnum theMode, @Validate.Profile String theProfile, RequestDetails theRequestDetails) { return getDao().validate(theResource, theId, theRawResource, theEncoding, theMode, theProfile, theRequestDetails); }
@Validate public MethodOutcome validate(@ResourceParam T theResource, @IdParam IdType theId, @ResourceParam String theRawResource, @ResourceParam EncodingEnum theEncoding, @Validate.Mode ValidationModeEnum theMode, @Validate.Profile String theProfile, RequestDetails theRequestDetails) { return getDao().validate(theResource, theId, theRawResource, theEncoding, theMode, theProfile, theRequestDetails); }