Bladeren bron

[진료관리 - 상세] 혈압/맥박 valid 체크 미입력과 기타 오류 구분하여 처리.

(cherry picked from commit 5ffa772516ca12c4e9bbe1b0afa5cf28a2e109d2)
sjpark 4 jaren geleden
bovenliggende
commit
09b4e345c5
1 gewijzigde bestanden met toevoegingen van 31 en 14 verwijderingen
  1. 31 14
      src/main/webapp/WEB-INF/jsp/clinic/info.jsp

+ 31 - 14
src/main/webapp/WEB-INF/jsp/clinic/info.jsp

@@ -201,28 +201,45 @@ function handlePhrData() {
     }
     // 수축기 F 이완기 F
     else if (errorMessage1 && errorMessage2) {
-      // 맥박 F
-      if (errorMessage3) {
-        alert(errorMessage1);
-			  $("#phrValueSystolic").focus();
-			  return;
+
+      // 미입력 에러
+	    if ((!phrValueSystolic || phrValueSystolic.length === 0) && (!phrValueDiastolic || phrValueDiastolic.length === 0)) {
+        // 맥박 F
+        if (errorMessage3) {
+          alert(errorMessage3);
+          $("#phrValuePulseRate").focus();
+          return;
+        }
+        // 맥박 S
+        else {
+          // 맥박만 저장
+          createPhrData(mPatientIdx, "pulseRate", recordedDate, phrValuePulseRate);
+        }
       }
-      // 맥박 S
+      // min max 오류
       else {
-        // 맥박만 저장
-        createPhrData(mPatientIdx, "pulseRate", recordedDate, phrValuePulseRate);
+        if (errorMessage1) {
+          alert(errorMessage1);
+          $("#phrValueSystolic").focus();
+          return;
+        }
       }
     }
     // 수축기 S 이완기 S
     else if (!errorMessage1 && !errorMessage2) {
       // 맥박 F
       if (errorMessage3) {
-        // alert(errorMessage3);
-			  // $("#phrValuePulseRate").focus();
-			  // return;
-
-        // 혈압만 저장
-        createPhrData(mPatientIdx, "bloodPressure", recordedDate, phrValueSystolic, phrValueDiastolic);
+        // 미입력 오류
+        if (!phrValuePulseRate || phrValuePulseRate.length === 0) {
+          // 혈압만 저장
+          createPhrData(mPatientIdx, "bloodPressure", recordedDate, phrValueSystolic, phrValueDiastolic);
+        }
+        // min max 오류
+        else {
+          alert(errorMessage3);
+			    $("#phrValuePulseRate").focus();
+			    return;
+        }
       }
       // 맥박 S
       else {