test_user 2 settimane fa
parent
commit
2829ea26e0

+ 27 - 11
controllers/ah/ahyb_controller.go Vedi File

@@ -304,6 +304,10 @@ func (c *AHybController) PostTwo() {
304 304
 	doctor_name := c.GetString("doctor_name")
305 305
 	cainfo := c.GetString("cainfo")
306 306
 	card_sn := c.GetString("card_sn")
307
+	fmt.Println("Error decoding JSON:", verify_number)
308
+	fmt.Println("Error decoding JSON:", certNo)
309
+
310
+
307 311
 
308 312
 
309 313
 	result, inputLog := service.AHyb2201(psnNo, insutype, certNo, org_name, opera, ipt_otp_no, dept, fixmedins_code, dept_code, doctor_id, insuplc_admdvs, mdtrtarea_admvs, secret_key, id_card_type, doctor_name, url, ak, verify_number, cainfo,card_sn)
@@ -562,6 +566,7 @@ func (c *AHybController) PostFive() {
562 566
 	result, inputLog := service.AHyb2204(respJSON["psn_no"].(string), respJSON["mdtrt_id"].(string), hp, respJSON["chrg_bchno"].(string), respJSON["org_name"].(string),
563 567
 		respJSON["doctor"].(string), respJSON["dept"].(string), respJSON["fixmedins_code"].(string), respJSON["dept_code"].(string), respJSON["doctor_id"].(string), respJSON["insuplc_admdvs"].(string), respJSON["mdtrtarea_admvs"].(string), respJSON["secret_key"].(string), respJSON["balance_accounts_type"].(string), respJSON["diag_code"].(string), respJSON["url"].(string), respJSON["ak"].(string), respJSON["new_doctor_name"].(string), "", respJSON["cainfo"].(string), respJSON["opter"].(string))
564 568
 
569
+
565 570
 	saveJsLog(result, inputLog, "2204", "上传明细", respJSON["org_name"].(string))
566 571
 	var response Response
567 572
 	if err := json.Unmarshal([]byte(result), &response); err != nil {
@@ -1021,18 +1026,29 @@ func (c *AHybController) ReadCard() {
1021 1026
 
1022 1027
 		if len(pCardInfo) > 0 {
1023 1028
 			result, _ := service.AHyb1101A(basNumber, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, secret_key, id_card_type_int, card_sn, "1", url, ak, id_card_no, cainfo)
1024
-			var dat map[string]interface{}
1025
-			if err := json.Unmarshal([]byte(result), &dat); err == nil {
1026
-				fmt.Println(dat)
1027
-			} else {
1028
-				fmt.Println(err)
1029
+
1030
+
1031
+			var response Response
1032
+			if err := json.Unmarshal([]byte(result), &response); err != nil {
1033
+				fmt.Println("Error decoding JSON:", err)
1034
+				return
1029 1035
 			}
1030
-			c.ServeSuccessJSON(map[string]interface{}{
1031
-				"status":         "0",
1032
-				"card_info":      pCardInfo,
1033
-				"result":         dat,
1034
-				"type":           "1",
1035
-			})
1036
+			if  response.Code == 200{
1037
+				c.ServeSuccessJSON(map[string]interface{}{
1038
+					"status":         "0",
1039
+					"card_info":      pCardInfo,
1040
+					"result":         response.Body,
1041
+					"type":           "1",
1042
+				})
1043
+			}else{
1044
+
1045
+				c.ServeSuccessJSON(map[string]interface{}{
1046
+					"status":"0",
1047
+					"msg":response.Message,
1048
+				})
1049
+
1050
+			}
1051
+
1036 1052
 		} else {
1037 1053
 			c.ServeSuccessJSON(map[string]interface{}{
1038 1054
 				"status": "-1",

+ 75 - 16
controllers/sg/his_api_controller.go Vedi File

@@ -25851,6 +25851,7 @@ func (c *HisApiController) GetRegisterInfo() {
25851 25851
 				his.PsnNo = psn_info.PsnNo
25852 25852
 				psn_info.VerifyNumber = strings.Replace(psn_info.VerifyNumber, "+", "%2B", -1)
25853 25853
 				var cert_no string
25854
+
25854 25855
 				if id_card_type == 1 {
25855 25856
 					bas := strings.Split(psn_info.CardInfo, "|")
25856 25857
 					cert_no = bas[2]
@@ -25869,7 +25870,7 @@ func (c *HisApiController) GetRegisterInfo() {
25869 25870
 				his.Insutype = insutype
25870 25871
 				var api string
25871 25872
 				ipt_otp_no = timeFormat
25872
-				api = miConfig.SecretKey + "ahyb/2201?psn_no=" + PsnNo + "&insutype=" + insutype + "&cert_no=" + cert_no + "&ipt_otp_no=" + ipt_otp_no +
25873
+				api = miConfig.SecretKey + "ahyb/2201?verify_number="+cert_no+"&cert_no="+IdCardNo+"&psn_no=" + PsnNo + "&insutype=" + insutype + "&cert_no=" + cert_no + "&ipt_otp_no=" + ipt_otp_no +
25873 25874
 					"&org_name=" + miConfig.OrgName + "&opera=" + roles.UserName + "&doctor_name=" + doctor_info.UserName + "&fixmedins_code=" + miConfig.Code +
25874 25875
 					"&insuplc_admdvs=" + insuplc_admdvs_temp + "&mdtrtarea_admvs=" + miConfig.MdtrtareaAdmvs + "&secret_key=" + miConfig.SecretKey + "&id_card_type=" + strconv.FormatInt(id_card_type, 10) + "&dept_code=" + department.Number + "&dept=" + department.Name + "&doctor_id=" + doctor_info.DoctorNumber + "&url=" + miConfig.Url + "&ak=" + miConfig.AccessKey + "&verify_number=" + psn_info.VerifyNumber + "&cainfo=" + miConfig.Cainfo
25875 25876
 
@@ -25931,7 +25932,7 @@ func (c *HisApiController) GetRegisterInfo() {
25931 25932
 				his.Insutype = insutype
25932 25933
 				var api string
25933 25934
 				ipt_otp_no = timeFormat
25934
-				api = miConfig.SecretKey + "ahyb/2201?psn_no=" + PsnNo + "&insutype=" + insutype + "&cert_no=" + cert_no + "&ipt_otp_no=" + ipt_otp_no +
25935
+				api = miConfig.SecretKey + "ahyb/2201?psn_no=" + PsnNo +"&verify_number="+cert_no+"&cert_no="+IdCardNo+ "&insutype=" + insutype + "&cert_no=" + cert_no + "&ipt_otp_no=" + ipt_otp_no +
25935 25936
 					"&org_name=" + miConfig.OrgName + "&opera=" + roles.UserName + "&doctor_name=" + doctor_info.UserName + "&fixmedins_code=" + miConfig.Code +
25936 25937
 					"&insuplc_admdvs=" + insuplc_admdvs_temp + "&mdtrtarea_admvs=" + miConfig.MdtrtareaAdmvs + "&secret_key=" + miConfig.SecretKey + "&id_card_type=" + strconv.FormatInt(id_card_type, 10) + "&dept_code=" + department.Number + "&dept=" + department.Name + "&doctor_id=" + doctor_info.DoctorNumber + "&url=" + miConfig.Url + "&ak=" + miConfig.AccessKey + "&verify_number=" + psn_info.VerifyNumber + "&cainfo=" + miConfig.Cainfo
25937 25938
 
@@ -29306,6 +29307,10 @@ func (c *HisApiController) GetUploadInfo() {
29306 29307
 					if reg_type == 140104 {
29307 29308
 						med_type = "140104"
29308 29309
 					}
29310
+
29311
+					if reg_type == 140201 {
29312
+						med_type = "140201"
29313
+					}
29309 29314
 					if reg_type == 14 {
29310 29315
 						med_type = "14"
29311 29316
 					}
@@ -29313,6 +29318,13 @@ func (c *HisApiController) GetUploadInfo() {
29313 29318
 					if reg_type == 992102 {
29314 29319
 						med_type = "992102"
29315 29320
 					}
29321
+					if reg_type == 140104 {
29322
+						med_type = "140104"
29323
+					}
29324
+
29325
+					if reg_type == 140201 {
29326
+						med_type = "140201"
29327
+					}
29316 29328
 					if reg_type == 14 {
29317 29329
 						med_type = "14"
29318 29330
 					}
@@ -30681,8 +30693,13 @@ func (c *HisApiController) GetPreUploadInfo() {
30681 30693
 				data["sick_code"] = sickConfig.CountryCode
30682 30694
 				data["sick_name"] = sickConfig.ClassName
30683 30695
 			}
30696
+			if reg_type == 140201 {
30697
+				med_type = "140201"
30698
+				data["sick_code"] = sickConfig.CountryCode
30699
+				data["sick_name"] = sickConfig.ClassName
30700
+			}
30684 30701
 			if reg_type == 14 {
30685
-				med_type = "140104"
30702
+				med_type = "14"
30686 30703
 				data["sick_code"] = sickConfig.CountryCode
30687 30704
 				data["sick_name"] = sickConfig.ClassName
30688 30705
 			}
@@ -30690,18 +30707,23 @@ func (c *HisApiController) GetPreUploadInfo() {
30690 30707
 			if reg_type == 992102 {
30691 30708
 				med_type = "992102"
30692 30709
 				data["sick_code"] = sickConfig.CountryCode
30693
-				data["sick_name"] = sickConfig.CountryCode
30710
+				data["sick_name"] = sickConfig.ClassName
30711
+
30694 30712
 			}
30695 30713
 			if reg_type == 140104 {
30696 30714
 				med_type = "140104"
30697 30715
 				data["sick_code"] = sickConfig.CountryCode
30698
-				data["sick_name"] = sickConfig.CountryCode
30716
+				data["sick_name"] = sickConfig.ClassName
30717
+			}
30718
+			if reg_type == 140201 {
30719
+				med_type = "140201"
30720
+				data["sick_code"] = sickConfig.CountryCode
30721
+				data["sick_name"] = sickConfig.ClassName
30699 30722
 			}
30700 30723
 			if reg_type == 14 {
30701 30724
 				med_type = "14"
30702 30725
 				data["sick_code"] = sickConfig.CountryCode
30703 30726
 				data["sick_name"] = sickConfig.ClassName
30704
-
30705 30727
 			}
30706 30728
 		}
30707 30729
 
@@ -31002,20 +31024,38 @@ func (c *HisApiController) GetPreUploadInfo() {
31002 31024
 
31003 31025
 				data["diag_code"] = sickConfig.CountryCode
31004 31026
 
31027
+			}
31028
+			if reg_type == 140201 {
31029
+
31030
+				data["diag_code"] = sickConfig.CountryCode
31031
+
31005 31032
 			}
31006 31033
 			if reg_type == 14 {
31007 31034
 				data["diag_code"] = sickConfig.CountryCode
31008 31035
 
31009 31036
 			}
31010 31037
 		} else if his.Insutype == "310" {
31011
-			if reg_type == 992102 {
31012
-				data["diag_code"] = "ZDZ940"
31038
+			if miConfig.MdtrtareaAdmvs == "341203"{
31039
+				if reg_type == 992102 {
31040
+					data["diag_code"] = "ZDZ940"
31041
+
31042
+				}
31043
+				if reg_type != 992102 {
31044
+					data["diag_code"] = sickConfig.CountryCode
31045
+
31046
+				}
31047
+
31048
+
31049
+			}else{
31050
+
31051
+
31052
+
31053
+					data["diag_code"] = sickConfig.CountryCode
31054
+
31013 31055
 
31014
-			}
31015
-			if reg_type == 14 {
31016
-				data["diag_code"] = sickConfig.CountryCode
31017 31056
 
31018 31057
 			}
31058
+
31019 31059
 		}
31020 31060
 
31021 31061
 		data["cainfo"] = miConfig.Cainfo
@@ -32475,6 +32515,9 @@ func (c *HisApiController) GetPreUploadInfo() {
32475 32515
 							if reg_type == 140104 {
32476 32516
 								med_type = "140104"
32477 32517
 							}
32518
+							if reg_type == 140201 {
32519
+								med_type = "140201"
32520
+							}
32478 32521
 							if reg_type == 14 {
32479 32522
 								med_type = "140104"
32480 32523
 							}
@@ -32483,9 +32526,14 @@ func (c *HisApiController) GetPreUploadInfo() {
32483 32526
 								med_type = "992102"
32484 32527
 
32485 32528
 							}
32529
+							if reg_type == 140104 {
32530
+								med_type = "140104"
32531
+							}
32532
+							if reg_type == 140201 {
32533
+								med_type = "140201"
32534
+							}
32486 32535
 							if reg_type == 14 {
32487
-								med_type = "14"
32488
-
32536
+								med_type = "140104"
32489 32537
 							}
32490 32538
 						}
32491 32539
 
@@ -32631,17 +32679,24 @@ func (c *HisApiController) GetPreUploadInfo() {
32631 32679
 							if reg_type == 140104 {
32632 32680
 								med_type = "140104"
32633 32681
 							}
32682
+							if reg_type == 140201 {
32683
+								med_type = "140201"
32684
+							}
32634 32685
 							if reg_type == 14 {
32635
-								med_type = "140104"
32686
+								med_type = "14"
32636 32687
 							}
32637 32688
 						} else if his.Insutype == "310" {
32638 32689
 							if reg_type == 992102 {
32639 32690
 								med_type = "992102"
32640
-
32691
+							}
32692
+							if reg_type == 140104 {
32693
+								med_type = "140104"
32694
+							}
32695
+							if reg_type == 140201 {
32696
+								med_type = "140201"
32641 32697
 							}
32642 32698
 							if reg_type == 14 {
32643 32699
 								med_type = "14"
32644
-
32645 32700
 							}
32646 32701
 						}
32647 32702
 
@@ -33175,6 +33230,10 @@ func (c *HisApiController) GetPreUploadInfo() {
33175 33230
 						if res.Output.Setlinfo.MedType == "140104" {
33176 33231
 							order.MedType = "140104"
33177 33232
 
33233
+						}
33234
+						if res.Output.Setlinfo.MedType == "140201" {
33235
+							order.MedType = "140201"
33236
+
33178 33237
 						}
33179 33238
 						if res.Output.Setlinfo.MedType == "14" {
33180 33239
 							order.MedType = "14"

+ 1 - 1
service/ahyb_service.go Vedi File

@@ -1239,7 +1239,7 @@ func AHyb2207(psnNo string, mdtrtId string, chrgBchno string, certNo string, ins
1239 1239
 
1240 1240
 	if id_card_type == 1 {
1241 1241
 		inputData["mdtrt_cert_type"] = "03"                       // 就诊凭证类型
1242
-		inputData["mdtrt_cert_no"] = certNo + "|" + verify_number // 就诊凭证编号
1242
+		inputData["mdtrt_cert_no"] = certNo  // 就诊凭证编号
1243 1243
 	} else if id_card_type == 3 {
1244 1244
 		inputData["mdtrt_cert_type"] = "04"        // 就诊凭证类型
1245 1245
 		inputData["mdtrt_cert_no"] = verify_number // 就诊凭证编号