MMR01101.xjs 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <Script type="xscript4.0"><![CDATA[ /**
  3. * MMR01101.js
  4. * SMMMR01101_PostOpNote.xrw
  5. * 20130522 이윤주
  6. * -> 수술기록 신규 로딩할때에 brief 기록이 있으면 디폴트로 brief기록을 조회해옴(asis는 수술간호정보를 로딩했음)
  7. */
  8. //부분서식의 부모아이템 배열
  9. //0000512001
  10. var arrItemCds = new Array("0000515001" //수술일
  11. , "0007983001" //수술전진단명
  12. , "0000521001" //수술후진단명
  13. , "0000509001" //수술(시술)명
  14. , "0012039001"
  15. );
  16. var gItemCds = new Array("0007983001", "0000521001", "0000509001", "0012039001");
  17. var gItemCdsTextArea = new Array("0012039001");
  18. var gItemCdsXRWArea = new Array("0007983001", "0000521001", "0000509001");
  19. //부분서식의 개수만큼 일단 '0'으로 채운다.
  20. var gPageIdx = new Array(0, 0);
  21. var iSurg = grup_base.ipt_surg.degnitemlevlcd;
  22. var oprsrvno = ""; //수술예약번호
  23. var perfdeptcd = ""; //집도과
  24. var lodedYn = false;
  25. /****************************************************************************************
  26. * Function : fClearComnFormData
  27. * Description : 서식 데이터 Clear, 인터페이스 입력값 조회 입력
  28. * retrun type :
  29. ****************************************************************************************/
  30. function fClearComnFormData()
  31. {
  32. if (!utlf_isNull(gMaxSectionID))
  33. {
  34. frmf_inputEnterKey( "ComnFormObj.lbl_"+gMaxSectionID, "onclick", new ClickEventInfo);
  35. }
  36. if( lodedYn == true )
  37. ClearComnFormData(gItemCds);
  38. //2010.01.20 dhkim -권한체크로 리턴값 추가
  39. if(!fInitialize()){
  40. return false;
  41. }
  42. if (parent.fGetFormRec("status") == "C")
  43. {
  44. var rtn = 'true';
  45. if(!rtn)
  46. {
  47. fBtnDisEnable(true);
  48. return "oprfalse";
  49. } else {
  50. }
  51. }
  52. //포커스 처리
  53. SetDefFocusIVW(gItemCdsTextArea);
  54. return true;
  55. }
  56. /****************************************************************************************
  57. * Function : fLoadData
  58. * Description : 기록데이터 조회
  59. * retrun type :
  60. ****************************************************************************************/
  61. function fLoadData()
  62. {
  63. //2010.01.20 dhkim -권한체크로 리턴값 추가
  64. if(!fInitialize()){
  65. return false;
  66. }
  67. lf_setRecData(arrItemCds);
  68. var sStatus = fGetFormRec("status");
  69. lf_setBasicInfo(sStatus);
  70. /*
  71. //Program 서식 데이터 조회반영
  72. InitPgmFormData();
  73. this.recRef2 = "/root/hidden/recinfo"
  74. //부분서식 데이터 조회 반영
  75. InitUnitFormData(gItemCds);
  76. */
  77. parent.gSubmitID = TX_SUBMIT_EXTN_FORM;
  78. parent.fSetFormRec("extnflag", "opr");
  79. return true;//2010.01.21 dhkim - 리턴값 추가(blocking 메세지후 리턴)
  80. }
  81. /****************************************************************************************
  82. * Function : fInitialize
  83. * Description : 화면 초기화
  84. * retrun type : true / false
  85. * History : 2010.01.20 dhkim - 리턴값 추가
  86. ****************************************************************************************/
  87. function fInitialize()
  88. {
  89. //2010.01.18 dhkim - 작성권한 체크(수술예약번호, 집도과체크)->기존기능임
  90. var operation = sysf_getGlobalVariable("operation").split("▩")[1];
  91. if(!utlf_isNull(operation)){
  92. oprsrvno = operation.split("▦")[0];
  93. perfdeptcd = operation.split("▦")[10];
  94. }
  95. if (parent.fGetFormRec("status") == "C")
  96. {
  97. parent.fSetFormRec("extnflag", "opr");
  98. parent.fSetFormRec("oprsrvno", oprsrvno);
  99. //수술예약번호 체크
  100. if(utlf_isNull(oprsrvno))
  101. {
  102. sysf_messageBox("수술예약이 되지 않은", "I005");
  103. grup_base.enable = false;
  104. fBtnDisEnable(true);
  105. return false;
  106. } else {
  107. fBtnDisEnable(false);
  108. }
  109. //집도과 체크
  110. if (perfdeptcd != sysf_getUserInfo("dutplcecd"))
  111. {
  112. sysf_messageBox("작성 권한이", "I004");
  113. grup_base.enable = false;
  114. fBtnDisEnable(true);
  115. return false;
  116. } else {
  117. fBtnDisEnable(false);
  118. }
  119. }
  120. //그리드 top, hei확장값 세팅
  121. gTermViewTopPos = 29;
  122. gTermViewHei = 152;
  123. gTermViewItems = gItemCdsXRWArea;
  124. grup_base.ipt_surg.enable = false;
  125. return true;
  126. }
  127. /****************************************************************************************
  128. * Function : fChngDoct
  129. * Description : 의사 선택에 따른 reccnts셋팅
  130. ****************************************************************************************/
  131. function fChngDoct(obj:Combo, e:ItemChangeEventInfo)
  132. {
  133. var sDrnm, sDrcd;
  134. var sDegnitemlevlcd = obj.degnitemlevlcd;
  135. var nFindRow = ds_data_recitem.findRow("degnitemlevlcd", sDegnitemlevlcd);
  136. if(nFindRow == -1)
  137. {
  138. nFindRow = ds_data_recitem.addRow();
  139. var insRow = ds_temp_mainrecitem.findRow("degnitemlevlcd", sDegnitemlevlcd);
  140. ds_data_recitem.copyRow(nFindRow, ds_temp_mainrecitem, insRow);
  141. }
  142. sDrnm = e.posttext;
  143. sDrcd = e.postvalue;
  144. if( utlf_isNull(e.posttext) ){
  145. sDrnm = "";
  146. sDrcd = "";
  147. obj.value = "";
  148. }
  149. ds_data_recitem.setColumn(nFindRow, "rectermcd", sDrcd);
  150. ds_data_recitem.setColumn(nFindRow, "rectermnm", sDrnm);
  151. }
  152. /****************************************************************************************
  153. * Function : fRadioYN
  154. * Description : 라디오버튼 선택에 따른 reccnts셋팅
  155. ****************************************************************************************/
  156. function fRadioYN(obj:Radio, e:ItemChangeEventInfo)
  157. {
  158. var sDegnitemlevlcd = obj.degnitemlevlcd;
  159. var nFindRow = ds_data_recitem.findRow("degnitemlevlcd", sDegnitemlevlcd);
  160. if(nFindRow == -1)
  161. {
  162. nFindRow = ds_data_recitem.addRow();
  163. var insRow = ds_temp_mainrecitem.findRow("degnitemlevlcd", sDegnitemlevlcd);
  164. ds_data_recitem.copyRow(nFindRow, ds_temp_mainrecitem, insRow);
  165. }
  166. ds_data_recitem.setColumn(nFindRow, "rectermcd", e.postvalue);
  167. ds_data_recitem.setColumn(nFindRow, "rectermnm", e.posttext);
  168. }
  169. /****************************************************************************************
  170. * Function : fPatientHist
  171. * Description : 수술이력 팝업
  172. * retrun type :
  173. ****************************************************************************************/
  174. function fPatientHist()
  175. {
  176. frmf_modal("SMMMO02500", "SMMMO02500", null, null, null, null, null, null, null, null, null, null, "M");
  177. }
  178. /**
  179. * @desc : 기록 인스턴스 연결
  180. * @
  181. * @param :
  182. * @return :
  183. * @authur : 박종훈
  184. */
  185. function fSetRecItemValue(reciteminfo)
  186. {
  187. return SetCommMediFormValue(gItemCds, reciteminfo);
  188. }
  189. /**
  190. * @desc : 수술예약번호를 통한 진단명, 마취종류 조회
  191. * @
  192. * @param :
  193. * @return :
  194. * @---------------------------------------------------
  195. */
  196. function fGetdiagFormOprsrvno(oprsrvno, iMcdnm, iMcdnm, iScdnm, iScdnm)
  197. {
  198. if(oprsrvno != ""){
  199. model.removeNodeset("/root/main/diaginfo/diagcdlist");
  200. model.makeValue("/root/send/oprsrvno", oprsrvno);
  201. //model.makeValue("/root/send/oprsrvno", "2007000009");
  202. submit("TRMRF04001", false);//TRMRF04001 : (oprd, anst) 수술진단조회, 마취주부
  203. var anstmthdcd = model.getValue("/root/main/diaginfo/anstlist/anstmthdcd");
  204. var mcdnm = model.getValue("/root/main/diaginfo/anstlist/mcdnm");
  205. var anstmthdcdsub = model.getValue("/root/main/diaginfo/anstlist/anstmthdcdsub");
  206. var scdnm = model.getValue("/root/main/diaginfo/anstlist/scdnm");
  207. var pageInfo = new PAGEINFO();
  208. var iptMObj = document.controls("ipt_mcdnm");
  209. var iptSObj = document.controls("ipt_scdnm");
  210. return true;
  211. }else{
  212. return false;
  213. }
  214. }
  215. /****************************************************************************************
  216. * Function : fSetSizeFormDiag
  217. * Description : 수술전 진단명 사이즈 조절
  218. * retrun type :
  219. ****************************************************************************************/
  220. function fSetSizeFormDiag()
  221. {
  222. grup_base.ivw_0007983001.fInitPage(false, parseInt(grup_base.ivw_0007983001.position.height), parseInt(grup_base.ivw_0007983001.position.width), "ivw_0007983001", "수술전 진단명(Free text)");
  223. }
  224. /****************************************************************************************
  225. * Function : fSetSizeFormDiag1
  226. * Description : 수술후 진단명 사이즈 조절
  227. * retrun type :
  228. ****************************************************************************************/
  229. function fSetSizeFormDiag1()
  230. {
  231. grup_base.ivw_0000521001.fInitPage(false, parseInt(grup_base.ivw_0000521001.position.height), parseInt(grup_base.ivw_0000521001.position.width), "ivw_0000521001", "수술후 진단명(Free text)");
  232. }
  233. /****************************************************************************************
  234. * Function : fSetSizeFormOpr
  235. * Description : 서식 수술명 사이즈 조절
  236. * retrun type :
  237. ****************************************************************************************/
  238. function fSetSizeFormOpr()
  239. {
  240. grup_base.ivw_0000509001.fInitPage(false, parseInt(grup_base.ivw_0000509001.position.height), parseInt(grup_base.ivw_0000509001.position.width), "ivw_0000509001");
  241. }
  242. /*****************************************************************************
  243. 튜닝
  244. ******************************************************************************/
  245. var gLoadFormCnts = 0;
  246. /****************************************************************************************
  247. * Function : fFormReady()
  248. * Description : 화면 로딩후 초기화 작업 수행
  249. * retrun type :
  250. ****************************************************************************************/
  251. function fFormReady()
  252. {
  253. this.ComnFormObj = this.grup_base;
  254. dsf_createDsRow("ds_temp_mainrecitem",
  255. [{col:"formxrw", val:""}]);
  256. // 공통서식의 초기 recitem 정보. 기록 데이터 조합시 사용
  257. ds_temp_mainrecitem.assign(ds_data_recitem);
  258. lf_setSectionSize(gItemCds, "grup_base.tar_0012039001", "grup_base.tar_0012039001", 350);
  259. //20080702 박종훈 추가
  260. InitBtnImge(gItemCdsTextArea);
  261. InitBtnEtcRec(gItemCdsTextArea);
  262. // InitBtnComn(gItemCdsTextArea);
  263. // dispOnLoadComplete(COMN_FORM);
  264. // lf_checkUnitForm(gItemCds); // 부분서식 로딩
  265. lf_AllLoadUnitFormExpand(gItemCds); // 전체 로드
  266. if (parent.fGetFormRec("status") == "C")
  267. {
  268. if(!fClearComnFormData()){
  269. return false;
  270. }
  271. }
  272. else if (parent.fGetFormRec("status") == "U")
  273. {
  274. fCosignCheck();
  275. }
  276. //2010.01.25, hkjoo
  277. // initCmbExtnList(gItemCds);
  278. lf_setRecData(arrItemCds);
  279. initFormAtLast_MMR01100I();
  280. }
  281. /****************************************************************************************
  282. * Function : fLoadUnitForm()
  283. * Description : 부분서식 로딩
  284. * retrun type :
  285. ****************************************************************************************/
  286. function fLoadUnitForm()
  287. {
  288. initSection(gItemCds);
  289. }
  290. var diagcnt = 0;
  291. /****************************************************************************************
  292. * Function : fOnLoadComplete()
  293. * Description : 부분서식 로딩후 후처리
  294. * retrun type :
  295. ****************************************************************************************/
  296. function fOnLoadComplete()
  297. {
  298. var rtn = false;
  299. var curLoadFormCd = frmf_getParameter("loadformcd");
  300. frmf_setParameter("loadformcd", "");
  301. var nFindRow = ds_data_unitformmast.findRowExpr("formcd=='" + curLoadFormCd + "' && loaded != 'true'");
  302. var fstLevlItemCd = ds_data_unitformmast.getColumn(nFindRow, "orgsupdegnitemcd");
  303. var ivwObj = ComnFormObj.components["ivw_" + fstLevlItemCd];
  304. var unitformload = ds_data_unitformmast.getColumn(nFindRow, "loaded");
  305. if(!utlf_isNull(ivwObj) && unitformload != "true")
  306. {
  307. //setFstLevlItemCd(ivwObj, curLoadFormCd);
  308. var nRow = ds_data_unitformmast.findRow("formcd", curLoadFormCd);
  309. ds_data_unitformmast.setColumn(nRow, "loaded", "true");
  310. }
  311. //수술전진단명 부분서식 로딩후 처리
  312. if(fstLevlItemCd == '0007983001')
  313. {
  314. fSetSizeFormDiag();
  315. }
  316. //수술후진단명 부분서식 로딩후 처리
  317. if(fstLevlItemCd == '0000521001')
  318. {
  319. fSetSizeFormDiag1();
  320. if (parent.fGetFormRec("status") == "C")
  321. {
  322. }
  323. }
  324. //수술명 부분서식 로딩후 처리
  325. if(fstLevlItemCd == '0000509001')
  326. {
  327. fSetSizeFormOpr();
  328. if (parent.fGetFormRec("status") == "C")
  329. {
  330. if(!fClearComnFormData()){
  331. return false;
  332. }
  333. }
  334. else if (parent.fGetFormRec("status") == "U")
  335. {
  336. fCosignCheck();
  337. }
  338. }
  339. gLoadFormCnts++;
  340. utlf_addLog("@@@@@ gItemCds.length : " + gItemCds.length + " gLoadFormCnts : " + gLoadFormCnts );
  341. if(gItemCds.length == gLoadFormCnts)
  342. {
  343. if (parent.fGetFormRec("status") == "U")
  344. {
  345. }
  346. dispOnLoadComplete(UNIT_FORM);//COMN_FORM = 1, UNIT_FORM = 2, GENL_FORM = 3
  347. //서식 로딩 후 포커스 처리(2008-11-18 박종훈)
  348. SetDefFocusIVW(gItemCdsTextArea);
  349. }
  350. }
  351. /****************************************************************************************
  352. * Function : fGetDefData()
  353. * Description : 동일 서식이 떠있을 경우 내부 인스턴스 로딩 후 디폴트 조회내용 조회
  354. * retrun type :
  355. ****************************************************************************************/
  356. function fGetDefData()
  357. {
  358. fSetSizeFormOpr();
  359. operation = sysf_getGlobalVariable("operation").split("▩")[1];
  360. if(!utlf_isNull(operation)){
  361. oprsrvno = operation.split("▦")[0];
  362. perfdeptcd = operation.split("▦")[10];
  363. }
  364. dispOnLoadComplete(UNIT_FORM);//COMN_FORM = 1, UNIT_FORM = 2, GENL_FORM = 3
  365. }
  366. /****************************************************************************************
  367. * Function : fBtnDisEnable()
  368. * Description : 저장버튼 Disable
  369. * retrun type :
  370. ****************************************************************************************/
  371. function fBtnDisEnable(flag)
  372. {
  373. if(flag)
  374. {
  375. parent.fDisalbeSave(flag);
  376. }
  377. else
  378. {
  379. parent.fDisalbeSave(flag);
  380. }
  381. }
  382. /****************************************************************************************
  383. * Function : fCosignCheck()
  384. * Description : 코사인버튼처리
  385. * retrun type :
  386. * History : 2010.04.20 dhkim 스탭권한체크 서브미션 TRMMR01302로 변경(unpreplib호출로 통합)
  387. ****************************************************************************************/
  388. function fCosignCheck()
  389. {
  390. //2010.04.20 dhkim 스탭권한체크 서브미션 TRMMR01302로 변경(unpreplib호출로 통합)
  391. //이전의 TRMMR00802 호출부분은 주석처리함.
  392. if (parent.fGetFormRec("status") == "U" && parent.fGetFormRec("espiyn") == "Y")
  393. {
  394. ds_send_extninfo.clearData();
  395. var nRow = ds_send_extninfo.addRow();
  396. ds_send_extninfo.setColumn(nRow, "infoflag", "staffauth");
  397. ds_send_extninfo.setColumn(nRow, "formrecseq", parent.fGetFormRec("formrecseq"));
  398. dsf_setDefaultVal(ds_send_extninfo, "dschdd:99991231");
  399. var oParam = {};
  400. oParam.id = "TRMMR01302";
  401. oParam.service = "medirecapp.RecIf";
  402. oParam.method = "reqGetFormRecExtnInfo";
  403. oParam.inds = "req=ds_send_extninfo";
  404. oParam.outds = "ds_main_extninfo_resultinfo=resultinfo ds_main_extninfo_staffauthinfo=staffauthinfo ds_main_extninfo_oprinfo=oprinfo "
  405. + "ds_main_extninfo_oplistinfo=oplistinfo ds_main_extninfo_recitem=recitem ds_main_extninfo_drlistinfo=drlistinfo "
  406. + "ds_data_diagcdlist=diagcdlist ds_main_extninfo_selectoplist=selectoplist ds_main_extninfo_dscinoutinfo=dscinoutinfo "
  407. + "ds_main_extninfo_rectextinfo=rectextinfo ds_main_extninfo_anstdrlistinfo=anstdrlistinfo ds_main_extninfo_oproomlistinfo=oproomlistinfo "
  408. + "ds_main_extninfo_recseqinfo=recseqinfo ds_main_extninfo_etcinfo=etcinfo";
  409. oParam.async = false;
  410. oParam.callback = "cf_TRMMR01302";
  411. tranf_submit(oParam);
  412. if(arErrorCode.pop("TRMMR01302") > -1)
  413. {
  414. var nRow = ds_main_extninfo_staffauthinfo.rowposition;
  415. var authyn = ds_main_extninfo_staffauthinfo.getColumn(nRow, "authyn");
  416. if(authyn == "Y")
  417. {
  418. //인증저장버튼과 코사인버튼처리
  419. parent.grup_btn.btn_cosign.position.left = parent.grup_btn.btn_signsave.position.left;
  420. parent.grup_btn.btn_signsave.visible = false;
  421. parent.grup_btn.btn_cosign.visible = true;
  422. //임시저장버튼과 기록반려버튼처리
  423. parent.grup_btn.btn_resend.position.left = parent.grup_btn.btn_tmpsave.position.left;
  424. parent.grup_btn.btn_tmpsave.visible = false;
  425. parent.grup_btn.btn_resend.visible = true;
  426. //기타버튼 disable처리
  427. parent.grup_btn.btn_init.enable = false;
  428. parent.grup_btn.btn_preview.enable = false;
  429. parent.grup_btn.btn_signsaveasnew.enable = false;
  430. parent.grup_btn.btn_del.enable = false;
  431. if (parent.fGetFormRec("cosign") == "Y")
  432. {
  433. parent.grup_btn.btn_cosign.enable = false;
  434. grup_base.enable = false;
  435. }
  436. else
  437. {
  438. parent.grup_btn.btn_cosign.enable = true;
  439. grup_base.enable = true;
  440. }
  441. }
  442. else
  443. {
  444. //인증저장버튼과 코사인버튼처리
  445. parent.grup_btn.btn_signsave.visible = true;
  446. parent.grup_btn.btn_cosign.visible = false;
  447. //임시저장버튼과 기록반려버튼처리
  448. parent.grup_btn.btn_tmpsave.visible = true;
  449. parent.grup_btn.btn_resend.visible = false;
  450. //기타버튼 disable처리
  451. parent.grup_btn.btn_init.enable = true;
  452. parent.grup_btn.btn_preview.enable = true;
  453. parent.grup_btn.btn_signsaveasnew.enable = true;
  454. parent.grup_btn.btn_del.enable = true;
  455. }
  456. }
  457. }
  458. }
  459. function cf_TRMMR01302(sSvcId, nErrorCode, sErrorMsg) {
  460. arErrorCode.push(sSvcId, nErrorCode);
  461. if(nErrorCode < 0) return;
  462. // sysf_trace("***** cf_TRMMR01302 *****");
  463. dsf_setDefaultVal(ds_main_extninfo_recitem, "recitemno:'',degnitemno:'',supdegnitemno:''");
  464. dsf_setTypeFormat(ds_main_extninfo_recitem, "recitemno:INT^degnitemno:INT^supdegnitemno:INT");
  465. }
  466. /****************************************************************************************
  467. * Function : fDefInfo_MMR00601()
  468. * Description : 수술에 대한 기본 정보 조회
  469. * retrun type :
  470. ****************************************************************************************/
  471. function fDefInfo_MMR00601()
  472. {
  473. return;//2010.01..18 dhkim 사용안함
  474. }
  475. /****************************************************************************************
  476. * Function : fSetOprRecIf_MMR00601()
  477. * Description : 수술기록 인터페이스 내용 셋팅
  478. * retrun type :
  479. ****************************************************************************************/
  480. function fSetOprRecIf_MMR00601()
  481. {
  482. return; //2010.01.18 dhkim 사용안함
  483. }
  484. /**
  485. * @group :
  486. * @ver : 2009.01.05
  487. * @by : jonghun
  488. * @---------------------------------------------------
  489. * @type : function
  490. * @access : private
  491. * @desc : 서식 로딩 완료 후 수술 예약번호 유무에 따라 서식 내용 셋팅
  492. * @param :
  493. * @return :
  494. * @---------------------------------------------------
  495. */
  496. function fSetOprInfo_MMR00601()
  497. {
  498. if (parent.window.javascript.fGetFormRec("status") == "C")
  499. {
  500. var dschdd = parent.window.javascript.fGetPamInfo("dschdd");
  501. if (dschdd == "" || dschdd == "-")
  502. {
  503. dschdd = "99991231";
  504. }
  505. model.makeValue("/root/send/oprinfo/pid", parent.window.javascript.fGetPamInfo("pid"));
  506. model.makeValue("/root/send/oprinfo/indd", parent.window.javascript.fGetPamInfo("indd"));
  507. model.makeValue("/root/send/oprinfo/dschdd", dschdd);
  508. //TRMMR01002 : (oprs, opcr)수술확정일자, 수술명, 과 -->콤보에 세팅
  509. if (submit("TRMMR01002")) //수술 이력 조회
  510. {
  511. var nodeList = model.instances(0).selectNodes("/root/init/oprlist/oplist");
  512. if (oprsrvno != "")
  513. {
  514. parent.window.javascript.fSetFormRec("oprsrvno", oprsrvno);
  515. model.makeValue("/root/send/reqinfstrec/pid", parent.window.javascript.fGetPamInfo("pid"));
  516. model.makeValue("/root/send/reqinfstrec/orddd", parent.window.javascript.fGetPamInfo("indd"));
  517. model.makeValue("/root/send/reqinfstrec/cretno", parent.window.javascript.fGetPamInfo("cretno"));
  518. model.makeValue("/root/send/reqinfstrec/oprsrvno", oprsrvno);
  519. //TRMMR01003 : (oprd, anst)수술진단조회,마취주부
  520. if (submit("TRMMR01003")) //수술 예약번호에 따른 수술기록지 기록내용 조회
  521. {
  522. var nodeList1 = model.instances(0).selectNodes("/root/main/infstrec/recitem");
  523. //해당 수술건에 대한 수술기록 유무에 따른 분기
  524. if (nodeList1.length > 0)
  525. {
  526. fSetOprRecIf_MMR00601();
  527. }
  528. else
  529. {
  530. fDefInfo_MMR00601(); //수술기록이 없을경우 디폴트 정보 조회
  531. }
  532. }
  533. }
  534. else if(nodeList.length == 1)
  535. {
  536. var opsrvno = model.getValue("/root/init/oprlist/oplist/oprsrvno");
  537. if (opsrvno != "" && opsrvno != "-")
  538. {
  539. parent.window.javascript.fSetFormRec("oprsrvno", opsrvno);
  540. model.makeValue("/root/send/reqinfstrec/pid", parent.window.javascript.fGetPamInfo("pid"));
  541. model.makeValue("/root/send/reqinfstrec/orddd", parent.window.javascript.fGetPamInfo("indd"));
  542. model.makeValue("/root/send/reqinfstrec/cretno", parent.window.javascript.fGetPamInfo("cretno"));
  543. model.makeValue("/root/send/reqinfstrec/oprsrvno", opsrvno);
  544. //TRMMR01003 : (oprd, anst)수술진단조회,마취주부
  545. if (submit("TRMMR01003")) //수술 예약번호에 따른 수술기록지 기록내용 조회
  546. {
  547. var nodeList2 = model.instances(0).selectNodes("/root/main/infstrec/recitem");
  548. //해당 수술건에 대한 수술기록 유무에 따른 분기
  549. if (nodeList2.length > 0)
  550. {
  551. fSetOprRecIf_MMR00601();
  552. }
  553. else
  554. {
  555. fDefInfo_MMR00601(); //수술기록이 없을경우 디폴트 정보 조회
  556. }
  557. }
  558. }
  559. }
  560. else
  561. {
  562. var curdd = getCurrentDate();
  563. model.setValue(pageInfo.recItemRef + "[degnitemlevlcd=0000515]/reccnts", curdd);
  564. }
  565. }
  566. }
  567. }
  568. /****************************************************************************************
  569. * Function : getSubmitID_MMR01300I
  570. * Description : MMR01300.js에서 submit직전에 submitID를 설정하기 위해서 호출한다.
  571. * retrun type :
  572. ****************************************************************************************/
  573. function getSubmitID_MMR01300I(flag) {
  574. //2010.02.23 dhkim - 통합기록조회용 JCI구분자추가(fSetXsltFlag없애고 getSubmitID_MMR01300I로 이동)
  575. parent.fSetFormRec("xsltflag", "JCI");
  576. //2010.03.12 안치원 - 수정없이 staff-sign할때 xsltflag가 들어가지 않는 오류수정
  577. if (utlf_isNull(flag)) {
  578. parent.fSetFormRec("extnflag", "opr");
  579. parent.fSetFormRec("addexecflag", "cosign");
  580. return TX_SUBMIT_EXTN_FORM;
  581. }
  582. }
  583. function fSetOpInfo_SMMMR00601() {
  584. }
  585. /****************************************************************************************
  586. * Function : fCosignCheck_SMMMR00601
  587. * Description : staff-sign 버튼을 설정한다.
  588. * retrun type :
  589. ****************************************************************************************/
  590. function fCosignCheck_SMMMR00601() {
  591. if (parent.fGetFormRec("formrecdeptcd") == sysf_getUserInfo("dutplcecd")) {
  592. if (parent.fGetFormRec("espiyn") == "Y") {
  593. var authyn = ds_main_extninfo_staffauthinfo.getColumn(0, "authyn");
  594. var cosign = parent.fGetFormRec("cosign");
  595. utlf_addLog("authyn :"+authyn + "cosign :"+cosign );
  596. utlf_addLog("authyn getFormrec:"+parent.fGetFormRec("authyn"));
  597. if (cosign == "Y") {
  598. if (parent.fGetFormRec("cosignid") == sysf_getUserId()) {
  599. if (parent.fGetFormRec("formrecuserid") == sysf_getUserId()) {
  600. //staff이 신규작성하여 sign된 경우 수정모드
  601. // [요청번호:20180712032] 입퇴원요약기록, 수술기록의 STAFF SIGN 관련건 수정모드 -> 싸인모드
  602. parent.initButtonLayer_MMR01100("staff_auth_y");
  603. } else {
  604. //전공의가 신규작성하여 staff이 sign한 경우 싸인모드
  605. parent.initButtonLayer_MMR01100("staff_auth_y");
  606. }
  607. } else {
  608. //staff sign이후이므로 staff이외에는 수정불가
  609. parent.initButtonLayer_MMR01100("no_auth");
  610. }
  611. } else {
  612. if (authyn == "Y") {
  613. //전공의 신규작성후에 staff이 수정모드로 열었으므로, 싸인모드
  614. parent.initButtonLayer_MMR01100("staff_auth_y");
  615. } else {
  616. //수정모드
  617. parent.initButtonLayer_MMR01100("staff_auth_n");
  618. }
  619. }
  620. } else {
  621. //수정모드
  622. parent.initButtonLayer_MMR01100("staff_auth_n");
  623. }
  624. } else {
  625. parent.initButtonLayer_MMR01100("no_auth");
  626. }
  627. }
  628. /**
  629. * @desc : 보조의combo노드에 none을 추가한다.
  630. * @
  631. * @param :
  632. * @return :
  633. * @authur : dhkim 20091228
  634. */
  635. function fMakeNodeSdt_MMR00601(nodeset){
  636. ///root/init/drlist0000341.0001830/usercombo
  637. var sdtNodeCnt = getNodesetCount(nodeset);
  638. if(sdtNodeCnt > 0){
  639. model.makeValue(nodeset+"["+sdtNodeCnt+"]/userid", "none");
  640. model.makeValue(nodeset+"["+sdtNodeCnt+"]/usernm", "없음");
  641. model.makeValue(nodeset+"["+sdtNodeCnt+"]/mpphonno", "");
  642. model.makeValue(nodeset+"["+sdtNodeCnt+"]/refseq", "C");
  643. }
  644. model.refresh();
  645. }
  646. /****************************************************************************************
  647. * Function : initFormAtLast_MMR01100I
  648. * Description : MMR01100.js에서 서식load를 완료한 후에 호출한다.
  649. * retrun type :
  650. ****************************************************************************************/
  651. function initFormAtLast_MMR01100I() {
  652. var formcd = parent.fGetFormMast("formcd");
  653. //신규서식로딩의 경우만 Brief Op Note 연동
  654. if (parent.fGetFormRec("status") == "C") {
  655. //2010.01.21 dhkim - 리턴값 추가(blocking 메세지후 리턴)
  656. if(!fGetRecIfData_MMR00601("oprec")){
  657. return false;
  658. }
  659. var cnt = ds_main_extninfo_oplistinfo.getRowCount();
  660. if (cnt == 0) {
  661. sysf_messageBox("수술이 없는", "I005");
  662. grup_base.enable = false;
  663. parent.initButtonLayer_MMR01100("no_auth");
  664. return;
  665. } else if (cnt == 1) {
  666. ds_send_reqinfstrec.setColumn(0, "oprsrvno", ds_init_extninfo_oplistinfo.getColumn(0, "oprsrvno"));
  667. grup_base.cmb_oplist.enable = false;
  668. parent.initButtonLayer_MMR01100("staff_auth_n");
  669. parent.fSetFormRec("oprsrvno", ds_send_reqinfstrec.getColumn(0, "oprsrvno"));
  670. lodedYn = false;
  671. if(!fGetRecIfData_MMR00601("oprec;opr")){
  672. return false;
  673. }
  674. } else {
  675. //ds_send_reqinfstrec.setColumn(0, "oprsrvno", ds_init_extninfo_oplistinfo.getColumn(0, "oprsrvno"));
  676. ds_send_reqinfstrec.setColumn(0, "oprsrvno", "");
  677. grup_base.cmb_oplist.enable = true;
  678. if (parent.fGetFormRec("status") == "C") {
  679. parent.initButtonLayer_MMR01100("no_auth");
  680. }
  681. }
  682. } else {
  683. if (parent.fGetFormRec("espiyn") == "Y") {
  684. //2010.01.21 dhkim - 리턴값 추가(blocking 메세지후 리턴)
  685. //2010.01.29 dhkim - 수술기록JCI Staff-Sign 막음.
  686. //2010.02.09 dhkim- 수술기록JCI Staff-Sign 주석해제.
  687. if(!fGetRecIfData_MMR00601("staffauth;oplist;drlist")){
  688. return false;
  689. }
  690. } else {
  691. if(!fGetRecIfData_MMR00601("oplist;drlist")){
  692. return false;
  693. }
  694. }
  695. ds_send_reqinfstrec.setColumn(0, "oprsrvno", parent.fGetFormRec("oprsrvno"));
  696. grup_base.cmb_oplist.enable = false;
  697. fCosignCheck_SMMMR00601();
  698. }
  699. return true;
  700. }
  701. /****************************************************************************************
  702. * Function : fChngOpList_MMR00601
  703. * Description : 수술리스트 콤보선택시 수술번호로 Brief OP Note를 찾아 설정한다.
  704. * 신규서식일때만 수행하도록 한다.
  705. * retrun type :
  706. ****************************************************************************************/
  707. function fChngOpList_MMR00601()
  708. {
  709. utlf_addLog(" *** fChngOpList_MMR00601 ***");
  710. if (parent.fGetFormRec("status") == "C") {
  711. var v_oprsrvno = grup_base.cmb_oplist.value;//ds_send_reqinfstrec.getColumn(0, "oprsrvno");
  712. if (!utlf_isNull(v_oprsrvno)) {
  713. //model.removenodeset("/root/init/extninfo/oplistinfo[oprsrvno = '']");
  714. parent.fSetFormRec("oprsrvno", v_oprsrvno);
  715. //2010.01.21 dhkim - 리턴값 추가(blocking 메세지후 리턴)
  716. //2010.01.29 dhkim - 수술기록JCI Staff-Sign 막음.
  717. //2010.02.09 dhkim- 수술기록JCI Staff-Sign 주석해제.
  718. if(!fGetRecIfData_MMR00601("drlist;opr;recdata;staffauth")){
  719. return false;
  720. }
  721. fCosignCheck_SMMMR00601();
  722. }
  723. }
  724. return true;//2010.01.21 dhkim - 리턴값 추가(blocking 메세지후 리턴)
  725. }
  726. /****************************************************************************************
  727. * Function : fGetRecIfData_MMR00601
  728. * Description : 수술기록의 Data를 설정한다.
  729. * retrun type :
  730. ****************************************************************************************/
  731. function fGetRecIfData_MMR00601(infoflag) {
  732. ds_send_extninfo.clearData();
  733. var nRow = ds_send_extninfo.addRow();
  734. ds_send_extninfo.setColumn(nRow, "infoflag", infoflag);
  735. ds_send_extninfo.setColumn(nRow, "pid", parent.fGetFormRec("pid"));
  736. ds_send_extninfo.setColumn(nRow, "orddd", parent.fGetFormRec("orddd"));
  737. ds_send_extninfo.setColumn(nRow, "cretno", parent.fGetFormRec("cretno"));
  738. ds_send_extninfo.setColumn(nRow, "fromsrcformcd", "0000003169"); //BriefOpNote기록의 기본서식코드
  739. ds_send_extninfo.setColumn(nRow, "toformcd", parent.fGetFormMast("formcd"));
  740. ds_send_extninfo.setColumn(nRow, "srcformcd", parent.fGetFormRec("srcformcd"));
  741. ds_send_extninfo.setColumn(nRow, "formrecdd", parent.fGetFormRec("formrecdd"));
  742. ds_send_extninfo.setColumn(nRow, "oprsrvno", parent.fGetFormRec("oprsrvno"));
  743. ds_send_extninfo.setColumn(nRow, "indd", ds_send_extninfo.getColumn(0, "orddd"));
  744. ds_send_extninfo.setColumn(nRow, "standd", parent.fGetFormRec("formrecdd"));
  745. ds_send_extninfo.setColumn(nRow, "deptcd", parent.fGetFormRec("formrecdeptcd"));
  746. ds_send_extninfo.setColumn(nRow, "jobkindcd", "0330");
  747. //2010.02.22 dhkim 추가
  748. ds_send_extninfo.setColumn(nRow, "formrecseq", parent.fGetFormRec("formrecseq"));
  749. dsf_setDefaultVal(ds_send_extninfo, "dschdd:99991231");
  750. lf_clearExtninfo();
  751. var oParam = {};
  752. oParam.id = "TRMMR01302";
  753. oParam.service = "medirecapp.RecIf";
  754. oParam.method = "reqGetFormRecExtnInfo";
  755. oParam.inds = "req=ds_send_extninfo";
  756. oParam.outds = "ds_main_extninfo_resultinfo=resultinfo ds_main_extninfo_staffauthinfo=staffauthinfo ds_main_extninfo_oprinfo=oprinfo "
  757. + "ds_main_extninfo_oplistinfo=oplistinfo ds_main_extninfo_recitem=recitem ds_main_extninfo_drlistinfo=drlistinfo "
  758. + "ds_data_diagcdlist=diagcdlist ds_main_extninfo_selectoplist=selectoplist ds_main_extninfo_dscinoutinfo=dscinoutinfo "
  759. + "ds_main_extninfo_rectextinfo=rectextinfo ds_main_extninfo_anstdrlistinfo=anstdrlistinfo ds_main_extninfo_oproomlistinfo=oproomlistinfo "
  760. + "ds_main_extninfo_recseqinfo=recseqinfo ds_main_extninfo_etcinfo=etcinfo";
  761. oParam.async = false;
  762. oParam.callback = "cf_TRMMR01302";
  763. tranf_submit(oParam);
  764. if(arErrorCode.pop("TRMMR01302") > -1)
  765. {
  766. var execInfoFlag = ds_main_extninfo_resultinfo.getColumn(0, "infoflag");
  767. utlf_addLog(" fGetRecIfData_MMR00601 execInfoFlag : " + execInfoFlag );
  768. if (execInfoFlag.indexOf("oplist;") != -1) {
  769. //수술리스트설정
  770. ds_init_extninfo_oplistinfo.clearData();
  771. ds_init_extninfo_oplistinfo.copyData(ds_main_extninfo_oplistinfo);
  772. }
  773. if (execInfoFlag.indexOf("opr;") > -1) {
  774. //수술일자
  775. if( ds_main_extninfo_oprinfo.rowcount > 0 ){
  776. var nOprRow = ds_main_extninfo_oprinfo.rowposition;
  777. var opcnfmdd = ds_main_extninfo_oprinfo.getColumn(nOprRow, "opcnfmdd");
  778. var opcnfmhm = ds_main_extninfo_oprinfo.getColumn(nOprRow, "opcnfmhm");
  779. parent.fSetFormRec("formrecdd", opcnfmdd);
  780. //parent.fSetFormRec("formrechm", opcnfmhm);
  781. }
  782. }
  783. //2010.01.15 dhkim - 수술전 진단명, 수술후 진단명 추가
  784. // sysf_trace(ds_data_diagcdlist.getRowCount());
  785. if (execInfoFlag.indexOf("opdiag;") != -1 && lodedYn == true) {
  786. //수술진단 설정
  787. // copyNodeset("/root/main/diaginfo/diagcdlist", "/root/main/extninfo/diagcdlist", "replace", ivw_0007983001.model, model);
  788. // copyNodeset("/root/main/diaginfo/diagcdlist", "/root/main/extninfo/diagcdlist", "replace", ivw_0000521001.model, model);
  789. grup_base.ivw_0007983001.fSetDiagNmInstance();
  790. grup_base.ivw_0000521001.fSetDiagNmInstance();
  791. }
  792. //2010.05.19 김달현 - recdata, opr, opdiag 분기순서변경
  793. //alert("execInfoFlag : " + execInfoFlag);
  794. if (execInfoFlag.indexOf("recdata;") != -1) {
  795. if( lodedYn == true ){
  796. ClearComnFormData(gItemCds);
  797. }
  798. /* jw.choe 임시 주석
  799. //Copy Of Brief OP Note
  800. copyNodeset(gPageInfo.recItemRef2, "/root/main/extninfo/recitem", "replace", model, model);
  801. //2010.01.21 dhkim - 리턴값 추가(blocking 메세지후 리턴)
  802. if(!fLoadData()){
  803. return false;
  804. }
  805. */
  806. fSetCopyRecData();
  807. }
  808. // 2017.09.12 submit 수행 실패시에만 return false 처리(기존 수술기록과 동일하도록 처리)
  809. // else
  810. // {
  811. // lodedYn = true;
  812. // return false;
  813. // }
  814. var sStatus = fGetFormRec("status");
  815. lf_setBasicInfo(sStatus); //수술 정보 기록데이터 세팅
  816. lodedYn = true; // 로드 시점 처리
  817. //2010.01.21 dhkim - 리턴값 추가(blocking 메세지후 리턴)
  818. return true;
  819. }else{
  820. lodedYn = true;
  821. return false;
  822. }
  823. }
  824. /****************************************************************************************
  825. * Function : fSetCopyRecData
  826. * Description : BriefOpNote 정보 연계
  827. * retrun type :
  828. ****************************************************************************************/
  829. function fSetCopyRecData()
  830. {
  831. utlf_addLog(" fGetFormRec(status) : " + fGetFormRec("status") + "\n\n" + ds_main_extninfo_recitem.saveXML() );
  832. if(fGetFormRec("status") == "C")
  833. {
  834. var fstlevlitemcd = "";
  835. var degnitemcd = "";
  836. var reccnts = "";
  837. var degnitemkind = "";
  838. var sRow = "";
  839. // 1계층 MTX값 세팅, 조회해온 기록값 rowcount 만큼 루프
  840. for(var i = 0; i < ds_main_extninfo_recitem.rowcount; i++)
  841. {
  842. fstlevlitemcd = ds_main_extninfo_recitem.getColumn(i, "fstlevlitemcd");
  843. degnitemcd = ds_main_extninfo_recitem.getColumn(i, "degnitemcd");
  844. reccnts = ds_main_extninfo_recitem.getColumn(i, "reccnts");
  845. degnitemkind = ds_main_extninfo_recitem.getColumn(i, "degnitemkind");
  846. // 최상위 아이템이고 1계층 MTX 값이 있으면 세팅
  847. // 부분서식은 각자 onload 시 기록데이터 세팅
  848. if( (fstlevlitemcd == degnitemcd) && !utlf_isNull(reccnts))
  849. {
  850. sRow = ds_data_recitem.findRowExpr("fstlevlitemcd == '"+ fstlevlitemcd +"' && degnitemcd == '"+ degnitemcd +"' && degnitemkind == 'MTX'");
  851. ds_data_recitem.setColumn(sRow, "reccnts", reccnts);
  852. var tarObj = ComnFormObj.components["tar_" + fstlevlitemcd];
  853. if(tarObj != null)
  854. tarObj.value = reccnts;
  855. }
  856. // Grid 설정
  857. if( degnitemkind == "DGN" || degnitemkind == "OPN" ){
  858. var grdObj = grup_base.components["ivw_" + fstlevlitemcd ];
  859. if( lodedYn == true && !utlf_isNull(grdObj) && !utlf_isNull(grdObj.url) ){
  860. grdObj.lf_setGridModify(fstlevlitemcd, "N");
  861. }
  862. }
  863. }
  864. }
  865. }
  866. ]]></Script>