123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279 |
- /***********************************************************************************************************************************************************
- *
- * @ creat date - 2007.12.21
- * @ author - dhkim
- * @ desc - SMARC00800_응급실환자조회.xrw에서 사용하는 스크립트이다.
- * 조회조건의 의뢰환자체크박스가 체크되어있지 않을때는 환자번호를 필수로 조회조건으로 줘야한다.
- * 조회하여 그리드에 출력할때 내부적으로 key를 리턴하여 그리드 더블클릭 이벤트 발생시 상단정보를 등록하고 의뢰환자등록화면을 호출한다.
- * 그리드에 병동~주민번호까지 틀고정한다.
- **********************************************************************************************************************************************************/
-
- var xSearchPath = '/root/main/search';
- var xSendpath = '/root/send';
- var xTempPath = '/root/temp';
- var xGridPath = '/root/main/list/erpatlist';
- var CurrentDate = getCurrentDate();
- // 초기값 셋팅
- function fInit(){
- model.removeNodeset('/root/main/list/erpatlist');
- cmb_reqrgstyn.select(0);
- fSetCondition();
- }
-
- /**
- * 2007.12.21
- * 환자번호 입력시 환자명 출력
- * 환자명 입력시 환자번호 출력
- * 입력한 값이 존재하지않으면 팝업호출
- */
- function fGetPatientInfo(srchcond, keyword){
-
- model.removeNodeset(xSendpath );
- model.removeNodeset(xTempPath );
-
- model.makeValue(xSendpath + '/reqdata/srchcond', srchcond);//1:환자번호조회, 2:환자명조회
- if(srchcond == '1'){
- model.makeValue(xSendpath + '/reqdata/pid', keyword);
- }else if(srchcond == '2'){
- model.makeValue(xSendpath + '/reqdata/hngnm', keyword);
- }
-
- if(submit('TRARC00702')){
- if(getNodesetCount(xTempPath + '/patientinfo') != 1){
- fPopupWindowPatient(srchcond, keyword);
- }else if(getNodesetCount(xTempPath + '/patientinfo') == 1){
- model.setValue(xSearchPath + '/pid', model.getValue(xTempPath + '/patientinfo/pid'));
- model.setValue(xSearchPath + '/hngnm', model.getValue(xTempPath + '/patientinfo/hngnm'));
- model.refresh();
- }
- }
-
- }
-
- /**
- * 2007.12.21
- * 원무팀의 환자조회팝업을 호출한다.
- */
- function fPopupWindowPatient(srchcond, keyword){
-
- //parameter값 세팅
- model.removeNodeset(xTempPath );
- model.makeValue(xTempPath + '/pid', keyword==''? ipt_pid.currentText : keyword);
- model.makeValue(xTempPath + '/hngnm', keyword==''? ipt_hngnm.currentText : keyword);
- model.makeValue(xTempPath + '/srchcond', srchcond);
-
- //원무팀의 환자명을 받아오는 팝업창을 띄운다.
- modal('SPPMC02500', '1','150', '150', 'SPPMC02500', xTempPath , xSendpath );
-
- //팝업의 result는 /root/main/patinfo/patinfolist 에 들어온다.
- model.removeNodeset(xSearchPath + '/pid');
- model.removeNodeset(xSearchPath + '/hngnm');
- model.makeValue(xSearchPath + '/pid', model.getValue('/root/main/patinfo/patinfolist/pid'));
- model.makeValue(xSearchPath + '/hngnm', model.getValue('/root/main/patinfo/patinfolist/hngnm'));
- model.refresh();
- }
-
-
-
-
- /**
- * 2007.12.22
- * 내원자, 퇴원일자 별로 날짜를 세팅한다.
- * default - 내원자
- */
- function fSetCondition(condflag){
-
- if(condflag == null || condflag == '' ){
- condflag = '1';
- }
-
- //condflag : 1 (내원자) , 2(퇴원일자)
- //내원자 조회는 잘짜입력안함.. 퇴원일자는 조회조건에 날짜선택가능하고 default는 오늘날짜만 ..
- if(condflag == '1'){
- model.setValue(xSearchPath + '/fromdd', '');
- model.setValue(xSearchPath + '/todd', '');
- ipt_fromdd.disabled = 'true';
- ipt_todd.disabled = 'true';
-
- model.setValue(xSearchPath + '/reqyn', 'CP');
- }else if(condflag == '2' || condflag == '3'){
- model.setValue(xSearchPath + '/fromdd', CurrentDate);
- model.setValue(xSearchPath + '/todd', CurrentDate);
- ipt_fromdd.disabled = 'false';
- ipt_todd.disabled = 'false';
- }
-
- model.setValue(xSearchPath + '/condflag', condflag);
- //model.setValue(xSearchPath + '/reqyn', 'CP');
-
- model.refresh();
- }
-
- // 조회
- function fSearch(){
- var reqyn = model.getValue(xSearchPath + '/reqyn'); //조회조건의 의뢰환자 chk true일때의 값:CP
- var pid = ipt_pid.currentText; //환자등록번호
- var hngnm = ipt_hngnm.currentText; //환자명
- var condflag = model.getValue(xSearchPath + '/condflag'); //조회조건
- var fromdd = model.getValue(xSearchPath + '/fromdd');
- var todd = model.getValue(xSearchPath + '/todd');
- var reqrgstyn = model.getValue(xSearchPath + '/reqrgstyn');
-
- /*
- if(reqyn != 'CP'){
- if (pid.length < 2 && hngnm.length < 2) {
- messageBox( '의뢰환자여부를 체크하거나, 환자번호또는 환자명을 2자리 이상', 'C001' );
- return;
- }
- }
- */
-
- if (condflag == "1")
- {
- if(reqyn != 'CP'){
- /*
- if (pid.length < 2 && hngnm.length < 2) {
- messageBox( '환자번호 또는 환자명을 2자리 이상', 'C001' );
- return;
- }
- */
- }
-
- }
- else
- {
- if( ! isValidDateTime( fromdd, 'YYYYMMDD') || ! isValidDateTime( todd, 'YYYYMMDD') ){
- messageBox("입력하신 일자구분이 정확한 날짜타입이 아닙니다.", "E999", "");
- return;
- }
-
- if( getDateInterval(fromdd, todd) > 31 ){
- messageBox("조회가능한 최대 기간은 1달입니다. 일자구분에서 날짜를 수정하세요!", "E999", "");
- return;
- }
-
- if( getDateInterval(fromdd, todd) < 0 ){
- messageBox("일자구분에서 시작일자가 종료일자보다 미래일자 입니다. 확인하세요!", "E999", "");
- return;
- }
-
- if (hngnm.length > 0 && hngnm.length < 2) {
- messageBox( '환자명을 2자리 이상', 'C001' );
- return;
- }
-
- }
-
- model.removeNodeset(xSearchPath);
- model.makeValue(xSearchPath + '/condflag', condflag);
- model.makeValue(xSearchPath + '/reqyn', reqyn);
- model.makeValue(xSearchPath + '/pid', pid);
- model.makeValue(xSearchPath + '/hngnm', hngnm);
- model.makeValue(xSearchPath + '/fromdd', fromdd);
- model.makeValue(xSearchPath + '/todd', todd);
- model.makeValue(xSearchPath + '/reqrgstyn', reqrgstyn);
- //model.makeValue(xSearchPath + '/opyn', opyn);
-
- if (!submit('TRARC00801', false)){
- messageBox('조회를', 'E009');
- }
-
- model.refresh();
-
- }
-
-
- /**
- * 2007.12.21
- * 그리드 더블클릭 이벤트 발생시 상단정보 올리고 의뢰환자등록 팝업 호출
- */
- function fOpen(){
- var mainObj = getMainViewer();
-
- var curRow = grd_list.row; //그리드에서 해당 환자 선택
-
- if (curRow < 1) return;
-
- var ordtype = model.getValue(xGridPath + '[' + curRow + ']/ordtype');
- var pid = model.getValue(xGridPath + '[' + curRow + ']/pid');
- var orddd = model.getValue(xGridPath + '[' + curRow + ']/indd');
- var cretno = model.getValue(xGridPath + '[' + curRow + ']/cretno');
- //var instcd = model.getValue(xGridPath + '[' + curRow + ']/instcd');
- var instcd = getUserInfo("dutplceinstcd");
- var dschdd = model.getValue(xGridPath + '[' + curRow + ']/dschdd');
- var indschacptstat = model.getValue(xGridPath + '[' + curRow + ']/indschacptstat');
-
- var curdate = getCurrentDate();
-
- if (ordtype == "E")
- {
- curdate = orddd;
- }
- else
- {
- if (indschacptstat == "D")
- {
- curdate = dschdd;
- }
- else if (indschacptstat == "T")
- {
- if (dschdd != "99991231")
- {
- curdate = dschdd;
- }
- }
- }
-
- var condparam = ordtype + '▦' + pid + '▦' + orddd + '▦' + cretno + '▦' + instcd + '▦' + curdate;
- setParameter('condparam', condparam);
-
- modal('SPMMO08900', 1, '', '', '', '', '', 'left:0; right:0; width:0; height:0; sysmenu:hidden; caption:hidden; min:hidden, max:hidden;');
- //open('SPARC00100',1,1,1);
-
- var curEmrRecObj = getOpenWindow("SPARC00100"); //활성화된 진료기록 화면 object loading
-
- //var curCpObj = mainObj.javascript.getOpenWindow("SPARC00100"); //활성화된 CP Main 화면 object loading
-
- //alert(curCpObj);
- if (curEmrRecObj != null)
- {
- curEmrRecObj.javascript.fInit();
- }
- else
- {
- //curCpObj.javascript.fInit();
- open("SPARC00100",1,1,1, "SPARC00100", "", "", "", false);
- }
-
- }
-
- // 엑셀 저장
- function fExcel()
- {
- if (grd_list.rows <= 1) return;
-
- var fileName = window.fileDialog("save", ",", false, "응급실환자리스트", "xls", "Excel Files(*.xls)|*.xls|All Files (*.*)|*.*");
- if (fileName != ""){
- grd_list.saveExcel(fileName, "응급실환자", false, false, "", "", false);
- }
- }
-
- // 통합기록조회
- function fRecPopup()
- {
- var curRow = grd_list.row; //그리드에서 해당 환자 선택
-
- if (curRow >= 1)
- {
- var pid = model.getValue(xGridPath + '[' + curRow + ']/pid');
-
- setParameter("SMMRI00400_param_pid", pid);
- }
- open("SMMRI00400");
- }
-
|