-
Notifications
You must be signed in to change notification settings - Fork 0
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
Conversation
@@ -109,21 +106,6 @@ const EditHouseholdMemberTable = ({ | |||
}); | |||
}, [currentMembers]); | |||
|
|||
// If new members have beed added highlight their relationship field if it's DNC |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whiteSpace='nowrap' | ||
/> | ||
))} | ||
{hh.householdClients.map((c) => |
There was a problem hiding this comment.
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:
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
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this 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') { |
There was a problem hiding this comment.
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')
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In practice, its' the picklist that appears when you are enrolling a new client: https://github.com/greenriver/hmis-warehouse/blob/24060527d5f707d337e36894f213b181df7dcfc6/drivers/hmis/lib/form_data/default/fragments/new_enrollment_details.json#L53
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
Checklist before requesting review