Exemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                var db  = ContextPool.GetContext();
                var blh = Request["blh"];
                Jcxx = db.T_JCXX.SingleOrDefault(o => o.F_BLH == blh);
                if (Jcxx == null)
                {
                    Response.Redirect("NotDataFound.aspx");
                }

                double referenceValue = 0;
                var    seriesName     = "";
                var    seriesName2    = "";
                if (Jcxx.F_BLK == "EBV")
                {
                    seriesName  = "结果值(copy/mL)";
                    seriesName2 = "参考值(copy/mL)";
                }
                else if (Jcxx.F_BLK == "HBV")
                {
                    seriesName  = "结果值(IU/mL)";
                    seriesName2 = "参考值(IU/mL)";
                }
                WebChartControl1.Series[0].Name = seriesName;
                WebChartControl1.Series[1].Name = seriesName2;
            }
        }
Exemplo n.º 2
0
        private void btnConfirm_Click(object sender, EventArgs e)
        {
            var uid = txtUid.Text.Trim();
            var pwd = txtPwd.Text.Trim();

            if (string.IsNullOrEmpty(uid))
            {
                XtraMessageBox.Show("登录名不能为空!");
                return;
            }
            if (string.IsNullOrEmpty(pwd))
            {
                XtraMessageBox.Show("密码不能为空!");
                return;
            }

            //query from db
            var db = ContextPool.GetContext();
            var yh = db.T_YH.SingleOrDefault(o => o.F_YHBH == uid && o.F_YHMM == pwd);

            if (yh == null)
            {
                XtraMessageBox.Show("用户命或密码不正确!");
                return;
            }

            //success
            DialogResult    = DialogResult.Yes;
            _authorizedUser = yh;
            Close();
        }
Exemplo n.º 3
0
        static void Main(string[] args)
        {
            #region MyRegion

//            Application.EnableVisualStyles();
//            Application.SetCompatibleTextRenderingDefault(false);
//            Application.Run(new Form1());

            #endregion

            string yhm;

            //获取要启动的exe文件名
            string exeName    = "pathnetrpt";
            var    sourceName = AppDomain.CurrentDomain.FriendlyName.ToUpper().Replace(".EXE", "");
            if (sourceName.Split('_').Length > 1)
            {
                exeName = sourceName.Split('_')[1];
            }


            //验证病理exe是否存在
            if (File.Exists(AppDomain.CurrentDomain.BaseDirectory + $"\\{exeName}.exe") == false)
            {
                MessageBox.Show("未找到朗珈病理系统启动程序,请将单点登录程序放在朗珈主程序文件夹中.");
                Application.Exit();
            }

            //验证入参
            if (args.Length == 0)
            {
                MessageBox.Show("无法启动:没有传入用户登录信息.");
                Application.Exit();
            }
            if (args[0].Split('|').Length != 2)
            {
                MessageBox.Show("无法启动:用户登录参数的数量不正确.");
                Application.Exit();
            }

            //解密用户名
            var userInfo = args[0].Split('|');
            yhm = AESDecrypt(userInfo[0], userInfo[1]);

            //查询对应的用户
            db = ContextPool.GetContext();
            var yh = db.T_YH.SingleOrDefault(o => o.F_YHM == yhm);

            //如果用户不存在,新建用户并弹出提示
            if (yh == null)
            {
                yh = CreateYh(yhm);
                MessageBox.Show("您没有朗珈病理系统登录权限,已为您自动新建朗珈用户,请联系朗珈病理系统管理员为您修改权限和密码.");
            }

            //调用PathQc
            Process.Start(exeName + ".exe", yh.F_YHM + "," + yh.F_YHMM);
        }
Exemplo n.º 4
0
        public void EfTest()
        {
            PathnetEntities db  = ContextPool.GetContext();
            var             lst = (from o in db.T_JCXX
                                   orderby o.F_BLH
                                   select o).Skip(10).Take(5).ToList();

            Assert.AreEqual(lst.Count, 5);
        }
Exemplo n.º 5
0
        private void Main_Load(object sender, EventArgs e)
        {
            _context = ContextPool.GetContext();
            var filterStr = txtFilter.Text.Trim();

            var query = (from o in _context.T_LGI_WJZ
                         join j in _context.T_JCXX on o.F_BLH equals j.F_BLH
                         where o.F_SBSJ >= dteSbsj1.DateTime && o.F_SBSJ <= dteSbsj2.DateTime
                         select new { Wjz = o, Jcxx = j });

            var lstWjz = new List <T_LGI_WJZ>();

            foreach (var x1 in query)
            {
                x1.Wjz.Jcxx = x1.Jcxx;
                lstWjz.Add(x1.Wjz);
            }

            tLGIWJZBindingSource.DataSource = lstWjz;
            gridView1.RefreshData();
        }
Exemplo n.º 6
0
        public static void ReportCrisis(string blh, string crisis)
        {
            string inXml     = "";
            var    dbContext = ContextPool.GetContext();
            var    jcxx      = dbContext.T_JCXX.SingleOrDefault(o => o.F_BLH == blh);

            if (jcxx == null)
            {
                throw new Exception($"病理号[{blh}]不存在");
            }

            inXml = $@"
                    <REQUEST>
                        <CRITICALVALUES_TYPE></CRITICALVALUES_TYPE>
                        <PARITEMNAME>{jcxx.F_YZXM}</PARITEMNAME>
                        <REPORT_DATE_TIME>{jcxx.F_SPARE5}</REPORT_DATE_TIME>
                        <SPECIMEN_NO></SPECIMEN_NO>
                        <PATIENT_ID>{jcxx.F_BRBH}</PATIENT_ID>
                        <REMARK>{crisis}</REMARK>
                        <CRITICALVALUES_NO>{jcxx.F_BLH}</CRITICALVALUES_NO>
                    </REQUEST>
                    ";

            try
            {
                CRITICALVALUESBSSoapClient cs = new CRITICALVALUESBSSoapClient();
                var rtnByte = cs.JHEmrSynchroExeJhCriticalValues(inXml);
                var rtn     = Encoding.Default.GetString(rtnByte);
                if (rtn.Contains("失败"))
                {
                    throw new Exception("服务端返回错误:" + rtn);
                }
            }
            catch (Exception e)
            {
                Logger.Error($"[{blh}]危急值上传失败\r\n" + e);
                throw new Exception($"[{blh}]危急值上传失败\r\n" + e);
            }
        }
Exemplo n.º 7
0
        public List <ChartItem> GetChartItems(string blh)
        {
            var db = ContextPool.GetContext();

            var jcxx = db.T_JCXX.SingleOrDefault(o => o.F_BLH == blh);

            if (jcxx == null)
            {
                return(new List <ChartItem>());
            }
            var chartItems = (from jc in db.T_JCXX
                              join tb in db.T_TBS_BG on jc.F_BLH equals tb.F_BLH
                              where jc.F_BRBH == jcxx.F_BRBH && jc.F_BLK == jcxx.F_BLK && jc.F_BGZT == "已审核"
                              select new ChartItem
            {
                TestDate = jc.F_SPARE5.Substring(0, jc.F_SPARE5.Length - 9),
                ResultText = tb.F_TBS_XBXM1,
                ReferenceValueText = tb.F_TBS_XBXM2
                                     // Result = ChangeToDouble(tb.F_TBS_XBXM1.Replace("copy/mL","").Trim())
            }).ToList();

            //结果值
            chartItems.ForEach(o => o.Result = ChangeToDouble(o.ResultText.Replace("copy/mL", "").Replace("IU/mL", "").Trim()));
            //参考值
            try
            {
                chartItems.ForEach(o => o.ReferenceValue = Convert.ToDouble(o.ReferenceValueText
                                                                            .Replace("copy/mL", "")
                                                                            .Replace("IU/mL", "")
                                                                            .Replace("<", "")
                                                                            .Trim()));
            }
            catch (Exception e)
            {
            }

            return(chartItems);
        }
Exemplo n.º 8
0
        private static void SaveRequestMessage(string requestXml)
        {
            HL7v2Reader reader = new HL7v2Reader(requestXml);

            //患者信息
            var pid = reader["PID"][0];
            //挂号信息
            var pv1 = reader["PV1"][0];
            //申请单信息
            var orc     = reader["ORC"][0];
            var dg1List = reader["DG1"];
            //医嘱信息列表
            var obrList = reader["OBR"];

            _mshCode = reader["MSH"][0][10][0];

            T_SQD sqd = new T_SQD();

            sqd.F_msgxml = reader.HL7String;
            sqd.F_SQRQ   = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            sqd.F_BRBH   = pid[2][0];  //患者id
            sqd.F_JZH    = pv1[19][0]; //就诊ID
            sqd.F_SQXH   = orc[2][0];  //申请单ID
            var pType = pv1[2][0];     //E:急诊 I: 住院 O:门诊 T:体检

            switch (pType)
            {
            case "I":     //住院
                sqd.F_ZYH  = pv1[19][0];
                sqd.F_BRLB = "住院";
                break;

            case "E":
                sqd.F_MZH  = pv1[19][0];
                sqd.F_BRLB = "急诊";
                break;

            case "O":
                sqd.F_MZH  = pv1[19][0];
                sqd.F_BRLB = "门诊";
                break;

            case "T":
                sqd.F_MZH  = pv1[19][0];
                sqd.F_BRLB = "体检";
                break;

            default:
                sqd.F_MZH  = pv1[19][0];
                sqd.F_BRLB = "其他";
                break;
            }
            sqd.F_XM   = pid[5][1]; //姓名
            sqd.F_XBBM = pid[8][0]; //性别 F: Female M:Male O: Others 其余见HL7 定义
            switch (sqd.F_XBBM)
            {
            case "F":
                sqd.F_XB = "女";
                break;

            case "M":
                sqd.F_XB = "男";
                break;

            default:
                sqd.F_XB = "其它";
                break;
            }
            var nlString = pid[7][0];               //年龄 根据出生日期计算 yyyyMMddhhmmss,取年的整数

            sqd.F_CSRQ = pid[7][0].Substring(0, 8); //出生日期
            try
            {
                sqd.F_NL =
                    (DateTime.Now.Year - DateTime.ParseExact(nlString, "yyyyMMddHHmmss", CultureInfo.CurrentCulture).Year)
                    .ToString();
            }
            catch (Exception)
            {
            }
            var hy = pid[16][0]; //婚姻 M^己婚或 S^未婚或 O^其他

            switch (hy)
            {
            case "M":
                hy = "已婚";
                break;

            case "S":
                hy = "未婚";
                break;

            default:
                hy = "其他";
                break;
            }
            sqd.F_HY = hy;

            sqd.F_DZ     = pid[11][0]; //地址
            sqd.F_DH     = pid[13][6]; //电话
            sqd.F_BQ     = pv1[3][0];  //病区
            sqd.F_CH     = pv1[3][2];  //床号
            sqd.F_SFZH   = pid[19][0]; //身份证号
            sqd.F_SQYSBM = orc[17][0]; //开单医生编码
            sqd.F_SQKS   = orc[17][1]; //开单科室
            sqd.F_SQYS   = orc[12][2]; //开单医生
            sqd.F_SFZH   = orc[20][0]; //总费用
            if (dg1List.Any())
            {
                try
                {
                    sqd.F_LCZD = dg1List[0][4][0];
                }
                catch (Exception)
                {
                }
            }



            var dbContext = ContextPool.GetContext();

            foreach (Segment obr in obrList)
            {
                var sqdClone = sqd.Clone();
                sqdClone.F_YZID = obr[4][0];
                sqdClone.F_YZXM = obr[4][1];
                dbContext.T_SQD.Add(sqdClone);
            }
            dbContext.SaveChanges();
        }