예제 #1
0
        public void PublishFiles(IDicomServiceNode remoteAEInfo, IStudyRootData study, DeletionBehaviour behaviour, List <string> files)
        {
            EventResult result = EventResult.Success;

            try
            {
                var request = new PublishFilesRequest
                {
                    DestinationServerName     = remoteAEInfo.Name,
                    DestinationServerAETitle  = remoteAEInfo.AETitle,
                    DestinationServerHostname = remoteAEInfo.ScpParameters != null ? remoteAEInfo.ScpParameters.HostName : null,
                    DestinationServerPort     = remoteAEInfo.ScpParameters != null ? remoteAEInfo.ScpParameters.Port : 0,
                    Priority          = WorkItemPriorityEnum.High,
                    DeletionBehaviour = behaviour,
                    Study             = new WorkItemStudy(study),
                    Patient           = new WorkItemPatient(study),
                    FilePaths         = files
                };
                InsertRequest(request, new DicomSendProgress());
            }
            catch (Exception ex)
            {
                result    = EventResult.MajorFailure;
                Exception = ex;
                Platform.Log(LogLevel.Error, ex, Common.SR.MessageFailedToSendSops);
                throw;
            }
            finally
            {
                var instances = new AuditedInstances();
                instances.AddInstance(study.PatientId, study.PatientsName, study.StudyInstanceUid);

                AuditHelper.LogBeginSendInstances(remoteAEInfo.AETitle, remoteAEInfo.ScpParameters.HostName,
                                                  instances,
                                                  string.IsNullOrEmpty(Request.UserName)
                                                                        ? EventSource.CurrentProcess
                                                                        : EventSource.CurrentUser, result);
            }
        }
예제 #2
0
        public void PublishFiles(IDicomServiceNode remoteAEInfo, IStudyRootData study, DeletionBehaviour behaviour, List<string> files)
        {
            EventResult result = EventResult.Success;
            try
            {
                var request = new PublishFilesRequest
                                  {
                                      DestinationServerName = remoteAEInfo.Name,
                                      Priority = WorkItemPriorityEnum.High,
                                      DeletionBehaviour = behaviour,
                                      Study = new WorkItemStudy(study),
                                      Patient = new WorkItemPatient(study),
                                      FilePaths = files
                                  };
                InsertRequest(request, new DicomSendProgress());
            }
            catch (Exception ex)
            {
                result = EventResult.MajorFailure;
                Exception = ex;
                Platform.Log(LogLevel.Error, ex, Common.SR.MessageFailedToSendSops);
                throw;
            }
            finally
            {
                var instances = new AuditedInstances();
                instances.AddInstance(study.PatientId, study.PatientsName, study.StudyInstanceUid);

                AuditHelper.LogBeginSendInstances(remoteAEInfo.AETitle, remoteAEInfo.ScpParameters.HostName,
                                                  instances,
                                                  string.IsNullOrEmpty(Request.UserName)
                                                      ? EventSource.CurrentProcess
                                                      : EventSource.CurrentUser, result);
            }
        }