AnsweredAssumed Answered

Portal Filtering in a Dashboard

Question asked by NaturSalus on Oct 2, 2012
Latest reply on Oct 3, 2012 by NaturSalus

Title

Portal Filtering in a Dashboard

Post

      

     In the Dashboard layout, based on the Dashboard TO, I have a Portal based on the SchedulePatient TO with the following fields:

         
  •           Schedule:ScheduleDate
  •      
  •           

    Schedule:ScheduleYear

         
  •      
  •           

    Schedule:ScheduleMonth

         
  •      
  •           

    Schedule:ScheduleDay

         
  •      
  •           

    Schedule:ScheduleDayOfWeek

         
  •      
  •           

    Schedule:ScheduleTime

         
  •      
  •           

    Patient:NameFirstLast

         

     The established relationships are shown in the attached image.


     I know that some Portal fields look redundant (Schedule:ScheduleYear; Schedule:ScheduleMonth; Schedule:ScheduleDay; Schedule:ScheduleDayOfWeek) but I am still figuring out what is the best way to give the user all the possible filtering options.

      

     No issues with the Portal since it shows the right data.

      

What I want to achieve, and I don't know what is the best way, is to set up multiple filters for the Portal, so that the user has absolute control on what is shown on the Portal.

     The Filter criteria that I want to use are:

         
  •           

                   show data per year

         
  •      
  •           

                   show data per year & month

         
  •      
  •           

                   show data per year & month & day of the week

         
  •      
  •           

                   show data per per date

         
  •      
  •           

                   show data per per date & time

         
  •      
  •           

                   show data per per date & day of the week & time & patient name

         

     To achieve that I thought of setting up a few global fields that would be the ones used by the user to select the: “year, month, date, day of the week, time and patient name” of the records shown on the Portal.

     The following global fields would be created in the Globals table:

         
  •           

    gYear

         
  •      
  •           

    gMonth

         
  •      
  •           

    gDate

         
  •      
  •           

    gDayOfWeek

         
  •      
  •           

    gTime

         
  •      
  •           

    gPatientName

         


      

     Then I though of setting up the following portal filter calculation:

Globals::gYear = Schedule:ScheduleYear or

Globals::gMonth = Schedule:ScheduleMonth or

Globals::gDate = Schedule:ScheduleDate or

Globals::gYear = Schedule:ScheduleYear or

Globals::gDayOfWeek = Schedule:DayOfWeek or

Globals::gTime= Schedule:Time or

Globals::gNameFirstLast= Patient:NameFirstLast


      

     Concerning the Portal Refresh issue, I thought establishing the following cartesian relationships:

         
  •           

                   Schedule::Refresh x SchedulePatient::Refresh

         
  •      
  •           

                   SchedulePatient::Refresh x Patient::Refresh

         


      

     and OnLayoutEnter the Dashboard the following Refresh Cartesian Join script is triggered:

Set Field [Get (Active Field Contents)]

Set Field [Schedule::Refresh;1]

Set Field [SchedulePatient::Refresh;1]


      

     The big question is what is the right context for the filter calculation given that:

         
  1.           

                   the Portal is on the Dashboard layout

         
  2.      
  3.           

                   the Portal is based on the SchedulePatient TO

         


      

     Does it make any sense?


      

     Thanks,

     natursalus

relationship.jpg

Outcomes