|
@@ -87,6 +87,8 @@ func HisManagerApiRegistRouters() {
|
87
|
87
|
|
88
|
88
|
beego.Router("/api/3501", &HisApiController{}, "post:Post3501")
|
89
|
89
|
|
|
90
|
+ beego.Router("/api/readele", &HisApiController{}, "get:ReadEleToken")
|
|
91
|
+
|
90
|
92
|
}
|
91
|
93
|
|
92
|
94
|
type Result3101 struct {
|
|
@@ -122,6 +124,108 @@ type Result3101 struct {
|
122
|
124
|
} `json:"output"`
|
123
|
125
|
}
|
124
|
126
|
|
|
127
|
+func (c *HisApiController) ReadEleToken() {
|
|
128
|
+ admin_user_id, _ := c.GetInt64("admin_user_id")
|
|
129
|
+ his_patient_id, _ := c.GetInt64("his_patient_id")
|
|
130
|
+
|
|
131
|
+ adminUser := c.GetAdminUserInfo()
|
|
132
|
+ miConfig, _ := service.FindMedicalInsuranceInfo(adminUser.CurrentOrgId)
|
|
133
|
+ roles, _ := service.GetAdminUserInfoByID(adminUser.CurrentOrgId, admin_user_id)
|
|
134
|
+ his, _ := service.GetNewHisPatientInfoFour(c.GetAdminUserInfo().CurrentOrgId, his_patient_id)
|
|
135
|
+
|
|
136
|
+ if miConfig.MdtrtareaAdmvs == "320921" || miConfig.MdtrtareaAdmvs == "320982" {
|
|
137
|
+ tokens := ReadEleCard(admin_user_id, c.GetAdminUserInfo().CurrentOrgId, c)
|
|
138
|
+ if len(tokens) > 0 {
|
|
139
|
+ c.ServeSuccessJSON(map[string]interface{}{
|
|
140
|
+ "msg": "读取成功,请在5分钟内进行结算操作",
|
|
141
|
+ })
|
|
142
|
+ } else {
|
|
143
|
+ c.ServeSuccessJSON(map[string]interface{}{
|
|
144
|
+ "failed_code": -10,
|
|
145
|
+ "msg": "读取失败",
|
|
146
|
+ })
|
|
147
|
+ }
|
|
148
|
+
|
|
149
|
+ } else if miConfig.MdtrtareaAdmvs == "440305" {
|
|
150
|
+ if initFlag == 0 {
|
|
151
|
+ c.TestGetBasBaseInit()
|
|
152
|
+ }
|
|
153
|
+ token := c.GetEleBaseInfo()
|
|
154
|
+ token = Remove0000(token)
|
|
155
|
+ if len(token) > 0 {
|
|
156
|
+ c.ServeSuccessJSON(map[string]interface{}{
|
|
157
|
+ "msg": "读取成功,请在5分钟内进行结算操作",
|
|
158
|
+ })
|
|
159
|
+ } else {
|
|
160
|
+ c.ServeSuccessJSON(map[string]interface{}{
|
|
161
|
+ "failed_code": -10,
|
|
162
|
+ "msg": "读取失败",
|
|
163
|
+ })
|
|
164
|
+ }
|
|
165
|
+
|
|
166
|
+ } else if miConfig.MdtrtareaAdmvs == "350500" {
|
|
167
|
+ _, outPutInfo, errMsg := service.ReadEleCardForSettle(miConfig.Code, roles.UserName, roles.AdminUserId)
|
|
168
|
+ if len(errMsg) == 0 {
|
|
169
|
+ type ELeData struct {
|
|
170
|
+ Data struct {
|
|
171
|
+ IdNo string `json:"idNo"`
|
|
172
|
+ IdType string `json:"idType"`
|
|
173
|
+ UserName string `json:"userName"`
|
|
174
|
+ EcToken string `json:"ecToken"`
|
|
175
|
+ InsuOrg string `json:"insuOrg"`
|
|
176
|
+ Gender string `json:"gender"`
|
|
177
|
+ Birthday string `json:"birthday"`
|
|
178
|
+ Nationality string `json:"nationality"`
|
|
179
|
+ Email string `json:"email"`
|
|
180
|
+ Extra string `json:"extra"`
|
|
181
|
+ } `json:"data"`
|
|
182
|
+ Code int `json:"code"`
|
|
183
|
+ Message string `json:"message"`
|
|
184
|
+ }
|
|
185
|
+
|
|
186
|
+ var ele ELeData
|
|
187
|
+ err := json.Unmarshal([]byte(outPutInfo), &ele)
|
|
188
|
+ if err != nil {
|
|
189
|
+ utils.ErrorLog("解析失败:%v", err)
|
|
190
|
+ }
|
|
191
|
+ token := ele.Data.EcToken
|
|
192
|
+
|
|
193
|
+ if len(token) > 0 {
|
|
194
|
+ psn := &models.HisPsn{
|
|
195
|
+ PsnNo: his.PsnNo,
|
|
196
|
+ Age: 0,
|
|
197
|
+ PatientId: his.PatientId,
|
|
198
|
+ Certno: his.Certno,
|
|
199
|
+ Brdy: his.Brdy,
|
|
200
|
+ Gend: his.Gend,
|
|
201
|
+ Naty: his.Naty,
|
|
202
|
+ PsnCertType: his.PsnCertType,
|
|
203
|
+ PsnName: his.PsnName,
|
|
204
|
+ Idetinfo: his.Idetinfo,
|
|
205
|
+ Insuinfo: his.Iinfo,
|
|
206
|
+ UserOrgId: c.GetAdminUserInfo().CurrentOrgId,
|
|
207
|
+ CardInfo: outPutInfo,
|
|
208
|
+ VerifyNumber: token,
|
|
209
|
+ }
|
|
210
|
+ service.CreateHisPsn(psn)
|
|
211
|
+
|
|
212
|
+ }
|
|
213
|
+
|
|
214
|
+ if len(token) > 0 {
|
|
215
|
+ c.ServeSuccessJSON(map[string]interface{}{
|
|
216
|
+ "msg": "读取成功,请在5分钟内进行结算操作",
|
|
217
|
+ })
|
|
218
|
+ } else {
|
|
219
|
+ c.ServeSuccessJSON(map[string]interface{}{
|
|
220
|
+ "failed_code": -10,
|
|
221
|
+ "msg": "读取失败",
|
|
222
|
+ })
|
|
223
|
+ }
|
|
224
|
+
|
|
225
|
+ }
|
|
226
|
+ }
|
|
227
|
+
|
|
228
|
+}
|
125
|
229
|
func (c *HisApiController) Get9001() {
|
126
|
230
|
adminUser := c.GetAdminUserInfo()
|
127
|
231
|
miConfig, _ := service.FindMedicalInsuranceInfo(adminUser.CurrentOrgId)
|
|
@@ -7243,13 +7347,17 @@ func (c *HisApiController) GetUploadInfo() {
|
7243
|
7347
|
}
|
7244
|
7348
|
|
7245
|
7349
|
} else if miConfig.MdtrtareaAdmvs == "350500" {
|
7246
|
|
- psn_info, _ := service.GetPsnByPatientId(his.PatientId)
|
7247
|
7350
|
var cert_no string
|
7248
|
|
- if his.IdCardType == 1 {
|
|
7351
|
+ if his.IdCardType == 4 {
|
|
7352
|
+ psn_info, _ := service.GetPsnByPatientId(his.PatientId)
|
|
7353
|
+ cert_no = psn_info.VerifyNumber
|
|
7354
|
+ result2, src_resquest, _ = service.FJyb2207ForToken(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, miConfig.Url, miConfig.Code, miConfig.AppSecret, miConfig.SignKey, miConfig.EncKey)
|
|
7355
|
+
|
|
7356
|
+ } else if his.IdCardType == 1 {
|
|
7357
|
+ psn_info, _ := service.GetPsnByPatientId(his.PatientId)
|
7249
|
7358
|
cert_no = strings.Split(psn_info.CardInfo, "|")[0]
|
|
7359
|
+ result2, src_resquest, _ = service.FJyb2207(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, miConfig.Url, miConfig.Code, miConfig.AppSecret, miConfig.SignKey, miConfig.EncKey)
|
7250
|
7360
|
}
|
7251
|
|
- fmt.Println(cert_no)
|
7252
|
|
- result2, src_resquest, _ = service.FJyb2207(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, miConfig.Url, miConfig.Code, miConfig.AppSecret, miConfig.SignKey, miConfig.EncKey)
|
7253
|
7361
|
|
7254
|
7362
|
//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)
|
7255
|
7363
|
var dat map[string]interface{}
|
|
@@ -7718,8 +7826,10 @@ func (c *HisApiController) GetUploadInfo() {
|
7718
|
7826
|
var cert_no string
|
7719
|
7827
|
if his.IdCardType == 1 {
|
7720
|
7828
|
cert_no = strings.Split(psn_info.CardInfo, "|")[0]
|
|
7829
|
+ } else {
|
|
7830
|
+ cert_no = psn_info.VerifyNumber
|
|
7831
|
+
|
7721
|
7832
|
}
|
7722
|
|
- fmt.Println(cert_no)
|
7723
|
7833
|
|
7724
|
7834
|
result2, src_resquest, _ = service.FJyb2207(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, miConfig.Url, miConfig.Code, miConfig.AppSecret, miConfig.SignKey, miConfig.EncKey)
|
7725
|
7835
|
var dat map[string]interface{}
|
|
@@ -8580,15 +8690,7 @@ func (c *HisApiController) GetPreUploadInfo() {
|
8580
|
8690
|
if miConfig.MdtrtareaAdmvs == "320921" {
|
8581
|
8691
|
req, _ = http.NewRequest("POST", "http://192.168.2.110:9532/"+"jsyb/2203", bytes.NewReader(bytesData))
|
8582
|
8692
|
} else {
|
8583
|
|
- tokens := ReadEleCard(admin_user_id, c.GetAdminUserInfo().CurrentOrgId, c)
|
8584
|
|
- if len(tokens) > 0 {
|
8585
|
|
- req, _ = http.NewRequest("POST", "http://192.168.5.251:9532/"+"jsyb/2203", bytes.NewReader(bytesData))
|
8586
|
|
- } else {
|
8587
|
|
- c.ServeSuccessJSON(map[string]interface{}{
|
8588
|
|
- "failed_code": -10,
|
8589
|
|
- "msg": "token无效",
|
8590
|
|
- })
|
8591
|
|
- }
|
|
8693
|
+ req, _ = http.NewRequest("POST", "http://192.168.5.251:9532/"+"jsyb/2203", bytes.NewReader(bytesData))
|
8592
|
8694
|
}
|
8593
|
8695
|
|
8594
|
8696
|
resp, _ := client.Do(req)
|
|
@@ -8651,6 +8753,7 @@ func (c *HisApiController) GetPreUploadInfo() {
|
8651
|
8753
|
if miConfig.MdtrtareaAdmvs == "440781" { //
|
8652
|
8754
|
result, requestLog = service.Gdyb2203A(his.PsnNo, his.Number, doctor_info.UserName, department.Name, miConfig.OrgName, strconv.FormatInt(reg_type, 10), doctor_info.DoctorNumber, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, sickConfig.ContentCode, sickConfig.ClassName, roles.UserName, config, begin_time)
|
8653
|
8755
|
} else {
|
|
8756
|
+
|
8654
|
8757
|
if miConfig.Code == "H15049901371" {
|
8655
|
8758
|
//赤峰地区国家医保医疗类别
|
8656
|
8759
|
//职工透析:医疗类别选特殊情况门诊990502
|
|
@@ -8672,8 +8775,8 @@ func (c *HisApiController) GetPreUploadInfo() {
|
8672
|
8775
|
result, requestLog = service.Gdyb2203A(his.PsnNo, his.Number, doctor_info.UserName, department.Name, miConfig.OrgName, med_type, doctor_info.DoctorNumber, miConfig.Code, his.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, sickConfig.ContentCode, sickConfig.ClassName, roles.UserName, config, begin_time)
|
8673
|
8776
|
} else {
|
8674
|
8777
|
result, requestLog = service.Gdyb2203(his.PsnNo, his.Number, doctor_info.UserName, department.Name, miConfig.OrgName, strconv.FormatInt(reg_type, 10), doctor_info.DoctorNumber, miConfig.Code, his.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, sickConfig.ContentCode, sickConfig.ClassName, roles.UserName, config, begin_time)
|
8675
|
|
-
|
8676
|
8778
|
}
|
|
8779
|
+
|
8677
|
8780
|
saveLog(result, requestLog, "2203", "上传就诊信息")
|
8678
|
8781
|
var respJSON2 map[string]interface{}
|
8679
|
8782
|
if err := json.Unmarshal([]byte(string(result)), &respJSON2); err != nil {
|
|
@@ -8703,9 +8806,7 @@ func (c *HisApiController) GetPreUploadInfo() {
|
8703
|
8806
|
}
|
8704
|
8807
|
}
|
8705
|
8808
|
}
|
8706
|
|
-
|
8707
|
8809
|
}
|
8708
|
|
-
|
8709
|
8810
|
if res2.Infcode != 0 {
|
8710
|
8811
|
adminUser := c.GetAdminUserInfo()
|
8711
|
8812
|
errlog := &models.HisOrderError{
|
|
@@ -9279,8 +9380,16 @@ func (c *HisApiController) GetPreUploadInfo() {
|
9279
|
9380
|
}
|
9280
|
9381
|
|
9281
|
9382
|
} else if miConfig.MdtrtareaAdmvs == "350500" {
|
|
9383
|
+ psn_info, _ := service.GetPsnByPatientIdTwo(his.PatientId, recordDateTime)
|
|
9384
|
+ var result string
|
|
9385
|
+ var request_log string
|
|
9386
|
+ if his.IdCardType == 4 && len(psn_info.VerifyNumber) > 0 {
|
|
9387
|
+ result, request_log, _ = service.FJyb2206ForToken(his.PsnNo, his.Number, chrg_bchno, psn_info.VerifyNumber, 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, miConfig.Url, miConfig.Code, miConfig.AppSecret, miConfig.SignKey, miConfig.EncKey)
|
|
9388
|
+
|
|
9389
|
+ } else {
|
|
9390
|
+ result, request_log, _ = service.FJyb2206(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, miConfig.Url, miConfig.Code, miConfig.AppSecret, miConfig.SignKey, miConfig.EncKey)
|
|
9391
|
+ }
|
9282
|
9392
|
|
9283
|
|
- result, request_log, _ := service.FJyb2206(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, miConfig.Url, miConfig.Code, miConfig.AppSecret, miConfig.SignKey, miConfig.EncKey)
|
9284
|
9393
|
var dat map[string]interface{}
|
9285
|
9394
|
if err := json.Unmarshal([]byte(result), &dat); err == nil {
|
9286
|
9395
|
fmt.Println(dat)
|
|
@@ -9318,7 +9427,13 @@ func (c *HisApiController) GetPreUploadInfo() {
|
9318
|
9427
|
}
|
9319
|
9428
|
result, request_log = service.Gdyb2206(his.PsnNo, his.Number, chrg_bchno, cert_no, insutype, allTotal, miConfig.OrgName, roles.UserName, miConfig.Code, his.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, med_type, his.IdCardType, 0, 0, 0, 0, his.IdType)
|
9320
|
9429
|
} else {
|
9321
|
|
- result, request_log = service.Gdyb2206(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)
|
|
9430
|
+ psn_info, _ := service.GetPsnByPatientId(his.PatientId)
|
|
9431
|
+ if his.IdCardType == 4 {
|
|
9432
|
+ result, request_log = service.Gdyb2206(his.PsnNo, his.Number, chrg_bchno, psn_info.VerifyNumber, 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)
|
|
9433
|
+ } else {
|
|
9434
|
+ result, request_log = service.Gdyb2206(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)
|
|
9435
|
+ }
|
|
9436
|
+
|
9322
|
9437
|
}
|
9323
|
9438
|
|
9324
|
9439
|
var dat map[string]interface{}
|