SMARC01400.js 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823
  1. /**
  2. - ▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩
  3. 의료협력 - 타병원진료의뢰서 팝업 ( SPARC02900.xrw - JScript )
  4. * Version :
  5. - Ver.1.00.01
  6. * 개발자: 이경희
  7. * 최초작성일:
  8. - 2009.6.24
  9. * 수정이력:
  10. * 기타:
  11. - ▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩
  12. */
  13. /**
  14. * 하드코드 조회
  15. *
  16. * @param
  17. * ref reference path
  18. * rsltref result reference path
  19. * hardcd - 하드코드
  20. */
  21. function mmbfGetHardCodeInfo(ref, rsltref, hardcd){
  22. var mmb_rsltref = "/root/hidden/mmb/hardcd";
  23. model.removeNode(mmb_rsltref);
  24. model.makeNode(mmb_rsltref);
  25. model.removeNode(ref);
  26. model.makeValue(ref + "/hardcd", hardcd);
  27. if(submit("TRMMB04103", "false", ref, mmb_rsltref)==true){
  28. model.copyNode(rsltref, mmb_rsltref); model.removeNode(mmb_rsltref);
  29. }
  30. model.refresh();
  31. }
  32. // 초기값
  33. function fInit()
  34. {
  35. mmbfGetHardCodeInfo("/root/send/formhrdcd", "/root/temp/formhardcd", 1300); // 전원의뢰팝업 사용여부
  36. if(model.getValue("/root/temp/formhardcd/hardcd/hardcd") == "Y")
  37. {
  38. button2.visible = true;
  39. }
  40. iviewer1.window.javascript.fInitPage(false, false, parseInt(iviewer1.attribute("height")));
  41. // 오늘 날짜로 세팅
  42. var CurrentDate = getCurrentDate();
  43. model.setValue("/root/send/search/fromdd", CurrentDate);
  44. model.setValue("/root/send/search/todd", CurrentDate);
  45. // 공통코드 목록 가져오기
  46. zbcfGetCodeList(new Array("A0439", "A0438", "A0426"), new Array("/root/init/resncd", "/root/init/rsltcd", "/root/init/areacd") , true);
  47. // 유형코드 가져오기
  48. zbcfGetKindCodeList(
  49. new Array("A0014"),
  50. new Array("A0426"),
  51. new Array("/root/init/areacd"),
  52. true,
  53. new Array(""),
  54. new Array("")
  55. );
  56. // 진료과
  57. //var instcd = "012";
  58. var instcd = getUserInfo("dutplceinstcd");
  59. //var standard_yn = "orduseyn";
  60. var standard_yn = "rcptuseyn";
  61. var ord_deptflag = 'D';
  62. var rslt_ref = "/root/init/dept";
  63. var sort_method = "depthngnm";
  64. //zbcfGetDeptCodeList(instcd, standard_yn, ord_deptflag, rslt_ref, sort_method);
  65. sort_field = "depthngnm"
  66. zsdfGetInOutOrdDeptList(instcd, rslt_ref, sort_field, sort_method);
  67. addComboItem("cmb_orddeptcd", "", "", "above");
  68. fDoctSerach();
  69. model.removeNodeset("/root/main/req_info/req_pat_list");
  70. model.resetInstanceNode("/root/main/req_pat_info/patinfo/patinfo");
  71. model.refresh();
  72. }
  73. // 진료의사 조회
  74. function fDoctSerach()
  75. {
  76. // 진료의사
  77. model.removenode("/root/send/doctor");
  78. model.makeValue("/root/send/doctor/orddd", model.getValue("/root/send/search/fromdd"));
  79. model.makeValue("/root/send/doctor/orddeptcd", model.getValue("/root/send/search/orddeptcd"));
  80. submit("TRARC01302", false);
  81. cmb_orddrid.select(0);
  82. //model.setValue("/root/main/patient/orddrid", orddrid);
  83. }
  84. // 조회전 필수 체크
  85. function fCheckDateSend()
  86. {
  87. var fromdd = model.getValue("/root/send/search/fromdd");
  88. var todd = model.getValue("/root/send/search/todd");
  89. var pid = model.getValue("/root/send/search/pid");
  90. var olddateyn = model.getValue("/root/send/search/olddateyn");
  91. if (isNull(pid) == true)
  92. {
  93. if (olddateyn != "Y")
  94. {
  95. if( ! isValidDateTime( fromdd, 'YYYYMMDD') || ! isValidDateTime( todd, 'YYYYMMDD') ){
  96. messageBox("입력하신 일자구분이 정확한 날짜타입이 아닙니다.", "E999", "");
  97. return false;
  98. }
  99. if( getDateInterval(fromdd, todd) > 31 ){
  100. messageBox("조회가능한 최대 기간은 1달입니다. 일자구분에서 날짜를 수정하세요!", "E999", "");
  101. return false;
  102. }
  103. if( getDateInterval(fromdd, todd) < 0 ){
  104. messageBox("일자구분에서 시작일자가 종료일자보다 미래일자 입니다. 확인하세요!", "E999", "");
  105. return false;
  106. }
  107. // 날짜 계산
  108. var daycnt = getDateInterval(fromdd, todd);
  109. // 1일이 아닌 경우는 조건을 타야 함
  110. if (daycnt != 0)
  111. {
  112. // 진료과 체크
  113. if (model.getValue("/root/send/search/orddeptcd") == "")
  114. {
  115. messageBox("일자구분에서 하루 이상의 기간을 선택했을 경우, 진료과는 조회 필수 조건입니다. 진료과를 입력하세요.", "E999", "");
  116. //messageBox("진료과를 ","C002");
  117. return false;
  118. }
  119. if (ipt_hngnm.currentText.length > 0 && ipt_hngnm.currentText.length < 2) {
  120. messageBox("환자명은 2글자 이상으로 해주십시요!","E999","");
  121. model.setFocus("ipt_hngnm");
  122. return false;
  123. }
  124. if (ipt_rumint.currentText.length > 0 && ipt_rumint.currentText.length < 2) {
  125. messageBox("전원의뢰병원명은 2글자 이상으로 해주십시요!","E999","");
  126. model.setFocus("ipt_rumint");
  127. return false;
  128. }
  129. }
  130. }
  131. }
  132. return true;
  133. }
  134. //조회(전원의뢰내역)
  135. function fSearch()
  136. {
  137. model.resetInstanceNode("/root/main/req_pat_info/patinfo");
  138. iviewer1.src = "../../../emr/medirecweb/xrw/SMMMR00000_Empty.xrw";
  139. //var formcd = "0000001539";
  140. //iviewer1.window.javascript.fLoadNewForm(formcd);
  141. // getReqPatList
  142. if (submit("TRARC01401", false) == true)
  143. {
  144. //var formrecseq = 0;
  145. //iviewer1.object1.RemoveAll();
  146. //iviewer1.window.javascript.fLoadRecForm(formrecseq);
  147. //iviewer1.window.javascirpt.fLoadNewForm();
  148. //model.refresh();
  149. }
  150. else
  151. {
  152. messageBox("조회를", "E009");
  153. }
  154. }
  155. // 저장전 필수 체크
  156. function fCheckDate()
  157. {
  158. if (model.getValue("/root/main/req_pat_info/patinfo/pid") == "") {
  159. messageBox("저장하고자 하는 환자를", "C002");
  160. return false;
  161. }
  162. /*
  163. if (model.getValue("/root/main/req_pat_info/patinfo/enddd") == "") {
  164. messageBox("완료일자를 ","C001");
  165. model.setFocus("ipt_enddd");
  166. return false;
  167. }
  168. */
  169. return true;
  170. }
  171. // 저장
  172. function fSave()
  173. {
  174. /*
  175. var pid = model.getValue("/root/main/req_pat_info/patinfo/pid")
  176. if (pid == "")
  177. {
  178. messageBox("저장하고자 하는 환자를", "C002");
  179. return;
  180. }
  181. */
  182. model.setValue("/root/main/req_pat_info/patinfo/reqflag", "C");
  183. var enddd = model.getValue("/root/main/req_pat_info/patinfo/enddd");
  184. if (enddd == "")
  185. {
  186. model.setValue("/root/main/req_pat_info/patinfo/enddd", "00000000");
  187. //enddd = "00000000";
  188. }
  189. model.resetInstanceNode("/root/send/savedata");
  190. model.copyNode("/root/send/savedata","/root/main/req_pat_info/patinfo");
  191. mmbfGetHardCodeInfo("/root/send/formhrdcd", "/root/temp/formhardcd", 1300); // 전원의뢰팝업 사용여부
  192. if(model.getValue("/root/temp/formhardcd/hardcd/hardcd") == "Y")
  193. {
  194. var originNode = findNode(model, "/root/send/savedata");
  195. var copyNode = findNode(model, "/root/send/adddata");
  196. originNode.appendChild(copyNode);
  197. model.makeValue("/root/send/savedata/popup", "Y");
  198. }
  199. if (submit("TXARC01401", false) == true)
  200. {
  201. //fSearch();
  202. }
  203. else
  204. {
  205. messageBox("저장에", "E009");
  206. }
  207. }
  208. // 삭제
  209. function fDelete()
  210. {
  211. if (grd_list.rows <= 1) return;
  212. if (grd_list.row < 1) return;
  213. // 데이터 삭제시
  214. if(messageBox("해당 데이터를", "Q001")== "6")
  215. {
  216. if (isNull(cmb_confflag.value) == true)
  217. {
  218. messageBox("구분", "C001");
  219. model.setFocus("cmb_flag");
  220. return;
  221. }
  222. if (isNull(ipt_confdd.value) == true)
  223. {
  224. messageBox("등록일자를", "C001");
  225. model.setFocus("ipt_confdd");
  226. return;
  227. }
  228. model.setValue("/root/send/savedata/status", "d");
  229. if (submit("TXARC01401") == true)
  230. {
  231. fSearch();
  232. }
  233. else
  234. {
  235. messageBox("삭제에", "E009");
  236. }
  237. }
  238. else
  239. {
  240. return;
  241. }
  242. }
  243. // 병원 팝업
  244. function fHospPopup()
  245. {
  246. model.setValue("/root/main/hospflag", "N");
  247. //modal("SPARH00200",1,1,1);
  248. modal("SPARH00200", 1,10, 10, "SPARH00200", "", "");
  249. /*
  250. var flag = getParameter("flag")
  251. if (flag == "Y")
  252. {
  253. model.setValue("/root/main/req_pat_info/patinfo/coophospnm", getParameter("coophospnm"));
  254. model.setValue("/root/main/req_pat_info/patinfo/coophospcd", getParameter("coophospcd"));
  255. model.setValue("/root/main/req_pat_info/patinfo/telno", getParameter("telno1"));
  256. model.setValue("/root/main/req_pat_info/patinfo/faxno", getParameter("faxno"));
  257. model.setValue("/root/main/req_pat_info/patinfo/areacd", getParameter("areacd"));
  258. model.refresh();
  259. }
  260. */
  261. if( model.getValue("/root/main/hospflag") == "Y" )
  262. {
  263. model.setValue("/root/main/req_pat_info/patinfo/coophospnm", model.getValue("/root/main/hospinfo/hospinfolist/coophospnm"));
  264. model.setValue("/root/main/req_pat_info/patinfo/coophospcd", model.getValue("/root/main/hospinfo/hospinfolist/coophospcd"));
  265. model.setValue("/root/main/req_pat_info/patinfo/areacd", model.getValue("/root/main/hospinfo/hospinfolist/areacd"));
  266. model.setValue("/root/main/req_pat_info/patinfo/telno", model.getValue("/root/main/hospinfo/hospinfolist/telno"));
  267. model.setValue("/root/main/req_pat_info/patinfo/faxno", model.getValue("/root/main/hospinfo/hospinfolist/faxno"));
  268. model.setValue("/root/main/req_pat_info/patinfo/drnm", model.getValue("/root/main/hospinfo/hospinfolist/drnm"));
  269. model.setValue("/root/main/req_pat_info/patinfo/coopdrcd", model.getValue("/root/main/hospinfo/hospinfolist/coopdrcd"));
  270. model.setValue("/root/main/req_pat_info/patinfo/fromdd", model.getValue("/root/main/hospinfo/hospinfolist/fromdd"));
  271. model.refresh();
  272. }
  273. }
  274. // 의뢰환자 정보 Popup
  275. function fReqPatPopup()
  276. {
  277. var pid = setParameter("pid", model.getValue("/root/main/req_pat_info/patinfo/pid")); //팝업 등록화면의 교육명에 값 가져가기
  278. if (isNull(opt_pid.value) == true)
  279. {
  280. messageBox("등록일자를", "C001");
  281. model.setFocus("opt_pid");
  282. return;
  283. }
  284. model.setValue("/root/main/reqpopupflag", "N");
  285. modal("SPARC02100", 1,10, 10, "SPARC02100", "", "");
  286. if( model.getValue("/root/main/reqpopupflag") == "Y" )
  287. {
  288. //alert(model.getValue("/root/main/reqpopupflag"));
  289. model.setValue("/root/main/req_pat_info/patinfo/reqcoophospnm", model.getValue("/root/main/reqpopup/reqpopuplist/coophospnm"));
  290. model.setValue("/root/main/req_pat_info/patinfo/reqdrnm", model.getValue("/root/main/reqpopup/reqpopuplist/drnm"));
  291. model.setValue("/root/main/req_pat_info/patinfo/reqdd", model.getValue("/root/main/reqpopup/reqpopuplist/reqdd"));
  292. model.setValue("/root/main/req_pat_info/patinfo/reqorddeptnm", model.getValue("/root/main/reqpopup/reqpopuplist/orddeptnm"));
  293. model.setValue("/root/main/req_pat_info/patinfo/reqorddrnm", model.getValue("/root/main/reqpopup/reqpopuplist/orddrnm"));
  294. model.setValue("/root/main/req_pat_info/patinfo/reqorddd", model.getValue("/root/main/reqpopup/reqpopuplist/orddd"));
  295. model.setValue("/root/main/req_pat_info/patinfo/reqcretno", model.getValue("/root/main/reqpopup/reqpopuplist/cretno"));
  296. model.setValue("/root/main/req_pat_info/patinfo/reqacptseqno", model.getValue("/root/main/reqpopup/reqpopuplist/acptseqno"));
  297. model.setValue("/root/main/req_pat_info/patinfo/reqseqno", model.getValue("/root/main/reqpopup/reqpopuplist/seqno"));
  298. model.refresh();
  299. }
  300. }
  301. function fReqAgnInfo()
  302. {
  303. if (grd_list.rows <= 0) return;
  304. if (grd_list.row < 0) return;
  305. //그리드에서 해당 환자 선택
  306. var idxRow = grd_list.row;
  307. var pid = model.getValue("/root/main/req_pat_list["+idxRow+"]/pid");
  308. var hngnm = model.getValue("/root/main/req_pat_list["+idxRow+"]/hngnm");
  309. var orddd = model.getValue("/root/main/req_pat_list["+idxRow+"]/orddd");
  310. var deptnm = model.getValue("/root/main/req_pat_list["+idxRow+"]/deptnm");
  311. var atdoctnm = model.getValue("/root/main/req_pat_list["+idxRow+"]/atdoctnm");
  312. model.setValue("/root/main/req_pat_info/patinfo/pid", pid);
  313. model.setValue("/root/main/req_pat_info/patinfo/hngnm", hngnm);
  314. model.setValue("/root/main/req_pat_info/patinfo/orddd", orddd);
  315. model.setValue("/root/main/req_pat_info/patinfo/deptnm", deptnm);
  316. model.setValue("/root/main/req_pat_info/patinfo/atdoctnm", atdoctnm);
  317. model.refresh();
  318. }
  319. // 등록번호 조회 팝업
  320. function fPatPopUp()
  321. {
  322. //model.makeValue("/root/temp/pid", model.getValue("/root/send/search/pid"));
  323. //model.makeValue("/root/temp/srchcond","1");
  324. //model.makeValue("/root/temp/autoflag","N");
  325. modal("SPPMC02500", 1,10, 10, "SPPMC02500", "/root/temp", "/root/send");
  326. //model.resetInstanceNode("/root/main/patinfo/patinfolist");
  327. //model.resetInstanceNode("/root/send/cond");
  328. if (model.getValue("/root/main/popupendflag") == "ok")
  329. {
  330. model.setValue("/root/send/search/pid", model.getValue("/root/main/patinfo/patinfolist/pid"));
  331. model.setValue("/root/send/search/hngnm", model.getValue("/root/main/patinfo/patinfolist/hngnm"));
  332. }
  333. //fHistSearch();
  334. model.refresh();
  335. }
  336. // 전원의뢰 리스트 선택
  337. function fGrdClick()
  338. {
  339. if (grd_list.rows <= 1) return;
  340. if (grd_list.row < 1) return;
  341. var lrow = grd_list.row;
  342. if(grd_list.isCell(event.target) && grd_list.mouseRow >= grd_list.fixedrows)
  343. {
  344. //fBiztrgtClick();
  345. }
  346. else
  347. {
  348. return;
  349. }
  350. /*
  351. model.copyNode("/root/main/req_pat_info/patinfo", "/root/main/req_info/req_pat_list[" + lrow + "]");
  352. //model.setValue("/root/main/req_pat_into/reqflag", "A");
  353. */
  354. model.resetInstanceNode("/root/send/cond");
  355. model.setValue("/root/send/cond/pid", model.getValue("/root/main/req_info/req_pat_list[" + lrow + "]/pid"));
  356. model.setValue("/root/send/cond/orddd", model.getValue("/root/main/req_info/req_pat_list[" + lrow + "]/orddd"));
  357. model.setValue("/root/send/cond/cretno", model.getValue("/root/main/req_info/req_pat_list[" + lrow + "]/cretno"));
  358. model.setValue("/root/send/cond/seqno", model.getValue("/root/main/req_info/req_pat_list[" + lrow + "]/seqno"));
  359. model.setValue("/root/send/cond/formrecseq", model.getValue("/root/main/req_info/req_pat_list[" + lrow + "]/formrecseq"));
  360. model.setValue("/root/send/cond/orddeptcd", model.getValue("/root/main/req_info/req_pat_list[" + lrow + "]/orddeptcd"));
  361. model.setValue("/root/send/cond/orddrid", model.getValue("/root/main/req_info/req_pat_list[" + lrow + "]/orddrid"));
  362. model.setValue("/root/send/cond/oldyn", model.getValue("/root/main/req_info/req_pat_list[" + lrow + "]/oldyn"));
  363. if (submit("TRARC01402", false) == true)
  364. {
  365. if (model.getValue("/root/main/req_pat_info/patinfo/pid") == "")
  366. {
  367. model.setValue("/root/main/req_pat_info/patinfo/pid", model.getValue("/root/main/req_info/req_pat_list[" + lrow + "]/pid"));
  368. model.setValue("/root/main/req_pat_info/patinfo/hngnm", model.getValue("/root/main/req_info/req_pat_list[" + lrow + "]/hngnm"));
  369. model.setValue("/root/main/req_pat_info/patinfo/sex", model.getValue("/root/main/req_info/req_pat_list[" + lrow + "]/sex"));
  370. model.setValue("/root/main/req_pat_info/patinfo/age", model.getValue("/root/main/req_info/req_pat_list[" + lrow + "]/age"));
  371. model.setValue("/root/main/req_pat_info/patinfo/orddd", model.getValue("/root/main/req_info/req_pat_list[" + lrow + "]/orddd"));
  372. model.setValue("/root/main/req_pat_info/patinfo/cretno", model.getValue("/root/main/req_info/req_pat_list[" + lrow + "]/cretno"));
  373. model.setValue("/root/main/req_pat_info/patinfo/orddeptnm", model.getValue("/root/main/req_info/req_pat_list[" + lrow + "]/orddeptnm"));
  374. model.setValue("/root/main/req_pat_info/patinfo/orddrnm", model.getValue("/root/main/req_info/req_pat_list[" + lrow + "]/orddrnm"));
  375. model.setValue("/root/main/req_pat_info/patinfo/orddeptcd", model.getValue("/root/main/req_info/req_pat_list[" + lrow + "]/orddeptcd"));
  376. model.setValue("/root/main/req_pat_info/patinfo/orddrid", model.getValue("/root/main/req_info/req_pat_list[" + lrow + "]/orddrid"));
  377. model.setValue("/root/main/req_pat_info/patinfo/formrecseq", model.getValue("/root/main/req_info/req_pat_list[" + lrow + "]/formrecseq"));
  378. model.setValue("/root/main/req_pat_info/patinfo/status", "i");
  379. }
  380. mmbfGetHardCodeInfo("/root/send/formhrdcd", "/root/temp/formhardcd", 1300); // 전원의뢰팝업 사용여부
  381. if(model.getValue("/root/temp/formhardcd/hardcd/hardcd") == "Y")
  382. {
  383. if (submit("TRARC01403", false) == true)
  384. {
  385. //fSetPopup();
  386. }
  387. }
  388. }
  389. var oldyn = model.getValue("/root/main/req_info/req_pat_list[" + lrow + "]/oldyn");
  390. if (oldyn != "Y")
  391. {
  392. iviewer1.src= "../../../emr/medirecweb/xrw/SSMMR01100_서식로더.xrw";
  393. iviewer1.window.javascript.fInitPage(false, false, parseInt(iviewer1.attribute("height")), parseInt(iviewer1.attribute("width")));
  394. // 서식 로드
  395. var formrecseq = model.getValue("/root/send/cond/formrecseq");
  396. //alert(formrecseq);
  397. iviewer1.window.javascript.fLoadRecForm(formrecseq, false);
  398. }
  399. /*
  400. model.setValue("/root/main/req_pat_info/patinfo/pid", model.getValue("/root/main/req_info/req_pat_list[" + lrow + "]/pid"));
  401. model.setValue("/root/main/req_pat_info/patinfo/hngnm", model.getValue("/root/main/req_info/req_pat_list[" + lrow + "]/hngnm"));
  402. model.setValue("/root/main/req_pat_info/patinfo/sex", model.getValue("/root/main/req_info/req_pat_list[" + lrow + "]/sex"));
  403. model.setValue("/root/main/req_pat_info/patinfo/age", model.getValue("/root/main/req_info/req_pat_list[" + lrow + "]/age"));
  404. model.setValue("/root/main/req_pat_info/patinfo/orddd", model.getValue("/root/main/req_info/req_pat_list[" + lrow + "]/odrdd"));
  405. model.setValue("/root/main/req_pat_info/patinfo/orddeptnm", model.getValue("/root/main/req_info/req_pat_list[" + lrow + "]/orddeptnm"));
  406. model.setValue("/root/main/req_pat_info/patinfo/orddrnm", model.getValue("/root/main/req_info/req_pat_list[" + lrow + "]/orddrnm"));
  407. model.setValue("/root/main/req_pat_info/patinfo/coophospnm", model.getValue("/root/main/req_info/req_pat_list[" + lrow + "]/coophospnm"));
  408. model.setValue("/root/main/req_pat_info/patinfo/areacd", model.getValue("/root/main/req_info/req_pat_list[" + lrow + "]/areacd"));
  409. model.setValue("/root/main/req_pat_info/patinfo/telno", model.getValue("/root/main/req_info/req_pat_list[" + lrow + "]/telno"));
  410. model.setValue("/root/main/req_pat_info/patinfo/faxno", model.getValue("/root/main/req_info/req_pat_list[" + lrow + "]/faxno"));
  411. model.setValue("/root/main/req_pat_info/patinfo/resncd", model.getValue("/root/main/req_info/req_pat_list[" + lrow + "]/resncd"));
  412. model.setValue("/root/main/req_pat_info/patinfo/enddd", model.getValue("/root/main/req_info/req_pat_list[" + lrow + "]/enddd"));
  413. model.setValue("/root/main/req_pat_info/patinfo/rsltcd", model.getValue("/root/main/req_info/req_pat_list[" + lrow + "]/rsltcd"));
  414. model.setValue("/root/main/req_pat_info/patinfo/reqorddd", model.getValue("/root/main/req_info/req_pat_list[" + lrow + "]/reqorddd"));
  415. model.setValue("/root/main/req_pat_info/patinfo/reqcretno", model.getValue("/root/main/req_info/req_pat_list[" + lrow + "]/reqcretno"));
  416. model.setValue("/root/main/req_pat_info/patinfo/reqacptseqno", model.getValue("/root/main/req_info/req_pat_list[" + lrow + "]/reqacptseqno"));
  417. model.setValue("/root/main/req_pat_info/patinfo/reqseqno", model.getValue("/root/main/req_info/req_pat_list[" + lrow + "]/reqseqno"));
  418. model.setValue("/root/main/req_pat_info/patinfo/reqcoophospnm", model.getValue("/root/main/req_info/req_pat_list[" + lrow + "]/reqcoophospnm"));
  419. model.setValue("/root/main/req_pat_info/patinfo/reqdrnm", model.getValue("/root/main/req_info/req_pat_list[" + lrow + "]/reqdrnm"));
  420. model.setValue("/root/main/req_pat_info/patinfo/reqorddeptnm", model.getValue("/root/main/req_info/req_pat_list[" + lrow + "]/reqorddeptnm"));
  421. model.setValue("/root/main/req_pat_info/patinfo/reqorddrnm", model.getValue("/root/main/req_info/req_pat_list[" + lrow + "]/reqorddrnm"));
  422. model.setValue("/root/main/req_pat_info/patinfo/orddeptcd", model.getValue("/root/main/req_info/req_pat_list[" + lrow + "]/orddeptcd"));
  423. model.setValue("/root/main/req_pat_info/patinfo/orddrid", model.getValue("/root/main/req_info/req_pat_list[" + lrow + "]/orddrid"));
  424. model.setValue("/root/main/req_pat_info/patinfo/coophospcd", model.getValue("/root/main/req_info/req_pat_list[" + lrow + "]/coophospcd"));
  425. model.setValue("/root/main/req_pat_info/patinfo/reqflag", model.getValue("/root/main/req_info/req_pat_list[" + lrow + "]/reqflag"));
  426. model.setValue("/root/main/req_pat_info/patinfo/formrecseq", model.getValue("/root/main/req_info/req_pat_list[" + lrow + "]/formrecseq"));
  427. model.setValue("/root/main/req_pat_info/patinfo/cretno", model.getValue("/root/main/req_info/req_pat_list[" + lrow + "]/cretno"));
  428. model.setValue("/root/main/req_pat_info/patinfo/acptseqno", model.getValue("/root/main/req_info/req_pat_list[" + lrow + "]/acptseqno"));
  429. model.setValue("/root/main/req_pat_info/patinfo/seqno", model.getValue("/root/main/req_info/req_pat_list[" + lrow + "]/seqno"));
  430. model.setValue("/root/main/req_pat_info/patinfo/status", model.getValue("/root/main/req_info/req_pat_list[" + lrow + "]/status"));
  431. */
  432. model.refresh();
  433. }
  434. // 의뢰정보 삭제
  435. function fReqDel()
  436. {
  437. /*
  438. opt_reqcoophospnm.value = "";
  439. opt_reqdrnm.value = "";
  440. opt_reqdd.value = "";
  441. opt_reqorddeptnm.value = "";
  442. opt_reqorddrnm.value = "";
  443. */
  444. var stat = model.getValue("/root/main/req_info/req_pat_list[" +grd_list.row + "]/stat");
  445. model.setValue("/root/main/req_pat_info/patinfo/reqcoophospnm", "");
  446. model.setValue("/root/main/req_pat_info/patinfo/reqdrnm", "");
  447. model.setValue("/root/main/req_pat_info/patinfo/reqdd", "");
  448. model.setValue("/root/main/req_pat_info/patinfo/reqorddeptnm", "");
  449. model.setValue("/root/main/req_pat_info/patinfo/reqorddrnm", "");
  450. model.setValue("/root/main/req_pat_info/patinfo/reqorddd", "");
  451. model.setValue("/root/main/req_pat_info/patinfo/reqcretno", "0");
  452. model.setValue("/root/main/req_pat_info/patinfo/reqacptseqno", "0");
  453. model.setValue("/root/main/req_pat_info/patinfo/reqseqno", "0");
  454. model.refresh();
  455. }
  456. // 전원의뢰 정보 삭제
  457. function fReqAgnDel()
  458. {
  459. var stat = model.getValue("/root/main/req_info/req_pat_list[" +grd_list.row + "]/stat");
  460. model.setValue("/root/main/req_pat_info/patinfo/coophospnm", "");
  461. model.setValue("/root/main/req_pat_info/patinfo/rsltcd", "");
  462. model.setValue("/root/main/req_pat_info/patinfo/areacd", "");
  463. model.setValue("/root/main/req_pat_info/patinfo/telno", "");
  464. model.setValue("/root/main/req_pat_info/patinfo/faxno", "");
  465. model.setValue("/root/main/req_pat_info/patinfo/resncd", "");
  466. model.setValue("/root/main/req_pat_info/patinfo/enddd", "");
  467. model.setValue("/root/main/req_pat_info/patinfo/coophospcd", "");
  468. model.refresh();
  469. }
  470. // 출력
  471. function fReplcheck()
  472. {
  473. /*
  474. if (model.getValue("/root/main/req_pat_info/patinfo/status") != "u")
  475. {
  476. messageBox("저장하지 않은 데이터는 출력할 수", "I004");
  477. return;
  478. }
  479. */
  480. var currow = grd_list.row;
  481. var sREPLDOCULIST_PATH = "/root/main/req_pat_info/patinfo";
  482. var formrecseq = model.getValue(sREPLDOCULIST_PATH+"/formrecseq")
  483. var pid = model.getValue(sREPLDOCULIST_PATH+"/pid")
  484. //var irow = grd_list.rows;
  485. //var cnt = 0;
  486. //var savedata = getNodeListCSV(instance1.selectNodes(sREPLDOCULIST_PATH));
  487. //model.setValue("/root/send/savedata", savedata);
  488. if (pid == "")
  489. {
  490. messageBox("저장하고자 하는 환자를", "C002");
  491. return;
  492. }
  493. var ivwCtrl = iviewer1.window.document.controls("ivw_base");
  494. copyNodeset("/root/main/recinfo", "/root/main/recinfo", "replace", model, ivwCtrl.model); //서식지 정보 설정
  495. model.makeValue("/root/hidden/docinfo/signimge", ivwCtrl.model.getValue("/root/hidden/docinfo/signimge")); //서식서명이미지 설정
  496. fDoMakeProfPrntInfo(ivwCtrl);
  497. //alert(formrecseq);
  498. getFormData("0000002536", formrecseq);
  499. setParameter("reportprintyn", "");
  500. exeReportPreview("RFM0253600", "XMLSTR");
  501. //alert(getParameter("reportprintyn"));
  502. if (getParameter("reportprintyn") == "Y")
  503. {
  504. model.resetInstanceNode("/root/send/savedata");
  505. model.copyNode("/root/send/savedata","/root/main/req_pat_info/patinfo")
  506. if(submit("TXARC01402", false)==true){
  507. messageBox("출력이", "I002");
  508. }
  509. }
  510. /*
  511. for(var i=1; i < irow; i++){
  512. var chk = model.getValue(sREPLDOCULIST_PATH+"["+ i +"]/chk")
  513. if (chk == "true"){
  514. model.makeValue("/root/send/savedata/instcd" ,model.getValue(sREPLDOCULIST_PATH+"["+ i +"]/instcd"));
  515. model.makeValue("/root/send/savedata/formrecseq" ,model.getValue(sREPLDOCULIST_PATH+"["+ i +"]/formrecseq"));
  516. model.makeValue("/root/send/savedata/pid" ,model.getValue(sREPLDOCULIST_PATH+"["+ i +"]/pid"));
  517. model.makeValue("/root/send/savedata/orddd" ,model.getValue(sREPLDOCULIST_PATH+"["+ i +"]/orddd"));
  518. model.makeValue("/root/send/savedata/cretno" ,model.getValue(sREPLDOCULIST_PATH+"["+ i +"]/cretno"));
  519. model.makeValue("/root/send/savedata/reqorddd" ,model.getValue(sREPLDOCULIST_PATH+"["+ i +"]/orddd"));
  520. model.makeValue("/root/send/savedata/reqcretno" ,model.getValue(sREPLDOCULIST_PATH+"["+ i +"]/cretno"));
  521. model.makeValue("/root/send/savedata/reqseqno" ,model.getValue(sREPLDOCULIST_PATH+"["+ i +"]/seqno"));
  522. getFormData("0000001536", model.getValue(sREPLDOCULIST_PATH+"["+ i +"]/formrecseq"));
  523. setParameter("reportprintyn", "");
  524. exeReportPreview("RFM0153600", "XMLSTR");
  525. // alert(getParameter('reportprintyn'));
  526. if (getParameter("reportprintyn") == "Y"){
  527. if(submit("TXARC02001",false)==true){
  528. messageBox("출력저장", "I001");
  529. }
  530. }
  531. cnt++;
  532. model.resetInstanceNode("/root/send/savedata");
  533. }
  534. }
  535. if(cnt == 0){
  536. messageBox("출력할 정보가", "I004");
  537. return;
  538. }
  539. fSearch();
  540. */
  541. model.refresh();
  542. }
  543. function fDoMakeProfPrntInfo(ivwCtrl){
  544. //진단코드 3자리마다 점(.)표시
  545. var totcnt = getNodesetCount("/root/main/recinfo/grid[degnitemlevlcd='0016650.0000960']/recitem[degnitemlevlcd='0016650.0000960.0000960']");
  546. for(var i = 0; i < totcnt; i++){
  547. var diagroflag = model.getValue("/root/main/recinfo/grid[degnitemlevlcd='0016650.0000960']/recitem[degnitemlevlcd='0016650.0000960.0004249' and rowno='" + i + "' and colno='0']/reccnts");
  548. var diagkindflag = model.getValue("/root/main/recinfo/grid[degnitemlevlcd='0016650.0000960']/recitem[degnitemlevlcd='0016650.0000960.0001443' and rowno='" + i + "' and colno='1']/reccnts");
  549. var rectermcd = model.getValue("/root/main/recinfo/grid[degnitemlevlcd='0016650.0000960']/recitem[rowno='" + i + "' and colno='2']/rectermcd");
  550. var rectermnm = model.getValue("/root/main/recinfo/grid[degnitemlevlcd='0016650.0000960']/recitem[rowno='" + i + "' and colno='2']/rectermnm");
  551. var reccnts = model.getValue("/root/main/recinfo/grid[degnitemlevlcd='0016650.0000960']/recitem[rowno='" + i + "' and colno='2']/reccnts");
  552. var langflag = ivwCtrl.model.getValue("/root/main/forminfo/formmast/langflag");
  553. if(langflag == "KO"){
  554. //if(isHangul(rectermnm)== "H"){
  555. if(diagkindflag == "M"){
  556. rectermnm = "(주)".concat(rectermnm);
  557. }
  558. if(diagroflag == "R"){
  559. rectermnm = "(의증)".concat(rectermnm);
  560. }
  561. if(reccnts != ""){
  562. reccnts = " [" + reccnts + "]";
  563. }
  564. rectermnm = rectermnm + reccnts;
  565. }else if(langflag == "EN"){
  566. //}else if(isHangul(rectermnm)== "E"){
  567. if(diagkindflag == "M"){
  568. rectermnm = "(Principle)".concat(rectermnm);
  569. }
  570. if(diagroflag == "R"){
  571. rectermnm = "(R/O)".concat(rectermnm);
  572. }
  573. if(reccnts != ""){
  574. reccnts = " [" + reccnts + "]";
  575. }
  576. rectermnm = rectermnm + reccnts;
  577. }
  578. rectermcd = removeChar(rectermcd, "."); //점을 제거
  579. rectermcd = insertChar(rectermcd, ".", 3); // 3개 단위로 점을 입력
  580. model.setValue("/root/main/recinfo/grid[degnitemlevlcd='0016650.0000960']/recitem[rowno='" + i + "' and colno='2']/rectermcd", rectermcd);
  581. model.setValue("/root/main/recinfo/grid[degnitemlevlcd='0016650.0000960']/recitem[rowno='" + i + "' and colno='2']/rectermnm", rectermnm);
  582. }
  583. var stmt = "";
  584. var formcd = ivwCtrl.model.getValue("/root/main/forminfo/formmast/formcd");
  585. //전원소견서, 응급실전원소견서
  586. if(formcd == "0000002536" || formcd == "0000003129"){
  587. stmt = model.getValue("/root/main/recinfo/recitem[degnitemlevlcd='0010597']/reccnts"); //내용
  588. fDoSepProfPage(stmt, 47);
  589. }
  590. }
  591. /**
  592. * @desc : 제증명 페이지 설정(출력시, 제증명 내용이 늘어지는 것을 막는다)
  593. * @
  594. * @param :
  595. * @return :
  596. * @author : 오지훈
  597. * @---------------------------------------------------
  598. */
  599. function fDoSepProfPage(stmt, maxcnt){
  600. model.removeNodeset("/root/main/contents");
  601. var detail = "";
  602. var wordcnt = 0;
  603. var rowcnt = 1;
  604. if(stmt != ""){
  605. for(var i = 0; i < stmt.length ; i++){
  606. if(stmt.charAt(i)=='\n'){ //Enter입력인 경우
  607. model.makeNode("/root/main/contents[" + rowcnt + "]");
  608. model.makeValue("/root/main/contents[" + rowcnt + "]/detail", detail);
  609. detail = "";
  610. wordcnt = 0;
  611. rowcnt++;
  612. }
  613. detail = detail.concat(stmt.charAt(i));
  614. wordcnt++;
  615. if(wordcnt == maxcnt){
  616. model.makeNode("/root/main/contents[" + rowcnt + "]");
  617. model.makeValue("/root/main/contents[" + rowcnt + "]/detail", detail);
  618. detail = "";
  619. wordcnt = 0;
  620. rowcnt++;
  621. }
  622. }
  623. }
  624. model.makeNode("/root/main/contents[" + rowcnt + "]");
  625. model.makeValue("/root/main/contents[" + rowcnt + "]/detail", detail);
  626. model.refresh();
  627. }
  628. /**
  629. * 단어에 특정 문자 제거
  630. *
  631. * @param
  632. * word 단어
  633. * ch 문자
  634. */
  635. function removeChar(word, ch){
  636. var temp = "";
  637. var res = "";
  638. var len = word.length
  639. for(i = 0; i < len; i++){
  640. temp = word.charAt(i);
  641. if(temp == ch){
  642. continue;
  643. }else{
  644. res += temp;
  645. }
  646. }
  647. return res;
  648. }
  649. /**
  650. * 단어에 step간격 특정 문자 삽입
  651. *
  652. * @param
  653. * word 단어
  654. * ch 문자
  655. * step 간격
  656. */
  657. function insertChar(word, ch, step){
  658. var temp = "";
  659. var res = "";
  660. var cnt = 0;
  661. var len = word.length;
  662. for(i = 0; i < len; i++){
  663. cnt++;
  664. temp = word.charAt(i);
  665. if(cnt % step == 0 && cnt != len){
  666. temp = temp + ch;
  667. }
  668. res += temp;
  669. }
  670. return res;
  671. }