csx vor 3 Jahren
Ursprung
Commit
5c025a8a43
3 geänderte Dateien mit 251 neuen und 118 gelöschten Zeilen
  1. 60 59
      controllers/base_api_controller.go
  2. 189 57
      controllers/his_api_controller.go
  3. 2 2
      service/schedule_service.go

+ 60 - 59
controllers/base_api_controller.go Datei anzeigen

@@ -2,6 +2,7 @@ package controllers
2 2
 
3 3
 import (
4 4
 	"XT_New/enums"
5
+	"XT_New/models"
5 6
 	"XT_New/service"
6 7
 	"fmt"
7 8
 	"strconv"
@@ -69,36 +70,36 @@ type BaseAuthAPIController struct {
69 70
 func (this *BaseAuthAPIController) Prepare() {
70 71
 	this.BaseAPIController.Prepare()
71 72
 	if this.GetAdminUserInfo() == nil {
72
-		//var userAdmin models.AdminUser
73
-		//userAdmin.Id = 1448
74
-		//userAdmin.Mobile = "13318599895"
75
-		//
76
-		//userAdmin.Id = 597
77
-		//userAdmin.Mobile = "19874122664"
78
-		//userAdmin.IsSuperAdmin = false
79
-		//userAdmin.Status = 1
80
-		//userAdmin.CreateTime = 1530786071
81
-		//userAdmin.ModifyTime = 1530786071
82
-		//var subscibe models.ServeSubscibe
83
-		//subscibe.ID = 1
84
-		//subscibe.OrgId = 3877
85
-		//subscibe.PeriodStart = 1538035409
86
-		//subscibe.PeriodEnd = 1569571409
87
-		//subscibe.State = 1
88
-		//subscibe.Status = 1
89
-		//subscibe.CreatedTime = 1538035409
90
-		//subscibe.UpdatedTime = 1538035409
91
-		//subscibes := make(map[int64]*models.ServeSubscibe, 0)
92
-		//subscibes[4] = &subscibe
93
-		//var adminUserInfo service.AdminUserInfo
94
-		//adminUserInfo.CurrentOrgId = 3877
95
-		//adminUserInfo.CurrentAppId = 4
96
-		//adminUserInfo.AdminUser = &userAdmin
97
-		//adminUserInfo.Subscibes = subscibes
98
-		//this.SetSession("admin_user_info", &adminUserInfo)
99
-
100
-		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeNotLogin)
101
-		this.StopRun()
73
+		var userAdmin models.AdminUser
74
+		userAdmin.Id = 1448
75
+		userAdmin.Mobile = "13318599895"
76
+
77
+		userAdmin.Id = 597
78
+		userAdmin.Mobile = "19874122664"
79
+		userAdmin.IsSuperAdmin = false
80
+		userAdmin.Status = 1
81
+		userAdmin.CreateTime = 1530786071
82
+		userAdmin.ModifyTime = 1530786071
83
+		var subscibe models.ServeSubscibe
84
+		subscibe.ID = 1
85
+		subscibe.OrgId = 10106
86
+		subscibe.PeriodStart = 1538035409
87
+		subscibe.PeriodEnd = 1569571409
88
+		subscibe.State = 1
89
+		subscibe.Status = 1
90
+		subscibe.CreatedTime = 1538035409
91
+		subscibe.UpdatedTime = 1538035409
92
+		subscibes := make(map[int64]*models.ServeSubscibe, 0)
93
+		subscibes[4] = &subscibe
94
+		var adminUserInfo service.AdminUserInfo
95
+		adminUserInfo.CurrentOrgId = 10106
96
+		adminUserInfo.CurrentAppId = 4
97
+		adminUserInfo.AdminUser = &userAdmin
98
+		adminUserInfo.Subscibes = subscibes
99
+		this.SetSession("admin_user_info", &adminUserInfo)
100
+
101
+		//this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeNotLogin)
102
+		//this.StopRun()
102 103
 
103 104
 	}
104 105
 
@@ -315,35 +316,35 @@ type BaseServeAPIController struct {
315 316
 func (this *BaseServeAPIController) Prepare() {
316 317
 	this.BaseAPIController.Prepare()
317 318
 	if this.GetAdminUserInfo() == nil {
318
-		//var userAdmin models.AdminUser
319
-		//userAdmin.Id = 1448
320
-		//userAdmin.Mobile = "13318599895"
321
-		//
322
-		//userAdmin.Id = 597
323
-		//userAdmin.Mobile = "19874122664"
324
-		//userAdmin.IsSuperAdmin = false
325
-		//userAdmin.Status = 1
326
-		//userAdmin.CreateTime = 1530786071
327
-		//userAdmin.ModifyTime = 1530786071
328
-		//var subscibe models.ServeSubscibe
329
-		//subscibe.ID = 1
330
-		//subscibe.OrgId = 3877
331
-		//subscibe.PeriodStart = 1538035409
332
-		//subscibe.PeriodEnd = 1569571409
333
-		//subscibe.State = 1
334
-		//subscibe.Status = 1
335
-		//subscibe.CreatedTime = 1538035409
336
-		//subscibe.UpdatedTime = 1538035409
337
-		//subscibes := make(map[int64]*models.ServeSubscibe, 0)
338
-		//subscibes[4] = &subscibe
339
-		//var adminUserInfo service.AdminUserInfo
340
-		//adminUserInfo.CurrentOrgId = 3877
341
-		//adminUserInfo.CurrentAppId = 4
342
-		//adminUserInfo.AdminUser = &userAdmin
343
-		//adminUserInfo.Subscibes = subscibes
344
-		//this.SetSession("admin_user_info", &adminUserInfo)
345
-		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeNotLogin)
346
-		this.StopRun()
319
+		var userAdmin models.AdminUser
320
+		userAdmin.Id = 1448
321
+		userAdmin.Mobile = "13318599895"
322
+
323
+		userAdmin.Id = 597
324
+		userAdmin.Mobile = "19874122664"
325
+		userAdmin.IsSuperAdmin = false
326
+		userAdmin.Status = 1
327
+		userAdmin.CreateTime = 1530786071
328
+		userAdmin.ModifyTime = 1530786071
329
+		var subscibe models.ServeSubscibe
330
+		subscibe.ID = 1
331
+		subscibe.OrgId = 10106
332
+		subscibe.PeriodStart = 1538035409
333
+		subscibe.PeriodEnd = 1569571409
334
+		subscibe.State = 1
335
+		subscibe.Status = 1
336
+		subscibe.CreatedTime = 1538035409
337
+		subscibe.UpdatedTime = 1538035409
338
+		subscibes := make(map[int64]*models.ServeSubscibe, 0)
339
+		subscibes[4] = &subscibe
340
+		var adminUserInfo service.AdminUserInfo
341
+		adminUserInfo.CurrentOrgId = 10106
342
+		adminUserInfo.CurrentAppId = 4
343
+		adminUserInfo.AdminUser = &userAdmin
344
+		adminUserInfo.Subscibes = subscibes
345
+		this.SetSession("admin_user_info", &adminUserInfo)
346
+		//this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeNotLogin)
347
+		//this.StopRun()
347 348
 	}
348 349
 
349 350
 	//if adminUserInfo.AppRole != nil {

+ 189 - 57
controllers/his_api_controller.go Datei anzeigen

@@ -100,6 +100,9 @@ func HisManagerApiRegistRouters() {
100 100
 
101 101
 	beego.Router("/api/uncharge/list", &HisApiController{}, "get:GetHisUnChargePatientList")
102 102
 
103
+	beego.Router("/api/monthcharge/info", &HisApiController{}, "get:GetHisMonthChargePatientInfo")
104
+	beego.Router("/api/monthhispatient/get", &HisApiController{}, "get:GetHisMonthPatientInfo")
105
+
103 106
 }
104 107
 
105 108
 func (c *HisApiController) GetHisUnChargePatientList() {
@@ -349,8 +352,8 @@ func (c *HisApiController) GetHisPatientInfo() {
349 352
 	his_patient_id, _ := c.GetInt64("his_patient_id")
350 353
 	record_date := c.GetString("record_date")
351 354
 	number := c.GetString("number")
352
-	start_time := c.GetString("start_time")
353
-	end_time := c.GetString("end_time")
355
+	//start_time := c.GetString("start_time")
356
+	//end_time := c.GetString("end_time")
354 357
 	p_type, _ := c.GetInt64("p_type")
355 358
 
356 359
 	timeLayout := "2006-01-02"
@@ -361,16 +364,16 @@ func (c *HisApiController) GetHisPatientInfo() {
361 364
 		return
362 365
 	}
363 366
 	recordDateTime := theTime.Unix()
364
-	startTime, err := time.ParseInLocation(timeLayout+" 15:04:05", start_time+" 00:00:00", loc)
365
-	if err != nil {
366
-
367
-	}
368
-	startRecordDateTime := startTime.Unix()
369
-	endTime, err := time.ParseInLocation(timeLayout+" 15:04:05", end_time+" 23:59:59", loc)
370
-	if err != nil {
371
-
372
-	}
373
-	endRecordDateTime := endTime.Unix()
367
+	//startTime, err := time.ParseInLocation(timeLayout+" 15:04:05", start_time+" 00:00:00", loc)
368
+	//if err != nil {
369
+	//
370
+	//}
371
+	//startRecordDateTime := startTime.Unix()
372
+	//endTime, err := time.ParseInLocation(timeLayout+" 15:04:05", end_time+" 23:59:59", loc)
373
+	//if err != nil {
374
+	//
375
+	//}
376
+	//endRecordDateTime := endTime.Unix()
374 377
 	admin := c.GetAdminUserInfo()
375 378
 	his_patient_info, _ := service.GetNewHisPatientInfoTwo(admin.CurrentOrgId, his_patient_id, recordDateTime)
376 379
 	xt_patient_info, _ := service.GetXTPatientInfo(admin.CurrentOrgId, patient_id)
@@ -396,7 +399,7 @@ func (c *HisApiController) GetHisPatientInfo() {
396 399
 
397 400
 	}
398 401
 	//prescriptions, _ := service.GetHisPrescription(admin.CurrentOrgId, patient_id, his_patient_id, recordDateTime)
399
-	monthPrescriptions, _ := service.GetMonthHisPrescriptionTwo(admin.CurrentOrgId, patient_id, startRecordDateTime, endRecordDateTime, p_type)
402
+	//monthPrescriptions, _ := service.GetMonthHisPrescriptionTwo(admin.CurrentOrgId, patient_id, startRecordDateTime, endRecordDateTime, p_type)
400 403
 	case_history, _ := service.GetHisPatientCaseHistoryInfo(admin.CurrentOrgId, patient_id, recordDateTime)
401 404
 	patientPrescriptionInfo, _ := service.FindPatientPrescriptionInfo(admin.CurrentOrgId, patient_id, recordDateTime, p_type)
402 405
 	lastPatientPrescriptionInfo, _ := service.FindLastPatientPrescriptionInfoTwo(admin.CurrentOrgId, patient_id, recordDateTime, p_type)
@@ -409,21 +412,21 @@ func (c *HisApiController) GetHisPatientInfo() {
409 412
 	//获取所有科室信息
410 413
 	department, _ := service.GetAllDepartMent(admin.CurrentOrgId)
411 414
 	c.ServeSuccessJSON(map[string]interface{}{
412
-		"his_info":            his_patient_info,
413
-		"xt_info":             xt_patient_info,
414
-		"prescription":        prescriptions,
415
-		"case_history":        case_history,
416
-		"info":                patientPrescriptionInfo,
417
-		"month_prescriptions": monthPrescriptions,
418
-		"order":               order,
419
-		"doctors":             doctors,
420
-		"department":          department,
421
-		"sch_prescriptions":   sch_prescriptions,
422
-		"last_prescriptions":  last_prescriptions,
423
-		"schedule":            sch,
424
-		"count":               count,
425
-		"drugStockConfig":     drugStockConfig,
426
-		"last_info":           lastPatientPrescriptionInfo,
415
+		"his_info":     his_patient_info,
416
+		"xt_info":      xt_patient_info,
417
+		"prescription": prescriptions,
418
+		"case_history": case_history,
419
+		"info":         patientPrescriptionInfo,
420
+		//"month_prescriptions": monthPrescriptions,
421
+		"order":              order,
422
+		"doctors":            doctors,
423
+		"department":         department,
424
+		"sch_prescriptions":  sch_prescriptions,
425
+		"last_prescriptions": last_prescriptions,
426
+		"schedule":           sch,
427
+		"count":              count,
428
+		"drugStockConfig":    drugStockConfig,
429
+		"last_info":          lastPatientPrescriptionInfo,
427 430
 	})
428 431
 	return
429 432
 
@@ -3492,8 +3495,8 @@ func (c *HisApiController) GetHisChargePatientInfo() {
3492 3495
 	patient_id, _ := c.GetInt64("patient_id")
3493 3496
 	his_patient_id, _ := c.GetInt64("his_patient_id")
3494 3497
 	record_date := c.GetString("record_date")
3495
-	start_time := c.GetString("start_time")
3496
-	end_time := c.GetString("end_time")
3498
+	//start_time := c.GetString("start_time")
3499
+	//end_time := c.GetString("end_time")
3497 3500
 	order_status, _ := c.GetInt64("type", 0)
3498 3501
 	p_type, _ := c.GetInt64("p_type", 0)
3499 3502
 	order_id, _ := c.GetInt64("order_id", 0)
@@ -3507,17 +3510,17 @@ func (c *HisApiController) GetHisChargePatientInfo() {
3507 3510
 	}
3508 3511
 	recordDateTime := theTime.Unix()
3509 3512
 
3510
-	startTime, err := time.ParseInLocation(timeLayout+" 15:04:05", start_time+" 00:00:00", loc)
3511
-	if err != nil {
3512
-
3513
-	}
3514
-	startRecordDateTime := startTime.Unix()
3515
-
3516
-	endTime, err := time.ParseInLocation(timeLayout+" 15:04:05", end_time+" 23:59:59", loc)
3517
-	if err != nil {
3518
-
3519
-	}
3520
-	endRecordDateTime := endTime.Unix()
3513
+	//startTime, err := time.ParseInLocation(timeLayout+" 15:04:05", start_time+" 00:00:00", loc)
3514
+	//if err != nil {
3515
+	//
3516
+	//}
3517
+	//startRecordDateTime := startTime.Unix()
3518
+	//
3519
+	//endTime, err := time.ParseInLocation(timeLayout+" 15:04:05", end_time+" 23:59:59", loc)
3520
+	//if err != nil {
3521
+	//
3522
+	//}
3523
+	//endRecordDateTime := endTime.Unix()
3521 3524
 
3522 3525
 	admin := c.GetAdminUserInfo()
3523 3526
 	his_patient_info, _ := service.GetNewHisPatientInfo(his_patient_id)
@@ -3533,12 +3536,13 @@ func (c *HisApiController) GetHisChargePatientInfo() {
3533 3536
 		prescriptions, _ = service.GetChargeHisPrescriptionSeven(admin.CurrentOrgId, patient_id, order.Number, p_type)
3534 3537
 	}
3535 3538
 
3536
-	var monthPrescriptions []*models.HisPrescription
3537
-	if order_status == 1 || order_status == 0 {
3538
-		monthPrescriptions, _ = service.GetUnChargeMonthHisPrescriptionThree(admin.CurrentOrgId, patient_id, startRecordDateTime, endRecordDateTime, p_type)
3539
-	} else if order_status == 2 {
3540
-		monthPrescriptions, _ = service.GetChargeMonthHisPrescriptionFive(admin.CurrentOrgId, patient_id, order.Number, p_type)
3541
-	}
3539
+	//var monthPrescriptions []*models.HisPrescription
3540
+	//if order_status == 1 || order_status == 0 {
3541
+	//	monthPrescriptions, _ = service.GetUnChargeMonthHisPrescriptionThree(admin.CurrentOrgId, patient_id, startRecordDateTime, endRecordDateTime, p_type)
3542
+	//} else if order_status == 2 {
3543
+	//	monthPrescriptions, _ = service.GetChargeMonthHisPrescriptionFive(admin.CurrentOrgId, patient_id, order.Number, p_type)
3544
+	//}
3545
+
3542 3546
 	case_history, _ := service.GetHisPatientCaseHistoryInfo(admin.CurrentOrgId, patient_id, recordDateTime)
3543 3547
 	patientPrescriptionInfo, _ := service.FindPatientPrescriptionInfo(admin.CurrentOrgId, patient_id, recordDateTime, p_type)
3544 3548
 
@@ -3549,16 +3553,16 @@ func (c *HisApiController) GetHisChargePatientInfo() {
3549 3553
 	department, _ := service.GetAllDepartMent(admin.CurrentOrgId)
3550 3554
 
3551 3555
 	c.ServeSuccessJSON(map[string]interface{}{
3552
-		"his_info":            his_patient_info,
3553
-		"xt_info":             xt_patient_info,
3554
-		"prescription":        prescriptions,
3555
-		"case_history":        case_history,
3556
-		"info":                patientPrescriptionInfo,
3557
-		"last_info":           lastPatientPrescriptionInfo,
3558
-		"month_prescriptions": monthPrescriptions,
3559
-		"order":               order,
3560
-		"doctors":             doctors,
3561
-		"department":          department,
3556
+		"his_info":     his_patient_info,
3557
+		"xt_info":      xt_patient_info,
3558
+		"prescription": prescriptions,
3559
+		"case_history": case_history,
3560
+		"info":         patientPrescriptionInfo,
3561
+		"last_info":    lastPatientPrescriptionInfo,
3562
+		//"month_prescriptions": monthPrescriptions,
3563
+		"order":      order,
3564
+		"doctors":    doctors,
3565
+		"department": department,
3562 3566
 	})
3563 3567
 	return
3564 3568
 
@@ -5040,3 +5044,131 @@ func (this *HisApiController) ChangeMedType() {
5040 5044
 	}
5041 5045
 
5042 5046
 }
5047
+
5048
+func (c *HisApiController) GetHisMonthChargePatientInfo() {
5049
+	patient_id, _ := c.GetInt64("patient_id")
5050
+	his_patient_id, _ := c.GetInt64("his_patient_id")
5051
+	record_date := c.GetString("record_date")
5052
+	start_time := c.GetString("start_time")
5053
+	end_time := c.GetString("end_time")
5054
+	order_status, _ := c.GetInt64("type", 0)
5055
+	p_type, _ := c.GetInt64("p_type", 0)
5056
+	order_id, _ := c.GetInt64("order_id", 0)
5057
+
5058
+	timeLayout := "2006-01-02"
5059
+	loc, _ := time.LoadLocation("Local")
5060
+	theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", record_date+" 00:00:00", loc)
5061
+	if err != nil {
5062
+		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
5063
+		return
5064
+	}
5065
+	recordDateTime := theTime.Unix()
5066
+
5067
+	startTime, err := time.ParseInLocation(timeLayout+" 15:04:05", start_time+" 00:00:00", loc)
5068
+	if err != nil {
5069
+
5070
+	}
5071
+	startRecordDateTime := startTime.Unix()
5072
+
5073
+	endTime, err := time.ParseInLocation(timeLayout+" 15:04:05", end_time+" 23:59:59", loc)
5074
+	if err != nil {
5075
+
5076
+	}
5077
+	endRecordDateTime := endTime.Unix()
5078
+
5079
+	admin := c.GetAdminUserInfo()
5080
+	his_patient_info, _ := service.GetNewHisPatientInfo(his_patient_id)
5081
+	xt_patient_info, _ := service.GetXTPatientInfo(admin.CurrentOrgId, patient_id)
5082
+
5083
+	order, _ := service.GetHisOrderByID(order_id)
5084
+
5085
+	var monthPrescriptions []*models.HisPrescription
5086
+	if order_status == 1 || order_status == 0 {
5087
+		monthPrescriptions, _ = service.GetUnChargeMonthHisPrescriptionThree(admin.CurrentOrgId, patient_id, startRecordDateTime, endRecordDateTime, p_type)
5088
+	} else if order_status == 2 {
5089
+		monthPrescriptions, _ = service.GetChargeMonthHisPrescriptionFive(admin.CurrentOrgId, patient_id, order.Number, p_type)
5090
+	}
5091
+
5092
+	case_history, _ := service.GetHisPatientCaseHistoryInfo(admin.CurrentOrgId, patient_id, recordDateTime)
5093
+	patientPrescriptionInfo, _ := service.FindPatientPrescriptionInfo(admin.CurrentOrgId, patient_id, recordDateTime, p_type)
5094
+
5095
+	lastPatientPrescriptionInfo, _ := service.FindLastPatientPrescriptionInfoTwo(admin.CurrentOrgId, patient_id, recordDateTime, p_type)
5096
+
5097
+	doctors, _ := service.GetHisAdminUserDoctors(admin.CurrentOrgId)
5098
+	//获取所有科室信息
5099
+	department, _ := service.GetAllDepartMent(admin.CurrentOrgId)
5100
+
5101
+	c.ServeSuccessJSON(map[string]interface{}{
5102
+		"his_info":            his_patient_info,
5103
+		"xt_info":             xt_patient_info,
5104
+		"case_history":        case_history,
5105
+		"info":                patientPrescriptionInfo,
5106
+		"last_info":           lastPatientPrescriptionInfo,
5107
+		"month_prescriptions": monthPrescriptions,
5108
+		"order":               order,
5109
+		"doctors":             doctors,
5110
+		"department":          department,
5111
+	})
5112
+	return
5113
+}
5114
+
5115
+func (c *HisApiController) GetHisMonthPatientInfo() {
5116
+	patient_id, _ := c.GetInt64("patient_id")
5117
+	his_patient_id, _ := c.GetInt64("his_patient_id")
5118
+	record_date := c.GetString("record_date")
5119
+	number := c.GetString("number")
5120
+	start_time := c.GetString("start_time")
5121
+	end_time := c.GetString("end_time")
5122
+	p_type, _ := c.GetInt64("p_type")
5123
+
5124
+	timeLayout := "2006-01-02"
5125
+	loc, _ := time.LoadLocation("Local")
5126
+	theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", record_date+" 00:00:00", loc)
5127
+	if err != nil {
5128
+		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
5129
+		return
5130
+	}
5131
+	recordDateTime := theTime.Unix()
5132
+	startTime, err := time.ParseInLocation(timeLayout+" 15:04:05", start_time+" 00:00:00", loc)
5133
+	if err != nil {
5134
+
5135
+	}
5136
+	startRecordDateTime := startTime.Unix()
5137
+	endTime, err := time.ParseInLocation(timeLayout+" 15:04:05", end_time+" 23:59:59", loc)
5138
+	if err != nil {
5139
+
5140
+	}
5141
+	endRecordDateTime := endTime.Unix()
5142
+	admin := c.GetAdminUserInfo()
5143
+	his_patient_info, _ := service.GetNewHisPatientInfoTwo(admin.CurrentOrgId, his_patient_id, recordDateTime)
5144
+	xt_patient_info, _ := service.GetXTPatientInfo(admin.CurrentOrgId, patient_id)
5145
+
5146
+	count, _ := service.GetHisPatientCount(admin.CurrentOrgId, patient_id, recordDateTime)
5147
+
5148
+	monthPrescriptions, _ := service.GetMonthHisPrescriptionTwo(admin.CurrentOrgId, patient_id, startRecordDateTime, endRecordDateTime, p_type)
5149
+	case_history, _ := service.GetHisPatientCaseHistoryInfo(admin.CurrentOrgId, patient_id, recordDateTime)
5150
+	patientPrescriptionInfo, _ := service.FindPatientPrescriptionInfo(admin.CurrentOrgId, patient_id, recordDateTime, p_type)
5151
+	lastPatientPrescriptionInfo, _ := service.FindLastPatientPrescriptionInfoTwo(admin.CurrentOrgId, patient_id, recordDateTime, p_type)
5152
+
5153
+	order, _ := service.GetHisOrder(admin.CurrentOrgId, number, patient_id)
5154
+	doctors, _ := service.GetHisAdminUserDoctors(admin.CurrentOrgId)
5155
+
5156
+	_, drugStockConfig := service.FindDrugStockAutomaticReduceRecordByOrgId(admin.CurrentOrgId)
5157
+	//获取所有科室信息
5158
+	department, _ := service.GetAllDepartMent(admin.CurrentOrgId)
5159
+	c.ServeSuccessJSON(map[string]interface{}{
5160
+		"his_info":            his_patient_info,
5161
+		"xt_info":             xt_patient_info,
5162
+		"case_history":        case_history,
5163
+		"info":                patientPrescriptionInfo,
5164
+		"month_prescriptions": monthPrescriptions,
5165
+		"order":               order,
5166
+		"doctors":             doctors,
5167
+		"department":          department,
5168
+		"count":               count,
5169
+		"drugStockConfig":     drugStockConfig,
5170
+		"last_info":           lastPatientPrescriptionInfo,
5171
+	})
5172
+	return
5173
+
5174
+}

+ 2 - 2
service/schedule_service.go Datei anzeigen

@@ -583,7 +583,7 @@ func GetWeekDayScheduleById(orgid int64, scheduleDate int64, scheduleType int64,
583 583
 	err = db.Select("x.id,x.user_org_id,x.partition_id,x.bed_id,x.patient_id,x.schedule_date,x.schedule_type,x.schedule_week,x.mode_id,x.is_export").Preload("XtPatients", "status = 1").Preload("DeviceZone", "status = 1").Preload("DeviceNumber", "status = 1").Preload("DialysisOrder", "status = 1").Preload("DoctorAdvice", func(db *gorm.DB) *gorm.DB {
584 584
 		return db.Where("status =1 and parent_id = 0").Preload("ChildDoctorAdvice", "status = 1")
585 585
 	}).Preload("HisDoctorAdviceInfo", "status = 1").Preload("DialysisPrescription", "status = 1").Preload("DialysisSolution", func(db *gorm.DB) *gorm.DB {
586
-		return db.Where("status =1").Order("id desc")
586
+		return db.Where("status =1").Order("id asc")
587 587
 	}).Find(&list).Error
588 588
 
589 589
 	return list, err
@@ -608,7 +608,7 @@ func GetWeekDayScheduleByIdTwo(orgid int64, scheduleDate int64, scheduleType int
608 608
 	err = db.Select("x.id,x.user_org_id,x.partition_id,x.bed_id,x.patient_id,x.schedule_date,x.schedule_type,x.schedule_week,x.mode_id,x.is_export").Preload("XtPatients", "status = 1").Preload("DeviceZone", "status = 1").Preload("DeviceNumber", "status = 1").Preload("DialysisOrder", "status = 1").Preload("DoctorAdvice", func(db *gorm.DB) *gorm.DB {
609 609
 		return db.Where("status =1 and parent_id = 0").Preload("ChildDoctorAdvice", "status = 1")
610 610
 	}).Preload("HisDoctorAdviceInfo", "status = 1").Preload("DialysisPrescription", "status = 1").Preload("DialysisSolution", func(db *gorm.DB) *gorm.DB {
611
-		return db.Where("status =1").Order("id desc")
611
+		return db.Where("status =1").Order("id asc")
612 612
 	}).Find(&list).Error
613 613
 
614 614
 	return list, err