123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528 |
- /* ---------------------------------------------------------------------
- 교육요구도 (SMMRJ00400_교육요구도.xrw - JScript )
- - Version :
- 1) : Ver.1.00.01
- : Create By heedae
- : 2010-04-14 오전 10:08:30
- ---------------------------------------------------------------------- */
- /* --------------------------------------------------*/
- /* type : function */
- /* access : public */
- /* desc : xforms-ready시 수행한다 */
- /* return : */
- /* --------------------------------------------------*/
- function fInit() {
- ipt_reqfromstnddd.value = getNewDate().getAddDate(-1, "M").getDateFormat("YYYYMMDD").substr(0, 8);
- ipt_reqtostnddd.value = getCurrentDate().substr(0, 8);
- emrfGetCodeList(new Array("J000000001","J000000002","J000000003","J000000004","J000000005"), new Array("/root/init/J000000001","/root/init/J000000002","/root/init/J000000003","/root/init/J000000004","/root/init/J000000005"));
-
- fGetOpenPatInfo();
- model.refresh();
- }
- /*
- * 화면 내용 클리어
- */
- function fInitMainList() {
- model.resetInstanceNode("/root/main/educordlists/educordlist");
- model.removeNodeset("/root/main/educordlists/educordlist");
- model.refresh();
- }
- /*
- * 넘어 온값 및 상대 값 체크
- */
- function fGetOpenPatInfo(){
-
- var pid = "";
- var orddd = "";
- var cretno = "";
- var hngnm = "";
- var ioflag= "";
- var setordtype="";
-
- if (isPopup() == true) {
- // param 환자정보
- pid = opener.javascript.getParameter("SPMRJ00400_pid");
- orddd = opener.javascript.getParameter("SPMRJ00400_orddd");
- cretno = opener.javascript.getParameter("SPMRJ00400_cretno");
- hngnm = opener.javascript.getParameter("SPMRJ00400_hngnm");
- ioflag = opener.javascript.getParameter("SPMRJ00400_ioflag");
- }
-
- //pid = "10043128";
- // hngnm = "이은경";
- // orddd = "20091029";
- // cretno = "1";
- // ioflag = "I";
- if ( !isNull(pid) && !isNull(orddd) && !isNull(cretno) && !isNull(hngnm) && !isNull(ioflag) ) {
- model.setValue("/root/send/reqdata/pid", pid);
- if(ioflag == "I" || ioflag == "E" || ioflag == "D"){
- setordtype="I";
- } else {
- setordtype="O";
- }
- model.setValue("/root/send/reqdata/ordtype", setordtype);
- input1.refresh();
-
- model.makeValue("/root/init/condition/pid", pid);
- model.makeValue("/root/init/condition/orddd", orddd);
- model.makeValue("/root/init/condition/cretno", cretno);
-
- model.setValue("/root/send/reqdata/pnm", hngnm);
- input2.refresh();
- fSearchOrdList();
-
- if( !isNull(pid) && isNull(hngnm)){
- model.setValue("/root/send/reqdata/pid", pid);
- fSearchPatNm();
- }
- } else {
- if( !isNull(pid) && isNull(hngnm)){
- model.setValue("/root/send/reqdata/pid", pid);
- fSearchPatNm();
- }
- }
-
- if ( isNull(pid) ) {
- // 상단 환자정보
- var node = getGlobalVariable("paminfo");
- model.removeNodeset("/root/init/paminfo/list");
- setCSVToNode("/root/init/paminfo", node);
- pid = model.getValue("/root/init/paminfo/list/pid");
- model.setValue("/root/send/reqdata/pid", pid);
- hngnm = model.getValue("/root/init/paminfo/list/hngnm");
- model.setValue("/root/send/reqdata/pnm", hngnm);
- ioflag = model.getValue("/root/init/paminfo/list/ioflag");
- if(ioflag == "I" || ioflag == "E" || ioflag == "D"){
- orddd = model.getValue("/root/init/paminfo/list/indd");
- setordtype="I";
- } else {
- orddd = model.getValue("/root/init/paminfo/list/orddd");
- setordtype="O";
- }
- cretno = model.getValue("/root/init/paminfo/list/cretno");
-
- if ( !isNull(pid) && !isNull(orddd) && !isNull(cretno) && !isNull(hngnm) ) {
-
- model.setValue("/root/send/reqdata/ordtype", setordtype);
-
- model.makeValue("/root/init/condition/pid", pid);
- model.makeValue("/root/init/condition/orddd", orddd);
- model.makeValue("/root/init/condition/cretno", cretno);
-
- fSearchOrdList();
- } else {
- model.setFocus("input1");
- button1.visible = false;
- model.setValue("/root/main/educordlists/educordlist/eduhandcapyn", "N");
- fRdoEduHandCapyn();
- }
- }
- }
- /*
- * 수진이력 가져오기
- */
- function fSearchOrdList(){
- model.removeNodeset("/root/init/ordlists");
- fInitMainList();
- model.refresh();
- var ordtype = radio1.value;
- if(!(model.getValue("/root/send/reqdata/pnm")=="")){
- model.setValue("/root/send/reqdata/ordtype",ordtype);
- submit("TRMRJ00102");
- if("" == model.getValue("/root/init/condition/pid") && "" == model.getValue("/root/init/condition/orddd") && "" == model.getValue("/root/init/condition/cretno") ){
- combo1.select(0);
- if ( combo1.length < 1){
- button1.visible = false;
- }
- } else {
- fChangeValueOrdList("open");
- }
-
- }
- }
- /*
- * 이전작성일시 변경시
- */
- function fChangeValueBeforeList()
- {
- var combindex = combo2.focusIndex+1;
-
- model.removeNode("root/searchneed");
- model.makeNode("root/searchneed");
- model.makeValue("root/searchneed/instcd", model.getValue("root/main/educorddaylists/educorddaylist["+combindex+"]/instcd"));
- model.makeValue("root/searchneed/pid",model.getValue("root/main/educorddaylists/educorddaylist["+combindex+"]/pid"));
- model.makeValue("root/searchneed/orddd",model.getValue("root/main/educorddaylists/educorddaylist["+combindex+"]/orddd"));
- model.makeValue("root/searchneed/cretno",model.getValue("root/main/educorddaylists/educorddaylist["+combindex+"]/cretno"));
- model.makeValue("root/searchneed/histno",model.getValue("root/main/educorddaylists/educorddaylist["+combindex+"]/histno"));
-
- submit("TRMRJ00203");
-
- fCheckOtherYn(ipt_eduwho9 ,chk_eduwho9.value);
- fCheckOtherYn(ipt_eduhandcap9 ,chk_eduhandcap9ck.value);
- fCheckOtherYn(ipt_eduway9 ,chk_eduway9ck.value);
- fCheckOtherYn(ipt_eduneed9 ,chk_eduneed9ck.value);
-
- if(rdo_eduwill.value== "999"){
- fCheckOtherYn(ipt_eduwill9,"Y");
- }else{
- fCheckOtherYn(ipt_eduwill9,"N");
- }
- fRdoEduHandCapyn();
- }
- /*
- * 수진이력 변경시
- */
- function fChangeValueOrdList(value){
- var ordtype = "";
- var i = 0;
-
- if( value == "open" && model.getValue("/root/init/condition/pid") !="" && model.getValue("/root/init/condition/orddd") != "" && model.getValue("/root/init/condition/cretno") != ""){
- for(i=1;i<=combo1.length; i++ ){
- if(model.getValue("/root/init/ordlists/ordlist["+i+"]/suminfo") == model.getValue("/root/init/condition/pid")+model.getValue("/root/init/condition/orddd")+model.getValue("/root/init/condition/cretno")){
- model.removeNodeset("/root/init/condition");
- combo1.select(i-1);
- ordtype = model.getValue("/root/init/ordlists/ordlist["+i+"]/ordtype");
- break;
- }
- }
- }else{
- model.setValue("/root/search/pid" , model.getValue("/root/init/ordlists/ordlist["+(combo1.focusIndex+1)+"]/pid"));
- model.setValue("/root/search/orddd" , model.getValue("/root/init/ordlists/ordlist["+(combo1.focusIndex+1)+"]/orddd"));
- model.setValue("/root/search/cretno" ,model.getValue("/root/init/ordlists/ordlist["+(combo1.focusIndex+1)+"]/cretno"));
- model.setValue("/root/search/ordtype" ,model.getValue("/root/init/ordlists/ordlist["+(combo1.focusIndex+1)+"]/ordtype"));
- model.setValue("/root/search/fromdd" ,model.getValue("/root/init/ordlists/ordlist["+(combo1.focusIndex+1)+"]/orddd"));
- ordtype = model.getValue("/root/init/ordlists/ordlist["+(combo1.focusIndex+1)+"]/ordtype");
-
- if(ordtype == "I"||ordtype == "D"||ordtype == "E" || ordtype == "O"){
- checkbox2.deselect(0);
- if(ordtype != "I" && ordtype != "E"){
- button1.visible = true;
- }else {
- button1.visible = false;
- }
- }else{
- checkbox2.select(0);
- button1.visible = false;
- }
-
- fSelectOrdCntsList();
- }
- }
- /*
- * 이전작성일시 조회
- */
- function fSelectOrdCntsList(){
- model.removeNodeset("/root/main/educorddaylists");
- model.refresh();
-
- var ordtype = model.getValue("/root/init/ordlists/ordlist["+(combo1.focusIndex+1)+"]/ordtype");
-
- if(ordtype == "D" || ordtype == "O"){
- if("0" != model.getValue("/root/search/daycheck")){
-
- button1.visible = true;
-
- }else{
- button1.visible = false;
- }
- }else {
- button1.visible = false;
- }
-
- model.setValue("/root/search/searchflag", "SPMRJ00400");
-
- if( fSelectChk()){
- submit("TRMRJ00401");
-
- if(combo2.length > 0){
- combo2.select(0);
- } else {
- //교육요구도 인스턴스 생성
- fSetInstance();
- model.setValue("/root/main/educordlists/educordlist/eduhandcapyn", "N");
- }
-
- fCheckOtherYn(ipt_eduwho9 ,chk_eduwho9.value);
- fCheckOtherYn(ipt_eduhandcap9 ,chk_eduhandcap9ck.value);
- fCheckOtherYn(ipt_eduway9 ,chk_eduway9ck.value);
- fCheckOtherYn(ipt_eduneed9 ,chk_eduneed9ck.value);
-
- if(rdo_eduwill.value== "999"){
- fCheckOtherYn(ipt_eduwill9,"Y");
- }else{
- fCheckOtherYn(ipt_eduwill9,"N");
- }
- fRdoEduHandCapyn();
-
- }
- }
- /**
- * 조회값 체크
- */
- function fSelectChk(){
- var pid = model.getValue("/root/search/pid");
- var orddd = model.getValue("/root/search/orddd");
- var cretno = model.getValue("/root/search/cretno");
-
- if ( pid == null ) { pid == ""; }
- if ( orddd == null ) { orddd == ""; }
- if ( cretno == null ) { cretno == ""; }
- if ( pid == "" || orddd =="" || cretno =="" ) {
- return false;
- }
-
- return true;
- }
- /*
- * 교육 장애요인 값 체크
- */
- function fRdoEduHandCapyn(){
- if(rdo_eduhandcapyn.value=="N"){
- chk_eduhandcap1.value = "N";
- chk_eduhandcap1.disabled = "true";
- chk_eduhandcap2.value = "N";
- chk_eduhandcap2.disabled = "true";
- chk_eduhandcap3.value = "N";
- chk_eduhandcap3.disabled = "true";
- chk_eduhandcap4.value = "N";
- chk_eduhandcap4.disabled = "true";
- chk_eduhandcap5.value = "N";
- chk_eduhandcap5.disabled = "true";
- chk_eduhandcap6.value = "N";
- chk_eduhandcap6.disabled = "true";
- chk_eduhandcap9ck.value = "N";
- chk_eduhandcap9ck.disabled = "true";
- fCheckOtherYn(ipt_eduhandcap9,"N");
- }else{
- chk_eduhandcap1.disabled = "false";
- chk_eduhandcap2.disabled = "false";
- chk_eduhandcap3.disabled = "false";
- chk_eduhandcap4.disabled = "false";
- chk_eduhandcap5.disabled = "false";
- chk_eduhandcap6.disabled = "false";
- chk_eduhandcap9ck.disabled = "false";
- fCheckOtherYn(ipt_eduhandcap9,chk_eduhandcap9ck.value);
- }
- }
- /*
- * 교육요구도 인스턴스 생성
- */
- function fSetInstance(){
- model.makeValue("/root/main/educordlists/educordlist/instcd", "");
- model.makeValue("/root/main/educordlists/educordlist/pid", "");
- model.makeValue("/root/main/educordlists/educordlist/orddd", "");
- model.makeValue("/root/main/educordlists/educordlist/cretno", "");
- model.makeValue("/root/main/educordlists/educordlist/histno", "");
- model.makeValue("/root/main/educordlists/educordlist/delyn", "");
- model.makeValue("/root/main/educordlists/educordlist/eduwho1", "");
- model.makeValue("/root/main/educordlists/educordlist/eduwho2", "");
- model.makeValue("/root/main/educordlists/educordlist/eduwho9", "");
- model.makeValue("/root/main/educordlists/educordlist/eduwho9ck", "");
- model.makeValue("/root/main/educordlists/educordlist/eduwill1", "");
- model.makeValue("/root/main/educordlists/educordlist/eduwill9", "");
- model.makeValue("/root/main/educordlists/educordlist/eduhandcapyn", "");
- model.makeValue("/root/main/educordlists/educordlist/eduhandcap1", "");
- model.makeValue("/root/main/educordlists/educordlist/eduhandcap2", "");
- model.makeValue("/root/main/educordlists/educordlist/eduhandcap3", "");
- model.makeValue("/root/main/educordlists/educordlist/eduhandcap4", "");
- model.makeValue("/root/main/educordlists/educordlist/eduhandcap5", "");
- model.makeValue("/root/main/educordlists/educordlist/eduhandcap6", "");
- model.makeValue("/root/main/educordlists/educordlist/eduhandcap9", "");
- model.makeValue("/root/main/educordlists/educordlist/eduhandcap9ck", "");
- model.makeValue("/root/main/educordlists/educordlist/eduway1", "");
- model.makeValue("/root/main/educordlists/educordlist/eduway2", "");
- model.makeValue("/root/main/educordlists/educordlist/eduway3", "");
- model.makeValue("/root/main/educordlists/educordlist/eduway4", "");
- model.makeValue("/root/main/educordlists/educordlist/eduway5", "");
- model.makeValue("/root/main/educordlists/educordlist/eduway9", "");
- model.makeValue("/root/main/educordlists/educordlist/eduway9ck", "");
- model.makeValue("/root/main/educordlists/educordlist/eduneed1", "");
- model.makeValue("/root/main/educordlists/educordlist/eduneed2", "");
- model.makeValue("/root/main/educordlists/educordlist/eduneed3", "");
- model.makeValue("/root/main/educordlists/educordlist/eduneed4", "");
- model.makeValue("/root/main/educordlists/educordlist/eduneed9", "");
- model.makeValue("/root/main/educordlists/educordlist/eduneed9ck", "");
- model.makeValue("/root/main/educordlists/educordlist/fstrgstdt", "");
- model.makeValue("/root/main/educordlists/educordlist/lastupdtrid", "");
- model.makeValue("/root/main/educordlists/educordlist/lastupdtdt", "");
- model.makeValue("/root/main/educordlists/educordlist/usernm", "");
-
- }
- /*
- * 교육 장애요인 값 체크(기타 선택시 입력 필드 체크)
- */
- function fCheckOtherYn(ipt, param){
-
- if(param=="Y"){
- ipt.visible = true;
- }else{
- ipt.visible = false;
- ipt.value = "";
- }
-
- }
- /*
- * 파라메타값(pid)로 환자정보 찾기
- */
- function fSearchPatNm(){
- if(model.getValue("/root/send/reqdata/pid")==""){
- return;
- }else{
- fGetPid("/root/send/reqdata/pid", "/root/send/reqdata/pnm");
- }
- input2.refresh();
- }
- /**
- * @desc : 환자등록번호 조회 팝업
- * @
- * @param : refPid - 환자번호 참고 node path
- * refPnm - 환자명 참고 node path
- * @return :
- * @authur : 이은영 2008.03.18
- * @---------------------------------------------------
- */
- function fGetPid(refPid, refPnm)
- {
- model.setValue("/root/send/reqdata/pnm","");
- input2.refresh();
- model.removeNodeset("/root/init/ordlists");
- fInitMainList();
- combo1.refresh();
- model.makeNode("/root/main/patinfo/patinfolist");
- //조회건수가 1건일 경우 팝업창을 바로 닫는다.
- model.makeValue("/root/hidden/tmp/pidpopupinfo/checkfnexam", "1");
- model.makeValue("/root/hidden/tmp/pidpopupinfo/autoflag", "Y");
- model.makeValue("/root/hidden/tmp/pidpopupinfo/pid", model.getValue(refPid));
- if( model.getValue("/root/hidden/tmp/pidpopupinfo/srchcond") == '' ){
- model.makeValue("/root/hidden/tmp/pidpopupinfo/srchcond", '1');
- }
- modal("SPPMC02500", "1","150", "150", "SPPMC02500", "/root/hidden/tmp/pidpopupinfo", "/root/send");
- model.resetInstanceNode("/root/source");
- //환자번호 copy
- var popupendflag = model.getValue("/root/main/popupendflag");
- if (popupendflag == "ok")
- {
- model.makeValue(refPid, model.getValue("/root/main/patinfo/patinfolist/pid"));
- if (refPnm == null) { refPnm = "" }
- if (refPnm != "") {
- model.makeValue(refPnm, model.getValue("/root/main/patinfo/patinfolist/hngnm"));
- }
- model.refresh();
- fSearchOrdList();
- }
- }
- /**
- * 등록 체크 및 처리
- */
- function fSave(){
- // 교육요구도 사정 필수 체크
- var ordtype = model.getValue("/root/init/ordlists/ordlist["+(combo1.focusIndex+1)+"]/ordtype");
-
- if(ordtype == "O" || ordtype == "D"){
- model.setValue("/root/main/educordlists/educordlist/pid" , model.getValue("/root/init/ordlists/ordlist["+(combo1.focusIndex+1)+"]/pid"));
- model.setValue("/root/main/educordlists/educordlist/orddd" , model.getValue("/root/init/ordlists/ordlist["+(combo1.focusIndex+1)+"]/orddd"));
- model.setValue("/root/main/educordlists/educordlist/cretno" ,model.getValue("/root/init/ordlists/ordlist["+(combo1.focusIndex+1)+"]/cretno"));
- }
-
- if(!(chk_eduwho1.value == "Y" || chk_eduwho2.value == "Y" || chk_eduwho9.value == "Y")){
- messageBox("교육요구 항목이 누락 되었습니다.","I003");
- return;
- }
- if(chk_eduwho9.value == "Y" && ipt_eduwho9.value.getTrim() == "") { // 기타 항목 체크
- messageBox("교육요구의 기타 항목이 누락 되었습니다.","I003");
- model.setFocus("ipt_eduwho9")
- return;
- }
- if(rdo_eduwill.value == ""){
- messageBox("교육에 대한 의지 항목이 누락 되었습니다.","I003");
- return;
- }
- if(rdo_eduwill.value == "999" && ipt_eduwill9.value.getTrim() == ""){ // 기타 항목 체크
- messageBox("교육에 대한 의지의 기타 항목이 누락 되었습니다.","I003");
- model.setFocus("ipt_eduwill9")
- return;
-
- }
- if((rdo_eduhandcapyn.value == "Y")&&!(chk_eduhandcap1.value == "Y" || chk_eduhandcap2.value == "Y" || chk_eduhandcap3.value == "Y" || chk_eduhandcap4.value == "Y" || chk_eduhandcap5.value == "Y" || chk_eduhandcap6.value == "Y" || chk_eduhandcap9ck.value == "Y")){
- messageBox("교육 장애요인 항목이 누락 되었습니다.","I003");
- return;
- }
- if(chk_eduhandcap9ck.value == "Y" && ipt_eduhandcap9.value.getTrim() == ""){ // 기타 항목 체크
- messageBox("교육 장애요인의 기타 항목이 누락 되었습니다.","I003");
- model.setFocus("ipt_eduhandcap9")
- return;
- }
- if(!(chk_eduway1.value == "Y" || chk_eduway2.value == "Y" || chk_eduway3.value == "Y" || chk_eduway4.value == "Y" || chk_eduway5.value == "Y" || chk_eduway9ck.value == "Y")){
- messageBox("교육방법 항목이 누락 되었습니다.","I003");
- return;
- }
- if(chk_eduway9ck.value == "Y"&& ipt_eduway9.value.getTrim() == ""){ // 기타 항목 체크
- messageBox("교육방법의 기타 항목이 누락 되었습니다.","I003");
- model.setFocus("ipt_eduway9")
- return;
- }
- if(!(chk_eduneed1.value == "Y" || chk_eduneed2.value == "Y" || chk_eduneed3.value == "Y" || chk_eduneed4.value == "Y" || chk_eduneed9ck.value == "Y")){
- messageBox("원하는 교육 내용 항목이 누락 되었습니다.","I003");
- return;
- }
- if(chk_eduneed9ck.value == "Y" && ipt_eduneed9.value.getTrim() == ""){ // 기타 항목 체크
- messageBox("원하는 교육 내용의 기타 항목이 누락 되었습니다.","I003");
- model.setFocus("ipt_eduneed9")
- return;
- }
-
- if(submit("TXMRJ00301")){
- fSelectOrdCntsList();
-
- }else{
- messageBox("교육요구도 저장이 실패하였습니다.", "E");
- return false;
- }
- return true;
- }
- /**
- * 닫기 클릭
- */
- function fClose(){
- window.close();
- }
|