|
@@ -1,8 +1,10 @@
|
|
|
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
|
|
|
+<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
|
|
|
<%@ 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="/resources/bower_components/moment/moment.min.js"></script>
|
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.9.4/Chart.min.js"></script>
|
|
|
<script>
|
|
|
|
|
@@ -16,7 +18,6 @@ function handlePhrData() {
|
|
|
if (phrType === "bloodPressure") {
|
|
|
phrValueSystolic = $("#phrValueSystolic").val();
|
|
|
phrValueDiastolic = $("#phrValueDiastolic").val();
|
|
|
- phrValuePulse = $("#phrValuePulse").val();
|
|
|
|
|
|
if (!phrValueSystolic || phrValueSystolic.length === 0) {
|
|
|
alert("수축기 혈압을 입력해 주세요.");
|
|
@@ -26,17 +27,11 @@ function handlePhrData() {
|
|
|
alert("이완기 혈압을 입력해 주세요.");
|
|
|
return;
|
|
|
}
|
|
|
- if (!phrValuePulse || phrValuePulse.length === 0) {
|
|
|
- alert("맥박을 입력해 주세요.");
|
|
|
- return;
|
|
|
- }
|
|
|
|
|
|
- createPhrData(${patientIdx}, "bloodPressure", phrValueSystolic, phrValueDiastolic, false);
|
|
|
- createPhrData(${patientIdx}, "pulseRate", phrValuePulse);
|
|
|
+ createPhrData(${patientIdx}, "bloodPressure", phrValueSystolic, phrValueDiastolic);
|
|
|
|
|
|
$("#phrValueSystolic").val("");
|
|
|
$("#phrValueDiastolic").val("");
|
|
|
- $("#phrValuePulse").val("");
|
|
|
}
|
|
|
else {
|
|
|
phrValue = $("#phrValue").val();
|
|
@@ -62,7 +57,6 @@ function createPhrData(patientIdx, phrType, phrValue, phrValue2, needRetrieveDat
|
|
|
method : "POST",
|
|
|
dataType : "json",
|
|
|
success : function( datas ){
|
|
|
- console.log(datas);
|
|
|
|
|
|
if (needRetrieveData) {
|
|
|
retrievePhrData();
|
|
@@ -72,7 +66,6 @@ function createPhrData(patientIdx, phrType, phrValue, phrValue2, needRetrieveDat
|
|
|
alert(error.message);
|
|
|
}
|
|
|
}).done( function(){
|
|
|
- console.log('done!');
|
|
|
});
|
|
|
}
|
|
|
|
|
@@ -87,9 +80,13 @@ function retrievePhrData() {
|
|
|
method : "GET",
|
|
|
dataType : "json",
|
|
|
success : function( datas ){
|
|
|
- console.log(datas);
|
|
|
|
|
|
- drawPhrChart(datas, phrName);
|
|
|
+ if (phrType==="bloodPressure") {
|
|
|
+ drawBPChart(datas);
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ drawPhrChart(datas, phrName);
|
|
|
+ }
|
|
|
|
|
|
var html = "<thead><tr>";
|
|
|
html += "<th>기록일시</th>";
|
|
@@ -101,19 +98,22 @@ function retrievePhrData() {
|
|
|
if (datas.length > 0) {
|
|
|
contents = "";
|
|
|
datas.forEach(d => {
|
|
|
- contents += "<tr>";
|
|
|
- contents += "<td>" + d.createDate + "</td>";
|
|
|
+ var row = "";
|
|
|
+ row += "<tr>";
|
|
|
+ row += "<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>";
|
|
|
+ row += "<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>";
|
|
|
+ row += "<td><span class='text-danger'>" + d.phrValue + "</span></td>";
|
|
|
}
|
|
|
else {
|
|
|
- contents += "<td><span class='text-danger'>" + parseInt(d.phrValue) + "</span></td>";
|
|
|
+ row += "<td><span class='text-danger'>" + parseInt(d.phrValue) + "</span></td>";
|
|
|
}
|
|
|
- contents += "<td>" + d.recordedByName + "</td>";
|
|
|
- contents += "</tr>";
|
|
|
+ row += "<td>" + d.recordedByName + "</td>";
|
|
|
+ row += "</tr>";
|
|
|
+
|
|
|
+ contents = row + contents;
|
|
|
});
|
|
|
};
|
|
|
html += contents;
|
|
@@ -125,17 +125,16 @@ function retrievePhrData() {
|
|
|
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);
|
|
|
+ var t = moment(d.createDate).format("MM-DD HH:mm:ss");
|
|
|
+ xDatas.push(t);
|
|
|
yDatas.push(d.phrValue);
|
|
|
});
|
|
|
var ctx = document.getElementById("phrChart").getContext('2d');
|
|
@@ -157,6 +156,42 @@ function drawPhrChart(data, dataName) {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+function drawBPChart(data) {
|
|
|
+
|
|
|
+ var xDatas = [];
|
|
|
+ var y1Datas = [];
|
|
|
+ var y2Datas = [];
|
|
|
+ data.forEach(d=> {
|
|
|
+ var t = moment(d.createDate).format("MM-DD HH:mm:ss");
|
|
|
+ xDatas.push(t);
|
|
|
+ y1Datas.push(d.phrValue);
|
|
|
+ y2Datas.push(d.phrValue2);
|
|
|
+ });
|
|
|
+ var ctx = document.getElementById("phrChart").getContext('2d');
|
|
|
+ var myChart = new Chart(ctx, {
|
|
|
+ type: 'line',
|
|
|
+ data: {
|
|
|
+ labels: xDatas,
|
|
|
+ datasets: [{
|
|
|
+ label: "수축기 혈압",
|
|
|
+ data: y1Datas,
|
|
|
+ fill: false,
|
|
|
+ backgroundColor: 'rgb(255, 99, 132)',
|
|
|
+ borderColor: 'rgb(255, 99, 132)',
|
|
|
+ },{
|
|
|
+ label: "이완기 혈압",
|
|
|
+ data: y2Datas,
|
|
|
+ fill: false,
|
|
|
+ backgroundColor: 'rgb(255, 99, 132)',
|
|
|
+ borderColor: 'rgb(255, 99, 132)',
|
|
|
+ }]
|
|
|
+ },
|
|
|
+ options: {
|
|
|
+
|
|
|
+ }
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
/*
|
|
|
* 임상증상 탭 처리
|
|
|
*/
|
|
@@ -217,7 +252,6 @@ function createSymptomData(symptomObject) {
|
|
|
method : "POST",
|
|
|
dataType : "json",
|
|
|
success : function( datas ){
|
|
|
- console.log(datas);
|
|
|
|
|
|
retrieveSymptomData();
|
|
|
},
|
|
@@ -225,7 +259,6 @@ function createSymptomData(symptomObject) {
|
|
|
alert(error.message);
|
|
|
}
|
|
|
}).done( function(){
|
|
|
- console.log('done!');
|
|
|
});
|
|
|
}
|
|
|
|
|
@@ -238,7 +271,6 @@ function retrieveSymptomData() {
|
|
|
method : "GET",
|
|
|
dataType : "json",
|
|
|
success : function( datas ){
|
|
|
- console.log(datas);
|
|
|
|
|
|
var html = "<tr><td colspan=18>데이터가 없습니다.</td></tr>" ;
|
|
|
var checkSymbol = '<i class="mdi mdi-check-bold"></i>';
|
|
@@ -277,12 +309,11 @@ function retrieveSymptomData() {
|
|
|
alert(error.message);
|
|
|
}
|
|
|
}).done( function(){
|
|
|
- console.log('done!');
|
|
|
});
|
|
|
}
|
|
|
|
|
|
/*
|
|
|
- * 임상증상 탭 처리
|
|
|
+ * 메모 탭 처리
|
|
|
*/
|
|
|
|
|
|
function handleMemoData() {
|
|
@@ -310,7 +341,6 @@ function createMemoData(memoContent) {
|
|
|
method : "POST",
|
|
|
dataType : "json",
|
|
|
success : function( datas ){
|
|
|
- console.log(datas);
|
|
|
|
|
|
retrieveMemoData();
|
|
|
},
|
|
@@ -318,7 +348,6 @@ function createMemoData(memoContent) {
|
|
|
alert(error.message);
|
|
|
}
|
|
|
}).done( function(){
|
|
|
- console.log('done!');
|
|
|
});
|
|
|
}
|
|
|
|
|
@@ -331,7 +360,6 @@ function retrieveMemoData() {
|
|
|
method : "GET",
|
|
|
dataType : "json",
|
|
|
success : function( datas ){
|
|
|
- console.log(datas);
|
|
|
|
|
|
var html = "<tr><td colspan=3>데이터가 없습니다.</td></tr>" ;
|
|
|
if (datas.length > 0) {
|
|
@@ -351,7 +379,7 @@ function retrieveMemoData() {
|
|
|
alert(error.message);
|
|
|
}
|
|
|
}).done( function(){
|
|
|
- console.log('done!');
|
|
|
+
|
|
|
});
|
|
|
}
|
|
|
|
|
@@ -392,9 +420,7 @@ $(document).ready(function() {
|
|
|
|
|
|
// phrData 기록 추가 클릭 이벤트
|
|
|
$(document).on('click','[data-target="#defaultModalPrimary_1"]',function(){
|
|
|
- console.log("click!");
|
|
|
var selectData = $('#phrTypeSelect').find('option:selected').val();
|
|
|
- console.log(selectData);
|
|
|
var healthInfoHTML = '';
|
|
|
if(selectData == 'temperature'){
|
|
|
healthInfoHTML += '<th>체온</th>';
|
|
@@ -404,17 +430,24 @@ $(document).ready(function() {
|
|
|
healthInfoHTML += ' </div>';
|
|
|
healthInfoHTML += '</td>';
|
|
|
}
|
|
|
- if(selectData == 'bloodPressure'){
|
|
|
- healthInfoHTML += '<th>혈압/맥박</th>';
|
|
|
+ else if(selectData == 'bloodPressure'){
|
|
|
+ healthInfoHTML += '<th>혈압</th>';
|
|
|
healthInfoHTML += '<td>';
|
|
|
healthInfoHTML += ' <div class="form-group mb-xl-0">';
|
|
|
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>';
|
|
|
}
|
|
|
- if(selectData == 'oxygenSaturation'){
|
|
|
+ else if(selectData == 'pulseRate'){
|
|
|
+ healthInfoHTML += '<th>맥박</th>';
|
|
|
+ healthInfoHTML += '<td>';
|
|
|
+ healthInfoHTML += ' <div class="form-group mb-xl-0">';
|
|
|
+ healthInfoHTML += ' <input id="phrValue" class="form-control" type="number" placeholder="맥박 입력">';
|
|
|
+ healthInfoHTML += ' </div>';
|
|
|
+ healthInfoHTML += '</td>';
|
|
|
+ }
|
|
|
+ else if(selectData == 'oxygenSaturation'){
|
|
|
healthInfoHTML += '<th>산소포화도</th>';
|
|
|
healthInfoHTML += '<td>';
|
|
|
healthInfoHTML += ' <div class="form-group mb-xl-0">';
|
|
@@ -422,7 +455,7 @@ $(document).ready(function() {
|
|
|
healthInfoHTML += ' </div>';
|
|
|
healthInfoHTML += '</td>';
|
|
|
}
|
|
|
- if(selectData == 'sugar'){
|
|
|
+ else if(selectData == 'bloodSugar'){
|
|
|
healthInfoHTML += '<th>혈당</th>';
|
|
|
healthInfoHTML += '<td>';
|
|
|
healthInfoHTML += ' <div class="form-group mb-xl-0">';
|
|
@@ -681,7 +714,7 @@ $(document).ready(function() {
|
|
|
<div class="col-12">
|
|
|
<div class="card toggle">
|
|
|
<div class="card-header">
|
|
|
- <h1 class="h4">- 환자 기본정보</h1>
|
|
|
+ <h1 class="h4">김환자 환자 기본정보</h1>
|
|
|
<a href="#" class="toggleBtn">메뉴</a>
|
|
|
</div>
|
|
|
<div class="card-body">
|
|
@@ -847,7 +880,9 @@ $(document).ready(function() {
|
|
|
- 건강정보 조회 <label> <select class="custom-select ml-1 form-control" id=phrTypeSelect name="inputState" onchange="retrievePhrData()">
|
|
|
<option value="temperature" selected>체온</option>
|
|
|
<option value="bloodPressure">혈압</option>
|
|
|
+ <option value="pulseRate">맥박</option>
|
|
|
<option value="oxygenSaturation">산소포화도</option>
|
|
|
+ <option value="bloodSugar">혈당</option>
|
|
|
</select>
|
|
|
</label> <label class="ml-1">
|
|
|
<button type="button" class="btn btn-primary ml-2" data-toggle="modal" data-target="#defaultModalPrimary_1">기록추가</button>
|
|
@@ -870,11 +905,11 @@ $(document).ready(function() {
|
|
|
<tbody>
|
|
|
<c:choose>
|
|
|
<c:when test="${phrTotal > 0}">
|
|
|
- <c:forEach var="phr" items="${phrItems}">
|
|
|
+ <c:forEach var="i" begin="1" end="${phrTotal}">
|
|
|
<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}" /></td>
|
|
|
+ <td><c:out value="${phrItems[phrTotal-i].createDate}" /></td>
|
|
|
+ <td><span class="text-danger"><c:out value="${phrItems[phrTotal-i].phrValue} ℃" /></span></td>
|
|
|
+ <td><c:out value="${phrItems[phrTotal-i].recordedByName}" /></td>
|
|
|
</tr>
|
|
|
</c:forEach>
|
|
|
</c:when>
|