Browse Source

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

csx 4 years ago
parent
commit
52f75d84ce
2 changed files with 23 additions and 10 deletions
  1. 5 5
      controllers/sz/sz_his_api_controller.go
  2. 18 5
      service/sz_his_service.go

+ 5 - 5
controllers/sz/sz_his_api_controller.go View File

@@ -457,7 +457,7 @@ func (c *SZHisApiController) GetRegisterInfo() {
457 457
 				if is_yidi == 1 {
458 458
 					//本地就医流程
459 459
 					//挂号
460
-					resp_result := service.SzybMZ002(doctor_name, doctor_code, miConfig.Code, dept_code, yiliao_number, verifyCode, number, mz_number, version_code, custom_code, custom_project_name, allPrice)
460
+					resp_result := service.SzybMZ002(doctor_name, doctor_code, miConfig.Code, dept_code, yiliao_number, verifyCode, number, mz_number, version_code, custom_code, custom_project_name, allPrice, medical_care)
461 461
 					var dat map[string]interface{}
462 462
 					if err := json.Unmarshal([]byte(resp_result), &dat); err == nil {
463 463
 						fmt.Println(dat)
@@ -521,7 +521,7 @@ func (c *SZHisApiController) GetRegisterInfo() {
521 521
 
522 522
 					//tempPatient, _ := service.GetPatientByNumber(id_card_number, adminInfo.CurrentOrgId)
523 523
 					//if tempPatient.ID == patient_id {
524
-					resp_result := service.SzybMZ002(doctor_name, doctor_code, miConfig.Code, "0305", yiliao_number, verifyCode, number, mz_number, version_code, custom_code, custom_project_name, allPrice)
524
+					resp_result := service.SzybMZ002(doctor_name, doctor_code, miConfig.Code, "0305", yiliao_number, verifyCode, number, mz_number, version_code, custom_code, custom_project_name, allPrice, medical_care)
525 525
 					var dat map[string]interface{}
526 526
 					if err := json.Unmarshal([]byte(resp_result), &dat); err == nil {
527 527
 						fmt.Println(dat)
@@ -586,7 +586,7 @@ func (c *SZHisApiController) GetRegisterInfo() {
586 586
 				//fmt.Println(readCardBasResult)
587 587
 				//是否异地就医,是的话走鉴权流程,不是的话走门诊挂号
588 588
 				if is_yidi == 1 { //1本地就医
589
-					resp_result := service.SzybMZ002(doctor_name, doctor_code, miConfig.Code, "0305", yiliao_number, verifyCode, number, mz_number, version_code, custom_code, custom_project_name, allPrice)
589
+					resp_result := service.SzybMZ002(doctor_name, doctor_code, miConfig.Code, "0305", yiliao_number, verifyCode, number, mz_number, version_code, custom_code, custom_project_name, allPrice, medical_care)
590 590
 					var dat map[string]interface{}
591 591
 					if err := json.Unmarshal([]byte(resp_result), &dat); err == nil {
592 592
 						fmt.Println(dat)
@@ -647,7 +647,7 @@ func (c *SZHisApiController) GetRegisterInfo() {
647 647
 				} else { //异地就医需要走鉴权流程
648 648
 					//authResult := CardAuth(number)
649 649
 					//fmt.Println(authResult)
650
-					resp_result := service.SzybMZ002(doctor_name, doctor_code, miConfig.Code, "0305", yiliao_number, verifyCode, number, mz_number, version_code, custom_code, custom_project_name, allPrice)
650
+					resp_result := service.SzybMZ002(doctor_name, doctor_code, miConfig.Code, "0305", yiliao_number, verifyCode, number, mz_number, version_code, custom_code, custom_project_name, allPrice, medical_care)
651 651
 					var dat map[string]interface{}
652 652
 					if err := json.Unmarshal([]byte(resp_result), &dat); err == nil {
653 653
 						fmt.Println(dat)
@@ -1071,7 +1071,7 @@ func (c *SZHisApiController) GetSettleInfo() {
1071 1071
 			tempPatient, _ := service.GetPatientByNumber(id_card_number, adminUser.CurrentOrgId)
1072 1072
 			if tempPatient.ID == patient_id {
1073 1073
 
1074
-				result_three := service.SzybFY005(doctor_name, doctor_code, miConfig.Code, total, yiliao_number, verifyCode, number, mz_number, version_code, drug_doctor_code, drug_doctor_name)
1074
+				result_three := service.SzybFY005(doctor_name, doctor_code, miConfig.Code, total, yiliao_number, verifyCode, number, mz_number, version_code, drug_doctor_code, drug_doctor_name, his.MedicalTreatmentType)
1075 1075
 				var dat map[string]interface{}
1076 1076
 				if err := json.Unmarshal([]byte(result_three), &dat); err == nil {
1077 1077
 					fmt.Println(dat)

+ 18 - 5
service/sz_his_service.go View File

@@ -13,17 +13,24 @@ import (
13 13
 	_ "unsafe"
14 14
 )
15 15
 
16
-func SzybMZ002(doctor string, doctor_code string, fixmedins_code string, dept_code string, account string, verify_code string, serial_number string, mz_number string, version_code string, custom_code string, project_name string, price float64) string {
16
+func SzybMZ002(doctor string, doctor_code string, fixmedins_code string, dept_code string, account string, verify_code string, serial_number string, mz_number string, version_code string, custom_code string, project_name string, price float64, medical_care int64) string {
17 17
 	// 生成输入报文
18 18
 	inputMessage := SetSZInputMessage(doctor, doctor_code, fixmedins_code, verify_code, serial_number)
19 19
 	inputData := make(map[string]interface{})
20 20
 	inputMessage["transType"] = "MZ002"         // 交易编码
21 21
 	inputMessage["transVersion"] = version_code // 交易编码
22 22
 
23
+	if medical_care == 11 {
24
+		inputData["aka130"] = "11"
25
+	} else if medical_care == 13 {
26
+		inputData["aka130"] = "13"
27
+	} else {
28
+		inputData["aka130"] = fmt.Sprintf("%d", medical_care)
29
+	}
30
+
23 31
 	inputData["akc190"] = mz_number
24 32
 	inputData["aaz500"] = account
25 33
 	inputData["bzz269"] = "000000"
26
-	inputData["aka130"] = "13"
27 34
 	inputData["akf001"] = dept_code
28 35
 	inputData["akc264"] = price
29 36
 	inputData["bke384"] = inputMessage["serialNumber"]
@@ -301,7 +308,7 @@ func SzybFY004(doctor string, doctor_code string, fixmedins_code string, total f
301 308
 	str := string(respBytes)
302 309
 	return str
303 310
 }
304
-func SzybFY005(doctor string, doctor_code string, fixmedins_code string, total float64, account string, verify_code string, serial_number string, mz_number string, version_code string, drug_doctor string, drug_doctor_name string) string {
311
+func SzybFY005(doctor string, doctor_code string, fixmedins_code string, total float64, account string, verify_code string, serial_number string, mz_number string, version_code string, drug_doctor string, drug_doctor_name string, medical_care int64) string {
305 312
 	// 生成输入报文
306 313
 	inputMessage := SetSZInputMessage(doctor, doctor_code, fixmedins_code, verify_code, serial_number)
307 314
 	inputData := make(map[string]interface{})
@@ -309,17 +316,23 @@ func SzybFY005(doctor string, doctor_code string, fixmedins_code string, total f
309 316
 
310 317
 	inputMessage["transVersion"] = version_code // 交易编码
311 318
 
319
+	if medical_care == 11 {
320
+		inputData["aka130"] = "11"
321
+	} else if medical_care == 13 {
322
+		inputData["aka130"] = "13"
323
+		inputData["cka303"] = "Z99.2"
324
+	} else {
325
+		inputData["aka130"] = fmt.Sprintf("%d", medical_care)
326
+	}
312 327
 	inputData["aaz500"] = account
313 328
 	inputData["bzz269"] = "000000"
314 329
 	inputData["akc190"] = mz_number
315
-	inputData["aka130"] = "13"
316 330
 	inputData["bkc320"] = drug_doctor
317 331
 	inputData["ckc350"] = drug_doctor_name
318 332
 	inputData["aka030"] = "12"
319 333
 	inputData["akc264"] = total
320 334
 	inputData["ckc601"] = "0"
321 335
 	inputData["bke384"] = serial_number
322
-	inputData["cka303"] = "Z99.2"
323 336
 
324 337
 	inputMessage["transBody"] = inputData
325 338