陈少旭 3 months ago
parent
commit
05269cbe40
1 changed files with 36 additions and 28 deletions
  1. 36 28
      controllers/sg/his_api_controller.go

+ 36 - 28
controllers/sg/his_api_controller.go View File

12689
 	return res
12689
 	return res
12690
 }
12690
 }
12691
 func Checkgd3102(c *HisApiController, patient_id int64, his_patient_id int64, admin_user_id int64, trig_scen string, order_id int64) (res Resultgd3101) {
12691
 func Checkgd3102(c *HisApiController, patient_id int64, his_patient_id int64, admin_user_id int64, trig_scen string, order_id int64) (res Resultgd3101) {
12692
-	////patient_id, _ := c.GetInt64("patient_id")
12693
-	//order_id, _ := c.GetInt64("order_id")
12694
-	////his_patient_id, _ := c.GetInt64("his_patient_id")
12695
-	////admin_user_id, _ := c.GetInt64("admin_user_id")
12696
-	//trig_scen := c.GetString("trig_scen")
12697
-	//psn_info, _ := service.GetPsnByPatientId(patient_id)
12698
-	//utils.ErrorLog("解析失败:%v", psn_info)
12699
 
12692
 
12700
 	adminUser := c.GetAdminUserInfo()
12693
 	adminUser := c.GetAdminUserInfo()
12701
 	roles, _ := service.GetAdminUserInfoByID(c.GetAdminUserInfo().CurrentOrgId, admin_user_id)
12694
 	roles, _ := service.GetAdminUserInfoByID(c.GetAdminUserInfo().CurrentOrgId, admin_user_id)
26960
 					}
26953
 					}
26961
 					var result string
26954
 					var result string
26962
 					var requestLog string
26955
 					var requestLog string
26963
-					if miConfig.Code == "H44030501364" || miConfig.Code == "H44030903432" {
26956
+					if miConfig.Code == "H44030501364" || miConfig.Code == "H44030903432" || miConfig.Code == "H44030500255" {
26964
 						var hisPrescription []*models.HisPrescription
26957
 						var hisPrescription []*models.HisPrescription
26965
 						res3101 := Checkgd3101ForOne(c, patient.ID, his, admin_user_id, "1", record_time, hisPrescription, department)
26958
 						res3101 := Checkgd3101ForOne(c, patient.ID, his, admin_user_id, "1", record_time, hisPrescription, department)
26966
 						if res3101.Infcode == 0 {
26959
 						if res3101.Infcode == 0 {
26967
 							if len(res3101.Output.Result) > 0 {
26960
 							if len(res3101.Output.Result) > 0 {
26968
-								for _, item := range res3101.Output.Result {
26969
-									if len(res3101.ErrMsg) == 0 {
26970
-										res3101.ErrMsg = item.VolaCont
26971
-									} else {
26972
-										res3101.ErrMsg = res3101.ErrMsg + "\n" + item.VolaCont
26973
-									}
26961
+								if len(res3101.Output.Result) > 0 {
26962
+									c.ServeSuccessJSON(map[string]interface{}{
26963
+										"failed_code": -10,
26964
+										"failed_type": 100,
26965
+										"msg":         res3101.Output.Result,
26966
+									})
26967
+									return
26968
+								} else {
26969
+									c.ServeSuccessJSON(map[string]interface{}{
26970
+										"failed_code": -10,
26971
+										"msg":         res3101.ErrMsg,
26972
+									})
26973
+									return
26974
 								}
26974
 								}
26975
-								c.ServeSuccessJSON(map[string]interface{}{
26976
-									"failed_code": -10,
26977
-									"msg":         res3101.ErrMsg,
26978
-								})
26979
-								return
26980
 							} else {
26975
 							} else {
26981
 
26976
 
26982
 								hour := time.Now().Format("15")
26977
 								hour := time.Now().Format("15")
27089
 							utils.ErrorLog("解析失败:%v", item.Insutype)
27084
 							utils.ErrorLog("解析失败:%v", item.Insutype)
27090
 							utils.ErrorLog("解析失败:%v", insutype)
27085
 							utils.ErrorLog("解析失败:%v", insutype)
27091
 
27086
 
27092
-
27093
 							if item.Insutype == insutype {
27087
 							if item.Insutype == insutype {
27094
 								insuplc_admdvs_temp = item.InsuplcAdmdvs
27088
 								insuplc_admdvs_temp = item.InsuplcAdmdvs
27095
 								utils.ErrorLog("解析失败:%v", insuplc_admdvs_temp)
27089
 								utils.ErrorLog("解析失败:%v", insuplc_admdvs_temp)
27098
 
27092
 
27099
 						}
27093
 						}
27100
 
27094
 
27101
-
27102
 						result, requestLog = service.Gdyb2201A(psn_info.PsnNo, insutype, IdCardNo, miConfig.OrgName, roles.UserName, ipt_otp_no, department.Name, miConfig.Code, department.Number, doctor_info.DoctorNumber, insuplc_admdvs_temp, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, id_card_type, doctor_info.UserName, record_time_two, psn_info.VerifyNumber, admin_user_id)
27095
 						result, requestLog = service.Gdyb2201A(psn_info.PsnNo, insutype, IdCardNo, miConfig.OrgName, roles.UserName, ipt_otp_no, department.Name, miConfig.Code, department.Number, doctor_info.DoctorNumber, insuplc_admdvs_temp, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, id_card_type, doctor_info.UserName, record_time_two, psn_info.VerifyNumber, admin_user_id)
27103
 						saveLog(result, requestLog, "2201A", "挂号")
27096
 						saveLog(result, requestLog, "2201A", "挂号")
27104
 					}
27097
 					}
30517
 					}
30510
 					}
30518
 					result2, src_resquest = service.Gdyb2207(his.PsnNo, his.Number, chrg_bchno, cert_no, insutype, allTotal, miConfig.OrgName, roles.UserName, miConfig.Code, his.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, med_type, his.IdCardType, tempOrder.FulamtOwnpayAmt, tempOrder.OverlmtSelfPay, tempOrder.PreselfpayAmt, tempOrder.InscpScpAmt, his.IdType, acct_used_flag, "", admin_user_id)
30511
 					result2, src_resquest = service.Gdyb2207(his.PsnNo, his.Number, chrg_bchno, cert_no, insutype, allTotal, miConfig.OrgName, roles.UserName, miConfig.Code, his.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, med_type, his.IdCardType, tempOrder.FulamtOwnpayAmt, tempOrder.OverlmtSelfPay, tempOrder.PreselfpayAmt, tempOrder.InscpScpAmt, his.IdType, acct_used_flag, "", admin_user_id)
30519
 				} else {
30512
 				} else {
30513
+					if miConfig.Code == "H44030501364" || miConfig.Code == "H44030903432" || miConfig.Code == "H44030500255" {
30514
+						result3101 := Checkgd3102(c, id, his_patient_id, admin_user_id, "7", tempOrder.ID)
30515
+						if result3101.Infcode == 0 {
30516
+							if len(result3101.Output.Result) > 0 {
30517
+								c.ServeSuccessJSON(map[string]interface{}{
30518
+									"failed_code": -10,
30519
+									"failed_type": 100,
30520
+									"msg":         result3101.Output.Result,
30521
+								})
30522
+								return
30523
+							}
30524
+						} else {
30525
+							c.ServeSuccessJSON(map[string]interface{}{
30526
+								"failed_code": -10,
30527
+								"msg":         result3101.ErrMsg,
30528
+							})
30529
+							return
30530
+						}
30531
+					}
30532
+
30520
 					if his.IdCardType == 4 {
30533
 					if his.IdCardType == 4 {
30521
 						psn_info, _ := service.GetPsnByPatientId(his.PatientId)
30534
 						psn_info, _ := service.GetPsnByPatientId(his.PatientId)
30522
 						token := psn_info.VerifyNumber
30535
 						token := psn_info.VerifyNumber
30523
 						result2, src_resquest = service.Gdyb2207(his.PsnNo, his.Number, chrg_bchno, cert_no, insutype, allTotal, miConfig.OrgName, roles.UserName, miConfig.Code, his.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, strconv.FormatInt(reg_type, 10), his.IdCardType, tempOrder.FulamtOwnpayAmt, tempOrder.OverlmtSelfPay, tempOrder.PreselfpayAmt, tempOrder.InscpScpAmt, his.IdType, acct_used_flag, token, admin_user_id)
30536
 						result2, src_resquest = service.Gdyb2207(his.PsnNo, his.Number, chrg_bchno, cert_no, insutype, allTotal, miConfig.OrgName, roles.UserName, miConfig.Code, his.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, strconv.FormatInt(reg_type, 10), his.IdCardType, tempOrder.FulamtOwnpayAmt, tempOrder.OverlmtSelfPay, tempOrder.PreselfpayAmt, tempOrder.InscpScpAmt, his.IdType, acct_used_flag, token, admin_user_id)
30524
-
30525
 					} else {
30537
 					} else {
30526
-
30527
 						result2, src_resquest = service.Gdyb2207(his.PsnNo, his.Number, chrg_bchno, cert_no, insutype, allTotal, miConfig.OrgName, roles.UserName, miConfig.Code, his.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, strconv.FormatInt(reg_type, 10), his.IdCardType, tempOrder.FulamtOwnpayAmt, tempOrder.OverlmtSelfPay, tempOrder.PreselfpayAmt, tempOrder.InscpScpAmt, his.IdType, acct_used_flag, "", admin_user_id)
30538
 						result2, src_resquest = service.Gdyb2207(his.PsnNo, his.Number, chrg_bchno, cert_no, insutype, allTotal, miConfig.OrgName, roles.UserName, miConfig.Code, his.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, strconv.FormatInt(reg_type, 10), his.IdCardType, tempOrder.FulamtOwnpayAmt, tempOrder.OverlmtSelfPay, tempOrder.PreselfpayAmt, tempOrder.InscpScpAmt, his.IdType, acct_used_flag, "", admin_user_id)
30528
-
30529
 					}
30539
 					}
30530
 				}
30540
 				}
30531
 
30541
 
30561
 							return
30571
 							return
30562
 
30572
 
30563
 						}
30573
 						}
30564
-
30565
 						res.InfRefmsgid = gzresSeven10265Two.InfRefmsgid
30574
 						res.InfRefmsgid = gzresSeven10265Two.InfRefmsgid
30566
-
30567
 						res.Output.Setlinfo.AcctMulaidPay = gzresSeven10265Two.Output.Setlinfo.AcctMulaidPay
30575
 						res.Output.Setlinfo.AcctMulaidPay = gzresSeven10265Two.Output.Setlinfo.AcctMulaidPay
30568
 						res.Output.Setlinfo.AcctPay = gzresSeven10265Two.Output.Setlinfo.AcctPay
30576
 						res.Output.Setlinfo.AcctPay = gzresSeven10265Two.Output.Setlinfo.AcctPay
30569
 						res.Output.Setlinfo.CvlservPay = gzresSeven10265Two.Output.Setlinfo.CvlservPay
30577
 						res.Output.Setlinfo.CvlservPay = gzresSeven10265Two.Output.Setlinfo.CvlservPay
32455
 						res.Infcode = infocode
32463
 						res.Infcode = infocode
32456
 
32464
 
32457
 					} else {
32465
 					} else {
32458
-						if miConfig.Code == "H44030903432" || miConfig.Code == "H44030501364" {
32466
+						if miConfig.Code == "H44030903432" || miConfig.Code == "H44030501364" || miConfig.Code == "H44030500255" {
32459
 							result3101 := Checkgd3101(c, id, his_patient_id, admin_user_id, "2", record_time, prescriptions)
32467
 							result3101 := Checkgd3101(c, id, his_patient_id, admin_user_id, "2", record_time, prescriptions)
32460
 							if result3101.Infcode == 0 {
32468
 							if result3101.Infcode == 0 {
32461
 								if len(result3101.Output.Result) > 0 {
32469
 								if len(result3101.Output.Result) > 0 {
33863
 
33871
 
33864
 							psn_info, _ := service.GetPsnByPatientId(his.PatientId)
33872
 							psn_info, _ := service.GetPsnByPatientId(his.PatientId)
33865
 							allTotal = fmt.Sprintf("%.2f", total_two)
33873
 							allTotal = fmt.Sprintf("%.2f", total_two)
33866
-							if miConfig.Code == "H44030501364" || miConfig.Code == "H44030903432" {
33874
+							if miConfig.Code == "H44030501364" || miConfig.Code == "H44030903432" || miConfig.Code == "H44030500255" {
33867
 
33875
 
33868
 								result3101 := Checkgd3102(c, id, his_patient_id, admin_user_id, "6", order.ID)
33876
 								result3101 := Checkgd3102(c, id, his_patient_id, admin_user_id, "6", order.ID)
33869
 								if result3101.Infcode == 0 {
33877
 								if result3101.Infcode == 0 {