MMR04800.js 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817
  1. /*
  2. - ▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩
  3. 환자요약 ( MMR04800_환자요약.xrw - JScript )
  4. - Version :
  5. 1) : Ver.1.00.01
  6. - ▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩
  7. */
  8. var isUpdated = false;
  9. var instance = document.models(0).instances(0);
  10. var uInfo = getUserInfos();
  11. uInfo = uInfo.split("|");
  12. var pid = "";
  13. /**
  14. * @desc : 화면 초기화
  15. * @
  16. * @param :
  17. * @return :
  18. * @authur : 박종훈
  19. * @---------------------------------------------------
  20. */
  21. function fInitalize()
  22. {
  23. fClose();
  24. model.removeNodeset("/root/temp/attach");
  25. window.modelesstopmost = true;
  26. model.makeValue("/root/init/uid", uInfo[0]);
  27. model.makeValue("/root/init/udeptcd", uInfo[8]);
  28. model.setValue("/root/init/reqmedireclist/diffdt", 12); //검색 디폴트 12개월
  29. fAddDateReq("today");
  30. fGetUserEnvOcsOrdAnsw("/root/send/reqdata", "/root/envinit/srchcond", "011");
  31. fGetUserEnvOcsOrdAnsw("/root/send/reqdata", "/root/envinit/srchday", "012");
  32. var srchcond = model.getValue("/root/envinit/srchcond/answcnt");
  33. var srchday = model.getValue("/root/envinit/srchday/answcnt");
  34. switch(srchcond)
  35. {
  36. case "001" :
  37. model.setValue("/root/init/schkind", "2");
  38. break;
  39. case "002" :
  40. model.setValue("/root/init/schkind", "3");
  41. break;
  42. case "003" :
  43. model.setValue("/root/init/schkind", "1");
  44. break;
  45. case "" :
  46. model.setValue("/root/init/schkind", "2");
  47. break;
  48. }
  49. radio1.refresh();
  50. switch(srchday)
  51. {
  52. case "001" :
  53. model.setValue("/root/init/reqmedireclist/diffdt", "1");
  54. break;
  55. case "002" :
  56. model.setValue("/root/init/reqmedireclist/diffdt", "3");
  57. break;
  58. case "003" :
  59. model.setValue("/root/init/reqmedireclist/diffdt", "6");
  60. break;
  61. case "004" :
  62. model.setValue("/root/init/reqmedireclist/diffdt", "12");
  63. break;
  64. case "005" :
  65. model.setValue("/root/init/reqmedireclist/diffdt", "-");
  66. break;
  67. }
  68. combo4.refresh();
  69. combo4.dispatch("xforms-value-changed");
  70. if (model.getValue("/root/send/pid") != opener.model.getValue("/root/main/paminfo/pid"))
  71. {
  72. pid = opener.window.javascript.getParameter("SSMMP04800_pid"); //부모창으로부터 환자등록번호를 파라미터로 받는다.
  73. if (pid == "")
  74. {
  75. pid = opener.model.getValue("/root/main/paminfo/pid");
  76. }
  77. if ( !isNull ( pid ) )
  78. {
  79. ipt_pid.value = pid;
  80. fPidKeyPress(); //등록번호로 환자 정보조회
  81. model.setValue("/root/main/patinfo/patinfolist/pid", pid);
  82. fSelect_sub();
  83. }
  84. if (isPopup())
  85. {
  86. btn_detl.attribute("visibility") = "hidden";
  87. btn_close.attribute("visibility") = "visiblle";
  88. var list = getGlobalVariable("emr_gsv_cmmsrckcond");
  89. if(list != "" && list != null){
  90. model.removeNodeset("/root/send");
  91. setCSVToNode("/root",list,"send");
  92. }
  93. }
  94. grd_smmlist.autoresize = true;
  95. model.refresh();
  96. }
  97. }
  98. /**
  99. * @desc : 조회버튼 클릭
  100. * @
  101. * @param :
  102. * @return :
  103. * @authur : 박종훈
  104. * @---------------------------------------------------
  105. */
  106. function fSrchClick()
  107. {
  108. if (isPopup()) {
  109. fSelect_Pop();
  110. } else {
  111. fSelect_sub();
  112. }
  113. }
  114. function fAddrow_old(val, val2)
  115. {
  116. var nodelistSmm = instance.selectNodes("/root/main/smmlist");
  117. var nodelength = nodelistSmm.length;
  118. var smmcnts = model.getValue("/root/main/smmlist[1]/smmcnts");
  119. if (val == "true"){ //첨부파일인 경우
  120. if( val2 != "" ){//수정
  121. var fileupdata = messageBox(name + " 파일 수정을" , "S001");
  122. if(fileupdata == '6'){
  123. var maxsize = upload1.attribute("filesize");
  124. var files = window.fileDialog("open","|","false");
  125. var filelist = files.split("|");
  126. var filename = files.lastIndexOf("\\");
  127. for(var i = 0 ; i < filelist.length ; i++ ) {
  128. grd_smmlist.addRow();
  129. grd_smmlist.valueMatrix(grd_smmlist.rows - 1, grd_smmlist.colRef("attfilepath")) = filelist[i];
  130. grd_smmlist.valueMatrix(grd_smmlist.rows - 1, grd_smmlist.colRef("attfilenm")) = files.substring(filename + 1);
  131. grd_smmlist.valueMatrix(grd_smmlist.rows - 1, grd_smmlist.colRef("smmdd")) = getCurrentDate();
  132. grd_smmlist.valueMatrix(grd_smmlist.rows - 1, grd_smmlist.colRef("delyn")) = 'N';
  133. grd_attach.valueMatrix(grd_attach.rows - 1, 0) = filelist[i];
  134. if (!checkFileSize(upload1)){
  135. grd_attach.removeItem();
  136. messageBox("파일 크기가 최대치("+maxsize+"Byte)를", "E003");
  137. }else{
  138. isUpdated = true;
  139. }
  140. }
  141. }
  142. }else{//신규
  143. var maxsize = upload1.attribute("filesize");
  144. var files = window.fileDialog("open","|","false");
  145. var filelist = files.split("|");
  146. var filename = files.lastIndexOf("\\");
  147. for(var i = 0 ; i < filelist.length ; i++ ) {
  148. grd_smmlist.addRow();
  149. grd_smmlist.valueMatrix(grd_smmlist.rows - 1, grd_smmlist.colRef("attfilepath")) = filelist[i];
  150. grd_smmlist.valueMatrix(grd_smmlist.rows - 1, grd_smmlist.colRef("attfilenm")) = files.substring(filename + 1);
  151. grd_smmlist.valueMatrix(grd_smmlist.rows - 1, grd_smmlist.colRef("smmcnts")) = files.substring(filename + 1);
  152. grd_smmlist.valueMatrix(grd_smmlist.rows - 1, grd_smmlist.colRef("smmdd")) = getCurrentDate();
  153. grd_smmlist.valueMatrix(grd_smmlist.rows - 1, grd_smmlist.colRef("delyn")) = 'N';
  154. grd_attach.valueMatrix(grd_attach.rows - 1, 0) = filelist[i];
  155. if (!checkFileSize(upload1)){
  156. grd_attach.removeItem();
  157. messageBox("파일 크기가 최대치("+maxsize+"Byte)를", "E003");
  158. }else{
  159. isUpdated = true;
  160. }
  161. }
  162. }
  163. }else { //첨부파일이 아닌경우
  164. if(smmcnts != "" || nodelength == 0) { //첫줄에 추가셀 생성
  165. if (nodelength == 0) {
  166. grd_smmlist.addrow();
  167. } else {
  168. grd_smmlist.insertRow(1);
  169. }
  170. model.setValue("/root/main/smmlist[1]/smmdd", getCurrentDate());
  171. model.setValue("/root/main/smmlist[1]/delyn", 'N');
  172. }
  173. }
  174. grd_smmlist.row = 1;
  175. grd_smmlist.col = 4;
  176. }
  177. /**
  178. * @desc : 줄추가
  179. * @
  180. * @param :
  181. * @return :
  182. * @authur : 박종훈
  183. * @---------------------------------------------------
  184. */
  185. function fAddrow(val)
  186. {
  187. var nodelistSmm = instance.selectNodes("/root/main/smmlist");
  188. var nodelength = nodelistSmm.length;
  189. var smmcnts = model.getValue("/root/main/smmlist[1]/smmcnts");
  190. if (val == "true"){ //첨부파일인 경우
  191. var maxsize = upload1.attribute("filesize");
  192. var files = window.fileDialog("open","|","false");
  193. var filelist = files.split("|");
  194. var filename = files.lastIndexOf("\\");
  195. if( files != ""){
  196. for(var i = 0 ; i < filelist.length ; i++ ) {
  197. grd_smmlist.addRow();
  198. grd_smmlist.valueMatrix(grd_smmlist.rows - 1, grd_smmlist.colRef("attfilepath")) = filelist[i];
  199. grd_smmlist.valueMatrix(grd_smmlist.rows - 1, grd_smmlist.colRef("attfilenm")) = files.substring(filename + 1);
  200. grd_smmlist.valueMatrix(grd_smmlist.rows - 1, grd_smmlist.colRef("smmcnts")) = files.substring(filename + 1);
  201. grd_smmlist.valueMatrix(grd_smmlist.rows - 1, grd_smmlist.colRef("smmdd")) = getCurrentDate();
  202. grd_smmlist.valueMatrix(grd_smmlist.rows - 1, grd_smmlist.colRef("delyn")) = 'N';
  203. grd_attach.addRow();
  204. grd_attach.valueMatrix(grd_attach.rows - 1, 0) = filelist[i];
  205. // grd_smmlist.isReadOnly(grd_smmlist.rows - 1 ,grd_smmlist.colRef("smmcnts")) = true;
  206. if (!checkFileSize(upload1)){
  207. grd_attach.removeItem();
  208. messageBox("파일 크기가 최대치("+maxsize+"Byte)를", "E003");
  209. }else{
  210. isUpdated = true;
  211. }
  212. }
  213. }
  214. }else { //첨부파일이 아닌경우
  215. if(smmcnts != "" || nodelength == 0) { //첫줄에 추가셀 생성
  216. if (nodelength == 0) {
  217. grd_smmlist.addrow();
  218. } else {
  219. grd_smmlist.insertRow(1);
  220. }
  221. model.setValue("/root/main/smmlist[1]/smmdd", getCurrentDate());
  222. model.setValue("/root/main/smmlist[1]/delyn", 'N');
  223. }
  224. }
  225. grd_smmlist.row = 1;
  226. grd_smmlist.col = 4;
  227. }
  228. /**
  229. * @desc : 조회
  230. * @
  231. * @param :
  232. * @return :
  233. * @authur : 박종훈
  234. * @---------------------------------------------------
  235. */
  236. function fSelect_sub()
  237. {
  238. var srchpid = model.getValue("/root/main/patinfo/patinfolist/pid");
  239. if (srchpid != "")
  240. {
  241. model.removeNodeset("/root/main/smmlist");
  242. model.removeNodeset("/root/send");
  243. model.makeValue("/root/send/pid", srchpid);
  244. model.makeValue("/root/send/validyn", "Y");
  245. model.makeValue("/root/send/schkind", model.getValue("/root/init/schkind"));
  246. model.makeValue("/root/send/getyn", "Y");
  247. model.makeValue("/root/send/fromdd", model.getValue("/root/init/reqmedireclist/recfromdt"));
  248. model.makeValue("/root/send/todd", model.getValue("/root/init/reqmedireclist/rectodt"));
  249. model.makeValue("/root/send/allyn", model.getValue("/root/init/allyn"));
  250. submit("TRMMR04800");
  251. grd_smmlist.resizeCells();
  252. model.refresh();
  253. fAddrow();
  254. }
  255. else
  256. {
  257. messageBox("환자번호가 ", "I004");
  258. return;
  259. }
  260. }
  261. /**
  262. * @desc : 팝업시 조회
  263. * @
  264. * @param :
  265. * @return :
  266. * @authur : 박종훈
  267. * @---------------------------------------------------
  268. */
  269. function fSelect_Pop()
  270. {
  271. var srchpid = model.getValue("/root/main/patinfo/patinfolist/pid");
  272. var gridnode = grd_smmlist.attribute("nodeset");
  273. if (srchpid != "")
  274. {
  275. model.removeNodeset("/root/main/smmlist");
  276. model.makeValue("/root/send/pid", srchpid);
  277. model.makeValue("/root/send/getyn", "Y");
  278. model.makeValue("/root/send/schkind", model.getValue("/root/init/schkind"));
  279. model.makeValue("/root/send/validyn", model.getValue("/root/init/validyn"));
  280. model.makeValue("/root/send/fromdd", model.getValue("/root/init/reqmedireclist/recfromdt"));
  281. model.makeValue("/root/send/todd", model.getValue("/root/init/reqmedireclist/rectodt"));
  282. model.makeValue("/root/send/allyn", model.getValue("/root/init/allyn"));
  283. grd_smmlist.rebuildStyle();
  284. if (submit("TRMMR04800")) {
  285. /*
  286. var iCnt = getNodesetCount(gridnode);
  287. for (var i = 1; i <= iCnt; i++) {
  288. if (model.getValue(gridnode+"["+ i +"]/delyn") == "Y") {
  289. grd_smmlist.cellStyle("background-color", i, 0, i, grd_smmlist.cols-1) = "#808080";
  290. }
  291. }
  292. */
  293. }
  294. var reqnodeList = instance1.selectNodes("/root/send");
  295. if (reqnodeList.length > 0)
  296. {
  297. var csv = getNodeListCSV(reqnodeList);
  298. setGlobalVariable("emr_gsv_cmmsrckcond",csv);
  299. }
  300. grd_smmlist.resizeCells();
  301. if (model.getValue("/root/init/validyn") != 'D') { //삭제상태가 아닌 경우만
  302. fAddrow();
  303. }
  304. model.refresh();
  305. }
  306. else
  307. {
  308. messageBox("환자번호가 ", "I004");
  309. return;
  310. }
  311. }
  312. /**
  313. * @desc : 화면 컨트롤 설정
  314. * @
  315. * @param :
  316. * @return :
  317. * @authur : 박종훈
  318. * @---------------------------------------------------
  319. */
  320. function fResizeGrup(flag, heig, wid)
  321. {
  322. body.attribute("height") = heig;
  323. body.attribute("width") = wid;
  324. var titHeight = parseInt(grup_title.attribute("height"));
  325. var tTop = parseInt(grup_top.attribute("top"));
  326. var tHeight = parseInt(grup_top.attribute("height"));
  327. var bTop = parseInt(grup_body.attribute("top"));
  328. var bHeight = parseInt(grup_body.attribute("height"));
  329. var mTop = parseInt(grup_bottom.attribute("top"));
  330. var mHeight = parseInt(grup_bottom.attribute("height"));
  331. if(flag == "1")
  332. {
  333. btn_excel.attribute("left") = wid - 4 - 56 + "px";
  334. grup_title.attribute("width") = wid - 2;
  335. grup_top.attribute("top") = 0;
  336. grup_top.attribute("height") = 0;
  337. grup_top.attribute("width") = 0;
  338. grup_top.attribute("visibility") = "hidden";
  339. grup_body.attribute("left") = 0;
  340. grup_body.attribute("top") = tTop;
  341. grup_body.attribute("height") = (heig - (tHeight + mHeight) + 1);
  342. grup_body.attribute("width") = wid - 2;
  343. grd_smmlist.attribute("left") = 0;
  344. grd_smmlist.attribute("border-style") = "none";
  345. grd_smmlist.attribute("height") = (heig - (tHeight + mHeight) + 1);
  346. grd_smmlist.attribute("width") = wid - 2;
  347. grup_bottom.attribute("left") = 0;
  348. grup_bottom.attribute("top") = (heig - mHeight - 2);
  349. grup_bottom.attribute("width") = wid - 2;
  350. line12.attribute("x1") = "1px";
  351. line12.attribute("x2") = wid - 2 + "px";
  352. line12.attribute("y1") = "24px";
  353. line12.attribute("y2") = "24px";
  354. line1.attribute("x1") = "1px";
  355. line1.attribute("x2") = wid - 2 + "px";
  356. line1.attribute("y1") = "0px";
  357. line1.attribute("y2") = "0px";
  358. line2.attribute("x1") = "1px";
  359. line2.attribute("x2") = wid - 2 + "px";
  360. line2.attribute("y1") = "0px";
  361. line2.attribute("y2") = "0px";
  362. btn_save.attribute("left") = wid - 4 - 56 + "px";
  363. btn_del.attribute("left") = wid - 6 - 112 + "px";
  364. btn_end.attribute("left") = wid - 8 - 168 + "px";
  365. btn_close.attribute("left") = wid - 10 - 224 + "px";
  366. }
  367. model.refresh();
  368. }
  369. /**
  370. * @desc : 저장
  371. * @
  372. * @param :
  373. * @return :
  374. * @authur : 박종훈
  375. * @---------------------------------------------------
  376. */
  377. var g_changeYn = "N";
  378. function fSave()
  379. {
  380. var updateData = grd_smmlist.getUpdateData();
  381. var updateData = updateData.split("▩");
  382. var srchpid = model.getValue("/root/main/patinfo/patinfolist/pid");
  383. if (srchpid != "")
  384. {
  385. if (updateData.length <= 3) {
  386. messageBox("저장할 내용이", "I004");
  387. return;
  388. }
  389. model.makeValue("/root/temp/pid", srchpid);
  390. model.makeValue("/root/temp/reqsmm", grd_smmlist.getUpdateData());
  391. model.makeValue("/root/temp/schkind", model.getValue("/root/init/schkind"));
  392. model.makeValue("/root/temp/getyn", "N");
  393. model.makeValue("/root/temp/validyn", model.getValue("/root/init/validyn"));
  394. model.makeValue("/root/temp/fromdd", model.getValue("/root/init/reqmedireclist/recfromdt"));
  395. model.makeValue("/root/temp/todd", model.getValue("/root/init/reqmedireclist/rectodt"));
  396. if ( submit("TXMMR04801") )
  397. {
  398. grd_smmlist.clearStatus(); // submit() 성공하면 그리드의 i,u,d 상태 제거
  399. model.resetInstanceNode("/root/temp");
  400. if (isPopup()) {
  401. if (model.getValue("/root/main/patinfo/patinfolist/pid") == opener.model.getValue("/root/main/paminfo/pid"))
  402. {
  403. opener.window.javascript.setParameter("SSMMP04800_rtn", "Y");
  404. }
  405. }
  406. model.refresh();
  407. }
  408. }
  409. else
  410. {
  411. messageBox("환자번호가 ", "I004");
  412. return;
  413. }
  414. fAddrow();
  415. }
  416. /**
  417. * @desc : 삭제
  418. * @
  419. * @param :
  420. * @return :
  421. * @authur : 박종훈
  422. * @---------------------------------------------------
  423. */
  424. function fDelRow()
  425. {
  426. for(var i = 1; i < grd_smmlist.Rows; i++)
  427. {
  428. if(grd_smmlist.isselected(i))
  429. {
  430. if((model.getValue("/root/main/smmlist["+i+"]/patsmmseq") == "") && (i != (grd_smmlist.Rows - 1)))
  431. {
  432. grd_smmlist.deleteRow(i);
  433. }
  434. else if(fChkAuth(i))
  435. {
  436. grd_smmlist.addStatus(i, "delete");
  437. }
  438. }
  439. }
  440. var rtn = messageBox("삭제", "S001");
  441. if (rtn == 6)
  442. {
  443. fSave();
  444. }
  445. else
  446. {
  447. grd_smmlist.clearStatus();
  448. }
  449. }
  450. /**
  451. * @desc : 기록종료
  452. * @
  453. * @param :
  454. * @return :
  455. * @authur : 박종훈
  456. * @---------------------------------------------------
  457. */
  458. function fEndRec()
  459. {
  460. var j = 0;
  461. var uptArr = new Array();
  462. for(var i = 1; i < grd_smmlist.Rows; i++)
  463. {
  464. if(grd_smmlist.isselected(i) && fChkAuth(i) && model.getValue("/root/main/smmlist[" + i + "]/smmtodd") == "")
  465. {
  466. model.setValue("/root/main/smmlist[" + i + "]/smmtodd", getCurrentDate());
  467. grd_smmlist.addStatus(i, "update");
  468. uptArr[j] = i;
  469. j++;
  470. }
  471. }
  472. var rtn = messageBox("종료", "S001");//하시려면 예(Yes) 아니면 아니오(No)
  473. if (rtn == 6)
  474. {
  475. fSave();
  476. }
  477. else
  478. {
  479. for(var k = 0; k < uptArr.length; k++)
  480. {
  481. model.setValue("/root/main/smmlist[" + uptArr[k] + "]/smmtodd", "");
  482. }
  483. grd_smmlist.refresh();
  484. grd_smmlist.clearStatus();
  485. }
  486. }
  487. /**
  488. * @desc : 상세조회 클릭
  489. * @
  490. * @param :
  491. * @return :
  492. * @authur : 박종훈
  493. * @---------------------------------------------------
  494. */
  495. function fClickPop()
  496. {
  497. modal("../../../emr/medirecweb/xrw/SSMMR04800_진료요약기록.xrw", 1, 0, 0, "", "", "");
  498. if(opener.window.javascript.getParameter("SSMMP04800_rtn") == "Y")
  499. fSelect_sub();
  500. g_changeYn = "N";
  501. }
  502. /**
  503. * @desc : 작성자와 사용자의 일치여부
  504. * @
  505. * @param :
  506. * @return :
  507. * @authur : 박종훈
  508. * @---------------------------------------------------
  509. */
  510. function fChkAuth(selrow)
  511. {
  512. var recudpcd = model.getValue("/root/main/smmlist[" + selrow + "]/recdeptcd");
  513. var rtn = true;
  514. if(recudpcd != uInfo[8])
  515. {
  516. rtn = false;
  517. }
  518. return rtn;
  519. }
  520. /**
  521. * @desc : 창닫기전 변경된 내용 저장여부 확인
  522. * @
  523. * @param :
  524. * @return :
  525. * @authur : 박종훈
  526. * @---------------------------------------------------
  527. */
  528. function fClose()
  529. {
  530. var updateData = grd_smmlist.getUpdateData();
  531. var updateData = updateData.split("▩");
  532. if (updateData.length > 3 && (isPopup()))
  533. {
  534. var rtn = messageBox("환자요약에 변경된 정보가 있습니다 ", "Q002");
  535. if (rtn == 6)
  536. fSave();
  537. }
  538. }
  539. /**
  540. * @desc : 환자번호 정보조회
  541. * @id :
  542. * @event : onkeypress
  543. * @return : void
  544. * @authur : 박종훈
  545. */
  546. function fPidKeyPress()
  547. {
  548. model.makeValue("/root/send/srchcond", "1");
  549. model.makeValue("/root/send/pid", ipt_pid.currentText);
  550. //inputEnterKey("btn_search", "DOMActivate");
  551. //환자등록번호 체크
  552. if(ipt_pid.currentText.length >= 1 )
  553. {
  554. if(submit("TRPMC02500"))
  555. {
  556. //fSearch는 인적사항 화면을 임포트 해간 화면에서 구현해 주어야 하는 함수이다.
  557. if( getNodesetCount("/root/main/patinfo/patinfolist") < 0 ) {
  558. model.resetInstanceNode("/root/main/patinfo/patinfolist");
  559. messageBox("없는 환자 번호 입니다.", "E999", "");
  560. model.refresh();
  561. }
  562. }
  563. }
  564. else
  565. {
  566. messageBox("환자등록번호를 정확히", "C001");
  567. }
  568. }
  569. /**
  570. * @desc : 환자이름 정보조회
  571. * @id :
  572. * @event : onkeypress
  573. * @return : void
  574. * @authur : 박종훈
  575. */
  576. function fPnmKeyPress()
  577. {
  578. model.makeValue("/root/send/srchcond", "2");
  579. model.makeValue("/root/send/hngnm", ipt_hngnm.currentText);
  580. inputEnterKey("btn_pinfosearch", "DOMActivate");
  581. }
  582. /**
  583. * @desc : 환자정보조회 팝업
  584. * @id :
  585. * @event : DOMActivate
  586. * @return : void
  587. * @authur : 박종훈
  588. */
  589. function fPopPtinfo()
  590. {
  591. modal("SPPMC02500", "1","150", "150", "SPPMC02500", "/root/send", "/root/send");
  592. model.resetInstanceNode("/root/send");
  593. fSelect_Pop();
  594. }
  595. /**
  596. * @desc : 상용구 팝업
  597. * @id :
  598. * @event : DOMActivate
  599. * @return : void
  600. * @authur : 박종훈
  601. */
  602. function fPopCommUse()
  603. {
  604. setParameter("comn_chosflag", "C") // C : 상용구
  605. setParameter("comn_formprogflag", "A") // A: Summary, B : 주호소
  606. setParameter("openmode", "select");
  607. modal("SPMRF04900");
  608. var rtn = getParameter("comncnts"); //내용
  609. setParameter("comncnts", "");
  610. var re = /▦/i;
  611. var re1 = /▩/i;
  612. rtn = rtn.replace(re, "");
  613. rtn = rtn.replace(re1, "");
  614. var reccnts = model.getValue("/root/main/smmlist[" + grd_smmlist.row + "]/smmcnts");
  615. if (rtn == ""){
  616. return;
  617. }
  618. if (reccnts == ""){ // 요약내용이 없을경우
  619. model.setValue("/root/main/smmlist[" + grd_smmlist.row + "]/smmcnts", rtn);
  620. fAddrow();
  621. }else{
  622. model.setValue("/root/main/smmlist[" + grd_smmlist.row + "]/smmcnts", reccnts + " " + rtn);
  623. grd_smmlist.addStatus(grd_smmlist.row, "update");
  624. }
  625. model.refresh();
  626. grd_smmlist.resizeCells();
  627. }
  628. /**
  629. * @desc : 진료기록 리스트 조회조건 시작일, 종료일 셋팅
  630. * @id :
  631. * @event :
  632. * @return : void
  633. * @authur : 박종훈
  634. */
  635. function fAddDateReq(diffFlag)
  636. {
  637. var frdd = model.getValue("/root/init/reqmedireclist/recfromdt");
  638. var todd = model.getValue("/root/init/reqmedireclist/rectodt");
  639. var srcdd = new Date();
  640. var destdd = new Date();
  641. var diffdt;
  642. if (diffFlag == "next")
  643. {
  644. srcdd = todd.toDate();
  645. srcdd = srcdd.getAddDate(1, "D");
  646. frdd = srcdd.getDateFormat();
  647. diffdt = parseInt(model.getValue("/root/init/reqmedireclist/diffdt")) * 1;
  648. destdd = srcdd.getAddDate(diffdt, "M");
  649. todd = destdd.getDateFormat();
  650. model.makeValue("/root/init/allyn", "N");
  651. }
  652. else if (diffFlag == "back")
  653. {
  654. srcdd = frdd.toDate();
  655. srcdd = srcdd.getAddDate(-1, "D");
  656. todd = srcdd.getDateFormat();
  657. diffdt = parseInt(model.getValue("/root/init/reqmedireclist/diffdt")) * -1;
  658. destdd = srcdd.getAddDate(diffdt, "M");
  659. frdd = destdd.getDateFormat();
  660. model.makeValue("/root/init/allyn", "N");
  661. }
  662. else if (diffFlag == "today")
  663. {
  664. todd = getCurrentDate();
  665. var today = new Date();
  666. var frday = new Date();
  667. var diffdt = parseInt(model.getValue("/root/init/reqmedireclist/diffdt")) * -1;
  668. frday = today.getAddDate(diffdt , "M");
  669. frdd = frday.getDateFormat();
  670. model.makeValue("/root/init/allyn", "N");
  671. }
  672. else
  673. {
  674. if (model.getValue("/root/init/reqmedireclist/diffdt") != "-")
  675. {
  676. var today = todd.toDate();
  677. var frday = new Date();
  678. var diffdt = parseInt(model.getValue("/root/init/reqmedireclist/diffdt")) * -1;
  679. frday = today.getAddDate(diffdt , "M");
  680. frdd = frday.getDateFormat();
  681. button2.disabled = false;
  682. ipt_formrecdtfr.disabled = false;
  683. ipt_formrecdtto.disabled = false;
  684. button6.disabled = false;
  685. button3.disabled = false;
  686. model.makeValue("/root/init/allyn", "N");
  687. }
  688. else
  689. {
  690. button2.disabled = true;
  691. ipt_formrecdtfr.disabled = true;
  692. ipt_formrecdtto.disabled = true;
  693. button6.disabled = true;
  694. button3.disabled = true;
  695. model.makeValue("/root/init/allyn", "Y");
  696. }
  697. }
  698. model.setValue("/root/init/reqmedireclist/recfromdt", frdd);
  699. model.setValue("/root/init/reqmedireclist/rectodt", todd);
  700. ipt_formrecdtfr.refresh();
  701. ipt_formrecdtto.refresh();
  702. }
  703. function fDownLoad(){
  704. var i = grd_smmlist.row;
  705. if(model.getValue("/root/main/smmlist[" + i + "]/filexistyn") == "Y" ){
  706. var attfilepath = model.getValue("/root/main/smmlist["+i+"]/attfilepath");
  707. var filenm = model.getValue("/root/main/smmlist["+i+"]/attfilenm");
  708. var realfile = getActionURL("TRMMR04801") + "&attfilepath=" + attfilepath;
  709. var localfile = window.fileDialog("save", "|", false, filenm, "", "All Files(*.*)|*.*");
  710. if (localfile != "") {
  711. model.download(realfile, localfile);
  712. window.exec(localfile);
  713. }
  714. }else{
  715. messageBox("선택한 기록에 첨부파일이 존재하지 않습니다.","E");
  716. }
  717. }