Search in sources :

Example 26 with Base

use of org.hl7.fhir.dstu2016may.model.Base in project kindling by HL7.

the class PageProcessor method generateConstraintsTable.

private void generateConstraintsTable(String path, ElementDefn e, Map<String, String> invs, boolean base, String prefix) throws Exception {
    for (Invariant inv : e.getInvariants().values()) {
        String s = "";
        if (base)
            s = "<tr><td><b title=\"Formal Invariant Identifier\">" + inv.getId() + "</b></td><td>" + presentLevel(inv) + "</td><td>(base)</td><td>" + Utilities.escapeXml(inv.getEnglish()) + "</td><td><span style=\"font-family: Courier New, monospace\">" + Utilities.escapeXml(inv.getExpression()) + "</span>";
        else
            s = "<tr><td><b title=\"Formal Invariant Identifier\">" + inv.getId() + "</b></td><td>" + presentLevel(inv) + "</td><td>" + path + "</td><td>" + Utilities.escapeXml(inv.getEnglish()) + "</td><td><span style=\"font-family: Courier New, monospace\">" + Utilities.escapeXml(inv.getExpression()) + "</span>";
        if (!Utilities.noString(inv.getExplanation()))
            s = s + "<br/>This is (only) a best practice guideline because: <blockquote>" + processMarkdown("best practice guideline", inv.getExplanation(), prefix) + "</blockquote>";
        s = s + "</td></tr>";
        invs.put(inv.getId(), s);
    }
    for (ElementDefn c : e.getElements()) {
        generateConstraintsTable(path + "." + c.getName(), c, invs, false, prefix);
    }
}
Also used : Invariant(org.hl7.fhir.definitions.model.Invariant) ElementDefn(org.hl7.fhir.definitions.model.ElementDefn)

Example 27 with Base

use of org.hl7.fhir.dstu2016may.model.Base in project kindling by HL7.

the class PageProcessor method generateConstraints.

private void generateConstraints(String path, ElementDefn e, Map<String, String> invs, boolean base, String prefix) throws Exception {
    for (Invariant inv : e.getInvariants().values()) {
        String s = "";
        if (base)
            s = "<li>" + presentLevel(inv) + " <b title=\"Formal Invariant Identifier\">" + inv.getId() + "</b>: " + Utilities.escapeXml(inv.getEnglish()) + " (<a href=\"http://hl7.org/fhirpath\">expression</a>: <span style=\"font-family: Courier New, monospace\">" + Utilities.escapeXml(inv.getExpression()) + "</span>)";
        else
            s = "<li>" + presentLevel(inv) + " <b title=\"Formal Invariant Identifier\">" + inv.getId() + "</b>: On " + path + ": " + Utilities.escapeXml(inv.getEnglish()) + " (<a href=\"http://hl7.org/fhirpath\">expression</a> on " + presentPath(path) + ": <span style=\"font-family: Courier New, monospace\">" + Utilities.escapeXml(inv.getExpression()) + "</span>)";
        if (!Utilities.noString(inv.getExplanation()))
            s = s + ". This is (only) a best practice guideline because: <blockquote>" + processMarkdown("best practice guideline", inv.getExplanation(), prefix) + "</blockquote>";
        invs.put(inv.getId(), s + "</li>");
    }
    for (ElementDefn c : e.getElements()) {
        generateConstraints(path + "." + c.getName(), c, invs, false, prefix);
    }
}
Also used : Invariant(org.hl7.fhir.definitions.model.Invariant) ElementDefn(org.hl7.fhir.definitions.model.ElementDefn)

Example 28 with Base

use of org.hl7.fhir.dstu2016may.model.Base in project kindling by HL7.

the class PageProcessor method atHeader.

private String atHeader(String mode) {
    StringBuilder b = new StringBuilder();
    b.append("<ul class=\"nav nav-tabs\">");
    b.append(makeHeaderTab("Type Framework", "types.html", mode == null || "base".equals(mode)));
    b.append(makeHeaderTab("Detailed Descriptions", "types-definitions.html", mode == null || "definitions".equals(mode)));
    b.append(makeHeaderTab("Mappings", "types-mappings.html", mode == null || "mappings".equals(mode)));
    b.append(makeHeaderTab("Profiles and Extensions", "types-extras.html", mode == null || "extras".equals(mode)));
    b.append(makeHeaderTab("R3 Conversions", "types-version-maps.html", mode == null || "conversions".equals(mode)));
    b.append("</ul>\r\n");
    return b.toString();
}
Also used : CommaSeparatedStringBuilder(org.hl7.fhir.utilities.CommaSeparatedStringBuilder)

Example 29 with Base

use of org.hl7.fhir.dstu2016may.model.Base in project kindling by HL7.

the class PageProcessor method belHeader.

private String belHeader(String mode) {
    StringBuilder b = new StringBuilder();
    b.append("<ul class=\"nav nav-tabs\">");
    b.append(makeHeaderTab("Element", "backboneelement.html", mode == null || "base".equals(mode)));
    b.append(makeHeaderTab("Detailed Descriptions", "backboneelement-definitions.html", mode == null || "definitions".equals(mode)));
    b.append("</ul>\r\n");
    return b.toString();
}
Also used : CommaSeparatedStringBuilder(org.hl7.fhir.utilities.CommaSeparatedStringBuilder)

Example 30 with Base

use of org.hl7.fhir.dstu2016may.model.Base in project kindling by HL7.

the class PageProcessor method edHeader.

private String edHeader(String mode) {
    StringBuilder b = new StringBuilder();
    b.append("<ul class=\"nav nav-tabs\">");
    b.append(makeHeaderTab("Element Definition", "elementdefinition.html", mode == null || "base".equals(mode)));
    b.append(makeHeaderTab("Examples", "elementdefinition-examples.html", mode == null || "examples".equals(mode)));
    b.append(makeHeaderTab("Detailed Descriptions", "elementdefinition-definitions.html", mode == null || "definitions".equals(mode)));
    b.append(makeHeaderTab("Mappings", "elementdefinition-mappings.html", mode == null || "mappings".equals(mode)));
    b.append(makeHeaderTab("Extensions", "elementdefinition-extras.html", mode == null || "extensions".equals(mode)));
    b.append("</ul>\r\n");
    return b.toString();
}
Also used : CommaSeparatedStringBuilder(org.hl7.fhir.utilities.CommaSeparatedStringBuilder)

Aggregations

ArrayList (java.util.ArrayList)324 FHIRException (org.hl7.fhir.exceptions.FHIRException)177 Base (org.hl7.fhir.r4b.model.Base)87 Base (org.hl7.fhir.r5.model.Base)87 DefinitionException (org.hl7.fhir.exceptions.DefinitionException)76 CommaSeparatedStringBuilder (org.hl7.fhir.utilities.CommaSeparatedStringBuilder)70 ValidationMessage (org.hl7.fhir.utilities.validation.ValidationMessage)66 PathEngineException (org.hl7.fhir.exceptions.PathEngineException)64 StructureDefinition (org.hl7.fhir.r5.model.StructureDefinition)55 NotImplementedException (org.apache.commons.lang3.NotImplementedException)47 Base (org.hl7.fhir.dstu2016may.model.Base)47 UcumException (org.fhir.ucum.UcumException)43 ElementDefinition (org.hl7.fhir.r5.model.ElementDefinition)41 Base (org.hl7.fhir.dstu2.model.Base)40 BigDecimal (java.math.BigDecimal)39 IOException (java.io.IOException)37 ParserBase (org.hl7.fhir.dstu2016may.metamodel.ParserBase)34 FileOutputStream (java.io.FileOutputStream)29 ElementDefinition (org.hl7.fhir.dstu3.model.ElementDefinition)28 StructureDefinition (org.hl7.fhir.dstu3.model.StructureDefinition)28