Beispiel #1
0
        /// <summary>
        /// 将评分信息插入到评分表里
        /// 此处需判断此登录人的身份,如为质控科人员则操作EmrRHQcPoint表(质控科可对在院和出院的进行评分操作)对应了RecordType字段
        /// 如为科室质控员则操作Emr_RHPoint表(控制病历评分的状态StateID)
        /// </summary>
        private void Save()
        {
            string     stRHQCTableid = dtRHQCReport.Rows[0]["id"].ToString();
            RHEmrPoint emrPoint      = new RHEmrPoint();

            emrPoint.Valid          = "1";
            emrPoint.DoctorID       = lookUpEditDoctor.CodeValue.ToString();
            emrPoint.DoctorName     = lookUpEditDoctor.Text;
            emrPoint.CreateUserID   = m_App.User.Id;
            emrPoint.CreateUserName = m_App.User.Name;
            emrPoint.ProblemDesc    = memoEditDesc.Text;
            emrPoint.RecordDetailID = lookUpEditEmrDoc.EditValue.ToString();
            emrPoint.ReducePoint    = lookReduction.DisplayValue.ToString();
            emrPoint.CreateTime     = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            //emrPoint.ReducePoint = lookUpEditGrade.EditValue.ToString();
            //emrPoint.Grade = lookUpEditGrade.Text;
            if (lookReduction.DisplayValue.ToString().Contains("."))//处理 是小数分数的情况
            {
                decimal dec = Decimal.Parse(lookReduction.DisplayValue.ToString());
                emrPoint.Grade = dec.ToString().TrimEnd('0') + "级";
            }
            else
            {
                emrPoint.Grade = lookReduction.DisplayValue.ToString() + "级";
            }
            emrPoint.Num              = spinEditNum.Text;
            emrPoint.Noofinpat        = m_NoOfInpat;
            emrPoint.RecordDetailName = lookUpEditEmrDoc.Text;

            //大类别编号(AC,AB)
            string    id       = lookUpEditEmrDoc.EditValue.ToString();//取到recorddetail主键ID
            DataTable dtRecord = new DataTable();
            string    searchsq = string.Format(@" select sortid from  recorddetail where id ='{0}' ", id);

            dtRecord = m_App.SqlHelper.ExecuteDataTable(searchsq);
            string sortid = "";

            if (dtRecord.Rows.Count > 0)
            {
                sortid = dtRecord.Rows[0]["sortid"].ToString();
            }
            else
            {
                //大项从dict_catalog表里取数据
                string slq = string.Format(@" select ccode from   dict_catalog where cname='{0}'", lookUpEditEmrDoc.Text);
                if (m_App.SqlHelper.ExecuteDataTable(slq).Rows.Count > 0)
                {
                    sortid = m_App.SqlHelper.ExecuteDataTable(slq).Rows[0]["ccode"].ToString();
                }
            }

            //评分配置表的主键
            if (string.IsNullOrEmpty(lookUpEPoint.CodeValue))//评分配置表未进行配置,ID取recorddetail 里的相应的ID
            {
                //string sqlsec = string.Format(@"select ID from recorddetail where sortid='{0}' and  name ='{1}'",lookUpEditEmrDoc.EditValue.ToString(),lookUpEditEmrDoc.Text);
                //DataTable dtid = m_App.SqlHelper.ExecuteDataTable(sqlsec);
                //if (dtid.Rows.Count > 0)
                //{
                //    emrPoint.EmrPointID = Int32.Parse(dtid.Rows[0]["ID"].ToString());
                //}
                //else
                //{
                //    emrPoint.EmrPointID = 0;
                //}
                emrPoint.EmrPointID = Int32.Parse(lookUpEditEmrDoc.EditValue.ToString());
            }
            else
            {
                emrPoint.EmrPointID = Int32.Parse(lookUpEPoint.CodeValue);
            }
            emrPoint.SortID = sortid;

            m_SqlManger.InsertRHEmrPoint(emrPoint, stRHQCTableid);
        }