浏览代码

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

csx 4 年前
父节点
当前提交
397cf1f5f3
共有 2 个文件被更改,包括 30 次插入33 次删除
  1. 3 3
      conf/app.conf
  2. 27 30
      controllers/sz/sz_his_api_controller.go

+ 3 - 3
conf/app.conf 查看文件

1
 appname = 血透
1
 appname = 血透
2
 httpport = 9532
2
 httpport = 9532
3
-runmode = prod
3
+runmode = dev
4
 
4
 
5
 #
5
 #
6
 copyrequestbody = true
6
 copyrequestbody = true
161
 gdyb_url = "http://igb.hsa.gdgov.cn/ebus/gdyb_api/prd/hsa/hgs/"
161
 gdyb_url = "http://igb.hsa.gdgov.cn/ebus/gdyb_api/prd/hsa/hgs/"
162
 #gdyb_paasid = "test_sz"
162
 #gdyb_paasid = "test_sz"
163
 #gdyb_paasid = zh_cs
163
 #gdyb_paasid = zh_cs
164
-#gdyb_paasid = test_hosp
165
-gdyb_paasid = "zh_prd_yjyy"
164
+gdyb_paasid = test_hosp
165
+#gdyb_paasid = "zh_prd_yjyy"
166
 readmysqlhost = rm-wz9rg531npf61q03tro.mysql.rds.aliyuncs.com
166
 readmysqlhost = rm-wz9rg531npf61q03tro.mysql.rds.aliyuncs.com
167
 readmysqlport = 3306
167
 readmysqlport = 3306
168
 readmysqluser = root
168
 readmysqluser = root

+ 27 - 30
controllers/sz/sz_his_api_controller.go 查看文件

14
 
14
 
15
 	//"github.com/axgle/mahonia"
15
 	//"github.com/axgle/mahonia"
16
 	"math"
16
 	"math"
17
-	//"math/rand"
17
+	//"math/rand"µ
18
 	"strconv"
18
 	"strconv"
19
 	"strings"
19
 	"strings"
20
 	//"strings"
20
 	//"strings"
919
 
919
 
920
 		//1.判断读卡类型
920
 		//1.判断读卡类型
921
 		//2.读卡 获取交易验证码,医疗证号,发卡地区行政区划代码
921
 		//2.读卡 获取交易验证码,医疗证号,发卡地区行政区划代码
922
-		//yiliao_number, id_card_number, verifyCode, version_code, health_card_no, _, ret4 := ReadBasCardGetNumber("MZ002" + "|" + number + "|" + miConfig.Code + "|")
923
-		//fmt.Println(yiliao_number)
924
-		//fmt.Println(id_card_number)
925
-		//fmt.Println(verifyCode)
926
-		//fmt.Println(version_code)
927
-		//fmt.Println(ret4)
922
+		yiliao_number, id_card_number, verifyCode, version_code, health_card_no, _, ret4 := ReadBasCardGetNumber("MZ002" + "|" + number + "|" + miConfig.Code + "|")
923
+		fmt.Println(yiliao_number)
924
+		fmt.Println(id_card_number)
925
+		fmt.Println(verifyCode)
926
+		fmt.Println(version_code)
927
+		fmt.Println(ret4)
928
 
928
 
929
 		dept_code := doctorDepartment.Number
929
 		dept_code := doctorDepartment.Number
930
 
930
 
931
 		is_yidi = 1
931
 		is_yidi = 1
932
-		tempPatient, _ := service.GetPatientByNumber(id_card, adminInfo.CurrentOrgId)
932
+		tempPatient, _ := service.GetPatientByNumber(id_card_number, adminInfo.CurrentOrgId)
933
 		//根据业务的人员信息跟设备读社保卡获取的信息进行匹配,判断是否为同一个人,相同则进行挂号操作,不同则报错
933
 		//根据业务的人员信息跟设备读社保卡获取的信息进行匹配,判断是否为同一个人,相同则进行挂号操作,不同则报错
934
 		fmt.Println(tempPatient.ID)
934
 		fmt.Println(tempPatient.ID)
935
-		//fmt.Println(patient_id)
936
-		ret4 := 0
935
+		fmt.Println(patient_id)
936
+
937
 		if tempPatient.ID == patient_id {
937
 		if tempPatient.ID == patient_id {
938
 			temp_mz_number := miConfig.Code + year + month + day +
938
 			temp_mz_number := miConfig.Code + year + month + day +
939
 				fmt.Sprintf("%07v", rand.New(rand.NewSource(time.Now().UnixNano())).Int31n(10000000))
939
 				fmt.Sprintf("%07v", rand.New(rand.NewSource(time.Now().UnixNano())).Int31n(10000000))
940
 			tempVerifyCode, tempVersionCode := ReadCardGetCode("XX001" + "|" + temp_mz_number + "|" + miConfig.Code)
940
 			tempVerifyCode, tempVersionCode := ReadCardGetCode("XX001" + "|" + temp_mz_number + "|" + miConfig.Code)
941
-			yiliao_number := "%GALMAFXJGKUKZNKWAIUH?;07857319025346309758?"
941
+
942
+			yiliao_number = "%GALMAFXJGKUKZNKWAIUH?;07857319025346309758?"
943
+
942
 			result001 := service.SzybXX001(opera_name, opera_code, miConfig.Code, yiliao_number, tempVerifyCode, temp_mz_number, tempVersionCode)
944
 			result001 := service.SzybXX001(opera_name, opera_code, miConfig.Code, yiliao_number, tempVerifyCode, temp_mz_number, tempVersionCode)
943
 
945
 
944
 			if ret4 == 0 { //本地卡流程
946
 			if ret4 == 0 { //本地卡流程
956
 					//	utils.ErrorLog("解析失败:%v", err)
958
 					//	utils.ErrorLog("解析失败:%v", err)
957
 					//}
959
 					//}
958
 
960
 
959
-					tempVerifyCode, tempVersionCode := ReadCardGetCode("MZ002" + "|" + number + "|" + miConfig.Code)
960
-
961
 					//本地就医流程
961
 					//本地就医流程
962
 					//挂号
962
 					//挂号
963
-					resp_result := service.SzybMZ002(opera_name, opera_code, miConfig.Code, dept_code, yiliao_number, tempVerifyCode, number, mz_number, tempVersionCode, custom_code, custom_project_name, allPrice, medical_care)
963
+					resp_result := service.SzybMZ002(opera_name, opera_code, miConfig.Code, dept_code, yiliao_number, verifyCode, number, mz_number, version_code, custom_code, custom_project_name, allPrice, medical_care)
964
 					var dat map[string]interface{}
964
 					var dat map[string]interface{}
965
 					if err := json.Unmarshal([]byte(resp_result), &dat); err == nil {
965
 					if err := json.Unmarshal([]byte(resp_result), &dat); err == nil {
966
 						fmt.Println(dat)
966
 						fmt.Println(dat)
1003
 							YiliaoNumber:           yiliao_number,
1003
 							YiliaoNumber:           yiliao_number,
1004
 							MzNumber:               number,
1004
 							MzNumber:               number,
1005
 							Number:                 mz_number,
1005
 							Number:                 mz_number,
1006
-							PsnNo:                  "",
1006
+							PsnNo:                  health_card_no,
1007
 							PatientInfo:            result001,
1007
 							PatientInfo:            result001,
1008
 						}
1008
 						}
1009
 						service.CreateHisPatientTwo(&his)
1009
 						service.CreateHisPatientTwo(&his)
1030
 
1030
 
1031
 					//tempPatient, _ := service.GetPatientByNumber(id_card_number, adminInfo.CurrentOrgId)
1031
 					//tempPatient, _ := service.GetPatientByNumber(id_card_number, adminInfo.CurrentOrgId)
1032
 					//if tempPatient.ID == patient_id {
1032
 					//if tempPatient.ID == patient_id {
1033
-					resp_result := service.SzybMZ002(opera_name, opera_code, miConfig.Code, "0305", yiliao_number, tempVerifyCode, number, mz_number, tempVersionCode, custom_code, custom_project_name, allPrice, medical_care)
1033
+					resp_result := service.SzybMZ002(opera_name, opera_code, miConfig.Code, "0305", yiliao_number, verifyCode, number, mz_number, version_code, custom_code, custom_project_name, allPrice, medical_care)
1034
 					var dat map[string]interface{}
1034
 					var dat map[string]interface{}
1035
 					if err := json.Unmarshal([]byte(resp_result), &dat); err == nil {
1035
 					if err := json.Unmarshal([]byte(resp_result), &dat); err == nil {
1036
 						fmt.Println(dat)
1036
 						fmt.Println(dat)
1075
 							YiliaoNumber:           yiliao_number,
1075
 							YiliaoNumber:           yiliao_number,
1076
 							MzNumber:               number,
1076
 							MzNumber:               number,
1077
 							Number:                 mz_number,
1077
 							Number:                 mz_number,
1078
-							PsnNo:                  "",
1078
+							PsnNo:                  health_card_no,
1079
 							PatientInfo:            result001,
1079
 							PatientInfo:            result001,
1080
 						}
1080
 						}
1081
 						service.CreateHisPatientTwo(&his)
1081
 						service.CreateHisPatientTwo(&his)
1101
 				//fmt.Println(readCardBasResult)
1101
 				//fmt.Println(readCardBasResult)
1102
 				//是否异地就医,是的话走鉴权流程,不是的话走门诊挂号
1102
 				//是否异地就医,是的话走鉴权流程,不是的话走门诊挂号
1103
 				if is_yidi == 1 { //1本地就医
1103
 				if is_yidi == 1 { //1本地就医
1104
-					resp_result := service.SzybMZ002(opera_name, opera_code, miConfig.Code, "0305", yiliao_number, tempVerifyCode, number, mz_number, tempVersionCode, custom_code, custom_project_name, allPrice, medical_care)
1104
+					resp_result := service.SzybMZ002(opera_name, opera_code, miConfig.Code, "0305", yiliao_number, verifyCode, number, mz_number, version_code, custom_code, custom_project_name, allPrice, medical_care)
1105
 					var dat map[string]interface{}
1105
 					var dat map[string]interface{}
1106
 					if err := json.Unmarshal([]byte(resp_result), &dat); err == nil {
1106
 					if err := json.Unmarshal([]byte(resp_result), &dat); err == nil {
1107
 						fmt.Println(dat)
1107
 						fmt.Println(dat)
1146
 							YiliaoNumber:           yiliao_number,
1146
 							YiliaoNumber:           yiliao_number,
1147
 							MzNumber:               number,
1147
 							MzNumber:               number,
1148
 							Number:                 mz_number,
1148
 							Number:                 mz_number,
1149
-							PsnNo:                  "",
1149
+							PsnNo:                  health_card_no,
1150
 							PatientInfo:            result001,
1150
 							PatientInfo:            result001,
1151
 						}
1151
 						}
1152
 						service.CreateHisPatientTwo(&his)
1152
 						service.CreateHisPatientTwo(&his)
1168
 				} else { //异地就医需要走鉴权流程
1168
 				} else { //异地就医需要走鉴权流程
1169
 					//authResult := CardAuth(number)
1169
 					//authResult := CardAuth(number)
1170
 					//fmt.Println(authResult)
1170
 					//fmt.Println(authResult)
1171
-					resp_result := service.SzybMZ002(opera_name, opera_code, miConfig.Code, "0305", yiliao_number, tempVerifyCode, number, mz_number, tempVersionCode, custom_code, custom_project_name, allPrice, medical_care)
1171
+					resp_result := service.SzybMZ002(opera_name, opera_code, miConfig.Code, "0305", yiliao_number, verifyCode, number, mz_number, version_code, custom_code, custom_project_name, allPrice, medical_care)
1172
 					var dat map[string]interface{}
1172
 					var dat map[string]interface{}
1173
 					if err := json.Unmarshal([]byte(resp_result), &dat); err == nil {
1173
 					if err := json.Unmarshal([]byte(resp_result), &dat); err == nil {
1174
 						fmt.Println(dat)
1174
 						fmt.Println(dat)
1213
 							YiliaoNumber:           yiliao_number,
1213
 							YiliaoNumber:           yiliao_number,
1214
 							MzNumber:               number,
1214
 							MzNumber:               number,
1215
 							Number:                 mz_number,
1215
 							Number:                 mz_number,
1216
-							PsnNo:                  "",
1216
+							PsnNo:                  health_card_no,
1217
 							PatientInfo:            result001,
1217
 							PatientInfo:            result001,
1218
 						}
1218
 						}
1219
 						service.CreateHisPatientTwo(&his)
1219
 						service.CreateHisPatientTwo(&his)
2143
 	admin_user_id, _ := c.GetInt64("admin_user_id")
2143
 	admin_user_id, _ := c.GetInt64("admin_user_id")
2144
 
2144
 
2145
 	his_patient_id, _ := c.GetInt64("his_patient_id")
2145
 	his_patient_id, _ := c.GetInt64("his_patient_id")
2146
-	fmt.Println(his_patient_id)
2146
+
2147
 	timestamp := time.Now().Unix()
2147
 	timestamp := time.Now().Unix()
2148
 	tempTime := time.Unix(timestamp, 0)
2148
 	tempTime := time.Unix(timestamp, 0)
2149
 	timeFormat := tempTime.Format("20060102150405")
2149
 	timeFormat := tempTime.Format("20060102150405")
2215
 	adminRole_two, _ := service.GetAdminUserInfoByID(adminUser.CurrentOrgId, patientPrescription.DoctorId)
2215
 	adminRole_two, _ := service.GetAdminUserInfoByID(adminUser.CurrentOrgId, patientPrescription.DoctorId)
2216
 
2216
 
2217
 	adminRole, _ := service.GetAdminUserInfoByID(adminUser.CurrentOrgId, admin_user_id)
2217
 	adminRole, _ := service.GetAdminUserInfoByID(adminUser.CurrentOrgId, admin_user_id)
2218
-	his, err := service.GetHisPatientInfo(adminUser.CurrentOrgId, patient_id, recordDateTime)
2218
+	his, err := service.GetNewHisPatientInfo(adminUser.CurrentOrgId, his_patient_id, recordDateTime)
2219
 	mz_number := his.Number
2219
 	mz_number := his.Number
2220
 	number := miConfig.Code + year + month + day +
2220
 	number := miConfig.Code + year + month + day +
2221
 		fmt.Sprintf("%07v", rand.New(rand.NewSource(time.Now().UnixNano())).Int31n(10000000)) // 定点协议机构编码(5位)+日期(8位)+流水号(7位)
2221
 		fmt.Sprintf("%07v", rand.New(rand.NewSource(time.Now().UnixNano())).Int31n(10000000)) // 定点协议机构编码(5位)+日期(8位)+流水号(7位)
2489
 
2489
 
2490
 		total, _ = strconv.ParseFloat(fmt.Sprintf("%.2f", total), 64)
2490
 		total, _ = strconv.ParseFloat(fmt.Sprintf("%.2f", total), 64)
2491
 
2491
 
2492
-		tempVerifyCode, tempVersionCode := ReadCardGetCode("FY005" + "|" + number + "|" + miConfig.Code)
2492
+		yiliao_number, id_card_number, verifyCode, version_code, health_card_no, _, ret4 := ReadBasCardGetNumber("FY005" + "|" + number + "|" + miConfig.Code + "|")
2493
 
2493
 
2494
-		//yiliao_number, id_card_number, _, _, health_card_no, _, ret4 := ReadBasCardGetNumber("FY005" + "|" + number + "|" + miConfig.Code + "|")
2495
-		ret4 := 0
2496
-		yiliao_number := "%GALMAFXJGKUKZNKWAIUH?;07857319025346309758?"
2497
 		if ret4 == 0 {
2494
 		if ret4 == 0 {
2498
 			//根据业务的人员信息跟设备读社保卡获取的信息进行匹配,判断是否为同一个人,相同则进行挂号操作,不同则报错
2495
 			//根据业务的人员信息跟设备读社保卡获取的信息进行匹配,判断是否为同一个人,相同则进行挂号操作,不同则报错
2499
-			tempPatient, _ := service.GetPatientByNumber(his.IdCardNo, adminUser.CurrentOrgId)
2496
+			tempPatient, _ := service.GetPatientByNumber(id_card_number, adminUser.CurrentOrgId)
2500
 			if tempPatient.ID == patient_id {
2497
 			if tempPatient.ID == patient_id {
2501
-				result_three := service.SzybFY005(doctor_name, doctor_code, miConfig.Code, total, yiliao_number, tempVerifyCode, number, mz_number, tempVersionCode, drug_doctor_code, drug_doctor_name, his.MedicalTreatmentType, sick.CountryCode)
2498
+				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, sick.CountryCode)
2502
 				var dat map[string]interface{}
2499
 				var dat map[string]interface{}
2503
 				if err := json.Unmarshal([]byte(result_three), &dat); err == nil {
2500
 				if err := json.Unmarshal([]byte(result_three), &dat); err == nil {
2504
 					fmt.Println(dat)
2501
 					fmt.Println(dat)
2518
 					order.PayWay = pay_way
2515
 					order.PayWay = pay_way
2519
 					order.PayPrice = pay_price
2516
 					order.PayPrice = pay_price
2520
 					order.PayCardNo = pay_card_no
2517
 					order.PayCardNo = pay_card_no
2521
-					order.PsnNo = ""
2518
+					order.PsnNo = health_card_no
2522
 					order.DiscountPrice = discount_price
2519
 					order.DiscountPrice = discount_price
2523
 					order.PreferentialPrice = preferential_price
2520
 					order.PreferentialPrice = preferential_price
2524
 					order.RealityPrice = reality_price
2521
 					order.RealityPrice = reality_price