info.jsp 85 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991
  1. <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
  2. <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
  3. <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
  4. <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
  5. <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
  6. <jsp:include page="${data._INCLUDE}/header.jsp"></jsp:include>
  7. <link rel="stylesheet" href="/resources/bower_components/mdi/css/materialdesignicons.min.css">
  8. <link rel="stylesheet" href="/resources/bower_components/datetimepicker-master/build/jquery.datetimepicker.min.css">
  9. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.9.4/Chart.min.css">
  10. <script src="/resources/bower_components/moment/moment.min.js"></script>
  11. <script src="/resources/bower_components/datetimepicker-master/build/jquery.datetimepicker.full.min.js"></script>
  12. <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.9.4/Chart.min.js"></script>
  13. <script>
  14. const mPatientIdx = ${patientIdx}
  15. var PHR_VALUE_DEFAULT = {
  16. TEMPERATURE: {
  17. VALUE: "",
  18. MIN: 20,
  19. MAX: 50
  20. },
  21. BLOOD_PRESSURE_SYSTOLIC: {
  22. VALUE: "",
  23. MIN: 50,
  24. MAX: 250
  25. },
  26. BLOOD_PRESSURE_DIASTOLIC: {
  27. VALUE: "",
  28. MIN: 20,
  29. MAX: 160
  30. },
  31. OXYGEN_SATURATION: {
  32. VALUE: "",
  33. MIN: 60,
  34. MAX: 100
  35. },
  36. PULSE_RATE: {
  37. VALUE: "",
  38. MIN: 30,
  39. MAX: 200
  40. },
  41. BLOOD_SUGAR: {
  42. VALUE: "",
  43. MIN: 10,
  44. MAX: 600
  45. }
  46. }
  47. function ajaxErrorHandler(request, status, error){
  48. if (request.status === 0) {
  49. alert('Not connect.\n Verify Network.');
  50. }
  51. else if (request.status == 400) {
  52. alert('Server understood the request, but request content was invalid. [400]' + '\n\n' + request.responseText);
  53. }
  54. else if (request.status == 401) {
  55. alert('Unauthorized access. [401]' + '\n\n' + request.responseText);
  56. }
  57. else if (request.status == 403) {
  58. alert('Forbidden resource can not be accessed. [403]' + '\n\n' + request.responseText);
  59. }
  60. else if (request.status == 404) {
  61. alert('Requested page not found. [404]' + '\n\n' + request.responseText);
  62. }
  63. else if (request.status == 500) {
  64. alert('Internal server error. [500]' + '\n\n' + request.responseText);
  65. }
  66. else if (request.status == 503) {
  67. alert('Service unavailable. [503]' + '\n\n' + request.responseText);
  68. }
  69. else if (status === 'parsererror') {
  70. alert('Requested JSON parse failed. [Failed]' + '\n\n' + request.responseText);
  71. }
  72. else if (status === 'timeout') {
  73. alert('Time out error. [Timeout]' + '\n\n' + request.responseText);
  74. }
  75. else if (status === 'abort') {
  76. alert('Ajax request aborted. [Aborted]' + '\n\n' + request.responseText);
  77. }
  78. else {
  79. alert('Uncaught Error.' + '\n\n' + request.responseText);
  80. }
  81. }
  82. function gridDateFormatter(date) {
  83. return moment(date).format("YYYY-MM-DD HH:mm");
  84. }
  85. function chartDateFormatter(date) {
  86. return moment(date).format("MM-DD HH:mm");
  87. }
  88. /*
  89. * 비대면 진료 시작
  90. */
  91. function nonFaceStart(event) {
  92. event.stopPropagation();
  93. getAjax("/patient/nonFaceStart", $("#hiddenForm").serialize(), function ( result ) {
  94. $("#nonface").append('<input type="hidden" name="member_name" value="'+result.member_name+'" />');
  95. $("#nonface").append('<input type="hidden" name="member_id" value="'+result.member_id+'" />');
  96. $("#nonface").append('<input type="hidden" name="room_id" value="'+result.room_id+'" />');
  97. $("#nonface").append('<input type="hidden" name="hashData" value="'+result.hashData+'">');
  98. $("#nonface").append('<input type="hidden" name="token" value="'+result.token+'">');
  99. $("#nonface").append('<input type="hidden" name="api_key" value="'+result.api_key+'">');
  100. $("#nonface").append('<input type="hidden" name="classify" value="d">');
  101. var gsWin = window.open('about:blank','nonface');
  102. var frm =document.nonface;
  103. frm.target ="nonface";
  104. frm.method ="post";
  105. frm.submit();
  106. window.location.reload();
  107. }, function(){
  108. }, function(){
  109. });
  110. }
  111. /*
  112. * 건강정보이력 탭 처리
  113. */
  114. function checkValidForPhrData(phrType, phrValue) {
  115. var errorMessage = null;
  116. var errorMessagePrefix = null;
  117. var phrValueDefault = null;
  118. if (phrType === "temperature") {
  119. errorMessagePrefix = "체온을";
  120. phrValueDefault = PHR_VALUE_DEFAULT.TEMPERATURE;
  121. }
  122. else if (phrType === "bloodPressureSystolic") {
  123. errorMessagePrefix = "수축기 혈압을";
  124. phrValueDefault = PHR_VALUE_DEFAULT.BLOOD_PRESSURE_SYSTOLIC;
  125. }
  126. else if (phrType === "bloodPressureDiastolic") {
  127. errorMessagePrefix = "이완기 혈압을";
  128. phrValueDefault = PHR_VALUE_DEFAULT.BLOOD_PRESSURE_DIASTOLIC;
  129. }
  130. else if (phrType === "oxygenSaturation") {
  131. errorMessagePrefix = "산소포화도를";
  132. phrValueDefault = PHR_VALUE_DEFAULT.OXYGEN_SATURATION;
  133. }
  134. else if (phrType === "pulseRate") {
  135. errorMessagePrefix = "맥박을";
  136. phrValueDefault = PHR_VALUE_DEFAULT.PULSE_RATE;
  137. }
  138. else if (phrType === "bloodSugar") {
  139. errorMessagePrefix = "혈당을";
  140. phrValueDefault = PHR_VALUE_DEFAULT.BLOOD_SUGAR;
  141. }
  142. // 널 체크, 숫자 체크, 최대/최소 체크
  143. if (!phrValue || phrValue.length === 0) {
  144. errorMessage = errorMessagePrefix+" 입력해 주세요.";
  145. }
  146. else if (isNaN(phrValue)) {
  147. errorMessage = errorMessagePrefix+" 숫자로 입력해 주세요.";
  148. }
  149. else if (phrValue < phrValueDefault.MIN || phrValue > phrValueDefault.MAX) {
  150. errorMessage = errorMessagePrefix+" "+phrValueDefault.MIN+"~"+phrValueDefault.MAX+" 범위 내로 입력해 주세요.";
  151. }
  152. return errorMessage;
  153. }
  154. function handlePhrData() {
  155. var phrType = $('#healthInfo').attr("data-phr-type");
  156. var phrValue = "";
  157. if (phrType === "bloodPressure") {
  158. var phrValueSystolic = $("#phrValueSystolic").val();
  159. var phrValueDiastolic = $("#phrValueDiastolic").val();
  160. var phrValuePulseRate = $("#phrValuePulseRate").val();
  161. const recordedDate = $("#eventDateTime1").val() === "" ? null : $("#eventDateTime1").val();
  162. // 유효성 체크
  163. var errorMessage1 = checkValidForPhrData("bloodPressureSystolic", phrValueSystolic);
  164. var errorMessage2 = checkValidForPhrData("bloodPressureDiastolic", phrValueDiastolic);
  165. var errorMessage3 = checkValidForPhrData("pulseRate", phrValuePulseRate);
  166. // 수축기 F 이완기 S
  167. if (errorMessage1 && !errorMessage2) {
  168. alert(errorMessage1);
  169. $("#phrValueSystolic").focus();
  170. return;
  171. }
  172. // 수축기 S 이완기 F
  173. else if (!errorMessage1 && errorMessage2) {
  174. alert(errorMessage2);
  175. $("#phrValueDiastolic").focus();
  176. return;
  177. }
  178. // 수축기 F 이완기 F
  179. else if (errorMessage1 && errorMessage2) {
  180. // 미입력 에러
  181. if ((!phrValueSystolic || phrValueSystolic.length === 0) && (!phrValueDiastolic || phrValueDiastolic.length === 0)) {
  182. // 맥박 F
  183. if (errorMessage3) {
  184. alert(errorMessage3);
  185. $("#phrValuePulseRate").focus();
  186. return;
  187. }
  188. // 맥박 S
  189. else {
  190. // 맥박만 저장
  191. createPhrData(mPatientIdx, "pulseRate", recordedDate, phrValuePulseRate);
  192. }
  193. }
  194. // min max 오류
  195. else {
  196. if (errorMessage1) {
  197. alert(errorMessage1);
  198. $("#phrValueSystolic").focus();
  199. return;
  200. }
  201. }
  202. }
  203. // 수축기 S 이완기 S
  204. else if (!errorMessage1 && !errorMessage2) {
  205. // 맥박 F
  206. if (errorMessage3) {
  207. // 미입력 오류
  208. if (!phrValuePulseRate || phrValuePulseRate.length === 0) {
  209. // 혈압만 저장
  210. createPhrData(mPatientIdx, "bloodPressure", recordedDate, phrValueSystolic, phrValueDiastolic);
  211. }
  212. // min max 오류
  213. else {
  214. alert(errorMessage3);
  215. $("#phrValuePulseRate").focus();
  216. return;
  217. }
  218. }
  219. // 맥박 S
  220. else {
  221. // 혈압, 매박 모두 저장
  222. createPhrData(mPatientIdx, "bloodPressure", recordedDate, phrValueSystolic, phrValueDiastolic, phrValuePulseRate);
  223. }
  224. }
  225. $("#phrValueSystolic").val(PHR_VALUE_DEFAULT.BLOOD_PRESSURE_SYSTOLIC.VALUE);
  226. $("#phrValueDiastolic").val(PHR_VALUE_DEFAULT.BLOOD_PRESSURE_DIASTOLIC.VALUE);
  227. $("#phrValuePulseRate").val(PHR_VALUE_DEFAULT.PULSE_RATE.VALUE);
  228. }
  229. else {
  230. phrValue = $("#phrValue").val();
  231. // 유효성 체크
  232. var errorMessage = checkValidForPhrData(phrType, phrValue);
  233. if (errorMessage) {
  234. alert(errorMessage);
  235. $("#phrValue").focus();
  236. return;
  237. }
  238. // 저장 진행
  239. const recordedDate = $("#eventDateTime1").val() === "" ? null : $("#eventDateTime1").val();
  240. createPhrData(mPatientIdx, phrType, recordedDate, phrValue);
  241. var phrValueDefault = "";
  242. if (phrType === "temperature") {
  243. phrValueDefault = PHR_VALUE_DEFAULT.TEMPERATURE;
  244. }
  245. else if (phrType === "oxygenSaturation") {
  246. phrValueDefault = PHR_VALUE_DEFAULT.OXYGEN_SATURATION;
  247. }
  248. else if (phrType === "pulseRate") {
  249. phrValueDefault = PHR_VALUE_DEFAULT.PULSE_RATE;
  250. }
  251. else if (phrType === "bloodSugar") {
  252. phrValueDefault = PHR_VALUE_DEFAULT.BLOOD_SUGAR;
  253. }
  254. $("#phrValue").val(phrValueDefault);
  255. }
  256. $("#defaultModalPrimary_1").modal("hide");
  257. }
  258. function createPhrData(patientIdx, phrType, recordedDate, phrValue, phrValue2, phrValueExtra) {
  259. $.ajax({
  260. url : "./api/phrData",
  261. data : {patientIdx: patientIdx, phrType: phrType, recordedDate: recordedDate, phrValue: phrValue, phrValue2: phrValue2, phrValueExtra: phrValueExtra, recordedById: "${data._SES_ID}", recordedByName: "${data._SES_NAME}"},
  262. method : "POST",
  263. dataType : "json",
  264. success : function( datas ){
  265. retrievePhrData(phrType === "pulseRate" ? "bloodPressure" : phrType);
  266. },
  267. error : ajaxErrorHandler
  268. }).done( function(){
  269. });
  270. }
  271. function retrievePhrData(phrType) {
  272. const chartId = phrType + "Chart";
  273. let phrName = "";
  274. if (phrType === "temperature") {
  275. phrName = "체온";
  276. }
  277. else if (phrType === "bloodPressure") {
  278. // phrName = "";
  279. }
  280. else if (phrType === "oxygenSaturation") {
  281. phrName = "산소포화도";
  282. }
  283. else if (phrType === "bloodSugar") {
  284. phrName = "혈당";
  285. }
  286. var ignoreCache = moment().unix();
  287. var params = {patientIdx: mPatientIdx, phrType: phrType, ignoreCache:ignoreCache};
  288. $.ajax({
  289. url : "./api/phrDatas",
  290. data : params,
  291. method : "GET",
  292. dataType : "json",
  293. success : function( datas ){
  294. if (phrType==="bloodPressure") {
  295. drawBPChart(datas);
  296. }
  297. else {
  298. drawPhrChart(phrType+"Chart", datas, phrName);
  299. }
  300. var contents = "<tr><td colspan=4>데이터가 없습니다.</td></tr>" ;
  301. if (phrType==="bloodPressure") {
  302. contents = "<tr><td colspan=5>데이터가 없습니다.</td></tr>" ;
  303. }
  304. if (datas.length > 0) {
  305. contents = "";
  306. datas.forEach(function(d) {
  307. var danger = d.isWarning ? "text-danger" : "";
  308. var row = "";
  309. row += "<tr>";
  310. row += "<td>" + gridDateFormatter(d.recordedDate) + "</td>";
  311. if (phrType==="bloodPressure") {
  312. var extraDanger = d.isExtraWarning ? "text-danger" : "";
  313. row += "<td><span class='"+danger+"'>" + (isNaN(parseInt(d.phrValue)) ? "--" : parseInt(d.phrValue)) + " / " + (isNaN(parseInt(d.phrValue2)) ? "--" : parseInt(d.phrValue2)) + "</span></td>";
  314. row += "<td><span class='"+extraDanger+"'>" + (isNaN(parseInt(d.phrValueExtra)) ? "" : parseInt(d.phrValueExtra)) + "</span></td>";
  315. }
  316. else if (phrType==="temperature") {
  317. row += "<td><span class='"+danger+"'>" + parseFloat(d.phrValue).toFixed(1) + "</span></td>";
  318. }
  319. else {
  320. row += "<td><span class='"+danger+"'>" + parseInt(d.phrValue) + "</span></td>";
  321. }
  322. row += "<td>" + d.recordedByName + "</td>";
  323. row += "<td>" + gridDateFormatter(d.createDate) + "</td>";
  324. row += "</tr>";
  325. contents = row + contents;
  326. });
  327. };
  328. $("#"+phrType+"DataTable > tbody").html(contents);
  329. },
  330. error : ajaxErrorHandler
  331. }).done( function(){
  332. });
  333. }
  334. var myCharts = {};
  335. function drawPhrChart(chartId, data, dataName) {
  336. let myChart = myCharts[chartId];
  337. if (myChart) {
  338. myChart.destroy();
  339. myChart = null;
  340. }
  341. var xDatas = [];
  342. var yDatas = [];
  343. data.forEach(function(d) {
  344. var t = chartDateFormatter(d.recordedDate);
  345. xDatas.push(t);
  346. yDatas.push(d.phrValue);
  347. });
  348. var ctx = document.getElementById(chartId).getContext('2d');
  349. myCharts[chartId] = new Chart(ctx, {
  350. type: 'line',
  351. data: {
  352. labels: xDatas,
  353. datasets: [{
  354. label: dataName,
  355. data: yDatas,
  356. fill: false,
  357. backgroundColor: '#fff',
  358. borderColor: '#5b7dff',
  359. borderWidth: 2,
  360. }]
  361. },
  362. options: {
  363. maintainAspectRatio: false,
  364. }
  365. });
  366. }
  367. function drawBPChart(data) {
  368. let myChart = myCharts["bloodPressurePulseChart"];
  369. if (myChart) {
  370. myChart.destroy();
  371. myChart = null;
  372. }
  373. var xDatas = [];
  374. var y1Datas = [];
  375. var y2Datas = [];
  376. var y3Datas = [];
  377. var ymin = 1000;
  378. data.forEach(function(d) {
  379. var t = chartDateFormatter(d.recordedDate);
  380. xDatas.push(t);
  381. y1Datas.push(d.phrValue !== null && d.phrValue !== "" ? d.phrValue : Number.NaN);
  382. y2Datas.push(d.phrValue2 !== null && d.phrValue2 !== "" ? d.phrValue2 : Number.NaN);
  383. y3Datas.push(d.phrValueExtra !== null && d.phrValueExtra !== "" ? d.phrValueExtra : Number.NaN);
  384. if (d.phrValue !== null && d.phrValue !== "") ymin = Math.min(ymin, d.phrValue);
  385. if (d.phrValue2 !== null && d.phrValue2 !== "") ymin = Math.min(ymin, d.phrValue2);
  386. if (d.phrValueExtra !== null && d.phrValueExtra !== "") ymin = Math.min(ymin, d.phrValueExtra);
  387. });
  388. var ctx = document.getElementById("bloodPressurePulseChart").getContext('2d');
  389. myCharts["bloodPressurePulseChart"] = new Chart(ctx, {
  390. type: 'line',
  391. data: {
  392. labels: xDatas,
  393. datasets: [{
  394. label: "수축기 혈압",
  395. data: y1Datas,
  396. fill: false,
  397. backgroundColor: "#fff",
  398. borderColor: "#ff6384",
  399. borderWidth: 2,
  400. },{
  401. label: "이완기 혈압",
  402. data: y2Datas,
  403. fill: false,
  404. backgroundColor: "#fff",
  405. borderColor: "#5b7dff",
  406. borderWidth: 2,
  407. },{
  408. label: "맥박",
  409. data: y3Datas,
  410. backgroundColor: "#9ee7c5",
  411. type: 'bar',
  412. }]
  413. },
  414. options: {
  415. maintainAspectRatio: false,
  416. annotation: {
  417. drawTime: "afterDatasetsDraw",
  418. // annotations: annotationData,
  419. },
  420. scales: {
  421. yAxes: [{
  422. ticks: {
  423. suggestedMin: ymin - 10,
  424. }
  425. }]
  426. }
  427. }
  428. });
  429. }
  430. /*
  431. * 임상증상 탭 처리
  432. */
  433. function handleSymptomData() {
  434. if ($("input:checkbox[id='etcCheck']").is(":checked") && !$("#etcContent").val().trim()) {
  435. alert("기타 증상이 체크되었습니다. 내용을 입력해 주세요.");
  436. $("#etcContent").val("");
  437. return;
  438. }
  439. var checkedCount = ($("#defaultModalPrimary_2 input[type='checkbox']:checked").length);
  440. if (checkedCount === 0) {
  441. alert("증상을 체크해 주세요.");
  442. return;
  443. }
  444. var symptomObject = {
  445. patientIdx: mPatientIdx,
  446. coughCheck: $("input:checkbox[id='coughCheck']").is(":checked") ? "Y" : "N",
  447. dyspneaCheck: $("input:checkbox[id='dyspneaCheck']").is(":checked") ? "Y" : "N",
  448. coldFitCheck: $("input:checkbox[id='coldFitCheck']").is(":checked") ? "Y" : "N",
  449. musclePainCheck: $("input:checkbox[id='musclePainCheck']").is(":checked") ? "Y" : "N",
  450. headacheCheck: $("input:checkbox[id='headacheCheck']").is(":checked") ? "Y" : "N",
  451. soreThroatCheck: $("input:checkbox[id='soreThroatCheck']").is(":checked") ? "Y" : "N",
  452. smellPalateCheck: $("input:checkbox[id='smellPalateCheck']").is(":checked") ? "Y" : "N",
  453. fatigueCheck: $("input:checkbox[id='fatigueCheck']").is(":checked") ? "Y" : "N",
  454. appetiteLossCheck: $("input:checkbox[id='appetiteLossCheck']").is(":checked") ? "Y" : "N",
  455. sputumCheck: $("input:checkbox[id='sputumCheck']").is(":checked") ? "Y" : "N",
  456. ocinCheck: $("input:checkbox[id='ocinCheck']").is(":checked") ? "Y" : "N",
  457. vomitingCheck: $("input:checkbox[id='vomitingCheck']").is(":checked") ? "Y" : "N",
  458. diarrheaCheck: $("input:checkbox[id='diarrheaCheck']").is(":checked") ? "Y" : "N",
  459. dizzinessCheck: $("input:checkbox[id='dizzinessCheck']").is(":checked") ? "Y" : "N",
  460. noseCheck: $("input:checkbox[id='noseCheck']").is(":checked") ? "Y" : "N",
  461. etcCheck: $("input:checkbox[id='etcCheck']").is(":checked") ? "Y" : "N",
  462. etcContent: $("#etcContent").val(),
  463. recordedByName: "${data._SES_NAME}",
  464. recordedById: "${data._SES_ID}",
  465. recordedDate: $("#eventDateTime2").val() === "" ? null : $("#eventDateTime2").val(),
  466. }
  467. createSymptomData(symptomObject);
  468. $("#defaultModalPrimary_2 input[type='checkbox']:checked").prop("checked", false);
  469. $("#etcContent").val("");
  470. $("#eventDateTime2").val("")
  471. $("#defaultModalPrimary_2").modal("hide");
  472. }
  473. function createSymptomData(symptomObject) {
  474. $.ajax({
  475. url : "./api/symptomData",
  476. data : symptomObject,
  477. method : "POST",
  478. dataType : "json",
  479. success : function( datas ){
  480. retrieveSymptomData();
  481. },
  482. error : ajaxErrorHandler
  483. }).done( function(){
  484. });
  485. }
  486. function retrieveSymptomData() {
  487. var ignoreCache = moment().unix();
  488. var params = {patientIdx: mPatientIdx, ignoreCache:ignoreCache};
  489. $.ajax({
  490. url : "./api/symptomDatas",
  491. data : params,
  492. method : "GET",
  493. dataType : "json",
  494. success : function( datas ){
  495. var html = "<tr><td colspan=19>데이터가 없습니다.</td></tr>" ;
  496. var checkSymbol = '<i class="mdi mdi-check-bold"></i>';
  497. if (datas.length > 0) {
  498. html = "";
  499. contents = datas.forEach(function(d) {
  500. html += "<tr>";
  501. html += "<th>" + gridDateFormatter(d.recordedDate) + "</th>";
  502. html += "<td>" + (d.coughCheck === "Y" ? checkSymbol : "-") + "</td>";
  503. html += "<td>" + (d.dyspneaCheck === "Y" ? checkSymbol : "-") + "</td>";
  504. html += "<td>" + (d.coldFitCheck === "Y" ? checkSymbol : "-") + "</td>";
  505. html += "<td>" + (d.musclePainCheck === "Y" ? checkSymbol : "-") + "</td>";
  506. html += "<td>" + (d.headacheCheck === "Y" ? checkSymbol : "-") + "</td>";
  507. html += "<td>" + (d.soreThroatCheck === "Y" ? checkSymbol : "-") + "</td>";
  508. html += "<td>" + (d.smellPalateCheck === "Y" ? checkSymbol : "-") + "</td>";
  509. html += "<td>" + (d.fatigueCheck === "Y" ? checkSymbol : "-") + "</td>";
  510. html += "<td>" + (d.appetiteLossCheck === "Y" ? checkSymbol : "-") + "</td>";
  511. html += "<td>" + (d.sputumCheck === "Y" ? checkSymbol : "-") + "</td>";
  512. html += "<td>" + (d.ocinCheck === "Y" ? checkSymbol : "-") + "</td>";
  513. html += "<td>" + (d.vomitingCheck === "Y" ? checkSymbol : "-") + "</td>";
  514. html += "<td>" + (d.diarrheaCheck === "Y" ? checkSymbol : "-") + "</td>";
  515. html += "<td>" + (d.dizzinessCheck === "Y" ? checkSymbol : "-") + "</td>";
  516. html += "<td>" + (d.noseCheck === "Y" ? checkSymbol : "-") + "</td>";
  517. html += "<td>" + (d.etcCheck === "Y" ? d.etcContent : "-") + "</td>";
  518. html += "<td>" + d.recordedByName + "</td>";
  519. html += "<td>" + gridDateFormatter(d.createDate) + "</td>";
  520. html += "</tr>";
  521. });
  522. };
  523. $("#symptomDataTable > tbody").html(html);
  524. },
  525. error : ajaxErrorHandler
  526. }).done( function(){
  527. });
  528. }
  529. /*
  530. * 메모 탭 처리
  531. */
  532. function insertMemoData() {
  533. var memoContent = $("#memoContent").val().trim();
  534. const recordedDate = $("#eventDateTime3").val() === "" ? null : $("#eventDateTime3").val();
  535. if (!memoContent) {
  536. alert("메모 내용을 입력해 주세요.");
  537. $("#memoContent").val("");
  538. return;
  539. }
  540. requestInsertMemoData(memoContent, recordedDate);
  541. $("#memoContent").val("");
  542. $("#eventDateTime3").val("");
  543. }
  544. function deleteMemoData() {
  545. const memoId = $("#defaultModalPrimaryMemo").data("memoid");
  546. if (memoId === undefined || memoId === null || memoId === "") {
  547. alert("오류! 삭제할 메모를 찾을 수 없습니다.");
  548. return;
  549. }
  550. const result = confirm("메모를 삭제하시겠습니까?\n삭제후에는 복구가 불가능 합니다.");
  551. if(result){
  552. requestDeleteMemoData(memoId);
  553. $("#defaultModalPrimaryMemo").modal("hide");
  554. }
  555. }
  556. function modifyMemoData() {
  557. const memoId = $("#defaultModalPrimaryMemo").data("memoid");
  558. if (memoId === undefined || memoId === null || memoId === "") {
  559. alert("오류! 삭제할 메모를 찾을 수 없습니다.");
  560. return;
  561. }
  562. var modifyMemoContent = $("#modifyMemoContent").val().trim();
  563. if (!modifyMemoContent) {
  564. alert("메모 내용을 입력해 주세요.");
  565. $("#modifyMemoContent").val("");
  566. return;
  567. }
  568. const recordedDate = $("#modifMemoDateTime").val() === "" ? null : $("#modifMemoDateTime").val();
  569. const result = confirm("메모를 수정하시겠습니까?");
  570. if(result){
  571. requestUpdateMemoData(memoId, modifyMemoContent, recordedDate);
  572. $("#defaultModalPrimaryMemo").modal("hide");
  573. }
  574. }
  575. function requestInsertMemoData(memoContent, recordedDate) {
  576. $.ajax({
  577. url : "./api/memoData",
  578. data : {patientIdx:mPatientIdx, contents:memoContent, recordedDate:recordedDate, recordedByName:"${data._SES_NAME}", recordedById:"${data._SES_ID}"},
  579. method : "POST",
  580. dataType : "json",
  581. success : function( datas ){
  582. retrieveMemoData();
  583. },
  584. error : ajaxErrorHandler
  585. }).done( function(){
  586. });
  587. }
  588. function requestDeleteMemoData(memoIdx) {
  589. $.ajax({
  590. url : "./api/memoData",
  591. data : {idx:memoIdx},
  592. method : "DELETE",
  593. dataType : "json",
  594. success : function( datas ){
  595. retrieveMemoData();
  596. },
  597. error : ajaxErrorHandler
  598. }).done( function(){
  599. });
  600. }
  601. function requestUpdateMemoData(memoIdx, modifyMemoContent, recordedDate) {
  602. $.ajax({
  603. url : "./api/memoData",
  604. data : {idx:memoIdx, contents:modifyMemoContent, recordedDate:recordedDate},
  605. method : "PATCH",
  606. dataType : "json",
  607. success : function( datas ){
  608. if (datas.code === "00") {
  609. retrieveMemoData();
  610. }
  611. else {
  612. alert("메모 수정 실패.\n" + datas.code);
  613. }
  614. },
  615. error : ajaxErrorHandler
  616. }).done( function(){
  617. });
  618. }
  619. function retrieveMemoData() {
  620. var ignoreCache = moment().unix();
  621. var params = {patientIdx: mPatientIdx, ignoreCache:ignoreCache};
  622. $.ajax({
  623. url : "./api/memoDatas",
  624. data : params,
  625. method : "GET",
  626. dataType : "json",
  627. success : function( datas ){
  628. var html = "<tr><td colspan=4>데이터가 없습니다.</td></tr>" ;
  629. if (datas.length > 0) {
  630. html = "";
  631. contents = datas.forEach(function(d) {
  632. html += "<tr>";
  633. html += "<td>" + gridDateFormatter(d.recordedDate) + "</td>";
  634. if (d.canModify && d.recordedById === "${data._SES_ID}") {
  635. const clickEventListener ='handleModifyMemo("'+d.idx+'","'+d.recordedDate+'")';
  636. html += "<td><pre id='memo_"+d.idx+"' class='contentsEdit' onClick='"+clickEventListener+"'>" + d.contents + "</pre></td>";
  637. }
  638. else {
  639. html += "<td><pre>" + d.contents + "</pre></td>";
  640. }
  641. html += "<td>" + d.recordedByName + "</td>";
  642. html += "<td>" + gridDateFormatter(d.createDate) + "</td>";
  643. html += "</tr>";
  644. });
  645. };
  646. $("#memoDataTable > tbody").html(html);
  647. },
  648. error : ajaxErrorHandler
  649. }).done( function(){
  650. });
  651. }
  652. function gotoList() {
  653. var url = "./state";
  654. var refererSearch = '<c:out value="${refererSearch}" />';
  655. var refererPage = '<c:out value="${refererPage}" />';
  656. if (refererSearch !== "" && refererPage !== "") {
  657. url += "?searchText=" + encodeURIComponent(refererSearch) + "&page=" + refererPage;
  658. }
  659. else if (refererSearch !== "") {
  660. url += "?searchText=" + encodeURIComponent(refererSearch);
  661. }
  662. else if (refererPage !== "") {
  663. url += "?page=" + refererPage;
  664. }
  665. location.href = url;
  666. }
  667. function gotoPatientInfo() {
  668. var url = "/patient/info?patientIdx=" + mPatientIdx;
  669. location.href = url;
  670. }
  671. function getExcel() {
  672. if (!$("#downMemo").val().trim()) {
  673. alert("다운로드 사유를 입력해 주세요.");
  674. $("#downMemo").val("").foucs();
  675. return;
  676. }
  677. if ($("#downMemo").val().trim().length < 3) {
  678. alert("다운로드 사유는 3글자 이상이어야 합니다.");
  679. $("#downMemo").foucs();
  680. return;
  681. }
  682. const downMemo = $("#downMemo").val().trim();
  683. donwMemo = encodeURIComponent(downMemo);
  684. const url = "./excel?patientIdx=" + mPatientIdx + "&downMemo=" + downMemo;
  685. window.open(url);
  686. $("#excelDownMemo").modal("hide");
  687. }
  688. function handleModifyMemo(memoId, recordedDate) {
  689. $("#defaultModalPrimaryMemo").data("memoid", memoId);
  690. const content = $("#memo_"+memoId).html();
  691. var memoInfoHTML = '';
  692. memoInfoHTML += ' <th>내용</th>';
  693. memoInfoHTML += ' <td>';
  694. memoInfoHTML += ' <div class="form-row">';
  695. memoInfoHTML += ' <textarea id="modifyMemoContent" class="form-control" rows="15" placeholder="내용을 입력하세요">'+content+'</textarea>';
  696. memoInfoHTML += ' </div>';
  697. memoInfoHTML += ' </td>';
  698. $('#memoInfo').html(memoInfoHTML);
  699. $('#modifMemoDateTime').val(gridDateFormatter(recordedDate));
  700. $('#defaultModalPrimaryMemo').modal();
  701. setTimeout(function (){
  702. $('#memoInfo').find('.form-row textarea').focus();
  703. }, 500);
  704. }
  705. $(document).ready(function() {
  706. setTimeout(function () {
  707. $(".preloader").fadeOut("fast");
  708. }, 1000);
  709. $.datetimepicker.setLocale('ko');
  710. $(".datetimepicker").datetimepicker({
  711. format: 'Y-m-d H:i',
  712. step: 30,
  713. maxDate: '+1970/01/01' //오늘이 선택 가능한 마지막 날짜로 설정
  714. });
  715. const temperatureDatas = [];
  716. <c:forEach var="phr" items="${temperatureResult}" varStatus="status">
  717. temperatureDatas.push({recordedDate: "${phr.recordedDate}", phrValue: "${phr.phrValue}"});
  718. </c:forEach>
  719. drawPhrChart("temperatureChart", temperatureDatas, "체온");
  720. const bloodPressureUnionDatas = [];
  721. <c:forEach var="phr" items="${bloodPressureUnionResult}" varStatus="status">
  722. bloodPressureUnionDatas.push({recordedDate: "${phr.recordedDate}", phrValue: "${phr.phrValue}", phrValue2: "${phr.phrValue2}", phrValueExtra: "${phr.phrValueExtra}"});
  723. </c:forEach>
  724. drawBPChart(bloodPressureUnionDatas);
  725. const oxygenSaturationDatas = [];
  726. <c:forEach var="phr" items="${oxygenSaturationResult}" varStatus="status">
  727. oxygenSaturationDatas.push({recordedDate: "${phr.recordedDate}", phrValue: "${phr.phrValue}"});
  728. </c:forEach>
  729. drawPhrChart("oxygenSaturationChart", oxygenSaturationDatas, "산소포화도");
  730. const bloodSugarDatas = [];
  731. <c:forEach var="phr" items="${bloodSugarResult}" varStatus="status">
  732. bloodSugarDatas.push({recordedDate: "${phr.recordedDate}", phrValue: "${phr.phrValue}"});
  733. </c:forEach>
  734. drawPhrChart("bloodSugarChart", bloodSugarDatas, "혈당");
  735. // 초기 섹션 설정
  736. // var page_url = window.location.href;
  737. // var page_id = page_url.substring(page_url.lastIndexOf("#") + 1);
  738. // if (page_id === "symptomSection" || page_id === "medicalMemoSection") {
  739. // $('html, body').animate({ scrollTop: $('#' + page_id).offset().top }, 500);
  740. // }
  741. // 상단 환자 정보 영역 토글 이벤트
  742. $("#userInfo").find(".user-info").show();
  743. $(document).on("click", ".toggle .toggleHeader", function () {
  744. $(this).find("a.toggleBtn").toggleClass("active");
  745. $("#userInfo").slideToggle("fast");
  746. });
  747. // 섹션 토글
  748. $(document).on("click", ".sectionToggle, .phrTitle", function () {
  749. $(this).closest("section").find(".sectionToggle").toggleClass("hide");
  750. $(this).closest("section").find(".sectionContent").slideToggle("fast");
  751. });
  752. // 섹션 이동
  753. $(document).on("click", ".sectionNav li", function (event) {
  754. if ($(this).find("a").attr("href") !== "") {
  755. event.preventDefault();
  756. var aID = $(this).find("a").attr("href");
  757. $(".phrSection").removeClass("active");
  758. $(aID).addClass("active");
  759. $(".main").animate(
  760. {
  761. scrollTop: $(aID).position().top + 100,
  762. },
  763. 300
  764. );
  765. }
  766. });
  767. // 건강정보 엑셀 다운로드 사유 팝업 닫힐 때 처리
  768. $('#excelDownMemo').on('hidden.bs.modal', function () {
  769. $("#downMemo").val("");
  770. })
  771. // phrData 기록 추가 클릭 이벤트
  772. $('#defaultModalPrimary_1').on('hidden.bs.modal', function () {
  773. $("#eventDateTime1").val("");
  774. })
  775. $(document).on('click','[data-target="#defaultModalPrimary_1"]',function() {
  776. var selectData = $(this).attr("id");
  777. var healthInfoHTML = '';
  778. var phrValueDefault = null;
  779. if(selectData == 'temperature'){
  780. phrValueDefault = PHR_VALUE_DEFAULT.TEMPERATURE;
  781. healthInfoHTML += '<th>체온</th>';
  782. healthInfoHTML += '<td>';
  783. healthInfoHTML += ' <div class="form-group mb-xl-0">';
  784. healthInfoHTML += ' <input id="phrValue" class="form-control" type="number" placeholder="체온 입력" min="'+phrValueDefault.MIN+'" max="'+phrValueDefault.MAX+'" value="'+phrValueDefault.VALUE+'" step="0.1">';
  785. healthInfoHTML += ' </div>';
  786. healthInfoHTML += '</td>';
  787. }
  788. else if(selectData == 'bloodPressure'){
  789. phrValueDefault1 = PHR_VALUE_DEFAULT.BLOOD_PRESSURE_SYSTOLIC;
  790. phrValueDefault2 = PHR_VALUE_DEFAULT.BLOOD_PRESSURE_DIASTOLIC;
  791. phrValueDefault3 = PHR_VALUE_DEFAULT.PULSE_RATE;
  792. healthInfoHTML += '<th>혈압/맥박</th>';
  793. healthInfoHTML += '<td>';
  794. healthInfoHTML += ' <div class="form-group mb-xl-0">';
  795. healthInfoHTML += ' <input id="phrValueSystolic" class="form-control mb-2" type="number" placeholder="수축기 혈압 입력" min="'+phrValueDefault1.MIN+'" max="'+phrValueDefault1.MAX+'" value="'+phrValueDefault1.VALUE+'">';
  796. healthInfoHTML += ' <input id="phrValueDiastolic" class="form-control mb-2" type="number" placeholder="이완기 혈압 입력" min="'+phrValueDefault2.MIN+'" max="'+phrValueDefault2.MAX+'" value="'+phrValueDefault2.VALUE+'">';
  797. healthInfoHTML += ' <input id="phrValuePulseRate" class="form-control" type="number" placeholder="맥박 입력"min="'+phrValueDefault3.MIN+'" max="'+phrValueDefault3.MAX+'" value="'+phrValueDefault3.VALUE+'">';
  798. healthInfoHTML += ' </div>';
  799. healthInfoHTML += '</td>';
  800. }
  801. else if(selectData == 'pulseRate'){
  802. phrValueDefault = PHR_VALUE_DEFAULT.PULSE_RATE;
  803. healthInfoHTML += '<th>맥박</th>';
  804. healthInfoHTML += '<td>';
  805. healthInfoHTML += ' <div class="form-group mb-xl-0">';
  806. healthInfoHTML += ' <input id="phrValue" class="form-control" type="number" placeholder="맥박 입력"min="'+phrValueDefault.MIN+'" max="'+phrValueDefault.MAX+'" value="'+phrValueDefault.VALUE+'">';
  807. healthInfoHTML += ' </div>';
  808. healthInfoHTML += '</td>';
  809. }
  810. else if(selectData == 'oxygenSaturation'){
  811. phrValueDefault = PHR_VALUE_DEFAULT.OXYGEN_SATURATION;
  812. healthInfoHTML += '<th>산소포화도</th>';
  813. healthInfoHTML += '<td>';
  814. healthInfoHTML += ' <div class="form-group mb-xl-0">';
  815. healthInfoHTML += ' <input id="phrValue" class="form-control" type="number" placeholder="산소포화도 입력" min="'+phrValueDefault.MIN+'" max="'+phrValueDefault.MAX+'" value="'+phrValueDefault.VALUE+'">';
  816. healthInfoHTML += ' </div>';
  817. healthInfoHTML += '</td>';
  818. }
  819. else if(selectData == 'bloodSugar'){
  820. phrValueDefault = PHR_VALUE_DEFAULT.BLOOD_SUGAR;
  821. healthInfoHTML += '<th>혈당</th>';
  822. healthInfoHTML += '<td>';
  823. healthInfoHTML += ' <div class="form-group mb-xl-0">';
  824. healthInfoHTML += ' <input id="phrValue" class="form-control" type="number" placeholder="혈당 입력" min="'+phrValueDefault.MIN+'" max="'+phrValueDefault.MAX+'" value="'+phrValueDefault.VALUE+'"">';
  825. healthInfoHTML += ' </div>';
  826. healthInfoHTML += '</td>';
  827. }
  828. else {
  829. }
  830. $('#healthInfo').html(healthInfoHTML);
  831. $('#healthInfo').attr("data-phr-type", selectData);
  832. setTimeout(function (){
  833. $('#healthInfo').find('.form-group input:first-child').focus();
  834. }, 500);
  835. });
  836. // 임상증상 추가 클릭 이벤트
  837. $('#defaultModalPrimary_2').on('hidden.bs.modal', function () {
  838. $("#eventDateTime2").val("");
  839. })
  840. $(document).on('click','[data-target="#defaultModalPrimary_2"]',function(){
  841. var symptomInfoHtml = '';
  842. symptomInfoHtml += ' <th>임상증상</th>';
  843. symptomInfoHtml += ' <td>';
  844. symptomInfoHtml += ' <div class="form-group mb-xl-0">';
  845. symptomInfoHtml += ' <label class="form-check form-check-inline">';
  846. symptomInfoHtml += ' <input id="coughCheck" class="form-check-input" type="checkbox">';
  847. symptomInfoHtml += ' <span class="form-check-label">';
  848. symptomInfoHtml += ' 기침';
  849. symptomInfoHtml += ' </span>';
  850. symptomInfoHtml += ' </label>';
  851. symptomInfoHtml += ' <label class="form-check form-check-inline">';
  852. symptomInfoHtml += ' <input id="dyspneaCheck" class="form-check-input" type="checkbox">';
  853. symptomInfoHtml += ' <span class="form-check-label">';
  854. symptomInfoHtml += ' 호흡곤란';
  855. symptomInfoHtml += ' </span>';
  856. symptomInfoHtml += ' </label>';
  857. symptomInfoHtml += ' <label class="form-check form-check-inline">';
  858. symptomInfoHtml += ' <input id="coldFitCheck" class="form-check-input" type="checkbox">';
  859. symptomInfoHtml += ' <span class="form-check-label">';
  860. symptomInfoHtml += ' 오한';
  861. symptomInfoHtml += ' </span>';
  862. symptomInfoHtml += ' </label>';
  863. symptomInfoHtml += ' <label class="form-check form-check-inline">';
  864. symptomInfoHtml += ' <input id="musclePainCheck" class="form-check-input" type="checkbox">';
  865. symptomInfoHtml += ' <span class="form-check-label">';
  866. symptomInfoHtml += ' 근육통';
  867. symptomInfoHtml += ' </span>';
  868. symptomInfoHtml += ' </label>';
  869. symptomInfoHtml += ' <label class="form-check form-check-inline">';
  870. symptomInfoHtml += ' <input id="headacheCheck" class="form-check-input" type="checkbox">';
  871. symptomInfoHtml += ' <span class="form-check-label">';
  872. symptomInfoHtml += ' 두통';
  873. symptomInfoHtml += ' </span>';
  874. symptomInfoHtml += ' </label>';
  875. symptomInfoHtml += ' <label class="form-check form-check-inline">';
  876. symptomInfoHtml += ' <input id="soreThroatCheck" class="form-check-input" type="checkbox">';
  877. symptomInfoHtml += ' <span class="form-check-label">';
  878. symptomInfoHtml += ' 인후통';
  879. symptomInfoHtml += ' </span>';
  880. symptomInfoHtml += ' </label>';
  881. symptomInfoHtml += ' <label class="form-check form-check-inline">';
  882. symptomInfoHtml += ' <input id="smellPalateCheck" class="form-check-input" type="checkbox">';
  883. symptomInfoHtml += ' <span class="form-check-label">';
  884. symptomInfoHtml += ' 후각/미각 손실';
  885. symptomInfoHtml += ' </span>';
  886. symptomInfoHtml += ' </label>';
  887. symptomInfoHtml += ' <label class="form-check form-check-inline">';
  888. symptomInfoHtml += ' <input id="fatigueCheck" class="form-check-input" type="checkbox">';
  889. symptomInfoHtml += ' <span class="form-check-label">';
  890. symptomInfoHtml += ' 피로';
  891. symptomInfoHtml += ' </span>';
  892. symptomInfoHtml += ' </label>';
  893. symptomInfoHtml += ' <label class="form-check form-check-inline">';
  894. symptomInfoHtml += ' <input id="appetiteLossCheck" class="form-check-input" type="checkbox">';
  895. symptomInfoHtml += ' <span class="form-check-label">';
  896. symptomInfoHtml += ' 식욕감소';
  897. symptomInfoHtml += ' </span>';
  898. symptomInfoHtml += ' </label>';
  899. symptomInfoHtml += ' <label class="form-check form-check-inline">';
  900. symptomInfoHtml += ' <input id="sputumCheck" class="form-check-input" type="checkbox">';
  901. symptomInfoHtml += ' <span class="form-check-label">';
  902. symptomInfoHtml += ' 가래';
  903. symptomInfoHtml += ' </span>';
  904. symptomInfoHtml += ' </label>';
  905. symptomInfoHtml += ' <label class="form-check form-check-inline">';
  906. symptomInfoHtml += ' <input id="ocinCheck" class="form-check-input" type="checkbox">';
  907. symptomInfoHtml += ' <span class="form-check-label">';
  908. symptomInfoHtml += ' 오심';
  909. symptomInfoHtml += ' </span>';
  910. symptomInfoHtml += ' </label>';
  911. symptomInfoHtml += ' <label class="form-check form-check-inline">';
  912. symptomInfoHtml += ' <input id="vomitingCheck" class="form-check-input" type="checkbox">';
  913. symptomInfoHtml += ' <span class="form-check-label">';
  914. symptomInfoHtml += ' 구토';
  915. symptomInfoHtml += ' </span>';
  916. symptomInfoHtml += ' </label>';
  917. symptomInfoHtml += ' <label class="form-check form-check-inline">';
  918. symptomInfoHtml += ' <input id="diarrheaCheck" class="form-check-input" type="checkbox">';
  919. symptomInfoHtml += ' <span class="form-check-label">';
  920. symptomInfoHtml += ' 설사';
  921. symptomInfoHtml += ' </span>';
  922. symptomInfoHtml += ' </label>';
  923. symptomInfoHtml += ' <label class="form-check form-check-inline">';
  924. symptomInfoHtml += ' <input id="dizzinessCheck" class="form-check-input" type="checkbox">';
  925. symptomInfoHtml += ' <span class="form-check-label">';
  926. symptomInfoHtml += ' 어지러움';
  927. symptomInfoHtml += ' </span>';
  928. symptomInfoHtml += ' </label>';
  929. symptomInfoHtml += ' <label class="form-check form-check-inline">';
  930. symptomInfoHtml += ' <input id="noseCheck" class="form-check-input" type="checkbox">';
  931. symptomInfoHtml += ' <span class="form-check-label">';
  932. symptomInfoHtml += ' 콧물/코막힘';
  933. symptomInfoHtml += ' </span>';
  934. symptomInfoHtml += ' </label>';
  935. symptomInfoHtml += ' <label class="form-check form-check-inline">';
  936. symptomInfoHtml += ' <input id="etcCheck" class="form-check-input" type="checkbox">';
  937. symptomInfoHtml += ' <span class="form-check-label">';
  938. symptomInfoHtml += ' 기타 ( <input type="text" id="etcContent" class="form-control form-control-sm w150" value="" placeholder="증상 내용" disabled> )';
  939. symptomInfoHtml += ' </span>';
  940. symptomInfoHtml += ' </label>';
  941. symptomInfoHtml += ' </div>';
  942. symptomInfoHtml += ' </td>';
  943. $('#symptomInfo').html(symptomInfoHtml);
  944. document.getElementById('etcCheck').onchange = function() {
  945. document.getElementById('etcContent').disabled = !this.checked;
  946. if (!this.checked) {
  947. $("#etcContent").val("");
  948. }
  949. };
  950. });
  951. // 의료진 메모 추가 클릭 이벤트
  952. $('#defaultModalPrimaryMemo').on('hidden.bs.modal', function () {
  953. $("#modifMemoDateTime").val("");
  954. })
  955. $(document).on('click','.addMemo',function(){
  956. var memoInfoHTML = '';
  957. memoInfoHTML += '<th>내용</th>';
  958. memoInfoHTML += '<td>';
  959. memoInfoHTML += ' <div class="form-row">';
  960. memoInfoHTML += ' <textarea id="memoContent" class="form-control" rows="15" placeholder="내용을 입력하세요"></textarea>';
  961. memoInfoHTML += ' </div>';
  962. memoInfoHTML += '</td>';
  963. $('#memoInfo').html(memoInfoHTML);
  964. $('#defaultModalPrimaryMemo').modal();
  965. setTimeout(function (){
  966. $('#memoInfo').find('.form-row textarea').focus();
  967. }, 500);
  968. });
  969. });
  970. </script>
  971. </head>
  972. <body>
  973. <form id="nonface" name="nonface" action="https://lemon.medihere.com/app/vc">
  974. </form>
  975. <form id="hiddenForm">
  976. <input type="hidden" id="pId" name="pId" value='<c:out value="${info.id}" />'>
  977. <input type="hidden" id="pName" name="pName" value='<c:out value="${info.patientName}" />'>
  978. <input type="hidden" id="roomId" name="roomId" value='<c:out value="${info.roomNumber}" />'>
  979. </form>
  980. <div class="preloader">
  981. <div class="loadingIcon"></div>
  982. </div>
  983. <div class="modal fade" id="excelDownMemo" tabindex="-1" role="dialog" aria-hidden="true" data-memoid="">
  984. <div class="modal-dialog" role="document">
  985. <div class="modal-content">
  986. <div class="modal-header">
  987. <h5 class="modal-title">건강정보 Excel 다운로드</h5>
  988. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
  989. aria-hidden="true">&times;</span> </button>
  990. </div>
  991. <div class="modal-body m-3">
  992. <table class="table mobile-table">
  993. <colgroup>
  994. <col style="width: 20%">
  995. <col style="width: 80%">
  996. </colgroup>
  997. <tr>
  998. <th><span class="fix">*</span>다운로드 사유</th>
  999. <td>
  1000. <div class="form-row">
  1001. <textarea id="downMemo" name="downMemo" class="form-control" cols="" rows="6" placeholder="" maxlength="200"></textarea>
  1002. </div>
  1003. </td>
  1004. </tr>
  1005. </table>
  1006. </div>
  1007. <div class="addMemoTools modal-footer">
  1008. <button type="button" class="btn btn-outline-primary" data-dismiss="modal">취소</button>
  1009. <button type="button" class="btn btn-primary" onclick="getExcel();">제출 후 다운로드</button>
  1010. </div>
  1011. </div>
  1012. </div>
  1013. </div>
  1014. <div class="modal fade" id="legendGuide" tabindex="-1" role="dialog" aria-hidden="true">
  1015. <div class="modal-dialog modal-sm" role="document">
  1016. <div class="modal-content">
  1017. <div class="modal-header">
  1018. <h5 class="modal-title">알람 표시 기준 안내</h5>
  1019. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span> </button>
  1020. </div>
  1021. <div class="modal-body m-1">
  1022. <h4>생체측정 알람 표시 기준</h4>
  1023. <ul class="legend">
  1024. <li class="row fever">
  1025. <div class="col-lg-4">체온</div>
  1026. <div class="col-lg-8">37.5 이상</div>
  1027. </li>
  1028. <li class="row bloodPressure">
  1029. <div class="col-lg-4">고혈압</div>
  1030. <div class="col-lg-8">수축기 149 이상<br>이완기 99 이상</div>
  1031. </li>
  1032. <li class="row bloodPressure">
  1033. <div class="col-lg-4">저혈압</div>
  1034. <div class="col-lg-8">수축기 90 이하<br>이완기 60 이하</div>
  1035. </li>
  1036. <li class="row pulse">
  1037. <div class="col-lg-4">맥박</div>
  1038. <div class="col-lg-8">최저 55 이하<br>최고 110 이상</div>
  1039. </li>
  1040. <li class="row oxygen">
  1041. <div class="col-lg-4">산소포화도</div>
  1042. <div class="col-lg-8">94% 이하</div>
  1043. </li>
  1044. <li class="row sugar">
  1045. <div class="col-lg-4">고혈당</div>
  1046. <div class="col-lg-8">200 이상</div>
  1047. </li>
  1048. <li class="row sugar">
  1049. <div class="col-lg-4">저혈당</div>
  1050. <div class="col-lg-8">70 이하 </div>
  1051. </li>
  1052. </ul>
  1053. </div>
  1054. <div class="modal-footer">
  1055. <button type="button" class="btn btn-primary" data-dismiss="modal">닫기</button>
  1056. </div>
  1057. </div>
  1058. </div>
  1059. </div>
  1060. <div class="modal fade" id="defaultModalPrimary_1" tabindex="-1" role="dialog" aria-hidden="true">
  1061. <div class="modal-dialog modal-sm" role="document">
  1062. <div class="modal-content">
  1063. <div class="modal-header">
  1064. <h5 class="modal-title">건강정보 입력</h5>
  1065. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
  1066. aria-hidden="true">&times;</span> </button>
  1067. </div>
  1068. <div class="modal-body m-3">
  1069. <table class="table mobile-table">
  1070. <colgroup>
  1071. <col style="width: 30%">
  1072. <col style="width: 70%">
  1073. </colgroup>
  1074. <tr>
  1075. <th>기록자</th>
  1076. <td>
  1077. <div class="form-group mb-xl-0">
  1078. <input class="form-control" type="text" value="${data._SES_NAME}" readonly>
  1079. </div>
  1080. </td>
  1081. </tr>
  1082. <tr id="healthInfo">
  1083. <!-- 컨텐츠 동적 생성 -->
  1084. </tr>
  1085. <tr>
  1086. <th>측정일시</th>
  1087. <td>
  1088. <div class="datetimepickerWrap">
  1089. <input id="eventDateTime1" class="datetimepicker form-control" type="text" placeholder="측정일시(미 입력시 현재시간 자동등록)">
  1090. </div>
  1091. </td>
  1092. </tr>
  1093. </table>
  1094. </div>
  1095. <div class="modal-footer">
  1096. <button type="button" class="btn btn-outline-primary" data-dismiss="modal">취소</button>
  1097. <button type="button" class="btn btn-primary" onclick="handlePhrData()">등록</button>
  1098. </div>
  1099. </div>
  1100. </div>
  1101. </div>
  1102. <div class="modal fade" id="defaultModalPrimary_2" tabindex="-1" role="dialog" aria-hidden="true">
  1103. <div class="modal-dialog" role="document">
  1104. <div class="modal-content">
  1105. <div class="modal-header">
  1106. <h5 class="modal-title">임상증상 입력</h5>
  1107. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
  1108. aria-hidden="true">&times;</span> </button>
  1109. </div>
  1110. <div class="modal-body m-3">
  1111. <table class="table mobile-table">
  1112. <colgroup>
  1113. <col style="width: 30%">
  1114. <col style="width: 70%">
  1115. </colgroup>
  1116. <tr>
  1117. <th>기록자</th>
  1118. <td>
  1119. <div class="form-group mb-xl-0">
  1120. <input class="form-control" type="text" value="${data._SES_NAME}" readonly>
  1121. </div>
  1122. </td>
  1123. </tr>
  1124. <tr id="symptomInfo">
  1125. <!-- 컨텐츠 동적 생성 -->
  1126. </tr>
  1127. <tr>
  1128. <th>측정일시</th>
  1129. <td>
  1130. <div class="datetimepickerWrap">
  1131. <input id="eventDateTime2" class="datetimepicker form-control" type="text" placeholder="측정일시(미 입력시 현재시간 자동등록)">
  1132. </div>
  1133. </td>
  1134. </tr>
  1135. </table>
  1136. </div>
  1137. <div class="modal-footer">
  1138. <button type="button" class="btn btn-outline-primary" data-dismiss="modal">취소</button>
  1139. <button type="button" class="btn btn-primary" onclick="handleSymptomData()">등록</button>
  1140. </div>
  1141. </div>
  1142. </div>
  1143. </div>
  1144. <div class="modal fade" id="defaultModalPrimaryMemo" tabindex="-1" role="dialog" aria-hidden="true" data-memoid="">
  1145. <div class="modal-dialog" role="document">
  1146. <div class="modal-content">
  1147. <div class="modal-header">
  1148. <h5 class="modal-title">의료진 메모 수정</h5>
  1149. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
  1150. aria-hidden="true">&times;</span> </button>
  1151. </div>
  1152. <div class="modal-body m-3">
  1153. <table class="table mobile-table">
  1154. <colgroup>
  1155. <col style="width: 20%">
  1156. <col style="width: 80%">
  1157. </colgroup>
  1158. <tr>
  1159. <th>작성자</th>
  1160. <td>
  1161. <div class="form-row">
  1162. <input id="modifUser" type="text" name="" class="form-control" placeholder="이름을 입력하세요" value="${data._SES_NAME}" readonly>
  1163. </div>
  1164. </td>
  1165. </tr>
  1166. <tr id="memoInfo">
  1167. <!-- 컨텐츠 동적 생성 -->
  1168. </tr>
  1169. <tr>
  1170. <th>처리일시</th>
  1171. <td>
  1172. <div class="datetimepickerWrap form-row">
  1173. <input id="modifMemoDateTime" class="datetimepicker form-control" type="text" placeholder="측정일시(미 입력시 현재시간 자동등록)">
  1174. </div>
  1175. </td>
  1176. </tr>
  1177. </table>
  1178. </div>
  1179. <div class="modal-footer">
  1180. <button type="button" class="removeMemo btn btn-danger" onclick="deleteMemoData()">삭제</button>
  1181. <button type="button" class="btn btn-outline-primary" data-dismiss="modal">취소</button>
  1182. <button type="button" class="btn btn-primary" onclick="modifyMemoData()">수정</button>
  1183. </div>
  1184. </div>
  1185. </div>
  1186. </div>
  1187. <div class="wrapper">
  1188. <jsp:include page="${data._INCLUDE}/sidebar.jsp"></jsp:include>
  1189. <div class="main">
  1190. <jsp:include page="${data._INCLUDE}/top.jsp"></jsp:include>
  1191. <main class="content">
  1192. <div class="container-fluid p-0">
  1193. <div class="row">
  1194. <div class="col-12 col-lg-6">
  1195. <h1 class="h3 mb-3">건강정보 조회</h1>
  1196. </div>
  1197. <div class="col-12 col-lg-6 text-right">
  1198. <nav aria-label="breadcrumb">
  1199. <ol class="breadcrumb">
  1200. <li class="breadcrumb-item"><a href="javscript:;">Home</a></li>
  1201. <li class="breadcrumb-item">진료관리</li>
  1202. <li class="breadcrumb-item active">건강정보 조회</li>
  1203. </ol>
  1204. </nav>
  1205. </div>
  1206. </div>
  1207. <div class="row">
  1208. <div class="col-12">
  1209. <div id="home" class="card">
  1210. <div class="row mb-3">
  1211. <div class="col-12">
  1212. <button class="btn btn-lg btn-secondary mr-2" onclick="gotoList()"><i class="mdi mdi-backburger"></i> 대시보드</button>
  1213. <c:if test="${data._SES_GROUP_IDX ne '3'}">
  1214. <button id="downloadData" type="button" class="btn btn-lg btn-success" data-toggle="modal" data-target="#excelDownMemo"><i class="mdi mdi-file-excel-outline"></i> 건강정보 다운로드</button>
  1215. </c:if>
  1216. </div>
  1217. </div>
  1218. <div class="toggle">
  1219. <div class="toggleHeader card-header">
  1220. <h1 class="h4">
  1221. <c:set var="now" value="<%=new java.util.Date()%>" />
  1222. <fmt:formatDate value="${now}" pattern="yyyy" var="sysYear"/>
  1223. <fmt:parseDate value="${info.jumin}" pattern="yyyy년 MM월 dd일" var="birthDate"/>
  1224. <fmt:formatDate value="${birthDate}" pattern="yyyy" var="birthYear"/>
  1225. <c:set var="age" value="${sysYear-birthYear}" />
  1226. <span class="mr-2"><span id="roomNumber"><c:out value="${info.roomNumber}" />호</span> <span id="patientName"><c:out value="${info.patientName}" /></span>(<span id="patientGender"><c:out value="${info.gender=='M'?'남':'여'}" /></span>/<span id="patientYearsOld"><c:out value="${age}" /></span>세) 환자 기본정보</span>
  1227. <button class="untactStart btn btn-lg btn-warning" onclick="nonFaceStart(event);"><i class="mdi mdi-message-video"></i> 비대면 진료</button>
  1228. </h1>
  1229. <a href="javscript:;" class="toggleBtn">메뉴</a>
  1230. </div>
  1231. <div id="userInfo" class="card-body user-info">
  1232. <div class="mb-3">
  1233. <button class="patientInfo btn btn-primary" onclick="gotoPatientInfo()"><i class="mdi mdi-account"></i> 환자정보 관리</button>
  1234. </div>
  1235. <jsp:include page="${data._INCLUDE}/patientInfo.jsp"></jsp:include>
  1236. </div>
  1237. </div>
  1238. <!-- <hr> -->
  1239. <div class="card-body">
  1240. <section id="symptomSection" class="phrSection">
  1241. <div class="col-lg-12">
  1242. <div class="row">
  1243. <div class="col-lg-3">
  1244. <h1 class="h4">
  1245. <div class="sectionToggle"></div>
  1246. <span class="phrTitle symptom">임상증상</span>
  1247. </h1>
  1248. </div>
  1249. <div class="col-lg-9 text-right">
  1250. <button id="symptom" type="button" class="btn btn-primary" data-toggle="modal" data-target="#defaultModalPrimary_2"><i class="mdi mdi-clipboard-pulse-outline"></i> 임상증상 추가</button>
  1251. </div>
  1252. </div>
  1253. </div>
  1254. <div class="sectionContent col-lg-12">
  1255. <div class="row">
  1256. <div class="sectionNav col-lg-12">
  1257. <ul>
  1258. <li><a href="#home">환자정보</a></li>
  1259. <li class="active"><a href="#symptomSection">임상증상</a></li>
  1260. <li><a href="#feverSection">체온</a></li>
  1261. <li><a href="#bloodPressureSection">혈압 / 맥박</a></li>
  1262. <li><a href="#oxygenSection">산소포화도</a></li>
  1263. <li><a href="#sugarSection">혈당</a></li>
  1264. <li><a href="#medicalMemoSection">의료진 메모</a></li>
  1265. </ul>
  1266. </div>
  1267. <div class="col-lg-12">
  1268. <div class="phrDataTableWrap table-responsive mb-4">
  1269. <table id="symptomDataTable" class="symptomDataTable table data-table text-center">
  1270. <thead>
  1271. <tr>
  1272. <th>측정일시</th>
  1273. <th>기침</th>
  1274. <th>호흡곤란</th>
  1275. <th>오한</th>
  1276. <th>근육통</th>
  1277. <th>두통</th>
  1278. <th>인후통</th>
  1279. <th>후각/미각 소실</th>
  1280. <th>피로</th>
  1281. <th>식욕감소</th>
  1282. <th>가래</th>
  1283. <th>오심</th>
  1284. <th>구토</th>
  1285. <th>설사</th>
  1286. <th>어지러움</th>
  1287. <th>콧물/코막힘</th>
  1288. <th>기타증상</th>
  1289. <th>기록자</th>
  1290. <th>기록일시</th>
  1291. </tr>
  1292. </thead>
  1293. <tbody>
  1294. <c:set var="symptomTotal" value="${symptomResult.size()}" />
  1295. <c:set var="yesHtml" value="<i class='mdi mdi-check-bold'></i>" />
  1296. <c:set var="noHtml" value="-" />
  1297. <c:choose>
  1298. <c:when test="${symptomTotal > 0}">
  1299. <c:forEach var="d" items="${symptomResult}">
  1300. <tr>
  1301. <th><c:out value="${d.recordedDateFormatted}" /></th>
  1302. <td>${d.coughCheck == 'Y' ? yesHtml : noHtml}</td>
  1303. <td>${d.dyspneaCheck == 'Y' ? yesHtml : noHtml}</td>
  1304. <td>${d.coldFitCheck == 'Y' ? yesHtml : noHtml}</td>
  1305. <td>${d.musclePainCheck == 'Y' ? yesHtml : noHtml}</td>
  1306. <td>${d.headacheCheck == 'Y' ? yesHtml : noHtml}</td>
  1307. <td>${d.soreThroatCheck == 'Y' ? yesHtml : noHtml}</td>
  1308. <td>${d.smellPalateCheck == 'Y' ? yesHtml : noHtml}</td>
  1309. <td>${d.fatigueCheck == 'Y' ? yesHtml : noHtml}</td>
  1310. <td>${d.appetiteLossCheck == 'Y' ? yesHtml : noHtml}</td>
  1311. <td>${d.sputumCheck == 'Y' ? yesHtml : noHtml}</td>
  1312. <td>${d.ocinCheck == 'Y' ? yesHtml : noHtml}</td>
  1313. <td>${d.vomitingCheck == 'Y' ? yesHtml : noHtml}</td>
  1314. <td>${d.diarrheaCheck == 'Y' ? yesHtml : noHtml}</td>
  1315. <td>${d.dizzinessCheck == 'Y' ? yesHtml : noHtml}</td>
  1316. <td>${d.noseCheck == 'Y' ? yesHtml : noHtml}</td>
  1317. <td>${d.etcCheck == 'Y' ? d.etcContent : noHtml}</td>
  1318. <td><c:out value="${d.recordedByName}" /></td>
  1319. <td><c:out value="${d.createDateFormatted}" /></td>
  1320. </tr>
  1321. </c:forEach>
  1322. </c:when>
  1323. <c:otherwise>
  1324. <tr>
  1325. <td colspan=19>데이터가 없습니다.</td>
  1326. </tr>
  1327. </c:otherwise>
  1328. </c:choose>
  1329. </tbody>
  1330. </table>
  1331. </div>
  1332. </div>
  1333. </div>
  1334. </div>
  1335. </section>
  1336. <!-- <hr> -->
  1337. <section id="feverSection" class="phrSection">
  1338. <div class="col-lg-12">
  1339. <div class="row">
  1340. <div class="col-lg-3">
  1341. <h1 class="h4">
  1342. <div class="sectionToggle"></div>
  1343. <span class="phrTitle fever">체온</span>
  1344. </h1>
  1345. </div>
  1346. <div class="col-lg-9 text-right">
  1347. <button id="temperature" type="button" class="btn btn-primary ml-2" data-toggle="modal" data-target="#defaultModalPrimary_1"><i class="mdi mdi-clipboard-pulse-outline"></i> 체온 추가</button>
  1348. </div>
  1349. </div>
  1350. </div>
  1351. <div class="sectionContent col-lg-12">
  1352. <div class="row">
  1353. <div class="sectionNav col-lg-12">
  1354. <ul>
  1355. <li><a href="#home">환자정보</a></li>
  1356. <li><a href="#symptomSection">임상증상</a></li>
  1357. <li class="active"><a href="#feverSection">체온</a></li>
  1358. <li><a href="#bloodPressureSection">혈압 / 맥박</a></li>
  1359. <li><a href="#oxygenSection">산소포화도</a></li>
  1360. <li><a href="#sugarSection">혈당</a></li>
  1361. <li><a href="#medicalMemoSection">의료진 메모</a></li>
  1362. </ul>
  1363. </div>
  1364. <div class="col-lg-6 col-md-12">
  1365. <div class="graph-area mb-4">
  1366. <canvas id="temperatureChart" style="width: 100%; height: 370px"></canvas>
  1367. </div>
  1368. </div>
  1369. <div class="col-lg-6 col-md-12">
  1370. <h1 class="h4 text-right">
  1371. <span class="small showLegend" data-toggle="modal" data-target="#legendGuide"><i class="mdi mdi-comment-question-outline"></i> 알람 표시 기준</span>
  1372. </h1>
  1373. <div class="phrDataTableWrap table-responsive">
  1374. <table id="temperatureDataTable" class="phrDataTable table data-table text-center">
  1375. <thead>
  1376. <tr>
  1377. <th>측정일시</th>
  1378. <th>체온</th>
  1379. <th>기록자</th>
  1380. <th>기록일시</th>
  1381. </tr>
  1382. </thead>
  1383. <tbody>
  1384. <c:set var="temperatureTotal" value="${temperatureResult.size()}" />
  1385. <c:choose>
  1386. <c:when test="${temperatureTotal > 0}">
  1387. <c:forEach var="i" begin="1" end="${temperatureTotal}">
  1388. <tr>
  1389. <td><c:out value="${temperatureResult[temperatureTotal-i].recordedDateFormatted}" /></td>
  1390. <td><span class="${temperatureResult[temperatureTotal-i].isWarning ? 'text-danger' : ''}"><c:out value="${temperatureResult[temperatureTotal-i].phrValue}" /></span></td>
  1391. <td><c:out value="${temperatureResult[temperatureTotal-i].recordedByName}" /></td>
  1392. <td><c:out value="${temperatureResult[temperatureTotal-i].createDateFormatted}" /></td>
  1393. </tr>
  1394. </c:forEach>
  1395. </c:when>
  1396. <c:otherwise>
  1397. <tr>
  1398. <td colspan=4>데이터가 없습니다.</td>
  1399. </tr>
  1400. </c:otherwise>
  1401. </c:choose>
  1402. </tbody>
  1403. </table>
  1404. </div>
  1405. </div>
  1406. </div>
  1407. </div>
  1408. </section>
  1409. <!-- <hr> -->
  1410. <section id="bloodPressureSection" class="phrSection">
  1411. <div class="col-lg-12">
  1412. <div class="row">
  1413. <div class="col-lg-3">
  1414. <h1 class="h4">
  1415. <div class="sectionToggle"></div>
  1416. <span class="phrTitle bloodPressure">혈압 / 맥박</span>
  1417. </h1>
  1418. </div>
  1419. <div class="col-lg-9 text-right">
  1420. <button id="bloodPressure" type="button" class="btn btn-primary ml-2" data-toggle="modal" data-target="#defaultModalPrimary_1"><i class="mdi mdi-clipboard-pulse-outline"></i> 혈압 / 맥박 추가</button>
  1421. </div>
  1422. </div>
  1423. </div>
  1424. <div class="sectionContent col-lg-12">
  1425. <div class="row">
  1426. <div class="sectionNav col-lg-12">
  1427. <ul>
  1428. <li><a href="#home">환자정보</a></li>
  1429. <li><a href="#symptomSection">임상증상</a></li>
  1430. <li><a href="#feverSection">체온</a></li>
  1431. <li class="active"><a href="#bloodPressureSection">혈압 / 맥박</a></li>
  1432. <li><a href="#oxygenSection">산소포화도</a></li>
  1433. <li><a href="#sugarSection">혈당</a></li>
  1434. <li><a href="#medicalMemoSection">의료진 메모</a></li>
  1435. </ul>
  1436. </div>
  1437. <div class="col-lg-6 col-md-12">
  1438. <div class="graph-area mb-4">
  1439. <canvas id="bloodPressurePulseChart" style="width: 100%; height: 370px"></canvas>
  1440. </div>
  1441. </div>
  1442. <div class="col-lg-6 col-md-12">
  1443. <h1 class="h4 text-right">
  1444. <span class="small showLegend" data-toggle="modal" data-target="#legendGuide"><i class="mdi mdi-comment-question-outline"></i> 알람 표시 기준</span>
  1445. </h1>
  1446. <div class="phrDataTableWrap table-responsive">
  1447. <table id="bloodPressureDataTable" class="phrDataTable table data-table text-center">
  1448. <thead>
  1449. <tr>
  1450. <th>측정일시</th>
  1451. <th>혈압</th>
  1452. <th>맥박</th>
  1453. <th>기록자</th>
  1454. <th>기록일시</th>
  1455. </tr>
  1456. </thead>
  1457. <tbody>
  1458. <c:set var="bloodPressureUnionTotal" value="${bloodPressureUnionResult.size()}" />
  1459. <c:choose>
  1460. <c:when test="${bloodPressureUnionTotal > 0}">
  1461. <c:forEach var="i" begin="1" end="${bloodPressureUnionTotal}">
  1462. <fmt:parseNumber var="bpH" value="${bloodPressureUnionResult[bloodPressureUnionTotal-i].phrValue}" integerOnly="true" />
  1463. <fmt:parseNumber var="bpL" value="${bloodPressureUnionResult[bloodPressureUnionTotal-i].phrValue2}" integerOnly="true" />
  1464. <fmt:parseNumber var="pr" value="${bloodPressureUnionResult[bloodPressureUnionTotal-i].phrValueExtra}" integerOnly="true" />
  1465. <tr>
  1466. <td><c:out value="${bloodPressureUnionResult[bloodPressureUnionTotal-i].recordedDateFormatted}" /></td>
  1467. <td><span class="${bloodPressureUnionResult[bloodPressureUnionTotal-i].isWarning ? 'text-danger' : ''}"><c:out value="${bpH}/${bpL}" /></span></td>
  1468. <td><span class="${bloodPressureUnionResult[bloodPressureUnionTotal-i].isExtraWarning ? 'text-danger' : ''}"><c:out value="${pr}" /></span></td>
  1469. <td><c:out value="${bloodPressureUnionResult[bloodPressureUnionTotal-i].recordedByName}" /></td>
  1470. <td><c:out value="${bloodPressureUnionResult[bloodPressureUnionTotal-i].createDateFormatted}" /></td>
  1471. </tr>
  1472. </c:forEach>
  1473. </c:when>
  1474. <c:otherwise>
  1475. <tr>
  1476. <td colspan=5>데이터가 없습니다.</td>
  1477. </tr>
  1478. </c:otherwise>
  1479. </c:choose>
  1480. </tbody>
  1481. </table>
  1482. </div>
  1483. </div>
  1484. </div>
  1485. </div>
  1486. </section>
  1487. <!-- <hr> -->
  1488. <section id="oxygenSection" class="phrSection">
  1489. <div class="col-lg-12">
  1490. <div class="row">
  1491. <div class="col-lg-3">
  1492. <h1 class="h4">
  1493. <div class="sectionToggle"></div>
  1494. <span class="phrTitle oxygen">산소포화도</span>
  1495. </h1>
  1496. </div>
  1497. <div class="col-lg-9 text-right">
  1498. <button id="oxygenSaturation" type="button" class="btn btn-primary ml-2" data-toggle="modal" data-target="#defaultModalPrimary_1"><i class="mdi mdi-clipboard-pulse-outline"></i> 산소포화도 추가</button>
  1499. </div>
  1500. </div>
  1501. </div>
  1502. <div class="sectionContent col-lg-12">
  1503. <div class="row">
  1504. <div class="sectionNav col-lg-12">
  1505. <ul>
  1506. <li><a href="#home">환자정보</a></li>
  1507. <li><a href="#symptomSection">임상증상</a></li>
  1508. <li><a href="#feverSection">체온</a></li>
  1509. <li><a href="#bloodPressureSection">혈압 / 맥박</a></li>
  1510. <li class="active"><a href="#oxygenSection">산소포화도</a></li>
  1511. <li><a href="#sugarSection">혈당</a></li>
  1512. <li><a href="#medicalMemoSection">의료진 메모</a></li>
  1513. </ul>
  1514. </div>
  1515. <div class="col-lg-6 col-md-12">
  1516. <div class="graph-area mb-4">
  1517. <canvas id="oxygenSaturationChart" style="width: 100%; height: 370px"></canvas>
  1518. </div>
  1519. </div>
  1520. <div class="col-lg-6 col-md-12">
  1521. <h1 class="h4 text-right">
  1522. <span class="small showLegend" data-toggle="modal" data-target="#legendGuide"><i class="mdi mdi-comment-question-outline"></i> 알람 표시 기준</span>
  1523. </h1>
  1524. <div class="phrDataTableWrap table-responsive">
  1525. <table id="oxygenSaturationDataTable" class="phrDataTable table data-table text-center">
  1526. <thead>
  1527. <tr>
  1528. <th>측정일시</th>
  1529. <th>산소포화도</th>
  1530. <th>기록자</th>
  1531. <th>기록일시</th>
  1532. </tr>
  1533. </thead>
  1534. <tbody>
  1535. <c:set var="oxygenSaturationTotal" value="${oxygenSaturationResult.size()}" />
  1536. <c:choose>
  1537. <c:when test="${oxygenSaturationTotal > 0}">
  1538. <c:forEach var="i" begin="1" end="${oxygenSaturationTotal}">
  1539. <fmt:parseNumber var="phrValue" value="${oxygenSaturationResult[oxygenSaturationTotal-i].phrValue}" integerOnly="true" />
  1540. <tr>
  1541. <td><c:out value="${oxygenSaturationResult[oxygenSaturationTotal-i].recordedDateFormatted}" /></td>
  1542. <td><span class="${oxygenSaturationResult[oxygenSaturationTotal-i].isWarning ? 'text-danger' : ''}"><c:out value="${phrValue}" /></span></td>
  1543. <td><c:out value="${oxygenSaturationResult[oxygenSaturationTotal-i].recordedByName}" /></td>
  1544. <td><c:out value="${oxygenSaturationResult[oxygenSaturationTotal-i].createDateFormatted}" /></td>
  1545. </tr>
  1546. </c:forEach>
  1547. </c:when>
  1548. <c:otherwise>
  1549. <tr>
  1550. <td colspan=4>데이터가 없습니다.</td>
  1551. </tr>
  1552. </c:otherwise>
  1553. </c:choose>
  1554. </tbody>
  1555. </table>
  1556. </div>
  1557. </div>
  1558. </div>
  1559. </div>
  1560. </section>
  1561. <!-- <hr> -->
  1562. <section id="sugarSection" class="phrSection">
  1563. <div class="col-lg-12">
  1564. <div class="row">
  1565. <div class="col-lg-3">
  1566. <h1 class="h4">
  1567. <div class="sectionToggle"></div>
  1568. <span class="phrTitle sugar">혈당</span>
  1569. </h1>
  1570. </div>
  1571. <div class="col-lg-9 text-right">
  1572. <button id="bloodSugar" type="button" class="btn btn-primary ml-2" data-toggle="modal" data-target="#defaultModalPrimary_1"><i class="mdi mdi-clipboard-pulse-outline"></i> 혈당 추가</button>
  1573. </div>
  1574. </div>
  1575. </div>
  1576. <div class="sectionContent col-lg-12">
  1577. <div class="row">
  1578. <div class="sectionNav col-lg-12">
  1579. <ul>
  1580. <li><a href="#home">환자정보</a></li>
  1581. <li><a href="#symptomSection">임상증상</a></li>
  1582. <li><a href="#feverSection">체온</a></li>
  1583. <li><a href="#bloodPressureSection">혈압 / 맥박</a></li>
  1584. <li><a href="#oxygenSection">산소포화도</a></li>
  1585. <li class="active"><a href="#sugarSection">혈당</a></li>
  1586. <li><a href="#medicalMemoSection">의료진 메모</a></li>
  1587. </ul>
  1588. </div>
  1589. <div class="col-lg-6 col-md-12">
  1590. <div class="graph-area mb-4">
  1591. <canvas id="bloodSugarChart" style="width: 100%; height: 370px"></canvas>
  1592. </div>
  1593. </div>
  1594. <div class="col-lg-6 col-md-12">
  1595. <h1 class="h4 text-right">
  1596. <span class="small showLegend" data-toggle="modal" data-target="#legendGuide"><i class="mdi mdi-comment-question-outline"></i> 알람 표시 기준</span>
  1597. </h1>
  1598. <div class="phrDataTableWrap table-responsive">
  1599. <table id="bloodSugarDataTable" class="phrDataTable table data-table text-center">
  1600. <thead>
  1601. <tr>
  1602. <th>측정일시</th>
  1603. <th>혈당</th>
  1604. <th>기록자</th>
  1605. <th>기록일시</th>
  1606. </tr>
  1607. </thead>
  1608. <tbody>
  1609. <c:set var="bloodSugarTotal" value="${bloodSugarResult.size()}" />
  1610. <c:choose>
  1611. <c:when test="${bloodSugarTotal > 0}">
  1612. <c:forEach var="i" begin="1" end="${bloodSugarTotal}">
  1613. <fmt:parseNumber var="phrValue" value="${bloodSugarResult[bloodSugarTotal-i].phrValue}" integerOnly="true" />
  1614. <tr>
  1615. <td><c:out value="${bloodSugarResult[bloodSugarTotal-i].recordedDateFormatted}" /></td>
  1616. <td><span class="${bloodSugarResult[bloodSugarTotal-i].isWarning ? 'text-danger' : ''}"><c:out value="${phrValue}" /></span></td>
  1617. <td><c:out value="${bloodSugarResult[bloodSugarTotal-i].recordedByName}" /></td>
  1618. <td><c:out value="${bloodSugarResult[bloodSugarTotal-i].createDateFormatted}" /></td>
  1619. </tr>
  1620. </c:forEach>
  1621. </c:when>
  1622. <c:otherwise>
  1623. <tr>
  1624. <td colspan=4>데이터가 없습니다.</td>
  1625. </tr>
  1626. </c:otherwise>
  1627. </c:choose>
  1628. </tbody>
  1629. </table>
  1630. </div>
  1631. </div>
  1632. </div>
  1633. </div>
  1634. </section>
  1635. <!-- <hr> -->
  1636. <section id="medicalMemoSection" class="phrSection">
  1637. <h1 class="h4 col-lg-12">
  1638. <span class="phrTitle medicalMemo">의료진 메모</span>
  1639. <!-- <button id="medicalMemo" type="button" class="btn btn-primary ml-2" data-toggle="modal" data-target="#defaultModalPrimaryMemo"><i class="mdi mdi-clipboard-alert-outline"></i> 메모추가</button> -->
  1640. </h1>
  1641. <div class="col-lg-12">
  1642. <div class="row">
  1643. <div class="sectionNav col-lg-12">
  1644. <ul>
  1645. <li><a href="#home">환자정보</a></li>
  1646. <li><a href="#symptomSection">임상증상</a></li>
  1647. <li><a href="#feverSection">체온</a></li>
  1648. <li><a href="#bloodPressureSection">혈압 / 맥박</a></li>
  1649. <li><a href="#oxygenSection">산소포화도</a></li>
  1650. <li><a href="#sugarSection">혈당</a></li>
  1651. <li class="active"><a href="#medicalMemoSection">의료진 메모</a></li>
  1652. </ul>
  1653. </div>
  1654. <div class="col-lg-4">
  1655. <textarea id="memoContent" class="medicalMemo form-control mb-3" rows="15" placeholder="내용을 입력하세요"></textarea>
  1656. <div class="datetimepickerWrap mb-3">
  1657. <input id="eventDateTime3" class="datetimepicker form-control" type="text" placeholder="처리 일시 (미 입력시 현재시간 자동등록)" />
  1658. </div>
  1659. <div class="text-right">
  1660. <button id="medicalMemo" type="button" class="btn btn-primary ml-2" onclick="insertMemoData()"><i class="mdi mdi-clipboard-alert-outline"></i> 메모추가</button>
  1661. </div>
  1662. </div>
  1663. <div class="col-lg-8">
  1664. <div class="memoDataTableWrap table-responsive mb-4">
  1665. <table id="memoDataTable" class="memoDataTable table data-table text-center">
  1666. <thead>
  1667. <tr>
  1668. <th>처리일시</th>
  1669. <th>내용</th>
  1670. <th>기록자</th>
  1671. <th>기록일시</th>
  1672. </tr>
  1673. </thead>
  1674. <tbody>
  1675. <c:set var="memoTotal" value="${memoResult.size()}" />
  1676. <c:set var="loginId" value="${data._SES_ID}" />
  1677. <c:choose>
  1678. <c:when test="${memoTotal > 0}">
  1679. <c:forEach var="d" items="${memoResult}">
  1680. <tr>
  1681. <td><c:out value="${d.recordedDateFormatted}" /></td>
  1682. <c:choose>
  1683. <c:when test="${d.canModify && d.recordedById.equals(loginId)}">
  1684. <td><pre id='memo_${d.idx}' class='contentsEdit' onClick='handleModifyMemo("${d.idx}", "${d.recordedDate}")'>${d.contents}</pre></td>
  1685. </c:when>
  1686. <c:otherwise>
  1687. <td><pre>${d.contents}</pre></td>
  1688. </c:otherwise>
  1689. </c:choose>
  1690. <td><c:out value="${d.recordedByName}" /></td>
  1691. <td><c:out value="${d.createDateFormatted}" /></td>
  1692. </tr>
  1693. </c:forEach>
  1694. </c:when>
  1695. <c:otherwise>
  1696. <tr>
  1697. <td colspan=4>데이터가 없습니다.</td>
  1698. </tr>
  1699. </c:otherwise>
  1700. </c:choose>
  1701. </tbody>
  1702. </table>
  1703. </div>
  1704. </div>
  1705. </div>
  1706. </div>
  1707. </section>
  1708. </div>
  1709. </div>
  1710. </div>
  1711. </div>
  1712. <!-- <div class="row">
  1713. <div class="col-12">
  1714. <div class="card">
  1715. <ul class="tab-nav">
  1716. <li class="tab-item active" tabindex="#tabPhr">건강정보이력</li>
  1717. <li class="tab-item" tabindex="#tabSymptom">임상증상</li>
  1718. <li class="tab-item" tabindex="#tabMemo">의료진 메모</li>
  1719. </ul>
  1720. <div id="tabPhr" class="tab in">
  1721. <div class="card-header">
  1722. <h1 class="h4">
  1723. - 건강정보 조회 <label> <select class="custom-select ml-1 form-control" id=phrTypeSelect name="inputState" onchange="retrievePhrData()">
  1724. <option value="temperature" selected>체온</option>
  1725. <option value="bloodPressure">혈압</option>
  1726. <option value="oxygenSaturation">산소포화도</option>
  1727. <option value="pulseRate">맥박</option>
  1728. <option value="bloodSugar">혈당</option>
  1729. </select>
  1730. </label> <label class="ml-1">
  1731. <button type="button" class="btn btn-primary ml-2" data-toggle="modal" data-target="#defaultModalPrimary_1">기록추가</button>
  1732. </label>
  1733. </h1>
  1734. </div>
  1735. <div class="card-body">
  1736. <div class="graph-area mb-4" style="height:300px;">
  1737. <canvas id="phrChart"></canvas>
  1738. </div>
  1739. <button class="btn btn-success" onclick="getExcel('');">Excel 다운로드</button>
  1740. <h1 class="h4 text-right"><span class="small showLegend ml-2" data-toggle="modal" data-target="#legendGuide"><i class="mdi mdi-comment-question-outline"></i> 알람 표시 기준</span></h1>
  1741. <div class="table-responsive">
  1742. <table id="phrDataTable" class="table data-table text-center">
  1743. <thead>
  1744. <tr>
  1745. <th>기록일시</th>
  1746. <th>체온</th>
  1747. <th>기록자</th>
  1748. </tr>
  1749. </thead>
  1750. <tbody>
  1751. <c:choose>
  1752. <c:when test="${phrTotal > 0}">
  1753. <c:forEach var="i" begin="1" end="${phrTotal}">
  1754. <tr>
  1755. <td><c:out value="${phrItems[phrTotal-i].createDateFormatted}" /></td>
  1756. <td><span class="${phrItems[phrTotal-i].isWarning ? 'text-danger' : ''}"><c:out value="${phrItems[phrTotal-i].phrValue}" /></span></td>
  1757. <td><c:out value="${phrItems[phrTotal-i].recordedByName}" /></td>
  1758. </tr>
  1759. </c:forEach>
  1760. </c:when>
  1761. <c:otherwise>
  1762. <tr>
  1763. <td colspan=3>데이터가 없습니다.</td>
  1764. </tr>
  1765. </c:otherwise>
  1766. </c:choose>
  1767. </tbody>
  1768. </table>
  1769. </div>
  1770. </div>
  1771. </div>
  1772. <div id="tabSymptom" class="tab">
  1773. <div class="card-header">
  1774. <h1 class="h4">
  1775. - 임상증상 <label class="ml-1">
  1776. <button type="button" class="btn btn-primary ml-2" data-toggle="modal" data-target="#defaultModalPrimary_2">증상추가</button>
  1777. </label>
  1778. <button class="btn btn-success text-right" style="float:right;" onclick="getExcel('symptom');">Excel 다운로드</button>
  1779. </h1>
  1780. </div>
  1781. <div class="card-body">
  1782. <div class="table-responsive">
  1783. <table id="symptomDataTable" class="table data-table text-center">
  1784. <thead>
  1785. <tr>
  1786. <th>기록일시</th>
  1787. <th>기침</th>
  1788. <th>호흡곤란</th>
  1789. <th>오한</th>
  1790. <th>근육통</th>
  1791. <th>두통</th>
  1792. <th>인후통</th>
  1793. <th>후각/미각 손실</th>
  1794. <th>피로</th>
  1795. <th>식욕감소</th>
  1796. <th>가래</th>
  1797. <th>오심</th>
  1798. <th>구토</th>
  1799. <th>설사</th>
  1800. <th>어지러움</th>
  1801. <th>콧물/코막힘</th>
  1802. <th>기타증상</th>
  1803. <th>기록자</th>
  1804. </tr>
  1805. </thead>
  1806. <tbody>
  1807. </tbody>
  1808. </table>
  1809. </div>
  1810. </div>
  1811. </div>
  1812. <div id="tabMemo" class="tab">
  1813. <div class="card-header">
  1814. <h1 class="h4">
  1815. - 의료진 메모
  1816. <button type="button" class="addMemo btn btn-primary ml-2" data-toggle="modal">메모추가</button>
  1817. <button class="btn btn-success text-right" style="float:right;" onclick="getExcel('memo');">Excel 다운로드</button>
  1818. </h1>
  1819. </div>
  1820. <div class="card-body">
  1821. <div class="table-responsive">
  1822. <table id="memoDataTable" class="table data-table text-center">
  1823. <thead>
  1824. <tr>
  1825. <th>기록일시</th>
  1826. <th>내용</th>
  1827. <th>기록자</th>
  1828. </tr>
  1829. </thead>
  1830. <tbody>
  1831. </tbody>
  1832. </table>
  1833. </div>
  1834. </div>
  1835. </div>
  1836. </div>
  1837. </div>
  1838. </div>-->
  1839. </div>
  1840. </main>
  1841. <jsp:include page="${data._INCLUDE}/footer.jsp"></jsp:include>
  1842. </div>
  1843. </div>
  1844. </body>
  1845. </html>