123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020 |
- //===================================================================
- // 공통으로 사용하는 함수
- //===================================================================
- /**
- * @desc : 환자 수술여부 및 수술처방 확인
- * @ 수정 : 미니진료대상자에 맞게끔 내용 수정
- * @
- * @param :
- * @return :
- * @author : 오지훈
- * @---------------------------------------------------
- */
- function fChkMiniPatOpPrcp(pid, stnddd){
- model.removeNodeset("/root/send/reqdata");
- model.makeValue("/root/send/reqdata/pid" , pid);
- model.makeValue("/root/send/reqdata/stnddd", stnddd);
- if(submit("TRMMO04109")){
- var opprcpflag = model.getValue("/root/main/opprcpinfo/opprcpinfo/opprcpflag");
- if(opprcpflag == "N"){
- return false;
- }
- }
- return true;
- }
- /**
- * @desc : 처방화면, CP화면에 modal로 뜬 화면이 있는지 여부를 검사한다.
- * @ 수정 : 미니진료대상자에 맞게끔 내용 수정
- * @
- * @param :
- * @return :
- * @author : 오지훈
- * @---------------------------------------------------
- */
- function fChkScrnModal(){
- var cpflag = model.getValue(root.cpflag); //cpflag여부
- if(cpflag == "N"){
- var wndobj = getOpenWindow("SMMMO00100");
-
- }else if(cpflag == "Y"){
- var wndobj = getOpenWindow("SMMMP00800");
- }
- if(wndobj != null){
- var status = wndobj.javascript.getScreenDisabled();
- if(status == true){
- return false;
- }
- }
- }
- /**
- * @desc : 처방Main 화면 Open, CP환자인 경우 CP Main 화면 Open 또는 CP검색화면 Open (CP업무 추가 2007.09.27)
- * @
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fOpenPrcpMainWnd(){
- var cpflag = model.getValue("/root/cpflag");
-
- var mainObj = getMainViewer();
- var monitorNumber = app.monitorNumber;
- var monitorResolutions = app.monitorResolution;
- var monitorResolutionsArr = monitorResolutions.split('|');
-
- var resolution = monitorResolutionsArr[monitorNumber-1];
- var resolution_width = resolution.split(',')[0];
- var resolution_height = resolution.split(',')[1];
-
- //alert(monitorNumber);
- curEmrRecObj = getOpenWindow("SMMRI00400"); //활성화된 진료기록 화면 object loading
- curExamRsltObj = getOpenWindow("SMAER00800"); //활성화된 검사결과 화면 object loading
-
- if(curEmrRecObj != null){curEmrRecObj.javascript.fClose();} //진료기록 화면 close
- if(curExamRsltObj != null){curExamRsltObj.javascript.fClose();} //검사결과 화면 close
-
- curCpObj = mainObj.javascript.getOpenWindow("SMMMP00800"); //활성화된 CP Main 화면 object loading
- curPrcpObj = mainObj.javascript.getOpenWindow("SMMMO00100"); //활성화된 처방Main 화면 object loading
- curCpSrchObj = mainObj.javascript.getOpenWindow("SPMMP01200"); //활성화된 CP 검색 화면 object loading
-
- if(cpflag == "N"){ //처방 Main Open
- if(curCpObj != null){curCpObj.javascript.fCloseGPS();} //활성화된 CP Main화면이 있는 경우 close
- if(curCpSrchObj != null){curCpSrchObj.javascript.fCpSrchWndClose();} //활성화된 CP검색화면이 있는 경우 close
-
- if(curPrcpObj == null){ //활성화된 처방화면이 없는 경우, 신규화면을 오픈
- var xpt = (resolution_width - 1210)/2;
- var ypt = (resolution_height- 784)/2;
- mainObj.javascript.setParameter("SMMMO00100_ordrecflag", model.getValue("/root/main/cond/ordrecflag"));
- mainObj.javascript.open("SMMMO00100", monitorNumber, xpt, ypt, "SMMMO00100", "", "", "", false);
- fChngMainEMRScrn();
-
- }else{
- if(curPrcpObj.javascript.fPrcpSavePatList()){}
- curPrcpObj.model.setValue("/root/init/bfprcpload" , "N"); //전처방을 초기화한다.
-
- //curPrcpObj.javascript.fInitializeConDone();
- //curPrcpObj.javascript.fInitializeReady();
- curPrcpObj.javascript.fXReReady();
-
- curPrcpObj.model.setValue("/root/init/fstopenflag", "Y"); //처방최초 open여부를 재설정, 진료기록을 열기위해
- //curPrcpObj.javascript.fChngMainScrn();
- fChngMainEMRScrn();
- }
-
- }
- else if(cpflag =="Y"){ //CP Main Open
- if(curPrcpObj != null){curPrcpObj.javascript.fPrcpWndClose();} //활성화된 처방Main화면이 있는 경우 close
- if(curCpSrchObj != null){curCpSrchObj.javascript.fCpSrchWndClose();} //활성화된 CP검색화면이 있는 경우 close
-
- if(curCpObj == null){ //활성화된 CP화면이 없는 경우, 신규화면을 오픈
- var xpt = (resolution_width - 1236)/2;
- var ypt = (resolution_height- 985)/2;
- mainObj.javascript.setParameter("SMMMO00100_ordrecflag", model.getValue("/root/main/cond/ordrecflag"));
- mainObj.javascript.open("SMMMP00800", monitorNumber, xpt, ypt, "SMMMP00800", "", "", "sysmenu:hidden; min:visible; max:visible; icon:visible", false);
-
- //JJE- 삭제
- //fChngMainEMRScrn();
-
- }
-
- else{
- curCpObj.javascript.fReconstruct();
- }
-
-
- }else if(cpflag =="X"){ //CP 검색 Open
- if(curCpObj != null){curCpObj.javascript.fCloseGPS();} //활성화된 CP Main화면이 있는 경우 close
- if(curPrcpObj != null){curPrcpObj.javascript.fPrcpWndClose();} //활성화된 처방Main화면이 있는 경우 close
-
- if(curCpSrchObj == null){
- mainObj.javascript.open("SPMMP01200", monitorNumber, xpt, ypt, "SPMMP01200", "", "", "", false);
- }
- }
- }
- function fChngMainEMRScrn() {
- var mainobj = getMainViewer();
- var mainscrnid = mainobj.javascript.getScreenID(); //메인화면의 기록지 ID
- var cpflag = model.getValue("/root/cpflag");
-
- if (cpflag =="Y"){
- var curPrcpObj= getOpenWindow("SMMMP00800");
- } else {
- var curPrcpObj= getOpenWindow("SMMMO00100");
- }
- var fstopenflag = curPrcpObj.model.getValue("/root/init/fstopenflag"); //처방화면이 최초 생성 여부
- var bfprcpload = curPrcpObj.model.getValue("/root/init/bfprcpload"); //전처방화면 최초 생성 여부
- var cpflag = curPrcpObj.model.getValue("/root/cp"); //CP화면여부
-
- var ordrecflag = model.getValue("/root/main/cond/ordrecflag"); //OCS 체크여부
- var chngflag = model.getValue("/root/main/cond/chngflag"); //OCS 체크여부
-
- if(mainobj != null){
- var dutplcecd = getUserInfo("dutplcecd"); //사용자부서
- var operation = getGlobalVariable("operation"); //수술정보
-
- var wndid = "SMMMR00100"; //진료기록화면이 default
-
- if(fstopenflag !="N" || chngflag == "Y"){ //처방화면이 최초로 열린 경우, 진료대상자의 ocs체크값이 변경된 경우에는 메인화면 변경
-
- if(bfprcpload != "Y"){ //전처방화면이 로딩된 여부,(단순히 tab변경인 경우에는 메인화면 변경 로직을 처리하지 않음
-
- /*
- if(cpflag == "Y"){ //CP화면인 경우, CP초기화 후, 메인화면 변경 수행
- var cpendflag = curPrcpObj.javascript.fReconstruct();
- if(cpendflag == "True"){
- }
- }
- */
-
- //if(cpendflag == "True"){ //CPMain의 fReconstruct()가 완료된 이후 진료기록 변경로직을 수행
-
- if(dutplcecd == "2090000000" || dutplcecd == "2090300000"){ //사용자부서가 마취통증의학과, 통증클리닉인 경우
-
- if(operation.length > 0){ //수술환자리스트에서 환자 선택된 경우, 메인화면은 '마취환자기록' loading
- wndid = "SMMMR03700";
-
- }else{
- if(ordrecflag == "Y"){
- wndid = "SMMMR00100";
- }
- }
-
- }else{
- if(ordrecflag == "Y"){
- wndid = "SMMMR00100";
-
- }
- }
-
- curPrcpObj.model.setValue("/root/init/bfprcpload" , "Y");
- curPrcpObj.model.setValue("/root/init/fstopenflag", "N");
-
- if(mainscrnid == wndid){
- if(wndid == "SMMMR03700"){
- mainobj.javascript.fFormInit();
-
- }else{
- mainobj.javascript.fInitRecPamInfo();
-
- }
- }else{
- //if(cpflag != "Y"){
- mainobj.javascript.navigate(wndid);
- //}
- }
-
- //}
-
- }else{ //전처방화면이 최초 생성된 경우, bfprcpload를 Y로 변경, 추후 tab변경시 메인화면 변경이 되지 않게함
- curPrcpObj.model.setValue("/root/init/bfprcpload", "Y");
- }
- }
- }
- }
- //===================================================================
- // 입원에서 사용하는 함수들
- //===================================================================
- /**
- * @desc : 환자 선택 후, 환자 정보 조회 및 기록지 화면 연동
- * @ 수정 : 미니진료대상자에 맞게끔 내용 수정
- * @
- * @param :
- * @return :
- * @author : 김영학
- * @---------------------------------------------------
- */
- function fMiniInPat(){
- var ordrecflag = model.getValue(root.main.cond.ordrecflag);
- var currow = grd_inpatlist.row;
- if(currow < 1){
- return;
- }
-
- //처방, CP화면에 modal 또는 modaless가 뜬 경우, 환자 선택 불가
- if(fChkScrnModal()==false){
- return;
- }
-
- var pid = model.getValue("/root/main/inpatinfo/inpatlist[" + currow + "]/pid");
- var hngnm = model.getValue("/root/main/inpatinfo/inpatlist[" + currow + "]/hngnm");
- var reqptype = model.getValue("/root/main/inpatinfo/inpatlist[" + currow + "]/reqptype");
- var stnddd = model.getValue("/root/main/cond/fromdd");
- setParameter("SPMMO04200_openflag", "SPMMO04200");
-
- //환자수술 여부 및 수술처방 확인, 수술처방이 없는 경우 처방화면을 blocking
- if(fChkMiniPatOpPrcp(pid, stnddd)==false){
- var opcnfmdd = model.getValue("/root/main/opprcpinfo/opprcpinfo/opcnfmdd");
- opcnfmdd = opcnfmdd.substring(0, 4) + "-" + opcnfmdd.substring(4, 6) + "-" + opcnfmdd.substring(6, 8);
- messageBox("[" + hngnm + "]환자의 [" + opcnfmdd + "]일자 수술 처방을", "C001");
- }
- //CP환자 여부 확인
- if(fChkCPMiniPatValid(currow)==false){
- return;
- }
- //상단정보 설정 및 진료기록 처방화면 연동
- var mainObj = getMainViewer();
- /*
- if(fReqInPatPamInfo()==true){
- opener.javascript.setParameter("SMMMO04100_reqptype", reqptype);
- var cpflag = opener.model.getValue("/root/cpflag");
- var ordrecflag = opener.model.getValue("/root/main/cond/ordrecflag");
- var mainObj = getMainViewer();
- if(cpflag == "Y"){
- mainObj.window.javascript.openEmrScrn("SMMMP00800"); //CP처방 화면
-
- }else if(cpflag == "X"){
- mainObj.window.javascript.openEmrScrn("SPMMP01200"); //CP검색 화면
-
- }else{
- opener.javascript.setParameter("SMMMO04100_reqptype", reqptype);
- opener.javascript.fOpenPrcpMainWnd();
- }
-
- if(cpflag == "Y" || cpflag == "X"){
- if(ordrecflag == "Y"){
- mainObj.window.javascript.openEmrScrn("SMMMB08100"); //empty
-
- }else{
- mainObj.window.javascript.openEmrScrn("SMMMR00100"); //진료기록
-
- }
- }
- }
- */
- //상단정보 설정
- if(fReqMiniInPatPamInfo()==true){
- setParameter("SMMMO04100_reqptype", reqptype);
- fOpenPrcpMainWnd();
- }
- }
- /**
- * @desc : 입원환자 환자 기본정보설정
- * @ 수정 : 미니진료대상자에 맞게끔 내용 수정
- * @
- * @param :
- * @return :
- * @author : 오지훈
- * @---------------------------------------------------
- */
- function fReqMiniInPatPamInfo(){
- var iRow = grd_inpatlist.row;
- var pid = model.getValue("/root/main/inpatinfo/inpatlist[" + iRow + "]/pid");
- var indd = model.getValue("/root/main/inpatinfo/inpatlist[" + iRow + "]/indd");
- var cretno = model.getValue("/root/main/inpatinfo/inpatlist[" + iRow + "]/cretno");
- var instcd = model.getValue("/root/main/inpatinfo/inpatlist[" + iRow + "]/instcd");
- var srchdd = model.getValue("/root/main/cond/indd"); //조회일자
- var param;
-
- param = "I" + "▦" + pid + "▦" + indd + "▦" + cretno + "▦" + instcd + "▦" + srchdd;
-
- setParameter("condparam", param);
- modal("SPMMO08900", 1, "", "", "", "", "", "left:0; right:0; width:0; height:0; sysmenu:hidden; caption:hidden; min:hidden, max:hidden;");
-
- var useyn = getParameter("SPMMO08900_rtn_useyn");
- if(useyn == "Y"){
- setParameter("SPMMO08900_rtn_useyn", "");
- return true;
- }else{
- return false;
- }
- }
- /**
- * @desc : CP환자 여부 검사
- * @
- * @param :
- * @return :
- * @author : 오지훈
- * @---------------------------------------------------
- */
- function fChkCPMiniPatValid(currow){
- var pid = model.getValue("/root/main/inpatinfo/inpatlist[" + currow + "]/pid");
- var orddd = model.getValue("/root/main/inpatinfo/inpatlist[" + currow + "]/indd");
- var cretno = model.getValue("/root/main/inpatinfo/inpatlist[" + currow + "]/cretno");
- var cpyn = model.getValue("/root/main/inpatinfo/inpatlist[" + currow + "]/cpyn");
- var hngnm = model.getValue("/root/main/inpatinfo/inpatlist[" + currow + "]/hngnm");
- //입원환자이나 외래CP가 진행중인 경우, 경고 메시지를 띄운다. (박유미요청)
- //2008. 07. 25 오지훈
- model.removeNodeset("/root/send/reqdata");
- model.makeValue("/root/send/reqdata/pid" , pid);
- model.makeValue("/root/send/reqdata/orddd", orddd);
- if(submit("TRMMO04303")==true){
- var outcppatnode = model.instance1.selectNodes("/root/init/getdata/getdata");
- if(outcppatnode.length > 0){
- messageBox("외래 cp적용중인 환자입니다. 외래 CP Drop을", "C003");
- model.setValue(opener.root.cpflag, "N");
- return false;
- }
- }
- model.removeNodeset("/root/send/reqdata");
- model.makeValue("/root/send/reqdata/pid" , pid);
- model.makeValue("/root/send/reqdata/orddd" , orddd);
- model.makeValue("/root/send/reqdata/cretno" , cretno);
- model.makeValue("/root/send/reqdata/prcpgenrflag", "I");
- if(submit("TRMMO04303")==true){
- var cppatnode = model.instance1.selectNodes("/root/init/rsltgetdata/getdata");
- if(cppatnode.length < 1){ //cp적용환자 tbl에 유효한 데이터가 없는 경우
- model.setValue(root.cpflag, "N");
- return true;
-
- }else{ //CP적용환자 tbl에 유효한 데이터가 있는 경우
- var appstat = model.getValue("/root/init/rsltgetdata/getdata/appstat");
- var cpgnm = model.getValue("/root/init/rsltgetdata/getdata/cpgnm");
-
- if(appstat == 12){ //CP적용상태가 12인 경우, 무조건 CP(M-GPS)창을 띄운다
- model.setValue(root.cpflag, "Y");
- return true;
-
- }else if(appstat == 52){
- var rtnval = messageBox("[" + hngnm + "]환자에게 CP를", "Q003");
- if(rtnval == 6){ //예, CP Main open, CP적용환자 tbl에 appstat 10 진행중
- model.setValue(root.cpflag, "X");
- return true;
- }else{
- model.setValue(root.cpflag, "N");
- return fUpdtCPPatAppStatVal(41); //41 : CP취소
- }
-
- }else{ //CP적용상태가 12가 아닌 경우, CP Main창 open
- model.setValue(root.cpflag, "Y");
- return true;
-
- }
- }
- }
- }
- //===================================================================
- // 외래에서 사용하는 함수들
- //===================================================================
- /**
- * @desc : 환자 선택 후, 환자 정보 조회 및 기록지 화면 연동
- * @
- * @param :
- * @return :
- * @author : 오지훈
- * @---------------------------------------------------
- */
- function fMiniOutPat(){
- var ordrecflag = model.getValue(root.main.cond.ordrecflag);
- var currow = grd_outpatlist.row;
- if(currow < 1){
- return;
- }
-
- //처방, CP화면에 modal 또는 modaless가 뜬 경우, 환자 선택 불가
- if(fChkScrnModal()==false){
- return;
- }
-
- var pid = model.getValue("/root/main/outpatinfo/outpatlist[" + currow + "]/pid");
- var stnddd = model.getValue("/root/main/outpatinfo/outpatlist[" + currow + "]/orddd");
- var hngnm = model.getValue("/root/main/outpatinfo/outpatlist[" + currow + "]/hngnm");
- var reqptype = model.getValue("/root/main/outpatinfo/outpatlist[" + currow + "]/reqptype");
- setParameter("SPMMO04200_openflag", "SPMMO04200");
-
- //환자수술 여부 및 수술처방 확인, 수술처방이 없는 경우 처방화면을 blocking
- if(fChkPatOpPrcp(pid, stnddd)==false){
- var opcnfmdd = model.getValue("/root/main/opprcpinfo/opprcpinfo/opcnfmdd");
- opcnfmdd = opcnfmdd.substring(0, 4) + "-" + opcnfmdd.substring(5, 6) + "-" + opcnfmdd.substring(7, 8);
- messageBox("[" + hngnm + "]환자의 [" + opcnfmdd + "]일자 수술 처방을", "C001");
- }
-
- //CP환자 여부 확인, update시 에러나면 변경 불가
- if(fChkCPMiniOutPatValid(currow)==false){
- return;
- }
- //상단정보 설정 및 진료기록, 처방화면 연동
- var mainObj = getMainViewer();
- /*
- if(fReqMiniOutPatPamInfo()==true){
- opener.javascript.setParameter("SMMMO04100_reqptype", reqptype);
- var cpflag = opener.model.getValue("/root/cpflag");
- var ordrecflag = opener.model.getValue("/root/main/cond/ordrecflag");
- var mainObj = getMainViewer();
- if(cpflag == "Y"){
- mainObj.window.javascript.openEmrScrn("SMMMP00800"); //CP화면 open
-
- }else if(cpflag == "X"){
- mainObj.window.javascript.openEmrScrn("SPMMP01200"); //CP검색화면 open
-
- }else{
- opener.javascript.setParameter("SMMMO04100_reqptype", reqptype);
- opener.javascript.fOpenPrcpMainWnd();
- }
- if(cpflag == "Y" || cpflag == "X"){
- if(ordrecflag == "Y"){
- mainObj.window.javascript.openEmrScrn("SMMMB08100"); //empty
-
- }else{
- mainObj.window.javascript.openEmrScrn("SMMMR00100"); //진료기록
-
- }
- }
- }
- */
- //상단정보 설정
- if(fReqMiniOutPatPamInfo()==true){
- setParameter("SMMMO04100_reqptype", reqptype);
- fOpenPrcpMainWnd();
- }
-
- }
- /**
- * @desc : CP환자 여부 검사
- * @
- * @param :
- * @return :
- * @author : 오지훈
- * @---------------------------------------------------
- */
- function fChkCPMiniOutPatValid(currow){
- var pid = model.getValue("/root/main/outpatinfo/outpatlist[" + currow + "]/pid");
- var orddd = model.getValue("/root/main/outpatinfo/outpatlist[" + currow + "]/orddd");
- var cretno = model.getValue("/root/main/outpatinfo/outpatlist[" + currow + "]/cretno");
- var cpyn = model.getValue("/root/main/outpatinfo/outpatlist[" + currow + "]/cpyn");
- var hngnm = model.getValue("/root/main/outpatinfo/outpatlist[" + currow + "]/hngnm");
-
- model.removeNodeset("/root/send/reqdata");
- model.makeValue("/root/send/reqdata/pid" , pid);
- model.makeValue("/root/send/reqdata/orddd" , orddd);
- model.makeValue("/root/send/reqdata/cretno" , cretno);
- model.makeValue("/root/send/reqdata/prcpgenrflag", "O");
- if(submit("TRMMO04303")==true){
- var cppatnode = model.instance1.selectNodes("/root/init/rsltgetdata/getdata");
- if(cppatnode.length < 1){ //cp적용환자 tbl에 유효한 데이터가 없는 경우
- model.setValue(root.cpflag, "N"); //처방open
- return true;
-
- }else{ //CP적용환자 tbl에 유효한 데이터가 있는 경우
- var appstat = model.getValue("/root/init/rsltgetdata/getdata/appstat");
- var cpgnm = model.getValue("/root/init/rsltgetdata/getdata/cpgnm");
-
- if(appstat == 11){ //CP적용상태가 11인 경우
- var rtnval = messageBox("[" + hngnm + "]환자의 [" + cpgnm + "] CP를", "Q003");
- if(rtnval == 6){ //예 선택, CP Main open, CP적용환자 tbl에 appstat 10 진행중
- model.setValue(root.cpflag, "N");
- return fUpdtCPPatAppStatVal(51);
-
- }else{ //아니오 선택, 처방 Main open, CP적용환자 tbl에 appstat 51 drop out
- model.setValue(root.cpflag, "Y");
- return fUpdtCPPatAppStatVal(10);
- }
- }else if(appstat == 53){
- model.setValue(root.cpflag, "X");
- return true;
-
- }else{ //CP적용상태가 11가 아닌 경우, CP Main창 open
- model.setValue(root.cpflag, "Y");
- return true;
- }
- }
- }
- }
- /**
- * @desc : 외래환자 환자 기본정보설정
- * @ 수정 : 미니진료대상자에 맞게끔 내용 수정
- * @
- * @param :
- * @return :
- * @author : 오지훈
- * @---------------------------------------------------
- */
- function fReqMiniOutPatPamInfo(){
- var iRow = grd_outpatlist.row;
- var pid = model.getValue("/root/main/outpatinfo/outpatlist[" + iRow + "]/pid");
- var orddd = model.getValue("/root/main/outpatinfo/outpatlist[" + iRow + "]/orddd");
- var cretno = model.getValue("/root/main/outpatinfo/outpatlist[" + iRow + "]/cretno");
- var instcd = model.getValue("/root/main/outpatinfo/outpatlist[" + iRow + "]/instcd");
-
- var param = "O" + "▦" + pid + "▦" + orddd + "▦" + cretno + "▦" + instcd;
- setParameter("condparam", param);
- modal("SPMMO08900", 1, 0, 0, "", "", "", "left:0; right:0; width:0; height:0; sysmenu:hidden; caption:hidden; min:hidden, max:hidden;");
- var useyn = getParameter("SPMMO08900_rtn_useyn");
- if(useyn == "Y"){
- setParameter("SPMMO08900_rtn_useyn", "");
- return true;
- }else{
- return false;
- }
- }
-
-
- /*===============================================================================
- @desc : 검색구분에 대한 항목 선택시 각 화면 선택
- ===============================================================================*/
- function fGrdInit() {
- var searflag = model.getValue("/root/main/cond/searflag");
-
- if (searflag =='O'){
- model.setValue("/root/main/cond/fromdd" , getCurrentDate());
- rdo_patflag.visible = true;
- rdo_patflagstat.visible = false;
- ipt_todd.visible = false;
- cmb_concslip.visible = false;
- caption4.visible = true;
- chk_myPat.visible = false;
- caption5.visible = false;
- rdo_opstatcd.visible = false;
- caption1.text = "조회기간 :";
- rdo_clsflag.visible = true;
- caption2.text= "분류구분 :";
- cmb_orddept.visible = false;
- bool1.visible = false;
- caption6.visible = false;
- model.toggle("case1");
- } else if (searflag =='I') {
- model.setValue("/root/main/cond/fromdd" , getCurrentDate());
- rdo_patflag.visible = false;
- rdo_patflagstat.visible = true;
- ipt_todd.visible = false;
- cmb_concslip.visible = false;
- caption4.visible = true;
- chk_myPat.visible = true;
- caption5.visible = true;
- chk_myPat.value = 'Y'
- rdo_opstatcd.visible = false;
- caption1.text = "조회기간 :";
- rdo_clsflag.visible = true;
- caption2.text= "분류구분 :";
- cmb_orddept.visible = false;
- bool1.visible = false;
- caption6.visible = false;
- model.toggle("case2");
- } else if (searflag =='P'){
- fInitialize();
- var cur_day = getCurrentDate();
- var idate = new Date();
- var peveDate = idate.getAddDate(-2, "D");
- model.setValue("/root/main/cond/fromdd", peveDate.getDateFormat());
- model.setValue("/root/main/cond/todd" , cur_day );
-
- rdo_patflag.visible = false;
- rdo_patflagstat.visible = false;
- ipt_todd.visible = true;
- cmb_concslip.visible = true;
- caption4.visible = false;
- chk_myPat.visible = false;
- caption5.visible = false;
- rdo_opstatcd.visible = false;
- caption1.text = "조회기간 :";
- rdo_clsflag.visible = true;
- caption2.text= "분류구분 :";
- cmb_orddept.visible = false;
- bool1.visible = false;
- caption6.visible = false;
- model.toggle("case3");
- } else if (searflag =='A'){
- fInitialize();
- var cur_day = getCurrentDate();
- var idate = new Date();
- var peveDate = idate.getAddDate(-2, "D");
- model.setValue("/root/main/cond/fromdd", cur_day);
- model.setValue("/root/main/cond/todd" , cur_day );
-
- rdo_patflag.visible = false;
- rdo_patflagstat.visible = false;
- ipt_todd.visible = false;
- cmb_concslip.visible = false;
- caption4.visible = true;
- chk_myPat.visible = false;
- caption5.visible = false;
- rdo_opstatcd.visible = true;
- caption1.text = "수술일자 :";
- rdo_clsflag.visible = false;
- caption2.text= "집도과 :";
- cmb_orddept.visible = true;
- bool1.visible = true;
- caption6.visible = true;
- model.toggle("case4");
- }
-
- model.refresh();
- }
- /*===============================================================================
- @desc : 입원시 조회
- ===============================================================================*/
- function fInPatList() {
- model.removeNodeset("/root/main/inpatinfo/inpatlist");
- model.removeNodeset("/root/main/outpatinfo/outpatlist");
- model.removeNodeset("/root/main/info/concslippatlist");
- model.removeNodeset("/root/main/oppatinfo/oppatlist");
-
- model.resetInstanceNode("/root/send/reqdata");
-
- model.copyNode("/root/send/reqdata", "/root/main/cond");
- submit("TRMMO04205");
- window.modelesstopmost = true;
- }
- /*===============================================================================
- @desc : 외래시 조회
- ===============================================================================*/
- function fOutPatList() {
- model.removeNodeset("/root/main/inpatinfo/inpatlist");
- model.removeNodeset("/root/main/outpatinfo/outpatlist");
- model.removeNodeset("/root/main/info/concslippatlist");
- model.removeNodeset("/root/main/oppatinfo/oppatlist");
-
- model.resetInstanceNode("/root/send/reqdata");
-
- model.copyNode("/root/send/reqdata", "/root/main/cond");
- submit("TRMMO04207");
- window.modelesstopmost = true;
- }
- /*===============================================================================
- @desc : 조회일자가 2일이 넘지 않도록 설정
- ===============================================================================*/
- function fChkDate() {
- var todd = model.getValue("/root/main/cond/todd");
- fromdd2 = Number(todd-2)
- var fromdd = model.getValue("/root/main/cond/fromdd");
- Number(fromdd);
-
- if (fromdd < fromdd2 || fromdd > todd) {
- var cur_day = getCurrentDate();
- model.setValue("/root/main/cond/fromdd" , todd );
- ipt_fromdd.refresh();
-
- messageBox("시작일은 2일 이전일 또는 종료일보다 클 수 ","E001");
-
- } else {
- fChkGetData() ;
- }
- }
- function fInitialize() {
-
- //관심슬립콤보 아이템추가
- if (model.getValue ("/root/main/cond/clsflag") == "P" ){
- model.setValue("/root/main/cond/userid", getUserInfo("userid"));
- } else if ( model.getValue ("/root/main/cond/clsflag") == "G" ) {
- model.setValue("/root/main/cond/userid", getUserInfo("dutplcecd"));
- }
-
- model.copyNode("/root/send/reqdata", "/root/main/cond");
-
- submit("TRMMB00101");
-
- addComboItem("cmb_concslip","","","above");
-
- }
- /*===============================================================================
- @desc : 관심슬립대상자 조회
- ===============================================================================*/
- function fGetConcSlipPatList(){
-
- model.makeNode("/root/send/cond");
-
- if (model.getValue ("/root/main/cond/clsflag") == "P" ){
- model.setValue("/root/main/cond/userid", getUserInfo("userid"));
- } else if ( model.getValue ("/root/main/cond/clsflag") == "G" ) {
- model.setValue("/root/main/cond/userid", getUserInfo("dutplcecd"));
- }
- model.copyNode("/root/send/reqdata", "/root/main/cond");
- submit("TRMMB00102");
- window.modelesstopmost = true;
- model.refresh();
- }
- /*===============================================================================
- @desc : 수술마취대상자조회
- ===============================================================================*/
-
- function fGetOpPatList(){
-
- model.makeNode("/root/send/cond");
- model.removeNodeset("/root/main/inpatinfo/inpatlist");
- model.removeNodeset("/root/main/outpatinfo/outpatlist");
- model.removeNodeset("/root/main/info/concslippatlist");
- model.removeNodeset("/root/main/oppatinfo/oppatlist");
-
- // if (model.getValue ("/root/main/cond/clsflag") == "P" ){
- // model.setValue("/root/main/cond/userid", getUserInfo("userid"));
- // } else if ( model.getValue ("/root/main/cond/clsflag") == "G" ) {
- // model.setValue("/root/main/cond/userid", getUserInfo("dutplcecd"));
- // }
- model.copyNode("/root/send/reqdata", "/root/main/cond");
- submit("TRMMO04206");
- window.modelesstopmost = true;
- model.refresh();
- }
-
- function fChkGetData() {
-
- var searflag = model.getValue("/root/main/cond/searflag");
- if (searflag =="P") {
- fInitialize();
- fGetConcSlipPatList();
- } else if(searflag =="A") {
- fGetOpPatList();
- } else if(searflag =="O") {
- fOutPatList() ;
- } else if (searflag == "I") {
- fInPatList() ;
- fMyPatChngColor();
- }
- }
- function fMyPatChngColor(){
- for(var currow = 1; currow < grd_inpatlist.rows; currow++){
- var color = model.getValue("/root/main/inpatinfo/inpatlist[" + currow + "]/color");
- if(color == ""){
- color = "ffffff";
- }
- grd_inpatlist.rowStyle(currow, "data", "background-color") = "#" + color;
- }
- grd_inpatlist.refresh();
- }
-
- //===================================================================
- // 수술에서 사용하는 함수들
- //===================================================================
- /**
- * @desc : 환자 선택 후, 환자 정보 조회 및 기록지 화면 연동
- * @
- * @param :
- * @return :
- * @author : 오지훈
- * @---------------------------------------------------
- */
-
-
- /**
- * @desc : 수술환자 선택
- * @
- * @param :
- * @return :
- * @author : 오지훈
- * @---------------------------------------------------
- */
- function fMiniOpPat(){
- var ordrecflag = model.getValue(root.main.cond.ordrecflag);
- var currow = grd_oppatlist.row;
- if(currow < 1){
- return;
- }
- var opstatcd = model.getValue("/root/main/oppatinfo/oppatlist[" + currow + "]/opstatcd");
- if(opstatcd == "00" || opstatcd == "10"){
- messageBox("선택된 환자는 수술확정이 되지", "E007");
- return;
- }
-
- //처방, CP화면에 modal 또는 modaless가 뜬 경우, 환자 선택 불가
- if(fChkScrnModal()==false){
- return;
- }
-
- //CP환자 여부 확인
- if(fChkCPMiniOpPatValid(currow)==false){
- return;
- }
-
- //상단정보 설정
- //model.setValue(opener.root.cpflag, "N"); //처방open
- if(fReqMiniOpPatPamInfo(currow)==true){
- fOpenPrcpMainWnd();
- }
-
- var mainobj = getMainViewer();
- var mainscrnid = mainobj.javascript.getScreenID(); //메인화면의 기록지 ID
- if(getUserInfo("dutplcecd") == "2090000000"){ //로그인한 의사가 마취통증의학과인 경우
- if(mainscrnid == "SMMMR03700"){
- mainobj.javascript.fFormInit();
- }else{
- mainobj.javascript.navigate("SMMMR03700");
- }
- }
- }
- /**
- * @desc : 수술환자 환자 기본정보설정
- * @ 수정 : 미니진료대상자에 맞게끔 내용 수정
- * @
- * @param :
- * @return :
- * @author : 오지훈
- * @---------------------------------------------------
- */
- function fReqMiniOpPatPamInfo(iRow){
- var ioflag = "T" // 수술일 경우 ioflag:T
- var pid = model.getValue("/root/main/oppatinfo/oppatlist[" + iRow + "]/pid");
- var opcnfmdd = model.getValue("/root/main/oppatinfo/oppatlist[" + iRow + "]/opcnfmdd");
- var cretno = "";
- var instcd = model.getValue("/root/main/oppatinfo/oppatlist[" + iRow + "]/instcd");
- var perfdeptcd = model.getValue("/root/main/oppatinfo/oppatlist[" + iRow + "]/perfdeptcd");
- var perfdrid = model.getValue("/root/main/oppatinfo/oppatlist[" + iRow + "]/perfdrid");
- var patflag = model.getValue("/root/main/oppatinfo/oppatlist[" + iRow + "]/ioflag");
- var procflag = "F"; // 최초조회:F , 재조회:R
- var oprsrvno = model.getValue("/root/main/oppatinfo/oppatlist[" + iRow + "]/oprsrvno");
- var ophistno = model.getValue("/root/main/oppatinfo/oppatlist[" + iRow + "]/ophistno");
- var srchdd = model.getValue("/root/main/cond/fromdd"); //조회일자
-
- var param = ioflag + "▦" +
- pid + "▦" +
- opcnfmdd + "▦" +
- cretno + "▦" +
- instcd + "▦" +
- perfdeptcd + "▦" +
- perfdrid + "▦" +
- patflag + "▦" +
- procflag + "▦" +
- oprsrvno + "▦" +
- ophistno + "▦" +
- srchdd;
-
- setParameter("condparam", param);
- model.setValue("/root/init", param);
- modal("SPMMO08900", 1, 0, 0, "", "", "", "left:0; right:0; width:0; height:0; sysmenu:hidden; caption:hidden; min:hidden, max:hidden;");
-
- var useyn = getParameter("SPMMO08900_rtn_useyn");
- if(useyn == "Y"){
- setParameter("SPMMO08900_rtn_useyn", "");
- return true;
- }else{
- return false;
- }
- }
- /**
- * @desc : 수술환자 CP적용여부 확인
- * @
- * @param :
- * @return :
- * @author : 오지훈
- * @---------------------------------------------------
- */
- function fChkCPMiniOpPatValid(currow){
- var pid = model.getValue("/root/main/oppatinfo/oppatlist[" + currow + "]/pid");
- var opcnfmdd = model.getValue("/root/main/oppatinfo/oppatlist[" + currow + "]/opcnfmdd");
- var perfdeptcd = model.getValue("/root/main/oppatinfo/oppatlist[" + currow + "]/perfdeptcd");
- var perfdrid = model.getValue("/root/main/oppatinfo/oppatlist[" + currow + "]/perfdrid");
- var ioflag = model.getValue("/root/main/oppatinfo/oppatlist[" + currow + "]/ioflag");
- var instcd = model.getValue("/root/main/oppatinfo/oppatlist[" + currow + "]/instcd");
- var srchdd = model.getValue("/root/main/cond/opcnfmdd");
-
- model.removeNodeset("/root/send/reqdata");
- model.makeValue("/root/send/reqdata/ioflag" , "T"); //수술환자 ioflag는 T로 설정, 실제로 T는 없으나, 로직처리를 위해 임시로, 실제 ioflag는 patflag
- model.makeValue("/root/send/reqdata/pid" , pid);
- model.makeValue("/root/send/reqdata/orddd" , opcnfmdd);
- model.makeValue("/root/send/reqdata/orddeptcd", perfdeptcd);
- model.makeValue("/root/send/reqdata/orddrid" , perfdrid);
- model.makeValue("/root/send/reqdata/patflag" , ioflag); //실제 ioflag는 patflag로 설정
- model.makeValue("/root/send/reqdata/instcd" , instcd); //기관코드
- model.makeValue("/root/send/reqdata/srchdd" , srchdd); //기준일자
-
- if(submit("TRMMO04503")==true){ //수술환자의 원무키 조회
- var pid = model.getValue("/root/init/pamkeyinfo/pamkeyinfo/pid");
- var orddd = model.getValue("/root/init/pamkeyinfo/pamkeyinfo/orddd");
- var cretno= model.getValue("/root/init/pamkeyinfo/pamkeyinfo/cretno");
- var instcd= model.getValue("/root/init/pamkeyinfo/pamkeyinfo/instcd");
- var ioflag= model.getValue("/root/init/pamkeyinfo/pamkeyinfo/ioflag");
-
- model.removeNodeset("/root/send/reqdata");
- model.makeValue("/root/send/reqdata/pid" , pid);
- model.makeValue("/root/send/reqdata/orddd" , orddd);
- model.makeValue("/root/send/reqdata/cretno" , cretno);
- model.makeValue("/root/send/reqdata/prcpgenrflag", ioflag);
-
- var ocsflag = model.getValue("root/main/cond/ocsflag");
- if(ocsflag == "Y"){
- if(submit("TRMMO04303")==true){ //수술환자의 CP적용 여부 확인
- var cppatnode = model.instance1.selectNodes("/root/init/rsltgetdata/getdata");
- if(cppatnode.length < 1){ //cp적용환자 tbl에 유효한 데이터가 없는 경우
- model.setValue(root.cpflag, "N"); //처방open
- return true;
- }else{ //CP적용환자 tbl에 유효한 데이터가 있는 경우
- var appstat = model.getValue("/root/init/rsltgetdata/getdata/appstat");
- var cpgnm = model.getValue("/root/init/rsltgetdata/getdata/cpgnm");
- if(appstat == 12){ //CP적용상태가 12인 경우
- model.setValue(root.cpflag, "Y");
- return true;
- /*
- var rtnval = messageBox("[" + hngnm + "]환자의 [" + cpgnm + "] CP를", "Q003");
- if(rtnval == 6){ //예 선택, CP Main open, CP적용환자 tbl에 appstat 10 진행중
- model.setValue(opener.root.cpflag, "N");
- return fUpdtCPPatAppStatVal(52);
-
- }else{ //아니오 선택, 처방 Main open, CP적용환자 tbl에 appstat 51 drop out
- model.setValue(opener.root.cpflag, "Y");
- return fUpdtCPPatAppStatVal(10);
- }*/
- }else if(appstat == 52){
- var rtnval = messageBox("[" + hngnm + "]환자에게 CP를", "Q003");
- if(rtnval == 6){ //예, CP Main open, CP적용환자 tbl에 appstat 10 진행중
- model.setValue(root.cpflag, "X");
- return true;
- }else{
- model.setValue(root.cpflag, "N");
- return fUpdtCPPatAppStatVal(41); //41 : CP취소
- }
- }else{ //CP적용상태가 11가 아닌 경우, CP Main창 open
- model.setValue(root.cpflag, "Y");
- return true;
- }
- }
- }
- }
- }
- }
- /**
- * @desc : OCS Check Box 클릭시 처리
- * : check 할 경우 진료기록 화면만 열리고 처방화면은 열지 않는다
- * @
- * @param :
- * @return :
- * @author : 오지훈
- * @---------------------------------------------------
- */
- function fClkCheckBoxOCS(){
- var ocsflag = model.getValue("/root/main/cond/ocsflag");
- if(ocsflag == "Y"){
- model.setValue("/root/main/cond/ocsflag", "Y");
- }else{
- model.setValue("/root/main/cond/ocsflag", "N");
- }
- model.refresh();
- }
|