|
@@ -2402,7 +2402,7 @@ func (c *DialysisAPIController) PostDialysisPrescription() {
|
2402
|
2402
|
err := service.AddSigleRecord(&prescription)
|
2403
|
2403
|
|
2404
|
2404
|
//溪康 更改目标超滤量 同步监测里面的超滤量 超滤率 置换量 置换率
|
2405
|
|
- if adminUserInfo.Org.Id == 10721 || adminUserInfo.Org.Id == 10164 || adminUserInfo.Org.Id == 9478 {
|
|
2405
|
+ if adminUserInfo.Org.Id == 10721 || adminUserInfo.Org.Id == 10164 || adminUserInfo.Org.Id == 9478 || adminUserInfo.Org.Id == 10766 {
|
2406
|
2406
|
|
2407
|
2407
|
monitorList, _ := service.GetMobilePatientMonitor(prescription.PatientId, prescription.RecordDate, prescription.UserOrgId)
|
2408
|
2408
|
|
|
@@ -2423,6 +2423,11 @@ func (c *DialysisAPIController) PostDialysisPrescription() {
|
2423
|
2423
|
replacement_rate = math.Floor(prescription.DisplaceLiquiValue*1000/float64(totalMin)*10) / 10
|
2424
|
2424
|
}
|
2425
|
2425
|
|
|
2426
|
+ if adminUserInfo.Org.Id == 10766 {
|
|
2427
|
+ //乘10 除10是为了保留一位小数
|
|
2428
|
+ replacement_rate = math.Floor(prescription.DisplaceLiquiValue*1000/float64(totalMin)*10) / 10
|
|
2429
|
+ }
|
|
2430
|
+
|
2426
|
2431
|
var firstOpeateTime = monitorList[0].OperateTime
|
2427
|
2432
|
for _, item := range monitorList {
|
2428
|
2433
|
//超滤率
|
|
@@ -2707,7 +2712,7 @@ func (c *DialysisAPIController) PostDialysisPrescription() {
|
2707
|
2712
|
service.UpDateDialysisPrescription(&prescription)
|
2708
|
2713
|
|
2709
|
2714
|
//溪康 更改目标超滤量 同步监测里面的超滤量 超滤率 置换量 置换率
|
2710
|
|
- if adminUserInfo.Org.Id == 10721 || adminUserInfo.Org.Id == 10164 {
|
|
2715
|
+ if adminUserInfo.Org.Id == 10721 || adminUserInfo.Org.Id == 10164 || adminUserInfo.Org.Id == 9478 || adminUserInfo.Org.Id == 10766 {
|
2711
|
2716
|
|
2712
|
2717
|
monitorList, _ := service.GetMobilePatientMonitor(prescription.PatientId, prescription.RecordDate, prescription.UserOrgId)
|
2713
|
2718
|
|
|
@@ -2723,7 +2728,7 @@ func (c *DialysisAPIController) PostDialysisPrescription() {
|
2723
|
2728
|
replacement_rate = math.Floor(prescription.ReplacementTotal*1000/float64(totalMin)*10) / 10
|
2724
|
2729
|
}
|
2725
|
2730
|
|
2726
|
|
- if adminUserInfo.Org.Id == 9478 {
|
|
2731
|
+ if adminUserInfo.Org.Id == 9478 || adminUserInfo.Org.Id == 10766 {
|
2727
|
2732
|
//乘10 除10是为了保留一位小数
|
2728
|
2733
|
replacement_rate = math.Floor(prescription.DisplaceLiquiValue*1000/float64(totalMin)*10) / 10
|
2729
|
2734
|
}
|
|
@@ -3000,6 +3005,11 @@ func (c *DialysisAPIController) Finish() {
|
3000
|
3005
|
tempassessmentAfterDislysis.DiastolicBloodPressure = endmonitorRecords.DiastolicBloodPressure
|
3001
|
3006
|
}
|
3002
|
3007
|
|
|
3008
|
+ if adminUserInfo.Org.Id == 10766 {
|
|
3009
|
+ tempassessmentAfterDislysis.SystolicBloodPressure = endmonitorRecords.SystolicBloodPressure
|
|
3010
|
+ tempassessmentAfterDislysis.DiastolicBloodPressure = endmonitorRecords.DiastolicBloodPressure
|
|
3011
|
+ }
|
|
3012
|
+
|
3003
|
3013
|
if adminUserInfo.Org.Id != 10445 {
|
3004
|
3014
|
tempassessmentAfterDislysis.ActualUltrafiltration = endmonitorRecords.UltrafiltrationVolume
|
3005
|
3015
|
}
|
|
@@ -3069,7 +3079,7 @@ func (c *DialysisAPIController) Finish() {
|
3069
|
3079
|
|
3070
|
3080
|
}
|
3071
|
3081
|
|
3072
|
|
- 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 || adminUserInfo.Org.Id == 10469 || adminUserInfo.Org.Id == 10693 || adminUserInfo.Org.Id == 10702 || adminUserInfo.Org.Id == 10735 || adminUserInfo.Org.Id == 10742 {
|
|
3082
|
+ 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 || adminUserInfo.Org.Id == 10469 || adminUserInfo.Org.Id == 10693 || adminUserInfo.Org.Id == 10702 || adminUserInfo.Org.Id == 10735 || adminUserInfo.Org.Id == 10742 || adminUserInfo.Org.Id == 10766 {
|
3073
|
3083
|
evaluation, _ := service.MobileGetPredialysisEvaluationOne(adminUserInfo.Org.Id, id, recordDate.Unix())
|
3074
|
3084
|
|
3075
|
3085
|
if adminUserInfo.Org.Id != 10702 {
|
|
@@ -3191,6 +3201,10 @@ func (c *DialysisAPIController) Finish() {
|
3191
|
3201
|
tempassessmentAfterDislysis.ActualUltrafiltration = endmonitorRecords.UltrafiltrationVolume
|
3192
|
3202
|
}
|
3193
|
3203
|
|
|
3204
|
+ if endmonitorRecords.ID > 0 && adminUserInfo.Org.Id == 10766 {
|
|
3205
|
+ tempassessmentAfterDislysis.ActualUltrafiltration = endmonitorRecords.UltrafiltrationVolume
|
|
3206
|
+ }
|
|
3207
|
+
|
3194
|
3208
|
if endmonitorRecords.ID > 0 && adminUserInfo.Org.Id == 10617 {
|
3195
|
3209
|
tempassessmentAfterDislysis.ActualUltrafiltration = endmonitorRecords.UltrafiltrationVolume
|
3196
|
3210
|
}
|
|
@@ -3218,6 +3232,13 @@ func (c *DialysisAPIController) Finish() {
|
3218
|
3232
|
tempassessmentAfterDislysis.BreathingRate = endmonitorRecords.BreathingRate
|
3219
|
3233
|
}
|
3220
|
3234
|
|
|
3235
|
+ if endmonitorRecords.ID > 0 && adminUserInfo.Org.Id == 10766 {
|
|
3236
|
+ tempassessmentAfterDislysis.SystolicBloodPressure = endmonitorRecords.SystolicBloodPressure
|
|
3237
|
+ tempassessmentAfterDislysis.DiastolicBloodPressure = endmonitorRecords.DiastolicBloodPressure
|
|
3238
|
+ tempassessmentAfterDislysis.Temperature = endmonitorRecords.Temperature
|
|
3239
|
+ tempassessmentAfterDislysis.BreathingRate = endmonitorRecords.BreathingRate
|
|
3240
|
+ }
|
|
3241
|
+
|
3221
|
3242
|
if endmonitorRecords.ID > 0 && adminUserInfo.Org.Id == 10598 {
|
3222
|
3243
|
tempassessmentAfterDislysis.SystolicBloodPressure = 0
|
3223
|
3244
|
tempassessmentAfterDislysis.DiastolicBloodPressure = 0
|
|
@@ -4293,6 +4314,11 @@ func (this *DialysisAPIController) StartDialysis() {
|
4293
|
4314
|
ultrafiltration_rate = ultrafiltration_rate / 1000
|
4294
|
4315
|
}
|
4295
|
4316
|
|
|
4317
|
+ if adminUserInfo.Org.Id == 10766 {
|
|
4318
|
+ ultrafiltration_rate = math.Floor(prescription.PrescriptionWater * 1000 / float64(totalMin) * 60 * 1000)
|
|
4319
|
+ ultrafiltration_rate = ultrafiltration_rate / 1000
|
|
4320
|
+ }
|
|
4321
|
+
|
4296
|
4322
|
if adminUserInfo.Org.Id == 10757 {
|
4297
|
4323
|
ultrafiltration_rate = math.Floor(prescription.PrescriptionWater * 1000 / float64(totalMin) * 60 * 1000)
|
4298
|
4324
|
ultrafiltration_rate = ultrafiltration_rate / 1000
|
|
@@ -4313,6 +4339,21 @@ func (this *DialysisAPIController) StartDialysis() {
|
4313
|
4339
|
}
|
4314
|
4340
|
}
|
4315
|
4341
|
|
|
4342
|
+ if adminUserInfo.Org.Id == 10766 {
|
|
4343
|
+ if prescription.ModeId == 2 || prescription.ModeId == 13 {
|
|
4344
|
+ totalMin := prescription.DialysisDurationHour*60 + prescription.DialysisDurationMinute
|
|
4345
|
+ if totalMin == 0 {
|
|
4346
|
+ totalMin = 240
|
|
4347
|
+ }
|
|
4348
|
+ if prescription.DisplaceLiquiValue == 0 {
|
|
4349
|
+ prescription.DisplaceLiquiValue = 15
|
|
4350
|
+ }
|
|
4351
|
+
|
|
4352
|
+ //乘10 除10是为了保留一位小数
|
|
4353
|
+ replacement_rate = math.Floor(prescription.DisplaceLiquiValue*1000/float64(totalMin)*10) / 10
|
|
4354
|
+ }
|
|
4355
|
+ }
|
|
4356
|
+
|
4316
|
4357
|
if adminUserInfo.Org.Id == 10752 {
|
4317
|
4358
|
|
4318
|
4359
|
if prescription.ModeId == 2 {
|
|
@@ -4386,7 +4427,7 @@ func (this *DialysisAPIController) StartDialysis() {
|
4386
|
4427
|
}
|
4387
|
4428
|
|
4388
|
4429
|
//只针对广慈医院
|
4389
|
|
- if template.TemplateId == 26 || template.TemplateId == 25 || template.TemplateId == 28 || adminUserInfo.Org.Id == 9987 || adminUserInfo.Org.Id == 9526 || template.TemplateId == 32 || adminUserInfo.Org.Id == 9918 || adminUserInfo.Org.Id == 9671 || adminUserInfo.Org.Id == 3877 || adminUserInfo.Org.Id == 4 || adminUserInfo.Org.Id == 10432 || adminUserInfo.Org.Id == 10445 || adminUserInfo.Org.Id == 10517 || adminUserInfo.Org.Id == 10679 || adminUserInfo.Org.Id == 10742 || adminUserInfo.Org.Id == 10757 {
|
|
4430
|
+ if template.TemplateId == 26 || template.TemplateId == 25 || template.TemplateId == 28 || adminUserInfo.Org.Id == 9987 || adminUserInfo.Org.Id == 9526 || template.TemplateId == 32 || adminUserInfo.Org.Id == 9918 || adminUserInfo.Org.Id == 9671 || adminUserInfo.Org.Id == 3877 || adminUserInfo.Org.Id == 4 || adminUserInfo.Org.Id == 10432 || adminUserInfo.Org.Id == 10445 || adminUserInfo.Org.Id == 10517 || adminUserInfo.Org.Id == 10679 || adminUserInfo.Org.Id == 10742 || adminUserInfo.Org.Id == 10757 || adminUserInfo.Org.Id == 9478 || adminUserInfo.Org.Id == 10766 {
|
4390
|
4431
|
// 查询病人是否有透前评估数据
|
4391
|
4432
|
befor, errcode := service.GetAssessmentBefor(adminUserInfo.Org.Id, patientID, recordDate.Unix())
|
4392
|
4433
|
|
|
@@ -4486,7 +4527,7 @@ func (this *DialysisAPIController) StartDialysis() {
|
4486
|
4527
|
}
|
4487
|
4528
|
|
4488
|
4529
|
//胶州少海医院
|
4489
|
|
- if adminUserInfo.Org.Id == 10735 {
|
|
4530
|
+ if adminUserInfo.Org.Id == 10735 || adminUserInfo.Org.Id == 9478 {
|
4490
|
4531
|
befor, _ := service.GetAssessmentBeforThrity(adminUserInfo.Org.Id, patientID, recordDate.Unix())
|
4491
|
4532
|
dialysisPrescription, _ := service.GetDialysisPrescription(patientID, adminUserInfo.Org.Id, recordDate.Unix())
|
4492
|
4533
|
record.BreathingRate = befor.BreathingRate
|
|
@@ -4934,6 +4975,15 @@ func (c *DialysisAPIController) PostSolution() {
|
4934
|
4975
|
}
|
4935
|
4976
|
}
|
4936
|
4977
|
|
|
4978
|
+ if adminUserInfo.Org.Id == 10766 || adminUserInfo.Org.Id == 9478 {
|
|
4979
|
+ if prescription.ModeId == 2 || prescription.ModeId == 13 {
|
|
4980
|
+ if prescription.ReplacementTotal == 0 {
|
|
4981
|
+ prescription.ReplacementTotal = 15
|
|
4982
|
+ }
|
|
4983
|
+
|
|
4984
|
+ }
|
|
4985
|
+ }
|
|
4986
|
+
|
4937
|
4987
|
_, dialysisPrescription := service.FindDialysisPrescriptionByReordDate(id, recordDate.Unix(), adminUserInfo.Org.Id)
|
4938
|
4988
|
appRole, _ := service.FindAdminRoleTypeById(adminUserInfo.Org.Id, adminUserInfo.AdminUser.Id, adminUserInfo.App.Id)
|
4939
|
4989
|
|
|
@@ -5111,7 +5161,7 @@ func (c *DialysisAPIController) PostSolution() {
|
5111
|
5161
|
|
5112
|
5162
|
service.SavePrescriptionAndCreateSolution(&solution, &prescription)
|
5113
|
5163
|
|
5114
|
|
- if adminUserInfo.Org.Id == 10721 || adminUserInfo.Org.Id == 10164 || adminUserInfo.Org.Id == 9478 {
|
|
5164
|
+ if adminUserInfo.Org.Id == 10721 || adminUserInfo.Org.Id == 10164 || adminUserInfo.Org.Id == 9478 || adminUserInfo.Org.Id == 10766 {
|
5115
|
5165
|
|
5116
|
5166
|
monitorList, _ := service.GetMobilePatientMonitor(prescription.PatientId, prescription.RecordDate, prescription.UserOrgId)
|
5117
|
5167
|
|
|
@@ -5132,6 +5182,11 @@ func (c *DialysisAPIController) PostSolution() {
|
5132
|
5182
|
replacement_rate = math.Floor(prescription.DisplaceLiquiValue*1000/float64(totalMin)*10) / 10
|
5133
|
5183
|
}
|
5134
|
5184
|
|
|
5185
|
+ if adminUserInfo.Org.Id == 10766 {
|
|
5186
|
+ //乘10 除10是为了保留一位小数
|
|
5187
|
+ replacement_rate = math.Floor(prescription.DisplaceLiquiValue*1000/float64(totalMin)*10) / 10
|
|
5188
|
+ }
|
|
5189
|
+
|
5135
|
5190
|
var firstOpeateTime = monitorList[0].OperateTime
|
5136
|
5191
|
for _, item := range monitorList {
|
5137
|
5192
|
//超滤率
|
|
@@ -5146,7 +5201,7 @@ func (c *DialysisAPIController) PostSolution() {
|
5146
|
5201
|
|
5147
|
5202
|
//置换量
|
5148
|
5203
|
displacement_quantity := (math.Floor(float64(item.OperateTime+3600-firstOpeateTime)/3600) * replacement_rate) * 60 / 1000
|
5149
|
|
- fmt.Println("displacement_quantity----------------------", displacement_quantity)
|
|
5204
|
+
|
5150
|
5205
|
service.ModifyPatientDisplacementQuantity(item.ID, displacement_quantity)
|
5151
|
5206
|
|
5152
|
5207
|
}
|
|
@@ -5485,7 +5540,6 @@ func (this *DialysisAPIController) GetLastMonitorRecordTody() {
|
5485
|
5540
|
//重庆塘坝卫生院
|
5486
|
5541
|
if adminInfo.Org.Id == 10742 || adminInfo.Org.Id == 10740 || adminInfo.Org.Id == 10745 || adminInfo.Org.Id == 9478 {
|
5487
|
5542
|
ultrafiltration_rate = math.Floor(prescription.PrescriptionWater / float64(totalMin) * 60 * 1000)
|
5488
|
|
- fmt.Println("ultrafiltration_rate--------------------", ultrafiltration_rate)
|
5489
|
5543
|
record.UltrafiltrationRate = ultrafiltration_rate
|
5490
|
5544
|
}
|
5491
|
5545
|
|
|
@@ -5585,6 +5639,11 @@ func (this *DialysisAPIController) GetLastMonitorRecordTody() {
|
5585
|
5639
|
record.UltrafiltrationRate = ultrafiltration_rate / 1000
|
5586
|
5640
|
}
|
5587
|
5641
|
|
|
5642
|
+ if adminInfo.Org.Id == 10766 {
|
|
5643
|
+ ultrafiltration_rate = math.Floor(prescription.PrescriptionWater * 1000 / float64(totalMin) * 60 * 1000)
|
|
5644
|
+ record.UltrafiltrationRate = ultrafiltration_rate / 1000
|
|
5645
|
+ }
|
|
5646
|
+
|
5588
|
5647
|
if adminInfo.Org.Id == 10757 {
|
5589
|
5648
|
ultrafiltration_rate = math.Floor(prescription.PrescriptionWater * 1000 / float64(totalMin) * 60 * 1000)
|
5590
|
5649
|
record.UltrafiltrationRate = ultrafiltration_rate / 1000
|
|
@@ -5675,7 +5734,7 @@ func (this *DialysisAPIController) GetLastMonitorRecordTody() {
|
5675
|
5734
|
}
|
5676
|
5735
|
|
5677
|
5736
|
//长沙南雅
|
5678
|
|
- if adminInfo.Org.Id == 10395 || adminInfo.Org.Id == 10138 || adminInfo.Org.Id == 10278 || adminInfo.Org.Id == 10432 || adminInfo.Org.Id == 10441 || adminInfo.Org.Id == 10445 || adminInfo.Org.Id == 10469 || adminInfo.Org.Id == 10375 || adminInfo.Org.Id == 10610 || adminInfo.Org.Id == 10537 || adminInfo.Org.Id == 10667 || adminInfo.Org.Id == 9478 {
|
|
5737
|
+ if adminInfo.Org.Id == 10395 || adminInfo.Org.Id == 10138 || adminInfo.Org.Id == 10278 || adminInfo.Org.Id == 10432 || adminInfo.Org.Id == 10441 || adminInfo.Org.Id == 10445 || adminInfo.Org.Id == 10469 || adminInfo.Org.Id == 10375 || adminInfo.Org.Id == 10610 || adminInfo.Org.Id == 10537 || adminInfo.Org.Id == 10667 || adminInfo.Org.Id == 9478 || adminInfo.Org.Id == 10766 {
|
5679
|
5738
|
|
5680
|
5739
|
if ultrafiltration_rate > 0 {
|
5681
|
5740
|
ultrafiltration_volume := math.Floor(float64(record.OperateTime+3600-fristrecord.OperateTime) / 3600 * ultrafiltration_rate)
|
|
@@ -5724,7 +5783,7 @@ func (this *DialysisAPIController) GetLastMonitorRecordTody() {
|
5724
|
5783
|
record.UltrafiltrationVolume = 0
|
5725
|
5784
|
}
|
5726
|
5785
|
|
5727
|
|
- if adminInfo.Org.Id == 10721 || adminInfo.Org.Id == 10164 || adminInfo.Org.Id == 10731 || adminInfo.Org.Id == 10752 || adminInfo.Org.Id == 10757 {
|
|
5786
|
+ if adminInfo.Org.Id == 10721 || adminInfo.Org.Id == 10164 || adminInfo.Org.Id == 10731 || adminInfo.Org.Id == 10752 || adminInfo.Org.Id == 10757 || adminInfo.Org.Id == 10766 {
|
5728
|
5787
|
if ultrafiltration_rate > 0 {
|
5729
|
5788
|
ultrafiltration_volume := math.Floor(float64(record.OperateTime+3600-fristrecord.OperateTime) / 3600 * ultrafiltration_rate)
|
5730
|
5789
|
record.UltrafiltrationVolume = ultrafiltration_volume / 1000
|
|
@@ -5756,7 +5815,7 @@ func (this *DialysisAPIController) GetLastMonitorRecordTody() {
|
5756
|
5815
|
}
|
5757
|
5816
|
}
|
5758
|
5817
|
|
5759
|
|
- if adminInfo.Org.Id == 10721 || adminInfo.Org.Id == 10757 || adminInfo.Org.Id == 9478 || adminInfo.Org.Id == 10290 {
|
|
5818
|
+ if adminInfo.Org.Id == 10721 || adminInfo.Org.Id == 10757 || adminInfo.Org.Id == 10290 {
|
5760
|
5819
|
var replacement_rate float64
|
5761
|
5820
|
var displacement_quantity float64
|
5762
|
5821
|
totalMin := prescription.DialysisDurationHour*60 + prescription.DialysisDurationMinute
|
|
@@ -5768,28 +5827,47 @@ func (this *DialysisAPIController) GetLastMonitorRecordTody() {
|
5768
|
5827
|
|
5769
|
5828
|
}
|
5770
|
5829
|
|
5771
|
|
- if adminInfo.Org.Id == 10752 {
|
|
5830
|
+ if adminInfo.Org.Id == 10766 {
|
5772
|
5831
|
var replacement_rate float64
|
5773
|
5832
|
var displacement_quantity float64
|
5774
|
5833
|
totalMin := prescription.DialysisDurationHour*60 + prescription.DialysisDurationMinute
|
5775
|
5834
|
replacement_rate = math.Floor(prescription.DisplaceLiquiValue*1000/float64(totalMin)*60) / 1000
|
5776
|
5835
|
record.ReplacementRate = replacement_rate
|
5777
|
|
-
|
5778
|
5836
|
displacement_quantity = math.Floor(float64(record.OperateTime+3600-fristrecord.OperateTime)/3600) * replacement_rate
|
5779
|
5837
|
record.DisplacementQuantity = displacement_quantity
|
5780
|
5838
|
|
5781
|
5839
|
}
|
5782
|
5840
|
|
5783
|
|
- if adminInfo.Org.Id == 10740 || adminInfo.Org.Id == 10742 || adminInfo.Org.Id == 10745 || adminInfo.Org.Id == 9478 {
|
|
5841
|
+ if adminInfo.Org.Id == 9478 {
|
|
5842
|
+ var replacement_rate float64
|
|
5843
|
+ var displacement_quantity float64
|
|
5844
|
+ totalMin := prescription.DialysisDurationHour*60 + prescription.DialysisDurationMinute
|
|
5845
|
+ replacement_rate = math.Floor(prescription.DisplaceLiquiValue*1000/float64(totalMin)*60) / 1000
|
|
5846
|
+ record.ReplacementRate = replacement_rate
|
|
5847
|
+ displacement_quantity = math.Floor(float64(record.OperateTime+3600-fristrecord.OperateTime)/3600) * replacement_rate
|
|
5848
|
+ record.DisplacementQuantity = displacement_quantity
|
|
5849
|
+
|
|
5850
|
+ }
|
5784
|
5851
|
|
|
5852
|
+ if adminInfo.Org.Id == 10752 {
|
5785
|
5853
|
var replacement_rate float64
|
5786
|
5854
|
var displacement_quantity float64
|
5787
|
5855
|
totalMin := prescription.DialysisDurationHour*60 + prescription.DialysisDurationMinute
|
5788
|
5856
|
replacement_rate = math.Floor(prescription.DisplaceLiquiValue*1000/float64(totalMin)*60) / 1000
|
5789
|
5857
|
|
5790
|
5858
|
record.ReplacementRate = replacement_rate
|
|
5859
|
+ displacement_quantity = math.Floor(float64(record.OperateTime+3600-fristrecord.OperateTime)/3600) * replacement_rate
|
|
5860
|
+ record.DisplacementQuantity = displacement_quantity
|
5791
|
5861
|
|
5792
|
|
- fmt.Println(math.Floor(float64(record.OperateTime+3600-fristrecord.OperateTime) / 3600))
|
|
5862
|
+ }
|
|
5863
|
+
|
|
5864
|
+ if adminInfo.Org.Id == 10740 || adminInfo.Org.Id == 10742 || adminInfo.Org.Id == 10745 || adminInfo.Org.Id == 9478 || adminInfo.Org.Id == 10766 {
|
|
5865
|
+
|
|
5866
|
+ var replacement_rate float64
|
|
5867
|
+ var displacement_quantity float64
|
|
5868
|
+ totalMin := prescription.DialysisDurationHour*60 + prescription.DialysisDurationMinute
|
|
5869
|
+ replacement_rate = math.Floor(prescription.DisplaceLiquiValue*1000/float64(totalMin)*60) / 1000
|
|
5870
|
+ record.ReplacementRate = replacement_rate
|
5793
|
5871
|
displacement_quantity = math.Floor(float64(record.OperateTime+3600-fristrecord.OperateTime)/3600) * replacement_rate
|
5794
|
5872
|
record.DisplacementQuantity = displacement_quantity
|
5795
|
5873
|
}
|
|
@@ -5827,9 +5905,12 @@ func (this *DialysisAPIController) GetLastMonitorRecordTody() {
|
5827
|
5905
|
|
5828
|
5906
|
lastMonitorRecordList, _ := service.GetLastMonitorRecordList(patientID, monitorDate, adminInfo.Org.Id)
|
5829
|
5907
|
|
|
5908
|
+ fisrtMonitorRecordList, _ := service.GetFisrtMonitorRecordList(patientID, monitorDate, adminInfo.Org.Id)
|
|
5909
|
+
|
5830
|
5910
|
this.ServeSuccessJSON(map[string]interface{}{
|
5831
|
|
- "monitor": record,
|
5832
|
|
- "lastMonitorRecordList": lastMonitorRecordList,
|
|
5911
|
+ "monitor": record,
|
|
5912
|
+ "lastMonitorRecordList": lastMonitorRecordList,
|
|
5913
|
+ "fisrtMonitorRecordList": fisrtMonitorRecordList,
|
5833
|
5914
|
})
|
5834
|
5915
|
|
5835
|
5916
|
}
|
|
@@ -6030,6 +6111,14 @@ func (this *DialysisAPIController) ModifyStartDialysisOrder() {
|
6030
|
6111
|
DialysisStrainer: dialysis_strainer,
|
6031
|
6112
|
}
|
6032
|
6113
|
|
|
6114
|
+ _, prescription := service.FindDialysisPrescriptionByReordDate(patient_id, record_date, adminUserInfo.Org.Id)
|
|
6115
|
+
|
|
6116
|
+ if prescription.ID > 0 {
|
|
6117
|
+ var endTime int64
|
|
6118
|
+ endTime = dialysisRecord.StartTime + prescription.DialysisDurationHour*3600 + prescription.DialysisDurationMinute*60
|
|
6119
|
+ dialysisRecord.EndTime = endTime
|
|
6120
|
+ }
|
|
6121
|
+
|
6033
|
6122
|
//修改床位号需要重新消毒
|
6034
|
6123
|
if adminUserInfo.Org.Id == 9671 || adminUserInfo.Org.Id == 10340 || adminUserInfo.Org.Id == 10445 || adminUserInfo.Org.Id == 3877 {
|
6035
|
6124
|
service.UpdateDeviceInformation(tempDialysisRecord.PatientId, tempDialysisRecord.DialysisDate)
|
|
@@ -13012,3 +13101,206 @@ func (c *DialysisAPIController) StopLongAdvice() {
|
13012
|
13101
|
"advice": advice,
|
13013
|
13102
|
})
|
13014
|
13103
|
}
|
|
13104
|
+
|
|
13105
|
+func (c *DialysisAPIController) BatchAdviceCheckList() {
|
|
13106
|
+
|
|
13107
|
+ dataBody := make(map[string]interface{}, 0)
|
|
13108
|
+ err := json.Unmarshal(c.Ctx.Input.RequestBody, &dataBody)
|
|
13109
|
+ if err != nil {
|
|
13110
|
+ utils.ErrorLog(err.Error())
|
|
13111
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
13112
|
+ return
|
|
13113
|
+ }
|
|
13114
|
+ orgId := c.GetMobileAdminUserInfo().Org.Id
|
|
13115
|
+ patient_id := int64(dataBody["patient_id"].(float64))
|
|
13116
|
+ record_date := int64(dataBody["record_date"].(float64))
|
|
13117
|
+
|
|
13118
|
+ checker := int64(dataBody["checker"].(float64))
|
|
13119
|
+
|
|
13120
|
+ check_time := dataBody["check_time"].(string)
|
|
13121
|
+
|
|
13122
|
+ checkTime, parseStartDateErr := utils.ParseTimeStringToTime("2006-01-02 15:04:05", check_time)
|
|
13123
|
+ if parseStartDateErr != nil {
|
|
13124
|
+ c.ErrorLog("时间解析失败:%v", parseStartDateErr)
|
|
13125
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
13126
|
+ return
|
|
13127
|
+ }
|
|
13128
|
+ var advice_id []int64
|
|
13129
|
+ var his_advice_id []int64
|
|
13130
|
+ var project_id []int64
|
|
13131
|
+ var team_list []int64
|
|
13132
|
+ if dataBody["new_advice_list"] != nil && reflect.TypeOf(dataBody["new_advice_list"]).String() == "[]interface {}" {
|
|
13133
|
+ newAdviceList, _ := dataBody["new_advice_list"].([]interface{})
|
|
13134
|
+ if len(newAdviceList) > 0 {
|
|
13135
|
+ for _, item := range newAdviceList {
|
|
13136
|
+ items := item.(map[string]interface{})
|
|
13137
|
+ if items["id"] == nil || reflect.TypeOf(items["id"]).String() != "float64" {
|
|
13138
|
+ utils.ErrorLog("id")
|
|
13139
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
13140
|
+ return
|
|
13141
|
+ }
|
|
13142
|
+ id := int64(items["id"].(float64))
|
|
13143
|
+
|
|
13144
|
+ if items["origin"] == nil || reflect.TypeOf(items["origin"]).String() != "float64" {
|
|
13145
|
+ utils.ErrorLog("origin")
|
|
13146
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
13147
|
+ return
|
|
13148
|
+ }
|
|
13149
|
+ origin := int64(items["origin"].(float64))
|
|
13150
|
+
|
|
13151
|
+ if items["team_id"] == nil || reflect.TypeOf(items["team_id"]).String() != "float64" {
|
|
13152
|
+ utils.ErrorLog("team_id")
|
|
13153
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
13154
|
+ return
|
|
13155
|
+ }
|
|
13156
|
+ team_id := int64(items["team_id"].(float64))
|
|
13157
|
+
|
|
13158
|
+ if team_id == 0 {
|
|
13159
|
+
|
|
13160
|
+ //临时医嘱
|
|
13161
|
+ if origin == 1 {
|
|
13162
|
+ service.BatchAdviceDoctorList(patient_id, record_date, id, orgId, checker, checkTime.Unix())
|
|
13163
|
+ advice_id = append(advice_id, id)
|
|
13164
|
+ }
|
|
13165
|
+
|
|
13166
|
+ //his医嘱
|
|
13167
|
+ if origin == 2 {
|
|
13168
|
+ service.BatchHisAdviceDoctorList(patient_id, record_date, id, orgId, checker, checkTime.Unix())
|
|
13169
|
+ his_advice_id = append(his_advice_id, id)
|
|
13170
|
+ }
|
|
13171
|
+
|
|
13172
|
+ //his医嘱
|
|
13173
|
+ if origin == 3 {
|
|
13174
|
+ service.BatchHisPrescriptionProject(patient_id, record_date, id, orgId, checker, checkTime.Unix())
|
|
13175
|
+ project_id = append(project_id, id)
|
|
13176
|
+ }
|
|
13177
|
+ }
|
|
13178
|
+
|
|
13179
|
+ if team_id > 0 {
|
|
13180
|
+
|
|
13181
|
+ service.BatchCheckPrescriptionProject(patient_id, record_date, team_id, orgId, checker, checkTime.Unix())
|
|
13182
|
+ team_list = append(team_list, team_id)
|
|
13183
|
+ }
|
|
13184
|
+
|
|
13185
|
+ }
|
|
13186
|
+ }
|
|
13187
|
+ }
|
|
13188
|
+
|
|
13189
|
+ advice, _ := service.GetBatchAdviceList(advice_id)
|
|
13190
|
+
|
|
13191
|
+ hisadvice, _ := service.GetBatchHisAdviceList(his_advice_id)
|
|
13192
|
+
|
|
13193
|
+ hisproject, _ := service.GetBatchPrescriptionList(project_id)
|
|
13194
|
+
|
|
13195
|
+ teamlist, _ := service.GetBatchTeamList(team_list, patient_id, record_date, orgId)
|
|
13196
|
+
|
|
13197
|
+ c.ServeSuccessJSON(map[string]interface{}{
|
|
13198
|
+ "advice": advice,
|
|
13199
|
+ "hisadvice": hisadvice,
|
|
13200
|
+ "hisproject": hisproject,
|
|
13201
|
+ "teamlist": teamlist,
|
|
13202
|
+ })
|
|
13203
|
+
|
|
13204
|
+ return
|
|
13205
|
+
|
|
13206
|
+}
|
|
13207
|
+
|
|
13208
|
+func (c *DialysisAPIController) BatchAdviceExeCutionList() {
|
|
13209
|
+
|
|
13210
|
+ dataBody := make(map[string]interface{}, 0)
|
|
13211
|
+ err := json.Unmarshal(c.Ctx.Input.RequestBody, &dataBody)
|
|
13212
|
+ if err != nil {
|
|
13213
|
+ utils.ErrorLog(err.Error())
|
|
13214
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
13215
|
+ return
|
|
13216
|
+ }
|
|
13217
|
+ orgId := c.GetMobileAdminUserInfo().Org.Id
|
|
13218
|
+ patient_id := int64(dataBody["patient_id"].(float64))
|
|
13219
|
+ record_date := int64(dataBody["record_date"].(float64))
|
|
13220
|
+
|
|
13221
|
+ execution_staff := int64(dataBody["execution_staff"].(float64))
|
|
13222
|
+
|
|
13223
|
+ execution_time := dataBody["execution_time"].(string)
|
|
13224
|
+
|
|
13225
|
+ executionTime, parseStartDateErr := utils.ParseTimeStringToTime("2006-01-02 15:04:05", execution_time)
|
|
13226
|
+ if parseStartDateErr != nil {
|
|
13227
|
+ c.ErrorLog("时间解析失败:%v", parseStartDateErr)
|
|
13228
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
13229
|
+ return
|
|
13230
|
+ }
|
|
13231
|
+ var advice_id []int64
|
|
13232
|
+ var his_advice_id []int64
|
|
13233
|
+ var project_id []int64
|
|
13234
|
+ var team_list []int64
|
|
13235
|
+ if dataBody["new_advice_list"] != nil && reflect.TypeOf(dataBody["new_advice_list"]).String() == "[]interface {}" {
|
|
13236
|
+ newAdviceList, _ := dataBody["new_advice_list"].([]interface{})
|
|
13237
|
+ if len(newAdviceList) > 0 {
|
|
13238
|
+ for _, item := range newAdviceList {
|
|
13239
|
+ items := item.(map[string]interface{})
|
|
13240
|
+ if items["id"] == nil || reflect.TypeOf(items["id"]).String() != "float64" {
|
|
13241
|
+ utils.ErrorLog("id")
|
|
13242
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
13243
|
+ return
|
|
13244
|
+ }
|
|
13245
|
+ id := int64(items["id"].(float64))
|
|
13246
|
+
|
|
13247
|
+ if items["origin"] == nil || reflect.TypeOf(items["origin"]).String() != "float64" {
|
|
13248
|
+ utils.ErrorLog("origin")
|
|
13249
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
13250
|
+ return
|
|
13251
|
+ }
|
|
13252
|
+ origin := int64(items["origin"].(float64))
|
|
13253
|
+
|
|
13254
|
+ if items["team_id"] == nil || reflect.TypeOf(items["team_id"]).String() != "float64" {
|
|
13255
|
+ utils.ErrorLog("team_id")
|
|
13256
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
|
13257
|
+ return
|
|
13258
|
+ }
|
|
13259
|
+ team_id := int64(items["team_id"].(float64))
|
|
13260
|
+
|
|
13261
|
+ if team_id == 0 {
|
|
13262
|
+ //临时医嘱
|
|
13263
|
+ if origin == 1 {
|
|
13264
|
+ service.BatchExecutionAdviceDoctorList(patient_id, record_date, id, orgId, execution_staff, executionTime.Unix())
|
|
13265
|
+ advice_id = append(advice_id, id)
|
|
13266
|
+ }
|
|
13267
|
+
|
|
13268
|
+ //his医嘱
|
|
13269
|
+ if origin == 2 {
|
|
13270
|
+ service.BatchExecutionHisAdviceDoctorList(patient_id, record_date, id, orgId, execution_staff, executionTime.Unix())
|
|
13271
|
+ his_advice_id = append(his_advice_id, id)
|
|
13272
|
+ }
|
|
13273
|
+
|
|
13274
|
+ //his医嘱
|
|
13275
|
+ if origin == 3 {
|
|
13276
|
+ service.BatchExecutionHisPrescriptionProject(patient_id, record_date, id, orgId, execution_staff, executionTime.Unix())
|
|
13277
|
+ project_id = append(project_id, id)
|
|
13278
|
+ }
|
|
13279
|
+
|
|
13280
|
+ }
|
|
13281
|
+
|
|
13282
|
+ if team_id > 0 {
|
|
13283
|
+ service.BatchExecutionPrescriptionProject(patient_id, record_date, team_id, orgId, execution_staff, executionTime.Unix())
|
|
13284
|
+ team_list = append(team_list, team_id)
|
|
13285
|
+ }
|
|
13286
|
+
|
|
13287
|
+ }
|
|
13288
|
+ }
|
|
13289
|
+ }
|
|
13290
|
+
|
|
13291
|
+ advice, _ := service.GetBatchAdviceList(advice_id)
|
|
13292
|
+
|
|
13293
|
+ hisadvice, _ := service.GetBatchHisAdviceList(his_advice_id)
|
|
13294
|
+
|
|
13295
|
+ hisproject, _ := service.GetBatchPrescriptionList(project_id)
|
|
13296
|
+
|
|
13297
|
+ teamlist, _ := service.GetBatchTeamList(team_list, patient_id, record_date, orgId)
|
|
13298
|
+
|
|
13299
|
+ c.ServeSuccessJSON(map[string]interface{}{
|
|
13300
|
+ "advice": advice,
|
|
13301
|
+ "hisadvice": hisadvice,
|
|
13302
|
+ "hisproject": hisproject,
|
|
13303
|
+ "teamlist": teamlist,
|
|
13304
|
+ })
|
|
13305
|
+ return
|
|
13306
|
+}
|