use of org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionSlicingDiscriminatorComponent in project kindling by HL7.
the class XmlSpecGenerator method describeSlicing.
private String describeSlicing(ElementDefinitionSlicingComponent slicing) {
CommaSeparatedStringBuilder csv = new CommaSeparatedStringBuilder();
for (ElementDefinitionSlicingDiscriminatorComponent d : slicing.getDiscriminator()) {
csv.append(d.getType().toCode() + ":" + d.getPath());
}
String s = slicing.getOrdered() ? " in any order" : " in the specified order" + (slicing.hasRules() ? slicing.getRules().getDisplay() : "");
return " sliced by " + csv.toString() + " " + s;
}
use of org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionSlicingDiscriminatorComponent in project kindling by HL7.
the class JsonSpecGenerator method describeSlicing.
private String describeSlicing(ElementDefinitionSlicingComponent slicing) {
CommaSeparatedStringBuilder csv = new CommaSeparatedStringBuilder();
for (ElementDefinitionSlicingDiscriminatorComponent d : slicing.getDiscriminator()) {
csv.append(d.getType().toCode() + ":" + d.getPath());
}
String s = slicing.getOrdered() ? " in any order, " : " in the specified order, " + (slicing.hasRules() ? slicing.getRules().getDisplay() : "");
return " sliced by " + csv.toString() + " " + s;
}
use of org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionSlicingDiscriminatorComponent in project kindling by HL7.
the class DictHTMLGenerator method generateSlicing.
private void generateSlicing(StructureDefinition profile, ElementDefinitionSlicingComponent slicing) throws IOException {
StringBuilder b = new StringBuilder();
if (slicing.getOrdered())
b.append("<li>ordered</li>");
else
b.append("<li>unordered</li>");
if (slicing.hasRules())
b.append("<li>" + slicing.getRules().getDisplay() + "</li>");
if (!slicing.getDiscriminator().isEmpty()) {
b.append("<li>discriminators: ");
boolean first = true;
for (ElementDefinitionSlicingDiscriminatorComponent s : slicing.getDiscriminator()) {
if (first)
first = false;
else
b.append(", ");
b.append(s.getType().toCode() + ":" + s.getPath());
}
b.append("</li>");
}
tableRowNE("Slicing", "profiling.html#slicing", "This element introduces a set of slices. The slicing rules are: <ul> " + b.toString() + "</ul>");
}
use of org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionSlicingDiscriminatorComponent in project org.hl7.fhir.core by hapifhir.
the class ProfileUtilities method sliceSummary.
private String sliceSummary(ElementDefinition ed) {
if (!ed.hasSlicing() && !ed.hasSliceName())
return "";
if (ed.hasSliceName())
return " (slicename = " + ed.getSliceName() + ")";
StringBuilder b = new StringBuilder();
boolean first = true;
for (ElementDefinitionSlicingDiscriminatorComponent d : ed.getSlicing().getDiscriminator()) {
if (first)
first = false;
else
b.append("|");
b.append(d.getPath());
}
return " (slicing by " + b.toString() + ")";
}
use of org.hl7.fhir.r5.model.ElementDefinition.ElementDefinitionSlicingDiscriminatorComponent in project org.hl7.fhir.core by hapifhir.
the class ProfileUtilities method summariseSlicing.
private String summariseSlicing(ElementDefinitionSlicingComponent slice) {
StringBuilder b = new StringBuilder();
boolean first = true;
for (ElementDefinitionSlicingDiscriminatorComponent d : slice.getDiscriminator()) {
if (first)
first = false;
else
b.append(", ");
b.append(d);
}
b.append("(");
if (slice.hasOrdered())
b.append(slice.getOrderedElement().asStringValue());
b.append("/");
if (slice.hasRules())
b.append(slice.getRules().toCode());
b.append(")");
if (slice.hasDescription()) {
b.append(" \"");
b.append(slice.getDescription());
b.append("\"");
}
return b.toString();
}
Aggregations