huiwon.seo 4 gadi atpakaļ
vecāks
revīzija
d42aaa2163

+ 14 - 0
src/main/java/com/lemon/lifecenter/controller/PatientController.java

@@ -63,8 +63,13 @@ public class PatientController extends LifeCenterController {
         System.err.println( "page : " + page );
         
         String sesCenterCode  = LifeCenterSessionController.getSession( request, "sesCenterCode" );
+        String sesGroupIdx    = LifeCenterSessionController.getSession( request, "sesGroupIdx" );
+        
+        // 권한이 SYSTEM일경우
+        
         PatientDTO dto = new PatientDTO();
         dto.setCenterCode(Integer.parseInt(sesCenterCode));
+        dto.setGroupIdx( Integer.valueOf( sesGroupIdx ) );
         dto.setPatientName(patientName);
         dto.setState(inputState);
         dto.setStartDate(startDate);
@@ -100,6 +105,7 @@ public class PatientController extends LifeCenterController {
         mv.addObject( "endDate", endDate );
         mv.addObject( "page", page );
         mv.addObject( "pageSize", dto.getLimitMax() );
+        mv.addObject( "sesGroupIdx" , sesGroupIdx );
         
         return mv;
     }
@@ -151,6 +157,10 @@ public class PatientController extends LifeCenterController {
         dto.setState( "H" ); // H : 입소
         dto.setCreateBy( sesId );
         
+        if( dto.getDisisolationDate().equals( "" ) ) {
+            dto.setDisisolationDate( null );
+        }
+        
         patientService.insertPatientCare( dto );  // 환지 기본정보 insert
         
         int patientIdx = dto.getPatientIdx();
@@ -275,6 +285,10 @@ public class PatientController extends LifeCenterController {
         dto.setCenterCode( sesCenterCode );
         dto.setUpdateBy( sesId );
         
+        if( dto.getDisisolationDate().equals( "" ) ) {
+            dto.setDisisolationDate( null );
+        }
+        
         patientService.updatePatientCare( dto );  // 환지 기본정보
         
         //patientDisease Insert

+ 8 - 1
src/main/java/com/lemon/lifecenter/dto/PatientDTO.java

@@ -6,6 +6,7 @@ import org.springframework.stereotype.Repository;
 public class PatientDTO {
     // patient_care
     private int patientIdx;
+    private int groupIdx;
     private String patientName;
     private String gender = "";
     private String wardNumber="";
@@ -19,7 +20,7 @@ public class PatientDTO {
     private String guardianPhone;
     private String symptomStartDate;
     private String confirmationDate;
-    private String disisolationDate;
+    private String disisolationDate=null;
     private String basalDiseaseYn = "";
     private String drugYn="";
     private String drugContent="";
@@ -102,6 +103,12 @@ public class PatientDTO {
     private int limitMax;
     
     
+    public int getGroupIdx() {
+        return groupIdx;
+    }
+    public void setGroupIdx(int groupIdx) {
+        this.groupIdx = groupIdx;
+    }
     public String getSymptomContent() {
         return symptomContent;
     }

+ 15 - 3
src/main/resources/mybatis/mapper/patient/patient.xml

@@ -7,8 +7,12 @@
             SELECT count(*) AS total
               FROM PATIENT_CARE
              WHERE 1 = 1
-               AND CENTER_CODE = #{centerCode}
         ]]>
+        <if test='groupIdx != "1"'>
+            <![CDATA[
+               AND CENTER_CODE = #{centerCode}
+            ]]>
+        </if>
         <if test='state != "ALL"'>
             <![CDATA[
                AND STATE = #{state}
@@ -45,11 +49,19 @@
                         WHEN STATE = 'T' THEN '지정병원 이송'
                         WHEN STATE = 'E' THEN '기타'
                         ELSE ''
-                   END                                                                AS state
+                   END                                                                AS state,
+                   center_code                                                        AS centerCode,
+                   ( SELECT center_name
+                       FROM center_info
+                      WHERE center_code = PATIENT_CARE.center_code )                  AS centerName
               FROM PATIENT_CARE
              WHERE 1 = 1
-               AND CENTER_CODE = #{centerCode}
         ]]>
+    <if test='groupIdx != "1"'>
+        <![CDATA[
+           AND CENTER_CODE = #{centerCode}
+        ]]>
+    </if>
     <if test='state != "ALL"'>
         <![CDATA[
             AND STATE = #{state}

+ 20 - 12
src/main/webapp/WEB-INF/jsp/patient/list.jsp

@@ -122,30 +122,36 @@ var endDate   = "<c:out value='${endDate}'/>";
                                             <fmt:formatNumber value="${total}" pattern="#,###" />
                                         </div>
                                         <div class="col-6 text-right">
-                                            <button class="btn btn-primary" onclick="location.href='./new';">신규환자등록</button>
+                                            <c:if test="${sesGroupIdx ne '1'}">
+                                                <button class="btn btn-primary" onclick="location.href='./new';">신규환자등록</button>
+                                            </c:if>
                                         </div>
                                     </div>
                                     <div class="table-responsive">
                                         <table class="table table-striped text-center">
                                             <colgroup>
-                                                <col style=" width: 12.5%; ">
-                                                <col style=" width: 12.5%; ">
-                                                <col style=" width: 12.5%; ">
-                                                <col style=" width: 12.5%; ">
-                                                <col style=" width: 12.5%; ">
-<%--                                                 <col style=" width: 11.1%; "> --%>
-                                                <col style=" width: 12.5%; ">
-                                                <col style=" width: 12.5%; ">
-                                                <col style=" width: 12.5%; ">
+                                                <col style=" width: 11.1%; ">
+                                                <c:if test="${sesGroupIdx eq '1'}">
+                                                    <col style=" width: 11.1%; ">
+                                                </c:if>
+                                                <col style=" width: 11.1%; ">
+                                                <col style=" width: 11.1%; ">
+                                                <col style=" width: 11.1%; ">
+                                                <col style=" width: 11.1%; ">
+                                                <col style=" width: 11.1%; ">
+                                                <col style=" width: 11.1%; ">
+                                                <col style=" width: 11.1%; ">
                                             </colgroup>
                                             <thead>
                                                 <tr>
                                                     <th>번호</th>
+                                                    <c:if test="${sesGroupIdx eq '1'}">
+                                                        <th>생활치료센터명</th>
+                                                    </c:if>
                                                     <th>환자명</th>
                                                     <th>성별</th>
                                                     <th>나이</th>
                                                     <th>호실</th>
-<!--                                                     <th>최종진료일시</th> -->
                                                     <th>입소일자</th>
                                                     <th>격리해제 예정일</th>
                                                     <th>상태</th>
@@ -160,13 +166,15 @@ var endDate   = "<c:out value='${endDate}'/>";
                                                             
                                                             <tr>
                                                                 <td><fmt:formatNumber value="${pageNum}" pattern="#,###" /></td>
+                                                                <c:if test="${sesGroupIdx eq '1'}">
+                                                                    <td><c:out value="${l.centerName}" /></td>
+                                                                </c:if>
                                                                 <td>
                                                                     <a href="${viewLink}"><c:out value="${l.patientName}" /></a>
                                                                 </td>
                                                                 <td><c:out value="${l.gender}" /></td>
                                                                 <td><c:out value="${l.age}" /></td>
                                                                 <td><c:out value="${l.wardNumber}동 ${l.roomNumber}호" /></td>
-<%--                                                                 <td><c:out value="${l.finamClinicDate}" /></td> --%>
                                                                 <td><c:out value="${l.hospitalizationDate}" /></td>
                                                                 <td>
                                                                     <c:if test="${l.disisolationDate eq null or l.disisolationDate eq ''}">