-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
backend query insertion cleanup (#101)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
- Loading branch information
1 parent
e2c9aa6
commit 7c56baf
Showing
6 changed files
with
63 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { GroupedValueSet } from "./customizeQuery/customizeQueryUtils"; | ||
|
||
/** | ||
* Utility function to count the number of labs / meds / conditions that we display | ||
* on the customize query page | ||
* @param obj a grouped ValueSet dictionary that we render as an individual accordion | ||
* @returns A count of the number of items in each of the DibbsConceptTypes | ||
*/ | ||
export const countDibbsConceptTypeToVsMapItems = (obj: { | ||
[vsNameAuthorSystem: string]: GroupedValueSet; | ||
}) => { | ||
return Object.values(obj).reduce((runningSum, gvs) => { | ||
gvs.items.forEach((vs) => { | ||
runningSum += vs.concepts.length; | ||
}); | ||
return runningSum; | ||
}, 0); | ||
}; |