Browse Source

Merge branch 'master' of http://git.shengws.com/csx/gdyb

test_user 6 days ago
parent
commit
993b97da72
2 changed files with 157 additions and 145 deletions
  1. 132 53
      controllers/sg/his_api_controller.go
  2. 25 92
      service/ah_dianzichufang.go

+ 132 - 53
controllers/sg/his_api_controller.go View File

34
 	"syscall"
34
 	"syscall"
35
 	"time"
35
 	"time"
36
 	"unsafe"
36
 	"unsafe"
37
-	"github.com/go-ole/go-ole"
38
-
39
 )
37
 )
40
 
38
 
41
 type HisApiController struct {
39
 type HisApiController struct {
5380
 	struct3505.Bchno = "---"
5378
 	struct3505.Bchno = "---"
5381
 	struct3505.FixmedinsCode = miConfig.Code
5379
 	struct3505.FixmedinsCode = miConfig.Code
5382
 	struct3505.Code = miConfig.Code
5380
 	struct3505.Code = miConfig.Code
5383
-	struct3505.FinlTrnsPric =  strconv.FormatFloat(drug.HisDoctorAdviceInfo.Price, 'f', -1, 64)
5381
+	struct3505.FinlTrnsPric = strconv.FormatFloat(drug.HisDoctorAdviceInfo.Price, 'f', -1, 64)
5384
 
5382
 
5385
 	roles, _ := service.GetAdminUserInfoByID(org_id, pre.Creator)
5383
 	roles, _ := service.GetAdminUserInfoByID(org_id, pre.Creator)
5386
 	struct3505.PrscDrName = roles.UserName
5384
 	struct3505.PrscDrName = roles.UserName
5494
 
5492
 
5495
 	}
5493
 	}
5496
 
5494
 
5497
-
5498
-	if org_id == 10610 || org_id == 10278 || org_id == 10138 || org_id == 10537{
5495
+	if org_id == 10610 || org_id == 10278 || org_id == 10138 || org_id == 10537 {
5499
 
5496
 
5500
 		if drug.HisDoctorAdviceInfo.BaseDrugLib.IsZeroFlag == 1 {
5497
 		if drug.HisDoctorAdviceInfo.BaseDrugLib.IsZeroFlag == 1 {
5501
 			struct3505.TrdnFlag = "1"
5498
 			struct3505.TrdnFlag = "1"
5508
 
5505
 
5509
 	}
5506
 	}
5510
 
5507
 
5511
-
5512
-
5513
 	struct3505.RtalDocno = order.Number
5508
 	struct3505.RtalDocno = order.Number
5514
 	struct3505.PsnCertType = "01"
5509
 	struct3505.PsnCertType = "01"
5515
 
5510
 
8085
 			drug.MedinsListCodg = subItem.BaseDrugLib.MedicalInsuranceNumber
8080
 			drug.MedinsListCodg = subItem.BaseDrugLib.MedicalInsuranceNumber
8086
 			drug.RxItemTypeCode = "11"
8081
 			drug.RxItemTypeCode = "11"
8087
 
8082
 
8088
-			drug.DrugDosform = "乳膏剂" //TODO
8083
+			drug.DrugDosform = "剂" //TODO
8089
 			if subItem.BaseDrugLib.MinUnit != subItem.BaseDrugLib.DoseUnit {
8084
 			if subItem.BaseDrugLib.MinUnit != subItem.BaseDrugLib.DoseUnit {
8090
 				drug.DrugSpec = subItem.BaseDrugLib.Dose + subItem.BaseDrugLib.DoseUnit + "*" + strconv.FormatInt(subItem.BaseDrugLib.MinNumber, 10) + subItem.BaseDrugLib.MinUnit + "/" + subItem.BaseDrugLib.MaxUnit
8085
 				drug.DrugSpec = subItem.BaseDrugLib.Dose + subItem.BaseDrugLib.DoseUnit + "*" + strconv.FormatInt(subItem.BaseDrugLib.MinNumber, 10) + subItem.BaseDrugLib.MinUnit + "/" + subItem.BaseDrugLib.MaxUnit
8091
 			}
8086
 			}
8157
 		cFYLJG001.Mdtrtinfo.MaindiagCode = "N18.500"
8152
 		cFYLJG001.Mdtrtinfo.MaindiagCode = "N18.500"
8158
 		cFYLJG001.Mdtrtinfo.MaindiagName = "慢性肾脏病5期"
8153
 		cFYLJG001.Mdtrtinfo.MaindiagName = "慢性肾脏病5期"
8159
 
8154
 
8160
-		//memo := make(map[string]interface{})
8161
-		//inputData := make(map[string]interface{}, 0)
8162
-
8163
-		//type MyData struct {
8164
-		//	Insutype string `json:"insutype"`
8165
-		//}
8166
-		//
8167
-		//	data := MyData{
8168
-		//	Insutype: his.Insutype,
8169
-		//}
8170
-		//
8171
-
8172
 		diagnosis_ids := strings.Split(info.Diagnosis, ",")
8155
 		diagnosis_ids := strings.Split(info.Diagnosis, ",")
8173
 		var config []*models.HisXtDiagnoseConfig
8156
 		var config []*models.HisXtDiagnoseConfig
8174
 		for _, item := range diagnosis_ids {
8157
 		for _, item := range diagnosis_ids {
8208
 			}
8191
 			}
8209
 		}
8192
 		}
8210
 		if miConfig.MdtrtareaAdmvs == "340699" {
8193
 		if miConfig.MdtrtareaAdmvs == "340699" {
8211
-			//result, request := service.GetAHCFYLJG001(miConfig.OrgName, curRoles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, cFYLJG001, his.Insutype)
8212
-			//saveLog(result, request, "GetCFYLJG001", "GetCFYLJG001")
8194
+			result, request := service.GetAHCFYLJG001("http://10.66.149.64:8080/epc/api", cFYLJG001, his.Insutype)
8195
+			saveLog(result, request, "GetCFYLJG001", "GetCFYLJG001")
8196
+			var res ResultCFYLJG001
8197
+			var respJSON2 map[string]interface{}
8198
+			if err := json.Unmarshal([]byte(string(result)), &respJSON2); err != nil {
8199
+				utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
8200
+				c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
8201
+				return
8202
+			}
8203
+			userJSONBytes2, _ := json.Marshal(respJSON2)
8204
+			if err := json.Unmarshal(userJSONBytes2, &res); err != nil {
8205
+				utils.ErrorLog("解析失败:%v", err)
8206
+				c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
8207
+				return
8208
+			}
8209
+			if res.Infcode == -1 {
8210
+				c.ServeSuccessJSON(map[string]interface{}{
8211
+					"failed_code": -10,
8212
+					"msg":         res.ErrMsg,
8213
+				})
8214
+				return
8215
+
8216
+			} else {
8217
+				var flow models.HisPrescriptionFlow
8218
+				flow.Ctime = time.Now().Unix()
8219
+				flow.SignDigest = ""
8220
+				flow.RxTraceCode = res.Output.RxTraceCode
8221
+				flow.HiRxno = res.Output.HiRxno
8222
+				flow.MID = his.Number
8223
+				flow.Status = 1
8224
+				flow.DCode = doctor_info.DoctorNumber
8225
+				flow.OriginalRxFile = ""
8226
+				flow.OriginalValue = ""
8227
+				flow.SignCertDn = ""
8228
+				flow.UserOrgId = c.GetAdminUserInfo().CurrentOrgId
8229
+				flow.SignCertSn = ""
8230
+				flow.Mtime = time.Now().Unix()
8231
+
8232
+				service.Createflow(&flow)
8233
+				c.ServeSuccessJSON(map[string]interface{}{
8234
+					"msg": "上传成功",
8235
+				})
8236
+			}
8213
 
8237
 
8214
 		} else {
8238
 		} else {
8215
 			result, request := service.GetCFYLJG001(miConfig.OrgName, curRoles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, cFYLJG001, his.Insutype)
8239
 			result, request := service.GetCFYLJG001(miConfig.OrgName, curRoles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, cFYLJG001, his.Insutype)
8246
 				flow.OriginalRxFile = ""
8270
 				flow.OriginalRxFile = ""
8247
 				flow.OriginalValue = ""
8271
 				flow.OriginalValue = ""
8248
 				flow.SignCertDn = ""
8272
 				flow.SignCertDn = ""
8249
-				flow.UserOrgId = 10454
8273
+				flow.UserOrgId = c.GetAdminUserInfo().CurrentOrgId
8250
 				flow.SignCertSn = ""
8274
 				flow.SignCertSn = ""
8251
 				flow.Mtime = time.Now().Unix()
8275
 				flow.Mtime = time.Now().Unix()
8252
 
8276
 
8257
 			}
8281
 			}
8258
 		}
8282
 		}
8259
 
8283
 
8260
-
8261
 	}
8284
 	}
8262
 }
8285
 }
8286
+
8263
 func (c *HisApiController) GetCFYLJG002() {
8287
 func (c *HisApiController) GetCFYLJG002() {
8264
 	admin_user_id, _ := c.GetInt64("admin_user_id")
8288
 	admin_user_id, _ := c.GetInt64("admin_user_id")
8265
 	his_patient_id, _ := c.GetInt64("his_patient_id")
8289
 	his_patient_id, _ := c.GetInt64("his_patient_id")
8330
 	fmt.Println(err)
8354
 	fmt.Println(err)
8331
 
8355
 
8332
 	if miConfig.MdtrtareaAdmvs == "340699" {
8356
 	if miConfig.MdtrtareaAdmvs == "340699" {
8333
-		//result, request := service.GetAHCFYLJG002(miConfig.OrgName, curRoles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, encoded, rx_encoded, "")
8334
-		//saveLog(result, request, "GetCFYLJG002", "GetCFYLJG002")
8357
+		result, request := service.GetAHCFYLJG002(miConfig.Code, "http://10.66.149.64:8080/epc/api", encoded, rx_encoded, "")
8358
+		saveLog(result, request, "GetCFYLJG002", "GetCFYLJG002")
8335
 
8359
 
8360
+		var res2 Result002
8361
+		var respJSON2 map[string]interface{}
8362
+		if err := json.Unmarshal([]byte(string(result)), &respJSON2); err != nil {
8363
+			utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
8364
+			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
8365
+			return
8366
+		}
8367
+		userJSONBytes2, _ := json.Marshal(respJSON2)
8368
+		if err := json.Unmarshal(userJSONBytes2, &res2); err != nil {
8369
+			utils.ErrorLog("解析失败:%v", err)
8370
+			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
8371
+			return
8372
+		}
8373
+		if res2.Infcode == 0 {
8374
+			flow.Ctime = time.Now().Unix()
8375
+			flow.SignDigest = res2.Output.SignDigest
8376
+			flow.RxFile = res2.Output.RxFile
8377
+			flow.MID = his.Number
8378
+			flow.Status = 1
8379
+			flow.DCode = doctor_info.DoctorNumber
8380
+			flow.OriginalRxFile = rx_encoded
8381
+			flow.OriginalValue = encoded
8382
+			flow.SignCertDn = res2.Output.SignCertDn
8383
+			flow.SignCertSn = res2.Output.SignCertSn
8384
+			flow.Mtime = time.Now().Unix()
8385
+			service.Saveflow(flow)
8386
+			c.ServeSuccessJSON(map[string]interface{}{
8387
+				"msg": "预签名成功",
8388
+			})
8389
+		} else {
8390
+			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
8391
+			return
8392
+		}
8336
 	} else {
8393
 	} else {
8337
 		result, request := service.GetCFYLJG002(miConfig.OrgName, curRoles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, encoded, rx_encoded, "")
8394
 		result, request := service.GetCFYLJG002(miConfig.OrgName, curRoles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, encoded, rx_encoded, "")
8338
 		//result, request := service.GetCFYLJG001(miConfig.OrgName, curRoles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, cFYLJG001,his.Insutype)
8395
 		//result, request := service.GetCFYLJG001(miConfig.OrgName, curRoles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, cFYLJG001,his.Insutype)
8414
 	cFYLJG003.Certno = his.Certno
8471
 	cFYLJG003.Certno = his.Certno
8415
 	cFYLJG003.FixmedinsName = miConfig.OrgName
8472
 	cFYLJG003.FixmedinsName = miConfig.OrgName
8416
 	cFYLJG003.FixmedinsCode = miConfig.Code
8473
 	cFYLJG003.FixmedinsCode = miConfig.Code
8417
-
8418
 	cFYLJG003.DrCode = doctor_info.DoctorNumber
8474
 	cFYLJG003.DrCode = doctor_info.DoctorNumber
8419
 	cFYLJG003.PrscDrName = doctor_info.UserName
8475
 	cFYLJG003.PrscDrName = doctor_info.UserName
8420
 	cFYLJG003.PharDeptName = dept.Name
8476
 	cFYLJG003.PharDeptName = dept.Name
8421
 	cFYLJG003.PharDeptCode = dept.Number
8477
 	cFYLJG003.PharDeptCode = dept.Number
8422
-	cFYLJG003.PharCode = "HY440309002107"
8423
-	cFYLJG003.PharCertType = "01"
8424
-	cFYLJG003.PharCertno = "430482199408260023"
8425
-	cFYLJG003.PharName = "彭斯遥"
8478
+
8479
+	if c.GetAdminUserInfo().CurrentOrgId == 10721 {
8480
+		cFYLJG003.PharName = "孙莉侠"
8481
+		cFYLJG003.PharPracCertNo = "060399"
8482
+		cFYLJG003.PharCode = "HY440309002107"
8483
+		cFYLJG003.PharCertType = "01"
8484
+		cFYLJG003.PharCertno = "430482199408260023"
8485
+	} else {
8486
+		cFYLJG003.PharName = "彭斯遥"
8487
+		cFYLJG003.PharPracCertNo = "30220200943042010052"
8488
+		cFYLJG003.PharCode = "HY440309002107"
8489
+		cFYLJG003.PharCertType = "01"
8490
+		cFYLJG003.PharCertno = "430482199408260023"
8491
+
8492
+	}
8493
+
8426
 	cFYLJG003.PsnCertType = "01"
8494
 	cFYLJG003.PsnCertType = "01"
8427
 	cFYLJG003.RxFile = flow.RxFile
8495
 	cFYLJG003.RxFile = flow.RxFile
8428
 	cFYLJG003.SignDigest = flow.SignDigest
8496
 	cFYLJG003.SignDigest = flow.SignDigest
8436
 	cFYLJG003.PharChkTime = timeFormatTwo
8504
 	cFYLJG003.PharChkTime = timeFormatTwo
8437
 
8505
 
8438
 	if miConfig.MdtrtareaAdmvs == "340699" {
8506
 	if miConfig.MdtrtareaAdmvs == "340699" {
8439
-		//result, request := service.GetAHCFYLJG002(miConfig.OrgName, curRoles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, encoded, rx_encoded, "")
8440
-		//result, request := service.GetAHCFYLJG003(miConfig.OrgName, curRoles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, cFYLJG003)
8441
-		//saveLog(result, request, "GetAHCFYLJG003", "GetAHCFYLJG003")
8507
+		result, request := service.GetAHCFYLJG003("http://10.66.149.64:8080/epc/api", cFYLJG003)
8508
+		saveLog(result, request, "GetAHCFYLJG003", "GetAHCFYLJG003")
8509
+		var res ResultCFYLJG003
8510
+		var respJSON2 map[string]interface{}
8511
+		if err := json.Unmarshal([]byte(string(result)), &respJSON2); err != nil {
8512
+			utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
8513
+			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
8514
+			return
8515
+		}
8516
+		userJSONBytes2, _ := json.Marshal(respJSON2)
8517
+		if err := json.Unmarshal(userJSONBytes2, &res); err != nil {
8518
+			utils.ErrorLog("解析失败:%v", err)
8519
+			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
8520
+			return
8521
+		}
8522
+		if res.Infcode == -1 {
8523
+			c.ServeSuccessJSON(map[string]interface{}{
8524
+				"failed_code": -10,
8525
+				"msg":         res.ErrMsg,
8526
+			})
8527
+			return
8528
+		} else {
8529
+			c.ServeSuccessJSON(map[string]interface{}{
8530
+				"info": res.Output,
8531
+			})
8532
+		}
8442
 	} else {
8533
 	} else {
8443
 		result, request := service.GetCFYLJG003(miConfig.OrgName, curRoles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, cFYLJG003)
8534
 		result, request := service.GetCFYLJG003(miConfig.OrgName, curRoles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, cFYLJG003)
8444
 		saveLog(result, request, "GetCFYLJG003", "GetCFYLJG003")
8535
 		saveLog(result, request, "GetCFYLJG003", "GetCFYLJG003")
8469
 
8560
 
8470
 	}
8561
 	}
8471
 
8562
 
8472
-
8473
 }
8563
 }
8474
 func (c *HisApiController) GetCFYLJG004() {
8564
 func (c *HisApiController) GetCFYLJG004() {
8475
 	admin_user_id, _ := c.GetInt64("admin_user_id")
8565
 	admin_user_id, _ := c.GetInt64("admin_user_id")
8545
 		}
8635
 		}
8546
 	}
8636
 	}
8547
 
8637
 
8548
-
8549
 }
8638
 }
8550
 func (c *HisApiController) GetCFYLJG005() {
8639
 func (c *HisApiController) GetCFYLJG005() {
8551
 	admin_user_id, _ := c.GetInt64("admin_user_id")
8640
 	admin_user_id, _ := c.GetInt64("admin_user_id")
8606
 		}
8695
 		}
8607
 	}
8696
 	}
8608
 
8697
 
8609
-
8610
 }
8698
 }
8611
 func (c *HisApiController) GetCFYLJG006() {
8699
 func (c *HisApiController) GetCFYLJG006() {
8612
 	admin_user_id, _ := c.GetInt64("admin_user_id")
8700
 	admin_user_id, _ := c.GetInt64("admin_user_id")
8664
 		}
8752
 		}
8665
 	}
8753
 	}
8666
 
8754
 
8667
-
8668
 }
8755
 }
8669
 func (c *HisApiController) GetCFYLJG007() {
8756
 func (c *HisApiController) GetCFYLJG007() {
8670
 	admin_user_id, _ := c.GetInt64("admin_user_id")
8757
 	admin_user_id, _ := c.GetInt64("admin_user_id")
8723
 		}
8810
 		}
8724
 	}
8811
 	}
8725
 
8812
 
8726
-
8727
 }
8813
 }
8728
 
8814
 
8729
 func (c *HisApiController) GetCFYLJG008() {
8815
 func (c *HisApiController) GetCFYLJG008() {
9165
 	}
9251
 	}
9166
 }
9252
 }
9167
 
9253
 
9168
-
9169
-
9170
 func (c *HisApiController) Get4201A() {
9254
 func (c *HisApiController) Get4201A() {
9171
 	order_id, _ := c.GetInt64("order_id")
9255
 	order_id, _ := c.GetInt64("order_id")
9172
 	admin_user_id, _ := c.GetInt64("admin_user_id")
9256
 	admin_user_id, _ := c.GetInt64("admin_user_id")
14849
 			fmt.Println(card_sn)
14933
 			fmt.Println(card_sn)
14850
 			patient, _ := service.GetPatientByNumber(basNumber, c.GetAdminUserInfo().CurrentOrgId)
14934
 			patient, _ := service.GetPatientByNumber(basNumber, c.GetAdminUserInfo().CurrentOrgId)
14851
 
14935
 
14852
-			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)
14936
+			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)
14853
 
14937
 
14854
 			//result := service.Jxyb1101(basNumber, miConfig.OrgName, roles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, id_card_type, card_sn, certificates)
14938
 			//result := service.Jxyb1101(basNumber, miConfig.OrgName, roles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, id_card_type, card_sn, certificates)
14855
 			var dat map[string]interface{}
14939
 			var dat map[string]interface{}
15236
 				return
15320
 				return
15237
 			}
15321
 			}
15238
 
15322
 
15239
-
15240
-
15241
 		} else if miConfig.MdtrtareaAdmvs == "430800" {
15323
 		} else if miConfig.MdtrtareaAdmvs == "430800" {
15242
 			fmt.Println(initFlag)
15324
 			fmt.Println(initFlag)
15243
 			fmt.Println("initFlag")
15325
 			fmt.Println("initFlag")
27530
 					}
27612
 					}
27531
 					var result string
27613
 					var result string
27532
 					var requestLog string
27614
 					var requestLog string
27533
-					if miConfig.Code == "H44030501364" || miConfig.Code == "H44030903432" || miConfig.Code == "H44030500255" ||  miConfig.Code == "H44082500483" {
27615
+					if miConfig.Code == "H44030501364" || miConfig.Code == "H44030903432" || miConfig.Code == "H44030500255" || miConfig.Code == "H44082500483" {
27534
 						var hisPrescription []*models.HisPrescription
27616
 						var hisPrescription []*models.HisPrescription
27535
 						res3101 := Checkgd3101ForOne(c, patient.ID, his, admin_user_id, "1", record_time, hisPrescription, department)
27617
 						res3101 := Checkgd3101ForOne(c, patient.ID, his, admin_user_id, "1", record_time, hisPrescription, department)
27536
 						if res3101.Infcode == 0 {
27618
 						if res3101.Infcode == 0 {
27659
 
27741
 
27660
 						for _, item := range rf {
27742
 						for _, item := range rf {
27661
 
27743
 
27662
-
27663
-
27664
 							if item.Insutype == insutype {
27744
 							if item.Insutype == insutype {
27665
 								insuplc_admdvs_temp = item.InsuplcAdmdvs
27745
 								insuplc_admdvs_temp = item.InsuplcAdmdvs
27666
 
27746
 
27668
 
27748
 
27669
 						}
27749
 						}
27670
 
27750
 
27671
-						if len(insuplc_admdvs_tt) > 0{
27751
+						if len(insuplc_admdvs_tt) > 0 {
27672
 							insuplc_admdvs_temp = insuplc_admdvs_tt
27752
 							insuplc_admdvs_temp = insuplc_admdvs_tt
27673
 
27753
 
27674
-
27675
 						}
27754
 						}
27676
 
27755
 
27677
 						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)
27756
 						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)
31132
 					}
31211
 					}
31133
 					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)
31212
 					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)
31134
 				} else {
31213
 				} else {
31135
-					if miConfig.Code == "H44030501364" || miConfig.Code == "H44030903432" || miConfig.Code == "H44030500255" ||  miConfig.Code == "H44082500483" {
31214
+					if miConfig.Code == "H44030501364" || miConfig.Code == "H44030903432" || miConfig.Code == "H44030500255" || miConfig.Code == "H44082500483" {
31136
 						result3101 := Checkgd3102(c, id, his_patient_id, admin_user_id, "7", tempOrder.ID)
31215
 						result3101 := Checkgd3102(c, id, his_patient_id, admin_user_id, "7", tempOrder.ID)
31137
 						if result3101.Infcode == 0 {
31216
 						if result3101.Infcode == 0 {
31138
 							if len(result3101.Output.Result) > 0 {
31217
 							if len(result3101.Output.Result) > 0 {
33123
 						res.Infcode = infocode
33202
 						res.Infcode = infocode
33124
 
33203
 
33125
 					} else {
33204
 					} else {
33126
-						if miConfig.Code == "H44030903432" || miConfig.Code == "H44030501364" || miConfig.Code == "H44030500255"  ||  miConfig.Code == "H44082500483"{
33205
+						if miConfig.Code == "H44030903432" || miConfig.Code == "H44030501364" || miConfig.Code == "H44030500255" || miConfig.Code == "H44082500483" {
33127
 							result3101 := Checkgd3101(c, id, his_patient_id, admin_user_id, "2", record_time, prescriptions)
33206
 							result3101 := Checkgd3101(c, id, his_patient_id, admin_user_id, "2", record_time, prescriptions)
33128
 							if result3101.Infcode == 0 {
33207
 							if result3101.Infcode == 0 {
33129
 								if len(result3101.Output.Result) > 0 {
33208
 								if len(result3101.Output.Result) > 0 {
34593
 
34672
 
34594
 							psn_info, _ := service.GetPsnByPatientId(his.PatientId)
34673
 							psn_info, _ := service.GetPsnByPatientId(his.PatientId)
34595
 							allTotal = fmt.Sprintf("%.2f", total_two)
34674
 							allTotal = fmt.Sprintf("%.2f", total_two)
34596
-							if miConfig.Code == "H44030501364" || miConfig.Code == "H44030903432" || miConfig.Code == "H44030500255" ||  miConfig.Code == "H44082500483" {
34675
+							if miConfig.Code == "H44030501364" || miConfig.Code == "H44030903432" || miConfig.Code == "H44030500255" || miConfig.Code == "H44082500483" {
34597
 
34676
 
34598
 								result3101 := Checkgd3102(c, id, his_patient_id, admin_user_id, "6", order.ID)
34677
 								result3101 := Checkgd3102(c, id, his_patient_id, admin_user_id, "6", order.ID)
34599
 								if result3101.Infcode == 0 {
34678
 								if result3101.Infcode == 0 {
40029
 		res.Output.Setlinfo.PsnCashPay = order.PsnCashPay
40108
 		res.Output.Setlinfo.PsnCashPay = order.PsnCashPay
40030
 
40109
 
40031
 		if res.Infcode == 0 {
40110
 		if res.Infcode == 0 {
40032
-			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{
40111
+			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 {
40033
 				c.ServeSuccessJSON(map[string]interface{}{
40112
 				c.ServeSuccessJSON(map[string]interface{}{
40034
 					"diagnosis":            name,
40113
 					"diagnosis":            name,
40035
 					"order_infos":          orderInfos,
40114
 					"order_infos":          orderInfos,

+ 25 - 92
service/ah_dianzichufang.go View File

7
 	"gdyb/models"
7
 	"gdyb/models"
8
 	"io/ioutil"
8
 	"io/ioutil"
9
 	"net/http"
9
 	"net/http"
10
-	//"strconv"
11
-	"time"
12
-
13
-
10
+	"os/exec"
14
 )
11
 )
15
 
12
 
16
-func GetAHCFYLJG001(org_name string, opera string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, url string, cFYLJG001 models.CFYLJG001, isu string, cainfo string) (string, string) {
17
-	// 生成签名
18
-	timestamp := time.Now().Unix()
19
-	//tempTime := time.Unix(timestamp, 0)
20
-	//timeFormatOne := tempTime.Format("2006-01-02 15:04:05")
21
-
22
-	// 生成输入报文
23
-	inputMessage := SetAHInputMessage(timestamp, org_name, opera, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, cainfo)
13
+func GetAHCFYLJG001(url string, cFYLJG001 models.CFYLJG001, isu string) (string, string) {
24
 	inputData := make(map[string]interface{}, 0)
14
 	inputData := make(map[string]interface{}, 0)
25
 	inputData["mdtrtCertType"] = cFYLJG001.MdtrtCertType
15
 	inputData["mdtrtCertType"] = cFYLJG001.MdtrtCertType
26
 	inputData["mdtrtCertNo"] = cFYLJG001.MdtrtCertNo
16
 	inputData["mdtrtCertNo"] = cFYLJG001.MdtrtCertNo
46
 	inputData["valiDays"] = cFYLJG001.ValiDays
36
 	inputData["valiDays"] = cFYLJG001.ValiDays
47
 	inputData["valiEndTime"] = cFYLJG001.ValiEndTime
37
 	inputData["valiEndTime"] = cFYLJG001.ValiEndTime
48
 	inputData["reptFlag"] = cFYLJG001.ReptFlag
38
 	inputData["reptFlag"] = cFYLJG001.ReptFlag
49
-
50
 	inputData["maxReptCnt"] = cFYLJG001.MaxReptCnt
39
 	inputData["maxReptCnt"] = cFYLJG001.MaxReptCnt
51
 	inputData["minInrvDays"] = cFYLJG001.MinInrvDays
40
 	inputData["minInrvDays"] = cFYLJG001.MinInrvDays
52
 	inputData["rxCotnFlag"] = cFYLJG001.RxCotnFlag
41
 	inputData["rxCotnFlag"] = cFYLJG001.RxCotnFlag
53
 	inputData["longRxFlag"] = cFYLJG001.LongRxFlag
42
 	inputData["longRxFlag"] = cFYLJG001.LongRxFlag
54
-
55
-	//inputData["reptd_cnt"] = cFYLJG001.ReptdCnt
56
-	//inputData["mdtrtareaNo"] = cFYLJG001.MdtrtareaNo
57
-
58
 	rxdrugdetail := make([]map[string]interface{}, 0)
43
 	rxdrugdetail := make([]map[string]interface{}, 0)
59
-
60
 	rxdrug := make(map[string]interface{})
44
 	rxdrug := make(map[string]interface{})
61
 	for _, item := range cFYLJG001.List {
45
 	for _, item := range cFYLJG001.List {
62
 		rxdrug["medListCodg"] = item.MedListCodg
46
 		rxdrug["medListCodg"] = item.MedListCodg
67
 		rxdrug["tcmdrugTypeName"] = item.TcmdrugTypeName
51
 		rxdrug["tcmdrugTypeName"] = item.TcmdrugTypeName
68
 		rxdrug["tcmdrugTypeCode"] = item.TcmdrugTypeCode
52
 		rxdrug["tcmdrugTypeCode"] = item.TcmdrugTypeCode
69
 		rxdrug["tcmherbFoote"] = item.TcmherbFoote
53
 		rxdrug["tcmherbFoote"] = item.TcmherbFoote
70
-
71
 		rxdrug["mednTypeCode"] = item.MednTypeCode
54
 		rxdrug["mednTypeCode"] = item.MednTypeCode
72
 		rxdrug["mednTypeName"] = item.MednTypeName
55
 		rxdrug["mednTypeName"] = item.MednTypeName
73
 		rxdrug["mainMedcFlag"] = item.MainMedcFlag
56
 		rxdrug["mainMedcFlag"] = item.MainMedcFlag
74
-
75
 		rxdrug["urgtFlag"] = item.UrgtFlag
57
 		rxdrug["urgtFlag"] = item.UrgtFlag
76
 		rxdrug["basMednFlag"] = item.BasMednFlag
58
 		rxdrug["basMednFlag"] = item.BasMednFlag
77
 		rxdrug["impDrugFlag"] = item.ImpDrugFlag
59
 		rxdrug["impDrugFlag"] = item.ImpDrugFlag
95
 		rxdrug["drugPric"] = item.DrugPric
77
 		rxdrug["drugPric"] = item.DrugPric
96
 		rxdrug["drugSumamt"] = item.DrugSumamt
78
 		rxdrug["drugSumamt"] = item.DrugSumamt
97
 		rxdrug["hospApprFlag"] = item.HospApprFlag
79
 		rxdrug["hospApprFlag"] = item.HospApprFlag
98
-
99
 		rxdrug["selfPayRea"] = ""
80
 		rxdrug["selfPayRea"] = ""
100
 		rxdrug["realDscr"] = ""
81
 		rxdrug["realDscr"] = ""
101
-
102
-		//rxdrug["genname_codg"] = item.GennameCodg
103
-		//rxdrug["drug_totlcnt"] = item.DrugTotlcnt
104
-		//rxdrug["drug_totlcnt_emp"] = item.DrugTotlcntEmp
105
 		rxdrug["extras"] = ""
82
 		rxdrug["extras"] = ""
106
 		rxdrugdetail = append(rxdrugdetail, rxdrug)
83
 		rxdrugdetail = append(rxdrugdetail, rxdrug)
107
 	}
84
 	}
108
 	inputData["rxdrugdetail"] = rxdrugdetail
85
 	inputData["rxdrugdetail"] = rxdrugdetail
109
-
110
 	mdtrtinfo := make(map[string]interface{})
86
 	mdtrtinfo := make(map[string]interface{})
111
 	mdtrtinfo["fixmedinsCode"] = cFYLJG001.Mdtrtinfo.FixmedinsCode
87
 	mdtrtinfo["fixmedinsCode"] = cFYLJG001.Mdtrtinfo.FixmedinsCode
112
 	mdtrtinfo["fixmedinsName"] = cFYLJG001.Mdtrtinfo.FixmedinsName
88
 	mdtrtinfo["fixmedinsName"] = cFYLJG001.Mdtrtinfo.FixmedinsName
162
 
138
 
163
 	mdtrtinfo["extras"] = data
139
 	mdtrtinfo["extras"] = data
164
 	inputData["mdtrtinfo"] = mdtrtinfo
140
 	inputData["mdtrtinfo"] = mdtrtinfo
165
-
166
 	diseinfos := make([]map[string]interface{}, 0)
141
 	diseinfos := make([]map[string]interface{}, 0)
167
-
168
 	for _, item := range cFYLJG001.Diseinfo {
142
 	for _, item := range cFYLJG001.Diseinfo {
169
 		diseinfo := make(map[string]interface{})
143
 		diseinfo := make(map[string]interface{})
170
 		diseinfo["diagType"] = item.DiagType
144
 		diseinfo["diagType"] = item.DiagType
174
 		diseinfo["diagName"] = item.DiagName
148
 		diseinfo["diagName"] = item.DiagName
175
 		diseinfo["diagDept"] = item.DiagDept
149
 		diseinfo["diagDept"] = item.DiagDept
176
 		diseinfo["diagDeptCode"] = ""
150
 		diseinfo["diagDeptCode"] = ""
177
-
178
 		diseinfo["diagDrNo"] = item.DiagDrNo
151
 		diseinfo["diagDrNo"] = item.DiagDrNo
179
 		diseinfo["diagDrName"] = item.DiagDrName
152
 		diseinfo["diagDrName"] = item.DiagDrName
180
 		diseinfo["diagTime"] = item.DiagTime
153
 		diseinfo["diagTime"] = item.DiagTime
185
 		diseinfos = append(diseinfos, diseinfo)
158
 		diseinfos = append(diseinfos, diseinfo)
186
 	}
159
 	}
187
 	inputData["diseinfo"] = diseinfos
160
 	inputData["diseinfo"] = diseinfos
188
-
189
-	inputMessage["input"] = inputData
190
-	argInputMessage := make(map[string]interface{})
191
-	argInputMessage["arg0"] = inputMessage
192
-
193
 	var inputLog string
161
 	var inputLog string
194
-	bytesData, err := json.Marshal(argInputMessage)
162
+	bytesData, err := json.Marshal(inputData)
195
 	inputLog = string(bytesData)
163
 	inputLog = string(bytesData)
196
-	fmt.Println(string(bytesData))
164
+	cmd := exec.Command("java", "-jar", "yh_hb_fat.jar", "19D43125C3E64BB784601F7B19A8D785", "6014F1F2CA6247F8960AF61A306B5DCC", "Ns0K7Gsxk1WSfxYYyBcCL3J4Q/2Tvp1bMe8JbakA9Fg=", inputLog)
165
+	out, err := cmd.Output()
166
+	fmt.Println(string(out))
197
 	if err != nil {
167
 	if err != nil {
198
-		fmt.Println(err.Error())
168
+		fmt.Println("error:", err.Error())
199
 		return err.Error(), ""
169
 		return err.Error(), ""
200
 	}
170
 	}
201
-	reader := bytes.NewReader(bytesData)
202
-
203
-	url = url + "7101"
171
+	reader := bytes.NewReader(out)
172
+	url = url + "/fixmedins/uploadChk"
204
 	request, err := http.NewRequest("POST", url, reader)
173
 	request, err := http.NewRequest("POST", url, reader)
205
 	if err != nil {
174
 	if err != nil {
206
 		fmt.Println(err.Error())
175
 		fmt.Println(err.Error())
207
 		return err.Error(), ""
176
 		return err.Error(), ""
208
 	}
177
 	}
209
-
210
 	request.Header.Set("Content-Type", "application/json;charset=UTF-8")
178
 	request.Header.Set("Content-Type", "application/json;charset=UTF-8")
211
-
212
 	client := http.Client{}
179
 	client := http.Client{}
213
 	resp, err := client.Do(request)
180
 	resp, err := client.Do(request)
214
 	if err != nil {
181
 	if err != nil {
220
 		fmt.Println(err.Error())
187
 		fmt.Println(err.Error())
221
 		return err.Error(), ""
188
 		return err.Error(), ""
222
 	}
189
 	}
223
-	fmt.Println(string(respBytes))
224
 	str := string(respBytes)
190
 	str := string(respBytes)
225
 	return str, inputLog
191
 	return str, inputLog
226
-
227
 }
192
 }
228
 
193
 
229
-func GetAHCFYLJG002(org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, url string, original_value string, original_rx_file string, extras string, cainfo string) (string, string) {
194
+func GetAHCFYLJG002(fixmedins_code string, url string, original_value string, original_rx_file string, extras string) (string, string) {
230
 	// 生成签名
195
 	// 生成签名
231
-	timestamp := time.Now().Unix()
232
 	// 生成输入报文
196
 	// 生成输入报文
233
-	inputMessage := SetAHInputMessage(timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, cainfo)
234
-
235
 	inputData := make(map[string]interface{})
197
 	inputData := make(map[string]interface{})
236
-	inputDatas := make(map[string]interface{})
237
-
238
-	inputMessage["infno"] = "7102"
239
 	inputData["fixmedinsCode"] = fixmedins_code
198
 	inputData["fixmedinsCode"] = fixmedins_code
240
 	inputData["originalValue"] = original_value
199
 	inputData["originalValue"] = original_value
241
 	inputData["originalRxFile"] = original_rx_file
200
 	inputData["originalRxFile"] = original_rx_file
242
 	inputData["extras"] = extras
201
 	inputData["extras"] = extras
243
-	inputDatas["data"] = inputData
244
-	inputMessage["input"] = inputDatas
245
-	argInputMessage := make(map[string]interface{})
246
-	argInputMessage["arg0"] = inputMessage
247
 	var inputLog string
202
 	var inputLog string
248
-	bytesData, err := json.Marshal(argInputMessage)
203
+	bytesData, err := json.Marshal(inputData)
249
 	inputLog = string(bytesData)
204
 	inputLog = string(bytesData)
250
 	fmt.Println(string(bytesData))
205
 	fmt.Println(string(bytesData))
251
 	if err != nil {
206
 	if err != nil {
252
 		fmt.Println(err.Error())
207
 		fmt.Println(err.Error())
253
 		return err.Error(), ""
208
 		return err.Error(), ""
254
 	}
209
 	}
255
-	reader := bytes.NewReader(bytesData)
256
-	url = url + "7102"
257
-	//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/1101"
210
+	cmd := exec.Command("java", "-jar", "yh_hb_fat.jar", "19D43125C3E64BB784601F7B19A8D785", "6014F1F2CA6247F8960AF61A306B5DCC", "Ns0K7Gsxk1WSfxYYyBcCL3J4Q/2Tvp1bMe8JbakA9Fg=", inputLog)
211
+	out, err := cmd.Output()
212
+	fmt.Println(string(out))
213
+	reader := bytes.NewReader(out)
214
+	url = url + "/fixmedins/rxFixmedinsSign"
258
 	request, err := http.NewRequest("POST", url, reader)
215
 	request, err := http.NewRequest("POST", url, reader)
259
 	if err != nil {
216
 	if err != nil {
260
 		fmt.Println(err.Error())
217
 		fmt.Println(err.Error())
261
 		return err.Error(), ""
218
 		return err.Error(), ""
262
 	}
219
 	}
263
 	request.Header.Set("Content-Type", "application/json;charset=UTF-8")
220
 	request.Header.Set("Content-Type", "application/json;charset=UTF-8")
264
-
265
 	client := http.Client{}
221
 	client := http.Client{}
266
 	resp, err := client.Do(request)
222
 	resp, err := client.Do(request)
267
 	if err != nil {
223
 	if err != nil {
276
 	fmt.Println(string(respBytes))
232
 	fmt.Println(string(respBytes))
277
 	str := string(respBytes)
233
 	str := string(respBytes)
278
 	return str, inputLog
234
 	return str, inputLog
279
-
280
 }
235
 }
281
 
236
 
282
-func GetAHCFYLJG003(org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, url string, cFYLJG003 models.CFYLJG003, cainfo string) (string, string) {
283
-	//生成签名
284
-	timestamp := time.Now().Unix()
285
-	// 生成输入报文
286
-	inputMessage := SetAHInputMessage(timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, cainfo)
287
-
237
+func GetAHCFYLJG003(url string, cFYLJG003 models.CFYLJG003) (string, string) {
288
 	inputData := make(map[string]interface{})
238
 	inputData := make(map[string]interface{})
289
-	inputData2 := make(map[string]interface{})
290
-
291
-	inputMessage["infno"] = "7103"
292
-
293
 	inputData["rxTraceCode"] = cFYLJG003.RxTraceCode
239
 	inputData["rxTraceCode"] = cFYLJG003.RxTraceCode
294
 	inputData["hiRxno"] = cFYLJG003.HiRxno
240
 	inputData["hiRxno"] = cFYLJG003.HiRxno
295
 	inputData["mdtrtId"] = cFYLJG003.MdtrtID
241
 	inputData["mdtrtId"] = cFYLJG003.MdtrtID
314
 	inputData["signDigest"] = cFYLJG003.SignDigest
260
 	inputData["signDigest"] = cFYLJG003.SignDigest
315
 	inputData["extras"] = ""
261
 	inputData["extras"] = ""
316
 
262
 
317
-	//inputData["rx_frqu_name"] = cFYLJG003.RxFrquName
318
-	inputData2["data"] = inputData
319
-	inputMessage["input"] = inputData2
320
 	var inputLog string
263
 	var inputLog string
321
-	bytesData, err := json.Marshal(inputMessage)
264
+	bytesData, err := json.Marshal(inputData)
322
 	inputLog = string(bytesData)
265
 	inputLog = string(bytesData)
323
-	fmt.Println(string(bytesData))
266
+	cmd := exec.Command("java", "-jar", "yh_hb_fat.jar", "19D43125C3E64BB784601F7B19A8D785", "6014F1F2CA6247F8960AF61A306B5DCC", "Ns0K7Gsxk1WSfxYYyBcCL3J4Q/2Tvp1bMe8JbakA9Fg=", inputLog)
267
+	out, err := cmd.Output()
268
+	fmt.Println(string(out))
269
+
324
 	if err != nil {
270
 	if err != nil {
325
 		fmt.Println(err.Error())
271
 		fmt.Println(err.Error())
326
 		return err.Error(), ""
272
 		return err.Error(), ""
327
 	}
273
 	}
328
 	reader := bytes.NewReader(bytesData)
274
 	reader := bytes.NewReader(bytesData)
329
-	url = url + "7102"
275
+	url = url + "/fixmedins/rxFileUpld"
330
 	//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/1101"
276
 	//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/1101"
331
 	request, err := http.NewRequest("POST", url, reader)
277
 	request, err := http.NewRequest("POST", url, reader)
332
 	if err != nil {
278
 	if err != nil {
352
 
298
 
353
 }
299
 }
354
 
300
 
355
-func GetAHCFYLJG004(org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, url string, cFYLJG004 models.CFYLJG004, cainfo string) (string, string) {
356
-	// 生成签名
357
-	timestamp := time.Now().Unix()
358
-	// 生成输入报文
359
-	inputMessage := SetAHInputMessage(timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, cainfo)
301
+func GetAHCFYLJG004(url string, cFYLJG004 models.CFYLJG004) (string, string) {
360
 
302
 
361
 	inputData := make(map[string]interface{})
303
 	inputData := make(map[string]interface{})
362
-	inputData1 := make(map[string]interface{})
363
-	//inputDatas := make([]map[string]interface{}, 0)
364
-	inputMessage["infno"] = "7104"
365
 	inputData["hiRxno"] = cFYLJG004.HiRxno
304
 	inputData["hiRxno"] = cFYLJG004.HiRxno
366
 	inputData["fixmedinsCode"] = cFYLJG004.FixmedinsCode
305
 	inputData["fixmedinsCode"] = cFYLJG004.FixmedinsCode
367
 	inputData["drCode"] = cFYLJG004.UndoDrCode
306
 	inputData["drCode"] = cFYLJG004.UndoDrCode
370
 	inputData["undoDrCertno"] = cFYLJG004.UndoDrCertno
309
 	inputData["undoDrCertno"] = cFYLJG004.UndoDrCertno
371
 	inputData["undoRea"] = cFYLJG004.UndoRea
310
 	inputData["undoRea"] = cFYLJG004.UndoRea
372
 	inputData["undoTime"] = cFYLJG004.UndoTime
311
 	inputData["undoTime"] = cFYLJG004.UndoTime
373
-	inputData1["data"] = inputData
374
-	inputMessage["input"] = inputData1
375
-	argInputMessage := make(map[string]interface{})
376
-	argInputMessage["arg0"] = inputMessage
377
 	var inputLog string
312
 	var inputLog string
378
-	bytesData, err := json.Marshal(inputMessage)
313
+	bytesData, err := json.Marshal(inputData)
379
 	inputLog = string(bytesData)
314
 	inputLog = string(bytesData)
380
 	fmt.Println(string(bytesData))
315
 	fmt.Println(string(bytesData))
381
 	if err != nil {
316
 	if err != nil {
383
 		return err.Error(), ""
318
 		return err.Error(), ""
384
 	}
319
 	}
385
 	reader := bytes.NewReader(bytesData)
320
 	reader := bytes.NewReader(bytesData)
386
-
387
 	url = url + "CFYLJG004"
321
 	url = url + "CFYLJG004"
388
-
389
 	//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/1101"
322
 	//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/1101"
390
 	request, err := http.NewRequest("POST", url, reader)
323
 	request, err := http.NewRequest("POST", url, reader)
391
 	if err != nil {
324
 	if err != nil {