MRF02301.js 78 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792
  1. /**
  2. * @desc : 초기셋팅
  3. *
  4. * @param :
  5. * @return :
  6. * @author : HIT EMR Team
  7. * @---------------------------------------------------
  8. */
  9. var _preass = "N"; //진정전 환자 평가서 화면 로딩 여부
  10. function fInitialize(){
  11. // ocr 받을 리스트 처리(20140623)
  12. mmbfGetHardCodeInfo("/root/send/reqdata", "/root/tabview", 5973);
  13. var iexNodeCnt = getNodesetCnt(model, "/root/tabview/hardcd[hardcd = '" + getUserInfo("dutplcecd") + "']");
  14. btn_neededlist.attribute("visibility") = "hidden";
  15. if(iexNodeCnt > 0) {
  16. btn_neededlist.attribute("visibility") = "visible";
  17. }
  18. var fromdd = ((getCurrentDate()).toDate()).getAddDate(-1, "M");
  19. model.removeNode("/root/hidden/topinfo/exist");
  20. fGetParaInfo();
  21. if(model.getValue("/root/main/ordinfo/pid") == ""){
  22. fGetTopInfo();
  23. }
  24. if (fContainsHardCD(5811, "Y") == true ) {
  25. btn_ecntform.attribute("visibility") = "visible" ;
  26. }else{
  27. btn_ecntform.attribute("visibility") = "hidden" ;
  28. }
  29. model.setValue("/root/main/trgtmanlist/out/orddd", getCurrentDate());
  30. model.setValue("/root/main/trgtmanlist/in/orddd", getCurrentDate());
  31. model.setValue("/root/main/ordinfo/fromdd", getCurrentDate());
  32. model.setValue("/root/main/trgtmanlist/er/orddd", getCurrentDate());
  33. model.setValue("/root/main/trgtmanlist/schpat/orddd", getCurrentDate());
  34. model.setValue("/root/main/ocrprntlist/fromdd", fromdd.getDateFormat());
  35. model.setValue("/root/main/ocrprntlist/todd", getCurrentDate());
  36. swt_trgtmanlist.selectedIndex = 0;
  37. // 20100309 한재상 수정 - 유전자검사동의서 재출력
  38. makeReportPreview(0, 0, 10, 10, "grp_report");
  39. // 수술 추가(20090120)
  40. //=======================================================
  41. model.setValue("/root/main/trgtmanlist/op/opcnfmdd", getCurrentDate());
  42. reqHardCodeInfo("/root/send/reqdata", "/root/init/hardcdno", 18); //마취통증의학과 부서코드 조회
  43. var anstdeptcd = model.getValue("/root/init/hardcdno/hardcd/hardcd");
  44. reqOpRoomList(model.getValue("/root/main/trgtmanlist/op/opcnfmdd"), "/root/init/oproomlist", "total"); //수술방명 조회
  45. addComboInstance("/root/init/oproomlist", "oproomcd^oproomnm", "0000^방없음", "oproomlist"); //수술방콤보 Item '방없음'추가
  46. copyNodeType("/root/init/oproomlist2", "/root/init/oproomlist", "replace");
  47. addComboInstance("/root/init/oproomlist2", "oproomcd^oproomnm", "-^전체", "oproomlist"); //조회조건 수술방콤보 Item '전체'추가
  48. //cmb_oproomcd.select(0); //수술방 콤보는 default '전체'설정
  49. mmbfGetDeptCodeComboList("/root/send/reqdata", "/root/init/orddept" , "D"); //부서콤보 조회
  50. addComboInstance("/root/init/orddept", "deptcd^depthngnm", "-^전체", "dept"); //부서콤보 Item '전체'추가
  51. mmbfGetUserComboList("/root/send/reqdata", "/root/init/userlist" , getUserInfo("dutplcecd"), "0330"); //의사콤보 조회
  52. addComboInstance("/root/init/userlist", "userid^usernm", "-^전체", "usercombo"); //의사콤보 Item '전체'추가
  53. mmbfGetUserComboList("/root/send/reqdata", "/root/init/userlist2" , anstdeptcd, "0330"); //마취통증의학과 의사콤보 조회
  54. if(cmb_orddept.label==""){cmb_orddept.select(0);}
  55. if(cmb_orddrid.label==""){cmb_orddrid.select(0);}
  56. //=======================================================
  57. //zbcfGetDeptCodeList(getUserInfo("dutplceinstcd"), "orduseyn", "D", "/root/main/common", "depthngnm", "asc");
  58. zsdfGetOutOrdDeptList(getUserInfo("dutplceinstcd"), "/root/main/common", "depthngnm", "asc");
  59. copyNodeset("/root/main/trgtmanlist/out/dept", "/root/main/common/dept");
  60. //copyNodeset("/root/main/trgtmanlist/in/dept", "/root/main/common/dept");
  61. //copyNodeset("/root/main/trgtmanlist/er/dept", "/root/main/common/dept");
  62. //copyNodeset("/root/main/trgtmanlist/scshpat/dept", "/root/main/common/dept");
  63. //model.removeNodeset("/root/main/common/dept");
  64. //zbcfGetDeptCodeList(getUserInfo("dutplceinstcd"), "orduseyn", "D", "/root/main/common", "depthngnm", "asc");
  65. //copyNodeset("/root/init/ocrsch/dept", "/root/main/common/dept", "replace");
  66. zbcfGetDeptCodeList(getUserInfo("dutplceinstcd"), "orduseyn", "W", "/root/main/ward", "depthngnm", "asc");
  67. copyNodeset("/root/main/trgtmanlist/in/wardlist", "/root/main/ward/dept");
  68. reqGetDrList1("/root/send/reqdata" , "/root/main/common/drlist" , getUserInfo("dutplcecd"), "total"); //의사리스트 combo조회
  69. //fReqSectionInfo(); //기본구역 정보 조회
  70. //addComboInstance("/root/main/common", "cdid^cdnm", "-^전체", "usercombo");
  71. //addParameter("cdgrupid", "M0062");
  72. //submit("TRMRF02304", "false",getParameterPath(), "/root/main/common/ordflag");
  73. zbcfGetCodeList(new Array("M0062", "M0017"), new Array("/root/main/common", "/root/init/M0017"));
  74. copyNodeset("/root/main/trgtmanlist/out/ordflag", "/root/main/common/M0062");
  75. addComboItem("cmb_ordflag", "전체", "-", "above");
  76. submit("TRMRF02307");
  77. addComboItem("cmb_formcls", "전체", "-", "above");
  78. zbcfGetCodeList(new Array("M0259"), new Array("/root/main/common"));
  79. copyNodeset("/root/main/ocrsch/formbizcls", "/root/main/common/M0259");
  80. iviewer1.window.document.body.attribute("width") = iviewer1.attribute("width");
  81. /*
  82. 2013/02/15 소스 머지 시작(주석)
  83. iviewer1.window.document.controls("obj_BCP").attribute("width") = "470px";
  84. iviewer1.window.document.body.attribute("height") = iviewer1.attribute("height");
  85. iviewer1.window.document.controls("obj_BCP").attribute("height") = iviewer1.attribute("height");
  86. iviewer1.window.document.controls("ipt_diagnm").attribute("width") = "230px";
  87. iviewer1.window.document.controls("grp_cnrlbox").attribute("width") = "468px";
  88. 2013/02/15 소스 머지 끝
  89. */
  90. //2013/02/15 소스머지 시작(추가)
  91. //iviewer1.window.document.controls("obj_BCP").attribute("width") = "470px";
  92. iviewer1.window.document.body.attribute("height") = iviewer1.attribute("height");
  93. //iviewer1.window.document.controls("obj_BCP").attribute("height") = iviewer1.attribute("height");
  94. iviewer1.window.document.controls("ipt_diagnm").attribute("width") = "230px";
  95. iviewer1.window.document.controls("grp_cnrlbox").attribute("width") = "468px";
  96. iviewer1.window.document.controls("f_View").attribute("width") = "470px";
  97. iviewer1.window.document.controls("f_View").attribute("height") = iviewer1.attribute("height");
  98. //2013/02/15 소스머지 끝
  99. // 의사(0330), 치과의사(0332), 사제(0110)
  100. if((getUserInfo("jobkindcd") == "0330") || (getUserInfo("jobkindcd") == "0332")){
  101. model.setValue("/root/main/ocrsch/ocrflag", "468");
  102. model.setValue("/root/main/ocrsch/formbizcls", "02");
  103. //model.setValue("/root/main/ocrsch/dept", model.getValue("/root/main/ordinfo/orddeptcd"));
  104. model.setValue("/root/main/ocrsch/dept", getUserInfo("dutplcecd"));
  105. model.setValue("/root/main/trgtmanlist/out/dept", model.getValue("/root/main/ordinfo/orddeptcd"));
  106. } else if(getUserInfo("jobkindcd") == "1110"){
  107. model.setValue("/root/main/ocrsch/ocrflag", "468");
  108. model.setValue("/root/main/ocrsch/formbizcls", "03");
  109. //model.setValue("/root/main/ocrsch/dept", model.getValue("/root/main/ordinfo/orddeptcd"));
  110. model.setValue("/root/main/ocrsch/dept", getUserInfo("dutplcecd"));
  111. model.setValue("/root/main/trgtmanlist/out/dept", model.getValue("/root/main/ordinfo/orddeptcd"));
  112. } else {
  113. model.setValue("/root/main/ocrsch/ocrflag", "468");
  114. cmb_formbizcls.select(0);
  115. if(model.getValue("/root/temp/para/orddeptcd") == ""){
  116. model.setValue("/root/main/ocrsch/dept", "-");
  117. } else {
  118. model.setValue("/root/main/ocrsch/formbizcls", "02");
  119. //model.setValue("/root/main/ocrsch/dept", model.getValue("/root/main/ordinfo/orddeptcd"));
  120. model.setValue("/root/main/ocrsch/dept", getUserInfo("dutplcecd"));
  121. model.setValue("/root/main/trgtmanlist/out/dept", model.getValue("/root/main/ordinfo/orddeptcd"));
  122. }
  123. }
  124. fChngSrchCond("/root/main/trgtmanlist/out/dept","/root/main/trgtmanlist/out/drlist", "total");
  125. cmb_ordflag.select(0);
  126. cmb_orddept2.value = "-";
  127. fOcrTreeSrch();
  128. fSetFormDisplay();
  129. fGetFavorList();
  130. fGetRgstDeptCD();
  131. addComboItem("cmb_ocrdept", "전체", "-", "above");
  132. addComboItem("cmb_orddept1", "전체", "-", "above");
  133. // 2012/12/04 Start
  134. model.setValue("/root/main/trgtmanlist/out/dept", getUserInfo("dutplcecd"));
  135. model.setValue("/root/main/trgtmanlist/out/ioflag", "O");
  136. // 2012/12/04 End
  137. mmbfGetHardCodeInfo("/root/send/reqdata", "/root/tabview", 5973);
  138. var iexNodeCnt = getNodesetCnt(model, "/root/tabview/hardcd[hardcd = '" + getUserInfo("dutplcecd") + "']");
  139. btn_neededlist.attribute("visibility") = "hidden";
  140. if(iexNodeCnt > 0) {
  141. btn_neededlist.attribute("visibility") = "visible";
  142. }
  143. btn_ocrform.dispatch("DOMActivate");
  144. btn_ocrform.selected = true;
  145. swt_ocrinfoflag.selectedindex = 0;
  146. model.refresh();
  147. }
  148. /**
  149. * @desc : 환자 정보 셋팅
  150. *
  151. * @param :
  152. * @return :
  153. * @author : HIT EMR Team
  154. * @---------------------------------------------------
  155. */
  156. function fGetTopInfo(){
  157. var paminfo;
  158. var paminfocnt = 0;
  159. var paminfoflag;
  160. var paminfotag;
  161. var paminfovalue;
  162. var sexinfo;
  163. var ageinfo;
  164. paminfo = getGlobalVariable("paminfo");
  165. if(paminfo.length > 0){
  166. paminfoflag = paminfo.split("▩");
  167. paminfotag = paminfoflag[0].split("▦");
  168. paminfovalue = paminfoflag[1].split("▦");
  169. while(paminfocnt < paminfotag.length){
  170. switch(paminfotag[paminfocnt])
  171. {
  172. case "pid":
  173. model.setValue("/root/main/ordinfo/pid", paminfovalue[paminfocnt]);
  174. break;
  175. case "orddd":
  176. model.setValue("/root/main/ordinfo/orddd", paminfovalue[paminfocnt]);
  177. break;
  178. case "indd":
  179. model.setValue("/root/main/ordinfo/orddd", paminfovalue[paminfocnt]);
  180. break;
  181. case "orddeptcd":
  182. model.setValue("/root/main/ordinfo/orddeptcd", paminfovalue[paminfocnt]);
  183. break;
  184. case "orddrid":
  185. model.setValue("/root/main/ordinfo/drid", paminfovalue[paminfocnt]);
  186. break;
  187. case "medispclid":
  188. model.setValue("/root/main/ordinfo/drid", paminfovalue[paminfocnt]);
  189. break;
  190. case "ioflag":
  191. model.setValue("/root/main/ordinfo/ordtype", paminfovalue[paminfocnt]);
  192. break;
  193. case "hngnm":
  194. model.setValue("/root/main/ordinfo/patnm", paminfovalue[paminfocnt]);
  195. break;
  196. case "roomcd":
  197. model.setValue("/root/main/ordinfo/inroomcd", paminfovalue[paminfocnt]);
  198. break;
  199. case "cretno":
  200. model.setValue("/root/main/ordinfo/cretno", paminfovalue[paminfocnt]);
  201. break;
  202. case "age":
  203. ageinfo = paminfovalue[paminfocnt];
  204. break;
  205. case "sex":
  206. sexinfo = paminfovalue[paminfocnt];
  207. break;
  208. case "rrgstno1":
  209. model.setValue("/root/main/ordinfo/rrgstno", paminfovalue[paminfocnt]);
  210. break;
  211. }
  212. paminfocnt++;
  213. }
  214. model.makeValue("/root/hidden/topinfo/exist", "Y");
  215. }
  216. model.removeNodeset("/root/send/cond");
  217. model.makeValue("/root/send/cond/pid", model.getValue("/root/main/ordinfo/pid"));
  218. submit("TRMRF02314");
  219. var rrgstno2 = "";
  220. if (model.instances(0).selectNodes("/root/temp/patinfo/patlist/pid").length > 0)
  221. {
  222. var rrgstno2 = model.getValue("/root/temp/patinfo/patlist/rrgstno2");
  223. }
  224. // 임시로 주석처리함(추후 상단에 환자정보를 가져올시 다시 반영할 예정임(2009.02.14)
  225. //var rrgstno2 = getPatientInfo("regstno");
  226. if (isNull(rrgstno2) == true)
  227. {
  228. var rrgstno = model.getValue("/root/main/ordinfo/rrgstno");
  229. //alert(rrgstno2);
  230. }
  231. else
  232. {
  233. var rrgstno = model.getValue("/root/main/ordinfo/rrgstno") + "-" + rrgstno2.substring(0, 1) + "XXXXXX";
  234. }
  235. //alert(rrgstno);
  236. model.setValue("/root/main/ordinfo/rrgstno", rrgstno);
  237. /*
  238. if(sexinfo == "M"){
  239. model.setValue("/root/main/ordinfo/rrgstno", model.getValue("/root/main/ordinfo/rrgstno") + "-1XXXXXX");
  240. } else if(sexinfo =="F") {
  241. model.setValue("/root/main/ordinfo/rrgstno", model.getValue("/root/main/ordinfo/rrgstno") + "-2XXXXXX");
  242. }
  243. */
  244. model.setValue("/root/main/ordinfo/sa", sexinfo + "/" + ageinfo);
  245. model.setValue("/root/main/ordinfo/orddeptnm", getPatientInfo("orddept"));
  246. model.setValue("/root/main/ordinfo/drnm", getPatientInfo("apntdr"));
  247. model.setValue("/root/main/ordinfo/centcd", getPatientInfoDetail("centcd"));
  248. model.setValue("/root/main/ordinfo/centnm", getPatientInfoDetail("centnm"));
  249. }
  250. /**
  251. * @desc : 의사 정보 조회
  252. *
  253. * @param :
  254. * @return :
  255. * @author : HIT EMR Team
  256. * @---------------------------------------------------
  257. */
  258. function reqGetDrList1(ref, rsltRef, orddeptcd, queryflag, drflag){
  259. model.makeValue(ref + "/orddeptcd" , orddeptcd);
  260. model.makeValue(ref + "/queryflag" , queryflag);
  261. model.makeValue(ref + "/stflag" , drflag);
  262. submit("TRMRF02303", true, ref, rsltRef);
  263. }
  264. /**
  265. * @desc : 조회 조건 변경
  266. *
  267. * @param :
  268. * @return :
  269. * @author : HIT EMR Team
  270. * @---------------------------------------------------
  271. */
  272. function fChngSrchCond(deptref, drref, drflag){
  273. model.removeNodeset("/root/send/reqdata");
  274. model.refresh();
  275. var sDutplceCD = model.getValue(deptref);
  276. reqGetDrList1("/root/send/reqdata", "/root/main/common/drlist", sDutplceCD, "total", drflag);
  277. copyNodeset(drref, "/root/main/common/drlist");
  278. var sLoginID = getUserInfo("userid");
  279. var sDrID = model.getValue("/root/main/common/drlist[drid='"+ sLoginID + "']/drid");
  280. if(sDrID != ""){
  281. model.setValue(drref, sDrID);
  282. }else{
  283. model.setValue(drref, "-");
  284. }
  285. model.refresh();
  286. }
  287. /**
  288. * @desc : 외래환자 조회 요청
  289. *
  290. * @param :
  291. * @return :
  292. * @author : HIT EMR Team
  293. * @---------------------------------------------------
  294. */
  295. function fReqOutPatList(){
  296. model.removeNodeset("/root/send/reqdata");
  297. model.makeValue("/root/send/reqdata/pid", model.getValue("/root/main/trgtmanlist/out/pid"));
  298. model.makeValue("/root/send/reqdata/orddd", model.getValue("/root/main/trgtmanlist/out/orddd"));
  299. model.makeValue("/root/send/reqdata/ordflag", model.getValue("/root/main/trgtmanlist/out/ordflag"));
  300. model.makeValue("/root/send/reqdata/orddept", model.getValue("/root/main/trgtmanlist/out/dept"));
  301. model.makeValue("/root/send/reqdata/drlist", model.getValue("/root/main/trgtmanlist/out/drlist"));
  302. // Edited by 나종천 2008-07-14
  303. // 물리치료과인지 판단
  304. if((model.getValue("/root/main/trgtmanlist/out/dept") == "2010700000") || (model.getValue("/root/main/trgtmanlist/out/dept") == "2220000000")){
  305. model.makeValue("/root/send/reqdata/deptflag", "-");
  306. } else {
  307. model.makeValue("/root/send/reqdata/deptflag", "0");
  308. }
  309. //2012/12/04 Start
  310. model.makeValue("/root/send/reqdata/ioflag", model.getValue("/root/main/trgtmanlist/out/ioflag"));
  311. //2012/12/04 End
  312. submit("TRMRF02305");
  313. }
  314. /**
  315. * @desc : 입원환자 조회 요청
  316. *
  317. * @param :
  318. * @return :
  319. * @author : HIT EMR Team
  320. * @---------------------------------------------------
  321. */
  322. function fReqInPatList(){
  323. model.removeNodeset("/root/send/reqdata");
  324. model.makeValue("/root/send/reqdata/pid", model.getValue("/root/main/trgtmanlist/in/pid"));
  325. model.makeValue("/root/send/reqdata/srchdd", model.getValue("/root/main/trgtmanlist/in/orddd"));
  326. model.makeValue("/root/send/reqdata/wardlist", model.getValue("/root/main/trgtmanlist/in/wardlist"));
  327. model.makeValue("/root/send/reqdata/dschyn", model.getValue("/root/main/trgtmanlist/in/dschyn"));
  328. model.makeValue("/root/send/reqdata/orddept", model.getValue("/root/main/trgtmanlist/in/dept"));
  329. model.makeValue("/root/send/reqdata/drlist", model.getValue("/root/main/trgtmanlist/in/drlist"));
  330. submit("TRMRF02306");
  331. model.refresh();
  332. }
  333. /**
  334. * @desc : 응급환자 조회 요청
  335. *
  336. * @param :
  337. * @return :
  338. * @author : HIT EMR Team
  339. * @---------------------------------------------------
  340. */
  341. function fReqErPatList(){
  342. model.removeNodeset("/root/send/reqdata");
  343. model.makeValue("/root/send/reqdata/pid", model.getValue("/root/main/trgtmanlist/er/pid"));
  344. model.makeValue("/root/send/reqdata/srchdd", model.getValue("/root/main/trgtmanlist/er/orddd"));
  345. model.makeValue("/root/send/reqdata/srchflag", model.getValue("/root/main/trgtmanlist/er/erflag"));
  346. model.makeValue("/root/send/reqdata/orddeptcd", model.getValue("/root/main/trgtmanlist/er/dept"));
  347. model.makeValue("/root/send/reqdata/orddrid", model.getValue("/root/main/trgtmanlist/er/drlist"));
  348. model.makeValue("/root/send/reqdata/section", "-");
  349. submit("TRMRF02310");
  350. model.refresh();
  351. }
  352. /**
  353. * @desc : 환자리스트 조회 요청
  354. *
  355. * @param :
  356. * @return :
  357. * @author : HIT EMR Team
  358. * @---------------------------------------------------
  359. */
  360. function fReqSchPatList(){
  361. model.removeNodeset("/root/send/reqdata");
  362. model.makeValue("/root/send/reqdata/pid", model.getValue("/root/main/trgtmanlist/schpat/srchpid"));
  363. model.makeValue("/root/send/reqdata/orddd", model.getValue("/root/main/trgtmanlist/schpat/orddd"));
  364. model.makeValue("/root/send/reqdata/sflag", model.getValue("/root/main/trgtmanlist/schpat/sflag"));
  365. model.makeValue("/root/send/reqdata/ordflag", model.getValue("/root/main/trgtmanlist/schpat/ordflag"));
  366. model.makeValue("/root/send/reqdata/orddept", model.getValue("/root/main/trgtmanlist/schpat/dept"));
  367. model.makeValue("/root/send/reqdata/orddrid", model.getValue("/root/main/trgtmanlist/schpat/drlist"));
  368. switch(model.getValue("/root/main/trgtmanlist/schpat/ordflag")){
  369. case 'O':
  370. if((model.getValue("/root/main/trgtmanlist/schpat/dept") == "2010700000") || (model.getValue("/root/main/trgtmanlist/schpat/dept") == "2220000000")){
  371. model.makeValue("/root/send/reqdata/deptflag", "-");
  372. } else {
  373. model.makeValue("/root/send/reqdata/deptflag", "0");
  374. }
  375. break;
  376. }
  377. submit("TRMRF02311");
  378. model.refresh();
  379. }
  380. /**
  381. * @desc : 수술환자리스트 조회
  382. * @
  383. * @param :
  384. * @return :
  385. * @author : HIT EMR Team
  386. * @---------------------------------------------------
  387. */
  388. function fReqOPPatList(){
  389. //마취통증의학과와 조회진료과가 동일한 경우는 전체 조회 처리
  390. //서버로직으로의 처리는 속도영향이 있음으로 web에서 처리
  391. //2008. 07. 29. 오지훈
  392. model.copyNode("/root/send/reqdata", "/root/main/cond");
  393. var anstpaindeptcd = model.getValue("/root/init/hardcdno/hardcd/hardcd");
  394. if(anstpaindeptcd == model.getValue("/root/main/cond/perfdeptcd")){
  395. model.setValue("/root/send/reqdata/perfdeptcd", "-"); //집도과 전체설정
  396. model.setValue("/root/send/reqdata/perfdrid" , "-"); //집도의 전체설정
  397. }
  398. /*
  399. var orderby = model.getValue("/root/main/cond/orderby");
  400. var sortcol = model.getValue("/root/main/cond/sortcol");
  401. if(sortcol != "" && orderby != ""){
  402. sORDERBY = orderby;
  403. //nodeListSort(grd_oppatlist.nodeset, grd_oppatlist.colAttribute(sortcol, "ref"), sORDERBY);
  404. grd_oppatlist.colsort(sortcol) = sORDERBY
  405. grd_oppatlist.sort(1, 1, grd_oppatlist.rows -1, grd_oppatlist.cols -1) = "usersort";
  406. grd_oppatlist.gridToInstance();
  407. grd_oppatlist.refresh();
  408. }
  409. */
  410. model.removeNodeset("/root/send/reqdata");
  411. model.makeValue("/root/send/reqdata/pid", model.getValue("/root/main/trgtmanlist/op/pid"));
  412. model.makeValue("/root/send/reqdata/opcnfmdd", model.getValue("/root/main/trgtmanlist/op/opcnfmdd"));
  413. model.makeValue("/root/send/reqdata/perfdeptcd", model.getValue("/root/main/trgtmanlist/op/perfdeptcd"));
  414. model.makeValue("/root/send/reqdata/perfdrid", model.getValue("/root/main/trgtmanlist/op/perfdrid"));
  415. model.makeValue("/root/send/reqdata/opstatcd", model.getValue("/root/main/trgtmanlist/op/opstatcd"));
  416. submit("TRMRF02313");
  417. model.refresh();
  418. }
  419. /**
  420. * @desc : 환자 선택
  421. *
  422. * @param :
  423. * @return :
  424. * @author : HIT EMR Team
  425. * @---------------------------------------------------
  426. */
  427. function fSelectPat(pCtrl){
  428. var ctrlObj = document.controls(pCtrl);
  429. var currRow = ctrlObj.Row;
  430. var sexflag;
  431. //alert(swt_trgtmanlist.selectedIndex);
  432. switch(swt_trgtmanlist.selectedIndex){
  433. case 0:
  434. model.setValue("/root/main/ordinfo/ordtype", model.getValue("/root/main/trgtmanlist/out/opat/list["+currRow + "]/ordtype"));
  435. model.setValue("/root/main/ordinfo/orddeptcd", model.getValue("/root/main/trgtmanlist/out/opat/list["+currRow + "]/orddeptcd"));
  436. model.setValue("/root/main/ordinfo/pid", model.getValue("/root/main/trgtmanlist/out/opat/list["+currRow + "]/pid"));
  437. model.setValue("/root/main/ordinfo/patnm",model.getValue("/root/main/trgtmanlist/out/opat/list["+currRow + "]/patnm"));
  438. model.setValue("/root/main/ordinfo/orddd",model.getValue("/root/main/trgtmanlist/out/opat/list["+currRow + "]/orddd"));
  439. model.setValue("/root/main/ordinfo/orddeptnm", ctrlObj.labelMatrix(currRow,ctrlObj.colRef("orddeptcd")));
  440. model.setValue("/root/main/ordinfo/drid",model.getValue("/root/main/trgtmanlist/out/opat/list["+currRow + "]/drid"));
  441. model.setValue("/root/main/ordinfo/drnm",model.getValue("/root/main/trgtmanlist/out/opat/list["+currRow + "]/drnm"));
  442. model.setValue("/root/main/ordinfo/sa",model.getValue("/root/main/trgtmanlist/out/opat/list["+currRow + "]/sa"));
  443. model.setValue("/root/main/ordinfo/cretno",model.getValue("/root/main/trgtmanlist/out/opat/list["+currRow + "]/cretno"));
  444. model.setValue("/root/main/ordinfo/rrgstno",model.getValue("/root/main/trgtmanlist/out/opat/list["+currRow + "]/rrgstno"));
  445. model.setValue("/root/main/ordinfo/centcd",model.getValue("/root/main/trgtmanlist/out/opat/list["+currRow + "]/centcd"));
  446. model.setValue("/root/main/ordinfo/centnm",model.getValue("/root/main/trgtmanlist/out/opat/list["+currRow + "]/centnm"));
  447. model.setValue("/root/main/ordinfo/centengabbr",model.getValue("/root/main/trgtmanlist/out/opat/list["+currRow + "]/centengabbr"));
  448. break;
  449. case 1:
  450. model.setValue("/root/main/ordinfo/ordtype", model.getValue("/root/main/trgtmanlist/in/ipat/list["+currRow + "]/ordtype"));
  451. model.setValue("/root/main/ordinfo/orddeptcd", model.getValue("/root/main/trgtmanlist/in/ipat/list["+currRow + "]/orddeptcd"));
  452. model.setValue("/root/main/ordinfo/pid", model.getValue("/root/main/trgtmanlist/in/ipat/list["+currRow + "]/pid"));
  453. model.setValue("/root/main/ordinfo/patnm",model.getValue("/root/main/trgtmanlist/in/ipat/list["+currRow + "]/patnm"));
  454. model.setValue("/root/main/ordinfo/orddd",model.getValue("/root/main/trgtmanlist/in/ipat/list["+currRow + "]/indd"));
  455. model.setValue("/root/main/ordinfo/orddeptnm", ctrlObj.labelMatrix(currRow,ctrlObj.colRef("orddeptcd")));
  456. model.setValue("/root/main/ordinfo/drid", model.getValue("/root/main/trgtmanlist/in/ipat/list["+currRow + "]/medispclid"));
  457. model.setValue("/root/main/ordinfo/drnm", model.getValue("/root/main/trgtmanlist/in/ipat/list["+currRow + "]/medispclnm"));
  458. model.setValue("/root/main/ordinfo/inroomcd", model.getValue("/root/main/trgtmanlist/in/ipat/list["+currRow + "]/roomcd"));
  459. model.setValue("/root/main/ordinfo/sa", model.getValue("/root/main/trgtmanlist/in/ipat/list["+currRow + "]/sa"));
  460. model.setValue("/root/main/ordinfo/cretno", model.getValue("/root/main/trgtmanlist/in/ipat/list["+currRow + "]/cretno"));
  461. model.setValue("/root/main/ordinfo/rrgstno", model.getValue("/root/main/trgtmanlist/in/ipat/list["+currRow + "]/rrgstno"));
  462. model.setValue("/root/main/ordinfo/centcd", "");
  463. model.setValue("/root/main/ordinfo/centnm", "");
  464. model.setValue("/root/main/ordinfo/centengabbr", "");
  465. break;
  466. case 2:
  467. model.setValue("/root/main/ordinfo/ordtype", model.getValue("/root/main/trgtmanlist/er/erpat/list["+currRow + "]/ordtype"));
  468. model.setValue("/root/main/ordinfo/orddeptcd", model.getValue("/root/main/trgtmanlist/er/erpat/list["+currRow + "]/orddeptcd"));
  469. model.setValue("/root/main/ordinfo/pid", model.getValue("/root/main/trgtmanlist/er/erpat/list["+currRow + "]/pid"));
  470. model.setValue("/root/main/ordinfo/patnm",model.getValue("/root/main/trgtmanlist/er/erpat/list["+currRow + "]/patnm"));
  471. model.setValue("/root/main/ordinfo/orddd",model.getValue("/root/main/trgtmanlist/er/erpat/list["+currRow + "]/indd"));
  472. model.setValue("/root/main/ordinfo/orddeptnm", ctrlObj.labelMatrix(currRow,ctrlObj.colRef("orddeptcd")));
  473. model.setValue("/root/main/ordinfo/drid", model.getValue("/root/main/trgtmanlist/er/erpat/list["+currRow + "]/drid"));
  474. model.setValue("/root/main/ordinfo/drnm", model.getValue("/root/main/trgtmanlist/er/erpat/list["+currRow + "]/drnm"));
  475. model.setValue("/root/main/ordinfo/sa", model.getValue("/root/main/trgtmanlist/er/erpat/list["+currRow + "]/sa"));
  476. model.setValue("/root/main/ordinfo/cretno", model.getValue("/root/main/trgtmanlist/er/erpat/list["+currRow + "]/cretno"));
  477. model.setValue("/root/main/ordinfo/rrgstno", model.getValue("/root/main/trgtmanlist/er/erpat/list["+currRow + "]/rrgstno"));
  478. model.setValue("/root/main/ordinfo/centcd", "");
  479. model.setValue("/root/main/ordinfo/centnm", "");
  480. model.setValue("/root/main/ordinfo/centengabbr", "");
  481. break;
  482. case 3:
  483. model.setValue("/root/main/ordinfo/ordtype", model.getValue("/root/main/trgtmanlist/schpat/srchpat/list["+currRow + "]/ordtype"));
  484. model.setValue("/root/main/ordinfo/orddeptcd", model.getValue("/root/main/trgtmanlist/schpat/srchpat/list["+currRow + "]/orddeptcd"));
  485. model.setValue("/root/main/ordinfo/pid", model.getValue("/root/main/trgtmanlist/schpat/srchpat/list["+currRow + "]/pid"));
  486. model.setValue("/root/main/ordinfo/patnm", model.getValue("/root/main/trgtmanlist/schpat/srchpat/list["+currRow + "]/hngnm"));
  487. model.setValue("/root/main/ordinfo/orddd", model.getValue("/root/main/trgtmanlist/schpat/srchpat/list["+currRow + "]/orddd"));
  488. model.setValue("/root/main/ordinfo/orddeptnm", ctrlObj.labelMatrix(currRow,ctrlObj.colRef("orddeptcd")));
  489. model.setValue("/root/main/ordinfo/drid", model.getValue("/root/main/trgtmanlist/schpat/srchpat/list["+currRow + "]/orddrid"));
  490. model.setValue("/root/main/ordinfo/drnm", model.getValue("/root/main/trgtmanlist/schpat/srchpat/list["+currRow + "]/orddrnm"));
  491. model.setValue("/root/main/ordinfo/inroomcd", model.getValue("/root/main/trgtmanlist/schpat/srchpat/list["+currRow + "]/roomcd"));
  492. model.setValue("/root/main/ordinfo/sa", model.getValue("/root/main/trgtmanlist/schpat/srchpat/list["+currRow + "]/sa"));
  493. model.setValue("/root/main/ordinfo/cretno", model.getValue("/root/main/trgtmanlist/schpat/srchpat/list["+currRow + "]/cretno"));
  494. model.setValue("/root/main/ordinfo/rrgstno", model.getValue("/root/main/trgtmanlist/schpat/srchpat/list["+currRow + "]/rrgstno"));
  495. model.setValue("/root/main/ordinfo/centcd", model.getValue("/root/main/trgtmanlist/schpat/srchpat/list["+currRow + "]/centcd"));
  496. model.setValue("/root/main/ordinfo/centnm", model.getValue("/root/main/trgtmanlist/schpat/srchpat/list["+currRow + "]/centnm"));
  497. model.setValue("/root/main/ordinfo/centengabbr", model.getValue("/root/main/trgtmanlist/schpat/srchpat/list["+currRow + "]/centengabbr"));
  498. break;
  499. case 4:
  500. model.setValue("/root/main/ordinfo/ordtype", model.getValue("/root/main/trgtmanlist/op/oppat/list["+currRow + "]/ordtype"));
  501. model.setValue("/root/main/ordinfo/orddeptcd", model.getValue("/root/main/trgtmanlist/op/oppat/list["+currRow + "]/orddeptcd"));
  502. model.setValue("/root/main/ordinfo/pid", model.getValue("/root/main/trgtmanlist/op/oppat/list["+currRow + "]/pid"));
  503. model.setValue("/root/main/ordinfo/patnm",model.getValue("/root/main/trgtmanlist/op/oppat/list["+currRow + "]/hngnm"));
  504. model.setValue("/root/main/ordinfo/orddd",model.getValue("/root/main/trgtmanlist/op/oppat/list["+currRow + "]/indd"));
  505. model.setValue("/root/main/ordinfo/orddeptnm", ctrlObj.labelMatrix(currRow,ctrlObj.colRef("orddeptcd")));
  506. model.setValue("/root/main/ordinfo/drid", model.getValue("/root/main/trgtmanlist/op/oppat/list["+currRow + "]/perfdrid"));
  507. model.setValue("/root/main/ordinfo/drnm", model.getValue("/root/main/trgtmanlist/op/oppat/list["+currRow + "]/perfdrnm"));
  508. model.setValue("/root/main/ordinfo/inroomcd", model.getValue("/root/main/trgtmanlist/op/oppat/list["+currRow + "]/roomcd"));
  509. model.setValue("/root/main/ordinfo/sa", model.getValue("/root/main/trgtmanlist/op/oppat/list["+currRow + "]/sa"));
  510. model.setValue("/root/main/ordinfo/cretno", model.getValue("/root/main/trgtmanlist/op/oppat/list["+currRow + "]/cretno"));
  511. model.setValue("/root/main/ordinfo/rrgstno", model.getValue("/root/main/trgtmanlist/op/oppat/list["+currRow + "]/rrgstno"));
  512. model.setValue("/root/main/ordinfo/centcd", "");
  513. model.setValue("/root/main/ordinfo/centnm", "");
  514. model.setValue("/root/main/ordinfo/centengabbr", "");
  515. break;
  516. }
  517. model.setValue("/root/main/ocrsch/dept", model.getValue("/root/main/ordinfo/orddeptcd"));
  518. sexflag = model.getValue("/root/main/ordinfo/sa");
  519. var rrgstno = model.getValue("/root/main/ordinfo/rrgstno").substring(0, 8) + "XXXXXX";
  520. model.setValue("/root/main/ordinfo/rrgstno", rrgstno);
  521. /*
  522. if(sexflag.substring(0, 1) == "M"){
  523. model.setValue("/root/main/ordinfo/rrgstno", model.getValue("/root/main/ordinfo/rrgstno") + "-1XXXXXX");
  524. } else if(sexflag.substring(0,1) == "F"){
  525. model.setValue("/root/main/ordinfo/rrgstno", model.getValue("/root/main/ordinfo/rrgstno") + "-2XXXXXX");
  526. }
  527. */
  528. model.refresh();
  529. }
  530. /**
  531. * @desc : OCR 조회
  532. *
  533. * @param :
  534. * @return :
  535. * @author : HIT EMR Team
  536. * @---------------------------------------------------
  537. */
  538. function fSearchOcr(flag){
  539. if(flag == "F"){
  540. var selNode = instance1.selectSingleNode("/root/main/favorlist/list[formcd=" + model.getValue("/root/main/selform") + "]");
  541. var formtypecls = instance1.selectSingleNode("/root/main/favorlist/list[formcd=" + model.getValue("/root/main/selform") + "]/formtypecls");
  542. var ocrtagprntyn = instance1.selectSingleNode("/root/main/favorlist/list[formcd=" + model.getValue("/root/main/selform") + "]/ocrtagprntyn");
  543. if((model.getValue("/root/main/ordinfo/pid") == null) || (model.getValue("/root/main/ordinfo/pid") == "")){
  544. messageBox("환자를", "C002");
  545. return;
  546. } else{
  547. if((model.getValue("/root/main/selform") != '')){
  548. model.setValue("/root/main/ordinfo/formcd", model.getValue("/root/main/selform"));
  549. iviewer1.window.javascript.fGetOCRInfo(model.getValue("/root/main/selform"), null, null, null, null, formtypecls.text, ocrtagprntyn.text);
  550. } else {
  551. messageBox("서식을", "C002");
  552. return;
  553. }
  554. }
  555. } else {
  556. var selNode = instance1.selectSingleNode("/root/main/ocrinfo/ocrlist[formcd=" + model.getValue("/root/main/selform") + "]");
  557. var formtypecls = instance1.selectSingleNode("/root/main/ocrinfo/ocrlist[formcd=" + model.getValue("/root/main/selform") + "]/formtypecls");
  558. var ocrtagprntyn = instance1.selectSingleNode("/root/main/ocrinfo/ocrlist[formcd=" + model.getValue("/root/main/selform") + "]/ocrtagprntyn");
  559. //검색 탭에서 찾기
  560. if (formtypecls == null || formtypecls.text == "")
  561. {
  562. formtypecls = instance1.selectSingleNode("/root/main/formlist[formcd=" + model.getValue("/root/main/selform") + "]/formtypecls");
  563. }
  564. if (ocrtagprntyn == null || ocrtagprntyn.text == "")
  565. {
  566. ocrtagprntyn = instance1.selectSingleNode("/root/main/formlist[formcd=" + model.getValue("/root/main/selform") + "]/ocrtagprntyn");
  567. }
  568. //비었을 경우 즐겨찾기에서 찾기
  569. if (formtypecls == null || formtypecls.text == "")
  570. {
  571. formtypecls = instance1.selectSingleNode("/root/main/favorlist/list[formcd=" + model.getValue("/root/main/selform") + "]/formtypecls");
  572. }
  573. if (ocrtagprntyn == null || ocrtagprntyn.text == "")
  574. {
  575. ocrtagprntyn = instance1.selectSingleNode("/root/main/favorlist/list[formcd=" + model.getValue("/root/main/selform") + "]/ocrtagprntyn");
  576. }
  577. if((model.getValue("/root/main/ordinfo/pid") == null) || (model.getValue("/root/main/ordinfo/pid") == "")){
  578. messageBox("환자를", "C002");
  579. return;
  580. } else{
  581. if((model.getValue("/root/main/selform") != '')){
  582. //20110725
  583. if (model.getValue("/root/main/jinjeong/jinjeonginfo/printyn")=="Y"){
  584. model.setValue("/root/main/ordinfo/formcd", model.getValue("/root/main/selform"));
  585. iviewer1.window.javascript.fGetOCRInfo(model.getValue("/root/main/selform"), null, null, null, null, model.getValue("/root/main/jinjeongcode/jinjeongcdinfo/formtypecls"), model.getValue("/root/main/jinjeongcode/jinjeongcdinfo/ocrtagprntyn"));
  586. //20110725
  587. }else{
  588. model.setValue("/root/main/ordinfo/formcd", model.getValue("/root/main/selform"));
  589. iviewer1.window.javascript.fGetOCRInfo(model.getValue("/root/main/selform"), null, null, null, null, formtypecls.text, ocrtagprntyn.text);
  590. }
  591. //iviewer1.window.javascript.fGetOCRInfo(model.getValue("/root/main/selform"), "00036823", "20070504","1","O");
  592. } else {
  593. messageBox("서식을", "C002");
  594. return;
  595. }
  596. }
  597. }
  598. }
  599. /**
  600. * @desc : 이미지 인쇄
  601. *
  602. * @param :
  603. * @return :
  604. * @author : HIT EMR Team
  605. * @---------------------------------------------------
  606. */
  607. function fPrintImage(prntflag)
  608. {
  609. model.makeValue("/root/send/reqdata/pid", model.getValue("/root/main/ordinfo/pid"));
  610. model.makeValue("/root/send/reqdata/orddd", model.getValue("/root/main/ordinfo/orddd"));
  611. model.makeValue("/root/send/reqdata/cretno", model.getValue("/root/main/ordinfo/cretno"));
  612. model.makeValue("/root/send/reqdata/ordtype", model.getValue("/root/main/ordinfo/ordtype"));
  613. model.makeValue("/root/send/reqdata/formcd", model.getValue("/root/main/ordinfo/formcd"));
  614. //사본발행 및 진단서 가접수 동의서 출력여부 확인 -20150216 이윤주
  615. mmbfGetHardCodeInfo("/root/send/reqdata", "/root/init/prnt", 5989);
  616. var prntcnt = getNodesetCnt(model, "/root/init/prnt/hardcd[hardcd = 'Y']");
  617. if (prntcnt > 0) {
  618. submit("TRMRF02318");
  619. var prntableyn = model.getValue("/root/temp/prntableinfo/prntablelist/prntableyn");
  620. if ( prntableyn == "N" ) {
  621. messageBox("출력할 수 없는 수진이력입니다 사본발행이나 제증명 수진이력이외의 수진이력을 선택해 주십시오","I");
  622. return;
  623. }
  624. }
  625. mmbfGetHardCodeInfo("/root/send/reqdata", "/root/init/preass", 5873);
  626. mmbfGetHardCodeInfo("/root/send/reqdata", "/root/init/jinjeong", 5554);
  627. var formcd = model.getValue("/root/main/ordinfo/formcd");
  628. var formcdcnt = getNodeSetCnt("/root/init/jinjeong/hardcd[hardcd = '" + formcd + "']"); //진정 동의서
  629. var precnt = getNodeSetCnt("/root/init/preass/hardcd"); //진정전 평가서
  630. if (formcdcnt > 0 && precnt > 0) {
  631. if ( "6" == messageBox("진정전 환자 평가서를 작성하시겠습니까?", "Q")) {
  632. _preass = "Y";
  633. }
  634. }
  635. //재출력만 가능한 서식
  636. if (fContainsHardCD("6005", formcd)){
  637. messageBox("재출력만 가능한 서식입니다. 처방발행후 발행리스트 탭을 이용하시기 바랍니다 문의:의무기록팀", "I");
  638. return;
  639. }
  640. // 20110721
  641. // 출력하는 동의서가 진정동의서와 같이 출력 되어야 하는지 체크
  642. var jinjeong="";
  643. if(getParameter("jinjeongchk")==""){
  644. submit("TRMRF02315");
  645. if(model.getValue("/root/main/jinjeong/jinjeonginfo/chkflag")=="true"){
  646. jinjeong=messageBox("진정 동의서를 출력하시겠습니까? ", "S001", ""); //예:6 아니오:7 취소:2
  647. if(jinjeong=="6"){
  648. model.makeValue("/root/main/jinjeong/jinjeonginfo/printyn", "Y");
  649. model.makeValue("/root/send/reqdata/hardcdno", "5554");
  650. submit("TRMRF02316");
  651. setParameter("orijinformcd", model.getValue("/root/main/ordinfo/formcd"));
  652. setParameter("jinjeongchk", "NO");
  653. setParameter("jinjeongchk2","");
  654. }else if(jinjeong=="7"){
  655. setParameter("jinjeongchk", "NO");
  656. setParameter("jinjeongchk2","");
  657. }
  658. }
  659. }
  660. // 20110721
  661. if(submit("TRMRF02312") && jinjeong!="2"){
  662. if(getNodesetCount("/root/main/duplocrprnt/msginfo/list") > 0 && (model.getValue("/root/main/duplocrprnt/msginfo/list/statcd") != "CP" && model.getValue("/root/main/duplocrprnt/msginfo/list/statcd") != "D")) {
  663. //var msg = messageBox("이전 출력 내역이 있습니다. 새서식을 출력", "S003", "재출력을");
  664. // 이윤주 추가(20161104)
  665. var msg = messageBox("오늘 이전 출력 내역이 있습니다. 새서식으로 출력하시겠습니까?", "Q");
  666. if ( 6 != msg ) {
  667. return;
  668. }
  669. // 재출력인 경우(7)
  670. if(msg == "7"){
  671. var formcd = model.getValue("/root/main/duplocrprnt/msginfo/list/formcd");
  672. var formtypecls = model.getValue("/root/main/duplocrprnt/msginfo/list/formtypecls");
  673. var ocrtagprntyn = model.getValue("/root/main/duplocrprnt/msginfo/list/ocrtagprntyn");
  674. var ocrtag = model.getValue("/root/main/duplocrprnt/msginfo/list/ocrtag");
  675. model.setValue("/root/main/ordinfo/ordtype", model.getValue("/root/main/duplocrprnt/msginfo/list/ordtype"));
  676. model.setValue("/root/main/ordinfo/orddeptcd", model.getValue("/root/main/duplocrprnt/msginfo/list/orddeptcd"));
  677. model.setValue("/root/main/ordinfo/pid", model.getValue("/root/main/duplocrprnt/msginfo/list/pid"));
  678. model.setValue("/root/main/ordinfo/patnm", model.getValue("/root/main/duplocrprnt/msginfo/list/patnm"));
  679. model.setValue("/root/main/ordinfo/orddd", model.getValue("/root/main/duplocrprnt/msginfo/list/orddd"));
  680. model.setValue("/root/main/ordinfo/orddeptnm", model.getValue("/root/main/duplocrprnt/msginfo/list/orddeptnm"));
  681. model.setValue("/root/main/ordinfo/drid",model.getValue("/root/main/duplocrprnt/msginfo/list/orddrid"));
  682. model.setValue("/root/main/ordinfo/drnm",model.getValue("/root/main/duplocrprnt/msginfo/list/orddrnm"));
  683. model.setValue("/root/main/ordinfo/sa",model.getValue("/root/main/duplocrprnt/msginfo/list/sa"));
  684. model.setValue("/root/main/ordinfo/cretno",model.getValue("/root/main/duplocrprnt/msginfo/list/cretno"));
  685. model.setValue("/root/main/ordinfo/rrgstno",model.getValue("/root/main/duplocrprnt/msginfo/list/rrgstno"));
  686. var sexflag = model.getValue("/root/main/duplocrprnt/msginfo/list/sa");
  687. var rrgstno = model.getValue("/root/main/ordinfo/rrgstno").substring(0, 8) + "XXXXXX";
  688. model.setValue("/root/main/ordinfo/rrgstno", rrgstno);
  689. /*
  690. if(sexflag.substring(0, 1) == "M"){
  691. model.setValue("/root/main/ordinfo/rrgstno", model.getValue("/root/main/ordinfo/rrgstno") + "-1XXXXXX");
  692. } else if(sexflag.substring(0,1) == "F"){
  693. model.setValue("/root/main/ordinfo/rrgstno", model.getValue("/root/main/ordinfo/rrgstno") + "-2XXXXXX");
  694. }
  695. */
  696. if(formcd != ''){
  697. model.setValue("/root/main/ordinfo/formcd", formcd);
  698. iviewer1.window.javascript.fGetOCRInfo(formcd, null, null, null, null, formtypecls, ocrtagprntyn, ocrtag);
  699. }
  700. iviewer1.window.javascript.fPrint("A");
  701. } else if(msg == "6"){
  702. iviewer1.window.javascript.fPrint(prntflag);
  703. } else {
  704. return;
  705. }
  706. } else {
  707. iviewer1.window.javascript.fPrint(prntflag);
  708. }
  709. if(model.getValue("/root/main/jinjeong/jinjeonginfo/printyn")=="Y" && getParameter("jinjeongchk2")==""){
  710. setParameter("jinjeongchk2","NO");
  711. fJinJeong();
  712. }
  713. } else {
  714. return;
  715. }
  716. if (_preass == "Y"){
  717. _preass = "N";
  718. fOpenPreA();
  719. }
  720. }
  721. /**
  722. * 진정 동의서를 출력
  723. */
  724. function fJinJeong(){
  725. model.setValue("/root/main/selform", model.getValue("/root/main/jinjeongcode/jinjeongcdinfo/jinjeongcd"));
  726. fSearchOcr(); // 진정동의서를 세팅
  727. fPrintImage(); // 진정동의서를 출력
  728. model.setValue("/root/main/selform", getParameter("orijinformcd")); // 진정동의서 이전 이미지의 formcd를 세팅
  729. fSearchOcr(); // 원본 이미지로 세팅
  730. }
  731. /**
  732. * @desc : 재인쇄
  733. *
  734. * @param :
  735. * @return :
  736. * @author : HIT EMR Team
  737. * @---------------------------------------------------
  738. */
  739. function fRePrint(){
  740. /*
  741. var currentpage = iviewer1.model.getValue("/root/main/ocrinfo/currentpage");
  742. if(currentpage > 0)
  743. {
  744. iviewer1.window.javascript.fPrint(model.getValue("/root/main/ocrinfo/ocrlist[" + currentpage + "]/ocrfilenm"), "P");
  745. }
  746. */
  747. iviewer1.window.javascript.fPrint("P");
  748. }
  749. /**
  750. * @desc : 모두 재인쇄
  751. *
  752. * @param :
  753. * @return :
  754. * @---------------------------------------------------
  755. */
  756. function fAllRePrint(){
  757. var statcd = model.getValue("/root/main/ordinfo/statcd");
  758. //상태가 삭제인 경우만 제외하고 재출력이 가능하도록 수정
  759. if ( statcd != "CP" && statcd != "D" )
  760. fPrintImage("A");
  761. else
  762. messageBox("삭제 상태의 서식은 출력 ", "E001");
  763. }
  764. /**
  765. * @desc : OCR 출력 리스트 조회
  766. *
  767. * @param :
  768. * @return :
  769. * @author : HIT EMR Team
  770. * @---------------------------------------------------
  771. */
  772. function fGetOCRPrntList(){
  773. model.removeNodeset("/root/send/reqdata");
  774. if(model.getValue("/root/main/ordinfo/pid") == ""){
  775. model.makeValue("/root/send/reqdata/pid", model.getValue("/root/main/ocrprntlist/pid"));
  776. } else {
  777. if((model.getValue("/root/main/ocrprntlist/pid") != model.getValue("/root/main/ordinfo/pid")) && (model.getValue("/root/main/ocrprntlist/pid") != "")){
  778. model.makeValue("/root/send/reqdata/pid", model.getValue("/root/main/ocrprntlist/pid"));
  779. } else {
  780. model.makeValue("/root/send/reqdata/pid", model.getValue("/root/main/ordinfo/pid"));
  781. }
  782. }
  783. model.makeValue("/root/send/reqdata/fromdd", model.getValue("/root/main/ocrprntlist/fromdd"));
  784. model.makeValue("/root/send/reqdata/todd", model.getValue("/root/main/ocrprntlist/todd"));
  785. if (model.getValue("/root/send/reqdata/pid") == "") {
  786. messageBox("등록번호 없이는 조회가 되지 않습니다 ", "I999");
  787. return;
  788. }
  789. submit("TRMRF02304");
  790. }
  791. /**
  792. * @desc : OCR 리스트 선택
  793. *
  794. * @param :
  795. * @return :
  796. * @author : HIT EMR Team
  797. * @---------------------------------------------------
  798. */
  799. function fSelOCRList(){
  800. var rownum = grd_ocrprntlist.row;
  801. var formcd = model.getValue("/root/main/ocrprntlist/ocrprnthist/list["+rownum+"]/formcd");
  802. var formtypecls = model.getValue("/root/main/ocrprntlist/ocrprnthist/list["+rownum+"]/formtypecls");
  803. var ocrtagprntyn = model.getValue("/root/main/ocrprntlist/ocrprnthist/list["+rownum+"]/ocrtagprntyn");
  804. var ocrtag = model.getValue("/root/main/ocrprntlist/ocrprnthist/list["+rownum+"]/ocrtag");
  805. var eocryn = model.getValue("/root/main/ocrprntlist/ocrprnthist/list["+rownum+"]/eocryn");
  806. if (eocryn == "Y") {
  807. btn_pageReprnt.disabled=true;
  808. btn_Reprnt.disabled=true;
  809. btn_ecntform.disabled=true;
  810. btn_mutiprnt.disabled=true;
  811. btn_prnt.disabled=true;
  812. }
  813. // 20100309 한재상 수정 - 유전자검사동의서 재출력
  814. reqHardCodeInfo("/root/send/reqdata", "/root/init/hardcdno", 199);
  815. if ( formcd == model.getValue("/root/init/hardcdno/hardcd/hardcd") ) { //유전자검사동의서
  816. var msgRtn = messageBox("유전자검사동의서는 재출력만 가능합니다.\n\n 유전자검사용 재출력 ", "S006", " 유전자검사용+연구용 재출력| 재출력 안");
  817. if ( msgRtn == "6" || msgRtn == "7") {
  818. model.makeValue("/root/send/ocrtag", ocrtag);
  819. var ordtype = model.getValue("/root/main/ocrprntlist/ocrprnthist/list["+rownum+"]/ioflag");
  820. if (ordtype == "O" || ordtype == "S") model.makeValue("/root/send/ordtype", "O");
  821. else model.makeValue("/root/send/ordtype", "I");
  822. model.makeValue("/root/hidden/geneunitlist", "");
  823. submit("TRMMO21001", true);
  824. model.setValue("/root/hidden/geneunitlist/logurl", getBigLogoImageURL("", ""));
  825. if ( msgRtn == "6" ) model.makeValue("/root/hidden/geneunitlist/inspecttype", "0");
  826. else if ( msgRtn == "7" ) model.makeValue("/root/hidden/geneunitlist/inspecttype", "1");
  827. exeReportPreview("RPMMO21001", "XMLSTR" , "/root/hidden/geneunitlist" , "" , "true" , "", "", "", "", "", "", "grp_report");
  828. }
  829. } else { // 기존 OCR동의서
  830. model.setValue("/root/main/ordinfo/ordtype", model.getValue("/root/main/ocrprntlist/ocrprnthist/list["+rownum+"]/ioflag"));
  831. model.setValue("/root/main/ordinfo/orddeptcd", model.getValue("/root/main/ocrprntlist/ocrprnthist/list["+rownum + "]/orddeptcd"));
  832. model.setValue("/root/main/ordinfo/pid", model.getValue("/root/main/ocrprntlist/ocrprnthist/list["+rownum + "]/pid"));
  833. model.setValue("/root/main/ordinfo/patnm", model.getValue("/root/main/ocrprntlist/ocrprnthist/list["+rownum + "]/patnm"));
  834. model.setValue("/root/main/ordinfo/orddd", model.getValue("/root/main/ocrprntlist/ocrprnthist/list["+rownum + "]/orddd"));
  835. model.setValue("/root/main/ordinfo/orddeptnm", model.getValue("/root/main/ocrprntlist/ocrprnthist/list["+rownum + "]/orddeptnm"));
  836. model.setValue("/root/main/ordinfo/drid",model.getValue("/root/main/ocrprntlist/ocrprnthist/list["+rownum + "]/orddrid"));
  837. model.setValue("/root/main/ordinfo/drnm",model.getValue("/root/main/ocrprntlist/ocrprnthist/list["+rownum + "]/orddrnm"));
  838. model.setValue("/root/main/ordinfo/sa",model.getValue("/root/main/ocrprntlist/ocrprnthist/list["+rownum + "]/sa"));
  839. model.setValue("/root/main/ordinfo/cretno",model.getValue("/root/main/ocrprntlist/ocrprnthist/list["+rownum + "]/cretno"));
  840. model.setValue("/root/main/ordinfo/rrgstno",model.getValue("/root/main/ocrprntlist/ocrprnthist/list["+rownum + "]/rrgstno"));
  841. model.makeValue("/root/main/ordinfo/statcd",model.getValue("/root/main/ocrprntlist/ocrprnthist/list["+rownum + "]/statcd"));
  842. var sexflag = model.getValue("/root/main/ocrprntlist/ocrprnthist/list["+rownum + "]/sa");
  843. var rrgstno = model.getValue("/root/main/ordinfo/rrgstno").substring(0, 8) + "XXXXXX";
  844. model.setValue("/root/main/ordinfo/rrgstno", rrgstno);
  845. /*
  846. if(sexflag.substring(0, 1) == "M"){
  847. model.setValue("/root/main/ordinfo/rrgstno", model.getValue("/root/main/ordinfo/rrgstno") + "-1XXXXXX");
  848. } else if(sexflag.substring(0,1) == "F"){
  849. model.setValue("/root/main/ordinfo/rrgstno", model.getValue("/root/main/ordinfo/rrgstno") + "-2XXXXXX");
  850. }
  851. */
  852. if(grd_ocrprntlist.isCell(event.target) && grd_ocrprntlist.mouserow >= grd_ocrprntlist.fixedrows) {//그리드에서 데이타영역만 선택
  853. if(formcd != ''){
  854. model.setValue("/root/main/ordinfo/formcd", formcd);
  855. iviewer1.window.javascript.fGetOCRInfo(formcd, null, null, null, null, formtypecls, ocrtagprntyn, ocrtag);
  856. }
  857. }
  858. }
  859. model.refresh();
  860. }
  861. /**
  862. * @desc : 즐겨찾기 OCR 셋팅
  863. *
  864. * @param :
  865. * @return :
  866. * @author : HIT EMR Team
  867. * @---------------------------------------------------
  868. */
  869. function fSetFavorOCR(){
  870. if(swt_ocrinfoflag.selectedIndex == 0){
  871. var selIndx = trv_ocrlist.selectedIndex + 1;
  872. var depth = instance1.selectSingleNode("/root/main/ocrinfo/ocrlist[" + selIndx + "]").depth.text;
  873. var ocrForm = instance1.selectSingleNode("/root/main/ocrinfo/ocrlist[" + selIndx + "]").formcd.text;
  874. } else if(swt_ocrinfoflag.selectedIndex == 3){
  875. var selIndx = grd_ocrformlist.row;
  876. var depth = model.getValue("/root/main/formlist[" + selIndx + "]/depth");
  877. var ocrForm = model.getValue("/root/main/formlist[" + selIndx + "]/formcd");
  878. }
  879. model.removeNodeSet("/root/main/favor/savedata");
  880. model.removeNodeset("/root/send/reqdata");
  881. model.makeNode("/root/send/reqdata");
  882. /*
  883. switch(depth){
  884. case "1":
  885. model.makeValue("/root/main/favor/savedata/supitemindxseq", "0");
  886. model.makeValue("/root/main/favor/savedata/indxflag", "O");
  887. model.makeValue("/root/main/favor/savedata/deptcd", getUserInfo("posdeptcd"));
  888. model.makeValue("/root/main/favor/savedata/userid", getUserInfo("userid"));
  889. model.makeValue("/root/main/favor/savedata/fstrgstrid", getUserInfo("userid"));
  890. model.makeValue("/root/main/favor/savedata/fstrgstdt", getCurrentDate()+getCurrentTime());
  891. model.makeValue("/root/main/favor/savedata/lastupdtrid", getUserInfo("userid"));
  892. model.makeValue("/root/main/favor/savedata/lastupdtdt", getCurrentDate()+getCurrentTime());
  893. if(ocrForm == ""){
  894. model.makeValue("/root/main/favor/savedata/linkflag", "N");
  895. model.makeValue("/root/main/favor/savedata/linkcd", "");
  896. } else {
  897. model.makeValue("/root/main/favor/savedata/linkflag", "Y");
  898. model.makeValue("/root/main/favor/savedata/linkcd", instance1.selectSingleNode("/root/main/ocrinfo/ocrlist[" + selIndx + "]").formcd.text);
  899. }
  900. break;
  901. case "2":
  902. model.makeValue("/root/main/favor/savedata/supitemindxseq", instance1.selectSingleNode("/root/main/ocrinfo/ocrlist[" + selIndx + "]").lrgclscd.text);
  903. model.makeValue("/root/main/favor/savedata/indxflag", "O");
  904. model.makeValue("/root/main/favor/savedata/deptcd", getUserInfo("posdeptcd"));
  905. model.makeValue("/root/main/favor/savedata/userid", getUserInfo("userid"));
  906. model.makeValue("/root/main/favor/savedata/fstrgstrid", getUserInfo("userid"));
  907. model.makeValue("/root/main/favor/savedata/fstrgstdt", getCurrentDate()+getCurrentTime());
  908. model.makeValue("/root/main/favor/savedata/lastupdtrid", getUserInfo("userid"));
  909. model.makeValue("/root/main/favor/savedata/lastupd", getCurrentDate()+getCurrentTime());
  910. if(ocrForm == ""){
  911. model.makeValue("/root/main/favor/savedata/linkflag", "N");
  912. model.makeValue("/root/main/favor/savedata/linkcd", "");
  913. } else {
  914. model.makeValue("/root/main/favor/savedata/linkflag", "Y");
  915. model.makeValue("/root/main/favor/savedata/linkcd", instance1.selectSingleNode("/root/main/ocrinfo/ocrlist[" + selIndx + "]").formcd.text);
  916. }
  917. break;
  918. case "3":
  919. model.makeValue("/root/main/favor/savedata/supitemindxseq", instance1.selectSingleNode("/root/main/ocrinfo/ocrlist[" + selIndx + "]").mdlclscd.text);
  920. model.makeValue("/root/main/favor/savedata/indxflag", "O");
  921. model.makeValue("/root/main/favor/savedata/deptcd", getUserInfo("posdeptcd"));
  922. model.makeValue("/root/main/favor/savedata/userid", getUserInfo("userid"));
  923. model.makeValue("/root/main/favor/savedata/fstrgstrid", getUserInfo("userid"));
  924. model.makeValue("/root/main/favor/savedata/fstrgstdt", getCurrentDate()+getCurrentTime());
  925. model.makeValue("/root/main/favor/savedata/lastupdtrid", getUserInfo("userid"));
  926. model.makeValue("/root/main/favor/savedata/lastupdtdt", getCurrentDate()+getCurrentTime());
  927. if(ocrForm == ""){
  928. model.makeValue("/root/main/favor/savedata/linkflag", "N");
  929. model.makeValue("/root/main/favor/savedata/linkcd", "");
  930. } else {
  931. model.makeValue("/root/main/favor/savedata/linkflag", "Y");
  932. model.makeValue("/root/main/favor/savedata/linkcd", instance1.selectSingleNode("/root/main/ocrinfo/ocrlist[" + selIndx + "]").formcd.text);
  933. }
  934. break;
  935. case "4":
  936. model.makeValue("/root/main/favor/savedata/supitemindxseq", instance1.selectSingleNode("/root/main/ocrinfo/ocrlist[" + selIndx + "]").smlclscd.text);
  937. model.makeValue("/root/main/favor/savedata/indxflag", "O");
  938. model.makeValue("/root/main/favor/savedata/deptcd", getUserInfo("posdeptcd"));
  939. model.makeValue("/root/main/favor/savedata/userid", getUserInfo("userid"));
  940. model.makeValue("/root/main/favor/savedata/fstrgstrid", getUserInfo("userid"));
  941. model.makeValue("/root/main/favor/savedata/fstrgstdt", getCurrentDate()+getCurrentTime());
  942. model.makeValue("/root/main/favor/savedata/lastupdtrid", getUserInfo("userid"));
  943. model.makeValue("/root/main/favor/savedata/lastupdtdt", getCurrentDate()+getCurrentTime());
  944. if(ocrForm == ""){
  945. model.makeValue("/root/main/favor/savedata/linkflag", "N");
  946. model.makeValue("/root/main/favor/savedata/linkcd", "");
  947. } else {
  948. model.makeValue("/root/main/favor/savedata/linkflag", "Y");
  949. model.makeValue("/root/main/favor/savedata/linkcd", instance1.selectSingleNode("/root/main/ocrinfo/ocrlist[" + selIndx + "]").formcd.text);
  950. }
  951. break;
  952. case "5":
  953. model.makeValue("/root/main/favor/savedata/supitemindxseq", instance1.selectSingleNode("/root/main/ocrinfo/ocrlist[" + selIndx + "]").detclscd.text);
  954. model.makeValue("/root/main/favor/savedata/indxflag", "O");
  955. model.makeValue("/root/main/favor/savedata/deptcd", getUserInfo("posdeptcd"));
  956. model.makeValue("/root/main/favor/savedata/userid", getUserInfo("userid"));
  957. model.makeValue("/root/main/favor/savedata/fstrgstrid", getUserInfo("userid"));
  958. model.makeValue("/root/main/favor/savedata/fstrgstdt", getCurrentDate()+getCurrentTime());
  959. model.makeValue("/root/main/favor/savedata/lastupdtrid", getUserInfo("userid"));
  960. model.makeValue("/root/main/favor/savedata/lastupdtdt", getCurrentDate()+getCurrentTime());
  961. if(ocrForm == ""){
  962. model.makeValue("/root/main/favor/savedata/linkflag", "N");
  963. model.makeValue("/root/main/favor/savedata/linkcd", "");
  964. } else {
  965. model.makeValue("/root/main/favor/savedata/linkflag", "Y");
  966. model.makeValue("/root/main/favor/savedata/linkcd", instance1.selectSingleNode("/root/main/ocrinfo/ocrlist[" + selIndx + "]").formcd.text);
  967. }
  968. break;
  969. default :
  970. model.makeValue("/root/main/favor/savedata/supitemindxseq", "-1");
  971. model.makeValue("/root/main/favor/savedata/indxflag", "O");
  972. model.makeValue("/root/main/favor/savedata/deptcd", getUserInfo("posdeptcd"));
  973. model.makeValue("/root/main/favor/savedata/userid", getUserInfo("userid"));
  974. model.makeValue("/root/main/favor/savedata/fstrgstrid", getUserInfo("userid"));
  975. model.makeValue("/root/main/favor/savedata/fstrgstdt", getCurrentDate()+getCurrentTime());
  976. model.makeValue("/root/main/favor/savedata/lastupdtrid", getUserInfo("userid"));
  977. model.makeValue("/root/main/favor/savedata/lastupdtdt", getCurrentDate()+getCurrentTime());
  978. if(ocrForm == ""){
  979. model.makeValue("/root/main/favor/savedata/linkflag", "N");
  980. model.makeValue("/root/main/favor/savedata/linkcd", "");
  981. } else {
  982. model.makeValue("/root/main/favor/savedata/linkflag", "Y");
  983. model.makeValue("/root/main/favor/savedata/linkcd", instance1.selectSingleNode("/root/main/ocrinfo/ocrlist[" + selIndx + "]").formcd.text);
  984. }
  985. break;
  986. } */
  987. if(swt_ocrinfoflag.selectedIndex == 0){
  988. model.makeValue("/root/main/favor/savedata/supitemindxseq", instance1.selectSingleNode("/root/main/ocrinfo/ocrlist[" + selIndx + "]").supindx.text);
  989. } else if(swt_ocrinfoflag.selectedIndex == 3){
  990. model.makeValue("/root/main/favor/savedata/supitemindxseq", model.getValue("/root/main/formlist[" + selIndx + "]/supindx"));
  991. }
  992. model.makeValue("/root/main/favor/savedata/indxflag", "O");
  993. model.makeValue("/root/main/favor/savedata/deptcd", getUserInfo("dutplcecd"));
  994. model.makeValue("/root/main/favor/savedata/userid", getUserInfo("userid"));
  995. model.makeValue("/root/main/favor/savedata/fstrgstrid", getUserInfo("userid"));
  996. model.makeValue("/root/main/favor/savedata/fstrgstdt", getCurrentDate()+getCurrentTime());
  997. model.makeValue("/root/main/favor/savedata/lastupdtrid", getUserInfo("userid"));
  998. model.makeValue("/root/main/favor/savedata/lastupdtdt", getCurrentDate()+getCurrentTime());
  999. if(ocrForm == ""){
  1000. model.makeValue("/root/main/favor/savedata/linkflag", "N");
  1001. model.makeValue("/root/main/favor/savedata/linkcd", "");
  1002. } else {
  1003. model.makeValue("/root/main/favor/savedata/linkflag", "Y");
  1004. model.makeValue("/root/main/favor/savedata/linkcd", ocrForm);
  1005. }
  1006. model.copyNode("/root/send/reqdata", "/root/main/favor/savedata");
  1007. if(submit("TXMRF02301")){
  1008. messageBox("즐겨찾기 등록", "I001");
  1009. fGetFavorList();
  1010. trv_favorlist.refresh();
  1011. } else {
  1012. messageBox("즐겨찾기 등록을", "E009");
  1013. return;
  1014. }
  1015. }
  1016. /**
  1017. * @desc : 즐겨찾기 OCR 리스트 조회
  1018. *
  1019. * @param :
  1020. * @return :
  1021. * @author : HIT EMR Team
  1022. * @---------------------------------------------------
  1023. */
  1024. function fGetFavorList(){
  1025. model.removeNodeset("/root/send/reqdata");
  1026. model.makeValue("/root/send/reqdata/indxflag", "O");
  1027. model.makeValue("/root/send/reqdata/userid", getUserInfo("userid"));
  1028. submit("TRMRF02301");
  1029. }
  1030. /**
  1031. * @desc : OCR 트리 구조 조회
  1032. *
  1033. * @param :
  1034. * @return :
  1035. * @author : HIT EMR Team
  1036. * @---------------------------------------------------
  1037. */
  1038. function fOcrTreeSrch(){
  1039. model.removeNodeset("/root/send/reqdata");
  1040. model.makeValue("/root/send/reqdata/ocrflag", model.getValue("/root/main/ocrsch/ocrflag"));
  1041. model.makeValue("/root/send/reqdata/formbizcls", model.getValue("/root/main/ocrsch/formbizcls"));
  1042. model.makeValue("/root/send/reqdata/orddeptcd", model.getValue("/root/main/ocrsch/dept"));
  1043. model.makeValue("/root/send/reqdata/formchosflag", model.getValue("/root/main/ocrsch/formchosflag"));
  1044. submit("TRMRF02309");
  1045. trv_ocrlist.rebuild();
  1046. }
  1047. /**
  1048. * @desc : 즐겨찾기에 등록
  1049. *
  1050. * @param :
  1051. * @return :
  1052. * @author : HIT EMR Team
  1053. * @---------------------------------------------------
  1054. */
  1055. function fAddFavor(){
  1056. var selectedFormcd = "";
  1057. if(swt_ocrinfoflag.selectedIndex == 0){
  1058. selectedFormcd = model.getValue("/root/main/ocrinfo/ocrlist[" + ( trv_ocrlist.mouseRow + 1 )+ "]/formcd");
  1059. } else if(swt_ocrinfoflag.selectedIndex == 3){
  1060. selectedFormcd = model.getValue("/root/main/formlist[" + ( grd_ocrformlist.mouseRow )+ "]/formcd");
  1061. }
  1062. if(selectedFormcd == ""){
  1063. return;
  1064. }
  1065. if(swt_ocrinfoflag.selectedIndex == 0){
  1066. if(trv_ocrlist.isCell(event.target) && trv_ocrlist.mouseRow <= trv_ocrlist.length){
  1067. if( instance1.selectSingleNode("/root/main/favorlist/list[formcd='" + selectedFormcd + "']") != null ){
  1068. messageBox("즐겨찾기에 중복으로 등록", "E001");
  1069. model.setValue("/root/main/selform", "");
  1070. trv_favorlist.rebuild();
  1071. return;
  1072. } else {
  1073. setPopupMenu("trv_ocrlist", false, "/root/init/mouserght", "label", "value");
  1074. }
  1075. } else {
  1076. initPopupMenu();
  1077. }
  1078. } else if(swt_ocrinfoflag.selectedIndex == 3){
  1079. if(grd_ocrformlist.isCell(event.target) && grd_ocrformlist.mouserow >= grd_ocrformlist.fixedrows){
  1080. if( instance1.selectSingleNode("/root/main/favorlist/list[formcd='" + selectedFormcd + "']") != null ){
  1081. messageBox("즐겨찾기에 중복으로 등록", "E001");
  1082. model.setValue("/root/main/selform", "");
  1083. trv_favorlist.rebuild();
  1084. return;
  1085. } else {
  1086. setPopupMenu("grd_ocrformlist", false, "/root/init/mouserght", "label", "value");
  1087. }
  1088. } else {
  1089. initPopupMenu();
  1090. }
  1091. }
  1092. }
  1093. /**
  1094. * @desc : 즐겨찾기에서 삭제
  1095. *
  1096. * @param :
  1097. * @return :
  1098. * @author : HIT EMR Team
  1099. * @---------------------------------------------------
  1100. */
  1101. function fDelFavor(){
  1102. if(trv_favorlist.value == ""){
  1103. return;
  1104. }
  1105. var selectedFormcd = trv_favorlist.value;
  1106. if(trv_favorlist.isCell(event.target) && trv_favorlist.mouseRow <= trv_favorlist.length){
  1107. setPopupMenu("trv_favorlist", false, "/root/init/favormouserght", "label", "value");
  1108. } else {
  1109. initPopupMenu();
  1110. }
  1111. }
  1112. /**
  1113. * @desc : OCR 즐겨찾기에서 삭제
  1114. *
  1115. * @param :
  1116. * @return :
  1117. * @author : HIT EMR Team
  1118. * @---------------------------------------------------
  1119. */
  1120. function fDelFavorOCR(){
  1121. if(trv_favorlist.focusIndex < 0){
  1122. return;
  1123. }
  1124. var selIndx = trv_favorlist.selectedIndex + 1;
  1125. var ocrItemindx = instance1.selectSingleNode("/root/main/favorlist/list[" + selIndx + "]").itemindxseq.text
  1126. model.removeNodeset("/root/send/reqdata");
  1127. model.makeNode("/root/send/reqdata");
  1128. model.makeValue("/root/send/reqdata/itemindxseq", ocrItemindx);
  1129. model.makeValue("/root/send/reqdata/indxflag", "O");
  1130. model.makeValue("/root/send/reqdata/userid", getUserInfo("userid"));
  1131. submit("TXMRF02302");
  1132. }
  1133. /**
  1134. * @desc : 폼 조회
  1135. *
  1136. * @param :
  1137. * @return :
  1138. * @author : HIT EMR Team
  1139. * @---------------------------------------------------
  1140. */
  1141. function fSrchForm(){
  1142. model.makeValue("/root/send/reqdata/reqflag", "formnm");
  1143. model.makeValue("/root/send/reqdata/reqdata", model.getValue("/root/main/srchocrformnm"));
  1144. model.makeValue("/root/send/reqdata/reqstatus", "0");
  1145. model.makeValue("/root/send/reqdata/reqformprogflag", "OCR,OCR(CODE)");
  1146. submit("TRMRF02302");
  1147. model.removeNodeset("/root/send/reqdata");
  1148. model.setValue("/root/main/srchocrformnm", "");
  1149. }
  1150. /**
  1151. * @desc : OCR 폼리스트 선택
  1152. *
  1153. * @param :
  1154. * @return :
  1155. * @author : HIT EMR Team
  1156. * @---------------------------------------------------
  1157. */
  1158. function fSelOCRFormList(){
  1159. var rownum = grd_ocrformlist.row;
  1160. var formcd = model.getValue("/root/main/formlist["+rownum+"]/formcd");
  1161. var formtypecls = model.getValue("/root/main/formlist["+rownum+"]/formtypecls");
  1162. var ocrtagprntyn = model.getValue("/root/main/formlist["+rownum+"]/ocrtagprntyn");
  1163. model.makeValue("/root/main/selform", formcd);
  1164. if(grd_ocrformlist.isCell(event.target) && grd_ocrformlist.mouserow >= grd_ocrformlist.fixedrows) {//그리드에서 데이타영역만 선택
  1165. if(formcd != ''){
  1166. iviewer1.window.javascript.fGetOCRInfo(formcd, null, null, null, null, formtypecls, ocrtagprntyn);
  1167. model.setValue("/root/main/ordinfo/formcd", formcd);
  1168. }
  1169. }
  1170. }
  1171. /**
  1172. * @desc : 환자정보 셋팅
  1173. *
  1174. * @param :
  1175. * @return :
  1176. * @author : HIT EMR Team
  1177. * @---------------------------------------------------
  1178. */
  1179. function fGetParaInfo(){
  1180. var sexinfo;
  1181. var ageinfo;
  1182. var node = instance1.selectNodes("/root/temp/para/pid");
  1183. if(node.length < 1){
  1184. return false;
  1185. }
  1186. model.setValue("/root/main/ordinfo/pid", model.getValue("/root/temp/para/pid"));
  1187. model.setValue("/root/main/ordinfo/orddd", model.getValue("/root/temp/para/orddd"));
  1188. model.setValue("/root/main/ordinfo/orddeptcd", model.getValue("/root/temp/para/orddeptcd"));
  1189. model.setValue("/root/main/ordinfo/orddeptnm", model.getValue("/root/temp/para/orddeptnm"));
  1190. model.setValue("/root/main/ordinfo/drid", model.getValue("/root/temp/para/orddrid"));
  1191. model.setValue("/root/main/ordinfo/drnm", model.getValue("/root/temp/para/drnm"));
  1192. model.setValue("/root/main/ordinfo/ordtype", model.getValue("/root/temp/para/ordtype"));
  1193. model.setValue("/root/main/ordinfo/patnm", model.getValue("/root/temp/para/patnm"));
  1194. model.setValue("/root/main/ordinfo/inroomcd", model.getValue("/root/temp/para/inroomcd"));
  1195. model.setValue("/root/main/ordinfo/cretno", model.getValue("/root/temp/para/cretno"));
  1196. //model.setValue("/root/main/ordinfo/rrgstno", model.getValue("/root/temp/para/rrgstno1"));
  1197. //나이 구하기
  1198. ageinfo = getFullAge(model.getValue("/root/temp/para/rrgstno1")+model.getValue("/root/temp/para/rrgstno2"));
  1199. //성별 구하기
  1200. sexinfo = getGender(model.getValue("/root/temp/para/rrgstno2"));
  1201. var rrgstno = model.getValue("/root/temp/para/rrgstno1") + "-" + model.getValue("/root/temp/para/rrgstno2").substring(0, 1) + "XXXXXX";
  1202. model.setValue("/root/main/ordinfo/rrgstno", rrgstno);
  1203. /*
  1204. if(sexinfo == 'M'){
  1205. model.setValue("/root/main/ordinfo/rrgstno", model.getValue("/root/temp/para/rrgstno1") + "-1XXXXXX");
  1206. } else if(sexinfo == 'F'){
  1207. model.setValue("/root/main/ordinfo/rrgstno", model.getValue("/root/temp/para/rrgstno1") + "-2XXXXXX");
  1208. }
  1209. */
  1210. model.setValue("/root/main/ordinfo/sa", sexinfo + "/" + ageinfo);
  1211. return true;
  1212. //model.setValue("/root/main/ordinfo/orddeptnm", getPatientInfo("orddept"));
  1213. //model.setValue("/root/main/ordinfo/drnm", getPatientInfo("apntdr"));
  1214. }
  1215. /**
  1216. * @desc : 다중 출력
  1217. *
  1218. * @param :
  1219. * @return :
  1220. * @author : HIT EMR Team
  1221. * @---------------------------------------------------
  1222. */
  1223. function fMutiPrnt(){
  1224. var nodeList = "";
  1225. if(swt_trgtmanlist.selectedIndex == 0){
  1226. nodeList = instance1.selectNodes("/root/main/trgtmanlist/out/opat/list");
  1227. for(var i = 1; i <= nodeList.length; i++){
  1228. if(model.getValue("/root/main/trgtmanlist/out/opat/list["+i+"]/check") == "true"){
  1229. grd_opatlist.row = i;
  1230. fSelectPat("grd_opatlist");
  1231. fSearchOcr();
  1232. fPrintImage();
  1233. setParameter("jinjeongchk2","");
  1234. }
  1235. }
  1236. setParameter("jinjeongchk", "");
  1237. } else if(swt_trgtmanlist.selectedIndex == 1){
  1238. nodeList = instance1.selectNodes("/root/main/trgtmanlist/in/ipat/list");
  1239. for(var i = 1; i <= nodeList.length; i++){
  1240. if(model.getValue("/root/main/trgtmanlist/in/ipat/list["+i+"]/check") == "true"){
  1241. grd_ipatlist.row = i;
  1242. fSelectPat("grd_ipatlist");
  1243. fSearchOcr();
  1244. fPrintImage();
  1245. setParameter("jinjeongchk2","");
  1246. }
  1247. }
  1248. setParameter("jinjeongchk", "");
  1249. } else if(swt_trgtmanlist.selectedIndex == 2){
  1250. nodeList = instance1.selectNodes("/root/main/trgtmanlist/er/erpat/list");
  1251. for(var i = 1; i <= nodeList.length; i++){
  1252. if(model.getValue("/root/main/trgtmanlist/er/erpat/list["+i+"]/check") == "true"){
  1253. grd_epatlist.row = i;
  1254. fSelectPat("grd_epatlist");
  1255. fSearchOcr();
  1256. fPrintImage();
  1257. setParameter("jinjeongchk2","");
  1258. }
  1259. }
  1260. setParameter("jinjeongchk", "");
  1261. } else if(swt_trgtmanlist.selectedIndex == 3){
  1262. nodeList = instance1.selectNodes("/root/main/trgtmanlist/schpat/srchpat/list");
  1263. for(var i = 1; i <= nodeList.length; i++){
  1264. if(model.getValue("/root/main/trgtmanlist/schpat/srchpat/list["+i+"]/check") == "true"){
  1265. grd_srchpatlist.row = i;
  1266. fSelectPat("grd_srchpatlist");
  1267. fSearchOcr();
  1268. fPrintImage();
  1269. setParameter("jinjeongchk2","");
  1270. }
  1271. }
  1272. setParameter("jinjeongchk", "");
  1273. } else if(swt_trgtmanlist.selectedIndex == 4){
  1274. //alert("AA");
  1275. nodeList = instance1.selectNodes("/root/main/trgtmanlist/op/oppat/list");
  1276. for(var i = 1; i <= nodeList.length; i++){
  1277. if(model.getValue("/root/main/trgtmanlist/op/oppat/list["+i+"]/check") == "true"){
  1278. grd_oppatlist.row = i;
  1279. fSelectPat("grd_oppatlist");
  1280. fSearchOcr();
  1281. fPrintImage();
  1282. setParameter("jinjeongchk2","");
  1283. }
  1284. }
  1285. setParameter("jinjeongchk", "");
  1286. }
  1287. }
  1288. /**
  1289. * @desc : 입원환자 셋팅
  1290. *
  1291. * @param :
  1292. * @return :
  1293. * @author : HIT EMR Team
  1294. * @---------------------------------------------------
  1295. */
  1296. function fSettingInPat(){
  1297. var paminfo;
  1298. var paminfocnt = 0;
  1299. var paminfoflag;
  1300. var paminfotag;
  1301. var paminfovalue;
  1302. var pid = "";
  1303. var orddeptcd = "";
  1304. var wardcd = "";
  1305. var orddrid = "";
  1306. model.removeNodeset("/root/main/common/dept");
  1307. zsdfGetInOrdDeptList(getUserInfo("dutplceinstcd"), "/root/main/common", "depthngnm", "asc");
  1308. copyNodeset("/root/main/trgtmanlist/in/dept", "/root/main/common/dept", "replace");
  1309. //copyNodeset("/root/init/ocrsch/dept", "/root/main/common/dept", "replace");
  1310. addComboItem("cmb_indeptlist", "전체", "-", "above");
  1311. //addComboItem("cmb_ocrdept", "전체", "-", "above");
  1312. paminfo = getGlobalVariable("paminfo");
  1313. if(paminfo.length > 0){
  1314. paminfoflag = paminfo.split("▩");
  1315. paminfotag = paminfoflag[0].split("▦");
  1316. paminfovalue = paminfoflag[1].split("▦");
  1317. while(paminfocnt < paminfotag.length){
  1318. switch(paminfotag[paminfocnt])
  1319. {
  1320. case "pid":
  1321. pid = paminfovalue[paminfocnt];
  1322. break;
  1323. case "orddeptcd":
  1324. orddeptcd = paminfovalue[paminfocnt];
  1325. break;
  1326. case "orddrid":
  1327. orddrid = paminfovalue[paminfocnt];
  1328. break;
  1329. case "wardcd":
  1330. wardcd = paminfovalue[paminfocnt];
  1331. break;
  1332. }
  1333. paminfocnt++;
  1334. }
  1335. }
  1336. if((getUserInfo("jobkindcd") == "0330") || (getUserInfo("jobkindcd") == "0332")){
  1337. cmb_wardlist.value = "-";
  1338. cmb_indeptlist.value = getUserInfo("dutplcecd");
  1339. fChngSrchCond("/root/main/trgtmanlist/in/dept", "/root/main/trgtmanlist/in/drlist", "staff");
  1340. cmb_indrlist.value = getUserInfo("userid");
  1341. fReqInPatList();
  1342. } else if((getUserInfo("jobkindcd") == "2820") || (getUserInfo("jobkindcd") == "1140")){
  1343. cmb_wardlist.value = getUserInfo("dutplcecd");
  1344. cmb_indeptlist.value = "-";
  1345. fChngSrchCond("/root/main/trgtmanlist/in/dept","/root/main/trgtmanlist/in/drlist", "staff");
  1346. cmb_indrlist.value = "-";
  1347. fReqInPatList();
  1348. } else if(pid != "") {
  1349. cmb_wardlist.value = wardcd;
  1350. cmb_indeptlist.value = orddeptcd;
  1351. fChngSrchCond("/root/main/trgtmanlist/in/dept","/root/main/trgtmanlist/in/drlist", "staff");
  1352. cmb_indrlist.value = "-";
  1353. fReqInPatList();
  1354. } else {
  1355. cmb_wardlist.value = "-";
  1356. cmb_indeptlist.value = "-";
  1357. fChngSrchCond("/root/main/trgtmanlist/in/dept","/root/main/trgtmanlist/in/drlist", "staff");
  1358. cmb_indrlist.value = "-";
  1359. }
  1360. }
  1361. /**
  1362. * @desc : 폼 표현 셋팅
  1363. *
  1364. * @param :
  1365. * @return :
  1366. * @author : HIT EMR Team
  1367. * @---------------------------------------------------
  1368. */
  1369. function fSetFormDisplay(){
  1370. var node = instance1.selectNodes("/root/temp/para/formcd");
  1371. if(node.length < 1){
  1372. return false;
  1373. }
  1374. model.setValue("/root/main/selform", model.getValue("/root/temp/para/formcd"));
  1375. trv_ocrlist.expandDepth = "4";
  1376. model.refresh();
  1377. trv_ocrlist.vscroll.attribute("pos") = ( parseInt(trv_ocrlist.attribute("itemheight")) + 1 ) * trv_ocrlist.selectedIndex;
  1378. fSearchOcr();
  1379. }
  1380. /**
  1381. * @desc : 부서코드 셋팅
  1382. *
  1383. * @param :
  1384. * @return :
  1385. * @author : HIT EMR Team
  1386. * @---------------------------------------------------
  1387. */
  1388. function fGetRgstDeptCD(){
  1389. model.makeValue("/root/send/req/formprogflag", "OCR,OCR(CODE)");
  1390. submit("TRMRF02308");
  1391. model.removeNodeset("/root/send/req");
  1392. }
  1393. function fPrntPopup(){
  1394. if(isDataCell() && event.button==3){
  1395. var state = grd_ocrprntlist.valueMatrix(grd_ocrprntlist.mouserow, grd_ocrprntlist.colRef("statcd"));
  1396. setPopupMenu("grd_ocrprntlist", false, "/root/init/mouseright", "label", "value");
  1397. }
  1398. else{
  1399. initPopupMenu();
  1400. }
  1401. }
  1402. function fOcrReprnt(){
  1403. var row = grd_ocrprntlist.row;
  1404. var statcd = model.getValue("/root/main/ocrprntlist/ocrprnthist/list["+row+"]/statcd");
  1405. var eocryn = model.getValue("/root/main/ocrprntlist/ocrprnthist/list["+row+"]/eocryn");
  1406. if ( eocryn == "Y" ) {
  1407. messageBox("전자동의서는 재출력 되지 않습니다","I999");
  1408. return;
  1409. }
  1410. if ( statcd != "CP" && statcd != "D" ) {
  1411. messageBox("재출력되지 않는 상태입니다","I999");
  1412. return;
  1413. }
  1414. else {
  1415. messageBox("준비중입니다","I999");
  1416. }
  1417. }
  1418. function fShowScan() {
  1419. var row = grd_ocrprntlist.row;
  1420. var statcd = model.getValue("/root/main/ocrprntlist/ocrprnthist/list["+row+"]/statcd");
  1421. var scanyn = model.getValue("/root/main/ocrprntlist/ocrprnthist/list["+row+"]/scanyn");
  1422. if(scanyn == "N"){
  1423. messageBox("반납 및 스캔작업이 완료되지 ", "E007");
  1424. return;
  1425. }
  1426. if(scanyn == "CP" || scanyn == "D"){
  1427. messageBox("삭제된 동의서가 선택되었습니다.", "I", "");
  1428. return;
  1429. }
  1430. model.resetInstanceNode("/root/send/iemr");
  1431. model.makeValue("/root/send/iemr/pid", model.getValue("/root/main/ocrprntlist/ocrprnthist/list["+row+"]/pid"));
  1432. model.makeValue("/root/send/iemr/docucd", model.getValue("/root/main/ocrprntlist/ocrprnthist/list["+row+"]/formcd"));
  1433. model.makeValue("/root/send/iemr/ocrcode", model.getValue("/root/main/ocrprntlist/ocrprnthist/list["+row+"]/ocrtag"));
  1434. if((window.children.item("imgemrviewer") == null) && (model.getValue("/root/send/iemr/pid") != "") &&
  1435. (model.getValue("/root/send/iemr/docucd") != "") && (model.getValue("/root/send/iemr/ocrcode") != ""))
  1436. {
  1437. window.load("../../../emr/imgemrweb/xrw/SSMRC03130.xrw", "modeless", "imgemrviewer", "", "/root/send/iemr", "/root/hidden/temp");
  1438. window.children.item("imgemrviewer").document.title = "Image EMR Viewer";
  1439. }
  1440. }
  1441. /**
  1442. * @desc : 받을 리스트
  1443. *
  1444. * @param :
  1445. * @return :
  1446. * @author : 이윤주
  1447. * @---------------------------------------------------
  1448. */
  1449. function fSrchNeeded(){
  1450. var pid = model.getValue("/root/main/ordinfo/pid");
  1451. var cretno = model.getValue("/root/main/ordinfo/cretno");
  1452. var orddd = model.getValue("/root/main/ordinfo/orddd");
  1453. model.removeNodeset("/root/send/reqdata");
  1454. model.makeValue("/root/send/reqdata/pid", pid);
  1455. model.makeValue("/root/send/reqdata/cretno", cretno);
  1456. model.makeValue("/root/send/reqdata/orddd", orddd);
  1457. submit("TRMRF02317");
  1458. }
  1459. /**
  1460. * @desc : 전자동의서 오픈
  1461. *
  1462. * @param :
  1463. * @return :
  1464. * @author : 이윤주
  1465. * @---------------------------------------------------
  1466. */
  1467. function fOpenElecOCR (pid,cretno,orddd,ordtype,formcd,flag,tmflag,pensize,pencolor1,pencolor2,pencolor3,penstyle ) {
  1468. if (pid == "") {
  1469. messageBox("환자정보가 없습니다","I999");
  1470. return;
  1471. }
  1472. if (formcd == "") {
  1473. messageBox("서식정보가 없습니다","I999");
  1474. return;
  1475. }
  1476. setParameter("SSMRC03160_param_patid",pid);
  1477. setParameter("SSMRC03160_param_cretno",cretno);
  1478. setParameter("SSMRC03160_param_indate",orddd);
  1479. setParameter("SSMRC03160_param_class",ordtype);
  1480. setParameter("SSMRC03160_param_docucd",formcd);
  1481. setParameter("SSMRC03160_param_flag",flag);
  1482. setParameter("SSMRC03160_param_pensize",pensize);
  1483. setParameter("SSMRC03160_param_pencolor1",pencolor1);
  1484. setParameter("SSMRC03160_param_pencolor2",pencolor2);
  1485. setParameter("SSMRC03160_param_pencolor3",pencolor3);
  1486. setParameter("SSMRC03160_param_penstyle",penstyle);
  1487. // setParameter("SSMRC03160_param_patid","3241518");
  1488. // setParameter("SSMRC03160_param_cretno","1");
  1489. // setParameter("SSMRC03160_param_indate","20141212");
  1490. // setParameter("SSMRC03160_param_class","E");
  1491. // setParameter("SSMRC03160_param_docucd","1100010798");
  1492. // setParameter("SSMRC03160_param_flag","G");
  1493. // setParameter("SSMRC03160_param_pensize",2);
  1494. // setParameter("SSMRC03160_param_pencolor1",0);
  1495. // setParameter("SSMRC03160_param_pencolor2",0);
  1496. // setParameter("SSMRC03160_param_pencolor3",0);
  1497. // setParameter("SSMRC03160_param_penstyle",0);
  1498. // setParameter("SSMRC03160_param_ocrtag","2015051089551");
  1499. modal ("SSMRC03160");
  1500. }
  1501. function fSetPrntCancel() {
  1502. var row = grd_neededlist.row;
  1503. var currDT = getCurrentDate()+getCurrentTime();
  1504. var pid = model.getValue("/root/main/neededlist["+row+"]/pid");
  1505. var cretno = model.getValue("/root/main/neededlist["+row+"]/cretno");
  1506. var orddd = model.getValue("/root/main/neededlist["+row+"]/orddd");
  1507. var orddeptcd = model.getValue("/root/main/neededlist["+row+"]/orddeptcd");
  1508. var orddrid = model.getValue("/root/main/neededlist["+row+"]/orddrid");
  1509. var ocrtag = model.getValue("/root/main/neededlist["+row+"]/ocrtag");
  1510. model.makeValue("/root/send/reqdata/pid", pid);
  1511. model.makeValue("/root/send/reqdata/cretno", cretno);
  1512. model.makeValue("/root/send/reqdata/orddd", orddd);
  1513. model.makeValue("/root/send/reqdata/orddeptcd", orddeptcd);
  1514. model.makeValue("/root/send/reqdata/orddrid", orddrid);
  1515. model.makeValue("/root/send/reqdata/ocrtag", ocrtag);
  1516. model.makeValue("/root/send/reqdata/prntdeptcd", "");
  1517. model.makeValue("/root/send/reqdata/prntdeptnm", "");
  1518. model.makeValue("/root/send/reqdata/prntusernm", "");
  1519. model.makeValue("/root/send/reqdata/statcd", "CP");
  1520. model.makeValue("/root/send/reqdata/rtncnfm", "N");
  1521. model.makeValue("/root/send/reqdata/lstupdtdt", currDT);
  1522. model.makeValue("/root/send/reqdata/lstupdtdeptcd", getUserInfo("dutplcecd"));
  1523. model.makeValue("/root/send/reqdata/lstupdtuserid", getUserInfo("userid"));
  1524. model.makeValue("/root/send/reqdata/lstupdtdeptnm", getUserInfo("dutplcenm"));
  1525. model.makeValue("/root/send/reqdata/lstupdtusernm", getUserInfo("usernm"));
  1526. model.makeValue("/root/send/reqdata/eocryn","N");
  1527. if(!submit("TXMRF02303")){
  1528. messageBox("삭제 실패", "I999");
  1529. return false;
  1530. }
  1531. return true;
  1532. }
  1533. function fOpenPreA() {
  1534. var sa = model.getValue("/root/main/ordinfo/sa");
  1535. var pid = model.getValue("/root/main/ordinfo/pid");
  1536. var orddd = model.getValue("/root/main/ordinfo/orddd");
  1537. var cretno = model.getValue("/root/main/ordinfo/cretno");
  1538. var ioflag = model.getValue("/root/main/ordinfo/ordtype");
  1539. var orddeptcd = model.getValue("/root/main/ordinfo/orddeptcd");
  1540. var orddrid = model.getValue("/root/main/ordinfo/drid");
  1541. var patnm = model.getValue("/root/main/ordinfo/patnm");
  1542. var age = sa.substr(1,3);
  1543. var sex = sa.substr(0,1);
  1544. var suppdeptcd = "";
  1545. var formdeptcd = "";
  1546. setParameter("SPMMR05400_parm_pinfo", pid + "▦" + orddd + "▦" + cretno + "▦" + ioflag + "▦" + orddeptcd + "▦" + orddrid +"▦"+ patnm + "▦" + age + "▦" + sex + "▦" + suppdeptcd + "▦" + formdeptcd);
  1547. var formcd = model.getValue("/root/init/preass/hardcd/hardcd"); //서식코드
  1548. setParameter("SPMMR05400_parm_formcd", formcd ); // 진정전 평가서
  1549. setParameter("SPMMR05400_tabflag", "formlist");
  1550. setParameter("SPMMR05400_parm_formrecdd", getCurrentDate());
  1551. open("SPMMR05400", "", "", "" ,"SPMMR05400", "", "");
  1552. }
  1553. function fRePrntOCR(){
  1554. var formtypecls = "";
  1555. var ocrtagprntyn = "";
  1556. var iRow = grd_ocrprntlist.row;
  1557. ivw_ocrprnt.attribute("src") = "../../../emr/formmngtweb/xrw/SSMRF03800_OCR뷰어.xrw";
  1558. var formcd = model.getValue("/root/main/ocrprntlist/ocrprnthist/list["+ iRow + "]/formcd");
  1559. var pid = model.getValue("/root/main/ocrprntlist/ocrprnthist/list["+ iRow + "]/pid");
  1560. var orddd = model.getValue("/root/main/ocrprntlist/ocrprnthist/list["+ iRow + "]/orddd");
  1561. var cretno = model.getValue("/root/main/ocrprntlist/ocrprnthist/list["+ iRow + "]/cretno");
  1562. var ordtype = model.getValue("/root/main/ocrprntlist/ocrprnthist/list["+ iRow + "]/ioflag");
  1563. var ocrtag = model.getValue("/root/main/ocrprntlist/ocrprnthist/list["+ iRow + "]/ocrtag");
  1564. var statcd = model.getValue("/root/main/ocrprntlist/ocrprnthist/list["+ iRow + "]/statcd");
  1565. // 변경 요청번호 1851에 따른 수정
  1566. // 2009-07-24 nj
  1567. if(statcd == "D" || statcd == "CP" || statcd == "C" ){
  1568. messageBox("재출력 할 수 없는 상태입니다", "I");
  1569. return;
  1570. }
  1571. model.removeNodeset("/root/send/reqdata");
  1572. model.makeValue("/root/send/reqdata/ocrtag", ocrtag);
  1573. /* var returnVal = fGetHardCDList("Y", 199, 3);dnpq
  1574. //유전자검사 동의서 재출력(2011.12.08 lyj)
  1575. if ( formcd == returnVal ) */
  1576. if( fContainsHardCD("199", formcd))
  1577. {
  1578. ivw_ocrprnt.window.javascript.fGenePrint(ocrtag,ordtype,formcd);
  1579. return;
  1580. }
  1581. if(submit("TRMRF02605")){
  1582. formtypecls = model.getValue("/root/main/ocrforminfo/formtypecls");
  1583. ocrtagprntyn = model.getValue("/root/main/ocrforminfo/ocrtagprntyn");
  1584. ivw_ocrprnt.window.javascript.fGetOCRInfo(formcd, pid, orddd, cretno, ordtype, formtypecls, ocrtagprntyn, ocrtag);
  1585. ivw_ocrprnt.window.javascript.fPrint("A");
  1586. }
  1587. }