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