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());
}
}
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());
}
}
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;
}
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;
}
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());
}
}
Aggregations