Search in sources :

Example 6 with XLSXmlParser

use of org.hl7.fhir.utilities.xls.XLSXmlParser in project kindling by HL7.

the class BindingsFixer method checkBindings.

private static void checkBindings(File f) throws Exception {
    System.out.println(f.getName());
    XLSXmlParser xls = new XLSXmlParser(new FileInputStream(f), f.getName());
    Sheet sheet = xls.getSheets().get("Bindings");
    if (sheet != null) {
        String sfx = "";
        processSheet(xls, sheet, Utilities.getDirectoryForFile(f.getAbsolutePath()), sfx);
    }
}
Also used : XLSXmlParser(org.hl7.fhir.utilities.xls.XLSXmlParser) Sheet(org.hl7.fhir.utilities.xls.XLSXmlParser.Sheet) FileInputStream(java.io.FileInputStream)

Example 7 with XLSXmlParser

use of org.hl7.fhir.utilities.xls.XLSXmlParser in project kindling by HL7.

the class SourceParser method loadPrimitives.

private void loadPrimitives() throws Exception {
    XLSXmlParser xls = new XLSXmlParser(new CSFileInputStream(dtDir + "primitives.xml"), "primitives");
    new XLSXmlNormaliser(dtDir + "primitives.xml", exceptionIfExcelNotNormalised).go();
    Sheet sheet = xls.getSheets().get("Imports");
    for (int row = 0; row < sheet.rows.size(); row++) {
        processImport(sheet, row);
    }
    sheet = xls.getSheets().get("Patterns");
    for (int row = 0; row < sheet.rows.size(); row++) {
        processStringPattern(sheet, row);
    }
}
Also used : XLSXmlParser(org.hl7.fhir.utilities.xls.XLSXmlParser) XLSXmlNormaliser(org.hl7.fhir.utilities.xls.XLSXmlNormaliser) Sheet(org.hl7.fhir.utilities.xls.XLSXmlParser.Sheet) CSFileInputStream(org.hl7.fhir.utilities.CSFileInputStream)

Example 8 with XLSXmlParser

use of org.hl7.fhir.utilities.xls.XLSXmlParser 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()));
            }
        }
    }
}
Also used : Compartment(org.hl7.fhir.definitions.model.Compartment) XLSXmlParser(org.hl7.fhir.utilities.xls.XLSXmlParser) XLSXmlNormaliser(org.hl7.fhir.utilities.xls.XLSXmlNormaliser) Sheet(org.hl7.fhir.utilities.xls.XLSXmlParser.Sheet) ResourceDefn(org.hl7.fhir.definitions.model.ResourceDefn) CSFileInputStream(org.hl7.fhir.utilities.CSFileInputStream)

Aggregations

XLSXmlParser (org.hl7.fhir.utilities.xls.XLSXmlParser)8 Sheet (org.hl7.fhir.utilities.xls.XLSXmlParser.Sheet)7 XLSXmlNormaliser (org.hl7.fhir.utilities.xls.XLSXmlNormaliser)5 CSFileInputStream (org.hl7.fhir.utilities.CSFileInputStream)4 File (java.io.File)3 FileInputStream (java.io.FileInputStream)2 ArrayList (java.util.ArrayList)2 FileNotFoundException (java.io.FileNotFoundException)1 FileOutputStream (java.io.FileOutputStream)1 IOException (java.io.IOException)1 Date (java.util.Date)1 ParserConfigurationException (javax.xml.parsers.ParserConfigurationException)1 BindingSpecification (org.hl7.fhir.definitions.model.BindingSpecification)1 BindingMethod (org.hl7.fhir.definitions.model.BindingSpecification.BindingMethod)1 Compartment (org.hl7.fhir.definitions.model.Compartment)1 Invariant (org.hl7.fhir.definitions.model.Invariant)1 ProfiledType (org.hl7.fhir.definitions.model.ProfiledType)1 ResourceDefn (org.hl7.fhir.definitions.model.ResourceDefn)1 TypeDefn (org.hl7.fhir.definitions.model.TypeDefn)1 TypeRef (org.hl7.fhir.definitions.model.TypeRef)1