public DataSyn(string _appPath) { this.appPath = _appPath; this.logPath = (new DirectoryInfo(this.appPath)).Parent.FullName + @"\InterfaceDataLog\检查\"; this.logOp = new BLPublic.LogOperate(this.appPath + @"\log\", "SDFYSyn"); this.db = new BLPublic.DBOperate(Path.Combine(this.appPath, "bl_server.lcf")); if (!this.db.IsConnected) { this.logOp.log("连接服务器失败:" + this.db.Error); } }
public SynPivasData(string _appPath) { this.appPath = _appPath; this.logOp = new BLPublic.LogOperate(Path.Combine(this.appPath, "log\\"), "synpivasdata"); }
public void monitor() { this.logOp = new BLPublic.LogOperate(this.appPath + @"\log\", "tpnmonitorlog"); this.db = new BLPublic.DBOperate(this.appPath + @"\bl_server.lcf", "CPMATE"); if (!this.db.IsConnected) { this.logOp.log("连接服务器失败:" + this.db.Error); return; } DataTable tblPatient = null; if (!this.db.GetRecordSet(SEL_ORDERS_NOCHK, ref tblPatient)) { this.logOp.log("加载未审方医嘱失败:" + this.db.Error); return; } if ((null == tblPatient) || (0 == tblPatient.Rows.Count)) { this.logOp.log("审方结束"); } this.tpnMnt = new tpnmonitor.TPNMonitor(); this.tpnMnt.init(this.db, "9999"); int month = 0; DateTime birthday; bool rt = false; foreach (DataRow row in tblPatient.Rows) { if (!Convert.IsDBNull(row["Birthday"])) { birthday = Convert.ToDateTime(row["Birthday"].ToString()); month = DateTime.Now.Month - birthday.Month; month = (DateTime.Now.Year - birthday.Year) * 12 + month; if (DateTime.Now.Day - birthday.Day < -15) { month--; } else if (DateTime.Now.Day - birthday.Day > 14) { month++; } } else { month = 0; } rt = this.tpnMnt.Monitor(row["PatientCode"].ToString(), month, "f".Equals(row["Sex"].ToString()) ? "女" : "男", row["RecipeID"].ToString()); if (rt) { this.tpnMnt.saveTPNValue(); } else { this.logOp.log("审核医嘱'" + row["RecipeID"].ToString() + "'失败:" + this.tpnMnt.getError()); } } tblPatient.Clear(); this.logOp.log("审方结束"); endMonitor(); }