Ejemplo n.º 1
0
        private DicomNCreateResponse CreateFilmBox(DicomNCreateRequest request)
        {
            if (_filmSession == null)
            {
                LogManager.Instance.Error("A basic film session does not exist for this association {0}", CallingAE);
                SendAbort(DicomAbortSource.ServiceProvider, DicomAbortReason.NotSpecified);
                return(new DicomNCreateResponse(request, DicomStatus.NoSuchObjectInstance));
            }

            FilmBox filmBox = _filmSession.CreateFilmBox(request.SOPInstanceUID, request.Dataset);

            if (!filmBox.Initialize())
            {
                LogManager.Instance.Error("Failed to initialize requested film box {0}", filmBox.SOPInstanceUID.UID);
                SendAbort(DicomAbortSource.ServiceProvider, DicomAbortReason.NotSpecified);
                return(new DicomNCreateResponse(request, DicomStatus.ProcessingFailure));
            }

            LogManager.Instance.Info("Created new film box {0}", filmBox.SOPInstanceUID.UID);

            var response = new DicomNCreateResponse(request, DicomStatus.Success);

            response.Command.Add(DicomTag.AffectedSOPInstanceUID, filmBox.SOPInstanceUID);
            response.Dataset = filmBox;
            return(response);
        }
Ejemplo n.º 2
0
        private DicomNCreateResponse CreateFilmBox(DicomNCreateRequest request)
        {
            if (_filmSession == null)
            {
                Logger.Error("A basic film session does not exist for this association {0}", CallingAE);
                SendAbortAsync(DicomAbortSource.ServiceProvider, DicomAbortReason.NotSpecified).Wait();
                return(new DicomNCreateResponse(request, DicomStatus.NoSuchObjectInstance));
            }

            var filmBox = _filmSession.CreateFilmBox(request.SOPInstanceUID, request.Dataset);

            if (!filmBox.Initialize())
            {
                Logger.Error("Failed to initialize requested film box {0}", filmBox.SOPInstanceUID.UID);
                SendAbortAsync(DicomAbortSource.ServiceProvider, DicomAbortReason.NotSpecified).Wait();
                return(new DicomNCreateResponse(request, DicomStatus.ProcessingFailure));
            }

            Logger.Info("Created new film box {0}", filmBox.SOPInstanceUID.UID);
            if (string.IsNullOrEmpty(request.SOPInstanceUID?.UID))
            {
                request.Command.AddOrUpdate(DicomTag.AffectedSOPInstanceUID, filmBox.SOPInstanceUID.UID);
            }

            return(new DicomNCreateResponse(request, DicomStatus.Success)
            {
                Dataset = filmBox
            });
        }