/// <summary> /// 创建LIS报告接口实例 /// </summary> /// <returns>LIS报告接口实例</returns> public static ILISReportInterFace CreateLISReportObject() { string[] medicalReportType = OP_ReadBaseData.GetConfigValue("009").Split(','); if (medicalReportType.Length > 1) { switch (medicalReportType[1]) { case "华奕": return(new HIS.MZDoc_BLL.InterFace.LISReport_Great()); default: return(null); } } return(null); }
/// <summary> /// 获取病人未收费处方明细 /// </summary> /// <param name="patListId">门诊病人就诊Id</param> /// <returns>门诊收费处方结构体组</returns> public HIS.Interface.Structs.Prescription[] GetPrescriptions(int patListId) { int presNo = 0; string strsql = ""; bool isControlSkinTest = OP_ReadBaseData.GetConfigValue("003").Trim() == "1"; //系统参数:是否控制未皮试和皮试阳性的药品不能收费 //获取处方头列表信息 update 王志 2010-03-11 导致收完费的处方还能收费 //List<PresHead> presHeads = new PresHead(patListId).GetNormalPresHeadList(); List <PresHead> presHeads = new PresHead((long)patListId, 0).GetNoChangePresHeadList(); //定义收费处方结构体 HIS.Interface.Structs.Prescription[] prescriptions = new HIS.Interface.Structs.Prescription[presHeads.Count]; for (int i = 0; i < presHeads.Count; i++) { //获取处方明细信息 if (presHeads[i].PresType.Trim() == "00") { strsql = HIS.BLL.Tables.mz_doc_preslist.PRESHEADID + oleDb.EuqalTo() + presHeads[i].PresHeadId + oleDb.And() + HIS.BLL.Tables.mz_doc_preslist.DELETE_BIT + oleDb.EuqalTo() + 0 + oleDb.OrderBy(HIS.BLL.Tables.mz_doc_preslist.ORDERNO); } else { strsql = HIS.BLL.Tables.mz_doc_preslist.PRESHEADID + oleDb.EuqalTo() + presHeads[i].PresHeadId + oleDb.And() + HIS.BLL.Tables.mz_doc_preslist.DELETE_BIT + oleDb.EuqalTo() + 0 + oleDb.And() + HIS.BLL.Tables.mz_doc_preslist.SELFDRUG_FLAG + oleDb.EuqalTo() + 0 + oleDb.OrderBy(HIS.BLL.Tables.mz_doc_preslist.ORDERNO); } List <HIS.Model.Mz_Doc_PresList> presList = BindEntity <HIS.Model.Mz_Doc_PresList> .CreateInstanceDAL(oleDb).GetListArray(strsql); if (presList.Count > 0) { DataRow[] rows = null; if (isControlSkinTest) { rows = Public.Function.ListToDataTable(presList, new HIS.Model.Mz_Doc_PresList()).Select("SkinTest_Flag = 1 or SkinTest_Flag = 3"); } if (rows != null && rows.Length > 0) { continue; } #region 读取处方头 prescriptions[presNo] = new HIS.Interface.Structs.Prescription(); prescriptions[presNo].Charge_Flag = 0; prescriptions[presNo].ChargeCode = ""; prescriptions[presNo].ChargeID = 0; prescriptions[presNo].Drug_Flag = presHeads[i].PresType == "00" ? 0 : 1; prescriptions[presNo].ExecDeptCode = presHeads[i].Pres_ExeDept.ToString(); prescriptions[presNo].ExecDocCode = ""; prescriptions[presNo].OldPresID = 0; prescriptions[presNo].PresCostCode = presHeads[i].Pres_Doc.ToString(); prescriptions[presNo].PrescriptionID = presHeads[i].PresHeadId; prescriptions[presNo].PrescType = presHeads[i].PresType == "00" ? "-1" : Convert.ToInt32(presHeads[i].PresType).ToString(); prescriptions[presNo].PresDeptCode = presHeads[i].Pres_Dept.ToString(); prescriptions[presNo].PresDocCode = presHeads[i].Pres_Doc.ToString(); prescriptions[presNo].Record_Flag = 0; prescriptions[presNo].TicketCode = ""; prescriptions[presNo].TicketNum = ""; prescriptions[presNo].Total_Fee = 0; //prescriptions[presNo].VisitNo = ""; #endregion //定义收费处方明细结构体 HIS.Interface.Structs.PrescriptionDetail[] details = new HIS.Interface.Structs.PrescriptionDetail[presList.Count]; for (int j = 0; j < presList.Count; j++) { #region 读取处方明细 details[j] = new HIS.Interface.Structs.PrescriptionDetail(); details[j].Amount = presList[j].Item_Amount * presList[j].RelationNum / presList[j].Item_Rate; details[j].BigitemCode = presList[j].StatItem_Code; details[j].Buy_price = presList[j].Buy_Price; details[j].ComplexId = presList[j].Tc_Flag == 1 ? presList[j].Service_Item_Id : 0; details[j].DetailId = presList[j].PresListId; details[j].ItemId = presList[j].Service_Item_Id; details[j].Itemname = presList[j].Item_Name; details[j].ItemType = (presList[j].StatItem_Code == "01" || presList[j].StatItem_Code == "02" || presList[j].StatItem_Code == "03") ? presList[j].StatItem_Code : "00"; details[j].Order_Flag = presList[j].OrderNo; details[j].PassId = 0; details[j].PresAmount = presList[j].Dosage; details[j].PresctionId = presHeads[i].PresHeadId; details[j].RelationNum = presList[j].RelationNum; details[j].Sell_price = presList[j].Sell_Price; details[j].Standard = presList[j].Standard; details[j].Tolal_Fee = presList[j].Item_Amount * presList[j].Item_Price * presList[j].Dosage; details[j].Unit = presList[j].Unit; details[j].Drug_Flag = (presList[j].StatItem_Code == "01" || presList[j].StatItem_Code == "02" || presList[j].StatItem_Code == "03") ? 1 : 0; prescriptions[presNo].Total_Fee += details[j].Tolal_Fee; #endregion } prescriptions[presNo].PresDetails = details; presNo++; } } //定义返回的处方结构体 //取有效处方记录 HIS.Interface.Structs.Prescription[] returnPres = new HIS.Interface.Structs.Prescription[presNo]; { for (int i = 0; i < presNo; i++) { returnPres[i] = prescriptions[i]; } } return(returnPres); }
/// <summary> /// 组织输液卡打印数据 /// </summary> /// <param name="presTable"></param> /// <returns></returns> private DataTable CreateTransfuCardData(DataTable presTable) { int skinTestUsageId = Convert.ToInt32(OP_ReadBaseData.GetConfigValue("002")); int groupId = 0; DataTable printTable = new DataTable(); printTable.Columns.Add("Item_Name", Type.GetType("System.String")); printTable.Columns.Add("Item_Usage_Amount", Type.GetType("System.String")); printTable.Columns.Add("Item_Usage_Name", Type.GetType("System.String")); printTable.Columns.Add("Item_Days", Type.GetType("System.String")); printTable.Columns.Add("Entrust", Type.GetType("System.String")); printTable.Columns.Add("Group_Id", Type.GetType("System.Int32")); printTable.Columns.Add("Group_Flag", Type.GetType("System.String")); for (int index = 0; index < presTable.Rows.Count; index++) { DataRow row = printTable.NewRow(); row["Item_Name"] = presTable.Rows[index]["Item_Name"].ToString().Trim() + "[" + presTable.Rows[index]["Standard"].ToString().Trim() + "]"; row["Item_Days"] = presTable.Rows[index]["Days"].ToString().Trim() + "天"; row["Entrust"] = presTable.Rows[index]["Entrust"].ToString().Trim(); if (Convert.ToInt32(presTable.Rows[index]["SkinTest_Flag"]) > 0 && Convert.ToInt32(presTable.Rows[index]["SkinTest_Flag"]) < 4) { row["Item_Name"] = row["Item_Name"].ToString() + " 皮试( )"; } else if (Convert.ToInt32(presTable.Rows[index]["SkinTest_Flag"]) == 4 && Convert.ToInt32(presTable.Rows[index]["Usage_Id"]) != skinTestUsageId) { row["Item_Name"] = row["Item_Name"].ToString() + "(免试)"; } row["Item_Usage_Amount"] = Convert.ToDecimal(presTable.Rows[index]["Usage_Amount"]).ToString().TrimEnd('0').TrimEnd('.') + "" + presTable.Rows[index]["Usage_Unit"].ToString(); int group_id = Convert.ToInt32(presTable.Rows[index]["Group_Id"]); if (group_id < 2) { if (index > 0) { decimal execNum = Convert.ToInt32(presTable.Rows[index - 1]["Frequency_ExecNum"]) / Convert.ToInt32(presTable.Rows[index - 1]["Frequency_CycleDay"]); if (execNum > 1) { DataRow[] grouprows = printTable.Select("Group_Id=" + groupId.ToString()); for (decimal i = execNum; i > 1; i--) { groupId++; for (int j = 0; j < grouprows.Length; j++) { printTable.Rows.Add(grouprows[j].ItemArray); printTable.Rows[printTable.Rows.Count - 1]["Group_Id"] = groupId; } } } } groupId++; row["Group_Id"] = groupId; row["Item_Usage_Name"] = presTable.Rows[index]["Usage_Name"]; row["Group_Flag"] = ""; if (group_id == 1) { row["Group_Flag"] = "│"; } } else { row["Group_Id"] = groupId; row["Item_Usage_Name"] = ""; row["Group_Flag"] = "│"; } printTable.Rows.Add(row); } if (presTable.Rows.Count > 0) { decimal execNum = Convert.ToInt32(presTable.Rows[presTable.Rows.Count - 1]["Frequency_ExecNum"]) / Convert.ToInt32(presTable.Rows[presTable.Rows.Count - 1]["Frequency_CycleDay"]); if (execNum > 1) { DataRow[] grouprows = printTable.Select("Group_Id=" + groupId.ToString()); for (decimal i = execNum; i > 1; i--) { groupId++; for (int j = 0; j < grouprows.Length; j++) { printTable.Rows.Add(grouprows[j].ItemArray); printTable.Rows[printTable.Rows.Count - 1]["Group_Id"] = groupId; } } } } return(printTable); }