public static ReconcileHistoryRecord ReadReconcileRecord(StudyHistory historyRecord) { Platform.CheckTrue(historyRecord.StudyHistoryTypeEnum == StudyHistoryTypeEnum.StudyReconciled, "History record has invalid history record type"); ReconcileHistoryRecord record = new ReconcileHistoryRecord(); record.InsertTime = historyRecord.InsertTime; record.StudyStorageLocation = StudyStorageLocation.FindStorageLocations(StudyStorage.Load(historyRecord.StudyStorageKey))[0]; StudyReconcileDescriptorParser parser = new StudyReconcileDescriptorParser(); record.UpdateDescription = parser.Parse(historyRecord.ChangeDescription); return(record); }
private AutoReconcilerResult ApplyHistories(DicomFile file, IList <StudyHistory> histories) { Platform.CheckForNullReference(file, "file"); Platform.CheckForNullReference(histories, "histories"); AutoReconcilerResult preProcessingResult = null; StudyHistory lastHistory = histories[0]; StudyReconcileDescriptorParser parser = new StudyReconcileDescriptorParser(); StudyReconcileDescriptor changeLog = parser.Parse(lastHistory.ChangeDescription); switch (changeLog.Action) { case StudyReconcileAction.CreateNewStudy: case StudyReconcileAction.Merge: if (lastHistory.DestStudyStorageKey != null) { preProcessingResult = MergeImage(changeLog.Action, file, lastHistory); } break; case StudyReconcileAction.Discard: preProcessingResult = new AutoReconcilerResult(StudyReconcileAction.Discard) { DiscardImage = true }; break; case StudyReconcileAction.ProcessAsIs: if (lastHistory.DestStudyStorageKey != null) { preProcessingResult = ProcessImageAsIs(file, lastHistory); } break; default: throw new NotImplementedException(); } return(preProcessingResult); }