Kulcare Docs
DeveloperCare plansCare planGuides

Care Plan Feature - Usage Guide

Accessing Care Plan in Development

When Running Through Shell App (Port 3000)

The Care Plan feature is part of the CMS app, which is mounted at /cms/* in the shell application.

Correct URLs:

  • Care Plan Dashboard: http://localhost:3000/cms/careplan
  • New Encounter: http://localhost:3000/cms/careplan/new
  • Patient Encounter: http://localhost:3000/cms/careplan/{patientId}/{encounterId}

How to Navigate:

  1. Start the shell app: pnpm dev (runs on port 3000)
  2. Log in to the application
  3. Click on "CMS" in the app switcher
  4. Click on "Care Plan" in the sidebar menu
  5. The system will navigate to /cms/careplan automatically

When Running CMS Standalone (Port 3001)

If you're running the CMS app directly for development:

URLs:

  • Care Plan Dashboard: http://localhost:3001/careplan
  • New Encounter: http://localhost:3001/careplan/new
  • Patient Encounter: http://localhost:3001/careplan/{patientId}/{encounterId}

How to Run Standalone:

pnpm dev --filter=@kulcare/cms

Common Issues

Issue: "Page redirects to dashboard" ✅ FIXED

Cause: Accessing /careplan/new instead of /cms/careplan/new when using the shell app. Solution: Navigation has been updated to automatically include the /cms prefix when running through the shell app. The navigation utility (apps/cms/src/utils/navigation.ts) handles this automatically.

Issue: "React validateDOMNesting error" ✅ FIXED

Cause: Invalid HTML nesting (e.g., <div> inside <p> tags). Solution: Fixed. The Skeleton components are now properly wrapped in <div> instead of <p> tags.

Features Available

Care Plan Dashboard (/cms/careplan)

  • View today's encounters statistics
  • See in-progress and completed encounters
  • View average encounter duration
  • Access active encounters list
  • Search and filter patients
  • Quick access to start new encounters

New Encounter (/cms/careplan/new)

  • Search and select patients
  • Select healthcare provider
  • Set visit type and urgency
  • Enter chief complaint
  • Start new encounter

Encounter Page (/cms/careplan/{patientId}/{encounterId})

  • Vitals Tab: Record vital signs with validation

    • Blood pressure, heart rate, temperature
    • Respiratory rate, oxygen saturation
    • Height, weight, BMI calculation
    • Color-coded normal range indicators
  • Observations Tab: Document clinical observations

    • Chief complaint
    • History of present illness
    • General and systemic examination
    • Provisional and differential diagnosis
    • Clinical notes
  • Medications Tab (Phase 5): Complete medication management system

    • Intelligent drug search with autocomplete
    • Advanced drug interaction checking with clinical recommendations
    • Electronic prescription workflow with pharmacy integration
    • Allergy checking and age-related medication warnings
    • Integration with AI Scribe medication suggestions
  • Investigations Tab (Phase 6 - NEW!): Comprehensive test and imaging ordering

    • Lab tests, imaging studies, and procedure ordering
    • Quick test category selection (Hematology, Radiology, Cardiology)
    • Test search with cost estimation and preparation instructions
    • Urgency levels (Routine, Urgent, STAT) with priority handling
    • Clinical notes and special instructions for each test
    • Status tracking from ordered to completed
  • Advice & Follow-up Tab (Phase 6 - NEW!): Patient instructions and care coordination

    • Pre-built advice templates (medication compliance, lifestyle, diet, exercise)
    • Custom patient instruction creation with priority levels
    • Follow-up scheduling (appointments, calls, tests, reviews)
    • Provider assignment and reminder system
    • Patient education content with copy functionality
  • AI Scribe: Intelligent recording and transcription assistant

    • Real-time audio recording with voice activity detection
    • Live transcription with speaker identification
    • AI-powered clinical suggestions (diagnosis, medications, tests, advice)
    • Context-aware recommendations based on chief complaint
    • Accept/reject workflow for AI suggestions
    • Automatic integration with encounter documentation
  • Auto-Save: Changes are automatically saved after 2 seconds of inactivity

Mock Data

The Care Plan feature includes comprehensive mock data for testing:

Available Test Data

  • 5 Mock Patients with varied medical histories:

    • John Smith (45M) - Hypertension, Diabetes
    • Sarah Johnson (32F) - Asthma
    • Michael Chen (28M) - New patient
    • Emily Davis (55F) - Hypertension, Osteoarthritis
    • Robert Wilson (67M) - COPD, Hypertension, Diabetes
  • 4 Mock Encounters in different states:

    • IN-PROGRESS: John Smith - Cough and fever (started 45 min ago)
    • DRAFT: Robert Wilson - COPD exacerbation (started 15 min ago)
    • COMPLETED: Sarah Johnson - Annual physical (completed 1 hour ago)
    • COMPLETED: Emily Davis - Joint pain (completed yesterday)
  • Mock doctors/providers are available for selection

  • All data is stored in memory during the session

  1. From Shell Dashboard → Click "CMS" → Click "Care Plan" in sidebar
  2. Direct URL Access: Use http://localhost:3000/cms/careplan
  3. Within Care Plan:
    • Click "New Encounter" button → Goes to /cms/careplan/new
    • Click on a patient row → Goes to patient history
    • Click "Continue" on active encounter → Goes to encounter page
    • Click "AI Scribe" button → Opens intelligent transcription sidebar

Testing the Feature

Quick Test Scenarios

  1. View In-Progress Encounters:

    • Navigate to Care Plan dashboard
    • You should see "2 Active" encounters in the statistics
    • Click on John Smith's in-progress encounter to continue
  2. Start New Encounter:

    • Click "New Encounter" button
    • Search for "Michael" to find Michael Chen (new patient)
    • Select provider and enter chief complaint
    • Start the encounter
  3. Search Patients:

    • Use the search box to find patients by name, phone, or medical ID
    • Try searching for "MR-003890" to find Michael Chen

Debug Tools

Open browser console and run:

testCarePlanData(); // Shows statistics about mock data

This will display:

  • Total patients and encounters
  • Active encounters count
  • Today's encounters count

Development Tips

  • Navigation automatically handles URL prefixes (no manual /cms prefix needed in code)
  • The feature uses mock data, so no backend API is required
  • Changes are not persisted between page refreshes (mock data resets)
  • Debug information is shown in development mode
  • Use browser DevTools to check for console errors if navigation issues occur

All Care Plan navigation now uses the navigateToCMS utility function which automatically:

  • Detects if running in standalone mode (port 3001) or shell mode (port 3000)
  • Adds /cms prefix when running through the shell
  • No prefix when running standalone

The navigation utility is located at: apps/cms/src/utils/navigation.ts

Testing Checklist

  • Access Care Plan through sidebar navigation
  • Create a new encounter
  • Enter vital signs and see validation
  • Add observations and notes
  • Test Medications functionality:
    • Search for drugs and add medications
    • Verify drug interaction checking
    • Test ePrescription flow with pharmacy selection
    • Check allergy warnings and age-related alerts
  • Test Investigations functionality:
    • Browse test categories (Lab, Imaging, Procedures)
    • Search and order different types of tests
    • Set urgency levels and add clinical notes
    • Verify cost estimation and preparation instructions
  • Test Advice & Follow-up functionality:
    • Apply pre-built advice templates
    • Create custom patient instructions
    • Schedule follow-up appointments and calls
    • Test priority levels and provider assignment
  • Test AI Scribe functionality:
    • Click AI Scribe button to open sidebar
    • Start recording and see live transcription
    • Wait for AI suggestions to appear
    • Accept an AI suggestion and see it integrate
    • Try different chief complaints for scenario adaptation
  • Verify auto-save indicator appears
  • Navigate between tabs
  • Return to dashboard and see encounter in list

Last Updated: January 2025

On this page