Skip to content

eziCode/Medical-Activity-Tracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 

Repository files navigation

📋 MyMedTracker Alexa Skill

MyMedTracker is an Alexa skill that helps users log and retrieve medical activity records for themselves or others (e.g., children, patients, pets). It leverages AWS services including DynamoDB, SES, and the Alexa Skills Kit SDK (v2) to store and send medical records via email.


🚀 Features

  • Add Medical Events: Log events like exercises, appointments, or any custom activity.
  • Add Medication Entries: Log specific medications and dosages.
  • Retrieve Records by Date: Ask for medical history for a specific person on a specific date.
  • Retrieve Records by Period: Retrieve all events from the past X days/weeks/months.
  • Ask When Questions: Find out the last time a person did a certain activity or took a specific medicine.
  • Email Delivery: Results are automatically emailed to the user’s Alexa-linked email address via AWS SES.

🛠️ Technologies Used

  • Alexa Skills Kit SDK v2
  • AWS DynamoDB – stores user-submitted medical activity logs
  • AWS SES – sends medical history to user’s email
  • AWS SDK for JavaScript
  • HTTPS Requests – fetches Alexa user email securely

📦 Intents Overview

AddMedicalActivityIntent

Logs a general medical activity and its duration.

Example:

“Alexa, log that I walked for 30 minutes.”


AddMedicineGivenIntent

Logs a medicine given to a person and its dosage.

Example:

“Alexa, record that I gave John 10 milliliters of Tylenol.”


RetrieveIntentForSpecificDate

Retrieves all medical records for a specific person on a specific date.

Example:

“Alexa, what did Sarah do on July 15th?”


RetrieveIntentForPeriodsOfTime

Retrieves records for a person over the past N days/weeks/months.

Example:

“Alexa, what did John do over the last 2 weeks?”


WhenQuestionIntent

Finds the last time a specific activity or medicine was logged.

Example:

“Alexa, when did John last take Tylenol?”


📬 Email Integration

  • Fetches Alexa-linked email via Alexa Profile API.
  • Emails results to the user via AWS SES.
  • Note: You must verify the sender email (e.g., ezraakresh@gmail.com) in SES, especially if using a sandboxed account.

🔒 Permissions Required

To function properly, the skill must request the following permissions:

  • alexa::profile:email:read

You must enable this in the Alexa Developer Console and request consent during account linking.


🗃️ DynamoDB Table Schema

  • Table Name: MyMedTrackerTable
  • Partition Key: userid (e.g., userId#name)
  • Sort Key: date (ISO 8601-like string)
  • Attributes:
    • event: medical activity or medication event description
    • duration (optional): duration in minutes
    • dosage (optional): dosage amount

🔧 Setup Instructions

1. AWS Setup

  • Create DynamoDB table MyMedTrackerTable
  • Set up SES and verify sender email
  • Ensure Lambda IAM role has permissions for:
    • DynamoDB (read/write)
    • SES (send email)

2. Alexa Skill Configuration

  • Enable Email read permission in Developer Console
  • Configure intents, slots, and utterances to match handlers in the code

3. Lambda Deployment

  • Deploy the index.js code to AWS Lambda
  • Set the handler as index.handler
  • Ensure region is us-east-1

4. Connect to Alexa Console

  • Set the endpoint to your Lambda ARN
  • Enable permissions under "Permissions" tab
  • Enable account linking (with permissions scope)

🧪 Testing

You can test the skill using:

  • Alexa Developer Console (Test tab)
  • Alexa-enabled devices

Example Test Phrases:

  • “Alexa, ask My Med Tracker to log 30 minutes of yoga for John.”
  • “Alexa, ask My Med Tracker when Sarah last had her Tylenol.”
  • “Alexa, ask My Med Tracker for Sarah’s medical history on July 4th.”

🧹 Error Handling

The skill will respond with a generic fallback if an error occurs:

“Sorry, I had trouble doing what you asked. Please try again.”


📌 Notes

  • Email results are only sent to the Alexa-linked email address.
  • DynamoDB date keys use formatted UTC timestamps.
  • If deploying to production, move SES out of sandbox mode.

📄 License

MIT License
(c) 2025 Ezra Akresh


About

Amazon Skill

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published