public YunZhiResult UpdateRecorInfo(string hrid, string data03, string data04, string data05, string data06, DataTable table, List <string> delID) { YunZhiResult result = new YunZhiResult(); try { if (string.IsNullOrEmpty(hrid) == true) { result.Msg = "参数不能为空"; return(result); } int delResult = this.YunZhiDal.UpdateRecorInfo(hrid, data03, data04, data05, data06, table, delID); if (delResult > 0) { result.Result = 1; result.Msg = "操作成功"; } else { result.Msg = "操作失败!"; } } catch (Exception ex) { Logger.Log.Error(ex.Message, ex); result.Msg = "UpdateRecorInfo:" + ex.Message; } return(result); }
/// <summary>查询快检信息(返回客户列表信息)</summary> /// <param name="startTime"></param> /// <param name="endTime"></param> /// <param name="hid"></param> /// <param name="pname"></param> /// <returns></returns> public YunZhiResult QueryProjectList(string startTime, string endTime, string hid, string pname) { YunZhiResult result = new YunZhiResult(); try { if (string.IsNullOrEmpty(startTime) == true || string.IsNullOrEmpty(endTime) == true || string.IsNullOrEmpty(hid) == true) { result.Msg = "时间或者医院不能为空"; return(result); } if (Convert.ToDateTime(startTime) > Convert.ToDateTime(endTime)) { result.Msg = "开始日期不能大于结束日期"; return(result); } startTime = Convert.ToDateTime(startTime).ToString("yyyy-MM-dd 00:00:00"); endTime = Convert.ToDateTime(endTime).ToString("yyyy-MM-dd 23:59:59"); DataTable table = this.YunZhiDal.GetProjectPatientDistinct(startTime, endTime, hid, pname); result.Result = 1; result.DataInfo = table; } catch (Exception ex) { Logger.Log.Error(ex.Message, ex); result.Msg = "查询快检信息错误:" + ex.Message; } return(result); }
/// <summary>用户登录</summary> /// <param name="account"></param> /// <param name="pwd"></param> /// <returns></returns> public YunZhiResult UserLogin(string account, string pwd) { YunZhiResult result = new YunZhiResult(); try { if (string.IsNullOrEmpty(account) || string.IsNullOrEmpty(pwd)) { result.Msg = "用户名或密码不能为空!"; return(result); } string md5Pwd = MD5Helper.MD5Encrypt(pwd); DataTable table = this.YunZhiDal.UserLogin(account, md5Pwd); if (table == null || table.Rows.Count == 0) { result.Msg = "用户名或者密码错误!"; } else { result.Result = 1; result.DataInfo = table; } } catch (Exception ex) { Logger.Log.Error(ex.Message, ex); result.Msg = "登录错误:" + ex.Message; } return(result); }
private void button1_Click(object sender, EventArgs e) { string data03 = this.txtbs.Text.Trim(); string data04 = this.txtzs.Text.Trim(); string data05 = this.txtjg.Text.Trim(); string hosid = this.curHosID; string hosname = this.curHosName; string docid = this.curEmpID; string docName = this.curEmpName; string recordid = this._hrid; YunZhiService service = new YunZhiService(); YunZhiResult result = service.GetZhiHuiTuiSongData(data03, data04, data05, hosid, hosname, docid, docName, recordid); if (result.Result == 1) { string tuisongData = result.Msg; //解析推送消息就行显示在界面上 //调用清空 RunMethod(this.webBrowser1, "filllongtong", new string[] { tuisongData }); } else { MessageBox.Show(result.Msg, "错误提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }
/// <summary>得到项目列表</summary> /// <param name="sn">设备SN号码</param> /// <param name="startTime">开始时间</param> /// <param name="endTime">结束时间</param> /// <param name="token">系统分配的token,测试可以任意填写</param> /// <returns></returns> public YunZhiResult GetProjectList(string sn, DateTime startTime, DateTime endTime, string token) { YunZhiResult result = new YunZhiResult(); try { if (string.IsNullOrEmpty(sn)) { result.Msg = "sn不能为空"; return(result); } if (string.IsNullOrEmpty(token)) { result.Msg = "token错误!"; return(result); } if (startTime == null || startTime.ToString() == "" || endTime == null || endTime.ToString() == "") { result.Msg = "开始时间或结束时间不能为空!"; return(result); } DataTable table = this.YunZhiDal.GetProjectList(sn, startTime, endTime, token); result.Result = 1; result.DataInfo = table; } catch (Exception ex) { Logger.Log.Error(ex.Message, ex); result.Msg = "获取项目数据错误:" + ex.Message; } return(result); }
public YunZhiResult DelHealthRecode(string hrid) { YunZhiResult result = new YunZhiResult(); try { if (string.IsNullOrEmpty(hrid) == true) { result.Msg = "参数不能为空"; return(result); } int delResult = this.YunZhiDal.DelHealthRecode(hrid); if (delResult > 0) { result.Result = 1; result.Msg = "删除成功"; } else { result.Msg = "删除失败!"; } } catch (Exception ex) { Logger.Log.Error(ex.Message, ex); result.Msg = "得到项目列表和客户信息错误:" + ex.Message; } return(result); }
private void SaveOption() { YunZhiService service = null; try { string userName = this.txtUserName.Text.Trim(); if (string.IsNullOrEmpty(userName)) { MessageBox.Show("请输入姓名!"); return; } string idcard = this.txt_IDCard.Text.Trim(); if (string.IsNullOrEmpty(idcard)) { //TODO Services MessageBox.Show("请输入身份证号!"); //不输入身份证号,服务端保存失败,返回的msg="" return; } string sex = this.cbBox_Sex.SelectedIndex.ToString(); DateTime birthday = this.dtp_Birthday.Value; string tel = this.txt_Tel.Text.Trim(); string address = this.txt_Address.Text.Trim(); string addressNew = this.txt_AddressNew.Text.Trim(); service = new YunZhiService(); YunZhiResult addResult = service.AddPatientInfo(userName, address, tel, birthday.ToString("yyyy-MM-dd hh:mm:ss"), sex, idcard, addressNew, SourceHelper.EmployeeInfo.HID, SourceHelper.EmployeeInfo.EmpID); if (addResult.Result == 1) { MessageBox.Show("添加成功"); this.DialogResult = DialogResult.OK; } else { string strMessgage = string.IsNullOrEmpty(addResult.Msg) ? "添加失败" : addResult.Msg; MessageBox.Show(strMessgage); } } catch (Exception ex) { Logger.Log.Error("添加异常:" + ex.Message, ex); } finally { if (service != null) { service.Abort(); } } }
void _MainWork_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { if (e.Result != null && e.Result is YunZhiResult) { YunZhiResult result = e.Result as YunZhiResult; if (result.Result == 0) { MessageBox.Show(result.Msg); } else { this.SetValue(result.DataList); } } }
public YunZhiResult Demo(string ptid) { YunZhiResult result = new YunZhiResult(); try { DataTable table = new DataTable(); result.Result = 1; result.DataInfo = table; } catch (Exception ex) { Logger.Log.Error(ex.Message, ex); result.Msg = "获取患者数据错误:" + ex.Message; } return(result); }
/// <summary>获取患者信息通过身份证号</summary> /// <param name="idNumber"></param> /// <returns></returns> public YunZhiResult GetPatientInfoByIDNumber(string idNumber) { YunZhiResult result = new YunZhiResult(); try { DataTable table = this.YunZhiDal.GetPatientInfoByIDNumber(idNumber); result.Result = 1; result.DataInfo = table; } catch (Exception ex) { Logger.Log.Error(ex.Message, ex); result.Msg = "获取患者信息:" + ex.Message; } return(result); }
/// <summary>获取当前医生的看病记录通过医生ID</summary> /// <param name="docId">医生id</param> /// <returns></returns> public YunZhiResult GetCurrentHealthListByDocId(string docId) { YunZhiResult result = new YunZhiResult(); try { DataTable table = this.YunZhiDal.GetCurrentHealthListByDocId(docId); result.Result = 1; result.DataInfo = table; } catch (Exception ex) { Logger.Log.Error(ex.Message, ex); result.Msg = "获取就诊记录错误:" + ex.Message; } return(result); }
/// <summary>得到用户基本信息和项目列表</summary> /// <param name="ptid"></param> /// <param name="hid"></param> /// <param name="hrid"></param> /// <returns></returns> public YunZhiResult GetZhenLiaoListByPTID(string ptid, string hid, string hrid) { YunZhiResult result = new YunZhiResult(); if (string.IsNullOrEmpty(ptid) == true || string.IsNullOrEmpty(hid) == true) { result.Msg = "参数不能为空"; return(result); } try { DataTable patientSource = this.YunZhiDal.GetPatientInfoByPTID(ptid); //通过ptid得到ptidnumber List <YZ_Patients> patientList = new ModelHandler <YZ_Patients>().TableToList(patientSource); List <DataTable> tableList = new List <DataTable>(); tableList.Add(patientSource); if (patientList != null && patientList.Count > 0) { string ptidnumber = patientList[0].PTIDNumber; DataTable projectSource = this.YunZhiDal.GetProjectListByPatientID(ptidnumber, hid); tableList.Add(projectSource); DataTable recordData = this.YunZhiDal.GetRecordInfo(hrid); tableList.Add(recordData); //药品信息 DataTable drugInfo = this.YunZhiDal.GetDrugList(hrid); tableList.Add(drugInfo); } else { tableList.Add(new DataTable()); tableList.Add(new DataTable()); tableList.Add(new DataTable()); } result.Result = 1; result.DataList = tableList; } catch (Exception ex) { Logger.Log.Error(ex.Message, ex); result.Msg = "获取患者基本信息和检查项目错误:" + ex.Message; } return(result); }
/// <summary> /// 异步完成之后执行事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void _bgWork_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { if (e.Result != null && e.Result is object[]) { try { object[] result = e.Result as object[]; string method = result[0].ToString(); YunZhiResult res = result[1] as YunZhiResult; if (res.Result == 0) { MessageBox.Show(res.Msg); return; } switch (method) { case "getrecordlist": this.SetRecordList(res.DataInfo); if (res.DataInfo != null && res.DataInfo.Rows.Count > 0) { this._bgWork.RunWorkerAsync("getpatientinfo"); } else { ClearControl(); } break; case "getpatientinfo": this.SetJiBenAndProjectInfo(res.DataList); break; } } catch (Exception ex) { Logger.Log.Error(ex.Message, ex); MessageBox.Show("异常:" + ex.Message); } } else { MessageBox.Show("参数错误"); } }
void backgroundWorker1_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { if (e.Result != null && e.Result is YunZhiResult) { YunZhiResult loginResult = e.Result as YunZhiResult; if (loginResult.Result == 1) { this._UserInfo = loginResult.DataInfo; this.DialogResult = DialogResult.OK; this.Close(); } else { MessageBox.Show(loginResult.Msg); } } this.label1.Visible = false; this.btnOK.Enabled = true; }
/// <summary>得到项目列表和客户信息</summary> /// <param name="eid"></param> /// <param name="hid"></param> /// <param name="startTime"></param> /// <param name="endTime"></param> /// <returns></returns> public YunZhiResult GetProjectListAndPatientInfo(string eid, string hid, string startTime, string endTime) { YunZhiResult result = new YunZhiResult(); try { if (string.IsNullOrEmpty(startTime) == true || string.IsNullOrEmpty(endTime) == true || string.IsNullOrEmpty(hid) == true) { result.Msg = "时间或者医院不能为空"; return(result); } if (Convert.ToDateTime(startTime) > Convert.ToDateTime(endTime)) { result.Msg = "开始日期不能大于结束日期"; return(result); } List <DataTable> tableList = new List <DataTable>(); DataTable patientTable = this.YunZhiDal.GetPatientInfoByPTID(eid); tableList.Add(patientTable); List <YZ_Patients> patientList = new ModelHandler <YZ_Patients>().TableToList(patientTable); startTime = Convert.ToDateTime(startTime).ToString("yyyy-MM-dd 00:00:00"); endTime = Convert.ToDateTime(endTime).ToString("yyyy-MM-dd 23:59:59"); if (patientList != null && patientList.Count > 0) { string idNumber = patientList[0].PTIDNumber; DataTable table = this.YunZhiDal.GetZhenLiaoBySearch(startTime, endTime, hid, idNumber); tableList.Add(table); result.Result = 1; result.DataList = tableList; } else { result.Msg = "客户不存在"; } } catch (Exception ex) { Logger.Log.Error(ex.Message, ex); result.Msg = "得到项目列表和客户信息错误:" + ex.Message; } return(result); }
void _mainBgWork_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { if (e.Result != null && e.Result is YunZhiResult) { YunZhiResult curResult = e.Result as YunZhiResult; if (curResult.Result == 0) { MessageBox.Show(curResult.Msg); } else { this.dataGridView1.DataSource = curResult.DataInfo; if (curResult.DataInfo == null || curResult.DataInfo.Rows.Count == 0) { MessageBox.Show("没有查询出来数据"); } } } this.btnSearch.Enabled = true; }
void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e) { YunZhiService service = new YunZhiService(); try { YunZhiResult loginResult = service.UserLogin(this.TxtTel, this.TxtPwd); e.Result = loginResult; } catch (Exception ex) { Logger.Log.Error("登录异常:" + ex.Message, ex); } finally { if (service != null) { service.Abort(); } } }
void _mainBgWork_DoWork(object sender, DoWorkEventArgs e) { YunZhiService service = null; try { service = new YunZhiService(); YunZhiResult result = service.QueryZhenLiaoList(this._StartDate.ToString("yyyy-MM-dd 00:00:00"), this._EndDate.ToString("yyyy-MM-dd 23:59:59"), SourceHelper.EmployeeInfo.HID, this._PatientName); e.Result = result; } catch (Exception ex) { Logger.Log.Error("获取档案信息异常:" + ex.Message, ex); } finally { if (service != null) { service.Abort(); } } }
/// <summary>获取患者信息通过患者ID</summary> /// <param name="ptid"></param> /// <returns></returns> public YunZhiResult GetPatientInfoByPTID(string ptid) { YunZhiResult result = new YunZhiResult(); try { DataTable table = this.YunZhiDal.GetPatientInfoByPTID(ptid); if (table == null || table.Rows.Count == 0) { result.Msg = "没有查询到数据"; } else { result.Result = 1; result.DataInfo = table; } } catch (Exception ex) { Logger.Log.Error(ex.Message, ex); result.Msg = "获取患者数据错误:" + ex.Message; } return(result); }
private void btnPrint_Click(object sender, EventArgs e) { try { if (string.IsNullOrEmpty(this._hrid) == true) { MessageBox.Show("请选择患者!"); return; } YunZhiService service = new YunZhiService(); try { if (System.IO.File.Exists(GetPath() + "chufang.frx") == false) { MessageBox.Show("未找到处方打印模板!"); return; } YunZhiResult res = service.GetZhenLiaoListByPTID(this._patientID, SourceHelper.EmployeeInfo.HID, this._hrid); if (res.Result == 0) { MessageBox.Show(res.Msg); return; } DataTable[] sourceList = res.DataList; //获取当前信息,然后打印 if (sourceList == null || sourceList.Length == 0) { return; } List <PrintModel> printList = new List <PrintModel>(); PrintModel model = new PrintModel(); DataTable source = sourceList[0]; List <YZ_Patients> patientList = new ModelHandler <YZ_Patients>().TableToList(source); if (patientList != null && patientList.Count > 0) { YZ_Patients patinetModel = patientList[0]; model.PTName = patinetModel.PTName; if (string.IsNullOrEmpty(patinetModel.PTBrithday) == false) { DateTime curTime = Convert.ToDateTime(patinetModel.PTBrithday); DateTime now = DateTime.Today; int age = now.Year - curTime.Year; if (curTime > now.AddYears(-age)) { age--; } model.PTNianLing = age.ToString(); } model.PTSex = patinetModel.PTSex == "0" ? "男" : "女"; } DataTable projectSource = sourceList[1]; List <YZ_Project> projectList = new ModelHandler <YZ_Project>().TableToList(projectSource); this.SetKuaiJianResult(projectList); List <YZ_Health_Record> recordList = new ModelHandler <YZ_Health_Record>().TableToList(sourceList[2]); if (recordList != null && recordList.Count > 0) { model.ZhenDuan = recordList[0].Data05; model.ZhuShu = recordList[0].Data04; } model.HosName = this.curHosName; if (sourceList[3] != null && sourceList[3].Rows != null && sourceList[3].Rows.Count > 0) { foreach (DataRow row in sourceList[3].Rows) { model.YaoPinList.Add(new YaoPinModel() { YaoPinName = row["DrugName"].ToString(), YongFa = row["DrugYF"].ToString(), YongLiang = row["DrugYL"].ToString() }); } printList.Add(model); } Report report = new Report(); report.Load(GetPath() + "chufang.frx"); report.RegisterData(printList, "CFDS"); report.Prepare(); report.ShowPrepared(); report.Dispose(); } catch (Exception ex) { Logger.Log.Error("SetJiBenAndProjectInfo异常:" + ex.Message, ex); MessageBox.Show(ex.ToString()); } } catch (Exception ex) { MessageBox.Show(ex.ToString(), "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public YunZhiResult SetDrugInfo(DataTable table) { YunZhiResult result = new YunZhiResult(); return(result); }