123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785 |
- /**
- * 파 일 명 : SMADT20300.js
- * 설 명 : 특조 처방전/조제표/집계표/라벨 출력 Javascriot
- * 설 계 자 : 이훈재
- * 작 성 자 : 이훈재
- * 수정이력 : 2006.9.29 / 최초작성 / 이훈재
- */
- //조회조건에 맞는 데이터가 있는지를 chk
- var chk_drugno = 0;
- var chk_wardcd = 0;
- var chk_pid = 0;
- var chk_cnt = 0;
- /**
- * 초기화
- */
- function fInit() {
- //특수조제실분리
- var drugflag = getScreenMenuParameter();
- model.setValue("/root/hidden/srchinfo/drugflag", drugflag);
-
- if(drugflag == "" || drugflag == "null") {
- model.setValue("/root/hidden/srchinfo/drugflag", "S");
- }
-
- grd_prcplist.fixedcellcheckbox(0,grd_prcplist.colRef("sel")) = true;
- grd_sumlist.fixedcellcheckbox(0,grd_sumlist.colRef("sel")) = true;
- model.setValue("/root/hidden/srchinfo/drugdd", getCurrentDate());
- model.setValue("/root/hidden/srchinfo/drugkindall", "Y");
- model.setValue("/root/hidden/srchinfo/drugkind", "D|B|T|C|1");
-
- model.setValue("/root/hidden/srchinfo/instcd", getUserInfo("dutplceinstcd"));
- if(model.getValue("/root/hidden/srchinfo/instcd") == ""){
- model.setValue("/root/hidden/srchinfo/instcd", "012");
- }
-
- if(model.getValue("/root/hidden/srchinfo/ioflag") == "O") {
- ipt_wardnm.visible = "false";
- button7.visible = "false";
- chk_ward.visible = "false";
- } else if(model.getValue("/root/hidden/srchinfo/ioflag") == "I") {
- ipt_wardnm.visible = "true";
- button7.visible = "true";
- }
-
- //병동 Combo 조회
- model.makeValue("/root/send/deptinfo/deptflag", "W");
- submit("TRADT10203");
- astfAddCombo("/root/hidden/deptlist", "ward", "wardcd,wardnm", "T,전체");
-
- //model.refresh();
-
- //caption19.text = caption19.text + "(" + combo1.label + ")";
-
- //바코드프린터설정 초기화
- model.setValue("/root/send/scrnid", getScreenID());
- submit("TRLLC90101", false);
-
- var comm = model.getValue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/comm02/comm");
- var prntkind = model.getValue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/prntkind");
- if(comm == "2") {
- model.setValue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/comm02/comm", "1");
- }
- if(prntkind == "1") {
- model.setValue("/root/main/barcdprntsetup/prntsetupinfo/setupinfo/prntkind", "5");
- }
-
- // 20101021_laboru_경북대병원_실출고부서 셋팅
- submit("TRADT01106");
- combo3.select(2);
-
- chk_cnt++
- model.makeValue("/root/send/suminfo/mstocdeptcd", model.getValue("/root/hidden/prcpsrch/stocdeptcd"));
- combo3.refresh();
-
- model.refresh();
-
- //1일기준인지 1회기준인지 체크하여 컬럼을 hidden
- var colHidnValue = grdBaseColHidn("D");
- //1회 기준
- if( colHidnValue == "C") {
- grd_prcplist.colHidden(grd_prcplist.colRef("prcpvol")) = true;
- grd_prcplist.colHidden(grd_prcplist.colRef("prcpqty")) = true;
- } else {
- grd_prcplist.colHidden(grd_prcplist.colRef("prcpvol2")) = true;
- grd_prcplist.colHidden(grd_prcplist.colRef("prcpqty2")) = true;
- }
- }
- /**
- * 특수조제 마감
- */
- function fHosSpSum() {
- var prcpflag = model.getValue("/root/hidden/srchinfo/prcpflag");
- var prcpdd = model.getValue("/root/hidden/srchinfo/drugdd");
- var instcd = model.getValue("/root/hidden/srchinfo/instcd");
- var drugkind = model.getValue ("/root/hidden/srchinfo/drugkind");
- var chk ="";
- if(model.getValue("/root/init/autoflag") != "1") {
- chk = messageBox("마감을", "Q004");
- } else {
- chk = 6;
- }
-
- if(chk == 6){
- model.setValue ( "/root/send/suminfo/drugkind", model.getValue ("/root/hidden/srchinfo/drugkind"));
- model.setValue("/root/send/suminfo/prcpdd", prcpdd);
- model.setValue("/root/send/suminfo/prcpflag", prcpflag);
- model.setValue("/root/send/suminfo/instcd", instcd);
- model.setValue("/root/send/suminfo/drugflag", model.getValue("/root/hidden/srchinfo/drugflag"));
- model.setValue("/root/send/suminfo/pid", model.getValue("/root/hidden/srchinfo/pid"));
- model.setValue("/root/send/suminfo/wardcd", model.getValue("/root/hidden/srchinfo/wardcd"));
- //각구분별 마감.( 동시 마감시 구분별 같은 번호가 생성되어 문제됨 )
- if ( drugkind.indexOf("D") >-1 ){
- model.setValue("/root/send/suminfo/kindd","N");
- model.setValue("/root/send/suminfo/kindb","N");
- model.setValue("/root/send/suminfo/kindt","N");
- model.setValue("/root/send/suminfo/kindc","N");
- model.setValue("/root/send/suminfo/kind1","N");
- model.setValue("/root/send/suminfo/kindd","");
- model.refresh();
- submit("TXADT10201");
- }
- if ( drugkind.indexOf("B") >-1 ){
- model.setValue("/root/send/suminfo/kindd","N");
- model.setValue("/root/send/suminfo/kindb","N");
- model.setValue("/root/send/suminfo/kindt","N");
- model.setValue("/root/send/suminfo/kindc","N");
- model.setValue("/root/send/suminfo/kind1","N");
- model.setValue("/root/send/suminfo/kindb","");
- model.refresh();
- submit("TXADT10201");
- }
- if ( drugkind.indexOf("T") >-1 ){
- model.setValue("/root/send/suminfo/kindd","N");
- model.setValue("/root/send/suminfo/kindb","N");
- model.setValue("/root/send/suminfo/kindt","N");
- model.setValue("/root/send/suminfo/kindc","N");
- model.setValue("/root/send/suminfo/kind1","N");
- model.setValue("/root/send/suminfo/kindt","");
- model.refresh();
- submit("TXADT10201");
- }
- if ( drugkind.indexOf("C") >-1 ){
- model.setValue("/root/send/suminfo/kindd","N");
- model.setValue("/root/send/suminfo/kindb","N");
- model.setValue("/root/send/suminfo/kindt","N");
- model.setValue("/root/send/suminfo/kindc","N");
- model.setValue("/root/send/suminfo/kind1","N");
- model.setValue("/root/send/suminfo/kindc","");
- model.refresh();
- submit("TXADT10201");
- }
- if ( drugkind.indexOf("1") >-1 ){
- model.setValue("/root/send/suminfo/kindd","N");
- model.setValue("/root/send/suminfo/kindb","N");
- model.setValue("/root/send/suminfo/kindt","N");
- model.setValue("/root/send/suminfo/kindc","N");
- model.setValue("/root/send/suminfo/kind1","N");
- model.setValue("/root/send/suminfo/kind1","");
- model.refresh();
- submit("TXADT10201");
- }
- }
- }
- /**
- * 마감리스트 조회
- */
- function fSrchsumData() {
- // 20110823_laboru_무균조제 구분 flag 추가
- model.removeNodeset("/root/hidden/srchinfo/srchmugyunflag");
- var s = model.getValue("/root/hidden/srchinfo/drugkind");
- if(s.search("C") >= 0 ) {
- model.makeValue("/root/hidden/srchinfo/srchmugyunflag","Y");
- }
-
- model.copyNode("/root/send/sumlistinfo", "/root/hidden/srchinfo");
- model.setValue("/root/send/sumlistinfo/drugkind", fChkDrugkind(model.getValue("/root/send/sumlistinfo/drugkind")));
- submit("TRADT20302");
- }
- /**
- * 처방 상세조회
- */
- function fSrchPrcpData() {
- if ( (grd_sumlist.iscell(event.target) && model.getValue("/root/main/sumlist/sumlist/sumdd") != "" && grd_sumlist.row >0) || model.getValue("/root/init/autoflag") == "1" ){
- if(grd_sumlist.col != 0 && model.getValue("/root/init/autoflag") != "1"){
- if ( model.getValue("/root/main/sumlist/sumlist[" + grd_sumlist.row + "]/sel")=="Y"){
- model.setValue("/root/main/sumlist/sumlist[" + grd_sumlist.row + "]/sel", "N");
- } else {
- model.setValue("/root/main/sumlist/sumlist[" + grd_sumlist.row + "]/sel", "Y");
- }
- }
- model.refresh();
-
- model.removeNodeset("/root/send/srchinfo/sumlist");
- var cnt = 0;
- for(var i = grd_sumlist.fixedRows; i < grd_sumlist.rows; i++){
- if(model.getValue("/root/main/sumlist/sumlist["+i+"]/sel") == "Y"){
- astfCopyNodeSet("/root/send/srchinfo/sumlist", "/root/main/sumlist/sumlist["+i+"]");
- model.makeValue("/root/send/srchinfo/sumlist[" + (cnt+1) + "]/drugflag", model.getValue("/root/hidden/srchinfo/drugflag"));
- model.makeValue("/root/send/srchinfo/sumlist[" + (cnt+1) + "]/pid", model.getValue("/root/hidden/srchinfo/pid"));
- cnt++;
- }
- }
- if(cnt == 0){
- model.removeNodeset("/root/main/masterinfo/grid1");
- model.refresh();
- } else {
- nodeList = instance1.selectNodes("/root/send/srchinfo/sumlist");
- var rCSV = getNodeListCSV(nodeList);
- model.setValue("/root/send/data1",rCSV);
- submit("TRADT20301");
- }
- for ( i = 1; i<grd_prcplist.rows ; i++){
- model.setValue("/root/main/masterinfo/grid1["+i+"]/sel","Y");
- }
- model.refresh();
-
- } else if(grd_sumlist.fixedcellischeck(0,1) == true){ // 전체 선택
- if(grd_sumlist.row > 0){
- if ( model.getValue("/root/main/sumlist/sumlist[" + grd_sumlist.row + "]/sel")=="Y"){
- model.setValue("/root/main/sumlist/sumlist[" + grd_sumlist.row + "]/sel", "N");
- } else {
- model.setValue("/root/main/sumlist/sumlist[" + grd_sumlist.row + "]/sel", "Y");
- }
- }
- model.refresh();
-
- model.removeNodeset("/root/send/srchinfo/sumlist");
- var cnt = 0;
- for(var i = grd_sumlist.fixedRows; i < grd_sumlist.rows; i++){
- if(model.getValue("/root/main/sumlist/sumlist["+i+"]/sel") == "Y"){
- astfCopyNodeSet("/root/send/srchinfo/sumlist", "/root/main/sumlist/sumlist["+i+"]");
- model.makeValue("/root/send/srchinfo/sumlist[" + (cnt+1) + "]/drugflag", model.getValue("/root/hidden/srchinfo/drugflag"));
- model.makeValue("/root/send/srchinfo/sumlist[" + (cnt+1) + "]/pid", model.getValue("/root/hidden/srchinfo/pid"));
- cnt++;
- }
- }
- if(cnt == 0){
- model.removeNodeset("/root/main/masterinfo/grid1");
- model.refresh();
- } else {
- nodeList = instance1.selectNodes("/root/send/srchinfo/sumlist");
- var rCSV = getNodeListCSV(nodeList);
- model.setValue("/root/send/data1",rCSV);
- submit("TRADT20301");
- }
- for ( i = 1; i<grd_prcplist.rows ; i++){
- model.setValue("/root/main/masterinfo/grid1["+i+"]/sel","Y");
- }
- model.refresh();
-
- } else if(grd_sumlist.fixedcellischeck(0,1) == false) { // 전체 해제
- model.removeNodeset("/root/send/srchinfo/sumlist");
- var cnt = 0;
- for(var i = grd_sumlist.fixedRows; i < grd_sumlist.rows; i++){
- if(model.getValue("/root/main/sumlist/sumlist["+i+"]/sel") == "Y"){
- astfCopyNodeSet("/root/send/srchinfo/sumlist", "/root/main/sumlist/sumlist["+i+"]");
- model.makeValue("/root/send/srchinfo/sumlist[" + (cnt+1) + "]/drugflag", model.getValue("/root/hidden/srchinfo/drugflag"));
- model.makeValue("/root/send/srchinfo/sumlist[" + (cnt+1) + "]/pid", model.getValue("/root/hidden/srchinfo/pid"));
- cnt++;
- }
- }
- if(cnt == 0){
- model.removeNodeset("/root/main/masterinfo/grid1");
- model.refresh();
- } else {
- nodeList = instance1.selectNodes("/root/send/srchinfo/sumlist");
- var rCSV = getNodeListCSV(nodeList);
- model.setValue("/root/send/data1",rCSV);
- submit("TRADT20301");
- }
- for ( i = 1; i<grd_prcplist.rows ; i++){
- model.setValue("/root/main/masterinfo/grid1["+i+"]/sel","Y");
- }
- model.refresh();
-
- }
- }
- function fSrchPrcpDataRe() {
- if ( model.getValue("/root/main/sumlist/sumlist/sumdd") != "" && grd_sumlist.row >0){
-
- model.removeNodeset("/root/send/srchinfo/sumlist");
- var cnt = 0;
- for(var i = grd_sumlist.fixedRows; i < grd_sumlist.rows; i++){
- if(model.getValue("/root/main/sumlist/sumlist["+i+"]/sel") == "Y"){
- astfCopyNodeSet("/root/send/srchinfo/sumlist", "/root/main/sumlist/sumlist["+i+"]");
- model.makeValue("/root/send/srchinfo/sumlist[" + (cnt+1) + "]/drugflag", model.getValue("/root/hidden/srchinfo/drugflag"));
- model.makeValue("/root/send/srchinfo/sumlist[" + (cnt+1) + "]/pid", model.getValue("/root/hidden/srchinfo/pid"));
- cnt++;
- }
- }
- if(cnt == 0){
- model.removeNodeset("/root/main/masterinfo/grid1");
- model.refresh();
- } else {
- nodeList = instance1.selectNodes("/root/send/srchinfo/sumlist");
- var rCSV = getNodeListCSV(nodeList);
- model.setValue("/root/send/data1",rCSV);
- submit("TRADT20301");
- }
- }
- }
- /**
- * 처방전/라벨 출력
- */
- function fPrcpMPSPrint() {
- //처방전 및 라벨 출력
- var chk_mpsflag = model.getValue("/root/hidden/srchinfo/mpsflag");
- var chk_lblyn = model.getValue("/root/hidden/srchinfo/lblyn");
-
- // 20100324_laboru_처방구분, 등록번호, D#, Mix, 약품코드 차례로 다를때 라벨 출력하기 위함.
- var drugno ="";
- var tmpdrugno ="";
- var prcpflagnm = "";
- var pid="";
- var tmppid="";
- var prcpmixno = "";
- var tmpprcpmixno = "";
- var tmpprcpflagnm = "";
- var prtldg = "";
- var tmpprtldg = "";
- var prcpcd = "";
- var tmpprcpcd = "";
-
- var autoyn = model.getValue("/root/init/autoflag"); //자동출력 여부
- var lblprnttims = 0;//라벨출력횟수
- var prnttims = 0;//처방전 출력횟수
- var spclblflag = "Y"; // 20100324_laboru_특조실 라벨 출력 일때.
- //처방전 출력 데이터 조회
- var cnt = 0;
- for(var i = grd_prcplist.fixedRows; i < grd_prcplist.rows; i++){
- if(model.getValue("/root/main/masterinfo/grid1["+i+"]/sel") == "Y"){
-
- prnttims = model.getValue("/root/main/masterinfo/grid1["+i+"]/prnttims");
- lblprnttims = model.getValue("/root/main/masterinfo/grid1["+i+"]/lblprnttims");
- model.copyNode("/root/send/prcpinfo", "/root/main/masterinfo/grid1["+i+"]");
- var drugno = model.getValue("/root/send/prcpinfo/drugno");
- var wardcd = model.getValue("/root/send/prcpinfo/wardcd");
- var pid = model.getValue("/root/send/prcpinfo/pid");
- // 20100322_laboru
- var prcpmixno = model.getValue("/root/send/prcpinfo/prcpmixno");
- var prcpflagnm = model.getValue("/root/send/prcpinfo/prcpflagnm");
- var prtldg = model.getValue("/root/send/prcpinfo/prtldg");
- var prcpcd = model.getValue("/root/send/prcpinfo/prcpcd");
-
- if (tmpdrugno != drugno ){
-
- model.makeValue("/root/send/prcpinfo/drugflag", model.getValue("/root/hidden/srchinfo/drugflag"));
-
- //처방전 출력
- if (chk_mpsflag != "" ) {
- if(autoyn != "1" || prnttims == 0) { //자동출력은 처음 한번만
- fHosInMPSPrint();
- fSleep(2000);
- }
- }
- tmpdrugno=drugno;
- }
-
- // 20100324_laboru_라벨 출력 처방구분
- if(prcpflagnm != tmpprcpflagnm ) {
- if (chk_lblyn != "" ) {
- if(autoyn != "1" || lblprnttims == 0 ) { //자동출력은 처음 한번만
- fHosInLBLPrint();
- fSleep(2000);
- }
- }
- cnt++;
- } else if(pid != tmppid) { // 환자번호
- if (chk_lblyn != "" ) {
- if(autoyn != "1" || lblprnttims == 0 ) { //자동출력은 처음 한번만
- fHosInLBLPrint();
- fSleep(2000);
- }
- }
- cnt++;
- } else if(prtldg != tmpprtldg) { // D#
- if (chk_lblyn != "" ) {
- if(autoyn != "1" || lblprnttims == 0 ) { //자동출력은 처음 한번만
- fHosInLBLPrint();
- fSleep(2000);
- }
- }
- cnt++;
- } else if(prcpmixno != tmpprcpmixno) { // Mix
- if (chk_lblyn != "" ) {
- if(autoyn != "1" || lblprnttims == 0 ) { //자동출력은 처음 한번만
- fHosInLBLPrint();
- fSleep(2000);
- }
- }
- cnt++;
- } else if(prcpcd != tmpprcpcd && prcpmixno == "-") { // 약품코드
- if (chk_lblyn != "" ) {
- if(autoyn != "1" || lblprnttims == 0 ) { //자동출력은 처음 한번만
- fHosInLBLPrint();
- fSleep(2000);
- }
- }
- cnt++;
- } else if(prcpmixno == "-" ) { // prcpmixno 가 "-" 이면서 같은 약품 코드라도 각각 출력. mix 번호가 있고 같은 약품 코드인 경우는 Mix Case 에 걸림.
- if (chk_lblyn != "" ) {
- if(autoyn != "1" || lblprnttims == 0 ) { //자동출력은 처음 한번만
- fHosInLBLPrint();
- fSleep(2000);
- }
- }
- cnt++;
- }
-
- // 20100324_laboru_전 상태 기억
- tmpprcpflagnm = prcpflagnm;
- tmppid = pid;
- tmpprtldg = prtldg;
- tmpprcpmixno = prcpmixno;
- tmpprcpcd = prcpcd;
-
-
- }
- }
- if( cnt == 0){
- messageBox("처방전을 출력할 환자리스트가 없거나 선택된 환자가", "I004");
- }
-
- }
- /**
- * 처방전 출력
- */
- function fHosInMPSPrint() {
- var sParam = "";
- sParam = "drugdd▦drugno▦ioflag▦prcpdd▦orddd▦cretno▦prcpgenrflag▦pid▦orddeptcd▦wardcd▦lblflag▦prcpflag▦prntflag▦drugflag▩";
- sParam += model.getValue("/root/send/prcpinfo/drugdd")+"▦"+
- model.getValue("/root/send/prcpinfo/drugno")+"▦"+
- model.getValue("/root/send/prcpinfo/ioflag")+"▦"+
- model.getValue("/root/send/prcpinfo/prcpdd")+"▦"+
- model.getValue("/root/send/prcpinfo/orddd")+"▦"+
- model.getValue("/root/send/prcpinfo/cretno")+"▦"+
- model.getValue("/root/send/prcpinfo/prcpgenrflag")+"▦"+
- model.getValue("/root/send/prcpinfo/pid")+"▦"+
- model.getValue("/root/send/prcpinfo/orddeptcd")+"▦"+
- model.getValue("/root/send/prcpinfo/wardcd")+"▦"+
- model.getValue("/root/send/prcpinfo/lblflag")+"▦"+
- model.getValue("/root/send/prcpinfo/prcpflag")+"▦"+
- model.getValue("/root/send/prcpinfo/prntflag")+"▦"+
- model.getValue("/root/send/prcpinfo/drugflag")+"▩";
-
- model.setAttribute("params", sParam);
- modal("SPADT63200",0,200,200,"","");
- model.setAttribute("params", "");
- }
- /**
- * 라벨 출력
- */
- function fHosInLBLPrint() {
- var sParam = "";
-
- // 20100323_laboru_prcpno, prcpmixno, spclblflag 추가
- sParam = "drugdd▦drugno▦ioflag▦prcpdd▦orddd▦cretno▦prcpgenrflag▦pid▦orddeptcd▦wardcd▦lblflag▦prcpflag▦prntflag▦drugflag▦prcpno▦prcpmixno▦spclblflag▩";
- sParam += model.getValue("/root/send/prcpinfo/drugdd")+"▦"+
- model.getValue("/root/send/prcpinfo/drugno")+"▦"+
- model.getValue("/root/send/prcpinfo/ioflag")+"▦"+
- model.getValue("/root/send/prcpinfo/prcpdd")+"▦"+
- model.getValue("/root/send/prcpinfo/orddd")+"▦"+
- model.getValue("/root/send/prcpinfo/cretno")+"▦"+
- model.getValue("/root/send/prcpinfo/prcpgenrflag")+"▦"+
- model.getValue("/root/send/prcpinfo/pid")+"▦"+
- model.getValue("/root/send/prcpinfo/orddeptcd")+"▦"+
- model.getValue("/root/send/prcpinfo/wardcd")+"▦"+
- model.getValue("/root/send/prcpinfo/lblflag")+"▦"+
- model.getValue("/root/send/prcpinfo/prcpflag")+"▦"+
- model.getValue("/root/send/prcpinfo/prntflag")+"▦"+
- model.getValue("/root/send/prcpinfo/drugflag")+"▦";
-
- // 20100322_laboru_mix 번호 있을때 없을때 구분.
- if(model.getValue("/root/send/prcpinfo/prcpmixno") == "-") {
- sParam += model.getValue("/root/send/prcpinfo/prcpno")+"▦"+""+"▦"+"Y"+"▦"+"▩";
- } else {
- sParam += ""+"▦"+model.getValue("/root/send/prcpinfo/prcpmixno")+"▦"+"N"+"▦"+"▩";
- }
-
- model.setAttribute("params", sParam);
- model.copyNode("/root/init/barcdprntsetup", "/root/main/barcdprntsetup");
- //modal("SPADT63300",0,200,200,"SPADT63300","/root/init/barcdprntsetup","/root/init/barcdprntsetup");
- modal("SPADT63300",0,200,200,"SPADT63300","/root","/root"); // 20101220 wify 경북대병원 라벨출력방식 rexpert로 변경
- //alert("SMADT20300.js row:503");
- //modal("SPADT63300",0,200,200,"SPADT63300","/root","/root"); // 20101220 wify 경북대병원 라벨출력방식 rexpert로 변경
- //modal("SPADT63303",0,200,200,"SPADT63303","/root","/root"); // 2015년 3월17일 항암주사라벨 출력 김치국
- model.setAttribute("params", "");
- // submit("TRADT10205");
-
- }
- /**
- * 집계표 출력
- */
- function fSumPrint() {
-
-
- model.removeNodeset("/root/send/srchinfo/sumlist");
- var cnt = 0;
- var cntD = 0;
- var cntB = 0;
- var cntT = 0;
- var cnt1 = 0;
- var cntC = 0;
- var sumcls = "";
- for(var i = grd_prcplist.fixedRows; i < grd_prcplist.rows; i++){
- if(model.getValue("/root/main/masterinfo/grid1["+i+"]/sel") == "Y"){
- astfCopyNodeSet("/root/send/srchinfo/sumlist", "/root/main/masterinfo/grid1["+i+"]");
- cnt++;
- if(model.getValue("/root/main/masterinfo/grid1["+i+"]/sumcls") == "D"){
- cntD++;
- } else if(model.getValue("/root/main/masterinfo/grid1["+i+"]/sumcls") == "B"){
- cntB++;
- } else if(model.getValue("/root/main/masterinfo/grid1["+i+"]/sumcls") == "T"){
- cntT++;
- } else if(model.getValue("/root/main/masterinfo/grid1["+i+"]/sumcls") == "1"){
- cnt1++;
- } else {
- cntC++;
- }
- }
- }
-
- model.refresh();
- if(cnt == 0){
- messageBox("마감리스트에서 출력할 데이터를", "C002");
- } else {
- // 20100205 이선경 수정 : 마감일자로도 조회되도록 적용일자, 마감일자 구분자 셋팅
- model.makeValue("/root/send/srchinfo/sumlist/timeflag", model.getValue("/root/hidden/srchinfo/timeflag"));
-
- if(cntD > 0) {
- model.setValue("/root/send/srchinfo/sumlist/sumcls", "D");
- submit("TRADT20303");
- if(getNodesetCount("/root/main/sumprintlist/sumlist") > 0) {
- exeReportPreview("RPADT20302", "XMLSTR", "", "", "true","","","","","true");
- }
- }
-
- if(cntB > 0) {
- model.setValue("/root/send/srchinfo/sumlist/sumcls", "B");
- submit("TRADT20303");
- if(getNodesetCount("/root/main/sumprintlist/sumlist") > 0) {
- exeReportPreview("RPADT20302", "XMLSTR", "", "", "true","","","","","true");
- }
- }
-
- if(cntT > 0) {
- model.setValue("/root/send/srchinfo/sumlist/sumcls", "T");
- submit("TRADT20303");
- if(getNodesetCount("/root/main/sumprintlist/sumlist") > 0) {
- exeReportPreview("RPADT20302", "XMLSTR", "", "", "true","","","","","true");
- }
- }
-
- if(cnt1 > 0) {
- model.setValue("/root/send/srchinfo/sumlist/sumcls", "1");
- submit("TRADT20303");
- if(getNodesetCount("/root/main/sumprintlist/sumlist") > 0) {
- exeReportPreview("RPADT20302", "XMLSTR", "", "", "true","","","","","true");
- }
- }
-
- if(cntC > 0) {
- model.setValue("/root/send/srchinfo/sumlist/sumcls", "C");
- submit("TRADT20303");
- if(getNodesetCount("/root/main/sumprintlist/sumlist") > 0) {
- exeReportPreview("RPADT20302", "XMLSTR", "", "", "true","","","","","true");
- }
- }
-
- }
-
- }
- /**
- * 조제표 출력
- */
- function fPrcpListPrnt() {
- var ioflag = "";
- var sumcls = "";
- //var cnt = 0;
- var cntD = 0;
- var cntB = 0;
- var cntT = 0;
- var cnt1 = 0;
- var cntC = 0;
-
- //2010-03-20 TPN 조제표 코드별 집계 표시
- model.removeNodeset("/root/temp/prntdrugsumlist");
-
- for(var i = grd_prcplist.fixedRows; i < grd_prcplist.rows; i++){
- if(model.getValue("/root/main/masterinfo/grid1["+i+"]/sel") == "Y"){
- //ioflag = model.getValue("/root/main/sumlist/sumlist["+i+"]/ioflag");
- sumcls = model.getValue("/root/main/masterinfo/grid1["+i+"]/sumcls");
-
- /*
- if(sumcls == "D"){
- //항암제 조제표
- if(ioflag == "I"){
- exeReportPreview("RPADT20303", "XML", "/root/main/sumlist/sumlist["+i+"]", "", "true","","","","","true");
- cnt++;
- } else {
- exeReportPreview("RPADT20304", "XML", "/root/main/sumlist/sumlist["+i+"]", "", "true","","","","","true");
- cnt++;
- }
- } else {
- //항암제 이외의 조제표
- exeReportPreview("RPADT20305", "XML", "/root/main/sumlist/sumlist["+i+"]", "","true","","","","","true");
- cnt++;
- }
- */
-
- if(sumcls == "D") {
- //항암제 조제표 개수
- cntD++;
- } else if(sumcls == "B") {
- //소아TPN 조제표 개수
- cntB++;
- } else if(sumcls == "T") {
- //TPN 조제표 개수
- cntT++;
- } else if(sumcls == "1") {
- //면역억제제 조제표 개수
- cnt1++;
- } else {
- //무균조제 조제표 개수
- cntC++;
- }
-
- //2010-03-20 TPN 조제표 코드별 집계 표시([특조완료]인경우만 Count) Start
- if ( (sumcls == "T") || (sumcls == "B") ) { //TPN(T) 및 소아TPN(B)일경우만 해당
-
- var Tmpdrugstat = model.getValue("/root/main/masterinfo/grid1["+i+"]/drugstat");
- var Tmpdrugstatnm = model.getValue("/root/main/masterinfo/grid1["+i+"]/drugstatnm");
- if( Tmpdrugstat != "ND" && Tmpdrugstatnm != "반환" ) { //조제보유 및 반환이 아닌경우만 Count
- var Tmp_sumclsPath = "";
- if (sumcls == "T") Tmp_sumclsPath = "/root/temp/prntdrugsumlist/sumclsT";
- if (sumcls == "B") Tmp_sumclsPath = "/root/temp/prntdrugsumlist/sumclsB";
- Tmp_drugcd = model.getValue("/root/main/masterinfo/grid1["+i+"]/prcpcd");
- Tmp_prcpqty = model.getValue("/root/main/masterinfo/grid1["+i+"]/prcpqty");
- var rowcnt = getNodesetCount(Tmp_sumclsPath + "/prntdrugsum");
- var TmpTotCnt = 0;
- var drugcnt = 0;
- if ( Number(rowcnt) > 0) {
- for(var j = 1; j <= rowcnt; j++){
- if ( model.getValue (Tmp_sumclsPath + "/prntdrugsum[" + j + "]/drugcd") == Tmp_drugcd ) { //동일코드 있을경우 갯수 더하기
- drugcnt = Number(model.getValue (Tmp_sumclsPath + "/prntdrugsum[" + j + "]/sum")) + Number(Tmp_prcpqty);
- model.makeValue (Tmp_sumclsPath + "/prntdrugsum[" + j + "]/sum" , drugcnt);
- TmpTotCnt ++;
- }
- }
- }
- if ((sumcls == "B") && (Number(rowcnt) ==0) ) { //소악TPN에 [DLMCT1]란 빈공란 추가
- model.makeValue(Tmp_sumclsPath + "/prntdrugsum[1]/drugcd" , "DLMCT1");
- model.makeValue(Tmp_sumclsPath + "/prntdrugsum[1]/sum" , "");
- rowcnt++;
- }
- if (TmpTotCnt == 0 ) { //해당되는 코드가 없을 경우는 생성.
- model.makeValue(Tmp_sumclsPath + "/prntdrugsum["+ (Number(rowcnt)+1) +"]/drugcd" , Tmp_drugcd);
- model.makeValue(Tmp_sumclsPath + "/prntdrugsum["+ (Number(rowcnt)+1) +"]/sum" , Tmp_prcpqty);
- }
- }
- }
- //2010-03-20 TPN 조제표 코드별 집계 표시([특조완료]인경우만 Count) End
- }
- }
-
- if(cntD == 0 && cntT == 0 && cntB == 0 && cntC == 0 && cnt1 == 0){
- messageBox("마감리스트에서 출력할 데이터를", "C002");
- }
-
- if(cntD > 0) {
- exeReportPreview("RPADT20303", "XMLSTR", "", "", "true","","","","","true", "", "");
- }
-
- if(cntB > 0) {
- exeReportPreview("RPADT20305", "XMLSTR", "", "","true","","","","","true", "", "");
- }
-
- if(cntT > 0) {
- exeReportPreview("RPADT20308", "XMLSTR", "", "","true","","","","","true", "", "");
- }
-
- if(cnt1 > 0) {
- exeReportPreview("RPADT20310", "XMLSTR", "", "","true","","","","","true", "", "");
- }
-
- if(cntC > 0) {
- exeReportPreview("RPADT20309", "XMLSTR", "", "","true","","","","","true", "", "");
- }
-
- }
- /**
- * 반환리스트 출력
- */
- function fRtnListPrnt() {
- if(model.getValue("/root/hidden/srchinfo/ioflag") == "I"){
- model.removeNodeset("/root/hidden/rtninfo");
- astfCopyNodeSet("/root/hidden/rtninfo", "/root/hidden/srchinfo");
- var matrix_val = model.getValue("/root/hidden/rtninfo/drugkind");
- var col_data = "";
- var drugkind = "";
- var col_flag = "|";
- col_data = matrix_val.split(col_flag); //구분자를 통한 array 생성
- var chk = col_data.length;
- for(var i=0; i < chk; i++){
- if ( drugkind == "" ) {
- drugkind = "'" + col_data[i] + "'";
- } else {
- drugkind += ",'" + col_data[i] + "'";
- }
- }
- model.setValue("/root/hidden/rtninfo/drugkind", drugkind);
- //1일기준인지 1회기준인지 체크하여 컬럼을 hidden
- var colHidnValue = grdBaseColHidn("D");
- if( colHidnValue == "C") {//1회 기준
- model.makeValue("/root/hidden/rtninfo/prcpqtychk", 'Y');
- }
- exeReportPreview("RPADT20306", "XML", "/root/hidden/rtninfo", "", "");
- exeReportPreview("RPADT20307", "XML", "/root/hidden/rtninfo", "", "");
- } else {
-
- }
-
- }
- /**
- * 처방구분 만들기
- */
- function fChkDrugkind(sDrugkind) {
- var arrVal = sDrugkind.split("|");
- var dk_val = "";
- for( var i = 0; i< arrVal.length; i++ ) {
- if(dk_val == ""){
- if(arrVal[i] == "T"){
- dk_val = "T|Q";
- } else {
- dk_val = arrVal[i];
- }
- } else {
- if(arrVal[i] == "T"){
- dk_val += "|T|Q";
- } else {
- dk_val += "|"+arrVal[i];
- }
- }
- }
- return dk_val;
- }
- function fSleep(numberMillis) {
- var now = new Date();
- var exitTime = now.getTime() + numberMillis;
- while (true) {
- now = new Date();
- if (now.getTime() > exitTime)
- return;
- }
- }
|