MMR00600_20100125.js 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905
  1. //부분서식의 부모아이템 배열
  2. var gItemCds = new Array("0007983001", "0000521001", "0000509001", "0000512001", "0000507001");
  3. var gItemCdsTextArea = new Array("0000512001", "0000507001");
  4. var gItemCdsXRWArea = new Array("0007983001", "0000521001", "0000509001");
  5. //부분서식의 개수만큼 일단 '0'으로 채운다.
  6. var gPageIdx = new Array(0, 0);
  7. var iSurg = ipt_surg.attribute("degnitemlevlcd");
  8. var iMcdnm = ipt_mcdnm.attribute("degnitemlevlcd");
  9. var iScdnm = ipt_scdnm.attribute("degnitemlevlcd");
  10. var cOdt1 = cmb_odt1.attribute("degnitemlevlcd");
  11. var cSdt1 = cmb_sdt1.attribute("degnitemlevlcd");
  12. //var operation = getGlobalVariable("operation").split("▩")[1];
  13. var instance = document.models(0).instances(0);
  14. var pageInfo = new PAGEINFO();
  15. var oprsrvno = ""; //수술예약번호
  16. var perfdeptcd = ""; //집도과
  17. /**
  18. * @desc : 확장버튼(이미지,가계도,추가기록)을 기록여부에 따라 표시를 위한 버튼목록
  19. * @id :
  20. * @authur : 안치원
  21. * @history : 2009.09.09 신규 안치원 ACW_090909A
  22. */
  23. var gExtnBtnIds = new Array("btn_imge_0000512001", "btn_etcrec_0000512001",
  24. "btn_imge_0000507001", "btn_etcrec_0000507001");
  25. /*
  26. if(operation != null && operation != ""){
  27. oprsrvno = operation.split("▦")[0];
  28. perfdeptcd = operation.split("▦")[10];
  29. }
  30. */
  31. /**
  32. * @desc : 초기 화면 설정
  33. * @id :
  34. * @event : xforms-ready
  35. * @return : void
  36. * @authur : 박종훈
  37. */
  38. function fFormReady_old()
  39. {
  40. grup_base.attribute("border-style") = "none";
  41. InitSetMaxSizeSection(gItemCdsTextArea, 335, 350);
  42. InitBtnImge(gItemCdsTextArea);
  43. InitBtnComn(gItemCdsTextArea);
  44. }
  45. /**
  46. * @desc : 서식 불러오기, 부분 그리드서식 사이즈 초기화
  47. * @id :
  48. * @event : xforms-ready
  49. * @return : void
  50. * @authur : 박종훈
  51. */
  52. function fLoadForm_old()
  53. {
  54. InitLoadSection(gItemCdsTextArea);
  55. InitSetUnitForm(gItemCdsXRWArea, false);
  56. parent.window.javascript.gSubmitID = TX_SUBMIT_EXTN_FORM;
  57. }
  58. /**
  59. * @desc : 서식 데이터 Clear, 인터페이스 입력값 조회 입력
  60. * @id :
  61. * @event : xforms-ready
  62. * @return : void
  63. * @authur : 박종훈
  64. */
  65. function fClearComnFormData()
  66. {
  67. if (gMaxSectionID != "")
  68. {
  69. var MaxObj = document.controls("lbl_" + gMaxSectionID);
  70. MaxObj.dispatch("onclick");
  71. }
  72. ClearComnFormData(gItemCds);
  73. fInitialize();
  74. if (parent.window.javascript.fGetFormRec("status") == "C")
  75. {
  76. var rtn = fGetdiagFormOprsrvno(oprsrvno, iMcdnm, iMcdnm, iScdnm, iScdnm); //수술예약번호로 진단명 조회
  77. //ivw_0000509001.window.javascript.fSrchOprlist(oprsrvno, cOdt1); //환자정보로 수술명, 집도의 조회
  78. fSrchOprPerfDrlist(oprsrvno, cOdt1); //환자정보로 수술명, 집도의 조회
  79. if(!rtn)
  80. {
  81. fBtnDisEnable(true);
  82. return "oprfalse";
  83. } else {
  84. model.refresh();
  85. }
  86. }
  87. //포커스 처리
  88. SetDefFocusIVW(gItemCdsTextArea);
  89. parent.window.javascript.fSetFormRec("extnflag", "opr");
  90. parent.window.javascript.fSetFormRec("oprsrvno", oprsrvno);
  91. }
  92. /**
  93. * @desc : 기록데이터 조회
  94. * @id :
  95. * @event : xforms-ready
  96. * @return : void
  97. * @authur : 박종훈
  98. */
  99. function fLoadData()
  100. {
  101. fInitialize();
  102. //Program 서식 데이터 조회반영
  103. InitPgmFormData();
  104. this.recRef2 = "/root/hidden/recinfo"
  105. //부분서식 데이터 조회 반영
  106. InitUnitFormData(gItemCds);
  107. parent.window.javascript.gSubmitID = TX_SUBMIT_EXTN_FORM;
  108. parent.window.javascript.fSetFormRec("extnflag", "opr");
  109. //parent.window.javascript.fSetFormRec("oprsrvno", oprsrvno);
  110. }
  111. /**
  112. * @desc : 화면 초기화
  113. * @
  114. * @param :
  115. * @return :
  116. * @authur : 박종훈
  117. */
  118. function fInitialize()
  119. {
  120. var operation = getGlobalVariable("operation").split("▩")[1];
  121. if(operation != null && operation != ""){
  122. oprsrvno = operation.split("▦")[0];
  123. perfdeptcd = operation.split("▦")[10];
  124. }
  125. if (parent.window.javascript.fGetFormRec("status") == "C")
  126. {
  127. parent.window.javascript.fSetFormRec("extnflag", "opr");
  128. parent.window.javascript.fSetFormRec("oprsrvno", oprsrvno);
  129. //수술예약번호 체크
  130. if(oprsrvno == "")
  131. {
  132. messageBox("수술예약이 되지 않은", "I005");
  133. grup_base.disabled = true;
  134. fBtnDisEnable(true);
  135. return;
  136. } else {
  137. fBtnDisEnable(false);
  138. }
  139. //집도과 체크
  140. if (perfdeptcd != getUserInfo("dutplcecd"))
  141. {
  142. messageBox("작성 권한이", "I004");
  143. grup_base.disabled = true;
  144. fBtnDisEnable(true);
  145. return;
  146. } else {
  147. fBtnDisEnable(false);
  148. }
  149. }
  150. var uInfo = getUserInfos();
  151. uInfo = uInfo.split("|");
  152. if (parent.window.javascript.fGetFormRec("status") == "C")
  153. {
  154. //초기조건 설정
  155. var opschedd = operation.split("▦")[7]; //수술예약일
  156. var opcnfmdd = operation.split("▦")[8]; //수술확정일
  157. var indxdd = getCurrentDate();
  158. if (opcnfmdd != "")
  159. {
  160. indxdd = opcnfmdd;
  161. }
  162. else if (opschedd != "")
  163. {
  164. indxdd = opschedd;
  165. }
  166. else
  167. {
  168. indxdd = getCurrentDate();
  169. }
  170. mmbfGetUserComboList("/root/init/reqdata", "/root/init/drlist" + cOdt1 , uInfo[8], "0330", "", "", indxdd);
  171. mmbfGetUserComboList("/root/init/reqdata", "/root/init/drlist" + cSdt1 , uInfo[8], "0330", "", "", indxdd);
  172. }
  173. else
  174. {
  175. var recdept = parent.window.javascript.fGetFormRec("formrecdeptcd");
  176. var recdd = parent.window.javascript.fGetFormRec("formrecdd");
  177. mmbfGetUserComboList("/root/init/reqdata", "/root/init/drlist" + cOdt1 , recdept, "0330", "", "", recdd);
  178. mmbfGetUserComboList("/root/init/reqdata", "/root/init/drlist" + cSdt1 , recdept, "0330", "", "", recdd);
  179. }
  180. // reqGetDrList("/root/init/reqdata", "/root/init/drlist" + cOdt1 +"/drlist", uInfo[8], ""); //집도의1
  181. // reqGetDrList("/root/init/reqdata", "/root/init/drlist" + cSdt1 +"/drlist", uInfo[8], ""); //보조의1
  182. ivw_0007983001.attribute("border-style") = "none";
  183. ivw_0000521001.attribute("border-style") = "none";
  184. ivw_0000509001.attribute("border-style") = "none";
  185. gTermViewTopPos = 29;
  186. gTermViewHei = 152;
  187. gTermViewItems = gItemCdsXRWArea;
  188. ipt_surg.attribute("disabled") = true;
  189. //fRadioYN();
  190. model.refresh();
  191. }
  192. /**
  193. * @desc : 의사 선택에 따른 reccnts셋팅
  194. * @
  195. * @param :
  196. * @return :
  197. * @authur : 박종훈
  198. */
  199. function fChngDoct(degnitemlevlcd)
  200. {
  201. var sDrid = model.getValue("/root/main/recinfo/recitem[degnitemlevlcd='" + degnitemlevlcd + "']/rectermcd");
  202. var sDrnm = model.getValue("/root/init/drlist"+degnitemlevlcd+"/usercombo[userid='"+sDrid+"']/usernm");
  203. if (sDrnm == "")
  204. {
  205. sDrnm = "";
  206. model.setValue("/root/main/recinfo/recitem[degnitemlevlcd='" + degnitemlevlcd + "']/rectermcd", "");
  207. }
  208. model.setValue("/root/main/recinfo/recitem[degnitemlevlcd='" + degnitemlevlcd + "']/rectermnm", sDrnm);
  209. model.refresh();
  210. }
  211. /**
  212. * @desc : 라디오버튼 선택에 따른 reccnts셋팅
  213. * @
  214. * @param :
  215. * @return :
  216. * @authur : 박종훈
  217. */
  218. function fRadioYN(degnitemlevlcd)
  219. {
  220. var sRdoCd = model.getValue("/root/main/recinfo/recitem[degnitemlevlcd='" + degnitemlevlcd + "']/rectermcd");
  221. var sRdoNm = model.getValue("/root/main/forminfo/vallist[valcd='" + sRdoCd + "']/valitemnm");
  222. model.setValue("/root/main/recinfo/recitem[degnitemlevlcd='" + degnitemlevlcd + "']/rectermnm", sRdoNm);
  223. }
  224. /**
  225. * @desc : 수술이력 팝업
  226. * @
  227. * @param :
  228. * @return :
  229. * @authur : 박종훈
  230. */
  231. function fPatientHist()
  232. {
  233. modal("SMMMO02500");
  234. }
  235. /**
  236. * @desc : 기록 인스턴스 연결
  237. * @
  238. * @param :
  239. * @return :
  240. * @authur : 박종훈
  241. */
  242. function fSetRecItemValue(reciteminfo)
  243. {
  244. return SetCommMediFormValue(gItemCds, reciteminfo);
  245. }
  246. /**
  247. * @desc : 확장서식 기록 초기 설정
  248. * @
  249. * @param :
  250. * @return :
  251. * @authur : 박종훈
  252. */
  253. function fExtnInitFormRec_old()
  254. {
  255. if (parent.window.javascript.fGetFormRec("status") == "C")
  256. {
  257. parent.window.javascript.gSubmitID = TX_SUBMIT_EXTN_FORM;
  258. parent.window.javascript.fSetFormRec("extnflag", "opr");
  259. parent.window.javascript.fSetFormRec("oprsrvno", oprsrvno);
  260. }
  261. }
  262. /**
  263. * @desc : 수술예약번호를 통한 진단명, 마취종류 조회
  264. * @
  265. * @param :
  266. * @return :
  267. * @---------------------------------------------------
  268. */
  269. function fGetdiagFormOprsrvno(oprsrvno, iMcdnm, iMcdnm, iScdnm, iScdnm)
  270. {
  271. if(oprsrvno != ""){
  272. model.removeNodeset("/root/main/diaginfo/diagcdlist");
  273. model.makeValue("/root/send/oprsrvno", oprsrvno);
  274. //model.makeValue("/root/send/oprsrvno", "2007000009");
  275. submit("TRMRF04001", false);
  276. var anstmthdcd = model.getValue("/root/main/diaginfo/anstlist/anstmthdcd");
  277. var mcdnm = model.getValue("/root/main/diaginfo/anstlist/mcdnm");
  278. var anstmthdcdsub = model.getValue("/root/main/diaginfo/anstlist/anstmthdcdsub");
  279. var scdnm = model.getValue("/root/main/diaginfo/anstlist/scdnm");
  280. var pageInfo = new PAGEINFO();
  281. var iptMObj = document.controls("ipt_mcdnm");
  282. var iptSObj = document.controls("ipt_scdnm");
  283. if (anstmthdcd != "" && mcdnm != "")
  284. {
  285. //주마취
  286. model.setValue("/root/main/recinfo/recitem[degnitemlevlcd='" + iMcdnm + "']/rectermcd", anstmthdcd);
  287. model.setValue("/root/main/recinfo/recitem[degnitemlevlcd='" + iMcdnm + "']/rectermnm", mcdnm);
  288. iptMObj.attribute("ref") = pageInfo.recItemRef + "[degnitemlevlcd='" + iMcdnm + "']/rectermnm";
  289. }
  290. else
  291. {
  292. iptMObj.attribute("ref") = pageInfo.recItemRef + "[degnitemlevlcd='" + iMcdnm + "']/reccnts";
  293. }
  294. if (anstmthdcdsub != "" && scdnm != "")
  295. {
  296. //부마취
  297. model.setValue("/root/main/recinfo/recitem[degnitemlevlcd='" + iScdnm + "']/rectermcd", anstmthdcdsub);
  298. model.setValue("/root/main/recinfo/recitem[degnitemlevlcd='" + iScdnm + "']/rectermnm", scdnm);
  299. iptSObj.attribute("ref") = pageInfo.recItemRef + "[degnitemlevlcd='" + iScdnm + "']/rectermnm";
  300. }
  301. else
  302. {
  303. iptSObj.attribute("ref") = pageInfo.recItemRef + "[degnitemlevlcd='" + iScdnm + "']/reccnts";
  304. }
  305. copyNodeset("/root/main/diaginfo/diagcdlist", "/root/main/diaginfo/diagcdlist", "replace", ivw_0007983001.model, model);
  306. copyNodeset("/root/main/diaginfo/diagcdlist", "/root/main/diaginfo/diagcdlist", "replace", ivw_0000521001.model, model);
  307. model.refresh();
  308. ivw_0007983001.window.javascript.fSetDiagNmInstance();
  309. ivw_0000521001.window.javascript.fSetDiagNmInstance();
  310. return true;
  311. }else{
  312. //alert("해당환자는 수술환자가 아닙니다!");
  313. //grup_base.disabled = true;
  314. //parent.window.javascript.fBtnDisable();
  315. return false;
  316. }
  317. }
  318. /**
  319. * @desc : 수술명, 집도의 조회
  320. * @
  321. * @param :
  322. * @return :
  323. * @---------------------------------------------------
  324. */
  325. function fSrchOprPerfDrlist(oprsrvno, cOdt1)
  326. {
  327. model.removeNodeset("/root/tmpop/selectoplist");
  328. model.removeNodeset("/root/main/paminfo/list");
  329. var node = getGlobalVariable("paminfo");
  330. if(node != "" && node != null){
  331. setCSVToNode("/root/main/paminfo", node);
  332. model.makeValue("/root/send/pid", model.getValue("/root/main/paminfo/list/pid"));
  333. model.makeValue("/root/send/cretno", model.getValue("/root/main/paminfo/list/cretno"));
  334. if (model.getValue("/root/main/paminfo/list/ioflag") == "O")
  335. {
  336. model.makeValue("/root/send/orddd", model.getValue("/root/main/paminfo/list/orddd"));
  337. }
  338. else
  339. {
  340. model.makeValue("/root/send/orddd", model.getValue("/root/main/paminfo/list/indd"));
  341. }
  342. model.makeValue("/root/send/oprsrvno", oprsrvno);
  343. model.makeValue("/root/send/srchmode", "dr");
  344. //model.removeNodeset("/root/main/recinfo/recitem[degnitemno = '1']");
  345. if (submit("TRMRF04301"))
  346. {
  347. copyNodeset("/root/tmpop/selectoplist", "/root/tmpop/selectoplist", "replace", ivw_0000509001.model, model);
  348. ivw_0000509001.window.javascript.fAfterSrch();
  349. }
  350. if (submit("TRMRF04302"))
  351. {
  352. var perfdrid = model.getValue("/root/tmp/perfdr/perfdrid");
  353. var opfromdt = model.getValue("/root/tmp/perfdr/opfromdt");
  354. var opstdd = opfromdt.substring(0, 8);
  355. var opsttm = opfromdt.substring(8, 12);
  356. if (opstdd == "" || opstdd.length < 8)
  357. {
  358. opstdd = getCurrentDate();
  359. }
  360. if (opsttm == "" || opsttm.length < 4)
  361. {
  362. opsttm = getCurrentTime().substr(0, 4);
  363. }
  364. //var transopdd = opstdd.substr(0, 4) + "-" + opstdd.substr(4, 2) + "-" + opstdd.substr(6, 2)
  365. parent.window.javascript.fSetFormRec("formrecdd" , opstdd);
  366. parent.window.javascript.fSetFormRec("formrechm" , opsttm);
  367. parent.ipt_formrecdd.refresh();
  368. parent.ipt_formrectm.refresh();
  369. model.setValue("/root/main/recinfo/recitem[degnitemlevlcd='" + iSurg + "']/reccnts", opstdd); //수술일
  370. model.setValue("/root/main/recinfo/recitem[degnitemlevlcd='" + cOdt1 + "']/rectermcd", perfdrid);
  371. fChngDoct(cOdt1);
  372. }
  373. }
  374. }
  375. /**
  376. * @desc : 수술전 진단명 사이즈 조절
  377. * @
  378. * @param :
  379. * @return :
  380. * @---------------------------------------------------
  381. */
  382. function fSetSizeFormDiag()
  383. {
  384. ivw_0007983001.window.javascript.fInitPage(false, parseInt(ivw_0007983001.attribute("height")), parseInt(ivw_0007983001.attribute("width")), "ivw_0007983001", "수술전 진단명(Free text))");
  385. //ivw_0000521001.window.javascript.fInitPage(false, parseInt(ivw_0000521001.attribute("height")), parseInt(ivw_0000521001.attribute("width")), "ivw_0000521001", "수술후 진단명");
  386. }
  387. /**
  388. * @desc : 수술후 진단명 사이즈 조절
  389. * @
  390. * @param :
  391. * @return :
  392. * @---------------------------------------------------
  393. */
  394. function fSetSizeFormDiag1()
  395. {
  396. //ivw_0007983001.window.javascript.fInitPage(false, parseInt(ivw_0007983001.attribute("height")), parseInt(ivw_0007983001.attribute("width")), "ivw_0007983001", "수술전 진단명");
  397. ivw_0000521001.window.javascript.fInitPage(false, parseInt(ivw_0000521001.attribute("height")), parseInt(ivw_0000521001.attribute("width")), "ivw_0000521001", "수술후 진단명(Free text)");
  398. }
  399. /**
  400. * @desc : 서식 수술명 사이즈 조절
  401. * @
  402. * @param :
  403. * @return :
  404. * @---------------------------------------------------
  405. */
  406. function fSetSizeFormOpr()
  407. {
  408. //fFormReady();
  409. ivw_0000509001.window.javascript.fInitPage(false, parseInt(ivw_0000509001.attribute("height")), parseInt(ivw_0000509001.attribute("width")), "ivw_0000509001");
  410. }
  411. /*****************************************************************************
  412. 튜닝
  413. ******************************************************************************/
  414. var gLoadFormCnts = 0;
  415. /**
  416. * @group :
  417. * @ver : 2008.06.13
  418. * @by : snoweye
  419. * @---------------------------------------------------
  420. * @type : function
  421. * @access : private
  422. * @desc : 화면 로딩후 초기화 작업 수행
  423. * @param :
  424. * @return :
  425. * @---------------------------------------------------
  426. */
  427. function fFormReady()
  428. {
  429. grup_base.attribute("border-style") = "none";
  430. setSectionSize(gItemCds, 335, 350);
  431. //20080702 박종훈 추가
  432. //fInitialize();
  433. InitBtnImge(gItemCdsTextArea);
  434. InitBtnEtcRec(gItemCdsTextArea);
  435. InitBtnComn(gItemCdsTextArea);
  436. dispOnLoadComplete(COMN_FORM);
  437. // fCosignCheck();
  438. //2010.01.21
  439. //initCmbExtnList(gItemCds);
  440. }
  441. /**
  442. * @group :
  443. * @ver : 2008.06.13
  444. * @by : snoweye
  445. * @---------------------------------------------------
  446. * @type : function
  447. * @access : private
  448. * @desc : 부분서식 로딩
  449. * @param :
  450. * @return :
  451. * @---------------------------------------------------
  452. */
  453. function fLoadUnitForm()
  454. {
  455. initSection(gItemCds);
  456. }
  457. var diagcnt = 0;
  458. /**
  459. * @group :
  460. * @ver : 2008.06.13
  461. * @by : snoweye
  462. * @---------------------------------------------------
  463. * @type : function
  464. * @access : private
  465. * @desc : 부분서식 로딩후 후처리
  466. * @param :
  467. * @return :
  468. * @---------------------------------------------------
  469. */
  470. function fOnLoadComplete()
  471. {
  472. var rtn = false;
  473. var curLoadFormCd = getParameter("loadformcd");
  474. setParameter("loadformcd", "");
  475. var fstLevlItemCd = model.getValue(gPageInfo.forminfoRef + "/unitformmast[formcd='" + curLoadFormCd + "' and loaded != 'true']/orgsupdegnitemcd");
  476. var ivwObj = document.controls("ivw_" + fstLevlItemCd);
  477. var unitformload = model.getValue(gPageInfo.forminfoRef + "/unitformmast[formcd='" + curLoadFormCd + "' and loaded != 'true']/loaded");
  478. //if(ivwObj != null)
  479. if(ivwObj != null && unitformload != "true")
  480. {
  481. //ivwObj.window.javascript.setFstLevlItemCd(fstLevlItemCd);
  482. setFstLevlItemCd(ivwObj, curLoadFormCd);
  483. model.setValue(gPageInfo.forminfoRef + "/unitformmast[formcd='" + curLoadFormCd + "']/loaded", "true");
  484. }
  485. //수술전진단명 부분서식 로딩후 처리
  486. if(fstLevlItemCd == '0007983001')
  487. {
  488. fSetSizeFormDiag();
  489. }
  490. //수술후진단명 부분서식 로딩후 처리
  491. if(fstLevlItemCd == '0000521001')
  492. {
  493. fSetSizeFormDiag1();
  494. if (parent.window.javascript.fGetFormRec("status") == "C")
  495. {
  496. //rtn = fGetdiagFormOprsrvno(oprsrvno, iMcdnm, iMcdnm, iScdnm, iScdnm); //수술예약번호로 진단명 조회
  497. }
  498. }
  499. //수술명 부분서식 로딩후 처리
  500. if(fstLevlItemCd == '0000509001')
  501. {
  502. fSetSizeFormOpr();
  503. if (parent.window.javascript.fGetFormRec("status") == "C")
  504. {
  505. //fSrchOprPerfDrlist(oprsrvno, cOdt1); //환자정보로 수술명, 집도의 조회
  506. fClearComnFormData();
  507. dispOnLoadComplete(UNIT_FORM);
  508. }
  509. else if (parent.window.javascript.fGetFormRec("status") == "U")
  510. {
  511. // fCosignCheck();
  512. }
  513. }
  514. gLoadFormCnts++;
  515. if(gItemCds.length == gLoadFormCnts)
  516. {
  517. if (parent.window.javascript.fGetFormRec("status") == "U")
  518. {
  519. var anstmthdcd = parent.model.getValue("/root/main/recinfo/recitem[degnitemlevlcd='" + iMcdnm + "']/rectermcd");
  520. var mcdnm = parent.model.getValue("/root/main/recinfo/recitem[degnitemlevlcd='" + iMcdnm + "']/rectermnm");
  521. var anstmthdcdsub = parent.model.getValue("/root/main/recinfo/recitem[degnitemlevlcd='" + iScdnm + "']/rectermcd");
  522. var scdnm = parent.model.getValue("/root/main/recinfo/recitem[degnitemlevlcd='" + iScdnm + "']/rectermnm");
  523. var iptMObj = document.controls("ipt_mcdnm");
  524. var iptSObj = document.controls("ipt_scdnm");
  525. if (anstmthdcd != "" && mcdnm != "")
  526. {
  527. iptMObj.attribute("ref") = pageInfo.recItemRef + "[degnitemlevlcd='" + iMcdnm + "']/rectermnm";
  528. }
  529. else
  530. {
  531. iptMObj.attribute("ref") = pageInfo.recItemRef + "[degnitemlevlcd='" + iMcdnm + "']/reccnts";
  532. }
  533. if (anstmthdcdsub != "" && scdnm != "")
  534. {
  535. iptSObj.attribute("ref") = pageInfo.recItemRef + "[degnitemlevlcd='" + iScdnm + "']/rectermnm";
  536. }
  537. else
  538. {
  539. iptSObj.attribute("ref") = pageInfo.recItemRef + "[degnitemlevlcd='" + iScdnm + "']/reccnts";
  540. }
  541. iptMObj.refresh();
  542. iptSObj.refresh();
  543. }
  544. dispOnLoadComplete(UNIT_FORM);
  545. //서식 로딩 후 포커스 처리(2008-11-18 박종훈)
  546. SetDefFocusIVW(gItemCdsTextArea);
  547. }
  548. // if(!rtn)
  549. // {
  550. // return "oprfalse";
  551. // } else {
  552. // model.refresh();
  553. // }
  554. }
  555. /**
  556. * @group :
  557. * @ver : 2008.11.28
  558. * @by : jonghun
  559. * @---------------------------------------------------
  560. * @type : function
  561. * @access : private
  562. * @desc : 동일 서식이 떠있을 경우 내부 인스턴스 로딩 후 디폴트 조회내용 조회
  563. * @param :
  564. * @return :
  565. * @---------------------------------------------------
  566. */
  567. function fGetDefData()
  568. {
  569. fSetSizeFormOpr();
  570. operation = getGlobalVariable("operation").split("▩")[1];
  571. if(operation != null && operation != ""){
  572. oprsrvno = operation.split("▦")[0];
  573. perfdeptcd = operation.split("▦")[10];
  574. }
  575. dispOnLoadComplete(UNIT_FORM);
  576. /*
  577. if (parent.window.javascript.fGetFormRec("status") == "C")
  578. {
  579. fSrchOprPerfDrlist(oprsrvno, cOdt1); //환자정보로 수술명, 집도의 조회
  580. parent.window.javascript.fSetFormRec("extnflag", "opr");
  581. parent.window.javascript.fSetFormRec("oprsrvno", oprsrvno);
  582. //서식 로딩 후 포커스 처리(2008-11-18 박종훈)
  583. SetDefFocusIVW(gItemCdsTextArea);
  584. //수술예약번호 체크
  585. if(oprsrvno == "")
  586. {
  587. messageBox("수술예약이 되지 않은", "I005");
  588. grup_base.disabled = true;
  589. fBtnDisEnable(true);
  590. return;
  591. } else {
  592. fBtnDisEnable(false);
  593. }
  594. //집도과 체크
  595. if (perfdeptcd != getUserInfo("dutplcecd"))
  596. {
  597. messageBox("작성 권한이", "I004");
  598. grup_base.disabled = true;
  599. fBtnDisEnable(true);
  600. return;
  601. } else {
  602. fBtnDisEnable(false);
  603. }
  604. }*/
  605. }
  606. /**
  607. * @desc : 저장버튼 Disable
  608. * @
  609. * @param :
  610. * @return :
  611. * @authur : 박종훈
  612. */
  613. function fBtnDisEnable(flag)
  614. {
  615. if(flag)
  616. {
  617. parent.window.javascript.fDisalbeSave(flag);
  618. }
  619. else
  620. {
  621. parent.window.javascript.fDisalbeSave(flag);
  622. }
  623. }
  624. /**
  625. * @group :
  626. * @ver : 2008.06.13
  627. * @by : jonghun
  628. * @---------------------------------------------------
  629. * @type : function
  630. * @access : private
  631. * @desc : 코사인버튼처리
  632. * @param :
  633. * @return :
  634. * @---------------------------------------------------
  635. */
  636. function fCosignCheck()
  637. {
  638. return;
  639. if (parent.window.javascript.fGetFormRec("status") == "U" && parent.window.javascript.fGetFormRec("espiyn") == "Y")
  640. {
  641. //코사인 권한 관련 처리(2008-11-27 박종훈)
  642. model.makeValue("/root/authsend/pid", parent.window.javascript.fGetFormRec("pid"));
  643. model.makeValue("/root/authsend/indd", parent.window.javascript.fGetFormRec("orddd"));
  644. model.makeValue("/root/authsend/cretno", parent.window.javascript.fGetFormRec("cretno"));
  645. model.makeValue("/root/authsend/formcd", parent.window.javascript.fGetFormRec("formcd"));
  646. model.makeValue("/root/authsend/srcformcd", parent.window.javascript.fGetFormRec("srcformcd"));
  647. model.makeValue("/root/authsend/formkind" , "opr");
  648. model.makeValue("/root/authsend/oprsrvno" , parent.window.javascript.fGetFormRec("oprsrvno"));
  649. if(submit("TRMMR00802"))
  650. {
  651. if(model.getValue("/root/staffcoyn/authyn") == "Y")
  652. {
  653. //인증저장버튼과 코사인버튼처리
  654. parent.window.btn_cosign.attribute("left") = parent.window.btn_signsave.attribute("left");
  655. parent.window.btn_signsave.visible = false;
  656. parent.window.btn_cosign.visible = true;
  657. //임시저장버튼과 기록반려버튼처리
  658. parent.window.btn_resend.attribute("left") = parent.window.btn_tmpsave.attribute("left");
  659. parent.window.btn_tmpsave.visible = false;
  660. parent.window.btn_resend.visible = true;
  661. //기타버튼 disable처리
  662. parent.window.btn_init.disabled = true;
  663. parent.window.btn_preview.disabled = true;
  664. parent.window.btn_signsaveasnew.disabled = true;
  665. parent.window.btn_del.disabled = true;
  666. if (parent.window.javascript.fGetFormRec("cosign") == "Y")
  667. {
  668. parent.window.btn_cosign.disabled = true;
  669. grup_base.disabled = true;
  670. }
  671. else
  672. {
  673. parent.window.btn_cosign.disabled = false;
  674. grup_base.disabled = false;
  675. }
  676. }
  677. else
  678. {
  679. //인증저장버튼과 코사인버튼처리
  680. parent.window.btn_signsave.visible = true;
  681. parent.window.btn_cosign.visible = false;
  682. //임시저장버튼과 기록반려버튼처리
  683. parent.window.btn_tmpsave.visible = true;
  684. parent.window.btn_resend.visible = false;
  685. //기타버튼 disable처리
  686. parent.window.btn_init.disabled = false;
  687. parent.window.btn_preview.disabled = false;
  688. parent.window.btn_signsaveasnew.disabled = false;
  689. parent.window.btn_del.disabled = false;
  690. }
  691. }
  692. }
  693. }
  694. /**
  695. * MMR01300.js에서 submit직전에 submitID를 설정하기 위해서 호출한다.
  696. * @return
  697. */
  698. function getSubmitID_MMR01300I() {
  699. // if (model.getValue("/root/main/extninfo/staffauthinfo/authyn") == "Y") {
  700. // //
  701. // } else {
  702. // parent.window.javascript.fSetFormRec("addexecflag", "cosign");
  703. // }
  704. parent.window.javascript.fSetFormRec("extnflag", "opr");
  705. parent.window.javascript.fSetFormRec("addexecflag", "cosign");
  706. return TX_SUBMIT_EXTN_FORM;
  707. }
  708. /**
  709. * MMR01100.js에서 서식load를 완료한 후에 호출한다.
  710. * @return
  711. */
  712. function initFormAtLast_MMR01100I() {
  713. var flag = false;
  714. if (parent.window.javascript.fGetFormRec("status") == "C" ) {
  715. flag = true;
  716. model.makeValue("/root/send/extninfo/infoflag", "opr");
  717. model.makeValue("/root/send/extninfo/oprsrvno", parent.window.javascript.fGetFormRec("oprsrvno"));
  718. } else if (parent.window.javascript.fGetFormRec("status") == "U" ) {
  719. if (parent.window.javascript.fGetFormRec("espiyn") == "Y") {
  720. flag = true;
  721. model.makeValue("/root/send/extninfo/infoflag", "staffauth");
  722. model.makeValue("/root/send/extninfo/pid", parent.window.javascript.fGetFormRec("pid"));
  723. model.makeValue("/root/send/extninfo/formrecdd", parent.window.javascript.fGetFormRec("formrecdd"));
  724. model.makeValue("/root/send/extninfo/srcformcd", parent.window.javascript.fGetFormRec("srcformcd"));
  725. }
  726. }
  727. if (flag && submit("TRMMR01302")) {
  728. if (model.getValue("/root/send/extninfo/infoflag").indexOf("staffauth") > -1) {
  729. fCosignCheck_SMMMR00600();
  730. }
  731. if (model.getValue("/root/send/extninfo/infoflag").indexOf("opr") > -1) {
  732. fSetOpInfo_SMMMR00600();
  733. }
  734. }
  735. }
  736. function fSetOpInfo_SMMMR00600() {
  737. }
  738. /**
  739. * @desc : staff-sign 버튼을 설정한다.
  740. * @
  741. * @param :
  742. * @return :
  743. * @authur : acwon 20091218
  744. */
  745. function fCosignCheck_SMMMR00600() {
  746. if (parent.window.javascript.fGetFormRec("formrecdeptcd") == getUserInfo("dutplcecd")) {
  747. if (parent.window.javascript.fGetFormRec("espiyn") == "Y") {
  748. var authyn = model.getValue("/root/main/extninfo/staffauthinfo/authyn");
  749. var cosign = parent.window.javascript.fGetFormRec("cosign");
  750. if (cosign == "Y") {
  751. if (parent.window.javascript.fGetFormRec("cosignid") == getUserId()) {
  752. if (parent.window.javascript.fGetFormRec("formrecuserid") == getUserId()) {
  753. //staff이 신규작성하여 sign된 경우 수정모드
  754. parent.window.javascript.initButtonLayer_MMR01100("staff_auth_n");
  755. } else {
  756. //전공의가 신규작성하여 staff이 sign한 경우 싸인모드
  757. parent.window.javascript.initButtonLayer_MMR01100("staff_auth_y");
  758. }
  759. } else {
  760. //staff sign이후이므로 staff이외에는 수정불가
  761. parent.window.javascript.initButtonLayer_MMR01100("no_auth");
  762. }
  763. } else {
  764. if (authyn == "Y") {
  765. //전공의 신규작성후에 staff이 수정모드로 열었으므로, 싸인모드
  766. parent.window.javascript.initButtonLayer_MMR01100("staff_auth_y");
  767. } else {
  768. //수정모드
  769. parent.window.javascript.initButtonLayer_MMR01100("staff_auth_n");
  770. }
  771. }
  772. } else {
  773. //수정모드
  774. parent.window.javascript.initButtonLayer_MMR01100("staff_auth_n");
  775. }
  776. } else {
  777. parent.window.javascript.initButtonLayer_MMR01100("no_auth");
  778. }
  779. }