info.jsp 83 KB

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