Package org.dcm4che3.net.service

Examples of org.dcm4che3.net.service.DicomServiceException


        assertEquals(2, arr.getConnections().size());
    }

    private void validate(List<AuditSuppressCriteria> criteriaList) {
        assertEquals(1, criteriaList.size());
        AuditSuppressCriteria criteria = criteriaList.get(0);
        assertEquals("AuditSuppressCriteria", criteria.getCommonName());
        EventID[] eventIDs = criteria.getEventIDs();
        assertEquals(1, eventIDs.length);
        assertEquals(AuditMessages.EventID.ApplicationActivity.getCode(),
                eventIDs[0].getCode());
        assertEquals(AuditMessages.EventID.ApplicationActivity.getCodeSystemName(),
                eventIDs[0].getCodeSystemName());
        assertEquals(AuditMessages.EventID.ApplicationActivity.getDisplayName(),
                eventIDs[0].getDisplayName());
        String[] eventActionCodes = criteria.getEventActionCodes();
        assertEquals(1, eventActionCodes.length);
        assertEquals(AuditMessages.EventActionCode.Execute, eventActionCodes[0]);
        EventTypeCode[] eventTypeCodes = criteria.getEventTypeCodes();
        assertEquals(2, eventTypeCodes.length);
        String[] eventOutcomeIndicators = criteria.getEventOutcomeIndicators();
        assertEquals(1, eventOutcomeIndicators.length);
        assertEquals(AuditMessages.EventOutcomeIndicator.Success, eventOutcomeIndicators[0]);
        String[] userIDs = criteria.getUserIDs();
        assertEquals(1, userIDs.length);
        assertEquals("UserID", userIDs[0]);
        String[] altUserIDs = criteria.getAlternativeUserIDs();
        assertEquals(1, altUserIDs.length);
        assertEquals("AltUserID", altUserIDs[0]);
        String[] networkAccessPointIDs = criteria.getNetworkAccessPointIDs();
        assertEquals(1, networkAccessPointIDs.length);
        assertEquals("127.0.0.1", networkAccessPointIDs[0]);
        RoleIDCode[] userRoleIDCodes = criteria.getUserRoleIDCodes();
        assertEquals(1, userRoleIDCodes.length);
        assertEquals(AuditMessages.RoleIDCode.ApplicationLauncher.getCode(),
                userRoleIDCodes[0].getCode());
        assertEquals(AuditMessages.RoleIDCode.ApplicationLauncher.getCodeSystemName(),
                userRoleIDCodes[0].getCodeSystemName());
        assertEquals(AuditMessages.RoleIDCode.ApplicationLauncher.getDisplayName(),
                userRoleIDCodes[0].getDisplayName());
        assertEquals(true, criteria.getUserIsRequestor());
    }
View Full Code Here


        this.status = status;
    }

    public void setTransferSyntaxes(String[] tss) {
        rq.addPresentationContext(
                new PresentationContext(1, UID.VerificationSOPClass,
                        UID.ImplicitVRLittleEndian));
        rq.addPresentationContext(
                new PresentationContext(2,
                        UID.StorageCommitmentPushModelSOPClass,
                        tss));
        ae.addTransferCapability(
                new TransferCapability(null,
                        UID.VerificationSOPClass,
View Full Code Here

            LOG.warn("{}: M-DELETE {} failed!", as, file);
    }

    private DicomServiceRegistry createServiceRegistry() {
        DicomServiceRegistry serviceRegistry = new DicomServiceRegistry();
        serviceRegistry.addDicomService(new BasicCEchoSCP());
        serviceRegistry.addDicomService(cstoreSCP);
        return serviceRegistry;
    }
View Full Code Here

    public StgCmtSCU(ApplicationEntity ae) throws IOException {
        this.remote = new Connection();
        this.ae = ae;
        DicomServiceRegistry serviceRegistry = new DicomServiceRegistry();
        serviceRegistry.addDicomService(new BasicCEchoSCP());
        serviceRegistry.addDicomService(stgcmtResultHandler);
        ae.setDimseRQHandler(serviceRegistry);
    }
View Full Code Here

                    Attributes.createFileMetaInformation(iuid, cuid,
                            UID.ExplicitVRLittleEndian),
                    eventInfo);
        } catch (IOException e) {
            LOG.warn(as + ": Failed to store Storage Commitment Result:", e);
            throw new DicomServiceException(Status.ProcessingFailure, e);
        } finally {
            SafeClose.close(out);
        }
        return null;
    }
View Full Code Here

    @Override
    public void process(Exchange exchange) throws Exception {
        DicomMessage in = exchange.getIn(DicomMessage.class);
        Dimse dimse = in.getHeader("dimse", Dimse.class);
        if (dimse != Dimse.C_ECHO_RQ)
            throw new DicomServiceException(Status.UnrecognizedOperation);
        DicomMessage out = new DicomMessage(
                Dimse.C_ECHO_RSP,
                Commands.mkEchoRSP(in.getCommand(), Status.Success));
        exchange.setOut(out);
    }
View Full Code Here

        @Override
        public void done(boolean doneSync) {
            Attributes cmd;
            Attributes data;
            if (exchange.getException() != null) {
                DicomServiceException dse;
                Exception ex = exchange.getException();
                if (ex instanceof DicomServiceException) {
                    dse = (DicomServiceException) ex;
                } else {
                    dse = new DicomServiceException(Status.ProcessingFailure, ex);
                }
                cmd = dse.mkRSP(dimse.commandFieldOfRSP(), msgId);
                data = dse.getDataset();
            } else {
                DicomMessage out = exchange.getOut(DicomMessage.class);
                cmd = out.getCommand();
                data = out.getBody(Attributes.class);
            }
View Full Code Here

            return null;
        String cuid = rq.getString(Tag.AffectedSOPClassUID);
        String iuid = rq.getString(Tag.AffectedSOPInstanceUID);
        File file = new File(storageDir, iuid);
        if (file.exists())
            throw new DicomServiceException(Status.DuplicateSOPinstance).
                setUID(Tag.AffectedSOPInstanceUID, iuid);
        DicomOutputStream out = null;
        LOG.info("{}: M-WRITE {}", as, file);
        try {
            out = new DicomOutputStream(file);
            out.writeDataset(
                    Attributes.createFileMetaInformation(iuid, cuid,
                            UID.ExplicitVRLittleEndian),
                    rqAttrs);
        } catch (IOException e) {
            LOG.warn(as + ": Failed to store Instance Available Notification:", e);
            throw new DicomServiceException(Status.ProcessingFailure, e);
        } finally {
            SafeClose.close(out);
        }
        return null;
    }
View Full Code Here

   
                    patRec = ddr.findNextPatientRecord(patRec, patIDs);
            }
            return list;
        } catch (IOException e) {
            throw new DicomServiceException(Status.UnableToCalculateNumberOfMatches, e);
        }
    }
View Full Code Here

                }
                patRec = ddr.findNextPatientRecord(patRec);
            }
        } catch (IOException e) {
            LOG.info("Failed to M-READ " + dicomDir, e);
            throw new DicomServiceException(Status.ProcessingFailure, e);
        }
        for (Map.Entry<String, String> entry : map.entrySet()) {
            failedSeq.add(refSOP(entry.getKey(), entry.getValue(), Status.NoSuchObjectInstance));
        }
        if (failedSeq.isEmpty())
View Full Code Here

TOP

Related Classes of org.dcm4che3.net.service.DicomServiceException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.