use of org.hl7.fhir.definitions.model.Compartment in project kindling by HL7.
the class Publisher method addToResourceFeed.
private void addToResourceFeed(CompartmentDefinition cd, Bundle dest) throws Exception {
if (cd.getId() == null)
throw new Exception("Resource has no id");
if (ResourceUtilities.getById(dest, ResourceType.CompartmentDefinition, cd.getId()) != null)
throw new Exception("Attempt to add duplicate Compartment Definition " + cd.getId());
if (!cd.hasText() || !cd.getText().hasDiv()) {
RendererFactory.factory(cd, page.getRc().copy()).render(cd);
}
if (cd.getText() == null || cd.getText().getDiv() == null)
throw new Exception("Example Compartment Definition " + cd.getId() + " does not have any narrative");
ResourceUtilities.meta(cd).setLastUpdated(page.getGenDate().getTime());
if (!cd.getUrl().equals("http://hl7.org/fhir/" + cd.getResourceType().toString() + "/" + cd.getId()))
throw new Exception("URL mismatch on concept map");
dest.getEntry().add(new BundleEntryComponent().setResource(cd).setFullUrl("http://hl7.org/fhir/" + cd.fhirType() + "/" + cd.getId()));
}
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 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.hasProfileElement())
composeUri(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 composeCapabilityStatementCapabilityStatementRestComponent.
protected void composeCapabilityStatementCapabilityStatementRestComponent(Complex parent, String parentType, String name, CapabilityStatement.CapabilityStatementRestComponent 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, "CapabilityStatement", "mode", element.getModeElement(), -1);
if (element.hasDocumentationElement())
composeString(t, "CapabilityStatement", "documentation", element.getDocumentationElement(), -1);
if (element.hasSecurity())
composeCapabilityStatementCapabilityStatementRestSecurityComponent(t, "CapabilityStatement", "security", element.getSecurity(), -1);
for (int i = 0; i < element.getResource().size(); i++) composeCapabilityStatementCapabilityStatementRestResourceComponent(t, "CapabilityStatement", "resource", element.getResource().get(i), i);
for (int i = 0; i < element.getInteraction().size(); i++) composeCapabilityStatementSystemInteractionComponent(t, "CapabilityStatement", "interaction", element.getInteraction().get(i), i);
for (int i = 0; i < element.getSearchParam().size(); i++) composeCapabilityStatementCapabilityStatementRestResourceSearchParamComponent(t, "CapabilityStatement", "searchParam", element.getSearchParam().get(i), i);
for (int i = 0; i < element.getOperation().size(); i++) composeCapabilityStatementCapabilityStatementRestOperationComponent(t, "CapabilityStatement", "operation", element.getOperation().get(i), i);
for (int i = 0; i < element.getCompartment().size(); i++) composeUri(t, "CapabilityStatement", "compartment", element.getCompartment().get(i), i);
}
use of org.hl7.fhir.definitions.model.Compartment in project org.hl7.fhir.core by hapifhir.
the class RdfParser method composeGraphDefinitionGraphDefinitionLinkTargetCompartmentComponent.
protected void composeGraphDefinitionGraphDefinitionLinkTargetCompartmentComponent(Complex parent, String parentType, String name, GraphDefinition.GraphDefinitionLinkTargetCompartmentComponent element, int index) {
if (element == null)
return;
Complex t;
if (Utilities.noString(parentType))
t = parent;
else {
t = parent.predicate("fhir:" + parentType + '.' + name);
}
composeBackboneElement(t, "compartment", name, element, index);
if (element.hasCodeElement())
composeEnum(t, "GraphDefinition", "code", element.getCodeElement(), -1);
if (element.hasRuleElement())
composeEnum(t, "GraphDefinition", "rule", element.getRuleElement(), -1);
if (element.hasExpressionElement())
composeString(t, "GraphDefinition", "expression", element.getExpressionElement(), -1);
if (element.hasDescriptionElement())
composeString(t, "GraphDefinition", "description", element.getDescriptionElement(), -1);
}
Aggregations