From 28a8165034513ef0a8bb65dd10e9d1b81f6cda74 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Tue, 4 Oct 2022 14:04:20 +1100 Subject: [PATCH] add .toString() for OperationOutcome.issue --- .../java/org/hl7/fhir/r5/model/OperationOutcome.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/OperationOutcome.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/OperationOutcome.java index 603aba49e..f34dfed78 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/OperationOutcome.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/OperationOutcome.java @@ -1299,6 +1299,15 @@ For resource issues, this will be a simple XPath limited to element names, repet } + @Override + public String toString() { + if (getExpression().size() == 1) { + return getExpression().get(0)+" "+getDiagnostics()+" "+getSeverity().toCode()+"/"+getCode().toCode()+": "+getDetails().getText(); + } else { + return getExpression()+" "+getDiagnostics()+" "+getSeverity().toCode()+"/"+getCode().toCode()+": "+getDetails().getText(); + } + } + } /**