陈少旭 hace 3 semanas
padre
commit
2bfe5a11cf
Se han modificado 3 ficheros con 599 adiciones y 618 borrados
  1. 102 40
      controllers/sg/his_api_controller.go
  2. 299 359
      service/ah_dianzichufang.go
  3. 198 219
      service/ahyb_service.go

+ 102 - 40
controllers/sg/his_api_controller.go Ver fichero

@@ -8152,9 +8152,15 @@ func (c *HisApiController) GetCFYLJG001() {
8152 8152
 				cFYLJG001.Diseinfo = append(cFYLJG001.Diseinfo, dia)
8153 8153
 			}
8154 8154
 		}
8155
-		result, request := service.GetCFYLJG001(miConfig.OrgName, curRoles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, cFYLJG001, his.Insutype)
8155
+		if miConfig.MdtrtareaAdmvs == "340699" {
8156
+			result, request := service.GetAHCFYLJG001(miConfig.OrgName, curRoles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, cFYLJG001, his.Insutype)
8157
+			saveLog(result, request, "GetCFYLJG001", "GetCFYLJG001")
8156 8158
 
8157
-		saveLog(result, request, "GetCFYLJG001", "GetCFYLJG001")
8159
+		} else {
8160
+			result, request := service.GetCFYLJG001(miConfig.OrgName, curRoles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, cFYLJG001, his.Insutype)
8161
+			saveLog(result, request, "GetCFYLJG001", "GetCFYLJG001")
8162
+
8163
+		}
8158 8164
 
8159 8165
 		var res ResultCFYLJG001
8160 8166
 		var respJSON2 map[string]interface{}
@@ -8268,9 +8274,16 @@ func (c *HisApiController) GetCFYLJG002() {
8268 8274
 
8269 8275
 	fmt.Println(err)
8270 8276
 
8271
-	result, request := service.GetCFYLJG002(miConfig.OrgName, curRoles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, encoded, rx_encoded, "")
8272
-	//result, request := service.GetCFYLJG001(miConfig.OrgName, curRoles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, cFYLJG001,his.Insutype)
8273
-	saveLog(result, request, "GetCFYLJG002", "GetCFYLJG002")
8277
+	if miConfig.MdtrtareaAdmvs == "340699" {
8278
+		result, request := service.GetAHCFYLJG002(miConfig.OrgName, curRoles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, encoded, rx_encoded, "")
8279
+		saveLog(result, request, "GetCFYLJG002", "GetCFYLJG002")
8280
+
8281
+	} else {
8282
+		result, request := service.GetCFYLJG002(miConfig.OrgName, curRoles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, encoded, rx_encoded, "")
8283
+		//result, request := service.GetCFYLJG001(miConfig.OrgName, curRoles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, cFYLJG001,his.Insutype)
8284
+		saveLog(result, request, "GetCFYLJG002", "GetCFYLJG002")
8285
+
8286
+	}
8274 8287
 
8275 8288
 	var res2 Result002
8276 8289
 	var respJSON2 map[string]interface{}
@@ -8367,8 +8380,16 @@ func (c *HisApiController) GetCFYLJG003() {
8367 8380
 	timeFormatTwo := tempTime2.Format("2006-01-02 15:04:05")
8368 8381
 	cFYLJG003.PharChkTime = timeFormatTwo
8369 8382
 
8370
-	result, request := service.GetCFYLJG003(miConfig.OrgName, curRoles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, cFYLJG003)
8371
-	saveLog(result, request, "GetCFYLJG003", "GetCFYLJG003")
8383
+	if miConfig.MdtrtareaAdmvs == "340699" {
8384
+		//result, request := service.GetAHCFYLJG002(miConfig.OrgName, curRoles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, encoded, rx_encoded, "")
8385
+		result, request := service.GetAHCFYLJG003(miConfig.OrgName, curRoles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, cFYLJG003)
8386
+		saveLog(result, request, "GetAHCFYLJG003", "GetAHCFYLJG003")
8387
+
8388
+	} else {
8389
+		result, request := service.GetCFYLJG003(miConfig.OrgName, curRoles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, cFYLJG003)
8390
+		saveLog(result, request, "GetCFYLJG003", "GetCFYLJG003")
8391
+
8392
+	}
8372 8393
 
8373 8394
 	var res ResultCFYLJG003
8374 8395
 	var respJSON2 map[string]interface{}
@@ -8431,8 +8452,17 @@ func (c *HisApiController) GetCFYLJG004() {
8431 8452
 	cFYLJG004.UndoTime = time.Now().Format("2006-01-02 15:04:05")
8432 8453
 	cFYLJG004.UndoDrName = doctor_info.UserName
8433 8454
 	cFYLJG004.UndoDrCode = doctor_info.DoctorNumber
8434
-	result, request := service.GetCFYLJG004(miConfig.OrgName, curRoles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, cFYLJG004)
8435
-	saveLog(result, request, "GetCFYLJG004", "GetCFYLJG004")
8455
+
8456
+	if miConfig.MdtrtareaAdmvs == "340699" {
8457
+		//result, request := service.GetAHCFYLJG002(miConfig.OrgName, curRoles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, encoded, rx_encoded, "")
8458
+		result, request := service.GetAHCFYLJG004(miConfig.OrgName, curRoles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, cFYLJG003)
8459
+		saveLog(result, request, "GetAHCFYLJG004", "GetAHCFYLJG004")
8460
+
8461
+	} else {
8462
+		result, request := service.GetCFYLJG004(miConfig.OrgName, curRoles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, cFYLJG004)
8463
+		saveLog(result, request, "GetCFYLJG004", "GetCFYLJG004")
8464
+
8465
+	}
8436 8466
 
8437 8467
 	var res ResultCFYLJG004
8438 8468
 	var respJSON2 map[string]interface{}
@@ -8485,8 +8515,18 @@ func (c *HisApiController) GetCFYLJG005() {
8485 8515
 	cFYLJG005.PsnName = his.Name
8486 8516
 	cFYLJG005.PsnCertType = "01"
8487 8517
 	cFYLJG005.Certno = his.IdCardNo
8488
-	result, request := service.GetCFYLJG005(miConfig.OrgName, curRoles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, cFYLJG005)
8489
-	saveLog(result, request, "GetCFYLJG005", "GetCFYLJG005")
8518
+
8519
+	if miConfig.MdtrtareaAdmvs == "340699" {
8520
+		//result, request := service.GetAHCFYLJG002(miConfig.OrgName, curRoles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, encoded, rx_encoded, "")
8521
+
8522
+		result, request := service.GetAHCFYLJG005(miConfig.OrgName, curRoles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, cFYLJG005)
8523
+		saveLog(result, request, "GetCFYLJG005", "GetCFYLJG005")
8524
+
8525
+	} else {
8526
+		result, request := service.GetCFYLJG005(miConfig.OrgName, curRoles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, cFYLJG005)
8527
+		saveLog(result, request, "GetCFYLJG005", "GetCFYLJG005")
8528
+
8529
+	}
8490 8530
 
8491 8531
 	var res ResultCFYLJG005
8492 8532
 	var respJSON2 map[string]interface{}
@@ -8534,8 +8574,17 @@ func (c *HisApiController) GetCFYLJG006() {
8534 8574
 	cFYLJG006.PsnName = patient.Name
8535 8575
 	cFYLJG006.PsnCertType = "01"
8536 8576
 	cFYLJG006.Certno = patient.IdCardNo
8537
-	result, request := service.GetCFYLJG006(miConfig.OrgName, curRoles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, cFYLJG006)
8538
-	saveLog(result, request, "GetCFYLJG006", "GetCFYLJG006")
8577
+
8578
+	if miConfig.MdtrtareaAdmvs == "340699" {
8579
+		//result, request := service.GetAHCFYLJG002(miConfig.OrgName, curRoles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, encoded, rx_encoded, "")
8580
+
8581
+		result, request := service.GetAHCFYLJG006(miConfig.OrgName, curRoles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, cFYLJG006)
8582
+		saveLog(result, request, "GetCFYLJG006", "GetCFYLJG006")
8583
+	} else {
8584
+		result, request := service.GetCFYLJG006(miConfig.OrgName, curRoles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, cFYLJG006)
8585
+		saveLog(result, request, "GetCFYLJG006", "GetCFYLJG006")
8586
+	}
8587
+
8539 8588
 	var res ResultCFYLJG006
8540 8589
 	var respJSON2 map[string]interface{}
8541 8590
 	if err := json.Unmarshal([]byte(string(result)), &respJSON2); err != nil {
@@ -8585,8 +8634,14 @@ func (c *HisApiController) GetCFYLJG007() {
8585 8634
 	cFYLJG007.PsnCertType = "01"
8586 8635
 	cFYLJG007.Certno = patient.IdCardNo
8587 8636
 	cFYLJG007.PsnName = patient.Name
8588
-	result, request := service.GetCFYLJG007(miConfig.OrgName, curRoles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, cFYLJG007)
8589
-	saveLog(result, request, "GetCFYLJG007", "GetCFYLJG007")
8637
+
8638
+	if miConfig.MdtrtareaAdmvs == "340699" {
8639
+		result, request := service.GetAHCFYLJG007(miConfig.OrgName, curRoles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, cFYLJG007)
8640
+		saveLog(result, request, "GetCFYLJG007", "GetCFYLJG007")
8641
+	} else {
8642
+		result, request := service.GetCFYLJG007(miConfig.OrgName, curRoles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, cFYLJG007)
8643
+		saveLog(result, request, "GetCFYLJG007", "GetCFYLJG007")
8644
+	}
8590 8645
 
8591 8646
 	var res ResultCFYLJG007
8592 8647
 	var respJSON2 map[string]interface{}
@@ -8661,33 +8716,40 @@ func (c *HisApiController) GetCFYLJG008() {
8661 8716
 	MPI.MedListCodg = prescriptions[0].HisDoctorAdviceInfo[0].MedListCodg
8662 8717
 	MPI.Cnt = prescriptions[0].HisDoctorAdviceInfo[0].PrescribingNumber
8663 8718
 	cFYLJG008.MedList = append(cFYLJG008.MedList, MPI)
8664
-	result, request := service.GetCFYLJG008(miConfig.OrgName, curRoles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, cFYLJG008)
8665
-	saveLog(result, request, "GetCFYLJG008", "GetCFYLJG008")
8666 8719
 
8667
-	var res ResultCFYLJG008
8668
-	var respJSON2 map[string]interface{}
8669
-	if err := json.Unmarshal([]byte(string(result)), &respJSON2); err != nil {
8670
-		utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
8671
-		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
8672
-		return
8673
-	}
8674
-	userJSONBytes2, _ := json.Marshal(respJSON2)
8675
-	if err := json.Unmarshal(userJSONBytes2, &res); err != nil {
8676
-		utils.ErrorLog("解析失败:%v", err)
8677
-		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
8678
-		return
8679
-	}
8680
-	if res.Infcode == -1 {
8681
-		c.ServeSuccessJSON(map[string]interface{}{
8682
-			"failed_code": -10,
8683
-			"msg":         res.ErrMsg,
8684
-		})
8685
-		return
8720
+	if miConfig.MdtrtareaAdmvs == "340699" {
8721
+		result, request := service.GetAHCFYLJG008(miConfig.OrgName, curRoles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, cFYLJG008)
8722
+		saveLog(result, request, "GetAHCFYLJG008", "GetAHCFYLJG008")
8723
+
8686 8724
 	} else {
8687
-		c.ServeSuccessJSON(map[string]interface{}{
8688
-			"info": res.Output,
8689
-		})
8690
-		return
8725
+		result, request := service.GetCFYLJG008(miConfig.OrgName, curRoles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, cFYLJG008)
8726
+		saveLog(result, request, "GetCFYLJG008", "GetCFYLJG008")
8727
+
8728
+		var res ResultCFYLJG008
8729
+		var respJSON2 map[string]interface{}
8730
+		if err := json.Unmarshal([]byte(string(result)), &respJSON2); err != nil {
8731
+			utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
8732
+			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
8733
+			return
8734
+		}
8735
+		userJSONBytes2, _ := json.Marshal(respJSON2)
8736
+		if err := json.Unmarshal(userJSONBytes2, &res); err != nil {
8737
+			utils.ErrorLog("解析失败:%v", err)
8738
+			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
8739
+			return
8740
+		}
8741
+		if res.Infcode == -1 {
8742
+			c.ServeSuccessJSON(map[string]interface{}{
8743
+				"failed_code": -10,
8744
+				"msg":         res.ErrMsg,
8745
+			})
8746
+			return
8747
+		} else {
8748
+			c.ServeSuccessJSON(map[string]interface{}{
8749
+				"info": res.Output,
8750
+			})
8751
+			return
8752
+		}
8691 8753
 	}
8692 8754
 
8693 8755
 }

+ 299 - 359
service/ah_dianzichufang.go Ver fichero

@@ -11,139 +11,146 @@ import (
11 11
 	"time"
12 12
 )
13 13
 
14
-func GetAHCFYLJG001(org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string, cFYLJG001 models.CFYLJG001, isu string) (string, string) {
15
-	//生成签名
16
-	nonce := GetRandomString(32)
14
+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) {
15
+	// 生成签名
17 16
 	timestamp := time.Now().Unix()
18
-	signature := setSignature(timestamp, nonce, secret_key)
19
-	//生成输入报文
20
-	inputMessage := SetInputMessage(nonce, timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs)
21
-	//input := make(map[string]interface{})
22
-	inputData := make(map[string]interface{}, 0)
17
+	//tempTime := time.Unix(timestamp, 0)
18
+	//timeFormatOne := tempTime.Format("2006-01-02 15:04:05")
23 19
 
24
-	inputMessage["infno"] = "CFYLJG001"
25
-
26
-	inputData["mdtrt_cert_type"] = cFYLJG001.MdtrtCertType
27
-	inputData["mdtrt_cert_no"] = cFYLJG001.MdtrtCertNo
28
-	inputData["card_sn"] = cFYLJG001.CardSn
29
-	inputData["ec_token"] = cFYLJG001.EcToken
30
-	inputData["auth_no"] = cFYLJG001.AuthNo
31
-	inputData["biz_type_code"] = cFYLJG001.BizTypeCode
32
-	inputData["insu_admdvs"] = cFYLJG001.InsuAdmdvs
33
-	inputData["hosp_rxno"] = cFYLJG001.HospRxno
34
-	inputData["init_rxno"] = cFYLJG001.InitRxno
35
-	inputData["rx_type_code"] = cFYLJG001.RxTypeCode
36
-	inputData["prsc_time"] = cFYLJG001.PrscTime
37
-	inputData["rx_drug_cnt"] = cFYLJG001.RxDrugCnt
38
-	inputData["rx_used_way_codg"] = cFYLJG001.RxUsedWayCodg
39
-	inputData["rx_used_way_name"] = cFYLJG001.RxUsedWayName
40
-	inputData["rx_frqu_codg"] = cFYLJG001.RxFrquCodg
41
-	inputData["rx_frqu_name"] = cFYLJG001.RxFrquName
42
-	inputData["rx_dosunt"] = cFYLJG001.RxDosunt
43
-	inputData["rx_doscnt"] = cFYLJG001.RxDoscnt
44
-	inputData["rx_drord_dscr"] = cFYLJG001.RxDrordDscr
45
-	inputData["vali_days"] = cFYLJG001.ValiDays
46
-	inputData["vali_end_time"] = cFYLJG001.ValiEndTime
47
-	inputData["rept_flag"] = cFYLJG001.ReptFlag
48
-	inputData["max_rept_cnt"] = cFYLJG001.MaxReptCnt
49
-	inputData["reptd_cnt"] = cFYLJG001.ReptdCnt
50
-	inputData["min_inrv_days"] = cFYLJG001.MinInrvDays
51
-	inputData["rx_cotn_flag"] = cFYLJG001.RxCotnFlag
52
-	inputData["long_rx_flag"] = cFYLJG001.LongRxFlag
53
-	inputData["mdtrtareaNo"] = cFYLJG001.MdtrtareaNo
20
+	// 生成输入报文
21
+	inputMessage := SetAHInputMessage(timestamp, org_name, opera, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, cainfo)
22
+	inputData := make(map[string]interface{}, 0)
23
+	inputData["mdtrtCertType"] = cFYLJG001.MdtrtCertType
24
+	inputData["mdtrtCertNo"] = cFYLJG001.MdtrtCertNo
25
+	inputData["cardSn"] = cFYLJG001.CardSn
26
+	inputData["bizTypeCode"] = cFYLJG001.BizTypeCode
27
+	inputData["rxExraAttrCode"] = ""
28
+	inputData["ecToken"] = cFYLJG001.EcToken
29
+	inputData["authNo"] = cFYLJG001.AuthNo
30
+	inputData["insuPlcNo"] = ""
31
+	inputData["mdtrtareaNo"] = ""
32
+	inputData["hospRxno"] = cFYLJG001.HospRxno
33
+	inputData["initRxno"] = cFYLJG001.InitRxno
34
+	inputData["rxTypeCode"] = cFYLJG001.RxTypeCode
35
+	inputData["prscTime"] = cFYLJG001.PrscTime
36
+	inputData["rxDrugCnt"] = cFYLJG001.RxDrugCnt
37
+	inputData["rxUsedWayCodg"] = cFYLJG001.RxUsedWayCodg
38
+	inputData["rxUsedWayName"] = cFYLJG001.RxUsedWayName
39
+	inputData["rxFrquCodg"] = cFYLJG001.RxFrquCodg
40
+	inputData["rxFrquName"] = cFYLJG001.RxFrquName
41
+	inputData["rxDosunt"] = cFYLJG001.RxDosunt
42
+	inputData["rxDoscnt"] = cFYLJG001.RxDoscnt
43
+	inputData["rxDrordDscr"] = cFYLJG001.RxDrordDscr
44
+	inputData["valiDays"] = cFYLJG001.ValiDays
45
+	inputData["valiEndTime"] = cFYLJG001.ValiEndTime
46
+	inputData["reptFlag"] = cFYLJG001.ReptFlag
47
+
48
+	inputData["maxReptCnt"] = cFYLJG001.MaxReptCnt
49
+	inputData["minInrvDays"] = cFYLJG001.MinInrvDays
50
+	inputData["rxCotnFlag"] = cFYLJG001.RxCotnFlag
51
+	inputData["longRxFlag"] = cFYLJG001.LongRxFlag
52
+
53
+	//inputData["reptd_cnt"] = cFYLJG001.ReptdCnt
54
+	//inputData["mdtrtareaNo"] = cFYLJG001.MdtrtareaNo
54 55
 
55 56
 	rxdrugdetail := make([]map[string]interface{}, 0)
56 57
 
57 58
 	rxdrug := make(map[string]interface{})
58 59
 	for _, item := range cFYLJG001.List {
59
-		rxdrug["med_list_codg"] = item.MedListCodg
60
-		rxdrug["medins_list_codg"] = item.MedinsListCodg
61
-		rxdrug["hosp_prep_flag"] = item.HospPrepFlag
62
-		rxdrug["rx_item_type_code"] = item.RxItemTypeCode
63
-		rxdrug["rx_item_type_name"] = item.RxItemTypeName
64
-		rxdrug["tcmdrug_type_name"] = item.TcmdrugTypeName
65
-		rxdrug["tcmdrug_type_code"] = item.TcmdrugTypeCode
66
-		rxdrug["tcmherb_foote"] = item.TcmherbFoote
67
-		rxdrug["medn_type_code"] = item.MednTypeCode
68
-		rxdrug["medn_type_name"] = item.MednTypeName
69
-		rxdrug["main_medc_flag"] = item.MainMedcFlag
70
-		rxdrug["urgt_flag"] = item.UrgtFlag
71
-		rxdrug["bas_medn_flag"] = item.BasMednFlag
72
-		rxdrug["imp_drug_flag"] = item.ImpDrugFlag
73
-		rxdrug["drug_prodname"] = item.DrugProdname
74
-		rxdrug["genname_codg"] = item.GennameCodg
75
-		rxdrug["drug_genname"] = item.DrugGenname
76
-		rxdrug["drug_dosform"] = item.DrugDosform
77
-		rxdrug["drug_spec"] = item.DrugSpec
78
-		rxdrug["prdr_name"] = item.PrdrName
79
-		rxdrug["medc_way_codg"] = item.MedcWayCodg
80
-		rxdrug["medc_way_dscr"] = item.MedcWayDscr
81
-		rxdrug["medc_begntime"] = item.MedcBegntime
82
-		rxdrug["medc_endtime"] = item.MedcEndtime
83
-		rxdrug["medc_days"] = item.MedcDays
84
-		rxdrug["drug_pric"] = item.DrugPric
85
-		rxdrug["drug_sumamt"] = item.DrugSumamt
86
-		rxdrug["drug_cnt"] = item.DrugCnt
87
-		rxdrug["drug_dosunt"] = item.DrugDosunt
88
-		rxdrug["sin_doscnt"] = item.SinDoscnt
89
-		rxdrug["sin_dosunt"] = item.SinDosunt
90
-		rxdrug["used_frqu_codg"] = item.UsedFrquCodg
91
-		rxdrug["used_frqu_name"] = item.UsedFrquName
92
-		rxdrug["drug_totlcnt"] = item.DrugTotlcnt
93
-
94
-		rxdrug["drug_totlcnt_emp"] = item.DrugTotlcntEmp
95
-		rxdrug["hosp_appr_flag"] = item.HospApprFlag
96
-		//rxdrug["extras"] = ""
60
+		rxdrug["medListCodg"] = item.MedListCodg
61
+		rxdrug["fixmedinsHilistId"] = item.MedinsListCodg
62
+		rxdrug["hospPrepFlag"] = item.HospPrepFlag
63
+		rxdrug["rxItemTypeCode"] = item.RxItemTypeCode
64
+		rxdrug["rxItemTypeName"] = item.RxItemTypeName
65
+		rxdrug["tcmdrugTypeName"] = item.TcmdrugTypeName
66
+		rxdrug["tcmdrugTypeCode"] = item.TcmdrugTypeCode
67
+		rxdrug["tcmherbFoote"] = item.TcmherbFoote
68
+
69
+		rxdrug["mednTypeCode"] = item.MednTypeCode
70
+		rxdrug["mednTypeName"] = item.MednTypeName
71
+		rxdrug["mainMedcFlag"] = item.MainMedcFlag
72
+
73
+		rxdrug["urgtFlag"] = item.UrgtFlag
74
+		rxdrug["basMednFlag"] = item.BasMednFlag
75
+		rxdrug["impDrugFlag"] = item.ImpDrugFlag
76
+		rxdrug["otcFlag"] = ""
77
+		rxdrug["drugGenname"] = item.DrugGenname
78
+		rxdrug["drugDosform"] = item.DrugDosform
79
+		rxdrug["drugSpec"] = item.DrugSpec
80
+		rxdrug["drugProdname"] = item.DrugProdname
81
+		rxdrug["prdrName"] = item.PrdrName
82
+		rxdrug["medcWayCodg"] = item.MedcWayCodg
83
+		rxdrug["medcWayDscr"] = item.MedcWayDscr
84
+		rxdrug["medcBegntime"] = item.MedcBegntime
85
+		rxdrug["medcEndtime"] = item.MedcEndtime
86
+		rxdrug["medcDays"] = item.MedcDays
87
+		rxdrug["sinDosunt"] = item.SinDosunt
88
+		rxdrug["sinDoscnt"] = item.SinDoscnt
89
+		rxdrug["usedFrquCodg"] = item.UsedFrquCodg
90
+		rxdrug["usedFrquName"] = item.UsedFrquName
91
+		rxdrug["drugDosunt"] = item.DrugDosunt
92
+		rxdrug["drugCnt"] = item.DrugCnt
93
+		rxdrug["drugPric"] = item.DrugPric
94
+		rxdrug["drugSumamt"] = item.DrugSumamt
95
+		rxdrug["hospApprFlag"] = item.HospApprFlag
96
+
97
+		rxdrug["selfPayRea"] = ""
98
+		rxdrug["realDscr"] = ""
99
+
100
+		//rxdrug["genname_codg"] = item.GennameCodg
101
+		//rxdrug["drug_totlcnt"] = item.DrugTotlcnt
102
+		//rxdrug["drug_totlcnt_emp"] = item.DrugTotlcntEmp
103
+		rxdrug["extras"] = ""
97 104
 		rxdrugdetail = append(rxdrugdetail, rxdrug)
98 105
 	}
99 106
 	inputData["rxdrugdetail"] = rxdrugdetail
100 107
 
101 108
 	mdtrtinfo := make(map[string]interface{})
102
-	mdtrtinfo["fixmedins_code"] = cFYLJG001.Mdtrtinfo.FixmedinsCode
103
-	mdtrtinfo["fixmedins_name"] = cFYLJG001.Mdtrtinfo.FixmedinsName
104
-	mdtrtinfo["mdtrt_id"] = cFYLJG001.Mdtrtinfo.MdtrtID
105
-	mdtrtinfo["med_type"] = cFYLJG001.Mdtrtinfo.MedType
106
-	mdtrtinfo["ipt_otp_no"] = cFYLJG001.Mdtrtinfo.IptOtpNo
107
-	mdtrtinfo["otp_ipt_flag"] = cFYLJG001.Mdtrtinfo.OtpIptFlag
108
-	mdtrtinfo["psn_no"] = cFYLJG001.Mdtrtinfo.PsnNo
109
-	mdtrtinfo["patn_name"] = cFYLJG001.Mdtrtinfo.PatnName
110
-	mdtrtinfo["psn_cert_type"] = cFYLJG001.Mdtrtinfo.PsnCertType
109
+	mdtrtinfo["fixmedinsCode"] = cFYLJG001.Mdtrtinfo.FixmedinsCode
110
+	mdtrtinfo["fixmedinsName"] = cFYLJG001.Mdtrtinfo.FixmedinsName
111
+	mdtrtinfo["mdtrtId"] = cFYLJG001.Mdtrtinfo.MdtrtID
112
+	mdtrtinfo["medType"] = cFYLJG001.Mdtrtinfo.MedType
113
+	mdtrtinfo["iptOtpNo"] = cFYLJG001.Mdtrtinfo.IptOtpNo
114
+	mdtrtinfo["otpIptFlag"] = cFYLJG001.Mdtrtinfo.OtpIptFlag
115
+	mdtrtinfo["psnNo"] = cFYLJG001.Mdtrtinfo.PsnNo
116
+	mdtrtinfo["patnName"] = cFYLJG001.Mdtrtinfo.PatnName
117
+	mdtrtinfo["psnCertType"] = cFYLJG001.Mdtrtinfo.PsnCertType
111 118
 	mdtrtinfo["certno"] = cFYLJG001.Mdtrtinfo.Certno
112
-	mdtrtinfo["patn_age"] = cFYLJG001.Mdtrtinfo.PatnAge
113
-	mdtrtinfo["patn_hgt"] = cFYLJG001.Mdtrtinfo.PatnHgt
114
-	mdtrtinfo["patn_wt"] = cFYLJG001.Mdtrtinfo.PatnWt
119
+	mdtrtinfo["patnAge"] = cFYLJG001.Mdtrtinfo.PatnAge
120
+	mdtrtinfo["patnHgt"] = cFYLJG001.Mdtrtinfo.PatnHgt
121
+	mdtrtinfo["patnWt"] = cFYLJG001.Mdtrtinfo.PatnWt
115 122
 	mdtrtinfo["gend"] = cFYLJG001.Mdtrtinfo.Gend
116 123
 	mdtrtinfo["birctrlType"] = cFYLJG001.Mdtrtinfo.BirctrlType
117 124
 	mdtrtinfo["birctrlMatnDate"] = cFYLJG001.Mdtrtinfo.BirctrlMatnDate
118 125
 	mdtrtinfo["matnType"] = cFYLJG001.Mdtrtinfo.MatnType
119
-	mdtrtinfo["geso_val"] = cFYLJG001.Mdtrtinfo.GesoVal
120
-	mdtrtinfo["nwb_flag"] = cFYLJG001.Mdtrtinfo.NwbFlag
121
-	mdtrtinfo["nwb_age"] = cFYLJG001.Mdtrtinfo.NwbAge
122
-	mdtrtinfo["suck_prd_flag"] = cFYLJG001.Mdtrtinfo.SuckPrdFlag
123
-	mdtrtinfo["algs_his"] = cFYLJG001.Mdtrtinfo.AlgsHis
124
-	mdtrtinfo["prsc_dept_name"] = cFYLJG001.Mdtrtinfo.PrscDeptName
125
-	mdtrtinfo["prsc_dept_code"] = cFYLJG001.Mdtrtinfo.PrscDeptCode
126
-	mdtrtinfo["dr_code"] = cFYLJG001.Mdtrtinfo.DrCode
127
-	mdtrtinfo["prsc_dr_name"] = cFYLJG001.Mdtrtinfo.PrscDrName
128
-	mdtrtinfo["prsc_dr_cert_type"] = cFYLJG001.Mdtrtinfo.PrscDrCertType
129
-	mdtrtinfo["prsc_dr_certno"] = cFYLJG001.Mdtrtinfo.PrscDrCertno
130
-	mdtrtinfo["dr_profttl_codg"] = cFYLJG001.Mdtrtinfo.DrProfttlCodg
131
-	mdtrtinfo["dr_profttl_name"] = cFYLJG001.Mdtrtinfo.DrProfttlName
132
-	mdtrtinfo["dr_dept_code"] = cFYLJG001.Mdtrtinfo.DrDeptCode
133
-	mdtrtinfo["dr_dept_name"] = cFYLJG001.Mdtrtinfo.DrDeptName
126
+	mdtrtinfo["gesoVal"] = cFYLJG001.Mdtrtinfo.GesoVal
127
+	mdtrtinfo["nwbFlag"] = cFYLJG001.Mdtrtinfo.NwbFlag
128
+	mdtrtinfo["nwbAge"] = cFYLJG001.Mdtrtinfo.NwbAge
129
+	mdtrtinfo["suckPrdFlag"] = cFYLJG001.Mdtrtinfo.SuckPrdFlag
130
+	mdtrtinfo["algsHis"] = cFYLJG001.Mdtrtinfo.AlgsHis
131
+	mdtrtinfo["prscDeptName"] = cFYLJG001.Mdtrtinfo.PrscDeptName
132
+	mdtrtinfo["prscDeptCode"] = cFYLJG001.Mdtrtinfo.PrscDeptCode
133
+	mdtrtinfo["drCode"] = cFYLJG001.Mdtrtinfo.DrCode
134
+	mdtrtinfo["prscDrName"] = cFYLJG001.Mdtrtinfo.PrscDrName
135
+	mdtrtinfo["prscDrCertType"] = cFYLJG001.Mdtrtinfo.PrscDrCertType
136
+	mdtrtinfo["prscDrCertno"] = cFYLJG001.Mdtrtinfo.PrscDrCertno
137
+	mdtrtinfo["drProfttlCodg"] = cFYLJG001.Mdtrtinfo.DrProfttlCodg
138
+	mdtrtinfo["drProfttlName"] = cFYLJG001.Mdtrtinfo.DrProfttlName
139
+	mdtrtinfo["drDeptCode"] = cFYLJG001.Mdtrtinfo.DrDeptCode
140
+	mdtrtinfo["drDeptName"] = cFYLJG001.Mdtrtinfo.DrDeptName
134 141
 	mdtrtinfo["caty"] = cFYLJG001.Mdtrtinfo.Caty
135
-	mdtrtinfo["mdtrt_time"] = cFYLJG001.Mdtrtinfo.MdtrtTime
136
-	mdtrtinfo["dise_codg"] = cFYLJG001.Mdtrtinfo.DiseCodg
137
-	mdtrtinfo["dise_name"] = cFYLJG001.Mdtrtinfo.DiseName
138
-	mdtrtinfo["sp_dise_flag"] = cFYLJG001.Mdtrtinfo.SpDiseFlag
139
-	mdtrtinfo["maindiag_code"] = cFYLJG001.Mdtrtinfo.MaindiagCode
140
-	mdtrtinfo["maindiag_name"] = cFYLJG001.Mdtrtinfo.MaindiagName
141
-	mdtrtinfo["dise_cond_dscr"] = cFYLJG001.Mdtrtinfo.DiseCondDscr
142
-	mdtrtinfo["hi_feesetl_flag"] = cFYLJG001.Mdtrtinfo.HiFeesetlFlag
143
-	mdtrtinfo["hi_feesetl_name"] = cFYLJG001.Mdtrtinfo.HiFeesetlName
144
-	mdtrtinfo["rgst_fee"] = cFYLJG001.Mdtrtinfo.RgstFee
145
-	mdtrtinfo["medfee_sumamt"] = cFYLJG001.Mdtrtinfo.MedfeeSumamt
146
-	mdtrtinfo["fstdiag_flag"] = cFYLJG001.Mdtrtinfo.FstdiagFlag
142
+	mdtrtinfo["mdtrtTime"] = cFYLJG001.Mdtrtinfo.MdtrtTime
143
+	mdtrtinfo["diseCodg"] = cFYLJG001.Mdtrtinfo.DiseCodg
144
+	mdtrtinfo["diseName"] = cFYLJG001.Mdtrtinfo.DiseName
145
+	mdtrtinfo["spDiseFlag"] = cFYLJG001.Mdtrtinfo.SpDiseFlag
146
+	mdtrtinfo["maindiagCode"] = cFYLJG001.Mdtrtinfo.MaindiagCode
147
+	mdtrtinfo["maindiagName"] = cFYLJG001.Mdtrtinfo.MaindiagName
148
+	mdtrtinfo["diseCondDscr"] = cFYLJG001.Mdtrtinfo.DiseCondDscr
149
+	mdtrtinfo["hiFeesetlType"] = cFYLJG001.Mdtrtinfo.HiFeesetlFlag
150
+	mdtrtinfo["hiFeesetlName"] = cFYLJG001.Mdtrtinfo.HiFeesetlName
151
+	mdtrtinfo["rgstFee"] = cFYLJG001.Mdtrtinfo.RgstFee
152
+	mdtrtinfo["medfeeSumamt"] = cFYLJG001.Mdtrtinfo.MedfeeSumamt
153
+	mdtrtinfo["fstdiagFlag"] = cFYLJG001.Mdtrtinfo.FstdiagFlag
147 154
 	type MyData struct {
148 155
 		Insutype string `json:"insutype"`
149 156
 	}
@@ -158,27 +165,31 @@ func GetAHCFYLJG001(org_name string, doctor string, fixmedins_code string, insup
158 165
 
159 166
 	for _, item := range cFYLJG001.Diseinfo {
160 167
 		diseinfo := make(map[string]interface{})
161
-		diseinfo["diag_type"] = item.DiagType
162
-		diseinfo["maindiag_flag"] = item.MaindiagFlag
163
-		diseinfo["diag_srt_no"] = item.DiagSrtNo
164
-		diseinfo["diag_code"] = item.DiagCode
165
-		diseinfo["diag_name"] = item.DiagName
166
-		diseinfo["diag_dept"] = item.DiagDept
167
-		diseinfo["diag_dr_no"] = item.DiagDrNo
168
-		diseinfo["diag_dr_name"] = item.DiagDrName
169
-		diseinfo["diag_time"] = item.DiagTime
170
-		diseinfo["tcm_dise_code"] = item.TcmDiseCode
171
-		diseinfo["tcm_dise_name"] = item.TcmDiseName
172
-		diseinfo["tcmsymp_code"] = item.TcmsympCode
168
+		diseinfo["diagType"] = item.DiagType
169
+		diseinfo["maindiagFlag"] = item.MaindiagFlag
170
+		diseinfo["diagSrtNo"] = item.DiagSrtNo
171
+		diseinfo["diagCode"] = item.DiagCode
172
+		diseinfo["diagName"] = item.DiagName
173
+		diseinfo["diagDept"] = item.DiagDept
174
+		diseinfo["diagDeptCode"] = ""
175
+
176
+		diseinfo["diagDrNo"] = item.DiagDrNo
177
+		diseinfo["diagDrName"] = item.DiagDrName
178
+		diseinfo["diagTime"] = item.DiagTime
179
+		diseinfo["tcmDiseCode"] = item.TcmDiseCode
180
+		diseinfo["tcmDiseName"] = item.TcmDiseName
181
+		diseinfo["tcmsympCode"] = item.TcmsympCode
173 182
 		diseinfo["tcmsymp"] = item.Tcmsymp
174 183
 		diseinfos = append(diseinfos, diseinfo)
175 184
 	}
176 185
 	inputData["diseinfo"] = diseinfos
177 186
 
178 187
 	inputMessage["input"] = inputData
188
+	argInputMessage := make(map[string]interface{})
189
+	argInputMessage["arg0"] = inputMessage
179 190
 
180 191
 	var inputLog string
181
-	bytesData, err := json.Marshal(inputMessage)
192
+	bytesData, err := json.Marshal(argInputMessage)
182 193
 	inputLog = string(bytesData)
183 194
 	fmt.Println(string(bytesData))
184 195
 	if err != nil {
@@ -186,17 +197,8 @@ func GetAHCFYLJG001(org_name string, doctor string, fixmedins_code string, insup
186 197
 		return err.Error(), ""
187 198
 	}
188 199
 	reader := bytes.NewReader(bytesData)
189
-	gdyb_url := beego.AppConfig.String("gdyb_url")
190
-	gdyb_paasid := beego.AppConfig.String("gdyb_paasid")
191 200
 
192
-	var url string
193
-	if fixmedins_code == "H15049901371" {
194
-		url = gdyb_url
195
-	} else {
196
-		url = gdyb_url + "CFYLJG001"
197
-	}
198
-
199
-	//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/1101"
201
+	url = url + "7101"
200 202
 	request, err := http.NewRequest("POST", url, reader)
201 203
 	if err != nil {
202 204
 		fmt.Println(err.Error())
@@ -204,10 +206,6 @@ func GetAHCFYLJG001(org_name string, doctor string, fixmedins_code string, insup
204 206
 	}
205 207
 
206 208
 	request.Header.Set("Content-Type", "application/json;charset=UTF-8")
207
-	request.Header.Set("x-tif-paasid", gdyb_paasid)
208
-	request.Header.Set("x-tif-signature", signature)
209
-	request.Header.Set("x-tif-timestamp", strconv.FormatInt(timestamp, 10))
210
-	request.Header.Set("x-tif-nonce", nonce)
211 209
 
212 210
 	client := http.Client{}
213 211
 	resp, err := client.Do(request)
@@ -226,26 +224,26 @@ func GetAHCFYLJG001(org_name string, doctor string, fixmedins_code string, insup
226 224
 
227 225
 }
228 226
 
229
-func GetAHCFYLJG002(org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string, original_value string, original_rx_file string, extras string) (string, string) {
230
-	//生成签名
231
-	nonce := GetRandomString(32)
227
+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) {
228
+	// 生成签名
232 229
 	timestamp := time.Now().Unix()
233
-	signature := setSignature(timestamp, nonce, secret_key)
234
-	//生成输入报文
235
-	inputMessage := SetInputMessage(nonce, timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs)
230
+	// 生成输入报文
231
+	inputMessage := SetAHInputMessage(timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, cainfo)
232
+
236 233
 	inputData := make(map[string]interface{})
237 234
 	inputDatas := make(map[string]interface{})
238 235
 
239
-	inputMessage["infno"] = "CFYLJG002"
240
-	inputData["fixmedins_code"] = fixmedins_code
241
-	inputData["original_value"] = original_value
242
-	inputData["original_rx_file"] = original_rx_file
236
+	inputMessage["infno"] = "7102"
237
+	inputData["fixmedinsCode"] = fixmedins_code
238
+	inputData["originalValue"] = original_value
239
+	inputData["originalRxFile"] = original_rx_file
243 240
 	inputData["extras"] = extras
244
-	inputDatas["rx_sign_info"] = inputData
241
+	inputDatas["data"] = inputData
245 242
 	inputMessage["input"] = inputDatas
246
-
243
+	argInputMessage := make(map[string]interface{})
244
+	argInputMessage["arg0"] = inputMessage
247 245
 	var inputLog string
248
-	bytesData, err := json.Marshal(inputMessage)
246
+	bytesData, err := json.Marshal(argInputMessage)
249 247
 	inputLog = string(bytesData)
250 248
 	fmt.Println(string(bytesData))
251 249
 	if err != nil {
@@ -253,28 +251,14 @@ func GetAHCFYLJG002(org_name string, doctor string, fixmedins_code string, insup
253 251
 		return err.Error(), ""
254 252
 	}
255 253
 	reader := bytes.NewReader(bytesData)
256
-	gdyb_url := beego.AppConfig.String("gdyb_url")
257
-	gdyb_paasid := beego.AppConfig.String("gdyb_paasid")
258
-
259
-	var url string
260
-	if fixmedins_code == "H15049901371" {
261
-		url = gdyb_url
262
-	} else {
263
-		url = gdyb_url + "CFYLJG002"
264
-	}
265
-
254
+	url = url + "7102"
266 255
 	//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/1101"
267 256
 	request, err := http.NewRequest("POST", url, reader)
268 257
 	if err != nil {
269 258
 		fmt.Println(err.Error())
270 259
 		return err.Error(), ""
271 260
 	}
272
-
273 261
 	request.Header.Set("Content-Type", "application/json;charset=UTF-8")
274
-	request.Header.Set("x-tif-paasid", gdyb_paasid)
275
-	request.Header.Set("x-tif-signature", signature)
276
-	request.Header.Set("x-tif-timestamp", strconv.FormatInt(timestamp, 10))
277
-	request.Header.Set("x-tif-nonce", nonce)
278 262
 
279 263
 	client := http.Client{}
280 264
 	resp, err := client.Do(request)
@@ -293,43 +277,43 @@ func GetAHCFYLJG002(org_name string, doctor string, fixmedins_code string, insup
293 277
 
294 278
 }
295 279
 
296
-func GetAHCFYLJG003(org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string, cFYLJG003 models.CFYLJG003) (string, string) {
280
+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) {
297 281
 	//生成签名
298
-	nonce := GetRandomString(32)
299 282
 	timestamp := time.Now().Unix()
300
-	signature := setSignature(timestamp, nonce, secret_key)
301
-	//生成输入报文
302
-	inputMessage := SetInputMessage(nonce, timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs)
303
-	//input := make(map[string]interface{})
283
+	// 生成输入报文
284
+	inputMessage := SetAHInputMessage(timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, cainfo)
285
+
304 286
 	inputData := make(map[string]interface{})
305 287
 	inputData2 := make(map[string]interface{})
306 288
 
307
-	inputMessage["infno"] = "CFYLJG003"
289
+	inputMessage["infno"] = "7103"
308 290
 
309
-	inputData["rx_trace_code"] = cFYLJG003.RxTraceCode
310
-	inputData["hi_rxno"] = cFYLJG003.HiRxno
311
-	inputData["mdtrt_id"] = cFYLJG003.MdtrtID
312
-	inputData["patn_name"] = cFYLJG003.PatnName
313
-	inputData["psn_cert_type"] = cFYLJG003.PsnCertType
291
+	inputData["rxTraceCode"] = cFYLJG003.RxTraceCode
292
+	inputData["hiRxno"] = cFYLJG003.HiRxno
293
+	inputData["mdtrtId"] = cFYLJG003.MdtrtID
294
+	inputData["patnName"] = cFYLJG003.PatnName
295
+	inputData["psnCertType"] = cFYLJG003.PsnCertType
314 296
 	inputData["certno"] = cFYLJG003.Certno
315
-	inputData["fixmedins_name"] = cFYLJG003.FixmedinsName
316
-	inputData["fixmedins_code"] = cFYLJG003.FixmedinsCode
317
-	inputData["dr_code"] = cFYLJG003.DrCode
318
-	inputData["prsc_dr_name"] = cFYLJG003.PrscDrName
319
-	inputData["phar_dept_name"] = cFYLJG003.PharDeptName
320
-	inputData["phar_dept_code"] = cFYLJG003.PharDeptCode
321
-	inputData["phar_profttl_codg"] = cFYLJG003.PharProfttlCodg
322
-	inputData["phar_profttl_name"] = cFYLJG003.PharProfttlName
323
-	inputData["phar_code"] = cFYLJG003.PharCode
324
-	inputData["rx_frqu_name"] = cFYLJG003.RxFrquName
325
-	inputData["phar_cert_type"] = cFYLJG003.PsnCertType
326
-	inputData["phar_certno"] = cFYLJG003.PharCertno
327
-	inputData["phar_name"] = cFYLJG003.PharName
328
-	inputData["phar_prac_cert_no"] = cFYLJG003.PharPracCertNo
329
-	inputData["phar_chk_time"] = cFYLJG003.PharChkTime
330
-	inputData["rx_file"] = cFYLJG003.RxFile
331
-	inputData["sign_digest"] = cFYLJG003.SignDigest
332
-	inputData2["rx_upload_info"] = inputData
297
+	inputData["fixmedinsName"] = cFYLJG003.FixmedinsName
298
+	inputData["fixmedinsCode"] = cFYLJG003.FixmedinsCode
299
+	inputData["drCode"] = cFYLJG003.DrCode
300
+	inputData["prscDrName"] = cFYLJG003.PrscDrName
301
+	inputData["pharDeptName"] = cFYLJG003.PharDeptName
302
+	inputData["pharDeptCode"] = cFYLJG003.PharDeptCode
303
+	inputData["pharProfttlCodg"] = cFYLJG003.PharProfttlCodg
304
+	inputData["pharProfttlName"] = cFYLJG003.PharProfttlName
305
+	inputData["pharCode"] = cFYLJG003.PharCode
306
+	inputData["pharCertType"] = cFYLJG003.PsnCertType
307
+	inputData["pharCertno"] = cFYLJG003.PharCertno
308
+	inputData["pharName"] = cFYLJG003.PharName
309
+	inputData["pharPracCertNo"] = cFYLJG003.PharPracCertNo
310
+	inputData["pharChkTime"] = cFYLJG003.PharChkTime
311
+	inputData["rxFile"] = cFYLJG003.RxFile
312
+	inputData["signDigest"] = cFYLJG003.SignDigest
313
+	inputData["extras"] = ""
314
+
315
+	//inputData["rx_frqu_name"] = cFYLJG003.RxFrquName
316
+	inputData2["data"] = inputData
333 317
 	inputMessage["input"] = inputData2
334 318
 	var inputLog string
335 319
 	bytesData, err := json.Marshal(inputMessage)
@@ -340,16 +324,7 @@ func GetAHCFYLJG003(org_name string, doctor string, fixmedins_code string, insup
340 324
 		return err.Error(), ""
341 325
 	}
342 326
 	reader := bytes.NewReader(bytesData)
343
-	gdyb_url := beego.AppConfig.String("gdyb_url")
344
-	gdyb_paasid := beego.AppConfig.String("gdyb_paasid")
345
-
346
-	var url string
347
-	if fixmedins_code == "H15049901371" {
348
-		url = gdyb_url
349
-	} else {
350
-		url = gdyb_url + "CFYLJG003"
351
-	}
352
-
327
+	url = url + "7102"
353 328
 	//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/1101"
354 329
 	request, err := http.NewRequest("POST", url, reader)
355 330
 	if err != nil {
@@ -358,11 +333,6 @@ func GetAHCFYLJG003(org_name string, doctor string, fixmedins_code string, insup
358 333
 	}
359 334
 
360 335
 	request.Header.Set("Content-Type", "application/json;charset=UTF-8")
361
-	request.Header.Set("x-tif-paasid", gdyb_paasid)
362
-	request.Header.Set("x-tif-signature", signature)
363
-	request.Header.Set("x-tif-timestamp", strconv.FormatInt(timestamp, 10))
364
-	request.Header.Set("x-tif-nonce", nonce)
365
-
366 336
 	client := http.Client{}
367 337
 	resp, err := client.Do(request)
368 338
 	if err != nil {
@@ -380,28 +350,28 @@ func GetAHCFYLJG003(org_name string, doctor string, fixmedins_code string, insup
380 350
 
381 351
 }
382 352
 
383
-func GetAHCFYLJG004(org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string, cFYLJG004 models.CFYLJG004) (string, string) {
384
-	//生成签名
385
-	nonce := GetRandomString(32)
353
+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) {
354
+	// 生成签名
386 355
 	timestamp := time.Now().Unix()
387
-	signature := setSignature(timestamp, nonce, secret_key)
388
-	//生成输入报文
389
-	inputMessage := SetInputMessage(nonce, timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs)
356
+	// 生成输入报文
357
+	inputMessage := SetAHInputMessage(timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, cainfo)
358
+
390 359
 	inputData := make(map[string]interface{})
391 360
 	inputData1 := make(map[string]interface{})
392
-
393 361
 	//inputDatas := make([]map[string]interface{}, 0)
394
-	inputMessage["infno"] = "CFYLJG004"
395
-	inputData["hi_rxno"] = cFYLJG004.HiRxno
396
-	inputData["undo_dr_code"] = cFYLJG004.UndoDrCode
397
-	inputData["undo_dr_name"] = cFYLJG004.UndoDrName
398
-	inputData["undo_dr_cert_type"] = cFYLJG004.UndoDrCertType
399
-	inputData["undo_dr_certno"] = cFYLJG004.UndoDrCertno
400
-	inputData["undo_rea"] = cFYLJG004.UndoRea
401
-	inputData["undo_time"] = cFYLJG004.UndoTime
402
-	inputData["fixmedins_code"] = cFYLJG004.FixmedinsCode
403
-	inputData1["rx_cancel_info"] = inputData
362
+	inputMessage["infno"] = "7104"
363
+	inputData["hiRxno"] = cFYLJG004.HiRxno
364
+	inputData["fixmedinsCode"] = cFYLJG004.FixmedinsCode
365
+	inputData["drCode"] = cFYLJG004.UndoDrCode
366
+	inputData["undoDrName"] = cFYLJG004.UndoDrName
367
+	inputData["undoDrCertType"] = cFYLJG004.UndoDrCertType
368
+	inputData["undoDrCertno"] = cFYLJG004.UndoDrCertno
369
+	inputData["undoRea"] = cFYLJG004.UndoRea
370
+	inputData["undoTime"] = cFYLJG004.UndoTime
371
+	inputData1["data"] = inputData
404 372
 	inputMessage["input"] = inputData1
373
+	argInputMessage := make(map[string]interface{})
374
+	argInputMessage["arg0"] = inputMessage
405 375
 	var inputLog string
406 376
 	bytesData, err := json.Marshal(inputMessage)
407 377
 	inputLog = string(bytesData)
@@ -411,15 +381,8 @@ func GetAHCFYLJG004(org_name string, doctor string, fixmedins_code string, insup
411 381
 		return err.Error(), ""
412 382
 	}
413 383
 	reader := bytes.NewReader(bytesData)
414
-	gdyb_url := beego.AppConfig.String("gdyb_url")
415
-	gdyb_paasid := beego.AppConfig.String("gdyb_paasid")
416 384
 
417
-	var url string
418
-	if fixmedins_code == "H15049901371" {
419
-		url = gdyb_url
420
-	} else {
421
-		url = gdyb_url + "CFYLJG004"
422
-	}
385
+	url = url + "CFYLJG004"
423 386
 
424 387
 	//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/1101"
425 388
 	request, err := http.NewRequest("POST", url, reader)
@@ -451,7 +414,7 @@ func GetAHCFYLJG004(org_name string, doctor string, fixmedins_code string, insup
451 414
 
452 415
 }
453 416
 
454
-func GetAHCFYLJG005(org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string, cFYLJG005 models.CFYLJG005) (string, string) {
417
+func GetAHCFYLJG005(org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string, cFYLJG005 models.CFYLJG005, cainfo string) (string, string) {
455 418
 	//生成签名
456 419
 	nonce := GetRandomString(32)
457 420
 	timestamp := time.Now().Unix()
@@ -463,19 +426,17 @@ func GetAHCFYLJG005(org_name string, doctor string, fixmedins_code string, insup
463 426
 
464 427
 	inputData2 := make(map[string]interface{})
465 428
 	//inputDatas := make([]map[string]interface{}, 0)
466
-
467
-	inputMessage["infno"] = "CFYLJG005"
468
-
469
-	inputData["fixmedins_code"] = fixmedins_code
470
-
471
-	inputData["hi_rxno"] = cFYLJG005.HiRxno
472
-	inputData["mdtrt_id"] = cFYLJG005.MdtrtID
473
-	inputData["ec_token"] = cFYLJG005.EcToken
474
-	inputData["psn_name"] = cFYLJG005.PsnName
475
-	inputData["psn_cert_type"] = cFYLJG005.PsnCertType
429
+	inputMessage["infno"] = "7105"
430
+	inputData["fixmedinsCode"] = fixmedins_code
431
+	inputData["hiRxno"] = cFYLJG005.HiRxno
432
+	inputData["mdtrtId"] = cFYLJG005.MdtrtID
433
+	inputData["psnName"] = cFYLJG005.PsnName
434
+	inputData["psnCertType"] = cFYLJG005.PsnCertType
476 435
 	inputData["certno"] = cFYLJG005.Certno
477
-	inputData2["rx_detl_query"] = inputData
436
+	inputData2["data"] = inputData
478 437
 	inputMessage["input"] = inputData2
438
+	argInputMessage := make(map[string]interface{})
439
+	argInputMessage["arg0"] = inputMessage
479 440
 	var inputLog string
480 441
 	bytesData, err := json.Marshal(inputMessage)
481 442
 	inputLog = string(bytesData)
@@ -485,15 +446,10 @@ func GetAHCFYLJG005(org_name string, doctor string, fixmedins_code string, insup
485 446
 		return err.Error(), ""
486 447
 	}
487 448
 	reader := bytes.NewReader(bytesData)
488
-	gdyb_url := beego.AppConfig.String("gdyb_url")
489
-	gdyb_paasid := beego.AppConfig.String("gdyb_paasid")
490 449
 
491 450
 	var url string
492
-	if fixmedins_code == "H15049901371" {
493
-		url = gdyb_url
494
-	} else {
495
-		url = gdyb_url + "CFYLJG005"
496
-	}
451
+
452
+	url = url + "7105"
497 453
 
498 454
 	//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/1101"
499 455
 	request, err := http.NewRequest("POST", url, reader)
@@ -503,11 +459,6 @@ func GetAHCFYLJG005(org_name string, doctor string, fixmedins_code string, insup
503 459
 	}
504 460
 
505 461
 	request.Header.Set("Content-Type", "application/json;charset=UTF-8")
506
-	request.Header.Set("x-tif-paasid", gdyb_paasid)
507
-	request.Header.Set("x-tif-signature", signature)
508
-	request.Header.Set("x-tif-timestamp", strconv.FormatInt(timestamp, 10))
509
-	request.Header.Set("x-tif-nonce", nonce)
510
-
511 462
 	client := http.Client{}
512 463
 	resp, err := client.Do(request)
513 464
 	if err != nil {
@@ -536,14 +487,13 @@ func GetAHCFYLJG006(org_name string, doctor string, fixmedins_code string, insup
536 487
 	inputData2 := make(map[string]interface{})
537 488
 
538 489
 	inputMessage["infno"] = "CFYLJG006"
539
-
540
-	inputData["fixmedins_code"] = fixmedins_code
541
-	inputData["hi_rxno"] = cFYLJG006.HiRxno
542
-	inputData["mdtrt_id"] = cFYLJG006.MdtrtID
543
-	inputData["psn_cert_type"] = cFYLJG006.PsnCertType
490
+	inputData["fixmedinsCode"] = fixmedins_code
491
+	inputData["hiRxno"] = cFYLJG006.HiRxno
492
+	inputData["mdtrtId"] = cFYLJG006.MdtrtID
493
+	inputData["psnName"] = cFYLJG006.PsnName
494
+	inputData["psnCertType"] = cFYLJG006.PsnCertType
544 495
 	inputData["certno"] = cFYLJG006.Certno
545
-	inputData["psn_name"] = cFYLJG006.PsnName
546
-	inputData2["rx_chk_info"] = inputData
496
+	inputData2["data"] = inputData
547 497
 	inputMessage["input"] = inputData2
548 498
 	var inputLog string
549 499
 	bytesData, err := json.Marshal(inputMessage)
@@ -607,15 +557,14 @@ func GetAHCFYLJG007(org_name string, doctor string, fixmedins_code string, insup
607 557
 
608 558
 	inputMessage["infno"] = "CFYLJG007"
609 559
 
610
-	inputData["fixmedins_code"] = fixmedins_code
611
-	inputData["hi_rxno"] = cFYLJG007.HiRxno
612
-	inputData["mdtrt_id"] = cFYLJG007.MdtrtID
613
-	inputData["psn_no"] = cFYLJG007.PsnNo
614
-	inputData["psn_cert_type"] = cFYLJG007.PsnCertType
560
+	inputData["fixmedinsCode"] = fixmedins_code
561
+	inputData["hiRxno"] = cFYLJG007.HiRxno
562
+	inputData["mdtrtId"] = cFYLJG007.MdtrtID
563
+	inputData["psnCertType"] = cFYLJG007.PsnCertType
615 564
 	inputData["certno"] = cFYLJG007.Certno
616
-	inputData["psn_name"] = cFYLJG007.PsnName
565
+	inputData["psnName"] = cFYLJG007.PsnName
617 566
 
618
-	inputData2["rx_setl_query"] = inputData
567
+	inputData2["data"] = inputData
619 568
 
620 569
 	inputMessage["input"] = inputData2
621 570
 	var inputLog string
@@ -666,85 +615,76 @@ func GetAHCFYLJG007(org_name string, doctor string, fixmedins_code string, insup
666 615
 	return str, inputLog
667 616
 
668 617
 }
669
-func GetAHCFYLJG008(org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string, cFYLJG008 models.CFYLJG008) (string, string) {
670
-	//生成签名
671
-	nonce := GetRandomString(32)
672
-	timestamp := time.Now().Unix()
673
-	signature := setSignature(timestamp, nonce, secret_key)
674
-	//生成输入报文
675
-	inputMessage := SetInputMessage(nonce, timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs)
676
-	inputData := make(map[string]interface{})
677
-	//inputData2 := make(map[string]interface{})
678
-
679
-	//inputDatas := make([]map[string]interface{}, 0)
680
-
681
-	inputMessage["infno"] = "CFYLJG008"
682
-
683
-	inputData["pageNum"] = cFYLJG008.PageNum
684
-	inputData["pageSize"] = cFYLJG008.PageSize
685
-	inputData["orderType"] = cFYLJG008.OrderType
686
-	inputData["poolareaNo"] = cFYLJG008.PoolareaNo
687
-	inputData["fixmedinsName"] = cFYLJG008.FixmedinsName
688
-	inputData["lng"] = cFYLJG008.Lng
689
-	inputData["lat"] = cFYLJG008.Lat
690
-	inputData["medinsProdInvChgDDTOList"] = cFYLJG008.MedList
691
-
692
-	inputMessage["input"] = inputData
693
-	var inputLog string
694
-	bytesData, err := json.Marshal(inputMessage)
695
-	inputLog = string(bytesData)
696
-	fmt.Println(string(bytesData))
697
-	if err != nil {
698
-		fmt.Println(err.Error())
699
-		return err.Error(), ""
700
-	}
701
-	reader := bytes.NewReader(bytesData)
702
-	gdyb_url := beego.AppConfig.String("gdyb_url")
703
-	gdyb_paasid := beego.AppConfig.String("gdyb_paasid")
704
-
705
-	var url string
706
-	if fixmedins_code == "H15049901371" {
707
-		url = gdyb_url
708
-	} else {
709
-		url = gdyb_url + "CFYLJG007"
710
-	}
711
-
712
-	//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/1101"
713
-	request, err := http.NewRequest("POST", url, reader)
714
-	if err != nil {
715
-		fmt.Println(err.Error())
716
-		return err.Error(), ""
717
-	}
718
-
719
-	request.Header.Set("Content-Type", "application/json;charset=UTF-8")
720
-	request.Header.Set("x-tif-paasid", gdyb_paasid)
721
-	request.Header.Set("x-tif-signature", signature)
722
-	request.Header.Set("x-tif-timestamp", strconv.FormatInt(timestamp, 10))
723
-	request.Header.Set("x-tif-nonce", nonce)
724
-
725
-	client := http.Client{}
726
-	resp, err := client.Do(request)
727
-	if err != nil {
728
-		fmt.Println(err.Error())
729
-		return err.Error(), ""
730
-	}
731
-	respBytes, err := ioutil.ReadAll(resp.Body)
732
-	if err != nil {
733
-		fmt.Println(err.Error())
734
-		return err.Error(), ""
735
-	}
736
-	fmt.Println(string(respBytes))
737
-	str := string(respBytes)
738
-	return str, inputLog
739
-
740
-}
741
-
742
-func Getflow(id int64) (flow models.HisPrescriptionFlow, err error) {
743
-	err = readDb.Model(&models.HisPrescriptionFlow{}).Where("id = ?", id).First(&flow).Error
744
-	return
745
-}
746 618
 
747
-func Getflowtwo(m_id string) (flow models.HisPrescriptionFlow, err error) {
748
-	err = readDb.Model(&models.HisPrescriptionFlow{}).Where("m_id = ?", m_id).First(&flow).Error
749
-	return
750
-}
619
+//func GetAHCFYLJG008(org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string, cFYLJG008 models.CFYLJG008) (string, string) {
620
+//	//生成签名
621
+//	nonce := GetRandomString(32)
622
+//	timestamp := time.Now().Unix()
623
+//	signature := setSignature(timestamp, nonce, secret_key)
624
+//	//生成输入报文
625
+//	inputMessage := SetInputMessage(nonce, timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs)
626
+//	inputData := make(map[string]interface{})
627
+//	//inputData2 := make(map[string]interface{})
628
+//
629
+//	//inputDatas := make([]map[string]interface{}, 0)
630
+//
631
+//	inputMessage["infno"] = "CFYLJG008"
632
+//
633
+//	inputData["pageNum"] = cFYLJG008.PageNum
634
+//	inputData["pageSize"] = cFYLJG008.PageSize
635
+//	inputData["orderType"] = cFYLJG008.OrderType
636
+//	inputData["poolareaNo"] = cFYLJG008.PoolareaNo
637
+//	inputData["fixmedinsName"] = cFYLJG008.FixmedinsName
638
+//	inputData["lng"] = cFYLJG008.Lng
639
+//	inputData["lat"] = cFYLJG008.Lat
640
+//	inputData["medinsProdInvChgDDTOList"] = cFYLJG008.MedList
641
+//
642
+//	inputMessage["input"] = inputData
643
+//	var inputLog string
644
+//	bytesData, err := json.Marshal(inputMessage)
645
+//	inputLog = string(bytesData)
646
+//	fmt.Println(string(bytesData))
647
+//	if err != nil {
648
+//		fmt.Println(err.Error())
649
+//		return err.Error(), ""
650
+//	}
651
+//	reader := bytes.NewReader(bytesData)
652
+//	gdyb_url := beego.AppConfig.String("gdyb_url")
653
+//	gdyb_paasid := beego.AppConfig.String("gdyb_paasid")
654
+//
655
+//	var url string
656
+//	if fixmedins_code == "H15049901371" {
657
+//		url = gdyb_url
658
+//	} else {
659
+//		url = gdyb_url + "CFYLJG007"
660
+//	}
661
+//
662
+//	//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/1101"
663
+//	request, err := http.NewRequest("POST", url, reader)
664
+//	if err != nil {
665
+//		fmt.Println(err.Error())
666
+//		return err.Error(), ""
667
+//	}
668
+//
669
+//	request.Header.Set("Content-Type", "application/json;charset=UTF-8")
670
+//	request.Header.Set("x-tif-paasid", gdyb_paasid)
671
+//	request.Header.Set("x-tif-signature", signature)
672
+//	request.Header.Set("x-tif-timestamp", strconv.FormatInt(timestamp, 10))
673
+//	request.Header.Set("x-tif-nonce", nonce)
674
+//
675
+//	client := http.Client{}
676
+//	resp, err := client.Do(request)
677
+//	if err != nil {
678
+//		fmt.Println(err.Error())
679
+//		return err.Error(), ""
680
+//	}
681
+//	respBytes, err := ioutil.ReadAll(resp.Body)
682
+//	if err != nil {
683
+//		fmt.Println(err.Error())
684
+//		return err.Error(), ""
685
+//	}
686
+//	fmt.Println(string(respBytes))
687
+//	str := string(respBytes)
688
+//	return str, inputLog
689
+//
690
+//}

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 198 - 219
service/ahyb_service.go