Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new Markdown query documentation page under Care/Clinical describing a Metabase query to count specific nursing procedures by facility, scoped to an organization and optionally filtered by visit date.
Changes:
- Introduces documentation for “Nursing Procedures Count by Facility” (purpose, parameters, SQL, notes).
- Adds a SQL query that expands questionnaire response JSON to count selected procedure values per facility.
- Documents hardcoded questionnaire/question IDs and Metabase filter usage.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
Suppressed comments (2)
Care/Clinical/nursing_procedures_count_by_facility_kc.md:38
org_idcan return multiple rows (when theexternal_idpredicate is commented out), and theINNER JOIN org_idwill then multiplyfiltered_encountersrows for facilities whosegeo_organization_cacheoverlaps multiple org IDs. That can inflate the downstreamCOUNT(*). Consider aggregating org IDs into a single array row (or usingEXISTS) to avoid join-multiplication while keeping the same filtering behavior.
INNER JOIN org_id
ON facility_facility.geo_organization_cache && ARRAY[org_id.id]::integer[]
Care/Clinical/nursing_procedures_count_by_facility_kc.md:86
- The Notes claim "
organization_idis required" but the SQL currently has theexternal_idpredicate commented out, so the query will run without providingorganization_id. Please update the note to match the current SQL behavior (or instruct readers to uncomment the predicate when they want organization scoping).
- **`organization_id` is required** (no `[[...]]` wrapper) — the query will not run without a value.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.