123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197 |
- var admissionPath = "/root/admission";
- var outsidePath = "/root/outside";
- /*
- 외래 : 투약내역 화면 초기화
- */
- function fOutSideInitialize() {
- model.setValue(outsidePath+"/send/search/type", "0");
- model.setValue(outsidePath+"/send/search/begindate", getNewDate().getAddDate(-7, "D").getDateFormat("YYYYMMDD"));
- model.setValue(outsidePath+"/send/search/enddate", getCurrentDate());
- model.removenode(outsidePath+"/main/druglist/item");
- model.removenode(outsidePath+"/main/patientlist/item");
-
- //진료과 콤보
- submit("TRADM00202");
- }
- /*
- 외래 : 약품 리스트
- */
- function fOutSideSearch() {
- var begindate = model.getValue("/root/outside/send/search/begindate");
- var enddate = model.getValue("/root/outside/send/search/enddate");
- if (begindate == "") {
- messageBox("조회기간 시작날짜는 ", "I003");
- model.setFocus("ipt_begindate");
- return;
- }
- if (enddate == "") {
- messageBox("조회기간 종료날짜는 ", "I003");
- model.setFocus("ipt_enddate");
- return;
- }
- submit('TRADM00401');
- model.removenode("/root/outside/main/patientlist");
- model.makeNode("/root/outside/main/patientlist");
- grd_patient.refresh();
- if (model.getXPathValue("count(/root/outside/main/druglist/item)") == 0) {
- messageBox("", "E013");
- }
- }
- /*
- 외래/입원 : 조회 조건 약품 팝업
- */
- function fSearchDrugOpt(dtype) {
- var tmpPath = "";
- if (dtype == "outside") {
- tmpPath = outsidePath;
- } else if (dtype == "admission") {
- tmpPath = admissionPath;
- }
- model.setValue(tmpPath+"/temp/receivedata/receiveref", tmpPath+"/temp/usrSelectDrugcd");
-
- modal( "SPADB60100", 0, 100, 150, "SPADB60100", tmpPath+"/temp/receivedata", "/root/temp/receivedata" );
- var selectCd = model.getValue(tmpPath+"/temp/usrSelectDrugcd");
- var cd = model.getValue(tmpPath+"/send/search/drugcds");
- var nm = model.getValue(tmpPath+"/send/search/drugnm");
- if (selectCd != "") {
- model.setValue(tmpPath+"/send/usrSelectDrugcd", selectCd);
- TRADM00302.attribute("ref") = tmpPath+"/send";
- TRADM00302.attribute("resultref") = tmpPath+"/temp/tmpDrugDetail";
- submit("TRADM00302");
- var detailPath = tmpPath+"/temp/tmpDrugDetail/resultVal";
- var selectNm = model.getValue(detailPath+"/hngnm");
- var delimeter = "";
- if (cd != "") {
- delimeter = " | "
- }
- cd += delimeter + selectCd;
- nm += delimeter + selectNm;
- } else {
- cd = "";
- nm = "";
- }
- model.setValue(tmpPath+"/send/search/drugcds", cd);
- model.setValue(tmpPath+"/send/search/drugnm", nm);
- model.setValue(tmpPath+"/temp/usrSelectDrugcd", "");
- opt_goodcd.refresh();
- opt_goodnm.refresh();
- opt_admission_drugcd.refresh();
- opt_admission_drugnm.refresh();
- }
- /*
- 외래 : 환자 목록 조회
- */
- function fOutSideSearchPatient() {
- if (grd_druglist.isCell(event.target) && grd_druglist.row > 0) {
- var searchPath = "/root/outside/send/searchPatient";
- var conditionPath = "/root/outside/main/druglist/condition";
-
- var selBeginDate = model.getValue(conditionPath+"/begindate");
- var selEndDate = model.getValue(conditionPath+"/enddate");
- var selDeptcd = model.getValue(conditionPath+"/deptcd");
- var selType = model.getValue(conditionPath+"/type");
- var selDrugcd = model.getValue("/root/outside/main/druglist/item["+grd_druglist.row+"]/prcpcd");
-
- model.setValue(searchPath+"/begindate", selBeginDate);
- model.setValue(searchPath+"/enddate", selEndDate);
- model.setValue(searchPath+"/deptcd", selDeptcd);
- model.setValue(searchPath+"/type", selType);
- model.setValue(searchPath+"/drugcd", selDrugcd);
-
- submit("TRADM00402");
- }
- }
- /*
- 외래 : 엑셀 저장
- */
- function fOutSideSaveExcel() {
- var files = window.fileDialog("save","|", true,"","xls","Excel Files(*.xls)|*.xls");
- if (files !="") {
- if (model.getXPathValue("count(/root/outside/main/patientlist/item)") > 0) {
- grd_patient.saveExcel(files);
- } else {
- grd_druglist.saveExcel(files);
- }
- }
- }
- /*
- 입원 : 화면 초기화
- */
- function fAdmissionInitialize() {
- var chkCnt = model.getXPathValue("count(/root/admission/init/deptlist/item)");
- if (chkCnt == 0) {
- model.copyNode(admissionPath+"/init/deptlist", outsidePath+"/init/deptlist");
- model.setValue(admissionPath+"/send/search/begindate", getNewDate().getAddDate(-7, "D").getDateFormat("YYYYMMDD"));
- model.setValue(admissionPath+"/send/search/enddate", getCurrentDate());
- model.removeNode(admissionPath+"/main/admissionlist");
-
- btn_admission_dept.refresh();
- ipt_admission_begindate.refresh();
- ipt_admission_enddate.refresh();
- grd_admission.refresh();
- }
- }
- function fAdmissionSearchPidOpt() {
- model.makeValue("/root/send/srchcond","2");
- modal("SPPMC02500", "", "200", "200", "SPPMC02500",admissionPath+"/temp","/root/send");
- var flag = model.getValue("/root/main/popupendflag");
- var pids = model.getValue(admissionPath+"/send/search/pids");
- var pidn = model.getValue(admissionPath+"/send/search/pidsnm");
- if (flag == "cancel") {
- pids = "";
- pidn = "";
- } else {
- var tmpId = model.getValue("/root/main/patinfo/patinfolist/pid");
- var tmpnm = model.getValue("/root/main/patinfo/patinfolist/hngnm");
- if (pids == "") {
- pids = tmpId;
- pidn = tmpnm;
- } else {
- pids += " | "+tmpId;
- pidn += " | "+tmpnm;
- }
- }
-
- model.setValue(admissionPath+"/send/search/pids", pids);
- model.setValue(admissionPath+"/send/search/pidsnm", pidn);
-
- opt_pids.refresh();
- opt_pidn.refresh();
-
- model.removeNode("/root/main/patinfo/patinfolist");
- model.makeNode("/root/main/patinfo/patinfolist");
- }
- function fAdmissionSearch() {
- submit("TRADM00403");
- }
- function fAdmissionType1Chk() {
- var chkVal = model.getValue(admissionPath+"/send/search/type1");
- if (chkVal == "A0") {
- chk_type2.visible = false;
- model.setValue(admissionPath+"/send/search/type2", "");
- } else {
- chk_type2.visible = true;
- }
- }
- function fAdmissionType2Chk() {
- var chkVal = model.getValue(admissionPath+"/send/search/type2");
- if (chkVal.indexOf("A1") > -1 && chkVal.indexOf("A2") > -1 && chkVal.indexOf("A3") > -1) {
- model.setValue(admissionPath+"/send/search/type2", "");
- chk_type2.visible = false;
- model.setValue(admissionPath+"/send/search/type1", "A0");
- chk_type1.refresh();
- }
- }
|