use of org.hl7.fhir.definitions.model.Compartment in project org.hl7.fhir.core by hapifhir.
the class RdfParser method composeGraphDefinitionGraphDefinitionLinkTargetComponent.
protected void composeGraphDefinitionGraphDefinitionLinkTargetComponent(Complex parent, String parentType, String name, GraphDefinition.GraphDefinitionLinkTargetComponent element, int index) {
if (element == null)
return;
Complex t;
if (Utilities.noString(parentType))
t = parent;
else {
t = parent.predicate("fhir:" + parentType + '.' + name);
}
composeBackboneElement(t, "target", name, element, index);
if (element.hasTypeElement())
composeCode(t, "GraphDefinition", "type", element.getTypeElement(), -1);
if (element.hasParamsElement())
composeString(t, "GraphDefinition", "params", element.getParamsElement(), -1);
if (element.hasProfileElement())
composeCanonical(t, "GraphDefinition", "profile", element.getProfileElement(), -1);
for (int i = 0; i < element.getCompartment().size(); i++) composeGraphDefinitionGraphDefinitionLinkTargetCompartmentComponent(t, "GraphDefinition", "compartment", element.getCompartment().get(i), i);
for (int i = 0; i < element.getLink().size(); i++) composeGraphDefinitionGraphDefinitionLinkComponent(t, "GraphDefinition", "link", element.getLink().get(i), i);
}
use of org.hl7.fhir.definitions.model.Compartment in project org.hl7.fhir.core by hapifhir.
the class RdfParser method composeConformanceConformanceRestComponent.
protected void composeConformanceConformanceRestComponent(Complex parent, String parentType, String name, Conformance.ConformanceRestComponent element, int index) {
if (element == null)
return;
Complex t;
if (Utilities.noString(parentType))
t = parent;
else {
t = parent.predicate("fhir:" + parentType + '.' + name);
}
composeBackboneElement(t, "rest", name, element, index);
if (element.hasModeElement())
composeEnum(t, "Conformance", "mode", element.getModeElement(), -1);
if (element.hasDocumentationElement())
composeString(t, "Conformance", "documentation", element.getDocumentationElement(), -1);
if (element.hasSecurity())
composeConformanceConformanceRestSecurityComponent(t, "Conformance", "security", element.getSecurity(), -1);
for (int i = 0; i < element.getResource().size(); i++) composeConformanceConformanceRestResourceComponent(t, "Conformance", "resource", element.getResource().get(i), i);
for (int i = 0; i < element.getInteraction().size(); i++) composeConformanceSystemInteractionComponent(t, "Conformance", "interaction", element.getInteraction().get(i), i);
if (element.hasTransactionModeElement())
composeEnum(t, "Conformance", "transactionMode", element.getTransactionModeElement(), -1);
for (int i = 0; i < element.getSearchParam().size(); i++) composeConformanceConformanceRestResourceSearchParamComponent(t, "Conformance", "searchParam", element.getSearchParam().get(i), i);
for (int i = 0; i < element.getOperation().size(); i++) composeConformanceConformanceRestOperationComponent(t, "Conformance", "operation", element.getOperation().get(i), i);
for (int i = 0; i < element.getCompartment().size(); i++) composeUri(t, "Conformance", "compartment", element.getCompartment().get(i), i);
}
use of org.hl7.fhir.definitions.model.Compartment in project org.hl7.fhir.core by hapifhir.
the class CapabilityStatementComparer method compareRests.
private void compareRests(List<CapabilityStatementRestComponent> left, List<CapabilityStatementRestComponent> right, StructuralMatch<Element> combined, List<CapabilityStatementRestComponent> union, List<CapabilityStatementRestComponent> intersection, CapabilityStatement csU, CapabilityStatement csI, CapabilityStatementComparison res, String path) {
List<CapabilityStatementRestComponent> matchR = new ArrayList<>();
for (CapabilityStatementRestComponent l : left) {
CapabilityStatementRestComponent r = findInList(right, l);
if (r == null) {
union.add(l);
combined.getChildren().add(new StructuralMatch<Element>(l, vmI(IssueSeverity.INFORMATION, "Removed this item", path)));
} else {
matchR.add(r);
CapabilityStatementRestComponent cdM = merge(l, r, res);
CapabilityStatementRestComponent cdI = intersect(l, r, res);
union.add(cdM);
intersection.add(cdI);
StructuralMatch<Element> sm = new StructuralMatch<Element>(l, r);
compare(sm, l, r, path + ".where(mode='" + l.getMode() + "')", res);
combined.getChildren().add(sm);
compareRestSecurity(l, r, sm, cdM.getSecurity(), cdI.getSecurity(), csU, csI, res, path + ".security");
compareRestResources(l, r, sm, cdM, cdI, csU, csI, res, path + ".resource");
compareSearchParams(combined, l.getSearchParam(), r.getSearchParam(), path, res, cdM.getSearchParam(), cdI.getSearchParam());
compareOperations(combined, l.getOperation(), r.getOperation(), path, res, cdM.getOperation(), cdI.getOperation());
compareItemPropertyList(sm, "compartment", l.getCompartment(), r.getCompartment(), path, res, cdM.getCompartment(), cdI.getCompartment(), IssueSeverity.ERROR);
}
}
for (CapabilityStatementRestComponent r : right) {
if (!matchR.contains(r)) {
union.add(r);
combined.getChildren().add(new StructuralMatch<Element>(vmI(IssueSeverity.INFORMATION, "Added this concept", path), r));
}
}
}
use of org.hl7.fhir.definitions.model.Compartment 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.definitions.model.Compartment 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