use of org.hl7.fhir.r4b.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent in project ipf by oehf.
the class TestIti83Success method testGetConformance.
@Test
public void testGetConformance() {
var conf = client.capabilities().ofType(CapabilityStatement.class).execute();
assertEquals(1, conf.getRest().size());
var component = conf.getRest().iterator().next();
CapabilityStatementRestResourceOperationComponent operation = component.getResource().stream().filter(resource -> "Patient".equals(resource.getType())).flatMap(resource -> resource.getOperation().stream()).findFirst().get();
assertEquals(Iti83Constants.PIXM_OPERATION_NAME.substring(1), operation.getName());
// printAsXML(conf);
}
use of org.hl7.fhir.r4b.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent in project org.hl7.fhir.core by hapifhir.
the class CapabilityStatementComparer method addRestOperationRow.
private Row addRestOperationRow(HierarchicalTableGenerator gen, List<Row> rows, StructuralMatch<Element> t, CapabilityStatementComparison comparison) {
Row r = gen.new Row();
rows.add(r);
r.getCells().add(gen.new Cell(null, null, "operation", null, null));
CapabilityStatementRestResourceOperationComponent left = t.hasLeft() ? (CapabilityStatementRestResourceOperationComponent) t.getLeft() : null;
CapabilityStatementRestResourceOperationComponent right = t.hasRight() ? (CapabilityStatementRestResourceOperationComponent) t.getRight() : null;
r.getCells().add(style(gen.new Cell(null, null, left != null ? left.getName() : "", null, null), left != null ? left.getName() : null, right != null ? right.getName() : null, true));
r.getCells().add(style(gen.new Cell(null, null, left != null ? left.getDocumentation() : "", null, null), left != null ? left.getDocumentation() : null, right != null ? right.getDocumentation() : null, true));
r.getCells().add(style(gen.new Cell(null, null, right != null ? right.getName() : "", null, null), left != null ? left.getName() : null, right != null ? right.getName() : null, false));
r.getCells().add(style(gen.new Cell(null, null, right != null ? right.getDocumentation() : "", null, null), left != null ? left.getDocumentation() : null, right != null ? right.getDocumentation() : null, true));
r.getCells().add(cellForMessages(gen, t.getMessages()));
return r;
}
use of org.hl7.fhir.r4b.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent in project org.hl7.fhir.core by hapifhir.
the class CapabilityStatementComparer method intersectOperations.
private CapabilityStatementRestResourceOperationComponent intersectOperations(CapabilityStatementRestResourceOperationComponent l, CapabilityStatementRestResourceOperationComponent r) {
CapabilityStatementRestResourceOperationComponent res = new CapabilityStatementRestResourceOperationComponent();
res.setName(l.getName());
if (l.hasDocumentation() && r.hasDocumentation()) {
res.setDocumentation(l.getDocumentation());
}
return res;
}
use of org.hl7.fhir.r4b.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent in project org.hl7.fhir.core by hapifhir.
the class CapabilityStatementComparer method compareOperations.
private void compareOperations(StructuralMatch<Element> combined, List<CapabilityStatementRestResourceOperationComponent> left, List<CapabilityStatementRestResourceOperationComponent> right, String path, CapabilityStatementComparison res, List<CapabilityStatementRestResourceOperationComponent> union, List<CapabilityStatementRestResourceOperationComponent> intersection) {
List<CapabilityStatementRestResourceOperationComponent> matchR = new ArrayList<>();
for (CapabilityStatementRestResourceOperationComponent l : left) {
CapabilityStatementRestResourceOperationComponent r = findInList(right, l);
if (r == null) {
union.add(l);
combined.getChildren().add(new StructuralMatch<Element>(l, vmI(IssueSeverity.INFORMATION, "Removed this Search Parameter", path)));
} else {
matchR.add(r);
CapabilityStatementRestResourceOperationComponent cdM = mergeOperations(l, r);
CapabilityStatementRestResourceOperationComponent cdI = intersectOperations(l, r);
union.add(cdM);
intersection.add(cdI);
StructuralMatch<Element> sm = new StructuralMatch<Element>(l, r);
compareStrings(path, sm.getMessages(), l.getDocumentation(), r.getDocumentation(), "documentation", IssueSeverity.INFORMATION, res);
compareItemProperty(sm, "definition", l.getDefinitionElement(), r.getDefinitionElement(), path, res, cdM.getDefinitionElement(), cdI.getDefinitionElement(), IssueSeverity.ERROR);
compareExpectations(sm, l, r, path, res, cdM, cdI);
combined.getChildren().add(sm);
}
}
for (CapabilityStatementRestResourceOperationComponent r : right) {
if (!matchR.contains(r)) {
union.add(r);
combined.getChildren().add(new StructuralMatch<Element>(vmI(IssueSeverity.INFORMATION, "Added this Search Parameter", path), r));
}
}
}
use of org.hl7.fhir.r4b.model.CapabilityStatement.CapabilityStatementRestResourceOperationComponent in project org.hl7.fhir.core by hapifhir.
the class CapabilityStatementComparer method intersectOperations.
private CapabilityStatementRestResourceOperationComponent intersectOperations(CapabilityStatementRestResourceOperationComponent l, CapabilityStatementRestResourceOperationComponent r) {
CapabilityStatementRestResourceOperationComponent res = new CapabilityStatementRestResourceOperationComponent();
res.setName(l.getName());
if (l.hasDocumentation() && r.hasDocumentation()) {
res.setDocumentation(l.getDocumentation());
}
return res;
}
Aggregations