HIFIS 4 Logo - With Transparency HIFIS Community
⌘K
Mailing List
Home
Discussion
People
Events
HIFIS Changelog
Known Issues & Ideas
HIFIS Improvement Project
Homelessness Learning Hub
HIFIS Demo Site
Latest Version of HIFIS
Slack Channel
Mailing List
Votes
RB
Ryan Booker
5 months ago
👍
AR
Ali Ryder
5 months ago
👍
Ideas
RB
Ryan Booker
over 1 year ago
Monitoring

Client State Accuracy Impacted by Gaps in ClientIDs

We've observed inconsistencies in client states within HIFIS, for example, some clients are marked as 'Active' despite not receiving services in over 90 days, while others are marked as 'Inactive' even though they still have open case management goals.

In HIFIS, client state is updated by the [dbo].[sp_checkClientState] stored procedure. This procedure can be executed for an individual client or for all clients in the database. When run for all clients, it processes them in sequential batches of 5,000 (e.g., ClientID 1–5,000; 5,001–10,000; etc.).

However, gaps in the ClientID sequence can cause the procedure to skip clients. For example, our database contains a gap between ClientIDs 25,000 and 35,000. As a result, the client state for all clients with a ClientID above 25,000 may not be updated.

Explanation

When processing all clients, the [dbo].[sp_checkClientState] procedure relies on the [dbo].[fn_checkClientStateData] function to retrieve client state data for each batch. If no data is returned for a given batch (e.g., when a gap exists in the ClientID range) the [dbo].[sp_checkClientState] procedure exits early. This prevents the remaining client batches from being evaluated, leading to incomplete or inaccurate client state data.

2
🚦Activity Status 🚨Major 🐛Bug
👍 RB AR
Comments

Please log in or register to post a comment
AR
Ali Ryder 🧑‍💼 Staff

Reported fixed in 4.0.61.1

Reply 5mo ago
AR
Ali Ryder 🧑‍💼 Staff

Ryan: Here is a query to check for gaps in the clientID sequence in the HIFIS_Clients table.

DECLARE @BatchSize INT = 5000;	-- same batch size as sp_CheckClientState procDECLARE @MaxClientID INT-- get the max clientID in databaseSELECT @MaxClientID = MAX(ClientID)FROM HIFIS_Clients;WITH RangesAS (	SELECT 1 AS RangeStart		,@BatchSize AS RangeEnd		UNION ALL		SELECT RangeStart + @BatchSize		,RangeEnd + @BatchSize	FROM Ranges	WHERE RangeEnd <= @MaxClientID	)SELECT CONCAT (		R.RangeStart		,' - '		,R.RangeEnd		) AS ClientBatch	,COUNT(C.ClientID) AS ClientsFROM Ranges RLEFT JOIN HIFIS_Clients C ON C.ClientID BETWEEN R.RangeStart		AND R.RangeEndGROUP BY R.RangeStart	,R.RangeEnd
Reply 5mo ago
HIFIS 4 Logo - With Transparency HIFIS Community
Customer service
Terms and conditions
Copyright © 2026 ACRE Consulting