/// <summary> /// 获取科室下专科病历表单(数据检索用) /// </summary> /// <param name="p_strDeptID"></param> /// <param name="p_objFormInfoArr"></param> /// <returns></returns> public long m_lngIMR_NewGetFormInfo(/*string p_strDeptID,*/ out iCareData.clsInpatMedRec_Type[] p_objFormInfoArr) { p_objFormInfoArr = null; DataTable dtResult; clsRecordSearchService m_objService = (clsRecordSearchService)com.digitalwave.iCare.common.clsObjectGenerator.objCreatorObjectByType(typeof(clsRecordSearchService)); long lngRes = 0; try { lngRes = m_objService.m_lngIMR_GetFormInfo(clsLoginContext.s_ObjLoginContext.m_ObjPrincial /*,p_strDeptID*/, out dtResult); } finally { //m_objService.Dispose(); } if (lngRes <= 0 || dtResult.Rows.Count == 0) { return(lngRes); } p_objFormInfoArr = new iCareData.clsInpatMedRec_Type[dtResult.Rows.Count]; for (int i = 0; i < dtResult.Rows.Count; i++) { p_objFormInfoArr[i] = new iCareData.clsInpatMedRec_Type(); p_objFormInfoArr[i].m_strTypeID = dtResult.Rows[i]["TYPEID"].ToString(); p_objFormInfoArr[i].m_strTypeName = dtResult.Rows[i]["TYPENAME"].ToString(); } return(lngRes); }
/// <summary> /// 获取专科病历表单(新专科病历用) /// </summary> /// <param name="p_strDeptID">科室ID</param> /// <param name="p_objFormInfoArr"></param> /// <returns></returns> public long m_lngIMR_GetFormInfo(string p_strDeptID, out clsFormInfo[] p_objFormInfoArr) { p_objFormInfoArr = null; DataTable dtResult; string strSearchInfoSql = null; if (com.digitalwave.Emr.StaticObject.clsEMR_StaticObject.s_StrCurrentHospitalNO == "440104001") { strSearchInfoSql = @"select distinct PBI.FirstName,PBI.Sex,DATEDIFF(year, convert(datetime,PBI.Birth,120), getdate()) as Age, b.InPatientID,b.InPatientDate,b.OpenDate,EBI_Record.FirstName as CreateUserName, b.OpenDate as CreateDate,a.CreateUserID from InpatMedRec a inner join InpatMedRec_Item b on a.TypeID = b.TypeID and a.InPatientID = b.InPatientID and a.InPatientDate = b.InpatientDate and a.OpenDate = b.OpenDate inner join PatientBaseInfo PBI on a.InPatientID = PBI.InPatientID inner join EmployeeBaseInfo EBI_Record on a.CreateUserID = EBI_Record.EmployeeID inner join Dept_Employee DE on a.CreateUserID = DE.EmployeeID and DE.EndDate = $NULLDate$ where a.Status = 0 and a.TypeID = $TypeID$ and DE.DeptID = $DeptID$ and " ; } else { strSearchInfoSql = @"select distinct PBI.FirstName,PBI.Sex,to_number(To_Char(sysdate,'YYYY'))-to_number(To_Char(PBI.Birth,'YYYY')) as Age, b.InPatientID,b.InPatientDate,b.OpenDate,EBI_Record.FirstName as CreateUserName, b.OpenDate as CreateDate,a.CreateUserID from InpatMedRec a inner join InpatMedRec_Item b on a.TypeID = b.TypeID and a.InPatientID = b.InPatientID and a.InPatientDate = b.InpatientDate and a.OpenDate = b.OpenDate inner join PatientBaseInfo PBI on a.InPatientID = PBI.InPatientID inner join EmployeeBaseInfo EBI_Record on a.CreateUserID = EBI_Record.EmployeeID inner join Dept_Employee DE on a.CreateUserID = DE.EmployeeID and DE.EndDate = $NULLDate$ where a.Status = 0 and a.TypeID = $TypeID$ and DE.DeptID = $DeptID$ and " ; } clsRecordSearchService m_objService = (clsRecordSearchService)com.digitalwave.iCare.common.clsObjectGenerator.objCreatorObjectByType(typeof(clsRecordSearchService)); long lngRes = 0; try { lngRes = m_objService.m_lngIMR_GetFormInfo(clsLoginContext.s_ObjLoginContext.m_ObjPrincial, out dtResult); } finally { //m_objService.Dispose(); } if (lngRes <= 0 || dtResult.Rows.Count == 0) { return(lngRes); } p_objFormInfoArr = new clsFormInfo[dtResult.Rows.Count]; DataRow objRow = null; for (int i = 0; i < dtResult.Rows.Count; i++) { clsFormInfo objFormInfo = new clsFormInfo(); objRow = dtResult.Rows[i]; objFormInfo.m_strFormID = objRow["TYPEID"].ToString(); objFormInfo.m_strFormName = objRow["TYPENAME"].ToString(); objFormInfo.m_strSearchInfoType = "AND"; objFormInfo.m_strMainSearchInfo = strSearchInfoSql; p_objFormInfoArr[i] = objFormInfo; } return(lngRes); }