use of org.hl7.fhir.utilities.xls.XLSXmlParser.Sheet in project kindling by HL7.
the class OldSpreadsheetParser method readEvents.
private void readEvents(Sheet sheet, ResourceDefn root) throws Exception {
if (sheet != null) {
for (int row = 0; row < sheet.rows.size(); row++) {
String code = sheet.getColumn(row, "Event Code");
if (code != null && !code.equals("") && !code.startsWith("!")) {
System.out.print("!!Lloyd Look at me! - event " + code + " on resource " + root.getName());
EventDefn e = new EventDefn();
events.add(e);
e.setCode(code);
e.setTitle(sheet.getColumn(row, "Title"));
e.setDefinition(Utilities.appendPeriod(sheet.getColumn(row, "Description")));
e.setCategory(readCategory(sheet.getColumn(row, "Category")));
EventUsage u = new EventUsage();
e.getUsages().add(u);
u.setNotes(sheet.getColumn(row, "Notes"));
for (String s : sheet.getColumn(row, "Request Resources").split(",")) {
s = s.trim();
if (!s.isEmpty())
u.getRequestResources().add(s);
}
for (String s : sheet.getColumn(row, "Request Aggregations").split("\n")) {
s = s.trim();
if (!s.isEmpty())
u.getRequestAggregations().add(s);
}
for (String s : sheet.getColumn(row, "Response Resources").split(",")) {
s = s.trim();
if (!s.isEmpty())
u.getResponseResources().add(s);
}
for (String s : sheet.getColumn(row, "Response Aggregations").split("\n")) {
s = s.trim();
if (!s.isEmpty())
u.getResponseAggregations().add(s);
}
for (String s : sheet.getColumn(row, "Follow Ups").split(",")) {
s = s.trim();
if (!s.isEmpty())
e.getFollowUps().add(s);
}
}
}
}
}
use of org.hl7.fhir.utilities.xls.XLSXmlParser.Sheet in project kindling by HL7.
the class SpreadSheetCreator method addPacks.
private void addPacks(XSSFWorkbook excel) throws FHIRFormatError, FileNotFoundException, IOException {
ListResource list = (ListResource) parseXml(fnPacks());
list.setText(null);
for (ListResourceEntryComponent li : list.getEntry()) {
String ref = li.getItem().getReference();
ref = ref.substring(ref.indexOf("/") + 1);
String id = ref.contains("-") ? ref.substring(ref.indexOf("-") + 1) : ref;
XSSFSheet sheet = excel.createSheet("Pack " + id);
addPackColumns(sheet);
addPack(sheet, ref);
}
}
use of org.hl7.fhir.utilities.xls.XLSXmlParser.Sheet in project kindling by HL7.
the class SpreadSheetCreator method addSearchParams.
private void addSearchParams(XSSFWorkbook excel) throws FHIRFormatError, FileNotFoundException, IOException {
Bundle bnd = (Bundle) parseXml(fnSP());
XSSFSheet sheet = excel.createSheet(SN_SEARCH);
addSearchColumns(sheet);
int rowCount = 0;
for (BundleEntryComponent be : bnd.getEntry()) {
rowCount++;
addSearchParam(sheet, (SearchParameter) be.getResource(), rowCount);
}
}
use of org.hl7.fhir.utilities.xls.XLSXmlParser.Sheet in project kindling by HL7.
the class SpreadSheetCreator method addOperations.
private void addOperations(XSSFWorkbook excel, XSSFSheet bindings) throws FHIRFormatError, FileNotFoundException, IOException {
ListResource list = (ListResource) parseXml(fnOperations());
list.setText(null);
XSSFSheet sheet = excel.createSheet(SN_OPERATIONS);
addOperationColumns(sheet);
int rowCount = 1;
for (ListResourceEntryComponent li : list.getEntry()) {
String ref = li.getItem().getReference();
ref = ref.substring(ref.indexOf("/") + 1);
OperationDefinition opd = (OperationDefinition) parseXml(fnOpDef(ref));
opd.setText(null);
rowCount = addOperation(sheet, bindings, opd, rowCount);
}
}
use of org.hl7.fhir.utilities.xls.XLSXmlParser.Sheet in project kindling by HL7.
the class SpreadSheetCreator method addOperation.
private int addOperation(XSSFSheet sheet, XSSFSheet bindings, OperationDefinition opd, int rowCount) {
Row row = sheet.createRow(rowCount++);
int columnCount = 0;
addCell(opd.getCode(), row, columnCount++);
addCell(use(opd), row, columnCount++);
addCell("", row, columnCount++);
addCell(type(opd), row, columnCount++);
addCell("", row, columnCount++);
addCell(opd.present(), row, columnCount++);
addCell(opd.getDescription(), row, columnCount++);
addCell(opd.getComment(), row, columnCount++);
addCell(ext(opd, BuildExtensions.EXT_FOOTER), row, columnCount++);
addCell(ext(opd, BuildExtensions.EXT_FOOTER2), row, columnCount++);
addCell(exlist(opd, false, "1"), row, columnCount++);
addCell(exlist(opd, true, "1"), row, columnCount++);
addCell(exlist(opd, false, "2"), row, columnCount++);
addCell(exlist(opd, true, "2"), row, columnCount++);
addCell(status(opd), row, columnCount++);
addCell(ext(opd, BuildExtensions.EXT_COMMITTEE_NOTES), row, columnCount++);
for (OperationDefinitionParameterComponent param : opd.getParameter()) {
rowCount = addOpParam(sheet, bindings, opd.getCode(), param, rowCount);
}
return rowCount;
}
Aggregations