123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562 |
- /*
-
- EDCCall관리(SMMNE05200.xfm - JScript )
- - Version :
- 1) : Ver.1.00.01
- - Create : 2009.11.04
- */
- var seoulinstcd ;//서울성모기관코드
- var uijungbuinstcd;//의정부성모기관코드
- var bucheoninstcd; //부천성모기관코드
- var vincentinstcd; //빈센트기관코드
- //초기화
- function fInit() {
- //20091116 dhkim 기관코드 조회 추가
- var pCode = "'077', '104'"; // 조회할 CdGrupID 코드정보 , 104번 추가 중증응급관련 inpt 업데이트 할 코드 조회 : 20110308 김영학
- var pDate = getCurrentDate(); //조회기준일자
- fGetNursHardCdInfo(pCode, pDate);
-
- //supcdid : '01' : 서울성모
- if(model.getValue("/root/code/codeinfo/codelist[cdgrupid = '077' and supcdid = '01' and cdid = '"+ getUserInfo("dutplceinstcd") +"']/cdid")){
- seoulinstcd = model.getValue("/root/code/codeinfo/codelist[cdgrupid = '077' and supcdid = '01' and cdid = '"+ getUserInfo("dutplceinstcd") +"']/cdid");
- }
- //supcdid : '02' : 의정부성모
- if(model.getValue("/root/code/codeinfo/codelist[cdgrupid = '077' and supcdid = '02' and cdid = '"+ getUserInfo("dutplceinstcd") +"']/cdid")){
- uijungbuinstcd = model.getValue("/root/code/codeinfo/codelist[cdgrupid = '077' and supcdid = '02' and cdid = '"+ getUserInfo("dutplceinstcd") +"']/cdid");
- }
- //supcdid : '03' : 부천성모
- if(model.getValue("/root/code/codeinfo/codelist[cdgrupid = '077' and supcdid = '03' and cdid = '"+ getUserInfo("dutplceinstcd") +"']/cdid")){
- bucheoninstcd = model.getValue("/root/code/codeinfo/codelist[cdgrupid = '077' and supcdid = '03' and cdid = '"+ getUserInfo("dutplceinstcd") +"']/cdid");
- }
- //supcdid : '04' : 빈센트
- if(model.getValue("/root/code/codeinfo/codelist[cdgrupid = '077' and supcdid = '04' and cdid = '"+ getUserInfo("dutplceinstcd") +"']/cdid")){
- vincentinstcd = model.getValue("/root/code/codeinfo/codelist[cdgrupid = '077' and supcdid = '04' and cdid = '"+ getUserInfo("dutplceinstcd") +"']/cdid");
- }
-
- //20091116 dhkim New Brain 추가호출 서울성모만 보여지도록 함
- if(seoulinstcd == getUserInfo("dutplceinstcd")){
- //grp_nbsecond.attribute("visibility") = "visible";
- grp_nbsecond.attribute("visibility") = "hidden";
- }else{
- grp_nbsecond.attribute("visibility") = "hidden";
- }
-
-
- var CurrentDate = getCurrentDate();
- model.makeValue("/root/hidden/con/orddd",CurrentDate);
- model.removeNodeset("/root/main/ordschelist");
-
- model.copyNode("/root/send/reqdata","/root/hidden/con");
- submit("TRMNE05003"); //센터, 진료과 정보 가져옴
-
- model.copyNode("/root/send/reqdata","/root/hidden/con");
-
- //pameter setting
- //pid + "▦" + orddd + "▦" + cretno + "▦" + visitno-20090615
- var param = opener.javascript.getParameter("SMMNE05200_param");
- param = param.split("▦");
- model.setValue("/root/tmp/patinfo/pid", param[0]);
- model.setValue("/root/tmp/patinfo/orddd", param[1]);
- model.setValue("/root/tmp/patinfo/cretno", param[2]);
- model.setValue("/root/tmp/patinfo/visitno", param[3]);
-
- //테스트용
- //model.setValue("/root/tmp/patinfo/pid", "18206032");
- //model.setValue("/root/tmp/patinfo/orddd", "20090529");
- //model.setValue("/root/tmp/patinfo/cretno", "1");
- //model.setValue("/root/tmp/patinfo/visitno", "1");
-
- submit("TRMNE05202"); //환자정보 가져옴
- var pid = model.getValue("/root/main/erpat/erpatinfo/pid");
- var nm = model.getValue("/root/main/erpat/erpatinfo/nm");
- var sa = model.getValue("/root/main/erpat/erpatinfo/sa");
- var indt = model.getValue("/root/main/erpat/erpatinfo/indt");
- var deptengabbr = model.getValue("/root/main/erpat/erpatinfo/deptengabbr");
- caption2.value = nm + "(" + pid + ") " + sa + " " + indt + " " + deptengabbr;
-
- //mmbfGetHardCodeInfoNm("/root/send/reqdata", "/root/tmp/grtype", 201);//중증 응급 호출구분 선택할 리스트를 조회한다.
- // 하드코드 관리된 내용을 그룹 마스터를 통해서 조회하도록 수정한다. : 20110308 : 김영학
- submit("TRMNE05204");
-
- //호출구분선택 및 협진과 disabled및 enabled처리
- fSetCaptionGrType();
-
- model.refresh();
-
- }
- //협진과조회
- function fGetCnstDeptList(callflag) {
-
- model.makeValue("/root/send/reqdata/callflag" , callflag);
- submit("TRMNE05201");
- var ref = "/root/main/staffdeptcd/staffdeptlist";
- var cnt = getNodesetCnt(model, ref);
- var chkorddeptcdlist = "";
-
- for ( var i = 1; i <= cnt; i++) {
- var orddeptcd = model.getValue(ref + "[" + i + "]/orddeptcd");
- chkorddeptcdlist = chkorddeptcdlist + orddeptcd + "|";
- }
- var deptcdlist = chkorddeptcdlist.split("|");
- if (deptcdlist.length > 0) {
- chkorddeptcdlist = chkorddeptcdlist.substring(0, chkorddeptcdlist.length -1);
- }
-
- model.removenode("/root/main/chkdeptcdlist");
- model.makeValue("/root/main/chkdeptcdlist", chkorddeptcdlist);
- chk_orddeptcd.refresh();
- }
- //20091104 dhkim
- //호출 유효성 체크
- function fIsValidErCallDr(params){
- var paramArr = params.split('|');
- var pid = paramArr[0];
- var indd = paramArr[1];
- var cretno = paramArr[2];
- var visitno = paramArr[3];
- var intm = paramArr[4];
- var grtype = paramArr[5];
- //환자정보가 존재하지 않으면 호출 되지 않게 blocking
- if(pid == '' || indd == '' || cretno == '' || visitno == '' || intm == ''){
- messageBox('환자정보가 존재하지 않아 호출 할 수 없습니다.', 'E');
- return false;
- }
-
- //호출구분선택
- if(grtype == ''){
- messageBox('호출구분을 선택하십시오.', 'E');
- return false;
- }
-
-
- //=========================================================================
- //호출진행중이면 호출이 되지않게 blocking-20090618
- var callingyn = "";
- model.makeValue("/root/send/reqchk/pid", pid);
- model.makeValue("/root/send/reqchk/indd", indd);
- model.makeValue("/root/send/reqchk/cretno", cretno);
- model.makeValue("/root/send/reqchk/visitno", visitno);
- model.makeValue("/root/send/reqchk/grtype", grtype);
-
-
- if(!submit("TRMNE05203")){
- messageBox('호출 중 체크를 실패하였습니다.', 'E999');
- return false;
- }else{
- callingyn = model.getValue("/root/tmp/calling/calling/callingyn");
- if(callingyn == "Y"){
- messageBox("호출이 진행중입니다.\n 잠시 후 다시 시도해 주시기 바랍니다.", "I");
- return false;
- }
- }
-
-
- return true;
- }
- //호출
- //20091116 dhkim grtype구분자추가
- function fErCallDr(grtype){
- //환자정보
- var pid = model.getValue("/root/main/erpat/erpatinfo/pid");
- var patnm = model.getValue("/root/main/erpat/erpatinfo/nm");
- var indd = model.getValue("/root/main/erpat/erpatinfo/indd");
- var cretno = model.getValue("/root/main/erpat/erpatinfo/cretno");
- var visitno = model.getValue("/root/tmp/patinfo/visitno");
- var intm = model.getValue("/root/main/erpat/erpatinfo/intm");
-
- //응급의학과 전화번호
- var cntctel = model.getValue("/root/main/erpat/erpatinfo/cntctel");
- cntctel = cntctel.replace(/-/gi, '');
- //주진료과
- var maindeptcd = model.getValue("/root/main/condition/orddeptcd");
-
- //호출구분 :
- //var grtype = model.getValue("/root/main/condition/grtype");
- if(grtype == null || grtype == ''){
- grtype = model.getValue("/root/main/condition/grtype");
- }
- var grtypenm = "";
- // 하드코딩된 부분 제거 (마스터에서 값 가지고 오도록 수정 : 20110308 김영학
- grtypenm = model.getValue("/root/init/grtypeinfo/grtypelist[grtype = '" + grtype + "' ]/grname");
- /*
- if(grtype == "1"){
- grtypenm = "Trauma";
- }
- else if(grtype == "2"){
- grtypenm = "New Brain";
- }
- else if(grtype == "3"){
- grtypenm = "New Heart";
- } else if(grtype == "4"){
- grtypenm = "다증상 내과계";
- }
- */
- var params = pid + '|'
- + indd + '|'
- + cretno + '|'
- + visitno + '|'
- + intm + '|'
- + grtype
- ;
- //호출전 유효성체크
- if(!fIsValidErCallDr(params))
- return;
-
- //==========================================================================
-
- var sSrchData = "";
- var sSrchHeader = "pid" +"▦"
- + "patnm" +"▦"
- + "indd" +"▦"
- + "cretno" +"▦"
- + "visitno" +"▦"
- + "intm" +"▦"
- + "grtype" +"▦"//호출구분 :
- + "grtypenm" +"▦"
- + "cntctel" +"▦"
- + "orddeptcd" +"▩"
- ;
- //주진진료과셋팅
- var sSrchData = pid +"▦"
- + patnm +"▦"
- + indd +"▦"
- + cretno +"▦"
- + visitno +"▦"
- + intm +"▦"
- + grtype +"▦"
- + grtypenm +"▦"
- + cntctel +"▦"
- + maindeptcd +"▩"
- ;
-
- //체크된 각 협진과에 환자정보 attach
- var calldeptcd = model.getValue("/root/main/chkdeptcdlist");//체크박스에 들어있는값
- var sendcalldeptcd = calldeptcd.split("|");
- for(var i = 0;i < sendcalldeptcd.length;i++){
- var sSrchData = sSrchData
- + pid +"▦"
- + patnm +"▦"
- + indd +"▦"
- + cretno +"▦"
- + visitno +"▦"
- + intm +"▦"
- + grtype +"▦"
- + grtypenm +"▦"
- + cntctel +"▦"
- + sendcalldeptcd[i] +"▩";
- }
- model.makeValue("/root/send/reqdata/inscallinfo", sSrchHeader + sSrchData);
-
- if(submit("TXMNE05201")){
-
- //총 호출수
- var totcallcnt = model.getValue('/root/tmp/temp/rslt/callinfo/totcallcnt');
-
-
- //-----------------------------------------------------------------------------------------------------------
- // inpt테이블에 증증 코드 자동 등록 --> inpt의 명칭이 recovwardcd로 되어있으나 중증등록코드임! 헷갈림 주의!
- //-----------------------------------------------------------------------------------------------------------
- model.makeValue("/root/tmp2/pid",pid);
- model.makeValue("/root/tmp2/indd",indd);
- model.makeValue("/root/tmp2/cretno",cretno);
- model.makeValue("/root/tmp2/visitno",visitno);
-
- //하드코딩된 부분을 하드코드테이블 이용 하드코딩 제거 : 20110308 김영학
- grname = model.getValue("/root/code/codeinfo/codelist[cdgrupid = '104' and cdnm = '" + cpt_grtype.attribute("text") + "']/cdid");
- /*
- if(grtype == "1"){
- model.makeValue("/root/tmp2/recovwardcd" , grname);
- } else if(grtype == "2"){
- model.makeValue("/root/tmp2/recovwardcd" , "02") ; // "New Brain"
- } else if(grtype == "3"){
- model.makeValue("/root/tmp2/recovwardcd" , "01") ; //"New Heart";
- } else if(grtype == "4"){
- model.makeValue("/root/tmp2/recovwardcd" , "06") ; //"New Heart";
- }
- */
- if(submit("TXMNE05202")) {
- }
- //---------------------------------------------------------------------------------------
- //messageBox("호출("+ cpt_grtype.attribute("text") +")되었습니다.(총" + totcallcnt + "건)", "I");
- messageBox("호출("+ cpt_grtype.attribute("text") +")되었습니다.", "I");
- }else{
- if(isSearchString(model.getValue('/root/properties/error/code'), 'info') == false){
- messageBox('호출을 실패하였습니다.', 'E999');
- return;
- }
- }
- }
- //20091116 dhkim
- //호출구분선택시 중증구분 캡션 내용 표시 및 협진과 체크 disable (기존소스를 펑션으로 분리)
- function fSetCaptionGrType(){
- var grtype = rdo_grtype.value;
- //if (grtype != "4") {
- fGetCnstDeptList(grtype);
- //} else if (grtype == "4") {
- // model.setValue("/root/main/chkdeptcdlist", "");
- //}
- cpt_grtype.attribute("text") = model.getValue("/root/init/grtypeinfo/grtypelist[grtype = '" + grtype + "' ]/grtypesym");
- /*
- if(grtype == "1"){
- cpt_grtype.attribute("text")="T★";
- } else if(grtype == "2"){
- cpt_grtype.attribute("text")="B★" ; // "New Brain"
- } else if(grtype == "3"){
- cpt_grtype.attribute("text")="C★" ; //"New Heart";
- } else if(grtype == "4"){
- cpt_grtype.attribute("text")="M★" ; //"New Heart";
- }
- */
-
- //체크박스의 disable true시 어두워져 이미지컨트롤로 대체함.-20090617
-
- // if(grtype == "4"){ //일반환자추가시 사용
- // button1.attribute("visibility") = "hidden";
- // button1.attribute("disabled") = false;
- // }else{
- // button1.attribute("visibility") = "visible";
- // button1.attribute("disabled") = true;
- // }
-
- //----------------------------------------------------
-
-
-
- //if(dutinstcd == "013"){ //일반환자추가시 사용 || ( grtype=="1")
-
- //20091116 dhkim 기관코드 하드코딩 수정
- //의정부의 경우 트라우마 선택시 하위부서 체크를 풀어준다
- /*
- if(uijungbuinstcd == getUserInfo("dutplceinstcd")){
-
- if ( grtype=="1") {
- button1.attribute("visibility") = "hidden";
- button1.attribute("disabled") = false;
- } else {
- button1.attribute("visibility") = "visible";
- button1.attribute("disabled") = true;
- }
-
- }else{
- button1.attribute("visibility") = "visible";
- button1.attribute("disabled") = true;
- }
-
- if ( grtype=="4") {
- button1.attribute("visibility") = "hidden";
- button1.attribute("disabled") = false;
- }
- */
- button1.attribute("visibility") = "hidden";
- button1.attribute("disabled") = false;
- model.refresh();
- }
- //20091104 dhkim
- //New Brain 2차호출
- //2차call: 신경외과 임상강사(fellow), Angio방기사에게 호출 grtype:6
- function fSecondCallNB(){
- if(messageBox("New Brain 2차호출을 진행하시겠습니까?", "Q") == 7){
- return;
- }
-
- //20091118 dhkim
- //중증구분캡션 New Brain과 동일하게 적용 --> B★
- cpt_grtype.attribute("text")="B★" ;
- var grtype = "6";
- var grtypenm = "";
-
- //new brain 2차는 서울성모만 적용임
- if(seoulinstcd == getUserInfo("dutplceinstcd")){
- grtypenm = "New Brain 2차";
- }else{
- messageBox("현재 2차호출은 서울성모에서만 사용하실 수 있습니다.", "E");
- return;
- }
-
- //환자정보
- var pid = model.getValue("/root/main/erpat/erpatinfo/pid");
- var patnm = model.getValue("/root/main/erpat/erpatinfo/nm");
- var indd = model.getValue("/root/main/erpat/erpatinfo/indd");
- var cretno = model.getValue("/root/main/erpat/erpatinfo/cretno");
- var visitno = model.getValue("/root/tmp/patinfo/visitno");
- var intm = model.getValue("/root/main/erpat/erpatinfo/intm");
-
- //응급의학과 전화번호
- var cntctel = model.getValue("/root/main/erpat/erpatinfo/cntctel");
- cntctel = cntctel.replace(/-/gi, '');
-
- var params = pid + '|'
- + indd + '|'
- + cretno + '|'
- + visitno + '|'
- + intm + '|'
- + grtype
- ;
- //호출전 유효성체크
- if(!fIsValidErCallDr(params))
- return;
-
-
- var sSrchData = "";
- var sSrchHeader = "pid" +"▦"
- + "patnm" +"▦"
- + "indd" +"▦"
- + "cretno" +"▦"
- + "visitno" +"▦"
- + "intm" +"▦"
- + "grtype" +"▦"//호출구분 :
- + "grtypenm" +"▦"
- + "cntctel" +"▦"
- + "callflag" +"▦"//2차, 종료호출구분
- + "orddeptcd" +"▩"
- ;
- //환자정보셋팅
- var sSrchData = pid +"▦"
- + patnm +"▦"
- + indd +"▦"
- + cretno +"▦"
- + visitno +"▦"
- + intm +"▦"
- + grtype +"▦"
- + grtypenm +"▦"
- + cntctel +"▦"
- + "2" +"▦" //2차, 종료호출구분 - 2: 2차호출, 3: 종료호출
- + '-' +"▩" //new brain 2차호출은 주/부과 세팅 따로 구분 없음.
- ;
-
- model.makeValue("/root/send/reqdata/inscallinfo", sSrchHeader + sSrchData);
-
- if(submit("TXMNE05203")){
- //총 호출수
- var totcallcnt = model.getValue('/root/tmp/temp/rslt/callinfo/totcallcnt');
- messageBox("2차 호출("+ cpt_grtype.attribute("text") +")되었습니다.", "I");
- }else{
- if(isSearchString(model.getValue('/root/properties/error/code'), 'info') == false){
- messageBox('호출을 실패하였습니다.', 'E999');
- return;
- }
- }
-
-
- }
- //20091104 dhkim
- //New Brain 종료호출
- function fFinalCallNB(){
-
- //사용시기 : TPA약제 시작전이나 사용후 또는 Angio하기 전에 신경과 의사가 판단하여 호출함.
- //호출대상 : 1, 2차 New Brain 호출자 전체
-
-
- if(messageBox("New Brain 종료호출을 진행하시겠습니까?", "Q") == 7){
- return;
- }
-
- //중증구분캡션 New Brain과 동일하게 적용 --> B★
- cpt_grtype.attribute("text")="B★" ;
- var grtype = "6";
- var grtypenm = "";
-
- //new brain 종료는 서울성모만 적용임
- if(seoulinstcd == getUserInfo("dutplceinstcd")){
- grtypenm = "New Brain";
- }else{
- messageBox("현재 종료호출은 서울성모에서만 사용하실 수 있습니다.", "E");
- return;
- }
-
- //환자정보
- var pid = model.getValue("/root/main/erpat/erpatinfo/pid");
- var patnm = model.getValue("/root/main/erpat/erpatinfo/nm");
- var indd = model.getValue("/root/main/erpat/erpatinfo/indd");
- var cretno = model.getValue("/root/main/erpat/erpatinfo/cretno");
- var visitno = model.getValue("/root/tmp/patinfo/visitno");
- var intm = model.getValue("/root/main/erpat/erpatinfo/intm");
-
- //응급의학과 전화번호
- var cntctel = model.getValue("/root/main/erpat/erpatinfo/cntctel");
- cntctel = cntctel.replace(/-/gi, '');
-
- var params = pid + '|'
- + indd + '|'
- + cretno + '|'
- + visitno + '|'
- + intm + '|'
- + grtype
- ;
- //호출전 유효성체크
- if(!fIsValidErCallDr(params))
- return;
-
-
- var sSrchData = "";
- var sSrchHeader = "pid" +"▦"
- + "patnm" +"▦"
- + "indd" +"▦"
- + "cretno" +"▦"
- + "visitno" +"▦"
- + "intm" +"▦"
- + "grtype" +"▦"//호출구분 :
- + "grtypenm" +"▦"
- + "cntctel" +"▦"
- + "callflag" +"▦"//2차, 종료호출구분
- + "orddeptcd" +"▩"
- ;
- //환자정보셋팅
- var sSrchData = pid +"▦"
- + patnm +"▦"
- + indd +"▦"
- + cretno +"▦"
- + visitno +"▦"
- + intm +"▦"
- + grtype +"▦"
- + grtypenm +"▦"
- + cntctel +"▦"
- + "3" +"▦" //2차, 종료호출구분 - 2: 2차호출, 3: 종료호출
- + '-' +"▩" //new brain 2차호출은 주/부과 세팅 따로 구분 없음.
- ;
-
- model.makeValue("/root/send/reqdata/inscallinfo", sSrchHeader + sSrchData);
-
- if(submit("TXMNE05203")){
- //총 호출수
- var totcallcnt = model.getValue('/root/tmp/temp/rslt/callinfo/totcallcnt');
- messageBox("종료 호출("+ cpt_grtype.attribute("text") +")되었습니다.", "I");
- }else{
- if(isSearchString(model.getValue('/root/properties/error/code'), 'info') == false){
- messageBox('호출을 실패하였습니다.', 'E999');
- return;
- }
- }
-
-
- }
-
|