123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254 |
- <?xml version="1.0" encoding="utf-8"?>
- <Script type="xscript4.0"><![CDATA[var arErrorCode = new HashArray();
- /**
- * @desc : 간호파트 전자동의서 처리 공통 모듈
- * @param : pid, cretno, indd, instcd, formcd, rexnm
- * @return : 없음
- * @authur : 김지선 2013.03.14 (TF) --> 김도형 2016.07.06 (XP)
- */
- // 전자동의서 사용시 각 화면에서 Timer 적용 필수!
- function fElecPrint(pid, cretno, indd, instcd, formcd, ocrtag, rexnm) {
- var lgv_Foldernm = system.convertRealPath("%MYDOCUMENT%") + "\KU20\\report";
-
- var flag = "";
-
- var bTimer = false;
-
- if (rexnm.length > 1) { // Rex로 만들어지는 동의서의 경우에만 이미지로 전환
-
- //기존파일 삭제
- // 기존파일 삭제 후 생성
- try{
- var objFileList = VirtualFile.getFileList(lgv_Foldernm, "*", VirtualFile.findFileOnly);
- for(var i=0; i<objFileList.length; i++){
- sFileName = objFileList[i].filename;
- bDeleteFile = VirtualFile.delete(lgv_Foldernm+"\\"+sFileName);
- }
- }catch(e){
- }
-
- var sFileName = lgv_Foldernm + "\\"+ pid + "_" + rexnm + ".jpg";
-
- var fileType = "jpeg"; //hwp, bmp, jpeg, pdf
-
- //전체조회시 reptdoc가 00이므로
- var objDOM = rptf_createDOM();
- var objParam = new Object();
- objParam.xml_data_XML1 = objDOM.documentElement.source; // 최상의노드 XML 스트링 추출
- //var option = "open=1;save=1;directprint=1;printdialog=0;print=1;zoom=0;";
-
- // exeReportPreview(rexnm, "XMLSTR", "", "", "false", "false", fileType, pid+"_"+rexnm, "0", "true", "", "", "", "", "", "");
- var option = "open=1;save=1;export=1;exportdialog=0;exporttype=jpg;printdailog=0;print=1;zoom=0;exportfilename="+sFileName+";";
- rptf_exeReportPreview30([rexnm],[objParam], option);
-
- frmf_setParameter("SSMRC03160_param_imgpath", lgv_Foldernm);
- frmf_setParameter("SSMRC03160_param_signpageformcd","1300013787");
- frmf_setParameter("SSMRC03160_param_ocrtag", ocrtag);
-
- flag = "Q";
-
- this.setTimer(1, 4000);
- bTimer = true;
-
- } else {
-
- flag = rexnm;
-
- }
-
- frmf_setParameter("SSMRC03160_param_patid", pid);
- frmf_setParameter("SSMRC03160_param_cretno", cretno);
- frmf_setParameter("SSMRC03160_param_indate", indd);
- frmf_setParameter("SSMRC03160_param_instcd", instcd);
- frmf_setParameter("SSMRC03160_param_class", "I");
- frmf_setParameter("SSMRC03160_param_docucd", formcd);
- frmf_setParameter("SSMRC03160_param_cuser", sysf_getUserId());
- frmf_setParameter("SSMRC03160_param_flag", flag);
- frmf_setParameter("SSMRC03160_param_tmflag", "N");
-
- // open("SSMRC03160");
- if( bTimer == false )
- frmf_open("SSMRC03160", "SSMRC03160", "", "", "", "", "", "", "", "", "", "", "M");
- }
- /**
- * @desc : 퇴원간호계획 xp 컨버젼시 사용되는 곳이 없어서 삭제
- * @param : formcd, elecflag
- * @return : 없음
- * @authur : 김도형 2016.07.06
- */
- function fClickPrintBtn(formcd, elecflag) {
-
- // var pid = model.getValue("/root/temp/cond/list/pid");
- // var cretno = model.getValue("/root/temp/cond/list/cretno");
- // var indd = model.getValue("/root/temp/cond/list/indd");
-
- dsf_setTypeFormat(ds_temp_cond, "cretno:INT");
-
- var pid = grp_biz.import1.ds_temp_cond.getColumn(0, "pid");
- var cretno = grp_biz.import1.ds_temp_cond.getColumn(0, "cretno");
- var indd = grp_biz.import1.ds_temp_cond.getColumn(0, "indd");
-
-
- var ocrtag = "" ;
-
-
- // model.makeValue("/root/send/req/formcd", formcd);
- // model.makeValue("/root/send/req/pid", pid);
- // model.makeValue("/root/send/req/cretno", cretno);
- // model.makeValue("/root/send/req/orddd", indd);
-
- ds_send_req.clear();
-
- dsf_createDsRow("ds_send_req", [
- {col:"formcd", type:"STRING", size:256, val: formcd}
- , {col:"pid", type:"STRING", size:256, val: pid}
- , {col:"cretno", type:"STRING", size:256, val: cretno }
- , {col:"indd", type:"STRING", size:256, val: indd}
- ]);
-
-
-
-
- if (elecflag == "Y") { // 전자 동의서의 경우 무조건 신규 출력 2013.04.08 KJS
-
- fPrintDschInfo("newprint", ocrtag, elecflag);
- trace("YYY");
-
- } else { // 출력 동의서의 경우 규칙에 따라 (출력 유무, 스캔 유무에 따라 신규출력 or 재출력)
- trace("NNN");
- var oParam = {};
- oParam.id = "TRMNW15101";
- oParam.service = "wardcareapp.WardDschCareRec";
- oParam.method = "reqGetDupPrntCheck";
- oParam.inds = "req=ds_send_req";
- oParam.outds = "ds_duplorcprnt_msginfo=prntinfo";
- oParam.async = false;
- oParam.callback = "cf_TRMNW15101";
- tranf_submit(oParam);
-
- if (arErrorCode.pop("TRMNW15101") > -1){
-
-
- if(ds_duplorcprnt_msginfo.rowcount > 0 ) { // 출력했던 건인 경우
- if(ds_duplorcprnt_msginfo.getColumn(0, "scanyn") == "N"){ // 스캔된건이 없는경우
- if(ds_duplorcprnt_msginfo.getColumn(0, "statcd") == "D" || ds_duplorcprnt_msginfo.getColumn(0, "statcd") == "CP"){ // 삭제/출력취소 된 건인 경우
- //신규출력
- fPrintDschInfo("newprint", ocrtag, elecflag);
-
- }else{
- // 재출력
- ocrtag = ds_duplorcprnt_msginfo.getColumn(0, "ocrtag");
- fPrintDschInfo("reprint", ocrtag, elecflag);
- }
-
- }else if(ds_duplorcprnt_msginfo.getColumn(0, "scanyn") == "Y"){ // 스캔된건이 있는경우
- //신규출력
- var rtnval = sysf_messageBox("스캔 완료된 출력물이 있습니다. 신규출력하시겠습니까?\n(신규출력할 경우 의무기록실에 이전에 스캔된 퇴원간호계획지 삭제를 요청하시기 바랍니다.)", "Q"); // return : yes=6
- if(rtnval == "6"){ // yes
- fPrintDschInfo("newprint", ocrtag, elecflag);
- }else{
- return;
- }
- }
- }else{
- // 신규출력
- fPrintDschInfo("newprint", ocrtag, elecflag);
- }
- }
- }
- }
- function cf_TRMNW15101(sSvcId, nErrorCode, sErrorMsg) {
- arErrorCode.push(sSvcId, nErrorCode);
- }
-
- /**
- * @desc : 간호파트 퇴원교육확인서 OCR 처리 공통 모듈
- * @param : left, top, pid, indd, cretno, ordtype, formcd
- * @return : 없음
- * @authur : 김지선 2013.05.16 ( TF ) --> 김도형 2016.07.06 (XP)
- */
- function fOCRPrint(left, top, pid, indd, cretno, ordtype, formcd) {
-
- frmf_setParameter("formcd",formcd);
- frmf_setParameter("pid", pid);
- frmf_setParameter("orddd", indd);
- frmf_setParameter("cretno", cretno);
- frmf_setParameter("ordtype", ordtype);
-
- //open("SSMRF03700",1,left,top);
- frmf_open("SSMRF03700", "SSMRF03700", null, null, 1, left, top, null, null, null, null, null, "M");
-
- }
- /**
- * @desc : 퇴원간호계획 - 출력(환자교육출력물 포함), 환자교육출력물 클릭 시 본원 정신과 퇴원통지서 출력토록 수정
- * @param : 없음
- * @return : 없음
- * @authur : AYS 2017.04.21
- */
- function fPsyDschNotiPrintBtn() {
- var exist = ds_hidden_existinfo.getColumn(0, "exist");
- if(exist != "Y") {
- trace("PsyPrntLogic Stop - Not Saved");
- //sysf_messageBox("저장 안됨.", "I");
- return;
- }
- var deptcd = ds_temp_cond.getColumn(0, "wardcd");
- var userdept = sysf_getUserInfo("dutplcecd");
- var spiritdept = ds_codelist.lookupExpr("cdgrupid =='U31'", "cdid");
- if(deptcd == spiritdept && userdept == spiritdept) {
- trace("PsyPrntLogic Start");
-
- dsf_setTypeFormat(ds_temp_cond, "cretno:INT");
-
- var pid = grp_biz.import1.ds_temp_cond.getColumn(0, "pid");
- var cretno = grp_biz.import1.ds_temp_cond.getColumn(0, "cretno");
- var indd = grp_biz.import1.ds_temp_cond.getColumn(0, "indd");
-
- ds_send_req.clear();
- dsf_createDsRow("ds_send_req", [
- {col:"pid", type:"STRING", size:256, val: pid}
- , {col:"cretno", type:"STRING", size:256, val: cretno }
- , {col:"indd", type:"STRING", size:256, val: indd}
- ]);
-
- var oParam = {};
- oParam.id = "TRMMR09101";
- oParam.service = "medirecapp.ExtnMediRec";
- oParam.method = "reqGetProfDschYN";
- oParam.inds = "req=ds_send_req";
- oParam.outds = "ds_psydschinfo=cntlist";
- oParam.async = false;
- oParam.callback = "cf_TRMMR09101";
- tranf_submit(oParam);
-
- if (arErrorCode.pop("TRMMR09101") > -1){
- trace("PsyPrntLogic Submit OK");
- if(ds_psydschinfo.rowcount > 0 ) {
- if(ds_psydschinfo.getColumn(0, "cnt") == "1" && !utlf_isNull(ds_psydschinfo.getColumn(0, "formrecseq"))){
- lf_RecPrnt(ds_psydschinfo.getColumn(0, "formrecseq"))
- trace("PsyPrnt 출력");
- }else{
- trace("PsyPrnt 미출력");
- }
- }
- }
- }
- }
- function cf_TRMMR09101(sSvcId, nErrorCode, sErrorMsg) {
- arErrorCode.push(sSvcId, nErrorCode);
- }
- ]]></Script>
|