|
@@ -273,8 +273,90 @@ func ZHHisManagerApiRegistRouters() {
|
273
|
273
|
beego.Router("/zh/api/outhopitaluncheck/get", &ZHHisApiController{}, "get:GetZHOutHospitalUnCheck")
|
274
|
274
|
beego.Router("/zh/api/refund", &ZHHisApiController{}, "get:ZHRefund")
|
275
|
275
|
beego.Router("/zh/api/refunddetail", &ZHHisApiController{}, "get:ZHRefundDetail")
|
|
276
|
+ beego.Router("/zh/api/patient/info", &ZHHisApiController{}, "get:ƒ")
|
276
|
277
|
|
277
|
278
|
}
|
|
279
|
+func (c *ZHHisApiController) GetZHPatientInfo() {
|
|
280
|
+ id_card_no := c.GetString("id_card_no")
|
|
281
|
+ admin_user_id, _ := c.GetInt64("admin_user_id")
|
|
282
|
+
|
|
283
|
+ patient, _ := service.GetPatientByIDCard(id_card_no, c.GetAdminUserInfo().CurrentOrgId)
|
|
284
|
+
|
|
285
|
+ if patient.ID == 0 {
|
|
286
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodePatientNoExist)
|
|
287
|
+ return
|
|
288
|
+ }
|
|
289
|
+
|
|
290
|
+ role, _ := service.GetAdminUserInfoByID(c.GetAdminUserInfo().CurrentOrgId, admin_user_id)
|
|
291
|
+ miConfig, _ := service.FindMedicalInsuranceInfo(c.GetAdminUserInfo().CurrentOrgId)
|
|
292
|
+ config, _ := service.GetMedicalInsuranceConfig(c.GetAdminUserInfo().CurrentOrgId)
|
|
293
|
+ if config.IsOpen == 1 {
|
|
294
|
+
|
|
295
|
+ result := service.Gdyb1101A(id_card_no, miConfig.OrgName, role.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey)
|
|
296
|
+ var dat map[string]interface{}
|
|
297
|
+ if err := json.Unmarshal([]byte(result), &dat); err == nil {
|
|
298
|
+ fmt.Println(dat)
|
|
299
|
+ } else {
|
|
300
|
+ fmt.Println(err)
|
|
301
|
+ }
|
|
302
|
+
|
|
303
|
+ userJSONBytes, _ := json.Marshal(dat)
|
|
304
|
+ var res ResultTwo
|
|
305
|
+ if err := json.Unmarshal(userJSONBytes, &res); err != nil {
|
|
306
|
+ utils.ErrorLog("解析失败:%v", err)
|
|
307
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
308
|
+ return
|
|
309
|
+ }
|
|
310
|
+
|
|
311
|
+ var insutypes []string
|
|
312
|
+
|
|
313
|
+ var insutype string
|
|
314
|
+ var is390 int = 0
|
|
315
|
+ var is310 int = 0
|
|
316
|
+ for _, item := range res.Output.Iinfo {
|
|
317
|
+ if (item.Insutype == "390" && item.PsnInsuStas == "1") || (item.Insutype == "310" && item.PsnInsuStas == "1") {
|
|
318
|
+ insutypes = append(insutypes, item.Insutype)
|
|
319
|
+ }
|
|
320
|
+ }
|
|
321
|
+ if len(insutypes) == 1 {
|
|
322
|
+ insutype = insutypes[0]
|
|
323
|
+ } else {
|
|
324
|
+ for _, i := range insutypes {
|
|
325
|
+ if i == "390" {
|
|
326
|
+ is390 = 1
|
|
327
|
+ }
|
|
328
|
+
|
|
329
|
+ if i == "310" {
|
|
330
|
+ is310 = 1
|
|
331
|
+ }
|
|
332
|
+ }
|
|
333
|
+ }
|
|
334
|
+ if is390 == 1 {
|
|
335
|
+ insutype = "390"
|
|
336
|
+ }
|
|
337
|
+ if is310 == 1 {
|
|
338
|
+ insutype = "310"
|
|
339
|
+ }
|
|
340
|
+
|
|
341
|
+ if len(insutypes) == 0 {
|
|
342
|
+ insutype = "310"
|
|
343
|
+ }
|
|
344
|
+
|
|
345
|
+ if res.Infcode != 0 {
|
|
346
|
+ c.ServeSuccessJSON(map[string]interface{}{
|
|
347
|
+ "failed_code": -10,
|
|
348
|
+ "msg": res.ErrMsg,
|
|
349
|
+ })
|
|
350
|
+ } else {
|
|
351
|
+ c.ServeSuccessJSON(map[string]interface{}{
|
|
352
|
+ "failed_code": 0,
|
|
353
|
+ "info": res,
|
|
354
|
+ "insutype": insutype,
|
|
355
|
+ })
|
|
356
|
+ }
|
|
357
|
+
|
|
358
|
+ }
|
|
359
|
+}
|
278
|
360
|
|
279
|
361
|
func (c *ZHHisApiController) GetZHInHospitalCheck() {
|
280
|
362
|
id, _ := c.GetInt64("id")
|
|
@@ -293,6 +375,9 @@ func (c *ZHHisApiController) GetZHInHospitalCheck() {
|
293
|
375
|
start_time := c.GetString("start_time")
|
294
|
376
|
balance_accounts_type, _ := c.GetInt64("balance_accounts_type")
|
295
|
377
|
|
|
378
|
+ social_type, _ := c.GetInt64("social_type")
|
|
379
|
+ psn_type, _ := c.GetInt64("psn_type")
|
|
380
|
+
|
296
|
381
|
//reg_type, _ := c.GetInt64("p_type")
|
297
|
382
|
med_type, _ := c.GetInt64("med_type")
|
298
|
383
|
diagnosis_ids_arr := strings.Split(diagnosis_ids, "-")
|
|
@@ -346,39 +431,39 @@ func (c *ZHHisApiController) GetZHInHospitalCheck() {
|
346
|
431
|
|
347
|
432
|
if res2.Infcode == 0 {
|
348
|
433
|
|
349
|
|
- var insutypes []string
|
350
|
|
-
|
351
|
|
- var insutype string
|
352
|
|
- var is390 int = 0
|
353
|
|
- var is310 int = 0
|
354
|
|
- for _, item := range res2.Output.Iinfo {
|
355
|
|
- if (item.Insutype == "390" && item.PsnInsuStas == "1") || (item.Insutype == "310" && item.PsnInsuStas == "1") {
|
356
|
|
- insutypes = append(insutypes, item.Insutype)
|
357
|
|
- }
|
358
|
|
- }
|
359
|
|
- if len(insutypes) == 1 {
|
360
|
|
- insutype = insutypes[0]
|
361
|
|
- } else {
|
362
|
|
- for _, i := range insutypes {
|
363
|
|
- if i == "390" {
|
364
|
|
- is390 = 1
|
365
|
|
- }
|
366
|
|
-
|
367
|
|
- if i == "310" {
|
368
|
|
- is310 = 1
|
369
|
|
- }
|
370
|
|
- }
|
371
|
|
- }
|
372
|
|
- if is390 == 1 {
|
373
|
|
- insutype = "390"
|
374
|
|
- }
|
375
|
|
- if is310 == 1 {
|
376
|
|
- insutype = "310"
|
377
|
|
- }
|
378
|
|
-
|
379
|
|
- if len(insutypes) == 0 {
|
380
|
|
- insutype = "310"
|
381
|
|
- }
|
|
434
|
+ //var insutypes []string
|
|
435
|
+ //
|
|
436
|
+ //var insutype string
|
|
437
|
+ //var is390 int = 0
|
|
438
|
+ //var is310 int = 0
|
|
439
|
+ //for _, item := range res2.Output.Iinfo {
|
|
440
|
+ // if (item.Insutype == "390" && item.PsnInsuStas == "1") || (item.Insutype == "310" && item.PsnInsuStas == "1") {
|
|
441
|
+ // insutypes = append(insutypes, item.Insutype)
|
|
442
|
+ // }
|
|
443
|
+ //}
|
|
444
|
+ //if len(insutypes) == 1 {
|
|
445
|
+ // insutype = insutypes[0]
|
|
446
|
+ //} else {
|
|
447
|
+ // for _, i := range insutypes {
|
|
448
|
+ // if i == "390" {
|
|
449
|
+ // is390 = 1
|
|
450
|
+ // }
|
|
451
|
+ //
|
|
452
|
+ // if i == "310" {
|
|
453
|
+ // is310 = 1
|
|
454
|
+ // }
|
|
455
|
+ // }
|
|
456
|
+ //}
|
|
457
|
+ //if is390 == 1 {
|
|
458
|
+ // insutype = "390"
|
|
459
|
+ //}
|
|
460
|
+ //if is310 == 1 {
|
|
461
|
+ // insutype = "310"
|
|
462
|
+ //}
|
|
463
|
+ //
|
|
464
|
+ //if len(insutypes) == 0 {
|
|
465
|
+ // insutype = "310"
|
|
466
|
+ //}
|
382
|
467
|
|
383
|
468
|
timestamp := time.Now().Unix()
|
384
|
469
|
tempTime := time.Unix(timestamp, 0)
|
|
@@ -389,7 +474,7 @@ func (c *ZHHisApiController) GetZHInHospitalCheck() {
|
389
|
474
|
timeFormatOne := tempTime.Format("2006-01-02 15:04:05")
|
390
|
475
|
var struct2401 service.Struct2401
|
391
|
476
|
struct2401.PsnNo = res2.Output.Baseinfo.PsnNo
|
392
|
|
- struct2401.Insutype = insutype
|
|
477
|
+ struct2401.Insutype = strconv.FormatInt(int64(social_type), 10)
|
393
|
478
|
struct2401.MdtrtCertType = "02"
|
394
|
479
|
struct2401.MdtrtCertNo = res2.Output.Baseinfo.Certno
|
395
|
480
|
struct2401.MedType = strconv.FormatInt(int64(med_type), 10)
|
|
@@ -473,7 +558,7 @@ func (c *ZHHisApiController) GetZHInHospitalCheck() {
|
473
|
558
|
Gend: res2.Output.Baseinfo.Gend,
|
474
|
559
|
Naty: res2.Output.Baseinfo.Naty,
|
475
|
560
|
MedType: med_type,
|
476
|
|
- InsutypeType: insutype,
|
|
561
|
+ InsutypeType: strconv.FormatInt(int64(social_type), 10),
|
477
|
562
|
Brdy: res2.Output.Baseinfo.Brdy,
|
478
|
563
|
Iinfo: infoStr,
|
479
|
564
|
Idetinfo: idetinfoStr,
|
|
@@ -489,6 +574,7 @@ func (c *ZHHisApiController) GetZHInHospitalCheck() {
|
489
|
574
|
Certificates: certificates,
|
490
|
575
|
Phone: phone,
|
491
|
576
|
BalanceAccountsType: balance_accounts_type,
|
|
577
|
+ PsnType: psn_type,
|
492
|
578
|
}
|
493
|
579
|
service.CreateHospitalRecord(inHospital)
|
494
|
580
|
c.ServeSuccessJSON(map[string]interface{}{
|
|
@@ -953,9 +1039,10 @@ func (c *ZHHisApiController) GetUploadInfo() {
|
953
|
1039
|
//randNum = rand.Intn(10000) + 1000
|
954
|
1040
|
if subItem.Type == 2 {
|
955
|
1041
|
if len(subItem.HisProject.MedicalCode) > 0 {
|
|
1042
|
+ cnt, _ := strconv.ParseFloat(subItem.Count, 64)
|
956
|
1043
|
cus := &models.NewCustom{
|
957
|
|
- DetItemFeeSumamt: fmt.Sprintf("%.2f", subItem.Price*float64(subItem.Count)),
|
958
|
|
- Cut: fmt.Sprintf("%.2f", float64(subItem.Count)),
|
|
1044
|
+ DetItemFeeSumamt: fmt.Sprintf("%.2f", subItem.Price*cnt),
|
|
1045
|
+ Cut: fmt.Sprintf("%.2f", cnt),
|
959
|
1046
|
FeedetlSn: subItem.FeedetlSn,
|
960
|
1047
|
Price: fmt.Sprintf("%.2f", float64(subItem.Price)),
|
961
|
1048
|
MedListCodg: subItem.HisProject.MedicalCode,
|
|
@@ -965,9 +1052,11 @@ func (c *ZHHisApiController) GetUploadInfo() {
|
965
|
1052
|
}
|
966
|
1053
|
} else if subItem.Type == 3 {
|
967
|
1054
|
if len(subItem.GoodInfo.MedicalInsuranceNumber) > 0 {
|
|
1055
|
+ cnt, _ := strconv.ParseFloat(subItem.Count, 64)
|
|
1056
|
+
|
968
|
1057
|
cus := &models.NewCustom{
|
969
|
|
- DetItemFeeSumamt: fmt.Sprintf("%.2f", subItem.Price*float64(subItem.Count)),
|
970
|
|
- Cut: fmt.Sprintf("%.2f", float64(subItem.Count)),
|
|
1058
|
+ DetItemFeeSumamt: fmt.Sprintf("%.2f", subItem.Price*cnt),
|
|
1059
|
+ Cut: fmt.Sprintf("%.2f", cnt),
|
971
|
1060
|
FeedetlSn: subItem.FeedetlSn,
|
972
|
1061
|
Price: fmt.Sprintf("%.2f", float64(subItem.Price)),
|
973
|
1062
|
MedListCodg: subItem.GoodInfo.MedicalInsuranceNumber,
|
|
@@ -1136,7 +1225,8 @@ func (c *ZHHisApiController) GetUploadInfo() {
|
1136
|
1225
|
}
|
1137
|
1226
|
if item.Type == 2 { //项目
|
1138
|
1227
|
for _, subItem := range item.HisPrescriptionProject {
|
1139
|
|
- total = total + (subItem.Price * float64(subItem.Count))
|
|
1228
|
+ cnt, _ := strconv.ParseFloat(subItem.Count, 64)
|
|
1229
|
+ total = total + (subItem.Price * cnt)
|
1140
|
1230
|
}
|
1141
|
1231
|
}
|
1142
|
1232
|
}
|