use of org.hl7.fhir.definitions.parsers.spreadsheets.OldSpreadsheetParser in project kindling by HL7.
the class SourceParser method loadConformancePackages.
private void loadConformancePackages(String n, List<ValidationMessage> issues) throws Exception {
String usage = "core";
String[] v = ini.getStringProperty("profiles", n).split("\\:");
File spreadsheet = new CSFile(Utilities.path(rootDir, v[1]));
if (TextFile.fileToString(spreadsheet.getAbsolutePath()).contains("urn:schemas-microsoft-com:office:spreadsheet")) {
OldSpreadsheetParser sparser = new OldSpreadsheetParser(n, new CSFileInputStream(spreadsheet), spreadsheet.getName(), spreadsheet.getAbsolutePath(), definitions, srcDir, logger, registry, version, context, genDate, false, page, false, ini, wg(v[0]), definitions.getProfileIds(), fpUsages, page.getConceptMaps(), exceptionIfExcelNotNormalised, page.packageInfo(), page.getRc());
try {
Profile pack = new Profile(usage);
pack.setTitle(n);
pack.setSource(spreadsheet.getAbsolutePath());
pack.setSourceType(ConformancePackageSourceType.Spreadsheet);
if (definitions.getPackMap().containsKey(n))
throw new Exception("Duplicate Pack id " + n);
definitions.getPackList().add(pack);
definitions.getPackMap().put(n, pack);
sparser.parseConformancePackage(pack, definitions, Utilities.getDirectoryForFile(spreadsheet.getAbsolutePath()), pack.getCategory(), issues, null);
errors.addAll(sparser.getErrors());
} catch (Exception e) {
throw new Exception("Error Parsing StructureDefinition: '" + n + "': " + e.getMessage(), e);
}
} else {
Profile pack = new Profile(usage);
parseConformanceDocument(pack, n, spreadsheet, usage, null);
if (definitions.getPackMap().containsKey(n))
throw new Exception("Duplicate Pack id " + n);
definitions.getPackList().add(pack);
definitions.getPackMap().put(n, pack);
throw new Error("check this!");
}
}
Aggregations