|
@@ -297,16 +297,128 @@ func SzybFY005(doctor string, doctor_code string, fixmedins_code string, dept_co
|
297
|
297
|
str := string(respBytes)
|
298
|
298
|
return str
|
299
|
299
|
}
|
300
|
|
-func SzybJY002(doctor string, doctor_code string, fixmedins_code string, dept_code string, number string, verify_code string) string {
|
301
|
|
-
|
302
|
|
- inputMessage := SetSZInputMessage(doctor, doctor_code, fixmedins_code, verify_code)
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
|
|
303
|
+
|
|
304
|
+
|
|
305
|
+
|
|
306
|
+
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+
|
|
319
|
+
|
|
320
|
+
|
|
321
|
+
|
|
322
|
+
|
|
323
|
+
|
|
324
|
+
|
|
325
|
+
|
|
326
|
+
|
|
327
|
+
|
|
328
|
+
|
|
329
|
+
|
|
330
|
+
|
|
331
|
+
|
|
332
|
+
|
|
333
|
+
|
|
334
|
+
|
|
335
|
+
|
|
336
|
+
|
|
337
|
+
|
|
338
|
+
|
|
339
|
+
|
|
340
|
+
|
|
341
|
+
|
|
342
|
+
|
|
343
|
+
|
|
344
|
+
|
|
345
|
+
|
|
346
|
+
|
|
347
|
+
|
|
348
|
+
|
|
349
|
+
|
|
350
|
+
|
|
351
|
+
|
|
352
|
+
|
|
353
|
+
|
|
354
|
+
|
|
355
|
+
|
|
356
|
+
|
|
357
|
+
|
|
358
|
+
|
|
359
|
+
|
|
360
|
+
|
|
361
|
+
|
|
362
|
+
|
|
363
|
+
|
|
364
|
+
|
|
365
|
+
|
|
366
|
+
|
|
367
|
+
|
|
368
|
+
|
|
369
|
+
|
|
370
|
+
|
|
371
|
+
|
|
372
|
+
|
|
373
|
+
|
|
374
|
+
|
|
375
|
+
|
|
376
|
+
|
|
377
|
+
|
|
378
|
+
|
|
379
|
+
|
|
380
|
+
|
|
381
|
+
|
|
382
|
+
|
|
383
|
+
|
|
384
|
+
|
|
385
|
+
|
|
386
|
+
|
|
387
|
+
|
|
388
|
+
|
|
389
|
+func SzybML008(doctor string, doctor_code string, fixmedins_code string, datas []*models.DrugDetail) string {
|
|
390
|
+
|
|
391
|
+ inputMessage := SetSZDrugMessage(doctor, doctor_code, fixmedins_code)
|
|
392
|
+
|
303
|
393
|
inputData := make(map[string]interface{})
|
304
|
|
- inputMessage["transType"] = "JY002"
|
305
|
394
|
|
306
|
|
- inputData["akc190"] = "2021033012131415"
|
307
|
|
- inputData["bke384"] = number
|
|
395
|
+ inputData["listsize"] = len(datas)
|
|
396
|
+ inputMessage["transType"] = "ML008"
|
|
397
|
+ feedetail := make([]map[string]interface{}, 0)
|
|
398
|
+
|
|
399
|
+ for _, item := range datas {
|
|
400
|
+ fmt.Println("中国222222", item.DrugDosageName)
|
|
401
|
+ feedetailInfo := make(map[string]interface{})
|
|
402
|
+ feedetailInfo["ake001"] = item.MedicalInsuranceNumber
|
|
403
|
+ feedetailInfo["bkm017"] = item.Code
|
|
404
|
+ feedetailInfo["ake005"] = "110100002"
|
|
405
|
+ feedetailInfo["ake006"] = item.DrugName
|
|
406
|
+ feedetailInfo["aka074"] = item.DrugSpec
|
|
407
|
+ feedetailInfo["aka070"] = item.DrugDosageName
|
|
408
|
+
|
|
409
|
+ feedetailInfo["aka067"] = item.MinUnit
|
|
410
|
+ feedetailInfo["bka053"] = item.ManufacturerName
|
|
411
|
+ feedetailInfo["aka064"] = "1"
|
|
412
|
+ feedetailInfo["bka505"] = item.LastPrice
|
|
413
|
+ feedetailInfo["bka506"] = item.RetailPrice
|
|
414
|
+ feedetailInfo["aae030"] = 20210406
|
|
415
|
+ feedetailInfo["aae013"] = item.LimitRemark
|
|
416
|
+ feedetail = append(feedetail, feedetailInfo)
|
|
417
|
+ }
|
308
|
418
|
|
|
419
|
+ inputData["inputlist"] = feedetail
|
309
|
420
|
inputMessage["transBody"] = inputData
|
|
421
|
+
|
310
|
422
|
bytesData, err := json.Marshal(inputMessage)
|
311
|
423
|
fmt.Println(string(bytesData))
|
312
|
424
|
if err != nil {
|
|
@@ -339,18 +451,117 @@ func SzybJY002(doctor string, doctor_code string, fixmedins_code string, dept_co
|
339
|
451
|
fmt.Println(string(respBytes))
|
340
|
452
|
str := string(respBytes)
|
341
|
453
|
return str
|
|
454
|
+
|
342
|
455
|
}
|
343
|
456
|
|
344
|
|
-func SzybJY003(doctor string, doctor_code string, fixmedins_code string, dept_code string, number string, verify_code string) string {
|
345
|
|
-
|
346
|
|
- inputMessage := SetSZInputMessage(doctor, doctor_code, fixmedins_code, verify_code)
|
|
457
|
+
|
|
458
|
+func SetSZInputMessage(doctor string, doctor_code string, fixmedins_code string, verify_code string, number string) map[string]interface{} {
|
|
459
|
+ month := time.Unix(1557042972, 0).Format("1")
|
|
460
|
+ year := time.Now().Format("2006")
|
|
461
|
+ month = time.Now().Format("01")
|
|
462
|
+ day := time.Now().Format("02")
|
|
463
|
+
|
|
464
|
+ hour := time.Now().Format("15")
|
|
465
|
+ min := time.Now().Format("04")
|
|
466
|
+ sec := time.Now().Format("05")
|
|
467
|
+
|
|
468
|
+ msec := time.Now().Format("000")
|
|
469
|
+
|
|
470
|
+
|
|
471
|
+ inputMessage := make(map[string]interface{})
|
|
472
|
+
|
|
473
|
+
|
|
474
|
+ inputMessage["cardArea"] = "440300"
|
|
475
|
+ inputMessage["extendDeviceId"] = ""
|
|
476
|
+ inputMessage["extendSerialNumber"] = ""
|
|
477
|
+ inputMessage["extendUserId"] = ""
|
|
478
|
+ inputMessage["hospitalCode"] = fixmedins_code
|
|
479
|
+ inputMessage["operatorCode"] = doctor_code
|
|
480
|
+ inputMessage["operatorName"] = doctor
|
|
481
|
+ inputMessage["operatorPass"] = ""
|
|
482
|
+ inputMessage["serialNumber"] = fixmedins_code + year + month + day +
|
|
483
|
+ fmt.Sprintf("%07v", rand.New(rand.NewSource(time.Now().UnixNano())).Int31n(10000000))
|
|
484
|
+ inputMessage["serialNumber"] = number
|
|
485
|
+
|
|
486
|
+ inputMessage["transReturnCode"] = ""
|
|
487
|
+ inputMessage["transReturnMessage"] = ""
|
|
488
|
+ inputMessage["transTime"] = year + month + day + hour + min + sec + ":" + msec
|
|
489
|
+ inputMessage["transVersion"] = "V0.3"
|
|
490
|
+ inputMessage["verifyCode"] = verify_code
|
|
491
|
+ inputMessage["transChannel"] = "10"
|
|
492
|
+
|
|
493
|
+ return inputMessage
|
|
494
|
+}
|
|
495
|
+func msToTime(ms int64) string {
|
|
496
|
+ tm := time.Unix(0, ms*int64(time.Millisecond))
|
|
497
|
+ return tm.Format("2006-02-01 15:04:05.000")
|
|
498
|
+}
|
|
499
|
+
|
|
500
|
+
|
|
501
|
+func SetSZDrugMessage(doctor string, doctor_code string, fixmedins_code string) map[string]interface{} {
|
|
502
|
+ month := time.Unix(1557042972, 0).Format("1")
|
|
503
|
+ year := time.Now().Format("2006")
|
|
504
|
+ month = time.Now().Format("01")
|
|
505
|
+ day := time.Now().Format("02")
|
|
506
|
+
|
|
507
|
+ hour := time.Now().Format("15")
|
|
508
|
+ min := time.Now().Format("04")
|
|
509
|
+ sec := time.Now().Format("05")
|
|
510
|
+
|
|
511
|
+ msec := time.Now().Format("000")
|
|
512
|
+
|
|
513
|
+
|
|
514
|
+ inputMessage := make(map[string]interface{})
|
|
515
|
+
|
|
516
|
+
|
|
517
|
+ inputMessage["cardArea"] = "440300"
|
|
518
|
+ inputMessage["extendDeviceId"] = ""
|
|
519
|
+ inputMessage["extendSerialNumber"] = ""
|
|
520
|
+ inputMessage["extendUserId"] = ""
|
|
521
|
+ inputMessage["hospitalCode"] = "G5540"
|
|
522
|
+ inputMessage["operatorCode"] = doctor_code
|
|
523
|
+ inputMessage["operatorName"] = doctor
|
|
524
|
+ inputMessage["operatorPass"] = ""
|
|
525
|
+
|
|
526
|
+
|
|
527
|
+ inputMessage["serialNumber"] = "G554020210406" + fmt.Sprintf("%07v", rand.New(rand.NewSource(time.Now().UnixNano())).Int31n(10000000))
|
|
528
|
+ inputMessage["verifyCode"] = "000000|8ec5b7745a5cc45b631f23b4bf1e417e"
|
|
529
|
+
|
|
530
|
+ inputMessage["transReturnCode"] = ""
|
|
531
|
+ inputMessage["transReturnMessage"] = ""
|
|
532
|
+ inputMessage["transTime"] = year + month + day + hour + min + sec + ":" + msec
|
|
533
|
+ inputMessage["transVersion"] = "V0.3"
|
|
534
|
+ inputMessage["transChannel"] = "10"
|
|
535
|
+
|
|
536
|
+ return inputMessage
|
|
537
|
+}
|
|
538
|
+
|
|
539
|
+func SzybML009(doctor string, doctor_code string, fixmedins_code string, datas []*models.DrugDetail) string {
|
|
540
|
+
|
|
541
|
+ inputMessage := SetSZDrugMessage(doctor, doctor_code, fixmedins_code)
|
|
542
|
+
|
347
|
543
|
inputData := make(map[string]interface{})
|
348
|
|
- inputMessage["transType"] = "JY002"
|
349
|
544
|
|
350
|
|
- inputData["akc190"] = "2021033012131415"
|
351
|
|
- inputData["bke384"] = number
|
|
545
|
+ inputData["listsize"] = len(datas)
|
|
546
|
+ inputMessage["transType"] = "ML009"
|
|
547
|
+ feedetail := make([]map[string]interface{}, 0)
|
352
|
548
|
|
|
549
|
+ for _, item := range datas {
|
|
550
|
+ feedetailInfo := make(map[string]interface{})
|
|
551
|
+ feedetailInfo["ake001"] = item.MedicalInsuranceNumber
|
|
552
|
+ feedetailInfo["ake005"] = "110100002"
|
|
553
|
+ feedetailInfo["ake006"] = item.DrugName
|
|
554
|
+ feedetailInfo["bkf131"] = "4"
|
|
555
|
+ feedetailInfo["bkm062"] = "0"
|
|
556
|
+ feedetailInfo["bka506"] = item.RetailPrice
|
|
557
|
+ feedetailInfo["aae030"] = 20210407
|
|
558
|
+ feedetailInfo["aae013"] = item.LimitRemark
|
|
559
|
+ feedetail = append(feedetail, feedetailInfo)
|
|
560
|
+ }
|
|
561
|
+ fmt.Println("feeedDetal2333333333", feedetail)
|
|
562
|
+ inputData["inputlist"] = feedetail
|
353
|
563
|
inputMessage["transBody"] = inputData
|
|
564
|
+
|
354
|
565
|
bytesData, err := json.Marshal(inputMessage)
|
355
|
566
|
fmt.Println(string(bytesData))
|
356
|
567
|
if err != nil {
|
|
@@ -383,47 +594,299 @@ func SzybJY003(doctor string, doctor_code string, fixmedins_code string, dept_co
|
383
|
594
|
fmt.Println(string(respBytes))
|
384
|
595
|
str := string(respBytes)
|
385
|
596
|
return str
|
|
597
|
+
|
386
|
598
|
}
|
387
|
599
|
|
388
|
|
-
|
389
|
|
-func SetSZInputMessage(doctor string, doctor_code string, fixmedins_code string, verify_code string, number string) map[string]interface{} {
|
390
|
|
- month := time.Unix(1557042972, 0).Format("1")
|
391
|
|
- year := time.Now().Format("2006")
|
392
|
|
- month = time.Now().Format("01")
|
393
|
|
- day := time.Now().Format("02")
|
|
600
|
+func SzybML010(doctor string, doctor_code string, fixmedins_code string, datas []*models.DrugDetail) string {
|
|
601
|
+
|
|
602
|
+ inputMessage := SetSZDrugMessage(doctor, doctor_code, fixmedins_code)
|
394
|
603
|
|
395
|
|
- hour := time.Now().Format("15")
|
396
|
|
- min := time.Now().Format("04")
|
397
|
|
- sec := time.Now().Format("05")
|
|
604
|
+ inputData := make(map[string]interface{})
|
398
|
605
|
|
399
|
|
- msec := time.Now().Format("000")
|
|
606
|
+ inputData["listsize"] = len(datas)
|
|
607
|
+ inputMessage["transType"] = "ML010"
|
|
608
|
+ feedetail := make([]map[string]interface{}, 0)
|
400
|
609
|
|
401
|
|
-
|
402
|
|
- inputMessage := make(map[string]interface{})
|
403
|
|
-
|
|
610
|
+ for _, item := range datas {
|
|
611
|
+ feedetailInfo := make(map[string]interface{})
|
|
612
|
+ feedetailInfo["ake003"] = "1"
|
|
613
|
+ feedetailInfo["ake001"] = item.MedicalInsuranceNumber
|
|
614
|
+ feedetailInfo["ake005"] = "110100002"
|
|
615
|
+ feedetail = append(feedetail, feedetailInfo)
|
|
616
|
+ }
|
404
|
617
|
|
405
|
|
- inputMessage["cardArea"] = "440300"
|
406
|
|
- inputMessage["extendDeviceId"] = ""
|
407
|
|
- inputMessage["extendSerialNumber"] = ""
|
408
|
|
- inputMessage["extendUserId"] = ""
|
409
|
|
- inputMessage["hospitalCode"] = fixmedins_code
|
410
|
|
- inputMessage["operatorCode"] = doctor_code
|
411
|
|
- inputMessage["operatorName"] = doctor
|
412
|
|
- inputMessage["operatorPass"] = ""
|
413
|
|
- inputMessage["serialNumber"] = fixmedins_code + year + month + day +
|
414
|
|
- fmt.Sprintf("%07v", rand.New(rand.NewSource(time.Now().UnixNano())).Int31n(10000000))
|
415
|
|
- inputMessage["serialNumber"] = number
|
|
618
|
+ inputData["inputlist"] = feedetail
|
|
619
|
+ inputMessage["transBody"] = inputData
|
416
|
620
|
|
417
|
|
- inputMessage["transReturnCode"] = ""
|
418
|
|
- inputMessage["transReturnMessage"] = ""
|
419
|
|
- inputMessage["transTime"] = year + month + day + hour + min + sec + ":" + msec
|
420
|
|
- inputMessage["transVersion"] = "V0.3"
|
421
|
|
- inputMessage["verifyCode"] = verify_code
|
422
|
|
- inputMessage["transChannel"] = "10"
|
|
621
|
+ bytesData, err := json.Marshal(inputMessage)
|
|
622
|
+ fmt.Println(string(bytesData))
|
|
623
|
+ if err != nil {
|
|
624
|
+ fmt.Println(err.Error())
|
|
625
|
+ return err.Error()
|
|
626
|
+ }
|
|
627
|
+ reader := bytes.NewReader(bytesData)
|
|
628
|
+
|
|
629
|
+ url := "http://192.168.1.228:17001/szsi-portal/transData"
|
|
630
|
+
|
|
631
|
+ request, err := http.NewRequest("POST", url, reader)
|
|
632
|
+ if err != nil {
|
|
633
|
+ fmt.Println(err.Error())
|
|
634
|
+ return err.Error()
|
|
635
|
+ }
|
|
636
|
+
|
|
637
|
+ request.Header.Set("Content-Type", "application/json;charset=UTF-8")
|
|
638
|
+
|
|
639
|
+ client := http.Client{}
|
|
640
|
+ resp, err := client.Do(request)
|
|
641
|
+ if err != nil {
|
|
642
|
+ fmt.Println(err.Error())
|
|
643
|
+ return err.Error()
|
|
644
|
+ }
|
|
645
|
+ respBytes, err := ioutil.ReadAll(resp.Body)
|
|
646
|
+ if err != nil {
|
|
647
|
+ fmt.Println(err.Error())
|
|
648
|
+ return err.Error()
|
|
649
|
+ }
|
|
650
|
+ fmt.Println(string(respBytes))
|
|
651
|
+ str := string(respBytes)
|
|
652
|
+ return str
|
423
|
653
|
|
424
|
|
- return inputMessage
|
425
|
654
|
}
|
426
|
|
-func msToTime(ms int64) string {
|
427
|
|
- tm := time.Unix(0, ms*int64(time.Millisecond))
|
428
|
|
- return tm.Format("2006-02-01 15:04:05.000")
|
|
655
|
+
|
|
656
|
+func SzybYS001(doctor string, doctor_code string, fixmedins_code string, datas []*models.DocDetail) string {
|
|
657
|
+
|
|
658
|
+ inputMessage := SetSZDrugMessage(doctor, doctor_code, fixmedins_code)
|
|
659
|
+
|
|
660
|
+ inputData := make(map[string]interface{})
|
|
661
|
+
|
|
662
|
+ inputData["listsize"] = len(datas)
|
|
663
|
+ inputMessage["transType"] = "ML010"
|
|
664
|
+ feedetail := make([]map[string]interface{}, 0)
|
|
665
|
+
|
|
666
|
+ for _, item := range datas {
|
|
667
|
+ feedetailInfo := make(map[string]interface{})
|
|
668
|
+ feedetailInfo["aac003"] = item.UserName
|
|
669
|
+ feedetailInfo["bka633"] = item.RoleId
|
|
670
|
+ feedetailInfo["aac004"] = item.Sex
|
|
671
|
+ feedetailInfo["aac058"] = item.CardType
|
|
672
|
+ feedetailInfo["aac147"] = item.IdCard
|
|
673
|
+ feedetailInfo["aae005"] = item.Phone
|
|
674
|
+ feedetailInfo["bkc322"] = item.WorkMajorName
|
|
675
|
+ feedetailInfo["aac005"] = item.Nation
|
|
676
|
+ feedetailInfo["aac006"] = item.BirthDay
|
|
677
|
+ feedetailInfo["aac007"] = item.WorkTime
|
|
678
|
+ feedetailInfo["aac011"] = item.Education
|
|
679
|
+ feedetailInfo["aac183"] = item.StudyMajorName
|
|
680
|
+ feedetailInfo["bkc323"] = item.CertificateCode
|
|
681
|
+ feedetailInfo["bke955"] = item.MedicalCode
|
|
682
|
+ feedetailInfo["akc055"] = item.MedicalRangeCode
|
|
683
|
+ feedetailInfo["bcc950"] = item.MedicalLevel
|
|
684
|
+ feedetailInfo["bcc955"] = item.TypeJob
|
|
685
|
+ feedetailInfo["bka503"] = item.DoctorNumber
|
|
686
|
+ feedetailInfo["bkc324"] = item.Licensing
|
|
687
|
+ feedetailInfo["bkc326"] = item.DoctorServiceStatus
|
|
688
|
+ feedetailInfo["bkc328"] = item.MonitoringLevel
|
|
689
|
+ feedetailInfo["bkc329"] = item.DrugPsychotropicSubstances
|
|
690
|
+ feedetailInfo["bke801"] = item.HealthCareCode
|
|
691
|
+ feedetailInfo["bkc330"] = item.PlanningTechnicalServiceCode
|
|
692
|
+ feedetailInfo["bkc332"] = item.PharmacistType
|
|
693
|
+ feedetailInfo["bkc333"] = item.PharmacistPracticeCategory
|
|
694
|
+ feedetailInfo["bkc334"] = item.PharmacistsLicensing
|
|
695
|
+ feedetailInfo["bkc335"] = item.PharmacistRegistrationNumber
|
|
696
|
+ feedetailInfo["akf001"] = item.OfficeCode
|
|
697
|
+ feedetailInfo["acc501"] = item.JobNumber
|
|
698
|
+ feedetailInfo["ahc451"] = item.PostName
|
|
699
|
+ feedetailInfo["aaf009"] = item.TechnicalJobLevelCode
|
|
700
|
+ feedetailInfo["bkc321"] = item.IsActive
|
|
701
|
+ feedetailInfo["ckc302"] = item.PrescriptionQualificationIdentification
|
|
702
|
+ feedetailInfo["bkc325"] = item.IdentificationOutpatients
|
|
703
|
+ feedetailInfo["ckc304"] = item.OutpatientIllnessCategory
|
|
704
|
+ feedetailInfo["aae030"] = item.StartTime
|
|
705
|
+ feedetail = append(feedetail, feedetailInfo)
|
|
706
|
+ }
|
|
707
|
+
|
|
708
|
+ inputData["inputlist"] = feedetail
|
|
709
|
+ inputMessage["transBody"] = inputData
|
|
710
|
+
|
|
711
|
+ bytesData, err := json.Marshal(inputMessage)
|
|
712
|
+ fmt.Println(string(bytesData))
|
|
713
|
+ if err != nil {
|
|
714
|
+ fmt.Println(err.Error())
|
|
715
|
+ return err.Error()
|
|
716
|
+ }
|
|
717
|
+ reader := bytes.NewReader(bytesData)
|
|
718
|
+
|
|
719
|
+ url := "http://192.168.1.228:17001/szsi-portal/transData"
|
|
720
|
+
|
|
721
|
+ request, err := http.NewRequest("POST", url, reader)
|
|
722
|
+ if err != nil {
|
|
723
|
+ fmt.Println(err.Error())
|
|
724
|
+ return err.Error()
|
|
725
|
+ }
|
|
726
|
+
|
|
727
|
+ request.Header.Set("Content-Type", "application/json;charset=UTF-8")
|
|
728
|
+
|
|
729
|
+ client := http.Client{}
|
|
730
|
+ resp, err := client.Do(request)
|
|
731
|
+ if err != nil {
|
|
732
|
+ fmt.Println(err.Error())
|
|
733
|
+ return err.Error()
|
|
734
|
+ }
|
|
735
|
+ respBytes, err := ioutil.ReadAll(resp.Body)
|
|
736
|
+ if err != nil {
|
|
737
|
+ fmt.Println(err.Error())
|
|
738
|
+ return err.Error()
|
|
739
|
+ }
|
|
740
|
+ fmt.Println(string(respBytes))
|
|
741
|
+ str := string(respBytes)
|
|
742
|
+ return str
|
|
743
|
+
|
|
744
|
+}
|
|
745
|
+
|
|
746
|
+func SzybYS002(doctor string, doctor_code string, fixmedins_code string, datas []*models.DocDetail) string {
|
|
747
|
+
|
|
748
|
+
|
|
749
|
+ inputMessage := SetSZDrugMessage(doctor, doctor_code, fixmedins_code)
|
|
750
|
+
|
|
751
|
+ inputData := make(map[string]interface{})
|
|
752
|
+
|
|
753
|
+ inputData["listsize"] = len(datas)
|
|
754
|
+ inputMessage["transType"] = "ML010"
|
|
755
|
+ feedetail := make([]map[string]interface{}, 0)
|
|
756
|
+
|
|
757
|
+ for _, item := range datas {
|
|
758
|
+ fmt.Println("item2222", item)
|
|
759
|
+ feedetailInfo := make(map[string]interface{})
|
|
760
|
+ feedetailInfo["bkc320"] = 1111
|
|
761
|
+ feedetailInfo["bke155"] = ""
|
|
762
|
+ feedetail = append(feedetail, feedetailInfo)
|
|
763
|
+ }
|
|
764
|
+
|
|
765
|
+ inputData["inputlist"] = feedetail
|
|
766
|
+ inputMessage["transBody"] = inputData
|
|
767
|
+
|
|
768
|
+ bytesData, err := json.Marshal(inputMessage)
|
|
769
|
+ fmt.Println(string(bytesData))
|
|
770
|
+ if err != nil {
|
|
771
|
+ fmt.Println(err.Error())
|
|
772
|
+ return err.Error()
|
|
773
|
+ }
|
|
774
|
+ reader := bytes.NewReader(bytesData)
|
|
775
|
+
|
|
776
|
+ url := "http://192.168.1.228:17001/szsi-portal/transData"
|
|
777
|
+
|
|
778
|
+ request, err := http.NewRequest("POST", url, reader)
|
|
779
|
+ if err != nil {
|
|
780
|
+ fmt.Println(err.Error())
|
|
781
|
+ return err.Error()
|
|
782
|
+ }
|
|
783
|
+
|
|
784
|
+ request.Header.Set("Content-Type", "application/json;charset=UTF-8")
|
|
785
|
+
|
|
786
|
+ client := http.Client{}
|
|
787
|
+ resp, err := client.Do(request)
|
|
788
|
+ if err != nil {
|
|
789
|
+ fmt.Println(err.Error())
|
|
790
|
+ return err.Error()
|
|
791
|
+ }
|
|
792
|
+ respBytes, err := ioutil.ReadAll(resp.Body)
|
|
793
|
+ if err != nil {
|
|
794
|
+ fmt.Println(err.Error())
|
|
795
|
+ return err.Error()
|
|
796
|
+ }
|
|
797
|
+ fmt.Println(string(respBytes))
|
|
798
|
+ str := string(respBytes)
|
|
799
|
+ return str
|
|
800
|
+}
|
|
801
|
+
|
|
802
|
+func SzybYS003(doctor string, doctor_code string, fixmedins_code string, datas []*models.DocDetail) string {
|
|
803
|
+
|
|
804
|
+
|
|
805
|
+ inputMessage := SetSZDrugMessage(doctor, doctor_code, fixmedins_code)
|
|
806
|
+
|
|
807
|
+ inputData := make(map[string]interface{})
|
|
808
|
+
|
|
809
|
+ inputData["listsize"] = len(datas)
|
|
810
|
+ inputMessage["transType"] = "ML010"
|
|
811
|
+ feedetail := make([]map[string]interface{}, 0)
|
|
812
|
+
|
|
813
|
+ for _, item := range datas {
|
|
814
|
+ feedetailInfo := make(map[string]interface{})
|
|
815
|
+ feedetailInfo["bkc320"] = ""
|
|
816
|
+ feedetailInfo["aac003"] = item.UserName
|
|
817
|
+ feedetailInfo["bka633"] = item.RoleId
|
|
818
|
+ feedetailInfo["aac004"] = item.Sex
|
|
819
|
+ feedetailInfo["aac058"] = item.CardType
|
|
820
|
+ feedetailInfo["aac147"] = item.IdCard
|
|
821
|
+ feedetailInfo["aae005"] = item.Phone
|
|
822
|
+ feedetailInfo["bkc322"] = item.WorkMajorName
|
|
823
|
+ feedetailInfo["aac005"] = item.Nation
|
|
824
|
+ feedetailInfo["aac006"] = item.BirthDay
|
|
825
|
+ feedetailInfo["aac007"] = item.WorkTime
|
|
826
|
+ feedetailInfo["aac011"] = item.Education
|
|
827
|
+ feedetailInfo["aac183"] = item.StudyMajorName
|
|
828
|
+ feedetailInfo["bkc323"] = item.CertificateCode
|
|
829
|
+ feedetailInfo["bke955"] = item.MedicalCode
|
|
830
|
+ feedetailInfo["akc055"] = item.MedicalRangeCode
|
|
831
|
+ feedetailInfo["bcc950"] = item.MedicalLevel
|
|
832
|
+ feedetailInfo["bcc955"] = item.TypeJob
|
|
833
|
+ feedetailInfo["bka503"] = item.DoctorNumber
|
|
834
|
+ feedetailInfo["bkc324"] = item.Licensing
|
|
835
|
+ feedetailInfo["bkc326"] = item.DoctorServiceStatus
|
|
836
|
+ feedetailInfo["bkc328"] = item.MonitoringLevel
|
|
837
|
+ feedetailInfo["bkc329"] = item.DrugPsychotropicSubstances
|
|
838
|
+ feedetailInfo["bke801"] = item.HealthCareCode
|
|
839
|
+ feedetailInfo["bkc330"] = item.PlanningTechnicalServiceCode
|
|
840
|
+ feedetailInfo["bkc332"] = item.PharmacistType
|
|
841
|
+ feedetailInfo["bkc333"] = item.PharmacistPracticeCategory
|
|
842
|
+ feedetailInfo["bkc334"] = item.PharmacistsLicensing
|
|
843
|
+ feedetailInfo["bkc335"] = item.PharmacistRegistrationNumber
|
|
844
|
+ feedetailInfo["akf001"] = item.OfficeCode
|
|
845
|
+ feedetailInfo["acc501"] = item.JobNumber
|
|
846
|
+ feedetailInfo["ahc451"] = item.PostName
|
|
847
|
+ feedetailInfo["aaf009"] = item.TechnicalJobLevelCode
|
|
848
|
+ feedetailInfo["bkc321"] = item.IsActive
|
|
849
|
+ feedetailInfo["ckc302"] = item.PrescriptionQualificationIdentification
|
|
850
|
+ feedetailInfo["bkc325"] = item.IdentificationOutpatients
|
|
851
|
+ feedetailInfo["ckc304"] = item.OutpatientIllnessCategory
|
|
852
|
+ feedetailInfo["aae030"] = item.StartTime
|
|
853
|
+ feedetailInfo["aae031"] = item.EndTime
|
|
854
|
+ feedetail = append(feedetail, feedetailInfo)
|
|
855
|
+ }
|
|
856
|
+
|
|
857
|
+ inputData["inputlist"] = feedetail
|
|
858
|
+ inputMessage["transBody"] = inputData
|
|
859
|
+
|
|
860
|
+ bytesData, err := json.Marshal(inputMessage)
|
|
861
|
+ fmt.Println(string(bytesData))
|
|
862
|
+ if err != nil {
|
|
863
|
+ fmt.Println(err.Error())
|
|
864
|
+ return err.Error()
|
|
865
|
+ }
|
|
866
|
+ reader := bytes.NewReader(bytesData)
|
|
867
|
+
|
|
868
|
+ url := "http://192.168.1.228:17001/szsi-portal/transData"
|
|
869
|
+
|
|
870
|
+ request, err := http.NewRequest("POST", url, reader)
|
|
871
|
+ if err != nil {
|
|
872
|
+ fmt.Println(err.Error())
|
|
873
|
+ return err.Error()
|
|
874
|
+ }
|
|
875
|
+
|
|
876
|
+ request.Header.Set("Content-Type", "application/json;charset=UTF-8")
|
|
877
|
+
|
|
878
|
+ client := http.Client{}
|
|
879
|
+ resp, err := client.Do(request)
|
|
880
|
+ if err != nil {
|
|
881
|
+ fmt.Println(err.Error())
|
|
882
|
+ return err.Error()
|
|
883
|
+ }
|
|
884
|
+ respBytes, err := ioutil.ReadAll(resp.Body)
|
|
885
|
+ if err != nil {
|
|
886
|
+ fmt.Println(err.Error())
|
|
887
|
+ return err.Error()
|
|
888
|
+ }
|
|
889
|
+ fmt.Println(string(respBytes))
|
|
890
|
+ str := string(respBytes)
|
|
891
|
+ return str
|
429
|
892
|
}
|