Search in sources :

Example 26 with Sheet

use of org.hl7.fhir.utilities.xls.XLSXmlParser.Sheet in project org.hl7.fhir.core by hapifhir.

the class CodeSystemSpreadsheetGenerator method addFilters.

private void addFilters(List<CodeSystemFilterComponent> filters) {
    Sheet sheet = makeSheet("Filters");
    addHeaders(sheet, "Code", "Description", "Operators", "Value");
    for (CodeSystemFilterComponent f : filters) {
        CommaSeparatedStringBuilder cs = new CommaSeparatedStringBuilder();
        for (Enumeration<FilterOperator> op : f.getOperator()) {
            cs.append(op.asStringValue());
        }
        addRow(sheet, f.getCode(), f.getDescription(), cs.toString(), f.getValue());
    }
}
Also used : FilterOperator(org.hl7.fhir.r5.model.Enumerations.FilterOperator) CodeSystemFilterComponent(org.hl7.fhir.r5.model.CodeSystem.CodeSystemFilterComponent) CommaSeparatedStringBuilder(org.hl7.fhir.utilities.CommaSeparatedStringBuilder) Sheet(org.apache.poi.ss.usermodel.Sheet)

Example 27 with Sheet

use of org.hl7.fhir.utilities.xls.XLSXmlParser.Sheet in project org.hl7.fhir.core by hapifhir.

the class CodeSystemSpreadsheetGenerator method genExpansionParams.

private void genExpansionParams(List<ValueSetExpansionParameterComponent> params) {
    Sheet sheet = makeSheet("Expansion Parameters");
    addHeaders(sheet, "Parameter", "Value");
    for (ValueSetExpansionParameterComponent p : params) {
        addRow(sheet, p.getName(), dr.display(p.getValue()));
    }
}
Also used : ValueSetExpansionParameterComponent(org.hl7.fhir.r5.model.ValueSet.ValueSetExpansionParameterComponent) Sheet(org.apache.poi.ss.usermodel.Sheet)

Example 28 with Sheet

use of org.hl7.fhir.utilities.xls.XLSXmlParser.Sheet in project org.hl7.fhir.core by hapifhir.

the class CodeSystemSpreadsheetGenerator method addProperties.

private void addProperties(List<PropertyComponent> properties) {
    Sheet sheet = makeSheet("Properties");
    addHeaders(sheet, "Code", "Uri", "Description", "Type");
    for (PropertyComponent p : properties) {
        addRow(sheet, p.getCode(), p.getUri(), p.getDescription(), p.getTypeElement().asStringValue());
    }
}
Also used : PropertyComponent(org.hl7.fhir.r4b.model.CodeSystem.PropertyComponent) Sheet(org.apache.poi.ss.usermodel.Sheet)

Example 29 with Sheet

use of org.hl7.fhir.utilities.xls.XLSXmlParser.Sheet in project org.hl7.fhir.core by hapifhir.

the class CodeSystemSpreadsheetGenerator method addFilters.

private void addFilters(List<CodeSystemFilterComponent> filters) {
    Sheet sheet = makeSheet("Filters");
    addHeaders(sheet, "Code", "Description", "Operators", "Value");
    for (CodeSystemFilterComponent f : filters) {
        CommaSeparatedStringBuilder cs = new CommaSeparatedStringBuilder();
        for (Enumeration<FilterOperator> op : f.getOperator()) {
            cs.append(op.asStringValue());
        }
        addRow(sheet, f.getCode(), f.getDescription(), cs.toString(), f.getValue());
    }
}
Also used : FilterOperator(org.hl7.fhir.r4b.model.Enumerations.FilterOperator) CodeSystemFilterComponent(org.hl7.fhir.r4b.model.CodeSystem.CodeSystemFilterComponent) CommaSeparatedStringBuilder(org.hl7.fhir.utilities.CommaSeparatedStringBuilder) Sheet(org.apache.poi.ss.usermodel.Sheet)

Example 30 with Sheet

use of org.hl7.fhir.utilities.xls.XLSXmlParser.Sheet in project org.hl7.fhir.core by hapifhir.

the class CanonicalSpreadsheetGenerator method renderCanonicalResource.

protected Sheet renderCanonicalResource(CanonicalResource cr) {
    Sheet sheet = makeSheet("Metadata");
    Row headerRow = sheet.createRow(0);
    addCell(headerRow, 0, "Property", styles.get("header"));
    addCell(headerRow, 1, "Value", styles.get("header"));
    addMetadataRow(sheet, "URL", cr.getUrl());
    for (Identifier id : cr.getIdentifier()) {
        addMetadataRow(sheet, "Identifier", dr.display(id));
    }
    addMetadataRow(sheet, "Version", cr.getVersion());
    addMetadataRow(sheet, "Name", cr.getName());
    addMetadataRow(sheet, "Title", cr.getTitle());
    addMetadataRow(sheet, "Status", cr.getStatusElement().asStringValue());
    addMetadataRow(sheet, "Experimental", cr.getExperimentalElement().asStringValue());
    addMetadataRow(sheet, "Date", cr.getDateElement().asStringValue());
    addMetadataRow(sheet, "Publisher", cr.getPublisher());
    for (ContactDetail c : cr.getContact()) {
        addMetadataRow(sheet, "Contact", dr.display(c));
    }
    for (CodeableConcept j : cr.getJurisdiction()) {
        addMetadataRow(sheet, "Jurisdiction", dr.display(j));
    }
    addMetadataRow(sheet, "Description", cr.getDescription());
    addMetadataRow(sheet, "Purpose", cr.getPurpose());
    addMetadataRow(sheet, "Copyright", cr.getCopyright());
    configureSheet(sheet);
    return sheet;
}
Also used : ContactDetail(org.hl7.fhir.r4b.model.ContactDetail) Identifier(org.hl7.fhir.r4b.model.Identifier) Row(org.apache.poi.ss.usermodel.Row) Sheet(org.apache.poi.ss.usermodel.Sheet) CodeableConcept(org.hl7.fhir.r4b.model.CodeableConcept)

Aggregations

FHIRException (org.hl7.fhir.exceptions.FHIRException)18 Sheet (org.hl7.fhir.utilities.xls.XLSXmlParser.Sheet)15 Sheet (org.apache.poi.ss.usermodel.Sheet)14 Row (org.apache.poi.ss.usermodel.Row)13 XSSFSheet (org.apache.poi.xssf.usermodel.XSSFSheet)12 ArrayList (java.util.ArrayList)8 XSSFRow (org.apache.poi.xssf.usermodel.XSSFRow)8 ElementDefn (org.hl7.fhir.definitions.model.ElementDefn)8 Invariant (org.hl7.fhir.definitions.model.Invariant)8 XLSXmlParser (org.hl7.fhir.utilities.xls.XLSXmlParser)8 TypeRef (org.hl7.fhir.definitions.model.TypeRef)7 File (java.io.File)6 BindingSpecification (org.hl7.fhir.definitions.model.BindingSpecification)5 ResourceDefn (org.hl7.fhir.definitions.model.ResourceDefn)5 IniFile (org.hl7.fhir.utilities.IniFile)5 HashMap (java.util.HashMap)4 ConditionalFormattingRule (org.apache.poi.ss.usermodel.ConditionalFormattingRule)4 FontFormatting (org.apache.poi.ss.usermodel.FontFormatting)4 PatternFormatting (org.apache.poi.ss.usermodel.PatternFormatting)4 SheetConditionalFormatting (org.apache.poi.ss.usermodel.SheetConditionalFormatting)4