承志医疗管理系统技术解析住院管理(六)
下面是对医生工作站的一些主体的功能进行描述,和解析说明;
医师对分配好床位的病人进行医嘱录入和处方录入还有一些辅助的检查和对病人的信息修改查看等,功能如下图:
医师点击菜单栏——》护理——》体温单进行对病人的体温录入
录入完成点击保存,保存后可以编辑修改。
医师点击菜单栏——》护理——》过敏药品录入,进行对病人的过敏药品录入,如下图:这部尤为关键,如果病人对某种药品过敏的话,在医生开药的时
候会对病人过敏的药品进行限制
医生对上面的操做好了以后可以进行对病人的处方录入,录入药品时回对病人的过敏药品进行检测,如果病人对某些药品过敏是不能进行此药品的录入的。如下图
录入处方后,医生会对病人属性一些医嘱,就是护士要根据医嘱来对病人进行料理:如下图
除了这些以外,医生站还可以查看病人信息和修改病人资料。
修改资料图如下
从所有界面上可以看到我们这里用到的控件有
控件名称 |
说明 |
日期控件(DateTimePicker) |
控件可以在工具箱直接拖动至窗体,拖至窗体后右击属性可以修改控件的样式和各种属性,还可以编辑事件。 |
下拉框(ComboBox) |
|
文本(TextBox) |
|
按钮(Button) |
|
表格(DataGridView) |
医嘱录入关系图如下图:
病历书写
处方录入
过敏药品录入
表1 医嘱表 ZY_DoctorAdviceList
列名 |
数据类型/主外键 |
说明 |
DoctorAdviceID |
int - Identity(主键) |
医嘱ID |
CheckProject |
nchar (20) |
检查项目 |
DoctorAdviceContent |
nchar (50) |
医嘱内容 |
EntrustNo |
bit |
嘱托否 |
ParturitionManufacturers |
nchar (50) |
生产厂家 |
ChineseMedicinFuShu |
decimal (18) |
中药付数 |
Number |
decimal (18) |
数量 |
OnceDose |
nchar (20) |
单次剂量 |
Unit |
nchar (20) |
单位 |
Specification |
nchar (20) |
规格 |
Contents |
nchar (10) |
含量 |
UnitPrice |
decimal (18, 2) |
单价 |
Money |
decimal (18, 2) |
金额 |
UseMethod |
nchar (20) |
用法 |
Frequency |
decimal (18) |
频率 |
OpenEntrustDate |
datetime |
开嘱日期 |
DoctorID |
Int(外键) |
开嘱医生ID |
ExecuteNurseID |
int(外键) |
执行护士ID |
StopEntrustDate |
datetime |
停嘱日期 |
StopEntrustNo |
bit |
停嘱否 |
RegisterInhospitalID |
int(外键) |
住院登记ID |
SubmitNo |
bit |
提交否 |
表 2床位分配表 ZY_BedLocationAllocationList
列名 |
数据类型/主外键 |
说明 |
BedLocationAllocationID |
int - Identity(主键) |
床位分配ID |
RegisterInhospitalID |
int(外键) |
住院登记ID |
BedLocationID |
int(外键) |
床位ID |
EnterResideTime |
datetime |
入住时间 |
QuitBedTime |
datetime |
退床时间 |
QuitBedNo |
bit |
退床否 |
表3过敏药品录入表
列名 |
数据类型 |
说明 |
AllergicMedicineID |
int - Identity |
过敏药品ID |
MedicineID |
int(外键) |
药品ID |
MedicineName |
nchar (20) |
药品名称 |
AllergicReason |
nchar (50) |
过敏原因 |
CheckResultID |
int(外键) |
药品ID |
RegisterInhospitalID |
int(外键) |
住院登记ID |
Encoding |
nchar (20) |
编码 |
表4影像表
列名 |
数据类型 |
说明 |
ImageID |
int - Identity(主键) |
影像ID |
Date |
nchar (20) |
日期 |
FileName |
nvarchar (MAX) |
文件名 |
Describe |
nvarchar (50) |
描述 |
RegisterInhospitalID |
Int(外键) |
住院登记ID |
表5 体温表
列名 |
数据类型 |
说明 |
TemperatureID |
int - Identity(主键) |
体温ID |
BillsDate |
datetime |
单据日期 |
OperationDate |
datetime |
手术日期 |
InHospitalData |
decimal (18) |
住院天数 |
Temperature1 |
decimal (18, 1) |
体温1 |
Temperature2 |
decimal (18, 1) |
体温2 |
Temperature3 |
decimal (18, 1) |
体温3 |
Temperature4 |
decimal (18, 1) |
体温4 |
Temperature5 |
decimal (18, 1) |
体温5 |
Temperature6 |
decimal (18, 1) |
体温6 |
Pulse1 |
decimal (18, 1) |
脉搏1 |
Pulse2 |
decimal (18, 1) |
脉搏2 |
Pulse3 |
decimal (18, 1) |
脉搏3 |
Pulse4 |
decimal (18, 1) |
脉搏4 |
Pulse5 |
decimal (18, 1) |
脉搏5 |
Pulse6 |
decimal (18, 1) |
脉搏6 |
Breathe1 |
decimal (18) |
呼吸1 |
Breathe2 |
decimal (18) |
呼吸2 |
Breathe3 |
decimal (18) |
呼吸3 |
Breathe4 |
decimal (18) |
呼吸4 |
Breathe5 |
decimal (18) |
呼吸5 |
Breathe6 |
decimal (18) |
呼吸6 |
DefecateNumber |
decimal (18) |
大便次数 |
PeeNumber |
decimal (18) |
小便次数 |
EffluentMeasure |
decimal (18) |
出水量 |
RuWorterMeasure |
decimal (18) |
入水量 |
BloodPressure |
decimal (18) |
血压 |
Height |
decimal (18, 2) |
身高 |
Weight |
decimal (18, 2) |
体重 |
MedicineAllergic |
nvarchar (150) |
药物过敏 |
RegisterInhospitalID |
Int(外键) |
住院登记ID |
表6:病历表
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 |
住院否 |
表7:处方明细表
dbo.MZ_PrescriptionBillsMingXiList
Primary Key(s): PrescriptionBillsMingXiID
列名 |
数据类型 |
说明 |
PrescriptionBillsMingXiID |
int - Identity |
处方明细ID |
MedicineID |
int |
药品ID |
Number |
decimal (18, 2) |
数量 |
PrescriptionBillsID |
int |
处方ID |
SendOutMedicineNo |
bit |
发药否 |
SkinTestID |
int |
皮试ID |
UsageID |
int |
用法ID |
UseMedicineFrequencyID |
int |
用药频率ID |
AtEveryTurnNumber |
decimal (18) |
每次数量 |
AtEveryTurnDoseID |
int |
每次剂量ID |
PayMoney |
decimal (18, 2) |
自付金额 |
OfficeID |
int |
科室ID |
RetreatMedicineNumber |
decimal (18) |
退药数量 |
InhospitalNo |
bit |
住院否 |
具体实现(一)进入医生工作站的主界面病人资料卡片的实现
private void Frm_ZhuYuanYiShengZhancs_Load(object sender, EventArgs e){//清空后再加载plSickMap.Controls.Clear();if (radNoOutHospital.Checked == true && Selecting==false)//如果选择未出院{DataTable dtBingRen = myFrm_ZhuYuanYiShengZhanClient.Frm_ZhuYuanYiShengZhan_SelectBingRenXinXi().Tables[0];//创建数据集把数据表装进去DataView dv = new DataView(dtBingRen);//给数据集条件筛选数据,条件为出院否=0,相当于数据库存储过程中的Where条件dv.RowFilter = "(LeaveHospitalNo=0 and QuitBedNo=0)";//把筛选的数据集转化为数据表dtBingRenXinXi = dv.ToTable();}for (int i = 0, leftX = 10, leftY = 80; i < dtBingRenXinXi.Rows.Count; i++){int RowCount = i / 4;if (i % 4== 0){leftX = 20;}else{leftX += 200;}leftY = RowCount * 180;Button btnXinXi = new Button();btnXinXi.Size = new Size(150, 25);//设置控件的大小btnXinXi.FlatAppearance.BorderSize = 1;//获取用于指示选中状态和鼠标状态的边框外观和颜色。btnXinXi.BackColor = Color.SkyBlue;//设置控件的背景色。btnXinXi.TextAlign = System.Drawing.ContentAlignment.TopLeft;//设置文本对齐方式btnXinXi.FlatStyle = FlatStyle.Flat;//设置按钮控件的平面样式外观。btnXinXi.Location = new Point(leftX, leftY);//控件的坐标string XingBie = dtBingRenXinXi.Rows[i]["Sex"].ToString().Trim();string XingMing = dtBingRenXinXi.Rows[i]["Name"].ToString().Trim();btnXinXi.Text = XingMing;//判断病人性别int QuBie;//如果为男性if (XingBie == "男"){//QuBie赋值为0QuBie = 0;}else{//为女性QuBie赋值为1QuBie = 1;}switch (QuBie){case 0://QuBie赋值为0头像为男btnXinXi.Image = ImgTuiPian.Images["man.gif"];break;case 1://QuBie赋值为1头像为女btnXinXi.Image = ImgTuiPian.Images["wife.gif"];break;}PictureBox pbXinXi = new PictureBox();//实例化PictureBoxpbXinXi.Tag = dtBingRenXinXi.Rows[i]["RegisterInhospitalID"].ToString().Trim();pbXinXi.Size = new Size(150, 150);//设置大小pbXinXi.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;//指示控件的边框样式pbXinXi.Location = new Point(leftX, leftY+25);plSickMap.Controls.Add(btnXinXi);plSickMap.Controls.Add(pbXinXi);pbXinXi.MouseClick += new MouseEventHandler(pbXinXi_MouseClick);//鼠标单击事件pbXinXi.MouseLeave += new EventHandler(pbXinXi_MouseLeave);//鼠标离开事件pbXinXi.MouseEnter += new EventHandler(pbXinXi_MouseEnter);//鼠标进入事件pbXinXi.Paint+=new PaintEventHandler(pbXinXi_Paint);//窗体重绘事件}}public void pbXinXi_Paint(object sender, PaintEventArgs e){PictureBox pb = sender as PictureBox;//把触发事件的对象转换为图片对象Graphics g = e.Graphics;//实例化图片的绘图对象int tag = Convert.ToInt32(pb.Tag); //获取图片对应的住院IDforeach (DataRow dt in dtBingRenXinXi.Rows)//遍历全局变量myDataTable住院表{if (Convert.ToInt32(dt["RegisterInhospitalID"]) == tag)//如果住院表的住院ID与图片对应的ID相等{//给相应变量赋值string Name = dt["Name"].ToString().Trim();string ZhuYuanHao = dt["InHospitalNumber"].ToString().Trim();string XingBie = dt["Sex"].ToString().Trim();string NianLing = dt["Age"].ToString().Trim();string ZhuYuangRiQi = dt["EnterHospitalDate"].ToString().Trim();string YiSheng = dt["DoctorName"].ToString().Trim();g.DrawString( "住院号:" + ZhuYuanHao+"\n"+"\n"+"姓名:" + Name+ " " + "性别:" + XingBie + "\n"+"\n" + "年龄:" + NianLing + " " + "医生:" + YiSheng + "\n"+"\n" + "住院日期:" + ZhuYuangRiQi, new Font("宋体", 10, FontStyle.Regular), SystemBrushes.ControlText, new PointF(10, 5));}}}
然后医生对病人进行检查对对过敏药品的录入。次操作直接影响到医生的开药。具体的实现如下:
单击HbsAg,HCV_Ab。HIV—Ab是实现的代码
private void txtCheck_Click(object sender, EventArgs e){//for 循环为了检查表格中是否存在"HIV-Ab"项目for (int index = 0; index < dgDrugallergicRecord.Rows.Count;index++ ){if(Convert.ToString( dgDrugallergicRecord.Rows[index].Cells["MedicineName"].Value.ToString().Trim()) == "HIV-Ab"){//如果存在则跳出次方法return;}}dgDrugallergicRecord.Rows.Add(3);//添加3行//对应的赋值dgDrugallergicRecord.Rows[dgDrugallergicRecord.Rows.Count - 1].Cells["MedicineName"].Value = "HIV-Ab";dgDrugallergicRecord.Rows[dgDrugallergicRecord.Rows.Count - 2].Cells["MedicineName"].Value = "HCV-Ab";dgDrugallergicRecord.Rows[dgDrugallergicRecord.Rows.Count - 3].Cells["MedicineName"].Value = "HbsAg";dgDrugallergicRecord.Rows[dgDrugallergicRecord.Rows.Count - 1].Cells["AllergicMedicineID"].Value =0;dgDrugallergicRecord.Rows[dgDrugallergicRecord.Rows.Count - 2].Cells["AllergicMedicineID"].Value = 0;dgDrugallergicRecord.Rows[dgDrugallergicRecord.Rows.Count - 3].Cells["AllergicMedicineID"].Value = 0;}
点击删除时要用到数组记录已经移除的项目ID,移除并不是删除,实际删除要单击保存,避免误操作。删除时的操作代码,
#region 删除功能int i = 0;//定义一个变量private void btnShanChu_Click(object sender, EventArgs e){if (dgDrugallergicRecord.Rows.Count > 0)//如果过敏药品表>0{ShuZhu[i] = Convert.ToInt32(dgDrugallergicRecord.Rows[dgDrugallergicRecord.Rows.Count - 1].Cells["AllergicMedicineID"].Value);//用数组记录移除了的IDdgDrugallergicRecord.Rows.RemoveAt(dgDrugallergicRecord.Rows.Count - 1);//移除行i++;//变量每一次都加一}}
保存过敏记录的实现
第一步:数据库存储过程
if @Type='Frm_ZhuYuanYiShengZhan_InsertGuoMinYaoPing'begininsert ZY_AllergicMedicineCheckRecordList ( MedicineID,MedicineName, AllergicReason, CheckResultID,RegisterInhospitalID,Encoding)values ( @MedicineID,@MedicineName, @AllergicReason, @CheckResultID,@RegisterInhospitalID,@Encoding)end
第二步:逻辑层(BLL)代码
[OperationContract]public int Frm_ZhuYuanYiShengZhan_InsertGuoMinYaoPing(int MedicineID, string MedicineName,string AllergicReason,int CheckResultID, int RegisterInhospitalID, string Encoding){SqlParameter[] mySqlParameters = {new SqlParameter ("@Type",SqlDbType .Char),new SqlParameter ("@MedicineID",SqlDbType.Int),new SqlParameter ("@MedicineName",SqlDbType.Char),new SqlParameter ("@AllergicReason",SqlDbType.Char),new SqlParameter ("@CheckResultID",SqlDbType.Int),new SqlParameter ("@RegisterInhospitalID",SqlDbType.Int),new SqlParameter ("@Encoding",SqlDbType.Char),};mySqlParameters[0].Value = "Frm_ZhuYuanYiShengZhan_InsertGuoMinYaoPing";mySqlParameters[1].Value = MedicineID;mySqlParameters[2].Value = MedicineName;mySqlParameters[3].Value = AllergicReason;mySqlParameters[4].Value = CheckResultID;mySqlParameters[5].Value = RegisterInhospitalID;mySqlParameters[6].Value = Encoding;return myDALMethod.UpdateData("住院登记_Frm_ZhuYuanYiShengZhan", mySqlParameters);}
第三步:界面层(UIL)代码
int Sum;//声明变量int inCount;//声明变量int ChengGong;//声明变量private void btnBaoCun_Click(object sender, EventArgs e){ for (int j = 0; j < dgDrugallergicRecord.Rows.Count;j++ ){if (Convert.ToInt32(dgDrugallergicRecord.Rows[j].Cells["AllergicMedicineID"].Value) == 0){ //循环判断检查ID是否为空int CheckResultID = Convert.ToInt32(dgDrugallergicRecord.Rows[j].Cells["CheckResult"].Value);if (CheckResultID ==0){MessageBox.Show("检查结果不能留空!");//为空则跳出该方法return;}else{//否则变量加一Sum++;}}}//for循环获取每一行对应的值for (int i = 0; i < dgDrugallergicRecord.Rows.Count;i++ ){if (Convert.ToInt32(dgDrugallergicRecord.Rows[i].Cells["AllergicMedicineID"].Value )==0){ int MedicineID =Convert.ToInt32( dgDrugallergicRecord.Rows[i].Cells["MedicineID"].Value);string MedicineName =Convert.ToString(dgDrugallergicRecord.Rows[i].Cells["MedicineName"].Value);string AllergicReason =Convert.ToString( dgDrugallergicRecord.Rows[i].Cells["AllergicReason"].Value);int CheckResultID = Convert.ToInt32(dgDrugallergicRecord.Rows[i].Cells["CheckResult"].Value);string Encoding = Convert.ToString(dgDrugallergicRecord.Rows[i].Cells["Encoding"].Value);myFrm_ZhuYuanYiShengZhanClient.Frm_ZhuYuanYiShengZhan_InsertGuoMinYaoPing(MedicineID, MedicineName, AllergicReason, CheckResultID, PulicStatic.ZhuYuanDengjiID, Encoding);inCount++;//变量加一}}//for 循环数组删除for (int k = 0; k < ShuZhu.Length;k++ ){ ChengGong= myFrm_ZhuYuanYiShengZhanClient.Frm_ZhuYuanYiShengZhan_DeleteGuoMinYaoPing(ShuZhu[k]);}if (Sum == inCount || ChengGong>0){MessageBox.Show("保存成功!");}}
过敏药物记录以后,医生可对病人进行病历的书写,和处方的录入
处方录入的实现解析代码如下:
如图看到的自付金和总金额的实现
#region 计算总金和自付金public void JiSuZongJinZiFuJin(){ //获取单价decimal DanJia = Convert.ToDecimal(dgvMedicineInformation.CurrentRow.Cells["RetailPrice_J"].Value);//获取数量decimal ShuLiang = Convert.ToDecimal(dgvMedicineInformation.CurrentRow.Cells["SumNumber"].Value);//判断库房数量if (门诊管理.Frm_MenZhenYiShengGongZuoZhanYaoPin_Insert.decStockNumber > 0){ //比较获取的数量和库房数量if (ShuLiang > 门诊管理.Frm_MenZhenYiShengGongZuoZhanYaoPin_Insert.decStockNumber){ //如果数量>库房数则跳出次方法MessageBox.Show("总数量不能大于该药品的库存数量!");return;}}//计算当前选择的行的总金额=单价*数量dgvMedicineInformation.CurrentRow.Cells["SumMoney"].Value =( DanJia * ShuLiang).ToString("0.00");//获取药品IDYoPingID = Convert.ToInt32(dgvMedicineInformation.CurrentRow.Cells["MedicineID"].Value);//查询病人对应的折扣率(根据医疗方式和药品ID)DataTable dtZheKouLv = myFrm_ZhuYuanJiZhangClient.Frm_ZhuYuanJiZhang_SelectZheKouLi(PulicStatic.YiLiaoFangShi, YoPingID).Tables[0];//如果查询的折扣率的表>0if (dtZheKouLv.Rows.Count > 0){//获取当前行的总金额decimal ZongJinE = Convert.ToDecimal(dgvMedicineInformation.CurrentRow.Cells["SumMoney"].Value);//计算自付金额=总金额*折扣率dgvMedicineInformation.CurrentRow.Cells["PayMoney"].Value =(ZongJinE * Convert.ToDecimal(dtZheKouLv.Rows[0][0])).ToString("0.00");}else{ //如果该药每有折扣率则自付金额=总金额decimal ZongJinE = Convert.ToDecimal(dgvMedicineInformation.CurrentRow.Cells["SumMoney"].Value);dgvMedicineInformation.CurrentRow.Cells["PayMoney"].Value = (ZongJinE).ToString("0.00");}JiSuSumMoney();//调用计算每行的累计总金额和自付金方法。}#endregion
计算每行的累计总金额和自付金方法。#region 累计总金和 自付金额public void JiSuSumMoney(){decimal ZongJin = 0;//定义变量总金decimal ZiFuJi = 0;//定义变量自付金int i = 0;//for循环累计总金和 自付金额for (i = 0; i < dgvMedicineInformation.Rows.Count; i++){ZongJin += Convert.ToDecimal(dgvMedicineInformation.Rows[i].Cells["SumMoney"].Value);ZiFuJi += Convert.ToDecimal(dgvMedicineInformation.Rows[i].Cells["PayMoney"].Value);}//给文本赋值lblSumMoney.Text = ZongJin.ToString("0.00").Trim();lblZiFuJin.Text = ZiFuJi.ToString("0.00").Trim();}#endregion
处方单药品的保存和库房的修改的实现
第一步:数据库存储过程
if(@Type='Frm_MenZhenYiShengGongZuoZhan_UpdateKuCunShu')
begin
update KC_StockList
set StockNumber=StockNumber-@StockNumber
where KC_StockList.MedicineID=@MedicineID AND KC_StockList.StoreroomID=@StoreroomIDend --库房数的修改
if(@Type='Frm_MenZhenYiShengGongZuoZhan_InsertChuFangDanMingXi')
begininsert MZ_PrescriptionBillsMingXiList(MedicineID, Number, PrescriptionBillsID, SendOutMedicineNo, SkinTestID, UsageID, UseMedicineFrequencyID, AtEveryTurnNumber, AtEveryTurnDoseID, PayMoney,OfficeID,InhospitalNo)values (@MedicineID, @Number, @PrescriptionBillsID, @SendOutMedicineNo, @SkinTestID, @UsageID, @UseMedicineFrequencyID, @AtEveryTurnNumber, @AtEveryTurnDoseID, @PayMoney,@OfficeID,@InhospitalNo)end --处方的新增
第二步:逻辑层(BLL)代码
[OperationContract]public int Frm_MenZhenYiShengGongZuoZhan_UpdateKuCunShu(decimal decStockNumber, int intMedicineID, int intStoreroomID){SqlParameter[] mySqlParameters = {new SqlParameter ("@Type",SqlDbType .Char),new SqlParameter ("@StockNumber",SqlDbType.Decimal),new SqlParameter ("@MedicineID",SqlDbType.Int),new SqlParameter ("@StoreroomID",SqlDbType.Int),};mySqlParameters[0].Value = "Frm_MenZhenYiShengGongZuoZhan_UpdateKuCunShu";mySqlParameters[1].Value = decStockNumber;mySqlParameters[2].Value = intMedicineID;mySqlParameters[3].Value = intStoreroomID;return myDALMethod.UpdateData("门诊登记_Frm_MenZhenYiShengGongZuoZhan", mySqlParameters);}[OperationContract]public int Frm_MenZhenYiShengGongZuoZhan_InsertChuFangDanMingXi(int intMedicineID, decimal strNumber, int intPrescriptionBillsID, bool bitSendOutMedicineNo, int intSkinTestID, int intUsageID, int intUseMedicineFrequencyID, decimal decAtEveryTurnNumber,int intAtEveryTurnDoseID, decimal decPayMoney, int intOfficeID,bool InhospitalNo){SqlParameter[] mySqlParameters = {new SqlParameter ("@Type",SqlDbType .Char),new SqlParameter ("@MedicineID",SqlDbType.Int),new SqlParameter ("@Number",SqlDbType.Decimal),new SqlParameter ("@PrescriptionBillsID",SqlDbType .Int),new SqlParameter ("@SendOutMedicineNo",SqlDbType.Bit),new SqlParameter ("@SkinTestID",SqlDbType.Int),new SqlParameter ("@UsageID",SqlDbType.Int),new SqlParameter ("@UseMedicineFrequencyID",SqlDbType.Int),new SqlParameter ("@AtEveryTurnNumber",SqlDbType.Decimal),new SqlParameter ("@AtEveryTurnDoseID",SqlDbType.Int),new SqlParameter ("@PayMoney",SqlDbType.Decimal),new SqlParameter ("@OfficeID",SqlDbType.Int),new SqlParameter ("@InhospitalNo",SqlDbType.Bit),};mySqlParameters[0].Value = "Frm_MenZhenYiShengGongZuoZhan_InsertChuFangDanMingXi";mySqlParameters[1].Value = intMedicineID;mySqlParameters[2].Value = strNumber;mySqlParameters[3].Value = intPrescriptionBillsID;mySqlParameters[4].Value = bitSendOutMedicineNo;mySqlParameters[5].Value = intSkinTestID;mySqlParameters[6].Value = intUsageID;mySqlParameters[7].Value = intUseMedicineFrequencyID;mySqlParameters[8].Value = decAtEveryTurnNumber;mySqlParameters[9].Value = intAtEveryTurnDoseID;mySqlParameters[10].Value = decPayMoney;mySqlParameters[11].Value = intOfficeID;mySqlParameters[12].Value = InhospitalNo;int i = myDALMethod.UpdateData("门诊登记_Frm_MenZhenYiShengGongZuoZhan", mySqlParameters);return i;}
第三步:界面层(UIL)代码
int intMedicineID;private void btSave_Click(object sender, EventArgs e){ //判断是否添加行if (dgvMedicineInformation.Rows.Count == 0){MessageBox.Show("还没添加药品");return;}//for循环获取每一行的值检查必填的是否为空for (int K = 0; K < dgvMedicineInformation.Rows.Count; K++){ intMedicineID = Convert.ToInt32(dgvMedicineInformation.Rows[K].Cells["MedicineID"].Value);if (intMedicineID > 0){int intSkinTestID = Convert.ToInt32(dgvMedicineInformation.Rows[K].Cells["SkinTestNo"].Value);int intUsageID = Convert.ToInt32(dgvMedicineInformation.Rows[K].Cells["Usage"].Value);int intUseMedicineFrequencyID = Convert.ToInt32(dgvMedicineInformation.Rows[K].Cells["UseMedicineFrequency"].Value);int intAtEveryTurnDoseID = Convert.ToInt32(dgvMedicineInformation.Rows[K].Cells["AtEveryTurnDose"].Value);int intOfficeID = Convert.ToInt32(dgvMedicineInformation.Rows[K].Cells["OfficeName"].Value);if (intSkinTestID == 0 || intUsageID == 0 || intUseMedicineFrequencyID == 0 || intAtEveryTurnDoseID == 0 || intOfficeID == 0) //判断dgvYaoPinXinXi里面的cbo值是否为空{MessageBox.Show("请填写完整!");return;}}}int J = 0;decimal decSumNumber = 0;foreach (DataGridViewRow dgvr in dgvMedicineInformation.Rows){intMedicineID = Convert.ToInt32(dgvr.Cells["MedicineID"].Value);//区别变量,开始给区别变量赋值为1,目的为了区分那是新增的药品int TianJiaID = Convert.ToInt32(dgvr.Cells["TianJiaID"].Value);if ( TianJiaID==1){decimal decNumber = Convert.ToDecimal(dgvr.Cells["SumNumber"].Value);bool bitSendOutMedicineNo = false;int SkinTestID = Convert.ToInt32(dgvr.Cells["SkinTestNo"].Value);int UsageID = Convert.ToInt32(dgvr.Cells["Usage"].Value);int UseMedicineFrequencyID = Convert.ToInt32(dgvr.Cells["UseMedicineFrequency"].Value);decimal decAtEveryTurnNumber = Convert.ToDecimal(dgvr.Cells["AtEveryTurnNumber"].Value);int AtEveryTurnDoseID = Convert.ToInt32(dgvr.Cells["AtEveryTurnDose"].Value);int OfficeID = Convert.ToInt32(dgvr.Cells["OfficeName"].Value);decimal decPayMoney = Convert.ToDecimal(dgvr.Cells["SumMoney"].Value);decSumNumber = Convert.ToDecimal(dgvr.Cells["SumNumber"].Value);int intStoreroomID = Convert.ToInt32(dgvr.Cells["StoreroomID"].Value);//修改药品库房数量myFrm_MenZhenYiShengGongZuoZhanClient.Frm_MenZhenYiShengGongZuoZhan_UpdateKuCunShu(decSumNumber, intMedicineID, intStoreroomID);// 新增药品处方J = myFrm_MenZhenYiShengGongZuoZhanClient.Frm_MenZhenYiShengGongZuoZhan_InsertChuFangDanMingXi(intMedicineID, decNumber, PulicStatic.ZhuYuanDengjiID, bitSendOutMedicineNo,SkinTestID, UsageID, UseMedicineFrequencyID, decAtEveryTurnNumber,AtEveryTurnDoseID, decPayMoney, OfficeID, true);}}if (J > 0){MessageBox.Show("保存成功!");}}
医生对病人录入处方以后进行医嘱的录入,对应的医嘱录入也只是新增的过程,由于前面描述太多的新增,所以不进一步的详细描述了。除此外,还有些简单的操作,如体温单的录入,病人信息的修改,和病人的消费情况的查询,都是简单的新增。
还有,医生可以对病人检查拍的影像进行查阅和管理。
如下图1为影像的新增,图2 为影像的查看
图1
图2
实现代码如下:
1.影像的新增:
第一步:数据库存储过程
if @Type='Frm_YingXiangGuanLi_InsertImg'beginInsert ZY_ImageList(Date, FileName, Describe,RegisterInhospitalID)values (@Date, @FileName, @Describe,@RegisterInhospitalID) end
第二步:逻辑层(BLL)代码
#region 新增影像[OperationContract]public int Frm_YingXiangGuanLi_InsertImg(string Date, byte[][] FileName, string Describe, int RegisterInhospitalID){string strFileName= FileNameLiu(FileName);SqlParameter[] mySqlParameters = {new SqlParameter ("@Type",SqlDbType .Char),new SqlParameter ("@Date",SqlDbType.Char),new SqlParameter ("@FileName",SqlDbType .Char),new SqlParameter ("@Describe",SqlDbType .Char),new SqlParameter ("@RegisterInhospitalID",SqlDbType .Int),};mySqlParameters[0].Value = "Frm_YingXiangGuanLi_InsertImg";mySqlParameters[1].Value = Date;mySqlParameters[2].Value = strFileName;mySqlParameters[3].Value = Describe;mySqlParameters[4].Value = RegisterInhospitalID;return myDALMethod.UpdateData("住院登记_Frm_YingXiangGuanLi", mySqlParameters);}#endregion#region 新增时文件流转换public string FileNameLiu(byte[][] FileLiu){string strWenJanQianZui = DateTime.Now.Year.ToString() + DateTime.Now.Month.ToString() + DateTime.Now.Day.ToString() + DateTime.Now.Hour.ToString() +DateTime.Now.Minute.ToString() + DateTime.Now.Second.ToString() + DateTime.Now.Millisecond.ToString();string FileName = "";for (int i = 0; i < FileLiu.Length; i++){//生成文件名string WenJianMing = strWenJanQianZui + ".png";//获取路径string WenjianLuJing = System.AppDomain.CurrentDomain.BaseDirectory;WenjianLuJing = WenjianLuJing + "image\\" + WenJianMing;FileInfo fi = new System.IO.FileInfo(WenjianLuJing);//创建地址FileStream fs;//文件流对象fs = fi.OpenWrite();//文件流写入fs.Write(FileLiu[i], 0, FileLiu[i].Length);//文件流插入数据fs.Close();//关闭文件流FileName = WenJianMing;}return FileName;}
#endregion
第三步:界面层(UIL)代码
添加影像代码:
private void btnInsertImage_Click(object sender, EventArgs e){//lisBytes.Clear();//清空List数组OpenFileDialog myOpenFileDialog = new OpenFileDialog();//打开文件myOpenFileDialog.Filter = "*.jpg|*.jpg|*.mp4|*.mp4";//文件格式myOpenFileDialog.Multiselect = false;//设置是否多选if (myOpenFileDialog.ShowDialog() == DialogResult.OK){dgImageInformation.Rows.Add(1);string WenJianMing = DateTime.Now.Year.ToString() + DateTime.Now.Month.ToString() + DateTime.Now.Day.ToString() + DateTime.Now.Hour.ToString() +DateTime.Now.Minute.ToString()+".png";//把当前日期转化为0000-00--00的格式string wenJianRiQi = DateTime.Now.Year.ToString() + "-" + DateTime.Now.Month.ToString() + "-" + DateTime.Now.Day.ToString();dgImageInformation.Rows[dgImageInformation.Rows.Count - 1].Cells["FileName"].Value = WenJianMing;dgImageInformation.Rows[dgImageInformation.Rows.Count - 1].Cells["Date"].Value = wenJianRiQi;using (Stream sm = new FileStream(myOpenFileDialog.FileName, FileMode.Open, FileAccess.ReadWrite, FileShare.None)){ //二进制文件长度int length = (int)sm.Length;//二进制文件存放的二进制数组byte[] bytes = new byte[length];//内存流读取sm.Read(bytes, 0, length);//关闭内存流sm.Close();lisBytes.Add(bytes);MemoryStream stmBLOBData = new MemoryStream(bytes);}}}
保存影像代码:int j;private void btnSaveImage_Click(object sender, EventArgs e){//定义二进制数组,长度为1byte[][] byWenJian = new byte[1][];//循环新增for (int i = 0; i < lisBytes.Count; i++){try{//对应赋值二进制数组byWenJian[0] = lisBytes[i];string WenJianDate = Convert.ToString(dgImageInformation.Rows[i].Cells["Date"].Value);string MiaoShu = Convert.ToString(dgImageInformation.Rows[i].Cells["Describe"].Value);j = myFrm_YingXiangGuanLiClient.Frm_YingXiangGuanLi_InsertImg(WenJianDate, byWenJian, MiaoShu, PulicStatic.ZhuYuanDengjiID);}catch { }}if (j > 0){MessageBox.Show("新增成功");Frm_YingXiangGuanLi_Load(null,null);}}
2.影像的查看
第一步:数据库存储过程
if @Type='Frm_YingXiangGuanLi_SelectImg'beginSELECT ZY_ImageList.*
FROM ZY_ImageListwhere RegisterInhospitalID=@RegisterInhospitalID end--获取影像if @Type='Frm_YingXiangGuanLi_SelectFileName'beginSELECT FileName
FROM ZY_ImageList
where ZY_ImageList.ImageID=@ImageIDend--获取文件名
第二步:逻辑层(BLL)代码
[OperationContract]public DataSet Frm_YingXiangGuanLi_SelectImg(int RegisterInhospitalID){SqlParameter[] mySqlParameters = {new SqlParameter ("@Type",SqlDbType .Char),new SqlParameter ("@RegisterInhospitalID",SqlDbType .Int),};mySqlParameters[0].Value = "Frm_YingXiangGuanLi_SelectImg";mySqlParameters[1].Value = RegisterInhospitalID;DataTable dt = myDALMethod.QueryDataTable("住院登记_Frm_YingXiangGuanLi", mySqlParameters);DataSet ds = new DataSet();ds.Tables.Add(dt);return ds;}[OperationContract]public DataSet Frm_YingXiangGuanLi_SelectFileName(int ImageID){SqlParameter[] mySqlParameters = {new SqlParameter ("@Type",SqlDbType .Char),new SqlParameter ("@ImageID",SqlDbType .Int),};mySqlParameters[0].Value = "Frm_YingXiangGuanLi_SelectFileName";mySqlParameters[1].Value = ImageID;DataTable dt = myDALMethod.QueryDataTable("住院登记_Frm_YingXiangGuanLi", mySqlParameters);DataSet ds = new DataSet();ds.Tables.Add(dt);return ds;}#region 查看影像路径转换文件流private byte[][] WenJianLiuZhuanHuanLuJing(string strLuJing){byte[][] lstbytes = new byte[1][];if (strLuJing != ""){string strBaoCunLuJIng = System.AppDomain.CurrentDomain.BaseDirectory;strLuJing = strBaoCunLuJIng + "image\\" + strLuJing;using (Stream sm = new FileStream(strLuJing, FileMode.Open, FileAccess.ReadWrite, FileShare.None)){//二进制文件长度int length = (int)sm.Length;//二进制文件存放的二进制数组byte[] bytes = new byte[length];//内存流读取sm.Read(bytes, 0, length);//关闭内存流sm.Close();将数据保存到数据库中lstbytes[0] = bytes;}}return lstbytes;}#endregion
第三步:界面层(UIL)代码
byte[][] TuPian;//定义二进制数组private void Frm_ChaKanYingXiang_Load(object sender, EventArgs e){ //查询文件名你DataTable dt = myFrm_YingXiangGuanLiClient.Frm_YingXiangGuanLi_SelectFileName(Frm_YingXiangGuanLi.ImageID).Tables[0];if (dt.Rows.Count > 0){TuPian = myFrm_YingXiangGuanLiClient.Frm_YingXiangGuanLi_UpdateFileName(dt.Rows[0]["FileName"].ToString().Trim());MemoryStream stmBLOBData = new MemoryStream(TuPian[0]);XianShiTuPian(stmBLOBData);}else{MessageBox.Show("请选择影像");}}void XianShiTuPian(Stream st){//实例化PictureBoxPictureBox myPictureBox = new PictureBox();//从指定的数据流创建Image myImage = Image.FromStream(st);//影像大小myPictureBox.Size = myImage.Size;myPictureBox.BackgroundImage = myImage;//获取或设置在 System.Windows.Forms.ImageLayout 枚举中定义的背景图像布局。myPictureBox.BackgroundImageLayout = ImageLayout.Zoom;plImage.Controls.Add(myPictureBox);}
仅供学习,禁止用于商业用途!
承志医疗管理系统技术解析住院管理(六)相关推荐
- 承志医疗管理系统技术解析设置商品折扣率(九)
可以说商品的折扣率是连贯整个系统的中枢,每个病人的医疗的费用都要根据该商品是否设置到折扣的问题,按照不同的医疗方式商品设置不同的折扣,在病人消费的时候根据病人的医疗方式进行对应的折扣. 打开设置商品折 ...
- 承志医院管理系统项目解析 门诊医生工作站—辅助检查项目(六)
1.33辅助检查 在需要做辅助检查的时候,选择病人,然后选择相关信息的辅助检查项目,如图(1).(2)所示:: 图(1) 图(2) 从界面上可以看到我们这里用到的控件有 控件名称 说明 日期控件(Da ...
- 承志医院管理系统项目解析 门诊医生工作站—书写病历(四)
1.3门诊医生工作站 由门诊医生进行看病,开药与诊疗方案. 1.31书写病历 书写病历这个模块,主要是给病人写病历,如图(1) 图(1) 控件名称 说明 日期控件(DateTimePicker) 控件 ...
- 承志医院管理系统项目解析 门诊收费(七)
1.4门诊收费 用于处方和辅助检查项目的收费,收费有3种情况:分别是现金.记账和刷卡.按照要求,备注填写你收费的类型,在后面收费员交款时好区别.如图(1): 图(1) 从界面上可以看到我们这里用到的控 ...
- 海马汽车经销商管理系统技术解析(三)应收管理
海马汽车经销商管理系统技术解析(三)应收管理 应收管理这个模块可以查看所有欠款的客户和每个客户的欠款明细信息,还可以新建欠账单和删除欠账单.可以通过客户姓名.发生日期等条件对欠账单进行筛选查询.还可以 ...
- 海马汽车经销商管理系统技术解析(二)维修收银
海马汽车经销商管理系统技术解析(二)维修收银 维修收银这个模块可以查看已经结算和已经收款的工单.可以通过工单号.车主姓名等条件对工单进行筛选查询.还可以对工单进行收银.刷新操作. 主界面如图(图1)所 ...
- 海马汽车经销商管理系统技术解析(五)车辆续保提醒
海马汽车经销商管理系统技术解析(五)车辆续保提醒 车辆续保提醒这个模块会把三天后需要续保的客户及车辆信息显示在车辆续保提醒界面,然后可以对信息进行提醒操作,还有查询.上页.下页操作. 车辆续保提醒主界 ...
- 海马汽车经销商管理系统技术解析(六)顾客生日祝贺
海马汽车经销商管理系统技术解析(六)顾客生日祝贺 顾客生日祝贺模块会把当天生日的顾客信息显示在顾客生日祝贺界面,然后可以对客户进行生日祝贺,还有上页.下页操作. 顾客生日祝贺主界面如图(图1)所示: ...
- WCF医院管理系统技术解析(十)体检报告结果打印(水晶报表)
WCF医院管理系统技术解析(十)体检报告结果打印(水晶报表) 对于已经完成体检的病人,对其进行体检结果的打印,其体检结果报告打印效果如图: 界面涉及到的控件有: 控件 说明 从工具箱中找到对应的报表控 ...
最新文章
- java固定资产管理系统代码_Java 固定资产管理系统(课程设计)
- 可见的轮廓线用虚线绘制_为什么你用SketchUp没有别人“快”?
- 《深入理解计算机系统》读书笔记六:整数表示
- 这三个NLP项目写进简历,网申通过率提高50%
- Spark Streaming之:Flume监控目录下文件内容变化,然后Spark Streaming实时监听Flume,然后从其上拉取数据,并计算出结果
- ThreadLocal的理解
- 美国华尔街拥抱区块链是最大的威胁
- android游戏黑屏,第五人格游戏进不去黑屏解决办法
- Activiti 流程查询出的结果封装为 JSON 时出现的异常
- SQLSERVER2005 收缩日志
- linux perl开发工具,专家推荐 几款常用Perl开发工具
- 苹果或将推出可折叠iPad:支持5G 对抗双屏Surface
- Zygo保存zxg(Zemax File)文件(光学领域知道Zygo的一定要看)
- 第一单元 用python学习微积分(三) 求导四则运算及三角函数(下)- 三角函数
- mysql比较两张表中两个字段值_如何通过SQL找出2个表里值不同的列的方法
- 发现自己水平很欠缺!
- ue4游戏传送门实现
- 1251:丛林中的路
- android5 网络请求时 FileNotFoundException android兼容性原因
- linux下iperf性能受限,网络性能测试工具Iperf详细使用图文教程
热门文章
- 整个IT界可分为13块大领域
- mysql在视图中增加新数据_怎么向Mysql视图中增加新数据
- 分享一些酷酷的特效,希望你也能够喜欢
- 2018年7月18日日报
- 《剑指offter》第十九题(js)
- 华为交换机的浮动路由及NQA动态切换
- 计算机考博方向数学,2016华中科技大学考博:计算机数学考试大纲
- 微信企业号之获取所有部门列表
- DeepCham: Collaborative Edge-Mediated Adaptive Deep Learning for Mobile Object Recognition
- 计算机科学与技术专业大学排名2020年,2020年全国计算机科学与技术专业大学排名,高考填报志愿可参考下...