private Row readRow(Element row) throws DOMException, FHIRException { Row res = new Row(); int ndx = 1; NodeList cells = row.getElementsByTagNameNS(XLS_NS, "Cell"); for (int i = 0; i < cells.getLength(); i++) { Element cell = (Element) cells.item(i); if (cell.hasAttributeNS(XLS_NS, "Index")) { int index = Integer.parseInt(cell.getAttributeNS(XLS_NS, "Index")); while (ndx < index) { res.add(""); ndx++; } } res.add(readData(cell, ndx, res.size() > 0 ? res.get(0) : "?")); ndx++; } return res; }
public String getColumn(int row, String column) { int c = -1; String s = ""; for (int i = 0; i < columns.size(); i++) { s = s + ","+columns.get(i); if (columns.get(i).equalsIgnoreCase(column)) c = i; } if (c == -1) return ""; // throw new FHIRException("unable to find column "+column+" in "+s.substring(1)); else if (rows.get(row).size() <= c) return ""; else { s = rows.get(row).get(c); return s == null ? "" : s.trim(); } }
public String getByColumnPrefix(int row, String column) { int c = -1; String s = ""; for (int i = 0; i < columns.size(); i++) { s = s + ","+columns.get(i); if (columns.get(i).startsWith(column)) c = i; } if (c == -1) return ""; // throw new FHIRException("unable to find column "+column+" in "+s.substring(1)); else if (rows.get(row).size() <= c) return ""; else return rows.get(row).get(c).trim(); }
private Row readRow(Element row) throws DOMException, FHIRException { Row res = new Row(); int ndx = 1; NodeList cells = row.getElementsByTagNameNS(XLS_NS, "Cell"); for (int i = 0; i < cells.getLength(); i++) { Element cell = (Element) cells.item(i); if (cell.hasAttributeNS(XLS_NS, "Index")) { int index = Integer.parseInt(cell.getAttributeNS(XLS_NS, "Index")); while (ndx < index) { res.add(""); ndx++; } } res.add(readData(cell, ndx, res.size() > 0 ? res.get(0) : "?")); ndx++; } return res; }
public String getColumn(int row, String column) { int c = -1; String s = ""; for (int i = 0; i < columns.size(); i++) { s = s + ","+columns.get(i); if (columns.get(i).equalsIgnoreCase(column)) c = i; } if (c == -1) return ""; // throw new FHIRException("unable to find column "+column+" in "+s.substring(1)); else if (rows.get(row).size() <= c) return ""; else { s = rows.get(row).get(c); return s == null ? "" : s.trim(); } }
public String getByColumnPrefix(int row, String column) { int c = -1; String s = ""; for (int i = 0; i < columns.size(); i++) { s = s + ","+columns.get(i); if (columns.get(i).startsWith(column)) c = i; } if (c == -1) return ""; // throw new FHIRException("unable to find column "+column+" in "+s.substring(1)); else if (rows.get(row).size() <= c) return ""; else return rows.get(row).get(c).trim(); }