public void AddAllData(System.Collections.ArrayList alData)
        {
            if (alData.Count <= 0)
            {
                return;
            }

            #region 患者信息赋值

            Neusoft.HISFC.Models.Pharmacy.ApplyOut tempApply = alData[0] as Neusoft.HISFC.Models.Pharmacy.ApplyOut;
            string clinicNO = tempApply.PatientNO;

            Neusoft.HISFC.BizLogic.Registration.Register registerManager = new Neusoft.HISFC.BizLogic.Registration.Register();
            Neusoft.HISFC.Models.Registration.Register   register        = registerManager.GetByClinic(clinicNO);

            foreach (Neusoft.HISFC.Models.Pharmacy.ApplyOut temp in alData)
            {
                temp.UseTime   = temp.Operation.ApplyOper.OperTime;
                temp.PatientNO = register.PID.CardNO;
                temp.User02    = register.Name;
            }

            #endregion

            if (this.ucInject == null)
            {
                this.ucInject = new ucZLInjectList();
            }

            this.ucInject.AddAllData(alData);

            //对打印标签的情况 对数据按组合分组
            ComboSort comboSort = new ComboSort();
            alData.Sort(comboSort);

            ArrayList alGroupApplyOut = new ArrayList();
            ArrayList alCombo         = new ArrayList();
            string    privCombo       = "-1";

            #region 标签打印

            foreach (Neusoft.HISFC.Models.Pharmacy.ApplyOut info in alData)
            {
                if (privCombo == "-1" || (privCombo == info.CombNO && info.CombNO != ""))
                {
                    alCombo.Add(info.Clone());
                    privCombo = info.CombNO;
                    continue;
                }
                else                    //不同处方号
                {
                    alGroupApplyOut.Add(alCombo);

                    privCombo = info.CombNO;
                    alCombo   = new ArrayList();

                    alCombo.Add(info.Clone());
                }
            }

            if (alCombo.Count > 0)
            {
                alGroupApplyOut.Add(alCombo);
            }

            this.alGroupCompound = alGroupApplyOut;

            #endregion
        }
Ejemplo n.º 2
0
        public void AddAllData(System.Collections.ArrayList al)
        {
            if (al.Count <= 0)
            {
                return;
            }

            #region 中成药、草药打印

            try
            {
                try
                {
                    ComboSort comboSort = new ComboSort();
                    al.Sort(comboSort);
                }
                catch (Exception ex)
                {
                    MessageBox.Show("数组排序发生错误" + ex.Message);
                    return;
                }

                int iIndex = this.neuSpread1_Sheet1.Rows.Count;
                foreach (Neusoft.HISFC.Models.Pharmacy.ApplyOut info in al)
                {
                    this.neuSpread1_Sheet1.Rows.Add(iIndex, 1);
                    this.neuSpread1_Sheet1.Cells[iIndex, 0].Text = info.CombNO;                                                                                                                                                                                                   //组合号
                    this.neuSpread1_Sheet1.Cells[iIndex, 2].Text = string.Format("{0}-{1}[{2}]  {3}{4}/{5}", info.Item.Name, Function.DrugDosage.GetStaticDosage(info.Item.ID), info.Item.Specs, info.Operation.ApplyQty, info.Item.MinUnit, usageHelper.GetName(info.Usage.ID)); //药品用药信息

                    this.lbInfo.Text = string.Format("姓名:{0}        日期:{1}     病历号:{2}", info.User02, info.Operation.ApplyOper.OperTime.ToString("yyyy-MM-dd"), info.PatientNO);
                }

                int    groupID   = 0;
                string privCombo = "-1";
                for (int i = 0; i < this.neuSpread1_Sheet1.Rows.Count; i++)
                {
                    if (privCombo != this.neuSpread1_Sheet1.Cells[i, 0].Text)
                    {
                        groupID++;
                        this.neuSpread1_Sheet1.Cells[i, 1].Text = groupID.ToString();
                        privCombo = this.neuSpread1_Sheet1.Cells[i, 0].Text;
                    }
                    else
                    {
                        this.neuSpread1_Sheet1.Cells[i, 1].Text = groupID.ToString();
                    }
                }

                iIndex = this.neuSpread1_Sheet1.Rows.Count;
                this.neuSpread1_Sheet1.Rows.Add(iIndex, 2);
                iIndex = this.neuSpread1_Sheet1.Rows.Count - 1;
                this.neuSpread1_Sheet1.Cells[iIndex, 0].ColumnSpan = 7;
                this.neuSpread1_Sheet1.Cells[iIndex, 0].Text       = "发药:              核对:                 护士核对:";
                this.neuSpread1_Sheet1.Rows[iIndex].Font           = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }

            #endregion
        }