承志医院管理系统项目解析 门诊医生工作站—书写病历(四)
2015-05-30 15:03
501 查看
1.3门诊医生工作站
由门诊医生进行看病,开药与诊疗方案。1.31书写病历
书写病历这个模块,主要是给病人写病历,如图(1)
图(1)
控件名称 | 说明 |
日期控件(DateTimePicker) | 控件可以在工具箱直接拖动至窗体,拖至窗体后右击属性可以修改控件的样式和各种属性,还可以编辑事件。 |
树形控件(TreeView) | |
文本(TextBox) | |
按钮(Button) | |
表格(DataGridView) | |
选项卡(TabControl) |
第一步:数据库
1、表与关系
表1:简单元素表(MZ_SimplenessElementList)
列名 | 数据类型 | 主键/外键 | 说明 |
SimplenessElementID | int | 主键 | 简单因素ID |
SimplenessElementName | nchar(30) | 简单元素名称 | |
SimplenessElementID_f | int | 简单元素ID_F |
第一步:数据库的存储过程
if(@Type='Frm_MenZhenYiShengGongZuoZhan_ChaXunYuanSu') begin SELECT SimplenessElementID, RTRIM(LTRIM(SimplenessElementName)) as SimplenessElementName, SimplenessElementID_f FROM MZ_SimplenessElementList where SimplenessElementID_f=@SimplenessElementID_f end
第二步:逻辑层(BLL)代码
DALPublic.DALMethod myDALMethod = new DALPublic.DALMethod(); [OperationContract] public DataSet Frm_MenZhenYiShengGongZuoZhan_ChaXunYuanSu(int intJianDanYuanSuFuID) { SqlParameter[] mySqlParameters = { new SqlParameter ("@Type",SqlDbType .Char), new SqlParameter ("@SimplenessElementID_f",SqlDbType.Int), }; mySqlParameters[0].Value = "Frm_MenZhenYiShengGongZuoZhan_ChaXunYuanSu"; mySqlParameters[1].Value = intJianDanYuanSuFuID; DataTable dt = myDALMethod.QueryDataTable("门?诊?登Ì?记?_Frm_MenZhenYiShengGongZuoZhan", mySqlParameters); DataSet ds = new DataSet(); ds.Tables.Add(dt); return ds; }
第三步:界面层(UIL)代码
#region 绑定DGV和树节点 private void Frm_MenZhenYiShengGongZuoZhan_Load(object sender, EventArgs e) { if (chkMedicine.Checked == true) { txtTieShu.ReadOnly = false; } else { txtTieShu.ReadOnly = true; txtTieShu.BackColor = Color.Silver; } dgvPayMoneyHelpCheck.DataSource = myFrm_MenZhenYiShengGongZuoZhanClient.Frm_MenZhenYiShengGongZuoZhan_ChaXunHelpCheckListNotShouFei().Tables[0]; dgvWeiShouFeiChuZhiXinXi.DataSource = myFrm_MenZhenYiShengGongZuoZhanClient.Frm_MenZhenYiShengGongZuoZhan_ChaXunPrescriptionBillsList().Tables[0]; dgvWeiShouFeiLieBiao.DataSource = myFrm_MenZhenYiShengGongZuoZhanClient.Frm_MenZhenYiShengGongZuoZhan_ChaXunPrescriptionBillsList().Tables[0]; dgvHangNumberPatient.DataSource = myFrm_MenZhenYiShengGongZuoZhanClient.Frm_MenZhenYiShengGongZuoZhan_ChaXunBingRen().Tables[0]; dgvHangNumberPatient2.DataSource = myFrm_MenZhenYiShengGongZuoZhanClient.Frm_MenZhenYiShengGongZuoZhan_ChaXunBingRen().Tables[0]; bingdingRootNode(); } private void bingdingRootNode() { DataTable dtYuanSu = myFrm_MenZhenYiShengGongZuoZhanClient.Frm_MenZhenYiShengGongZuoZhan_ChaXunYuanSu(0).Tables[0];//查询数据绑定数据表,获取父节点 for (int i = 0; i < dtYuanSu.Rows.Count; i++)//循环遍历数据 { TreeNode tn = new TreeNode();//实例化一个树节点 tn.Text = dtYuanSu.Rows[i]["SimplenessElementName"].ToString();//在树节点绑定文本 tn.Tag = dtYuanSu.Rows[i]["SimplenessElementID"];//获取ID tvwSimplenessElement.Nodes.Add(tn);//然后放在tvwSimplenessElement bingdingChildNode(tn);//在Load事件绑定 } } private void bingdingChildNode(TreeNode tnF) { DataTable DT = myFrm_MenZhenYiShengGongZuoZhanClient.Frm_MenZhenYiShengGongZuoZhan_ChaXunYuanSu(int.Parse(tnF.Tag.ToString())).Tables[0];//根据父节点绑定数据 for (int i = 0; i < DT.Rows.Count; i++) { TreeNode tn = new TreeNode(); tn.Text = DT.Rows[i]["SimplenessElementName"].ToString(); tn.Tag = DT.Rows[i]["SimplenessElementID"]; tnF.Nodes.Add(tn); bingdingChildNode(tn); } } #endregion
3:点击哪个文本框值就传到哪里
#region 双击树节点传值 private void tvwSimplenessElement_DoubleClick(object sender, EventArgs e) { try { int nodeTag = Convert.ToInt32(tvwSimplenessElement.SelectedNode.Tag.ToString());//获取当前节点数据 DataTable DT = myFrm_MenZhenYiShengGongZuoZhanClient.Frm_MenZhenYiShengGongZuoZhan_ChaXunYuanSuMingXi(nodeTag).Tables[0]; for (int i = 0; i < DT.Rows.Count; i++) { if (kaiguan == 0) { txtZhuSu.Text += DT.Rows[i]["SimplenessElementName"].ToString().Trim() + ", "; return; } if (kaiguan == 1) { txtNowIllnessHistory.Text += DT.Rows[i]["SimplenessElementName"].ToString().Trim() + " , "; return; } if (kaiguan == 2) { txtBeforeHistory.Text += DT.Rows[i]["SimplenessElementName"].ToString().Trim() + " , "; return; } if (kaiguan == 3) { txtAllergyHistory.Text += DT.Rows[i]["SimplenessElementName"].ToString().Trim() + " , "; return; } if (kaiguan == 4) { txtCheckBuild.Text += DT.Rows[i]["SimplenessElementName"].ToString().Trim() + " , "; return; } if (kaiguan == 5) { txtPreliminaryDiagnosis.Text += DT.Rows[i]["SimplenessElementName"].ToString().Trim() + " , "; return; } if (kaiguan == 6) { txtDealwithIdea.Text += DT.Rows[i]["SimplenessElementName"].ToString().Trim() + " , "; return; } } } catch { } } private void txtNowIllnessHistory_Click(object sender, EventArgs e) { kaiguan = 1;//定义开关 } private void txtZhuSu_Click(object sender, EventArgs e) { kaiguan = 0; } private void txtBeforeHistory_Click(object sender, EventArgs e) { kaiguan = 2; } private void txtAllergyHistory_Click(object sender, EventArgs e) { kaiguan = 3; } private void txtCheckBuild_Click(object sender, EventArgs e) { kaiguan = 4; } private void txtPreliminaryDiagnosis_Click(object sender, EventArgs e) { kaiguan = 5; } private void txtDealwithIdea_Click(object sender, EventArgs e) { kaiguan = 6 ; } #endregion
4:保存当前病历
第一步:数据库
1、表与关系
表1:病历表
Primary Key(s): BingLiID
列名 | 数据类型 | 说明 |
BingLiID | int - Identity | 病历ID |
ZhuSu | nchar (50) | 主诉 |
NowIllnessHistory | nchar (50) | 现病史 |
BeforeHistory | nchar (50) | 既往史 |
AllergyHistory | nchar (50) | 过敏史 |
CheckBuild | nchar (50) | 体格检查 |
PreliminaryDiagnosis | nchar (50) | 初步诊断 |
DealwithIdea | nchar (100) | 处理意见 |
BeforeNo | bit | 以往否 |
MenZhenRegisterID | int | 门诊登记ID |
RegisterTime | datetime | 登记时间 |
InHospitalNo | bit | 住院否 |
if(@Type='Frm_MenZhenYiShengGongZuoZhan_BingLiInsert') begin insert MZ_BingLiList(ZhuSu, NowIllnessHistory, BeforeHistory, AllergyHistory, CheckBuild, PreliminaryDiagnosis, DealwithIdea, BeforeNo, MenZhenRegisterID, RegisterTime) values (@ZhuSu, @NowIllnessHistory, @BeforeHistory, @AllergyHistory, @CheckBuild, @PreliminaryDiagnosis, @DealwithIdea, @BeforeNo, @MenZhenRegisterID, @RegisterTime) end
第二步:逻辑层(BLL)代码
<pre class="csharp" name="code"> [OperationContract] public int Frm_MenZhenYiShengGongZuoZhan_BingLiInsert(string strZhuShu, string strXianBingShi, string strJiWangShi , string strGuoMingShi, string strTiGeJianCha, string strChuBuZhenDuan, string strChuLiYiJian, bool YiWangFou, int intMenZhenDengJiID, DateTime DengJiShiJian) { SqlParameter[] mySqlParameters = { new SqlParameter ("@Type",SqlDbType .Char), new SqlParameter ("@ZhuSu",SqlDbType.Char), new SqlParameter ("@NowIllnessHistory",SqlDbType .Char), new SqlParameter ("@BeforeHistory",SqlDbType .Char), new SqlParameter ("@AllergyHistory",SqlDbType .Char), new SqlParameter ("@CheckBuild",SqlDbType.Char), new SqlParameter ("@PreliminaryDiagnosis",SqlDbType.Char), new SqlParameter ("@DealwithIdea",SqlDbType.Char), new SqlParameter ("@BeforeNo",SqlDbType.Bit), new SqlParameter ("@MenZhenRegisterID",SqlDbType.Int), new SqlParameter ("@RegisterTime",SqlDbType.DateTime), }; mySqlParameters[0].Value = "Frm_MenZhenYiShengGongZuoZhan_BingLiInsert"; mySqlParameters[1].Value = strZhuShu; mySqlParameters[2].Value = strXianBingShi; mySqlParameters[3].Value = strJiWangShi; mySqlParameters[4].Value = strGuoMingShi; mySqlParameters[5].Value = strTiGeJianCha; mySqlParameters[6].Value = strChuBuZhenDuan; mySqlParameters[7].Value = strChuLiYiJian; mySqlParameters[8].Value = YiWangFou; mySqlParameters[9].Value = intMenZhenDengJiID; mySqlParameters[10].Value = DengJiShiJian; int i = myDALMethod.UpdateData("门诊登记_Frm_MenZhenYiShengGongZuoZhan", mySqlParameters); return i; }
第三步:界面层(UIL)代码
private void BaoCun_Click(object sender, EventArgs e) { if (txtName.Text == "") { MessageBox.Show("还没有选择病人呢?"); return; } if (txtZhuSu.Text == "" || txtNowIllnessHistory.Text == "" || txtBeforeHistory.Text == "" || txtAllergyHistory.Text == "" || txtCheckBuild.Text == "" || txtPreliminaryDiagnosis.Text == "" || txtDealwithIdea.Text == "") { if (MessageBox.Show("当前这位病人的病历还没有写完呢,你确认要保存?", "温馨提示!", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { string strZhuShu = txtZhuSu.Text.Trim(); string strXianBingShi = txtNowIllnessHistory.Text; string strJiWangShi = txtBeforeHistory.Text; string strGuoMingShi = txtAllergyHistory.Text; string strTiGeJianCha = txtCheckBuild.Text; string strChuBuZhenDuan = txtPreliminaryDiagnosis.Text; string strChuLiYiJian = txtDealwithIdea.Text; bool YiWangFou = true; int intMenZhenDengJiID = PublicStatic.intMenZhenGuaHaoID; DateTime DengJiShiJian = Convert.ToDateTime(dtpRegisterTime.Text); int i = myFrm_MenZhenYiShengGongZuoZhanClient.Frm_MenZhenYiShengGongZuoZhan_BingLiInsert(strZhuShu, strXianBingShi, strJiWangShi, strGuoMingShi, strTiGeJianCha, strChuBuZhenDuan, strChuLiYiJian, YiWangFou, intMenZhenDengJiID, DengJiShiJian); if (i > 0) { MessageBox.Show("保存成功!!!"); txtZhuSu.Text = ""; txtNowIllnessHistory.Text = ""; txtBeforeHistory.Text = ""; txtAllergyHistory.Text = ""; txtCheckBuild.Text = ""; txtPreliminaryDiagnosis.Text = ""; txtDealwithIdea.Text = ""; return; } else { MessageBox.Show("保存失败!!!"); } } }
仅供学习,禁止用于商业用途
相关文章推荐
- 微信公众号开发:access_token和jsapi_ticket的缓存和数据库存储方案
- 快速排序
- 【每日scrum】NO.3
- 异常处理的解决方案
- c++ 基本使用
- makefile
- arduino 是什么
- Win 2003 AD以及ISA2006安装配置
- linux学习笔记—shell概述
- 初识android开发,activity的认识
- Log4j
- windows win7 win10 多系统启动菜单 多系统引导设置
- Xen虚拟化--介绍
- 6174问题
- 关于go语言中http做服务器使用正则的实例
- 批量创建用户并生成随机密码
- iOS duplicate symbol 错误
- Android常用的Uri及常用的方法
- 会员卡管理系统技术解析(六)登陆与注册之注册
- Android_SpannableString与SpannableStringBuilder