Search in sources :

Example 1 with ComparisonRenderer

use of org.hl7.fhir.r5.comparison.ComparisonRenderer in project org.hl7.fhir.core by hapifhir.

the class ComparisonService method compareStructureDefinitions.

public static void compareStructureDefinitions(String dest, ValidationEngine validator, String left, String right, StructureDefinition resLeft, StructureDefinition resRight) throws IOException, FHIRException, EOperationOutcome {
    System.out.println("Comparing StructureDefinitions " + left + " to " + right);
    ComparisonSession session = new ComparisonSession(validator.getContext(), validator.getContext(), "Comparing Profiles", null);
    session.compare(resLeft, resRight);
    System.out.println("Generating output to " + dest + "...");
    Utilities.createDirectory(dest);
    ComparisonRenderer cr = new ComparisonRenderer(validator.getContext(), validator.getContext(), dest, session);
    cr.getTemplates().put("CodeSystem", new String(validator.getContext().getBinaries().get("template-comparison-CodeSystem.html")));
    cr.getTemplates().put("ValueSet", new String(validator.getContext().getBinaries().get("template-comparison-ValueSet.html")));
    cr.getTemplates().put("Profile", new String(validator.getContext().getBinaries().get("template-comparison-Profile.html")));
    cr.getTemplates().put("Index", new String(validator.getContext().getBinaries().get("template-comparison-index.html")));
    File htmlFile = cr.render(left, right);
    Desktop.getDesktop().browse(htmlFile.toURI());
    System.out.println("Done");
}
Also used : ComparisonSession(org.hl7.fhir.r5.comparison.ComparisonSession) ComparisonRenderer(org.hl7.fhir.r5.comparison.ComparisonRenderer) File(java.io.File)

Aggregations

File (java.io.File)1 ComparisonRenderer (org.hl7.fhir.r5.comparison.ComparisonRenderer)1 ComparisonSession (org.hl7.fhir.r5.comparison.ComparisonSession)1