Exemple #1
0
        public void Config(MoveObjectsJob MoveJob)
        {
            try
            {
                if (String.IsNullOrEmpty(PatientID) && String.IsNullOrEmpty(StudyInstanceUID) && String.IsNullOrEmpty(SeriesInstanceUID) && String.IsNullOrEmpty(SOPInstanceUID))
                {
                    throw new ArgumentException("Should provide one key to perform c-move");
                }

                MoveJob.DataSet = new DicomDataSetAdapter()
                {
                    PatientID         = PatientID,
                    StudyInstanceUID  = StudyInstanceUID,
                    SeriesInstanceUID = SeriesInstanceUID,
                    SOPInstanceUID    = SOPInstanceUID
                };
            }
            catch (System.Exception e)
            {
                #region LOG
                {
                    string message = @"MoveObjectsJobConfig Failure: " + e.Message;
                    Logger.Global.Log(string.Empty, string.Empty, -1, string.Empty, string.Empty, -1, DicomCommandType.Undefined, DateTime.Now,
                                      LogType.Information, MessageDirection.None, message, null, null);
                }
                #endregion

                throw;
            }
        }
Exemple #2
0
        private static MoveObjectsJob CreateJob(string sType, string sObj, string sOwner)
        {
            MoveObjectsJob moj = JobsPersistence.Load <MoveObjectsJob>(sObj);

            moj.PatientRightsDataAccess = JobsQeue.PatientRightsDataAccess;
            moj.DataAccessAgent         = JobsQeue.DataAccessAgent;
            moj.Owner = sOwner;
            if (null != moj.Settings)
            {
                moj.Settings.MoveToClientAE = JobsQeue.MoveToAE;
            }
            return(moj);
        }
Exemple #3
0
        public bool Match(string PatientID,
                          string StudyInstanceUID,
                          string SeriesInstanceUID,
                          string SOPInstanceUID)
        {
            if (string.IsNullOrEmpty(PatientID) &&
                string.IsNullOrEmpty(StudyInstanceUID) &&
                string.IsNullOrEmpty(SeriesInstanceUID) &&
                string.IsNullOrEmpty(SOPInstanceUID))
            {
                return(true);
            }

            if (!_idisset)
            {
                return(true);
            }

            //have to load details...

            string   sType;
            string   sObject;
            string   sUserData;
            string   sError;
            string   sOwner;
            int      nStatus;
            int      nCompletedStatus;
            DateTime time;

            _DownloadJobsDataAccessAgent.ReadJob(Id, out sType, out sObject, out nStatus, out nCompletedStatus, out time, out sError, out sUserData, out sOwner);

            using (MoveObjectsJob job = CreateJob(sType, sObject, ""))
            {
                if (null == job.DataSet)
                {
                    return(false);
                }

                ReverseDicomDatasetAdapter dataSetReader = new ReverseDicomDatasetAdapter()
                {
                    query = job.DataSet
                };

                string curPatientID         = dataSetReader.PatientID;
                string curStudyInstanceUID  = dataSetReader.StudyInstanceUID;
                string curSeriesInstanceUID = dataSetReader.SeriesInstanceUID;
                string curSOPInstanceUID    = dataSetReader.SOPInstanceUID;

                if (
                    ((PatientID == curPatientID) || (string.IsNullOrEmpty(PatientID) && string.IsNullOrEmpty(curPatientID))) &&
                    ((StudyInstanceUID == curStudyInstanceUID) || (string.IsNullOrEmpty(StudyInstanceUID) && string.IsNullOrEmpty(curStudyInstanceUID))) &&
                    ((SeriesInstanceUID == curSeriesInstanceUID) || (string.IsNullOrEmpty(SeriesInstanceUID) && string.IsNullOrEmpty(curSeriesInstanceUID))) &&
                    ((SOPInstanceUID == curSOPInstanceUID) || (string.IsNullOrEmpty(SOPInstanceUID) && string.IsNullOrEmpty(curSOPInstanceUID)))
                    )
                {
                    return(true);
                }
            }

            return(false);
        }
Exemple #4
0
        public void GetAllDetails
        (
            out JobProxy.Status status,
            out JobProxy.CompletedStatus completedstatus,
            out string sError,
            out string sUserData,
            out string sOwner,
            out string PatientID,
            out string StudyInstanceUID,
            out string SeriesInstanceUID,
            out string SOPInstanceUID,
            out string ServerAE,
            out string ServerIP,
            out int ServerPort,
            out int ServerTimeout,
            out string ClientAE,
            out string MoveToClientAE,
            out string ClientIP,
            out int ClientPort
        )
        {
            string   sType;
            string   sObject;
            int      nStatus;
            int      nCompletedStatus;
            DateTime time;


            PatientID         = string.Empty;
            StudyInstanceUID  = string.Empty;
            SeriesInstanceUID = string.Empty;
            SOPInstanceUID    = string.Empty;

            ServerAE       = string.Empty;
            ServerIP       = string.Empty;
            ServerPort     = 0;
            ServerTimeout  = 0;
            ClientAE       = string.Empty;
            MoveToClientAE = string.Empty;
            ClientIP       = string.Empty;
            ClientPort     = 0;

            CheckHasId();

            _DownloadJobsDataAccessAgent.ReadJob(Id, out sType, out sObject, out nStatus, out nCompletedStatus, out time, out sError, out sUserData, out sOwner);

            status          = (Status)nStatus;
            completedstatus = (CompletedStatus)nCompletedStatus;

            using (MoveObjectsJob job = CreateJob(sType, sObject, sOwner))
            {
                ServerAE       = job.ServerAE;
                ServerIP       = job.ServerIP;
                ServerPort     = job.ServerPort;
                ServerTimeout  = job.ServerTimeout;
                ClientAE       = job.ClientAE;
                MoveToClientAE = job.MoveToClientAE;
                ClientIP       = job.ClientIP;
                ClientPort     = job.ClientPort;

                if (null != job.DataSet)
                {
                    ReverseDicomDatasetAdapter dataSetReader = new ReverseDicomDatasetAdapter()
                    {
                        query = job.DataSet
                    };

                    PatientID         = dataSetReader.PatientID;
                    StudyInstanceUID  = dataSetReader.StudyInstanceUID;
                    SeriesInstanceUID = dataSetReader.SeriesInstanceUID;
                    SOPInstanceUID    = dataSetReader.SOPInstanceUID;
                }
            }
        }