Преглед изворни кода

Merge branch 'databank' of http://wcollector.idatabank.com:5230/dbs289/LifeCenter.git into databank

huiwon.seo пре 4 година
родитељ
комит
146b7335cb

+ 416 - 2
src/main/java/com/lemon/lifecenter/controller/RestApiController.java

@@ -1,10 +1,19 @@
 package com.lemon.lifecenter.controller;
 
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
 import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Date;
 import java.util.HashMap;
+import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.TreeMap;
 
+import org.json.JSONArray;
+import org.json.JSONObject;
+import org.json.simple.JSONValue;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -15,6 +24,10 @@ import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.ResponseBody;
 import org.springframework.web.bind.annotation.RestController;
 
+import com.lemon.lifecenter.common.LifeCenterConfigVO;
+import com.lemon.lifecenter.common.LifeCenterFunction;
+import com.lemon.lifecenter.dto.ApiPhrResponseDTO;
+import com.lemon.lifecenter.dto.ApiSymptomDTO;
 import com.lemon.lifecenter.dto.AppVersionDTO;
 import com.lemon.lifecenter.dto.DeviceInfoDTO;
 import com.lemon.lifecenter.dto.HlRequestDTO;
@@ -30,8 +43,409 @@ public class RestApiController {
     @Autowired
     private RestApiService service;
     
-    @RequestMapping(value="/patientList" , method = RequestMethod.POST)
-    public void selectHLPatientList(@RequestBody HlRequestDTO dto) {
+    @RequestMapping(value="/tokenTest", method = RequestMethod.POST)
+    public String tokenTest(@RequestBody HlRequestDTO dto) {
+        String apiKey = service.selectApiKey(dto);
+        
+        String token = "";
+        String id = dto.getManagerId();
+        String time = LifeCenterFunction.getNow();
+        int centerCode = dto.getCenterCode();
+        String careAgencyCode = dto.getCareAgencyCode();
+        
+        try {
+            token = LifeCenterFunction.aesEncrypt(apiKey, LifeCenterConfigVO.IV, id+"|"+careAgencyCode+"|"+time);
+        } catch (Exception e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+        
+        return token;
+    }
+    
+    /**
+     * api 분기
+     * @param dto
+     * resourceType
+     * bloodPressure    : 혈압
+     * bloodSugar       : 혈당
+     * oxygenSaturation : 산소포화도
+     * pulseRate        : 맥박수
+     * temperature      : 체온
+     * patientInfoList  : 환자정보
+     * munjin           : 문진 정보
+     * symptom          : 환자 임상정보
+     * @return json String
+     */
+    @RequestMapping(value="/toAction", method = RequestMethod.POST)
+    public String moveToAction(@RequestBody HlRequestDTO dto) {
+        
+        String result = "";
+        String token = dto.getToken();
+        LinkedHashMap<String, Object> object = new LinkedHashMap<>();
+        if (!token.equals("")) {
+            String apiKey = service.selectApiKey(dto);
+            if (apiKey.equals("")) {
+                object.put("error", "invalidToken");
+                return object.toString();
+            } else {
+                try {
+                    token = LifeCenterFunction.aesDecrypt(apiKey, LifeCenterConfigVO.IV, token);
+                    String[] splitToken = token.split("[|]");
+                    String managerId = splitToken[0];
+                    //int centerCode = Integer.parseInt(splitToken[1]);
+                    String careAgencyCode = splitToken[1];
+                    String time = splitToken[2];
+                    
+                    if (managerId.equals(dto.getManagerId()) && careAgencyCode.equals(dto.getCareAgencyCode())) {
+                        DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+                        Calendar cal = Calendar.getInstance();
+                        Date getDate = dateFormat.parse(time);
+                        cal.setTime(getDate);
+                        cal.add(Calendar.MINUTE, 15);
+                        String tokenDateTime = dateFormat.format(cal.getTime());
+                        getDate = dateFormat.parse(tokenDateTime);
+                        
+                        Date nowDate = new Date();
+                        if (nowDate.getTime() < getDate.getTime()) {
+                            
+                            String resourceType = dto.getResourceType();
+                            if (resourceType.equals("")) {
+                                object.put("error", "invalidParameters");
+                                return object.toString();
+                            } else {
+                                if (resourceType.equals("bloodPressure") || resourceType.equals("bloodSugar") || 
+                                        resourceType.equals("oxygenSaturation") || resourceType.equals("pulseRate") || resourceType.equals("temperature")) {
+                                        
+                                        result = selectPhrData(dto);
+                                        
+                                    } else if (resourceType.equals("patientInfoList")) {
+                                        result = selectHLPatientList(dto);
+                                    } else if (resourceType.equals("munjin")) {
+                                        result = selectMunjinDataList(dto);
+                                    } else if (resourceType.equals("symptom")) {
+                                        result = selectSymptomDataList(dto);
+                                    } else if (resourceType.equals("vitalSign")) {
+                                        //String[] strAr = {"temperature", "bloodPressure", "bloodSugar", "oxygenSaturation", "pulseRate"};
+//                                        result = selectVitalSign(dto);
+                                    } else {
+                                        object.put("error", "invalidParameters");
+                                        return object.toString();
+                                    }
+                            }
+
+                            
+                        } else {
+                            object.put("error", "expireToken");
+                            return object.toString();
+                        }
+                    } else {
+                        object.put("error", "invalidParameters");
+                        return object.toString();
+                    }
+                    
+                } catch (Exception e) {
+                    object.put("error", "invalidParameters");
+                    return object.toString();
+                }
+            }
+            
+        } else {
+            object.put("error", "emptyToken");
+            return object.toString();
+        }
+        
+        return result;
+    }
+    
+    //@RequestMapping(value="/patientList" , method = RequestMethod.POST)
+    private String selectHLPatientList(HlRequestDTO dto) {
         List<PatientDTO> list = service.selectHLPatientList(dto);
+        JSONArray array = new JSONArray();
+        
+        for (int i = 0; i < list.size(); i ++) {
+            LinkedHashMap<String, Object> object = new LinkedHashMap<>();
+            String patientNumber        = list.get(i).getPatientNumber();
+            String patientName          = list.get(i).getPatientName();
+            String gender               = list.get(i).getGender();
+            String wardNumber           = list.get(i).getWardNumber();
+            String roomNumber           = list.get(i).getRoomNumber();
+            String finalClinicDate      = list.get(i).getFinamClinicDate();
+            String hospitalizationDate  = list.get(i).getHospitalizationDate();
+            String state                = list.get(i).getState();
+            int centerCode              = list.get(i).getCenterCode();
+            String jumin                = list.get(i).getJumin();
+            String patientPhone         = list.get(i).getPatientPhone();
+            String guardianPhone        = list.get(i).getGuardianPhone();
+            String symptomStartDate     = list.get(i).getSymptomStartDate();
+            String confirmationDate     = list.get(i).getConfirmationDate();
+            String disisolationDate     = list.get(i).getDisisolationDate();
+            String basalDiseaseYn       = list.get(i).getBasalDiseaseYn();
+            String drugYn               = list.get(i).getDrugYn();
+            String drugContent          = list.get(i).getDrugContent();
+            String pregnancyStatus      = list.get(i).getPregnancyStatus();
+            String pregnancyWeek        = list.get(i).getPregnancyWeek();
+            String managerId            = list.get(i).getManagerId();
+            String expectedDischargeDate = list.get(i).getExpectedDischargeDate();
+            
+            object.put("resourceType", "patientInfoList");
+            object.put("patinetId", patientNumber);
+            object.put("patientName", patientName);
+            object.put("gender", gender);
+            object.put("wardNumber", wardNumber);
+            object.put("roomNumber", roomNumber);
+            object.put("state", state);
+            object.put("centerCode", centerCode);
+            object.put("birthDate", jumin);
+            object.put("patientPhone", patientPhone);
+            object.put("guardianPhone", guardianPhone);
+            object.put("finalClinicDate", finalClinicDate);
+            object.put("hospitalizationDate", hospitalizationDate);
+            object.put("symptomDate", symptomStartDate);
+            object.put("confirmationDate", confirmationDate);
+            object.put("disisolationDate", disisolationDate);
+            object.put("dischargeDate", expectedDischargeDate);
+            object.put("basalDiseaseYn", basalDiseaseYn);
+            object.put("drugYn", drugYn);
+            object.put("drugContent", drugContent);
+            object.put("pregnancyStatus", pregnancyStatus);
+            object.put("pregnancyWeek", pregnancyWeek);
+            object.put("doctorId", managerId);
+            
+            String jsonText = JSONValue.toJSONString(object);
+            array.put(jsonText);
+        }
+        
+        return array.toString();
+    }
+    
+    private String selectPhrData(HlRequestDTO dto) {
+        String resourceType = dto.getResourceType();
+        
+        List<ApiPhrResponseDTO> list = service.selectPhrData(dto);
+        JSONArray array = new JSONArray();
+        
+        for (int i = 0; i < list.size(); i++) {
+            LinkedHashMap<String, Object> object = new LinkedHashMap<>();
+            String patientNumber    = list.get(i).getPatientNumber();
+            String patientName      = list.get(i).getPatientName();
+            String patientPhone     = list.get(i).getPatientPhone();
+            String jumin            = list.get(i).getJumin();
+            String recordedByName   = list.get(i).getRecordedByName();
+            String recordedById     = list.get(i).getRecordedById();
+            String recordedDate      = list.get(i).getRecordedDate();
+            String createDate       = list.get(i).getCreateDate();
+            String phrValue1        = list.get(i).getValueType1();
+            String phrValue2        = list.get(i).getValueType2();
+            
+            object.put("resourceType", resourceType);
+            object.put("patinetId", patientNumber);
+            object.put("patientName", patientName);
+            object.put("patientPhone", patientPhone);
+            object.put("birthDate", jumin);
+            if (resourceType.equals("bloodPressure")) {
+                object.put("bloodSbp", phrValue1);
+                object.put("bloodDbp", phrValue2);
+            } else {
+                object.put(resourceType, phrValue1);
+            }
+            object.put("recordedByName", recordedByName);
+            object.put("recordedById", recordedById);
+            object.put("recodedDate", recordedDate);
+            object.put("createDate", createDate);
+            
+            String jsonText = JSONValue.toJSONString(object);
+            array.put(jsonText);
+        }
+        
+        
+        return array.toString();
     }
+    
+    private String selectMunjinDataList(HlRequestDTO dto) {
+        String resourceType = dto.getResourceType();
+        List<PatientDTO> list = service.selectMunjinDataList(dto);
+        JSONArray array = new JSONArray();
+        
+        for (int i = 0; i < list.size(); i++) {
+            LinkedHashMap<String, Object> object = new LinkedHashMap<>();
+            String patientNumber      = list.get(i).getPatientNumber();
+            String patientName        = list.get(i).getPatientName();
+            String patientPhone       = list.get(i).getPatientPhone();
+            String jumin              = list.get(i).getJumin();
+            String feverCheck         = list.get(i).getFeverCheck();
+            String coughCheck         = list.get(i).getCoughCheck();
+            String colic              = list.get(i).getColic();
+            String coldFitCheck       = list.get(i).getColdFitCheck();
+            String sputumCheck        = list.get(i).getSputumCheck();
+            String ocinCheck          = list.get(i).getOcinCheck();
+            String feverRight         = list.get(i).getFeverRight();
+            String feverLeft          = list.get(i).getFeverLeft();
+            String fatigueCheck       = list.get(i).getFatigueCheck();
+            String etcCheck           = list.get(i).getEtcCheck();
+            String etcContent         = list.get(i).getEtcContent();
+            String chestPain          = list.get(i).getChestPain();
+            String noseCheck          = list.get(i).getNoseCheck();
+            String vomitingCheck      = list.get(i).getVomitingCheck();
+            String musclePain         = list.get(i).getMusclePainCheck();
+            String soreThroatCheck    = list.get(i).getSoreThroatCheck();
+            String diarrheaCheck      = list.get(i).getDiarrheaCheck();
+            String headacheCheck      = list.get(i).getHeadacheCheck();
+            String dyspenaCheck       = list.get(i).getDyspneaCheck();
+            String pulseRate          = list.get(i).getPulseRate();
+            String respirationRate    = list.get(i).getRespirationRate();
+            String bloodPressureLevel = list.get(i).getBloodPressureLevel();
+            String oxygenSaturatio    = list.get(i).getOxygenSaturation();
+            
+            object.put("resourceType", resourceType);
+            object.put("patinetId", patientNumber);
+            object.put("patientName", patientName);
+            object.put("patientPhone", patientPhone);
+            object.put("birthDate", jumin);
+            
+            object.put("feverCheck", feverCheck);
+            object.put("coughCheck", coughCheck);
+            object.put("colic", colic);
+            object.put("coldFitCheck", coldFitCheck);
+            object.put("sputumCheck", sputumCheck);
+            object.put("ocinCheck", ocinCheck);
+            object.put("feverRight", feverRight);
+            object.put("feverLeft", feverLeft);
+            object.put("fatigueCheck", fatigueCheck);
+            object.put("etcCheck", etcCheck);
+            object.put("etcContent", etcContent);
+            object.put("chestPain", chestPain);
+            object.put("noseCheck", noseCheck);
+            object.put("vomitingCheck", vomitingCheck);
+            object.put("musclePain", musclePain);
+            object.put("soreThroatCheck", soreThroatCheck);
+            object.put("diarrheaCheck", diarrheaCheck);
+            object.put("headacheCheck", headacheCheck);
+            object.put("dyspenaCheck", dyspenaCheck);
+            object.put("pulseRate", pulseRate);
+            object.put("respirationRate", respirationRate);
+            object.put("bloodPressureLevel", bloodPressureLevel);
+            object.put("oxygenSaturation", oxygenSaturatio);
+            
+            String jsonText = JSONValue.toJSONString(object);
+            array.put(jsonText);
+        }
+        
+        return array.toString();
+    }
+    
+    private String selectSymptomDataList(HlRequestDTO dto) {
+        String resourceType = dto.getResourceType();
+        List<ApiSymptomDTO> list = service.selectSymptomDataList(dto);
+        JSONArray array = new JSONArray();
+        
+        for (int i = 0; i < list.size(); i++) {
+            LinkedHashMap<String, Object> object = new LinkedHashMap<>();
+            String patientNumber     = list.get(i).getPatientNumber();
+            String patientName       = list.get(i).getPatientName();
+            String patientPhone      = list.get(i).getPatientPhone();
+            String jumin             = list.get(i).getJumin();
+            String coughCheck        = list.get(i).getCoughCheck();
+            String dyspneaCheck      = list.get(i).getDyspneaCheck();
+            String coldFitCheck      = list.get(i).getColdFitCheck();
+            String musclePainCheck   = list.get(i).getMusclePainCheck();
+            String headacheCheck     = list.get(i).getHeadacheCheck();
+            String soreThroatCheck   = list.get(i).getSoreThroatCheck();
+            String smellPlateCheck   = list.get(i).getSmellPlateCheck();
+            String fatigueCheck      = list.get(i).getFatigueCheck();
+            String appetiteLossCheck = list.get(i).getAppetiteLossCheck();
+            String sputumCheck       = list.get(i).getSputumCheck();
+            String ocinCheck         = list.get(i).getOcinCheck();
+            String vomitingCheck     = list.get(i).getVomitingCheck();
+            String diarrheaCheck     = list.get(i).getDiarrheaCheck();
+            String dizzinessCheck    = list.get(i).getDizzinessCheck();
+            String noseCheck         = list.get(i).getNoseCheck();
+            String etcCheck          = list.get(i).getEtcCheck();
+            String etcContent        = list.get(i).getEtcContent();
+            String recordedById      = list.get(i).getRecordedById();
+            String recordedByName    = list.get(i).getRecordedByName();
+            String recordedByDate    = list.get(i).getRecordedByDate();
+            String createDate        = list.get(i).getCreateDate();
+            
+            object.put("resourceType", resourceType);
+            object.put("patinetId", patientNumber);
+            object.put("patientName", patientName);
+            object.put("patientPhone", patientPhone);
+            object.put("birthDate", jumin);
+            
+            object.put("coughCheck", coughCheck);
+            object.put("dyspenaCheck", dyspneaCheck);
+            object.put("coldFitCheck", coldFitCheck);
+            object.put("musclePain", musclePainCheck);
+            object.put("headacheCheck", headacheCheck);
+            object.put("soreThroatCheck", soreThroatCheck);
+            object.put("smellPlateCheck", smellPlateCheck);
+            object.put("fatigueCheck", fatigueCheck);
+            object.put("appetiteLossCheck", appetiteLossCheck);
+            object.put("sputumCheck", sputumCheck);
+            object.put("ocinCheck", ocinCheck);
+            object.put("vomitingCheck", vomitingCheck);
+            object.put("diarrheaCheck", diarrheaCheck);
+            object.put("dizzinessCheck", dizzinessCheck);
+            object.put("noseCheck", noseCheck);
+            object.put("etcCheck", etcCheck);
+            object.put("etcContent", etcContent);
+            object.put("recordedById", recordedById);
+            object.put("recordedByName", recordedByName);
+            object.put("recordedByDate", recordedByDate);
+            object.put("createDate", createDate);
+            
+            String jsonText = JSONValue.toJSONString(object);
+            array.put(jsonText);
+        }
+        
+        return array.toString();
+    }
+    
+    private String selectVitalSign(HlRequestDTO dto) {
+        dto.setCenterCode(63);
+        List<ApiPhrResponseDTO> patientList = service.selectPatientInfoList(dto);
+        JSONArray array = new JSONArray();
+        
+        for (int i = 0; i < patientList.size(); i++) {
+            LinkedHashMap<String, Object> object = new LinkedHashMap<>();
+            int patientIdx      = patientList.get(i).getPatientIdx();
+            String patientId    = patientList.get(i).getPatientNumber();
+            String patientName  = patientList.get(i).getPatientName();
+            String patientPhone = patientList.get(i).getPatientPhone();
+            String jumin        = patientList.get(i).getJumin();
+            List<ApiPhrResponseDTO> phrList = service.selectPatientPhrData(patientIdx);
+            
+            object.put("patinetId", patientId);
+            object.put("patientName", patientName);
+            object.put("patientPhone", patientPhone);
+            object.put("birthDate", jumin);
+            for (int j = 0; j < phrList.size(); j++ ) {
+                LinkedHashMap<String, Object> object2 = new LinkedHashMap<>();
+                String phrType        = phrList.get(j).getPhrType();
+                String valueType1     = phrList.get(j).getValueType1();
+                String valueType2     = phrList.get(j).getValueType2();
+                String recordedByName = phrList.get(j).getRecordedByName();
+                String recordedById   = phrList.get(j).getRecordedById();
+                String createDate     = phrList.get(j).getCreateDate();
+                
+                if (phrType.equals("bloodPressure")) {
+                    object2.put("bloodSbp", valueType1);
+                    object2.put("bloodDbp", valueType2);
+                } else {
+                    object2.put(phrType, valueType1);
+                }
+                
+                object2.put("recordedByName", recordedByName);
+                object2.put("recordedById", recordedById);
+                object2.put("createDate", createDate);
+                object.put(phrType, object2);
+            }
+            String jsonText = JSONValue.toJSONString(object);
+            array.put(jsonText);
+        }
+        
+        return array.toString();
+    }
+    
 }

+ 89 - 0
src/main/java/com/lemon/lifecenter/dto/ApiPhrResponseDTO.java

@@ -0,0 +1,89 @@
+package com.lemon.lifecenter.dto;
+
+public class ApiPhrResponseDTO {
+    private int patientIdx          = 0;
+    private String patientNumber    = "";
+    private String patientName      = "";
+    private String patientPhone     = "";
+    private String jumin            = "";
+    private String recordedByName   = "";
+    private String recordedById     = "";
+    private String recordedDate     = "";
+    private String createDate       = "";
+    private String valueType1       = "";
+    private String valueType2       = "";
+    private String phrType          = "";
+    
+    public int getPatientIdx() {
+        return patientIdx;
+    }
+    public void setPatientIdx(int patientIdx) {
+        this.patientIdx = patientIdx;
+    }
+    public String getPatientNumber() {
+        return patientNumber;
+    }
+    public void setPatientNumber(String patientNumber) {
+        this.patientNumber = patientNumber;
+    }
+    public String getPatientName() {
+        return patientName;
+    }
+    public void setPatientName(String patientName) {
+        this.patientName = patientName;
+    }
+    public String getPatientPhone() {
+        return patientPhone;
+    }
+    public void setPatientPhone(String patientPhone) {
+        this.patientPhone = patientPhone;
+    }
+    public String getJumin() {
+        return jumin;
+    }
+    public void setJumin(String jumin) {
+        this.jumin = jumin;
+    }
+    public String getRecordedByName() {
+        return recordedByName;
+    }
+    public void setRecordedByName(String recordedByName) {
+        this.recordedByName = recordedByName;
+    }
+    public String getRecordedById() {
+        return recordedById;
+    }
+    public void setRecordedById(String recordedById) {
+        this.recordedById = recordedById;
+    }
+    public String getRecordedDate() {
+        return recordedDate;
+    }
+    public void setRecordedDate(String recordedDate) {
+        this.recordedDate = recordedDate;
+    }
+    public String getCreateDate() {
+        return createDate;
+    }
+    public void setCreateDate(String createDate) {
+        this.createDate = createDate;
+    }
+    public String getValueType1() {
+        return valueType1;
+    }
+    public void setValueType1(String valueType1) {
+        this.valueType1 = valueType1;
+    }
+    public String getValueType2() {
+        return valueType2;
+    }
+    public void setValueType2(String valueType2) {
+        this.valueType2 = valueType2;
+    }
+    public String getPhrType() {
+        return phrType;
+    }
+    public void setPhrType(String phrType) {
+        this.phrType = phrType;
+    }
+}

+ 187 - 0
src/main/java/com/lemon/lifecenter/dto/ApiSymptomDTO.java

@@ -0,0 +1,187 @@
+package com.lemon.lifecenter.dto;
+
+public class ApiSymptomDTO {
+    private String patientNumber     = "";
+    private String patientName       = "";
+    private String patientPhone      = "";
+    private String jumin             = "";
+    private String coughCheck        = "";
+    private String dyspneaCheck      = "";
+    private String coldFitCheck      = "";
+    private String musclePainCheck   = "";
+    private String headacheCheck     = "";
+    private String soreThroatCheck   = "";
+    private String smellPlateCheck   = "";
+    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 etcContent        = "";
+    private String recordedById      = "";
+    private String recordedByName    = "";
+    private String recordedByDate    = "";
+    private String createDate        = "";
+    private String phrType           = "";
+    
+    public String getPatientNumber() {
+        return patientNumber;
+    }
+    public void setPatientNumber(String patientNumber) {
+        this.patientNumber = patientNumber;
+    }
+    public String getPatientName() {
+        return patientName;
+    }
+    public void setPatientName(String patientName) {
+        this.patientName = patientName;
+    }
+    public String getPatientPhone() {
+        return patientPhone;
+    }
+    public void setPatientPhone(String patientPhone) {
+        this.patientPhone = patientPhone;
+    }
+    public String getJumin() {
+        return jumin;
+    }
+    public void setJumin(String jumin) {
+        this.jumin = jumin;
+    }
+    public String getCoughCheck() {
+        return coughCheck;
+    }
+    public void setCoughCheck(String coughCheck) {
+        this.coughCheck = coughCheck;
+    }
+    public String getDyspneaCheck() {
+        return dyspneaCheck;
+    }
+    public void setDyspneaCheck(String dyspneaCheck) {
+        this.dyspneaCheck = dyspneaCheck;
+    }
+    public String getColdFitCheck() {
+        return coldFitCheck;
+    }
+    public void setColdFitCheck(String coldFitCheck) {
+        this.coldFitCheck = coldFitCheck;
+    }
+    public String getMusclePainCheck() {
+        return musclePainCheck;
+    }
+    public void setMusclePainCheck(String musclePainCheck) {
+        this.musclePainCheck = musclePainCheck;
+    }
+    public String getHeadacheCheck() {
+        return headacheCheck;
+    }
+    public void setHeadacheCheck(String headacheCheck) {
+        this.headacheCheck = headacheCheck;
+    }
+    public String getSoreThroatCheck() {
+        return soreThroatCheck;
+    }
+    public void setSoreThroatCheck(String soreThroatCheck) {
+        this.soreThroatCheck = soreThroatCheck;
+    }
+    public String getSmellPlateCheck() {
+        return smellPlateCheck;
+    }
+    public void setSmellPlateCheck(String smellPlateCheck) {
+        this.smellPlateCheck = smellPlateCheck;
+    }
+    public String getFatigueCheck() {
+        return fatigueCheck;
+    }
+    public void setFatigueCheck(String fatigueCheck) {
+        this.fatigueCheck = fatigueCheck;
+    }
+    public String getAppetiteLossCheck() {
+        return appetiteLossCheck;
+    }
+    public void setAppetiteLossCheck(String appetiteLossCheck) {
+        this.appetiteLossCheck = appetiteLossCheck;
+    }
+    public String getSputumCheck() {
+        return sputumCheck;
+    }
+    public void setSputumCheck(String sputumCheck) {
+        this.sputumCheck = sputumCheck;
+    }
+    public String getOcinCheck() {
+        return ocinCheck;
+    }
+    public void setOcinCheck(String ocinCheck) {
+        this.ocinCheck = ocinCheck;
+    }
+    public String getVomitingCheck() {
+        return vomitingCheck;
+    }
+    public void setVomitingCheck(String vomitingCheck) {
+        this.vomitingCheck = vomitingCheck;
+    }
+    public String getDiarrheaCheck() {
+        return diarrheaCheck;
+    }
+    public void setDiarrheaCheck(String diarrheaCheck) {
+        this.diarrheaCheck = diarrheaCheck;
+    }
+    public String getDizzinessCheck() {
+        return dizzinessCheck;
+    }
+    public void setDizzinessCheck(String dizzinessCheck) {
+        this.dizzinessCheck = dizzinessCheck;
+    }
+    public String getNoseCheck() {
+        return noseCheck;
+    }
+    public void setNoseCheck(String noseCheck) {
+        this.noseCheck = noseCheck;
+    }
+    public String getEtcCheck() {
+        return etcCheck;
+    }
+    public void setEtcCheck(String etcCheck) {
+        this.etcCheck = etcCheck;
+    }
+    public String getEtcContent() {
+        return etcContent;
+    }
+    public void setEtcContent(String etcContent) {
+        this.etcContent = etcContent;
+    }
+    public String getRecordedById() {
+        return recordedById;
+    }
+    public void setRecordedById(String recordedById) {
+        this.recordedById = recordedById;
+    }
+    public String getRecordedByName() {
+        return recordedByName;
+    }
+    public void setRecordedByName(String recordedByName) {
+        this.recordedByName = recordedByName;
+    }
+    public String getRecordedByDate() {
+        return recordedByDate;
+    }
+    public void setRecordedByDate(String recordedByDate) {
+        this.recordedByDate = recordedByDate;
+    }
+    public String getCreateDate() {
+        return createDate;
+    }
+    public void setCreateDate(String createDate) {
+        this.createDate = createDate;
+    }
+    public String getPhrType() {
+        return phrType;
+    }
+    public void setPhrType(String phrType) {
+        this.phrType = phrType;
+    }
+}

+ 22 - 1
src/main/java/com/lemon/lifecenter/dto/HlRequestDTO.java

@@ -7,6 +7,9 @@ public class HlRequestDTO {
     private String patientName    = "";
     private String birthDate      = "";
     private String patientPhone   = "";
+    private String managerId      = "";
+    private int centerCode        = 0;
+    private String token = "";
     
     public String getResourceType() {
         return resourceType;
@@ -44,5 +47,23 @@ public class HlRequestDTO {
     public void setPatientPhone(String patientPhone) {
         this.patientPhone = patientPhone;
     }
-    
+    public String getManagerId() {
+        return managerId;
+    }
+    public void setManagerId(String managerId) {
+        this.managerId = managerId;
+    }
+    public int getCenterCode() {
+        return centerCode;
+    }
+    public void setCenterCode(int centerCode) {
+        this.centerCode = centerCode;
+    }
+   
+    public String getToken() {
+        return token;
+    }
+    public void setToken(String token) {
+        this.token = token;
+    }
 }

+ 9 - 0
src/main/java/com/lemon/lifecenter/mapper/RestApiMapper.java

@@ -5,6 +5,8 @@ import java.util.List;
 import org.apache.ibatis.annotations.Mapper;
 import org.springframework.stereotype.Repository;
 
+import com.lemon.lifecenter.dto.ApiPhrResponseDTO;
+import com.lemon.lifecenter.dto.ApiSymptomDTO;
 import com.lemon.lifecenter.dto.HlRequestDTO;
 import com.lemon.lifecenter.dto.PatientDTO;
 
@@ -12,4 +14,11 @@ import com.lemon.lifecenter.dto.PatientDTO;
 @Mapper
 public interface RestApiMapper {
     public List<PatientDTO> selectHLPatientList(HlRequestDTO dto);
+    public List<ApiPhrResponseDTO> selectPhrData(HlRequestDTO dto);
+    public List<PatientDTO> selectMunjinDataList(HlRequestDTO dto);
+    public List<ApiSymptomDTO> selectSymptomDataList(HlRequestDTO dto);
+    public List<ApiPhrResponseDTO> selectPatientInfoList(HlRequestDTO dto);
+    public List<ApiPhrResponseDTO> selectPatientPhrData(int patientIdx);
+    
+    public String selectApiKey(HlRequestDTO dto);
 }

+ 26 - 0
src/main/java/com/lemon/lifecenter/service/RestApiService.java

@@ -5,6 +5,8 @@ import java.util.List;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import com.lemon.lifecenter.dto.ApiPhrResponseDTO;
+import com.lemon.lifecenter.dto.ApiSymptomDTO;
 import com.lemon.lifecenter.dto.AppVersionDTO;
 import com.lemon.lifecenter.dto.DeviceInfoDTO;
 import com.lemon.lifecenter.dto.HlRequestDTO;
@@ -19,4 +21,28 @@ public class RestApiService {
     public List<PatientDTO> selectHLPatientList(HlRequestDTO dto) {
         return mapper.selectHLPatientList(dto);
     }
+    
+    public List<ApiPhrResponseDTO> selectPhrData(HlRequestDTO dto) {
+        return mapper.selectPhrData(dto);
+    }
+    
+    public List<PatientDTO> selectMunjinDataList(HlRequestDTO dto) {
+        return mapper.selectMunjinDataList(dto);
+    }
+    
+    public List<ApiSymptomDTO> selectSymptomDataList(HlRequestDTO dto) {
+        return mapper.selectSymptomDataList(dto);
+    }
+    
+    public List<ApiPhrResponseDTO> selectPatientInfoList(HlRequestDTO dto) {
+        return mapper.selectPatientInfoList(dto);
+    }
+    
+    public List<ApiPhrResponseDTO> selectPatientPhrData(int patientIdx) {
+        return mapper.selectPatientPhrData(patientIdx);
+    }
+    
+    public String selectApiKey(HlRequestDTO dto) {
+        return mapper.selectApiKey(dto);
+    }
 }

+ 279 - 29
src/main/resources/mybatis/mapper/api/api.xml

@@ -5,42 +5,36 @@
     <select id="selectHLPatientList" parameterType="HlRequestDTO" resultType="PatientDTO">
         <!-- 조건이 맞지 않을 경우에는 데이터를 주면 안됨 -->
         <![CDATA[
-            SELECT PATIENT_NUMBER          AS patinetNumber,
-                   PATIENT_NAME            AS patientName,
-                   GENDER                  AS gender,
-                   WARD_NUMBER             AS wardNumber,
-                   ROOM_NUMBER             AS roomNumber,
-                   FINAL_CLINIC_DATE       AS finalClinicDate,
-                   HOSPITALIZATION_DATE    AS hospitalizationDate,
-                   STATE                   AS state,
-                   CENTER_CODE             AS centerCode,
-                   JUMIN                   AS jumin,
-                   PATIENT_PHONE           AS patientPhone,
-                   GUARDIAN_PHONE          AS guardianPhone,
-                   SYMPTOM_START_DATE      AS sysmptomStartDate,
-                   CONFIRMATION_DATE       AS confirmationDate,
-                   DISISOLATION_DATE       AS disisolationDate,
-                   BASAL_DISEASE_YN        AS basalDiseaseYn,
-                   DRUG_YN                 AS drugYn,
-                   DRUG_CONTENT            AS drugContent,
-                   PREGNANCY_STATUS        AS pregnancyStatus,
-                   PREGNANCY_WEEK          AS pregnancyWeek,
-                   MANAGER_ID              AS namagerId,
-                   EXPECTED_DISCHARGE_DATE AS expectedDischargeDate
+            SELECT IFNULL(PATIENT_NUMBER, '')                                         AS patientNumber,
+                   IFNULL(PATIENT_NAME, '')                                           AS patientName,
+                   IFNULL(GENDER, '')                                                 AS gender,
+                   IFNULL(WARD_NUMBER, '')                                            AS wardNumber,
+                   IFNULL(ROOM_NUMBER, '')                                            AS roomNumber,
+                   IFNULL(DATE_FORMAT(FINAL_CLINIC_DATE, '%Y-%m-%d %H:%i'), '')       AS finamClinicDate,
+                   IFNULL(DATE_FORMAT(HOSPITALIZATION_DATE, '%Y-%m-%d %H:%i'), '')    AS hospitalizationDate,
+                   IFNULL(STATE, '')                                                  AS state,
+                   IFNULL(CENTER_CODE, '')                                            AS centerCode,
+                   IFNULL(JUMIN, '')                                                  AS jumin,
+                   IFNULL(PATIENT_PHONE, '')                                          AS patientPhone,
+                   IFNULL(GUARDIAN_PHONE, '')                                         AS guardianPhone,
+                   IFNULL(DATE_FORMAT(SYMPTOM_START_DATE, '%Y-%m-%d %H:%i'), '')      AS symptomStartDate,
+                   IFNULL(DATE_FORMAT(CONFIRMATION_DATE, '%Y-%m-%d %H:%i'), '')       AS confirmationDate,
+                   IFNULL(DATE_FORMAT(DISISOLATION_DATE, '%Y-%m-%d %H:%i'), '')       AS disisolationDate,
+                   IFNULL(BASAL_DISEASE_YN, '')                                       AS basalDiseaseYn,
+                   IFNULL(DRUG_YN, '')                                                AS drugYn,
+                   IFNULL(DRUG_CONTENT, '')                                           AS drugContent,
+                   IFNULL(PREGNANCY_STATUS, '')                                       AS pregnancyStatus,
+                   IFNULL(PREGNANCY_WEEK, '')                                         AS pregnancyWeek,
+                   IFNULL(MANAGER_ID, '')                                             AS managerId,
+                   IFNULL(DATE_FORMAT(EXPECTED_DISCHARGE_DATE, '%Y-%m-%d %H:%i'), '') AS expectedDischargeDate
               FROM PATIENT_CARE
              WHERE 1 = 1
         ]]>
         
-        
         <choose>
             <when test='careAgencyCode != null and careAgencyCode != ""'>
                 <![CDATA[
-                       AND CENTER_CODE    = (SELECT CENTER_CODE
-                                              FROM CENTER_INFO
-                                             WHERE 1 = 1
-                                               AND COOPERATIVE_CODE = (SELECT COOPERATIVE_CODE
-                                                                         FROM COOPERATIVE_HOSPITAL
-                                                                        WHERE COOPERATIVE_CODE = #{careAgencyCode}))
+                       AND CENTER_CODE    = #{centerCode}
                 ]]>
             </when>
             <otherwise>
@@ -64,4 +58,260 @@
         </choose>
         
     </select>
+    
+    <select id="selectPhrData" parameterType="HlRequestDTO" resultType="ApiPhrResponseDTO">
+        <![CDATA[
+            SELECT IFNULL(PC.PATIENT_NUMBER, '')    AS patientNumber,
+                   IFNULL(PC.PATIENT_NAME, '')      AS patientName,
+                   IFNULL(PC.PATIENT_PHONE, '')     AS patientPhone,
+                   IFNULL(PC.JUMIN, '')             AS jumin,
+                   IFNULL(PPH.PHR_VALUE, '')        AS valueType1,
+        ]]>
+        <if test='resourceType == "bloodPressure"'>
+            <![CDATA[
+                   IFNULL(PPH.PHR_VALUE_2, '') AS valueType2,
+            ]]>
+        </if>
+
+        <![CDATA[
+                   IFNULL(PPH.RECORDED_BY_NAME, '') AS recordedByName,
+                   IFNULL(PPH.RECORDED_BY_ID, '')   AS recordedById,
+                   IFNULL(DATE_FORMAT(PPH.RECORDED_DATE, '%Y-%m-%d %H:%i'), '')      AS recordedDate,
+                   IFNULL(DATE_FORMAT(PPH.CREATE_DATE, '%Y-%m-%d %H:%i'), '')      AS createDate
+              FROM PATIENT_PHR_HISTORY PPH
+              LEFT JOIN (SELECT PATIENT_IDX,
+                                PATIENT_NUMBER,
+                                PATIENT_NAME,
+                                PATIENT_PHONE,
+                                JUMIN,
+                                CENTER_CODE
+                           FROM PATIENT_CARE
+                          WHERE CENTER_CODE = 63) PC
+                ON PC.PATIENT_IDX = PPH.PATIENT_IDX
+             WHERE 1 = 1
+               AND PPH.PHR_TYPE      = #{resourceType}
+         ]]>
+
+        <choose>
+            <when test='careAgencyCode != null and careAgencyCode != ""'>
+                <![CDATA[
+                       AND PC.CENTER_CODE    = #{centerCode}
+                ]]>
+            </when>
+            <otherwise>
+                <choose>
+                    <when test='patientNumber != null and patientNumber !=""'>
+                        <![CDATA[
+                               AND PC.PATIENT_NUMBER = #{patientNumber}
+                        ]]>
+                    </when>
+                    <otherwise>
+                        <if test='birthDate != null and birthDate !="" and patientName != null and patientName != "" and patientPhone != null and patientPhone != ""'>
+                            <![CDATA[
+                                   AND PC.JUMIN          = #{birthDate}
+                                   AND PC.PATIENT_NAME   = #{patientName}
+                                   AND PC.PATIENT_PHONE  = #{patientPhone}
+                            ]]>
+                        </if>
+                    </otherwise>
+                </choose>
+            </otherwise>
+        </choose>
+     </select>
+     
+     <select id="selectMunjinDataList" parameterType="HlRequestDTO" resultType="PatientDTO">
+        <![CDATA[
+            SELECT IFNULL(PC.PATIENT_NUMBER, '')       AS patientNumber,
+                   IFNULL(PC.PATIENT_NAME, '')         AS patientName,
+                   IFNULL(PC.PATIENT_PHONE, '')        AS patientPhone,
+                   IFNULL(PC.JUMIN, '')                AS jumin,
+                   IFNULL(PS.FEVER_CHECK, '')          AS feverCheck,
+                   IFNULL(PS.COUGH_CHECK, '')          AS coughCheck,
+                   IFNULL(PS.COLIC, '')                AS colic,
+                   IFNULL(PS.COLD_FIT_CHECK, '')       AS coldFitCheck,
+                   IFNULL(PS.SPUTUM_CHECK, '')         AS sputumCheck,
+                   IFNULL(PS.OCIN_CHECK, '')           AS ocinCheck,
+                   IFNULL(PS.FEVER_RIGHT, '')          AS feverRight,
+                   IFNULL(PS.FEVER_LEFT, '')           AS feverLeft,
+                   IFNULL(PS.FATIGUE_CHECK, '')        AS fatigueCheck,
+                   IFNULL(PS.ETC_CHECK, '')            AS etcCheck,
+                   IFNULL(PS.ETC_CONTENT, '')          AS etcContent,
+                   IFNULL(PS.CHEST_PAIN, '')           AS chestPain,
+                   IFNULL(PS.NOSE_CHECK, '')           AS noseCheck,
+                   IFNULL(PS.VOMITING_CHECK, '')       AS vomitingCheck,
+                   IFNULL(PS.MUSCLE_PAIN_CHECK, '')    AS musclePain,
+                   IFNULL(PS.SORE_THROAT_CHECK, '')    AS soreThroatCheck,
+                   IFNULL(PS.DIARRHEA_CHECK, '')       AS diarrheaCheck,
+                   IFNULL(PS.HEADACHE_CHECK, '')       AS headacheCheck,
+                   IFNULL(PS.DYSPNEA_CHECK, '')        AS dyspenaCheck,
+                   IFNULL(PS.PULSE_RATE, '')           AS pulseRate,
+                   IFNULL(PS.RESPIRATION_RATE, '')     AS respirationRate,
+                   IFNULL(PS.BLOOD_PRESSURE_LEVEL, '') AS bloodPressureLevel,
+                   IFNULL(PS.OXYGEN_SATURATION, '')    AS oxygenSaturation
+              FROM PATIENT_SYMPTOM PS
+              LEFT JOIN (SELECT PATIENT_IDX,
+                                PATIENT_NUMBER,
+                                PATIENT_NAME,
+                                PATIENT_PHONE,
+                                JUMIN,
+                                CENTER_CODE
+                           FROM PATIENT_CARE
+                          WHERE CENTER_CODE = 63) PC
+                ON PS.PATIENT_IDX = PC.PATIENT_IDX
+             WHERE 1 = 1
+        ]]>
+        <choose>
+            <when test='careAgencyCode != null and careAgencyCode != ""'>
+                <![CDATA[
+                       AND PC.CENTER_CODE    = #{centerCode}
+                ]]>
+            </when>
+            <otherwise>
+                <choose>
+                    <when test='patientNumber != null and patientNumber !=""'>
+                        <![CDATA[
+                               AND PC.PATIENT_NUMBER = #{patientNumber}
+                        ]]>
+                    </when>
+                    <otherwise>
+                        <if test='birthDate != null and birthDate !="" and patientName != null and patientName != "" and patientPhone != null and patientPhone != ""'>
+                            <![CDATA[
+                                   AND PC.JUMIN          = #{birthDate}
+                                   AND PC.PATIENT_NAME   = #{patientName}
+                                   AND PC.PATIENT_PHONE  = #{patientPhone}
+                            ]]>
+                        </if>
+                    </otherwise>
+                </choose>
+            </otherwise>
+        </choose>
+     </select>
+     
+     <select id="selectSymptomDataList" parameterType="HlRequestDTO" resultType="ApiSymptomDTO">
+         <![CDATA[
+             SELECT IFNULL(PC.PATIENT_NUMBER, '')                              AS patientNumber,
+                    IFNULL(PC.PATIENT_NAME, '')                                AS patientName,
+                    IFNULL(PC.PATIENT_PHONE, '')                               AS patientPhone,
+                    IFNULL(PC.JUMIN, '')                                       AS jumin,
+                    IFNULL(PSS.COUGH_CHECK, '')                                AS coughCheck,
+                    IFNULL(PSS.DYSPNEA_CHECK, '')                              AS dyspneaCheck,
+                    IFNULL(PSS.COLD_FIT_CHECK, '')                             AS coldFitCheck,
+                    IFNULL(PSS.MUSCLE_PAIN_CHECK, '')                          AS musclePainCheck,
+                    IFNULL(PSS.HEADACHE_CHECK, '')                             AS headacheCheck,
+                    IFNULL(PSS.SORE_THROAT_CHECK, '')                          AS soreThroatCheck,
+                    IFNULL(PSS.SMELL_PALATE_CHECK, '')                         AS smellPlateCheck,
+                    IFNULL(PSS.FATIGUE_CHECK, '')                              AS fatigueCheck,
+                    IFNULL(PSS.APPETITE_LOSS_CHECK, '')                        AS appetiteLossCheck,
+                    IFNULL(PSS.SPUTUM_CHECK, '')                               AS sputumCheck,
+                    IFNULL(PSS.OCIN_CHECK, '')                                 AS ocinCheck,
+                    IFNULL(PSS.VOMITING_CHECK, '')                             AS vomitingCheck,
+                    IFNULL(PSS.DIARRHEA_CHECK, '')                             AS diarrheaCheck,
+                    IFNULL(PSS.DIZZINESS_CHECK, '')                            AS dizzinessCheck,
+                    IFNULL(PSS.NOSE_CHECK, '')                                 AS noseCheck,
+                    IFNULL(PSS.ETC_CHECK, '')                                  AS etcCheck,
+                    IFNULL(PSS.ETC_CONTENT, '')                                AS etcContent,
+                    IFNULL(PSS.RECORDED_BY_NAME, '')                           AS recordedById,
+                    IFNULL(PSS.RECORDED_BY_ID, '')                             AS recordedByName,
+                    IFNULL(PSS.RECORDED_DATE, '')                              AS recordedByDate,
+                    IFNULL(DATE_FORMAT(PSS.CREATE_DATE, '%Y-%m-%d %H:%i'), '') AS createDate
+               FROM PATIENT_SYMPTOM_SIM PSS
+               LEFT JOIN (SELECT PATIENT_IDX,
+                                 PATIENT_NUMBER,
+                                 PATIENT_NAME,
+                                 PATIENT_PHONE,
+                                 JUMIN,
+                                 CENTER_CODE
+                            FROM PATIENT_CARE
+                           WHERE CENTER_CODE = 63) PC
+                 ON PC.PATIENT_IDX = PSS.PATIENT_IDX
+              WHERE 1 = 1
+        ]]>
+        <choose>
+            <when test='careAgencyCode != null and careAgencyCode != ""'>
+                <![CDATA[
+                       AND PC.CENTER_CODE    = #{centerCode}
+                ]]>
+            </when>
+            <otherwise>
+                <choose>
+                    <when test='patientNumber != null and patientNumber !=""'>
+                        <![CDATA[
+                               AND PC.PATIENT_NUMBER = #{patientNumber}
+                        ]]>
+                    </when>
+                    <otherwise>
+                        <if test='birthDate != null and birthDate !="" and patientName != null and patientName != "" and patientPhone != null and patientPhone != ""'>
+                            <![CDATA[
+                                   AND PC.JUMIN          = #{birthDate}
+                                   AND PC.PATIENT_NAME   = #{patientName}
+                                   AND PC.PATIENT_PHONE  = #{patientPhone}
+                            ]]>
+                        </if>
+                    </otherwise>
+                </choose>
+            </otherwise>
+        </choose>
+     </select>
+     
+     <select id="selectPatientInfoList" parameterType="HlRequestDTO" resultType="ApiPhrResponseDTO">
+         <![CDATA[
+             SELECT PATIENT_IDX    AS patientIdx,
+                    PATIENT_NUMBER AS patientNumber,
+                    PATIENT_NAME   AS patientName,
+                    PATIENT_PHONE  AS patientPhone,
+                    JUMIN          AS jumin,
+                    CENTER_CODE    AS centerCode
+               FROM PATIENT_CARE
+              WHERE 1 = 1
+         ]]>
+        <choose>
+            <when test='centerCode != null and centerCode != ""'>
+                <![CDATA[
+                       AND CENTER_CODE    = #{centerCode}
+                ]]>
+            </when>
+            <otherwise>
+                <choose>
+                    <when test='patientNumber != null and patientNumber !=""'>
+                        <![CDATA[
+                               AND PC.PATIENT_NUMBER = #{patientNumber}
+                        ]]>
+                    </when>
+                    <otherwise>
+                        <if test='birthDate != null and birthDate !="" and patientName != null and patientName != "" and patientPhone != null and patientPhone != ""'>
+                            <![CDATA[
+                                   AND JUMIN          = #{birthDate}
+                                   AND PATIENT_NAME   = #{patientName}
+                                   AND PATIENT_PHONE  = #{patientPhone}
+                            ]]>
+                        </if>
+                    </otherwise>
+                </choose>
+            </otherwise>
+        </choose>
+     </select>
+     
+     <select id="selectPatientPhrData" parameterType="int" resultType="ApiPhrResponseDTO">
+        <![CDATA[
+            SELECT IFNULL(PHR_TYPE, '')                                   AS phrType,
+                   IFNULL(PHR_VALUE, '')                                  AS valueType1,
+                   IFNULL(PHR_VALUE_2, '')                                AS valueType2,
+                   IFNULL(RECORDED_BY_NAME, '')                           AS recordedByName,
+                   IFNULL(RECORDED_BY_ID, '')                             AS recordedById,
+                   IFNULL(DATE_FORMAT(CREATE_DATE, '%Y-%m-%d %H:%i'), '') AS createDate
+              FROM PATIENT_PHR_HISTORY
+             WHERE 1 = 1
+               AND PATIENT_IDX = #{patientIdx}
+             ORDER BY PHR_TYPE
+        ]]>
+     </select>
+     
+     <select id="selectApiKey" parameterType="HlRequestDTO" resultType="String">
+        <![CDATA[
+            SELECT API_KEY AS apikey
+              FROM API_MANAGER
+             WHERE MANAGER_ID = #{managerId}
+               AND COOPERATIVE_CODE = #{careAgencyCode}
+        ]]>
+     </select>
 </mapper>

+ 12 - 12
src/main/webapp/WEB-INF/jsp/include/sidebar.jsp

@@ -80,22 +80,22 @@
                         <a class="sidebar-link" href="/notice/list">공지사항</a>
                     </li>
                     <c:if test="${data._SES_ID eq 'user'}">
-<%--                         <li class="sidebar-item <c:if test='${data._MENUPATH eq "qna"}'>active</c:if>"> --%>
-<!--                             <a class="sidebar-link" href="/qna/list">의견 게시판</a> -->
-<!--                         </li> -->
+                        <li class="sidebar-item <c:if test='${data._MENUPATH eq "qna"}'>active</c:if>">
+                            <a class="sidebar-link" href="/qna/list">의견 게시판</a>
+                        </li>
                     </c:if>
                     
                     <c:if test="${data._SES_ID eq 'user'}">
-<%--                         <li class="sidebar-item <c:if test='${data._MENUPATH eq "push"}'>active</c:if>"> --%>
-<!--                             <a class="sidebar-link" href="/push/list">푸시 서비스 관리</a> -->
-<!--                         </li> -->
-<%--                         <li class="sidebar-item <c:if test='${data._MENUPATH eq "apiManager"}'>active</c:if>"> --%>
-<!--                             <a class="sidebar-link" href="/apiManager/list">API 서비스 관리</a> -->
-<!--                         </li> -->
+                        <li class="sidebar-item <c:if test='${data._MENUPATH eq "push"}'>active</c:if>">
+                            <a class="sidebar-link" href="/push/list">푸시 서비스 관리</a>
+                        </li>
+                        <li class="sidebar-item <c:if test='${data._MENUPATH eq "apiManager"}'>active</c:if>">
+                            <a class="sidebar-link" href="/apiManager/list">API 서비스 관리</a>
+                        </li>
                         
-<%--                         <li class="sidebar-item <c:if test='${data._MENUPATH eq "role"}'>active</c:if>"> --%>
-<!--                             <a class="sidebar-link" href="/role/list">그룹 권한 관리</a> -->
-<!--                         </li> -->
+                        <li class="sidebar-item <c:if test='${data._MENUPATH eq "role"}'>active</c:if>">
+                            <a class="sidebar-link" href="/role/list">그룹 권한 관리</a>
+                        </li>
                     </c:if>
                 </ul>
             </li>