/// <summary> /// 更新检查医生日期 /// </summary> /// <param name="jyjg"></param> /// <param name="sqls"></param> private void Update_jcys(Jyjgb jyjg, List <string> sqls) { sql = new StringBuilder("update b set b.jcys='" + Program.userid + "',b.jcrq=getdate() from tj_tjjlmxb a join tj_tjjlb b on a.xh=b.xh"); sql.Append(" join TJ_JGXMDZB c on a.tjxm=c.tjmxxm join tj_tjdjb d on b.tjbh=d.tjbh and b.tjcs=d.tjcs "); sql.Append(" where djlsh='" + jyjg.Djlsh + "' and gjc='" + jyjg.Xmbh + "' and tjlx='06'"); sqls.Add(sql.ToString()); }
/// <summary> /// 发布结果用 /// </summary> /// <param name="djlsh"></param> /// <returns></returns> List <Jyjgb> GetJyjgs_fb(string djlsh) { dt = new DataTable(); dt = jyjkBiz.GetJyjg(djlsh, cmbJyyq.SelectedValue.ToString()); if (dt.Rows.Count <= 0) { MessageBox.Show("没有找到需要发布的结果\n可能您还未保存,请先保存后发布!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return(new List <Jyjgb>()); } List <Jyjgb> jyjgs = new List <Jyjgb>(); Jyjgb jyjg; for (int i = 0; i < dt.Rows.Count; i++) { jyjg = new Jyjgb(); jyjg.Djlsh = dt.Rows[i]["djlsh"].ToString().Trim(); jyjg.Xmbh = dt.Rows[i]["xmbh"].ToString().Trim(); jyjg.Jg = dt.Rows[i]["jg"].ToString().Trim(); jyjg.Dy = dt.Rows[i]["dy"].ToString().Trim(); jyjg.Xy = dt.Rows[i]["xy"].ToString().Trim(); jyjg.Djid = dt.Rows[i]["djid"].ToString().Trim(); jyjgs.Add(jyjg); } return(jyjgs); }
/// <summary> /// 更新检验结果 /// </summary> /// <param name="jyjg"></param> /// <param name="sqls"></param> public void UpdateJg(Jyjgb jyjg, List <string> sqls) { sql = new StringBuilder("update a set jg='" + jyjg.Jg + "' from tj_tjjlmxb a join tj_tjjlb b on a.xh=b.xh " + "join TJ_JGXMDZB c on a.tjxm=c.tjmxxm "); sql.Append(" join tj_tjdjb d on b.tjbh=d.tjbh and b.tjcs=d.tjcs where djlsh='" + jyjg.Djlsh + "' and gjc='" + jyjg.Xmbh + "' and tjlx='06'"); sqls.Add(sql.ToString()); }
/// <summary> /// 插入检验结果表 /// </summary> /// <param name="jyjg"></param> /// <param name="sql"></param> public void InsertJyjg(Jyjgb jyjg, List <string> sqls) { sql = new StringBuilder("insert into jy_jyjgb(djlsh,xmbh,djid,jg) values('"); sql.Append(jyjg.Djlsh + "','"); sql.Append(jyjg.Xmbh + "','"); sql.Append(jyjg.Djid + "','"); sql.Append(jyjg.Jg + "')"); sqls.Add(sql.ToString()); }
/// <summary> /// 保存结果用 /// </summary> /// <param name="djlsh"></param> /// <returns></returns> List <Jyjgb> GetJyjgs(string djlsh, string djid) { List <Jyjgb> jyjgs = new List <Jyjgb>(); Jyjgb jyjg; for (int i = 0; i < dgvJyjg.Rows.Count; i++) { jyjg = new Jyjgb(); jyjg.Djlsh = djlsh; jyjg.Xmbh = dgvJyjg.Rows[i].Cells["xmbh"].Value.ToString().Trim(); jyjg.Jg = dgvJyjg.Rows[i].Cells["jg"].Value.ToString().Trim(); jyjg.Djid = djid; jyjgs.Add(jyjg); } return(jyjgs); }
/// <summary> /// 保存阳性、进入小结等 /// </summary> /// <param name="yqlx">仪器类型</param> /// <param name="value">结果值</param> /// <param name="key">结果编号</param> /// <param name="tjbh">体检编号</param> /// <param name="sqls"></param> private void Update_sfyc(Jyjgb jyjg, List <string> sqls) { sql = new StringBuilder("update a set a.jrxj=case when a.jg='阴性' or a.jg between dy1 and xy1 then 0 else 1 end ,a.mcjrxj=case when a.jg='阴性' or a.jg between dy1 and xy1 then 0 else 1 end ,a.sfyx=case when a.jg='阴性' or a.jg between dy1 and xy1 then 0 else 1 end " + " from tj_tjjlmxb a join tj_tjjlb b on a.xh=b.xh join TJ_JGXMDZB c on a.tjxm=c.tjmxxm join tj_tjdjb d on b.tjbh=d.tjbh and b.tjcs=d.tjcs " + " join v_jy_xmjg e on c.gjc=e.xmbh and d.djlsh=e.djlsh "); sql.Append("where d.djlsh='" + jyjg.Djlsh + "' and gjc='" + jyjg.Xmbh + "'"); sqls.Add(sql.ToString()); #region 取体检中的参考值 //sql = new StringBuilder("select xb,nl,gz from jy_jydj where djid='" + jyjg.Djid + "'"); //DataTable dt = new DataTable(); //dt = base.SqlDBAgent.GetDataTable(sql.ToString()); //if (dt.Rows.Count == 0) //{ // return; //} //string xb = dt.Rows[0]["xb"].ToString().Trim(); //string nl = dt.Rows[0]["nl"].ToString().Trim(); //string gzmc = dt.Rows[0]["gz"].ToString().Trim(); //sql = new StringBuilder("select bzdm gzid from xt_zdxm where zdflbm='19' and xmmc='" + gzmc + "'"); //dt = new DataTable(); //if (dt.Rows.Count == 0) //{ // return; //} //string gzid = dt.Rows[0]["gzid"].ToString().Trim(); //string tjxm = GetTjxm(jyjg.Xmbh); //if (tjxm == "") //{ // return; //} //if (nl == "") //{ // nl = "0"; //} //dt = new DataTable(); //dt = jgBiz.Get_pro_get_ckz("06", tjxm, xb, Convert.ToInt32(nl), gzid); //decimal xx = 0, sx = 0, jg = 0; //string jrxj = "0", mcjrxj = "0", sfyx = "0"; //if (dt.Rows.Count > 0) //{ // string ckz = dt.Rows[0][0].ToString().Trim(); // try // { // xx = Convert.ToDecimal(ckz.Split('—')[0]); // sx = Convert.ToDecimal(ckz.Split('—')[1]); // try // { // jg = Convert.ToDecimal(jyjg.Jg.Trim()); // if (jg >= xx && jg <= sx) // { // jrxj = "0"; // mcjrxj = "0"; // sfyx = "0"; // } // else // { // jrxj = "1"; // mcjrxj = "1"; // sfyx = "1"; // } // } // catch // { // if (jyjg.Jg == "阴性") // { // jrxj = "0"; // mcjrxj = "0"; // sfyx = "0"; // } // else // { // jrxj = "1"; // mcjrxj = "1"; // sfyx = "1"; // } // } // } // catch // { // if (jyjg.Jg == "阴性") // { // jrxj = "0"; // mcjrxj = "0"; // sfyx = "0"; // } // else // { // jrxj = "1"; // mcjrxj = "1"; // sfyx = "1"; // } // } //} //else //{ // if (jyjg.Jg == "阴性") // { // jrxj = "0"; // mcjrxj = "0"; // sfyx = "0"; // } // else // { // jrxj = "1"; // mcjrxj = "1"; // sfyx = "1"; // } //} //sql = new StringBuilder("update a set a.jrxj='" + jrxj + "' ,a.mcjrxj='" + mcjrxj + "' ,a.sfyx='" + sfyx + "' " // + " from tj_tjjlmxb a join tj_tjjlb b on a.xh=b.xh join TJ_JGXMDZB c on a.tjxm=c.tjmxxm join tj_tjdjb d on b.tjbh=d.tjbh and b.tjcs=d.tjcs " // + " join v_jy_xmjg e on c.gjc=e.xmbh and d.djlsh=e.djlsh "); //sql.Append("where d.djlsh='" + jyjg.Djlsh + "' and gjc='" + jyjg.Xmbh + "'"); //sqls.Add(sql.ToString()); #endregion }
/// <summary> /// 更新检验结果 /// </summary> /// <param name="jyjg"></param> /// <param name="sqls"></param> public void UpdateJyjg(Jyjgb jyjg, List <string> sqls) { sql = new StringBuilder("update jy_jyjgb set jg='" + jyjg.Jg + "', djid='" + jyjg.Djid + "' where xmbh='" + jyjg.Xmbh + "' and djlsh='" + jyjg.Djlsh + "' "); sqls.Add(sql.ToString()); }