|
@@ -711,6 +711,41 @@ func (c *DialysisApiController) PostPrescription() {
|
711
|
711
|
|
712
|
712
|
err := service.AddSigleRecord(&prescription)
|
713
|
713
|
|
|
714
|
+ if adminUserInfo.CurrentOrgId == 10721 || adminUserInfo.CurrentOrgId == 10164 {
|
|
715
|
+
|
|
716
|
+ monitorList, _ := service.GetMobilePatientMonitor(prescription.PatientId, prescription.RecordDate, prescription.UserOrgId)
|
|
717
|
+
|
|
718
|
+ if len(monitorList) > 0 {
|
|
719
|
+ var ultrafiltration_rate float64
|
|
720
|
+ totalMin := prescription.DialysisDurationHour*60 + prescription.DialysisDurationMinute
|
|
721
|
+
|
|
722
|
+ ultrafiltration_rate = (math.Floor(prescription.PrescriptionWater * 1000 / float64(totalMin) * 60 * 1000)) / 1000
|
|
723
|
+ var replacement_rate float64
|
|
724
|
+
|
|
725
|
+ //乘10 除10是为了保留一位小数
|
|
726
|
+ replacement_rate = math.Floor(prescription.ReplacementTotal*1000/float64(totalMin)*10) / 10
|
|
727
|
+
|
|
728
|
+ var firstOpeateTime = monitorList[0].OperateTime
|
|
729
|
+ for _, item := range monitorList {
|
|
730
|
+ //超滤率
|
|
731
|
+ service.ModifyDialysisPatientMonitor(item.ID, ultrafiltration_rate)
|
|
732
|
+
|
|
733
|
+ //置换率
|
|
734
|
+ service.ModifyDialysisPatientReplascementRate(item.ID, replacement_rate)
|
|
735
|
+
|
|
736
|
+ //超滤量
|
|
737
|
+ ultrafiltration_volume := math.Floor(float64(item.OperateTime-firstOpeateTime)/3600) * ultrafiltration_rate
|
|
738
|
+ service.ModifyPatientUltrafiltrationVolume(item.ID, ultrafiltration_volume)
|
|
739
|
+
|
|
740
|
+ //置换量
|
|
741
|
+ displacement_quantity := (math.Floor(float64(item.OperateTime+3600-firstOpeateTime)/3600) * replacement_rate) * 60 / 1000
|
|
742
|
+
|
|
743
|
+ service.ModifyPatientDisplacementQuantity(item.ID, displacement_quantity)
|
|
744
|
+
|
|
745
|
+ }
|
|
746
|
+ }
|
|
747
|
+
|
|
748
|
+ }
|
714
|
749
|
//记录日志
|
715
|
750
|
byterequest, _ := json.Marshal(prescription)
|
716
|
751
|
dialysisPrescriptionLog := models.XtDialysisPrescriptionLog{
|
|
@@ -849,6 +884,42 @@ func (c *DialysisApiController) PostPrescription() {
|
849
|
884
|
|
850
|
885
|
updateErr := service.UpDateDialysisPrescription(&prescription)
|
851
|
886
|
|
|
887
|
+ if adminUserInfo.CurrentOrgId == 10721 || adminUserInfo.CurrentOrgId == 10164 {
|
|
888
|
+
|
|
889
|
+ monitorList, _ := service.GetMobilePatientMonitor(prescription.PatientId, prescription.RecordDate, prescription.UserOrgId)
|
|
890
|
+
|
|
891
|
+ if len(monitorList) > 0 {
|
|
892
|
+ var ultrafiltration_rate float64
|
|
893
|
+ totalMin := prescription.DialysisDurationHour*60 + prescription.DialysisDurationMinute
|
|
894
|
+
|
|
895
|
+ ultrafiltration_rate = (math.Floor(prescription.PrescriptionWater * 1000 / float64(totalMin) * 60 * 1000)) / 1000
|
|
896
|
+ var replacement_rate float64
|
|
897
|
+
|
|
898
|
+ //乘10 除10是为了保留一位小数
|
|
899
|
+ replacement_rate = math.Floor(prescription.ReplacementTotal*1000/float64(totalMin)*10) / 10
|
|
900
|
+
|
|
901
|
+ var firstOpeateTime = monitorList[0].OperateTime
|
|
902
|
+ for _, item := range monitorList {
|
|
903
|
+ //超滤率
|
|
904
|
+ service.ModifyDialysisPatientMonitor(item.ID, ultrafiltration_rate)
|
|
905
|
+
|
|
906
|
+ //置换率
|
|
907
|
+ service.ModifyDialysisPatientReplascementRate(item.ID, replacement_rate)
|
|
908
|
+
|
|
909
|
+ //超滤量
|
|
910
|
+ ultrafiltration_volume := math.Floor(float64(item.OperateTime-firstOpeateTime)/3600) * ultrafiltration_rate
|
|
911
|
+ service.ModifyPatientUltrafiltrationVolume(item.ID, ultrafiltration_volume)
|
|
912
|
+
|
|
913
|
+ //置换量
|
|
914
|
+ displacement_quantity := (math.Floor(float64(item.OperateTime+3600-firstOpeateTime)/3600) * replacement_rate) * 60 / 1000
|
|
915
|
+
|
|
916
|
+ service.ModifyPatientDisplacementQuantity(item.ID, displacement_quantity)
|
|
917
|
+
|
|
918
|
+ }
|
|
919
|
+ }
|
|
920
|
+
|
|
921
|
+ }
|
|
922
|
+
|
852
|
923
|
//记录日志
|
853
|
924
|
byterequest, _ := json.Marshal(prescription)
|
854
|
925
|
dialysisPrescriptionLog := models.XtDialysisPrescriptionLog{
|
|
@@ -1497,6 +1568,41 @@ func (c *DialysisApiController) PostSoulution() {
|
1497
|
1568
|
|
1498
|
1569
|
err := service.SavePrescriptionAndCreateSolution(&solution, &prescription)
|
1499
|
1570
|
|
|
1571
|
+ if adminUserInfo.CurrentOrgId == 10721 || adminUserInfo.CurrentOrgId == 10164 {
|
|
1572
|
+
|
|
1573
|
+ monitorList, _ := service.GetMobilePatientMonitor(prescription.PatientId, prescription.RecordDate, prescription.UserOrgId)
|
|
1574
|
+
|
|
1575
|
+ if len(monitorList) > 0 {
|
|
1576
|
+ var ultrafiltration_rate float64
|
|
1577
|
+ totalMin := prescription.DialysisDurationHour*60 + prescription.DialysisDurationMinute
|
|
1578
|
+
|
|
1579
|
+ ultrafiltration_rate = (math.Floor(prescription.PrescriptionWater * 1000 / float64(totalMin) * 60 * 1000)) / 1000
|
|
1580
|
+ var replacement_rate float64
|
|
1581
|
+
|
|
1582
|
+ //乘10 除10是为了保留一位小数
|
|
1583
|
+ replacement_rate = math.Floor(prescription.ReplacementTotal*1000/float64(totalMin)*10) / 10
|
|
1584
|
+
|
|
1585
|
+ var firstOpeateTime = monitorList[0].OperateTime
|
|
1586
|
+ for _, item := range monitorList {
|
|
1587
|
+ //超滤率
|
|
1588
|
+ service.ModifyDialysisPatientMonitor(item.ID, ultrafiltration_rate)
|
|
1589
|
+
|
|
1590
|
+ //置换率
|
|
1591
|
+ service.ModifyDialysisPatientReplascementRate(item.ID, replacement_rate)
|
|
1592
|
+
|
|
1593
|
+ //超滤量
|
|
1594
|
+ ultrafiltration_volume := math.Floor(float64(item.OperateTime-firstOpeateTime)/3600) * ultrafiltration_rate
|
|
1595
|
+ service.ModifyPatientUltrafiltrationVolume(item.ID, ultrafiltration_volume)
|
|
1596
|
+
|
|
1597
|
+ //置换量
|
|
1598
|
+ displacement_quantity := (math.Floor(float64(item.OperateTime+3600-firstOpeateTime)/3600) * replacement_rate) * 60 / 1000
|
|
1599
|
+
|
|
1600
|
+ service.ModifyPatientDisplacementQuantity(item.ID, displacement_quantity)
|
|
1601
|
+
|
|
1602
|
+ }
|
|
1603
|
+ }
|
|
1604
|
+
|
|
1605
|
+ }
|
1500
|
1606
|
//记录日志
|
1501
|
1607
|
byterequest, _ := json.Marshal(prescription)
|
1502
|
1608
|
dialysisPrescriptionLog := models.XtDialysisPrescriptionLog{
|
|
@@ -2973,6 +3079,44 @@ func (c *DialysisApiController) PostAssessmentBeforeDislysis() {
|
2973
|
3079
|
}
|
2974
|
3080
|
}
|
2975
|
3081
|
|
|
3082
|
+ if adminUserInfo.CurrentOrgId == 10721 || adminUserInfo.CurrentOrgId == 10164 {
|
|
3083
|
+
|
|
3084
|
+ prescription, _ := service.GetTodayPrescription(patient, adminUserInfo.CurrentOrgId, recordDate.Unix())
|
|
3085
|
+
|
|
3086
|
+ monitorList, _ := service.GetMobilePatientMonitor(prescription.PatientId, prescription.RecordDate, prescription.UserOrgId)
|
|
3087
|
+
|
|
3088
|
+ if len(monitorList) > 0 {
|
|
3089
|
+ var ultrafiltration_rate float64
|
|
3090
|
+ totalMin := prescription.DialysisDurationHour*60 + prescription.DialysisDurationMinute
|
|
3091
|
+
|
|
3092
|
+ ultrafiltration_rate = (math.Floor(prescription.PrescriptionWater * 1000 / float64(totalMin) * 60 * 1000)) / 1000
|
|
3093
|
+ var replacement_rate float64
|
|
3094
|
+
|
|
3095
|
+ //乘10 除10是为了保留一位小数
|
|
3096
|
+ replacement_rate = math.Floor(prescription.ReplacementTotal*1000/float64(totalMin)*10) / 10
|
|
3097
|
+
|
|
3098
|
+ var firstOpeateTime = monitorList[0].OperateTime
|
|
3099
|
+ for _, item := range monitorList {
|
|
3100
|
+ //超滤率
|
|
3101
|
+ service.ModifyDialysisPatientMonitor(item.ID, ultrafiltration_rate)
|
|
3102
|
+
|
|
3103
|
+ //置换率
|
|
3104
|
+ service.ModifyDialysisPatientReplascementRate(item.ID, replacement_rate)
|
|
3105
|
+
|
|
3106
|
+ //超滤量
|
|
3107
|
+ ultrafiltration_volume := math.Floor(float64(item.OperateTime-firstOpeateTime)/3600) * ultrafiltration_rate
|
|
3108
|
+ service.ModifyPatientUltrafiltrationVolume(item.ID, ultrafiltration_volume)
|
|
3109
|
+
|
|
3110
|
+ //置换量
|
|
3111
|
+ displacement_quantity := (math.Floor(float64(item.OperateTime+3600-firstOpeateTime)/3600) * replacement_rate) * 60 / 1000
|
|
3112
|
+
|
|
3113
|
+ service.ModifyPatientDisplacementQuantity(item.ID, displacement_quantity)
|
|
3114
|
+
|
|
3115
|
+ }
|
|
3116
|
+ }
|
|
3117
|
+
|
|
3118
|
+ }
|
|
3119
|
+
|
2976
|
3120
|
}
|
2977
|
3121
|
|
2978
|
3122
|
key := strconv.FormatInt(adminUserInfo.CurrentOrgId, 10) + ":" + strconv.FormatInt(patient, 10) + ":" + strconv.FormatInt(recordDate.Unix(), 10) + ":assessment_before_dislysis"
|
|
@@ -3332,6 +3476,44 @@ func (c *DialysisApiController) PostAssessmentBeforeDislysis() {
|
3332
|
3476
|
|
3333
|
3477
|
}
|
3334
|
3478
|
|
|
3479
|
+ if adminUserInfo.CurrentOrgId == 10721 || adminUserInfo.CurrentOrgId == 10164 {
|
|
3480
|
+
|
|
3481
|
+ prescription, _ := service.GetTodayPrescription(patient, adminUserInfo.CurrentOrgId, recordDate.Unix())
|
|
3482
|
+
|
|
3483
|
+ monitorList, _ := service.GetMobilePatientMonitor(prescription.PatientId, prescription.RecordDate, prescription.UserOrgId)
|
|
3484
|
+
|
|
3485
|
+ if len(monitorList) > 0 {
|
|
3486
|
+ var ultrafiltration_rate float64
|
|
3487
|
+ totalMin := prescription.DialysisDurationHour*60 + prescription.DialysisDurationMinute
|
|
3488
|
+
|
|
3489
|
+ ultrafiltration_rate = (math.Floor(prescription.PrescriptionWater * 1000 / float64(totalMin) * 60 * 1000)) / 1000
|
|
3490
|
+ var replacement_rate float64
|
|
3491
|
+
|
|
3492
|
+ //乘10 除10是为了保留一位小数
|
|
3493
|
+ replacement_rate = math.Floor(prescription.ReplacementTotal*1000/float64(totalMin)*10) / 10
|
|
3494
|
+
|
|
3495
|
+ var firstOpeateTime = monitorList[0].OperateTime
|
|
3496
|
+ for _, item := range monitorList {
|
|
3497
|
+ //超滤率
|
|
3498
|
+ service.ModifyDialysisPatientMonitor(item.ID, ultrafiltration_rate)
|
|
3499
|
+
|
|
3500
|
+ //置换率
|
|
3501
|
+ service.ModifyDialysisPatientReplascementRate(item.ID, replacement_rate)
|
|
3502
|
+
|
|
3503
|
+ //超滤量
|
|
3504
|
+ ultrafiltration_volume := math.Floor(float64(item.OperateTime-firstOpeateTime)/3600) * ultrafiltration_rate
|
|
3505
|
+ service.ModifyPatientUltrafiltrationVolume(item.ID, ultrafiltration_volume)
|
|
3506
|
+
|
|
3507
|
+ //置换量
|
|
3508
|
+ displacement_quantity := (math.Floor(float64(item.OperateTime+3600-firstOpeateTime)/3600) * replacement_rate) * 60 / 1000
|
|
3509
|
+
|
|
3510
|
+ service.ModifyPatientDisplacementQuantity(item.ID, displacement_quantity)
|
|
3511
|
+
|
|
3512
|
+ }
|
|
3513
|
+ }
|
|
3514
|
+
|
|
3515
|
+ }
|
|
3516
|
+
|
3335
|
3517
|
err := service.UpadatePredialysisEvaluation(&assessmentBeforeDislysis)
|
3336
|
3518
|
|
3337
|
3519
|
//创建步骤表
|