Przeglądaj źródła

수정사항 반영, 정신건강 미입력 필터추가

huiwonseo 4 lat temu
rodzic
commit
330b5076ba

+ 1 - 1
src/main/java/com/lemon/lifecenter/common/LifeCenterInterCeptor.java

@@ -71,7 +71,7 @@ public class LifeCenterInterCeptor extends HandlerInterceptorAdapter {
 //                    System.err.println( "sesMAcceptCheck : " + sesMAcceptCheck );
                     
                     if( sesMAcceptCheck != null && sesMAcceptCheck.equals( "Y" ) ) {
-                        if( !url.equals( "/mobile/accept/list" ) ) {
+                        if( !url.equals( "/mobile/accept/list" ) && !url.equals( "/mobile/insertDeviceInfo" ) ) {
                             logger.info( "약관 동의 페이지로 이동" );
                             
                             if( !url.equals( "/mobile/accept/insert" ) && !url.equals( "/mobile/login/logout" ) ) {

+ 8 - 3
src/main/java/com/lemon/lifecenter/controller/ClinicController.java

@@ -93,7 +93,8 @@ public class ClinicController extends LifeCenterController {
 	    pulseRateBlank(0x10), 
 	    oxygenSaturationBlank(0x20), 
 	    bloodSugarBlank(0x40), 
-	    symptomBlank(0x80);
+	    symptomBlank(0x80),
+	    mentalBlank(0x100);
 	
 	    private final int value;
 	
@@ -107,13 +108,13 @@ public class ClinicController extends LifeCenterController {
 	}
 
 	private String[] parseFilter(String filter) {
-
     ArrayList<String> arrayList = new ArrayList<String>();
     try {
       int filterValue = Integer.parseInt(filter);
       for (FilterType f: FilterType.values()) {
         if ((filterValue & f.getValue()) == f.getValue()) {
           arrayList.add(f.name());
+          System.out.println( f.name() );
         }
       }
     }
@@ -141,6 +142,10 @@ public class ClinicController extends LifeCenterController {
 		dto.setSearchText(searchText);
 		if (!filter.equals("")) {
 	        String[] filterList = parseFilter(filter);
+          System.out.println( "#######################");
+          System.out.println( filterList );
+          System.out.println("#######################");
+          
 	        if (filterList.length > 0) {
 	        	dto.setFilterList(filterList);
 	        }
@@ -1344,7 +1349,7 @@ public class ClinicController extends LifeCenterController {
         for (String key : keySet) {
           if (key.equals("recordedDate")) {
             System.out.println( "request.getParameter(key) : " + request.getParameter(key) );
-            recordedDate = request.getParameter(key) == "" ? LifeCenterFunction.getNow("yyyy-MM-dd HH:mm").toString(): request
+            recordedDate = request.getParameter(key).equals("") ? LifeCenterFunction.getNow("yyyy-MM-dd HH:mm").toString(): request
                 .getParameter(key);
             continue;
           }

+ 1 - 0
src/main/java/com/lemon/lifecenter/controller/DeviceController.java

@@ -91,6 +91,7 @@ public class DeviceController {
         } else {
             rCnt = deviceService.updatedeviceInfo(dto);
         }
+
         
         if (rCnt == 0) {
             code = "02";

+ 4 - 4
src/main/java/com/lemon/lifecenter/dto/PatientPHRLatestDTO.java

@@ -501,13 +501,13 @@ public class PatientPHRLatestDTO {
     long diffSec = (todayCalendar.getTimeInMillis() - targetCalendar.getTimeInMillis()) / 1000;
 
     long diffDays = diffSec / (24 * 60 * 60);
-    System.out.println( "diffSec : " + diffSec );
-    System.out.println( "diffDays : " + diffDays );
+    // System.out.println( "diffSec : " + diffSec );
+    // System.out.println( "diffDays : " + diffDays );
     
     if( diffDays <= 5 ) {
       needCheck = false;
     }
-    System.out.println( "needCheck : " + needCheck );
+    // System.out.println( "needCheck : " + needCheck );
     return needCheck;
   }
 
@@ -516,7 +516,7 @@ public class PatientPHRLatestDTO {
   }
 
   public boolean getIsMentalWarning() {
-    System.out.println( "this.mentalCreateDate : " + this.mentalCreateDate + " | " + this.patientName );
+    // System.out.println( "this.mentalCreateDate : " + this.mentalCreateDate + " | " + this.patientName );
     if (this.mentalCreateDate == null)
       return false;
     

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

@@ -196,6 +196,7 @@
 	<![CDATA[
 	    SELECT count(*) AS total
 		FROM patient_care c LEFT JOIN patient_phr_latest p ON p.patient_idx = c.patient_idx
+    LEFT JOIN ( SELECT * FROM mental_health_total WHERE patient_idx = c.patient_idx ORDER BY idx DESC limit 1 ) m ON m.patient_idx = c.patient_idx
 		WHERE c.center_code = #{centerCode} AND c.state = 'H'
 	]]>
 		<if test="filterList != null and filterList.length > 0"> 
@@ -273,7 +274,13 @@
 	                <![CDATA[
 	                	((p.symptom_create_date IS NULL) OR (DATEDIFF(p.symptom_create_date, CURDATE()) != 0 OR HOUR(p.symptom_create_date) < 12))
 	                ]]>
-	                </when>              
+	                </when>             
+
+                  <when test="filter == 'mentalBlank'" >
+	                <![CDATA[
+	                	( (m.recorded_date IS NULL) OR (DATEDIFF(NOW(), m.recorded_date) >= 6) )
+	                ]]>
+	                </when>   
 	        	</choose>     
 	  		</foreach>
   		<![CDATA[
@@ -320,7 +327,7 @@
    				m.depressed_total 	 	 		  AS depressedTotal,
    				m.depressed_nine        	  AS depressedNine,
    				m.vas_total                 AS vasTotal,
-   				m.create_date               AS mentalCreateDate,
+   				m.recorded_date               AS mentalCreateDate,
           m.agree_yn                  AS agreeYn
 
 		FROM patient_care c LEFT JOIN patient_phr_latest p ON p.patient_idx = c.patient_idx
@@ -402,7 +409,13 @@
 	                <![CDATA[
 	                	((p.symptom_create_date IS NULL) OR (DATEDIFF(p.symptom_create_date, CURDATE()) != 0 OR HOUR(p.symptom_create_date) < 12))
 	                ]]>
-	                </when>              
+	                </when>     
+
+                  <when test="filter == 'mentalBlank'" >
+	                <![CDATA[
+	                	( (m.recorded_date IS NULL) OR (DATEDIFF(NOW(), m.recorded_date) >= 6) )
+	                ]]>
+	                </when>           
 	        	</choose>     
 	  		</foreach>
   		<![CDATA[

+ 12 - 4
src/main/webapp/WEB-INF/jsp/clinic/state.jsp

@@ -123,7 +123,9 @@ function searchPatients() {
   var filterValue = 0;
   $('input:checkbox[name="filter"]').each(function() {
     if(this.checked) {
+      console.log( filterValue );
       filterValue = filterValue | this.value
+      console.log( filterValue );
     }
   });
 
@@ -140,7 +142,6 @@ function searchPatients() {
     url += (index === 0 ? "?" : "&");
     url += param;
   })
-
   location.href = url;
 }
 
@@ -163,9 +164,12 @@ function retrieveStateData(page, needInitPagination) {
 						if (result.items.length > 0) {
 							html = "";
 							result.items.forEach(function(d) {
-                console.log( d.patientName, d );
+                // console.log( d.patientName, JSON.stringify(d) );
+                d.needMentalCheck = d.needMentalCheck == null ? true : d.needMentalCheck;
+                d.isMentalWarning = d.needMentalCheck ? false : d.isMentalWarning;
+
 								var danger = (d.isTemperatureWarning || d.isBloodPressureWarning || d.isPulseRateWarning || d.isOxygenSaturationeWarning || d.isBloodSugarWarning || d.isMentalWarning) ? "danger" : "";
-                
+
                 var temperatureStep = d.isTemperatureWarning ? "step_two" : "step_one";
                 var bloodPressureStep = d.isBloodPressureWarning ? "step_two" : "step_one";
                 var pulseRateStep = d.isPulseRateWarning ? "step_two" : "step_one";
@@ -174,9 +178,12 @@ function retrieveStateData(page, needInitPagination) {
                 var mentalStep = d.isMentalWarning ?  "step_two" : "step_one";
                 
                 var agreeYn = d.agreeYn == 'Y' ? "(동의)" : "(비동의)";
-                d.needMentalCheck = d.needMentalCheck == null ? true : false;
+                
                 var mentalWarning = d.needMentalCheck ?  "-- " : ( d.isMentalWarning ?  "상담" + agreeYn : "정상" );
                 var mentalWarning1 = d.needMentalCheck ?  "timeover" : "";
+                
+                
+
 
                 var temperatureCheck = d.needTemperatureCheck ? "timeover" : "";
                 var bloodPressureCheck = d.needBloodPressCheck ? "timeover" : "";
@@ -592,6 +599,7 @@ $(document).ready(function() {
                           <label class="filterItem"><input type="checkbox" id= "filter32" name="filter" value="32" /><span>산소포화도 미입력</span></label>
                           <label class="filterItem"><input type="checkbox" id= "filter64" name="filter" value="64" /><span>혈당 미입력</span></label>
                           <label class="filterItem"><input type="checkbox" id= "filter128" name="filter" value="128" /><span>임상증상 미입력</span></label>
+                          <label class="filterItem"><input type="checkbox" id= "filter256" name="filter" value="256" /><span>정신건강 미입력</span></label>
                         </span>
                         <span class="filterApply"
                           ><button id="filterApply" class="btn btn-primary" onclick="searchPatients()"><i class="mdi mdi-filter-outline"></i> 적용</button></span