123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325 |
- /*
-
- 투약반환예정조회(SMMNR03800.xrw - JScript )
- - Version :
- 1) : Ver.1.00.01
- */
- var xCondPath = "/root/main/cond";
- var xWardPatListPath = "/root/main/wardpatinfo/wardpatlist";
- var xPatInfoPath = "/root/main/paminfo/pamlist";
- /**
- * @group :
- * @ver : 2007.09.12
- * @by :
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 초기화
- * @param :
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fInitialize(){
-
- //처방내역 초기화
- model.removenodeset("/root/main/warddrugrtninfo/warddrugrtnlist");
- //오늘 날짜로 초기화 하는 부분.(진료일자를 default로 오늘 날짜로 선택함)(20080510)
- var tempdate = getCurrentDate();
- model.setValue("/root/main/cond/dtto", tempdate);
- //----------(20080910)----------(20091020)
- //model.setValue("/root/main/cond/dtto", tempdate);
- var date = getCurrentDate().toDate().getAddDate(-1,"M").getDateFormat("YYYYMMDD");
- model.setValue("/root/main/cond/dtfr", date);
- //----------(20080910)----------(20091020)
-
- model.setValue(xCondPath+"/execprcphistcd", "%");
- model.setValue(xCondPath+"/wardcd", getUserInfo("dutplcecd"));
- model.copynode("/root/send/reqdata", xCondPath);
- // 환자정보 조회
- var sPamInfo = getGlobalVariable("paminfo");
- setCSVToNode("/root/main/paminfo",sPamInfo,"pamlist");
- var sPID = model.getValue(xPatInfoPath + "/pid");
- var sWardCd = model.getValue(xPatInfoPath+"/wardcd");
-
- //-----------------(20080416)
- // 병실설정하기
- var sRoomCd = model.getValue(xPatInfoPath+"/roomcd");
-
- if(sPID == ""){
- model.setValue(xCondPath + "/wardcd", getUserInfo("dutplcecd"));
- }else{
- model.setValue(xCondPath + "/pid", sPID);
- model.setValue(xCondPath + "/wardcd", sWardCd);
- model.setValue(xCondPath + "/roomcd", sRoomCd); //조회조건에 반영하고
- }
- submit("TRMNR00601");
- fGetRoomList();
- if(sPID == ""){
- }else{
- model.setValue(xCondPath + "/roomcd", sRoomCd); //콤보에 재반영한다.
- }
- //-----------------(20080416)
- fGetPatList();
- //-----------------------------(20080906)
- fSetsettingrnid();
- //-----------------------------(20080906)
-
- if(sPID != ""){
- 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");
- fClickDrugList(i);
- }
- }
- }
- 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.09.12
- * @by :
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 투약기록 병동별 병실 리스트 조회
- * @param :
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fGetRoomList(){
- model.setValue(xCondPath+"/roomcd", "");
- model.resetInstanceNode("/root/send/reqdata");
- model.copynode("/root/send/reqdata", xCondPath);
- submit("TRMNR00602");
- }
- /**
- * @group :
- * @ver : 2007.09.12
- * @by :
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 투약기록 환자 리스트 조회
- * @param :
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fGetPatList(){
- model.removenodeset("/root/main/wardpatinfo/wardpatlist");
- model.resetInstanceNode("/root/send/reqdata");
- model.copynode("/root/send/reqdata", xCondPath);
- submit("TRMNR00603");
- }
- /**
- * @group :
- * @ver : 2007.09.12
- * @by :
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 투약기록 환자별 투약 기록 리스트 조회
- * @param :
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fClickDrugList(row){
- if(row > 0){
- model.makeValue("/root/send/reqdata/pid", model.getValue(xWardPatListPath+"["+row+"]/pid"));
- model.makeValue("/root/send/reqdata/indd", model.getValue(xWardPatListPath+"["+row+"]/indd"));
- model.makeValue("/root/send/reqdata/cretno", model.getValue(xWardPatListPath+"["+row+"]/cretno"));
- model.makeValue("/root/send/reqdata/execprcphistcd",model.getValue(xCondPath+"/execprcphistcd"));
-
- //-------------(20080510)
- //일자구분
- model.makeValue("/root/send/reqdata/dtflag", model.getValue(xCondPath+"/dtflag"));
- model.makeValue("/root/send/reqdata/dtfr", model.getValue(xCondPath+"/dtfr"));
- model.makeValue("/root/send/reqdata/dtto", model.getValue(xCondPath+"/dtto"));
-
- submit("TRMNR03801");
- } else {
- messageBox("환자를 선택하십시오.","E999");
- }
- }
- /**
- * @group :
- * @ver : 2007.09.12
- * @by :
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 등록번호 조회시 환자리스트에서 검색
- * @param :
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fPid_Search(){
- model.setFocus("grd_patlist");
-
- //var sPID = model.getValue(xCondPath + "/pid");
- var sPID = model.getValue("root/main/pidinfo/pidlist/pid");
-
- var seq = 0;
- for(var i = 1; i <= getNodesetCount(xWardPatListPath); i++){
- if(model.getValue(xWardPatListPath + "[" + i + "]/pid") == sPID){
- seq = i;
- }
- }
- //alert(seq);
- if(seq > 0){
- grd_patlist.row = seq;
- grd_patlist.dispatch("onentercell");
- fClickDrugList(seq);
- }else{
- grd_patlist.row = 0;
- grd_patlist.dispatch("onentercell");
- model.removenodeset("/root/main/warddrugrtninfo/warddrugrtnlist");
- }
- }
- /**
- * @group :
- * @ver : 2008.05.10
- * @by :
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 환자리스트에 대한 처방 내역 조회
- * @param :
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fnSubQuery() {
- var sPath1 = "/root/main/cond/patinfo/patlist";
- var sPath2 = "/root/main/wardpatinfo/wardpatlist";
-
- var pGrd = grd_patlist
- if (pGrd.row < 1) return ;
-
- var mouserow = pGrd.row;
-
- var patcnt = getNodesetCount(xWardPatListPath);
- //model.setValue("/root/main/cond/pid", model.getValue("/root/main/wardpatinfo/wardpatlist[" + mouserow + "]/pid"));
- //model.setValue(sPath1 + "/pid", model.getValue(sPath2 + "[" + mouserow + "]/pid"));
-
- if(mouserow > 0 && mouserow <= patcnt){
- fClickDrugList(mouserow);
- }
- }
- /* --------------------------------------------------*/
- /* type : function */
- /* access : public */
- /* desc : 환자정보 가져오기 */
- /* param : 검색구분 */
- /* return : */
- /* --------------------------------------------------*/
- function fSearchPatInfo(qryflag) {
- var sPath1 = "/root/main/pidinfo/pidlist"; //화면상 연결
- var sPath2 = "/root/main/patinfo/patinfolist"; //팝업의리턴 정보
-
- model.removenodeset("/root/temp/");
- model.makeValue("/root/temp/pid", model.getValue("/root/main/pidinfo/pidlist/pid"));
- model.makeValue("/root/temp/srchcond","1");
- model.makeValue("/root/temp/autoflag","Y");
- //modal("SPPMC02500", 1,10, 10, "SPPMC02500", "/root/temp", "/root/send");
- //modal("../../../pam/commonweb/xrw/SPPMC02500", qryflag,"150", "150", "SPPMC02500", "/root/source", "/root/send");
- modal("SPPMC02500", qryflag,"150", "150", "SPPMC02500", "/root/temp", "/root/send");
-
- //환자번호 copy
- var popupendflag = model.getValue("/root/main/popupendflag");
- if (popupendflag == "ok"){
- model.setValue(sPath1 + "/pid" , model.getValue(sPath2 + "/pid") );
- model.setValue(sPath1 + "/hngnm", model.getValue(sPath2 + "/hngnm") );
- model.refresh();
- }
- }
- /* --------------------------------------------------*/
- /* type : function */
- /* access : public */
- /* desc : 환자에 대한 투약반환예정조회 */
- /* param : 검색구분 */
- /* return : */
- /* --------------------------------------------------*/
- function fClickPat() {
-
- var sPathpidlist = "/root/main/pidinfo/pidlist";
- var sPathwardpatlist= "/root/main/wardpatinfo/wardpatlist";
-
- var pGrd = grd_patlist;
- var row = pGrd.Row;
- if (pGrd.rows <= 1 || pGrd.row < 1 ) return;
-
- var patcnt = getNodesetCount(xWardPatListPath);
- model.setValue(sPathpidlist + "/pid", model.getValue(sPathwardpatlist + "[" + row + "]/pid"));
- model.setValue(sPathpidlist + "/hngnm", model.getValue(sPathwardpatlist + "[" + row + "]/patnm"));
- model.setValue("/root/main/cond/pid", model.getValue(sPathwardpatlist + "[" + row + "]/pid"));
- fClickDrugList(row);
- }
-
- function fClickPat_OLD() {
-
- var sPathpidlist = "/root/main/pidinfo/pidlist";
- var sPathwardpatlist= "/root/main/wardpatinfo/wardpatlist";
-
- var pGrd = grd_patlist;
- var mouserow = pGrd.mouseRow;
- var patcnt = getNodesetCount(xWardPatListPath);
- model.setValue(sPathpidlist + "/pid", model.getValue(sPathwardpatlist + "[" + mouserow + "]/pid"));
- model.setValue(sPathpidlist + "/hngnm", model.getValue(sPathwardpatlist + "[" + mouserow + "]/patnm"));
- model.setValue("/root/main/cond/pid", model.getValue(sPathwardpatlist + "[" + mouserow + "]/pid"));
-
- if(mouserow > 0 && mouserow <= patcnt){
- fClickDrugList(mouserow);
- }
- }
|