1

Resolved

Extend Family Relationships Beyond "Family Head"

description

Currently, in order for the additional family relationships to work with Check-in, they must be made with the head of the family (family.FamilyHead). We've encountered situations where, for example, our admins put a relationship between the grandmother and the grandchildren and not between the grandfather and the grandchildren, and because grandmother is not the head of the family when she attempts to check in the children they do not appear as options (in fact, because they have no young children they receive the "No Eligible People for CheckIn" message).
 
We are proposing that the GetRelatives method of the CheckInBLL be changed to fetch family members for the first two adults (not just FamilyHead). This will cause slightly decrease performance as an additional person is loaded in order to fetch their relationships.

comments

JasonOffutt wrote Oct 28, 2009 at 6:51 PM

Here's our proposed solution:
    public static FamilyMemberCollection GetRelatives(Family family, int[] relationshipTypeIDs)
    {
        FamilyMemberCollection familyMembers = family.FamilyMembersActive;

        if (relationshipTypeIDs.Length > 0)
        {
            Person head = family.FamilyHead;
            Person spouse = head.Spouse();
            var relationships = from r in head.Relationships.OfType<Relationship>()
                                select r;
            var spouseRelationships = spouse != null ? (from r in spouse.Relationships.OfType<Relationship>()
                                                        select r) : new List<Relationship>();
            relationships = relationships.Concat(spouseRelationships).ToList();

            foreach (var rel in relationships)
            {
                foreach (int i in relationshipTypeIDs)
                {
                    if (rel.RelationshipTypeId != i || familyMembers.FindByID(rel.RelatedPersonId) != null)
                    {
                        continue;
                    }

                    FamilyMember relative = new FamilyMember(rel.RelatedPersonId);

                    if (relative.RecordStatus != Enums.RecordStatus.Inactive)
                    {
                        familyMembers.Add(relative);
                    }
                }
            }
        }

        return familyMembers;
    }

wrote Oct 28, 2009 at 8:17 PM

wrote Nov 16, 2009 at 4:31 PM

wrote Feb 1, 2013 at 3:23 AM

wrote May 14, 2013 at 1:43 AM

wrote May 14, 2013 at 1:43 AM

wrote Jun 12, 2013 at 12:10 AM