12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433 |
- /*
- - ▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩
- 마취환자기록 ( SSMMR05800_마취환자기록마스터.xrw - JScript )
- - Version :
- 1) : Ver.1.00.01 2008-06-23
- - ▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩▩
- */
- var instcd = "012";
- var anstrecno = "";
- var currentdate = "";
- var prcpmast_load = "";
- var prcpset_load = "";
- /**
- 수술환자 parameter 구조 : mmohoprs수술예약정보 tbl의 정보를 기본으로 함
- var param = 구분자'T' + "▦" +
- 등록번호 :=pid + "▦" +
- 수술확정일자 :=opcnfmdd + "▦" +
- (생성번호) :=cretno + "▦" +
- 기관코드 :=instcd + "▦" +
- 집도과코드 :=perfdeptcd + "▦" +
- 집도의 :=perfdrid + "▦" +
- 환자구분 :=patflag + "▦" + ==> 외래(I), 입원(O), DSC(D), 응급(E)
- 처리구분'F' + "▦" +
- 수술예약번호 :=oprsrvno + "▦" +
- 수술이력번호 :=ophistno + "▦" +
- 조회일자;
- */
- /**
- * @desc : 폼초기화 ( 마취환자 기록셋 & 기록항목 조회 )
- * @
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fFormInit()
- {
- anstrecno = window.parent.iv_anstinfo.model.getValue("/root/main/anstinfo/anstrecno");
- // 기록 : default tab 처리
- btn_anstrec.dispatch("onclick");
- // 현재일시
- currentdate = getCurrentDate() + getCurrentTime();
- model.setValue("/root/send/reqdata/currentdate" , currentdate);
- // 기록 Set 목록
- model.setValue("/root/send/reqdata/settype", "R");
- submit("TRMMR04204","","/root/send/reqdata", "/root/init/recsetlist/item");
- // 기록 Set Code
- var recsetcd = window.parent.iv_anstinfo.model.getValue("/root/main/anstinfo/recsetcd");
- if (recsetcd == "0") { recsetcd = "-1"; }
- model.setValue("/root/send/reqdata/recsetcd", recsetcd);
- if (recsetcd == "-1") {
- // 마취기록 마스터 정보 조회
- submit("TRMMR04201");
- } else {
- model.setValue("/root/send/setinfo/instcd" , instcd);
- model.setValue("/root/send/setinfo/settype", "R");
- model.setValue("/root/send/setinfo/setcd" , recsetcd);
- // 현재일시
- currentdate = getCurrentDate() + getCurrentTime();
- model.setValue("/root/send/setinfo/currentdate" , currentdate);
- // 마취기록 SET 아이템 조회하기..
- submit("TRMMR04205");
- }
- // 그리드를 트리형태로 보여주기..
- setTree(grd_recmast , grd_recmast.colref("depth"), grd_recmast.colref("rec"), false);
- if (anstrecno != "0")
- {
- // 마취기록번호
- model.setValue("/root/send/reqdata/anstrecno", anstrecno);
- // 마취환자 기록 조회
- submit("TRMMR03704");
- // 마취환자 기록 체킹해주기
- fAnstRecChecked("/root/main/anstrec/item", grd_recmast, "recitem", "checked", "rec", "rectype", "recnm", "subrec");
- }
- }
- /**
- * @desc : 처방 SET 조회
- * @
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fPrcpSetLoad()
- {
- sw_left1.visible = true;
- if (prcpset_load != "Y") {
- // 전체 선택을 위한 그리드 셋..
- // grd_agent01.fixedcellcheckbox(0,0) = true;
- grd_prcpset.fixedcellcheckbox(0,0) = true;
- var setclscd = model.getValue("/root/send/reqdata/setclscd");
- if (setclscd == "") {
- model.setValue("/root/send/reqdata/setclscd","1");
- model.refresh();
- // 그리드 초기화
- if (grd_prcpset.rows> 1) {
- grd_prcpset.removeRow();
- grd_prcpset.refresh();
- }
- // 처방 SET 수술별 조회
- fComboSetlist();
- }
- prcpset_load = "Y";
- }
- }
- /**
- * @desc : 처방 마스터 조회
- * @
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fPrcpMastLoad()
- {
- sw_left1.visible = true;
- if (prcpmast_load != "Y") {
- // 용법조회 (주사약)
- model.setValue ( "/root/send/req/cond1" , "I");
- model.setValue ( "/root/send/req/cond2" , 1);
- model.setValue ( "/root/send/req/cond3" , "");
- submit("TRMMR03710");
- //공통코드 가져오기...
- //M0287:drug 소분류
- zbcfGetCodeList(new Array("M0287"), new Array("/root/init/M0287"));
- // Agent 시작일시, 종료일시 적용을 위한 기본 셋
- model.setValue("/root/hidden/agentfromdd", window.parent.iv_anstinfo.model.getValue("/root/main/anstinfo/anstfromdd"));
- model.setValue("/root/hidden/agentfromtm", window.parent.iv_anstinfo.model.getValue("/root/main/anstinfo/anstfromtm"));
- model.setValue("/root/hidden/agenttodd" , window.parent.iv_anstinfo.model.getValue("/root/main/anstinfo/ansttodd"));
- model.setValue("/root/hidden/agenttotm" , window.parent.iv_anstinfo.model.getValue("/root/main/anstinfo/ansttotm"));
- // 처방마스터 정보 조회
- model.setValue("/root/send/reqdata/clscd","");
- model.setValue("/root/send/reqdata/prcptype","");
- submit("TRMMR04202","","/root/send/reqdata","/root/main/prcpmast/item");
-
- copyNodeset("/root/main/agent/item" , "/root/main/prcpmast/item[prcptype = 'A']");
- copyNodeset("/root/main/drug/item" , "/root/main/prcpmast/item[prcptype = 'D']");
- copyNodeset("/root/main/fluid/item" , "/root/main/prcpmast/item[prcptype = 'F']");
- copyNodeset("/root/main/blod/item" , "/root/main/prcpmast/item[prcptype = 'H']");
- copyNodeset("/root/main/proc/item" , "/root/main/prcpmast/item[prcptype = 'P']");
- copyNodeset("/root/main/agent01/item", "/root/main/agent/item[clscd = '01']");
- copyNodeset("/root/main/agent02/item", "/root/main/agent/item[clscd = '02']");
- copyNodeset("/root/main/agent03/item", "/root/main/agent/item[clscd = '03']");
- copyNodeset("/root/main/agent04/item", "/root/main/agent/item[clscd = '04']");
-
- // 2008.01.04. drug... 소분류는 "많이쓰는약" 으로 디폴트 처리한다..
- model.setValue("/root/send/reqdata/clscd", "01");
- model.setValue("/root/send/reqdata/prcptype","D");
- submit("TRMMR04202","","/root/send/reqdata","/root/main/drug/item");
- // Inhalational Agent : 별도로 (그룹싱글) 조회하여 트리형태로 서브항목을 보여줌
- // submit("TRMMR04208","","/root/send/reqdata","/root/main/agent01/item");
- // Inhalational Agent : 별도로 Display (항목 선택해 주고, 시작일시, 종료일시 다시 보여주기)
- fDisplayAgent01();
- // 혈액리스트 조회
- fGetBlodList();
- prcpmast_load = "Y";
- model.refresh();
- }
-
- //20131106 Start 처방 검색 후 DRUG가 세팅 안되는 오류 수정
- model.resetInstanceNode("/root/send/reqdata/data");
- model.resetInstanceNode("/root/main/prcpsearch/item");
- model.refresh();
- //20131106 End
- }
- /**
- * @desc : Inhalational Agent 인 경우 시작일시, 종료일시 셋해주기
- * @
- * @param :
- * @return :
- * @author :
- * @---------------------------------------------------
- */
- function fSetTimeAgent01()
- {
- model.setValue("/root/hidden/agentfromdd", window.parent.iv_anstinfo.model.getValue("/root/main/anstinfo/anstfromdd"));
- model.setValue("/root/hidden/agentfromtm", window.parent.iv_anstinfo.model.getValue("/root/main/anstinfo/anstfromtm"));
- model.setValue("/root/hidden/agenttodd" , window.parent.iv_anstinfo.model.getValue("/root/main/anstinfo/ansttodd"));
- model.setValue("/root/hidden/agenttotm" , window.parent.iv_anstinfo.model.getValue("/root/main/anstinfo/ansttotm"));
- model.refresh();
- }
- /**
- * @desc : Inhalational Agent : 별도로 Display (항목 선택해 주고, 시작일시, 종료일시 다시 보여주기)
- * @
- * @param :
- * @return :
- * @author :
- * @---------------------------------------------------
- */
- function fDisplayAgent01()
- {
- var gridObj = grd_agent01;
- var dataRef = "/root/main/agent01/item";
- // Inhalational Agent 인 경우 시작일시, 종료일시 셋해주기
- var agentfromdd = model.getValue("/root/hidden/agentfromdd");
- var agentfromtm = model.getValue("/root/hidden/agentfromtm");
- var agenttodd = model.getValue("/root/hidden/agenttodd");
- var agenttotm = model.getValue("/root/hidden/agenttotm");
- var dataCnt = getNodesetCnt(model, dataRef);
- for (var i=1 ; i <= dataCnt ; i++) {
- gridObj.textMatrix(i,gridObj.colref("drugfromdd")) = agentfromdd;
- gridObj.textMatrix(i,gridObj.colref("drugfromtm")) = agentfromtm;
- gridObj.textMatrix(i,gridObj.colref("drugtodd")) = agenttodd;
- gridObj.textMatrix(i,gridObj.colref("drugtotm")) = agenttotm;
- }
- var prcpRef = "/root/main/anstprcp/item";
- var prcpCnt = getNodesetCnt(window.parent.iv_anstprcp.model, prcpRef);
- // 전체 처방목록 중 Agent 의 소분류 01 (Inhalational Agent) 체킹해 주기
- if (anstrecno != "0") {
- for (var i=1 ; i <= prcpCnt ; i++) {
- var prcptype = window.parent.iv_anstprcp.model.getValue(prcpRef+"["+ i +"]/prcptype");
- var clscd = window.parent.iv_anstprcp.model.getValue(prcpRef+"["+ i +"]/clscd");
- if (prcptype == "A" && clscd == "01") {
- var prcpcd = window.parent.iv_anstprcp.model.getValue(prcpRef+"["+ i +"]/prcpcd");
- // 처방코드가 있는가?
- var dataCnt = getNodesetCnt(model, dataRef+"[prcpcd = '"+ prcpcd +"']");
- if (dataCnt > 0) {
- model.setValue(dataRef+"[prcpcd = '"+ prcpcd +"']/checked", "true");
- var remark = window.parent.iv_anstprcp.model.getValue(prcpRef+"[prcpcd = '"+ prcpcd +"']/remark");
- var tmpString = remark.split(".");
- if (tmpString.length == 4) {
- if (tmpString[0].length != 0) {
- window.parent.iv_anstprcp.model.setValue(prcpRef+"[prcpcd = '"+ prcpcd +"']/drugfromdd",tmpString[0].replace(".",""));
- }
- if (tmpString[1].length != 0) {
- window.parent.iv_anstprcp.model.setValue(prcpRef+"[prcpcd = '"+ prcpcd +"']/drugfromtm",tmpString[1].replace(".",""));
- }
- if (tmpString[2].length != 0) {
- window.parent.iv_anstprcp.model.setValue(prcpRef+"[prcpcd = '"+ prcpcd +"']/drugtodd" ,tmpString[2].replace(".",""));
- }
- if (tmpString[3].length != 0) {
- window.parent.iv_anstprcp.model.setValue(prcpRef+"[prcpcd = '"+ prcpcd +"']/drugtotm" ,tmpString[3].replace(".",""));
- }
- }
- }
- }
- }
- }
- gridObj.refresh();
- model.refresh();
- }
- /**
- * @desc : 저장된 기록 정보를 그리드 트리뷰 에 체킹 표시하고 기록명칭의 추가기록도 보여준다
- * @
- * @param :
- * @
- * @return :
- * @author :
- * @---------------------------------------------------
- */
- function fAnstRecChecked(dataPath, gridObj, levlColNm, checkedColNm, recColNm, rectypeColNm, recnmColNm, subrecColNm)
- {
- gridObj.allstyle( "all", "font-weight" ) = "normal";
- gridObj.allstyle( "all", "color" ) = "#000000";
- for (var i=1 ; i < gridObj.rows ; i++) {
- gridObj.textmatrix(i, gridObj.colref(checkedColNm)) = "false";
- gridObj.textmatrix(i, gridObj.colref(subrecColNm)) = "";
- }
- var dataCnt = getNodesetCnt(model, dataPath);
- var levlCol = gridObj.colref(levlColNm);
- var checkedCol = gridObj.colref(checkedColNm);
- var recCol = gridObj.colref(recColNm);
- var rectypeCol = gridObj.colref(rectypeColNm);
- var recnmCol = gridObj.colref(recnmColNm);
- var subrecCol = gridObj.colref(subrecColNm);
-
- //그리드 트리뷰 에 체킹 표시
- for (var i = 1 ; i <= dataCnt ; i++) {
-
- var recitem = model.getValue(dataPath + "["+ i + "]/" + levlColNm);
- var rectype = model.getValue(dataPath + "["+ i + "]/" + rectypeColNm);
- var recnm = model.getValue(dataPath + "["+ i + "]/" + recnmColNm);
- var subrec = model.getValue(dataPath + "["+ i + "]/" + subrecColNm);
- for (var j=1 ; j < gridObj.rows ; j++) {
- var tmplevl = gridObj.textmatrix(j, levlCol);
- if (tmplevl == recitem) {
- fSetCheckedStyle(gridObj, j, checkedCol, "true");
- if (rectype == "R" || rectype == "P") {
- if (subrec.length > 0) {
- gridObj.textmatrix(j, recCol) = fDisplayRec(recnm, subrec);
- gridObj.textmatrix(j, subrecCol) = subrec;
- }
- }
- break;
- }
- }
- }
- }
- /**
- * @desc : 추가기록 정보 보여주기
- * @
- * @param :
- * @
- * @return :
- * @author :
- * @---------------------------------------------------
- */
- function fDisplayRec(recnm, subrec)
- {
- var recnmdata = recnm.split("_");
- if (recnmdata.length == 2) {
- recnm = recnmdata[0].replace("_","") + subrec + recnmdata[1].replace("_","");
- } else {
- recnm = recnm + " " + subrec;
- }
- return recnm;
- }
- /**
- * @desc : 저장된 처방 정보를 그리드 에 체킹 표시
- * @
- * @param :
- * @
- * @return :
- * @author :
- * @---------------------------------------------------
- */
- function fAnstPrcpChecked(dataPath, targetPath, prcpcdColNm, checkedColNm)
- {
- var dataCnt = getNodesetCnt(model, dataPath)
- var targetCnt = getNodesetCnt(model, targetPath)
-
- //그리드 에 체킹 표시
- for (var i = 1 ; i <= dataCnt ; i++) {
-
- var prcpcd = model.getValue(dataPath + "["+ i +"]/" + prcpcdColNm);
- for (var j=1 ; j < targetCnt ; j++) {
- var tmpprcpcd = model.getValue(targetPath + "["+ j +"]/" + prcpcdColNm);
- if (tmpprcpcd == prcpcd) {
- model.setValue(targetPath + "["+ j +"]/" + checkedColNm, "true");
- break;
- }
- }
- }
- }
- /**
- * @desc : 그리드 트리뷰 더블 클릭시 체킹 표시
- * @
- * @param :
- * @
- * @return :
- * @author :
- * @---------------------------------------------------
- */
- function fRecDbClick(gridObj)
- {
- // 그리드 트리뷰 더블 클릭시 체킹 토글
- var getChecked = model.getValue("/root/main/recmast/item[" + gridObj.row + "]/checked");
- if (getChecked == "true") {
- getChecked = "false";
- } else {
- getChecked = "true";
- }
- model.setValue("/root/main/recmast/item[" + gridObj.row + "]/checked", getChecked);
-
- // 그리드 트리뷰 더블 클릭시 체킹 표시
- fSetChecked(gridObj, "depth", "recitem", "suprecitem", "checked");
- // 기록 마스터의 체크된 정보를 마취환자 기록 인스턴스에 카피노드 하기..
- copyNodeset("/root/main/anstrec/item", "/root/main/recmast/item[checked = 'true']");
- // checked "true" 이고 rectype 이 기록(R), 처방(P) 인 경우에만 팝업처리
- // checked 가 "true" 인가?
- var checked = gridObj.textMatrix(gridObj.row, gridObj.colref("checked"));
- if (checked == "true") {
- // rectype 이 기록(R), 처방(P) 인가?
- var rectype = gridObj.textMatrix(gridObj.row, gridObj.colref("rectype"));
- if (rectype == "R") {
- // recnm 에 구분자 "_" 가 있는가? 있는 경우에만 추가기록 팝업 보여주기...
- var recnm = gridObj.textMatrix(gridObj.row, gridObj.colref("recnm"));
- var recnmdata = recnm.split("_");
- if (recnmdata.length > 1) {
- fAddSubRec();
- }
- } else if (rectype == "P") {
- fOpenRecPrcp();
- }
- }
- }
- /**
- * @desc : 추가기록 (예 : 몰핀 @ 수량 @ mg. -> 몰핀 45 mg. )
- * @
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fAddSubRec()
- {
- var gridObj = grd_recmast;
- // 기록마스터
- var ref = "/root/main/recmast/item";
- // 선택 Row
- var selectedRow = gridObj.row;
- model.setValue("/root/hidden/selectedrec", selectedRow);
- // checked 가 "true" 인가?
- var checked = model.getValue(ref+"["+ selectedRow +"]/checked");
- if (checked == "true") {
- // subrec (추가기록정보가 있으면 input box에 적어주기
- var subrec = model.getValue(ref+"["+ selectedRow +"]/subrec");
- model.setValue("/root/hidden/subrec", subrec);
- model.refresh();
- // 팝업으로 보여주자!!!
- fShowWndIptBox("subrec");
- } else {
- model.setValue("/root/hidden/subrec", "");
- model.refresh();
- }
- }
- /**
- * @desc : 그리드 트리뷰인 경우 선택에 의해 선택항목 체킹하여 bold체로 표현한다.
- * @ checked 가 true 이면 상위항목도 checked 를 true 로 한다.
- * @ checked 가 false 이면 하위항목도 checked 를 false 로 한다.
- * @param :
- * @ gridObj : grid 객체
- * @ depthColNm : depth 컬럼 참조
- * @ levlColNm : 레벨 컬럼 참조
- * @ suplevlColNm : 상위레벨 컬럼 참조
- * @ checkedCol : checked 컬럼 참조
- * @return :
- * @author :
- * @---------------------------------------------------
- */
- function fSetChecked(gridObj, depthColNm, levlColNm, suplevlColNm, checkedColNm)
- {
- // 선택된 로우에 대한 처리
- var depth = gridObj.textmatrix(gridObj.row, gridObj.colref(depthColNm));
- var levl = gridObj.textmatrix(gridObj.row, gridObj.colref(levlColNm));
- var suplevl = gridObj.textmatrix(gridObj.row, gridObj.colref(suplevlColNm));
- var checked = gridObj.textmatrix(gridObj.row, gridObj.colref(checkedColNm));
- var checkedCol = gridObj.colref(checkedColNm);
- // 선택항목 처리
- fSetCheckedStyle(gridObj, gridObj.row, checkedCol, checked);
-
- if (checked == "true") {
-
- for (var i = gridObj.row -1 ; i > 0 ; i--) {
-
- var tmpdepth = gridObj.textmatrix(i, gridObj.colref(depthColNm));
- var tmplevl = gridObj.textmatrix(i, gridObj.colref(levlColNm));
- var tmpsuplevl = gridObj.textmatrix(i, gridObj.colref(suplevlColNm));
- var tmpchecked = gridObj.textmatrix(i, gridObj.colref(checkedColNm));
-
- if (tmpdepth < 1) {
- break;
- }
-
- if (tmplevl == suplevl) {
- if (tmpchecked == checked) {
- break;
- }
- fSetCheckedStyle(gridObj, i, checkedCol, checked);
- suplevl = tmpsuplevl;
- }
-
- }
-
- } else {
-
- for (var i = gridObj.row+1; i < gridObj.rows; i++) {
-
- var tmpdepth = gridObj.textmatrix(i, gridObj.colref(depthColNm));
- var tmplevl = gridObj.textmatrix(i, gridObj.colref(levlColNm));
- var tmpsuplevl = gridObj.textmatrix(i, gridObj.colref(suplevlColNm));
-
- if (tmpdepth <= depth) {
- break;
- }
-
- fSetCheckedStyle(gridObj, i, checkedCol, checked);
-
- }
-
- }
- gridObj.refresh();
- }
- /**
- * @desc : 그리드 트리뷰인 경우 선택상태값(true/false)와 표현(bold/normal)을 한다.
- * @param :
- * @ gridObj : grid 객체
- * @ checkedRow : 선택 로우
- * @ checkedCol : 선택 컬럼
- * @ checked : 선택 상태
- * @return :
- * @author :
- * @---------------------------------------------------
- */
- function fSetCheckedStyle(gridObj, checkedRow, checkedCol, checked)
- {
- gridObj.textmatrix(checkedRow, checkedCol) = checked;
-
- if (checked == "true") {
- gridObj.rowStyle(checkedRow, "data", "font-weight") = "bold";
- gridObj.rowStyle(checkedRow, "data", "color") = "#0000ff";
- } else {
- gridObj.rowStyle(checkedRow, "data", "font-weight") = "normal";
- gridObj.rowStyle(checkedRow, "data", "color") = "#000000";
- }
- }
- /**
- * @desc : 처방마스터의 처방코드/처방명 검색
- * @param :
- * @
- * @return :
- * @author :
- * @---------------------------------------------------
- */
- function fGetPrcpDrugClscd()
- {
- var clscd = model.getValue("/root/send/reqdata/clscd");
- model.setValue("/root/send/reqdata/clscd", clscd);
- model.setValue("/root/send/reqdata/prcptype","D");
- submit("TRMMR04202","","/root/send/reqdata","/root/main/drug/item");
- }
- /**
- * @desc : 처방마스터의 처방코드/처방명 검색
- * @param :
- * @
- * @return :
- * @author :
- * @---------------------------------------------------
- */
- function fSearchPrcpMast()
- {
- currentdate = getCurrentDate() + getCurrentTime();
- model.setValue("/root/send/reqdata/currentdate", currentdate);
- model.setValue("/root/send/reqdata/prcptype", "");
- //20131106 이정택 주석처리
- //model.setValue("/root/send/reqdata/clscd", "");
- var data = model.getValue("/root/send/reqdata/data");
- model.setValue("/root/send/reqdata/data", data.toUpperCase());
- submit("TRMMR04202", "", "/root/send/reqdata", "/root/main/prcpsearch/item");
- model.refresh();
- }
- /**
- * @desc : Agent, Drug, Fluid, Blood, Proc 에서의 처방추가 버튼 클릭
- * @param :
- * @
- * @return :
- * @author :
- * @---------------------------------------------------
- */
- function fAddBtnClick(prcptype, clscd)
- {
- if (prcptype == "A") {
- if (clscd == "02") {
- fAddAnstPrcp(grd_agent02,"/root/main/agent02/item");
- copyNodeset("/root/main/agent02/item", "/root/main/agent/item[clscd = '02']");
- } else if (clscd == "03") {
- fAddAnstPrcp(grd_agent03,"/root/main/agent03/item");
- copyNodeset("/root/main/agent03/item", "/root/main/agent/item[clscd = '03']");
- } else if (clscd == "04") {
- fAddAnstPrcp(grd_agent04,"/root/main/agent04/item");
- copyNodeset("/root/main/agent04/item", "/root/main/agent/item[clscd = '04']");
- }
- } else if (prcptype == "D") {
- fAddAnstPrcp(grd_drug,"/root/main/drug/item");
- copyNodeset("/root/main/drug/item" , "/root/main/prcpmast/item[prcptype = 'D']");
- // 2008.01.04. drug... 선택한 소분류로 다시 조회하기..
- model.setValue("/root/send/reqdata/prcptype","D");
- submit("TRMMR04202","","/root/send/reqdata","/root/main/drug/item");
- } else if (prcptype == "F") {
- fAddAnstPrcp(grd_fluid,"/root/main/fluid/item");
- copyNodeset("/root/main/fluid/item" , "/root/main/prcpmast/item[prcptype = 'F']");
- } else if (prcptype == "H") {
- fAddAnstPrcp(grd_fluid,"/root/main/blod/item");
- copyNodeset("/root/main/blod/item" , "/root/main/prcpmast/item[prcptype = 'H']");
- } else if (prcptype == "P") {
- fAddAnstPrcp(grd_proc,"/root/main/proc/item");
- copyNodeset("/root/main/proc/item" , "/root/main/prcpmast/item[prcptype = 'P']");
- } else if (prcptype == "S") {
- fAddAnstPrcp(grd_prcpset,"/root/main/prcpsetitem/item");
- copyNodeset("/root/main/prcpsetitem/item", "/root/main/prcpset/item");
- } else if (prcptype == "Z") {
- fAddAnstPrcp(grd_search,"/root/main/prcpsearch/item");
- //2014/01/03
- grd_search.valueMatrix(grd_search.row, grd_search.colRef("checked"))="false";
- //2014/01/03
- }
- model.refresh();
- }
- /**
- * @desc : 처방추가 버튼 클릭시 처방목록에 추가한다.
- * @param :
- * @
- * @return :
- * @author :
- * @---------------------------------------------------
- */
- function fAddAnstPrcp(gridObj, ref)
- {
- // 처방목록 노드
- var AddRef = "/root/main/anstprcp/item";
- // 노드 갯수를 가져온후 노드 하나를 추가한다.
- var dataCnt = getNodesetCnt(window.parent.iv_anstprcp.model, AddRef);
- // agent, drug, fluid, blood, prog
- for (var i=1 ; i < gridObj.rows ; i++) {
- var checked = model.getValue(ref+"[" + i + "]/checked");
- if (checked == "true") {
- var prcpcd = model.getValue(ref+"[" + i + "]/prcpcd");
- if (prcpcd != "" && prcpcd != null) {
- var prcpcd = model.getValue(ref+"[" + i + "]/prcpcd");
- var prcptype = model.getValue(ref+"[" + i + "]/prcptype");
- var clscd = model.getValue(ref+"[" + i + "]/clscd");
- var prcpnm = model.getValue(ref+"[" + i + "]/prcpnm");
- var abbrnm = model.getValue(ref+"[" + i + "]/abbrnm");
- var prcpvol = model.getValue(ref+"[" + i + "]/prcpvol");
- var prcpvolunitnm = model.getValue(ref+"[" + i + "]/prcpvolunitnm");
- var drugmthdcd = model.getValue(ref+"[" + i + "]/drugmthdcd");
- var prcpappyn = model.getValue(ref+"[" + i + "]/prcpappyn");
- var totvolyn = model.getValue(ref+"[" + i + "]/totvolyn");
- var sortno = model.getValue(ref+"[" + i + "]/sortno");
- // 처방목록에 처방코드가 있는가?
- var cntprcpcd = getNodesetCnt(window.parent.iv_anstprcp.model, AddRef+"[prcpcd = '" + prcpcd + "']");
-
- if (cntprcpcd > 0 && prcptype != "F") {
- messageBox("이미 추가되었습니다. - [" + prcpnm+ "]", "E");
- /** 처방은 한번만 한다..................................2007.10.09.
- // 처방코드가 있다면 용량만 더하자..
- for (var j=1 ; j <= dataCnt ; j++) {
- var tmpprcpcd = model.getValue(AddRef+"[" + j + "]/prcpcd");
- if (prcpcd == tmpprcpcd) {
- var tmpprcpvol = model.getValue(AddRef+"["+ j +"]/prcpvol");
- prcpvol = Number(prcpvol) + Number(tmpprcpvol);
- model.setValue(AddRef+"["+ j +"]/prcpvol", prcpvol);
- break;
- }
- }
- */
- } else {
- // 처방코드가 없다면 추가하자..
- var checkValue = window.parent.iv_anstprcp.model.getValue(AddRef+"["+dataCnt+"]/prcpnm");
- if (checkValue != "" || dataCnt == "0") {
- dataCnt = dataCnt + 1;
- }
- // 2008.09.23. 어렵다..
- var prcpseqno = 0;
- for (var j=1 ; j <= dataCnt ; j++) {
- var tmp = window.parent.iv_anstprcp.model.getValue(AddRef+"["+ j +"]/prcpcd");
- if (tmp == prcpcd) {
- prcpseqno = window.parent.iv_anstprcp.model.getValue(AddRef+"["+ j +"]/prcpseqno");
- }
- }
- prcpseqno = parseInt(prcpseqno) + 1;
-
- window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/prcpcd" , prcpcd);
- window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/prcptype" , prcptype);
- window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/prcpvol" , "");
- window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/prcpvolunitnm" , prcpvolunitnm);
- window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/prcpvolunitnm2", prcpvolunitnm);
- window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/prcpnm" , prcpnm);
- window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/abbrnm" , abbrnm);
- window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/drugmthdcd" , drugmthdcd);
- window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/recvol" , "");
- window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/remark" , "");
- window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/clscd" , clscd);
- window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/prcpappyn" , prcpappyn);
- window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/totvolyn" , totvolyn);
- window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/sortno" , sortno);
- window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/pcaflag" , "N");
- window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/checked" , checked);
- // 2008.09.23. 2개이상 처방코드 추가 기록하기.. (fluid일때)
- window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/prcpseqno" , prcpseqno);
- window.parent.iv_anstprcp.model.refresh();
- window.parent.javascript.fAddRow(prcptype, prcpcd, sortno, prcpseqno);
- }
- }
- }
- }
-
- // 그리드 정렬후 노드셋 정렬
- window.parent.iv_anstprcp.window.javascript.fSetAnstPrcp();
- // 메인 그리드 정렬
- //2014/05/16 이정택 수정
- window.parent.javascript.fGridSort();
- //2014/05/16 이정택 수정
-
- //2012/12/26 Start 기록 & 처방에서 입력했을시에 오른쪽에 줄 반영
- window.parent.javascript.fSetGrdColor();
- //2012/12/26 end
- }
- /**
- * @desc : 노드셋 갯수 구하기
- * @
- * @param :
- * @
- * @return :
- * @author :
- * @---------------------------------------------------
- */
- function getNodeList(strPath) {
- var node = instance1.selectNodes(strPath);
- if(node == null)
- return 0;
- return node;
- }
- /**
- * @desc : 마우스 오른쪽 버튼 팝업창
- * @
- * @param :
- * @return :
- * @---------------------------------------------------
- *
- */
- function fMouseRghtBtnPopup(gridObj, job)
- {
- if (event.button == 3) {
- if (gridObj.isCell(event.target)) {
- if (job == "subrec") {
- // checked "true" 이고 rectype 이 기록(R) 인 경우에만 팝업처리
- // checked 가 "true" 인가?
- var checked = gridObj.textMatrix(gridObj.row, gridObj.colref("checked"));
- if (checked == "true") {
- // rectype 이 기록(R) 인가?
- var rectype = gridObj.textMatrix(gridObj.row, gridObj.colref("rectype"));
- if (rectype == "R") {
- window.setPopupMenu(true, "/root/hidden/menu2/menu", "label", "func", false);
- } else {
- window.setPopupMenu(false);
- }
- } else {
- window.setPopupMenu(false);
- }
- } else if (job == "search") {
- // 처방 에서 우클릭시 약품편람 팝업
- if (gridObj.row > 0) {
- window.setPopupMenu(true, "/root/hidden/menu7/menu", "label", "func", false);
- } else {
- window.setPopupMenu(false);
- }
- } else {
- window.setPopupMenu(false);
- }
- } else {
- window.setPopupMenu(false);
- }
- } else {
- window.setPopupMenu(false);
- }
- }
- /**
- * @desc :마취기록 추가기록의 팝업
- * @
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fShowWndIptBox(job)
- {
- grup_subrec.visible = "false";
- if (job == "subrec") {
- if (event.clientY < 700) {
- grup_subrec.attribute("top") = event.clientY-70;
- } else {
- grup_subrec.attribute("top") = event.clientY-150;
- }
- grup_subrec.visible = "true";
- }
- }
- /**
- * @desc : 추가기록 내용 마취기록에 적용하기..
- * @
- * @param :
- * @return :
- * @---------------------------------------------------
- *
- */
- function fSendSubRec()
- {
- var gridObj = grd_recmast;
- // 기록마스터
- var ref = "/root/main/recmast/item";
- // 선택 Row
- var selectedRow = model.getValue("/root/hidden/selectedrec");
- if (selectedRow > 0) {
- // checked 가 "true" 인가?
- var checked = model.getValue(ref+"["+ selectedRow + "]/checked");
- if (checked == "true") {
- // rectype 이 기록(R), 처방(P) 인가?
- var rectype = model.getValue(ref+"["+ selectedRow + "]/rectype");
- if (rectype == "R" || rectype == "P") {
- var recnm = gridObj.textmatrix(selectedRow, gridObj.colref("recnm"));
- var subrec = model.getValue("/root/hidden/subrec");
- gridObj.textmatrix(selectedRow, gridObj.colref("rec")) = fDisplayRec(recnm, subrec);
- gridObj.textmatrix(selectedRow, gridObj.colref("subrec")) = subrec;
- }
- }
- }
- grup_subrec.visible = "false";
- // 기록 마스터의 체크된 정보를 마취환자 기록 인스턴스에 카피노드 하기..
- copyNodeset("/root/main/anstrec/item", "/root/main/recmast/item[checked = 'true']");
- // 마취기록 체킹해주기
- fAnstRecChecked("/root/main/anstrec/item", grd_recmast, "recitem", "checked", "rec", "rectype", "recnm", "subrec");
- }
- /**
- * @group : SET 버튼 클릭시 SET 목록 조회하여 콤보 초기화 or 리셋
- * @ver : 2007-08-24
- * @by : 이은영
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc :
- * @---------------------------------------------------
- */
- function fComboSetlist()
- {
- var dataCnt = getNodesetCnt(model, "/root/init/setlist/item");
- if (dataCnt < 2) {
- model.setValue("/root/send/reqdata/settype","P");
- submit("TRMMR04204","","/root/send/reqdata","/root/init/setlist/item");
- }
- // SET 목록 콤보 리셋하기..
- var clscd = model.getValue("/root/send/reqdata/setclscd");
- model.refresh();
- cbo_setlist.choices.itemset.attribute("nodeset") = "/root/init/setlist/item[clscd = '"+ clscd +"']";
- cbo_setlist.refresh();
- // 콤보에 셋코드를 선택해주기...
- model.setValue("/root/send/setinfo/setcd",model.getValue("/root/hidden/prcpsetcd"));
- model.refresh();
- }
- /**
- * @group : SET 목록 조회 선택시 SET 아이템 보여주기
- * @ver : 2007-08-24
- * @by : 이은영
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc :
- * @---------------------------------------------------
- */
- function fRecSetItemDisplay()
- {
- var recsetcd = cbo_recsetlist.value;
- window.parent.iv_anstinfo.model.makeValue("/root/main/anstinfo/recsetcd" , model.getValue("/root/send/reqdata/recsetcd"));
- model.setValue("/root/send/setinfo/instcd" , instcd);
- model.setValue("/root/send/setinfo/settype", "R");
- model.setValue("/root/send/setinfo/setcd" , recsetcd);
- // 현재일시
- currentdate = getCurrentDate() + getCurrentTime();
- model.setValue("/root/send/setinfo/currentdate" , currentdate);
- if (cbo_recsetlist.value != "-1")
- {
- // 마취기록 SET 아이템 조회하기..
- submit("TRMMR04205");
- } else {
- // 마취기록 마스터 정보 조회
- submit("TRMMR04201");
- }
- // 그리드를 트리형태로 보여주기..
- setTree(grd_recmast , grd_recmast.colref("depth"), grd_recmast.colref("rec"), false);
- // 마취환자 기록 체킹해주기
- fAnstRecChecked("/root/main/anstrec/item", grd_recmast, "recitem", "checked", "rec", "rectype", "recnm", "subrec");
- }
- /**
- * @group : SET 목록 조회 선택시 SET 아이템 보여주기
- * @ver : 2007-08-24
- * @by : 이은영
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc :
- * @---------------------------------------------------
- */
- function fPrcpSetItemDisplay()
- {
- model.setValue("/root/send/setinfo/instcd",instcd);
- model.setValue("/root/send/setinfo/settype","P");
- model.setValue("/root/send/setinfo/setcd",cbo_setlist.value);
- // 현재일시
- currentdate = getCurrentDate() + getCurrentTime();
- model.setValue("/root/send/setinfo/currentdate" , currentdate);
- // 마취처방 SET 아이템 조회하기..
- submit("TRMMR04206");
- //
- copyNodeset("/root/main/prcpsetitem/item", "/root/main/prcpset/item");
- model.refresh();
- }
- /**
- * @desc : 종료일시 적용 (선택된 Inhalational Agent)
- * @
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fSetAnstToDt()
- {
- // 2007.12.13. 마취시작시간을 확인한다.. 마취시작시간이랑 선택할 시작시간이 같으면 선택시간 변경한다..
- var anstfromdt = window.parent.iv_anstinfo.model.getValue("/root/main/anstinfo/anstfromdd") + window.parent.iv_anstinfo.model.getValue("/root/main/anstinfo/anstfromtm");
- //20111103 수정시작
- //var agenttodd = window.parent.iv_anstinfo.model.getValue("/root/hidden/agenttodd");
- //var agenttotm = window.parent.iv_anstinfo.model.getValue("/root/hidden/agenttotm");
- var agenttodd =window.parent.iv_anstinfo.model.getValue("/root/main/anstinfo/ansttodd");
- var agenttotm =window.parent.iv_anstinfo.model.getValue("/root/main/anstinfo/ansttotm");
- var todt = agenttodd + agenttotm;
- //20111103 수정종료
- if (anstfromdt > todt)
- {
- alert("종료일시가 마취시작일시 보다 작습니다.");
- return;
- }
- // Inhalational Agent
- var ref = "/root/main/agent01/item";
- var gridObj = grd_agent01;
- for (var i=1 ; i < gridObj.rows ; i++) {
- var checked = model.getValue(ref +"[" + i + "]/checked");
- var depth = model.getValue(ref +"[" + i + "]/depth");
- if (checked == "true" && depth == "1") {
- gridObj.textMatrix(i, gridObj.colref("drugtodd")) = agenttodd;
- gridObj.textMatrix(i, gridObj.colref("drugtotm")) = agenttotm;
- }
- }
- gridObj.rebuild();
- model.refresh();
- }
- /**
- * @desc : col = checked : 처방 목록 체크박스 클릭시 처방목록에서 추가/삭제 하고 메인 그리드에서 추가/삭제한다.
- * @
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fCheckedPrcpA01(gridObj, ref, row)
- {
- if (gridObj.col == gridObj.colref("checked")) {
- var checked = model.getValue(ref+"["+ row +"]/checked");
- var depth = model.getValue(ref+"["+ row +"]/depth");
- if (checked == "false" && depth == "1") {
- // 처방목록에서 삭제 하시겠습니까?
- var result = window.alert("처방목록에서 삭제 하시겠습니까?", "", 4 | 32 | 256);
- if (result == 6) { // yes
- // 삭제해주자
- fDelAnstPrcpA01(gridObj, ref, row);
- } else {
- model.setValue(ref+"["+ row +"]/checked", "true");
- model.refresh();
- }
- } else if (checked == "true") {
- // 추가해주자
- fAddAnstPrcpA01(gridObj, ref, row);
- }
- }
- }
- /**
- * @desc : Agent 마스터 그리드 선택시 전체 처방 목록에 추가한다.
- * @ - Agent 의 소분류 01 (Inhalational Agent)
- * @ - 전체 처방목록에 있으면 skip
- * @param :
- * @
- * @return :
- * @author :
- * @---------------------------------------------------
- */
- function fAddAnstPrcpA01(gridObj, ref, row)
- {
- var prcpcd = model.getValue(ref+"[" + row + "]/prcpcd");
- var prcptype = model.getValue(ref+"[" + row + "]/prcptype");
- var clscd = model.getValue(ref+"[" + row + "]/clscd");
- var prcpnm = model.getValue(ref+"[" + row + "]/prcpnm");
- var abbrnm = model.getValue(ref+"[" + row + "]/abbrnm");
- var prcpvol = model.getValue(ref+"[" + row + "]/prcpvol");
- var prcpvolunitnm = model.getValue(ref+"[" + row + "]/prcpvolunitnm");
- var drugmthdcd = model.getValue(ref+"[" + row + "]/drugmthdcd");
- var prcpappyn = model.getValue(ref+"[" + row + "]/prcpappyn");
- var totvolyn = model.getValue(ref+"[" + row + "]/totvolyn");
- var sortno = model.getValue(ref+"[" + row + "]/sortno");
-
- // 처방목록 노드
- var AddRef = "/root/main/anstprcp/item";
-
- // 처방목록에 처방코드가 있는가?
- var cntprcpcd = getNodesetCnt(window.parent.iv_anstprcp.model, AddRef+"[prcpcd = '" + prcpcd + "']");
-
- // 처방목록에 처방코드가 없는가? add
- if ( cntprcpcd > 0 ) {
- alert("이미 추가되었습니다. - [" + prcpnm+ "]");
- return;
- } else {
- // 노드 갯수를 가져온후 노드 하나를 추가한다.
- var dataCnt = getNodesetCnt(window.parent.iv_anstprcp.model, AddRef);
- var checkValue = window.parent.iv_anstprcp.model.getValue(AddRef+"["+dataCnt+"]/prcpnm");
- if (checkValue != "" || dataCnt == "0") {
- dataCnt = dataCnt + 1;
- }
- // 2008.09.23. 어렵다..
- var prcpseqno = 0;
- for (var j=1 ; j <= dataCnt ; j++) {
- var tmp = window.parent.iv_anstprcp.model.getValue(AddRef+"["+ j +"]/prcpcd");
- if (tmp == prcpcd) {
- prcpseqno = window.parent.iv_anstprcp.model.getValue(AddRef+"["+ j +"]/prcpseqno");
- }
- }
- prcpseqno = parseInt(prcpseqno) + 1;
- window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/prcpcd" , prcpcd);
- window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/prcptype" , prcptype);
- window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/prcpvol" , "");
- window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/prcpvolunitnm" , prcpvolunitnm);
- window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/prcpvolunitnm2", prcpvolunitnm);
- window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/prcpnm" , prcpnm);
- window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/abbrnm" , abbrnm);
- window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/drugmthdcd" , drugmthdcd);
- window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/recvol" , "");
- window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/remark" , "");
- window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/clscd" , clscd);
- window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/prcpappyn" , prcpappyn);
- window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/totvolyn" , totvolyn);
- window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/sortno" , sortno);
- window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/pcaflag" , "N");
- window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/checked" , "true");
- // 2008.09.23. 2개이상 처방코드 추가 기록하기.. (fluid일때)
- window.parent.iv_anstprcp.model.makeValue(AddRef+"["+dataCnt+"]/prcpseqno" , prcpseqno);
- window.parent.iv_anstprcp.model.refresh();
- // 그리드 정렬후 노드셋 정렬
- window.parent.iv_anstprcp.window.javascript.fSetAnstPrcp();
- window.parent.javascript.fAddRow(prcptype, prcpcd, sortno, prcpseqno);
- // 메인 그리드 정렬
- window.parent.javascript.fGridSort();
- // 2008.10.03. 검색에서 찾은 처방코드를 선택해 주자~~
- model.setValue("/root/main/agent01/item[prcpcd='" + prcpcd + "']/checked", "true");
- }
- }
- /**
- * @desc : Agent 마스터 그리드 선택 취소시 전체 처방 목록에 삭제한다.
- * @ - Agent 의 소분류 01 (Inhalational Agent)
- * @ - 전체 처방목록에서 del
- * @param :
- * @
- * @return :
- * @author :
- * @---------------------------------------------------
- */
- function fDelAnstPrcpA01(gridObj, ref, row)
- {
- // 처방목록 노드
- var DelRef = "/root/main/anstprcp/item";
- // 노드 갯수를 가져오기
- var dataCnt = getNodesetCnt(window.parent.iv_anstprcp.model, DelRef);
- var prcpcd = model.getValue(ref+"[" + row + "]/prcpcd");
- // 2008.09.23. 2개이상 처방코드 추가 기록하기.. (fluid일때)
- var prcpseqno = model.getValue(ref+"[" + row + "]/prcpseqno");
- // 처방목록에 처방코드가 있는가? 삭제
- for (var j=1 ; j <= dataCnt ; j++) {
- var tmpprcptype = window.parent.iv_anstprcp.model.getValue(DelRef+"[" + j + "]/prcptype");
- var tmpclscd = window.parent.iv_anstprcp.model.getValue(DelRef+"[" + j + "]/clscd");
- var tmpprcpcd = window.parent.iv_anstprcp.model.getValue(DelRef+"[" + j + "]/prcpcd");
- var tmpprcpseqno= window.parent.iv_anstprcp.model.getValue(DelRef+"[" + j + "]/prcpseqno");
- if (tmpprcptype == "A" && tmpclscd == "01" && tmpprcpcd == prcpcd && tmpprcpseqno == prcpseqno) {
- // 전체 처방목록의 항목 삭제
- window.parent.iv_anstprcp.model.destroy(DelRef+"["+ j +"]");
- window.parent.iv_anstprcp.model.refresh();
- // 투여일시 인스턴스도 삭제
- window.parent.fDestroyAnstItem("root/main/anstitem/item", prcpcd, prcpseqno);
- // 그리드 정렬후 노드셋 정렬
- window.parent.iv_anstprcp.window.javascript.fSetAnstPrcp();
- break;
- }
- }
- }
- /**
- * @desc : Agent 의 소분류 01 (Inhalational Agent) 처방적용유무 "N" 인 경우
- * @ - 그리드 전체선택 (처방목록 add) / 전체선택취소 (처방목록 del)
- * @ - >> 사라진 업무 기능 2007.10.10
- * @param :
- * @
- * @return :
- * @author :
- * @---------------------------------------------------
- */
- function fCheckedAgent01n(flag)
- {
- var gridObj = grd_agent01n;
- var ref = "/root/main/agent01n/item";
- if (flag == "true") {
- for (var i = 1 ; i < gridObj.rows ; i++) {
- var prcpcd = model.getValue(ref+"[" + i + "]/prcpcd");
- // 처방목록 노드
- var AddRef = "/root/main/anstprcp/item";
- // 처방목록에 처방코드가 있는가?
- var cntprcpcd = getNodesetCnt(model, AddRef+"[prcpcd = '" + prcpcd + "']");
- if (cntprcpcd == 0) {
- fAddAnstPrcpA01(gridObj, ref, i);
- }
- }
- }
- if (flag == "false") {
- for (var i = 1 ; i < gridObj.rows ; i++) {
- fDelAnstPrcpA01(gridObj, ref, i);
- }
- }
- }
- /**
- * @group : 혈액리스트 조회
- * @ver : 2007-11-23
- * @by : 이은영
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc :
- * @---------------------------------------------------
- */
- function fGetBlodList()
- {
- //pid = "12158831";
- //ioflag = "o";
- model.makeValue("/root/send/reqdata/pid" , window.parent.iv_anstinfo.window.javascript.pid);
- model.makeValue("/root/send/reqdata/ioflag" , window.parent.iv_anstinfo.window.javascript.ioflag);
- // prcpfromdd, prcptodd (수술예약등록일자, 수술확정일자)
- var prcpfromdd = window.parent.iv_anstinfo.model.getValue("/root/main/oprsrvinfo/rgstdd");
- var prcptodd = window.parent.iv_anstinfo.model.getValue("/root/main/oprsrvinfo/opcnfmdd");
- var ansttodd = window.parent.iv_anstinfo.model.getValue("/root/main/anstinfo/ansttodd");
- model.makeValue("/root/send/reqdata/prcpfromdd" ,prcpfromdd);
- model.makeValue("/root/send/reqdata/prcptodd" ,prcptodd);
- model.makeValue("/root/send/reqdata/ansttodd" ,ansttodd);
- // 혈액리스트 조회하기..
- submit("TRMMR03713");
- }
- /**
- * @group : 약품편람 팝업처리
- * @ver : 2007-12-13
- * @by : 이은영
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc :
- * @---------------------------------------------------
- */
- function fDrugInfo() {
- // model.setValue ( "/root/hidden/receivedata/srchdrugcd", "prcpcd" ));
- modal ( "SMADB01900" );
- }
- /**
- * @group : 혈액리스트 더블클릭시 혈액관련 처방항목 체크하여 항목추가한다.
- * @ver : 2007-12-13
- * @by : 이은영
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc :
- * @---------------------------------------------------
- */
- function fSetBlodChecked() {
- if (grd_blodlist.row < 1) {
- return;
- }
- // 혈액리스트에서 선택된 혈액 처방코드를 읽는다.
- var prcpcd = model.getValue("/root/main/blodlist/item[" + grd_blodlist.row + "]/prcpcd");
- // Blood 처방항목리스트
- var ref = "/root/main/blod/item";
- var gridObj = grd_blod;
- for (var i=1 ; i < gridObj.rows ; i++) {
- var tempprcpcd = model.getValue(ref +"[" + i + "]/prcpcd");
- if (tempprcpcd == prcpcd) {
- model.setValue(ref +"[" + i + "]/checked", "true");
- model.refresh();
- break;
- }
- }
- if (i < gridObj.rows) {
- btn_addblod.dispatch("DOMActivate");
- } else {
- alert("마스터에 등록된 혈액종류가 아닙니다.");
- }
- }
- /**
- * @group : 혈액리스트 마우스 우클릭 후 혈액번호 복사 버튼 클릭 시 복사할 대상 행을 체크 할 수 있도록 UI visible
- * @ver : 2010-03-15
- * @by : 주희경
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc :
- * @---------------------------------------------------
- */
- function fSetBlodno()
- {
- model.removeNodeset("/root/temp/blodcopy");
- var rows = parent.grd_prog.rows;
- for(i=1; i<rows; i++)
- {
- model.makeNode("/root/temp/blodcopy["+i+"]/chk");
- model.makeValue("/root/temp/blodcopy["+i+"]/seq", i);
- }
- grd_blodcopylist.rebuild();
- grup_blodcopyform.attribute("visibility") = "visible";
- }
- /**
- * @group : 복사할 대상 행을 체크 하고 확인 버튼을 누르면 progress에 대상 혈액번호를 copy해준다.(single, multi)
- * @ver : 2010-03-15
- * @by : 주희경
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc :
- * @---------------------------------------------------
- */
- function fCopyBlodno()
- {
- grup_blodcopyform.attribute("visibility") = "hidden";
- var seq = model.getValue("/root/temp/blodcopy[chk='true']/seq");
- var blodno = "";
- if (grd_blodlist.selectedRows > 1)
- {
- for(i=0; i<grd_blodlist.selectedRows; i++ )
- {
- blodno = blodno + grd_blodlist.valueMatrix(grd_blodlist.selectedRow(i), grd_blodlist.colref("prepblodseqno")) + ", "
- }
- }
- else
- {
- blodno = grd_blodlist.valueMatrix(grd_blodlist.row, grd_blodlist.colref("prepblodseqno")) + ", ";
- }
-
- var predata = parent.grd_prog.valueMatrix(seq, parent.grd_prog.colref("progrec"));
- if (predata != "")
- {
- predata = predata + ", ";
- }
- parent.grd_prog.valueMatrix(seq, parent.grd_prog.colref("progrec")) = predata + blodno.substr(0, blodno.length-2);
- parent.grd_prog.resizeCells();
- }
|