protected void LoadStudy() { if (String.IsNullOrEmpty(_studyInstanceUid)) { return; } if (_partition == null) { return; } StudyAdaptor studyAdaptor = new StudyAdaptor(); StudySelectCriteria criteria = new StudySelectCriteria(); criteria.StudyInstanceUid.EqualTo(_studyInstanceUid); criteria.ServerPartitionKey.EqualTo(Partition.GetKey()); Study study = studyAdaptor.GetFirst(HttpContextData.Current.ReadContext, criteria); if (study != null) { _study = StudySummaryAssembler.CreateStudySummary(HttpContextData.Current.ReadContext, study); } else { StudyNotFoundException exception = new StudyNotFoundException(_studyInstanceUid); ExceptionHandler.ThrowException(exception); } StudyDetailsPanel.Study = _study; StudyDetailsPanel.DataBind(); }
private static WorkQueueDetails CreateGeneralWorkQueueItemDetails(Model.WorkQueue item) { var detail = new WorkQueueDetails(); detail.Key = item.Key; detail.ScheduledDateTime = item.ScheduledTime; detail.ExpirationTime = item.ExpirationTime; detail.InsertTime = item.InsertTime; detail.FailureCount = item.FailureCount; detail.Type = item.WorkQueueTypeEnum; detail.Status = item.WorkQueueStatusEnum; detail.Priority = item.WorkQueuePriorityEnum; detail.FailureDescription = item.FailureDescription; detail.ServerDescription = item.ProcessorID; StudyStorageLocation storage = WorkQueueController.GetLoadStorageLocation(item); detail.StorageLocationPath = storage.GetStudyPath(); // Fetch UIDs var wqUidsAdaptor = new WorkQueueUidAdaptor(); var uidCriteria = new WorkQueueUidSelectCriteria(); uidCriteria.WorkQueueKey.EqualTo(item.GetKey()); IList <WorkQueueUid> uids = wqUidsAdaptor.Get(uidCriteria); var mapSeries = new Hashtable(); foreach (WorkQueueUid uid in uids) { if (mapSeries.ContainsKey(uid.SeriesInstanceUid) == false) { mapSeries.Add(uid.SeriesInstanceUid, uid.SopInstanceUid); } } detail.NumInstancesPending = uids.Count; detail.NumSeriesPending = mapSeries.Count; // Fetch the study and patient info var ssAdaptor = new StudyStorageAdaptor(); StudyStorage storages = ssAdaptor.Get(item.StudyStorageKey); var studyAdaptor = new StudyAdaptor(); var studycriteria = new StudySelectCriteria(); studycriteria.StudyInstanceUid.EqualTo(storages.StudyInstanceUid); studycriteria.ServerPartitionKey.EqualTo(item.ServerPartitionKey); Study study = studyAdaptor.GetFirst(studycriteria); // Study may not be available until the images are processed. if (study != null) { var studyAssembler = new StudyDetailsAssembler(); detail.Study = studyAssembler.CreateStudyDetail(study); } return(detail); }
private void LoadSeriesDetails() { if (!String.IsNullOrEmpty(_serverae) && !String.IsNullOrEmpty(_studyInstanceUid) && !String.IsNullOrEmpty(_seriesInstanceUid)) { StudyAdaptor studyAdaptor = new StudyAdaptor(); SeriesSearchAdaptor seriesAdaptor = new SeriesSearchAdaptor(); ServerPartitionDataAdapter adaptor = new ServerPartitionDataAdapter(); ServerPartitionSelectCriteria criteria = new ServerPartitionSelectCriteria(); criteria.AeTitle.EqualTo(_serverae); Model.ServerPartition partition = adaptor.GetFirst(criteria); if (partition != null) { Partition = partition; StudySelectCriteria studyCriteria = new StudySelectCriteria(); studyCriteria.StudyInstanceUid.EqualTo(_studyInstanceUid); studyCriteria.ServerPartitionKey.EqualTo(Partition.GetKey()); Model.Study study = studyAdaptor.GetFirst(studyCriteria); if (study != null) { // there should be only one study _study = study; SeriesSelectCriteria seriesCriteria = new SeriesSelectCriteria(); seriesCriteria.SeriesInstanceUid.EqualTo(_seriesInstanceUid); Series series = seriesAdaptor.GetFirst(seriesCriteria); if (series != null) { _series = series; } } } } if (_study!=null && _series != null) { SeriesDetailsPanel1.Study = _study; SeriesDetailsPanel1.Series = _series; } DataBind(); }
protected override void OnInit(EventArgs e) { //This sets the GridView Page Size to the number of series. Needs to be done in the OnInit method, //since the page size needs to be set here, and the Study and Partition aren't set until the databind //happens in StudyDetailsTabs. var studyInstanceUID = Request.QueryString[ImageServerConstants.QueryStrings.StudyInstanceUID]; var serverAE = Request.QueryString[ImageServerConstants.QueryStrings.ServerAE]; if (!String.IsNullOrEmpty(studyInstanceUID) && !String.IsNullOrEmpty(serverAE)) { var adaptor = new ServerPartitionDataAdapter(); var partitionCriteria = new ServerPartitionSelectCriteria(); partitionCriteria.AeTitle.EqualTo(serverAE); IList <ServerPartition> partitions = adaptor.Get(partitionCriteria); if (partitions != null && partitions.Count > 0) { if (partitions.Count == 1) { var partition = partitions[0]; var studyAdaptor = new StudyAdaptor(); var studyCriteria = new StudySelectCriteria(); studyCriteria.StudyInstanceUid.EqualTo(studyInstanceUID); studyCriteria.ServerPartitionKey.EqualTo(partition.GetKey()); var study = studyAdaptor.GetFirst(studyCriteria); if (study != null) { var seriesAdaptor = new SeriesSearchAdaptor(); var criteria = new SeriesSelectCriteria(); criteria.StudyKey.EqualTo(study.GetKey()); criteria.ServerPartitionKey.EqualTo(partition.GetKey()); Series = seriesAdaptor.Get(criteria); GridView1.PageSize = Series.Count; } } } } else { GridView1.PageSize = 150; //Set it to a large number to ensure that all series are displayed if more than 25. } }
/// <summary> /// Constructs an instance of <see cref="WorkQueueSummary"/> based on a <see cref="WorkQueue"/> object. /// </summary> /// <param name="item"></param> /// <returns></returns> /// <remark> /// /// </remark> private ArchiveQueueSummary CreateWorkQueueSummary(ArchiveQueue item) { ArchiveQueueSummary summary = new ArchiveQueueSummary(); summary.TheArchiveQueueItem = item; summary.ThePartition = Partition; if (item.FailureDescription == null) { summary.Notes = String.Empty; } else { summary.Notes = item.FailureDescription; } // Fetch the patient info: StudyStorageAdaptor ssAdaptor = new StudyStorageAdaptor(); summary.StudyStorage = ssAdaptor.Get(item.StudyStorageKey); if (summary.StudyStorage == null) { summary.PatientId = "N/A"; summary.PatientsName = "N/A"; return(summary); } StudyAdaptor studyAdaptor = new StudyAdaptor(); StudySelectCriteria studycriteria = new StudySelectCriteria(); studycriteria.StudyInstanceUid.EqualTo(summary.StudyStorage.StudyInstanceUid); studycriteria.ServerPartitionKey.EqualTo(summary.StudyStorage.ServerPartitionKey); Study theStudy = studyAdaptor.GetFirst(studycriteria); if (theStudy == null) { summary.PatientId = "N/A"; summary.PatientsName = "N/A"; } else { summary.PatientId = theStudy.PatientId; summary.PatientsName = theStudy.PatientsName; } return(summary); }
/// <summary> /// Constructs an instance of <see cref="WorkQueue"/> based on a <see cref="WorkQueueSummary"/> object. /// </summary> /// <param name="item"></param> /// <returns></returns> /// <remark> /// /// </remark> private RestoreQueueSummary CreateWorkQueueSummary(RestoreQueue item) { RestoreQueueSummary summary = new RestoreQueueSummary(); summary.TheRestoreQueueItem = item; summary.ThePartition = Partition; if (item.FailureDescription == null) { summary.Notes = String.Empty; } else { summary.Notes = item.FailureDescription; } // Fetch the patient info: StudyStorageAdaptor ssAdaptor = new StudyStorageAdaptor(); summary.StudyStorage = ssAdaptor.Get(item.StudyStorageKey); if (summary.StudyStorage == null) { summary.PatientId = "N/A"; summary.PatientsName = "N/A"; return(summary); } StudyAdaptor studyAdaptor = new StudyAdaptor(); StudySelectCriteria studycriteria = new StudySelectCriteria(); studycriteria.StudyInstanceUid.EqualTo(summary.StudyStorage.StudyInstanceUid); studycriteria.ServerPartitionKey.EqualTo(summary.StudyStorage.ServerPartitionKey); IList <Study> studyList = studyAdaptor.Get(studycriteria); if (studyList == null || studyList.Count == 0) { summary.PatientId = "N/A"; summary.PatientsName = "N/A"; } else { summary.PatientId = studyList[0].PatientId; summary.PatientsName = studyList[0].PatientsName; } return(summary); }
protected Study LoadStudy(string studyInstanceUID) { if (String.IsNullOrEmpty(studyInstanceUID)) { return(null); } if (_partition == null) { return(null); } StudyAdaptor studyAdaptor = new StudyAdaptor(); StudySelectCriteria criteria = new StudySelectCriteria(); criteria.StudyInstanceUid.EqualTo(studyInstanceUID); criteria.ServerPartitionKey.EqualTo(Partition.Key); return(studyAdaptor.GetFirst(criteria)); }
/// <summary> /// Constructs an instance of <see cref="WorkQueueSummary"/> based on a <see cref="WorkQueue"/> object. /// </summary> /// <param name="item"></param> /// <returns></returns> /// <remark> /// /// </remark> private WorkQueueSummary CreateWorkQueueSummary(WorkQueue item) { WorkQueueSummary summary = new WorkQueueSummary { TheWorkQueueItem = item, ThePartition = Partition }; // Fetch the patient info: StudyStorageAdaptor ssAdaptor = new StudyStorageAdaptor(); StudyStorage storages = ssAdaptor.Get(item.StudyStorageKey); if (storages == null) { summary.PatientId = "N/A"; summary.PatientsName = "N/A"; return(summary); } StudyAdaptor studyAdaptor = new StudyAdaptor(); StudySelectCriteria studycriteria = new StudySelectCriteria(); studycriteria.StudyInstanceUid.EqualTo(storages.StudyInstanceUid); studycriteria.ServerPartitionKey.EqualTo(item.ServerPartitionKey); IList <Study> studyList = studyAdaptor.Get(studycriteria); if (studyList == null || studyList.Count == 0) { summary.PatientId = "N/A"; summary.PatientsName = "N/A"; } else { summary.PatientId = studyList[0].PatientId; summary.PatientsName = studyList[0].PatientsName; } if (item.WorkQueueTypeEnum == WorkQueueTypeEnum.WebMoveStudy || item.WorkQueueTypeEnum == WorkQueueTypeEnum.AutoRoute) { DeviceDataAdapter deviceAdaptor = new DeviceDataAdapter(); Device dest = deviceAdaptor.Get(item.DeviceKey); summary.Notes = String.Format("Destination AE : {0}", dest.AeTitle); if (item.FailureDescription != null) { summary.FullDescription = String.Format("{0}, {1}", summary.Notes, item.FailureDescription); //Set the FullDescription for the Tooltip in the GUI summary.Notes = summary.FullDescription.Length > 60 ? summary.FullDescription.Substring(0, 60) : summary.FullDescription; } } else if (item.FailureDescription != null) { // This used to only be shown when the status was "Failed" for a // queue entry. We now show it any time there's if (item.FailureDescription.Length > 60) { summary.Notes = item.FailureDescription.Substring(0, 60); summary.Notes += " ..."; summary.FullDescription = item.FailureDescription; //Set the FullDescription for the Tooltip in the GUI } else { summary.Notes = item.FailureDescription; } } summary.RequiresAttention = item.WorkQueueStatusEnum.Equals(WorkQueueStatusEnum.Failed) || !ServerPlatform.IsActiveWorkQueue(item); return(summary); }
protected void LoadStudy() { if (String.IsNullOrEmpty(_studyInstanceUid)) return; if (_partition == null) return; StudyAdaptor studyAdaptor = new StudyAdaptor(); StudySelectCriteria criteria = new StudySelectCriteria(); criteria.StudyInstanceUid.EqualTo(_studyInstanceUid); criteria.ServerPartitionKey.EqualTo(Partition.GetKey()); Study study = studyAdaptor.GetFirst(HttpContextData.Current.ReadContext, criteria); if (study != null) { _study = StudySummaryAssembler.CreateStudySummary(HttpContextData.Current.ReadContext, study); } else { StudyNotFoundException exception = new StudyNotFoundException(_studyInstanceUid); ExceptionHandler.ThrowException(exception); } StudyDetailsPanel.Study = _study; StudyDetailsPanel.DataBind(); GenerateAuditLog(); }
private static WorkQueueDetails CreateEditWorkQueueItemDetails(Model.WorkQueue item) { string studyPath; try { StudyStorageLocation storage = WorkQueueController.GetLoadStorageLocation(item); studyPath = storage.GetStudyPath(); } catch (Exception) { studyPath = string.Empty; } var detail = new WorkQueueDetails { Key = item.Key, ScheduledDateTime = item.ScheduledTime, ExpirationTime = item.ExpirationTime, InsertTime = item.InsertTime, FailureCount = item.FailureCount, Type = item.WorkQueueTypeEnum, Status = item.WorkQueueStatusEnum, Priority = item.WorkQueuePriorityEnum, FailureDescription = item.FailureDescription, ServerDescription = item.ProcessorID, StorageLocationPath = studyPath }; // Fetch UIDs var wqUidsAdaptor = new WorkQueueUidAdaptor(); var uidCriteria = new WorkQueueUidSelectCriteria(); uidCriteria.WorkQueueKey.EqualTo(item.GetKey()); IList <WorkQueueUid> uids = wqUidsAdaptor.Get(uidCriteria); var mapSeries = new Hashtable(); foreach (WorkQueueUid uid in uids) { if (mapSeries.ContainsKey(uid.SeriesInstanceUid) == false) { mapSeries.Add(uid.SeriesInstanceUid, uid.SopInstanceUid); } } detail.NumInstancesPending = uids.Count; detail.NumSeriesPending = mapSeries.Count; // Fetch the study and patient info var ssAdaptor = new StudyStorageAdaptor(); StudyStorage storages = ssAdaptor.Get(item.StudyStorageKey); var studyAdaptor = new StudyAdaptor(); var studycriteria = new StudySelectCriteria(); studycriteria.StudyInstanceUid.EqualTo(storages.StudyInstanceUid); studycriteria.ServerPartitionKey.EqualTo(item.ServerPartitionKey); Study study = studyAdaptor.GetFirst(studycriteria); // Study may not be available until the images are processed. if (study != null) { var studyAssembler = new StudyDetailsAssembler(); detail.Study = studyAssembler.CreateStudyDetail(study); } var parser = new EditStudyWorkQueueDataParser(); EditStudyWorkQueueData data = parser.Parse(item.Data.DocumentElement); detail.EditUpdateItems = data.EditRequest.UpdateEntries.ToArray(); return(detail); }
/// <summary> /// Constructs an instance of <see cref="WorkQueue"/> based on a <see cref="WorkQueueSummary"/> object. /// </summary> /// <param name="item"></param> /// <returns></returns> /// <remark> /// /// </remark> private RestoreQueueSummary CreateWorkQueueSummary(RestoreQueue item) { RestoreQueueSummary summary = new RestoreQueueSummary(); summary.TheRestoreQueueItem = item; summary.ThePartition = Partition; if (item.FailureDescription == null) summary.Notes = String.Empty; else summary.Notes = item.FailureDescription; // Fetch the patient info: StudyStorageAdaptor ssAdaptor = new StudyStorageAdaptor(); summary.StudyStorage = ssAdaptor.Get(item.StudyStorageKey); if (summary.StudyStorage == null) { summary.PatientId = "N/A"; summary.PatientsName = "N/A"; return summary; } StudyAdaptor studyAdaptor = new StudyAdaptor(); StudySelectCriteria studycriteria = new StudySelectCriteria(); studycriteria.StudyInstanceUid.EqualTo(summary.StudyStorage.StudyInstanceUid); studycriteria.ServerPartitionKey.EqualTo(summary.StudyStorage.ServerPartitionKey); IList<Study> studyList = studyAdaptor.Get(studycriteria); if (studyList == null || studyList.Count == 0) { summary.PatientId = "N/A"; summary.PatientsName = "N/A"; } else { summary.PatientId = studyList[0].PatientId; summary.PatientsName = studyList[0].PatientsName; } return summary; }
protected override void OnInit(EventArgs e) { //This sets the GridView Page Size to the number of series. Needs to be done in the OnInit method, //since the page size needs to be set here, and the Study and Partition aren't set until the databind //happens in StudyDetailsTabs. var studyInstanceUID = Request.QueryString[ImageServerConstants.QueryStrings.StudyInstanceUID]; var serverAE = Request.QueryString[ImageServerConstants.QueryStrings.ServerAE]; if (!String.IsNullOrEmpty(studyInstanceUID) && !String.IsNullOrEmpty(serverAE)) { var adaptor = new ServerPartitionDataAdapter(); var partitionCriteria = new ServerPartitionSelectCriteria(); partitionCriteria.AeTitle.EqualTo(serverAE); IList<ServerPartition> partitions = adaptor.Get(partitionCriteria); if (partitions != null && partitions.Count > 0) { if (partitions.Count == 1) { var partition = partitions[0]; var studyAdaptor = new StudyAdaptor(); var studyCriteria = new StudySelectCriteria(); studyCriteria.StudyInstanceUid.EqualTo(studyInstanceUID); studyCriteria.ServerPartitionKey.EqualTo(partition.GetKey()); var study = studyAdaptor.GetFirst(studyCriteria); if (study!=null) { var seriesAdaptor = new SeriesSearchAdaptor(); var criteria = new SeriesSelectCriteria(); criteria.StudyKey.EqualTo(study.GetKey()); criteria.ServerPartitionKey.EqualTo(partition.GetKey()); Series = seriesAdaptor.Get(criteria); GridView1.PageSize = Series.Count; } } } } else { GridView1.PageSize = 150; //Set it to a large number to ensure that all series are displayed if more than 25. } }
/// <summary> /// Constructs an instance of <see cref="WorkQueueSummary"/> based on a <see cref="WorkQueue"/> object. /// </summary> /// <param name="item"></param> /// <returns></returns> /// <remark> /// /// </remark> private WorkQueueSummary CreateWorkQueueSummary(WorkQueue item) { WorkQueueSummary summary = new WorkQueueSummary { TheWorkQueueItem = item, ThePartition = Partition }; // Fetch the patient info: StudyStorageAdaptor ssAdaptor = new StudyStorageAdaptor(); StudyStorage storages = ssAdaptor.Get(item.StudyStorageKey); if (storages == null) { summary.PatientId = "N/A"; summary.PatientsName = "N/A"; return summary; } StudyAdaptor studyAdaptor = new StudyAdaptor(); StudySelectCriteria studycriteria = new StudySelectCriteria(); studycriteria.StudyInstanceUid.EqualTo(storages.StudyInstanceUid); studycriteria.ServerPartitionKey.EqualTo(item.ServerPartitionKey); IList<Study> studyList = studyAdaptor.Get(studycriteria); if (studyList == null || studyList.Count == 0) { summary.PatientId = "N/A"; summary.PatientsName = "N/A"; } else { summary.PatientId = studyList[0].PatientId; summary.PatientsName = studyList[0].PatientsName; } if (item.WorkQueueTypeEnum == WorkQueueTypeEnum.WebMoveStudy || item.WorkQueueTypeEnum == WorkQueueTypeEnum.AutoRoute) { DeviceDataAdapter deviceAdaptor = new DeviceDataAdapter(); Device dest = deviceAdaptor.Get(item.DeviceKey); summary.Notes = String.Format("Destination AE : {0}", dest.AeTitle); if (item.FailureDescription != null) { summary.FullDescription = String.Format("{0}, {1}", summary.Notes, item.FailureDescription); //Set the FullDescription for the Tooltip in the GUI summary.Notes = summary.FullDescription.Length > 60 ? summary.FullDescription.Substring(0, 60) : summary.FullDescription; } } else if (item.FailureDescription != null) { // This used to only be shown when the status was "Failed" for a // queue entry. We now show it any time there's if (item.FailureDescription.Length > 60) { summary.Notes = item.FailureDescription.Substring(0, 60); summary.Notes += " ..."; summary.FullDescription = item.FailureDescription; //Set the FullDescription for the Tooltip in the GUI } else summary.Notes = item.FailureDescription; } summary.RequiresAttention = item.WorkQueueStatusEnum.Equals(WorkQueueStatusEnum.Failed) || !ServerPlatform.IsActiveWorkQueue(item); return summary; }
private static WorkQueueDetails CreateGeneralWorkQueueItemDetails(Model.WorkQueue item) { var detail = new WorkQueueDetails(); detail.Key = item.Key; detail.ScheduledDateTime = item.ScheduledTime; detail.ExpirationTime = item.ExpirationTime; detail.InsertTime = item.InsertTime; detail.FailureCount = item.FailureCount; detail.Type = item.WorkQueueTypeEnum; detail.Status = item.WorkQueueStatusEnum; detail.Priority = item.WorkQueuePriorityEnum; detail.FailureDescription = item.FailureDescription; detail.ServerDescription = item.ProcessorID; StudyStorageLocation storage = WorkQueueController.GetLoadStorageLocation(item); detail.StorageLocationPath = storage.GetStudyPath(); // Fetch UIDs var wqUidsAdaptor = new WorkQueueUidAdaptor(); var uidCriteria = new WorkQueueUidSelectCriteria(); uidCriteria.WorkQueueKey.EqualTo(item.GetKey()); IList<WorkQueueUid> uids = wqUidsAdaptor.Get(uidCriteria); var mapSeries = new Hashtable(); foreach (WorkQueueUid uid in uids) { if (mapSeries.ContainsKey(uid.SeriesInstanceUid) == false) mapSeries.Add(uid.SeriesInstanceUid, uid.SopInstanceUid); } detail.NumInstancesPending = uids.Count; detail.NumSeriesPending = mapSeries.Count; // Fetch the study and patient info var ssAdaptor = new StudyStorageAdaptor(); StudyStorage storages = ssAdaptor.Get(item.StudyStorageKey); var studyAdaptor = new StudyAdaptor(); var studycriteria = new StudySelectCriteria(); studycriteria.StudyInstanceUid.EqualTo(storages.StudyInstanceUid); studycriteria.ServerPartitionKey.EqualTo(item.ServerPartitionKey); Study study = studyAdaptor.GetFirst(studycriteria); // Study may not be available until the images are processed. if (study != null) { var studyAssembler = new StudyDetailsAssembler(); detail.Study = studyAssembler.CreateStudyDetail(study); } return detail; }
private static WorkQueueDetails CreateEditWorkQueueItemDetails(Model.WorkQueue item) { string studyPath; try { StudyStorageLocation storage = WorkQueueController.GetLoadStorageLocation(item); studyPath = storage.GetStudyPath(); } catch(Exception) { studyPath = string.Empty; } var detail = new WorkQueueDetails { Key = item.Key, ScheduledDateTime = item.ScheduledTime, ExpirationTime = item.ExpirationTime, InsertTime = item.InsertTime, FailureCount = item.FailureCount, Type = item.WorkQueueTypeEnum, Status = item.WorkQueueStatusEnum, Priority = item.WorkQueuePriorityEnum, FailureDescription = item.FailureDescription, ServerDescription = item.ProcessorID, StorageLocationPath = studyPath }; // Fetch UIDs var wqUidsAdaptor = new WorkQueueUidAdaptor(); var uidCriteria = new WorkQueueUidSelectCriteria(); uidCriteria.WorkQueueKey.EqualTo(item.GetKey()); IList<WorkQueueUid> uids = wqUidsAdaptor.Get(uidCriteria); var mapSeries = new Hashtable(); foreach (WorkQueueUid uid in uids) { if (mapSeries.ContainsKey(uid.SeriesInstanceUid) == false) mapSeries.Add(uid.SeriesInstanceUid, uid.SopInstanceUid); } detail.NumInstancesPending = uids.Count; detail.NumSeriesPending = mapSeries.Count; // Fetch the study and patient info var ssAdaptor = new StudyStorageAdaptor(); StudyStorage storages = ssAdaptor.Get(item.StudyStorageKey); var studyAdaptor = new StudyAdaptor(); var studycriteria = new StudySelectCriteria(); studycriteria.StudyInstanceUid.EqualTo(storages.StudyInstanceUid); studycriteria.ServerPartitionKey.EqualTo(item.ServerPartitionKey); Study study = studyAdaptor.GetFirst(studycriteria); // Study may not be available until the images are processed. if (study != null) { var studyAssembler = new StudyDetailsAssembler(); detail.Study = studyAssembler.CreateStudyDetail(study); } var parser = new EditStudyWorkQueueDataParser(); EditStudyWorkQueueData data = parser.Parse(item.Data.DocumentElement); detail.EditUpdateItems = data.EditRequest.UpdateEntries.ToArray(); return detail; }
protected Study LoadStudy(string studyInstanceUID) { if (String.IsNullOrEmpty(studyInstanceUID)) return null; if (_partition == null) return null; StudyAdaptor studyAdaptor = new StudyAdaptor(); StudySelectCriteria criteria = new StudySelectCriteria(); criteria.StudyInstanceUid.EqualTo(studyInstanceUID); criteria.ServerPartitionKey.EqualTo(Partition.Key); return studyAdaptor.GetFirst(criteria); }
/// <summary> /// Constructs an instance of <see cref="WorkQueueSummary"/> based on a <see cref="WorkQueue"/> object. /// </summary> /// <param name="item"></param> /// <returns></returns> /// <remark> /// /// </remark> private ArchiveQueueSummary CreateWorkQueueSummary(ArchiveQueue item) { ArchiveQueueSummary summary = new ArchiveQueueSummary(); summary.TheArchiveQueueItem = item; summary.ThePartition = Partition; if (item.FailureDescription == null) summary.Notes = String.Empty; else summary.Notes = item.FailureDescription; // Fetch the patient info: StudyStorageAdaptor ssAdaptor = new StudyStorageAdaptor(); summary.StudyStorage = ssAdaptor.Get(item.StudyStorageKey); if (summary.StudyStorage == null) { summary.PatientId = "N/A"; summary.PatientsName = "N/A"; return summary; } StudyAdaptor studyAdaptor = new StudyAdaptor(); StudySelectCriteria studycriteria = new StudySelectCriteria(); studycriteria.StudyInstanceUid.EqualTo(summary.StudyStorage.StudyInstanceUid); studycriteria.ServerPartitionKey.EqualTo(summary.StudyStorage.ServerPartitionKey); Study theStudy = studyAdaptor.GetFirst(studycriteria); if (theStudy == null) { summary.PatientId = "N/A"; summary.PatientsName = "N/A"; } else { summary.PatientId = theStudy.PatientId; summary.PatientsName = theStudy.PatientsName; } return summary; }