MMR04900.js 73 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977
  1. var gItemCds = new Array("0000960001", "0011449001", "0001019001", "0011529001");
  2. var gItemCdsTextArea = new Array("0011449001", "0011529001");
  3. var gItemCdsXRWArea = new Array("0000960001", "0001019001");
  4. var gPageIdx = new Array(0, 0);
  5. var instance = document.models(0).instances(0);
  6. var gdeptcd = "";
  7. var cnstflag = parent.window.javascript.getParameter("SMMMR04900_cnstflag");
  8. // 20131120 소화기내시경의뢰서 사이즈 확장으로 인해서 사용한 변수
  9. var chknum = 0;
  10. var mtxh = null;
  11. var ivwfrmh = null;
  12. var tar11529001t = null;
  13. var tar11529001h = null;
  14. var grp11529001h = null;
  15. var grp11529001t = null;
  16. var ivw11449001h = null;
  17. var grp11449001h = null;
  18. var grpcnth = null;
  19. /**
  20. * @desc : 확장버튼(이미지,가계도,추가기록)을 기록여부에 따라 표시를 위한 버튼목록
  21. * @id :
  22. * @authur : 안치원
  23. * @history : 2009.09.09 신규 안치원 ACW_090909A
  24. */
  25. var gExtnBtnIds = new Array("btn_etcrec_0011449001", "btn_imge_0011449001",
  26. "btn_etcrec_0011529001", "btn_imge_0011529001");
  27. /**
  28. * @desc : 화면 초기화
  29. * @
  30. * @param :
  31. * @return :
  32. * @authur : 박종훈
  33. * @---------------------------------------------------
  34. */
  35. function fFormReady_old()
  36. {
  37. lbl_0011449001.attribute("width") = "593";
  38. lbl_0011529001.attribute("width") = "593";
  39. ivw_0000960001.attribute("width") = "593";
  40. ivw_0011449001.attribute("width") = "593";
  41. ivw_0001019001.attribute("width") = "593";
  42. ivw_0011529001.attribute("width") = "593";
  43. ipt_formnm.attribute("top") = ipt_recdoct.attribute("top");
  44. ipt_formnm.attribute("left") = ipt_recdoct.attribute("left");
  45. //fSetViewMode("0");
  46. parent.window.javascript.fSetFormNm("Consult");
  47. // if (submit("TRMMR04901") && submit("TRMMR04902"))
  48. // {
  49. // fSortCnstDpList(); //컨설트 구분
  50. // }
  51. // else
  52. // {
  53. // }
  54. parent.window.javascript.fEndFormReady("SMMMR04900");
  55. if (opener.window.javascript.getParameter("SMMMR04900_newcnstform") == "Y")
  56. parent.window.javascript.fEndFormReady("SMMMR04900_newcnstform");
  57. }
  58. /**
  59. * @desc : 수신부서 선택 시 이벤트
  60. * @
  61. * @param :
  62. * @return :
  63. * @authur : 박종훈
  64. * @---------------------------------------------------
  65. */
  66. function fAfterChoiRecvDeptCd(formcd)
  67. {
  68. SetUserTimeLog("MMR04900", "fAfterChoiRecvDeptCd", parent.model);
  69. var deptcd = model.getValue("/root/init/cond/rscdeptcd");
  70. parent.window.javascript.setParameter("userdeptcd", deptcd);
  71. var cnstdeptcd = parent.window.javascript.getParameter("SMMMR04900_cnstdeptcd");
  72. var cnstdeptnm = model.getXPathValue("/root/main/cnstformlist/cnstform[cnstdeptcd='"+cnstdeptcd+"']/cnstdeptnm");
  73. model.setValue("/root/init/cond/cnstflag", cnstflag);
  74. fSetViewMode(cnstflag);
  75. if (cnstflag == "1")
  76. {
  77. var drid = parent.window.javascript.getParameter("SMMMR04900_drid");
  78. var drnm = model.getXPathValue("/root/init/recvrlist/usercombo[userid='"+drid+"']/usernm");
  79. var hopedd = parent.window.javascript.getParameter("SMMMR04900_hopedd");
  80. formcd = model.getXPathValue("/root/main/cnstformlist/cnstform[cnstdeptcd='"+deptcd+"']/formcd");
  81. model.setValue("/root/init/cond/formcd", formcd);
  82. fSetOpenFormCd();
  83. }
  84. else if (cnstflag == "3")
  85. {
  86. ipt_formnm.visible = true;
  87. cap_mode1.visible = true;
  88. var formnm = parent.window.javascript.getParameter("SMMMR04900_formnm");
  89. var formcd = parent.window.javascript.getParameter("SMMMR04900_formcd");
  90. model.setValue("/root/init/cond/formnm", formnm);
  91. model.setValue("/root/init/cond/formcd", formcd);
  92. fSetOpenFormCd();
  93. }
  94. else
  95. {
  96. alert("Consult대상부서가 아닙니다.");
  97. return false;
  98. }
  99. return true;
  100. }
  101. /**
  102. * @desc : 컨설트 서식 오픈시 이벤트
  103. * @
  104. * @param :
  105. * @return :
  106. * @authur : 박종훈
  107. * @---------------------------------------------------
  108. */
  109. function fOpenCnstForm(formcd, deptcd, cnstflag)
  110. {
  111. SetUserTimeLog("MMR04900", "fOpenCnstForm", parent.model);
  112. parent.window.javascript.setParameter("userdeptcd", deptcd)
  113. model.setValue("/root/init/cond/cnstflag", cnstflag);
  114. fSetViewMode(cnstflag);
  115. if (cnstflag == "1")
  116. {
  117. // btn_sch.attribute("visibility") = "visible";
  118. // reqGetDrList("/root/init/reqdata", "/root/init/drlist", deptcd, "");
  119. formcd = model.getXPathValue("/root/main/cnstformlist/cnstform[cnstdeptcd='"+deptcd+"']/formcd");
  120. model.setValue("/root/init/cond/formcd", formcd);
  121. fSetOpenFormCd();
  122. }
  123. else if (cnstflag == "3")
  124. {
  125. //btn_sch.attribute("visibility") = "hidden";
  126. //aa.aa();
  127. var path = "";
  128. if (formcd == null)
  129. {
  130. path = "/root/main/cnstformlist/cnstform[cnstdeptcd='"+deptcd+"']";
  131. copyNodeset("/root/main/cmbformlist/cnstform", path, "replace", model, model);
  132. }
  133. else
  134. {
  135. path = "/root/main/cnstformlist/cnstform[formcd='"+formcd+"']";
  136. copyNodeset("/root/main/cmbformlist/cnstform", path, "replace", model, model);
  137. }
  138. var cnt = getNodesetCnt(model, path);
  139. if (cnt == 1)
  140. {
  141. ipt_formnm.visible = false;
  142. cap_mode1.visible = false;
  143. formcd = model.getValue(path+"/formcd");
  144. model.setValue("/root/init/cond/formcd", formcd);
  145. fSetOpenFormCd();
  146. }
  147. else
  148. {
  149. ipt_formnm.visible = true;
  150. cap_mode1.visible = true;
  151. }
  152. }
  153. else
  154. {
  155. alert("Consult대상부서가 아닙니다.");
  156. return false;
  157. }
  158. return true;
  159. }
  160. /**
  161. * @desc : 진료, 타과의뢰시 서식 항목 표현 설정
  162. * @
  163. * @param :
  164. * @return :
  165. * @authur : 박종훈
  166. * @---------------------------------------------------
  167. */
  168. function fSetViewMode(cnstflag)
  169. {
  170. if (cnstflag == "0")
  171. {
  172. grup_cnts.visible = false;
  173. }
  174. if (cnstflag == "1")
  175. {
  176. cap_mode1.text = "수신자";
  177. cap_hordt.visible = false;
  178. ipt_hordtm.visible = false;
  179. ipt_recdoct.visible = true;
  180. cmb_recdoct.visible = true;
  181. ipt_formnm.visible = false;
  182. }
  183. else if (cnstflag == "3")
  184. {
  185. cap_mode1.text = "의뢰항목";
  186. cap_hordt.visible = false;
  187. ipt_hordtm.visible = false;
  188. /* 20121112 정창혁 지원부서의뢰신규 수신의추가로 인한 변경 아래로 대체
  189. ipt_recdoct.visible = false;
  190. cmb_recdoct.visible = false;
  191. cmb_recdept.visible = false;
  192. ipt_formnm.visible = true;
  193. */
  194. ipt_recdoct.visible = false;
  195. cmb_recdoct.visible = true;
  196. cmb_recdept.visible = false;
  197. ipt_formnm.visible = true;
  198. }
  199. }
  200. /**
  201. * @desc : 오픈된 서식코드 셋팅
  202. * @
  203. * @param :
  204. * @return :
  205. * @authur : 박종훈
  206. * @---------------------------------------------------
  207. */
  208. function fSetOpenFormCd()
  209. {
  210. SetUserTimeLog("MMR04900", "fSetOpenFormCd", parent.model);
  211. grup_cnts.visible = true;
  212. var formcd = parent.window.javascript.getParameter("SMMMR04900_formcd");
  213. //parent.window.javascript.fLoadNewForm(formcd);
  214. }
  215. /**
  216. * @desc : 서식 오픈
  217. * @
  218. * @param :
  219. * @return :
  220. * @authur : 박종훈
  221. * @---------------------------------------------------
  222. */
  223. function fLoadForm_old()
  224. {
  225. SetUserTimeLog("MMR04900", "fLoadForm", parent.model);
  226. InitUnitForm(gItemCdsTextArea, gPageIdx, 1, grup_cnts);
  227. InitSetUnitForm(gItemCdsXRWArea, false);
  228. body.visible = true;
  229. makeRefByDegnitemno();
  230. fExtnInitFormRec();
  231. parent.window.javascript.gSubmitID = TX_SUBMIT_EXTN_FORM;
  232. gFstItemCds = new Array("0011449001", "0011449001", "0011529001", "0011529001");
  233. if (parent.javascript.fGetFormMast("formcd") == "0000000692" || parent.javascript.fGetFormMast("formcd")=="1600017738")
  234. btn_homenurord.attribute("visibility") = "visible";
  235. else
  236. btn_homenurord.attribute("visibility") = "hidden";
  237. }
  238. /**
  239. * @desc : 서식 내용 초기화
  240. * @
  241. * @param :
  242. * @return :
  243. * @authur : 박종훈
  244. * @---------------------------------------------------
  245. */
  246. function fClearComnFormData()
  247. {
  248. ClearComnFormData(gItemCds);
  249. clearData();
  250. //fExtnInitFormRec(); //2008-07-05 기록을 위한 초기화
  251. /*var ivwfrm = document.controls("ivw_0011449001");
  252. var diagnm = getParameter("SSMRF04000_diagnm");
  253. if (diagnm != "" && cnstflag == "1")
  254. {
  255. var reqcnt = "상기 환자는 진단명[" + diagnm + "](으)로 현재 치료중인 환자입니다.";
  256. ivwfrm.model.setValue("/root/main/recinfo/recitem[degnitemcd='0000146001' and degnitemlevlcd = '0011449.0000146']/reccnts", reqcnt);
  257. model.refresh();
  258. }*/
  259. }
  260. /**
  261. * @desc : 기록 내용 조회 및 조회 후 처리 로직
  262. * @
  263. * @param :
  264. * @return :
  265. * @authur : 박종훈
  266. * @---------------------------------------------------
  267. */
  268. function fLoadData()
  269. {
  270. InitPgmFormData();
  271. this.recRef2 = "/root/hidden/recinfo";
  272. InitUnitFormData(gItemCds);
  273. model.setValue("/root/send/formrecseq", parent.window.javascript.fGetFormRec("formrecseq"));
  274. model.setValue("/root/send/userdeptcd", parent.window.javascript.getParameter("userdeptcd"));
  275. //alert(parent.window.javascript.fGetFormRec("formrecseq") + ", " + parent.window.javascript.getParameter("userdeptcd"));
  276. //영적의뢰지 진단명 안보이게
  277. if(parent.javascript.fGetFormRec("formcd") == "0000000695")
  278. {
  279. var grdgrupheight = grup_extn0011529001.attribute("height");
  280. grup_extn0011529001.attribute("height") = 0;
  281. ivw_0011529001.attribute("top") = 23;
  282. ivw_0011529001.attribute("height") = parseInt(ivw_0011529001.attribute("height")) + parseInt(grdgrupheight);
  283. }
  284. if (submit("TRMMR04903"))
  285. {
  286. var cnstflag = model.getValue("/root/main/cnstinfo/cnstflag");
  287. var apprtdrid = model.getValue("/root/main/cnstinfo/apprtdrid");
  288. var inptuserid = model.getValue("/root/main/cnstinfo/inptuserid");
  289. var cnststat = model.getValue("/root/main/cnstinfo/cnststat");
  290. var recvuserid = model.getValue("/root/main/cnstinfo/recvuserid"); //20121112 정창혁 추가
  291. fSetRecvDeptCd(cnstflag);
  292. // 아이템 disable
  293. ipt_recdept.disabled = true;
  294. ipt_recdoct.disabled = true;
  295. cmb_inptuserid.disabled = true;
  296. cmb_apprtdrid.disabled = true;
  297. ipt_formnm.disabled = true;
  298. ipt_hordtm.disabled = true;
  299. //회신 전 상태의 경우 수신과, 수신의사 콤보 활성화(2010.03.18 박종훈)
  300. var iCnststat = parseInt(parent.window.javascript.fGetFormRec("cnststat"));
  301. var sRequserid = model.getValue("/root/main/cnstinfo/requserid");
  302. var sApprtdrid = model.getValue("/root/main/cnstinfo/apprtdrid");
  303. var sInptuserid = model.getValue("/root/main/cnstinfo/inptuserid");
  304. var sUserid = getUserInfo("userid")
  305. //수정권한을 과가 아닌 주치의, 담당의, 입력의로 변경(2010.04.07 박종훈)
  306. if (cnstflag == "1" && (iCnststat > 5 && iCnststat < 21) && (sUserid == sRequserid || sUserid == sApprtdrid || sUserid == sInptuserid))
  307. {
  308. cmb_recdept.disabled = false;
  309. cmb_recdoct.disabled = false;
  310. }
  311. else
  312. {
  313. cmb_recdept.disabled = true;
  314. cmb_recdoct.disabled = true;
  315. }
  316. mmbfGetUserComboList("/root/send/reqdata", "/root/init/userlist", model.getValue("/root/main/cnstinfo/reqdeptcd"), "0330");
  317. //수신과 의사 조회
  318. mmbfGetUserComboList("/root/send/reqdata", "/root/init/recvrlist", model.getValue("/root/main/cnstinfo/recvdeptcd"), "0330");
  319. model.setValue("/root/init/cond/apprtdrid", apprtdrid);
  320. model.setValue("/root/init/cond/inptuserid", inptuserid);
  321. model.setValue("/root/init/cond/rscdoctid", recvuserid); //20121109 정창혁 수신의 추가
  322. fSetViewMode(cnstflag);
  323. var showflag = model.getValue("/root/main/cnstinfo/showflag");
  324. if (showflag == "req")
  325. {
  326. SetUnitFormFullSize("0011449001", 0, gItemCds, gPageIdx, grup_cnts);
  327. //2010-07-27 김달현 ivw.src를 지움으로 인해 컨설트 회신시 입력한 내용이 공백으로 저장되는 오류 발생하여 주석처리
  328. //ivw_0011529001.src = ""; //2010-04-06 오후 1:12:36 강지훈 수정 : 격리병실신청 수정시 보이지않는 부분필수체크때문에 수정안되는 오류 수정
  329. //2010-07-27 김달현 notChkEssnYn 플래그를 추가(Y:저장시 필수체크안함. N:저장시 필수체크함)
  330. //의뢰서의 경우 ivw_0011529001(회신뷰어) 필수체크 안함설정
  331. ivw_0011529001.attribute("notChkEssnYn") = "Y";
  332. grup_cnts.visible = true;
  333. }
  334. else
  335. {
  336. var aUnitFormOrgiHeig = new Array(150, 175);
  337. var aUnitFormOrgoHeig = new Array(263, 287);
  338. InitUnitFormData(gItemCds);
  339. //SetUnitFormOrgSize(gItemCdsTextArea, 150, 263);
  340. SetUnitFormOrgSizeCnst(gItemCdsTextArea, aUnitFormOrgiHeig, aUnitFormOrgoHeig);
  341. //2010-07-27 김달현 notChkEssnYn 플래그를 추가(Y:저장시 필수체크안함. N:저장시 필수체크함)
  342. //회신서의 경우 ivw_0011529001(회신뷰어) 필수체크설정
  343. ivw_0011529001.attribute("notChkEssnYn") = "N";
  344. grup_cnts.visible = true;
  345. }
  346. var reqedityn = model.getValue("/root/main/cnstinfo/reqedityn");
  347. if (reqedityn == "Y")
  348. {
  349. EditableCtrl(window.grup_0011449001, true);
  350. }
  351. else
  352. {
  353. EditableCtrl(window.grup_0011449001, false);
  354. fEditablefalse();
  355. }
  356. var recvedityn = model.getValue("/root/main/cnstinfo/recvedityn");
  357. if (recvedityn == "Y")
  358. {
  359. EditableCtrl(window.grup_0011529001, true);
  360. fSetRecvDefSyntex();
  361. //fEditablefalse();
  362. }
  363. else
  364. {
  365. var replflag = model.getValue("/root/main/cnstinfo/replflag");
  366. EditableCtrl(window.grup_0011529001, false);
  367. if (model.getValue("/root/main/cnstinfo/recvdeptcd") == getUserInfo("dutplcecd"))
  368. {
  369. btn_addrepl.disabled = false;
  370. }
  371. else
  372. {
  373. btn_addrepl.disabled = true;
  374. }
  375. if (replflag == "T")
  376. {
  377. btn_etcrec_0011529001.disabled = false;
  378. }
  379. }
  380. //회신확정 이전의 상태에서는 추가회신 버튼 비활성화
  381. if(cnststat >= 30 && model.getValue("/root/main/cnstinfo/recvdeptcd") == getUserInfo("dutplcecd"))
  382. {
  383. btn_addrepl.disabled = false;
  384. }
  385. else
  386. {
  387. btn_addrepl.disabled = true;
  388. }
  389. fCheckCnstWriteUser();
  390. var replflag = model.getValue("/root/main/cnstinfo/replflag");
  391. if ((cnststat >= 22 && recvedityn == "Y") || (replflag == "T" && showflag != "req"))
  392. {
  393. opener.window.btn_tmpsave.disabled = true;
  394. }
  395. else
  396. {
  397. opener.window.btn_tmpsave.disabled = false;
  398. }
  399. //if ((cnststat >= 22 && recvedityn == "Y"))
  400. //{
  401. // opener.window.btn_tmpsave.disabled = true;
  402. //}
  403. //else if(replflag == "T" && showflag != "req"){ //2009-12-08 오후 7:32:55 강지훈 수정 : 팀의뢰 관련 수정
  404. // opener.window.btn_tmpsave.disabled = true;
  405. // opener.window.btn_tmpsave.visible = false;
  406. // opener.window.btn_tmpsave.refresh();
  407. //}
  408. //else
  409. //{
  410. // opener.window.btn_tmpsave.visible = true;
  411. // opener.window.btn_tmpsave.disabled = false;
  412. //}
  413. parent.window.javascript.gSubmitID = TX_SUBMIT_EXTN_FORM;
  414. parent.window.javascript.fSetFormRec("extnflag", "cnst");
  415. parent.window.javascript.fSetFormRec("cnstflag", cnstflag);
  416. parent.window.javascript.fSetFormRec("replflag", model.getValue("/root/main/cnstinfo/replflag"));
  417. parent.window.javascript.fSetFormRec("userdeptcd", parent.window.javascript.getParameter("userdeptcd"));
  418. //전문간호의뢰의 경우 전공의 입력의 항목 안보이게..
  419. //if (cnstflag == "3")
  420. if (model.getValue("/root/main/cnstinfo/recvdeptcd") == "3043900000" || model.getValue("/root/main/cnstinfo/formcd") == "0000002911")
  421. {
  422. caption1.attribute("visibility") = "hidden";
  423. caption10.attribute("visibility") = "hidden";
  424. cmb_apprtdrid.attribute("visibility") = "hidden";
  425. cmb_inptuserid.attribute("visibility") = "hidden";
  426. caption2.text = "의뢰자";
  427. }
  428. else if (parent.window.javascript.fGetFormRec("chosflag") == "E" && parent.window.javascript.fGetFormRec("orddeptcd") == "2280000000")
  429. {
  430. caption1.attribute("visibility") = "hidden";
  431. caption10.attribute("visibility") = "hidden";
  432. cmb_apprtdrid.attribute("visibility") = "hidden";
  433. cmb_inptuserid.attribute("visibility") = "hidden";
  434. caption2.text = "의뢰의";
  435. }
  436. model.refresh();
  437. }
  438. //회신서가 작성된 화면도 의뢰내용만 보이게..
  439. if (opener.window.javascript.getParameter("cnstopenmode") != "" && opener.window.javascript.getParameter("cnstopenmode") == "Y")
  440. {
  441. //SetUnitFormFullSize("0011449001", 0, gItemCds, gPageIdx, grup_cnts);
  442. grup_cnts.visible = true;
  443. opener.window.javascript.fDisalbeSave(true);
  444. }
  445. //영양평가의뢰 회신내용 자동입력부분
  446. var replcnts = getParameter("MMR04900_replcnts");
  447. var overwrite = getParameter("MMR04900_overwrite");
  448. clearParameter("MMR04900_replcnts");
  449. clearParameter("MMR04900_overwrite");
  450. if (replcnts != "" && overwrite != "")
  451. {
  452. var replflag = model.getValue("/root/main/cnstinfo/replflag");
  453. if (replflag == "T")
  454. {
  455. var curdt = getCurrentDate();
  456. var curtm = getCurrentTime().substr(0, 4);
  457. var parmdt = curdt.substr(0, 4) + "-" + curdt.substr(4, 2) + "-" + curdt.substr(6, 2);
  458. var parmtm = curtm.substr(0, 2) + ":" + curtm.substr(2, 2);
  459. replcnts = "▣ 팀교육 의뢰 회신 " + parmdt + " " + parmtm + " " + " 회신부서 : " + getUserInfo("dutplcenm") + " 작성자 : " + getUserInfo("usernm") + "\n" + replcnts + "\n";
  460. }
  461. fSetReplCnts(replcnts, eval(overwrite));
  462. }
  463. }
  464. /**
  465. * @desc : 작성권한에 따른 서식 저장 권한 체크
  466. * @
  467. * @param :
  468. * @return :
  469. * @authur : 박종훈
  470. * @---------------------------------------------------
  471. */
  472. function fCheckCnstWriteUser()
  473. {
  474. //debugger;
  475. var showflag = model.getValue("/root/main/cnstinfo/showflag");
  476. var reqedityn = model.getValue("/root/main/cnstinfo/reqedityn");
  477. var recvedityn = model.getValue("/root/main/cnstinfo/recvedityn");
  478. var replflag = model.getValue("/root/main/cnstinfo/replflag");
  479. if ((reqedityn == "Y" || recvedityn == "Y") || (replflag == "T" && showflag == "both"))
  480. {
  481. opener.window.javascript.fDisalbeSave(false);
  482. }
  483. else
  484. {
  485. opener.window.javascript.fDisalbeSave(true);
  486. }
  487. }
  488. /**
  489. * @desc : 기록 아이템 Disable
  490. * @
  491. * @param :
  492. * @return :
  493. * @authur : 박종훈
  494. * @---------------------------------------------------
  495. */
  496. function fEditablefalse()
  497. {
  498. //그룹으로 묶을것(아래)
  499. ipt_recdept.disabled = true;
  500. ipt_recdoct.disabled = true;
  501. cmb_inptuserid.disabled = true;
  502. cmb_apprtdrid.disabled = true;
  503. ipt_formnm.disabled = true;
  504. ipt_hordtm.disabled = true;
  505. rdo_eryn.disabled = true;
  506. tar_cntcno.disabled = true;
  507. }
  508. /**
  509. * @desc : 프리텍스트 항목 크기 최대화
  510. * @
  511. * @param :
  512. * @return :
  513. * @authur : 박종훈
  514. * @---------------------------------------------------
  515. */
  516. function fSetMultiTextFull()
  517. {
  518. for (var i = 0; i < gItemCdsTextArea.length; i++)
  519. {
  520. SetMultiTextFull(document.controls("ivw_" + gItemCdsTextArea[i]), 1);
  521. }
  522. }
  523. /**
  524. * @desc : 새로운 컨설트 서식 오픈
  525. * @
  526. * @param :
  527. * @return :
  528. * @authur : 박종훈
  529. * @---------------------------------------------------
  530. */
  531. function fNewCnstForm(formcd, userdeptcd)
  532. {
  533. SetUserTimeLog("MMR04900", "fNewCnstForm", parent.model);
  534. model.setValue("/root/init/cond/rscdeptcd", userdeptcd);
  535. var cnstdeptcd = parent.window.javascript.getParameter("SMMMR04900_cnstdeptcd");
  536. var drid = parent.window.javascript.getParameter("SMMMR04900_drid");
  537. model.setValue("/root/init/cond/rscdeptcd", cnstdeptcd);
  538. model.setValue("/root/init/cond/rscdoctid", drid);
  539. var flag = fAfterChoiRecvDeptCd(formcd);
  540. return flag;
  541. }
  542. /**
  543. * @desc : 아이템 수정 불가
  544. * @
  545. * @param :
  546. * @return :
  547. * @---------------------------------------------------
  548. */
  549. function fSaveAfter()
  550. {
  551. var tmpCnststat = model.getValue("/root/main/cnstinfo/cnststat");
  552. if (tmpCnststat == "12" || tmpCnststat == "20")
  553. {
  554. opener.window.btn_tmpsave.disabled = true;
  555. }
  556. ipt_recdept.disabled = true;
  557. ipt_recdoct.disabled = true;
  558. cmb_inptuserid.disabled = true;
  559. cmb_apprtdrid.disabled = true;
  560. ipt_formnm.disabled = true;
  561. ipt_hordtm.disabled = true;
  562. rdo_eryn.disabled = true;
  563. //
  564. //회신 전 상태의 경우 수신과, 수신의사 콤보 활성화(2010.03.18 박종훈)
  565. var iCnststat = parseInt(parent.window.javascript.fGetFormRec("cnststat"));
  566. var sRequserid = model.getValue("/root/main/cnstinfo/requserid");
  567. var sApprtdrid = model.getValue("/root/main/cnstinfo/apprtdrid");
  568. var sInptuserid = model.getValue("/root/main/cnstinfo/inptuserid");
  569. var sUserid = getUserInfo("userid")
  570. //수정권한을 과가 아닌 주치의, 담당의, 입력의로 변경(2010.04.07 박종훈)
  571. if (cnstflag == "1" && (iCnststat > 5 && iCnststat < 21) && (sUserid == sRequserid || sUserid == sApprtdrid || sUserid == sInptuserid))
  572. {
  573. cmb_recdept.disabled = false;
  574. cmb_recdoct.disabled = false;
  575. }
  576. else
  577. {
  578. cmb_recdept.disabled = true;
  579. cmb_recdoct.disabled = true;
  580. }
  581. //tar_cntcno.disabled = true;
  582. model.refresh();
  583. }
  584. /**
  585. * @desc : 가정간호 처방화명 호출
  586. * @
  587. * @param :
  588. * @return :
  589. * @authur : 박종훈
  590. * @---------------------------------------------------
  591. */
  592. function fDoHomeNurOrd()
  593. {
  594. if (parent.javascript.fGetFormRec("formcd") == "0000000692" || parent.javascript.fGetFormRec("formcd") == "1600017738")
  595. {
  596. if (parent.javascript.fGetFormRec("status") == "C" || parent.javascript.fGetFormRec("espiyn") == "N")
  597. {
  598. messageBox("가정간호의뢰를 인증저장후에 시도하여 주십시요.", "I", "");
  599. return;
  600. }
  601. else
  602. {
  603. if (parent.javascript.fGetFormRec("espiyn") == "Y" && parseInt(parent.javascript.fGetFormRec("cnststat")) > 12)
  604. {
  605. setParameter("SMMMB00500_scrnflag", "D"); //저장, 삭제 disable
  606. }
  607. /**
  608. * 가정간호의뢰지일때 처방오픈
  609. * SMMMB00500_formrecseq : formrecseq 기록순번
  610. * SMMMB00500_prcpfromdd : formrecdd 기록일자
  611. */
  612. var sPrcpfromdd = model.getValue("/root/main/cnstinfo/reqdd");
  613. if (sPrcpfromdd == "")
  614. {
  615. sPrcpfromdd = getCurrentDate();
  616. }
  617. setParameter("SMMMB00500_formrecseq", parent.javascript.fGetFormRec("formrecseq"));
  618. setParameter("SMMMB00500_prcpfromdd", sPrcpfromdd);
  619. modal("SMMMB00500", 1, 0, 0, "", "", "");
  620. }
  621. }
  622. }
  623. /**
  624. * @desc : 서식진단명 로드 완료 후 진단명 조회
  625. * @
  626. * @param :
  627. * @return :
  628. * @authur : 박종훈
  629. * @---------------------------------------------------
  630. */
  631. function fGetDiag_old()
  632. {
  633. ivw_0000960001.window.javascript.fInitPage(false, parseInt(ivw_0000960001.attribute("height")), parseInt(ivw_0000960001.attribute("width")));
  634. ivw_0001019001.window.javascript.fInitPage(false, parseInt(ivw_0001019001.attribute("height")), parseInt(ivw_0001019001.attribute("width")));
  635. ivw_0000960001.window.javascript.fGetDiagNm(parent.instance1.selectSingleNode("/root/main/recinfo/formrec")); //환자정보로 진단명 조회
  636. fGetRecDeptDoct();
  637. }
  638. /**
  639. * @desc : 서식 수정 여부 체크
  640. * @
  641. * @param :
  642. * @return :
  643. * @authur : 박종훈
  644. * @---------------------------------------------------
  645. */
  646. function fCheckWriteUserSubForm()
  647. {
  648. if (opener.window.javascript.getParameter("SMMMR04900_newcnstform") == "Y")
  649. {
  650. ipt_recdept.disabled = true;
  651. ipt_recdoct.disabled = true;
  652. cmb_inptuserid.disabled = true;
  653. cmb_apprtdrid.disabled = true;
  654. ipt_formnm.disabled = true;
  655. ipt_hordtm.disabled = true;
  656. }
  657. }
  658. /**
  659. * @desc : 기록부서, 의사 조회하기
  660. * @
  661. * @param :
  662. * @return :
  663. * @authur : 박종훈
  664. * @---------------------------------------------------
  665. */
  666. function fGetRecDeptDoct()
  667. {
  668. var treplflag = parent.window.javascript.getParameter("SMMMR04900_replflag");
  669. var cnstdeptcd = parent.window.javascript.getParameter("SMMMR04900_cnstdeptcd");
  670. var cnstdeptnm = parent.window.javascript.getParameter("SMMMR04900_cnstdeptnm");
  671. //var cnstdeptnm = model.getXPathValue("/root/main/cnstformlist/cnstform[cnstdeptcd='"+cnstdeptcd+"']/cnstdeptnm");
  672. model.setValue("/root/main/recinfo/recitem[degnitemno='" + ipt_recdept.attribute("extn_degnitemno") + "']/rectermcd", cnstdeptcd);
  673. model.setValue("/root/main/recinfo/recitem[degnitemno='" + ipt_recdept.attribute("extn_degnitemno") + "']/rectermnm", cnstdeptnm);
  674. mmbfGetUserComboList("/root/send/reqdata", "/root/init/recvrlist", cnstdeptcd, "0330"); //수신자 콤보 데이터 조회
  675. if (cnstflag == "1")
  676. {
  677. var drid = parent.window.javascript.getParameter("SMMMR04900_drid");
  678. var drnm = model.getXPathValue("/root/init/recvrlist/usercombo[userid='"+drid+"']/usernm");
  679. var hopedd = parent.window.javascript.getParameter("SMMMR04900_hopedd");
  680. model.setValue("/root/main/recinfo/recitem[degnitemno='" + ipt_recdoct.attribute("extn_degnitemno") + "']/rectermcd", drid);
  681. model.setValue("/root/main/recinfo/recitem[degnitemno='" + ipt_recdoct.attribute("extn_degnitemno") + "']/rectermnm", drnm);
  682. model.setValue("/root/main/recinfo/recitem[degnitemno='" + ipt_hordtm.attribute("degnitemno") + "']/reccnts", hopedd); //희망진료일시
  683. }
  684. else if (cnstflag == "3" && treplflag == "D")
  685. {
  686. model.setValue("/root/main/recinfo/recitem[degnitemno='" + ipt_recdoct.attribute("extn_degnitemno") + "']/rectermcd", parent.window.javascript.getParameter("SMMMR04900_cnstuserid"));
  687. model.setValue("/root/main/recinfo/recitem[degnitemno='" + ipt_recdoct.attribute("extn_degnitemno") + "']/rectermnm", parent.window.javascript.getParameter("SMMMR04900_cnstusernm"));
  688. }
  689. fSetRecvDeptCd(cnstflag);
  690. model.refresh();
  691. }
  692. /**
  693. * @desc : 응급여부 선택에 따른 reccnts셋팅
  694. * @
  695. * @param :
  696. * @return :
  697. * @---------------------------------------------------
  698. */
  699. function fEmergencYN()
  700. {
  701. var sEmerCd = model.getValue("/root/main/recinfo/recitem[degnitemno='" + rdo_eryn.attribute("degnitemno") + "']/rectermcd");
  702. var sEmerNm = model.getValue("/root/main/forminfo/vallist[valcd='" + sEmerCd + "']/valitemnm");
  703. model.setValue("/root/main/recinfo/recitem[degnitemno='" + rdo_eryn.attribute("degnitemno") + "']/rectermnm", sEmerNm);
  704. model.refresh();
  705. }
  706. /**
  707. * @desc : 진료일정 팝업
  708. * @
  709. * @param :
  710. * @return :
  711. * @---------------------------------------------------
  712. */
  713. function fPDrSchedule()
  714. {
  715. var drid = ipt_recdoct.value;
  716. var deptcd = ipt_recdept.value;
  717. var orddd = ipt_hordtm.value.substring(0 , 8);
  718. if (orddd == "")
  719. orddd = getCurrentDate();
  720. model.makeValue("/root/temp/tmpnode/orddrid", drid);
  721. model.makeValue("/root/temp/tmpnode/orddeptcd", deptcd);
  722. model.makeValue("/root/temp/tmpnode/orddd", orddd);
  723. modal("SPPMB01200", "1", "100", "100" ,"SPPMB01200", "/root/temp/tmpnode", "/root/temp/tmpnode");
  724. var rtn = getParameter("SPPMB01200_RTN");
  725. var horddd = getParameter("SPPMB01200_orddd");
  726. var hordtm = getParameter("SPPMB01200_ordtm");
  727. var orddrid = getParameter("SPPMB01200_orddrid");
  728. var orddeptcd = getParameter("SPPMB01200_orddeptcd");
  729. if (rtn == "Y")
  730. {
  731. var iFndRow = getNodesetCnt(model, "/root/main/cnstdeptlist/cnstdept[cnstdeptcd='" + orddeptcd + "']");
  732. if (iFndRow > 0){
  733. model.setValue("/root/init/cond/rscdeptcd", orddeptcd);
  734. fSetRecvDeptCd();
  735. model.setValue("/root/init/cond/rscdoctid", orddrid);
  736. model.setValue("/root/init/cond/hordtm", hordtm);
  737. ipt_recdoct.refresh();
  738. model.setValue("/root/main/recinfo/recitem[degnitemno='" + ipt_recdept.attribute("extn_degnitemno") + "']/rectermcd", ipt_recdept.value);
  739. model.setValue("/root/main/recinfo/recitem[degnitemno='" + ipt_recdept.attribute("extn_degnitemno") + "']/rectermnm", ipt_recdept.label);
  740. model.setValue("/root/main/recinfo/recitem[degnitemno='" + ipt_recdoct.attribute("extn_degnitemno") + "']/rectermcd", ipt_recdoct.value);
  741. model.setValue("/root/main/recinfo/recitem[degnitemno='" + ipt_recdoct.attribute("extn_degnitemno") + "']/rectermnm", ipt_recdoct.label);
  742. model.setValue("/root/main/recinfo/recitem[degnitemno='" + ipt_hordtm.attribute("degnitemno") + "']/reccnts", horddd); //희망진료일시
  743. model.refresh();
  744. } else {
  745. alert("Consult대상부서가 아닙니다.");
  746. return;
  747. }
  748. }
  749. //model.removeNodeset("/root/temp/tmpnode");
  750. }
  751. /**
  752. * @desc : 수신부서 셋팅
  753. * @
  754. * @param :
  755. * @return :
  756. * @authur : 박종훈
  757. * @modify : 2008-07-05 박종훈
  758. * @---------------------------------------------------
  759. */
  760. function fSetRecvDeptCd(cnstflag)
  761. {
  762. var deptnm = model.getValue("/root/main/recinfo/recitem[degnitemcd='0010381001']/rectermnm");
  763. var deptcd = model.getValue("/root/main/recinfo/recitem[degnitemcd='0010381001']/rectermcd");
  764. model.setValue("/root/init/cond/rscdeptcd", deptcd);
  765. model.setValue("/root/init/cond/rscdeptnm", deptnm);
  766. if (cnstflag == "1")
  767. {
  768. var drid = model.getValue("/root/main/recinfo/recitem[degnitemcd='0010383001']/rectermcd");
  769. var drnm = model.getValue("/root/main/recinfo/recitem[degnitemcd='0010383001']/rectermnm");
  770. model.setValue("/root/init/cond/rscdoctid", drid);
  771. model.setValue("/root/init/cond/rscdoctnm", drnm);
  772. /* 2012/02/15 영상구분을 안보이게 설정하면서 추가로 주석처리
  773. //2012/02/09 Start 진료의뢰신규에서 수신과가 영상의학과일때 영상구분을 선택 할 수 있도록 셋팅
  774. if(model.getValue("/root/init/cond/rscdeptcd")=="2160000000"){
  775. combo1.disabled=false;
  776. }else{
  777. combo1.deselect();
  778. combo1.disabled=true;
  779. }
  780. //2012/02/09 End
  781. */
  782. }
  783. else if (cnstflag == "3")
  784. {
  785. var formnm = model.getValue("/root/main/forminfo/formmast/formnm");
  786. var formcd = model.getValue("/root/main/forminfo/formmast/formcd");
  787. model.setValue("/root/init/cond/formcd", formcd);
  788. model.setValue("/root/init/cond/formnm", formnm);
  789. }
  790. fEditablefalse();
  791. rdo_eryn.disabled = false;
  792. tar_cntcno.disabled = false;
  793. model.refresh();
  794. }
  795. /**
  796. * @desc : 컨설트 부서리스트 구분자('-------------')삽입
  797. * @
  798. * @param :
  799. * @return :
  800. * @authur : 박종훈
  801. * @---------------------------------------------------
  802. */
  803. function fSortCnstDpList()
  804. {
  805. var cnstDeptList = instance.selectNodes("/root/main/cnstdeptlist/cnstdept");
  806. var cnstdeptcd = "";
  807. var cnstdeptnm = "";
  808. var cnstflag = "";
  809. if(cnstDeptList.length >= 1){
  810. model.copyNode("/root/init/cnstdeptlist", "/root/main/cnstdeptlist");
  811. var path1 = "/root/init/cnstdeptlist/cnstdept[cnstflag='1']";
  812. copyNodeset("/root/main/cnstdeptlist/cnstdept", path1, null, model, model);
  813. var path2 = "/root/init/cnstdept";
  814. copyNodeset("/root/main/cnstdeptlist/cnstdept", path2, "after", model, model);
  815. var path3 = "/root/init/cnstdeptlist/cnstdept[cnstflag='3']";
  816. copyNodeset("/root/main/cnstdeptlist/cnstdept", path3, "after", model, model);
  817. model.removeNodeset("/root/init/cnstdeptlist");
  818. model.refresh();
  819. }
  820. }
  821. /**
  822. * @desc : 저장전 항목검사
  823. * @
  824. * @param :
  825. * @return :
  826. * @authur : 박종훈
  827. * @---------------------------------------------------
  828. */
  829. function fChkPreSave()
  830. {
  831. var rtn = true;
  832. var deptcd = model.getValue("/root/init/cond/rscdeptcd");
  833. var cnstflag = model.getXPathValue("/root/main/cnstdeptlist/cnstdept[cnstdeptcd='" +deptcd+ "']/cnstflag");
  834. if (cnstflag == "1")
  835. {
  836. //var recdoctcd = model.getValue("/root/main/recinfo/recitem[degnitemno='" + ipt_recdoct.attribute("extn_degnitemno") + "']/recrefcd");
  837. //var recdoctnm = model.getValue("/root/main/recinfo/recitem[degnitemno='" + ipt_recdoct.attribute("extn_degnitemno") + "']/recitemnm");
  838. var recdoctcd = model.getValue("/root/main/recinfo/recitem[degnitemno='" + ipt_recdoct.attribute("extn_degnitemno") + "']/rectermcd");
  839. var recdoctnm = model.getValue("/root/main/recinfo/recitem[degnitemno='" + ipt_recdoct.attribute("extn_degnitemno") + "']/rectermnm");
  840. var hopeordtm = model.getValue("/root/main/recinfo/recitem[degnitemno='" + ipt_hordtm.attribute("degnitemno") + "']/reccnts"); //희망진료일시
  841. if (recdoctcd == "" || recdoctnm == "" || hopeordtm == "")
  842. {
  843. messageBox("수신의사와 희망진료일시는", "I003");
  844. rtn = false;
  845. }
  846. }
  847. return rtn;
  848. }
  849. /**
  850. * @desc : 회신서 자동입력(영양)
  851. * @
  852. * @param :
  853. * @return :
  854. * @authur : 박종훈
  855. * @---------------------------------------------------
  856. */
  857. function fSetReplCnts(text, overWrite)
  858. {
  859. setItemDataByDegnItemNo(1, text, 2, ivw_0011529001.model, overWrite, "0011529001");
  860. }
  861. /**
  862. * @desc : 의뢰내용 자동입력(영양)
  863. * @
  864. * @param :
  865. * @return :
  866. * @authur : 박종훈
  867. * @---------------------------------------------------
  868. */
  869. function fSetReqCnts(text, overWrite)
  870. {
  871. setItemDataByDegnItemNo(1, text, 2, ivw_0011449001.model, overWrite, "0011449001");
  872. }
  873. /*****************************************************************************
  874. 튜닝
  875. ******************************************************************************/
  876. var gLoadFormCnts = 0;
  877. /**
  878. * @group :
  879. * @ver : 2008.06.13
  880. * @by : snoweye
  881. * @---------------------------------------------------
  882. * @type : function
  883. * @access : private
  884. * @desc : 화면 로딩후 초기화 작업 수행
  885. * @param :
  886. * @return :
  887. * @---------------------------------------------------
  888. */
  889. function fFormReady()
  890. {
  891. //화면 초기화
  892. lbl_0011449001.attribute("width") = "593";
  893. lbl_0011529001.attribute("width") = "593";
  894. ivw_0000960001.attribute("width") = "593";
  895. ivw_0011449001.attribute("width") = "593";
  896. ivw_0001019001.attribute("width") = "593";
  897. ivw_0011529001.attribute("width") = "593";
  898. ipt_formnm.attribute("top") = ipt_recdoct.attribute("top");
  899. ipt_formnm.attribute("left") = ipt_recdoct.attribute("left");
  900. //fGetRecDeptDoct();
  901. mmbfGetHardCodeInfo("/root/send/reqdata","/root/inithrdcd/hrdform", 1210); //의뢰정보 로그인 사용자정보 셋팅 여부(서식)
  902. mmbfGetHardCodeInfo("/root/send/reqdata","/root/inithrdcd/hrddept", 1220); //의뢰정보 로그인 사용자정보 셋팅 여부(사용자부서)
  903. //onloadcomplete 이벤트 발생
  904. dispOnLoadComplete(COMN_FORM);
  905. //서브밋 설정(일반기록:1301, 확장기록(컨설트, 제증명..):1303)
  906. //parent.window.javascript.gSubmitID = TX_SUBMIT_EXTN_FORM;
  907. //가정간호의 경우에만 가정간호처방 버튼 Visible
  908. var sHomeNurOrd_dispYn = parent.javascript.getParameter("homeNurOrd_dispYn");
  909. if ( (parent.javascript.fGetFormMast("formcd") == "0000000692" || parent.javascript.fGetFormMast("formcd") == "1600017738") && sHomeNurOrd_dispYn != "N")
  910. btn_homenurord.attribute("visibility") = "visible";
  911. else
  912. btn_homenurord.attribute("visibility") = "hidden";
  913. if (cnstflag == "3")
  914. {
  915. btn_etcrec_0011449001.attribute("visibility") = "visible";
  916. btn_etcrec_0011529001.attribute("visibility") = "visible";
  917. btn_addrepl.attribute("visibility") = "hidden";
  918. }
  919. else
  920. {
  921. btn_etcrec_0011449001.attribute("visibility") = "hidden";
  922. btn_etcrec_0011529001.attribute("visibility") = "hidden";
  923. btn_addrepl.attribute("visibility") = "visible";
  924. btn_addrepl.attribute("left") = btn_etcrec_0011529001.attribute("left");
  925. }
  926. InitBtnImge(gItemCdsTextArea);
  927. InitBtnEtcRec(gItemCdsTextArea);
  928. //2012/02/08 START
  929. //하드코드 테이블 체크(영상구분)
  930. fGetHardCDList("N", 5601, 0 , "/root/init/hardcditem");
  931. //2012/02/08 END
  932. }
  933. /**
  934. * @group :
  935. * @ver : 2008.06.13
  936. * @by : snoweye
  937. * @---------------------------------------------------
  938. * @type : function
  939. * @access : private
  940. * @desc : 부분서식 로딩
  941. * @param :
  942. * @return :
  943. * @---------------------------------------------------
  944. */
  945. function fLoadUnitForm()
  946. {
  947. initSection(gItemCds);
  948. }
  949. /**
  950. * @group :
  951. * @ver : 2008.06.13
  952. * @by : snoweye
  953. * @Modify : jonghun(2008-07-05)
  954. * @---------------------------------------------------
  955. * @type : function
  956. * @access : private
  957. * @desc : 부분서식 로딩후 후처리
  958. * @param :
  959. * @return :
  960. * @---------------------------------------------------
  961. */
  962. function fOnLoadComplete()
  963. {
  964. var curLoadFormCd = getParameter("loadformcd");
  965. var orgsupdegnitemcd = model.getValue(gPageInfo.forminfoRef + "/unitformmast[formcd='" + curLoadFormCd + "' and loaded != 'true']/orgsupdegnitemcd");
  966. //1. 부분서식 레벨코드 보정(fstlevlitemcd 추가)
  967. var ivwObj = document.controls("ivw_" + orgsupdegnitemcd);
  968. var unitformload = model.getValue(gPageInfo.forminfoRef + "/unitformmast[formcd='" + curLoadFormCd + "' and loaded != 'true']/loaded");
  969. if(ivwObj != null && unitformload != "true")
  970. {
  971. setFstLevlItemCd(ivwObj, curLoadFormCd);
  972. model.setValue(gPageInfo.forminfoRef + "/unitformmast[formcd='" + curLoadFormCd + "' and loaded != 'true']/loaded", "true");
  973. }
  974. //2. 부분서식 로딩후 처리
  975. //2-1. 의뢰내용 진단명
  976. if(orgsupdegnitemcd == '0000960001')
  977. {
  978. fGetReqDiagInfo(ivwObj);
  979. fExtnInitFormRec();
  980. fGetDiag();
  981. fSetReqDefSyntex();
  982. }
  983. //2-2. 회신내용 진단명
  984. if(orgsupdegnitemcd == '0001019001')
  985. {
  986. fGetReqDiagInfo(ivwObj);
  987. }
  988. gLoadFormCnts++;
  989. if(gItemCds.length == gLoadFormCnts)
  990. {
  991. //>2008-07-05 추가
  992. //fExtnInitFormRec();
  993. //fGetDiag();
  994. //alert(2);
  995. //fSetReqDefSyntex();
  996. //<
  997. dispOnLoadComplete(UNIT_FORM);
  998. }
  999. }
  1000. /**
  1001. * @group :
  1002. * @ver : 2008.11.28
  1003. * @by : jonghun
  1004. * @---------------------------------------------------
  1005. * @type : function
  1006. * @access : private
  1007. * @desc : 동일 서식이 떠있을 경우 내부 인스턴스 로딩 후 디폴트 조회내용 조회
  1008. * @param :
  1009. * @return :
  1010. * @---------------------------------------------------
  1011. */
  1012. function fGetDefData()
  1013. {
  1014. if (parent.window.javascript.fGetFormRec("status") == "C")
  1015. {
  1016. fExtnInitFormRec();
  1017. fGetDiag();
  1018. fSetReqDefSyntex();
  1019. }
  1020. dispOnLoadComplete(UNIT_FORM);
  1021. }
  1022. /**
  1023. * @group :
  1024. * @ver : 2008.06.13
  1025. * @by : snoweye
  1026. * @---------------------------------------------------
  1027. * @type : function
  1028. * @access : private
  1029. * @desc : 의뢰 진단명 로드 완료 후 진단명 조회 <-- fGetDiag
  1030. * @param : ivwObj - 부분서식을 포함한 iviewer object
  1031. * @return :
  1032. * @---------------------------------------------------
  1033. */
  1034. function fGetReqDiagInfo(ivwObj)
  1035. {
  1036. if(ivwObj == null)
  1037. return;
  1038. ivwObj.window.javascript.fInitPage(false, parseInt(ivw_0000960001.attribute("height")), parseInt(ivw_0000960001.attribute("width")));
  1039. /*ivw_0000960001.window.javascript.fInitPage(false, parseInt(ivw_0000960001.attribute("height")), parseInt(ivw_0000960001.attribute("width")));
  1040. ivw_0001019001.window.javascript.fInitPage(false, parseInt(ivw_0001019001.attribute("height")), parseInt(ivw_0001019001.attribute("width")));
  1041. ivw_0000960001.window.javascript.fGetDiagNm(parent.instance1.selectSingleNode("/root/main/recinfo/formrec")); //환자정보로 진단명 조회*/
  1042. }
  1043. /**
  1044. * @desc : 서식진단명 로드 완료 후 진단명 조회
  1045. * @
  1046. * @param :
  1047. * @return :
  1048. * @authur : 박종훈
  1049. * @---------------------------------------------------
  1050. */
  1051. function fGetDiag()
  1052. {
  1053. //ivw_0000960001.window.javascript.fInitPage(false, parseInt(ivw_0000960001.attribute("height")), parseInt(ivw_0000960001.attribute("width")));
  1054. //ivw_0001019001.window.javascript.fInitPage(false, parseInt(ivw_0001019001.attribute("height")), parseInt(ivw_0001019001.attribute("width")));
  1055. if (parent.window.javascript.fGetFormRec("status") == "C")
  1056. {
  1057. ivw_0000960001.window.javascript.fGetDiagNm(parent.instance1.selectSingleNode("/root/main/recinfo/formrec")); //환자정보로 진단명 조회
  1058. }
  1059. }
  1060. /**
  1061. * @desc : 의뢰내용 자유입력의 Default구문 처리
  1062. * @
  1063. * @param :
  1064. * @return :
  1065. * @authur : 박종훈
  1066. * @---------------------------------------------------
  1067. */
  1068. function fSetReqDefSyntex()
  1069. {
  1070. if (parent.window.javascript.fGetFormRec("status") != "C")
  1071. return;
  1072. var ivwfrm = document.controls("ivw_0011449001");
  1073. var diagnm = getParameter("SSMRF04000_diagnm");
  1074. var formcd = parent.window.javascript.fGetFormRec("formcd");
  1075. var reqcnt = "";
  1076. //이윤주(20140812 formcd 조건 추가)
  1077. if (diagnm != "" && cnstflag == "1" && formcd =="0000000677")
  1078. {
  1079. reqcnt = "상기 환자는 진단명[" + diagnm + "](으)로 현재 치료중인 환자입니다.\n";
  1080. ivwfrm.model.setValue("/root/main/recinfo/recitem[degnitemcd='0000146001' and degnitemlevlcd = '0011449.0000146']/reccnts", reqcnt);
  1081. ivwfrm.model.refresh();
  1082. }
  1083. if (cnstflag == "1" && formcd =="0000000677")
  1084. {
  1085. var reqcnts = getParameter("MMR04900_reqcnts");
  1086. var reqoverwrite = getParameter("MMR04900_reqoverwrite");
  1087. clearParameter("MMR04900_reqcnts");
  1088. clearParameter("MMR04900_reqoverwrite");
  1089. if (reqcnts != "" && reqoverwrite != "")
  1090. {
  1091. fSetReqCnts(reqcnts, eval(reqoverwrite));
  1092. ivwfrm.model.refresh();
  1093. }
  1094. //이윤주추가(20140818)
  1095. reqcnts = getParameter("SMMMR04900_reqcnt");
  1096. clearParameter("SMMMR04900_reqcnt");
  1097. reqoverwrite = "true";
  1098. if (reqcnts != "" && reqoverwrite != "")
  1099. {
  1100. fSetReqCnts(reqcnts, eval(reqoverwrite));
  1101. ivwfrm.model.refresh();
  1102. }
  1103. var mtxNm = "MTX_1";
  1104. var mtx = ivwfrm.window.document.controls(mtxNm);
  1105. ivwfrm.model.setFocus(mtxNm);
  1106. //mtx.selBegin = txtSelPos + commuse.length;
  1107. mtx.selBegin = reqcnt.length;
  1108. mtx.dispatch("onkeyup");
  1109. }
  1110. }
  1111. /**
  1112. * @desc : 회신내용 자유입력의 Default구문 처리, 진단명 조회
  1113. * @
  1114. * @param :
  1115. * @return :
  1116. * @authur : 박종훈
  1117. * @---------------------------------------------------
  1118. */
  1119. function fSetRecvDefSyntex()
  1120. {
  1121. var pamleng = parent.instance1.selectSingleNode("/root/main/recinfo/formrec").length;
  1122. var recdiag = ivw_0001019001.instance1.selectNodes("/root/main/recinfo/grid").length;
  1123. var chkcnt = null;
  1124. var chkformcd = null;
  1125. var formcdlistNodeCnt = null;
  1126. var formcdlistCnt = 0;
  1127. var stype = parent.window.type;
  1128. if (stype == "modal")
  1129. {
  1130. }else{
  1131. var scrnid = opener.opener.javascript.getScreenID();
  1132. // 2013.11.22 CYW 소화기내시경의뢰서 포맷 변경 =========================
  1133. if( scrnid == "SMMMR05000" ){
  1134. chkcnt = parent.parent.window.document.controls("grd_cnstlist").row;
  1135. chkformcd = parent.parent.model.getValue("/root/main/cnstlist[" + chkcnt + "]/formcd");
  1136. }
  1137. if( scrnid == "SMMMR00100" ){
  1138. chkcnt = parent.parent.window.document.controls("grd_medireclist").row;
  1139. chkformcd = parent.parent.model.getValue("/root/main/mainlist/medireclist[" + chkcnt + "]/formcd");
  1140. }
  1141. model.makeNode("/root/temp2");
  1142. mmbfGetHardCodeInfo("/root/send/reqdata", "/root/temp2/formcdlist", 5594 );
  1143. formcdlistNodeCnt = getNodesetCount("/root/temp2/formcdlist/hardcd");
  1144. formcdlistCnt = 0;
  1145. for( var i = 1 ; i <= formcdlistNodeCnt ; i++ ){
  1146. if( chkformcd == model.getValue("/root/temp2/formcdlist/hardcd[" + i + "]/hardcd") ){
  1147. formcdlistCnt++;
  1148. }
  1149. }
  1150. //========================================================
  1151. }
  1152. if (pamleng > 0 && recdiag <= 0)
  1153. {
  1154. ivw_0001019001.window.javascript.fGetDiagNm(parent.instance1.selectSingleNode("/root/main/recinfo/formrec")); //환자정보로 진단명 조회
  1155. }
  1156. var ivwfrm = document.controls("ivw_0011529001");
  1157. if (cnstflag == "1")
  1158. {
  1159. var replcnts = ivwfrm.model.getValue("/root/main/recinfo/recitem[degnitemcd='0000146001' and degnitemlevlcd = '0011529.0000146']/reccnts");
  1160. var repNode = ivwfrm.model.instance1.selectSingleNode("/root/main/recinfo/recitem[degnitemcd='0000146001' and degnitemlevlcd = '0011529.0000146']");
  1161. if (replcnts == "" && repNode != null)
  1162. {
  1163. var reqcnt = "의뢰하신 환자 진료 잘 보았습니다.\n";
  1164. ivwfrm.model.setValue("/root/main/recinfo/recitem[degnitemcd='0000146001' and degnitemlevlcd = '0011529.0000146']/reccnts", reqcnt);
  1165. ivwfrm.model.refresh();
  1166. var mtxNm = "MTX_1";
  1167. var mtx = ivwfrm.window.document.controls(mtxNm);
  1168. ivwfrm.model.setFocus(mtxNm);
  1169. //mtx.selBegin = txtSelPos + commuse.length;
  1170. mtx.selBegin = reqcnt.length;
  1171. mtx.dispatch("onkeyup");
  1172. }
  1173. else
  1174. {
  1175. var mtxNm = "MTX_1";
  1176. var mtx = ivwfrm.window.document.controls(mtxNm);
  1177. ivwfrm.model.setFocus(mtxNm);
  1178. //mtx.selBegin = txtSelPos + commuse.length;
  1179. mtx.selBegin = replcnts.length;
  1180. mtx.dispatch("onkeyup");
  1181. }
  1182. }else if (cnstflag == "3" && formcdlistCnt > 0 ){ // 소화기내시경의뢰서
  1183. var replcnts = ivwfrm.model.getValue("/root/main/recinfo/recitem[degnitemcd='0000146001' and degnitemlevlcd = '0011529.0000146']/reccnts");
  1184. var repNode = ivwfrm.model.instance1.selectSingleNode("/root/main/recinfo/recitem[degnitemcd='0000146001' and degnitemlevlcd = '0011529.0000146']");
  1185. var rep_instcd = getUserInfo("dutplceinstcd");
  1186. var reqcnt = "";
  1187. if( replcnts != "" )
  1188. {
  1189. reqcnt = replcnts;
  1190. }else{
  1191. if( rep_instcd == "031" ){
  1192. reqcnt = "내시경 시행하겠습니다. 동의서 받아주시고 내시경실( T.5512 )로 연락주세요.";
  1193. }else if( rep_instcd == "032" ){
  1194. reqcnt = "내시경 시행하겠습니다. 동의서 받아주시고 내시경실( T.3081 )로 연락주세요.";
  1195. }else{
  1196. reqcnt = "내시경 시행하겠습니다. 동의서 받아주시고 내시경실로 연락주세요.";
  1197. }
  1198. }
  1199. ivwfrm.model.setValue("/root/main/recinfo/recitem[degnitemcd='0000146001' and degnitemlevlcd = '0011529.0000146']/reccnts", reqcnt);
  1200. ivwfrm.model.refresh();
  1201. var mtxNm = "MTX_1";
  1202. var mtx = ivwfrm.window.document.controls(mtxNm);
  1203. ivwfrm.model.setFocus(mtxNm);
  1204. //mtx.selBegin = txtSelPos + commuse.length;
  1205. mtx.selBegin = reqcnt.length;
  1206. mtx.dispatch("onkeyup");
  1207. if( chknum == 0 ){
  1208. mtxh = mtx.attribute("height");
  1209. ivwfrmh = ivwfrm.attribute("height");
  1210. tar11529001t = tar_0011529001.attribute("top");
  1211. tar11529001h = tar_0011529001.attribute("height");
  1212. grp11529001h = grup_0011529001.attribute("height");
  1213. grp11529001t = grup_0011529001.attribute("top");
  1214. ivw11449001h = ivw_0011449001.attribute("height");
  1215. grp11449001h = grup_0011449001.attribute("height");
  1216. grpcnth = grup_cnts.attribute("height");
  1217. chknum++;
  1218. }else{
  1219. mtx.attribute("height") = mtxh;
  1220. ivwfrm.attribute("height") = ivwfrmh;
  1221. tar_0011529001.attribute("top") = tar11529001t;
  1222. tar_0011529001.attribute("height") = tar11529001h;
  1223. grup_0011529001.attribute("height") = grp11529001h;
  1224. grup_0011529001.attribute("top") = grp11529001t;
  1225. ivw_0011449001.attribute("height") = ivw11449001h;
  1226. grup_0011449001.attribute("height") = grp11449001h;
  1227. grup_cnts.attribute("height") = grpcnth;
  1228. }
  1229. mtx.attribute("height") = parseInt(mtx.attribute("height")) - parseInt(140);
  1230. ivwfrm.attribute("height") = parseInt(ivwfrm.attribute("height")) - parseInt(140);
  1231. tar_0011529001.attribute("top") = parseInt(tar_0011529001.attribute("top")) - parseInt(tar_0011529001.attribute("top"));
  1232. tar_0011529001.attribute("height") = parseInt(tar_0011529001.attribute("height")) - parseInt(tar_0011529001.attribute("height"));
  1233. grup_0011529001.attribute("height") = parseInt(grup_0011529001.attribute("height")) - parseInt(130);
  1234. grup_0011529001.attribute("top") = parseInt(grup_0011529001.attribute("top")) + parseInt(153);
  1235. ivw_0011449001.attribute("height") = parseInt(ivw_0011449001.attribute("height")) + parseInt(155);
  1236. grup_0011449001.attribute("height") = parseInt(grup_0011449001.attribute("height")) + parseInt(155);
  1237. grup_cnts.attribute("height") = parseInt(grup_cnts.attribute("height")) + parseInt(24);
  1238. /* }
  1239. else
  1240. {
  1241. var mtxNm = "MTX_1";
  1242. var mtx = ivwfrm.window.document.controls(mtxNm);
  1243. ivwfrm.model.setFocus(mtxNm);
  1244. //mtx.selBegin = txtSelPos + commuse.length;
  1245. mtx.selBegin = replcnts.length;
  1246. mtx.dispatch("onkeyup");
  1247. }
  1248. */
  1249. }
  1250. }
  1251. /**
  1252. * @desc : 서식 기록을 위한 초기화(확장)
  1253. * @
  1254. * @param :
  1255. * @return :
  1256. * @authur : 박종훈
  1257. * @---------------------------------------------------
  1258. */
  1259. function fExtnInitFormRec()
  1260. {
  1261. SetUserTimeLog("MMR04900", "fExtnInitFormRec", parent.model);
  1262. //수신과, 수신의사 변경 기능 추가로 인한 submit 위치 변경(최초 작성일때가 아닌 수정모드에서도 조회해옴 2010.03.23)
  1263. if (cnstflag == "1")
  1264. {
  1265. //20081114 수신과 수신의사 콤보 처리
  1266. var sIoflag = parent.window.javascript.fGetFormRec("chosflag");
  1267. if (sIoflag == "I" || sIoflag == "E" || sIoflag == "D")
  1268. {
  1269. sIoflag = "I";
  1270. }
  1271. else
  1272. {
  1273. sIoflag = "O";
  1274. }
  1275. model.makeValue("/root/send/ioflag", sIoflag);
  1276. model.makeValue("/root/send/cnstflag", "1");
  1277. submit("TRMMR04902"); //컨설트부서조회
  1278. }
  1279. fSetLayOut(cnstflag); //지원부서의뢰신규일때 수신의 추가로 인한 동적레이아웃변경 추가 20121109 정창혁
  1280. if (parent.window.javascript.fGetFormRec("status") == "C")
  1281. {
  1282. //진료의뢰의경우 수신과, 수신의사 선택 콤보 활성화(2010.03.18 박종훈)
  1283. if (cnstflag == "1" || cnstflag == "3") //지원부서의뢰신규일경우에도 수신의 활성화 20121108 정창혁
  1284. {
  1285. cmb_recdept.disabled = false;
  1286. cmb_recdoct.disabled = false;
  1287. }
  1288. if (parent.window.javascript.fGetFormRec("chosflag") == "E" && parent.window.javascript.fGetFormRec("orddeptcd") == "2280000000")
  1289. {
  1290. mmbfGetUserComboList("/root/send/reqdata", "/root/init/userlist", getUserInfo("dutplcecd"), "0330"); //응급환자의 경우 로그인 사용자의 부서를 기준으로 조회
  1291. }
  1292. else
  1293. {
  1294. mmbfGetUserComboList("/root/send/reqdata", "/root/init/userlist", parent.model.getValue("/root/main/paminfo/orddeptcd"), "0330");
  1295. }
  1296. //의뢰없는 회신(treplflag = R)부분 처리
  1297. var treplflag = parent.window.javascript.getParameter("SMMMR04900_replflag");
  1298. if (treplflag == "R" && getUserInfo("jobkindcd").substring(0, 2) != "03")
  1299. {
  1300. model.setValue("/root/main/recinfo/recitem[degnitemno='" + ipt_csldeptnm.attribute("degnitemno") + "']/rectermcd", parent.window.javascript.getParameter("SMMMR04900_reqdpcd")); //사용자 부서코드
  1301. model.setValue("/root/main/recinfo/recitem[degnitemno='" + ipt_csldeptnm.attribute("degnitemno") + "']/rectermnm", parent.window.javascript.getParameter("SMMMR04900_reqdpnm")); //사용자 부서명
  1302. model.setValue("/root/main/recinfo/recitem[degnitemno='" + ipt_csldoctnm.attribute("degnitemno") + "']/rectermcd", parent.window.javascript.getParameter("SMMMR04900_reqdrid")); //사용자 아이디
  1303. model.setValue("/root/main/recinfo/recitem[degnitemno='" + ipt_csldoctnm.attribute("degnitemno") + "']/rectermnm", parent.window.javascript.getParameter("SMMMR04900_reqdrnm")); //사용자 명
  1304. }
  1305. else
  1306. {
  1307. var pamioflag = parent.model.getValue("/root/main/paminfo/ioflag");
  1308. if (pamioflag == "I" || pamioflag == "E" || pamioflag == "D")
  1309. {
  1310. var medispclid = parent.model.getValue("/root/main/paminfo/medispclid");
  1311. var atdoctid = parent.model.getValue("/root/main/paminfo/atdoctid");
  1312. }
  1313. else
  1314. {
  1315. var medispclid = parent.model.getValue("/root/main/paminfo/orddrid");
  1316. }
  1317. //전문간호의뢰여부 check
  1318. var cnstdeptcd = parent.window.javascript.getParameter("SMMMR04900_cnstdeptcd");
  1319. var cnstformcd = parent.window.javascript.getParameter("SMMMR04900_formcd");
  1320. //if (cnstflag == "3")
  1321. if (cnstdeptcd == "3043900000" || cnstformcd == "0000002911")
  1322. {
  1323. //초기조건 설정
  1324. model.setValue("/root/main/recinfo/recitem[degnitemno='" + ipt_csldeptnm.attribute("degnitemno") + "']/rectermcd", getUserInfo("dutplcecd")); //환자진료 부서코드
  1325. model.setValue("/root/main/recinfo/recitem[degnitemno='" + ipt_csldeptnm.attribute("degnitemno") + "']/rectermnm", getUserInfo("dutplcenm")); //환자진료 부서명
  1326. model.setValue("/root/main/recinfo/recitem[degnitemno='" + ipt_csldoctnm.attribute("degnitemno") + "']/rectermcd", getUserInfo("userid")); //의뢰자 아이디
  1327. model.setValue("/root/main/recinfo/recitem[degnitemno='" + ipt_csldoctnm.attribute("degnitemno") + "']/rectermnm", getUserInfo("usernm")); //의뢰자 명
  1328. caption1.attribute("visibility") = "hidden";
  1329. caption10.attribute("visibility") = "hidden";
  1330. cmb_apprtdrid.attribute("visibility") = "hidden";
  1331. cmb_inptuserid.attribute("visibility") = "hidden";
  1332. caption2.text = "의뢰자";
  1333. }
  1334. else
  1335. {
  1336. if (parent.window.javascript.fGetFormRec("chosflag") == "E" && parent.window.javascript.fGetFormRec("orddeptcd") == "2280000000")
  1337. {
  1338. model.setValue("/root/main/recinfo/recitem[degnitemno='" + ipt_csldeptnm.attribute("degnitemno") + "']/rectermcd", getUserInfo("dutplcecd")); //환자진료 부서코드
  1339. model.setValue("/root/main/recinfo/recitem[degnitemno='" + ipt_csldeptnm.attribute("degnitemno") + "']/rectermnm", getUserInfo("dutplcenm")); //환자진료 부서명
  1340. model.setValue("/root/main/recinfo/recitem[degnitemno='" + ipt_csldoctnm.attribute("degnitemno") + "']/rectermcd", getUserInfo("userid")); //의뢰자 아이디
  1341. model.setValue("/root/main/recinfo/recitem[degnitemno='" + ipt_csldoctnm.attribute("degnitemno") + "']/rectermnm", getUserInfo("usernm")); //의뢰자 명
  1342. caption1.attribute("visibility") = "hidden";
  1343. caption10.attribute("visibility") = "hidden";
  1344. cmb_apprtdrid.attribute("visibility") = "hidden";
  1345. cmb_inptuserid.attribute("visibility") = "hidden";
  1346. caption2.text = "의뢰의";
  1347. }
  1348. else
  1349. {
  1350. //알콜센터에서 의뢰한 사회사업인지 여부 체크
  1351. var compFormcd = parent.window.javascript.fGetFormRec("formcd");
  1352. var iFormtrgtNodeCnt = getNodesetCnt(model, "/root/inithrdcd/hrdform/hardcd[hardcd = '" + compFormcd + "']"); //의뢰정보 사용자정보 적용의뢰
  1353. var compDeptCd = getUserInfo("dutplcecd");
  1354. var iDepttrgtNodeCnt = getNodesetCnt(model, "/root/inithrdcd/hrddept/hardcd[hardcd = '" + compDeptCd + "']"); //의뢰정보 사용자정보 적용부서
  1355. if (iFormtrgtNodeCnt > 0 && iDepttrgtNodeCnt > 0)
  1356. {
  1357. //초기조건 설정
  1358. model.setValue("/root/main/recinfo/recitem[degnitemno='" + ipt_csldeptnm.attribute("degnitemno") + "']/rectermcd", getUserInfo("dutplcecd")); //환자진료 부서코드
  1359. model.setValue("/root/main/recinfo/recitem[degnitemno='" + ipt_csldeptnm.attribute("degnitemno") + "']/rectermnm", getUserInfo("dutplcenm")); //환자진료 부서명
  1360. model.setValue("/root/main/recinfo/recitem[degnitemno='" + ipt_csldoctnm.attribute("degnitemno") + "']/rectermcd", getUserInfo("userid")); //전문의 아이디
  1361. model.setValue("/root/main/recinfo/recitem[degnitemno='" + ipt_csldoctnm.attribute("degnitemno") + "']/rectermnm", getUserInfo("usernm")); //전문의 명
  1362. caption1.attribute("visibility") = "hidden";
  1363. caption10.attribute("visibility") = "hidden";
  1364. cmb_apprtdrid.attribute("visibility") = "hidden";
  1365. cmb_inptuserid.attribute("visibility") = "hidden";
  1366. caption2.text = "의뢰자";
  1367. mmbfGetUserComboList("/root/send/reqdata", "/root/init/userlist", getUserInfo("dutplcecd"), "-");
  1368. }
  1369. else
  1370. {
  1371. //초기조건 설정
  1372. model.setValue("/root/main/recinfo/recitem[degnitemno='" + ipt_csldeptnm.attribute("degnitemno") + "']/rectermcd", parent.model.getValue("/root/main/paminfo/orddeptcd")); //환자진료 부서코드
  1373. model.setValue("/root/main/recinfo/recitem[degnitemno='" + ipt_csldeptnm.attribute("degnitemno") + "']/rectermnm", parent.model.getValue("/root/main/paminfo/orddeptnm")); //환자진료 부서명
  1374. model.setValue("/root/main/recinfo/recitem[degnitemno='" + ipt_csldoctnm.attribute("degnitemno") + "']/rectermcd", medispclid); //전문의 아이디
  1375. model.setValue("/root/main/recinfo/recitem[degnitemno='" + ipt_csldoctnm.attribute("degnitemno") + "']/rectermnm", getPatientInfo("apntdr")); //전문의 명
  1376. if (pamioflag == "I" || pamioflag == "E" || pamioflag == "D")
  1377. {
  1378. model.setValue("/root/init/cond/apprtdrid", atdoctid); //전공의 아이디
  1379. model.setValue("/root/init/cond/apprtdrnm", getPatientInfo("attndr")); //전공의 아이디
  1380. cmb_apprtdrid.refresh();
  1381. }
  1382. else
  1383. {
  1384. cmb_apprtdrid.disabled = true;
  1385. }
  1386. }
  1387. }
  1388. }
  1389. model.setValue("/root/init/cond/inptuserid", getUserInfo("userid")); //작성자 아이디
  1390. model.setValue("/root/init/cond/inptusernm", getUserInfo("usernm")); //작성자 아이디
  1391. cmb_inptuserid.refresh();
  1392. }
  1393. model.setValue("/root/main/recinfo/recitem[degnitemno='" + rdo_eryn.attribute("degnitemno") + "']/rectermcd", "0018564001"); //응급여부
  1394. fEmergencYN(); //일단막아둠(reccnts에 값 셋팅시 (응급여부> 정규 ※정규) 와 같이 중복 표현문제)
  1395. parent.window.javascript.fSetFormRec("extnflag", "cnst");
  1396. parent.window.javascript.fSetFormRec("cnstflag", parent.window.javascript.getParameter("SMMMR04900_cnstflag"));
  1397. parent.window.javascript.fSetFormRec("cnststat", "10");
  1398. parent.window.javascript.fSetFormRec("replflag", parent.window.javascript.getParameter("SMMMR04900_replflag"));
  1399. parent.window.javascript.fSetFormRec("apprtdrid", model.getValue("/root/init/cond/apprtdrid"));
  1400. parent.window.javascript.fSetFormRec("apprtdrid", model.getValue("/root/init/cond/rscdoctid"));
  1401. parent.window.javascript.fSetFormRec("inptuserid", model.getValue("/root/init/cond/inptuserid"));
  1402. parent.window.javascript.fSetFormRec("cnstchosflag", parent.window.javascript.getParameter("SMMMR04900_cnstioflag"));
  1403. if (parent.window.javascript.fGetFormRec("formcd") == "0000000692")
  1404. {
  1405. parent.window.javascript.fSetFormRec("homecarerereqyn", parent.window.javascript.getParameter("SMMMR05000_param_homecarerereqyn"));
  1406. parent.window.javascript.fSetFormRec("hinptdt", parent.window.javascript.getParameter("SMMMR05000_hcare_inptdt"));
  1407. parent.window.javascript.fSetFormRec("hrecdd", parent.window.javascript.getParameter("SMMMR05000_hcare_recdd"));
  1408. }
  1409. var treplflag = parent.window.javascript.getParameter("SMMMR04900_replflag");
  1410. //기록영역 최대화
  1411. if (treplflag != "R" || getUserInfo("jobkindcd").substring(0, 2) == "03")
  1412. {
  1413. SetUnitFormFullSize("0011449001", 0, gItemCds, gPageIdx, grup_cnts);
  1414. //2010-07-27 김달현 ivw.src를 지움으로 인해 컨설트 회신시 입력한 내용이 공백으로 저장되는 오류 발생하여 주석처리
  1415. //ivw_0011529001.src = ""; //2010-04-06 오후 1:12:36 강지훈 수정 : 격리병실신청 수정시 수정안되는 오류
  1416. //2010-07-27 김달현 notChkEssnYn 플래그를 추가(Y:저장시 필수체크안함. N:저장시 필수체크함)
  1417. //의뢰서의 경우 ivw_0011529001(회신뷰어) 필수체크 안함설정
  1418. ivw_0011529001.attribute("notChkEssnYn") = "Y";
  1419. }
  1420. fAfterChoiRecvDeptCd();
  1421. parent.window.btn_init.attribute("visibility") = "visible";
  1422. model.setValue("/root/init/cond/rscdeptcd", parent.window.javascript.getParameter("userdeptcd"));
  1423. fGetRecDeptDoct();
  1424. //영양평가의뢰 회신내용 자동입력부분
  1425. var replcnts = getParameter("MMR04900_replcnts");
  1426. var overwrite = getParameter("MMR04900_overwrite");
  1427. clearParameter("MMR04900_replcnts");
  1428. clearParameter("MMR04900_overwrite");
  1429. if (replcnts != "" && overwrite != "")
  1430. {
  1431. fSetReplCnts(replcnts, eval(overwrite));
  1432. }
  1433. cmb_recdept.attribute("ref") = "/root/init/cond/rscdeptcd";
  1434. cmb_recdoct.attribute("ref") = "/root/init/cond/rscdoctid";
  1435. }
  1436. else
  1437. {
  1438. //pjh
  1439. //cmb_recdept.attribute("ref") = "/root/init/cond/rscdeptnm";
  1440. //cmb_recdoct.attribute("ref") = "/root/init/cond/rscdoctnm";
  1441. /*var replcnts = getParameter("MMR04900_replcnts");
  1442. var overwrite = getParameter("MMR04900_overwrite");
  1443. clearParameter("MMR04900_replcnts");
  1444. clearParameter("MMR04900_overwrite");
  1445. if (replcnts != "" && overwrite != "")
  1446. {
  1447. fSetReplCnts(replcnts, eval(overwrite));
  1448. }*/
  1449. //알콜센터에서 의뢰한 사회사업인지 여부 체크
  1450. var compFormcd = parent.window.javascript.fGetFormRec("formcd");
  1451. var iFormtrgtNodeCnt = getNodesetCnt(model, "/root/inithrdcd/hrdform/hardcd[hardcd = '" + compFormcd + "']"); //의뢰정보 사용자정보 적용의뢰
  1452. if (iFormtrgtNodeCnt > 0)
  1453. {
  1454. caption1.attribute("visibility") = "hidden";
  1455. caption10.attribute("visibility") = "hidden";
  1456. cmb_apprtdrid.attribute("visibility") = "hidden";
  1457. cmb_inptuserid.attribute("visibility") = "hidden";
  1458. caption2.text = "의뢰자";
  1459. mmbfGetUserComboList("/root/send/reqdata", "/root/init/userlist", getUserInfo("dutplcecd"), "-");
  1460. }
  1461. }
  1462. if(parseInt(parent.window.javascript.fGetFormRec("cnststat")) > 12)
  1463. {
  1464. parent.window.btn_init.attribute("visibility") = "hidden";
  1465. }
  1466. }
  1467. /**
  1468. * @desc : 추가회신 버튼 이벤트
  1469. * @
  1470. * @param :
  1471. * @return :
  1472. * @authur : 박종훈
  1473. * @---------------------------------------------------
  1474. */
  1475. function fAddRepl()
  1476. {
  1477. var addcnststat = parseInt(model.getValue("/root/main/cnstinfo/cnststat"));
  1478. var rtn = "";
  1479. var ivwfrm = document.controls("ivw_0011529001");
  1480. if (addcnststat == 30 || addcnststat == 40)
  1481. {
  1482. rtn = messageBox("의뢰과에서 회신내용을 확인하셨습니다.\n 회신내용을", "Q008");
  1483. }
  1484. else
  1485. {
  1486. rtn = 6;
  1487. }
  1488. if (rtn == 6)
  1489. {
  1490. var cntparm = "";
  1491. var defdata = "";
  1492. var curdt = getCurrentDate();
  1493. var curtm = getCurrentTime().substr(0, 4);
  1494. var parmdt = curdt.substr(0, 4) + "-" + curdt.substr(4, 2) + "-" + curdt.substr(6, 2);
  1495. var parmtm = curtm.substr(0, 2) + ":" + curtm.substr(2, 2);
  1496. setParameter("etcrec_cnstReplAddYn", "Y");
  1497. if (addcnststat > 30 && addcnststat < 40) // 추가회신내용을 의뢰자가 확인 안한상태 체크
  1498. {
  1499. var replcnts = ivwfrm.model.getValue("/root/main/recinfo/recitem[degnitemcd='0000146001' and degnitemlevlcd = '0011529.0000146']/reccnts");
  1500. var existrec = "N";
  1501. var strloc = 0;
  1502. var bindinfo = new Array();
  1503. var regexp = new RegExp("▣", 'igm');
  1504. var orgrec = "";
  1505. if (regexp.test(replcnts) == true)
  1506. {
  1507. bindinfo = replcnts.match(regexp);
  1508. for(var i = 0; i < bindinfo.length; i++)
  1509. {
  1510. if(bindinfo[i] != "")
  1511. {
  1512. strloc = bindinfo.index;
  1513. break;
  1514. }
  1515. }
  1516. cntparm = replcnts.substr(strloc, (replcnts.length - strloc));
  1517. orgrec = cntparm;
  1518. cntparm = cntparm.replace("▣ ", "");
  1519. defdata = cntparm.split("\n")[0];
  1520. cntparm = cntparm.replace(defdata, "");
  1521. //cntparm = cntparm.replace("\n", "");
  1522. ivwfrm.model.setValue("/root/main/recinfo/recitem[degnitemcd='0000146001' and degnitemlevlcd = '0011529.0000146']/reccnts", replcnts.substr(0, strloc));
  1523. ivwfrm.model.refresh();
  1524. setParameter("etcrec_addreplcnts", cntparm);
  1525. existrec = "Y";
  1526. }
  1527. else
  1528. {
  1529. }
  1530. }
  1531. else
  1532. {
  1533. var replcnts = ivwfrm.model.getValue("/root/main/recinfo/recitem[degnitemcd='0000146001' and degnitemlevlcd = '0011529.0000146']/reccnts");
  1534. var existrec = "N";
  1535. var strloc = 0;
  1536. var bindinfo = new Array();
  1537. var regexp = new RegExp("▣", 'igm');
  1538. var orgrec = "";
  1539. if (regexp.test(replcnts) == true)
  1540. {
  1541. bindinfo = replcnts.match(regexp);
  1542. for(var i = 0; i < bindinfo.length; i++)
  1543. {
  1544. if(bindinfo[i] != "")
  1545. {
  1546. strloc = bindinfo.index;
  1547. break;
  1548. }
  1549. }
  1550. cntparm = replcnts.substr(strloc, (replcnts.length - strloc));
  1551. orgrec = cntparm;
  1552. cntparm = cntparm.replace("▣ ", "");
  1553. defdata = cntparm.split("\n")[0];
  1554. cntparm = cntparm.replace(defdata, "");
  1555. //cntparm = cntparm.replace("\n", "");
  1556. ivwfrm.model.setValue("/root/main/recinfo/recitem[degnitemcd='0000146001' and degnitemlevlcd = '0011529.0000146']/reccnts", replcnts.substr(0, strloc));
  1557. ivwfrm.model.refresh();
  1558. setParameter("etcrec_addreplcnts", cntparm);
  1559. existrec = "Y";
  1560. }
  1561. else
  1562. {
  1563. defdata = parmdt + " " + parmtm + " " + getUserInfo("deptabbr") + " " + "전문의 : " + model.getValue("/root/main/recinfo/recitem[degnitemno='" + ipt_csldoctnm.attribute("degnitemno") + "']/rectermnm") + " " + "작성자 : " + getUserInfo("usernm");
  1564. }
  1565. }
  1566. modal("SPMMR06100");
  1567. var cnstaddrec = getParameter("cnataddrec_rtn");
  1568. //if (cnstaddrec != "" && cnstaddrec != cntparm)
  1569. if (cnstaddrec != "" && cntparm != cnstaddrec)
  1570. {
  1571. var tmpreccnts = ivwfrm.model.getValue("/root/main/recinfo/recitem[degnitemcd='0000146001' and degnitemlevlcd = '0011529.0000146']/reccnts");
  1572. tmpreccnts = tmpreccnts + "\n" + "▣ " + defdata + "\n" + cnstaddrec;
  1573. ivwfrm.model.setValue("/root/main/recinfo/recitem[degnitemcd='0000146001' and degnitemlevlcd = '0011529.0000146']/reccnts", tmpreccnts);
  1574. ivwfrm.model.refresh();
  1575. cnstaddrec = "";
  1576. clearParameter("cnataddrec_rtn");
  1577. clearParameter("etcrec_addreplcnts");
  1578. }
  1579. else if (existrec == "Y" || getParameter("etcrec_cnclyn") == "Y")
  1580. {
  1581. //추가회신 변경된 내용이 없는 경우
  1582. ivwfrm.model.setValue("/root/main/recinfo/recitem[degnitemcd='0000146001' and degnitemlevlcd = '0011529.0000146']/reccnts", replcnts);
  1583. ivwfrm.model.refresh();
  1584. cnstaddrec = "";
  1585. clearParameter("cnataddrec_rtn");
  1586. clearParameter("etcrec_addreplcnts");
  1587. clearParameter("etcrec_cnclyn");
  1588. }
  1589. //openEtcRec("0011529001");
  1590. parent.window.btn_signsave.disabled = false;
  1591. }
  1592. }
  1593. /**
  1594. * 지원부서의뢰신규시 수신의 설정 가능하게 수정함 20121107 정창혁
  1595. */
  1596. function fSetLayOut(cnstflag) {
  1597. if (cnstflag == "3") {
  1598. cap_rcvdoct.attribute("style") = "left:0px; top:52px; width:95px; height:23px; vertical-align:middle; ";
  1599. cmb_recdoct.attribute("style") = "left:98px; top:54px; width:195px; height:19px; ";
  1600. cmb_recdoct.visible = true;
  1601. cmb_recdoct.disabled = false;
  1602. cap_mode1.attribute("style") = "left:0px; top:78px; width:95px; height:23px; vertical-align:middle; ";
  1603. ipt_formnm.attribute("style") = "left:98px; top:79px; width:195px; height:19px; ";
  1604. caption19.attribute("style") = "left:0px; top:103px; width:60px; height:23px; vertical-align:middle; "; //응급여부 캡션
  1605. rdo_eryn.attribute("style") = "left:63px; top:107px; width:90px; height:19px; border-style:none; ";
  1606. rdo_eryn.attribute("cellspacing") = "0";
  1607. caption22.attribute("style") = "left:156px; top:104px; width:60px; height:23px; vertical-align:middle; "; //연락번호 캡션
  1608. tar_cntcno.attribute("style") = "left:218px; top:107px; width:80px; height:19px; ";
  1609. } else if (cnstflag == "1") {
  1610. cap_rcvdoct.attribute("style") = "left:0px; top:52px; width:95px; height:23px; vertical-align:middle; ";
  1611. cmb_recdoct.attribute("style") = "left:98px; top:54px; width:195px; height:19px; ";
  1612. cmb_recdoct.visible = true;
  1613. cmb_recdoct.disabled = false;
  1614. cap_mode1.attribute("style") = "left:0px; top:52px; width:95px; height:23px; vertical-align:middle; ";
  1615. ipt_formnm.attribute("style") = "left:98px; top:54px; width:195px; height:19px; "
  1616. caption19.attribute("style") = "left:0px; top:78px; width:95px; height:23px; vertical-align:middle; "; //응급여부 캡션
  1617. rdo_eryn.attribute("style") = "left:98px; top:80px; width:195px; height:19px; border-style:none; ";
  1618. rdo_eryn.attribute("cellspacing") = "20";
  1619. caption22.attribute("style") = "left:0px; top:104px; width:95px; height:23px; vertical-align:middle; "; //연락번호 캡션
  1620. tar_cntcno.attribute("style") = "left:98px; top:107px; width:195px; height:19px; ";
  1621. }
  1622. }
  1623. /**
  1624. * 수신의 변경시 이벤트 (자바스크립트로 옮김) 20121112 정창혁
  1625. */
  1626. function fOnChangeCmbRecDoct() {
  1627. var drid = cmb_recdoct.value;
  1628. fGetSuspendDiagInfo();
  1629. if (cnstflag == "1") { //지원부서의뢰신규시 동작 안하게 설정(서식에는 존재하지 않는 아이템이라) 20121108 정창혁
  1630. model.setValue("/root/main/recinfo/recitem[degnitemno='" + ipt_recdoct.attribute("extn_degnitemno") + "']/rectermcd", model.getValue("/root/init/cond/rscdoctid"));
  1631. var sDrNm = model.getValue("/root/init/recvrlist/usercombo[userid='" + model.getValue("/root/init/cond/rscdoctid") + "']/usernm");
  1632. model.setValue("/root/init/cond/rscdoctnm", sDrNm);
  1633. model.setValue("/root/main/recinfo/recitem[degnitemno='" + ipt_recdoct.attribute("extn_degnitemno") + "']/rectermnm", sDrNm);
  1634. } else if (cnstflag == "3") {
  1635. parent.window.javascript.fSetFormRec("rscdoctid", model.getValue("/root/init/cond/rscdoctid"));
  1636. }
  1637. //model.setValue("/root/main/recinfo/recitem[degnitemno='" + ipt_recdoct.attribute("extn_degnitemno") + "']/rectermcd", model.getValue("/root/init/cond/rscdoctnm"));
  1638. //var sDrNm = model.getValue("/root/init/recvrlist/usercombo[userid='" + model.getValue("/root/init/cond/rscdoctnm") + "']/usernm");
  1639. //var sDrNm = model.getValue("/root/init/recvrlist/usercombo[userid='" + model.getValue("/root/init/cond/rscdoctid") + "']/usernm");
  1640. //model.setValue("/root/init/cond/rscdoctnm", sDrNm);
  1641. //debugger;
  1642. //model.setValue("/root/main/recinfo/recitem[degnitemno='" + ipt_recdoct.attribute("extn_degnitemno") + "']/rectermcd", model.getValue("/root/init/cond/rscdoctid"));
  1643. //model.setValue("/root/main/recinfo/recitem[degnitemno='" + ipt_recdoct.attribute("extn_degnitemno") + "']/rectermnm", sDrNm);
  1644. }
  1645. /**
  1646. * 선택한 수신의의 휴진 정보 조회
  1647. */
  1648. function fGetSuspendDiagInfo() {
  1649. model.makeValue("/root/send/reqsuspend/orddeptcd", parent.window.javascript.getParameter("SMMMR04900_cnstdeptcd"));
  1650. model.makeValue("/root/send/reqsuspend/orddrid", cmb_recdoct.value);
  1651. var sDrNm = model.getValue("/root/init/recvrlist/usercombo[userid='" + model.getValue("/root/init/cond/rscdoctid") + "']/usernm");
  1652. model.removeNodeset("/root/hidden/suspendinfo");
  1653. if (submit("TRMMR04905")) {
  1654. if (model.getValue("/root/hidden/suspendinfo/spndyn") == "Y") {
  1655. messageBox("["+sDrNm+"] 선생님의 휴진정보입니다. \n\n"+
  1656. model.getValue("/root/hidden/suspendinfo/description")+"\n\n", "I", "");
  1657. return;
  1658. }
  1659. }
  1660. }