Closed nataliesus closed 6 days ago
Agh. This is the ripple effect from including exit dates that are greater than ReportEnd in the join to hmis_Exit. They shouldn't be relevant at all, but truncating enrollments based on HMIS participation and operating dates makes a mess.
Where the conditions are mutually exclusive (e,g., 1 requires ExitDate to be null or > ReportEnd and 2 requires ExitDate to be <= ReportEnd), it doesn't matter which one comes first in the code.
I've made a few changes in 3.3.1 -- the most useful is selecting the latest of HMISStart and OperatingStart as pStart (p for project) and the earliest non-null HMISEnd / OperatingEnd as pEnd in the core subquery. It makes applying the rules a lot less messy, and I think it is consistent with the rules defined by the specs, but it is a little further away from perfect symmetry with the way they rules are expressed in the specs.
I have to leave for the airport in about 4 hours, I haven't slept or packed yet., and I want to make sure to get the 3.3.1 issues in the sample code addressed before I go. (I'll be back on Tuesday.)
Hi @MollyMcEvilley ,
How important to follow the priority? If we should keep it, then there is one issue related to the priority order. Spec has a rule with priority 1, but it is the 2nd condition in CASE in the Sample Code. Either Sample Code or Spec should be updated.
The spec has "LSAProjectType = 1 and ExitDate is not null" condition. The Sample Code uses "LSAProjectType = 1 and ExitDate <= ReportEnd" condition. I am thinking about ExitDate > ReportEnd case. Could you please fix either Spec or Sample code?
Priority rule 4: 3.1. According to the Spec, Effective Exit Date must be [MoveInDate + 1 day]. The Sample Code uses dateadd(dd, 1, ExitDate). I understand that we have MoveInDate = ExitDate, but can it be updated for consistency? 3.2. Sample Code uses
ExitDate < ReportEnd
condition which is missing in the Spec.Priority rule 5: 4.1. Sample Code uses
ExitDate <= OperatingEnd
, but Spec usesExitDate < OperatingEndDate
. Looks like Sample Code should be updated. 4.2. Sample Code usesExitDate <= HMISEnd
, but Spec usesExitDate < HMISEnd
. Looks like Sample Code should be updated. 4.3. Sample Code usesExitDate <= ReportEnd
condition which is missing in the Spec.Priority rule 6: Spec uses "ExitDate is null; and OperatingEndDate is null or > ReportEnd; and HMISEnd is NULL". In the Sample Code there are 2 WHENs:
I am not sure the Spec describes what is in the Sample Code because in the Spec "> ReportEnd" is related to the OperatingEndDate , not to the raw ExitDate. Which one if correct?
Thank you! Natalie