public long m_lngGetExptypeAndVendor(bool p_blnForDrugStore, out DataTable dtExp, out DataTable dtVendor, out DataTable dtMedType) { long lngRes = -1; dtExp = null; dtVendor = null; dtMedType = null; string strSQL = ""; try { clsHRPTableService objHRPSvc = new clsHRPTableService(); lngRes = this.m_lngGetMedStroge(p_blnForDrugStore, out dtExp); strSQL = @"select t.vendorid_chr id, t.vendorname_vchr name, t.usercode_chr code,t.pycode_chr,t.wbcode_chr from t_bse_vendor t where vendortype_int = 2 or vendortype_int = 3 order by t.usercode_chr "; lngRes = objHRPSvc.DoGetDataTable(strSQL, ref dtVendor); lngRes = this.m_lngGetMedType(p_blnForDrugStore, out dtMedType); objHRPSvc.Dispose(); } catch (Exception objEx) { com.digitalwave.Utility.clsLogText objLogger = new com.digitalwave.Utility.clsLogText(); bool blnRes = objLogger.LogError(objEx); } return(lngRes); }
public long m_lngGetMedStoreInfo(System.Security.Principal.IPrincipal p_objPrincipal, out DataTable m_dtMedStore) { long lngRes = 0; m_dtMedStore = null; string strSQL = @"select a.medstoreid_chr, a.medstorename_vchr, a.medstoretype_int, a.medicnetype_int, a.urgence_int, a.deptid_chr, b.deptname_vchr, a.shortname_chr from t_bse_medstore a, t_bse_deptdesc b where a.deptid_chr = b.deptid_chr(+) order by a.medstoreid_chr"; try { clsHRPTableService objHRPServ = new clsHRPTableService(); lngRes = objHRPServ.DoGetDataTable(strSQL, ref m_dtMedStore); objHRPServ.Dispose(); objHRPServ = null; } catch (Exception objEx) { com.digitalwave.Utility.clsLogText objLogger = new com.digitalwave.Utility.clsLogText(); bool blnRes = objLogger.LogError(objEx); } return(lngRes); }
public long m_lngGetDeptInfo(System.Security.Principal.IPrincipal p_objPrincipal, out DataTable m_dtDeptDesc) { long lngRes = 0; m_dtDeptDesc = null; string strSQL = @"select deptid_chr, deptname_vchr, pycode_chr, code_vchr,attributeid from t_bse_deptdesc where status_int = 1 order by deptname_vchr"; try { clsHRPTableService objHRPServ = new clsHRPTableService(); lngRes = objHRPServ.DoGetDataTable(strSQL, ref m_dtDeptDesc); objHRPServ.Dispose(); objHRPServ = null; } catch (Exception objEx) { com.digitalwave.Utility.clsLogText objLogger = new com.digitalwave.Utility.clsLogText(); bool blnRes = objLogger.LogError(objEx); } return(lngRes); }
/// <summary> /// 获取一个序列号 /// </summary> /// <param name="p_objPrincipal"></param> /// <param name="p_strSeqName"></param> /// <param name="p_lngSeqId"></param> /// <returns></returns> public static long m_lngGetSequence(string p_strSeqName, out long p_lngSeqId) { p_lngSeqId = 0; long lngRes = 0; if (string.IsNullOrEmpty(p_strSeqName)) { return(lngRes); } try { if (clsHRPTableService.bytDatabase_Selector == (byte)clsHRPTableService.enumDatabase_Selector.bytOracle) { string strSQL = "select " + p_strSeqName + ".nextval from dual"; clsHRPTableService objHRPServ = new clsHRPTableService(); DataTable dtResult = null; lngRes = objHRPServ.DoGetDataTable(strSQL, ref dtResult); if (dtResult != null && dtResult.Rows.Count == 1) { p_lngSeqId = Convert.ToInt64(dtResult.Rows[0][0]); } else { p_lngSeqId = 1; } } } catch (Exception objEx) { com.digitalwave.Utility.clsLogText objLogger = new com.digitalwave.Utility.clsLogText(); bool blnRes = objLogger.LogDetailError(objEx, true); } return(lngRes); }
public long m_lngGetMedReport(string p_dtpStartDate, string p_dtpEndDate, out DataTable p_outDatatable) { long lngRes = 0; p_outDatatable = null; try { string strSQL = @"SELECT t2.typename_vchr AS itemname,SUM (b.tolfee_mny) AS TOLFEE_MNY FROM t_opr_outpatientrecipeinvde b, t_opr_outpatientrecipeinv a, t_bse_chargeitemextype t2 WHERE b.invoiceno_vchr = a.invoiceno_vchr and b.itemcatid_chr = t2.typeid_chr and t2.flag_int='2'"; strSQL += @" AND a.recorddate_dat BETWEEN TO_DATE ('" + p_dtpStartDate + "', 'yyyy-mm-dd hh24:mi:ss' )"; strSQL += @" AND TO_DATE ('" + p_dtpEndDate + "', 'yyyy-mm-dd hh24:mi:ss' )"; strSQL += @" AND a.balanceflag_int = 1 and t2.flag_int='2' GROUP BY t2.typename_vchr"; //order by TOLFEE_MNY"; com.digitalwave.iCare.middletier.HRPService.clsHRPTableService objHRPSvc = new clsHRPTableService(); lngRes = objHRPSvc.DoGetDataTable(strSQL, ref p_outDatatable); } catch (Exception objEx) { string strTmp = objEx.Message; com.digitalwave.Utility.clsLogText objLogger = new clsLogText(); bool blnRes = objLogger.LogError(objEx); } return(lngRes); }
public long m_mthOrderExecuteData(string strInHospitalID, DateTime date1, DateTime date2, out DataTable dt) { long lngRes = 0; dt = new DataTable(); string strSQL = @"SELECT Max(to_char(A.createdate_dat,'yyyy-mm-dd')) CreatDate FROM t_opr_bih_orderexecute A,T_OPR_BIH_ORDER B where a.orderid_chr =b.orderid_chr(+) and a.STATUS_INT =1 AND a.createdate_dat > TO_DATE ('" + date1.ToString("yyyy-MM-dd 00:00:00") + @"', 'YYYY-MM-DD HH24:MI:SS') AND a.createdate_dat < TO_DATE ('" + date2.ToString("yyyy-MM-dd 23:59:59") + @"', 'YYYY-MM-DD HH24:MI:SS') and b.registerid_chr ='" + strInHospitalID + @"' GROUP BY TRUNC (A.createdate_dat)"; try { com.digitalwave.iCare.middletier.HRPService.clsHRPTableService objService = new clsHRPTableService(); lngRes = objService.DoGetDataTable(strSQL, ref dt); } catch (Exception objEx) { string strTmp = objEx.Message; com.digitalwave.Utility.clsLogText objLogger = new clsLogText(); bool blnRes = objLogger.LogError(objEx); } return(lngRes); }
public long m_lngGetMedStroge(bool p_blnIsStore, out DataTable dtExp) { long lngRes = -1; string strSQL = ""; if (p_blnIsStore) { strSQL = @"select t.deptid_chr medicineroomid,t.medstorename_vchr medicineroomname from t_bse_medstore t order by t.medstoreid_chr"; } else { strSQL = @"select distinct t.medicineroomid medicineroomid, t.medicineroomname medicineroomname from t_ms_medicinestoreroomset t order by t.medicineroomid "; } dtExp = new DataTable(); try { clsHRPTableService objHRPSvc = new clsHRPTableService(); lngRes = objHRPSvc.DoGetDataTable(strSQL, ref dtExp); objHRPSvc.Dispose(); } catch (Exception objEx) { com.digitalwave.Utility.clsLogText objLogger = new com.digitalwave.Utility.clsLogText(); bool blnRes = objLogger.LogError(objEx); } return(lngRes); }
public long lngSelectByCondition(IPrincipal p_objPrincipal, string p_strWhereCondition, out DataTable p_objResultTable) { long lngRes = -1; p_objResultTable = null; clsHRPTableService HRPSvc = new clsHRPTableService(); clsPrivilegeHandleService objPrivilege = new clsPrivilegeHandleService(); lngRes = objPrivilege.m_lngCheckCallPrivilege(p_objPrincipal, "com.digitalwave.iCare.middletier.HIS.clsBillSvc", "lngSelectByCondition"); if (lngRes < 0) { return(-1); } string strSQL = @"SELECT billid_int, billtype_chr, billno_vchr, status_int, inempid_chr, indatetime_dat, inoprid_chr, inoprdatetime_dat, outempid_chr, outdatetime_dat, outoprid_chr, outoprdatetime_dat, returnempid_chr, returndatetime_dat, returnoprid_chr, returnoprdatetime_dat, useempid_chr, usedatetime_dat, cancelempid_chr, canceldatetime_dat, refempid_chr, refdatetime_dat, note_vchr, totalsum_mny, acctsum_mny, sbsum_mny FROM t_bse_bill " ; if (p_strWhereCondition != "") { strSQL += " Where " + p_strWhereCondition; } try { lngRes = HRPSvc.DoGetDataTable(strSQL, ref p_objResultTable); HRPSvc.Dispose(); } catch (Exception objEx) { string strTmp = objEx.Message; clsLogText objLogger = new clsLogText(); bool blnRes = objLogger.LogError(objEx); } return(lngRes); }
public long m_lngGetEmployeeSignDocAndNur(System.Security.Principal.IPrincipal p_objPrincipal, out DataTable p_objdt) { long lngRes = 0; p_objdt = null; clsHRPTableService objHRPServer = new clsHRPTableService(); try { string strSql = ""; strSql = @"select empno_chr, lastname_vchr, technicalrank_chr, pycode_chr, empid_chr, psw_chr, digitalsign_dta, technicallevel_chr from (select t.empno_chr, t.lastname_vchr, t.technicalrank_chr, t.pycode_chr, t.empid_chr, t.psw_chr, t.digitalsign_dta, t.technicallevel_chr from t_bse_employee t where t.status_int = 1 and t.technicallevel_chr like '4%' union select t.empno_chr, t.lastname_vchr, t.technicalrank_chr, t.pycode_chr, t.empid_chr, t.psw_chr, t.digitalsign_dta, t.technicallevel_chr from t_bse_employee t where t.status_int = 1 and t.technicallevel_chr like '5%') order by technicallevel_chr desc"; lngRes = objHRPServer.DoGetDataTable(strSql, ref p_objdt); } catch (Exception exp) { com.digitalwave.Utility.clsLogText objLogger = new com.digitalwave.Utility.clsLogText(); bool blnRes = objLogger.LogError(exp); } finally { //objHRPServer.Dispose(); } return(lngRes); }
public long m_lngGetMedTypeInfo(System.Security.Principal.IPrincipal p_objPrincipal, out clsHISMedType_VO[] p_objResultArr, string strMainID) { long lngRes = 0; p_objResultArr = new clsHISMedType_VO[0]; clsPrivilegeHandleService objPrivilege = new clsPrivilegeHandleService(); lngRes = objPrivilege.m_lngCheckCallPrivilege(p_objPrincipal, "com.digitalwave.iCare.middletier.HIS.clsHISMedTypeManageSvc", "m_lngGetMedTypeInfo"); if (lngRes < 0) { return(-1); } string strSQL = @"Select * From T_BSE_PHARMATYPE order by PHARMAID_CHR"; try { DataTable dtbResult = new DataTable(); com.digitalwave.iCare.middletier.HRPService.clsHRPTableService objHRPSvc = new clsHRPTableService(); lngRes = objHRPSvc.DoGetDataTable(strSQL, ref dtbResult); if (lngRes > 0 && dtbResult.Rows.Count > 0) { p_objResultArr = new com.digitalwave.iCare.ValueObject.clsHISMedType_VO[dtbResult.Rows.Count]; for (int i1 = 0; i1 < p_objResultArr.Length; i1++) { p_objResultArr[i1] = new com.digitalwave.iCare.ValueObject.clsHISMedType_VO(); p_objResultArr[i1].m_strPHARMAID_CHR = dtbResult.Rows[i1]["PHARMAID_CHR"].ToString().Trim(); p_objResultArr[i1].m_strPHARMANAME_VCHR = dtbResult.Rows[i1]["PHARMANAME_VCHR"].ToString().Trim(); p_objResultArr[i1].m_strASSISTCODE_VCHR = dtbResult.Rows[i1]["ASSISTCODE_VCHR"].ToString().Trim(); p_objResultArr[i1].m_strPYCODE_VCHR = dtbResult.Rows[i1]["PYCODE_VCHR"].ToString().Trim(); p_objResultArr[i1].m_strWBCODE_VCHR = dtbResult.Rows[i1]["WBCODE_VCHR"].ToString().Trim(); if (dtbResult.Rows[i1]["PARENTID_CHR"] != System.DBNull.Value) { p_objResultArr[i1].m_strPARENTID_CHR = dtbResult.Rows[i1]["PARENTID_CHR"].ToString().Trim(); } else { p_objResultArr[i1].m_strPARENTID_CHR = null; } } } objHRPSvc.Dispose(); } catch (Exception objEx) { string strTmp = objEx.Message; com.digitalwave.Utility.clsLogText objLogger = new clsLogText(); bool blnRes = objLogger.LogError(objEx); } return(lngRes); }
public long m_lngCheckOrderStatus(ArrayList arrOrderID, ArrayList ArrFlag, ref bool Exist) { long lngRes = -1; Exist = true; DataTable dt = new DataTable(); string sql = string.Empty; try { clsHRPTableService objHRPSvc = new clsHRPTableService(); if (arrOrderID.Count == 1) { sql = @"select a.status_int from t_opr_bih_order a where a.orderid_chr = ?"; IDataParameter[] param = null; objHRPSvc.CreateDatabaseParameter(1, out param); param[0].Value = arrOrderID[0].ToString(); lngRes = objHRPSvc.lngGetDataTableWithParameters(sql, ref dt, param); } else if (arrOrderID.Count > 0) { sql = @"select a.status_int from t_opr_bih_order a where a.orderid_chr in ([arrOrderID])"; string strOrderid = ""; foreach (Object objTmp in arrOrderID) { strOrderid += "'" + arrOrderID + "',"; } strOrderid = strOrderid.TrimEnd(','); sql = sql.Replace("[arrOrderID]", strOrderid); lngRes = objHRPSvc.DoGetDataTable(sql, ref dt); } objHRPSvc.Dispose(); for (int i1 = 0; i1 < dt.Rows.Count; i1++) { if (!ArrFlag.Contains(int.Parse(dt.Rows[i1][0].ToString()))) { Exist = false; return(lngRes); } } } catch (Exception objEx) { string strTmp = objEx.Message; com.digitalwave.Utility.clsLogText objLogger = new clsLogText(); bool blnRes = objLogger.LogError(objEx); } return(lngRes); }
public long m_lngWindowsWork(System.Security.Principal.IPrincipal p_objPrincipal, string strWindowsID, out bool isWork) { isWork = false; long lngRes = 0; clsPrivilegeHandleService objPrivilege = new clsPrivilegeHandleService(); lngRes = objPrivilege.m_lngCheckCallPrivilege(p_objPrincipal, "com.digitalwave.iCare.middletier.LIS.clsLisDeviceSvc", "m_lngWindowsWork"); if (lngRes < 0) { return(-1); } com.digitalwave.iCare.middletier.HRPService.clsHRPTableService objHRPSvc = new clsHRPTableService(); if (lngRes < 0) { return(lngRes); } string strSQL = @"SELECT a.WORKSTATUS_INT FROM t_bse_medstorewin a WHERE a.WINDOWID_CHR = '" + strWindowsID + "'"; DataTable dt = new DataTable(); try { lngRes = objHRPSvc.DoGetDataTable(strSQL, ref dt); } catch (Exception objEx) { com.digitalwave.Utility.clsLogText objLogger = new clsLogText(); bool blnRes = objLogger.LogError(objEx); } if (dt.Rows.Count > 0) { try { if (int.Parse(dt.Rows[0]["WORKSTATUS_INT"].ToString()) == 1) { isWork = true; } else { isWork = false; } } catch { isWork = false; } } return(lngRes); }
/// <summary> /// 返回检查申请单类型 /// </summary> /// <returns></returns> public DataTable GetApplyList() { string sql = "select * from AR_APPLY_TYPELIST where Deleted <> 1 order by ORDERSEQ_INT"; // return service.SqlSelect(sql); DataTable dtValue = new DataTable(); m_objHRPServ.DoGetDataTable(sql, ref dtValue); return(dtValue); }
public long m_lngGetStatiticsData(System.Security.Principal.IPrincipal p_objPrincipal, out DataTable p_dtbResult, string p_strPeriodId) { p_dtbResult = new DataTable(); long lngRes = 0; //权限控制 com.digitalwave.security.clsPrivilegeHandleService objHandle = new clsPrivilegeHandleService(); lngRes = objHandle.m_lngCheckCallPrivilege(p_objPrincipal, "com.digitalwave.iCare.middletier.HIS.clsHisMedInOrderStatisticSvc", "m_lngGetStatiticsData"); if (lngRes < 0) { return(-1); } com.digitalwave.iCare.middletier.HRPService.clsHRPTableService objHRPSvc = new clsHRPTableService(); string strSQL; if (p_strPeriodId != "") { strSQL = @"SELECT Ta.docid_vchr, Ta.tolmny_mny, Tb.vendorname_vchr FROM t_opr_storageord Ta, t_bse_vendor Tb, t_bse_period Tc WHERE Ta.vendorid_chr = Tb.vendorid_chr(+) AND Ta.periodid_chr = Tc.periodid_chr AND Tc.PERIODID_CHR = " ; strSQL += "'" + p_strPeriodId + "'"; strSQL += " AND Ta.pstatus_int = 2 AND Ta.sign_int = 1"; } else //选择所有时期 { strSQL = @"SELECT Ta.docid_vchr, Ta.tolmny_mny, Tb.vendorname_vchr FROM t_opr_storageord Ta, t_bse_vendor Tb, t_bse_period Tc WHERE Ta.vendorid_chr = Tb.vendorid_chr(+) AND Ta.periodid_chr = Tc.periodid_chr " ; strSQL += " AND Ta.pstatus_int = 2 AND Ta.sign_int = 1"; } try { lngRes = objHRPSvc.DoGetDataTable(strSQL, ref p_dtbResult); } catch (Exception objEx) { string strTmp = objEx.Message; com.digitalwave.Utility.clsLogText objLogger = new clsLogText(); bool blnRes = objLogger.LogError(objEx); } objHRPSvc.Dispose(); return(lngRes); }
public long m_mthFindReportData(string strInHospitalID, string p_date, out DataTable dt) { long lngRes = 0; DateTime date = DateTime.Now; try { date = DateTime.Parse(p_date); } catch { } dt = new DataTable(); string strSQL = @"SELECT d.code_chr AS bed, e.lastname_vchr AS NAME, DECODE (b.executetype_int, 1, '长嘱', 2, '临嘱', '') AS exetype, b.name_vchr AS itemname, b.dosage_dec AS usecount, b.dosetypename_chr AS useway, a.executedate_vchr AS excutetime FROM t_opr_bih_orderexecute a, t_opr_bih_order b, t_opr_bih_register c, t_bse_bed d, t_bse_patient e WHERE a.orderid_chr = b.orderid_chr(+) AND b.registerid_chr = c.registerid_chr(+) AND c.bedid_chr = d.bedid_chr(+) AND b.patientid_chr = e.patientid_chr(+) AND a.status_int = 1 AND a.createdate_dat > TO_DATE ('" + date.ToString("yyyy-MM-dd 00:00:00") + @"', 'YYYY-MM-DD HH24:MI:SS') AND a.createdate_dat < TO_DATE ('" + date.ToString("yyyy-MM-dd 23:59:59") + @"', 'YYYY-MM-DD HH24:MI:SS') and b.registerid_chr ='" + strInHospitalID + @"'"; try { com.digitalwave.iCare.middletier.HRPService.clsHRPTableService objService = new clsHRPTableService(); lngRes = objService.DoGetDataTable(strSQL, ref dt); } catch (Exception objEx) { string strTmp = objEx.Message; com.digitalwave.Utility.clsLogText objLogger = new clsLogText(); bool blnRes = objLogger.LogError(objEx); } return(lngRes); }
public long m_mthGetChargeManInfo(System.Security.Principal.IPrincipal p_objPrincipal, out clsEChargeInfo_VO[] p_objResultArr) { long lngRes = 0; p_objResultArr = new clsEChargeInfo_VO[0]; clsPrivilegeHandleService objPrivilege = new clsPrivilegeHandleService(); lngRes = objPrivilege.m_lngCheckCallPrivilege(p_objPrincipal, "com.digitalwave.iCare.middletier.HIS.clsOutpatientChargeIdetityPrintSvc", "m_mthGetChargeManInfo"); if (lngRes < 0) { return(-1); } string strSQL = @"SELECT distinct te.lastname_vchr, te.empid_chr FROM t_bse_employee te, t_opr_outpatientrecipeinv tp WHERE te.empid_chr = tp.opremp_chr AND tp.balanceflag_int = 1" ; try { DataTable dtbResult = new DataTable(); com.digitalwave.iCare.middletier.HRPService.clsHRPTableService objHRPSvc = new clsHRPTableService(); lngRes = objHRPSvc.DoGetDataTable(strSQL, ref dtbResult); if (lngRes > 0 && dtbResult.Rows.Count > 0) { p_objResultArr = new com.digitalwave.iCare.ValueObject.clsEChargeInfo_VO[dtbResult.Rows.Count]; for (int i1 = 0; i1 < p_objResultArr.Length; i1++) { p_objResultArr[i1] = new com.digitalwave.iCare.ValueObject.clsEChargeInfo_VO(); p_objResultArr[i1].m_strEmpid_chr = dtbResult.Rows[i1]["empid_chr"].ToString().Trim(); p_objResultArr[i1].m_strLastname_vchr = dtbResult.Rows[i1]["lastname_vchr"].ToString().Trim(); } } objHRPSvc.Dispose(); } catch (Exception objEx) { string strTmp = objEx.Message; com.digitalwave.Utility.clsLogText objLogger = new clsLogText(); bool blnRes = objLogger.LogError(objEx); } return(lngRes); }
public long m_lngCheckMedTypeIsHasSubById(System.Security.Principal.IPrincipal p_objPrincipal, out bool blnHasSubNode, string m_strPHARMAID_CHR) { long lngRes = 0; blnHasSubNode = false; clsPrivilegeHandleService objPrivilege = new clsPrivilegeHandleService(); lngRes = objPrivilege.m_lngCheckCallPrivilege(p_objPrincipal, "com.digitalwave.iCare.middletier.HIS.clsHISMedTypeManageSvc", "m_lngCheckMedTypeIsHasSubById"); if (lngRes < 0) { return(-1); } string strSQL = @"Select count(*) From T_BSE_PHARMATYPE where PARENTID_CHR='" + m_strPHARMAID_CHR + "'"; try { DataTable dtbResult = new DataTable(); com.digitalwave.iCare.middletier.HRPService.clsHRPTableService objHRPSvc = new clsHRPTableService(); lngRes = objHRPSvc.DoGetDataTable(strSQL, ref dtbResult); if (lngRes > 0 && dtbResult.Rows.Count > 0) { if (Convert.ToInt32(dtbResult.Rows[0][0].ToString()) != 0) { blnHasSubNode = true; //存在子结点 } else { blnHasSubNode = false; } } } catch (Exception objEx) { string strTmp = objEx.Message; com.digitalwave.Utility.clsLogText objLogger = new clsLogText(); bool blnRes = objLogger.LogError(objEx); } return(lngRes); }
public long m_lngGetPeriodList(System.Security.Principal.IPrincipal p_objPrincipal, out clsPeriod_VO[] p_objResultArr) { long lngRes = 0; p_objResultArr = new clsPeriod_VO[0]; clsPrivilegeHandleService objPrivilege = new clsPrivilegeHandleService(); lngRes = objPrivilege.m_lngCheckCallPrivilege(p_objPrincipal, "com.digitalwave.iCare.middletier.HIS.clsHisMedInOrderStatisticSvc", "m_lngGetPeriodList"); if (lngRes < 0) { return(-1); } string strSQL = @"Select PERIODID_CHR,STARTDATE_DAT,ENDDATE_DAT From t_bse_period order by PERIODID_CHR"; try { DataTable dtbResult = new DataTable(); com.digitalwave.iCare.middletier.HRPService.clsHRPTableService objHRPSvc = new clsHRPTableService(); lngRes = objHRPSvc.DoGetDataTable(strSQL, ref dtbResult); if (lngRes > 0 && dtbResult.Rows.Count > 0) { p_objResultArr = new com.digitalwave.iCare.ValueObject.clsPeriod_VO[dtbResult.Rows.Count]; for (int i1 = 0; i1 < p_objResultArr.Length; i1++) { p_objResultArr[i1] = new com.digitalwave.iCare.ValueObject.clsPeriod_VO(); p_objResultArr[i1].m_strPeriodID = dtbResult.Rows[i1]["PERIODID_CHR"].ToString().Trim(); p_objResultArr[i1].m_strStartDate = dtbResult.Rows[i1]["STARTDATE_DAT"].ToString().Trim(); p_objResultArr[i1].m_strEndDate = dtbResult.Rows[i1]["ENDDATE_DAT"].ToString().Trim(); } } objHRPSvc.Dispose(); } catch (Exception objEx) { string strTmp = objEx.Message; com.digitalwave.Utility.clsLogText objLogger = new clsLogText(); bool blnRes = objLogger.LogError(objEx); } return(lngRes); }
public long m_mthGetPatientCatInfo(System.Security.Principal.IPrincipal p_objPrincipal, out clsPType_VO[] p_objResultArr) { long lngRes = 0; p_objResultArr = new clsPType_VO[0]; clsPrivilegeHandleService objPrivilege = new clsPrivilegeHandleService(); lngRes = objPrivilege.m_lngCheckCallPrivilege(p_objPrincipal, "com.digitalwave.iCare.middletier.HIS.clsOutpatientChargeIdetityPrintSvc", "m_mthGetPatientCatInfo"); if (lngRes < 0) { return(-1); } string strSQL = @"select distinct ta.PAYTYPEID_CHR , ta.PAYTYPENAME_VCHR from T_BSE_PATIENTPAYTYPE TA,t_opr_outpatientrecipeinv TB Where TA.PAYTYPEID_CHR=TB.PAYTYPEID_CHR And BALANCEFLAG_INT=1 order by ta.PAYTYPEID_CHR"; try { DataTable dtbResult = new DataTable(); com.digitalwave.iCare.middletier.HRPService.clsHRPTableService objHRPSvc = new clsHRPTableService(); lngRes = objHRPSvc.DoGetDataTable(strSQL, ref dtbResult); if (lngRes > 0 && dtbResult.Rows.Count > 0) { p_objResultArr = new com.digitalwave.iCare.ValueObject.clsPType_VO[dtbResult.Rows.Count]; for (int i1 = 0; i1 < p_objResultArr.Length; i1++) { p_objResultArr[i1] = new com.digitalwave.iCare.ValueObject.clsPType_VO(); p_objResultArr[i1].m_strPAYTYPEID_CHR = dtbResult.Rows[i1]["PAYTYPEID_CHR"].ToString().Trim(); p_objResultArr[i1].m_strPAYTYPENAME_VCHR = dtbResult.Rows[i1]["PAYTYPENAME_VCHR"].ToString().Trim(); } } objHRPSvc.Dispose(); } catch (Exception objEx) { string strTmp = objEx.Message; com.digitalwave.Utility.clsLogText objLogger = new clsLogText(); bool blnRes = objLogger.LogError(objEx); } return(lngRes); }
public long m_mthGetInHospitalIDByCardID(string strCardID, string strEx, out DataTable dt, int Flag) { long lngRes = 0; dt = new DataTable(); string strSQL = ""; if (Flag == 1) //用卡号查询 { strSQL = @" SELECT b.registerid_chr, c.lastname_vchr, c.sex_chr, TO_CHAR (SYSDATE, 'yyyy') - TO_CHAR (c.birth_dat, 'yyyy') age FROM t_bse_patientcard a, t_opr_bih_register b, t_bse_patient c WHERE a.patientid_chr = b.patientid_chr AND a.status_int = 1 AND a.patientid_chr = c.patientid_chr(+) AND a.patientcardid_chr = '" + strCardID + "'"; } else //用住院号查询 { strSQL = @"SELECT b.registerid_chr, c.lastname_vchr, c.sex_chr, TO_CHAR (SYSDATE, 'yyyy') - TO_CHAR (c.birth_dat, 'yyyy') age FROM t_opr_bih_register b, t_bse_patient c WHERE b.patientid_chr = c.patientid_chr(+) and b.STATUS_INT =1 AND b.registerid_chr = '" + strCardID + "'"; } try { com.digitalwave.iCare.middletier.HRPService.clsHRPTableService objService = new clsHRPTableService(); lngRes = objService.DoGetDataTable(strSQL, ref dt); } catch (Exception objEx) { string strTmp = objEx.Message; com.digitalwave.Utility.clsLogText objLogger = new clsLogText(); bool blnRes = objLogger.LogError(objEx); } return(lngRes); }
public long lngSelectRecordCount(IPrincipal p_objPrincipal, string p_strWhereCondition, out int p_intCount) { long lngRes = -1; p_intCount = -1; clsHRPTableService HRPSvc = new clsHRPTableService(); clsPrivilegeHandleService objPrivilege = new clsPrivilegeHandleService(); lngRes = objPrivilege.m_lngCheckCallPrivilege(p_objPrincipal, "com.digitalwave.iCare.middletier.HIS.clsBillSvc", "lngSelectRecordCount"); if (lngRes < 0) { return(-1); } string strSQL = @"SELECT COUNT(*) AS ResultCount FROM t_bse_bill "; if (p_strWhereCondition != "") { strSQL += " Where " + p_strWhereCondition; } try { DataTable objResult = null; lngRes = HRPSvc.DoGetDataTable(strSQL, ref objResult); if (lngRes > 0) { p_intCount = Convert.ToInt32(objResult.Rows[0][0].ToString()); } HRPSvc.Dispose(); } catch (Exception objEx) { string strTmp = objEx.Message; clsLogText objLogger = new clsLogText(); bool blnRes = objLogger.LogError(objEx); } return(lngRes); }
public long m_lngGetStatiticsData(System.Security.Principal.IPrincipal p_objPrincipal, string p_dtm1, string p_dtm2, out DataTable p_dtb) { p_dtb = new DataTable(); long lngRes = 0; //权限控制 com.digitalwave.security.clsPrivilegeHandleService objHandle = new clsPrivilegeHandleService(); lngRes = objHandle.m_lngCheckCallPrivilege(p_objPrincipal, "com.digitalwave.iCare.middletier.HIS.clsOutPatientSvc", "m_lngGetStatiticsData"); if (lngRes < 0) { return(-1); } com.digitalwave.iCare.middletier.HRPService.clsHRPTableService objHRPSvc = new clsHRPTableService(); string strSQL = @"SELECT t1.*, t2.typename_vchr FROM (SELECT b.itemcatid_chr, SUM (b.tolfee_mny) AS totalmoney FROM t_opr_outpatientrecipesumde b, t_opr_outpatientrecipeinv a WHERE b.seqid_chr = a.seqid_chr AND a.recorddate_dat BETWEEN to_date('" + p_dtm1 + " 00:00:00" + "','yyyy-mm-dd hh24:mi:ss')"; strSQL += " AND to_date('" + p_dtm2 + " 00:00:00" + "','yyyy-mm-dd hh24:mi:ss')"; strSQL += " AND a.balanceflag_int = 1"; strSQL += " GROUP BY b.itemcatid_chr) t1,"; strSQL += " t_bse_chargeitemextype t2"; strSQL += " WHERE t1.itemcatid_chr = t2.typeid_chr"; try { lngRes = objHRPSvc.DoGetDataTable(strSQL, ref p_dtb); } catch (Exception objEx) { string strTmp = objEx.Message; com.digitalwave.Utility.clsLogText objLogger = new clsLogText(); bool blnRes = objLogger.LogError(objEx); } objHRPSvc.Dispose(); return(lngRes); }
public long m_lngGetSequence(System.Security.Principal.IPrincipal p_objPrincipal, string p_strSEQName, out long p_lngSEQ) { p_lngSEQ = 0; if (string.IsNullOrEmpty(p_strSEQName)) { return(-1); } long lngRes = 0; try { if (clsHRPTableService.bytDatabase_Selector == (byte)clsHRPTableService.enumDatabase_Selector.bytOracle) { string strSQL = "select " + p_strSEQName + ".nextval from dual"; clsHRPTableService objHRPServ = new clsHRPTableService(); DataTable dtValue = null; lngRes = objHRPServ.DoGetDataTable(strSQL, ref dtValue); objHRPServ.Dispose(); objHRPServ = null; if (dtValue != null && dtValue.Rows.Count == 1) { p_lngSEQ = Convert.ToInt64(dtValue.Rows[0][0]); } else { p_lngSEQ = 1; } } } catch (Exception objEx) { com.digitalwave.Utility.clsLogText objLogger = new com.digitalwave.Utility.clsLogText(); bool blnRes = objLogger.LogError(objEx); } return(lngRes); }
public long m_lngGetMedType(bool p_blnIsStore, out DataTable dtMedType) { long lngRes = -1; string strSQL = ""; if (p_blnIsStore) { strSQL = @"select a.medicinetypeid_chr, b.medicinetypename_vchr, c.deptid_chr medicineroomid from t_ds_medstoreset a left join t_aid_medicinetype b on b.medicinetypeid_chr = a.medicinetypeid_chr inner join t_bse_medstore c on c.medstoreid_chr = a.medstoreid"; } else { strSQL = @"select b.medicinetypeid_chr, b.medicinetypename_vchr, a.medicineroomid from t_ms_medicinestoreroomset a, t_aid_medicinetype b where a.medicinetypeid_chr = b.medicinetypeid_chr "; } dtMedType = new DataTable(); try { clsHRPTableService objHRPSvc = new clsHRPTableService(); lngRes = objHRPSvc.DoGetDataTable(strSQL, ref dtMedType); objHRPSvc.Dispose(); } catch (Exception objEx) { com.digitalwave.Utility.clsLogText objLogger = new com.digitalwave.Utility.clsLogText(); bool blnRes = objLogger.LogError(objEx); } return(lngRes); }
public long m_lngGetDataByTimeIndetityOp(System.Security.Principal.IPrincipal p_objPrincipal, out clsOutPatientTableInfo_VO[] p_objResultArr, string p_strdtmBegin, string p_strdtmEnd, string p_strPatientTypeId, string p_strEmployeeID) { long lngRes = 0; p_objResultArr = new clsOutPatientTableInfo_VO[0]; clsPrivilegeHandleService objPrivilege = new clsPrivilegeHandleService(); lngRes = objPrivilege.m_lngCheckCallPrivilege(p_objPrincipal, "com.digitalwave.iCare.middletier.HIS.clsOutpatientChargeIdetityPrintSvc", "m_lngGetDataByTimeIndetityOp"); if (lngRes < 0) { return(-1); } string strSQL = @"SELECT td.patientcardid_chr, ta.recorddate_dat, ta.patientname_chr, ta.invoiceno_vchr, ta.acctsum_mny, ta.sbsum_mny, ta.totalsum_mny, te.lastname_vchr FROM t_opr_outpatientrecipeinv ta, t_bse_employee te, t_bse_patientpaytype tp, t_bse_patientcard td WHERE ta.balanceflag_int = 1 AND ta.opremp_chr = te.empid_chr(+) AND ta.paytypeid_chr = tp.paytypeid_chr(+) AND ta.patientid_chr = td.patientid_chr (+)" ; strSQL += " AND ta.recorddate_dat BETWEEN to_date('" + p_strdtmBegin + " 00:00:00" + "','yyyy-mm-dd hh24:mi:ss')"; strSQL += " AND to_date('" + p_strdtmEnd + " 23:59:59" + "','yyyy-mm-dd hh24:mi:ss')"; if (p_strPatientTypeId != null) { strSQL += " AND ta.PAYTYPEID_CHR = '" + p_strPatientTypeId + "'"; } if (p_strEmployeeID != null) { strSQL += " AND te.EMPID_CHR = '" + p_strEmployeeID + "'"; } strSQL += " order by te.EMPID_CHR,ta.recorddate_dat,ta.INVOICENO_VCHR"; try { DataTable dtbResult = new DataTable(); com.digitalwave.iCare.middletier.HRPService.clsHRPTableService objHRPSvc = new clsHRPTableService(); lngRes = objHRPSvc.DoGetDataTable(strSQL, ref dtbResult); if (lngRes > 0 && dtbResult.Rows.Count > 0) { p_objResultArr = new com.digitalwave.iCare.ValueObject.clsOutPatientTableInfo_VO[dtbResult.Rows.Count]; for (int i1 = 0; i1 < p_objResultArr.Length; i1++) { p_objResultArr[i1] = new com.digitalwave.iCare.ValueObject.clsOutPatientTableInfo_VO(); p_objResultArr[i1].m_strLastname_vchr = dtbResult.Rows[i1]["LASTNAME_VCHR"].ToString().Trim(); p_objResultArr[i1].m_strPatientCardId = dtbResult.Rows[i1]["PATIENTCARDID_CHR"].ToString().Trim(); p_objResultArr[i1].m_strPatientName = dtbResult.Rows[i1]["PATIENTNAME_CHR"].ToString().Trim(); p_objResultArr[i1].m_strRecordDataTime = Convert.ToDateTime(dtbResult.Rows[i1]["RECORDDATE_DAT"].ToString()).Date; p_objResultArr[i1].m_strInvoiceNo = dtbResult.Rows[i1]["INVOICENO_VCHR"].ToString(); p_objResultArr[i1].m_strTOTALSUM_MNY = float.Parse(dtbResult.Rows[i1]["TOTALSUM_MNY"].ToString().Trim()); p_objResultArr[i1].m_strSBSUM_MNY = float.Parse(dtbResult.Rows[i1]["SBSUM_MNY"].ToString().Trim()); p_objResultArr[i1].m_strACCTSUM_MNY = float.Parse(dtbResult.Rows[i1]["ACCTSUM_MNY"].ToString().Trim()); } } objHRPSvc.Dispose(); } catch (Exception objEx) { string strTmp = objEx.Message; com.digitalwave.Utility.clsLogText objLogger = new clsLogText(); bool blnRes = objLogger.LogError(objEx); } return(lngRes); }
public long lngSelectByCondition(IPrincipal p_objPrincipal, string p_strWhereCondition, out clsBill_VO[] p_objEntity) { long lngRes = -1; p_objEntity = null; clsHRPTableService HRPSvc = new clsHRPTableService(); clsPrivilegeHandleService objPrivilege = new clsPrivilegeHandleService(); lngRes = objPrivilege.m_lngCheckCallPrivilege(p_objPrincipal, "com.digitalwave.iCare.middletier.HIS.clsBillSvc", "lngSelectRecordCount"); if (lngRes < 0) { return(-1); } string strSQL = @"SELECT billid_int, billtype_chr, billno_vchr, status_int, inempid_chr, indatetime_dat, inoprid_chr, inoprdatetime_dat, outempid_chr, outdatetime_dat, outoprid_chr, outoprdatetime_dat, returnempid_chr, returndatetime_dat, returnoprid_chr, returnoprdatetime_dat, useempid_chr, usedatetime_dat, cancelempid_chr, canceldatetime_dat, refempid_chr, refdatetime_dat, note_vchr, totalsum_mny, acctsum_mny, sbsum_mny FROM t_bse_bill " ; if (p_strWhereCondition != "") { strSQL += " Where " + p_strWhereCondition; } try { DataTable p_objResultTable = null; lngRes = HRPSvc.DoGetDataTable(strSQL, ref p_objResultTable); if (lngRes > 0) { if (p_objResultTable.Rows.Count != 0) { p_objEntity = new clsBill_VO[p_objResultTable.Rows.Count]; for (int j = 0; j < p_objResultTable.Rows.Count; j++) { p_objEntity[j] = new clsBill_VO(); if (p_objResultTable.Rows[0]["billid_int"] != DBNull.Value) { p_objEntity[j].Billid_int = Convert.ToInt32(p_objResultTable.Rows[0]["billid_int"]); } if (p_objResultTable.Rows[0]["billtype_chr"] != DBNull.Value) { p_objEntity[j].Billtype_chr = Convert.ToString(p_objResultTable.Rows[0]["billtype_chr"]); } if (p_objResultTable.Rows[0]["billno_vchr"] != DBNull.Value) { p_objEntity[j].Billno_vchr = Convert.ToString(p_objResultTable.Rows[0]["billno_vchr"]); } if (p_objResultTable.Rows[0]["status_int"] != DBNull.Value) { p_objEntity[j].Status_int = Convert.ToInt32(p_objResultTable.Rows[0]["status_int"]); } if (p_objResultTable.Rows[0]["inempid_chr"] != DBNull.Value) { p_objEntity[j].Inempid_chr = Convert.ToString(p_objResultTable.Rows[0]["inempid_chr"]); } if (p_objResultTable.Rows[0]["indatetime_dat"] != DBNull.Value) { p_objEntity[j].Indatetime_dat = Convert.ToDateTime(p_objResultTable.Rows[0]["indatetime_dat"]); } if (p_objResultTable.Rows[0]["inoprid_chr"] != DBNull.Value) { p_objEntity[j].Inoprid_chr = Convert.ToString(p_objResultTable.Rows[0]["inoprid_chr"]); } if (p_objResultTable.Rows[0]["inoprdatetime_dat"] != DBNull.Value) { p_objEntity[j].Inoprdatetime_dat = Convert.ToDateTime(p_objResultTable.Rows[0]["inoprdatetime_dat"]); } if (p_objResultTable.Rows[0]["outempid_chr"] != DBNull.Value) { p_objEntity[j].Outempid_chr = Convert.ToString(p_objResultTable.Rows[0]["outempid_chr"]); } if (p_objResultTable.Rows[0]["outdatetime_dat"] != DBNull.Value) { p_objEntity[j].Outdatetime_dat = Convert.ToDateTime(p_objResultTable.Rows[0]["outdatetime_dat"]); } if (p_objResultTable.Rows[0]["outoprid_chr"] != DBNull.Value) { p_objEntity[j].Outoprid_chr = Convert.ToString(p_objResultTable.Rows[0]["outoprid_chr"]); } if (p_objResultTable.Rows[0]["outoprdatetime_dat"] != DBNull.Value) { p_objEntity[j].Outoprdatetime_dat = Convert.ToDateTime(p_objResultTable.Rows[0]["outoprdatetime_dat"]); } if (p_objResultTable.Rows[0]["returnempid_chr"] != DBNull.Value) { p_objEntity[j].Returnempid_chr = Convert.ToString(p_objResultTable.Rows[0]["returnempid_chr"]); } if (p_objResultTable.Rows[0]["returndatetime_dat"] != DBNull.Value) { p_objEntity[j].Returndatetime_dat = Convert.ToDateTime(p_objResultTable.Rows[0]["returndatetime_dat"]); } if (p_objResultTable.Rows[0]["returnoprid_chr"] != DBNull.Value) { p_objEntity[j].Returnoprid_chr = Convert.ToString(p_objResultTable.Rows[0]["returnoprid_chr"]); } if (p_objResultTable.Rows[0]["returnoprdatetime_dat"] != DBNull.Value) { p_objEntity[j].Returnoprdatetime_dat = Convert.ToDateTime(p_objResultTable.Rows[0]["returnoprdatetime_dat"]); } if (p_objResultTable.Rows[0]["useempid_chr"] != DBNull.Value) { p_objEntity[j].Useempid_chr = Convert.ToString(p_objResultTable.Rows[0]["useempid_chr"]); } if (p_objResultTable.Rows[0]["usedatetime_dat"] != DBNull.Value) { p_objEntity[j].Usedatetime_dat = Convert.ToDateTime(p_objResultTable.Rows[0]["usedatetime_dat"]); } if (p_objResultTable.Rows[0]["cancelempid_chr"] != DBNull.Value) { p_objEntity[j].Cancelempid_chr = Convert.ToString(p_objResultTable.Rows[0]["cancelempid_chr"]); } if (p_objResultTable.Rows[0]["canceldatetime_dat"] != DBNull.Value) { p_objEntity[j].Canceldatetime_dat = Convert.ToDateTime(p_objResultTable.Rows[0]["canceldatetime_dat"]); } if (p_objResultTable.Rows[0]["refempid_chr"] != DBNull.Value) { p_objEntity[j].Refempid_chr = Convert.ToString(p_objResultTable.Rows[0]["refempid_chr"]); } if (p_objResultTable.Rows[0]["refdatetime_dat"] != DBNull.Value) { p_objEntity[j].Refdatetime_dat = Convert.ToDateTime(p_objResultTable.Rows[0]["refdatetime_dat"]); } if (p_objResultTable.Rows[0]["note_vchr"] != DBNull.Value) { p_objEntity[j].Note_vchr = Convert.ToString(p_objResultTable.Rows[0]["note_vchr"]); } if (p_objResultTable.Rows[0]["totalsum_mny"] != DBNull.Value) { p_objEntity[j].Totalsum_mny = Convert.ToInt32(p_objResultTable.Rows[0]["totalsum_mny"]); } if (p_objResultTable.Rows[0]["acctsum_mny"] != DBNull.Value) { p_objEntity[j].Acctsum_mny = Convert.ToInt32(p_objResultTable.Rows[0]["acctsum_mny"]); } if (p_objResultTable.Rows[0]["sbsum_mny"] != DBNull.Value) { p_objEntity[j].Sbsum_mny = Convert.ToInt32(p_objResultTable.Rows[0]["sbsum_mny"]); } } } } HRPSvc.Dispose(); } catch (Exception objEx) { string strTmp = objEx.Message; clsLogText objLogger = new clsLogText(); bool blnRes = objLogger.LogError(objEx); } return(lngRes); }
public long m_lngGetOutPatientInfor(string m_strRegID, out clsHospRecordCS_Vo p_objHospRecord, out List <clsHospBillCS_Vo> m_glsHospBill, out List <clsHospOrderCS_Vo> m_glsHospOrder) { long lngRes = -1; string strSQL = string.Empty; DataTable dtTmp = null; p_objHospRecord = null; m_glsHospBill = null; m_glsHospOrder = null; try { #region 1. 个人信息 strSQL = @"select b.lastname_vchr, b.sex_chr, b.race_vchr, b.homeaddress_vchr, b.officeaddress_vchr, b.homephone_vchr, b.contactpersonfirstname_vchr, b.nationality_vchr, b.married_chr, b.birth_dat, b.idcard_chr, b.insuranceid_vchr, a.inpatientid_chr, a.inpatientcount_int, a.registerid_chr, f.patientcardid_chr, e.code_chr, a.areaid_chr, d.deptname_vchr, a.casedoctor_chr, g.lastname_vchr as doctorname, a.inareadate_dat, a.icd10diagtext_vchr, a.icd10diagid_vchr, a.status_int, td.deptname_vchr as outdeptname, ta.outareaid_chr, ta.outhospital_dat, ta.diagnose_vchr as outdiagnose, ta.ins_diagnose_vchr, ta.type_int,b.birthplace_vchr,a.inpatient_dat,a.paytypeid_chr from t_opr_bih_register a, t_opr_bih_leave ta, t_opr_bih_registerdetail b, t_bse_deptdesc d, t_bse_bed e, t_bse_patientcard f, t_bse_employee g, t_bse_deptdesc td where a.registerid_chr = b.registerid_chr and a.registerid_chr = ta.registerid_chr and ta.pstatus_int = 1 and ta.status_int = 1 and ta.outareaid_chr = td.deptid_chr and a.patientid_chr = f.patientid_chr and a.casedoctor_chr = g.empid_chr and a.areaid_chr = d.deptid_chr and a.bedid_chr = e.bedid_chr and a.status_int != 0 and a.registerid_chr = ?"; clsHRPTableService objHRPSvc = new clsHRPTableService(); IDataParameter[] param = null; objHRPSvc.CreateDatabaseParameter(1, out param); param[0].Value = m_strRegID; dtTmp = new DataTable(); lngRes = objHRPSvc.lngGetDataTableWithParameters(strSQL, ref dtTmp, param); objHRPSvc.Dispose(); objHRPSvc = null; param = null; if (lngRes < 0 || dtTmp.Rows.Count < 1) { return(lngRes); } ///////////////////////////////////////////////////// DataRow dr = dtTmp.Rows[0]; p_objHospRecord = new clsHospRecordCS_Vo(); p_objHospRecord.m_strName = dr["lastname_vchr"].ToString(); p_objHospRecord.m_strSex = clsDataUpload_Svc.m_strConvertValue("sex", dr["sex_chr"].ToString(), ""); p_objHospRecord.m_strEthnicGroup = clsDataUpload_Svc.m_strConvertValue("ethnicgroup", dr["race_vchr"].ToString(), ""); p_objHospRecord.m_strAddress = dr["homeaddress_vchr"].ToString(); if (dr["inpatient_dat"] != DBNull.Value) { p_objHospRecord.m_dtmConfirmDate = Convert.ToDateTime(dr["inpatient_dat"].ToString().Trim()); string m_strDateTime = p_objHospRecord.m_dtmConfirmDate.ToString("yyyy-MM-dd"); p_objHospRecord.m_dtmConfirmDate = Convert.ToDateTime(m_strDateTime); } p_objHospRecord.m_strJobTitle = dr["officeaddress_vchr"].ToString(); p_objHospRecord.m_strPhoneNum = dr["homephone_vchr"].ToString(); p_objHospRecord.m_strContactPerson = dr["contactpersonfirstname_vchr"].ToString(); p_objHospRecord.m_strNationality = clsDataUpload_Svc.m_strConvertValue("nationality", dr["nationality_vchr"].ToString(), ""); p_objHospRecord.m_strMaritalStatus = clsDataUpload_Svc.m_strConvertValue("maritalstatus", dr["married_chr"].ToString(), ""); p_objHospRecord.m_dtmBirthDay = Convert.ToDateTime(dr["birth_dat"]); p_objHospRecord.m_strIDNumber = dr["idcard_chr"].ToString(); p_objHospRecord.m_strSSID = dr["insuranceid_vchr"].ToString(); p_objHospRecord.m_strInHospNO = dr["inpatientid_chr"].ToString(); p_objHospRecord.m_intInHospCount = int.Parse(dr["inpatientcount_int"].ToString()); p_objHospRecord.m_strRegisterID = dr["registerid_chr"].ToString(); p_objHospRecord.m_strClinicID = dr["patientcardid_chr"].ToString(); p_objHospRecord.m_strBedNO = dr["code_chr"].ToString(); p_objHospRecord.m_strInDeptCode = dr["areaid_chr"].ToString(); p_objHospRecord.m_strInDeptName = dr["deptname_vchr"].ToString(); p_objHospRecord.m_strMainDoctorID = dr["casedoctor_chr"].ToString(); p_objHospRecord.m_strMainDoctorName = dr["doctorname"].ToString(); p_objHospRecord.m_dtmInDate = DateTime.Parse(dr["inpatient_dat"].ToString()); p_objHospRecord.m_strInDiagnosName = dr["icd10diagtext_vchr"].ToString(); p_objHospRecord.m_strInDiagnosCode = dr["icd10diagid_vchr"].ToString(); p_objHospRecord.m_strOutDeptName = dr["outdeptname"].ToString(); p_objHospRecord.m_strOutDeptCode = dr["outareaid_chr"].ToString(); p_objHospRecord.m_dtmOutDate = Convert.ToDateTime(dr["outhospital_dat"]); p_objHospRecord.m_strOutDiagnosName = dr["outdiagnose"].ToString(); p_objHospRecord.m_strOutDiagnosCode = dr["ins_diagnose_vchr"].ToString(); p_objHospRecord.m_strStatus = dr["type_int"].ToString();//改 p_objHospRecord.m_intCancel = int.Parse(dr["status_int"].ToString()); TimeSpan ts = p_objHospRecord.m_dtmOutDate - p_objHospRecord.m_dtmInDate; p_objHospRecord.m_intHospDay = ts.Days; p_objHospRecord.m_strKind = clsDataUpload_Svc.m_strConvertValue("kind", dr["paytypeid_chr"].ToString(), "");// 跟身份关联 p_objHospRecord.m_strBirthPlace = dr["BIRTHPLACE_VCHR"].ToString(); p_objHospRecord.m_dtmInAreaTime = Convert.ToDateTime(dr["inareadate_dat"]); dtTmp.Dispose(); dtTmp = null; //////////////////////////////////////////////////// #endregion #region 2. 发票信息 //2.1 主信息 // strSQL = @"select a.registerid_chr, c.invoiceno_vchr, a.totalsum_mny, a.sbsum_mny, // a.operdate_dat, e.typeid_chr, e.typename_vchr, a.chargeno_chr, // sum (b.totalmoney_dec) as submoney,a.paytypeid_chr // from t_opr_bih_charge a, // t_opr_bih_chargeitementry b, // t_opr_bih_chargedefinv c, // t_bse_chargeitemextype e // where a.chargeno_chr = c.chargeno_chr // and a.chargeno_chr = b.chargeno_chr // and b.invcateid_chr = e.typeid_chr // and e.flag_int = 4 // and a.registerid_chr = ? // group by a.registerid_chr, // c.invoiceno_vchr, // a.totalsum_mny, // a.sbsum_mny, // a.operdate_dat, // e.typeid_chr, // e.typename_vchr, // a.chargeno_chr // order by c.invoiceno_vchr"; strSQL = @"select b.sid_int, a.registerid_chr, c.orderid_chr, c.create_dat, c.createarea_chr, d.invoiceno_vchr, a.totalsum_mny, a.sbsum_mny, a.operdate_dat, g.itemcode_vchr as chargeitemid_chr, b.chargeitemname_chr, b.amount_dec, b.unitprice_dec, b.totalmoney_dec as itemmoney, b.createarea_chr, e.deptname_vchr, b.doctorid_chr, f.lastname_vchr, b.invcateid_chr, a.chargeno_chr, b.sid_int, g.itemsrcid_vchr, g.itemcode_vchr, h.drugid_chr from t_opr_bih_charge a, t_opr_bih_chargeitementry b, t_opr_bih_patientcharge c, t_opr_bih_chargedefinv d, t_bse_deptdesc e, t_bse_employee f, t_bse_chargeitem g, t_bse_medidrefloadupdrugid h where b.chargeitemid_chr = g.itemid_chr(+) and a.chargeno_chr = b.chargeno_chr and a.chargeno_chr = d.chargeno_chr and a.chargeno_chr = c.paymoneyid_chr and b.pchargeid_chr = c.pchargeid_chr and b.createarea_chr = e.deptid_chr and b.doctorid_chr = f.empid_chr and g.itemsrcid_vchr = h.medicineid_chr(+) and a.registerid_chr = ? "; objHRPSvc = new clsHRPTableService(); dtTmp = new DataTable(); objHRPSvc.CreateDatabaseParameter(1, out param); param[0].Value = m_strRegID; lngRes = objHRPSvc.lngGetDataTableWithParameters(strSQL, ref dtTmp, param); objHRPSvc.Dispose(); objHRPSvc = null; param = null; if (lngRes < 0 || dtTmp.Rows.Count < 1) { return(lngRes); } // 2.2 要取得开始和结束时间 int intRowCount = dtTmp.Rows.Count; List <string> m_glsChargeNo = new List <string>(); for (int i = 0; i < intRowCount; i++) { dr = dtTmp.Rows[i]; if (!m_glsChargeNo.Contains(dr["chargeno_chr"].ToString())) { m_glsChargeNo.Add(dr["chargeno_chr"].ToString()); } } System.Text.StringBuilder stbTmp = new System.Text.StringBuilder(m_glsChargeNo.Count * 23); int i1 = 0; for (i1 = 0; i1 < m_glsChargeNo.Count - 1; i1++) { stbTmp.Append("'" + m_glsChargeNo[i1].ToString() + "',"); } stbTmp.Append("'" + m_glsChargeNo[i1].ToString() + "'"); strSQL = @"select a.chargeno_chr, max (c.chargeactive_dat) as enddate, min (c.chargeactive_dat) as begindate from t_opr_bih_charge a, t_opr_bih_chargeitementry b, t_opr_bih_patientcharge c where a.chargeno_chr = b.chargeno_chr and b.pchargeid_chr = c.pchargeid_chr and a.chargeno_chr in (" + stbTmp.ToString().Trim() + ") group by a.chargeno_chr"; stbTmp = null; objHRPSvc = new clsHRPTableService(); DataTable dtChargeNO = new DataTable(); lngRes = objHRPSvc.DoGetDataTable(strSQL, ref dtChargeNO); objHRPSvc.Dispose(); objHRPSvc = null; if (lngRes < 0 || dtChargeNO.Rows.Count < 0) { return(lngRes); } Dictionary <string, List <DateTime> > m_gDicChargeDefTime = new Dictionary <string, List <DateTime> >(dtChargeNO.Rows.Count); List <DateTime> m_glsTime; for (i1 = 0; i1 < dtChargeNO.Rows.Count; i1++) { dr = dtChargeNO.Rows[i1]; m_glsTime = new List <DateTime>(2); m_glsTime.Add(Convert.ToDateTime(dr["begindate"])); m_glsTime.Add(Convert.ToDateTime(dr["enddate"])); m_gDicChargeDefTime.Add(dr["chargeno_chr"].ToString(), m_glsTime); } dtChargeNO = null; // 2.3 赋值 m_glsHospBill = new List <clsHospBillCS_Vo>(intRowCount); for (i1 = 0; i1 < intRowCount; i1++) { dr = dtTmp.Rows[i1]; clsHospBillCS_Vo objNew = new clsHospBillCS_Vo(); objNew.m_strRegisterID = dr["registerid_chr"].ToString(); objNew.m_strInvoNo = dr["invoiceno_vchr"].ToString(); objNew.m_dclInvoTotolMoney = Convert.ToDecimal(dr["totalsum_mny"]); objNew.m_dclInvoFSPMoney = Convert.ToDecimal(dr["sbsum_mny"]); objNew.m_dtmBeginDate = m_gDicChargeDefTime[dr["chargeno_chr"].ToString()][0]; objNew.m_dtmEndDate = m_gDicChargeDefTime[dr["chargeno_chr"].ToString()][1]; objNew.m_dtmBillDate = Convert.ToDateTime(dr["operdate_dat"]); objNew.m_strKind = p_objHospRecord.m_strKind;//身份 //objNew.m_strFareCode = dr["typeid_chr"].ToString(); //objNew.m_strFareName = dr["typename_vchr"].ToString(); objNew.m_strFareCode = dr["itemcode_vchr"].ToString(); objNew.m_strFareName = dr["chargeitemname_chr"].ToString(); objNew.m_dclSubMoney = decimal.Parse(dr["itemmoney"].ToString()); objNew.m_intAmount = decimal.Parse(dr["amount_dec"].ToString()); objNew.m_dclPrice = decimal.Parse(dr["unitprice_dec"].ToString()); objNew.m_strInDeptName = dr["createarea_chr"].ToString(); objNew.m_strInDeptID = dr["deptname_vchr"].ToString(); objNew.m_strDoctorID = dr["doctorid_chr"].ToString(); objNew.m_strDoctorName = dr["lastname_vchr"].ToString(); objNew.m_strFareKind = clsDataUpload_Svc.m_strConvertValue("billkind", dr["invcateid_chr"].ToString(), ""); objNew.m_strSEQID = dr["sid_int"].ToString(); objNew.m_strOrderID = dr["orderid_chr"].ToString(); objNew.m_strITEMID = dr["drugid_chr"].ToString().Trim(); objNew.m_dtEXECUTEDATE = Convert.ToDateTime(dr["create_dat"].ToString()); objNew.m_strDEPCODE = dr["createarea_chr"].ToString(); objNew.m_strDEPNAME = dr["deptname_vchr"].ToString().Trim(); m_glsHospBill.Add(objNew); } #endregion #region 3. 个人医嘱 strSQL = @" select a.creatorid_chr, a.registerid_chr, a.creator_chr, a.createareaid_chr, a.createareaname_vchr, a.recipeno_int, c.itemcode_vchr as chargeitemid_chr, b.chargeitemname_chr, b.spec_vchr, b.amount_dec, b.unitprice_dec, b.unit_vchr, a.createdate_dat, a.startdate_dat, a.executetype_int, a.orderid_chr, '' as kind, b.flag_int, decode(a.dosage_dec,null,b.amount_dec,a.dosage_dec) as dosage_dec, a.dosageunit_chr, a.execfreqname_chr as execfreqid_chr, a.dosetypeid_chr, a.dosetypename_chr, a.curareaid_chr, d.deptname_vchr as curareaname, a.stoperid_chr, a.stoper_chr, a.stopdate_dat, c.itemipinvtype_chr, e.sample_type_desc_vchr, f.partname, a.remark_vchr, c.itemsrcid_vchr, g.drugid_chr, decode(n.flaga_int,1,'01',2,'02','99') as JXBZDM from t_opr_bih_order a, t_opr_bih_orderchargedept b, t_bse_chargeitem c, t_bse_deptdesc d, t_aid_lis_sampletype e, ar_apply_partlist f, t_bse_medidrefloadupdrugid g, t_bse_medicine m, t_aid_medicinepreptype n where a.orderid_chr = b.orderid_chr and b.chargeitemid_chr = c.itemid_chr and a.sampleid_vchr = e.sample_type_id_chr(+) and a.partid_vchr = f.partid(+) and a.curareaid_chr = d.deptid_chr and c.itemsrcid_vchr = g.medicineid_chr(+) and c.itemsrcid_vchr=m.medicineid_chr(+) and m.medicinepreptype_chr = n.medicinepreptype_chr(+) and a.status_int in (2, 3, 6) and a.registerid_chr = ? "; objHRPSvc = new clsHRPTableService(); objHRPSvc.CreateDatabaseParameter(1, out param); param[0].Value = m_strRegID; lngRes = objHRPSvc.lngGetDataTableWithParameters(strSQL, ref dtTmp, param); objHRPSvc.Dispose(); objHRPSvc = null; if (lngRes < 0) { return(lngRes); } intRowCount = dtTmp.Rows.Count; m_glsHospOrder = new List <clsHospOrderCS_Vo>(intRowCount); for (int i = 0; i < intRowCount; i++) { dr = dtTmp.Rows[i]; clsHospOrderCS_Vo objOrder = new clsHospOrderCS_Vo(); objOrder.m_strKind = p_objHospRecord.m_strKind; objOrder.m_strCreatorID = dr["creatorid_chr"].ToString(); objOrder.m_strCreateDoctor = dr["creator_chr"].ToString(); objOrder.m_strCreateDeptID = dr["createareaid_chr"].ToString(); objOrder.m_strCreateDept = dr["createareaname_vchr"].ToString(); objOrder.m_strOrderID = dr["orderid_chr"].ToString(); objOrder.m_strChargeItemID = dr["chargeitemid_chr"].ToString(); objOrder.m_strChargeItemName = dr["chargeitemname_chr"].ToString(); objOrder.m_strSpec = dr["spec_vchr"].ToString(); objOrder.m_dclAmount = decimal.Parse(dr["amount_dec"].ToString()); objOrder.m_dclPrice = decimal.Parse(dr["unitprice_dec"].ToString()); objOrder.m_strUnit = dr["unit_vchr"].ToString() == "" ? "[无]" : dr["unit_vchr"].ToString(); objOrder.m_intGroupNo = int.Parse(dr["recipeno_int"].ToString()); if (dr["createdate_dat"] != DBNull.Value) { objOrder.m_dtmCreateDate = DateTime.Parse(dr["createdate_dat"].ToString()); } if (dr["startdate_dat"] != DBNull.Value) { objOrder.m_dtmStartDT = DateTime.Parse(dr["startdate_dat"].ToString()); } if (dr["stopdate_dat"] != DBNull.Value) { objOrder.m_dtmStopDT = DateTime.Parse(dr["stopdate_dat"].ToString()); } if (dr["executetype_int"] != DBNull.Value) { objOrder.m_intOrderStauts = int.Parse(dr["executetype_int"].ToString()); if (dr["executetype_int"].ToString() == "1") { TimeSpan t = objOrder.m_dtmStopDT - objOrder.m_dtmStartDT; objOrder.m_intDays = t.Days; } else { objOrder.m_intDays = 0; } } objOrder.m_strRegisterID = m_strRegID; objOrder.m_intGroupNo = int.Parse(dr["recipeno_int"].ToString()); objOrder.m_strType = clsDataUpload_Svc.m_strConvertValue("ordertype", dr["executetype_int"].ToString(), ""); if (dr["flag_int"].ToString() == "0") { if (dr["dosage_dec"] == DBNull.Value) { try { objOrder.m_dclDosageUse = Convert.ToDecimal(dr["amount_dec"]); } catch { objOrder.m_dclDosageUse = 0; } } else { try { objOrder.m_dclDosageUse = Convert.ToDecimal(dr["dosage_dec"]); } catch { objOrder.m_dclDosageUse = 0; } } objOrder.m_strUseUnit = dr["dosageunit_chr"].ToString(); objOrder.m_strFrequencyName = clsDataUpload_Svc.m_strConvertValue("Frequency", dr["execfreqid_chr"].ToString(), ""); objOrder.m_strUsageType = clsDataUpload_Svc.m_strConvertValue("medicineusage", dr["dosetypeid_chr"].ToString(), ""); } objOrder.m_strINDeptID = dr["curareaid_chr"].ToString(); objOrder.m_strINDeptName = dr["curareaname"].ToString(); objOrder.m_strStopDoctor = dr["stoperid_chr"].ToString(); objOrder.m_strStopDoctorName = dr["stoper_chr"].ToString(); objOrder.m_strFarekind = clsDataUpload_Svc.m_strConvertValue("billkind", dr["itemipinvtype_chr"].ToString(), ""); objOrder.m_strCheckName = dr["sample_type_desc_vchr"].ToString(); objOrder.m_strCheckPark = dr["partname"].ToString(); objOrder.m_strRemark = dr["remark_vchr"].ToString(); objOrder.m_strITEMID = dr["drugid_chr"].ToString().Trim(); objOrder.m_strJXBZDM = dr["JXBZDM"].ToString().Trim(); //objOrder. m_glsHospOrder.Add(objOrder); } dtTmp.Dispose(); dtTmp = null; #endregion } catch (Exception objEx) { string strTmp = objEx.Message; com.digitalwave.Utility.clsLogText objLogger = new clsLogText(); bool blnRes = objLogger.LogError(objEx); } return(lngRes); }
public long m_lngGetInpatientInfo(List <string> p_strInPatient, out List <clsHospRecordCS_Vo> p_glsInPatientInfor) { long lngRes = -1; p_glsInPatientInfor = null; System.Text.StringBuilder stbTmp = new System.Text.StringBuilder(p_strInPatient.Count * 21); int i1 = 0; for (i1 = 0; i1 < p_strInPatient.Count - 1; i1++) { stbTmp.Append("'" + p_strInPatient[i1].ToString() + "',"); } stbTmp.Append("'" + p_strInPatient[i1].ToString() + "'"); string sql = @"select b.lastname_vchr, b.sex_chr, b.race_vchr, b.homeaddress_vchr, b.officeaddress_vchr, b.homephone_vchr, b.contactpersonfirstname_vchr, b.nationality_vchr, b.married_chr, b.birth_dat, b.idcard_chr, b.insuranceid_vchr, a.inpatientid_chr, a.inpatientcount_int, a.registerid_chr, f.patientcardid_chr, e.code_chr, a.areaid_chr, d.deptname_vchr, a.casedoctor_chr, g.lastname_vchr as doctorname, a.inareadate_dat, a.icd10diagtext_vchr, a.icd10diagid_vchr, a.status_int from t_opr_bih_register a, t_opr_bih_registerdetail b, t_bse_deptdesc d, t_bse_bed e, t_bse_patientcard f, t_bse_employee g where a.registerid_chr = b.registerid_chr and a.patientid_chr = f.patientid_chr and a.casedoctor_chr = g.empid_chr and a.areaid_chr = d.deptid_chr and a.bedid_chr = e.bedid_chr and a.status_int != 0 and a.registerid_chr in ( " + stbTmp.ToString().Trim() + ")"; stbTmp = null; p_strInPatient = null; try { clsHRPTableService objHRPSvc = new clsHRPTableService(); DataTable dt = new DataTable(); lngRes = objHRPSvc.DoGetDataTable(sql, ref dt); objHRPSvc.Dispose(); objHRPSvc = null; if (lngRes < 0) { return(lngRes); } p_glsInPatientInfor = new List <clsHospRecordCS_Vo>(dt.Rows.Count); foreach (DataRow dr in dt.Rows) { clsHospRecordCS_Vo objNew = new clsHospRecordCS_Vo(); objNew.m_strName = dr["lastname_vchr"].ToString(); objNew.m_strSex = clsDataUpload_Svc.m_strConvertValue("sex", dr["sex_chr"].ToString(), ""); objNew.m_strEthnicGroup = clsDataUpload_Svc.m_strConvertValue("ethnicgroup", dr["race_vchr"].ToString(), ""); objNew.m_strAddress = dr["homeaddress_vchr"].ToString(); objNew.m_strJobTitle = dr["officeaddress_vchr"].ToString(); objNew.m_strPhoneNum = dr["homephone_vchr"].ToString(); objNew.m_strContactPerson = dr["contactpersonfirstname_vchr"].ToString(); //objNew.m_strNationality= dr["nationality_vchr"].ToString(); objNew.m_strNationality = clsDataUpload_Svc.m_strConvertValue("nationality", dr["nationality_vchr"].ToString(), ""); //objNew.m_strMaritalStatus = this.m_strMarryStatus(dr["married_chr"].ToString()); //婚姻 objNew.m_strMaritalStatus = clsDataUpload_Svc.m_strConvertValue("maritalstatus", dr["married_chr"].ToString(), ""); objNew.m_dtmBirthDay = Convert.ToDateTime(dr["birth_dat"]); objNew.m_strIDNumber = dr["idcard_chr"].ToString(); objNew.m_strSSID = dr["insuranceid_vchr"].ToString(); objNew.m_strInHospNO = dr["inpatientid_chr"].ToString(); objNew.m_intInHospCount = int.Parse(dr["inpatientcount_int"].ToString()); objNew.m_strRegisterID = dr["registerid_chr"].ToString(); objNew.m_strClinicID = dr["patientcardid_chr"].ToString(); objNew.m_strBedNO = dr["code_chr"].ToString(); objNew.m_strInDeptCode = dr["areaid_chr"].ToString(); objNew.m_strInDeptName = dr["deptname_vchr"].ToString(); objNew.m_strMainDoctorID = dr["casedoctor_chr"].ToString(); objNew.m_strMainDoctorName = dr["doctorname"].ToString(); objNew.m_dtmInDate = Convert.ToDateTime(dr["inareadate_dat"]); objNew.m_strInDiagnosName = dr["icd10diagtext_vchr"].ToString(); objNew.m_strInDiagnosCode = dr["icd10diagid_vchr"].ToString(); objNew.m_intCancel = int.Parse(dr["status_int"].ToString()); objNew.m_strKind = "1"; p_glsInPatientInfor.Add(objNew); } dt.Dispose(); dt = null; } catch (Exception objEx) { string strTmp = objEx.Message; com.digitalwave.Utility.clsLogText objLogger = new clsLogText(); bool blnRes = objLogger.LogError(objEx); } return(lngRes); }