Hi,
I have a server which is offering pacs functionallity by using dcm4che 3. Everything work well if I use OsiriX to access my server. But with Query/Retrieve I have some problems when I use an other clean than OsiriX. When I use K-PACS or Synedra Personal, the query part works, but when I request to send the images a new Association is initiated, negociation ok, data is send. But when all data is send, I get no Respone. Sometimes I get an abort.
Here is my code to build the new Association:
Association associateToTarget(Association as, Attributes rq) throws SQLException, DicomServiceException, IOException, InterruptedException,
IncompatibleConnectionException, GeneralSecurityException {
String destName = rq.getString(Tag.MoveDestination);
DcmFacilityPdm node = IDicomTX.FACTORY.get().findFacilityByAETitle(destName);
if (node == null) {
throw new DicomServiceException(Status.MoveDestinationUnknown, destName + " not registered in ixserv");
}
ApplicationEntity destAE = new ApplicationEntity(destName);
Connection conn = new Connection(destName, node.getDfcHost(), node.getDfcPort());
destAE.addConnection(conn);
Device device = new Device(destAE.getAETitle());
device.addConnection(conn);
device.addApplicationEntity(destAE);
AAssociateRQ ac = new AAssociateRQ();
ac.setCalledAET(destName);
ac.setCallingAET(as.getCalledAET());
int idx = 0;
for (String cuid : SCU_CLASSES) {
ac.addPresentationContext(new PresentationContext(++idx, cuid, DcmSCP.NON_RETIRED_LE_TS));
}
Association dest = as.getApplicationEntity().connect(destAE, ac);
return dest;
}
I use an implementation of org.dcm4che.net.service.RetrieveTask which is mostly a copy of org.dcm4che.net.service.BasicRetrieveTask but with the Instance-Locator replaced by my own infrastructure.
One thing I had to change, was to add an role selection in the run method:
if (pendingRSP)
writePendingRSP();
try {
storeas.getAAssociateAC().addRoleSelection(new RoleSelection(inst.getCUID(), true, true));
cstore(storeas, inst);
}
catch (Exception e) {
failed.add(inst.getIUID());
status = Status.UnableToPerformSubOperations;
LOG.warn(as + ": Unable to perform sub-operation on association to " + storeas.getRemoteAET(), e);
}
Has anybody an idea what I am doing wrong?
Yours, Andreas