123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249 |
- "use strict";
- /**
- * mplus_modal_examlist
- */
- var mplus_modal_examlist = function(){
- // 상속
- mplus_common.call(this);
-
- // 상위 객체 생성
- //var mplusPatient = new mplus_mobile_patient();
- //var mplusNursing = new mplus_nursing();
-
- //super
- var self = this;
- var varExamlistResultLists = [];
-
- //==== 변수 { ====
- //==== 변수 } ====
-
- /**
- * 초기화
- */
- this.init = function(){ //여기서 모든화면 콤보박스데이터를 집어넣자!!! 그래야지 화면이동할때 속도가 오래걸리지않음!!!
- // 초기 화면 조건 구성
- initCondition();
-
- // 이벤트 초기화
- addEvent();
- };
-
- //==== 초기화 설정 { ====
- var initCondition = function(){
- //결과값 초기화
- initEmptyData();
-
- // 초기 화면 조건 구성
- initStartEndDate();
-
- //접수부서
- initReceiptDeptList();
-
- };
-
- var initEmptyData = function(){
- $("#divExamResultRows").empty();
- varExamlistResultLists=[];
- }
-
- var initReceiptDeptList = function(){
- var param = {
- userId:gLoginUserId,
- patientId:gPatientId,
- startDt:moment($("#txtExamStartDt").val()).format("YYYYMMDD"),
- endDt:moment($("#txtExamEndDt").val()).format("YYYYMMDD")
- };
- self.medical.getExamReceiptDeptList(param, processReceiptDeptList);
- };
-
- var processReceiptDeptList = function(lists){
- $("#selReceiptDept").empty();
- var strDisplayTemp = "";
- strDisplayTemp = "<option value=\"\">접수부서</option>";
- if(lists != undefined){
- for(var i=0; i<lists.length; i++){
- strDisplayTemp += "<option value=\""+ lists[i].receiptDeptCd + "\" >"+ lists[i].receiptDeptNm +"</option>";
- }
- }
- $("#selReceiptDept").append(strDisplayTemp);
-
- $("#selReceiptDept").val($("#selReceiptDept option:first").val());
-
- searchExam();
- };
-
- var initStartEndDate = function(){
- //오늘일자 로드
- var varToday = new Date();
- //varToday.setDate(varToday.getMonth() - 1);
- //일요일이면 차주 가져오기
- //다른 요일이면 해당 요일 처리
- $("#txtExamEndDt").val( moment(varToday).format("YYYY-MM-DD") );
- $("#txtExamStartDt").val( moment().subtract(1, 'months').format("YYYY-MM-DD") );
- };
-
- var searchExam = function(){
- var param = {
- hospitalCd: localStorage.getItem("hospitalCd"),
- userId:gLoginUserId,
- patientId:gPatientId,
- startDt:moment($("#txtExamStartDt").val()).format("YYYYMMDD"),
- endDt:moment($("#txtExamEndDt").val()).format("YYYYMMDD"),
- receiptDeptCd:$("#selReceiptDept").val()
- };
- self.medical.getExamList(param, processSearchExamList);
- };
-
- var processSearchExamList = function(lists){
- var strDisplayTemp = "";
- var varExamReceiptDt = "";
- var varExamReceiptTm = "";
- var varExamDt = "";
- varExamlistResultLists = lists;
- $("#divExamResultRows").empty();
- for( var i = 0; i < lists.length; i++){
- if(lists[i].examReceiptDt != undefined && lists[i].examReceiptDt != "" && lists[i].examReceiptDt != null) {
- varExamReceiptDt = moment(lists[i].examReceiptDt).format("YYYY-MM-DD");
- varExamReceiptTm = moment(lists[i].examReceiptDt , "YYYYMMDDHHmmss").format("HH:mm");
- } else {
- varExamReceiptDt = lists[i].examReceiptDt;
- varExamReceiptTm = lists[i].examReceiptDt;
- }
- if(lists[i].examDt != undefined && lists[i].examDt != "" && lists[i].examDt != null) {
- varExamDt = moment(lists[i].examDt).format("YYYY-MM-DD");
- } else {
- varExamDt = lists[i].examDt;
- }
- strDisplayTemp += "<div class=\"chart-content\" listCnt=\"" + i + "\" examRsltKey=\"" + lists[i].examRsltKey + "\" style=\"overflow: hidden;\">"
- + " <div class=\"row\">"
- + " <div class=\"col-xs-1 text-center\" style=\"padding: 4px 0px;word-wrap: break-word;\"><p>" + lists[i].examClsNm + "</p></div>"
- // + " <div class=\"col-xs-3 text-center\" style=\"padding: 4px 0px;word-wrap: break-word;\"><p>" + moment(lists[i].examReceiptDt).format("YYYY-MM-DD") + "<br>" + moment(lists[i].examReceiptDt , "YYYYMMDDHHmmss").format("HH:mm") + "</p></div>"
- + " <div class=\"col-xs-3 text-center\" style=\"padding: 4px 0px;word-wrap: break-word;\"><p>" + varExamReceiptDt + "<br>" + varExamReceiptTm + "</p></div>"
- // + " <div class=\"col-xs-2 text-center\" style=\"padding: 4px 0px;word-wrap: break-word;\"><p>" + moment(lists[i].examDt).format("YYYY-MM-DD") + "</p></div>"
- + " <div class=\"col-xs-2 text-center\" style=\"padding: 4px 0px;word-wrap: break-word;\"><p>" + varExamDt + "</p></div>"
- + " <div class=\"col-xs-6\" style=\"padding: 4px 0px;word-wrap: break-word;\"><p>" + lists[i].examNm + "</p></div>"
- + " </div>"
- + "</div>"
- ;
- //console.log( i + " : " + lists[i].deptNm);
- }
-
- $("#divExamResultRows").append(strDisplayTemp); // element 추가
-
- addEventExamList();
- };
-
- var addEventExamList = function() {
- $("#divExamResultRows .chart-content").off("click"); // 기존 이벤트 해제
- $("#divExamResultRows .chart-content").on("click", function(e){
- if(varExamlistResultLists[e.currentTarget.attributes.listCnt.value].examRsltTy == "1"){ // 1:검체검사 2:판독결과 3:병리검사
- // 환자 정보 화면 띄우기
- $("#modalExamRsltTy1").modal("show");
- mplusModalExamrsltty1.init(varExamlistResultLists[e.currentTarget.attributes.listCnt.value]);
- // }else if(varExamlistResultLists[e.currentTarget.attributes.listCnt.value].examRsltTy == "2"){
- }else{
- // 환자 정보 화면 띄우기
- $("#modalExamRsltTy2").modal("show");
- mplusModalExamrsltty2.init(varExamlistResultLists[e.currentTarget.attributes.listCnt.value]);
- //} else {
- // self.alert("검사결과 타입값에 오류가 있습니다.");
- }
-
- });
- };
-
- var btnSetClassDefault = function(){
- $(".inquiry-btn").removeClass("on");
- };
- //==== 초기화 설정 } ====
-
- //==== 이벤트 설정 { ====
- var addEvent = function(){
- //$("#btnLogout").on("click", function(){
- // logout();
- //});
- eventConditionClick();
-
- eventColumnClick();
-
- eventRowClick();
- };
-
- var eventConditionClick = function(){
- // 1일
- $("#btnExamOneDaySearch").off("click"); // 기존 이벤트 해제
- $("#btnExamOneDaySearch").on("click", function(e){
- btnSetClassDefault();
- $("#btnExamOneDaySearch").addClass("on");
- $("#txtExamStartDt").val( moment().subtract(1, 'days').format("YYYY-MM-DD") );
- //접수부서
- initReceiptDeptList();
- });
- // 1주 버튼클릭
- $("#btnExamOneWeekSearch").off("click"); // 기존 이벤트 해제
- $("#btnExamOneWeekSearch").on("click", function(e){
- btnSetClassDefault();
- $("#btnExamOneWeekSearch").addClass("on");
- var varSelDate = new Date($("#txtExamEndDt").val());
- varSelDate.setDate(varSelDate.getDate() - 7);
- $("#txtExamStartDt").val( moment(varSelDate).format("YYYY-MM-DD") );
- //접수부서
- initReceiptDeptList();
- });
- // 1달 버튼클릭
- $("#btnExamOneMonthSearch").off("click"); // 기존 이벤트 해제
- $("#btnExamOneMonthSearch").on("click", function(e){
- btnSetClassDefault();
- $("#btnExamOneMonthSearch").addClass("on");
- $("#txtExamStartDt").val( moment().subtract(1, 'months').format("YYYY-MM-DD") );
- //접수부서
- initReceiptDeptList();
- });
- // 3달 버튼클릭
- $("#btnExamThreeMonthSearch").off('click'); // 기존 이벤트 해제
- $("#btnExamThreeMonthSearch").on('click', function(e){
- btnSetClassDefault();
- $("#btnExamThreeMonthSearch").addClass("on");
- $("#txtExamStartDt").val( moment().subtract(3, 'months').format("YYYY-MM-DD") );
- //접수부서
- initReceiptDeptList();
- });
- // 조회버튼
- $("#btnExamSearch").off("click"); // 기존 이벤트 해제
- $("#btnExamSearch").on("click", function(e){
- searchExam();
- });
-
- //날짜 변경 시 부서 다시 가져오기
- $("#txtExamStartDt").off("change"); // 기존 이벤트 해제
- $("#txtExamStartDt").on("change", function(e){
- //접수부서
- initReceiptDeptList();
- });
-
- $("#txtExamEndDt").off("change"); // 기존 이벤트 해제
- $("#txtExamEndDt").on("change", function(e){
- //접수부서
- initReceiptDeptList();
- });
- };
-
- var eventColumnClick = function(){
- };
-
- var eventRowClick = function(){
-
- };
- //==== 이벤트 설정 } ====
-
-
- //==== 서비스 실행 { ====
- //==== 서비스 실행 { ====
-
- };
|