Search in sources :

Example 1 with LoincToDEConvertor

use of org.hl7.fhir.r5.terminologies.LoincToDEConvertor in project kindling by HL7.

the class Publisher method buildLoincExample.

private String buildLoincExample(String filename) throws FileNotFoundException, Exception {
    LoincToDEConvertor conv = new LoincToDEConvertor();
    conv.setDefinitions(Utilities.path(page.getFolders().srcDir, "loinc", "loincS.xml"));
    conv.process();
    IParser xml = new XmlParser().setOutputStyle(OutputStyle.PRETTY);
    FileOutputStream s = new FileOutputStream(Utilities.path(page.getFolders().dstDir, filename + ".xml"));
    xml.compose(s, conv.getBundle());
    s.close();
    IParser json = new JsonParser().setOutputStyle(OutputStyle.PRETTY);
    s = new FileOutputStream(Utilities.path(page.getFolders().dstDir, filename + ".json"));
    json.compose(s, conv.getBundle());
    s.close();
    return "Loinc Narrative";
}
Also used : XmlParser(org.hl7.fhir.r5.formats.XmlParser) FileOutputStream(java.io.FileOutputStream) LoincToDEConvertor(org.hl7.fhir.r5.terminologies.LoincToDEConvertor) IParser(org.hl7.fhir.r5.formats.IParser) JsonParser(org.hl7.fhir.r5.formats.JsonParser)

Aggregations

FileOutputStream (java.io.FileOutputStream)1 IParser (org.hl7.fhir.r5.formats.IParser)1 JsonParser (org.hl7.fhir.r5.formats.JsonParser)1 XmlParser (org.hl7.fhir.r5.formats.XmlParser)1 LoincToDEConvertor (org.hl7.fhir.r5.terminologies.LoincToDEConvertor)1