Skip to content

Add documentation for Total Doctor Visit Count by Facility query - #133

Open
sonzsara wants to merge 3 commits into
mainfrom
ENG-757
Open

Add documentation for Total Doctor Visit Count by Facility query#133
sonzsara wants to merge 3 commits into
mainfrom
ENG-757

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 documentation page for a Metabase/SQL analytics query that reports completed “doctor visit” questionnaire responses grouped by facility, scoped to patients in a specific organization.

Changes:

  • Introduces a new query doc: Total Doctor Visit Count by Facility
  • Documents parameters (organization_id, date) and includes the SQL used to generate the metric
  • Adds notes about hardcoded questionnaire ID and result ordering

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Care/Operations/total_doctor_visit_count_by_facility_kc.md

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/total_doctor_visit_count_by_facility_kc.md:72

  • The documentation says organization_id is required and the query will not run without it, but the only {{organization_id}} predicate is currently commented out. Update the note to reflect the current SQL (or uncomment the predicate if the intention is to require scoping).
- **`organization_id` is required** (no `[[...]]` wrapper) — the query will not run without a value.

Care/Operations/total_doctor_visit_count_by_facility_kc.md:8

  • Purpose claims the query is scoped to living patients, but the SQL never joins to a patient table or filters on a "deceased"/"deceased_datetime" field. This makes the documentation inaccurate; either add the living-patient filter in SQL or remove the claim from the Purpose section.
Counts completed responses to the doctor visit questionnaire (`questionnaire_id = 68`) per facility, scoped to living patients within a specified organization.

Care/Operations/total_doctor_visit_count_by_facility_kc.md:65

  • The Notes say results are ordered by visit count descending (then facility name for ties), but the SQL orders only by facility name. Update the ORDER BY clause to match the documented behavior (or adjust the note if alphabetical order is intended).
GROUP BY facility_facility.name
ORDER BY facility_facility.name;

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