WCF医院管理系统技术解析(四)体检登记(三)
体检登记中的新增历史病人(需要注意的是:该病人不经过挂号和处方,只是到医院进行体检)与医院中的前台登记病人不同。
对于这种情况:我的思路是:该病人先到医院进行登记体检,然后设置好体检的项目,再到前台进行收费,最后拿着收费单到体检执行处,执行体检处将体检的结果以纸质形式返回给病人。
选择好历史病人后,历史病人的病历就会显示出来效果图为:
2.9.8(图25)
该界面用到的控件有:
控件 | 说明 从工具箱中找到对应的控件,拖动到界面,右键属性可以设置控件的一些属性样式和事件。如显示的文本,命名是规范
|
文本框 (TextBox) | |
下拉框 (ComBobox) | |
数据表格 (DataGridView) | |
按钮(Button) | |
标签 (Label) | |
容器(Panel) | |
选项卡(TabContral) |
涉及到的表和关系有:
2.9.8(图26)
2.9.8(图27)
表1:门诊病历模板表(BT_OutpatientMedicalRecordsTemplateTable)
用于记录挂号病人的病历和其他信息
列名 | 数据类型 | 主键/外键 | 说明 |
OutpatientMedicalRecordsTemplateID | int | 主键 | 门诊病历模板ID |
TemplateNumber | nchar (50) |
| 模板编号 |
TemplateName | nchar (50) |
| 模板名称 |
WriteDoctor_StaffID | int | 外键 | 撰写医生_员工ID |
WriteTechnicalOfficesID | int | 外键 | 撰写科室_科室ID |
AS_TemplateTypeID | int | 外键 | 模板类型ID |
AS_InvokingJurisdictionID | int | 外键 | 调用权限ID |
WhetherOperation | bit |
| 是否手术 |
TemplateRemarks | nchar (200) |
| 模板备注 |
SuitCase | nchar (200) |
| 适合情况 |
PatientActionInChief | nchar (300) |
| 病人主诉 |
PatientMedicalHistory | nchar (300) |
| 病人病史 |
PhysicalExaminationCase | nchar (300) |
| 体检情况 |
InitialDiagnosis | nchar (300) |
| 初步诊断 |
DisposeIdea | nchar (300) |
| 处理意见 |
WhetherEffective | bit | ((1)) | 有效否 |
RegisterID | int | 外键 | 挂号ID |
表2:挂号表(RegisterTable)
用于对病人进行挂号候等医生看病人的情况
列名 | 数据类型 | 主键/外键 | 说明 |
RegisterID | int | 主键 | 挂号ID |
RegisterNumber | nchar (50) |
| 挂号单号 |
PatientID | int | 外键 | 病人ID |
AS_SettleAccountsWayID | int | 外键 | 结算方式ID |
TechnicalOfficesID | int | 外键 | 科室ID |
Doctor_StaffID | int | 外键 | 医生_员工ID |
RegisterSum | decimal (18, 2) |
| 挂号金额 |
DiagnosisFee | decimal (18, 2) |
| 诊察费 |
CaseHistorySum | decimal (18, 2) |
| 病历金额 |
RegisterRemarks | nchar (50) |
| 挂号备注 |
RegisterTime | datetime |
| 挂号时间 |
AS_RegisterStatusID | int | 外键 | 挂号状态ID |
ClassesID | int | 外键 | 班次ID |
InvoiceNumber | nchar (50) |
| 发票号 |
RegisterOperator_StaffID | int | 外键 | 挂号人员(操作员)_员工ID |
WhetherEffective | bit | ((1)) | 有效否 |
NullifyRemarks | nchar (100) |
| 作废备注 |
NullifyOperator_StaffID | int | 外键 | 作废操作员_员工ID |
表3.病人表(BT_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 |
| 是否体检 |
表4:属性明细表(BT_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)) | 有效否 |
表5:收费单表(PW_ChargeBillID)
用于对病人的处方单或者其他收费单进行收费的凭证
列名 | 数据类型 | 主键/外键 | 说明 |
ChargeBillID | int | 主键 | 收费单ID |
ReceiptNumber | nchar (30) |
| 收据号 |
BillNumber | nchar (30) |
| 发票号 |
AS_ChargeStatusID | int | 外键 | 收费状态ID |
OrdonnanceID | int | 外键 | 处方单ID |
Discount | decimal (18, 2) |
| 折扣 |
CashPaySum | decimal (18, 2) |
| 现金支付金额 |
MedicarePaySum | decimal (18, 2) |
| 医保支付金额 |
BlockPaySum | decimal (18, 2) |
| 卡付金额 |
TallyPaySum | decimal (18, 2) |
| 记账支付金额 |
Operator_StaffID | int | 外键 | 操作员_员工ID |
OperateTime | datetime |
| 操作时间 |
WhetherCancel | bit |
| 作废否 |
WhetherEffective | bit | ((1)) | 有效否 |
WhetherOrdonnance | Bit |
| 是否经过处方 |
表6:体检登记病人表(PW_PhysicalExaminationChargeBillPatientTable)
用于记录不经过处方只是体检的病人的收费情况
列名 | 数据类型 | 主键/外键 | 说明 |
PhysicalExaminationChargeBillPatientID | Int | 主键 | 体检登记病人ID |
PatientID | Int | 外键 | 病人ID |
ChargeBillID | Int | 外键 | 收费单ID |
AuxiliaryItemDetailID | Int | 外键 | 辅助项目明细ID |
WhetherChargeBill | Bit |
| 是否收费 |
表7:处方单表(PW_OrdonnanceTable)
用于对体检病人进行开处方
列名 | 数据类型 | 主键/外键 | 说明 |
OrdonnanceID | int | 主键 | 处方单ID |
OrdonnanceNumber | nchar (30) |
| 处方单号 |
PatientID | int | 外键 | 病人ID |
PrescriptionDate | datetime |
| 处方时间 |
ClinicTechnicalOffices_TechnicalOfficesID | int | 外键 | 就诊科室_科室ID |
TreatmentDoctor_StaffID | int | 外键 | 就诊医生_员工ID |
AS_ChargeStatusID | int | 外键 | 收费状态ID |
ChargeForPersonnel_StaffID | int | 外键 | 收费人员_员工ID |
ChargeTime | datetime |
| 收费时间 |
AS_TakeMedicineStatusID | int | 外键 | 发药状态ID |
TakeMedicinePersonnel_StaffID | int | 外键 | 发药人员_员工ID |
TakeMedicineTime | datetime |
| 发药时间 |
BedID | int | 外键 | 床位ID |
WhetherEffective | bit | ((1)) | 有效否 |
表8:药品表【DrugTable】
用于存放药品
列名 | 数据类型 | 主键/外键 | 说明 |
DrugID | int | 主键 | 药品ID |
DrugName | nchar (70) |
| 药品名称 |
ChargeCategoryID | int | 外键 | 收费类别 ID |
DrugEncoding | nchar (30) |
| 药品编码 |
StripShapeEncoding | nchar (50) |
| 条形码 |
MedicineEncoding | nchar (30) |
| 医学编码 |
EnglishName | nchar (50) |
| 英文名称 |
RatifyWritingNumber | nchar (70) |
| 批准文号 |
AlphabeticBrevityCode | nchar (20) |
| 拼音简码 |
WubiInCode | nchar (20) |
| 五笔简码 |
AS_DrugAgentTypeID | int | 外键 | 药品类型ID |
AS_DoseUnitID | int | 外键 | 剂量单位ID |
UnitDose | nchar (30) |
| 单位剂量 |
DrugSpecification | nchar (50) |
| 药品规格 |
AS_ScatteredUnitID | int | 外键 | 散装单位I |
AS_PieceUnitID | int | 外键 | 件装单位ID |
AS_DrugTypeID | int | 外键 | 药品类型ID |
DrugPicture | char (200) |
| 药品图片 |
WhetherMedicare | bit |
| 是否医保 |
MedicareEncoding | nchar (50) |
| 医保编码 |
WhetherMedicalRecord | bit |
| 在病历中否 |
WhetherAddWater | bit |
| 是否加水 |
WhetherSkinTest | bit |
| 是否皮试 |
WhetherSpecialDrugs | bit |
| 特殊药品否 |
AS_DistributionWayID | int | 外键 | 经销方式ID |
AS_UserStatusID | int | 外键 | 使用状态ID |
AS_MedicareCategoryID | int | 外键 | 医保类别 ID |
ApplicableSymptoms | nchar (100) |
| 适用症状 |
PromotionalLogo | nchar (50) |
| 促销标识 |
MainEfficacy | nchar (100) |
| 主要功效 |
WhetherIntegral | bit |
| 积分否 |
IntegralProportion | decimal (18, 2) |
| 积分比例 |
IntegralScores | decimal (18, 2) |
| 积分分数 |
WhetherParticipateInInventoryAccountingManagement | bit |
| 参与库存核算管理否 |
WhetherAllowTheFrontDeskToChangePriceSales | bit |
| 允许前台改价销售否 |
WhetherAllowTheFrontDeskDiscountSales | bit |
| 允许前台折扣销售否 |
AS_ValuationWayID | int | 外键 | 计价方式ID |
EntryStaff_StaffID | int | 外键 | 录入人员_员工ID |
EntryDate | datetime |
| 录入日期 |
UpdateStaff_StaffID | int | 外键 | 更新人员_员工ID |
UpdateDate | datetime |
| 更新日期 |
WhetherEffective | bit | ((1)) | 有效否 |
AS_DrugAgentTypeID | Int | 外键 | 药品剂型ID |
ScatteredStockPrice | decimal (18, 2 |
| 散装进价 |
PieceStockPrice | decimal (18, 2 |
| 件装进价 |
ScatteredPrice | decimal (18, 2) |
| 散装售价 |
PiecePrice | decimal (18, 2) |
| 件装售价 |
ScatteredMemberPrice | decimal (18, 2) |
| 散会员价 |
表9:药品价格表(DrugPriceTable)
列名 | 数据类型 | 主键/外键 | 说明 |
DrugPriceID | int - Identity | 主键 | 药品价格ID |
DrugID | int | 外键 | 药品ID |
ScatteredPrice | decimal (18, 2) |
| 散装售价 |
ScatteredMemberPrice | decimal (18, 2) |
| 散会员价 |
PiecePrice | decimal (18, 2) |
| 件装售价 |
MedicarePrice | decimal (18, 2) |
| 医保价格 |
SupplierID | int | 外键 | 供货商ID |
ManufacturerName | nchar (100) |
| 厂商名称 |
ProductionField | nchar (100) |
| 生产产地 |
ProductionBatchNumber | nchar (50) |
| 生产批号 |
ProductionDate | datetime |
| 生产日期 |
ValidityPeriod | datetime |
| 有效期 |
WhetherEffective | bit | ((1)) | 有效否 |
DataOperateRecordID | int |
| 数据操作记录ID |
数据库中涉及的储存过程有:
--根据病人IF查找病人的病历
IF @Type = 'FRM_TiJianDengJi_Insert_Load_SelectBingLi'
BEGIN
SELECT BT_PatientTable.PatientID, BT_PatientTable.PatientName, BT_PatientTable.AS_SexID, BT_AttributeDetailsTable.AttributeDetailsName <span style="white-space:pre"> </span> AS Sex, BT_OutpatientMedicalRecordsTemplateTable.PatientActionInChief, BT_OutpatientMedicalRecordsTemplateTable.PatientMedicalHi<span style="white-space:pre"> </span>, PW_RegisterTable.RegisterTime, PW_RegisterTable.RegisterID
FROM BT_OutpatientMedicalRecordsTemplateTable INNER JOIN
PW_RegisterTable ON BT_OutpatientMedicalRecordsTemplateTable.RegisterID = PW_RegisterTable.RegisterID INNER JOIN
BT_PatientTable ON PW_RegisterTable.PatientID = BT_PatientTable.PatientID INNER JOIN
BT_AttributeDetailsTable ON BT_PatientTable.AS_SexID = BT_AttributeDetailsTable.AttributeDetailsID
WHERE BT_PatientTable.PatientID = @PatientID
END
BLL中涉及到的对应方法有:
#region 查询病人的病历
[OperationContract]
public DataSet FRM_TiJianDengJi_Insert_Load_SelectBingLi(int intPatientID)//获取界面中选择的历史病人
{
SqlParameter[] mySqlParameters = {
new SqlParameter("@Type",SqlDbType .Char ),
new SqlParameter ("@PatientID",SqlDbType.Char),//根据病人ID查找数据库中的病人病史
};
mySqlParameters[0].Value = "FRM_TiJianDengJi_Insert_Load_SelectBingLi";
mySqlParameters[1].Value = intPatientID;
DataTable dt = myDALMethod.QueryDataTable("TiJianZhongXin_TiJianDengJi_Patient_Main", mySqlParameters);
DataSet ds = new DataSet();
ds.Tables.Add(dt);
return ds;
}
#endregion
UIL中涉及到的代码有:
// 根据病人ID把查询到的病人信息绑定到对应的控件中
DataTable dtMedicalHistory = myFRM_TiJianDengJi_Patient_MainClient.FRM_TiJianDengJi_Insert_Load_SelectBingLi(intPatienID).Tables[0];
if (dtMedicalHistory.Rows.Count == 0)
{ }
else
{
string[] strMedicalHistory = new string[dtMedicalHistory.Rows.Count];//声明一个字符串的数组,长度为dtMedicalHistory中行的集合
string strBingLi = ""; int intCount = 0;
for (int i = 0; i < dtMedicalHistory.Rows.Count; i++)//遍历查询出来的病人病历信息表
{
intCount = i + 1;//累加病人看病的次数
//数组成员获取病人的看病次数和病历
strMedicalHistory[i] = "第" + intCount + "次到医院病史情况:" + "\t" + dtMedicalHistory.Rows[i]["PatientMedicalHistory"].ToString().Trim() + "\r\n";
strBingLi += strMedicalHistory[i] + "\r\n";//累加数组成员
}
txt_CaseHistory.Text = strBingLi;//把病人的看病情况进行赋值给病历文本框
}
历史病人的账户流水效果图如下:
2.9.8(图28)
图解:通过图像可以看出处方单号中的第一条数据的单号为“无”,那么这是怎么回事?那是因为该条单据是病人到医院只是做了体检项目的收费,并不经过处方涉及到其他的收费项目,所以她的处方单号为“无”,但是第二条数据就不同了
,那条数据她是经过处方单开的收费项目,
涉及到的表和关系有:
经过处方单的
2.9.8(图29)
2.9.8(图30)
不经过处方单的:
2.9.8(图32)
涉及到的储存过程有:
-根据病人ID查找处方ID
IF @Type = 'FRM_TiJianBingRen_Insert_SelectOrdonnanceIDOnPatientID'
BEGIN
--经过处方
SELECT PW_OrdonnanceTable.PatientID, PW_OrdonnanceTable.OrdonnanceID, RTRIM(PW_OrdonnanceTable.OrdonnanceNumber) AS OrdonnanceNumber, RTRIM(BT_PatientTable.PatientName)
AS PatientName, PW_OrdonnanceTable.PrescriptionDate, BT_PatientTable.AS_SexID, rtrim(BT_AttributeDetailsTable.AttributeDetailsName) as AttributeDetailsName ,
rtrim(BT_PatientTable.PatientCardNumber ) as PatientCardNumber,RTRIM(0) AS ChargeBillID
FROM BT_PatientTable INNER JOIN
PW_OrdonnanceTable ON BT_PatientTable.PatientID = PW_OrdonnanceTable.PatientID INNER JOIN
BT_AttributeDetailsTable ON BT_PatientTable.AS_SexID = BT_AttributeDetailsTable.AttributeDetailsID
where BT_PatientTable.PatientID = @PatientID
UNION
--不经过处方
SELECT DISTINCT
BT_PatientTable.PatientID, RTRIM(0) AS OrdonnanceID, RTRIM('无') AS OrdonnanceNumber, BT_PatientTable.PatientName, PW_ChargeBillTable.OperateTime AS PrescriptionDate,
BT_PatientTable.AS_SexID, RTRIM(BT_AttributeDetailsTable.AttributeDetailsName) AS AttributeDetailsName, RTRIM(BT_PatientTable.PatientCardNumber) AS PatientCardNumber,
PW_PhysicalExaminationChargeBillPatientTable.ChargeBillID
FROM PW_ChargeBillTable INNER JOIN
PW_PhysicalExaminationChargeBillPatientTable ON PW_ChargeBillTable.ChargeBillID = PW_PhysicalExaminationChargeBillPatientTable.ChargeBillID INNER JOIN
BT_PatientTable ON PW_PhysicalExaminationChargeBillPatientTable.PatientID = BT_PatientTable.PatientID INNER JOIN
BT_AttributeDetailsTable ON BT_PatientTable.AS_SexID = BT_AttributeDetailsTable.AttributeDetailsID
WHERE BT_PatientTable.PatientID = @PatientID
END
BLL中涉及的方法有:
#region 根据病人ID查找处方ID
[OperationContract]
public DataSet FRM_TiJianBingRen_Insert_SelectOrdonnanceIDOnPatientID(int intPatientID)//获取界面中传入的病人ID
{
SqlParameter[] mySqlParameters = {
new SqlParameter("@Type",SqlDbType .Char ),
new SqlParameter ("@PatientID",SqlDbType.Char),//根据界面中传入的病人ID 查询数据库病人的信息
};
mySqlParameters[0].Value = "FRM_TiJianBingRen_Insert_SelectOrdonnanceIDOnPatientID";
mySqlParameters[1].Value = intPatientID;
DataTable dt = myDALMethod.QueryDataTable("TiJianZhongXin_TiJianDengJi_Patient_Main", mySqlParameters);
DataSet ds = new DataSet();
ds.Tables.Add(dt);
return ds;
}
#endregion
UIL中涉及到的代码有:
dgv_PatientOrdonnance.AutoGenerateColumns = false;//设置dgv_PatientOrdonnance中的列不可改变性
dgv_PatientOrdonnance.DataSource = myFRM_TiJianDengJi_Patient_MainClient.FRM_TiJianBingRen_Insert_SelectOrdonnanceIDOnPatientID(intPatienID).Tables[0];//把从数据库中查询出来的病人信息绑定到数据表格上
点击收费详细信息 能查看该病人的详细收费项目:
效果如图所示:
2.9.8(图33)
涉及到的表和关系有:
2.9.8(图34
涉及到的储存过程有:
进过处方的体检、化验、治疗等收费信息
-查询病人每个处方以前的各种收费项目
IF @Type = 'FRM_TiJianDengJi_Insert_Load_SelectGeZhongShouFeiXiangMu'
BEGIN
SELECT LTRIM(RTRIM(PW_OrdonnanceDetailTable.TotalDrug)) AS TotalDrug,
LTRIM(RTRIM(BT_DrugTable.DrugSpecification)) AS DrugSpecification,
LTRIM(RTRIM(1))AS IssueMedicineUnit, --用药单位
LTRIM(RTRIM(BT_DrugTable.WhetherMedicare)) AS WhetherMedicare,
LTRIM(RTRIM(BT_DrugPriceTable.MedicarePrice)) AS MedicarePrice,
LTRIM(RTRIM(PW_OrdonnanceDetailTable.DrugID)) AS AllItemID,
LTRIM(RTRIM(PW_OrdonnanceDetailTable.OrdonnanceDetailEncoding)) AS AllICoding,
LTRIM(RTRIM(BT_DrugTable.DrugName)) AS AllIName,
isnull(BT_DrugPriceTable.ScatteredPrice , 0) AS AllIPrice
FROM BT_DrugPriceTable RIGHT OUTER JOIN
BT_DrugTable ON BT_DrugPriceTable.DrugID = BT_DrugTable.DrugID RIGHT OUTER JOIN
PW_OrdonnanceDetailTable ON BT_DrugTable.DrugID = PW_OrdonnanceDetailTable.DrugID
WHERE PW_OrdonnanceDetailTable.OrdonnanceID =@OrdonnanceID
union
--查询辅助检查项目(体检项目)
SELECT
LTRIM(RTRIM(1)) AS TotalDrug,
LTRIM(RTRIM(0)) AS DrugSpecification,
LTRIM(RTRIM(0)) AS IssueMedicineUnit,
LTRIM(RTRIM(0)) AS WhetherMedicare,
LTRIM(RTRIM(0)) AS MedicarePrice,
LTRIM(RTRIM(PW_AuxiliaryItemDetailTable.AllItemID)) AS AllItemID,
LTRIM(RTRIM(BT_ItemTable.ItemCoding)) AS AllICoding,
LTRIM(RTRIM(BT_ItemTable.ItemName)) AS AllIName,
isnull(BT_ItemTable.ProjectPrice,0) AS AllIPrice
FROM PW_AuxiliaryItemDetailTable INNER JOIN
BT_ItemTable ON PW_AuxiliaryItemDetailTable.AllItemID = BT_ItemTable.ItemID
WHERE PW_AuxiliaryItemDetailTable.OrdonnanceID =@OrdonnanceID AND PW_AuxiliaryItemDetailTable.ItemCategoryID =1
union
--化验项目
SELECT
LTRIM(RTRIM(1)) AS TotalDrug,
LTRIM(RTRIM(0)) AS DrugSpecification,
LTRIM(RTRIM(0)) AS IssueMedicineUnit,
LTRIM(RTRIM(0)) AS WhetherMedicare,
LTRIM(RTRIM(0)) AS MedicarePrice,
LTRIM(RTRIM(PW_AuxiliaryItemDetailTable.AllItemID)) AS AllItemID,
LTRIM(RTRIM(BT_AssayItemsTable.AssayItemsNumber)) AS AllICoding,
LTRIM(RTRIM(BT_AssayItemsTable.ChineseName)) AS AllIName,
isnull(BT_AssayItemsTable.AssayItemsPrice,0) AS AllIPrice
FROM PW_AuxiliaryItemDetailTable INNER JOIN
BT_AssayItemsTable ON PW_AuxiliaryItemDetailTable.AllItemID = BT_AssayItemsTable.AssayItemsID
WHERE PW_AuxiliaryItemDetailTable.OrdonnanceID = @OrdonnanceID AND PW_AuxiliaryItemDetailTable.ItemCategoryID =2
--治疗项目
union
SELECT LTRIM(RTRIM(BT_TreatmentItemsTable.TotalInvestment)) AS TotalDrug,
LTRIM(RTRIM(0)) AS DrugSpecification,
LTRIM(RTRIM(0)) AS IssueMedicineUnit,
LTRIM(RTRIM(BT_TreatmentItemsTable.WhetherMedicare)) AS WhetherMedicare,
LTRIM(RTRIM(BT_TreatmentItemsTable.MedicarePricing)) AS MedicarePrice,
LTRIM(RTRIM(PW_AuxiliaryItemDetailTable.AllItemID)) AS AllItemID,
LTRIM(RTRIM(BT_TreatmentItemsTable.ItemNumber)) AS AllICoding,
LTRIM(RTRIM(BT_TreatmentItemsTable.TreatmentItemName)) AS AllIName,
LTRIM(RTRIM(BT_TreatmentItemsTable.GeneralPricing)) AS AllIPrice
FROM PW_AuxiliaryItemDetailTable LEFT OUTER JOIN
BT_TreatmentItemsTable ON PW_AuxiliaryItemDetailTable.AllItemID = BT_TreatmentItemsTable.TreatmentItemID
WHERE PW_AuxiliaryItemDetailTable.OrdonnanceID = @OrdonnanceID AND PW_AuxiliaryItemDetailTable.ItemCategoryID =3
--体检套餐
union
SELECT
LTRIM(RTRIM(1)) AS TotalDrug,
LTRIM(RTRIM(0)) AS DrugSpecification,
LTRIM(RTRIM(0)) AS IssueMedicineUnit,
LTRIM(RTRIM(0)) AS WhetherMedicare,
LTRIM(RTRIM(0)) AS MedicarePrice,
LTRIM(RTRIM(PW_AuxiliaryItemDetailTable.AllItemID)) AS AllItemID,
LTRIM(RTRIM(BT_PhysicalExaminationSetMealTable.SetMealNumber)) AS AllICoding,
LTRIM(RTRIM(BT_PhysicalExaminationSetMealTable.PhysicalExaminationSetMealName)) AS AllIName,
isnull(BT_PhysicalExaminationSetMealTable.CashPrice,0) AS AllIPrice
FROM PW_AuxiliaryItemDetailTable INNER JOIN
BT_PhysicalExaminationSetMealTable ON PW_AuxiliaryItemDetailTable.AllItemID =
BT_PhysicalExaminationSetMealTable.PhysicalExaminationSetMealID
WHERE PW_AuxiliaryItemDetailTable.OrdonnanceID = @OrdonnanceID AND PW_AuxiliaryItemDetailTable.ItemCategoryID =4
--化验组合
union
SELECT
LTRIM(RTRIM(1)) AS TotalDrug,
LTRIM(RTRIM(0)) AS DrugSpecification,
LTRIM(RTRIM(0)) AS IssueMedicineUnit,
LTRIM(RTRIM(0)) AS WhetherMedicare,
LTRIM(RTRIM(0)) AS MedicarePrice,
LTRIM(RTRIM(PW_AuxiliaryItemDetailTable.AllItemID)) AS AllItemID,
LTRIM(RTRIM(BT_AssayInspectCombinationTable.CombinationNumber)) AS AllICoding,
LTRIM(RTRIM(BT_AssayInspectCombinationTable.CombinationName)) AS AllIName,
isnull(BT_AssayInspectCombinationTable.Price,0) AS AllIPrice
FROM PW_AuxiliaryItemDetailTable INNER JOIN
BT_AssayInspectCombinationTable ON PW_AuxiliaryItemDetailTable.AllItemID = BT_AssayInspectCombinationTable.AssayInspectCombinationID
WHERE PW_AuxiliaryItemDetailTable.OrdonnanceID = @OrdonnanceID AND PW_AuxiliaryItemDetailTable.ItemCategoryID =5
END
不经过处方的体检项目:
--不经过处方的体检项目
IF @Type = 'FRM_TiJianDengJi_Insert_Load_SelectGeZhongShouFeiXiangMuNotOrdonnance'
BEGIN
SELECT LTRIM(RTRIM(1)) AS TotalDrug, LTRIM(RTRIM(0)) AS DrugSpecification, LTRIM(RTRIM(0)) AS IssueMedicineUnit, LTRIM(RTRIM(0)) AS WhetherMedicare, LTRIM(RTRIM(0)) AS MedicarePrice,
LTRIM(RTRIM(PW_AuxiliaryItemDetailTable.AllItemID)) AS AllItemID, LTRIM(RTRIM(BT_ItemTable.ItemCoding)) AS AllICoding, LTRIM(RTRIM(BT_ItemTable.ItemName)) AS AllIName,
ISNULL(BT_ItemTable.ProjectPrice, 0) AS AllIPrice, PW_ChargeBillTable.ChargeBillID
FROM PW_AuxiliaryItemDetailTable INNER JOIN
BT_ItemTable ON PW_AuxiliaryItemDetailTable.AllItemID = BT_ItemTable.ItemID INNER JOIN
PW_PhysicalExaminationChargeBillPatientTable ON PW_AuxiliaryItemDetailTable.AuxiliaryItemDetailID = PW_PhysicalExaminationChargeBillPatientTable.AuxiliaryItemDetailID INNER JOIN
PW_ChargeBillTable ON PW_PhysicalExaminationChargeBillPatientTable.ChargeBillID = PW_ChargeBillTable.ChargeBillID
WHERE PW_ChargeBillTable.ChargeBillID = @ChargeBillID AND PW_AuxiliaryItemDetailTable.ItemCategoryID = 1 AND PW_AuxiliaryItemDetailTable.WhetherOrdonnance = 0
END
BLL中涉及到的方法有:
经过处方的:
#region 查询病人每个处方以前的各种收费项目
[OperationContract]
public DataSet FRM_TiJianDengJi_Insert_Load_SelectGeZhongShouFeiXiangMu(int intOrdonnanceID)//获取界面点击收费详细信息中传入的处方ID
{
SqlParameter[] mySqlParameters = {
new SqlParameter("@Type",SqlDbType .Char ),
new SqlParameter ("@OrdonnanceID",SqlDbType.Char),///根据界面点击收费详细信息中传入的处方ID查询数据库中对应的收费项目
};
mySqlParameters[0].Value = "FRM_TiJianDengJi_Insert_Load_SelectGeZhongShouFeiXiangMu";
mySqlParameters[1].Value = intOrdonnanceID;
DataTable dt = myDALMethod.QueryDataTable("TiJianZhongXin_TiJianDengJi_Patient_Main", mySqlParameters);
DataSet ds = new DataSet();
ds.Tables.Add(dt);
return ds;
}
#endregion
不经过处方的:
#region 不经过处方的体检项目
[OperationContract]
public DataSet FRM_TiJianDengJi_Insert_Load_SelectGeZhongShouFeiXiangMuNotOrdonnance(int intChargeBillID)//获取点击界面详细收费项目传入的收费单ID
{
SqlParameter[] mySqlParameters = {
new SqlParameter("@Type",SqlDbType .Char ),
new SqlParameter ("@ChargeBillID",SqlDbType.Char),//根据收费单ID查询数据库中某病人的详细收费项目
};
mySqlParameters[0].Value = "FRM_TiJianDengJi_Insert_Load_SelectGeZhongShouFeiXiangMuNotOrdonnance";
mySqlParameters[1].Value = intChargeBillID;
DataTable dt = myDALMethod.QueryDataTable("TiJianZhongXin_TiJianDengJi_Patient_Main", mySqlParameters);
DataSet ds = new DataSet();
ds.Tables.Add(dt);
return ds;
}
#endregion
UIL中涉及到的方法有:
private void dgv_PatientOrdonnance_CellClick(object sender, DataGridViewCellEventArgs e)
{
//获取处方ID
int intOrdonnanceID =Convert .ToInt32 ( dgv_PatientOrdonnance.CurrentRow .Cells["OrdonnanceID"].Value .ToString());
if (e.ColumnIndex == 9)//点击收费详细信息
{
pnl_ShouFeiXiangMu.Visible = true;//Panle容器显示出来
if (intOrdonnanceID == 0)//如何处方ID为0
{
//获取收费单ID
int intChargeBillID = Convert.ToInt32(dgv_PatientOrdonnance.CurrentRow.Cells["收费单ID"].Value);
//根据收费单ID查询收费项目信息
dgv_ChargeBillItem.DataSource = myFRM_TiJianDengJi_Patient_MainClient.FRM_TiJianDengJi_Insert_Load_SelectGeZhongShouFeiXiangMuNotOrdonnance(intChargeBillID).Tables[0];
}
else
{
//根据处方单查询收费项目信息
dgv_ChargeBillItem.DataSource = myFRM_TiJianDengJi_Patient_MainClient.FRM_TiJianDengJi_Insert_Load_SelectGeZhongShouFeiXiangMu(intOrdonnanceID).Tables[0];
}
}
}
选择历史病人进行点击选择历史病人后,其界面效果图如下:
2.9.8(图35)
点击保存,即让该历史病人进入体检中心。
2.9.8(图36)
解析:因为该病人在医院上有过看病记录,所以不会新增该病人,只是在原有基础上把数据库中的“WhetherFromPhysicalExamination”的值改为“false”,就可以了
数据库中的储存过程:
--修改病人中的是否体检
IF @Type = 'FRM_TiJianBingRen_Main_Load_UpdateWhetherFromPhysicalExamination'
BEGIN
UPDATE BT_PatientTable
SET WhetherFromPhysicalExamination = 0
WHERE PatientID = @PatientID
END
BLL中涉及到的方法有:
#region 修改病人中的是否体检
[OperationContract]
public int FRM_TiJianBingRen_Main_Load_UpdateWhetherFromPhysicalExamination(int intPatientID)//获取界面传入的病人ID
{
SqlParameter[] mySqlParameters = {
new SqlParameter("@Type",SqlDbType .Char ),
new SqlParameter ("@PatientID",SqlDbType.Char),//根据界面中传入的病人ID查询数据库中的病人信息
};
mySqlParameters[0].Value = "FRM_TiJianBingRen_Main_Load_UpdateWhetherFromPhysicalExamination";
mySqlParameters[1].Value = intPatientID;
return myDALMethod.UpdateData ("TiJianZhongXin_TiJianDengJi_Patient_Main", mySqlParameters);
}
#endregion
UIL中涉及到的代码:
if (myFRM_TiJianDengJi_Patient_MainClient.FRM_TiJianBingRen_Main_Load_UpdateWhetherFromPhysicalExamination(intPatientID) > 0)//如果病人的是否体检为0,就///保存成功,否则保存失败
{
MessageBox.Show("保存成功!");
}
else
{
MessageBox.Show("保存失败!");
}
这样就可以对历史病人再次体检进行设置体检项目了。
注:此文章只供学习参考,禁止用于商业用途。否则后果自负