Parcourir la source

Merge branch 'master' of http://git.shengws.com/csx/gdyb

csx il y a 2 ans
Parent
révision
bb5772c22b

+ 1 - 1
conf/app.conf Voir le fichier

@@ -45,7 +45,7 @@ appsecret="61ee2e6268497d5aa9de0b0187c39aea"
45 45
 
46 46
 
47 47
 [prod]
48
-org_id = 10138
48
+org_id = 10188
49 49
 mobile_token_expiration_second = 86400
50 50
 httpdomain = https://api.xt.kuyicloud.com
51 51
 sso_domain = https://sso.kuyicloud.com

+ 2 - 2
controllers/js/jsyb_controller.go Voir le fichier

@@ -1087,7 +1087,7 @@ func (c *JSybController) Get3101() {
1087 1087
 		utils.ErrorLog("解析失败:%v", err)
1088 1088
 		return
1089 1089
 	}
1090
-	request, result := service.Jsyb3101(pd, fed, fdd, fod, fopd, pp)
1090
+	request, result := service.Jsyb3101(pd, fed, fdd, fod, fopd, pp, respJSON["trig_scen"].(string))
1091 1091
 	var dat map[string]interface{}
1092 1092
 	if err := json.Unmarshal([]byte(result), &dat); err == nil {
1093 1093
 		fmt.Println(dat)
@@ -1153,7 +1153,7 @@ func (c *JSybController) Get3102() {
1153 1153
 		return
1154 1154
 	}
1155 1155
 
1156
-	request, result := service.Jsyb3102(pd, fed, fdd, fod, fopd, pp)
1156
+	request, result := service.Jsyb3102(pd, fed, fdd, fod, fopd, pp, respJSON["trig_scen"].(string))
1157 1157
 	var dat map[string]interface{}
1158 1158
 	if err := json.Unmarshal([]byte(result), &dat); err == nil {
1159 1159
 		fmt.Println(dat)

+ 164 - 97
controllers/sg/his_api_controller.go Voir le fichier

@@ -90,8 +90,7 @@ func (c *HisApiController) Check3101() {
90 90
 	his, _ := service.GetNewHisPatientInfoFour(c.GetAdminUserInfo().CurrentOrgId, his_patient_id)
91 91
 	miConfig, _ := service.FindMedicalInsuranceInfo(c.GetAdminUserInfo().CurrentOrgId)
92 92
 	record_time := c.GetString("record_time")
93
-
94
-	trig_scen := "1"
93
+	trig_scen := c.GetString("trig_scen")
95 94
 
96 95
 	timeLayout := "2006-01-02"
97 96
 	loc, _ := time.LoadLocation("Local")
@@ -189,10 +188,10 @@ func (c *HisApiController) Check3101() {
189 188
 	} else {
190 189
 		fed.MedType = "9933"
191 190
 	}
191
+	var orders []*models.FsiOrderDtos
192 192
 
193 193
 	if trig_scen == "2" {
194 194
 		//处方医嘱信息
195
-		var orders []*models.FsiOrderDtos
196 195
 		for _, item := range prescriptions {
197 196
 			for _, subItem := range item.HisDoctorAdviceInfo {
198 197
 				var order models.FsiOrderDtos
@@ -310,6 +309,42 @@ func (c *HisApiController) Check3101() {
310 309
 	fed.ReimFlag = "0"
311 310
 	fed.OutSetlFlag = "0"
312 311
 
312
+	var fopd []*models.FsiOperationDtosData
313
+	data := make(map[string]interface{})
314
+	data["fed"] = fed
315
+	data["fdd"] = fdds
316
+	data["fod"] = orders
317
+	data["pd"] = pd
318
+	data["pp"] = pp
319
+	data["fopd"] = fopd
320
+	data["trig_scen"] = trig_scen
321
+	fmt.Println(data)
322
+	fmt.Println(fed)
323
+	fmt.Println(fdds)
324
+	fmt.Println(orders)
325
+	fmt.Println(pd)
326
+	fmt.Println(pp)
327
+	fmt.Println(fopd)
328
+
329
+	client := &http.Client{}
330
+	bytesData, _ := json.Marshal(data)
331
+	var req *http.Request
332
+	req, _ = http.NewRequest("POST", "http://192.168.3.111:9532/"+"jsyb/3101", bytes.NewReader(bytesData))
333
+	resp, _ := client.Do(req)
334
+	defer resp.Body.Close()
335
+	body, ioErr := ioutil.ReadAll(resp.Body)
336
+	if ioErr != nil {
337
+		utils.ErrorLog("接口返回数据读取失败: %v", ioErr)
338
+		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
339
+		return
340
+	}
341
+	var respJSON map[string]interface{}
342
+	if err := json.Unmarshal([]byte(body), &respJSON); err != nil {
343
+		utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
344
+		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
345
+		return
346
+	}
347
+
313 348
 	//手术操作集合
314 349
 	//手术操作集合
315 350
 
@@ -317,15 +352,17 @@ func (c *HisApiController) Check3101() {
317 352
 
318 353
 func (c *HisApiController) Check3102() {
319 354
 	patient_id, _ := c.GetInt64("patient_id")
355
+	order_id, _ := c.GetInt64("order_id")
320 356
 	his_patient_id, _ := c.GetInt64("his_patient_id")
321 357
 	admin_user_id, _ := c.GetInt64("admin_user_id")
358
+	trig_scen := c.GetString("trig_scen")
359
+
322 360
 	adminUser := c.GetAdminUserInfo()
323 361
 	roles, _ := service.GetAdminUserInfoByID(c.GetAdminUserInfo().CurrentOrgId, admin_user_id)
324 362
 	his, _ := service.GetNewHisPatientInfoFour(c.GetAdminUserInfo().CurrentOrgId, his_patient_id)
325 363
 	miConfig, _ := service.FindMedicalInsuranceInfo(c.GetAdminUserInfo().CurrentOrgId)
326 364
 	record_time := c.GetString("record_time")
327
-
328
-	trig_scen := "1"
365
+	order, _ := service.GetHisOrderByID(order_id)
329 366
 
330 367
 	timeLayout := "2006-01-02"
331 368
 	loc, _ := time.LoadLocation("Local")
@@ -344,7 +381,7 @@ func (c *HisApiController) Check3102() {
344 381
 	department, _ := service.GetDepartMentDetail(patientPrescription.Departments)
345 382
 	doctor_info, _ := service.GetAdminUserInfoByID(adminUser.CurrentOrgId, patientPrescription.DoctorId)
346 383
 	//
347
-	diagnosis_ids := strings.Split(patientPrescription.Diagnosis, ",")
384
+	diagnosis_ids := strings.Split(his.Diagnosis, ",")
348 385
 
349 386
 	prescriptions, _ := service.GetNewHisPrescriptionTen(adminUser.CurrentOrgId, his_patient_id, recordDateTime)
350 387
 
@@ -418,17 +455,44 @@ func (c *HisApiController) Check3102() {
418 455
 	fed.DscgDeptCodg = strconv.FormatInt(department.ID, 10)
419 456
 	fed.DscgDeptName = department.Name
420 457
 	fed.MedMdtrtType = ""
421
-	if his.Insutype == "390" {
422
-		fed.MedType = "1402"
423
-	} else {
424
-		fed.MedType = "9933"
425
-	}
426 458
 
427
-	if trig_scen == "2" {
428
-		//处方医嘱信息
429
-		var orders []*models.FsiOrderDtos
430
-		for _, item := range prescriptions {
431
-			for _, subItem := range item.HisDoctorAdviceInfo {
459
+	fed.MedType = order.MedType
460
+	//处方医嘱信息
461
+	var orders []*models.FsiOrderDtos
462
+	for _, item := range prescriptions {
463
+		for _, subItem := range item.HisDoctorAdviceInfo {
464
+			var order models.FsiOrderDtos
465
+			order.RxID = strconv.FormatInt(item.ID, 10)
466
+			order.Rxno = strconv.FormatInt(item.ID, 10)
467
+			order.LongDrordFlag = "0"
468
+			order.HilistType = "1"
469
+			order.ChrgType = "1"
470
+			order.DrordBhvr = "-"
471
+			order.HilistCode = subItem.BaseDrugLib.MedicalInsuranceNumber
472
+			order.HosplistName = subItem.BaseDrugLib.DrugName
473
+			order.HilistLv = "1"
474
+			order.HilistPric = strconv.FormatFloat(subItem.Price, 'E', -1, 64)
475
+			order.HosplistCode = subItem.BaseDrugLib.MedicalInsuranceNumber
476
+			order.HosplistName = subItem.BaseDrugLib.DrugName
477
+			order.Cnt = strconv.FormatFloat(subItem.PrescribingNumber, 'E', -1, 64)
478
+			order.Pric = strconv.FormatFloat(subItem.Price, 'E', -1, 64)
479
+			order.Sumamt = strconv.FormatFloat((subItem.Price * subItem.PrescribingNumber), 'E', -1, 64)
480
+			order.OwnpayAmt = ""
481
+			order.SelfpayAmt = ""
482
+			order.Spec = ""
483
+			order.SpecUnt = ""
484
+			order.DrordBegnDate = s_tm
485
+			order.DrordStopDate = ""
486
+			order.DrordDrCodg = "1"
487
+			order.DrordDeptName = department.Name
488
+			order.DrordDrCodg = "1"
489
+			order.DrordDrName = doctor_info.UserName
490
+			order.DrordDrProfttl = ""
491
+			order.CurrDrordFlag = "1"
492
+			orders = append(orders, &order)
493
+		}
494
+		for _, subItem := range item.HisPrescriptionProject {
495
+			if subItem.Type == 2 {
432 496
 				var order models.FsiOrderDtos
433 497
 				order.RxID = strconv.FormatInt(item.ID, 10)
434 498
 				order.Rxno = strconv.FormatInt(item.ID, 10)
@@ -436,15 +500,17 @@ func (c *HisApiController) Check3102() {
436 500
 				order.HilistType = "1"
437 501
 				order.ChrgType = "1"
438 502
 				order.DrordBhvr = "-"
439
-				order.HilistCode = subItem.BaseDrugLib.MedicalInsuranceNumber
440
-				order.HosplistName = subItem.BaseDrugLib.DrugName
503
+				order.HilistCode = subItem.HisProject.MedicalCode
504
+				order.HosplistName = subItem.HisProject.ProjectName
441 505
 				order.HilistLv = "1"
442 506
 				order.HilistPric = strconv.FormatFloat(subItem.Price, 'E', -1, 64)
443
-				order.HosplistCode = subItem.BaseDrugLib.MedicalInsuranceNumber
444
-				order.HosplistName = subItem.BaseDrugLib.DrugName
445
-				order.Cnt = strconv.FormatFloat(subItem.PrescribingNumber, 'E', -1, 64)
507
+				order.HosplistCode = subItem.HisProject.MedicalCode
508
+				order.HosplistName = subItem.HisProject.ProjectName
509
+				order.Cnt = subItem.Count
510
+				cnt, _ := strconv.ParseFloat(subItem.Count, 64)
511
+
446 512
 				order.Pric = strconv.FormatFloat(subItem.Price, 'E', -1, 64)
447
-				order.Sumamt = strconv.FormatFloat((subItem.Price * subItem.PrescribingNumber), 'E', -1, 64)
513
+				order.Sumamt = strconv.FormatFloat((subItem.Price * cnt), 'E', -1, 64)
448 514
 				order.OwnpayAmt = ""
449 515
 				order.SelfpayAmt = ""
450 516
 				order.Spec = ""
@@ -458,93 +524,94 @@ func (c *HisApiController) Check3102() {
458 524
 				order.DrordDrProfttl = ""
459 525
 				order.CurrDrordFlag = "1"
460 526
 				orders = append(orders, &order)
461
-			}
462
-			for _, subItem := range item.HisPrescriptionProject {
463
-				if subItem.Type == 2 {
464
-					var order models.FsiOrderDtos
465
-					order.RxID = strconv.FormatInt(item.ID, 10)
466
-					order.Rxno = strconv.FormatInt(item.ID, 10)
467
-					order.LongDrordFlag = "0"
468
-					order.HilistType = "1"
469
-					order.ChrgType = "1"
470
-					order.DrordBhvr = "-"
471
-					order.HilistCode = subItem.HisProject.MedicalCode
472
-					order.HosplistName = subItem.HisProject.ProjectName
473
-					order.HilistLv = "1"
474
-					order.HilistPric = strconv.FormatFloat(subItem.Price, 'E', -1, 64)
475
-					order.HosplistCode = subItem.HisProject.MedicalCode
476
-					order.HosplistName = subItem.HisProject.ProjectName
477
-					order.Cnt = subItem.Count
478
-					cnt, _ := strconv.ParseFloat(subItem.Count, 64)
479
-
480
-					order.Pric = strconv.FormatFloat(subItem.Price, 'E', -1, 64)
481
-					order.Sumamt = strconv.FormatFloat((subItem.Price * cnt), 'E', -1, 64)
482
-					order.OwnpayAmt = ""
483
-					order.SelfpayAmt = ""
484
-					order.Spec = ""
485
-					order.SpecUnt = ""
486
-					order.DrordBegnDate = s_tm
487
-					order.DrordStopDate = ""
488
-					order.DrordDrCodg = "1"
489
-					order.DrordDeptName = department.Name
490
-					order.DrordDrCodg = "1"
491
-					order.DrordDrName = doctor_info.UserName
492
-					order.DrordDrProfttl = ""
493
-					order.CurrDrordFlag = "1"
494
-					orders = append(orders, &order)
495 527
 
496
-				}
497
-				if subItem.Type == 3 {
528
+			}
529
+			if subItem.Type == 3 {
498 530
 
499
-					var order models.FsiOrderDtos
500
-					order.RxID = strconv.FormatInt(item.ID, 10)
501
-					order.Rxno = strconv.FormatInt(item.ID, 10)
502
-					order.LongDrordFlag = "0"
503
-					order.HilistType = "1"
504
-					order.ChrgType = "1"
505
-					order.DrordBhvr = "-"
506
-					order.HilistCode = subItem.GoodInfo.MedicalInsuranceNumber
507
-					order.HosplistName = subItem.GoodInfo.GoodName
508
-					order.HilistLv = "1"
509
-					order.HilistPric = strconv.FormatFloat(subItem.Price, 'E', -1, 64)
510
-					order.HosplistCode = subItem.GoodInfo.MedicalInsuranceNumber
511
-					order.HosplistName = subItem.GoodInfo.GoodName
512
-					order.Cnt = subItem.Count
513
-					cnt, _ := strconv.ParseFloat(subItem.Count, 64)
514
-					order.Pric = strconv.FormatFloat(subItem.Price, 'E', -1, 64)
515
-					order.Sumamt = strconv.FormatFloat((subItem.Price * cnt), 'E', -1, 64)
516
-					order.OwnpayAmt = ""
517
-					order.SelfpayAmt = ""
518
-					order.Spec = ""
519
-					order.SpecUnt = ""
520
-					order.DrordBegnDate = s_tm
521
-					order.DrordStopDate = ""
522
-					order.DrordDrCodg = "1"
523
-					order.DrordDeptName = department.Name
524
-					order.DrordDrCodg = "1"
525
-					order.DrordDrName = doctor_info.UserName
526
-					order.DrordDrProfttl = ""
527
-					order.CurrDrordFlag = "1"
528
-					orders = append(orders, &order)
531
+				var order models.FsiOrderDtos
532
+				order.RxID = strconv.FormatInt(item.ID, 10)
533
+				order.Rxno = strconv.FormatInt(item.ID, 10)
534
+				order.LongDrordFlag = "0"
535
+				order.HilistType = "1"
536
+				order.ChrgType = "1"
537
+				order.DrordBhvr = "-"
538
+				order.HilistCode = subItem.GoodInfo.MedicalInsuranceNumber
539
+				order.HosplistName = subItem.GoodInfo.GoodName
540
+				order.HilistLv = "1"
541
+				order.HilistPric = strconv.FormatFloat(subItem.Price, 'E', -1, 64)
542
+				order.HosplistCode = subItem.GoodInfo.MedicalInsuranceNumber
543
+				order.HosplistName = subItem.GoodInfo.GoodName
544
+				order.Cnt = subItem.Count
545
+				cnt, _ := strconv.ParseFloat(subItem.Count, 64)
546
+				order.Pric = strconv.FormatFloat(subItem.Price, 'E', -1, 64)
547
+				order.Sumamt = strconv.FormatFloat((subItem.Price * cnt), 'E', -1, 64)
548
+				order.OwnpayAmt = ""
549
+				order.SelfpayAmt = ""
550
+				order.Spec = ""
551
+				order.SpecUnt = ""
552
+				order.DrordBegnDate = s_tm
553
+				order.DrordStopDate = ""
554
+				order.DrordDrCodg = "1"
555
+				order.DrordDeptName = department.Name
556
+				order.DrordDrCodg = "1"
557
+				order.DrordDrName = doctor_info.UserName
558
+				order.DrordDrProfttl = ""
559
+				order.CurrDrordFlag = "1"
560
+				orders = append(orders, &order)
529 561
 
530
-				}
531 562
 			}
532 563
 		}
533
-		//处方医嘱信息
534 564
 	}
565
+	//处方医嘱信息
535 566
 	fed.MatnStas = "0"
536
-	fed.MedfeeSumamt = "0"
537
-	fed.OwnpayAmt = "0"
538
-	fed.SelfpayAmt = "0"
539
-	fed.AcctPayamt = "0"
540
-	fed.MaAmt = "0"
541
-	fed.HifpPayamt = "0"
542
-	fed.SetlTotlnum = "0"
567
+	fed.MedfeeSumamt = strconv.FormatFloat(order.MedfeeSumamt, 'E', -1, 64)
568
+	fed.OwnpayAmt = strconv.FormatFloat(order.FulamtOwnpayAmt, 'E', -1, 64)
569
+	fed.SelfpayAmt = strconv.FormatFloat(order.PreselfpayAmt, 'E', -1, 64)
570
+	fed.AcctPayamt = strconv.FormatFloat(order.AcctPay, 'E', -1, 64)
571
+	fed.MaAmt = strconv.FormatFloat(order.MafPay, 'E', -1, 64)
572
+	fed.HifpPayamt = strconv.FormatFloat(order.HifpPay, 'E', -1, 64)
573
+	fed.SetlTotlnum = "1"
543 574
 	fed.Insutype = his.Insutype
544 575
 	fed.ReimFlag = "0"
545 576
 	fed.OutSetlFlag = "0"
546 577
 
578
+	var fopd []*models.FsiOperationDtosData
579
+	data := make(map[string]interface{})
580
+	data["fed"] = fed
581
+	data["fdd"] = fdds
582
+	data["fod"] = orders
583
+	data["pd"] = pd
584
+	data["pp"] = pp
585
+	data["fopd"] = fopd
586
+	data["trig_scen"] = trig_scen
587
+
588
+	fmt.Println(data)
589
+	fmt.Println(fed)
590
+	fmt.Println(fdds)
591
+	fmt.Println(orders)
592
+	fmt.Println(pd)
593
+	fmt.Println(pp)
594
+	fmt.Println(fopd)
595
+	client := &http.Client{}
596
+	bytesData, _ := json.Marshal(data)
597
+	var req *http.Request
598
+	req, _ = http.NewRequest("POST", "http://192.168.3.111:9532/"+"jsyb/3102", bytes.NewReader(bytesData))
599
+	resp, _ := client.Do(req)
600
+	defer resp.Body.Close()
601
+	body, ioErr := ioutil.ReadAll(resp.Body)
602
+	if ioErr != nil {
603
+		utils.ErrorLog("接口返回数据读取失败: %v", ioErr)
604
+		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
605
+		return
606
+	}
607
+	var respJSON map[string]interface{}
608
+	if err := json.Unmarshal([]byte(body), &respJSON); err != nil {
609
+		utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
610
+		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
611
+		return
612
+	}
547 613
 	//手术操作集合
614
+
548 615
 	//手术操作集合
549 616
 
550 617
 }

+ 122 - 0
models/his_models.go Voir le fichier

@@ -1306,3 +1306,125 @@ type HisPsn struct {
1306 1306
 func (HisPsn) TableName() string {
1307 1307
 	return "his_psn"
1308 1308
 }
1309
+
1310
+type HisPrescriptionTen struct {
1311
+	ID                     int64                        `gorm:"column:id" json:"id" form:"id"`
1312
+	UserOrgId              int64                        `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
1313
+	RecordDate             int64                        `gorm:"column:record_date" json:"record_date" form:"record_date"`
1314
+	PatientId              int64                        `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
1315
+	HisPatientId           int64                        `gorm:"column:his_patient_id" json:"his_patient_id" form:"his_patient_id"`
1316
+	Status                 int64                        `gorm:"column:status" json:"status" form:"status"`
1317
+	Ctime                  int64                        `gorm:"column:ctime" json:"ctime" form:"ctime"`
1318
+	Mtime                  int64                        `gorm:"column:mtime" json:"mtime" form:"mtime"`
1319
+	Number                 string                       `gorm:"column:number" json:"number" form:"number"`
1320
+	Type                   int64                        `gorm:"column:type" json:"type" form:"type"`
1321
+	Doctor                 string                       `gorm:"column:doctor" json:"doctor" form:"doctor"`
1322
+	Creator                int64                        `gorm:"column:creator" json:"creator" form:"creator"`
1323
+	Modifier               int64                        `gorm:"column:modifier" json:"modifier" form:"modifier"`
1324
+	OrderStatus            int64                        `gorm:"column:order_status" json:"order_status" form:"order_status"`
1325
+	PreTime                int64                        `gorm:"column:pre_time" json:"pre_time" form:"pre_time"`
1326
+	BatchNumber            string                       `gorm:"column:batch_number" json:"batch_number" form:"batch_number"`
1327
+	PrescriptionNumber     string                       `gorm:"column:prescription_number" json:"prescription_number" form:"prescription_number"`
1328
+	Patients               Patients                     `gorm:"ForeignKey:PatientId;AssociationForeignKey:ID" json:"patient"`
1329
+	HisPatient             VMHisPatient                 `gorm:"ForeignKey:PatientId;AssociationForeignKey:patient_id" json:"hisPatient"`
1330
+	HisDoctorAdviceInfo    []*HisDoctorAdviceInfoTen    `gorm:"ForeignKey:PrescriptionId;AssociationForeignKey:ID" json:"advices"`
1331
+	HisPrescriptionProject []*HisPrescriptionProjectTen `gorm:"ForeignKey:PrescriptionId;AssociationForeignKey:ID" json:"project"`
1332
+}
1333
+
1334
+func (HisPrescriptionTen) TableName() string {
1335
+	return "his_prescription"
1336
+}
1337
+
1338
+type HisDoctorAdviceInfoTen struct {
1339
+	ID                    int64        `gorm:"column:id" json:"id" form:"id"`
1340
+	UserOrgId             int64        `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
1341
+	PatientId             int64        `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
1342
+	HisPatientId          int64        `gorm:"column:his_patient_id" json:"his_patient_id" form:"his_patient_id"`
1343
+	AdviceType            int64        `gorm:"column:advice_type" json:"advice_type" form:"advice_type"`
1344
+	AdviceDate            int64        `gorm:"column:advice_date" json:"advice_date" form:"advice_date"`
1345
+	StartTime             int64        `gorm:"column:start_time" json:"start_time" form:"start_time"`
1346
+	AdviceName            string       `gorm:"column:advice_name" json:"advice_name" form:"advice_name"`
1347
+	AdviceDesc            string       `gorm:"column:advice_desc" json:"advice_desc" form:"advice_desc"`
1348
+	ReminderDate          int64        `gorm:"column:reminder_date" json:"reminder_date" form:"reminder_date"`
1349
+	SingleDose            float64      `gorm:"column:single_dose" json:"single_dose" form:"single_dose"`
1350
+	SingleDoseUnit        string       `gorm:"column:single_dose_unit" json:"single_dose_unit" form:"single_dose_unit"`
1351
+	PrescribingNumber     float64      `gorm:"column:prescribing_number" json:"prescribing_number" form:"prescribing_number"`
1352
+	PrescribingNumberUnit string       `gorm:"column:prescribing_number_unit" json:"prescribing_number_unit" form:"prescribing_number_unit"`
1353
+	DeliveryWay           string       `gorm:"column:delivery_way" json:"delivery_way" form:"delivery_way"`
1354
+	ExecutionFrequency    string       `gorm:"column:execution_frequency" json:"execution_frequency" form:"execution_frequency"`
1355
+	AdviceDoctor          int64        `gorm:"column:advice_doctor" json:"advice_doctor" form:"advice_doctor"`
1356
+	Status                int64        `gorm:"column:status" json:"status" form:"status"`
1357
+	CreatedTime           int64        `gorm:"column:created_time" json:"created_time" form:"created_time"`
1358
+	UpdatedTime           int64        `gorm:"column:updated_time" json:"updated_time" form:"updated_time"`
1359
+	AdviceAffirm          string       `gorm:"column:advice_affirm" json:"advice_affirm" form:"advice_affirm"`
1360
+	Remark                string       `gorm:"column:remark" json:"remark" form:"remark"`
1361
+	StopTime              int64        `gorm:"column:stop_time" json:"stop_time" form:"stop_time"`
1362
+	StopReason            string       `gorm:"column:stop_reason" json:"stop_reason" form:"stop_reason"`
1363
+	StopDoctor            int64        `gorm:"column:stop_doctor" json:"stop_doctor" form:"stop_doctor"`
1364
+	StopState             int64        `gorm:"column:stop_state" json:"stop_state" form:"stop_state"`
1365
+	ParentId              int64        `gorm:"column:parent_id" json:"parent_id" form:"parent_id"`
1366
+	ExecutionTime         int64        `gorm:"column:execution_time" json:"execution_time" form:"execution_time"`
1367
+	ExecutionStaff        int64        `gorm:"column:execution_staff" json:"execution_staff" form:"execution_staff"`
1368
+	ExecutionState        int64        `gorm:"column:execution_state" json:"execution_state" form:"execution_state"`
1369
+	Checker               int64        `gorm:"column:checker" json:"checker" form:"checker"`
1370
+	RecordDate            int64        `gorm:"column:record_date" json:"record_date" form:"record_date"`
1371
+	DialysisOrderId       int64        `gorm:"column:dialysis_order_id" json:"dialysis_order_id" form:"dialysis_order_id"`
1372
+	CheckTime             int64        `gorm:"column:check_time" json:"check_time" form:"check_time"`
1373
+	CheckState            int64        `gorm:"column:check_state" json:"check_state" form:"check_state"`
1374
+	DrugSpec              float64      `gorm:"column:drug_spec" json:"drug_spec" form:"drug_spec"`
1375
+	DrugSpecUnit          string       `gorm:"column:drug_spec_unit" json:"drug_spec_unit" form:"drug_spec_unit"`
1376
+	Groupno               int64        `gorm:"column:groupno" json:"groupno" form:"groupno"`
1377
+	RemindType            int64        `gorm:"column:remind_type" json:"remind_type" form:"remind_type"`
1378
+	FrequencyType         int64        `gorm:"column:frequency_type" json:"frequency_type" form:"frequency_type"`
1379
+	DayCount              int64        `gorm:"column:day_count" json:"day_count" form:"day_count"`
1380
+	WeekDay               string       `gorm:"column:week_day" json:"week_day" form:"week_day"`
1381
+	TemplateId            string       `gorm:"column:template_id" json:"template_id" form:"template_id"`
1382
+	Modifier              int64        `gorm:"column:modifier" json:"modifier" form:"modifier"`
1383
+	DrugId                int64        `gorm:"column:drug_id" json:"drug_id" form:"drug_id"`
1384
+	Price                 float64      `gorm:"column:price" json:"price" form:"price"`
1385
+	PrescriptionId        int64        `gorm:"column:prescription_id" json:"prescription_id" form:"prescription_id"`
1386
+	MedListCodg           string       `gorm:"column:med_list_codg" json:"med_list_codg" form:"med_list_codg"`
1387
+	FeedetlSn             string       `gorm:"column:feedetl_sn" json:"feedetl_sn" form:"feedetl_sn"`
1388
+	Day                   int64        `gorm:"column:day" json:"day" form:"day"`
1389
+	HospApprFlag          int64        `gorm:"column:hosp_appr_flag" json:"hosp_appr_flag" form:"hosp_appr_flag"`
1390
+	BaseDrugLib           BaseDrugLib  `gorm:"ForeignKey:DrugId;AssociationForeignKey:ID" json:"drug"`
1391
+	HisOrderInfo          HisOrderInfo `gorm:"ForeignKey:ID;AssociationForeignKey:AdviceId" json:"order_info"`
1392
+}
1393
+
1394
+func (HisDoctorAdviceInfoTen) TableName() string {
1395
+	return "his_doctor_advice_info"
1396
+}
1397
+
1398
+type HisPrescriptionProjectTen struct {
1399
+	ID                 int64            `gorm:"column:id" json:"id" form:"id"`
1400
+	ProjectId          int64            `gorm:"column:project_id" json:"project_id" form:"project_id"`
1401
+	Price              float64          `gorm:"column:price" json:"price" form:"price"`
1402
+	UserOrgId          int64            `gorm:"column:user_org_id" json:"user_org_id" form:"user_org_id"`
1403
+	Status             int64            `gorm:"column:status" json:"status" form:"status"`
1404
+	Ctime              int64            `gorm:"column:ctime" json:"ctime" form:"ctime"`
1405
+	Mtime              int64            `gorm:"column:mtime" json:"mtime" form:"mtime"`
1406
+	PatientId          int64            `gorm:"column:patient_id" json:"patient_id" form:"patient_id"`
1407
+	HisPatientId       int64            `gorm:"column:his_patient_id" json:"his_patient_id" form:"his_patient_id"`
1408
+	RecordDate         int64            `gorm:"column:record_date" json:"record_date" form:"record_date"`
1409
+	PrescriptionId     int64            `gorm:"column:prescription_id" json:"prescription_id" form:"prescription_id"`
1410
+	Count              string           `gorm:"column:count" json:"count" form:"count"`
1411
+	FeedetlSn          string           `gorm:"column:feedetl_sn" json:"feedetl_sn" form:"feedetl_sn"`
1412
+	MedListCodg        string           `gorm:"column:med_list_codg" json:"med_list_codg" form:"med_list_codg"`
1413
+	SingleDose         string           `gorm:"column:single_dose" json:"single_dose" form:"single_dose"`
1414
+	DeliveryWay        string           `gorm:"column:delivery_way" json:"delivery_way" form:"delivery_way"`
1415
+	ExecutionFrequency string           `gorm:"column:execution_frequency" json:"execution_frequency" form:"execution_frequency"`
1416
+	Day                string           `gorm:"column:day" json:"day" form:"day"`
1417
+	HisProject         HisProject       `gorm:"ForeignKey:ProjectId;AssociationForeignKey:ID" json:"project"`
1418
+	GoodInfo           GoodInfo         `gorm:"ForeignKey:ProjectId;AssociationForeignKey:ID" json:"good_info"`
1419
+	Type               int64            `gorm:"column:type" json:"type" form:"type"`
1420
+	Remark             string           `gorm:"column:remark" json:"remark" form:"remark"`
1421
+	Unit               string           `gorm:"column:unit" json:"unit" form:"unit"`
1422
+	TeamId             int64            `gorm:"column:team_id" json:"team_id" form:"team_id"`
1423
+	XtHisProjectTeam   XtHisProjectTeam `gorm:"ForeignKey:TeamId;AssociationForeignKey:ID" json:"team"`
1424
+	IsCheckTeam        int64            `gorm:"-" json:"is_check_team" form:"is_check_team"`
1425
+	HisOrderInfo       HisOrderInfo     `gorm:"ForeignKey:ID;AssociationForeignKey:ProjectId" json:"order_info"`
1426
+}
1427
+
1428
+func (HisPrescriptionProjectTen) TableName() string {
1429
+	return "his_prescription_project"
1430
+}

+ 4 - 4
service/his_service.go Voir le fichier

@@ -1426,16 +1426,16 @@ func UpdateOrder(order models.HisOrder) (err error) {
1426 1426
 	return
1427 1427
 }
1428 1428
 
1429
-func GetNewHisPrescriptionTen(org_id int64, his_patient_id int64, record_date int64) (prescription []*models.HisPrescription, err error) {
1430
-	err = readDb.Model(&models.HisPrescription{}).
1429
+func GetNewHisPrescriptionTen(org_id int64, his_patient_id int64, record_date int64) (prescription []*models.HisPrescriptionTen, err error) {
1430
+	err = readDb.Model(&models.HisPrescriptionTen{}).
1431 1431
 		Preload("HisAdditionalCharge", func(db *gorm.DB) *gorm.DB {
1432 1432
 			return db.Where("status = 1 AND user_org_id = ?", org_id).Preload("XtHisAddtionConfig", "status=1")
1433 1433
 		}).
1434 1434
 		Preload("HisDoctorAdviceInfo", func(db *gorm.DB) *gorm.DB {
1435
-			return db.Where("status = 1 AND user_org_id = ?", org_id).Preload("BaseDrugLib", "status=1")
1435
+			return db.Where("status = 1 AND user_org_id = ?", org_id).Preload("HisOrderInfo", "status = 1").Preload("BaseDrugLib", "status=1")
1436 1436
 		}).
1437 1437
 		Preload("HisPrescriptionProject", func(db *gorm.DB) *gorm.DB {
1438
-			return db.Where("status = 1 AND user_org_id = ?", org_id).Preload("HisProject", "status=1").Preload("GoodInfo", "status=1")
1438
+			return db.Where("status = 1 AND user_org_id = ?", org_id).Preload("HisOrderInfo", "status = 1").Preload("HisProject", "status=1").Preload("GoodInfo", "status=1")
1439 1439
 		}).
1440 1440
 		Where("user_org_id = ? AND status = 1 AND record_date = ? AND his_patient_id = ? AND order_status <> 2 AND p_type <> 1 ", org_id, record_date, his_patient_id).
1441 1441
 		Find(&prescription).Error

+ 4 - 4
service/jsyb_service.go Voir le fichier

@@ -1207,7 +1207,7 @@ func GetMacTwo() string {
1207 1207
 	return ""
1208 1208
 }
1209 1209
 
1210
-func Jsyb3101(pd models.PatientDtos, fed models.FsiEncounterDtos, fdds []*models.FsiDiagnoseDtos, fods []*models.FsiOrderDtos, fopds []*models.FsiOperationDtosData, params models.PublicParams) (string, string) {
1210
+func Jsyb3101(pd models.PatientDtos, fed models.FsiEncounterDtos, fdds []*models.FsiDiagnoseDtos, fods []*models.FsiOrderDtos, fopds []*models.FsiOperationDtosData, params models.PublicParams, trig_scen string) (string, string) {
1211 1211
 	// 生成签名
1212 1212
 	timestamp := time.Now().Unix()
1213 1213
 	// 生成输入报文
@@ -1339,7 +1339,7 @@ func Jsyb3101(pd models.PatientDtos, fed models.FsiEncounterDtos, fdds []*models
1339 1339
 	patientDtosinputData["fsi_his_data_dto"] = ""
1340 1340
 	patientDtosinputData["fsi_encounter_dtos"] = fisEncounterDtosData
1341 1341
 	inputData["syscode"] = "LinkDialysis"
1342
-	inputData["trig_scen"] = "1"
1342
+	inputData["trig_scen"] = trig_scen
1343 1343
 	inputData["patient_dtos"] = patientDtosinputData
1344 1344
 	input["data"] = inputData
1345 1345
 	inputMessage["infno"] = "3101"
@@ -1354,7 +1354,7 @@ func Jsyb3101(pd models.PatientDtos, fed models.FsiEncounterDtos, fdds []*models
1354 1354
 	return HttpRequest(params.RequestUrl, params.AccessKey, params.SecretKey, timestamp, string(bytesData)), string(bytesData)
1355 1355
 
1356 1356
 }
1357
-func Jsyb3102(pd models.PatientDtos, fed models.FsiEncounterDtos, fdds []*models.FsiDiagnoseDtos, fods []*models.FsiOrderDtos, fopds []*models.FsiOperationDtosData, params models.PublicParams) (string, string) {
1357
+func Jsyb3102(pd models.PatientDtos, fed models.FsiEncounterDtos, fdds []*models.FsiDiagnoseDtos, fods []*models.FsiOrderDtos, fopds []*models.FsiOperationDtosData, params models.PublicParams, trig_scen string) (string, string) {
1358 1358
 	// 生成签名
1359 1359
 	timestamp := time.Now().Unix()
1360 1360
 	// 生成输入报文
@@ -1486,7 +1486,7 @@ func Jsyb3102(pd models.PatientDtos, fed models.FsiEncounterDtos, fdds []*models
1486 1486
 	patientDtosinputData["fsi_his_data_dto"] = ""
1487 1487
 	patientDtosinputData["fsi_encounter_dtos"] = fisEncounterDtosData
1488 1488
 	inputData["syscode"] = "LinkDialysis"
1489
-	inputData["trig_scen"] = "1"
1489
+	inputData["trig_scen"] = trig_scen
1490 1490
 	inputData["patient_dtos"] = patientDtosinputData
1491 1491
 	input["data"] = inputData
1492 1492
 	inputMessage["infno"] = "3102"