|
@@ -841,6 +841,8 @@ func (c *DialysisAPIController) PostDoubleCheck() {
|
841
|
841
|
|
842
|
842
|
//针对长沙南雅
|
843
|
843
|
if adminUserInfo.Org.Id == 9671 || adminUserInfo.Org.Id == 10340 || adminUserInfo.Org.Id == 3877 {
|
|
844
|
+ fmt.Println("-----------------------", adminUserInfo.Org.Id)
|
|
845
|
+ fmt.Println("modifier----------------", modifier)
|
844
|
846
|
//查询未核对的医嘱
|
845
|
847
|
doctorList, _ := service.GetDoctorAdviceCheckList(id, recordDate.Unix(), adminUserInfo.Org.Id)
|
846
|
848
|
if len(doctorList) > 0 && modifier > 0 {
|
|
@@ -883,6 +885,29 @@ func (c *DialysisAPIController) PostDoubleCheck() {
|
883
|
885
|
doubleCheck.ID = check.ID
|
884
|
886
|
doubleCheck.EmployeeNumber = employee_number
|
885
|
887
|
err := service.UpdateDoubleCheck(&doubleCheck)
|
|
888
|
+ //针对长沙南雅
|
|
889
|
+ if adminUserInfo.Org.Id == 9671 || adminUserInfo.Org.Id == 10340 || adminUserInfo.Org.Id == 3877 {
|
|
890
|
+ //查询未核对的医嘱
|
|
891
|
+ doctorList, _ := service.GetDoctorAdviceCheckList(id, recordDate.Unix(), adminUserInfo.Org.Id)
|
|
892
|
+ if len(doctorList) > 0 && modifier > 0 {
|
|
893
|
+ for _, advice := range doctorList {
|
|
894
|
+ service.UpdateDoctorAdviceList(advice.ID, modifier)
|
|
895
|
+ key := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(advice.PatientId, 10) + ":" + strconv.FormatInt(advice.AdviceDate, 10) + ":doctor_advices"
|
|
896
|
+ redis := service.RedisClient()
|
|
897
|
+ //清空key 值
|
|
898
|
+ redis.Set(key, "", time.Second)
|
|
899
|
+ keyTwo := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(advice.AdviceDate, 10) + ":advice_list_all"
|
|
900
|
+ redis.Set(keyTwo, "", time.Second)
|
|
901
|
+ theTime := time.Now()
|
|
902
|
+ recordDate := theTime.Format("2006-01-02")
|
|
903
|
+ keyFour := "scheduals_" + recordDate + "_" + strconv.FormatInt(adminUserInfo.Org.Id, 10)
|
|
904
|
+ redis.Set(keyFour, "", time.Second)
|
|
905
|
+ defer redis.Close()
|
|
906
|
+ }
|
|
907
|
+ }
|
|
908
|
+
|
|
909
|
+ }
|
|
910
|
+
|
886
|
911
|
key := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(id, 10) + ":" + strconv.FormatInt(recordDate.Unix(), 10) + ":double_check"
|
887
|
912
|
redis := service.RedisClient()
|
888
|
913
|
defer redis.Close()
|
|
@@ -1658,6 +1683,9 @@ func (c *DialysisAPIController) PostDialysisPrescription() {
|
1658
|
1683
|
//长沙南雅医院,自动生成抗凝剂的临时处方
|
1659
|
1684
|
if adminUserInfo.Org.Id == 3877 || adminUserInfo.Org.Id == 9671 || adminUserInfo.Org.Id == 10340 {
|
1660
|
1685
|
|
|
1686
|
+ if prescribing_number == 0 {
|
|
1687
|
+ prescribing_number = 1
|
|
1688
|
+ }
|
1661
|
1689
|
advice := models.DoctorAdvice{
|
1662
|
1690
|
UserOrgId: adminUserInfo.Org.Id,
|
1663
|
1691
|
PatientId: id,
|
|
@@ -1665,8 +1693,8 @@ func (c *DialysisAPIController) PostDialysisPrescription() {
|
1665
|
1693
|
AdviceType: 2,
|
1666
|
1694
|
RecordDate: recordDate.Unix(),
|
1667
|
1695
|
AdviceDate: recordDate.Unix(),
|
1668
|
|
- StartTime: recordDate.Unix() + 7*60*60, // 根据排班班次,给默认时间
|
1669
|
|
- AdviceName: "", // 根据抗凝剂转换为中文 + 首剂 + 维持 + 总量
|
|
1696
|
+ StartTime: recordDate.Unix() + 6.5*60*60, // 根据排班班次,给默认时间
|
|
1697
|
+ AdviceName: "", // 根据抗凝剂转换为中文 + 首剂 + 维持 + 总量
|
1670
|
1698
|
AdviceDesc: "",
|
1671
|
1699
|
ReminderDate: 0,
|
1672
|
1700
|
SingleDose: 5000,
|
|
@@ -1682,12 +1710,15 @@ func (c *DialysisAPIController) PostDialysisPrescription() {
|
1682
|
1710
|
CreatedTime: time.Now().Unix(),
|
1683
|
1711
|
UpdatedTime: time.Now().Unix(),
|
1684
|
1712
|
IsPrescription: 1,
|
|
1713
|
+ ExecutionState: 2,
|
|
1714
|
+ StopState: 2,
|
|
1715
|
+ IsSettle: 2,
|
1685
|
1716
|
}
|
1686
|
1717
|
// 查询排班信息
|
1687
|
1718
|
schedulePatient, _ := service.GetScheduleByPatient(id, recordDate.Unix(), adminUserInfo.Org.Id)
|
1688
|
1719
|
if schedulePatient.ID > 0 {
|
1689
|
1720
|
if schedulePatient.ScheduleType == 1 {
|
1690
|
|
- advice.StartTime = recordDate.Unix() + 7*60*60
|
|
1721
|
+ advice.StartTime = recordDate.Unix() + 6.5*60*60
|
1691
|
1722
|
}
|
1692
|
1723
|
|
1693
|
1724
|
if schedulePatient.ScheduleType == 2 {
|
|
@@ -1735,7 +1766,7 @@ func (c *DialysisAPIController) PostDialysisPrescription() {
|
1735
|
1766
|
}
|
1736
|
1767
|
//advice.AdviceDesc = "首剂" + strconv.FormatFloat(anticoagulant_shouji, 'f', -1, 64) + "维持" + strconv.FormatFloat(anticoagulant_weichi, 'f', -1, 64) + "总量" + strconv.FormatFloat(anticoagulant_zongliang, 'f', -1, 64)
|
1737
|
1768
|
|
1738
|
|
- if appRole.UserType == 2 || appRole.UserType == 1 || appRole.UserType == 4 {
|
|
1769
|
+ if appRole.UserType == 2 || appRole.UserType == 1 || appRole.UserType == 3 || appRole.UserType == 4 {
|
1739
|
1770
|
advice.AdviceDoctor = appRole.AdminUserId
|
1740
|
1771
|
}
|
1741
|
1772
|
|
|
@@ -2062,7 +2093,7 @@ func (c *DialysisAPIController) Finish() {
|
2062
|
2093
|
|
2063
|
2094
|
}
|
2064
|
2095
|
|
2065
|
|
- if adminUserInfo.Org.Id == 10101 || adminUserInfo.Org.Id == 9671 || adminUserInfo.Org.Id == 3877 || adminUserInfo.Org.Id == 9675 || adminUserInfo.Org.Id == 10215 || adminUserInfo.Org.Id == 10233 || adminUserInfo.Org.Id == 10223 || adminUserInfo.Org.Id == 10243 || adminUserInfo.Org.Id == 10340 || adminUserInfo.Org.Id == 10414 || adminUserInfo.Org.Id == 10430 || adminUserInfo.Org.Id == 10432 || adminUserInfo.Org.Id == 10445 || adminUserInfo.Org.Id == 10223 || adminUserInfo.Org.Id == 9829 || adminUserInfo.Org.Id == 10432 {
|
|
2096
|
+ if adminUserInfo.Org.Id == 10101 || adminUserInfo.Org.Id == 9671 || adminUserInfo.Org.Id == 3877 || adminUserInfo.Org.Id == 9675 || adminUserInfo.Org.Id == 10215 || adminUserInfo.Org.Id == 10233 || adminUserInfo.Org.Id == 10223 || adminUserInfo.Org.Id == 10243 || adminUserInfo.Org.Id == 10340 || adminUserInfo.Org.Id == 10414 || adminUserInfo.Org.Id == 10430 || adminUserInfo.Org.Id == 10432 || adminUserInfo.Org.Id == 10445 || adminUserInfo.Org.Id == 10223 || adminUserInfo.Org.Id == 9829 || adminUserInfo.Org.Id == 10432 || adminUserInfo.Org.Id == 10440 {
|
2066
|
2097
|
evaluation, _ := service.MobileGetPredialysisEvaluationOne(adminUserInfo.Org.Id, id, recordDate.Unix())
|
2067
|
2098
|
if evaluation.SystolicBloodPressure == 0 {
|
2068
|
2099
|
evaluation.SystolicBloodPressure = fmonitorRecords.SystolicBloodPressure
|
|
@@ -2719,7 +2750,7 @@ func (this *DialysisAPIController) StartDialysis() {
|
2719
|
2750
|
|
2720
|
2751
|
//针对肇庆三鹤血液透析中心
|
2721
|
2752
|
|
2722
|
|
- if template.TemplateId == 43 || adminUserInfo.Org.Id == 10432 || adminUserInfo.Org.Id == 10441 || adminUserInfo.Org.Id == 10445 {
|
|
2753
|
+ if template.TemplateId == 43 || adminUserInfo.Org.Id == 10432 || adminUserInfo.Org.Id == 10441 || adminUserInfo.Org.Id == 10445 || adminUserInfo.Org.Id == 10440 {
|
2723
|
2754
|
ultrafiltration_rate = math.Floor(prescription.TargetUltrafiltration * 60 / float64(totalMin))
|
2724
|
2755
|
}
|
2725
|
2756
|
|
|
@@ -3233,6 +3264,9 @@ func (c *DialysisAPIController) PostSolution() {
|
3233
|
3264
|
|
3234
|
3265
|
//长沙南雅医院,自动生成抗凝剂的临时处方
|
3235
|
3266
|
if adminUserInfo.Org.Id == 3877 || adminUserInfo.Org.Id == 9671 || adminUserInfo.Org.Id == 10340 {
|
|
3267
|
+ if prescribing_number == 0 {
|
|
3268
|
+ prescribing_number = 1
|
|
3269
|
+ }
|
3236
|
3270
|
advice := models.DoctorAdvice{
|
3237
|
3271
|
UserOrgId: adminUserInfo.Org.Id,
|
3238
|
3272
|
PatientId: id,
|
|
@@ -3240,8 +3274,8 @@ func (c *DialysisAPIController) PostSolution() {
|
3240
|
3274
|
AdviceType: 2,
|
3241
|
3275
|
RecordDate: recordDate.Unix(),
|
3242
|
3276
|
AdviceDate: recordDate.Unix(),
|
3243
|
|
- StartTime: recordDate.Unix() + 7*60*60, // 根据排班班次,给默认时间
|
3244
|
|
- AdviceName: "", // 根据抗凝剂转换为中文 + 首剂 + 维持 + 总量
|
|
3277
|
+ StartTime: recordDate.Unix() + 6.5*60*60, // 根据排班班次,给默认时间
|
|
3278
|
+ AdviceName: "", // 根据抗凝剂转换为中文 + 首剂 + 维持 + 总量
|
3245
|
3279
|
AdviceDesc: "",
|
3246
|
3280
|
ReminderDate: 0,
|
3247
|
3281
|
SingleDose: 5000,
|
|
@@ -3257,12 +3291,15 @@ func (c *DialysisAPIController) PostSolution() {
|
3257
|
3291
|
CreatedTime: time.Now().Unix(),
|
3258
|
3292
|
UpdatedTime: time.Now().Unix(),
|
3259
|
3293
|
IsPrescription: 1,
|
|
3294
|
+ ExecutionState: 2,
|
|
3295
|
+ StopState: 2,
|
|
3296
|
+ IsSettle: 2,
|
3260
|
3297
|
}
|
3261
|
3298
|
// 查询排班信息
|
3262
|
3299
|
schedulePatient, _ := service.GetScheduleByPatient(id, recordDate.Unix(), adminUserInfo.Org.Id)
|
3263
|
3300
|
if schedulePatient.ID > 0 {
|
3264
|
3301
|
if schedulePatient.ScheduleType == 1 {
|
3265
|
|
- advice.StartTime = recordDate.Unix() + 7*60*60
|
|
3302
|
+ advice.StartTime = recordDate.Unix() + 6.5*60*60
|
3266
|
3303
|
}
|
3267
|
3304
|
|
3268
|
3305
|
if schedulePatient.ScheduleType == 2 {
|
|
@@ -3309,7 +3346,7 @@ func (c *DialysisAPIController) PostSolution() {
|
3309
|
3346
|
break
|
3310
|
3347
|
}
|
3311
|
3348
|
//advice.AdviceDesc = "首剂" + strconv.FormatFloat(anticoagulant_shouji, 'f', -1, 64) + "维持" + strconv.FormatFloat(anticoagulant_weichi, 'f', -1, 64) + "总量" + strconv.FormatFloat(anticoagulant_zongliang, 'f', -1, 64)
|
3312
|
|
- if appRole.UserType == 2 || appRole.UserType == 1 || appRole.UserType == 4 {
|
|
3349
|
+ if appRole.UserType == 2 || appRole.UserType == 1 || appRole.UserType == 3 || appRole.UserType == 4 {
|
3313
|
3350
|
advice.AdviceDoctor = appRole.AdminUserId
|
3314
|
3351
|
}
|
3315
|
3352
|
|
|
@@ -3547,7 +3584,7 @@ func (this *DialysisAPIController) GetLastMonitorRecordTody() {
|
3547
|
3584
|
record.UltrafiltrationRate = ultrafiltration_rate
|
3548
|
3585
|
}
|
3549
|
3586
|
|
3550
|
|
- if adminInfo.Org.Id == 10395 || adminInfo.Org.Id == 10138 || adminInfo.Org.Id == 10278 || adminInfo.Org.Id == 10340 || adminInfo.Org.Id == 10432 || adminInfo.Org.Id == 10441 || adminInfo.Org.Id == 10445 || adminInfo.Org.Id == 9829 {
|
|
3587
|
+ if adminInfo.Org.Id == 10395 || adminInfo.Org.Id == 10138 || adminInfo.Org.Id == 10278 || adminInfo.Org.Id == 10340 || adminInfo.Org.Id == 10432 || adminInfo.Org.Id == 10441 || adminInfo.Org.Id == 10445 || adminInfo.Org.Id == 9829 || adminInfo.Org.Id == 10440 {
|
3551
|
3588
|
ultrafiltration_rate = math.Floor(prescription.TargetUltrafiltration * 60 / 1000 / float64(totalMin) * 1000)
|
3552
|
3589
|
record.UltrafiltrationRate = ultrafiltration_rate
|
3553
|
3590
|
}
|
|
@@ -3792,8 +3829,22 @@ func (this *DialysisAPIController) ModifyStartDialysisOrder() {
|
3792
|
3829
|
}
|
3793
|
3830
|
|
3794
|
3831
|
//修改床位号需要重新消毒
|
3795
|
|
- if adminUserInfo.Org.Id == 9671 || adminUserInfo.Org.Id == 10340 || adminUserInfo.Org.Id == 10445 {
|
|
3832
|
+ if adminUserInfo.Org.Id == 9671 || adminUserInfo.Org.Id == 10340 || adminUserInfo.Org.Id == 10445 || adminUserInfo.Org.Id == 3877 {
|
3796
|
3833
|
service.UpdateDeviceInformation(tempDialysisRecord.PatientId, tempDialysisRecord.DialysisDate)
|
|
3834
|
+
|
|
3835
|
+ //查询第一条监测
|
|
3836
|
+ firstMonitor, _ := service.GetFirstMonitor(tempDialysisRecord.PatientId, tempDialysisRecord.DialysisDate)
|
|
3837
|
+
|
|
3838
|
+ service.UpdateFirstMonitor(firstMonitor.ID, catheter_operation)
|
|
3839
|
+
|
|
3840
|
+ key := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(tempDialysisRecord.PatientId, 10) + ":" + strconv.FormatInt(tempDialysisRecord.DialysisDate, 10) + ":monitor_records"
|
|
3841
|
+ redis := service.RedisClient()
|
|
3842
|
+ //清空key 值
|
|
3843
|
+ redis.Set(key, "", time.Second)
|
|
3844
|
+ keyOne := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(tempDialysisRecord.DialysisDate, 10) + ":monitor_record_list_all"
|
|
3845
|
+ redis.Set(keyOne, "", time.Second)
|
|
3846
|
+ defer redis.Close()
|
|
3847
|
+
|
3797
|
3848
|
}
|
3798
|
3849
|
|
3799
|
3850
|
updateErr := service.ModifyStartDialysisOrder(dialysisRecord)
|