Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new markdown query documentation page for reporting the count of completed “Doctor with Community Nurse” questionnaire responses, grouped by facility and scoped to patients in an organization (Karunashraya / KC context).
Changes:
- Introduces a new documented SQL query for counting completed “Doctor with Community Nurse” visits by facility.
- Documents Metabase parameters (
organization_id,date) and includes notes on hardcoded questionnaire IDs.
💡 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 (3)
Care/Operations/doctor_with_community_nurse_visit_count_by_facility_kc.md:8
- The short description and purpose state the query is scoped to a specific organization and to “living patients”, but the SQL currently has the organization filter commented out and does not filter patient living status. Please update the documentation text to match the actual query behavior (or explicitly mention that organization scoping requires un-commenting the filter).
> Count of completed doctor visits accompanied by a community nurse, grouped by facility for patients belonging to a given organization
## Purpose
Counts completed responses to the doctor visit questionnaire (`questionnaire_id = 68`) where the visit type is `'Doctor with Community Nurse'`, per facility, scoped to living patients within a specified organization.
Care/Operations/doctor_with_community_nurse_visit_count_by_facility_kc.md:14
organization_idis described as scoping patients, but (when enabled) the filter is applied onemr_organization.external_idand used viafacility_facility.geo_organization_cacheto scope facilities/encounters. Adjust the parameter description to match what the SQL actually scopes.
| `organization_id` | TEXT | Organization external ID to scope patients (matched against `emr_organization.external_id`) | `'org-uuid-1234'` |
Care/Operations/doctor_with_community_nurse_visit_count_by_facility_kc.md:76
- The Notes section says
organization_idis required and the query will not run without it, but theorganization_idpredicate is currently commented out in the SQL. Update the note to reflect the current behavior and how to enable 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.