123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977 |
- var gItemCds = new Array("0000960001", "0011449001", "0001019001", "0011529001");
- var gItemCdsTextArea = new Array("0011449001", "0011529001");
- var gItemCdsXRWArea = new Array("0000960001", "0001019001");
- var gPageIdx = new Array(0, 0);
- var instance = document.models(0).instances(0);
- var gdeptcd = "";
- var cnstflag = parent.window.javascript.getParameter("SMMMR04900_cnstflag");
- // 20131120 소화기내시경의뢰서 사이즈 확장으로 인해서 사용한 변수
- var chknum = 0;
- var mtxh = null;
- var ivwfrmh = null;
- var tar11529001t = null;
- var tar11529001h = null;
- var grp11529001h = null;
- var grp11529001t = null;
- var ivw11449001h = null;
- var grp11449001h = null;
- var grpcnth = null;
- /**
- * @desc : 확장버튼(이미지,가계도,추가기록)을 기록여부에 따라 표시를 위한 버튼목록
- * @id :
- * @authur : 안치원
- * @history : 2009.09.09 신규 안치원 ACW_090909A
- */
- var gExtnBtnIds = new Array("btn_etcrec_0011449001", "btn_imge_0011449001",
- "btn_etcrec_0011529001", "btn_imge_0011529001");
- /**
- * @desc : 화면 초기화
- * @
- * @param :
- * @return :
- * @authur : 박종훈
- * @---------------------------------------------------
- */
- function fFormReady_old()
- {
- lbl_0011449001.attribute("width") = "593";
- lbl_0011529001.attribute("width") = "593";
- ivw_0000960001.attribute("width") = "593";
- ivw_0011449001.attribute("width") = "593";
- ivw_0001019001.attribute("width") = "593";
- ivw_0011529001.attribute("width") = "593";
- ipt_formnm.attribute("top") = ipt_recdoct.attribute("top");
- ipt_formnm.attribute("left") = ipt_recdoct.attribute("left");
- //fSetViewMode("0");
- parent.window.javascript.fSetFormNm("Consult");
- // if (submit("TRMMR04901") && submit("TRMMR04902"))
- // {
- // fSortCnstDpList(); //컨설트 구분
- // }
- // else
- // {
- // }
- parent.window.javascript.fEndFormReady("SMMMR04900");
- if (opener.window.javascript.getParameter("SMMMR04900_newcnstform") == "Y")
- parent.window.javascript.fEndFormReady("SMMMR04900_newcnstform");
- }
- /**
- * @desc : 수신부서 선택 시 이벤트
- * @
- * @param :
- * @return :
- * @authur : 박종훈
- * @---------------------------------------------------
- */
- function fAfterChoiRecvDeptCd(formcd)
- {
- SetUserTimeLog("MMR04900", "fAfterChoiRecvDeptCd", parent.model);
- var deptcd = model.getValue("/root/init/cond/rscdeptcd");
- parent.window.javascript.setParameter("userdeptcd", deptcd);
- var cnstdeptcd = parent.window.javascript.getParameter("SMMMR04900_cnstdeptcd");
- var cnstdeptnm = model.getXPathValue("/root/main/cnstformlist/cnstform[cnstdeptcd='"+cnstdeptcd+"']/cnstdeptnm");
- model.setValue("/root/init/cond/cnstflag", cnstflag);
- fSetViewMode(cnstflag);
- if (cnstflag == "1")
- {
- var drid = parent.window.javascript.getParameter("SMMMR04900_drid");
- var drnm = model.getXPathValue("/root/init/recvrlist/usercombo[userid='"+drid+"']/usernm");
- var hopedd = parent.window.javascript.getParameter("SMMMR04900_hopedd");
- formcd = model.getXPathValue("/root/main/cnstformlist/cnstform[cnstdeptcd='"+deptcd+"']/formcd");
- model.setValue("/root/init/cond/formcd", formcd);
- fSetOpenFormCd();
- }
- else if (cnstflag == "3")
- {
- ipt_formnm.visible = true;
- cap_mode1.visible = true;
- var formnm = parent.window.javascript.getParameter("SMMMR04900_formnm");
- var formcd = parent.window.javascript.getParameter("SMMMR04900_formcd");
- model.setValue("/root/init/cond/formnm", formnm);
- model.setValue("/root/init/cond/formcd", formcd);
- fSetOpenFormCd();
- }
- else
- {
- alert("Consult대상부서가 아닙니다.");
- return false;
- }
- return true;
- }
- /**
- * @desc : 컨설트 서식 오픈시 이벤트
- * @
- * @param :
- * @return :
- * @authur : 박종훈
- * @---------------------------------------------------
- */
- function fOpenCnstForm(formcd, deptcd, cnstflag)
- {
- SetUserTimeLog("MMR04900", "fOpenCnstForm", parent.model);
- parent.window.javascript.setParameter("userdeptcd", deptcd)
- model.setValue("/root/init/cond/cnstflag", cnstflag);
- fSetViewMode(cnstflag);
- if (cnstflag == "1")
- {
- // btn_sch.attribute("visibility") = "visible";
- // reqGetDrList("/root/init/reqdata", "/root/init/drlist", deptcd, "");
- formcd = model.getXPathValue("/root/main/cnstformlist/cnstform[cnstdeptcd='"+deptcd+"']/formcd");
- model.setValue("/root/init/cond/formcd", formcd);
- fSetOpenFormCd();
- }
- else if (cnstflag == "3")
- {
- //btn_sch.attribute("visibility") = "hidden";
- //aa.aa();
- var path = "";
- if (formcd == null)
- {
- path = "/root/main/cnstformlist/cnstform[cnstdeptcd='"+deptcd+"']";
- copyNodeset("/root/main/cmbformlist/cnstform", path, "replace", model, model);
- }
- else
- {
- path = "/root/main/cnstformlist/cnstform[formcd='"+formcd+"']";
- copyNodeset("/root/main/cmbformlist/cnstform", path, "replace", model, model);
- }
- var cnt = getNodesetCnt(model, path);
- if (cnt == 1)
- {
- ipt_formnm.visible = false;
- cap_mode1.visible = false;
- formcd = model.getValue(path+"/formcd");
- model.setValue("/root/init/cond/formcd", formcd);
- fSetOpenFormCd();
- }
- else
- {
- ipt_formnm.visible = true;
- cap_mode1.visible = true;
- }
- }
- else
- {
- alert("Consult대상부서가 아닙니다.");
- return false;
- }
- return true;
- }
- /**
- * @desc : 진료, 타과의뢰시 서식 항목 표현 설정
- * @
- * @param :
- * @return :
- * @authur : 박종훈
- * @---------------------------------------------------
- */
- function fSetViewMode(cnstflag)
- {
- if (cnstflag == "0")
- {
- grup_cnts.visible = false;
- }
- if (cnstflag == "1")
- {
- cap_mode1.text = "수신자";
- cap_hordt.visible = false;
- ipt_hordtm.visible = false;
- ipt_recdoct.visible = true;
- cmb_recdoct.visible = true;
- ipt_formnm.visible = false;
- }
- else if (cnstflag == "3")
- {
- cap_mode1.text = "의뢰항목";
- cap_hordt.visible = false;
- ipt_hordtm.visible = false;
- /* 20121112 정창혁 지원부서의뢰신규 수신의추가로 인한 변경 아래로 대체
- ipt_recdoct.visible = false;
- cmb_recdoct.visible = false;
- cmb_recdept.visible = false;
- ipt_formnm.visible = true;
- */
- ipt_recdoct.visible = false;
- cmb_recdoct.visible = true;
- cmb_recdept.visible = false;
- ipt_formnm.visible = true;
-
- }
- }
- /**
- * @desc : 오픈된 서식코드 셋팅
- * @
- * @param :
- * @return :
- * @authur : 박종훈
- * @---------------------------------------------------
- */
- function fSetOpenFormCd()
- {
- SetUserTimeLog("MMR04900", "fSetOpenFormCd", parent.model);
- grup_cnts.visible = true;
- var formcd = parent.window.javascript.getParameter("SMMMR04900_formcd");
- //parent.window.javascript.fLoadNewForm(formcd);
- }
- /**
- * @desc : 서식 오픈
- * @
- * @param :
- * @return :
- * @authur : 박종훈
- * @---------------------------------------------------
- */
- function fLoadForm_old()
- {
- SetUserTimeLog("MMR04900", "fLoadForm", parent.model);
- InitUnitForm(gItemCdsTextArea, gPageIdx, 1, grup_cnts);
- InitSetUnitForm(gItemCdsXRWArea, false);
- body.visible = true;
- makeRefByDegnitemno();
- fExtnInitFormRec();
- parent.window.javascript.gSubmitID = TX_SUBMIT_EXTN_FORM;
- gFstItemCds = new Array("0011449001", "0011449001", "0011529001", "0011529001");
- if (parent.javascript.fGetFormMast("formcd") == "0000000692" || parent.javascript.fGetFormMast("formcd")=="1600017738")
- btn_homenurord.attribute("visibility") = "visible";
- else
- btn_homenurord.attribute("visibility") = "hidden";
- }
- /**
- * @desc : 서식 내용 초기화
- * @
- * @param :
- * @return :
- * @authur : 박종훈
- * @---------------------------------------------------
- */
- function fClearComnFormData()
- {
- ClearComnFormData(gItemCds);
- clearData();
-
- //fExtnInitFormRec(); //2008-07-05 기록을 위한 초기화
- /*var ivwfrm = document.controls("ivw_0011449001");
- var diagnm = getParameter("SSMRF04000_diagnm");
- if (diagnm != "" && cnstflag == "1")
- {
- var reqcnt = "상기 환자는 진단명[" + diagnm + "](으)로 현재 치료중인 환자입니다.";
- ivwfrm.model.setValue("/root/main/recinfo/recitem[degnitemcd='0000146001' and degnitemlevlcd = '0011449.0000146']/reccnts", reqcnt);
- model.refresh();
- }*/
- }
- /**
- * @desc : 기록 내용 조회 및 조회 후 처리 로직
- * @
- * @param :
- * @return :
- * @authur : 박종훈
- * @---------------------------------------------------
- */
- function fLoadData()
- {
- InitPgmFormData();
- this.recRef2 = "/root/hidden/recinfo";
- InitUnitFormData(gItemCds);
- model.setValue("/root/send/formrecseq", parent.window.javascript.fGetFormRec("formrecseq"));
- model.setValue("/root/send/userdeptcd", parent.window.javascript.getParameter("userdeptcd"));
-
- //alert(parent.window.javascript.fGetFormRec("formrecseq") + ", " + parent.window.javascript.getParameter("userdeptcd"));
- //영적의뢰지 진단명 안보이게
- if(parent.javascript.fGetFormRec("formcd") == "0000000695")
- {
- var grdgrupheight = grup_extn0011529001.attribute("height");
- grup_extn0011529001.attribute("height") = 0;
- ivw_0011529001.attribute("top") = 23;
- ivw_0011529001.attribute("height") = parseInt(ivw_0011529001.attribute("height")) + parseInt(grdgrupheight);
- }
- if (submit("TRMMR04903"))
- {
- var cnstflag = model.getValue("/root/main/cnstinfo/cnstflag");
- var apprtdrid = model.getValue("/root/main/cnstinfo/apprtdrid");
- var inptuserid = model.getValue("/root/main/cnstinfo/inptuserid");
- var cnststat = model.getValue("/root/main/cnstinfo/cnststat");
- var recvuserid = model.getValue("/root/main/cnstinfo/recvuserid"); //20121112 정창혁 추가
-
- fSetRecvDeptCd(cnstflag);
- // 아이템 disable
- ipt_recdept.disabled = true;
- ipt_recdoct.disabled = true;
- cmb_inptuserid.disabled = true;
- cmb_apprtdrid.disabled = true;
- ipt_formnm.disabled = true;
- ipt_hordtm.disabled = true;
-
- //회신 전 상태의 경우 수신과, 수신의사 콤보 활성화(2010.03.18 박종훈)
- var iCnststat = parseInt(parent.window.javascript.fGetFormRec("cnststat"));
- var sRequserid = model.getValue("/root/main/cnstinfo/requserid");
- var sApprtdrid = model.getValue("/root/main/cnstinfo/apprtdrid");
- var sInptuserid = model.getValue("/root/main/cnstinfo/inptuserid");
- var sUserid = getUserInfo("userid")
-
- //수정권한을 과가 아닌 주치의, 담당의, 입력의로 변경(2010.04.07 박종훈)
- if (cnstflag == "1" && (iCnststat > 5 && iCnststat < 21) && (sUserid == sRequserid || sUserid == sApprtdrid || sUserid == sInptuserid))
- {
- cmb_recdept.disabled = false;
- cmb_recdoct.disabled = false;
- }
- else
- {
- cmb_recdept.disabled = true;
- cmb_recdoct.disabled = true;
- }
-
- mmbfGetUserComboList("/root/send/reqdata", "/root/init/userlist", model.getValue("/root/main/cnstinfo/reqdeptcd"), "0330");
-
- //수신과 의사 조회
- mmbfGetUserComboList("/root/send/reqdata", "/root/init/recvrlist", model.getValue("/root/main/cnstinfo/recvdeptcd"), "0330");
- model.setValue("/root/init/cond/apprtdrid", apprtdrid);
- model.setValue("/root/init/cond/inptuserid", inptuserid);
- model.setValue("/root/init/cond/rscdoctid", recvuserid); //20121109 정창혁 수신의 추가
- fSetViewMode(cnstflag);
- var showflag = model.getValue("/root/main/cnstinfo/showflag");
- if (showflag == "req")
- {
- SetUnitFormFullSize("0011449001", 0, gItemCds, gPageIdx, grup_cnts);
-
- //2010-07-27 김달현 ivw.src를 지움으로 인해 컨설트 회신시 입력한 내용이 공백으로 저장되는 오류 발생하여 주석처리
- //ivw_0011529001.src = ""; //2010-04-06 오후 1:12:36 강지훈 수정 : 격리병실신청 수정시 보이지않는 부분필수체크때문에 수정안되는 오류 수정
-
- //2010-07-27 김달현 notChkEssnYn 플래그를 추가(Y:저장시 필수체크안함. N:저장시 필수체크함)
- //의뢰서의 경우 ivw_0011529001(회신뷰어) 필수체크 안함설정
- ivw_0011529001.attribute("notChkEssnYn") = "Y";
- grup_cnts.visible = true;
- }
- else
- {
- var aUnitFormOrgiHeig = new Array(150, 175);
- var aUnitFormOrgoHeig = new Array(263, 287);
-
- InitUnitFormData(gItemCds);
- //SetUnitFormOrgSize(gItemCdsTextArea, 150, 263);
- SetUnitFormOrgSizeCnst(gItemCdsTextArea, aUnitFormOrgiHeig, aUnitFormOrgoHeig);
-
-
- //2010-07-27 김달현 notChkEssnYn 플래그를 추가(Y:저장시 필수체크안함. N:저장시 필수체크함)
- //회신서의 경우 ivw_0011529001(회신뷰어) 필수체크설정
- ivw_0011529001.attribute("notChkEssnYn") = "N";
-
- grup_cnts.visible = true;
- }
- var reqedityn = model.getValue("/root/main/cnstinfo/reqedityn");
- if (reqedityn == "Y")
- {
- EditableCtrl(window.grup_0011449001, true);
- }
- else
- {
- EditableCtrl(window.grup_0011449001, false);
- fEditablefalse();
- }
- var recvedityn = model.getValue("/root/main/cnstinfo/recvedityn");
- if (recvedityn == "Y")
- {
- EditableCtrl(window.grup_0011529001, true);
- fSetRecvDefSyntex();
- //fEditablefalse();
- }
- else
- {
- var replflag = model.getValue("/root/main/cnstinfo/replflag");
-
- EditableCtrl(window.grup_0011529001, false);
-
- if (model.getValue("/root/main/cnstinfo/recvdeptcd") == getUserInfo("dutplcecd"))
- {
- btn_addrepl.disabled = false;
- }
- else
- {
- btn_addrepl.disabled = true;
- }
-
- if (replflag == "T")
- {
- btn_etcrec_0011529001.disabled = false;
- }
- }
-
- //회신확정 이전의 상태에서는 추가회신 버튼 비활성화
- if(cnststat >= 30 && model.getValue("/root/main/cnstinfo/recvdeptcd") == getUserInfo("dutplcecd"))
- {
- btn_addrepl.disabled = false;
- }
- else
- {
- btn_addrepl.disabled = true;
- }
-
- fCheckCnstWriteUser();
-
- var replflag = model.getValue("/root/main/cnstinfo/replflag");
- if ((cnststat >= 22 && recvedityn == "Y") || (replflag == "T" && showflag != "req"))
- {
- opener.window.btn_tmpsave.disabled = true;
- }
- else
- {
- opener.window.btn_tmpsave.disabled = false;
- }
-
- //if ((cnststat >= 22 && recvedityn == "Y"))
- //{
- // opener.window.btn_tmpsave.disabled = true;
- //}
- //else if(replflag == "T" && showflag != "req"){ //2009-12-08 오후 7:32:55 강지훈 수정 : 팀의뢰 관련 수정
- // opener.window.btn_tmpsave.disabled = true;
- // opener.window.btn_tmpsave.visible = false;
- // opener.window.btn_tmpsave.refresh();
- //}
- //else
- //{
- // opener.window.btn_tmpsave.visible = true;
- // opener.window.btn_tmpsave.disabled = false;
- //}
- parent.window.javascript.gSubmitID = TX_SUBMIT_EXTN_FORM;
- parent.window.javascript.fSetFormRec("extnflag", "cnst");
- parent.window.javascript.fSetFormRec("cnstflag", cnstflag);
- parent.window.javascript.fSetFormRec("replflag", model.getValue("/root/main/cnstinfo/replflag"));
- parent.window.javascript.fSetFormRec("userdeptcd", parent.window.javascript.getParameter("userdeptcd"));
-
-
- //전문간호의뢰의 경우 전공의 입력의 항목 안보이게..
- //if (cnstflag == "3")
- if (model.getValue("/root/main/cnstinfo/recvdeptcd") == "3043900000" || model.getValue("/root/main/cnstinfo/formcd") == "0000002911")
- {
- caption1.attribute("visibility") = "hidden";
- caption10.attribute("visibility") = "hidden";
- cmb_apprtdrid.attribute("visibility") = "hidden";
- cmb_inptuserid.attribute("visibility") = "hidden";
- caption2.text = "의뢰자";
- }
- else if (parent.window.javascript.fGetFormRec("chosflag") == "E" && parent.window.javascript.fGetFormRec("orddeptcd") == "2280000000")
- {
- caption1.attribute("visibility") = "hidden";
- caption10.attribute("visibility") = "hidden";
- cmb_apprtdrid.attribute("visibility") = "hidden";
- cmb_inptuserid.attribute("visibility") = "hidden";
- caption2.text = "의뢰의";
- }
-
- model.refresh();
- }
- //회신서가 작성된 화면도 의뢰내용만 보이게..
- if (opener.window.javascript.getParameter("cnstopenmode") != "" && opener.window.javascript.getParameter("cnstopenmode") == "Y")
- {
- //SetUnitFormFullSize("0011449001", 0, gItemCds, gPageIdx, grup_cnts);
- grup_cnts.visible = true;
- opener.window.javascript.fDisalbeSave(true);
- }
-
- //영양평가의뢰 회신내용 자동입력부분
- var replcnts = getParameter("MMR04900_replcnts");
- var overwrite = getParameter("MMR04900_overwrite");
-
- clearParameter("MMR04900_replcnts");
- clearParameter("MMR04900_overwrite");
-
- if (replcnts != "" && overwrite != "")
- {
- var replflag = model.getValue("/root/main/cnstinfo/replflag");
- if (replflag == "T")
- {
- var curdt = getCurrentDate();
- var curtm = getCurrentTime().substr(0, 4);
-
- var parmdt = curdt.substr(0, 4) + "-" + curdt.substr(4, 2) + "-" + curdt.substr(6, 2);
- var parmtm = curtm.substr(0, 2) + ":" + curtm.substr(2, 2);
-
- replcnts = "▣ 팀교육 의뢰 회신 " + parmdt + " " + parmtm + " " + " 회신부서 : " + getUserInfo("dutplcenm") + " 작성자 : " + getUserInfo("usernm") + "\n" + replcnts + "\n";
- }
-
- fSetReplCnts(replcnts, eval(overwrite));
- }
-
- }
- /**
- * @desc : 작성권한에 따른 서식 저장 권한 체크
- * @
- * @param :
- * @return :
- * @authur : 박종훈
- * @---------------------------------------------------
- */
- function fCheckCnstWriteUser()
- {
- //debugger;
- var showflag = model.getValue("/root/main/cnstinfo/showflag");
- var reqedityn = model.getValue("/root/main/cnstinfo/reqedityn");
- var recvedityn = model.getValue("/root/main/cnstinfo/recvedityn");
- var replflag = model.getValue("/root/main/cnstinfo/replflag");
- if ((reqedityn == "Y" || recvedityn == "Y") || (replflag == "T" && showflag == "both"))
- {
- opener.window.javascript.fDisalbeSave(false);
- }
- else
- {
- opener.window.javascript.fDisalbeSave(true);
- }
- }
- /**
- * @desc : 기록 아이템 Disable
- * @
- * @param :
- * @return :
- * @authur : 박종훈
- * @---------------------------------------------------
- */
- function fEditablefalse()
- {
- //그룹으로 묶을것(아래)
- ipt_recdept.disabled = true;
- ipt_recdoct.disabled = true;
- cmb_inptuserid.disabled = true;
- cmb_apprtdrid.disabled = true;
- ipt_formnm.disabled = true;
- ipt_hordtm.disabled = true;
- rdo_eryn.disabled = true;
- tar_cntcno.disabled = true;
- }
- /**
- * @desc : 프리텍스트 항목 크기 최대화
- * @
- * @param :
- * @return :
- * @authur : 박종훈
- * @---------------------------------------------------
- */
- function fSetMultiTextFull()
- {
- for (var i = 0; i < gItemCdsTextArea.length; i++)
- {
- SetMultiTextFull(document.controls("ivw_" + gItemCdsTextArea[i]), 1);
- }
- }
- /**
- * @desc : 새로운 컨설트 서식 오픈
- * @
- * @param :
- * @return :
- * @authur : 박종훈
- * @---------------------------------------------------
- */
- function fNewCnstForm(formcd, userdeptcd)
- {
- SetUserTimeLog("MMR04900", "fNewCnstForm", parent.model);
- model.setValue("/root/init/cond/rscdeptcd", userdeptcd);
- var cnstdeptcd = parent.window.javascript.getParameter("SMMMR04900_cnstdeptcd");
- var drid = parent.window.javascript.getParameter("SMMMR04900_drid");
- model.setValue("/root/init/cond/rscdeptcd", cnstdeptcd);
- model.setValue("/root/init/cond/rscdoctid", drid);
- var flag = fAfterChoiRecvDeptCd(formcd);
- return flag;
- }
- /**
- * @desc : 아이템 수정 불가
- * @
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fSaveAfter()
- {
- var tmpCnststat = model.getValue("/root/main/cnstinfo/cnststat");
-
- if (tmpCnststat == "12" || tmpCnststat == "20")
- {
- opener.window.btn_tmpsave.disabled = true;
- }
-
- ipt_recdept.disabled = true;
- ipt_recdoct.disabled = true;
- cmb_inptuserid.disabled = true;
- cmb_apprtdrid.disabled = true;
- ipt_formnm.disabled = true;
- ipt_hordtm.disabled = true;
- rdo_eryn.disabled = true;
- //
-
- //회신 전 상태의 경우 수신과, 수신의사 콤보 활성화(2010.03.18 박종훈)
- var iCnststat = parseInt(parent.window.javascript.fGetFormRec("cnststat"));
- var sRequserid = model.getValue("/root/main/cnstinfo/requserid");
- var sApprtdrid = model.getValue("/root/main/cnstinfo/apprtdrid");
- var sInptuserid = model.getValue("/root/main/cnstinfo/inptuserid");
- var sUserid = getUserInfo("userid")
-
- //수정권한을 과가 아닌 주치의, 담당의, 입력의로 변경(2010.04.07 박종훈)
- if (cnstflag == "1" && (iCnststat > 5 && iCnststat < 21) && (sUserid == sRequserid || sUserid == sApprtdrid || sUserid == sInptuserid))
- {
- cmb_recdept.disabled = false;
- cmb_recdoct.disabled = false;
- }
- else
- {
- cmb_recdept.disabled = true;
- cmb_recdoct.disabled = true;
- }
- //tar_cntcno.disabled = true;
- model.refresh();
- }
- /**
- * @desc : 가정간호 처방화명 호출
- * @
- * @param :
- * @return :
- * @authur : 박종훈
- * @---------------------------------------------------
- */
- function fDoHomeNurOrd()
- {
- if (parent.javascript.fGetFormRec("formcd") == "0000000692" || parent.javascript.fGetFormRec("formcd") == "1600017738")
- {
- if (parent.javascript.fGetFormRec("status") == "C" || parent.javascript.fGetFormRec("espiyn") == "N")
- {
- messageBox("가정간호의뢰를 인증저장후에 시도하여 주십시요.", "I", "");
- return;
- }
- else
- {
- if (parent.javascript.fGetFormRec("espiyn") == "Y" && parseInt(parent.javascript.fGetFormRec("cnststat")) > 12)
- {
- setParameter("SMMMB00500_scrnflag", "D"); //저장, 삭제 disable
- }
- /**
- * 가정간호의뢰지일때 처방오픈
- * SMMMB00500_formrecseq : formrecseq 기록순번
- * SMMMB00500_prcpfromdd : formrecdd 기록일자
- */
-
- var sPrcpfromdd = model.getValue("/root/main/cnstinfo/reqdd");
-
- if (sPrcpfromdd == "")
- {
- sPrcpfromdd = getCurrentDate();
- }
-
- setParameter("SMMMB00500_formrecseq", parent.javascript.fGetFormRec("formrecseq"));
- setParameter("SMMMB00500_prcpfromdd", sPrcpfromdd);
- modal("SMMMB00500", 1, 0, 0, "", "", "");
- }
- }
- }
- /**
- * @desc : 서식진단명 로드 완료 후 진단명 조회
- * @
- * @param :
- * @return :
- * @authur : 박종훈
- * @---------------------------------------------------
- */
- function fGetDiag_old()
- {
- ivw_0000960001.window.javascript.fInitPage(false, parseInt(ivw_0000960001.attribute("height")), parseInt(ivw_0000960001.attribute("width")));
- ivw_0001019001.window.javascript.fInitPage(false, parseInt(ivw_0001019001.attribute("height")), parseInt(ivw_0001019001.attribute("width")));
- ivw_0000960001.window.javascript.fGetDiagNm(parent.instance1.selectSingleNode("/root/main/recinfo/formrec")); //환자정보로 진단명 조회
- fGetRecDeptDoct();
- }
- /**
- * @desc : 서식 수정 여부 체크
- * @
- * @param :
- * @return :
- * @authur : 박종훈
- * @---------------------------------------------------
- */
- function fCheckWriteUserSubForm()
- {
- if (opener.window.javascript.getParameter("SMMMR04900_newcnstform") == "Y")
- {
- ipt_recdept.disabled = true;
- ipt_recdoct.disabled = true;
- cmb_inptuserid.disabled = true;
- cmb_apprtdrid.disabled = true;
- ipt_formnm.disabled = true;
- ipt_hordtm.disabled = true;
- }
- }
- /**
- * @desc : 기록부서, 의사 조회하기
- * @
- * @param :
- * @return :
- * @authur : 박종훈
- * @---------------------------------------------------
- */
- function fGetRecDeptDoct()
- {
- var treplflag = parent.window.javascript.getParameter("SMMMR04900_replflag");
- var cnstdeptcd = parent.window.javascript.getParameter("SMMMR04900_cnstdeptcd");
- var cnstdeptnm = parent.window.javascript.getParameter("SMMMR04900_cnstdeptnm");
- //var cnstdeptnm = model.getXPathValue("/root/main/cnstformlist/cnstform[cnstdeptcd='"+cnstdeptcd+"']/cnstdeptnm");
- model.setValue("/root/main/recinfo/recitem[degnitemno='" + ipt_recdept.attribute("extn_degnitemno") + "']/rectermcd", cnstdeptcd);
- model.setValue("/root/main/recinfo/recitem[degnitemno='" + ipt_recdept.attribute("extn_degnitemno") + "']/rectermnm", cnstdeptnm);
- mmbfGetUserComboList("/root/send/reqdata", "/root/init/recvrlist", cnstdeptcd, "0330"); //수신자 콤보 데이터 조회
-
- if (cnstflag == "1")
- {
- var drid = parent.window.javascript.getParameter("SMMMR04900_drid");
- var drnm = model.getXPathValue("/root/init/recvrlist/usercombo[userid='"+drid+"']/usernm");
- var hopedd = parent.window.javascript.getParameter("SMMMR04900_hopedd");
- model.setValue("/root/main/recinfo/recitem[degnitemno='" + ipt_recdoct.attribute("extn_degnitemno") + "']/rectermcd", drid);
- model.setValue("/root/main/recinfo/recitem[degnitemno='" + ipt_recdoct.attribute("extn_degnitemno") + "']/rectermnm", drnm);
- model.setValue("/root/main/recinfo/recitem[degnitemno='" + ipt_hordtm.attribute("degnitemno") + "']/reccnts", hopedd); //희망진료일시
- }
- else if (cnstflag == "3" && treplflag == "D")
- {
- model.setValue("/root/main/recinfo/recitem[degnitemno='" + ipt_recdoct.attribute("extn_degnitemno") + "']/rectermcd", parent.window.javascript.getParameter("SMMMR04900_cnstuserid"));
- model.setValue("/root/main/recinfo/recitem[degnitemno='" + ipt_recdoct.attribute("extn_degnitemno") + "']/rectermnm", parent.window.javascript.getParameter("SMMMR04900_cnstusernm"));
- }
- fSetRecvDeptCd(cnstflag);
- model.refresh();
- }
- /**
- * @desc : 응급여부 선택에 따른 reccnts셋팅
- * @
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fEmergencYN()
- {
- var sEmerCd = model.getValue("/root/main/recinfo/recitem[degnitemno='" + rdo_eryn.attribute("degnitemno") + "']/rectermcd");
- var sEmerNm = model.getValue("/root/main/forminfo/vallist[valcd='" + sEmerCd + "']/valitemnm");
- model.setValue("/root/main/recinfo/recitem[degnitemno='" + rdo_eryn.attribute("degnitemno") + "']/rectermnm", sEmerNm);
- model.refresh();
- }
- /**
- * @desc : 진료일정 팝업
- * @
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fPDrSchedule()
- {
- var drid = ipt_recdoct.value;
- var deptcd = ipt_recdept.value;
- var orddd = ipt_hordtm.value.substring(0 , 8);
- if (orddd == "")
- orddd = getCurrentDate();
- model.makeValue("/root/temp/tmpnode/orddrid", drid);
- model.makeValue("/root/temp/tmpnode/orddeptcd", deptcd);
- model.makeValue("/root/temp/tmpnode/orddd", orddd);
- modal("SPPMB01200", "1", "100", "100" ,"SPPMB01200", "/root/temp/tmpnode", "/root/temp/tmpnode");
- var rtn = getParameter("SPPMB01200_RTN");
- var horddd = getParameter("SPPMB01200_orddd");
- var hordtm = getParameter("SPPMB01200_ordtm");
- var orddrid = getParameter("SPPMB01200_orddrid");
- var orddeptcd = getParameter("SPPMB01200_orddeptcd");
- if (rtn == "Y")
- {
- var iFndRow = getNodesetCnt(model, "/root/main/cnstdeptlist/cnstdept[cnstdeptcd='" + orddeptcd + "']");
- if (iFndRow > 0){
- model.setValue("/root/init/cond/rscdeptcd", orddeptcd);
- fSetRecvDeptCd();
- model.setValue("/root/init/cond/rscdoctid", orddrid);
- model.setValue("/root/init/cond/hordtm", hordtm);
- ipt_recdoct.refresh();
- model.setValue("/root/main/recinfo/recitem[degnitemno='" + ipt_recdept.attribute("extn_degnitemno") + "']/rectermcd", ipt_recdept.value);
- model.setValue("/root/main/recinfo/recitem[degnitemno='" + ipt_recdept.attribute("extn_degnitemno") + "']/rectermnm", ipt_recdept.label);
- model.setValue("/root/main/recinfo/recitem[degnitemno='" + ipt_recdoct.attribute("extn_degnitemno") + "']/rectermcd", ipt_recdoct.value);
- model.setValue("/root/main/recinfo/recitem[degnitemno='" + ipt_recdoct.attribute("extn_degnitemno") + "']/rectermnm", ipt_recdoct.label);
- model.setValue("/root/main/recinfo/recitem[degnitemno='" + ipt_hordtm.attribute("degnitemno") + "']/reccnts", horddd); //희망진료일시
- model.refresh();
- } else {
- alert("Consult대상부서가 아닙니다.");
- return;
- }
- }
- //model.removeNodeset("/root/temp/tmpnode");
- }
- /**
- * @desc : 수신부서 셋팅
- * @
- * @param :
- * @return :
- * @authur : 박종훈
- * @modify : 2008-07-05 박종훈
- * @---------------------------------------------------
- */
- function fSetRecvDeptCd(cnstflag)
- {
- var deptnm = model.getValue("/root/main/recinfo/recitem[degnitemcd='0010381001']/rectermnm");
- var deptcd = model.getValue("/root/main/recinfo/recitem[degnitemcd='0010381001']/rectermcd");
- model.setValue("/root/init/cond/rscdeptcd", deptcd);
- model.setValue("/root/init/cond/rscdeptnm", deptnm);
- if (cnstflag == "1")
- {
- var drid = model.getValue("/root/main/recinfo/recitem[degnitemcd='0010383001']/rectermcd");
- var drnm = model.getValue("/root/main/recinfo/recitem[degnitemcd='0010383001']/rectermnm");
- model.setValue("/root/init/cond/rscdoctid", drid);
- model.setValue("/root/init/cond/rscdoctnm", drnm);
-
- /* 2012/02/15 영상구분을 안보이게 설정하면서 추가로 주석처리
- //2012/02/09 Start 진료의뢰신규에서 수신과가 영상의학과일때 영상구분을 선택 할 수 있도록 셋팅
- if(model.getValue("/root/init/cond/rscdeptcd")=="2160000000"){
- combo1.disabled=false;
- }else{
- combo1.deselect();
- combo1.disabled=true;
- }
- //2012/02/09 End
- */
- }
- else if (cnstflag == "3")
- {
- var formnm = model.getValue("/root/main/forminfo/formmast/formnm");
- var formcd = model.getValue("/root/main/forminfo/formmast/formcd");
- model.setValue("/root/init/cond/formcd", formcd);
- model.setValue("/root/init/cond/formnm", formnm);
- }
- fEditablefalse();
- rdo_eryn.disabled = false;
- tar_cntcno.disabled = false;
- model.refresh();
- }
- /**
- * @desc : 컨설트 부서리스트 구분자('-------------')삽입
- * @
- * @param :
- * @return :
- * @authur : 박종훈
- * @---------------------------------------------------
- */
- function fSortCnstDpList()
- {
- var cnstDeptList = instance.selectNodes("/root/main/cnstdeptlist/cnstdept");
- var cnstdeptcd = "";
- var cnstdeptnm = "";
- var cnstflag = "";
- if(cnstDeptList.length >= 1){
- model.copyNode("/root/init/cnstdeptlist", "/root/main/cnstdeptlist");
- var path1 = "/root/init/cnstdeptlist/cnstdept[cnstflag='1']";
- copyNodeset("/root/main/cnstdeptlist/cnstdept", path1, null, model, model);
- var path2 = "/root/init/cnstdept";
- copyNodeset("/root/main/cnstdeptlist/cnstdept", path2, "after", model, model);
- var path3 = "/root/init/cnstdeptlist/cnstdept[cnstflag='3']";
- copyNodeset("/root/main/cnstdeptlist/cnstdept", path3, "after", model, model);
- model.removeNodeset("/root/init/cnstdeptlist");
- model.refresh();
- }
- }
- /**
- * @desc : 저장전 항목검사
- * @
- * @param :
- * @return :
- * @authur : 박종훈
- * @---------------------------------------------------
- */
- function fChkPreSave()
- {
- var rtn = true;
- var deptcd = model.getValue("/root/init/cond/rscdeptcd");
- var cnstflag = model.getXPathValue("/root/main/cnstdeptlist/cnstdept[cnstdeptcd='" +deptcd+ "']/cnstflag");
- if (cnstflag == "1")
- {
- //var recdoctcd = model.getValue("/root/main/recinfo/recitem[degnitemno='" + ipt_recdoct.attribute("extn_degnitemno") + "']/recrefcd");
- //var recdoctnm = model.getValue("/root/main/recinfo/recitem[degnitemno='" + ipt_recdoct.attribute("extn_degnitemno") + "']/recitemnm");
- var recdoctcd = model.getValue("/root/main/recinfo/recitem[degnitemno='" + ipt_recdoct.attribute("extn_degnitemno") + "']/rectermcd");
- var recdoctnm = model.getValue("/root/main/recinfo/recitem[degnitemno='" + ipt_recdoct.attribute("extn_degnitemno") + "']/rectermnm");
- var hopeordtm = model.getValue("/root/main/recinfo/recitem[degnitemno='" + ipt_hordtm.attribute("degnitemno") + "']/reccnts"); //희망진료일시
- if (recdoctcd == "" || recdoctnm == "" || hopeordtm == "")
- {
- messageBox("수신의사와 희망진료일시는", "I003");
- rtn = false;
- }
- }
- return rtn;
- }
- /**
- * @desc : 회신서 자동입력(영양)
- * @
- * @param :
- * @return :
- * @authur : 박종훈
- * @---------------------------------------------------
- */
- function fSetReplCnts(text, overWrite)
- {
- setItemDataByDegnItemNo(1, text, 2, ivw_0011529001.model, overWrite, "0011529001");
- }
- /**
- * @desc : 의뢰내용 자동입력(영양)
- * @
- * @param :
- * @return :
- * @authur : 박종훈
- * @---------------------------------------------------
- */
- function fSetReqCnts(text, overWrite)
- {
- setItemDataByDegnItemNo(1, text, 2, ivw_0011449001.model, overWrite, "0011449001");
- }
- /*****************************************************************************
- 튜닝
- ******************************************************************************/
- var gLoadFormCnts = 0;
- /**
- * @group :
- * @ver : 2008.06.13
- * @by : snoweye
- * @---------------------------------------------------
- * @type : function
- * @access : private
- * @desc : 화면 로딩후 초기화 작업 수행
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fFormReady()
- {
- //화면 초기화
- lbl_0011449001.attribute("width") = "593";
- lbl_0011529001.attribute("width") = "593";
- ivw_0000960001.attribute("width") = "593";
- ivw_0011449001.attribute("width") = "593";
- ivw_0001019001.attribute("width") = "593";
- ivw_0011529001.attribute("width") = "593";
- ipt_formnm.attribute("top") = ipt_recdoct.attribute("top");
- ipt_formnm.attribute("left") = ipt_recdoct.attribute("left");
- //fGetRecDeptDoct();
-
- mmbfGetHardCodeInfo("/root/send/reqdata","/root/inithrdcd/hrdform", 1210); //의뢰정보 로그인 사용자정보 셋팅 여부(서식)
- mmbfGetHardCodeInfo("/root/send/reqdata","/root/inithrdcd/hrddept", 1220); //의뢰정보 로그인 사용자정보 셋팅 여부(사용자부서)
- //onloadcomplete 이벤트 발생
- dispOnLoadComplete(COMN_FORM);
- //서브밋 설정(일반기록:1301, 확장기록(컨설트, 제증명..):1303)
- //parent.window.javascript.gSubmitID = TX_SUBMIT_EXTN_FORM;
- //가정간호의 경우에만 가정간호처방 버튼 Visible
- var sHomeNurOrd_dispYn = parent.javascript.getParameter("homeNurOrd_dispYn");
- if ( (parent.javascript.fGetFormMast("formcd") == "0000000692" || parent.javascript.fGetFormMast("formcd") == "1600017738") && sHomeNurOrd_dispYn != "N")
- btn_homenurord.attribute("visibility") = "visible";
- else
- btn_homenurord.attribute("visibility") = "hidden";
-
- if (cnstflag == "3")
- {
- btn_etcrec_0011449001.attribute("visibility") = "visible";
- btn_etcrec_0011529001.attribute("visibility") = "visible";
- btn_addrepl.attribute("visibility") = "hidden";
- }
- else
- {
- btn_etcrec_0011449001.attribute("visibility") = "hidden";
- btn_etcrec_0011529001.attribute("visibility") = "hidden";
- btn_addrepl.attribute("visibility") = "visible";
- btn_addrepl.attribute("left") = btn_etcrec_0011529001.attribute("left");
- }
-
- InitBtnImge(gItemCdsTextArea);
- InitBtnEtcRec(gItemCdsTextArea);
-
- //2012/02/08 START
- //하드코드 테이블 체크(영상구분)
- fGetHardCDList("N", 5601, 0 , "/root/init/hardcditem");
- //2012/02/08 END
-
- }
- /**
- * @group :
- * @ver : 2008.06.13
- * @by : snoweye
- * @---------------------------------------------------
- * @type : function
- * @access : private
- * @desc : 부분서식 로딩
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fLoadUnitForm()
- {
- initSection(gItemCds);
- }
- /**
- * @group :
- * @ver : 2008.06.13
- * @by : snoweye
- * @Modify : jonghun(2008-07-05)
- * @---------------------------------------------------
- * @type : function
- * @access : private
- * @desc : 부분서식 로딩후 후처리
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fOnLoadComplete()
- {
- var curLoadFormCd = getParameter("loadformcd");
- var orgsupdegnitemcd = model.getValue(gPageInfo.forminfoRef + "/unitformmast[formcd='" + curLoadFormCd + "' and loaded != 'true']/orgsupdegnitemcd");
-
- //1. 부분서식 레벨코드 보정(fstlevlitemcd 추가)
- var ivwObj = document.controls("ivw_" + orgsupdegnitemcd);
- var unitformload = model.getValue(gPageInfo.forminfoRef + "/unitformmast[formcd='" + curLoadFormCd + "' and loaded != 'true']/loaded");
-
- if(ivwObj != null && unitformload != "true")
- {
- setFstLevlItemCd(ivwObj, curLoadFormCd);
-
- model.setValue(gPageInfo.forminfoRef + "/unitformmast[formcd='" + curLoadFormCd + "' and loaded != 'true']/loaded", "true");
- }
- //2. 부분서식 로딩후 처리
- //2-1. 의뢰내용 진단명
- if(orgsupdegnitemcd == '0000960001')
- {
- fGetReqDiagInfo(ivwObj);
-
- fExtnInitFormRec();
- fGetDiag();
- fSetReqDefSyntex();
- }
- //2-2. 회신내용 진단명
- if(orgsupdegnitemcd == '0001019001')
- {
- fGetReqDiagInfo(ivwObj);
- }
- gLoadFormCnts++;
- if(gItemCds.length == gLoadFormCnts)
- {
- //>2008-07-05 추가
- //fExtnInitFormRec();
- //fGetDiag();
- //alert(2);
- //fSetReqDefSyntex();
- //<
- dispOnLoadComplete(UNIT_FORM);
- }
- }
- /**
- * @group :
- * @ver : 2008.11.28
- * @by : jonghun
- * @---------------------------------------------------
- * @type : function
- * @access : private
- * @desc : 동일 서식이 떠있을 경우 내부 인스턴스 로딩 후 디폴트 조회내용 조회
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fGetDefData()
- {
- if (parent.window.javascript.fGetFormRec("status") == "C")
- {
- fExtnInitFormRec();
- fGetDiag();
- fSetReqDefSyntex();
- }
- dispOnLoadComplete(UNIT_FORM);
- }
- /**
- * @group :
- * @ver : 2008.06.13
- * @by : snoweye
- * @---------------------------------------------------
- * @type : function
- * @access : private
- * @desc : 의뢰 진단명 로드 완료 후 진단명 조회 <-- fGetDiag
- * @param : ivwObj - 부분서식을 포함한 iviewer object
- * @return :
- * @---------------------------------------------------
- */
- function fGetReqDiagInfo(ivwObj)
- {
- if(ivwObj == null)
- return;
- ivwObj.window.javascript.fInitPage(false, parseInt(ivw_0000960001.attribute("height")), parseInt(ivw_0000960001.attribute("width")));
- /*ivw_0000960001.window.javascript.fInitPage(false, parseInt(ivw_0000960001.attribute("height")), parseInt(ivw_0000960001.attribute("width")));
- ivw_0001019001.window.javascript.fInitPage(false, parseInt(ivw_0001019001.attribute("height")), parseInt(ivw_0001019001.attribute("width")));
- ivw_0000960001.window.javascript.fGetDiagNm(parent.instance1.selectSingleNode("/root/main/recinfo/formrec")); //환자정보로 진단명 조회*/
- }
- /**
- * @desc : 서식진단명 로드 완료 후 진단명 조회
- * @
- * @param :
- * @return :
- * @authur : 박종훈
- * @---------------------------------------------------
- */
- function fGetDiag()
- {
- //ivw_0000960001.window.javascript.fInitPage(false, parseInt(ivw_0000960001.attribute("height")), parseInt(ivw_0000960001.attribute("width")));
- //ivw_0001019001.window.javascript.fInitPage(false, parseInt(ivw_0001019001.attribute("height")), parseInt(ivw_0001019001.attribute("width")));
- if (parent.window.javascript.fGetFormRec("status") == "C")
- {
- ivw_0000960001.window.javascript.fGetDiagNm(parent.instance1.selectSingleNode("/root/main/recinfo/formrec")); //환자정보로 진단명 조회
- }
- }
- /**
- * @desc : 의뢰내용 자유입력의 Default구문 처리
- * @
- * @param :
- * @return :
- * @authur : 박종훈
- * @---------------------------------------------------
- */
- function fSetReqDefSyntex()
- {
- if (parent.window.javascript.fGetFormRec("status") != "C")
- return;
-
-
- var ivwfrm = document.controls("ivw_0011449001");
- var diagnm = getParameter("SSMRF04000_diagnm");
- var formcd = parent.window.javascript.fGetFormRec("formcd");
- var reqcnt = "";
- //이윤주(20140812 formcd 조건 추가)
- if (diagnm != "" && cnstflag == "1" && formcd =="0000000677")
- {
- reqcnt = "상기 환자는 진단명[" + diagnm + "](으)로 현재 치료중인 환자입니다.\n";
- ivwfrm.model.setValue("/root/main/recinfo/recitem[degnitemcd='0000146001' and degnitemlevlcd = '0011449.0000146']/reccnts", reqcnt);
- ivwfrm.model.refresh();
- }
-
- if (cnstflag == "1" && formcd =="0000000677")
- {
- var reqcnts = getParameter("MMR04900_reqcnts");
- var reqoverwrite = getParameter("MMR04900_reqoverwrite");
-
- clearParameter("MMR04900_reqcnts");
- clearParameter("MMR04900_reqoverwrite");
-
- if (reqcnts != "" && reqoverwrite != "")
- {
- fSetReqCnts(reqcnts, eval(reqoverwrite));
- ivwfrm.model.refresh();
- }
-
- //이윤주추가(20140818)
- reqcnts = getParameter("SMMMR04900_reqcnt");
- clearParameter("SMMMR04900_reqcnt");
- reqoverwrite = "true";
-
- if (reqcnts != "" && reqoverwrite != "")
- {
- fSetReqCnts(reqcnts, eval(reqoverwrite));
- ivwfrm.model.refresh();
- }
-
-
- var mtxNm = "MTX_1";
- var mtx = ivwfrm.window.document.controls(mtxNm);
-
- ivwfrm.model.setFocus(mtxNm);
-
- //mtx.selBegin = txtSelPos + commuse.length;
- mtx.selBegin = reqcnt.length;
- mtx.dispatch("onkeyup");
- }
- }
- /**
- * @desc : 회신내용 자유입력의 Default구문 처리, 진단명 조회
- * @
- * @param :
- * @return :
- * @authur : 박종훈
- * @---------------------------------------------------
- */
- function fSetRecvDefSyntex()
- {
- var pamleng = parent.instance1.selectSingleNode("/root/main/recinfo/formrec").length;
- var recdiag = ivw_0001019001.instance1.selectNodes("/root/main/recinfo/grid").length;
-
- var chkcnt = null;
- var chkformcd = null;
- var formcdlistNodeCnt = null;
- var formcdlistCnt = 0;
- var stype = parent.window.type;
- if (stype == "modal")
- {
- }else{
- var scrnid = opener.opener.javascript.getScreenID();
- // 2013.11.22 CYW 소화기내시경의뢰서 포맷 변경 =========================
- if( scrnid == "SMMMR05000" ){
- chkcnt = parent.parent.window.document.controls("grd_cnstlist").row;
- chkformcd = parent.parent.model.getValue("/root/main/cnstlist[" + chkcnt + "]/formcd");
- }
-
- if( scrnid == "SMMMR00100" ){
- chkcnt = parent.parent.window.document.controls("grd_medireclist").row;
- chkformcd = parent.parent.model.getValue("/root/main/mainlist/medireclist[" + chkcnt + "]/formcd");
- }
- model.makeNode("/root/temp2");
- mmbfGetHardCodeInfo("/root/send/reqdata", "/root/temp2/formcdlist", 5594 );
- formcdlistNodeCnt = getNodesetCount("/root/temp2/formcdlist/hardcd");
- formcdlistCnt = 0;
-
- for( var i = 1 ; i <= formcdlistNodeCnt ; i++ ){
- if( chkformcd == model.getValue("/root/temp2/formcdlist/hardcd[" + i + "]/hardcd") ){
- formcdlistCnt++;
- }
- }
- //========================================================
- }
-
- if (pamleng > 0 && recdiag <= 0)
- {
- ivw_0001019001.window.javascript.fGetDiagNm(parent.instance1.selectSingleNode("/root/main/recinfo/formrec")); //환자정보로 진단명 조회
- }
-
- var ivwfrm = document.controls("ivw_0011529001");
-
- if (cnstflag == "1")
- {
- var replcnts = ivwfrm.model.getValue("/root/main/recinfo/recitem[degnitemcd='0000146001' and degnitemlevlcd = '0011529.0000146']/reccnts");
- var repNode = ivwfrm.model.instance1.selectSingleNode("/root/main/recinfo/recitem[degnitemcd='0000146001' and degnitemlevlcd = '0011529.0000146']");
-
- if (replcnts == "" && repNode != null)
- {
- var reqcnt = "의뢰하신 환자 진료 잘 보았습니다.\n";
-
- ivwfrm.model.setValue("/root/main/recinfo/recitem[degnitemcd='0000146001' and degnitemlevlcd = '0011529.0000146']/reccnts", reqcnt);
- ivwfrm.model.refresh();
-
- var mtxNm = "MTX_1";
- var mtx = ivwfrm.window.document.controls(mtxNm);
-
- ivwfrm.model.setFocus(mtxNm);
-
- //mtx.selBegin = txtSelPos + commuse.length;
- mtx.selBegin = reqcnt.length;
- mtx.dispatch("onkeyup");
- }
- else
- {
- var mtxNm = "MTX_1";
- var mtx = ivwfrm.window.document.controls(mtxNm);
-
- ivwfrm.model.setFocus(mtxNm);
-
- //mtx.selBegin = txtSelPos + commuse.length;
- mtx.selBegin = replcnts.length;
- mtx.dispatch("onkeyup");
- }
- }else if (cnstflag == "3" && formcdlistCnt > 0 ){ // 소화기내시경의뢰서
- var replcnts = ivwfrm.model.getValue("/root/main/recinfo/recitem[degnitemcd='0000146001' and degnitemlevlcd = '0011529.0000146']/reccnts");
- var repNode = ivwfrm.model.instance1.selectSingleNode("/root/main/recinfo/recitem[degnitemcd='0000146001' and degnitemlevlcd = '0011529.0000146']");
- var rep_instcd = getUserInfo("dutplceinstcd");
- var reqcnt = "";
-
- if( replcnts != "" )
- {
- reqcnt = replcnts;
- }else{
- if( rep_instcd == "031" ){
- reqcnt = "내시경 시행하겠습니다. 동의서 받아주시고 내시경실( T.5512 )로 연락주세요.";
- }else if( rep_instcd == "032" ){
- reqcnt = "내시경 시행하겠습니다. 동의서 받아주시고 내시경실( T.3081 )로 연락주세요.";
- }else{
- reqcnt = "내시경 시행하겠습니다. 동의서 받아주시고 내시경실로 연락주세요.";
- }
-
- }
-
- ivwfrm.model.setValue("/root/main/recinfo/recitem[degnitemcd='0000146001' and degnitemlevlcd = '0011529.0000146']/reccnts", reqcnt);
- ivwfrm.model.refresh();
-
- var mtxNm = "MTX_1";
- var mtx = ivwfrm.window.document.controls(mtxNm);
-
- ivwfrm.model.setFocus(mtxNm);
-
- //mtx.selBegin = txtSelPos + commuse.length;
- mtx.selBegin = reqcnt.length;
- mtx.dispatch("onkeyup");
-
- if( chknum == 0 ){
- mtxh = mtx.attribute("height");
- ivwfrmh = ivwfrm.attribute("height");
- tar11529001t = tar_0011529001.attribute("top");
- tar11529001h = tar_0011529001.attribute("height");
- grp11529001h = grup_0011529001.attribute("height");
- grp11529001t = grup_0011529001.attribute("top");
- ivw11449001h = ivw_0011449001.attribute("height");
- grp11449001h = grup_0011449001.attribute("height");
- grpcnth = grup_cnts.attribute("height");
- chknum++;
- }else{
- mtx.attribute("height") = mtxh;
- ivwfrm.attribute("height") = ivwfrmh;
- tar_0011529001.attribute("top") = tar11529001t;
- tar_0011529001.attribute("height") = tar11529001h;
- grup_0011529001.attribute("height") = grp11529001h;
- grup_0011529001.attribute("top") = grp11529001t;
- ivw_0011449001.attribute("height") = ivw11449001h;
- grup_0011449001.attribute("height") = grp11449001h;
- grup_cnts.attribute("height") = grpcnth;
- }
-
- mtx.attribute("height") = parseInt(mtx.attribute("height")) - parseInt(140);
- ivwfrm.attribute("height") = parseInt(ivwfrm.attribute("height")) - parseInt(140);
- tar_0011529001.attribute("top") = parseInt(tar_0011529001.attribute("top")) - parseInt(tar_0011529001.attribute("top"));
- tar_0011529001.attribute("height") = parseInt(tar_0011529001.attribute("height")) - parseInt(tar_0011529001.attribute("height"));
- grup_0011529001.attribute("height") = parseInt(grup_0011529001.attribute("height")) - parseInt(130);
- grup_0011529001.attribute("top") = parseInt(grup_0011529001.attribute("top")) + parseInt(153);
-
- ivw_0011449001.attribute("height") = parseInt(ivw_0011449001.attribute("height")) + parseInt(155);
- grup_0011449001.attribute("height") = parseInt(grup_0011449001.attribute("height")) + parseInt(155);
- grup_cnts.attribute("height") = parseInt(grup_cnts.attribute("height")) + parseInt(24);
- /* }
- else
- {
- var mtxNm = "MTX_1";
- var mtx = ivwfrm.window.document.controls(mtxNm);
-
- ivwfrm.model.setFocus(mtxNm);
-
- //mtx.selBegin = txtSelPos + commuse.length;
- mtx.selBegin = replcnts.length;
- mtx.dispatch("onkeyup");
- }
- */
- }
- }
- /**
- * @desc : 서식 기록을 위한 초기화(확장)
- * @
- * @param :
- * @return :
- * @authur : 박종훈
- * @---------------------------------------------------
- */
- function fExtnInitFormRec()
- {
- SetUserTimeLog("MMR04900", "fExtnInitFormRec", parent.model);
-
- //수신과, 수신의사 변경 기능 추가로 인한 submit 위치 변경(최초 작성일때가 아닌 수정모드에서도 조회해옴 2010.03.23)
- if (cnstflag == "1")
- {
- //20081114 수신과 수신의사 콤보 처리
- var sIoflag = parent.window.javascript.fGetFormRec("chosflag");
- if (sIoflag == "I" || sIoflag == "E" || sIoflag == "D")
- {
- sIoflag = "I";
- }
- else
- {
- sIoflag = "O";
- }
-
- model.makeValue("/root/send/ioflag", sIoflag);
- model.makeValue("/root/send/cnstflag", "1");
- submit("TRMMR04902"); //컨설트부서조회
- }
- fSetLayOut(cnstflag); //지원부서의뢰신규일때 수신의 추가로 인한 동적레이아웃변경 추가 20121109 정창혁
- if (parent.window.javascript.fGetFormRec("status") == "C")
- {
- //진료의뢰의경우 수신과, 수신의사 선택 콤보 활성화(2010.03.18 박종훈)
- if (cnstflag == "1" || cnstflag == "3") //지원부서의뢰신규일경우에도 수신의 활성화 20121108 정창혁
- {
- cmb_recdept.disabled = false;
- cmb_recdoct.disabled = false;
- }
-
- if (parent.window.javascript.fGetFormRec("chosflag") == "E" && parent.window.javascript.fGetFormRec("orddeptcd") == "2280000000")
- {
- mmbfGetUserComboList("/root/send/reqdata", "/root/init/userlist", getUserInfo("dutplcecd"), "0330"); //응급환자의 경우 로그인 사용자의 부서를 기준으로 조회
- }
- else
- {
- mmbfGetUserComboList("/root/send/reqdata", "/root/init/userlist", parent.model.getValue("/root/main/paminfo/orddeptcd"), "0330");
- }
-
- //의뢰없는 회신(treplflag = R)부분 처리
- var treplflag = parent.window.javascript.getParameter("SMMMR04900_replflag");
- if (treplflag == "R" && getUserInfo("jobkindcd").substring(0, 2) != "03")
- {
- model.setValue("/root/main/recinfo/recitem[degnitemno='" + ipt_csldeptnm.attribute("degnitemno") + "']/rectermcd", parent.window.javascript.getParameter("SMMMR04900_reqdpcd")); //사용자 부서코드
- model.setValue("/root/main/recinfo/recitem[degnitemno='" + ipt_csldeptnm.attribute("degnitemno") + "']/rectermnm", parent.window.javascript.getParameter("SMMMR04900_reqdpnm")); //사용자 부서명
- model.setValue("/root/main/recinfo/recitem[degnitemno='" + ipt_csldoctnm.attribute("degnitemno") + "']/rectermcd", parent.window.javascript.getParameter("SMMMR04900_reqdrid")); //사용자 아이디
- model.setValue("/root/main/recinfo/recitem[degnitemno='" + ipt_csldoctnm.attribute("degnitemno") + "']/rectermnm", parent.window.javascript.getParameter("SMMMR04900_reqdrnm")); //사용자 명
- }
- else
- {
- var pamioflag = parent.model.getValue("/root/main/paminfo/ioflag");
- if (pamioflag == "I" || pamioflag == "E" || pamioflag == "D")
- {
- var medispclid = parent.model.getValue("/root/main/paminfo/medispclid");
- var atdoctid = parent.model.getValue("/root/main/paminfo/atdoctid");
- }
- else
- {
- var medispclid = parent.model.getValue("/root/main/paminfo/orddrid");
- }
-
- //전문간호의뢰여부 check
- var cnstdeptcd = parent.window.javascript.getParameter("SMMMR04900_cnstdeptcd");
- var cnstformcd = parent.window.javascript.getParameter("SMMMR04900_formcd");
-
- //if (cnstflag == "3")
- if (cnstdeptcd == "3043900000" || cnstformcd == "0000002911")
- {
- //초기조건 설정
- model.setValue("/root/main/recinfo/recitem[degnitemno='" + ipt_csldeptnm.attribute("degnitemno") + "']/rectermcd", getUserInfo("dutplcecd")); //환자진료 부서코드
- model.setValue("/root/main/recinfo/recitem[degnitemno='" + ipt_csldeptnm.attribute("degnitemno") + "']/rectermnm", getUserInfo("dutplcenm")); //환자진료 부서명
- model.setValue("/root/main/recinfo/recitem[degnitemno='" + ipt_csldoctnm.attribute("degnitemno") + "']/rectermcd", getUserInfo("userid")); //의뢰자 아이디
- model.setValue("/root/main/recinfo/recitem[degnitemno='" + ipt_csldoctnm.attribute("degnitemno") + "']/rectermnm", getUserInfo("usernm")); //의뢰자 명
-
- caption1.attribute("visibility") = "hidden";
- caption10.attribute("visibility") = "hidden";
- cmb_apprtdrid.attribute("visibility") = "hidden";
- cmb_inptuserid.attribute("visibility") = "hidden";
- caption2.text = "의뢰자";
- }
- else
- {
- if (parent.window.javascript.fGetFormRec("chosflag") == "E" && parent.window.javascript.fGetFormRec("orddeptcd") == "2280000000")
- {
- model.setValue("/root/main/recinfo/recitem[degnitemno='" + ipt_csldeptnm.attribute("degnitemno") + "']/rectermcd", getUserInfo("dutplcecd")); //환자진료 부서코드
- model.setValue("/root/main/recinfo/recitem[degnitemno='" + ipt_csldeptnm.attribute("degnitemno") + "']/rectermnm", getUserInfo("dutplcenm")); //환자진료 부서명
- model.setValue("/root/main/recinfo/recitem[degnitemno='" + ipt_csldoctnm.attribute("degnitemno") + "']/rectermcd", getUserInfo("userid")); //의뢰자 아이디
- model.setValue("/root/main/recinfo/recitem[degnitemno='" + ipt_csldoctnm.attribute("degnitemno") + "']/rectermnm", getUserInfo("usernm")); //의뢰자 명
-
- caption1.attribute("visibility") = "hidden";
- caption10.attribute("visibility") = "hidden";
- cmb_apprtdrid.attribute("visibility") = "hidden";
- cmb_inptuserid.attribute("visibility") = "hidden";
- caption2.text = "의뢰의";
- }
- else
- {
- //알콜센터에서 의뢰한 사회사업인지 여부 체크
- var compFormcd = parent.window.javascript.fGetFormRec("formcd");
- var iFormtrgtNodeCnt = getNodesetCnt(model, "/root/inithrdcd/hrdform/hardcd[hardcd = '" + compFormcd + "']"); //의뢰정보 사용자정보 적용의뢰
-
- var compDeptCd = getUserInfo("dutplcecd");
- var iDepttrgtNodeCnt = getNodesetCnt(model, "/root/inithrdcd/hrddept/hardcd[hardcd = '" + compDeptCd + "']"); //의뢰정보 사용자정보 적용부서
-
- if (iFormtrgtNodeCnt > 0 && iDepttrgtNodeCnt > 0)
- {
- //초기조건 설정
- model.setValue("/root/main/recinfo/recitem[degnitemno='" + ipt_csldeptnm.attribute("degnitemno") + "']/rectermcd", getUserInfo("dutplcecd")); //환자진료 부서코드
- model.setValue("/root/main/recinfo/recitem[degnitemno='" + ipt_csldeptnm.attribute("degnitemno") + "']/rectermnm", getUserInfo("dutplcenm")); //환자진료 부서명
- model.setValue("/root/main/recinfo/recitem[degnitemno='" + ipt_csldoctnm.attribute("degnitemno") + "']/rectermcd", getUserInfo("userid")); //전문의 아이디
- model.setValue("/root/main/recinfo/recitem[degnitemno='" + ipt_csldoctnm.attribute("degnitemno") + "']/rectermnm", getUserInfo("usernm")); //전문의 명
-
- caption1.attribute("visibility") = "hidden";
- caption10.attribute("visibility") = "hidden";
- cmb_apprtdrid.attribute("visibility") = "hidden";
- cmb_inptuserid.attribute("visibility") = "hidden";
- caption2.text = "의뢰자";
-
- mmbfGetUserComboList("/root/send/reqdata", "/root/init/userlist", getUserInfo("dutplcecd"), "-");
- }
- else
- {
- //초기조건 설정
- model.setValue("/root/main/recinfo/recitem[degnitemno='" + ipt_csldeptnm.attribute("degnitemno") + "']/rectermcd", parent.model.getValue("/root/main/paminfo/orddeptcd")); //환자진료 부서코드
- model.setValue("/root/main/recinfo/recitem[degnitemno='" + ipt_csldeptnm.attribute("degnitemno") + "']/rectermnm", parent.model.getValue("/root/main/paminfo/orddeptnm")); //환자진료 부서명
- model.setValue("/root/main/recinfo/recitem[degnitemno='" + ipt_csldoctnm.attribute("degnitemno") + "']/rectermcd", medispclid); //전문의 아이디
- model.setValue("/root/main/recinfo/recitem[degnitemno='" + ipt_csldoctnm.attribute("degnitemno") + "']/rectermnm", getPatientInfo("apntdr")); //전문의 명
-
- if (pamioflag == "I" || pamioflag == "E" || pamioflag == "D")
- {
- model.setValue("/root/init/cond/apprtdrid", atdoctid); //전공의 아이디
- model.setValue("/root/init/cond/apprtdrnm", getPatientInfo("attndr")); //전공의 아이디
- cmb_apprtdrid.refresh();
- }
- else
- {
- cmb_apprtdrid.disabled = true;
- }
- }
- }
- }
-
- model.setValue("/root/init/cond/inptuserid", getUserInfo("userid")); //작성자 아이디
- model.setValue("/root/init/cond/inptusernm", getUserInfo("usernm")); //작성자 아이디
- cmb_inptuserid.refresh();
-
- }
- model.setValue("/root/main/recinfo/recitem[degnitemno='" + rdo_eryn.attribute("degnitemno") + "']/rectermcd", "0018564001"); //응급여부
-
- fEmergencYN(); //일단막아둠(reccnts에 값 셋팅시 (응급여부> 정규 ※정규) 와 같이 중복 표현문제)
-
- parent.window.javascript.fSetFormRec("extnflag", "cnst");
- parent.window.javascript.fSetFormRec("cnstflag", parent.window.javascript.getParameter("SMMMR04900_cnstflag"));
- parent.window.javascript.fSetFormRec("cnststat", "10");
- parent.window.javascript.fSetFormRec("replflag", parent.window.javascript.getParameter("SMMMR04900_replflag"));
- parent.window.javascript.fSetFormRec("apprtdrid", model.getValue("/root/init/cond/apprtdrid"));
- parent.window.javascript.fSetFormRec("apprtdrid", model.getValue("/root/init/cond/rscdoctid"));
- parent.window.javascript.fSetFormRec("inptuserid", model.getValue("/root/init/cond/inptuserid"));
- parent.window.javascript.fSetFormRec("cnstchosflag", parent.window.javascript.getParameter("SMMMR04900_cnstioflag"));
- if (parent.window.javascript.fGetFormRec("formcd") == "0000000692")
- {
- parent.window.javascript.fSetFormRec("homecarerereqyn", parent.window.javascript.getParameter("SMMMR05000_param_homecarerereqyn"));
- parent.window.javascript.fSetFormRec("hinptdt", parent.window.javascript.getParameter("SMMMR05000_hcare_inptdt"));
- parent.window.javascript.fSetFormRec("hrecdd", parent.window.javascript.getParameter("SMMMR05000_hcare_recdd"));
- }
- var treplflag = parent.window.javascript.getParameter("SMMMR04900_replflag");
- //기록영역 최대화
- if (treplflag != "R" || getUserInfo("jobkindcd").substring(0, 2) == "03")
- {
- SetUnitFormFullSize("0011449001", 0, gItemCds, gPageIdx, grup_cnts);
-
- //2010-07-27 김달현 ivw.src를 지움으로 인해 컨설트 회신시 입력한 내용이 공백으로 저장되는 오류 발생하여 주석처리
- //ivw_0011529001.src = ""; //2010-04-06 오후 1:12:36 강지훈 수정 : 격리병실신청 수정시 수정안되는 오류
-
- //2010-07-27 김달현 notChkEssnYn 플래그를 추가(Y:저장시 필수체크안함. N:저장시 필수체크함)
- //의뢰서의 경우 ivw_0011529001(회신뷰어) 필수체크 안함설정
- ivw_0011529001.attribute("notChkEssnYn") = "Y";
-
- }
-
- fAfterChoiRecvDeptCd();
-
- parent.window.btn_init.attribute("visibility") = "visible";
-
- model.setValue("/root/init/cond/rscdeptcd", parent.window.javascript.getParameter("userdeptcd"));
-
- fGetRecDeptDoct();
-
- //영양평가의뢰 회신내용 자동입력부분
- var replcnts = getParameter("MMR04900_replcnts");
- var overwrite = getParameter("MMR04900_overwrite");
-
- clearParameter("MMR04900_replcnts");
- clearParameter("MMR04900_overwrite");
-
- if (replcnts != "" && overwrite != "")
- {
- fSetReplCnts(replcnts, eval(overwrite));
- }
- cmb_recdept.attribute("ref") = "/root/init/cond/rscdeptcd";
- cmb_recdoct.attribute("ref") = "/root/init/cond/rscdoctid";
-
-
-
- }
- else
- {
- //pjh
- //cmb_recdept.attribute("ref") = "/root/init/cond/rscdeptnm";
- //cmb_recdoct.attribute("ref") = "/root/init/cond/rscdoctnm";
-
- /*var replcnts = getParameter("MMR04900_replcnts");
- var overwrite = getParameter("MMR04900_overwrite");
-
- clearParameter("MMR04900_replcnts");
- clearParameter("MMR04900_overwrite");
-
- if (replcnts != "" && overwrite != "")
- {
- fSetReplCnts(replcnts, eval(overwrite));
- }*/
-
- //알콜센터에서 의뢰한 사회사업인지 여부 체크
- var compFormcd = parent.window.javascript.fGetFormRec("formcd");
- var iFormtrgtNodeCnt = getNodesetCnt(model, "/root/inithrdcd/hrdform/hardcd[hardcd = '" + compFormcd + "']"); //의뢰정보 사용자정보 적용의뢰
-
- if (iFormtrgtNodeCnt > 0)
- {
- caption1.attribute("visibility") = "hidden";
- caption10.attribute("visibility") = "hidden";
- cmb_apprtdrid.attribute("visibility") = "hidden";
- cmb_inptuserid.attribute("visibility") = "hidden";
- caption2.text = "의뢰자";
-
- mmbfGetUserComboList("/root/send/reqdata", "/root/init/userlist", getUserInfo("dutplcecd"), "-");
- }
- }
-
-
-
- if(parseInt(parent.window.javascript.fGetFormRec("cnststat")) > 12)
- {
- parent.window.btn_init.attribute("visibility") = "hidden";
- }
- }
- /**
- * @desc : 추가회신 버튼 이벤트
- * @
- * @param :
- * @return :
- * @authur : 박종훈
- * @---------------------------------------------------
- */
- function fAddRepl()
- {
- var addcnststat = parseInt(model.getValue("/root/main/cnstinfo/cnststat"));
- var rtn = "";
- var ivwfrm = document.controls("ivw_0011529001");
-
- if (addcnststat == 30 || addcnststat == 40)
- {
- rtn = messageBox("의뢰과에서 회신내용을 확인하셨습니다.\n 회신내용을", "Q008");
- }
- else
- {
- rtn = 6;
- }
- if (rtn == 6)
- {
- var cntparm = "";
- var defdata = "";
- var curdt = getCurrentDate();
- var curtm = getCurrentTime().substr(0, 4);
-
- var parmdt = curdt.substr(0, 4) + "-" + curdt.substr(4, 2) + "-" + curdt.substr(6, 2);
- var parmtm = curtm.substr(0, 2) + ":" + curtm.substr(2, 2);
-
- setParameter("etcrec_cnstReplAddYn", "Y");
- if (addcnststat > 30 && addcnststat < 40) // 추가회신내용을 의뢰자가 확인 안한상태 체크
- {
- var replcnts = ivwfrm.model.getValue("/root/main/recinfo/recitem[degnitemcd='0000146001' and degnitemlevlcd = '0011529.0000146']/reccnts");
- var existrec = "N";
- var strloc = 0;
- var bindinfo = new Array();
- var regexp = new RegExp("▣", 'igm');
- var orgrec = "";
-
- if (regexp.test(replcnts) == true)
- {
- bindinfo = replcnts.match(regexp);
-
- for(var i = 0; i < bindinfo.length; i++)
- {
- if(bindinfo[i] != "")
- {
- strloc = bindinfo.index;
- break;
- }
- }
-
- cntparm = replcnts.substr(strloc, (replcnts.length - strloc));
- orgrec = cntparm;
- cntparm = cntparm.replace("▣ ", "");
- defdata = cntparm.split("\n")[0];
- cntparm = cntparm.replace(defdata, "");
- //cntparm = cntparm.replace("\n", "");
-
-
- ivwfrm.model.setValue("/root/main/recinfo/recitem[degnitemcd='0000146001' and degnitemlevlcd = '0011529.0000146']/reccnts", replcnts.substr(0, strloc));
- ivwfrm.model.refresh();
-
- setParameter("etcrec_addreplcnts", cntparm);
- existrec = "Y";
- }
- else
- {
- }
- }
- else
- {
- var replcnts = ivwfrm.model.getValue("/root/main/recinfo/recitem[degnitemcd='0000146001' and degnitemlevlcd = '0011529.0000146']/reccnts");
-
- var existrec = "N";
- var strloc = 0;
- var bindinfo = new Array();
- var regexp = new RegExp("▣", 'igm');
- var orgrec = "";
-
- if (regexp.test(replcnts) == true)
- {
- bindinfo = replcnts.match(regexp);
-
- for(var i = 0; i < bindinfo.length; i++)
- {
- if(bindinfo[i] != "")
- {
- strloc = bindinfo.index;
- break;
- }
- }
-
- cntparm = replcnts.substr(strloc, (replcnts.length - strloc));
- orgrec = cntparm;
- cntparm = cntparm.replace("▣ ", "");
- defdata = cntparm.split("\n")[0];
- cntparm = cntparm.replace(defdata, "");
- //cntparm = cntparm.replace("\n", "");
-
-
- ivwfrm.model.setValue("/root/main/recinfo/recitem[degnitemcd='0000146001' and degnitemlevlcd = '0011529.0000146']/reccnts", replcnts.substr(0, strloc));
- ivwfrm.model.refresh();
-
- setParameter("etcrec_addreplcnts", cntparm);
- existrec = "Y";
- }
- else
- {
- defdata = parmdt + " " + parmtm + " " + getUserInfo("deptabbr") + " " + "전문의 : " + model.getValue("/root/main/recinfo/recitem[degnitemno='" + ipt_csldoctnm.attribute("degnitemno") + "']/rectermnm") + " " + "작성자 : " + getUserInfo("usernm");
- }
-
- }
-
- modal("SPMMR06100");
-
- var cnstaddrec = getParameter("cnataddrec_rtn");
-
- //if (cnstaddrec != "" && cnstaddrec != cntparm)
-
- if (cnstaddrec != "" && cntparm != cnstaddrec)
- {
- var tmpreccnts = ivwfrm.model.getValue("/root/main/recinfo/recitem[degnitemcd='0000146001' and degnitemlevlcd = '0011529.0000146']/reccnts");
-
- tmpreccnts = tmpreccnts + "\n" + "▣ " + defdata + "\n" + cnstaddrec;
-
- ivwfrm.model.setValue("/root/main/recinfo/recitem[degnitemcd='0000146001' and degnitemlevlcd = '0011529.0000146']/reccnts", tmpreccnts);
-
- ivwfrm.model.refresh();
-
- cnstaddrec = "";
- clearParameter("cnataddrec_rtn");
- clearParameter("etcrec_addreplcnts");
- }
- else if (existrec == "Y" || getParameter("etcrec_cnclyn") == "Y")
- {
- //추가회신 변경된 내용이 없는 경우
- ivwfrm.model.setValue("/root/main/recinfo/recitem[degnitemcd='0000146001' and degnitemlevlcd = '0011529.0000146']/reccnts", replcnts);
-
- ivwfrm.model.refresh();
-
- cnstaddrec = "";
- clearParameter("cnataddrec_rtn");
- clearParameter("etcrec_addreplcnts");
- clearParameter("etcrec_cnclyn");
- }
-
- //openEtcRec("0011529001");
- parent.window.btn_signsave.disabled = false;
-
- }
- }
- /**
- * 지원부서의뢰신규시 수신의 설정 가능하게 수정함 20121107 정창혁
- */
- function fSetLayOut(cnstflag) {
- if (cnstflag == "3") {
- cap_rcvdoct.attribute("style") = "left:0px; top:52px; width:95px; height:23px; vertical-align:middle; ";
- cmb_recdoct.attribute("style") = "left:98px; top:54px; width:195px; height:19px; ";
- cmb_recdoct.visible = true;
- cmb_recdoct.disabled = false;
- cap_mode1.attribute("style") = "left:0px; top:78px; width:95px; height:23px; vertical-align:middle; ";
- ipt_formnm.attribute("style") = "left:98px; top:79px; width:195px; height:19px; ";
- caption19.attribute("style") = "left:0px; top:103px; width:60px; height:23px; vertical-align:middle; "; //응급여부 캡션
- rdo_eryn.attribute("style") = "left:63px; top:107px; width:90px; height:19px; border-style:none; ";
- rdo_eryn.attribute("cellspacing") = "0";
- caption22.attribute("style") = "left:156px; top:104px; width:60px; height:23px; vertical-align:middle; "; //연락번호 캡션
- tar_cntcno.attribute("style") = "left:218px; top:107px; width:80px; height:19px; ";
- } else if (cnstflag == "1") {
- cap_rcvdoct.attribute("style") = "left:0px; top:52px; width:95px; height:23px; vertical-align:middle; ";
- cmb_recdoct.attribute("style") = "left:98px; top:54px; width:195px; height:19px; ";
- cmb_recdoct.visible = true;
- cmb_recdoct.disabled = false;
- cap_mode1.attribute("style") = "left:0px; top:52px; width:95px; height:23px; vertical-align:middle; ";
- ipt_formnm.attribute("style") = "left:98px; top:54px; width:195px; height:19px; "
- caption19.attribute("style") = "left:0px; top:78px; width:95px; height:23px; vertical-align:middle; "; //응급여부 캡션
- rdo_eryn.attribute("style") = "left:98px; top:80px; width:195px; height:19px; border-style:none; ";
- rdo_eryn.attribute("cellspacing") = "20";
- caption22.attribute("style") = "left:0px; top:104px; width:95px; height:23px; vertical-align:middle; "; //연락번호 캡션
- tar_cntcno.attribute("style") = "left:98px; top:107px; width:195px; height:19px; ";
- }
- }
- /**
- * 수신의 변경시 이벤트 (자바스크립트로 옮김) 20121112 정창혁
- */
- function fOnChangeCmbRecDoct() {
-
- var drid = cmb_recdoct.value;
-
- fGetSuspendDiagInfo();
-
- if (cnstflag == "1") { //지원부서의뢰신규시 동작 안하게 설정(서식에는 존재하지 않는 아이템이라) 20121108 정창혁
- model.setValue("/root/main/recinfo/recitem[degnitemno='" + ipt_recdoct.attribute("extn_degnitemno") + "']/rectermcd", model.getValue("/root/init/cond/rscdoctid"));
-
- var sDrNm = model.getValue("/root/init/recvrlist/usercombo[userid='" + model.getValue("/root/init/cond/rscdoctid") + "']/usernm");
- model.setValue("/root/init/cond/rscdoctnm", sDrNm);
-
- model.setValue("/root/main/recinfo/recitem[degnitemno='" + ipt_recdoct.attribute("extn_degnitemno") + "']/rectermnm", sDrNm);
- } else if (cnstflag == "3") {
- parent.window.javascript.fSetFormRec("rscdoctid", model.getValue("/root/init/cond/rscdoctid"));
- }
- //model.setValue("/root/main/recinfo/recitem[degnitemno='" + ipt_recdoct.attribute("extn_degnitemno") + "']/rectermcd", model.getValue("/root/init/cond/rscdoctnm"));
-
- //var sDrNm = model.getValue("/root/init/recvrlist/usercombo[userid='" + model.getValue("/root/init/cond/rscdoctnm") + "']/usernm");
-
- //var sDrNm = model.getValue("/root/init/recvrlist/usercombo[userid='" + model.getValue("/root/init/cond/rscdoctid") + "']/usernm");
- //model.setValue("/root/init/cond/rscdoctnm", sDrNm);
- //debugger;
- //model.setValue("/root/main/recinfo/recitem[degnitemno='" + ipt_recdoct.attribute("extn_degnitemno") + "']/rectermcd", model.getValue("/root/init/cond/rscdoctid"));
- //model.setValue("/root/main/recinfo/recitem[degnitemno='" + ipt_recdoct.attribute("extn_degnitemno") + "']/rectermnm", sDrNm);
- }
- /**
- * 선택한 수신의의 휴진 정보 조회
- */
- function fGetSuspendDiagInfo() {
- model.makeValue("/root/send/reqsuspend/orddeptcd", parent.window.javascript.getParameter("SMMMR04900_cnstdeptcd"));
- model.makeValue("/root/send/reqsuspend/orddrid", cmb_recdoct.value);
- var sDrNm = model.getValue("/root/init/recvrlist/usercombo[userid='" + model.getValue("/root/init/cond/rscdoctid") + "']/usernm");
- model.removeNodeset("/root/hidden/suspendinfo");
- if (submit("TRMMR04905")) {
- if (model.getValue("/root/hidden/suspendinfo/spndyn") == "Y") {
- messageBox("["+sDrNm+"] 선생님의 휴진정보입니다. \n\n"+
- model.getValue("/root/hidden/suspendinfo/description")+"\n\n", "I", "");
- return;
- }
- }
- }
|