瀏覽代碼

[phr] 건강정보이력 - 위험 표시 색상 추가.

sjpark 4 年之前
父節點
當前提交
845332c7d9

+ 18 - 8
src/main/java/com/lemon/lifecenter/dto/PatientPHRHistoryDTO.java

@@ -69,15 +69,25 @@ public class PatientPHRHistoryDTO {
 	public void setLimitMax(int limitMax) {
 		this.limitMax = limitMax;
 	}
-	public String getPhrValueWithValue2() {
-		String valueString = "--";
-		if (this.phrValue != null) {
-			valueString = this.phrValue.toString();
+	public boolean getIsWarning() {
+		try {
+			if (this.phrType.equals("temperature")) {
+				return this.phrValue > 37.5;
+			}
+			else if (this.phrType.equals("bloodPressure")) {
+				boolean highBP = this.phrValue > 140 || this.phrValue2 > 90;
+				boolean lowBP = this.phrValue < 80 || this.phrValue2 < 60;
+			
+				return highBP || lowBP;
+			}
+			else if (this.phrType.equals("oxygenSaturation")) {
+				return this.phrValue < 95;
+			}
 		}
-		String value2String = "--";
-		if (this.phrValue2 != null) {
-			value2String = this.phrValue2.toString();
+		catch(Exception e) {
+			
 		}
-		return valueString + " / " + value2String;
+		
+		return false;
 	}
 }

+ 1 - 0
src/main/resources/mybatis/mapper/patient/patientPHRHistory.xml

@@ -49,6 +49,7 @@
     <select id="selectPHRHistoryList" parameterType="PatientPHRHistoryDTO" resultType="PatientPHRHistoryDTO">
     <![CDATA[
 	    SELECT	create_date			AS createDate,
+	    		phr_type			AS phrType,
 	    		phr_value			AS phrValue,
 	]]>
     	<if test='phrType == "bloodPressure"'>

+ 6 - 5
src/main/webapp/WEB-INF/jsp/clinic/info.jsp

@@ -98,17 +98,18 @@ function retrievePhrData() {
 			if (datas.length > 0) {
 				contents = "";
 				datas.forEach(d => {
+					var danger = d.isWarning ? "text-danger" : "";
 					var row = "";
 					row += "<tr>";
 					row += "<td>" + d.createDate + "</td>";
 					if (phrType==="bloodPressure") {
-					row += "<td><span class=''>" + (isNaN(parseInt(d.phrValue)) ? "--" : parseInt(d.phrValue)) + " / " + (isNaN(parseInt(d.phrValue2)) ? "--" : parseInt(d.phrValue2)) + "</span></td>";
+					row += "<td><span class='"+danger+"'>" + (isNaN(parseInt(d.phrValue)) ? "--" : parseInt(d.phrValue)) + " / " + (isNaN(parseInt(d.phrValue2)) ? "--" : parseInt(d.phrValue2)) + "</span></td>";
 					}
 					else if (phrType==="temperature") {
-					row += "<td><span class=''>" + d.phrValue + "</span></td>";
+					row += "<td><span class='"+danger+"'>" + d.phrValue + "</span></td>";
 					}
 					else {
-					row += "<td><span class=''>" + parseInt(d.phrValue) + "</span></td>";
+					row += "<td><span class='"+danger+"'>" + parseInt(d.phrValue) + "</span></td>";
 					}
 					row += "<td>" + d.recordedByName + "</td>";
 					row += "</tr>";
@@ -408,7 +409,7 @@ $(document).ready(function() {
 	drawPhrChart(datas, "체온");
 
 	// 상단 환자 정보 영역 토글 이벤트
-	$('.toggle .card-header a.toggleBtn').click(function () {
+	$('.toggle .card-header').click(function () {
 		$('.toggle .card-header a.toggleBtn').toggleClass('active');
 		$('.toggle .user-info').toggleClass('active');
 	})
@@ -940,7 +941,7 @@ $(document).ready(function() {
 															<c:forEach var="i" begin="1" end="${phrTotal}">
 																<tr>
 																	<td><c:out value="${phrItems[phrTotal-i].createDate}" /></td>
-																	<td><span class=""><c:out value="${phrItems[phrTotal-i].phrValue} ℃" /></span></td>
+																	<td><span class="${phrItems[phrTotal-i].isWarning ? 'text-danger' : ''}"><c:out value="${phrItems[phrTotal-i].phrValue} ℃" /></span></td>
 																	<td><c:out value="${phrItems[phrTotal-i].recordedByName}" /></td>
 																</tr>
 															</c:forEach>