special case support for fr-CA language
This commit is contained in:
parent
54d320bb7b
commit
8ce405cc4d
|
@ -168,6 +168,10 @@ public class DataRenderer extends Renderer {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String describeLang(String lang) {
|
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");
|
ValueSet v = getContext().getWorker().fetchResource(ValueSet.class, "http://hl7.org/fhir/ValueSet/languages");
|
||||||
if (v != null) {
|
if (v != null) {
|
||||||
ConceptReferenceComponent l = null;
|
ConceptReferenceComponent l = null;
|
||||||
|
@ -176,8 +180,9 @@ public class DataRenderer extends Renderer {
|
||||||
l = cc;
|
l = cc;
|
||||||
}
|
}
|
||||||
if (l == null) {
|
if (l == null) {
|
||||||
if (lang.contains("-"))
|
if (lang.contains("-")) {
|
||||||
lang = lang.substring(0, lang.indexOf("-"));
|
lang = lang.substring(0, lang.indexOf("-"));
|
||||||
|
}
|
||||||
for (ConceptReferenceComponent cc : v.getCompose().getIncludeFirstRep().getConcept()) {
|
for (ConceptReferenceComponent cc : v.getCompose().getIncludeFirstRep().getConcept()) {
|
||||||
if (cc.getCode().equals(lang) || cc.getCode().startsWith(lang+"-"))
|
if (cc.getCode().equals(lang) || cc.getCode().startsWith(lang+"-"))
|
||||||
l = cc;
|
l = cc;
|
||||||
|
|
Loading…
Reference in New Issue