|
@@ -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;
|