Search in sources :

Example 26 with ConceptDefinitionDesignationComponent

use of org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionDesignationComponent in project org.hl7.fhir.core by hapifhir.

the class CodeSystemRenderer method addLanguageRow.

private void addLanguageRow(ConceptDefinitionComponent c, XhtmlNode t, List<String> langs) {
    XhtmlNode tr = t.tr();
    tr.td().addText(c.getCode());
    for (String lang : langs) {
        ConceptDefinitionDesignationComponent d = null;
        for (ConceptDefinitionDesignationComponent designation : c.getDesignation()) {
            if (designation.hasLanguage()) {
                if (lang.equals(designation.getLanguage()))
                    d = designation;
            }
        }
        tr.td().addText(d == null ? "" : d.getValue());
    }
}
Also used : ConceptDefinitionDesignationComponent(org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionDesignationComponent) XhtmlNode(org.hl7.fhir.utilities.xhtml.XhtmlNode)

Example 27 with ConceptDefinitionDesignationComponent

use of org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionDesignationComponent in project org.hl7.fhir.core by hapifhir.

the class NarrativeGenerator method addLanguageRow.

private void addLanguageRow(ConceptDefinitionComponent c, XhtmlNode t, List<String> langs) {
    XhtmlNode tr = t.tr();
    tr.td().addText(c.getCode());
    for (String lang : langs) {
        ConceptDefinitionDesignationComponent d = null;
        for (ConceptDefinitionDesignationComponent designation : c.getDesignation()) {
            if (lang.equals(designation.getLanguage()))
                d = designation;
        }
        tr.td().addText(d == null ? "" : d.getValue());
    }
}
Also used : ConceptDefinitionDesignationComponent(org.hl7.fhir.dstu3.model.CodeSystem.ConceptDefinitionDesignationComponent) XhtmlNode(org.hl7.fhir.utilities.xhtml.XhtmlNode)

Example 28 with ConceptDefinitionDesignationComponent

use of org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionDesignationComponent in project org.hl7.fhir.core by hapifhir.

the class ValueSetExpanderSimple method convertDesignations.

private List<ConceptDefinitionDesignationComponent> convertDesignations(List<ConceptReferenceDesignationComponent> list) {
    List<ConceptDefinitionDesignationComponent> res = new ArrayList<CodeSystem.ConceptDefinitionDesignationComponent>();
    for (ConceptReferenceDesignationComponent t : list) {
        ConceptDefinitionDesignationComponent c = new ConceptDefinitionDesignationComponent();
        c.setLanguage(t.getLanguage());
        c.setUse(t.getUse());
        c.setValue(t.getValue());
    }
    return res;
}
Also used : ConceptDefinitionDesignationComponent(org.hl7.fhir.dstu3.model.CodeSystem.ConceptDefinitionDesignationComponent)

Example 29 with ConceptDefinitionDesignationComponent

use of org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionDesignationComponent in project org.hl7.fhir.core by hapifhir.

the class ValueSetExpanderSimple method addCode.

private ValueSetExpansionContainsComponent addCode(String system, String code, String display, ValueSetExpansionContainsComponent parent, List<ConceptDefinitionDesignationComponent> designations, ExpansionProfile profile, boolean isAbstract, boolean inactive, List<ValueSet> filters) {
    if (filters != null && !filters.isEmpty() && !filterContainsCode(filters, system, code))
        return null;
    ValueSetExpansionContainsComponent n = new ValueSet.ValueSetExpansionContainsComponent();
    n.setSystem(system);
    n.setCode(code);
    if (isAbstract)
        n.setAbstract(true);
    if (inactive)
        n.setInactive(true);
    if (profile.getIncludeDesignations() && designations != null) {
        for (ConceptDefinitionDesignationComponent t : designations) {
            ToolingExtensions.addLanguageTranslation(n, t.getLanguage(), t.getValue());
        }
    }
    ConceptDefinitionDesignationComponent t = profile.hasLanguage() ? getMatchingLang(designations, profile.getLanguage()) : null;
    if (t == null)
        n.setDisplay(display);
    else
        n.setDisplay(t.getValue());
    String s = key(n);
    if (map.containsKey(s) || excludeKeys.contains(s)) {
        canBeHeirarchy = false;
    } else {
        codes.add(n);
        map.put(s, n);
        total++;
    }
    if (canBeHeirarchy && parent != null) {
        parent.getContains().add(n);
    } else {
        roots.add(n);
    }
    return n;
}
Also used : ConceptDefinitionDesignationComponent(org.hl7.fhir.dstu3.model.CodeSystem.ConceptDefinitionDesignationComponent)

Example 30 with ConceptDefinitionDesignationComponent

use of org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionDesignationComponent in project org.hl7.fhir.core by hapifhir.

the class NarrativeGenerator method addMapHeaders.

// private void scanLangs(ConceptDefinitionComponent c, List<String> langs) {
// for (ConceptDefinitionDesignationComponent designation : c.getDesignation()) {
// if (designation.hasLanguage()) {
// String lang = designation.getLanguage();
// if (langs != null && !langs.contains(lang) && c.hasDisplay() && !c.getDisplay().equalsIgnoreCase(designation.getValue()))
// langs.add(lang);
// }
// }
// for (ConceptDefinitionComponent g : c.getConcept())
// scanLangs(g, langs);
// }
private void addMapHeaders(XhtmlNode tr, List<UsedConceptMap> maps) throws FHIRFormatError, DefinitionException, IOException {
    for (UsedConceptMap m : maps) {
        XhtmlNode td = tr.td();
        XhtmlNode b = td.b();
        XhtmlNode a = b.ah(prefix + m.getLink());
        a.addText(m.getDetails().getName());
        if (m.getDetails().isDoDescription() && m.getMap().hasDescription())
            addMarkdown(td, m.getMap().getDescription());
    }
}
Also used : XhtmlNode(org.hl7.fhir.utilities.xhtml.XhtmlNode)

Aggregations

ConceptDefinitionDesignationComponent (org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionDesignationComponent)11 XhtmlNode (org.hl7.fhir.utilities.xhtml.XhtmlNode)10 ConceptDefinitionComponent (org.hl7.fhir.r5.model.CodeSystem.ConceptDefinitionComponent)7 CommaSeparatedStringBuilder (org.hl7.fhir.utilities.CommaSeparatedStringBuilder)7 ArrayList (java.util.ArrayList)6 ConceptDefinitionDesignationComponent (org.hl7.fhir.r4b.model.CodeSystem.ConceptDefinitionDesignationComponent)6 ConceptDefinitionDesignationComponent (org.hl7.fhir.dstu3.model.CodeSystem.ConceptDefinitionDesignationComponent)4 ConceptDefinitionDesignationComponent (org.hl7.fhir.r4.model.CodeSystem.ConceptDefinitionDesignationComponent)4 CodeSystem (org.hl7.fhir.r5.model.CodeSystem)4 ConceptReferenceDesignationComponent (org.hl7.fhir.r5.model.ValueSet.ConceptReferenceDesignationComponent)4 ConceptReferenceDesignationComponent (org.hl7.fhir.r4b.model.ValueSet.ConceptReferenceDesignationComponent)3 ConceptDefinitionDesignationComponent (org.hl7.fhir.dstu2.model.ValueSet.ConceptDefinitionDesignationComponent)2 ConceptDefinitionDesignationComponent (org.hl7.fhir.dstu2016may.model.CodeSystem.ConceptDefinitionDesignationComponent)2 ConceptReferenceDesignationComponent (org.hl7.fhir.r4.model.ValueSet.ConceptReferenceDesignationComponent)2 ConceptDefinitionComponent (org.hl7.fhir.r4b.model.CodeSystem.ConceptDefinitionComponent)2 Extension (org.hl7.fhir.r5.model.Extension)2 ConceptDefinitionComponent (org.hl7.fhir.dstu2.model.ValueSet.ConceptDefinitionComponent)1 ConceptDefinitionComponent (org.hl7.fhir.dstu2016may.model.CodeSystem.ConceptDefinitionComponent)1 ConceptDefinitionComponent (org.hl7.fhir.dstu3.model.CodeSystem.ConceptDefinitionComponent)1 Coding (org.hl7.fhir.dstu3.model.Coding)1