-
Notifications
You must be signed in to change notification settings - Fork 242
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
(fix) O3-4045: Display only tests with results in result viewer #2049
base: main
Are you sure you want to change the base?
Conversation
Thanks, @makombe. Do you mind updating the description to clearly indicate what this PR addresses? You can also mention the status before and after, and the limitations of the previous approach. Asante |
Done. Thanks |
Thank you |
} else if (!node?.subSets?.length && node.obs?.length > 0) { | ||
// Treat the current node as a leaf and a test | ||
leaves.push(node.flatName); | ||
tests.push([node.flatName, node]); | ||
|
||
// Add the current node to the lowest parents list | ||
lowestParents.push({ flatName: node.flatName, display: node.display }); |
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.
Couldn't this have been an else on the following block?
@@ -67,7 +67,8 @@ const FilterNodeParent = ({ root, itemNumber }: filterNodeParentProps) => { | |||
const tablet = useLayoutType() === 'tablet'; | |||
const [expandAll, setExpandAll] = useState<boolean | undefined>(undefined); | |||
|
|||
if (!root.subSets) return; | |||
// Filter out root nodes without data | |||
if (!root.subSets || !root.subSets.some((node) => node.hasData || node.subSets)) return null; |
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.
Does this work for a root that has subSets with subSets, but those grandchildren have no data?
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.
Let me do this recursively.
@@ -103,6 +104,11 @@ const FilterNode = ({ root, level, open }: FilterNodeProps) => { | |||
const indeterminate = isIndeterminate(parents[root.flatName], checkboxes); | |||
const allChildrenChecked = parents[root.flatName]?.every((kid) => checkboxes[kid]); | |||
|
|||
// Filter out nodes that don't have data or don't have children with data | |||
if (!root.hasData && (!root.subSets || !root.subSets.some((subNode) => subNode.hasData || subNode.subSets))) { |
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.
Again, this only looks like it works at one level of depth.
@@ -129,14 +135,17 @@ const FilterNode = ({ root, level, open }: FilterNodeProps) => { | |||
|
|||
const FilterLeaf = ({ leaf }: FilterLeafProps) => { | |||
const { checkboxes, toggleVal } = useContext(FilterContext); | |||
|
|||
// Filter out leaves without data | |||
if (!leaf.hasData) return null; |
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.
if (!leaf.hasData) return null; | |
if (!leaf.hasData) { | |
return null; | |
} |
@ibacher I have made some adjustments, please you can re-review. Thanks |
Please provide a short video or screenshot. |
@ojwanganto The screenshot remains the same as one already shared above. Thanks |
Thanks |
ping @makombe please resolve the conflicts. cc @ibacher @denniskigen for a second review. |
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.
Thanks @makombe , kindly fix the conflicts
Requirements
Summary
Currently all configured test whether individual or convset will be shown. The ask here is to only show test ordered for a patient and has results.
This will:
Screenshots
Before:
After:
Screencast from 01-10-2024 12:49:24 ALASIRI.webm
Related Issue
https://openmrs.atlassian.net/browse/O3-4045
Other