Ver código fonte

환자정보 완료

junekeunsong 4 anos atrás
pai
commit
fb5095cac6

+ 13 - 11
src/main/java/com/lemon/lifecenter/controller/PatientController.java

@@ -348,8 +348,10 @@ public class PatientController extends LifeCenterController {
         String operation = dto.getOperation().equals("Y") ? "수술(" + dto.getOperationContent() + ")" : "";
         String allergyCheck = dto.getAllergyCheck().equals("Y") ? "알레르기" : "";
         String kidneyDisease = dto.getKidneyDisease().equals("Y") ? "신장질환" : "";
-        String cancerCheck = dto.getCancerCheck().equals("Y") ? "암(" + dto.getCancerName() + ")" : "";
-        String ectCheckDisease = dto.getEtcCheckDisease().equals("Y") ? "기타(" + dto.getEtcContentDisease() + ")" : "";
+        String cancerName = dto.getCancerName() == null ? "" : dto.getCancerName();
+        String cancerCheck = dto.getCancerCheck().equals("Y") ? "암(" + cancerName + ")" : "";
+        String etcContent = dto.getEtcContentDisease() == null ? "" : dto.getEtcContentDisease();
+        String ectCheckDisease = dto.getEtcCheckDisease().equals("Y") ? "기타(" + etcContent + ")" : "";
         
         ArrayList<String> disease = new ArrayList<String>();
         disease.add(highBloodPressureCheck);
@@ -371,14 +373,12 @@ public class PatientController extends LifeCenterController {
             String str = disease.get(i);
             if (!str.equals("")) {
                 strDisease += str;
-                
-                if (i < disease.size()-2) {
-                    strDisease += ", ";
-                }
+                strDisease += ", ";
             }
         }
         
-        logger.error("!!!!!!!!!!!!!!!!!!!! -- > " + strDisease);
+        strDisease = strDisease.trim();
+        strDisease = strDisease.substring(0, strDisease.length()-1);
         return strDisease;
     }
     
@@ -398,7 +398,8 @@ public class PatientController extends LifeCenterController {
         String headacheCheck = dto.getHeadacheCheck().equals("Y") ? "두통(머리아픔)" : "";
         String dyspneaCheck = dto.getDyspneaCheck().equals("Y") ? "호흡곤란(숨가쁨)" : "";
         String fatigueCheck = dto.getFatigueCheck().equals("Y") ? "권태감(피로감)" : "";
-        String ectCheckSymptom = dto.getEtcCheckSymptom().equals("Y") ? "기타(" + dto.getEtcContentSymptom() + ")" : "";
+        String etcContent = dto.getEtcContentSymptom() == null ? "" : dto.getEtcContentSymptom();
+        String ectCheckSymptom = dto.getEtcCheckSymptom().equals("Y") ? "기타(" + etcContent + ")" : "";
         
         String strSymptom = "";
         ArrayList<String> symptom = new ArrayList<String>();
@@ -423,12 +424,13 @@ public class PatientController extends LifeCenterController {
             String str = symptom.get(i);
             if (!str.equals("")) {
                 strSymptom += str;
-                if (i < symptom.size()-2) {
-                    strSymptom += ", ";
-                }
+                strSymptom += ", ";
             }
         }
         
+        strSymptom = strSymptom.trim();
+        strSymptom = strSymptom.substring(0, strSymptom.length() - 1);
+        
         return strSymptom;
     }
 }