123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499 |
- /**
- - ▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩
- - 외래차트대출신청 및 상태조회 ( SMMRC01500_외래차트대출신청 및 상태조회.xrw - JScript )
- - Version :
- 1) : Ver.1.00.01
-
- - ▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩
- **/
- /**
- * @ver : 2007/12/11
- * @desc : 폼초기화 및 공통코드 load,상단정보 있을시 검색
- * @
- * @by : 이창록
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function finitialize(){
-
- model.removeNodeset("/root/main/appchrt/outchrtlist");
- model.removeNodeset("/root/main/otherchrt/otherchrtlist");
- mmbfGetDeptCodeComboList("/root/send/reqdata", "/root/init/wardlist", "W"); //병동코드 콤보
- var pamInfoCvs = getGlobalVariable("paminfo");
- if(pamInfoCvs != null && pamInfoCvs != "")
- { //cvs가 null이 아닌 경우에만 처리함.
- model.removeNodeSet ("/root/main/result/paminfo/list");
- setCSVToNode ("/root/main/result/paminfo", pamInfoCvs);
- var pid = model.getValue("/root/main/result/paminfo/list/pid");
- var orddeptcd = model.getValue("/root/main/result/paminfo/list/orddeptcd");
- var wardcd = model.getValue("/root/main/result/paminfo/list/wardcd");
- var roomcd = model.getValue("/root/main/result/paminfo/list/roomcd");
- var indd = model.getValue("/root/main/result/paminfo/list/indd");
- //model.setValue("/root/outcond/chrtdept" ,orddeptcd);
- model.setValue("/root/outcond/ward" ,wardcd);
- model.setValue("/root/outcond/pid" ,pid);
- model.setValue("/root/outcond/ddlist" ,getCurrentDate());
- model.makeValue("/root/outcond/instcd" ,getUserInfo("dutplceinstcd"));
- //model.makeValue("/root/outcond/dschdd" ,getCurrentDate());
- model.setValue("/root/othercond/ward" ,wardcd);
- fSelectWard();
- fOutChartList();
- model.setValue("/root/othercond/room" ,roomcd);
- fRoomPatList();
- model.setValue("/root/othercond/pid" ,pid);
- model.makeValue("/root/othercond/indd" ,indd);
- model.makeValue("/root/othercond/instcd",getUserInfo("dutplceinstcd"));
- fOtherChrtList();
- }else if(pamInfoCvs==""){
- model.setValue("/root/outcond/ward" ,getUserInfo("dutplcecd"));
- model.makeValue("/root/outcond/ddlist" ,getCurrentDate());
- model.makeValue("/root/outcond/instcd" ,getUserInfo("dutplceinstcd"));
- fOutChartList();
- }
- grd_outchrtlist.colHidden(10)=true;
- }
- /**
- * @group :
- * @ver : 2007.12.11
- * @by : 이창록
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 외래차트대출 상태조회
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fOutChartList()
- {
- if(submit("TRMRC01501")==true){
- var trgCol = grd_outchrtlist.colRef("appdd");
- var rendflagCol = grd_outchrtlist.colRef("rendflag");
- for(var i =1; i < grd_outchrtlist.rows; i++ ) {
- if(model.getValue("/root/outcond/dschInddlist")=="dschdd"){
- if( grd_outchrtlist.valueMatrix(i, trgCol) != "" ){//그 인덱스 값이 없을 때
- grd_outchrtlist.isReadOnly(i, rendflagCol) = true;//edit못하게
- }
- }else if(model.getValue("/root/outcond/dschInddlist")=="indd"){
- if(grd_outchrtlist.valueMatrix(i,grd_outchrtlist.colRef("appdd"))=="신청중"){
- grd_outchrtlist.isReadOnly(i, rendflagCol) = true;
- grd_outchrtlist.refresh();
- }else if(grd_outchrtlist.valueMatrix(i,grd_outchrtlist.colRef("appdd"))!=""){
- grd_outchrtlist.isReadOnly(i, rendflagCol) = true;
- grd_outchrtlist.refresh();
- }else{
- grd_outchrtlist.isReadOnly(i, rendflagCol) = false;
- }
- }
- }
- }
- model.refresh();
- }
- /**
- * @group :
- * @ver : 2007.12.11
- * @by : 이창록
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 외래차트대출
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fRowRendflag(){
-
- if (grd_outchrtlist.isCell(event.target)
- && grd_outchrtlist.row >= grd_outchrtlist.fixedRows){
- var iRow = grd_outchrtlist.row - grd_outchrtlist.fixedRows + 1;
- var rRow = grd_otherchrtlist.row - grd_otherchrtlist.fixedRows + 1;
- var rendflag = model.getValue("/root/main/appchrt/outchrtlist[" + iRow + "]/rendflag");
- var chrtflag = model.getValue("/root/main/appchrt/outchrtlist[" + iRow + "]/chrtflag");
- var appdeptcd = model.getValue("/root/main/appchrt/outchrtlist[" + iRow + "]/appdeptcd");
- var appdd = model.getValue("/root/main/appchrt/outchrtlist[" + iRow + "]/appdd");
- var appmanid = model.getValue("/root/main/appchrt/outchrtlist[" + iRow + "]/appmanid");
- var lendmanid = model.getValue("/root/main/appchrt/outchrtlist[" + iRow + "]/lendmanid");
- var rtndd = model.getValue("/root/main/appchrt/outchrtlist[" + iRow + "]/rtndd");
- if(chrtflag != "P")
- {
- messageBox("이 환자는 해당 입원과 차트가 없으니 오른쪽의 타과 차트 대출에서 신청","I008");
- model.setValue("/root/main/appchrt/outchrtlist[" + iRow + "]/rendflag", "false");
- grd_outchrtlist.refresh();
- return;
- }
-
- if(rendflag=="true"){
- model.setValue("/root/main/appchrt/outchrtlist[" + iRow + "]/rendflag", "true");
- model.setValue("/root/main/appchrt/outchrtlist[" + iRow + "]/appdd",getCurrentDate());
- }else if(rendflag=="false"){
- model.setValue("/root/main/appchrt/outchrtlist[" + iRow + "]/appdd" , "");
- model.setValue("/root/main/appchrt/outchrtlist[" + iRow + "]/rendflag", "false");
- grd_outchrtlist.refresh();
- }
- }
- model.refresh();
- }
- /**
- * @group :
- * @ver : 2007.12.11
- * @by : 이창록
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 병동에 병실 조회
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fSelectWard()
- {
- model.makeValue("/root/send/reqdata/wardcd", model.getValue("/root/othercond/ward"));
- submit("TRMRC00051");
- cmb_room.refresh();
- cmb_pid.refresh();
- ipt_pid.value="";
- }
- /**
- * @group :
- * @ver : 2007.12.11
- * @by : 이창록
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 입원환자차트리스트 저장
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fReqLendChrt()
- {
- grd_outchrtlist.clearStatus();
- var iRow = grd_outchrtlist.row - grd_outchrtlist.fixedRows + 1;
- var bSave = false;
- for ( var i= 1; i< grd_outchrtlist.rows; i++)
- {
- var check = model.getValue("/root/main/appchrt/outchrtlist[" + i + "]/rendflag");
- if(check == "true")
- {
- grd_outchrtlist.rowStatus(i) = 1;
- bSave = true;
- }
- }
- if(bSave == true)
- {
- var iRow = grd_outchrtlist.row - grd_outchrtlist.fixedRows+ 1;
- var ward =model.getValue("/root/outcond/ward");
-
-
- if (ward=="2280200000"){
- //병동이 응급의료센터일때 대출용도를 강제로 006로 저장
- model.setValue("/root/main/appchrt/outchrtlist[" + iRow + "]/rendcd","006");
- }else
- model.setValue("/root/main/appchrt/outchrtlist[" + iRow + "]/rendcd","004");
- model.makeValue("/root/send/savedata", grd_outchrtlist.getUpdateData());
- if(submit("TXMRC01501")==true)
- {
- messageBox("선택하신 차트가","I001");
- }else{
- messageBox("선택하신 차트가","E009");
- }
- model.removeNodeset("/root/send/savedata");
- fOutChartList();
- model.refresh();
-
- }else{
- messageBox("대출신청할 종이차트를","C002");
- }
- }
- /**
- * @group :
- * @ver : 2007.12.11
- * @by : 이창록
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 병실에 환자 가져오기
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fRoomPatList()
- {
- model.makeValue("/root/send/reqdata/room/roomcd", model.getValue("/root/othercond/room"));
- submit("TRMRC01503");
- cmb_pid.refresh();
- ipt_pid.value="";
- }
- /**
- * @group :
- * @ver : 2007.12.11
- * @by : 이창록
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 기준일자에 따른 버튼 disabled 상태변경 및 TEXT명 변경
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fSelectRdoList()
- {
- var dschInddlist=model.getValue("/root/outcond/dschInddlist");
-
- if(dschInddlist=="indd")
- {
- cap_snm.text="입원기준일"
- btn_x_appchrt.disabled = "false";
- grd_outchrtlist.colHidden(10)=true;
- grd_outchrtlist.colHidden(7)=false;
- model.removeNodeset("/root/main/appchrt/outchrtlist");
- }else if(dschInddlist=="dschdd")
- {
- cap_snm.text="퇴원기준일"
- btn_x_appchrt.disabled = "true";
- ipt_srchfrdd.refresh();
- grd_outchrtlist.colHidden(10)=false;
- grd_outchrtlist.colHidden(7)=true;
- model.setValue("/root/outcond/ddlist",getCurrentDate());
- model.removeNodeset("/root/main/appchrt/outchrtlist");
- }
-
- model.refresh();
- }
- /**
- * @group :
- * @ver : 2007.12.11
- * @by : 이창록
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc :타과 차트리스트 조회
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fOtherChrtList()
- {
- var pid=model.getValue("/root/othercond/pid");
- var indd=model.getValue("/root/init/roompatlist[ pid = '" + pid + "']/indd");
- var iRow = grd_otherchrtlist.row - grd_otherchrtlist.fixedRows+ 1;
- var instcd = getUserInfo("dutplceinstcd");
- model.makeValue("/root/othercond/indd",indd);
- model.makeValue("/root/othercond/instcd",instcd);
- if(submit("TRMRC01502"))
- {
- for(var i =1; i < grd_otherchrtlist.rows; i++ ) {
- var trgCol = grd_otherchrtlist.colRef("appdd");
- var rendflagCol = grd_otherchrtlist.colRef("rendflag");
- var appmCol = cmb_ward.value;
- if(grd_otherchrtlist.valueMatrix(i, trgCol) =="신청중"){
- grd_otherchrtlist.isReadOnly(i, rendflagCol) = true;
- grd_otherchrtlist.refresh();
- }else{
- if(grd_otherchrtlist.valueMatrix(i, trgCol)!=""){
- grd_otherchrtlist.isReadOnly(i, rendflagCol) = true;
- grd_otherchrtlist.refresh();
- }else{
- grd_otherchrtlist.isReadOnly(i, rendflagCol) = false;
- }
- }
- }
- }
- model.refresh();
- // 2009.06.02. 의정부인 경우.. 응급실, 건진센터 구영상 조회하기..
- var instcd = getUserInfo("dutplceinstcd");
- if (instcd == "013") {
- submit("TRMRC00147");
- var msgER = "";
- var msgAH = "";
- var dataCnt = getNodesetCnt(model, "/root/main/oldimg/oldimglist");
- for (var i = 1 ; i <= dataCnt ; i++)
- {
- var cls = model.getValue("/root/main/oldimg/oldimglist["+ i +"]/cls");
- var cnt = model.getValue("/root/main/oldimg/oldimglist["+ i +"]/cnt");
- // 구영상 응급의학과
- if (cls == "E") {
- msgER = "▣ 구영상 응급의학과 (" + cnt + "건)";
- }
- // 구영상 건진
- if (cls == "S") {
- msgAH = "▣ 구영상 건진 (" + cnt + "건)";
- }
- }
- model.setValue("/root/hidden/cap_oldimgER", msgER);
- cap_oldimgER.refresh();
- model.setValue("/root/hidden/cap_oldimgAH", msgAH);
- cap_oldimgAH.refresh();
- }
- }
- /**
- * @group :
- * @ver : 2007.12.11
- * @by : 이창록
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc :타과 차트신청
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fReqotherLendChrt()
- {
- grd_otherchrtlist.clearStatus();
- var iRow = grd_otherchrtlist.row - grd_otherchrtlist.fixedRows + 1;
- var cSave = false;
-
- for ( var i= 1; i< grd_otherchrtlist.rows; i++)
- {
- var check = model.getValue("/root/main/otherchrt/otherchrtlist[" + i + "]/rendflag");
- var stat = model.getValue("/root/main/otherchrt/otherchrtlist[" + i + "]/stat");
- if(check == "true")
- {
- if(stat==""){
- grd_otherchrtlist.rowStatus(i) = 1;
- }else if(stat=="u"){
- grd_otherchrtlist.rowStatus(i) = 2;
- }
- cSave = true;
- }
- }
-
- if(cSave == true)
- {
- var iRow = grd_otherchrtlist.row - grd_otherchrtlist.fixedRows+ 1;
- var xOtherChrtListPath="/root/main/otherchrt/otherchrtlist";
- var ward =model.getValue("/root/othercond/ward");
- if (ward=="2280200000"){
- model.setValue("/root/main/otherchrt/otherchrtlist[" + iRow + "]/rendcd","006");
- }else{
- model.setValue("/root/main/otherchrt/otherchrtlist[" + iRow + "]/rendcd","004");
- }
- model.makeValue("/root/send/savedata", grd_otherchrtlist.getUpdateData());
- if(submit("TXMRC01502"))
- {
- messageBox("선택한 차트가","I001");
- model.removeNodeset("/root/send/savedata");
- fOtherChrtList();
-
- }
- }else{
- messageBox("대출신청할 차트가","I004");
- }
- model.refresh();
- }
- /**
- * @group :
- * @ver : 2007.12.11
- * @by : 이창록
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc :타과 차트 신청시 신청된 차트는 확인
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fOtherRowRendflag()
- {
- if (grd_otherchrtlist.isCell(event.target)
- && grd_otherchrtlist.row >= grd_otherchrtlist.fixedRows){
- var iRow = grd_otherchrtlist.row - grd_otherchrtlist.fixedRows + 1;
- var outRow = grd_outchrtlist.row - grd_outchrtlist.fixedRows + 1;
- var Rendflag = model.getValue("/root/main/otherchrt/otherchrtlist[" + iRow + "]/rendflag");
- var Chrtflag = model.getValue("/root/main/otherchrt/otherchrtlist[" + iRow + "]/chrtflag");
- var ward = model.getValue("/root/main/otherchrt/otherchrtlist[" + iRow + "]/ward");
- var Otherdeptcd = model.getValue("/root/main/otherchrt/otherchrtlist[" + outRow + "]/appdeptcd");
- var Outdeptcd = model.getValue("/root/main/appchrt/outchrtlist[" + outRow + "]/appdeptcd");
- if(Chrtflag != "P")
- {
- messageBox("종이차트만 대출신청","I006");
- model.setValue("/root/main/otherchrt/otherchrtlist[" + iRow + "]/rendflag", "false");
- grd_otherchrtlist.refresh();
- return;
- }
- if(Rendflag=="true"){
- if(grd_otherchrtlist.valueMatrix(iRow,grd_otherchrtlist.colRef("appdd"))=="신청중"){
- var Msgchrt=messageBox("이 차트는 이미 신청된차트입니다. 그래도 ","Q004");
- if(Msgchrt=="7")
- {
- model.setValue("/root/main/otherchrt/otherchrtlist[" + iRow + "]/rendflag", "false");
- model.makeValue("/root/main/otherchrt/otherchrtlist[" + iRow + "]/appdd" , "신청중");
- grd_otherchrtlist.refresh();
- return;
- }else if(Msgchrt=="6")
- {
- model.setValue("/root/main/otherchrt/otherchrtlist[" + iRow + "]/rendflag" ,"true");
- model.setValue("/root/main/otherchrt/otherchrtlist[" + iRow + "]/appdd" ,getCurrentDate());
- model.makeValue("/root/main/otherchrt/otherchrtlist[" + iRow + "]/appmanid" ,getUserId());
- model.makeValue("/root/main/otherchrt/otherchrtlist[" + iRow + "]/appmanm" ,getUserInfo("usernm"));
- model.makeValue("/root/main/otherchrt/otherchrtlist[" + iRow + "]/appdeptcd",getUserInfo("dutplcecd"));
- model.makeValue("/root/main/otherchrt/otherchrtlist[" + iRow + "]/appdeptnm",getUserInfo("dutplcenm"));
- //model.makeValue("/root/main/otherchrt/otherchrtlist[" + iRow + "]/stat" ,"u");
- grd_otherchrtlist.refresh();
- }
- }else{
- model.setValue("/root/main/otherchrt/otherchrtlist[" + iRow + "]/rendflag", "true");
- model.setValue("/root/main/otherchrt/otherchrtlist[" + iRow + "]/appdd",getCurrentDate());
- }
- }else if(Rendflag=="false"){
- model.setValue("/root/main/otherchrt/otherchrtlist[" + iRow + "]/appdd" , "");
- model.setValue("/root/main/otherchrt/otherchrtlist[" + iRow + "]/appmanid" , "");
- model.setValue("/root/main/otherchrt/otherchrtlist[" + iRow + "]/appmanm" , "");
- model.setValue("/root/main/otherchrt/otherchrtlist[" + iRow + "]/appdeptcd", "");
- model.setValue("/root/main/otherchrt/otherchrtlist[" + iRow + "]/appdeptnm", "");
- }
- }
- model.refresh();
- }
-
- /**
- * @ver :
- * @desc : 입원/퇴원환자 차트 리스트 조회한 것을 엑셀에 저장
- * @
- * @by : 이창록
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fChrtListSaveExcel(){
- var fileName = window.fileDialog("save", ",", false, "입퇴원환자차트리스트", "xls", "Excel Files(*.xls)|*.xls|All Files (*.*)|*.*");
- if (fileName != "")
- {
- grd_outchrtlist.saveExcel(fileName, "SheetName", false, false, "", "", "false");
- }
- }
- /**
- * @ver :
- * @desc : 입/퇴원환자차트 리스트 더블클릭시 환자별 차트리스트 조회
- * @
- * @by : 이창록
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fPatChrtInfo(iRow){
- model.setValue("/root/othercond/ward" ,model.getValue("/root/main/appchrt/outchrtlist["+iRow+"]/ward"));
- model.setValue("/root/othercond/instcd" ,model.getValue("/root/main/appchrt/outchrtlist["+iRow+"]/instcd"));
- fSelectWard();
- model.setValue("/root/othercond/room" ,model.getValue("/root/main/appchrt/outchrtlist["+iRow+"]/roomcd"));
- model.setValue("/root/othercond/indd" ,model.getValue("/root/main/appchrt/outchrtlist["+iRow+"]/indd"));
- fRoomPatList();
- model.setValue("/root/othercond/pid" ,model.getValue("/root/main/appchrt/outchrtlist["+iRow+"]/pid"));
- fOtherChrtList();
- }
|