Example #1
0
        /// <summary>
        /// 完成病历后,结束该份病历对应的时限记录
        /// </summary>
        public void CompleteQCTimeLimit(string recordDetailID)
        {
            try
            {
                Action <string> CompleteQCTimeLimitAction = (id) =>
                {
                    try
                    {
                        DS_SqlHelper.BeginTransaction();

                        DataTable dt = GetRecordDetailInfo(id);
                        if (dt != null && dt.Rows.Count > 0)
                        {
                            CompleteQCTimeLimitInner(dt);
                        }

                        DS_SqlHelper.CommitTransaction();
                    }
                    catch (Exception ex)
                    {
                        DS_SqlHelper.AppDbTransaction.Rollback();
                        throw ex;
                    }
                };
                CompleteQCTimeLimitAction.BeginInvoke(recordDetailID, null, null);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #2
0
 /// <summary>
 /// 保存所有病历
 /// </summary>
 /// <auth>Yanqiao.Cai</auth>
 /// <date>2013-02-21</date>
 /// <param name="list"></param>
 private void SaveRecordsInTran(List <DataRow> list)
 {
     try
     {
         if (null == list || list.Count() == 0)
         {
             return;
         }
         DS_SqlHelper.CreateSqlHelper();
         DS_SqlHelper.BeginTransaction();
         foreach (DataRow dr in list)
         {
             if (dr["sortid"].ToString() == ContainerCatalog.BingChengJiLu && !m_IsNeedBatchInDailyEmr)//如果是病程记录,并且不需要导入病程,则暂时不做任何动作
             {
                 //TODO
             }
             else
             {
                 EmrModel model = new EmrModel(dr);
                 if (null != dr["content"] && !string.IsNullOrEmpty(dr["content"].ToString().Trim()))
                 {
                     model.ModelContent = NewXmlDocument(dr["content"].ToString());
                 }
                 m_RecordDal.InsertModelInstanceInTran(model, Convert.ToInt32(m_CurrentInpatient.NoOfFirstPage));
             }
         }
         DS_SqlHelper.CommitTransaction();
     }
     catch (Exception ex)
     {
         DS_SqlHelper.AppDbTransaction.Rollback();
         throw new Exception(ex.Message);
     }
 }
        /// <summary>
        /// 保存
        /// edit by wangji 2013 1.6
        /// </summary>
        public void Save()
        {
            if (CheckData())
            {
                try
                {
                    //m_App.SqlHelper.BeginTransaction();
                    DS_SqlHelper.BeginTransaction();
                    string consultApplySn = string.Empty;

                    if (m_ConsultApplySN == string.Empty)//新增
                    {
                        consultApplySn = SaveConsultationApply(SaveType.Insert, "");
                        SaveConsultationApplyDept(consultApplySn);
                        #region 注释
                        //                        DataTable dt = gridControlDepartment.DataSource as DataTable;

                        //                        for (int i = 0; i < dt.Rows.Count; i++)
                        //                        {
                        //                            //string orderValue = Convert.ToString(i + 1);
                        //                            //string hospitalCode = lookUpEditorHospital.CodeValue;
                        //                            //string departmentCode = lookUpEditorDepartment.CodeValue;
                        //                            string hospitalCode = dt.Rows[i]["HospitalCode"].ToString();
                        //                            string departmentCode = dt.Rows[i]["DepartmentCode"].ToString();
                        //                            string departmentName = dt.Rows[i]["DepartmentName"].ToString();
                        //                            string employeeCode = dt.Rows[i]["EmployeeID"].ToString();
                        //                            string employeeName = dt.Rows[i]["EmployeeName"].ToString();
                        //                            //string employeeLevelID = lookUpEditorLevel.CodeValue;
                        //                            string employeeLevelID = dt.Rows[i]["employeeLevelID"].ToString();

                        //                            string sql = string.Format(@"select  ID from
                        //consultapplydepartment where CONSULTAPPLYSN='{0}' and DEPARTMENTCODE='{1}'
                        //and EMPLOYEECODE='{2}' and EMPLOYEELEVELID='{3}'", consultApplySn, departmentCode, employeeCode, employeeLevelID);
                        //                            if (m_App.SqlHelper.ExecuteDataTable(sql, CommandType.Text).Rows.Count > 0)
                        //                            {
                        //                                m_App.CustomMessageBox.MessageShow("此病人已申请会诊,请勿重复提交!");

                        //                                string updatesql = string.Format("update consultapplydepartment set valid='0' where CONSULTAPPLYSN='{0}'",consultApplySn);
                        //                                m_App.SqlHelper.ExecuteDataTable(updatesql,CommandType.Text);
                        //                                string updatesql1 = string.Format("update consultapply set valid='0' where CONSULTAPPLYSN='{0}'", consultApplySn);
                        //                                m_App.SqlHelper.ExecuteDataTable(updatesql1, CommandType.Text);
                        //                                string updatesql2 = string.Format("update consultrecorddepartment set valid='0' where CONSULTAPPLYSN='{0}'", consultApplySn);
                        //                                m_App.SqlHelper.ExecuteDataTable(updatesql2, CommandType.Text);
                        //                                gridControlDepartment.DataSource = null;
                        //                            }

                        //}
                        #endregion
                        m_ConsultApplySN = consultApplySn;

                        //m_App.SqlHelper.CommitTransaction();
                    }
                    else//修改
                    {
                        SaveConsultationApply(SaveType.Modify, m_ConsultApplySN);
                        SaveConsultationApplyDept(m_ConsultApplySN);
                        //m_App.SqlHelper.CommitTransaction();
                        //DS_SqlHelper.CommitTransaction();
                    }
                    DS_SqlHelper.CommitTransaction();
                    m_App.CustomMessageBox.MessageShow("保存成功", CustomMessageBoxKind.InformationOk);
                }
                catch (Exception ex)
                {
                    DrectSoft.Common.Ctrs.DLG.MyMessageBox.Show(1, ex);
                    //m_App.SqlHelper.RollbackTransaction();
                }
            }
        }