use of org.openehealth.ipf.commons.ihe.xds.core.ebxml.ebxml30.EbXMLSubmitObjectsRequest30 in project ipf by oehf.
the class Ebrs30MarshalingTest method verifyExtraMetadataWithJaxbBinding.
@Test
public void verifyExtraMetadataWithJaxbBinding() throws Exception {
var file = new File(getClass().getClassLoader().getResource("SubmitObjectsRequest_ebrs3_extra_metadata.xml").toURI());
var unmarshaller = context.createUnmarshaller();
unmarshaller.setListener(new XdsJaxbDataBinding().getUnmarshallerListener());
var unmarshalled = unmarshaller.unmarshal(file);
var original = (SubmitObjectsRequest) unmarshalled;
int numberOfSlotsInFirstDoc = new EbXMLSubmitObjectsRequest30(original).getExtrinsicObjects().get(0).getSlots().size();
var marshaller = context.createMarshaller();
marshaller.setListener(new XdsJaxbDataBinding().getMarshallerListener());
StringWriter writer = new StringWriter();
marshaller.marshal(original, writer);
var unmarshalledSecond = (SubmitObjectsRequest) unmarshaller.unmarshal(new StringReader(writer.toString()));
int numberOfSlotsInSecondDoc = new EbXMLSubmitObjectsRequest30(unmarshalledSecond).getExtrinsicObjects().get(0).getSlots().size();
assertEquals(numberOfSlotsInFirstDoc, numberOfSlotsInSecondDoc, "Number of slots after Marshalling and Unmarsshalling does not match");
}
use of org.openehealth.ipf.commons.ihe.xds.core.ebxml.ebxml30.EbXMLSubmitObjectsRequest30 in project ipf by oehf.
the class Iti80AuditStrategy method enrichAuditDatasetFromRequest.
@Override
public XdsSubmitAuditDataset enrichAuditDatasetFromRequest(XdsSubmitAuditDataset auditDataset, Object pojo, Map<String, Object> parameters) {
var request = (ProvideAndRegisterDocumentSetRequestType) pojo;
var submitObjectsRequest = request.getSubmitObjectsRequest();
if (submitObjectsRequest != null) {
EbXMLSubmitObjectsRequest ebXML = new EbXMLSubmitObjectsRequest30(submitObjectsRequest);
enrichDatasetFromSubmitObjectsRequest(auditDataset, ebXML);
}
return auditDataset;
}
use of org.openehealth.ipf.commons.ihe.xds.core.ebxml.ebxml30.EbXMLSubmitObjectsRequest30 in project ipf by oehf.
the class XdsSubmitAuditStrategy30 method enrichAuditDatasetFromRequest.
@Override
public XdsSubmitAuditDataset enrichAuditDatasetFromRequest(XdsSubmitAuditDataset auditDataset, Object pojo, Map<String, Object> parameters) {
if (pojo instanceof SubmitObjectsRequest) {
var submitObjectsRequest = (SubmitObjectsRequest) pojo;
EbXMLSubmitObjectsRequest ebXML = new EbXMLSubmitObjectsRequest30(submitObjectsRequest);
enrichDatasetFromSubmitObjectsRequest(auditDataset, ebXML);
}
return auditDataset;
}
use of org.openehealth.ipf.commons.ihe.xds.core.ebxml.ebxml30.EbXMLSubmitObjectsRequest30 in project ipf by oehf.
the class Ebrs30MarshalingTest method testFromRealEbXML.
@Test
public void testFromRealEbXML() throws Exception {
var file = new File(getClass().getClassLoader().getResource("SubmitObjectsRequest_ebrs30.xml").toURI());
var unmarshaller = context.createUnmarshaller();
var unmarshalled = unmarshaller.unmarshal(file);
var original = (SubmitObjectsRequest) unmarshalled;
var transformer = new RegisterDocumentSetTransformer(factory);
var result = transformer.fromEbXML(new EbXMLSubmitObjectsRequest30(original));
var documentEntry = result.getDocumentEntries().get(0);
assertEquals("Document01", documentEntry.getEntryUuid());
assertEquals(DocumentEntryType.STABLE, documentEntry.getType());
assertEquals("Gerald Smitty", documentEntry.getAuthors().get(0).getAuthorPerson().getId().getId());
var submissionSet = result.getSubmissionSet();
assertEquals("SubmissionSet01", submissionSet.getEntryUuid());
assertEquals(1, submissionSet.getAuthors().size());
assertEquals("Sherry Dopplemeyer", submissionSet.getAuthors().get(0).getAuthorPerson().getId().getId());
assertEquals(result.getAssociations().get(0).getAssociationType(), AssociationType.HAS_MEMBER);
assertEquals(result.getAssociations().get(1).getAssociationType(), AssociationType.IS_SNAPSHOT_OF);
}
use of org.openehealth.ipf.commons.ihe.xds.core.ebxml.ebxml30.EbXMLSubmitObjectsRequest30 in project ipf by oehf.
the class Iti41AuditStrategy method enrichAuditDatasetFromRequest.
@Override
public XdsSubmitAuditDataset enrichAuditDatasetFromRequest(XdsSubmitAuditDataset auditDataset, Object pojo, Map<String, Object> parameters) {
var request = (ProvideAndRegisterDocumentSetRequestType) pojo;
var submitObjectsRequest = request.getSubmitObjectsRequest();
if (submitObjectsRequest != null) {
EbXMLSubmitObjectsRequest ebXML = new EbXMLSubmitObjectsRequest30(submitObjectsRequest);
enrichDatasetFromSubmitObjectsRequest(auditDataset, ebXML);
}
return auditDataset;
}
Aggregations