private void populateDetails(FhirContext theCtx, Throwable theException, IBaseOperationOutcome theOo) { if (myReturnStackTracesForExceptionTypes != null) { for (Class<?> next : myReturnStackTracesForExceptionTypes) { if (next.isAssignableFrom(theException.getClass())) { String detailsValue = theException.getMessage() + "\n\n" + ExceptionUtils.getStackTrace(theException); OperationOutcomeUtil.addIssue(theCtx, theOo, "error", detailsValue, null, PROCESSING); return; } } } OperationOutcomeUtil.addIssue(theCtx, theOo, "error", theException.getMessage(), null, PROCESSING); }
public void validateDeleteConflictsEmptyOrThrowException(List<DeleteConflict> theDeleteConflicts) { if (theDeleteConflicts.isEmpty()) { return; } IBaseOperationOutcome oo = OperationOutcomeUtil.newInstance(getContext()); String firstMsg = null; for (DeleteConflict next : theDeleteConflicts) { StringBuilder b = new StringBuilder(); b.append("Unable to delete "); b.append(next.getTargetId().toUnqualifiedVersionless().getValue()); b.append(" because at least one resource has a reference to this resource. First reference found was resource "); b.append(next.getTargetId().toUnqualifiedVersionless().getValue()); b.append(" in path "); b.append(next.getSourcePath()); String msg = b.toString(); if (firstMsg == null) { firstMsg = msg; } OperationOutcomeUtil.addIssue(getContext(), oo, OO_SEVERITY_ERROR, msg, null, "processing"); } throw new ResourceVersionConflictException(firstMsg, oo); }
if (baseServerResponseException.getAdditionalMessages() != null) { for (String next : baseServerResponseException.getAdditionalMessages()) { OperationOutcomeUtil.addIssue(ctx, oo, "error", next, null, PROCESSING);
/** * Populate an operation outcome with the results of the validation */ public void populateOperationOutcome(IBaseOperationOutcome theOperationOutcome) { for (SingleValidationMessage next : myMessages) { String location; if (isNotBlank(next.getLocationString())) { location = next.getLocationString(); } else if (next.getLocationLine() != null || next.getLocationCol() != null) { location = "Line[" + next.getLocationLine() + "] Col[" + next.getLocationCol() + "]"; } else { location = null; } String severity = next.getSeverity() != null ? next.getSeverity().getCode() : null; OperationOutcomeUtil.addIssue(myCtx, theOperationOutcome, severity, next.getMessage(), location, Constants.OO_INFOSTATUS_PROCESSING); } if (myMessages.isEmpty()) { String message = myCtx.getLocalizer().getMessage(ValidationResult.class, "noIssuesDetected"); OperationOutcomeUtil.addIssue(myCtx, theOperationOutcome, "information", message, null, "informational"); } }
String severity = "warning"; String code = "not-found"; OperationOutcomeUtil.addIssue(getContext(), oo, severity, message, null, code); } else { oo = OperationOutcomeUtil.newInstance(getContext()); String severity = "information"; String code = "informational"; OperationOutcomeUtil.addIssue(getContext(), oo, severity, message, null, code);
private void populateDetails(FhirContext theCtx, Throwable theException, IBaseOperationOutcome theOo) { if (myReturnStackTracesForExceptionTypes != null) { for (Class<?> next : myReturnStackTracesForExceptionTypes) { if (next.isAssignableFrom(theException.getClass())) { String detailsValue = theException.getMessage() + "\n\n" + ExceptionUtils.getStackTrace(theException); OperationOutcomeUtil.addIssue(theCtx, theOo, "error", detailsValue, null, PROCESSING); return; } } } OperationOutcomeUtil.addIssue(theCtx, theOo, "error", theException.getMessage(), null, PROCESSING); }
FhirContext ctx = theRequestDetails.getServer().getFhirContext(); outcome = OperationOutcomeUtil.newInstance(ctx); OperationOutcomeUtil.addIssue(ctx, outcome, "information", "No issues detected", "", "informational");
String severity = "information"; String code = "informational"; OperationOutcomeUtil.addIssue(getContext(), oo, severity, message, null, code); outcome.setOperationOutcome(oo); String severity = "information"; String code = "informational"; OperationOutcomeUtil.addIssue(getContext(), oo, severity, message, null, code); outcome.setOperationOutcome(oo);
public void validateDeleteConflictsEmptyOrThrowException(List<DeleteConflict> theDeleteConflicts) { if (theDeleteConflicts.isEmpty()) { return; } IBaseOperationOutcome oo = OperationOutcomeUtil.newInstance(getContext()); String firstMsg = null; for (DeleteConflict next : theDeleteConflicts) { StringBuilder b = new StringBuilder(); b.append("Unable to delete "); b.append(next.getTargetId().toUnqualifiedVersionless().getValue()); b.append(" because at least one resource has a reference to this resource. First reference found was resource "); b.append(next.getTargetId().toUnqualifiedVersionless().getValue()); b.append(" in path "); b.append(next.getSourcePath()); String msg = b.toString(); if (firstMsg == null) { firstMsg = msg; } OperationOutcomeUtil.addIssue(getContext(), oo, OO_SEVERITY_ERROR, msg, null, "processing"); } throw new ResourceVersionConflictException(firstMsg, oo); }
if (baseServerResponseException.getAdditionalMessages() != null) { for (String next : baseServerResponseException.getAdditionalMessages()) { OperationOutcomeUtil.addIssue(ctx, oo, "error", next, null, PROCESSING);
/** * Populate an operation outcome with the results of the validation */ public void populateOperationOutcome(IBaseOperationOutcome theOperationOutcome) { for (SingleValidationMessage next : myMessages) { String location; if (isNotBlank(next.getLocationString())) { location = next.getLocationString(); } else if (next.getLocationLine() != null || next.getLocationCol() != null) { location = "Line[" + next.getLocationLine() + "] Col[" + next.getLocationCol() + "]"; } else { location = null; } String severity = next.getSeverity() != null ? next.getSeverity().getCode() : null; OperationOutcomeUtil.addIssue(myCtx, theOperationOutcome, severity, next.getMessage(), location, Constants.OO_INFOSTATUS_PROCESSING); } if (myMessages.isEmpty()) { String message = myCtx.getLocalizer().getMessage(ValidationResult.class, "noIssuesDetected"); OperationOutcomeUtil.addIssue(myCtx, theOperationOutcome, "information", message, null, "informational"); } }
String severity = "warning"; String code = "not-found"; OperationOutcomeUtil.addIssue(getContext(), oo, severity, message, null, code); } else { oo = OperationOutcomeUtil.newInstance(getContext()); String severity = "information"; String code = "informational"; OperationOutcomeUtil.addIssue(getContext(), oo, severity, message, null, code);
FhirContext ctx = theRequestDetails.getServer().getFhirContext(); outcome = OperationOutcomeUtil.newInstance(ctx); OperationOutcomeUtil.addIssue(ctx, outcome, "information", "No issues detected", "", "informational");
String severity = "information"; String code = "informational"; OperationOutcomeUtil.addIssue(getContext(), oo, severity, message, null, code); outcome.setOperationOutcome(oo); String severity = "information"; String code = "informational"; OperationOutcomeUtil.addIssue(getContext(), oo, severity, message, null, code); outcome.setOperationOutcome(oo);