1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492 |
- // =================================================================================================
- // 사후심사 공통 Java Script (김상진)
- // @ver : 2008.06.03
- // @by : 김상진
- // @desc : 사후심사 공통관련 함수 (명명규칙 : 함수명 앞에 "pidf"를 붙인다.)
- // =================================================================================================
- /*
- * @---------------------------------------------------
- * @ver : 2008.08.23
- * @by : 김상진
- * @type : function
- * @access : public
- * @desc : 청구차수 : 이전월 다음월 계산
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function pidfCalMonth(idc, av_ym){
-
- var lv_date = av_ym.toDate("YYYYMM" + "01");
- lv_date = lv_date.getAddDate(idc, "M")
-
- return lv_date.getDateFormat("YYYYMM");
- }
- /*
- * @---------------------------------------------------
- * @ver : 2008.08.23
- * @by : 김상진
- * @type : function
- * @access : public
- * @desc : 청구차수조회
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function pidfGetClamdg() {
-
- model.removeNodeset("/root/init/clamdg");
- model.makeNode("/root/init/clamdg");
- submit("TRPID20407");
-
- cmb_clamdg.select(0);
- model.refreshpart("/root/init/clamdg");
- //model.setValue("/root/send/clamdg", 0);
- }
- /**
- * @---------------------------------------------------
- * @ver : 2008.06.08
- * @by : 김상진
- * @type : function
- * @access : public
- * @desc : 선택처방조회
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function pidfGetSpcOrdList() {
-
- var row = grd_clodhist.findRow("선", 1, grd_clodhist.colRef("payflag"), false, false);
-
- if (row < 1) {
- messageBox("조회된 선택처방이", "I004"); ///조회된 선택처방이 없습니다.
- //chk_choiordtotamt.dispatch("xforms-deselect");
- chk_choiordtotamt.value = "";
- return;
- }
-
- var insukind = model.getValue("/root/main/Item1/clbs/insukindcd");
- insukind = insukind.substr(1,1);
-
- for (var i = grd_clodhist.fixedRows; i < grd_clodhist.rows; i++) {
- grd_clodhist.rowHidden(i) = false;
- var payflag = model.getValue("/root/main/list2/clod["+ i +"]/payflag");
-
- if (insukind == "3" || insukind == "4") {
- if (payflag != "8") {
- grd_clodhist.rowHidden(i) = true;
- }
- } else {
- if (payflag != "9") {
- grd_clodhist.rowHidden(i) = true;
- }
- }
- }
-
- }
- /* @---------------------------------------------------
- * @ver : 2008.06.08
- * @by : 김상진
- * @type : function
- * @access : public
- * @desc : 선택처방해제
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function pidfSetSpcOrdListBack() {
- for (var i = grd_clodhist.fixedRows; i < grd_clodhist.rows; i++) {
- if (grd_clodhist.rowHidden(i)) {
- grd_clodhist.rowHidden(i) = false;
- }
- }
- }
-
- // padding
- function fPaddingData(sData,sflag,sPad,iLeng){
-
- if ( sData == "" || sflag == "" || sPad == "" || iLeng == "" ) {
- return;
- }
- if ( sData.length >= iLeng ) {
- return;
- }
- if ( iLeng <= 0 ) {
- return;
- }
-
- if ( sflag == "L" ) {
- sData = sData.getLeftPad(iLeng, sPad);
- } else if ( sflag == "R" ) {
- sData = sData.getRightPad(iLeng, sPad);
- } else {
- //
- }
-
- return sData;
-
- }
- //-----------------------------------
- //명세서 합철
- //-----------------------------------
- function pidfDocuMerge() {
- var irow = grd_clbsmast.row;
- var clamkey = model.getValue("/root/main/list1/clbs[" + irow + "]/clamkey");
- if (clamkey) {
-
- model.setValue("/root/hidden/smpid20600/cond/makeflag", "1"); // 1:명세서 합철
- model.setValue("/root/hidden/smpid20600/cond/copyflag", ""); // 명세서복사인 경우만 해당
- model.setValue("/root/hidden/smpid20600/cond/ioflag", model.getValue("/root/send/item1/ioflag"));
- model.setValue("/root/hidden/smpid20600/cond/clamym", model.getValue("/root/main/list1/clbs[" + irow + "]/clamym"));
- model.setValue("/root/hidden/smpid20600/cond/clamdg", model.getValue("/root/main/list1/clbs[" + irow + "]/clamdg"));
- model.setValue("/root/hidden/smpid20600/cond/pid", model.getValue("/root/main/list1/clbs[" + irow + "]/pid"));
- model.setValue("/root/hidden/smpid20600/cond/pidsn", model.getValue("/root/main/list1/clbs[" + irow + "]/pidsn"));
-
- modal("SMPID22300", "1", "50", "100", "SMPID22300", "/root/hidden/smpid20600/cond", "/root/init/item1", "", ""); // SMPID22300_명세서합철.xrw
- }
- }
-
- //-----------------------------------
- //명세서 복사
- //-----------------------------------
- function pidfDocuCopy() {
- var irow = grd_clbsmast.row;
- var clamkey = model.getValue("/root/main/list1/clbs[" + irow + "]/clamkey");
- if (clamkey) {
-
- model.setValue("/root/hidden/smpid20600/cond/makeflag", "2"); // 2:명세서 복사
- model.setValue("/root/hidden/smpid20600/cond/copyflag", "1"); // 명세서복사인 경우만 해당(1.기본만생성)
- model.setValue("/root/hidden/smpid20600/cond/ioflag", model.getValue("/root/send/item1/ioflag"));
- model.setValue("/root/hidden/smpid20600/cond/clamym", model.getValue("/root/main/list1/clbs[" + irow + "]/clamym"));
- model.setValue("/root/hidden/smpid20600/cond/clamdg", model.getValue("/root/main/list1/clbs[" + irow + "]/clamdg"));
- model.setValue("/root/hidden/smpid20600/cond/pid", model.getValue("/root/main/list1/clbs[" + irow + "]/pid"));
- model.setValue("/root/hidden/smpid20600/cond/pidsn", model.getValue("/root/main/list1/clbs[" + irow + "]/pidsn"));
- model.setValue("/root/hidden/smpid20600/cond/t_clamym", model.getValue("/root/main/list1/clbs[" + irow + "]/clamym")); //생성청구년월
- model.setValue("/root/hidden/smpid20600/cond/t_clamdg", model.getValue("/root/main/list1/clbs[" + irow + "]/clamdg")); //생성청구차수
- model.setValue("/root/hidden/smpid20600/cond/t_clamflagcd", "0"); //생청청구구분
-
- modal("SMPID22400", "1", "50", "100", "SMPID22400", "/root/hidden/smpid20600/cond", "/root/init/item1", "", ""); // SMPID22400_명세서복사.xrw
- }
- }
-
- //-----------------------------------
- //명세서 이동
- //-----------------------------------
- function pidfDocuMove() {
- var irow = grd_clbsmast.row;
- var clamkey = model.getValue("/root/main/list1/clbs[" + irow + "]/clamkey");
- if (clamkey) {
-
- model.setValue("/root/hidden/smpid20600/cond/makeflag", "3"); // 3:명세서 이동
- model.setValue("/root/hidden/smpid20600/cond/copyflag", ""); // 명세서복사인 경우만 해당
- model.setValue("/root/hidden/smpid20600/cond/ioflag", model.getValue("/root/send/item1/ioflag"));
- model.setValue("/root/hidden/smpid20600/cond/clamym", model.getValue("/root/main/list1/clbs[" + irow + "]/clamym"));
- model.setValue("/root/hidden/smpid20600/cond/clamdg", model.getValue("/root/main/list1/clbs[" + irow + "]/clamdg"));
- model.setValue("/root/hidden/smpid20600/cond/pid", model.getValue("/root/main/list1/clbs[" + irow + "]/pid"));
- model.setValue("/root/hidden/smpid20600/cond/pidsn", model.getValue("/root/main/list1/clbs[" + irow + "]/pidsn"));
- model.setValue("/root/hidden/smpid20600/cond/t_clamym", model.getValue("/root/main/list1/clbs[" + irow + "]/clamym")); //생성청구년월
- model.setValue("/root/hidden/smpid20600/cond/t_clamdg", model.getValue("/root/main/list1/clbs[" + irow + "]/clamdg")); //생성청구차수
- model.setValue("/root/hidden/smpid20600/cond/t_clamflagcd", "0"); //생청청구구분
-
- modal("SMPID22500", "1", "50", "100", "SMPID22500", "/root/hidden/smpid20600/cond", "/root/init/item1", "", ""); // SMPID22500_명세서이동.xrw
- }
- }
-
- //-----------------------------------
- //명세서 처방이동
- //-----------------------------------
- function pidfDocuOrderMove() {
- var irow = grd_clbsmast.row;
- var clamkey = model.getValue("/root/main/list1/clbs[" + irow + "]/clamkey");
- if (clamkey) {
-
- model.setValue("/root/hidden/smpid20600/cond/makeflag", "6"); // 6:명세서 처방이동
- model.setValue("/root/hidden/smpid20600/cond/copyflag", ""); // 명세서복사인 경우만 해당
- model.setValue("/root/hidden/smpid20600/cond/ioflag", model.getValue("/root/send/item1/ioflag"));
- model.setValue("/root/hidden/smpid20600/cond/clamym", model.getValue("/root/main/list1/clbs[" + irow + "]/clamym"));
- model.setValue("/root/hidden/smpid20600/cond/clamdg", model.getValue("/root/main/list1/clbs[" + irow + "]/clamdg"));
- model.setValue("/root/hidden/smpid20600/cond/pid", model.getValue("/root/main/list1/clbs[" + irow + "]/pid"));
- model.setValue("/root/hidden/smpid20600/cond/pidsn", model.getValue("/root/main/list1/clbs[" + irow + "]/pidsn"));
-
- modal("SMPID23200", "1", "50", "100", "SMPID23200", "/root/hidden/smpid20600/cond", "/root/init/item1", "", ""); // SMPID23200_명세서처방이동.xrw
- }
- }
-
- //-----------------------------------
- //추가청구
- //-----------------------------------
- function pidfDocuAddClam() {
- var irow = grd_clbsmast.row;
- var clamkey = model.getValue("/root/main/list1/clbs[" + irow + "]/clamkey");
- if (clamkey) {
-
- model.setValue("/root/hidden/smpid20600/cond/makeflag", "4"); // 4:추가청구생성
- model.setValue("/root/hidden/smpid20600/cond/copyflag", ""); // 명세서복사인 경우만 해당
- model.setValue("/root/hidden/smpid20600/cond/ioflag", model.getValue("/root/send/item1/ioflag"));
- model.setValue("/root/hidden/smpid20600/cond/clamym", model.getValue("/root/main/list1/clbs[" + irow + "]/clamym"));
- model.setValue("/root/hidden/smpid20600/cond/clamdg", model.getValue("/root/main/list1/clbs[" + irow + "]/clamdg"));
- model.setValue("/root/hidden/smpid20600/cond/pid", model.getValue("/root/main/list1/clbs[" + irow + "]/pid"));
- model.setValue("/root/hidden/smpid20600/cond/pidsn", model.getValue("/root/main/list1/clbs[" + irow + "]/pidsn"));
- model.setValue("/root/hidden/smpid20600/cond/t_clamym", model.getValue("/root/main/list1/clbs[" + irow + "]/clamym")); //생성청구년월
- model.setValue("/root/hidden/smpid20600/cond/t_clamdg", model.getValue("/root/main/list1/clbs[" + irow + "]/clamdg")); //생성청구차수
- model.setValue("/root/hidden/smpid20600/cond/t_clamflagcd", "2"); //생청청구구분
-
- modal("SMPID22600", "1", "50", "100", "SMPID22600", "/root/hidden/smpid20600/cond", "/root/init/item1", "", ""); // SMPID22600_명세서추가청구생성.xrw
- }
- }
-
- //-----------------------------------
- //자격수정
- //-----------------------------------
- function pidfDocuChange() {
- var irow = grd_clbsmast.row;
- var clamkey = model.getValue("/root/main/list1/clbs[" + irow + "]/clamkey");
- var clamflagcd = model.getValue("root/main/list1/clbs[" + irow + "]/clamflagcd");
- if (clamflagcd == "1")
- {
- messageBox("보완청구의 경우에는 자격 변경을 방지하기 위해 명세서 자격수정을", "E001");
-
- }
- else
- {
- if (clamkey) {
-
- model.setValue("/root/hidden/smpid20600/cond/makeflag", "5"); // 5:자격수정
- model.setValue("/root/hidden/smpid20600/cond/copyflag", ""); // 명세서복사인 경우만 해당
- model.setValue("/root/hidden/smpid20600/cond/ioflag", model.getValue("/root/send/item1/ioflag"));
- model.setValue("/root/hidden/smpid20600/cond/clamym", model.getValue("/root/main/list1/clbs[" + irow + "]/clamym"));
- model.setValue("/root/hidden/smpid20600/cond/clamdg", model.getValue("/root/main/list1/clbs[" + irow + "]/clamdg"));
- model.setValue("/root/hidden/smpid20600/cond/pid", model.getValue("/root/main/list1/clbs[" + irow + "]/pid"));
- model.setValue("/root/hidden/smpid20600/cond/pidsn", model.getValue("/root/main/list1/clbs[" + irow + "]/pidsn"));
-
- modal("SMPID22700", "1", "50", "100", "SMPID22700", "/root/hidden/smpid20600/cond", "/root/init/item1", "", ""); // SMPID22700_명세서자격수정.xrw
- }
- }
- }
-
- //-----------------------------------
- //공여자명세서생성
- //-----------------------------------
- function pidfDocuDonor() {
- var irow = grd_clbsmast.row;
- var clamkey = model.getValue("/root/main/list1/clbs[" + irow + "]/clamkey");
- if (clamkey) {
- model.setValue("/root/hidden/smpid22200/cond/ioflag", model.getValue("/root/send/item1/ioflag"));
- model.setValue("/root/hidden/smpid22200/cond/clamym", model.getValue("/root/main/list1/clbs[" + irow + "]/clamym"));
- model.setValue("/root/hidden/smpid22200/cond/clamdg", model.getValue("/root/main/list1/clbs[" + irow + "]/clamdg"));
- model.setValue("/root/hidden/smpid22200/cond/pid", model.getValue("/root/main/list1/clbs[" + irow + "]/pid"));
- model.setValue("/root/hidden/smpid22200/cond/pidsn", model.getValue("/root/main/list1/clbs[" + irow + "]/pidsn"));
-
- modal("SMPID22200", "1", "250", "220", "SMPID22200", "/root/hidden/smpid22200/cond", "/root/init/item1", "", ""); // SMPID22200_공여자명세서생성.xrw
- }
- }
-
- //-----------------------------------
- //명세서처방 이동/복사
- //-----------------------------------
- function pidfDocuCopyMove() {
- var irow = grd_clbsmast.row;
- var clamkey = model.getValue("/root/main/list1/clbs[" + irow + "]/clamkey");
- if (clamkey) {
- model.setValue("/root/hidden/smpid23200/cond/ioflag", model.getValue("/root/send/item1/ioflag"));
- model.setValue("/root/hidden/smpid23200/cond/clamym", model.getValue("/root/main/list1/clbs[" + irow + "]/clamym"));
- model.setValue("/root/hidden/smpid23200/cond/clamdg", model.getValue("/root/main/list1/clbs[" + irow + "]/clamdg"));
- model.setValue("/root/hidden/smpid23200/cond/pid", model.getValue("/root/main/list1/clbs[" + irow + "]/pid"));
- model.setValue("/root/hidden/smpid23200/cond/pidsn", model.getValue("/root/main/list1/clbs[" + irow + "]/pidsn"));
- model.setValue("/root/hidden/smpid23200/cond/patnm", model.getValue("/root/main/list1/clbs[" + irow + "]/patnm"));
- model.setValue("/root/hidden/smpid23200/cond/insukind", model.getValue("/root/main/list1/clbs[" + irow + "]/insukindcd"));
- model.setValue("/root/hidden/smpid23200/cond/suppkind", model.getValue("/root/main/list1/clbs[" + irow + "]/suppkindcd"));
- model.setValue("/root/hidden/smpid23200/cond/orddeptcd", model.getValue("/root/main/list1/clbs[" + irow + "]/orddeptcd"));
- modal("SMPID23200", "1", "50", "100", "SMPID23200", "/root/hidden/smpid23200/cond", "/root/init/item1", "", ""); // SMPID23200_명세서처방복사.xrw
- }
- }
- //-----------------------------------
- //심사자변경
- //-----------------------------------
- function pidfJudgridChange() {
- var irow = grd_clbsmast.row;
- var clamkey = model.getValue("/root/main/list1/clbs[" + irow + "]/clamkey");
- if (clamkey) {
- model.setValue("/root/hidden/smpid23000/cond/ioflag", model.getValue("/root/send/item1/ioflag"));
- model.setValue("/root/hidden/smpid23000/cond/clamym", model.getValue("/root/main/list1/clbs[" + irow + "]/clamym"));
- model.setValue("/root/hidden/smpid23000/cond/clamdg", model.getValue("/root/main/list1/clbs[" + irow + "]/clamdg"));
- model.setValue("/root/hidden/smpid23000/cond/pid", model.getValue("/root/main/list1/clbs[" + irow + "]/pid"));
- model.setValue("/root/hidden/smpid23000/cond/pidsn", model.getValue("/root/main/list1/clbs[" + irow + "]/pidsn"));
-
- modal("SMPID23000", "1", "50", "100", "SMPID23000", "/root/hidden/smpid23000/cond", "/root/init/item1", "", ""); // SMPID23000_심사자변경.xrw
- }
- }
- //-------------------------------------------------------------------
- // 1. 재청구 삭제일 경우 : (1). 반송부제기사유 체크
- // (2). 반송부제기사유 UPDATE
- //-------------------------------------------------------------------
- function pidfChkAbdResncd() {
-
- var abdresncd = model.getValue("/root/main/item1/clbs/abdresncd");
- if (abdresncd == "") {
- messageBox("반송부제기사유는","I003"); //I003=필수입력입니다.
- model.setFocus("cmb_abdresncd");
- return false;
- } else {
- return true;
- }
- }
-
-
- //-------------------------------------------------------------------
- // 2. 명세서삭제일 경우 : (1). 명세서삭제사유 체크
- // (2). 기타일경우 심사자메모에 기타사유 추가
- //-------------------------------------------------------------------
- function pidfChkDocuDelResncd() {
-
-
- var docudelresncd = model.getValue("/root/main/item1/clbs/docudelresncd");
- if (docudelresncd == "") {
- messageBox("명세서삭제사유는","I003"); //I003=필수입력입니다.
- model.setFocus("cmb_docudelresncd");
- return false;
- } else {
- var docudelresncd = model.getValue("/root/main/item1/clbs/docudelresncd");
- if (docudelresncd == "Z") {
- // 명세서삭제사유가 "기타"인경우 심사자메모에 기타사유 넣는다.
- var judgmemo = model.getValue("/root/main/item1/memo/judgmemo");
- judgmemo = "[명세서 삭제: 기타]" || " " || judgmemo
- model.setValue("/root/main/item1/memo/judgmemo", judgmemo);
- }
- return true;
- }
- }
- //-----------------------------------
- // 상병별 청구환자조회
- //-----------------------------------
- function pidfOpenSMPIS00400(ioflag) {
-
- if (ioflag == "I") {
- var irow = grd_clbsmast.row;
- } else {
- var srchmode = model.getValue("/root/hidden/clbs/srchmode");
- if (srchmode == "specclbs") { // 선별심사 모드인 경우
- var irow = grd_specclbs.row;
- } else {
- var irow = grd_clbsmast.row;
- }
- }
-
- var clamkey = model.getValue("/root/main/list1/clbs[" + irow + "]/clamkey");
- if (clamkey) {
- model.setValue("/root/hidden/smpis00400/cond/pid", model.getValue("/root/main/list1/clbs[" + irow + "]/pid"));
- model.setValue("/root/hidden/smpis00400/cond/clamymfrom", model.getValue("/root/main/list1/clbs[" + irow + "]/clamym"));
- model.setValue("/root/hidden/smpis00400/cond/clamymto", model.getValue("/root/main/list1/clbs[" + irow + "]/clamym"));
- model.setValue("/root/hidden/smpis00400/cond/ioflag", model.getValue("/root/send/item1/ioflag"));
- model.setValue("/root/hidden/smpis00400/cond/insukind", model.getValue("/root/main/list1/clbs[" + irow + "]/insukindcd"));
-
- var i = 1;
- var nodeList = instance1.selectNodes("/root/init/orddeptcd/orddeptcdlist");
- var orddeptcd = model.getValue("/root/main/list1/clbs[" + irow + "]/orddeptcd");
- for ( i = 1; i < nodeList.length; i++) {
- if ( orddeptcd == model.getValue("/root/init/orddeptcd/orddeptcdlist[" + i + "]/deptengabbr")) {
- orddeptcd = model.getValue("/root/init/orddeptcd/orddeptcdlist[" + i + "]/cd");
- break;
- }
- }
- model.setValue("/root/hidden/smpis00400/cond/orddeptcd", orddeptcd);
- model.setValue("/root/hidden/smpis00400/cond/diagcond", "M"); // 상병조건 : M:주상병, S:부상병
- model.setValue("/root/hidden/smpis00400/cond/diagcdfr", ""); // 시작상병
- model.setValue("/root/hidden/smpis00400/cond/diagcdto", ""); // 종료상병
- }
- modal("SMPIS00400", "1", "10", "10", "SMPIS00400", "/root/hidden/smpis00400/cond", "/root/send/item1", "", ""); // SMPIS00400_상병별청구환자조회.xrw
- }
-
- //-----------------------------------
- // 처방별 환자조회(계산)
- //-----------------------------------
- function pidfOpenSMPIS00500(ioflag, calltype, codetype) {
-
- model.resetInstanceNode("/root/hidden/smpis00500/cond");
-
- // calltype : M:사후대상자조회 호출(환자별검색), D:사후메인에서 호출(코드별검색)
- if (calltype == "M") {
- if (ioflag == "I") {
- var irow = grd_clbsmast.row;
- } else {
- var srchmode = model.getValue("/root/hidden/clbs/srchmode");
- if (srchmode == "specclbs") { // 선별심사 모드인 경우
- var irow = grd_specclbs.row;
- } else {
- var irow = grd_clbsmast.row;
- }
- }
-
- var pid = model.getValue("/root/main/list1/clbs[" + irow + "]/pid");
- if (pid) {
- model.makeValue("/root/hidden/smpis00500/cond/patunitsrch", model.getValue("/root/main/list1/clbs[" + irow + "]/pid"));
- model.makeValue("/root/hidden/smpis00500/cond/fromdd", model.getValue("/root/main/list1/clbs[" + irow + "]/ordfromdd"));
- model.makeValue("/root/hidden/smpis00500/cond/todd", model.getValue("/root/main/list1/clbs[" + irow + "]/ordtodd"));
- if (ioflag == "O") {
- model.makeValue("/root/hidden/smpis00500/cond/ioflag", "A");
- model.makeValue("/root/hidden/smpis00500/cond/orddrid", "");
- }
- else {
- model.makeValue("/root/hidden/smpis00500/cond/ioflag", model.getValue("/root/send/item1/ioflag"));
- model.makeValue("/root/hidden/smpis00500/cond/orddrid", model.getValue("/root/main/list1/clbs[" + irow + "]/orddrid"));
- }
- model.makeValue("/root/hidden/smpis00500/cond/orddeptcd", model.getValue("/root/main/list1/clbs[" + irow + "]/orddeptcd"));
- model.makeValue("/root/hidden/smpis00500/cond/codecond", "calc"); // calc:코드별, cancer:항암제, kind:분류별
- model.makeValue("/root/hidden/smpis00500/cond/code", ""); // 검색할 수가코드
- }
- }
- else {
- var irow = grd_clodhist.row;
-
- var pid = model.getValue("/root/main/item1/clbs/pid");
- if (pid) {
- model.makeValue("/root/hidden/smpis00500/cond/patunitsrch", model.getValue("/root/main/item1/clbs/pid"));
- if (ioflag == "O") {
- model.makeValue("/root/hidden/smpis00500/cond/fromdd", model.getValue("/root/main/item1/clbs/indd"));
- model.makeValue("/root/hidden/smpis00500/cond/todd", model.getValue("/root/main/item1/clbs/dschdd"));
- model.makeValue("/root/hidden/smpis00500/cond/orddrid", "");
- if (model.getValue("/root/main/item1/clbs/stsioflag") == "-")
- model.makeValue("/root/hidden/smpis00500/cond/ioflag", "O");
- else
- model.makeValue("/root/hidden/smpis00500/cond/ioflag", "I");
-
- }
- else {
- model.makeValue("/root/hidden/smpis00500/cond/fromdd", model.getValue("/root/main/item1/clbs/ordfromdd"));
- model.makeValue("/root/hidden/smpis00500/cond/todd", model.getValue("/root/main/item1/clbs/ordtodd"));
- model.makeValue("/root/hidden/smpis00500/cond/orddrid", model.getValue("/root/main/item1/clbs/orddrid"));
- model.makeValue("/root/hidden/smpis00500/cond/ioflag", model.getValue("/root/main/item1/clbs/ioflag"));
- }
- //model.makeValue("/root/hidden/smpis00500/cond/orddeptcd", model.getValue("/root/main/list1/clbs[" + irow + "]/orddeptcd"));
- //model.makeValue("/root/hidden/smpis00500/cond/orddeptcd", " ");
- // 20100322 김용민 수정
- model.makeValue("/root/hidden/smpis00500/cond/orddeptcd", "");
- model.makeValue("/root/hidden/smpis00500/cond/orddrid", "");
- model.makeValue("/root/hidden/smpis00500/cond/codecond", "calc"); // calc:코드별, cancer:항암제, kind:분류별
- if (codetype == "SnglCD")
- model.makeValue("/root/hidden/smpis00500/cond/code", model.getValue("/root/main/list2/clod["+ irow +"]/snglcalcscorcd")); // 검색할 수가코드
- else
- model.makeValue("/root/hidden/smpis00500/cond/edicd", model.getValue("/root/main/list2/clod["+ irow +"]/edicd")); // 검색할 EDI코드
- }
-
- }
- modal("SMPIS00500", "1", "10", "10", "SMPIS00500", "/root/hidden/smpis00500/cond", "/root/send", "", ""); // SMPIS00500_계산처방시행조회.xrw
- }
-
-
- //-----------------------------------
- // 처방별 환자조회(청구/삭감)
- //-----------------------------------
- function pidfOpenSMPIS00600(ioflag, calltype) {
-
- // calltype : M:사후대상자조회 호출(환자별검색), D:사후메인에서 호출(코드별검색)
- if (calltype == "M") {
- if (ioflag == "I") {
- var irow = grd_clbsmast.row;
- } else {
- var srchmode = model.getValue("/root/hidden/clbs/srchmode");
- if (srchmode == "specclbs") { // 선별심사 모드인 경우
- var irow = grd_specclbs.row;
- } else {
- var irow = grd_clbsmast.row;
- }
- }
-
- var pid = model.getValue("/root/main/list1/clbs[" + irow + "]/pid");
- if (pid) {
- model.makeValue("/root/hidden/smpis00600/cond/patunitsrch", model.getValue("/root/main/list1/clbs[" + irow + "]/pid"));
- model.makeValue("/root/hidden/smpis00600/cond/clamym", "");
- model.makeValue("/root/hidden/smpis00600/cond/clamymfrom", model.getValue("/root/main/list1/clbs[" + irow + "]/clamym"));
- //model.makeValue("/root/hidden/smpis00600/cond/clamdgfrom", model.getValue("/root/main/list1/clbs[" + irow + "]/clamdg"));
- model.makeValue("/root/hidden/smpis00600/cond/clamymto", model.getValue("/root/main/list1/clbs[" + irow + "]/clamym"));
- //model.makeValue("/root/hidden/smpis00600/cond/clamdgto", model.getValue("/root/main/list1/clbs[" + irow + "]/clamdg"));
- model.makeValue("/root/hidden/smpis00600/cond/clamflag", model.getValue("/root/main/list1/clbs[" + irow + "]/clamflagcd"));
- model.makeValue("/root/hidden/smpis00600/cond/ioflag", model.getValue("/root/send/item1/ioflag"));
- model.makeValue("/root/hidden/smpis00600/cond/insukind", model.getValue("/root/main/list1/clbs[" + irow + "]/insukindcd"));
- //model.makeValue("/root/hidden/smpis00600/cond/orddeptcd", model.getValue("/root/main/list1/clbs[" + irow + "]/orddeptcd"));
- //model.makeValue("/root/hidden/smpis00600/cond/orddrid", model.getValue("/root/main/list1/clbs[" + irow + "]/orddrid"));
- model.makeValue("/root/hidden/smpis00600/cond/cutonly", "false"); // 삭감처방만조회:true, 청구처방조회:false
- model.makeValue("/root/hidden/smpis00600/cond/code", ""); // 수가코드
- // 20100322 김용민 기본값 추가
- model.makeValue("/root/hidden/smpis00600/cond/codecond", "calc"); // calc:코드별, cancer:항암제, kind:분류별
- model.makeValue("/root/hidden/smpis00600/cond/trustinstcd", "N"); //
- model.makeValue("/root/hidden/smpis00600/cond/clamdgfrom", "");
- model.makeValue("/root/hidden/smpis00600/cond/clamdgto", "");
- model.makeValue("/root/hidden/smpis00600/cond/orddeptcd", "");
- model.makeValue("/root/hidden/smpis00600/cond/orddrid", "");
- } else {
- model.makeValue("/root/hidden/smpis00600/cond/patunitsrch", "");
- model.makeValue("/root/hidden/smpis00600/cond/clamym", "");
- model.makeValue("/root/hidden/smpis00600/cond/clamymfrom", "");
- model.makeValue("/root/hidden/smpis00600/cond/clamymto", "");
- model.makeValue("/root/hidden/smpis00600/cond/clamflag", "");
- model.makeValue("/root/hidden/smpis00600/cond/ioflag", model.getValue("/root/send/item1/ioflag"));
- model.makeValue("/root/hidden/smpis00600/cond/insukind", "");
- model.makeValue("/root/hidden/smpis00600/cond/cutonly", "false"); // 삭감처방만조회:true, 청구처방조회:false
- model.makeValue("/root/hidden/smpis00600/cond/code", ""); // 수가코드
- // 20100322 김용민 기본값 추가
- model.makeValue("/root/hidden/smpis00600/cond/codecond", "calc"); // calc:코드별, cancer:항암제, kind:분류별
- model.makeValue("/root/hidden/smpis00600/cond/trustinstcd", "N"); //
- model.makeValue("/root/hidden/smpis00600/cond/clamdgfrom", "");
- model.makeValue("/root/hidden/smpis00600/cond/clamdgto", "");
- model.makeValue("/root/hidden/smpis00600/cond/orddeptcd", "");
- model.makeValue("/root/hidden/smpis00600/cond/orddrid", "");
- }
- }
- else {
- var irow = grd_clodhist.row;
- var pid = model.getValue("/root/main/item1/clbs/pid");
- if (pid) {
- model.makeValue("/root/hidden/smpis00600/cond/patunitsrch", model.getValue("/root/main/item1/clbs/pid"));
- model.makeValue("/root/hidden/smpis00600/cond/clamym", "");
- model.makeValue("/root/hidden/smpis00600/cond/clamymfrom", model.getValue("/root/main/item1/clbs/clamym"));
- //model.makeValue("/root/hidden/smpis00600/cond/clamdgfrom", model.getValue("/root/main/item1/clbs/clamdg"));
- model.makeValue("/root/hidden/smpis00600/cond/clamymto", model.getValue("/root/main/item1/clbs/clamym"));
- //model.makeValue("/root/hidden/smpis00600/cond/clamdgto", model.getValue("/root/main/item1/clbs/clamdg"));
- model.makeValue("/root/hidden/smpis00600/cond/clamflag", model.getValue("/root/main/item1/clbs/clamflagcd"));
- model.makeValue("/root/hidden/smpis00600/cond/ioflag", model.getValue("/root/main/item1/clbs/ioflag"));
- model.makeValue("/root/hidden/smpis00600/cond/insukind", model.getValue("/root/main/item1/clbs/insukindcd"));
- //model.makeValue("/root/hidden/smpis00600/cond/orddeptcd", model.getValue("/root/main/item1/clbs/orddeptcd"));
- //model.makeValue("/root/hidden/smpis00600/cond/orddrid", model.getValue("/root/main/item1/clbs/orddrid"));
- model.makeValue("/root/hidden/smpis00600/cond/cutonly", "false"); // 삭감처방만조회:true, 청구처방조회:false
- model.makeValue("/root/hidden/smpis00600/cond/code", model.getValue("/root/main/list2/clod["+ irow +"]/snglcalcscorcd")); // 수가코드
- // 20100322 김용민 기본값 추가
- model.makeValue("/root/hidden/smpis00600/cond/codecond", "calc"); // calc:코드별, cancer:항암제, kind:분류별
- model.makeValue("/root/hidden/smpis00600/cond/trustinstcd", "N"); //
- model.makeValue("/root/hidden/smpis00600/cond/clamdgfrom", "");
- model.makeValue("/root/hidden/smpis00600/cond/clamdgto", "");
- model.makeValue("/root/hidden/smpis00600/cond/orddeptcd", "");
- model.makeValue("/root/hidden/smpis00600/cond/orddrid", "");
- var curFrom = getCurrentDate().toDate().getAddDate(-6,"M").getDateFormat("YYYYMM");
- var curTo = getCurrentDate().toDate().getDateFormat("YYYYMM");
- model.makeValue("/root/hidden/smpis00600/cond/clamymfrom", curFrom);
- model.makeValue("/root/hidden/smpis00600/cond/clamymto", curTo);
- }
- }
-
- modal("SMPIS00600", "1", "10", "10", "SMPIS00600", "/root/hidden/smpis00600/cond", "/root/send", "", ""); // SMPIS00600_청구삭감조회.xrw
- }
-
- //------------------------------------
- // 급여구분별 사후처방조회
- //------------------------------------
- function pidfGetOrderWithPayflag() {
-
- var pid = model.getValue("/root/send/item1/clbs/pid");
-
- if (pid) {
- var payflag = model.getValue("/root/hidden/list2/clodsrch/selectedRdoPay");
- model.makeValue("/root/send/item1/clbs/payflag", payflag);
- if (submit("TRPID20310")) {
- grd_selectclod.attribute("left") = "0";
- grd_selectclod.attribute("top") = "286";
- grd_selectclod.visible = true;
- grd_clodhist.visible = false;
- }
- }
-
- }
-
- //-------------------------------------------------------------------
- // 생성삭제(입원,외래사후심사 대상자조회에서 "생성삭제"버튼 눌렀을 때
- //-------------------------------------------------------------------
- function pidfDelClamData(ioflag, deptcd) {
- /*
- if (grd_clbsmast.visible == true) {
- var iSel_Row = grd_clbsmast.selectedrow(0);
- var clamkey = model.getValue("/root/main/list1/clbs[" + iSel_Row + "]/clamkey");
- var pid = model.getValue("/root/main/list1/clbs[" + iSel_Row + "]/pid");
- var pidsn = model.getValue("/root/main/list1/clbs[" + iSel_Row + "]/pidsn");
- var patnm = model.getValue("/root/main/list1/clbs[" + iSel_Row + "]/patnm");
- var clamendyn = model.getValue("/root/main/list1/clbs[" + iSel_Row + "]/clamendyn");
- var lockyn = model.getValue("/root/main/list1/clbs[" + iSel_Row + "]/lockyn");
-
- if (clamkey != "" && clamkey != '-') {
- //if (clamendyn == "A" ) {
- if (lockyn != "Y" ) {
- var ans = messageBox("[ 환자명:" + patnm + ", 등록번호:" + pid + ", 순번:" + pidsn + " ] 생성삭제", "S001"); ///하시려면 예(Yes)\n아니면 아니오(No)
- if (ans == 6) { // 6: yes, 7:no, 2:cancel
- model.setValue("/root/send/item4/clbs/clamym", model.getValue("/root/main/list1/clbs[" + iSel_Row + "]/clamym"));
- model.setValue("/root/send/item4/clbs/clamdg", model.getValue("/root/main/list1/clbs[" + iSel_Row + "]/clamdg"));
- model.setValue("/root/send/item4/clbs/pid", model.getValue("/root/main/list1/clbs[" + iSel_Row + "]/pid"));
- model.setValue("/root/send/item4/clbs/pidsn", model.getValue("/root/main/list1/clbs[" + iSel_Row + "]/pidsn"));
- model.setValue("/root/send/item4/clbs/clamkey", model.getValue("/root/main/list1/clbs[" + iSel_Row + "]/clamkey"));
- model.setValue("/root/send/item4/clbs/ioflag", "I");
- model.setValue("/root/send/item4/clbs/instcd", getUserInfo("posinstcd"));
-
- if (submit("TXPID20303")) {
- model.removeNode("/root/main/list1/clbs["+iSel_Row+"]");
- grd_clbsmast.refresh();
- grd_clbsmast.row = iSel_Row;
- }
- }
- } else {
- messageBox("잠금설정상태입니다. 삭제", "E001"); ///할 수 없습니다.
- }
- }
- }
- else {
- messageBox("선별심사모드에서는 생성삭제", "E001"); ///선별심사모드에서는 생성삭제 할 수 없습니다.
- }
- */
-
- // 청구생성 삭제로직으로 변경함.
- if (grd_clbsmast.visible == true) {
-
- var iSel_Row = grd_clbsmast.selectedrow(0);
- var clamkey = model.getValue("/root/main/list1/clbs[" + iSel_Row + "]/clamkey");
- var lockyn = model.getValue("/root/main/list1/clbs[" + iSel_Row + "]/lockyn");
-
- if (clamkey != "" && clamkey != '-') {
- if (lockyn != "Y" ) {
- var pid = model.getValue("/root/main/list1/clbs[" + iSel_Row + "]/pid");
- var patnm = model.getValue("/root/main/list1/clbs[" + iSel_Row + "]/patnm");
- //var ans = messageBox("[ 환자명:" + patnm + ", 등록번호:" + pid + " ] 생성삭제", "S001"); ///하시려면 예(Yes)\n아니면 아니오(No)
- //var ans = messageBox("[ 환자명:" + patnm + ", 등록번호:" + pid + " ] 해당 환자의 전체보험유형, 진료분야, 진료과를 생성삭제", "S001"); ///하시려면 예(Yes)\n아니면 아니오(No)
- //var message = "1. 선택한 진료과만 삭제하시려면 : 예(Y)\n\n2. 전 체 진료과를 모두 삭제하시려면 : 아니오(N) 를 누르세요"
- //var ans = messageBox("[ 환자명:" + patnm + ", 등록번호:" + pid + ", 진료과:" + deptcd + " ]\n\n" + message, "S006"); ///하시려면 예(Yes)\n아니면 아니오(No)
- var message = "2. 전 체 진료과를 모두 삭제|3. 취 소";
- var ans = messageBox("[ 환자명:" + patnm + ", 등록번호:" + pid + ", 진료과:" + deptcd + " ]\n\n" + "1. 선택한 진료과만 삭제", "S006", message); ///하시려면 예(Yes)\n아니면 아니오(No)
- if (ans == 6 || ans == 7) { // 6: yes, 7:no, 2:cancel
- model.setValue("/root/send/item6/clbs/clamym", model.getValue("/root/main/list1/clbs[" + iSel_Row + "]/clamym")); // 1.청구년월
- model.setValue("/root/send/item6/clbs/clamdg", model.getValue("/root/main/list1/clbs[" + iSel_Row + "]/clamdg")); // 2.청구차수
- model.setValue("/root/send/item6/clbs/clamfromdd", model.getValue("/root/main/list1/clbs[" + iSel_Row + "]/cretfromdd")); // 3.생성시작일
- model.setValue("/root/send/item6/clbs/clamtodd", model.getValue("/root/main/list1/clbs[" + iSel_Row + "]/crettodd")); // 4.생성종료일
-
- // 전체보험유형,진료분야,진료과 삭제이면( 7:no )
- if (ans == 7) {
- // 5.보험유형 : -.전체
- model.setValue("/root/send/item6/clbs/insutype", "-");
- // 6.진료분야 : -.전체
- model.setValue("/root/send/item6/clbs/ordfildcd", "-");
- // 7.진료과
- model.setValue("/root/send/item6/clbs/orddeptcd", "");
- } else {
- // 5.보험유형
- var insukind = model.getValue("/root/main/list1/clbs[" + iSel_Row + "]/insukindcd");
- if (insukind == "11") {
- model.setValue("/root/send/item6/clbs/insutype", "2"); // 보험
- } else if (insukind == "21") {
- model.setValue("/root/send/item6/clbs/insutype", "4"); // 급여1종
- } else if (insukind == "22") {
- model.setValue("/root/send/item6/clbs/insutype", "5"); // 급여2종
- } else if (insukind == "41") {
- model.setValue("/root/send/item6/clbs/insutype", "6"); // 산재
- } else if (insukind == "31") {
- model.setValue("/root/send/item6/clbs/insutype", "7"); // 자보
- }
- // 6.진료분야
- model.setValue("/root/send/item6/clbs/ordfildcd", model.getValue("/root/main/list1/clbs[" + iSel_Row + "]/ordfildcd"));
- // 7.진료과
- model.setValue("/root/send/item6/clbs/orddeptcd", model.getValue("/root/main/list1/clbs[" + iSel_Row + "]/orddeptcd"));
- }
-
- model.setValue("/root/send/item6/clbs/clamflag", '-'); // 8.청구구분 : -.퇴원+중간, 1.퇴원청구, 2.중간청구
- model.setValue("/root/send/item6/clbs/predata", "4"); // 9.이전자료 : 4.삭제
- model.setValue("/root/send/item6/clbs/ownb100", "N"); // 10.전액본인 : N.생성안함
- model.setValue("/root/send/item6/clbs/datacretflag", "-"); // 11.생성여부 : -.전체
- model.setValue("/root/send/item6/clbs/pid", model.getValue("/root/main/list1/clbs[" + iSel_Row + "]/pid")); // 12.등록번호
- model.setValue("/root/send/item6/clbs/name", model.getValue("/root/main/list1/clbs[" + iSel_Row + "]/name")); // 13.환자명
- model.setValue("/root/send/item6/clbs/chk", "true"); // 14.선택여부
-
- // 15.집계구분
- if (ioflag == "I") {
- model.setValue("/root/send/item6/clbs/weekflag", "T");
- model.setValue("/root/send/item6/clbs/ioflag", ioflag);
- } else {
- model.setValue("/root/send/item6/clbs/weekflag", "S"); // S:집계 월단위 청구
- model.setValue("/root/send/item6/clbs/ioflag", ioflag);
- }
-
- // 16. 생성삭제
- if (submit("TXPID10102")) {
- //model.removeNode("/root/main/list1/clbs["+iSel_Row+"]");
- //grd_clbsmast.refresh();
- //grd_clbsmast.row = iSel_Row;
- }
-
- // 17. 생성삭제로그 자동호출
- btn_logview.dispatch("DOMActivate");
-
- messageBox("생성삭제되었는지 반드시 로그를 확인하시기 바랍니다. 생성삭제 호출", "I001"); //I001=처리되었습니다.
- }
- } else {
- messageBox("잠금설정상태입니다. 삭제", "E001"); ///할 수 없습니다.
- }
- }
- }
- else {
- messageBox("선별심사모드에서는 생성삭제", "E001"); ///선별심사모드에서는 생성삭제 할 수 없습니다.
- }
- }
- //-------------------------------------------------------------------
- // 2011.11.08 syjung
- // 명세서삭제(입원,외래사후심사 대상자조회에서 "명세서삭제"버튼 눌렀을 때
- //-------------------------------------------------------------------
- function pidfDelClbsData(ioflag, deptcd) {
-
- if (grd_clbsmast.visible == true) {
- var iSel_Row = grd_clbsmast.selectedrow(0);
- var clamkey = model.getValue("/root/main/list1/clbs[" + iSel_Row + "]/clamkey");
- var pid = model.getValue("/root/main/list1/clbs[" + iSel_Row + "]/pid");
- var pidsn = model.getValue("/root/main/list1/clbs[" + iSel_Row + "]/pidsn");
- var patnm = model.getValue("/root/main/list1/clbs[" + iSel_Row + "]/patnm");
- var clamendyn = model.getValue("/root/main/list1/clbs[" + iSel_Row + "]/clamendyn");
- var lockyn = model.getValue("/root/main/list1/clbs[" + iSel_Row + "]/lockyn");
-
- if (clamkey != "" && clamkey != '-') {
- //if (clamendyn == "A" ) {
- if (lockyn != "Y" ) {
- var ans = messageBox("[ 환자명:" + patnm + ", 등록번호:" + pid + ", 순번:" + pidsn + " ] 명세서를 삭제합니다. 삭제된 명세서는 복구할 수 없습니다. 계속 ", "S001"); ///하시려면 예(Yes)\n아니면 아니오(No)
- if (ans == 6) { // 6: yes, 7:no, 2:cancel
- model.setValue("/root/send/item4/clbs/clamym", model.getValue("/root/main/list1/clbs[" + iSel_Row + "]/clamym"));
- model.setValue("/root/send/item4/clbs/clamdg", model.getValue("/root/main/list1/clbs[" + iSel_Row + "]/clamdg"));
- model.setValue("/root/send/item4/clbs/pid", model.getValue("/root/main/list1/clbs[" + iSel_Row + "]/pid"));
- model.setValue("/root/send/item4/clbs/pidsn", model.getValue("/root/main/list1/clbs[" + iSel_Row + "]/pidsn"));
- model.setValue("/root/send/item4/clbs/clamkey", model.getValue("/root/main/list1/clbs[" + iSel_Row + "]/clamkey"));
- model.setValue("/root/send/item4/clbs/ioflag", ioflag);
- model.setValue("/root/send/item4/clbs/instcd", getUserInfo("posinstcd"));
-
- if (submit("TXPID20303")) {
- model.removeNode("/root/main/list1/clbs["+iSel_Row+"]");
- grd_clbsmast.refresh();
- grd_clbsmast.row = iSel_Row;
- }
- }
- } else {
- messageBox("잠금설정상태입니다. 삭제", "E001"); ///할 수 없습니다.
- }
- }
- }
- else {
- messageBox("선별심사모드에서는 생성삭제", "E001"); ///선별심사모드에서는 생성삭제 할 수 없습니다.
- }
-
- }
- //-----------------------------------------------------------------------------------
- // 결과조회 : SMAER00800_결과조회 (외래, 입원사후대상자조회에서 마우스 팝업으로 조회)
- //-------------------------------------------------------------
- function pidfOrderRsltSrch() {
-
- var row = grd_clbsmast.row;
- var pid = model.getValue("/root/main/list1/clbs[" + row + "]/pid");
- if (pid) { // 조회된 심사대상자가 있으면
- // ast/examcureweb/xrw/SMAER00800_결과조회.xrw
- model.makeValue("/root/hidden/smaer00800/cond/srchdate1", model.getValue("/root/main/list1/clbs[" + row + "]/indd"));
- model.makeValue("/root/hidden/smaer00800/cond/srchdate2", getCurrentDate()); // (dateHelper.js) 현재날짜 반환
- model.makeValue("/root/hidden/smaer00800/cond/srchpid", model.getValue("/root/main/list1/clbs[" + row + "]/pid"));
- model.makeValue("/root/hidden/smaer00800/cond/wardcd", ""); //model.getValue("/root/main/item1/iteminfo/wardcd"));
- model.makeValue("/root/hidden/smaer00800/cond/roomcd", ""); //model.getValue("/root/main/item1/iteminfo/roomcd"));
- model.makeValue("/root/hidden/smaer00800/cond/listflag", "P");
- model.makeValue("/root/hidden/smaer00800/cond/deptcd", model.getValue("/root/main/list1/clbs[" + row + "]/orddeptcd"));
- model.makeNode("/root/hidden/smaer00800/cond/drid");
- model.makeNode("/root/hidden/smaer00800/cond/chkcheck");
- model.makeValue("/root/hidden/smaer00800/cond/chkcheck1", "A");
- model.makeValue("/root/hidden/smaer00800/cond/chkcheck2", "B");
- model.makeValue("/root/hidden/smaer00800/cond/chkcheck3", "C");
- model.makeValue("/root/hidden/smaer00800/cond/chkcheck4", "D");
- model.makeValue("/root/hidden/smaer00800/cond/chkcheck5", "E");
- model.makeValue("/root/hidden/smaer00800/cond/chkcheck6", "F");
- model.makeValue("/root/hidden/smaer00800/cond/chkcheck7", "G");
- model.makeNode("/root/hidden/smaer00800/cond/chkcheck8");
- model.makeNode("/root/hidden/smaer00800/cond/tabflag");
- model.makeNode("/root/hidden/smaer00800/cond/mdlcd");
- model.makeNode("/root/hidden/smaer00800/cond/examgubun");
- model.makevalue("/root/hidden/smaer00800/cond/srchflag", "B");
- model.makevalue("/root/hidden/smaer00800/cond/hlaflag", "N");
- model.makevalue("/root/hidden/smaer00800/cond/prntfrmflag", "");
-
- //modal("SMAER00800", "1", "10", "10", "SMAER00800", "/root/hidden/smaer00800/cond", "/root/send/data/singdata", "", ""); // SMAER00800_결과조회
- open("SMAER00800", "1", "10", "10", "SMAER00800", "/root/hidden/smaer00800/cond", "/root/send/data/singdata", "", ""); // SMAER00800_결과조회
- }
- }
- //-----------------------------------------------------------------------------------
- // 결과조회 : SMAER00800_결과조회 (외래사후대상자조회 선별조회 에서 마우스 팝업으로 조회)
- //-------------------------------------------------------------
- function pidfOrderRsltSrch2() {
-
- var row = grd_specclbs.row;
- var pid = model.getValue("/root/main/list1/clbs[" + row + "]/pid");
- if (pid) { // 조회된 심사대상자가 있으면
- // ast/examcureweb/xrw/SMAER00800_결과조회.xrw
- model.makeValue("/root/hidden/smaer00800/cond/srchdate1", model.getValue("/root/main/list1/clbs[" + row + "]/indd"));
- model.makeValue("/root/hidden/smaer00800/cond/srchdate2", getCurrentDate()); // (dateHelper.js) 현재날짜 반환
- model.makeValue("/root/hidden/smaer00800/cond/srchpid", model.getValue("/root/main/list1/clbs[" + row + "]/pid"));
- model.makeValue("/root/hidden/smaer00800/cond/wardcd", ""); //model.getValue("/root/main/item1/iteminfo/wardcd"));
- model.makeValue("/root/hidden/smaer00800/cond/roomcd", ""); //model.getValue("/root/main/item1/iteminfo/roomcd"));
- model.makeValue("/root/hidden/smaer00800/cond/listflag", "P");
- model.makeValue("/root/hidden/smaer00800/cond/deptcd", model.getValue("/root/main/list1/clbs[" + row + "]/orddeptcd"));
- model.makeNode("/root/hidden/smaer00800/cond/drid");
- model.makeNode("/root/hidden/smaer00800/cond/chkcheck");
- model.makeValue("/root/hidden/smaer00800/cond/chkcheck1", "A");
- model.makeValue("/root/hidden/smaer00800/cond/chkcheck2", "B");
- model.makeValue("/root/hidden/smaer00800/cond/chkcheck3", "C");
- model.makeValue("/root/hidden/smaer00800/cond/chkcheck4", "D");
- model.makeValue("/root/hidden/smaer00800/cond/chkcheck5", "E");
- model.makeValue("/root/hidden/smaer00800/cond/chkcheck6", "F");
- model.makeValue("/root/hidden/smaer00800/cond/chkcheck7", "G");
- model.makeNode("/root/hidden/smaer00800/cond/chkcheck8");
- model.makeNode("/root/hidden/smaer00800/cond/tabflag");
- model.makeNode("/root/hidden/smaer00800/cond/mdlcd");
- model.makeNode("/root/hidden/smaer00800/cond/examgubun");
- model.makevalue("/root/hidden/smaer00800/cond/srchflag", "B");
- model.makevalue("/root/hidden/smaer00800/cond/hlaflag", "N");
- model.makevalue("/root/hidden/smaer00800/cond/prntfrmflag", "");
-
- //modal("SMAER00800", "1", "10", "10", "SMAER00800", "/root/hidden/smaer00800/cond", "/root/send/data/singdata", "", ""); // SMAER00800_결과조회
- open("SMAER00800", "1", "10", "10", "SMAER00800", "/root/hidden/smaer00800/cond", "/root/send/data/singdata", "", ""); // SMAER00800_결과조회
- }
- }
- //--------------------------
- // KDRG 3.2 DRG분류번호 생성
- //--------------------------
- function pidfGetKDRGCode() {
- var fso,fileObj,inputStr='';
- var ForReading=1,ForWriting=2; // 화일/읽기 쓰기 지정을 쉽게하기 위한 변수
- // var gExecfilePath ='c:\\kdrg32batch\\kdrg30.exe';
- // var gWritefilePath ='c:\\kdrg32batch\\kdrg30.in';
- // var gReadfilePath ='c:\\kdrg32batch\\kdrg30.out';
- var gExecfilePath ='c:\\kdrg33\\kdrg33.exe';
- var gWritefilePath ='c:\\kdrg33\\kdrg33.in';
- var gReadfilePath ='c:\\kdrg33\\kdrg33.out';
-
- fso=new ActiveXObject('Scripting.FileSystemObject');
-
- // KDRG 3.2 배치 프로그램이 설치되어 있고 DRG분류번호가 '-'인 경우 실행
- if (fso.FileExists(gExecfilePath) && model.getValue("/root/main/item1/clbs/drgcd") == '-') {
-
- var cnt01=0, cnt02=0, cnt03=0, cnt04=0, cnt05=0; // 각 코드별 객수
-
- var code01Arr = Array();
- var code02Arr = Array();
- var code03Arr = Array();
- var code04Arr = Array();
- var code05Arr = Array();
-
- var i=1, k=0;
- var rowstaus;
- var diagcd = "";
- var unit = "";
- var codetype = "";
- var payflag = "";
- var basecd = "";
- var makeStr = "";
- var cldinodeList = instance1.selectNodes("/root/main/list1/cldi");
- var clodnodeList = instance1.selectNodes("/root/main/list2/clod");
- // 상병 및 처방갯수가 0개만 아닌 경우만 실행
- if (cldinodeList.length > 0 && clodnodeList.length > 0) {
-
- // 1. KDRG - 환자기본조회(요양기관번호,주민번호, 요야개시일, 입원일수, 진료결과, 입원시체중등..)
- makeStr += model.getValue("/root/main/item1/clbs/proccorpcd"); // (1).요양기관기호 : 1 8
- makeStr += model.getValue("/root/main/item1/clbs/patrrgstno"); // (2).주민번호 : 9 13
- makeStr += model.getValue("/root/main/item1/clbs/ordfromdd"); // (3).요양개시일 : 22 8
- makeStr += model.getValue("/root/main/item1/clbs/chosindayno").getLeftPad(3, "0"); // (4).입원일수 : 30 3
- makeStr += model.getValue("/root/main/item1/clbs/ordrsltcd"); // (5).진료결과 : 33 1
-
-
- // 2. KDRG - 진단코드조회
- for( i=1; i <= cldinodeList.length; i++) {
- rowstaus = model.getValue("/root/main/list1/cldi[" + i + "]/rowstat");
- if ( rowstaus != "D") { // 삭제아닌것만...
- diagcd = model.getValue("/root/main/list1/cldi[" + i + "]/diagcd");
- //diagcd = diagcd.getLeftPad(5, " ");
- diagcd = diagcd.getRightPad(5, " "); // 20100201 수정
- makeStr += diagcd
- if (i == 10) break;
- }
- }
- // 20100201 추가
- for( k=i; k <= 10; k++) {
- makeStr += " ";
- }
-
-
- // 3. KDRG - 적용수가코드(시술, 검사, 방사선, 주사및혈액제제, 마취및호흡치료)
- for( i=1; i <= clodnodeList.length; i++) {
- payflag = model.getValue("/root/main/list2/clod[" + i + "]/payflag");
- rowstaus = model.getValue("/root/main/list2/clod[" + i + "]/rowstat");
- //if (payflag == "0" || payflag == "9" || grd_clodhist.rowHidden(i) == false) {
- if ( payflag == "0" && rowstaus != "D" ) {
- unit = model.getValue("/root/main/list2/clod[" + i + "]/unit");
- basecd = model.getValue("/root/main/list2/clod[" + i + "]/basecd");
- basecd = basecd.substr(0, 5);
-
- if (unit >= "자1" && unit <= "자810") codetype = "01"; // 01. 시술코드
- else if (unit >= "저21" && unit <= "저891") codetype = "01";
- else if (unit >= "차1" && unit <= "차113") codetype = "01";
- else if (unit >= "처1" && unit <= "처102") codetype = "01";
-
- else if (unit >= "나610" && unit <= "나624") codetype = "02"; // 02. 검사코드
- else if (unit >= "나720" && unit <= "나729") codetype = "02";
- else if (unit >= "너681" && unit <= "너705") codetype = "02";
- else if (unit >= "너871" && unit <= "너874") codetype = "02";
- else if (unit >= "나750" && unit <= "나862") codetype = "02";
- else if (unit == "너961") codetype = "02";
-
- else if (unit >= "다201" && unit <= "다276") codetype = "03"; // 03. 방사선코드
- else if (unit >= "다401" && unit <= "다412-1") codetype = "03";
- else if (unit >= "더401" && unit <= "더402") codetype = "03";
-
- else if (unit >= "마1" && unit <= "마16" ) codetype = "04"; // 04. 주사및혈액제제코드
- else if (unit == "머1") codetype = "04";
- else if (unit >= "마102" && unit <= "마107") codetype = "04";
- else if (unit >= "파1" && unit <= "파2" ) codetype = "04";
-
- else if (unit >= "바21" && unit <= "바26") codetype = "05"; // 05. 마취및호흡치료코드
- else if (unit == "버51") codetype = "05";
- else if (unit >= "바31" && unit <= "바35") codetype = "05";
- else if (unit == "버71") codetype = "05";
- else if (unit >= "사30" && unit <= "사41") codetype = "05";
- else if (unit >= "서31" && unit <= "서36") codetype = "05";
- else codetype = "-";
-
- if (codetype == "01" ) {
- if (cnt01 == 10) continue;
- code01Arr[cnt01] = basecd.getRightPad(5, " ");
- cnt01++;
- } else if (codetype == "02") {
- if (cnt02 == 5) continue;
- code02Arr[cnt02] = basecd.getRightPad(5, " ");
- cnt02++;
- } else if (codetype == "03" && cnt01 != 5) {
- if (cnt03 == 5) continue;
- code03Arr[cnt03] = basecd.getRightPad(5, " ");
- cnt03++;
- } else if (codetype == "04" && cnt01 != 5) {
- if (cnt04 == 5) continue;
- code04Arr[cnt04] = basecd.getRightPad(5, " ");
- cnt04++;
- } else if (codetype == "05" && cnt01 != 5) {
- if (cnt05 == 5) continue;
- code05Arr[cnt05] = basecd.getRightPad(5, " ");
- cnt05++;
- }
- }
- }
-
- // (7). 시술코드1-10 (시작위치:84, 길이:50)
- for (k = 0; k < code01Arr.length; k++) {
- makeStr += code01Arr[k];
- }
- if (cnt01 != 10) {
- for ( i = 1; i <= (10 - cnt01); i++) {;
- makeStr += " ";
- }
- }
-
-
- // (8). 검사코드1-5 (시작위치:134, 길이:25)
- for (k = 0; k < code02Arr.length; k++) {
- makeStr += code02Arr[k];
- }
- if (cnt02 != 5) {
- for ( i = 1; i <= (5 - cnt02); i++) {
- makeStr += " ";
- }
- }
-
- // (9). 방사선코드1-5 (시작위치:159, 길이:25)
- for (k = 0; k < code03Arr.length; k++) {
- makeStr += code03Arr[k];
- }
- if (cnt03 != 5) {
- for ( i = 1; i <= (5 - cnt03); i++) {
- makeStr += " ";
- }
- }
-
- // (10). 주사및혈액제제코드1-5 (시작위치:184, 길이:25)
- for (k = 0; k < code04Arr.length; k++) {
- makeStr += code04Arr[k];
- }
- if (cnt04 != 5) {
- for ( i = 1; i <= (5 - cnt04); i++) {
- makeStr += " ";
- }
- }
-
- // (11). 마취및호흡치료코드1-5 (시작위치:209, 길이:25)
- for (k = 0; k < code05Arr.length; k++) {
- makeStr += code05Arr[k];
- }
- if (cnt05 != 5) {
- for ( i = 1; i <= (5 - cnt05); i++) {
- makeStr += " ";
- }
- }
-
- // (12). 알콜및약물중독재활치료코드 (시작위치:234, 길이:5)
- makeStr += " ";
-
- // (13). 부가코드1-5 (시작위치:239, 길이:25)
- for ( i = 1;i <= 5; i++) {
- makeStr += " ";
- }
-
- // (14). 입원시체중(g) : 만1세미만 기재 (시작위치:264, 길이:5)
- makeStr += "00000";
- // (15). 인공호흡시간(hour) : 만1세미만 기재 (시작위치:269, 길이:5) ==> 현재 EMR팀 미개발(2008-10-16)");
- makeStr += "00000";
-
- // (16). MDC (시작위치:274, 길이:3)
- makeStr += "000";
- // (17). ADRG (시작위치:277, 길이:4)
- makeStr += "0000";
- // (18). PCCL (시작위치:281, 길이:1)
- makeStr += "0";
- // (19). DRG (시작위치:282, 길이:6)
- makeStr += "000000";
- // (20). version (시작위치:288, 길이:8)
- makeStr += "00000000";
-
-
-
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
- // 1.기존파일 삭제 ==> 2.파일 쓰기 ==> 3.KDRG실행 ==> 4. Timer ==> 5.파일 읽기
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
- // 1.기존파일 삭제
- if (fso.FileExists(gWritefilePath)) {
- fso.DeleteFile(gWritefilePath); // kdrg30.in 삭제
- }
- if (fso.FileExists(gReadfilePath)) {
- fso.DeleteFile(gReadfilePath); // kdrg30.out 삭제
- }
-
- // 2. 파일 쓰기(kdrg30.in)
- fileObj=fso.CreateTextFile(gWritefilePath, true); // 쓰기 위한 화일을 변수에 개체를 할당한다.
- fileObj.WriteLine(makeStr);
- fileObj.Close(); // 화일을 닫는다.
-
- // kdrg30.in 파일이 있는 경우만 실행
- if (fso.FileExists(gWritefilePath)) {
-
- // 3. KDRG 실행
- //window.exec("cmd.exe", "/c cd c:\\KDRG32batch\\ && kdrg30.exe");
- window.exec("c:\\kdrg33\\kdrg33.exe","","c:\\kdrg33");
- // 4. kdrg30.out파일이 생성될때까지 timer
- //fTimer();
-
-
- // 5. 파일 읽기(kdrg30.out)
- var fileChk = true;
- var iCnt = 0, jCnt=0;
- while (fileChk) { // kdrg30.out 파일이 있는 경우만 실행
- if (fso.FileExists(gReadfilePath)) {
- fileObj = fso.OpenTextFile(gReadfilePath, ForReading); // 읽기 위한 화일을 변수에 개체를 할당한다.
-
- while (!fileObj.AtEndOfStream){
- if (!fileObj.AtEndOfLine){
- inputStr += fileObj.ReadLine();
- }
- }
-
- fileObj.Close();
- if (inputStr != "") {
- //alert(inputStr);
- //alert(inputStr.substr(273, 3)); // (16). MDC (시작위치:274, 길이:3)
- //alert(inputStr.substr(276, 4)); // (17). ADRG (시작위치:277, 길이:4)
- //alert(inputStr.substr(280, 1)); // (18). PCCL (시작위치:281, 길이:1)
- //alert(inputStr.substr(281, 6)); // (19). DRG (시작위치:282, 길이:6)
-
- // 6. KDRG코드 셋팅 (시작위치:282, 길이:6)
- model.setValue("/root/main/item1/clbs/drgcd", inputStr.substr(281, 6));
- opt_drgcd.refresh();
- fileChk = false;
- }
- } else {
- fileChk = true;
- }
- }
- }
- }
- }
- }
- //------------------------------
- // KDRG 번호 생성 (입원사후메인)
- //------------------------------
- function fSetKDRGpid() {
- var fso,fileObj = "";
- var ForReading=1,ForWriting=2; // 화일/읽기 쓰기 지정을 쉽게하기 위한 변수
- var gJobPath = "c:\\kdrg33";
- var gExecfilePath = "c:\\kdrg33\\kdrg33.exe";
- var gWritefilePath = "c:\\kdrg33\\kdrg33.in";
- var gReadfilePath = "c:\\kdrg33\\kdrg33.out";
- var makeStr,inputStr,kdrgNo = "";
- // 실행화일 유무 체크
- fso = new ActiveXObject("Scripting.FileSystemObject");
- if ( !fso.FileExists(gExecfilePath) ) {
- messageBox( "실행화일이 PC에 존재하지 않습니다.\n\n"
- + "KDRG 3.3 ver 을 설치하세요.\n\n"
- + gExecfilePath + " 의 존재여부를 확인하세요"
- ,"");
- return;
- }
- // 최종 사용자 확인
- var message = messageBox("대상자의 DRG 정보를 생성합니다.\n\n"
- +"계속 진행"
- ,"S001");
- if ( message != 6 ) { return; }
- model.resetInstanceNode("/root/send/item4/clbs"); // 공백으로 삭제
- model.resetInstanceNode("/root/hidden/item6/kdrginfo"); // 공백으로 삭제
- model.setValue("/root/send/item4/clbs/clamym", model.getValue("/root/main/item1/clbs/clamym"));
- model.setValue("/root/send/item4/clbs/clamdg", model.getValue("/root/main/item1/clbs/clamdg"));
- model.setValue("/root/send/item4/clbs/pid", model.getValue("/root/main/item1/clbs/pid"));
- model.setValue("/root/send/item4/clbs/pidsn", model.getValue("/root/main/item1/clbs/pidsn"));
- //model.setValue("/root/send/item4/clbs/instcd", getUserInfo("posinstcd"));
- model.setValue("/root/send/item4/clbs/instcd", model.getValue("/root/main/item1/clbs/instcd"));
-
- // 에러시 바로 종료
- if ( !submit("TXPID20305") ) { return; }
- // 상병,처방 없으면 다음 대상자로..
- if ( model.getValue("/root/hidden/item6/kdrginfo/ordyn") != "Y" ) { return; }
- // string 생성
- makeStr = "";
- makeStr += model.getValue("/root/hidden/item6/kdrginfo/proccorpcd"); // (1) 요양기관기호
- makeStr += model.getValue("/root/hidden/item6/kdrginfo/resno"); // (2) 주민번호
- makeStr += model.getValue("/root/hidden/item6/kdrginfo/ordfromdd"); // (3) 요양개시일
- makeStr += model.getValue("/root/hidden/item6/kdrginfo/chosindayno"); // (4) 입원일수
- makeStr += model.getValue("/root/hidden/item6/kdrginfo/ordrsltcd"); // (5) 진료결과
- makeStr += model.getValue("/root/hidden/item6/kdrginfo/diag").getRightPad(50," "); // (6) 진단코드
- makeStr += model.getValue("/root/hidden/item6/kdrginfo/optr").getRightPad(50," "); // (7) 시술코드
- makeStr += model.getValue("/root/hidden/item6/kdrginfo/exam").getRightPad(25," "); // (8) 검사코드
- makeStr += model.getValue("/root/hidden/item6/kdrginfo/xray").getRightPad(25," "); // (9) 방사선코드
- makeStr += model.getValue("/root/hidden/item6/kdrginfo/ijbd").getRightPad(25," "); // (10) 주사및혈액
- makeStr += model.getValue("/root/hidden/item6/kdrginfo/anst").getRightPad(25," "); // (11) 마취및호흡치료
- makeStr += " ".getRightPad(5," "); // (12) 알콜및약물중독재활치료코드
- makeStr += " ".getRightPad(25," "); // (13) 부가코드1-5
- makeStr += model.getValue("/root/hidden/item6/kdrginfo/mt027"); // (14) 입원시체중
- makeStr += model.getValue("/root/hidden/item6/kdrginfo/mt026"); // (15) 인공호흡시간
- makeStr += " ".getRightPad(3," "); // (16) MDC
- makeStr += " ".getRightPad(4," "); // (17) ADRG
- makeStr += " "; // (18) PCCL
- makeStr += " ".getRightPad(6," "); // (19) DRG분류번호
- makeStr += " ".getRightPad(8," "); // (20) version
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
- // 1.기존파일 삭제 ==> 2.파일 쓰기 ==> 3.KDRG실행 ==> 4.파일 읽기
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
- // 1.기존파일 삭제
- if (fso.FileExists(gWritefilePath)) {
- fso.DeleteFile(gWritefilePath); // kdrg30.in 삭제
- }
- if (fso.FileExists(gReadfilePath)) {
- fso.DeleteFile(gReadfilePath); // kdrg30.out 삭제
- }
- // 2. 파일 쓰기(kdrg30.in)
- fileObj=fso.CreateTextFile(gWritefilePath, true); // 쓰기 위한 화일을 변수에 개체를 할당한다.
- fileObj.WriteLine(makeStr);
- fileObj.Close(); // 화일을 닫는다.
-
- // kdrg33.in 파일이 없으면 다음 대상자로..
- if ( !fso.FileExists(gWritefilePath) ) { return; }
-
- // 3. KDRG 실행
- window.exec(gExecfilePath,"",gJobPath);
- // 4. 파일읽기
- var fileChk = true;
- while (fileChk) { // kdrg33.out 파일이 있는 경우만 실행
- if (fso.FileExists(gReadfilePath)) {
- fileObj = fso.OpenTextFile(gReadfilePath, ForReading); // 읽기 위한 화일을 변수에 개체를 할당한다.
-
- inputStr = ""; // 초기화
- while (!fileObj.AtEndOfStream){
- if (!fileObj.AtEndOfLine){
- inputStr += fileObj.ReadLine();
- }
- }
- fileObj.Close();
- if ( inputStr != "" ) {
- kdrgNo = inputStr.substr(281, 6).getTrim();
- fileChk = false;
- }
- }
- }
-
- // 값이 없으면 다음 대상자로
- if ( kdrgNo == "" ) { return; }
-
- // KDRG번호 저장
- model.resetInstanceNode("/root/hidden/item7/kdrgval"); // 공백으로 삭제
- model.setValue("/root/send/item4/clbs/kdrgno",kdrgNo);
- if ( !submit("TXPID20306") ) { return; }
-
- // 그리드에 표시
- model.setValue("/root/main/item1/clbs/drgcd" ,kdrgNo);
- model.setValue("/root/main/item1/clbs/kstage",model.getValue("/root/hidden/item7/kdrgval/kstage"));
- model.setValue("/root/main/item1/clbs/kmdc" ,model.getValue("/root/hidden/item7/kdrgval/kmdc"));
- model.setValue("/root/main/item1/clbs/kdrgnm",model.getValue("/root/hidden/item7/kdrgval/kdrgnm"));
- opt_drgcd.refresh();
- opt_kstage.refresh();
- opt_kdrgnm.refresh();
-
- // 대상자조회 화면에도 표시
- var trgtManWindow = getChildWindow("SMPID20200"); // SMPID20200_입원사후심사대상자조회.xrw
- if (trgtManWindow != null) {
- var selectedRow = model.getValue("/root/hidden/smpid20200/rslt/selectedRow");
- if (selectedRow) {
- var trgtmanlist = trgtManWindow.instance1.selectSingleNode("/root/main/list1/clbs");
- if (trgtmanlist != null) {
- var srchmode = trgtManWindow.model.getValue("/root/hidden/clbs/srchmode");
- if (srchmode != "specclbs") { // 선별심사 모드 아닌경우
- if ( trgtManWindow.model.getValue("/root/main/list1/clbs["+ selectedRow +"]/clamym") == model.getValue("/root/main/item1/clbs/clamym")
- && trgtManWindow.model.getValue("/root/main/list1/clbs["+ selectedRow +"]/clamdg") == model.getValue("/root/main/item1/clbs/clamdg")
- && trgtManWindow.model.getValue("/root/main/list1/clbs["+ selectedRow +"]/pid") == model.getValue("/root/main/item1/clbs/pid")
- && trgtManWindow.model.getValue("/root/main/list1/clbs["+ selectedRow +"]/pidsn") == model.getValue("/root/main/item1/clbs/pidsn")
- ) {
- trgtManWindow.model.setValue("/root/main/list1/clbs["+ selectedRow +"]/drgcd", kdrgNo);
- trgtManWindow.model.setValue("/root/main/list1/clbs["+ selectedRow +"]/kstage", model.getValue("/root/hidden/item7/kdrgval/kstage"));
- trgtManWindow.model.setValue("/root/main/list1/clbs["+ selectedRow +"]/kmdc" , model.getValue("/root/hidden/item7/kdrgval/kmdc"));
- trgtManWindow.model.setValue("/root/main/list1/clbs["+ selectedRow +"]/kdrgnm", model.getValue("/root/hidden/item7/kdrgval/kdrgnm"));
- }
- }
- }
- }
- }
-
- }
- //------------------------------------------------------------
- // KDRG 처방정보 생성 _ 대상자 조회 화면 (pam.pidhkdrg) - 20100709
- //------------------------------------------------------------
- function fSetKDRGclodlist() {
- var fso,fileObj = "";
- var ForReading=1,ForWriting=2; // 화일/읽기 쓰기 지정을 쉽게하기 위한 변수
- var gJobPath = "c:\\kdrg33";
- var gExecfilePath = "c:\\kdrg33\\kdrg33.exe";
- var gWritefilePath = "c:\\kdrg33\\kdrg33.in";
- var gReadfilePath = "c:\\kdrg33\\kdrg33.out";
- var summit_error = false;
- var makeStr,inputStr,kdrgNo = "";
- // 실행화일 유무 체크
- fso = new ActiveXObject("Scripting.FileSystemObject");
- if ( !fso.FileExists(gExecfilePath) ) {
- messageBox( "실행화일이 PC에 존재하지 않습니다.\n\n"
- + "KDRG 3.3 ver 을 설치하세요.\n\n"
- + gExecfilePath + " 의 존재여부를 확인하세요"
- ,"");
- return;
- }
- // 대상자 선택여부 확인
- if ( grd_clbsmast.selectedRows == 0
- || grd_clbsmast.rows <= 1
- ) {
- messageBox("DRG 정보를 생성할 대상자를", "C002"); // DRG 정보를 생성할 대상자를 선택하십시오.
- return;
- }
- // 최종 사용자 확인
- var message = messageBox("선택된 대상자의 DRG 정보를 생성합니다.\n\n"
- +"(기존에 생성된 정보는 삭제후 다시 생성됩니다.)\n\n"
- +"계속 진행"
- ,"S001");
- if ( message != 6 ) {
- return;
- }
-
- // 로딩창열기
- var sWindowMsg = "DRG 정보 생성중입니다....";
- callLoadingWindow(sWindowMsg);
- // 선택된 모든 대상자의 DRG 적용 처방정보를 생성한다.
- for (var i = 0; i < grd_clbsmast.selectedRows; i++) {
- model.resetInstanceNode("/root/send/item4/clbs"); // 공백으로 삭제
- model.resetInstanceNode("/root/hidden/item6/kdrginfo"); // 공백으로 삭제
- var row = grd_clbsmast.selectedrow(i);
- model.setValue("/root/send/item4/clbs/clamym", model.getValue("/root/main/list1/clbs[" + row + "]/clamym"));
- model.setValue("/root/send/item4/clbs/clamdg", model.getValue("/root/main/list1/clbs[" + row + "]/clamdg"));
- model.setValue("/root/send/item4/clbs/pid", model.getValue("/root/main/list1/clbs[" + row + "]/pid"));
- model.setValue("/root/send/item4/clbs/pidsn", model.getValue("/root/main/list1/clbs[" + row + "]/pidsn"));
- model.setValue("/root/send/item4/clbs/instcd", getUserInfo("posinstcd"));
-
- // 에러시 바로 종료
- if ( !submit("TXPID20305") ) {
- summit_error = true;
- break;
- }
-
- // 상병,처방 없으면 다음 대상자로..
- if ( model.getValue("/root/hidden/item6/kdrginfo/ordyn") != "Y" ) {
- continue;
- }
-
- // string 생성
- makeStr = "";
- makeStr += model.getValue("/root/hidden/item6/kdrginfo/proccorpcd"); // (1) 요양기관기호
- makeStr += model.getValue("/root/hidden/item6/kdrginfo/resno"); // (2) 주민번호
- makeStr += model.getValue("/root/hidden/item6/kdrginfo/ordfromdd"); // (3) 요양개시일
- makeStr += model.getValue("/root/hidden/item6/kdrginfo/chosindayno"); // (4) 입원일수
- makeStr += model.getValue("/root/hidden/item6/kdrginfo/ordrsltcd"); // (5) 진료결과
- makeStr += model.getValue("/root/hidden/item6/kdrginfo/diag").getRightPad(50," "); // (6) 진단코드
- makeStr += model.getValue("/root/hidden/item6/kdrginfo/optr").getRightPad(50," "); // (7) 시술코드
- makeStr += model.getValue("/root/hidden/item6/kdrginfo/exam").getRightPad(25," "); // (8) 검사코드
- makeStr += model.getValue("/root/hidden/item6/kdrginfo/xray").getRightPad(25," "); // (9) 방사선코드
- makeStr += model.getValue("/root/hidden/item6/kdrginfo/ijbd").getRightPad(25," "); // (10) 주사및혈액
- makeStr += model.getValue("/root/hidden/item6/kdrginfo/anst").getRightPad(25," "); // (11) 마취및호흡치료
- makeStr += " ".getRightPad(5," "); // (12) 알콜및약물중독재활치료코드
- makeStr += " ".getRightPad(25," "); // (13) 부가코드1-5
- makeStr += model.getValue("/root/hidden/item6/kdrginfo/mt027"); // (14) 입원시체중
- makeStr += model.getValue("/root/hidden/item6/kdrginfo/mt026"); // (15) 인공호흡시간
- makeStr += " ".getRightPad(3," "); // (16) MDC
- makeStr += " ".getRightPad(4," "); // (17) ADRG
- makeStr += " "; // (18) PCCL
- makeStr += " ".getRightPad(6," "); // (19) DRG분류번호
- makeStr += " ".getRightPad(8," "); // (20) version
-
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
- // 1.기존파일 삭제 ==> 2.파일 쓰기 ==> 3.KDRG실행 ==> 4.파일 읽기
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
- // 1.기존파일 삭제
- if (fso.FileExists(gWritefilePath)) {
- fso.DeleteFile(gWritefilePath); // kdrg30.in 삭제
- }
- if (fso.FileExists(gReadfilePath)) {
- fso.DeleteFile(gReadfilePath); // kdrg30.out 삭제
- }
- // 2. 파일 쓰기(kdrg30.in)
- fileObj=fso.CreateTextFile(gWritefilePath, true); // 쓰기 위한 화일을 변수에 개체를 할당한다.
- fileObj.WriteLine(makeStr);
- fileObj.Close(); // 화일을 닫는다.
- // kdrg33.in 파일이 없으면 다음 대상자로..
- if ( !fso.FileExists(gWritefilePath) ) { continue; }
-
- // 3. KDRG 실행
- window.exec(gExecfilePath,"",gJobPath);
- //window.exec("cmd.exe -b"," /c cd c:\\kdrg33\\ && kdrg33.exe");
- // 4. 파일읽기
- var fileChk = true;
- while (fileChk) { // kdrg33.out 파일이 있는 경우만 실행
- if (fso.FileExists(gReadfilePath)) {
- fileObj = fso.OpenTextFile(gReadfilePath, ForReading); // 읽기 위한 화일을 변수에 개체를 할당한다.
-
- inputStr = ""; // 초기화
- while (!fileObj.AtEndOfStream){
- if (!fileObj.AtEndOfLine){
- inputStr += fileObj.ReadLine();
- }
- }
- fileObj.Close();
- if ( inputStr != "" ) {
- kdrgNo = inputStr.substr(281, 6).getTrim();
- fileChk = false;
- }
- }
- }
-
- // 값이 없으면 다음 대상자로
- if ( kdrgNo == "" ) { continue; }
-
- // KDRG번호 저장
- model.resetInstanceNode("/root/hidden/item7/kdrgval"); // 공백으로 삭제
- model.setValue("/root/send/item4/clbs/kdrgno",kdrgNo);
- if ( !submit("TXPID20306") ) {
- summit_error = true;
- break;
- }
- // 그리드에 표시
- model.setValue("/root/main/list1/clbs[" + row + "]/drgcd" ,kdrgNo);
- model.setValue("/root/main/list1/clbs[" + row + "]/kstage",model.getValue("/root/hidden/item7/kdrgval/kstage"));
- model.setValue("/root/main/list1/clbs[" + row + "]/kmdc" ,model.getValue("/root/hidden/item7/kdrgval/kmdc"));
- model.setValue("/root/main/list1/clbs[" + row + "]/kdrgnm",model.getValue("/root/hidden/item7/kdrgval/kdrgnm"));
-
- }
-
- // 로딩창닫기
- removeLoadingWindow();
-
- if ( summit_error ) {
- messageBox("DRG 정보 생성중 오류발생","");
- } else {
- messageBox("DRG 정보 생성 완료","");
- }
- }
- //-----------------------------------
- //명세서 KDRG 상세정보 조회 (대상자조회)
- //-----------------------------------
- function fDocuKdrgViewList() {
- var irow = grd_clbsmast.row;
- var clamkey = model.getValue("/root/main/list1/clbs[" + irow + "]/clamkey");
- if (clamkey) {
- model.setValue("/root/hidden/smpid23300/cond/clamym", model.getValue("/root/main/list1/clbs[" + irow + "]/clamym"));
- model.setValue("/root/hidden/smpid23300/cond/clamdg", model.getValue("/root/main/list1/clbs[" + irow + "]/clamdg"));
- model.setValue("/root/hidden/smpid23300/cond/pid", model.getValue("/root/main/list1/clbs[" + irow + "]/pid"));
- model.setValue("/root/hidden/smpid23300/cond/pidsn", model.getValue("/root/main/list1/clbs[" + irow + "]/pidsn"));
- model.setValue("/root/hidden/smpid23300/cond/patnm", model.getValue("/root/main/list1/clbs[" + irow + "]/patnm"));
- model.setValue("/root/hidden/smpid23300/cond/insukind", model.getValue("/root/main/list1/clbs[" + irow + "]/insukindcd"));
- model.setValue("/root/hidden/smpid23300/cond/suppkind", model.getValue("/root/main/list1/clbs[" + irow + "]/suppkindcd"));
- model.setValue("/root/hidden/smpid23300/cond/orddeptcd", model.getValue("/root/main/list1/clbs[" + irow + "]/orddeptcd"));
- model.setValue("/root/hidden/smpid23300/cond/indd", model.getValue("/root/main/list1/clbs[" + irow + "]/indd"));
-
- modal("SMPID23300", "1", "50", "100", "SMPID23300", "/root/hidden/smpid23300/cond", "/root/init/item1", "", ""); // SMPID23300_KDRG상세정보.xrw
- }
- }
- //-----------------------------------
- //명세서 KDRG 상세정보 조회 (심사메인)
- //-----------------------------------
- function fDocuKdrgViewPid() {
- var pid = model.getValue("/root/main/item1/clbs/pid");
- if (pid) {
- model.setValue("/root/hidden/smpid23300/cond/clamym", model.getValue("/root/main/item1/clbs/clamym"));
- model.setValue("/root/hidden/smpid23300/cond/clamdg", model.getValue("/root/main/item1/clbs/clamdg"));
- model.setValue("/root/hidden/smpid23300/cond/pid", model.getValue("/root/main/item1/clbs/pid"));
- model.setValue("/root/hidden/smpid23300/cond/pidsn", model.getValue("/root/main/item1/clbs/pidsn"));
- model.setValue("/root/hidden/smpid23300/cond/patnm", model.getValue("/root/main/item1/clbs/patnm"));
- model.setValue("/root/hidden/smpid23300/cond/insukind", model.getValue("/root/main/item1/clbs/insukindcd"));
- model.setValue("/root/hidden/smpid23300/cond/suppkind", model.getValue("/root/main/item1/clbs/suppkindcd"));
- model.setValue("/root/hidden/smpid23300/cond/orddeptcd", model.getValue("/root/main/item1/clbs/orddeptcd"));
- model.setValue("/root/hidden/smpid23300/cond/indd", model.getValue("/root/main/item1/clbs/indd"));
-
- modal("SMPID23300", "1", "50", "100", "SMPID23300", "/root/hidden/smpid23300/cond", "/root/init/item1", "", ""); // SMPID23300_KDRG상세정보.xrw
- }
- }
|