public void InsertRHEmrPoint(RHEmrPoint emrPoint, string rhqcTableId) { string guidstr = Guid.NewGuid().ToString(); string sqlinsert = string.Format(@"insert into emr_rhpoint values ('{0}','{1}','{2}','{3}','{4}','{5}','{6}',{7},'{8}',{9},'{10}',null,null,'{11}','{12}',null,'{13}','{14}','{15}','{16}')", guidstr, emrPoint.Noofinpat, emrPoint.RecordDetailID, emrPoint.DoctorID, emrPoint.CreateUserID, emrPoint.CreateTime, emrPoint.ProblemDesc, emrPoint.ReducePoint, emrPoint.Grade, emrPoint.Num, emrPoint.Valid, emrPoint.DoctorName, emrPoint.CreateUserName, emrPoint.RecordDetailName, emrPoint.EmrPointID, emrPoint.SortID, rhqcTableId); m_app.SqlHelper.ExecuteNoneQuery(sqlinsert); }
public void CancelRHEmrPoint(RHEmrPoint emrPoint) { SqlParameter[] sqlParams = new SqlParameter[] { new SqlParameter("@ID", SqlDbType.VarChar), new SqlParameter("@cancel_user", SqlDbType.VarChar), new SqlParameter("@cancel_userName", SqlDbType.VarChar), }; sqlParams[0].Value = emrPoint.ID; sqlParams[1].Value = emrPoint.CancelUserID; sqlParams[2].Value = emrPoint.CancelUserName; m_app.SqlHelper.ExecuteNoneQuery("EMRQCMANAGER.usp_cancelRHEmrPoint", sqlParams, CommandType.StoredProcedure); }
private bool IsDelSucess;//判断是否删除成功 private void DeleteRow() { DataRowView drv = gridView1.GetRow(gridView1.FocusedRowHandle) as DataRowView; if (drv != null) { //取得创建人(只能创建人可以删除自己的评分信息)add by ywk 2012年6月12日 14:15:12 //string createuser = drv["CREATE_USER"].ToString(); //if (m_App.User.Id!=createuser)//当前登录者不是此项的创建人 //{ // m_App.CustomMessageBox.MessageShow("只有评分创建人可以进行删除!"); // IsDelSucess = false; // return; //} string id = drv["ID"].ToString(); RHEmrPoint emrPoint = new RHEmrPoint(); emrPoint.ID = id; emrPoint.CancelUserID = m_App.User.DoctorId; emrPoint.CancelUserName = m_App.User.DoctorName; m_SqlManger.CancelRHEmrPoint(emrPoint); } }
public void InsertEmrPoint(RHEmrPoint emrPoint) { SqlParameter[] sqlParams = new SqlParameter[] { new SqlParameter("@doctorID", SqlDbType.VarChar), new SqlParameter("@doctorname", SqlDbType.VarChar), new SqlParameter("@create_user", SqlDbType.VarChar), new SqlParameter("@createusername", SqlDbType.VarChar), new SqlParameter("@problem_desc", SqlDbType.VarChar), new SqlParameter("@reducepoint", SqlDbType.VarChar), new SqlParameter("@num", SqlDbType.VarChar), new SqlParameter("@grade", SqlDbType.VarChar), new SqlParameter("@recorddetailid", SqlDbType.VarChar), new SqlParameter("@noofinpat", SqlDbType.VarChar), new SqlParameter("@recorddetailname", SqlDbType.VarChar), //新增评分配置表主键 new SqlParameter("@emrpointid", SqlDbType.Int), //新增大类别编号 new SqlParameter("@sortid", SqlDbType.VarChar) }; sqlParams[0].Value = emrPoint.DoctorID; sqlParams[1].Value = emrPoint.DoctorName; sqlParams[2].Value = emrPoint.CreateUserID; sqlParams[3].Value = emrPoint.CreateUserName; sqlParams[4].Value = emrPoint.ProblemDesc; sqlParams[5].Value = emrPoint.ReducePoint; sqlParams[6].Value = emrPoint.Num; sqlParams[7].Value = emrPoint.Grade; sqlParams[8].Value = emrPoint.RecordDetailID; sqlParams[9].Value = emrPoint.Noofinpat; sqlParams[10].Value = emrPoint.RecordDetailName; sqlParams[11].Value = emrPoint.EmrPointID; sqlParams[12].Value = emrPoint.SortID; m_app.SqlHelper.ExecuteNoneQuery("EMRQCMANAGER.usp_insertEmrPoint", sqlParams, CommandType.StoredProcedure); }
/// <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); }