Пример #1
0
        void RgtWarning(int d, int p)
        {
            RGTPOSManager       RGTPOSMgr       = new RGTPOSManager();
            AssayRunParaService AssayRunParaSer = new AssayRunParaService();
            RunService          RunSer          = new RunService();
            TroubleLogService   TroubleLogSer   = new TroubleLogService();

            int rgtwarncount  = RunSer.GetRgtWarnCount();
            int rgtleastcount = RunSer.GetRgtLeastCount();

            RGTPosition rgp = RGTPOSMgr.Get(1, p.ToString());

            if (rgp != null)
            {
                AssayRunPara arp = AssayRunParaSer.Get(rgp.Assay) as AssayRunPara;
                int          c   = 0;
                int          v   = rgp.CType.Volume * rgp.ValidPercent / 100 * 1000;
                switch (rgp.AssayPara)
                {
                case "R1":
                    c = arp.R1Vol == 0 ? 0 : v / arp.R1Vol;
                    if (c < rgtleastcount)
                    {
                        if (RunSer.IsMutiRgtEnable() == true)    //多试剂位开关标志
                        {
                            RGTPosition mrgt = RGTPOSMgr.GetEnableMutiRgtPosition(rgp);
                            if (mrgt != null)
                            {
                                RGTPOSMgr.BetweenMutiRgtPositionAndRgtPositionChange(mrgt, rgp);

                                TroubleLog trouble = new TroubleLog();
                                trouble.TroubleCode = @"0000773";
                                trouble.TroubleType = TROUBLETYPE.WARN;
                                trouble.TroubleUnit = @"试剂";
                                trouble.TroubleInfo = string.Format("试剂位{0}项目{1}试剂1由于余量不足开始启用其多试剂位{2}. ", p, rgp.Assay, mrgt.Position);
                                TroubleLogSer.Save(trouble);
                            }
                            else
                            {
                                if (RunSer.IsLockRgtEnable() == true)
                                {
                                    rgp.IsLocked = true;
                                    RGTPOSMgr.UpdateLockState(rgp);

                                    TroubleLog trouble = new TroubleLog();
                                    trouble.TroubleCode = @"0000773";
                                    trouble.TroubleType = TROUBLETYPE.WARN;
                                    trouble.TroubleUnit = @"试剂";
                                    trouble.TroubleInfo = string.Format("试剂位{0}项目{1}试剂1由于余量不足将锁定其对应的工作表. ", p, rgp.Assay);
                                    TroubleLogSer.Save(trouble);
                                }
                                else
                                {
                                    TroubleLog trouble = new TroubleLog();
                                    trouble.TroubleCode = @"0000773";
                                    trouble.TroubleType = TROUBLETYPE.ERR;
                                    trouble.TroubleUnit = @"试剂";
                                    trouble.TroubleInfo = string.Format("试剂位{0}项目{1}试剂1由于余量不足. ", p, rgp.Assay);
                                    TroubleLogSer.Save(trouble);
                                }
                            }
                        }
                        else
                        {
                            if (RunSer.IsLockRgtEnable() == true)
                            {
                                rgp.IsLocked = true;
                                RGTPOSMgr.UpdateLockState(rgp);

                                TroubleLog trouble = new TroubleLog();
                                trouble.TroubleCode = @"0000773";
                                trouble.TroubleType = TROUBLETYPE.WARN;
                                trouble.TroubleUnit = @"试剂";
                                trouble.TroubleInfo = string.Format("试剂位{0}项目{1}试剂1由于余量不足将锁定其对应的工作表. ", p, rgp.Assay);
                                TroubleLogSer.Save(trouble);
                            }
                            else
                            {
                                TroubleLog trouble = new TroubleLog();
                                trouble.TroubleCode = @"0000773";
                                trouble.TroubleType = TROUBLETYPE.ERR;
                                trouble.TroubleUnit = @"试剂";
                                trouble.TroubleInfo = string.Format("试剂位{0}项目{1}试剂1由于余量不足. ", p, rgp.Assay);
                                TroubleLogSer.Save(trouble);
                            }
                        }
                    }

                    if (c < rgtwarncount && c > rgtleastcount)
                    {
                        TroubleLog trouble = new TroubleLog();
                        trouble.TroubleCode = @"0000773";
                        trouble.TroubleType = TROUBLETYPE.WARN;
                        trouble.TroubleUnit = @"设备";
                        trouble.TroubleInfo = string.Format("试剂位{0}项目{1}:试剂1余量即将耗尽. ", p, rgp.Assay);
                        TroubleLogSer.Save(trouble);
                        return;
                    }
                    break;

                case "R2":
                    c = arp.R2Vol == 0 ? 0 : v / arp.R2Vol;
                    if (c < rgtleastcount)
                    {
                        if (RunSer.IsMutiRgtEnable() == true)    //多试剂位开关标志
                        {
                            RGTPosition mrgt = RGTPOSMgr.GetEnableMutiRgtPosition(rgp);
                            if (mrgt != null)
                            {
                                RGTPOSMgr.BetweenMutiRgtPositionAndRgtPositionChange(mrgt, rgp);

                                TroubleLog trouble = new TroubleLog();
                                trouble.TroubleCode = @"0000773";
                                trouble.TroubleType = TROUBLETYPE.WARN;
                                trouble.TroubleUnit = @"试剂";
                                trouble.TroubleInfo = string.Format("试剂位{0}项目{1}试剂2由于余量不足开始启用其多试剂位{2}. ", p, rgp.Assay, mrgt.Position);
                                TroubleLogSer.Save(trouble);
                            }
                            else
                            {
                                if (RunSer.IsLockRgtEnable() == true)
                                {
                                    rgp.IsLocked = true;
                                    RGTPOSMgr.UpdateLockState(rgp);

                                    TroubleLog trouble = new TroubleLog();
                                    trouble.TroubleCode = @"0000773";
                                    trouble.TroubleType = TROUBLETYPE.WARN;
                                    trouble.TroubleUnit = @"试剂";
                                    trouble.TroubleInfo = string.Format("试剂位{0}项目{1}试剂2由于余量不足将锁定其对应的工作表. ", p, rgp.Assay);
                                    TroubleLogSer.Save(trouble);
                                }
                                else
                                {
                                    TroubleLog trouble = new TroubleLog();
                                    trouble.TroubleCode = @"0000773";
                                    trouble.TroubleType = TROUBLETYPE.ERR;
                                    trouble.TroubleUnit = @"试剂";
                                    trouble.TroubleInfo = string.Format("试剂位{0}项目{1}试剂2余量不足. ", p, rgp.Assay);
                                    TroubleLogSer.Save(trouble);
                                }
                            }
                        }
                        else
                        {
                            if (RunSer.IsLockRgtEnable() == true)
                            {
                                rgp.IsLocked = true;
                                RGTPOSMgr.UpdateLockState(rgp);

                                TroubleLog trouble = new TroubleLog();
                                trouble.TroubleCode = @"0000773";
                                trouble.TroubleType = TROUBLETYPE.WARN;
                                trouble.TroubleUnit = @"试剂";
                                trouble.TroubleInfo = string.Format("试剂位{0}项目{1}试剂2余量不足将锁定其对应的工作表. ", p, rgp.Assay);
                                TroubleLogSer.Save(trouble);
                            }
                            else
                            {
                                TroubleLog trouble = new TroubleLog();
                                trouble.TroubleCode = @"0000773";
                                trouble.TroubleType = TROUBLETYPE.ERR;
                                trouble.TroubleUnit = @"试剂";
                                trouble.TroubleInfo = string.Format("试剂位{0}项目{1}试剂2余量不足. ", p, rgp.Assay);
                                TroubleLogSer.Save(trouble);
                            }
                        }
                    }
                    if (c < rgtwarncount && c > rgtleastcount)
                    {
                        TroubleLog trouble = new TroubleLog();
                        trouble.TroubleCode = @"0000775";
                        trouble.TroubleType = TROUBLETYPE.WARN;
                        trouble.TroubleUnit = @"设备";
                        trouble.TroubleInfo = string.Format("试剂位{0}项目{1}:试剂2余量即将耗尽. ", p, rgp.Assay);
                        TroubleLogSer.Save(trouble);
                        return;
                    }
                    break;
                }
            }
        }
Пример #2
0
        RGTPosition AnanlyeBarcode(string barcode, string b1)
        {
            string      code        = barcode.Substring(0, 3);
            ReagentItem reagentItem = new ReagentItemService().GetReagentItem(code);

            if (reagentItem == null)
            {
                TroubleLog t = new TroubleLog();
                t.TroubleCode = "7777772";
                t.TroubleType = TROUBLETYPE.ERR;
                t.TroubleUnit = @"试剂条码";
                t.TroubleInfo = "条码:" + b1 + "与封闭项目不匹配";
                new TroubleLogService().Save(t);

                return(null);
            }

            RGTPosition reagentPosition = new RGTPosition();

            reagentPosition.Assay = reagentItem.ItemName;
            //1:S10ml  2:M 20ml  3:L 70ml  4:XL100m
            RGTContainerType RGTContainerType = null;
            string           containertype    = barcode.Substring(3, 1);

            switch (containertype)
            {
            case "1":
                RGTContainerType = this.GetRGTContainerType(20);
                break;

            case "2":
                RGTContainerType = this.GetRGTContainerType(40);
                break;

            case "3":
                RGTContainerType = this.GetRGTContainerType(70);
                break;

            case "4":
                RGTContainerType = this.GetRGTContainerType(100);
                break;
            }
            if (RGTContainerType == null)
            {
                TroubleLog t = new TroubleLog();
                t.TroubleCode = "7777773";
                t.TroubleType = TROUBLETYPE.ERR;
                t.TroubleUnit = @"试剂条码";
                t.TroubleInfo = "条码:" + b1 + "容器类型系统不识别";
                new TroubleLogService().Save(t);

                return(null);
            }
            else
            {
                reagentPosition.CType.Name = RGTContainerType.Name;
            }

            //1:R1 2:R2 3:R3 4:R4  5:稀释液 6:清洗剂
            string reagenttype = barcode.Substring(4, 1);

            switch (reagenttype)
            {
            case "1": reagentPosition.AssayPara = "R1"; break;

            case "2": reagentPosition.AssayPara = "R2"; break;

            case "3": reagentPosition.AssayPara = "R3"; break;

            case "4": reagentPosition.AssayPara = "R4"; break;

            case "5": reagentPosition.AssayPara = "Diluent"; break;
                //case "6": ReagentPosition.AssayPara = "R4"; break;
            }
            switch (this.Disk)
            {
            case 1:
                if (reagentPosition.AssayPara == "R1" || reagentPosition.AssayPara == "Diluent")
                {
                }
                else
                {
                    TroubleLog t = new TroubleLog();
                    t.TroubleCode = "7777774";
                    t.TroubleType = TROUBLETYPE.ERR;
                    t.TroubleUnit = @"试剂条码";
                    t.TroubleInfo = "条码:" + b1 + "试剂类型R1识别失败";
                    new TroubleLogService().Save(t);

                    return(null);
                }
                break;

            case 2:
                if (reagentPosition.AssayPara == "R2")
                {
                }
                else
                {
                    TroubleLog t = new TroubleLog();
                    t.TroubleCode = "7777775";
                    t.TroubleType = TROUBLETYPE.ERR;
                    t.TroubleUnit = @"试剂条码";
                    t.TroubleInfo = "条码:" + b1 + "试剂类型R2识别失败";
                    new TroubleLogService().Save(t);

                    return(null);
                }
                break;
            }

            string batchnum = barcode.Substring(5, 6);


            reagentPosition.RGTProductor.FactoryName = "上海华臣生物试剂有限公司";
            reagentPosition.RGTProductor.BatchNO     = batchnum;

            string str1    = batchnum.Substring(0, 2);
            int    str1int = 0;

            try
            {
                str1int = int.Parse(str1);
            }
            catch
            {
                return(null);
            }
            str1 = "20" + (str1int + 1).ToString() + batchnum.Substring(2);

            try
            {
                reagentPosition.RGTProductor.ExpireDay = DateTime.ParseExact(str1, "yyyyMMdd", System.Globalization.CultureInfo.CurrentCulture);
            }
            catch
            {
                TroubleLog t = new TroubleLog();
                t.TroubleCode = "7777776";
                t.TroubleType = TROUBLETYPE.ERR;
                t.TroubleUnit = @"试剂条码";
                t.TroubleInfo = "条码:" + b1 + "识别失败";
                new TroubleLogService().Save(t);

                return(null);
            }

            reagentPosition.BarCode = b1;

            DoSaveAssayRunPara(reagentItem);
            DoSaveAssayValuePara(reagentItem);
            DoSaveResultSets(reagentItem);
            //测试序列
            DoSaveRunSQ(reagentItem);

            return(reagentPosition);
        }
Пример #3
0
        void RgtWarning(int d, int p)
        {
            RGTPOSManager     RGTPOSMgr     = new RGTPOSManager();
            RunService        RunSer        = new RunService();
            TroubleLogService TroubleLogSer = new TroubleLogService();

            int rgtwarncount  = RunSer.GetRgtWarnCount();
            int rgtleastcount = RunSer.GetRgtLeastCount();

            RGTPosition rgp = RGTPOSMgr.Get(1, p.ToString());

            if (rgp != null)
            {
                int c = 0;
                int v = rgp.CType.Volume * rgp.ValidPercent / 100 * 1000;
                switch (rgp.AssayPara)
                {
                case "R1":
                    c = v / 250;
                    if (c < rgtleastcount)
                    {
                        TroubleLog trouble = new TroubleLog();
                        trouble.TroubleCode = @"0000772";
                        trouble.TroubleType = TROUBLETYPE.ERR;
                        trouble.TroubleUnit = @"设备";
                        trouble.TroubleInfo = string.Format("试剂位{0}清洗剂耗尽. ", p);
                        TroubleLogSer.Save(trouble);

                        return;
                    }
                    if (c < rgtwarncount)
                    {
                        TroubleLog trouble = new TroubleLog();
                        trouble.TroubleCode = @"0000773";
                        trouble.TroubleType = TROUBLETYPE.WARN;
                        trouble.TroubleUnit = @"设备";
                        trouble.TroubleInfo = string.Format("试剂位{0}清洗剂即将耗尽. ", p);
                        TroubleLogSer.Save(trouble);
                        return;
                    }
                    break;

                case "R2":
                    c = v / 150;
                    if (c < rgtleastcount)
                    {
                        TroubleLog trouble = new TroubleLog();
                        trouble.TroubleCode = @"0000774";
                        trouble.TroubleType = TROUBLETYPE.ERR;
                        trouble.TroubleUnit = @"设备";
                        trouble.TroubleInfo = string.Format("试剂位{0}清洗剂耗尽. ", p);
                        TroubleLogSer.Save(trouble);

                        return;
                    }
                    if (c < rgtwarncount)
                    {
                        TroubleLog trouble = new TroubleLog();
                        trouble.TroubleCode = @"0000775";
                        trouble.TroubleType = TROUBLETYPE.WARN;
                        trouble.TroubleUnit = @"设备";
                        trouble.TroubleInfo = string.Format("试剂位{0}清洗剂即将耗尽. ", p);
                        TroubleLogSer.Save(trouble);
                        return;
                    }
                    break;
                }
            }
        }
Пример #4
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);
        }