浏览代码

2024/6/17

28169 3 个月前
父节点
当前提交
066e8eafaf

二进制
XT_New.exe 查看文件


+ 4 - 4
controllers/base_api_controller.go 查看文件

@@ -83,7 +83,7 @@ func (this *BaseAuthAPIController) Prepare() {
83 83
 		userAdmin.ModifyTime = 1530786071
84 84
 		var subscibe models.ServeSubscibe
85 85
 		subscibe.ID = 11
86
-		subscibe.OrgId = 10191 //机构id
86
+		subscibe.OrgId = 10278 //机构id
87 87
 		subscibe.PeriodStart = 1547447814
88 88
 		subscibe.PeriodEnd = 1550039814
89 89
 		subscibe.State = 1
@@ -93,7 +93,7 @@ func (this *BaseAuthAPIController) Prepare() {
93 93
 		subscibes := make(map[int64]*models.ServeSubscibe, 0)
94 94
 		subscibes[4] = &subscibe
95 95
 		var adminUserInfo service.AdminUserInfo
96
-		adminUserInfo.CurrentOrgId = 10191 //机构id小英9675或4
96
+		adminUserInfo.CurrentOrgId = 10278 //机构id小英9675或4
97 97
 		adminUserInfo.CurrentAppId = 18470 //4
98 98
 		adminUserInfo.AdminUser = &userAdmin
99 99
 		adminUserInfo.Subscibes = subscibes
@@ -329,7 +329,7 @@ func (this *BaseServeAPIController) Prepare() {
329 329
 		userAdmin.ModifyTime = 1530786071
330 330
 		var subscibe models.ServeSubscibe
331 331
 		subscibe.ID = 11
332
-		subscibe.OrgId = 10191 //机构id小英9675或4
332
+		subscibe.OrgId = 10278 //机构id小英9675或4
333 333
 		subscibe.PeriodStart = 1538035409
334 334
 		subscibe.PeriodEnd = 1569571409
335 335
 		subscibe.State = 1
@@ -339,7 +339,7 @@ func (this *BaseServeAPIController) Prepare() {
339 339
 		subscibes := make(map[int64]*models.ServeSubscibe, 0)
340 340
 		subscibes[4] = &subscibe
341 341
 		var adminUserInfo service.AdminUserInfo
342
-		adminUserInfo.CurrentOrgId = 10191 //机构id小英9675或4
342
+		adminUserInfo.CurrentOrgId = 10278 //机构id小英9675或4
343 343
 		adminUserInfo.CurrentAppId = 18470 //4
344 344
 		adminUserInfo.AdminUser = &userAdmin
345 345
 		adminUserInfo.Subscibes = subscibes

+ 34 - 0
controllers/mobile_api_controllers/dialysis_api_controller.go 查看文件

@@ -3957,6 +3957,40 @@ func (this *DialysisAPIController) StartDialysis() {
3957 3957
 				ultrafiltration_rate = ultrafiltration_rate / 1000
3958 3958
 			}
3959 3959
 
3960
+			if adminUserInfo.Org.Id == 10721 {
3961
+				if prescription.ModeId == 2 {
3962
+					totalMin := prescription.DialysisDurationHour*60 + prescription.DialysisDurationMinute
3963
+					if totalMin == 0 {
3964
+						totalMin = 240
3965
+					}
3966
+					if prescription.ReplacementTotal == 0 {
3967
+						prescription.ReplacementTotal = 15
3968
+					}
3969
+
3970
+					//乘10 除10是为了保留一位小数
3971
+					replacement_rate = math.Floor(prescription.ReplacementTotal*1000/float64(totalMin)*10) / 10
3972
+				}
3973
+			}
3974
+
3975
+		}
3976
+	}
3977
+
3978
+	if adminUserInfo.Org.Id == 10172 {
3979
+		if prescription.ID == 0 {
3980
+
3981
+			if prescription.ModeId == 2 {
3982
+				totalMin := prescription.DialysisDurationHour*60 + prescription.DialysisDurationMinute
3983
+				if totalMin == 0 {
3984
+					totalMin = 240
3985
+				}
3986
+				if prescription.ReplacementTotal == 0 {
3987
+					prescription.ReplacementTotal = 15
3988
+				}
3989
+
3990
+				//乘10 除10是为了保留一位小数
3991
+				replacement_rate = math.Floor(prescription.ReplacementTotal*1000/float64(totalMin)*10) / 10
3992
+			}
3993
+
3960 3994
 		}
3961 3995
 	}
3962 3996
 

+ 20 - 0
controllers/new_mobile_api_controllers/new_dialysis_api_controller.go 查看文件

@@ -1478,6 +1478,26 @@ func (this *NewDialysisApiController) UpdatedPatient() {
1478 1478
 			PatientType:       patient_type_one,
1479 1479
 		}
1480 1480
 		err = service.UpdatedPatient(patients, patient.BloodId)
1481
+
1482
+		record := models.XtPatientLaspseRecord{
1483
+			PatientId:     patients.ID,
1484
+			RecordDate:    time.Now().Unix(),
1485
+			LapseDate:     time.Now().Unix(),
1486
+			LapseType:     lapseto,
1487
+			LapseClass:    0,
1488
+			LapseReason:   "",
1489
+			AdminUserId:   adminInfo.AdminUser.Id,
1490
+			Remark:        "",
1491
+			UserOrgId:     orgid,
1492
+			Ctime:         time.Now().Unix(),
1493
+			Mtime:         time.Now().Unix(),
1494
+			Status:        1,
1495
+			LapseTypeName: "转入",
1496
+			HisType:       0,
1497
+			HisZone:       "",
1498
+			HisBed:        "",
1499
+		}
1500
+		service.CreatePatientRecord(record)
1481 1501
 		key := strconv.FormatInt(orgid, 10) + ":" + strconv.FormatInt(patient.BloodId, 10) + ":patient_info"
1482 1502
 		redis := service.RedisClient()
1483 1503
 		defer redis.Close()

+ 0 - 3
controllers/schedule_api_controller.go 查看文件

@@ -5501,7 +5501,6 @@ func (c *ScheduleApiController) ChangeScheduleTen() {
5501 5501
 
5502 5502
 			//查询该床位今天是否存在排班
5503 5503
 			sch, _ := service.GetScheduleByBedId(bed_id, schedule_type, adminINfo.CurrentOrgId, schedule.ScheduleDate)
5504
-			fmt.Println("schwowowoowowowowowo", sch.ID, sch.PatientId)
5505 5504
 
5506 5505
 			if sch.ID == 0 {
5507 5506
 				////删除排班
@@ -5579,7 +5578,6 @@ func (c *ScheduleApiController) ChangeScheduleTen() {
5579 5578
 		if bed_id != schedule.BedId {
5580 5579
 			//查询该床位今天是否存在排班
5581 5580
 			sch, _ := service.GetScheduleByBedId(bed_id, schedule_type, adminINfo.CurrentOrgId, schedule.ScheduleDate)
5582
-			fmt.Println("schwowowoowowowowowo", sch.ID, sch.PatientId)
5583 5581
 
5584 5582
 			if sch.ID == 0 {
5585 5583
 				////删除排班
@@ -5624,7 +5622,6 @@ func (c *ScheduleApiController) ChangeScheduleTen() {
5624 5622
 					IsExport:            8888,
5625 5623
 					DialysisMachineName: "",
5626 5624
 				}
5627
-				fmt.Println("idwoowowowowowowoowowowowo", id)
5628 5625
 
5629 5626
 				//赵云的ID
5630 5627
 				// 该床位存在的患者

+ 5 - 1
service/mobile_dialysis_service.go 查看文件

@@ -3318,7 +3318,11 @@ func GetAllHisDoctorAdvice(orgid int64, patientid int64, recorddate int64) (his
3318 3318
 
3319 3319
 	if orgid == 10721 {
3320 3320
 		if len(his_doctor_advice_str) == 0 { //没有到缓存数据,从数据库中获取数据,进行缓存到redis
3321
-			err = readDb.Model(&models.HisDoctorAdviceInfo{}).Where("patient_id = ? AND user_org_id = ? AND status=1 AND record_date = ? and execution_frequency!='上机前' and delivery_way!='口服' ", patientid, orgid, recorddate).Order("created_time asc").Find(&his).Error
3321
+
3322
+			var keyword = "胰岛素"
3323
+
3324
+			keyword = "%" + keyword + "%"
3325
+			err = readDb.Model(&models.HisDoctorAdviceInfo{}).Where("patient_id = ? AND user_org_id = ? AND status=1 AND record_date = ? and execution_frequency!='上机前' and delivery_way!='口服' and advice_name not like ?", patientid, orgid, recorddate, keyword).Order("created_time asc").Find(&his).Error
3322 3326
 			if err != nil {
3323 3327
 				if err == gorm.ErrRecordNotFound {
3324 3328
 					if len(his) <= 0 {

+ 5 - 1
service/patient_service.go 查看文件

@@ -513,8 +513,12 @@ func GetAllHisAdvicesByList(orgID int64, scheduleDate int64) (hisAdvices []VMHis
513 513
 
514 514
 	if orgID == 10721 {
515 515
 
516
+		var keyword = "胰岛素"
517
+
518
+		keyword = "%" + keyword + "%"
519
+
516 520
 		if len(his_advices_all) == 0 { //没有到缓存数据,从数据库中获取数据,进行缓存到redis
517
-			err = readDb.Model(&VMHisDoctorAdviceInfo{}).Where("status = 1 AND user_org_id = ? AND advice_date = ? and execution_frequency !='上机前' and delivery_way!='口服' ", orgID, scheduleDate).Find(&hisAdvices).Error
521
+			err = readDb.Model(&VMHisDoctorAdviceInfo{}).Where("status = 1 AND user_org_id = ? AND advice_date = ? and execution_frequency !='上机前' and delivery_way!='口服' and advice_name not like ? ", orgID, scheduleDate, keyword).Find(&hisAdvices).Error
518 522
 			if err != nil {
519 523
 				if err == gorm.ErrRecordNotFound {
520 524
 					if len(hisAdvices) <= 0 {

+ 1 - 22
service/schedule_service.go 查看文件

@@ -351,27 +351,6 @@ func ModeFyScheduleById(schedule_date int64, bedid int64, scheduletype int64, or
351 351
 	return err
352 352
 }
353 353
 
354
-func ModeScheduleByTime(startime int64, endtime int64, orgid int64) error {
355
-
356
-	schedule := models.XtSchedule{}
357
-
358
-	err := XTWriteDB().Model(&schedule).Where("schedule_date >? and schedule_date<=? and status = 1 and user_org_id = ?", startime, endtime, orgid).Updates(map[string]interface{}{"status": 0}).Error
359
-	return err
360
-}
361
-
362
-func ModeScheduleByTimeOne(startime int64, endtime int64, orgid int64) error {
363
-
364
-	schedule := models.XtSchedule{}
365
-
366
-	err := XTWriteDB().Model(&schedule).Where("schedule_date >=? and schedule_date<=? and status = 1 and user_org_id = ?", startime, endtime, orgid).Updates(map[string]interface{}{"status": 0}).Error
367
-	return err
368
-}
369
-
370
-func UpdateScheduleByOrgId(patientid int64, scheduledate int64, orgid int64, mode_id int64, schedule_type int64, sch *models.XtSchedule) error {
371
-	err := XTWriteDB().Model(&sch).Where("patient_id = ? and schedule_date= ? and user_org_id = ? and status = 1 and mode_id = ? and schedule_type = ?", patientid, scheduledate, orgid, mode_id, schedule_type).Updates(map[string]interface{}{"partition_id": sch.PartitionId, "bed_id": sch.BedId, "schedule_type": sch.ScheduleType, "schedule_week": sch.ScheduleWeek, "mode_id": sch.ModeId, "updated_time": time.Now().Unix()}).Error
372
-	return err
373
-}
374
-
375 354
 func UpdateScheduleByOrgIdOne(patientid int64, scheduledate int64, orgid int64, sch *models.XtSchedule) error {
376 355
 	err := XTWriteDB().Model(&sch).Where("patient_id = ? and schedule_date= ? and user_org_id = ? and status = 1", patientid, scheduledate, orgid).Updates(map[string]interface{}{"partition_id": sch.PartitionId, "bed_id": sch.BedId, "schedule_type": sch.ScheduleType, "schedule_week": sch.ScheduleWeek, "mode_id": sch.ModeId, "updated_time": time.Now().Unix(), "dialysis_machine_name": sch.DialysisMachineName}).Error
377 356
 	return err
@@ -1918,7 +1897,7 @@ func UpdateRepeatSchStatus(user_org_id int64, schedule_date int64) {
1918 1897
 
1919 1898
 	for _, schedule := range schedules {
1920 1899
 		// Update records with status = 0 where id is less than max_id
1921
-		XTReadDB().Model(&models.XtSchedule{}).Where("patient_id = ? AND schedule_date = ? AND id < ?", schedule.PatientId, schedule.ScheduleDate, schedule.MaxId).Update("status", 0)
1900
+		XTReadDB().Model(&models.XtSchedule{}).Where("patient_id = ? AND schedule_date = ? AND id < ?", schedule.PatientId, schedule.ScheduleDate, schedule.MaxId).Update("status", 0, "remark", "去除重复排班")
1922 1901
 
1923 1902
 	}
1924 1903