Search in sources :

Example 1 with ConceptMapSpreadsheetGenerator

use of org.hl7.fhir.r5.renderers.spreadsheets.ConceptMapSpreadsheetGenerator in project org.hl7.fhir.core by hapifhir.

the class ConceptMapSpreadsheetGenerator method renderConceptMap.

public ConceptMapSpreadsheetGenerator renderConceptMap(ConceptMap cm) {
    addConceptMapMetadata(renderCanonicalResource(cm), cm);
    int i = 0;
    for (ConceptMapGroupComponent grp : cm.getGroup()) {
        renderGroup(grp, i);
        i++;
    }
    return this;
}
Also used : ConceptMapGroupComponent(org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupComponent)

Example 2 with ConceptMapSpreadsheetGenerator

use of org.hl7.fhir.r5.renderers.spreadsheets.ConceptMapSpreadsheetGenerator in project org.hl7.fhir.core by hapifhir.

the class ValidationService method generateSpreadsheet.

public void generateSpreadsheet(CliContext cliContext, ValidationEngine validator) throws Exception {
    CanonicalResource cr = validator.loadCanonicalResource(cliContext.getSources().get(0), cliContext.getSv());
    boolean ok = true;
    if (cr instanceof StructureDefinition) {
        new StructureDefinitionSpreadsheetGenerator(validator.getContext(), false, false).renderStructureDefinition((StructureDefinition) cr).finish(new FileOutputStream(cliContext.getOutput()));
    } else if (cr instanceof CodeSystem) {
        new CodeSystemSpreadsheetGenerator(validator.getContext()).renderCodeSystem((CodeSystem) cr).finish(new FileOutputStream(cliContext.getOutput()));
    } else if (cr instanceof ValueSet) {
        new ValueSetSpreadsheetGenerator(validator.getContext()).renderValueSet((ValueSet) cr).finish(new FileOutputStream(cliContext.getOutput()));
    } else if (cr instanceof ConceptMap) {
        new ConceptMapSpreadsheetGenerator(validator.getContext()).renderConceptMap((ConceptMap) cr).finish(new FileOutputStream(cliContext.getOutput()));
    } else {
        ok = false;
        System.out.println(" ...Unable to generate spreadsheet for " + cliContext.getSources().get(0) + ": no way to generate a spreadsheet for a " + cr.fhirType());
    }
    if (ok) {
        System.out.println(" ...generated spreadsheet successfully");
    }
}
Also used : StructureDefinitionSpreadsheetGenerator(org.hl7.fhir.r5.renderers.spreadsheets.StructureDefinitionSpreadsheetGenerator) FileOutputStream(java.io.FileOutputStream) CodeSystemSpreadsheetGenerator(org.hl7.fhir.r5.renderers.spreadsheets.CodeSystemSpreadsheetGenerator) ValueSetSpreadsheetGenerator(org.hl7.fhir.r5.renderers.spreadsheets.ValueSetSpreadsheetGenerator) ConceptMapSpreadsheetGenerator(org.hl7.fhir.r5.renderers.spreadsheets.ConceptMapSpreadsheetGenerator)

Example 3 with ConceptMapSpreadsheetGenerator

use of org.hl7.fhir.r5.renderers.spreadsheets.ConceptMapSpreadsheetGenerator in project org.hl7.fhir.core by hapifhir.

the class ConceptMapSpreadsheetGenerator method renderConceptMap.

public ConceptMapSpreadsheetGenerator renderConceptMap(ConceptMap cm) {
    addConceptMapMetadata(renderCanonicalResource(cm), cm);
    int i = 0;
    for (ConceptMapGroupComponent grp : cm.getGroup()) {
        renderGroup(grp, i);
        i++;
    }
    return this;
}
Also used : ConceptMapGroupComponent(org.hl7.fhir.r4b.model.ConceptMap.ConceptMapGroupComponent)

Aggregations

FileOutputStream (java.io.FileOutputStream)1 ConceptMapGroupComponent (org.hl7.fhir.r4b.model.ConceptMap.ConceptMapGroupComponent)1 ConceptMapGroupComponent (org.hl7.fhir.r5.model.ConceptMap.ConceptMapGroupComponent)1 CodeSystemSpreadsheetGenerator (org.hl7.fhir.r5.renderers.spreadsheets.CodeSystemSpreadsheetGenerator)1 ConceptMapSpreadsheetGenerator (org.hl7.fhir.r5.renderers.spreadsheets.ConceptMapSpreadsheetGenerator)1 StructureDefinitionSpreadsheetGenerator (org.hl7.fhir.r5.renderers.spreadsheets.StructureDefinitionSpreadsheetGenerator)1 ValueSetSpreadsheetGenerator (org.hl7.fhir.r5.renderers.spreadsheets.ValueSetSpreadsheetGenerator)1