MMR01102.xjs 34 KB

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