张保健 3 years ago
parent
commit
6aa8c9d017

+ 231 - 64
controllers/sync.go View File

@@ -6,7 +6,6 @@ import (
6 6
 	"Data_Upload_Api/service"
7 7
 	"Data_Upload_Api/service/city"
8 8
 	"Data_Upload_Api/utils"
9
-	"fmt"
10 9
 	_ "fmt"
11 10
 	"github.com/astaxie/beego"
12 11
 	_ "github.com/jinzhu/gorm"
@@ -24,6 +23,63 @@ func SyncAPIRegisterRouters() {
24 23
 	beego.Router("/sync/upload/hqyy", &SyncController{}, "get:SyncToHqyy")
25 24
 	beego.Router("/sync/upload/lg2h", &SyncController{}, "get:SyncToLg2h")
26 25
 	beego.Router("/sync/upload/smzy", &SyncController{}, "get:SyncToSmzy")
26
+	beego.Router("/sync/upload/szbl", &SyncController{}, "get:SyncToSzbl")
27
+	beego.Router("/sync/upload/szjk", &SyncController{}, "get:SyncToSzjk")
28
+}
29
+
30
+func (c *SyncController) SyncToSzbl() {
31
+	org := &sz.DataUploadConfig{
32
+		OrgId:          10138,
33
+		ProvinceId:     19,
34
+		CityId:         291,
35
+		DepartmentName: "深圳市百霖血液透析中心",
36
+		HospitalId:     "MA5DB4KB6 ",
37
+		InstType:       1,
38
+		DbHost:         "127.0.0.1",
39
+		DbPort:         "1433",
40
+		DbPass:         "adapter",
41
+		DbUser:         "adapter",
42
+		DbName:         "adapter_2019",
43
+	}
44
+
45
+	// for _, org := range configs {
46
+	// 第二步:跟进配置,创建数据库连接
47
+	if len(org.DbHost) > 0 && len(org.DbUser) > 0 && len(org.DbPort) > 0 && len(org.DbPass) > 0 && len(org.DbName) > 0 {
48
+		orgDb, err := service.CreateSqlServiceDB(org.DbHost, org.DbPort, org.DbUser, org.DbPass, org.DbName)
49
+		if err != nil {
50
+			utils.ErrorLog("创建数据库连接失败:%v", err)
51
+			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
52
+			return
53
+		}
54
+
55
+		// 第三步:开始同步数据
56
+		// 机构人员字典表  t_hd_hospital
57
+		city.SyncTBDICPractitioner(orgDb, org.OrgId, org.HospitalId)
58
+		// 机构床位  t_hd_wm
59
+		city.SyncTMDICTBED(orgDb, org.OrgId, org.HospitalId)
60
+		// 门诊患者信息表
61
+		city.SyncTBMZPatientInformation(orgDb, org.OrgId, org.HospitalId)
62
+		// 挂号表
63
+		city.SyncTBHISMZReg(orgDb, org.OrgId, org.HospitalId)
64
+		// 门诊就诊记录表
65
+		city.SyncTB_YL_MZ_Medical_Record(orgDb, org.OrgId, org.HospitalId)
66
+		// 门诊处方主表
67
+		city.SyncTB_CIS_Prescription(orgDb, org.OrgId, org.HospitalId)
68
+		// 18.	门诊处方明细表
69
+		city.SyncTB_CIS_Prescription_Detail(orgDb, org.OrgId, org.HospitalId)
70
+		// 19.	门诊收费表
71
+		city.SyncTB_HIS_MZ_Charge(orgDb, org.OrgId, org.HospitalId)
72
+		// 20.	门诊收费明细表
73
+		city.SyncTB_HIS_MZ_Fee_Detail(orgDb, org.OrgId, org.HospitalId)
74
+	
75
+		// 第四步:关闭数据库连接
76
+		service.CloseDB(orgDb)
77
+	}
78
+	// }
79
+	c.ServeSuccessJSON(map[string]interface{}{
80
+		"resultList": "12345",
81
+	})
82
+	return
27 83
 }
28 84
 
29 85
 func (c *SyncController) SyncToLg2h() {
@@ -37,7 +93,7 @@ func (c *SyncController) SyncToLg2h() {
37 93
 		ProvinceId:     19,
38 94
 		CityId:         291,
39 95
 		DepartmentName: "深圳市龙岗区第二人民医院",
40
-		HospitalId:     "455835506",
96
+		HospitalId:     "MA5DB4KB6",
41 97
 		InstType:       1,
42 98
 		DbHost:         "183.62.158.36",
43 99
 		DbPort:         "61433",
@@ -55,88 +111,86 @@ func (c *SyncController) SyncToLg2h() {
55 111
 			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
56 112
 			return
57 113
 		}
58
-		fmt.Println("触发了没有22222222")
114
+
59 115
 		// 第三步:开始同步数据
60 116
 		// 同步医院信息  t_hd_hospital
61
-		// city.SyncHospital(orgDb, org.OrgId, org.HospitalId, org.InstType, org.DepartmentName)
62
-		// // 同步水处理器  t_hd_wm
63
-		// city.SyncWMS(orgDb, org.OrgId, org.HospitalId)
64
-		// // // 同步员工 t_hd_staff
65
-		// city.SyncStaff(orgDb, org.OrgId, org.HospitalId)
66
-		// // // 同步病人 t_hd_patient
67
-		// city.SyncPatient(orgDb, org.OrgId, org.HospitalId)
68
-		// // // 同步排班  t_hd_shift
69
-		// city.SyncShift(orgDb, org.OrgId, org.HospitalId)
70
-		// // 同步处方 t_hd_ps
71
-		// city.SyncPs(orgDb, org.OrgId, org.HospitalId)
72
-		// // 同步处方药品 t_hd_ps
73
-		// city.SyncPsMedicine(orgDb, org.OrgId, org.HospitalId)
74
-		// // // 同步转院信息 t_hd_patient_out
75
-		// city.SyncPatientOut(orgDb, org.OrgId, org.HospitalId)
76
-		// // 同步处方信息 t_hd_doctors_advice
77
-		// city.SyncDoctorAdvice(orgDb, org.OrgId, org.HospitalId)
78
-		// // 同步透中信息 t_hd_middle
79
-		// city.SyncMiddle(orgDb, org.OrgId, org.HospitalId)
80
-		// // // 同步设备 t_hd_other_machine
81
-		// city.SyncOtherMachine(orgDb, org.OrgId, org.HospitalId)
82
-		// // // 同步维修 t_hd_maintain
83
-		// city.SyncMachineRepair(orgDb, org.OrgId, org.HospitalId)
84
-		// // // 同步设备 t_hd_dm
85
-		// city.SyncDM(orgDb, org.OrgId, org.HospitalId)
86
-		// // // 同步患者透析记录 t_hd_dialysis
87
-		// city.SyncDialysis(orgDb, org.OrgId, org.HospitalId)
88
-		// // 同步透析床位分区 t_hd_division
89
-		// city.SyncDivision(orgDb, org.OrgId, org.HospitalId)
90
-		// // 患者通路信息表(T_HD_ACCESS)
91
-		// city.SyncAccess(orgDb, org.OrgId, org.HospitalId)
92
-		// // 透析床位表(T_HD_SICKBED)
93
-		// city.SyncSickbed(orgDb, org.OrgId, org.HospitalId)
94
-		// // 患者诊断信息表(T_HD_DIAGNOSIS)
95
-		// city.SyncDiagnosis(orgDb, org.OrgId, org.HospitalId)
96
-		//  患者传染病检查记录表(T_HD_INFECTION
97
-		//city.SyncInfection(orgDb, org.OrgId, org.HospitalId)
98
-		// //  透析并发症记录表(T_HD_COMPLICATION)
99
-		// city.SyncComplication(orgDb, org.OrgId, org.HospitalId)
100
-		// //  血透患者检测结果表(T_HD_LIS_REPORT)
101
-		// city.SyncLisReport(orgDb, org.OrgId, org.HospitalId)
102
-		// //  血透患者检验结果指标表(T_HD_LIS_INDICATORS)
103
-		// city.SyncLisIndicators(orgDb, org.OrgId, org.HospitalId)
104
-
105
-		// 透析机透析液细菌培养检测记录表(t_hd_dm_dialysate_bc)
106
-		// city.SyncLisCulture(orgDb,org.OrgId,org.HospitalId)
107
-		//透析机透析液内毒素检测记录表(T_HD_DM_DIALYSATE_BC)
108
-		// city.SyncDialysate(orgDb,org.OrgId,org.HospitalId)
109
-
110
-		//物表消毒记录表(T_HD_SURFACE_DISINFECT)
111
-		// city.SyncLisBodyDetection(orgDb,org.OrgId,org.HospitalId)
117
+		city.SyncHospital(orgDb, org.OrgId, org.HospitalId, org.InstType, org.DepartmentName)
118
+		// 同步水处理器  t_hd_wm
119
+		city.SyncWMS(orgDb, org.OrgId, org.HospitalId)
120
+		// 同步员工 t_hd_staff
121
+		city.SyncStaff(orgDb, org.OrgId, org.HospitalId)
122
+		// 同步病人 t_hd_patient
123
+		city.SyncPatient(orgDb, org.OrgId, org.HospitalId)
124
+		// 同步排班  t_hd_shift
125
+		city.SyncShift(orgDb, org.OrgId, org.HospitalId)
126
+		// 同步处方 t_hd_ps
127
+		city.SyncPs(orgDb, org.OrgId, org.HospitalId)
128
+		// 同步处方药品 t_hd_ps
129
+		city.SyncPsMedicine(orgDb, org.OrgId, org.HospitalId)
130
+		// 同步转院信息 t_hd_patient_out
131
+		city.SyncPatientOut(orgDb, org.OrgId, org.HospitalId)
132
+		// 同步处方信息 t_hd_doctors_advice
133
+		city.SyncDoctorAdvice(orgDb, org.OrgId, org.HospitalId)
134
+		// 同步透中信息 t_hd_middle
135
+		city.SyncMiddle(orgDb, org.OrgId, org.HospitalId)
136
+		// 同步设备 t_hd_other_machine
137
+		city.SyncOtherMachine(orgDb, org.OrgId, org.HospitalId)
138
+		// 同步维修 t_hd_maintain
139
+		city.SyncMachineRepair(orgDb, org.OrgId, org.HospitalId)
140
+		// 同步设备 t_hd_dm
141
+		city.SyncDM(orgDb, org.OrgId, org.HospitalId)
142
+		// 同步患者透析记录 t_hd_dialysis
143
+		city.SyncDialysis(orgDb, org.OrgId, org.HospitalId)
144
+		// 同步透析床位分区 t_hd_division
145
+		city.SyncDivision(orgDb, org.OrgId, org.HospitalId)
146
+		// 患者通路信息表(T_HD_ACCESS)
147
+		city.SyncAccess(orgDb, org.OrgId, org.HospitalId)
148
+		// 透析床位表(T_HD_SICKBED)
149
+		city.SyncSickbed(orgDb, org.OrgId, org.HospitalId)
150
+		// 患者诊断信息表(T_HD_DIAGNOSIS)
151
+		city.SyncDiagnosis(orgDb, org.OrgId, org.HospitalId)
152
+		// 患者传染病检查记录表(T_HD_INFECTION
153
+		city.SyncInfection(orgDb, org.OrgId, org.HospitalId)
154
+		// 透析并发症记录表(T_HD_COMPLICATION)
155
+		city.SyncComplication(orgDb, org.OrgId, org.HospitalId)
156
+		// 血透患者检测结果表(T_HD_LIS_REPORT)
157
+		city.SyncLisReport(orgDb, org.OrgId, org.HospitalId)
158
+		// // 血透患者检验结果指标表(T_HD_LIS_INDICATORS)
159
+		city.SyncLisIndicators(orgDb, org.OrgId, org.HospitalId)
160
+		// // 透析机透析液细菌培养检测记录表(t_hd_dm_dialysate_bc)
161
+		city.SyncLisCulture(orgDb,org.OrgId,org.HospitalId)
162
+		// 透析机透析液内毒素检测记录表(T_HD_DM_DIALYSATE_BC)
163
+		city.SyncDialysate(orgDb,org.OrgId,org.HospitalId)
164
+		// 物表消毒记录表(T_HD_SURFACE_DISINFECT)
165
+		city.SyncLisBodyDetection(orgDb,org.OrgId,org.HospitalId)
112 166
 		// 第四步:关闭数据库连接
113 167
 
114 168
 		//透析用水游离氯检测表(T_HD_WATER_FC)
115
-		// city.SyncLisWaterFc(orgDb,org.OrgId,org.HospitalId)
169
+		city.SyncLisWaterFc(orgDb,org.OrgId,org.HospitalId)
116 170
 
117 171
 		//透析用水有毒化学物检测表(T_HD_WATER_NC)
118
-		// city.SynLisWaterNc(orgDb,org.OrgId,org.HospitalId)
172
+		city.SynLisWaterNc(orgDb,org.OrgId,org.HospitalId)
119 173
 
120 174
 		//透析用水PH值检测表(T_HD_WATER_PH)
121
-		// city.SynLisWaterPh(orgDb,org.OrgId,org.HospitalId)
175
+		city.SynLisWaterPh(orgDb,org.OrgId,org.HospitalId)
122 176
 
123 177
 		//透析用水水硬度检测表(T_HD_WATER_WH)
124
-		// city.SynListHadWater(orgDb,org.OrgId,org.HospitalId)
178
+		city.SynListHadWater(orgDb,org.OrgId,org.HospitalId)
125 179
 
126 180
 		//导管感染记录表(T_HD_CI)
127
-		// city.SynListHdCi(orgDb,org.OrgId,org.HospitalId)
181
+		city.SynListHdCi(orgDb,org.OrgId,org.HospitalId)
128 182
 
129 183
 		//导管感染转归记录表(T_HD_CI_OUTCOME)
130
-		// city.SynLisHdCiOutCome(orgDb,org.OrgId,org.HospitalId)
184
+		city.SynLisHdCiOutCome(orgDb,org.OrgId,org.HospitalId)
131 185
 
132 186
 		//透析室空气消毒记录表(T_HD_AIR_DISINFECT)
133
-		// city.SyncLisAirDetection(orgDb,org.OrgId,org.HospitalId)
187
+		city.SyncLisAirDetection(orgDb,org.OrgId,org.HospitalId)
134 188
 
135 189
 		//透析用水细菌培养检测表(T_HD_WATER_BC)
136
-		// city.SyncLisWaterBc(orgDb,org.OrgId,org.HospitalId)
190
+		city.SyncLisWaterBc(orgDb,org.OrgId,org.HospitalId)
137 191
 
138
-		//透析用水内毒素检测表(T_HD_WATER_EN)
139
-		// city.SyncLisWaterEn(orgDb,org.OrgId,org.HospitalId)
192
+		// //透析用水内毒素检测表(T_HD_WATER_EN)
193
+		city.SyncLisWaterEn(orgDb,org.OrgId,org.HospitalId)
140 194
 		// 第四步:关闭数据库连接
141 195
 		service.CloseDB(orgDb)
142 196
 	}
@@ -316,3 +370,116 @@ func (c *SyncController) SyncToSmzy() {
316 370
 	})
317 371
 	return
318 372
 }
373
+
374
+
375
+func (c *SyncController) SyncToSzjk() {
376
+	// 第一步:到上报配置表中找到深圳需要上报的机构
377
+	// sz_province, _ := beego.AppConfig.Int64("sz_province")
378
+	// sz_city, _ := beego.AppConfig.Int64("sz_city")
379
+	// configs, _ := service.FindAllDataUploadConfigOrgInfo(sz_province, sz_city, 3)
380
+
381
+	org := &sz.DataUploadConfig{
382
+		OrgId:          10245,
383
+		ProvinceId:     19,
384
+		CityId:         291,
385
+		DepartmentName: "深圳静康医院血液透析中心",
386
+		HospitalId:     "MA5DKWHG3",
387
+		InstType:       1,
388
+		DbHost:         "localhost",
389
+		DbPort:         "1433",
390
+		DbPass:         "Ya2019",
391
+		DbUser:         "sa",
392
+		DbName:         "xtzk",
393
+	}
394
+
395
+	// for _, org := range configs {
396
+	// 第二步:跟进配置,创建数据库连接
397
+	if len(org.DbHost) > 0 && len(org.DbUser) > 0 && len(org.DbPort) > 0 && len(org.DbPass) > 0 && len(org.DbName) > 0 {
398
+		orgDb, err := service.CreateSqlServiceDB(org.DbHost, org.DbPort, org.DbUser, org.DbPass, org.DbName)
399
+		if err != nil {
400
+			utils.ErrorLog("创建数据库连接失败:%v", err)
401
+			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
402
+			return
403
+		}
404
+		// 第三步:开始同步数据
405
+		// 同步医院信息  t_hd_hospital
406
+		city.SyncHospital(orgDb, org.OrgId, org.HospitalId, org.InstType, org.DepartmentName)
407
+		// 同步水处理器  t_hd_wm
408
+		city.SyncWMS(orgDb, org.OrgId, org.HospitalId)
409
+		// // 同步员工 t_hd_staff
410
+		city.SyncStaff(orgDb, org.OrgId, org.HospitalId)
411
+		// // 同步病人 t_hd_patient
412
+		city.SyncPatient(orgDb, org.OrgId, org.HospitalId)
413
+		// // 同步排班  t_hd_shift
414
+		city.SyncShift(orgDb, org.OrgId, org.HospitalId)
415
+		// 同步处方 t_hd_ps
416
+		city.SyncPs(orgDb, org.OrgId, org.HospitalId)
417
+		// 同步处方药品 t_hd_ps
418
+		city.SyncPsMedicine(orgDb, org.OrgId, org.HospitalId)
419
+		// // 同步转院信息 t_hd_patient_out
420
+		city.SyncPatientOut(orgDb, org.OrgId, org.HospitalId)
421
+		// 同步处方信息 t_hd_doctors_advice
422
+		city.SyncDoctorAdvice(orgDb, org.OrgId, org.HospitalId)
423
+		// 同步透中信息 t_hd_middle
424
+		city.SyncMiddle(orgDb, org.OrgId, org.HospitalId)
425
+		// // 同步设备 t_hd_other_machine
426
+		city.SyncOtherMachine(orgDb, org.OrgId, org.HospitalId)
427
+		// // 同步维修 t_hd_maintain
428
+		city.SyncMachineRepair(orgDb, org.OrgId, org.HospitalId)
429
+		// // 同步设备 t_hd_dm
430
+		city.SyncDM(orgDb, org.OrgId, org.HospitalId)
431
+		// // 同步患者透析记录 t_hd_dialysis
432
+		city.SyncDialysis(orgDb, org.OrgId, org.HospitalId)
433
+		// 同步透析床位分区 t_hd_division
434
+		city.SyncDivision(orgDb, org.OrgId, org.HospitalId)
435
+		// 患者通路信息表(T_HD_ACCESS)
436
+		city.SyncAccess(orgDb, org.OrgId, org.HospitalId)
437
+		// 透析床位表(T_HD_SICKBED)
438
+		city.SyncSickbed(orgDb, org.OrgId, org.HospitalId)
439
+		// 患者诊断信息表(T_HD_DIAGNOSIS)
440
+		city.SyncDiagnosis(orgDb, org.OrgId, org.HospitalId)
441
+		//  患者传染病检查记录表(T_HD_INFECTION
442
+		city.SyncInfection(orgDb, org.OrgId, org.HospitalId)
443
+		//  透析并发症记录表(T_HD_COMPLICATION)
444
+		city.SyncComplication(orgDb, org.OrgId, org.HospitalId)
445
+		//  血透患者检测结果表(T_HD_LIS_REPORT)
446
+		city.SyncLisReport(orgDb, org.OrgId, org.HospitalId)
447
+		//  血透患者检验结果指标表(T_HD_LIS_INDICATORS)
448
+		city.SyncLisIndicators(orgDb, org.OrgId, org.HospitalId)
449
+		// 透析机透析液细菌培养检测记录表(t_hd_dm_dialysate_bc)
450
+		city.SyncLisCulture(orgDb,org.OrgId,org.HospitalId)
451
+		//透析机透析液内毒素检测记录表(T_HD_DM_DIALYSATE_BC)
452
+		city.SyncDialysate(orgDb,org.OrgId,org.HospitalId)
453
+		//物表消毒记录表(T_HD_SURFACE_DISINFECT)
454
+		city.SyncLisBodyDetection(orgDb,org.OrgId,org.HospitalId)
455
+		//透析用水游离氯检测表(T_HD_WATER_FC)
456
+		city.SyncLisWaterFc(orgDb,org.OrgId,org.HospitalId)
457
+		//透析用水有毒化学物检测表(T_HD_WATER_NC)
458
+		city.SynLisWaterNc(orgDb,org.OrgId,org.HospitalId)
459
+		//透析用水PH值检测表(T_HD_WATER_PH)
460
+		city.SynLisWaterPh(orgDb,org.OrgId,org.HospitalId)
461
+		//透析用水水硬度检测表(T_HD_WATER_WH)
462
+		city.SynListHadWater(orgDb,org.OrgId,org.HospitalId)
463
+		//导管感染记录表(T_HD_CI)
464
+		city.SynListHdCi(orgDb,org.OrgId,org.HospitalId)
465
+		//导管感染转归记录表(T_HD_CI_OUTCOME)
466
+		city.SynLisHdCiOutCome(orgDb,org.OrgId,org.HospitalId)
467
+		//透析室空气消毒记录表(T_HD_AIR_DISINFECT)
468
+		city.SyncLisAirDetection(orgDb,org.OrgId,org.HospitalId)
469
+		//透析用水细菌培养检测表(T_HD_WATER_BC)
470
+		city.SyncLisWaterBc(orgDb,org.OrgId,org.HospitalId)
471
+		//透析用水内毒素检测表(T_HD_WATER_EN)
472
+		city.SyncLisWaterEn(orgDb,org.OrgId,org.HospitalId)
473
+
474
+		// 第四步:关闭数据库连接
475
+		service.CloseDB(orgDb)
476
+	}
477
+	// }
478
+	c.ServeSuccessJSON(map[string]interface{}{
479
+		"resultList": "12345",
480
+	})
481
+	return
482
+}
483
+
484
+
485
+

+ 454 - 0
models/src_data.go View File

@@ -81,6 +81,58 @@ func (UserAdminRole) TableName() string {
81 81
 	return "sgj_user_admin_role"
82 82
 }
83 83
 
84
+type HisPatient struct {
85
+	ID                     int64   `gorm:"column:id" json:"id" form:"id"`
86
+	BalanceAccountsType    int64   `gorm:"column:balance_accounts_type" json:"balance_accounts_type" form:"balance_accounts_type"`
87
+	MedicalInsuranceNumber string  `gorm:"column:medical_insurance_number" json:"medical_insurance_number" form:"medical_insurance_number"`
88
+	Name                   string  `gorm:"column:name" json:"name" form:"name"`
89
+	Gender                 int64   `gorm:"column:gender" json:"gender" form:"gender"`
90
+	IdType                 int64   `gorm:"column:id_type" json:"id_type" form:"id_type"`
91
+	MedicalTreatmentType   int64   `gorm:"column:medical_treatment_type" json:"medical_treatment_type" form:"medical_treatment_type"`
92
+	Birthday               int64   `gorm:"column:birthday" json:"birthday" form:"birthday"`
93
+	RecordDate             int64   `gorm:"column:record_date" json:"record_date" form:"record_date"`
94
+	Age                    int64   `gorm:"column:age" json:"age" form:"age"`
95
+	PhoneNumber            string  `gorm:"column:phone_number" json:"phone_number" form:"phone_number"`
96
+	IdCardNo               string  `gorm:"column:id_card_no" json:"id_card_no" form:"id_card_no"`
97
+	RegisterType           int64   `gorm:"column:register_type" json:"register_type" form:"register_type"`
98
+	AdminUserId            int64   `gorm:"column:admin_user_id" json:"admin_user_id" form:"admin_user_id"`
99
+	Departments            int64   `gorm:"column:departments" json:"departments" form:"departments"`
100
+	IsNeedCostOfProduction int64   `gorm:"column:is_need_cost_of_production" json:"is_need_cost_of_production" form:"is_need_cost_of_production"`
101
+	RegisterCost           float64 `gorm:"column:register_cost" json:"register_cost" form:"register_cost"`
102
+	TreatmentCost          float64 `gorm:"column:treatment_cost" json:"treatment_cost" form:"treatment_cost"`
103
+	CostOfProduction       float64 `gorm:"column:cost_of_production" json:"cost_of_production" form:"cost_of_production"`
104
+	Total                  float64 `gorm:"column:total" json:"total" form:"total"`
105
+	UserOrgId              int64   `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
106
+	Status                 int64   `gorm:"column:status" json:"status" form:"status"`
107
+	Ctime                  int64   `gorm:"column:ctime" json:"ctime" form:"ctime"`
108
+	Mtime                  int64   `gorm:"column:mtime" json:"mtime" form:"mtime"`
109
+	PatientId              int64   `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
110
+	Number                 string  `gorm:"column:number" json:"number" form:"number"`
111
+	Doctor                 int64   `gorm:"column:doctor" json:"doctor" form:"doctor"`
112
+	IsReturn               int64   `gorm:"column:is_return" json:"is_return" form:"is_return"`
113
+	PsnNo                  string  `gorm:"column:psn_no" json:"psn_no" form:"psn_no"`
114
+	PsnCertType            string  `gorm:"column:psn_cert_type" json:"psn_cert_type" form:"psn_cert_type"`
115
+	Certno                 string  `gorm:"column:certno" json:"certno" form:"certno"`
116
+	PsnName                string  `gorm:"column:psn_name" json:"psn_name" form:"psn_name"`
117
+	Gend                   string  `gorm:"column:gend" json:"gend" form:"gend"`
118
+	Naty                   string  `gorm:"column:naty" json:"naty" form:"naty"`
119
+	Brdy                   string  `gorm:"column:brdy" json:"brdy" form:"brdy"`
120
+	Iinfo                  string  `gorm:"column:iinfo" json:"iinfo" form:"iinfo"`
121
+	Idetinfo               string  `gorm:"column:idetinfo" json:"idetinfo" form:"idetinfo"`
122
+	IptOtpNo               string  `gorm:"column:ipt_otp_no" json:"ipt_otp_no" form:"ipt_otp_no"`
123
+	Phone                  string  `gorm:"column:phone" json:"phone" form:"phone"`
124
+	SocialType             int64   `gorm:"column:social_type" json:"social_type" form:"social_type"`
125
+	YiliaoNumber           string  `gorm:"column:yiliao_number" json:"yiliao_number" form:"yiliao_number"`
126
+	MzNumber               string  `gorm:"column:mz_number" json:"mz_number" form:"mz_number"`
127
+	PatientInfo            string  `gorm:"column:patient_info" json:"patient_info" form:"patient_info"`
128
+	Diagnosis              string   `gorm:"column:diagnosis" json:"diagnosis" form:"diagnosis"`
129
+	SickType               int64   `gorm:"column:sick_type" json:"sick_type" form:"sick_type"`
130
+}
131
+
132
+func (HisPatient) TableName() string {
133
+	return "his_patient"
134
+}
135
+
84 136
 type Patients struct {
85 137
 	ID                           int64                 `gorm:"column:id" json:"id"`
86 138
 	UserOrgId                    int64                 `gorm:"column:user_org_id" json:"user_org_id"`
@@ -1104,3 +1156,405 @@ type XtPatientVascularAccess struct {
1104 1156
 func (XtPatientVascularAccess) TableName() string {
1105 1157
 	return "xt_patient_vascular_access"
1106 1158
 }
1159
+
1160
+type App_Role struct {
1161
+	Id            int64     `gorm:"PRIMARY_KEY;AUTO_INCREMENT" json:"id"`
1162
+	AdminUserId   int64     `gorm:"column:admin_user_id" json:"admin_user_id"`
1163
+	OrgId         int64     `gorm:"column:org_id" json:"org_id"`
1164
+	AppId         int64     `gorm:"column:app_id" json:"app_id"`
1165
+	RoleId        int64     `gorm:"column:role_id" json:"role_id"`
1166
+	Avatar        string    `json:"avatar" json:"avatar"`
1167
+	UserName      string    `gorm:"column:user_name" json:"user_name"`   // 用户名称
1168
+	Intro         string    `json:"intro"`                               // 简介
1169
+	UserType      int8      `gorm:"column:user_type" json:"user_type"`   // 用户类型(1.管理员;2.医生;3.护士;4.运营)
1170
+	UserTitle     int8      `gorm:"column:user_title" json:"user_title"` // 用户职称(1.医士;2.医师;3.住院医师;4.主治医师;5.副主任医师;6.主任医师;7.护士;8.护师;9.主管护师;10.副主任护师;11.主任护师;12.运营专员;13.运营主管)
1171
+	Status        int8      `json:"status"`                              // 状态 0.无效 1.有效
1172
+	CreateTime    int64     `gorm:"column:ctime" json:"ctime"`           // 创建时间
1173
+	ModifyTime    int64     `gorm:"column:mtime" json:"mtime"`           // 修改时间UserTitleName string `gorm:"column:user_title_name" json:"user_title_name" form:"user_title_name"`
1174
+	UserTitleName string    `gorm:"column:user_title_name" json:"user_title_name" form:"user_title_name"`
1175
+	RoleIds       string    `gorm:"column:role_ids" json:"role_ids" form:"role_ids"`
1176
+	IsSubSuperAdmin bool   `gorm:"-" json:"is_sub_super_admin" form:"is_sub_super_admin"`
1177
+	Message         string `gorm:"column:message" json:"message" form:"message"`
1178
+	Sex             int64  `gorm:"column:sex" json:"sex" form:"sex"`
1179
+	Birthday        int64  `gorm:"column:birthday" json:"birthday" form:"birthday"`
1180
+	Sort            int64  `gorm:"column:sort" json:"sort" form:"sort"`
1181
+	IsSort          int64  `gorm:"column:is_sort" json:"is_sort" form:"is_sort"`
1182
+	DepartmentId    int64  `gorm:"column:department_id" json:"department_id" form:"department_id"`
1183
+	Department      string `gorm:"column:department" json:"department" form:"department"`
1184
+
1185
+	Age                                     int64  `gorm:"column:age" json:"age" form:"age"`
1186
+	Nation                                  string `gorm:"column:nation" json:"nation" form:"nation"`
1187
+	CardType                                int64  `gorm:"column:card_type" json:"card_type" form:"card_type"`
1188
+	IdCard                                  string `gorm:"column:id_card" json:"id_card" form:"id_card"`
1189
+	Education                               int64  `gorm:"column:education" json:"education" form:"education"`
1190
+	StudyMajorName                          string `gorm:"column:study_major_name" json:"study_major_name" form:"study_major_name"`
1191
+	WorkMajorName                           string `gorm:"column:work_major_name" json:"work_major_name" form:"work_major_name"`
1192
+	RoleType                                int64  `gorm:"column:role_type" json:"role_type" form:"role_type"`
1193
+	MedicalCode                             string `gorm:"column:medical_code" json:"medical_code" form:"medical_code"`
1194
+	DoctorCode                              string `gorm:"column:doctor_code" json:"doctor_code" form:"doctor_code"`
1195
+	Licensing                               int64  `gorm:"column:licensing" json:"licensing" form:"licensing"`
1196
+	JobNumber                               string `gorm:"column:job_number" json:"job_number" form:"job_number"`
1197
+	PrescriptionQualificationIdentification int64  `gorm:"column:prescription_qualification_identification" json:"prescription_qualification_identification" form:"prescription_qualification_identification"`
1198
+	IdentificationOutpatients               int64  `gorm:"column:identification_outpatients" json:"identification_outpatients" form:"identification_outpatients"`
1199
+	StartTime                               int64  `gorm:"column:start_time" json:"start_time" form:"start_time"`
1200
+	MedicalRangeCode                        int64  `gorm:"column:medical_range_code" json:"medical_range_code" form:"medical_range_code"`
1201
+	MedicalLevel                            int64  `gorm:"column:medical_level" json:"medical_level" form:"medical_level"`
1202
+	MedicalTypeJob                          int64  `gorm:"column:medical_type_job" json:"medical_type_job" form:"medical_type_job"`
1203
+	PharmacistRegistrationNumber            string `gorm:"column:pharmacist_registration_number" json:"pharmacist_registration_number" form:"pharmacist_registration_number"`
1204
+	DoctorRangeCode                         int64  `gorm:"column:doctor_range_code" json:"doctor_range_code" form:"doctor_range_code"`
1205
+	DoctorLevel                             int64  `gorm:"column:doctor_level" json:"doctor_level" form:"doctor_level"`
1206
+	DoctorTypeJob                           int64  `gorm:"column:doctor_type_job" json:"doctor_type_job" form:"doctor_type_job"`
1207
+	DoctorNumber                            string `gorm:"column:doctor_number" json:"doctor_number" form:"doctor_number"`
1208
+	OutpatientIllnesscategory               string `gorm:"column:outpatient_illness_category" json:"outpatient_illness_category" form:"outpatient_illness_category"`
1209
+	IsActive                                int64  `gorm:"column:is_active" json:"is_active" form:"is_active"`
1210
+	ActiveStatus                            int64  `gorm:"column:active_status" json:"active_status" form:"active_status"`
1211
+}
1212
+
1213
+func (App_Role) TableName() string {
1214
+	return "sgj_user_admin_role"
1215
+}
1216
+
1217
+
1218
+type HisPrescriptionInfo struct {
1219
+	ID                 int64           `gorm:"column:id" json:"id" form:"id"`
1220
+	UserOrgId          int64           `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
1221
+	RecordDate         int64           `gorm:"column:record_date" json:"record_date" form:"record_date"`
1222
+	PatientId          int64           `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
1223
+	HisPatientId       int64           `gorm:"column:his_patient_id" json:"his_patient_id" form:"his_patient_id"`
1224
+	Status             int64           `gorm:"column:status" json:"status" form:"status"`
1225
+	Ctime              int64           `gorm:"column:ctime" json:"ctime" form:"ctime"`
1226
+	Mtime              int64           `gorm:"column:mtime" json:"mtime" form:"mtime"`
1227
+	Creator            int64           `gorm:"column:creator" json:"creator" form:"creator"`
1228
+	Modifier           int64           `gorm:"column:modifier" json:"modifier" form:"modifier"`
1229
+	Diagnosis          int64           `gorm:"column:diagnosis" json:"diagnosis" form:"diagnosis"`
1230
+	RegisterType       int64           `gorm:"column:register_type" json:"register_type" form:"register_type"`
1231
+	Doctor             string          `gorm:"column:doctor" json:"doctor" form:"doctor"`
1232
+	Departments        int64           `gorm:"column:departments" json:"departments" form:"departments"`
1233
+	SickHistory        string          `gorm:"column:sick_history" json:"sick_history" form:"sick_history"`
1234
+	PrescriptionNumber string          `gorm:"column:prescription_number" json:"prescription_number" form:"prescription_number"`
1235
+	PrescriptionStatus int64           `gorm:"column:prescription_status" json:"prescription_status" form:"prescription_status"`
1236
+	BatchNumber        string          `gorm:"column:batch_number" json:"batch_number" form:"batch_number"`
1237
+	DoctorId           int64           `gorm:"column:doctor_id" json:"doctor_id" form:"doctor_id"`
1238
+	SickType           int64           `gorm:"column:sick_type" json:"sick_type" form:"sick_type"`
1239
+}
1240
+
1241
+func (HisPrescriptionInfo) TableName() string {
1242
+	return "his_prescription_info"
1243
+}
1244
+
1245
+type HisPrescription struct {
1246
+	ID                     int64                     `gorm:"column:id" json:"id" form:"id"`
1247
+	UserOrgId              int64                     `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
1248
+	RecordDate             int64                     `gorm:"column:record_date" json:"record_date" form:"record_date"`
1249
+	PatientId              int64                     `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
1250
+	HisPatientId           int64                     `gorm:"column:his_patient_id" json:"his_patient_id" form:"his_patient_id"`
1251
+	Status                 int64                     `gorm:"column:status" json:"status" form:"status"`
1252
+	Ctime                  int64                     `gorm:"column:ctime" json:"ctime" form:"ctime"`
1253
+	Mtime                  int64                     `gorm:"column:mtime" json:"mtime" form:"mtime"`
1254
+	Number                 string                    `gorm:"column:number" json:"number" form:"number"`
1255
+	Type                   int64                     `gorm:"column:type" json:"type" form:"type"`
1256
+	Doctor                 string                    `gorm:"column:doctor" json:"doctor" form:"doctor"`
1257
+	Creator                int64                     `gorm:"column:creator" json:"creator" form:"creator"`
1258
+	Modifier               int64                     `gorm:"column:modifier" json:"modifier" form:"modifier"`
1259
+	OrderStatus            int64                     `gorm:"column:order_status" json:"order_status" form:"order_status"`
1260
+	BatchNumber            string                    `gorm:"column:batch_number" json:"batch_number" form:"batch_number"`
1261
+	PrescriptionNumber     string                    `gorm:"column:prescription_number" json:"prescription_number" form:"prescription_number"`
1262
+}
1263
+
1264
+func (HisPrescription) TableName() string {
1265
+	return "his_prescription"
1266
+}
1267
+
1268
+type HisDoctorAdviceInfo struct {
1269
+	ID                    int64       `gorm:"column:id" json:"id" form:"id"`
1270
+	UserOrgId             int64       `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
1271
+	PatientId             int64       `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
1272
+	HisPatientId          int64       `gorm:"column:his_patient_id" json:"his_patient_id" form:"his_patient_id"`
1273
+	AdviceType            int64       `gorm:"column:advice_type" json:"advice_type" form:"advice_type"`
1274
+	AdviceDate            int64       `gorm:"column:advice_date" json:"advice_date" form:"advice_date"`
1275
+	StartTime             int64       `gorm:"column:start_time" json:"start_time" form:"start_time"`
1276
+	AdviceName            string      `gorm:"column:advice_name" json:"advice_name" form:"advice_name"`
1277
+	AdviceDesc            string      `gorm:"column:advice_desc" json:"advice_desc" form:"advice_desc"`
1278
+	ReminderDate          int64       `gorm:"column:reminder_date" json:"reminder_date" form:"reminder_date"`
1279
+	SingleDose            float64     `gorm:"column:single_dose" json:"single_dose" form:"single_dose"`
1280
+	SingleDoseUnit        string      `gorm:"column:single_dose_unit" json:"single_dose_unit" form:"single_dose_unit"`
1281
+	PrescribingNumber     float64     `gorm:"column:prescribing_number" json:"prescribing_number" form:"prescribing_number"`
1282
+	PrescribingNumberUnit string      `gorm:"column:prescribing_number_unit" json:"prescribing_number_unit" form:"prescribing_number_unit"`
1283
+	DeliveryWay           string      `gorm:"column:delivery_way" json:"delivery_way" form:"delivery_way"`
1284
+	ExecutionFrequency    string      `gorm:"column:execution_frequency" json:"execution_frequency" form:"execution_frequency"`
1285
+	AdviceDoctor          int64       `gorm:"column:advice_doctor" json:"advice_doctor" form:"advice_doctor"`
1286
+	Status                int64       `gorm:"column:status" json:"status" form:"status"`
1287
+	CreatedTime           int64       `gorm:"column:created_time" json:"created_time" form:"created_time"`
1288
+	UpdatedTime           int64       `gorm:"column:updated_time" json:"updated_time" form:"updated_time"`
1289
+	AdviceAffirm          string      `gorm:"column:advice_affirm" json:"advice_affirm" form:"advice_affirm"`
1290
+	Remark                string      `gorm:"column:remark" json:"remark" form:"remark"`
1291
+	StopTime              int64       `gorm:"column:stop_time" json:"stop_time" form:"stop_time"`
1292
+	StopReason            string      `gorm:"column:stop_reason" json:"stop_reason" form:"stop_reason"`
1293
+	StopDoctor            int64       `gorm:"column:stop_doctor" json:"stop_doctor" form:"stop_doctor"`
1294
+	StopState             int64       `gorm:"column:stop_state" json:"stop_state" form:"stop_state"`
1295
+	ParentId              int64       `gorm:"column:parent_id" json:"parent_id" form:"parent_id"`
1296
+	ExecutionTime         int64       `gorm:"column:execution_time" json:"execution_time" form:"execution_time"`
1297
+	ExecutionStaff        int64       `gorm:"column:execution_staff" json:"execution_staff" form:"execution_staff"`
1298
+	ExecutionState        int64       `gorm:"column:execution_state" json:"execution_state" form:"execution_state"`
1299
+	Checker               int64       `gorm:"column:checker" json:"checker" form:"checker"`
1300
+	RecordDate            int64       `gorm:"column:record_date" json:"record_date" form:"record_date"`
1301
+	DialysisOrderId       int64       `gorm:"column:dialysis_order_id" json:"dialysis_order_id" form:"dialysis_order_id"`
1302
+	CheckTime             int64       `gorm:"column:check_time" json:"check_time" form:"check_time"`
1303
+	CheckState            int64       `gorm:"column:check_state" json:"check_state" form:"check_state"`
1304
+	DrugSpec              float64     `gorm:"column:drug_spec" json:"drug_spec" form:"drug_spec"`
1305
+	DrugSpecUnit          string      `gorm:"column:drug_spec_unit" json:"drug_spec_unit" form:"drug_spec_unit"`
1306
+	Groupno               int64       `gorm:"column:groupno" json:"groupno" form:"groupno"`
1307
+	RemindType            int64       `gorm:"column:remind_type" json:"remind_type" form:"remind_type"`
1308
+	FrequencyType         int64       `gorm:"column:frequency_type" json:"frequency_type" form:"frequency_type"`
1309
+	DayCount              int64       `gorm:"column:day_count" json:"day_count" form:"day_count"`
1310
+	WeekDay               string      `gorm:"column:week_day" json:"week_day" form:"week_day"`
1311
+	TemplateId            string      `gorm:"column:template_id" json:"template_id" form:"template_id"`
1312
+	Modifier              int64       `gorm:"column:modifier" json:"modifier" form:"modifier"`
1313
+	DrugId                int64       `gorm:"column:drug_id" json:"drug_id" form:"drug_id"`
1314
+	Price                 float64     `gorm:"column:price" json:"price" form:"price"`
1315
+	PrescriptionId        int64       `gorm:"column:prescription_id" json:"prescription_id" form:"prescription_id"`
1316
+	MedListCodg           string      `gorm:"column:med_list_codg" json:"med_list_codg" form:"med_list_codg"`
1317
+	FeedetlSn             string      `gorm:"column:feedetl_sn" json:"feedetl_sn" form:"feedetl_sn"`
1318
+	Day                   int64       `gorm:"column:day" json:"day" form:"day"`
1319
+	BaseDrugLib           BaseDrugLib `gorm:"ForeignKey:DrugId;AssociationForeignKey:ID" json:"drug"`
1320
+}
1321
+
1322
+func (HisDoctorAdviceInfo) TableName() string {
1323
+	return "his_doctor_advice_info"
1324
+}
1325
+
1326
+type BaseDrugLib struct {
1327
+	ID                          int64   `gorm:"column:id" json:"id" form:"id"`
1328
+	DrugName                    string  `gorm:"column:drug_name" json:"drug_name" form:"drug_name"`
1329
+	Pinyin                      string  `gorm:"column:pinyin" json:"pinyin" form:"pinyin"`
1330
+	Wubi                        string  `gorm:"column:wubi" json:"wubi" form:"wubi"`
1331
+	DrugAlias                   string  `gorm:"column:drug_alias" json:"drug_alias" form:"drug_alias"`
1332
+	DrugAliasPinyin             string  `gorm:"column:drug_alias_pinyin" json:"drug_alias_pinyin" form:"drug_alias_pinyin"`
1333
+	DrugAliasWubi               string  `gorm:"column:drug_alias_wubi" json:"drug_alias_wubi" form:"drug_alias_wubi"`
1334
+	DrugCategory                int64   `gorm:"column:drug_category" json:"drug_category" form:"drug_category"`
1335
+	DrugSpec                    string  `gorm:"column:drug_spec" json:"drug_spec" form:"drug_spec"`
1336
+	DrugType                    int64   `gorm:"column:drug_type" json:"drug_type" form:"drug_type"`
1337
+	DrugStockLimit              string  `gorm:"column:drug_stock_limit" json:"drug_stock_limit" form:"drug_stock_limit"`
1338
+	DrugOriginPlace             string  `gorm:"column:drug_origin_place" json:"drug_origin_place" form:"drug_origin_place"`
1339
+	DrugDosageForm              int64   `gorm:"column:drug_dosage_form" json:"drug_dosage_form" form:"drug_dosage_form"`
1340
+	MedicalInsuranceLevel       int64   `gorm:"column:medical_insurance_level" json:"medical_insurance_level" form:"medical_insurance_level"`
1341
+	MaxUnit                     string  `gorm:"column:max_unit" json:"max_unit" form:"max_unit"`
1342
+	MinUnit                     string  `gorm:"column:min_unit" json:"min_unit" form:"min_unit"`
1343
+	UnitMatrixing               string  `gorm:"column:unit_matrixing" json:"unit_matrixing" form:"unit_matrixing"`
1344
+	RetailPrice                 float64 `gorm:"column:retail_price" json:"retail_price" form:"retail_price"`
1345
+	LastPrice                   float64 `gorm:"column:last_price" json:"last_price" form:"last_price"`
1346
+	DrugControl                 int64   `gorm:"column:drug_control" json:"drug_control" form:"drug_control"`
1347
+	Number                      string  `gorm:"column:number" json:"number" form:"number"`
1348
+	DrugClassify                string  `gorm:"column:drug_classify" json:"drug_classify" form:"drug_classify"`
1349
+	DrugDose                    float64 `gorm:"column:drug_dose" json:"drug_dose" form:"drug_dose"`
1350
+	DrugDoseUnit                int64   `gorm:"column:drug_dose_unit" json:"drug_dose_unit" form:"drug_dose_unit"`
1351
+	MedicalInsuranceNumber      string  `gorm:"column:medical_insurance_number" json:"medical_insurance_number" form:"medical_insurance_number"`
1352
+	Manufacturer                int64   `gorm:"column:manufacturer" json:"manufacturer" form:"manufacturer"`
1353
+	PharmacologyCategory        int64   `gorm:"column:pharmacology_category" json:"pharmacology_category" form:"pharmacology_category"`
1354
+	StatisticsCategory          int64   `gorm:"column:statistics_category" json:"statistics_category" form:"statistics_category"`
1355
+	Code                        string  `gorm:"column:code" json:"code" form:"code"`
1356
+	IsSpecialDiseases           int64   `gorm:"column:is_special_diseases" json:"is_special_diseases" form:"is_special_diseases"`
1357
+	IsRecord                    int64   `gorm:"column:is_record" json:"is_record" form:"is_record"`
1358
+	Agent                       string  `gorm:"column:agent" json:"agent" form:"agent"`
1359
+	DrugStatus                  string  `gorm:"column:drug_status" json:"drug_status" form:"drug_status"`
1360
+	LimitRemark                 string  `gorm:"column:limit_remark" json:"limit_remark" form:"limit_remark"`
1361
+	DeliveryWay                 string  `gorm:"column:delivery_way" json:"delivery_way" form:"delivery_way"`
1362
+	ExecutionFrequency          string  `gorm:"column:execution_frequency" json:"execution_frequency" form:"execution_frequency"`
1363
+	SingleDose                  float64 `gorm:"column:single_dose" json:"single_dose" form:"single_dose"`
1364
+	PrescribingNumber           float64 `gorm:"column:prescribing_number" json:"prescribing_number" form:"prescribing_number"`
1365
+	Label                       int64   `gorm:"column:label" json:"label" form:"label"`
1366
+	Sort                        int64   `gorm:"column:sort" json:"sort" form:"sort"`
1367
+	IsUseDoctorAdvice           int64   `gorm:"column:is_use_doctor_advice" json:"is_use_doctor_advice" form:"is_use_doctor_advice"`
1368
+	IsDefault                   int64   `gorm:"column:is_default" json:"is_default" form:"is_default"`
1369
+	IsChargePredict             int64   `gorm:"column:is_charge_predict" json:"is_charge_predict" form:"is_charge_predict"`
1370
+	IsStatisticsWork            int64   `gorm:"column:is_statistics_work" json:"is_statistics_work" form:"is_statistics_work"`
1371
+	IsChargeUse                 int64   `gorm:"column:is_charge_use" json:"is_charge_use" form:"is_charge_use"`
1372
+	Status                      int64   `gorm:"column:status" json:"status" form:"status"`
1373
+	Ctime                       int64   `gorm:"column:ctime" json:"ctime" form:"ctime"`
1374
+	Mtime                       int64   `gorm:"column:mtime" json:"mtime" form:"mtime"`
1375
+	OrgId                       int64   `gorm:"column:org_id" json:"org_id" form:"org_id"`
1376
+	DrugCode                    string  `gorm:"column:drug_code" json:"drug_code" form:"drug_code"`
1377
+	PrescriptionMark            int64   `gorm:"column:prescription_mark" json:"prescription_mark" form:"prescription_mark"`
1378
+	RecordDate                  int64   `gorm:"column:record_date" json:"record_date" form:"record_date"`
1379
+	DrugRemark                  string  `gorm:"column:drug_remark" json:"drug_remark" form:"drug_remark"`
1380
+	SocialSecurityDirectoryCode string  `gorm:"column:social_security_directory_code" json:"social_security_directory_code" form:"social_security_directory_code"`
1381
+	DoseCode                    string  `gorm:"column:dose_code" json:"dose_code" form:"dose_code"`
1382
+	IsMark                      int64   `gorm:"column:is_mark" json:"is_mark" form:"is_mark"`
1383
+	HospApprFlag                int64   `gorm:"column:hosp_appr_flag" json:"hosp_appr_flag" form:"hosp_appr_flag"`
1384
+	LmtUsedFlag                 int64   `gorm:"column:lmt_used_flag" json:"lmt_used_flag" form:"lmt_used_flag"`
1385
+	//MedicineInsurancePercentage []*MedicineInsurancePercentage `gorm:"ForeignKey:PatientId;AssociationForeignKey:PatientId" json:"monitoring_record"`
1386
+}
1387
+
1388
+func (BaseDrugLib) TableName() string {
1389
+	return "xt_base_drug"
1390
+}
1391
+
1392
+type HisPrescriptionProject struct {
1393
+	ID                 int64      `gorm:"column:id" json:"id" form:"id"`
1394
+	ProjectId          int64      `gorm:"column:project_id" json:"project_id" form:"project_id"`
1395
+	Price              float64    `gorm:"column:price" json:"price" form:"price"`
1396
+	UserOrgId          int64      `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
1397
+	Status             int64      `gorm:"column:status" json:"status" form:"status"`
1398
+	Ctime              int64      `gorm:"column:ctime" json:"ctime" form:"ctime"`
1399
+	Mtime              int64      `gorm:"column:mtime" json:"mtime" form:"mtime"`
1400
+	PatientId          int64      `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
1401
+	HisPatientId       int64      `gorm:"column:his_patient_id" json:"his_patient_id" form:"his_patient_id"`
1402
+	RecordDate         int64      `gorm:"column:record_date" json:"record_date" form:"record_date"`
1403
+	PrescriptionId     int64      `gorm:"column:prescription_id" json:"prescription_id" form:"prescription_id"`
1404
+	Count              int64      `gorm:"column:count" json:"count" form:"count"`
1405
+	FeedetlSn          string     `gorm:"column:feedetl_sn" json:"feedetl_sn" form:"feedetl_sn"`
1406
+	MedListCodg        string     `gorm:"column:med_list_codg" json:"med_list_codg" form:"med_list_codg"`
1407
+	SingleDose         string     `gorm:"column:single_dose" json:"single_dose" form:"single_dose"`
1408
+	DeliveryWay        string     `gorm:"column:delivery_way" json:"delivery_way" form:"delivery_way"`
1409
+	ExecutionFrequency string     `gorm:"column:execution_frequency" json:"execution_frequency" form:"execution_frequency"`
1410
+	Day                string     `gorm:"column:day" json:"day" form:"day"`
1411
+	Remark             string     `gorm:"column:remark" json:"remark" form:"remark"`
1412
+	Unit               string     `gorm:"column:unit" json:"unit" form:"unit"`
1413
+}
1414
+
1415
+func (HisPrescriptionProject) TableName() string {
1416
+	return "his_prescription_project"
1417
+}
1418
+
1419
+type HisOrder struct {
1420
+	ID                    int64     `gorm:"column:id" json:"id" form:"id"`
1421
+	UserOrgId             int64     `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
1422
+	HisPatientId          int64     `gorm:"column:his_patient_id" json:"his_patient_id" form:"his_patient_id"`
1423
+	SettleAccountsDate    int64     `gorm:"column:settle_accounts_date" json:"settle_accounts_date" form:"settle_accounts_date"`
1424
+	Ctime                 int64     `gorm:"column:ctime" json:"ctime" form:"ctime"`
1425
+	Mtime                 int64     `gorm:"column:mtime" json:"mtime" form:"mtime"`
1426
+	Status                int64     `gorm:"column:status" json:"status" form:"status"`
1427
+	Number                string    `gorm:"column:number" json:"number" form:"number"`
1428
+	PatientId             int64     `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
1429
+	Infcode               int64     `gorm:"column:infcode" json:"infcode" form:"infcode"`
1430
+	WarnMsg               string    `gorm:"column:warn_msg" json:"warn_msg" form:"warn_msg"`
1431
+	Cainfo                string    `gorm:"column:cainfo" json:"cainfo" form:"cainfo"`
1432
+	ErrMsg                string    `gorm:"column:err_msg" json:"err_msg" form:"err_msg"`
1433
+	RespondTime           string    `gorm:"column:respond_time" json:"respond_time" form:"respond_time"`
1434
+	InfRefmsgid           string    `gorm:"column:inf_refmsgid" json:"inf_refmsgid" form:"inf_refmsgid"`
1435
+	OrderStatus           int64     `gorm:"column:order_status" json:"order_status" form:"order_status"`
1436
+	MdtrtId               string    `gorm:"column:mdtrt_id" json:"mdtrt_id" form:"mdtrt_id"`
1437
+	SetlId                string    `gorm:"column:setl_id" json:"setl_id" form:"setl_id"`
1438
+	PsnNo                 string    `gorm:"column:psn_no" json:"psn_no" form:"psn_no"`
1439
+	PsnName               string    `gorm:"column:psn_name" json:"psn_name" form:"psn_name"`
1440
+	PsnCertType           string    `gorm:"column:psn_cert_type" json:"psn_cert_type" form:"psn_cert_type"`
1441
+	Certno                string    `gorm:"column:certno" json:"certno" form:"certno"`
1442
+	Gend                  string    `gorm:"column:gend" json:"gend" form:"gend"`
1443
+	Naty                  string    `gorm:"column:naty" json:"naty" form:"naty"`
1444
+	Brdy                  string 	`gorm:"column:brdy" json:"brdy" form:"brdy"`
1445
+	Age                   float64   `gorm:"column:age" json:"age" form:"age"`
1446
+	Insutype              string    `gorm:"column:insutype" json:"insutype" form:"insutype"`
1447
+	PsnType               string    `gorm:"column:psn_type" json:"psn_type" form:"psn_type"`
1448
+	CvlservFlag           string    `gorm:"column:cvlserv_flag" json:"cvlserv_flag" form:"cvlserv_flag"`
1449
+	SetlTime              string    `gorm:"column:setl_time" json:"setl_time" form:"setl_time"`
1450
+	MdtrtCertType         string    `gorm:"column:mdtrt_cert_type" json:"mdtrt_cert_type" form:"mdtrt_cert_type"`
1451
+	MedType               string    `gorm:"column:med_type" json:"med_type" form:"med_type"`
1452
+	MedfeeSumamt          float64   `gorm:"column:medfee_sumamt" json:"medfee_sumamt" form:"medfee_sumamt"`
1453
+	FulamtOwnpayAmt       float64   `gorm:"column:fulamt_ownpay_amt" json:"fulamt_ownpay_amt" form:"fulamt_ownpay_amt"`
1454
+	OverlmtSelfPay        float64   `gorm:"column:overlmt_self_pay" json:"overlmt_self_pay" form:"overlmt_self_pay"`
1455
+	PreselfpayAmt         float64   `gorm:"column:preselfpay_amt" json:"preselfpay_amt" form:"preselfpay_amt"`
1456
+	InscpScpAmt           float64   `gorm:"column:inscp_scp_amt" json:"inscp_scp_amt" form:"inscp_scp_amt"`
1457
+	ActPayDedc            float64   `gorm:"column:act_pay_dedc" json:"act_pay_dedc" form:"act_pay_dedc"`
1458
+	HifpPay               float64   `gorm:"column:hifp_pay" json:"hifp_pay" form:"hifp_pay"`
1459
+	CvlservPay            float64   `gorm:"column:cvlserv_pay" json:"cvlserv_pay" form:"cvlserv_pay"`
1460
+	PoolPropSelfpay       float64   `gorm:"column:pool_prop_selfpay" json:"pool_prop_selfpay" form:"pool_prop_selfpay"`
1461
+	HifesPay              float64   `gorm:"column:hifes_pay" json:"hifes_pay" form:"hifes_pay"`
1462
+	HifmiPay              float64   `gorm:"column:hifmi_pay" json:"hifmi_pay" form:"hifmi_pay"`
1463
+	HifobPay              float64   `gorm:"column:hifob_pay" json:"hifob_pay" form:"hifob_pay"`
1464
+	MafPay                float64   `gorm:"column:maf_pay" json:"maf_pay" form:"maf_pay"`
1465
+	OthPay                float64   `gorm:"column:oth_pay" json:"oth_pay" form:"oth_pay"`
1466
+	FundPaySumamt         float64   `gorm:"column:fund_pay_sumamt" json:"fund_pay_sumamt" form:"fund_pay_sumamt"`
1467
+	PsnPartAmt            float64   `gorm:"column:psn_part_amt" json:"psn_part_amt" form:"psn_part_amt"`
1468
+	AcctPay               float64   `gorm:"column:acct_pay" json:"acct_pay" form:"acct_pay"`
1469
+	PsnCashPay            float64   `gorm:"column:psn_cash_pay" json:"psn_cash_pay" form:"psn_cash_pay"`
1470
+	HospPartAmt           float64   `gorm:"column:hosp_part_amt" json:"hosp_part_amt" form:"hosp_part_amt"`
1471
+	Balc                  float64   `gorm:"column:balc" json:"balc" form:"balc"`
1472
+	AcctMulaidPay         float64   `gorm:"column:acct_mulaid_pay" json:"acct_mulaid_pay" form:"acct_mulaid_pay"`
1473
+	MedinsSetlId          string    `gorm:"column:medins_setl_id" json:"medins_setl_id" form:"medins_setl_id"`
1474
+	ClrOptins             string    `gorm:"column:clr_optins" json:"clr_optins" form:"clr_optins"`
1475
+	ClrWay                string    `gorm:"column:clr_way" json:"clr_way" form:"clr_way"`
1476
+	ClrType               string    `gorm:"column:clr_type" json:"clr_type" form:"clr_type"`
1477
+	SetlDetail            string    `gorm:"column:setl_detail" json:"setl_detail" form:"setl_detail"`
1478
+	IsMedicineInsurance   int64     `gorm:"column:is_medicine_insurance" json:"is_medicine_insurance" form:"is_medicine_insurance"`
1479
+	PayWay                int64     `gorm:"column:pay_way" json:"pay_way" form:"pay_way"`
1480
+	PayPrice              float64   `gorm:"column:pay_price" json:"pay_price" form:"pay_price"`
1481
+	PayCardNo             string    `gorm:"column:pay_card_no" json:"pay_card_no" form:"pay_card_no"`
1482
+	DiscountPrice         float64   `gorm:"column:discount_price" json:"discount_price" form:"discount_price"`
1483
+	PreferentialPrice     float64   `gorm:"column:preferential_price" json:"preferential_price" form:"preferential_price"`
1484
+	RealityPrice          float64   `gorm:"column:reality_price" json:"reality_price" form:"reality_price"`
1485
+	FoundPrice            float64   `gorm:"column:found_price" json:"found_price" form:"found_price"`
1486
+	MedicalInsurancePrice float64   `gorm:"column:medical_insurance_price" json:"medical_insurance_price" form:"medical_insurance_price"`
1487
+	PrivatePrice          float64   `gorm:"column:private_price" json:"private_price" form:"private_price"`
1488
+	Creator               int64     `gorm:"column:creator" json:"creator" form:"creator"`
1489
+	Modify                int64     `gorm:"column:modify" json:"modify" form:"modify"`
1490
+	AccountPrice          float64   `gorm:"column:account_price" json:"account_price" form:"account_price"`
1491
+
1492
+	SzChargeInfo            string `gorm:"column:sz_charge_info" json:"sz_charge_info" form:"sz_charge_info"`
1493
+	SzProjectInfo           string `gorm:"column:sz_project_info" json:"sz_project_info" form:"sz_project_info"`
1494
+	SzMedicineInsuranceInfo string `gorm:"column:sz_medicine_insurance_info" json:"sz_medicine_insurance_info" form:"sz_medicine_insurance_info"`
1495
+	YiliaoNumber            string `gorm:"column:yiliao_number" json:"yiliao_number" form:"yiliao_number"`
1496
+
1497
+	FaPiaoCode   string `gorm:"column:fa_piao_code" json:"fa_piao_code" form:"fa_piao_code"`
1498
+	FaPiaoNumber string `gorm:"column:fa_piao_number" json:"fa_piao_number" form:"fa_piao_number"`
1499
+
1500
+	MzNumber      string `gorm:"column:mz_number" json:"mz_number" form:"mz_number"`
1501
+	OrgSetlNumber string `gorm:"column:org_setl_number" json:"org_setl_number" form:"org_setl_number"`
1502
+
1503
+	SettleType      int64 `gorm:"column:settle_type" json:"settle_type" form:"settle_type"`
1504
+	SettleStartTime int64 `gorm:"column:settle_start_time" json:"settle_start_time" form:"settle_start_time"`
1505
+	SettleEndTime   int64 `gorm:"column:settle_end_time" json:"settle_end_time" form:"settle_end_time"`
1506
+
1507
+	RefundLog string `gorm:"column:refund_log" json:"refund_log" form:"refund_log"`
1508
+	DetailLog string `gorm:"column:detail_log" json:"detail_log" form:"detail_log"`
1509
+
1510
+	RequestLog       string `gorm:"column:request_log" json:"request_log" form:"request_log"`
1511
+	RefundRequestLog string `gorm:"column:refund_request_log" json:"refund_request_log" form:"refund_request_log"`
1512
+}
1513
+
1514
+func (HisOrder) TableName() string {
1515
+	return "his_order"
1516
+}
1517
+
1518
+type HisOrderInfo struct {
1519
+	ID                     int64                  `gorm:"column:id" json:"id" form:"id"`
1520
+	OrderNumber            string                 `gorm:"column:order_number" json:"order_number" form:"order_number"`
1521
+	UploadDate             int64                  `gorm:"column:upload_date" json:"upload_date" form:"upload_date"`
1522
+	AdviceId               int64                  `gorm:"column:advice_id" json:"advice_id" form:"advice_id"`
1523
+	DetItemFeeSumamt       float64                `gorm:"column:det_item_fee_sumamt" json:"det_item_fee_sumamt" form:"det_item_fee_sumamt"`
1524
+	Cnt                    float64                `gorm:"column:cnt" json:"cnt" form:"cnt"`
1525
+	Pric                   float64                `gorm:"column:pric" json:"pric" form:"pric"`
1526
+	PatientId              int64                  `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
1527
+	PricUplmtAmt           float64                `gorm:"column:pric_uplmt_amt" json:"pric_uplmt_amt" form:"pric_uplmt_amt"`
1528
+	SelfpayProp            float64                `gorm:"column:selfpay_prop" json:"selfpay_prop" form:"selfpay_prop"`
1529
+	FulamtOwnpayAmt        float64                `gorm:"column:fulamt_ownpay_amt" json:"fulamt_ownpay_amt" form:"fulamt_ownpay_amt"`
1530
+	OverlmtAmt             float64                `gorm:"column:overlmt_amt" json:"overlmt_amt" form:"overlmt_amt"`
1531
+	PreselfpayAmt          float64                `gorm:"column:preselfpay_amt" json:"preselfpay_amt" form:"preselfpay_amt"`
1532
+	BasMednFlag            string                 `gorm:"column:bas_medn_flag" json:"bas_medn_flag" form:"bas_medn_flag"`
1533
+	MedChrgitmType         string                 `gorm:"column:med_chrgitm_type" json:"med_chrgitm_type" form:"med_chrgitm_type"`
1534
+	HiNegoDrugFlag         string                 `gorm:"column:hi_nego_drug_flag" json:"hi_nego_drug_flag" form:"hi_nego_drug_flag"`
1535
+	Status                 int64                  `gorm:"column:status" json:"status" form:"status"`
1536
+	Memo                   string                 `gorm:"column:memo" json:"memo" form:"memo"`
1537
+	FeedetlSn              string                 `gorm:"column:feedetl_sn" json:"feedetl_sn" form:"feedetl_sn"`
1538
+	Mtime                  int64                  `gorm:"column:mtime" json:"mtime" form:"mtime"`
1539
+	InscpScpAmt            float64                `gorm:"column:inscp_scp_amt" json:"inscp_scp_amt" form:"inscp_scp_amt"`
1540
+	DrtReimFlag            string                 `gorm:"column:drt_reim_flag" json:"drt_reim_flag" form:"drt_reim_flag"`
1541
+	Ctime                  int64                  `gorm:"column:ctime" json:"ctime" form:"ctime"`
1542
+	ListSpItemFlag         string                 `gorm:"column:list_sp_item_flag" json:"list_sp_item_flag" form:"list_sp_item_flag"`
1543
+	ChldMedcFlag           string                 `gorm:"column:chld_medc_flag" json:"chld_medc_flag" form:"chld_medc_flag"`
1544
+	LmtUsedFlag            string                 `gorm:"column:lmt_used_flag" json:"lmt_used_flag" form:"lmt_used_flag"`
1545
+	ChrgitmLv              string                 `gorm:"column:chrgitm_lv" json:"chrgitm_lv" form:"chrgitm_lv"`
1546
+	UserOrgId              int64                  `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
1547
+	HisPatientId           int64                  `gorm:"column:his_patient_id" json:"his_patient_id" form:"his_patient_id"`
1548
+	OrderId                int64                  `gorm:"column:order_id" json:"order_id" form:"order_id"`
1549
+	ProjectId              int64                  `gorm:"column:project_id" json:"project_id" form:"project_id"`
1550
+	Type                   int64                  `gorm:"column:type" json:"type" form:"type"`
1551
+	ItemId                 int64                  `gorm:"column:item_id" json:"item_id" form:"item_id"`
1552
+	OverPricPsnPay         float64                `gorm:"column:over_pric_psn_pay" json:"over_pric_psn_pay" form:"over_pric_psn_pay"`
1553
+	AllowReimburse         float64                `gorm:"column:allow_reimburse" json:"allow_reimburse" form:"allow_reimburse"`
1554
+	HisDoctorAdviceInfo    HisDoctorAdviceInfo    `gorm:"ForeignKey:AdviceId;AssociationForeignKey:ID" json:"advice"`
1555
+	HisPrescriptionProject HisPrescriptionProject `gorm:"ForeignKey:ID;AssociationForeignKey:ProjectId" json:"project"`
1556
+}
1557
+
1558
+func (HisOrderInfo) TableName() string {
1559
+	return "his_order_info"
1560
+}

+ 297 - 0
models/sz/target_data.go View File

@@ -1010,3 +1010,300 @@ type TempHdLisWaterEn struct {
1010 1010
 func (TempHdLisWaterEn) TableName() string {
1011 1011
 	return "t_hd_water_en"
1012 1012
 }
1013
+
1014
+type TBDICPractitioner struct {
1015
+	GH 			string     `gorm:"column:GH" json:"GH" form:"GH"`
1016
+	YLJGDM 		string    `gorm:"column:YLJGDM" json:"YLJGDM" form:"YLJGDM"`
1017
+	ZCM 		string    `gorm:"column:ZCM" json:"ZCM" form:"ZCM"`
1018
+	XM 			string    `gorm:"column:XM" json:"XM" form:"XM"`
1019
+	XBBM		string    `gorm:"column:XBBM" json:"XBBM" form:"XBBM"`
1020
+	SSKS 		string     `gorm:"column:SSKS" json:"SSKS" form:"SSKS"`
1021
+	SZYWKSMC 	string    `gorm:"column:SZYWKSMC" json:"SZYWKSMC" form:"SZYWKSMC"`
1022
+	ZWDM        string    `gorm:"column:ZWDM" json:"ZWDM" form:"ZWDM"`
1023
+	ZHIW        string    `gorm:"column:ZHIW" json:"ZHIW" form:"ZHIW"`
1024
+	ZCDM   		string    `gorm:"column:ZCDM" json:"ZCDM" form:"ZCDM"`
1025
+	ZHIC 		string    `gorm:"column:ZHIC" json:"ZHIC" form:"ZHIC"`
1026
+	NNRYLDQK  	string     `gorm:"column:NNRYLDQK" json:"NNRYLDQK" form:"NNRYLDQK"`
1027
+	BZQK 		string    `gorm:"column:BZQK" json:"BZQK" form:"BZQK"`
1028
+	LB        	string    `gorm:"column:LB" json:"LB" form:"LB"`
1029
+	// ZZKYRYBS	string    `gorm:"column:ZZKYRYBS" json:"ZZKYRYBS" form:"ZZKYRYBS"`
1030
+	YWSCSJ      time.Time    `gorm:"column:YWSCSJ" json:"YWSCSJ" form:"YWSCSJ"`
1031
+	SJSCSJ 		time.Time    `gorm:"column:SJSCSJ" json:"SJSCSJ" form:"SJSCSJ"`
1032
+	XGBZ 		int64     `gorm:"column:XGBZ" json:"XGBZ" form:"XGBZ"`
1033
+}
1034
+
1035
+func (TBDICPractitioner) TableName() string {
1036
+	return "TB_DIC_Practitioner"
1037
+}
1038
+
1039
+type TM_DICT_BED struct {
1040
+	YLJGDM 		string    `gorm:"column:YLJGDM" json:"YLJGDM" form:"YLJGDM"`
1041
+	CWBM 		string    `gorm:"column:CWBM" json:"CWBM" form:"CWBM"`
1042
+	CH 			string    `gorm:"column:CH" json:"CH" form:"CH"`
1043
+	SSKSDM		string    `gorm:"column:SSKSDM" json:"SSKSDM" form:"SSKSDM"`
1044
+	SSKSMC 		string     `gorm:"column:SSKSMC" json:"SSKSMC" form:"SSKSMC"`
1045
+	CWLX 	string    `gorm:"column:CWLX" json:"CWLX" form:"CWLX"`
1046
+	CWZT        string    `gorm:"column:CWZT" json:"ZWDM" form:"CWZT"`
1047
+	DYZLXMDJ        string    `gorm:"column:DYZLXMDJ" json:"DYZLXMDJ" form:"DYZLXMDJ"`
1048
+	ZYH   		string    `gorm:"column:ZYH" json:"ZYH" form:"ZYH"`
1049
+	YWSCSJ      time.Time    `gorm:"column:YWSCSJ" json:"YWSCSJ" form:"YWSCSJ"`
1050
+	SJSCSJ 		time.Time    `gorm:"column:SJSCSJ" json:"SJSCSJ" form:"SJSCSJ"`
1051
+	XGBZ 		int64     `gorm:"column:XGBZ" json:"XGBZ" form:"XGBZ"`
1052
+}
1053
+
1054
+func (TM_DICT_BED) TableName() string {
1055
+	return "TM_DICT_BED"
1056
+}
1057
+
1058
+type TB_MZ_Patient_Information struct {
1059
+	KH 		string    `gorm:"column:KH" json:"KH" form:"KH"`
1060
+	KLX 		string    `gorm:"column:KLX" json:"KLX" form:"KLX"`
1061
+	YLJGDM 		string    `gorm:"column:YLJGDM" json:"YLJGDM" form:"YLJGDM"`
1062
+	FKDQ 			string    `gorm:"column:FKDQ" json:"FKDQ" form:"FKDQ"`
1063
+	ZJHM 			string    `gorm:"column:ZJHM" json:"ZJHM" form:"ZJHM"`
1064
+	ZJLXDM 			string    `gorm:"column:ZJLXDM" json:"ZJLXDM" form:"ZJLXDM"`
1065
+	ZJLXMC 			string    `gorm:"column:ZJLXMC" json:"ZJLXMC" form:"ZJLXMC"`
1066
+	XM 			string    `gorm:"column:XM" json:"XM" form:"XM"`
1067
+	CSRQ		string    `gorm:"column:CSRQ" json:"CSRQ" form:"CSRQ"`
1068
+	MZDM		string    `gorm:"column:MZDM" json:"MZDM" form:"MZDM"`
1069
+	MZMC		string    `gorm:"column:MZMC" json:"MZMC" form:"MZMC"`
1070
+	GJDM		string    `gorm:"column:GJDM" json:"GJDM" form:"GJDM"`
1071
+	GJMC		string    `gorm:"column:GJMC" json:"GJMC" form:"GJMC"`
1072
+	SJHM		string    `gorm:"column:SJHM" json:"SJHM" form:"SJHM"`
1073
+	XBDM		string    `gorm:"column:XBDM" json:"XBDM" form:"XBDM"`
1074
+	XBMC 		string     `gorm:"column:XBMC" json:"XBMC" form:"XBMC"`
1075
+	HZLXDM        string    `gorm:"column:HZLXDM" json:"HZLXDM" form:"HZLXDM"`
1076
+	HZLXMC        string    `gorm:"column:HZLXMC" json:"HZLXMC" form:"HZLXMC"`
1077
+	YWSCSJ      time.Time    `gorm:"column:YWSCSJ" json:"YWSCSJ" form:"YWSCSJ"`
1078
+	SJSCSJ 		time.Time    `gorm:"column:SJSCSJ" json:"SJSCSJ" form:"SJSCSJ"`
1079
+	XGBZ 		int64     `gorm:"column:XGBZ" json:"XGBZ" form:"XGBZ"`
1080
+}
1081
+
1082
+func (TB_MZ_Patient_Information) TableName() string {
1083
+	return "TB_MZ_Patient_Information"
1084
+}
1085
+
1086
+
1087
+type TB_HIS_MZ_Reg struct {
1088
+	GHRQ 		string    `gorm:"column:GHRQ" json:"GHRQ" form:"GHRQ"`
1089
+	JZLSH 		string    `gorm:"column:JZLSH" json:"JZLSH" form:"JZLSH"`
1090
+	GTHBZ 		string    `gorm:"column:GTHBZ" json:"GTHBZ" form:"GTHBZ"`
1091
+	YLJGDM 		string    `gorm:"column:YLJGDM" json:"YLJGDM" form:"YLJGDM"`
1092
+	STFBH 			string    `gorm:"column:STFBH" json:"STFBH" form:"STFBH"`
1093
+	GTHSJ		string    `gorm:"column:GTHSJ" json:"GTHSJ" form:"GTHSJ"`
1094
+	GHHX 		string     `gorm:"column:GHHX" json:"GHHX" form:"GHHX"`
1095
+	GHLB 	string    `gorm:"column:GHLB" json:"GHLB" form:"GHLB"`
1096
+	GHMC        string    `gorm:"column:GHMC" json:"GHMC" form:"GHMC"`
1097
+	YLFYLYDM        string    `gorm:"column:YLFYLYDM" json:"YLFYLYDM" form:"YLFYLYDM"`
1098
+	YLBXLBDM        string    `gorm:"column:YLBXLBDM" json:"YLBXLBDM" form:"YLBXLBDM"`
1099
+	YBZHBZ        string    `gorm:"column:YBZHBZ" json:"YBZHBZ" form:"YBZHBZ"`
1100
+	SSJYBZ        string    `gorm:"column:SSJYBZ" json:"SSJYBZ" form:"SSJYBZ"`
1101
+	KSBM        string    `gorm:"column:KSBM" json:"KSBM" form:"KSBM"`
1102
+	KSMC        string    `gorm:"column:KSMC" json:"KSMC" form:"KSMC"`
1103
+	YSBM        string    `gorm:"column:YSBM" json:"YSBM" form:"YSBM"`
1104
+	YSXM        string    `gorm:"column:YSXM" json:"YSXM" form:"YSXM"`
1105
+	TXBZ        string    `gorm:"column:TXBZ" json:"TXBZ" form:"TXBZ"`
1106
+	WDBZ        string    `gorm:"column:WDBZ" json:"WDBZ" form:"WDBZ"`
1107
+	KH        string    `gorm:"column:KH" json:"KH" form:"KH"`
1108
+	KLX        string    `gorm:"column:KLX" json:"KLX" form:"KLX"`
1109
+	SFYY        string    `gorm:"column:SFYY" json:"SFYY" form:"SFYY"`
1110
+	GHRCBS        string    `gorm:"column:GHRCBS" json:"GHRCBS" form:"GHRCBS"`
1111
+	GHFY        float64    `gorm:"column:GHFY" json:"GHFY" form:"GHFY"`
1112
+	JMGHF        float64    `gorm:"column:JMGHF" json:"JMGHF" form:"JMGHF"`
1113
+	ZJF        float64    `gorm:"column:ZJF" json:"ZJF" form:"ZJF"`
1114
+	JMZJF		float64    `gorm:"column:JMZJF" json:"JMZJF" form:"JMZJF"`
1115
+	QTF        string    `gorm:"column:QTF" json:"QTF" form:"QTF"`
1116
+	CZYBM        string    `gorm:"column:CZYBM" json:"CZYBM" form:"CZYBM"`
1117
+	CZYXM        string    `gorm:"column:CZYXM" json:"CZYXM" form:"CZYXM"`
1118
+	SJSCSJ 		time.Time    `gorm:"column:SJSCSJ" json:"SJSCSJ" form:"SJSCSJ"`
1119
+	XGBZ 		int64     `gorm:"column:XGBZ" json:"XGBZ" form:"XGBZ"`
1120
+}
1121
+
1122
+func (TB_HIS_MZ_Reg) TableName() string {
1123
+	return "TB_HIS_MZ_Reg"
1124
+}
1125
+
1126
+
1127
+type TB_YL_MZ_Medical_Record struct {
1128
+	YLJGDM 		string    `gorm:"column:YLJGDM" json:"YLJGDM" form:"YLJGDM"`
1129
+	JZLSH 			string    `gorm:"column:JZLSH" json:"JZLSH" form:"JZLSH"`
1130
+	KH		string    `gorm:"column:KH" json:"KH" form:"KH"`
1131
+	KLX 		string     `gorm:"column:KLX" json:"KLX" form:"KLX"`
1132
+	MJZH 	string    `gorm:"column:MJZH" json:"MJZH" form:"MJZH"`
1133
+	HZXM        string    `gorm:"column:HZXM" json:"HZXM" form:"HZXM"`
1134
+	JZLX        string    `gorm:"column:JZLX" json:"JZLX" form:"JZLX"`
1135
+	CZBZ        string    `gorm:"column:CZBZ" json:"CZBZ" form:"CZBZ"`
1136
+	SFTH        string    `gorm:"column:SFTH" json:"SFTH" form:"SFTH"`
1137
+	YLBXLBDM        string    `gorm:"column:YLBXLBDM" json:"YLBXLBDM" form:"YLBXLBDM"`
1138
+	YLFKFSDM        string    `gorm:"column:YLFKFSDM" json:"YLFKFSDM" form:"YLFKFSDM"`
1139
+	TXBZ        string    `gorm:"column:TXBZ" json:"TXBZ" form:"TXBZ"`
1140
+	YBZHBZ        string    `gorm:"column:YBZHBZ" json:"YBZHBZ" form:"YBZHBZ"`
1141
+	WDBZ        string    `gorm:"column:WDBZ" json:"WDBZ" form:"WDBZ"`
1142
+	SFSYZYZLJS        string    `gorm:"column:SFSYZYZLJS" json:"SFSYZYZLJS" form:"SFSYZYZLJS"`
1143
+	ZYZLJSLB        string    `gorm:"column:ZYZLJSLB" json:"ZYZLJSLB" form:"ZYZLJSLB"`
1144
+	SFSYZYZHLJS        string    `gorm:"column:SFSYZYZHLJS" json:"SFSYZYZHLJS" form:"SFSYZYZHLJS"`
1145
+	JZKSBM        string    `gorm:"column:JZKSBM" json:"JZKSBM" form:"JZKSBM"`
1146
+	JZKSMC        string    `gorm:"column:JZKSMC" json:"JZKSMC" form:"JZKSMC"`
1147
+	JZKSRQ        string    `gorm:"column:JZKSRQ" json:"JZKSRQ" form:"JZKSRQ"`
1148
+	ZZYSGH        string    `gorm:"column:ZZYSGH" json:"ZZYSGH" form:"ZZYSGH"`
1149
+	ZZYSXM        string    `gorm:"column:ZZYSXM" json:"ZZYSXM" form:"ZZYSXM"`
1150
+	YWSCSJ      time.Time    `gorm:"column:YWSCSJ" json:"YWSCSJ" form:"YWSCSJ"`
1151
+	SJSCSJ 		time.Time    `gorm:"column:SJSCSJ" json:"SJSCSJ" form:"SJSCSJ"`
1152
+	XGBZ 		int64     `gorm:"column:XGBZ" json:"XGBZ" form:"XGBZ"`
1153
+}
1154
+
1155
+func (TB_YL_MZ_Medical_Record) TableName() string {
1156
+	return "TB_YL_MZ_Medical_Record"
1157
+}
1158
+
1159
+type TB_CIS_Prescription struct {
1160
+	YLJGDM 		string    `gorm:"column:YLJGDM" json:"YLJGDM" form:"YLJGDM"`
1161
+	CYH 			string    `gorm:"column:CYH" json:"CYH" form:"CYH"`
1162
+	JZLSH 			string    `gorm:"column:JZLSH" json:"JZLSH" form:"JZLSH"`
1163
+	KH		string    `gorm:"column:KH" json:"KH" form:"KH"`
1164
+	KLX 		string     `gorm:"column:KLX" json:"KLX" form:"KLX"`
1165
+	CFLX 			string    `gorm:"column:CFLX" json:"CFLX" form:"CFLX"`
1166
+	YPLX 			string    `gorm:"column:YPLX" json:"YPLX" form:"YPLX"`
1167
+	ZYYPCFLB 			string    `gorm:"column:ZYYPCFLB" json:"ZYYPCFLB" form:"ZYYPCFLB"`
1168
+	CFJS 			string    `gorm:"column:CFJS" json:"CFJS" form:"CFJS"`
1169
+	JZKSDM 			string    `gorm:"column:JZKSDM" json:"JZKSDM" form:"JZKSDM"`
1170
+	JZKSMC 			string    `gorm:"column:JZKSMC" json:"JZKSMC" form:"JZKSMC"`
1171
+	KFYS 			string    `gorm:"column:KFYS" json:"KFYS" form:"KFYS"`
1172
+	KFYSXM 			string    `gorm:"column:KFYSXM" json:"KFYSXM" form:"KFYSXM"`
1173
+	KFRQ 			string    `gorm:"column:KFRQ" json:"KFRQ" form:"KFRQ"`
1174
+	CFLRSJ 			string    `gorm:"column:CFLRSJ" json:"CFLRSJ" form:"CFLRSJ"`
1175
+	SGCFBZ 			string    `gorm:"column:SGCFBZ" json:"SGCFBZ" form:"SGCFBZ"`
1176
+	CFYPJE 			float64    `gorm:"column:CFYPJE" json:"CFYPJE" form:"CFYPJE"`
1177
+	SJSCSJ 		time.Time    `gorm:"column:SJSCSJ" json:"SJSCSJ" form:"SJSCSJ"`
1178
+	XGBZ 		int64     `gorm:"column:XGBZ" json:"XGBZ" form:"XGBZ"`
1179
+}
1180
+
1181
+func (TB_CIS_Prescription) TableName() string {
1182
+	return "TB_CIS_Prescription"
1183
+}
1184
+
1185
+type TB_CIS_Prescription_Detail struct {
1186
+	YLJGDM 		string    `gorm:"column:YLJGDM" json:"YLJGDM" form:"YLJGDM"`
1187
+	CYH 			string    `gorm:"column:CYH" json:"CYH" form:"CYH"`
1188
+	CFMXH 			string    `gorm:"column:CFMXH" json:"CFMXH" form:"CFMXH"`
1189
+	JZLSH 			string    `gorm:"column:JZLSH" json:"JZLSH" form:"JZLSH"`
1190
+	XMBM		string    `gorm:"column:XMBM" json:"XMBM" form:"XMBM"`
1191
+	XMBMYB 		string     `gorm:"column:XMBMYB" json:"XMBMYB" form:"XMBMYB"`
1192
+	XMMC 			string    `gorm:"column:XMMC" json:"XMMC" form:"XMMC"`
1193
+	XMSL 			float64    `gorm:"column:XMSL" json:"XMSL" form:"XMSL"`
1194
+	XMDW 			string    `gorm:"column:XMDW" json:"XMDW" form:"XMDW"`
1195
+	XMDJ 			float64    `gorm:"column:XMDJ" json:"XMDJ" form:"XMDJ"`
1196
+	XMJE 			float64    `gorm:"column:XMJE" json:"XMJE" form:"XMJE"`
1197
+	XMLB 			string    `gorm:"column:XMLB" json:"XMLB" form:"XMLB"`
1198
+	YWFLDM 			string    `gorm:"column:YWFLDM" json:"YWFLDM" form:"YWFLDM"`
1199
+	SFJJ 			string    `gorm:"column:SFJJ" json:"SFJJ" form:"SFJJ"`
1200
+	SFPS 			string    `gorm:"column:SFPS" json:"SFPS" form:"SFPS"`
1201
+	YPGG			string    `gorm:"column:YPGG" json:"YPGG" form:"YPGG"`
1202
+	SCPH			string    `gorm:"column:SCPH" json:"SCPH" form:"SCPH"`
1203
+	YXQZ			string    `gorm:"column:YXQZ" json:"YXQZ" form:"YXQZ"`
1204
+	SYPCDM			string    `gorm:"column:SYPCDM" json:"SYPCDM" form:"SYPCDM"`
1205
+	SYPC			string    `gorm:"column:SYPC" json:"SYPC" form:"SYPC"`
1206
+	JL				float64    `gorm:"column:JL" json:"JL" form:"JL"`
1207
+	DW				string    `gorm:"column:DW" json:"DW" form:"DW"`
1208
+	MCSL				float64    `gorm:"column:MCSL" json:"MCSL" form:"MCSL"`
1209
+	MCDW			string    `gorm:"column:MCDW" json:"MCDW" form:"MCDW"`
1210
+	YF			string    `gorm:"column:YF" json:"YF" form:"YF"`
1211
+	YPYF			string    `gorm:"column:YPYF" json:"YPYF" form:"YPYF"`
1212
+	YYTS			int64 `gorm:"column:YYTS" json:"YYTS" form:"YYTS"`
1213
+	YWSYZJL 			float64    `gorm:"column:YWSYZJL" json:"YWSYZJL" form:"YWSYZJL"`
1214
+	YWSYZJLDW 			string    `gorm:"column:YWSYZJLDW" json:"YWSYZJLDW" form:"YWSYZJLDW"`
1215
+	SJSCSJ 		time.Time    `gorm:"column:SJSCSJ" json:"SJSCSJ" form:"SJSCSJ"`
1216
+	XGBZ 		int64     `gorm:"column:XGBZ" json:"XGBZ" form:"XGBZ"`
1217
+}
1218
+
1219
+func (TB_CIS_Prescription_Detail) TableName() string {
1220
+	return "TB_CIS_Prescription_Detail"
1221
+}
1222
+
1223
+type TB_HIS_MZ_Charge struct {
1224
+	STFRQ 		string    `gorm:"column:STFRQ" json:"STFRQ" form:"STFRQ"`
1225
+	STFBH 		string    `gorm:"column:STFBH" json:"STFBH" form:"STFBH"`
1226
+	STFBZ 		string    `gorm:"column:STFBZ" json:"STFBZ" form:"STFBZ"`
1227
+	YLJGDM 		string    `gorm:"column:YLJGDM" json:"YLJGDM" form:"YLJGDM"`
1228
+	GHBM 		string    `gorm:"column:GHBM" json:"GHBM" form:"GHBM"`
1229
+	KH 		string    `gorm:"column:KH" json:"KH" form:"KH"`
1230
+	KLX 		string    `gorm:"column:KLX" json:"KLX" form:"KLX"`
1231
+	FPH 		string    `gorm:"column:FPH" json:"FPH" form:"FPH"`
1232
+	YLFKFSDM 		string    `gorm:"column:YLFKFSDM" json:"YLFKFSDM" form:"YLFKFSDM"`
1233
+	YLBXLBDM 		string    `gorm:"column:YLBXLBDM" json:"YLBXLBDM" form:"YLBXLBDM"`
1234
+	YBZHBZ 		string    `gorm:"column:YBZHBZ" json:"YBZHBZ" form:"YBZHBZ"`
1235
+	SSJYBZ 		string    `gorm:"column:SSJYBZ" json:"SSJYBZ" form:"SSJYBZ"`
1236
+	ZLLX 		string    `gorm:"column:ZLLX" json:"ZLLX" form:"ZLLX"`
1237
+	WDBZ 		string    `gorm:"column:WDBZ" json:"WDBZ" form:"WDBZ"`
1238
+	STFSJ 		string    `gorm:"column:STFSJ" json:"STFSJ" form:"STFSJ"`
1239
+	STFZE 		float64    `gorm:"column:STFZE" json:"STFZE" form:"STFZE"`
1240
+	SSJE 		float64    `gorm:"column:SSJE" json:"SSJE" form:"SSJE"`
1241
+	YBFWWZF 	float64    `gorm:"column:YBFWWZF" json:"YBFWWZF" form:"YBFWWZF"`
1242
+	TXFYE 		string    `gorm:"column:TXFYE" json:"TXFYE" form:"TXFYE"`
1243
+	TXYF 		string    `gorm:"column:TXYF" json:"TXYF" form:"TXYF"`
1244
+	GHF 		string    `gorm:"column:GHF" json:"GHF" form:"GHF"`
1245
+	ZLF 		string    `gorm:"column:ZLF" json:"ZLF" form:"ZLF"`
1246
+	ZHF 		float64    `gorm:"column:ZHF" json:"ZHF" form:"ZHF"`
1247
+	JCF 		float64    `gorm:"column:JCF" json:"JCF" form:"JCF"`
1248
+	SSF 		float64    `gorm:"column:SSF" json:"SSF" form:"SSF"`
1249
+	WSCLF 		float64    `gorm:"column:WSCLF" json:"WSCLF" form:"WSCLF"`
1250
+	CWF 		float64    `gorm:"column:CWF" json:"CWF" form:"CWF"`
1251
+	HLF 		string    `gorm:"column:HLF" json:"HLF" form:"HLF"`
1252
+	YSFWF 		string    `gorm:"column:YSFWF" json:"YSFWF" form:"YSFWF"`
1253
+	YBZLF 		string    `gorm:"column:YBZLF" json:"YBZLF" form:"YBZLF"`
1254
+	HYF 		float64    `gorm:"column:HYF" json:"HYF" form:"HYF"`
1255
+	TSF 		string    `gorm:"column:TSF" json:"TSF" form:"TSF"`
1256
+	SPF 		string    `gorm:"column:SPF" json:"SPF" form:"SPF"`
1257
+	XYF 		float64    `gorm:"column:XYF" json:"XYF" form:"XYF"`
1258
+	YHJE		float64    `gorm:"column:YHJE" json:"YHJE" form:"YHJE"`
1259
+	ZFJE		float64    `gorm:"column:ZFJE" json:"ZFJE" form:"ZFJE"`
1260
+	YBJZ		float64    `gorm:"column:YBJZ" json:"YBJZ" form:"YBJZ"`
1261
+	YBJJ		float64    `gorm:"column:YBJJ" json:"YBJJ" form:"YBJJ"`
1262
+	YBZE		float64    `gorm:"column:YBZE" json:"YBZE" form:"YBZE"`
1263
+	YBZF		float64    `gorm:"column:YBZF" json:"YBZF" form:"YBZF"`
1264
+	ZCYF 		float64    `gorm:"column:ZCYF" json:"ZCYF" form:"ZCYF"`
1265
+	ZYZJF 		string    `gorm:"column:ZYZJF" json:"ZYZJF" form:"ZYZJF"`
1266
+	ZCAF 		string    `gorm:"column:ZCAF" json:"ZCAF" form:"ZCAF"`
1267
+	QTF 		float64    `gorm:"column:QTF" json:"QTF" form:"QTF"`
1268
+	CFZS 		string    `gorm:"column:CFZS" json:"CFZS" form:"CFZS"`
1269
+	SJSCSJ 		time.Time    `gorm:"column:SJSCSJ" json:"SJSCSJ" form:"SJSCSJ"`
1270
+	XGBZ 		int64     `gorm:"column:XGBZ" json:"XGBZ" form:"XGBZ"`
1271
+}
1272
+
1273
+func (TB_HIS_MZ_Charge) TableName() string {
1274
+	return "TB_HIS_MZ_Charge"
1275
+}
1276
+
1277
+type TB_HIS_MZ_Fee_Detail struct {
1278
+	SFMXID 		string    `gorm:"column:SFMXID" json:"SFMXID" form:"SFMXID"`
1279
+	TFBZ 		string    `gorm:"column:TFBZ" json:"TFBZ" form:"TFBZ"`
1280
+	YLJGDM 		string    `gorm:"column:YLJGDM" json:"YLJGDM" form:"YLJGDM"`
1281
+	JZLSH 		string    `gorm:"column:JZLSH" json:"JZLSH" form:"JZLSH"`
1282
+	STFBH 		string    `gorm:"column:STFBH" json:"STFBH" form:"STFBH"`
1283
+	KH 		string    `gorm:"column:KH" json:"KH" form:"KH"`
1284
+	KLX 		string    `gorm:"column:KLX" json:"KLX" form:"KLX"`
1285
+	ZLLX 		string    `gorm:"column:ZLLX" json:"ZLLX" form:"ZLLX"`
1286
+	YLFKFSDM 		string    `gorm:"column:YLFKFSDM" json:"YLFKFSDM" form:"YLFKFSDM"`
1287
+	FPH 		string    `gorm:"column:FPH" json:"FPH" form:"FPH"`
1288
+	STFSJ 		string    `gorm:"column:STFSJ" json:"STFSJ" form:"STFSJ"`
1289
+	MXFYLB 		string    `gorm:"column:MXFYLB" json:"MXFYLB" form:"MXFYLB"`
1290
+	MXXMBM 		string    `gorm:"column:MXXMBM" json:"MXXMBM" form:"MXXMBM"`
1291
+	MXXMBMYB 		string    `gorm:"column:MXXMBMYB" json:"MXXMBMYB" form:"MXXMBMYB"`
1292
+	MXXMMC 		string    `gorm:"column:MXXMMC" json:"MXXMMC" form:"MXXMMC"`
1293
+	MXXMDW 		string    `gorm:"column:MXXMDW" json:"MXXMDW" form:"MXXMDW"`
1294
+	MXXMDJ 		float64    `gorm:"column:MXXMDJ" json:"MXXMDJ" form:"MXXMDJ"`
1295
+	MXXMSL 		float64    `gorm:"column:MXXMSL" json:"MXXMSL" form:"MXXMSL"`
1296
+	MXXMJE 		float64    `gorm:"column:MXXMJE" json:"MXXMJE" form:"MXXMJE"`
1297
+	KDKSBM 		string    `gorm:"column:KDKSBM" json:"KDKSBM" form:"KDKSBM"`
1298
+	KDKSMC 		string    `gorm:"column:KDKSMC" json:"KDKSMC" form:"KDKSMC"`
1299
+	KDRGH 		string    `gorm:"column:KDRGH" json:"KDRGH" form:"KDRGH"`
1300
+	KDRXM 		string    `gorm:"column:KDRXM" json:"KDRXM" form:"KDRXM"`
1301
+	ZXKSBM 		string    `gorm:"column:ZXKSBM" json:"ZXKSBM" form:"ZXKSBM"`
1302
+	ZXKSMC 		string    `gorm:"column:ZXKSMC" json:"ZXKSMC" form:"ZXKSMC"`
1303
+	SJSCSJ 		time.Time    `gorm:"column:SJSCSJ" json:"SJSCSJ" form:"SJSCSJ"`
1304
+	XGBZ 		int64     `gorm:"column:XGBZ" json:"XGBZ" form:"XGBZ"`
1305
+}
1306
+
1307
+func (TB_HIS_MZ_Fee_Detail) TableName() string {
1308
+	return "TB_HIS_MZ_Fee_Detail"
1309
+}

File diff suppressed because it is too large
+ 873 - 14
service/city/auto_create_week_schedules_service.go


+ 172 - 4
service/city_data_uoload_service.go View File

@@ -37,6 +37,14 @@ func FindOrgRolesData(org_id int64, lastUploadTime int64, nowTime int64) (role [
37 37
 	err = db.Find(&role).Error
38 38
 	return
39 39
 }
40
+
41
+func FindOrgRolesDataNew(org_id int64, lastUploadTime int64, nowTime int64) (role []*models.App_Role, err error) {
42
+	db := readUserDb.Model(&models.App_Role{}).Where("status = 1 AND org_id = ?  ", org_id)
43
+	db = db.Where("ctime >= ? AND ctime <= ?", lastUploadTime, nowTime)
44
+	err = db.Find(&role).Error
45
+	return
46
+}
47
+
40 48
 func FindOrgPatientData(org_id int64, lastUploadTime int64, nowTime int64) (patient []*models.Patients, err error) {
41 49
 	db := readDb.Model(&models.Patients{}).Where("status = 1 AND user_org_id = ?", org_id)
42 50
 	db = db.Where("created_time >= ? AND created_time <= ?", lastUploadTime, nowTime)
@@ -45,6 +53,113 @@ func FindOrgPatientData(org_id int64, lastUploadTime int64, nowTime int64) (pati
45 53
 	return
46 54
 }
47 55
 
56
+func FindOrgPatientInfoById(id int64) (*models.Patients, error) {
57
+	var patient models.Patients
58
+	db := readDb.Model(&models.Patients{}).Where("status = 1 AND id = ?", id)
59
+	err = db.First(&patient).Error
60
+	return &patient,err
61
+}
62
+
63
+func FindOrgHisPatient(org_id int64, lastUploadTime int64, nowTime int64) (patient []*models.HisPatient, err error) {
64
+	db := readDb.Model(&models.HisPatient{}).Where("status = 1 AND user_org_id = ?", org_id)
65
+	db = db.Where("ctime >= ? AND ctime <= ?", lastUploadTime, nowTime)
66
+	err = db.Find(&patient).Error
67
+
68
+	return
69
+}
70
+
71
+func FindOrgHisPrescriptionInfo(org_id int64, lastUploadTime int64, nowTime int64) (patient []*models.HisPrescriptionInfo, err error) {
72
+	db := readDb.Model(&models.HisPrescriptionInfo{}).Where("status = 1 AND user_org_id = ?", org_id)
73
+	db = db.Where("ctime >= ? AND ctime <= ?", lastUploadTime, nowTime)
74
+	err = db.Find(&patient).Error
75
+
76
+	return
77
+}
78
+
79
+func FindOrgHisPrescription(org_id int64, lastUploadTime int64, nowTime int64) (patient []*models.HisPrescription, err error) {
80
+	db := readDb.Model(&models.HisPrescription{}).Where("status = 1 AND user_org_id = ?", org_id)
81
+	db = db.Where("ctime >= ? AND ctime <= ?", lastUploadTime, nowTime)
82
+	err = db.Find(&patient).Error
83
+	return
84
+}
85
+
86
+func FindOrgHisDoctorAdviceInfo(org_id int64, lastUploadTime int64, nowTime int64) (patient []*models.HisDoctorAdviceInfo, err error) {
87
+	db := readDb.Model(&models.HisDoctorAdviceInfo{}).Where("status = 1 AND user_org_id = ?", org_id)
88
+	db = db.Where("created_time >= ? AND created_time <= ?", lastUploadTime, nowTime)
89
+	err = db.Find(&patient).Error
90
+	return
91
+}
92
+
93
+func FindOrgHisDoctorAdviceInfoByPid(org_id int64, pid int64) (patient []*models.HisDoctorAdviceInfo, err error) {
94
+	db := readDb.Model(&models.HisDoctorAdviceInfo{}).Where("status = 1 AND user_org_id = ? and prescription_id = ?", org_id)
95
+	err = db.Find(&patient).Error
96
+	return
97
+}
98
+
99
+func FindOrgHisOrder(org_id int64, lastUploadTime int64, nowTime int64) (patient []*models.HisOrder, err error) {
100
+	db := readDb.Model(&models.HisOrder{}).Where("status = 1 AND user_org_id = ?", org_id)
101
+	db = db.Where("ctime >= ? AND ctime <= ?", lastUploadTime, nowTime)
102
+	err = db.Find(&patient).Error
103
+	return
104
+}
105
+
106
+func FindOrgHisOrderInfo(org_id int64, lastUploadTime int64, nowTime int64) (patient []*models.HisOrderInfo, err error) {
107
+	db := readDb.Model(&models.HisOrderInfo{}).Where("status = 1 AND user_org_id = ?", org_id)
108
+	db = db.Where("ctime >= ? AND ctime <= ?", lastUploadTime, nowTime)
109
+	err = db.Find(&patient).Error
110
+	return
111
+}
112
+
113
+func GetHisOrderByNumber(order_number string) ( *models.HisOrder,  error) {
114
+	var order models.HisOrder
115
+	db := readDb.Model(&models.HisOrder{}).Where("number = ? AND status = 1 ", order_number)
116
+	err = db.First(&order).Error
117
+	return &order,err
118
+}
119
+
120
+func GetHisDoctorAdviceInfo(id int64) ( *models.HisDoctorAdviceInfo, error) {
121
+	var order models.HisDoctorAdviceInfo
122
+	db := readDb.Model(&models.HisDoctorAdviceInfo{}).Where("id = ? AND status = 1 ", id)
123
+	err = db.Find(&order).Error
124
+	return &order,err
125
+}
126
+
127
+func GetHisOrderInfoByNumber(order_number string) (order []*models.HisOrderInfo, err error) {
128
+	db := readDb.Model(&models.HisOrderInfo{}).Preload("HisDoctorAdviceInfo", func(db *gorm.DB) *gorm.DB {
129
+		return db.Preload("BaseDrugLib", "status = 1").Where("status = 1")
130
+	})
131
+	err = db.Where("order_number = ? AND status = 1 AND advice_id > 0", order_number).Find(&order).Error
132
+	return
133
+}
134
+
135
+func FindOrgHisPrescriptionById( id int64) (*models.HisPrescription,  error) {
136
+	var HisPrescription models.HisPrescription
137
+	db := readDb.Model(&models.HisPrescription{}).Where("status = 1  and id =? ", id)
138
+	err = db.First(&HisPrescription).Error
139
+	return &HisPrescription,err
140
+}
141
+
142
+func FindBaseDrugLibById( id int64) (*models.BaseDrugLib,  error) {
143
+	var BaseDrugLib models.BaseDrugLib
144
+	db := readDb.Model(&models.BaseDrugLib{}).Where("status = 1  and id =? ", id)
145
+	err = db.First(&BaseDrugLib).Error
146
+	return &BaseDrugLib,err
147
+}
148
+
149
+func FindOrgHisPrescriptionInfoByNumber(org_id int64, prescription_number string) (*models.HisPrescriptionInfo,  error) {
150
+	var HisPrescriptionInfo models.HisPrescriptionInfo
151
+	db := readDb.Model(&models.HisPrescriptionInfo{}).Where("status = 1 AND user_org_id = ? and prescription_number =? ", org_id,prescription_number)
152
+	err = db.First(&HisPrescriptionInfo).Error
153
+	return &HisPrescriptionInfo,err
154
+}
155
+
156
+func FindOrgHisPatientInfo(org_id int64, record_date int64, patient_id int64) (*models.HisPatient, error) {
157
+	var HisPatient models.HisPatient
158
+	db := readDb.Model(&models.HisPatient{}).Where("status = 1 AND user_org_id = ? and record_date =? and patient_id = ?", org_id,record_date,patient_id)
159
+	err = db.First(&HisPatient).Error
160
+	return &HisPatient,err
161
+}
162
+
48 163
 func FindOrgPatientDataOne(org_id int64) (patient []*models.Patients, err error) {
49 164
 	db := readDb.Model(&models.Patients{}).Where("status = 1 AND user_org_id = ?", org_id)
50 165
 	err = db.Find(&patient).Error
@@ -118,6 +233,13 @@ func FindOrgMonitorRecordByLike(org_id int64, keyword string, lastUploadTime int
118 233
 }
119 234
 
120 235
 func FindOrgInspection(org_id int64, lastUploadTime int64, nowTime int64) (inspection []*models.XtInspection, err error) {
236
+	db := readDb.Model(&models.XtInspection{}).Where("status = 1 AND org_id = ? ", org_id).Preload("Patients", "status = 1")
237
+	db = db.Where("created_time >= ? AND created_time <= ?", lastUploadTime, nowTime).Group("inspect_date,project_id,patient_id")
238
+	err = db.Find(&inspection).Error
239
+	return
240
+}
241
+
242
+func FindOrgInspectionTwo(org_id int64, lastUploadTime int64, nowTime int64) (inspection []*models.XtInspection, err error) {
121 243
 	db := readDb.Model(&models.XtInspection{}).Where("status = 1 AND org_id = ? ", org_id).Preload("Patients", "status = 1")
122 244
 	db = db.Where("created_time >= ? AND created_time <= ?", lastUploadTime, nowTime)
123 245
 	err = db.Find(&inspection).Error
@@ -231,7 +353,8 @@ func BatchCreateStaffRecord(staffs []*sz.TempHdStaff, rdb *gorm.DB) (err error)
231 353
 	if len(staffs) > 0 {
232 354
 		utx := rdb
233 355
 		if len(staffs) > 0 {
234
-			id_no := 429001198701091670
356
+			var id_no int64
357
+			id_no = 429001198701091670
235 358
 			for _, info := range staffs {
236 359
 				thisSQL := "INSERT INTO t_hd_staff (hospital_id,staff_id, id_no,id_type,staff_name,  position,  staff_status, staff_no, permanent_type, in_date ,create_time, update_time, sjscsj, xgbz) VALUES "
237 360
 				insertParams := make([]string, 0)
@@ -945,7 +1068,7 @@ func CreateLisIndicators(wms []*sz.TempHdLisIndicators, rdb *gorm.DB) (err error
945 1068
 
946 1069
 func FindOrgCulture(org_id int64, lastUploadTime int64, nowTime int64) (culture []*models.XtDeviceCulture, err error) {
947 1070
 
948
-	err = UserReadDB().Model(&culture).Where("status = 1 and user_org_id = ? and speling_date>=? and speling_date<=?", org_id, lastUploadTime, nowTime).Find(&culture).Error
1071
+	err = UserReadDB().Model(&culture).Where("status = 1 and user_org_id = ? and ctime>=? and ctime<=?", org_id, lastUploadTime, nowTime).Find(&culture).Error
949 1072
 	return culture, err
950 1073
 }
951 1074
 
@@ -979,7 +1102,7 @@ func CreateLisCulture(wms []*sz.TempHdLisCulture, rdb *gorm.DB) (err error) {
979 1102
 
980 1103
 func FindOrgDialysate(org_id int64, lastUploadTime int64, nowTime int64) (dialysate []*models.XtDeviceDialysate, err error) {
981 1104
 
982
-	err = UserReadDB().Model(&dialysate).Where("status = 1 and user_org_id = ? and sampling_date>=? and sampling_date<=?", org_id, lastUploadTime, nowTime).Find(&dialysate).Error
1105
+	err = UserReadDB().Model(&dialysate).Where("status = 1 and user_org_id = ? and ctime>=? and ctime<=?", org_id, lastUploadTime, nowTime).Find(&dialysate).Error
983 1106
 	return dialysate, err
984 1107
 }
985 1108
 
@@ -1114,7 +1237,7 @@ func CreateWaterFc(wms []*sz.TempHdLisWaterFc, rdb *gorm.DB) (err error) {
1114 1237
 
1115 1238
 func FindOrgWaterNc(org_id int64, lastUploadTime int64, nowTime int64) (water []*models.XtDeviceOxygenates, err error) {
1116 1239
 
1117
-	err = UserReadDB().Model(&water).Where("user_org_id = ? and status = 1 and sampling_date>=? and sampling_date<=?", org_id, lastUploadTime, nowTime).Find(&water).Error
1240
+	err = UserReadDB().Model(&water).Where("user_org_id = ? and status = 1 and ctime>=? and ctime<=?", org_id, lastUploadTime, nowTime).Find(&water).Error
1118 1241
 	return water, err
1119 1242
 }
1120 1243
 
@@ -1346,3 +1469,48 @@ func CreateLisWaterEn(wms []*sz.TempHdLisWaterEn, rdb *gorm.DB) (err error) {
1346 1469
 	}
1347 1470
 	return
1348 1471
 }
1472
+
1473
+func BatchCreateTBDICPractitioner(ps *sz.TBDICPractitioner, rdb *gorm.DB) (err error) {
1474
+	err = rdb.Create(&ps).Error
1475
+	return err
1476
+}
1477
+
1478
+func BatchCreateTMDICTBED(ps *sz.TM_DICT_BED, rdb *gorm.DB) (err error) {
1479
+	err = rdb.Create(&ps).Error
1480
+	return err
1481
+}
1482
+
1483
+func BatchCreateTB_MZ_Patient_Information(ps *sz.TB_MZ_Patient_Information, rdb *gorm.DB) (err error) {
1484
+	err = rdb.Create(&ps).Error
1485
+	return err
1486
+}
1487
+
1488
+func BatchCreateTB_HIS_MZ_Reg(ps *sz.TB_HIS_MZ_Reg, rdb *gorm.DB) (err error) {
1489
+	err = rdb.Create(&ps).Error
1490
+	return err
1491
+}
1492
+
1493
+func BatchCreateTB_YL_MZ_Medical_Record(ps *sz.TB_YL_MZ_Medical_Record, rdb *gorm.DB) (err error) {
1494
+	err = rdb.Create(&ps).Error
1495
+	return err
1496
+}
1497
+
1498
+func BatchCreateTB_CIS_Prescription(ps *sz.TB_CIS_Prescription, rdb *gorm.DB) (err error) {
1499
+	err = rdb.Create(&ps).Error
1500
+	return err
1501
+}
1502
+
1503
+func BatchCreateTB_CIS_Prescription_Detail(ps *sz.TB_CIS_Prescription_Detail, rdb *gorm.DB) (err error) {
1504
+	err = rdb.Create(&ps).Error
1505
+	return err
1506
+}
1507
+
1508
+func BatchCreateTB_HIS_MZ_Charge(ps *sz.TB_HIS_MZ_Charge, rdb *gorm.DB) (err error) {
1509
+	err = rdb.Create(&ps).Error
1510
+	return err
1511
+}
1512
+
1513
+func BatchCreateTB_HIS_MZ_Fee_Detail(ps *sz.TB_HIS_MZ_Fee_Detail, rdb *gorm.DB) (err error) {
1514
+	err = rdb.Create(&ps).Error
1515
+	return err
1516
+}

+ 2 - 2
service/db.go View File

@@ -20,7 +20,7 @@ import (
20 20
 	"fmt"
21 21
 	"github.com/astaxie/beego"
22 22
 	"github.com/jinzhu/gorm"
23
-	_ "github.com/jinzhu/gorm/dialects/mssql"
23
+	 _"github.com/jinzhu/gorm/dialects/mssql"
24 24
 	_ "github.com/jinzhu/gorm/dialects/mysql" // mysql
25 25
 )
26 26
 
@@ -45,7 +45,7 @@ func CreateDB(Host string, Port string, User string, Pass string, Name string) (
45 45
 
46 46
 func CreateSqlServiceDB(Host string, Port string, User string, Pass string, Name string) (mssqlDb *gorm.DB, err error) {
47 47
 	//rdb := fmt.Sprintf("%s:%s@tcp(%s:%s)/%s?charset=utf8mb4&parseTime=true", User, Pass, Host, Port, Name)
48
-	mssqlstring := fmt.Sprintf("server=%s;port=%s;database=%s;user id=%s;password=%s", Host, Port, Name, User, Pass)
48
+	mssqlstring := fmt.Sprintf("server=%s;port=%s;database=%s;user id=%s;password=%s;encrypt=disable", Host, Port, Name, User, Pass)
49 49
 	fmt.Println(mssqlstring)
50 50
 	mssqlDb, err = gorm.Open("mssql", mssqlstring)
51 51
 	if err != nil {