1 Reply Latest reply on Jul 21, 2009 9:10 AM by etripoli

    Sort script

    mark_d2x

      Title

      Sort script

      Post

      Hi,

       

      I need to auto create a list of patients that are sorted - sounds easy but am struggling here is why:

       

      Variable 1 - ON LIST - parameter needed = Yes

      Variable 2 - SECTION - Parameter - 1 2 3 4

      Variable 3 - Hospital - parameter 1 2

       

      so here is what I need:

       

      Section 1

      Hospital 1

      Hospital 2

       

      Section 2

      Hospital 2

      Hospital 1

       

      Section 3

      Hospital 1

      Hospital 2

       

      Section 4

      Hospital 2

      Hospital 1

       

      So far, I have created a calculation field in the table to give me the values 11, 12, 21, 22, 31, 32, 41, 42.

       

      So for week 1, I need to put the patients into this order 11, 12, 22, 21, 31, 32, 42, 41

       

      For week 2, I need to put the patients into the order 12, 11, 21, 22, 32, 31, 41, 42

       

      What I was going to do was from one of the layouts have 2 buttons - week 1 and week 2, this then runs a script that

       

      Find ONLIST = yes

       

      Sort  either 11, 12, 22, 21, 31, 32, 42, 41 or 12, 11, 21, 22, 32, 31, 41, 42.

       

      How do this?

       

      Mark

        • 1. Re: Sort script
          etripoli
            

          If these values won't change, you'd be able to use two value lists, one with the values defined for week 1, the second for week 2.  Then apply the appropriate value list when sorting on your calculation field.

           

          Perhaps even simplier, sort by section, then hospital, changing the hospital sort between ascending and descending.