Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove 99 from Relationship to HoH picklist #1014

Merged
merged 7 commits into from
Jan 10, 2025

Conversation

gigxz
Copy link
Collaborator

@gigxz gigxz commented Dec 31, 2024

Description

Remove Data Not Collected as an option when selecting the Relationship To HoH for a new or existing Enrollment. 99 is not a valid selection per the HUD HMIS data dictionary. However it is valid per the CSV Export, so we retain it as a valid option for display only.

Testing instructions are on the issue https://github.com/open-path/Green-River/issues/7127

Related Warehouse PR (Does not depend on): greenriver/hmis-warehouse#5028

Type of change

  • Bug fix / HUD Compliance fix

Checklist before requesting review

  • I have performed a self-review of my code
  • I have run the code that is being changed under ideal conditions, and it doesn't fail
  • My code includes comments and/or descriptive variable names to help other engineers understand the intent (or not applicable)
  • My code follows the style guidelines of this project (eslint)
  • I have updated the documentation (or not applicable)
  • If it's not obvious how to test this change, I have provided testing instructions in this PR or the related issue

@gigxz gigxz changed the base branch from release-146 to release-147 January 9, 2025 17:39
@@ -109,21 +106,6 @@ const EditHouseholdMemberTable = ({
});
}, [currentMembers]);

// If new members have beed added highlight their relationship field if it's DNC
Copy link
Collaborator Author

@gigxz gigxz Jan 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is no longer needed, because it's not permitted to add a household member without specifying a valid RelationshipToHoH.

The existing "highlight" behavior is retained whereby when you change the HoH, the RelationshipToHoH field for other members is highlighted, to indicate that you should review those and update them if they are no longer accurate.

Screenshot 2025-01-10 at 9 57 09 AM

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, I like the new inference behavior. There are still some edge cases with inference that I guess we might refine later. For example, in a household like this:

  • A, HoH
  • B, Spouse
  • C, Other Relative

When changing HoH from A to C, B stays marked as "Spouse" but should probably be inferred to now be "Other Relative." I think this is not in scope for this PR though - looks like that would be a backend change.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@martha Good point, it would be possible to make some additional inferences! Currently the highlight is supposed to nudge the user to review those, and I think it's OK to stick to that existing behavior for now.

? HmisEnums.RelationshipToHoH[value]
: 'Select relationship',
}}
textInputProps={{ placeholder: 'Select Relationship', ...textInputProps }}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If an existing Enrollment has null or 99 for Relationship To HoH, it appears like this on the Enrollment dashboard Household tab:

Screenshot 2025-01-10 at 9 59 43 AM

And Edit Household:

Screenshot 2025-01-10 at 9 59 08 AM

@gigxz gigxz changed the title Remove 99 from relationship picklist Remove 99 from Relationship to HoH picklist Jan 10, 2025
@gigxz gigxz marked this pull request as ready for review January 10, 2025 15:06
@gigxz gigxz requested review from ttoomey and martha January 10, 2025 15:08
whiteSpace='nowrap'
/>
))}
{hh.householdClients.map((c) =>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gigxz could you give more info about why you reverted this? I'm seeing missing "Data Not Collected" info on the table:
Screenshot 2025-01-10 at 2 31 45 PM

Edit: It looks like this would be resolved in the Tables deploy branch, anyway: https://github.com/greenriver/hmis-frontend/pull/1020/files#diff-819ec0ace67cab35cca989ef6e3f3d5a6187dec26e6dcbcb1d4090614788a6c5R43-R53

Copy link
Collaborator Author

@gigxz gigxz Jan 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't change the current behavior here, enrollments with null/99 relationship to hoh still appear like they do in your screenshot (confirmed in staging environments which appear the same). On a previous version I had removed DataNotCollected from the Enum entirely, which is why you see that commit history, but I reverted that change.

@@ -109,21 +106,6 @@ const EditHouseholdMemberTable = ({
});
}, [currentMembers]);

// If new members have beed added highlight their relationship field if it's DNC
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, I like the new inference behavior. There are still some edge cases with inference that I guess we might refine later. For example, in a household like this:

  • A, HoH
  • B, Spouse
  • C, Other Relative

When changing HoH from A to C, B stays marked as "Spouse" but should probably be inferred to now be "Other Relative." I think this is not in scope for this PR though - looks like that would be a backend change.

Copy link
Contributor

@ttoomey ttoomey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

export const localResolvePickList = (
pickListReference: string,
excludeDataNotCollected = false
): PickListOption[] | null => {
if (isHmisEnum(pickListReference)) {
let values = Object.entries(HmisEnums[pickListReference]);
if (excludeDataNotCollected) {

if (excludeDataNotCollected || pickListReference === 'RelationshipToHoH') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice docs!
Rather than hard-coding this in the utility fn, would it be much more trouble to make this the caller's responsibility?

localResolvePickList(pickListReference, pickListReference === 'RelationshipToHoH')

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, the issue is that when a DynamicForm renders an item with picklist reference RelationshipToHoH, we also want to exclude 99 from that list. DynamicField uses the usePickList hook to resolve pick lists, which in turn uses localResolvePickList. So I figured it makes more sense to just hard-code it into the local resolution logic, rather than passing it through from multiple callers.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gigxz gigxz merged commit f10d4fe into release-147 Jan 10, 2025
3 checks passed
@gigxz gigxz deleted the gig/7127-disallow-99-relationship branch January 10, 2025 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants