private void btnQuery_Click(object sender, EventArgs e) { try { this.Cursor = GWMHIS.BussinessLogicLayer.Classes.PublicStaticFun.WaitCursor(); _currentZYPat = IN_InterFace.QueryPatByInpatNum(this.txtQueryNum.Text.Trim()); if (_currentZYPat == null) { MessageBox.Show(this.txtQueryNum, "该病人不存在"); this.txtQueryNum.Text = ""; return; } if (_currentZYPat.PatType != "2") { MessageBox.Show(this.txtQueryNum, "该病人已出院,无法退药"); this.txtQueryNum.Text = ""; return; } ShowCurrentPat(); _dispOrder = IN_InterFace.QueryRefRecipeOrder(_currentZYPat, (int)_currentDeptId, cobBeginDate.Value, cobEndDate.Value); dgrdDispOrder.DataSource = _dispOrder; this.btnRefund.Focus(); } catch (Exception error) { MessageBox.Show(error.Message); } finally { this.Cursor = this.DefaultCursor; } }
private void txtQueryNum_KeyDown(object sender, KeyEventArgs e) { try { //发药模式为住院发药 if (_dispenseModel == 1 && e.KeyValue == 13) { if (this.txtQueryNum.Text.Trim() == "") { return; } lstPatInfo.Items.Clear(); _currentZYPat = IN_InterFace.QueryPatByInpatNum(this.txtQueryNum.Text.Trim()); if (_currentZYPat == null) { MessageBox.Show(this.txtQueryNum, "该病人不存在"); this.txtQueryNum.Text = ""; return; } ListViewItem lstItem = new ListViewItem(_currentZYPat.PatientInfo.PatName); lstPatInfo.Items.Add(lstItem); lstItem.SubItems.Add(_currentZYPat.PatientInfo.PatSex); lstItem.SubItems.Add(_currentZYPat.PatientInfo.PatBriDate.ToString("yyyy-mm-dd")); lstItem.Tag = _currentZYPat; lstPatInfo.Items[0].Selected = true; lstPatInfo_DoubleClick(null, null); ShowCurrentPat(); this.btnDispense.Focus(); } } catch (Exception error) { MessageBox.Show(error.Message); } }
private void btnRefresh_Click(object sender, EventArgs e) { try { this.Cursor = GWMHIS.BussinessLogicLayer.Classes.PublicStaticFun.WaitCursor(); if (_dispenseModel == 1) { lstPatInfo.Items.Clear(); List <ZY_PatList> patList = IN_InterFace.QueryAllZYPat(); LstPatBind(patList); } else { LoadTLMessage(); } } catch (Exception error) { MessageBox.Show(error.Message); } finally { this.Cursor = DefaultCursor; } }
private void LoadData() { try { _deptDt = IN_InterFace.LoadClinicDept(); txtDeptDraw.SetSelectionCardDataSource(_deptDt); } catch (Exception error) { throw error; } }
private void LoadTLMessage() { List <ZY_PatList> patList = IN_InterFace.QueryAllZYPat((int)_currentDeptId, _searchDeptId); ZY_PatList nullPat = new ZY_PatList(); nullPat.PatListID = 0; _recipeOrder = IN_InterFace.QueryRecipeOrder(nullPat, (int)_currentDeptId); dgrdRecipeInfo.DataSource = _recipeOrder; _allDispPats.Clear(); foreach (ZY_PatList pat in patList) { DataTable singleOrder = IN_InterFace.QueryRecipeOrder(pat, (int)_currentDeptId); _allDispPats.Add(pat.CureNo, singleOrder); } LstPatBind(patList); }
/// <summary> /// 加载发药消息头到科室节点 /// </summary> /// <param name="msgMasters">待发药消息头列表</param> /// <param name="deptNode">科室节点</param> private void AddMsgToDeptNode(int _searchDeptId, TreeNode deptNode) { List <HIS.Model.ZY_PatList> patlist = IN_InterFace.QueryAllZYPat(Convert.ToInt32(_currentDeptId), _searchDeptId); if (patlist != null) { foreach (ZY_PatList pat in patlist) { { TreeNode msgNode = new TreeNode(pat.PatientInfo.PatName + "__" + pat.CureNo + "__" + pat.PatientInfo.PatSex); msgNode.Tag = pat; deptNode.Nodes.Add(msgNode); } } } }
private void btnRefund_Click(object sender, EventArgs e) { try { if (ConfigManager.IsChecking(_currentDeptId)) { MessageBox.Show("药品正在盘点中......"); return; } if (MessageBox.Show("您确定要退以下药品么?", "退药确认", MessageBoxButtons.OKCancel) == DialogResult.Cancel) { return; } if (_dispOrder == null || _dispOrder.Rows.Count < 1) { MessageBox.Show("没有药品可退", "警告", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning); return; } this.Cursor = GWMHIS.BussinessLogicLayer.Classes.PublicStaticFun.WaitCursor(); ZY_DispPresInfo presInfo = new ZY_DispPresInfo(); presInfo.CureDocCode = _currentZYPat.CureDocCode; presInfo.CureNo = _currentZYPat.CureNo; presInfo.drFlag = 0; presInfo.opType = ConfigManager.OP_YF_REFUND; presInfo.PatListId = _currentZYPat.PatListID; presInfo.PatName = _currentZYPat.PatientInfo.PatName; presInfo.presDeptId = Convert.ToInt32(_currentZYPat.CurrDeptCode); presInfo.recipeNum = 1; YP_DRMaster refMaster = _billProcessor.BuildNewDispenseMaster(presInfo, (int)_currentDeptId, (int)_currentUserId); List <BillOrder> refList = _billProcessor.BuildNewDispOrder(_dispOrder, refMaster, 1); _billProcessor.SaveBill(refMaster, refList, _currentDeptId); MessageBox.Show("退药成功,请及时告知记账护士进行冲账"); this.txtQueryNum.Focus(); } catch (Exception error) { MessageBox.Show(error.Message); } finally { _dispOrder = IN_InterFace.QueryRefRecipeOrder(_currentZYPat, (int)_currentDeptId, cobBeginDate.Value, cobEndDate.Value); dgrdDispOrder.DataSource = _dispOrder; this.Cursor = DefaultCursor; } }
private void LoadData(string invoiceNum) { try { if (Convert.ToInt32(invoiceNum) != 0) { listMaster = _billQuery.LoadDispMaster(invoiceNum, (int)_currentDeptId); dgrdDispMaster.AutoGenerateColumns = false; dgrdDispMaster.DataSource = listMaster; _dispOrder = IN_InterFace.QueryRefRecipeOrder(invoiceNum); dgrdDispOrder.AutoGenerateColumns = false; dgrdDispOrder.DataSource = _dispOrder; } } catch (Exception error) { throw error; } }
private void lstPatInfo_DoubleClick(object sender, EventArgs e) { try { this.Cursor = GWMHIS.BussinessLogicLayer.Classes.PublicStaticFun.WaitCursor(); if (_dispenseModel == 1) { _recipeOrder = IN_InterFace.QueryRecipeOrder(_currentZYPat, (int)_currentDeptId); dgrdRecipeInfo.DataSource = _recipeOrder; } } catch (Exception error) { MessageBox.Show(error.Message); } finally { this.Cursor = DefaultCursor; } }
private void LoadData() { try { _deptDt = IN_InterFace.LoadClinicDept(); if (_deptDt != null) { DataRow allDeptRow = _deptDt.NewRow(); allDeptRow["DEPT_ID"] = 0; allDeptRow["NAME"] = "全院科室"; allDeptRow["WB_CODE"] = "qyks"; allDeptRow["PY_CODE"] = "qyks"; _deptDt.PrimaryKey = new DataColumn[] { _deptDt.Columns["DEPT_ID"] }; _deptDt.Rows.Add(allDeptRow); } txtDeptDraw.SetSelectionCardDataSource(_deptDt); } catch (Exception error) { throw error; } }
private void LoadData() { dgrdOrderInfo.AutoGenerateColumns = false; _deptInfoDt = IN_InterFace.LoadOutStoreDept((int)_currentDeptId); //add 平级药房调拨 张运辉 [20100531] DataTable Deptidt = _deptInfoDt.Clone(); DataRow[] dRows; dRows = _deptInfoDt.Select("NAME<>'药库' and DEPT_ID<>" + (int)_currentDeptId); foreach (DataRow dr in dRows) { Deptidt.Rows.Add(dr.ItemArray); } _deptInfoDt = Deptidt; _userInfoDt = IN_InterFace.LoadAllUser(); _drugInfoDt = StoreFactory.GetQuery(_belongSystem).LoadDrugInfo((int)_currentDeptId); _outOrderDt = _billQuery.LoadOrder(_currentMaster); txtOutDept.SetSelectionCardDataSource(_deptInfoDt); txtApplyPeople.SetSelectionCardDataSource(_userInfoDt); txtDgCode.SetSelectionCardDataSource(_drugInfoDt); this.dgrdOrderInfo.DataSource = _outOrderDt; }
private void btnDispense_Click(object sender, EventArgs e) { try { Decimal newDispFee = 0; this.Cursor = GWMHIS.BussinessLogicLayer.Classes.PublicStaticFun.WaitCursor(); if (ConfigManager.IsChecking(_currentDeptId) == true) { MessageBox.Show("药品正在盘点中......"); return; } if (this._recipeOrder == null) { MessageBox.Show("没有药品可发"); return; } if (this._recipeOrder.Rows.Count < 1) { MessageBox.Show("没有药品可发"); return; } if (_dispenseModel == 1) { if (_currentZYPat == null) { MessageBox.Show("没有病人需要发药"); return; } YP_DRMaster dispMaster = _billProcessor.BuildNewDispenseMaster(_currentZYPat, (int)_currentDeptId, (int)_currentUserId); newDispFee = IN_InterFace.QueryPatDispFee(_currentZYPat, (int)_currentDeptId); if (this.CompareFee(newDispFee) == false) { MessageBox.Show("该病人因费用冲账发药信息需要刷新,请重新刷新"); return; } if (_recipeOrder != null) { List <BillOrder> dispList = _billProcessor.BuildNewDispOrder(_recipeOrder, dispMaster, _dispenseModel); _billProcessor.SaveBill(dispMaster, dispList, _currentDeptId); MessageBox.Show("发药成功...", "发药成功", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); _recipeOrder = IN_InterFace.QueryRecipeOrder(_currentZYPat, (int)_currentDeptId); dgrdRecipeInfo.DataSource = _recipeOrder; } } //如果是住院统领 else { ZY_PatList dispPat; for (int index = 0; index < lstPatInfo.CheckedItems.Count; index++) { dispPat = (ZY_PatList)lstPatInfo.CheckedItems[index].Tag; newDispFee += IN_InterFace.QueryPatDispFee(dispPat, (int)_currentDeptId); } if (CompareFee(newDispFee) == false) { MessageBox.Show("有病人因费用冲账发药信息需要刷新,请重新刷新"); return; } List <BillMaster> dispList = new List <BillMaster>(); for (int index = 0; index < lstPatInfo.CheckedItems.Count; index++) { dispPat = (ZY_PatList)lstPatInfo.CheckedItems[index].Tag; YP_DRMaster dispMaster = _billProcessor.BuildNewDispenseMaster(dispPat, (int)_currentDeptId, (int)_currentUserId); dispList.Add(dispMaster); } YP_DispDeptHis newDispDept = (YP_DispDeptHis)(_billProcessor.SaveBills(dispList, _searchDeptId, _allDispPats)); MessageBox.Show("发药成功,开始打印统领发药单据...", "发药成功", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); PrintDispTL(dispList, newDispDept); LoadTLMessage(); } this.txtQueryNum.Focus(); } catch (Exception error) { MessageBox.Show(error.Message); } finally { this.Cursor = DefaultCursor; } }
private void btnDispense_Click(object sender, EventArgs e) { try { Decimal newDispFee = 0; this.Cursor = GWMHIS.BussinessLogicLayer.Classes.PublicStaticFun.WaitCursor(); if (ConfigManager.IsChecking(_currentDeptId) == true) { MessageBox.Show("药品正在盘点中......"); return; } if (this._recipeOrder == null) { MessageBox.Show("没有药品可发"); return; } if (this._recipeOrder.Rows.Count < 1) { MessageBox.Show("没有药品可发"); return; } for (int index = 0; index < selectPat.Count; index++) { newDispFee += IN_InterFace.QueryPatDispFee(selectPat[index], (int)_currentDeptId); } if (CompareFee(newDispFee) == false) { MessageBox.Show("有病人因费用冲账发药信息需要刷新,请重新刷新"); return; } List <BillMaster> dispList = new List <BillMaster>(); for (int index = 0; index < selectPat.Count; index++) { DataTable dt = (DataTable)_allDispPats[selectPat[index].CureNo]; YP_DRMaster dispMaster = _billProcessor.BuildNewDispenseMaster(selectPat[index], (int)_currentDeptId, (int)_currentUserId, Convert.ToInt32(dt.Rows[0]["presamount"].ToString()), Convert.ToInt32(dt.Rows[0]["group_id"].ToString())); dispList.Add(dispMaster); for (int j = 1; j < dt.Rows.Count; j++) { if (dt.Rows[j]["group_id"].ToString().Trim() != dt.Rows[j - 1]["group_id"].ToString().Trim()) { dispMaster = _billProcessor.BuildNewDispenseMaster(selectPat[index], (int)_currentDeptId, (int)_currentUserId, Convert.ToInt32(dt.Rows[j]["presamount"].ToString()), Convert.ToInt32(dt.Rows[j]["group_id"].ToString())); dispList.Add(dispMaster); } } } YP_DispDeptHis newDispDept = (YP_DispDeptHis)(_billProcessor.SaveBills(dispList, _searchDeptId, _allDispPats)); MessageBox.Show("发药成功,开始打印摆药单...", "发药成功", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); PrintBy(); // PrintDispTL(dispList, newDispDept); dgrdRecipeInfo.DataSource = null; LoadMsgMaster(); } catch (Exception error) { MessageBox.Show(error.Message); } finally { this.Cursor = DefaultCursor; } }
private void treeDrugMsg_AfterCheck(object sender, TreeViewEventArgs e) { try { DataTable dt = (DataTable)dgrdRecipeInfo.DataSource; if (e.Node != null) { this.Cursor = GWMHIS.BussinessLogicLayer.Classes.PublicStaticFun.WaitCursor(); if (e.Node.Level == 2 && e.Node.Checked) { ZY_PatList currentMsg = (ZY_PatList)(e.Node.Tag); _selectDeptId = Convert.ToInt32(currentMsg.CurrDeptCode); selectPat.Remove(currentMsg); selectPat.Add(currentMsg); TreeNode rootNode = treeDrugMsg.Nodes[0]; foreach (TreeNode node in rootNode.Nodes) { foreach (TreeNode msgNode in node.Nodes) { if (((ZY_PatList)msgNode.Tag).CurrDeptCode != currentMsg.CurrDeptCode && msgNode.Checked == true) { msgNode.Parent.Checked = false; break; } } } _allDispPats.Remove(currentMsg.CureNo); if (dt != null) { DataTable recipeDt = IN_InterFace.QueryRecipeOrder(currentMsg, (int)_currentDeptId); _allDispPats.Add(currentMsg.CureNo, recipeDt); DataTable recipeCopy = recipeDt.Clone(); recipeCopy.Clear(); for (int index = 0; index < recipeDt.Rows.Count; index++) { // _recipeOrder.Rows.Add(recipeDt.Rows[index].ItemArray); recipeCopy.Rows.Add(recipeDt.Rows[index].ItemArray); decimal presamount = (recipeCopy.Rows[index]["presamount"] == null || recipeCopy.Rows[index]["presamount"].ToString() == "0" ? 1 : Convert.ToDecimal(recipeCopy.Rows[index]["presamount"].ToString())); recipeCopy.Rows[index]["amount"] = Convert.ToDecimal(recipeCopy.Rows[index]["amount"].ToString()) / presamount; dt.Rows.Add(recipeCopy.Rows[index].ItemArray); } dgrdRecipeInfo.DataSource = dt; } else { _recipeOrder = IN_InterFace.QueryRecipeOrder(currentMsg, (int)_currentDeptId); _allDispPats.Add(currentMsg.CureNo, _recipeOrder); DataTable dtCopy = _recipeOrder.Clone(); dtCopy.Clear(); for (int i = 0; i < _recipeOrder.Rows.Count; i++) { dtCopy.Rows.Add(_recipeOrder.Rows[i].ItemArray); decimal presamount = (dtCopy.Rows[i]["presamount"] == null || dtCopy.Rows[i]["presamount"].ToString() == "0" ? 1 : Convert.ToDecimal(dtCopy.Rows[i]["presamount"].ToString())); dtCopy.Rows[i]["amount"] = Convert.ToDecimal(dtCopy.Rows[i]["amount"].ToString()) / presamount; } dgrdRecipeInfo.DataSource = dtCopy; } } if (e.Node.Level == 2 && !e.Node.Checked) { ZY_PatList currentMsg = (ZY_PatList)(e.Node.Tag); selectPat.Remove(currentMsg); _allDispPats.Remove(currentMsg.CureNo); if (_recipeOrder != null) { DataRow[] removeRows = dt.Select("cureno=" + "'" + currentMsg.CureNo.ToString() + "'"); foreach (DataRow removeRow in removeRows) { dt.Rows.Remove(removeRow); } } dgrdRecipeInfo.DataSource = dt; } if ((e.Node.Level == 2 && e.Node.Checked) || (e.Node.Level == 1 && e.Node.Checked)) { e.Node.Parent.Checked = true; } if ((e.Node.Level == 1 && !e.Node.Checked) || (e.Node.Level == 0 && !e.Node.Checked)) { foreach (TreeNode node in e.Node.Nodes) { node.Checked = false; } } } } catch (Exception error) { MessageBox.Show(error.Message); } finally { this.Cursor = DefaultCursor; } }