3 Replies Latest reply on Dec 21, 2016 9:28 AM by avallejo

    Case troubles.

    stereophonic

      Title

      Case troubles.

      Post

           Hi,

           I'm rather new to FMP and I’m having trouble getting the case function to work. I’m not sure what I’m doing incorrectly.
           This is designed to stage lung cancer based on TNM results.
           See http://www.cancerstaging.org/staging/posters/lung8.5x11.pdf

           At the moment it seems to display the correct result when T2a, and T2b are selected with N0 and M0, other combinations result in 0


           Any help would be greatly appreciated.

           Case(
           (Clinical T = ("T1a" or "T1b") and Clinical N = "N0" and Clinical M = "M0") ;
           "Stage IA" ;

           (Clinical T = "T2a" and Clinical N = "N0" and Clinical M = "M0") ;
           "Stage IB" ;

           (Clinical T = ("T1a" or "T1b" or "T2a") and Clinical N = "N1" and Clinical M = "M0") ;
           "Stage IIA" ;

           (Clinical T = ("T2b") and Clinical N = "N0" and Clinical M = "M0") ;
           "Stage IIA" ;

           (Clinical T = "T2b" and Clinical N = "N1" and Clinical M = "M0") ;
           "Stage IIB" ;

           (Clinical T = "T3" and Clinical N = "N0" and Clinical M = "M0") ;
           "Stage IIB" ;

           (Clinical T = ("T1a" or "T1b" or "T2a" or "T2b") and Clinical N = "N2" and Clinical M = "M0") ;
           "Stage IIIA" ;

           (Clinical T = "T3" and Clinical N = ("N1" or "N2") and Clinical M = "M0") ;
           "Stage IIIA" ;

           (Clinical T = "T4" and Clinical N = ("N0" or "N1") and Clinical M = "M0") ;
           "Stage IIIA" ;

           (Clinical T = "T4" and Clinical N = "N2" and Clinical M = "M0");
           "Stage IIIB" ;

           (Clinical T = ("T1a" or "T1b" or "T2a" or "T2b" or "T3" or "T4") and Clinical N = "N3" and Clinical M = "M0") ;
           "Stage IIIB" ;

           (Clinical T = ("T1a" or "T1b" or "T2a" or "T2b" or "T3" or "T4") and Clinical N = ("N0" or "N1" or "N2" or "N3") and Clinical M = ("M1a" or "M1b"))

           )

        • 1. Re: Case troubles.
          Jade

               Hi Alister,

               I think the first and subseqent statements should be expanded to work correctly:

               i.e.

               Case(

               (Clinical T = "T1a" or Clinical T = "T1b") and Clinical N = "N0" and Clinical M = "M0" ;

               …

               )

                

               The way you have it,  ("T1a" or "T1b") will always result in True (1) and I would guess that Clincai T = 1 never occurs.

               I also noticed that the last line that ends with …("'M1a" or "M1b")) is not followed by the result (e.g. " ; "Stage IIIC").  And there is no default result included.  The default result is optional but may help simplify your Case statement.

               You may be able to simplify the case statement  further although it would take more thought than I have time for at the moment.

          • 2. Re: Case troubles.
            stereophonic

                 Hey Jade,

                 That works a treat! Thanks very much for your answer.

                  

            • 3. Re: Case troubles.
              avallejo

              Hi.

              I'm trying to accomplish the same for breast cancer staging...if you have succeeded with the function, would you care to share the finished version, so I could adapt it to my database?

              Best,

              Andre Silva