use of org.hl7.fhir.r4.model.ValueSet.ConceptReferenceDesignationComponent in project org.hl7.fhir.core by hapifhir.
the class ValueSetExpanderSimple method convert.
private List<ConceptDefinitionDesignationComponent> convert(List<ConceptReferenceDesignationComponent> designations) {
List<ConceptDefinitionDesignationComponent> list = new ArrayList<ConceptDefinitionDesignationComponent>();
for (ConceptReferenceDesignationComponent d : designations) {
ConceptDefinitionDesignationComponent n = new ConceptDefinitionDesignationComponent();
n.setLanguage(d.getLanguage());
n.setUse(d.getUse());
n.setValue(d.getValue());
list.add(n);
}
return list;
}
use of org.hl7.fhir.r4.model.ValueSet.ConceptReferenceDesignationComponent in project org.hl7.fhir.core by hapifhir.
the class ValueSetRenderer method scanDesignations.
private void scanDesignations(ConceptSetComponent inc, List<String> langs, Map<String, String> designations) {
for (ConceptReferenceComponent cc : inc.getConcept()) {
for (Extension ext : cc.getExtension()) {
if (ToolingExtensions.EXT_TRANSLATION.equals(ext.getUrl())) {
String lang = ToolingExtensions.readStringExtension(ext, "lang");
if (!Utilities.noString(lang) && !langs.contains(lang)) {
langs.add(lang);
}
}
}
for (ConceptReferenceDesignationComponent d : cc.getDesignation()) {
String lang = d.getLanguage();
if (!Utilities.noString(lang) && !langs.contains(lang)) {
langs.add(lang);
} else {
// can we present this as a designation that we know?
String disp = getDisplayForDesignation(d);
String url = getUrlForDesignation(d);
if (disp == null) {
disp = getDisplayForUrl(url);
}
if (disp != null && !designations.containsKey(url)) {
designations.put(url, disp);
}
}
}
}
}
use of org.hl7.fhir.r4.model.ValueSet.ConceptReferenceDesignationComponent in project org.hl7.fhir.core by hapifhir.
the class ValueSetRenderer method addDesignationsToRow.
public void addDesignationsToRow(ValueSetExpansionContainsComponent c, Map<String, String> designations, XhtmlNode tr) {
for (String url : designations.keySet()) {
String d = null;
if (d == null) {
for (ConceptReferenceDesignationComponent dd : c.getDesignation()) {
if (url.equals(getUrlForDesignation(dd))) {
d = dd.getValue();
}
}
}
tr.td().addText(d == null ? "" : d);
}
}
use of org.hl7.fhir.r4.model.ValueSet.ConceptReferenceDesignationComponent in project org.hl7.fhir.core by hapifhir.
the class ValueSetRenderer method addLangaugesToRow.
public void addLangaugesToRow(ValueSetExpansionContainsComponent c, List<String> langs, XhtmlNode tr) {
for (String lang : langs) {
String d = null;
for (Extension ext : c.getExtension()) {
if (ToolingExtensions.EXT_TRANSLATION.equals(ext.getUrl())) {
String l = ToolingExtensions.readStringExtension(ext, "lang");
if (lang.equals(l)) {
d = ToolingExtensions.readStringExtension(ext, "content");
}
}
}
if (d == null) {
for (ConceptReferenceDesignationComponent dd : c.getDesignation()) {
String l = dd.getLanguage();
if (lang.equals(l)) {
d = dd.getValue();
}
}
}
tr.td().addText(d == null ? "" : d);
}
}
use of org.hl7.fhir.r4.model.ValueSet.ConceptReferenceDesignationComponent in project org.hl7.fhir.core by hapifhir.
the class ValueSetRenderer method addDesignationsToRow.
public void addDesignationsToRow(ConceptReferenceComponent c, Map<String, String> designations, XhtmlNode tr) {
for (String url : designations.keySet()) {
String d = null;
if (d == null) {
for (ConceptReferenceDesignationComponent dd : c.getDesignation()) {
if (url.equals(getUrlForDesignation(dd))) {
d = dd.getValue();
}
}
}
tr.td().addText(d == null ? "" : d);
}
}
Aggregations