public AuditContent AuditTestThroughDll(AuditContent content) { var exception = new Exception(); AuditContent auditResponseData = new AuditContent(); try { var postContent = new StringBuilder(JSON.Serialize(Mapping(content), option)); //Dlink(new StringBuilder(authToken), new StringBuilder(PublicType.Audit), postContent, new StringBuilder(baseUrl), Int32.Parse(timeOut) * 1000); auditResponseData = JSON.Deserialize<AuditContent>(postContent.ToString(), option); } catch (Win32Exception ex) { //exception = ex; //auditResponseData.Success = "F"; //auditResponseData.ErrorCode = ""; //auditResponseData.ErrorMsg = ex.Message; } return auditResponseData; }
public AuditContent Mapping(AuditContent auditContent) { //单位代码 string unitCode = ""; //外部代码 string externalCode = ""; //结算类型 string settlementType = ""; //获取外部代码跟单位代码 string sql = "Select dwdm,wbbh from cw_khxx where brbh ='" + auditContent.CardNo + "'"; using (OracleConnection con = new OracleConnection(connectionString)) { con.Open(); OracleCommand command = new OracleCommand(sql, con); var reader = command.ExecuteReader(); while (reader.Read()) { unitCode = reader.GetValue(0).ToString(); externalCode = reader.GetValue(1).ToString(); } } //转换医疗类别,如果就诊类型是门诊,并且是普通门诊的话要判断是否为慢病 if (auditContent.VisitType == "2") { if (auditContent.MedicineType == "02") { sql = "select count(*) from yl_zlhd where zlhdid="+auditContent.VisitNo+" and tbbm is not null"; using (OracleConnection con=new OracleConnection(connectionString)) { con.Open(); OracleCommand command = new OracleCommand(sql,con); int result =Int32.Parse(command.ExecuteScalar().ToString()); //如果大于0表示慢病 if (result>0) { auditContent.MedicineType = "03"; } } } } var medicalTypes = GetMapping("medicalTypes", "SELECT distinct BDDM,SBDM FROM CW_YBDZ_YGYB WHERE DZLB='yllb' AND ZTBZ=1"); if (medicalTypes.ContainsKey(auditContent.MedicineType)) { auditContent.MedicineType = medicalTypes[auditContent.MedicineType]; } //把本地医生编号转换为社保医生编号 auditContent.DoctorCode = GetDoctorCode(auditContent.DoctorCode, unitCode, externalCode); //科室医保编号 PB端处理 var deptNOs = GetMapping("deptNOs", "SELECT distinct ZKID,SBKSDM FROM CW_YB_KSDZ"); if (deptNOs.ContainsKey(auditContent.MedicalDeptCode)) { auditContent.MedicalDeptCode = deptNOs[auditContent.MedicalDeptCode]; } var diagnoses = GetMapping("diagnoses", "SELECT distinct ICD,SBBM FROM YLGZ3.YL_ZD"); //诊断代码 foreach (var diagnose in auditContent.Diagnoses) { if (diagnoses.ContainsKey(diagnose.DiagnoseCode)) { diagnose.DiagnoseCode = diagnoses[diagnose.DiagnoseCode]; } } //剂型类别 var doseForms = GetMapping("doseForms", "SELECT distinct BDDM,SBDM FROM CW_YBDZ_YGYB WHERE DZLB='jxlb' AND ZTBZ=1 "); //剂量单位 var singleDoseUnits = GetMapping("singleDoseUnits", "SELECT distinct BDDM,SBDM FROM CW_YBDZ_YGYB WHERE DZLB='jldw' AND ZTBZ=1 "); //给药途径 var deliverWays = GetMapping("deliverWays", "SELECT distinct BDDM,SBDM FROM CW_YBDZ_YGYB WHERE DZLB='gytj' AND ZTBZ=1 "); //药品使用频次 var takeFrequences = GetMapping("takeFrequences", "SELECT distinct BDDM,SBDM FROM CW_YBDZ_YGYB WHERE DZLB='ypsypc' AND ZTBZ=1 "); if (unitCode != "") { if (unitCode.Substring(0, 1) == "A") { settlementType = "02"; } else { settlementType = "01"; } } foreach (var adviceDetail in auditContent.AdviceDetails) { if (adviceDetail.HospitalCode != "0") { adviceDetail.ProjectCode = GetProject(adviceDetail.HospitalCode, settlementType, adviceDetail.ProjectType == "1" ? "yp" : "zl"); } if (doseForms.ContainsKey(adviceDetail.DoseForm)) { adviceDetail.DoseForm = doseForms[adviceDetail.DoseForm]; } if (singleDoseUnits.ContainsKey(adviceDetail.SingleDoseUnit)) { adviceDetail.SingleDoseUnit = singleDoseUnits[adviceDetail.SingleDoseUnit]; } if (deliverWays.ContainsKey(adviceDetail.DeliverWay)) { adviceDetail.DeliverWay = deliverWays[adviceDetail.DeliverWay]; } if (takeFrequences.ContainsKey(adviceDetail.TakeFrequence)) { adviceDetail.TakeFrequence = takeFrequences[adviceDetail.TakeFrequence]; } } return auditContent; }