123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467 |
- //SPMMO33200, SPMMO33400, SPMMO33400
- //화면 초기화 (진료과 정보 등을 조회)
- //flag(A:신청, R:도착, E:종료, P:결재/접수, S:집계, T:통계조회)
- var xSortCol = -1;
- var xSortType = "";
- function fInitOnCall(flag){
-
- model.setValue("/root/main/cond/condflag", flag);
-
- if( flag == "P" ){ //결재(접수) 화면
- model.setValue("/root/main/cond/condkind", "R");
- model.setValue("/root/main/cond/condacpt", "-");
- model.setValue("/root/main/cond/sortkind", "D");
- model.setValue("/root/main/cond/patflagcd", "-");
- fInitMngtOnCall(flag);
- fGetAfterOnCallList();
-
- }else if( flag == "S" ){ //집계 화면
- fInitMngtOnCall(flag);
- fGetSumOnCallList();
-
- var DayOfWeek = model.getValue("/root/main/oncalllist/month/day");
- if(!isNull(DayOfWeek)){
- grd_oncalllist.caption = "구분^calldeptcd^진료과^성명^사번^01^02^03^04^05^06^07^08^09^10^11^12^13^14^15^16^17^18^19^20^21^22^23^24^25^26^27^28^29^30^31|구분^calldeptcd^진료과^성명^사번^" + DayOfWeek;
- grd_oncalllist.refresh();
- }
-
- }else if( flag == "T" ){ //통계조회 화면
- fInitMngtOnCall(flag);
- fGetStatsOnCallList()
- }else if( flag == "V" ){ //통계조회 화면
- //fGetStatsOnCallList()
- //call 진료과 리스트를 조회;
- mmbfGetDeptCodeComboList("/root/send/reqdata", "/root/init/orddept" , "D");
- fInitMngtOnCall(flag);
- }else{ //신청-도착-완료 화면
- //call 진료과 리스트를 조회
- mmbfGetDeptCodeComboList("/root/send/reqdata", "/root/init/orddept" , "D");
-
- //각 화면의 초기화
- if( flag == "A" ){
- fInitAppOnCall();
- model.setValue("/root/main/oncallinfo/patflagcd", getScreenMenuParameter());
- }else{
- fInitMngtOnCall(flag);
- }
- //환자별 신청내역 조회
- fGetOnCallList();
- }
-
- model.refresh();
- }
- //신청화면 초기화
- function fInitAppOnCall(){
- //로그인한 사용자 정보
- var userid = getUserInfo("userid");
- var dutplcecd = getUserInfo("dutplcecd");
- model.setValue("/root/main/userinfo/orddrid" , userid);
- model.setValue("/root/main/userinfo/orddeptcd", dutplcecd);
- model.setValue("/root/main/userinfo/orddrnm" , getUserInfo("usernm"));
- model.setValue("/root/main/userinfo/orddeptnm", getUserInfo("dutplcenm"));
- model.setValue("/root/main/userinfo/mpphonno" , getUserInfo("mpphonno"));
- model.setValue("/root/main/userinfo/pdano" , getUserInfo("pdano"));
-
- //신청자 정보
- model.setValue("/root/main/oncallinfo/apporddrid" , userid);
- model.setValue("/root/main/oncallinfo/appdeptcd" , dutplcecd);
- model.setValue("/root/main/oncallinfo/appmpphonno", model.getValue("/root/main/userinfo/mpphonno"));
-
- //상단 환자정보
- var pid = getPatientInfo("pid");
- if( !isNull(pid) ){
- model.setValue("/root/main/oncallinfo/pid" , pid);
- model.setValue("/root/main/oncallinfo/hngnm" , getPatientInfo("pname"));
- //model.setValue("/root/main/oncallinfo/rrgstno", getPatientInfoDetail("rrgstno1") + "-" + getPatientInfoDetail("rrgstno2"));
-
- model.setValue("/root/main/cond/condpid" , pid);
- }else{
- model.setValue("/root/main/cond/condpid" , "-");
- }
- }
- //신청화면 초기화
- function fInitMngtOnCall(flag){
- var curDD = getCurrentDate();
-
- if( flag == "S" ){
- model.setValue("/root/main/cond/basemm" , curDD.substring(0,6)); //집계화면은 조회월 초기화
- }else if( flag == "T" ){
- model.setValue("/root/main/cond/fromdd" , getNewDate().getAddDate(-1, "M").getDateFormat("YYYYMMDD"));
- model.setValue("/root/main/cond/todd" , curDD);
- }else{
- model.setValue("/root/main/cond/fromdd" , curDD);
- model.setValue("/root/main/cond/todd" , curDD);
- }
-
- if( flag == "R" ){
- model.setValue("/root/main/cond/codnstat" , "A"); //도착화면은 신청내역 조회
- model.setValue("/root/main/oncallinfo/arvdd", curDD);
- }else if( flag == "E" ){
- model.setValue("/root/main/cond/codnstat" , "R"); //완료화면은 도착내역 조회
- model.setValue("/root/main/oncallinfo/enddd", curDD);
- }
-
- if( flag == "P" ) { // 온콜 내역화면
- if(fContainsHardCD("490", getUserInfo( "dutplcecd" ))) { // 저장버튼 활성화 부서
- btn_save.disabled = false;
- } else {
- btn_save.disabled = true;
- }
- }
- }
- //진료과 선택 시 해당과 진료의 리스트를 조회한다.
- function fGetOrdDrList(){
- cmb_orddept.refresh();
- model.setValue("/root/main/oncallinfo/calldeptnm", cmb_orddept.label);
- mmbfGetUserComboList("/root/send/reqdata", "/root/init/userlist" , cmb_orddept.value, "0330", "", "M");
- model.refresh();
- }
- function fGetOrdDrList1(retValue){
- mmbfGetUserComboList("/root/send/reqdata", "/root/init/userlist" , retValue, "0330", "", "M");
- model.refresh();
- }
- //On Call 리스트 중 선택한 정보를 화면에 display한다.
- function fGetOnCallInfo(flag){
- var iRow = grd_oncalllist.row;
- if(iRow <= 0 ) return;
-
- model.copyNode("/root/main/oncallinfo", "/root/main/oncalllist/info["+iRow+"]");
- fGetOrdDrList();
-
- if(flag == "R"){
- }else if(flag == "R"){
- var curDD = getCurrentDate();
- var curTM = getCurrentTime();
- if( model.getValue("/root/main/oncallinfo/arvdd") == "00000000" ){
- model.setValue("/root/main/oncallinfo/arvdd", curDD);
- }
- if( model.getValue("/root/main/oncallinfo/arvtm") == "000000" || model.getValue("/root/main/oncallinfo/arvtm") == "0000" ){
- model.setValue("/root/main/oncallinfo/arvtm", curTM);
- }
- }else if(flag == "E"){
- var curDD = getCurrentDate();
- var curTM = getCurrentTime();
- if( model.getValue("/root/main/oncallinfo/enddd") == "00000000" ){
- model.setValue("/root/main/oncallinfo/enddd", curDD);
- }
- if( model.getValue("/root/main/oncallinfo/endtm") == "000000" || model.getValue("/root/main/oncallinfo/endtm") == "0000" ){
- model.setValue("/root/main/oncallinfo/endtm", curTM);
- }
- }
- model.refresh();
- }
- //On Call 정보를 저장한다.
- //flag(A:신청, R:도착, E:종료, P:결재/접수, S:집계)
- function fSaveOnCallInfo(flag){
-
- if( flag == "P" ){
- copyNodeType("/root/send/savedata", "/root/main/oncalllist", "replace");
-
- }else{
- var appSeq = model.getValue("/root/main/oncallinfo/appseq");
- var statCd = model.getValue("/root/main/oncallinfo/statcd");
- var acptYn = model.getValue("/root/main/oncallinfo/acptyn");
-
- if(acptYn == "Y"){
- messageBox("결재가 완료되어 수정할 수 없습니다","I");
- return;
- }
-
- //필수값 체크 (신청 화면)
- if( flag == "A" ){
- if ( ! isRequiredControls("ipt_pid", "ipt_hngnm", "ipt_appmpphonno", "rdo_patflagcd", "cmb_orddept", "cmb_orddr") ) return false;
-
- model.setValue("/root/main/oncallinfo/statcd" , "A");
- if( isNull(appSeq) ){
- model.setValue("/root/main/oncallinfo/saveflag", "I");
- }else{
- model.setValue("/root/main/oncallinfo/saveflag", "U");
- }
-
- } else if( flag == "R" ){ //필수값 체크 (도착 화면)
- if(isNull(model.getValue("/root/main/oncallinfo/appseq"))){
- messageBox("신청내역을 선택하십시오.","I");
- return;
- }
-
- if ( ! isRequiredControls("ipt_arvdd", "ipt_arvtm") ) return false;
-
- var sCurrentDate = getCurrentDate();
- var appdt = model.getValue("/root/main/oncallinfo/appdt");
- var arvdd = model.getValue("/root/main/oncallinfo/arvdd");
- var arvtm = model.getValue("/root/main/oncallinfo/arvtm");
- if(arvdd == "00000000"){
- messageBox("도착일자를 정확히 입력하십시오.","I");
- return;
- }
- if( arvtm.getByteLength() < 4 ){
- messageBox("도착시간을 4자리 이상 입력하십시오.","I");
- return;
- }else{
- arvtm = arvtm.getRightPad(6, "0");
- }
-
- if( statCd == "" || statCd == "E" ){
- messageBox("수정할 수 없는 상태입니다.","I");
- return;
- }
-
- if(appdt.substr(0,6) != sCurrentDate.substr(0,6)) { // 이전달 신청내용은 이번달 5일까지만 수정 가능 하도록 요청번호 20150707019 2015.07.20 엄영만
- if(sCurrentDate.substr(0,6) + "05" < sCurrentDate) {
- messageBox("이전달 신청항목은 이번달 5일이후 수정이 불가능 합니다","E");
- return;
- }
- }
-
- //도착시간에 대한 수정하는 경우, 권한과 시간 체크
- if( model.getValue("/root/main/oncallinfo/endrgstdt") != "00000000000000" && getUserInfo("dutplcecd") != "3310000000" && getUserInfo("userid") != model.getValue("/root/main/oncallinfo/calldrid")){ //진료행정팀이나 진료의가 아닌 경우
- messageBox("해당 진료의가 아니면 수정 불가능합니다.","I");
- return;
- }
-
- model.setValue("/root/main/oncallinfo/arvdt" , arvdd + arvtm);
- model.setValue("/root/main/oncallinfo/saveflag", "U");
- model.setValue("/root/main/oncallinfo/statcd" , "R");
-
- }
- else if( flag == "E"
- ){ //필수값 체크 (종료 화면)
- if(isNull(model.getValue("/root/main/oncallinfo/appseq"))){
- messageBox("신청내역을 선택하십시오.","I");
- return;
- }
-
- if ( ! isRequiredControls("ipt_arvdd", "ipt_arvtm", "ipt_enddd", "ipt_endtm") ) return false;
-
- var sCurrentDate = getCurrentDate();
- var appdt = model.getValue("/root/main/oncallinfo/appdt");
- var arvdd = model.getValue("/root/main/oncallinfo/arvdd");
- var arvtm = model.getValue("/root/main/oncallinfo/arvtm");
- var enddd = model.getValue("/root/main/oncallinfo/enddd");
- var endtm = model.getValue("/root/main/oncallinfo/endtm");
-
- var checkyn = model.getValue("/root/main/oncallinfo/checkyn");
- var checkynetc = model.getValue("/root/main/oncallinfo/checkynetc");
-
-
- if( arvdd.getByteLength() < 6){
- messageBox("도착시간을 6자리 이상 입력하십시오.","I");
- return;
- }
- if( arvtm.getByteLength() < 4 ){
- messageBox("도착시간을 4자리 이상 입력하십시오.","I");
- return;
- }else{
- arvtm = arvtm.getRightPad(6, "0");
- }
-
- if(enddd == "00000000"){
- messageBox("완료일자를 정확히 입력하십시오.","I");
- return;
- }
- if( endtm.getByteLength() < 4 ){
- messageBox("완료시간을 4자리 이상 입력하십시오.","I");
- return;
- }else{
- endtm = endtm.getRightPad(6, "0");
- }
-
- if( statCd == "" || statCd == "A" ){
- messageBox("완료할 수 없는 상태입니다.","I");
- return;
- }
-
-
- //201711001 이돈희 추가 : 이순희선생님 요청으로 칠곡인 경우 비활성화
- var instcd = getUserInfo("dutplceinstcd");
- if(instcd == "031")
- {
- //20171030 이돈희 추가 : 완료시간이 도착시간보다 이전일인 경우 저장 안됨(요청번호 : 20171016008)
- if((arvdd+arvtm)>(enddd+endtm))
- {
- messageBox("완료시간은 도착시간보다 미래시간을 입력하십시오.", "I");
- return;
- }
-
- //20171031 이돈희 추가
- //이순희 선생님 요청사항 : 작성여부의 수술기록(1), 시술기록(2), 경과기록(3), 마취기록(4), 기타(5) 중
- // 체크된것이 있는 경우 저장 가능
- if(isNull(checkyn))
- {
- messageBox("작성여부를 체크하여 주십시오.", "I");
- return;
- }
-
- //20171101 이돈희 추가
- //이순희 선생님 요청사항 : 작성여부의 기타(5)가 체크된 경우 기타 에디트가 작성안된 경우 저장 안되도록 수정
- if(checkyn.indexOf("5") != -1)
- {
- if(isNull(checkynetc))
- {
- messageBox("작성여부의 기타란을 작성하여 주십시오.", "I");
- return;
- }
- }
- }
-
-
- if(appdt.substr(0,6) != sCurrentDate.substr(0,6)) { // 이전달 신청내용은 이번달 5일까지만 수정 가능 하도록 요청번호 20150707019 2015.07.20 엄영만
- if(sCurrentDate.substr(0,6) + "05" < sCurrentDate) {
- messageBox("이전달 신청항목은 이번달 5일이후 수정이 불가능 합니다","E");
- return;
- }
- }
-
- //완료시간에 대한 수정하는 경우, 권한과 시간 체크
- if( model.getValue("/root/main/oncallinfo/endrgstdt") != "00000000000000" && getUserInfo("dutplcecd") != "3310000000" && getUserInfo("userid") != model.getValue("/root/main/oncallinfo/calldrid")){ //진료행정팀이나 진료의가 아닌 경우
- messageBox("해당 진료의가 아니면 수정 불가능합니다.","I");
- return;
- }
-
- model.setValue("/root/main/oncallinfo/arvdt" , arvdd + arvtm);
- model.setValue("/root/main/oncallinfo/enddt" , enddd + endtm);
- model.setValue("/root/main/oncallinfo/saveflag", "U");
- model.setValue("/root/main/oncallinfo/statcd" , "E");
-
- } else if( flag == "X" ){ // 삭제처리
- if(isNull(model.getValue("/root/main/oncallinfo/appseq"))){
- messageBox("삭제 내역을 선택하십시오.","I");
- return;
- }
-
- if( statCd == "" || statCd == "A" ){
- messageBox("도착 또는 완료 상태일때만 삭제가 가능 합니다.","I");
- return;
- }
- //완료시간에 대한 수정하는 경우, 권한과 시간 체크
- if( getUserInfo("dutplcecd") != "3310000000" && getUserInfo("userid") != model.getValue("/root/main/oncallinfo/calldrid")){ //진료행정팀이나 진료의가 아닌 경우
- messageBox("해당 진료의가 아니면 삭제 불가능합니다.","I");
- return;
- }
-
- if ( messageBox ( "삭제 하시겠습니까?","Q") != "6" ) {
- return ;
- }
-
- model.setValue("/root/main/oncallinfo/arvdt" , "");
- model.setValue("/root/main/oncallinfo/enddt" , "");
- model.setValue("/root/main/oncallinfo/saveflag", "D");
- model.setValue("/root/main/oncallinfo/statcd" , "X");
- }
-
- model.copyNode("/root/send/savedata", "/root/main/oncallinfo");
-
- } //end else
-
- model.removeNode("/root/send/reqdata");
- model.makeNode("/root/send/reqdata");
- model.copyNode("/root/send/reqdata", "/root/main/cond");
-
- //저장
- if( submit("TXMMO33201", false) ){
-
- //신청 후에 메세지 보여줌
- if( flag == "A" ){
- if(model.getValue("/root/main/oncallinfo/sendsmsyn") == "Y") {
- mpphonno = model.getValue("/root/temp/callinfo/info/mpphonno");
- messageBox( mpphonno + " 번호로 SMS 전송되었습니다." ,"I");
- } else {
- messageBox("저장 되었습니다." ,"I");
- }
- } else if ( flag == "X" ){
- model.resetInstanceNode("/root/main/oncallinfo");
- }
- /*
- if( flag == "E" ){
- fGetOnCallList();
- }
- */
- model.refresh();
- }else{
- model.setValue("/root/main/oncallinfo/saveflag", "I");
- }
-
- }
- //환자별 OnCall 리스트를 조회한다.
- //fromdd:기간 시작일자, todd:기간 종료일자, condstat:환자상태 조건
- function fGetOnCallList(){
- submit("TRMMO33201");
- }
- //등록기간/시작시간 기준 OnCall 전체 리스트를 조회한다.
- function fGetAfterOnCallList(){
- submit("TRMMO33501");
- }
- //월별 On Call 수당지급내역을 조회한다.
- //fromdd:기간 시작일자, todd:기간 종료일자, condstat:환자상태 조건
- function fGetSumOnCallList(){
- submit("TRMMO33601");
- }
- //월별 On Call 수당을 집계한다.
- function fSaveSumOnCall(){
- if( submit("TXMMO33601") ){
- alert("집계가 완료되었습니다.");
- }
- }
- //월별 직급별 On Call 통계를 조회한다.
- function fGetStatsOnCallList(){
- submit("TRMMO33701");
- }
- /**
- * 환자기본정보 조회
- * @param
- * pid : 등록번호
- * stnddd : 기준일자
- */
- function fGetPatBaseInfo(){
- var pid = ipt_pid.currentText;
- model.setValue("/root/main/oncallinfo/pid", pid);
-
- if(submit("TRMMO33202")){
- if(!isNull(pid)){
- model.setValue("/root/main/oncallinfo/pid" , pid);
- model.setValue("/root/main/oncallinfo/hngnm" , model.getValue("/root/temp/patinfo/info/hngnm"));
- //model.setValue("/root/main/oncallinfo/rrgstno", model.getValue("/root/temp/patinfo/info/rrgstno"));
- model.refresh();
-
- model.setValue("/root/main/cond/condpid" , pid);
- fGetOnCallList();
-
- }else{
- model.setValue("/root/main/oncallinfo/pid" , "");
- model.setValue("/root/main/oncallinfo/hngnm" , "");
- //model.setValue("/root/main/oncallinfo/rrgstno", "");
- }
- }
- }
- function fGetUserCallInfo(){
- //model.removeNode("/root/send/reqdata");
- //model.makeNode("/root/send/reqdata");
- //model.makeValue("/root/send/reqdata/calldrid", model.getValue("/root/main/oncallinfo/calldrid"));
-
- model.setValue("/root/main/oncallinfo/calldrnm", cmb_orddr.label);
-
- if(submit("TRMMO33203")){
-
- }
- }
|