2 Replies Latest reply: May 28, 2013 12:12 PM by Jasmine Lee-Oracle RSS

    Conditionally Display Entity Question Screens??

    1008148
      Hello,

      I have an entity called 'the household member' which has 1:M relationship from global & it has an attribute called 'the household member is an applicant'.

      I have created an Entity Collection Screen for the household member which collects basic details.
      I have created a further Entity Question Screen for the household member which collects further details.
      I would like to constrain the display of the further Entity Question Screen only to instances for which 'the household member is an applicant' attribute is true.

      Example : 2 household member instances

      household member 1
      Name : John Smith
      is an applicant : true

      household member 2
      Name : Sue Jones
      is an applicant : false

      I would only like to display the Entity Question Screen which collects further details for John Smith. Q. Can anybody advise on how best this could be achieved?

      I have tried creating an inferred relationship as below :

      IsMemberOf(the household member, the household members applicant's) if
      the household member is an applicant

      But I could not add this inferred relationship to the Entity Question Screen i.e the add relationship button could not identify this relationship.

      I don't think this can be achieved through screen order rules because of the 1:M relationship between global and household member.

      Also, Q. Is it correct that inferred relationships have to be declared in the properties file e.g. the household member is both source and target entity with M:M relationship??

      Many Thanks
        • 1. Re: Conditionally Display Entity Question Screens??
          1008148
          Managed to find a solution to this:

          I created an inferred relationship to categorise instances of the household member as applicants as below:

          IsMemberOf(the household member, the applicants) if
          the household member is an applicant

          To do this I created a M:M recursive relationship on the household member in the properties file

          On creating the screen I created a screen attribute which indicates whether the screen has been viewed for the instance, as below

          the screen 'Screen1 Details for %HSEHLDMBR9%' has been displayed for the household member

          I then created two attributes to conditionally display the screen depending on the particular household members instance's membership of the inferred relatiionship, 'the applicants'.

          the screen1 has been shown for the applicants if
          ForAllScope(the household members)
          the screen1 should be displayed for the household member
          or
          IsNotMemberOf(the household member, the household members applicants)

          The ForAllScope function brings into context all the household members, the IsMemberOf and IsNotMemberOf are used to evaluate whether the instance is part of the inferred relationship
          the screen1 should be displayed for the household member if
          IsMemberOf(the household member, the household members applicants)
          and
          the screen 'Screen1 Details for %HSEHLDMBR9%' has been displayed for the household member
          • 2. Re: Conditionally Display Entity Question Screens??
            Jasmine Lee-Oracle
            This seems like an overly complex solution to a reasonably simple situation. If all you want to do is collect some additional data about the household member who is the applicant, you don't need inferred relationships or membership statements or screen attributes. You just need the regular containment relationship (Global --> one-to-many --> the household members) and a procedural rule or two, e.g.

            the interview is complete if
            .....ForAll(the household members, the household member's basic details have been collected)

            the household member's basic details have been collected if
            .....the household member's name is known and
            .....either
            ..........the household member is not the applicant or
            ..........all
            ...............the household member's favourite colour is known and
            ...............the household member's favourite animal is known and
            ...............the household member's favourite holiday destination is known
            ...............(etc)

            If you add the hhm's name and the hhm applicant question to the entity collect screen, then even with just automatic screens after that the interview will then ask about favourite colour, animal, holiday destination -- but only for the household member for whom 'Is the household member the applicant?' = TRUE

            Cheers,
            Jasmine