test_user преди 1 година
родител
ревизия
fa00503b9a
променени са 9 файла, в които са добавени 2708 реда и са изтрити 70 реда
  1. 8 6
      conf/app.conf
  2. 3 0
      controllers/hb/hbyb_controller.go
  3. 784 30
      controllers/sg/his_api_controller.go
  4. 2 1
      controllers/zh/zh_his_api_controller.go
  5. 1 1
      models/drug.go
  6. 17 13
      service/fj_service.go
  7. 26 17
      service/gdyb_service.go
  8. 7 2
      service/his_service.go
  9. 1860 0
      service/jx_service.go

+ 8 - 6
conf/app.conf Целия файл

@@ -3,11 +3,11 @@ httpport = 9532
3 3
 runmode = prod
4 4
 
5 5
 
6
-#
6
+
7 7
 copyrequestbody = true
8 8
 sessionon = true
9 9
 sessiongcmaxlifetime = 64800
10
-###
10
+
11 11
 tokencookiemaxlifetime = 7200
12 12
 enablexsrf = false
13 13
 xsrfkey = 61oETzKXQAGaYdkL5gEmGeJJFuYh7EQnp2XdTP1o
@@ -45,7 +45,7 @@ appsecret="61ee2e6268497d5aa9de0b0187c39aea"
45 45
 
46 46
 
47 47
 [prod]
48
-org_id = 10191
48
+org_id = 10106
49 49
 mobile_token_expiration_second = 86400
50 50
 httpdomain = https://api.xt.kuyicloud.com
51 51
 sso_domain = https://sso.kuyicloud.com
@@ -53,10 +53,10 @@ call_domain = https://hf.sgjyun.com
53 53
 front_end_domain = "https://xt.kuyicloud.com/#"
54 54
 #url  = "http://192.168.1.228:17001/szsi-portal/transData"
55 55
 #url = "http://192.168.1.88:6666/szsi-portal/transData"
56
-#gdyb_url = "http://igb.hsa.gdgov.cn/ebus/gdyb_api/prd/hsa/hgs/"
56
+gdyb_url = "http://igb.hsa.gdgov.cn/ebus/gdyb_api/prd/hsa/hgs/"
57 57
 #test
58 58
 # gdyb_url = http://10.97.240.206/ebus/gdyb_inf/poc/hsa/hgs/
59
-gdyb_url="http://igb.hsa.gdgov.cn/ebus/sz_prd/hsa/hgs/"
59
+#gdyb_url="http://igb.hsa.gdgov.cn/ebus/sz_prd/hsa/hgs/"
60 60
 #gdyb_url = "http://10.97.240.206/ebus/sztest_hosp/poc/hsa/hgs/"
61 61
 #内蒙古
62 62
 # http://tyjk.nm.hsip.gov.cn:8090/uif-hsaf-med-api/api/medical/service
@@ -70,12 +70,14 @@ gdyb_url="http://igb.hsa.gdgov.cn/ebus/sz_prd/hsa/hgs/"
70 70
 #珠海
71 71
 # gdyb_paasid="zh_prd_yrojyy"
72 72
 #深圳
73
-gdyb_paasid = "sz_prd_yjyy"
73
+#gdyb_paasid = "sz_prd_yjyy"
74 74
 #肇庆
75 75
 #gdyb_paasid = "zq_prd_yjyy"
76 76
 # gdyb_paasid = "sztest_hosp"
77 77
 #广州
78 78
 #gdyb_paasid = "gdyb_inf"
79
+#江西
80
+#gdyb_url = "http://10.77.211.236/CSB/hsa-fsi-"
79 81
 
80 82
 
81 83
 readmysqlhost = shengws1.mysql.rds.aliyuncs.com

+ 3 - 0
controllers/hb/hbyb_controller.go Целия файл

@@ -321,7 +321,10 @@ func (c *HBybController) PostFive() {
321 321
 	fmt.Println(respJSON["dept"].(string))
322 322
 	fmt.Println(respJSON["fixmedins_code"].(string))
323 323
 	fmt.Println(respJSON["dept_code"].(string))
324
+	fmt.Println(respJSON["balance_accounts_type"].(string))
325
+	fmt.Println("1111111")
324 326
 
327
+	fmt.Println(respJSON["opter"].(string))
325 328
 	fmt.Println(respJSON["insuplc_admdvs"].(string))
326 329
 	fmt.Println(respJSON["mdtrtarea_admvs"].(string))
327 330
 	fmt.Println(respJSON["secret_key"].(string))

Файловите разлики са ограничени, защото са твърде много
+ 784 - 30
controllers/sg/his_api_controller.go


+ 2 - 1
controllers/zh/zh_his_api_controller.go Целия файл

@@ -1504,12 +1504,13 @@ func (c *ZHHisApiController) GetZHInHospitalCheck() {
1504 1504
 			struct2401.MdtrtCertType = "02"
1505 1505
 			struct2401.MdtrtCertNo = res2.Output.Baseinfo.Certno
1506 1506
 		}
1507
+		insutype = "310"
1507 1508
 
1508 1509
 		if miConfig.Code == "H15049901371" {
1509 1510
 			if med_type == 14 {
1510 1511
 				if insutype == "390" {
1511 1512
 
1512
-					struct2401.MedType = "9933"
1513
+					struct2401.MedType = "990502"
1513 1514
 
1514 1515
 				} else if insutype == "310" {
1515 1516
 

+ 1 - 1
models/drug.go Целия файл

@@ -64,7 +64,7 @@ type BaseDrugLib struct {
64 64
 	LmtUsedFlag                 int64   `gorm:"column:lmt_used_flag" json:"lmt_used_flag" form:"lmt_used_flag"`
65 65
 
66 66
 	MinNumber int64   `gorm:"column:min_number" json:"min_number" form:"min_number"`
67
-	Dose      float64 `gorm:"column:dose" json:"dose" form:"dose"`
67
+	Dose      string  `gorm:"column:dose" json:"dose" form:"dose"`
68 68
 	DoseUnit  string  `gorm:"column:dose_unit" json:"dose_unit" form:"dose_unit"`
69 69
 	DrugDay   string  `gorm:"column:drug_day" json:"drug_day" form:"drug_day"`
70 70
 	MinPrice  float64 `gorm:"column:min_price" json:"min_price" form:"min_price"`

+ 17 - 13
service/fj_service.go Целия файл

@@ -87,7 +87,7 @@ func FJyb1101(certNo string, org_name string, doctor string, fixmedins_code stri
87 87
 	return output, inputLog, err_msg
88 88
 }
89 89
 
90
-func FJyb1101ForEleToken(certNo string, org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, id_card_type int64, card_sn string, certificates int64, url string, app_id string, app_secret string, sign_key string, enc_key string, token string) (string, string, string) {
90
+func FJyb1101ForEleToken(certNo string, org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, id_card_type int64, card_sn string, certificates int64, url string, app_id string, app_secret string, sign_key string, enc_key string, token string, name string) (string, string, string) {
91 91
 	//生成签名
92 92
 	nonce := GetRandomString(32)
93 93
 	timestamp := time.Now().Unix()
@@ -102,6 +102,7 @@ func FJyb1101ForEleToken(certNo string, org_name string, doctor string, fixmedin
102 102
 		inputData["mdtrt_cert_type"] = "99" // 就诊凭证类型
103 103
 		inputData["certno"] = certNo        // 证件号码
104 104
 		inputData["psn_cert_type"] = "99"   // 人员证件类型
105
+		inputData["psn_name"] = ""          // 人员姓名
105 106
 
106 107
 	} else {
107 108
 		if id_card_type == 1 {
@@ -109,25 +110,27 @@ func FJyb1101ForEleToken(certNo string, org_name string, doctor string, fixmedin
109 110
 			inputData["card_sn"] = card_sn      // 卡识别码
110 111
 			inputData["psn_cert_type"] = ""     // 人员证件类型
111 112
 			inputData["mdtrt_cert_no"] = certNo // 就诊凭证编号
113
+			inputData["psn_name"] = ""          // 人员姓名
112 114
 
113 115
 		} else if id_card_type == 4 {
114 116
 			inputData["mdtrt_cert_type"] = "01" // 就诊凭证类型
115 117
 			inputData["card_sn"] = ""           // 卡识别码
116 118
 			inputData["mdtrt_cert_no"] = token  // 就诊凭证编号
117
-			inputData["psn_cert_type"] = ""     // 人员证件类型
119
+			inputData["psn_cert_type"] = "01"   // 人员证件类型
120
+			inputData["psn_name"] = name        // 人员姓名
118 121
 
119 122
 		} else {
120 123
 			inputData["mdtrt_cert_type"] = "02" // 就诊凭证类型
121 124
 			inputData["card_sn"] = ""           // 卡识别码
122 125
 			inputData["psn_cert_type"] = "01"   // 人员证件类型
123 126
 			inputData["mdtrt_cert_no"] = certNo // 就诊凭证编号
127
+			inputData["psn_name"] = ""          // 人员姓名
124 128
 
125 129
 		}
126 130
 	}
127 131
 	inputData["certno"] = certNo // 证件号码
128 132
 
129 133
 	inputData["begntime"] = "" // 开始时间
130
-	inputData["psn_name"] = "" // 人员姓名
131 134
 	input["data"] = inputData
132 135
 	inputMessage["input"] = input //交易输入
133 136
 
@@ -2683,9 +2686,9 @@ func ReadEleCard(code string) (string, string, string) {
2683 2686
 	DllDef := syscall.MustLoadDLL("chs_fjs_standard.dll")
2684 2687
 	readCard := DllDef.MustFindProc("ec_decode")
2685 2688
 
2686
-	pCardInfo := make([]byte, 8192)
2687
-	pBusiCardInfo := make([]byte, 8192)
2688
-	pErrMsg := make([]byte, 8192)
2689
+	//pCardInfo := make([]byte, 8192)
2690
+	pBusiCardInfo := make([]byte, 2048)
2691
+	pErrMsg := make([]byte, 2048)
2689 2692
 
2690 2693
 	data := make(map[string]interface{})
2691 2694
 
@@ -2694,22 +2697,23 @@ func ReadEleCard(code string) (string, string, string) {
2694 2697
 	inputData["businessType"] = "01101"
2695 2698
 	inputData["operatorId"] = "1"
2696 2699
 	inputData["operatorName"] = "admin"
2697
-	inputData["officeId"] = "001"
2698
-	inputData["officeName"] = "111"
2700
+	inputData["officeId"] = "101"
2701
+	inputData["officeName"] = "xt"
2702
+	inputData["deviceType"] = ""
2703
+
2699 2704
 	data["data"] = inputData
2700 2705
 	data["transType"] = "ec.query"
2701 2706
 	data["orgId"] = code
2702
-	bytesData, _ := json.Marshal(data)
2703
-	pCardInfo = bytesData
2704
-	pCardInfo = []byte(ConvertByte2String(pCardInfo, GB18030))
2705 2707
 
2706
-	ret2, _, _ := readCard.Call((uintptr)(unsafe.Pointer(&pCardInfo[0])), (uintptr)(unsafe.Pointer(&pBusiCardInfo[0])), (uintptr)(unsafe.Pointer(&pErrMsg[0])))
2707
-	fmt.Println(ret2)
2708
+	bytesData, _ := json.Marshal(data)
2709
+	ret2, _, _ := readCard.Call((uintptr)(unsafe.Pointer(&bytesData[0])), (uintptr)(unsafe.Pointer(&pBusiCardInfo[0])), (uintptr)(unsafe.Pointer(&pErrMsg[0])))
2710
+	fmt.Println(ConvertToString(DeleteExtraSpace(string(pErrMsg)), "gbk", "utf-8"))
2708 2711
 	fmt.Println(":", ConvertToString(DeleteExtraSpace(string(bytesData)), "gbk", "utf-8"))
2709 2712
 	fmt.Println(":", ConvertToString(DeleteExtraSpace(string(pBusiCardInfo)), "gbk", "utf-8"))
2710 2713
 	if ret2 != 0 {
2711 2714
 		return "", "", ""
2712 2715
 	}
2716
+	//readCard.Dll.Release()
2713 2717
 	return ConvertToString(DeleteExtraSpace(string(bytesData)), "gbk", "utf-8"), ConvertToString(DeleteExtraSpace(string(pBusiCardInfo)), "gbk", "utf-8"), ConvertToString(DeleteExtraSpace(string(pErrMsg)), "gbk", "utf-8")
2714 2718
 
2715 2719
 }

+ 26 - 17
service/gdyb_service.go Целия файл

@@ -2871,6 +2871,8 @@ type Struct4101 struct {
2871 2871
 	AdmTime        string
2872 2872
 	AdmEndTime     string
2873 2873
 	HisNo          string
2874
+	DoctorName     string
2875
+	DoctorCode     string
2874 2876
 }
2875 2877
 
2876 2878
 //
@@ -2899,19 +2901,26 @@ func Gdyb4101(struct4101 Struct4101, secret_key string, org_name string, doctor
2899 2901
 	inputData["setl_id"] = struct4101.SetlId   // 结算 ID  必填
2900 2902
 	inputData["psn_no"] = struct4101.PsnNo     // 结算 ID  必填
2901 2903
 
2902
-	inputData["fixmedins_name"] = org_name                    // 定点医药机构名称  必填
2903
-	inputData["fixmedins_code"] = fixmedins_code              // 定点医药机构编码  必填
2904
-	inputData["hi_setl_lv"] = ""                              // 医保结算等级
2905
-	inputData["hi_no"] = struct4101.PsnNo                     // 医保编号
2906
-	inputData["medcasno"] = struct4101.PsnNo                  // 病案号  必填
2907
-	inputData["dcla_time"] = year + "-" + month + "-" + day   // 申报时间  必填
2908
-	inputData["psn_name"] = struct4101.PsnName                // 人员姓名  必填
2909
-	inputData["gend"] = struct4101.Gend                       // 性别  必填
2910
-	inputData["brdy"] = struct4101.Brdy                       // 出生日期  必填
2911
-	inputData["age"] = struct4101.Age                         // 年龄  必填
2912
-	inputData["ntly"] = struct4101.Ntly                       // 国籍  必填
2913
-	inputData["nwb_age"] = ""                                 // 年龄  必填
2914
-	inputData["naty"] = struct4101.Naty                       // 民族  必填
2904
+	inputData["fixmedins_name"] = org_name                  // 定点医药机构名称  必填
2905
+	inputData["fixmedins_code"] = fixmedins_code            // 定点医药机构编码  必填
2906
+	inputData["hi_setl_lv"] = ""                            // 医保结算等级
2907
+	inputData["hi_no"] = struct4101.PsnNo                   // 医保编号
2908
+	inputData["medcasno"] = struct4101.PsnNo                // 病案号  必填
2909
+	inputData["dcla_time"] = year + "-" + month + "-" + day // 申报时间  必填
2910
+	inputData["psn_name"] = struct4101.PsnName              // 人员姓名  必填
2911
+	inputData["gend"] = struct4101.Gend                     // 性别  必填
2912
+	inputData["brdy"] = struct4101.Brdy                     // 出生日期  必填
2913
+	inputData["age"] = struct4101.Age                       // 年龄  必填
2914
+	inputData["ntly"] = struct4101.Ntly                     // 国籍  必填
2915
+	inputData["nwb_age"] = ""                               // 年龄  必填
2916
+	inputData["naty"] = struct4101.Naty                     // 民族  必填
2917
+	if org_id == 10138 {
2918
+		inputData["dscg_way"] = "9" // 民族  必填
2919
+
2920
+		inputData["resp_nurs_code"] = "N441623001432" // 民族  必填
2921
+
2922
+	}
2923
+
2915 2924
 	inputData["patn_cert_type"] = struct4101.PatnCertType     // 患者证件类别  必填
2916 2925
 	inputData["certno"] = struct4101.Certno                   // 证件号码  必填
2917 2926
 	inputData["prfs"] = struct4101.Prfs                       // 职业  必填
@@ -2933,8 +2942,8 @@ func Gdyb4101(struct4101 Struct4101, secret_key string, org_name string, doctor
2933 2942
 	inputData["opsp_diag_caty"] = ""                          // 门诊慢特病诊断  必填
2934 2943
 	inputData["opsp_mdtrt_date"] = ""                         // 门诊慢特病就诊日期  必填
2935 2944
 	inputData["ipt_med_type"] = struct4101.IptMedType         // 住院医疗类型  必填
2936
-	inputData["adm_way"] = ""                                 // 入院途径  必填
2937
-	inputData["trt_type"] = ""                                // 治疗类别  必填
2945
+	inputData["adm_way"] = "2"                                // 入院途径  必填
2946
+	inputData["trt_type"] = "1"                               // 治疗类别  必填
2938 2947
 	inputData["adm_time"] = struct4101.AdmTime                // 入院时间  必填
2939 2948
 	inputData["adm_caty"] = struct4101.AdmCaty                // 入院科别  必填
2940 2949
 	inputData["refldept_dept"] = ""                           // 转科科别  必填
@@ -2963,8 +2972,8 @@ func Gdyb4101(struct4101 Struct4101, secret_key string, org_name string, doctor
2963 2972
 	inputData["biz_sn"] = struct4101.BizSn                    // 业务流水号  必填
2964 2973
 	inputData["days_rinp_flag_31"] = ""                       // 出院 31 天内再住院计划标志  必填
2965 2974
 	inputData["days_rinp_pup_31"] = ""                        // 出院 31 天内再住院目的  必填
2966
-	inputData["chfpdr_name"] = ""                             // 主诊医师姓名  必填
2967
-	inputData["chfpdr_code"] = ""                             // 主诊医师代码  必填
2975
+	inputData["chfpdr_name"] = struct4101.DoctorName          // 主诊医师姓名  必填
2976
+	inputData["chfpdr_code"] = struct4101.DoctorCode          // 主诊医师代码  必填
2968 2977
 	inputData["setl_begn_date"] = struct4101.SetlBegnDate     // 结算开始日期  必填
2969 2978
 	inputData["setl_end_date"] = struct4101.SetlEndDate       // 结算结束日期  必填
2970 2979
 	inputData["psn_selfpay"] = struct4101.PsnSelfPay          // 个人自付  必填

+ 7 - 2
service/his_service.go Целия файл

@@ -1036,7 +1036,7 @@ func GetPatientByID(orgID int64, patientID int64) (*models.Patients, error) {
1036 1036
 
1037 1037
 func FindDiagnoseById(id int64) (models.HisXtDiagnoseConfig, error) {
1038 1038
 	dealer := models.HisXtDiagnoseConfig{}
1039
-	err := readDb.Model(&models.HisXtDiagnoseConfig{}).Where("id = ? AND status = 1", id).First(&dealer).Error
1039
+	err := readDb.Model(&models.HisXtDiagnoseConfig{}).Where("id = ?", id).First(&dealer).Error
1040 1040
 	return dealer, err
1041 1041
 }
1042 1042
 
@@ -1299,6 +1299,11 @@ func GetHisPatientByNumber(number string) (his models.HisPatient, err error) {
1299 1299
 	err = readDb.Model(&models.HisPatient{}).Where("number = ? AND status = 1", number).First(&his).Error
1300 1300
 	return
1301 1301
 }
1302
+func GetNewHisPrescriptionByNumber(number string) (pre models.HisPrescription, err error) {
1303
+	err = readDb.Model(&models.HisPrescription{}).Where("batch_number = ? AND status = 1", number).First(&pre).Error
1304
+	return
1305
+
1306
+}
1302 1307
 
1303 1308
 func CreateUploadRecord(result *models.HisFundSettleListResult) (err error) {
1304 1309
 	err = writeDb.Create(&result).Error
@@ -1417,7 +1422,7 @@ func GetPsnByPatientIdTwo(patient_id int64, record_date int64) (psn models.HisPs
1417 1422
 }
1418 1423
 
1419 1424
 func GetAllHisOrder(org_id int64) (his []*models.HisOrder, err error) {
1420
-	err = readDb.Model(&models.HisOrder{}).Where("user_org_id = ?  AND status = 1  AND  order_status = 2 AND setl_id <> ''  AND med_type = '14' AND setl_time >= '2022-05-01 00:00:00' AND setl_time <= '2022-06-01 23:59:59'", org_id).Order("setl_time asc").Find(&his).Error
1425
+	err = readDb.Model(&models.HisOrder{}).Where("user_org_id = ?  AND status = 1  AND  order_status = 2 AND setl_id <> ''  AND med_type = '14' AND setl_time >= '2022-08-01 00:00:00' AND setl_time <= '2022-09-30 23:59:59'", org_id).Order("setl_time asc").Find(&his).Error
1421 1426
 	return
1422 1427
 }
1423 1428
 func GetAllHisOrderErr(org_id int64, stage int64) (his []*models.HisOrderError, err error) {

Файловите разлики са ограничени, защото са твърде много
+ 1860 - 0
service/jx_service.go