Skip to content

Commit f7d860a

Browse files
jcrussellclaude
andcommitted
Prepare v1.0.0 release: Update documentation and add comprehensive badge tests
This commit prepares the project for the v1.0.0 release by fixing documentation inaccuracies and adding comprehensive test coverage for previously untested badges. Documentation Updates: - Update README.md badge count from 75 to 101 across 16 categories (was 14) - Fix individual category counts (Specialty: 2→10, Labs: 8→14, Medications: 3→6) - Add missing categories: Visit Frequency Milestones (5), Seasonal (4) - Update pkg/analysis/badges/doc.go badge count and category list - Remove outdated BADGE_IDEAS.md (described implemented features as future work) Test Coverage: - Add distance_test.go: Tests for all 6 distance/travel badges - Add milestones_test.go: Tests for all 5 visit frequency milestone badges - Add seasonal_test.go: Tests for all 4 seasonal health pattern badges - Add registry_test.go: Validates 101 badge count, no duplicates, complete metadata Test Infrastructure: - Enhance testutil builders with WithGeocodingEnabled(), WithDistanceFromHome(), WithVisitType(), and WithConfig() methods for comprehensive badge testing Release Documentation: - Add CHANGELOG.md documenting v1.0.0 release with complete feature list All 450+ tests pass. The project is now ready for v1.0.0 release. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 3c26c82 commit f7d860a

File tree

9 files changed

+963
-66
lines changed

9 files changed

+963
-66
lines changed

BADGE_IDEAS.md

Lines changed: 0 additions & 50 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [Unreleased]
9+
10+
## [1.0.0] - 2025-01-01
11+
12+
### Added
13+
- Initial release of gamify-ccda
14+
- **101 Achievement Badges** across 16 categories:
15+
- ⏰ Temporal (10): Time-based patterns (early morning, lunch hour, weekend, after hours, etc.)
16+
- 📍 Location (7): Facility visit patterns (wanderer, loyalist, boomerang, yo-yo, etc.)
17+
- 🎉 Holiday (7): Visits on special days (New Year's, Valentine's, Halloween, Christmas, etc.)
18+
- 💻 Visit Modality (6): How you receive care (in-person, virtual, phone, hybrid)
19+
- 👨‍⚕️ Provider Continuity (3): Provider relationships and loyalty
20+
- 🏥 Specialty (10): Specialist care patterns
21+
- 🔬 Lab & Testing (14): Lab work and preventive screening
22+
- 📊 Vitals (4): Vital sign monitoring and tracking
23+
- 💊 Medication (6): Medication management
24+
- 💉 Immunization (3): Vaccination records
25+
- 🩺 Diagnosis (4): Health condition tracking
26+
- 🌟 Wellness (3): Overall healthcare engagement
27+
- 🚗 Distance & Travel (6): Healthcare travel patterns and distances (requires geocoding)
28+
- 🏆 Achievement & Milestone (9): Major milestones and meta-achievements
29+
- 🎖️ Visit Frequency Milestones (5): Visit count milestones (Bronze, Silver, Gold, Platinum, Diamond)
30+
- 🍂 Seasonal (4): Seasonal healthcare patterns (Spring, Summer, Fall, Winter)
31+
- **CCDA Parsing**: Comprehensive extraction of encounters, diagnoses, vitals, labs, medications, and immunizations
32+
- **Interactive Dashboard**: Activity heatmap, badge progress, quarterly timeline, and year-by-year comparison
33+
- **Location Map**: Interactive Leaflet map with geocoded facility locations and distance tracking (optional)
34+
- **Terminal Browser**: Browse encounters in a terminal UI with Bubble Tea
35+
- **Time Travel**: View data as of any historical date with `--when` flag
36+
- **Configuration System**: TOML-based config with geocoding preferences and home address support
37+
- **Privacy-Focused**: All processing happens locally, optional geocoding with OpenStreetMap
38+
- **Multi-Platform**: Cross-platform builds for Linux, macOS, and Windows (amd64, arm64)
39+
40+
### Security
41+
- Password-protected ZIP file support for secure CCDA exports
42+
- Sensitive health data files excluded from git (.gitignore)
43+
- Generated HTML files created with restrictive permissions (0600)
44+
- Secure password input using golang.org/x/term
45+
- Geocoding disabled by default to protect privacy
46+
47+
### Documentation
48+
- Comprehensive README with quick start guide
49+
- CLAUDE.md with architecture details and development guidelines
50+
- Example configuration file (config.example.toml)
51+
- BSD 3-Clause License
52+
53+
### Infrastructure
54+
- GitHub Actions CI/CD (test, lint, build, release)
55+
- GoReleaser configuration for automated releases
56+
- Codecov integration for test coverage tracking
57+
- Comprehensive test suite with 450+ tests
58+
59+
[Unreleased]: https://github.com/jcrussell/gamify-ccda/compare/v1.0.0...HEAD
60+
[1.0.0]: https://github.com/jcrussell/gamify-ccda/releases/tag/v1.0.0

README.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ This repository was created to explore the capabilities of Claude AI in software
1616

1717
- 📊 **Interactive Dashboard**: View your health encounters over time with activity heatmap and insights
1818
- 🗺️ **Location Map**: Visualize all your healthcare facilities with distance tracking (requires geocoding)
19-
- 🏆 **75 Achievement Badges**: Earn badges across 14 categories (6 distance badges require geocoding)
19+
- 🏆 **101 Achievement Badges**: Earn badges across 16 categories (6 distance badges require geocoding)
2020
- 📅 **Yearly & Lifetime Stats**: Track your health journey with comprehensive analytics
2121
-**Time Travel**: View your data as of any historical date with `--when` flag
2222
- 🔒 **Secure**: Processes password-protected ZIP files locally
@@ -56,29 +56,31 @@ Open `output/index.html` in your browser to view your health dashboard!
5656

5757
## Badge Categories
5858

59-
Earn badges across 14 categories tracking different aspects of your healthcare journey:
59+
Earn badges across 16 categories tracking different aspects of your healthcare journey:
6060

6161
- **⏰ Temporal (10)**: Time-based patterns (early morning, lunch hour, weekend, after hours, etc.)
6262
- **📍 Location (7)**: Facility visit patterns (wanderer, loyalist, boomerang, yo-yo, etc.)
6363
- **🎉 Holiday (7)**: Visits on special days (New Year's, Valentine's, Halloween, Christmas, etc.)
6464
- **💻 Visit Modality (6)**: How you receive care (in-person, virtual, phone, hybrid)
6565
- **👨‍⚕️ Provider Continuity (3)**: Provider relationships and loyalty
66-
- **🏥 Specialty (2)**: Specialist care patterns
67-
- **🔬 Lab & Testing (8)**: Lab work and preventive screening
66+
- **🏥 Specialty (10)**: Specialist care patterns
67+
- **🔬 Lab & Testing (14)**: Lab work and preventive screening
6868
- **📊 Vitals (4)**: Vital sign monitoring and tracking
69-
- **💊 Medication (3)**: Medication management
69+
- **💊 Medication (6)**: Medication management
7070
- **💉 Immunization (3)**: Vaccination records
71-
- **🏥 Diagnosis (4)**: Health condition tracking
71+
- **🩺 Diagnosis (4)**: Health condition tracking
7272
- **🌟 Wellness (3)**: Overall healthcare engagement
7373
- **🚗 Distance & Travel (6)**: Healthcare travel patterns and distances
7474
- **🏆 Achievement & Milestone (9)**: Major milestones and meta-achievements
75+
- **🎖️ Visit Frequency Milestones (5)**: Visit count milestones (Bronze, Silver, Gold, Platinum, Diamond)
76+
- **🍂 Seasonal (4)**: Seasonal healthcare patterns (Spring, Summer, Fall, Winter)
7577

7678
## How It Works
7779

7880
1. **Export**: Download your health records as a CCDA/IHE_XDM ZIP file from your healthcare provider
7981
2. **Parse**: The tool extracts and parses comprehensive health data (encounters, diagnoses, vitals, labs, medications, immunizations)
8082
3. **Geocode** (optional): When enabled, geocodes facility addresses to calculate distances and generate map visualizations
81-
4. **Analyze**: Aggregates data into yearly buckets and evaluates 75 badge criteria across 14 categories
83+
4. **Analyze**: Aggregates data into yearly buckets and evaluates 101 badge criteria across 16 categories
8284
5. **Visualize**: Generates a beautiful HTML dashboard with interactive heatmaps, maps, and achievement tracking
8385

8486
## CCDA Compatibility

internal/testutil/builders.go

Lines changed: 73 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -98,19 +98,47 @@ func (b *EncounterBuilder) WithStatus(status string) *EncounterBuilder {
9898
return b
9999
}
100100

101+
// WithDistanceFromHome sets the distance from home in km
102+
func (b *EncounterBuilder) WithDistanceFromHome(distance float64) *EncounterBuilder {
103+
b.enc.DistanceFromHome = distance
104+
return b
105+
}
106+
107+
// WithVisitType sets the encounter code and location to match the specified visit type
108+
func (b *EncounterBuilder) WithVisitType(visitType ccda.VisitType) *EncounterBuilder {
109+
switch visitType {
110+
case ccda.VisitTypeInPerson:
111+
b.enc.EncounterCode = "99213"
112+
b.enc.EncounterCodeSystem = "2.16.840.1.113883.6.12" // CPT
113+
b.enc.Location = "Medical Center"
114+
case ccda.VisitTypeVirtual:
115+
b.enc.EncounterOriginalText = "E-Visit"
116+
b.enc.Location = "Virtual Clinic"
117+
case ccda.VisitTypePhone:
118+
b.enc.EncounterOriginalText = "Phone Consultation"
119+
b.enc.Location = "Call Center"
120+
case ccda.VisitTypeInHome:
121+
b.enc.EncounterOriginalText = "Home Visit"
122+
b.enc.Location = "Home Health"
123+
}
124+
return b
125+
}
126+
101127
// Build returns the built encounter
102128
func (b *EncounterBuilder) Build() ccda.Encounter {
103129
return b.enc
104130
}
105131

106132
// HistoryBuilder provides a fluent interface for building health history
107133
type HistoryBuilder struct {
108-
encounters []ccda.Encounter
109-
diagnoses []ccda.Diagnosis
110-
vitals []ccda.Vital
111-
labs []ccda.Lab
112-
medications []ccda.Medication
113-
immunizations []ccda.Immunization
134+
encounters []ccda.Encounter
135+
diagnoses []ccda.Diagnosis
136+
vitals []ccda.Vital
137+
labs []ccda.Lab
138+
medications []ccda.Medication
139+
immunizations []ccda.Immunization
140+
geocodingEnabled bool
141+
config *config.Config
114142
}
115143

116144
// NewHistory creates a new history builder
@@ -197,6 +225,38 @@ func (h *HistoryBuilder) WithImmunizations(imms ...ccda.Immunization) *HistoryBu
197225
return h
198226
}
199227

228+
// WithGeocodingEnabled sets whether geocoding is enabled
229+
func (h *HistoryBuilder) WithGeocodingEnabled(enabled bool) *HistoryBuilder {
230+
h.geocodingEnabled = enabled
231+
// If enabling geocoding, create a default config with a test home address if not already set
232+
if enabled && h.config == nil {
233+
h.config = &config.Config{
234+
Preferences: config.Preferences{
235+
DistanceUnit: "km",
236+
EnableGeocoding: true,
237+
},
238+
Addresses: []config.AddressEntry{
239+
{
240+
StartDate: "2000-01-01",
241+
EndDate: "",
242+
Street: "123 Test Street",
243+
City: "Test City",
244+
State: "CA",
245+
PostalCode: "90001",
246+
Country: "USA",
247+
},
248+
},
249+
}
250+
}
251+
return h
252+
}
253+
254+
// WithConfig sets a custom config
255+
func (h *HistoryBuilder) WithConfig(cfg *config.Config) *HistoryBuilder {
256+
h.config = cfg
257+
return h
258+
}
259+
200260
// Build returns the built HealthHistory
201261
func (h *HistoryBuilder) Build() *analysis.HealthHistory {
202262
data := &ccda.Data{
@@ -207,5 +267,11 @@ func (h *HistoryBuilder) Build() *analysis.HealthHistory {
207267
Medications: h.medications,
208268
Immunizations: h.immunizations,
209269
}
210-
return analysis.NewHealthHistory(data, time.Now(), config.DefaultConfig(), false)
270+
271+
cfg := h.config
272+
if cfg == nil {
273+
cfg = config.DefaultConfig()
274+
}
275+
276+
return analysis.NewHealthHistory(data, time.Now(), cfg, h.geocodingEnabled)
211277
}

0 commit comments

Comments
 (0)