Beispiel #1
0
        private string getJiuZhenSJD(string yishengdm, string keshidm, string guahaoxh, string yuyuelx, int shangxiawpb, string guahaolb, string yuyuerq)
        {
            string MRJZSJD = ConfigurationManager.AppSettings["MRHaoYanJiuZhensjd"];

            if (string.IsNullOrEmpty(MRJZSJD))
            {
                MRJZSJD = "";
            }
            StringBuilder sbsql = new StringBuilder();

            sbsql.Append("select kaishisj||'-'||jieshusj as sjd from v_mz_houzhensj where keshiid = '" + keshidm + "' and " + guahaoxh + " >= qishighxh and " + guahaoxh + "<=jieshughxh " +
                         "and shangxiawbz = " + shangxiawpb + " and nvl(yishengid,'*') = '" + yishengdm + "' ");

            DataTable dt = DBVisitor.ExecuteTable(sbsql.ToString());

            if (dt.Rows.Count > 0)//返回数据空
            {
                if (string.IsNullOrEmpty(dt.Rows[0]["SJD"].ToString()))
                {
                    return(MRJZSJD);
                }
                return(dt.Rows[0]["SJD"].ToString());
            }
            return(MRJZSJD);
        }
Beispiel #2
0
 /// <summary>
 /// 判断是否节假日
 /// </summary>
 /// <param name="regDate"></param>
 /// <returns></returns>
 public static bool GetHoliday(DateTime regDate)
 {
     if ((int)regDate.DayOfWeek == 6)
     {
         string    dynamicSql = "Select Decode(2,1,Csz1,Csz2) Value From Gy_Xtcs Where Csmc = 'SAT' And Xtxh = 23";
         DataTable dt         = DBVisitor.ExecuteTable(dynamicSql);
         if (dt.Rows.Count > 0 && dt.Rows[0]["Value"].ToString() == "1")
         {
             return(true);
         }
     }
     else if ((int)regDate.DayOfWeek == 0)
     {
         string    dynamicSql = "Select Decode(2,1,Csz1,Csz2) Value From Gy_Xtcs Where Csmc = 'SUN' And Xtxh = 23";
         DataTable dt         = DBVisitor.ExecuteTable(dynamicSql);
         if (dt.Rows.Count > 0 && dt.Rows[0]["Value"].ToString() == "1")
         {
             return(true);
         }
     }
     else
     {
         string    dynamicSql = $"SELECT COUNT(*) FROM gh_jjr WHERE RQ ='{regDate.ToString("MMdd")}'";
         DataTable dt         = DBVisitor.ExecuteTable(dynamicSql);
         if (dt.Rows.Count > 0)
         {
             return(true);
         }
     }
     return(false);
 }
Beispiel #3
0
        //改年龄是否可挂号
        public static Boolean shiFouKeGHNianLin(string keShiDM, string zhenJianHM)
        {
            string nianLinPd = ConfigurationManager.AppSettings["NianLinPD"];

            if (string.IsNullOrEmpty(nianLinPd))
            {
                return(true);
            }
            else if (nianLinPd == "0")
            {
                return(true);
            }
            else
            {
                int age = getAGE(zhenJianHM);

                string sqlBuf = "select * from v_guahaoKeShiNianLin where keshidm = '{0}' and {1} >= nvl(qishinl,0) and {1} <= nvl(jieshunl,999)";

                DataTable dtCount = DBVisitor.ExecuteTable(string.Format(sqlBuf, keShiDM, age));

                if (dtCount.Rows.Count > 0)
                {
                    return(false);
                }
            }
            return(true);
        }
Beispiel #4
0
        public override void ProcessMessage()
        {
            var bqdm = InObject.BINGQUDM;

            #region sql查询
            var listcwxx = DBVisitor.ExecuteModels(SqlLoad.GetFormat(SQ.BASE00004, bqdm));

            if (listcwxx.Count == 0)
            {
                throw new Exception(string.Format("无床位信息!"));
            }
            else
            {
                OutObject = new ZD_CHUANGWEIXX_OUT();

                foreach (var cwxx in listcwxx)
                {
                    var chuangweilb = new CHUANGWEIXX();
                    chuangweilb.CHUANGWEIH  = cwxx.Get("CHUANGWEIH").ToString();
                    chuangweilb.CHUANGWEISM = cwxx.Get("CHUANGWEISM");
                    OutObject.CHUANGWEIMX.Add(chuangweilb);
                }
            }
            #endregion
        }
Beispiel #5
0
        public override void ProcessMessage()
        {
            this.OutObject = new ZD_YISHENGXX_OUT();
            string keShiId = InObject.KESHIID;

            string YiShengXXSql = "select yishengid,yishengxm,yishengxb,yishengzc,yishengjs,keshiid from web_yishengxx where 1=1  ";

            if (!string.IsNullOrEmpty(keShiId))
            {
                YiShengXXSql += " and keshiid = '" + keShiId + "' ";
            }
            DataTable dtYiShengXX = DBVisitor.ExecuteTable(YiShengXXSql);

            if (dtYiShengXX.Rows.Count > 0)
            {
                for (int i = 0; i < dtYiShengXX.Rows.Count; i++)
                {
                    HIS4.Schemas.ZD.YISHENGXX ysxx = new Schemas.ZD.YISHENGXX();
                    ysxx.YISHENGID = dtYiShengXX.Rows[i]["yishengid"].ToString();
                    ysxx.YISHENGXM = dtYiShengXX.Rows[i]["yishengxm"].ToString();
                    ysxx.YISHENGXB = dtYiShengXX.Rows[i]["yishengxb"].ToString();
                    ysxx.YISHENGZC = dtYiShengXX.Rows[i]["yishengzc"].ToString();
                    ysxx.YISHENGJS = dtYiShengXX.Rows[i]["yishengjs"].ToString();
                    OutObject.YISHENGMX.Add(ysxx);
                }
            }
            else
            {
                throw new Exception("系统建设中……");
            }
        }
Beispiel #6
0
        public int RunService(string TradeType, string TradeMsg, string YYDM, ref string TradeMsgOut)
        {
            ILog   log  = log4net.LogManager.GetLogger("XmlLog");
            string guid = Guid.NewGuid().ToString("N").ToUpper();

            log.InfoFormat("[{2}][{0}].IN  {1}", TradeType, LogUnity.I.ShowXml(TradeMsg), guid);
            //var asm = Assembly.LoadFile(@"F:\1.服务平台\3.HIS4\服务平台\HisWCF\HisWCFSVR\bin\HIS4.Schemas.dll");
            //Type tp = asm.GetType("HIS4.Schemas.ZHIFUBAOTF_IN");
            //dynamic obj = Activator.CreateInstance(tp);



            var           listpbxx      = DBVisitor.ExecuteTable(SqlLoad.GetFormat(SQ.HIS00002));
            XmlSerializer xmlSerializer = new XmlSerializer(typeof(HIS4.Schemas.ZHIFUBAOTF_IN));
            Stream        stream        = new MemoryStream(ASCIIEncoding.UTF8.GetBytes(TradeMsg));

            HIS4.Schemas.ZHIFUBAOTF_IN p = xmlSerializer.Deserialize(stream) as HIS4.Schemas.ZHIFUBAOTF_IN;



            YuHangYY.HisApplayClient yhyy = new YuHangYY.HisApplayClient();
            int i = yhyy.RunService(TradeType, TradeMsg, ref TradeMsgOut);

            log.InfoFormat("[{2}][{0}].OUT {1}", TradeType, TradeMsgOut, guid);
            return(i);
        }
Beispiel #7
0
        public override void ProcessMessage()
        {
            var ZHIGONGLX = InObject.ZHIGONGLX;
            var ZHIGONGGH = InObject.ZHIGONGGH;
            var ZHIGONGXM = InObject.ZHIGONGXM;

            #region 参数验证
            //职工类型
            if (ZHIGONGLX == null || ZHIGONGLX == "")
            {
                throw new Exception(string.Format("职工类型不能为空!"));
            }
            else if (ZHIGONGLX != "1" && ZHIGONGLX != "2" && ZHIGONGLX != "0")
            {
                throw new Exception(string.Format("职工类型不正确,必须是:0.全部,1.医生,2.护士!"));
            }
            #endregion


            #region sql查询
            if (ZHIGONGLX != "0")
            {
                ZHIGONGLX = string.Format(" and ZGLB='{0}' ", ZHIGONGLX);
            }
            else
            {
                ZHIGONGLX = "";
            }
            if (!string.IsNullOrEmpty(ZHIGONGGH))
            {
                ZHIGONGGH = string.Format(" and ZGGH='{0}' ", ZHIGONGGH);
            }
            if (!string.IsNullOrEmpty(ZHIGONGXM))
            {
                ZHIGONGXM = string.Format(" and ZGXM='{0}' ", ZHIGONGXM);
            }

            var listpbxx = DBVisitor.ExecuteModels(SqlLoad.GetFormat(SQ.BASE00001, ZHIGONGLX, ZHIGONGGH, ZHIGONGXM));

            if (listpbxx.Count == 0)
            {
                throw new Exception(string.Format("无职工信息!"));
            }
            else
            {
                OutObject = new ZD_ZHIGONGXX_OUT();

                foreach (var zgxx in listpbxx)
                {
                    var zhigonglb = new ZHIGONGXX();
                    zhigonglb.ZHIGONGGH = zgxx.Get("ZGGH"); //工号
                    zhigonglb.ZHIGONGXM = zgxx.Get("ZGXM"); //姓名
                    zhigonglb.ZHIGONGZC = zgxx.Get("ZGZC"); //职称
                    zhigonglb.ZHIGONGJS = zgxx.Get("ZGJS"); //介绍
                    zhigonglb.ZHIGONGTC = zgxx.Get("ZGTC"); //特长
                    OutObject.ZHIGONGLB.Add(zhigonglb);
                }
            }
            #endregion
        }
Beispiel #8
0
        public override void ProcessMessage()
        {
            string jiuZhenKH = InObject.patientid;

            if (string.IsNullOrEmpty(jiuZhenKH))
            {
                throw new Exception("患者编号不能为空");
            }

            string sqlBingRenID = "select bingrenid from gy_bingrenxx where jiuzhenkh ='{0}'";
            string bingRenID    = (string)DBVisitor.ExecuteScalar(string.Format(sqlBingRenID, jiuZhenKH));

            string errChuFang = string.Empty;

            foreach (var item in InObject.orderinfo)
            {
                string orderno = item.orderno;
                if (string.IsNullOrEmpty(orderno))
                {
                    errChuFang += "," + jiuZhenKH;
                    continue;
                }
                string sqlPYWC = "update mz_chufang1 set peiyaobz = 1 where chufangid = '{0}' and bingrenid = '{1}'";
                DBVisitor.ExecuteNonQuery(string.Format(sqlPYWC, orderno, jiuZhenKH));
            }
            if (!string.IsNullOrEmpty(errChuFang))
            {
                errChuFang = errChuFang.Trim(',');
                throw new Exception("以下病人的处方id获取失败请检查数据:" + errChuFang);
            }
        }
Beispiel #9
0
        public static void sendJCFX()
        {
            var JCFXtable = DBVisitor.ExecuteModels(SqlLoad.GetFormat(SQ.AUTO00011));

            if (JCFXtable == null || JCFXtable.Count == 0)
            {
            }
            else
            {
                var xmlin = "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
                xmlin += "<request action=\"sendCheckDirection\" client=\"市二:192.168.1.10\">";
                xmlin += "<head>";
                xmlin += "<patient>";
                xmlin += "<mpiId></mpiId>";
                xmlin += "</patient>";
                xmlin += "</head>";
                xmlin += "<body>";

                foreach (var mxxx in JCFXtable)
                {
                    xmlin += "<item>";
                    xmlin += "<directionCode>" + mxxx.Get("id") + "</directionCode>";
                    xmlin += "<directionParentCode>" + mxxx.Get("IDF") + "</directionParentCode>";
                    xmlin += "<directionName>" + mxxx.Get("fxmc") + "</directionName>";
                    xmlin += "<inUseFlag>" + mxxx.Get("del_flag") + "</inUseFlag>";
                    xmlin += "<frequency>" + mxxx.Get("xmcs") + "</frequency>";
                    xmlin += "<hospitalCode>47011662233010511A1001</hospitalCode>";
                    xmlin += "</item>";
                }
                xmlin += "</body>";
                xmlin += "</request>";
                var rtnstr = sendJK(xmlin);
            }
        }
Beispiel #10
0
        public static void sendJCBW()
        {
            var JCBWtable = DBVisitor.ExecuteModels(SqlLoad.GetFormat(SQ.AUTO00012));

            if (JCBWtable == null || JCBWtable.Count == 0)
            {
            }
            else
            {
                var xmlin = "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
                xmlin += "<request action=\"sendCheckPart\" client=\"市二:192.168.1.10\">";
                xmlin += "<head>";
                xmlin += "<patient>";
                xmlin += "<mpiId></mpiId>";
                xmlin += "</patient>";
                xmlin += "</head>";
                xmlin += "<body>";

                foreach (var mxxx in JCBWtable)
                {
                    xmlin += "<item>";
                    xmlin += "<partCode>" + mxxx.Get("id") + "</partCode>";                 //检查部位代码
                    xmlin += "<partName>" + mxxx.Get("bwmc") + "</partName>";               //检查部位名称
                    xmlin += "<inUseFlag>" + mxxx.Get("del_flag") + "</inUseFlag>";
                    xmlin += "<classifyCode>" + mxxx.Get("flbm") + "</classifyCode>";       //检查类型代码
                    xmlin += "<departmentCode>" + mxxx.Get("zxksdm") + "</departmentCode>"; //执行科室代码
                    xmlin += "<hospitalCode>47011662233010511A1001</hospitalCode>";
                    xmlin += "</item>";
                }
                xmlin += "</body>";
                xmlin += "</request>";
                var rtnstr = sendJK(xmlin);
            }
        }
Beispiel #11
0
        public static void sendJCFL()
        {
            var JCFLtable = DBVisitor.ExecuteModels(SqlLoad.GetFormat(SQ.AUTO00009));

            if (JCFLtable == null || JCFLtable.Count == 0)
            {
            }
            else
            {
                var xmlin = "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
                xmlin += "<request action=\"sendCheckClassify\" client=\"市二:192.168.1.10\">";
                xmlin += "<head>";
                xmlin += "<patient>";
                xmlin += "<mpiId></mpiId>";
                xmlin += "</patient>";
                xmlin += "</head>";
                xmlin += "<body>";

                foreach (var mxxx in JCFLtable)
                {
                    xmlin += "<item>";
                    xmlin += "<classifyCode>" + mxxx.Get("id") + "</classifyCode>";
                    xmlin += "<classifyName>" + mxxx.Get("ylflmc") + "</classifyName>";
                    xmlin += "<departmentCode>" + mxxx.Get("zxkdm") + "</departmentCode>";
                    xmlin += "<inUseFlag>" + mxxx.Get("del_flag") + "</inUseFlag>";
                    xmlin += "<telephone>" + mxxx.Get("lxdh") + "</telephone>";
                    xmlin += "<departmentLocation>" + mxxx.Get("ksdz") + "</departmentLocation>";
                    xmlin += "<hospitalCode>47011662233010511A1001</hospitalCode>";
                    xmlin += "</item>";
                }
                xmlin += "</body>";
                xmlin += "</request>";
                var rtnstr = sendJK(xmlin);
            }
        }
Beispiel #12
0
        public override void ProcessMessage()
        {
            if (string.IsNullOrEmpty(InObject.LEIXING))
            {
                throw new Exception("日志类型不能为空!");
            }
            if (string.IsNullOrEmpty(InObject.CONTEXT))
            {
                throw new Exception("日志内容不能为空!");
            }
            string RiZId = "";
            var    maxid = DBVisitor.ExecuteModel(SqlLoad.GetFormat(SQ.HIS00026, " seq_GY_RIZHI_ZZJ.nextval "));

            if (maxid == null)
            {
                throw new Exception(string.Format("获取日志ID失败!"));
            }
            else
            {
                RiZId = maxid.Items["MAXID"].ToString();
            }
            string StrTct = InObject.CONTEXT.Replace("'", "").Trim();

            DBVisitor.ExecuteNonQuery(SqlLoad.GetFormat(SQ.HIS00027, RiZId, InObject.JIUZHENKH, StrTct, InObject.BASEINFO.CAOZUOYDM,
                                                        InObject.IP, InObject.LEIXING, InObject.ERRBZ));
            OutObject = new CAOZUORIJL_OUT();
        }
Beispiel #13
0
        public static void sendRYSJ()
        {
            var Brxx = DBVisitor.ExecuteModels(SqlLoad.GetFormat(SQ.AUTO00001, " and brzt in (3,4) and ryfszt = 0 "));

            if (Brxx == null || Brxx.Count == 0)
            {
            }
            else
            {
                foreach (var mxxx in Brxx)
                {
                    var str = "<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
                              "<request action= \"sendInHospitalFlag\" client=\"市二:192.168.1.10\" >" +
                              "<head><patient><mpiId></mpiId>" +
                              "<personName>" + mxxx.Get("brxm") + "</personName>" +
                              "<sexCode>" + mxxx.Get("brxb") + "</sexCode>" +
                              "<birthday>" + mxxx.Get("brcsrq") + "</birthday>" +
                              "<idCard>" + mxxx.Get("sfzh") + "</idCard>" +
                              "<idType>01</idType>" +
                              "<cardNo>" + mxxx.Get("jzkh") + "</cardNo>" +
                              "<cardType>" + mxxx.Get("jzklx") + "</cardType>" +
                              "</patient></head>" +
                              "<body>" +
                              "<hospitalCode>47011662233010511A1001</hospitalCode>" +
                              "<wardAreaCode>" + mxxx.Get("bqdm") + "</wardAreaCode>" +
                              "<wardArea>" + mxxx.Get("bqmc") + "</wardArea>" +
                              "<departmentCode>" + mxxx.Get("ksdm") + "</departmentCode>" +
                              "<department>" + mxxx.Get("ksmc") + "</department>" +
                              "<bedNo>" + mxxx.Get("curr_bed") + "</bedNo>" +
                              "<inHospitalTime>" + mxxx.Get("admiss_date") + "</inHospitalTime>" +
                              "<inHospitalReason></inHospitalReason>" +
                              "<doctorName>" + mxxx.Get("zzys") + "</doctorName>" +
                              "<doctorPhone>" + mxxx.Get("zzyslxdh") + "</doctorPhone>" +
                              "<reserveNo>" + mxxx.Get("zzsqdh") + "</reserveNo>" +
                              "<submitor>自动转发</submitor>" +
                              "<submitTime>" + System.DateTime.Now.ToString() + "</submitTime>" +
                              "<submitAgency>杭州市二医院</submitAgency></body></request>";

                    var rtnstr = sendJK(str);
                    var xmldom = new XmlDocument();
                    var xmlOut = "";
                    xmlOut = rtnstr;
                    xmldom.LoadXml(xmlOut);
                    var errno = xmldom.GetElementsByTagName("code").Item(0).FirstChild.InnerText;
                    if (errno == "200")
                    {
                        var tran = DBVisitor.Connection.BeginTransaction();
                        try
                        {
                            DBVisitor.ExecuteNonQuery(SqlLoad.GetFormat(SQ.AUTO00007, mxxx.Get("zzsqdh")), tran);
                            tran.Commit();
                        }
                        catch (Exception ex)
                        {
                            tran.Rollback();
                        }
                    }
                }
            }
        }
Beispiel #14
0
        public override void ProcessMessage()
        {
            OutObject = new YIZHUXX_OUT();
            string bingRenId = InObject.BINGRENID;//病人住院ID

            #region 基本入参判断
            if (string.IsNullOrEmpty(bingRenId))
            {
                throw new Exception("病人ID不能为空!");
            }
            #endregion

            string    pinci     = string.Empty;
            DataTable dtYIZHUXX = DBVisitor.ExecuteTable(string.Format("SELECT * FROM V_YZ_BINGRENYZ WHERE BINGRENZYID='{0}'", bingRenId));
            foreach (DataRow dr in dtYIZHUXX.Rows)
            {
                BINGRENYZXX yzxx = new BINGRENYZXX();
                yzxx.STARTTIME     = dr["START_TIME"].ToString();
                yzxx.ORDERNAME     = dr["ORDER_NAME"].ToString() + dr["PSJG"].ToString();
                yzxx.PHYSICIANNAME = dr["PHYSICIAN_NAME"].ToString();
                pinci = dr["PINCI"].ToString();
                if (pinci == "ONCE" || pinci == "ST")
                {
                    yzxx.ZHIXINGSJ      = dr["ZXSJ"].ToString();
                    yzxx.ZHIXINGRENNAME = dr["ZXR1"].ToString();
                }
                else
                {
                    yzxx.ZHIXINGSJ      = dr["ZHIXINGSJ"].ToString();
                    yzxx.ZHIXINGRENNAME = dr["ZHIXINGREN_NAME"].ToString();
                }
                OutObject.BINGRENYZXX.Add(yzxx);
            }
        }
Beispiel #15
0
        public override void ProcessMessage()
        {
            OutObject = new MENZHENTBZLMX_OUT();

            string BingRenID = InObject.BINGRENID; //病人ID

            if (string.IsNullOrEmpty(BingRenID))
            {
                throw new Exception("病人ID不能为空!");
            }

            ///人员信息确认
            var dtBingRenXX = DBVisitor.ExecuteTable(string.Format("select * from gy_v_bingrenxx where bingrenid = '{0}' ", BingRenID));

            if (dtBingRenXX == null || dtBingRenXX.Rows.Count <= 0)
            {
                throw new Exception(string.Format("未找到病人ID为[{0}]的病人!", BingRenID));
            }
            ///特殊病处方医技信息查询
            DataTable dtTeBingZLXX = DBVisitor.ExecuteTable(string.Format("select * from mz_v_teBingZhenliaoXX where bingrenid = '{0}' ", BingRenID));

            if (dtTeBingZLXX != null && dtTeBingZLXX.Rows.Count > 0)
            {
                for (int i = 0; i < dtTeBingZLXX.Rows.Count; i++)
                {
                    TEBINGZLXX temp = new TEBINGZLXX();
                    temp.ZHENLIAOLX = dtTeBingZLXX.Rows[i]["ZHENLIAOLX"].ToString();
                    temp.ZHENLIAOID = dtTeBingZLXX.Rows[i]["ZHENLIAOID"].ToString();
                    temp.BINGRENID  = dtTeBingZLXX.Rows[i]["bingrenid"].ToString();
                    temp.SHUXINGZT  = dtTeBingZLXX.Rows[i]["SHUXINGZT"].ToString();
                    OutObject.TEBINGZLMX.Add(temp);
                }
            }
        }
Beispiel #16
0
        public override void ProcessMessage()
        {
            #region sql查询
            if (InObject.XIAZAILX == "1")
            {
                var listjcxx = DBVisitor.ExecuteModels(SqlLoad.GetFormat(SQ.BASE00010));

                if (listjcxx.Count == 0)
                {
                    throw new Exception(string.Format("无检查明细信息!"));
                }
                else
                {
                    OutObject = new ZD_JIANCHAJYMX_OUT();

                    foreach (var jcxx in listjcxx)
                    {
                        var jianchalb = new JIANCHAJYXX();
                        jianchalb.MOBANDM     = jcxx.Get("MBLXDM");
                        jianchalb.JIANCHAJYDM = jcxx.Get("LBXH");
                        jianchalb.JIANCHAJYMC = jcxx.Get("LBMC");
                        jianchalb.FULEIXH     = jcxx.Get("FLXH");
                        jianchalb.MOJIEPB     = jcxx.Get("SFMJ");
                        jianchalb.ZHIXINGKS   = jcxx.Get("JCKS");
                        jianchalb.BEIZHU      = jcxx.Get("JCYQ");
                        OutObject.JIANCHAJYMX.Add(jianchalb);
                    }
                }
            }
            else
            {
                var listjyxx = DBVisitor.ExecuteModels(SqlLoad.GetFormat(SQ.BASE00012));

                if (listjyxx.Count == 0)
                {
                    throw new Exception(string.Format("无检验明细信息!"));
                }
                else
                {
                    OutObject = new ZD_JIANCHAJYMX_OUT();

                    foreach (var jyxx in listjyxx)
                    {
                        var jianyanlb = new JIANCHAJYXX();
                        jianyanlb.MOBANDM     = jyxx.Get("MBLXDM");
                        jianyanlb.JIANCHAJYDM = jyxx.Get("LBXH");
                        jianyanlb.JIANCHAJYMC = jyxx.Get("LBMC");
                        jianyanlb.FULEIXH     = "";
                        jianyanlb.MOJIEPB     = "0";
                        jianyanlb.ZHIXINGKS   = "";
                        jianyanlb.BEIZHU      = jyxx.Get("YLXH");
                        OutObject.JIANCHAJYMX.Add(jianyanlb);
                    }
                }
            }
            #endregion
        }
Beispiel #17
0
        public override void ProcessMessage()
        {
            if (string.IsNullOrEmpty(InObject.pharmacyid) || !InObject.pharmacyid.Contains('*'))
            {
                throw new Exception("传入参数格式错误");
            }
            string chuFangHM = InObject.pharmacyid.Split('*')[1]; //处方id 多个时使用#分割
            string bingRenID = InObject.pharmacyid.Split('*')[0]; //病人id

            string pharmacyid = string.Empty;                     //药房id
            string winno      = string.Empty;                     //窗口id

            #region 入参判断
            if (string.IsNullOrEmpty(chuFangHM))
            {
                throw new Exception("处方号码不能为空");
            }
            if (string.IsNullOrEmpty(bingRenID))
            {
                throw new Exception("病人id不能为空");
            }
            #endregion

            string sqlCKXX = "select a.chufangid, a.chuangkouid chuangkouid,b.yingyongid yaofangid from mz_chufang1 a ,my_chuangkou b where a.chuangkouid = b.chuangkouid and a.chufangid in(select max(chufangid) from mz_chufang1 where chufanghm in('{0}') group by chufanghm)  and a.bingrenid = '{1}' ";

            DataTable dtCKXX = DBVisitor.ExecuteTable(string.Format(sqlCKXX, chuFangHM, bingRenID));

            if (dtCKXX.Rows.Count > 0)
            {
                pharmacyid          = dtCKXX.Rows[0]["yaofangid"].ToString();
                winno               = dtCKXX.Rows[0]["chuangkouid"].ToString();
                InObject.pharmacyid = pharmacyid;
                InObject.winno      = winno;
                InObject.orderno    = dtCKXX.Rows[0]["chufangid"].ToString();
                string sqlJiuZhenKH = "select jiuzhenkh from gy_bingrenxx where bingrenid ='{0}'";
                InObject.patientid = (string)DBVisitor.ExecuteScalar(string.Format(sqlJiuZhenKH, bingRenID));
                //InObject.patientid = bingRenID;
                OutObject = Unity.runService <DISP_PREPARE_IN, DISP_PREPARE_OUT>(InObject);
                if (OutObject.ResultCode == "0")
                {
                    if (OutObject.Result.state == "2")
                    {
                        OutObject.ResultContent = "已配药完成";
                        string sqlPYBZ = "update mz_chufang1 set peiyaobz = 1 where chufangid = '{0}'";
                        DBVisitor.ExecuteNonQuery(string.Format(sqlPYBZ, InObject.orderno));
                    }
                    else
                    {
                        //OutObject.ResultContent = "正在配药中,请稍后!";
                    }
                }
            }
            else
            {
                throw new Exception("未找到相应的处方信息");
            }
        }
Beispiel #18
0
        public override void Sync(DBVisitor db)
        {
            db.Sync(this);
            var i = IteratorInstance();

            for (i.First(); !i.IsDone(); i.Next())
            {
                i.Target.Sync(db);
            }
        }
Beispiel #19
0
        public override void ProcessMessage()
        {
            OutObject = new JIANCHAJGCX_OUT();
            string shenQingDID = InObject.SHENQINDANID;//检查申请单ID

            #region 基础入参判断
            if (string.IsNullOrEmpty(shenQingDID))
            {
                throw new Exception("检查申请单ID不能为空!");
            }

            string    shenQingDQRSql = "select * from yj_shenqingdan where shenqindanid = '{0}'";
            DataTable dtShenQingDQR  = DBVisitor.ExecuteTable(string.Format(shenQingDQRSql, shenQingDID));
            if (dtShenQingDQR == null || dtShenQingDQR.Rows.Count <= 0)
            {
                throw new Exception("未找到该申请单的相关信息,请确认!");
            }
            #endregion

            string    shenQingBGSql = " select * from YJ_V_JIANCHABG where shenqindanid = '{0}' ";
            DataTable dtShenQingBG  = DBVisitor.ExecuteTable(string.Format(shenQingBGSql, shenQingDID));
            if (dtShenQingBG == null || dtShenQingBG.Rows.Count <= 0)
            {
                throw new Exception("检查还未出报告!");
            }
            else
            {
                for (int i = 0; i < dtShenQingBG.Rows.Count; i++)
                {
                    HIS4.Schemas.JIANCHAJGXX jcjgxx = new HIS4.Schemas.JIANCHAJGXX();
                    jcjgxx.SHENQINDANID = dtShenQingBG.Rows[i]["shenqindanid"].ToString(); //申请单id
                    jcjgxx.YIZHUID      = dtShenQingBG.Rows[i]["yizhuid"].ToString();      //医嘱id
                    jcjgxx.YIZHUXMID    = dtShenQingBG.Rows[i]["yizhuxmid"].ToString();    //医嘱项目id
                    jcjgxx.YIZHUMC      = dtShenQingBG.Rows[i]["yizhumc"].ToString();      //医嘱名称
                    jcjgxx.JIUZHENID    = dtShenQingBG.Rows[i]["jiuzhenid"].ToString();    //就诊id
                    jcjgxx.BINGRENID    = dtShenQingBG.Rows[i]["bingrenid"].ToString();    //病人id
                    jcjgxx.BINGRENZYID  = dtShenQingBG.Rows[i]["BINGRENZYID"].ToString();  //病人住院id
                    jcjgxx.JIANCHALX    = dtShenQingBG.Rows[i]["JIANCHALX"].ToString();    //检查类型
                    jcjgxx.JIANCHALXMC  = dtShenQingBG.Rows[i]["JIANCHALXMC"].ToString();  //检查类型名称
                    jcjgxx.KAIDANYS     = dtShenQingBG.Rows[i]["kaidanys"].ToString();     //开单医生
                    jcjgxx.KAIDANSJ     = dtShenQingBG.Rows[i]["kaidansj"].ToString();     //开单时间
                    jcjgxx.MOBANDM      = dtShenQingBG.Rows[i]["mobandm"].ToString();      //模板代码
                    jcjgxx.ZHUSU        = dtShenQingBG.Rows[i]["zhusu"].ToString();        //主诉
                    jcjgxx.LINCHUANGZD  = dtShenQingBG.Rows[i]["linchuangzd"].ToString();  //临床诊断
                    jcjgxx.JIANCHABW    = dtShenQingBG.Rows[i]["jianchabw"].ToString();    //检查部位
                    jcjgxx.JIANCHASJ    = dtShenQingBG.Rows[i]["jianchasj"].ToString();    //检查时间
                    jcjgxx.ZHENDUANJG   = dtShenQingBG.Rows[i]["zhenduanjg"].ToString();   //诊断结果
                    jcjgxx.BAOGAOSJ     = dtShenQingBG.Rows[i]["baogaosj"].ToString();     //报告时间
                    jcjgxx.MENZHENZYBZ  = dtShenQingBG.Rows[i]["menzhenzybz"].ToString();  //门诊住院标识
                    jcjgxx.DANGQIANZT   = dtShenQingBG.Rows[i]["dangqianzt"].ToString();   //当前状态
                    jcjgxx.DANGQIANZTMC = dtShenQingBG.Rows[i]["dangqianztmc"].ToString(); //当前状态名称
                    OutObject.JIANCHAJGMX.Add(jcjgxx);
                }
            }
        }
Beispiel #20
0
        //获取有效天数
        public static string GetYouXiaoTs()
        {
            //1手工处方2手工医技3电子处方4电子检验检查其他5处置6体检接口7代收挂号诊疗费中间用|分隔;0无穷天
            string    youxiaoTs = "0";
            string    sqlStr    = "select pkg_pt_gongyong.Fun_GY_GetCanShu('00','门诊收费_结算有效天数','3') as youxiaots from dual ";
            DataTable dtCount   = DBVisitor.ExecuteTable(sqlStr);

            if (dtCount.Rows.Count > 0 && dtCount.Rows[0][0].ToString() != string.Empty)
            {
                youxiaoTs = dtCount.Rows[0][0].ToString();
            }
            return(youxiaoTs);
        }
Beispiel #21
0
        public static string GetXiangMuFY(string xiangMuDM)
        {
            string sqlXMFY = "select danjia1 from gy_shoufeixm where shoufeixmid = '{0}'";

            DataTable dtXMFY = DBVisitor.ExecuteTable(string.Format(sqlXMFY, xiangMuDM));
            string    xmfy   = string.Empty;

            if (dtXMFY.Rows.Count > 0)
            {
                xmfy = dtXMFY.Rows[0][0].ToString();
            }
            return(xmfy);
        }
Beispiel #22
0
        public static void sendCFTZ()
        {
            var Brxx = DBVisitor.ExecuteModels(SqlLoad.GetFormat(SQ.AUTO00001, " and cftz in = 1 and cftzfszt = 0 "));

            if (Brxx == null || Brxx.Count == 0)
            {
            }
            else
            {
                foreach (var mxxx in Brxx)
                {
                    var str = "<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
                              "<request action= \"sendInhospitalVisitNotice\" client=\"市二:192.168.1.10\" >" +
                              "<head><patient><mpiId></mpiId>" +
                              "<personName>" + mxxx.Get("brxm") + "</personName>" +
                              "<sexCode>" + mxxx.Get("brxb") + "</sexCode>" +
                              "<birthday>" + mxxx.Get("brcsrq") + "</birthday>" +
                              "<idCard>" + mxxx.Get("sfzh") + "</idCard>" +
                              "<idType>01</idType>" +
                              "<cardNo>" + mxxx.Get("jzkh") + "</cardNo>" +
                              "<cardType>" + mxxx.Get("jzklx") + "</cardType>" +
                              "</patient></head>" +
                              "<body>" +
                              "<reserveNo>" + mxxx.Get("zzsqdh") + "</reserveNo>" +
                              "<visitDate>" + mxxx.Get("ywlx") + "</visitDate>" +
                              "<submitor>自动转发</submitor>" +
                              "<submitTime>" + System.DateTime.Now.ToString() + "</submitTime>" +
                              "<submitAgency>杭州市二医院</submitAgency></body></request>";

                    var rtnstr = sendJK(str);
                    var xmldom = new XmlDocument();
                    var xmlOut = "";
                    xmlOut = rtnstr;
                    xmldom.LoadXml(xmlOut);
                    var errno = xmldom.GetElementsByTagName("code").Item(0).FirstChild.InnerText;
                    if (errno == "200")
                    {
                        var tran = DBVisitor.Connection.BeginTransaction();
                        try
                        {
                            DBVisitor.ExecuteNonQuery(SqlLoad.GetFormat(SQ.AUTO00007, mxxx.Get("zzsqdh")), tran);
                            tran.Commit();
                        }
                        catch (Exception ex)
                        {
                            tran.Rollback();
                        }
                    }
                }
            }
        }
Beispiel #23
0
        public override void ProcessMessage()
        {
            if (string.IsNullOrEmpty(InObject.ZHENGJIANHM))
            {
                throw new Exception("证件号码不能为空!");
            }
            if (string.IsNullOrEmpty(InObject.XINGMING))
            {
                throw new Exception("姓名不能为空!");
            }
            if (string.IsNullOrEmpty(InObject.BASEINFO.FENYUANDM))
            {
                throw new Exception("分院代码不能为空!");
            }
            if (string.IsNullOrEmpty(InObject.JIUZHENKLX))
            {
                throw new Exception("就诊卡类型不能为空");
            }
            if (string.IsNullOrEmpty(InObject.JIUZHENKH))
            {
                throw new Exception("就诊卡号不能为空");
            }
            //判断是否存在传入身份证号的病人信息
            string fydmwhere = "";

            if (InObject.JIUZHENKLX != "2")
            { //如果是社保卡 则不增加医院条件 社保卡 全区都可以用
                fydmwhere = string.Format(" and  FENYUANDM='{0}'", InObject.BASEINFO.FENYUANDM);
            }
            InObject.JIUZHENKH = System.Convert.ToString(InObject.JIUZHENKH.ToUpper()).PadLeft(10, '0');
            var existInfo = DBVisitor.ExecuteModel(SqlLoad.GetFormat(SQ.HIS00004, InObject.ZHENGJIANHM.ToLower(), InObject.JIUZHENKH, InObject.JIUZHENKLX, fydmwhere));

            //if (InObject.JIUZHENKLX == "2" && InObject.BASEINFO.FENYUANDM == "10006" && existInfo == null)
            //{
            //    if (InObject.JIUZHENKH.Length == 10)
            //    {
            //        existInfo = DBVisitor.ExecuteModel(SqlLoad.GetFormat(SQ.HIS00004, InObject.ZHENGJIANHM.ToLower(), InObject.JIUZHENKH.Substring(1, 9), InObject.JIUZHENKLX, fydmwhere));
            //    }
            //}

            if (existInfo == null || existInfo.Items["ZUOFEIPB"].ToString() == "1")
            {
                throw new Exception("查询不到身份证号为【" + InObject.ZHENGJIANHM + "】的签约信息!");
            }
            if (InObject.XINGMING.ToString() != existInfo.Items["BINGRENXM"].ToString())
            {
                throw new Exception(string.Format("传入病人姓名[{0}]与签约账户姓名[{1}]不符", InObject.XINGMING, existInfo.Items["BINGRENXM"]));
            }
            OutObject           = new ZHIFUBAOBDCX_OUT();
            OutObject.ZHIFUBXYH = existInfo.Items["XIEYIHM"].ToString();
        }
Beispiel #24
0
        public static void sendDRYSJ()
        {
            var Brxx = DBVisitor.ExecuteModels(SqlLoad.GetFormat(SQ.AUTO00001, " and brzt in (1,3,4) and dryfszt = 0 "));

            if (Brxx == null || Brxx.Count == 0)
            {
            }
            else
            {
                foreach (var mxxx in Brxx)
                {
                    var str = "<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
                              "<request action= \"sendInHospitalAcceptFlag\" client=\"市二:192.168.1.10\" >" +
                              "<head><patient><mpiId></mpiId>" +
                              "<personName>" + mxxx.Get("brxm") + "</personName>" +
                              "<sexCode>" + mxxx.Get("brxb") + "</sexCode>" +
                              "<birthday>" + mxxx.Get("brcsrq") + "</birthday>" +
                              "<idCard>" + mxxx.Get("sfzh") + "</idCard>" +
                              "<idType>01</idType>" +
                              "<cardNo>" + mxxx.Get("jzkh") + "</cardNo>" +
                              "<cardType>" + mxxx.Get("jzklx") + "</cardType>" +
                              "</patient></head>" +
                              "<body>" +
                              "<reserveNo>" + mxxx.Get("zzsqdh") + "</reserveNo>" +
                              "<departmentNo>" + mxxx.Get("ksdm") + "</departmentNo>" +
                              "<department>" + mxxx.Get("ksmc") + "</department>" +
                              "</body></request>";

                    var rtnstr = sendJK(str);
                    var xmldom = new XmlDocument();
                    var xmlOut = "";
                    xmlOut = rtnstr;
                    xmldom.LoadXml(xmlOut);
                    var errno = xmldom.GetElementsByTagName("code").Item(0).FirstChild.InnerText;
                    if (errno == "200")
                    {
                        var tran = DBVisitor.Connection.BeginTransaction();
                        try
                        {
                            DBVisitor.ExecuteNonQuery(SqlLoad.GetFormat(SQ.AUTO00007, mxxx.Get("zzsqdh")), tran);
                            tran.Commit();
                        }
                        catch (Exception ex)
                        {
                            tran.Rollback();
                        }
                    }
                }
            }
        }
Beispiel #25
0
        public override void ProcessMessage()
        {
            OutObject = new YUANQUXX_OUT();

            string    sqlBuf     = "SELECT yuanquid,yuanqumc FROM v_GY_YUANQU ";
            DataTable dtYuanQuXX = DBVisitor.ExecuteTable(sqlBuf);

            for (int i = 0; i < dtYuanQuXX.Rows.Count; i++)
            {
                Schemas.YUANQUXX yqxx = new Schemas.YUANQUXX();
                yqxx.YUANQUID = dtYuanQuXX.Rows[i]["yuanquid"].ToString();
                yqxx.YUANQUMC = dtYuanQuXX.Rows[i]["yuanqumc"].ToString();
                OutObject.YUANQUMX.Add(yqxx);
            }
        }
Beispiel #26
0
        public override void ProcessMessage()
        {
            OutObject = new ZD_JIANCHAXMBW_OUT();
            DataTable dtJianChaBWXMXX = DBVisitor.ExecuteTable("SELECT DAIMAID AS JIANCHAXMBWDM, DAIMAMC AS JIANCHAXMBWMC,JIANCHALX AS JIANCHAXMLX  FROM GY_JIANCHABW WHERE ZUOFEIBZ = 0 ");

            for (int i = 0; i < dtJianChaBWXMXX.Rows.Count; i++)
            {
                JIANCHAXMBWXX temp = new JIANCHAXMBWXX();

                temp.JIANCHAXMBWDM = dtJianChaBWXMXX.Rows[i]["JIANCHAXMBWDM"].ToString();
                temp.JIANCHAXMBWMC = dtJianChaBWXMXX.Rows[i]["JIANCHAXMBWMC"].ToString();
                temp.JIANCHAXMLX   = dtJianChaBWXMXX.Rows[i]["JIANCHAXMLX"].ToString();

                OutObject.JIANCHAXMBWMX.Add(temp);
            }
        }
Beispiel #27
0
        /// <summary>
        /// 获取数据库参数配置
        /// </summary>
        /// <param name="sysNum">系统序号</param>
        /// <param name="varName">参数名称</param>
        /// <param name="varNum">参数序号</param>
        /// <param name="initValue">初始值</param>
        /// <returns>返回值</returns>
        public static string DbConfigValue(string sysNum, string varName, string varNum, string initValue)
        {
            string outVar     = "";
            string dynamicSql = string.Format("Select Decode({0},1,Csz1,Csz2) Value From Gy_Xtcs Where Csmc = '{1}' And Xtxh = {2}", varNum, varName, sysNum);
            var    Result     = DBVisitor.ExecuteModel(dynamicSql);

            if (Result != null)
            {
                outVar = Result.Items["VALUE"].ToString();
            }
            else
            {
                outVar = initValue;
            }
            return(outVar);
        }
Beispiel #28
0
        /// <summary>
        /// 判断科室可挂号性别
        /// </summary>
        /// <param name="keShiDM"></param>
        /// <param name="zhenJianHM"></param>
        /// <returns></returns>
        public static Boolean shiFouKeGHXingBie(string keShiDM, string zhenJianHM)
        {
            string xingBiePd = ConfigurationManager.AppSettings["XingBiePD"];

            if (string.IsNullOrEmpty(xingBiePd) || xingBiePd == "0")
            {
                return(true);
            }
            else
            {
                string sqlBuf  = "select canshuzhi from gy_canshu where canshuid like '挂号_挂号科室与性别排斥' and yingyongid = '00'";
                string canShuZ = DBVisitor.ExecuteScalar(sqlBuf).ToString();
                int    xingBie = getXingBie(zhenJianHM);
                if (xingBie == 1)//男
                {
                    string nanXingKS = canShuZ.Split('|')[0].ToString();
                    if (string.IsNullOrEmpty(nanXingKS) || nanXingKS == "*")
                    {
                        return(true);
                    }
                    foreach (string item in nanXingKS.Split('^'))
                    {
                        if (keShiDM == item)
                        {
                            return(false);
                        }
                    }
                }
                else  //女
                {
                    string nvXingKS = canShuZ.Split('|')[1].ToString();
                    if (string.IsNullOrEmpty(nvXingKS) || nvXingKS == "*")
                    {
                        return(true);
                    }
                    foreach (string item in nvXingKS.Split('^'))
                    {
                        if (keShiDM == item)
                        {
                            return(false);
                        }
                    }
                }
            }

            return(true);
        }
Beispiel #29
0
        public override void ProcessMessage()
        {
            #region sql查询
            if (InObject.XIAZAILX == "1")
            {
                var listjcxx = DBVisitor.ExecuteModels(SqlLoad.GetFormat(SQ.BASE00009));

                if (listjcxx.Count == 0)
                {
                    throw new Exception(string.Format("无检查模版信息!"));
                }
                else
                {
                    OutObject = new ZD_JIANCHAJYMB_OUT();

                    foreach (var jcxx in listjcxx)
                    {
                        var jianchalb = new MOBANXX();
                        jianchalb.MOBANDM = jcxx.Get("MBLXDM");
                        jianchalb.MOBANMC = jcxx.Get("MBMC");
                        OutObject.MOBANMX.Add(jianchalb);
                    }
                }
            }
            else
            {
                var listjyxx = DBVisitor.ExecuteModels(SqlLoad.GetFormat(SQ.BASE00011));

                if (listjyxx.Count == 0)
                {
                    throw new Exception(string.Format("无检验模版信息!"));
                }
                else
                {
                    OutObject = new ZD_JIANCHAJYMB_OUT();

                    foreach (var jyxx in listjyxx)
                    {
                        var jianyanlb = new MOBANXX();
                        jianyanlb.MOBANDM = jyxx.Get("MBLXDM");
                        jianyanlb.MOBANMC = jyxx.Get("MBMC");
                        OutObject.MOBANMX.Add(jianyanlb);
                    }
                }
            }
            #endregion
        }
Beispiel #30
0
        public override void ProcessMessage()
        {
            this.OutObject = new ZD_YIYUANXX_OUT();

            string YiYuanXXSql = "select YILIAOJGMC,YILIAOJGJS,YILIAOJGDZ from web_yiliaojgxx ";

            DataTable dtYiYuanXX = DBVisitor.ExecuteTable(YiYuanXXSql);

            if (dtYiYuanXX.Rows.Count > 0)
            {
                OutObject.YIYUANMC = dtYiYuanXX.Rows[0]["YILIAOJGMC"].ToString();
                OutObject.YIYUANJS = dtYiYuanXX.Rows[0]["YILIAOJGJS"].ToString();
                OutObject.YIYUANDZ = dtYiYuanXX.Rows[0]["YILIAOJGDZ"].ToString();
            }
            else
            {
                throw new Exception("系统建设中……");
            }
        }