Search in sources :

Example 1 with DataTypeTableGenerator

use of org.hl7.fhir.definitions.generators.specification.DataTypeTableGenerator in project kindling by HL7.

the class Publisher method genXhtmlProfile.

private void genXhtmlProfile() throws Exception {
    StructureDefinition profile = new ProfileGenerator(page.getDefinitions(), page.getWorkerContext(), page, page.getGenDate(), page.getVersion(), dataElements, fpUsages, page.getFolders().rootDir, page.getUml(), page.getRc()).generateXhtml();
    if (page.getProfiles().has(profile.getUrl()))
        throw new Exception("Duplicate Profile URL " + profile.getUrl());
    page.getProfiles().see(profile, page.packageInfo());
// DataTypeTableGenerator dtg = new DataTypeTableGenerator(page.getFolders().dstDir, page, t.getCode(), true);
// t.setProfile(profile);
// t.getProfile().getText().setDiv(new XhtmlNode(NodeType.Element, "div"));
// t.getProfile().getText().getDiv().getChildNodes().add(dtg.generate(t));
}
Also used : StructureDefinition(org.hl7.fhir.r5.model.StructureDefinition) ProfileGenerator(org.hl7.fhir.definitions.generators.specification.ProfileGenerator) TransformerException(javax.xml.transform.TransformerException) IOException(java.io.IOException) FHIRException(org.hl7.fhir.exceptions.FHIRException) FileNotFoundException(java.io.FileNotFoundException) UnsupportedEncodingException(java.io.UnsupportedEncodingException)

Example 2 with DataTypeTableGenerator

use of org.hl7.fhir.definitions.generators.specification.DataTypeTableGenerator in project kindling by HL7.

the class Publisher method genPrimitiveTypeProfile.

private void genPrimitiveTypeProfile(PrimitiveType t) throws Exception {
    StructureDefinition profile = new ProfileGenerator(page.getDefinitions(), page.getWorkerContext(), page, page.getGenDate(), page.getVersion(), dataElements, fpUsages, page.getFolders().rootDir, page.getUml(), page.getRc()).generate(t);
    if (page.getProfiles().has(profile.getUrl()))
        throw new Exception("Duplicate Profile URL " + profile.getUrl());
    page.getProfiles().see(profile, page.packageInfo());
    t.setProfile(profile);
// DataTypeTableGenerator dtg = new DataTypeTableGenerator(page.getFolders().dstDir, page, t.getCode(), true);
// t.setProfile(profile);
// t.getProfile().getText().setDiv(new XhtmlNode(NodeType.Element, "div"));
// t.getProfile().getText().getDiv().getChildNodes().add(dtg.generate(t));
}
Also used : StructureDefinition(org.hl7.fhir.r5.model.StructureDefinition) ProfileGenerator(org.hl7.fhir.definitions.generators.specification.ProfileGenerator) TransformerException(javax.xml.transform.TransformerException) IOException(java.io.IOException) FHIRException(org.hl7.fhir.exceptions.FHIRException) FileNotFoundException(java.io.FileNotFoundException) UnsupportedEncodingException(java.io.UnsupportedEncodingException)

Example 3 with DataTypeTableGenerator

use of org.hl7.fhir.definitions.generators.specification.DataTypeTableGenerator in project kindling by HL7.

the class Publisher method genPrimitiveTypeProfile.

private void genPrimitiveTypeProfile(DefinedStringPattern t) throws Exception {
    StructureDefinition profile = new ProfileGenerator(page.getDefinitions(), page.getWorkerContext(), page, page.getGenDate(), page.getVersion(), dataElements, fpUsages, page.getFolders().rootDir, page.getUml(), page.getRc()).generate(t);
    if (page.getProfiles().has(profile.getUrl()))
        throw new Exception("Duplicate Profile URL " + profile.getUrl());
    page.getProfiles().see(profile, page.packageInfo());
    t.setProfile(profile);
// DataTypeTableGenerator dtg = new DataTypeTableGenerator(page.getFolders().dstDir, page, t.getCode(), true);
// t.setProfile(profile);
// t.getProfile().getText().setDiv(new XhtmlNode(NodeType.Element, "div"));
// t.getProfile().getText().getDiv().getChildNodes().add(dtg.generate(t));
}
Also used : StructureDefinition(org.hl7.fhir.r5.model.StructureDefinition) ProfileGenerator(org.hl7.fhir.definitions.generators.specification.ProfileGenerator) TransformerException(javax.xml.transform.TransformerException) IOException(java.io.IOException) FHIRException(org.hl7.fhir.exceptions.FHIRException) FileNotFoundException(java.io.FileNotFoundException) UnsupportedEncodingException(java.io.UnsupportedEncodingException)

Example 4 with DataTypeTableGenerator

use of org.hl7.fhir.definitions.generators.specification.DataTypeTableGenerator in project kindling by HL7.

the class SourceParser method genTypeProfile.

private void genTypeProfile(org.hl7.fhir.definitions.model.TypeDefn t) throws Exception {
    StructureDefinition profile;
    try {
        profile = new ProfileGenerator(definitions, context, page, genDate, version, null, fpUsages, page.getFolders().rootDir, page.getUml(), page.getRc()).generate(t);
        t.setProfile(profile);
        DataTypeTableGenerator dtg = new DataTypeTableGenerator(dstDir, page, t.getName(), true, version);
        t.getProfile().getText().setDiv(new XhtmlNode(NodeType.Element, "div"));
        t.getProfile().getText().getDiv().getChildNodes().add(dtg.generate(t, null, false));
        if (context.hasResource(StructureDefinition.class, t.getProfile().getUrl()))
            throw new Exception("Duplicate Profile " + t.getProfile().getUrl());
        context.cacheResource(t.getProfile());
    } catch (Exception e) {
        throw new Exception("Error generating profile for '" + t.getName() + "': " + e.getMessage(), e);
    }
}
Also used : StructureDefinition(org.hl7.fhir.r5.model.StructureDefinition) ProfileGenerator(org.hl7.fhir.definitions.generators.specification.ProfileGenerator) DataTypeTableGenerator(org.hl7.fhir.definitions.generators.specification.DataTypeTableGenerator) IOException(java.io.IOException) FHIRException(org.hl7.fhir.exceptions.FHIRException) FileNotFoundException(java.io.FileNotFoundException) SAXException(org.xml.sax.SAXException) ParserConfigurationException(javax.xml.parsers.ParserConfigurationException) XhtmlNode(org.hl7.fhir.utilities.xhtml.XhtmlNode)

Example 5 with DataTypeTableGenerator

use of org.hl7.fhir.definitions.generators.specification.DataTypeTableGenerator in project kindling by HL7.

the class Publisher method genTypeProfile.

private void genTypeProfile(TypeDefn t) throws Exception {
    StructureDefinition profile;
    try {
        profile = new ProfileGenerator(page.getDefinitions(), page.getWorkerContext(), page, page.getGenDate(), page.getVersion(), dataElements, fpUsages, page.getFolders().rootDir, page.getUml(), page.getRc()).generate(t);
        page.getProfiles().see(profile, page.packageInfo());
        t.setProfile(profile);
        DataTypeTableGenerator dtg = new DataTypeTableGenerator(page.getFolders().dstDir, page, t.getName(), true, page.getVersion());
        t.getProfile().getText().setDiv(new XhtmlNode(NodeType.Element, "div"));
        t.getProfile().getText().getDiv().getChildNodes().add(dtg.generate(t, null, false));
    } catch (Exception e) {
        throw new Exception("Error generating profile for '" + t.getName() + "': " + e.getMessage(), e);
    }
}
Also used : StructureDefinition(org.hl7.fhir.r5.model.StructureDefinition) ProfileGenerator(org.hl7.fhir.definitions.generators.specification.ProfileGenerator) DataTypeTableGenerator(org.hl7.fhir.definitions.generators.specification.DataTypeTableGenerator) TransformerException(javax.xml.transform.TransformerException) IOException(java.io.IOException) FHIRException(org.hl7.fhir.exceptions.FHIRException) FileNotFoundException(java.io.FileNotFoundException) UnsupportedEncodingException(java.io.UnsupportedEncodingException) XhtmlNode(org.hl7.fhir.utilities.xhtml.XhtmlNode)

Aggregations

FileNotFoundException (java.io.FileNotFoundException)5 IOException (java.io.IOException)5 ProfileGenerator (org.hl7.fhir.definitions.generators.specification.ProfileGenerator)5 FHIRException (org.hl7.fhir.exceptions.FHIRException)5 StructureDefinition (org.hl7.fhir.r5.model.StructureDefinition)5 UnsupportedEncodingException (java.io.UnsupportedEncodingException)4 TransformerException (javax.xml.transform.TransformerException)4 DataTypeTableGenerator (org.hl7.fhir.definitions.generators.specification.DataTypeTableGenerator)2 XhtmlNode (org.hl7.fhir.utilities.xhtml.XhtmlNode)2 ParserConfigurationException (javax.xml.parsers.ParserConfigurationException)1 SAXException (org.xml.sax.SAXException)1