@Read public Patient read(@IdParam IdDt theId) { if (databaseIsDown) { OperationOutcome oo = new OperationOutcome(); oo.addIssue().setSeverity(IssueSeverityEnum.FATAL).setDetails("Database is down"); throw new InternalErrorException("Database is down", oo); } Patient patient = new Patient(); // populate this return patient; } //END SNIPPET: returnOO
@Override protected IBaseOperationOutcome createOperationOutcome(String theSeverity, String theMessage, String theCode) { OperationOutcome oo = new OperationOutcome(); oo.getIssueFirstRep().getSeverityElement().setValue(theSeverity); oo.getIssueFirstRep().getDiagnosticsElement().setValue(theMessage); oo.getIssueFirstRep().getCodeElement().setValue(theCode); return oo; }
/** * Gets the first repetition for <b>issue</b> (), * creating it if it does not already exist. * * <p> * <b>Definition:</b> * An error, warning or information message that results from a system action * </p> */ public Issue getIssueFirstRep() { if (getIssue().isEmpty()) { return addIssue(); } return getIssue().get(0); }
for (Issue nextIssue : oo.getIssue()) { if (nextIssue.getSeverityElement().getValueAsEnum().ordinal() >= IssueSeverityEnum.ERROR.ordinal()) { System.out.println("We failed validation!"); System.out.println(outcome.getIssueFirstRep().getDetailsElement().getValue());
/** * Adds a given new value for <b>issue</b> () * * <p> * <b>Definition:</b> * An error, warning or information message that results from a system action * </p> * @param theValue The issue to add (must not be <code>null</code>) */ public OperationOutcome addIssue(Issue theValue) { if (theValue == null) { throw new NullPointerException("theValue must not be null"); } getIssue().add(theValue); return this; }
/** * Adds and returns a new value for <b>issue</b> () * * <p> * <b>Definition:</b> * An error, warning or information message that results from a system action * </p> */ public Issue addIssue() { Issue newType = new Issue(); getIssue().add(newType); return newType; }
Entry nextEntry = resp.addEntry(); OperationOutcome oo = new OperationOutcome(); oo.addIssue().setSeverity(IssueSeverityEnum.ERROR).setDiagnostics(caughtEx.getMessage()); nextEntry.setResource(oo);
@Override protected IBaseOperationOutcome createOperationOutcome(String theSeverity, String theMessage, String theCode) { OperationOutcome oo = new OperationOutcome(); oo.getIssueFirstRep().getSeverityElement().setValue(theSeverity); oo.getIssueFirstRep().getDiagnosticsElement().setValue(theMessage); oo.getIssueFirstRep().getCodeElement().setValue(theCode); return oo; }
OperationOutcome oo = new OperationOutcome(); oo.addIssue().setSeverity(IssueSeverityEnum.INFORMATION).setDiagnostics("Ok to delete"); return new MethodOutcome(new IdDt(theId.getValue()), oo);
Entry nextEntry = resp.addEntry(); OperationOutcome oo = new OperationOutcome(); oo.addIssue().setSeverity(IssueSeverityEnum.ERROR).setDiagnostics(caughtEx.getMessage()); nextEntry.setResource(oo);
OperationOutcome oo = new OperationOutcome(); oo.addIssue().setSeverity(IssueSeverityEnum.INFORMATION).setDiagnostics("Ok to delete"); return new MethodOutcome(new IdDt(theId.getValue()), oo);