/// <summary> /// 执行数据打印 /// </summary> /// <param name="al">需打印数据</param> internal static void Print(ArrayList al, Neusoft.HISFC.Models.Pharmacy.DrugBillClass drugBillClass, bool isAutoPrint, bool isPrintLabel, bool isNeedPreview) { ArrayList alClone = new ArrayList(); foreach (Neusoft.HISFC.Models.Pharmacy.ApplyOut info in al) { alClone.Add(info.Clone()); } if (!isAutoPrint) { if (isPrintLabel) { Function.PrintLabelForOutpatient(alClone); } else { if (isNeedPreview) { Function.Preview(alClone, drugBillClass); } else { Function.PrintBill(alClone, drugBillClass); } } } }
/// <summary> /// 取摆药单列表中,被选中的摆药单组合。并返回是否可以对摆药单进行核准 /// </summary> /// <param name="tvBill">需判断是否选中的节点树</param> /// <param name="billCodes">选中的摆药单编码组合 由逗号间隔</param> /// <returns>返回是否允许进行核准操作 True 允许 Flase 不允许</returns> protected bool GetCheckBill(Neusoft.FrameWork.WinForms.Controls.NeuTreeView tvBill, ref string billCodes) { billCodes = "''"; bool enabledApprove = false; //是否允许对本组摆药单进行核准操作 if (tvBill.Nodes.Count <= 0) { return(false); } foreach (TreeNode billClassNode in tvBill.Nodes) { foreach (TreeNode deptBillNode in billClassNode.Nodes) { if (!deptBillNode.Checked) { continue; } DrugBillClass drugBillClass = deptBillNode.Tag as DrugBillClass; billCodes = billCodes + string.Format(",'{0}'", drugBillClass.DrugBillNO); if (drugBillClass.ApplyState == "1") { enabledApprove = true; } } } if (billCodes == "" || billCodes == "''") { MessageBox.Show(Language.Msg("请选择待核准摆药单")); billCodes = null; } //为何增加此处代码? if (billCodes == "''" && tvBill.SelectedNode.Level == 1) { Neusoft.HISFC.Models.Pharmacy.DrugBillClass selectBillClass = tvBill.SelectedNode.Tag as Neusoft.HISFC.Models.Pharmacy.DrugBillClass; if (selectBillClass.DrugBillNO.IndexOf("'") == -1) { billCodes = string.Format("'{0}'", selectBillClass.DrugBillNO); } else { billCodes = selectBillClass.DrugBillNO; } if (selectBillClass.ApplyState == "1") { enabledApprove = true; } } return(enabledApprove); }
/// <summary> /// 将摆药单信息加入列表 返回形成的摆药单节点 /// </summary> /// <param name="drugBillClass">摆药单信息</param> /// <param name="nodeCollection">父节点集合</param> /// <returns>返回摆药单节点</returns> private TreeNode GetBillClassNode(Neusoft.HISFC.Models.Pharmacy.DrugBillClass drugBillClass, TreeNodeCollection nodeCollection) { TreeNode nodeBillClass = new TreeNode(drugBillClass.Name); nodeBillClass.Tag = drugBillClass; nodeCollection.Add(nodeBillClass); return(nodeBillClass); }
/// <summary> /// 克隆函数 /// </summary> /// <returns>返回当前实例的副本</returns> public new DrugBillClass Clone() { DrugBillClass drugBillClass = base.Clone() as DrugBillClass; drugBillClass.ApplyDept = this.ApplyDept.Clone(); drugBillClass.PrintType = this.PrintType.Clone(); drugBillClass.DrugAttribute = this.DrugAttribute.Clone(); drugBillClass.Oper = this.Oper.Clone(); return(drugBillClass); }
/// <summary> /// 摆药单打印 /// </summary> /// <param name="alData">需打印数据</param> /// <returns>成功返回1 失败返回-1</returns> internal static int PrintBill(ArrayList alData, Neusoft.HISFC.Models.Pharmacy.DrugBillClass drugBillClass) { ArrayList alClone = new ArrayList(); foreach (Neusoft.HISFC.Models.Pharmacy.ApplyOut info in alData) { alClone.Add(info.Clone()); } if (Function.IDrugPrint == null) { System.Windows.Forms.MessageBox.Show("未正确设置摆药单打印接口."); return(-1); } Function.IDrugPrint.AddAllData(alClone, drugBillClass); Function.IDrugPrint.Print( ); return(1); }
/// <summary> /// 将摆药单信息加入列表 返回形成科室的摆药单节点 /// </summary> /// <param name="drugBillClass">摆药单信息</param> /// <param name="nodeCollection">父节点集合(摆药单节点)</param> /// <returns>返回科室摆药单节点</returns> private TreeNode GetDeptBillNode(Neusoft.HISFC.Models.Pharmacy.DrugBillClass drugBillClass, TreeNodeCollection nodeCollection) { //添加摆药单列表 TreeNode nodeDeptBill = new TreeNode(); nodeDeptBill.Text = drugBillClass.ApplyDept.Name + "[" + drugBillClass.Oper.OperTime.ToString("Hmmss") + "]"; if (drugBillClass.ApplyState == "1") { nodeDeptBill.ImageIndex = 2; nodeDeptBill.SelectedImageIndex = 2; } else { nodeDeptBill.ImageIndex = 3; nodeDeptBill.SelectedImageIndex = 3; } nodeDeptBill.Tag = drugBillClass; nodeCollection.Add(nodeDeptBill); return(nodeDeptBill); }
/// <summary> /// 判断是否需要打印 对未打印的患者获取数据进行打印 /// </summary> /// <param name="judgeKey">判断的主键依据</param> /// <param name="judgeMessage">摆药通知信息</param> /// <param name="judgePatientNO">患者住院号</param> protected virtual void JudgePrint(string judgeKey, Neusoft.HISFC.Models.Pharmacy.DrugMessage judgeMessage, string judgePatientNO) { if (!this.isAutoPrint) { return; } //if (tvDrugMessage.hsPrint != null && tvDrugMessage.hsPrint.ContainsKey(judgeKey)) if (tvDrugMessage.hsPrint == null) { tvDrugMessage.hsPrint = new Hashtable(); } #region 待打印数据获取 judgeMessage.User01 = judgePatientNO; //需打印患者住院流水号 //检索患者摆药申请明细数据 ArrayList al = this.itemManager.QueryApplyOutListByPatient(judgeMessage); if (al == null) { MessageBox.Show("获取" + judgePatientNO + "的待打印数据时发生错误"); return; } //屏蔽此处判断 同一张单据包括两天数据时 判断有问题 //if (al.Count > 0) //{ // Neusoft.HISFC.Models.Pharmacy.ApplyOut info = al[0] as Neusoft.HISFC.Models.Pharmacy.ApplyOut; // if (info != null) // { // //非当日数据不予打印 // if (info.Operation.ApplyOper.OperTime < this.sysDate) // { // tvDrugMessage.hsPrint.Add(judgeKey, null); // return; // } // } //} //取出所有未打印数据 ArrayList alPrintData = new ArrayList(); foreach (Neusoft.HISFC.Models.Pharmacy.ApplyOut printInfo in al) { //对非当日数据不打印 if (printInfo.Operation.ApplyOper.OperTime < this.sysDate) { continue; } if (printInfo.ValidState == Neusoft.HISFC.Models.Base.EnumValidState.Valid && printInfo.PrintState != "1") { alPrintData.Add(printInfo); } } #endregion //无待打印数据 直接返回 if (alPrintData.Count == 0) { return; } if (this.isPrintLabel) { #region 标签打印 if (Function.PrintLabelForOutpatient(alPrintData) != -1) { foreach (Neusoft.HISFC.Models.Pharmacy.ApplyOut info in alPrintData) { info.PrintState = "1"; //该标记用于区分是否已对单据进行过打印 if (this.itemManager.UpdateApplyOut(info) == -1) { MessageBox.Show("更新打印标记发生错误"); } } } #endregion } else { #region 摆药单打印 Neusoft.HISFC.Models.Pharmacy.DrugBillClass drugBillClass = this.drugStoreManager.GetDrugBillClass(judgeMessage.DrugBillClass.ID); drugBillClass.Memo = judgeMessage.DrugBillClass.Memo;//摆药单号 if (Function.PrintBill(alPrintData, drugBillClass) != -1) { foreach (Neusoft.HISFC.Models.Pharmacy.ApplyOut info in alPrintData) { info.PrintState = "1"; //该标记用于区分是否已对单据进行过打印 if (this.itemManager.UpdateApplyOutPrintState(info.ID, true) == -1) { MessageBox.Show("更新打印标记发生错误"); } } } #endregion } tvDrugMessage.hsPrint.Add(judgeKey, null); //屏蔽打印自动保存功能 //if (this.isPrintAndOutput) //{ // this.AutoSave(judgeMessage); //} }