-
Notifications
You must be signed in to change notification settings - Fork 1
Add documentation for list of users with manager role assigned to specific organizations #157
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
Open
sonzsara
wants to merge
3
commits into
main
Choose a base branch
from
ENG-971
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
b4cd03e
Add documentation for list of users with manager role assigned to spe…
sonzsara 2245442
Update list_of_users_with_manager_role_assigned_to_specific_organizat…
sonzsara 76adac9
Update list_of_users_with_manager_role_assigned_to_specific_organizat…
sonzsara File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
44 changes: 44 additions & 0 deletions
44
...sation/list_of_users_with_manager_role_assigned_to_specific_organizations_kc.md
This file contains hidden or 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,44 @@ | ||
|
|
||
| # List of Users with Manager Role Assigned to Specific Organizations | ||
|
|
||
| > Staff members with a specific role assignment at a specific organization | ||
|
|
||
| ## Purpose | ||
|
|
||
| Lists users assigned to the manager role (`role_id = 100`) for the selected organization (`organization_id = 101`), including the staff member's display name, organization name, and role name. | ||
|
|
||
| ## Parameters | ||
|
|
||
| | Parameter | Type | Description | Example | | ||
| |-----------|------|-------------|---------| | ||
| | *(none)* | - | Query uses hardcoded role and organization ids | - | | ||
|
|
||
| --- | ||
|
|
||
| ## Query | ||
|
|
||
| ```sql | ||
| SELECT | ||
| TRIM(COALESCE(u.prefix || ' ', '') || u.first_name || ' ' || u.last_name) AS staff_name, | ||
| o.name AS organization_name, | ||
| r.name AS role_name | ||
| FROM emr_organizationuser ou | ||
| INNER JOIN users_user u | ||
| ON u.id = ou.user_id | ||
| INNER JOIN emr_organization o | ||
| ON o.id = ou.organization_id | ||
| AND o.deleted = FALSE | ||
| INNER JOIN security_rolemodel r | ||
| ON r.id = ou.role_id | ||
| WHERE ou.role_id = 100 | ||
| AND ou.organization_id = 101 | ||
| ORDER BY staff_name; | ||
| ``` | ||
|
|
||
| ## Notes | ||
|
|
||
| - **Hardcoded filters:** `ou.role_id = 100` and `ou.organization_id = 101` are fixed in the query. Update these values if you want to inspect a different role or organization. | ||
| - **No Metabase variables:** The query currently has no optional `[[...]]` filters and runs as a static lookup. | ||
| - Results are ordered alphabetically by staff name. | ||
|
|
||
| *Last updated: 2026-08-31* | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.