瀏覽代碼

[진료관리] 임계치 설정 기능 수정 중.

sjpark 4 年之前
父節點
當前提交
969426c3fe

+ 6 - 0
src/main/java/com/lemon/lifecenter/controller/ClinicController.java

@@ -510,6 +510,7 @@ public class ClinicController extends LifeCenterController {
         union.setCreateDate(pr.getCreateDate());
         union.setRecordedDate(pr.getRecordedDate());
         union.setPhrValueExtra(pr.getPhrValue());
+        union.setIsExtraWarning(pr.getIsWarning());
         union.setRecordedByName(pr.getRecordedByName());
         union.setRecordedById(pr.getRecordedById());
 
@@ -523,6 +524,7 @@ public class ClinicController extends LifeCenterController {
         union.setRecordedDate(bp.getRecordedDate());
         union.setPhrValue(bp.getPhrValue());
         union.setPhrValue2(bp.getPhrValue2());
+        union.setIsWarning(bp.getIsWarning());
         union.setRecordedByName(bp.getRecordedByName());
         union.setRecordedById(bp.getRecordedById());
 
@@ -554,10 +556,12 @@ public class ClinicController extends LifeCenterController {
         union.setRecordedDate(bp.getRecordedDate());
         union.setPhrValue(bp.getPhrValue());
         union.setPhrValue2(bp.getPhrValue2());
+        union.setIsWarning(bp.getIsWarning());
         union.setRecordedByName(bp.getRecordedByName());
         union.setRecordedById(bp.getRecordedById());
 
         union.setPhrValueExtra(pr.getPhrValue());
+        union.setIsExtraWarning(pr.getIsWarning());
 
         bloodPressureIndex += 1;
         pulseRateIndex += 1;
@@ -567,6 +571,7 @@ public class ClinicController extends LifeCenterController {
         union.setRecordedDate(bp.getRecordedDate());
           union.setPhrValue(bp.getPhrValue());
           union.setPhrValue2(bp.getPhrValue2());
+          union.setIsWarning(bp.getIsWarning());
           union.setRecordedByName(bp.getRecordedByName());
           union.setRecordedById(bp.getRecordedById());
 
@@ -576,6 +581,7 @@ public class ClinicController extends LifeCenterController {
         union.setCreateDate(pr.getCreateDate());
         union.setRecordedDate(pr.getRecordedDate());
           union.setPhrValueExtra(pr.getPhrValue());
+          union.setIsExtraWarning(pr.getIsWarning());
           union.setRecordedByName(pr.getRecordedByName());
           union.setRecordedById(pr.getRecordedById());
 

+ 5 - 5
src/main/java/com/lemon/lifecenter/dto/ClinicConfigurationDTO.java

@@ -19,7 +19,7 @@ public class ClinicConfigurationDTO {
 	private int pulseRateThresholdMax;
 	private int oxygenSaturationThreshold;
 	private int bloodSugarThresholdMin;
-	private int bloodSugerThresholdMax;
+	private int bloodSugarThresholdMax;
 	
 	private int patientIdx;
 	
@@ -119,11 +119,11 @@ public class ClinicConfigurationDTO {
 	public void setBloodSugarThresholdMin(int bloodSugarThresholdMin) {
 		this.bloodSugarThresholdMin = bloodSugarThresholdMin;
 	}
-	public int getBloodSugerThresholdMax() {
-		return bloodSugerThresholdMax;
+	public int getBloodSugarThresholdMax() {
+		return bloodSugarThresholdMax;
 	}
-	public void setBloodSugerThresholdMax(int bloodSugerThresholdMax) {
-		this.bloodSugerThresholdMax = bloodSugerThresholdMax;
+	public void setBloodSugarThresholdMax(int bloodSugarThresholdMax) {
+		this.bloodSugarThresholdMax = bloodSugarThresholdMax;
 	}
 	public int getPatientIdx() {
 		return patientIdx;

+ 11 - 39
src/main/java/com/lemon/lifecenter/dto/PatientPHRHistoryDTO.java

@@ -19,6 +19,8 @@ public class PatientPHRHistoryDTO {
 	private String createDate;
 	private int limit;
 	private int limitMax;
+  private boolean isWarning;
+  private boolean isExtraWarning;
 	
 	public int getPatientIdx() {
 		return patientIdx;
@@ -86,48 +88,18 @@ public class PatientPHRHistoryDTO {
 	public void setLimitMax(int limitMax) {
 		this.limitMax = limitMax;
 	}
-	public boolean getIsWarning() {
-		try {
-			if (this.phrType.equals("temperature")) {
-				return this.phrValue >= 37.5;
-			}
-			else if (this.phrType.equals("bloodPressure")) {
-				boolean highBP = this.phrValue >= 149 || this.phrValue2 >= 99;
-        boolean lowBP = this.phrValue <= 90 || this.phrValue2 <= 60;
-        // phrType 이 혈압인 경우, 통합뷰의 경우 phrValueExtra 에 맥박이 들어가는 경우가 있음.
-        boolean lowPR = false;
-        // if (this.phrValueExtra != null) {
-        //   lowPR = this.phrValueExtra <= 55 || this.phrValueExtra >= 110;
-        // }  //getIsExtraWarning 으로 분리시킴
-			
-				return highBP || lowBP || lowPR;
-			}
-			else if (this.phrType.equals("oxygenSaturation")) {
-				return this.phrValue <= 94;
-			}
-			else if (this.phrType.equals("pulseRate")) {
-				return this.phrValue <= 55 || this.phrValue >= 110;
-			}
-			else if (this.phrType.equals("bloodSugar")) {
-				return this.phrValue <= 70;
-			}
-		}
-		catch(Exception e) {
-			
-		}
-		
-		return false;
+  public boolean getIsWarning() {
+    return isWarning;
+  }
+  public void setIsWarning(boolean value) {
+    this.isWarning = value;
   }
   public boolean getIsExtraWarning() {
-		try {
-				return this.phrValueExtra <= 55 || this.phrValueExtra >= 110;
-		}
-		catch(Exception e) {
-			
-		}
-		
-		return false;
+    return isExtraWarning;
 	}
+  public void setIsExtraWarning(boolean value) {
+    this.isExtraWarning = value;
+  }
 	public String getCreateDateFormatted() {
 		return getDateFormatted(this.createDate);
   }

+ 3 - 3
src/main/java/com/lemon/lifecenter/dto/PatientPHRLatestDTO.java

@@ -282,9 +282,9 @@ public class PatientPHRLatestDTO {
 
 		if (this.systolicBloodPressure == null || this.diastolicBloodPressure == null) return false;
 		
-    boolean systolicWarning = isAlarm(this.systolicBloodPressureAlarmYN, (this.systolicBloodPressure <= 90 || this.systolicBloodPressure >= 149));
-    boolean diastolicWarning = isAlarm(this.diastolicBloodPressureAlarmYN, (this.diastolicBloodPressure <= 60 || this.diastolicBloodPressure >= 99));
-    return systolicWarning || diastolicWarning;
+    boolean highBPWarning = isAlarm(this.highBloodPressureAlarmYN, (this.systolicBloodPressure >= 149 || this.diastolicBloodPressure >= 99));
+    boolean lowBPWarning = isAlarm(this.lowBloodPressureAlarmYN, (this.systolicBloodPressure <= 90 || this.diastolicBloodPressure <= 60));
+    return highBPWarning || lowBPWarning;
 	}
   public boolean getIsPulseRateWarning() {
 		if (this.pulseRate == null) return false;

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

@@ -85,7 +85,7 @@ public class PHRService {
 				break;
 			case "bloodSugar":
 				String bloodSugarAlarmYN = "N";
-				if (dto.getPhrValue().intValue() <= configurationDTO.getBloodSugarThresholdMin() || dto.getPhrValue().intValue() >= configurationDTO.getBloodSugerThresholdMax()) {
+				if (dto.getPhrValue().intValue() <= configurationDTO.getBloodSugarThresholdMin() || dto.getPhrValue().intValue() >= configurationDTO.getBloodSugarThresholdMax()) {
 					bloodSugarAlarmYN = "Y";
 				}
 				phrLatestDTO.setBloodSugar(dto.getPhrValue().intValue());
@@ -101,7 +101,32 @@ public class PHRService {
     }
     
     public List<PatientPHRHistoryDTO> selectPHRHistoryList(PatientPHRHistoryDTO dto) {
-        return mapperHistory.selectPHRHistoryList(dto);
+      // 해당 환자가 속해 있는 센터의 설정 정보 가져오기
+		  ClinicConfigurationDTO configDto = new ClinicConfigurationDTO();
+		  configDto.setPatientIdx(dto.getPatientIdx());
+		  configDto = mapperClinicConfiguration.selectConfigurationWithPatient(configDto);
+
+      List<PatientPHRHistoryDTO> phrList = mapperHistory.selectPHRHistoryList(dto);
+      for (PatientPHRHistoryDTO phrData: phrList) {
+        if (phrData.getPhrType() == "temperature") {
+          phrData.setIsWarning(phrData.getPhrValue() >= configDto.getTemperatureThreshold());
+        }
+        else if (phrData.getPhrType() == "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);
+        }
+        else if (phrData.getPhrType() == "pulseRate") {
+          phrData.setIsWarning(phrData.getPhrValue() <= configDto.getPulseRateThresholdMin() || phrData.getPhrValue() >= configDto.getPulseRateThresholdMax());
+        }
+        else if (phrData.getPhrType() == "oxygenSaturation") {
+          phrData.setIsWarning(phrData.getPhrValue() <= configDto.getOxygenSaturationThreshold());
+        }
+        else if (phrData.getPhrType() == "bloodSugar") {
+          phrData.setIsWarning(phrData.getPhrValue() <= configDto.getBloodSugarThresholdMin() || phrData.getPhrValue() >= configDto.getBloodSugarThresholdMax());
+        }
+      }
+      return phrList;
     }
     
     public void insertSymptom(PatientSymptomSimDTO dto) {

+ 3 - 3
src/main/resources/mybatis/mapper/center/clinicConfiguration.xml

@@ -65,7 +65,7 @@
 				pulse_rate_threshold_max				AS pulseRateThresholdMax,
 				oxygen_saturation_threshold				AS oxygenSaturationThreshold,
 				blood_sugar_threshold_min				AS bloodSugarThresholdMin,
-				blood_sugar_threshold_max				AS bloodSugerThresholdMax
+				blood_sugar_threshold_max				AS bloodSugarThresholdMax
 		FROM clinic_configuration
 		WHERE 
 			center_code = #{centerCode}
@@ -89,7 +89,7 @@
 				c.pulse_rate_threshold_max					AS pulseRateThresholdMax,
 				c.oxygen_saturation_threshold				AS oxygenSaturationThreshold,
 				c.blood_sugar_threshold_min					AS bloodSugarThresholdMin,
-				c.blood_sugar_threshold_max					AS bloodSugerThresholdMax
+				c.blood_sugar_threshold_max					AS bloodSugarThresholdMax
 		FROM clinic_configuration c, patient_care p
 		WHERE 
 			p.patient_idx = #{patientIdx)
@@ -124,7 +124,7 @@
 				pulse_rate_threshold_max				= #{pulseRateThresholdMax},
 				oxygen_saturation_threshold				= #{oxygenSaturationThreshold},
 				blood_sugar_threshold_min				= #{bloodSugarThresholdMin},
-				blood_sugar_threshold_max				= #{bloodSugerThresholdMax}   
+				blood_sugar_threshold_max				= #{bloodSugarThresholdMax}   
     	WHERE 
 			center_code = #{centerCode}
 	]]>

+ 4 - 4
src/main/webapp/WEB-INF/jsp/clinic/config.jsp

@@ -91,7 +91,7 @@ function saveAlarmValue() {
   var pulseRateThresholdMax = parseInt($("#pulseRateThresholdMax").val(), 10);
   var oxygenSaturationThreshold = parseInt($("#oxygenSaturationThreshold").val(), 10);
   var bloodSugarThresholdMin = parseInt($("#bloodSugarThresholdMin").val(), 10);
-  var bloodSugerThresholdMax = parseInt($("#bloodSugerThresholdMax").val(), 10);
+  var bloodSugarThresholdMax = parseInt($("#bloodSugarThresholdMax").val(), 10);
 
   var params = {
     centerCode: centerCode,
@@ -104,7 +104,7 @@ function saveAlarmValue() {
     pulseRateThresholdMax, pulseRateThresholdMax,
     oxygenSaturationThreshold, oxygenSaturationThreshold,
     bloodSugarThresholdMin, bloodSugarThresholdMin,
-    bloodSugerThresholdMax, bloodSugerThresholdMax,
+    bloodSugarThresholdMax, bloodSugarThresholdMax,
   }
 
   $.ajax({
@@ -232,7 +232,7 @@ $(document).ready(function() {
                     <c:set var="pulseRateThresholdMax" value="${config.pulseRateThresholdMax}" />
                     <c:set var="oxygenSaturationThreshold" value="${config.oxygenSaturationThreshold}" />
                     <c:set var="bloodSugarThresholdMin" value="${config.bloodSugarThresholdMin}" />
-                    <c:set var="bloodSugerThresholdMax" value="${config.bloodSugerThresholdMax}" />
+                    <c:set var="bloodSugarThresholdMax" value="${config.bloodSugarThresholdMax}" />
 
                     <li class="row fever">
                       <div class="col-lg-4">체온</div>
@@ -276,7 +276,7 @@ $(document).ready(function() {
                       <div class="col-lg-8">
                         <input id="bloodSugarThresholdMin" type="number" class="form-control w120" placeholder="저혈당" value="<c:out value="${bloodSugarThresholdMin}" />"> 이하
                         <span>또는</span>
-                        <input id="bloodSugerThresholdMax" type="number" class="form-control w120" placeholder="고혈당" value="<c:out value="${bloodSugerThresholdMax}" />"> 이상시 알람
+                        <input id="bloodSugarThresholdMax" type="number" class="form-control w120" placeholder="고혈당" value="<c:out value="${bloodSugarThresholdMax}" />"> 이상시 알람
                       </div>
                     </li>
                   </ul>

+ 1 - 1
src/main/webapp/WEB-INF/jsp/clinic/state.jsp

@@ -459,7 +459,7 @@ $(document).ready(function() {
 						</li>
 						<li class="row sugar">
 							<div class="col-lg-4">고혈당</div>
-							<div class="col-lg-8"><c:out value="${config.bloodSugerThresholdMax}" /> 이상</div>
+							<div class="col-lg-8"><c:out value="${config.bloodSugarThresholdMax}" /> 이상</div>
 						</li>
 						<li class="row sugar">
 							<div class="col-lg-4">저혈당</div>