<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="s" uri="http://www.springframework.org/tags"%>

<script type="text/javascript" src="<c:url value="/resources/js/mobile/medical/clinic.js?version=" /><s:message code="mp.version"/>"></script>

<div id="page" class="main-content">
	<div>
	  <!-- Nav tabs -->
	  <ul class="nav nav-tabs" role="tablist" id="clinicTab">
	    <li role="presentation" class="active"><a href="#tabIn" aria-controls="tabIn" role="tab" data-toggle="tab">재원</a></li>
	    <li role="presentation"><a href="#tabOut" aria-controls="tabOut" role="tab" data-toggle="tab">외래</a></li>
	    <li role="presentation"><a href="#tabEmer" aria-controls="tabEmer" role="tab" data-toggle="tab">응급</a></li>
	    <li role="presentation"><a href="#tabSearch" aria-controls="tabSearch" role="tab" data-toggle="tab">검색</a></li>
	  </ul>
	
	  <!-- Tab panes -->
	  <div class="tab-content">
	  	<!-- 입원탭 -->
	    <div role="tabpanel" class="tab-pane active" id="tabIn">
	    	<div class="row1 container">
				<div class="col-xs-3 col-sm-3 text-center">
					<img src="<c:url value='/resources/css/images/mobile/member.png' />" class="total-num-icon">
					<span class="total-num letter-control" id="inTotalNumSpan">0</span>
				</div>
				<div class="col-xs-6 col-sm-6 text-center pd0">
					<select class="form-control slt-my-department" id="inSltDept">
					</select>
				</div>
				<div class="col-xs-3 col-sm-3">
					<div class="checkbox3  checkbox-check checkbox-light">
                        <input type="checkbox" id="inChkTotalView" value="ALL" checked>
                        <label for="inChkTotalView">전체
                        </label>
	                   </div>
				</div>
			</div>
			<div class="row2 container result">
				<div class="col-xs-3 col-sm-3 text-center">
					<button class="btn btn-icon sort" id="inBtnSortOpen">
					</button>
				</div>
				<div class="col-xs-6 col-sm-6 text-center pd0">
					<input class="form-control" type="text" placeholder="환자번호" id="inPidSearch">
				</div>
				<div class="col-xs-3 col-sm-3">
					<button class="btn btn-style-1 btn-sm" id="inSearchBtn">조회</button>
				</div>
				<!-- 20180718 회진입력 부분 주석 처리
				<div class="col-xs-3 col-sm-3" id="roundBtnWrap" style="display: none">
					<button class="btn btn-style-1 btn-sm" id="inRoundBtn" style="display:initial">회진</button>
					<button class="btn btn-style-1 btn-sm" id="inInsertBtn" style="display:none">입력</button>
				</div> -->
			</div>
			<!-- .row2 end -->
	
			<div class="row3">
				<div id="patientList"> 
					<div class="list-header" id="patientHeader">
						<div id="inPatientHeaderPhone">  
							<div class="list-row container">
								<div class="col-xs-12 col-sm-8 pd0">
									<span class="header col-xs-5 col-sm-3 sort_ward pdr0 bed-wrap">병동/병실/병상
										<span class="sort-icon-down">▼</span> 
										<span class="sort-icon-up">▲</span>
									</span>
									<span class="header col-xs-4 col-sm-5 sort_patientNm pd0 patientNm-wrap">환자명
										<span class="sort-icon-down">▼</span>
										<span class="sort-icon-up">▲</span>
									</span> 
									<span class="header col-xs-3 col-sm-2 sexage sort_age pdr0" id="sexWrap">성별/나이
										<span class="sort-icon-down">▼</span>
										<span class="sort-icon-up">▲</span>
									</span>
								</div>
								<div class="col-xs-12 col-sm-4 pd0">
									<span class="header col-xs-4 col-sm-2 checkbox3 checkbox-sm checkbox-check checkbox-light" id="roundAllChkBoxWrapPhone" style="display: none">
				                        <input type="checkbox" id="roundAllChkBox" value="ALL" checked>
				                        <label for="roundAllChkBox">전체
				                        </label>
				                   	</span>
				                   	<span class="header col-xs-5 col-sm-5 pdr0 in-date-wrap" id="inDateWrap">입원일</span>
				                   	<span class="header col-xs-4 col-sm-5 pd0 doctor-wrap">주치의</span> 
								</div>
							</div>
						</div>
						
						<div id="inPatientHeaderTablet" style="display:none">  
							<div class="list-row container">
								<div class="col-xs-12 col-sm-12 pd0">
									<span class="header col-xs-1 col-sm-1 checkbox3 checkbox-sm checkbox-check checkbox-light" id="roundAllChkBoxWrapTablet" style="display: none">
				                        <input type="checkbox" id="roundAllChkBox" value="ALL" checked>
				                        <label for="roundAllChkBox">전체
				                        </label>
				                   	</span>
									<span class="header col-xs-2 col-sm-2 sort_ward pdr0 bed-wrap">병동/병실/병상
										<span class="sort-icon-down">▼</span> 
										<span class="sort-icon-up">▲</span>
									</span>
									<span class="header col-xs-3 col-sm-3 pdr0 in-date-wrap" id="inDateWrap">입원일</span>
									<span class="header col-xs-2 col-sm-2 sort_patientNm pd0 patientNm-wrap">환자명
										<span class="sort-icon-down">▼</span>
										<span class="sort-icon-up">▲</span>
									</span> 
									<span class="header col-xs-2 col-sm-2 sexage sort_age pdr0" id="sexWrap">성별/나이
										<span class="sort-icon-down">▼</span>
										<span class="sort-icon-up">▲</span>
									</span>
									<span class="header col-xs-2 col-sm-2 pd0 doctor-wrap">주치의</span> 
								</div>
							</div>
						</div>
					</div>
					<!-- 리스트 헤더 종료 -->
					<ul class="list-group" id="inUlPatientList">
					</ul>
				</div>
				<!-- patientList 종료 -->
			</div>
	    </div>
	    <!-- 입원탭  종료   -->
	    <!-- 외래탭-->
	    <div role="tabpanel" class="tab-pane" id="tabOut">
	    	<div class="row1 container">
				<div class="col-xs-3 col-sm-3 text-center">
					<img src="<c:url value='/resources/css/images/mobile/member.png' />" class="total-num-icon">
					<span class="total-num letter-control" id="outTotalNumSpan">0</span>
				</div>
				<div class="col-xs-5 col-sm-5 text-center pd0">
					<select class="form-control slt-my-department" id="outSltDept">
					</select>
				</div>
				<div class="col-xs-4 col-sm-4 pdl5">
					<select class="form-control" id="outSltDoctor">
					</select>
				</div>
			</div>
			<!-- .row1 end -->
	
			<div class="row2 container">
				<div class="col-xs-3 col-sm-3 text-center">
					<button class="btn btn-icon  btn-primary sort" id="outBtnSortOpen"></button>
				</div>
				<div class="calendar col-xs-4 col-sm-4 pd0 text-center">
					<input type="date" class="form-control" id="outSearchDate" required="required">
				</div>
				<div class="col-xs-3 col-sm-3 text-center pdl5 pdr0">
					<input class="form-control" type="text" placeholder="환자번호" id="outPidSearch">
				</div>
				<div class="col-xs-2 col-sm-2 pdl5">
					<button class="btn btn-style-1 btn-sm" id="outSearchBtn">조회</button>
				</div>
			</div>
			<!-- .row2 end -->
	
			<div class="row3">
				<div id="outPatientList">
					<div class="list-header" id="outPatientHeader">
						<div class="list-row container">
							<div class="col-xs-12 col-sm-6 pd0">
								<span class="header col-xs-3 col-sm-3 sort_treatTm">진료시간
									<span class="sort-icon-down">▼</span>
									<span class="sort-icon-up">▲</span>
								</span>
								<span class="header col-xs-6 col-sm-6 sort_patientNm">환자명
									<span class="sort-icon-down">▼</span>
									<span class="sort-icon-up">▲</span>
								</span> 
								<span class="header col-xs-3 col-sm-3 sort_age pdr0">성별/나이
									<span class="sort-icon-down">▼</span>
									<span class="sort-icon-up">▲</span>
								</span> 
							</div>
							<div class="col-xs-12 col-sm-6 pd0">
								<span class="header col-xs-3 hidden-sm">&nbsp;
								</span>
								<span class="header col-xs-6 col-sm-6">주치의
								</span>
								<span class="header col-xs-3 col-sm-3">상태
								</span> 
							</div>
						</div>
					</div>
					<!-- 리스트 헤더 종료 -->
					<ul class="list-group" id="outUlPatientList">
					</ul>
				</div>
				<!-- patientList 종료 -->
			</div>
	    </div>
	    <!-- 외래탭  종료   -->
	    <!-- 응급탭  -->
	    <div role="tabpanel" class="tab-pane" id="tabEmer">
	    	<div class="row1 container">
				<div class="col-xs-3 col-sm-3 text-center">
					<img src="<c:url value='/resources/css/images/mobile/member.png' />" class="total-num-icon">
					<span class="total-num letter-control" id="emerTotalNumSpan">0</span>
				</div>
				<div class="col-xs-6 col-sm-6 text-center">
					<select class="form-control" id="emerSltDept">
					</select>
				</div>
				<div class="col-xs-3 col-sm-3">
					<button class="btn btn-style-1 btn-sm" id="emerSearchBtn">조회</button>
				</div>
				<!-- <div class="col-xs-3 col-sm-3">
					<div class="checkbox3  checkbox-check checkbox-light">
						<input type="checkbox" id="emerChkTotalView" value="ALL" checked disabled>
						<label for="emerChkTotalView">전체 </label>
					</div>
				</div> -->
			</div>
			<!-- .row1 end -->
	
			<div class="row2 container">
				<div class="col-xs-3 col-sm-3 text-center">
					<button class="btn btn-icon  btn-primary sort" id="emerBtnSortOpen"></button>
				</div>
				<div class="col-xs-6 col-sm-6 text-center">
					<input class="form-control" type="text" placeholder="환자번호" id="emerPidSearch">
				</div>
				
			</div>
			<!-- .row2 end -->
	
			<div class="row3">
				<div id="emerPatientList">
					<div class="list-header">
						<div class="list-row container">
							<div class="col-xs-12 col-sm-7 pd0">
								<span class="header col-xs-4 col-sm-5 pdr0">병동/병실/병상</span>
								<span class="header col-xs-5 col-sm-4 sort_patientNm pd0">환자명
									<span class="sort-icon-down">▼</span>
									<span class="sort-icon-up">▲</span>
								</span> 
								<span class="header col-xs-3 col-sm-3 sort_age pdr0">성별/나이
									<span class="sort-icon-down">▼</span>
									<span class="sort-icon-up">▲</span>
								</span>
							</div>
							<div class="col-xs-12 col-sm-5 pd0">
								<span class="header col-xs-4 col-sm-4 pdr0">경과시간</span>
								<span class="header col-xs-5 col-sm-4 pd0">주치의</span> 
								<span class="header col-xs-3 col-sm-4 pdr0">입원일</span>
							</div>
						</div>
					</div>
					<!-- 리스트 헤더 종료 -->
					<ul class="list-group" id="emerUlPatientList">
					</ul>
				</div>
				<!-- patientList 종료 -->
			</div>
	    </div>
	    <!-- 응급탭  종료-->
	    <!-- 검색탭  -->
	    <div role="tabpanel" class="tab-pane" id="tabSearch">
	    	<div class="row1 container">
				<div class="col-xs-12 text-center pd0">
					<div class="radio3 radio-check radio-inline">
						<input type="radio" id="radioTreat" checked="" name="plist-search"
							value="treat"> <label for="radioTreat">진료과 /주치의 </label>
					</div>
					<div class="radio3 radio-check radio-inline">
						<input type="radio" id="radioHospital" name="plist-search"
							value="hospital"> <label for="radioHospital">병동/진료과</label>
					</div>
					<div class="radio3 radio-check radio-inline">
						<input type="radio" id="radioPatient" name="plist-search"
							value="patient"> <label for="radioPatient">재원환자</label>
					</div>
				</div>
			</div>
			<div class="row2 container">
				<div class="col-xs-12">
					<div class="col-xs-5" id="searchSearchConditionUpper">
					</div>
					<div class="col-xs-5" id="searchSearchConditionLower">
					</div>
					<div class="col-xs-2 pd0">
						<button class="btn btn-style-1 btn-sm" id="searchSearchBtn">조회</button>
					</div>
				</div>
				<div class="col-xs-12" style="top: 8px" id="searchSearchConditionType">
					<div class="col-xs-5 text-center pd0">
						<div class="radio3 radio-check radio-inline">
						<input type="radio" id="radioIn" checked="" name="treatment"
							value="in"> <label for="radioIn">재원 </label>
					</div>
					<div class="radio3 radio-check radio-inline">
						<input type="radio" id="radioOut" name="treatment"
							value="out"> <label for="radioOut">외래</label>
					</div>
					</div>
					<div class="col-xs-5 pdl5">
						<input type="date" class="form-control" id="searchSearchDate" required="required" readonly>
					</div>
				</div>
			</div>
			<div class="row3">
				<div id="searchPatientList">
					<div class="list-header" id="searchPatientHeaderPhone">
						<div class="list-row container">
							<div class="col-xs-12 col-sm-8 pd0">
								<span class="header col-xs-5 col-sm-2 pdr0">병동/병실/병상</span>
								<span class="header col-xs-4 col-sm-2 pd0">환자명</span>
								<span class="header col-xs-3 col-sm-2 pdr0">성별/나이</span>
							</div>
							<div class="col-xs-12 col-sm-4 pd0">
								<span class="header col-xs-5 col-sm-3 treat-header pdr0">입원일</span>
								<span class="header col-xs-4 col-sm-2 pd0">주치의</span>
							</div>
						</div>
					</div>
					
					<div class="list-header" id="searchPatientHeaderTablet">
						<div class="list-row container">
							<div class="col-xs-12 col-sm-12 pd0">
								<span class="header col-xs-2 col-sm-2 pdr0">병동/병실/병상</span>
								<span class="header col-xs-3 col-sm-3 treat-header pdr0">입원일</span>
								<span class="header col-xs-2 col-sm-2 pd0">환자명</span>
								<span class="header col-xs-2 col-sm-2">성별/나이</span>
								<span class="header col-xs-2 col-sm-2 pd0">주치의</span>
							</div>
						</div>
					</div>
					<!-- 리스트 헤더 종료 -->
					<ul class="list-group" id="searchUlPatientList">
					</ul>
				</div>
				<!--patientList 종료  -->
			</div>
	    </div>
	    <!-- 검색탭 종료  -->
	  </div>
	
	</div>
	<div class="modal fade" tabindex="-1" role="dialog" id="modalRoundInsert" style="display: none">
		<div class="modal-dialog" role="document">
		   <div class="modal-content">
		     <div class="modal-header">
		       <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
		       <h4 class="modal-title">회진시간입력</h4>
		     </div>
		     <div class="modal-body row">
		     	<div class="col-xs-12 col-sm-12 pd0 mb5">
			     	<div class="col-xs-4 col-sm-4">
			     		<span class="mp-dot"></span>회진시간
			     	</div>
					<div class="col-xs-8 col-sm-8 pd0">
							
					</div>
		     	</div>
		     	<div class="col-xs-12 col-sm-12 pd0 mb5">
					<div class="col-xs-6 col-sm-6 pdr0">
							<input type="date" class="form-control" id="dateRound"></input>
					</div>
					<div class="col-xs-6 col-sm-6 pdl0">
							<input type="time" class="form-control" id="timeRound"></input>
					</div>
		     	</div>
		     	
		     	<div class="col-xs-12 col-sm-12 pd0 mb5">
			     	<div class="col-xs-4 col-sm-4">
			     		<span class="mp-dot"></span>메&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;모
			     	</div>
					<div class="col-xs-8 col-sm-8 pdl0">
					</div>
		     	</div>
		     	<div class="col-xs-12 col-sm-12 pd0">
					<div class="col-xs-12 col-sm-12">
						<%-- <select class="form-control" id="roundMemo">
							<option value="memo1">메모1</option>
							<option value="memo2">메모2</option>
						</select> --%>
						<textarea class="form-control" id="roundMemo" rows="3"></textarea>
					</div>
		     	</div>
		     </div>
		     <div class="modal-footer">
		     	<button type="button" class="btn btn-style-1 btn-sm" id="rountInsertBtn">확인</button>
				<button type="button" class="btn btn-style-2 btn-sm" data-dismiss="modal">취소</button>
		     </div>
		   </div><!-- /.modal-content -->
	   </div>
	 </div>
</div>
<!-- #page 종료 -->
<script type="text/javascript">
	//다국어 사용
	/* var i18n = function(){
	 var message = {
	 "common006" : "<s:message code='mobile.message.common006'/>"
	 };
	
	 this.getMessage = function( code ){
	 return message[code];
	 };
	 };   
	 */
/* 	$(window).bind("pageshow", function (event){ 
		if(event.originalEvent.persisted){
			console.log("뒤로가기다!");
		}else{ 
			console.log("뒤로가기아니지롱");
		};  
	});
	  */
	  /* window.onpageshow = function (event) {
		    if (event.persisted) {
		    	// 뒤로가기로 페이지 로드 시
		        console.log(event.persited);
		    }
		    else {
		    	// 새로운 페이지 로드 시
		    }
		} */
	$(document).ready(function() {
		headerTitle.text("환자목록");
		var mplusClinic = new mplus_mobile_clinic();
		mplusClinic.init();
	}); 
</script>