Fix problem rendering ConceptMaps in value sets
This commit is contained in:
parent
7c5782689a
commit
cd820bdf3f
|
@ -108,6 +108,9 @@ public class ValueSetRenderer extends TerminologyRenderer {
|
|||
ConceptMap cm = (ConceptMap) md;
|
||||
if (isSource(vs, cm.getSourceScope())) {
|
||||
ConceptMapRenderInstructions re = findByTarget(cm.getTargetScope());
|
||||
if (re == null) {
|
||||
re = new ConceptMapRenderInstructions(cm.present(), cm.getUrl(), false);
|
||||
}
|
||||
if (re != null) {
|
||||
ValueSet vst = cm.hasTargetScope() ? getContext().getWorker().fetchResource(ValueSet.class, cm.hasTargetScopeCanonicalType() ? cm.getTargetScopeCanonicalType().getValue() : cm.getTargetScopeUriType().asStringValue()) : null;
|
||||
res.add(new UsedConceptMap(re, vst == null ? cm.getUserString("path") : vst.getUserString("path"), cm));
|
||||
|
@ -346,7 +349,9 @@ public class ValueSetRenderer extends TerminologyRenderer {
|
|||
return null;
|
||||
}
|
||||
String src = source.primitiveValue();
|
||||
if (src != null)
|
||||
if (src == null) {
|
||||
return null;
|
||||
}
|
||||
for (ConceptMapRenderInstructions t : renderingMaps) {
|
||||
if (src.equals(t.getUrl()))
|
||||
return t;
|
||||
|
|
|
@ -44,23 +44,45 @@ public class CommaSeparatedStringBuilder {
|
|||
String sep = ", ";
|
||||
StringBuilder b = new StringBuilder();
|
||||
int count = 0;
|
||||
String pending = null;
|
||||
private String lastSep;
|
||||
|
||||
public CommaSeparatedStringBuilder() {
|
||||
this.sep = ", ";
|
||||
this.lastSep = ", ";
|
||||
}
|
||||
|
||||
public CommaSeparatedStringBuilder(String sep) {
|
||||
this.sep = sep;
|
||||
this.lastSep = sep;
|
||||
}
|
||||
|
||||
public void append(String value) {
|
||||
if (!first)
|
||||
public CommaSeparatedStringBuilder(String sep, String lastSep) {
|
||||
this.sep = sep;
|
||||
this.lastSep = lastSep;
|
||||
}
|
||||
|
||||
private void commit(boolean last) {
|
||||
if (pending != null) {
|
||||
if (!first) {
|
||||
if (last) {
|
||||
b.append(lastSep);
|
||||
} else {
|
||||
b.append(sep);
|
||||
b.append(value);
|
||||
}
|
||||
}
|
||||
b.append(pending);
|
||||
first = false;
|
||||
}
|
||||
}
|
||||
public void append(String value) {
|
||||
commit(false);
|
||||
pending = value;
|
||||
count++;
|
||||
}
|
||||
|
||||
public int length() {
|
||||
commit(false);
|
||||
return b.length();
|
||||
}
|
||||
|
||||
|
@ -70,6 +92,7 @@ public class CommaSeparatedStringBuilder {
|
|||
|
||||
@Override
|
||||
public String toString() {
|
||||
commit(true);
|
||||
return b.toString();
|
||||
}
|
||||
|
||||
|
@ -81,7 +104,7 @@ public class CommaSeparatedStringBuilder {
|
|||
|
||||
public void addAll(List<String> list) {
|
||||
for (String s : list) {
|
||||
append(s);
|
||||
appendIfNotNull(s);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue