|
@@ -111,12 +111,14 @@ func (c *HisApiController) Get2505() {
|
111
|
111
|
|
112
|
112
|
func (c *HisApiController) Get4201A() {
|
113
|
113
|
order_id, _ := c.GetInt64("order_id")
|
|
114
|
+ order_id = 172977
|
114
|
115
|
admin_user_id, _ := c.GetInt64("admin_user_id")
|
|
116
|
+ admin_user_id = 3432
|
115
|
117
|
order, _ := service.GetHisOrderByIDTwo(order_id)
|
116
|
118
|
his, _ := service.GetInHospitalRecordByNumber(order.MdtrtId)
|
117
|
119
|
order_info, _ := service.GetHisOrderInfoByNumber(order.MdtrtId)
|
118
|
120
|
order_info_two, _ := service.GetHisOrderInfoByNumberTwo(order.MdtrtId)
|
119
|
|
- order_info = append(order_info, order_info_two...)
|
|
121
|
+ //order_info = append(order_info, order_info_two...)
|
120
|
122
|
curRoles, _ := service.GetAdminUserInfoByID(c.GetAdminUserInfo().CurrentOrgId, admin_user_id)
|
121
|
123
|
miConfig, _ := service.FindMedicalInsuranceInfo(c.GetAdminUserInfo().CurrentOrgId)
|
122
|
124
|
department, _ := service.GetDepartMentDetail(his.Departments)
|
|
@@ -130,11 +132,12 @@ func (c *HisApiController) Get4201A() {
|
130
|
132
|
var struct4201A models.Struct4201A
|
131
|
133
|
var fsiOPFLDs []models.FsiOwnpayPatnFeeListDDTO
|
132
|
134
|
for _, items := range order_info {
|
|
135
|
+ memo := make(map[string]interface{})
|
|
136
|
+
|
133
|
137
|
var fsiOPFLD models.FsiOwnpayPatnFeeListDDTO
|
134
|
138
|
fsiOPFLD.FixmedinsMdtrtID = items.OrderNumber
|
135
|
139
|
fsiOPFLD.MedType = "14"
|
136
|
140
|
fsiOPFLD.BkkpSn = items.OrderNumber
|
137
|
|
- fsiOPFLD.FeeOcurTime = time.Unix(items.HisDoctorAdviceInfo.CreatedTime, 0).Format("2006-01-02 15:04:05")
|
138
|
141
|
fsiOPFLD.FixmedinsCode = miConfig.Code
|
139
|
142
|
fsiOPFLD.FixmedinsName = miConfig.OrgName
|
140
|
143
|
fsiOPFLD.Cnt = fmt.Sprintf("%.2f", items.Cnt)
|
|
@@ -142,38 +145,262 @@ func (c *HisApiController) Get4201A() {
|
142
|
145
|
fsiOPFLD.DetItemFeeSumamt = fmt.Sprintf("%.2f", items.DetItemFeeSumamt)
|
143
|
146
|
|
144
|
147
|
if items.AdviceId > 0 && items.ProjectId == 0 {
|
|
148
|
+ fsiOPFLD.FeeOcurTime = time.Unix(items.HisDoctorAdviceInfo.CreatedTime, 0).Format("2006-01-02 15:04:05")
|
|
149
|
+ fsiOPFLD.MedListCodg = items.HisDoctorAdviceInfo.BaseDrugLib.MedicalInsuranceNumber
|
|
150
|
+
|
145
|
151
|
fsiOPFLD.MedinsListCodg = items.HisDoctorAdviceInfo.BaseDrugLib.MedicalInsuranceNumber
|
146
|
152
|
fsiOPFLD.MedinsListName = items.HisDoctorAdviceInfo.BaseDrugLib.DrugName
|
147
|
153
|
fsiOPFLD.Prodname = items.HisDoctorAdviceInfo.BaseDrugLib.DrugName
|
148
|
154
|
fsiOPFLD.BilgDeptName = department.Name
|
149
|
155
|
fsiOPFLD.BilgDeptCodg = department.Number
|
150
|
|
- fsiOPFLD.BilgDrCode = doctor.DoctorCode
|
|
156
|
+ fsiOPFLD.BilgDrCode = doctor.DoctorNumber
|
151
|
157
|
fsiOPFLD.BilgDrName = doctor.UserName
|
|
158
|
+ fsiOPFLD.MedChrgitmType = "09"
|
152
|
159
|
|
153
|
160
|
} else if items.AdviceId == 0 && items.ProjectId > 0 {
|
|
161
|
+ fsiOPFLD.FeeOcurTime = time.Unix(items.HisPrescriptionProject.Ctime, 0).Format("2006-01-02 15:04:05")
|
|
162
|
+ fsiOPFLD.MedListCodg = items.HisPrescriptionProject.HisProject.MedicalCode
|
|
163
|
+
|
154
|
164
|
fsiOPFLD.MedinsListCodg = items.HisPrescriptionProject.HisProject.MedicalCode
|
155
|
|
- fsiOPFLD.MedinsListName = items.HisPrescriptionProject.HisProject.ProjectName
|
156
|
|
- fsiOPFLD.Prodname = items.HisPrescriptionProject.HisProject.ProjectName
|
157
|
165
|
fsiOPFLD.BilgDeptName = department.Name
|
158
|
166
|
fsiOPFLD.BilgDeptCodg = department.Number
|
159
|
|
- fsiOPFLD.BilgDrCode = doctor.DoctorCode
|
|
167
|
+ fsiOPFLD.BilgDrCode = doctor.DoctorNumber
|
160
|
168
|
fsiOPFLD.BilgDrName = doctor.UserName
|
|
169
|
+ if items.HisPrescriptionProject.Type == 2 {
|
|
170
|
+ fsiOPFLD.MedinsListName = items.HisPrescriptionProject.HisProject.ProjectName
|
|
171
|
+ fsiOPFLD.Prodname = items.HisPrescriptionProject.HisProject.ProjectName
|
|
172
|
+
|
|
173
|
+ switch items.HisPrescriptionProject.HisProject.CostClassify {
|
|
174
|
+ case 0:
|
|
175
|
+
|
|
176
|
+ break
|
|
177
|
+ case 1:
|
|
178
|
+ fsiOPFLD.MedChrgitmType = "14"
|
|
179
|
+ break
|
|
180
|
+ case 2:
|
|
181
|
+ fsiOPFLD.MedChrgitmType = "05"
|
|
182
|
+
|
|
183
|
+ break
|
|
184
|
+ case 3:
|
|
185
|
+ fsiOPFLD.MedChrgitmType = "03"
|
|
186
|
+
|
|
187
|
+ break
|
|
188
|
+ case 4:
|
|
189
|
+ fsiOPFLD.MedChrgitmType = "03"
|
|
190
|
+
|
|
191
|
+ break
|
|
192
|
+ case 5:
|
|
193
|
+ fsiOPFLD.MedChrgitmType = "08"
|
|
194
|
+
|
|
195
|
+ break
|
|
196
|
+ case 6:
|
|
197
|
+ fsiOPFLD.MedChrgitmType = "14"
|
|
198
|
+
|
|
199
|
+ break
|
|
200
|
+ case 7:
|
|
201
|
+ fsiOPFLD.MedChrgitmType = "14"
|
|
202
|
+
|
|
203
|
+ break
|
|
204
|
+ case 8:
|
|
205
|
+ fsiOPFLD.MedChrgitmType = "03"
|
|
206
|
+ break
|
|
207
|
+ case 9:
|
|
208
|
+ fsiOPFLD.MedChrgitmType = "14"
|
|
209
|
+ break
|
|
210
|
+ case 10:
|
|
211
|
+ fsiOPFLD.MedChrgitmType = "14"
|
|
212
|
+ break
|
|
213
|
+ case 11:
|
|
214
|
+ fsiOPFLD.MedChrgitmType = "06"
|
|
215
|
+ break
|
|
216
|
+ case 12:
|
|
217
|
+ fsiOPFLD.MedChrgitmType = "12"
|
|
218
|
+ break
|
|
219
|
+ case 13:
|
|
220
|
+ fsiOPFLD.MedChrgitmType = "01"
|
|
221
|
+ break
|
|
222
|
+ case 14:
|
|
223
|
+ fsiOPFLD.MedChrgitmType = "04"
|
|
224
|
+ break
|
|
225
|
+ case 15:
|
|
226
|
+ fsiOPFLD.MedChrgitmType = "14"
|
|
227
|
+ break
|
|
228
|
+
|
|
229
|
+ }
|
|
230
|
+ } else if items.HisPrescriptionProject.Type == 3 {
|
|
231
|
+ fsiOPFLD.MedinsListName = items.HisPrescriptionProject.GoodInfo.GoodName
|
|
232
|
+ fsiOPFLD.Prodname = items.HisPrescriptionProject.GoodInfo.GoodName
|
|
233
|
+
|
|
234
|
+ fsiOPFLD.MedChrgitmType = "08"
|
|
235
|
+ }
|
161
|
236
|
}
|
162
|
237
|
|
163
|
|
- //fsiOPFLD.DetItemFeeSumamt = items.DetItemFeeSumamt
|
164
|
|
- fsiOPFLD.MedChrgitmType = "09"
|
165
|
238
|
fsiOPFLD.Prodname = items.HisDoctorAdviceInfo.AdviceName
|
166
|
239
|
fsiOPFLD.BilgDeptCodg = department.Number
|
167
|
240
|
fsiOPFLD.BilgDeptName = department.Name
|
|
241
|
+ memo["hosp_appr_flag"] = "1"
|
|
242
|
+ memo["invoice_no"] = order.MdtrtId
|
|
243
|
+ memo["memo"] = "自费"
|
|
244
|
+ bytesData, _ := json.Marshal(memo)
|
|
245
|
+ fsiOPFLD.Memo = string(bytesData)
|
|
246
|
+
|
168
|
247
|
fsiOPFLDs = append(fsiOPFLDs, fsiOPFLD)
|
169
|
248
|
}
|
|
249
|
+ for _, items := range order_info_two {
|
|
250
|
+ memo := make(map[string]interface{})
|
|
251
|
+ var fsiOPFLD models.FsiOwnpayPatnFeeListDDTO
|
|
252
|
+ fsiOPFLD.FixmedinsMdtrtID = items.OrderNumber
|
|
253
|
+ fsiOPFLD.MedType = "14"
|
|
254
|
+ fsiOPFLD.BkkpSn = items.OrderNumber
|
|
255
|
+ fsiOPFLD.FixmedinsCode = miConfig.Code
|
|
256
|
+ fsiOPFLD.FixmedinsName = miConfig.OrgName
|
|
257
|
+ fsiOPFLD.Cnt = fmt.Sprintf("%.2f", items.Cnt)
|
|
258
|
+ fsiOPFLD.Pric = fmt.Sprintf("%.2f", items.Pric)
|
|
259
|
+ fsiOPFLD.DetItemFeeSumamt = fmt.Sprintf("%.2f", items.DetItemFeeSumamt)
|
|
260
|
+
|
|
261
|
+ if items.AdviceId > 0 && items.ProjectId == 0 {
|
|
262
|
+ fsiOPFLD.FeeOcurTime = time.Unix(items.HisDoctorAdviceInfo.CreatedTime, 0).Format("2006-01-02 15:04:05")
|
|
263
|
+ fsiOPFLD.MedListCodg = items.HisDoctorAdviceInfo.BaseDrugLib.MedicalInsuranceNumber
|
|
264
|
+
|
|
265
|
+ fsiOPFLD.MedinsListCodg = items.HisDoctorAdviceInfo.BaseDrugLib.MedicalInsuranceNumber
|
|
266
|
+ fsiOPFLD.MedinsListName = items.HisDoctorAdviceInfo.BaseDrugLib.DrugName
|
|
267
|
+ fsiOPFLD.Prodname = items.HisDoctorAdviceInfo.BaseDrugLib.DrugName
|
|
268
|
+ fsiOPFLD.BilgDeptName = department.Name
|
|
269
|
+ fsiOPFLD.BilgDeptCodg = department.Number
|
|
270
|
+ fsiOPFLD.BilgDrCode = doctor.DoctorNumber
|
|
271
|
+ fsiOPFLD.BilgDrName = doctor.UserName
|
|
272
|
+ fsiOPFLD.MedChrgitmType = "09"
|
|
273
|
+
|
|
274
|
+ } else if items.AdviceId == 0 && items.ProjectId > 0 {
|
|
275
|
+ fsiOPFLD.FeeOcurTime = time.Unix(items.HisPrescriptionProject.Ctime, 0).Format("2006-01-02 15:04:05")
|
|
276
|
+ fsiOPFLD.MedListCodg = items.HisPrescriptionProject.HisProject.MedicalCode
|
|
277
|
+
|
|
278
|
+ fsiOPFLD.MedinsListCodg = items.HisPrescriptionProject.HisProject.MedicalCode
|
|
279
|
+ fsiOPFLD.BilgDeptName = department.Name
|
|
280
|
+ fsiOPFLD.BilgDeptCodg = department.Number
|
|
281
|
+ fsiOPFLD.BilgDrCode = doctor.DoctorNumber
|
|
282
|
+ fsiOPFLD.BilgDrName = doctor.UserName
|
|
283
|
+ if items.HisPrescriptionProject.Type == 2 {
|
|
284
|
+ fsiOPFLD.MedinsListName = items.HisPrescriptionProject.HisProject.ProjectName
|
|
285
|
+ fsiOPFLD.Prodname = items.HisPrescriptionProject.HisProject.ProjectName
|
|
286
|
+
|
|
287
|
+ switch items.HisPrescriptionProject.HisProject.CostClassify {
|
|
288
|
+ case 0:
|
|
289
|
+
|
|
290
|
+ break
|
|
291
|
+ case 1:
|
|
292
|
+ fsiOPFLD.MedChrgitmType = "14"
|
|
293
|
+ break
|
|
294
|
+ case 2:
|
|
295
|
+ fsiOPFLD.MedChrgitmType = "05"
|
|
296
|
+
|
|
297
|
+ break
|
|
298
|
+ case 3:
|
|
299
|
+ fsiOPFLD.MedChrgitmType = "03"
|
|
300
|
+
|
|
301
|
+ break
|
|
302
|
+ case 4:
|
|
303
|
+ fsiOPFLD.MedChrgitmType = "03"
|
|
304
|
+
|
|
305
|
+ break
|
|
306
|
+ case 5:
|
|
307
|
+ fsiOPFLD.MedChrgitmType = "08"
|
|
308
|
+
|
|
309
|
+ break
|
|
310
|
+ case 6:
|
|
311
|
+ fsiOPFLD.MedChrgitmType = "14"
|
|
312
|
+
|
|
313
|
+ break
|
|
314
|
+ case 7:
|
|
315
|
+ fsiOPFLD.MedChrgitmType = "14"
|
|
316
|
+
|
|
317
|
+ break
|
|
318
|
+ case 8:
|
|
319
|
+ fsiOPFLD.MedChrgitmType = "03"
|
|
320
|
+ break
|
|
321
|
+ case 9:
|
|
322
|
+ fsiOPFLD.MedChrgitmType = "14"
|
|
323
|
+ break
|
|
324
|
+ case 10:
|
|
325
|
+ fsiOPFLD.MedChrgitmType = "14"
|
|
326
|
+ break
|
|
327
|
+ case 11:
|
|
328
|
+ fsiOPFLD.MedChrgitmType = "06"
|
|
329
|
+ break
|
|
330
|
+ case 12:
|
|
331
|
+ fsiOPFLD.MedChrgitmType = "12"
|
|
332
|
+ break
|
|
333
|
+ case 13:
|
|
334
|
+ fsiOPFLD.MedChrgitmType = "01"
|
|
335
|
+ break
|
|
336
|
+ case 14:
|
|
337
|
+ fsiOPFLD.MedChrgitmType = "04"
|
|
338
|
+ break
|
|
339
|
+ case 15:
|
|
340
|
+ fsiOPFLD.MedChrgitmType = "14"
|
|
341
|
+ break
|
|
342
|
+
|
|
343
|
+ }
|
|
344
|
+ } else if items.HisPrescriptionProject.Type == 3 {
|
|
345
|
+ fsiOPFLD.MedinsListName = items.HisPrescriptionProject.GoodInfo.GoodName
|
|
346
|
+ fsiOPFLD.Prodname = items.HisPrescriptionProject.GoodInfo.GoodName
|
|
347
|
+
|
|
348
|
+ fsiOPFLD.MedChrgitmType = "08"
|
|
349
|
+ }
|
|
350
|
+ }
|
|
351
|
+
|
|
352
|
+ fsiOPFLD.Prodname = items.HisDoctorAdviceInfo.AdviceName
|
|
353
|
+ fsiOPFLD.BilgDeptCodg = department.Number
|
|
354
|
+ fsiOPFLD.BilgDeptName = department.Name
|
|
355
|
+ memo["hosp_appr_flag"] = "1"
|
|
356
|
+ memo["invoice_no"] = order.MdtrtId
|
|
357
|
+ memo["memo"] = "自费"
|
|
358
|
+ bytesData, _ := json.Marshal(memo)
|
|
359
|
+ fsiOPFLD.Memo = string(bytesData)
|
|
360
|
+
|
|
361
|
+ fsiOPFLDs = append(fsiOPFLDs, fsiOPFLD)
|
|
362
|
+ }
|
|
363
|
+
|
|
364
|
+ fmt.Println(fsiOPFLDs)
|
|
365
|
+
|
170
|
366
|
struct4201A.Fopfd = fsiOPFLDs
|
|
367
|
+ fmt.Println(struct4201A.Fopfd)
|
|
368
|
+
|
171
|
369
|
result, requestLog := service.Gdyb4201A(miConfig.OrgName, curRoles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, struct4201A)
|
|
370
|
+ saveLog(result, requestLog, "4201A", "自费费用明细上传")
|
|
371
|
+ var res2 ResultSix
|
|
372
|
+ var respJSON2 map[string]interface{}
|
|
373
|
+ if err := json.Unmarshal([]byte(string(result)), &respJSON2); err != nil {
|
|
374
|
+ utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
|
|
375
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
376
|
+ return
|
|
377
|
+ }
|
|
378
|
+ userJSONBytes2, _ := json.Marshal(respJSON2)
|
|
379
|
+ if err := json.Unmarshal(userJSONBytes2, &res2); err != nil {
|
|
380
|
+ utils.ErrorLog("解析失败:%v", err)
|
|
381
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
382
|
+ return
|
|
383
|
+ }
|
|
384
|
+ if res2.Infcode != 0 {
|
|
385
|
+ c.ServeSuccessJSON(map[string]interface{}{
|
|
386
|
+ "failed_code": -10,
|
|
387
|
+ "msg": res2.ErrMsg,
|
|
388
|
+ })
|
|
389
|
+ return
|
172
|
390
|
|
|
391
|
+ } else {
|
|
392
|
+ c.ServeSuccessJSON(map[string]interface{}{
|
|
393
|
+ "msg": "上传成功",
|
|
394
|
+ })
|
|
395
|
+ }
|
173
|
396
|
}
|
174
|
397
|
func (c *HisApiController) Get4202() {
|
175
|
398
|
order_id, _ := c.GetInt64("order_id")
|
|
399
|
+ order_id = 220548
|
|
400
|
+
|
176
|
401
|
admin_user_id, _ := c.GetInt64("admin_user_id")
|
|
402
|
+ admin_user_id = 3432
|
|
403
|
+
|
177
|
404
|
order, _ := service.GetHisOrderByIDTwo(order_id)
|
178
|
405
|
his, _ := service.GetInHospitalRecordByNumber(order.MdtrtId)
|
179
|
406
|
curRoles, _ := service.GetAdminUserInfoByID(c.GetAdminUserInfo().CurrentOrgId, admin_user_id)
|
|
@@ -261,6 +488,9 @@ func (c *HisApiController) Get4203() {
|
261
|
488
|
curRoles, _ := service.GetAdminUserInfoByID(c.GetAdminUserInfo().CurrentOrgId, admin_user_id)
|
262
|
489
|
miConfig, _ := service.FindMedicalInsuranceInfo(c.GetAdminUserInfo().CurrentOrgId)
|
263
|
490
|
order_id, _ := c.GetInt64("order_id")
|
|
491
|
+ order_id = 220548
|
|
492
|
+ admin_user_id = 3432
|
|
493
|
+
|
264
|
494
|
order, _ := service.GetHisOrderByIDTwo(order_id)
|
265
|
495
|
his, _ := service.GetInHospitalRecordByNumber(order.MdtrtId)
|
266
|
496
|
result, requestLog := service.Gdyb4203(miConfig.OrgName, curRoles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, his.Number)
|