12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240 |
- var doctyn = "N";
- var deptcd = "";
- var srchmode = "";
- // 상단정보연계를 위한 전역변수 선언 2009.12.12 LYJ
- var grdcnstrow = "";
- var consutioflag ="";
- var consutpid ="";
- var consutcretno ="";
- var consutorddd ="";
- var consutindd ="";
- var clickChk = "";
- var consulyn = "";
- //2013/01/23 Start
- var pat_medispclid=""; // 입원환자의 경우 주치의
- var pat_atdoctid=""; // 입원환자의 경우 담당의
- //2013/01/23 End
- //2013/02/12 Start
- var screenid="";
- //2013/02/12 End
- /**
- * @desc : 컨설트리스트 조회
- * @
- * @param :
- * @return :
- * @authur : 박종훈
- * @---------------------------------------------------
- */
- function fGetCnstlist(condflag)
- {
- model.setValue("/root/tmp/condflag", condflag );
- srchmode = condflag;
- model.removeNodeset("/root/main/cnstlist");
- var dpcd = getScreenMenuParameter(); //: 메뉴별 Parameter정보를 반환한다.
- var srchnm ="";
- if (condflag == "pidall")
- {
- srchnm = "환자별 모든건";
- }
- else if (condflag == "pidreq")
- {
- srchnm = "환자별 보낸건";
- }
- else if (condflag == "pidrecv")
- {
- srchnm = "환자별 받은건";
- }
- else if (condflag == "userreq")
- {
- if(dpcd == "doctor")
- {
- srchnm = "의사별 보낸건";
- }
- else
- {
- srchnm = "개인별 보낸건";
- }
- }
- else if (condflag == "userrecv")
- {
- if(dpcd == "doctor")
- {
- srchnm = "의사별 받은건";
- }
- else
- {
- srchnm = "개인별 받은건";
- }
- }
- else if (condflag == "deptreq")
- {
- srchnm = "과별 보낸건";
- }
- else if (condflag == "deptrecv")
- {
- srchnm = "과별 받은건";
- }
- else if (condflag == "piduserrecv")
- {
- srchnm = "환자별 의뢰 받은건";
- }
- else if (condflag == "piduserreq")
- {
- srchnm = "환자별 의뢰 보낸건";
- }
- else if (condflag == "pidnurcreq")
- {
- srchnm = "환자별 의뢰 내역(간호)";
- }
- else if (condflag == "piddeptrecv")
- {
- srchnm = "환자별 의뢰 받은건(부서)";
- }
- else if (condflag == "piddeptreq")
- {
- srchnm = "환자별 의뢰 보낸건(부서)";
- }
- model.makeValue("/root/init/srchnm", srchnm);
- fSetSendreq();
- model.makeValue("/root/send/condflag", condflag);
- model.makeValue("/root/send/prestdd", getCurrentDate());
- model.makeValue("/root/send/userid", getUserId());
- model.makeValue("/root/send/dutplcecd", getUserInfo("dutplcecd")); //20121012 이윤주
- if(submit("TRMMR05002"))
- {
- grd_cnstlist.allstyle("data", "background-color") = "#ffffff";
- grd_cnstlist.refresh();
- fCountReplList();
- clickChk = "C";
- }
- if(submit("TRMMR05001")) //통계조회
- {
- fCnstSumList();
- }
- model.refresh();
- }
- /**
- * @desc : 조회조건 설정
- * @
- * @param :
- * @return :
- * @authur : 박종훈
- * @---------------------------------------------------
- */
- function fSetSendreq()
- {
- var statflag = model.getValue("/root/presend/statflag");
- var inflag = model.getValue("/root/presend/inflag");
- var formcd = model.getValue("/root/send/formcd");
- statflag = statflag.split("|");
- if(statflag == "" || statflag.length > 1)
- {
- model.makeValue("/root/send/statflag", "all");
- }else{
- model.makeValue("/root/send/statflag", statflag);
- }
- if(inflag == "")
- {
- model.makeValue("/root/send/inflag", "in");
- }
- else
- {
- model.makeValue("/root/send/inflag", inflag);
- }
- if(formcd == "" || formcd == null)
- {
- model.makeValue("/root/send/formcd", "-");
- }
- }
- /**
- * @desc : 의사여부조회
- * @
- * @param :
- * @return :
- * @authur : 박종훈
- * @---------------------------------------------------
- */
- function fIsDoct()
- {
- // jobkindcd 향후 변경예정
- var sJobkind = getUserInfo("jobkindcd").substring(0, 2);
- if(sJobkind == "03")
- {
- return "Y";
- }
- else
- {
- return "N";
- }
- }
- /**
- * @desc : 화면초기화
- * @
- * @param :
- * @return :
- * @authur : 박종훈
- * @---------------------------------------------------
- */
- function fInitalize()
- {
- grd_cnstlist.rowHeight(0) = 32;
- ivw_loader.src = "../../../emr/medirecweb/xrw/SSMMR01100_서식로더.xrw";
- ivw_loader.window.javascript.fInitPage(false, true, parseInt(ivw_loader.attribute("height")));
- ivw_loader.window.javascript.afterSaveExeFuncNm = "fSaveAfter";
- reqGetDeptList("/root/init/reqdata", "/root/init/deptlist", "", "012");
-
-
- //model.removenode("/root/init/cnstreqmsrght/mouserght");
- // model.makeNode("/root/init/cnstreqmsrght/mouserght");
- if ((getUserInfo("jobkindcd") == "0330") || (getUserInfo("jobkindcd") == "0332") || (getUserInfo("jobkindcd") == "0510")) {
- /* 2013/01/28 주석처리
- model.makeValue("/root/init/cnstreqmsrght/mouserght[2]/label","상단연계");
- model.makeValue("/root/init/cnstreqmsrght/mouserght[2]/func","fSelPatInfo");
- model.makeValue("/root/init/cnstrecvmsrght/mouserght[2]/label","상단연계");
- model.makeValue("/root/init/cnstrecvmsrght/mouserght[2]/func","fSelPatInfo");
- model.makeValue("/root/init/cnstrecvmsrghtpat/mouserght[2]/label","상단연계");
- model.makeValue("/root/init/cnstrecvmsrghtpat/mouserght[2]/func","fSelPatInfo");
- */
- }
- model.setValue("/root/init/reqmedireclist/diffdt", 7);
- if (isPopup())
- deptcd = opener.window.javascript.getParameter("SMMMR05000_param_userdept");
- if (deptcd == "")
- {
- deptcd = getScreenMenuParameter(); //: 메뉴별 Parameter정보를 반환한다.
- }
- if (deptcd == "")
- {
- deptcd = getUserInfo("dutplcecd");
- }
- if (isDevMode() && deptcd == "")
- {
- deptcd = "doctor";
- }
- if (deptcd == "" || deptcd == null)
- {
- messageBox("부서정보가 설정되지 ", "E007");
- grp_base.disabled = true;
- return;
- }
- else
- {
- if (deptcd == "doctor")
- {
- doctyn = "Y";
- deptcd = getUserInfo("dutplcecd");
- button2.text = "의사별 보낸건";
- button4.text = "의사별 받은건";
- }
- }
- var param = "";
- var homecarerereqyn = "";
- var hinptdt = "";
- var hrecdd = "";
- if (isPopup())
- {
- param = opener.window.javascript.getParameter("SMMMR05000_param_pinfo"); //pid▦orddd▦cretno▦ioflag▦orddeptcd▦orddrid▦
- homecarerereqyn = opener.window.javascript.getParameter("SMMMR05000_param_homecarerereqyn");
- hinptdt = opener.window.javascript.getParameter("SMMMR05000_hcare_inptdt");
- hrecdd = opener.window.javascript.getParameter("SMMMR05000_hcare_recdd");
-
- //2013/02/12 Start 어느화면에서 오픈되었는지 체크한다.
- screenid = opener.window.javascript.getParameter("SMMMR05000_screenid");
- //2012/02/12 End
-
- opener.window.javascript.clearParameter("SMMMR05000_param_pinfo");
- opener.window.javascript.clearParameter("SMMMR05000_param_homecarerereqyn");
- opener.window.javascript.clearParameter("SMMMR05000_hcare_inptdt");
- opener.window.javascript.clearParameter("SMMMR05000_hcare_recdd");
- ivw_loader.window.javascript.setParameter("SMMMR05000_param_homecarerereqyn", homecarerereqyn);
- ivw_loader.window.javascript.setParameter("SMMMR05000_hcare_inptdt", hinptdt);
- ivw_loader.window.javascript.setParameter("SMMMR05000_hcare_recdd", hrecdd);
- }
- var pid = "";
- var orddd = "";
- var cretno = "";
- var ioflag = "I";
- var orddeptcd = "";
- var orddrid = "";
- //2013/02/26 Start 퇴원예고에서는 무조건 상단정보의 정보를 보도록
- if (param != "" && screenid!="SPMMO00400")
- //if (param != "")
- //2013/02/26 End
- {
- param = param.split("▦");
- pid = param[0];
- orddd = param[1];
- cretno = param[2];
- ioflag = param[3];
- orddeptcd = param[4];
- orddrid = param[5];
- model.makeValue ("/root/main/result/paminfo/list/pid", pid);
- model.makeValue ("/root/main/result/paminfo/list/orddd", orddd);
- model.makeValue ("/root/main/result/paminfo/list/cretno", cretno);
- model.makeValue ("/root/main/result/paminfo/list/ioflag", ioflag);
- model.makeValue ("/root/main/result/paminfo/list/orddeptcd", orddeptcd);
- model.makeValue ("/root/main/result/paminfo/list/orddrid", orddrid);
- model.refresh();
- }
- else
- {
- var pamInfoCvs = getGlobalVariable("paminfo"); //상단정보가 있을 경우는 검색
-
- if(pamInfoCvs != null && pamInfoCvs != "")
- { //cvs가 null이 아닌 경우에만 처리함.
- model.removeNodeSet ("/root/main/result/paminfo/list");
- setCSVToNode ("/root/main/result/paminfo", pamInfoCvs);
- pid = model.getValue ("/root/main/result/paminfo/list/pid");
- cretno = model.getValue ("/root/main/result/paminfo/list/cretno");
- ioflag = model.getValue ("/root/main/result/paminfo/list/ioflag");
- orddeptcd = model.getValue ("/root/main/result/paminfo/list/orddeptcd");
- orddrid = "";
- if (ioflag == "O" || ioflag == "S")
- {
- orddd = model.getValue ("/root/main/result/paminfo/list/orddd");
- orddrid = model.getValue ("/root/main/result/paminfo/list/orddrid");
- } else {
- orddd = model.getValue ("/root/main/result/paminfo/list/indd");
- orddrid = model.getValue ("/root/main/result/paminfo/list/medispclid");
- //2013/01/23 Start
- pat_medispclid= model.getValue ("/root/main/result/paminfo/list/medispclid");
- pat_atdoctid= model.getValue ("/root/main/result/paminfo/list/atdoctid");
- //2013/01/23 End
- }
- }
- }
-
- datagrid1.colStyle(0, "data", "border-right-style") = "none";
- datagrid1.colStyle(1, "data", "border-right-style") = "none";
- datagrid1.colStyle(3, "data", "border-right-style") = "none";
- datagrid1.colStyle(4, "data", "border-right-style") = "none";
- datagrid1.colStyle(6, "data", "border-right-style") = "none";
- datagrid1.colStyle(7, "data", "border-right-style") = "none";
- datagrid1.colStyle(9, "data", "border-right-style") = "none";
- datagrid1.colStyle(10, "data", "border-right-style") = "none";
- datagrid1.refresh();
- fAddDateReq("today");
-
- if (ioflag == "I" || ioflag == "E" || ioflag == "D")
- {
- ioflag = "I";
- }
- else if (ioflag == "O" || ioflag == "S")
- {
- ioflag = "O";
- }
- else
- {
- ioflag = "I";
- }
-
- model.makeValue("/root/send/ioflag", ioflag);
-
- //20111122 검색조건 디폴트로 전체로 지정
- model.setValue("/root/send/srchflag", 0);
- model.makeValue("/root/send/userdeptcd", getUserInfo("dutplcecd"));
- //20111122
- fIoFlagChange();
-
-
- /* 2012/02/09 전체 다 보이게 수정
- //20111123 영상의학과 : 2160000000 일때만 보이게 함
- if(getUserInfo("dutplcecd")=="2160000000"){
- caption14.visible="true";
- radio1.visible="true";
- grd_cnstlist.colhidden(2) = false;
- }else{
- caption14.visible="false";
- radio1.visible="false";
- grd_cnstlist.colhidden(2) = true;
- }
- //20111123
- 2012/02/09 */
- if (pid != "" && orddd != "" && cretno != "")
- {
- ipt_pid.value = pid;
- fPidKeyPress(); //등록번호로 환자 정보조회
- ivw_loader.window.javascript.fSetPamInfo(pid, orddd, cretno, ioflag, orddeptcd, orddrid);
- btn_excnst.attribute("visibility") = "visible";
- btn_cnst.attribute("visibility") = "visible";
- btn_cotrmt.visible = "true";
- model.refresh();
- }
- else if (pid != "" && orddd == "" && cretno == "")
- {
- ipt_pid.value = pid;
- fPidKeyPress(); //등록번호로 환자 정보조회
- fGetCnstlist("pidall");
- ivw_loader.disabled = true;
- }
- else
- {
- if (doctyn == "Y") //의사(진료의뢰)일 경우 의사별 받은건
- {
- var sJobkind = getUserInfo("jobkindcd").substring(0, 2);
- if(sJobkind == "03")
- {
- fGetCnstlist("userrecv");
- }
- else //의사가 아닐경우 환자별 의뢰건만 조회
- {
- fGetCnstlist("pidnurcreq");
- }
- }
- else
- {
- fGetCnstlist("deptrecv"); // 타과의뢰일 경우 부서별 받은건
- }
- ivw_loader.grup_btn.disabled = true;
- }
- //로컬테스트를 위한 버튼처리
- if (fLocalYn())
- {
- btn_excnst.attribute("visibility") = "visible";
- btn_cnst.attribute("visibility") = "visible";
- btn_cotrmt.attribute("visibility") = "visible";
- }
- //원목팀 요청(과별 보낸건, 받은건만)
- if(deptcd == "4050400000")
- {
- button7.attribute("visibility") = "hidden";
- button8.attribute("visibility") = "hidden";
- button2.attribute("visibility") = "hidden";
- button4.attribute("visibility") = "hidden";
- button3.attribute("visibility") = "hidden";
- btn_cnst.attribute("visibility") = "hidden";
- }
-
-
- model.makeValue("/root/send/userdeptcd", deptcd);
- model.makeValue("/root/send/userid", getUserId());
-
- if (submit("TRMMR04901")) //컨설트 부서조회
- {
- model.makeValue("/root/send/userdeptcd", getUserInfo("dutplcecd"));
- }
-
- //20110728
- //submit("TRMMR04904") //병동조회
- //mmbfGetDeptCodeComboList("/root/send/reqdata", "/root/init/orddept2", "W");
- mmbfGetDeptCodeComboList("/root/send/reqdata", "/root/main/cnstwardlist/cnstward", "W");
- addComboInstance("/root/main/cnstwardlist/cnstward", "deptcd^depthngnm", "-^전체", "dept");
- model.setValue("/root/send/wardcd", "-");
- //20110728
-
-
- model.makeValue("/root/send/cnstflag", "3");
- if(submit("TRMMR04902")) //컨설트 종류 조회
- {
- addComboInstance("/root/main/cnstformlist", "formcd^formnm", "0000000677^진료의뢰", "cnstform");
- addComboInstance("/root/main/cnstformlist", "formcd^formnm", "-^전체", "cnstform"); //진료과 전체항목 추가
- }
- ivw_loader.window.javascript.setParameter("userdeptcd", deptcd);
-
- //2013/02/14 Start 퇴원예고로부터 넘어온 경우에는 의뢰일자 시작일자를 선택
- if(screenid=="SPMMO00400"){
- model.makeValue("/root/send/reqfromdd", orddd);
- fGetCnstlist("pidall");
- }
- //2013/02/14 End
-
- //20140122
- fGetUserEnvOcsOrdAnsw("", "/root/hidden/procpconfiag", "053");
-
- var nonstopyn = opener.window.javascript.getParameter("SMMMR05000_nonstopyn");
- var nonstopcnstflag = opener.window.javascript.getParameter("SMMMR05000_nonstopcnstflag");
-
- if ( nonstopyn == "Y") {
- fNewCnst(nonstopcnstflag);
- }
-
- }
- /**
- * @desc : 환자번호 정보조회
- * @id :
- * @event : onkeypress
- * @return : void
- * @authur : 박종훈
- */
- function fPidKeyPress(autoYn, sroomcd)
- {
- model.makeValue("/root/source/srchcond", "1");
- model.makeValue("/root/source/pid", ipt_pid.currentText);
- //inputEnterKey("btn_search", "DOMActivate");
- //환자등록번호 체크
- if(ipt_pid.currentText.length >= 1 )
- {
- model.resetInstanceNode("/root/main/result/patinfo");
- model.makeNode("/root/main/result/patinfo");
- if(submit("TRPMC02500"))
- {
- //fSearch는 인적사항 화면을 임포트 해간 화면에서 구현해 주어야 하는 함수이다.
- if( getNodesetCount("/root/main/result/patinfo/patinfolist") > 0 )
- {
- model.copyNode("/root/main/patinfo", "/root/main/result/patinfo");
- model.makeValue("/root/main/patinfo/patinfolist/agesex", model.getValue("/root/main/patinfo/patinfolist/sex") + "/" + model.getValue("/root/main/patinfo/patinfolist/age"));
- var ioflag = model.getValue("/root/main/result/paminfo/list/ioflag");
- if (ioflag == "O" || ioflag == "S")
- {
- //화면 상단에 환자정보 셋팅
- model.setValue("/root/init/patinfo", "등록번호 : " + model.getValue("/root/main/patinfo/patinfolist/pid") +
- ", 환자명 : " + model.getValue("/root/main/patinfo/patinfolist/hngnm") +
- ", 성별/나이 : " + model.getValue("/root/main/patinfo/patinfolist/agesex"));
- }
- else
- {
- if (autoYn != "N")
- {
- var sRoomcd = model.getValue("/root/main/result/paminfo/list/roomcd");
- }
- else
- {
- //var sRoomcd = model.getValue("/root/main/cnstlist[" + grd_cnstlist.row + "]/roomcd");
- var sRoomcd = sroomcd;
- }
-
- //화면 상단에 환자정보 셋팅
- model.setValue("/root/init/patinfo", "병실 : " + sRoomcd +
- ", 등록번호 : " + model.getValue("/root/main/patinfo/patinfolist/pid") +
- ", 환자명 : " + model.getValue("/root/main/patinfo/patinfolist/hngnm") +
- ", 성별/나이 : " + model.getValue("/root/main/patinfo/patinfolist/agesex"));
- }
- model.makeValue("/root/send/pid", model.getValue("/root/main/patinfo/patinfolist/pid"));
- model.makeValue("/root/main/popupendflag", "ok");
-
- if (autoYn != "N")
- {
- fGetFirstList();
- }
- model.refresh();
- var patid = model.getValue("/root/main/patinfo/patinfolist/pid");
- var ivwpid = ivw_loader.model.getValue("/root/main/paminfo/pid");
- if (patid != "" && ivwpid != "")
- {
- if (patid != ivwpid)
- {
- btn_cnst.disabled = true;
- btn_excnst.disabled = true;
- btn_cotrmt.disabled = true;
- }
- else
- {
- btn_cnst.disabled = false;
- btn_excnst.disabled = false;
- btn_cotrmt.disabled = false;
- }
- }
- }
- else
- {
- model.resetInstanceNode("/root/main/patinfo/patinfolist");
- messageBox("없는 환자 번호 입니다.", "E999", "");
- model.refresh();
- }
- }
- }
- else
- {
- messageBox("환자등록번호를 정확히", "C001");
- }
- }
- /**
- * @desc : 환자이름 정보조회
- * @id :
- * @event : onkeypress
- * @return : void
- * @authur : 박종훈
- */
- function fPnmKeyPress()
- {
- model.makeValue("/root/source/srchcond", "2");
- model.makeValue("/root/source/hngnm", ipt_hngnm.currentText);
- inputEnterKey("btn_search", "DOMActivate");
- }
- /**
- * @desc : 검색 날짜기간
- * @id :
- * @event : DOMActivate
- * @return : void
- * @authur : 박종훈
- */
- function fAddDateReq(diffFlag)
- {
- var frdd = model.getValue("/root/send/reqfromdd");
- var todd = model.getValue("/root/send/reqtodd");
- var srcdd = new Date();
- var destdd = new Date();
- var diffdt;
- if (diffFlag == "next")
- {
- srcdd = todd.toDate();
- srcdd = srcdd.getAddDate(1, "D");
- frdd = srcdd.getDateFormat();
-
- diffdt = parseInt(model.getValue("/root/init/reqmedireclist/diffdt")) * 1;
- destdd = srcdd.getAddDate(diffdt, "D");
- todd = destdd.getDateFormat();
- }
- else if (diffFlag == "back")
- {
- srcdd = frdd.toDate();
- srcdd = srcdd.getAddDate(-1, "D");
- todd = srcdd.getDateFormat();
-
- diffdt = parseInt(model.getValue("/root/init/reqmedireclist/diffdt")) * -1;
- destdd = srcdd.getAddDate(diffdt, "D");
- frdd = destdd.getDateFormat();
- }
- else if (diffFlag == "today")
- {
- todd = getCurrentDate();
- var today = new Date();
- var frday = new Date();
- var diffdt = parseInt(model.getValue("/root/init/reqmedireclist/diffdt")) * -1;
- frday = today.getAddDate(diffdt , "D");
- frdd = frday.getDateFormat();
- }
- else
- {
- var today = todd.toDate();
- var frday = new Date();
- var diffdt = parseInt(model.getValue("/root/init/reqmedireclist/diffdt")) * -1;
- frday = today.getAddDate(diffdt , "D");
- frdd = frday.getDateFormat();
- }
- model.setValue("/root/send/reqfromdd", frdd);
- model.setValue("/root/send/reqtodd", todd);
- ipt_formrecdtfr.refresh();
- ipt_formrecdtto.refresh();
- }
- /**
- * @desc : 의뢰서 선택을 위한 팝업 호출
- * @
- * @param :
- * @return :
- * @authur : 박종훈
- * @---------------------------------------------------
- */
- function fNewCnst_old(cnstflag)
- {
- if (doctyn == "Y")
- {
- srchmode = "piduserreq";
- }
- else
- {
- srchmode = "piddeptreq";
- }
- setParameter("MMR05000_cnstflag", cnstflag);
- modal("SPMMR03900");
- }
- /**
- * @desc : 의뢰서 작성
- * @
- * @param :
- * @return :
- * @authur : 박종훈
- * @---------------------------------------------------
- */
- function old_fNewCnst()
- {
- var PamPid = model.getValue("/root/main/result/paminfo/list/pid");
- var PatPid = model.getValue("/root/main/result/patinfo/patinfolist/pid");
- if (PamPid == PatPid || isDevMode())
- {
- ivw_loader.disabled = false;
- ivw_loader.window.javascript.fLoadNewXRW("SMMMR04900");
- }
- else
- {
- messageBox("상단정보의 환자와 일치하지 않아 진행", "E001");
- ivw_loader.disabled = true;
- return;
- }
- }
- /**
- * @desc : 의뢰서 오픈(진료일정 팝업에서 호출)
- * @
- * @param :
- * @return :
- * @authur : 박종훈
- * @---------------------------------------------------
- */
- function fOpenCnstForm_old(formcd, cnstdeptcd, cnstdeptnm, drid, drnm, hopedd, cnstflag, formnm, replflag)
- {
- ivw_loader.disabled = false;
- setParameter("userdeptcd", cnstdeptcd);
- ivw_loader.window.javascript.setParameter("SMMMR04900_newcnstform", "Y");
- ivw_loader.window.javascript.setParameter("SMMMR04900_formcd", formcd);
- if (replflag == "R") //의뢰부서는 환자진료과
- {
- var reqdpcd = ivw_loader.model.getValue("/root/main/paminfo/orddeptcd");
- model.setValue("/root/cond/orddeptcd", reqdpcd);
- fAftertemp();
- var reqdrid = ivw_loader.model.getValue("/root/main/paminfo/orddrid");
- model.setValue("/root/cond/orddrid", reqdrid);
- var reqdpnm = model.getValue("/root/init/deptlist/orddept[deptcd = '" + reqdpcd + "']/deptnm");
- var reqdrnm = model.getValue("/root/init/userlist/usercombo[userid = '" + reqdrid + "']/usernm");
- ivw_loader.window.javascript.setParameter("SMMMR04900_reqdpcd", reqdpcd);
- ivw_loader.window.javascript.setParameter("SMMMR04900_reqdpnm", reqdpnm);
- ivw_loader.window.javascript.setParameter("SMMMR04900_reqdrid", reqdrid);
- ivw_loader.window.javascript.setParameter("SMMMR04900_reqdrnm", reqdrnm);
- ivw_loader.window.javascript.setParameter("SMMMR04900_cnstdeptcd", cnstdeptcd);
- ivw_loader.window.javascript.setParameter("SMMMR04900_cnstdeptnm", cnstdeptnm);
- }
- else if (replflag == "D") //회신부서는 환자 진료과
- {
- var recvdpcd = ivw_loader.model.getValue("/root/main/paminfo/orddeptcd");
- model.setValue("/root/cond/orddeptcd", recvdpcd);
- fAftertemp();
- var recvdrid = ivw_loader.model.getValue("/root/main/paminfo/orddrid");
- model.setValue("/root/cond/orddrid", recvdrid);
- var recvdpnm = model.getValue("/root/init/deptlist/orddept[deptcd = '" + recvdpcd + "']/deptnm");
- var recvdrnm = model.getValue("/root/init/userlist/usercombo[userid = '" + recvdrid + "']/usernm");
- ivw_loader.window.javascript.setParameter("SMMMR04900_cnstdeptcd", recvdpcd);
- ivw_loader.window.javascript.setParameter("SMMMR04900_cnstdeptnm", recvdpnm);
- ivw_loader.window.javascript.setParameter("SMMMR04900_cnstuserid", recvdrid);
- ivw_loader.window.javascript.setParameter("SMMMR04900_cnstusernm", recvdrnm);
- }
- else
- {
- ivw_loader.window.javascript.setParameter("SMMMR04900_cnstdeptcd", cnstdeptcd);
- ivw_loader.window.javascript.setParameter("SMMMR04900_cnstdeptnm", cnstdeptnm);
- }
- //fAftertemp
- if (cnstflag == "1")
- {
- ivw_loader.window.javascript.setParameter("SMMMR04900_drid", drid);
- ivw_loader.window.javascript.setParameter("SMMMR04900_drnm", drnm);
- ivw_loader.window.javascript.setParameter("SMMMR04900_hopedd", hopedd);
- }
- else if (cnstflag == "3")
- {
- ivw_loader.window.javascript.setParameter("SMMMR04900_formnm", formnm);
- ivw_loader.window.javascript.setParameter("SMMMR04900_replflag", replflag);
- }
- ivw_loader.window.javascript.setParameter("SMMMR04900_cnstflag", cnstflag);
- ivw_loader.window.javascript.fLoadNewForm(formcd);
- }
- /**
- * @desc : 그리드 사이즈 조절
- * @
- * @param :
- * @return :
- * @authur : 박종훈
- * @---------------------------------------------------
- */
- function fCnstGrdSize(mode)
- {
- if (mode == "max")
- {
- ivw_loader.visible = false;
- grd_cnstlist.attribute("width") = (body.attribute("width") - 15);
- //model.refresh();
- } else {
- ivw_loader.visible = true;
- grd_cnstlist.attribute("width") = 589;
- }
- }
- /**
- * @desc : 통계내역 화면 디자인
- * @
- * @param :
- * @return :
- * @authur : 박종훈
- * @---------------------------------------------------
- */
- function fCnstSumList()
- {
- var dpsend = model.getValue("/root/main/cnstsum/deptreqrepl") + " / " + model.getValue("/root/main/cnstsum/deptreqall");
- var dprecv = model.getValue("/root/main/cnstsum/deptrecvrepl") + " / " + model.getValue("/root/main/cnstsum/deptrecvall");
- var usersend = model.getValue("/root/main/cnstsum/userreqrepl") + " / " + model.getValue("/root/main/cnstsum/userreqall");
- var userrecv = model.getValue("/root/main/cnstsum/userrecvrepl") + " / " + model.getValue("/root/main/cnstsum/userrecvall");
- if (dpsend == "")
- dpsend = "0 / 0";
- if (dprecv == "")
- dprecv = "0 / 0";
- if (usersend == "")
- usersend = "0 / 0";
- if (userrecv == "")
- userrecv = "0 / 0";
- model.makeValue("/root/main/cnsttotal/dpsend", dpsend);
- model.makeValue("/root/main/cnsttotal/dprecv", dprecv);
- model.makeValue("/root/main/cnsttotal/usersend", usersend);
- model.makeValue("/root/main/cnsttotal/userrecv", userrecv);
- model.refresh();
- }
- /**
- * @desc : 기록서식 오픈 여부 확인
- * @
- * @param :
- * @return :
- * @authur : 박종훈
- * @---------------------------------------------------
- */
- function fEndFormReady_MMR01100()
- {
- var instance = document.models(0).instances(0);
- var nodelistCnst = "";
- var cnstflag = model.getValue("/root/send/cnstflag");
- if (cnstflag == "3")
- {
- nodelistCnst = instance.selectNodes("/root/main/cnstlist[recvdeptcd='" + deptcd + "']");
- }
- else
- {
- nodelistCnst = instance.selectNodes("/root/main/cnstlist[recvuserid='" + getUserId() + "']");
- }
- var cnststat = "";
- var srcNode = "";
- var recseq = "";
- var pid = model.getValue ("/root/main/result/paminfo/list/pid");
- var orddd= model.getValue ("/root/main/result/paminfo/list/orddd");
- var cretno = model.getValue ("/root/main/result/paminfo/list/cretno");
- var iofg = model.getValue ("/root/main/result/paminfo/list/ioflag");
- var orddeptcd = model.getValue ("/root/main/result/paminfo/list/orddeptcd");
- var orddrid = model.getValue ("/root/main/result/paminfo/list/orddrid");
- var reqfromrecseq = "";
- // if (pid == null || pid == "")
- // return;
- if(nodelistCnst.length >= 1)
- {
- srcNode = nodelistCnst.item(0);
- cnststat = srcNode.selectSingleNode("cnststat").text;
- if(cnststat < 21 && cnststat > 11)
- {
- reqfromrecseq = srcNode.selectSingleNode("formrecseq").text;
- if (reqfromrecseq != "")
- {
- grd_cnstlist.rowstyle(1, "data", "background-color") = "#ffcc99";
- grd_cnstlist.refresh();
- ivw_loader.window.javascript.fLoadRecForm(reqfromrecseq);
- if (doctyn == "Y")
- {
- var sJobkind = getUserInfo("jobkindcd").substring(0, 2);
- if(sJobkind == "03")
- {
- if (pid != "")
- {
- srchmode = "piduserrecv";
- }
- else
- {
- srchmode = "userrecv";
- }
- }
- else //의사가 아닐경우 환자별 의뢰건만 조회
- {
- ivw_loader.grup_btn.disabled = true;
- }
- }
- else
- {
- if (pid != "")
- {
- srchmode = "piddeptrecv";
- }
- else
- {
- srchmode = "deptrecv";
- }
- }
- }
- }
- }
- }
- /**
- * @desc : 환자정보조회 팝업
- * @id :
- * @event : DOMActivate
- * @return : void
- * @authur : 박종훈
- */
- function fPopPtinfo()
- {
- modal("SPPMC02500", "1","150", "150", "SPPMC02500", "/root/source", "/root/send");
- var patid = model.getValue("/root/main/patinfo/patinfolist/pid");
- var ivwpid = ivw_loader.model.getValue("/root/main/paminfo/pid");
- if (patid != "" && ivwpid != "")
- {
- if (patid != ivwpid)
- {
- btn_cnst.disabled = true;
- btn_excnst.disabled = true;
- btn_cotrmt.disabled = true;
- }
- else
- {
- btn_cnst.disabled = false;
- btn_excnst.disabled = false;
- btn_cotrmt.disabled = false;
- }
- model.makeValue("/root/send/pid", patid);
- model.makeValue("/root/main/patinfo/patinfolist/agesex", model.getValue("/root/main/patinfo/patinfolist/sex") + "/" + model.getValue("/root/main/patinfo/patinfolist/age"));
- //화면 상단에 환자정보 셋팅
- model.setValue("/root/init/patinfo", "등록번호 : " + model.getValue("/root/main/patinfo/patinfolist/pid") +
- ", 환자명 : " + model.getValue("/root/main/patinfo/patinfolist/hngnm") +
- ", 성별/나이 : " + model.getValue("/root/main/patinfo/patinfolist/agesex"));
- model.refresh();
- fGetCnstlist("pidall");
- }
- model.resetInstanceNode("/root/source");
- }
- /**
- * @desc : 로컬체크
- * @id :
- * @event : DOMActivate
- * @return : void
- * @authur : 박종훈
- */
- function fLocalYn()
- {
- if (window.document.location == "C:/CMCProject/application/webapps/emr/medirecweb/xrw/" ||
- window.document.location == "D:/CMCProject/application/webapps/emr/medirecweb/xrw/" ||
- window.document.location.indexOf("dev999") > -1)
- {
- return true;
- }
- else
- {
- return false;
- }
- }
- /**
- * @desc : 처음 로드시 컨설트 내역 조회
- * @id :
- * @event : DOMActivate
- * @return : void
- * @authur : 박종훈
- */
- function fGetFirstList()
- {
- var instance = document.models(0).instances(0);
- var nodelistPatinfo = instance.selectNodes("/root/main/result/paminfo/list");
- if(nodelistPatinfo.length == 1)
- {
- var sJobkind = getUserInfo("jobkindcd").substring(0, 2);
- if(sJobkind == "03")
- {
- fGetCnstlist("piduserrecv");
- }
- else //의사가 아닐경우 환자별 의뢰건만 조회
- {
- fGetCnstlist("pidnurcreq");
- }
- }
- else
- {
- if (doctyn == "Y")
- {
- fGetCnstlist("userrecv");
- }
- else
- {
- fGetCnstlist("deptrecv");
- }
- }
- }
- /**
- * @desc : 저장 후 로직
- * @id :
- * @event : DOMActivate
- * @return : void
- * @authur : 박종훈
- */
- function fSaveAfter()
- {
- fGetCnstlist(srchmode);
- ivw_loader.window.javascript.setParameter("SMMMR04900_newcnstform", "N");
- }
- /**
- * @desc : 의뢰 컨설트 열기
- * @
- * @param :
- * @return :
- * @authur : 박종훈
- * @---------------------------------------------------
- */
- function fOpenRecCnstForm(formrecseq, cnstflag, calledflag)
- {
-
- ivw_loader.window.javascript.setParameter("userdeptcd", getUserInfo("dutplcecd"));
- ivw_loader.window.javascript.setParameter("SMMMR04900_cnstflag", cnstflag);
- ivw_loader.window.javascript.fLoadRecForm(formrecseq, calledflag);
- if (doctyn == "Y") //의사(진료의뢰)일 경우 의사별 받은건
- {
- var sJobkind = getUserInfo("jobkindcd").substring(0, 2);
- if(sJobkind == "03")
- {
- srchmode = "piduserrecv";
- ivw_loader.grup_btn.disabled = false;
- }
- else //의사가 아닐경우 환자별 의뢰건만 조회
- {
- ivw_loader.grup_btn.disabled = true;
- }
- }
- else
- {
- srchmode = "piddeptrecv";
- }
- }
- /**
- * @desc : 회신처리
- * @
- * @param :
- * @return :
- * @authur : 박종훈
- * @---------------------------------------------------
- */
- function fSetRepl()
- {
- var formrecseq = model.getValue("/root/main/cnstlist[" + grd_cnstlist.row + "]/formrecseq");
- var cnststat = parseInt(model.getValue("/root/main/cnstlist[" + grd_cnstlist.row + "]/cnststat"));
- var recvuserid = model.getValue("/root/main/cnstlist[" + grd_cnstlist.row + "]/recvuserid");
- if (recvuserid != getUserId())
- {
- messageBox("회신처리", "E002");
- return;
- }
- else if (cnststat > 12)
- {
- messageBox("의뢰이후 상태에서는 회신처리", "E001");
- return;
- }
- else
- {
- model.makeValue("/root/send/formrecseq", formrecseq);
- submit("TXMMR05001");
- }
- }
- /**
- * @desc : 컨설트 의뢰 취소
- * @
- * @param :
- * @return :
- * @authur : 박종훈
- * @---------------------------------------------------
- */
- function fSetCnstCancel()
- {
- var rtn = messageBox("의뢰를 취소 합니다.", "Q003");
- if (rtn != 6)
- return;
-
- var formrecseq = model.getValue("/root/main/cnstlist[" + grd_cnstlist.row + "]/formrecseq");
- var cnststat = parseInt(model.getValue("/root/main/cnstlist[" + grd_cnstlist.row + "]/cnststat"));
- var requserid = model.getValue("/root/main/cnstlist[" + grd_cnstlist.row + "]/requserid");
- var recvuserid = model.getValue("/root/main/cnstlist[" + grd_cnstlist.row + "]/recvuserid");
- var chosflag= model.getValue("/root/main/cnstlist[" + grd_cnstlist.row + "]/chosflag");
- if (formrecseq != "")
- {
- model.makeValue("/root/send/formrecseq", formrecseq);
- if(submit("TXMMR05002"))
- {
- var mess = model.getValue("/root/main/savedinfo/rsltmsg/msg");
- if(mess == "1")
- {
- messageBox("취소 되었습니다.", "I", "");
- fGetCnstlist(srchmode);
-
- ivw_loader.src = "../../../emr/medirecweb/xrw/SSMMR01100_서식로더.xrw";
- ivw_loader.window.javascript.fInitPage(false, true, parseInt(ivw_loader.attribute("height")));
- }
- else
- {
- messageBox(mess, "I", "");
- }
- }
- }
- else
- {
- return;
- }
- }
- /**
- * @desc : 컨설트 의뢰확정 취소
- * @
- * @param :
- * @return :
- * @authur : 박종훈
- * @---------------------------------------------------
- */
- function fSetReqFixCancel()
- {
- var rtn = messageBox("의뢰 상태로 변경 됩니다.", "Q003");
- if (rtn != 6)
- return;
-
- var formrecseq = model.getValue("/root/main/cnstlist[" + grd_cnstlist.row + "]/formrecseq");
- var cnststat = parseInt(model.getValue("/root/main/cnstlist[" + grd_cnstlist.row + "]/cnststat"));
- var requserid = model.getValue("/root/main/cnstlist[" + grd_cnstlist.row + "]/requserid");
- var recvuserid = model.getValue("/root/main/cnstlist[" + grd_cnstlist.row + "]/recvuserid");
- var chosflag= model.getValue("/root/main/cnstlist[" + grd_cnstlist.row + "]/chosflag");
- var cnstflag= model.getValue("/root/main/cnstlist[" + grd_cnstlist.row + "]/cnstflag");
-
- if (formrecseq != "")
- {
- model.makeValue("/root/send/formrecseq", formrecseq);
- model.makeValue("/root/send/cnstflag", cnstflag);
- if(submit("TXMMR05003"))
- {
- var mess = model.getValue("/root/main/rsltinfo/cvrtcnt/cnt");
- if(mess == "1")
- {
- messageBox("변경 되었습니다.", "I", "");
- fGetCnstlist(srchmode);
- }
- else
- {
- messageBox("변경에 실패 하였습니다.", "I", "");
- }
- }
- }
- else
- {
- return;
- }
- }
- /**
- * @desc : 내원구분에 따른 환경 셋팅
- * @
- * @param :
- * @return :
- * @authur : 박종훈
- * @---------------------------------------------------
- */
- function fIoFlagChange()
- {
- var ioflag = model.getValue("/root/send/ioflag");
- var refdata = "";
- var sizedata = "";
- if (ioflag == "I")
- {
- refdata = "seq^checkflag^formnm^gubunflag^cnststatnm^eryn^pid^pidnm^wardnm^roomcd^reqdeptnm^requsernm^recvdeptnm^recvusernm^reqdd^repldd^replusernm^ddcnt^replcnt^lastreplusernm^lastrepldt^atdoctnm^inptusernm^medispclnm^indd^dschdd^formrecseq^chosflag^reqdeptcd^medispclid^atdoctid^repluserid^wardcd^cnststat^inptuserid^lastrepluserid^signno";
- sizedata = "5^30^100^60^55^30^65^65^70^70^85^65^85^65^100^100^65^40^30^65^100^65^65^0^70^70^50^0^0^0^0^0^0^0^0^0^0";
- checkbox2.visible = "true";
- caption13.visible = "true";
- combo2.visible = "true";
- }
- else if (ioflag == "O")
- {
- refdata = "seq^checkflag^formnm^gubunflag^cnststatnm^eryn^reqdd^pid^pidnm^reqdeptnm^requsernm^inptusernm^recvdeptnm^recvusernm^repldd^replusernm^ddcnt^replcnt^lastreplusernm^lastrepldt^formrecseq^chosflag^reqdeptcd^medispclid^medispclnm^atdoctid^atdoctnm^repluserid^indd^dschdd^wardcd^wardnm^roomcd^cnststat^inptuserid^lastrepluserid^signno";
- sizedata = "5^30^100^60^55^30^100^65^65^85^65^65^85^65^100^65^40^30^65^100^50^0^0^0^0^0^0^0^0^0^0^0^0^0^0^0^0";
- checkbox2.visible = "false";
- caption13.visible = "false";
- combo2.visible = "false";
-
- model.setValue("/root/presend/inflag", "");
- }
- else
- {
- refdata = "seq^checkflag^formnm^gubunflag^cnststatnm^eryn^reqdd^pid^pidnm^reqdeptnm^requsernm^recvdeptnm^recvusernm^repldd^replusernm^ddcnt^replcnt^lastreplusernm^lastrepldt^roomcd^atdoctnm^inptusernm^medispclnm^indd^dschdd^formrecseq^chosflag^reqdeptcd^medispclid^atdoctid^repluserid^wardcd^wardnm^cnststat^inptuserid^lastrepluserid^signno";
- sizedata = "5^30^100^60^55^30^100^65^65^85^65^85^65^100^65^40^30^65^100^70^65^65^0^70^70^50^0^0^0^0^0^0^0^0^0^0^0";
- }
- setOrderInfoOfCol("grd_cnstlist", refdata, sizedata);
-
- submit("TRMMR04901"); //컨설트 부서조회
-
- }
- /**
- * @desc : 컬럼 순서 정보 설정
- * @
- * @param : grid ID : 그리드ID
- * : refdata : 그리드 ref데이터 구분자 '^'
- * : sizedata : 그리드 size데이터 구분자 '^'
- * @return :
- * @author : 오지훈
- * @---------------------------------------------------
- */
- function setOrderInfoOfCol(grdid, refdata, sizedata)
- {
- var grdobj = document.controls.item(grdid);
- var refarr = refdata.split("^");
- var sizearr = sizedata.split("^");
- for(var i = 0; i < refarr.length; i++){
- var colcnt = grdobj.colref("" + refarr[i] + "");
- grdobj.colMove(i, colcnt, "before", false);
- var size = sizearr[i];
- if(size == 0){ // size of column 0 -> hidden
- grdobj.colHidden(i) = true;
- }else{
- grdobj.colHidden(i) = false;
- }
- grdobj.colWidth(i) = eval(size);
- }
- grdobj.rebuild();
- }
- /**
- * @desc : 확인안한 회신건 카운트
- * @
- * @param :
- * @return :
- * @authur : 박종훈
- * @---------------------------------------------------
- */
- function fCountReplList()
- {
- var instance = document.models(0).instances(0);
- var nodelistCnst = instance.selectNodes("/root/main/cnstlist[requserid='" + getUserId() + "' and (cnststat = '22' or cnststat = '32')]");
- if (nodelistCnst.length > 0)
- {
- model.setValue("/root/init/replinfo", "확인하지 않은 회신 " + nodelistCnst.length + "건 존재합니다.");
- }
- else
- {
- model.setValue("/root/init/replinfo", "");
- }
- model.refresh();
- }
- /**
- * @desc : 사용자 조회
- * @
- * @param :
- * @return :
- * @authur : 박종훈
- * @---------------------------------------------------
- */
- function fAftertemp()
- {
- mmbfGetUserComboList("/root/send/reqdata", "/root/init/userlist", cmb_orddept.value, "0330");
- }
- /*****************************************************************************
- 튜닝
- ******************************************************************************/
- /**
- * @group :
- * @ver : 2008.06.13
- * @by : snoweye
- * @---------------------------------------------------
- * @type : function
- * @access : private
- * @desc : 의뢰서 선택을 위한 팝업 호출 및 의뢰서 로딩
- * @param : cnstflag - 진료의뢰/타과의뢰 구분 ("1"/"3")
- * @return :
- * @---------------------------------------------------
- */
- function fNewCnst(cnstflag)
- {
- /*
- if (model.getValue ("/root/main/result/paminfo/list/ioflag") == "E" && cnstflag == "1")
- {
- messageBox("응급실 재원 환자는 진료과 consult를 발행할 수 없습니다.병동 입원 후 의뢰", "I008");
- return;
- }
- */
-
- if (doctyn == "Y")
- {
- srchmode = "piduserreq";
- }
- else
- {
- srchmode = "piddeptreq";
- }
-
- var nonstopyn = opener.window.javascript.getParameter("SMMMR05000_nonstopyn");
- var paramformcd = opener.window.javascript.getParameter("SMMMR05000_formcd");
- var paramdeptcd = opener.window.javascript.getParameter("SMMMR05000_deptcd");
- var paramdeptnm = opener.window.javascript.getParameter("SMMMR05000_deptnm");
- var paramdrid = opener.window.javascript.getParameter("SMMMR05000_drid");
- var paramdrnm = opener.window.javascript.getParameter("SMMMR05000_drnm");
- var paramorddd = opener.window.javascript.getParameter("SMMMR05000_orddd");
- var paramcnstflag = opener.window.javascript.getParameter("SMMMR05000_cnstflag");
- var paramreplflag = opener.window.javascript.getParameter("SMMMR05000_replflag");
- var paramcnstioflag = opener.window.javascript.getParameter("SMMMR05000_cnstioflag");
-
-
- if (nonstopyn != "Y") {
- setParameter("MMR05000_cnstflag", cnstflag);
- modal("SPMMR03900");
-
- if(getParameter("SPMMR03900_deptnm") == "") {
- return;
- }
- }
- else {
- setParameter("SPMMR03900_formcd",paramformcd);
- setParameter("SPMMR03900_deptcd",paramdeptcd);
- setParameter("SPMMR03900_deptnm",paramdeptnm);
- setParameter("SPMMR03900_drid",paramdrid);
- setParameter("SPMMR03900_drnm",paramdrnm);
- setParameter("SPMMR03900_orddd",paramorddd);
- setParameter("SPMMR03900_cnstflag",paramcnstflag);
- //setParameter("SPMMR03900_formnm",paramformnm);
- setParameter("SPMMR03900_replflag",paramreplflag);
- setParameter("SPMMR03900_cnstioflag",paramcnstioflag);
- }
- var formcd = getParameter("SPMMR03900_formcd");
- var deptcd = getParameter("SPMMR03900_deptcd");
- var deptnm = getParameter("SPMMR03900_deptnm");
- var drid = getParameter("SPMMR03900_drid");
- var drnm = getParameter("SPMMR03900_drnm");
- var orddd = getParameter("SPMMR03900_orddd");
- var cnstflag = getParameter("SPMMR03900_cnstflag");
- var formnm = getParameter("SPMMR03900_formnm");
- var replflag = getParameter("SPMMR03900_replflag");
- var cnstioflag = getParameter("SPMMR03900_cnstioflag");
- var reqdeptno = getParameter("SPMMR03900_reqdeptno");
-
- var mainscrnid = getScreenID();
-
- setParameter("SPMMR04900_mainscrnid", mainscrnid );
- setParameter("MMR05000_cnstflag", cnstflag);
- clearParameter("SPMMR03900_formcd");
- clearParameter("SPMMR03900_deptcd");
- clearParameter("SPMMR03900_deptnm");
- clearParameter("SPMMR03900_drid");
- clearParameter("SPMMR03900_drnm");
- clearParameter("SPMMR03900_orddd");
- clearParameter("SPMMR03900_cnstflag");
- clearParameter("SPMMR03900_formnm");
- clearParameter("SPMMR03900_replflag");
- clearParameter("SPMMR03900_cnstioflag");
-
- if(cnstflag == "1")
- {
- fOpenCnstForm(formcd, deptcd, deptnm, drid, drnm, orddd, cnstflag, "", "", cnstioflag);
- //2014/01/24 마취과로 컨설트 의뢰시 통증 또는 마취인지 구분 할 수 있도록 컨트롤 활성화
- if(deptcd=="2090000000"){
- ivw_loader.ivw_base.cap_gubun.visible=true;
- ivw_loader.ivw_base.rdo_anstflag.visible=true;
- ivw_loader.ivw_base.rdo_anstflag.value="";
- ivw_loader.ivw_base.rdo_anstflag.refresh();
- }else{
- ivw_loader.ivw_base.cap_gubun.visible=false;
- ivw_loader.ivw_base.rdo_anstflag.visible=false;
- ivw_loader.ivw_base.rdo_anstflag.value="";
- ivw_loader.ivw_base.rdo_anstflag.refresh();
-
- //초기화
- ivw_loader.ivw_base.model.makeValue("/root/init/cond/jinyn","N");
- //ivw_loader.ivw_base.model.makeValue("/root/init/cond/jinyn","N");
-
- //ivw_loader.ivw_base.b_jinyn.value="";
- ivw_loader.ivw_base.b_jinyn.refresh();
-
- }
- //2014/01/24
- }
- else
- {
- if(formcd == "0000000964")
- {
- modal("SPADC61700");
- }
- else if(formcd == "0000000769")
- {
- modal("SPADC62000");
- }
- else if(formcd == "0000000768")
- {
- modal("SPADC61800");
- }
- else if(formcd == "0000000770" || formcd == "0000003019")
- {
- model.removeNodeset("/root/temp/cnstinfo");
- model.makeValue("/root/temp/cnstinfo", formcd);
- modal("SPADB62300", 1, 0, 0 ,"SPADB62300", "/root/temp/cnstinfo", "/root/temp/cnstinfo");
- }
- else if(formcd == "0000000771")
- {
- modal("SPADC62100");
- }
- else if(formcd == "0000000693")
- {
- modal("SPADC60900");
- }
- else
- {
- fOpenCnstForm(formcd, deptcd, deptnm, "", "", "", cnstflag, formnm, replflag, "");
-
- //[요청번호:20160628017] 가정호스피스 이용동의서 확인 팝업 요청
- if( getUserInfo("dutplceinstcd") == "032" && formcd == "1600017738" ){
- messageBox("가정 호스피스 의뢰 시 완화 의료 이용동의서 확인 하십시요.","I");
- }else if( getUserInfo("dutplceinstcd") == "032" && formcd == "1700019904" ){
- // [요청번호:20180228002] consult화면에서 의뢰시 자동팝업창 요청
- messageBox("자문 호스피스 의뢰 시 환자 및 보호자에게 완화 의료 이용동의 확인 후 의뢰하여 주십시오.","I");
- }
- }
-
- fGetCnstlist(srchmode);
- }
- }
- /*****************************************************************************
- 튜닝
- ******************************************************************************/
- /**
- * @group :
- * @ver : 2008.06.13
- * @by : snoweye
- * @---------------------------------------------------
- * @type : function
- * @access : private
- * @desc : 진료의뢰 화면 로딩
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fOpenCnstForm(formcd, cnstdeptcd, cnstdeptnm, drid, drnm, hopedd, cnstflag, formnm, replflag, cnstioflag)
- {
- ivw_loader.disabled = false;
- setParameter("userdeptcd", cnstdeptcd);
- ivw_loader.window.javascript.setParameter("SMMMR04900_newcnstform", "Y");
- ivw_loader.window.javascript.setParameter("SMMMR04900_formcd", formcd);
- ivw_loader.window.javascript.setParameter("SMMMR04900_reqdeptno", getParameter("SPMMR03900_reqdeptno"));
- if (replflag == "R") //의뢰부서는 환자진료과
- {
- var reqdpcd = ivw_loader.model.getValue("/root/main/paminfo/orddeptcd");
- model.setValue("/root/cond/orddeptcd", reqdpcd);
- fAftertemp();
- var reqdrid = ivw_loader.model.getValue("/root/main/paminfo/orddrid");
- model.setValue("/root/cond/orddrid", reqdrid);
- var reqdpnm = model.getValue("/root/init/deptlist/orddept[deptcd = '" + reqdpcd + "']/deptnm");
- var reqdrnm = model.getValue("/root/init/userlist/usercombo[userid = '" + reqdrid + "']/usernm");
- ivw_loader.window.javascript.setParameter("SMMMR04900_reqdpcd", reqdpcd);
- ivw_loader.window.javascript.setParameter("SMMMR04900_reqdpnm", reqdpnm);
- ivw_loader.window.javascript.setParameter("SMMMR04900_reqdrid", reqdrid);
- ivw_loader.window.javascript.setParameter("SMMMR04900_reqdrnm", reqdrnm);
- ivw_loader.window.javascript.setParameter("SMMMR04900_cnstdeptcd", cnstdeptcd);
- ivw_loader.window.javascript.setParameter("SMMMR04900_cnstdeptnm", cnstdeptnm);
-
-
-
-
- }
- else if (replflag == "D") //회신부서는 환자 진료과
- {
- var recvdpcd = ivw_loader.model.getValue("/root/main/paminfo/orddeptcd");
- model.setValue("/root/cond/orddeptcd", recvdpcd);
- fAftertemp();
- var recvdrid = ivw_loader.model.getValue("/root/main/paminfo/orddrid");
- model.setValue("/root/cond/orddrid", recvdrid);
- var recvdpnm = model.getValue("/root/init/deptlist/orddept[deptcd = '" + recvdpcd + "']/deptnm");
- var recvdrnm = model.getValue("/root/init/userlist/usercombo[userid = '" + recvdrid + "']/usernm");
- ivw_loader.window.javascript.setParameter("SMMMR04900_cnstdeptcd", recvdpcd);
- ivw_loader.window.javascript.setParameter("SMMMR04900_cnstdeptnm", recvdpnm);
- ivw_loader.window.javascript.setParameter("SMMMR04900_cnstuserid", recvdrid);
- ivw_loader.window.javascript.setParameter("SMMMR04900_cnstusernm", recvdrnm);
- }
- else if (replflag == "T") //팀의뢰
- {
- model.makeValue("/root/send/formcd", formcd);
- var recvdpnm = "";
-
- if (submit("TRMMR05003"))
- {
- var edudplist = model.instances(0).selectNodes("/root/edudept/edudeptlist");
-
- if(edudplist.length == 0){
- alert("한건도 없다.");
- return false;
- }
- for (var i = 0; i < edudplist.length; i++)
- {
- depthngnm = edudplist.item(i).selectSingleNode("depthngnm").text;
- recvdpnm += depthngnm + ", "
- }
-
- }
-
- ivw_loader.window.javascript.setParameter("SMMMR04900_cnstdeptnm", recvdpnm.substring(0, recvdpnm.length - 2));
-
- ivw_loader.window.javascript.setParameter("SMMMR04900_cnstdeptcd", cnstdeptcd);
-
- /*
- var recvdpcd = ivw_loader.model.getValue("/root/main/paminfo/orddeptcd");
- model.setValue("/root/cond/orddeptcd", recvdpcd);
- fAftertemp();
- var recvdrid = ivw_loader.model.getValue("/root/main/paminfo/orddrid");
- model.setValue("/root/cond/orddrid", recvdrid);
- var recvdpnm = model.getValue("/root/init/deptlist/orddept[deptcd = '" + recvdpcd + "']/deptnm");
- var recvdrnm = model.getValue("/root/init/userlist/usercombo[userid = '" + recvdrid + "']/usernm");
- ivw_loader.window.javascript.setParameter("SMMMR04900_cnstdeptcd", recvdpcd);
- ivw_loader.window.javascript.setParameter("SMMMR04900_cnstdeptnm", recvdpnm);
- ivw_loader.window.javascript.setParameter("SMMMR04900_cnstuserid", recvdrid);
- ivw_loader.window.javascript.setParameter("SMMMR04900_cnstusernm", recvdrnm);
- */
- }
- else
- {
- ivw_loader.window.javascript.setParameter("SMMMR04900_cnstdeptcd", cnstdeptcd);
- ivw_loader.window.javascript.setParameter("SMMMR04900_cnstdeptnm", cnstdeptnm);
- }
- //fAftertemp
- if (cnstflag == "1")
- {
- ivw_loader.window.javascript.setParameter("SMMMR04900_drid", drid);
- ivw_loader.window.javascript.setParameter("SMMMR04900_drnm", drnm);
- ivw_loader.window.javascript.setParameter("SMMMR04900_hopedd", hopedd);
- ivw_loader.window.javascript.setParameter("SMMMR04900_cnstioflag", cnstioflag);
-
- //이윤주(20140812)
- var paramreqcnt = opener.window.javascript.getParameter("SMMMR05000_reqcnt");
- ivw_loader.window.javascript.setParameter("SMMMR04900_reqcnt", paramreqcnt);
-
- }
- else if (cnstflag == "3")
- {
- ivw_loader.window.javascript.setParameter("SMMMR04900_formnm", formnm);
- ivw_loader.window.javascript.setParameter("SMMMR04900_replflag", replflag);
- }
- ivw_loader.window.javascript.setParameter("SMMMR04900_cnstflag", cnstflag);
- ivw_loader.window.javascript.fLoadNewForm(formcd);
- }
- /**
- * @group :
- * @ver : 2008.09.01
- * @by : jonghun
- * @---------------------------------------------------
- * @type : function
- * @access : private
- * @desc : 컨설트 리스트 더블클릭시 이벤트
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fDbClickCnstList()
- {
-
- if((grd_cnstlist.isCell(event.target) && grd_cnstlist.mouserow >= grd_cnstlist.fixedrows))
- {
- //chk_setPatInfo.disabled = false;
- var cnfmyn = grd_cnstlist.valueMatrix(grd_cnstlist.row, grd_cnstlist.colRef("cnfmyn"));
-
- if (cnfmyn == "N")
- {
- messageBox("OCS에서 작성한 기록은 수정할 수 없습니다. 의료정보팀으로 문의", "I008");
- }
- else{
- ivw_loader.grup_btn.disabled = false; //2009-12-08 오후 9:00:59 강지훈 수정
- }
- var irow = parseInt(grd_cnstlist.row);
- grd_cnstlist.allstyle("data", "background-color") = "#ffffff";
- grd_cnstlist.rowstyle(irow, "data", "background-color") = "#ffcc99";
- grd_cnstlist.refresh();
-
- fCnstGrdSize("min");
-
- var cnstformcd = grd_cnstlist.valueMatrix(grd_cnstlist.row, grd_cnstlist.colRef("formcd"));
- var cnstflag = grd_cnstlist.valueMatrix(grd_cnstlist.row, grd_cnstlist.colRef("cnstflag"));
- var formrecseq = grd_cnstlist.valueMatrix(grd_cnstlist.row, grd_cnstlist.colRef("formrecseq"));
- var selpid = grd_cnstlist.valueMatrix(grd_cnstlist.row, grd_cnstlist.colRef("pid"));
- var sroomcd = grd_cnstlist.valueMatrix(grd_cnstlist.row, grd_cnstlist.colRef("roomcd"));
- var sCnststat = grd_cnstlist.valueMatrix(grd_cnstlist.row, grd_cnstlist.colRef("cnststat"));
-
- if (sCnststat == "04" || sCnststat == "05")
- {
- messageBox("취소된 의뢰", "I009");
- return;
- }
- if(cnstflag == "1")
- {
-
- fOpenRecCnstForm(grd_cnstlist.valueMatrix(grd_cnstlist.row, grd_cnstlist.colRef("formrecseq")), grd_cnstlist.valueMatrix(grd_cnstlist.row, grd_cnstlist.colRef("cnstflag")));
- //2014/01/28 수신과가 마취통증의학과 일시에는 의뢰구분이 보이도록 설정
- var userdeptcd=getUserInfo("dutplcecd"); // 유저부서
- var cnststat = model.getValue("/root/main/cnstlist["+grd_cnstlist.row+"]/cnststat"); // 컨설트 상태
- if(cnstformcd=="0000000677" && grd_cnstlist.valueMatrix(grd_cnstlist.row, grd_cnstlist.colRef("reqdeptcd")) == getUserInfo("dutplcecd") &&
- grd_cnstlist.valueMatrix(grd_cnstlist.row, grd_cnstlist.colRef("recvdeptcd"))=="2090000000" && cnststat == "12"){
- ivw_loader.ivw_base.cap_gubun.visible=true;
- ivw_loader.ivw_base.rdo_anstflag.visible=true;
- ivw_loader.ivw_base.rdo_anstflag.value=model.getValue("/root/main/cnstlist["+grd_cnstlist.row+"]/anstflag");
- ivw_loader.ivw_base.rdo_anstflag.disabled=false;
- ivw_loader.ivw_base.rdo_anstflag.refresh();
- }else if(cnstformcd=="0000000677" && grd_cnstlist.valueMatrix(grd_cnstlist.row, grd_cnstlist.colRef("reqdeptcd")) == getUserInfo("dutplcecd") &&
- grd_cnstlist.valueMatrix(grd_cnstlist.row, grd_cnstlist.colRef("recvdeptcd"))=="2090000000" && cnststat > "12"){
- ivw_loader.ivw_base.cap_gubun.visible=true;
- ivw_loader.ivw_base.rdo_anstflag.visible=true;
- ivw_loader.ivw_base.rdo_anstflag.value=model.getValue("/root/main/cnstlist["+grd_cnstlist.row+"]/anstflag");
- ivw_loader.ivw_base.rdo_anstflag.disabled=true;
- ivw_loader.ivw_base.rdo_anstflag.refresh();
- }else if(cnstformcd=="0000000677" && grd_cnstlist.valueMatrix(grd_cnstlist.row, grd_cnstlist.colRef("recvdeptcd"))=="2090000000" &&
- getUserInfo("dutplcecd") == "2090000000"){
- ivw_loader.ivw_base.cap_gubun.visible=true;
- ivw_loader.ivw_base.rdo_anstflag.visible=true;
- ivw_loader.ivw_base.rdo_anstflag.value=model.getValue("/root/main/cnstlist["+grd_cnstlist.row+"]/anstflag");
- ivw_loader.ivw_base.rdo_anstflag.disabled=true;
- ivw_loader.ivw_base.rdo_anstflag.refresh();
- }else{
- ivw_loader.ivw_base.cap_gubun.visible=false;
- ivw_loader.ivw_base.rdo_anstflag.visible=false;
- ivw_loader.ivw_base.rdo_anstflag.value="";
- ivw_loader.ivw_base.rdo_anstflag.disabled=false;
- ivw_loader.ivw_base.rdo_anstflag.refresh();
- }
- //2014/01/28
- //2012/02/10 Start 컨설트의 상태가 의뢰일시에는 수신과 및 수신의를 수정가능토록 하지만 그 이외는 수정 불가능하도록 막음
- if(grd_cnstlist.valueMatrix(grd_cnstlist.row, grd_cnstlist.colRef("cnststat"))=="12"){
- ivw_loader.ivw_base.cmb_recdept.disabled=false;
- ivw_loader.ivw_base.cmb_recdoct.disabled=false;
- ivw_loader.ivw_base.combo1.disabled=false;
- }else{
- ivw_loader.ivw_base.cmb_recdept.disabled=true;
- ivw_loader.ivw_base.cmb_recdoct.disabled=true;
- ivw_loader.ivw_base.combo1.disabled=true;
- }
-
- /*
- //Consult화면에서 컨설트 내역 더블클릭시 영상구분을 disabled를 제어(의뢰일시에만 수정가능)
- if((grd_cnstlist.valueMatrix(grd_cnstlist.row, grd_cnstlist.colRef("inptuserid"))==getUserInfo("userid"))&&
- grd_cnstlist.valueMatrix(grd_cnstlist.row, grd_cnstlist.colRef("cnststat"))=="12" &&
- grd_cnstlist.valueMatrix(grd_cnstlist.row, grd_cnstlist.colRef("recvdeptcd"))=="2160000000"){
- ivw_loader.ivw_base.combo1.disabled=false;
- }else{
- ivw_loader.ivw_base.combo1.disabled=true;
- }
- */
- //2012/02/10 End
- }
- else
- {
- if(cnstformcd == "0000003019" || cnstformcd == "0000000964" || cnstformcd == "0000000769" || cnstformcd == "0000000770" || cnstformcd == "0000000771" || cnstformcd == "0000000693")
- {
- model.removeNodeset("/root/temp/cnstinfo");
- model.makeNode("/root/temp/cnstinfo");
- model.copyNode("/root/temp/cnstinfo", "/root/main/cnstlist[formrecseq='" + formrecseq + "']");
-
- var cnststat = parseInt(grd_cnstlist.valueMatrix(grd_cnstlist.row, grd_cnstlist.colRef("cnststat")));
- if (cnststat >= 22)
- {
- modal("SPADC62200", 1, 0, 0 ,"SPADC62200", "/root/temp/cnstinfo", "/root/temp/cnstinfo");
- }
- else
- {
- if(cnstformcd == "0000000964")
- {
- modal("SPADC61700", 1, 0, 0 ,"SPADC61700", "/root/temp/cnstinfo", "/root/temp/cnstinfo");
- }
- else if(cnstformcd == "0000000769")
- {
- modal("SPADC62000", 1, 0, 0 ,"SPADC62000", "/root/temp/cnstinfo", "/root/temp/cnstinfo");
- }
- else if(cnstformcd == "0000000770" || cnstformcd == "0000003019")
- {
- modal("SPADB62300", 1, 0, 0 ,"SPADB62300", "/root/temp/cnstinfo", "/root/temp/cnstinfo");
- }
- else if(cnstformcd == "0000000771")
- {
- modal("SPADC62100", 1, 0, 0 ,"SPADC62100", "/root/temp/cnstinfo", "/root/temp/cnstinfo");
- }
- else if(cnstformcd == "0000000693")
- {
- modal("SPADC60900", 1, 0, 0 ,"SPADC60900", "/root/temp/cnstinfo", "/root/temp/cnstinfo");
- }
- }
- fGetCnstlist(srchmode);
- }
- else if(cnstformcd == "0000000768")
- {
- model.removeNodeset("/root/temp/cnstinfo");
- model.makeNode("/root/temp/cnstinfo");
- model.copyNode("/root/temp/cnstinfo", "/root/main/cnstlist[formrecseq='" + formrecseq + "']");
-
- var cnststat = parseInt(grd_cnstlist.valueMatrix(grd_cnstlist.row, grd_cnstlist.colRef("cnststat")));
- if (cnststat >= 22)
- {
- modal("SMADC01600", 1, 0, 0 ,"SMADC01600", "/root/temp/cnstinfo", "/root/temp/cnstinfo");
- }
- else
- {
- modal("SPADC61800", 1, 0, 0 ,"SPADC61800", "/root/temp/cnstinfo", "/root/temp/cnstinfo");
- }
-
- fGetCnstlist(srchmode);
- }
- else
- {
- fOpenRecCnstForm(grd_cnstlist.valueMatrix(grd_cnstlist.row, grd_cnstlist.colRef("formrecseq")), grd_cnstlist.valueMatrix(grd_cnstlist.row, grd_cnstlist.colRef("cnstflag")));
- }
- }
-
- ipt_pid.value = selpid;
- fPidKeyPress("N", sroomcd);
-
- //2009-12-08 오후 8:58:57 강지훈 수정
- if (cnfmyn == "N")
- {
- ivw_loader.grup_btn.disabled = true;
- }
- else
- {
- ivw_loader.grup_btn.disabled = false;
- }
-
- }
- /* if (model.getValue("/root/init/paminfoyn") == "Y"){
- fChngMainEMRScrn();
- }*/
- }
- /**
- * @group :
- * @ver : 2008.10.10
- * @by : jonghun
- * @---------------------------------------------------
- * @type : function
- * @access : private
- * @desc : 컨설트 리스트 마우스 오른쪽 버튼 이벤트
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fCnstListMouseRight()
- {
- setPopupMenu("grd_cnstlist", false, "/root/init/cnstrecvmsrghtpat/mouserght", "label", "func"); //컨설트리스트 우클릭시 상단연계 이벤트 추가 2009.12.12 LYJ
- if(grd_cnstlist.isCell(event.target) && (grd_cnstlist.mouserow >= grd_cnstlist.fixedrows))
- {
- var grdcnststat = grd_cnstlist.valueMatrix(grd_cnstlist.row, grd_cnstlist.colRef("cnststat"));
- var cnstformcd = grd_cnstlist.valueMatrix(grd_cnstlist.row, grd_cnstlist.colRef("formcd"));
- var grdrequserid = grd_cnstlist.valueMatrix(grd_cnstlist.row, grd_cnstlist.colRef("medispclid"));
- var grdatdoctid = grd_cnstlist.valueMatrix(grd_cnstlist.row, grd_cnstlist.colRef("atdoctid"));
- var grdinputuserid = grd_cnstlist.valueMatrix(grd_cnstlist.row, grd_cnstlist.colRef("inptuserid"));
- var grdreqdpcd = grd_cnstlist.valueMatrix(grd_cnstlist.row, grd_cnstlist.colRef("reqdeptcd"));
-
- var grdrecvuserid = grd_cnstlist.valueMatrix(grd_cnstlist.row, grd_cnstlist.colRef("recvuserid"));
- var grdrecvdpcd = grd_cnstlist.valueMatrix(grd_cnstlist.row, grd_cnstlist.colRef("recvdeptcd"));
- var cnststatnm = grd_cnstlist.valueMatrix(grd_cnstlist.row, grd_cnstlist.colRef("cnststatnm"));
-
- var loginuserid = getUserId();
- var loginuserdpcd = getUserInfo("dutplcecd");
-
- if (cnstformcd != "0000003019" && cnstformcd != "0000000964" && cnstformcd != "0000000769" && cnstformcd != "0000000770" && cnstformcd != "0000000771" && cnstformcd != "0000000693" && cnstformcd != "0000000768")
- {
- if ((grdcnststat == "11" || grdcnststat == "12" || grdcnststat == "20") && (grdreqdpcd == loginuserdpcd || loginuserid == grdrequserid || loginuserid == grdatdoctid || loginuserid == grdinputuserid ||loginuserid==pat_atdoctid ||loginuserid==pat_medispclid))
- {
- //2013/01/29 Start 환자의 주치의 또는 담당의 인지 플래그 셋팅
- if(loginuserid==pat_atdoctid ||loginuserid==pat_medispclid){
- model.makeValue("/root/send/orddridchk", "Y");
- }
- //2013/01/29 End
-
- model.setValue("/root/init/cnstreqmsrght/mouserght/label", "의뢰 취소");
-
- setPopupMenu("grd_cnstlist", false, "/root/init/cnstreqmsrght/mouserght", "label", "func");
- }
- else if ((grdcnststat == "20" || grdcnststat == "21") && (loginuserdpcd == grdrecvdpcd || loginuserid == grdrecvuserid))
- {
- //model.setValue("/root/init/cnstrecvmsrght/mouserght/label", cnststatnm + " 취소");
- //setPopupMenu("grd_cnstlist", false, "/root/init/cnstrecvmsrght/mouserght", "label", "func");
- }
- }
-
- //model.setValue("/root/main/cccdinfo/cccd[" + grd_cccd.mouserow + "]/boolflag", "true");
- //model.refresh();
- //alert(grd_cccd.getUpdateData());
-
- //setPopupMenu("grd_cccd", false, "/root/init/ccmsrght/mouserght", "label", "func");
- }
- }
- /**
- * @group :
- * @ver : 2008.10.17
- * @by : jonghun
- * @---------------------------------------------------
- * @type : function
- * @access : private
- * @desc : 출력 버튼 이벤트
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fClickPrtBtn()
- {
- var checkflag = "";
- var formcd = "";
- var signno = "";
- var prtparam = "";
-
- var cnststat = "";
- var recvdpcd = "";
- var arrrecseq = "formrecseq▦cnstflag▩";
- var isExiest = "N"; //Y일경우 서브밋
-
- var selectcnt=getNodesetCount("/root/main/cnstlist[checkflag='Y']");
-
- if(selectcnt<1){
- messageBox("선택된 의뢰가", "I004");
- return;
- }
-
- for(var i = 1 ; i < grd_cnstlist.rows ; i++){
- checkflag = grd_cnstlist.valueMatrix(i , grd_cnstlist.colRef("checkflag"));
-
- if(checkflag == "Y")
- {
- formcd = grd_cnstlist.valueMatrix(i , grd_cnstlist.colRef("formcd"));
- signno = grd_cnstlist.valueMatrix(i , grd_cnstlist.colRef("signno"));
- cnststat = grd_cnstlist.valueMatrix(i , grd_cnstlist.colRef("cnststat"));
- recvdpcd = grd_cnstlist.valueMatrix(i , grd_cnstlist.colRef("recvdeptcd"));
-
- if (formcd != "" && signno != "0")
- {
- prtparam += "E▦" + signno + "▦" + formcd + "▩";
-
- if (cnststat == "12" && recvdpcd == getUserInfo("dutplcecd"))
- {
- arrrecseq += grd_cnstlist.valueMatrix(i , grd_cnstlist.colRef("formrecseq")) + "▦" + grd_cnstlist.valueMatrix(i , grd_cnstlist.colRef("cnstflag")) + "▩";
- isExiest = "Y";
- }
- }
- }
- }
-
- if (isExiest == "Y")
- {
- model.makeValue("/root/send/arrrecseq", arrrecseq);
- if(submit("TXMMR05004"))
- {
- grd_cnstlist.allstyle("data", "background-color") = "#ffffff";
- grd_cnstlist.refresh();
-
- fCountReplList();
- fGetCnstlist(srchmode);
- }
- }
-
- if(prtparam == "")
- {
- messageBox("출력할 수 없는 서식입니다", "I", "");
- for(var i=1; i<=grd_cnstlist.rows; i++){
- grd_cnstlist.valueMatrix(i , grd_cnstlist.colRef("checkflag"))="N";
- }
- model.refresh();
- return;
- }
-
- //setParameter("SPMRI02400_autoprtYn", "Y");
- setParameter("SPMRI02400_prtrecinfo", prtparam);
- //modal("SPMRI02400", 1, "", "", "", "", "", "left:-800; right:0; width:0; height:0;");
- modal("SPMRI02400");
- }
- function fSelPatInfo()
- {
- messageBox("준비중입니다","Q999");
- return;
- }
- /**
- * @desc : 영상의학과 판독 협진의뢰서 선택
- * @id :
- * @event :
- * @return : void
- * @authur : 박종훈
- */
- function fClickCoTrmtCnst()
- {
- //formcd :1000009108, formnm :영상의학과 판독 협진의뢰서, cnstdeptcd : 2160000000, cnstdeptnm : 영상의학과, replflag : -
- //fOpenCnstForm(formcd, deptcd, deptnm, "", "", "", cnstflag, formnm, replflag, "");
- fOpenCnstForm("1000009108", "2160000000", "영상의학과", "", "", "", "3", "영상의학과 판독 협진의뢰서", "-", "");
- if (doctyn == "Y") {
- srchmode = "piduserreq";
- } else {
- srchmode = "piddeptreq";
- }
-
- fGetCnstlist(srchmode);
- }
- /**
- * @desc : 삭제버튼 클릭시 삭제처리
- * @id :
- * @event :
- * @return :
- * @authur :
- */
- function fCnstRecDelete(){
- var selectcnt=getNodesetCount("/root/main/cnstlist[checkflag='Y']");
- var select_row=grd_cnstlist.row;
- var cnststatnm = grd_cnstlist.valueMatrix(select_row , grd_cnstlist.colRef("cnststatnm"));
-
- if(selectcnt<1){
- messageBox("선택된 의뢰가", "I004");
- return;
- }
-
- if(selectcnt>1){
- messageBox("의뢰취소의 경우 멀티선택을", "E001");
-
- model.setValue("/root/main/cond/checkallitem", "N");
- for(var i=1; i<=grd_cnstlist.rows; i++){
- grd_cnstlist.valueMatrix(i , grd_cnstlist.colRef("checkflag"))="N";
- }
- model.refresh();
- return;
- }
-
- if(cnststatnm=="취소"){
- messageBox("이미 취소된 건이", "E005");
- grd_cnstlist.valueMatrix(select_row , grd_cnstlist.colRef("checkflag"))="N";
- return;
- }
-
- var savedata = "formrecseq▦formcd▦orddridchk▩";
- var datastring="";
- var orddridchk="N";
-
-
- var scnststat = parseInt(grd_cnstlist.valueMatrix(select_row , grd_cnstlist.colRef("cnststat")));
- var formrecseq = model.getValue("/root/main/cnstlist[" + select_row + "]/formrecseq");
- var cnstformcd = grd_cnstlist.valueMatrix(select_row, grd_cnstlist.colRef("formcd"));
- var grdrequserid = grd_cnstlist.valueMatrix(select_row, grd_cnstlist.colRef("requserid"));
- var grdmedispclid = grd_cnstlist.valueMatrix(select_row, grd_cnstlist.colRef("medispclid"));
- var grdatdoctid = grd_cnstlist.valueMatrix(select_row, grd_cnstlist.colRef("atdoctid"));
- var grdinputuserid = grd_cnstlist.valueMatrix(select_row, grd_cnstlist.colRef("inptuserid"));
- var grdreqdpcd = grd_cnstlist.valueMatrix(select_row, grd_cnstlist.colRef("reqdeptcd"));
-
- var grdrecvuserid = grd_cnstlist.valueMatrix(select_row, grd_cnstlist.colRef("recvuserid"));
- var grdrecvdpcd = grd_cnstlist.valueMatrix(select_row, grd_cnstlist.colRef("recvdeptcd"));
- var cnststatnm = grd_cnstlist.valueMatrix(select_row, grd_cnstlist.colRef("cnststatnm"));
- var formnm = grd_cnstlist.valueMatrix(select_row, grd_cnstlist.colRef("formnm"));
-
- var loginuserid = getUserId();
- var loginuserdpcd = getUserInfo("dutplcecd");
-
- if(scnststat>=20 && (cnstformcd == "0000003019" || cnstformcd == "0000000964" ||
- cnstformcd == "0000000769" || cnstformcd == "0000000770" || cnstformcd == "0000000771" ||
- cnstformcd == "0000000693" || cnstformcd == "0000000768" || cnstformcd == "1000009108")){
- // 아래의 8가지 지원부서 의뢰일 경우는 상태값이 의뢰임시 또는 의뢰 상태에서는 삭제 될 수 있음
- /*
- 0000000693 약물유해반응 의뢰
- 0000000768 약품식별의뢰
- 0000000769 임상약동학의뢰(TDM)
- 0000000770 정맥영양지원의뢰
- 0000000771 복약상담의뢰
- 0000000964 항응고약물상담(ACS)의뢰
- 0000003019 경장영양지원의뢰(EN)
- 1000009108 판독협진의뢰
- */
- messageBox(formnm + "는 상태값이 의뢰일 때만 취소", "I006");
- grd_cnstlist.valueMatrix(select_row , grd_cnstlist.colRef("checkflag"))="N";
- return;
- }
-
- if(cnstformcd == "0000003019" || cnstformcd == "0000000964" ||
- cnstformcd == "0000000769" || cnstformcd == "0000000770" || cnstformcd == "0000000771" ||
- cnstformcd == "0000000693" || cnstformcd == "0000000768" || cnstformcd == "1000009108"){
- if(loginuserdpcd != grdreqdpcd && loginuserid != grdrequserid &&
- loginuserid != grdatdoctid && loginuserid != grdinputuserid &&
- loginuserid != grdmedispclid && loginuserid!=pat_atdoctid &&
- loginuserid != pat_medispclid){
- messageBox("수정 권한이 없습니다", "I", "");
- return;
- }
- }
-
- if((loginuserdpcd == grdreqdpcd || loginuserid == grdrequserid || loginuserid == grdatdoctid ||
- loginuserid == grdinputuserid ||loginuserid==pat_atdoctid ||loginuserid==pat_medispclid)){
- //if((loginuserid==pat_atdoctid ||loginuserid==pat_medispclid) && cnstformcd=="0000000677"){
- if(loginuserid==pat_atdoctid ||loginuserid==pat_medispclid){
- orddridchk="Y";
- }
- if (formrecseq != ""){
- datastring += formrecseq + "▦" + cnstformcd + "▦" + orddridchk + "▩";
- }
- }
-
- /*
- for(var i = 1 ; i < grd_cnstlist.rows ; i++){
- if(grd_cnstlist.valueMatrix(i , grd_cnstlist.colRef("checkflag"))=="N"){
- continue;
- }
- var scnststat = grd_cnstlist.valueMatrix(i , grd_cnstlist.colRef("cnststat"));
- var formrecseq = model.getValue("/root/main/cnstlist[" + i + "]/formrecseq");
- var cnstformcd = grd_cnstlist.valueMatrix(i, grd_cnstlist.colRef("formcd"));
- var grdrequserid = grd_cnstlist.valueMatrix(i, grd_cnstlist.colRef("medispclid"));
- var grdatdoctid = grd_cnstlist.valueMatrix(i, grd_cnstlist.colRef("atdoctid"));
- var grdinputuserid = grd_cnstlist.valueMatrix(i, grd_cnstlist.colRef("inptuserid"));
- var grdreqdpcd = grd_cnstlist.valueMatrix(i, grd_cnstlist.colRef("reqdeptcd"));
-
- var grdrecvuserid = grd_cnstlist.valueMatrix(i, grd_cnstlist.colRef("recvuserid"));
- var grdrecvdpcd = grd_cnstlist.valueMatrix(i, grd_cnstlist.colRef("recvdeptcd"));
- var cnststatnm = grd_cnstlist.valueMatrix(i, grd_cnstlist.colRef("cnststatnm"));
-
- var loginuserid = getUserId();
- var loginuserdpcd = getUserInfo("dutplcecd");
- */
- /* if(scnststat == "11" || scnststat == "12" || scnststat == "20"){
- if(scnststat=="20" && (cnstformcd == "0000003019" || cnstformcd == "0000000964" ||
- cnstformcd == "0000000769" || cnstformcd == "0000000770" || cnstformcd == "0000000771" ||
- cnstformcd == "0000000693" || cnstformcd == "0000000768" || cnstformcd == "1000009108")){
- // 아래의 8가지 지원부서 의뢰일 경우는 상태값이 의뢰임시 또는 의뢰 상태에서는 삭제 될 수 있음
-
- 0000000693 약물유해반응 의뢰
- 0000000768 약품식별의뢰
- 0000000769 임상약동학의뢰(TDM)
- 0000000770 정맥영양지원의뢰
- 0000000771 복약상담의뢰
- 0000000964 항응고약물상담(ACS)의뢰
- 0000003019 경장영양지원의뢰(EN)
- 1000009108 판독협진의뢰
-
- grd_cnstlist.valueMatrix(i , grd_cnstlist.colRef("checkflag")) = "N";
- model.refresh();
- continue;
- }
-
- if((loginuserdpcd == grdreqdpcd || loginuserid == grdrequserid || loginuserid == grdatdoctid ||
- loginuserid == grdinputuserid ||loginuserid==pat_atdoctid ||loginuserid==pat_medispclid)){
- if((loginuserid==pat_atdoctid ||loginuserid==pat_medispclid) && cnstformcd=="0000000677"){
- orddridchk="Y";
- }
- if (formrecseq != ""){
- datastring += formrecseq + "▦" + cnstformcd + "▦" + orddridchk + "▩";
- }
- orddridchk="N";
- }
- else{
- grd_cnstlist.valueMatrix(i , grd_cnstlist.colRef("checkflag")) = "N";
- }
- }else{
- grd_cnstlist.valueMatrix(i , grd_cnstlist.colRef("checkflag")) = "N";
- }
- }*/
-
- if(datastring!=""){
- model.removenode("/root/send/savedata");
- model.makeValue("/root/send/savedata", savedata + datastring);
-
- if(submit("TXMMR05002"))
- {
- var mess = model.getValue("/root/main/savedinfo/rsltmsg/msg");
- if(mess == "1")
- {
- messageBox("취소 되었습니다.", "I", "");
- fGetCnstlist(srchmode);
-
- ivw_loader.src = "../../../emr/medirecweb/xrw/SSMMR01100_서식로더.xrw";
- ivw_loader.window.javascript.fInitPage(false, true, parseInt(ivw_loader.attribute("height")));
- }
- else
- {
- messageBox(mess, "I", "");
- for(var i=1; i<=grd_cnstlist.rows; i++){
- grd_cnstlist.valueMatrix(i , grd_cnstlist.colRef("checkflag"))="N";
- }
- model.refresh();
- }
- }
- }
- model.refresh();
- }
- function fCnststatChng(){
- var userid = getUserInfo("userid");
- if( model.getValue("/root/main/cnstlist[" + grd_cnstlist.row + "]/lastid") == userid && model.getValue("/root/main/cnstlist[" + grd_cnstlist.row + "]/cnststat") == "20" ){
- if( messageBox("【 의뢰확정 】 상태를 【 의뢰 】로 변경하시겠습니까?", "Q999") == 6 ){
- var formrecseq = model.getValue("/root/main/cnstlist[" + grd_cnstlist.row + "]/formrecseq");
- model.makeValue( "/root/send/reqitem/instcd" , getUserInfo("dutplceinstcd") );
- model.makeValue( "/root/send/reqitem/formrecseq" , formrecseq );
- if( submit("TXMMR05005") ){
- messageBox( "변경되었습니다.", "E999" );
- fGetCnstlist( model.getValue("/root/tmp/condflag") );
- }
- }else{
- return;
- }
- }else{
- messageBox( "의뢰확정자가 아닙니다.", "E999" );
- return;
- }
- }
- function fSendRecInfoToSMMMO00100(){
- if(getUserInfo("jobkindcd").substring(0,2) == "03"){
-
- if(isPopup()){
-
- if(getParameter("MMR05000_cnstflag") == "1"){
-
- if(model.getValue("/root/hidden/procpconfiag/answcnt") == "001"){
-
- var pamInfoNode = "/root/main/result/paminfo/list";
-
- var pid = model.getValue ( pamInfoNode + "/pid" );
- var cretno = model.getValue ( pamInfoNode + "/cretno" );
- var orddd = model.getValue ( pamInfoNode + "/orddd" );
-
- if(isNull(orddd)){
- orddd = model.getValue ( pamInfoNode + "/indd" );
- }
-
- var wd = getOpenWindow("SMMMO00100");
- if(wd != null){
-
- var rscdoctid = ivw_loader.ivw_base.model.getValue("/root/init/cond/rscdoctid");
- var rscdeptcd = ivw_loader.ivw_base.model.getValue("/root/init/cond/rscdeptcd");
-
- var rscdoctnm = ivw_loader.ivw_base.model.getValue("/root/init/recvrlist/usercombo[usernm != '일반의사' and usernm != '의무기록' and userid = '"+ rscdoctid +"']/usernm");
- var rscdeptnm = ivw_loader.ivw_base.model.getValue("/root/main/cnstformlist/cnstform[ cnstdeptcd = '"+ rscdeptcd +"']/cnstdeptnm");
-
- wd.javascript.fSetAutoPrcpInfo( pid, cretno, orddd, "Consult (수신과 : "+rscdeptnm+", 수신자 : "+rscdoctnm+")" );
- }
- }
- }
- }
- }
- }
|