Esempio n. 1
0
        internal AggRamDbState GetSampleInfoByCrvSeqNum(int crvSeqNum)
        {
            var condition =
            new ParadoxCondition.LogicalAnd(
                new ParadoxCondition.Compare(
                    ParadoxCompareOperator.Greater, 0, 0, 0),
                new ParadoxCondition.Compare(
                    ParadoxCompareOperator.Equal, crvSeqNum, 3, 0));
            var sr = _Connection.ExecuteQuery("HRRuns", condition, false);
            if (sr.Read())
            {
                AggRamDbState result = new AggRamDbState();
                // 基本信息
                result.WrkLstNum = (int)sr["WrkLstNum"];
                result.ChnlNum = (short)((short)sr["ChnlNum"] + 1);
                result.CrvSeqNum = (int)sr["CrvSeqNum"];
                result.StartTime = ((DateTime)sr["StartTime"]).ToString("yyyy/MM/dd HH:mm:ss");

                // 创建曲线点信息
                int lblChnNum = (short)sr["ChnlNum"] + 1;
                string label = "Channel " + lblChnNum.ToString();
                AggRamCurve crv = new AggRamCurve(
                    label,
                    (int)sr["InitialMax"], (int)sr["InitialMin"],
                    (int)sr["ScaleSet1Rd"], (int)sr["MaxPCPoint"], (double)sr["ScaleSetResult"],
                    (int)sr["DataPoints"], (byte[])sr["Data"]);
                Curve c = new Curve();
                c.Label = crv.Label;
                c.InitialMin = (int)sr["InitialMin"];
                c.InitialMax = (int)sr["InitialMax"];
                c.ZeroODPoint = crv.ZeroODPoint;
                c.MaxPCPoint = crv.MaxPCPoint;
                c.PointUnit = crv.PointUnit;
                c.CurvePoints = crv.CurvePoints;
                c.Count = crv.Count;
                result.Curve = c;
                // Add Report Row
                ReportInfo reportRow = new ReportInfo();
                reportRow.ChnlNum = lblChnNum;
                reportRow.StartTime = (DateTime)sr["StartTime"];

                int selectedProcTag = (int)sr["ProcTag"];
                var procInfo = GetTestParams(selectedProcTag);
                if (procInfo != null)
                {
                    reportRow.ProcID = procInfo.ProcID;
                    reportRow.Abbrev = procInfo.Abbrev;
                }
                reportRow.Unit = (string)sr["Unit"];
                reportRow.Conc = (double)sr["Conc"];
                reportRow.PRP = FloatPS(crv.PRP, 3);
                reportRow.PPP = FloatPS(crv.PPP, 3);
                reportRow.MaxPercent = FloatPS(crv.MaxPercent * 100, 1);
                reportRow.MaxPCTime = FloatPS((int)sr["MaxPCTime"] / 1000.0, 0);
                reportRow.LagTime = FloatPS((int)sr["LagTime"] / 1000.0, 1);
                reportRow.Slope = FloatPS((double)sr["Slope"], 1);
                result.Report = reportRow;

                string selectedPrimID = (string)sr["PrimID"];

                result.Patient = GetPatientInfo(selectedPrimID);
                return result;
            }
            return null;
        }