use of org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseItemComponent in project org.hl7.fhir.core by hapifhir.
the class QuestionnaireResponseRenderer method genDefinitionLink.
public void genDefinitionLink(HierarchicalTableGenerator gen, QuestionnaireResponseItemComponent i, Cell defn) {
// can we resolve the definition?
String path = null;
String d = i.getDefinition();
if (d.contains("#")) {
path = d.substring(d.indexOf("#") + 1);
d = d.substring(0, d.indexOf("#"));
}
StructureDefinition sd = context.getWorker().fetchResource(StructureDefinition.class, d);
if (sd != null) {
String url = sd.getUserString("path");
if (url != null) {
defn.getPieces().add(gen.new Piece(url + "#" + path, path, null));
} else {
defn.getPieces().add(gen.new Piece(null, i.getDefinition(), null));
}
} else {
defn.getPieces().add(gen.new Piece(null, i.getDefinition(), null));
}
}
use of org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseItemComponent in project org.hl7.fhir.core by hapifhir.
the class QuestionnaireResponseRenderer method genDefinitionLink.
public void genDefinitionLink(XhtmlNode x, QuestionnaireResponseItemComponent i) {
// can we resolve the definition?
String path = null;
String d = i.getDefinition();
if (d.contains("#")) {
path = d.substring(d.indexOf("#") + 1);
d = d.substring(0, d.indexOf("#"));
}
StructureDefinition sd = context.getWorker().fetchResource(StructureDefinition.class, d);
if (sd != null) {
String url = sd.getUserString("path");
if (url != null) {
x.ah(url + "#" + path).tx(path);
} else {
x.tx(i.getDefinition());
}
} else {
x.tx(i.getDefinition());
}
}
use of org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseItemComponent in project org.hl7.fhir.core by hapifhir.
the class QuestionnaireResponseRenderer method genDefinitionLink.
public void genDefinitionLink(HierarchicalTableGenerator gen, QuestionnaireResponseItemComponent i, Cell defn) {
// can we resolve the definition?
String path = null;
String d = i.getDefinition();
if (d.contains("#")) {
path = d.substring(d.indexOf("#") + 1);
d = d.substring(0, d.indexOf("#"));
}
StructureDefinition sd = context.getWorker().fetchResource(StructureDefinition.class, d);
if (sd != null) {
String url = sd.getUserString("path");
if (url != null) {
defn.getPieces().add(gen.new Piece(url + "#" + path, path, null));
} else {
defn.getPieces().add(gen.new Piece(null, i.getDefinition(), null));
}
} else {
defn.getPieces().add(gen.new Piece(null, i.getDefinition(), null));
}
}
use of org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseItemComponent in project org.hl7.fhir.core by hapifhir.
the class QuestionnaireResponseRenderer method renderTreeItem.
private boolean renderTreeItem(HierarchicalTableGenerator gen, List<Row> rows, QuestionnaireResponse q, QuestionnaireResponseItemComponent i) throws IOException {
Row r = gen.new Row();
rows.add(r);
boolean hasExt = false;
boolean hasItem = i.hasItem();
for (QuestionnaireResponseItemAnswerComponent a : i.getAnswer()) {
hasItem = a.hasItem();
}
if (hasItem) {
r.setIcon("icon-q-group.png", "Group");
} else {
r.setIcon("icon-q-string.png", "Item");
}
r.getCells().add(gen.new Cell(null, context.getDefinitionsTarget() == null ? "" : context.getDefinitionsTarget() + "#item." + i.getLinkId(), i.getLinkId(), null, null));
r.getCells().add(gen.new Cell(null, null, i.getText(), null, null));
r.getCells().add(gen.new Cell(null, null, null, null, null));
r.getCells().add(gen.new Cell(null, null, null, null, null));
return hasExt;
}
use of org.hl7.fhir.r5.model.QuestionnaireResponse.QuestionnaireResponseItemComponent in project org.hl7.fhir.core by hapifhir.
the class QuestionnaireResponseRenderer method genDefinitionLink.
public void genDefinitionLink(XhtmlNode x, QuestionnaireResponseItemComponent i) {
// can we resolve the definition?
String path = null;
String d = i.getDefinition();
if (d.contains("#")) {
path = d.substring(d.indexOf("#") + 1);
d = d.substring(0, d.indexOf("#"));
}
StructureDefinition sd = context.getWorker().fetchResource(StructureDefinition.class, d);
if (sd != null) {
String url = sd.getUserString("path");
if (url != null) {
x.ah(url + "#" + path).tx(path);
} else {
x.tx(i.getDefinition());
}
} else {
x.tx(i.getDefinition());
}
}
Aggregations