123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206 |
- function fInit() {
- var vPath = "/root/main/paminfo";
- //grd_prcplist.fixedcellcheckbox(0, 0) = true;
- model.setValue("/root/send/cond/cond1", parent.opener.opener.model.getValue(vPath + "/pid"));
- model.setValue("/root/send/cond/cond2", getNewDate().getAddDate(-6, "M").getDateFormat("YYYYMMDD"));
- model.setValue("/root/send/cond/cond3", "0"); //처방권한 구분
- model.setValue("/root/send/cond/cond4", getCurrentDate()); //처방일자
- model.setValue("/root/send/cond/cond5", "bfprcp"); //전처방 where 조건 구분자
- model.setValue("/root/send/cond/cond6", "" ); //최초구분
- model.setValue("/root/send/cond/cond7", parent.opener.opener.model.getValue(vPath + "/orddrid"));
- model.setValue("/root/send/cond/cond8", getCurrentDate());//parent.opener.opener.model.getValue(vPath + "/orddd"));
- model.setValue("/root/send/cond/cond9", parent.opener.opener.model.getValue(vPath + "/ordtype"));
- model.setValue("/root/send/cond/cond10", parent.opener.opener.model.getValue(vPath + "/orddeptcd"));
- model.setValue("/root/send/cond/cond11", parent.opener.opener.model.getValue(vPath + "/cretno"));
- model.setValue("/root/send/cond/cond97", "fromto");
- model.setValue("/root/send/cond/cond98", parent.opener.opener.model.getValue(vPath + "/hngnm"));
-
- fGetPrcpList();
- model.refresh();
- }
- /**
- * @desc :환자처방정보 가져오기
- * @id :
- * @event : onclick
- * @return : void
- * @authur : 박종훈
- */
- function fGetPrcpList() {
- grd_prcplist.rebuildStyle();
- var pageInfo = new PAGEINFO();
- var prcpdd = getCurrentDate();
-
- var curprcpdd = opener.opener.model.getValue ( "/root/init/prcpdd" );
- if (isNull(curprcpdd)) {
- curprcpdd = opener.model.getValue ( "/root/init/prcpdd" );
- if (isNull(curprcpdd)){
- curprcpdd = getCurrentDate();
- }
- }
-
-
- var insukind = opener.opener.model.getValue ( "/root/paminfo/list/insukind");
-
- if (isNull(insukind)) {
- insukind = model.getValue ( "/root/paminfo/list/insukind");
- }
-
- if (!isNull(insukind)){
- model.setValue( "/root/send/cond/cond13", insukind ); //외래follow up
- }
-
- model.setValue("/root/send/cond/cond14", curprcpdd );
- model.setValue("/root/send/cond/cond99", "getBfPrcpSrchInfo" );//검색구분
-
- //처방정보 가져오기(퇴원처방 prcpkindcd = 60)
- if(submit("TRMMO00100")) {
- var iCols = grd_prcplist.cols -1;
- for (var i = 1; i <= getNodesetCount(grd_prcplist.nodeset); i++) {
-
- if (model.getValue(grd_prcplist.nodeset+"["+i+"]/prcpclscd") == "") {
- if (model.getValue("/root/send/cond/cond9") != "O") {
- model.setValue(grd_prcplist.nodeset+"["+i+"]/tempcol6", model.getValue(grd_prcplist.nodeset+"["+i+"]/tempcol6")+" / "+model.getValue(grd_prcplist.nodeset+"["+i+"]/tempcol7"));
- }
- grd_prcplist.isReadonly(i, grd_prcplist.colRef("chkcol")) = false;
- grd_prcplist.mergeByFree(i, 3, i, iCols);
- grd_prcplist.rowStyle(i, "data", "font-weight") = "bold";
- } else {
- grd_prcplist.isReadonly(i, grd_prcplist.colRef("chkcol")) = true;
- }
- }
- }
- }
- /**
- * 선택한 처방 내역 복사 후 창 닫기
- */
-
- function fCnfm() {
- var pageInfo = new PAGEINFO();
- var prcpkind = ""; //처방종류
- var orgprcpnm = ""; //처방명
- var drugmthdspccdnm = ""; //용법
- var prcpdelivefact = ""; //전달사항
- var prcplist = "";
- var prcphistcd = ""; //임시,인증구분
- var prcpclscd = "";
-
- var tmpdrugmthdspccdnm = "";
- var itemCd = "0000080001"; //처방 버튼id에서 가져옴
-
- var nodelistPrcpinfo = model.instances(0).selectNodes("/root/prcpsrch/prcplist[chkcol = 'true' and prcpkindcd != '' and prcphistcd != 'C' and prcphistcd != 'L' and prcphistcd != 'E']");
- if(nodelistPrcpinfo.length >= 1){
- for(var i = 1; i <= nodelistPrcpinfo.length; i++)
- {
- var subNode = nodelistPrcpinfo.item(i - 1);
- //orgprcpnm = subNode.selectSingleNode("orgprcpnm").text;
- tmpdrugmthdspccdnm = subNode.selectSingleNode("drugmthdspccdnm").text;
- prcpkind = subNode.selectSingleNode("tempcol13").text;
- orgprcpnm = subNode.selectSingleNode("tempcol6").text;
- drugmthdspccdnm = subNode.selectSingleNode("tempcol7").text;
- prcpclscd = subNode.selectSingleNode("prcpclscd").text;
-
- //2012.06.08 처방 가져오기 개인 설정 조회 엄영만
- fGetUserEnvOcsOrdAnsw("/root/send/reqdata", "/root/envinit/getprcpcnt", "033");
- var getprcpcnt = model.getValue("/root/envinit/getprcpcnt/answcnt");
-
- switch(getprcpcnt)
- {
- case "001" : // 기본값 용법 삭제
- drugmthdspccdnm = drugmthdspccdnm.replace(tmpdrugmthdspccdnm, "");
- break;
-
- case "002" : // 약품처방 용법표시
- if (prcpclscd != "A2" && prcpclscd != "A4" && prcpclscd != "A6") {
- drugmthdspccdnm = drugmthdspccdnm.replace(tmpdrugmthdspccdnm, "");
- }
- break;
-
- default:
- drugmthdspccdnm = drugmthdspccdnm.replace(tmpdrugmthdspccdnm, "");
- break;
- }
-
- drugmthdspccdnm = drugmthdspccdnm.replace(/\[급\]|\[일\]|\[본\]|\(집\)|\[home\]|\[임상\]|\[prn\]/g, "");
- prcpdelivefact = subNode.selectSingleNode("prcpdelivefact").text;
- prcphistcd = subNode.selectSingleNode("prcphistcd").text;
-
- if(prcphistcd == "T") {
- if (prcpclscd == "A2" || prcpclscd == "A4" || prcpclscd == "A6") {
- prcplist += "[임] " + orgprcpnm + " " + drugmthdspccdnm + "\n"
- } else {
- prcplist += "[임] " + orgprcpnm + "\n"
- }
- } else {
- if (prcpclscd == "A2" || prcpclscd == "A4" || prcpclscd == "A6") {
- prcplist += orgprcpnm + " " + drugmthdspccdnm + " " + "\n"
- }
- else {
- prcplist += orgprcpnm + "\n"
- }
- }
- }
- }
-
- var prerec = opener.model.getValue(pageInfo.recItemRef + "[fstlevlitemcd='" + itemCd + "']/reccnts");
- if (prerec != "") {
- prerec = prerec + "\n" + prcplist + "\n";
- }
- else {
- prerec = prcplist + "\n"
- }
- model.makeValue("/root/send/pid", model.getValue("/root/send/cond/cond1"));
- if (submit("TRMMR00301")) {
- var nodelistResrvinfo = opener.model.instances(0).selectNodes("/root/main/resvlist");
- var resvinfo
- if (nodelistResrvinfo.length > 0) {
- resvinfo = "진료예약 : ";
- var orddd = "";
- var ordtm = "";
- var orddeptnm = "";
- var orddrnm = "";
- for (var i = 1; i <= nodelistResrvinfo.length; i++) {
- var subNode = nodelistResrvinfo.item(i - 1);
- var orddd = subNode.selectSingleNode("orddd").text;
- var ordtm = subNode.selectSingleNode("ordtm").text;
- var orddeptnm = subNode.selectSingleNode("orddeptnm").text;
- var orddrnm = subNode.selectSingleNode("orddrnm").text;
- if (i == 1) {
- resvinfo += orddd.substr(0, 4) + "-" + orddd.substr(4, 2) + "-"
- + orddd.substr(6, 2) + " " + ordtm.substr(0, 2) + ":"
- + ordtm.substr(2, 2) + ", 진료과 : " + orddeptnm + ", 진료의 : " + orddrnm + "\n";
- } else {
- resvinfo += " " + orddd.substr(0, 4) + "-" + orddd.substr(4, 2) + "-"
- + orddd.substr(6, 2) + " " + ordtm.substr(0, 2) + ":"
- + ordtm.substr(2, 2) + ", 진료과 : " + orddeptnm + ", 진료의 : " + orddrnm + "\n";
- }
- }
- } else {
- resvinfo = "";
- }
- }
- if (resvinfo != "") {
- prerec += resvinfo;
- }
- opener.model.setValue(pageInfo.recItemRef + "[fstlevlitemcd='" + itemCd + "']/reccnts", prerec);
- opener.model.refresh();
- window.close();
- }
- /**
- * 창 닫기
- */
- function fCncl() {
- window.close();
- }
|