ソースを参照

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

csx 3 年 前
コミット
1120dffe12
共有6 個のファイルを変更した246 個の追加53 個の削除を含む
  1. 1 1
      conf/app.conf
  2. 47 40
      controllers/sg/his_api_controller.go
  3. 11 7
      controllers/sz/sz_his_api_controller.go
  4. 2 0
      models/his_models.go
  5. 174 2
      service/gdyb_service.go
  6. 11 3
      service/hbyb_service.go

+ 1 - 1
conf/app.conf ファイルの表示

@@ -45,7 +45,7 @@ appsecret="61ee2e6268497d5aa9de0b0187c39aea"
45 45
 
46 46
 
47 47
 [prod]
48
-org_id = 9504
48
+org_id = 10088
49 49
 mobile_token_expiration_second = 86400
50 50
 httpdomain = https://api.xt.kuyicloud.com
51 51
 sso_domain = https://sso.kuyicloud.com

+ 47 - 40
controllers/sg/his_api_controller.go ファイルの表示

@@ -1976,26 +1976,28 @@ func (c *HisApiController) GetRegisterInfo() {
1976 1976
 
1977 1977
 			var rf []*ResultFive
1978 1978
 			json.Unmarshal([]byte(his.Iinfo), &rf)
1979
-			var insutypes []string
1979
+			var insutypes []*ResultFive
1980 1980
 			var insutype string
1981
+			var insuplc_admdvs string
1981 1982
 			var is390 int = 0
1982 1983
 			var is310 int = 0
1983 1984
 
1984 1985
 			for _, item := range rf {
1985 1986
 				if (item.Insutype == "390" && item.PsnInsuStas == "1") || (item.Insutype == "310" && item.PsnInsuStas == "1") {
1986
-					insutypes = append(insutypes, item.Insutype)
1987
+					insutypes = append(insutypes, item)
1987 1988
 				}
1988 1989
 			}
1989 1990
 
1990 1991
 			if len(insutypes) == 1 {
1991
-				insutype = insutypes[0]
1992
+				insutype = insutypes[0].Insutype
1993
+				//insuplc_admdvs = insutypes[0].InsuplcAdmdvs
1992 1994
 			} else {
1993 1995
 				for _, i := range insutypes {
1994
-					if i == "390" {
1996
+					if i.Insutype == "390" {
1995 1997
 						is390 = 1
1996 1998
 					}
1997 1999
 
1998
-					if i == "310" {
2000
+					if i.Insutype == "310" {
1999 2001
 						is310 = 1
2000 2002
 					}
2001 2003
 				}
@@ -2015,12 +2017,16 @@ func (c *HisApiController) GetRegisterInfo() {
2015 2017
 			if len(insutypes) == 2 {
2016 2018
 				insutype = med_type
2017 2019
 			}
2018
-
2020
+			for _, item := range rf {
2021
+				if item.Insutype == insutype {
2022
+					insuplc_admdvs = item.InsuplcAdmdvs
2023
+				}
2024
+			}
2019 2025
 			var resThree ResultThree
2020 2026
 			if miConfig.MdtrtareaAdmvs == "421300" {
2021 2027
 				api := "http://192.168.124.4:9532/" + "hbyb/2201?psn_no=" + PsnNo + "&insutype=" + insutype + "&cert_no=" + Certno + "&ipt_otp_no=" + ipt_otp_no +
2022 2028
 					"&org_name=" + miConfig.OrgName + "&doctor=" + roles.UserName + "&fixmedins_code=" + miConfig.Code +
2023
-					"&insuplc_admdvs=" + miConfig.InsuplcAdmdvs + "&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_id
2029
+					"&insuplc_admdvs=" + insuplc_admdvs + "&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_id
2024 2030
 				resp, requestErr := http.Get(api)
2025 2031
 				if requestErr != nil {
2026 2032
 					c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
@@ -2053,7 +2059,7 @@ func (c *HisApiController) GetRegisterInfo() {
2053 2059
 
2054 2060
 			} else {
2055 2061
 				fmt.Println(roles.UserName)
2056
-				result, requestLog := service.Gdyb2201(res.Output.Baseinfo.PsnNo, insutype, IdCardNo, miConfig.OrgName, roles.UserName, ipt_otp_no, department.Name, miConfig.Code, department.Number, doctor_id, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, id_card_type, doctor_info.UserName)
2062
+				result, requestLog := service.Gdyb2201(res.Output.Baseinfo.PsnNo, insutype, IdCardNo, miConfig.OrgName, roles.UserName, ipt_otp_no, department.Name, miConfig.Code, department.Number, doctor_id, insuplc_admdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, id_card_type, doctor_info.UserName)
2057 2063
 				saveLog(result, requestLog, "2201", "挂号")
2058 2064
 				if err := json.Unmarshal([]byte(result), &resThree); err != nil {
2059 2065
 					utils.ErrorLog("解析失败:%v", err)
@@ -2090,6 +2096,7 @@ func (c *HisApiController) GetRegisterInfo() {
2090 2096
 			his.UserOrgId = adminInfo.CurrentOrgId
2091 2097
 			his.Ctime = time.Now().Unix()
2092 2098
 			his.Mtime = time.Now().Unix()
2099
+			his.InsuplcAdmdvs = insuplc_admdvs
2093 2100
 			his.Status = 1
2094 2101
 			service.UpdateHisPatientStatus(&his)
2095 2102
 			service.UpdateHisPrescriptionHisID(his.ID, patient.ID, recordDateTime, adminInfo.CurrentOrgId)
@@ -2241,7 +2248,7 @@ func (c *HisApiController) GetUploadInfo() {
2241 2248
 			data["med_type"] = strconv.FormatInt(reg_type, 10)
2242 2249
 			data["doctor_id"] = strconv.FormatInt(doctor_info.AdminUserId, 10)
2243 2250
 			data["fixmedins_code"] = miConfig.Code
2244
-			data["insuplc_admdvs"] = miConfig.InsuplcAdmdvs
2251
+			data["insuplc_admdvs"] = his.InsuplcAdmdvs
2245 2252
 			data["mdtrtarea_admvs"] = miConfig.MdtrtareaAdmvs
2246 2253
 			data["secret_key"] = miConfig.SecretKey
2247 2254
 			data["sick_code"] = sickConfig.CountryCode
@@ -2278,9 +2285,9 @@ func (c *HisApiController) GetUploadInfo() {
2278 2285
 
2279 2286
 		} else {
2280 2287
 			if miConfig.InsuplcAdmdvs == "440781" { //
2281
-				result, requestLog = service.Gdyb2203A(his.PsnNo, his.Number, doctor_info.UserName, department.Name, miConfig.OrgName, strconv.FormatInt(reg_type, 10), doctor_info.AdminUserId, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, sickConfig.ContentCode, sickConfig.ClassName, roles.UserName, config)
2288
+				result, requestLog = service.Gdyb2203A(his.PsnNo, his.Number, doctor_info.UserName, department.Name, miConfig.OrgName, strconv.FormatInt(reg_type, 10), doctor_info.AdminUserId, miConfig.Code, his.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, sickConfig.ContentCode, sickConfig.ClassName, roles.UserName, config)
2282 2289
 			} else {
2283
-				result, requestLog = service.Gdyb2203(his.PsnNo, his.Number, doctor_info.UserName, department.Name, miConfig.OrgName, strconv.FormatInt(reg_type, 10), doctor_info.AdminUserId, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, sickConfig.ContentCode, sickConfig.ClassName, roles.UserName, config)
2290
+				result, requestLog = service.Gdyb2203(his.PsnNo, his.Number, doctor_info.UserName, department.Name, miConfig.OrgName, strconv.FormatInt(reg_type, 10), doctor_info.AdminUserId, miConfig.Code, his.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, sickConfig.ContentCode, sickConfig.ClassName, roles.UserName, config)
2284 2291
 			}
2285 2292
 			saveLog(result, requestLog, "2203", "上传就诊信息")
2286 2293
 			var respJSON2 map[string]interface{}
@@ -2321,13 +2328,18 @@ func (c *HisApiController) GetUploadInfo() {
2321 2328
 		} else {
2322 2329
 			his.Diagnosis = diagnosis_id
2323 2330
 			his.SickType = sickConfig.ID
2324
-			his.PType = fmt.Sprintf("%d", reg_type)
2331
+			var p_type int64
2332
+			if reg_type == 1111 || reg_type == 1112 {
2333
+				p_type = 11
2334
+
2335
+			}
2336
+			his.PType = fmt.Sprintf("%d", p_type)
2325 2337
 			service.UpdateHisPatientThree(&his)
2326 2338
 
2327 2339
 			data := make(map[string]interface{})
2328 2340
 			if settle_accounts_type == 1 { //日结
2329 2341
 
2330
-				if reg_type == 11 {
2342
+				if reg_type == 11 || reg_type == 1111 || reg_type == 1112 {
2331 2343
 					prescriptions, _ = service.GetPrescriptionByIds(ids_arr, adminUser.CurrentOrgId)
2332 2344
 				} else {
2333 2345
 					prescriptions, _ = service.GetNewHisPrescription(adminUser.CurrentOrgId, his_patient_id, recordDateTime, strconv.Itoa(int(reg_type)))
@@ -2359,10 +2371,6 @@ func (c *HisApiController) GetUploadInfo() {
2359 2371
 
2360 2372
 			}
2361 2373
 
2362
-			if reg_type == 1111 || reg_type == 1112 {
2363
-				reg_type = 11
2364
-			}
2365
-
2366 2374
 			timestamp := time.Now().Unix()
2367 2375
 			tempTime := time.Unix(timestamp, 0)
2368 2376
 			timeFormat := tempTime.Format("20060102150405")
@@ -2385,7 +2393,7 @@ func (c *HisApiController) GetUploadInfo() {
2385 2393
 				data["dept_code"] = department.Number
2386 2394
 			}
2387 2395
 
2388
-			data["insuplc_admdvs"] = miConfig.InsuplcAdmdvs
2396
+			data["insuplc_admdvs"] = his.InsuplcAdmdvs
2389 2397
 			data["mdtrtarea_admvs"] = miConfig.MdtrtareaAdmvs
2390 2398
 			data["secret_key"] = miConfig.SecretKey
2391 2399
 			data["balance_accounts_type"] = strconv.FormatInt(his.BalanceAccountsType, 10)
@@ -2428,7 +2436,7 @@ func (c *HisApiController) GetUploadInfo() {
2428 2436
 					}
2429 2437
 
2430 2438
 				} else {
2431
-					result, request_log := service.Gdyb2204(his.PsnNo, his.Number, prescriptions, chrg_bchno, miConfig.OrgName, roles.UserName, data["dept"].(string), data["fixmedins_code"].(string), data["dept_code"].(string), data["doctor_id"].(string), miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, data["balance_accounts_type"].(string))
2439
+					result, request_log := service.Gdyb2204(his.PsnNo, his.Number, prescriptions, chrg_bchno, miConfig.OrgName, roles.UserName, data["dept"].(string), data["fixmedins_code"].(string), data["dept_code"].(string), data["doctor_id"].(string), his.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, data["balance_accounts_type"].(string))
2432 2440
 					var dat map[string]interface{}
2433 2441
 					if err := json.Unmarshal([]byte(result), &dat); err == nil {
2434 2442
 						fmt.Println(dat)
@@ -2636,7 +2644,7 @@ func (c *HisApiController) GetUploadInfo() {
2636 2644
 							api := "http://192.168.124.4:9532/" + "hbyb/2207?psn_no=" + his.PsnNo + "&mdtrt_id=" +
2637 2645
 								his.Number + "&chrg_bchno=" + chrg_bchno + "&org_name=" + miConfig.OrgName +
2638 2646
 								"&doctor=" + roles.UserName + "&fixmedins_code=" + miConfig.Code +
2639
-								"&insuplc_admdvs=" + miConfig.InsuplcAdmdvs + "&mdtrtarea_admvs=" + miConfig.MdtrtareaAdmvs +
2647
+								"&insuplc_admdvs=" + his.InsuplcAdmdvs + "&mdtrtarea_admvs=" + miConfig.MdtrtareaAdmvs +
2640 2648
 								"&secret_key=" + miConfig.SecretKey + "&id_card_type=" + strconv.FormatInt(his.IdCardType, 10) +
2641 2649
 								"&certificates=" + strconv.FormatInt(his.IdType, 10) + "&cert_no=" + cert_no +
2642 2650
 								"&insutype=" + insutype + "&total=" + allTotal + "&med_type=" + strconv.FormatInt(reg_type, 10) + "&acct_used_flag=" + acct_used_flag
@@ -2670,7 +2678,7 @@ func (c *HisApiController) GetUploadInfo() {
2670 2678
 							}
2671 2679
 
2672 2680
 						} else {
2673
-							result2, src_resquest = service.Gdyb2207(his.PsnNo, his.Number, chrg_bchno, cert_no, insutype, allTotal, miConfig.OrgName, roles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, strconv.FormatInt(reg_type, 10), his.IdCardType, 0, 0, 0, 0, his.IdType, acct_used_flag)
2681
+							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, strconv.FormatInt(reg_type, 10), his.IdCardType, 0, 0, 0, 0, his.IdType, acct_used_flag)
2674 2682
 							var dat map[string]interface{}
2675 2683
 							if err := json.Unmarshal([]byte(result2), &dat); err == nil {
2676 2684
 								fmt.Println(dat)
@@ -2889,7 +2897,7 @@ func (c *HisApiController) GetUploadInfo() {
2889 2897
 				api := "http://192.168.124.4:9532/" + "hbyb/2207?psn_no=" + his.PsnNo + "&mdtrt_id=" +
2890 2898
 					his.Number + "&chrg_bchno=" + chrg_bchno + "&org_name=" + miConfig.OrgName +
2891 2899
 					"&doctor=" + roles.UserName + "&fixmedins_code=" + miConfig.Code +
2892
-					"&insuplc_admdvs=" + miConfig.InsuplcAdmdvs + "&mdtrtarea_admvs=" + miConfig.MdtrtareaAdmvs +
2900
+					"&insuplc_admdvs=" + his.InsuplcAdmdvs + "&mdtrtarea_admvs=" + miConfig.MdtrtareaAdmvs +
2893 2901
 					"&secret_key=" + miConfig.SecretKey + "&id_card_type=" + strconv.FormatInt(his.IdCardType, 10) +
2894 2902
 					"&certificates=" + strconv.FormatInt(his.IdType, 10) + "&cert_no=" + cert_no +
2895 2903
 					"&insutype=" + insutype + "&total=" + allTotal + "&med_type=" + strconv.FormatInt(reg_type, 10) + "&acct_used_flag=" + acct_used_flag
@@ -2925,7 +2933,7 @@ func (c *HisApiController) GetUploadInfo() {
2925 2933
 
2926 2934
 			} else {
2927 2935
 
2928
-				result2, src_resquest = service.Gdyb2207(his.PsnNo, his.Number, chrg_bchno, cert_no, insutype, allTotal, miConfig.OrgName, roles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, strconv.FormatInt(reg_type, 10), his.IdCardType, tempOrder.FulamtOwnpayAmt, tempOrder.OverlmtSelfPay, tempOrder.PreselfpayAmt, tempOrder.InscpScpAmt, his.IdType, acct_used_flag)
2936
+				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, strconv.FormatInt(reg_type, 10), his.IdCardType, tempOrder.FulamtOwnpayAmt, tempOrder.OverlmtSelfPay, tempOrder.PreselfpayAmt, tempOrder.InscpScpAmt, his.IdType, acct_used_flag)
2929 2937
 				var dat map[string]interface{}
2930 2938
 				if err := json.Unmarshal([]byte(result2), &dat); err == nil {
2931 2939
 					fmt.Println(dat)
@@ -3716,7 +3724,7 @@ func (c *HisApiController) GetPreUploadInfo() {
3716 3724
 
3717 3725
 		data := make(map[string]interface{})
3718 3726
 		if settle_accounts_type == 1 { //日结
3719
-			if reg_type == 11 {
3727
+			if reg_type == 11 || reg_type == 1111 || reg_type == 1112 {
3720 3728
 				prescriptions, _ = service.GetPrescriptionByIds(ids_arr, adminUser.CurrentOrgId)
3721 3729
 			} else {
3722 3730
 				prescriptions, _ = service.GetNewHisPrescription(adminUser.CurrentOrgId, his_patient_id, recordDateTime, strconv.Itoa(int(reg_type)))
@@ -3745,10 +3753,6 @@ func (c *HisApiController) GetPreUploadInfo() {
3745 3753
 			data["pre"] = prescriptions
3746 3754
 		}
3747 3755
 
3748
-		if reg_type == 1111 || reg_type == 1112 {
3749
-			reg_type = 11
3750
-		}
3751
-
3752 3756
 		client := &http.Client{}
3753 3757
 		data["psn_no"] = his.PsnNo
3754 3758
 		data["mdtrt_id"] = his.Number
@@ -4391,9 +4395,10 @@ func (c *HisApiController) Refund() {
4391 4395
 	//	return
4392 4396
 	//}
4393 4397
 	//recordDateTime := theTime.Unix()
4394
-	//his, _ := service.GetVMHisPatientInfo(adminUser.CurrentOrgId, patient_id, recordDateTime)
4395 4398
 	var order models.HisOrder
4396 4399
 	order, _ = service.GetHisOrderByID(order_id)
4400
+	his, _ := service.GetHisPatientByNumber(order.MdtrtId)
4401
+
4397 4402
 	roles, _ := service.GetAdminUserInfoByID(adminUser.CurrentOrgId, admin_user_id)
4398 4403
 	if order.ID == 0 {
4399 4404
 		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
@@ -4410,7 +4415,7 @@ func (c *HisApiController) Refund() {
4410 4415
 		if miConfig.MdtrtareaAdmvs == "421300" {
4411 4416
 			api3 := "http://192.168.124.4:9532/" + "hbyb/2208?psn_no=" + order.PsnNo +
4412 4417
 				"&mdtrt_id=" + order.MdtrtId + "&setl_id=" + order.SetlId + "&doctor=" + roles.UserName + "&org_name=" + miConfig.OrgName + "&fixmedins_code=" + miConfig.Code +
4413
-				"&insuplc_admdvs=" + miConfig.InsuplcAdmdvs + "&mdtrtarea_admvs=" + miConfig.MdtrtareaAdmvs + "&secret_key=" + miConfig.SecretKey
4418
+				"&insuplc_admdvs=" + his.InsuplcAdmdvs + "&mdtrtarea_admvs=" + miConfig.MdtrtareaAdmvs + "&secret_key=" + miConfig.SecretKey
4414 4419
 			resp3, requestErr3 := http.Get(api3)
4415 4420
 			if requestErr3 != nil {
4416 4421
 				c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
@@ -4440,7 +4445,7 @@ func (c *HisApiController) Refund() {
4440 4445
 			}
4441 4446
 
4442 4447
 		} else {
4443
-			result, src_resquest = service.Gdyb2208(order.PsnNo, order.MdtrtId, order.SetlId, miConfig.OrgName, roles.UserName, miConfig.SecretKey, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs)
4448
+			result, src_resquest = service.Gdyb2208(order.PsnNo, order.MdtrtId, order.SetlId, miConfig.OrgName, roles.UserName, miConfig.SecretKey, miConfig.Code, his.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs)
4444 4449
 			var dat map[string]interface{}
4445 4450
 			if err := json.Unmarshal([]byte(result), &dat); err == nil {
4446 4451
 				fmt.Println(dat)
@@ -4463,7 +4468,7 @@ func (c *HisApiController) Refund() {
4463 4468
 
4464 4469
 				api3 := "http://192.168.124.4:9532/" + "hbyb/2205?psn_no=" + order.PsnNo +
4465 4470
 					"&mdtrt_id=" + order.MdtrtId + "&chrg_bchno=" + order.Number + "&doctor=" + roles.UserName + "&org_name=" + miConfig.OrgName + "&fixmedins_code=" + miConfig.Code +
4466
-					"&insuplc_admdvs=" + miConfig.InsuplcAdmdvs + "&mdtrtarea_admvs=" + miConfig.MdtrtareaAdmvs + "&secret_key=" + miConfig.SecretKey
4471
+					"&insuplc_admdvs=" + his.InsuplcAdmdvs + "&mdtrtarea_admvs=" + miConfig.MdtrtareaAdmvs + "&secret_key=" + miConfig.SecretKey
4467 4472
 				resp3, requestErr3 := http.Get(api3)
4468 4473
 				if requestErr3 != nil {
4469 4474
 					c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
@@ -4494,7 +4499,7 @@ func (c *HisApiController) Refund() {
4494 4499
 
4495 4500
 			} else {
4496 4501
 
4497
-				result2, src_request := service.Gdyb2205(order.PsnNo, order.MdtrtId, order.Number, miConfig.OrgName, roles.UserName, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, miConfig.Code)
4502
+				result2, src_request := service.Gdyb2205(order.PsnNo, order.MdtrtId, order.Number, miConfig.OrgName, roles.UserName, his.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, miConfig.Code)
4498 4503
 				var dat map[string]interface{}
4499 4504
 				if err := json.Unmarshal([]byte(result2), &dat); err == nil {
4500 4505
 					fmt.Println(dat)
@@ -4577,7 +4582,7 @@ func (c *HisApiController) RefundNumber() {
4577 4582
 
4578 4583
 			api3 := "http://192.168.124.4:9532/" + "hbyb/2202?psn_no=" + his.PsnNo +
4579 4584
 				"&mdtrt_id=" + his.Number + "&ipt_otp_no=" + his.IptOtpNo + "&doctor=" + roles.UserName + "&org_name=" + miConfig.OrgName + "&fixmedins_code=" + miConfig.Code +
4580
-				"&insuplc_admdvs=" + miConfig.InsuplcAdmdvs + "&mdtrtarea_admvs=" + miConfig.MdtrtareaAdmvs + "&secret_key=" + miConfig.SecretKey
4585
+				"&insuplc_admdvs=" + his.InsuplcAdmdvs + "&mdtrtarea_admvs=" + miConfig.MdtrtareaAdmvs + "&secret_key=" + miConfig.SecretKey
4581 4586
 			resp3, requestErr3 := http.Get(api3)
4582 4587
 			if requestErr3 != nil {
4583 4588
 				c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
@@ -4611,7 +4616,7 @@ func (c *HisApiController) RefundNumber() {
4611 4616
 
4612 4617
 			api3 := "http://127.0.0.1:9532/" + "gdyb/three?psn_no=" + his.PsnNo +
4613 4618
 				"&mdtrt_id=" + his.Number + "&ipt_otp_no=" + his.IptOtpNo + "&doctor=" + roles.UserName + "&org_name=" + miConfig.OrgName + "&fixmedins_code=" + miConfig.Code +
4614
-				"&insuplc_admdvs=" + miConfig.InsuplcAdmdvs + "&mdtrtarea_admvs=" + miConfig.MdtrtareaAdmvs + "&secret_key=" + miConfig.SecretKey
4619
+				"&insuplc_admdvs=" + his.InsuplcAdmdvs + "&mdtrtarea_admvs=" + miConfig.MdtrtareaAdmvs + "&secret_key=" + miConfig.SecretKey
4615 4620
 			resp3, requestErr3 := http.Get(api3)
4616 4621
 			if requestErr3 != nil {
4617 4622
 				c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
@@ -4676,7 +4681,7 @@ func (c *HisApiController) RefundNumber() {
4676 4681
 }
4677 4682
 func (c *HisApiController) RefundDetail() {
4678 4683
 	order_id, _ := c.GetInt64("order_id")
4679
-	his_patient_id, _ := c.GetInt64("his_patient_id")
4684
+	//his_patient_id, _ := c.GetInt64("his_patient_id")
4680 4685
 
4681 4686
 	number := c.GetString("number")
4682 4687
 	record_time := c.GetString("record_time")
@@ -4691,7 +4696,8 @@ func (c *HisApiController) RefundDetail() {
4691 4696
 		return
4692 4697
 	}
4693 4698
 	recordDateTime := theTime.Unix()
4694
-	his, _ := service.GetNewVMHisPatientInfo(adminUser.CurrentOrgId, his_patient_id, recordDateTime)
4699
+	//his, _ := service.GetNewVMHisPatientInfo(adminUser.CurrentOrgId, his_patient_id, recordDateTime)
4700
+
4695 4701
 	patientPrescription, _ := service.FindPatientPrescriptionInfo(adminUser.CurrentOrgId, patient_id, recordDateTime)
4696 4702
 	miConfig, _ := service.FindMedicalInsuranceInfo(adminUser.CurrentOrgId)
4697 4703
 	config, _ := service.GetMedicalInsuranceConfig(adminUser.CurrentOrgId)
@@ -4703,11 +4709,12 @@ func (c *HisApiController) RefundDetail() {
4703 4709
 		order, _ = service.GetHisOrderThree(recordDateTime, patient_id, adminUser.CurrentOrgId)
4704 4710
 
4705 4711
 	}
4712
+	his, _ := service.GetHisPatientByNumber(order.MdtrtId)
4706 4713
 
4707 4714
 	if config.IsOpen == 1 { //对接了医保,走医保流程
4708 4715
 		api2 := "http://127.0.0.1:9532/" + "gdyb/six?psn_no=" + his.PsnNo +
4709 4716
 			"&mdtrt_id=" + his.Number + "&chrg_bchno=" + order.Number + "&doctor=" + patientPrescription.Doctor + "&org_name=" + miConfig.OrgName + "&fixmedins_code=" + miConfig.Code +
4710
-			"&insuplc_admdvs=" + miConfig.InsuplcAdmdvs + "&mdtrtarea_admvs=" + miConfig.MdtrtareaAdmvs + "&secret_key=" + miConfig.SecretKey
4717
+			"&insuplc_admdvs=" + his.InsuplcAdmdvs + "&mdtrtarea_admvs=" + miConfig.MdtrtareaAdmvs + "&secret_key=" + miConfig.SecretKey
4711 4718
 		resp2, requestErr2 := http.Get(api2)
4712 4719
 		if requestErr2 != nil {
4713 4720
 			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
@@ -5339,7 +5346,7 @@ func (c *HisApiController) GetSettleAccounts() {
5339 5346
 	baseParams := models.BaseParams{
5340 5347
 		SecretKey:      miConfig.SecretKey,
5341 5348
 		FixmedinsCode:  miConfig.Code,
5342
-		InsuplcAdmdvs:  miConfig.InsuplcAdmdvs,
5349
+		InsuplcAdmdvs:  his.InsuplcAdmdvs,
5343 5350
 		MdtrtareaAdmvs: miConfig.MdtrtareaAdmvs,
5344 5351
 		OrgName:        miConfig.OrgName,
5345 5352
 		Doctor:         user_name,
@@ -5356,7 +5363,7 @@ func (c *HisApiController) GetSettleAccounts() {
5356 5363
 
5357 5364
 			api := "http://192.168.124.4:9532/" + "hbyb/5203?psn_no=" + businessParams.PsnNo + "&mdtrt_id=" + businessParams.MdtrtId + "&setl_id=" + businessParams.SetlId +
5358 5365
 				"&org_name=" + miConfig.OrgName + "&doctor=" + baseParams.Doctor + "&fixmedins_code=" + miConfig.Code +
5359
-				"&insuplc_admdvs=" + miConfig.InsuplcAdmdvs + "&mdtrtarea_admvs=" + miConfig.MdtrtareaAdmvs + "&secret_key=" + miConfig.SecretKey
5366
+				"&insuplc_admdvs=" + his.InsuplcAdmdvs + "&mdtrtarea_admvs=" + miConfig.MdtrtareaAdmvs + "&secret_key=" + miConfig.SecretKey
5360 5367
 			resp, requestErr := http.Get(api)
5361 5368
 			if requestErr != nil {
5362 5369
 				c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)

+ 11 - 7
controllers/sz/sz_his_api_controller.go ファイルの表示

@@ -2285,7 +2285,7 @@ func (c *SZHisApiController) GetSettleInfo() {
2285 2285
 							ChargeSerialNumber: newFl,
2286 2286
 							Code:               subItem.BaseDrugLib.MedicalInsuranceNumber,
2287 2287
 							CodeName:           subItem.BaseDrugLib.DrugName,
2288
-							BwCode:				subItem.BaseDrugLib.Code,
2288
+							BwCode:             subItem.BaseDrugLib.Code,
2289 2289
 							Flag:               "1",
2290 2290
 							Price:              price,
2291 2291
 							Count:              subItem.PrescribingNumber,
@@ -2319,7 +2319,7 @@ func (c *SZHisApiController) GetSettleInfo() {
2319 2319
 								OrderType:          "1",
2320 2320
 								ChargeSerialNumber: newFl,
2321 2321
 								Code:               subItem.HisProject.MedicalCode,
2322
-								BwCode:				subItem.HisProject.MedicalCode,
2322
+								BwCode:             subItem.HisProject.MedicalCode,
2323 2323
 								CodeName:           subItem.HisProject.ProjectName,
2324 2324
 								Flag:               "1",
2325 2325
 								Price:              subItem.Price,
@@ -2350,7 +2350,7 @@ func (c *SZHisApiController) GetSettleInfo() {
2350 2350
 								ChargeSerialNumber: newFl,
2351 2351
 								Code:               subItem.GoodInfo.MedicalInsuranceNumber,
2352 2352
 								CodeName:           subItem.GoodInfo.GoodName,
2353
-								BwCode:				subItem.GoodInfo.MedicalInsuranceNumber,
2353
+								BwCode:             subItem.GoodInfo.MedicalInsuranceNumber,
2354 2354
 								Flag:               "1",
2355 2355
 								Price:              subItem.Price,
2356 2356
 								Count:              count,
@@ -3031,8 +3031,12 @@ func (c *SZHisApiController) GetPreSettleInfo() {
3031 3031
 	var start_time int64
3032 3032
 	var end_time int64
3033 3033
 
3034
+	if reg_type == 1111 || reg_type == 1112 {
3035
+		reg_type = 11
3036
+	}
3034 3037
 	if settle_accounts_type == 1 { //日结
3035
-		if reg_type == 11 {
3038
+
3039
+		if reg_type == 11 || reg_type == 1111 || reg_type == 1112 {
3036 3040
 
3037 3041
 			prescriptions, _ = service.GetPrescriptionByIds(ids_arr, adminUser.CurrentOrgId)
3038 3042
 		} else {
@@ -3117,7 +3121,7 @@ func (c *SZHisApiController) GetPreSettleInfo() {
3117 3121
 						OrderType:          "1",
3118 3122
 						ChargeSerialNumber: newFl,
3119 3123
 						Code:               subItem.BaseDrugLib.MedicalInsuranceNumber,
3120
-						BwCode:				subItem.BaseDrugLib.Code,
3124
+						BwCode:             subItem.BaseDrugLib.Code,
3121 3125
 						CodeName:           subItem.BaseDrugLib.DrugName,
3122 3126
 						Flag:               "1",
3123 3127
 						Price:              price,
@@ -3153,7 +3157,7 @@ func (c *SZHisApiController) GetPreSettleInfo() {
3153 3157
 							ChargeSerialNumber: newFl,
3154 3158
 							Code:               subItem.HisProject.MedicalCode,
3155 3159
 							CodeName:           subItem.HisProject.ProjectName,
3156
-							BwCode:				subItem.HisProject.MedicalCode,
3160
+							BwCode:             subItem.HisProject.MedicalCode,
3157 3161
 							Flag:               "1",
3158 3162
 							Price:              subItem.Price,
3159 3163
 							Count:              count,
@@ -3183,7 +3187,7 @@ func (c *SZHisApiController) GetPreSettleInfo() {
3183 3187
 							OrderType:          "1",
3184 3188
 							ChargeSerialNumber: newFl,
3185 3189
 							Code:               subItem.GoodInfo.MedicalInsuranceNumber,
3186
-							BwCode:               subItem.GoodInfo.MedicalInsuranceNumber,
3190
+							BwCode:             subItem.GoodInfo.MedicalInsuranceNumber,
3187 3191
 							CodeName:           subItem.GoodInfo.GoodName,
3188 3192
 							Flag:               "1",
3189 3193
 							Price:              subItem.Price,

+ 2 - 0
models/his_models.go ファイルの表示

@@ -124,6 +124,7 @@ type HisPatient struct {
124 124
 	YiliaoNumber           string  `gorm:"column:yiliao_number" json:"yiliao_number" form:"yiliao_number"`
125 125
 	MzNumber               string  `gorm:"column:mz_number" json:"mz_number" form:"mz_number"`
126 126
 	PatientInfo            string  `gorm:"column:patient_info" json:"patient_info" form:"patient_info"`
127
+	InsuplcAdmdvs          string  `gorm:"column:insuplc_admdvs" json:"insuplc_admdvs" form:"insuplc_admdvs"`
127 128
 }
128 129
 
129 130
 func (HisPatient) TableName() string {
@@ -801,6 +802,7 @@ type VMHisPatient struct {
801 802
 	Diagnosis              string  `gorm:"column:diagnosis" json:"diagnosis" form:"diagnosis"`
802 803
 	SickType               int64   `gorm:"column:sick_type" json:"sick_type" form:"sick_type"`
803 804
 	PType                  int64   `gorm:"column:p_type" json:"p_type" form:"p_type"`
805
+	InsuplcAdmdvs          string  `gorm:"column:insuplc_admdvs" json:"insuplc_admdvs" form:"insuplc_admdvs"`
804 806
 }
805 807
 
806 808
 func (VMHisPatient) TableName() string {

+ 174 - 2
service/gdyb_service.go ファイルの表示

@@ -531,6 +531,10 @@ func Gdyb2203(psnNo string, mdtrtId string, doctor string, department string, or
531 531
 	inputData := make(map[string]interface{})
532 532
 	diseinfo := make([]map[string]interface{}, 0)
533 533
 
534
+	if med_type == "1111" || med_type == "1112" {
535
+		med_type = "11"
536
+	}
537
+
534 538
 	inputMessage["infno"] = "2203"        // 交易编码
535 539
 	inputData["mdtrt_id"] = mdtrtId       // 就诊 ID(来自2201接口返回)
536 540
 	inputData["psn_no"] = psnNo           // 人员编号 (来自1101接口返回)
@@ -636,6 +640,10 @@ func Gdyb2203A(psnNo string, mdtrtId string, doctor string, department string, o
636 640
 	inputData := make(map[string]interface{})
637 641
 	diseinfo := make([]map[string]interface{}, 0)
638 642
 
643
+	if med_type == "1111" || med_type == "1112" {
644
+		med_type = "11"
645
+	}
646
+
639 647
 	inputMessage["infno"] = "2203A"       // 交易编码
640 648
 	inputData["mdtrt_id"] = mdtrtId       // 就诊 ID(来自2201接口返回)
641 649
 	inputData["psn_no"] = psnNo           // 人员编号 (来自1101接口返回)
@@ -1112,7 +1120,7 @@ func Gdyb2206(psnNo string, mdtrtId string, chrgBchno string, certNo string, ins
1112 1120
 		}
1113 1121
 	}
1114 1122
 	if insuplc_admdvs == "421300" {
1115
-		if med_type == "11" {
1123
+		if med_type == "11" || med_type == "1112" || med_type == "1111" {
1116 1124
 			inputData["med_type"] = "110104" // 医疗类别 11 普通门诊  12 门诊挂号
1117 1125
 		} else if med_type == "14" {
1118 1126
 			inputData["med_type"] = "140110" // 医疗类别 11 普通门诊  12 门诊挂号
@@ -1222,7 +1230,9 @@ func Gdyb2207(psnNo string, mdtrtId string, chrgBchno string, certNo string, ins
1222 1230
 			inputData["mdtrt_cert_no"] = certNo // 就诊凭证编号
1223 1231
 		}
1224 1232
 	}
1225
-
1233
+	if med_type == "1111" || med_type == "1112" {
1234
+		med_type = "11"
1235
+	}
1226 1236
 	if insuplc_admdvs == "421300" {
1227 1237
 		if med_type == "11" {
1228 1238
 			inputData["med_type"] = "110104" // 医疗类别 11 普通门诊  12 门诊挂号
@@ -1822,6 +1832,9 @@ func Gdyb5203(baseParams models.BaseParams, businessParams models.BusinessParams
1822 1832
 }
1823 1833
 
1824 1834
 func Gdyb2001(baseParams models.BaseParams, psn_no string, insutype string, med_type string) string {
1835
+	if med_type == "1111" || med_type == "1112" {
1836
+		med_type = "11"
1837
+	}
1825 1838
 	// 生成签名
1826 1839
 	nonce := GetRandomString(32)
1827 1840
 	timestamp := time.Now().Unix()
@@ -2681,6 +2694,165 @@ func Gdyb4101(struct4101 Struct4101, secret_key string, org_name string, doctor
2681 2694
 	return str
2682 2695
 }
2683 2696
 
2697
+//func Gdyb7101(psnNo string, insutype string, org_name string, doctor string, fixmedins_code string, doctor_id string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string, sick_name string, sick_code string) string {
2698
+//	// 生成签名
2699
+//	nonce := GetRandomString(32)
2700
+//	timestamp := time.Now().Unix()
2701
+//	signature := setSignature(timestamp, nonce, secret_key)
2702
+//	tempTime := time.Unix(timestamp, 0)
2703
+//	//timeFormatOne := tempTime.Format("2006-01-02 15:04:05")
2704
+//
2705
+//	timeFormatTwo := tempTime.Format("2006-01-02")
2706
+//
2707
+//	t := time.Now()
2708
+//	last := time.Date(t.Year(), time.December, 31, 0, 0, 0, 0, time.UTC)
2709
+//	tm := time.Unix(last.Unix(), 0)
2710
+//
2711
+//	// 生成输入报文
2712
+//	inputMessage := SetInputMessage(nonce, timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs)
2713
+//	input := make(map[string]interface{})
2714
+//	inputData := make(map[string]interface{})
2715
+//
2716
+//	inputData2 := make(map[string]interface{})
2717
+//
2718
+//	inputMessage["infno"] = "7101"                 // 交易编码
2719
+//	inputData["hosp_rxno"] = psnNo                    // 人员编号 (来自1101接口返回)
2720
+//	inputData["init_rxno"] = insutype               // 险种类型(来自1101接口返回)
2721
+//	inputData["rx_type_code"] = sick_code        // 险种类型(来自1101接口返回)
2722
+//	inputData["prsc_time"] = sick_name        // 险种类型(来自1101接口返回)
2723
+//	inputData["rx_drug_nums"] = insuplc_admdvs      // 险种类型(来自1101接口返回)
2724
+//	inputData["rx_way_codg"] = fixmedins_code // 险种类型(来自1101接口返回)
2725
+//	inputData["rx_way_name"] = org_name     // 险种类型(来自1101接口返回)
2726
+//	inputData["rx_freq_codg"] = timeFormatTwo     // 险种类型(来自1101接口返回)
2727
+//	inputData["rx_freq_name"] = doctor_id          // 开始时间
2728
+//	inputData["rx_dosunt"] = doctor             // 开始时间
2729
+//	inputData["rx_doscnt"] = timeFormatTwo          // 医师编码
2730
+//	inputData["rx_drord_dscr"] = ""                          // 医师编码
2731
+//	inputData["valid_days"] = ""                         // 医师编码
2732
+//	inputData["valid_end_time"] = tm.Format("2006-01-02") // 医师编码
2733
+//	inputData["rept_flag"] = tm.Format("2006-01-02") // 医师编码
2734
+//	inputData["max_rept_cnt"] = tm.Format("2006-01-02") // 医师编码
2735
+//	inputData["reptd_cnt"] = tm.Format("2006-01-02") // 医师编码
2736
+//	inputData["min_inrv_days"] = tm.Format("2006-01-02") // 医师编码
2737
+//	inputData["dr_sign_info"] = tm.Format("2006-01-02") // 医师编码
2738
+//	inputData["phar_sign_info"] = tm.Format("2006-01-02") // 医师编码
2739
+//	inputData["fixmedins_sign_info"] = tm.Format("2006-01-02") // 医师编码
2740
+//	inputData["rx_cotn_flag"] = tm.Format("2006-01-02") // 医师编码
2741
+//	inputData["rx_file"] = tm.Format("2006-01-02") // 医师编码
2742
+//	input["data"] = inputData
2743
+//
2744
+//
2745
+//	inputData2["med_list_codg"] = psnNo                    // 人员编号 (来自1101接口返回)
2746
+//	inputData2["fixmedins_hilist_id"] = insutype               // 险种类型(来自1101接口返回)
2747
+//	inputData["hosp_prep_flag"] = sick_code        // 险种类型(来自1101接口返回)
2748
+//	inputData["rx_item_type_code"] = sick_name        // 险种类型(来自1101接口返回)
2749
+//	inputData["rx_item_type_name"] = insuplc_admdvs      // 险种类型(来自1101接口返回)
2750
+//	inputData["tcmdrug_type_name"] = fixmedins_code // 险种类型(来自1101接口返回)
2751
+//	inputData["tcmdrug_type_code"] = org_name     // 险种类型(来自1101接口返回)
2752
+//	inputData["tcmherb_foote"] = timeFormatTwo     // 险种类型(来自1101接口返回)
2753
+//	inputData["medn_type_code"] = doctor_id          // 开始时间
2754
+//	inputData["medn_type_name"] = doctor             // 开始时间
2755
+//	inputData["main_medc_flag"] = timeFormatTwo          // 医师编码
2756
+//	inputData["urgt_flag"] = ""                          // 医师编码
2757
+//	inputData["bas_medn_flag"] = ""                         // 医师编码
2758
+//	inputData["imp_drug_flag"] = tm.Format("2006-01-02") // 医师编码
2759
+//	inputData["prod_barc"] = tm.Format("2006-01-02") // 医师编码
2760
+//	inputData["drug_prodname"] = tm.Format("2006-01-02") // 医师编码
2761
+//
2762
+//	inputData["genname_codg"] = tm.Format("2006-01-02") // 医师编码
2763
+//	inputData["drug_genname"] = tm.Format("2006-01-02") // 医师编码
2764
+//	inputData["chemname"] = tm.Format("2006-01-02") // 医师编码
2765
+//
2766
+//	inputData["drugstdcode"] = tm.Format("2006-01-02") // 医师编码
2767
+//	inputData["drug_dosform"] = tm.Format("2006-01-02") // 医师编码
2768
+//
2769
+//
2770
+//	inputData["drug_spec"] = tm.Format("2006-01-02") // 医师编码
2771
+//	inputData["prdr_name"] = tm.Format("2006-01-02") // 医师编码
2772
+//
2773
+//
2774
+//	inputData["drug_pric"] = tm.Format("2006-01-02") // 医师编码
2775
+//	inputData["drug_cnt"] = tm.Format("2006-01-02") // 医师编码
2776
+//	inputData["drug_cnt_unit"] = tm.Format("2006-01-02") // 医师编码
2777
+//	inputData["drug_sumamt"] = tm.Format("2006-01-02") // 医师编码
2778
+//	inputData["medc_way_codg"] = tm.Format("2006-01-02") // 医师编码
2779
+//	inputData["medc_way_dscr"] = tm.Format("2006-01-02") // 医师编码
2780
+//	inputData["medc_starttime"] = tm.Format("2006-01-02") // 医师编码
2781
+//
2782
+//	inputData["medc_endtime"] = tm.Format("2006-01-02") // 医师编码
2783
+//
2784
+//
2785
+//	inputData["medc_days"] = tm.Format("2006-01-02") // 医师编码
2786
+//	inputData["drug_dosunt"] = tm.Format("2006-01-02") // 医师编码
2787
+//	inputData["sin_doscnt"] = tm.Format("2006-01-02") // 医师编码
2788
+//	inputData["sin_dosunt"] = tm.Format("2006-01-02") // 医师编码
2789
+//	inputData["used_frqu_codg"] = tm.Format("2006-01-02") // 医师编码
2790
+//
2791
+//
2792
+//	inputData["used_frqu_name"] = tm.Format("2006-01-02") // 医师编码
2793
+//	inputData["drug_totlnt"] = tm.Format("2006-01-02") // 医师编码
2794
+//
2795
+//	inputData["drug_totlnt_emp"] = tm.Format("2006-01-02") // 医师编码
2796
+//	inputData["dise_codg"] = tm.Format("2006-01-02") // 医师编码
2797
+//	inputData["drug_res"] = tm.Format("2006-01-02") // 医师编码
2798
+//	inputData["drug_limit"] = tm.Format("2006-01-02") // 医师编码
2799
+//
2800
+//
2801
+//
2802
+//
2803
+//
2804
+//
2805
+//
2806
+//
2807
+//
2808
+//	input["rxdrugdetail"] = inputData2
2809
+//
2810
+//
2811
+//
2812
+//
2813
+//	inputMessage["input"] = input //交易输入
2814
+//	bytesData, err := json.Marshal(inputMessage)
2815
+//	fmt.Println(string(bytesData))
2816
+//	if err != nil {
2817
+//		fmt.Println(err.Error())
2818
+//		return err.Error()
2819
+//	}
2820
+//	reader := bytes.NewReader(bytesData)
2821
+//	//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_api/prd/hsa/hgs/2503"
2822
+//	//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/2503"
2823
+//	gdyb_url := beego.AppConfig.String("gdyb_url")
2824
+//	gdyb_paasid := beego.AppConfig.String("gdyb_paasid")
2825
+//	//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_api/prd/hsa/hgs/1101"
2826
+//	url := gdyb_url + "2503"
2827
+//
2828
+//	request, err := http.NewRequest("POST", url, reader)
2829
+//	if err != nil {
2830
+//		fmt.Println(err.Error())
2831
+//		return err.Error()
2832
+//	}
2833
+//
2834
+//	request.Header.Set("Content-Type", "application/json;charset=UTF-8")
2835
+//	request.Header.Set("x-tif-paasid", gdyb_paasid)
2836
+//	request.Header.Set("x-tif-signature", signature)
2837
+//	request.Header.Set("x-tif-timestamp", strconv.FormatInt(timestamp, 10))
2838
+//	request.Header.Set("x-tif-nonce", nonce)
2839
+//
2840
+//	client := http.Client{}
2841
+//	resp, err := client.Do(request)
2842
+//	if err != nil {
2843
+//		fmt.Println(err.Error())
2844
+//		return err.Error()
2845
+//	}
2846
+//	respBytes, err := ioutil.ReadAll(resp.Body)
2847
+//	if err != nil {
2848
+//		fmt.Println(err.Error())
2849
+//		return err.Error()
2850
+//	}
2851
+//	str := string(respBytes)
2852
+//	fmt.Println(str)
2853
+//	return str
2854
+//}
2855
+
2684 2856
 // 生成签名
2685 2857
 func setSignature(timestamp int64, nonce string, secret_key string) string {
2686 2858
 	str := strconv.FormatInt(timestamp, 10) + secret_key + nonce + strconv.FormatInt(timestamp, 10)

+ 11 - 3
service/hbyb_service.go ファイルの表示

@@ -213,7 +213,7 @@ func Hbyb2203(psnNo string, mdtrtId string, doctor string, department string, or
213 213
 	inputData["birctrl_matn_date"] = "" // 计划生育手术或生育日期
214 214
 
215 215
 	if insuplc_admdvs == "421300" {
216
-		if med_type == "11" {
216
+		if med_type == "11" || med_type == "1111" || med_type == "1112" {
217 217
 			inputData["med_type"] = "110104" // 医疗类别 11 普通门诊  12 门诊挂号
218 218
 		} else if med_type == "14" {
219 219
 			inputData["med_type"] = "140101" // 医疗类别 11 普通门诊  12 门诊挂号
@@ -495,8 +495,13 @@ func Hbyb2206(psnNo string, mdtrtId string, chrgBchno string, certNo string, ins
495 495
 			inputData["mdtrt_cert_no"] = certNo // 就诊凭证编号
496 496
 		}
497 497
 	}
498
+	if med_type == "1111" || med_type == "1112" {
499
+
500
+		med_type = "11"
501
+	}
502
+
498 503
 	if insuplc_admdvs == "421300" {
499
-		if med_type == "11" {
504
+		if med_type == "11" || med_type == "1111" || med_type == "1112" {
500 505
 			inputData["med_type"] = "110104" // 医疗类别 11 普通门诊  12 门诊挂号
501 506
 		} else if med_type == "14" {
502 507
 			inputData["med_type"] = "140110" // 医疗类别 11 普通门诊  12 门诊挂号
@@ -562,9 +567,12 @@ func Hbyb2207(psnNo string, mdtrtId string, chrgBchno string, certNo string, ins
562 567
 			inputData["mdtrt_cert_no"] = certNo // 就诊凭证编号
563 568
 		}
564 569
 	}
570
+	if med_type == "1111" || med_type == "1112" {
571
+		med_type = "11"
572
+	}
565 573
 
566 574
 	if insuplc_admdvs == "421300" {
567
-		if med_type == "11" {
575
+		if med_type == "11" || med_type == "1111" || med_type == "1112" {
568 576
 			inputData["med_type"] = "110104" // 医疗类别 11 普通门诊  12 门诊挂号
569 577
 		} else if med_type == "14" {
570 578
 			inputData["med_type"] = "140101" // 医疗类别 11 普通门诊  12 门诊挂号