Explorar el Código

Merge branch 'master' of http://git.shengws.com/csx/gdyb

csx hace 3 años
padre
commit
f7667b4066
Se han modificado 1 ficheros con 435 adiciones y 265 borrados
  1. 435 265
      service/gdyb_service.go

+ 435 - 265
service/gdyb_service.go Ver fichero

@@ -92,7 +92,7 @@ func Gdyb1201(certNo string, org_name string, doctor string, fixmedins_code stri
92 92
 	//ole.CoUninitialize()
93 93
 	//
94 94
 	var json2 string
95
-	cmd := exec.Command("java", "-jar", "yh_hb_fat.jar", "1201", string(bytesData), json2)
95
+	cmd := exec.Command("java", "-jar", "yh_hb_fat.jar", "1101", string(bytesData), json2)
96 96
 	out, err := cmd.Output()
97 97
 	if err != nil {
98 98
 		fmt.Println("error:", err.Error())
@@ -211,33 +211,47 @@ func Gdyb1101(certNo string, org_name string, doctor string, fixmedins_code stri
211 211
 	//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_api/prd/hsa/hgs/1101"
212 212
 	url := gdyb_url + "1101"
213 213
 
214
-	//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/1101"
215
-	request, err := http.NewRequest("POST", url, reader)
216
-	if err != nil {
217
-		fmt.Println(err.Error())
218
-		return err.Error(), ""
219
-	}
214
+	if insuplc_admdvs == "421300" {
215
+		var json2 string
216
+		cmd := exec.Command("java", "-jar", "yh_hb_fat.jar", "1101", string(bytesData), json2)
217
+		out, err := cmd.Output()
218
+		if err != nil {
219
+			fmt.Println("error:", err.Error())
220
+		}
221
+		fmt.Println(string(out))
222
+		return string(out), inputLog
223
+	} else {
220 224
 
221
-	request.Header.Set("Content-Type", "application/json;charset=UTF-8")
222
-	request.Header.Set("x-tif-paasid", gdyb_paasid)
223
-	request.Header.Set("x-tif-signature", signature)
224
-	request.Header.Set("x-tif-timestamp", strconv.FormatInt(timestamp, 10))
225
-	request.Header.Set("x-tif-nonce", nonce)
225
+		//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/1101"
226
+		request, err := http.NewRequest("POST", url, reader)
227
+		if err != nil {
228
+			fmt.Println(err.Error())
229
+			return err.Error(), ""
230
+		}
231
+
232
+		request.Header.Set("Content-Type", "application/json;charset=UTF-8")
233
+		request.Header.Set("x-tif-paasid", gdyb_paasid)
234
+		request.Header.Set("x-tif-signature", signature)
235
+		request.Header.Set("x-tif-timestamp", strconv.FormatInt(timestamp, 10))
236
+		request.Header.Set("x-tif-nonce", nonce)
237
+
238
+		client := http.Client{}
239
+		resp, err := client.Do(request)
240
+		if err != nil {
241
+			fmt.Println(err.Error())
242
+			return err.Error(), ""
243
+		}
244
+		respBytes, err := ioutil.ReadAll(resp.Body)
245
+		if err != nil {
246
+			fmt.Println(err.Error())
247
+			return err.Error(), ""
248
+		}
249
+		fmt.Println(string(respBytes))
250
+		str := string(respBytes)
251
+		return str, inputLog
226 252
 
227
-	client := http.Client{}
228
-	resp, err := client.Do(request)
229
-	if err != nil {
230
-		fmt.Println(err.Error())
231
-		return err.Error(), ""
232
-	}
233
-	respBytes, err := ioutil.ReadAll(resp.Body)
234
-	if err != nil {
235
-		fmt.Println(err.Error())
236
-		return err.Error(), ""
237 253
 	}
238
-	fmt.Println(string(respBytes))
239
-	str := string(respBytes)
240
-	return str, inputLog
254
+
241 255
 }
242 256
 
243 257
 func Gdyb1101A(certNo string, org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, secret_key string) string {
@@ -274,32 +288,46 @@ func Gdyb1101A(certNo string, org_name string, doctor string, fixmedins_code str
274 288
 	//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/1101"
275 289
 
276 290
 	//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/1101"
277
-	request, err := http.NewRequest("POST", url, reader)
278
-	if err != nil {
279
-		fmt.Println(err.Error())
280
-		return err.Error()
281
-	}
282 291
 
283
-	request.Header.Set("Content-Type", "application/json;charset=UTF-8")
284
-	request.Header.Set("x-tif-paasid", gdyb_paasid)
285
-	request.Header.Set("x-tif-signature", signature)
286
-	request.Header.Set("x-tif-timestamp", strconv.FormatInt(timestamp, 10))
287
-	request.Header.Set("x-tif-nonce", nonce)
292
+	if insuplc_admdvs == "421300" {
293
+		var json2 string
294
+		cmd := exec.Command("java", "-jar", "yh_hb_fat.jar", "1101A", string(bytesData), json2)
295
+		out, err := cmd.Output()
296
+		if err != nil {
297
+			fmt.Println("error:", err.Error())
298
+		}
299
+		fmt.Println(string(out))
300
+		return string(out)
301
+	} else {
302
+		request, err := http.NewRequest("POST", url, reader)
303
+		if err != nil {
304
+			fmt.Println(err.Error())
305
+			return err.Error()
306
+		}
307
+
308
+		request.Header.Set("Content-Type", "application/json;charset=UTF-8")
309
+		request.Header.Set("x-tif-paasid", gdyb_paasid)
310
+		request.Header.Set("x-tif-signature", signature)
311
+		request.Header.Set("x-tif-timestamp", strconv.FormatInt(timestamp, 10))
312
+		request.Header.Set("x-tif-nonce", nonce)
313
+
314
+		client := http.Client{}
315
+		resp, err := client.Do(request)
316
+		if err != nil {
317
+			fmt.Println(err.Error())
318
+			return err.Error()
319
+		}
320
+		respBytes, err := ioutil.ReadAll(resp.Body)
321
+		if err != nil {
322
+			fmt.Println(err.Error())
323
+			return err.Error()
324
+		}
325
+		fmt.Println(string(respBytes))
326
+		str := string(respBytes)
327
+		return str
288 328
 
289
-	client := http.Client{}
290
-	resp, err := client.Do(request)
291
-	if err != nil {
292
-		fmt.Println(err.Error())
293
-		return err.Error()
294
-	}
295
-	respBytes, err := ioutil.ReadAll(resp.Body)
296
-	if err != nil {
297
-		fmt.Println(err.Error())
298
-		return err.Error()
299 329
 	}
300
-	fmt.Println(string(respBytes))
301
-	str := string(respBytes)
302
-	return str
330
+
303 331
 }
304 332
 
305 333
 // 门诊挂号
@@ -353,33 +381,48 @@ func Gdyb2201(psnNo string, insutype string, certNo string, org_name string, doc
353 381
 	gdyb_url := beego.AppConfig.String("gdyb_url")
354 382
 	gdyb_paasid := beego.AppConfig.String("gdyb_paasid")
355 383
 	url := gdyb_url + "2201"
356
-	//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/2201"
357
-	request, err := http.NewRequest("POST", url, reader)
358
-	if err != nil {
359
-		fmt.Println(err.Error())
360
-		return err.Error(), ""
361
-	}
362 384
 
363
-	request.Header.Set("Content-Type", "application/json;charset=UTF-8")
364
-	request.Header.Set("x-tif-paasid", gdyb_paasid)
365
-	request.Header.Set("x-tif-signature", signature)
366
-	request.Header.Set("x-tif-timestamp", strconv.FormatInt(timestamp, 10))
367
-	request.Header.Set("x-tif-nonce", nonce)
385
+	if insuplc_admdvs == "421300" {
386
+		var json2 string
387
+		cmd := exec.Command("java", "-jar", "yh_hb_fat.jar", "2201", string(bytesData), json2)
388
+		out, err := cmd.Output()
389
+		if err != nil {
390
+			fmt.Println("error:", err.Error())
391
+		}
392
+		fmt.Println(string(out))
393
+
394
+		return string(out), requestLog
395
+	} else {
396
+		request, err := http.NewRequest("POST", url, reader)
397
+		if err != nil {
398
+			fmt.Println(err.Error())
399
+			return err.Error(), ""
400
+		}
401
+
402
+		request.Header.Set("Content-Type", "application/json;charset=UTF-8")
403
+		request.Header.Set("x-tif-paasid", gdyb_paasid)
404
+		request.Header.Set("x-tif-signature", signature)
405
+		request.Header.Set("x-tif-timestamp", strconv.FormatInt(timestamp, 10))
406
+		request.Header.Set("x-tif-nonce", nonce)
407
+
408
+		client := http.Client{}
409
+		resp, err := client.Do(request)
410
+		if err != nil {
411
+			fmt.Println(err.Error())
412
+			return err.Error(), ""
413
+		}
414
+		respBytes, err := ioutil.ReadAll(resp.Body)
415
+		if err != nil {
416
+			fmt.Println(err.Error())
417
+			return err.Error(), ""
418
+		}
419
+		str := string(respBytes)
420
+		fmt.Println(str)
421
+		return str, requestLog
368 422
 
369
-	client := http.Client{}
370
-	resp, err := client.Do(request)
371
-	if err != nil {
372
-		fmt.Println(err.Error())
373
-		return err.Error(), ""
374
-	}
375
-	respBytes, err := ioutil.ReadAll(resp.Body)
376
-	if err != nil {
377
-		fmt.Println(err.Error())
378
-		return err.Error(), ""
379 423
 	}
380
-	str := string(respBytes)
381
-	fmt.Println(str)
382
-	return str, requestLog
424
+	//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/2201"
425
+
383 426
 }
384 427
 
385 428
 // 门诊挂号撤销
@@ -419,34 +462,49 @@ func Gdyb2202(psnNo string, mdtrtId string, ipt_otp_no string, org_name string,
419 462
 	//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/2202"
420 463
 
421 464
 	//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/2202"
422
-	request, err := http.NewRequest("POST", url, reader)
423
-	if err != nil {
424
-		fmt.Println(err.Error())
425
-		return err.Error(), ""
426
-	}
465
+	if insuplc_admdvs == "421300" {
466
+		var json2 string
467
+		cmd := exec.Command("java", "-jar", "yh_hb_fat.jar", "2202", string(bytesData), json2)
468
+		out, err := cmd.Output()
469
+		if err != nil {
470
+			fmt.Println("error:", err.Error())
471
+		}
472
+		fmt.Println(string(out))
427 473
 
428
-	request.Header.Set("Content-Type", "application/json;charset=UTF-8")
429
-	//request.Header.Set("x-tif-paasid", "test_hosp")
430
-	request.Header.Set("x-tif-paasid", gdyb_paasid)
474
+		return string(out), requestLog
475
+	} else {
431 476
 
432
-	request.Header.Set("x-tif-signature", signature)
433
-	request.Header.Set("x-tif-timestamp", strconv.FormatInt(timestamp, 10))
434
-	request.Header.Set("x-tif-nonce", nonce)
477
+		request, err := http.NewRequest("POST", url, reader)
478
+		if err != nil {
479
+			fmt.Println(err.Error())
480
+			return err.Error(), ""
481
+		}
482
+
483
+		request.Header.Set("Content-Type", "application/json;charset=UTF-8")
484
+		//request.Header.Set("x-tif-paasid", "test_hosp")
485
+		request.Header.Set("x-tif-paasid", gdyb_paasid)
486
+
487
+		request.Header.Set("x-tif-signature", signature)
488
+		request.Header.Set("x-tif-timestamp", strconv.FormatInt(timestamp, 10))
489
+		request.Header.Set("x-tif-nonce", nonce)
490
+
491
+		client := http.Client{}
492
+		resp, err := client.Do(request)
493
+		if err != nil {
494
+			fmt.Println(err.Error())
495
+			return err.Error(), ""
496
+		}
497
+		respBytes, err := ioutil.ReadAll(resp.Body)
498
+		if err != nil {
499
+			fmt.Println(err.Error())
500
+			return err.Error(), ""
501
+		}
502
+		str := string(respBytes)
503
+		fmt.Println(str)
504
+		return str, requestLog
435 505
 
436
-	client := http.Client{}
437
-	resp, err := client.Do(request)
438
-	if err != nil {
439
-		fmt.Println(err.Error())
440
-		return err.Error(), ""
441
-	}
442
-	respBytes, err := ioutil.ReadAll(resp.Body)
443
-	if err != nil {
444
-		fmt.Println(err.Error())
445
-		return err.Error(), ""
446 506
 	}
447
-	str := string(respBytes)
448
-	fmt.Println(str)
449
-	return str, requestLog
507
+
450 508
 }
451 509
 
452 510
 // 门诊就诊信息上传
@@ -507,36 +565,51 @@ func Gdyb2203(psnNo string, mdtrtId string, doctor string, department string, or
507 565
 	gdyb_paasid := beego.AppConfig.String("gdyb_paasid")
508 566
 	url := gdyb_url + "2203"
509 567
 
568
+	if insuplc_admdvs == "421300" {
569
+		var json2 string
570
+		cmd := exec.Command("java", "-jar", "yh_hb_fat.jar", "2203", string(bytesData), json2)
571
+		out, err := cmd.Output()
572
+		if err != nil {
573
+			fmt.Println("error:", err.Error())
574
+		}
575
+		fmt.Println(string(out))
576
+
577
+		return string(out), requestLog
578
+	} else {
579
+		request, err := http.NewRequest("POST", url, reader)
580
+		if err != nil {
581
+			fmt.Println(err.Error())
582
+			return err.Error(), ""
583
+		}
584
+
585
+		request.Header.Set("Content-Type", "application/json;charset=UTF-8")
586
+		request.Header.Set("x-tif-paasid", gdyb_paasid)
587
+		request.Header.Set("x-tif-signature", signature)
588
+		request.Header.Set("x-tif-timestamp", strconv.FormatInt(timestamp, 10))
589
+		request.Header.Set("x-tif-nonce", nonce)
590
+
591
+		client := http.Client{}
592
+		resp, err := client.Do(request)
593
+		if err != nil {
594
+			fmt.Println(err.Error())
595
+			return err.Error(), ""
596
+		}
597
+		respBytes, err := ioutil.ReadAll(resp.Body)
598
+		if err != nil {
599
+			fmt.Println(err.Error())
600
+			return err.Error(), ""
601
+		}
602
+		str := string(respBytes)
603
+		fmt.Println(str)
604
+		return str, requestLog
605
+
606
+	}
607
+
510 608
 	//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_api/prd/hsa/hgs/2203"
511 609
 	//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/2203"
512 610
 
513 611
 	//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/2203"
514
-	request, err := http.NewRequest("POST", url, reader)
515
-	if err != nil {
516
-		fmt.Println(err.Error())
517
-		return err.Error(), ""
518
-	}
519 612
 
520
-	request.Header.Set("Content-Type", "application/json;charset=UTF-8")
521
-	request.Header.Set("x-tif-paasid", gdyb_paasid)
522
-	request.Header.Set("x-tif-signature", signature)
523
-	request.Header.Set("x-tif-timestamp", strconv.FormatInt(timestamp, 10))
524
-	request.Header.Set("x-tif-nonce", nonce)
525
-
526
-	client := http.Client{}
527
-	resp, err := client.Do(request)
528
-	if err != nil {
529
-		fmt.Println(err.Error())
530
-		return err.Error(), ""
531
-	}
532
-	respBytes, err := ioutil.ReadAll(resp.Body)
533
-	if err != nil {
534
-		fmt.Println(err.Error())
535
-		return err.Error(), ""
536
-	}
537
-	str := string(respBytes)
538
-	fmt.Println(str)
539
-	return str, requestLog
540 613
 }
541 614
 
542 615
 // 门诊就诊信息上传
@@ -600,36 +673,51 @@ func Gdyb2203A(psnNo string, mdtrtId string, doctor string, department string, o
600 673
 	gdyb_paasid := beego.AppConfig.String("gdyb_paasid")
601 674
 	url := gdyb_url + "2203A"
602 675
 
676
+	if insuplc_admdvs == "421300" {
677
+		var json2 string
678
+		cmd := exec.Command("java", "-jar", "yh_hb_fat.jar", "2203A", string(bytesData), json2)
679
+		out, err := cmd.Output()
680
+		if err != nil {
681
+			fmt.Println("error:", err.Error())
682
+		}
683
+		fmt.Println(string(out))
684
+
685
+		return string(out), requestLog
686
+	} else {
687
+
688
+		request, err := http.NewRequest("POST", url, reader)
689
+		if err != nil {
690
+			fmt.Println(err.Error())
691
+			return err.Error(), ""
692
+		}
693
+
694
+		request.Header.Set("Content-Type", "application/json;charset=UTF-8")
695
+		request.Header.Set("x-tif-paasid", gdyb_paasid)
696
+		request.Header.Set("x-tif-signature", signature)
697
+		request.Header.Set("x-tif-timestamp", strconv.FormatInt(timestamp, 10))
698
+		request.Header.Set("x-tif-nonce", nonce)
699
+
700
+		client := http.Client{}
701
+		resp, err := client.Do(request)
702
+		if err != nil {
703
+			fmt.Println(err.Error())
704
+			return err.Error(), ""
705
+		}
706
+		respBytes, err := ioutil.ReadAll(resp.Body)
707
+		if err != nil {
708
+			fmt.Println(err.Error())
709
+			return err.Error(), ""
710
+		}
711
+		str := string(respBytes)
712
+		fmt.Println(str)
713
+		return str, requestLog
714
+
715
+	}
603 716
 	//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_api/prd/hsa/hgs/2203A"
604 717
 	//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/2203"
605 718
 
606 719
 	//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/2203"
607
-	request, err := http.NewRequest("POST", url, reader)
608
-	if err != nil {
609
-		fmt.Println(err.Error())
610
-		return err.Error(), ""
611
-	}
612 720
 
613
-	request.Header.Set("Content-Type", "application/json;charset=UTF-8")
614
-	request.Header.Set("x-tif-paasid", gdyb_paasid)
615
-	request.Header.Set("x-tif-signature", signature)
616
-	request.Header.Set("x-tif-timestamp", strconv.FormatInt(timestamp, 10))
617
-	request.Header.Set("x-tif-nonce", nonce)
618
-
619
-	client := http.Client{}
620
-	resp, err := client.Do(request)
621
-	if err != nil {
622
-		fmt.Println(err.Error())
623
-		return err.Error(), ""
624
-	}
625
-	respBytes, err := ioutil.ReadAll(resp.Body)
626
-	if err != nil {
627
-		fmt.Println(err.Error())
628
-		return err.Error(), ""
629
-	}
630
-	str := string(respBytes)
631
-	fmt.Println(str)
632
-	return str, requestLog
633 721
 }
634 722
 
635 723
 type Custom struct {
@@ -857,30 +945,46 @@ func Gdyb2204(psnNo string, mdtrtId string, hisPrescription []*models.HisPrescri
857 945
 	//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/2204"
858 946
 
859 947
 	//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/2204"
860
-	request, err := http.NewRequest("POST", url, reader)
861
-	if err != nil {
862
-		fmt.Println(err.Error())
863
-		return "", ""
864
-	}
865 948
 
866
-	request.Header.Set("Content-Type", "application/json;charset=UTF-8")
867
-	request.Header.Set("x-tif-paasid", gdyb_paasid)
868
-	request.Header.Set("x-tif-signature", signature)
869
-	request.Header.Set("x-tif-timestamp", strconv.FormatInt(timestamp, 10))
870
-	request.Header.Set("x-tif-nonce", nonce)
949
+	if insuplc_admdvs == "421300" {
950
+		var json2 string
951
+		cmd := exec.Command("java", "-jar", "yh_hb_fat.jar", "2204", string(bytesData), json2)
952
+		out, err := cmd.Output()
953
+		if err != nil {
954
+			fmt.Println("error:", err.Error())
955
+		}
956
+		fmt.Println(string(out))
957
+
958
+		return string(out), requestLog
959
+	} else {
960
+
961
+		request, err := http.NewRequest("POST", url, reader)
962
+		if err != nil {
963
+			fmt.Println(err.Error())
964
+			return "", ""
965
+		}
966
+
967
+		request.Header.Set("Content-Type", "application/json;charset=UTF-8")
968
+		request.Header.Set("x-tif-paasid", gdyb_paasid)
969
+		request.Header.Set("x-tif-signature", signature)
970
+		request.Header.Set("x-tif-timestamp", strconv.FormatInt(timestamp, 10))
971
+		request.Header.Set("x-tif-nonce", nonce)
972
+
973
+		client := http.Client{}
974
+		resp, err := client.Do(request)
975
+		if err != nil {
976
+			fmt.Println(err.Error())
977
+			return "", ""
978
+		}
979
+		respBytes, err := ioutil.ReadAll(resp.Body)
980
+		if err != nil {
981
+			fmt.Println(err.Error())
982
+			return "", ""
983
+		}
984
+		return string(respBytes), requestLog
871 985
 
872
-	client := http.Client{}
873
-	resp, err := client.Do(request)
874
-	if err != nil {
875
-		fmt.Println(err.Error())
876
-		return "", ""
877
-	}
878
-	respBytes, err := ioutil.ReadAll(resp.Body)
879
-	if err != nil {
880
-		fmt.Println(err.Error())
881
-		return "", ""
882 986
 	}
883
-	return string(respBytes), requestLog
987
+
884 988
 	//var result RequestResult
885 989
 	//json.Unmarshal(respBytes, &result)
886 990
 	//return &result
@@ -926,35 +1030,50 @@ func Gdyb2205(psnNo string, mdtrtId string, chrgBchno string, org_name string, d
926 1030
 	//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/2205"
927 1031
 
928 1032
 	//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/2205"
929
-	request, err := http.NewRequest("POST", url, reader)
930
-	fmt.Println(err)
931 1033
 
932
-	fmt.Println(request)
933
-	if err != nil {
934
-		fmt.Println(err.Error())
935
-		return err.Error(), ""
936
-	}
1034
+	if insuplc_admdvs == "421300" {
1035
+		var json2 string
1036
+		cmd := exec.Command("java", "-jar", "yh_hb_fat.jar", "2205", string(bytesData), json2)
1037
+		out, err := cmd.Output()
1038
+		if err != nil {
1039
+			fmt.Println("error:", err.Error())
1040
+		}
1041
+		fmt.Println(string(out))
937 1042
 
938
-	request.Header.Set("Content-Type", "application/json;charset=UTF-8")
939
-	request.Header.Set("x-tif-paasid", gdyb_paasid)
940
-	request.Header.Set("x-tif-signature", signature)
941
-	request.Header.Set("x-tif-timestamp", strconv.FormatInt(timestamp, 10))
942
-	request.Header.Set("x-tif-nonce", nonce)
1043
+		return string(out), requestLog
1044
+	} else {
1045
+		request, err := http.NewRequest("POST", url, reader)
1046
+		fmt.Println(err)
1047
+
1048
+		fmt.Println(request)
1049
+		if err != nil {
1050
+			fmt.Println(err.Error())
1051
+			return err.Error(), ""
1052
+		}
1053
+
1054
+		request.Header.Set("Content-Type", "application/json;charset=UTF-8")
1055
+		request.Header.Set("x-tif-paasid", gdyb_paasid)
1056
+		request.Header.Set("x-tif-signature", signature)
1057
+		request.Header.Set("x-tif-timestamp", strconv.FormatInt(timestamp, 10))
1058
+		request.Header.Set("x-tif-nonce", nonce)
1059
+
1060
+		client := http.Client{}
1061
+		resp, err := client.Do(request)
1062
+		if err != nil {
1063
+			fmt.Println(err.Error())
1064
+			return err.Error(), ""
1065
+		}
1066
+		respBytes, err := ioutil.ReadAll(resp.Body)
1067
+		if err != nil {
1068
+			fmt.Println(err.Error())
1069
+			return err.Error(), ""
1070
+		}
1071
+		str := string(respBytes)
1072
+		fmt.Println(str)
1073
+		return str, requestLog
943 1074
 
944
-	client := http.Client{}
945
-	resp, err := client.Do(request)
946
-	if err != nil {
947
-		fmt.Println(err.Error())
948
-		return err.Error(), ""
949
-	}
950
-	respBytes, err := ioutil.ReadAll(resp.Body)
951
-	if err != nil {
952
-		fmt.Println(err.Error())
953
-		return err.Error(), ""
954 1075
 	}
955
-	str := string(respBytes)
956
-	fmt.Println(str)
957
-	return str, requestLog
1076
+
958 1077
 }
959 1078
 
960 1079
 //  门诊预结算
@@ -1018,32 +1137,47 @@ func Gdyb2206(psnNo string, mdtrtId string, chrgBchno string, certNo string, ins
1018 1137
 	//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/2206"
1019 1138
 
1020 1139
 	//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/2206"
1021
-	request, err := http.NewRequest("POST", url, reader)
1022
-	if err != nil {
1023
-		fmt.Println(err.Error())
1024
-		return err.Error(), ""
1025
-	}
1026 1140
 
1027
-	request.Header.Set("Content-Type", "application/json;charset=UTF-8")
1028
-	request.Header.Set("x-tif-paasid", gdyb_paasid)
1029
-	request.Header.Set("x-tif-signature", signature)
1030
-	request.Header.Set("x-tif-timestamp", strconv.FormatInt(timestamp, 10))
1031
-	request.Header.Set("x-tif-nonce", nonce)
1141
+	if insuplc_admdvs == "421300" {
1142
+		var json2 string
1143
+		cmd := exec.Command("java", "-jar", "yh_hb_fat.jar", "2206", string(bytesData), json2)
1144
+		out, err := cmd.Output()
1145
+		if err != nil {
1146
+			fmt.Println("error:", err.Error())
1147
+		}
1148
+		fmt.Println(string(out))
1149
+
1150
+		return string(out), requestLog
1151
+	} else {
1152
+		request, err := http.NewRequest("POST", url, reader)
1153
+		if err != nil {
1154
+			fmt.Println(err.Error())
1155
+			return err.Error(), ""
1156
+		}
1157
+
1158
+		request.Header.Set("Content-Type", "application/json;charset=UTF-8")
1159
+		request.Header.Set("x-tif-paasid", gdyb_paasid)
1160
+		request.Header.Set("x-tif-signature", signature)
1161
+		request.Header.Set("x-tif-timestamp", strconv.FormatInt(timestamp, 10))
1162
+		request.Header.Set("x-tif-nonce", nonce)
1163
+
1164
+		client := http.Client{}
1165
+		resp, err := client.Do(request)
1166
+		if err != nil {
1167
+			fmt.Println(err.Error())
1168
+			return err.Error(), ""
1169
+		}
1170
+		respBytes, err := ioutil.ReadAll(resp.Body)
1171
+		if err != nil {
1172
+			fmt.Println(err.Error())
1173
+			return err.Error(), ""
1174
+		}
1175
+		str := string(respBytes)
1176
+		fmt.Println(str)
1177
+		return str, requestLog
1032 1178
 
1033
-	client := http.Client{}
1034
-	resp, err := client.Do(request)
1035
-	if err != nil {
1036
-		fmt.Println(err.Error())
1037
-		return err.Error(), ""
1038
-	}
1039
-	respBytes, err := ioutil.ReadAll(resp.Body)
1040
-	if err != nil {
1041
-		fmt.Println(err.Error())
1042
-		return err.Error(), ""
1043 1179
 	}
1044
-	str := string(respBytes)
1045
-	fmt.Println(str)
1046
-	return str, requestLog
1180
+
1047 1181
 }
1048 1182
 
1049 1183
 //  门诊结算
@@ -1106,35 +1240,53 @@ func Gdyb2207(psnNo string, mdtrtId string, chrgBchno string, certNo string, ins
1106 1240
 	//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/2207"
1107 1241
 
1108 1242
 	//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/2207"
1109
-	request, err := http.NewRequest("POST", url, reader)
1110
-	if err != nil {
1111
-		fmt.Println(err.Error())
1112
-		return err.Error(), ""
1113
-	}
1114 1243
 
1115
-	request.Header.Set("Content-Type", "application/json;charset=UTF-8")
1116
-	request.Header.Set("x-tif-paasid", gdyb_paasid)
1117
-	request.Header.Set("x-tif-signature", signature)
1118
-	request.Header.Set("x-tif-timestamp", strconv.FormatInt(timestamp, 10))
1119
-	request.Header.Set("x-tif-nonce", nonce)
1244
+	if insuplc_admdvs == "421300" {
1245
+		var json2 string
1246
+		cmd := exec.Command("java", "-jar", "yh_hb_fat.jar", "2207", string(bytesData), json2)
1247
+		out, err := cmd.Output()
1248
+		if err != nil {
1249
+			fmt.Println("error:", err.Error())
1250
+		}
1251
+		mjson, _ := json.Marshal(inputMessage)
1252
+		str2 := string(mjson)
1253
+		fmt.Println(string(out))
1254
+
1255
+		return string(out), str2
1256
+	} else {
1257
+
1258
+		request, err := http.NewRequest("POST", url, reader)
1259
+		if err != nil {
1260
+			fmt.Println(err.Error())
1261
+			return err.Error(), ""
1262
+		}
1263
+
1264
+		request.Header.Set("Content-Type", "application/json;charset=UTF-8")
1265
+		request.Header.Set("x-tif-paasid", gdyb_paasid)
1266
+		request.Header.Set("x-tif-signature", signature)
1267
+		request.Header.Set("x-tif-timestamp", strconv.FormatInt(timestamp, 10))
1268
+		request.Header.Set("x-tif-nonce", nonce)
1269
+
1270
+		client := http.Client{}
1271
+		resp, err := client.Do(request)
1272
+		if err != nil {
1273
+			fmt.Println(err.Error())
1274
+			return err.Error(), ""
1275
+		}
1276
+		respBytes, err := ioutil.ReadAll(resp.Body)
1277
+		if err != nil {
1278
+			fmt.Println(err.Error())
1279
+			return err.Error(), ""
1280
+		}
1281
+		str := string(respBytes)
1282
+		fmt.Println(str)
1283
+		mjson, _ := json.Marshal(inputMessage)
1284
+		str2 := string(mjson)
1285
+
1286
+		return str, str2
1120 1287
 
1121
-	client := http.Client{}
1122
-	resp, err := client.Do(request)
1123
-	if err != nil {
1124
-		fmt.Println(err.Error())
1125
-		return err.Error(), ""
1126
-	}
1127
-	respBytes, err := ioutil.ReadAll(resp.Body)
1128
-	if err != nil {
1129
-		fmt.Println(err.Error())
1130
-		return err.Error(), ""
1131 1288
 	}
1132
-	str := string(respBytes)
1133
-	fmt.Println(str)
1134
-	mjson, _ := json.Marshal(inputMessage)
1135
-	str2 := string(mjson)
1136 1289
 
1137
-	return str, str2
1138 1290
 }
1139 1291
 
1140 1292
 //  门诊结算撤销
@@ -1174,34 +1326,51 @@ func Gdyb2208(psnNo string, mdtrtId string, setlId string, org_name string, doct
1174 1326
 	//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/2208"
1175 1327
 
1176 1328
 	//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/2208"
1177
-	request, err := http.NewRequest("POST", url, reader)
1178
-	if err != nil {
1179
-		fmt.Println(err.Error())
1180
-		return err.Error(), ""
1181
-	}
1182 1329
 
1183
-	request.Header.Set("Content-Type", "application/json;charset=UTF-8")
1184
-	request.Header.Set("x-tif-paasid", gdyb_paasid)
1185
-	request.Header.Set("x-tif-signature", signature)
1186
-	request.Header.Set("x-tif-timestamp", strconv.FormatInt(timestamp, 10))
1187
-	request.Header.Set("x-tif-nonce", nonce)
1330
+	if insuplc_admdvs == "421300" {
1331
+		var json2 string
1332
+		cmd := exec.Command("java", "-jar", "yh_hb_fat.jar", "2208", string(bytesData), json2)
1333
+		out, err := cmd.Output()
1334
+		if err != nil {
1335
+			fmt.Println("error:", err.Error())
1336
+		}
1337
+		mjson, _ := json.Marshal(inputMessage)
1338
+		str2 := string(mjson)
1339
+		fmt.Println(string(out))
1340
+
1341
+		return string(out), str2
1342
+	} else {
1343
+		request, err := http.NewRequest("POST", url, reader)
1344
+		if err != nil {
1345
+			fmt.Println(err.Error())
1346
+			return err.Error(), ""
1347
+		}
1348
+
1349
+		request.Header.Set("Content-Type", "application/json;charset=UTF-8")
1350
+		request.Header.Set("x-tif-paasid", gdyb_paasid)
1351
+		request.Header.Set("x-tif-signature", signature)
1352
+		request.Header.Set("x-tif-timestamp", strconv.FormatInt(timestamp, 10))
1353
+		request.Header.Set("x-tif-nonce", nonce)
1354
+
1355
+		client := http.Client{}
1356
+		resp, err := client.Do(request)
1357
+		if err != nil {
1358
+			fmt.Println(err.Error())
1359
+			return err.Error(), ""
1360
+		}
1361
+		respBytes, err := ioutil.ReadAll(resp.Body)
1362
+		if err != nil {
1363
+			fmt.Println(err.Error())
1364
+			return err.Error(), ""
1365
+		}
1366
+		str := string(respBytes)
1367
+		fmt.Println(str)
1368
+		mjson, _ := json.Marshal(inputMessage)
1369
+		str2 := string(mjson)
1370
+		return str, str2
1188 1371
 
1189
-	client := http.Client{}
1190
-	resp, err := client.Do(request)
1191
-	if err != nil {
1192
-		fmt.Println(err.Error())
1193
-		return err.Error(), ""
1194
-	}
1195
-	respBytes, err := ioutil.ReadAll(resp.Body)
1196
-	if err != nil {
1197
-		fmt.Println(err.Error())
1198
-		return err.Error(), ""
1199 1372
 	}
1200
-	str := string(respBytes)
1201
-	fmt.Println(str)
1202
-	mjson, _ := json.Marshal(inputMessage)
1203
-	str2 := string(mjson)
1204
-	return str, str2
1373
+
1205 1374
 }
1206 1375
 
1207 1376
 //确认订单
@@ -2968,6 +3137,7 @@ func Gdyb90100(psn_no string, org_name string, doctor string, fixmedins_code str
2968 3137
 		fmt.Println(err.Error())
2969 3138
 		return err.Error()
2970 3139
 	}
3140
+
2971 3141
 	reader := bytes.NewReader(bytesData)
2972 3142
 	gdyb_url := beego.AppConfig.String("gdyb_url")
2973 3143
 	gdyb_paasid := beego.AppConfig.String("gdyb_paasid")