|
@@ -846,6 +846,8 @@ func (c *CheckWeightApiController) GetPatientInfoDialysis() {
|
846
|
846
|
// 获取患者透前干体重或者获取患者透前体重
|
847
|
847
|
var dry_weight map[string]interface{}
|
848
|
848
|
dry_weight = make(map[string]interface{})
|
|
849
|
+ var after_dry_weight map[string]interface{}
|
|
850
|
+ after_dry_weight = make(map[string]interface{})
|
849
|
851
|
if dialysistype == 1 {
|
850
|
852
|
|
851
|
853
|
lastPredialysisEvaluation, getLPEErr := service.MobileGetLastTimePredialysisEvaluation(adminUserInfo.Org.Id, id, endTime)
|
|
@@ -900,6 +902,44 @@ func (c *CheckWeightApiController) GetPatientInfoDialysis() {
|
900
|
902
|
dry_weight["dry_weight"] = predialysisEvaluation.WeightBefore
|
901
|
903
|
}
|
902
|
904
|
}
|
|
905
|
+
|
|
906
|
+ lastPredialysisEvaluation, getLPEErr := service.MobileGetLastTimePredialysisEvaluation(adminUserInfo.Org.Id, id, endTime)
|
|
907
|
+ weight, err := service.FindLastDryWeightAdjust(adminUserInfo.Org.Id, id)
|
|
908
|
+ if err == gorm.ErrRecordNotFound {
|
|
909
|
+ if getLPEErr != nil {
|
|
910
|
+ after_dry_weight["code"] = 1
|
|
911
|
+ after_dry_weight["dry_weight"] = nil
|
|
912
|
+ } else {
|
|
913
|
+ if lastPredialysisEvaluation == nil {
|
|
914
|
+ after_dry_weight["code"] = 1
|
|
915
|
+ after_dry_weight["dry_weight"] = nil
|
|
916
|
+ } else {
|
|
917
|
+ // 传输的干体重实际为干体重加上衣服重
|
|
918
|
+ after_dry_weight["code"] = 0
|
|
919
|
+ after_dry_weight["dry_weight"] = lastPredialysisEvaluation.DryWeight + lastPredialysisEvaluation.AdditionalWeight
|
|
920
|
+ }
|
|
921
|
+ }
|
|
922
|
+ } else {
|
|
923
|
+ if err != nil {
|
|
924
|
+ after_dry_weight["code"] = 1
|
|
925
|
+ after_dry_weight["dry_weight"] = nil
|
|
926
|
+ } else {
|
|
927
|
+ after_dry_weight["code"] = 0
|
|
928
|
+ if getLPEErr != nil {
|
|
929
|
+ after_dry_weight["code"] = 0
|
|
930
|
+ after_dry_weight["dry_weight"] = weight.DryWeight
|
|
931
|
+ } else {
|
|
932
|
+ if lastPredialysisEvaluation == nil {
|
|
933
|
+ after_dry_weight["code"] = 1
|
|
934
|
+ after_dry_weight["dry_weight"] = weight.DryWeight
|
|
935
|
+ } else {
|
|
936
|
+ // 传输的干体重实际为干体重加上衣服重
|
|
937
|
+ after_dry_weight["code"] = 0
|
|
938
|
+ after_dry_weight["dry_weight"] = weight.DryWeight + lastPredialysisEvaluation.AdditionalWeight
|
|
939
|
+ }
|
|
940
|
+ }
|
|
941
|
+ }
|
|
942
|
+ }
|
903
|
943
|
}
|
904
|
944
|
|
905
|
945
|
c.ServeSuccessJSON(map[string]interface{}{
|
|
@@ -907,6 +947,7 @@ func (c *CheckWeightApiController) GetPatientInfoDialysis() {
|
907
|
947
|
"patient": dialysisinfo,
|
908
|
948
|
"schedule": sc,
|
909
|
949
|
"dryweight": dry_weight,
|
|
950
|
+ "after_dry_weight": after_dry_weight,
|
910
|
951
|
})
|
911
|
952
|
return
|
912
|
953
|
}
|