Пример #1
0
 protected void GenderPDF(LabReport report)
 {
     DataSet ds = DataStruct.GetSet();
     int sectionNo = report.Info.SectionNo;
     bool hasImage = (report.ImageList.Count > 0);
     //数据填充
     this.FillReport(report, ds);
     //获取模板
     string model = GetModelPath(sectionNo, report.ItemList.Count, hasImage, report.SuperList);
     //string model = "D:\\Project\\VS2013\\Repos\\XYS\\XYS.FR\\Print\\Lab\\mianyi-adaption.frx";
     //生成pdf,获取pdf路径
     string filePath = this.GenderPDF(model, ds);
     //获取排序号
     int orderNo = GetOrderNo(sectionNo, report.SuperList);
     //保存生成记录
     this.DAL.SaveRecord(report.Info, orderNo, filePath);
     //触发生成pdf成功事件
     this.OnSuccess(report);
 }
Пример #2
0
 //将内部数据转换成通讯数据
 private void ItemConvert(LabReport lr, List<IFillElement> ItemList)
 {
     bool cb = false;
     ItemElement item = null;
     CustomElement custom = new CustomElement();
     foreach (IFillElement element in ItemList)
     {
         item = element as ItemElement;
         if (item != null)
         {
             if (!lr.SuperList.Contains(item.SuperNo))
             {
                 lr.SuperList.Add(item.SuperNo);
             }
             if (this.ConvertCustom(item, custom))
             {
                 cb = true;
                 continue;
             }
             if (this.IsItemLegal(item))
             {
                 lr.ItemList.Add(item);
             }
         }
     }
     if (cb)
     {
         lr.CustomList.Add(custom);
     }
 }
Пример #3
0
 public void HandleReport(LabReport report)
 {
     this.RequestQueue.Add(report);
 }
Пример #4
0
        private void SaveReport(LabReport lr)
        {
            MReport mr = new MReport();
            this.ConvertReport(lr, mr);

            //
            this.MongoService.UpdateAndInsertReport(mr);
        }
Пример #5
0
 private bool InnerHandleItem(LabReport report, LabPK RK)
 {
     bool result = false;
     List<IFillElement> ls = new List<IFillElement>(32);
     LOG.Info("报告明细项处理");
     result = this.ItemHandler.HandleElement(ls, RK, typeof(ItemElement));
     if (result)
     {
         this.ItemConvert(report, ls);
         report.ItemList.Sort();
     }
     return result;
 }
Пример #6
0
 private void FillReport(LabReport report, DataSet ds)
 {
     //上传info
     FRInfo header = new FRInfo();
     this.FillInfo(report.Info, header);
     this.Export.ExportElement(header, ds);
     //
     int sectionNo = report.Info.SectionNo;
     List<IExportElement> ls = new List<IExportElement>(30);
     switch (sectionNo)
     {
         case 39:
             this.FillGSCustoms(report.CustomList, ls);
             break;
         default:
             this.FillItems(report.ItemList, ls);
             this.FillImage(report.ImageList, ls);
             this.FillCustoms(report.CustomList, ls);
             break;
     }
     this.Export.ExportElement(ls, ds);
 }
Пример #7
0
 private void SaveMongo(LabReport report)
 {
     byte[] re = TransHelper.SerializeObject(report);
     //this.MongoClient.SaveToMongo(re);
 }
Пример #8
0
 //内部操作,处理成功后触发成功事件,失败后触发失败事件
 private void InnerHandle(LabPK RK)
 {
     LabReport report = new LabReport();
     bool result = this.InnerHandle(report, RK);
     if (result)
     {
         //后续处理
         LOG.Info("报告后续处理");
         this.HandleAfter(report, RK);
         LOG.Info("触发处理完成事件");
         this.OnSuccess(report);
     }
     else
     {
         LOG.Info("触发处理失败事件");
         this.OnError(report);
     }
 }
Пример #9
0
 //数据填充、清洗、转换等操作
 private bool InnerHandle(LabReport report, LabPK RK)
 {
     bool result = false;
     //处理info
     result = this.InfoHandler.HandleElement(report.Info, RK);
     switch (RK.SectionNo)
     {
         //无图无特殊内容
         case 2:
         case 27:
         case 62:
         case 17:
         case 23:
         case 29:
         case 34:
         case 5:
         case 19:
         case 20:
         case 21:
         case 25:
         case 30:
         case 33:
         case 63:
         case 14:
         case 4:
         case 24:
         case 18:
             LOG.Info("通用无图类型报告处理");
             result = this.InnerHandleItem(report, RK);
             break;
         //基因配型
         case 45:
             LOG.Info("基因配型报告处理");
             result = this.InnerHandleGene(report, RK);
             break;
         case 39:
             LOG.Info("骨髓报告处理");
             result = this.InnerHandleGS(report, RK);
             break;
         //默认
         default:
             LOG.Info("通用有图类型报告处理(默认处理方式)");
             result = this.InnerHandleItem(report, RK);
             result = this.InnerHandleImage(report, RK);
             break;
     }
     return result;
 }
Пример #10
0
 private void HandleAfterImage(LabReport report, string id)
 {
     if (report.Info.SectionNo == 11)
     {
         if (report.SuperList.Count > 0)
         {
             ImageElement normal = this.GetNormalImage(report.SuperList[0], id);
             if (normal != null)
             {
                 report.ImageList.Add(normal);
             }
         }
     }
 }
Пример #11
0
 private void ImageConvert(LabReport lr, List<IFillElement> ImageList)
 {
     ImageElement image = null;
     foreach (IFillElement element in ImageList)
     {
         image = element as ImageElement;
         if (image != null)
         {
             lr.ImageList.Add(image);
         }
     }
 }
Пример #12
0
 //11小组添加标准图片(通讯数据整体处理)
 private void HandleAfter(LabReport report, IReportKey RK)
 {
     this.HandleAfterImage(report, RK.ID);
 }
Пример #13
0
 protected void OnSuccess(LabReport report)
 {
     HandleSuccessHandler handler = this.m_handleCompleteEvent;
     if (handler != null)
     {
         handler(report);
     }
 }
Пример #14
0
 public void Save2Mongo(LabReport report)
 {
     this.RequestQueue.Add(report);
 }
Пример #15
0
 protected void OnError(LabReport report)
 {
     GenderErrorHandler handler = this.m_genderErrorEvent;
     if (handler != null)
     {
         handler(report);
     }
 }
Пример #16
0
 private bool InnerHandleGene(LabReport report, LabPK RK)
 {
     bool result = false;
     GeneCustom ci = null;
     CustomElement custom = null;
     List<IFillElement> items = null;
     List<LabPK> PKList = new List<LabPK>(3);
     this.PKDAL.InitKey(RK, PKList);
     foreach (LabPK key in PKList)
     {
         ci = new GeneCustom();
         custom = new CustomElement();
         result = this.GeneCustomHandler.HandleElement(ci, key);
         if (result)
         {
             this.GeneConvert(custom, ci);
             items = new List<IFillElement>(5);
             result = this.ItemHandler.HandleElement(items, key, typeof(ItemElement));
             if (result)
             {
                 this.GeneConvert(custom, report.SuperList, items);
             }
         }
         else
         {
             break;
         }
         report.CustomList.Add(custom);
     }
     return result;
 }
Пример #17
0
 protected void OnSuccess(LabReport report)
 {
     GenderSuccessHandler handler = this.m_genderSuccessEvent;
     if (handler != null)
     {
         handler(report);
     }
 }
Пример #18
0
 private bool InnerHandleGS(LabReport report, LabPK RK)
 {
     bool result = false;
     List<IFillElement> ls = new List<IFillElement>(50);
     result = this.GSItemHandler.HandleElement(ls, RK, typeof(GSItem));
     if (result)
     {
         this.GSItemConvert(ls, report.CustomList);
         ls.Clear();
         result = this.GeneCustomHandler.HandleElement(ls, RK, typeof(GSCustom));
         if (result)
         {
             this.GSCustomConvert(report.Info, report.ImageList, ls);
         }
     }
     return result;
 }
Пример #19
0
        private void PrintAndSave(LabReport report)
        {
            LOG.Info("获取报告成功,报告ID为:" + report.Info.ReportID + ",将报告发送到打印服务");
            byte[] re = TransHelper.SerializeObject(report);
            this.FRClient.PrintPDF(re);

            LOG.Info("获取报告成功,报告ID为:" + report.Info.ReportID + ",将报告发送到保存服务");
            this.MongoClient.SaveToMongo(re);
        }
Пример #20
0
 private bool InnerHandleImage(LabReport report, LabPK RK)
 {
     bool result = false;
     List<IFillElement> ls = new List<IFillElement>(6);
     //处理image
     result = this.ImageHandler.HandleElement(ls, RK, typeof(ImageElement));
     if (result)
     {
         this.ImageConvert(report, ls);
     }
     return result;
 }
Пример #21
0
 private void PrintPDF(LabReport report)
 {
     byte[] re = TransHelper.SerializeObject(report);
     //this.PDFClient.PrintPDF(re);
 }
Пример #22
0
 private void ConvertReport(LabReport lr, MReport mr)
 {
     mr.ReportID = lr.Info.ReportID;
     mr.ActiveFlag = 1;
     this.ConvertInfo(lr.Info, mr.Info);
     this.ConvertItems(lr.ItemList, mr.ItemCollection);
     this.ConvertCustoms(lr.CustomList, mr.CustomCollection);
     this.ConvertImages(lr.ImageList, mr.ImageMap);
 }