test_user 1 week geleden
bovenliggende
commit
6d6c07bcef
8 gewijzigde bestanden met toevoegingen van 348 en 283 verwijderingen
  1. 65 59
      controllers/sg/his_api_controller.go
  2. 1 1
      controllers/zh/zh_his_api_controller.go
  3. 219 219
      main.go
  4. 1 0
      models/drug.go
  5. 1 1
      models/models_3501.go
  6. 4 2
      service/his_service.go
  7. 1 1
      service/hn_service.go
  8. 56 0
      service/jx_service.go

+ 65 - 59
controllers/sg/his_api_controller.go Bestand weergeven

@@ -5380,7 +5380,7 @@ func SaleStock(org_id int64, pre models.HisPrescription, drug *models.DrugFlow,
5380 5380
 	struct3505.Bchno = "---"
5381 5381
 	struct3505.FixmedinsCode = miConfig.Code
5382 5382
 	struct3505.Code = miConfig.Code
5383
-	struct3505.FinlTrnsPric = drug.HisDoctorAdviceInfo.Price
5383
+	struct3505.FinlTrnsPric =  strconv.FormatFloat(drug.HisDoctorAdviceInfo.Price, 'f', -1, 64)
5384 5384
 
5385 5385
 	roles, _ := service.GetAdminUserInfoByID(org_id, pre.Creator)
5386 5386
 	struct3505.PrscDrName = roles.UserName
@@ -5485,7 +5485,6 @@ func SaleStock(org_id int64, pre models.HisPrescription, drug *models.DrugFlow,
5485 5485
 	} else {
5486 5486
 		struct3505.TrdnFlag = "1"
5487 5487
 	}
5488
-
5489 5488
 	if drug.HisDoctorAdviceInfo.ZeroFlag == 1 {
5490 5489
 		struct3505.TrdnFlag = "1"
5491 5490
 	}
@@ -5495,6 +5494,22 @@ func SaleStock(org_id int64, pre models.HisPrescription, drug *models.DrugFlow,
5495 5494
 
5496 5495
 	}
5497 5496
 
5497
+
5498
+	if org_id == 10610 || org_id == 10278 || org_id == 10138 || org_id == 10537{
5499
+
5500
+		if drug.HisDoctorAdviceInfo.BaseDrugLib.IsZeroFlag == 1 {
5501
+			struct3505.TrdnFlag = "1"
5502
+		}
5503
+
5504
+		if drug.HisDoctorAdviceInfo.BaseDrugLib.IsZeroFlag == 2 {
5505
+			struct3505.TrdnFlag = "0"
5506
+
5507
+		}
5508
+
5509
+	}
5510
+
5511
+
5512
+
5498 5513
 	struct3505.RtalDocno = order.Number
5499 5514
 	struct3505.PsnCertType = "01"
5500 5515
 
@@ -12025,7 +12040,7 @@ func Check3102(c *HisApiController, patient_id int64, his_patient_id int64, admi
12025 12040
 				order.RxID = strconv.FormatInt(item.ID, 10)
12026 12041
 				order.Rxno = strconv.FormatInt(item.ID, 10)
12027 12042
 				order.LongDrordFlag = "0"
12028
-				order.HilistType = "1"
12043
+				order.HilistType = "101"
12029 12044
 				order.ChrgType = "1"
12030 12045
 				order.DrordBhvr = "-"
12031 12046
 				order.HilistCode = subItem.BaseDrugLib.MedicalInsuranceNumber
@@ -12058,7 +12073,7 @@ func Check3102(c *HisApiController, patient_id int64, his_patient_id int64, admi
12058 12073
 				order.RxID = strconv.FormatInt(item.ID, 10)
12059 12074
 				order.Rxno = strconv.FormatInt(item.ID, 10)
12060 12075
 				order.LongDrordFlag = "0"
12061
-				order.HilistType = "1"
12076
+				order.HilistType = "201"
12062 12077
 				order.ChrgType = "1"
12063 12078
 				order.DrordBhvr = "-"
12064 12079
 				order.HilistCode = subItem.HisProject.MedicalCode
@@ -12092,7 +12107,7 @@ func Check3102(c *HisApiController, patient_id int64, his_patient_id int64, admi
12092 12107
 				order.RxID = strconv.FormatInt(item.ID, 10)
12093 12108
 				order.Rxno = strconv.FormatInt(item.ID, 10)
12094 12109
 				order.LongDrordFlag = "0"
12095
-				order.HilistType = "1"
12110
+				order.HilistType = "301"
12096 12111
 				order.ChrgType = "1"
12097 12112
 				order.DrordBhvr = "0"
12098 12113
 				order.HilistCode = subItem.GoodInfo.MedicalInsuranceNumber
@@ -12321,7 +12336,7 @@ func Checkgd3101ForOne(c *HisApiController, patient_id int64, his models.VMHisPa
12321 12336
 					order.RxID = strconv.FormatInt(item.ID, 10)
12322 12337
 					order.Rxno = strconv.FormatInt(item.ID, 10)
12323 12338
 					order.LongDrordFlag = "0"
12324
-					order.HilistType = "1"
12339
+					order.HilistType = "101"
12325 12340
 					order.ChrgType = "1"
12326 12341
 					order.DrordBhvr = "0"
12327 12342
 					order.HilistCode = subItem.BaseDrugLib.MedicalInsuranceNumber
@@ -12355,7 +12370,7 @@ func Checkgd3101ForOne(c *HisApiController, patient_id int64, his models.VMHisPa
12355 12370
 					order.RxID = strconv.FormatInt(item.ID, 10)
12356 12371
 					order.Rxno = strconv.FormatInt(item.ID, 10)
12357 12372
 					order.LongDrordFlag = "0"
12358
-					order.HilistType = "1"
12373
+					order.HilistType = "201"
12359 12374
 					order.ChrgType = "1"
12360 12375
 					order.DrordBhvr = "0"
12361 12376
 					order.HilistCode = subItem.HisProject.MedicalCode
@@ -12389,7 +12404,7 @@ func Checkgd3101ForOne(c *HisApiController, patient_id int64, his models.VMHisPa
12389 12404
 					order.RxID = strconv.FormatInt(item.ID, 10)
12390 12405
 					order.Rxno = strconv.FormatInt(item.ID, 10)
12391 12406
 					order.LongDrordFlag = "0"
12392
-					order.HilistType = "1"
12407
+					order.HilistType = "301"
12393 12408
 					order.ChrgType = "1"
12394 12409
 					order.DrordBhvr = "0"
12395 12410
 					order.HilistCode = subItem.GoodInfo.MedicalInsuranceNumber
@@ -12624,7 +12639,7 @@ func Checkgd3101(c *HisApiController, patient_id int64, his_patient_id int64, ad
12624 12639
 					order.RxID = strconv.FormatInt(item.ID, 10)
12625 12640
 					order.Rxno = strconv.FormatInt(item.ID, 10)
12626 12641
 					order.LongDrordFlag = "0"
12627
-					order.HilistType = "1"
12642
+					order.HilistType = "101"
12628 12643
 					order.ChrgType = "1"
12629 12644
 					order.DrordBhvr = "0"
12630 12645
 					order.HilistCode = subItem.BaseDrugLib.MedicalInsuranceNumber
@@ -12657,7 +12672,7 @@ func Checkgd3101(c *HisApiController, patient_id int64, his_patient_id int64, ad
12657 12672
 					order.RxID = strconv.FormatInt(item.ID, 10)
12658 12673
 					order.Rxno = strconv.FormatInt(item.ID, 10)
12659 12674
 					order.LongDrordFlag = "0"
12660
-					order.HilistType = "1"
12675
+					order.HilistType = "201"
12661 12676
 					order.ChrgType = "1"
12662 12677
 					order.DrordBhvr = "0"
12663 12678
 					order.HilistCode = subItem.HisProject.MedicalCode
@@ -12691,7 +12706,7 @@ func Checkgd3101(c *HisApiController, patient_id int64, his_patient_id int64, ad
12691 12706
 					order.RxID = strconv.FormatInt(item.ID, 10)
12692 12707
 					order.Rxno = strconv.FormatInt(item.ID, 10)
12693 12708
 					order.LongDrordFlag = "0"
12694
-					order.HilistType = "1"
12709
+					order.HilistType = "301"
12695 12710
 					order.ChrgType = "1"
12696 12711
 					order.DrordBhvr = "0"
12697 12712
 					order.HilistCode = subItem.GoodInfo.MedicalInsuranceNumber
@@ -13019,8 +13034,8 @@ func Checkgd3102(c *HisApiController, patient_id int64, his_patient_id int64, ad
13019 13034
 				order.RxID = strconv.FormatInt(item.ID, 10)
13020 13035
 				order.Rxno = strconv.FormatInt(item.ID, 10)
13021 13036
 				order.LongDrordFlag = "0"
13022
-				order.HilistType = "1"
13023
-				order.ChrgType = "1"
13037
+				order.HilistType = "101"
13038
+				order.ChrgType = "01"
13024 13039
 				order.DrordBhvr = "0"
13025 13040
 				order.HilistCode = subItem.BaseDrugLib.MedicalInsuranceNumber
13026 13041
 				order.HosplistName = subItem.BaseDrugLib.DrugName
@@ -13053,8 +13068,8 @@ func Checkgd3102(c *HisApiController, patient_id int64, his_patient_id int64, ad
13053 13068
 				order.RxID = strconv.FormatInt(item.ID, 10)
13054 13069
 				order.Rxno = strconv.FormatInt(item.ID, 10)
13055 13070
 				order.LongDrordFlag = "0"
13056
-				order.HilistType = "1"
13057
-				order.ChrgType = "1"
13071
+				order.HilistType = "201"
13072
+				order.ChrgType = "05"
13058 13073
 				order.DrordBhvr = "0"
13059 13074
 				order.HilistCode = subItem.HisProject.MedicalCode
13060 13075
 				order.HosplistName = subItem.HisProject.ProjectName
@@ -13087,8 +13102,8 @@ func Checkgd3102(c *HisApiController, patient_id int64, his_patient_id int64, ad
13087 13102
 				order.RxID = strconv.FormatInt(item.ID, 10)
13088 13103
 				order.Rxno = strconv.FormatInt(item.ID, 10)
13089 13104
 				order.LongDrordFlag = "0"
13090
-				order.HilistType = "1"
13091
-				order.ChrgType = "1"
13105
+				order.HilistType = "301"
13106
+				order.ChrgType = "08"
13092 13107
 				order.DrordBhvr = "0"
13093 13108
 				order.HilistCode = subItem.GoodInfo.MedicalInsuranceNumber
13094 13109
 				order.HosplistName = subItem.GoodInfo.GoodName
@@ -14826,11 +14841,13 @@ func (c *HisApiController) ReadCard() {
14826 14841
 			bas := strings.Split(basStr, "|")
14827 14842
 			basNumber := bas[1]
14828 14843
 			fmt.Println(basNumber)
14844
+			card := bas[2]
14845
+
14829 14846
 			card_sn := bas[3]
14830 14847
 			fmt.Println(card_sn)
14831 14848
 			patient, _ := service.GetPatientByNumber(basNumber, c.GetAdminUserInfo().CurrentOrgId)
14832 14849
 
14833
-			result, _ := service.Jxyb1101(basNumber, miConfig.OrgName, roles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, id_card_type, card_sn, "1", miConfig.Url, miConfig.AccessKey, patient.Name)
14850
+			result, _ := service.Jxyb11012(basNumber, miConfig.OrgName, roles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, id_card_type, card_sn, "1", miConfig.Url, miConfig.AccessKey, patient.Name,card)
14834 14851
 
14835 14852
 			//result := service.Jxyb1101(basNumber, miConfig.OrgName, roles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, id_card_type, card_sn, certificates)
14836 14853
 			var dat map[string]interface{}
@@ -15089,36 +15106,26 @@ func (c *HisApiController) ReadCard() {
15089 15106
 			}
15090 15107
 
15091 15108
 		} else if miConfig.MdtrtareaAdmvs == "360100" {
15109
+			fmt.Println(initFlag)
15110
+			fmt.Println("initFlag")
15092 15111
 
15093
-			basStr := c.GetBasBaseInfo22222()
15094
-			fmt.Println(basStr)
15095
-
15112
+			if initFlag == 0 {
15113
+				c.TestGetJiangXiBasBaseInittwo()
15114
+			}
15115
+			basStr := c.GetBasBaseInfo()
15096 15116
 			if len(basStr) == 0 {
15097 15117
 				c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeReadCardException)
15098 15118
 				return
15099 15119
 			}
15100 15120
 			fmt.Println(basStr)
15101 15121
 			bas := strings.Split(basStr, "|")
15102
-			basNumber := bas[2] //卡号
15103
-			card_sn := bas[3]   //
15104
-
15105
-			id_card_No := bas[1] //卡号
15106
-
15122
+			basNumber := bas[1]
15107 15123
 			fmt.Println(basNumber)
15124
+			card_sn := bas[3]
15108 15125
 			fmt.Println(card_sn)
15109
-			fmt.Println(id_card_No)
15110
-
15111
-			var patient service.Patients
15112
-			if len(id_card_No) == 0 {
15113
-
15114
-				patient, _ = service.GetPatientByNumber(basNumber, c.GetAdminUserInfo().CurrentOrgId)
15115
-
15116
-			} else {
15117
-				patient, _ = service.GetPatientByNumber(id_card_No, c.GetAdminUserInfo().CurrentOrgId)
15118
-
15119
-			}
15126
+			patient, _ := service.GetPatientByNumber(basNumber, c.GetAdminUserInfo().CurrentOrgId)
15120 15127
 
15121
-			result, _ := service.Jxyb1101bycard(basNumber, miConfig.OrgName, roles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, id_card_type, card_sn, "1", miConfig.Url, miConfig.AccessKey, patient.Name, patient.IdCardNo)
15128
+			result, _ := service.Jxyb1101(basNumber, miConfig.OrgName, roles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, id_card_type, card_sn, "1", miConfig.Url, miConfig.AccessKey, patient.Name)
15122 15129
 
15123 15130
 			//result := service.Jxyb1101(basNumber, miConfig.OrgName, roles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, id_card_type, card_sn, certificates)
15124 15131
 			var dat map[string]interface{}
@@ -15137,17 +15144,7 @@ func (c *HisApiController) ReadCard() {
15137 15144
 			}
15138 15145
 
15139 15146
 			if res.Infcode == 0 {
15140
-				var pateint2 service.Patients
15141
-				var err error
15142
-				if len(id_card_No) == 0 {
15143
-					pateint2, err = service.GetPatientByNumber(basNumber, c.GetAdminUserInfo().CurrentOrgId)
15144
-
15145
-				} else {
15146
-					pateint2, err = service.GetPatientByNumber(id_card_No, c.GetAdminUserInfo().CurrentOrgId)
15147
-
15148
-					//patient, _ = service.GetPatientByNumber(id_card_No, c.GetAdminUserInfo().CurrentOrgId)
15149
-
15150
-				}
15147
+				patient, err := service.GetPatientByNumber(basNumber, c.GetAdminUserInfo().CurrentOrgId)
15151 15148
 				if err == gorm.ErrRecordNotFound {
15152 15149
 					c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeNoPateintException)
15153 15150
 					return
@@ -15210,7 +15207,7 @@ func (c *HisApiController) ReadCard() {
15210 15207
 					psn := &models.HisPsn{
15211 15208
 						PsnNo: res.Output.Baseinfo.PsnNo,
15212 15209
 
15213
-						PatientId: pateint2.ID,
15210
+						PatientId: patient.ID,
15214 15211
 						Certno:    res.Output.Baseinfo.Certno,
15215 15212
 
15216 15213
 						Gend:          res.Output.Baseinfo.Gend,
@@ -15237,6 +15234,8 @@ func (c *HisApiController) ReadCard() {
15237 15234
 				return
15238 15235
 			}
15239 15236
 
15237
+
15238
+
15240 15239
 		} else if miConfig.MdtrtareaAdmvs == "430800" {
15241 15240
 			fmt.Println(initFlag)
15242 15241
 			fmt.Println("initFlag")
@@ -25796,6 +25795,8 @@ func (c *HisApiController) GetRegisterInfo() {
25796 25795
 	social_type, _ := c.GetInt64("social_type")
25797 25796
 	admin_user_id, _ := c.GetInt64("admin_user_id")
25798 25797
 	insuplc_admdvs := c.GetString("insuplc_admdvs")
25798
+	insuplc_admdvs_tt := c.GetString("insuplc_admdvs")
25799
+
25799 25800
 	mdtrt_type := c.GetString("mdtrt_type")
25800 25801
 	if id_card_type == 5 {
25801 25802
 		id_card_type = 4
@@ -27527,7 +27528,7 @@ func (c *HisApiController) GetRegisterInfo() {
27527 27528
 					}
27528 27529
 					var result string
27529 27530
 					var requestLog string
27530
-					if miConfig.Code == "H44030501364" || miConfig.Code == "H44030903432" || miConfig.Code == "H44030500255" {
27531
+					if miConfig.Code == "H44030501364" || miConfig.Code == "H44030903432" || miConfig.Code == "H44030500255" ||  miConfig.Code == "H44082500483" {
27531 27532
 						var hisPrescription []*models.HisPrescription
27532 27533
 						res3101 := Checkgd3101ForOne(c, patient.ID, his, admin_user_id, "1", record_time, hisPrescription, department)
27533 27534
 						if res3101.Infcode == 0 {
@@ -27656,17 +27657,21 @@ func (c *HisApiController) GetRegisterInfo() {
27656 27657
 
27657 27658
 						for _, item := range rf {
27658 27659
 
27659
-							utils.ErrorLog("解析失败:%v", item.Insutype)
27660
-							utils.ErrorLog("解析失败:%v", insutype)
27660
+
27661 27661
 
27662 27662
 							if item.Insutype == insutype {
27663 27663
 								insuplc_admdvs_temp = item.InsuplcAdmdvs
27664
-								utils.ErrorLog("解析失败:%v", insuplc_admdvs_temp)
27665 27664
 
27666 27665
 							}
27667 27666
 
27668 27667
 						}
27669 27668
 
27669
+						if len(insuplc_admdvs_tt) > 0{
27670
+							insuplc_admdvs_temp = insuplc_admdvs_tt
27671
+
27672
+
27673
+						}
27674
+
27670 27675
 						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)
27671 27676
 						saveLog(result, requestLog, "2201A", "挂号")
27672 27677
 					}
@@ -31125,7 +31130,7 @@ func (c *HisApiController) GetUploadInfo() {
31125 31130
 					}
31126 31131
 					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)
31127 31132
 				} else {
31128
-					if miConfig.Code == "H44030501364" || miConfig.Code == "H44030903432" || miConfig.Code == "H44030500255" {
31133
+					if miConfig.Code == "H44030501364" || miConfig.Code == "H44030903432" || miConfig.Code == "H44030500255" ||  miConfig.Code == "H44082500483" {
31129 31134
 						result3101 := Checkgd3102(c, id, his_patient_id, admin_user_id, "7", tempOrder.ID)
31130 31135
 						if result3101.Infcode == 0 {
31131 31136
 							if len(result3101.Output.Result) > 0 {
@@ -33116,7 +33121,7 @@ func (c *HisApiController) GetPreUploadInfo() {
33116 33121
 						res.Infcode = infocode
33117 33122
 
33118 33123
 					} else {
33119
-						if miConfig.Code == "H44030903432" || miConfig.Code == "H44030501364" || miConfig.Code == "H44030500255" {
33124
+						if miConfig.Code == "H44030903432" || miConfig.Code == "H44030501364" || miConfig.Code == "H44030500255"  ||  miConfig.Code == "H44082500483"{
33120 33125
 							result3101 := Checkgd3101(c, id, his_patient_id, admin_user_id, "2", record_time, prescriptions)
33121 33126
 							if result3101.Infcode == 0 {
33122 33127
 								if len(result3101.Output.Result) > 0 {
@@ -34586,7 +34591,7 @@ func (c *HisApiController) GetPreUploadInfo() {
34586 34591
 
34587 34592
 							psn_info, _ := service.GetPsnByPatientId(his.PatientId)
34588 34593
 							allTotal = fmt.Sprintf("%.2f", total_two)
34589
-							if miConfig.Code == "H44030501364" || miConfig.Code == "H44030903432" || miConfig.Code == "H44030500255" {
34594
+							if miConfig.Code == "H44030501364" || miConfig.Code == "H44030903432" || miConfig.Code == "H44030500255" ||  miConfig.Code == "H44082500483" {
34590 34595
 
34591 34596
 								result3101 := Checkgd3102(c, id, his_patient_id, admin_user_id, "6", order.ID)
34592 34597
 								if result3101.Infcode == 0 {
@@ -36746,6 +36751,7 @@ func (c *HisApiController) RefundNumber() {
36746 36751
 					"msg": "退号成功",
36747 36752
 				})
36748 36753
 				service.UpdataRegStatusTwo(his_patient_id, recordDateTime, adminUser.CurrentOrgId)
36754
+				//service.UpdataOrderStatusTen(his., recordDateTime, adminUser.CurrentOrgId)
36749 36755
 
36750 36756
 			} else {
36751 36757
 				c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
@@ -37918,7 +37924,7 @@ func (c *HisApiController) GetCheckAccount() {
37918 37924
 			baseParams.RequestUrl = miConfig.Url
37919 37925
 
37920 37926
 			if clr_type == "9903" {
37921
-				clr_type = "9994"
37927
+				clr_type = "9901"
37922 37928
 			}
37923 37929
 
37924 37930
 			businessParams := models.BusinessParams{
@@ -40020,7 +40026,7 @@ func (c *HisApiController) GetSettleAccounts() {
40020 40026
 		res.Output.Setlinfo.PsnCashPay = order.PsnCashPay
40021 40027
 
40022 40028
 		if res.Infcode == 0 {
40023
-			if adminUser.CurrentOrgId == 10215 || adminUser.CurrentOrgId == 10387 || adminUser.CurrentOrgId == 9919 || adminUser.CurrentOrgId == 10088 || adminUser.CurrentOrgId == 10150 || adminUser.CurrentOrgId == 10454 || adminUser.CurrentOrgId == 10644 || adminUser.CurrentOrgId == 10653 || adminUser.CurrentOrgId == 10210 {
40029
+			if adminUser.CurrentOrgId == 10215 || adminUser.CurrentOrgId == 10387 || adminUser.CurrentOrgId == 9919 || adminUser.CurrentOrgId == 10088 || adminUser.CurrentOrgId == 10150 || adminUser.CurrentOrgId == 10454 || adminUser.CurrentOrgId == 10644 || adminUser.CurrentOrgId == 10653{
40024 40030
 				c.ServeSuccessJSON(map[string]interface{}{
40025 40031
 					"diagnosis":            name,
40026 40032
 					"order_infos":          orderInfos,

+ 1 - 1
controllers/zh/zh_his_api_controller.go Bestand weergeven

@@ -1494,7 +1494,7 @@ func (c *ZHHisApiController) GetZHPatientInfo() {
1494 1494
 			result = string(result_byte)
1495 1495
 			saveLog(result_log, request_log, "1101", "人员基本信息获取")
1496 1496
 
1497
-		} else if miConfig.MdtrtareaAdmvs == "360399" ||  miConfig.MdtrtareaAdmvs == "361025" {
1497
+		} else if miConfig.MdtrtareaAdmvs == "360399" ||  miConfig.MdtrtareaAdmvs == "361025" || miConfig.MdtrtareaAdmvs == "360100" {
1498 1498
 			result, request_log = service.JxybZY1101(patient.IdCardNo, miConfig.OrgName, role.UserName, miConfig.Code,  miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, 2, "", 0, miConfig.Url, miConfig.AccessKey, patient.Name, patient.IdCardNo, patient.Name)
1499 1499
 			saveLog(result_log, request_log, "1101", "人员基本信息获取")
1500 1500
 		}else if miConfig.MdtrtareaAdmvs == "341203"{

+ 219 - 219
main.go Bestand weergeven

@@ -705,226 +705,226 @@ type ResultSeventeen struct {
705 705
 //}GetAllHisOrder10138
706 706
 //
707 707
 //
708
-//func GetblBatchSettleList() {
709
-//	org_id, _ := beego.AppConfig.Int64("org_id")
710
-//	var orders []*models.HisOrder
711
-//	//var orders []*models.HisOrderError
712
-//	orders, _ = service.GetAllHisOrder10138()
713
-//	for _, item := range orders {
714
-//		order_id := item.ID
715
-//		order, _ := service.GetHisOrderByIDTwo(order_id)
716
-//		if order.MedType == "14" {
717
-//			his, _ := service.GetHisPatientByNumber(order.MdtrtId)
718
-//			var patientPrescription models.HisPrescriptionInfo
719
-//			patientPrescription, _ = service.FindLastPatientPrescriptionInfo(order.UserOrgId, order.PatientId, order.SettleAccountsDate)
720
-//			doctor_info, _ := service.GetAdminUserInfoByID(order.UserOrgId, patientPrescription.DoctorId)
721
-//			department, _ := service.GetDepartMentDetail(patientPrescription.Departments)
722
-//			miConfig, _ := service.FindMedicalInsuranceInfo(order.UserOrgId)
723
-//			var configTwo []*models.HisXtDiagnoseConfig
724
-//			diagnosis_idstwo := strings.Split(his.Diagnosis, ",")
725
-//			curRoles, _ := service.GetAdminUserInfoByID(org_id, 5320)
726
-//			for _, item := range diagnosis_idstwo {
727
-//				id, _ := strconv.ParseInt(item, 10, 64)
728
-//				diagnosisConfig, _ := service.FindDiagnoseById(id)
729
-//				configTwo = append(configTwo, &diagnosisConfig)
730
-//			}
731
-//			patient, _ := service.GetPatientByIDTwo(10028, order.PatientId)
732
-//
733
-//			sickConfig, _ := service.FindSickById(his.SickType)
734
-//			//if order.MedType == "1111" || order.MedType == "1112" {
735
-//			//	order.MedType = "11"
736
-//			//}
737
-//			service.Gdyb2203d(his.PsnNo, his.Number, doctor_info.UserName, department.Name, miConfig.OrgName, "14", doctor_info.DoctorNumber, miConfig.Code, his.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, sickConfig.ContentCode, sickConfig.ClassName, curRoles.UserName, configTwo, time.Unix(his.RecordDate, 0).Format("2006-01-02 15:04:05"))
738
-//
739
-//			depart, _ := service.GetDepartMentDetail(curRoles.DepartmentId)
740
-//			pre, _ := service.GetNewHisPrescriptionByNumber(order.Number)
741
-//			doctor, _ := service.GetAdminUserInfoByID(org_id, pre.Creator)
742
-//			if order.ID == 0 {
743
-//				return
744
-//			}
745
-//			if his.BalanceAccountsType == 2 {
746
-//				continue
747
-//			}
748
-//			struct4101 := service.Struct4101{
749
-//				PsnNo:          order.PsnNo,
750
-//				MdtrtId:        order.MdtrtId,
751
-//				SetlId:         order.SetlId,
752
-//				PsnName:        order.PsnName,
753
-//				Gend:           order.Gend,
754
-//				Brdy:           his.Brdy,
755
-//				Age:            his.Age,
756
-//				Naty:           order.Naty,
757
-//				PatnCertType:   order.PsnCertType,
758
-//				Certno:         order.Certno,
759
-//				Prfs:           "90",
760
-//				ConerName:      "",
761
-//				PatnRlts:       "",
762
-//				ConerAddr:      "",
763
-//				ConerTel:       "",
764
-//				HiType:         order.Insutype,
765
-//				Insuplc:        his.InsuplcAdmdvs,
766
-//				MaindiagFlag:   "1",
767
-//				BillCode:       order.SetlId,
768
-//				BillNo:         order.SetlId,
769
-//				BizSn:          order.Number,
770
-//				PsnSelfPay:     order.PsnPartAmt,
771
-//				PsnOwnPay:      order.PsnPartAmt,
772
-//				AcctPay:        order.AcctPay,
773
-//				PsnCashpay:     order.PsnCashPay,
774
-//				HiPaymtd:       "1",
775
-//				Hsorg:          his.InsuplcAdmdvs,
776
-//				HsorgOpter:     his.InsuplcAdmdvs,
777
-//				MedinsFillPsn:  curRoles.UserName,
778
-//				MedinsFillDept: depart.Name,
779
-//				IptMedType:     "2",
780
-//				CurAddr:        patient.HomeAddress,
781
-//			}
782
-//
783
-//			struct4101.SetlBegnDate = order.SetlTime
784
-//			struct4101.SetlEndDate = order.SetlTime
785
-//
786
-//			var rf []CustomFundPay
787
-//			json.Unmarshal([]byte(order.SetlDetail), &rf)
788
-//
789
-//			//var tempFunPays []service.CustomStruct
790
-//			//var tempFunPay610100 service.CustomStruct
791
-//
792
-//			//for _, item := range rf {
793
-//			//	if item.FundPayType == "610100" {
794
-//			//		tempFunPay610100.FundPayamt, _ = decimal.NewFromFloat(tempFunPay610100.FundPayamt).Add(decimal.NewFromFloat(item.FundPayamt)).Float64()
795
-//			//		tempFunPay610100.FundPayType = item.FundPayType
796
-//			//	} else {
797
-//			//		var tempFunPay service.CustomStruct
798
-//			//		tempFunPay.FundPayamt = item.FundPayamt
799
-//			//		tempFunPay.FundPayType = item.FundPayType
800
-//			//		tempFunPays = append(tempFunPays, tempFunPay)
801
-//			//	}
802
-//			//}
803
-//			//tempFunPays = append(tempFunPays, tempFunPay610100)
804
-//			//struct4101.CustomStruct = tempFunPays
805
-//
806
-//			var tempDiaginfos []service.DiaginfoStructTwo
807
-//			var tempOpspdiseinfo2 service.OpspdiseinfoStruct
808
-//			var tempOpspdiseinfos []service.OpspdiseinfoStruct
809
-//
810
-//			diagnosis_ids := strings.Split(his.Diagnosis, ",")
811
-//			var config []*models.HisXtDiagnoseConfig
812
-//			for _, item := range diagnosis_ids {
813
-//				id, _ := strconv.ParseInt(item, 10, 64)
814
-//				if id == 24 {
815
-//
816
-//					diagnosisConfig, _ := service.FindDiagnoseById(id)
817
-//					config = append(config, &diagnosisConfig)
818
-//				}
819
-//
820
-//			}
821
-//
822
-//			for _, item := range diagnosis_ids {
823
-//
824
-//				id, _ := strconv.ParseInt(item, 10, 64)
825
-//				if id != 24 {
826
-//					diagnosisConfig, _ := service.FindDiagnoseById(id)
827
-//					config = append(config, &diagnosisConfig)
828
-//				}
829
-//
830
-//			}
831
-//
832
-//			for index, item := range config {
833
-//				if index == 0 {
834
-//					var tempDiaginfo service.DiaginfoStructTwo
835
-//					tempDiaginfo.DiagCode = item.CountryCode
836
-//					tempDiaginfo.DiagName = item.CountryContentName
837
-//					tempDiaginfo.DiagType = "1"
838
-//					tempDiaginfo.MaindiagFlag = "1"
839
-//					tempDiaginfos = append(tempDiaginfos, tempDiaginfo)
840
-//				} else {
841
-//
842
-//					var tempDiaginfo service.DiaginfoStructTwo
843
-//					tempDiaginfo.DiagCode = item.CountryCode
844
-//					tempDiaginfo.DiagName = item.CountryContentName
845
-//					tempDiaginfo.DiagType = "1"
846
-//					tempDiaginfo.MaindiagFlag = "0"
847
-//					tempDiaginfos = append(tempDiaginfos, tempDiaginfo)
848
-//				}
849
-//			}
850
-//			struct4101.Diseinfo = tempDiaginfos
851
-//			sickConfigTwo, _ := service.FindSickById(his.SickType)
852
-//			tempOpspdiseinfo2.DiagCode = sickConfigTwo.ContentCode
853
-//			tempOpspdiseinfo2.DiagName = sickConfigTwo.CountryContentName
854
-//			tempOpspdiseinfo2.OprnOprtCode = ""
855
-//			tempOpspdiseinfo2.OprnOprtName = ""
856
-//			tempOpspdiseinfos = append(tempOpspdiseinfos, tempOpspdiseinfo2)
857
-//			struct4101.OpspdiseinfoStruct = tempOpspdiseinfos
858
-//			time_arr := strings.Split(order.SetlTime, " ")
859
-//			struct4101.AdmTime = time_arr[0]
860
-//			struct4101.AdmEndTime = time_arr[0]
861
-//			struct4101.DoctorName = doctor.UserName
862
-//			struct4101.DoctorCode = doctor.DoctorNumber
863
-//
864
-//			struct4101.Ntly = "CHN"
865
-//			struct4101.AdmCaty = "A03.06"
866
-//			var res ResultSeventeen
867
-//
868
-//			result, request := service.Gdyb4101For10138(struct4101, miConfig.SecretKey, miConfig.OrgName, curRoles.UserName, miConfig.Code, his.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, org_id)
869
-//			fmt.Println(result)
870
-//			saveLog(result, request, "4101A", "清单上传")
871
-//			var dat map[string]interface{}
872
-//			if err := json.Unmarshal([]byte(result), &dat); err == nil {
873
-//				fmt.Println(dat)
874
-//			} else {
875
-//				fmt.Println(err)
876
-//			}
877
-//			userJSONBytes, _ := json.Marshal(dat)
878
-//			if err := json.Unmarshal(userJSONBytes, &res); err != nil {
879
-//				//utils.ErrorLog("解析失败:%v", err)
880
-//				//c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
881
-//				//adminUser := c.GetAdminUserInfo()
882
-//				errlog := &models.HisOrderError{
883
-//					UserOrgId: org_id,
884
-//					Ctime:     time.Now().Unix(),
885
-//					Mtime:     time.Now().Unix(),
886
-//					ErrMsg:    res.ErrMsg + "解析失败",
887
-//					Status:    1,
888
-//					PatientId: order_id,
889
-//					Stage:     10138600,
890
-//				}
891
-//				service.CreateErrMsgLog(errlog)
892
-//				continue
893
-//			}
894
-//
895
-//			if res.Infcode != 0 {
896
-//				//adminUser := c.GetAdminUserInfo()
897
-//				errlog := &models.HisOrderError{
898
-//					UserOrgId: org_id,
899
-//					Ctime:     time.Now().Unix(),
900
-//					Mtime:     time.Now().Unix(),
901
-//					ErrMsg:    res.ErrMsg,
902
-//					Status:    1,
903
-//					PatientId: order_id,
904
-//					Stage:     10138600,
905
-//				}
906
-//				service.CreateErrMsgLog(errlog)
907
-//				continue
908
-//			} else {
909
-//				hisFundSettleListResult := &models.HisFundSettleListResult{
910
-//					Number:    res.Output.SetlListId,
911
-//					Status:    1,
912
-//					Ctime:     time.Now().Unix(),
913
-//					Mtime:     time.Now().Unix(),
914
-//					UserOrgId: org_id,
915
-//					IsUpload:  1,
916
-//					OrderId:   order_id,
917
-//				}
918
-//				service.CreateUploadRecord(hisFundSettleListResult)
919
-//				continue
920
-//			}
921
-//		}
922
-//	}
923
-//}
708
+func GetblBatchSettleList() {
709
+	org_id, _ := beego.AppConfig.Int64("org_id")
710
+	var orders []*models.HisOrder
711
+	//var orders []*models.HisOrderError
712
+	orders, _ = service.GetAllHisOrder10138()
713
+	for _, item := range orders {
714
+		order_id := item.ID
715
+		order, _ := service.GetHisOrderByIDTwo(order_id)
716
+		if order.MedType == "14" {
717
+			his, _ := service.GetHisPatientByNumber(order.MdtrtId)
718
+			var patientPrescription models.HisPrescriptionInfo
719
+			patientPrescription, _ = service.FindLastPatientPrescriptionInfo(order.UserOrgId, order.PatientId, order.SettleAccountsDate)
720
+			doctor_info, _ := service.GetAdminUserInfoByID(order.UserOrgId, patientPrescription.DoctorId)
721
+			department, _ := service.GetDepartMentDetail(patientPrescription.Departments)
722
+			miConfig, _ := service.FindMedicalInsuranceInfo(order.UserOrgId)
723
+			var configTwo []*models.HisXtDiagnoseConfig
724
+			diagnosis_idstwo := strings.Split(his.Diagnosis, ",")
725
+			curRoles, _ := service.GetAdminUserInfoByID(org_id, 5318)
726
+			for _, item := range diagnosis_idstwo {
727
+				id, _ := strconv.ParseInt(item, 10, 64)
728
+				diagnosisConfig, _ := service.FindDiagnoseById(id)
729
+				configTwo = append(configTwo, &diagnosisConfig)
730
+			}
731
+			patient, _ := service.GetPatientByIDTwo(10138, order.PatientId)
732
+
733
+			sickConfig, _ := service.FindSickById(his.SickType)
734
+			//if order.MedType == "1111" || order.MedType == "1112" {
735
+			//	order.MedType = "11"
736
+			//}
737
+			service.Gdyb2203d(his.PsnNo, his.Number, doctor_info.UserName, department.Name, miConfig.OrgName, "14", doctor_info.DoctorNumber, miConfig.Code, his.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, sickConfig.ContentCode, sickConfig.ClassName, curRoles.UserName, configTwo, time.Unix(his.RecordDate, 0).Format("2006-01-02 15:04:05"))
738
+
739
+			depart, _ := service.GetDepartMentDetail(curRoles.DepartmentId)
740
+			pre, _ := service.GetNewHisPrescriptionByNumber(order.Number)
741
+			doctor, _ := service.GetAdminUserInfoByID(org_id, pre.Creator)
742
+			if order.ID == 0 {
743
+				return
744
+			}
745
+			if his.BalanceAccountsType == 2 {
746
+				continue
747
+			}
748
+			struct4101 := service.Struct4101{
749
+				PsnNo:          order.PsnNo,
750
+				MdtrtId:        order.MdtrtId,
751
+				SetlId:         order.SetlId,
752
+				PsnName:        order.PsnName,
753
+				Gend:           order.Gend,
754
+				Brdy:           his.Brdy,
755
+				Age:            his.Age,
756
+				Naty:           order.Naty,
757
+				PatnCertType:   order.PsnCertType,
758
+				Certno:         order.Certno,
759
+				Prfs:           "90",
760
+				ConerName:      "",
761
+				PatnRlts:       "",
762
+				ConerAddr:      "",
763
+				ConerTel:       "",
764
+				HiType:         order.Insutype,
765
+				Insuplc:        his.InsuplcAdmdvs,
766
+				MaindiagFlag:   "1",
767
+				BillCode:       order.SetlId,
768
+				BillNo:         order.SetlId,
769
+				BizSn:          order.Number,
770
+				PsnSelfPay:     order.PsnPartAmt,
771
+				PsnOwnPay:      order.PsnPartAmt,
772
+				AcctPay:        order.AcctPay,
773
+				PsnCashpay:     order.PsnCashPay,
774
+				HiPaymtd:       "1",
775
+				Hsorg:          his.InsuplcAdmdvs,
776
+				HsorgOpter:     his.InsuplcAdmdvs,
777
+				MedinsFillPsn:  curRoles.UserName,
778
+				MedinsFillDept: depart.Name,
779
+				IptMedType:     "2",
780
+				CurAddr:        patient.HomeAddress,
781
+			}
782
+
783
+			struct4101.SetlBegnDate = order.SetlTime
784
+			struct4101.SetlEndDate = order.SetlTime
785
+
786
+			var rf []CustomFundPay
787
+			json.Unmarshal([]byte(order.SetlDetail), &rf)
788
+
789
+			//var tempFunPays []service.CustomStruct
790
+			//var tempFunPay610100 service.CustomStruct
791
+
792
+			//for _, item := range rf {
793
+			//	if item.FundPayType == "610100" {
794
+			//		tempFunPay610100.FundPayamt, _ = decimal.NewFromFloat(tempFunPay610100.FundPayamt).Add(decimal.NewFromFloat(item.FundPayamt)).Float64()
795
+			//		tempFunPay610100.FundPayType = item.FundPayType
796
+			//	} else {
797
+			//		var tempFunPay service.CustomStruct
798
+			//		tempFunPay.FundPayamt = item.FundPayamt
799
+			//		tempFunPay.FundPayType = item.FundPayType
800
+			//		tempFunPays = append(tempFunPays, tempFunPay)
801
+			//	}
802
+			//}
803
+			//tempFunPays = append(tempFunPays, tempFunPay610100)
804
+			//struct4101.CustomStruct = tempFunPays
805
+
806
+			var tempDiaginfos []service.DiaginfoStructTwo
807
+			var tempOpspdiseinfo2 service.OpspdiseinfoStruct
808
+			var tempOpspdiseinfos []service.OpspdiseinfoStruct
809
+
810
+			diagnosis_ids := strings.Split(his.Diagnosis, ",")
811
+			var config []*models.HisXtDiagnoseConfig
812
+			for _, item := range diagnosis_ids {
813
+				id, _ := strconv.ParseInt(item, 10, 64)
814
+				if id == 24 {
815
+
816
+					diagnosisConfig, _ := service.FindDiagnoseById(id)
817
+					config = append(config, &diagnosisConfig)
818
+				}
819
+
820
+			}
821
+
822
+			for _, item := range diagnosis_ids {
823
+
824
+				id, _ := strconv.ParseInt(item, 10, 64)
825
+				if id != 24 {
826
+					diagnosisConfig, _ := service.FindDiagnoseById(id)
827
+					config = append(config, &diagnosisConfig)
828
+				}
829
+
830
+			}
831
+
832
+			for index, item := range config {
833
+				if index == 0 {
834
+					var tempDiaginfo service.DiaginfoStructTwo
835
+					tempDiaginfo.DiagCode = item.CountryCode
836
+					tempDiaginfo.DiagName = item.CountryContentName
837
+					tempDiaginfo.DiagType = "1"
838
+					tempDiaginfo.MaindiagFlag = "1"
839
+					tempDiaginfos = append(tempDiaginfos, tempDiaginfo)
840
+				} else {
841
+
842
+					var tempDiaginfo service.DiaginfoStructTwo
843
+					tempDiaginfo.DiagCode = item.CountryCode
844
+					tempDiaginfo.DiagName = item.CountryContentName
845
+					tempDiaginfo.DiagType = "1"
846
+					tempDiaginfo.MaindiagFlag = "0"
847
+					tempDiaginfos = append(tempDiaginfos, tempDiaginfo)
848
+				}
849
+			}
850
+			struct4101.Diseinfo = tempDiaginfos
851
+			sickConfigTwo, _ := service.FindSickById(his.SickType)
852
+			tempOpspdiseinfo2.DiagCode = sickConfigTwo.ContentCode
853
+			tempOpspdiseinfo2.DiagName = sickConfigTwo.CountryContentName
854
+			tempOpspdiseinfo2.OprnOprtCode = ""
855
+			tempOpspdiseinfo2.OprnOprtName = ""
856
+			tempOpspdiseinfos = append(tempOpspdiseinfos, tempOpspdiseinfo2)
857
+			struct4101.OpspdiseinfoStruct = tempOpspdiseinfos
858
+			time_arr := strings.Split(order.SetlTime, " ")
859
+			struct4101.AdmTime = time_arr[0]
860
+			struct4101.AdmEndTime = time_arr[0]
861
+			struct4101.DoctorName = doctor.UserName
862
+			struct4101.DoctorCode = doctor.DoctorNumber
863
+
864
+			struct4101.Ntly = "CHN"
865
+			struct4101.AdmCaty = "A03.06"
866
+			var res ResultSeventeen
867
+
868
+			result, request := service.Gdyb4101For10138(struct4101, miConfig.SecretKey, miConfig.OrgName, curRoles.UserName, miConfig.Code, his.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, org_id)
869
+			fmt.Println(result)
870
+			saveLog(result, request, "4101A", "清单上传")
871
+			var dat map[string]interface{}
872
+			if err := json.Unmarshal([]byte(result), &dat); err == nil {
873
+				fmt.Println(dat)
874
+			} else {
875
+				fmt.Println(err)
876
+			}
877
+			userJSONBytes, _ := json.Marshal(dat)
878
+			if err := json.Unmarshal(userJSONBytes, &res); err != nil {
879
+				//utils.ErrorLog("解析失败:%v", err)
880
+				//c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
881
+				//adminUser := c.GetAdminUserInfo()
882
+				errlog := &models.HisOrderError{
883
+					UserOrgId: org_id,
884
+					Ctime:     time.Now().Unix(),
885
+					Mtime:     time.Now().Unix(),
886
+					ErrMsg:    res.ErrMsg + "解析失败",
887
+					Status:    1,
888
+					PatientId: order_id,
889
+					Stage:     10138600,
890
+				}
891
+				service.CreateErrMsgLog(errlog)
892
+				continue
893
+			}
894
+
895
+			if res.Infcode != 0 {
896
+				//adminUser := c.GetAdminUserInfo()
897
+				errlog := &models.HisOrderError{
898
+					UserOrgId: org_id,
899
+					Ctime:     time.Now().Unix(),
900
+					Mtime:     time.Now().Unix(),
901
+					ErrMsg:    res.ErrMsg,
902
+					Status:    1,
903
+					PatientId: order_id,
904
+					Stage:     10138600,
905
+				}
906
+				service.CreateErrMsgLog(errlog)
907
+				continue
908
+			} else {
909
+				hisFundSettleListResult := &models.HisFundSettleListResult{
910
+					Number:    res.Output.SetlListId,
911
+					Status:    1,
912
+					Ctime:     time.Now().Unix(),
913
+					Mtime:     time.Now().Unix(),
914
+					UserOrgId: org_id,
915
+					IsUpload:  1,
916
+					OrderId:   order_id,
917
+				}
918
+				service.CreateUploadRecord(hisFundSettleListResult)
919
+				continue
920
+			}
921
+		}
922
+	}
923
+}
924 924
 
925 925
 func GetblbrBatchSettleList() {
926 926
 	org_id, _ := beego.AppConfig.Int64("org_id")
927
-	org_id = 10537
927
+	org_id = 10278
928 928
 	var orders []*models.HisOrder
929 929
 	//var orders []*models.HisOrderError
930 930
 	orders, _ = service.GetAllHisOrder10278()
@@ -940,13 +940,13 @@ func GetblbrBatchSettleList() {
940 940
 			miConfig, _ := service.FindMedicalInsuranceInfo(order.UserOrgId)
941 941
 			var configTwo []*models.HisXtDiagnoseConfig
942 942
 			diagnosis_idstwo := strings.Split(his.Diagnosis, ",")
943
-			curRoles, _ := service.GetAdminUserInfoByID(org_id, 2234)
943
+			curRoles, _ := service.GetAdminUserInfoByID(org_id, 2791)
944 944
 			for _, item := range diagnosis_idstwo {
945 945
 				id, _ := strconv.ParseInt(item, 10, 64)
946 946
 				diagnosisConfig, _ := service.FindDiagnoseById(id)
947 947
 				configTwo = append(configTwo, &diagnosisConfig)
948 948
 			}
949
-			patient, _ := service.GetPatientByIDTwo(10537, order.PatientId)
949
+			patient, _ := service.GetPatientByIDTwo(10278, order.PatientId)
950 950
 
951 951
 			//sickConfig, _ := service.FindSickById(his.SickType)
952 952
 			//if order.MedType == "1111" || order.MedType == "1112" {

+ 1 - 0
models/drug.go Bestand weergeven

@@ -73,6 +73,7 @@ type BaseDrugLib struct {
73 73
 	Bck01b             string    `gorm:"column:bck01b" json:"bck01b" form:"bck01b"`
74 74
 	Bby01             string    `gorm:"column:bby01" json:"bby01" form:"bby01"`
75 75
 
76
+	IsZeroFlag           int64   `gorm:"column:is_zero_flag" json:"is_zero_flag" form:"is_zero_flag"`
76 77
 
77 78
 
78 79
 	//MedicineInsurancePercentage []*MedicineInsurancePercentage `gorm:"ForeignKey:PatientId;AssociationForeignKey:PatientId" json:"monitoring_record"`

+ 1 - 1
models/models_3501.go Bestand weergeven

@@ -173,7 +173,7 @@ type Struct3505 struct {
173 173
 	ExpyEnd             string
174 174
 	RxFlag              string
175 175
 	TrdnFlag            string
176
-	FinlTrnsPric        float64
176
+	FinlTrnsPric        string
177 177
 	Rxno                string
178 178
 	RxCircFlag          string
179 179
 	RtalDocno           string

+ 4 - 2
service/his_service.go Bestand weergeven

@@ -420,6 +420,7 @@ type BaseDrugLib struct {
420 420
 	HospApprFlag         int64   `gorm:"column:hosp_appr_flag" json:"hosp_appr_flag" form:"hosp_appr_flag"`
421 421
 	LmtUsedFlag          int64   `gorm:"column:lmt_used_flag" json:"lmt_used_flag" form:"lmt_used_flag"`
422 422
 	IsUser               int64   `gorm:"column:is_user" json:"is_user" form:"is_user"`
423
+	IsZeroFlag           int64   `gorm:"column:is_zero_flag" json:"is_zero_flag" form:"is_zero_flag"`
423 424
 
424 425
 	//MedicineInsurancePercentage []*MedicineInsurancePercentage `gorm:"ForeignKey:PatientId;AssociationForeignKey:PatientId" json:"monitoring_record"`
425 426
 	OtherDrugWarehouseInfo []*OtherDrugWarehouseInfo `gorm:"ForeignKey:DrugId;AssociationForeignKey:ID" json:"stock_in"`
@@ -1569,7 +1570,7 @@ func GetAllHisOrder10106(org_id int64) (his []*models.HisOrder, err error) {
1569 1570
 	return
1570 1571
 }
1571 1572
 func GetAllHisOrder10138() (his []*models.HisOrder, err error) {
1572
-	err = readDb.Model(&models.HisOrder{}).Where("user_org_id = 10028  AND status = 1  AND  order_status = 2 AND  setl_id <> '' AND setl_time >= '2024-01-01 00:00:00'  and mdtrt_id not like '%out%'").Order("setl_time asc").Find(&his).Error
1573
+	err = readDb.Model(&models.HisOrder{}).Where("user_org_id = 10138  AND status = 1  AND  order_status = 2 AND  setl_id <> '' AND setl_time >= '2024-11-01 00:00:00'  and mdtrt_id not like '%out%'").Order("setl_time asc").Find(&his).Error
1573 1574
 	fmt.Println(err)
1574 1575
 	return
1575 1576
 }
@@ -1579,7 +1580,8 @@ func GetOrderError10138() (order []*models.HisOrderError, err error) {
1579 1580
 }
1580 1581
 
1581 1582
 func GetAllHisOrder10278() (his []*models.HisOrder, err error) {
1582
-	err = readDb.Model(&models.HisOrder{}).Where(" user_org_id = 10537  AND status = 1  AND  order_status = 2 AND setl_id <> ''  AND setl_time >= '2024-09-01 00:00:00' AND setl_time <= '2024-10-31 23:00:00' and mdtrt_id not like '%out%'").Order("setl_time asc").Find(&his).Error
1583
+
1584
+	err = readDb.Model(&models.HisOrder{}).Where(" user_org_id = 10278  AND status = 1  AND  order_status = 2 AND setl_id <> ''  AND setl_time >= '2024-11-01 00:00:00' AND setl_time <= '2024-11-30 23:00:00' and mdtrt_id not like '%out%'").Order("setl_time asc").Find(&his).Error
1583 1585
 	fmt.Println(err)
1584 1586
 	return
1585 1587
 }

+ 1 - 1
service/hn_service.go Bestand weergeven

@@ -411,7 +411,7 @@ func Hnyb2204(psnNo string, mdtrtId string, hisPrescription []*models.HisPrescri
411 411
 	//timestamp := time.Now().Unix()
412 412
 	//timestamp := time.Now().Unix()
413 413
 
414
-	//timestamp2 := time.Now().Unix()
414
+	timestamp2 := time.Now().Unix()
415 415
 
416 416
 
417 417
 	var customs []*Custom

+ 56 - 0
service/jx_service.go Bestand weergeven

@@ -70,6 +70,62 @@ func Jxyb1101(certNo string, org_name string, doctor string, fixmedins_code stri
70 70
 }
71 71
 
72 72
 
73
+func Jxyb11012(certNo string, org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string, id_card_type int64, card_sn string, certificates string, request_url string, access_key string, name string,id_card_no string) (string, string) {
74
+	timestamp := time.Now().Unix()
75
+	//生成输入报文
76
+	inputMessage := SetJXInputMessage(timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, "")
77
+
78
+	input := make(map[string]interface{})
79
+	inputData := make(map[string]interface{})
80
+	inputMessage["infno"] = "1101" // 交易编码
81
+
82
+	if certificates == "3" {
83
+		inputData["mdtrt_cert_type"] = "99" // 就诊凭证类型
84
+		inputData["certno"] = certNo        // 证件号码
85
+		inputData["psn_cert_type"] = "99"   // 人员证件类型
86
+
87
+	} else {
88
+		if id_card_type == 1 {
89
+			inputData["mdtrt_cert_type"] = "03" // 就诊凭证类型
90
+			inputData["card_sn"] = card_sn      // 卡识别码
91
+			inputData["certno"] = certNo        // 证件号码
92
+			inputData["psn_cert_type"] = "01"   // 人员证件类型
93
+			inputData["mdtrt_cert_no"] = id_card_no // 就诊凭证编号
94
+
95
+
96
+		} else if id_card_type == 4 {
97
+			inputData["mdtrt_cert_type"] = "01" // 就诊凭证类型
98
+			inputData["card_sn"] = ""      // 卡识别码
99
+			inputData["certno"] = certNo        // 证件号码
100
+			inputData["psn_cert_type"] = "01"   // 人员证件类型
101
+			inputData["mdtrt_cert_no"] = card_sn // 就诊凭证编号
102
+
103
+		}else {
104
+			inputData["mdtrt_cert_type"] = "02" // 就诊凭证类型
105
+			inputData["card_sn"] = ""           // 卡识别码
106
+			inputData["certno"] = certNo        // 证件号码
107
+			inputData["psn_cert_type"] = "01"   // 人员证件类型
108
+		}
109
+	}
110
+
111
+	inputData["begntime"] = ""          // 开始时间
112
+	inputData["psn_name"] = name          // 人员姓名
113
+	input["data"] = inputData
114
+	inputMessage["input"] = input //交易输入
115
+
116
+	var inputLog string
117
+	bytesData, _ := json.Marshal(inputMessage)
118
+	inputLog = string(bytesData)
119
+	fmt.Println(string(bytesData))
120
+	if err != nil {
121
+		fmt.Println(err.Error())
122
+		return err.Error(), ""
123
+	}
124
+	request_url = request_url + "1101"
125
+	return JXHttpRequest(request_url, access_key, secret_key, timestamp, string(bytesData), "1101"), inputLog
126
+}
127
+
128
+
73 129
 func Jxyb1101bycard(certNo string, org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string, id_card_type int64, card_sn string, certificates string, request_url string, access_key string, name string,id_card_no string) (string, string) {
74 130
 	timestamp := time.Now().Unix()
75 131
 	//生成输入报文