/// <summary>
        /// 保存
        /// </summary>
        /// <returns></returns>
        public int Save()
        {
            //取控件中修改后的患者信息
            if (!GetPatientInfo(register))
            {
                return(-1);
            }

            Neusoft.HISFC.Models.RADT.Patient obj = (Neusoft.HISFC.Models.RADT.Patient)register;

            Neusoft.FrameWork.Management.PublicTrans.BeginTransaction();

            //Neusoft.FrameWork.Management.Transaction t = new Neusoft.FrameWork.Management.Transaction(Neusoft.FrameWork.Management.Connection.Instance);
            //t.BeginTransaction();

            radtManager.SetTrans(Neusoft.FrameWork.Management.PublicTrans.Trans);

            if (this.radtManager.UpdatePatient((Neusoft.HISFC.Models.RADT.PatientInfo)obj) == 1)
            {
                Neusoft.FrameWork.Management.PublicTrans.Commit();
                MessageBox.Show("保存成功!", "提示");
                base.OnRefreshTree();
            }
            else
            {
                Neusoft.FrameWork.Management.PublicTrans.RollBack();
                MessageBox.Show("保存失败!" + this.radtManager.Err, "提示");
                return(-1);
            }
            return(0);
        }
Example #2
0
        /// <summary>
        ///从病案信息表里查询信息
        /// </summary>
        /// <param name="InpatientNo"></param>
        /// <returns></returns>
        public ArrayList QueryCaseFeeState(string InpatientNo)
        {
            ArrayList List   = null;
            string    strSql = "";

            if (this.Sql.GetSql("Case.BaseDML.GetCaseFeeState", ref strSql) == -1)
            {
                return(null);
            }
            try
            {
                //查询
                strSql = string.Format(strSql, InpatientNo);
                this.ExecQuery(strSql);
                Neusoft.HISFC.Models.RADT.Patient info = null;
                List = new ArrayList();
                while (this.Reader.Read())
                {
                    info          = new Neusoft.HISFC.Models.RADT.Patient();
                    info.DIST     = this.Reader[4].ToString(); //统计大类编码
                    info.AreaCode = this.Reader[5].ToString(); //统计名称
                    info.IDCard   = this.Reader[6].ToString(); //统计费用
                    List.Add(info);
                    info = null;
                }
                return(List);
            }
            catch (Exception ex)
            {
                this.Err = ex.Message;
                return(null);
            }
        }
Example #3
0
        /// <summary>
        /// 更新一条数据 如果更新失败 则执行插入操作
        /// </summary>
        /// <param name="info">这里借用了患者实体来存储费用信息</param>
        /// <returns></returns>
        public int UpdateFeeInfo(Neusoft.HISFC.Models.RADT.Patient info)
        {
            string strSql = "";

            if (this.Sql.GetSql("Case.BaseDML.UpdateFeeInfo", ref strSql) == -1)
            {
                return(-1);
            }
            try
            {
                //查询
                strSql = string.Format(strSql, GetInfo(info));
                int i = this.ExecNoQuery(strSql);
                if (i < 1)                       //更新失败
                {
                    return(InsertFeeInfo(info)); //执行插入操作
                }
                else
                {
                    return(i);
                }
            }
            catch (Exception ex)
            {
                this.Err = ex.Message;
                return(-1);
            }
        }
Example #4
0
        /// <summary>
        /// 获取费用信息
        /// </summary>
        /// <returns></returns>
        public ArrayList GetFeeInfoList()
        {
            feeInfoList = null;
            if (dtfeeInfo != null)
            {
                foreach (DataRow dr in this.dtfeeInfo.Rows)
                {
                    dr.EndEdit();
                }

                dtfeeInfo.AcceptChanges();//
                feeInfoList = new ArrayList();
                Neusoft.HISFC.Models.RADT.Patient info = null;
                foreach (DataRow row in dtfeeInfo.Rows)
                {
                    info      = new Neusoft.HISFC.Models.RADT.Patient();
                    info.ID   = patientInfo.ID;
                    info.DIST = row["统计编码"].ToString();//统计大类编码
                    if (info.DIST == "" || info.DIST == null)
                    {
                        continue;
                    }
                    info.AreaCode = row["费用名称"].ToString(); //统计名称
                    if (row["费用金额"] != DBNull.Value)
                    {
                        info.IDCard = row["费用金额"].ToString();//统计费用
                    }
                    feeInfoList.Add(info);
                }
            }
            return(feeInfoList);
        }
Example #5
0
        /// <summary>
        /// 查询并显示数据
        /// </summary>
        /// <returns>出错返回 -1 正常 0 不允许有病案1  </returns>
        public int LoadInfo(Neusoft.HISFC.Models.RADT.PatientInfo patient)
        {
            if (this.dtfeeInfo != null)
            {
                this.dtfeeInfo.Clear();
                this.dtfeeInfo.AcceptChanges();
            }
            if (patient == null)
            {
                return(-1);
            }
            patientInfo = patient;
            if (patientInfo.CaseState == "0")
            {
                //不允许有病案
                return(1);
            }
            Neusoft.HISFC.BizLogic.HealthRecord.Fee ba = new Neusoft.HISFC.BizLogic.HealthRecord.Fee();
            //查询符合条件的数据
            if (patientInfo.CaseState == "1")
            {
                feeInfoList = ba.QueryFeeInfoState(patientInfo.ID);
            }
            else
            {
                feeInfoList = ba.QueryFeeInfoState(patientInfo.ID);
            }
            if (feeInfoList == null)
            {
                return(-1);
            }
            //循环插入数据
            foreach (Neusoft.HISFC.Models.RADT.Patient info in feeInfoList)
            {
                DataRow row = dtfeeInfo.NewRow();
                SetRow(row, info);
                dtfeeInfo.Rows.Add(row);
            }
            decimal tempDec = 0;

            foreach (Neusoft.HISFC.Models.RADT.Patient info in feeInfoList)
            {
                tempDec = tempDec + Neusoft.FrameWork.Function.NConvert.ToDecimal(info.IDCard);
            }
            Neusoft.HISFC.Models.RADT.Patient obj = new Neusoft.HISFC.Models.RADT.Patient();
            obj.AreaCode = "合计:";
            obj.IDCard   = tempDec.ToString();
            DataRow rows = dtfeeInfo.NewRow();

            SetRow(rows, obj);
            dtfeeInfo.Rows.Add(rows);

            //更改标志
            dtfeeInfo.AcceptChanges();
            SetFpEnter();
            return(0);
        }
Example #6
0
 /// <summary>
 /// 获取实体里的数据
 /// </summary>
 /// <param name="info">这里借用了患者实体来存储费用信息</param>
 /// <returns></returns>
 private string[] GetInfo(Neusoft.HISFC.Models.RADT.Patient info)
 {
     string[] str = new string[8];
     str[0] = info.ID;          //住院流水号
     str[2] = info.DIST;        //统计大类
     str[3] = info.AreaCode;    //统计名称
     str[4] = info.IDCard;      //统计费用
     str[5] = info.User01;      //出院日期
     str[7] = this.Operator.ID; //操作员
     return(str);
 }
Example #7
0
        /// <summary>
        /// 插入一条数据
        /// </summary>
        /// <param name="info"> 这里借用了患者实体来存储费用信息</param>
        /// <returns></returns>
        public int InsertFeeInfo(Neusoft.HISFC.Models.RADT.Patient info)
        {
            string strSql = "";

            if (this.Sql.GetSql("Case.BaseDML.InsertFeeInfo", ref strSql) == -1)
            {
                return(-1);
            }
            try
            {
                //查询
                strSql = string.Format(strSql, GetInfo(info));
                return(this.ExecNoQuery(strSql));
            }
            catch (Exception ex)
            {
                this.Err = ex.Message;
                return(-1);
            }
        }
Example #8
0
        /// <summary>
        /// 设置患者信息到控件
        /// </summary>
        /// <param name="patientInfo"></param>
        protected void SetPatientInfo(Neusoft.HISFC.Models.RADT.PatientInfo patientInfo)
        {
            this.patientInfo = patientInfo;
            Neusoft.HISFC.Models.RADT.Patient Patient = patientInfo;

            this.txtPatientNo.Text  = Patient.PID.PatientNO;                             //住院号
            this.txtCard.Text       = patientInfo.PID.CardNO;                            //门诊卡号
            this.txtName.Text       = Patient.Name;                                      //患者姓名
            this.txtWork.Text       = Patient.CompanyName;                               //单位名称
            this.txtHomeTel.Text    = Patient.PhoneHome;                                 //家庭电话
            this.cmbHomeAddr.Text   = Patient.AddressHome;                               //家庭住址
            this.cmbMarry.Tag       = Patient.MaritalStatus.ID;                          //婚否
            this.cmbSex.Tag         = Patient.Sex.ID;                                    //性别
            this.cmbProfession.Tag  = Patient.Profession.ID;                             //职业
            this.dtBirthday.Value   = Patient.Birthday;                                  //出生日期
            this.txtDeptName.Text   = patientInfo.PVisit.PatientLocation.Dept.Name;      //科室名称
            this.dtIndate.Text      = patientInfo.PVisit.InTime.ToString("yyyy年MM月dd日"); //入院日期
            this.cmbRelation.Tag    = patientInfo.Kin.Relation.ID;                       //与病人关系编码
            this.cmbKinAddress.Text = patientInfo.Kin.RelationAddress;                   //联系人地址
            this.txtLinkTel.Text    = patientInfo.Kin.RelationPhone;                     //联系人电话
            this.txtLinkMan.Text    = patientInfo.Kin.Name;                              //联系人姓名
            this.txtID.Text         = patientInfo.IDCard;                                //身份证号
            this.txtHeight.Text     = patientInfo.Height;                                //身高
            this.txtWeight.Text     = patientInfo.Weight;                                //体重
            if (patientInfo.Memo == "")
            {
                this.cmbMemo.Tag = "";
            }
            else
            {
                this.cmbMemo.Text = patientInfo.Memo;                           //备注
            }
            this.cmbPact.Text = patientInfo.Pact.Name;                          //合同单位名称
            this.cmbPact.Tag  = patientInfo.Pact.ID;                            //合同单位代码

            this.txtDeptName.Text = patientInfo.PVisit.PatientLocation.Dept.Name;
        }
Example #9
0
 public int SetPatient(Neusoft.HISFC.Models.RADT.Patient Patient)
 {
     throw new NotImplementedException();
 }
Example #10
0
        /// <summary>
        /// 刷新列表
        /// </summary>
        private void RefreshList()
        {
            this.Nodes.Clear();
            int Branch = 0;

            if (this.myPatients.Count == 0)
            {
                this.AddRootNode();
            }
            for (int i = 0; i < this.myPatients.Count; i++)
            {
                System.Windows.Forms.TreeNode      newNode = new System.Windows.Forms.TreeNode();
                Neusoft.FrameWork.Models.NeuObject obj     = new Neusoft.FrameWork.Models.NeuObject();
                //类型为叶
                if (this.myPatients[i].GetType().ToString() == "Neusoft.HISFC.Models.RADT.PatientInfo")
                {
                    try
                    {
                        Neusoft.HISFC.Models.RADT.PatientInfo PatientInfo = (Neusoft.HISFC.Models.RADT.PatientInfo) this.myPatients[i];
                        obj.ID   = PatientInfo.PID.PatientNO;
                        obj.Name = PatientInfo.Name;
                        try
                        {
                            obj.Memo = PatientInfo.PVisit.PatientLocation.Bed.ID;
                            try
                            {   //请假
                                if (PatientInfo.PVisit.PatientLocation.Bed.Status.ID.ToString() == "R")
                                {
                                    obj.Name = obj.Name + "【请假】";
                                }
                            }
                            catch { }
                        }
                        catch
                        {//无病床信息
                        }
                        obj.User01 = PatientInfo.PVisit.PatientLocation.Dept.Name;
                        obj.User02 = PatientInfo.PVisit.InState.Name;
                        obj.User03 = PatientInfo.Sex.ID.ToString();
                        //入院不超过24小时,显示(新)
                        if (this.bIsShowNewPatient)
                        {
                            if (dtToday < PatientInfo.PVisit.InTime.Date.AddDays(1))
                            {
                                obj.Name = obj.Name + "(新)";
                            }
                        }
                        this.AddTreeNode(Branch, obj, PatientInfo);
                    }
                    catch { }
                }
                else if (this.myPatients[i].GetType().ToString() == "Neusoft.HISFC.Models.RADT.Patient")
                {
                    Neusoft.HISFC.Models.RADT.Patient PatientInfo = (Neusoft.HISFC.Models.RADT.Patient) this.myPatients[i];
                    obj.ID     = PatientInfo.PID.PatientNO;
                    obj.Name   = PatientInfo.Name;
                    obj.Memo   = "";
                    obj.User01 = "";
                    obj.User02 = "";
                    obj.User03 = PatientInfo.Sex.ID.ToString();
                    this.AddTreeNode(Branch, obj, PatientInfo);
                }
                else if (this.myPatients[i].GetType().ToString() == "Neusoft.FrameWork.Models.NeuObject")
                {
                    obj = (Neusoft.FrameWork.Models.NeuObject) this.myPatients[i];
                    this.AddTreeNode(Branch, obj, obj);
                }
                else
                {//为干
                    //分割字符串 text|tag 标识结点
                    string   all = this.myPatients[i].ToString();
                    string[] s   = all.Split('|');

                    newNode.Text = s[0];

                    try
                    {
                        newNode.Tag = s[1];
                    }
                    catch { newNode.Tag = ""; }
                    try
                    {
                        newNode.ImageIndex         = this.BranchImageIndex;
                        newNode.SelectedImageIndex = this.BranchSelectedImageIndex;
                    }
                    catch { }
                    Branch = this.Nodes.Add(newNode);
                }
            }
            if (this.bIsShowCount)
            {
                foreach (System.Windows.Forms.TreeNode node in this.Nodes)
                {
                    if (node.Tag == null || node.Tag.GetType().ToString() == "System.String")
                    {//结点
                        int count = 0;
                        count     = node.GetNodeCount(false);
                        node.Text = node.Text + "(" + count.ToString() + ")";
                    }
                }
            }
            this.ExpandAll();
            try//wolf added ensure node visible
            {
                if (this.SelectedNode == null)
                {
                    try
                    {
                        this.SelectedNode = this.Nodes[0];
                    }
                    catch { }
                }
                this.SelectedNode.EnsureVisible();
            }
            catch { }
        }
Example #11
0
 /// <summary>
 /// 将实体中的值赋值到row中
 /// </summary>
 /// <param name="row">传入的row</param>
 /// <param name="info">传入的实体</param>
 private void SetRow(DataRow row, Neusoft.HISFC.Models.RADT.Patient info)
 {
     row["统计编码"] = info.DIST;                                                  //统计大类编码
     row["费用名称"] = info.AreaCode;                                              //统计名称
     row["费用金额"] = Neusoft.FrameWork.Function.NConvert.ToDecimal(info.IDCard); //统计费用
 }
Example #12
0
        //#region addby xuewj 2010-3-31 {67B867B1-96BD-454a-9BE0-E4DD6EB3E995} 中草药医嘱打印设置
        ///// <summary>
        ///// sheetView
        ///// </summary>
        //private FarPoint.Win.Spread.SheetView view = new FarPoint.Win.Spread.SheetView();

        //InterfaceInstanceDefault.IRecipePrint.Print pp = new Print();

        ///// <summary>
        ///// 草药处方每行显示的药品数
        ///// </summary>
        //private int pccPerRowCount = 0;

        ///// <summary>
        ///// 草药处方每页显示的行数
        ///// </summary>
        //private int pccPerPageCount = 0;

        ///// <summary>
        ///// 草药打印容器是否初始化过
        ///// </summary>
        //private bool isInitial = false;


        //private String deptCode = "";

        ////public String DeptCode
        ////{
        ////    get { return deptCode; }
        ////    set { deptCode = value; }
        ////}
        ///// <summary>
        ///// 列枚举
        ///// </summary>
        //enum Columns
        //{
        //    /// <summary>
        //    /// 名称
        //    /// </summary>
        //    drugName,
        //    /// <summary>
        //    /// 规格
        //    /// </summary>
        //    specs,
        //    /// <summary>
        //    /// 组合号
        //    /// </summary>
        //    comboNO,
        //    /// <summary>
        //    /// 付
        //    /// </summary>
        //    hearbalQty,
        //    /// <summary>
        //    /// 组
        //    /// </summary>
        //    comboFlag,
        //    /// <summary>
        //    /// 剂量
        //    /// </summary>
        //    doseOnce,
        //    /// <summary>
        //    /// 用法
        //    /// </summary>
        //    usage,
        //    /// <summary>
        //    /// 频次
        //    /// </summary>
        //    frequence,
        //    /// <summary>
        //    /// 总量
        //    /// </summary>
        //    totQty,
        //    /// <summary>
        //    /// 院注
        //    /// </summary>
        //    injectCount,
        //    /// <summary>
        //    /// 备注
        //    /// </summary>
        //    memo

        //}
        //#endregion
        //#endregion

        //#region 属性

        ///// <summary>
        /////
        ///// </summary>
        //public Neusoft.HISFC.Models.Registration.Register PatientInfo
        //{
        //    get
        //    {
        //        return this.myRegister;
        //    }
        //    set
        //    {
        //        this.myRegister = value;
        //    }
        //}

        //#endregion

        //#region 私有方法

        ///// <summary>
        ///// 取控制参数
        ///// </summary>
        //private void GetArgument()
        //{
        //    pPrintNum = this.controlManagemnt.GetControlParam<int>("200031", false, 99);
        //    pccPrintNum = this.controlManagemnt.GetControlParam<int>("200033", false, 99);
        //    isSameRecipe = this.controlManagemnt.GetControlParam<bool>("200032", false, true);

        //    #region addby xuewj 2010-3-31 {67B867B1-96BD-454a-9BE0-E4DD6EB3E995} 中草药医嘱打印设置
        //    pccPerRowCount = this.controlManagemnt.GetControlParam<int>("200043", false, 4);
        //    pccPerPageCount = this.controlManagemnt.GetControlParam<int>("200044", false, 17);
        //    #endregion
        //}

        /// <summary>
        /// 设置患者基本信息
        /// </summary>
        public void SetPatient(Neusoft.HISFC.Models.Registration.Register myRegister)
        {
            //this.GetArgument();

            if (myRegister == null)
            {
                return;
            }
            DateTime myOperDate = System.DateTime.MinValue;

            myOperDate = this.orderManagement.QueryMaxOperTimeByClinicCode(myRegister.ID);

            Neusoft.HISFC.Models.Order.OutPatient.ClinicCaseHistory clinicCaseHistory = new Neusoft.HISFC.Models.Order.OutPatient.ClinicCaseHistory();
            clinicCaseHistory = this.orderManagement.QueryCaseHistoryByClinicCode(myRegister.ID, myOperDate.ToString("yyyy-MM-dd HH:mm:ss"));
            if (clinicCaseHistory != null)
            {
                if (clinicCaseHistory.ID != "" && clinicCaseHistory.ID != null)
                {
                    this.lblDiagnose.Text = clinicCaseHistory.CaseDiag;
                }
                else
                {
                    this.lblDiagnose.Text = "";
                }
            }
            else
            {
                this.lblDiagnose.Text = "";
            }

            #region 病历中不存在诊断则去met_com_diagnose中找门诊诊断  {787A81FD-9E3D-4cc3-A932-95A686A89B0A}

            if (this.lblDiagnose.Text == "")
            {
                ArrayList alDiagnoses = this.diagnoseIntegrate.QueryDiagnoseNoOps(myRegister.ID);
                if (alDiagnoses != null)
                {
                    foreach (Neusoft.HISFC.Models.HealthRecord.Diagnose diagnose in alDiagnoses)
                    {
                        if (diagnose.DiagInfo.DiagType.ID == "1")
                        {
                            if (this.lblDiagnose.Text != "")
                            {
                                this.lblDiagnose.Text += "|" + diagnose.DiagInfo.Name;
                            }
                            else
                            {
                                this.lblDiagnose.Text = diagnose.DiagInfo.Name;
                            }
                        }
                    }
                }
            }

            #endregion

            //#region {B8B67F3B-397F-4e21-9A87-56BD52E0C042}

            //this.lblTitle.Text = managerIntegrate.GetHospitalName() + "\r\n" + "    处 方 笺";

            //#endregion

            this.lblPact.Text = myRegister.Pact.Name;
            this.lblDept.Text = myRegister.DoctorInfo.Templet.Dept.Name;
            // this.deptCode = this.myRegister.DoctorInfo.Templet.Dept.ID;

            this.lblName.Text   = myRegister.Name;
            this.lblCardNO.Text = myRegister.PID.CardNO;
            this.lblSex.Text    = myRegister.Sex.Name;
            //this.lblAge.Text = orderManagement.GetAge(this.myRegister.Birthday);
            Neusoft.HISFC.Models.RADT.Patient pat = this.managerIntegrate.QueryComPatientInfo(myRegister.PID.CardNO);
            if (pat != null)
            {
                this.lblAge.Text = Neusoft.HISFC.BizProcess.Integrate.Function.GetAge(pat.Birthday);
            }

            this.lblSICard.Text  = myRegister.SIMainInfo.RegNo;
            this.lblAddress.Text = myRegister.AddressHome + "   " + myRegister.PhoneHome;

            DateTime sysDate = orderManagement.GetDateTimeFromSysDateTime();
            this.lblSeeDate.Text = sysDate.ToString("yyyy年MM月dd日");

            this.lblSeeDoctor.Text = orderManagement.Operator.Name;
        }
        /// <summary>
        /// 头像闪动
        /// </summary>
        /// <param name="alInpatientNO"></param>
        public void RefreshImage(ArrayList alInpatientNO)
        {
            if (alInpatientNO != null && alInpatientNO.Count > 0)
            {
                bool      isExist     = false;
                Hashtable htInpatient = new Hashtable();
                foreach (string inpatienNO in alInpatientNO)
                {
                    Neusoft.HISFC.Models.RADT.Patient patientInfo = new Neusoft.HISFC.Models.RADT.Patient();
                    foreach (System.Windows.Forms.TreeNode treeNode in this.Nodes)
                    {
                        isExist = false;
                        foreach (System.Windows.Forms.TreeNode subTreeNode in treeNode.Nodes)
                        {
                            if (subTreeNode.Tag is Neusoft.HISFC.Models.RADT.PatientInfo)
                            {
                                patientInfo = subTreeNode.Tag as Neusoft.HISFC.Models.RADT.PatientInfo;

                                if (patientInfo != null && patientInfo.ID == inpatienNO)
                                {
                                    if (subTreeNode.ImageIndex == this.BlankImageIndex)
                                    {
                                        switch (patientInfo.Sex.ID.ToString())
                                        {
                                        case "F":
                                            //男
                                            if (patientInfo.ID.IndexOf("B") > 0)
                                            {
                                                subTreeNode.ImageIndex = this.GirlImageIndex;           //婴儿女
                                            }
                                            else
                                            {
                                                subTreeNode.ImageIndex = this.FemaleImageIndex;         //成年女
                                            }
                                            break;

                                        case "M":
                                            if (patientInfo.ID.IndexOf("B") > 0)
                                            {
                                                subTreeNode.ImageIndex = this.BabyImageIndex;           //婴儿男
                                            }
                                            else
                                            {
                                                subTreeNode.ImageIndex = this.MaleImageIndex;           //成年男
                                            }
                                            break;

                                        default:
                                            subTreeNode.ImageIndex = this.MaleImageIndex;
                                            break;
                                        }
                                    }
                                    else
                                    {
                                        subTreeNode.ImageIndex = this.BlankImageIndex;
                                    }
                                    isExist = true;
                                    break;
                                }
                            }
                        }

                        if (isExist)
                        {
                            break;
                        }
                    }
                }
            }
        }
Example #14
0
        /// <summary>
        /// 住院检查
        /// </summary>
        /// <param name="patient"></param>
        /// <param name="orderList"></param>
        public void ControlValue(Neusoft.HISFC.Models.RADT.Patient patient, List <Neusoft.HISFC.Models.Order.Inpatient.Order> orderList)
        {
            this.neuSpread1_Sheet1.Cells[0, 0].Value = this.mgrIntegrate.GetHospitalName() + orderList[0].Item.Name.ToString() + "检查申请单";

            if (orderList[0].IsEmergency)
            {
                this.neuSpread1_Sheet1.Cells[0, 9].Value         = "加  急";//加急
                this.neuSpread1_Sheet1.Cells.Get(0, 9).ForeColor = System.Drawing.Color.Red;
            }
            if (orderList[0].BeginTime != null)
            {
                this.neuSpread1_Sheet1.Cells[2, 1].Value = orderList[0].BeginTime.ToString();//申请日期
            }
            if (patient.PID.PatientNO != null)
            {
                this.neuSpread1_Sheet1.Cells[2, 5].Value = patient.PID.PatientNO.ToString();//住院号
            }
            if (patient.Pact.Name != null)
            {
                this.neuSpread1_Sheet1.Cells[2, 9].Value = patient.Pact.Name.ToString();//费用类别
            }
            if (patient.Name != null)
            {
                this.neuSpread1_Sheet1.Cells[3, 1].Value = patient.Name.ToString();//姓名
            }
            if (patient.Sex != null)
            {
                this.neuSpread1_Sheet1.Cells[3, 3].Value = patient.Sex.ToString();//性别
            }
            if (patient.Age != null)
            {
                this.neuSpread1_Sheet1.Cells[3, 5].Value = patient.Age.ToString();//年龄
            }
            if (orderList[0].NurseStation.Name != null)
            {
                this.neuSpread1_Sheet1.Cells[3, 7].Value = orderList[0].NurseStation.Name.ToString();//病区
            }
            if (orderList[0].Patient.PVisit.PatientLocation.Bed.ID != null)
            {
                this.neuSpread1_Sheet1.Cells[3, 9].Value = orderList[0].Patient.PVisit.PatientLocation.Bed.ID.ToString();//床号
            }
            Neusoft.HISFC.Models.Fee.Item.Undrug undrug = new Neusoft.HISFC.Models.Fee.Item.Undrug();

            Neusoft.HISFC.BizLogic.Fee.Item item = new Neusoft.HISFC.BizLogic.Fee.Item();

            undrug = item.GetValidItemByUndrugCode(orderList[0].Item.ID.ToString());

            if (undrug.CheckRequest != null)
            {
                this.neuSpread1_Sheet1.Cells[4, 1].Value = undrug.CheckRequest.ToString();//检查部位/要求
            }
            #region  诊断(代码摘自ucDiagnosis FillList())
            Neusoft.HISFC.BizProcess.Integrate.HealthRecord.HealthRecordBaseMC diagnoseMgrMc = new Neusoft.HISFC.BizProcess.Integrate.HealthRecord.HealthRecordBaseMC();
            Neusoft.HISFC.BizProcess.Integrate.Manager managerIntegrate = new Neusoft.HISFC.BizProcess.Integrate.Manager();

            Neusoft.HISFC.Models.HealthRecord.Diagnose diagns = null;
            Neusoft.HISFC.Models.Base.Spell            dsType = null;
            Neusoft.HISFC.Models.Base.Employee         emp    = null;

            //ArrayList diagnoseList = diagnoseMgrMc.QueryDiagnoseBoth(orderList[0].Patient.PVisit.PatientLocation.Bed.InpatientNO.ToString());
            ArrayList diagnoseList = diagnoseMgrMc.QueryDiagnoseBoth(orderList[0].Patient.ID);
            ArrayList dsTypeList   = Neusoft.HISFC.Models.HealthRecord.DiagnoseType.SpellList();
            ArrayList drList       = managerIntegrate.QueryEmployee(Neusoft.HISFC.Models.Base.EnumEmployeeType.D);
            String    strDsType    = "";
            String    strDrName    = "";
            string    diag         = string.Empty;
            if (diagnoseList != null)
            {
                for (int i = 0; i < diagnoseList.Count; i++)
                {
                    diagns = (Neusoft.HISFC.Models.HealthRecord.Diagnose)diagnoseList[i];
                    for (int j = 0; j < dsTypeList.Count; j++)
                    {
                        dsType = (Neusoft.HISFC.Models.Base.Spell)dsTypeList[j];
                        if (dsType.ID.ToString() == diagns.DiagInfo.DiagType.ID)
                        {
                            strDsType = dsType.Name;//诊断类型
                            break;
                        }
                    }
                    //填入诊断医生姓名
                    for (int j = 0; j < drList.Count; j++)
                    {
                        emp = (Neusoft.HISFC.Models.Base.Employee)drList[j];
                        if (emp.ID.ToString() == diagns.DiagInfo.Doctor.ID)
                        {
                            strDrName = emp.Name;
                            break;
                        }
                    }
                    if (i == 0)
                    {
                        diag = "[" + strDsType + "-" + diagns.DiagInfo.ICD10.Name.ToString() + "-" + strDrName + "]";
                    }
                    else
                    {
                        diag = diag + "[" + strDsType + "-" + diagns.DiagInfo.ICD10.Name.ToString() + "-" + strDrName + "]";
                    }
                }
            }
            this.neuSpread1_Sheet1.Cells[9, 1].Value = diag;
            #endregion

            if (orderList[0].ReciptDoctor.Name != null)
            {
                this.neuSpread1_Sheet1.Cells[19, 1].Value = orderList[0].Memo.ToString();//备注
            }
            if (orderList[0].Memo != null)
            {
                this.neuSpread1_Sheet1.Cells[25, 9].Value = orderList[0].ReciptDoctor.Name.ToString();//医师
            }
            if (undrug.Notice != null)
            {
                this.neuSpread1_Sheet1.Cells[22, 1].Value = undrug.Notice.ToString();//注意事项
            }
        }
Example #15
0
        /// <summary>
        /// 导出患者费用信息
        /// </summary>
        /// <param name="alFeeDetail">费用信息</param>
        /// <param name="p">患者信息</param>
        /// <param name="errTxt">错误信息</param>
        /// <returns>1成功 -1失败</returns>
        public int ExportInpatientFeedetail(string path, string tablename, Neusoft.HISFC.Models.RADT.Patient p, ArrayList alFeeDetail, ref string errTxt)
        {
            if (!System.IO.Directory.Exists(path))
            {
                System.IO.Directory.CreateDirectory(path);
            }
            //try
            //{
            //    foreach (string file in System.IO.Directory.GetFiles(path))
            //    {
            //        System.IO.File.Delete(file);
            //    }
            //}
            //catch { }


            string connect = @"Driver={Microsoft dBASE Driver (*.dbf)};DriverID=277; Dbq=" + path;

            System.Data.Odbc.OdbcConnection myconn = new System.Data.Odbc.OdbcConnection(connect);

            string drop = "drop table " + tablename;

            string create = "create table " + tablename +
                            @"(GRSHBZH CHAR(20) , ZYH CHAR(12) , XMXH NUMERIC , XMBH CHAR(15) , XMMC CHAR(40) , FLDM CHAR(3),
                        YPGG CHAR(15),YPJX CHAR(8), JG NUMERIC , MCYL NUMERIC , JE NUMERIC , ZFBL NUMERIC ,
                        ZFJE NUMERIC , CZFBZ CHAR(3) , BZ1 CHAR(20) , BZ2 CHAR(20) , BZ3 CHAR(20))";


            System.Data.Odbc.OdbcCommand cmDrop   = new System.Data.Odbc.OdbcCommand(drop, myconn);
            System.Data.Odbc.OdbcCommand cmCreate = new System.Data.Odbc.OdbcCommand(create, myconn);

            myconn.Open();

            //try
            //{
            //    cmDrop.ExecuteNonQuery();
            //}
            //catch { }
            try
            {
                cmCreate.ExecuteNonQuery();
            }
            catch (Exception ex)
            {
                errTxt = "导出文件出错" + ex.Message;
                return(-1);
            }


            System.Data.Odbc.OdbcCommand cmInsert = new System.Data.Odbc.OdbcCommand();
            cmInsert.Connection = myconn;
            int i = 1;

            //System.Data.Odbc.OdbcTransaction trans = myconn.BeginTransaction(System.Data.IsolationLevel.ReadCommitted);

            foreach (Neusoft.HISFC.Models.Fee.Inpatient.FeeItemList f in alFeeDetail)
            {
                string insert = "insert into " + tablename +
                                @"(GRSHBZH, ZYH, XMXH, XMBH , XMMC , FLDM ,YPGG ,YPJX ,JG , MCYL, JE, ZFBL,ZFJE, CZFBZ, BZ1, BZ2, BZ3
                )
                values
                (
                  '{0}','{1}',{2},'{3}', '{4}', '{5}','{6}','{7}',{8},{9},{10},{11},{12},'{13}','{14}','{15}','{16}'
                )";



                //传过去的价格应该是优惠之后的价格
                try
                {
                    insert = string.Format(insert, p.IDCard, p.PID.PatientNO, f.Item.User02, f.Item.UserCode, f.Item.Name, f.Item.SysClass.Name, f.Item.Specs, f.Item.User01,
                                           f.Item.Price, f.NoBackQty, f.FT.OwnCost, 0, 0, 0, "", "", "");
                }
                catch (Exception ex)
                {
                    //trans.Rollback();
                    errTxt = "导出文件出错" + ex.Message;
                    return(0);
                }
                i++;
                cmInsert.CommandText = insert;
                //cmInsert.Transaction = trans;
                try
                {
                    cmInsert.ExecuteNonQuery();
                }
                catch (Exception ex)
                {
                    //trans.Rollback();
                    errTxt = "导出文件出错" + ex.Message;
                    return(-1);
                }
            }
            //trans.Commit();
            cmInsert.Dispose();
            cmCreate.Dispose();
            cmDrop.Dispose();
            myconn.Close();
            try
            {
                string file = System.IO.Directory.GetFiles(path)[0];

                System.IO.FileInfo fileInfo = new System.IO.FileInfo(file);
                fileInfo.MoveTo(path + @"\" + tablename);
            }
            catch { }
            return(1);
        }