Search in sources :

Example 1 with EbXMLSubmitObjectsRequest30

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");
}
Also used : StringWriter(java.io.StringWriter) XdsJaxbDataBinding(org.openehealth.ipf.commons.ihe.xds.core.XdsJaxbDataBinding) EbXMLSubmitObjectsRequest30(org.openehealth.ipf.commons.ihe.xds.core.ebxml.ebxml30.EbXMLSubmitObjectsRequest30) StringReader(java.io.StringReader) File(java.io.File) SubmitObjectsRequest(org.openehealth.ipf.commons.ihe.xds.core.stub.ebrs30.lcm.SubmitObjectsRequest) Test(org.junit.jupiter.api.Test)

Example 2 with EbXMLSubmitObjectsRequest30

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;
}
Also used : EbXMLSubmitObjectsRequest(org.openehealth.ipf.commons.ihe.xds.core.ebxml.EbXMLSubmitObjectsRequest) EbXMLSubmitObjectsRequest30(org.openehealth.ipf.commons.ihe.xds.core.ebxml.ebxml30.EbXMLSubmitObjectsRequest30) ProvideAndRegisterDocumentSetRequestType(org.openehealth.ipf.commons.ihe.xds.core.ebxml.ebxml30.ProvideAndRegisterDocumentSetRequestType)

Example 3 with EbXMLSubmitObjectsRequest30

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;
}
Also used : EbXMLSubmitObjectsRequest(org.openehealth.ipf.commons.ihe.xds.core.ebxml.EbXMLSubmitObjectsRequest) EbXMLSubmitObjectsRequest30(org.openehealth.ipf.commons.ihe.xds.core.ebxml.ebxml30.EbXMLSubmitObjectsRequest30) SubmitObjectsRequest(org.openehealth.ipf.commons.ihe.xds.core.stub.ebrs30.lcm.SubmitObjectsRequest) EbXMLSubmitObjectsRequest(org.openehealth.ipf.commons.ihe.xds.core.ebxml.EbXMLSubmitObjectsRequest)

Example 4 with EbXMLSubmitObjectsRequest30

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);
}
Also used : RegisterDocumentSetTransformer(org.openehealth.ipf.commons.ihe.xds.core.transform.requests.RegisterDocumentSetTransformer) EbXMLSubmitObjectsRequest30(org.openehealth.ipf.commons.ihe.xds.core.ebxml.ebxml30.EbXMLSubmitObjectsRequest30) File(java.io.File) SubmitObjectsRequest(org.openehealth.ipf.commons.ihe.xds.core.stub.ebrs30.lcm.SubmitObjectsRequest) Test(org.junit.jupiter.api.Test)

Example 5 with EbXMLSubmitObjectsRequest30

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;
}
Also used : EbXMLSubmitObjectsRequest(org.openehealth.ipf.commons.ihe.xds.core.ebxml.EbXMLSubmitObjectsRequest) EbXMLSubmitObjectsRequest30(org.openehealth.ipf.commons.ihe.xds.core.ebxml.ebxml30.EbXMLSubmitObjectsRequest30) ProvideAndRegisterDocumentSetRequestType(org.openehealth.ipf.commons.ihe.xds.core.ebxml.ebxml30.ProvideAndRegisterDocumentSetRequestType)

Aggregations

EbXMLSubmitObjectsRequest30 (org.openehealth.ipf.commons.ihe.xds.core.ebxml.ebxml30.EbXMLSubmitObjectsRequest30)5 EbXMLSubmitObjectsRequest (org.openehealth.ipf.commons.ihe.xds.core.ebxml.EbXMLSubmitObjectsRequest)3 SubmitObjectsRequest (org.openehealth.ipf.commons.ihe.xds.core.stub.ebrs30.lcm.SubmitObjectsRequest)3 File (java.io.File)2 Test (org.junit.jupiter.api.Test)2 ProvideAndRegisterDocumentSetRequestType (org.openehealth.ipf.commons.ihe.xds.core.ebxml.ebxml30.ProvideAndRegisterDocumentSetRequestType)2 StringReader (java.io.StringReader)1 StringWriter (java.io.StringWriter)1 XdsJaxbDataBinding (org.openehealth.ipf.commons.ihe.xds.core.XdsJaxbDataBinding)1 RegisterDocumentSetTransformer (org.openehealth.ipf.commons.ihe.xds.core.transform.requests.RegisterDocumentSetTransformer)1