Search in sources :

Example 1 with RegistryObjectListType

use of org.openehealth.ipf.commons.ihe.xds.core.stub.ebrs30.rim.RegistryObjectListType in project ipf by oehf.

the class Ebrs30MarshalingTest method setUp.

@BeforeEach
public void setUp() throws JAXBException {
    factory = new EbXMLFactory30();
    objectLibrary = factory.createObjectLibrary();
    context = JAXBContext.newInstance("org.openehealth.ipf.commons.ihe.xds.core.stub.ebrs30.rs");
    request = new SubmitObjectsRequest();
    var objListElement = new RegistryObjectListType();
    request.setRegistryObjectList(objListElement);
    var objList = objListElement.getIdentifiable();
    docEntry = factory.createExtrinsic("Document01", objectLibrary);
    docEntry.setObjectType(DocumentEntryType.STABLE.getUuid());
    objList.add(new ObjectFactory().createExtrinsicObject(((EbXMLExtrinsicObject30) docEntry).getInternal()));
}
Also used : EbXMLFactory30(org.openehealth.ipf.commons.ihe.xds.core.ebxml.ebxml30.EbXMLFactory30) RegistryObjectListType(org.openehealth.ipf.commons.ihe.xds.core.stub.ebrs30.rim.RegistryObjectListType) ObjectFactory(org.openehealth.ipf.commons.ihe.xds.core.stub.ebrs30.rim.ObjectFactory) SubmitObjectsRequest(org.openehealth.ipf.commons.ihe.xds.core.stub.ebrs30.lcm.SubmitObjectsRequest) EbXMLExtrinsicObject30(org.openehealth.ipf.commons.ihe.xds.core.ebxml.ebxml30.EbXMLExtrinsicObject30) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 2 with RegistryObjectListType

use of org.openehealth.ipf.commons.ihe.xds.core.stub.ebrs30.rim.RegistryObjectListType in project MobileAccessGateway by i4mi.

the class Iti66ResponseBugfix method fixResponse.

/**
 * bugfix: add missing type classification to SubmissionSets in ITI-18 response
 * @param response
 * @return
 */
public AdhocQueryResponse fixResponse(@Body AdhocQueryResponse response) {
    RegistryObjectListType registryObjectList = response.getRegistryObjectList();
    if (registryObjectList != null) {
        var registryPackages = registryObjectList.getIdentifiable();
        if (registryPackages != null) {
            for (var possibleRegistryPackage : registryPackages) {
                IdentifiableType type = possibleRegistryPackage.getValue();
                if (type instanceof RegistryPackageType) {
                    RegistryPackageType registryPackageType = (RegistryPackageType) type;
                    boolean foundTypeClassification = false;
                    for (var classification : registryPackageType.getClassification()) {
                        if ("urn:uuid:a54d6aa5-d40d-43f9-88c5-b4633d873bdd".equals(classification.getClassificationNode()) || "urn:uuid:d9d542f3-6cc4-48b6-8870-ea235fbc94c2".equals(classification.getClassificationNode()))
                            foundTypeClassification = true;
                    }
                    // If not found add SubmissionSet classification
                    if (!foundTypeClassification) {
                        ClassificationType missing = new ClassificationType();
                        missing.setClassificationNode("urn:uuid:a54d6aa5-d40d-43f9-88c5-b4633d873bdd");
                        missing.setClassifiedObject(registryPackageType.getId());
                        registryPackageType.getClassification().add(missing);
                    }
                }
            }
        }
    }
    return response;
}
Also used : RegistryObjectListType(org.openehealth.ipf.commons.ihe.xds.core.stub.ebrs30.rim.RegistryObjectListType) IdentifiableType(org.openehealth.ipf.commons.ihe.xds.core.stub.ebrs30.rim.IdentifiableType) RegistryPackageType(org.openehealth.ipf.commons.ihe.xds.core.stub.ebrs30.rim.RegistryPackageType) ClassificationType(org.openehealth.ipf.commons.ihe.xds.core.stub.ebrs30.rim.ClassificationType)

Aggregations

RegistryObjectListType (org.openehealth.ipf.commons.ihe.xds.core.stub.ebrs30.rim.RegistryObjectListType)2 BeforeEach (org.junit.jupiter.api.BeforeEach)1 EbXMLExtrinsicObject30 (org.openehealth.ipf.commons.ihe.xds.core.ebxml.ebxml30.EbXMLExtrinsicObject30)1 EbXMLFactory30 (org.openehealth.ipf.commons.ihe.xds.core.ebxml.ebxml30.EbXMLFactory30)1 SubmitObjectsRequest (org.openehealth.ipf.commons.ihe.xds.core.stub.ebrs30.lcm.SubmitObjectsRequest)1 ClassificationType (org.openehealth.ipf.commons.ihe.xds.core.stub.ebrs30.rim.ClassificationType)1 IdentifiableType (org.openehealth.ipf.commons.ihe.xds.core.stub.ebrs30.rim.IdentifiableType)1 ObjectFactory (org.openehealth.ipf.commons.ihe.xds.core.stub.ebrs30.rim.ObjectFactory)1 RegistryPackageType (org.openehealth.ipf.commons.ihe.xds.core.stub.ebrs30.rim.RegistryPackageType)1