|
@@ -14,7 +14,7 @@ import (
|
14
|
14
|
"fmt"
|
15
|
15
|
//"github.com/tjfoc/gmsm/sm2"
|
16
|
16
|
//"github.com/tjfoc/gmsm/sm3"
|
17
|
|
-
|
|
17
|
+ "github.com/go-ole/go-ole"
|
18
|
18
|
"gdyb/controllers"
|
19
|
19
|
"gdyb/enums"
|
20
|
20
|
"gdyb/models"
|
|
@@ -2525,10 +2525,11 @@ func (c *HisApiController) GetCFYLJG001() {
|
2525
|
2525
|
flow.OriginalRxFile = ""
|
2526
|
2526
|
flow.OriginalValue = ""
|
2527
|
2527
|
flow.SignCertDn = ""
|
|
2528
|
+ flow.UserOrgId = 10454
|
2528
|
2529
|
flow.SignCertSn = ""
|
2529
|
2530
|
flow.Mtime = time.Now().Unix()
|
2530
|
|
- flow.ID = 0
|
2531
|
|
- service.Createflow(flow)
|
|
2531
|
+
|
|
2532
|
+ service.Createflow(&flow)
|
2532
|
2533
|
c.ServeSuccessJSON(map[string]interface{}{
|
2533
|
2534
|
"msg": "上传成功",
|
2534
|
2535
|
})
|
|
@@ -2537,14 +2538,18 @@ func (c *HisApiController) GetCFYLJG001() {
|
2537
|
2538
|
}
|
2538
|
2539
|
func (c *HisApiController) GetCFYLJG002() {
|
2539
|
2540
|
admin_user_id, _ := c.GetInt64("admin_user_id")
|
2540
|
|
-
|
2541
|
|
- id, _ := c.GetInt64("id")
|
|
2541
|
+ his_patient_id, _ := c.GetInt64("his_patient_id")
|
|
2542
|
+ record_time := c.GetString("record_time")
|
|
2543
|
+ admin_user_id = 3626
|
|
2544
|
+ his, _ := service.GetHisPatientRecord(c.GetAdminUserInfo().CurrentOrgId, his_patient_id)
|
|
2545
|
+ //id, _ := c.GetInt64("id")
|
2542
|
2546
|
admin_user_id = 3626
|
2543
|
2547
|
curRoles, _ := service.GetAdminUserInfoByID(c.GetAdminUserInfo().CurrentOrgId, admin_user_id)
|
2544
|
2548
|
miConfig, _ := service.FindMedicalInsuranceInfo(c.GetAdminUserInfo().CurrentOrgId)
|
2545
|
|
- flow, _ := service.Getflow(id)
|
2546
|
|
- his, _ := service.GetHisPatientByNumber(flow.MID)
|
2547
|
|
- record_time := c.GetString("record_time")
|
|
2549
|
+
|
|
2550
|
+ flow, _ := service.Getflowtwo(his.Number)
|
|
2551
|
+ //his, _ := service.GetHisPatientByNumber(flow.MID)
|
|
2552
|
+ //record_time := c.GetString("record_time")
|
2548
|
2553
|
patient_id, _ := c.GetInt64("patient_id")
|
2549
|
2554
|
//patient_id = 23834
|
2550
|
2555
|
//record_time = "2023-09-18"
|
|
@@ -2640,15 +2645,17 @@ func (c *HisApiController) GetCFYLJG002() {
|
2640
|
2645
|
}
|
2641
|
2646
|
func (c *HisApiController) GetCFYLJG003() {
|
2642
|
2647
|
admin_user_id, _ := c.GetInt64("admin_user_id")
|
2643
|
|
-
|
2644
|
|
- id, _ := c.GetInt64("id")
|
|
2648
|
+ his_patient_id, _ := c.GetInt64("his_patient_id")
|
|
2649
|
+ record_time := c.GetString("record_time")
|
|
2650
|
+ admin_user_id = 3626
|
|
2651
|
+ his, _ := service.GetHisPatientRecord(c.GetAdminUserInfo().CurrentOrgId, his_patient_id)
|
|
2652
|
+ //id, _ := c.GetInt64("id")
|
2645
|
2653
|
admin_user_id = 3626
|
2646
|
|
- //id = 3
|
2647
|
2654
|
curRoles, _ := service.GetAdminUserInfoByID(c.GetAdminUserInfo().CurrentOrgId, admin_user_id)
|
2648
|
2655
|
miConfig, _ := service.FindMedicalInsuranceInfo(c.GetAdminUserInfo().CurrentOrgId)
|
2649
|
|
- flow, _ := service.Getflow(id)
|
2650
|
|
- his, _ := service.GetHisPatientByNumber(flow.MID)
|
2651
|
|
- record_time := c.GetString("record_time")
|
|
2656
|
+
|
|
2657
|
+ flow, _ := service.Getflowtwo(his.Number)
|
|
2658
|
+ //id = 3
|
2652
|
2659
|
patient_id, _ := c.GetInt64("patient_id")
|
2653
|
2660
|
//patient_id = 23834
|
2654
|
2661
|
//record_time = "2023-09-18"
|
|
@@ -2728,15 +2735,17 @@ func (c *HisApiController) GetCFYLJG003() {
|
2728
|
2735
|
}
|
2729
|
2736
|
func (c *HisApiController) GetCFYLJG004() {
|
2730
|
2737
|
admin_user_id, _ := c.GetInt64("admin_user_id")
|
2731
|
|
-
|
2732
|
|
- id, _ := c.GetInt64("id")
|
|
2738
|
+ his_patient_id, _ := c.GetInt64("his_patient_id")
|
|
2739
|
+ record_time := c.GetString("record_time")
|
|
2740
|
+ admin_user_id = 3626
|
|
2741
|
+ his, _ := service.GetHisPatientRecord(c.GetAdminUserInfo().CurrentOrgId, his_patient_id)
|
|
2742
|
+ //id, _ := c.GetInt64("id")
|
2733
|
2743
|
admin_user_id = 3626
|
2734
|
|
- //id = 3
|
2735
|
2744
|
curRoles, _ := service.GetAdminUserInfoByID(c.GetAdminUserInfo().CurrentOrgId, admin_user_id)
|
2736
|
2745
|
miConfig, _ := service.FindMedicalInsuranceInfo(c.GetAdminUserInfo().CurrentOrgId)
|
2737
|
|
- flow, _ := service.Getflow(id)
|
2738
|
|
- //his, _ := service.GetHisPatientByNumber(flow.MID)
|
2739
|
|
- record_time := c.GetString("record_time")
|
|
2746
|
+
|
|
2747
|
+ flow, _ := service.Getflowtwo(his.Number)
|
|
2748
|
+ //id = 3
|
2740
|
2749
|
patient_id, _ := c.GetInt64("patient_id")
|
2741
|
2750
|
//patient_id = 23834
|
2742
|
2751
|
//record_time = "2023-09-18"
|
|
@@ -2793,19 +2802,26 @@ func (c *HisApiController) GetCFYLJG004() {
|
2793
|
2802
|
}
|
2794
|
2803
|
func (c *HisApiController) GetCFYLJG005() {
|
2795
|
2804
|
admin_user_id, _ := c.GetInt64("admin_user_id")
|
|
2805
|
+ his_patient_id, _ := c.GetInt64("his_patient_id")
|
|
2806
|
+ //record_time := c.GetString("record_time")
|
|
2807
|
+ admin_user_id = 3626
|
|
2808
|
+ his, _ := service.GetHisPatientRecord(c.GetAdminUserInfo().CurrentOrgId, his_patient_id)
|
|
2809
|
+ //id, _ := c.GetInt64("id")
|
|
2810
|
+ admin_user_id = 3626
|
2796
|
2811
|
curRoles, _ := service.GetAdminUserInfoByID(c.GetAdminUserInfo().CurrentOrgId, admin_user_id)
|
2797
|
2812
|
miConfig, _ := service.FindMedicalInsuranceInfo(c.GetAdminUserInfo().CurrentOrgId)
|
|
2813
|
+
|
|
2814
|
+ flow, _ := service.Getflowtwo(his.Number)
|
|
2815
|
+ //id = 3
|
2798
|
2816
|
var cFYLJG005 models.CFYLJG005
|
2799
|
|
- id, _ := c.GetInt64("id")
|
2800
|
|
- patient_id, _ := c.GetInt64("patient_id")
|
2801
|
|
- patient, _ := service.GetPatientByID(c.GetAdminUserInfo().CurrentOrgId, patient_id)
|
2802
|
|
- flow, _ := service.Getflow(id)
|
|
2817
|
+
|
|
2818
|
+ //patient_id, _ := c.GetInt64("patient_id")
|
2803
|
2819
|
cFYLJG005.HiRxno = flow.HiRxno
|
2804
|
2820
|
cFYLJG005.MdtrtID = flow.MID
|
2805
|
2821
|
cFYLJG005.EcToken = ""
|
2806
|
|
- cFYLJG005.PsnName = patient.Name
|
|
2822
|
+ cFYLJG005.PsnName = his.Name
|
2807
|
2823
|
cFYLJG005.PsnCertType = "01"
|
2808
|
|
- cFYLJG005.Certno = patient.IdCardNo
|
|
2824
|
+ cFYLJG005.Certno = his.IdCardNo
|
2809
|
2825
|
result, request := service.GetCFYLJG005(miConfig.OrgName, curRoles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, cFYLJG005)
|
2810
|
2826
|
saveLog(result, request, "GetCFYLJG005", "GetCFYLJG005")
|
2811
|
2827
|
|
|
@@ -2837,13 +2853,19 @@ func (c *HisApiController) GetCFYLJG005() {
|
2837
|
2853
|
}
|
2838
|
2854
|
func (c *HisApiController) GetCFYLJG006() {
|
2839
|
2855
|
admin_user_id, _ := c.GetInt64("admin_user_id")
|
|
2856
|
+ his_patient_id, _ := c.GetInt64("his_patient_id")
|
|
2857
|
+ admin_user_id = 3626
|
|
2858
|
+ his, _ := service.GetHisPatientRecord(c.GetAdminUserInfo().CurrentOrgId, his_patient_id)
|
|
2859
|
+ //id, _ := c.GetInt64("id")
|
|
2860
|
+ admin_user_id = 3626
|
2840
|
2861
|
curRoles, _ := service.GetAdminUserInfoByID(c.GetAdminUserInfo().CurrentOrgId, admin_user_id)
|
2841
|
2862
|
miConfig, _ := service.FindMedicalInsuranceInfo(c.GetAdminUserInfo().CurrentOrgId)
|
2842
|
|
- var cFYLJG006 models.CFYLJG006
|
2843
|
|
- id, _ := c.GetInt64("id")
|
|
2863
|
+
|
|
2864
|
+ flow, _ := service.Getflowtwo(his.Number)
|
|
2865
|
+ //id = 3
|
2844
|
2866
|
patient_id, _ := c.GetInt64("patient_id")
|
|
2867
|
+ var cFYLJG006 models.CFYLJG006
|
2845
|
2868
|
patient, _ := service.GetPatientByID(c.GetAdminUserInfo().CurrentOrgId, patient_id)
|
2846
|
|
- flow, _ := service.Getflow(id)
|
2847
|
2869
|
cFYLJG006.HiRxno = flow.HiRxno
|
2848
|
2870
|
cFYLJG006.MdtrtID = flow.MID
|
2849
|
2871
|
cFYLJG006.PsnName = patient.Name
|
|
@@ -2851,19 +2873,48 @@ func (c *HisApiController) GetCFYLJG006() {
|
2851
|
2873
|
cFYLJG006.Certno = patient.IdCardNo
|
2852
|
2874
|
result, request := service.GetCFYLJG006(miConfig.OrgName, curRoles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, cFYLJG006)
|
2853
|
2875
|
saveLog(result, request, "GetCFYLJG006", "GetCFYLJG006")
|
2854
|
|
-
|
|
2876
|
+ var res ResultCFYLJG006
|
|
2877
|
+ var respJSON2 map[string]interface{}
|
|
2878
|
+ if err := json.Unmarshal([]byte(string(result)), &respJSON2); err != nil {
|
|
2879
|
+ utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
|
|
2880
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
2881
|
+ return
|
|
2882
|
+ }
|
|
2883
|
+ userJSONBytes2, _ := json.Marshal(respJSON2)
|
|
2884
|
+ if err := json.Unmarshal(userJSONBytes2, &res); err != nil {
|
|
2885
|
+ utils.ErrorLog("解析失败:%v", err)
|
|
2886
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
2887
|
+ return
|
|
2888
|
+ }
|
|
2889
|
+ if res.Infcode == -1 {
|
|
2890
|
+ c.ServeSuccessJSON(map[string]interface{}{
|
|
2891
|
+ "failed_code": -10,
|
|
2892
|
+ "msg": res.ErrMsg,
|
|
2893
|
+ })
|
|
2894
|
+ return
|
|
2895
|
+ } else {
|
|
2896
|
+ c.ServeSuccessJSON(map[string]interface{}{
|
|
2897
|
+ "info": res.Output,
|
|
2898
|
+ })
|
|
2899
|
+ return
|
|
2900
|
+ }
|
2855
|
2901
|
}
|
2856
|
2902
|
func (c *HisApiController) GetCFYLJG007() {
|
2857
|
2903
|
admin_user_id, _ := c.GetInt64("admin_user_id")
|
|
2904
|
+ his_patient_id, _ := c.GetInt64("his_patient_id")
|
|
2905
|
+ admin_user_id = 3626
|
|
2906
|
+ his, _ := service.GetHisPatientRecord(c.GetAdminUserInfo().CurrentOrgId, his_patient_id)
|
|
2907
|
+ //id, _ := c.GetInt64("id")
|
|
2908
|
+ admin_user_id = 3626
|
2858
|
2909
|
curRoles, _ := service.GetAdminUserInfoByID(c.GetAdminUserInfo().CurrentOrgId, admin_user_id)
|
2859
|
2910
|
miConfig, _ := service.FindMedicalInsuranceInfo(c.GetAdminUserInfo().CurrentOrgId)
|
2860
|
|
- var cFYLJG007 models.CFYLJG007
|
2861
|
|
- id, _ := c.GetInt64("id")
|
|
2911
|
+
|
|
2912
|
+ flow, _ := service.Getflowtwo(his.Number)
|
|
2913
|
+ //id = 3
|
2862
|
2914
|
patient_id, _ := c.GetInt64("patient_id")
|
|
2915
|
+ var cFYLJG007 models.CFYLJG007
|
2863
|
2916
|
patient, _ := service.GetPatientByID(c.GetAdminUserInfo().CurrentOrgId, patient_id)
|
2864
|
2917
|
//his, _ := service.GetHisPatient(c.GetAdminUserInfo().CurrentOrgId,patient_id)
|
2865
|
|
- flow, _ := service.Getflow(id)
|
2866
|
|
- his, _ := service.GetHisPatientByNumber(flow.MID)
|
2867
|
2918
|
|
2868
|
2919
|
cFYLJG007.HiRxno = flow.HiRxno
|
2869
|
2920
|
cFYLJG007.MdtrtID = flow.MID
|
|
@@ -2874,7 +2925,7 @@ func (c *HisApiController) GetCFYLJG007() {
|
2874
|
2925
|
result, request := service.GetCFYLJG007(miConfig.OrgName, curRoles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, cFYLJG007)
|
2875
|
2926
|
saveLog(result, request, "GetCFYLJG007", "GetCFYLJG007")
|
2876
|
2927
|
|
2877
|
|
- var res ResultCFYLJG006
|
|
2928
|
+ var res ResultCFYLJG007
|
2878
|
2929
|
var respJSON2 map[string]interface{}
|
2879
|
2930
|
if err := json.Unmarshal([]byte(string(result)), &respJSON2); err != nil {
|
2880
|
2931
|
utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
|
|
@@ -2895,7 +2946,7 @@ func (c *HisApiController) GetCFYLJG007() {
|
2895
|
2946
|
return
|
2896
|
2947
|
} else {
|
2897
|
2948
|
c.ServeSuccessJSON(map[string]interface{}{
|
2898
|
|
- "info": res.Output,
|
|
2949
|
+ "info": res,
|
2899
|
2950
|
})
|
2900
|
2951
|
return
|
2901
|
2952
|
}
|
|
@@ -4429,16 +4480,19 @@ func (c *HisApiController) ReadEleToken() {
|
4429
|
4480
|
Idetinfos, _ := json.Marshal(res.Output.Idetinfo)
|
4430
|
4481
|
infoStr := string(Iinfos)
|
4431
|
4482
|
idetinfoStr := string(Idetinfos)
|
|
4483
|
+ //date,age,_ := GetBirthdateAndAge(res.Output.Baseinfo.Certno),
|
|
4484
|
+ b,age, _ := getBirthdateAndAge(res.Output.Baseinfo.Certno)
|
|
4485
|
+
|
4432
|
4486
|
psn := &models.HisPsn{
|
4433
|
4487
|
PsnNo: res.Output.Baseinfo.PsnNo,
|
4434
|
|
-
|
4435
|
4488
|
PatientId: patient.ID,
|
4436
|
4489
|
Certno: res.Output.Baseinfo.Certno,
|
4437
|
|
-
|
4438
|
4490
|
Gend: res.Output.Baseinfo.Gend,
|
4439
|
4491
|
Naty: res.Output.Baseinfo.Naty,
|
4440
|
4492
|
PsnCertType: res.Output.Baseinfo.PsnCertType,
|
4441
|
4493
|
PsnName: res.Output.Baseinfo.PsnName,
|
|
4494
|
+ Age:float64(age),
|
|
4495
|
+ Brdy:b,
|
4442
|
4496
|
Idetinfo: idetinfoStr,
|
4443
|
4497
|
Insuinfo: infoStr,
|
4444
|
4498
|
UserOrgId: c.GetAdminUserInfo().CurrentOrgId,
|
|
@@ -7948,12 +8002,14 @@ func (c *HisApiController) ReadCard() {
|
7948
|
8002
|
Idetinfos, _ := json.Marshal(res.Output.Idetinfo)
|
7949
|
8003
|
infoStr := string(Iinfos)
|
7950
|
8004
|
idetinfoStr := string(Idetinfos)
|
|
8005
|
+ b,age, _ := getBirthdateAndAge(res.Output.Baseinfo.Certno)
|
|
8006
|
+
|
7951
|
8007
|
psn := &models.HisPsn{
|
7952
|
8008
|
PsnNo: res.Output.Baseinfo.PsnNo,
|
7953
|
|
-
|
7954
|
8009
|
PatientId: patient.ID,
|
7955
|
8010
|
Certno: res.Output.Baseinfo.Certno,
|
7956
|
|
-
|
|
8011
|
+ Brdy: b,
|
|
8012
|
+ Age:float64(age),
|
7957
|
8013
|
Gend: res.Output.Baseinfo.Gend,
|
7958
|
8014
|
Naty: res.Output.Baseinfo.Naty,
|
7959
|
8015
|
PsnCertType: res.Output.Baseinfo.PsnCertType,
|
|
@@ -8122,12 +8178,14 @@ func (c *HisApiController) ReadCard() {
|
8122
|
8178
|
Idetinfos, _ := json.Marshal(res.Output.Idetinfo)
|
8123
|
8179
|
infoStr := string(Iinfos)
|
8124
|
8180
|
idetinfoStr := string(Idetinfos)
|
|
8181
|
+ b,age, _ := getBirthdateAndAge(res.Output.Baseinfo.Certno)
|
|
8182
|
+
|
8125
|
8183
|
psn := &models.HisPsn{
|
8126
|
8184
|
PsnNo: res.Output.Baseinfo.PsnNo,
|
8127
|
|
-
|
8128
|
8185
|
PatientId: patient.ID,
|
8129
|
8186
|
Certno: res.Output.Baseinfo.Certno,
|
8130
|
|
- //Brdy: res.Output.Baseinfo.Brdy,
|
|
8187
|
+ Brdy: b,
|
|
8188
|
+ Age:float64(age),
|
8131
|
8189
|
Gend: res.Output.Baseinfo.Gend,
|
8132
|
8190
|
Naty: res.Output.Baseinfo.Naty,
|
8133
|
8191
|
PsnCertType: res.Output.Baseinfo.PsnCertType,
|
|
@@ -9958,11 +10016,14 @@ func (c *HisApiController) ReadCard() {
|
9958
|
10016
|
Idetinfos, _ := json.Marshal(res.Output.Idetinfo)
|
9959
|
10017
|
infoStr := string(Iinfos)
|
9960
|
10018
|
idetinfoStr := string(Idetinfos)
|
|
10019
|
+ b,age, _ := getBirthdateAndAge(res.Output.Baseinfo.Certno)
|
|
10020
|
+
|
9961
|
10021
|
psn := &models.HisPsn{
|
9962
|
10022
|
PsnNo: res.Output.Baseinfo.PsnNo,
|
9963
|
10023
|
PatientId: patient.ID,
|
9964
|
10024
|
Certno: res.Output.Baseinfo.Certno,
|
9965
|
|
-
|
|
10025
|
+ Brdy: b,
|
|
10026
|
+ Age:float64(age),
|
9966
|
10027
|
//Brdy: res.Output.Baseinfo.Brdy,
|
9967
|
10028
|
Gend: res.Output.Baseinfo.Gend,
|
9968
|
10029
|
Naty: res.Output.Baseinfo.Naty,
|
|
@@ -11264,12 +11325,15 @@ func (c *HisApiController) ReadCard() {
|
11264
|
11325
|
Idetinfos, _ := json.Marshal(res.Output.Idetinfo)
|
11265
|
11326
|
infoStr := string(Iinfos)
|
11266
|
11327
|
idetinfoStr := string(Idetinfos)
|
|
11328
|
+
|
|
11329
|
+ b,age, _ := getBirthdateAndAge(res.Output.Baseinfo.Certno)
|
11267
|
11330
|
psn := &models.HisPsn{
|
11268
|
11331
|
PsnNo: res.Output.Baseinfo.PsnNo,
|
11269
|
11332
|
PatientId: patient.ID,
|
11270
|
11333
|
Certno: res.Output.Baseinfo.Certno,
|
11271
|
11334
|
Gend: res.Output.Baseinfo.Gend,
|
11272
|
|
- //Brdy: res.Output.Baseinfo.Brdy,
|
|
11335
|
+ Brdy: b,
|
|
11336
|
+ Age:float64(age),
|
11273
|
11337
|
Naty: res.Output.Baseinfo.Naty,
|
11274
|
11338
|
PsnCertType: res.Output.Baseinfo.PsnCertType,
|
11275
|
11339
|
PsnName: res.Output.Baseinfo.PsnName,
|
|
@@ -17109,6 +17173,12 @@ type ResultCFYLJG007 struct {
|
17109
|
17173
|
InfRefmsgid string `json:"inf_refmsgid"`
|
17110
|
17174
|
Infcode int64 `json:"infcode"`
|
17111
|
17175
|
Output struct {
|
|
17176
|
+ HiRxno string `json:"hi_rxno"`
|
|
17177
|
+ RxStasName string `json:"rx_stas_name"`
|
|
17178
|
+ RxUsedStasCodg string `json:"rx_used_stas_codg"`
|
|
17179
|
+ Seltdelts []interface{} `json:"seltdelts"`
|
|
17180
|
+ RxUsedStasName string `json:"rx_used_stas_name"`
|
|
17181
|
+ RxStasCodg string `json:"rx_stas_codg"`
|
17112
|
17182
|
} `json:"output"`
|
17113
|
17183
|
RefmsgTime string `json:"refmsg_time"`
|
17114
|
17184
|
RespondTime string `json:"respond_time"`
|
|
@@ -17241,7 +17311,7 @@ type ResultCFYLJG005 struct {
|
17241
|
17311
|
SinDosunt string `json:"sin_dosunt"`
|
17242
|
17312
|
UsedFrquCodg string `json:"used_frqu_codg"`
|
17243
|
17313
|
UsedFrquName string `json:"used_frqu_name"`
|
17244
|
|
- DrugTotlcnt float64 `json:"drug_totlcnt"`
|
|
17314
|
+ DrugTotlcnt string `json:"drug_totlcnt"`
|
17245
|
17315
|
DrugTotlcntEmp string `json:"drug_totlcnt_emp"`
|
17246
|
17316
|
DiseCodg string `json:"dise_codg"`
|
17247
|
17317
|
HospApprFlag string `json:"hosp_appr_flag"`
|
|
@@ -21039,6 +21109,8 @@ func (c *HisApiController) GetUploadInfo() {
|
21039
|
21109
|
order.Creator = order.Creator
|
21040
|
21110
|
order.Modify = roles.AdminUserId
|
21041
|
21111
|
order.RequestLog = src_resquest
|
|
21112
|
+ order.FaPiaoNumber = fapiao_number
|
|
21113
|
+ order.FaPiaoCode = fapiao_code
|
21042
|
21114
|
//setlDetail, _ := json.Marshal(res.Output.Setldetail)
|
21043
|
21115
|
//detailStr := string(setlDetail)
|
21044
|
21116
|
//order.SetlDetail = detailStr
|
|
@@ -22117,6 +22189,8 @@ func (c *HisApiController) GetUploadInfo() {
|
22117
|
22189
|
order.Modify = roles.AdminUserId
|
22118
|
22190
|
order.RequestLog = src_resquest
|
22119
|
22191
|
order.Diagnosis = diagnosis_id
|
|
22192
|
+ order.FaPiaoNumber = fapiao_number
|
|
22193
|
+ order.FaPiaoCode = fapiao_code
|
22120
|
22194
|
setlDetail, _ := json.Marshal(res.Output.Setldetail)
|
22121
|
22195
|
detailStr := string(setlDetail)
|
22122
|
22196
|
order.SetlDetail = detailStr
|
|
@@ -33027,3 +33101,37 @@ func RemoveRepeatedPurviewElement2(arr []string) (newArr []string) {
|
33027
|
33101
|
}
|
33028
|
33102
|
return
|
33029
|
33103
|
}
|
|
33104
|
+
|
|
33105
|
+
|
|
33106
|
+func getBirthdateAndAge(idNumber string) (string, int, error) {
|
|
33107
|
+ if len(idNumber) != 18 {
|
|
33108
|
+ return "", 0, fmt.Errorf("invalid ID number length. It should be 18 digits")
|
|
33109
|
+ }
|
|
33110
|
+
|
|
33111
|
+ // 提取出生日期
|
|
33112
|
+ year, err := strconv.Atoi(idNumber[6:10])
|
|
33113
|
+ if err != nil {
|
|
33114
|
+ return "", 0, err
|
|
33115
|
+ }
|
|
33116
|
+ month, err := strconv.Atoi(idNumber[10:12])
|
|
33117
|
+ if err != nil {
|
|
33118
|
+ return "", 0, err
|
|
33119
|
+ }
|
|
33120
|
+ day, err := strconv.Atoi(idNumber[12:14])
|
|
33121
|
+ if err != nil {
|
|
33122
|
+ return "", 0, err
|
|
33123
|
+ }
|
|
33124
|
+
|
|
33125
|
+ // 格式化生日字符串
|
|
33126
|
+ birthdate := time.Date(year, time.Month(month), day, 0, 0, 0, 0, time.UTC)
|
|
33127
|
+ birthdateFormatted := birthdate.Format("2006-01-02")
|
|
33128
|
+
|
|
33129
|
+ // 计算年龄
|
|
33130
|
+ today := time.Now()
|
|
33131
|
+ age := today.Year() - birthdate.Year()
|
|
33132
|
+ if today.YearDay() < birthdate.YearDay() {
|
|
33133
|
+ age--
|
|
33134
|
+ }
|
|
33135
|
+
|
|
33136
|
+ return birthdateFormatted, age, nil
|
|
33137
|
+}
|