HMIS / LSASampleCode

Longitudinal System Analysis (LSA) Sample Code and Documentation
22 stars 10 forks source link

10.18 bug causing Flag 1327-1 DQ Destination #1198

Closed eccovia-csmith closed 11 months ago

eccovia-csmith commented 11 months ago

It appears that there is an inconsistency in the programming of 10.18 in relation to 10.11. Flag 1327-1 appears to be comparing counts between these two calculated ReportRows (912 & 919). 10.11 Looks at Enrollments which are active and ExitDate <= ReportEnd. Though 10.18 joins to hmis_Exit but does not have a clause for where ExitDate <= ReportEnd so Row 919 can have a larger count than 912 when there are Exits after the ReportEnd. When populating Enrollment.ExitDate we join in hmis_Exit where ExitDate <= ReportEnd. I would presume since we are working with the raw hmis data for the DQ measure we should also apply the same rules when comparing to another set of data based on these rules. Due to this error in the programming we are seeing CoCs get Flag 1327-1 which is a vendor issue.

https://github.com/HMIS/LSASampleCode/blob/62cffc25e694cf59bbe1064c5c22b463863f41e6/10%20LSACalculated%20Data%20Quality.sql#L341C21-L341C21

MollyMcEvilley commented 11 months ago

I might be missing something, but I don't see how it would be possible for the sample code to produce larger numbers for row 919 (DQ for Destination) than for row 912 (count of client exits).

image The count for 912 is limited to tlsa_Enrollment.ExitDate <= ReportEnd and tlsa_Enrollment.Active = 1. The count for 919 has the same limitations, PLUS there must be an hmis_Exit record (it is possible to have a tlsa_Enrollment.ExitDate even if there is no hmis_Exit record), AND the Destination/DestinationSubsidyType must meet specific criteria. image

As I said, it is totally possible that there's something here that I'm overlooking -- can you see a way that the criteria for 919 are broader than those for 912?

eccovia-csmith commented 11 months ago

You're right. For some reason even though I started with the sample code for 10.18, I had n.EntryDate <= rpt.ReportEnd which is the very definition of a vendor issue. I have corrected this on my end and does not appear to be an issue with the sample code. Sorry for the confusion, thanks for the clarification.