info.jsp 84 KB

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