public RetrospectiveReviewReport(DateTime actionDate) { this.m_ReportNoCollection = new List <string>(); this.m_WordList = this.GetWordList(); DateTime finalDate = actionDate.AddDays(-1); if (actionDate.DayOfWeek == DayOfWeek.Monday) { finalDate = finalDate.AddDays(-3); } Business.ReportNoCollection finalCases = YellowstonePathology.Business.Gateway.AccessionOrderGateway.GetSurgicalFinal(finalDate); int count = finalCases.Count; double tenPercentOfCount = Math.Round((count * .1), 0); Random rnd = new Random(); int i = 0; while (true) { int nextRnd = rnd.Next(0, count - 1); string nextMasterAccessionNo = finalCases[nextRnd].MasterAccessionNo; Business.Persistence.AODocumentBuilder documentBuilder = new Persistence.AODocumentBuilder(nextMasterAccessionNo, false); Business.Test.AccessionOrder ao = (Business.Test.AccessionOrder)documentBuilder.BuildNew(); if (DoWordsExist(ao) == true) { this.m_ReportNoCollection.Add(finalCases[nextRnd].Value); } i += 1; if (i == 10) { break; } } InitializeComponent(); this.DataContext = this; }
private void FindY() { YellowstonePathology.Business.ReportNoCollection reportNoCollection = YellowstonePathology.Business.Gateway.AccessionOrderGateway.GetReportNumbers(); YellowstonePathology.Business.ReportNoCollection fix = new Business.ReportNoCollection(); foreach (YellowstonePathology.Business.ReportNo reportNo in reportNoCollection) { YellowstonePathology.Business.OrderIdParser orderIdParser = new Business.OrderIdParser(reportNo.Value); string path = YellowstonePathology.Document.CaseDocumentPath.GetPath(orderIdParser); string[] files = System.IO.Directory.GetFiles(path); foreach (string file in files) { if(file.Contains(".Y.") == true) { //System.IO.File.Delete(file); if (fix.Exists(reportNo.Value) == false) { fix.Add(reportNo); } } } } /* foreach (YellowstonePathology.Business.ReportNo reportNo in fix) { YellowstonePathology.Business.Interface.ICaseDocument caseDocument = YellowstonePathology.Business.Document.DocumentFactory.GetDocument(116); YellowstonePathology.Domain.OrderIdParser orderIdParser = new Domain.OrderIdParser(reportNo.Value); YellowstonePathology.Business.Rules.MethodResult methodResult = caseDocument.DeleteCaseFiles(orderIdParser); if (methodResult.Success == true) { caseDocument.Render(orderIdParser.MasterAccessionNo, reportNo.Value, YellowstonePathology.Business.Document.ReportSaveModeEnum.Normal); caseDocument.Publish(); } else { Console.WriteLine(methodResult.Message); } } */ }