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()));
}
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;
}
Aggregations