Пример #1
0
        public RegentConstRecordInfo GetRegentConstRecordInfo(ReagentItem item, DateTime begin, DateTime end)
        {
            RegentConstRecordInfo inf = new RegentConstRecordInfo();

            inf.Name = item.ItemName;

            List <ReagentBarcode> bars = new ReagentBarcodeService().GetReagentBarcodes(begin, end);

            foreach (ReagentBarcode e in bars)
            {
                /*
                 * if (e.ValidPercent != 99)
                 * {
                 *  continue;
                 * }
                 */
                string b = Decode(e.Barcode);
                if (b == null)
                {
                    continue;
                }

                string code = b.Substring(0, 3);
                if (code != item.Code.ToString())
                {
                    continue;
                }

                BarDrawInfo barDrawInfo = new BarDrawInfo();
                barDrawInfo.Bar      = e.Barcode;
                barDrawInfo.Datetime = e.ExchangeDatetime;
                string reagenttype = b.Substring(4, 1);
                switch (reagenttype)
                {
                case "1":
                    inf.R1BarDrawInfos.Add(barDrawInfo);
                    break;

                case "2":
                    inf.R2BarDrawInfos.Add(barDrawInfo);
                    break;

                case "3": break;

                case "4": break;

                case "5": break;
                    //case "6": ReagentPosition.AssayPara = "R4"; break;
                }
            }

            return(inf);
        }
Пример #2
0
        public RegentConstInfo GetR1R2ConstCount(ReagentItem item, DateTime begin, DateTime end)
        {
            RegentConstInfo inf = new RegentConstInfo();

            inf.Name    = item.ItemName;
            inf.R1Count = 0;
            inf.R2Count = 0;
            List <string> bars = new ReagentBarcodeService().GetAllBarString(begin, end);

            foreach (string e in bars)
            {
                string b = Decode(e);
                if (b == null)
                {
                    continue;
                }

                string code = b.Substring(0, 3);
                if (code != item.Code.ToString())
                {
                    continue;
                }

                string reagenttype = b.Substring(4, 1);
                switch (reagenttype)
                {
                case "1": inf.R1Count++; break;

                case "2": inf.R2Count++; break;

                case "3": break;

                case "4": break;

                case "5": break;
                    //case "6": ReagentPosition.AssayPara = "R4"; break;
                }
            }

            return(inf);
        }
Пример #3
0
        public object Process(string barcode, int disk, string position)
        {
            string b = Decode(barcode);

            if (b == null)
            {
                string erinfo = "条码:" + barcode + "解码失败";

                TroubleLog t = new TroubleLog();
                t.TroubleCode = "7777771";
                t.TroubleType = TROUBLETYPE.ERR;
                t.TroubleUnit = @"试剂条码";
                t.TroubleInfo = erinfo;
                new TroubleLogService().Save(t);

                return("条码:" + barcode + "不识别");
            }

            this.Disk     = disk;
            this.Position = position;
            RGTPosition newreagentPosition = AnanlyeBarcode(b, barcode);

            if (newreagentPosition == null)
            {
                return("条码:" + barcode + "不识别");
            }

            AssayRunPara a = new AssayRunParaService().Get(newreagentPosition.Assay) as AssayRunPara;

            if (a != null)
            {
                if (a.R2Vol == 0 && newreagentPosition.AssayPara == "R2")
                {
                    string erinfo = "条码:" + barcode + "不能装填。原因:参数试剂2体积为0,不能在该位置装填试剂2";

                    TroubleLog t = new TroubleLog();
                    t.TroubleCode = "7777771";
                    t.TroubleType = TROUBLETYPE.ERR;
                    t.TroubleUnit = @"试剂条码";
                    t.TroubleInfo = erinfo;
                    new TroubleLogService().Save(t);

                    return("条码:" + barcode + "装填失败");
                }
            }
            //检查该条码在试剂盘中是否存在
            RGTPosition barrgtpos = new RGTPOSManager().GetAssayALLReagentByBarcode(newreagentPosition.BarCode);

            if (barrgtpos == null)
            {
                //newreagentPosition.AssayPara = "MR1";
            }
            else
            {
                ReagentBarcode r = new ReagentBarcode();
                r.Barcode          = barrgtpos.BarCode;
                r.ValidPercent     = barrgtpos.ValidPercent;
                r.ExchangeDatetime = DateTime.Now;
                new ReagentBarcodeService().InsertReagentBarcode(r);
                new RGTPOSManager().Delete(barrgtpos);

                //newreagentPosition.AssayPara = barrgtpos.AssayPara;
            }
            RGTPosition rgtpos = new RGTPOSManager().Get(disk, position);

            if (rgtpos == null)
            {
            }
            else
            {
                ReagentBarcode r = new ReagentBarcode();
                r.Barcode          = rgtpos.BarCode;
                r.ValidPercent     = rgtpos.ValidPercent;
                r.ExchangeDatetime = DateTime.Now;
                new ReagentBarcodeService().InsertReagentBarcode(r);
                new RGTPOSManager().Delete(rgtpos);
            }

            List <CLItem> reagents = new RGTPOSManager().GetAssayALLReagent(newreagentPosition.Assay);

            if (newreagentPosition.AssayPara == "R1")
            {
                bool f1 = false;
                foreach (RGTPosition e in reagents)
                {
                    if (e.AssayPara == "R1")
                    {
                        f1 = true;
                        break;
                    }
                }
                if (f1 == true)
                {
                    newreagentPosition.AssayPara = "MR1";
                }
                else
                {
                    newreagentPosition.AssayPara = "R1";
                }
            }
            if (newreagentPosition.AssayPara == "R2")
            {
                bool f1 = false;
                foreach (RGTPosition e in reagents)
                {
                    if (e.AssayPara == "R2")
                    {
                        f1 = true;
                        break;
                    }
                }
                if (f1 == true)
                {
                    newreagentPosition.AssayPara = "MR2";
                }
                else
                {
                    newreagentPosition.AssayPara = "R2";
                }
            }

            newreagentPosition.Disk     = disk;
            newreagentPosition.Position = position;

            RGTPosition oldreagentPosition = new RGTPOSManager().Get(disk, position);

            if (oldreagentPosition != null)
            {
                ReagentBarcode r = new ReagentBarcode();
                r.Barcode          = oldreagentPosition.BarCode;
                r.ValidPercent     = oldreagentPosition.ValidPercent;
                r.ExchangeDatetime = DateTime.Now;
                new ReagentBarcodeService().InsertReagentBarcode(r);
            }

            ReagentBarcode ReagentBarcode = new ReagentBarcodeService().GetLastestReagentBarcode(barcode);

            if (ReagentBarcode == null)
            {
                newreagentPosition.ValidPercent = 99;
            }
            else
            {
                newreagentPosition.ValidPercent = ReagentBarcode.ValidPercent;
            }

            new RGTPOSManager().Delete(newreagentPosition);
            new RGTPOSManager().Save(newreagentPosition);

            TroubleLog t1 = new TroubleLog();

            t1.TroubleCode = "7777772";
            t1.TroubleType = TROUBLETYPE.WARN;
            t1.TroubleUnit = @"试剂条码";
            t1.TroubleInfo = "条码:" + barcode + "加载成功";;
            new TroubleLogService().Save(t1);

            return(null);
        }