|
@@ -12,9 +12,7 @@ import (
|
12
|
12
|
//"crypto/x509/pkix"
|
13
|
13
|
"encoding/json"
|
14
|
14
|
"fmt"
|
15
|
|
- //"github.com/tjfoc/gmsm/sm2"
|
16
|
|
- //"github.com/tjfoc/gmsm/sm3"
|
17
|
|
- "github.com/go-ole/go-ole"
|
|
15
|
+
|
18
|
16
|
"gdyb/controllers"
|
19
|
17
|
"gdyb/enums"
|
20
|
18
|
"gdyb/models"
|
|
@@ -184,7 +182,349 @@ func HisManagerApiRegistRouters() {
|
184
|
182
|
|
185
|
183
|
beego.Router("/api/settlelist/get/batch", &HisApiController{}, "get:GetbatchSettleList")
|
186
|
184
|
|
|
185
|
+ //库盘和变更
|
|
186
|
+ beego.Router("/api/pc_bg", &HisApiController{}, "get:FJ3501AND3502")
|
|
187
|
+ //删除库盘和变更
|
|
188
|
+ beego.Router("/api/delete_pc_bg", &HisApiController{}, "get:DeletePCandBG")
|
|
189
|
+ beego.Router("/api/delete_pc_bg", &HisApiController{}, "get:DeleteXSandBG")
|
|
190
|
+ //药品变更
|
|
191
|
+ beego.Router("/api/changedrug", &HisApiController{}, "get:ChangeDrug")
|
|
192
|
+
|
|
193
|
+}
|
|
194
|
+func (c *HisApiController) FJ3501AND3502() {
|
|
195
|
+ ids := c.getString("ids")
|
|
196
|
+ id_arr := strings.Split(ids, ",")
|
|
197
|
+ drugs, _ := service.GetNewDrugWarehouseInfo(id_arr)
|
|
198
|
+ miConfig, _ := service.FindMedicalInsuranceInfo(c.GetAdminUserInfo().CurrentOrgId)
|
|
199
|
+ //库盘
|
|
200
|
+ for _, drug := range drugs {
|
|
201
|
+ if drug.IsPc == 0 && drug.IsBg == 0 {
|
|
202
|
+ var struct3501 models.Struct3501
|
|
203
|
+ struct3501.OrgName = miConfig.OrgName
|
|
204
|
+ struct3501.AccessKey = miConfig.AccessKey
|
|
205
|
+ struct3501.RequestUrl = miConfig.Url
|
|
206
|
+ struct3501.SecretKey = miConfig.SecretKey
|
|
207
|
+ struct3501.MedListCodg = drug.BaseDrugLib.MedicalInsuranceNumber
|
|
208
|
+ struct3501.FixmedinsHilistId = miConfig.Code
|
|
209
|
+ struct3501.FixmedinsHilistName = miConfig.OrgName
|
|
210
|
+ struct3501.RxFlag = "0"
|
|
211
|
+ struct3501.Invdate = time.Unix(drug.Ctime, 0).Format("2006-01-02 15:04:05")
|
|
212
|
+ struct3501.MdtrtareaAdmvs = miConfig.MdtrtareaAdmvs
|
|
213
|
+ struct3501.InsuplcAdmdvs = miConfig.InsuplcAdmdvs
|
|
214
|
+ struct3501.InvCnt = strconv.FormatInt(drug.StockMaxNumber, 10)
|
|
215
|
+ struct3501.ExpyEnd = time.Unix(drug.ExpiryDate, 0).Format("2006-01-02 15:04:05")
|
|
216
|
+ //todo 批次号规则需要在咨询下保健
|
|
217
|
+ struct3501.FixmedinsBchno = ""
|
|
218
|
+ struct3501.Memo = ""
|
|
219
|
+ result1, result2, result3 := service.FJyb3501(struct3501)
|
|
220
|
+ fmt.Println(result1)
|
|
221
|
+ fmt.Println(result2)
|
|
222
|
+ fmt.Println(result3)
|
|
223
|
+
|
|
224
|
+ var struct3502 models.Struct3502
|
|
225
|
+ struct3502.MedListCodg = drug.BaseDrugLib.MedicalInsuranceNumber
|
|
226
|
+ struct3502.FixmedinsHilistId = miConfig.Code
|
|
227
|
+ struct3502.FixmedinsHilistName = miConfig.OrgName
|
|
228
|
+ struct3502.FixmedinsCode = miConfig.Code
|
|
229
|
+ struct3502.RxFlag = "0"
|
|
230
|
+ struct3502.InvChgTime = time.Unix(drug.Ctime, 0).Format("2006-01-02 15:04:05")
|
|
231
|
+ struct3502.OrgName = miConfig.OrgName
|
|
232
|
+ struct3502.AccessKey = miConfig.AccessKey
|
|
233
|
+ struct3502.RequestUrl = miConfig.Url
|
|
234
|
+ struct3502.SecretKey = miConfig.SecretKey
|
|
235
|
+ struct3502.MdtrtareaAdmvs = miConfig.MdtrtareaAdmvs
|
|
236
|
+ struct3502.InsuplcAdmdvs = miConfig.InsuplcAdmdvs
|
|
237
|
+ struct3502.InvChgType = "102"
|
|
238
|
+ struct3502.FixmedinsBchno = ""
|
|
239
|
+ struct3502.Cnt = strconv.FormatInt(drug.WarehousingCount, 10)
|
|
240
|
+ struct3502.Pric = fmt.Sprintf("%.2f", drug.BaseDrugLib.RetailPrice)
|
|
241
|
+ result11, result22, result33 := service.FJyb3502(struct3502)
|
|
242
|
+ fmt.Println(result11)
|
|
243
|
+ fmt.Println(result22)
|
|
244
|
+ fmt.Println(result33)
|
|
245
|
+
|
|
246
|
+ }
|
|
247
|
+ //变更
|
|
248
|
+ if drug.IsPc == 1 && drug.IsBg == 0 {
|
|
249
|
+ var struct3502 models.Struct3502
|
|
250
|
+ struct3502.MedListCodg = drug.BaseDrugLib.MedicalInsuranceNumber
|
|
251
|
+ struct3502.FixmedinsHilistId = miConfig.Code
|
|
252
|
+ struct3502.FixmedinsHilistName = miConfig.OrgName
|
|
253
|
+ struct3502.FixmedinsCode = miConfig.Code
|
|
254
|
+ struct3502.RxFlag = "0"
|
|
255
|
+ struct3502.InvChgTime = time.Unix(drug.Ctime, 0).Format("2006-01-02 15:04:05")
|
|
256
|
+ struct3502.OrgName = miConfig.OrgName
|
|
257
|
+ struct3502.AccessKey = miConfig.AccessKey
|
|
258
|
+ struct3502.RequestUrl = miConfig.Url
|
|
259
|
+ struct3502.SecretKey = miConfig.SecretKey
|
|
260
|
+ struct3502.MdtrtareaAdmvs = miConfig.MdtrtareaAdmvs
|
|
261
|
+ struct3502.InsuplcAdmdvs = miConfig.InsuplcAdmdvs
|
|
262
|
+ struct3502.InvChgType = "102"
|
|
263
|
+ struct3502.FixmedinsBchno = ""
|
|
264
|
+ struct3502.Cnt = strconv.FormatInt(drug.WarehousingCount, 10)
|
|
265
|
+ struct3502.Pric = fmt.Sprintf("%.2f", drug.BaseDrugLib.RetailPrice)
|
|
266
|
+ result1, result2, result3 := service.FJyb3502(struct3502)
|
|
267
|
+ fmt.Println(result1)
|
|
268
|
+ fmt.Println(result2)
|
|
269
|
+ fmt.Println(result3)
|
|
270
|
+ }
|
|
271
|
+ }
|
|
272
|
+}
|
|
273
|
+func (c *HisApiController) DeletePCandBG() {
|
|
274
|
+ ids := c.getString("ids")
|
|
275
|
+ id_arr := strings.Split(ids, ",")
|
|
276
|
+ drugs, _ := service.GetNewDrugWarehouseInfo(id_arr)
|
|
277
|
+ miConfig, _ := service.FindMedicalInsuranceInfo(c.GetAdminUserInfo().CurrentOrgId)
|
|
278
|
+ for _, item := range drugs {
|
|
279
|
+ if item.IsPc == 1 && item.IsBg == 1 {
|
|
280
|
+ var struct3507 models.Struct3507
|
|
281
|
+ struct3507.FixmedinsBchno = ""
|
|
282
|
+ struct3507.InvDataType = "1"
|
|
283
|
+ struct3507.OrgName = miConfig.OrgName
|
|
284
|
+ struct3507.AccessKey = miConfig.AccessKey
|
|
285
|
+ struct3507.RequestUrl = miConfig.Url
|
|
286
|
+ struct3507.SecretKey = miConfig.SecretKey
|
|
287
|
+ struct3507.MdtrtareaAdmvs = miConfig.MdtrtareaAdmvs
|
|
288
|
+ struct3507.InsuplcAdmdvs = miConfig.InsuplcAdmdvs
|
|
289
|
+ service.FJyb3507(struct3507)
|
|
290
|
+
|
|
291
|
+ var struct3507_2 models.Struct3507
|
|
292
|
+ struct3507_2.OrgName = miConfig.OrgName
|
|
293
|
+ struct3507_2.AccessKey = miConfig.AccessKey
|
|
294
|
+ struct3507_2.RequestUrl = miConfig.Url
|
|
295
|
+ struct3507_2.SecretKey = miConfig.SecretKey
|
|
296
|
+ struct3507_2.MdtrtareaAdmvs = miConfig.MdtrtareaAdmvs
|
|
297
|
+ struct3507_2.InsuplcAdmdvs = miConfig.InsuplcAdmdvs
|
|
298
|
+ struct3507_2.FixmedinsBchno = ""
|
|
299
|
+ struct3507_2.InvDataType = "2"
|
|
300
|
+ service.FJyb3507(struct3507_2)
|
|
301
|
+ }
|
|
302
|
+ if item.IsPc == 1 && item.IsBg == 0 {
|
|
303
|
+ var struct3507 models.Struct3507
|
|
304
|
+ struct3507.OrgName = miConfig.OrgName
|
|
305
|
+ struct3507.AccessKey = miConfig.AccessKey
|
|
306
|
+ struct3507.RequestUrl = miConfig.Url
|
|
307
|
+ struct3507.SecretKey = miConfig.SecretKey
|
|
308
|
+ struct3507.MdtrtareaAdmvs = miConfig.MdtrtareaAdmvs
|
|
309
|
+ struct3507.InsuplcAdmdvs = miConfig.InsuplcAdmdvs
|
|
310
|
+ struct3507.FixmedinsBchno = ""
|
|
311
|
+ struct3507.InvDataType = "1"
|
|
312
|
+ service.FJyb3507(struct3507)
|
|
313
|
+ }
|
|
314
|
+
|
|
315
|
+ }
|
|
316
|
+
|
|
317
|
+}
|
|
318
|
+
|
|
319
|
+func (c *HisApiController) DeleteXSandBG() {
|
|
320
|
+ ids := c.getString("ids")
|
|
321
|
+ id_arr := strings.Split(ids, ",")
|
|
322
|
+ drugs, _ := service.GetNewDrugWarehouseInfo(id_arr)
|
|
323
|
+ miConfig, _ := service.FindMedicalInsuranceInfo(c.GetAdminUserInfo().CurrentOrgId)
|
|
324
|
+ for _, item := range drugs {
|
|
325
|
+ if item.is == 1 && item.IsBg == 1 {
|
|
326
|
+ var struct3507 models.Struct3507
|
|
327
|
+ struct3507.FixmedinsBchno = ""
|
|
328
|
+ struct3507.InvDataType = "1"
|
|
329
|
+ struct3507.OrgName = miConfig.OrgName
|
|
330
|
+ struct3507.AccessKey = miConfig.AccessKey
|
|
331
|
+ struct3507.RequestUrl = miConfig.Url
|
|
332
|
+ struct3507.SecretKey = miConfig.SecretKey
|
|
333
|
+ struct3507.MdtrtareaAdmvs = miConfig.MdtrtareaAdmvs
|
|
334
|
+ struct3507.InsuplcAdmdvs = miConfig.InsuplcAdmdvs
|
|
335
|
+ service.FJyb3507(struct3507)
|
|
336
|
+
|
|
337
|
+ var struct3507_2 models.Struct3507
|
|
338
|
+ struct3507_2.OrgName = miConfig.OrgName
|
|
339
|
+ struct3507_2.AccessKey = miConfig.AccessKey
|
|
340
|
+ struct3507_2.RequestUrl = miConfig.Url
|
|
341
|
+ struct3507_2.SecretKey = miConfig.SecretKey
|
|
342
|
+ struct3507_2.MdtrtareaAdmvs = miConfig.MdtrtareaAdmvs
|
|
343
|
+ struct3507_2.InsuplcAdmdvs = miConfig.InsuplcAdmdvs
|
|
344
|
+ struct3507_2.FixmedinsBchno = ""
|
|
345
|
+ struct3507_2.InvDataType = "2"
|
|
346
|
+ service.FJyb3507(struct3507_2)
|
|
347
|
+ }
|
|
348
|
+ if item.IsPc == 1 && item.IsBg == 0 {
|
|
349
|
+ var struct3507 models.Struct3507
|
|
350
|
+ struct3507.OrgName = miConfig.OrgName
|
|
351
|
+ struct3507.AccessKey = miConfig.AccessKey
|
|
352
|
+ struct3507.RequestUrl = miConfig.Url
|
|
353
|
+ struct3507.SecretKey = miConfig.SecretKey
|
|
354
|
+ struct3507.MdtrtareaAdmvs = miConfig.MdtrtareaAdmvs
|
|
355
|
+ struct3507.InsuplcAdmdvs = miConfig.InsuplcAdmdvs
|
|
356
|
+ struct3507.FixmedinsBchno = ""
|
|
357
|
+ struct3507.InvDataType = "1"
|
|
358
|
+ service.FJyb3507(struct3507)
|
|
359
|
+ }
|
|
360
|
+
|
|
361
|
+ }
|
|
362
|
+
|
|
363
|
+}
|
|
364
|
+
|
|
365
|
+func (c *HisApiController) ChangeDrug() {
|
|
366
|
+ ids := c.getString("ids")
|
|
367
|
+ id_arr := strings.Split(ids, ",")
|
|
368
|
+ flows, _ := service.GetNewDrugFlowInfo(id_arr)
|
|
369
|
+ miConfig, _ := service.FindMedicalInsuranceInfo(c.GetAdminUserInfo().CurrentOrgId)
|
|
370
|
+
|
|
371
|
+ for _, item := range flows {
|
|
372
|
+ if item.ConsumableType == 3 { //3为自动出库 7为自动退库
|
|
373
|
+ prescription := service.GetHisPrescriptionByID(item.HisDoctorAdviceInfo.PrescriptionId)
|
|
374
|
+ if prescription.OrderStatus == 2 { //已经结算
|
|
375
|
+ //判断是否已经销售
|
|
376
|
+ if item.IsSale == 1 { //是否已经销售,1是 0否
|
|
377
|
+ //是否已经变更 1是 0否
|
|
378
|
+ if item.IsChange == 0 { //没变更,进行变更操作
|
|
379
|
+ ChangeStock(item.Count, item.HisDoctorAdviceInfo, miConfig, "102")
|
|
380
|
+ }
|
|
381
|
+ } else { //没销售,
|
|
382
|
+ //进行商品销售接口
|
|
383
|
+ SaleStock(c.GetAdminUserInfo().CurrentOrgId, prescription, item.HisDoctorAdviceInfo, miConfig, "")
|
|
384
|
+
|
|
385
|
+ if item.IsChange == 0 { //没变更,进行变更操作
|
|
386
|
+ ChangeStock(item.Count, item.HisDoctorAdviceInfo, miConfig, "102")
|
|
387
|
+ }
|
|
388
|
+ }
|
|
389
|
+ } else { //还没结算
|
|
390
|
+ if item.IsChange == 0 { //没变更,进行变更操作
|
|
391
|
+ ChangeStock(item.Count, item.HisDoctorAdviceInfo, miConfig, "102")
|
|
392
|
+
|
|
393
|
+ }
|
|
394
|
+ }
|
|
395
|
+ } else if item.ConsumableType == 7 {
|
|
396
|
+ prescription := service.GetHisPrescriptionByID(item.HisDoctorAdviceInfo.PrescriptionId)
|
|
397
|
+ order := service.GetHisOrderByNumber(prescription.BatchNumber)
|
|
398
|
+
|
|
399
|
+ if order.OrderStatus == 2 || order.OrderStatus == 1 { //已经结算
|
|
400
|
+ //判断是否已经销售
|
|
401
|
+ if item.IsSale == 1 { //是否已经销售,1是 0否
|
|
402
|
+ //是否已经变更 1是 0否
|
|
403
|
+ if item.IsChange == 0 { //没变更,进行变更操作
|
|
404
|
+ ChangeStock(item.Count, item.HisDoctorAdviceInfo, miConfig, "102")
|
|
405
|
+ }
|
|
406
|
+ } else { //没销售,
|
|
407
|
+ //进行商品销售退货接口
|
|
408
|
+ CancleSaleStock(c.GetAdminUserInfo().CurrentOrgId, prescription, item.HisDoctorAdviceInfo, miConfig, "")
|
|
409
|
+ if item.IsChange == 0 { //没变更,进行变更操作
|
|
410
|
+ ChangeStock(item.Count, item.HisDoctorAdviceInfo, miConfig, "102")
|
|
411
|
+ }
|
|
412
|
+ }
|
|
413
|
+ } else { //还没结算
|
|
414
|
+ if item.IsChange == 0 { //没变更,进行变更操作
|
|
415
|
+ ChangeStock(item.Count, item.HisDoctorAdviceInfo, miConfig, "102")
|
|
416
|
+
|
|
417
|
+ }
|
|
418
|
+ }
|
|
419
|
+
|
|
420
|
+ } else { //其他方式
|
|
421
|
+ if item.IsChange == 0 { //没变更,进行变更操作
|
|
422
|
+ ChangeStock(item.Count, item.HisDoctorAdviceInfo, miConfig, "102")
|
|
423
|
+ }
|
|
424
|
+ }
|
|
425
|
+ }
|
187
|
426
|
}
|
|
427
|
+
|
|
428
|
+func ChangeStock(count int64, drug models.HisDoctorAdviceInfo, miConfig models.MedicalInsuranceOrgConfig, chgType string) {
|
|
429
|
+ var struct3502 models.Struct3502
|
|
430
|
+ struct3502.MedListCodg = drug.BaseDrugLib.MedicalInsuranceNumber
|
|
431
|
+ struct3502.FixmedinsHilistId = miConfig.Code
|
|
432
|
+ struct3502.FixmedinsHilistName = miConfig.OrgName
|
|
433
|
+ struct3502.FixmedinsCode = miConfig.Code
|
|
434
|
+ struct3502.RxFlag = "0"
|
|
435
|
+ struct3502.InvChgTime = time.Unix(drug.CreatedTime, 0).Format("2006-01-02 15:04:05")
|
|
436
|
+ struct3502.OrgName = miConfig.OrgName
|
|
437
|
+ struct3502.AccessKey = miConfig.AccessKey
|
|
438
|
+ struct3502.RequestUrl = miConfig.Url
|
|
439
|
+ struct3502.SecretKey = miConfig.SecretKey
|
|
440
|
+ struct3502.MdtrtareaAdmvs = miConfig.MdtrtareaAdmvs
|
|
441
|
+ struct3502.InsuplcAdmdvs = miConfig.InsuplcAdmdvs
|
|
442
|
+ struct3502.InvChgType = chgType
|
|
443
|
+ struct3502.FixmedinsBchno = ""
|
|
444
|
+ struct3502.Cnt = strconv.FormatInt(count, 10)
|
|
445
|
+ struct3502.Pric = fmt.Sprintf("%.2f", drug.Price)
|
|
446
|
+ result1, result2, result3 := service.FJyb3502(struct3502)
|
|
447
|
+ fmt.Println(result1)
|
|
448
|
+ fmt.Println(result2)
|
|
449
|
+ fmt.Println(result3)
|
|
450
|
+
|
|
451
|
+}
|
|
452
|
+func SaleStock(org_id int64, pre models.HisPrescription, drug models.HisDoctorAdviceInfo, miConfig models.MedicalInsuranceOrgConfig, chgType string) {
|
|
453
|
+ var struct3505 models.Struct3505
|
|
454
|
+ struct3505.MedListCodg = drug.BaseDrugLib.MedicalInsuranceNumber
|
|
455
|
+ struct3505.FixmedinsHilistId = miConfig.Code
|
|
456
|
+ struct3505.FixmedinsHilistName = miConfig.OrgName
|
|
457
|
+ struct3505.FixmedinsCode = miConfig.Code
|
|
458
|
+ struct3505.FixmedinsBchno = ""
|
|
459
|
+ roles, _ := service.GetAdminUserInfoByID(org_id, pre.Creator)
|
|
460
|
+ struct3505.PrscDrName = roles.UserName
|
|
461
|
+ struct3505.PharName = ""
|
|
462
|
+ struct3505.PharPracCertNo = ""
|
|
463
|
+ order := service.GetHisOrderByNumber(pre.BatchNumber)
|
|
464
|
+ struct3505.SetlId = order.SetlId
|
|
465
|
+ struct3505.MdtrtSn = order.MdtrtId
|
|
466
|
+ struct3505.ManuLotnum = ""
|
|
467
|
+ struct3505.ManuDate = ""
|
|
468
|
+ struct3505.ExpyEnd = ""
|
|
469
|
+ struct3505.RxFlag = "0"
|
|
470
|
+ struct3505.TrdnFlag = "1"
|
|
471
|
+ struct3505.RtalDocno = order.Number
|
|
472
|
+ strValue := fmt.Sprintf("%.2f", drug.PrescribingNumber)
|
|
473
|
+ struct3505.SelRetnCnt = strValue
|
|
474
|
+ struct3505.SelRetnTime = time.Unix(drug.CreatedTime, 0).Format("2006-01-02 15:04:05")
|
|
475
|
+ roles_two, _ := service.GetAdminUserInfoByID(org_id, order.Creator)
|
|
476
|
+
|
|
477
|
+ struct3505.SelRetnOpterName = roles_two.UserName
|
|
478
|
+ if order.IsMedicineInsurance == 1 {
|
|
479
|
+ struct3505.MdtrtSetlType = "1"
|
|
480
|
+ } else {
|
|
481
|
+ struct3505.MdtrtSetlType = "2"
|
|
482
|
+ }
|
|
483
|
+ struct3505.OrgName = miConfig.OrgName
|
|
484
|
+ struct3505.AccessKey = miConfig.AccessKey
|
|
485
|
+ struct3505.RequestUrl = miConfig.Url
|
|
486
|
+ struct3505.SecretKey = miConfig.SecretKey
|
|
487
|
+ struct3505.MdtrtareaAdmvs = miConfig.MdtrtareaAdmvs
|
|
488
|
+ struct3505.InsuplcAdmdvs = miConfig.InsuplcAdmdvs
|
|
489
|
+ result1, result2, result3 := service.FJyb3505(struct3505)
|
|
490
|
+ fmt.Println(result1)
|
|
491
|
+ fmt.Println(result2)
|
|
492
|
+ fmt.Println(result3)
|
|
493
|
+
|
|
494
|
+}
|
|
495
|
+func CancleSaleStock(org_id int64, pre models.HisPrescription, drug models.HisDoctorAdviceInfo, miConfig models.MedicalInsuranceOrgConfig, chgType string) {
|
|
496
|
+ var struct3506 models.Struct3506
|
|
497
|
+ struct3506.MedListCodg = drug.BaseDrugLib.MedicalInsuranceNumber
|
|
498
|
+ struct3506.FixmedinsHilistId = miConfig.Code
|
|
499
|
+ struct3506.FixmedinsHilistName = miConfig.OrgName
|
|
500
|
+ struct3506.FixmedinsCode = miConfig.Code
|
|
501
|
+ struct3506.FixmedinsBchno = ""
|
|
502
|
+ order := service.GetHisOrderByNumber(pre.BatchNumber)
|
|
503
|
+ //roles, _ := service.GetAdminUserInfoByID(org_id, pre.Creator)
|
|
504
|
+ struct3506.ManuLotnum = ""
|
|
505
|
+ struct3506.ManuDate = ""
|
|
506
|
+ struct3506.MdtrtSn = order.MdtrtId
|
|
507
|
+ struct3506.ExpyEnd = ""
|
|
508
|
+ struct3506.RxFlag = "0"
|
|
509
|
+ struct3506.TrdnFlag = "1"
|
|
510
|
+ strValue := fmt.Sprintf("%.2f", drug.PrescribingNumber)
|
|
511
|
+ struct3506.SelRetnCnt = strValue
|
|
512
|
+ struct3506.SelRetnTime = time.Unix(drug.CreatedTime, 0).Format("2006-01-02 15:04:05")
|
|
513
|
+ roles_two, _ := service.GetAdminUserInfoByID(org_id, order.Creator)
|
|
514
|
+ struct3506.SelRetnOpterName = roles_two.UserName
|
|
515
|
+ struct3506.OrgName = miConfig.OrgName
|
|
516
|
+ struct3506.AccessKey = miConfig.AccessKey
|
|
517
|
+ struct3506.RequestUrl = miConfig.Url
|
|
518
|
+ struct3506.SecretKey = miConfig.SecretKey
|
|
519
|
+ struct3506.MdtrtareaAdmvs = miConfig.MdtrtareaAdmvs
|
|
520
|
+ struct3506.InsuplcAdmdvs = miConfig.InsuplcAdmdvs
|
|
521
|
+ result1, result2, result3 := service.FJyb3506(struct3506)
|
|
522
|
+ fmt.Println(result1)
|
|
523
|
+ fmt.Println(result2)
|
|
524
|
+ fmt.Println(result3)
|
|
525
|
+
|
|
526
|
+}
|
|
527
|
+
|
188
|
528
|
func (c *HisApiController) Get1318() {
|
189
|
529
|
adminUser := c.GetAdminUserInfo()
|
190
|
530
|
admin_user_id, _ := c.GetInt64("admin_user_id")
|
|
@@ -4480,19 +4820,19 @@ func (c *HisApiController) ReadEleToken() {
|
4480
|
4820
|
Idetinfos, _ := json.Marshal(res.Output.Idetinfo)
|
4481
|
4821
|
infoStr := string(Iinfos)
|
4482
|
4822
|
idetinfoStr := string(Idetinfos)
|
4483
|
|
- //date,age,_ := GetBirthdateAndAge(res.Output.Baseinfo.Certno),
|
4484
|
|
- b,age, _ := getBirthdateAndAge(res.Output.Baseinfo.Certno)
|
|
4823
|
+ //date,age,_ := GetBirthdateAndAge(res.Output.Baseinfo.Certno),
|
|
4824
|
+ b, age, _ := getBirthdateAndAge(res.Output.Baseinfo.Certno)
|
4485
|
4825
|
|
4486
|
4826
|
psn := &models.HisPsn{
|
4487
|
|
- PsnNo: res.Output.Baseinfo.PsnNo,
|
4488
|
|
- PatientId: patient.ID,
|
4489
|
|
- Certno: res.Output.Baseinfo.Certno,
|
|
4827
|
+ PsnNo: res.Output.Baseinfo.PsnNo,
|
|
4828
|
+ PatientId: patient.ID,
|
|
4829
|
+ Certno: res.Output.Baseinfo.Certno,
|
4490
|
4830
|
Gend: res.Output.Baseinfo.Gend,
|
4491
|
4831
|
Naty: res.Output.Baseinfo.Naty,
|
4492
|
4832
|
PsnCertType: res.Output.Baseinfo.PsnCertType,
|
4493
|
4833
|
PsnName: res.Output.Baseinfo.PsnName,
|
4494
|
|
- Age:float64(age),
|
4495
|
|
- Brdy:b,
|
|
4834
|
+ Age: float64(age),
|
|
4835
|
+ Brdy: b,
|
4496
|
4836
|
Idetinfo: idetinfoStr,
|
4497
|
4837
|
Insuinfo: infoStr,
|
4498
|
4838
|
UserOrgId: c.GetAdminUserInfo().CurrentOrgId,
|
|
@@ -8002,14 +8342,14 @@ func (c *HisApiController) ReadCard() {
|
8002
|
8342
|
Idetinfos, _ := json.Marshal(res.Output.Idetinfo)
|
8003
|
8343
|
infoStr := string(Iinfos)
|
8004
|
8344
|
idetinfoStr := string(Idetinfos)
|
8005
|
|
- b,age, _ := getBirthdateAndAge(res.Output.Baseinfo.Certno)
|
|
8345
|
+ b, age, _ := getBirthdateAndAge(res.Output.Baseinfo.Certno)
|
8006
|
8346
|
|
8007
|
8347
|
psn := &models.HisPsn{
|
8008
|
|
- PsnNo: res.Output.Baseinfo.PsnNo,
|
8009
|
|
- PatientId: patient.ID,
|
8010
|
|
- Certno: res.Output.Baseinfo.Certno,
|
|
8348
|
+ PsnNo: res.Output.Baseinfo.PsnNo,
|
|
8349
|
+ PatientId: patient.ID,
|
|
8350
|
+ Certno: res.Output.Baseinfo.Certno,
|
8011
|
8351
|
Brdy: b,
|
8012
|
|
- Age:float64(age),
|
|
8352
|
+ Age: float64(age),
|
8013
|
8353
|
Gend: res.Output.Baseinfo.Gend,
|
8014
|
8354
|
Naty: res.Output.Baseinfo.Naty,
|
8015
|
8355
|
PsnCertType: res.Output.Baseinfo.PsnCertType,
|
|
@@ -8178,14 +8518,14 @@ func (c *HisApiController) ReadCard() {
|
8178
|
8518
|
Idetinfos, _ := json.Marshal(res.Output.Idetinfo)
|
8179
|
8519
|
infoStr := string(Iinfos)
|
8180
|
8520
|
idetinfoStr := string(Idetinfos)
|
8181
|
|
- b,age, _ := getBirthdateAndAge(res.Output.Baseinfo.Certno)
|
|
8521
|
+ b, age, _ := getBirthdateAndAge(res.Output.Baseinfo.Certno)
|
8182
|
8522
|
|
8183
|
8523
|
psn := &models.HisPsn{
|
8184
|
|
- PsnNo: res.Output.Baseinfo.PsnNo,
|
8185
|
|
- PatientId: patient.ID,
|
8186
|
|
- Certno: res.Output.Baseinfo.Certno,
|
|
8524
|
+ PsnNo: res.Output.Baseinfo.PsnNo,
|
|
8525
|
+ PatientId: patient.ID,
|
|
8526
|
+ Certno: res.Output.Baseinfo.Certno,
|
8187
|
8527
|
Brdy: b,
|
8188
|
|
- Age:float64(age),
|
|
8528
|
+ Age: float64(age),
|
8189
|
8529
|
Gend: res.Output.Baseinfo.Gend,
|
8190
|
8530
|
Naty: res.Output.Baseinfo.Naty,
|
8191
|
8531
|
PsnCertType: res.Output.Baseinfo.PsnCertType,
|
|
@@ -10016,14 +10356,14 @@ func (c *HisApiController) ReadCard() {
|
10016
|
10356
|
Idetinfos, _ := json.Marshal(res.Output.Idetinfo)
|
10017
|
10357
|
infoStr := string(Iinfos)
|
10018
|
10358
|
idetinfoStr := string(Idetinfos)
|
10019
|
|
- b,age, _ := getBirthdateAndAge(res.Output.Baseinfo.Certno)
|
|
10359
|
+ b, age, _ := getBirthdateAndAge(res.Output.Baseinfo.Certno)
|
10020
|
10360
|
|
10021
|
10361
|
psn := &models.HisPsn{
|
10022
|
10362
|
PsnNo: res.Output.Baseinfo.PsnNo,
|
10023
|
10363
|
PatientId: patient.ID,
|
10024
|
10364
|
Certno: res.Output.Baseinfo.Certno,
|
10025
|
|
- Brdy: b,
|
10026
|
|
- Age:float64(age),
|
|
10365
|
+ Brdy: b,
|
|
10366
|
+ Age: float64(age),
|
10027
|
10367
|
//Brdy: res.Output.Baseinfo.Brdy,
|
10028
|
10368
|
Gend: res.Output.Baseinfo.Gend,
|
10029
|
10369
|
Naty: res.Output.Baseinfo.Naty,
|
|
@@ -11326,14 +11666,14 @@ func (c *HisApiController) ReadCard() {
|
11326
|
11666
|
infoStr := string(Iinfos)
|
11327
|
11667
|
idetinfoStr := string(Idetinfos)
|
11328
|
11668
|
|
11329
|
|
- b,age, _ := getBirthdateAndAge(res.Output.Baseinfo.Certno)
|
|
11669
|
+ b, age, _ := getBirthdateAndAge(res.Output.Baseinfo.Certno)
|
11330
|
11670
|
psn := &models.HisPsn{
|
11331
|
|
- PsnNo: res.Output.Baseinfo.PsnNo,
|
11332
|
|
- PatientId: patient.ID,
|
11333
|
|
- Certno: res.Output.Baseinfo.Certno,
|
11334
|
|
- Gend: res.Output.Baseinfo.Gend,
|
11335
|
|
- Brdy: b,
|
11336
|
|
- Age:float64(age),
|
|
11671
|
+ PsnNo: res.Output.Baseinfo.PsnNo,
|
|
11672
|
+ PatientId: patient.ID,
|
|
11673
|
+ Certno: res.Output.Baseinfo.Certno,
|
|
11674
|
+ Gend: res.Output.Baseinfo.Gend,
|
|
11675
|
+ Brdy: b,
|
|
11676
|
+ Age: float64(age),
|
11337
|
11677
|
Naty: res.Output.Baseinfo.Naty,
|
11338
|
11678
|
PsnCertType: res.Output.Baseinfo.PsnCertType,
|
11339
|
11679
|
PsnName: res.Output.Baseinfo.PsnName,
|
|
@@ -17173,12 +17513,12 @@ type ResultCFYLJG007 struct {
|
17173
|
17513
|
InfRefmsgid string `json:"inf_refmsgid"`
|
17174
|
17514
|
Infcode int64 `json:"infcode"`
|
17175
|
17515
|
Output struct {
|
17176
|
|
- HiRxno string `json:"hi_rxno"`
|
17177
|
|
- RxStasName string `json:"rx_stas_name"`
|
17178
|
|
- RxUsedStasCodg string `json:"rx_used_stas_codg"`
|
17179
|
|
- Seltdelts []interface{} `json:"seltdelts"`
|
17180
|
|
- RxUsedStasName string `json:"rx_used_stas_name"`
|
17181
|
|
- RxStasCodg string `json:"rx_stas_codg"`
|
|
17516
|
+ HiRxno string `json:"hi_rxno"`
|
|
17517
|
+ RxStasName string `json:"rx_stas_name"`
|
|
17518
|
+ RxUsedStasCodg string `json:"rx_used_stas_codg"`
|
|
17519
|
+ Seltdelts []interface{} `json:"seltdelts"`
|
|
17520
|
+ RxUsedStasName string `json:"rx_used_stas_name"`
|
|
17521
|
+ RxStasCodg string `json:"rx_stas_codg"`
|
17182
|
17522
|
} `json:"output"`
|
17183
|
17523
|
RefmsgTime string `json:"refmsg_time"`
|
17184
|
17524
|
RespondTime string `json:"respond_time"`
|
|
@@ -17311,7 +17651,7 @@ type ResultCFYLJG005 struct {
|
17311
|
17651
|
SinDosunt string `json:"sin_dosunt"`
|
17312
|
17652
|
UsedFrquCodg string `json:"used_frqu_codg"`
|
17313
|
17653
|
UsedFrquName string `json:"used_frqu_name"`
|
17314
|
|
- DrugTotlcnt string `json:"drug_totlcnt"`
|
|
17654
|
+ DrugTotlcnt string `json:"drug_totlcnt"`
|
17315
|
17655
|
DrugTotlcntEmp string `json:"drug_totlcnt_emp"`
|
17316
|
17656
|
DiseCodg string `json:"dise_codg"`
|
17317
|
17657
|
HospApprFlag string `json:"hosp_appr_flag"`
|
|
@@ -21109,8 +21449,8 @@ func (c *HisApiController) GetUploadInfo() {
|
21109
|
21449
|
order.Creator = order.Creator
|
21110
|
21450
|
order.Modify = roles.AdminUserId
|
21111
|
21451
|
order.RequestLog = src_resquest
|
21112
|
|
- order.FaPiaoNumber = fapiao_number
|
21113
|
|
- order.FaPiaoCode = fapiao_code
|
|
21452
|
+ order.FaPiaoNumber = fapiao_number
|
|
21453
|
+ order.FaPiaoCode = fapiao_code
|
21114
|
21454
|
//setlDetail, _ := json.Marshal(res.Output.Setldetail)
|
21115
|
21455
|
//detailStr := string(setlDetail)
|
21116
|
21456
|
//order.SetlDetail = detailStr
|
|
@@ -22189,8 +22529,8 @@ func (c *HisApiController) GetUploadInfo() {
|
22189
|
22529
|
order.Modify = roles.AdminUserId
|
22190
|
22530
|
order.RequestLog = src_resquest
|
22191
|
22531
|
order.Diagnosis = diagnosis_id
|
22192
|
|
- order.FaPiaoNumber = fapiao_number
|
22193
|
|
- order.FaPiaoCode = fapiao_code
|
|
22532
|
+ order.FaPiaoNumber = fapiao_number
|
|
22533
|
+ order.FaPiaoCode = fapiao_code
|
22194
|
22534
|
setlDetail, _ := json.Marshal(res.Output.Setldetail)
|
22195
|
22535
|
detailStr := string(setlDetail)
|
22196
|
22536
|
order.SetlDetail = detailStr
|
|
@@ -33102,7 +33442,6 @@ func RemoveRepeatedPurviewElement2(arr []string) (newArr []string) {
|
33102
|
33442
|
return
|
33103
|
33443
|
}
|
33104
|
33444
|
|
33105
|
|
-
|
33106
|
33445
|
func getBirthdateAndAge(idNumber string) (string, int, error) {
|
33107
|
33446
|
if len(idNumber) != 18 {
|
33108
|
33447
|
return "", 0, fmt.Errorf("invalid ID number length. It should be 18 digits")
|