Skip to content

Add documentation for Doctor with Community Nurse Visit Count by Facility query - #134

Open
sonzsara wants to merge 4 commits into
mainfrom
ENG-759
Open

Add documentation for Doctor with Community Nurse Visit Count by Facility query#134
sonzsara wants to merge 4 commits into
mainfrom
ENG-759

Conversation

@sonzsara

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread Care/Operations/doctor_with_community_nurse_visit_count_by_facility_kc.md Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_id is described as scoping patients, but (when enabled) the filter is applied on emr_organization.external_id and used via facility_facility.geo_organization_cache to 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_id is required and the query will not run without it, but the organization_id predicate 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants