public long m_lngGetApplVO(string orderId, out clsLisApplMainVO applMain) { long lngRes = 0; applMain = null; string sql = @"select a.application_id_chr, a.patientid_chr, a.application_dat, a.sex_chr, a.patient_name_vchr, a.patient_subno_chr, a.age_chr, a.patient_type_id_chr, a.diagnose_vchr, a.bedno_chr, a.icdcode_chr, a.patientcardid_chr, a.application_form_no_chr, a.modify_dat, a.operator_id_chr, a.appl_empid_chr, a.appl_deptid_chr, a.summary_vchr, a.pstatus_int, a.emergency_int, a.special_int, a.form_int, a.patient_inhospitalno_chr, a.sample_type_id_chr, a.check_content_vchr, a.sample_type_vchr, a.oringin_dat, a.charge_info_vchr, a.printed_num, a.orderunitrelation_vchr, a.printed_date, b.sample_id_chr from t_opr_lis_application a, t_opr_lis_sample b where a.application_id_chr = b.application_id_chr(+) and a.orderunitrelation_vchr like ? and b.status_int > 0"; try { DataTable dtbResult = new DataTable(); clsHRPTableService objHRPSvc = new clsHRPTableService(); IDataParameter[] objParamArr = null; objHRPSvc.CreateDatabaseParameter(1, out objParamArr); objParamArr[0].Value = "%" + orderId + "%"; lngRes = objHRPSvc.lngGetDataTableWithParameters(sql, ref dtbResult, objParamArr); objHRPSvc.Dispose(); if (lngRes > 0 && dtbResult != null) { if (dtbResult.Rows.Count == 0) { // throw new Exception(string.Format("未找到医嘱Id{0}对应的申请单!", orderId)); } else if (dtbResult.Rows.Count == 1) { applMain = new clsVOConstructor().m_objConstructAppMainVO(dtbResult.Rows[0]); } else { throw new Exception(string.Format("医嘱Id为{0}对应的不只一个申请单!", orderId)); } } } catch (Exception ex) { new clsLogText().LogError(ex.Message); throw ex; } return(lngRes); }
public long m_lngGetRelatesByUnitID(System.Security.Principal.IPrincipal p_objPrincipal, string p_strApplyUnitID, out clsUnitPropertyRelate_VO[] p_objVOArr) { long lngRes = 0; p_objVOArr = null; string strSQL = @"SELECT r.* FROM t_aid_lis_unit_propert_relate r, t_aid_lis_unit_property p, t_aid_lis_unit_property_value v where r.UNIT_PROPERTY_ID_CHR = p.property_id_chr and r.VALUE_ID_CHR = v.vlaue_id_chr and p.inuse_flag_num = 1 and v.inuse_flag_num = 1 and r.APPLY_UNIT_ID_CHR = ? order by r.unit_property_id_chr, PRIORITY_NUM " ; try { System.Data.IDataParameter[] objDPArr = null; com.digitalwave.iCare.middletier.HRPService.clsHRPTableService objHRPSvc = new clsHRPTableService(); objHRPSvc.CreateDatabaseParameter(1, out objDPArr); objDPArr[0].Value = p_strApplyUnitID; DataTable dtbResult = new DataTable(); lngRes = objHRPSvc.lngGetDataTableWithParameters(strSQL, ref dtbResult, objDPArr); if (lngRes > 0 && dtbResult != null) { clsVOConstructor objVOConstructor = new clsVOConstructor(); int intCount = dtbResult.Rows.Count; p_objVOArr = new clsUnitPropertyRelate_VO[intCount]; for (int i = 0; i < intCount; i++) { p_objVOArr[i] = objVOConstructor.m_objConstructUnitPropertyRelateVO(dtbResult.Rows[i]); } } } catch (Exception objEx) { com.digitalwave.Utility.clsLogText objLogger = new clsLogText(); bool blnRes = objLogger.LogError(objEx);//要在LogError方法中抛出异常。 throw objEx; } return(lngRes); }
public long m_lngGetAllUnitPropertyAndDetail(System.Security.Principal.IPrincipal p_objPrincipal, out clsUnitProperty_VO[] p_objPropertyArr, out clsUnitPropertyValue_VO[] p_objValueArr) { long lngRes = 0; p_objPropertyArr = null; p_objValueArr = null; string strSQL1 = @"SELECT * FROM t_aid_lis_unit_property ORDER BY inuse_flag_num DESC, property_priority_num "; string strSQL2 = @"SELECT * FROM t_aid_lis_unit_property_value"; try { DataTable dtbData = new DataTable(); clsVOConstructor objVOConstructor = new clsVOConstructor(); com.digitalwave.iCare.middletier.HRPService.clsHRPTableService objHRPSvc = new clsHRPTableService(); lngRes = objHRPSvc.lngGetDataTableWithoutParameters(strSQL1, ref dtbData); if (lngRes > 0 && dtbData != null) { p_objPropertyArr = new clsUnitProperty_VO[dtbData.Rows.Count]; for (int i = 0; i < dtbData.Rows.Count; i++) { p_objPropertyArr[i] = objVOConstructor.m_objConstructUnitPropertyVO(dtbData.Rows[i]); } lngRes = 0; dtbData = new DataTable(); lngRes = objHRPSvc.lngGetDataTableWithoutParameters(strSQL2, ref dtbData); if (lngRes > 0 && dtbData != null) { p_objValueArr = new clsUnitPropertyValue_VO[dtbData.Rows.Count]; for (int j = 0; j < dtbData.Rows.Count; j++) { p_objValueArr[j] = objVOConstructor.m_objConstructUnitPropertyValueVO(dtbData.Rows[j]); } } } if (lngRes <= 0) { p_objPropertyArr = null; p_objValueArr = null; } } catch (Exception objEx) { com.digitalwave.Utility.clsLogText objLogger = new clsLogText(); bool blnRes = objLogger.LogError(objEx);//要在LogError方法中抛出异常。 } return(lngRes); }