Search in sources :

Example 11 with ConceptReferenceDesignationComponent

use of org.hl7.fhir.r4b.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;
}
Also used : ConceptDefinitionDesignationComponent(org.hl7.fhir.r4b.model.CodeSystem.ConceptDefinitionDesignationComponent) ArrayList(java.util.ArrayList) ConceptReferenceDesignationComponent(org.hl7.fhir.r4b.model.ValueSet.ConceptReferenceDesignationComponent)

Example 12 with ConceptReferenceDesignationComponent

use of org.hl7.fhir.r4b.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);
                }
            }
        }
    }
}
Also used : Extension(org.hl7.fhir.r5.model.Extension) ConceptReferenceDesignationComponent(org.hl7.fhir.r5.model.ValueSet.ConceptReferenceDesignationComponent) ConceptReferenceComponent(org.hl7.fhir.r5.model.ValueSet.ConceptReferenceComponent)

Example 13 with ConceptReferenceDesignationComponent

use of org.hl7.fhir.r4b.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);
    }
}
Also used : ConceptReferenceDesignationComponent(org.hl7.fhir.r5.model.ValueSet.ConceptReferenceDesignationComponent)

Example 14 with ConceptReferenceDesignationComponent

use of org.hl7.fhir.r4b.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);
    }
}
Also used : Extension(org.hl7.fhir.r5.model.Extension) ConceptReferenceDesignationComponent(org.hl7.fhir.r5.model.ValueSet.ConceptReferenceDesignationComponent)

Example 15 with ConceptReferenceDesignationComponent

use of org.hl7.fhir.r4b.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);
    }
}
Also used : ConceptReferenceDesignationComponent(org.hl7.fhir.r5.model.ValueSet.ConceptReferenceDesignationComponent)

Aggregations

ConceptReferenceDesignationComponent (org.hl7.fhir.r5.model.ValueSet.ConceptReferenceDesignationComponent)11 ConceptReferenceDesignationComponent (org.hl7.fhir.r4b.model.ValueSet.ConceptReferenceDesignationComponent)7 ArrayList (java.util.ArrayList)6 XhtmlNode (org.hl7.fhir.utilities.xhtml.XhtmlNode)5 ConceptDefinitionDesignationComponent (org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionDesignationComponent)4 Extension (org.hl7.fhir.r5.model.Extension)4 ConceptReferenceDesignationComponent (org.hl7.fhir.dstu3.model.ValueSet.ConceptReferenceDesignationComponent)3 ConceptDefinitionDesignationComponent (org.hl7.fhir.r4.model.CodeSystem.ConceptDefinitionDesignationComponent)3 ConceptReferenceDesignationComponent (org.hl7.fhir.r4.model.ValueSet.ConceptReferenceDesignationComponent)3 ConceptDefinitionDesignationComponent (org.hl7.fhir.r4b.model.CodeSystem.ConceptDefinitionDesignationComponent)3 ConceptReferenceComponent (org.hl7.fhir.r5.model.ValueSet.ConceptReferenceComponent)3 CommaSeparatedStringBuilder (org.hl7.fhir.utilities.CommaSeparatedStringBuilder)3 ConceptReferenceComponent (org.hl7.fhir.dstu3.model.ValueSet.ConceptReferenceComponent)2 ValidationResult (org.hl7.fhir.r4.context.IWorkerContext.ValidationResult)2 CodeSystem (org.hl7.fhir.r4.model.CodeSystem)2 Extension (org.hl7.fhir.r4b.model.Extension)2 ConceptReferenceComponent (org.hl7.fhir.r4b.model.ValueSet.ConceptReferenceComponent)2 ValueSetExpansionContainsComponent (org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionContainsComponent)2 ValidationResult (org.hl7.fhir.dstu3.context.IWorkerContext.ValidationResult)1 CodeSystem (org.hl7.fhir.dstu3.model.CodeSystem)1