private int sendIAN(String aet, DicomObject ian) throws IOException, InterruptedException, GeneralSecurityException { String iuid = UIDUtils.createUID(); Association assoc = open(aet); TransferCapability tc = assoc.getTransferCapabilityAsSCU(UID.InstanceAvailabilityNotificationSOPClass); RspHandler rspHandler = new RspHandler(); if (tc == null) { tc = assoc.getTransferCapabilityAsSCU(UID.BasicStudyContentNotificationSOPClassRetired); if (tc == null) { throw new NoPresentationContextException( UIDDictionary.getDictionary() .prompt( isOfferStudyContentNotification() ? UID.BasicStudyContentNotificationSOPClassRetired : UID.InstanceAvailabilityNotificationSOPClass)); } String tsuid = tc.getTransferSyntax()[0]; DicomObject scn = toSCN(ian); scn.putString(Tag.SOPInstanceUID, VR.UI, iuid); scn.putString(Tag.SOPClassUID, VR.UI, UID.BasicStudyContentNotificationSOPClassRetired); LOG.debug("Study Content Notification to {}:\n{}", aet, scn); assoc.cstore( UID.BasicStudyContentNotificationSOPClassRetired, iuid, priority, new DataWriterAdapter(scn), tsuid, rspHandler); } else { String tsuid = tc.getTransferSyntax()[0]; LOG.debug("Instance Availability Notification to {}:\n{}", aet, ian); assoc.ncreate(UID.InstanceAvailabilityNotificationSOPClass, iuid, ian, tsuid, rspHandler); } assoc.waitForDimseRSP(); try { assoc.release(true); } catch (InterruptedException t) { LOG.error("Association release failed! aet:" + aet, t); } return rspHandler.getStatus(); }