use of org.hl7.fhir.utilities.xls.XLSXmlNormaliser in project kindling by HL7.
the class SourceParser method loadCompartments.
private void loadCompartments() throws FileNotFoundException, Exception {
XLSXmlParser xml = new XLSXmlParser(new CSFileInputStream(srcDir + "compartments.xml"), "compartments.xml");
new XLSXmlNormaliser(srcDir + "compartments.xml", exceptionIfExcelNotNormalised).go();
Sheet sheet = xml.getSheets().get("compartments");
for (int row = 0; row < sheet.rows.size(); row++) {
Compartment c = new Compartment();
c.setName(sheet.getColumn(row, "Name"));
if (!c.getName().startsWith("!")) {
c.setTitle(sheet.getColumn(row, "Title"));
c.setDescription(sheet.getColumn(row, "Description"));
c.setIdentity(sheet.getColumn(row, "Identification"));
c.setMembership(sheet.getColumn(row, "Inclusion"));
definitions.getCompartments().add(c);
}
}
sheet = xml.getSheets().get("resources");
for (int row = 0; row < sheet.rows.size(); row++) {
String mn = sheet.getColumn(row, "Resource");
if (!Utilities.noString(mn) && !mn.startsWith("!")) {
ResourceDefn r = definitions.getResourceByName(mn);
for (Compartment c : definitions.getCompartments()) {
c.getResources().put(r, sheet.getColumn(row, c.getName()));
}
}
}
}
Aggregations