use of org.hl7.fhir.r5.model.CompartmentDefinition in project org.hl7.fhir.core by hapifhir.
the class RdfParser method composeCompartmentDefinitionCompartmentDefinitionResourceComponent.
protected void composeCompartmentDefinitionCompartmentDefinitionResourceComponent(Complex parent, String parentType, String name, CompartmentDefinition.CompartmentDefinitionResourceComponent element, int index) {
if (element == null)
return;
Complex t;
if (Utilities.noString(parentType))
t = parent;
else {
t = parent.predicate("fhir:" + parentType + '.' + name);
}
composeBackboneElement(t, "resource", name, element, index);
if (element.hasCodeElement())
composeCode(t, "CompartmentDefinition", "code", element.getCodeElement(), -1);
for (int i = 0; i < element.getParam().size(); i++) composeString(t, "CompartmentDefinition", "param", element.getParam().get(i), i);
if (element.hasDocumentationElement())
composeString(t, "CompartmentDefinition", "documentation", element.getDocumentationElement(), -1);
}
use of org.hl7.fhir.r5.model.CompartmentDefinition in project org.hl7.fhir.core by hapifhir.
the class RdfParser method composeCompartmentDefinition.
protected void composeCompartmentDefinition(Complex parent, String parentType, String name, CompartmentDefinition element, int index) {
if (element == null)
return;
Complex t;
if (Utilities.noString(parentType))
t = parent;
else {
t = parent.predicate("fhir:" + parentType + '.' + name);
}
composeDomainResource(t, "CompartmentDefinition", name, element, index);
if (element.hasUrlElement())
composeUri(t, "CompartmentDefinition", "url", element.getUrlElement(), -1);
if (element.hasVersionElement())
composeString(t, "CompartmentDefinition", "version", element.getVersionElement(), -1);
if (element.hasNameElement())
composeString(t, "CompartmentDefinition", "name", element.getNameElement(), -1);
if (element.hasStatusElement())
composeEnum(t, "CompartmentDefinition", "status", element.getStatusElement(), -1);
if (element.hasExperimentalElement())
composeBoolean(t, "CompartmentDefinition", "experimental", element.getExperimentalElement(), -1);
if (element.hasDateElement())
composeDateTime(t, "CompartmentDefinition", "date", element.getDateElement(), -1);
if (element.hasPublisherElement())
composeString(t, "CompartmentDefinition", "publisher", element.getPublisherElement(), -1);
for (int i = 0; i < element.getContact().size(); i++) composeContactDetail(t, "CompartmentDefinition", "contact", element.getContact().get(i), i);
if (element.hasDescriptionElement())
composeMarkdown(t, "CompartmentDefinition", "description", element.getDescriptionElement(), -1);
for (int i = 0; i < element.getUseContext().size(); i++) composeUsageContext(t, "CompartmentDefinition", "useContext", element.getUseContext().get(i), i);
if (element.hasPurposeElement())
composeMarkdown(t, "CompartmentDefinition", "purpose", element.getPurposeElement(), -1);
if (element.hasCodeElement())
composeEnum(t, "CompartmentDefinition", "code", element.getCodeElement(), -1);
if (element.hasSearchElement())
composeBoolean(t, "CompartmentDefinition", "search", element.getSearchElement(), -1);
for (int i = 0; i < element.getResource().size(); i++) composeCompartmentDefinitionCompartmentDefinitionResourceComponent(t, "CompartmentDefinition", "resource", element.getResource().get(i), i);
}
use of org.hl7.fhir.r5.model.CompartmentDefinition in project org.hl7.fhir.core by hapifhir.
the class RdfParser method composeCompartmentDefinition.
protected void composeCompartmentDefinition(Complex parent, String parentType, String name, CompartmentDefinition element, int index) {
if (element == null)
return;
Complex t;
if (Utilities.noString(parentType))
t = parent;
else {
t = parent.predicate("fhir:" + parentType + '.' + name);
}
composeDomainResource(t, "CompartmentDefinition", name, element, index);
if (element.hasUrlElement())
composeUri(t, "CompartmentDefinition", "url", element.getUrlElement(), -1);
if (element.hasNameElement())
composeString(t, "CompartmentDefinition", "name", element.getNameElement(), -1);
if (element.hasStatusElement())
composeEnum(t, "CompartmentDefinition", "status", element.getStatusElement(), -1);
if (element.hasExperimentalElement())
composeBoolean(t, "CompartmentDefinition", "experimental", element.getExperimentalElement(), -1);
if (element.hasPublisherElement())
composeString(t, "CompartmentDefinition", "publisher", element.getPublisherElement(), -1);
for (int i = 0; i < element.getContact().size(); i++) composeCompartmentDefinitionCompartmentDefinitionContactComponent(t, "CompartmentDefinition", "contact", element.getContact().get(i), i);
if (element.hasDateElement())
composeDateTime(t, "CompartmentDefinition", "date", element.getDateElement(), -1);
if (element.hasDescriptionElement())
composeString(t, "CompartmentDefinition", "description", element.getDescriptionElement(), -1);
if (element.hasRequirementsElement())
composeString(t, "CompartmentDefinition", "requirements", element.getRequirementsElement(), -1);
if (element.hasCodeElement())
composeEnum(t, "CompartmentDefinition", "code", element.getCodeElement(), -1);
if (element.hasSearchElement())
composeBoolean(t, "CompartmentDefinition", "search", element.getSearchElement(), -1);
for (int i = 0; i < element.getResource().size(); i++) composeCompartmentDefinitionCompartmentDefinitionResourceComponent(t, "CompartmentDefinition", "resource", element.getResource().get(i), i);
}
use of org.hl7.fhir.r5.model.CompartmentDefinition in project org.hl7.fhir.core by hapifhir.
the class NarrativeGenerator method generate.
public boolean generate(ResourceContext rcontext, CompartmentDefinition cpd) {
StringBuilder in = new StringBuilder();
StringBuilder out = new StringBuilder();
for (CompartmentDefinitionResourceComponent cc : cpd.getResource()) {
CommaSeparatedStringBuilder rules = new CommaSeparatedStringBuilder();
if (!cc.hasParam()) {
out.append(" <li><a href=\"").append(cc.getCode().toLowerCase()).append(".html\">").append(cc.getCode()).append("</a></li>\r\n");
} else if (!rules.equals("{def}")) {
for (StringType p : cc.getParam()) rules.append(p.asStringValue());
in.append(" <tr><td><a href=\"").append(cc.getCode().toLowerCase()).append(".html\">").append(cc.getCode()).append("</a></td><td>").append(rules.toString()).append("</td></tr>\r\n");
}
}
XhtmlNode x;
try {
x = new XhtmlParser().parseFragment("<div><p>\r\nThe following resources may be in this compartment:\r\n</p>\r\n" + "<table class=\"grid\">\r\n" + " <tr><td><b>Resource</b></td><td><b>Inclusion Criteria</b></td></tr>\r\n" + in.toString() + "</table>\r\n" + "<p>\r\nA resource is in this compartment if the nominated search parameter (or chain) refers to the patient resource that defines the compartment.\r\n</p>\r\n" + "<p>\r\n\r\n</p>\r\n" + "<p>\r\nThe following resources are never in this compartment:\r\n</p>\r\n" + "<ul>\r\n" + out.toString() + "</ul></div>\r\n");
inject(cpd, x, NarrativeStatus.GENERATED);
return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
use of org.hl7.fhir.r5.model.CompartmentDefinition in project org.hl7.fhir.core by hapifhir.
the class NarrativeGenerator method generate.
public boolean generate(ResourceContext rcontext, CompartmentDefinition cpd) {
StringBuilder in = new StringBuilder();
StringBuilder out = new StringBuilder();
for (CompartmentDefinitionResourceComponent cc : cpd.getResource()) {
CommaSeparatedStringBuilder rules = new CommaSeparatedStringBuilder();
if (!cc.hasParam()) {
out.append(" <li><a href=\"").append(cc.getCode().toLowerCase()).append(".html\">").append(cc.getCode()).append("</a></li>\r\n");
} else if (!rules.equals("{def}")) {
for (StringType p : cc.getParam()) rules.append(p.asStringValue());
in.append(" <tr><td><a href=\"").append(cc.getCode().toLowerCase()).append(".html\">").append(cc.getCode()).append("</a></td><td>").append(rules.toString()).append("</td></tr>\r\n");
}
}
XhtmlNode x;
try {
x = new XhtmlParser().parseFragment("<div><p>\r\nThe following resources may be in this compartment:\r\n</p>\r\n" + "<table class=\"grid\">\r\n" + " <tr><td><b>Resource</b></td><td><b>Inclusion Criteria</b></td></tr>\r\n" + in.toString() + "</table>\r\n" + "<p>\r\nA resource is in this compartment if the nominated search parameter (or chain) refers to the patient resource that defines the compartment.\r\n</p>\r\n" + "<p>\r\n\r\n</p>\r\n" + "<p>\r\nThe following resources are never in this compartment:\r\n</p>\r\n" + "<ul>\r\n" + out.toString() + "</ul></div>\r\n");
inject(cpd, x, NarrativeStatus.GENERATED);
return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
Aggregations