special case support for fr-CA language

This commit is contained in:
Grahame Grieve 2020-09-17 15:40:46 +10:00
parent 54d320bb7b
commit 8ce405cc4d
1 changed files with 6 additions and 1 deletions

View File

@ -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;