Преглед на файлове

[진료관리] phrDataHistory isWarning 계산시 null 체크 추가.

sjpark преди 4 години
родител
ревизия
76ecad4f84
променени са 1 файла, в които са добавени 7 реда и са изтрити 7 реда
  1. 7 7
      src/main/java/com/lemon/lifecenter/service/PHRService.java

+ 7 - 7
src/main/java/com/lemon/lifecenter/service/PHRService.java

@@ -109,21 +109,21 @@ public class PHRService {
       List<PatientPHRHistoryDTO> phrList = mapperHistory.selectPHRHistoryList(dto);
       for (PatientPHRHistoryDTO phrData: phrList) {
         if (phrData.getPhrType().equals("temperature")) {
-          phrData.setIsWarning(phrData.getPhrValue() >= configDto.getTemperatureThreshold());
+          phrData.setIsWarning(phrData.getPhrValue() != null && (phrData.getPhrValue() >= configDto.getTemperatureThreshold()));
         }
         else if (phrData.getPhrType().equals("bloodPressure")) {
-          boolean highBP = phrData.getPhrValue() >= configDto.getSystolicBloodPressureThresholdMax() || phrData.getPhrValue2() >= configDto.getDiastolicBloodPressureThresholdMax();
-          boolean lowBP = phrData.getPhrValue() <= configDto.getSystolicBloodPressureThresholdMin() || phrData.getPhrValue2() <= configDto.getDiastolicBloodPressureThresholdMin();
-          phrData.setIsWarning(highBP || lowBP);
+          boolean systolicBP = phrData.getPhrValue() != null && (phrData.getPhrValue() <= configDto.getSystolicBloodPressureThresholdMin() || phrData.getPhrValue() >= configDto.getSystolicBloodPressureThresholdMax());
+          boolean diastolicBP = phrData.getPhrValue2() != null && (phrData.getPhrValue2() <= configDto.getDiastolicBloodPressureThresholdMin() || phrData.getPhrValue2() >= configDto.getDiastolicBloodPressureThresholdMax());
+          phrData.setIsWarning(systolicBP || diastolicBP);
         }
         else if (phrData.getPhrType().equals("pulseRate")) {
-          phrData.setIsWarning(phrData.getPhrValue() <= configDto.getPulseRateThresholdMin() || phrData.getPhrValue() >= configDto.getPulseRateThresholdMax());
+          phrData.setIsWarning(phrData.getPhrValue() != null && (phrData.getPhrValue() <= configDto.getPulseRateThresholdMin() || phrData.getPhrValue() >= configDto.getPulseRateThresholdMax()));
         }
         else if (phrData.getPhrType().equals("oxygenSaturation")) {
-          phrData.setIsWarning(phrData.getPhrValue() <= configDto.getOxygenSaturationThreshold());
+          phrData.setIsWarning(phrData.getPhrValue() != null && (phrData.getPhrValue() <= configDto.getOxygenSaturationThreshold()));
         }
         else if (phrData.getPhrType().equals("bloodSugar")) {
-          phrData.setIsWarning(phrData.getPhrValue() <= configDto.getBloodSugarThresholdMin() || phrData.getPhrValue() >= configDto.getBloodSugarThresholdMax());
+          phrData.setIsWarning(phrData.getPhrValue() != null && (phrData.getPhrValue() <= configDto.getBloodSugarThresholdMin() || phrData.getPhrValue() >= configDto.getBloodSugarThresholdMax()));
         }
       }
       return phrList;