浏览代码

건강정보기록 완료

huiwon.seo 4 年之前
父节点
当前提交
a86396fc9d

+ 26 - 18
src/main/java/com/lemon/lifecenter/controller/MobileHealthController.java

@@ -14,8 +14,8 @@ import org.springframework.web.servlet.ModelAndView;
 import com.lemon.lifecenter.common.LifeCenterController;
 import com.lemon.lifecenter.common.LifeCenterFunction;
 import com.lemon.lifecenter.common.LifeCenterSessionController;
-import com.lemon.lifecenter.dto.LoginDTO;
 import com.lemon.lifecenter.dto.PatientPHRHistoryDTO;
+import com.lemon.lifecenter.dto.PatientSymptomSimDTO;
 import com.lemon.lifecenter.service.PHRService;
 
 @Controller
@@ -38,7 +38,9 @@ public class MobileHealthController extends LifeCenterController {
     }
     
     @RequestMapping("/health/insert")
-    public String healthInsert( @ModelAttribute("dto") final PatientPHRHistoryDTO dto,
+    public String healthInsert( 
+            @ModelAttribute("pdto") final PatientPHRHistoryDTO pdto,
+            @ModelAttribute("sdto") final PatientSymptomSimDTO sdto,
             @RequestParam( value="phrTypeAnother", required=false, defaultValue="" ) String phrTypeAnother,
             @RequestParam( value="phrValueAnother", required=false, defaultValue="" ) String phrValueAnother,
             @RequestParam( value="phrValueAnother2", required=false, defaultValue="" ) String phrValueAnother2,
@@ -46,25 +48,31 @@ public class MobileHealthController extends LifeCenterController {
         String patientName = LifeCenterSessionController.getSession( request, "sesMName" );
         int patientIdx     = Integer.valueOf( LifeCenterSessionController.getSession( request, "sesMpIdx" ) );
         
-        System.out.println(" phrValue : " + dto.getPhrValue() );
-        
-        
-        dto.setPatientIdx( patientIdx );
-        dto.setRecordedByName( patientName+"(환자)" );
-        phrService.insertPHR( dto );
-        
-        if( !phrTypeAnother.trim().equals( "" ) ) {
-            dto.setPhrType( phrTypeAnother );
+        if( pdto.getPhrType().equals( "symptom" ) ) {
             
-            if( !phrValueAnother.equals( "" ) ) {
-                dto.setPhrValue( Float.valueOf( phrValueAnother ) );
-            }
+            sdto.setPatientIdx( patientIdx );
+            sdto.setRecordedByName( patientName + "(환자)" );
+            phrService.insertSymptom( sdto );
             
-            if( !phrValueAnother2.equals( "" ) ) {
-                dto.setPhrValue2( Float.valueOf( phrValueAnother2 ) );
-            }
+        } else {
+            
+            pdto.setPatientIdx( patientIdx );
+            pdto.setRecordedByName( patientName + "(환자)" );
+            phrService.insertPHR( pdto );
             
-            phrService.insertPHR( dto );
+            if( !phrTypeAnother.trim().equals( "" ) ) {
+                pdto.setPhrType( phrTypeAnother );
+                
+                if( !phrValueAnother.equals( "" ) ) {
+                    pdto.setPhrValue( Float.valueOf( phrValueAnother ) );
+                }
+                
+                if( !phrValueAnother2.equals( "" ) ) {
+                    pdto.setPhrValue2( Float.valueOf( phrValueAnother2 ) );
+                }
+                
+                phrService.insertPHR( pdto );
+            }
         }
         
         LifeCenterFunction.scriptMessage(response, "alert('기록되었습니다');location.href='/mobile/menu';" );

+ 16 - 16
src/main/java/com/lemon/lifecenter/dto/PatientSymptomSimDTO.java

@@ -3,22 +3,22 @@ package com.lemon.lifecenter.dto;
 public class PatientSymptomSimDTO {
 	
 	private int patientIdx;
-	private String coughCheck;
-	private String dyspneaCheck;	
-	private String coldFitCheck;
-	private String musclePainCheck;
-	private String headacheCheck;
-	private String soreThroatCheck;
-	private String smellPalateCheck;
-	private String fatigueCheck;
-	private String appetiteLossCheck;
-	private String sputumCheck;
-	private String ocinCheck;
-	private String vomitingCheck;
-	private String diarrheaCheck;
-	private String dizzinessCheck;
-	private String noseCheck;
-	private String etcCheck;
+	private String coughCheck="N";
+	private String dyspneaCheck="N";	
+	private String coldFitCheck="N";
+	private String musclePainCheck="N";
+	private String headacheCheck="N";
+	private String soreThroatCheck="N";
+	private String smellPalateCheck="N";
+	private String fatigueCheck="N";
+	private String appetiteLossCheck="N";
+	private String sputumCheck="N";
+	private String ocinCheck="N";
+	private String vomitingCheck="N";
+	private String diarrheaCheck="N";
+	private String dizzinessCheck="N";
+	private String noseCheck="N";
+	private String etcCheck="N";
 	private String etcContent;
 	private String recordedByName;
 	private String recordedById;

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

@@ -104,7 +104,7 @@
 	    </if>
 	    <if test='bloodSugar != null and bloodSugar != ""'>
 	    <![CDATA[
-   			, blood_suger = #{bloodSugar}, blood_suger_create_date = NOW()
+   			, blood_sugar = #{bloodSugar}, blood_sugar_create_date = NOW()
 	    ]]>
 	    </if>
 	</insert>

+ 2 - 2
src/main/webapp/WEB-INF/jsp/mobile/health/health4.jsp

@@ -39,7 +39,7 @@ $( function(){
             <div class="device_tab">
                 <ul>
                     <li>
-                        <a href="./1" class="one active">체온</a>
+                        <a href="./1" class="one">체온</a>
                     </li>
                     <li>
                         <a href="./2" class="two">맥박수/혈압</a>
@@ -48,7 +48,7 @@ $( function(){
                         <a href="./3" class="three">산소포화도</a>
                     </li>
                     <li>
-                        <a href="./4" class="four">혈당</a>
+                        <a href="./4" class="four active">혈당</a>
                     </li>
                     <li>
                         <a href="./5" class="five">임상증상</a>

+ 140 - 0
src/main/webapp/WEB-INF/jsp/mobile/health/health5.jsp

@@ -0,0 +1,140 @@
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
+<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
+<jsp:include page="${data._INCLUDE}/header.jsp"></jsp:include>
+<script type="text/javascript" src="/resources/js/mobile/health.js"></script>
+<script>
+$( function(){
+    $( "#healthForm" ).validate({
+        onkeyup: function( element, event ) {
+//             $( "div.error-msg" ).text( "" );
+        },
+        onfocusout: function (element) {
+//             $( "div.error-msg" ).text( "" );
+        },
+        submitHandler: function(form) {
+        	form.submit();
+        }
+    });
+})
+</script>
+</head>
+<body>
+    <div id="sub">
+        <div class="container">
+            <div class="header">
+                <div class="previous">
+                    <a href="/mobile/menu">이전</a>
+                </div>
+                <div class="title">건강정보기록</div>
+            </div>
+            <div class="device_tab">
+                <ul>
+                    <li>
+                        <a href="./1" class="one">체온</a>
+                    </li>
+                    <li>
+                        <a href="./2" class="two">맥박수/혈압</a>
+                    </li>
+                    <li>
+                        <a href="./3" class="three">산소포화도</a>
+                    </li>
+                    <li>
+                        <a href="./4" class="four">혈당</a>
+                    </li>
+                    <li>
+                        <a href="./5" class="five active">임상증상</a>
+                    </li>
+                </ul>
+            </div>
+            
+            <form id="healthForm" method="post" action="./insert">
+                <div class="check_list">
+                    <div class="part">
+                        <div class="title">
+                            해당 증상에 모두 체크해 주세요
+                        </div>
+                        <div class="list">
+                            <ul class="circle half">
+                                <li>
+                                    <input type="checkbox" id="coughCheck" name="coughCheck" value="Y">
+                                    <label for="coughCheck"><span></span>기침</label>
+                                </li>
+                                <li>
+                                    <input type="checkbox" id="dyspneaCheck" name="dyspneaCheck" value="Y">
+                                    <label for="dyspneaCheck"><span></span>호흡곤란</label>
+                                </li>
+                                <li>
+                                    <input type="checkbox" id="coldFitCheck" name="coldFitCheck" value="Y">
+                                    <label for="coldFitCheck"><span></span>오한</label>
+                                </li>
+                                <li>
+                                    <input type="checkbox" id="musclePainCheck" name="musclePainCheck" value="Y">
+                                    <label for="musclePainCheck"><span></span>근육통</label>
+                                </li>
+                                <li>
+                                    <input type="checkbox" id="headacheCheck" name="headacheCheck" value="Y">
+                                    <label for="headacheCheck"><span></span>두통</label>
+                                </li>
+                                <li>
+                                    <input type="checkbox" id="soreThroatCheck" name="soreThroatCheck" value="Y">
+                                    <label for="soreThroatCheck"><span></span>인후통</label>
+                                </li>
+                                <li>
+                                    <input type="checkbox" id="smellPalateCheck" name="smellPalateCheck" value="Y">
+                                    <label for="smellPalateCheck"><span></span>후각/미각손실</label>
+                                </li>
+                                <li>
+                                    <input type="checkbox" id="fatigueCheck" name="fatigueCheck" value="Y">
+                                    <label for="fatigueCheck"><span></span>피로</label>
+                                </li>
+                                <li>
+                                    <input type="checkbox" id="appetiteLossCheck" name="appetiteLossCheck" value="Y">
+                                    <label for="appetiteLossCheck"><span></span>식욕감소</label>
+                                </li>
+                                <li>
+                                    <input type="checkbox" id="sputumCheck" name="sputumCheck" value="Y">
+                                    <label for="sputumCheck"><span></span>가래</label>
+                                </li>
+                                <li>
+                                    <input type="checkbox" id="vomitingCheck" name="vomitingCheck" value="Y">
+                                    <label for="vomitingCheck"><span></span>구토</label>
+                                </li>
+                                <li>
+                                    <input type="checkbox" id="diarrheaCheck" name="diarrheaCheck" value="Y">
+                                    <label for="diarrheaCheck"><span></span>설사</label>
+                                </li>
+                                <li>
+                                    <input type="checkbox" id="dizzinessCheck" name="dizzinessCheck" value="Y">
+                                    <label for="dizzinessCheck"><span></span>어지러움</label>
+                                </li>
+                                <li>
+                                    <input type="checkbox" id="noseCheck" name="noseCheck" value="Y">
+                                    <label for="noseCheck"><span></span>콧물/코막힘</label>
+                                </li>
+                                <li class="full">
+                                    <input type="checkbox" id="etcCheck" name="etcCheck" value="Y">
+                                    <label for="etcCheck"><span></span>기타</label>
+                                    <div class="comment">
+                                        <input type="text" name="etcContent" placeholder="증상을 입력하세요.">
+                                    </div>
+                                </li>
+                            </ul>
+                        </div>
+                    </div>
+                </div>
+                
+                <div class="btn_group">
+                    <ul>
+                        <li>
+                            <input type="hidden" name="phrType" value="symptom">
+                            
+                            <button type="submit" class="confirm"><span class="check">기록하기</span></button>
+                        </li>
+                    </ul>
+                </div>
+            </form>
+        </div>
+    </div>
+</body>
+</html>

+ 3 - 3
src/main/webapp/WEB-INF/jsp/mobile/include/header.jsp

@@ -13,10 +13,10 @@
 <!-- <link rel="stylesheet" type="text/css" href="/resources/css/mobile/bootstrap-datepicker.css" /> -->
 <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
 <link rel="stylesheet" type="text/css" href="/resources/css/mobile/style.css" />
-<link rel="stylesheet" type="text/css" href="/resources/css/mobile/bootstrap-datepicker3.standalone.css" />
+<!-- <link rel="stylesheet" type="text/css" href="/resources/css/mobile/bootstrap-datepicker3.standalone.css" /> -->
 
 <script type="text/javascript" src="/resources/js/mobile/jquery-3.3.1.min.js"></script>
 <script type="text/javascript" src="/resources/js/mobile/app.js"></script>
-<script type="text/javascript" src="/resources/js/mobile/bootstrap-datepicker.min.js"></script>
-<script type="text/javascript" src="/resources/js/mobile/bootstrap-datepicker.ko.min.js"></script>
+<!-- <script type="text/javascript" src="/resources/js/mobile/bootstrap-datepicker.min.js"></script> -->
+<!-- <script type="text/javascript" src="/resources/js/mobile/bootstrap-datepicker.ko.min.js"></script> -->
 <script type="text/javascript" src="/resources/js/mobile/common.js"></script>