123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612 |
- /*
-
- 산부인과 자궁경부 암결과입력(SMMNO04000.xfm - JScript )
- - Version :
- 1) : Ver.1.00.01
- */
- var uijeongbuinstcd="", buchuninstcd="", vincentinstcd="", yeuidoinstcd=""; // 의정부성모,부천성가, 성빈센트병원기관코드
- var seoulinstcd=""; //서울성모기관코드
- var OBGYdeptcd = "";
- /**
- * @desc : 화면 초기화
- * @
- * @param :
- * @event :
- * @return :
- * @---------------------------------------------------
- */
- function fInit(){
- //오늘 날짜로 초기화 하는 부분.(진료일자를 default로 오늘 날짜로 선택함)
- var dt = getCurrentDate();
- model.setValue("/root/main/cond/fromdd", dt);
- model.setValue("/root/main/cond/todd", dt);
-
- grd_obgypatlist.fixedcellcheckbox(0,1) = true;
-
- cmb_base.select(2); //결과일자를 처음 setting
-
- model.setValue("/root/main/cond/srchobgy", "Y");
- model.setValue("/root/main/cond/srchetc", "N");
-
- // 간호 환경설정테이블 조회
- var pCode = "'069','077'"; // 조회할 CdGrupID 코드정보
- var pDate = getCurrentDate(); //조회기준일자
- fGetNursHardCdInfo(pCode, pDate);
-
- for(var i=1; i<=getNodesetCount("/root/code/codeinfo/codelist"); i++){
- switch (model.getValue("/root/code/codeinfo/codelist["+i+"]/cdgrupid")){
- case "069": // 산부인과
- OBGYdeptcd = model.getValue("/root/code/codeinfo/codelist["+i+"]/cdid");
- break;
- case "077": // 의정부성모병원기관코드_20090606
- switch(model.getValue("/root/code/codeinfo/codelist["+i+"]/supcdid")){
- case "01": // (01:서울성모,02:의정부성모,03:부천성가, 04:성빈센트)-20090811
- seoulinstcd = model.getValue("/root/code/codeinfo/codelist["+i+"]/cdid");
- break;
- case "02": // (01:서울성모,02:의정부성모,03:부천성가, 04:성빈센트)
- uijeongbuinstcd = model.getValue("/root/code/codeinfo/codelist["+i+"]/cdid");
- break;
- case "03": // (01:서울성모,02:의정부성모,03:부천성가, 04:성빈센트)
- sunggainstcd = model.getValue("/root/code/codeinfo/codelist["+i+"]/cdid");
- break;
- case "04": // (01:서울성모,02:의정부성모,03:부천성가, 04:성빈센트)
- vincentinstcd = model.getValue("/root/code/codeinfo/codelist["+i+"]/cdid");
- break;
- case "05": // (01:서울성모,02:의정부성모,03:부천성가, 04:성빈센트, 05:여의도성모)
- yeuidoinstcd = model.getValue("/root/code/codeinfo/codelist["+i+"]/cdid");
- break;
-
- }
- }
- }
- fDeptTelNo(); //산부인과 외래전화번호를 조회.
- model.refresh();
- }
- /**
- * @group :
- * @ver : 2010.03.08
- * @by : kys
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 산부인과 외래전화번호를 조회
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fDeptTelNo(){
- model.removeNodeset("/root/send");
- model.makeNode("/root/send");
- model.makeValue("/root/send/fromdd" , model.getValue("/root/main/cond/fromdd"));
- model.makeValue("/root/send/todd" , model.getValue("/root/main/cond/todd"));
- model.makeValue("/root/send/basedd" , model.getValue("/root/main/cond/basedd"));
- model.makeValue("/root/send/pid" , model.getValue("/root/main/cond/pid"));
- model.removenode("/root/temp/depttel");
- if(!submit("TRMNO04004")){
- messageBox("조회를 실패하였습니다.", "E");
- return;
- }else{
-
- }
- }
- /**
- * @group :
- * @ver : 2010.02.25
- * @by : kys
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 자궁경부환자 조회
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fSearch(){
- var condobgyyn = "";
- if(model.getValue("/root/main/cond/pid") == ""){ //등록번호로 조회시에는 Pass
- var fromDate = model.getValue("/root/main/cond/fromdd"); // fromdd
- var toDate = model.getValue("/root/main/cond/todd"); // todd
- var sdaycnt = getDateInterval(fromDate, toDate); // todd - fromdd 일수계산
- if(parseInt(sdaycnt) + 1 > 31){
- messageBox("31일이상은 조회 하실수 없습니다.", "I");
- return;
- }
- }
-
- grd_obgypatlist.fixedcellischeck(0,1) = false; //fixedcell 체크박스 풀기
-
- //20100426-kys-조회조건 추가
- if(model.getValue("/root/main/cond/srchobgy") == "N" && model.getValue("/root/main/cond/srchetc") == "N"){
- messageBox("진료과를 선택하셔야 합니다.", "I");
- return;
- }
-
- if(model.getValue("/root/main/cond/srchobgy") == "Y"){
- condobgyyn = "O"; //산부인과
- }
-
- if(model.getValue("/root/main/cond/srchetc") == "Y"){
- condobgyyn = "E"; //그외 진료과
- }
-
- if(model.getValue("/root/main/cond/srchobgy") == "Y" && model.getValue("/root/main/cond/srchetc") == "Y"){
- condobgyyn = ""; //산부인과 및 그외 진료과
- }
-
- model.removeNodeset("/root/send");
- model.makeNode("/root/send");
-
- model.makeValue("/root/send/fromdd" , model.getValue("/root/main/cond/fromdd"));
- model.makeValue("/root/send/todd" , model.getValue("/root/main/cond/todd"));
- model.makeValue("/root/send/basedd" , model.getValue("/root/main/cond/basedd"));
- model.makeValue("/root/send/pid" , model.getValue("/root/main/cond/pid"));
- model.makeValue("/root/send/condobgyyn" , condobgyyn);
- model.removenode("/root/main/obgypatlist");
- if(!submit("TRMNO04001")){
- messageBox("조회를 실패하였습니다.", "E");
- return;
- }else{
- if(model.getValue("/root/main/cond/basedd") == "1"){
- grd_obgypatlist.caption = "^수납일자^등록번호^성명^센터^진료과^하위부서^주치의^결과^출력^상태^다음예약1^다음예약2^전화번호1^전화번호2^SMS^전송^입원예정일^입원일^수술예정일^우편번호^주소^비고^기관코드^진료일^cretno^특이사항존재여부^msgkey^status";
- }else if(model.getValue("/root/main/cond/basedd") == "2"){
- grd_obgypatlist.caption = "^처방일자^등록번호^성명^센터^진료과^하위부서^주치의^결과^출력^상태^다음예약1^다음예약2^전화번호1^전화번호2^SMS^전송^입원예정일^입원일^수술예정일^우편번호^주소^비고^기관코드^진료일^cretno^특이사항존재여부^msgkey^status";
- }else{
- grd_obgypatlist.caption = "^결과일자^등록번호^성명^센터^진료과^하위부서^주치의^결과^출력^상태^다음예약1^다음예약2^전화번호1^전화번호2^SMS^전송^입원예정일^입원일^수술예정일^우편번호^주소^비고^기관코드^진료일^cretno^특이사항존재여부^msgkey^status";
- }
- //결과가 정상일경우(1) 글씨색 표시(빨강)
- for(var i=1;i<=getNodesetCount("/root/main/obgypatlist/obgypatlistinfo");i++){
- var status = model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ i +"]/status");
- var examrslt = model.getValue("/root/main/obgypatlist/obgypatlistinfo["+i+"]/examrslt")
- if(examrslt == "1" && status == "i"){
- grd_obgypatlist.rowstyle(i, "data", "color") = "#ff0000"; //빨강
- }else{
- grd_obgypatlist.rowstyle(i, "data", "color") = "#000000"; //검정
- }
- }
- }
- button4.value = "□ 특이사항";
- fInitExamRslt(""); //셋팅된 값 클리어
- model.refresh();
- }
- /**
- * @group :
- * @ver : 2010.02.26
- * @by : kys
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 환자의 가장 최근 병리검사 조회
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fPatExamRsltSrch(){
- model.removeNodeset("/root/send");
- model.makeNode("/root/send");
- model.makeValue("/root/send/pid" , model.getValue("/root/temp/pid"));
- model.makeValue("/root/send/histsrchyn" , "N");
-
- model.removenode("/root/temp/examrsltlist");
- if(!submit("TRMNO04002")){
- messageBox("조회를 실패하였습니다.", "E");
- return;
- }else{
- //alert("getNodesetCount(/root/temp/examrsltlist) : " + getNodesetCount("/root/temp/examrsltlist/examrsltlistinfo"));
- if(getNodesetCount("/root/temp/examrsltlist/examrsltlistinfo") > 0){
- model.makeValue("/root/temp/examrslttxt",model.getValue("/root/temp/examrsltlist/examrsltlistinfo/rsltcnts")); //병리검사결과
- model.makeValue("/root/temp/ptno", "★ Lab. No. " + model.getValue("/root/temp/examrsltlist/examrsltlistinfo/ptno")); //병리번호
- var prcpdd = model.getValue("/root/temp/examrsltlist/examrsltlistinfo/prcpdd"); //처방일
- var acptdt = model.getValue("/root/temp/examrsltlist/examrsltlistinfo/acptdt"); //접수시간
- model.makeValue("/root/temp/prcpdd", "☞ 처방시간 : " + prcpdd.toDate().getDateFormat("YYYY-MM-DD") + ", 접수시간 : " + acptdt.toDate("YYYYMMDDhhmmss").getDateFormat("YYYY-MM-DD hh:mm:ss"));
- }else{
- model.removeNode("/root/temp/examrslttxt");
- model.removeNode("/root/temp/ptno");
- model.removeNode("/root/temp/prcpdd");
- }
- tar_examrslt.refresh();
- output3.refresh();
- output4.refresh();
- }
- }
- /**
- * @group :
- * @ver : 2010.03.04
- * @by : kys
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 환자의 병리검사 이력조회
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fPatExamHist(){
- model.removeNodeset("/root/send");
- model.makeNode("/root/send");
- model.makeValue("/root/send/pid" , model.getValue("/root/temp/pid"));
- model.makeValue("/root/send/histsrchyn" , "Y");
-
- model.removenode("/root/temp/patexamhistlist");
- if(!submit("TRMNO04003")){
- messageBox("조회를 실패하였습니다.", "E");
- return;
- }else{
-
- }
- grd_examhist.refresh();
- }
- /**
- * @group :
- * @ver : 2010.03.04
- * @by : kys
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 환자의 병리검사 이력 클릭
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fPatExamHistClick(){
- model.removeNode("/root/temp/examrslttxt");
- model.removeNode("/root/temp/ptno");
- model.removeNode("/root/temp/prcpdd");
- model.makeValue("/root/temp/examrslttxt",model.getValue("/root/temp/patexamhistlist/patexamhistinfo["+ grd_examhist.row +"]/rsltcnts")); //병리검사결과
- model.makeValue("/root/temp/ptno", "★ Lab. No. " + model.getValue("/root/temp/patexamhistlist/patexamhistinfo["+ grd_examhist.row +"]/ptno")); //병리번호
- var prcpdd = model.getValue("/root/temp/patexamhistlist/patexamhistinfo["+ grd_examhist.row +"]/prcpdd"); //처방일
- var acptdt = model.getValue("/root/temp/patexamhistlist/patexamhistinfo["+ grd_examhist.row +"]/acptdt"); //접수시간
- model.makeValue("/root/temp/prcpdd", "☞ 처방시간 : " + prcpdd.toDate().getDateFormat("YYYY-MM-DD") + ", 접수시간 : " + acptdt.toDate("YYYYMMDDhhmmss").getDateFormat("YYYY-MM-DD hh:mm:ss"));
- group2.attribute("visibility") = "hidden";
- tar_examrslt.refresh();
- output3.refresh();
- output4.refresh();
- }
- /**
- * @group :
- * @ver : 2010.03.04
- * @by : kys
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 셋팅된 값 초기화
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fInitExamRslt(flag){
- model.removeNode("/root/temp/examrslttxt");
- model.removeNode("/root/temp/ptno");
- model.removeNode("/root/temp/prcpdd");
- if(flag != "1"){ //조회버튼 클릭이 아니면..
- model.removeNode("/root/temp/smssendcnts");
- }
- model.removeNode("/root/temp/pid");
- model.removeNode("/root/temp/patnm");
- model.refresh();
- }
- /**
- * @group :
- * @ver : 2010.03.05
- * @by : kys
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 우편물 출력
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fPrntPost(){
- var j = 1;
- var instnm = "";
- var smstestrslt = "";
- model.removenode("/root/temp/printdata");
- model.makeNode("/root/temp/printdata");
- //기관에 따른 명칭변경
- if(getUserInfo("dutplceinstcd") == seoulinstcd){
- instnm = "서울 성모산부인과(외래)"
- }else if(getUserInfo("dutplceinstcd") == yeuidoinstcd){
- instnm = "여의도 성모산부인과(외래)"
- }else if(getUserInfo("dutplceinstcd") == uijeongbuinstcd){
- instnm = "의정부 성모산부인과(외래)"
- }else if(getUserInfo("dutplceinstcd") == buchuninstcd){
- instnm = "부천 성모산부인과(외래)"
- }else if(getUserInfo("dutplceinstcd") == vincentinstcd){
- instnm = "성빈센트 산부인과(외래)"
- }
- for(var i=1;i<=getNodesetCount("/root/main/obgypatlist/obgypatlistinfo");i++){
- if(model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ i +"]/chk") == "true"){
- model.makeValue("/root/temp/printdata/obgypatlist/obgypatlistinfo[" + j +"]/pid", model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ i +"]/pid"));
- model.makeValue("/root/temp/printdata/obgypatlist/obgypatlistinfo[" + j +"]/patnm", model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ i +"]/patnm"));
- if(model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ i +"]/examrslt") == "1"){
- smstestrslt = "정상";
- }else if(model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ i +"]/examrslt") == "2"){
- smstestrslt = "전화로 알림";
- }else if(model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ i +"]/examrslt") == "3"){
- smstestrslt = "재검-SMS로 알림";
- }else if(model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ i +"]/examrslt") == "4"){
- smstestrslt = "정상+염증성소견";
- }
- model.makeValue("/root/temp/printdata/obgypatlist/obgypatlistinfo[" + j +"]/smssendcnts", smstestrslt);
- var nextrsrv1 = model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ i +"]/nextrsrv1");
- model.makeValue("/root/temp/printdata/obgypatlist/obgypatlistinfo[" + j +"]/nextrsrv1", nextrsrv1.toDate().getDateFormat("YYYY-MM-DD"));
- model.makeValue("/root/temp/printdata/obgypatlist/obgypatlistinfo[" + j +"]/orddepttel", model.getValue("/root/temp/depttellist/depttellistinfo/depttelno"));
- model.makeValue("/root/temp/printdata/obgypatlist/obgypatlistinfo[" + j +"]/instnm", instnm);
- model.makeValue("/root/temp/printdata/obgypatlist/obgypatlistinfo[" + j +"]/addr", model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ i +"]/addr"));
- model.makeValue("/root/temp/printdata/obgypatlist/obgypatlistinfo[" + j +"]/zipcd", model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ i +"]/zipcd"));
- j++;
- }
- }
- clearParameter("reportprintyn"); //20100520_미리보기창보임으로추가_kys
- exeReportPreview("RPMNO04000", "XMLSTR", "", "", "", "", "", "", "", "");//20100520_미리보기창보임으로수정_kys
- }
- /**
- * @group :
- * @ver : 2010.03.08
- * @by : kys
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 환자 Print정보 입력
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fInsPrintInfo(){
- var j = 1;
- model.removenode("/root/send/reqinsdata");
- model.makeNode("/root/send/reqinsdata");
- for(var i=1;i<=getNodesetCount("/root/main/obgypatlist/obgypatlistinfo");i++){
- if(model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ i +"]/chk") == "true"){
- //if(model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ i +"]/prntstat") != "Y"){ //Y인경우 data가 있으므로 제외.
- //var prntstat = model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ i +"]/prntstat");
- //var smssenddt = model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ i +"]/smssenddt");
- if(model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ i +"]/status") == "i"){
- model.makeValue("/root/send/reqinsdata[" + j +"]/status", "i");
- model.makeValue("/root/send/reqinsdata[" + j +"]/msgkey", "0");
- }else if(model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ i +"]/status") == "u") {
- model.makeValue("/root/send/reqinsdata[" + j +"]/status", "u");
- model.makeValue("/root/send/reqinsdata[" + j +"]/msgkey", model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ i +"]/msgkey"));
- }
- model.makeValue("/root/send/reqinsdata[" + j +"]/pid", model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ i +"]/pid"));
- model.makeValue("/root/send/reqinsdata[" + j +"]/orddd", model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ i +"]/orddd"));
- model.makeValue("/root/send/reqinsdata[" + j +"]/cretno", model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ i +"]/cretno"));
- model.makeValue("/root/send/reqinsdata[" + j +"]/prntyn", "Y");
- model.makeValue("/root/send/reqinsdata[" + j +"]/examrslt", model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ i +"]/examrslt"));
- model.makeValue("/root/send/reqinsdata[" + j +"]/rem", model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ i +"]/rem"));
- model.makeValue("/root/send/reqinsdata[" + j +"]/saveflag", "P");
- j++;
- //}
- }
- }
- if(!submit("TXMNO04001")){
- messageBox("저장 실패하였습니다.", "E");
- return false;
- }else{
- return true;
- }
- }
- /**
- * @group :
- * @ver : 2010.03.08
- * @by : kys
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 환자 특이사항 조회.
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fCmmtSrch(){
- model.removenode("/root/send/reqcmmtdata");
- model.makeNode("/root/send/reqcmmtdata");
- model.makeValue("/root/send/reqcmmtdata/pid", model.getValue("/root/temp/pidcmmt")); //등록번호 set
- if(!submit("TRMNO04005")){
- messageBox("특이사항 조회를 실패하였습니다.", "E");
- return;
- }else{
- model.makeValue("/root/temp/pidcmmt", model.getValue("/root/main/obgypatlist/obgypatlistinfo[" + grd_obgypatlist.row+ "]/pid")); //등록번호 set
- if(model.getValue("/root/temp/patcmmt/patcmmtstmtinfo/patcmmtstmt") == ""){ //가져온 값이 없다면 노드 생성.
- model.makeNode("/root/temp/patcmmt/patcmmtstmtinfo/patcmmtstmt");
- }
- inpt_cmmtpid.refresh();
- tar_cmmt.refresh();
- }
- }
- /**
- * @group :
- * @ver : 2010.03.08
- * @by : kys
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 환자 특이사항 저장.
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fInsPatCmmt(){
- if(model.getValue("/root/temp/patcmmt/patcmmtstmtinfo/patcmmtstmt") == ""){
- messageBox("입력된 내용이 없습니다.", "E");
- return;
- }
- model.removenode("/root/send/reqinscmmtdata");
- model.makeNode("/root/send/reqinscmmtdata");
- model.makeValue("/root/send/reqinscmmtdata/pid", model.getValue("/root/temp/pidcmmt")); //등록번호 set
- model.makeValue("/root/send/reqinscmmtdata/patcmmtstmt", model.getValue("/root/temp/patcmmt/patcmmtstmtinfo/patcmmtstmt")); //등록번호 set
- if(!submit("TXMNO04002")){
- messageBox("특이사항 저장을 실패하였습니다.", "E");
- return;
- }else{
- fCmmtSrch(); //특이사항 조회.
- var cmmtyn = model.getValue("/root/main/obgypatlist/obgypatlistinfo[pid = '" + model.getValue("/root/temp/pidcmmt") + "']/cmmtyn");
- if(cmmtyn = "N"){
- model.makeValue("/root/main/obgypatlist/obgypatlistinfo[pid = '" + model.getValue("/root/temp/pidcmmt") + "']/cmmtyn", "Y");
- button4.value = "■ 특이사항";
- }
-
- }
- }
- /**
- * @group :
- * @ver : 2010.03.09
- * @by : kys
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 환자 SMS전송 입력
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fSendSms(){
- var j = 1, k = 0;
- model.removenode("/root/send/reqsmsdata");
- model.makeNode("/root/send/reqsmsdata");
- for(var i=1;i<=getNodesetCount("/root/main/obgypatlist/obgypatlistinfo");i++){
- if(model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ i +"]/chk") == "true"){
- if(model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ i +"]/examrslt") == ""){
- messageBox("결과컬럼에 값을 입력하지 않은행이 존재합니다. [ " + i + " ]행", "E");
- return false;
- }
- //유효하지 않은값 체크-kys-20100405
- if(eval(model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ i +"]/examrslt")) > 4){
- messageBox("결과컬럼 값이 유효하지 않은 행이 존재합니다. [ " + i +" ]행", "E");
- return false;
- }
-
- if(model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ i +"]/smssenddt") != ""){
- messageBox("SMS전송중이거나 전송된 행이 존재합니다. [ " + i +" ]행", "E");
- return false;
- }
-
- if(model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ i +"]/examrslt") == "2"){
- messageBox("검사결과과 전화로 알림인 경우 SMS를 보낼수 없습니다.", "E");
- return false;
- }
-
- if(model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ i +"]/examrslt") == "4"){
- messageBox("검사결과과 재검+염증성 소견일 경우 SMS를 보낼수 없습니다.", "E");
- return false;
- }
-
- if(model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ i +"]/hpno") == "" || model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ i +"]/hpno") == "-"){
- messageBox("전화번호2가 없는 행이 존재합니다. [" + i + "]행", "E");
- return false;
- }
-
- //var prntstat = model.getValue("/root/main/obgypatlist/obgypatlistinfo[" + i + "]/prntstat");
- //var smssenddt = model.getValue("/root/main/obgypatlist/obgypatlistinfo[" + i + "]/smssenddt");
- var depttelno = model.getValue("/root/temp/depttellist/depttellistinfo/depttelno");
- var patnm = model.getValue("/root/main/obgypatlist/obgypatlistinfo[" + i + "]/patnm");
- if(model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ i +"]/status") == "i"){ //두개의 값이 없으면 insert(data의 존재여부를 판단)
- model.makeValue("/root/send/reqsmsdata[" + j +"]/status", "i");
- model.makeValue("/root/send/reqsmsdata[" + j +"]/prntyn", "N"); //print출력여부
- }else if(model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ i +"]/status") == "u") {
- model.makeValue("/root/send/reqsmsdata[" + j +"]/status", "u");
- model.makeValue("/root/send/reqsmsdata[" + j +"]/prntyn", model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ i +"]/prntstat")); //print출력여부
- }
- model.makeValue("/root/send/reqsmsdata[" + j +"]/pid", model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ i +"]/pid")); //등록번호
- model.makeValue("/root/send/reqsmsdata[" + j +"]/orddd", model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ i +"]/orddd")); //진료일
- model.makeValue("/root/send/reqsmsdata[" + j +"]/cretno", model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ i +"]/cretno")); //cretno
- model.makeValue("/root/send/reqsmsdata[" + j +"]/examrslt", model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ i +"]/examrslt")); //검사결과
- model.makeValue("/root/send/reqsmsdata[" + j +"]/rem", model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ i +"]/rem")); //비고
- model.makeValue("/root/send/reqsmsdata[" + j +"]/mpphontel", model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ i +"]/hpno")); //환자핸드폰번호
- model.makeValue("/root/send/reqsmsdata[" + j +"]/cntctel", depttelno); //산부인과외래전화번호
- model.makeValue("/root/send/reqsmsdata[" + j +"]/hngnm", patnm); //환자명
- if(model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ i +"]/examrslt") == "1"){ //암검사결과에 따른 SMS메시지 작성
- model.makeValue("/root/send/reqsmsdata[" + j +"]/msgparam", patnm + "님, 자궁경부암 결과가 정상입니다. 산부인과 외래전화번호(" + depttelno + ")");
- }else if(model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ i +"]/examrslt") == "3"){
- model.makeValue("/root/send/reqsmsdata[" + j +"]/msgparam", patnm + "님, 자궁경부암 결과를 확인하십시오. 산부인과 외래전화번호(" + depttelno + ")");
- }
- j++;
- k++; //메세지박스 판단 변수.
- }
- }
- if(k == 1){ //체크한 data가 한개일 경우
- var rtnval = "";
- var examrslt = model.getValue("/root/send/reqsmsdata[1]/examrslt");
- if(examrslt == "1"){
- rtnval = messageBox("메시지를 전송하시겠습니까? " , "Q");
- if(rtnval == 7){ //취소 버튼을 클릭한 경우
- return false;
- }
- }else if(examrslt == "3"){
- rtnval = messageBox("재검, 메시지를 전송하시겠습니까?" , "Q");
- if(rtnval == 7){ //취소 버튼을 클릭한 경우
- return false;
- }
- }
- }else if(k > 1){ //체크한 data가 1개 이상일 경우 단일 메시지로....
- var rtnval = "";
- rtnval = messageBox("메시지를 전송하시겠습니까? " , "Q");
- if(rtnval == 7){ //취소 버튼을 클릭한 경우
- return false;
- }
- }
- if(!submit("TXMNO04003")){
- messageBox("저장 실패하였습니다.", "E");
- return false;
- }else{
- return true;
- }
- }
- /**
- * @group :
- * @ver : 2010.03.26
- * @by : kys
- * @---------------------------------------------------
- * @type : function
- * @access : public
- * @desc : 발송내용 선택시 저장.
- * @param :
- * @return :
- * @---------------------------------------------------
- */
- function fSaveNormal(){
- model.removenode("/root/send/reqinsdata");
- model.makeNode("/root/send/reqinsdata");
-
- if(model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ grd_obgypatlist.row +"]/status") == "i"){
- model.makeValue("/root/send/reqinsdata[1]/status", "i");
- model.makeValue("/root/send/reqinsdata[1]/msgkey", "0");
- model.makeValue("/root/send/reqinsdata[1]/prntyn", "N");
- }else if(model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ grd_obgypatlist.row +"]/status") == "u") {
- model.makeValue("/root/send/reqinsdata[1]/status", "u");
- model.makeValue("/root/send/reqinsdata[1]/msgkey", model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ grd_obgypatlist.row +"]/msgkey"));
- model.makeValue("/root/send/reqinsdata[1]/prntyn", model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ grd_obgypatlist.row +"]/prntstat"));
- }
- model.makeValue("/root/send/reqinsdata[1]/pid", model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ grd_obgypatlist.row +"]/pid"));
- model.makeValue("/root/send/reqinsdata[1]/orddd", model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ grd_obgypatlist.row +"]/orddd"));
- model.makeValue("/root/send/reqinsdata[1]/cretno", model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ grd_obgypatlist.row +"]/cretno"));
- model.makeValue("/root/send/reqinsdata[1]/examrslt", model.getValue("/root/temp/smssendcnts"));
- model.makeValue("/root/send/reqinsdata[1]/rem", model.getValue("/root/main/obgypatlist/obgypatlistinfo["+ grd_obgypatlist.row +"]/rem"));
- model.makeValue("/root/send/reqinsdata[1]/saveflag", "R");
-
- if(!submit("TXMNO04001")){
- messageBox("저장 실패하였습니다.", "E");
- return false;
- }else{
- messageBox("저장 되었습니다.", "I");
- return true;
- }
- }
|