Example #1
0
        /// <summary>
        /// 得到只有发药记录的病人
        /// </summary>
        /// <param name="CureDeptCode"></param>
        /// <returns></returns>
        private static List <ZY_PatList> OperPatInfo(string YfCode, string CureDeptCode)
        {
            ZY_PatList zypl = new ZY_PatList(oleDb);

            List <ZY_PatList> zyPL = null;
            BindPatListVal    bplv = new BindPatListVal();

            if (CureDeptCode == null)
            {
                bplv.IsIn            = true;
                zypl.bindPatListVal  = bplv;
                zypl.bindPatListType = BindPatListType.住院病人列表;
                zyPL = zypl.BindPatList();
            }
            else
            {
                bplv.IsIn            = true;
                bplv.DeptCode        = CureDeptCode.ToString();
                zypl.bindPatListVal  = bplv;
                zypl.bindPatListType = BindPatListType.住院病人列表;
                zyPL = zypl.BindPatList();
            }
            zyPL.RemoveAll(delegate(ZY_PatList x)
            {
                DataTable dt = GetPatPresInfo(x.PatListID, YfCode);
                if (dt == null || dt.Rows.Count == 0)
                {
                    return(true);
                }
                return(false);
            });
            return(zyPL);
        }
Example #2
0
        private void GetPatList(string deptcode)
        {
            ZY_PatList     zy_Patlist = new ZY_PatList();
            BindPatListVal bplv       = new BindPatListVal();

            bplv.IsIn                  = true;
            bplv.DeptCode              = deptcode;
            bplv.IsOperation           = IsOper;
            zy_Patlist.bindPatListVal  = bplv;
            zy_Patlist.bindPatListType = BindPatListType.费用清单病人列表;
            List <ZY_PatList> zyPatList = zy_Patlist.BindPatList();

            RecDt.Rows.Clear();

            for (int i = 0; i < zyPatList.Count; i++)
            {
                DataRow dr = RecDt.NewRow();
                dr["patlistid"] = zyPatList[i].PatListID.ToString();
                dr["cureno"]    = zyPatList[i].CureNo;
                dr["bedcode"]   = zyPatList[i].BedCode;
                dr["Name"]      = zyPatList[i].patientInfo.PatName;
                dr["py_code"]   = zyPatList[i].patientInfo.PYM;
                dr["wb_code"]   = zyPatList[i].patientInfo.WBM;
                RecDt.Rows.Add(dr);
            }
            this.tbPatname.SetSelectionCardDataSource(RecDt);
        }
Example #3
0
        /// <summary>
        /// 得到病人信息
        /// </summary>
        /// <param name="IsIn">是否在院</param>
        /// <param name="deptId">病人所在科室</param>
        /// <returns></returns>
        public static List <HIS.Model.ZY_PatList> GetPatInfo(bool IsIn, int deptId)
        {
            ZY_PatList     zypl = new ZY_PatList();
            BindPatListVal bplv = new BindPatListVal();

            bplv.IsIn            = IsIn;
            bplv.DeptCode        = deptId.ToString();
            zypl.bindPatListVal  = bplv;
            zypl.bindPatListType = BindPatListType.住院病人列表;
            return(Charge(zypl.BindPatList()));
        }
Example #4
0
        /// <summary>
        /// 绑定病人列表
        /// </summary>
        /// <returns></returns>
        private List <ZY_PatList> BindLvPatList()
        {
            BindPatListVal bplv = new BindPatListVal();

            bplv.IsIn                 = view.searchPatList.rbIn;
            bplv.DeptCode             = view.searchPatList.DeptCode;
            bplv.Bdate                = view.searchPatList.Bdate;
            bplv.Edate                = view.searchPatList.Edate;
            zy_Patlist.bindPatListVal = bplv;
            return(zy_Patlist.BindPatList());
        }
Example #5
0
        // 绑定病人列表
        private void BindLvPatList1(bool b)
        {
            this.lvPatList.Items.Clear();

            //List<ZY_PatList> zypatlist = null;
            if (b == true)
            {
                zypatlist = zy_PatList.BindPatList();
            }

            for (int i = 0; i < zypatlist.Count; i++)
            {
                ListViewItem lstViewItem = new ListViewItem();
                lstViewItem.SubItems.Clear();
                lstViewItem.Tag = zypatlist[i];
                lstViewItem.SubItems[0].Text = zypatlist[i].CureNo;
                lstViewItem.SubItems.Add(zypatlist[i].patientInfo.PatName);
                lstViewItem.SubItems.Add(zypatlist[i].patientInfo.PatSex);
                lstViewItem.SubItems.Add(zypatlist[i].patientInfo.PatBriDate.ToString("yyyy-MM-dd"));
                this.lvPatList.Items.Add(lstViewItem);
            }
        }
Example #6
0
        //绑定病人列表
        private void BindLvPatList()
        {
            string DeptCode = null;
            string CureNo   = null;
            string PatName  = null;

            DateTime?Bdate = null;
            DateTime?Edate = null;

            bool IsIn = true;

            if (this.chbDept.Checked)
            {
                DeptCode = this.cbDept.SelectedValue.ToString().Trim();
            }

            if (this.checkBox3.Checked)
            {
                CureNo = this.tbInpatNo.Text;
            }

            if (this.checkBox4.Checked)
            {
                PatName = this.textBox1.Text.Trim();
            }

            if (this.checkBox2.Checked)
            {
                Bdate = this.dtpBdate.Value;
                Edate = this.dtpEdate.Value;
            }

            IsIn = this.cb_pattype.SelectedIndex == 0 ? true : false;

            this.lvPatList.Items.Clear();

            List <ZY_PatList> zypatlist = null;

            //ZY_PatList zy_Patlist = new ZY_PatList();
            BindPatListVal bplv = new BindPatListVal();

            bplv.IsIn                  = IsIn;
            bplv.DeptCode              = DeptCode;
            bplv.Bdate                 = Bdate;
            bplv.Edate                 = Edate;
            bplv.CureNo                = CureNo;
            bplv.PatName               = PatName;
            bplv.IsCost                = this.cb_pattype.SelectedIndex == 1 ? true : false;
            zy_PatList.bindPatListVal  = bplv;
            zy_PatList.bindPatListType = BindPatListType.费用清单病人列表;
            zypatlist                  = zy_PatList.BindPatList();
            if (zypatlist.Count == 0)
            {
                MessageBox.Show("未找到任何病人!");
                return;
            }
            IcostManager icM = ObjectFactory.GetObject <IcostManager>(typeof(ZY_CostMaster));

            for (int i = 0; i < zypatlist.Count; i++)
            {
                bool b = true;//false 欠费病人

                ListViewItem lstViewItem = new ListViewItem();
                lstViewItem.SubItems.Clear();
                lstViewItem.Tag = zypatlist[i];
                lstViewItem.SubItems[0].Text = zypatlist[i].CureNo;
                lstViewItem.SubItems.Add(zypatlist[i].BedCode);
                lstViewItem.SubItems.Add(zypatlist[i].patientInfo.PatName);
                lstViewItem.SubItems.Add(zypatlist[i].patientInfo.PatSex);

                if (zypatlist[i].PatType == "4" || zypatlist[i].PatType == "5")
                {
                    icM = icM.GetCostMaster(zypatlist[i].PatListID);
                    lstViewItem.SubItems.Add(icM.Deptosit_Fee.ToString());
                    lstViewItem.SubItems.Add(icM.Total_Fee.ToString());//HIS.ZY_BLL.OP_CostManage.GetSumVillage_Fee(zypatlist[i].PatListID).ToString("0.00"));
                    lstViewItem.SubItems.Add(Convert.ToString(icM.Deptosit_Fee - icM.Total_Fee));
                }
                else
                {
                    icM.PatListID = zypatlist[i].PatListID;
                    PatFee patFee = icM.GetPatFee();

                    lstViewItem.SubItems.Add(patFee.chargeFee.ToString());
                    lstViewItem.SubItems.Add(patFee.costFee.ToString());
                    lstViewItem.SubItems.Add(patFee.surplusFee.ToString());
                    if (patFee.surplusFee < 0)
                    {
                        b = false;//欠费病人
                    }
                }
                lstViewItem.SubItems.Add(zypatlist[i].patientInfo.PatBriDate.ToString("yyyy-MM-dd"));
                lstViewItem.SubItems.Add(BaseNameFactory.GetName(baseNameType.科室名称, zypatlist[i].CurrDeptCode));
                lstViewItem.SubItems.Add(zypatlist[i].patientInfo.ACCOUNTTYPE);
                lstViewItem.SubItems.Add(zypatlist[i].CureDate.Date.ToString("yyyy-MM-dd"));
                string strOutDate = zypatlist[i].OutDate.Date.ToString("yyyy-MM-dd");
                strOutDate = strOutDate == "0001-01-01" ? "至今" : strOutDate;
                lstViewItem.SubItems.Add(strOutDate);
                if (zypatlist[i].OutDate.ToString("yyyy-MM-dd") == "0001-01-01")
                {
                    //this.tbNum.Text = ts.Days.ToString();
                    lstViewItem.SubItems.Add("0");
                }
                else
                {
                    TimeSpan ts = zypatlist[i].OutDate - zypatlist[i].CureDate;
                    lstViewItem.SubItems.Add(ts.Days.ToString());
                }

                //[20100624.1.10]
                if (this.cbQF.Checked == true)//欠费病人显示
                {
                    if (b == false)
                    {
                        this.lvPatList.Items.Add(lstViewItem);
                    }
                }
                else
                {
                    this.lvPatList.Items.Add(lstViewItem);
                }
            }
        }
        //绑定数据PresOrder所有数据(StatType:0.大输液 1.药品 2. 手术)
        //update 20091124 StatType:0.非口服 1.口服 2. 手术
        private void BindData(string deptcode, bool IsDrug, int StatType)
        {
            //加载病人信息
            dsMessageData.dtPatInfo.Rows.Clear();
            ZY_PatList     zy_Patlist = new ZY_PatList();
            BindPatListVal bplv       = new BindPatListVal();

            bplv.IsIn     = true;
            bplv.DeptCode = deptcode;
            //[20100514.1.04]
            bplv.IsOperation           = IsOper;
            zy_Patlist.bindPatListVal  = bplv;
            zy_Patlist.bindPatListType = BindPatListType.费用清单病人列表;
            List <ZY_PatList> zyPatList = zy_Patlist.BindPatList();

            //zyPatList = zyPatList.FindAll(delegate(ZY_PatList y) { return (y.BedCode.Trim() != ""); });
            //zyPatList.Sort();
            for (int i = 0; i < zyPatList.Count; i++)
            {
                DataRow dr = dsMessageData.dtPatInfo.NewRow();
                dr["XD"]        = false;
                dr["CureNo"]    = zyPatList[i].CureNo;
                dr["PatName"]   = zyPatList[i].patientInfo.PatName;
                dr["Sex"]       = zyPatList[i].patientInfo.PatSex;
                dr["BedCode"]   = zyPatList[i].BedCode;
                dr["CureDate"]  = zyPatList[i].CureDate;
                dr["patlistid"] = zyPatList[i].PatListID;
                dsMessageData.dtPatInfo.Rows.Add(dr);
            }
            //dsMessageData.dtPatInfo.OrderBy(x =>Convert.ToInt32(x.BedCode));
            string yfcode = this.comboBox1.SelectedValue.ToString().Trim();

            data[2] = yfcode;
            data[3] = IsDrug ? "1" : "0";
            data[4] = StatType.ToString();
            data[7] = StatType.ToString();
            //加载账单信息
            string strWhere = "prestype in ('0', '1','2','3') and charge_flag=1 and cost_flag=0 and execdeptcode='" + yfcode + "' ";

            //加载未发药的信息drug_flag=0,发药后为1
            //冲账的药品未退药的drug_flag=1,退药后改为0
            //未发药的费用冲账drug_flag=0 ,oldid 关联
            if (IsDrug)//发药
            {
                strWhere += " and RECORD_FLAG in (0,1) and DRUG_FLAG=0 ";
                if (StatType == 2)//手术用药
                {
                    strWhere += " and ORDER_ID=0 ";
                }
                if (StatType == 0)//非口服
                {
                    strWhere += " and ORDER_ID!=0 and (select count(*) from zy_doc_orderrecord b where b.order_id=zy_presorder.order_id and b.order_usage in (select name from BASE_USAGEDICTION where id not in( select distinct USAGE_ID  from DB2INST2.BASE_USAGE_USETYPE_ROLE where type_name = '服药单')))>0";
                }
                if (StatType == 1)//口服(包括交病人)
                {
                    strWhere += " and ORDER_ID!=0 and (select count(*) from zy_doc_orderrecord b where b.order_id=zy_presorder.order_id and b.order_usage in (select name from BASE_USAGEDICTION where id in( select distinct USAGE_ID  from DB2INST2.BASE_USAGE_USETYPE_ROLE where type_name = '服药单')))>0";
                }
            }
            else//退药
            {
                strWhere += " and RECORD_FLAG=1 and DRUG_FLAG=1 ";
                //if (IsOper)
                //{
                //    strWhere += " and ORDER_ID=0 ";
                //}
                //else
                //{
                //    strWhere += " and ORDER_ID!=0";
                //}
            }

            List <ZY_PresOrder> zyPOList = HIS.ZY_BLL.DurgMessage.OP_DurgMessage.GetPresOrder(strWhere, IsDrug);

            dsMessageData.dtPresOrder.Rows.Clear();
            for (int i = 0; i < zyPOList.Count; i++)
            {
                ZY_PatList zyP = zyPatList.Find(delegate(ZY_PatList y) { return(y.PatListID == zyPOList[i].PatListID); });
                if (zyP != null && (zyP.PatType == "1" || zyP.PatType == "2" || zyP.PatType == "7"))//过滤掉不在院的记录
                {
                    DataRow dr = dsMessageData.dtPresOrder.NewRow();
                    dr["XD"]           = true;
                    dr["PRESORDERID"]  = zyPOList[i].PresOrderID;
                    dr["patlistid"]    = zyPOList[i].PatListID;
                    dr["CureNo"]       = dsMessageData.dtPatInfo.Select("patlistid='" + zyPOList[i].PatListID + "'")[0]["CureNO"];
                    dr["PatName"]      = dsMessageData.dtPatInfo.Select("patlistid='" + zyPOList[i].PatListID + "'")[0]["PatName"];
                    dr["itemid"]       = zyPOList[i].ItemID;
                    dr["itemname"]     = zyPOList[i].ItemName;
                    dr["standard"]     = zyPOList[i].Standard;
                    dr["unit"]         = zyPOList[i].Unit;
                    dr["relationnum"]  = zyPOList[i].RelationNum;
                    dr["buy_price"]    = zyPOList[i].Buy_Price;
                    dr["sell_price"]   = zyPOList[i].Sell_Price;
                    dr["amount"]       = zyPOList[i].Amount;
                    dr["presamount"]   = zyPOList[i].PresAmount;
                    dr["tolal_fee"]    = zyPOList[i].Tolal_Fee;
                    dr["presdoccode"]  = zyPOList[i].PresDocCode;
                    dr["presdeptcode"] = zyPOList[i].PresDeptCode;
                    dr["costdate"]     = zyPOList[i].CostDate;
                    dr["oldid"]        = zyPOList[i].OldID;
                    dr["record_flag"]  = zyPOList[i].Record_Flag;
                    dr["order_id"]     = zyPOList[i].order_id;
                    dr["group_id"]     = zyPOList[i].group_id;

                    dr["order_type"] = zyPOList[i].order_type;
                    dr["BEDNO"]      = dsMessageData.dtPatInfo.Select("patlistid='" + zyPOList[i].PatListID + "'")[0]["BedCode"];
                    dr["CHARGECODE"] = zyPOList[i].ChargeCode;
                    dr["DT_State"]   = "";
                    dsMessageData.dtPresOrder.Rows.Add(dr);
                }
            }

            //加载统领信息
        }