Пример #1
0
        /// <summary>
        /// 打印自助挂号
        /// </summary>
        private void PrintReport(DataSet ds)
        {
            ds.WriteXml(Application.StartupPath + @"\\ReportXml\\自助挂号" + ds.Tables[0].Rows[0]["REGISTERID"].ToString() + ".xml");
            string path = Application.StartupPath + @"\\Reports\\自助挂号.frx";

            if (System.IO.File.Exists(path) == false)
            {
                SkynetMessage.MsgInfo("自助挂号票据不存在,请联系管理员!");
                return;
            }
            //Common_XH theCamera_XH = new Common_XH();
            //theCamera_XH.DoorLightOpen(LightTypeenum.凭条, LightOpenTypeenum.闪烁);
            PrintManager print = new PrintManager();

            print.InitReport("自助挂号");
            print.AddParam("医院名称", SysOperatorInfo.CustomerName);
            print.AddParam("姓名", SkyComm.eCardAuthorizationData.Tables[0].Rows[0]["PATIENTNAME"].ToString());
            print.AddParam("卡余额", SkyComm.cardBlance);
            print.AddParam("操作员", SysOperatorInfo.OperatorCode);
            print.AddParam("操作员姓名", SysOperatorInfo.OperatorName);
            print.AddData(ds.Tables[0], "report");
            PrintManager.CanDesign = false;
            //print.PreView();
            print.Print();
            print.Dispose();
            Thread.Sleep(100);
        }
        private void PrintSendCardReport(DataSet eLCardAuthorizationData, string patientName)
        {
            eLCardAuthorizationData.WriteXml(Application.StartupPath + @"\\ReportXml\\自助发卡凭证" + eLCardAuthorizationData.Tables[0].Rows[0]["DIAGNOSEID"].ToString() + ".xml");
            string path = Application.StartupPath + @"\\Reports\\自助发卡凭证.frx";

            if (System.IO.File.Exists(path) == false)
            {
                SkynetMessage.MsgInfo("自助发卡凭证不存在,请联系管理员!");
                return;
            }
            Skynet.LoggingService.LogService.GlobalInfoMessage("打印发卡证证");

            decimal decYJ = 0;
            string  stryj = SkyComm.getvalue("发卡工本费");

            if (string.IsNullOrEmpty(stryj) || stryj == "0")
            {
                decYJ = Convert.ToDecimal(SkyComm.dsCardType.Tables[0].Rows[0]["FEES"].ToString());
            }
            else
            {
                decYJ = Convert.ToDecimal(stryj);
            }

            //Common_XH theCamera_XH = new Common_XH();
            //theCamera_XH.DoorLightOpen(LightTypeenum.凭条, LightOpenTypeenum.闪烁);
            PrintManager print = new PrintManager();

            print.InitReport("自助发卡凭证");
            print.AddParam("医院名称", SysOperatorInfo.CustomerName);
            print.AddParam("姓名", patientName);
            print.AddParam("卡押金", decYJ);
            print.AddParam("操作员", SysOperatorInfo.OperatorCode);
            print.AddParam("操作员姓名", SysOperatorInfo.OperatorName);
            print.AddData(eLCardAuthorizationData.Tables[0], "report");
            //PrintManager.CanDesign = true;
            print.Print();
            print.Dispose();
            Thread.Sleep(100);
        }
Пример #3
0
        private void PrintInfo(string ReportName, string strTRANSACTION_ID, string Money, string advanceid)
        {
            try
            {
                MoneyTransferPresenter moneyTransferPresenter = new MoneyTransferPresenter();



                //CardSavingFacade cardSavingFacade = new CardSavingFacade();
                //DataSet cardSavingData = cardSavingFacade.FindByPrimaryKey(strTRANSACTION_ID);
                if (inHosData.Tables[0].Rows.Count > 0)
                {
                    moneyTransferPresenter.addDatas(inHosData, advanceid, "现金");
                    inHosData.WriteXml(Application.StartupPath + @"\\ReportXml\\" + ReportName + SkyComm.DiagnoseID + "_" + strTRANSACTION_ID + ".xml");
                    if (!File.Exists(Application.StartupPath + @"\\Reports\\" + ReportName + ".frx"))
                    {
                        SkynetMessage.MsgInfo(ReportName + ".frx报表文件不存在,无法打印.");
                        return;
                    }
                    decimal old_YE  = Convert.ToDecimal(inHosData.Tables[0].Rows[0]["BALANCEMONEY"].ToString());
                    decimal reMoney = Convert.ToDecimal(Money);

                    //Common_XH theCamera_XH = new Common_XH();
                    //theCamera_XH.DoorLightOpen(LightTypeenum.凭条, LightOpenTypeenum.闪烁);
                    PrintManager print = new PrintManager();
                    print.InitReport(ReportName);
                    print.AddParam("医院名称", SysOperatorInfo.CustomerName);
                    print.AddParam("收据号", strTRANSACTION_ID);
                    print.AddParam("姓名", SkyComm.eCardAuthorizationData.Tables[0].Rows[0]["PATIENTNAME"].ToString());
                    print.AddParam("预交金余额", (old_YE + reMoney).ToString("0.00##"));
                    print.AddParam("充值金额", Money);
                    print.AddParam("操作员", SysOperatorInfo.OperatorCode);
                    print.AddParam("操作员姓名", SysOperatorInfo.OperatorName);
                    print.AddData(inHosData.Tables[0], "report");

                    //PrintManager.CanDesign = true;

                    print.Print();
                    print.Dispose();
                    Thread.Sleep(100);
                }
            }
            catch (Exception lex)
            {
                if (lex.Message.IndexOf("灾难性") > 0)
                {
                    SkynetMessage.MsgInfo(lex.Message + ": 打印机连接失败,请检查!");
                }
                else
                {
                    SkynetMessage.MsgInfo(lex.Message);
                }
            }
        }
Пример #4
0
        private void PrintInfo(string ReportName, string strTRANSACTION_ID, string Money)
        {
            try
            {
                CardAuthorizationData   eCardAuthorizationData   = new CardAuthorizationData();
                CardAuthorizationFacade eCardAuthorizationFacade = new CardAuthorizationFacade();
                eCardAuthorizationData = (CardAuthorizationData)eCardAuthorizationFacade.SelectPatientAndCardInfoByCardID(SkyComm.cardInfoStruct.CardNo);
                string           identity         = eCardAuthorizationData.Tables["T_CARD_AUTHORIZATION"].Rows[0][CardAuthorizationData.T_CARD_AUTHORIZATION_IDENTITYCARD].ToString();
                CardSavingFacade cardSavingFacade = new CardSavingFacade();
                DataSet          cardSavingData   = cardSavingFacade.FindByPrimaryKey(strTRANSACTION_ID);

                cardSavingData.Tables[0].Columns.Add("身份证", typeof(string));

                if (cardSavingData.Tables[0].Rows.Count > 0)
                {
                    cardSavingData.Tables[0].Rows[0]["身份证"] = identity;
                    cardSavingData.WriteXml(Application.StartupPath + @"\\ReportXml\\" + ReportName + SkyComm.DiagnoseID + "_" + strTRANSACTION_ID + ".xml");
                    if (!File.Exists(Application.StartupPath + @"\\Reports\\" + ReportName + ".frx"))
                    {
                        SkynetMessage.MsgInfo(ReportName + ".frx报表文件不存在,无法打印.");
                        return;
                    }
                    PrintManager print = new PrintManager();
                    print.InitReport(ReportName);
                    print.AddParam("医院名称", SysOperatorInfo.CustomerName);
                    print.AddParam("收据号", strTRANSACTION_ID);
                    print.AddParam("姓名", SkyComm.eCardAuthorizationData.Tables[0].Rows[0]["PATIENTNAME"].ToString());
                    print.AddParam("卡余额", SkyComm.cardBlance);
                    print.AddParam("充值金额", Money);
                    print.AddParam("操作员", SysOperatorInfo.OperatorCode);
                    print.AddParam("操作员姓名", SysOperatorInfo.OperatorName);
                    print.AddData(cardSavingData.Tables[0], "report");

                    PrintManager.CanDesign = true;

                    print.Print();
                    print.Dispose();
                    Thread.Sleep(100);
                }
            }
            catch (Exception lex)
            {
//                if (lex.Message.IndexOf("灾难性") > 0)
//                {
//                    SkynetMessage.MsgInfo(lex.Message + ": 打印机连接失败,请检查!");
//                }
//                else
//                {
//                    SkynetMessage.MsgInfo(lex.Message);
//                }
            }
        }
        private void PrintInfo(string ReportName, string strTRANSACTION_ID, string Money)
        {
            try
            {
                CardSavingFacade cardSavingFacade = new CardSavingFacade();
                DataSet          cardSavingData   = cardSavingFacade.FindByPrimaryKey(strTRANSACTION_ID);
                if (cardSavingData.Tables[0].Rows.Count > 0)
                {
                    cardSavingData.WriteXml(Application.StartupPath + @"\\ReportXml\\" + ReportName + SkyComm.DiagnoseID + "_" + strTRANSACTION_ID + ".xml");
                    if (!File.Exists(Application.StartupPath + @"\\Reports\\" + ReportName + ".frx"))
                    {
                        SkynetMessage.MsgInfo(ReportName + ".frx报表文件不存在,无法打印.");
                        return;
                    }
                    //Common_XH theCamera_XH = new Common_XH();
                    //theCamera_XH.DoorLightOpen(LightTypeenum.凭条, LightOpenTypeenum.闪烁);
                    PrintManager print = new PrintManager();
                    print.InitReport(ReportName);
                    print.AddParam("医院名称", SysOperatorInfo.CustomerName);
                    print.AddParam("收据号", strTRANSACTION_ID);
                    print.AddParam("姓名", SkyComm.eCardAuthorizationData.Tables[0].Rows[0]["PATIENTNAME"].ToString());
                    print.AddParam("卡余额", SkyComm.cardBlance);
                    print.AddParam("充值金额", Money);
                    print.AddParam("操作员", SysOperatorInfo.OperatorCode);
                    print.AddParam("操作员姓名", SysOperatorInfo.OperatorName);
                    print.AddData(cardSavingData.Tables[0], "report");

                    PrintManager.CanDesign = true;

                    print.Print();
                    print.Dispose();
                    Thread.Sleep(100);
                }
            }
            catch (Exception lex)
            {
                if (lex.Message.IndexOf("灾难性") > 0)
                {
                    SkynetMessage.MsgInfo(lex.Message + ": 打印机连接失败,请检查!");
                }
                else
                {
                    SkynetMessage.MsgInfo(lex.Message);
                }
            }
        }
Пример #6
0
        private void PrintReport(DataSet ds, string strCK, DataSet ds1)
        {
            for (int i = ds1.Tables[0].Rows.Count - 1; i >= 0; i--)
            {
                if ("False" == ds1.Tables[0].Rows[i]["PITCHON1"].ToString())
                {
                    ds1.Tables[0].Rows.RemoveAt(i);
                }
            }



            ds1.WriteXml(Application.StartupPath + @"\\ReportXml\\自助扣费凭证" + ds.Tables[0].Rows[0]["REGISTERID"].ToString() + ".xml");
            string path = Application.StartupPath + @"\\Reports\\自助扣费凭证.frx";

            if (System.IO.File.Exists(path) == false)
            {
                //SkynetMessage.MsgInfo("自助挂号票据不存在,请联系管理员!");
                SkyComm.ShowMessageInfo("自助扣费凭证不存在,请联系管理员!");
                return;
            }

            //Common_XH theCamera_XH = new Common_XH();
            //theCamera_XH.DoorLightOpen(LightTypeenum.凭条, LightOpenTypeenum.闪烁);
            PrintManager print = new PrintManager();

            print.InitReport("自助扣费凭证");
            print.AddParam("医院名称", SysOperatorInfo.CustomerName);
            print.AddParam("姓名", lblxm.Text);
            print.AddParam("卡余额", SkyComm.cardBlance);
            print.AddParam("操作员", SysOperatorInfo.OperatorCode);
            print.AddParam("操作员姓名", SysOperatorInfo.OperatorName);
            print.AddParam("窗口号", strCK);
            print.AddData(ds1.Tables[0], "report");
            PrintManager.CanDesign = true;
            print.Print();
            print.Dispose();
            Thread.Sleep(100);
        }
Пример #7
0
        private void btnBalance_Click(object sender, EventArgs e)
        {
            QuerySolutionFacade querySolutionFacade = new QuerySolutionFacade();
            DetailAccountFacade detailAccountFacade = new DetailAccountFacade();
            string mechinNo = string.Empty;

            try
            {
                #region 获取ip
                string ipAddress = null;
                try
                {
                    string      hostName = Dns.GetHostName();
                    IPHostEntry ipEntry  = Dns.GetHostEntry(hostName);
                    for (int i = 0; i < ipEntry.AddressList.Length; i++)
                    {
                        if (ipEntry.AddressList[i].AddressFamily == AddressFamily.InterNetwork)
                        {
                            ipAddress = ipEntry.AddressList[i].ToString();
                        }
                    }
                }
                catch (Exception ex)
                {
                    SkyComm.ShowMessageInfo(ex.Message);
                    return;
                }

                #endregion
                #region 获取机器码
                string    sql1       = "select * from T_AUTOSERVICEMACHINE_INFO where IPADDRESS = @IPADDRESS";
                Hashtable hashtable1 = new Hashtable();
                hashtable1.Add("@IPADDRESS", ipAddress);
                DataSet dataSet = querySolutionFacade.ExeQuery(sql1, hashtable1);

                if (dataSet.Tables[0].Rows.Count > 0)
                {
                    mechinNo = dataSet.Tables[0].Rows[0]["MACHINENO"].ToString();
                }
                #endregion


                #region 判断结算


                Hashtable hashtablejs = new Hashtable();

                string sqljs = "select * from SETTLEMENT_RECORD where MECHINNO = @MECHINNO";// and BANKSTATE = '1'
                hashtablejs.Add("@MECHINNO", mechinNo);



                DataSet dataSet1 = querySolutionFacade.ExeQuery(sqljs, hashtablejs);

                if (dataSet1.Tables[0].Rows.Count > 0)
                {
                    if (dataSet1.Tables[0].Rows[0]["SETTLEMENT_TIME"].ToString().Equals(DateTime.Now.ToString("yyyy-MM-dd")))
                    {
                        SkyComm.ShowMessageInfo("此台机器已经结算过");
                        return;
                    }
                    else
                    {
                    }
                }

                #endregion



                #region 获取结算时间
                string MBeginTime = DateTime.Now.ToLocalTime().ToString();;
                string MEndTime   = DateTime.Now.ToLocalTime().ToString();;

                string    sql3       = "select * from SETTLEMENT_TIME where M_NO = @M_NO";
                Hashtable hashtable3 = new Hashtable();
                hashtable3.Add("@M_NO", mechinNo);
                DataSet dataSet3 = querySolutionFacade.ExeQuery(sql3, hashtable3);
                if (dataSet3.Tables[0].Rows.Count > 0)
                {
                    MBeginTime = dataSet3.Tables[0].Rows[0]["TIMES"].ToString();
                }



                #endregion


                #region 获取现金记录
                string    sql2       = "select * from T_AUTOINMONEY_RECORD where MACHINENO = @MACHINENO and OPERATORTIME between @starttime and @endtime";
                Hashtable hashtable2 = new Hashtable();
                hashtable2.Add("@MACHINENO", mechinNo);

                hashtable2.Add("@starttime", MBeginTime);
                hashtable2.Add("@endtime", MEndTime);
                DataSet dataSet2 = querySolutionFacade.ExeQuery(sql2, hashtable2);

                if (dataSet2.Tables[0].Rows.Count == 0)
                {
                    SkyComm.ShowMessageInfo("此台机器没有结算信息,已经记录结算时间");
                }
                else
                {
                    dataSet2.WriteXml(Application.StartupPath + @"\\ReportXml\\自助机结算.xml");
                    string       path  = Application.StartupPath + @"\\Reports\\自助机结算.frx";
                    PrintManager print = new PrintManager();
                    print.InitReport("自助机结算");
                    print.AddParam("结算时间", DateTime.Now.ToLocalTime().ToString());
                    print.AddData(dataSet2.Tables[0], "report");
                    PrintManager.CanDesign = true;
                    print.Print();
                    print.Dispose();
                }


                #endregion
            }
            catch (Exception e1)
            {
                SkyComm.ShowMessageInfo(e1.Message);
                return;
            }


            #region 记录结算



            DataSet data = new DataSet();

            Hashtable hashtable = new Hashtable();

            string mSql = "delete from SETTLEMENT_RECORD where MECHINNO = @MECHINNO";// and BANKSTATE = '1'
            hashtable.Add("@MECHINNO", mechinNo);



            querySolutionFacade.ExeNonQuery(mSql, hashtable);



            string sql = "insert into SETTLEMENT_RECORD values (@SETTLEMENT_TIME,'已结算',@MECHINNO);";
            hashtable.Add("@SETTLEMENT_TIME", DateTime.Now.ToString("yyyy-MM-dd"));


            data = querySolutionFacade.ExeQuery(sql, hashtable);
            #endregion


            #region 记录结算时间
            string    sql4       = "delete from SETTLEMENT_TIME where M_NO = @M_NO";
            Hashtable hashtable4 = new Hashtable();
            hashtable4.Add("@M_NO", mechinNo);
            int       a          = querySolutionFacade.ExeNonQuery(sql4, hashtable4);
            string    sql5       = "insert into SETTLEMENT_TIME values (@TIMES,@M_NO)";
            Hashtable hashtable5 = new Hashtable();
            hashtable5.Add("@TIMES", DateTime.Now.ToLocalTime().ToString());
            hashtable5.Add("@M_NO", mechinNo);
            int b = querySolutionFacade.ExeNonQuery(sql5, hashtable5);

            #endregion



            SkyComm.ShowMessageInfo("现金结算成功");

            //_mSquareAccountsPresenter = new SquareAccountsPresenter(this);

            //_mSquareAccountsPresenter.GetSquareAccount();
        }
Пример #8
0
        /// <summary>
        ///chenqiang 2018.04.20 add by Case:31026   打印电子健康卡二维码
        /// </summary>
        /// <param name="imgData">电子健康卡二维码base64数据</param>
        private void printVirtualCard(HealthCardInfoStruct Entity)

        {
            try
            {
                string       path  = Application.StartupPath + @"\\Reports\\电子卡二维码.frx";
                PrintManager print = new PrintManager();
                if (System.IO.File.Exists(path) == true)
                {
                    using (PrintManager report = new PrintManager())
                    {
                        DataTable dtQRCode = new DataTable("reportQR");
                        if (Entity.imgData != "" && Entity.imgData != null)
                        {
                            byte[] bytesImg = Convert.FromBase64String(Entity.imgData);//字符串转换为字节
                            dtQRCode.Columns.Add("QRCode", typeof(byte[]));
                            DataRow drQrCode = dtQRCode.NewRow();
                            drQrCode["QRCode"] = bytesImg;
                            dtQRCode.Rows.Add(drQrCode);
                        }
                        else
                        {
                            dtQRCode.Columns.Add("QRCode", typeof(string));
                            DataRow drQrCode = dtQRCode.NewRow();
                            drQrCode["QRCode"] = Entity.QRCode;
                            dtQRCode.Rows.Add(drQrCode);
                        }
                        string cardType = string.Empty;
                        if (Entity.QRCode.IndexOf("EH") == 0)
                        {
                            cardType = "1";
                        }
                        else if (Entity.QRCode.IndexOf("EM") == 0)
                        {
                            cardType = "2";
                        }
                        else
                        {
                            cardType = "0";
                        }
                        print.InitReport("电子卡二维码");
                        print.AddParam("二维码", Entity.QRCode);
                        print.AddDataSet(dtQRCode, "电子卡二维码");
                        print.AddVariable("姓名", IdInfo.Name);
                        print.AddVariable("性别", IdInfo.Sex);
                        print.AddVariable("年龄", "");
                        print.AddVariable("出生日期", IdInfo.Birthday);
                        string idNumber = IdInfo.Number;
                        print.AddVariable("身份证号", idNumber);
                        print.AddVariable("卡类型", cardType);
                        PrintManager.CanDesign = true;
                        //print.PreView();
                        print.Print();
                        print.Dispose();
                    }
                }
                else
                {
                    SkynetMessage.MsgInfo("系统没有找到报表文件“电子卡二维码.frx”!");
                }
            }
            catch (Exception lex)
            {
                if (lex.Message.IndexOf("灾难性") > 0)
                {
                    SkynetMessage.MsgInfo(lex.Message + ": 打印机连接失败,请检查!");
                }
                else
                {
                    SkynetMessage.MsgInfo(lex.Message);
                }
            }
        }
        private void lblClinicEmrPrint_Click(object sender, EventArgs e)
        {
            try
            {
                this.ucTime1.timer1.Stop();
                ClinicBriefemrData emr = listEmr.Find(a => a.PITCHON == true);
                if (emr == null)
                {
                    SkyComm.ShowMessageInfo("请选择您要打印的门诊病历信息");
                    return;
                }
                if (false == System.IO.File.Exists(Application.StartupPath + @"\\Reports\\门诊病历.frx"))
                {
                    SkyComm.ShowMessageInfo("系统没有找到报表文件“门诊病历.frx”!");
                    return;
                }
                ClinicPhysicianRecipeFacade recipeFacade = new ClinicPhysicianRecipeFacade();
                ClinicPhysicianRecipeData   RecipeData   = (ClinicPhysicianRecipeData)recipeFacade.FindRecipeInfoRepForReprint(emr.DiagnoseId, emr.Registerid);
                ClinicPhysicianRecipeData   dsTmp        = (ClinicPhysicianRecipeData)RecipeData.Clone();
                ClinicPhysicianRecipeData   dsTmpCheck   = (ClinicPhysicianRecipeData)RecipeData.Clone();
                string          item_Tmp    = string.Empty;
                string          item        = string.Empty;
                string          item2       = string.Empty;
                string          item3       = string.Empty;
                string          item4       = string.Empty;
                ClinicEmrFacade cef         = new ClinicEmrFacade();
                DataSet         CEFData     = cef.GetSchedulInfo(emr.DiagnoseId, emr.Registerid);
                string          ACCEPTSTIME = string.Empty;
                foreach (DataRow dsr in CEFData.Tables[0].Rows)
                {
                    if (dsr["ACCEPTSTIME"].ToString() != "")
                    {
                        ACCEPTSTIME = dsr["ACCEPTSTIME"].ToString();
                    }
                    else
                    {
                        ACCEPTSTIME = "";
                    }
                }
                foreach (DataRow datarow in RecipeData.Tables[0].Rows)
                {
                    if (Convert.ToInt32(datarow["RECIPESTATE"]) == 2)
                    { //过滤退过费
                        continue;
                    }

                    switch (datarow["RECIPETYPE"].ToString())
                    {
                    case "中草药":
                    case "药品费":
                        dsTmp.Tables[0].ImportRow(datarow);
                        break;

                    case "检查":
                        item += datarow["NAME"].ToString() + "    ";
                        dsTmpCheck.Tables[0].ImportRow(datarow);
                        break;

                    case "化验":
                        item2 += datarow["NAME"].ToString() + "    ";
                        dsTmpCheck.Tables[0].ImportRow(datarow);
                        break;

                    case "手术":
                        item3 += datarow["NAME"].ToString() + "    ";
                        dsTmpCheck.Tables[0].ImportRow(datarow);
                        break;

                    case "治疗":
                        datarow["RECIPETYPE"] = "治疗";
                        item4 += datarow["NAME"].ToString() + "    ";
                        dsTmpCheck.Tables[0].ImportRow(datarow);
                        break;
                    }
                }

                dsTmp = Facada(dsTmp);

                item_Tmp = (item == "" ? "" : item + "\r\n") + (item2 == "" ? "" : item2 + "\r\n") + (item3 == "" ? "" : item3 + "\r\n") + (item4 == "" ? "" : item4);
                if (!dsTmp.Tables[0].Columns.Contains("Type"))
                {
                    dsTmp.Tables[0].Columns.Add("Type", typeof(System.String)).DefaultValue = "";
                }


                foreach (DataRow row in dsTmp.Tables[0].Rows)
                {
                    DataSet ds = new MedUsageFacade().FindByMedUsage(row["MEDUSAGE"].ToString());
                    if (ds.Tables[0].Rows.Count > 0 && ds.Tables[0].Rows[0]["TYPE"].ToString().Contains("静滴"))
                    {
                        row["Type"] = "静滴";
                    }
                    if (row["RECIPETYPE"].ToString() == "中草药")
                    {
                        row["DOSE"] = row["AMOUNT"];
                    }
                    foreach (DataColumn dc in dsTmp.Tables[0].Columns)
                    {
                        if (dc.DataType == typeof(System.Decimal))
                        {
                            double decValue = 0;
                            if (double.TryParse(row[dc.ColumnName].ToString(), out decValue))
                            {
                                row[dc.ColumnName] = Convert.ToDouble(decValue).ToString("0.######");
                            }
                        }
                    }
                }

                DataTable tb = dsTmp.Tables[0];
                if (dsTmp.Tables[0].Rows.Count > 0)
                {
                    tb = dsTmp.Tables[0].Select("", "CLINICRECIPEID,GROUPNUM").CopyToDataTable();
                }


                dsTmp.WriteXml(Application.StartupPath + @"\\ReportXML\\门诊病历or治疗建议YP.xml");
                dsTmpCheck.WriteXml(Application.StartupPath + @"\\ReportXML\\门诊病历or治疗建议ZL.xml");

                PatientInfoFacade patientinfo = new PatientInfoFacade();
                DataSet           dataset     = patientinfo.FindPateintByDiagnoseID(emr.DiagnoseId);

                F_DIAGNOSEFacade diagnose = new F_DIAGNOSEFacade();
                DataSet          dataset1 = diagnose.FindByCustomID(emr.DiagnoseId, "DIAGNOSEID");

                PrintManager print = new PrintManager();
                print.InitReport("门诊病历");
                print.AddParam("诊疗号", emr.DiagnoseId);
                print.AddParam("挂号号", emr.Registerid);
                print.AddParam("PATIENTNAME", emr.PATIENTNAME); //姓名  PATIENTNAME
                print.AddParam("SEX", emr.SEX);                 //性别   SEX
                print.AddParam("AVOIRDUPOIS", emr.AVOIRDUPOIS); //体重   AVOIRDUPOIS
                print.AddParam("AGE", emr.AGE);                 //年龄   AGE
                print.AddParam("AGEUNIT", emr.AGEUNIT);         //年龄单位
                print.AddParam("费用类别", "");                     //费用类别
                print.AddParam("OPERATETIME", emr.VisitTime);   //就诊时间  VisitTime
                print.AddParam("REGISTEROFFIC", emr.Office);    //就诊科室  office
                print.AddParam("主诉", emr == null ? "" : emr.CaseinChief);
                print.AddParam("病史", emr == null ? "" : emr.Emrcontent);
                print.AddParam("查体", emr == null ? "" : emr.Physical);
                print.AddParam("治疗建议", emr == null ? "" : emr.Notice);
                print.AddParam("临床诊断", emr.DiagResult);                                             //门诊诊断  DiagResult
                print.AddParam("医生", emr.VisitDoctorName);                                          //接诊医生  VisitDoctorName
                print.AddParam("检查", item_Tmp);                                                     //检查
                print.AddParam("过敏史", emr.Allergen);                                                //过敏史
                print.AddParam("TELEPHONE", emr.TELEPHONE);                                         //联系电话
                print.AddParam("ADDRESS", emr.ADDRESS);                                             //地址
                print.AddParam("EMPLOYMENT", emr.EMPLOYMENT);                                       //职业
                print.AddParam("监护人", emr.Guardian);                                                //监护人
                print.AddParam("血压", emr.SystolicPressure + "/" + emr.DiastolicPressure + " mmHg"); //血压
                print.AddParam("ACCEPTSTIME", ACCEPTSTIME.ToString());                              //就诊开始时间 17417
                print.AddParam("医院名称", SysOperatorInfo.CustomerName);                               //医院名称
                print.AddParam("OPERATETIME", emr.VisitTime == null ? "" : emr.VisitTime.ToString());

                if (dataset != null && dataset.Tables[0].Rows.Count > 0)
                {
                    print.AddParam("BIRTHDAY", dataset.Tables[0].Rows[0]["BIRTHDAY"].ToString());             //出生日期
                    print.AddParam("EMPLOYMENT", dataset.Tables[0].Rows[0]["EMPLOYMENT"].ToString());         //职业
                    print.AddParam("MARRIAGESTATUS", dataset.Tables[0].Rows[0]["MARRIAGESTATUS"].ToString()); //婚姻状况
                    print.AddParam("NATION", dataset.Tables[0].Rows[0]["NATION"].ToString());                 //民族
                    //  print.AddParam("ACCEPTSTIME", dataset.Tables[0].Rows[0]["ACCEPTSTIME"].ToString());   //就诊开始时间
                }
                else
                {
                    print.AddParam("BIRTHDAY", "");       //出生日期
                    print.AddParam("EMPLOYMENT", "");     //职业
                    print.AddParam("MARRIAGESTATUS", ""); //婚姻状况
                    print.AddParam("NATION", "");         //民族
                }

                if (dataset1 != null && dataset1.Tables.Count > 0 && dataset1.Tables[0].Rows.Count > 0)
                {
                    print.AddParam("病名", dataset1.Tables[0].Rows[0]["SICKNESSNAME3"].ToString()); //病名
                    print.AddParam("证型", dataset1.Tables[0].Rows[0]["SICKNESS2"].ToString());     //证型
                }
                else
                {
                    print.AddParam("病名", "");   //病名
                    print.AddParam("证型", "");   //证型
                }
                print.AddData(dsTmpCheck.Tables[0], "report1");

                #region 构造病历数据集

                DataTable dt = new DataTable("reportemr");
                dt.Columns.Add("主诉");
                dt.Columns.Add("病史");
                dt.Columns.Add("查体");
                dt.Columns.Add("治疗建议");
                dt.Columns.Add("临床诊断");
                dt.Columns.Add("病名");
                dt.Columns.Add("证型");
                dt.Columns.Add("医生");
                dt.Columns.Add("检查");

                dt.Columns.Add("病生状态");
                dt.Columns.Add("过敏史");
                dt.Columns.Add("TELEPHONE");
                dt.Columns.Add("ADDRESS");
                dt.Columns.Add("EMPLOYMENT");
                dt.Columns.Add("监护人");

                DataRow theNewRow = dt.NewRow();
                theNewRow["主诉"]   = emr == null ? "" : emr.CaseinChief;
                theNewRow["病史"]   = emr == null ? "" : emr.Emrcontent;
                theNewRow["查体"]   = emr == null ? "" : emr.Physical;
                theNewRow["治疗建议"] = emr == null ? "" : emr.Notice;
                theNewRow["临床诊断"] = emr.DiagResult;
                if (dataset1 != null && dataset1.Tables[0].Rows.Count > 0)
                {
                    theNewRow["病名"] = dataset1.Tables[0].Rows[0]["SICKNESSNAME3"].ToString();
                    theNewRow["证型"] = dataset1.Tables[0].Rows[0]["SICKNESS2"].ToString();
                }
                theNewRow["医生"]         = SysOperatorInfo.OperatorName;
                theNewRow["检查"]         = item;
                theNewRow["病生状态"]       = emr.Morbidity;
                theNewRow["过敏史"]        = emr.Allergen;
                theNewRow["TELEPHONE"]  = emr.TELEPHONE;
                theNewRow["ADDRESS"]    = emr.ADDRESS;
                theNewRow["EMPLOYMENT"] = emr.EMPLOYMENT;
                theNewRow["监护人"]        = emr.Guardian;

                dt.Rows.Add(theNewRow);

                dt.WriteXml(Application.StartupPath + @"\\ReportXML\\门诊病历打印病历数据集.xml");

                print.AddData(dt, "reportemr");

                #endregion

                EPadidiographFacade eFacade = new EPadidiographFacade();
                DataSet             eData   = eFacade.GetByUserid(emr.VisitDoctor);
                print.AddData(eData.Tables[0], "dsPic"); //电子签名
                print.AddData(tb, "report");

                PrintManager.CanDesign = true;

                print.Print();
                print.Dispose();
                Thread.Sleep(100);
            }
            catch (Exception ex)
            {
                Skynet.LoggingService.LogService.GlobalInfoMessage("门诊病历打印异常:" + ex.Message);
            }
            finally
            {
                ucTime1.Sec = 60;
                ucTime1.timer1.Start();
            }
        }
        private void lblClinicEmrPrint_Click(object sender, EventArgs e)
        {
            try
            {
                this.ucTime1.timer1.Stop();
                if (false == System.IO.File.Exists(Application.StartupPath + @"\\Reports\\门诊费用清单.frx"))
                {
                    SkyComm.ShowMessageInfo("系统没有找到报表文件“门诊费用清单.frx”!");
                    return;
                }

                this.AnsyWorker(ui =>
                {
                    ui.UpdateTitle("正在准备数据,请稍等...");

                    ui.SynUpdateUI(() =>
                    {
                        #region 查询列表
                        string[] Condition         = { "", "", "", SkyComm.eCardAuthorizationData.Tables[0].Rows[0]["DIAGNOSEID"].ToString(), "", "", "" };
                        DetailAccountFacade facade = new DetailAccountFacade();
                        DateTime dtStart           = Convert.ToDateTime("2016-01-01");
                        DateTime dtEnd             = Convert.ToDateTime("2016-10-11");
                        DataSet ds = facade.QueryPatientPayList(Condition, dtStart, dtEnd);
                        if (ds.Tables[0].Rows.Count > 0)
                        {
                            foreach (DataRow row in ds.Tables[0].Rows)
                            {
                                row["MONEY"] = decimal.Round(decimal.Parse(row["MONEY"].ToString()), 2);
                            }
                        }
                        #endregion
                        if (ds == null || ds.Tables[0].Rows.Count == 0)
                        {
                            SkyComm.ShowMessageInfo("所选时间段内未找到门诊费用信息!");
                            return;
                        }

                        ui.UpdateTitle("正在打印,请稍等...");
                        ds.WriteXml(Application.StartupPath + @"\\ReportXml\\门诊费用清单.xml");
                        PrintManager print = new PrintManager();
                        print.InitReport("门诊费用清单");
                        print.AddData(ds.Tables[0], "report");

                        Hashtable MedType = new Hashtable();
                        foreach (DataRow dr in ds.Tables[0].Rows)
                        {
                            if (dr["MEDICARETYPE"].ToString().Trim() != string.Empty)
                            {
                                if (MedType.ContainsKey("医保" + dr["MEDICARETYPE"].ToString()) == false)
                                {
                                    MedType.Add("医保" + dr["MEDICARETYPE"].ToString(), Convert.ToDecimal(dr["MONEY"]));
                                }
                                else
                                {
                                    MedType["医保" + dr["MEDICARETYPE"].ToString()] = Convert.ToDecimal(MedType["医保" + dr["MEDICARETYPE"].ToString()]) + Convert.ToDecimal(dr["MONEY"]);
                                }
                            }

                            if (dr["NMEDICARETYPE"].ToString().Trim() != string.Empty)
                            {
                                if (MedType.ContainsKey("农保" + dr["NMEDICARETYPE"].ToString()) == false)
                                {
                                    MedType.Add("农保" + dr["NMEDICARETYPE"].ToString(), Convert.ToDecimal(dr["MONEY"]));
                                }
                                else
                                {
                                    MedType["农保" + dr["NMEDICARETYPE"].ToString()] = Convert.ToDecimal(MedType["农保" + dr["NMEDICARETYPE"].ToString()]) + Convert.ToDecimal(dr["MONEY"]);
                                }
                            }
                        }

                        foreach (DictionaryEntry de in MedType)
                        {
                            print.AddParam(de.Key.ToString(), de.Value.ToString());
                        }

                        PrintManager.CanDesign = true;
                        //print.PreView();
                        print.Print();
                        print.Dispose();
                        Thread.Sleep(100);
                    });
                });
            }
            catch (Exception ex)
            {
                Skynet.LoggingService.LogService.GlobalInfoMessage("门诊费用清单打印异常:" + ex.Message);
            }
            finally
            {
                ucTime1.Sec = 60;
                ucTime1.timer1.Start();
            }
        }
Пример #11
0
        private void lblInhosCostListPrint_Click(object sender, EventArgs e)
        {
            try
            {
                this.ucTime1.timer1.Stop();
                //if (!checkPrintCount())
                //{
                //    SkyComm.ShowMessageInfo("此住院费用清单已被打印过,不可再次打印!");
                //    ucTime1.Sec = 60;
                //    ucTime1.timer1.Start();
                //    return;
                //}

                if (false == System.IO.File.Exists(Application.StartupPath + @"\\Reports\\住院费用清单.frx"))
                {
                    SkyComm.ShowMessageInfo("系统没有找到报表文件“住院费用清单.frx”!");
                    ucTime1.Sec = 60;
                    ucTime1.timer1.Start();
                    return;
                }
                this.AnsyWorker(ui =>
                {
                    ui.UpdateTitle("正在打印,请稍等...");

                    ui.SynUpdateUI(() =>
                    {
                        foreach (DataSet dsDetail1 in dsAllDetail)
                        {
                            DataSet dsDetail = dsDetail1.Copy();
                            if (dsDetail.Tables.Count == 0 || dsDetail.Tables[0].Rows.Count == 0)
                            {
                                continue;
                            }
                            dsDetail.WriteXml(Application.StartupPath + @"\\ReportXml\\住院费用清单.xml");
                            dsDetail.Tables[1].Columns.Add("结算日期", typeof(string));
                            dsDetail.Tables[1].Columns.Add("住院天数", typeof(string));
                            dsDetail.Tables[1].Columns.Add("性别", typeof(string));
                            dsDetail.Tables[1].Columns.Add("年龄", typeof(string));
                            dsDetail.Tables[1].Columns.Add("年龄单位", typeof(string));
                            foreach (DataRow dr in dsDetail.Tables[1].Rows)
                            {
                                if (dr["住院号"].ToString().Contains("d"))
                                {
                                    continue;
                                }
                                DataSet dsAccount = new AccountBalanceFacade().FindAccountBalanceInfo(dr["住院号"].ToString(), Convert.ToInt32(dr["住院次数"]));
                                dr["结算日期"]        = Convert.ToDateTime(dsAccount.Tables[0].Rows[0]["LEAVEHOSDATE"]).ToString("yyyy-MM-dd HH:mm:ss");
                                dr["住院天数"]        = dsAccount.Tables[0].Rows[0]["INHOSDAYS"];

                                DataSet dsInhosrecord = new LeaveHosRecordFacade().FindByInHosID(dr["住院号"].ToString(), Convert.ToInt32(dr["住院次数"]));
                                dr["性别"]   = dsInhosrecord.Tables[0].Rows[0]["SEX"];
                                dr["年龄"]   = dsInhosrecord.Tables[0].Rows[0]["AGE"];
                                dr["年龄单位"] = dsInhosrecord.Tables[0].Rows[0]["AGEUNIT"];
                            }
                            PrintManager print = new PrintManager();
                            print.InitReport("住院费用清单");
                            print.AddData(dsDetail.Tables[1], "report1");
                            print.AddData(dsDetail.Tables[0], "report2");

                            print.AddParam("医院名称", SysOperatorInfo.CustomerName);
                            print.AddParam("DATE", new CommonFacade().GetServerDateTime().ToString());
                            print.AddParam("操作员", SysOperatorInfo.OperatorID);
                            print.AddParam("操作员代码", SysOperatorInfo.OperatorCode);
                            PrintManager.CanDesign = true;
                            //print.PreView();
                            print.Print();
                            print.Dispose();
                        }
                        insertPrintCount();
                        Thread.Sleep(100);
                        ucTime1.Sec = 60;
                        ucTime1.timer1.Start();
                    });
                });
            }
            catch (Exception ex)
            {
                Skynet.LoggingService.LogService.GlobalInfoMessage("住院费用清单打印异常:" + ex.Message);
                ucTime1.Sec = 60;
                ucTime1.timer1.Start();
            }
            finally
            {
                //ucTime1.Sec = 60;
                //ucTime1.timer1.Start();
            }
        }
        private void PrintInfo(string ReportName, string strTRANSACTION_ID, string Money, string advanceID, string HisSeqNo)
        {
            try
            {
                MoneyTransferPresenter moneyTransferPresenter = new MoneyTransferPresenter();

//                DataSet dataSet = moneyTransferPresenter.getBankInfo(SkyComm.DiagnoseID);

                if (inHosData.Tables[0].Rows.Count > 0)
                {
                    moneyTransferPresenter.addDatas(inHosData, advanceID, "银行卡");
                    inHosData.WriteXml(Application.StartupPath + @"\\ReportXml\\" + ReportName + SkyComm.DiagnoseID + "_" + strTRANSACTION_ID + ".xml");
                    if (!File.Exists(Application.StartupPath + @"\\Reports\\" + ReportName + ".frx"))
                    {
                        SkynetMessage.MsgInfo(ReportName + ".frx报表文件不存在,无法打印.");
                        return;
                    }
                    decimal old_YE  = Convert.ToDecimal(inHosData.Tables[0].Rows[0]["BALANCEMONEY"].ToString());
                    decimal reMoney = Convert.ToDecimal(Money);
                    //Common_XH theCamera_XH = new Common_XH();
                    //theCamera_XH.DoorLightOpen(LightTypeenum.凭条, LightOpenTypeenum.闪烁);
                    PrintManager print = new PrintManager();
                    print.InitReport(ReportName);
                    print.AddParam("医院名称", SysOperatorInfo.CustomerName);
                    print.AddParam("收据号", strTRANSACTION_ID);
                    print.AddParam("姓名", SkyComm.eCardAuthorizationData.Tables[0].Rows[0]["PATIENTNAME"].ToString());
                    print.AddParam("预交金余额", (old_YE + reMoney).ToString("0.00##"));
                    print.AddParam("充值金额", Money);
                    print.AddParam("操作员", SysOperatorInfo.OperatorCode);
                    print.AddParam("操作员姓名", SysOperatorInfo.OperatorName);

                    if (AutoHostConfig.PosInterfaceType.Equals("锡盟新利"))//锡盟新利增加输出参数
                    {
                        //锡盟自助机打印增加哦交易参考号
                        DataSet dataSet = moneyTransferPresenter.getBankInfo(SkyComm.DiagnoseID, HisSeqNo);
                        if (dataSet.Tables[0].Rows.Count > 0)
                        {
                            print.AddParam("交易参考号", (dataSet.Tables[0]).Rows[0]["OHISSEQNO"].ToString());
                        }
                    }
                    print.AddData(inHosData.Tables[0], "report");

                    //PrintManager.CanDesign = true;

                    print.Print();
                    print.Dispose();
                    Thread.Sleep(100);
                }
            }
            catch (Exception lex)
            {
                if (lex.Message.IndexOf("灾难性") > 0)
                {
                    SkynetMessage.MsgInfo(lex.Message + ": 打印机连接失败,请检查!");
                }
                else
                {
                    SkynetMessage.MsgInfo(lex.Message);
                }
            }
        }