MMR00600.js 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910
  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. //2010.02.03 dhkim - 수술기록 없을때 현재일자세팅하지 않음
  357. /*
  358. if (opstdd == "" || opstdd.length < 8)
  359. {
  360. opstdd = getCurrentDate();
  361. }
  362. */
  363. if (opsttm == "" || opsttm.length < 4)
  364. {
  365. opsttm = getCurrentTime().substr(0, 4);
  366. }
  367. //var transopdd = opstdd.substr(0, 4) + "-" + opstdd.substr(4, 2) + "-" + opstdd.substr(6, 2)
  368. //2010.02.03 dhkim - 수술기록 있을때만 일자세팅
  369. if(opstdd != "" && opstdd.length == 8){
  370. parent.window.javascript.fSetFormRec("formrecdd" , opstdd);
  371. parent.window.javascript.fSetFormRec("formrechm" , opsttm);
  372. parent.ipt_formrecdd.refresh();
  373. parent.ipt_formrectm.refresh();
  374. }
  375. model.setValue("/root/main/recinfo/recitem[degnitemlevlcd='" + iSurg + "']/reccnts", opstdd); //수술일
  376. model.setValue("/root/main/recinfo/recitem[degnitemlevlcd='" + cOdt1 + "']/rectermcd", perfdrid);
  377. fChngDoct(cOdt1);
  378. }
  379. }
  380. }
  381. /**
  382. * @desc : 수술전 진단명 사이즈 조절
  383. * @
  384. * @param :
  385. * @return :
  386. * @---------------------------------------------------
  387. */
  388. function fSetSizeFormDiag()
  389. {
  390. ivw_0007983001.window.javascript.fInitPage(false, parseInt(ivw_0007983001.attribute("height")), parseInt(ivw_0007983001.attribute("width")), "ivw_0007983001", "수술전 진단명(Free text))");
  391. //ivw_0000521001.window.javascript.fInitPage(false, parseInt(ivw_0000521001.attribute("height")), parseInt(ivw_0000521001.attribute("width")), "ivw_0000521001", "수술후 진단명");
  392. }
  393. /**
  394. * @desc : 수술후 진단명 사이즈 조절
  395. * @
  396. * @param :
  397. * @return :
  398. * @---------------------------------------------------
  399. */
  400. function fSetSizeFormDiag1()
  401. {
  402. //ivw_0007983001.window.javascript.fInitPage(false, parseInt(ivw_0007983001.attribute("height")), parseInt(ivw_0007983001.attribute("width")), "ivw_0007983001", "수술전 진단명");
  403. ivw_0000521001.window.javascript.fInitPage(false, parseInt(ivw_0000521001.attribute("height")), parseInt(ivw_0000521001.attribute("width")), "ivw_0000521001", "수술후 진단명(Free text)");
  404. }
  405. /**
  406. * @desc : 서식 수술명 사이즈 조절
  407. * @
  408. * @param :
  409. * @return :
  410. * @---------------------------------------------------
  411. */
  412. function fSetSizeFormOpr()
  413. {
  414. //fFormReady();
  415. ivw_0000509001.window.javascript.fInitPage(false, parseInt(ivw_0000509001.attribute("height")), parseInt(ivw_0000509001.attribute("width")), "ivw_0000509001");
  416. }
  417. /*****************************************************************************
  418. 튜닝
  419. ******************************************************************************/
  420. var gLoadFormCnts = 0;
  421. /**
  422. * @group :
  423. * @ver : 2008.06.13
  424. * @by : snoweye
  425. * @---------------------------------------------------
  426. * @type : function
  427. * @access : private
  428. * @desc : 화면 로딩후 초기화 작업 수행
  429. * @param :
  430. * @return :
  431. * @---------------------------------------------------
  432. */
  433. function fFormReady()
  434. {
  435. grup_base.attribute("border-style") = "none";
  436. setSectionSize(gItemCds, 335, 350);
  437. //20080702 박종훈 추가
  438. //fInitialize();
  439. InitBtnImge(gItemCdsTextArea);
  440. InitBtnEtcRec(gItemCdsTextArea);
  441. InitBtnComn(gItemCdsTextArea);
  442. dispOnLoadComplete(COMN_FORM);
  443. // fCosignCheck();
  444. //2010.01.21
  445. initCmbExtnList(gItemCds);
  446. }
  447. /**
  448. * @group :
  449. * @ver : 2008.06.13
  450. * @by : snoweye
  451. * @---------------------------------------------------
  452. * @type : function
  453. * @access : private
  454. * @desc : 부분서식 로딩
  455. * @param :
  456. * @return :
  457. * @---------------------------------------------------
  458. */
  459. function fLoadUnitForm()
  460. {
  461. initSection(gItemCds);
  462. }
  463. var diagcnt = 0;
  464. /**
  465. * @group :
  466. * @ver : 2008.06.13
  467. * @by : snoweye
  468. * @---------------------------------------------------
  469. * @type : function
  470. * @access : private
  471. * @desc : 부분서식 로딩후 후처리
  472. * @param :
  473. * @return :
  474. * @---------------------------------------------------
  475. */
  476. function fOnLoadComplete()
  477. {
  478. var rtn = false;
  479. var curLoadFormCd = getParameter("loadformcd");
  480. setParameter("loadformcd", "");
  481. var fstLevlItemCd = model.getValue(gPageInfo.forminfoRef + "/unitformmast[formcd='" + curLoadFormCd + "' and loaded != 'true']/orgsupdegnitemcd");
  482. var ivwObj = document.controls("ivw_" + fstLevlItemCd);
  483. var unitformload = model.getValue(gPageInfo.forminfoRef + "/unitformmast[formcd='" + curLoadFormCd + "' and loaded != 'true']/loaded");
  484. //if(ivwObj != null)
  485. if(ivwObj != null && unitformload != "true")
  486. {
  487. //ivwObj.window.javascript.setFstLevlItemCd(fstLevlItemCd);
  488. setFstLevlItemCd(ivwObj, curLoadFormCd);
  489. model.setValue(gPageInfo.forminfoRef + "/unitformmast[formcd='" + curLoadFormCd + "']/loaded", "true");
  490. }
  491. //수술전진단명 부분서식 로딩후 처리
  492. if(fstLevlItemCd == '0007983001')
  493. {
  494. fSetSizeFormDiag();
  495. }
  496. //수술후진단명 부분서식 로딩후 처리
  497. if(fstLevlItemCd == '0000521001')
  498. {
  499. fSetSizeFormDiag1();
  500. if (parent.window.javascript.fGetFormRec("status") == "C")
  501. {
  502. //rtn = fGetdiagFormOprsrvno(oprsrvno, iMcdnm, iMcdnm, iScdnm, iScdnm); //수술예약번호로 진단명 조회
  503. }
  504. }
  505. //수술명 부분서식 로딩후 처리
  506. if(fstLevlItemCd == '0000509001')
  507. {
  508. fSetSizeFormOpr();
  509. if (parent.window.javascript.fGetFormRec("status") == "C")
  510. {
  511. //fSrchOprPerfDrlist(oprsrvno, cOdt1); //환자정보로 수술명, 집도의 조회
  512. fClearComnFormData();
  513. dispOnLoadComplete(UNIT_FORM);
  514. }
  515. else if (parent.window.javascript.fGetFormRec("status") == "U")
  516. {
  517. // fCosignCheck();
  518. }
  519. }
  520. gLoadFormCnts++;
  521. if(gItemCds.length == gLoadFormCnts)
  522. {
  523. if (parent.window.javascript.fGetFormRec("status") == "U")
  524. {
  525. var anstmthdcd = parent.model.getValue("/root/main/recinfo/recitem[degnitemlevlcd='" + iMcdnm + "']/rectermcd");
  526. var mcdnm = parent.model.getValue("/root/main/recinfo/recitem[degnitemlevlcd='" + iMcdnm + "']/rectermnm");
  527. var anstmthdcdsub = parent.model.getValue("/root/main/recinfo/recitem[degnitemlevlcd='" + iScdnm + "']/rectermcd");
  528. var scdnm = parent.model.getValue("/root/main/recinfo/recitem[degnitemlevlcd='" + iScdnm + "']/rectermnm");
  529. var iptMObj = document.controls("ipt_mcdnm");
  530. var iptSObj = document.controls("ipt_scdnm");
  531. if (anstmthdcd != "" && mcdnm != "")
  532. {
  533. iptMObj.attribute("ref") = pageInfo.recItemRef + "[degnitemlevlcd='" + iMcdnm + "']/rectermnm";
  534. }
  535. else
  536. {
  537. iptMObj.attribute("ref") = pageInfo.recItemRef + "[degnitemlevlcd='" + iMcdnm + "']/reccnts";
  538. }
  539. if (anstmthdcdsub != "" && scdnm != "")
  540. {
  541. iptSObj.attribute("ref") = pageInfo.recItemRef + "[degnitemlevlcd='" + iScdnm + "']/rectermnm";
  542. }
  543. else
  544. {
  545. iptSObj.attribute("ref") = pageInfo.recItemRef + "[degnitemlevlcd='" + iScdnm + "']/reccnts";
  546. }
  547. iptMObj.refresh();
  548. iptSObj.refresh();
  549. }
  550. dispOnLoadComplete(UNIT_FORM);
  551. //서식 로딩 후 포커스 처리(2008-11-18 박종훈)
  552. SetDefFocusIVW(gItemCdsTextArea);
  553. }
  554. // if(!rtn)
  555. // {
  556. // return "oprfalse";
  557. // } else {
  558. // model.refresh();
  559. // }
  560. }
  561. /**
  562. * @group :
  563. * @ver : 2008.11.28
  564. * @by : jonghun
  565. * @---------------------------------------------------
  566. * @type : function
  567. * @access : private
  568. * @desc : 동일 서식이 떠있을 경우 내부 인스턴스 로딩 후 디폴트 조회내용 조회
  569. * @param :
  570. * @return :
  571. * @---------------------------------------------------
  572. */
  573. function fGetDefData()
  574. {
  575. fSetSizeFormOpr();
  576. operation = getGlobalVariable("operation").split("▩")[1];
  577. if(operation != null && operation != ""){
  578. oprsrvno = operation.split("▦")[0];
  579. perfdeptcd = operation.split("▦")[10];
  580. }
  581. dispOnLoadComplete(UNIT_FORM);
  582. /*
  583. if (parent.window.javascript.fGetFormRec("status") == "C")
  584. {
  585. fSrchOprPerfDrlist(oprsrvno, cOdt1); //환자정보로 수술명, 집도의 조회
  586. parent.window.javascript.fSetFormRec("extnflag", "opr");
  587. parent.window.javascript.fSetFormRec("oprsrvno", oprsrvno);
  588. //서식 로딩 후 포커스 처리(2008-11-18 박종훈)
  589. SetDefFocusIVW(gItemCdsTextArea);
  590. //수술예약번호 체크
  591. if(oprsrvno == "")
  592. {
  593. messageBox("수술예약이 되지 않은", "I005");
  594. grup_base.disabled = true;
  595. fBtnDisEnable(true);
  596. return;
  597. } else {
  598. fBtnDisEnable(false);
  599. }
  600. //집도과 체크
  601. if (perfdeptcd != getUserInfo("dutplcecd"))
  602. {
  603. messageBox("작성 권한이", "I004");
  604. grup_base.disabled = true;
  605. fBtnDisEnable(true);
  606. return;
  607. } else {
  608. fBtnDisEnable(false);
  609. }
  610. }*/
  611. }
  612. /**
  613. * @desc : 저장버튼 Disable
  614. * @
  615. * @param :
  616. * @return :
  617. * @authur : 박종훈
  618. */
  619. function fBtnDisEnable(flag)
  620. {
  621. if(flag)
  622. {
  623. parent.window.javascript.fDisalbeSave(flag);
  624. }
  625. else
  626. {
  627. parent.window.javascript.fDisalbeSave(flag);
  628. }
  629. }
  630. /**
  631. * @group :
  632. * @ver : 2008.06.13
  633. * @by : jonghun
  634. * @---------------------------------------------------
  635. * @type : function
  636. * @access : private
  637. * @desc : 코사인버튼처리
  638. * @param :
  639. * @return :
  640. * @---------------------------------------------------
  641. */
  642. function fCosignCheck()
  643. {
  644. return;
  645. /*
  646. if (parent.window.javascript.fGetFormRec("status") == "U" && parent.window.javascript.fGetFormRec("espiyn") == "Y")
  647. {
  648. //코사인 권한 관련 처리(2008-11-27 박종훈)
  649. model.makeValue("/root/authsend/pid", parent.window.javascript.fGetFormRec("pid"));
  650. model.makeValue("/root/authsend/indd", parent.window.javascript.fGetFormRec("orddd"));
  651. model.makeValue("/root/authsend/cretno", parent.window.javascript.fGetFormRec("cretno"));
  652. model.makeValue("/root/authsend/formcd", parent.window.javascript.fGetFormRec("formcd"));
  653. model.makeValue("/root/authsend/srcformcd", parent.window.javascript.fGetFormRec("srcformcd"));
  654. model.makeValue("/root/authsend/formkind" , "opr");
  655. model.makeValue("/root/authsend/oprsrvno" , parent.window.javascript.fGetFormRec("oprsrvno"));
  656. if(submit("TRMMR00802"))
  657. {
  658. if(model.getValue("/root/staffcoyn/authyn") == "Y")
  659. {
  660. //인증저장버튼과 코사인버튼처리
  661. parent.window.btn_cosign.attribute("left") = parent.window.btn_signsave.attribute("left");
  662. parent.window.btn_signsave.visible = false;
  663. parent.window.btn_cosign.visible = true;
  664. //임시저장버튼과 기록반려버튼처리
  665. parent.window.btn_resend.attribute("left") = parent.window.btn_tmpsave.attribute("left");
  666. parent.window.btn_tmpsave.visible = false;
  667. parent.window.btn_resend.visible = true;
  668. //기타버튼 disable처리
  669. parent.window.btn_init.disabled = true;
  670. parent.window.btn_preview.disabled = true;
  671. parent.window.btn_signsaveasnew.disabled = true;
  672. parent.window.btn_del.disabled = true;
  673. if (parent.window.javascript.fGetFormRec("cosign") == "Y")
  674. {
  675. parent.window.btn_cosign.disabled = true;
  676. grup_base.disabled = true;
  677. }
  678. else
  679. {
  680. parent.window.btn_cosign.disabled = false;
  681. grup_base.disabled = false;
  682. }
  683. }
  684. else
  685. {
  686. //인증저장버튼과 코사인버튼처리
  687. parent.window.btn_signsave.visible = true;
  688. parent.window.btn_cosign.visible = false;
  689. //임시저장버튼과 기록반려버튼처리
  690. parent.window.btn_tmpsave.visible = true;
  691. parent.window.btn_resend.visible = false;
  692. //기타버튼 disable처리
  693. parent.window.btn_init.disabled = false;
  694. parent.window.btn_preview.disabled = false;
  695. parent.window.btn_signsaveasnew.disabled = false;
  696. parent.window.btn_del.disabled = false;
  697. }
  698. }
  699. }
  700. */
  701. }
  702. /**
  703. * MMR01300.js에서 submit직전에 submitID를 설정하기 위해서 호출한다.
  704. * @return
  705. */
  706. function getSubmitID_MMR01300I() {
  707. parent.window.javascript.fSetFormRec("extnflag", "opr");
  708. return TX_SUBMIT_EXTN_FORM;
  709. }
  710. /**
  711. * MMR01100.js에서 서식load를 완료한 후에 호출한다.
  712. * @return
  713. */
  714. function initFormAtLast_MMR01100I() {
  715. var flag = false;
  716. if (parent.window.javascript.fGetFormRec("status") == "C" ) {
  717. flag = true;
  718. model.makeValue("/root/send/extninfo/infoflag", "opr");
  719. model.makeValue("/root/send/extninfo/oprsrvno", parent.window.javascript.fGetFormRec("oprsrvno"));
  720. } else if (parent.window.javascript.fGetFormRec("status") == "U" ) {
  721. if (parent.window.javascript.fGetFormRec("espiyn") == "Y") {
  722. flag = true;
  723. model.makeValue("/root/send/extninfo/infoflag", "staffauth");
  724. model.makeValue("/root/send/extninfo/pid", parent.window.javascript.fGetFormRec("pid"));
  725. model.makeValue("/root/send/extninfo/formrecdd", parent.window.javascript.fGetFormRec("formrecdd"));
  726. model.makeValue("/root/send/extninfo/srcformcd", parent.window.javascript.fGetFormRec("srcformcd"));
  727. model.makeValue("/root/send/extninfo/formrecseq", parent.window.javascript.fGetFormRec("formrecseq"));
  728. }
  729. }
  730. if (flag && submit("TRMMR01302")) {
  731. if (model.getValue("/root/send/extninfo/infoflag").indexOf("staffauth") > -1) {
  732. fCosignCheck_SMMMR00600();
  733. }
  734. if (model.getValue("/root/send/extninfo/infoflag").indexOf("opr") > -1) {
  735. fSetOpInfo_SMMMR00600();
  736. }
  737. }
  738. }
  739. function fSetOpInfo_SMMMR00600() {
  740. }
  741. /**
  742. * @desc : staff-sign 버튼을 설정한다.
  743. * @
  744. * @param :
  745. * @return :
  746. * @authur : acwon 20091218
  747. */
  748. function fCosignCheck_SMMMR00600() {
  749. if (parent.window.javascript.fGetFormRec("formrecdeptcd") == getUserInfo("dutplcecd")) {
  750. if (parent.window.javascript.fGetFormRec("espiyn") == "Y") {
  751. var authyn = model.getValue("/root/main/extninfo/staffauthinfo/authyn");
  752. var cosign = parent.window.javascript.fGetFormRec("cosign");
  753. if (cosign == "Y") {
  754. if (parent.window.javascript.fGetFormRec("cosignid") == getUserId()) {
  755. if (parent.window.javascript.fGetFormRec("formrecuserid") == getUserId()) {
  756. //staff이 신규작성하여 sign된 경우 수정모드
  757. parent.window.javascript.initButtonLayer_MMR01100("staff_auth_n");
  758. } else {
  759. //전공의가 신규작성하여 staff이 sign한 경우 싸인모드
  760. parent.window.javascript.initButtonLayer_MMR01100("staff_auth_y");
  761. }
  762. } else {
  763. //staff sign이후이므로 staff이외에는 수정불가
  764. parent.window.javascript.initButtonLayer_MMR01100("no_auth");
  765. }
  766. } else {
  767. if (authyn == "Y") {
  768. //전공의 신규작성후에 staff이 수정모드로 열었으므로, 싸인모드
  769. parent.window.javascript.initButtonLayer_MMR01100("staff_auth_y");
  770. } else {
  771. //수정모드
  772. parent.window.javascript.initButtonLayer_MMR01100("staff_auth_n");
  773. }
  774. }
  775. } else {
  776. //수정모드
  777. parent.window.javascript.initButtonLayer_MMR01100("staff_auth_n");
  778. }
  779. } else {
  780. parent.window.javascript.initButtonLayer_MMR01100("no_auth");
  781. }
  782. }