/// <summary> /// 读卡查询病人 /// </summary> public void SearchPat() { string values = ifrmSearchPatView.searchValue; if (values == null || values == "") { throw new Exception("不能输入空字符!"); } switch (ifrmSearchPatView.SelectIndex) { case 0: dtPatlist = zy_Patlist.patientInfo.GetNccmPat_LH(SearchNccmPatType.医疗卡号, values); break; case 1: dtPatlist = zy_Patlist.patientInfo.GetNccmPat_LH(SearchNccmPatType.身份证号, values); break; case 2: dtPatlist = zy_Patlist.patientInfo.GetNccmPat_LH(SearchNccmPatType.家庭编码, values); break; case 3: dtPatlist = zy_Patlist.patientInfo.GetNccmPat_LH(SearchNccmPatType.病人姓名, values); break; case 4: #region 根据住院编号查询 int regId; try { regId = Convert.ToInt32(values.Trim()); } catch (Exception err) { throw new Exception("住院编号只能输入数字"); } IMZ_ClinicData imz_clinic = InstanceFactory.CreatMZ_ClinicDataInstance(); DataTable dt = imz_clinic.GetInpatRegInfo(regId); if (dt.Rows.Count > 0) { try { zy_Patlist.patientInfo.CureNo = dt.Select("name='住院号'").Length > 0 ? dt.Select("name='住院号'")[0][1].ToString().Trim() : ""; if (zy_Patlist.patientInfo.CureNo != null && zy_Patlist.patientInfo.CureNo != "") { zy_Patlist = zy_Patlist.GetPatInfo(zy_Patlist.patientInfo.CureNo); } zy_Patlist.patientInfo.ACCOUNTTYPE = dt.Select("name='病人类型'").Length > 0 ? dt.Select("name='病人类型'")[0][1].ToString() : ""; zy_Patlist.patientInfo.LinkAddress = dt.Select("name='户口位置'").Length > 0 ? dt.Select("name='户口位置'")[0][1].ToString() : ""; zy_Patlist.patientInfo.PatAddress = dt.Select("name='户口位置'").Length > 0 ? dt.Select("name='户口位置'")[0][1].ToString() : ""; zy_Patlist.patientInfo.LinkMan = dt.Select("name='联系人'").Length > 0 ? dt.Select("name='联系人'")[0][1].ToString() : ""; zy_Patlist.patientInfo.LinkTel = dt.Select("name='联系电话'").Length > 0 ? dt.Select("name='联系电话'")[0][1].ToString() : ""; //patinfo.PatBriDate = //dt.Select("name='联系电话'").Length > 0 ? dt.Select("name='联系电话'")[0][1].ToString() : ""; zy_Patlist.patientInfo.PATJOB = dt.Select("name='职业'").Length > 0 ? dt.Select("name='职业'")[0][1].ToString() : ""; zy_Patlist.patientInfo.PatName = dt.Select("name='姓名'").Length > 0 ? dt.Select("name='姓名'")[0][1].ToString() : ""; zy_Patlist.patientInfo.PatSex = dt.Select("name='性别'").Length > 0 ? dt.Select("name='性别'")[0][1].ToString().Replace("性", "") : ""; zy_Patlist.patientInfo.PatTEL = dt.Select("name='联系电话'").Length > 0 ? dt.Select("name='联系电话'")[0][1].ToString() : ""; zy_Patlist.DiseaseName = dt.Select("name='西医诊断'").Length > 0 ? dt.Select("name='西医诊断'")[0][1].ToString() : ""; zy_Patlist.PatType = dt.Select("name='病人类型'").Length > 0 ? dt.Select("name='病人类型'")[0][1].ToString() : ""; zy_Patlist.CureDeptCode = dt.Select("name='入院科室ID'").Length > 0 ? dt.Select("name='入院科室ID'")[0][1].ToString() : ""; zy_Patlist.CureState = dt.Select("name='病情状况'").Length > 0 ? dt.Select("name='病情状况'")[0][1].ToString() : ""; zy_Patlist.OriginDocCode = dt.Select("name='签证医生ID'").Length > 0 ? dt.Select("name='签证医生ID'")[0][1].ToString() : ""; zy_Patlist.OriginDeptCode = dt.Select("name='签证科室ID'").Length > 0 ? dt.Select("name='签证科室ID'")[0][1].ToString() : ""; string Ages = dt.Select("name='年龄'").Length > 0 ? dt.Select("name='年龄'")[0][1].ToString() : ""; if (Ages != "") { string DAge = Ages.Trim(); if (DAge.IndexOf("岁") != -1) { zy_Patlist.patientInfo.PatBriDate = DateTime.Now.AddYears(0 - Convert.ToInt32(DAge.Replace("岁", "").Trim())); } if (DAge.IndexOf("月") != -1) { zy_Patlist.patientInfo.PatBriDate = DateTime.Now.AddMonths(0 - Convert.ToInt32(DAge.Replace("月", "").Trim())); } if (DAge.IndexOf("天") != -1) { zy_Patlist.patientInfo.PatBriDate = DateTime.Now.AddDays(0 - Convert.ToInt32(DAge.Replace("天", "").Trim())); } if (DAge.IndexOf("小时") != -1) { zy_Patlist.patientInfo.PatBriDate = DateTime.Now.AddHours(0 - Convert.ToInt32(DAge.Replace("小时", "").Trim())); } } //传送到界面 view.zyPatList = zy_Patlist; } catch { } } else { throw new Exception("该住院编号没有找到任何数据!"); } #endregion break; } ifrmSearchPatView.patListInfo = dtPatlist; }