public void RetrieveSeries(IDicomServiceNode remoteAEInfo, IStudyRootData study, string[] seriesInstanceUids) { EventResult result = EventResult.Success; try { var request = new DicomRetrieveSeriesRequest { ServerName = remoteAEInfo.Name, SeriesInstanceUids = new List <string>(), Study = new WorkItemStudy(study), Patient = new WorkItemPatient(study) }; request.SeriesInstanceUids.AddRange(seriesInstanceUids); InsertRequest(request, new DicomRetrieveProgress()); } catch (Exception ex) { result = EventResult.MajorFailure; Exception = ex; throw; } finally { var instances = new AuditedInstances(); instances.AddInstance(study.PatientId, study.PatientsName, study.StudyInstanceUid); AuditHelper.LogBeginReceiveInstances(remoteAEInfo.AETitle, remoteAEInfo.ScpParameters.HostName, instances, string.IsNullOrEmpty(Request.UserName) ? EventSource.CurrentProcess : EventSource.CurrentUser, result); } }
public void SendStudy(IDicomServiceNode remoteAEInfo, IStudyRootData study, WorkItemPriorityEnum priority) { EventResult result = EventResult.Success; try { var request = new DicomSendStudyRequest { DestinationServerName = remoteAEInfo.Name, Priority = priority, Study = new WorkItemStudy(study), Patient = new WorkItemPatient(study) }; InsertRequest(request, new DicomSendProgress()); } catch (Exception ex) { result = EventResult.MajorFailure; Exception = ex; Platform.Log(LogLevel.Error, ex, Common.SR.MessageFailedToSendStudy); 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); } }
public void Anonymize(bool applyToAll, IStudyRootData studyPrototype, bool keepPrivateTags) { _anonymizer.StudyDataPrototype = new StudyData(studyPrototype); _anonymizer.KeepPrivateTags = keepPrivateTags; if (applyToAll == false) { if (!WarnReportOrAttachmentAnonymization(_loadedFiles[_position])) { return; } _anonymizer.Anonymize(_loadedFiles[_position]); _dirtyFlags[_position] = true; } else { if (!WarnReportOrAttachmentAnonymization()) { return; } for (int i = 0; i < _loadedFiles.Count; i++) { _anonymizer.Anonymize(_loadedFiles[i]); _dirtyFlags[i] = true; } } }
public void DeleteSeries(IStudyRootData study, List <string> seriesInstanceUids) { EventResult result = EventResult.Success; try { var request = new DeleteSeriesRequest { Study = new WorkItemStudy(study), Patient = new WorkItemPatient(study), SeriesInstanceUids = seriesInstanceUids }; InsertRequest(request, new DeleteProgress()); } catch (Exception ex) { result = EventResult.MajorFailure; Exception = ex; throw; } finally { var instances = new AuditedInstances(); instances.AddInstance(study.PatientId, study.PatientsName, study.StudyInstanceUid); AuditHelper.LogDeleteSeries(new List <string> { AuditHelper.LocalAETitle }, instances, EventSource.CurrentUser, result); } }
/// <summary> /// Initializes a new instance of <see cref="StudyItem"/>. /// </summary> public StudyItem(IStudyRootData other, IDicomServiceNode server) // TODO (CR Nov 2012) - null is passed to the base class (Macro.Dicom.ServiceModel.Query.Identifier) causing // some of the properties in the base such as SpecificCharacterSet, InstanceAvailability, RetrieveAE not being copied as one would expect : this(other, other, null as IIdentifier) { Platform.CheckForNullReference(server, "server"); Server = server; }
protected override IPatientData ReconcilePatient(IStudyRootData studyData) { var reconciled = _reconciliationStrategy.ReconcilePatientInformation(studyData); if (reconciled != null) { return(new StudyRootStudyIdentifier(reconciled, new StudyIdentifier())); } return(base.ReconcilePatient(studyData)); }
/// <summary> /// Constructor. /// </summary> public StudyData(IStudyRootData sourceData) { if (sourceData != null) { _patientId = sourceData.PatientId; _patientsNameRaw = sourceData.PatientsName; _patientsBirthDateRaw = sourceData.PatientsBirthDate; _patientsSex = sourceData.PatientsSex; _accessionNumber = sourceData.AccessionNumber; _studyDescription = sourceData.StudyDescription; _studyId = sourceData.StudyId; _studyDateRaw = sourceData.StudyDate; } }
/// <summary> /// Constructor. /// </summary> public StudyData(IStudyRootData sourceData) { if (sourceData != null) { _patientId = sourceData.PatientId; _patientsNameRaw = sourceData.PatientsName; _patientsBirthDateRaw = sourceData.PatientsBirthDate; _patientsSex = sourceData.PatientsSex; _accessionNumber = sourceData.AccessionNumber; _studyDescription = sourceData.StudyDescription; _studyId = sourceData.StudyId; _studyDateRaw = sourceData.StudyDate; } }
public void RetrieveStudy(IDicomServiceNode remoteAEInfo, IStudyRootData study) { EventResult result = EventResult.Success; try { var request = new DicomRetrieveStudyRequest { ServerName = remoteAEInfo.Name, ServerAETitle = remoteAEInfo.AETitle, ServerHostname = remoteAEInfo.ScpParameters != null ? remoteAEInfo.ScpParameters.HostName : null, ServerPort = remoteAEInfo.ScpParameters != null ? remoteAEInfo.ScpParameters.Port : 0, Study = new WorkItemStudy(study), Patient = new WorkItemPatient(study) }; // TODO (CR Jul 2012): The service itself has logic like this already, so this should probably be there, too. // Then, we could also get rid of this GetMatching... method. var data = GetMatchingActiveWorkItem(request); if (data != null) { var existingRequest = data.Request as DicomRetrieveStudyRequest; if (existingRequest != null && remoteAEInfo.Name == existingRequest.ServerName) { Request = data.Request; return; } } InsertRequest(request, new DicomRetrieveProgress()); } catch (Exception ex) { result = EventResult.MajorFailure; Exception = ex; Platform.Log(LogLevel.Error, ex, Common.SR.MessageFailedToSendStudy); throw; } finally { var instances = new AuditedInstances(); instances.AddInstance(study.PatientId, study.PatientsName, study.StudyInstanceUid); AuditHelper.LogBeginReceiveInstances(remoteAEInfo.AETitle, remoteAEInfo.ScpParameters.HostName, instances, string.IsNullOrEmpty(Request.UserName) ? EventSource.CurrentProcess : EventSource.CurrentUser, result); } }
internal AnonymizeStudyComponent(IStudyRootData studyItem) { _original = new StudyData { AccessionNumber = studyItem.AccessionNumber, PatientsName = new PersonName(studyItem.PatientsName), PatientId = studyItem.PatientId, StudyDescription = studyItem.StudyDescription, PatientsBirthDateRaw = studyItem.PatientsBirthDate, StudyDateRaw = studyItem.StudyDate }; _anonymized = _original.Clone(); _validator = new DicomAnonymizer.ValidationStrategy(); }
internal AnonymizeStudyComponent(IStudyRootData studyItem) { _original = new StudyData { AccessionNumber = studyItem.AccessionNumber, PatientsName = new PersonName(studyItem.PatientsName), PatientId = studyItem.PatientId, StudyDescription = studyItem.StudyDescription, PatientsBirthDateRaw = studyItem.PatientsBirthDate, StudyDateRaw = studyItem.StudyDate }; _anonymized = _original.Clone(); _validator = new DicomAnonymizer.ValidationStrategy(); ShowKeepReportsAndAttachments = true; ShowPreserveSeriesData = true; }
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); } }
public StudyRootStudyIdentifier(IStudyRootData other) : base(other) { CopyFrom(other); }
public void DeleteSeries(IStudyRootData study, List<string> seriesInstanceUids) { EventResult result = EventResult.Success; try { var request = new DeleteSeriesRequest { Study = new WorkItemStudy(study), Patient = new WorkItemPatient(study), SeriesInstanceUids = seriesInstanceUids }; InsertRequest(request, new DeleteProgress()); } catch (Exception ex) { result = EventResult.MajorFailure; Exception = ex; throw; } finally { var instances = new AuditedInstances(); instances.AddInstance(study.PatientId, study.PatientsName, study.StudyInstanceUid); AuditHelper.LogDeleteSeries(new List<string> {AuditHelper.LocalAETitle}, instances, EventSource.CurrentUser, result); } }
public StudyRootStudyIdentifier(IStudyRootData other) : base(other) { CopyFrom(other); }
/// <summary> /// Initializes a new instance of <see cref="StudyItem"/>. /// </summary> public StudyItem(IStudyRootData other, IDicomServiceNode server) : this(other, other, null as IIdentifier) { Platform.CheckForNullReference(server, "server"); Server = server; }
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); } }
public void RetrieveSeries(IDicomServiceNode remoteAEInfo, IStudyRootData study, string[] seriesInstanceUids) { EventResult result = EventResult.Success; try { var request = new DicomRetrieveSeriesRequest { ServerName = remoteAEInfo.Name, SeriesInstanceUids = new List<string>(), Study = new WorkItemStudy(study), Patient = new WorkItemPatient(study) }; request.SeriesInstanceUids.AddRange(seriesInstanceUids); InsertRequest(request, new DicomRetrieveProgress()); } catch (Exception ex) { result = EventResult.MajorFailure; Exception = ex; throw; } finally { var instances = new AuditedInstances(); instances.AddInstance(study.PatientId, study.PatientsName, study.StudyInstanceUid); AuditHelper.LogBeginReceiveInstances(remoteAEInfo.AETitle, remoteAEInfo.ScpParameters.HostName, instances, string.IsNullOrEmpty(Request.UserName) ? EventSource.CurrentProcess : EventSource.CurrentUser, result); } }
public void RetrieveStudy(IDicomServiceNode remoteAEInfo, IStudyRootData study) { EventResult result = EventResult.Success; try { var request = new DicomRetrieveStudyRequest { ServerName = remoteAEInfo.Name, Study = new WorkItemStudy(study), Patient = new WorkItemPatient(study) }; // TODO (CR Jul 2012): The service itself has logic like this already, so this should probably be there, too. // Then, we could also get rid of this GetMatching... method. var data = GetMatchingActiveWorkItem(request); if (data != null) { var existingRequest = data.Request as DicomRetrieveStudyRequest; if (existingRequest != null && remoteAEInfo.Name == existingRequest.ServerName) { Request = data.Request; return; } } InsertRequest(request, new DicomRetrieveProgress()); } catch (Exception ex) { result = EventResult.MajorFailure; Exception = ex; Platform.Log(LogLevel.Error, ex, Common.SR.MessageFailedToSendStudy); throw; } finally { var instances = new AuditedInstances(); instances.AddInstance(study.PatientId, study.PatientsName, study.StudyInstanceUid); AuditHelper.LogBeginReceiveInstances(remoteAEInfo.AETitle, remoteAEInfo.ScpParameters.HostName, instances, string.IsNullOrEmpty(Request.UserName) ? EventSource.CurrentProcess : EventSource.CurrentUser, result); } }
protected virtual IPatientData ReconcilePatient(IStudyRootData studyData) { return(studyData); }
public void SendSops(IDicomServiceNode remoteAEInfo, IStudyRootData study, string seriesInstanceUid, string[] sopInstanceUids, WorkItemPriorityEnum priority) { EventResult result = EventResult.Success; try { var request = new DicomSendSopRequest { DestinationServerName = remoteAEInfo.Name, SeriesInstanceUid = seriesInstanceUid, SopInstanceUids = new List<string>(), Priority = priority, Study = new WorkItemStudy(study), Patient = new WorkItemPatient(study) }; request.SopInstanceUids.AddRange(sopInstanceUids); 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); } }