Phase 3: ILP Generator
Overview
Duration: ~2 weeks (60-80 hours)
Goal: Residents can view enhanced personal dashboard with trajectory charts and AI summaries, and download a pre-populated ILP Word document.
Demo: Resident views trajectory, sees comment summaries, clicks button, downloads Word doc with their data pre-filled.
Prerequisites: Phase 2 complete (RBAC working, resident dashboard exists)
Timeline
Week 6 Week 7
├───────────────────────────────────┼───────────────────────────────────┤
│ Day 1-2 │ Day 3-4 │ Day 5 │ Day 1-2 │ Day 3-4 │ Day 5 │
│ Trajectory │ AI │ ILP │ Word Doc │ Pre-pop │ Testing │
│ Charts │ Comments │ Schema │ Generator │ + Polish │ + Demo │
├────────────┼───────────┼─────────┼────────────┼───────────┼──────────┤
│ 12h │ 12h │ 8h │ 12h │ 8h │ 8h │
└────────────┴───────────┴─────────┴────────────┴───────────┴──────────┘
▲
DEMO 3
(FINAL DEMO)
User Stories
| ID | Story | Acceptance Criteria |
|---|
| US-3.1 | As a resident, I can view my competency trajectory over time | Line chart showing scores over evaluation dates |
| US-3.2 | As a resident, I can see how I compare to expected levels for my PGY | Visual indicator of expected vs actual |
| US-3.3 | As a resident, I can see AI-generated summaries of feedback comments | Strengths and areas for growth sections |
| US-3.4 | As a resident, I can download a Word doc ILP pre-filled with my data | Button click → .docx download |
| US-3.5 | As a resident, I see reflection prompts appropriate to my training level | PGY-specific prompts in ILP template |
Epic 3.1: Personal Dashboard Enhancements (AIM 1 - Full)
Estimated Time: 28 hours
| Task ID | Task | Description | Hours | Dependencies |
|---|
| 3.1.1 | Trajectory Data API | GET /api/me/trajectory returns time-series data | 4h | Phase 2 |
| 3.1.2 | Trajectory Visualization | Line chart showing scores over time (Chart.js or similar) | 8h | 3.1.1 |
| 3.1.3 | Expected Level Data | Define expected scores by PGY level per form | 4h | None |
| 3.1.4 | Expected Level Comparison | Visual overlay showing expected vs actual | 4h | 3.1.2, 3.1.3 |
| 3.1.5 | AI Comments Adaptation | Adapt existing AI system for OB-GYN data format | 6h | Phase 1 |
| 3.1.6 | Comment Summaries View | Display AI summaries (strengths, growth areas) | 4h | 3.1.5 |
Trajectory Visualization Wireframe
┌─────────────────────────────────────────────────────────────────┐
│ My Progress - Milestones │
├─────────────────────────────────────────────────────────────────┤
│ │
│ Score │
│ 5 ┤ ╭──● Current │
│ │ ╭────╯ │
│ 4 ┤ ╭────╯ │
│ │ ╭────╯ - - - Expected (PGY-3) │
│ 3 ┤ ╭────╯ │
│ │ ╭────╯ │
│ 2 ┤╭────╯ │
│ │ │
│ 1 ┼──────┬──────┬──────┬──────┬──────┬──────┬──────┬────► │
│ │ Jul │ Aug │ Sep │ Oct │ Nov │ Dec │ Jan │ Time │
│ │ '24 │ '24 │ '24 │ '24 │ '24 │ '24 │ '25 │ │
└─────────────────────────────────────────────────────────────────┘
│ ● Your average score - - - Expected for PGY-3 │
└─────────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────────┐
│ Feedback Summary (based on 47 evaluations) │
├─────────────────────────────────────────────────────────────────┤
│ │
│ ✓ STRENGTHS │
│ ─────────── │
│ • Strong clinical knowledge and patient rapport │
│ • Consistently prepared and punctual │
│ • Effective communication with nursing staff │
│ │
│ ↗ AREAS FOR GROWTH │
│ ────────────────── │
│ • Continue developing surgical autonomy │
│ • Work on efficiency in high-volume clinic settings │
│ │
│ 📊 Based on comments from Jul 2024 - Jan 2025 │
└─────────────────────────────────────────────────────────────────┘
Epic 3.2: ILP Template System (AIM 2)
Estimated Time: 32 hours
| Task ID | Task | Description | Hours | Dependencies |
|---|
| 3.2.1 | ILP Schema Design | Define template sections based on OB-GYN requirements | 4h | None |
| 3.2.2 | Reflection Prompts Table | Create DB table for PGY-specific prompts | 2h | None |
| 3.2.3 | Seed Prompts | Load prompts from research team | 2h | 3.2.2 |
| 3.2.4 | Data Pre-population Service | Gather all learner data for ILP | 6h | Phase 2, 3.1.6 |
| 3.2.5 | Word Doc Generator | python-docx template and generation logic | 10h | 3.2.1 |
| 3.2.6 | ILP Download Endpoint | GET /api/me/ilp/download returns .docx | 4h | 3.2.4, 3.2.5 |
| 3.2.7 | Download Button UI | Add button to resident dashboard | 2h | 3.2.6 |
| 3.2.8 | Integration Testing | End-to-end ILP generation test | 2h | All above |
ILP Template Structure
Based on OB-GYN’s existing ILP format (Appendix 1 of proposal):
┌─────────────────────────────────────────────────────────────────┐
│ INDIVIDUALIZED LEARNING PLAN │
│ [Resident Name] │
│ Date: [Generated Date] │
├─────────────────────────────────────────────────────────────────┤
│ │
│ CLINICAL │
│ ──────── │
│ Milestone Summary: [Auto-populated table of recent scores] │
│ Procedure Summary: [Auto-populated procedure counts/scores] │
│ │
│ Feedback Highlights: │
│ • [AI-generated strength 1] │
│ • [AI-generated strength 2] │
│ • [AI-generated growth area 1] │
│ │
│ ☐ Case Log Reviewed │
│ ☐ MedHub Reports Reviewed │
│ │
│ QUALITY IMPROVEMENT │
│ ─────────────────── │
│ IHI Module: ☐ Completed ☐ Not Completed │
│ QI Project: ________________________________ │
│ │
│ RESEARCH │
│ ──────── │
│ 1. _______________________________________________ │
│ 2. _______________________________________________ │
│ │
│ TEACHING │
│ ──────── │
│ Medical Student Evaluations: [Auto-populated if available] │
│ │
│ EXAMINATIONS │
│ ──────────── │
│ CREOG Score: [Auto-populated if available, else blank] │
│ Step 3: ☐ Completed ☐ Not Completed │
│ │
│ GOALS │
│ ───── │
│ [Reflection prompt based on PGY level] │
│ │
│ Professional: │
│ 1. _______________________________________________ │
│ 2. _______________________________________________ │
│ │
│ Clinical/Skills: │
│ 1. _______________________________________________ │
│ 2. _______________________________________________ │
│ │
│ Personal: │
│ 1. _______________________________________________ │
│ │
└─────────────────────────────────────────────────────────────────┘
Reflection Prompts by PGY Level
PGY-1:
"As a first-year resident, reflect on your transition to residency.
What clinical skills have you developed? What areas feel most
challenging? Consider specific patient encounters that shaped your
learning this period."
PGY-2:
"As you gain more autonomy, reflect on your growing independence.
Where do you feel confident making decisions? Where do you still
seek guidance? What procedures are you ready to lead?"
PGY-3:
"As a senior resident, reflect on your leadership development.
How are you teaching junior residents? What subspecialty interests
are emerging? How are you preparing for independent practice?"
PGY-4:
"As you approach graduation, reflect on your readiness for practice.
What are your career goals? What final skills do you want to
solidify? How will you continue your learning journey?"
Epic 3.3: Future/Budget Items
| Task ID | Task | Description | Priority |
|---|
| 3.3.1 | Configurable Prompts | Admin UI for programs to define own prompts | Future |
| 3.3.2 | Additional Data Fields | Integrate exam scores, attendance if available | Future |
| 3.3.3 | ILP Versioning | Save generated ILPs for historical tracking | Future |
| 3.3.4 | PDF Export Option | Alternative to Word doc | Future |
| 3.3.5 | Faculty Review Workflow | Faculty can view/comment on resident ILPs | Future |
Technical Implementation
python-docx Template Approach
from docx import Document
from docx.shared import Inches, Pt
from docx.enum.text import WD_ALIGN_PARAGRAPH
def generate_ilp(learner_data: dict) -> Document:
doc = Document()
# Title
title = doc.add_heading('Individualized Learning Plan', 0)
title.alignment = WD_ALIGN_PARAGRAPH.CENTER
# Resident info
doc.add_paragraph(f"Resident: {learner_data['name']}")
doc.add_paragraph(f"PGY Level: {learner_data['pgy_level']}")
doc.add_paragraph(f"Date: {learner_data['generated_date']}")
# Clinical section with auto-populated table
doc.add_heading('Clinical', level=1)
add_milestone_table(doc, learner_data['milestones'])
# Feedback highlights
doc.add_heading('Feedback Highlights', level=2)
for strength in learner_data['strengths']:
doc.add_paragraph(f"• {strength}", style='List Bullet')
# Reflection prompts
doc.add_heading('Goals', level=1)
doc.add_paragraph(learner_data['reflection_prompt'])
# Blank goal fields
doc.add_paragraph("Professional Goals:")
doc.add_paragraph("1. _______________________________")
doc.add_paragraph("2. _______________________________")
return doc
API Endpoint
@app.route('/api/me/ilp/download')
@require_role('resident', 'program_director', 'super_admin')
def download_ilp():
user = get_current_user()
# Get learner mapping
mapping = get_learner_mapping(user)
if not mapping:
return {"error": "No learner mapping found"}, 404
# Gather all data
learner_data = gather_ilp_data(mapping)
# Generate document
doc = generate_ilp(learner_data)
# Return as download
buffer = io.BytesIO()
doc.save(buffer)
buffer.seek(0)
filename = f"ILP_{user.name}_{date.today()}.docx"
return send_file(
buffer,
as_attachment=True,
download_name=filename,
mimetype='application/vnd.openxmlformats-officedocument.wordprocessingml.document'
)
Deliverables
| Deliverable | Description | Format |
|---|
| Trajectory Charts | Time-series visualization of scores | Chart.js component |
| Expected Level Comparison | Visual showing actual vs expected | UI overlay |
| AI Summaries Integration | Adapted comment analysis for OB-GYN | Python service |
| Comment Summaries UI | Strengths and growth areas display | HTML/JS component |
| ILP Template | Word document template with sections | python-docx template |
| Reflection Prompts | PGY-level appropriate prompts | Database seed |
| ILP Download Endpoint | API to generate and download ILP | Flask route |
Demo Script (End of Week 7 - FINAL DEMO)
Demo 3A: Enhanced Personal Dashboard
- Login as OB-GYN resident: Authenticate as test resident
- Show trajectory chart: Scores over time for Milestones
- Show expected level: Overlay showing PGY-3 expected vs actual
- Switch to Procedures: See trajectory for procedure scores
- Show AI summaries: Strengths and areas for growth
Demo 3B: ILP Generation
- Click “Download ILP” button: On resident dashboard
- Show download starts: Browser downloads .docx file
- Open Word document: Show pre-populated content
- Highlight auto-filled sections: Milestone scores, feedback highlights
- Show reflection prompt: PGY-appropriate prompt text
- Show editable sections: Blank goal fields ready for input
Demo 3C: Full User Journey
- Start as new resident: First login experience
- View personal dashboard: All evaluation data
- Explore trajectory: Understand progress over time
- Read feedback summary: AI-generated insights
- Download ILP: Get pre-populated template
- Ready for faculty meeting: ILP prepared with data
Definition of Done
| Item | Description | Needed By |
|---|
| Reflection Prompts | Text for PGY 1-4 prompts | Week 6 Day 1 |
| Expected Levels | Target scores by PGY per milestone | Week 6 Day 1 |
| ILP Template Review | Validation of auto-populated sections | Week 7 Day 3 |