Ejemplo n.º 1
0
        /// <summary>
        /// 获得病人处方
        /// </summary>
        /// <returns></returns>
        public DataTable GetPrescription(long presDocId)
        {
            int presNo = 0;

            InterFace.PrescMoneyCalculateInterFace PrescMoneyCalculateInterFace = new InterFace.PrescMoneyCalculateInterFace();

            //获取处方头列表信息
            List <Prescription> prescriptions = new List <Prescription>();
            string strsql = HIS.BLL.Tables.mz_doc_preshead.PATLISTID + oleDb.EuqalTo() + this.PatList.PatListID
                            + oleDb.And() + HIS.BLL.Tables.mz_doc_preshead.PRES_FLAG + oleDb.LessThan() + 3
                            + oleDb.And() + HIS.BLL.Tables.mz_doc_preshead.PRES_DOC + oleDb.EuqalTo() + presDocId
                            + oleDb.OrderBy(HIS.BLL.Tables.mz_doc_preshead.PRESHEADID);
            List <HIS.Model.Mz_Doc_PresHead> presHead = BindEntity <HIS.Model.Mz_Doc_PresHead> .CreateInstanceDAL(oleDb).GetListArray(strsql);

            for (int index = 0; index < presHead.Count; index++)
            {
                //获取处方明细信息
                List <PresDetail> presLists = new PresDetail(presHead[index].PresHeadId).GetAllPresDetailList();
                if (presLists.Count > 0)
                {
                    presNo++;
                    List <Prescription> presTemp = new List <Prescription>();
                    for (int i = 0; i < presLists.Count; i++)
                    {
                        Prescription prescription = new Prescription();
                        prescription         = (Prescription)HIS.SYSTEM.PubicBaseClasses.ApiFunction.ObjectToObj(presLists[i], prescription);
                        prescription.Dept_Id = presHead[index].Pres_ExeDept;
                        prescription.LoadData();
                        prescription.PresNo    = presNo;
                        prescription.Status    = (HIS.MZDoc_BLL.Public.PresStatus)presHead[index].Pres_Flag;
                        prescription.Pres_Date = presHead[index].Pres_Date;
                        prescriptions.Add(prescription);
                        if (prescription.SelfDrug_Flag == 0 || !prescription.IsDrug)
                        {
                            presTemp.Add(prescription);
                        }
                    }
                    //插入小记
                    Prescription prescription0 = new Prescription();
                    prescription0.PresHeadId = presHead[index].PresHeadId;
                    prescription0.Dept_Id    = presHead[index].Pres_ExeDept;
                    prescription0.Item_Name  = "小计:";
                    prescription0.PresNo     = presNo;
                    prescription0.OrderNo    = presLists.Count + 1;
                    //2009-12-22 统一医生站和收费系统的处方费用合计
                    prescription0.Item_Money = (presTemp.Count <= 0) ? "0.0" : (PrescMoneyCalculateInterFace.GetPrescriptionTotalMoney(presTemp).ToString());//itemMoney.ToString();
                    prescription0.Status     = (HIS.MZDoc_BLL.Public.PresStatus)presHead[index].Pres_Flag;
                    prescriptions.Add(prescription0);
                }
            }
            return(HIS.SYSTEM.PubicBaseClasses.ApiFunction.ObjToDataTable(prescriptions));
        }