Пример #1
0
        /// <summary>
        /// Emits a CMove operation to an entity which moves an image from the entity to the specified AETitle
        /// </summary>
        /// <param name="scp">the provider which will perform the move</param>
        /// <param name="sopUid">the uid of the image to be moved</param>
        /// <param name="patientId">the patient id of the image</param>
        /// <param name="toAETite">the entity title which will receive the image</param>
        /// <param name="msgId">the message id</param>
        /// <returns>the move response</returns>
        public CMoveResponse SendCMoveImage(Entity daemon, CFindImageIOD iod, string toAETite, ref ushort msgId)
        {
            ManualResetEvent mr   = new ManualResetEvent(false);
            CMoveResponse    resp = null;
            var cr = new EvilDICOM.Network.Services.DIMSEService.DIMSEResponseHandler <CMoveResponse>((res, asc) =>
            {
                if (!(res.Status == (ushort)Status.PENDING))
                {
                    mr.Set();
                }
                resp = res;
            });
            var result = new CMoveIOD()
            {
                QueryLevel = QueryLevel.IMAGE, SOPInstanceUID = iod.SOPInstanceUID, PatientId = iod.PatientId, StudyInstanceUID = iod.StudyInstanceUID, SeriesInstanceUID = iod.SeriesInstanceUID
            };
            var request = new CMoveRequest(result, toAETite, Root.STUDY, EvilDICOM.Core.Enums.Priority.MEDIUM, msgId);

            this.DIMSEService.CMoveResponseReceived += cr;
            this.SendMessage(request, daemon);
            mr.WaitOne();
            this.DIMSEService.CMoveResponseReceived -= cr;
            msgId += 2;
            return(resp);
        }
Пример #2
0
 private void DIMSEService_CMoveResponseReceived(CMoveResponse req, Association asc)
 {
     if ((int)req.Status != 65280)
     {
         return;
     }
     this.OnProgressUpdated((int)req.NumberOfCompletedOps, (int)req.NumberOfRemainingOps, (int)req.NumberOfFailedOps, (int)req.NumberOfWarningOps);
 }
Пример #3
0
        /// <summary>
        /// Emits a CMove operation to an entity which moves an image from the entity to the specified AETitle
        /// </summary>
        /// <param name="scp">the provider which will perform the move</param>
        /// <param name="sopUid">the uid of the image to be moved</param>
        /// <param name="patientId">the patient id of the image</param>
        /// <param name="toAETite">the entity title which will receive the image</param>
        /// <param name="msgId">the message id</param>
        /// <returns>the move response</returns>
        public CMoveResponse SendCMoveImage(Entity daemon, CFindImageIOD iod, string toAETite, ref ushort msgId)
        {
            System.DateTime lastContact = System.DateTime.Now;
            int             msWait      = 2000;

            var           mr   = new ManualResetEvent(false);
            CMoveResponse resp = null;
            var           cr   = new Services.DIMSEService.DIMSEResponseHandler <CMoveResponse>((res, asc) =>
            {
                lastContact = System.DateTime.Now;
                if (!(res.Status == (ushort)Status.PENDING))
                {
                    mr.Set();
                }
                resp = res;
            });
            var result = new CMoveIOD
            {
                QueryLevel        = QueryLevel.IMAGE,
                SOPInstanceUID    = iod.SOPInstanceUID,
                PatientId         = iod.PatientId,
                StudyInstanceUID  = iod.StudyInstanceUID,
                SeriesInstanceUID = iod.SeriesInstanceUID
            };
            var request = new CMoveRequest(result, toAETite, Root.STUDY, Core.Enums.Priority.MEDIUM, msgId);

            DIMSEService.CMoveResponseReceived += cr;
            SendMessage(request, daemon);
            while ((System.DateTime.Now - lastContact).TotalMilliseconds < msWait)
            {
                mr.WaitOne(msWait);
            }
            DIMSEService.CMoveResponseReceived -= cr;
            msgId += 2;
            return(resp);
        }
Пример #4
0
 void DIMSEService_CMoveResponseReceived(CMoveResponse req, Association asc)
 {
     throw new NotImplementedException();
 }