"use strict"; /** * mplus_modal_patientinfo */ var mplus_modal_patientinfo = function(){ // 상속 mplus_common.call(this); // 상위 객체 생성 //var mplusPatient = new mplus_mobile_patient(); //var mplusNursing = new mplus_nursing(); //super var self = this; //==== 변수 { ==== var varResultLists = []; var varDeptCd = ""; // 진료과 코드 var varDeptNm = ""; // 진료과 명 var varDoctorId = ""; // 의사 ID var varDoctorNm = ""; // 의사명 //==== 변수 } ==== /** * 초기화 */ this.init = function(){ //여기서 모든화면 콤보박스데이터를 집어넣자!!! 그래야지 화면이동할때 속도가 오래걸리지않음!!! // 접근 권한 체크 checkAccessPermission(); // 초기 화면 조건 구성 initCondition(); // 이벤트 초기화 addEvent(); // 환자 정보 화면 출력 getPatientInfo(); }; //==== 접근 권한 체크 { ==== var checkAccessPermission = function(){ /* if( !self.common.checkAccessJobKind( "1000")){ self.alertTrue("접근 권한이 없습니다.", function(){ $("#modalPatientInfo").modal("hide")}); } if( !self.common.checkAccessUserAuth( "01")){ self.alertTrue("접근 권한이 없습니다.", function(){ $("#modalPatientInfo").modal("hide");}); } if( !self.common.checkAccessJobKind( "1000")){ self.common.disableElements( $("#myModalBtn")); } else{ self.common.enableElements( $("#myModalBtn")); } self.common.disableElements( $("#btnCollaborationDetail")); self.common.disableElements( $("#btnInternWorkSchDetail"));*/ checkAccessRights(); }; //==== 접근 권한 체크 } ==== //==== 초기화 설정 { ==== var initCondition = function(){ // 초기 화면 조건 구성 }; //==== 초기화 설정 } ==== //==== 이벤트 설정 { ==== var addEvent = function(){ eventPatientInfoClick(); }; var eventPatientInfoClick = function(){ $("#btnPatientInfoMedicalHistory").off("click"); $("#btnPatientInfoMedicalHistory").on("click", function(){ $("#modalMedicalHistory").modal("show"); mplusModalMedicalhistory.init(); }); $("#btnPatientInfoMedicalRecord").off("click"); $("#btnPatientInfoMedicalRecord").on("click", function(){ $("#modalMedicalRecord").modal("show"); mplusModalMedicalrecord.init(); }); $("#btnPrescriptionPrescription").off("click"); $("#btnPrescriptionPrescription").on("click", function(){ $("#modalPrescription").modal("show"); mplusModalPrescription.init(); }); $("#btnPatientInfoExamList").off("click"); $("#btnPatientInfoExamList").on("click", function(){ $("#modalExamList").modal("show"); mplusModalExamlist.init(); }); $("#btnPatientInfoOperation").off("click"); $("#btnPatientInfoOperation").on("click", function(){ $("#modalOperationDetail").modal("show"); mplusModalOperationdetail.init(); }); $("#btnPatientInfoTreatment").off("click"); $("#btnPatientInfoTreatment").on("click", function(){ $("#modalTreatmentDetail").modal("show"); mplusModalTreatmentdetail.init(); }); $("#btnVitalList").off("click"); $("#btnVitalList").on("click", function(){ $("#modalVitalList").modal("show"); mplusModalVitallist.init(); }); $("#btMedicationList").off("click"); $("#btMedicationList").on("click", function(){ $("#modalMedicationList").modal("show"); mplusModalMedicationlist.init(); }); $("#btnPatientInfoCollaboration").off("click"); $("#btnPatientInfoCollaboration").on("click", function(){ $("#modalCollaborationDetail").modal("show"); mplusModalCollaborationdetail.init(); }); // 20190228 shinsunwoo 환부 이미지 촬영 버튼 클릭 $("#btnWoundImg").off("click"); $("#btnWoundImg").on("click", function(){ readPicture(); }); }; //==== 이벤트 설정 } ==== //==== 서비스 실행 { ==== var checkAccessRights = function(){ var param = { userId: gLoginUserId, patientId: gPatientId, accessCd : "00" }; self.medical.checkAccessRights(param, processCheckAccessRights); }; var processCheckAccessRights = function(lists){ if( lists.length == 1){ if( lists[0].isAllowed == "0"){ // 환자 정보 화면을 종료함 self.alertTrue( "환자 정보 접근 권한이 없습니다, " + lists[0].rejectedMsg, function(){$("#modalPatientInfo").modal("hide");}); } } else { // 환자 정보 화면을 종료함 self.alertTrue( "환자 정보 접근 권한이 없습니다.", function(){$("#modalPatientInfo").modal("hide");}); } }; var getPatientInfo = function(){ var param = { userId: gLoginUserId, patientId: gPatientId, receiptNo: gPatientReceiptNo, treatCls: gPatientTreatCls }; self.medical.getPatientInfo(param, processGetPatientInfo); }; var processGetPatientInfo = function(lists){ // 1. 환자 정보 조회 결과를 varResultLists로 복사 varResultLists = lists; // 3. 환자 정보 결과를 화면에 disaplay drawPatientInfo(); // 4. 글로벌 변수 처리 if(lists[0].hospitalizationDt != undefined && lists[0].hospitalizationDt != "" && lists[0].hospitalizationDt != null){ self.common.setHospitalizationDt(lists[0].hospitalizationDt); } }; // 환자 정보 화면에 그리기 var drawPatientInfo = function(){ var lists = varResultLists; var strDisplayTemp = ""; $("#divPatientInfoResult").empty(); //2019.03.12. 진료기록 29990030 오픈 //var tempMedirecordCSS = "control-disabled"; for( var i = 0; i < lists.length; i++){ // strDisplayTemp += "
" // + "
" // + "

" // + " " + lists[i].birthDt + "" // + " " + lists[i].cellphoneNo + "[전화걸기][문자 보내기]" // + "

" // + "

" // + " " + self.common.displayTreatCls( gPatientTreatCls) + "" // + " " + lists[i].wardNm + " / " + lists[i].roomNm + "" // + "

" // + "

" // + " " + lists[i].doctorNm + "" // + " " + lists[i].specialistNm + "" // + "

" // + "

" // + " " + lists[i].diagnosisNm + "" // + "

" // + "

" // + " " + lists[i].operationDt + " / " + lists[i].operationNm + "" // + "

" // + "
" // + "
" // + "
" // + " " // + " " // + " " // + " " // + " " // + " " // + " " // + "
" // + "
" // + "
" // + " " // + "
" // + "
" // + "
" // + " " // + " " // + "
" // ; var tmpIsExamResult = lists[i].isExamResult == "1" ? " on" : ""; var tmpIsCollaboration = lists[i].isCollaboration == "1" ? " on" : ""; var tmpIsOperation = lists[i].isOperation == "1" ? " on" : ""; var tmpIsTreatment = lists[i].isTreatment == "1" ? " on" : ""; var tmpoperationDt = (moment(lists[i].operationDt).format("YYYY-MM-DD HH:mm") != "Invalid date") ? moment(lists[i].operationDt).format("YYYY-MM-DD HH:mm") : "-"; strDisplayTemp += "
" + "
" + "
" + "

" + lists[i].patientNm + " (" + lists[i].patientId + ")

" + "

" + " 문자 전화" + "

" + "
" + "
" + "
" + "
" + "

" + " 나이/성별 " + lists[i].age + "/" + lists[i].gender + "" + "

" + "
" + "
" + "

" + " 진료 " + self.common.displayTreatCls( gPatientTreatCls) + "" + "

" + "
" + "
" + "
" + "
" + "

" + " 진료과 " + lists[i].deptNm + "" + "

" + "
" + "
" + "
" + "
" + "

" + " 담당의 / 주치의" + " " + lists[i].doctorNm + "문자 전화" + " / " + lists[i].specialistNm + "문자 전화" + " " + "

" + "
" + "
" + "
" + "
" + "

" + " 주진단명 " + lists[i].diagnosisNm + "" + "

" + "
" + "
" + "
" + "
" + "

" + " 수술일 /주 수술 명 " + tmpoperationDt+ " / " + lists[i].operationNm + "" + "

" + "
" + "
" + "
" + "" + "
" + "
" + "
" + "

" + " 진료정보" + "

" + "
" + "
" + "
" + "
" + " " + "
" + "
" + " " + "
" // + "
" // + " " // + "
" + "
" + " " + "
" + "
" + "
" + "
" + " " + "
" + "
" + " " + "
" + "
" + " " + "
" + "
" //20190528 dkchoi75 백병원 별 환자정보_서비스 메뉴 미노출 처리 // if (gClientIp == "14.40.0.113" || gClientIp == "14.40.4.137" || gClientIp == "100.100.251.251" || gClientIp == "10.10.10.36" || gClientIp == "127.0.0.1") { // console.log(gClientIp); + "
" + "
" + " " + "
" + "
" + " " + "
" + "
" // } // + "
" // + "
" // + " " // + "
" // + "
" // + " " // + "
" // + "
" // + " " // + "
" // + "
" // + "
" // + "
" // + "
" // + "
" // + "

" // + " 조치" // + "

" // + "
" // + "
" // + "
" // + "
" // + " " // + "
" // + "
" // + " " // + "
" // + "
" // + " " // + "
" // + "
" // + "
" // + "
" // + "
" // + "
" // + "

2018-12-12, 홍길동

" // + "
" // + "
" // + "

환자가 알약 투약이 어려우니 처방된 약을 분말로...

" // + "
" // + "
" // + "
" ; // 20190228 shinsunwoo 환부촬영 이미지에서 사용할 변수에 값을 할당 varDeptCd = lists[i].deptCd; // 진료과 코드 varDeptNm = lists[i].deptNm; // 진료과 명 varDoctorId = lists[i].doctorId; // 의사 ID varDoctorNm = lists[i].doctorNm; // 의사명 } $("#divPatientInfoResult").append(strDisplayTemp); // element 추가 eventPatientInfoClick(); // 클릭 이벤트 처리 // notice 를 추가해줌 getPatientNotice(); } // notice를 조회 var getPatientNotice = function(){ var param = { userId: gLoginUserId, patientId: gPatientId }; self.medical.getPatientNotice(param, processGetPatientNotice); }; // notice 처리 var processGetPatientNotice = function(lists){ var strDisplayTemp = ""; if( lists.length < 0){ return; } // 초기 notice div element 추가 strDisplayTemp = "
"; $("#divPatientInfoResult").append(strDisplayTemp); // element 추가 strDisplayTemp = ""; //$(".chart-notice").empty(); for( var i = 0; i < lists.length; i++){ //strDisplayTemp += lists[i].noticeTxt + " , " + lists[i].noticeWriter + " , " + lists[i].writeDtTM + "\n"; strDisplayTemp += "
" + "
" + "

" + lists[i].writeDtTm + ", " + lists[i].noticeWriter + "

" + "
" + "
" + "

" + lists[i].noticeTxt + "

" + "
" + "
" ; } $(".chart-notice").html(strDisplayTemp); }; //==== 서비스 실행 } ==== // 20190228 shinsunwoo 환자의 환부이미지 추출 toNative 호출 var readPicture = function( param_deptNm, param_doctorNm){ console.log('call readPicture'); var serviceUrl = contextPath + "/mobile/medical/inputWoundImg.json"; var msg = { type : "command", functionType : "readPicture", value : { hospitalCD : "01", userId: gLoginUserId, patientId: gPatientId, patientNm: gPatientNm, age: gPatientAge, gender: gPatientGender, deptCd: varDeptCd, deptNm: varDeptNm, doctorId: varDoctorId, doctorNm : varDoctorNm, treatCls: gPatientTreatCls, serviceUrl: serviceUrl, callbackFn : "window.activeObj.readBarcodeCallBack" } }; self.toNative( msg ); }; // 20190228 shinsunwoo 환자의 바코드 추출 callback 처리 this.readPictureCallBack = function( returnCode){ var results = new Object(); if( typeof returnCode === "string" ){ results = self.util.parseJson( returnCode ); } else { results = returnCode; } if( results.success != undefined && results.success == "true" ) { console.log("readPicture : success"); console.log( results.result); } else { console.log("readPicture : failed"); self.alert( "readPicture APP function 호출 오류 " ); } }; };