WCF医院管理系统技术解析(九)体检执行(二)
保存好体检执行单的信息后,就进行具体的执行各个体检项目的内容 选择保存执行信息的病人体检项目:
,输入进行该体检项目的内容
然后在是否确认处
打上勾,点击
保存。效果如图所示:
2.9.9(图7)
涉及到的控件有:
控件 | 说明
从工具箱中找到对应的控件,可以设置控件的一些属性和事件。如显示的文本,命名是规范
|
文本框 (TextBox) | |
下拉框 (ComBobox) | |
数据表格 (DataGridView) | |
按钮(Button) | |
标签 (Label) | |
选项卡(TabControl) | |
时间控件(DataTimePicker) | |
复选框(CheckBox) | |
线条(LineShape) |
涉及到的表和表中的关系有:
不经过处方单的收费单下的项目绑定:
2.9.9(图8)
2.9.9(图9)
经过处方的项目收费单下的项目绑定:
2.9.9(图10)
2.9.9(图11)
表1:病人表(PatientTable)
列名 | 数据类型 | 主键/外键 | 说明 |
PatientID | int | 主键 | 病人ID |
PatientCardNumber | nchar (50) |
| 病人卡号 |
PatientName | nchar (30) |
| 病人名称 |
RegisterCategoryID | int | 外键 | 挂号类别 ID |
AS_SexID | int | 外键 | 性别ID |
Birthday | datetime |
| 出生年月 |
IDCardNo | nchar (50) |
| 身份证号 |
AS_MaritalStatusID | int | 外键 | 婚姻情况ID |
Profession | nchar (50) |
| 所在职业 |
MemberTypeID | int | 外键 | 会员类型ID |
MedicareCardNumber | nchar (50) |
| 医保卡号 |
AS_InsuredTypeID | int | 外键 | 参保类型ID |
ContactTelephone | nchar (30) |
| 联系电话 |
ContactAddress | nchar (100) |
| 联系地址 |
DrugAllergyHistory | nchar (100) |
| 药物过敏史 |
PatientCategoryID | int | 外键 | 病人类别ID |
Age | nchar (30) |
| 年龄 |
AlphabeticBrevityCode | nchar (20) |
| 拼音简码 |
WubiInCode | nchar (20) |
| 五笔简码 |
ContactMobilePhone | nchar (30) |
| 联系手机 |
| nchar (30) |
| 电子邮件 |
Introducer | nchar (30) |
| 介绍人员 |
PersonalTaboo | nchar (70) |
| 个人忌讳 |
HighestReputation | nchar (70) |
| 信誉上限 |
NowIntegral | nchar (50) |
| 当前积分 |
Debt | decimal (18, 2) |
| 尚欠金额 |
ExpenseSum | decimal (18, 2) |
| 消费金额 |
LastTime | datetime |
| 上次时间 |
LastDoctor_StaffID | int | 外键 | 上次医生 |
Prescriptions | nchar (50) |
| 总处方数 |
PatientPhotos | char (200) |
| 病人照片 |
WhetherEffective | bit | ((1)) | 有效否 |
WhetherFromPhysicalExamination | Bit |
| 是否体检 |
表2: 属性明细表(AttributeDetailsTable):
列名 | 数据类型 | 主键/外键 | 说明 |
AttributeDetailsID | int | 主键 | 属性明细ID |
AttributeDetailsID_F | int | 外键 | 属性明细ID_F |
AttributeSetID | int | 外键 | 属性明细ID |
AttributeDetailsName | nchar (30) |
| 属性明细名称 |
Number | nchar (30) |
| 编号 |
RetrievalInCode | nchar (30) |
| 检索简码 |
BuiltInIdentifiers | bit | ((0)) | 内置标识 |
Remarks | nchar (100) |
| 备注 |
WhetherEffective | bit | ((1)) | 有效否 |
表3:体检登记病人表(PW_PhysicalExaminationChargeBillPatientTable)
列名 | 数据类型 | 主键/外键 | 说明 |
PhysicalExaminationChargeBillPatientID | int | 主键 | 体检登记病人ID |
PatientID | int |
| 病人ID |
ChargeBillID | int | 外键 | 收费单ID |
AuxiliaryItemDetailID | Int |
| 辅助项目明细ID |
WhetherChargeBill | bit | ((1)) | 是否收费 |
表4: 项目类别表 (PW_ItemCategoryTable)
列名 | 数据类型 | 主键/外键 | 说明 |
ItemCategoryID | int | 主键 | 项目类别ID |
ItemCategoryName | nchar (30) | 外键 | 项目类别名称 |
表5:体检套餐表 (PhysicalExaminationSetMealTable)
列名 | 数据类型 | 主键/外键 | 说明 |
PhysicalExaminationSetMealID | int | 主键 | 体检套餐ID |
PhysicalExaminationSetMealName | nchar (30) |
| 体检套餐名称 |
ChargeCategoryID | int | 外键 | 收费类别 ID |
CashPrice | decimal (18, 2) |
| 现金价格 |
DiscountRatio | decimal (18, 2) |
| 折扣比例 |
SetMealNumber | nchar (30) |
| 套餐编号 |
SetMealRemarks | nchar (150) |
| 套餐备注 |
AS_UsableStatusID | int | 外键 | 可用状态ID |
EntryStaff_StaffID | int | 外键 | 录入人员_员工ID |
EntryDate | datetime |
| 录入日期 |
UpdateStaff_StaffID | int | 外键 | 修改人员_员工ID |
UpdateDate | datetime |
| 修改日期 |
WhetherEffective | bit | ((1)) | 有效否 |
表6:体检套餐明细表(PhysicalExaminationSetMealDetailTable)
列名 | 数据类型 | 主键/外键 | 说明 |
PhysicalExaminationSetMealDetailID | int | 主键 | 体检套餐明细ID |
PhysicalExaminationSetMealID | int | 外键 | 体检套餐ID |
ItemID | int | 外键 | 项目ID |
WhetherEffective | bit | ((1)) | 有效否 |
表7:项目表(ItemTable)
列名 | 数据类型 | 主键/外键 | 说明 |
ItemID | int | 主键 | 项目ID |
ItemName | nchar (70) | 外键 | 项目名称 |
ItemCoding | nchar (50) |
| 项目编号 |
AS_UserStatusID | int | 外键 | 使用状态ID |
ProjectPrice | decimal (18, 2) |
| 现金价格 |
TechnicalOfficesID | int | 外键 | 科室ID |
DiscountProportion | decimal (18, 2) |
| 折扣比例 |
WhetherEffective | bit | ((1)) | 有效否 |
ItemRemarks | nchar (100) |
| 项目备注 |
ItemUnit | nchar (20) |
| 项目单位 |
表8 辅助项目明细表 (PW_AuxiliaryItemDetailTable)
列名 | 数据类型 | 主键/外键 | 说明 |
AuxiliaryItemDetailID | int | 主键 | 辅助明细项目ID |
RegisterID | int | 外键 | 挂号ID |
AllItemID | int | 外键 | 总项目ID |
ItemCategoryID | int | 外键 | 项目类别ID |
WhetherEffective | bit | ((1)) | 是否有效 |
AS_PhysicalExaminationRegisterID | int | 外键 | 体检登记ID |
OrdonnanceID | int | 外键 | 处方单ID |
点击登记未执行的某病人,获取该病人收费单下的体检项目的储存过程有:
其中经过处方的有:
--经过处方的收费单下的体检项目
IF @Type = 'FRM_TiJianZhiXing_Main_Load_dgv_PhysicalExaminationExecuteContentDetail'
BEGIN
SELECT BT_PatientTable.PatientID, PW_AuxiliaryItemDetailTable.ItemCategoryID, PW_ItemCategoryTable.ItemCategoryName, PW_AuxiliaryItemDetailTable.AuxiliaryItemDetailID,
PW_AuxiliaryItemDetailTable.AllItemID, RTRIM(BT_ItemTable.ItemName) AS ItemName, PW_AuxiliaryItemDetailTable.AS_PhysicalExaminationRegisterID,
BT_AttributeDetailsTable.AttributeDetailsName AS 体检状态, BT_PhysicalExaminationSetMealDetailTable.ItemID,
BT_PhysicalExaminationSetMealTable.PhysicalExaminationSetMealID AS 体检套餐ID, BT_PhysicalExaminationSetMealDetailTable.PhysicalExaminationSetMealDetailID AS 体检套餐明细ID,
RTRIM(BT_PhysicalExaminationSetMealTable.PhysicalExaminationSetMealName) AS 体检套餐MC, PW_OrdonnanceTable.OrdonnanceID, PW_ChargeBillTable.ChargeBillID
FROM BT_PhysicalExaminationSetMealTable INNER JOIN
PW_AuxiliaryItemDetailTable ON BT_PhysicalExaminationSetMealTable.PhysicalExaminationSetMealID = PW_AuxiliaryItemDetailTable.AllItemID INNER JOIN
BT_PhysicalExaminationSetMealDetailTable ON
BT_PhysicalExaminationSetMealTable.PhysicalExaminationSetMealID = BT_PhysicalExaminationSetMealDetailTable.PhysicalExaminationSetMealID INNER JOIN
BT_ItemTable ON BT_PhysicalExaminationSetMealDetailTable.ItemID = BT_ItemTable.ItemID INNER JOIN
PW_ItemCategoryTable ON PW_AuxiliaryItemDetailTable.ItemCategoryID = PW_ItemCategoryTable.ItemCategoryID INNER JOIN
BT_AttributeDetailsTable ON PW_AuxiliaryItemDetailTable.AS_PhysicalExaminationRegisterID = BT_AttributeDetailsTable.AttributeDetailsID INNER JOIN
PW_OrdonnanceTable ON PW_AuxiliaryItemDetailTable.OrdonnanceID = PW_OrdonnanceTable.OrdonnanceID INNER JOIN
BT_PatientTable ON PW_OrdonnanceTable.PatientID = BT_PatientTable.PatientID INNER JOIN
PW_ChargeBillTable ON PW_OrdonnanceTable.OrdonnanceID = PW_ChargeBillTable.OrdonnanceID
WHERE 1=1 AND PW_ItemCategoryTable.ItemCategoryID = 4 AND PW_ChargeBillTable.ChargeBillID = @ChargeBillID AND PW_ChargeBillTable.WhetherOrdonnance = 1 and PW_AuxiliaryItemDetailTable.WhetherOrdonnance = 1
union
SELECT BT_PatientTable.PatientID, RTRIM(PW_AuxiliaryItemDetailTable.ItemCategoryID) AS ItemCategoryID, RTRIM(PW_ItemCategoryTable.ItemCategoryName) AS ItemCategoryName,
RTRIM(PW_AuxiliaryItemDetailTable.AuxiliaryItemDetailID) AS AuxiliaryItemDetailID, RTRIM(PW_AuxiliaryItemDetailTable.AllItemID) AS AllItemID, RTRIM(BT_ItemTable.ItemName) AS ItemName,
RTRIM(PW_AuxiliaryItemDetailTable.AS_PhysicalExaminationRegisterID) AS AS_PhysicalExaminationRegisterID, RTRIM(BT_AttributeDetailsTable_1.AttributeDetailsName) AS 体检状态,
RTRIM(BT_ItemTable.ItemID) AS ItemID, RTRIM(0) AS 体检套餐ID, RTRIM(0) AS 体检套餐明细ID, RTRIM('无') AS 体检套餐MC, PW_OrdonnanceTable.OrdonnanceID,
PW_ChargeBillTable.ChargeBillID
FROM BT_StaffTable INNER JOIN
BT_PatientTable INNER JOIN
BT_AttributeDetailsTable ON BT_PatientTable.AS_SexID = BT_AttributeDetailsTable.AttributeDetailsID INNER JOIN
BT_AttributeDetailsTable AS BT_AttributeDetailsTable_1 INNER JOIN
PW_ItemCategoryTable INNER JOIN
PW_AuxiliaryItemDetailTable ON PW_ItemCategoryTable.ItemCategoryID = PW_AuxiliaryItemDetailTable.ItemCategoryID INNER JOIN
BT_ItemTable ON PW_AuxiliaryItemDetailTable.AllItemID = BT_ItemTable.ItemID ON
BT_AttributeDetailsTable_1.AttributeDetailsID = PW_AuxiliaryItemDetailTable.AS_PhysicalExaminationRegisterID INNER JOIN
PW_OrdonnanceTable ON PW_AuxiliaryItemDetailTable.OrdonnanceID = PW_OrdonnanceTable.OrdonnanceID ON BT_PatientTable.PatientID = PW_OrdonnanceTable.PatientID ON
BT_StaffTable.StaffID = PW_OrdonnanceTable.TreatmentDoctor_StaffID INNER JOIN
PW_ChargeBillTable ON PW_OrdonnanceTable.OrdonnanceID = PW_ChargeBillTable.OrdonnanceID
WHERE 1=1 AND PW_ItemCategoryTable.ItemCategoryID = 1 AND PW_ChargeBillTable.ChargeBillID = @ChargeBillID AND PW_ChargeBillTable.WhetherOrdonnance = 1 and PW_AuxiliaryItemDetailTable.WhetherOrdonnance = 1
END
不经过处方的有:
--绑定体检明细信息单击某病人,获取该病人下的体检项目(不经过处方)
IF @Type = 'FRM_TiJianZhiXing_Main_Load_dgv_PhysicalExaminationExecuteContentDetail_SelectItem'
BEGIN
SELECT RTRIM(BT_PatientTable.PatientID) AS PatientID, RTRIM(PW_AuxiliaryItemDetailTable.ItemCategoryID) AS ItemCategoryID, RTRIM(PW_ItemCategoryTable.ItemCategoryName) AS ItemCategoryName,
RTRIM(PW_AuxiliaryItemDetailTable.AuxiliaryItemDetailID) AS AuxiliaryItemDetailID, RTRIM(PW_AuxiliaryItemDetailTable.AllItemID) AS AllItemID, RTRIM(BT_ItemTable.ItemName) AS ItemName,
RTRIM(PW_AuxiliaryItemDetailTable.AS_PhysicalExaminationRegisterID) AS AS_PhysicalExaminationRegisterID, RTRIM(BT_AttributeDetailsTable.AttributeDetailsName) AS 体检状态,
BT_ItemTable.ItemID, BT_PhysicalExaminationSetMealTable.PhysicalExaminationSetMealID AS 体检套餐ID,
BT_PhysicalExaminationSetMealDetailTable.PhysicalExaminationSetMealDetailID AS 体检套餐明细ID, RTRIM(BT_PhysicalExaminationSetMealTable.PhysicalExaminationSetMealName)
AS 体检套餐MC, RTRIM(0) AS OrdonnanceID, PW_PhysicalExaminationChargeBillPatientTable.ChargeBillID, PW_PhysicalExaminationChargeBillPatientTable.WhetherCharge
FROM BT_PhysicalExaminationSetMealTable INNER JOIN
PW_AuxiliaryItemDetailTable ON BT_PhysicalExaminationSetMealTable.PhysicalExaminationSetMealID = PW_AuxiliaryItemDetailTable.AllItemID INNER JOIN
BT_PhysicalExaminationSetMealDetailTable ON
BT_PhysicalExaminationSetMealTable.PhysicalExaminationSetMealID = BT_PhysicalExaminationSetMealDetailTable.PhysicalExaminationSetMealID INNER JOIN
BT_ItemTable ON BT_PhysicalExaminationSetMealDetailTable.ItemID = BT_ItemTable.ItemID INNER JOIN
PW_ItemCategoryTable ON PW_AuxiliaryItemDetailTable.ItemCategoryID = PW_ItemCategoryTable.ItemCategoryID INNER JOIN
BT_AttributeDetailsTable ON PW_AuxiliaryItemDetailTable.AS_PhysicalExaminationRegisterID = BT_AttributeDetailsTable.AttributeDetailsID INNER JOIN
PW_PhysicalExaminationChargeBillPatientTable ON PW_AuxiliaryItemDetailTable.AuxiliaryItemDetailID = PW_PhysicalExaminationChargeBillPatientTable.AuxiliaryItemDetailID INNER JOIN
BT_PatientTable ON PW_PhysicalExaminationChargeBillPatientTable.PatientID = BT_PatientTable.PatientID INNER JOIN
PW_ChargeBillTable ON PW_PhysicalExaminationChargeBillPatientTable.ChargeBillID = PW_ChargeBillTable.ChargeBillID
WHERE 1 = 1 AND PW_ItemCategoryTable.ItemCategoryID = 4 AND PW_AuxiliaryItemDetailTable.WhetherOrdonnance = 0 AND
PW_PhysicalExaminationChargeBillPatientTable.WhetherCharge = 1 AND PW_PhysicalExaminationChargeBillPatientTable.ChargeBillID = @ChargeBillID
union
SELECT RTRIM(BT_PatientTable.PatientID) AS PatientID, RTRIM(PW_AuxiliaryItemDetailTable.ItemCategoryID) AS ItemCategoryID, RTRIM(PW_ItemCategoryTable.ItemCategoryName) AS ItemCategoryName,
RTRIM(PW_AuxiliaryItemDetailTable.AuxiliaryItemDetailID) AS AuxiliaryItemDetailID, RTRIM(PW_AuxiliaryItemDetailTable.AllItemID) AS AllItemID, RTRIM(BT_ItemTable.ItemName) AS ItemName,
RTRIM(PW_AuxiliaryItemDetailTable.AS_PhysicalExaminationRegisterID) AS AS_PhysicalExaminationRegisterID, RTRIM(BT_AttributeDetailsTable_1.AttributeDetailsName) AS 体检状态,
BT_ItemTable.ItemID, RTRIM(0) AS 体检套餐ID, RTRIM(0) AS 体检套餐明细ID, RTRIM('无') AS 体检套餐MC, RTRIM(0) AS OrdonnanceID,
PW_PhysicalExaminationChargeBillPatientTable.ChargeBillID, PW_PhysicalExaminationChargeBillPatientTable.WhetherCharge
FROM BT_AttributeDetailsTable AS BT_AttributeDetailsTable_1 INNER JOIN
PW_ItemCategoryTable INNER JOIN
PW_AuxiliaryItemDetailTable ON PW_ItemCategoryTable.ItemCategoryID = PW_AuxiliaryItemDetailTable.ItemCategoryID INNER JOIN
BT_ItemTable ON PW_AuxiliaryItemDetailTable.AllItemID = BT_ItemTable.ItemID ON
BT_AttributeDetailsTable_1.AttributeDetailsID = PW_AuxiliaryItemDetailTable.AS_PhysicalExaminationRegisterID INNER JOIN
PW_PhysicalExaminationChargeBillPatientTable ON PW_AuxiliaryItemDetailTable.AuxiliaryItemDetailID = PW_PhysicalExaminationChargeBillPatientTable.AuxiliaryItemDetailID INNER JOIN
BT_PatientTable INNER JOIN
BT_AttributeDetailsTable ON BT_PatientTable.AS_SexID = BT_AttributeDetailsTable.AttributeDetailsID ON
PW_PhysicalExaminationChargeBillPatientTable.PatientID = BT_PatientTable.PatientID INNER JOIN
PW_ChargeBillTable ON PW_PhysicalExaminationChargeBillPatientTable.ChargeBillID = PW_ChargeBillTable.ChargeBillID
WHERE 1=1 AND PW_ItemCategoryTable.ItemCategoryID = 1 AND PW_AuxiliaryItemDetailTable.WhetherOrdonnance = 0
AND PW_PhysicalExaminationChargeBillPatientTable .WhetherCharge = 1 AND PW_PhysicalExaminationChargeBillPatientTable.ChargeBillID = @ChargeBillID
END
BLL中的方法:
其中不经过处方的有:
#endregion
#region 绑定体检明细信息 单击某病人,获取该病人下的体检项目(不经过处方)
[OperationContract]
public DataSet FRM_TiJianZhiXing_Main_Load_dgv_PhysicalExaminationExecuteContentDetail_SelectItem(int intChargeBillID)
{
SqlParameter[] mySqlParameters = {
new SqlParameter("@Type",SqlDbType .Char ),
new SqlParameter ("@ChargeBillID",SqlDbType .Int),
};
mySqlParameters[0].Value = "FRM_TiJianZhiXing_Main_Load_dgv_PhysicalExaminationExecuteContentDetail_SelectItem ";
mySqlParameters[1].Value = intChargeBillID;
DataTable dt = myDALMethod.QueryDataTable("TiJianZhongXin_FRM_TiJianZhiXing_Main", mySqlParameters);
DataSet ds = new DataSet();
ds.Tables.Add(dt);
return ds;
}
#endregion
经过处方的方法有:
#region 绑定体检明细信息 单击某病人,获取该病人下的体检项目(经过处方)
[OperationContract]
public DataSet FRM_TiJianZhiXing_Main_Load_dgv_PhysicalExaminationExecuteContentDetail(int intChargeBillID)
{
SqlParameter[] mySqlParameters = {
new SqlParameter("@Type",SqlDbType .Char ),
new SqlParameter ("@ChargeBillID",SqlDbType.Int ),
};
mySqlParameters[0].Value = "FRM_TiJianZhiXing_Main_Load_dgv_PhysicalExaminationExecuteContentDetail ";
mySqlParameters[1].Value = intChargeBillID;
DataTable dt = myDALMethod.QueryDataTable("TiJianZhongXin_FRM_TiJianZhiXing_Main", mySqlParameters);
DataSet ds = new DataSet();
ds.Tables.Add(dt);
return ds;
}
#endregion
UIL中选择病人获取该病人的体检项目,在病人的列表中右键属性
然后点击事件属性符号
找到CellClick中 单击单元格任意部分时发生的事件
在其中写的代码有:
private void dgv_PatientMessage_CellClick_1(object sender, DataGridViewCellEventArgs e)
{
intOrdonnanceID = Convert.ToInt32(dgv_PatientMessage.CurrentRow.Cells["处方单ID"].Value);//获取挂号ID
intChargeBillID = Convert.ToInt32(dgv_PatientMessage.CurrentRow.Cells["收费单ID"].Value);//获取挂号ID
JudgeWetherFinisch();//自定义方法用于判断是否完成中的值,如果存在内容,为"√";否则为"×"
strPhysicalExaminationRegister = dgv_PatientMessage.CurrentRow.Cells["体检登记"].Value.ToString().Trim();//获取病人体检登记的信息
if (strPhysicalExaminationRegister == "登记未执行")
{
清空ToolStripMenuItem_Click(null, null);//调用清空各个控件的方法
JudgeMaxNumber();//获取体检执行单的最大单号
DateTime dtpDateTime = DateTime.Now; dtp_ReportTime.Text = dtpDateTime.ToString();
DataTable dtPhysicalExaminationExecuteID = new DataTable();
if (intOrdonnanceID != 0)//如果处方单ID不为空
{
//查询该处方单的体检项目
dtPhysicalExaminationExecuteID = myFRM_TiJianZhiXing_MainClient.FRM_TiJianZhiXing_Main_Load_dgv_PatientMessage_CellClick_SelectPhysicalExaminationExecuteID(intChargeBillID).Tables[0];
}
else
{
//该收费单的体检项目
dtPhysicalExaminationExecuteID = myFRM_TiJianZhiXing_MainClient.FRM_TiJianZhiXing_Main_Load_dgv_PatientMessage_CellClick_SelectPhysicalExaminationExecuteIDOnChargeBillID(intChargeBillID).Tables[0];
}
if (dtPhysicalExaminationExecuteID.Rows.Count == 0)//如果为空,说明该条挂号下的体检项目没有一条执行,即要全部都要进行插入操作
{ intSwitch = 0; }
else
{
#region 判断重复添加体检执行单
intPhysicalExaminationExecuteID = Convert.ToInt32(dtPhysicalExaminationExecuteID.Rows[0]["PhysicalExaminationExecuteID"].ToString().Trim());
intSwitch = 2;//获取新增体检执行明细表的判断、
#endregion
}
}
else
{
DataTable dtPhysicalExaminationExecuteID = new DataTable();
if (intOrdonnanceID != 0)
{
//根据该处方进行获取该处方的体检执行ID
dtPhysicalExaminationExecuteID = myFRM_TiJianZhiXing_MainClient.FRM_TiJianZhiXing_Main_Load_dgv_PatientMessage_CellClick_SelectPhysicalExaminationExecuteID(intChargeBillID).Tables[0];
}
else
{
//根据该收费单获取该不经过处方的体检执行ID
dtPhysicalExaminationExecuteID = myFRM_TiJianZhiXing_MainClient.FRM_TiJianZhiXing_Main_Load_dgv_PatientMessage_CellClick_SelectPhysicalExaminationExecuteIDOnChargeBillID(intChargeBillID).Tables[0];
}
intPhysicalExaminationExecuteID = Convert.ToInt32(dtPhysicalExaminationExecuteID.Rows[0]["PhysicalExaminationExecuteID"].ToString().Trim());//获取体检执行ITD
}
//把病人信息中的体检信息绑定到相应的控件中
txt_Age1.Text = dgv_PatientMessage.CurrentRow.Cells["年龄"].Value.ToString().Trim();
txt_AS_InsuredTypeID.Text = dgv_PatientMessage.CurrentRow.Cells["医保类型"].Value.ToString().Trim();
txt_AS_SexID1.Text = " " + dgv_PatientMessage.CurrentRow.Cells["性别"].Value.ToString().Trim();
string strBirthday = dgv_PatientMessage.CurrentRow.Cells["出生日期"].Value.ToString().Trim();//获取病人的出生日期
txt_MemberTypeID.Text = dgv_PatientMessage.CurrentRow.Cells["会员类型"].Value.ToString().Trim();
txt_PatientName.Text = dgv_PatientMessage.CurrentRow.Cells["姓名"].Value.ToString().Trim();
txt_PatientCardNumber.Text = dgv_PatientMessage.CurrentRow.Cells["病人卡号"].Value.ToString().Trim();
DateTime dtpTime = Convert.ToDateTime(strBirthday);//把病人的出生日期转为时间的数据类型
string strYear = dtpTime.Year.ToString();//获取初生日期中的年份
string strMonth = (dtpTime.Month > 9 ? dtpTime.Month.ToString() : "0" + dtpTime.Month.ToString());//用三目运算符获取出生日期前中的月份,并且不足10的用0补上
string strDay = (dtpTime.Day > 9 ? dtpTime.Day.ToString() : "0" + dtpTime.Month.ToString());//用三目运算符获取出生日期前中的日,并且不足10的用0补上
txt_Birthday1.Text = strYear + "-" + strMonth + "-" + strDay;//把出生日期中的年月日并接起来
txt_RegisterTime.Text = dgv_PatientMessage.CurrentRow.Cells["登记日期"].Value.ToString().Trim();
txt_PatientName1.Text = txt_PatientName.Text;
txt_Register.Text = dgv_PatientMessage.CurrentRow.Cells["就诊医生"].Value.ToString().Trim();
}
其中里面的自定义方法绑定体检项目和判断体检项目是否完成的有:
#region 自定义方法用于判断是否完成中的值,如果存在内容,为"√";否则为"×"
void JudgeWetherFinisch()
{
DataTable dtWetherFinisch = new DataTable();
if (intOrdonnanceID != 0)//如果处方单ID不为空
{
//绑定经过处方的体检项目和判断经过处方的是否完成
dgv_PhysicalExaminationExecuteContentDetail.DataSource =
myFRM_TiJianZhiXing_MainClient.FRM_TiJianZhiXing_Main_Load_dgv_PhysicalExaminationExecuteContentDetail(intChargeBillID).Tables[0];
dtWetherFinisch = myFRM_TiJianZhiXing_MainClient.FRM_TiJianZhiXing_Main_WetherFinisch(intChargeBillID).Tables[0];//
}
else
{
//绑定不经过处方的体检项目和判断不经过处方的是否完成
dgv_PhysicalExaminationExecuteContentDetail.DataSource =
myFRM_TiJianZhiXing_MainClient.FRM_TiJianZhiXing_Main_Load_dgv_PhysicalExaminationExecuteContentDetail_SelectItem(intChargeBillID).Tables[0];
dtWetherFinisch = myFRM_TiJianZhiXing_MainClient.FRM_TiJianZhiXing_Main_WetherFinisch_0nChargeBillID(intChargeBillID).Tables[0];
}
//根据挂号ID,查询对应的体检执行内容明细中的信息
if (dtWetherFinisch.Rows.Count == 0) //ddd小于行的集合=0,说明该挂号病人没有检查任何的项目,说明所有项目的是否完成的值都为"×";
{
foreach (DataGridViewRow dgvr in dgv_PhysicalExaminationExecuteContentDetail.Rows)
{
dgvr.Cells["是否完成"].Value = "×";
}
}
else
{
for (int i = 0; i < dgv_PhysicalExaminationExecuteContentDetail.Rows.Count; i++)//遍历dgv_PhysicalExaminationExecuteContentDetail行的集合
{
for (int k = 0; k < dtWetherFinisch.Rows.Count; k++)//遍历dtdtWetherFinisch行的集合
{
//如果两者中的项目ID相同,即说明体检执行内容明细表中对该项目的体检执行内容信息已经完成 ,否则就没有完成
if (Convert.ToInt32(dgv_PhysicalExaminationExecuteContentDetail.Rows[i].Cells["项目ID"].Value) == Convert.ToInt32(dtWetherFinisch.Rows[k]["ItemID"]))
{
intSelectWetherFinisch++;
dgv_PhysicalExaminationExecuteContentDetail.Rows[i].Cells["是否完成"].Value = "√";
break;
}
else
{
dgv_PhysicalExaminationExecuteContentDetail.Rows[i].Cells["是否完成"].Value = "×";
}
}
}
}
}
#endregion
其中判断体检项目是否完成
涉及到的储存过程有:
--判断是否完成(经过处方的)
IF @Type = 'FRM_TiJianZhiXing_Main_WetherFinisch'
BEGIN
SELECT PW_PhysicalExaminationExecuteTable.PhysicalExaminationExecuteID, PW_PhysicalExaminationExecuteContentDetailTable.PhysicalExaminationExecuteContentMessage,
PW_PhysicalExaminationExecuteContentDetailTable.ItemID, PW_PhysicalExaminationExecuteContentDetailTable.PhysicalExaminationExecuteContentDetailID,
PW_PhysicalExaminationExecuteContentDetailTable.PhysicalExaminationContentID, BT_ItemTable.ItemName, PW_PhysicalExaminationExecuteTable.ChargeBillID
FROM PW_PhysicalExaminationExecuteTable INNER JOIN
PW_PhysicalExaminationExecuteContentDetailTable ON
PW_PhysicalExaminationExecuteTable.PhysicalExaminationExecuteID = PW_PhysicalExaminationExecuteContentDetailTable.PhysicalExaminationExecuteID INNER JOIN
BT_ItemTable ON PW_PhysicalExaminationExecuteContentDetailTable.ItemID = BT_ItemTable.ItemID
WHERE PW_PhysicalExaminationExecuteTable.ChargeBillID = @ChargeBillID and PW_PhysicalExaminationExecuteTable.WhetherOrdonnance = 1
END
--判断是否完成(不经过处方)
IF @Type = 'FRM_TiJianZhiXing_Main_WetherFinisch_0nChargeBillID'
BEGIN
SELECT PW_PhysicalExaminationExecuteTable.PhysicalExaminationExecuteID, PW_PhysicalExaminationExecuteContentDetailTable.PhysicalExaminationExecuteContentMessage, PW_PhysicalExaminationExecuteContentDetailTable.ItemID,
PW_PhysicalExaminationExecuteContentDetailTable.PhysicalExaminationExecuteContentDetailID, PW_PhysicalExaminationExecuteContentDetailTable.PhysicalExaminationContentID,
BT_ItemTable.ItemName, PW_PhysicalExaminationExecuteTable.ChargeBillID
FROM PW_PhysicalExaminationExecuteTable INNER JOIN
PW_PhysicalExaminationExecuteContentDetailTable ON
PW_PhysicalExaminationExecuteTable.PhysicalExaminationExecuteID = PW_PhysicalExaminationExecuteContentDetailTable.PhysicalExaminationExecuteID INNER JOIN
BT_ItemTable ON PW_PhysicalExaminationExecuteContentDetailTable.ItemID = BT_ItemTable.ItemID
WHERE PW_PhysicalExaminationExecuteTable.ChargeBillID = @ChargeBillID and PW_PhysicalExaminationExecuteTable.WhetherOrdonnance = 0
END
BLL中对应的方法有:
//判断是否完成(经过处方的)
[OperationContract]
public DataSet FRM_TiJianZhiXing_Main_WetherFinisch(int intChargeBillID)
{
SqlParameter[] mySqlParameters = {
new SqlParameter("@Type",SqlDbType .Char ),
new SqlParameter ("@ChargeBillID",SqlDbType.Int ),
};
mySqlParameters[0].Value = "FRM_TiJianZhiXing_Main_WetherFinisch ";
mySqlParameters[1].Value = intChargeBillID;
DataTable dt = myDALMethod.QueryDataTable("TiJianZhongXin_FRM_TiJianZhiXing_Main", mySqlParameters);
DataSet ds = new DataSet();
ds.Tables.Add(dt);
return ds;
}
//判断是否完成(不经过处方)
[OperationContract]
public DataSet FRM_TiJianZhiXing_Main_WetherFinisch_0nChargeBillID(int intChargeBillID)//根据收费单查询体检执行内容明细中是否存在信息
{
SqlParameter[] mySqlParameters = {
new SqlParameter("@Type",SqlDbType .Char ),
new SqlParameter ("@ChargeBillID",SqlDbType.Int ),
};
mySqlParameters[0].Value = "FRM_TiJianZhiXing_Main_WetherFinisch_0nChargeBillID ";
mySqlParameters[1].Value = intChargeBillID;
DataTable dt = myDALMethod.QueryDataTable("TiJianZhongXin_FRM_TiJianZhiXing_Main", mySqlParameters);
DataSet ds = new DataSet();
ds.Tables.Add(dt);
return ds;
}
点击保存好病人体检执行信息后,选择执行体检的体检项目
,系统会自动跳转
到该体检项目的体检内容上,输入体检的结果 然后在是否确认处
打上勾,点击
保存。这样该病人的这个体检项目就完成了。
保存体检执行内容明细涉及到的储存过程有:
--新增体检执行内容明细表
IF @Type = 'FRM_TiJianZhiXing_Main_Load_btn_CommonSave_Click'
BEGIN
INSERT INTO PW_PhysicalExaminationExecuteContentDetailTable
(PhysicalExaminationContentID, ItemID, PhysicalExaminationExecuteContentMessage, PhysicalExaminationExecuteID,ReportDoctor_StaffID,ReportTime)
VALUES (@PhysicalExaminationContentID, @ItemID, @PhysicalExaminationExecuteContentMessage, @PhysicalExaminationExecuteID,@ReportDoctor_StaffID,@ReportTime)
END
BLL中对应的方法有:
//新增体检执行内容明细表,即保存体检执行中的病人检查的具体项目信息
[OperationContract]
public int FRM_TiJianZhiXing_Main_Load_btn_CommonSave_Click(int intPhysicalExaminationContentID, int intItemID, string strPhysicalExaminationExecuteContentMessage, int intPhysicalExaminationExecuteID,
int intReportDoctor_StaffID, DateTime dtpReportTime)
{
SqlParameter[] mySqlParameters = {
new SqlParameter("@Type",SqlDbType .Char ),
new SqlParameter ("@PhysicalExaminationContentID",SqlDbType .Int ),//获取界面中传入的体检执行内容ID
new SqlParameter ("@ItemID",SqlDbType .Int ),//获取界面中传入的体检项目ID
new SqlParameter ("@PhysicalExaminationExecuteContentMessage",SqlDbType .Char ),//获取界面中传入的体检结果
new SqlParameter ("@PhysicalExaminationExecuteID",SqlDbType .Int),//获取界面中传入的体检执行ID
new SqlParameter ("@ReportDoctor_StaffID",SqlDbType .Int ),//获取界面中传入的体检报告医生ID
new SqlParameter ("@ReportTime",SqlDbType .Date )//获取界面中传入的体检报告时间
};
mySqlParameters[0].Value = "FRM_TiJianZhiXing_Main_Load_btn_CommonSave_Click ";
mySqlParameters[1].Value = intPhysicalExaminationContentID;
mySqlParameters[2].Value = intItemID;
mySqlParameters[3].Value = strPhysicalExaminationExecuteContentMessage;
mySqlParameters[4].Value = intPhysicalExaminationExecuteID;
mySqlParameters[5].Value = intReportDoctor_StaffID;
mySqlParameters[6].Value = dtpReportTime;
return myDALMethod.UpdateData("TiJianZhongXin_FRM_TiJianZhiXing_Main", mySqlParameters);
}
UIL中涉及到的代码有:
#region 内科项目检查保存内容
#region 内科项目检查保存内容
if (txt_Medicine_Ultrasound.Text == "")//提示输入内科项目各项的值
{
MessageBox.Show("请输入内科项目超声的值!");
txt_Medicine_Ultrasound.Focus(); return;
}
else if (txt_Medicine__Diacrisis.Text == "")
{
MessageBox.Show("请输入内科项目诊断的值!");
txt_Medicine__Diacrisis.Focus(); return;
}
else if (txt_Medicine_DiacrisisFinding.Text == "")
{
MessageBox.Show("请输入内科项目诊查所见的值!");
txt_Medicine_DiacrisisFinding.Focus(); return;
}
else if (txt_Medicine_Conclusion.Text == "")
{
MessageBox.Show("请输入内科项目诊查结论的值!");
txt_Medicine_Conclusion.Focus(); return;
}
else
{
if (dtPhysicalExaminationProject == null)
{ }
else//说明
{
if (dtPhysicalExaminationProject.Rows.Count > 0)
{
for (int i = 0; i < dtPhysicalExaminationProject.Rows.Count; i++)//遍历新增体检执行明细表中的体检具体信息,新增各个控件的值
{
intCountSucceed++; string strPhysicalExaminationExecuteContentMessage = "";
switch (i)
{
case 0://获取内科超声的值
strPhysicalExaminationExecuteContentMessage = txt_Medicine_Ultrasound.Text.ToString().Trim();
break;
case 1://获取内科既往史的值
strPhysicalExaminationExecuteContentMessage = txt_Medicine_PreviousHistory.Text.ToString().Trim();
break;
case 2://获取内科诊查所见的值
strPhysicalExaminationExecuteContentMessage = txt_Medicine_DiacrisisFinding.Text.ToString().Trim();
break;
case 3://获取内科诊断所见的值
strPhysicalExaminationExecuteContentMessage = txt_Medicine__Diacrisis.Text.ToString().Trim();
break;
case 4://获取内科结论的值
strPhysicalExaminationExecuteContentMessage = txt_Medicine_Conclusion.Text.ToString().Trim();
break;
}
int intPhysicalExaminationContentID = Convert.ToInt32(dtPhysicalExaminationProject.Rows[i]["PhysicalExaminationContentID"].ToString().Trim());//获取体检执行内容ID
if (intSwitch == 3)//进行修改的操作
{
//获取体检执行内容明细ID
intPhysicalExaminationExecuteContentDetailID = Convert.ToInt32(dtPhysicalExaminationProject.Rows[i]["PhysicalExaminationExecuteContentDetailID"].ToString().Trim());
//进行修改的操作
if (myFRM_TiJianZhiXing_MainClient.FRM_TiJianZhiXing_Main_Update_PhysicalExaminationExecuteContentDetaiTable(intPhysicalExaminationContentID, intItemID, strPhysicalExaminationExecuteContentMessage, intReportDoctor_StaffID, dtpReportTime, intPhysicalExaminationExecuteContentDetailID) > 0)
{
intSaveSucceed++;//累加变量
}
}
else
{
//进行新增体检执行内容明细内容
if (myFRM_TiJianZhiXing_MainClient.FRM_TiJianZhiXing_Main_Load_btn_CommonSave_Click(intPhysicalExaminationContentID, intItemID, strPhysicalExaminationExecuteContentMessage, intPhysicalExaminationExecuteID, intReportDoctor_StaffID, dtpReportTime) > 0)
{
intSaveSucceed++;//累加变量
}
}
}
if (intSaveSucceed == intCountSucceed && intSaveSucceed > 0)//如果累加的变量和循环的次数相等且大于0
{
JudgeWetherFinisch();//自定义方法用于当添加体检执行明细内容表完成时,判断是否完成中的值,如果存在内容,为"√";否则为"×"
MessageBox.Show("内科检查项目检查记录保存成功! ");
UpdateAS_PhysicalExaminationRegisterID();//自定义一个方法判断是否修改体检登记状态,若修改了体检登记状态就重新绑定病人列表信息
dtPhysicalExaminationProject = null; //让表dtPhysicalExaminationProject为空可以解决,是为了修改完一个项目后,不单击项目而单击其他选项卡修改,尽管lbl_Item.Text = "",运行有选择项目的提示,还能显示修改成功,只是修改的内容与项目不对应
//保存内科项目后,把保存内科项目中的内容清空,防止保存重复操作
chk_MedicineWetherSure.Checked = false; txt_Medicine_Ultrasound.Text = ""; txt_Medicine__Diacrisis.Text = ""; txt_Medicine_DiacrisisFinding.Text = ""; txt_Medicine_Conclusion.Text = "";
txt_Medicine_PreviousHistory.Text = ""; lbl_ItemName.Text = "";
}
else
{
MessageBox.Show("内科检查项目检查记录保存失败!");
}
}
}
}
#endregion
其中涉及到的自定义方法有:
判断收费单下的体检项目是否完成涉及到的储存过程有:
--判断是否完成(经过处方的)
IF @Type = 'FRM_TiJianZhiXing_Main_WetherFinisch'
BEGIN
SELECT PW_PhysicalExaminationExecuteTable.PhysicalExaminationExecuteID, PW_PhysicalExaminationExecuteContentDetailTable.PhysicalExaminationExecuteContentMessage,
PW_PhysicalExaminationExecuteContentDetailTable.ItemID, PW_PhysicalExaminationExecuteContentDetailTable.PhysicalExaminationExecuteContentDetailID,
PW_PhysicalExaminationExecuteContentDetailTable.PhysicalExaminationContentID, BT_ItemTable.ItemName, PW_PhysicalExaminationExecuteTable.ChargeBillID
FROM PW_PhysicalExaminationExecuteTable INNER JOIN
PW_PhysicalExaminationExecuteContentDetailTable ON
PW_PhysicalExaminationExecuteTable.PhysicalExaminationExecuteID = PW_PhysicalExaminationExecuteContentDetailTable.PhysicalExaminationExecuteID INNER JOIN
BT_ItemTable ON PW_PhysicalExaminationExecuteContentDetailTable.ItemID = BT_ItemTable.ItemID
WHERE PW_PhysicalExaminationExecuteTable.ChargeBillID = @ChargeBillID and PW_PhysicalExaminationExecuteTable.WhetherOrdonnance = 1
END
--判断是否完成(不经过处方)
IF @Type = 'FRM_TiJianZhiXing_Main_WetherFinisch_0nChargeBillID'
BEGIN
SELECT PW_PhysicalExaminationExecuteTable.PhysicalExaminationExecuteID, PW_PhysicalExaminationExecuteContentDetailTable.PhysicalExaminationExecuteContentMessage, PW_PhysicalExaminationExecuteContentDetailTable.ItemID,
PW_PhysicalExaminationExecuteContentDetailTable.PhysicalExaminationExecuteContentDetailID, PW_PhysicalExaminationExecuteContentDetailTable.PhysicalExaminationContentID,
BT_ItemTable.ItemName, PW_PhysicalExaminationExecuteTable.ChargeBillID
FROM PW_PhysicalExaminationExecuteTable INNER JOIN
PW_PhysicalExaminationExecuteContentDetailTable ON
PW_PhysicalExaminationExecuteTable.PhysicalExaminationExecuteID = PW_PhysicalExaminationExecuteContentDetailTable.PhysicalExaminationExecuteID INNER JOIN
BT_ItemTable ON PW_PhysicalExaminationExecuteContentDetailTable.ItemID = BT_ItemTable.ItemID
WHERE PW_PhysicalExaminationExecuteTable.ChargeBillID = @ChargeBillID and PW_PhysicalExaminationExecuteTable.WhetherOrdonnance = 0
END
BLL中涉及到的方法有:
//判断是否完成(经过处方的)
[OperationContract]
public DataSet FRM_TiJianZhiXing_Main_WetherFinisch(int intChargeBillID)
{
SqlParameter[] mySqlParameters = {
new SqlParameter("@Type",SqlDbType .Char ),
new SqlParameter ("@ChargeBillID",SqlDbType.Int ),
};
mySqlParameters[0].Value = "FRM_TiJianZhiXing_Main_WetherFinisch ";
mySqlParameters[1].Value = intChargeBillID;
DataTable dt = myDALMethod.QueryDataTable("TiJianZhongXin_FRM_TiJianZhiXing_Main", mySqlParameters);
DataSet ds = new DataSet();
ds.Tables.Add(dt);
return ds;
}
//判断是否完成(不经过处方)
[OperationContract]
public DataSet FRM_TiJianZhiXing_Main_WetherFinisch_0nChargeBillID(int intChargeBillID)//根据收费单查询体检执行内容明细中是否存在信息
{
SqlParameter[] mySqlParameters = {
new SqlParameter("@Type",SqlDbType .Char ),
new SqlParameter ("@ChargeBillID",SqlDbType.Int ),
};
mySqlParameters[0].Value = "FRM_TiJianZhiXing_Main_WetherFinisch_0nChargeBillID ";
mySqlParameters[1].Value = intChargeBillID;
DataTable dt = myDALMethod.QueryDataTable("TiJianZhongXin_FRM_TiJianZhiXing_Main", mySqlParameters);
DataSet ds = new DataSet();
ds.Tables.Add(dt);
return ds;
}
UIL中自定义方法的代码:
#region 自定义方法用于判断是否完成中的值,如果存在内容,为"√";否则为"×"
void JudgeWetherFinisch()
{
DataTable dtWetherFinisch = new DataTable();
if (intOrdonnanceID != 0)//如果处方单ID不为空
{
//绑定经过处方的体检项目和判断经过处方的是否完成
dgv_PhysicalExaminationExecuteContentDetail.DataSource =
myFRM_TiJianZhiXing_MainClient.FRM_TiJianZhiXing_Main_Load_dgv_PhysicalExaminationExecuteContentDetail(intChargeBillID).Tables[0];
dtWetherFinisch = myFRM_TiJianZhiXing_MainClient.FRM_TiJianZhiXing_Main_WetherFinisch(intChargeBillID).Tables[0];//
}
else
{
//绑定不经过处方的体检项目和判断不经过处方的是否完成
dgv_PhysicalExaminationExecuteContentDetail.DataSource =
myFRM_TiJianZhiXing_MainClient.FRM_TiJianZhiXing_Main_Load_dgv_PhysicalExaminationExecuteContentDetail_SelectItem(intChargeBillID).Tables[0];
dtWetherFinisch = myFRM_TiJianZhiXing_MainClient.FRM_TiJianZhiXing_Main_WetherFinisch_0nChargeBillID(intChargeBillID).Tables[0];
}
//根据挂号ID,查询对应的体检执行内容明细中的信息
if (dtWetherFinisch.Rows.Count == 0) //ddd小于行的集合=0,说明该挂号病人没有检查任何的项目,说明所有项目的是否完成的值都为"×";
{
foreach (DataGridViewRow dgvr in dgv_PhysicalExaminationExecuteContentDetail.Rows)
{
dgvr.Cells["是否完成"].Value = "×";
}
}
else
{
for (int i = 0; i < dgv_PhysicalExaminationExecuteContentDetail.Rows.Count; i++)//遍历dgv_PhysicalExaminationExecuteContentDetail行的集合
{
for (int k = 0; k < dtWetherFinisch.Rows.Count; k++)//遍历dtdtWetherFinisch行的集合
{
//如果两者中的项目ID相同,即说明体检执行内容明细表中对该项目的体检执行内容信息已经完成 ,否则就没有完成
if (Convert.ToInt32(dgv_PhysicalExaminationExecuteContentDetail.Rows[i].Cells["项目ID"].Value) == Convert.ToInt32(dtWetherFinisch.Rows[k]["ItemID"]))
{
intSelectWetherFinisch++;
dgv_PhysicalExaminationExecuteContentDetail.Rows[i].Cells["是否完成"].Value = "√";
break;
}
else
{
dgv_PhysicalExaminationExecuteContentDetail.Rows[i].Cells["是否完成"].Value = "×";
}
}
}
}
}
#endregion
判断收费单下的体检项目是否完成,全部完成就进行修改该病人对应的体检状态的
涉及到修改体检状态的储存过程有:
-- 修改体检登记中的登记状态
IF @Type = 'FRM_TiJianZhiXing_Main_UpdateAS_PhysicalExaminationRegisterIDOnAuxiliaryItemDetailID'
BEGIN
UPDATE PW_AuxiliaryItemDetailTable
SET AS_PhysicalExaminationRegisterID = 364
WHERE AuxiliaryItemDetailID = @AuxiliaryItemDetailID
END
BLL中对应的方法有:
//修改体检登记中的登记状态
[OperationContract]
public int FRM_TiJianZhiXing_Main_UpdateAS_PhysicalExaminationRegisterIDOnAuxiliaryItemDetailID(int intAuxiliaryItemDetailID)
{
SqlParameter[] mySqlParameters = {
new SqlParameter("@Type",SqlDbType .Char ),//根据辅助项目修改体检状态
new SqlParameter ("@AuxiliaryItemDetailID",SqlDbType.Int ),
};
mySqlParameters[0].Value = "FRM_TiJianZhiXing_Main_UpdateAS_PhysicalExaminationRegisterIDOnAuxiliaryItemDetailID ";
mySqlParameters[1].Value = intAuxiliaryItemDetailID;
return myDALMethod.UpdateData("TiJianZhongXin_FRM_TiJianZhiXing_Main", mySqlParameters);
}
UIL中涉及到的代码有:
#region 自定义一个方法判断是否修改体检登记状态,若修改了体检登记状态就重新绑定病人列表信息
void UpdateAS_PhysicalExaminationRegisterID()
{
if (intSwitch == 2)
{
int intCount = 0; int intSuccess = 0;//声明两个变量用于判断是否进行修改体检登记状态
foreach (DataGridViewRow dgvr in dgv_PhysicalExaminationExecuteContentDetail.Rows)//遍历循环体检检查项目列表中的每行
{
intCount++;
if (dgvr.Cells["是否完成"].Value.ToString() == "√")
{
intSuccess++;
}
}
if (intCount == intSuccess)//如果每行中的是否完成的值都为‘√’,就修改体检登记状态
{
for (int i = 0; i < dgv_PhysicalExaminationExecuteContentDetail.Rows.Count; i++)
{
intAuxiliaryItemDetailID = Convert.ToInt32(dgv_PhysicalExaminationExecuteContentDetail.Rows[i].Cells["辅助项目ID1"].Value);
myFRM_TiJianZhiXing_MainClient.FRM_TiJianZhiXing_Main_Load_UpdateAS_PhysicalExaminationRegisterID(intAuxiliaryItemDetailID);
}
//修改完体检登记状态后重新进行病人信息(dgv_PatientMessage)的数据绑定
dgv_PatientMessage.DataSource = myFRM_TiJianZhiXing_MainClient.FRM_TiJianZhiXing_Main_Load_dgv_PatientMessage().Tables[0];
dgv_PatientMessage.ColumnHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;//列标题居中
JudgeItemCategoryName();//自定义方法绑定病人信息中项目类型
}
}
}
#endregion
这样对病人的某一项体检项目就就完成了,依次类推对病人的各个体检项目也如此,那么对病人的体检也算完成了。同时也可以对某一病人的收费单下的体检项目进行修改,点击要进行修改的体检病人右键点击 。修改涉及到的储存过程有:
--查询某一个收费单下的全部检查内容信息
IF @Type = 'FRM_TiJianZhiXing_Main_dgv_PatientMessage_CellClick_SelectAllMessage'
BEGIN
SELECT RTRIM(NULL) AS PhysicalExaminationSetMealName, BT_ItemTable.ItemID, RTRIM(BT_ItemTable.ItemName) AS ItemName, RTRIM(NULL) AS PhysicalExaminationSetMealID, RTRIM(NULL)
AS PhysicalExaminationSetMealDetailID, RTRIM('√') AS WhetherFinish, PW_PhysicalExaminationExecuteContentDetailTable.PhysicalExaminationContentID,
PW_PhysicalExaminationExecuteContentDetailTable.PhysicalExaminationExecuteContentMessage, PW_PhysicalExaminationExecuteContentDetailTable.PhysicalExaminationExecuteID,
PW_PhysicalExaminationExecuteTable.HealthSuggest, PW_PhysicalExaminationExecuteContentDetailTable.PhysicalExaminationExecuteContentDetailID,
PW_PhysicalExaminationContentTable.PhysicalExaminationContentName, PW_PhysicalExaminationContentTable.PhysicalExaminationTypeName, BT_StaffTable.StaffName,
PW_PhysicalExaminationExecuteTable.ExecuteDoctor_StaffID, PW_PhysicalExaminationExecuteTable.Remarks, PW_PhysicalExaminationExecuteTable.ExecuteNumber,
PW_PhysicalExaminationExecuteContentDetailTable.ReportDoctor_StaffID, PW_PhysicalExaminationExecuteContentDetailTable.ReportTime, BT_StaffTable_1.StaffName AS 报告医生,
PW_PhysicalExaminationExecuteTable.ChargeBillID
FROM PW_PhysicalExaminationExecuteContentDetailTable INNER JOIN
BT_ItemTable ON PW_PhysicalExaminationExecuteContentDetailTable.ItemID = BT_ItemTable.ItemID INNER JOIN
PW_PhysicalExaminationExecuteTable ON
PW_PhysicalExaminationExecuteContentDetailTable.PhysicalExaminationExecuteID = PW_PhysicalExaminationExecuteTable.PhysicalExaminationExecuteID INNER JOIN
PW_PhysicalExaminationContentTable ON
PW_PhysicalExaminationExecuteContentDetailTable.PhysicalExaminationContentID = PW_PhysicalExaminationContentTable.PhysicalExaminationContentID INNER JOIN
BT_StaffTable ON PW_PhysicalExaminationExecuteTable.ExecuteDoctor_StaffID = BT_StaffTable.StaffID INNER JOIN
BT_StaffTable AS BT_StaffTable_1 ON PW_PhysicalExaminationExecuteContentDetailTable.ReportDoctor_StaffID = BT_StaffTable_1.StaffID
WHERE PW_PhysicalExaminationExecuteTable. PhysicalExaminationExecuteID = @PhysicalExaminationExecuteID
END
BLL中与之对应的方法有:
//查询某一个收费单下的全部检查内容信息
[OperationContract]
public DataSet FRM_TiJianZhiXing_Main_dgv_PatientMessage_CellClick_SelectAllMessage(int intPhysicalExaminationExecuteID)
{
SqlParameter[] mySqlParameters = {
new SqlParameter("@Type",SqlDbType .Char ),
new SqlParameter ("@PhysicalExaminationExecuteID",SqlDbType.Int ),//根据体检执行单查询该单下的所有体检项目
};
mySqlParameters[0].Value = "FRM_TiJianZhiXing_Main_dgv_PatientMessage_CellClick_SelectAllMessage ";
mySqlParameters[1].Value = intPhysicalExaminationExecuteID;
DataTable dt = myDALMethod.QueryDataTable("TiJianZhongXin_FRM_TiJianZhiXing_Main", mySqlParameters);
DataSet ds = new DataSet();
ds.Tables.Add(dt);
return ds;
}
UIL中 在工具箱中找到鼠标拖动到界面点击病人列表右键属性
找到属性中的 点击选择
对应的代码有:
Boolean blnReportDoctor = false;//将要修改的体检执行内容明细表中的报告医生根据对应项目进行绑定到同一个下拉框中
private void 修改ToolStripMenuItem_Click(object sender, EventArgs e)
{
blnReportDoctor = true;//将要修改的体检执行内容明细表中的报告医生根据对应项目进行绑定到同一个下拉框中
清空ToolStripMenuItem_Click(null, null);//修改前先把所有项目中的控件清空
if (intOrdonnanceID > 0)
{
strPhysicalExaminationRegister = dgv_PatientMessage.CurrentRow.Cells["体检登记"].Value.ToString().Trim();//获取病人体检登记的信息
if (strPhysicalExaminationRegister == "已执行")//如果是执行完成的病人,就绑定好相应的执行信息进行体检执行内容中
{ //根据该挂号进行获取该挂号的体检执行ID
DataTable dtPhysicalExaminationExecuteID = myFRM_TiJianZhiXing_MainClient.FRM_TiJianZhiXing_Main_Load_dgv_PatientMessage_CellClick_SelectPhysicalExaminationExecuteID(intChargeBillID).Tables[0];
intPhysicalExaminationExecuteID = Convert.ToInt32(dtPhysicalExaminationExecuteID.Rows[0]["PhysicalExaminationExecuteID"].ToString().Trim());//获取体检执行ITD
//获取体检执行ID后查询体检执行ID中的全部信息,
DataTable dtAllExecuteMessage = myFRM_TiJianZhiXing_MainClient.FRM_TiJianZhiXing_Main_dgv_PatientMessage_CellClick_SelectAllMessage(intPhysicalExaminationExecuteID).Tables[0];
FRM( dtAllExecuteMessage);
intSwitch = 3;//给intSwitch = 3 是为了给各个项目保存中的一个判断,判断如果intSwitch = 3 保存按钮就执行修改的方法,否则就执行新增的方法
}
else
{
MessageBox.Show("该病人还没有进行体检执行操作!请执行该处方病人的内容!");
}
}
else
{
strPhysicalExaminationRegister = dgv_PatientMessage.CurrentRow.Cells["体检登记"].Value.ToString().Trim();//获取病人体检登记的信息
if (strPhysicalExaminationRegister == "已执行")//如果是执行完成的病人,就绑定好相应的执行信息进行体检执行内容中
{ //根据该挂号进行获取该挂号的体检执行ID
DataTable dtPhysicalExaminationExecuteID = myFRM_TiJianZhiXing_MainClient.FRM_TiJianZhiXing_Main_Load_dgv_PatientMessage_CellClick_SelectPhysicalExaminationExecuteIDOnChargeBillID(intChargeBillID).Tables[0];
intPhysicalExaminationExecuteID = Convert.ToInt32(dtPhysicalExaminationExecuteID.Rows[0]["PhysicalExaminationExecuteID"].ToString().Trim());//获取体检执行ITD
//获取体检执行ID后查询体检执行ID中的全部信息,
DataTable dtAllExecuteMessage = myFRM_TiJianZhiXing_MainClient.FRM_TiJianZhiXing_Main_dgv_PatientMessage_CellClick_SelectAllMessage(intPhysicalExaminationExecuteID).Tables[0];
FRM(dtAllExecuteMessage);
intSwitch = 3;//给intSwitch = 3 是为了给各个项目保存中的一个判断,判断如果intSwitch = 3 保存按钮就执行修改的方法,否则就执行新增的方法
}
else
{
MessageBox.Show("该病人还没有进行体检执行操作!请执行该体检病人的内容!");
}
}
}
输入需要修改的内容后,在
是否确认处打上勾,然后
点击保存,这样就对修改 体检的结果进行了保存了。其中涉及到的储存过程有:
--修改体检执行内容中的各个项目中的内容
IF @Type = 'FRM_TiJianZhiXing_Main_Update_PhysicalExaminationExecuteContentDetaiTable'
BEGIN
UPDATE PW_PhysicalExaminationExecuteContentDetailTable
SET PhysicalExaminationContentID =@PhysicalExaminationContentID, ItemID =@ItemID,
PhysicalExaminationExecuteContentMessage =@PhysicalExaminationExecuteContentMessage,
ReportDoctor_StaffID = @ReportDoctor_StaffID,ReportTime = @ReportTime
WHERE PhysicalExaminationExecuteContentDetailID = @PhysicalExaminationExecuteContentDetailID
END
BLL中涉及到的方法有:
//修改体检执行中的各个项目中的内容
[OperationContract]
public int FRM_TiJianZhiXing_Main_Update_PhysicalExaminationExecuteContentDetaiTable(int intPhysicalExaminationContentID, int intItemID,
string strPhysicalExaminationExecuteContentMessage, int intReportDoctor_StaffID, DateTime dtpReportTime, int intPhysicalExaminationExecuteContentDetailID)
{
SqlParameter[] mySqlParameters = {
new SqlParameter("@Type",SqlDbType .Char ),
new SqlParameter ("@PhysicalExaminationContentID",SqlDbType.Int ),//获取界面中传入的体检内容ID
new SqlParameter("@ItemID",SqlDbType.Int ),//获取界面中传入的体检项目ID
new SqlParameter ("@PhysicalExaminationExecuteContentMessage",SqlDbType.Char ),//获取界面中传入的体检结果
new SqlParameter ("@ReportDoctor_StaffID",SqlDbType.Int ),//获取界面中传入的报告医生ID
new SqlParameter ("@ReportTime",SqlDbType.Date ),//获取界面中传入的报告时间
new SqlParameter ("@PhysicalExaminationExecuteContentDetailID",SqlDbType.Int ),//获取界面中传入的体检内容明细ID
};
mySqlParameters[0].Value = "FRM_TiJianZhiXing_Main_Update_PhysicalExaminationExecuteContentDetaiTable ";
mySqlParameters[1].Value = intPhysicalExaminationContentID;
mySqlParameters[2].Value = intItemID;
mySqlParameters[3].Value = strPhysicalExaminationExecuteContentMessage;
mySqlParameters[4].Value = intReportDoctor_StaffID;
mySqlParameters[5].Value = dtpReportTime;
mySqlParameters[6].Value = intPhysicalExaminationExecuteContentDetailID;
return myDALMethod.UpdateData("TiJianZhongXin_FRM_TiJianZhiXing_Main", mySqlParameters);
}
UIL中涉及到的代码有:
if (intSwitch == 2 || intSwitch == 3)
{
if (chk_MedicineWetherSure.Checked == true)
{
#region 内科项目检查保存内容
if (txt_Medicine_Ultrasound.Text == "")//提示输入内科项目各项的值
{
MessageBox.Show("请输入内科项目超声的值!");
txt_Medicine_Ultrasound.Focus(); return;
}
else if (txt_Medicine__Diacrisis.Text == "")
{
MessageBox.Show("请输入内科项目诊断的值!");
txt_Medicine__Diacrisis.Focus(); return;
}
else if (txt_Medicine_DiacrisisFinding.Text == "")
{
MessageBox.Show("请输入内科项目诊查所见的值!");
txt_Medicine_DiacrisisFinding.Focus(); return;
}
else if (txt_Medicine_Conclusion.Text == "")
{
MessageBox.Show("请输入内科项目诊查结论的值!");
txt_Medicine_Conclusion.Focus(); return;
}
else
{
if (dtPhysicalExaminationProject == null)
{ }
else//说明
{
if (dtPhysicalExaminationProject.Rows.Count > 0)
{
for (int i = 0; i < dtPhysicalExaminationProject.Rows.Count; i++)//遍历新增体检执行明细表中的体检具体信息,新增各个控件的值
{
intCountSucceed++; string strPhysicalExaminationExecuteContentMessage = "";
switch (i)
{
case 0://获取内科超声的值
strPhysicalExaminationExecuteContentMessage = txt_Medicine_Ultrasound.Text.ToString().Trim();
break;
case 1://获取内科既往史的值
strPhysicalExaminationExecuteContentMessage = txt_Medicine_PreviousHistory.Text.ToString().Trim();
break;
case 2://获取内科诊查所见的值
strPhysicalExaminationExecuteContentMessage = txt_Medicine_DiacrisisFinding.Text.ToString().Trim();
break;
case 3://获取内科诊断所见的值
strPhysicalExaminationExecuteContentMessage = txt_Medicine__Diacrisis.Text.ToString().Trim();
break;
case 4://获取内科结论的值
strPhysicalExaminationExecuteContentMessage = txt_Medicine_Conclusion.Text.ToString().Trim();
break;
}
int intPhysicalExaminationContentID = Convert.ToInt32(dtPhysicalExaminationProject.Rows[i]["PhysicalExaminationContentID"].ToString().Trim());//获取体检执行内容ID
if (intSwitch == 3)//进行修改的操作
{
//获取体检执行内容明细ID
intPhysicalExaminationExecuteContentDetailID = Convert.ToInt32(dtPhysicalExaminationProject.Rows[i]["PhysicalExaminationExecuteContentDetailID"].ToString().Trim());
//进行修改的操作
if (myFRM_TiJianZhiXing_MainClient.FRM_TiJianZhiXing_Main_Update_PhysicalExaminationExecuteContentDetaiTable(intPhysicalExaminationContentID, intItemID, strPhysicalExaminationExecuteContentMessage, intReportDoctor_StaffID, dtpReportTime, intPhysicalExaminationExecuteContentDetailID) > 0)
{
intSaveSucceed++;//累加变量
}
}
else
{
//进行新增体检执行内容明细内容
if (myFRM_TiJianZhiXing_MainClient.FRM_TiJianZhiXing_Main_Load_btn_CommonSave_Click(intPhysicalExaminationContentID, intItemID, strPhysicalExaminationExecuteContentMessage, intPhysicalExaminationExecuteID, intReportDoctor_StaffID, dtpReportTime) > 0)
{
intSaveSucceed++;//累加变量
}
}
}
if (intSaveSucceed == intCountSucceed && intSaveSucceed > 0)//如果累加的变量和循环的次数相等且大于0
{
JudgeWetherFinisch();//自定义方法用于当添加体检执行明细内容表完成时,判断是否完成中的值,如果存在内容,为"√";否则为"×"
MessageBox.Show("内科检查项目检查记录保存成功! ");
UpdateAS_PhysicalExaminationRegisterID();//自定义一个方法判断是否修改体检登记状态,若修改了体检登记状态就重新绑定病人列表信息
dtPhysicalExaminationProject = null; //让表dtPhysicalExaminationProject为空可以解决,是为了修改完一个项目后,不单击项目而单击其他选项卡修改,尽管lbl_Item.Text = "",运行有选择项目的提示,还能显示修改成功,只是修改的内容与项目不对应
//保存内科项目后,把保存内科项目中的内容清空,防止保存重复操作
chk_MedicineWetherSure.Checked = false; txt_Medicine_Ultrasound.Text = ""; txt_Medicine__Diacrisis.Text = ""; txt_Medicine_DiacrisisFinding.Text = ""; txt_Medicine_Conclusion.Text = "";
txt_Medicine_PreviousHistory.Text = ""; lbl_ItemName.Text = "";
}
else
{
MessageBox.Show("内科检查项目检查记录保存失败!");
}
}
}
}
#endregion
}
else
{
MessageBox.Show("是否进行保存操作?如果要进行保存操作,请在是否进确认处打上 ✔");
}
}
体检执行完成后,就需要把病人的体检结果以纸质的形式返回给病人!
此文章仅供用于学习,禁止用于商业用途,否则后果自负!