Wakemed Operations uses MyChart consent workflows for proxy access, releases, research participation, and interpreter-supported communications. Write a PostgreSQL query to identify the five workflows with the highest failure rates for selected patient segments.
Requirements
- Include only attempts from the
pediatric_proxy, limited_english, and older_adult segments between 2025-01-01 inclusive and 2025-04-01 exclusive.
- Calculate total attempts, failed attempts, and failure rate percentage for each workflow.
- Exclude workflows with fewer than two qualifying attempts.
- Return the top five workflows, ordered by failure rate descending, failed attempts descending, and workflow name ascending to break ties.