Przeglądaj źródła

환자정보 완료

junekeunsong 4 lat temu
rodzic
commit
4af9aaeaec

+ 13 - 0
src/main/java/com/lemon/lifecenter/common/LifeCenterFunction.java

@@ -371,4 +371,17 @@ public class LifeCenterFunction {
 
         return result.toString();
     }
+
+    public static String phone(String src) {
+        if (src == null) {
+          return "";
+        }
+        if (src.length() == 8) {
+          return src.replaceFirst("^([0-9]{4})([0-9]{4})$", "$1-$2");
+        } else if (src.length() == 12) {
+          return src.replaceFirst("(^[0-9]{4})([0-9]{4})([0-9]{4})$", "$1-$2-$3");
+        }
+        return src.replaceFirst("(^02|[0-9]{3})([0-9]{3,4})([0-9]{4})$", "$1-$2-$3");
+    }
+    
 }

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

@@ -71,7 +71,7 @@ public class MobileNonFaceController extends LifeCenterController {
         mv.addObject("token", token);
         mv.addObject("room_id", roomId);
         mv.addObject("member_name", patientName);
-        mv.addObject("classify", "p");
+        mv.addObject("classify", "p"); // p이면 환자 d이면 의사
         mv.addObject("hashData", hashData);
         
         return mv;

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

@@ -1,18 +1,22 @@
 package com.lemon.lifecenter.controller;
 
 import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import org.json.JSONObject;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.ModelAttribute;
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
 import org.springframework.web.servlet.ModelAndView;
 
 import com.lemon.lifecenter.common.LifeCenterConfigVO;
@@ -175,6 +179,17 @@ public class PatientController extends LifeCenterController {
         jumin = jumin.substring(0, 4) + "년 " + jumin.substring(4, 6) + "월 " + jumin.substring(6, 8) + "일";
         dto.setJumin(jumin);
         
+        dto.setPatientPhone(LifeCenterFunction.phone(dto.getPatientPhone()));
+        dto.setGuardianPhone(LifeCenterFunction.phone(dto.getGuardianPhone()));
+        
+        String bloodPress = dto.getBloodPressureLevel();
+        
+        if (!bloodPress.equals("")) {
+            String[] bloodPressureLevel = dto.getBloodPressureLevel().split("[|]");
+            logger.error("bloodPress -- > " + bloodPressureLevel[0]);
+            logger.error("bloodPress -- > " + bloodPressureLevel[1]);
+        }
+        
         mv.addObject("patientIdx", patientIdx);
         mv.addObject("info", dto);
         return mv;
@@ -193,4 +208,59 @@ public class PatientController extends LifeCenterController {
 
         return mv;
     }
+    
+    @RequestMapping( value="/nonFaceStart", method = RequestMethod.POST )
+    @ResponseBody
+    public String nonFaceStart(
+            @RequestParam( value="pId", required = true ) String pId,
+            @RequestParam( value="roomId", required = true ) String roomId,
+            @RequestParam( value="pName", required = true ) String pName,
+            HttpServletRequest request, HttpServletResponse response) throws Exception {
+        
+        String salt = LifeCenterFunction.getSalt();
+        String timeStamp = LifeCenterFunction.getTimestamp();
+        String signature = LifeCenterFunction.getSignature(config.nonFaceApiSecret, salt, timeStamp);
+        
+        String userId = LifeCenterSessionController.getSession(request, "sesId");
+        String userNm = LifeCenterSessionController.getSession(request, "sesName");
+        
+        HashMap<String, String> data = new HashMap<String, String>();
+        data.put("api_key", config.nonFaceApiKey);
+        data.put("salt", salt);
+        data.put("timestamp", timeStamp);
+        data.put("signature", signature);
+        data.put("client_id", config.nonFaceClientId);
+        data.put("member_id", userId);
+        
+        String result = LifeCenterFunction.httpUrlConnection(config.nonFaceApiTokenUrl, data);
+        
+        JSONObject object = new JSONObject(result);
+        String message = "";
+        String token = "";
+        for(String key : object.keySet()) {
+            logger.error("key -- > " + key);
+            if (key.equals("errorCode")) {
+                message = object.getString("message");
+            } else if (key.equals("token")){
+                token = object.getString("token");
+            }
+        }
+        
+        if (!message.equals("")) {
+            //error
+        }
+        String hashData = LifeCenterFunction.getSignature(config.nonFaceApiSecret, config.nonFaceApiKey, roomId + userId); //"1011503101"
+        
+        object.put("api_key", config.nonFaceApiKey);
+        object.put("member_id", userId);
+        object.put("token", token);
+        object.put("room_id", roomId);
+        object.put("member_name", userNm);
+        object.put("classify", "d"); // p이면 환자 d이면 의사
+        object.put("hashData", hashData);
+        logger.error("pid -- > " + hashData);
+        
+        return object.toString();
+    }
+    
 }

+ 98 - 17
src/main/webapp/WEB-INF/jsp/patient/info.jsp

@@ -4,9 +4,36 @@
     pageEncoding="UTF-8"%>
 <jsp:include page="${data._INCLUDE}/header.jsp"></jsp:include>
 
+<script type="text/javascript">
+function nonFaceStart() {
+    getAjax("/patient/nonFaceStart", $("#hiddenForm").serialize(), function ( result ) {
+        
+        $("#nonface").append('<input type="hidden" name="member_name" value="'+result.member_name+'" />');
+        $("#nonface").append('<input type="hidden" name="member_id" value="'+result.member_id+'" />');
+        $("#nonface").append('<input type="hidden" name="room_id" value="'+result.room_id+'" />');
+        $("#nonface").append('<input type="hidden" name="hashData" value="'+result.hashData+'">');
+        $("#nonface").append('<input type="hidden" name="token" value="'+result.token+'">');
+        $("#nonface").append('<input type="hidden" name="api_key" value="'+result.api_key+'">');
+
+        $("#nonface").append('<input type="hidden" name="classify" value="d">');
+
+        var gsWin = window.open('about:blank','nonface');
+        var frm =document.nonface;
+        frm.target ="nonface";
+        frm.method ="post";
+        frm.submit();
+
+    }, function(){
+    }, function(){
+        
+    });
+}
+</script>
+
 </head>
 <body>
-
+    <form id="nonface" name="nonface" action="https://lemon.medihere.com/app/vc">
+    </form>
     <div class="wrapper">
         <jsp:include page="${data._INCLUDE}/sidebar.jsp"></jsp:include>
 
@@ -14,6 +41,11 @@
             <jsp:include page="${data._INCLUDE}/top.jsp"></jsp:include>
 
             <main class="content">
+                <form id="hiddenForm">
+                    <input type="hidden" id="pId" name="pId" value="<c:out value="${info.id}" />">
+                    <input type="hidden" id="pName" name="pName" value="<c:out value="${info.patientName}" />">
+                    <input type="hidden" id="roomId" name="roomId" value="<c:out value="${info.roomNumber}" />">
+                </form>
                 <div class="container-fluid p-0">
                     <!-- 환자관리 : 신규환자 등록 START -->
                     <div class="row">
@@ -58,7 +90,7 @@
                                             </td>
                                             <th>이름</th>
                                             <td>
-                                                <c:out value="${info.patientName}" />
+                                                <c:out value="${info.patientName}" /><button class="btn btn-primary ml-2" onclick="nonFaceStart();">진료시작</button>
                                             </td>
                                         </tr>
                                         <tr>
@@ -83,50 +115,98 @@
                                             </td>
                                             <th>보호자 연락처</th>
                                             <td>
-                                                010-1234-1234
+                                                <c:out value="${info.guardianPhone}" />
                                             </td>
                                         </tr>
                                         <tr>
                                             <th>증상시작일</th>
                                             <td>
-                                                2020-10-08
+                                                <c:out value="${info.symptomStartDate}" />
                                             </td>
                                             <th>확진일</th>
                                             <td>
-                                                2020-10-09
+                                                <c:out value="${info.confirmationDate}" />
                                             </td>
                                         </tr>
                                         <tr>
                                             <th>격리해제 예정일</th>
                                             <td colspan="3">
-                                                2020-10-25
+                                                <c:out value="${info.disisolationDate}" />
                                             </td>
                                         </tr>
                                         <tr>
                                             <th>최근 약복용<br />(최근 24시간 이내)</th>
                                             <td>
-                                                미복용
+                                                <c:choose>
+                                                    <c:when test="${info.drugYn eq 'Y'}">
+                                                        복용 (<c:out value="${info.drugContent}" />)
+                                                    </c:when>
+                                                    <c:otherwise>
+                                                        미복용
+                                                    </c:otherwise>
+                                                </c:choose>
                                             </td>
                                             <th>임신</th>
                                             <td>
-                                                무
+                                                <c:choose>
+                                                    <c:when test="${info.pregnancyStatus eq 'N'}">
+                                                        무
+                                                    </c:when>
+                                                    <c:otherwise>
+                                                        유 (<c:out value="${info.pregnancyWeek}주차" />)
+                                                    </c:otherwise>
+                                                </c:choose>
                                             </td>
                                         </tr>
                                         <tr>
                                             <th rowspan="2">기저질환 여부</th>
                                             <td colspan="3">
-                                                예
+                                                <c:choose>
+                                                    <c:when test="${info.basalDiseaseYn eq 'Y'}">
+                                                        유
+                                                    </c:when>
+                                                    <c:otherwise>
+                                                        무
+                                                    </c:otherwise>
+                                                </c:choose>
                                             </td>
                                         </tr>
                                         <tr>
                                             <td colspan="3">
-                                                고혈압, 수술(맹장수술), 신장질환
+                                                <c:if test="${info.highBloodPressureCheck eq 'Y'}">, 고혈압</c:if>
+                                                <c:if test="${info.lowBloodPressureCheck eq 'Y'}">, 저혈압</c:if>
+                                                <c:if test="${info.organTransplantCheck eq 'Y'}">, 장기이식(신장, 간 등)</c:if>
+                                                <c:if test="${info.diabetesCheck eq 'Y'}">, 당뇨</c:if>
+                                                <c:if test="${info.respiratoryDiseaseCheck eq 'Y'}">, 호흡기질환</c:if>
+                                                <c:if test="${info.immunologicalDiseaseCheck eq 'Y'}">, 면역질환(류마티스 등)</c:if>
+                                                <c:if test="${info.heartDisease eq 'Y'}">, 심장질환</c:if>
+                                                <c:if test="${info.liverDisease eq 'Y'}">, 간질환</c:if>
+                                                <c:if test="${info.operation eq 'Y'}">, 수술(<c:out value="${info.operationContent}" />)</c:if>
+                                                <c:if test="${info.allergyCheck eq 'Y'}">, 알레르기</c:if>
+                                                <c:if test="${info.kidneyDisease eq 'Y'}">, 신장질환</c:if>
+                                                <c:if test="${info.cancerCheck eq 'Y'}">, 암(<c:out value="${info.cancerName}" />)</c:if>
+                                                <c:if test="${info.ectCheckDisease eq 'Y'}">, 기타(<c:out value="${info.etcContentDisease}" />)</c:if>
                                             </td>
                                         </tr>
                                         <tr>
                                             <th>현재 증상<br />(입소 당시)</th>
                                             <td colspan="3">
-                                                기침, 가래
+                                                <c:if test="${info.feverCheck eq 'Y'}">, 열감(열나는느낌)</c:if>
+                                                <c:if test="${info.coughCheck eq 'Y'}">, 기침</c:if>
+                                                <c:if test="${info.colic eq 'Y'}">, 복통(배아픔)</c:if>
+                                                <c:if test="${info.coldFitCheck eq 'Y'}">, 오한(추운 느낌)</c:if>
+                                                <c:if test="${info.sputumCheck eq 'Y'}">, 가래</c:if>
+                                                <c:if test="${info.ocinCheck eq 'Y'}">, 오심(구역질)</c:if>
+                                                <c:if test="${info.chestPain eq 'Y'}">, 흉통</c:if>
+                                                <c:if test="${info.noseCheck eq 'Y'}">, 콧물 또는 코 막힘</c:if>
+                                                <c:if test="${info.vomitingCheck eq 'Y'}">, 구토</c:if>
+                                                <c:if test="${info.musclePainCheck eq 'Y'}">, 근육통(몸살)</c:if>
+                                                <c:if test="${info.soreThroatCheck eq 'Y'}">, 인후통(목 아픔)</c:if>
+                                                <c:if test="${info.diarrheaCheck eq 'Y'}">, 설사</c:if>
+                                                <c:if test="${info.headacheCheck eq 'Y'}">, 두통(머리아픔)</c:if>
+                                                <c:if test="${info.dyspneaCheck eq 'Y'}">, 호흡곤란(숨가쁨)</c:if>
+                                                <c:if test="${info.fatigueCheck eq 'Y'}">, 권태감(피곤함)</c:if>
+                                                <c:if test="${info.ectCheckSymptom eq 'Y'}">, 기타(<c:out value="${info.etcContentSymptom}" />)</c:if>
                                             </td>
                                         </tr>
                                         <tr>
@@ -134,13 +214,13 @@
                                                 체온
                                             </th>
                                             <td>
-                                                우측 36.7 ℃ /  좌측 36.5 ℃
+                                                <c:out value="우측 ${info.feverRight}℃ /  좌측  ${info.feverRight}℃" />
                                             </td>
                                             <th>
                                                 맥박수
                                             </th>
                                             <td>
-                                                72 회/분
+                                                <c:out value="${info.pulseRate} 회/분" />
                                             </td>
                                         </tr>
                                         <tr>
@@ -148,13 +228,13 @@
                                                 호흡수
                                             </th>
                                             <td>
-                                                54 회/분
+                                                <c:out value="${info.respirationRate} 회/분" />
                                             </td>
                                             <th>
                                                 혈압
                                             </th>
                                             <td>
-                                                수축기 94 mmHg  /  이완기 110 mmHg
+                                            <c:out value="수축기 ${info.bloodPressureLevelCon} mmHg  /  이완기 ${info.bloodPressureLevelRel} mmHg" />
                                             </td>
                                         </tr>
                                         <tr>
@@ -162,14 +242,15 @@
                                                 산소포화도
                                             </th>
                                             <td colspan="3">
-                                                90 %
+                                                <c:out value="${info.oxygenSaturation} %" />
                                             </td>
                                         </tr>
                                     </table>
                                     <div class="row mt-3">
                                         <div class="col-12">
                                             <div class="text-right">
-                                                <button class="btn btn-primary w100">확인</button>
+                                                <button class="btn btn-primary w100">수정</button>
+                                                <button class="btn btn-primary w100" onclick="location.href='./list'">확인</button>
                                             </div>
                                         </div>
                                     </div>