5 Replies Latest reply on Oct 29, 2016 9:38 AM by SteveMartino

    Having a problem with Auto Enter Calculation and number of digits returned

    teks4u

      Using a case statement for a health application that I've been working on and everything works correctly except the last case statement.

       

      Code:

       

      Case (Historical Systolic BP 1   ≥ "180"  or Historical Diastolic BP 1  ≥  "110" ; "Critical" ;

       

       

      Historical Systolic BP 1    ≥   "140"  or Historical Diastolic BP 1    ≥   "90" ; "High";

       

       

      Historical Systolic BP 1    =   "139"  or Historical Diastolic BP 1    =   "89"; "Elevated";

       

       

      Historical Systolic BP 1    ≥   "120"  or Historical Diastolic BP 1    ≥   "80" ; "Elevated";

       

       

      Historical Systolic BP 1      ≤      "119" and Historical Diastolic BP 1    ≤  "79"; "Normal";

       

       

      Self)

      ___________________________________________________________________________________________

       

      Everything works perfectly and I get the BP Status to show perfectly when I enter values according to my Adult Blood Pressure Levels Key, until I get to a 2 digit number in the Diastolic.  When I enter a below 2 digits in the Diastolic the BP Status jumps to critical, which it should not.

       

      I have to put a leading zero  to make the calculation work correctly. If I enter 3 digits in the Diastolic everything works correctly.

       

      Code:

       

      Case (Historical Systolic BP 1   ≥ "180"  or Historical Diastolic BP 1  ≥  "110" ; "Critical" ; - works correctly

       

       

      Historical Systolic BP 1    ≥   "140"  or Historical Diastolic BP 1    ≥   "90" ; "High"; - works correctly

       

       

      Historical Systolic BP 1    =   "139"  or Historical Diastolic BP 1    =   "89"; "Elevated"; - works correctly

       

       

      Historical Systolic BP 1    ≥   "120"  or Historical Diastolic BP 1    ≥   "80" ; "Elevated"; - works correctly

       

       

      Historical Systolic BP 1      ≤      "119" or Historical Diastolic BP 1    ≤  "79"; "Normal"; - this is where the issue comes in

       

       

      Self)

      ___________________________________________________________________________________________

       

      Screen Shot 2016-10-28 at 9.05.00 PM.png

       

      This is what the screen looks like when I enter a 2 digit number. The BP Status goes to Critical and it should be normal.

       

       

      The only way I can get it to work properly is to put a leading Zero (So it reads 070) and then the BP Status will read normal as it should.

       

      Screen Shot 2016-10-28 at 8.31.56 PM.png

       

      Not sure what to do to make the calculation work properly.

       

      Almost done with this project and just need to get this resolved before Tuesday. Any help would be greatly appreciated.