There's a bug in the Coordinated Access view having to do with families. It includes all group types and past group members instead of just limiting to present ones.
Here's the current code:
SELECT * FROM (SELECT people.PersonID, pg.GroupID, pg.GroupHeadYN, pg.DateStart,ROW_NUMBER() OVER(PARTITION BY people.PersonID ORDER BY pg.DateStart DESC) AS GroupRN
FROM HIFIS_People AS people
INNER JOIN HIFIS_People_Groups AS pg ON people.PersonID = pg.PersonID) groupsWithRN
WHERE groupsWithRN.GroupRN = 1) personRecentGroupHere's what it should be:
SELECT * FROM (SELECT people.PersonID, pg.GroupID, pg.GroupHeadYN, pg.DateStart,ROW_NUMBER() OVER(PARTITION BY people.PersonID ORDER BY pg.DateStart DESC) AS GroupRN
FROM HIFIS_People AS people
INNER JOIN HIFIS_People_Groups AS pg ON people.PersonID = pg.PersonID
INNER JOIN HIFIS_Groups AS g ON pg.GroupID = g.GroupID
WHERE g.GroupTypeID = 1 -- you need to only include family group types
AND pg.DateEnd IS NULL -- you need to only include current group memberships) groupsWithRN
WHERE groupsWithRN.GroupRN = 1) personRecentGroup
Series of related issues:
Duplicate clients in CA module (Income)
Duplicate Clients in CA module (First Episode)
Duplicate Clients in CA module (Families)
Duplicate Clients in CA module (Consent)
Bug in Coordinated Access: First Episode
Bug in Coordinated Access (Families)
Fixed in 4.0.59.6