|
@@ -298,6 +298,84 @@ func (c *HisApiController) ReadEleToken() {
|
298
|
298
|
fmt.Println(ele.Data.UserName)
|
299
|
299
|
result2, requestLog2 := service.Jxyb1101ForEleCert(miConfig.OrgName, roles.UserName, miConfig.Code, ele.Data.InsuOrg, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, miConfig.Url, miConfig.AccessKey, token, "", ele.Data.IdNo, ele.Data.UserName)
|
300
|
300
|
|
|
301
|
+ saveLog(result2, requestLog2, "1101", "获取人员信息")
|
|
302
|
+ var res ResultTwo
|
|
303
|
+ if err := json.Unmarshal([]byte(result2), &res); err != nil {
|
|
304
|
+ utils.ErrorLog("解析失败:%v", err)
|
|
305
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
306
|
+ return
|
|
307
|
+ }
|
|
308
|
+ if res.Infcode == 0 {
|
|
309
|
+ patient, err := service.GetPatientByNumber(res.Output.Baseinfo.Certno, c.GetAdminUserInfo().CurrentOrgId)
|
|
310
|
+ if err == gorm.ErrRecordNotFound {
|
|
311
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeNoPateintException)
|
|
312
|
+ return
|
|
313
|
+ } else if err != nil {
|
|
314
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
|
|
315
|
+ return
|
|
316
|
+ } else {
|
|
317
|
+ Iinfos, _ := json.Marshal(res.Output.Iinfo)
|
|
318
|
+ Idetinfos, _ := json.Marshal(res.Output.Idetinfo)
|
|
319
|
+ infoStr := string(Iinfos)
|
|
320
|
+ idetinfoStr := string(Idetinfos)
|
|
321
|
+ psn := &models.HisPsn{
|
|
322
|
+ PsnNo: res.Output.Baseinfo.PsnNo,
|
|
323
|
+ Age: res.Output.Baseinfo.Age,
|
|
324
|
+ PatientId: patient.ID,
|
|
325
|
+ Certno: res.Output.Baseinfo.Certno,
|
|
326
|
+ Brdy: res.Output.Baseinfo.Brdy,
|
|
327
|
+ Gend: res.Output.Baseinfo.Gend,
|
|
328
|
+ Naty: res.Output.Baseinfo.Naty,
|
|
329
|
+ PsnCertType: res.Output.Baseinfo.PsnCertType,
|
|
330
|
+ PsnName: res.Output.Baseinfo.PsnName,
|
|
331
|
+ Idetinfo: idetinfoStr,
|
|
332
|
+ Insuinfo: infoStr,
|
|
333
|
+ UserOrgId: c.GetAdminUserInfo().CurrentOrgId,
|
|
334
|
+ CardInfo: "",
|
|
335
|
+ VerifyNumber: token,
|
|
336
|
+ }
|
|
337
|
+ service.CreateHisPsn(psn)
|
|
338
|
+ c.ServeSuccessJSON(map[string]interface{}{
|
|
339
|
+ "patient": patient,
|
|
340
|
+ "number": token,
|
|
341
|
+ })
|
|
342
|
+ }
|
|
343
|
+ } else {
|
|
344
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeHisFailedException)
|
|
345
|
+ return
|
|
346
|
+ }
|
|
347
|
+ } else if miConfig.MdtrtareaAdmvs == "430800" {
|
|
348
|
+ if initFlag == 0 {
|
|
349
|
+ c.TestGetJiangXiBasBaseInit()
|
|
350
|
+ }
|
|
351
|
+ json_result := GetJxEleBaseInfo(c.GetAdminUserInfo().CurrentOrgId)
|
|
352
|
+ type ELeData struct {
|
|
353
|
+ Data struct {
|
|
354
|
+ IdNo string `json:"idNo"`
|
|
355
|
+ IdType string `json:"idType"`
|
|
356
|
+ UserName string `json:"userName"`
|
|
357
|
+ EcToken string `json:"ecToken"`
|
|
358
|
+ InsuOrg string `json:"insuOrg"`
|
|
359
|
+ Gender string `json:"gender"`
|
|
360
|
+ Birthday string `json:"birthday"`
|
|
361
|
+ Nationality string `json:"nationality"`
|
|
362
|
+ Email string `json:"email"`
|
|
363
|
+ Extra string `json:"extra"`
|
|
364
|
+ } `json:"data"`
|
|
365
|
+ Code int `json:"code"`
|
|
366
|
+ Message string `json:"message"`
|
|
367
|
+ }
|
|
368
|
+
|
|
369
|
+ var ele ELeData
|
|
370
|
+ err := json.Unmarshal([]byte(json_result), &ele)
|
|
371
|
+ if err != nil {
|
|
372
|
+ utils.ErrorLog("解析失败:%v", err)
|
|
373
|
+ }
|
|
374
|
+ token := ele.Data.EcToken
|
|
375
|
+ token = Remove0000(token)
|
|
376
|
+ fmt.Println(ele.Data.UserName)
|
|
377
|
+ result2, requestLog2 := service.Hnyb1101ForEleCert(miConfig.OrgName, roles.UserName, miConfig.Code, ele.Data.InsuOrg, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, miConfig.Url, miConfig.AccessKey, token, "", ele.Data.IdNo, ele.Data.UserName)
|
|
378
|
+
|
301
|
379
|
saveLog(result2, requestLog2, "1101", "获取人员信息")
|
302
|
380
|
var res ResultTwo
|
303
|
381
|
if err := json.Unmarshal([]byte(result2), &res); err != nil {
|
|
@@ -1416,6 +1494,25 @@ func (c *HisApiController) GetPsnNcdsInfo() {
|
1416
|
1494
|
return
|
1417
|
1495
|
}
|
1418
|
1496
|
|
|
1497
|
+ } else if miConfig.MdtrtareaAdmvs == "430800" {
|
|
1498
|
+ p, _ := service.GetHisPatientById(patient_id)
|
|
1499
|
+
|
|
1500
|
+ result, _ := service.Hnyb5301(p.PsnNo, miConfig.OrgName, role.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, miConfig.Url, miConfig.AccessKey, "")
|
|
1501
|
+
|
|
1502
|
+ var dat map[string]interface{}
|
|
1503
|
+ if err := json.Unmarshal([]byte(result), &dat); err == nil {
|
|
1504
|
+ fmt.Println(dat)
|
|
1505
|
+ } else {
|
|
1506
|
+ fmt.Println(err)
|
|
1507
|
+ }
|
|
1508
|
+
|
|
1509
|
+ userJSONBytes, _ := json.Marshal(dat)
|
|
1510
|
+ if err := json.Unmarshal(userJSONBytes, &res); err != nil {
|
|
1511
|
+ utils.ErrorLog("解析失败:%v", err)
|
|
1512
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
1513
|
+ return
|
|
1514
|
+ }
|
|
1515
|
+
|
1419
|
1516
|
} else {
|
1420
|
1517
|
|
1421
|
1518
|
result := service.Gdyb5301(psn_record.PsnNo, miConfig.OrgName, role.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey)
|
|
@@ -2169,10 +2266,168 @@ func (c *HisApiController) ReadCard() {
|
2169
|
2266
|
VerifyNumber: "",
|
2170
|
2267
|
}
|
2171
|
2268
|
service.CreateHisPsn(psn)
|
|
2269
|
+ var rf []*ResultFive
|
|
2270
|
+ json.Unmarshal([]byte(infoStr), &rf)
|
|
2271
|
+
|
|
2272
|
+ var insutypes []*ResultFive
|
|
2273
|
+ var insutype string
|
|
2274
|
+ var is390 int = 0
|
|
2275
|
+ var is310 int = 0
|
|
2276
|
+
|
|
2277
|
+ for _, item := range rf {
|
|
2278
|
+ if (item.Insutype == "390" && item.PsnInsuStas == "1") || (item.Insutype == "310" && item.PsnInsuStas == "1") {
|
|
2279
|
+ insutypes = append(insutypes, item)
|
|
2280
|
+ }
|
|
2281
|
+ }
|
|
2282
|
+
|
|
2283
|
+ if len(insutypes) == 1 {
|
|
2284
|
+ insutype = insutypes[0].Insutype
|
|
2285
|
+ //insuplc_admdvs = insutypes[0].InsuplcAdmdvs
|
|
2286
|
+ } else {
|
|
2287
|
+ for _, i := range insutypes {
|
|
2288
|
+ if i.Insutype == "390" {
|
|
2289
|
+ is390 = 1
|
|
2290
|
+ }
|
|
2291
|
+
|
|
2292
|
+ if i.Insutype == "310" {
|
|
2293
|
+ is310 = 1
|
|
2294
|
+ }
|
|
2295
|
+ }
|
|
2296
|
+ }
|
|
2297
|
+ if is390 == 1 {
|
|
2298
|
+ insutype = "390"
|
|
2299
|
+ }
|
|
2300
|
+
|
|
2301
|
+ if is310 == 1 {
|
|
2302
|
+ insutype = "310"
|
|
2303
|
+ }
|
|
2304
|
+
|
|
2305
|
+ if len(insutypes) == 0 {
|
|
2306
|
+ insutype = "310"
|
|
2307
|
+ }
|
2172
|
2308
|
|
2173
|
2309
|
c.ServeSuccessJSON(map[string]interface{}{
|
2174
|
|
- "patient": patient,
|
2175
|
|
- "number": basNumber,
|
|
2310
|
+ "patient": patient,
|
|
2311
|
+ "number": basNumber,
|
|
2312
|
+ "insutype": insutype,
|
|
2313
|
+ })
|
|
2314
|
+ }
|
|
2315
|
+ } else {
|
|
2316
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeHisFailedException)
|
|
2317
|
+ return
|
|
2318
|
+ }
|
|
2319
|
+
|
|
2320
|
+ } else if miConfig.MdtrtareaAdmvs == "430800" {
|
|
2321
|
+ fmt.Println(initFlag)
|
|
2322
|
+ fmt.Println("initFlag")
|
|
2323
|
+
|
|
2324
|
+ if initFlag == 0 {
|
|
2325
|
+ c.TestGetJiangXiBasBaseInit()
|
|
2326
|
+ }
|
|
2327
|
+ basStr := c.GetBasBaseInfo()
|
|
2328
|
+ if len(basStr) == 0 {
|
|
2329
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeReadCardException)
|
|
2330
|
+ return
|
|
2331
|
+ }
|
|
2332
|
+ fmt.Println(basStr)
|
|
2333
|
+ bas := strings.Split(basStr, "|")
|
|
2334
|
+ basNumber := bas[1]
|
|
2335
|
+ fmt.Println(basNumber)
|
|
2336
|
+ card_sn := bas[3]
|
|
2337
|
+ fmt.Println(card_sn)
|
|
2338
|
+ result, _ := service.Hnyb1101(basNumber, miConfig.OrgName, roles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, id_card_type, card_sn, "1", miConfig.Url, miConfig.AccessKey, "")
|
|
2339
|
+
|
|
2340
|
+ //result := service.Jxyb1101(basNumber, miConfig.OrgName, roles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, id_card_type, card_sn, certificates)
|
|
2341
|
+ var dat map[string]interface{}
|
|
2342
|
+ if err := json.Unmarshal([]byte(result), &dat); err == nil {
|
|
2343
|
+ fmt.Println(dat)
|
|
2344
|
+ } else {
|
|
2345
|
+ fmt.Println(err)
|
|
2346
|
+ }
|
|
2347
|
+
|
|
2348
|
+ userJSONBytes, _ := json.Marshal(dat)
|
|
2349
|
+ var res ResultTwo
|
|
2350
|
+ if err := json.Unmarshal(userJSONBytes, &res); err != nil {
|
|
2351
|
+ utils.ErrorLog("解析失败:%v", err)
|
|
2352
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
2353
|
+ return
|
|
2354
|
+ }
|
|
2355
|
+
|
|
2356
|
+ if res.Infcode == 0 {
|
|
2357
|
+ patient, err := service.GetPatientByNumber(basNumber, c.GetAdminUserInfo().CurrentOrgId)
|
|
2358
|
+ if err == gorm.ErrRecordNotFound {
|
|
2359
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeNoPateintException)
|
|
2360
|
+ return
|
|
2361
|
+ } else if err != nil {
|
|
2362
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
|
|
2363
|
+ return
|
|
2364
|
+
|
|
2365
|
+ } else {
|
|
2366
|
+ Iinfos, _ := json.Marshal(res.Output.Iinfo)
|
|
2367
|
+ Idetinfos, _ := json.Marshal(res.Output.Idetinfo)
|
|
2368
|
+ infoStr := string(Iinfos)
|
|
2369
|
+ idetinfoStr := string(Idetinfos)
|
|
2370
|
+ psn := &models.HisPsn{
|
|
2371
|
+ PsnNo: res.Output.Baseinfo.PsnNo,
|
|
2372
|
+ Age: res.Output.Baseinfo.Age,
|
|
2373
|
+ PatientId: patient.ID,
|
|
2374
|
+ Certno: res.Output.Baseinfo.Certno,
|
|
2375
|
+ Brdy: res.Output.Baseinfo.Brdy,
|
|
2376
|
+ Gend: res.Output.Baseinfo.Gend,
|
|
2377
|
+ Naty: res.Output.Baseinfo.Naty,
|
|
2378
|
+ PsnCertType: res.Output.Baseinfo.PsnCertType,
|
|
2379
|
+ PsnName: res.Output.Baseinfo.PsnName,
|
|
2380
|
+ Idetinfo: idetinfoStr,
|
|
2381
|
+ Insuinfo: infoStr,
|
|
2382
|
+ UserOrgId: c.GetAdminUserInfo().CurrentOrgId,
|
|
2383
|
+ CardInfo: basStr,
|
|
2384
|
+ VerifyNumber: "",
|
|
2385
|
+ }
|
|
2386
|
+ service.CreateHisPsn(psn)
|
|
2387
|
+ var rf []*ResultFive
|
|
2388
|
+ json.Unmarshal([]byte(infoStr), &rf)
|
|
2389
|
+
|
|
2390
|
+ var insutypes []*ResultFive
|
|
2391
|
+ var insutype string
|
|
2392
|
+ var is390 int = 0
|
|
2393
|
+ var is310 int = 0
|
|
2394
|
+
|
|
2395
|
+ for _, item := range rf {
|
|
2396
|
+ if (item.Insutype == "390" && item.PsnInsuStas == "1") || (item.Insutype == "310" && item.PsnInsuStas == "1") {
|
|
2397
|
+ insutypes = append(insutypes, item)
|
|
2398
|
+ }
|
|
2399
|
+ }
|
|
2400
|
+
|
|
2401
|
+ if len(insutypes) == 1 {
|
|
2402
|
+ insutype = insutypes[0].Insutype
|
|
2403
|
+ //insuplc_admdvs = insutypes[0].InsuplcAdmdvs
|
|
2404
|
+ } else {
|
|
2405
|
+ for _, i := range insutypes {
|
|
2406
|
+ if i.Insutype == "390" {
|
|
2407
|
+ is390 = 1
|
|
2408
|
+ }
|
|
2409
|
+
|
|
2410
|
+ if i.Insutype == "310" {
|
|
2411
|
+ is310 = 1
|
|
2412
|
+ }
|
|
2413
|
+ }
|
|
2414
|
+ }
|
|
2415
|
+ if is390 == 1 {
|
|
2416
|
+ insutype = "390"
|
|
2417
|
+ }
|
|
2418
|
+
|
|
2419
|
+ if is310 == 1 {
|
|
2420
|
+ insutype = "310"
|
|
2421
|
+ }
|
|
2422
|
+
|
|
2423
|
+ if len(insutypes) == 0 {
|
|
2424
|
+ insutype = "310"
|
|
2425
|
+ }
|
|
2426
|
+
|
|
2427
|
+ c.ServeSuccessJSON(map[string]interface{}{
|
|
2428
|
+ "patient": patient,
|
|
2429
|
+ "number": basNumber,
|
|
2430
|
+ "insutype": insutype,
|
2176
|
2431
|
})
|
2177
|
2432
|
}
|
2178
|
2433
|
} else {
|
|
@@ -2598,10 +2853,51 @@ func (c *HisApiController) ReadCard() {
|
2598
|
2853
|
CardInfo: card_info,
|
2599
|
2854
|
VerifyNumber: token,
|
2600
|
2855
|
}
|
|
2856
|
+ var rf []*ResultFive
|
|
2857
|
+ json.Unmarshal([]byte(infoStr), &rf)
|
|
2858
|
+
|
|
2859
|
+ var insutypes []*ResultFive
|
|
2860
|
+ var insutype string
|
|
2861
|
+ var is390 int = 0
|
|
2862
|
+ var is310 int = 0
|
|
2863
|
+
|
|
2864
|
+ for _, item := range rf {
|
|
2865
|
+ if (item.Insutype == "390" && item.PsnInsuStas == "1") || (item.Insutype == "310" && item.PsnInsuStas == "1") {
|
|
2866
|
+ insutypes = append(insutypes, item)
|
|
2867
|
+ }
|
|
2868
|
+ }
|
|
2869
|
+
|
|
2870
|
+ if len(insutypes) == 1 {
|
|
2871
|
+ insutype = insutypes[0].Insutype
|
|
2872
|
+ //insuplc_admdvs = insutypes[0].InsuplcAdmdvs
|
|
2873
|
+ } else {
|
|
2874
|
+ for _, i := range insutypes {
|
|
2875
|
+ if i.Insutype == "390" {
|
|
2876
|
+ is390 = 1
|
|
2877
|
+ }
|
|
2878
|
+
|
|
2879
|
+ if i.Insutype == "310" {
|
|
2880
|
+ is310 = 1
|
|
2881
|
+ }
|
|
2882
|
+ }
|
|
2883
|
+ }
|
|
2884
|
+ if is390 == 1 {
|
|
2885
|
+ insutype = "390"
|
|
2886
|
+ }
|
|
2887
|
+
|
|
2888
|
+ if is310 == 1 {
|
|
2889
|
+ insutype = "310"
|
|
2890
|
+ }
|
|
2891
|
+
|
|
2892
|
+ if len(insutypes) == 0 {
|
|
2893
|
+ insutype = "310"
|
|
2894
|
+ }
|
|
2895
|
+
|
2601
|
2896
|
service.CreateHisPsn(psn)
|
2602
|
2897
|
c.ServeSuccessJSON(map[string]interface{}{
|
2603
|
|
- "patient": patient,
|
2604
|
|
- "number": token,
|
|
2898
|
+ "patient": patient,
|
|
2899
|
+ "number": token,
|
|
2900
|
+ "insutype": insutype,
|
2605
|
2901
|
})
|
2606
|
2902
|
}
|
2607
|
2903
|
} else {
|
|
@@ -2743,9 +3039,171 @@ func (c *HisApiController) ReadCard() {
|
2743
|
3039
|
VerifyNumber: token,
|
2744
|
3040
|
}
|
2745
|
3041
|
service.CreateHisPsn(psn)
|
|
3042
|
+ var rf []*ResultFive
|
|
3043
|
+ json.Unmarshal([]byte(infoStr), &rf)
|
|
3044
|
+
|
|
3045
|
+ var insutypes []*ResultFive
|
|
3046
|
+ var insutype string
|
|
3047
|
+ var is390 int = 0
|
|
3048
|
+ var is310 int = 0
|
|
3049
|
+
|
|
3050
|
+ for _, item := range rf {
|
|
3051
|
+ if (item.Insutype == "390" && item.PsnInsuStas == "1") || (item.Insutype == "310" && item.PsnInsuStas == "1") {
|
|
3052
|
+ insutypes = append(insutypes, item)
|
|
3053
|
+ }
|
|
3054
|
+ }
|
|
3055
|
+
|
|
3056
|
+ if len(insutypes) == 1 {
|
|
3057
|
+ insutype = insutypes[0].Insutype
|
|
3058
|
+ //insuplc_admdvs = insutypes[0].InsuplcAdmdvs
|
|
3059
|
+ } else {
|
|
3060
|
+ for _, i := range insutypes {
|
|
3061
|
+ if i.Insutype == "390" {
|
|
3062
|
+ is390 = 1
|
|
3063
|
+ }
|
|
3064
|
+
|
|
3065
|
+ if i.Insutype == "310" {
|
|
3066
|
+ is310 = 1
|
|
3067
|
+ }
|
|
3068
|
+ }
|
|
3069
|
+ }
|
|
3070
|
+ if is390 == 1 {
|
|
3071
|
+ insutype = "390"
|
|
3072
|
+ }
|
|
3073
|
+
|
|
3074
|
+ if is310 == 1 {
|
|
3075
|
+ insutype = "310"
|
|
3076
|
+ }
|
|
3077
|
+
|
|
3078
|
+ if len(insutypes) == 0 {
|
|
3079
|
+ insutype = "310"
|
|
3080
|
+ }
|
|
3081
|
+
|
2746
|
3082
|
c.ServeSuccessJSON(map[string]interface{}{
|
2747
|
|
- "patient": patient,
|
2748
|
|
- "number": token,
|
|
3083
|
+ "patient": patient,
|
|
3084
|
+ "number": token,
|
|
3085
|
+ "insutype": insutype,
|
|
3086
|
+ })
|
|
3087
|
+ }
|
|
3088
|
+ } else {
|
|
3089
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeHisFailedException)
|
|
3090
|
+ return
|
|
3091
|
+ }
|
|
3092
|
+
|
|
3093
|
+ } else if miConfig.MdtrtareaAdmvs == "430800" {
|
|
3094
|
+ //if initFlag == 0 {
|
|
3095
|
+ c.TestGetJiangXiBasBaseInit()
|
|
3096
|
+ //}
|
|
3097
|
+ //if initEleFlag == 0 {
|
|
3098
|
+ // GetJxEleBaseInitInfo(c.GetAdminUserInfo().CurrentOrgId)
|
|
3099
|
+ //}
|
|
3100
|
+ json_result := GetJxEleBaseInfo(c.GetAdminUserInfo().CurrentOrgId)
|
|
3101
|
+ type ELeData struct {
|
|
3102
|
+ Data struct {
|
|
3103
|
+ IdNo string `json:"idNo"`
|
|
3104
|
+ IdType string `json:"idType"`
|
|
3105
|
+ UserName string `json:"userName"`
|
|
3106
|
+ EcToken string `json:"ecToken"`
|
|
3107
|
+ InsuOrg string `json:"insuOrg"`
|
|
3108
|
+ Gender string `json:"gender"`
|
|
3109
|
+ Birthday string `json:"birthday"`
|
|
3110
|
+ Nationality string `json:"nationality"`
|
|
3111
|
+ Email string `json:"email"`
|
|
3112
|
+ Extra string `json:"extra"`
|
|
3113
|
+ } `json:"data"`
|
|
3114
|
+ Code int `json:"code"`
|
|
3115
|
+ Message string `json:"message"`
|
|
3116
|
+ }
|
|
3117
|
+
|
|
3118
|
+ var ele ELeData
|
|
3119
|
+ err := json.Unmarshal([]byte(json_result), &ele)
|
|
3120
|
+ if err != nil {
|
|
3121
|
+ utils.ErrorLog("解析失败:%v", err)
|
|
3122
|
+ }
|
|
3123
|
+ token := ele.Data.EcToken
|
|
3124
|
+ token = Remove0000(token)
|
|
3125
|
+ result2, requestLog2 := service.Hnyb1101ForEleCert(miConfig.OrgName, roles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, miConfig.Url, miConfig.AccessKey, token, "", ele.Data.IdNo, ele.Data.UserName)
|
|
3126
|
+ saveLog(result2, requestLog2, "1101", "获取人员信息")
|
|
3127
|
+ var res ResultTwo
|
|
3128
|
+ if err := json.Unmarshal([]byte(result2), &res); err != nil {
|
|
3129
|
+ utils.ErrorLog("解析失败:%v", err)
|
|
3130
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
3131
|
+ return
|
|
3132
|
+ }
|
|
3133
|
+ if res.Infcode == 0 {
|
|
3134
|
+ patient, err := service.GetPatientByNumber(res.Output.Baseinfo.Certno, c.GetAdminUserInfo().CurrentOrgId)
|
|
3135
|
+ if err == gorm.ErrRecordNotFound {
|
|
3136
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeNoPateintException)
|
|
3137
|
+ return
|
|
3138
|
+ } else if err != nil {
|
|
3139
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
|
|
3140
|
+ return
|
|
3141
|
+ } else {
|
|
3142
|
+ Iinfos, _ := json.Marshal(res.Output.Iinfo)
|
|
3143
|
+ Idetinfos, _ := json.Marshal(res.Output.Idetinfo)
|
|
3144
|
+ infoStr := string(Iinfos)
|
|
3145
|
+ idetinfoStr := string(Idetinfos)
|
|
3146
|
+ psn := &models.HisPsn{
|
|
3147
|
+ PsnNo: res.Output.Baseinfo.PsnNo,
|
|
3148
|
+ Age: res.Output.Baseinfo.Age,
|
|
3149
|
+ PatientId: patient.ID,
|
|
3150
|
+ Certno: res.Output.Baseinfo.Certno,
|
|
3151
|
+ Brdy: res.Output.Baseinfo.Brdy,
|
|
3152
|
+ Gend: res.Output.Baseinfo.Gend,
|
|
3153
|
+ Naty: res.Output.Baseinfo.Naty,
|
|
3154
|
+ PsnCertType: res.Output.Baseinfo.PsnCertType,
|
|
3155
|
+ PsnName: res.Output.Baseinfo.PsnName,
|
|
3156
|
+ Idetinfo: idetinfoStr,
|
|
3157
|
+ Insuinfo: infoStr,
|
|
3158
|
+ UserOrgId: c.GetAdminUserInfo().CurrentOrgId,
|
|
3159
|
+ CardInfo: "",
|
|
3160
|
+ VerifyNumber: token,
|
|
3161
|
+ }
|
|
3162
|
+ service.CreateHisPsn(psn)
|
|
3163
|
+ var rf []*ResultFive
|
|
3164
|
+ json.Unmarshal([]byte(infoStr), &rf)
|
|
3165
|
+
|
|
3166
|
+ var insutypes []*ResultFive
|
|
3167
|
+ var insutype string
|
|
3168
|
+ var is390 int = 0
|
|
3169
|
+ var is310 int = 0
|
|
3170
|
+
|
|
3171
|
+ for _, item := range rf {
|
|
3172
|
+ if (item.Insutype == "390" && item.PsnInsuStas == "1") || (item.Insutype == "310" && item.PsnInsuStas == "1") {
|
|
3173
|
+ insutypes = append(insutypes, item)
|
|
3174
|
+ }
|
|
3175
|
+ }
|
|
3176
|
+
|
|
3177
|
+ if len(insutypes) == 1 {
|
|
3178
|
+ insutype = insutypes[0].Insutype
|
|
3179
|
+ //insuplc_admdvs = insutypes[0].InsuplcAdmdvs
|
|
3180
|
+ } else {
|
|
3181
|
+ for _, i := range insutypes {
|
|
3182
|
+ if i.Insutype == "390" {
|
|
3183
|
+ is390 = 1
|
|
3184
|
+ }
|
|
3185
|
+
|
|
3186
|
+ if i.Insutype == "310" {
|
|
3187
|
+ is310 = 1
|
|
3188
|
+ }
|
|
3189
|
+ }
|
|
3190
|
+ }
|
|
3191
|
+ if is390 == 1 {
|
|
3192
|
+ insutype = "390"
|
|
3193
|
+ }
|
|
3194
|
+
|
|
3195
|
+ if is310 == 1 {
|
|
3196
|
+ insutype = "310"
|
|
3197
|
+ }
|
|
3198
|
+
|
|
3199
|
+ if len(insutypes) == 0 {
|
|
3200
|
+ insutype = "310"
|
|
3201
|
+ }
|
|
3202
|
+
|
|
3203
|
+ c.ServeSuccessJSON(map[string]interface{}{
|
|
3204
|
+ "patient": patient,
|
|
3205
|
+ "number": token,
|
|
3206
|
+ "insutype": insutype,
|
2749
|
3207
|
})
|
2750
|
3208
|
}
|
2751
|
3209
|
} else {
|
|
@@ -3263,8 +3721,8 @@ func (c *HisApiController) GetSettleList() {
|
3263
|
3721
|
HiType: order.Insutype,
|
3264
|
3722
|
Insuplc: miConfig.InsuplcAdmdvs,
|
3265
|
3723
|
MaindiagFlag: "1",
|
3266
|
|
- BillCode: last_order.FaPiaoCode,
|
3267
|
|
- BillNo: zero,
|
|
3724
|
+ BillCode: order.SetlId,
|
|
3725
|
+ BillNo: order.SetlId,
|
3268
|
3726
|
BizSn: order.Number,
|
3269
|
3727
|
PsnSelfPay: order.PsnPartAmt,
|
3270
|
3728
|
PsnOwnPay: order.PsnPartAmt,
|
|
@@ -3299,7 +3757,7 @@ func (c *HisApiController) GetSettleList() {
|
3299
|
3757
|
var tempOpspdiseinfo2 service.OpspdiseinfoStruct
|
3300
|
3758
|
var tempOpspdiseinfos []service.OpspdiseinfoStruct
|
3301
|
3759
|
|
3302
|
|
- diagnosis_ids := strings.Split(order.Diagnosis, ",")
|
|
3760
|
+ diagnosis_ids := strings.Split(his.Diagnosis, ",")
|
3303
|
3761
|
var config []*models.HisXtDiagnoseConfig
|
3304
|
3762
|
for _, item := range diagnosis_ids {
|
3305
|
3763
|
id, _ := strconv.ParseInt(item, 10, 64)
|
|
@@ -3743,21 +4201,73 @@ func (c *HisApiController) GetSettleList() {
|
3743
|
4201
|
c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
3744
|
4202
|
return
|
3745
|
4203
|
}
|
3746
|
|
-
|
3747
|
|
- respJSON = respJSON["data"].(map[string]interface{})["request_log"].(map[string]interface{})
|
3748
|
|
- userJSONBytes, _ := json.Marshal(respJSON)
|
3749
|
|
- fmt.Println("log")
|
3750
|
|
- fmt.Println(string(userJSONBytes))
|
3751
|
|
- if err := json.Unmarshal(userJSONBytes, &resOther); err != nil {
|
|
4204
|
+
|
|
4205
|
+ respJSON = respJSON["data"].(map[string]interface{})["request_log"].(map[string]interface{})
|
|
4206
|
+ userJSONBytes, _ := json.Marshal(respJSON)
|
|
4207
|
+ fmt.Println("log")
|
|
4208
|
+ fmt.Println(string(userJSONBytes))
|
|
4209
|
+ if err := json.Unmarshal(userJSONBytes, &resOther); err != nil {
|
|
4210
|
+ utils.ErrorLog("解析失败:%v", err)
|
|
4211
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
4212
|
+ return
|
|
4213
|
+ }
|
|
4214
|
+ res.InfRefmsgid = resOther.InfRefmsgid
|
|
4215
|
+ res.Output = resOther.Output
|
|
4216
|
+ res.ErrMsg = resOther.ErrMsg
|
|
4217
|
+ infocode, _ := strconv.ParseInt(resOther.Infcode, 10, 64)
|
|
4218
|
+ res.Infcode = infocode
|
|
4219
|
+ } else if miConfig.MdtrtareaAdmvs == "360399" {
|
|
4220
|
+
|
|
4221
|
+ var pp models.PublicParams
|
|
4222
|
+ pp.InsuplcAdmdvs = miConfig.InsuplcAdmdvs
|
|
4223
|
+ pp.MdtrtareaAdmvs = miConfig.MdtrtareaAdmvs
|
|
4224
|
+ pp.FixmedinsName = miConfig.OrgName
|
|
4225
|
+ pp.FixmedinsCode = miConfig.Code
|
|
4226
|
+ pp.RequestUrl = miConfig.Url
|
|
4227
|
+ pp.Cainfo = miConfig.Cainfo
|
|
4228
|
+ pp.SecretKey = miConfig.SecretKey
|
|
4229
|
+ pp.AccessKey = miConfig.AccessKey
|
|
4230
|
+ pp.OpterName = curRoles.UserName
|
|
4231
|
+ result, _ := service.Jxyb4101(struct4101, pp)
|
|
4232
|
+ var dat map[string]interface{}
|
|
4233
|
+ if err := json.Unmarshal([]byte(result), &dat); err == nil {
|
|
4234
|
+ fmt.Println(dat)
|
|
4235
|
+ } else {
|
|
4236
|
+ fmt.Println(err)
|
|
4237
|
+ }
|
|
4238
|
+ userJSONBytes, _ := json.Marshal(dat)
|
|
4239
|
+ if err := json.Unmarshal(userJSONBytes, &res); err != nil {
|
|
4240
|
+ utils.ErrorLog("解析失败:%v", err)
|
|
4241
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
4242
|
+ return
|
|
4243
|
+ }
|
|
4244
|
+
|
|
4245
|
+ } else if miConfig.MdtrtareaAdmvs == "430800" {
|
|
4246
|
+
|
|
4247
|
+ var pp models.PublicParams
|
|
4248
|
+ pp.InsuplcAdmdvs = miConfig.InsuplcAdmdvs
|
|
4249
|
+ pp.MdtrtareaAdmvs = miConfig.MdtrtareaAdmvs
|
|
4250
|
+ pp.FixmedinsName = miConfig.OrgName
|
|
4251
|
+ pp.FixmedinsCode = miConfig.Code
|
|
4252
|
+ pp.RequestUrl = miConfig.Url
|
|
4253
|
+ pp.Cainfo = miConfig.Cainfo
|
|
4254
|
+ pp.SecretKey = miConfig.SecretKey
|
|
4255
|
+ pp.AccessKey = miConfig.AccessKey
|
|
4256
|
+ pp.OpterName = curRoles.UserName
|
|
4257
|
+ result, _ := service.Hnyb4101(struct4101, pp)
|
|
4258
|
+ var dat map[string]interface{}
|
|
4259
|
+ if err := json.Unmarshal([]byte(result), &dat); err == nil {
|
|
4260
|
+ fmt.Println(dat)
|
|
4261
|
+ } else {
|
|
4262
|
+ fmt.Println(err)
|
|
4263
|
+ }
|
|
4264
|
+ userJSONBytes, _ := json.Marshal(dat)
|
|
4265
|
+ if err := json.Unmarshal(userJSONBytes, &res); err != nil {
|
3752
|
4266
|
utils.ErrorLog("解析失败:%v", err)
|
3753
|
4267
|
c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
3754
|
4268
|
return
|
3755
|
4269
|
}
|
3756
|
|
- res.InfRefmsgid = resOther.InfRefmsgid
|
3757
|
|
- res.Output = resOther.Output
|
3758
|
|
- res.ErrMsg = resOther.ErrMsg
|
3759
|
|
- infocode, _ := strconv.ParseInt(resOther.Infcode, 10, 64)
|
3760
|
|
- res.Infcode = infocode
|
|
4270
|
+
|
3761
|
4271
|
} else {
|
3762
|
4272
|
|
3763
|
4273
|
result := service.Gdyb4101(struct4101, miConfig.SecretKey, miConfig.OrgName, curRoles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.UserOrgId)
|
|
@@ -3860,8 +4370,8 @@ func (c *HisApiController) GetSettleListHospital() {
|
3860
|
4370
|
HiType: order.Insutype,
|
3861
|
4371
|
Insuplc: miConfig.InsuplcAdmdvs,
|
3862
|
4372
|
MaindiagFlag: "1",
|
3863
|
|
- BillCode: order.FaPiaoNumber,
|
3864
|
|
- BillNo: order.FaPiaoNumber,
|
|
4373
|
+ BillCode: order.SetlId,
|
|
4374
|
+ BillNo: order.SetlId,
|
3865
|
4375
|
BizSn: order.Number,
|
3866
|
4376
|
PsnSelfPay: order.PsnPartAmt,
|
3867
|
4377
|
PsnOwnPay: order.PsnPartAmt,
|
|
@@ -6492,6 +7002,47 @@ func (c *HisApiController) GetRegisterInfo() {
|
6492
|
7002
|
|
6493
|
7003
|
}
|
6494
|
7004
|
|
|
7005
|
+ } else if miConfig.MdtrtareaAdmvs == "430800" {
|
|
7006
|
+ if id_card_type == 1 {
|
|
7007
|
+ psn_info, _ := service.GetPsnByPatientId(id)
|
|
7008
|
+ PsnNo = psn_info.PsnNo
|
|
7009
|
+ PsnCertType = psn_info.PsnCertType
|
|
7010
|
+ Certno = psn_info.Certno
|
|
7011
|
+ PsnName = psn_info.PsnName
|
|
7012
|
+ Gend = psn_info.Gend
|
|
7013
|
+ Naty = psn_info.Naty
|
|
7014
|
+ Brdy = psn_info.Brdy
|
|
7015
|
+ Age = psn_info.Age
|
|
7016
|
+ infoStr = psn_info.Insuinfo
|
|
7017
|
+ idetinfoStr = psn_info.Idetinfo
|
|
7018
|
+ infocode = 0
|
|
7019
|
+ verify_number = psn_info.VerifyNumber
|
|
7020
|
+
|
|
7021
|
+ } else if id_card_type == 2 {
|
|
7022
|
+ result, requestLog := service.Hnyb1101(patient.IdCardNo, miConfig.OrgName, roles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, id_card_type, "", "1", miConfig.Url, miConfig.AccessKey, "")
|
|
7023
|
+ saveLog(result, requestLog, "1101", "人员基本信息获取")
|
|
7024
|
+ if err := json.Unmarshal([]byte(result), &res); err != nil {
|
|
7025
|
+ utils.ErrorLog("解析失败:%v", err)
|
|
7026
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
7027
|
+ return
|
|
7028
|
+ }
|
|
7029
|
+
|
|
7030
|
+ PsnNo = res.Output.Baseinfo.PsnNo
|
|
7031
|
+ PsnCertType = res.Output.Baseinfo.PsnCertType
|
|
7032
|
+ Certno = res.Output.Baseinfo.Certno
|
|
7033
|
+ PsnName = res.Output.Baseinfo.PsnName
|
|
7034
|
+ Gend = res.Output.Baseinfo.Gend
|
|
7035
|
+ Naty = res.Output.Baseinfo.Naty
|
|
7036
|
+ Brdy = res.Output.Baseinfo.Brdy
|
|
7037
|
+ Age = res.Output.Baseinfo.Age
|
|
7038
|
+ Iinfos, _ := json.Marshal(res.Output.Iinfo)
|
|
7039
|
+ Idetinfos, _ := json.Marshal(res.Output.Idetinfo)
|
|
7040
|
+ infoStr = string(Iinfos)
|
|
7041
|
+ idetinfoStr = string(Idetinfos)
|
|
7042
|
+ infocode = res.Infcode
|
|
7043
|
+
|
|
7044
|
+ }
|
|
7045
|
+
|
6495
|
7046
|
} else {
|
6496
|
7047
|
|
6497
|
7048
|
var result string
|
|
@@ -6865,16 +7416,48 @@ func (c *HisApiController) GetRegisterInfo() {
|
6865
|
7416
|
var result string
|
6866
|
7417
|
var requestLog string
|
6867
|
7418
|
if id_card_type == 1 {
|
6868
|
|
- result, requestLog = service.Jxyb2201(PsnNo, insutype, IdCardNo, miConfig.OrgName, roles.UserName, ipt_otp_no, department.Name, miConfig.Code, department.Number, doctor_info.DoctorNumber, miConfig.MdtrtareaAdmvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, id_card_type, doctor_info.UserName, miConfig.Url, miConfig.AccessKey, psn_info.VerifyNumber, "")
|
|
7419
|
+ bas := strings.Split(psn_info.CardInfo, "|")
|
|
7420
|
+ basNumber := bas[2]
|
|
7421
|
+ card_sn := bas[3]
|
|
7422
|
+ result, requestLog = service.Jxyb2201(PsnNo, insutype, IdCardNo, miConfig.OrgName, roles.UserName, ipt_otp_no, department.Name, miConfig.Code, department.Number, doctor_info.DoctorNumber, miConfig.MdtrtareaAdmvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, id_card_type, doctor_info.UserName, miConfig.Url, miConfig.AccessKey, basNumber, "", card_sn)
|
|
7423
|
+ saveLog(result, requestLog, "2201A", "挂号")
|
|
7424
|
+
|
|
7425
|
+ } else if id_card_type == 2 {
|
|
7426
|
+ result, requestLog = service.Jxyb2201(PsnNo, insutype, IdCardNo, miConfig.OrgName, roles.UserName, ipt_otp_no, department.Name, miConfig.Code, department.Number, doctor_info.DoctorNumber, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, id_card_type, doctor_info.UserName, miConfig.Url, miConfig.AccessKey, IdCardNo, "", "")
|
|
7427
|
+ saveLog(result, requestLog, "2201A", "挂号")
|
|
7428
|
+
|
|
7429
|
+ } else {
|
|
7430
|
+
|
|
7431
|
+ result, requestLog = service.Jxyb2201(PsnNo, insutype, IdCardNo, miConfig.OrgName, roles.UserName, ipt_otp_no, department.Name, miConfig.Code, department.Number, doctor_info.DoctorNumber, insuplc_admdvs_temp, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, id_card_type, doctor_info.UserName, miConfig.Url, miConfig.AccessKey, psn_info.VerifyNumber, "", "")
|
|
7432
|
+ saveLog(result, requestLog, "2201A", "挂号")
|
|
7433
|
+
|
|
7434
|
+ }
|
|
7435
|
+
|
|
7436
|
+ if err := json.Unmarshal([]byte(result), &resThree); err != nil {
|
|
7437
|
+ utils.ErrorLog("解析失败:%v", err)
|
|
7438
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
7439
|
+ return
|
|
7440
|
+ }
|
|
7441
|
+ infocode = resThree.Infcode
|
|
7442
|
+ } else if miConfig.MdtrtareaAdmvs == "430800" { //江西萍乡
|
|
7443
|
+
|
|
7444
|
+ psn_info, _ := service.GetPsnByPatientId(id)
|
|
7445
|
+ var result string
|
|
7446
|
+ var requestLog string
|
|
7447
|
+ if id_card_type == 1 {
|
|
7448
|
+ bas := strings.Split(psn_info.CardInfo, "|")
|
|
7449
|
+ basNumber := bas[2]
|
|
7450
|
+ card_sn := bas[3]
|
|
7451
|
+ result, requestLog = service.Hnyb2201(PsnNo, insutype, IdCardNo, miConfig.OrgName, roles.UserName, ipt_otp_no, department.Name, miConfig.Code, department.Number, doctor_info.DoctorNumber, miConfig.MdtrtareaAdmvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, id_card_type, doctor_info.UserName, miConfig.Url, miConfig.AccessKey, basNumber, "", card_sn)
|
6869
|
7452
|
saveLog(result, requestLog, "2201A", "挂号")
|
6870
|
7453
|
|
6871
|
7454
|
} else if id_card_type == 2 {
|
6872
|
|
- result, requestLog = service.Jxyb2201(PsnNo, insutype, IdCardNo, miConfig.OrgName, roles.UserName, ipt_otp_no, department.Name, miConfig.Code, department.Number, doctor_info.DoctorNumber, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, id_card_type, doctor_info.UserName, miConfig.Url, miConfig.AccessKey, IdCardNo, "")
|
|
7455
|
+ result, requestLog = service.Hnyb2201(PsnNo, insutype, IdCardNo, miConfig.OrgName, roles.UserName, ipt_otp_no, department.Name, miConfig.Code, department.Number, doctor_info.DoctorNumber, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, id_card_type, doctor_info.UserName, miConfig.Url, miConfig.AccessKey, IdCardNo, "", "")
|
6873
|
7456
|
saveLog(result, requestLog, "2201A", "挂号")
|
6874
|
7457
|
|
6875
|
7458
|
} else {
|
6876
|
7459
|
|
6877
|
|
- result, requestLog = service.Jxyb2201(PsnNo, insutype, IdCardNo, miConfig.OrgName, roles.UserName, ipt_otp_no, department.Name, miConfig.Code, department.Number, doctor_info.DoctorNumber, insuplc_admdvs_temp, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, id_card_type, doctor_info.UserName, miConfig.Url, miConfig.AccessKey, psn_info.VerifyNumber, "")
|
|
7460
|
+ result, requestLog = service.Hnyb2201(PsnNo, insutype, IdCardNo, miConfig.OrgName, roles.UserName, ipt_otp_no, department.Name, miConfig.Code, department.Number, doctor_info.DoctorNumber, insuplc_admdvs_temp, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, id_card_type, doctor_info.UserName, miConfig.Url, miConfig.AccessKey, psn_info.VerifyNumber, "", "")
|
6878
|
7461
|
saveLog(result, requestLog, "2201A", "挂号")
|
6879
|
7462
|
|
6880
|
7463
|
}
|
|
@@ -8446,6 +9029,32 @@ func (c *HisApiController) GetUploadInfo() {
|
8446
|
9029
|
return
|
8447
|
9030
|
}
|
8448
|
9031
|
|
|
9032
|
+ } else if miConfig.MdtrtareaAdmvs == "430800" {
|
|
9033
|
+ psn_info, _ := service.GetPsnByPatientId(his.PatientId)
|
|
9034
|
+ var cert_no string
|
|
9035
|
+ if his.IdCardType == 1 {
|
|
9036
|
+ cert_no = strings.Split(psn_info.CardInfo, "|")[0]
|
|
9037
|
+ } else if his.IdCardType == 2 {
|
|
9038
|
+ cert_no = his.IdCardNo
|
|
9039
|
+ } else {
|
|
9040
|
+ cert_no = psn_info.VerifyNumber
|
|
9041
|
+
|
|
9042
|
+ }
|
|
9043
|
+ result2, src_resquest := service.Hnyb2207(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.IdCardType, acct_used_flag, miConfig.Url, miConfig.AccessKey, cert_no, "")
|
|
9044
|
+ var dat map[string]interface{}
|
|
9045
|
+ if err := json.Unmarshal([]byte(result2), &dat); err == nil {
|
|
9046
|
+ fmt.Println(dat)
|
|
9047
|
+ } else {
|
|
9048
|
+ fmt.Println(err)
|
|
9049
|
+ }
|
|
9050
|
+ saveLog(result2, src_resquest, "2207", "结算")
|
|
9051
|
+ userJSONBytes, _ := json.Marshal(dat)
|
|
9052
|
+ if err := json.Unmarshal(userJSONBytes, &res); err != nil {
|
|
9053
|
+ utils.ErrorLog("解析失败:%v", err)
|
|
9054
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
9055
|
+ return
|
|
9056
|
+ }
|
|
9057
|
+
|
8449
|
9058
|
} else {
|
8450
|
9059
|
|
8451
|
9060
|
var src_resquest string
|
|
@@ -9367,6 +9976,25 @@ func (c *HisApiController) GetPreUploadInfo() {
|
9367
|
9976
|
return
|
9368
|
9977
|
}
|
9369
|
9978
|
|
|
9979
|
+ } else if miConfig.MdtrtareaAdmvs == "430800" {
|
|
9980
|
+ var result string
|
|
9981
|
+ var requestLog string
|
|
9982
|
+ result, requestLog = service.Hnyb2203A(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, miConfig.Url, miConfig.AccessKey, "")
|
|
9983
|
+
|
|
9984
|
+ saveLog(result, requestLog, "2203", "上传就诊信息")
|
|
9985
|
+ var respJSON2 map[string]interface{}
|
|
9986
|
+ if err := json.Unmarshal([]byte(string(result)), &respJSON2); err != nil {
|
|
9987
|
+ utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
|
|
9988
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
9989
|
+ return
|
|
9990
|
+ }
|
|
9991
|
+ userJSONBytes2, _ := json.Marshal(respJSON2)
|
|
9992
|
+ if err := json.Unmarshal(userJSONBytes2, &res2); err != nil {
|
|
9993
|
+ utils.ErrorLog("解析失败:%v", err)
|
|
9994
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
9995
|
+ return
|
|
9996
|
+ }
|
|
9997
|
+
|
9370
|
9998
|
} else {
|
9371
|
9999
|
var result string
|
9372
|
10000
|
var requestLog string
|
|
@@ -9640,6 +10268,24 @@ func (c *HisApiController) GetPreUploadInfo() {
|
9640
|
10268
|
return
|
9641
|
10269
|
}
|
9642
|
10270
|
|
|
10271
|
+ } else if miConfig.MdtrtareaAdmvs == "430800" {
|
|
10272
|
+ result, request_log := service.Hnyb2204(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), sickConfig.CountryCode, miConfig.Url, miConfig.AccessKey, doctor_info.UserName, "", "")
|
|
10273
|
+ var dat map[string]interface{}
|
|
10274
|
+ if err := json.Unmarshal([]byte(result), &dat); err == nil {
|
|
10275
|
+ fmt.Println(dat)
|
|
10276
|
+ } else {
|
|
10277
|
+ fmt.Println(err)
|
|
10278
|
+ }
|
|
10279
|
+ saveLog(result, request_log, "2204", "上传费用明细")
|
|
10280
|
+
|
|
10281
|
+ userJSONBytes, _ := json.Marshal(dat)
|
|
10282
|
+
|
|
10283
|
+ if err := json.Unmarshal(userJSONBytes, &res); err != nil {
|
|
10284
|
+ utils.ErrorLog("解析失败:%v", err)
|
|
10285
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
10286
|
+ return
|
|
10287
|
+ }
|
|
10288
|
+
|
9643
|
10289
|
} else {
|
9644
|
10290
|
|
9645
|
10291
|
if miConfig.Code == "H15049901371" {
|
|
@@ -10045,8 +10691,50 @@ func (c *HisApiController) GetPreUploadInfo() {
|
10045
|
10691
|
if his.IdCardType == 2 {
|
10046
|
10692
|
result, request_log = service.Jxyb2206(his.PsnNo, his.Number, chrg_bchno, his.IdCardNo, 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.AccessKey, his.IdCardNo, "")
|
10047
|
10693
|
|
|
10694
|
+ } else if his.IdCardType == 1 {
|
|
10695
|
+ psn_info, _ := service.GetPsnByPatientId(his.PatientId)
|
|
10696
|
+ bas := strings.Split(psn_info.CardInfo, "|")
|
|
10697
|
+ basNumber := bas[2]
|
|
10698
|
+ card_sn := bas[3]
|
|
10699
|
+ result, request_log = service.Jxyb2206Two(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.AccessKey, basNumber, "", card_sn)
|
|
10700
|
+
|
|
10701
|
+ } else {
|
|
10702
|
+ psn_info, _ := service.GetPsnByPatientId(his.PatientId)
|
|
10703
|
+
|
|
10704
|
+ result, request_log = service.Jxyb2206(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.AccessKey, psn_info.VerifyNumber, "")
|
|
10705
|
+
|
|
10706
|
+ }
|
|
10707
|
+ var dat map[string]interface{}
|
|
10708
|
+ if err := json.Unmarshal([]byte(result), &dat); err == nil {
|
|
10709
|
+ fmt.Println(dat)
|
|
10710
|
+ } else {
|
|
10711
|
+ fmt.Println(err)
|
|
10712
|
+ }
|
|
10713
|
+ saveLog(result, request_log, "2206", "预结算")
|
|
10714
|
+
|
|
10715
|
+ userJSONBytes, _ := json.Marshal(dat)
|
|
10716
|
+ if err := json.Unmarshal(userJSONBytes, &res); err != nil {
|
|
10717
|
+ utils.ErrorLog("解析失败:%v", err)
|
|
10718
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
10719
|
+ return
|
|
10720
|
+ }
|
|
10721
|
+
|
|
10722
|
+ } else if miConfig.MdtrtareaAdmvs == "430800" {
|
|
10723
|
+ var result string
|
|
10724
|
+ var request_log string
|
|
10725
|
+ if his.IdCardType == 2 {
|
|
10726
|
+ result, request_log = service.Hnyb2206(his.PsnNo, his.Number, chrg_bchno, his.IdCardNo, 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.AccessKey, his.IdCardNo, "")
|
|
10727
|
+
|
|
10728
|
+ } else if his.IdCardType == 1 {
|
|
10729
|
+ psn_info, _ := service.GetPsnByPatientId(his.PatientId)
|
|
10730
|
+ bas := strings.Split(psn_info.CardInfo, "|")
|
|
10731
|
+ basNumber := bas[2]
|
|
10732
|
+ card_sn := bas[3]
|
|
10733
|
+ result, request_log = service.Jxyb2206Two(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.AccessKey, basNumber, "", card_sn)
|
|
10734
|
+
|
10048
|
10735
|
} else {
|
10049
|
10736
|
psn_info, _ := service.GetPsnByPatientId(his.PatientId)
|
|
10737
|
+
|
10050
|
10738
|
result, request_log = service.Jxyb2206(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.AccessKey, psn_info.VerifyNumber, "")
|
10051
|
10739
|
|
10052
|
10740
|
}
|
|
@@ -10407,6 +11095,24 @@ func (c *HisApiController) Refund() {
|
10407
|
11095
|
return
|
10408
|
11096
|
}
|
10409
|
11097
|
|
|
11098
|
+ } else if miConfig.MdtrtareaAdmvs == "430800" {
|
|
11099
|
+ result, src_resquest = service.Hnyb2208(order.PsnNo, order.MdtrtId, order.SetlId, miConfig.OrgName, roles.UserName, miConfig.SecretKey, miConfig.Code, his.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.Url, miConfig.AccessKey, "")
|
|
11100
|
+ var dat map[string]interface{}
|
|
11101
|
+ if err := json.Unmarshal([]byte(result), &dat); err == nil {
|
|
11102
|
+ fmt.Println(dat)
|
|
11103
|
+ } else {
|
|
11104
|
+ fmt.Println(err)
|
|
11105
|
+ }
|
|
11106
|
+ saveLog(result, src_resquest, "2208", "退费")
|
|
11107
|
+
|
|
11108
|
+ userJSONBytes, _ := json.Marshal(dat)
|
|
11109
|
+
|
|
11110
|
+ if err := json.Unmarshal(userJSONBytes, &res); err != nil {
|
|
11111
|
+ utils.ErrorLog("解析失败:%v", err)
|
|
11112
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
11113
|
+ return
|
|
11114
|
+ }
|
|
11115
|
+
|
10410
|
11116
|
} else {
|
10411
|
11117
|
|
10412
|
11118
|
if miConfig.Code == "H15049901371" {
|
|
@@ -10569,6 +11275,22 @@ func (c *HisApiController) Refund() {
|
10569
|
11275
|
fmt.Println(err)
|
10570
|
11276
|
}
|
10571
|
11277
|
|
|
11278
|
+ saveLog(result2, src_request, "2205", "撤销明细")
|
|
11279
|
+ userJSONBytes, _ := json.Marshal(dat)
|
|
11280
|
+ if err := json.Unmarshal(userJSONBytes, &res2); err != nil {
|
|
11281
|
+ utils.ErrorLog("解析失败:%v", err)
|
|
11282
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
11283
|
+ return
|
|
11284
|
+ }
|
|
11285
|
+ } else if miConfig.MdtrtareaAdmvs == "430800" {
|
|
11286
|
+ result2, src_request := service.Hnyb2205(order.PsnNo, order.MdtrtId, order.Number, miConfig.OrgName, roles.UserName, his.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, miConfig.Code, miConfig.Url, miConfig.AccessKey, "")
|
|
11287
|
+ var dat map[string]interface{}
|
|
11288
|
+ if err := json.Unmarshal([]byte(result2), &dat); err == nil {
|
|
11289
|
+ fmt.Println(dat)
|
|
11290
|
+ } else {
|
|
11291
|
+ fmt.Println(err)
|
|
11292
|
+ }
|
|
11293
|
+
|
10572
|
11294
|
saveLog(result2, src_request, "2205", "撤销明细")
|
10573
|
11295
|
userJSONBytes, _ := json.Marshal(dat)
|
10574
|
11296
|
if err := json.Unmarshal(userJSONBytes, &res2); err != nil {
|
|
@@ -10810,6 +11532,22 @@ func (c *HisApiController) RefundNumber() {
|
10810
|
11532
|
return
|
10811
|
11533
|
}
|
10812
|
11534
|
|
|
11535
|
+ } else if miConfig.MdtrtareaAdmvs == "430800" {
|
|
11536
|
+ result, request := service.Hnyb2202(his.PsnNo, his.Number, his.IptOtpNo, miConfig.OrgName, roles.UserName, his.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, miConfig.Code, miConfig.Url, miConfig.AccessKey, "")
|
|
11537
|
+ var dat map[string]interface{}
|
|
11538
|
+ if err := json.Unmarshal([]byte(result), &dat); err == nil {
|
|
11539
|
+ fmt.Println(dat)
|
|
11540
|
+ } else {
|
|
11541
|
+ fmt.Println(err)
|
|
11542
|
+ }
|
|
11543
|
+ saveLog(result, request, "2202", "退号")
|
|
11544
|
+ userJSONBytes, _ := json.Marshal(dat)
|
|
11545
|
+ if err := json.Unmarshal(userJSONBytes, &res2); err != nil {
|
|
11546
|
+ utils.ErrorLog("解析失败:%v", err)
|
|
11547
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
11548
|
+ return
|
|
11549
|
+ }
|
|
11550
|
+
|
10813
|
11551
|
} else {
|
10814
|
11552
|
var api3 string
|
10815
|
11553
|
|
|
@@ -11112,6 +11850,40 @@ func (c *HisApiController) RefundDetail() {
|
11112
|
11850
|
})
|
11113
|
11851
|
}
|
11114
|
11852
|
|
|
11853
|
+ } else if miConfig.MdtrtareaAdmvs == "430800" {
|
|
11854
|
+ result2, src_request := service.Hnyb2205(his.PsnNo, his.Number, order.Number, miConfig.OrgName, roles.UserName, his.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, miConfig.Code, miConfig.Url, miConfig.AccessKey, "")
|
|
11855
|
+ var dat map[string]interface{}
|
|
11856
|
+ if err := json.Unmarshal([]byte(result2), &dat); err == nil {
|
|
11857
|
+ fmt.Println(dat)
|
|
11858
|
+ } else {
|
|
11859
|
+ fmt.Println(err)
|
|
11860
|
+ }
|
|
11861
|
+
|
|
11862
|
+ saveLog(result2, src_request, "2205", "撤销明细")
|
|
11863
|
+ userJSONBytes, _ := json.Marshal(dat)
|
|
11864
|
+ if err := json.Unmarshal(userJSONBytes, &res2); err != nil {
|
|
11865
|
+ utils.ErrorLog("解析失败:%v", err)
|
|
11866
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
11867
|
+ return
|
|
11868
|
+ }
|
|
11869
|
+ if res2.Infcode == 0 {
|
|
11870
|
+ err := service.UpdataOrderStatus(order_id, number, adminUser.CurrentOrgId, "", "")
|
|
11871
|
+ if err == nil {
|
|
11872
|
+ c.ServeSuccessJSON(map[string]interface{}{
|
|
11873
|
+ "msg": "撤销明细成功",
|
|
11874
|
+ })
|
|
11875
|
+ return
|
|
11876
|
+ } else {
|
|
11877
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
11878
|
+ return
|
|
11879
|
+ }
|
|
11880
|
+ } else {
|
|
11881
|
+ c.ServeSuccessJSON(map[string]interface{}{
|
|
11882
|
+ "code": -10,
|
|
11883
|
+ "msg": res2.ErrMsg,
|
|
11884
|
+ })
|
|
11885
|
+ }
|
|
11886
|
+
|
11115
|
11887
|
} else {
|
11116
|
11888
|
api2 := "http://127.0.0.1:9532/" + "gdyb/six?psn_no=" + his.PsnNo +
|
11117
|
11889
|
"&mdtrt_id=" + his.Number + "&chrg_bchno=" + order.Number + "&doctor=" + roles.UserName + "&org_name=" + miConfig.OrgName + "&fixmedins_code=" + miConfig.Code +
|
|
@@ -12109,6 +12881,21 @@ func (c *HisApiController) GetSettleAccounts() {
|
12109
|
12881
|
c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
12110
|
12882
|
return
|
12111
|
12883
|
}
|
|
12884
|
+ } else if miConfig.MdtrtareaAdmvs == "430800" {
|
|
12885
|
+ result, requestLog := service.Hnyb5203(baseParams, businessParams)
|
|
12886
|
+ saveLog(result, requestLog, "5203", "结算单")
|
|
12887
|
+ var dat map[string]interface{}
|
|
12888
|
+ if err := json.Unmarshal([]byte(result), &dat); err == nil {
|
|
12889
|
+ fmt.Println(dat)
|
|
12890
|
+ } else {
|
|
12891
|
+ fmt.Println(err)
|
|
12892
|
+ }
|
|
12893
|
+ userJSONBytes, _ := json.Marshal(dat)
|
|
12894
|
+ if err := json.Unmarshal(userJSONBytes, &res); err != nil {
|
|
12895
|
+ utils.ErrorLog("解析失败:%v", err)
|
|
12896
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
12897
|
+ return
|
|
12898
|
+ }
|
12112
|
12899
|
} else if miConfig.MdtrtareaAdmvs == "150499" {
|
12113
|
12900
|
|
12114
|
12901
|
api := "http://172.16.13.254:9532/" + "nmyb/5203?psn_no=" + businessParams.PsnNo + "&mdtrt_id=" + businessParams.MdtrtId + "&setl_id=" + businessParams.SetlId +
|