123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463 |
- /*
-
- 투약기록(SMMNR04500_투약기록 조회.xrw - JScript )
- - Version :
- 1) : Ver.1.00.01
- */
- var xCondPath = "/root/main/cond";
- var xDrugListPath = "/root/main/druglist/druglist";
- var xWardPatListPath = "/root/main/wardpatinfo/wardpatlist";
- var xPatInfoPath = "/root/main/paminfo/pamlist";
- var xDschPatInfoPath = "/root/main/patinfo/patinfolist";
- /**
- * @group :
- * @ver : 2007.06.23
- * @by : 최경용
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 투약기록 조회 초기값 셋팅 및 초기조회
- * @param :
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fInitialize(){
-
- // 일자 초기화
- fnDateInit();
-
- // 환자정보 조회
- var sPamInfo = getGlobalVariable("paminfo");
- setCSVToNode("/root/main/paminfo",sPamInfo,"pamlist");
- var sPID = model.getValue(xPatInfoPath + "/pid");
- var sIndd = model.getValue(xPatInfoPath + "/indd");
- var sCretno = model.getValue(xPatInfoPath + "/cretno");
- var sWardCd = model.getValue(xPatInfoPath + "/wardcd");
- var sRoomCd = model.getValue(xPatInfoPath + "/roomcd");
- submit("TRMNR00601");
- grd_druglist.removeRow(true);
- grd_patlist.removeRow(true);
- if(sPID == ""){
- model.setValue("/root/main/cond/wardcd", getUserInfo("dutplcecd"));
-
- fGetPatList();
- //-----------------------------(20080906)
- fSetsettingrnid();
- //-----------------------------(20080906)
- fGetRoomList();
-
- }else if(model.getValue("/root/hidden/cond/pid") != ""){//보험
- model.setValue(xCondPath + "/pid", model.getValue("/root/hidden/cond/pid"));
- model.setValue(xCondPath + "/pid_search", model.getValue("/root/hidden/cond/pid"));
- model.setValue(xCondPath + "/indd", model.getValue("/root/hidden/cond/indd"));
- model.setValue(xCondPath + "/cretno", model.getValue("/root/hidden/cond/cretno"));
- //----------------(20080715)
- model.setValue(xCondPath + "/medfromdd", model.getValue("/root/hidden/cond/medrfromdd"));
- model.setValue(xCondPath + "/medtodd", model.getValue("/root/hidden/cond/medrtodd"));
- //------------------
- fGetPatList();
- //-----------------------------(20080906)
- fSetsettingrnid();
- //-----------------------------(20080906)
- fGetRoomList();
- grd_patlist.row = 1;
- grd_patlist.dispatch("onentercell");
- fGetDrugList();
- }else{//상단정보
- model.setValue(xCondPath + "/wardcd", sWardCd);
- fGetPatList();
- //-----------------------------(20080906)
- fSetsettingrnid();
- //-----------------------------(20080906)
- model.setValue(xCondPath + "/roomcd", sRoomCd);
- fGetRoomList();
- for(var i = 1; i <= getNodesetCount(xWardPatListPath); i++){
- if(model.getValue(xWardPatListPath + "[" + i + "]/pid") == sPID){
- model.setFocus("grd_patlist");
- grd_patlist.row = i;
- grd_patlist.dispatch("onentercell");
- fGetDrugList();
- }
- }
- }
-
- //원본 grd_druglist.frozenCols = grd_druglist.colRef("prcpvol");
- grd_druglist.frozenCols = grd_druglist.colRef("abbrnm"); // [TASK번호:33173] 투약기록조회 틀 고정 : ~ 경로까지_20091008(ByJA)
- model.refresh();
- }
- /**
- * @group :
- * @ver : 2008.09.06
- * @by :
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 내환자가 설정되어 있으면 자동으로 내환자설정시키기(성공)
- * @param :
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fSetsettingrnid(){
- var sUserId = getUserId();
- var sUserIdFind = ""
-
- for(i = 1; i <= getNodesetCount("/root/main/wardpatinfo/settingrn"); i++ ) {
- sUserIdFind = model.getValue("/root/main/wardpatinfo/settingrn["+ i +"]/settingrnid");
- if (sUserId == sUserIdFind) {
- model.setValue("/root/main/cond/settingrnid", sUserIdFind);
- model.refresh();
- fGetPatList();
- return;
- }
- }
- }
- /**
- * @group :
- * @ver : 2007.06.23
- * @by : 최경용
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 투약기록 병동별 병실 리스트 조회
- * @param :
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fGetRoomList(){
- if(model.getValue(xCondPath + "/settingrnid") == ""){
- model.setValue(xCondPath + "/roomflag", "");
- }else{
- model.setValue(xCondPath + "/roomflag", "settingrnid");
- }
- model.resetInstanceNode("/root/send/reqdata");
- model.copynode("/root/send/reqdata", xCondPath);
-
- //----------------------(20080922)
- model.removenodeset("/root/main/druglist/druglist");
- //----------------------(20080922)
- submit("TRMNR00602");
- }
- /**
- * @group :
- * @ver : 2007.06.23
- * @by : 최경용
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 투약기록 조회
- * @param :
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fGetDrugList(){
- var row = grd_patlist.row;
- var pid = "";
- var indd = "";
- var cretno = "";
-
- //---------------------(20080510)
- // 환자정보 보이기
- if (row > 0 ) {
- model.setValue("/root/main/pidinfo/roomcd", model.getValue(xWardPatListPath + "[" + row + "]/roomcd"));
- model.setValue("/root/main/pidinfo/pid", model.getValue(xWardPatListPath + "[" + row + "]/pid"));
- model.setValue("/root/main/pidinfo/patnm", model.getValue(xWardPatListPath + "[" + row + "]/patnm"));
- model.setValue("/root/main/pidinfo/sa", model.getValue(xWardPatListPath + "[" + row + "]/sexage"));
- model.setValue("/root/main/pidinfo/rrgstno", model.getValue(xWardPatListPath + "[" + row + "]/rrgstno"));
- }
- //-------------------------------------------------
-
- if(model.getValue(xCondPath + "/acpstatyn") == "true"){//등록번호로 조회시
- //model.resetInstanceNode("/root/send/reqdata");
-
- model.setValue(xCondPath + "/pid", xCondPath + "/pid_search");
- model.removeNode("/root/send/reqdata");
- model.makeNode("/root/send/reqdata");
- model.copynode("/root/send/reqdata", xCondPath);
- submit("TRMNR04501");
- }else{//환자 리스트에서 조회시
- if(row > 0){
- pid = model.getValue(xWardPatListPath + "[" + row + "]/pid");
- indd = model.getValue(xWardPatListPath + "[" + row + "]/indd");
- cretno = model.getValue(xWardPatListPath + "[" + row + "]/cretno");
- model.setValue(xCondPath + "/pid", pid);
- model.setValue(xCondPath + "/indd", indd);
- model.setValue(xCondPath + "/cretno", cretno);
- //model.resetInstanceNode("/root/send/reqdata");
- model.removeNode("/root/send/reqdata");
- model.makeNode("/root/send/reqdata");
- model.copynode("/root/send/reqdata", xCondPath);
- submit("TRMNR04501");
- }else{
- messageBox("환자 리스트가 선택되지","E007");
- }
- }
- }
- /**
- * @group :
- * @ver : 2007.06.23
- * @by : 최경용
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 환자명 조회
- * @param :
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fGetPatList(){
- model.setValue(xCondPath + "/acpstatflag", "A");//재원환자만
- model.resetInstanceNode("/root/send/reqdata");
- model.copynode("/root/send/reqdata", xCondPath);
- submit("TRMNR00603");
- }
- /**
- * @group :
- * @ver : 2008.05.10
- * @by : 김보성
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 조회일자 초기화
- * @param :
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fnDateInit() {
- model.setValue("/root/main/cond/medfromdd", getDateAddc(getCurrentDate(), -7));
- model.setValue("/root/main/cond/medtodd", getCurrentDate());
- }
- /**
- * @group :
- * @ver : 2008.05.10
- * @by : 김보성
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 입원일자 정보 조회
- * @param :
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fnhisindd() {
- var pGrd = grd_patlist;
- var row = pGrd.row;
-
- // if (row <= 1 ) return;
- if (bool_acptstat.value == "true") {
- cap_hisindd.visible = true;
- cbo_hisindd.visible = true;
- } else {
- cap_hisindd.visible = false;
- cbo_hisindd.visible = false;
- }
-
- //var pid = model.getValue(xWardPatListPath + "[" + row + "]/pid");
- var pid = model.getValue("/root/main/cond/pid_search");
- model.setValue(xCondPath + "/pid", pid);
- model.resetInstanceNode("/root/send/reqdata");
- model.copynode("/root/send/reqdata", xCondPath);
- submit("TRMNR04502");
- if (pid == '') return;
-
- if (cbo_hisindd.length < 1) {
- messageBox("입원정보가 존재하지 않습니다","E999");
- } else {
- messageBox(cbo_hisindd.length + " 건의 입원정보가 존재합니다","E999");
- fnhisinddmove();
- }
- }
- /**
- * @group :
- * @ver : 2008.05.10
- * @by : 김보성
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : his indd -> 조회일자 이동
- * @param :
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fnhisinddmove() {
- var hisindd = model.getValue("/root/main/cond/hisindd");
- if ( isNull(hisindd)) return;
-
- var indds = hisindd.split("-");
-
- var indd = indds[0]; //입원일자
- var dschdd = indds[1]; //퇴원일자
- var cretno = indds[2]; //입원생성번호 (20080922)
-
- var medfromdd = indd;
- var medtodd = ( dschdd == "99991231" ? getCurrentDate() : dschdd );
-
- var dschddM90 = medtodd.toDate().getAddDate(-90, "D").getDateFormat();
- if ( dschddM90 > indd ){
- medfromdd = dschddM90;
- }
-
- model.setValue("/root/main/cond/medfromdd", medfromdd);
- model.setValue("/root/main/cond/medtodd", medtodd);
- model.setValue("/root/main/cond/cretno", cretno); //---(20080922)
- model.setValue("/root/main/cond/indd", indd); //---(20080922)
- model.setValue("/root/main/cond/wardcd",""); //---(20080922)
- model.setValue("/root/main/cond/roomcd",""); //---(20080922)
- model.setValue("/root/main/cond/prcpkindcd",""); //---(20080922)
- model.setValue("/root/main/cond/prcpcd",""); //---(20080922)
- model.removenodeset("/root/main/wardpatinfo/wardpatlist"); //---(20080922)
-
- model.refresh();
- inp_medfromdd.refresh();
- inp_medtodd.refresh();
- }
- /* --------------------------------------------------*/
- /* type : function */
- /* access : public */
- /* desc : 환자정보 가져오기 */
- /* param : 검색구분 */
- /* return : */
- /* --------------------------------------------------*/
- function fSearchPatInfo(qryflag) {
- var sPath1 = "/root/main/cond";
- var sPath2 = "/root/main/patinfo/patinfolist";
-
- model.removenodeset("/root/temp/pidinfo");
- model.makeValue("/root/temp/pidinfo/pid", model.getValue(sPath1 + "/pid_search"));
- model.makeValue("/root/temp/pidinfo/srchcond","1");
-
- if (qryflag == "1") {
- model.makeValue("/root/temp/pidinfo/autoflag","Y");
- } else {
- model.makeValue("/root/temp/pidinfo/autoflag","N");
- }
- //modal("SPPMC02500", 1,10, 10, "SPPMC02500", "/root/temp", "/root/send"); 17863430
- //modal("../../../pam/commonweb/xrw/SPPMC02500", qryflag,"150", "150", "SPPMC02500", "/root/source", "/root/send");
- modal("SPPMC02500", qryflag,"150", "150", "SPPMC02500", "/root/temp/pidinfo", "/root/send");
-
- //환자번호 copy
- var popupendflag = model.getValue("/root/main/popupendflag");
- if (popupendflag == "ok"){
- model.setValue(sPath1 + "/pid_search" , model.getValue(sPath2 + "/pid") );
- model.setValue(sPath1 + "/hngnm_search", model.getValue(sPath2 + "/hngnm") );
-
- model.setValue("/root/main/pidinfo/roomcd", "");
- model.setValue("/root/main/pidinfo/pid", model.getValue(xDschPatInfoPath + "/pid"));
- model.setValue("/root/main/pidinfo/patnm", model.getValue(xDschPatInfoPath + "/hngnm"));
- model.setValue("/root/main/pidinfo/sa", model.getValue(xDschPatInfoPath + "/sex") + "/" + model.getValue(xDschPatInfoPath + "/age") );
- model.setValue("/root/main/pidinfo/rrgstno",model.getValue(xDschPatInfoPath + "/rrgstno1") + "-" + model.getValue(xDschPatInfoPath + "/rrgstno2").substring(0,1) +"******");
-
- } else {
- model.setValue("/root/main/pidinfo/roomcd", "");
- model.setValue("/root/main/pidinfo/pid", "");
- model.setValue("/root/main/pidinfo/patnm", "");
- model.setValue("/root/main/pidinfo/sa", "");
- model.setValue("/root/main/pidinfo/rrgstno","");
-
- }
- model.refresh();
- }
- /* --------------------------------------------------*/
- /* type : function */
- /* access : public */
- /* desc : 환자에 대한 입원정보 추출 */
- /* param : 검색구분 */
- /* return : */
- /* --------------------------------------------------*/
- function fSearchPatInddInfo() {
- //등록번호체크 : 이전 기능으로 막음
- if (model.getValue("/root/main/cond/hngnm_search") != "") {
- bool_acptstat.value = "true";
- }
-
- //콤보열기
- fnhisindd();
- model.setFocus("cbo_hisindd");
- cbo_hisindd.select(0);
- }
- /* --------------------------------------------------*/
- /* type : function */
- /* access : public */
- /* desc : 화면초기화(20080819) */
- /* param : */
- /* return : */
- /* --------------------------------------------------*/
- function fQueryinit() {
- // 일자 초기화
- fnDateInit();
- bool_acptstat.value = "false";
- // 콤보숨기기
- cap_hisindd.visible = false;
- cbo_hisindd.visible = false;
- // 조건 초기화
- model.setValue("/root/main/pidinfo/roomcd", "");
- model.setValue("/root/main/pidinfo/pid", "");
- model.setValue("/root/main/pidinfo/patnm", "");
- model.setValue("/root/main/pidinfo/sa", "");
- model.setValue("/root/main/pidinfo/rrgstno","");
- model.refresh();
- }
-
- /**
- * @group
- * @ver : 2009.06.16
- * @by : 최영
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 출력기능
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fExecPrint(){
- // 출력할 데이터가 없는 경우
- if(getNodesetCount("/root/main/druglist/druglist")==0){
- messageBox("출력할 데이터가", "I004"); return;
- }else{
- model.removeNodeset("/root/hidden/druglist");
- model.makeNode("/root/hidden/druglist");
- model.copyNode("/root/hidden/druglist", "/root/main/druglist");
- // for(var i=1;i<grd_druglist.rows;i++) {
- // model.makeNode("/root/hidden/druglist/druglist["+i+"]");
- // model.copyNode("/root/hidden/druglist/druglist["+i+"]", "/root/main/druglist/druglist["+i+"]");
- // }
-
- exeReportPreview("RPMNR04500", "XMLSTR","/root/hidden/druglist","","","","","","","");
- model.removeNodeset("/root/hidden/druglist");
- }
- }
|