csx 2 years ago
parent
commit
8953b3ef53
2 changed files with 178 additions and 170 deletions
  1. 159 163
      models/lis_model.go
  2. 19 7
      service/bl_service.go

+ 159 - 163
models/lis_model.go View File

@@ -70,14 +70,13 @@ func (FiledConfig) TableName() string {
70 70
 }
71 71
 
72 72
 type MiddlePatients struct {
73
-	ID             	int64 `gorm:"column:id" json:"id" form:"id"`
74
-	UserOrgId		int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
75
-	UserId       	int64 `gorm:"column:user_id" json:"user_id" form:"user_id"`
76
-	HisUserId  		string `gorm:"column:his_user_id" json:"his_user_id" form:"his_user_id"`
77
-	XtPatientId  	int64 `gorm:"column:xt_patient_id" json:"xt_patient_id" form:"xt_patient_id"`
78
-	SelectType  	int64 `gorm:"column:select_type" json:"select_type" form:"select_type"`
79
-	Status 			int	  `gorm:"column:status" json:"status" form:"status"`
80
-
73
+	ID          int64  `gorm:"column:id" json:"id" form:"id"`
74
+	UserOrgId   int64  `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
75
+	UserId      int64  `gorm:"column:user_id" json:"user_id" form:"user_id"`
76
+	HisUserId   string `gorm:"column:his_user_id" json:"his_user_id" form:"his_user_id"`
77
+	XtPatientId int64  `gorm:"column:xt_patient_id" json:"xt_patient_id" form:"xt_patient_id"`
78
+	SelectType  int64  `gorm:"column:select_type" json:"select_type" form:"select_type"`
79
+	Status      int    `gorm:"column:status" json:"status" form:"status"`
81 80
 }
82 81
 
83 82
 func (MiddlePatients) TableName() string {
@@ -85,14 +84,15 @@ func (MiddlePatients) TableName() string {
85 84
 }
86 85
 
87 86
 type Patients struct {
88
-	ID				int64	`gorm:"column:id" json:"id" form:"id"`
89
-	UserOrgId		int64	`gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
90
-	UserId			int64	`gorm:"column:user_id" json:"user_id" form:"user_id"`
91
-	AdmissionNumber	string	`gorm:"column:admission_number" json:"admission_number" form:"admission_number"`
92
-	DialysisNo		string	`gorm:"column:dialysis_no" json:"dialysis_no" form:"dialysis_no"`
93
-	IdCardNo		string	`gorm:"column:id_card_no" json:"id_card_no" form:"id_card_no"`
94
-	Name			string	`gorm:"column:name" json:"name" form:"name"`
95
-	ContactName		string	`gorm:"column:contact_name" json:"contact_name" form:"contact_name"`
87
+	ID              int64  `gorm:"column:id" json:"id" form:"id"`
88
+	UserOrgId       int64  `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
89
+	UserId          int64  `gorm:"column:user_id" json:"user_id" form:"user_id"`
90
+	AdmissionNumber string `gorm:"column:admission_number" json:"admission_number" form:"admission_number"`
91
+	DialysisNo      string `gorm:"column:dialysis_no" json:"dialysis_no" form:"dialysis_no"`
92
+	IdCardNo        string `gorm:"column:id_card_no" json:"id_card_no" form:"id_card_no"`
93
+	Name            string `gorm:"column:name" json:"name" form:"name"`
94
+	ContactName     string `gorm:"column:contact_name" json:"contact_name" form:"contact_name"`
95
+	Gender          int64  `gorm:"column:gender" json:"gender" form:"gender"`
96 96
 }
97 97
 
98 98
 func (Patients) TableName() string {
@@ -100,38 +100,37 @@ func (Patients) TableName() string {
100 100
 }
101 101
 
102 102
 type DialysisSchedule struct {
103
-	ID           int64 `gorm:"column:id" json:"id" form:"id"`
104
-	UserOrgId    int64 `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
105
-	PartitionId  int64 `gorm:"column:partition_id" json:"partition_id" form:"partition_id"`
106
-	BedId        int64 `gorm:"column:bed_id" json:"bed_id" form:"bed_id"`
107
-	PatientId    int64 `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
108
-	ScheduleDate int64 `gorm:"column:schedule_date" json:"schedule_date" form:"schedule_date"`
109
-	ScheduleType int64 `gorm:"column:schedule_type" json:"schedule_type" form:"schedule_type"`
110
-	ScheduleWeek int64 `gorm:"column:schedule_week" json:"schedule_week" form:"schedule_week"`
111
-	ModeId       int64 `gorm:"column:mode_id" json:"mode_id" form:"mode_id"`
112
-	Status       int64 `gorm:"column:status" json:"status" form:"status"`
113
-	CreatedTime  int64 `gorm:"column:created_time" json:"created_time" form:"created_time"`
114
-	UpdatedTime  int64 `gorm:"column:updated_time" json:"updated_time" form:"updated_time"`
115
-	Patients Patients `gorm:"ForeignKey:PatientId" json:"patient"`
103
+	ID           int64    `gorm:"column:id" json:"id" form:"id"`
104
+	UserOrgId    int64    `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
105
+	PartitionId  int64    `gorm:"column:partition_id" json:"partition_id" form:"partition_id"`
106
+	BedId        int64    `gorm:"column:bed_id" json:"bed_id" form:"bed_id"`
107
+	PatientId    int64    `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
108
+	ScheduleDate int64    `gorm:"column:schedule_date" json:"schedule_date" form:"schedule_date"`
109
+	ScheduleType int64    `gorm:"column:schedule_type" json:"schedule_type" form:"schedule_type"`
110
+	ScheduleWeek int64    `gorm:"column:schedule_week" json:"schedule_week" form:"schedule_week"`
111
+	ModeId       int64    `gorm:"column:mode_id" json:"mode_id" form:"mode_id"`
112
+	Status       int64    `gorm:"column:status" json:"status" form:"status"`
113
+	CreatedTime  int64    `gorm:"column:created_time" json:"created_time" form:"created_time"`
114
+	UpdatedTime  int64    `gorm:"column:updated_time" json:"updated_time" form:"updated_time"`
115
+	Patients     Patients `gorm:"ForeignKey:PatientId" json:"patient"`
116 116
 }
117 117
 
118 118
 func (DialysisSchedule) TableName() string {
119 119
 	return "xt_schedule"
120 120
 }
121 121
 
122
-
123 122
 type MiddleSyncInfo struct {
124
-	ID             	int64 `gorm:"column:id" json:"id" form:"id"`
125
-	OrgId       	int64 `gorm:"column:org_id" json:"org_id" form:"org_id"`
123
+	ID              int64  `gorm:"column:id" json:"id" form:"id"`
124
+	OrgId           int64  `gorm:"column:org_id" json:"org_id" form:"org_id"`
126 125
 	HisUserId       string `gorm:"column:his_user_id" json:"his_user_id" form:"his_user_id"`
127
-	SyncTime       	int64 `gorm:"column:sync_time" json:"sync_time" form:"sync_time"`
128
-	SyncResultType  int	  `gorm:"column:sync_result_type" json:"sync_result_type" form:"sync_result_type"`
126
+	SyncTime        int64  `gorm:"column:sync_time" json:"sync_time" form:"sync_time"`
127
+	SyncResultType  int    `gorm:"column:sync_result_type" json:"sync_result_type" form:"sync_result_type"`
129 128
 	SyncRsultRemark string `gorm:"column:sync_result_remark" json:"sync_result_remark" form:"sync_result_remark"`
130
-	SyncTotalNum    int64 `gorm:"column:sync_total_num" json:"sync_total_num" form:"sync_total_num"`
131
-	SyncSuccessNum  int64 `gorm:"column:sync_success_num" json:"sync_success_num" form:"sync_success_num"`
132
-	SyncInfo      	string `gorm:"column:sync_info" json:"sync_info" form:"sync_info"`
133
-	CreateTime      int64 `gorm:"column:create_time" json:"create_time" form:"create_time"`
134
-	UpdateTime    	int64 `gorm:"column:update_time" json:"update_time" form:"update_time"`
129
+	SyncTotalNum    int64  `gorm:"column:sync_total_num" json:"sync_total_num" form:"sync_total_num"`
130
+	SyncSuccessNum  int64  `gorm:"column:sync_success_num" json:"sync_success_num" form:"sync_success_num"`
131
+	SyncInfo        string `gorm:"column:sync_info" json:"sync_info" form:"sync_info"`
132
+	CreateTime      int64  `gorm:"column:create_time" json:"create_time" form:"create_time"`
133
+	UpdateTime      int64  `gorm:"column:update_time" json:"update_time" form:"update_time"`
135 134
 }
136 135
 
137 136
 func (MiddleSyncInfo) TableName() string {
@@ -139,21 +138,21 @@ func (MiddleSyncInfo) TableName() string {
139 138
 }
140 139
 
141 140
 type TBLISItem struct {
142
-	HisUserId             	string  `gorm:"column:his_user_id" json:"his_user_id" form:"his_user_id"`
143
-	ProjectId       		int64  `gorm:"column:project_id" json:"project_id" form:"project_id"`
144
-	ProjectName         	string `gorm:"column:project_name" json:"project_name" form:"project_name"`
145
-	PatientName         	string `gorm:"column:patient_name" json:"patient_name" form:"patient_name"`
146
-	InspectDate          	string  `gorm:"column:inspect_date" json:"inspect_date" form:"inspect_date"`
147
-	ItemId           		int64 `gorm:"column:item_id" json:"item_id" form:"item_id"`
148
-	ItemName      			string `gorm:"column:item_name" json:"item_name" form:"item_name"`
149
-	ItemType          		int    `gorm:"column:item_type" json:"item_type" form:"item_type"`
150
-	ItemValue    			string `gorm:"column:item_value" json:"item_value" form:"item_value"`
151
-	RangeMin    			string `gorm:"column:range_min" json:"range_min" form:"range_min"`
152
-	RangeMax    			string `gorm:"column:range_max" json:"range_max" form:"range_max"`
153
-	RangeValue   			string  `gorm:"column:range_value" json:"range_value" form:"range_value"`
154
-	RangeOptions         	string  `gorm:"column:range_options" json:"range_options" form:"range_options"`
155
-	Unit         			string `gorm:"column:unit" json:"unit" form:"unit"`
156
-	UTime 					string  `gorm:"column:u_time" json:"u_time" form:"u_time"`
141
+	HisUserId    string `gorm:"column:his_user_id" json:"his_user_id" form:"his_user_id"`
142
+	ProjectId    int64  `gorm:"column:project_id" json:"project_id" form:"project_id"`
143
+	ProjectName  string `gorm:"column:project_name" json:"project_name" form:"project_name"`
144
+	PatientName  string `gorm:"column:patient_name" json:"patient_name" form:"patient_name"`
145
+	InspectDate  string `gorm:"column:inspect_date" json:"inspect_date" form:"inspect_date"`
146
+	ItemId       int64  `gorm:"column:item_id" json:"item_id" form:"item_id"`
147
+	ItemName     string `gorm:"column:item_name" json:"item_name" form:"item_name"`
148
+	ItemType     int    `gorm:"column:item_type" json:"item_type" form:"item_type"`
149
+	ItemValue    string `gorm:"column:item_value" json:"item_value" form:"item_value"`
150
+	RangeMin     string `gorm:"column:range_min" json:"range_min" form:"range_min"`
151
+	RangeMax     string `gorm:"column:range_max" json:"range_max" form:"range_max"`
152
+	RangeValue   string `gorm:"column:range_value" json:"range_value" form:"range_value"`
153
+	RangeOptions string `gorm:"column:range_options" json:"range_options" form:"range_options"`
154
+	Unit         string `gorm:"column:unit" json:"unit" form:"unit"`
155
+	UTime        string `gorm:"column:u_time" json:"u_time" form:"u_time"`
157 156
 }
158 157
 
159 158
 func (TBLISItem) TableName() string {
@@ -161,46 +160,45 @@ func (TBLISItem) TableName() string {
161 160
 }
162 161
 
163 162
 type Inspection struct {
164
-	ID int64 `gorm:"column:id" json:"id" form:"id"`
165
-	PatientId int64 `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
166
-	OrgId int64 `gorm:"column:org_id" json:"org_id" form:"org_id"`
167
-	ProjectId int64 `gorm:"column:project_id" json:"project_id" form:"project_id"`
168
-	ItemId int64 `gorm:"column:item_id" json:"item_id" form:"item_id"`
169
-	ItemName string `gorm:"column:item_name" json:"item_name" form:"item_name"`
170
-	ProjectName string `gorm:"column:project_name" json:"project_name" form:"project_name"`
171
-	InspectType int64 `gorm:"column:inspect_type" json:"inspect_type" form:"inspect_type"`
163
+	ID           int64  `gorm:"column:id" json:"id" form:"id"`
164
+	PatientId    int64  `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
165
+	OrgId        int64  `gorm:"column:org_id" json:"org_id" form:"org_id"`
166
+	ProjectId    int64  `gorm:"column:project_id" json:"project_id" form:"project_id"`
167
+	ItemId       int64  `gorm:"column:item_id" json:"item_id" form:"item_id"`
168
+	ItemName     string `gorm:"column:item_name" json:"item_name" form:"item_name"`
169
+	ProjectName  string `gorm:"column:project_name" json:"project_name" form:"project_name"`
170
+	InspectType  int64  `gorm:"column:inspect_type" json:"inspect_type" form:"inspect_type"`
172 171
 	InspectValue string `gorm:"column:inspect_value" json:"inspect_value" form:"inspect_value"`
173
-	InspectTips string `gorm:"column:inspect_tips" json:"inspect_tips" form:"inspect_tips"`
174
-	InspectDate int64 `gorm:"column:inspect_date" json:"inspect_date" form:"inspect_date"`
175
-	Status int64 `gorm:"column:status" json:"status" form:"status"`
176
-	CreatedTime int64 `gorm:"column:created_time" json:"created_time" form:"created_time"`
177
-	UpdatedTime int64 `gorm:"column:updated_time" json:"updated_time" form:"updated_time"`
172
+	InspectTips  string `gorm:"column:inspect_tips" json:"inspect_tips" form:"inspect_tips"`
173
+	InspectDate  int64  `gorm:"column:inspect_date" json:"inspect_date" form:"inspect_date"`
174
+	Status       int64  `gorm:"column:status" json:"status" form:"status"`
175
+	CreatedTime  int64  `gorm:"column:created_time" json:"created_time" form:"created_time"`
176
+	UpdatedTime  int64  `gorm:"column:updated_time" json:"updated_time" form:"updated_time"`
178 177
 }
179 178
 
180
-
181 179
 func (Inspection) TableName() string {
182 180
 	return "xt_inspection"
183 181
 }
184 182
 
185 183
 type InspectionReference struct {
186
-	ID int64 `gorm:"column:id" json:"id" form:"id"`
187
-	OrgId int64 `gorm:"column:org_id" json:"org_id" form:"org_id"`
188
-	ProjectName string `gorm:"column:project_name" json:"project_name" form:"project_name"`
189
-	Project string `gorm:"column:project" json:"project" form:"project"`
190
-	ProjectId int64 `gorm:"column:project_id" json:"project_id" form:"project_id"`
191
-	ItemName string `gorm:"column:item_name" json:"item_name" form:"item_name"`
184
+	ID               int64  `gorm:"column:id" json:"id" form:"id"`
185
+	OrgId            int64  `gorm:"column:org_id" json:"org_id" form:"org_id"`
186
+	ProjectName      string `gorm:"column:project_name" json:"project_name" form:"project_name"`
187
+	Project          string `gorm:"column:project" json:"project" form:"project"`
188
+	ProjectId        int64  `gorm:"column:project_id" json:"project_id" form:"project_id"`
189
+	ItemName         string `gorm:"column:item_name" json:"item_name" form:"item_name"`
192 190
 	ItemNameAddition string `gorm:"column:item_name_addition" json:"item_name_addition" form:"item_name_addition"`
193
-	Item string `gorm:"column:item" json:"item" form:"item"`
194
-	ItemId int64 `gorm:"column:item_id" json:"item_id" form:"item_id"`
195
-	RangeType int `gorm:"column:range_type" json:"range_type" form:"range_type"`
196
-	RangeMin string `gorm:"column:range_min" json:"range_min" form:"range_min"`
197
-	RangeMax string `gorm:"column:range_max" json:"range_max" form:"range_max"`
198
-	RangeValue string `gorm:"column:range_value" json:"range_value" form:"range_value"`
199
-	RangeOptions string `gorm:"column:range_options" json:"range_options" form:"range_options"`
200
-	Unit string `gorm:"column:unit" json:"unit" form:"unit"`
201
-	Status int64 `gorm:"column:status" json:"status" form:"status"`
202
-	CreatedTime int64 `gorm:"column:created_time" json:"created_time" form:"created_time"`
203
-	UpdatedTime int64 `gorm:"column:updated_time" json:"updated_time" form:"updated_time"`
191
+	Item             string `gorm:"column:item" json:"item" form:"item"`
192
+	ItemId           int64  `gorm:"column:item_id" json:"item_id" form:"item_id"`
193
+	RangeType        int    `gorm:"column:range_type" json:"range_type" form:"range_type"`
194
+	RangeMin         string `gorm:"column:range_min" json:"range_min" form:"range_min"`
195
+	RangeMax         string `gorm:"column:range_max" json:"range_max" form:"range_max"`
196
+	RangeValue       string `gorm:"column:range_value" json:"range_value" form:"range_value"`
197
+	RangeOptions     string `gorm:"column:range_options" json:"range_options" form:"range_options"`
198
+	Unit             string `gorm:"column:unit" json:"unit" form:"unit"`
199
+	Status           int64  `gorm:"column:status" json:"status" form:"status"`
200
+	CreatedTime      int64  `gorm:"column:created_time" json:"created_time" form:"created_time"`
201
+	UpdatedTime      int64  `gorm:"column:updated_time" json:"updated_time" form:"updated_time"`
204 202
 }
205 203
 
206 204
 func (InspectionReference) TableName() string {
@@ -208,86 +206,84 @@ func (InspectionReference) TableName() string {
208 206
 }
209 207
 
210 208
 type MiddleReportHandle struct {
211
-	ID int64 `gorm:"column:id" json:"id" form:"id"`
212
-	OrgId int64 `gorm:"column:org_id" json:"org_id" form:"org_id"`
213
-	HisUserId string `gorm:"column:his_user_id" json:"his_user_id" form:"his_user_id"`
214
-	ApplyNo string `gorm:"column:apply_no" json:"apply_no" form:"apply_no"`
215
-	ReportId string `gorm:"column:report_id" json:"report_id" form:"report_id"`
216
-	Name string `gorm:"column:name" json:"name" form:"name"`
217
-	Sex string `gorm:"column:sex" json:"sex" form:"sex"`
218
-	Age string `gorm:"column:age" json:"age" form:"age"`
219
-	Dept string `gorm:"column:dept" json:"dept" form:"dept"`
220
-	PatientId string `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
221
-	RequestTime string `gorm:"column:request_time" json:"request_time" form:"request_time"`
222
-	ExecuteTime string `gorm:"column:execute_time" json:"execute_time" form:"execute_time"`
223
-	ReceiveTime string `gorm:"column:receive_time" json:"receive_time" form:"receive_time"`
224
-	Item string `gorm:"column:item" json:"item" form:"item"`
225
-	CheckTime string `gorm:"column:check_time" json:"check_time" form:"check_time"`
226
-	PatientType string `gorm:"column:patient_type" json:"patient_type" form:"patient_type"`
227
-	ReportInfo string `gorm:"column:report_info" json:"report_info" form:"report_info"`
228
-	ReportInfoItemNum int64 `gorm:"column:report_info_item_num" json:"report_info_item_num" form:"report_info_item_num"`
229
-	ReportInfoItemHandleNum int64 `gorm:"column:report_info_item_handle_num" json:"report_info_item_handle_num" form:"report_info_item_handle_num"`
230
-	HandleType int64 `gorm:"column:handle_type" json:"handle_type" form:"handle_type"`
231
-	CreatedTime int64 `gorm:"column:created_time" json:"created_time" form:"created_time"`
232
-	UpdatedTime int64 `gorm:"column:updated_time" json:"updated_time" form:"updated_time"`
209
+	ID                      int64  `gorm:"column:id" json:"id" form:"id"`
210
+	OrgId                   int64  `gorm:"column:org_id" json:"org_id" form:"org_id"`
211
+	HisUserId               string `gorm:"column:his_user_id" json:"his_user_id" form:"his_user_id"`
212
+	ApplyNo                 string `gorm:"column:apply_no" json:"apply_no" form:"apply_no"`
213
+	ReportId                string `gorm:"column:report_id" json:"report_id" form:"report_id"`
214
+	Name                    string `gorm:"column:name" json:"name" form:"name"`
215
+	Sex                     string `gorm:"column:sex" json:"sex" form:"sex"`
216
+	Age                     string `gorm:"column:age" json:"age" form:"age"`
217
+	Dept                    string `gorm:"column:dept" json:"dept" form:"dept"`
218
+	PatientId               string `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
219
+	RequestTime             string `gorm:"column:request_time" json:"request_time" form:"request_time"`
220
+	ExecuteTime             string `gorm:"column:execute_time" json:"execute_time" form:"execute_time"`
221
+	ReceiveTime             string `gorm:"column:receive_time" json:"receive_time" form:"receive_time"`
222
+	Item                    string `gorm:"column:item" json:"item" form:"item"`
223
+	CheckTime               string `gorm:"column:check_time" json:"check_time" form:"check_time"`
224
+	PatientType             string `gorm:"column:patient_type" json:"patient_type" form:"patient_type"`
225
+	ReportInfo              string `gorm:"column:report_info" json:"report_info" form:"report_info"`
226
+	ReportInfoItemNum       int64  `gorm:"column:report_info_item_num" json:"report_info_item_num" form:"report_info_item_num"`
227
+	ReportInfoItemHandleNum int64  `gorm:"column:report_info_item_handle_num" json:"report_info_item_handle_num" form:"report_info_item_handle_num"`
228
+	HandleType              int64  `gorm:"column:handle_type" json:"handle_type" form:"handle_type"`
229
+	CreatedTime             int64  `gorm:"column:created_time" json:"created_time" form:"created_time"`
230
+	UpdatedTime             int64  `gorm:"column:updated_time" json:"updated_time" form:"updated_time"`
233 231
 }
234 232
 
235
-
236 233
 func (MiddleReportHandle) TableName() string {
237 234
 	return "xt_middle_report_handle"
238 235
 }
239 236
 
240 237
 type MiddleInspection struct {
241
-	ID int64 `gorm:"column:id" json:"id" form:"id"`
242
-	PatientId int64 `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
243
-	OrgId int64 `gorm:"column:org_id" json:"org_id" form:"org_id"`
244
-	ProjectId int64 `gorm:"column:project_id" json:"project_id" form:"project_id"`
245
-	ItemId int64 `gorm:"column:item_id" json:"item_id" form:"item_id"`
246
-	ItemName string `gorm:"column:item_name" json:"item_name" form:"item_name"`
247
-	ProjectName string `gorm:"column:project_name" json:"project_name" form:"project_name"`
248
-	InspectType int `gorm:"column:inspect_type" json:"inspect_type" form:"inspect_type"`
238
+	ID           int64  `gorm:"column:id" json:"id" form:"id"`
239
+	PatientId    int64  `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
240
+	OrgId        int64  `gorm:"column:org_id" json:"org_id" form:"org_id"`
241
+	ProjectId    int64  `gorm:"column:project_id" json:"project_id" form:"project_id"`
242
+	ItemId       int64  `gorm:"column:item_id" json:"item_id" form:"item_id"`
243
+	ItemName     string `gorm:"column:item_name" json:"item_name" form:"item_name"`
244
+	ProjectName  string `gorm:"column:project_name" json:"project_name" form:"project_name"`
245
+	InspectType  int    `gorm:"column:inspect_type" json:"inspect_type" form:"inspect_type"`
249 246
 	InspectValue string `gorm:"column:inspect_value" json:"inspect_value" form:"inspect_value"`
250
-	InspectTips string `gorm:"column:inspect_tips" json:"inspect_tips" form:"inspect_tips"`
251
-	RecordDate int64 `gorm:"column:record_date" json:"record_date" form:"record_date"`
252
-	InspectDate string `gorm:"column:inspect_date" json:"inspect_date" form:"inspect_date"`
253
-	Status int64 `gorm:"column:status" json:"status" form:"status"`
254
-	CreatedTime int64 `gorm:"column:created_time" json:"created_time" form:"created_time"`
255
-	UpdatedTime int64 `gorm:"column:updated_time" json:"updated_time" form:"updated_time"`
256
-	UTime string `gorm:"column:u_time" json:"u_time" form:"u_time"`
257
-	IsSync int `gorm:"column:is_sync" json:"is_sync" form:"is_sync"`
247
+	InspectTips  string `gorm:"column:inspect_tips" json:"inspect_tips" form:"inspect_tips"`
248
+	RecordDate   int64  `gorm:"column:record_date" json:"record_date" form:"record_date"`
249
+	InspectDate  string `gorm:"column:inspect_date" json:"inspect_date" form:"inspect_date"`
250
+	Status       int64  `gorm:"column:status" json:"status" form:"status"`
251
+	CreatedTime  int64  `gorm:"column:created_time" json:"created_time" form:"created_time"`
252
+	UpdatedTime  int64  `gorm:"column:updated_time" json:"updated_time" form:"updated_time"`
253
+	UTime        string `gorm:"column:u_time" json:"u_time" form:"u_time"`
254
+	IsSync       int    `gorm:"column:is_sync" json:"is_sync" form:"is_sync"`
258 255
 	// SyncItemId int64 `gorm:"column:sync_item_id" json:"sync_item_id" form:"sync_item_id"`
259 256
 	HisUserId string `gorm:"column:his_user_id" json:"his_user_id" form:"his_user_id"`
260
-	SyncId			int64 `gorm:"column:sync_id" json:"sync_id" form:"sync_id"`
257
+	SyncId    int64  `gorm:"column:sync_id" json:"sync_id" form:"sync_id"`
261 258
 }
262 259
 
263
-
264 260
 func (MiddleInspection) TableName() string {
265 261
 	return "xt_middle_inspection"
266 262
 }
267 263
 
268 264
 type MiddleInspectionReference struct {
269
-	ID 					int64 `gorm:"column:id" json:"id" form:"id"`
270
-	OrgId 				int64 `gorm:"column:org_id" json:"org_id" form:"org_id"`
271
-	ProjectName 		string `gorm:"column:project_name" json:"project_name" form:"project_name"`
272
-	Project 			string `gorm:"column:project" json:"project" form:"project"`
273
-	ProjectId 			int64 `gorm:"column:project_id" json:"project_id" form:"project_id"`
274
-	ItemName 			string `gorm:"column:item_name" json:"item_name" form:"item_name"`
275
-	ItemId 				int64 `gorm:"column:item_id" json:"item_id" form:"item_id"`
276
-	ItemNameAddition 	string `gorm:"column:item_name_addition" json:"item_name_addition" form:"item_name_addition"`
277
-	Item 				string `gorm:"column:item" json:"item" form:"item"`
278
-	RangeType 			int `gorm:"column:range_type" json:"range_type" form:"range_type"`
279
-	RangeMin 			string `gorm:"column:range_min" json:"range_min" form:"range_min"`
280
-	RangeMax 			string `gorm:"column:range_max" json:"range_max" form:"range_max"`
281
-	RangeValue 			string `gorm:"column:range_value" json:"range_value" form:"range_value"`
282
-	RangeOptions 		string `gorm:"column:range_options" json:"range_options" form:"range_options"`
283
-	Unit 				string `gorm:"column:unit" json:"unit" form:"unit"`
284
-	Status 				int64 `gorm:"column:status" json:"status" form:"status"`
285
-	CreatedTime 		int64 `gorm:"column:created_time" json:"created_time" form:"created_time"`
286
-	UpdatedTime 		int64 `gorm:"column:updated_time" json:"updated_time" form:"updated_time"`
287
-	InspectDate 		string `gorm:"column:inspect_date" json:"inspect_date" form:"inspect_date"`
288
-	IsSync 				int `gorm:"column:is_sync" json:"is_sync" form:"is_sync"`
289
-	UTime 				string `gorm:"column:u_time" json:"u_time" form:"u_time"`
290
-	SyncId				int64 `gorm:"column:sync_id" json:"sync_id" form:"sync_id"`
265
+	ID               int64  `gorm:"column:id" json:"id" form:"id"`
266
+	OrgId            int64  `gorm:"column:org_id" json:"org_id" form:"org_id"`
267
+	ProjectName      string `gorm:"column:project_name" json:"project_name" form:"project_name"`
268
+	Project          string `gorm:"column:project" json:"project" form:"project"`
269
+	ProjectId        int64  `gorm:"column:project_id" json:"project_id" form:"project_id"`
270
+	ItemName         string `gorm:"column:item_name" json:"item_name" form:"item_name"`
271
+	ItemId           int64  `gorm:"column:item_id" json:"item_id" form:"item_id"`
272
+	ItemNameAddition string `gorm:"column:item_name_addition" json:"item_name_addition" form:"item_name_addition"`
273
+	Item             string `gorm:"column:item" json:"item" form:"item"`
274
+	RangeType        int    `gorm:"column:range_type" json:"range_type" form:"range_type"`
275
+	RangeMin         string `gorm:"column:range_min" json:"range_min" form:"range_min"`
276
+	RangeMax         string `gorm:"column:range_max" json:"range_max" form:"range_max"`
277
+	RangeValue       string `gorm:"column:range_value" json:"range_value" form:"range_value"`
278
+	RangeOptions     string `gorm:"column:range_options" json:"range_options" form:"range_options"`
279
+	Unit             string `gorm:"column:unit" json:"unit" form:"unit"`
280
+	Status           int64  `gorm:"column:status" json:"status" form:"status"`
281
+	CreatedTime      int64  `gorm:"column:created_time" json:"created_time" form:"created_time"`
282
+	UpdatedTime      int64  `gorm:"column:updated_time" json:"updated_time" form:"updated_time"`
283
+	InspectDate      string `gorm:"column:inspect_date" json:"inspect_date" form:"inspect_date"`
284
+	IsSync           int    `gorm:"column:is_sync" json:"is_sync" form:"is_sync"`
285
+	UTime            string `gorm:"column:u_time" json:"u_time" form:"u_time"`
286
+	SyncId           int64  `gorm:"column:sync_id" json:"sync_id" form:"sync_id"`
291 287
 }
292 288
 
293 289
 func (MiddleInspectionReference) TableName() string {
@@ -339,7 +335,7 @@ type XtDoctorAdvice struct {
339 335
 	TemplateId            string  `gorm:"column:template_id" json:"template_id" form:"template_id"`
340 336
 	Modifier              int64   `gorm:"column:modifier" json:"modifier" form:"modifier"`
341 337
 	SyncAdviceId          int64   `gorm:"column:sync_advice_id" json:"sync_advice_id" form:"sync_advice_id"`
342
-	IsSync          	  int64   `gorm:"column:is_sync" json:"is_sync" form:"is_sync"`
338
+	IsSync                int64   `gorm:"column:is_sync" json:"is_sync" form:"is_sync"`
343 339
 }
344 340
 
345 341
 func (XtDoctorAdvice) TableName() string {
@@ -347,21 +343,21 @@ func (XtDoctorAdvice) TableName() string {
347 343
 }
348 344
 
349 345
 type UserAdminRole struct {
350
-	ID              int64           `gorm:"column:id" json:"id"`
351
-	AdminUserId     int64           `gorm:"column:admin_user_id" json:"admin_user_id"`
352
-	OrgId           int64           `gorm:"column:org_id" json:"org_id"`
353
-	AppId           int64           `gorm:"column:app_id" json:"app_id"`
354
-	RoleId          int64           `gorm:"column:role_id" json:"role_id"`
355
-	UserName        string          `gorm:"column:user_name" json:"user_name"`
356
-	Avatar          string          `gorm:"column:avatar" json:"avatar"`
357
-	UserType        int64           `gorm:"column:user_type" json:"user_type"`
358
-	UserTitle       int64           `gorm:"column:user_title" json:"user_title"`
359
-	Intro           string          `gorm:"column:intro" json:"intro"`
360
-	Status          int64           `gorm:"column:status" json:"status"`
361
-	Ctime           int64           `gorm:"column:ctime" json:"ctime"`
362
-	Mtime           int64           `gorm:"column:mtime" json:"mtime"`
346
+	ID          int64  `gorm:"column:id" json:"id"`
347
+	AdminUserId int64  `gorm:"column:admin_user_id" json:"admin_user_id"`
348
+	OrgId       int64  `gorm:"column:org_id" json:"org_id"`
349
+	AppId       int64  `gorm:"column:app_id" json:"app_id"`
350
+	RoleId      int64  `gorm:"column:role_id" json:"role_id"`
351
+	UserName    string `gorm:"column:user_name" json:"user_name"`
352
+	Avatar      string `gorm:"column:avatar" json:"avatar"`
353
+	UserType    int64  `gorm:"column:user_type" json:"user_type"`
354
+	UserTitle   int64  `gorm:"column:user_title" json:"user_title"`
355
+	Intro       string `gorm:"column:intro" json:"intro"`
356
+	Status      int64  `gorm:"column:status" json:"status"`
357
+	Ctime       int64  `gorm:"column:ctime" json:"ctime"`
358
+	Mtime       int64  `gorm:"column:mtime" json:"mtime"`
363 359
 }
364 360
 
365 361
 func (UserAdminRole) TableName() string {
366 362
 	return "sgj_user_admin_role"
367
-}
363
+}

+ 19 - 7
service/bl_service.go View File

@@ -165,6 +165,7 @@ type HisLabelPrintInfo struct {
165 165
 	FeedetlSn              string                 `gorm:"column:feedetl_sn" json:"feedetl_sn" form:"feedetl_sn"`
166 166
 	PrescriptionId         int64                  `gorm:"column:prescription_id" json:"prescription_id" form:"prescription_id"`
167 167
 	HisPrescriptionProject HisPrescriptionProject `gorm:"ForeignKey:ID;AssociationForeignKey:PProjectId" json:"project"`
168
+	Patient                models.Patients        `gorm:"ForeignKey:ID;AssociationForeignKey:PatientId" json:"patient"`
168 169
 }
169 170
 
170 171
 func (HisLabelPrintInfo) TableName() string {
@@ -269,7 +270,7 @@ func GetLisDataById(org_id int64, last_id int64) (list []*HisLabelPrintInfo, err
269 270
 }
270 271
 
271 272
 func GetAllLisData(org_id int64) (list []*HisLabelPrintInfo, err error) {
272
-	err = readDb.Model(&HisLabelPrintInfo{}).Preload("HisPrescriptionProject", func(db *gorm.DB) *gorm.DB {
273
+	err = readDb.Model(&HisLabelPrintInfo{}).Preload("Patient", "stauts = 1").Preload("HisPrescriptionProject", func(db *gorm.DB) *gorm.DB {
273 274
 		return db.Preload("HisPrescription", func(db *gorm.DB) *gorm.DB {
274 275
 			return db.Preload("HisOrder", func(db *gorm.DB) *gorm.DB {
275 276
 				return db.Preload("XtHisPatient", func(db *gorm.DB) *gorm.DB {
@@ -308,11 +309,16 @@ func GetDataInsertDB(org_id int64) {
308 309
 				cms.Pno = item.HisPrescriptionProject.HisPrescription.HisOrder.MdtrtId
309 310
 				cms.Ptype = "门诊"
310 311
 				cms.Pname = item.HisPrescriptionProject.HisPrescription.HisOrder.XtHisPatient.Name
311
-				if item.HisPrescriptionProject.HisPrescription.HisOrder.XtHisPatient.Gender == 1 {
312
+
313
+				if item.Patient.Gender == 1 {
312 314
 					cms.Psex = "男"
313
-				} else if item.HisPrescriptionProject.HisPrescription.HisOrder.XtHisPatient.Gender == 2 {
315
+				} else if item.Patient.Gender == 2 {
314 316
 					cms.Psex = "女"
317
+				} else {
318
+					cms.Psex = "不详"
319
+
315 320
 				}
321
+
316 322
 				cms.Page = strconv.FormatInt(item.HisPrescriptionProject.HisPrescription.HisOrder.XtHisPatient.Age, 10)
317 323
 				cms.Pageunit = "岁"
318 324
 				cms.Departname = "肾病学专业"
@@ -427,11 +433,14 @@ func GetDataInsertDB(org_id int64) {
427 433
 					cms.Pno = item.HisPrescriptionProject.HisPrescription.HisOrder.MdtrtId
428 434
 					cms.Ptype = "门诊"
429 435
 					cms.Pname = item.HisPrescriptionProject.HisPrescription.HisOrder.XtHisPatient.Name
430
-					if item.HisPrescriptionProject.HisPrescription.HisOrder.XtHisPatient.Gender == 1 {
436
+					if item.Patient.Gender == 1 {
431 437
 						cms.Psex = "男"
432
-					} else if item.HisPrescriptionProject.HisPrescription.HisOrder.XtHisPatient.Gender == 2 {
438
+					} else if item.Patient.Gender == 2 {
433 439
 						cms.Psex = "女"
440
+					} else {
441
+						cms.Psex = "不详"
434 442
 					}
443
+
435 444
 					cms.Page = strconv.FormatInt(item.HisPrescriptionProject.HisPrescription.HisOrder.XtHisPatient.Age, 10)
436 445
 					cms.Pageunit = "岁"
437 446
 					cms.Departname = "肾病学专业"
@@ -470,11 +479,14 @@ func GetDataInsertDB(org_id int64) {
470 479
 					cms.Pno = item.HisPrescriptionProject.HisPrescription.HisOrder.MdtrtId
471 480
 					cms.Ptype = "门诊"
472 481
 					cms.Pname = item.HisPrescriptionProject.HisPrescription.HisOrder.XtHisPatient.Name
473
-					if item.HisPrescriptionProject.HisPrescription.HisOrder.XtHisPatient.Gender == 1 {
482
+					if item.Patient.Gender == 1 {
474 483
 						cms.Psex = "男"
475
-					} else if item.HisPrescriptionProject.HisPrescription.HisOrder.XtHisPatient.Gender == 2 {
484
+					} else if item.Patient.Gender == 2 {
476 485
 						cms.Psex = "女"
486
+					} else {
487
+						cms.Psex = "不详"
477 488
 					}
489
+
478 490
 					cms.Page = strconv.FormatInt(item.HisPrescriptionProject.HisPrescription.HisOrder.XtHisPatient.Age, 10)
479 491
 					cms.Pageunit = "岁"
480 492
 					cms.Departname = "肾病学专业"