From 8ce405cc4dc1c69ab9be225cdfdbf4ae5cfb09bc Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Thu, 17 Sep 2020 15:40:46 +1000 Subject: [PATCH] special case support for fr-CA language --- .../main/java/org/hl7/fhir/r5/renderers/DataRenderer.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/DataRenderer.java b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/DataRenderer.java index b13bc6fd1..a3531ce7c 100644 --- a/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/DataRenderer.java +++ b/org.hl7.fhir.r5/src/main/java/org/hl7/fhir/r5/renderers/DataRenderer.java @@ -168,6 +168,10 @@ public class DataRenderer extends Renderer { } protected String describeLang(String lang) { + // special cases: + if ("fr-CA".equals(lang)) { + return "French (Canadian)"; // this one was omitted from the value set + } ValueSet v = getContext().getWorker().fetchResource(ValueSet.class, "http://hl7.org/fhir/ValueSet/languages"); if (v != null) { ConceptReferenceComponent l = null; @@ -176,8 +180,9 @@ public class DataRenderer extends Renderer { l = cc; } if (l == null) { - if (lang.contains("-")) + if (lang.contains("-")) { lang = lang.substring(0, lang.indexOf("-")); + } for (ConceptReferenceComponent cc : v.getCompose().getIncludeFirstRep().getConcept()) { if (cc.getCode().equals(lang) || cc.getCode().startsWith(lang+"-")) l = cc;