info.jsp 86 KB

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