"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 + "" // + "
" // + "" + " 나이/성별 " + lists[i].age + "/" + lists[i].gender + "" + "
" + "" + " 진료 " + self.common.displayTreatCls( gPatientTreatCls) + "" + "
" + "" + " 진료과 " + lists[i].deptNm + "" + "
" + "" + " 주진단명 " + lists[i].diagnosisNm + "" + "
" + "" + " 수술일 /주 수술 명 " + tmpoperationDt+ " / " + lists[i].operationNm + "" + "
" + "" + " 진료정보" + "
" + "" // + " 조치" // + "
" // + "2018-12-12, 홍길동
" // + "환자가 알약 투약이 어려우니 처방된 약을 분말로...
" // + "" + lists[i].writeDtTm + ", " + lists[i].noticeWriter + "
" + "" + lists[i].noticeTxt + "
" + "