5 Commits 09c877b3ea ... 6d6c07bcef

Author SHA1 Message Date
  test_user 6d6c07bcef 更新 2 months ago
  test_user 816f33c5d1 Merge branch 'master' of http://git.shengws.com/csx/gdyb 2 months ago
  test_user 287aaa1075 更新 2 months ago
  test_user a749421dcb Merge branch 'master' of http://git.shengws.com/csx/gdyb 2 months ago
  test_user d54245c110 更新 2 months ago

+ 86 - 72
controllers/sg/his_api_controller.go View File

@@ -34,6 +34,8 @@ import (
34 34
 	"syscall"
35 35
 	"time"
36 36
 	"unsafe"
37
+	"github.com/go-ole/go-ole"
38
+
37 39
 )
38 40
 
39 41
 type HisApiController struct {
@@ -106,7 +108,7 @@ func HisManagerApiRegistRouters() {
106 108
 
107 109
 	beego.Router("/api/readele", &HisApiController{}, "get:ReadEleToken")
108 110
 
109
-	beego.Router("/api/2505", &HisApiController{}, "get:Get2505")
111
+	//beego.Router("/api/2505", &HisApiController{}, "get:Get2505")
110 112
 
111 113
 	beego.Router("/api/4201A", &HisApiController{}, "get:Get4201A")
112 114
 	beego.Router("/api/4202", &HisApiController{}, "get:Get4202")
@@ -174,7 +176,7 @@ func HisManagerApiRegistRouters() {
174 176
 
175 177
 	beego.Router("/api/2406", &HisApiController{}, "get:Get2406")
176 178
 
177
-	beego.Router("/api/2503", &HisApiController{}, "get:Get2503")
179
+	//beego.Router("/api/2503", &HisApiController{}, "get:Get2503")
178 180
 
179 181
 	beego.Router("/api/1318", &HisApiController{}, "get:Get1318")
180 182
 
@@ -5378,7 +5380,7 @@ func SaleStock(org_id int64, pre models.HisPrescription, drug *models.DrugFlow,
5378 5380
 	struct3505.Bchno = "---"
5379 5381
 	struct3505.FixmedinsCode = miConfig.Code
5380 5382
 	struct3505.Code = miConfig.Code
5381
-	struct3505.FinlTrnsPric = drug.HisDoctorAdviceInfo.Price
5383
+	struct3505.FinlTrnsPric =  strconv.FormatFloat(drug.HisDoctorAdviceInfo.Price, 'f', -1, 64)
5382 5384
 
5383 5385
 	roles, _ := service.GetAdminUserInfoByID(org_id, pre.Creator)
5384 5386
 	struct3505.PrscDrName = roles.UserName
@@ -5483,7 +5485,6 @@ func SaleStock(org_id int64, pre models.HisPrescription, drug *models.DrugFlow,
5483 5485
 	} else {
5484 5486
 		struct3505.TrdnFlag = "1"
5485 5487
 	}
5486
-
5487 5488
 	if drug.HisDoctorAdviceInfo.ZeroFlag == 1 {
5488 5489
 		struct3505.TrdnFlag = "1"
5489 5490
 	}
@@ -5493,6 +5494,22 @@ func SaleStock(org_id int64, pre models.HisPrescription, drug *models.DrugFlow,
5493 5494
 
5494 5495
 	}
5495 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
+
5496 5513
 	struct3505.RtalDocno = order.Number
5497 5514
 	struct3505.PsnCertType = "01"
5498 5515
 
@@ -9118,7 +9135,7 @@ func (c *HisApiController) Get3103() {
9118 9135
 	curRoles, _ := service.GetAdminUserInfoByID(c.GetAdminUserInfo().CurrentOrgId, admin_user_id)
9119 9136
 	result, requestLog := service.Gdyb3103(miConfig.OrgName, curRoles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, warm_type, warm_ids, fk_state, desc)
9120 9137
 	saveLog(result, requestLog, "3103", "反馈")
9121
-	var res2 ResultSix
9138
+	var res2 ResultSix3103
9122 9139
 	var respJSON2 map[string]interface{}
9123 9140
 	if err := json.Unmarshal([]byte(string(result)), &respJSON2); err != nil {
9124 9141
 		utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
@@ -9146,13 +9163,7 @@ func (c *HisApiController) Get3103() {
9146 9163
 	}
9147 9164
 }
9148 9165
 
9149
-func (c *HisApiController) Get3103() {
9150
-	admin_user_id, _ := c.GetInt64("admin_user_id")
9151
-	miConfig, _ := service.FindMedicalInsuranceInfo(10375)
9152
-	curRoles, _ := service.GetAdminUserInfoByID(c.GetAdminUserInfo().CurrentOrgId, admin_user_id)
9153 9166
 
9154
-	service.Gdyb2505("45000000000008100145868008", curRoles.UserName, miConfig.OrgName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, "2024-01-12 09:00:00", "2026-12-31 23:00:00", admin_user_id)
9155
-}
9156 9167
 
9157 9168
 func (c *HisApiController) Get4201A() {
9158 9169
 	order_id, _ := c.GetInt64("order_id")
@@ -12029,7 +12040,7 @@ func Check3102(c *HisApiController, patient_id int64, his_patient_id int64, admi
12029 12040
 				order.RxID = strconv.FormatInt(item.ID, 10)
12030 12041
 				order.Rxno = strconv.FormatInt(item.ID, 10)
12031 12042
 				order.LongDrordFlag = "0"
12032
-				order.HilistType = "1"
12043
+				order.HilistType = "101"
12033 12044
 				order.ChrgType = "1"
12034 12045
 				order.DrordBhvr = "-"
12035 12046
 				order.HilistCode = subItem.BaseDrugLib.MedicalInsuranceNumber
@@ -12062,7 +12073,7 @@ func Check3102(c *HisApiController, patient_id int64, his_patient_id int64, admi
12062 12073
 				order.RxID = strconv.FormatInt(item.ID, 10)
12063 12074
 				order.Rxno = strconv.FormatInt(item.ID, 10)
12064 12075
 				order.LongDrordFlag = "0"
12065
-				order.HilistType = "1"
12076
+				order.HilistType = "201"
12066 12077
 				order.ChrgType = "1"
12067 12078
 				order.DrordBhvr = "-"
12068 12079
 				order.HilistCode = subItem.HisProject.MedicalCode
@@ -12096,7 +12107,7 @@ func Check3102(c *HisApiController, patient_id int64, his_patient_id int64, admi
12096 12107
 				order.RxID = strconv.FormatInt(item.ID, 10)
12097 12108
 				order.Rxno = strconv.FormatInt(item.ID, 10)
12098 12109
 				order.LongDrordFlag = "0"
12099
-				order.HilistType = "1"
12110
+				order.HilistType = "301"
12100 12111
 				order.ChrgType = "1"
12101 12112
 				order.DrordBhvr = "0"
12102 12113
 				order.HilistCode = subItem.GoodInfo.MedicalInsuranceNumber
@@ -12325,7 +12336,7 @@ func Checkgd3101ForOne(c *HisApiController, patient_id int64, his models.VMHisPa
12325 12336
 					order.RxID = strconv.FormatInt(item.ID, 10)
12326 12337
 					order.Rxno = strconv.FormatInt(item.ID, 10)
12327 12338
 					order.LongDrordFlag = "0"
12328
-					order.HilistType = "1"
12339
+					order.HilistType = "101"
12329 12340
 					order.ChrgType = "1"
12330 12341
 					order.DrordBhvr = "0"
12331 12342
 					order.HilistCode = subItem.BaseDrugLib.MedicalInsuranceNumber
@@ -12359,7 +12370,7 @@ func Checkgd3101ForOne(c *HisApiController, patient_id int64, his models.VMHisPa
12359 12370
 					order.RxID = strconv.FormatInt(item.ID, 10)
12360 12371
 					order.Rxno = strconv.FormatInt(item.ID, 10)
12361 12372
 					order.LongDrordFlag = "0"
12362
-					order.HilistType = "1"
12373
+					order.HilistType = "201"
12363 12374
 					order.ChrgType = "1"
12364 12375
 					order.DrordBhvr = "0"
12365 12376
 					order.HilistCode = subItem.HisProject.MedicalCode
@@ -12393,7 +12404,7 @@ func Checkgd3101ForOne(c *HisApiController, patient_id int64, his models.VMHisPa
12393 12404
 					order.RxID = strconv.FormatInt(item.ID, 10)
12394 12405
 					order.Rxno = strconv.FormatInt(item.ID, 10)
12395 12406
 					order.LongDrordFlag = "0"
12396
-					order.HilistType = "1"
12407
+					order.HilistType = "301"
12397 12408
 					order.ChrgType = "1"
12398 12409
 					order.DrordBhvr = "0"
12399 12410
 					order.HilistCode = subItem.GoodInfo.MedicalInsuranceNumber
@@ -12628,7 +12639,7 @@ func Checkgd3101(c *HisApiController, patient_id int64, his_patient_id int64, ad
12628 12639
 					order.RxID = strconv.FormatInt(item.ID, 10)
12629 12640
 					order.Rxno = strconv.FormatInt(item.ID, 10)
12630 12641
 					order.LongDrordFlag = "0"
12631
-					order.HilistType = "1"
12642
+					order.HilistType = "101"
12632 12643
 					order.ChrgType = "1"
12633 12644
 					order.DrordBhvr = "0"
12634 12645
 					order.HilistCode = subItem.BaseDrugLib.MedicalInsuranceNumber
@@ -12661,7 +12672,7 @@ func Checkgd3101(c *HisApiController, patient_id int64, his_patient_id int64, ad
12661 12672
 					order.RxID = strconv.FormatInt(item.ID, 10)
12662 12673
 					order.Rxno = strconv.FormatInt(item.ID, 10)
12663 12674
 					order.LongDrordFlag = "0"
12664
-					order.HilistType = "1"
12675
+					order.HilistType = "201"
12665 12676
 					order.ChrgType = "1"
12666 12677
 					order.DrordBhvr = "0"
12667 12678
 					order.HilistCode = subItem.HisProject.MedicalCode
@@ -12695,7 +12706,7 @@ func Checkgd3101(c *HisApiController, patient_id int64, his_patient_id int64, ad
12695 12706
 					order.RxID = strconv.FormatInt(item.ID, 10)
12696 12707
 					order.Rxno = strconv.FormatInt(item.ID, 10)
12697 12708
 					order.LongDrordFlag = "0"
12698
-					order.HilistType = "1"
12709
+					order.HilistType = "301"
12699 12710
 					order.ChrgType = "1"
12700 12711
 					order.DrordBhvr = "0"
12701 12712
 					order.HilistCode = subItem.GoodInfo.MedicalInsuranceNumber
@@ -13023,8 +13034,8 @@ func Checkgd3102(c *HisApiController, patient_id int64, his_patient_id int64, ad
13023 13034
 				order.RxID = strconv.FormatInt(item.ID, 10)
13024 13035
 				order.Rxno = strconv.FormatInt(item.ID, 10)
13025 13036
 				order.LongDrordFlag = "0"
13026
-				order.HilistType = "1"
13027
-				order.ChrgType = "1"
13037
+				order.HilistType = "101"
13038
+				order.ChrgType = "01"
13028 13039
 				order.DrordBhvr = "0"
13029 13040
 				order.HilistCode = subItem.BaseDrugLib.MedicalInsuranceNumber
13030 13041
 				order.HosplistName = subItem.BaseDrugLib.DrugName
@@ -13057,8 +13068,8 @@ func Checkgd3102(c *HisApiController, patient_id int64, his_patient_id int64, ad
13057 13068
 				order.RxID = strconv.FormatInt(item.ID, 10)
13058 13069
 				order.Rxno = strconv.FormatInt(item.ID, 10)
13059 13070
 				order.LongDrordFlag = "0"
13060
-				order.HilistType = "1"
13061
-				order.ChrgType = "1"
13071
+				order.HilistType = "201"
13072
+				order.ChrgType = "05"
13062 13073
 				order.DrordBhvr = "0"
13063 13074
 				order.HilistCode = subItem.HisProject.MedicalCode
13064 13075
 				order.HosplistName = subItem.HisProject.ProjectName
@@ -13091,8 +13102,8 @@ func Checkgd3102(c *HisApiController, patient_id int64, his_patient_id int64, ad
13091 13102
 				order.RxID = strconv.FormatInt(item.ID, 10)
13092 13103
 				order.Rxno = strconv.FormatInt(item.ID, 10)
13093 13104
 				order.LongDrordFlag = "0"
13094
-				order.HilistType = "1"
13095
-				order.ChrgType = "1"
13105
+				order.HilistType = "301"
13106
+				order.ChrgType = "08"
13096 13107
 				order.DrordBhvr = "0"
13097 13108
 				order.HilistCode = subItem.GoodInfo.MedicalInsuranceNumber
13098 13109
 				order.HosplistName = subItem.GoodInfo.GoodName
@@ -14830,11 +14841,13 @@ func (c *HisApiController) ReadCard() {
14830 14841
 			bas := strings.Split(basStr, "|")
14831 14842
 			basNumber := bas[1]
14832 14843
 			fmt.Println(basNumber)
14844
+			card := bas[2]
14845
+
14833 14846
 			card_sn := bas[3]
14834 14847
 			fmt.Println(card_sn)
14835 14848
 			patient, _ := service.GetPatientByNumber(basNumber, c.GetAdminUserInfo().CurrentOrgId)
14836 14849
 
14837
-			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)
14838 14851
 
14839 14852
 			//result := service.Jxyb1101(basNumber, miConfig.OrgName, roles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, id_card_type, card_sn, certificates)
14840 14853
 			var dat map[string]interface{}
@@ -15093,36 +15106,26 @@ func (c *HisApiController) ReadCard() {
15093 15106
 			}
15094 15107
 
15095 15108
 		} else if miConfig.MdtrtareaAdmvs == "360100" {
15109
+			fmt.Println(initFlag)
15110
+			fmt.Println("initFlag")
15096 15111
 
15097
-			basStr := c.GetBasBaseInfo22222()
15098
-			fmt.Println(basStr)
15099
-
15112
+			if initFlag == 0 {
15113
+				c.TestGetJiangXiBasBaseInittwo()
15114
+			}
15115
+			basStr := c.GetBasBaseInfo()
15100 15116
 			if len(basStr) == 0 {
15101 15117
 				c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeReadCardException)
15102 15118
 				return
15103 15119
 			}
15104 15120
 			fmt.Println(basStr)
15105 15121
 			bas := strings.Split(basStr, "|")
15106
-			basNumber := bas[2] //卡号
15107
-			card_sn := bas[3]   //
15108
-
15109
-			id_card_No := bas[1] //卡号
15110
-
15122
+			basNumber := bas[1]
15111 15123
 			fmt.Println(basNumber)
15124
+			card_sn := bas[3]
15112 15125
 			fmt.Println(card_sn)
15113
-			fmt.Println(id_card_No)
15114
-
15115
-			var patient service.Patients
15116
-			if len(id_card_No) == 0 {
15117
-
15118
-				patient, _ = service.GetPatientByNumber(basNumber, c.GetAdminUserInfo().CurrentOrgId)
15119
-
15120
-			} else {
15121
-				patient, _ = service.GetPatientByNumber(id_card_No, c.GetAdminUserInfo().CurrentOrgId)
15122
-
15123
-			}
15126
+			patient, _ := service.GetPatientByNumber(basNumber, c.GetAdminUserInfo().CurrentOrgId)
15124 15127
 
15125
-			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)
15126 15129
 
15127 15130
 			//result := service.Jxyb1101(basNumber, miConfig.OrgName, roles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, id_card_type, card_sn, certificates)
15128 15131
 			var dat map[string]interface{}
@@ -15141,17 +15144,7 @@ func (c *HisApiController) ReadCard() {
15141 15144
 			}
15142 15145
 
15143 15146
 			if res.Infcode == 0 {
15144
-				var pateint2 service.Patients
15145
-				var err error
15146
-				if len(id_card_No) == 0 {
15147
-					pateint2, err = service.GetPatientByNumber(basNumber, c.GetAdminUserInfo().CurrentOrgId)
15148
-
15149
-				} else {
15150
-					pateint2, err = service.GetPatientByNumber(id_card_No, c.GetAdminUserInfo().CurrentOrgId)
15151
-
15152
-					//patient, _ = service.GetPatientByNumber(id_card_No, c.GetAdminUserInfo().CurrentOrgId)
15153
-
15154
-				}
15147
+				patient, err := service.GetPatientByNumber(basNumber, c.GetAdminUserInfo().CurrentOrgId)
15155 15148
 				if err == gorm.ErrRecordNotFound {
15156 15149
 					c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeNoPateintException)
15157 15150
 					return
@@ -15214,7 +15207,7 @@ func (c *HisApiController) ReadCard() {
15214 15207
 					psn := &models.HisPsn{
15215 15208
 						PsnNo: res.Output.Baseinfo.PsnNo,
15216 15209
 
15217
-						PatientId: pateint2.ID,
15210
+						PatientId: patient.ID,
15218 15211
 						Certno:    res.Output.Baseinfo.Certno,
15219 15212
 
15220 15213
 						Gend:          res.Output.Baseinfo.Gend,
@@ -15241,6 +15234,8 @@ func (c *HisApiController) ReadCard() {
15241 15234
 				return
15242 15235
 			}
15243 15236
 
15237
+
15238
+
15244 15239
 		} else if miConfig.MdtrtareaAdmvs == "430800" {
15245 15240
 			fmt.Println(initFlag)
15246 15241
 			fmt.Println("initFlag")
@@ -24253,6 +24248,18 @@ type ResultSix struct {
24253 24248
 	WarnMsg     interface{} `json:"warn_msg"`
24254 24249
 }
24255 24250
 
24251
+type ResultSix3103 struct {
24252
+	Cainfo      interface{} `json:"cainfo"`
24253
+	ErrMsg      string      `json:"err_msg"`
24254
+	InfRefmsgid string      `json:"inf_refmsgid"`
24255
+	Infcode     int64       `json:"infcode"`
24256
+
24257
+	RefmsgTime  string      `json:"refmsg_time"`
24258
+	RespondTime string      `json:"respond_time"`
24259
+	Signtype    interface{} `json:"signtype"`
24260
+	WarnMsg     interface{} `json:"warn_msg"`
24261
+}
24262
+
24256 24263
 type FJ3507Result struct {
24257 24264
 	Cainfo      interface{} `json:"cainfo"`
24258 24265
 	ErrMsg      string      `json:"err_msg"`
@@ -25788,6 +25795,8 @@ func (c *HisApiController) GetRegisterInfo() {
25788 25795
 	social_type, _ := c.GetInt64("social_type")
25789 25796
 	admin_user_id, _ := c.GetInt64("admin_user_id")
25790 25797
 	insuplc_admdvs := c.GetString("insuplc_admdvs")
25798
+	insuplc_admdvs_tt := c.GetString("insuplc_admdvs")
25799
+
25791 25800
 	mdtrt_type := c.GetString("mdtrt_type")
25792 25801
 	if id_card_type == 5 {
25793 25802
 		id_card_type = 4
@@ -27519,7 +27528,7 @@ func (c *HisApiController) GetRegisterInfo() {
27519 27528
 					}
27520 27529
 					var result string
27521 27530
 					var requestLog string
27522
-					if miConfig.Code == "H44030501364" || miConfig.Code == "H44030903432" || miConfig.Code == "H44030500255" {
27531
+					if miConfig.Code == "H44030501364" || miConfig.Code == "H44030903432" || miConfig.Code == "H44030500255" ||  miConfig.Code == "H44082500483" {
27523 27532
 						var hisPrescription []*models.HisPrescription
27524 27533
 						res3101 := Checkgd3101ForOne(c, patient.ID, his, admin_user_id, "1", record_time, hisPrescription, department)
27525 27534
 						if res3101.Infcode == 0 {
@@ -27529,7 +27538,7 @@ func (c *HisApiController) GetRegisterInfo() {
27529 27538
 										"failed_code": -10,
27530 27539
 										"failed_type": 100,
27531 27540
 										"warm_type":   1,
27532
-										"msg":         res3101.Output.Result,
27541
+										"msg":         res3101,
27533 27542
 									})
27534 27543
 									return
27535 27544
 								} else {
@@ -27648,17 +27657,21 @@ func (c *HisApiController) GetRegisterInfo() {
27648 27657
 
27649 27658
 						for _, item := range rf {
27650 27659
 
27651
-							utils.ErrorLog("解析失败:%v", item.Insutype)
27652
-							utils.ErrorLog("解析失败:%v", insutype)
27660
+
27653 27661
 
27654 27662
 							if item.Insutype == insutype {
27655 27663
 								insuplc_admdvs_temp = item.InsuplcAdmdvs
27656
-								utils.ErrorLog("解析失败:%v", insuplc_admdvs_temp)
27657 27664
 
27658 27665
 							}
27659 27666
 
27660 27667
 						}
27661 27668
 
27669
+						if len(insuplc_admdvs_tt) > 0{
27670
+							insuplc_admdvs_temp = insuplc_admdvs_tt
27671
+
27672
+
27673
+						}
27674
+
27662 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)
27663 27676
 						saveLog(result, requestLog, "2201A", "挂号")
27664 27677
 					}
@@ -31117,7 +31130,7 @@ func (c *HisApiController) GetUploadInfo() {
31117 31130
 					}
31118 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)
31119 31132
 				} else {
31120
-					if miConfig.Code == "H44030501364" || miConfig.Code == "H44030903432" || miConfig.Code == "H44030500255" {
31133
+					if miConfig.Code == "H44030501364" || miConfig.Code == "H44030903432" || miConfig.Code == "H44030500255" ||  miConfig.Code == "H44082500483" {
31121 31134
 						result3101 := Checkgd3102(c, id, his_patient_id, admin_user_id, "7", tempOrder.ID)
31122 31135
 						if result3101.Infcode == 0 {
31123 31136
 							if len(result3101.Output.Result) > 0 {
@@ -31125,7 +31138,7 @@ func (c *HisApiController) GetUploadInfo() {
31125 31138
 									"failed_code": -10,
31126 31139
 									"failed_type": 100,
31127 31140
 									"warm_type":   2,
31128
-									"msg":         result3101.Output.Result,
31141
+									"msg":         result3101,
31129 31142
 								})
31130 31143
 								return
31131 31144
 							}
@@ -33108,7 +33121,7 @@ func (c *HisApiController) GetPreUploadInfo() {
33108 33121
 						res.Infcode = infocode
33109 33122
 
33110 33123
 					} else {
33111
-						if miConfig.Code == "H44030903432" || miConfig.Code == "H44030501364" || miConfig.Code == "H44030500255" {
33124
+						if miConfig.Code == "H44030903432" || miConfig.Code == "H44030501364" || miConfig.Code == "H44030500255"  ||  miConfig.Code == "H44082500483"{
33112 33125
 							result3101 := Checkgd3101(c, id, his_patient_id, admin_user_id, "2", record_time, prescriptions)
33113 33126
 							if result3101.Infcode == 0 {
33114 33127
 								if len(result3101.Output.Result) > 0 {
@@ -33116,7 +33129,7 @@ func (c *HisApiController) GetPreUploadInfo() {
33116 33129
 										"failed_code": -10,
33117 33130
 										"failed_type": 100,
33118 33131
 										"warm_type":   1,
33119
-										"msg":         result3101.Output.Result,
33132
+										"msg":         result3101,
33120 33133
 									})
33121 33134
 									return
33122 33135
 								} else {
@@ -34578,7 +34591,7 @@ func (c *HisApiController) GetPreUploadInfo() {
34578 34591
 
34579 34592
 							psn_info, _ := service.GetPsnByPatientId(his.PatientId)
34580 34593
 							allTotal = fmt.Sprintf("%.2f", total_two)
34581
-							if miConfig.Code == "H44030501364" || miConfig.Code == "H44030903432" || miConfig.Code == "H44030500255" {
34594
+							if miConfig.Code == "H44030501364" || miConfig.Code == "H44030903432" || miConfig.Code == "H44030500255" ||  miConfig.Code == "H44082500483" {
34582 34595
 
34583 34596
 								result3101 := Checkgd3102(c, id, his_patient_id, admin_user_id, "6", order.ID)
34584 34597
 								if result3101.Infcode == 0 {
@@ -34587,7 +34600,7 @@ func (c *HisApiController) GetPreUploadInfo() {
34587 34600
 											"failed_code": -10,
34588 34601
 											"failed_type": 100,
34589 34602
 											"warm_type":   2,
34590
-											"msg":         result3101.Output.Result,
34603
+											"msg":         result3101,
34591 34604
 										})
34592 34605
 										return
34593 34606
 									} else {
@@ -36738,6 +36751,7 @@ func (c *HisApiController) RefundNumber() {
36738 36751
 					"msg": "退号成功",
36739 36752
 				})
36740 36753
 				service.UpdataRegStatusTwo(his_patient_id, recordDateTime, adminUser.CurrentOrgId)
36754
+				//service.UpdataOrderStatusTen(his., recordDateTime, adminUser.CurrentOrgId)
36741 36755
 
36742 36756
 			} else {
36743 36757
 				c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
@@ -37910,7 +37924,7 @@ func (c *HisApiController) GetCheckAccount() {
37910 37924
 			baseParams.RequestUrl = miConfig.Url
37911 37925
 
37912 37926
 			if clr_type == "9903" {
37913
-				clr_type = "9994"
37927
+				clr_type = "9901"
37914 37928
 			}
37915 37929
 
37916 37930
 			businessParams := models.BusinessParams{
@@ -40012,7 +40026,7 @@ func (c *HisApiController) GetSettleAccounts() {
40012 40026
 		res.Output.Setlinfo.PsnCashPay = order.PsnCashPay
40013 40027
 
40014 40028
 		if res.Infcode == 0 {
40015
-			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{
40016 40030
 				c.ServeSuccessJSON(map[string]interface{}{
40017 40031
 					"diagnosis":            name,
40018 40032
 					"order_infos":          orderInfos,

+ 1 - 1
controllers/zh/zh_his_api_controller.go View File

@@ -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 View File

@@ -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 View File

@@ -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 View File

@@ -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 View File

@@ -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
 }

+ 7 - 2
service/hn_service.go View File

@@ -413,14 +413,15 @@ func Hnyb2204(psnNo string, mdtrtId string, hisPrescription []*models.HisPrescri
413 413
 
414 414
 	timestamp2 := time.Now().Unix()
415 415
 
416
-	tempTime := time.Unix(timestamp2, 0)
417
-	timeFormatOne := tempTime.Format("2006-01-02 15:04:05")
416
+
418 417
 	var customs []*Custom
419 418
 	for _, item := range hisPrescription {
420 419
 		//tm := time.Unix(item.PreTime, 0)
421 420
 
422 421
 		if item.Type == 1 { //药品
423 422
 			for _, subItem := range item.HisDoctorAdviceInfo {
423
+				tempTime := time.Unix(subItem.StartTime, 0)
424
+				timeFormatOne := tempTime.Format("2006-01-02 15:04:05")
424 425
 				if len(subItem.BaseDrugLib.MedicalInsuranceNumber) > 0 {
425 426
 					//var randNum int
426 427
 					//randNum = rand.Intn(10000) + 1000
@@ -449,6 +450,8 @@ func Hnyb2204(psnNo string, mdtrtId string, hisPrescription []*models.HisPrescri
449 450
 
450 451
 		if item.Type == 2 { //项目
451 452
 			for _, subItem := range item.HisPrescriptionProject {
453
+				tempTime := time.Unix(subItem.StartTime, 0)
454
+				timeFormatOne := tempTime.Format("2006-01-02 15:04:05")
452 455
 				//var randNum int
453 456
 				//randNum = rand.Intn(10000) + 1000
454 457
 				if subItem.Type == 2 {
@@ -471,6 +474,8 @@ func Hnyb2204(psnNo string, mdtrtId string, hisPrescription []*models.HisPrescri
471 474
 					}
472 475
 
473 476
 				} else if subItem.Type == 3 {
477
+					tempTime := time.Unix(subItem.StartTime, 0)
478
+					timeFormatOne := tempTime.Format("2006-01-02 15:04:05")
474 479
 					if len(subItem.GoodInfo.MedicalInsuranceNumber) > 0 {
475 480
 						cnt, _ := strconv.ParseFloat(subItem.Count, 64)
476 481
 

+ 56 - 0
service/jx_service.go View File

@@ -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
 	//生成输入报文