MMR05000.js 76 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240
  1. var doctyn = "N";
  2. var deptcd = "";
  3. var srchmode = "";
  4. // 상단정보연계를 위한 전역변수 선언 2009.12.12 LYJ
  5. var grdcnstrow = "";
  6. var consutioflag ="";
  7. var consutpid ="";
  8. var consutcretno ="";
  9. var consutorddd ="";
  10. var consutindd ="";
  11. var clickChk = "";
  12. var consulyn = "";
  13. //2013/01/23 Start
  14. var pat_medispclid=""; // 입원환자의 경우 주치의
  15. var pat_atdoctid=""; // 입원환자의 경우 담당의
  16. //2013/01/23 End
  17. //2013/02/12 Start
  18. var screenid="";
  19. //2013/02/12 End
  20. /**
  21. * @desc : 컨설트리스트 조회
  22. * @
  23. * @param :
  24. * @return :
  25. * @authur : 박종훈
  26. * @---------------------------------------------------
  27. */
  28. function fGetCnstlist(condflag)
  29. {
  30. model.setValue("/root/tmp/condflag", condflag );
  31. srchmode = condflag;
  32. model.removeNodeset("/root/main/cnstlist");
  33. var dpcd = getScreenMenuParameter(); //: 메뉴별 Parameter정보를 반환한다.
  34. var srchnm ="";
  35. if (condflag == "pidall")
  36. {
  37. srchnm = "환자별 모든건";
  38. }
  39. else if (condflag == "pidreq")
  40. {
  41. srchnm = "환자별 보낸건";
  42. }
  43. else if (condflag == "pidrecv")
  44. {
  45. srchnm = "환자별 받은건";
  46. }
  47. else if (condflag == "userreq")
  48. {
  49. if(dpcd == "doctor")
  50. {
  51. srchnm = "의사별 보낸건";
  52. }
  53. else
  54. {
  55. srchnm = "개인별 보낸건";
  56. }
  57. }
  58. else if (condflag == "userrecv")
  59. {
  60. if(dpcd == "doctor")
  61. {
  62. srchnm = "의사별 받은건";
  63. }
  64. else
  65. {
  66. srchnm = "개인별 받은건";
  67. }
  68. }
  69. else if (condflag == "deptreq")
  70. {
  71. srchnm = "과별 보낸건";
  72. }
  73. else if (condflag == "deptrecv")
  74. {
  75. srchnm = "과별 받은건";
  76. }
  77. else if (condflag == "piduserrecv")
  78. {
  79. srchnm = "환자별 의뢰 받은건";
  80. }
  81. else if (condflag == "piduserreq")
  82. {
  83. srchnm = "환자별 의뢰 보낸건";
  84. }
  85. else if (condflag == "pidnurcreq")
  86. {
  87. srchnm = "환자별 의뢰 내역(간호)";
  88. }
  89. else if (condflag == "piddeptrecv")
  90. {
  91. srchnm = "환자별 의뢰 받은건(부서)";
  92. }
  93. else if (condflag == "piddeptreq")
  94. {
  95. srchnm = "환자별 의뢰 보낸건(부서)";
  96. }
  97. model.makeValue("/root/init/srchnm", srchnm);
  98. fSetSendreq();
  99. model.makeValue("/root/send/condflag", condflag);
  100. model.makeValue("/root/send/prestdd", getCurrentDate());
  101. model.makeValue("/root/send/userid", getUserId());
  102. model.makeValue("/root/send/dutplcecd", getUserInfo("dutplcecd")); //20121012 이윤주
  103. if(submit("TRMMR05002"))
  104. {
  105. grd_cnstlist.allstyle("data", "background-color") = "#ffffff";
  106. grd_cnstlist.refresh();
  107. fCountReplList();
  108. clickChk = "C";
  109. }
  110. if(submit("TRMMR05001")) //통계조회
  111. {
  112. fCnstSumList();
  113. }
  114. model.refresh();
  115. }
  116. /**
  117. * @desc : 조회조건 설정
  118. * @
  119. * @param :
  120. * @return :
  121. * @authur : 박종훈
  122. * @---------------------------------------------------
  123. */
  124. function fSetSendreq()
  125. {
  126. var statflag = model.getValue("/root/presend/statflag");
  127. var inflag = model.getValue("/root/presend/inflag");
  128. var formcd = model.getValue("/root/send/formcd");
  129. statflag = statflag.split("|");
  130. if(statflag == "" || statflag.length > 1)
  131. {
  132. model.makeValue("/root/send/statflag", "all");
  133. }else{
  134. model.makeValue("/root/send/statflag", statflag);
  135. }
  136. if(inflag == "")
  137. {
  138. model.makeValue("/root/send/inflag", "in");
  139. }
  140. else
  141. {
  142. model.makeValue("/root/send/inflag", inflag);
  143. }
  144. if(formcd == "" || formcd == null)
  145. {
  146. model.makeValue("/root/send/formcd", "-");
  147. }
  148. }
  149. /**
  150. * @desc : 의사여부조회
  151. * @
  152. * @param :
  153. * @return :
  154. * @authur : 박종훈
  155. * @---------------------------------------------------
  156. */
  157. function fIsDoct()
  158. {
  159. // jobkindcd 향후 변경예정
  160. var sJobkind = getUserInfo("jobkindcd").substring(0, 2);
  161. if(sJobkind == "03")
  162. {
  163. return "Y";
  164. }
  165. else
  166. {
  167. return "N";
  168. }
  169. }
  170. /**
  171. * @desc : 화면초기화
  172. * @
  173. * @param :
  174. * @return :
  175. * @authur : 박종훈
  176. * @---------------------------------------------------
  177. */
  178. function fInitalize()
  179. {
  180. grd_cnstlist.rowHeight(0) = 32;
  181. ivw_loader.src = "../../../emr/medirecweb/xrw/SSMMR01100_서식로더.xrw";
  182. ivw_loader.window.javascript.fInitPage(false, true, parseInt(ivw_loader.attribute("height")));
  183. ivw_loader.window.javascript.afterSaveExeFuncNm = "fSaveAfter";
  184. reqGetDeptList("/root/init/reqdata", "/root/init/deptlist", "", "012");
  185. //model.removenode("/root/init/cnstreqmsrght/mouserght");
  186. // model.makeNode("/root/init/cnstreqmsrght/mouserght");
  187. if ((getUserInfo("jobkindcd") == "0330") || (getUserInfo("jobkindcd") == "0332") || (getUserInfo("jobkindcd") == "0510")) {
  188. /* 2013/01/28 주석처리
  189. model.makeValue("/root/init/cnstreqmsrght/mouserght[2]/label","상단연계");
  190. model.makeValue("/root/init/cnstreqmsrght/mouserght[2]/func","fSelPatInfo");
  191. model.makeValue("/root/init/cnstrecvmsrght/mouserght[2]/label","상단연계");
  192. model.makeValue("/root/init/cnstrecvmsrght/mouserght[2]/func","fSelPatInfo");
  193. model.makeValue("/root/init/cnstrecvmsrghtpat/mouserght[2]/label","상단연계");
  194. model.makeValue("/root/init/cnstrecvmsrghtpat/mouserght[2]/func","fSelPatInfo");
  195. */
  196. }
  197. model.setValue("/root/init/reqmedireclist/diffdt", 7);
  198. if (isPopup())
  199. deptcd = opener.window.javascript.getParameter("SMMMR05000_param_userdept");
  200. if (deptcd == "")
  201. {
  202. deptcd = getScreenMenuParameter(); //: 메뉴별 Parameter정보를 반환한다.
  203. }
  204. if (deptcd == "")
  205. {
  206. deptcd = getUserInfo("dutplcecd");
  207. }
  208. if (isDevMode() && deptcd == "")
  209. {
  210. deptcd = "doctor";
  211. }
  212. if (deptcd == "" || deptcd == null)
  213. {
  214. messageBox("부서정보가 설정되지 ", "E007");
  215. grp_base.disabled = true;
  216. return;
  217. }
  218. else
  219. {
  220. if (deptcd == "doctor")
  221. {
  222. doctyn = "Y";
  223. deptcd = getUserInfo("dutplcecd");
  224. button2.text = "의사별 보낸건";
  225. button4.text = "의사별 받은건";
  226. }
  227. }
  228. var param = "";
  229. var homecarerereqyn = "";
  230. var hinptdt = "";
  231. var hrecdd = "";
  232. if (isPopup())
  233. {
  234. param = opener.window.javascript.getParameter("SMMMR05000_param_pinfo"); //pid▦orddd▦cretno▦ioflag▦orddeptcd▦orddrid▦
  235. homecarerereqyn = opener.window.javascript.getParameter("SMMMR05000_param_homecarerereqyn");
  236. hinptdt = opener.window.javascript.getParameter("SMMMR05000_hcare_inptdt");
  237. hrecdd = opener.window.javascript.getParameter("SMMMR05000_hcare_recdd");
  238. //2013/02/12 Start 어느화면에서 오픈되었는지 체크한다.
  239. screenid = opener.window.javascript.getParameter("SMMMR05000_screenid");
  240. //2012/02/12 End
  241. opener.window.javascript.clearParameter("SMMMR05000_param_pinfo");
  242. opener.window.javascript.clearParameter("SMMMR05000_param_homecarerereqyn");
  243. opener.window.javascript.clearParameter("SMMMR05000_hcare_inptdt");
  244. opener.window.javascript.clearParameter("SMMMR05000_hcare_recdd");
  245. ivw_loader.window.javascript.setParameter("SMMMR05000_param_homecarerereqyn", homecarerereqyn);
  246. ivw_loader.window.javascript.setParameter("SMMMR05000_hcare_inptdt", hinptdt);
  247. ivw_loader.window.javascript.setParameter("SMMMR05000_hcare_recdd", hrecdd);
  248. }
  249. var pid = "";
  250. var orddd = "";
  251. var cretno = "";
  252. var ioflag = "I";
  253. var orddeptcd = "";
  254. var orddrid = "";
  255. //2013/02/26 Start 퇴원예고에서는 무조건 상단정보의 정보를 보도록
  256. if (param != "" && screenid!="SPMMO00400")
  257. //if (param != "")
  258. //2013/02/26 End
  259. {
  260. param = param.split("▦");
  261. pid = param[0];
  262. orddd = param[1];
  263. cretno = param[2];
  264. ioflag = param[3];
  265. orddeptcd = param[4];
  266. orddrid = param[5];
  267. model.makeValue ("/root/main/result/paminfo/list/pid", pid);
  268. model.makeValue ("/root/main/result/paminfo/list/orddd", orddd);
  269. model.makeValue ("/root/main/result/paminfo/list/cretno", cretno);
  270. model.makeValue ("/root/main/result/paminfo/list/ioflag", ioflag);
  271. model.makeValue ("/root/main/result/paminfo/list/orddeptcd", orddeptcd);
  272. model.makeValue ("/root/main/result/paminfo/list/orddrid", orddrid);
  273. model.refresh();
  274. }
  275. else
  276. {
  277. var pamInfoCvs = getGlobalVariable("paminfo"); //상단정보가 있을 경우는 검색
  278. if(pamInfoCvs != null && pamInfoCvs != "")
  279. { //cvs가 null이 아닌 경우에만 처리함.
  280. model.removeNodeSet ("/root/main/result/paminfo/list");
  281. setCSVToNode ("/root/main/result/paminfo", pamInfoCvs);
  282. pid = model.getValue ("/root/main/result/paminfo/list/pid");
  283. cretno = model.getValue ("/root/main/result/paminfo/list/cretno");
  284. ioflag = model.getValue ("/root/main/result/paminfo/list/ioflag");
  285. orddeptcd = model.getValue ("/root/main/result/paminfo/list/orddeptcd");
  286. orddrid = "";
  287. if (ioflag == "O" || ioflag == "S")
  288. {
  289. orddd = model.getValue ("/root/main/result/paminfo/list/orddd");
  290. orddrid = model.getValue ("/root/main/result/paminfo/list/orddrid");
  291. } else {
  292. orddd = model.getValue ("/root/main/result/paminfo/list/indd");
  293. orddrid = model.getValue ("/root/main/result/paminfo/list/medispclid");
  294. //2013/01/23 Start
  295. pat_medispclid= model.getValue ("/root/main/result/paminfo/list/medispclid");
  296. pat_atdoctid= model.getValue ("/root/main/result/paminfo/list/atdoctid");
  297. //2013/01/23 End
  298. }
  299. }
  300. }
  301. datagrid1.colStyle(0, "data", "border-right-style") = "none";
  302. datagrid1.colStyle(1, "data", "border-right-style") = "none";
  303. datagrid1.colStyle(3, "data", "border-right-style") = "none";
  304. datagrid1.colStyle(4, "data", "border-right-style") = "none";
  305. datagrid1.colStyle(6, "data", "border-right-style") = "none";
  306. datagrid1.colStyle(7, "data", "border-right-style") = "none";
  307. datagrid1.colStyle(9, "data", "border-right-style") = "none";
  308. datagrid1.colStyle(10, "data", "border-right-style") = "none";
  309. datagrid1.refresh();
  310. fAddDateReq("today");
  311. if (ioflag == "I" || ioflag == "E" || ioflag == "D")
  312. {
  313. ioflag = "I";
  314. }
  315. else if (ioflag == "O" || ioflag == "S")
  316. {
  317. ioflag = "O";
  318. }
  319. else
  320. {
  321. ioflag = "I";
  322. }
  323. model.makeValue("/root/send/ioflag", ioflag);
  324. //20111122 검색조건 디폴트로 전체로 지정
  325. model.setValue("/root/send/srchflag", 0);
  326. model.makeValue("/root/send/userdeptcd", getUserInfo("dutplcecd"));
  327. //20111122
  328. fIoFlagChange();
  329. /* 2012/02/09 전체 다 보이게 수정
  330. //20111123 영상의학과 : 2160000000 일때만 보이게 함
  331. if(getUserInfo("dutplcecd")=="2160000000"){
  332. caption14.visible="true";
  333. radio1.visible="true";
  334. grd_cnstlist.colhidden(2) = false;
  335. }else{
  336. caption14.visible="false";
  337. radio1.visible="false";
  338. grd_cnstlist.colhidden(2) = true;
  339. }
  340. //20111123
  341. 2012/02/09 */
  342. if (pid != "" && orddd != "" && cretno != "")
  343. {
  344. ipt_pid.value = pid;
  345. fPidKeyPress(); //등록번호로 환자 정보조회
  346. ivw_loader.window.javascript.fSetPamInfo(pid, orddd, cretno, ioflag, orddeptcd, orddrid);
  347. btn_excnst.attribute("visibility") = "visible";
  348. btn_cnst.attribute("visibility") = "visible";
  349. btn_cotrmt.visible = "true";
  350. model.refresh();
  351. }
  352. else if (pid != "" && orddd == "" && cretno == "")
  353. {
  354. ipt_pid.value = pid;
  355. fPidKeyPress(); //등록번호로 환자 정보조회
  356. fGetCnstlist("pidall");
  357. ivw_loader.disabled = true;
  358. }
  359. else
  360. {
  361. if (doctyn == "Y") //의사(진료의뢰)일 경우 의사별 받은건
  362. {
  363. var sJobkind = getUserInfo("jobkindcd").substring(0, 2);
  364. if(sJobkind == "03")
  365. {
  366. fGetCnstlist("userrecv");
  367. }
  368. else //의사가 아닐경우 환자별 의뢰건만 조회
  369. {
  370. fGetCnstlist("pidnurcreq");
  371. }
  372. }
  373. else
  374. {
  375. fGetCnstlist("deptrecv"); // 타과의뢰일 경우 부서별 받은건
  376. }
  377. ivw_loader.grup_btn.disabled = true;
  378. }
  379. //로컬테스트를 위한 버튼처리
  380. if (fLocalYn())
  381. {
  382. btn_excnst.attribute("visibility") = "visible";
  383. btn_cnst.attribute("visibility") = "visible";
  384. btn_cotrmt.attribute("visibility") = "visible";
  385. }
  386. //원목팀 요청(과별 보낸건, 받은건만)
  387. if(deptcd == "4050400000")
  388. {
  389. button7.attribute("visibility") = "hidden";
  390. button8.attribute("visibility") = "hidden";
  391. button2.attribute("visibility") = "hidden";
  392. button4.attribute("visibility") = "hidden";
  393. button3.attribute("visibility") = "hidden";
  394. btn_cnst.attribute("visibility") = "hidden";
  395. }
  396. model.makeValue("/root/send/userdeptcd", deptcd);
  397. model.makeValue("/root/send/userid", getUserId());
  398. if (submit("TRMMR04901")) //컨설트 부서조회
  399. {
  400. model.makeValue("/root/send/userdeptcd", getUserInfo("dutplcecd"));
  401. }
  402. //20110728
  403. //submit("TRMMR04904") //병동조회
  404. //mmbfGetDeptCodeComboList("/root/send/reqdata", "/root/init/orddept2", "W");
  405. mmbfGetDeptCodeComboList("/root/send/reqdata", "/root/main/cnstwardlist/cnstward", "W");
  406. addComboInstance("/root/main/cnstwardlist/cnstward", "deptcd^depthngnm", "-^전체", "dept");
  407. model.setValue("/root/send/wardcd", "-");
  408. //20110728
  409. model.makeValue("/root/send/cnstflag", "3");
  410. if(submit("TRMMR04902")) //컨설트 종류 조회
  411. {
  412. addComboInstance("/root/main/cnstformlist", "formcd^formnm", "0000000677^진료의뢰", "cnstform");
  413. addComboInstance("/root/main/cnstformlist", "formcd^formnm", "-^전체", "cnstform"); //진료과 전체항목 추가
  414. }
  415. ivw_loader.window.javascript.setParameter("userdeptcd", deptcd);
  416. //2013/02/14 Start 퇴원예고로부터 넘어온 경우에는 의뢰일자 시작일자를 선택
  417. if(screenid=="SPMMO00400"){
  418. model.makeValue("/root/send/reqfromdd", orddd);
  419. fGetCnstlist("pidall");
  420. }
  421. //2013/02/14 End
  422. //20140122
  423. fGetUserEnvOcsOrdAnsw("", "/root/hidden/procpconfiag", "053");
  424. var nonstopyn = opener.window.javascript.getParameter("SMMMR05000_nonstopyn");
  425. var nonstopcnstflag = opener.window.javascript.getParameter("SMMMR05000_nonstopcnstflag");
  426. if ( nonstopyn == "Y") {
  427. fNewCnst(nonstopcnstflag);
  428. }
  429. }
  430. /**
  431. * @desc : 환자번호 정보조회
  432. * @id :
  433. * @event : onkeypress
  434. * @return : void
  435. * @authur : 박종훈
  436. */
  437. function fPidKeyPress(autoYn, sroomcd)
  438. {
  439. model.makeValue("/root/source/srchcond", "1");
  440. model.makeValue("/root/source/pid", ipt_pid.currentText);
  441. //inputEnterKey("btn_search", "DOMActivate");
  442. //환자등록번호 체크
  443. if(ipt_pid.currentText.length >= 1 )
  444. {
  445. model.resetInstanceNode("/root/main/result/patinfo");
  446. model.makeNode("/root/main/result/patinfo");
  447. if(submit("TRPMC02500"))
  448. {
  449. //fSearch는 인적사항 화면을 임포트 해간 화면에서 구현해 주어야 하는 함수이다.
  450. if( getNodesetCount("/root/main/result/patinfo/patinfolist") > 0 )
  451. {
  452. model.copyNode("/root/main/patinfo", "/root/main/result/patinfo");
  453. model.makeValue("/root/main/patinfo/patinfolist/agesex", model.getValue("/root/main/patinfo/patinfolist/sex") + "/" + model.getValue("/root/main/patinfo/patinfolist/age"));
  454. var ioflag = model.getValue("/root/main/result/paminfo/list/ioflag");
  455. if (ioflag == "O" || ioflag == "S")
  456. {
  457. //화면 상단에 환자정보 셋팅
  458. model.setValue("/root/init/patinfo", "등록번호 : " + model.getValue("/root/main/patinfo/patinfolist/pid") +
  459. ", 환자명 : " + model.getValue("/root/main/patinfo/patinfolist/hngnm") +
  460. ", 성별/나이 : " + model.getValue("/root/main/patinfo/patinfolist/agesex"));
  461. }
  462. else
  463. {
  464. if (autoYn != "N")
  465. {
  466. var sRoomcd = model.getValue("/root/main/result/paminfo/list/roomcd");
  467. }
  468. else
  469. {
  470. //var sRoomcd = model.getValue("/root/main/cnstlist[" + grd_cnstlist.row + "]/roomcd");
  471. var sRoomcd = sroomcd;
  472. }
  473. //화면 상단에 환자정보 셋팅
  474. model.setValue("/root/init/patinfo", "병실 : " + sRoomcd +
  475. ", 등록번호 : " + model.getValue("/root/main/patinfo/patinfolist/pid") +
  476. ", 환자명 : " + model.getValue("/root/main/patinfo/patinfolist/hngnm") +
  477. ", 성별/나이 : " + model.getValue("/root/main/patinfo/patinfolist/agesex"));
  478. }
  479. model.makeValue("/root/send/pid", model.getValue("/root/main/patinfo/patinfolist/pid"));
  480. model.makeValue("/root/main/popupendflag", "ok");
  481. if (autoYn != "N")
  482. {
  483. fGetFirstList();
  484. }
  485. model.refresh();
  486. var patid = model.getValue("/root/main/patinfo/patinfolist/pid");
  487. var ivwpid = ivw_loader.model.getValue("/root/main/paminfo/pid");
  488. if (patid != "" && ivwpid != "")
  489. {
  490. if (patid != ivwpid)
  491. {
  492. btn_cnst.disabled = true;
  493. btn_excnst.disabled = true;
  494. btn_cotrmt.disabled = true;
  495. }
  496. else
  497. {
  498. btn_cnst.disabled = false;
  499. btn_excnst.disabled = false;
  500. btn_cotrmt.disabled = false;
  501. }
  502. }
  503. }
  504. else
  505. {
  506. model.resetInstanceNode("/root/main/patinfo/patinfolist");
  507. messageBox("없는 환자 번호 입니다.", "E999", "");
  508. model.refresh();
  509. }
  510. }
  511. }
  512. else
  513. {
  514. messageBox("환자등록번호를 정확히", "C001");
  515. }
  516. }
  517. /**
  518. * @desc : 환자이름 정보조회
  519. * @id :
  520. * @event : onkeypress
  521. * @return : void
  522. * @authur : 박종훈
  523. */
  524. function fPnmKeyPress()
  525. {
  526. model.makeValue("/root/source/srchcond", "2");
  527. model.makeValue("/root/source/hngnm", ipt_hngnm.currentText);
  528. inputEnterKey("btn_search", "DOMActivate");
  529. }
  530. /**
  531. * @desc : 검색 날짜기간
  532. * @id :
  533. * @event : DOMActivate
  534. * @return : void
  535. * @authur : 박종훈
  536. */
  537. function fAddDateReq(diffFlag)
  538. {
  539. var frdd = model.getValue("/root/send/reqfromdd");
  540. var todd = model.getValue("/root/send/reqtodd");
  541. var srcdd = new Date();
  542. var destdd = new Date();
  543. var diffdt;
  544. if (diffFlag == "next")
  545. {
  546. srcdd = todd.toDate();
  547. srcdd = srcdd.getAddDate(1, "D");
  548. frdd = srcdd.getDateFormat();
  549. diffdt = parseInt(model.getValue("/root/init/reqmedireclist/diffdt")) * 1;
  550. destdd = srcdd.getAddDate(diffdt, "D");
  551. todd = destdd.getDateFormat();
  552. }
  553. else if (diffFlag == "back")
  554. {
  555. srcdd = frdd.toDate();
  556. srcdd = srcdd.getAddDate(-1, "D");
  557. todd = srcdd.getDateFormat();
  558. diffdt = parseInt(model.getValue("/root/init/reqmedireclist/diffdt")) * -1;
  559. destdd = srcdd.getAddDate(diffdt, "D");
  560. frdd = destdd.getDateFormat();
  561. }
  562. else if (diffFlag == "today")
  563. {
  564. todd = getCurrentDate();
  565. var today = new Date();
  566. var frday = new Date();
  567. var diffdt = parseInt(model.getValue("/root/init/reqmedireclist/diffdt")) * -1;
  568. frday = today.getAddDate(diffdt , "D");
  569. frdd = frday.getDateFormat();
  570. }
  571. else
  572. {
  573. var today = todd.toDate();
  574. var frday = new Date();
  575. var diffdt = parseInt(model.getValue("/root/init/reqmedireclist/diffdt")) * -1;
  576. frday = today.getAddDate(diffdt , "D");
  577. frdd = frday.getDateFormat();
  578. }
  579. model.setValue("/root/send/reqfromdd", frdd);
  580. model.setValue("/root/send/reqtodd", todd);
  581. ipt_formrecdtfr.refresh();
  582. ipt_formrecdtto.refresh();
  583. }
  584. /**
  585. * @desc : 의뢰서 선택을 위한 팝업 호출
  586. * @
  587. * @param :
  588. * @return :
  589. * @authur : 박종훈
  590. * @---------------------------------------------------
  591. */
  592. function fNewCnst_old(cnstflag)
  593. {
  594. if (doctyn == "Y")
  595. {
  596. srchmode = "piduserreq";
  597. }
  598. else
  599. {
  600. srchmode = "piddeptreq";
  601. }
  602. setParameter("MMR05000_cnstflag", cnstflag);
  603. modal("SPMMR03900");
  604. }
  605. /**
  606. * @desc : 의뢰서 작성
  607. * @
  608. * @param :
  609. * @return :
  610. * @authur : 박종훈
  611. * @---------------------------------------------------
  612. */
  613. function old_fNewCnst()
  614. {
  615. var PamPid = model.getValue("/root/main/result/paminfo/list/pid");
  616. var PatPid = model.getValue("/root/main/result/patinfo/patinfolist/pid");
  617. if (PamPid == PatPid || isDevMode())
  618. {
  619. ivw_loader.disabled = false;
  620. ivw_loader.window.javascript.fLoadNewXRW("SMMMR04900");
  621. }
  622. else
  623. {
  624. messageBox("상단정보의 환자와 일치하지 않아 진행", "E001");
  625. ivw_loader.disabled = true;
  626. return;
  627. }
  628. }
  629. /**
  630. * @desc : 의뢰서 오픈(진료일정 팝업에서 호출)
  631. * @
  632. * @param :
  633. * @return :
  634. * @authur : 박종훈
  635. * @---------------------------------------------------
  636. */
  637. function fOpenCnstForm_old(formcd, cnstdeptcd, cnstdeptnm, drid, drnm, hopedd, cnstflag, formnm, replflag)
  638. {
  639. ivw_loader.disabled = false;
  640. setParameter("userdeptcd", cnstdeptcd);
  641. ivw_loader.window.javascript.setParameter("SMMMR04900_newcnstform", "Y");
  642. ivw_loader.window.javascript.setParameter("SMMMR04900_formcd", formcd);
  643. if (replflag == "R") //의뢰부서는 환자진료과
  644. {
  645. var reqdpcd = ivw_loader.model.getValue("/root/main/paminfo/orddeptcd");
  646. model.setValue("/root/cond/orddeptcd", reqdpcd);
  647. fAftertemp();
  648. var reqdrid = ivw_loader.model.getValue("/root/main/paminfo/orddrid");
  649. model.setValue("/root/cond/orddrid", reqdrid);
  650. var reqdpnm = model.getValue("/root/init/deptlist/orddept[deptcd = '" + reqdpcd + "']/deptnm");
  651. var reqdrnm = model.getValue("/root/init/userlist/usercombo[userid = '" + reqdrid + "']/usernm");
  652. ivw_loader.window.javascript.setParameter("SMMMR04900_reqdpcd", reqdpcd);
  653. ivw_loader.window.javascript.setParameter("SMMMR04900_reqdpnm", reqdpnm);
  654. ivw_loader.window.javascript.setParameter("SMMMR04900_reqdrid", reqdrid);
  655. ivw_loader.window.javascript.setParameter("SMMMR04900_reqdrnm", reqdrnm);
  656. ivw_loader.window.javascript.setParameter("SMMMR04900_cnstdeptcd", cnstdeptcd);
  657. ivw_loader.window.javascript.setParameter("SMMMR04900_cnstdeptnm", cnstdeptnm);
  658. }
  659. else if (replflag == "D") //회신부서는 환자 진료과
  660. {
  661. var recvdpcd = ivw_loader.model.getValue("/root/main/paminfo/orddeptcd");
  662. model.setValue("/root/cond/orddeptcd", recvdpcd);
  663. fAftertemp();
  664. var recvdrid = ivw_loader.model.getValue("/root/main/paminfo/orddrid");
  665. model.setValue("/root/cond/orddrid", recvdrid);
  666. var recvdpnm = model.getValue("/root/init/deptlist/orddept[deptcd = '" + recvdpcd + "']/deptnm");
  667. var recvdrnm = model.getValue("/root/init/userlist/usercombo[userid = '" + recvdrid + "']/usernm");
  668. ivw_loader.window.javascript.setParameter("SMMMR04900_cnstdeptcd", recvdpcd);
  669. ivw_loader.window.javascript.setParameter("SMMMR04900_cnstdeptnm", recvdpnm);
  670. ivw_loader.window.javascript.setParameter("SMMMR04900_cnstuserid", recvdrid);
  671. ivw_loader.window.javascript.setParameter("SMMMR04900_cnstusernm", recvdrnm);
  672. }
  673. else
  674. {
  675. ivw_loader.window.javascript.setParameter("SMMMR04900_cnstdeptcd", cnstdeptcd);
  676. ivw_loader.window.javascript.setParameter("SMMMR04900_cnstdeptnm", cnstdeptnm);
  677. }
  678. //fAftertemp
  679. if (cnstflag == "1")
  680. {
  681. ivw_loader.window.javascript.setParameter("SMMMR04900_drid", drid);
  682. ivw_loader.window.javascript.setParameter("SMMMR04900_drnm", drnm);
  683. ivw_loader.window.javascript.setParameter("SMMMR04900_hopedd", hopedd);
  684. }
  685. else if (cnstflag == "3")
  686. {
  687. ivw_loader.window.javascript.setParameter("SMMMR04900_formnm", formnm);
  688. ivw_loader.window.javascript.setParameter("SMMMR04900_replflag", replflag);
  689. }
  690. ivw_loader.window.javascript.setParameter("SMMMR04900_cnstflag", cnstflag);
  691. ivw_loader.window.javascript.fLoadNewForm(formcd);
  692. }
  693. /**
  694. * @desc : 그리드 사이즈 조절
  695. * @
  696. * @param :
  697. * @return :
  698. * @authur : 박종훈
  699. * @---------------------------------------------------
  700. */
  701. function fCnstGrdSize(mode)
  702. {
  703. if (mode == "max")
  704. {
  705. ivw_loader.visible = false;
  706. grd_cnstlist.attribute("width") = (body.attribute("width") - 15);
  707. //model.refresh();
  708. } else {
  709. ivw_loader.visible = true;
  710. grd_cnstlist.attribute("width") = 589;
  711. }
  712. }
  713. /**
  714. * @desc : 통계내역 화면 디자인
  715. * @
  716. * @param :
  717. * @return :
  718. * @authur : 박종훈
  719. * @---------------------------------------------------
  720. */
  721. function fCnstSumList()
  722. {
  723. var dpsend = model.getValue("/root/main/cnstsum/deptreqrepl") + " / " + model.getValue("/root/main/cnstsum/deptreqall");
  724. var dprecv = model.getValue("/root/main/cnstsum/deptrecvrepl") + " / " + model.getValue("/root/main/cnstsum/deptrecvall");
  725. var usersend = model.getValue("/root/main/cnstsum/userreqrepl") + " / " + model.getValue("/root/main/cnstsum/userreqall");
  726. var userrecv = model.getValue("/root/main/cnstsum/userrecvrepl") + " / " + model.getValue("/root/main/cnstsum/userrecvall");
  727. if (dpsend == "")
  728. dpsend = "0 / 0";
  729. if (dprecv == "")
  730. dprecv = "0 / 0";
  731. if (usersend == "")
  732. usersend = "0 / 0";
  733. if (userrecv == "")
  734. userrecv = "0 / 0";
  735. model.makeValue("/root/main/cnsttotal/dpsend", dpsend);
  736. model.makeValue("/root/main/cnsttotal/dprecv", dprecv);
  737. model.makeValue("/root/main/cnsttotal/usersend", usersend);
  738. model.makeValue("/root/main/cnsttotal/userrecv", userrecv);
  739. model.refresh();
  740. }
  741. /**
  742. * @desc : 기록서식 오픈 여부 확인
  743. * @
  744. * @param :
  745. * @return :
  746. * @authur : 박종훈
  747. * @---------------------------------------------------
  748. */
  749. function fEndFormReady_MMR01100()
  750. {
  751. var instance = document.models(0).instances(0);
  752. var nodelistCnst = "";
  753. var cnstflag = model.getValue("/root/send/cnstflag");
  754. if (cnstflag == "3")
  755. {
  756. nodelistCnst = instance.selectNodes("/root/main/cnstlist[recvdeptcd='" + deptcd + "']");
  757. }
  758. else
  759. {
  760. nodelistCnst = instance.selectNodes("/root/main/cnstlist[recvuserid='" + getUserId() + "']");
  761. }
  762. var cnststat = "";
  763. var srcNode = "";
  764. var recseq = "";
  765. var pid = model.getValue ("/root/main/result/paminfo/list/pid");
  766. var orddd= model.getValue ("/root/main/result/paminfo/list/orddd");
  767. var cretno = model.getValue ("/root/main/result/paminfo/list/cretno");
  768. var iofg = model.getValue ("/root/main/result/paminfo/list/ioflag");
  769. var orddeptcd = model.getValue ("/root/main/result/paminfo/list/orddeptcd");
  770. var orddrid = model.getValue ("/root/main/result/paminfo/list/orddrid");
  771. var reqfromrecseq = "";
  772. // if (pid == null || pid == "")
  773. // return;
  774. if(nodelistCnst.length >= 1)
  775. {
  776. srcNode = nodelistCnst.item(0);
  777. cnststat = srcNode.selectSingleNode("cnststat").text;
  778. if(cnststat < 21 && cnststat > 11)
  779. {
  780. reqfromrecseq = srcNode.selectSingleNode("formrecseq").text;
  781. if (reqfromrecseq != "")
  782. {
  783. grd_cnstlist.rowstyle(1, "data", "background-color") = "#ffcc99";
  784. grd_cnstlist.refresh();
  785. ivw_loader.window.javascript.fLoadRecForm(reqfromrecseq);
  786. if (doctyn == "Y")
  787. {
  788. var sJobkind = getUserInfo("jobkindcd").substring(0, 2);
  789. if(sJobkind == "03")
  790. {
  791. if (pid != "")
  792. {
  793. srchmode = "piduserrecv";
  794. }
  795. else
  796. {
  797. srchmode = "userrecv";
  798. }
  799. }
  800. else //의사가 아닐경우 환자별 의뢰건만 조회
  801. {
  802. ivw_loader.grup_btn.disabled = true;
  803. }
  804. }
  805. else
  806. {
  807. if (pid != "")
  808. {
  809. srchmode = "piddeptrecv";
  810. }
  811. else
  812. {
  813. srchmode = "deptrecv";
  814. }
  815. }
  816. }
  817. }
  818. }
  819. }
  820. /**
  821. * @desc : 환자정보조회 팝업
  822. * @id :
  823. * @event : DOMActivate
  824. * @return : void
  825. * @authur : 박종훈
  826. */
  827. function fPopPtinfo()
  828. {
  829. modal("SPPMC02500", "1","150", "150", "SPPMC02500", "/root/source", "/root/send");
  830. var patid = model.getValue("/root/main/patinfo/patinfolist/pid");
  831. var ivwpid = ivw_loader.model.getValue("/root/main/paminfo/pid");
  832. if (patid != "" && ivwpid != "")
  833. {
  834. if (patid != ivwpid)
  835. {
  836. btn_cnst.disabled = true;
  837. btn_excnst.disabled = true;
  838. btn_cotrmt.disabled = true;
  839. }
  840. else
  841. {
  842. btn_cnst.disabled = false;
  843. btn_excnst.disabled = false;
  844. btn_cotrmt.disabled = false;
  845. }
  846. model.makeValue("/root/send/pid", patid);
  847. model.makeValue("/root/main/patinfo/patinfolist/agesex", model.getValue("/root/main/patinfo/patinfolist/sex") + "/" + model.getValue("/root/main/patinfo/patinfolist/age"));
  848. //화면 상단에 환자정보 셋팅
  849. model.setValue("/root/init/patinfo", "등록번호 : " + model.getValue("/root/main/patinfo/patinfolist/pid") +
  850. ", 환자명 : " + model.getValue("/root/main/patinfo/patinfolist/hngnm") +
  851. ", 성별/나이 : " + model.getValue("/root/main/patinfo/patinfolist/agesex"));
  852. model.refresh();
  853. fGetCnstlist("pidall");
  854. }
  855. model.resetInstanceNode("/root/source");
  856. }
  857. /**
  858. * @desc : 로컬체크
  859. * @id :
  860. * @event : DOMActivate
  861. * @return : void
  862. * @authur : 박종훈
  863. */
  864. function fLocalYn()
  865. {
  866. if (window.document.location == "C:/CMCProject/application/webapps/emr/medirecweb/xrw/" ||
  867. window.document.location == "D:/CMCProject/application/webapps/emr/medirecweb/xrw/" ||
  868. window.document.location.indexOf("dev999") > -1)
  869. {
  870. return true;
  871. }
  872. else
  873. {
  874. return false;
  875. }
  876. }
  877. /**
  878. * @desc : 처음 로드시 컨설트 내역 조회
  879. * @id :
  880. * @event : DOMActivate
  881. * @return : void
  882. * @authur : 박종훈
  883. */
  884. function fGetFirstList()
  885. {
  886. var instance = document.models(0).instances(0);
  887. var nodelistPatinfo = instance.selectNodes("/root/main/result/paminfo/list");
  888. if(nodelistPatinfo.length == 1)
  889. {
  890. var sJobkind = getUserInfo("jobkindcd").substring(0, 2);
  891. if(sJobkind == "03")
  892. {
  893. fGetCnstlist("piduserrecv");
  894. }
  895. else //의사가 아닐경우 환자별 의뢰건만 조회
  896. {
  897. fGetCnstlist("pidnurcreq");
  898. }
  899. }
  900. else
  901. {
  902. if (doctyn == "Y")
  903. {
  904. fGetCnstlist("userrecv");
  905. }
  906. else
  907. {
  908. fGetCnstlist("deptrecv");
  909. }
  910. }
  911. }
  912. /**
  913. * @desc : 저장 후 로직
  914. * @id :
  915. * @event : DOMActivate
  916. * @return : void
  917. * @authur : 박종훈
  918. */
  919. function fSaveAfter()
  920. {
  921. fGetCnstlist(srchmode);
  922. ivw_loader.window.javascript.setParameter("SMMMR04900_newcnstform", "N");
  923. }
  924. /**
  925. * @desc : 의뢰 컨설트 열기
  926. * @
  927. * @param :
  928. * @return :
  929. * @authur : 박종훈
  930. * @---------------------------------------------------
  931. */
  932. function fOpenRecCnstForm(formrecseq, cnstflag, calledflag)
  933. {
  934. ivw_loader.window.javascript.setParameter("userdeptcd", getUserInfo("dutplcecd"));
  935. ivw_loader.window.javascript.setParameter("SMMMR04900_cnstflag", cnstflag);
  936. ivw_loader.window.javascript.fLoadRecForm(formrecseq, calledflag);
  937. if (doctyn == "Y") //의사(진료의뢰)일 경우 의사별 받은건
  938. {
  939. var sJobkind = getUserInfo("jobkindcd").substring(0, 2);
  940. if(sJobkind == "03")
  941. {
  942. srchmode = "piduserrecv";
  943. ivw_loader.grup_btn.disabled = false;
  944. }
  945. else //의사가 아닐경우 환자별 의뢰건만 조회
  946. {
  947. ivw_loader.grup_btn.disabled = true;
  948. }
  949. }
  950. else
  951. {
  952. srchmode = "piddeptrecv";
  953. }
  954. }
  955. /**
  956. * @desc : 회신처리
  957. * @
  958. * @param :
  959. * @return :
  960. * @authur : 박종훈
  961. * @---------------------------------------------------
  962. */
  963. function fSetRepl()
  964. {
  965. var formrecseq = model.getValue("/root/main/cnstlist[" + grd_cnstlist.row + "]/formrecseq");
  966. var cnststat = parseInt(model.getValue("/root/main/cnstlist[" + grd_cnstlist.row + "]/cnststat"));
  967. var recvuserid = model.getValue("/root/main/cnstlist[" + grd_cnstlist.row + "]/recvuserid");
  968. if (recvuserid != getUserId())
  969. {
  970. messageBox("회신처리", "E002");
  971. return;
  972. }
  973. else if (cnststat > 12)
  974. {
  975. messageBox("의뢰이후 상태에서는 회신처리", "E001");
  976. return;
  977. }
  978. else
  979. {
  980. model.makeValue("/root/send/formrecseq", formrecseq);
  981. submit("TXMMR05001");
  982. }
  983. }
  984. /**
  985. * @desc : 컨설트 의뢰 취소
  986. * @
  987. * @param :
  988. * @return :
  989. * @authur : 박종훈
  990. * @---------------------------------------------------
  991. */
  992. function fSetCnstCancel()
  993. {
  994. var rtn = messageBox("의뢰를 취소 합니다.", "Q003");
  995. if (rtn != 6)
  996. return;
  997. var formrecseq = model.getValue("/root/main/cnstlist[" + grd_cnstlist.row + "]/formrecseq");
  998. var cnststat = parseInt(model.getValue("/root/main/cnstlist[" + grd_cnstlist.row + "]/cnststat"));
  999. var requserid = model.getValue("/root/main/cnstlist[" + grd_cnstlist.row + "]/requserid");
  1000. var recvuserid = model.getValue("/root/main/cnstlist[" + grd_cnstlist.row + "]/recvuserid");
  1001. var chosflag= model.getValue("/root/main/cnstlist[" + grd_cnstlist.row + "]/chosflag");
  1002. if (formrecseq != "")
  1003. {
  1004. model.makeValue("/root/send/formrecseq", formrecseq);
  1005. if(submit("TXMMR05002"))
  1006. {
  1007. var mess = model.getValue("/root/main/savedinfo/rsltmsg/msg");
  1008. if(mess == "1")
  1009. {
  1010. messageBox("취소 되었습니다.", "I", "");
  1011. fGetCnstlist(srchmode);
  1012. ivw_loader.src = "../../../emr/medirecweb/xrw/SSMMR01100_서식로더.xrw";
  1013. ivw_loader.window.javascript.fInitPage(false, true, parseInt(ivw_loader.attribute("height")));
  1014. }
  1015. else
  1016. {
  1017. messageBox(mess, "I", "");
  1018. }
  1019. }
  1020. }
  1021. else
  1022. {
  1023. return;
  1024. }
  1025. }
  1026. /**
  1027. * @desc : 컨설트 의뢰확정 취소
  1028. * @
  1029. * @param :
  1030. * @return :
  1031. * @authur : 박종훈
  1032. * @---------------------------------------------------
  1033. */
  1034. function fSetReqFixCancel()
  1035. {
  1036. var rtn = messageBox("의뢰 상태로 변경 됩니다.", "Q003");
  1037. if (rtn != 6)
  1038. return;
  1039. var formrecseq = model.getValue("/root/main/cnstlist[" + grd_cnstlist.row + "]/formrecseq");
  1040. var cnststat = parseInt(model.getValue("/root/main/cnstlist[" + grd_cnstlist.row + "]/cnststat"));
  1041. var requserid = model.getValue("/root/main/cnstlist[" + grd_cnstlist.row + "]/requserid");
  1042. var recvuserid = model.getValue("/root/main/cnstlist[" + grd_cnstlist.row + "]/recvuserid");
  1043. var chosflag= model.getValue("/root/main/cnstlist[" + grd_cnstlist.row + "]/chosflag");
  1044. var cnstflag= model.getValue("/root/main/cnstlist[" + grd_cnstlist.row + "]/cnstflag");
  1045. if (formrecseq != "")
  1046. {
  1047. model.makeValue("/root/send/formrecseq", formrecseq);
  1048. model.makeValue("/root/send/cnstflag", cnstflag);
  1049. if(submit("TXMMR05003"))
  1050. {
  1051. var mess = model.getValue("/root/main/rsltinfo/cvrtcnt/cnt");
  1052. if(mess == "1")
  1053. {
  1054. messageBox("변경 되었습니다.", "I", "");
  1055. fGetCnstlist(srchmode);
  1056. }
  1057. else
  1058. {
  1059. messageBox("변경에 실패 하였습니다.", "I", "");
  1060. }
  1061. }
  1062. }
  1063. else
  1064. {
  1065. return;
  1066. }
  1067. }
  1068. /**
  1069. * @desc : 내원구분에 따른 환경 셋팅
  1070. * @
  1071. * @param :
  1072. * @return :
  1073. * @authur : 박종훈
  1074. * @---------------------------------------------------
  1075. */
  1076. function fIoFlagChange()
  1077. {
  1078. var ioflag = model.getValue("/root/send/ioflag");
  1079. var refdata = "";
  1080. var sizedata = "";
  1081. if (ioflag == "I")
  1082. {
  1083. refdata = "seq^checkflag^formnm^gubunflag^cnststatnm^eryn^pid^pidnm^wardnm^roomcd^reqdeptnm^requsernm^recvdeptnm^recvusernm^reqdd^repldd^replusernm^ddcnt^replcnt^lastreplusernm^lastrepldt^atdoctnm^inptusernm^medispclnm^indd^dschdd^formrecseq^chosflag^reqdeptcd^medispclid^atdoctid^repluserid^wardcd^cnststat^inptuserid^lastrepluserid^signno";
  1084. sizedata = "5^30^100^60^55^30^65^65^70^70^85^65^85^65^100^100^65^40^30^65^100^65^65^0^70^70^50^0^0^0^0^0^0^0^0^0^0";
  1085. checkbox2.visible = "true";
  1086. caption13.visible = "true";
  1087. combo2.visible = "true";
  1088. }
  1089. else if (ioflag == "O")
  1090. {
  1091. refdata = "seq^checkflag^formnm^gubunflag^cnststatnm^eryn^reqdd^pid^pidnm^reqdeptnm^requsernm^inptusernm^recvdeptnm^recvusernm^repldd^replusernm^ddcnt^replcnt^lastreplusernm^lastrepldt^formrecseq^chosflag^reqdeptcd^medispclid^medispclnm^atdoctid^atdoctnm^repluserid^indd^dschdd^wardcd^wardnm^roomcd^cnststat^inptuserid^lastrepluserid^signno";
  1092. sizedata = "5^30^100^60^55^30^100^65^65^85^65^65^85^65^100^65^40^30^65^100^50^0^0^0^0^0^0^0^0^0^0^0^0^0^0^0^0";
  1093. checkbox2.visible = "false";
  1094. caption13.visible = "false";
  1095. combo2.visible = "false";
  1096. model.setValue("/root/presend/inflag", "");
  1097. }
  1098. else
  1099. {
  1100. refdata = "seq^checkflag^formnm^gubunflag^cnststatnm^eryn^reqdd^pid^pidnm^reqdeptnm^requsernm^recvdeptnm^recvusernm^repldd^replusernm^ddcnt^replcnt^lastreplusernm^lastrepldt^roomcd^atdoctnm^inptusernm^medispclnm^indd^dschdd^formrecseq^chosflag^reqdeptcd^medispclid^atdoctid^repluserid^wardcd^wardnm^cnststat^inptuserid^lastrepluserid^signno";
  1101. sizedata = "5^30^100^60^55^30^100^65^65^85^65^85^65^100^65^40^30^65^100^70^65^65^0^70^70^50^0^0^0^0^0^0^0^0^0^0^0";
  1102. }
  1103. setOrderInfoOfCol("grd_cnstlist", refdata, sizedata);
  1104. submit("TRMMR04901"); //컨설트 부서조회
  1105. }
  1106. /**
  1107. * @desc : 컬럼 순서 정보 설정
  1108. * @
  1109. * @param : grid ID : 그리드ID
  1110. * : refdata : 그리드 ref데이터 구분자 '^'
  1111. * : sizedata : 그리드 size데이터 구분자 '^'
  1112. * @return :
  1113. * @author : 오지훈
  1114. * @---------------------------------------------------
  1115. */
  1116. function setOrderInfoOfCol(grdid, refdata, sizedata)
  1117. {
  1118. var grdobj = document.controls.item(grdid);
  1119. var refarr = refdata.split("^");
  1120. var sizearr = sizedata.split("^");
  1121. for(var i = 0; i < refarr.length; i++){
  1122. var colcnt = grdobj.colref("" + refarr[i] + "");
  1123. grdobj.colMove(i, colcnt, "before", false);
  1124. var size = sizearr[i];
  1125. if(size == 0){ // size of column 0 -> hidden
  1126. grdobj.colHidden(i) = true;
  1127. }else{
  1128. grdobj.colHidden(i) = false;
  1129. }
  1130. grdobj.colWidth(i) = eval(size);
  1131. }
  1132. grdobj.rebuild();
  1133. }
  1134. /**
  1135. * @desc : 확인안한 회신건 카운트
  1136. * @
  1137. * @param :
  1138. * @return :
  1139. * @authur : 박종훈
  1140. * @---------------------------------------------------
  1141. */
  1142. function fCountReplList()
  1143. {
  1144. var instance = document.models(0).instances(0);
  1145. var nodelistCnst = instance.selectNodes("/root/main/cnstlist[requserid='" + getUserId() + "' and (cnststat = '22' or cnststat = '32')]");
  1146. if (nodelistCnst.length > 0)
  1147. {
  1148. model.setValue("/root/init/replinfo", "확인하지 않은 회신 " + nodelistCnst.length + "건 존재합니다.");
  1149. }
  1150. else
  1151. {
  1152. model.setValue("/root/init/replinfo", "");
  1153. }
  1154. model.refresh();
  1155. }
  1156. /**
  1157. * @desc : 사용자 조회
  1158. * @
  1159. * @param :
  1160. * @return :
  1161. * @authur : 박종훈
  1162. * @---------------------------------------------------
  1163. */
  1164. function fAftertemp()
  1165. {
  1166. mmbfGetUserComboList("/root/send/reqdata", "/root/init/userlist", cmb_orddept.value, "0330");
  1167. }
  1168. /*****************************************************************************
  1169. 튜닝
  1170. ******************************************************************************/
  1171. /**
  1172. * @group :
  1173. * @ver : 2008.06.13
  1174. * @by : snoweye
  1175. * @---------------------------------------------------
  1176. * @type : function
  1177. * @access : private
  1178. * @desc : 의뢰서 선택을 위한 팝업 호출 및 의뢰서 로딩
  1179. * @param : cnstflag - 진료의뢰/타과의뢰 구분 ("1"/"3")
  1180. * @return :
  1181. * @---------------------------------------------------
  1182. */
  1183. function fNewCnst(cnstflag)
  1184. {
  1185. /*
  1186. if (model.getValue ("/root/main/result/paminfo/list/ioflag") == "E" && cnstflag == "1")
  1187. {
  1188. messageBox("응급실 재원 환자는 진료과 consult를 발행할 수 없습니다.병동 입원 후 의뢰", "I008");
  1189. return;
  1190. }
  1191. */
  1192. if (doctyn == "Y")
  1193. {
  1194. srchmode = "piduserreq";
  1195. }
  1196. else
  1197. {
  1198. srchmode = "piddeptreq";
  1199. }
  1200. var nonstopyn = opener.window.javascript.getParameter("SMMMR05000_nonstopyn");
  1201. var paramformcd = opener.window.javascript.getParameter("SMMMR05000_formcd");
  1202. var paramdeptcd = opener.window.javascript.getParameter("SMMMR05000_deptcd");
  1203. var paramdeptnm = opener.window.javascript.getParameter("SMMMR05000_deptnm");
  1204. var paramdrid = opener.window.javascript.getParameter("SMMMR05000_drid");
  1205. var paramdrnm = opener.window.javascript.getParameter("SMMMR05000_drnm");
  1206. var paramorddd = opener.window.javascript.getParameter("SMMMR05000_orddd");
  1207. var paramcnstflag = opener.window.javascript.getParameter("SMMMR05000_cnstflag");
  1208. var paramreplflag = opener.window.javascript.getParameter("SMMMR05000_replflag");
  1209. var paramcnstioflag = opener.window.javascript.getParameter("SMMMR05000_cnstioflag");
  1210. if (nonstopyn != "Y") {
  1211. setParameter("MMR05000_cnstflag", cnstflag);
  1212. modal("SPMMR03900");
  1213. if(getParameter("SPMMR03900_deptnm") == "") {
  1214. return;
  1215. }
  1216. }
  1217. else {
  1218. setParameter("SPMMR03900_formcd",paramformcd);
  1219. setParameter("SPMMR03900_deptcd",paramdeptcd);
  1220. setParameter("SPMMR03900_deptnm",paramdeptnm);
  1221. setParameter("SPMMR03900_drid",paramdrid);
  1222. setParameter("SPMMR03900_drnm",paramdrnm);
  1223. setParameter("SPMMR03900_orddd",paramorddd);
  1224. setParameter("SPMMR03900_cnstflag",paramcnstflag);
  1225. //setParameter("SPMMR03900_formnm",paramformnm);
  1226. setParameter("SPMMR03900_replflag",paramreplflag);
  1227. setParameter("SPMMR03900_cnstioflag",paramcnstioflag);
  1228. }
  1229. var formcd = getParameter("SPMMR03900_formcd");
  1230. var deptcd = getParameter("SPMMR03900_deptcd");
  1231. var deptnm = getParameter("SPMMR03900_deptnm");
  1232. var drid = getParameter("SPMMR03900_drid");
  1233. var drnm = getParameter("SPMMR03900_drnm");
  1234. var orddd = getParameter("SPMMR03900_orddd");
  1235. var cnstflag = getParameter("SPMMR03900_cnstflag");
  1236. var formnm = getParameter("SPMMR03900_formnm");
  1237. var replflag = getParameter("SPMMR03900_replflag");
  1238. var cnstioflag = getParameter("SPMMR03900_cnstioflag");
  1239. var reqdeptno = getParameter("SPMMR03900_reqdeptno");
  1240. var mainscrnid = getScreenID();
  1241. setParameter("SPMMR04900_mainscrnid", mainscrnid );
  1242. setParameter("MMR05000_cnstflag", cnstflag);
  1243. clearParameter("SPMMR03900_formcd");
  1244. clearParameter("SPMMR03900_deptcd");
  1245. clearParameter("SPMMR03900_deptnm");
  1246. clearParameter("SPMMR03900_drid");
  1247. clearParameter("SPMMR03900_drnm");
  1248. clearParameter("SPMMR03900_orddd");
  1249. clearParameter("SPMMR03900_cnstflag");
  1250. clearParameter("SPMMR03900_formnm");
  1251. clearParameter("SPMMR03900_replflag");
  1252. clearParameter("SPMMR03900_cnstioflag");
  1253. if(cnstflag == "1")
  1254. {
  1255. fOpenCnstForm(formcd, deptcd, deptnm, drid, drnm, orddd, cnstflag, "", "", cnstioflag);
  1256. //2014/01/24 마취과로 컨설트 의뢰시 통증 또는 마취인지 구분 할 수 있도록 컨트롤 활성화
  1257. if(deptcd=="2090000000"){
  1258. ivw_loader.ivw_base.cap_gubun.visible=true;
  1259. ivw_loader.ivw_base.rdo_anstflag.visible=true;
  1260. ivw_loader.ivw_base.rdo_anstflag.value="";
  1261. ivw_loader.ivw_base.rdo_anstflag.refresh();
  1262. }else{
  1263. ivw_loader.ivw_base.cap_gubun.visible=false;
  1264. ivw_loader.ivw_base.rdo_anstflag.visible=false;
  1265. ivw_loader.ivw_base.rdo_anstflag.value="";
  1266. ivw_loader.ivw_base.rdo_anstflag.refresh();
  1267. //초기화
  1268. ivw_loader.ivw_base.model.makeValue("/root/init/cond/jinyn","N");
  1269. //ivw_loader.ivw_base.model.makeValue("/root/init/cond/jinyn","N");
  1270. //ivw_loader.ivw_base.b_jinyn.value="";
  1271. ivw_loader.ivw_base.b_jinyn.refresh();
  1272. }
  1273. //2014/01/24
  1274. }
  1275. else
  1276. {
  1277. if(formcd == "0000000964")
  1278. {
  1279. modal("SPADC61700");
  1280. }
  1281. else if(formcd == "0000000769")
  1282. {
  1283. modal("SPADC62000");
  1284. }
  1285. else if(formcd == "0000000768")
  1286. {
  1287. modal("SPADC61800");
  1288. }
  1289. else if(formcd == "0000000770" || formcd == "0000003019")
  1290. {
  1291. model.removeNodeset("/root/temp/cnstinfo");
  1292. model.makeValue("/root/temp/cnstinfo", formcd);
  1293. modal("SPADB62300", 1, 0, 0 ,"SPADB62300", "/root/temp/cnstinfo", "/root/temp/cnstinfo");
  1294. }
  1295. else if(formcd == "0000000771")
  1296. {
  1297. modal("SPADC62100");
  1298. }
  1299. else if(formcd == "0000000693")
  1300. {
  1301. modal("SPADC60900");
  1302. }
  1303. else
  1304. {
  1305. fOpenCnstForm(formcd, deptcd, deptnm, "", "", "", cnstflag, formnm, replflag, "");
  1306. //[요청번호:20160628017] 가정호스피스 이용동의서 확인 팝업 요청
  1307. if( getUserInfo("dutplceinstcd") == "032" && formcd == "1600017738" ){
  1308. messageBox("가정 호스피스 의뢰 시 완화 의료 이용동의서 확인 하십시요.","I");
  1309. }else if( getUserInfo("dutplceinstcd") == "032" && formcd == "1700019904" ){
  1310. // [요청번호:20180228002] consult화면에서 의뢰시 자동팝업창 요청
  1311. messageBox("자문 호스피스 의뢰 시 환자 및 보호자에게 완화 의료 이용동의 확인 후 의뢰하여 주십시오.","I");
  1312. }
  1313. }
  1314. fGetCnstlist(srchmode);
  1315. }
  1316. }
  1317. /*****************************************************************************
  1318. 튜닝
  1319. ******************************************************************************/
  1320. /**
  1321. * @group :
  1322. * @ver : 2008.06.13
  1323. * @by : snoweye
  1324. * @---------------------------------------------------
  1325. * @type : function
  1326. * @access : private
  1327. * @desc : 진료의뢰 화면 로딩
  1328. * @param :
  1329. * @return :
  1330. * @---------------------------------------------------
  1331. */
  1332. function fOpenCnstForm(formcd, cnstdeptcd, cnstdeptnm, drid, drnm, hopedd, cnstflag, formnm, replflag, cnstioflag)
  1333. {
  1334. ivw_loader.disabled = false;
  1335. setParameter("userdeptcd", cnstdeptcd);
  1336. ivw_loader.window.javascript.setParameter("SMMMR04900_newcnstform", "Y");
  1337. ivw_loader.window.javascript.setParameter("SMMMR04900_formcd", formcd);
  1338. ivw_loader.window.javascript.setParameter("SMMMR04900_reqdeptno", getParameter("SPMMR03900_reqdeptno"));
  1339. if (replflag == "R") //의뢰부서는 환자진료과
  1340. {
  1341. var reqdpcd = ivw_loader.model.getValue("/root/main/paminfo/orddeptcd");
  1342. model.setValue("/root/cond/orddeptcd", reqdpcd);
  1343. fAftertemp();
  1344. var reqdrid = ivw_loader.model.getValue("/root/main/paminfo/orddrid");
  1345. model.setValue("/root/cond/orddrid", reqdrid);
  1346. var reqdpnm = model.getValue("/root/init/deptlist/orddept[deptcd = '" + reqdpcd + "']/deptnm");
  1347. var reqdrnm = model.getValue("/root/init/userlist/usercombo[userid = '" + reqdrid + "']/usernm");
  1348. ivw_loader.window.javascript.setParameter("SMMMR04900_reqdpcd", reqdpcd);
  1349. ivw_loader.window.javascript.setParameter("SMMMR04900_reqdpnm", reqdpnm);
  1350. ivw_loader.window.javascript.setParameter("SMMMR04900_reqdrid", reqdrid);
  1351. ivw_loader.window.javascript.setParameter("SMMMR04900_reqdrnm", reqdrnm);
  1352. ivw_loader.window.javascript.setParameter("SMMMR04900_cnstdeptcd", cnstdeptcd);
  1353. ivw_loader.window.javascript.setParameter("SMMMR04900_cnstdeptnm", cnstdeptnm);
  1354. }
  1355. else if (replflag == "D") //회신부서는 환자 진료과
  1356. {
  1357. var recvdpcd = ivw_loader.model.getValue("/root/main/paminfo/orddeptcd");
  1358. model.setValue("/root/cond/orddeptcd", recvdpcd);
  1359. fAftertemp();
  1360. var recvdrid = ivw_loader.model.getValue("/root/main/paminfo/orddrid");
  1361. model.setValue("/root/cond/orddrid", recvdrid);
  1362. var recvdpnm = model.getValue("/root/init/deptlist/orddept[deptcd = '" + recvdpcd + "']/deptnm");
  1363. var recvdrnm = model.getValue("/root/init/userlist/usercombo[userid = '" + recvdrid + "']/usernm");
  1364. ivw_loader.window.javascript.setParameter("SMMMR04900_cnstdeptcd", recvdpcd);
  1365. ivw_loader.window.javascript.setParameter("SMMMR04900_cnstdeptnm", recvdpnm);
  1366. ivw_loader.window.javascript.setParameter("SMMMR04900_cnstuserid", recvdrid);
  1367. ivw_loader.window.javascript.setParameter("SMMMR04900_cnstusernm", recvdrnm);
  1368. }
  1369. else if (replflag == "T") //팀의뢰
  1370. {
  1371. model.makeValue("/root/send/formcd", formcd);
  1372. var recvdpnm = "";
  1373. if (submit("TRMMR05003"))
  1374. {
  1375. var edudplist = model.instances(0).selectNodes("/root/edudept/edudeptlist");
  1376. if(edudplist.length == 0){
  1377. alert("한건도 없다.");
  1378. return false;
  1379. }
  1380. for (var i = 0; i < edudplist.length; i++)
  1381. {
  1382. depthngnm = edudplist.item(i).selectSingleNode("depthngnm").text;
  1383. recvdpnm += depthngnm + ", "
  1384. }
  1385. }
  1386. ivw_loader.window.javascript.setParameter("SMMMR04900_cnstdeptnm", recvdpnm.substring(0, recvdpnm.length - 2));
  1387. ivw_loader.window.javascript.setParameter("SMMMR04900_cnstdeptcd", cnstdeptcd);
  1388. /*
  1389. var recvdpcd = ivw_loader.model.getValue("/root/main/paminfo/orddeptcd");
  1390. model.setValue("/root/cond/orddeptcd", recvdpcd);
  1391. fAftertemp();
  1392. var recvdrid = ivw_loader.model.getValue("/root/main/paminfo/orddrid");
  1393. model.setValue("/root/cond/orddrid", recvdrid);
  1394. var recvdpnm = model.getValue("/root/init/deptlist/orddept[deptcd = '" + recvdpcd + "']/deptnm");
  1395. var recvdrnm = model.getValue("/root/init/userlist/usercombo[userid = '" + recvdrid + "']/usernm");
  1396. ivw_loader.window.javascript.setParameter("SMMMR04900_cnstdeptcd", recvdpcd);
  1397. ivw_loader.window.javascript.setParameter("SMMMR04900_cnstdeptnm", recvdpnm);
  1398. ivw_loader.window.javascript.setParameter("SMMMR04900_cnstuserid", recvdrid);
  1399. ivw_loader.window.javascript.setParameter("SMMMR04900_cnstusernm", recvdrnm);
  1400. */
  1401. }
  1402. else
  1403. {
  1404. ivw_loader.window.javascript.setParameter("SMMMR04900_cnstdeptcd", cnstdeptcd);
  1405. ivw_loader.window.javascript.setParameter("SMMMR04900_cnstdeptnm", cnstdeptnm);
  1406. }
  1407. //fAftertemp
  1408. if (cnstflag == "1")
  1409. {
  1410. ivw_loader.window.javascript.setParameter("SMMMR04900_drid", drid);
  1411. ivw_loader.window.javascript.setParameter("SMMMR04900_drnm", drnm);
  1412. ivw_loader.window.javascript.setParameter("SMMMR04900_hopedd", hopedd);
  1413. ivw_loader.window.javascript.setParameter("SMMMR04900_cnstioflag", cnstioflag);
  1414. //이윤주(20140812)
  1415. var paramreqcnt = opener.window.javascript.getParameter("SMMMR05000_reqcnt");
  1416. ivw_loader.window.javascript.setParameter("SMMMR04900_reqcnt", paramreqcnt);
  1417. }
  1418. else if (cnstflag == "3")
  1419. {
  1420. ivw_loader.window.javascript.setParameter("SMMMR04900_formnm", formnm);
  1421. ivw_loader.window.javascript.setParameter("SMMMR04900_replflag", replflag);
  1422. }
  1423. ivw_loader.window.javascript.setParameter("SMMMR04900_cnstflag", cnstflag);
  1424. ivw_loader.window.javascript.fLoadNewForm(formcd);
  1425. }
  1426. /**
  1427. * @group :
  1428. * @ver : 2008.09.01
  1429. * @by : jonghun
  1430. * @---------------------------------------------------
  1431. * @type : function
  1432. * @access : private
  1433. * @desc : 컨설트 리스트 더블클릭시 이벤트
  1434. * @param :
  1435. * @return :
  1436. * @---------------------------------------------------
  1437. */
  1438. function fDbClickCnstList()
  1439. {
  1440. if((grd_cnstlist.isCell(event.target) && grd_cnstlist.mouserow >= grd_cnstlist.fixedrows))
  1441. {
  1442. //chk_setPatInfo.disabled = false;
  1443. var cnfmyn = grd_cnstlist.valueMatrix(grd_cnstlist.row, grd_cnstlist.colRef("cnfmyn"));
  1444. if (cnfmyn == "N")
  1445. {
  1446. messageBox("OCS에서 작성한 기록은 수정할 수 없습니다. 의료정보팀으로 문의", "I008");
  1447. }
  1448. else{
  1449. ivw_loader.grup_btn.disabled = false; //2009-12-08 오후 9:00:59 강지훈 수정
  1450. }
  1451. var irow = parseInt(grd_cnstlist.row);
  1452. grd_cnstlist.allstyle("data", "background-color") = "#ffffff";
  1453. grd_cnstlist.rowstyle(irow, "data", "background-color") = "#ffcc99";
  1454. grd_cnstlist.refresh();
  1455. fCnstGrdSize("min");
  1456. var cnstformcd = grd_cnstlist.valueMatrix(grd_cnstlist.row, grd_cnstlist.colRef("formcd"));
  1457. var cnstflag = grd_cnstlist.valueMatrix(grd_cnstlist.row, grd_cnstlist.colRef("cnstflag"));
  1458. var formrecseq = grd_cnstlist.valueMatrix(grd_cnstlist.row, grd_cnstlist.colRef("formrecseq"));
  1459. var selpid = grd_cnstlist.valueMatrix(grd_cnstlist.row, grd_cnstlist.colRef("pid"));
  1460. var sroomcd = grd_cnstlist.valueMatrix(grd_cnstlist.row, grd_cnstlist.colRef("roomcd"));
  1461. var sCnststat = grd_cnstlist.valueMatrix(grd_cnstlist.row, grd_cnstlist.colRef("cnststat"));
  1462. if (sCnststat == "04" || sCnststat == "05")
  1463. {
  1464. messageBox("취소된 의뢰", "I009");
  1465. return;
  1466. }
  1467. if(cnstflag == "1")
  1468. {
  1469. fOpenRecCnstForm(grd_cnstlist.valueMatrix(grd_cnstlist.row, grd_cnstlist.colRef("formrecseq")), grd_cnstlist.valueMatrix(grd_cnstlist.row, grd_cnstlist.colRef("cnstflag")));
  1470. //2014/01/28 수신과가 마취통증의학과 일시에는 의뢰구분이 보이도록 설정
  1471. var userdeptcd=getUserInfo("dutplcecd"); // 유저부서
  1472. var cnststat = model.getValue("/root/main/cnstlist["+grd_cnstlist.row+"]/cnststat"); // 컨설트 상태
  1473. if(cnstformcd=="0000000677" && grd_cnstlist.valueMatrix(grd_cnstlist.row, grd_cnstlist.colRef("reqdeptcd")) == getUserInfo("dutplcecd") &&
  1474. grd_cnstlist.valueMatrix(grd_cnstlist.row, grd_cnstlist.colRef("recvdeptcd"))=="2090000000" && cnststat == "12"){
  1475. ivw_loader.ivw_base.cap_gubun.visible=true;
  1476. ivw_loader.ivw_base.rdo_anstflag.visible=true;
  1477. ivw_loader.ivw_base.rdo_anstflag.value=model.getValue("/root/main/cnstlist["+grd_cnstlist.row+"]/anstflag");
  1478. ivw_loader.ivw_base.rdo_anstflag.disabled=false;
  1479. ivw_loader.ivw_base.rdo_anstflag.refresh();
  1480. }else if(cnstformcd=="0000000677" && grd_cnstlist.valueMatrix(grd_cnstlist.row, grd_cnstlist.colRef("reqdeptcd")) == getUserInfo("dutplcecd") &&
  1481. grd_cnstlist.valueMatrix(grd_cnstlist.row, grd_cnstlist.colRef("recvdeptcd"))=="2090000000" && cnststat > "12"){
  1482. ivw_loader.ivw_base.cap_gubun.visible=true;
  1483. ivw_loader.ivw_base.rdo_anstflag.visible=true;
  1484. ivw_loader.ivw_base.rdo_anstflag.value=model.getValue("/root/main/cnstlist["+grd_cnstlist.row+"]/anstflag");
  1485. ivw_loader.ivw_base.rdo_anstflag.disabled=true;
  1486. ivw_loader.ivw_base.rdo_anstflag.refresh();
  1487. }else if(cnstformcd=="0000000677" && grd_cnstlist.valueMatrix(grd_cnstlist.row, grd_cnstlist.colRef("recvdeptcd"))=="2090000000" &&
  1488. getUserInfo("dutplcecd") == "2090000000"){
  1489. ivw_loader.ivw_base.cap_gubun.visible=true;
  1490. ivw_loader.ivw_base.rdo_anstflag.visible=true;
  1491. ivw_loader.ivw_base.rdo_anstflag.value=model.getValue("/root/main/cnstlist["+grd_cnstlist.row+"]/anstflag");
  1492. ivw_loader.ivw_base.rdo_anstflag.disabled=true;
  1493. ivw_loader.ivw_base.rdo_anstflag.refresh();
  1494. }else{
  1495. ivw_loader.ivw_base.cap_gubun.visible=false;
  1496. ivw_loader.ivw_base.rdo_anstflag.visible=false;
  1497. ivw_loader.ivw_base.rdo_anstflag.value="";
  1498. ivw_loader.ivw_base.rdo_anstflag.disabled=false;
  1499. ivw_loader.ivw_base.rdo_anstflag.refresh();
  1500. }
  1501. //2014/01/28
  1502. //2012/02/10 Start 컨설트의 상태가 의뢰일시에는 수신과 및 수신의를 수정가능토록 하지만 그 이외는 수정 불가능하도록 막음
  1503. if(grd_cnstlist.valueMatrix(grd_cnstlist.row, grd_cnstlist.colRef("cnststat"))=="12"){
  1504. ivw_loader.ivw_base.cmb_recdept.disabled=false;
  1505. ivw_loader.ivw_base.cmb_recdoct.disabled=false;
  1506. ivw_loader.ivw_base.combo1.disabled=false;
  1507. }else{
  1508. ivw_loader.ivw_base.cmb_recdept.disabled=true;
  1509. ivw_loader.ivw_base.cmb_recdoct.disabled=true;
  1510. ivw_loader.ivw_base.combo1.disabled=true;
  1511. }
  1512. /*
  1513. //Consult화면에서 컨설트 내역 더블클릭시 영상구분을 disabled를 제어(의뢰일시에만 수정가능)
  1514. if((grd_cnstlist.valueMatrix(grd_cnstlist.row, grd_cnstlist.colRef("inptuserid"))==getUserInfo("userid"))&&
  1515. grd_cnstlist.valueMatrix(grd_cnstlist.row, grd_cnstlist.colRef("cnststat"))=="12" &&
  1516. grd_cnstlist.valueMatrix(grd_cnstlist.row, grd_cnstlist.colRef("recvdeptcd"))=="2160000000"){
  1517. ivw_loader.ivw_base.combo1.disabled=false;
  1518. }else{
  1519. ivw_loader.ivw_base.combo1.disabled=true;
  1520. }
  1521. */
  1522. //2012/02/10 End
  1523. }
  1524. else
  1525. {
  1526. if(cnstformcd == "0000003019" || cnstformcd == "0000000964" || cnstformcd == "0000000769" || cnstformcd == "0000000770" || cnstformcd == "0000000771" || cnstformcd == "0000000693")
  1527. {
  1528. model.removeNodeset("/root/temp/cnstinfo");
  1529. model.makeNode("/root/temp/cnstinfo");
  1530. model.copyNode("/root/temp/cnstinfo", "/root/main/cnstlist[formrecseq='" + formrecseq + "']");
  1531. var cnststat = parseInt(grd_cnstlist.valueMatrix(grd_cnstlist.row, grd_cnstlist.colRef("cnststat")));
  1532. if (cnststat >= 22)
  1533. {
  1534. modal("SPADC62200", 1, 0, 0 ,"SPADC62200", "/root/temp/cnstinfo", "/root/temp/cnstinfo");
  1535. }
  1536. else
  1537. {
  1538. if(cnstformcd == "0000000964")
  1539. {
  1540. modal("SPADC61700", 1, 0, 0 ,"SPADC61700", "/root/temp/cnstinfo", "/root/temp/cnstinfo");
  1541. }
  1542. else if(cnstformcd == "0000000769")
  1543. {
  1544. modal("SPADC62000", 1, 0, 0 ,"SPADC62000", "/root/temp/cnstinfo", "/root/temp/cnstinfo");
  1545. }
  1546. else if(cnstformcd == "0000000770" || cnstformcd == "0000003019")
  1547. {
  1548. modal("SPADB62300", 1, 0, 0 ,"SPADB62300", "/root/temp/cnstinfo", "/root/temp/cnstinfo");
  1549. }
  1550. else if(cnstformcd == "0000000771")
  1551. {
  1552. modal("SPADC62100", 1, 0, 0 ,"SPADC62100", "/root/temp/cnstinfo", "/root/temp/cnstinfo");
  1553. }
  1554. else if(cnstformcd == "0000000693")
  1555. {
  1556. modal("SPADC60900", 1, 0, 0 ,"SPADC60900", "/root/temp/cnstinfo", "/root/temp/cnstinfo");
  1557. }
  1558. }
  1559. fGetCnstlist(srchmode);
  1560. }
  1561. else if(cnstformcd == "0000000768")
  1562. {
  1563. model.removeNodeset("/root/temp/cnstinfo");
  1564. model.makeNode("/root/temp/cnstinfo");
  1565. model.copyNode("/root/temp/cnstinfo", "/root/main/cnstlist[formrecseq='" + formrecseq + "']");
  1566. var cnststat = parseInt(grd_cnstlist.valueMatrix(grd_cnstlist.row, grd_cnstlist.colRef("cnststat")));
  1567. if (cnststat >= 22)
  1568. {
  1569. modal("SMADC01600", 1, 0, 0 ,"SMADC01600", "/root/temp/cnstinfo", "/root/temp/cnstinfo");
  1570. }
  1571. else
  1572. {
  1573. modal("SPADC61800", 1, 0, 0 ,"SPADC61800", "/root/temp/cnstinfo", "/root/temp/cnstinfo");
  1574. }
  1575. fGetCnstlist(srchmode);
  1576. }
  1577. else
  1578. {
  1579. fOpenRecCnstForm(grd_cnstlist.valueMatrix(grd_cnstlist.row, grd_cnstlist.colRef("formrecseq")), grd_cnstlist.valueMatrix(grd_cnstlist.row, grd_cnstlist.colRef("cnstflag")));
  1580. }
  1581. }
  1582. ipt_pid.value = selpid;
  1583. fPidKeyPress("N", sroomcd);
  1584. //2009-12-08 오후 8:58:57 강지훈 수정
  1585. if (cnfmyn == "N")
  1586. {
  1587. ivw_loader.grup_btn.disabled = true;
  1588. }
  1589. else
  1590. {
  1591. ivw_loader.grup_btn.disabled = false;
  1592. }
  1593. }
  1594. /* if (model.getValue("/root/init/paminfoyn") == "Y"){
  1595. fChngMainEMRScrn();
  1596. }*/
  1597. }
  1598. /**
  1599. * @group :
  1600. * @ver : 2008.10.10
  1601. * @by : jonghun
  1602. * @---------------------------------------------------
  1603. * @type : function
  1604. * @access : private
  1605. * @desc : 컨설트 리스트 마우스 오른쪽 버튼 이벤트
  1606. * @param :
  1607. * @return :
  1608. * @---------------------------------------------------
  1609. */
  1610. function fCnstListMouseRight()
  1611. {
  1612. setPopupMenu("grd_cnstlist", false, "/root/init/cnstrecvmsrghtpat/mouserght", "label", "func"); //컨설트리스트 우클릭시 상단연계 이벤트 추가 2009.12.12 LYJ
  1613. if(grd_cnstlist.isCell(event.target) && (grd_cnstlist.mouserow >= grd_cnstlist.fixedrows))
  1614. {
  1615. var grdcnststat = grd_cnstlist.valueMatrix(grd_cnstlist.row, grd_cnstlist.colRef("cnststat"));
  1616. var cnstformcd = grd_cnstlist.valueMatrix(grd_cnstlist.row, grd_cnstlist.colRef("formcd"));
  1617. var grdrequserid = grd_cnstlist.valueMatrix(grd_cnstlist.row, grd_cnstlist.colRef("medispclid"));
  1618. var grdatdoctid = grd_cnstlist.valueMatrix(grd_cnstlist.row, grd_cnstlist.colRef("atdoctid"));
  1619. var grdinputuserid = grd_cnstlist.valueMatrix(grd_cnstlist.row, grd_cnstlist.colRef("inptuserid"));
  1620. var grdreqdpcd = grd_cnstlist.valueMatrix(grd_cnstlist.row, grd_cnstlist.colRef("reqdeptcd"));
  1621. var grdrecvuserid = grd_cnstlist.valueMatrix(grd_cnstlist.row, grd_cnstlist.colRef("recvuserid"));
  1622. var grdrecvdpcd = grd_cnstlist.valueMatrix(grd_cnstlist.row, grd_cnstlist.colRef("recvdeptcd"));
  1623. var cnststatnm = grd_cnstlist.valueMatrix(grd_cnstlist.row, grd_cnstlist.colRef("cnststatnm"));
  1624. var loginuserid = getUserId();
  1625. var loginuserdpcd = getUserInfo("dutplcecd");
  1626. if (cnstformcd != "0000003019" && cnstformcd != "0000000964" && cnstformcd != "0000000769" && cnstformcd != "0000000770" && cnstformcd != "0000000771" && cnstformcd != "0000000693" && cnstformcd != "0000000768")
  1627. {
  1628. if ((grdcnststat == "11" || grdcnststat == "12" || grdcnststat == "20") && (grdreqdpcd == loginuserdpcd || loginuserid == grdrequserid || loginuserid == grdatdoctid || loginuserid == grdinputuserid ||loginuserid==pat_atdoctid ||loginuserid==pat_medispclid))
  1629. {
  1630. //2013/01/29 Start 환자의 주치의 또는 담당의 인지 플래그 셋팅
  1631. if(loginuserid==pat_atdoctid ||loginuserid==pat_medispclid){
  1632. model.makeValue("/root/send/orddridchk", "Y");
  1633. }
  1634. //2013/01/29 End
  1635. model.setValue("/root/init/cnstreqmsrght/mouserght/label", "의뢰 취소");
  1636. setPopupMenu("grd_cnstlist", false, "/root/init/cnstreqmsrght/mouserght", "label", "func");
  1637. }
  1638. else if ((grdcnststat == "20" || grdcnststat == "21") && (loginuserdpcd == grdrecvdpcd || loginuserid == grdrecvuserid))
  1639. {
  1640. //model.setValue("/root/init/cnstrecvmsrght/mouserght/label", cnststatnm + " 취소");
  1641. //setPopupMenu("grd_cnstlist", false, "/root/init/cnstrecvmsrght/mouserght", "label", "func");
  1642. }
  1643. }
  1644. //model.setValue("/root/main/cccdinfo/cccd[" + grd_cccd.mouserow + "]/boolflag", "true");
  1645. //model.refresh();
  1646. //alert(grd_cccd.getUpdateData());
  1647. //setPopupMenu("grd_cccd", false, "/root/init/ccmsrght/mouserght", "label", "func");
  1648. }
  1649. }
  1650. /**
  1651. * @group :
  1652. * @ver : 2008.10.17
  1653. * @by : jonghun
  1654. * @---------------------------------------------------
  1655. * @type : function
  1656. * @access : private
  1657. * @desc : 출력 버튼 이벤트
  1658. * @param :
  1659. * @return :
  1660. * @---------------------------------------------------
  1661. */
  1662. function fClickPrtBtn()
  1663. {
  1664. var checkflag = "";
  1665. var formcd = "";
  1666. var signno = "";
  1667. var prtparam = "";
  1668. var cnststat = "";
  1669. var recvdpcd = "";
  1670. var arrrecseq = "formrecseq▦cnstflag▩";
  1671. var isExiest = "N"; //Y일경우 서브밋
  1672. var selectcnt=getNodesetCount("/root/main/cnstlist[checkflag='Y']");
  1673. if(selectcnt<1){
  1674. messageBox("선택된 의뢰가", "I004");
  1675. return;
  1676. }
  1677. for(var i = 1 ; i < grd_cnstlist.rows ; i++){
  1678. checkflag = grd_cnstlist.valueMatrix(i , grd_cnstlist.colRef("checkflag"));
  1679. if(checkflag == "Y")
  1680. {
  1681. formcd = grd_cnstlist.valueMatrix(i , grd_cnstlist.colRef("formcd"));
  1682. signno = grd_cnstlist.valueMatrix(i , grd_cnstlist.colRef("signno"));
  1683. cnststat = grd_cnstlist.valueMatrix(i , grd_cnstlist.colRef("cnststat"));
  1684. recvdpcd = grd_cnstlist.valueMatrix(i , grd_cnstlist.colRef("recvdeptcd"));
  1685. if (formcd != "" && signno != "0")
  1686. {
  1687. prtparam += "E▦" + signno + "▦" + formcd + "▩";
  1688. if (cnststat == "12" && recvdpcd == getUserInfo("dutplcecd"))
  1689. {
  1690. arrrecseq += grd_cnstlist.valueMatrix(i , grd_cnstlist.colRef("formrecseq")) + "▦" + grd_cnstlist.valueMatrix(i , grd_cnstlist.colRef("cnstflag")) + "▩";
  1691. isExiest = "Y";
  1692. }
  1693. }
  1694. }
  1695. }
  1696. if (isExiest == "Y")
  1697. {
  1698. model.makeValue("/root/send/arrrecseq", arrrecseq);
  1699. if(submit("TXMMR05004"))
  1700. {
  1701. grd_cnstlist.allstyle("data", "background-color") = "#ffffff";
  1702. grd_cnstlist.refresh();
  1703. fCountReplList();
  1704. fGetCnstlist(srchmode);
  1705. }
  1706. }
  1707. if(prtparam == "")
  1708. {
  1709. messageBox("출력할 수 없는 서식입니다", "I", "");
  1710. for(var i=1; i<=grd_cnstlist.rows; i++){
  1711. grd_cnstlist.valueMatrix(i , grd_cnstlist.colRef("checkflag"))="N";
  1712. }
  1713. model.refresh();
  1714. return;
  1715. }
  1716. //setParameter("SPMRI02400_autoprtYn", "Y");
  1717. setParameter("SPMRI02400_prtrecinfo", prtparam);
  1718. //modal("SPMRI02400", 1, "", "", "", "", "", "left:-800; right:0; width:0; height:0;");
  1719. modal("SPMRI02400");
  1720. }
  1721. function fSelPatInfo()
  1722. {
  1723. messageBox("준비중입니다","Q999");
  1724. return;
  1725. }
  1726. /**
  1727. * @desc : 영상의학과 판독 협진의뢰서 선택
  1728. * @id :
  1729. * @event :
  1730. * @return : void
  1731. * @authur : 박종훈
  1732. */
  1733. function fClickCoTrmtCnst()
  1734. {
  1735. //formcd :1000009108, formnm :영상의학과 판독 협진의뢰서, cnstdeptcd : 2160000000, cnstdeptnm : 영상의학과, replflag : -
  1736. //fOpenCnstForm(formcd, deptcd, deptnm, "", "", "", cnstflag, formnm, replflag, "");
  1737. fOpenCnstForm("1000009108", "2160000000", "영상의학과", "", "", "", "3", "영상의학과 판독 협진의뢰서", "-", "");
  1738. if (doctyn == "Y") {
  1739. srchmode = "piduserreq";
  1740. } else {
  1741. srchmode = "piddeptreq";
  1742. }
  1743. fGetCnstlist(srchmode);
  1744. }
  1745. /**
  1746. * @desc : 삭제버튼 클릭시 삭제처리
  1747. * @id :
  1748. * @event :
  1749. * @return :
  1750. * @authur :
  1751. */
  1752. function fCnstRecDelete(){
  1753. var selectcnt=getNodesetCount("/root/main/cnstlist[checkflag='Y']");
  1754. var select_row=grd_cnstlist.row;
  1755. var cnststatnm = grd_cnstlist.valueMatrix(select_row , grd_cnstlist.colRef("cnststatnm"));
  1756. if(selectcnt<1){
  1757. messageBox("선택된 의뢰가", "I004");
  1758. return;
  1759. }
  1760. if(selectcnt>1){
  1761. messageBox("의뢰취소의 경우 멀티선택을", "E001");
  1762. model.setValue("/root/main/cond/checkallitem", "N");
  1763. for(var i=1; i<=grd_cnstlist.rows; i++){
  1764. grd_cnstlist.valueMatrix(i , grd_cnstlist.colRef("checkflag"))="N";
  1765. }
  1766. model.refresh();
  1767. return;
  1768. }
  1769. if(cnststatnm=="취소"){
  1770. messageBox("이미 취소된 건이", "E005");
  1771. grd_cnstlist.valueMatrix(select_row , grd_cnstlist.colRef("checkflag"))="N";
  1772. return;
  1773. }
  1774. var savedata = "formrecseq▦formcd▦orddridchk▩";
  1775. var datastring="";
  1776. var orddridchk="N";
  1777. var scnststat = parseInt(grd_cnstlist.valueMatrix(select_row , grd_cnstlist.colRef("cnststat")));
  1778. var formrecseq = model.getValue("/root/main/cnstlist[" + select_row + "]/formrecseq");
  1779. var cnstformcd = grd_cnstlist.valueMatrix(select_row, grd_cnstlist.colRef("formcd"));
  1780. var grdrequserid = grd_cnstlist.valueMatrix(select_row, grd_cnstlist.colRef("requserid"));
  1781. var grdmedispclid = grd_cnstlist.valueMatrix(select_row, grd_cnstlist.colRef("medispclid"));
  1782. var grdatdoctid = grd_cnstlist.valueMatrix(select_row, grd_cnstlist.colRef("atdoctid"));
  1783. var grdinputuserid = grd_cnstlist.valueMatrix(select_row, grd_cnstlist.colRef("inptuserid"));
  1784. var grdreqdpcd = grd_cnstlist.valueMatrix(select_row, grd_cnstlist.colRef("reqdeptcd"));
  1785. var grdrecvuserid = grd_cnstlist.valueMatrix(select_row, grd_cnstlist.colRef("recvuserid"));
  1786. var grdrecvdpcd = grd_cnstlist.valueMatrix(select_row, grd_cnstlist.colRef("recvdeptcd"));
  1787. var cnststatnm = grd_cnstlist.valueMatrix(select_row, grd_cnstlist.colRef("cnststatnm"));
  1788. var formnm = grd_cnstlist.valueMatrix(select_row, grd_cnstlist.colRef("formnm"));
  1789. var loginuserid = getUserId();
  1790. var loginuserdpcd = getUserInfo("dutplcecd");
  1791. if(scnststat>=20 && (cnstformcd == "0000003019" || cnstformcd == "0000000964" ||
  1792. cnstformcd == "0000000769" || cnstformcd == "0000000770" || cnstformcd == "0000000771" ||
  1793. cnstformcd == "0000000693" || cnstformcd == "0000000768" || cnstformcd == "1000009108")){
  1794. // 아래의 8가지 지원부서 의뢰일 경우는 상태값이 의뢰임시 또는 의뢰 상태에서는 삭제 될 수 있음
  1795. /*
  1796. 0000000693 약물유해반응 의뢰
  1797. 0000000768 약품식별의뢰
  1798. 0000000769 임상약동학의뢰(TDM)
  1799. 0000000770 정맥영양지원의뢰
  1800. 0000000771 복약상담의뢰
  1801. 0000000964 항응고약물상담(ACS)의뢰
  1802. 0000003019 경장영양지원의뢰(EN)
  1803. 1000009108 판독협진의뢰
  1804. */
  1805. messageBox(formnm + "는 상태값이 의뢰일 때만 취소", "I006");
  1806. grd_cnstlist.valueMatrix(select_row , grd_cnstlist.colRef("checkflag"))="N";
  1807. return;
  1808. }
  1809. if(cnstformcd == "0000003019" || cnstformcd == "0000000964" ||
  1810. cnstformcd == "0000000769" || cnstformcd == "0000000770" || cnstformcd == "0000000771" ||
  1811. cnstformcd == "0000000693" || cnstformcd == "0000000768" || cnstformcd == "1000009108"){
  1812. if(loginuserdpcd != grdreqdpcd && loginuserid != grdrequserid &&
  1813. loginuserid != grdatdoctid && loginuserid != grdinputuserid &&
  1814. loginuserid != grdmedispclid && loginuserid!=pat_atdoctid &&
  1815. loginuserid != pat_medispclid){
  1816. messageBox("수정 권한이 없습니다", "I", "");
  1817. return;
  1818. }
  1819. }
  1820. if((loginuserdpcd == grdreqdpcd || loginuserid == grdrequserid || loginuserid == grdatdoctid ||
  1821. loginuserid == grdinputuserid ||loginuserid==pat_atdoctid ||loginuserid==pat_medispclid)){
  1822. //if((loginuserid==pat_atdoctid ||loginuserid==pat_medispclid) && cnstformcd=="0000000677"){
  1823. if(loginuserid==pat_atdoctid ||loginuserid==pat_medispclid){
  1824. orddridchk="Y";
  1825. }
  1826. if (formrecseq != ""){
  1827. datastring += formrecseq + "▦" + cnstformcd + "▦" + orddridchk + "▩";
  1828. }
  1829. }
  1830. /*
  1831. for(var i = 1 ; i < grd_cnstlist.rows ; i++){
  1832. if(grd_cnstlist.valueMatrix(i , grd_cnstlist.colRef("checkflag"))=="N"){
  1833. continue;
  1834. }
  1835. var scnststat = grd_cnstlist.valueMatrix(i , grd_cnstlist.colRef("cnststat"));
  1836. var formrecseq = model.getValue("/root/main/cnstlist[" + i + "]/formrecseq");
  1837. var cnstformcd = grd_cnstlist.valueMatrix(i, grd_cnstlist.colRef("formcd"));
  1838. var grdrequserid = grd_cnstlist.valueMatrix(i, grd_cnstlist.colRef("medispclid"));
  1839. var grdatdoctid = grd_cnstlist.valueMatrix(i, grd_cnstlist.colRef("atdoctid"));
  1840. var grdinputuserid = grd_cnstlist.valueMatrix(i, grd_cnstlist.colRef("inptuserid"));
  1841. var grdreqdpcd = grd_cnstlist.valueMatrix(i, grd_cnstlist.colRef("reqdeptcd"));
  1842. var grdrecvuserid = grd_cnstlist.valueMatrix(i, grd_cnstlist.colRef("recvuserid"));
  1843. var grdrecvdpcd = grd_cnstlist.valueMatrix(i, grd_cnstlist.colRef("recvdeptcd"));
  1844. var cnststatnm = grd_cnstlist.valueMatrix(i, grd_cnstlist.colRef("cnststatnm"));
  1845. var loginuserid = getUserId();
  1846. var loginuserdpcd = getUserInfo("dutplcecd");
  1847. */
  1848. /* if(scnststat == "11" || scnststat == "12" || scnststat == "20"){
  1849. if(scnststat=="20" && (cnstformcd == "0000003019" || cnstformcd == "0000000964" ||
  1850. cnstformcd == "0000000769" || cnstformcd == "0000000770" || cnstformcd == "0000000771" ||
  1851. cnstformcd == "0000000693" || cnstformcd == "0000000768" || cnstformcd == "1000009108")){
  1852. // 아래의 8가지 지원부서 의뢰일 경우는 상태값이 의뢰임시 또는 의뢰 상태에서는 삭제 될 수 있음
  1853. 0000000693 약물유해반응 의뢰
  1854. 0000000768 약품식별의뢰
  1855. 0000000769 임상약동학의뢰(TDM)
  1856. 0000000770 정맥영양지원의뢰
  1857. 0000000771 복약상담의뢰
  1858. 0000000964 항응고약물상담(ACS)의뢰
  1859. 0000003019 경장영양지원의뢰(EN)
  1860. 1000009108 판독협진의뢰
  1861. grd_cnstlist.valueMatrix(i , grd_cnstlist.colRef("checkflag")) = "N";
  1862. model.refresh();
  1863. continue;
  1864. }
  1865. if((loginuserdpcd == grdreqdpcd || loginuserid == grdrequserid || loginuserid == grdatdoctid ||
  1866. loginuserid == grdinputuserid ||loginuserid==pat_atdoctid ||loginuserid==pat_medispclid)){
  1867. if((loginuserid==pat_atdoctid ||loginuserid==pat_medispclid) && cnstformcd=="0000000677"){
  1868. orddridchk="Y";
  1869. }
  1870. if (formrecseq != ""){
  1871. datastring += formrecseq + "▦" + cnstformcd + "▦" + orddridchk + "▩";
  1872. }
  1873. orddridchk="N";
  1874. }
  1875. else{
  1876. grd_cnstlist.valueMatrix(i , grd_cnstlist.colRef("checkflag")) = "N";
  1877. }
  1878. }else{
  1879. grd_cnstlist.valueMatrix(i , grd_cnstlist.colRef("checkflag")) = "N";
  1880. }
  1881. }*/
  1882. if(datastring!=""){
  1883. model.removenode("/root/send/savedata");
  1884. model.makeValue("/root/send/savedata", savedata + datastring);
  1885. if(submit("TXMMR05002"))
  1886. {
  1887. var mess = model.getValue("/root/main/savedinfo/rsltmsg/msg");
  1888. if(mess == "1")
  1889. {
  1890. messageBox("취소 되었습니다.", "I", "");
  1891. fGetCnstlist(srchmode);
  1892. ivw_loader.src = "../../../emr/medirecweb/xrw/SSMMR01100_서식로더.xrw";
  1893. ivw_loader.window.javascript.fInitPage(false, true, parseInt(ivw_loader.attribute("height")));
  1894. }
  1895. else
  1896. {
  1897. messageBox(mess, "I", "");
  1898. for(var i=1; i<=grd_cnstlist.rows; i++){
  1899. grd_cnstlist.valueMatrix(i , grd_cnstlist.colRef("checkflag"))="N";
  1900. }
  1901. model.refresh();
  1902. }
  1903. }
  1904. }
  1905. model.refresh();
  1906. }
  1907. function fCnststatChng(){
  1908. var userid = getUserInfo("userid");
  1909. if( model.getValue("/root/main/cnstlist[" + grd_cnstlist.row + "]/lastid") == userid && model.getValue("/root/main/cnstlist[" + grd_cnstlist.row + "]/cnststat") == "20" ){
  1910. if( messageBox("【 의뢰확정 】 상태를 【 의뢰 】로 변경하시겠습니까?", "Q999") == 6 ){
  1911. var formrecseq = model.getValue("/root/main/cnstlist[" + grd_cnstlist.row + "]/formrecseq");
  1912. model.makeValue( "/root/send/reqitem/instcd" , getUserInfo("dutplceinstcd") );
  1913. model.makeValue( "/root/send/reqitem/formrecseq" , formrecseq );
  1914. if( submit("TXMMR05005") ){
  1915. messageBox( "변경되었습니다.", "E999" );
  1916. fGetCnstlist( model.getValue("/root/tmp/condflag") );
  1917. }
  1918. }else{
  1919. return;
  1920. }
  1921. }else{
  1922. messageBox( "의뢰확정자가 아닙니다.", "E999" );
  1923. return;
  1924. }
  1925. }
  1926. function fSendRecInfoToSMMMO00100(){
  1927. if(getUserInfo("jobkindcd").substring(0,2) == "03"){
  1928. if(isPopup()){
  1929. if(getParameter("MMR05000_cnstflag") == "1"){
  1930. if(model.getValue("/root/hidden/procpconfiag/answcnt") == "001"){
  1931. var pamInfoNode = "/root/main/result/paminfo/list";
  1932. var pid = model.getValue ( pamInfoNode + "/pid" );
  1933. var cretno = model.getValue ( pamInfoNode + "/cretno" );
  1934. var orddd = model.getValue ( pamInfoNode + "/orddd" );
  1935. if(isNull(orddd)){
  1936. orddd = model.getValue ( pamInfoNode + "/indd" );
  1937. }
  1938. var wd = getOpenWindow("SMMMO00100");
  1939. if(wd != null){
  1940. var rscdoctid = ivw_loader.ivw_base.model.getValue("/root/init/cond/rscdoctid");
  1941. var rscdeptcd = ivw_loader.ivw_base.model.getValue("/root/init/cond/rscdeptcd");
  1942. var rscdoctnm = ivw_loader.ivw_base.model.getValue("/root/init/recvrlist/usercombo[usernm != '일반의사' and usernm != '의무기록' and userid = '"+ rscdoctid +"']/usernm");
  1943. var rscdeptnm = ivw_loader.ivw_base.model.getValue("/root/main/cnstformlist/cnstform[ cnstdeptcd = '"+ rscdeptcd +"']/cnstdeptnm");
  1944. wd.javascript.fSetAutoPrcpInfo( pid, cretno, orddd, "Consult (수신과 : "+rscdeptnm+", 수신자 : "+rscdoctnm+")" );
  1945. }
  1946. }
  1947. }
  1948. }
  1949. }
  1950. }