Pārlūkot izejas kodu

[phr] 진료관리 화면 수정.

sjpark 4 gadi atpakaļ
vecāks
revīzija
d73171357d

+ 4 - 77
src/main/java/com/lemon/lifecenter/controller/ClinicController.java

@@ -46,58 +46,6 @@ public class ClinicController extends LifeCenterController {
 			@RequestParam(value = "page", required = true, defaultValue = "1") int page,
 			@RequestParam(value = "searchText", required = false, defaultValue = "") String searchText) {
 
-		boolean makePhrData = false;
-		boolean makeSymptomData = false;
-		boolean makeMemoData = false;
-
-		if (makePhrData) {
-			for (int i = 0; i < 2000; i++) {
-				java.util.Random random = new java.util.Random();
-				random.setSeed(System.currentTimeMillis());
-
-				int idx = random.nextInt(2344) + 1;
-				while ((idx > 56 && idx < 68) || (idx > 69 && idx < 114) || (idx > 145 && idx < 170)
-						|| (idx > 385 && idx < 388)) {
-					idx = random.nextInt(2344) + 1;
-				}
-
-				String[] typeArray = { "temperature", "oxygenSaturation", "pulseRate", "systolicBloodPressure",
-						"diastolicBloodPressure", "bloodSugar" };
-				int type = random.nextInt(5);
-				int value = random.nextInt(100);
-
-				PatientPHRHistoryDTO dto2 = new PatientPHRHistoryDTO();
-
-				dto2.setPatientIdx(idx);
-				dto2.setPhrType(typeArray[type]);
-				dto2.setPhrValue(value);
-				dto2.setRecordedByName("홍길동");
-
-				phrService.insertPHR(dto2);
-
-				System.err.println("idx : " + idx);
-			}
-		}
-
-		if (makeSymptomData) {
-			java.util.Random random = new java.util.Random();
-			random.setSeed(System.currentTimeMillis());
-
-			int idx = random.nextInt(2344) + 1;
-			String[] typeArray = { "temperature", "oxygenSaturation", "pulseRate", "systolicBloodPressure",
-					"diastolicBloodPressure", "bloodSugar" };
-			int type = random.nextInt(5);
-			int value = random.nextInt(100);
-
-			PatientPHRHistoryDTO dto2 = new PatientPHRHistoryDTO();
-
-			dto2.setPatientIdx(idx);
-			dto2.setPhrType(typeArray[type]);
-			dto2.setPhrValue(value);
-			dto2.setRecordedByName("홍길동");
-
-			phrService.insertPHR(dto2);
-		}
 
 		System.err.println("page : " + page);
 
@@ -192,19 +140,9 @@ public class ClinicController extends LifeCenterController {
 	}
 
 	@RequestMapping(value = "/api/phrData", method = RequestMethod.POST)
-	public @ResponseBody String insertPhrData(
-			@RequestParam(value = "patientIdx", required = true, defaultValue = "") int patientIdx,
-			@RequestParam(value = "phrType", required = true, defaultValue = "") String phrType,
-			@RequestParam(value = "phrValue", required = true, defaultValue = "") float phrValue) {
+	public @ResponseBody String insertPhrData(@ModelAttribute("dto") final PatientPHRHistoryDTO dto) {
 
 		try {
-			PatientPHRHistoryDTO dto = new PatientPHRHistoryDTO();
-
-			dto.setPatientIdx(patientIdx);
-			dto.setPhrType(phrType);
-			dto.setPhrValue(phrValue);
-			dto.setRecordedByName("홍길동");
-
 			phrService.insertPHR(dto);
 
 			JSONObject json = new JSONObject();
@@ -235,8 +173,7 @@ public class ClinicController extends LifeCenterController {
 	}
 
 	@RequestMapping(value = "/api/symptomData", method = RequestMethod.POST)
-	public @ResponseBody String symptomData(
-			@ModelAttribute("dto") final PatientSymptomSimDTO dto) {
+	public @ResponseBody String symptomData(@ModelAttribute("dto") final PatientSymptomSimDTO dto) {
 
 		try {
 			phrService.insertSymptom(dto);
@@ -262,25 +199,15 @@ public class ClinicController extends LifeCenterController {
 			@RequestParam(value = "patientIdx", required = true, defaultValue = "") int patientIdx) {
 
 		PatientMemoDTO dto = new PatientMemoDTO();
+		dto.setPatientIdx(patientIdx);
 
 		return clinicService.selectMemoList(dto);
 	}
 
 	@RequestMapping(value = "/api/memoData", method = RequestMethod.POST)
-	public @ResponseBody String memoData(
-			@RequestParam(value = "patientIdx", required = true, defaultValue = "") int patientIdx,
-			@RequestParam(value = "contents", required = true, defaultValue = "") String contents,
-			@RequestParam(value = "recordedById", required = true, defaultValue = "") String recordedById,
-			@RequestParam(value = "recordedByName", required = true, defaultValue = "") String recordedByName) {
+	public @ResponseBody String memoData(@ModelAttribute("dto") final PatientMemoDTO dto) {
 
 		try {
-			PatientMemoDTO dto = new PatientMemoDTO();
-			
-			dto.setPatientIdx(patientIdx);
-			dto.setContents(contents);
-			dto.setRecordedById(recordedById);
-			dto.setRecordedByName(recordedByName);
-
 			clinicService.insertMemo(dto);
 
 			JSONObject json = new JSONObject();

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

@@ -7,8 +7,8 @@ public class PatientPHRHistoryDTO {
 	
 	private int patientIdx;
 	private String phrType;
-	private float phrValue;
-	private float phrValue2;
+	private Float phrValue;
+	private Float phrValue2;
 	private String recordedByName;
 	private String recordedById;
 	private String createDate;
@@ -27,26 +27,26 @@ public class PatientPHRHistoryDTO {
 	public void setPhrType(String phrType) {
 		this.phrType = phrType;
 	}
-	public float getPhrValue() {
+	public Float getPhrValue() {
 		return phrValue;
 	}
-	public void setPhrValue(float phrValue) {
+	public void setPhrValue(Float phrValue) {
 		this.phrValue = phrValue;
 	}
-	public float getPhrValue2() {
+	public Float getPhrValue2() {
 		return phrValue2;
 	}
-	public void setPhrValue2(float phrValue2) {
+	public void setPhrValue2(Float phrValue2) {
 		this.phrValue2 = phrValue2;
 	}
 	public String getRecordedByName() {
-		return recordedByName;
+		return recordedByName != null ? recordedByName : "";
 	}
 	public void setRecordedByName(String recordedByName) {
 		this.recordedByName = recordedByName;
 	}
 	public String getRecordedById() {
-		return recordedById;
+		return recordedById != null ? recordedById : "";
 	}
 	public void setRecordedById(String recordedById) {
 		this.recordedById = recordedById;
@@ -69,4 +69,15 @@ public class PatientPHRHistoryDTO {
 	public void setLimitMax(int limitMax) {
 		this.limitMax = limitMax;
 	}
+	public String getPhrValueWithValue2() {
+		String valueString = "--";
+		if (this.phrValue != null) {
+			valueString = this.phrValue.toString();
+		}
+		String value2String = "--";
+		if (this.phrValue2 != null) {
+			value2String = this.phrValue2.toString();
+		}
+		return valueString + " / " + value2String;
+	}
 }

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

@@ -1,5 +1,7 @@
 package com.lemon.lifecenter.dto;
 
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
 import java.util.Date;
 
 import org.springframework.stereotype.Repository;
@@ -22,7 +24,6 @@ public class PatientPHRLatestDTO {
 	private Date systolicBloodPressureCreateDate;
 	private Integer diastolicBloodPressure;
 	private Date diastolicBloodPressureCreateDate;
-	private String bloodPressureDisplayString;
 	private Integer bloodSugar;
 	private Date bloodSugarCreateDate;
 	private int memoCount;
@@ -31,6 +32,25 @@ public class PatientPHRLatestDTO {
 	private int limit;
 	private int limitMax;
 	
+	private boolean needCheckValue(Date targetDate) {
+		boolean needCheck = true;
+		Calendar todayCalendar = Calendar.getInstance();
+		Calendar targetCalendar = Calendar.getInstance();
+		
+		try {
+			todayCalendar.setTime(new Date());
+			targetCalendar.setTime(targetDate);
+			
+			if (targetCalendar.equals(todayCalendar) && targetCalendar.get(Calendar.AM_PM) == todayCalendar.get(Calendar.AM_PM)) {
+				needCheck = false;
+			}
+		}
+		catch (Exception e) {
+			// 체크가 필요한 것으로 처리
+		}
+		
+		return needCheck;
+	}
 	public int getPatientIdx() {
 		return patientIdx;
 	}
@@ -69,7 +89,7 @@ public class PatientPHRLatestDTO {
 	}
 	public Date getTemperatureCreateDate() {
 		return temperatureCreateDate;
-	}	
+	}
 	public Integer getOxygenSaturation() {
 		return oxygenSaturation;
 	}
@@ -106,17 +126,6 @@ public class PatientPHRLatestDTO {
 	public Date getDiastolicBloodPressureCreateDate() {
 		return diastolicBloodPressureCreateDate;
 	}	
-	public String getBloodPressureDisplay() {
-		String systolicBloodPressureString = "--";
-		if (this.systolicBloodPressure != null) {
-			systolicBloodPressureString = this.systolicBloodPressure.toString();
-		}
-		String diastolicBloodPressureString = "--";
-		if (this.diastolicBloodPressure != null) {
-			diastolicBloodPressureString = this.diastolicBloodPressure.toString();
-		}
-		return systolicBloodPressureString + " / " + diastolicBloodPressureString;
-	}
 	public Integer getBloodSugar() {
 		return bloodSugar;
 	}
@@ -153,4 +162,61 @@ public class PatientPHRLatestDTO {
 	public void setLimitMax(int limitMax) {
 		this.limitMax = limitMax;
 	}
+	public String getBloodPressureDisplay() {
+		String systolicBloodPressureString = "--";
+		if (this.systolicBloodPressure != null) {
+			systolicBloodPressureString = this.systolicBloodPressure.toString();
+		}
+		String diastolicBloodPressureString = "--";
+		if (this.diastolicBloodPressure != null) {
+			diastolicBloodPressureString = this.diastolicBloodPressure.toString();
+		}
+		return systolicBloodPressureString + " / " + diastolicBloodPressureString;
+	}
+	public boolean getNeedTemperatureCheck() {
+		return needCheckValue(this.temperatureCreateDate);
+	}
+	public boolean getNeedBloodPressCheck() {
+		return needCheckValue(this.systolicBloodPressureCreateDate) || needCheckValue(this.diastolicBloodPressureCreateDate);
+	}
+	public boolean getNeedOxygenSaturationCheck() {
+		return needCheckValue(this.oxygenSaturationCreateDate);
+	}
+	public boolean getIsTemperatureWarning() {
+		if (this.temperature == null) return false;
+		
+		return this.temperature > 37.5;
+	}
+	public boolean getIsBloodPressureWarning() {
+		if (this.systolicBloodPressure == null || this.diastolicBloodPressure == null) return false;
+		
+		boolean highBP = this.systolicBloodPressure > 140 || this.diastolicBloodPressure > 90;
+		boolean lowBP = this.systolicBloodPressure < 80 || this.diastolicBloodPressure < 60;
+		
+		return highBP || lowBP;
+	}
+	public boolean getIsOxygenSaturationeWarning() {
+		if (this.oxygenSaturation == null) return false;
+		
+		return this.oxygenSaturation < 95;
+	}
+	public boolean getHasTodaySymptom() {
+		boolean ret = false;
+		Calendar todayCalendar = Calendar.getInstance();
+		Calendar symptomCalendar = Calendar.getInstance();
+		
+		try {
+			todayCalendar.setTime(new Date());
+			symptomCalendar.setTime(this.symptomLastDate);
+			
+			if (symptomCalendar.equals(todayCalendar)) {
+				ret = true;
+			}
+		}
+		catch (Exception e) {
+			// 없는 것으로 처리
+		}
+		
+		return ret;
+	}
 }

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

@@ -35,17 +35,17 @@ public class PHRService {
 				phrLatestDTO.setTemperature(dto.getPhrValue());
 				break;
 			case "oxygenSaturation":
-				phrLatestDTO.setOxygenSaturation((int) dto.getPhrValue());
+				phrLatestDTO.setOxygenSaturation(dto.getPhrValue().intValue());
 				break;
 			case "pulseRate":
-				phrLatestDTO.setPulseRate((int) dto.getPhrValue());
+				phrLatestDTO.setPulseRate(dto.getPhrValue().intValue());
 				break;
 			case "bloodPressure":
-				phrLatestDTO.setSystolicBloodPressure((int) dto.getPhrValue());
-				phrLatestDTO.setDiastolicBloodPressure((int) dto.getPhrValue2());
+				phrLatestDTO.setSystolicBloodPressure(dto.getPhrValue().intValue());
+				phrLatestDTO.setDiastolicBloodPressure(dto.getPhrValue2().intValue());
 				break;
 			case "bloodSugar":
-				phrLatestDTO.setBloodSugar((int) dto.getPhrValue());
+				phrLatestDTO.setBloodSugar(dto.getPhrValue().intValue());
 				break;
 		}
 		

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

@@ -4,7 +4,7 @@
 <mapper namespace="com.lemon.lifecenter.mapper.PatientMemoMapper">
 	<insert id="insertMemo" parameterType="PatientMemoDTO" useGeneratedKeys="true">
 	<![CDATA[
-	    INSERT INTO patient_phr_history (patient_idx, contents, recorded_by_name, recorded_by_id, create_date)
+	    INSERT INTO patient_memo (patient_idx, contents, recorded_by_name, recorded_by_id, create_date)
        	VALUE (#{patientIdx}, #{contents}, #{recordedByName}, #{recordedById}, NOW())
 	]]>
 	</insert>

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

@@ -63,7 +63,7 @@
 			patient_idx = #{patientIdx}
 		AND
 			phr_type = #{phrType}
-		ORDER BY create_date DESC
+		ORDER BY create_date ASC
 	]]>
     </select>
 </mapper>

+ 2 - 2
src/main/resources/mybatis/mapper/patient/patientPHRLatest.xml

@@ -112,7 +112,7 @@
 	<![CDATA[
 	    SELECT count(*) AS total
 		FROM patient_care c LEFT JOIN patient_phr_latest p ON p.patient_idx = c.patient_idx
-		WHERE c.center_code = #{centerCode} AND c.status = 'H'
+		WHERE c.center_code = #{centerCode} AND c.state = 'H'
 	]]>
 		<if test='searchText != null and searchText != ""'>
             <![CDATA[
@@ -142,7 +142,7 @@
 	    		(SELECT count(*) FROM patient_memo m WHERE m.patient_idx = c.patient_idx) AS memoCount,
 	    		(SELECT s.create_date FROM patient_symptom_sim s WHERE s.patient_idx = c.patient_idx AND DATEDIFF(DATE(s.create_date), CURDATE()) = 0 ORDER BY s.create_date DESC LIMIT 1) AS symptomLastDate
 		FROM patient_care c LEFT JOIN patient_phr_latest p ON p.patient_idx = c.patient_idx
-		WHERE c.center_code = #{centerCode} AND c.status = 'H'
+		WHERE c.center_code = #{centerCode} AND c.state = 'H'
 	]]>
 		<if test='searchText != null and searchText != ""'>
             <![CDATA[

+ 267 - 149
src/main/webapp/WEB-INF/jsp/clinic/info.jsp

@@ -2,16 +2,21 @@
 <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
 <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
 <jsp:include page="${data._INCLUDE}/header.jsp"></jsp:include>
+<link rel="stylesheet" href="/resources/bower_components/mdi/css/materialdesignicons.min.css">
 <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.9.4/Chart.min.js"></script>
 <script>
 
+/*
+ * 건강정보이력 탭 처리
+ */
+ 
 function handlePhrData() {
 	var phrType = $("#phrTypeSelect option:selected").val();
 	var phrValue = "";
 	if (phrType === "bloodPressure") {
 		phrValueSystolic = $("#phrValueSystolic").val();
 		phrValueDiastolic = $("#phrValueDiastolic").val();
-		phrValuePurse = $("#phrValuePurse").val();
+		phrValuePulse = $("#phrValuePulse").val();
 
 		if (!phrValueSystolic || phrValueSystolic.length === 0) {
 			alert("수축기 혈압을 입력해 주세요.");
@@ -21,39 +26,50 @@ function handlePhrData() {
 			alert("이완기 혈압을 입력해 주세요.");
 			return;
 		}
-		if (!phrValuePurse || phrValuePurse.length === 0) {
+		if (!phrValuePulse || phrValuePulse.length === 0) {
 			alert("맥박을 입력해 주세요.");
 			return;
 		}
 
-		createPhrData(${patientIdx}, "systolicBloodPressure", phrValueSystolic);
-		createPhrData(${patientIdx}, "diastolicBloodPressure", phrValueDiastolic);
-		createPhrData(${patientIdx}, "pulseRate", phrValuePurse);
+		createPhrData(${patientIdx}, "bloodPressure", phrValueSystolic, phrValueDiastolic, false);
+		createPhrData(${patientIdx}, "pulseRate", phrValuePulse);
+
+		$("#phrValueSystolic").val("");
+		$("#phrValueDiastolic").val("");
+		$("#phrValuePulse").val("");
 	}
 	else {
-		if (!phrValuePurse || phrValuePurse.length === 0) {
-			alert("값 입력해 주세요.");
+		phrValue = $("#phrValue").val();
+		
+		if (!phrValue || phrValue.length === 0) {
+			alert("값을 입력해 주세요.");
 			return;
 		}
-		phrValue = $("#phrValue").val();
 
 		createPhrData(${patientIdx}, phrType, phrValue);
+
+		$("#phrValue").val("");
 	}
+
+	$("#defaultModalPrimary_1").modal("hide");
 }
 
-function createPhrData(patienIdx, phrType, phrValue) {
+function createPhrData(patientIdx, phrType, phrValue, phrValue2, needRetrieveData=true, recordedById="${data._SES_ID}", recordedByName="${data._SES_NAME}") {
+	
 	$.ajax({
         url      : "./api/phrData",
-        data     : {patineIdx: patienIdx, phrType: phrType, phrValue: phrValue},
+        data     : {patientIdx: patientIdx, phrType: phrType, phrValue: phrValue, phrValue2: phrValue2, recordedById: recordedById, recordedByName: recordedByName},
         method   : "POST",
         dataType : "json",
         success  : function( datas ){
             console.log(datas);
 
-            retrievePhrData();
+            if (needRetrieveData) {
+                retrievePhrData();
+            }
         },
-        error : function(){
-            console.error('error!');
+        error : function(error){
+            alert(error.message);
         }
     }).done( function(){
         console.log('done!');
@@ -87,8 +103,16 @@ function retrievePhrData() {
 				datas.forEach(d => {
 					contents += "<tr>";
 					contents += "<td>" + d.createDate + "</td>";
+					if (phrType==="bloodPressure") {
+					contents += "<td><span class='text-danger'>" + parseInt(d.phrValue) + " / " + (isNaN(parseInt(d.phrValue2)) ? "--" : parseInt(d.phrValue2)) + "</span></td>";
+					}
+					else if (phrType==="temperature") {
 					contents += "<td><span class='text-danger'>" + d.phrValue + "</span></td>";
-					contents += "<td>" + d.recordedByName+"("+d.recordedById+")</td>";
+					}
+					else {
+					contents += "<td><span class='text-danger'>" + parseInt(d.phrValue) + "</span></td>";
+					}
+					contents += "<td>" + d.recordedByName + "</td>";
 					contents += "</tr>";
 				});
 			};
@@ -98,7 +122,107 @@ function retrievePhrData() {
 			$("#phrDataTable").html(html);
         },
         error : function(){
-            console.error('error!');
+        	alert(error.message);
+        }
+    }).done( function(){
+        console.log('done!');
+    });
+}
+
+function drawPhrChart(data, dataName) {
+
+	console.log("chart!" + data);
+	var xDatas = [];
+	var yDatas = [];
+	data.forEach(d=> {
+		xDatas.push(d.createDate);
+		yDatas.push(d.phrValue);
+	});
+	var ctx = document.getElementById("phrChart").getContext('2d');
+	var myChart = new Chart(ctx, {
+	    type: 'line',
+	    data: {
+	        labels: xDatas,
+	        datasets: [{
+	            label: dataName,
+	            data: yDatas,
+	            fill: false,
+ 	            backgroundColor: 'rgb(255, 99, 132)',
+	            borderColor: 'rgb(255, 99, 132)',
+	        }]
+	    },
+	    options: {
+
+	    }
+	});
+}
+
+/*
+ * 임상증상 탭 처리
+ */
+function handleSymptomData() {
+
+	if ($("input:checkbox[id='etcCheck']").is(":checked") && !$("#etcContent").val().trim()) {
+		alert("기타 증상이 체크되었습니다. 내용을 입력해 주세요.");
+		$("#etcContent").val("");
+		return;
+	}
+
+	var checkedCount = ($("#defaultModalPrimary_2 input[type='checkbox']:checked").length);
+	if (checkedCount === 0) {
+		alert("증상을 체크해 주세요.");
+		return;
+	}
+
+	var symptomObject = {
+		patientIdx: ${patientIdx},
+
+		coughCheck: $("input:checkbox[id='coughCheck']").is(":checked") ? "Y" : "N",
+		dyspneaCheck: $("input:checkbox[id='dyspneaCheck']").is(":checked") ? "Y" : "N",	
+		coldFitCheck: $("input:checkbox[id='coldFitCheck']").is(":checked") ? "Y" : "N",
+		musclePainCheck: $("input:checkbox[id='musclePainCheck']").is(":checked") ? "Y" : "N",
+		headacheCheck: $("input:checkbox[id='headacheCheck']").is(":checked") ? "Y" : "N",
+
+		soreThroatCheck: $("input:checkbox[id='soreThroatCheck']").is(":checked") ? "Y" : "N",
+		smellPalateCheck: $("input:checkbox[id='smellPalateCheck']").is(":checked") ? "Y" : "N",
+		fatigueCheck: $("input:checkbox[id='fatigueCheck']").is(":checked") ? "Y" : "N",
+		appetiteLossCheck: $("input:checkbox[id='appetiteLossCheck']").is(":checked") ? "Y" : "N",
+		sputumCheck: $("input:checkbox[id='sputumCheck']").is(":checked") ? "Y" : "N",
+
+		ocinCheck: $("input:checkbox[id='ocinCheck']").is(":checked") ? "Y" : "N",
+		vomitingCheck: $("input:checkbox[id='vomitingCheck']").is(":checked") ? "Y" : "N",
+		diarrheaCheck: $("input:checkbox[id='diarrheaCheck']").is(":checked") ? "Y" : "N",
+		dizzinessCheck: $("input:checkbox[id='dizzinessCheck']").is(":checked") ? "Y" : "N",
+		noseCheck: $("input:checkbox[id='noseCheck']").is(":checked") ? "Y" : "N",
+
+		etcCheck: $("input:checkbox[id='etcCheck']").is(":checked") ? "Y" : "N",
+		etcContent: $("#etcContent").val(),
+		recordedByName: "${data._SES_NAME}",
+		recordedById: "${data._SES_ID}",
+	}
+
+	createSymptomData(symptomObject);
+
+	$("#defaultModalPrimary_2 input[type='checkbox']:checked").prop("checked", false);
+	$("#etcContent").val("");
+
+	$("#defaultModalPrimary_2").modal("hide");
+}
+
+function createSymptomData(symptomObject) {
+	
+	$.ajax({
+        url      : "./api/symptomData",
+        data     : symptomObject,
+        method   : "POST",
+        dataType : "json",
+        success  : function( datas ){
+            console.log(datas);
+
+            retrieveSymptomData();
+        },
+        error : function(){
+        	alert(error.message);
         }
     }).done( function(){
         console.log('done!');
@@ -117,31 +241,32 @@ function retrieveSymptomData() {
             console.log(datas);
 
 			var html = "<tr><td colspan=18>데이터가 없습니다.</td></tr>" ;
+			var checkSymbol = '<i class="mdi mdi-check-bold"></i>';
 			if (datas.length > 0) {
 				html = "";
-				contents = datas.map(d => {
-					html = "<tr>";
+				contents = datas.forEach(d => {
+					html += "<tr>";
 					html += "<th>" + d.createDate + "</th>";
-					html += "<td>" + d.coughCheck + "</td>";
-					html += "<td>" + d.dyspneaCheck + "</td>";
-					html += "<td>" + d.coldFitCheck + "</td>";
-					html += "<td>" + d.musclePainCheck + "</td>";
+					html += "<td>" + (d.coughCheck === "Y" ? checkSymbol : "-") + "</td>";
+					html += "<td>" + (d.dyspneaCheck === "Y" ? checkSymbol : "-") + "</td>";
+					html += "<td>" + (d.coldFitCheck === "Y" ? checkSymbol : "-") + "</td>";
+					html += "<td>" + (d.musclePainCheck === "Y" ? checkSymbol : "-") + "</td>";
 					
-					html += "<td>" + d.headacheCheck + "</td>";
-					html += "<td>" + d.soreThroatCheck + "</td>";
-					html += "<td>" + d.smellPalateCheck + "</td>";
-					html += "<td>" + d.fatigueCheck + "</td>";
-					html += "<td>" + d.appetiteLossCheck + "</td>";
-
-					html += "<td>" + d.sputumCheck + "</td>";
-					html += "<td>" + d.ocinCheck + "</td>";
-					html += "<td>" + d.vomitingCheck + "</td>";
-					html += "<td>" + d.diarrheaCheck + "</td>";
-					html += "<td>" + d.dizzinessCheck + "</td>";
-
-					html += "<td>" + d.noseCheck + "</td>";
-					html += "<td>" + d.etcCheck + "(" + d.etcContent + ")</td>";
-					html += "<td>" + d.recordedByName + "(" + d.recordedById + ")</td>";
+					html += "<td>" + (d.headacheCheck === "Y" ? checkSymbol : "-") + "</td>";
+					html += "<td>" + (d.soreThroatCheck === "Y" ? checkSymbol : "-") + "</td>";
+					html += "<td>" + (d.smellPalateCheck === "Y" ? checkSymbol : "-") + "</td>";
+					html += "<td>" + (d.fatigueCheck === "Y" ? checkSymbol : "-") + "</td>";
+					html += "<td>" + (d.appetiteLossCheck === "Y" ? checkSymbol : "-") + "</td>";
+
+					html += "<td>" + (d.sputumCheck === "Y" ? checkSymbol : "-") + "</td>";
+					html += "<td>" + (d.ocinCheck === "Y" ? checkSymbol : "-") + "</td>";
+					html += "<td>" + (d.vomitingCheck === "Y" ? checkSymbol : "-") + "</td>";
+					html += "<td>" + (d.diarrheaCheck === "Y" ? checkSymbol : "-") + "</td>";
+					html += "<td>" + (d.dizzinessCheck === "Y" ? checkSymbol : "-") + "</td>";
+
+					html += "<td>" + (d.noseCheck === "Y" ? checkSymbol : "-") + "</td>";
+					html += "<td>" + (d.etcCheck === "Y" ? d.etcContent : "-") + "</td>";
+					html += "<td>" + d.recordedByName + "</td>";
 					html += "</tr>";
 				});
 			};
@@ -149,39 +274,85 @@ function retrieveSymptomData() {
 			$("#symptomDataTable > tbody").html(html);
         },
         error : function(){
-            console.error('error!');
+        	alert(error.message);
         }
     }).done( function(){
         console.log('done!');
     });
 }
 
-function drawPhrChart(data, dataName) {
+/*
+ * 임상증상 탭 처리
+ */
 
-	console.log("chart!" + data);
-	var xDatas = [];
-	var yDatas = [];
-	data.forEach(d=> {
-		xDatas.push(d.createDate);
-		yDatas.push(d.phrValue);
-	});
-	var ctx = document.getElementById("phrChart").getContext('2d');
-	var myChart = new Chart(ctx, {
-	    type: 'line',
-	    data: {
-	        labels: xDatas,
-	        datasets: [{
-	            label: dataName,
-	            data: yDatas,
-	            fill: false,
- 	            backgroundColor: 'rgb(255, 99, 132)',
-	            borderColor: 'rgb(255, 99, 132)',
-	        }]
-	    },
-	    options: {
+ function handleMemoData() {
 
-	    }
-	});
+	 var memoContent = $("#memoContent").val().trim();
+
+	if (!memoContent) {
+		alert("메모 내용을 입력해 주세요.");
+		$("#memoContent").val("");
+		return;
+	}
+
+	createMemoData(memoContent);
+
+	$("#memoContent").val("");
+
+	$("#defaultModalPrimaryMemo").modal("hide");
+}
+
+function createMemoData(memoContent) {
+	
+	$.ajax({
+        url      : "./api/memoData",
+        data     : {patientIdx:${patientIdx}, contents:memoContent, recordedByName:"${data._SES_NAME}", recordedById:"${data._SES_ID}"},
+        method   : "POST",
+        dataType : "json",
+        success  : function( datas ){
+            console.log(datas);
+
+            retrieveMemoData();
+        },
+        error : function(){
+        	alert(error.message);
+        }
+    }).done( function(){
+        console.log('done!');
+    });
+}
+
+function retrieveMemoData() {
+	var params = {patientIdx: ${patientIdx}};
+
+	$.ajax({
+        url      : "./api/memoDatas",
+        data     : params,
+        method   : "GET",
+        dataType : "json",
+        success  : function( datas ){
+            console.log(datas);
+
+			var html = "<tr><td colspan=3>데이터가 없습니다.</td></tr>" ;
+			if (datas.length > 0) {
+				html = "";
+				contents = datas.forEach(d => {
+					html += "<tr>";
+					html += "<td>" + d.createDate + "</td>";
+					html += "<td><pre>" + d.contents + "</pre></td>";
+					html += "<td>" + d.recordedByName + "</td>";
+					html += "</tr>";
+				});
+			};
+
+			$("#memoDataTable > tbody").html(html);
+        },
+        error : function(){
+        	alert(error.message);
+        }
+    }).done( function(){
+        console.log('done!');
+    });
 }
 
 $(document).ready(function() {
@@ -214,6 +385,9 @@ $(document).ready(function() {
 		else if (targetTab==="#tabSymptom") {
 			retrieveSymptomData();
 		}
+		else if (targetTab==="#tabMemo") {
+			retrieveMemoData();
+		}
 	});
 
 	// phrData 기록 추가 클릭 이벤트
@@ -226,7 +400,7 @@ $(document).ready(function() {
 			healthInfoHTML += '<th>체온</th>';
 			healthInfoHTML += '<td>';
 			healthInfoHTML += '	<div class="form-group mb-xl-0">';
-			healthInfoHTML += '		<input id="phrValue" class="form-control" type="text" placeholder="체온 입력">';
+			healthInfoHTML += '		<input id="phrValue" class="form-control" type="number" placeholder="체온 입력">';
 			healthInfoHTML += '	</div>';
 			healthInfoHTML += '</td>';
 		}
@@ -234,9 +408,9 @@ $(document).ready(function() {
 			healthInfoHTML += '<th>혈압/맥박</th>';
 			healthInfoHTML += '<td>';
 			healthInfoHTML += '	<div class="form-group mb-xl-0">';
-			healthInfoHTML += '		<input id="phrValueSystolic" class="form-control mb-2" type="text" placeholder="수축기 혈압 입력">';
-			healthInfoHTML += '		<input id="phrValueDiastolic" class="form-control mb-2" type="text" placeholder="이완기 혈압 입력">';
-			healthInfoHTML += '		<input id="phrValuPulse" class="form-control" type="text" placeholder="맥박 입력">';
+			healthInfoHTML += '		<input id="phrValueSystolic" class="form-control mb-2" type="number" placeholder="수축기 혈압 입력">';
+			healthInfoHTML += '		<input id="phrValueDiastolic" class="form-control mb-2" type="number" placeholder="이완기 혈압 입력">';
+			healthInfoHTML += '		<input id="phrValuePulse" class="form-control" type="number" placeholder="맥박 입력">';
 			healthInfoHTML += '	</div>';
 			healthInfoHTML += '</td>';
 		}
@@ -294,12 +468,14 @@ $(document).ready(function() {
 								</div>
 							</td>
 						</tr>
-						<tr class="healthInfo"></tr>
+						<tr class="healthInfo">
+						<!--  컨텐츠 동적 생성 -->
+						</tr>
 					</table>
 				</div>
 				<div class="modal-footer">
 					<button type="button" class="btn btn-outline-primary" data-dismiss="modal">취소</button>
-					<button type="button" class="btn btn-primary">등록</button>
+					<button type="button" class="btn btn-primary" onclick="handlePhrData()">등록</button>
 				</div>
 			</div>
 		</div>
@@ -332,99 +508,99 @@ $(document).ready(function() {
 							<td>
 								<div class="form-group mb-xl-0">
 									<label class="form-check form-check-inline">
-										<input id="" class="form-check-input" type="checkbox">
+										<input id="coughCheck" class="form-check-input" type="checkbox">
 										<span class="form-check-label">
 											기침
 										</span>
 									</label>
 									<label class="form-check form-check-inline">
-										<input id="" class="form-check-input" type="checkbox">
+										<input id="dyspneaCheck" class="form-check-input" type="checkbox">
 										<span class="form-check-label">
 											호흡곤란
 										</span>
 									</label>
 									<label class="form-check form-check-inline">
-										<input id="" class="form-check-input" type="checkbox">
+										<input id="coldFitCheck" class="form-check-input" type="checkbox">
 										<span class="form-check-label">
 											오한
 										</span>
 									</label>
 									<label class="form-check form-check-inline">
-										<input id="" class="form-check-input" type="checkbox">
+										<input id="musclePainCheck" class="form-check-input" type="checkbox">
 										<span class="form-check-label">
 											근육통
 										</span>
 									</label>
 									<label class="form-check form-check-inline">
-										<input id="" class="form-check-input" type="checkbox">
+										<input id="headacheCheck" class="form-check-input" type="checkbox">
 										<span class="form-check-label">
 											두통
 										</span>
 									</label>
 									<label class="form-check form-check-inline">
-										<input id="" class="form-check-input" type="checkbox">
+										<input id="soreThroatCheck" class="form-check-input" type="checkbox">
 										<span class="form-check-label">
 											인후통
 										</span>
 									</label>
 									<label class="form-check form-check-inline">
-										<input id="" class="form-check-input" type="checkbox">
+										<input id="smellPalateCheck" class="form-check-input" type="checkbox">
 										<span class="form-check-label">
 											후각/미각 손실
 										</span>
 									</label>
 									<label class="form-check form-check-inline">
-										<input id="" class="form-check-input" type="checkbox">
+										<input id="fatigueCheck" class="form-check-input" type="checkbox">
 										<span class="form-check-label">
 											피로
 										</span>
 									</label>
 									<label class="form-check form-check-inline">
-										<input id="" class="form-check-input" type="checkbox">
+										<input id="appetiteLossCheck" class="form-check-input" type="checkbox">
 										<span class="form-check-label">
 											식욕감소
 										</span>
 									</label>
 									<label class="form-check form-check-inline">
-										<input id="" class="form-check-input" type="checkbox">
+										<input id="sputumCheck" class="form-check-input" type="checkbox">
 										<span class="form-check-label">
 											가래
 										</span>
 									</label>
 									<label class="form-check form-check-inline">
-										<input id="" class="form-check-input" type="checkbox">
+										<input id="ocinCheck" class="form-check-input" type="checkbox">
 										<span class="form-check-label">
-											오
+											오
 										</span>
 									</label>
 									<label class="form-check form-check-inline">
-										<input id="" class="form-check-input" type="checkbox">
+										<input id="vomitingCheck" class="form-check-input" type="checkbox">
 										<span class="form-check-label">
 											구토
 										</span>
 									</label>
 									<label class="form-check form-check-inline">
-										<input id="" class="form-check-input" type="checkbox">
+										<input id="diarrheaCheck" class="form-check-input" type="checkbox">
 										<span class="form-check-label">
 											설사
 										</span>
 									</label>
 									<label class="form-check form-check-inline">
-										<input id="" class="form-check-input" type="checkbox">
+										<input id="dizzinessCheck" class="form-check-input" type="checkbox">
 										<span class="form-check-label">
 											어지러움
 										</span>
 									</label>
 									<label class="form-check form-check-inline">
-										<input id="" class="form-check-input" type="checkbox">
+										<input id="noseCheck" class="form-check-input" type="checkbox">
 										<span class="form-check-label">
 											콧물/코막힘
 										</span>
 									</label>
 									<label class="form-check form-check-inline">
-										<input id="" class="form-check-input" type="checkbox">
+										<input id="etcCheck" class="form-check-input" type="checkbox">
 										<span class="form-check-label">
-											기타 ( <input type="text" id="" class="form-control form-control-sm w150" value="" placeholder="증상 내용"> )
+											기타 ( <input type="text" id="etcContent" class="form-control form-control-sm w150" value="" placeholder="증상 내용"> )
 										</span>
 									</label>
 								</div>
@@ -434,7 +610,7 @@ $(document).ready(function() {
 				</div>
 				<div class="modal-footer">
 					<button type="button" class="btn btn-outline-primary" data-dismiss="modal">취소</button>
-					<button type="button" class="btn btn-primary">등록</button>
+					<button type="button" class="btn btn-primary" onclick="handleSymptomData()">등록</button>
 				</div>
 			</div>
 		</div>
@@ -466,7 +642,7 @@ $(document).ready(function() {
 							<th>내용</th>
 							<td>
 								<div class="form-row">
-									<textarea class="form-control" rows="2" placeholder="내용을 입력하세요"></textarea>
+									<textarea id="memoContent" class="form-control" rows="2" placeholder="내용을 입력하세요"></textarea>
 								</div>
 							</td>
 						</tr>
@@ -474,7 +650,7 @@ $(document).ready(function() {
 				</div>
 				<div class="modal-footer">
 					<button type="button" class="btn btn-outline-primary" data-dismiss="modal">취소</button>
-					<button type="button" class="btn btn-primary">등록</button>
+					<button type="button" class="btn btn-primary" onclick="handleMemoData()">등록</button>
 				</div>
 			</div>
 		</div>
@@ -670,7 +846,7 @@ $(document).ready(function() {
 										<h1 class="h4">
 											- 건강정보 조회 <label> <select class="custom-select ml-1 form-control" id=phrTypeSelect name="inputState" onchange="retrievePhrData()">
 													<option value="temperature" selected>체온</option>
-													<option value="pulseRate">혈압</option>
+													<option value="bloodPressure">혈압</option>
 													<option value="oxygenSaturation">산소포화도</option>
 											</select>
 											</label> <label class="ml-1">
@@ -698,7 +874,7 @@ $(document).ready(function() {
 																<tr>
 																	<td><c:out value="${phr.createDate}" /></td>
 																	<td><span class="text-danger"><c:out value="${phr.phrValue} ℃" /></span></td>
-																	<td><c:out value="${phr.recordedByName}(${phr.recordedById})" /></td>
+																	<td><c:out value="${phr.recordedByName}" /></td>
 																</tr>
 															</c:forEach>
 														</c:when>
@@ -750,29 +926,6 @@ $(document).ready(function() {
 													</tr>
 												</thead>
 												<tbody>
-													<tr>
-														<th></th>
-														<td></td>
-														<td></td>
-														<td></td>
-														<td></td>
-
-														<td></td>
-														<td></td>
-														<td></td>
-														<td></td>
-														<td></td>
-
-														<td></td>
-														<td></td>
-														<td></td>
-														<td></td>
-														<td></td>
-
-														<td></td>
-														<td><span class="text-danger"></span></td>
-														<td></td>
-													</tr>
 												</tbody>
 											</table>
 										</div>
@@ -787,7 +940,7 @@ $(document).ready(function() {
 									</div>
 									<div class="card-body">
 										<div class="table-responsive">
-											<table class="table data-table text-center">
+											<table id="memoDataTable" class="table data-table text-center">
 												<thead>
 													<tr>
 														<th>기록일시</th>
@@ -796,41 +949,6 @@ $(document).ready(function() {
 													</tr>
 												</thead>
 												<tbody>
-													<tr>
-														<td>2020-10-10 10:25</td>
-														<td>소화가 잘 안된다고 소화제 복용 문의...</td>
-														<td>홍길동</td>
-													</tr>
-													<tr>
-														<td>2020-10-10 10:25</td>
-														<td>소화가 잘 안된다고 소화제 복용 문의...</td>
-														<td>홍길동</td>
-													</tr>
-													<tr>
-														<td>2020-10-10 10:25</td>
-														<td>소화가 잘 안된다고 소화제 복용 문의...</td>
-														<td>홍길동</td>
-													</tr>
-													<tr>
-														<td>2020-10-10 10:25</td>
-														<td>소화가 잘 안된다고 소화제 복용 문의...</td>
-														<td>홍길동</td>
-													</tr>
-													<tr>
-														<td>2020-10-10 10:25</td>
-														<td>소화가 잘 안된다고 소화제 복용 문의...</td>
-														<td>홍길동</td>
-													</tr>
-													<tr>
-														<td>2020-10-10 10:25</td>
-														<td>소화가 잘 안된다고 소화제 복용 문의...</td>
-														<td>홍길동</td>
-													</tr>
-													<tr>
-														<td>2020-10-10 10:25</td>
-														<td>소화가 잘 안된다고 소화제 복용 문의...</td>
-														<td>홍길동</td>
-													</tr>
 												</tbody>
 											</table>
 										</div>

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

@@ -1,6 +1,5 @@
 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
 <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
-<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
 <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
 <jsp:include page="${data._INCLUDE}/header.jsp"></jsp:include>
 <link rel="stylesheet" href="/resources/bower_components/mdi/css/materialdesignicons.min.css">
@@ -15,26 +14,22 @@ var reloadTimer = null;
 
 function changeReloadInterval() {
 	reloadIntervalTime = $("#reloadIntervalSelect option:selected").val();
-	alert(reloadIntervalTime + "초마다 반복 조회 합니다.");
 }
 
 function activeReloadTimer() {	
 	if (reloadIntervalTime) {
 		if (reloadTimer) {
-			alert("이미 반복 조회가 활성화되어 있어 반복 조회를 비활성화 합니다.");
 			deactiveReloadTimer();
 		}
 		
 		reloadTimer = setInterval(function() {
 			nextPage();
 		}, reloadIntervalTime * 1000);
-		alert("반복 조회가 활성화 되었습니다.");
 
 		return true;
 	}
 	else {
-		alert("반복 조회 주기를 설정해 주세요.");
-
+		
 		return false;
 	}
 }
@@ -43,10 +38,6 @@ function deactiveReloadTimer() {
 	if (reloadTimer) {
 		clearInterval(reloadTimer);
 		reloadTimer = null;
-		alert("반복 조회가 비활성화 되었습니다.");
-	}
-	else {
-		alert("활성화된 반복 조회가 없습니다.");
 	}
 }
 
@@ -73,29 +64,37 @@ function retrieveStateData(page) {
 			if (datas.length > 0) {
 				html = "";
 				datas.forEach(d => {
-					var danger = d.temperature > 37 ? "danger" : "";
-					var temperature_step = d.temperature > 37 ? "step_two" : "step_one";
-					var systolicBloodPressure_step = d.systolicBloodPressure > 37 ? "step_two" : "step_one";
-					var oxygenSaturation_step = d.oxygenSaturation > 37 ? "step_two" : "step_one";
+					var danger = (d.isTemperatureWarning || d.isBloodPressureWarning || d.isOxygenSaturationeWarning) ? "danger" : "";
+					var temperatureStep = d.isTemperatureWarning ? "step_two" : "step_one";
+					var bloodPressureStep = d.isBloodPressureWarning ? "step_two" : "step_one";
+					var oxygenSaturationStep = d.isOxygenSaturationeWarning ? "step_two" : "step_one";
+					var temperatureCheck = d.needTemperatureCheck ? "timeover" : "";
+					var bloodPressureCheck = d.needBloodPressCheck ? "timeover" : "";
+					var oxygenSaturationCheck = d.needOxygenSaturationCheck ? "timeover" : "";
 					
-					var temperature = (d.temperature || "--") + '℃';
-					var bloodPressure = (d.systolicBloodPressure || "--") + " / " + (d.diastolicBloodPressure || "--");
-					var oxygenSaturation = (d.oxygenSaturation || "--") + "%";
+					var temperature = (d.temperature || "--") + '  ';
+					var bloodPressure = (d.bloodPressureDisplay) + " ";
+					var oxygenSaturation = (d.oxygenSaturation || "--") + " % ";
 					html += '<div class="col-lg-2 col-md-6 mb-4">';
 					html += '	<div class="patients-stats">';
 					html += '		<div class="name">';
-					html += '			<a href="">'+d.roomNumber+'('+d.patientName+')</a>';
+					html += '			<a href="./info?patientIdx='+d.patientIdx+'">'+d.roomNumber+'('+d.patientName+')</a>';
 					html += '			<div class="check">';
-					html += '				<ul><li>';
-					html += '					<a href="javscript:;" class="symptom"><i class="align-middle ml-2 fas fa-fw fa-user-plus"></i></a>';
-					html += '				</li></ul>';
+					html += '				<ul>';
+					if (d.memoCount > 0) {
+					html += '					<li><a href="javscript:;" class="memo"><i class="align-middle ml-2 fas fa-fw fa-edit"></i></a></li>';
+					}
+					if (d.hasTodaySymptom) {
+					html += '					<li><a href="javscript:;" class="symptom"><i class="align-middle ml-2 fas fa-fw fa-user-plus"></i></a></li>';
+					}
+					html += '				</ul>';
 					html += '			</div>';
 					html += '		</div>';
 					html += '      <div class="stats '+danger+'">';
 					html += '			<ul>';
-					html += '				<li class="fever '+temperature_step+' timeover">'+temperature+'</li>';
-					html += '				<li class="bloodPressure '+systolicBloodPressure_step+'">'+bloodPressure+'</li>';
-					html += '				<li class="oxygen '+oxygenSaturation_step+'">'+oxygenSaturation+'</li>';
+					html += '				<li class="fever '+temperatureStep+' '+temperatureCheck+'">'+temperature+'</li>';
+					html += '				<li class="bloodPressure '+bloodPressureStep+' '+bloodPressureCheck+'">'+bloodPressure+'</li>';
+					html += '				<li class="oxygen '+oxygenSaturationStep+' '+oxygenSaturationCheck+'">'+oxygenSaturation+'</li>';
 					html += '			</ul>';
 					html += '		</div>';
 					html += '	</div>';
@@ -266,43 +265,35 @@ $(document).ready(function() {
 										<div class="blankItem">표시할 데이터가 없습니다.</div>
 										</c:when>
 										<c:otherwise>
-										<jsp:useBean id="now" class="java.util.Date" />
-										<fmt:formatDate value="${now}" pattern="yyyyMMdd" var="nowDateString" />
 										<c:forEach var="patient" items="${items}" varStatus="status">
-											<fmt:formatDate value="${patient.symptomLastDate}" pattern="yyyyMMdd" var="symptomLastDateString" />
-											<fmt:formatDate value="${patient.temperatureCreateDate}" pattern="yyyyMMdd" var="temperatureDateString" />
-											<fmt:formatDate value="${patient.systolicBloodPressureCreateDate}" pattern="yyyyMMdd" var="systolicBloodPressureDateString" />
-											<fmt:formatDate value="${patient.oxygenSaturationCreateDate}" pattern="yyyyMMdd" var="oxygenSaturationDateString" />
 											<c:set var="title" value="${patient.roomNumber}(${patient.patientName})" />
 											<c:set var="viewLink" value="./info?patientIdx=${patient.patientIdx}" />
-											<c:set var="showMemoIcon" value="${patient.memoCount > 0}" />
-											<c:set var="showSymptomIcon" value="${symptomLastDateString == nowDateString}" />
-											<c:set var="temperature_step" value="${patient.temperature > 37 ? 'step_two' : 'step_one'}" />
-											<c:set var="temperature_overtime" value="${temperatureDateString == nowDateString ? '' : 'overtime'}" />
-											<c:set var="bloodPressure_step" value="${patient.temperature > 37 ? 'step_two' : 'step_one'}" />
-											<c:set var="bloodPressure_overtime" value="${temperatureDateString == nowDateString ? '' : 'overtime'}" />
-											<c:set var="oxygenSaturation_step" value="${patient.temperature > 37 ? 'step_two' : 'step_one'}" />
-											<c:set var="oxygenSaturation_overtime" value="${temperatureDateString == nowDateString ? '' : 'overtime'}" />
+											<c:set var="temperatureStep" value="${patient.isTemperatureWarning ? 'step_two' : 'step_one'}" />
+											<c:set var="bloodPressureStep" value="${patient.isBloodPressureWarning ? 'step_two' : 'step_one'}" />
+											<c:set var="oxygenSaturationStep" value="${patient.isOxygenSaturationeWarning ? 'step_two' : 'step_one'}" />
+											<c:set var="temperatureCheck" value="${patient.needTemperatureCheck ? 'timeover' : ''}" />
+											<c:set var="bloodPressureCheck" value="${patient.needBloodPressCheck ? 'timeover' : ''}" />
+											<c:set var="oxygenSaturationCheck" value="${patient.needOxygenSaturationCheck ? 'timeover' : ''}" />
 											<div class="col-lg-2 col-md-6 mb-4">
 												<div class="patients-stats">
 													<div class="name">
 														<a href="${viewLink}"><c:out value="${title}" /></a>
 														<div class="check">
 															<ul>
-																<c:if test="${showMemoIcon}">
+																<c:if test="${patient.memoCount > 0}">
 																<li><a href="javscript:;" class="memo"><i class="align-middle ml-2 fas fa-fw fa-edit"></i></a></li>
 																</c:if>
-																<c:if test="${showSymptomIcon}">
+																<c:if test="${patient.hasTodaySymptom}">
 																<li><a href="javscript:;" class="symptom"> <i class="align-middle ml-2 fas fa-fw fa-user-plus"></i></a></li>
 																</c:if>
 															</ul>
 														</div>
 													</div>
-													<div class="stats ${patient.temperature > 37 ? 'danger' : '' }">
+													<div class="stats ${patient.isTemperatureWarning || patient.isBloodPressureWarning || patient.isOxygenSaturationeWarning ? 'danger' : '' }">
 														<ul>
-															<li class="fever ${temperature_step} ${temperature_overtime}"><c:out value="${patient.temperature != null ? patient.temperature : '--'} ℃" /></li>
-															<li class="bloodPressure ${systolicBloodPressureDateString == nowDateString ? 'step_one' : ''}"><c:out value='${patient.bloodPressureDisplay}' /></li>
-															<li class="oxygen ${oxygenSaturationDateString == nowDateString ? 'step_one' : ''}"><c:out value="${patient.oxygenSaturation != null ? patient.oxygenSaturation : '--'} %" />
+															<li class="fever ${temperatureStep} ${temperatureCheck}"><c:out value="${patient.temperature != null ? patient.temperature : '--'} ℃ " /></li>
+															<li class="bloodPressure ${bloodPressureStep} ${bloodPressureCheck}"><c:out value='${patient.bloodPressureDisplay} ' /></li>
+															<li class="oxygen ${oxygenSaturationStep} ${oxygenSaturationCheck}"><c:out value="${patient.oxygenSaturation != null ? patient.oxygenSaturation : '--'} %" />
 														</ul>
 													</div>
 												</div>

+ 11 - 6
src/main/webapp/resources/css/common/classic.css

@@ -76,19 +76,23 @@
 .mobile-table th span.fix, .mobile-table td span.fix { color:#FF0000; margin-right: 5px; }
 .sidebar + .main .footer { position: relative }
 .content { margin-bottom: 50px; }
-.tab-nav { margin: -24px; margin-bottom: 24px; background-color: #f5f9fc; padding: 0;}
-.tab-nav .tab-item { list-style: none; font-size: 18px; padding: 15px 24px; color: #999999; cursor: pointer; }
-.tab-nav .tab-item.active { background-color: #fff; border-radius: .25rem; color: #000; cursor: default; }
+.tab-nav { margin: -24px; margin-bottom: 24px; background-color: #f5f9fc; padding: 0; padding-bottom: 5px; box-shadow: 0 -3px 2px rgba(0,0,0,0.1) inset; overflow: hidden; }
+.tab-nav .tab-item { position: relative; list-style: none; font-size: 18px; padding: 15px 24px; color: #999999; overflow: hidden; cursor: pointer; }
+.tab-nav .tab-item.active { background-color: #fff; border-radius: .25rem; color: #000; cursor: default; box-shadow: 1.5px 3px 2px rgba(0,0,0,0.1) }
+.tab-nav .tab-item.active:before { content: ''; position: absolute; top: 0; left: 0; background-color: #47bac1; width: 5px; height: 100%; }
 .tab-nav .tab-item:hover { color: #000;}
 .tab { visibility: hidden; height: 0; overflow: hidden; opacity: 0; margin: 0; transition: all 0.2s ease-in-out; -webkit-transition: all 0.2s ease-in-out; -moz-transition: all 0.2s ease-in-out; -ms-transition: all 0.2s ease-in-out; -o-transition: all 0.2s ease-in-out; }
 .tab.in { visibility: visible; height: unset; overflow: auto; opacity: 1 }
 .tab .card-header .h4 { padding-top: 10px; }
+.tab i.mdi { color: #0063dc; }
 @media screen and (min-width:992px) { 
-  .mobile-table th, .mobile-table td { float: inherit; width: inherit; }
+  .mobile-table th, .mobile-table td { float: inherit; width: inherit; } 
   .sidebar + .main .footer { position: fixed; width: calc(100% - 256px); bottom: 0; transition: width 0.35s ease-in-out; -webkit-transition: width 0.35s ease-in-out; -moz-transition: width 0.35s ease-in-out; -ms-transition: width 0.35s ease-in-out; -o-transition: width 0.35s ease-in-out; }
   .sidebar.toggled + .main .footer { position: fixed; width: 100%; bottom: 0}
+  .tab-nav { padding: 0 }
   .tab-nav .tab-item { float: left; padding: 24px; }
-  .tab-nav .tab-item.active { background-color: #fff; border-radius: .25rem, .25rem, 0, 0 ; -webkit-border-radius: .25rem, .25rem, 0, 0 ; -moz-border-radius: .25rem, .25rem, 0, 0 ; -ms-border-radius: .25rem, .25rem, 0, 0 ; -o-border-radius: .25rem, .25rem, 0, 0 ; }
+  .tab-nav .tab-item.active { background-color: #fff; border-radius: .25rem .25rem 0 0 ; -webkit-border-radius: .25rem .25rem 0 0 ; -moz-border-radius: .25rem .25rem 0 0 ; -ms-border-radius: .25rem .25rem 0 0 ; -o-border-radius: .25rem .25rem 0 0 ; }
+  .tab-nav .tab-item.active:before { width: 100%; height: 5px; }
 }
 .patients-stats { position: relative; border: 1px solid #DDDDDD; border-radius: 5px; overflow: hidden; cursor: pointer !important;}
 .patients-stats:hover:before { content: ''; position: absolute; width: 100%; height: 100%; top: 0; left: 0; background-color: rgba(0,0,0,0.03); cursor: pointer;}
@@ -108,7 +112,7 @@
 .patients-stats .stats ul { padding: 0px; margin: 0px; }
 .patients-stats .stats li { list-style: none; font-size: 16px; color:#BBBBBB; text-align: right; line-height: 20px; height: 20px; padding-left: 20px; margin: 5px 0; background-repeat: no-repeat; background-position: left center; background-size: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;}
 .patients-stats .stats li.step_one { color:#40A3DF; }
-.patients-stats .stats li.step_two { color:#FF0000; }
+.patients-stats .stats li.step_two, .patients-stats .stats li.step_two.timeover { color:#FF0000; }
 .patients-stats .stats li.timeover { color:#BBBBBB; }
 .patients-stats .stats li:after { content: '\F134'; color:#3faf45; font-family: 'Material Design Icons'; font-size: 12px; vertical-align: middle; }
 .patients-stats .stats li.timeover:after { content: '\F130'; color:#BBBBBB; }
@@ -139,5 +143,6 @@
 .pagination > li > a { color: inherit; text-decoration: none; cursor: inherit; }
 #playButton.disabled, #pauseButton.disabled { display:none; }
 #tabMemo th:nth-child(2), #tabMemo td:nth-child(2) { text-align: left; }
+#defaultModalPrimary_2 .form-check-inline { min-width: 110px; }
 .error{color:red;margin:0;}
 .mt8{margin-top:8px;}