From a72263474ee90a2c643b07dc150504c6301d49b6 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Fri, 29 Nov 2019 13:25:41 +1100 Subject: [PATCH] add Coding.toString() --- .../src/main/java/org/hl7/fhir/r5/model/Coding.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/Coding.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/Coding.java index 92d2cfd9a..ade6f5845 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/Coding.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/model/Coding.java @@ -555,8 +555,17 @@ public class Coding extends Type implements IBaseCoding, ICompositeType, ICoding public boolean is(String system, String code) { return hasSystem() && hasCode() && this.getSystem().equals(system) && this.getCode().equals(code); } - + public String toString() { + String base = getSystem(); + if (hasVersion()) + base = base+"|"+getVersion(); + base = base + "#"+getCode(); + if (hasDisplay()) + base = base+": "+getDisplay(); + return base; + + } // end addition }