Search in sources :

Example 1 with AAssociateRQ

use of org.dcm4che3.net.pdu.AAssociateRQ in project dcm4chee-arc-light by dcm4che.

the class UPSEventSCP method mkAAssociateRQ.

private static AAssociateRQ mkAAssociateRQ(ApplicationEntity localAE, String subscriberAET) {
    AAssociateRQ aarq = new AAssociateRQ();
    aarq.setCalledAET(subscriberAET);
    TransferCapability tc = localAE.getTransferCapabilityFor(UID.UnifiedProcedureStepEvent, TransferCapability.Role.SCP);
    aarq.addPresentationContext(new PresentationContext(1, UID.UnifiedProcedureStepEvent, tc != null ? tc.getTransferSyntaxes() : new String[] { UID.ImplicitVRLittleEndian }));
    aarq.addRoleSelection(new RoleSelection(UID.UnifiedProcedureStepEvent, false, true));
    return aarq;
}
Also used : AAssociateRQ(org.dcm4che3.net.pdu.AAssociateRQ) RoleSelection(org.dcm4che3.net.pdu.RoleSelection) PresentationContext(org.dcm4che3.net.pdu.PresentationContext)

Example 2 with AAssociateRQ

use of org.dcm4che3.net.pdu.AAssociateRQ in project dcm4chee-arc-light by dcm4che.

the class CStoreSCUImpl method openMultipleAssocations.

private Association[] openMultipleAssocations(RetrieveContext ctx) throws DicomServiceException {
    Association storeas = openAssociation(ctx);
    ctx.setStoreAssociation(storeas);
    Association[] storeass = new Association[Math.min(ctx.getArchiveAEExtension().maxStoreAssociationsTo(ctx.getDestinationAETitle()), Math.max(ctx.getNumberOfMatches(), 1))];
    storeass[0] = storeas;
    ApplicationEntity localAE = ctx.getLocalApplicationEntity();
    ApplicationEntity destinationAE = ctx.getDestinationAE();
    AAssociateRQ acrq = storeas.getAAssociateRQ();
    int count = 0;
    while (++count < storeass.length) {
        try {
            storeass[count] = localAE.connect(destinationAE, acrq);
        } catch (Exception e) {
            LOG.warn("failed to open additional association to {}:\n", ctx.getDestinationAETitle());
            return Arrays.copyOf(storeass, count);
        }
    }
    return storeass;
}
Also used : AAssociateRQ(org.dcm4che3.net.pdu.AAssociateRQ) DicomServiceException(org.dcm4che3.net.service.DicomServiceException)

Example 3 with AAssociateRQ

use of org.dcm4che3.net.pdu.AAssociateRQ in project dcm4chee-arc-light by dcm4che.

the class CStoreSCUImpl method createAARQ.

private AAssociateRQ createAARQ(ApplicationEntity localAE, String calledAET, String cuid) {
    AAssociateRQ aarq = new AAssociateRQ();
    if (!localAE.isMasqueradeCallingAETitle(calledAET))
        aarq.setCallingAET(localAE.getAETitle());
    aarq.addPresentationContextFor(cuid, UID.ExplicitVRLittleEndian);
    aarq.addPresentationContextFor(cuid, UID.ImplicitVRLittleEndian);
    return aarq;
}
Also used : AAssociateRQ(org.dcm4che3.net.pdu.AAssociateRQ)

Example 4 with AAssociateRQ

use of org.dcm4che3.net.pdu.AAssociateRQ in project dcm4chee-arc-light by dcm4che.

the class CStoreSCUImpl method createAARQ.

private AAssociateRQ createAARQ(RetrieveContext ctx) {
    AAssociateRQ aarq = new AAssociateRQ();
    ApplicationEntity localAE = ctx.getLocalApplicationEntity();
    ApplicationEntity destAE = ctx.getDestinationAE();
    if (!localAE.isMasqueradeCallingAETitle(ctx.getDestinationAETitle()))
        aarq.setCallingAET(ctx.getCallingAET());
    boolean noDestinationRestriction = destAE.getTransferCapabilitiesWithRole(SCP).isEmpty();
    for (Iterator<InstanceLocations> iter = ctx.getMatches().iterator(); iter.hasNext(); ) {
        InstanceLocations inst = iter.next();
        String cuid = inst.getSopClassUID();
        TransferCapability localTC = localAE.getTransferCapabilityFor(cuid, SCU);
        TransferCapability destTC = noDestinationRestriction ? null : destAE.getTransferCapabilityFor(cuid, SCP);
        if (!aarq.containsPresentationContextFor(cuid) && !isVideo(inst)) {
            if (noDestinationRestriction) {
                addPresentationContext(aarq, cuid, UID.ImplicitVRLittleEndian, localTC);
                addPresentationContext(aarq, cuid, UID.ExplicitVRLittleEndian, localTC);
            } else {
                addPresentationContext(aarq, cuid, UID.ImplicitVRLittleEndian, localTC, destTC);
                addPresentationContext(aarq, cuid, UID.ExplicitVRLittleEndian, localTC, destTC);
            }
        }
        for (Location location : inst.getLocations()) {
            String tsuid = location.getTransferSyntaxUID();
            if (!tsuid.equals(UID.ImplicitVRLittleEndian) && !tsuid.equals(UID.ExplicitVRLittleEndian))
                if (noDestinationRestriction) {
                    addPresentationContext(aarq, cuid, tsuid, localTC);
                } else {
                    addPresentationContext(aarq, cuid, tsuid, localTC, destTC);
                }
        }
    }
    return aarq;
}
Also used : InstanceLocations(org.dcm4chee.arc.store.InstanceLocations) AAssociateRQ(org.dcm4che3.net.pdu.AAssociateRQ) Location(org.dcm4chee.arc.entity.Location)

Example 5 with AAssociateRQ

use of org.dcm4che3.net.pdu.AAssociateRQ in project dcm4chee-arc-light by dcm4che.

the class MPPSSCUImpl method forwardMPPS.

@Override
public Outcome forwardMPPS(String localAET, String remoteAET, Dimse dimse, String sopInstanceUID, Attributes attrs, Attributes procAttrs) throws Exception {
    ApplicationEntity localAE = device.getApplicationEntity(localAET, true);
    ApplicationEntity remoteAE = aeCache.findApplicationEntity(remoteAET);
    AAssociateRQ aarq = mkAAssociateRQ(localAE);
    Association as = localAE.connect(remoteAE, aarq);
    ProcedureContext pCtx = createProcedureCtx(sopInstanceUID, attrs.getString(Tag.PerformedProcedureStepStatus), as, dimse, procAttrs);
    try {
        DimseRSP rsp = dimse == Dimse.N_CREATE_RQ ? as.ncreate(UID.ModalityPerformedProcedureStep, sopInstanceUID, attrs, null) : as.nset(UID.ModalityPerformedProcedureStep, sopInstanceUID, attrs, null);
        rsp.next();
        return outcome(rsp.getCommand().getInt(Tag.Status, -1), dimse, sopInstanceUID, remoteAET, pCtx);
    } finally {
        try {
            as.release();
        } catch (IOException e) {
            LOG.info("{}: Failed to release association to {}", as, remoteAET);
        } finally {
            procedureEvent.fire(pCtx);
        }
    }
}
Also used : AAssociateRQ(org.dcm4che3.net.pdu.AAssociateRQ) ProcedureContext(org.dcm4chee.arc.procedure.ProcedureContext) IOException(java.io.IOException)

Aggregations

AAssociateRQ (org.dcm4che3.net.pdu.AAssociateRQ)19 PresentationContext (org.dcm4che3.net.pdu.PresentationContext)10 IOException (java.io.IOException)5 RoleSelection (org.dcm4che3.net.pdu.RoleSelection)4 ExtendedNegotiation (org.dcm4che3.net.pdu.ExtendedNegotiation)3 AAssociateAC (org.dcm4che3.net.pdu.AAssociateAC)2 AAssociateRJ (org.dcm4che3.net.pdu.AAssociateRJ)2 CommonExtendedNegotiation (org.dcm4che3.net.pdu.CommonExtendedNegotiation)2 DicomServiceException (org.dcm4che3.net.service.DicomServiceException)2 Outcome (org.dcm4chee.arc.qmgt.Outcome)2 ConfigurationNotFoundException (org.dcm4che3.conf.api.ConfigurationNotFoundException)1 ApplicationEntity (org.dcm4che3.net.ApplicationEntity)1 TransferCapability (org.dcm4che3.net.TransferCapability)1 AAbort (org.dcm4che3.net.pdu.AAbort)1 UserIdentityAC (org.dcm4che3.net.pdu.UserIdentityAC)1 Location (org.dcm4chee.arc.entity.Location)1 StgCmtResult (org.dcm4chee.arc.entity.StgCmtResult)1 ProcedureContext (org.dcm4chee.arc.procedure.ProcedureContext)1 InstanceLocations (org.dcm4chee.arc.store.InstanceLocations)1