Executive Summary
Integration Type:
Cognifit Cognitive Assessment API
Total Effort:
120 person-hours (15 person-days)
Estimated Timeline:
3-4 weeks (with shared resources)
Estimated Budget:
₹1,50,000 INR (~$1,800 USD)
Complexity Level:
Medium (Third-party API integration)
Recommendation:
Proceed as separate CR after current milestone
⚠ Important Context: This is a major scope addition requiring formal change order approval as per Bettroi SOP. Integration depends on Cognifit API availability, documentation quality, and access credentials.
Current Situation & Context
NeuroSense360 currently offers proprietary cognitive assessments developed in-house. The Cognifit API integration will enhance the platform by providing access to a comprehensive library of scientifically validated cognitive tests developed by CogniFit Inc.
Business Value:
- Expanded Test Library: Access to 30+ cognitive assessments (memory, attention, executive function, etc.)
- Scientific Validation: Peer-reviewed, clinically validated assessments
- Personalized Training: Adaptive cognitive training programs based on assessment results
- Progress Tracking: Longitudinal data showing cognitive improvement over time
- Competitive Advantage: Differentiate from competitors with world-class cognitive assessments
Impact on Current Timeline: If approved, this CR will be scheduled as a separate mini-project beginning after successful completion and client sign-off of the current NeuroSense360 milestone.
Technical Analysis
1. Application Structure
What type of application do we need to make?
| Component | Screens/Pages | Description |
|---|---|---|
| Admin Portal | 3 screens | Cognifit API configuration, credentials management, test catalog sync |
| Doctor Portal | 4 screens | Assign tests to patients, view results dashboard, historical trends, reports |
| Patient Portal | 5 screens | Available tests, instructions, take assessment (iframe embed), results, progress tracking |
| Backend APIs | 12 endpoints | Cognifit proxy layer, webhook handlers, data sync, caching |
| Total | 12 UI screens + 12 API endpoints | |
2. Features to Display
What are the key features that we need to show in our application?
Patient-Facing Features:
- Browse available cognitive assessments from Cognifit catalog
- View test details (duration, skills measured, difficulty level)
- Read instructions and watch demo videos before starting
- Take assessment via embedded Cognifit interface (iframe or redirect)
- View assessment results with detailed breakdowns (scores by cognitive domain)
- See visual representations (charts, graphs) of cognitive strengths and weaknesses
- Track progress over time with historical comparison
- Receive personalized recommendations for cognitive training
- Download assessment reports as PDF
Doctor-Facing Features:
- Assign specific Cognifit assessments to patients
- Monitor patient completion status in real-time
- View aggregated results dashboard for all assigned patients
- Compare patient results against normative data (age/gender matched)
- Track longitudinal changes in patient cognitive performance
- Generate clinical reports combining Cognifit data with other NeuroSense assessments
- Set automated alerts for significant changes in patient scores
- Export data for research or compliance purposes
Admin Features:
- Configure Cognifit API credentials (API keys, OAuth tokens)
- Sync test catalog from Cognifit (scheduled daily sync)
- Map Cognifit tests to NeuroSense assessment categories
- Monitor API usage and rate limits
- View integration health metrics (API success rate, latency)
- Manage webhook endpoints for real-time result notifications
3. Database Storage Requirements
What information do we need to store in our database that will be needed from Cognifit feature?
| Table Name | Purpose | Key Fields |
|---|---|---|
| cognifit_config | API credentials and settings | api_key, api_secret, base_url, webhook_secret, enabled |
| cognifit_tests | Cached test catalog from Cognifit | cognifit_test_id, name, description, duration_minutes, skills_measured, difficulty_level, last_synced_at |
| cognifit_assignments | Doctor assigns tests to patients | patient_id, doctor_id, cognifit_test_id, assigned_at, due_date, status (pending/in_progress/completed), priority |
| cognifit_sessions | Tracking patient test sessions | assignment_id, cognifit_session_id, started_at, completed_at, duration_seconds, ip_address, device_info |
| cognifit_results | Assessment results from Cognifit | session_id, overall_score, domain_scores_json, raw_data_json, percentile_rank, age_norm, gender_norm, completed_at |
| cognifit_sync_logs | API sync history and errors | sync_type, status, tests_synced, errors_json, started_at, completed_at |
| cognifit_webhooks | Incoming webhook events log | event_type, payload_json, processed_at, status, error_message |
| Estimated Storage | ~ 200 MB for 1,000 patients, 10,000 assessments | |
Integration with Existing NeuroSense Schema:
- Link cognifit_results to existing patients table via patient_id (foreign key)
- Extend assessments table to include assessment_source enum: 'neurosense_internal' | 'cognifit'
- Unified results view combining both internal and Cognifit assessments
- Cross-reference for clinical reports: Include Cognifit scores alongside NeuroSense scores
4. Cognitive Application Needs
What functions or features do we need/require from the Cognifit application for our own application?
| API Endpoint | Purpose | Request Method |
|---|---|---|
| GET /api/v1/assessments | Fetch list of available cognitive tests with metadata | GET (authenticated) |
| GET /api/v1/assessments/{id} | Get detailed information about specific test | GET (authenticated) |
| POST /api/v1/users | Create or sync user profile in Cognifit (patient registration) | POST (JSON: name, email, dob, gender) |
| GET /api/v1/users/{id} | Retrieve user profile and settings | GET (authenticated) |
| POST /api/v1/sessions | Create new assessment session for patient | POST (JSON: user_id, assessment_id, settings) |
| GET /api/v1/sessions/{id} | Get session details and launch URL | GET (returns: session_url, token, expiry) |
| GET /api/v1/sessions/{id}/status | Check if session is in-progress, completed, or abandoned | GET (polling endpoint) |
| GET /api/v1/sessions/{id}/results | Fetch detailed assessment results after completion | GET (JSON: scores, domains, percentiles, raw_data) |
| GET /api/v1/users/{id}/history | Retrieve all past assessments for longitudinal analysis | GET (paginated, filters: date_range, assessment_type) |
| POST /api/v1/webhooks | Register webhook URL for real-time event notifications | POST (webhook_url, events: ['session.completed', 'results.ready']) |
| DELETE /api/v1/webhooks/{id} | Unregister webhook | DELETE |
| GET /api/v1/reports/{session_id} | Generate downloadable PDF report for session | GET (returns: pdf_url or binary data) |
API Requirements:
- Authentication: OAuth 2.0 or API Key (header: X-API-Key)
- Data Format: JSON (UTF-8)
- Rate Limit: Assumed 100 requests/minute (to be confirmed)
- Webhook Format: POST with HMAC signature for verification
- Timeout: Standard HTTP timeout (30 seconds for most endpoints)
- Error Handling: Standard HTTP status codes (400, 401, 429, 500, etc.)
⚠ Dependency: This estimate assumes Cognifit provides a REST API with documentation. If API is not available or documentation is incomplete, estimate may increase by 20-30% for discovery and workaround development.
5. Overall Workflow
What will the overall workflow be?
Patient Assessment Workflow:
1. Doctor assigns Cognifit test to patient
→ Via NeuroSense doctor portal
→ Select patient from list
→ Choose Cognifit test from catalog
→ Set due date and priority
→ Click "Assign Test"
2. System creates assignment record
→ Store in cognifit_assignments table
→ Send notification to patient (email/SMS)
→ Assignment appears in patient dashboard
3. Patient logs into NeuroSense portal
→ Sees assigned Cognifit test in "Pending Assessments"
→ Clicks "Start Assessment"
4. NeuroSense backend calls Cognifit API
→ POST /api/v1/sessions (create new session)
→ Receives: session_id, launch_url, access_token
→ Stores session_id in cognifit_sessions table
5. Patient redirected to Cognifit platform
→ Option A: Embedded iframe within NeuroSense (seamless)
→ Option B: Redirect to Cognifit with return URL
→ Patient completes assessment on Cognifit interface
6. During assessment:
→ Optional polling: GET /api/v1/sessions/{id}/status
→ Shows progress bar in NeuroSense (if supported by Cognifit API)
7. Upon completion:
→ Cognifit sends webhook to NeuroSense
→ Event: "session.completed"
→ Payload: {session_id, user_id, status: 'completed', timestamp}
8. NeuroSense webhook handler:
→ Verify HMAC signature
→ Fetch results: GET /api/v1/sessions/{id}/results
→ Parse and store results in cognifit_results table
→ Update assignment status to 'completed'
9. Results processing:
→ Extract domain scores (memory, attention, executive function, etc.)
→ Calculate percentile ranks
→ Compare to age/gender norms
→ Store raw JSON for future reference
10. Notify doctor:
→ Email: "Patient [Name] completed Cognifit assessment"
→ Dashboard notification badge (new results available)
11. Doctor reviews results:
→ View detailed scores by cognitive domain
→ See visual charts (radar chart, bar graphs)
→ Compare to previous assessments (if any)
→ Compare to normative data
→ Add clinical notes
12. Patient accesses results:
→ View summary with explanations
→ Download PDF report
→ See personalized recommendations
Daily Sync Workflow (Automated):
1. Scheduled job runs daily (e.g., 2 AM)
→ Fetch latest test catalog: GET /api/v1/assessments
→ Compare with local cache (cognifit_tests table)
→ Update if changes detected (new tests, updated metadata)
→ Log sync status in cognifit_sync_logs
Error Handling Workflow:
- Cognifit API timeout (30 sec)
→ Retry with exponential backoff (3 attempts: 5s, 15s, 45s)
→ If still failing, log error and notify admin
- Authentication failure (401)
→ Check API credentials in cognifit_config
→ Attempt re-authentication (OAuth refresh token)
→ If refresh fails, alert admin (email + Slack)
- Rate limit exceeded (429)
→ Respect Retry-After header
→ Queue request for later processing
→ Notify admin if rate limits consistently hit
- Session launch URL expired
→ Regenerate session: POST /api/v1/sessions
→ Provide new launch URL to patient
- Webhook signature verification fails
→ Log as security incident
→ Do NOT process webhook payload
→ Alert admin immediately
- Patient abandons assessment midway
→ Status remains 'in_progress'
→ After 24 hours, mark as 'abandoned'
→ Send reminder to patient to complete
Detailed Effort Estimate
| Task Category | Sub-Tasks | Hours | Role |
|---|---|---|---|
| Phase 1: Discovery & API Analysis (12 hours) | |||
| Cognifit API Documentation Review | Study API endpoints, authentication, data models | 6 | Tech Lead |
| Sandbox Testing | Test API calls, verify responses, latency check | 4 | Backend Dev |
| Data Mapping Design | Map Cognifit data to NeuroSense schema | 2 | Tech Lead |
| Phase 2: Backend Integration (40 hours) | |||
| API Client Library | Build wrapper for Cognifit API with retry logic | 12 | Backend Dev |
| Authentication Layer | OAuth 2.0 or API key management, token refresh | 4 | Backend Dev |
| Database Schema Updates | Create 7 new tables, migrations, indexes | 6 | Backend Dev |
| Webhook Handler | Receive, verify, process Cognifit events | 8 | Backend Dev |
| Sync Service | Scheduled job for catalog sync, error handling | 6 | Backend Dev |
| Caching Layer | Redis cache for test catalog, reduce API calls | 4 | Backend Dev |
| Phase 3: Frontend Development (32 hours) | |||
| Admin Portal (API Config) | Credentials management, sync controls | 8 | Frontend Dev |
| Doctor Portal (Test Assignment) | Assign tests, view results dashboard | 12 | Frontend Dev |
| Patient Portal (Take Tests) | Browse tests, instructions, iframe embed, results | 12 | Frontend Dev |
| Phase 4: Data Visualization (12 hours) | |||
| Results Charts & Graphs | Radar charts, bar graphs, progress tracking | 8 | Frontend Dev |
| Comparative Analytics | Historical trends, normative comparisons | 4 | Frontend Dev |
| Phase 5: Testing & QA (16 hours) | |||
| Unit Testing | Backend API wrapper, webhook handler | 6 | Backend Dev |
| Integration Testing | End-to-end flows with Cognifit sandbox | 6 | QA Engineer |
| Error Scenario Testing | Timeouts, rate limits, authentication failures | 4 | QA Engineer |
| Phase 6: Deployment & Documentation (8 hours) | |||
| Staging Deployment | Deploy, configure webhooks, UAT | 3 | DevOps |
| Production Deployment | Go-live, monitoring setup | 2 | DevOps |
| Documentation | User guide, API integration docs | 3 | Tech Writer |
| Subtotal | 120 hrs | 15 days | |
| Contingency Buffer (20%) | 24 hrs | 3 days | |
| GRAND TOTAL | 144 hrs | 18 days | |
Estimated Timeline
Week 1: Discovery & Backend Setup
API analysis, authentication, database schema, API client wrapper
Week 2: Backend Integration
Webhook handler, sync service, caching, error handling
Week 3: Frontend Development
Admin, doctor, and patient portals; data visualization
Week 4: Testing & Deployment
QA testing, bug fixes, staging/production deployment
Resource Model: Shared resources across projects. With dedicated team, timeline compresses to 2.5-3 weeks.
Cost Estimate
| Component | Hours | Rate (INR/hr) | Amount (INR) |
|---|---|---|---|
| Tech Lead / Architect | 8 | ₹1,000 | ₹8,000 |
| Backend Development | 60 | ₹750 | ₹45,000 |
| Frontend Development | 36 | ₹750 | ₹27,000 |
| QA Engineering | 10 | ₹600 | ₹6,000 |
| DevOps | 5 | ₹750 | ₹3,750 |
| Technical Writing | 3 | ₹500 | ₹1,500 |
| Subtotal (120 hrs) | ₹91,250 | ||
| Contingency Buffer (20% - 24 hrs) | ₹58,750 | ||
| Total Development Cost | ₹1,50,000 | ||
Ongoing Costs (if applicable)
| Service | Estimated Cost/Month |
|---|---|
| Cognifit API Subscription | $XXX - TBD (depends on Cognifit pricing model) |
| Additional Database Storage | $10 - $30 |
| Redis Cache (if not already provisioned) | $20 - $50 |
| Total Monthly Cost (excluding Cognifit fees) | $30 - $80 |
Note: Cognifit API subscription cost is unknown and must be obtained from Cognifit directly. This could range from $100/month to $1,000+/month depending on usage tiers and licensing model.
Dependencies & Risks
External Dependencies
- Cognifit API Access: Requires active partnership/license agreement with CogniFit Inc.
- API Documentation: Complete and accurate API documentation from Cognifit
- Sandbox Environment: Test environment for development and QA
- API Credentials: Client ID, API keys, OAuth secrets
- Webhook Support: Cognifit must support webhook callbacks for real-time notifications
Technical Risks
| Risk | Probability | Impact | Mitigation |
|---|---|---|---|
| Cognifit API documentation incomplete or outdated | Medium | High | Request sandbox access early; schedule call with Cognifit technical support |
| API rate limits too restrictive for our usage | Medium | Medium | Implement caching; negotiate higher rate limits with Cognifit |
| Webhook delivery failures or delays | Low | Medium | Implement polling as fallback; retry mechanism for failed webhooks |
| Data format mismatches between Cognifit and NeuroSense | Medium | Medium | Build robust mapping layer; store raw JSON for future reference |
| Authentication token expiration issues | Low | Medium | Implement automatic token refresh; monitor auth errors |
| Cognifit API breaking changes | Low | High | Version pinning; monitor Cognifit changelog; adapter pattern for isolation |
| Iframe embedding restrictions (CORS, CSP) | Medium | Low | Test early; fallback to redirect approach if embedding not allowed |
Critical Dependency: This entire project depends on Cognifit providing a production-ready REST API. If API is in beta, poorly documented, or has reliability issues, this estimate could increase by 30-50%.
Assumptions
Technical Assumptions:
- Cognifit provides a RESTful API with JSON responses
- API documentation is complete, accurate, and up-to-date
- Authentication uses OAuth 2.0 or API Key (standard methods)
- API rate limits are reasonable (100+ requests/minute)
- Webhook support available for real-time event notifications
- Assessment results include structured data (not just PDFs)
- Sandbox environment available for development and testing
- No major breaking changes to API during development
- API latency <2 seconds for standard requests
- Iframe embedding allowed (or redirect approach acceptable)
Business Assumptions:
- Client has active license/partnership agreement with Cognifit
- Client approves this estimate within 2 weeks
- API credentials provided within 1 week of project kickoff
- Current NeuroSense milestone completed before this work begins
- Requirements stable; no major scope changes
- Client provides timely feedback (SLA: 3 business days)
- Cognifit subscription cost covered by client (not in estimate)
Open Questions for Client
These questions must be answered before work begins:
- Cognifit Partnership Status: Do we have an active agreement with Cognifit? If not, who will negotiate this?
- API Access: Can client provide Cognifit API documentation URL and sandbox credentials?
- Pricing Model: What is Cognifit's pricing (per assessment, per user, subscription)? Who pays?
- Test Selection: Which Cognifit assessments do we want to offer (all 30+, or curated subset)?
- User Experience: Embed assessments in iframe or redirect to Cognifit platform?
- Data Ownership: Who owns the assessment results data? Can we store locally?
- Compliance: Any HIPAA, GDPR, or regulatory requirements for cognitive assessment data?
- Integration Scope: Just assessment results, or also include Cognifit's training modules?
- Timeline Priority: Is this higher priority than DDO integration, or lower?
Recommendations
Recommended Approach:
- Verify Cognifit API Availability First: Before approving budget, confirm Cognifit has production-ready API with documentation. Schedule technical call with Cognifit.
- Start with Pilot: Integrate 3-5 most popular Cognifit assessments first (MVP). Expand catalog after validating integration.
- Phased After Current Milestone: Complete NeuroSense Phase 1 first, then tackle Cognifit as separate mini-project.
- Cache Aggressively: Reduce Cognifit API calls (and potential subscription costs) by caching test catalog and results.
- Monitor API Usage: Track API calls to avoid unexpected overage charges from Cognifit.
Alternative: Custom Assessment Development
If Cognifit API is unavailable, too expensive, or unreliable, consider:
- Developing custom cognitive assessments in-house (higher upfront cost, full control)
- Partnering with academic institutions for validated tests
- Licensing individual assessments instead of full Cognifit platform
Next Steps
Immediate Actions (Before Approval):
- Client: Answer open questions listed above
- Client: Provide Cognifit API documentation and sandbox access
- Bettroi: Review Cognifit API docs; validate estimate accuracy
- Both: Schedule technical call with Cognifit support (if available)
- Client: Clarify budget and approve/defer this CR
Upon Approval:
- Sign formal Change Request (CR) document
- Finalize project plan and sprint schedule
- Allocate development resources
- Kickoff meeting within 1 week
- Weekly progress updates
Estimate Validity: Valid for 60 days (27 Dec 2025 - 26 Feb 2026)
Approval & Sign-Off
|
Client Approval: Name: _________________________________ Title: _________________________________ Signature: _________________________________ Date: _________________________________ |
Bettroi Approval: Name: Dr. Murali B K (BK) Title: Technical Lead Signature: _________________________________ Date: 27 December 2025 |
Payment Terms (upon approval):
- 40% advance upon Change Request approval and project kickoff
- 60% upon completion, UAT sign-off, and production deployment
Payment Schedule:
- Payment 1: ₹60,000 (40%) - Upon CR approval
- Payment 2: ₹90,000 (60%) - Production go-live