![Med-X AI Logo](https://api.prod.med-x.ai/public/images/MedX-Logo.png)

# Laravel Appointment Booking & Management System (HIPAA Compliant)

Welcome to the Laravel Appointment Booking & Management System by Med-X AI, designed to meet HIPAA compliance requirements. This application ensures the security and privacy of patient information as mandated by the Health Insurance Portability and Accountability Act (HIPAA).

## Table of Contents

- [Features](#features)
- [Prerequisites](#prerequisites)
- [Installation](#installation)
- [Configuration](#configuration)
- [Usage](#usage)
- [Security and Compliance](#security-and-compliance)
- [Contributing](#contributing)
- [License](#license)

## Features

- Appointment's audio to text, reports analysis, SOAP summary generation driven by GEN AI
- Secure patient data management
- Role-based access control
- Audit logging for compliance
- Encrypted data storage and transmission
- Integration with Electronic Health Records (EHR) systems

## Prerequisites

- PHP >= 8.2
- Laravel >= 11.0
- Composer
- SQLite
- OpenSSL
- Apache web server

## Installation

1. **Clone the repository:**
    ```bash
    git clone git@bitbucket.org:medx-root/medx-integration.git
    cd medx-integration
    ```

2. **Install dependencies:**
    ```bash
    composer install
    ```

3. **Copy the environment file and generate an application key:**
    ```bash
    cp .env.example .env
    php artisan key:generate
    ```

4. **Configure the database connection in the `.env` file:**
    ```env
    DB_CONNECTION=sqlite
    ```

5. **Run database migrations:**
    ```bash
    php artisan migrate
    ```

6. **Seed the database (optional):**
    ```bash
    php artisan db:seed
    ```

7. **Start the development server:**
    ```bash
    php artisan serve
    ```

## Configuration

### Environment Variables

Ensure you have the following environment variables set in your `.env` file:

```env
APP_ENV=production (for production environment)
APP_DEBUG=false (to disable debug mode in production)
ENCRYPTION_KEY (a strong, unique encryption key for data encryption)
LOG_CHANNEL=daily (to ensure logs are rotated daily)
# GEN101.AI Details
GEN_BASE_URL=(101gen.ai base url)
GEN_CLIENT_ID=(101gen.ai client id)
GEN_CLIENT_SECRET=(101gen.ai client secret)
GEN_PROJECT_ID=(101gen.ai project id)
GEN_IMG_ANALYZE_PROJECT_ID=(101gen.ai image analyzing project id)
GEN_PRESCRIPTION_ID=(101gen.ai prescription generation project id)
GEN_CUSTOMER_ID=(101gen.ai customer id)
SOAPTOKEN=(101gen.ai auth token)
# zapEHR Details
ZAPEHRDOMAIN=(zapEHR auth url)
CLIENT_ID=(zapEHR client id)
CLIENT_SECRET=(zapEHR client secret)
REDIRECT_URI=(call backurl of server)
TIMEOUT=(system auto logout time)
ZAPEHR_BASE_URL=(zapEHR API url)
ZAPEHR_PROJECT_ID=(zapEHR project id)
Z3_BUCKET_URL=(zapEHR z3 bucket url)
Z3_BUCKET_NAME=(zapEHR z3 bucket name)
# LOG FILE ACCESS PASSWORD
LOG_VIEWER_PASSWORD=(Log system Login password)
APP_LOG_TIMEZONE=(system timezone)
# EPIC CONFIGURATION
EPIC_CLIENT_ID=(Epic client id)
EPIC_REDIRECT_URI=(Epic server callback url)
EPIC_AUTH_URI=(Epic auth url)
EPIC_BASE_URL=(Epic api base url)
# AUTH Login
ZAPEHR_AUTH_URL=(ZapEHR auth url)
ZAPEHR_AUDIENCE=(ZapEHR audience url)
ZAPEHR_SCOPE=(ZapEHR scope)
ZAPEHR_RESPONSE_TYPE=(zapEHR response type)
ZAPEHR_CODE_CHALLENGE_METHOD=(zapEHR challenge method)
ZAPEHR_GRANT_TYPE=(zapEHR token type)
ZAPEHR_TOKEN_URL=(zapEHR exchange code to token url)
ENCRYPTION_METHOD=(token encryption method for web)
ZAPEHR_PROFILE_API_URL=(zapEHR login profile url)
```

### Schedule Command

Schedule command to generate GEN AI token.


## HTTPS

Configure your web server to use HTTPS to encrypt data in transit. This is crucial for HIPAA compliance.

## Usage

### Access the application: 
	Install mobile application and log in with your practitioner credentials. You will be able to add patient, add appointment, exicute and manage scheduled appointment, reports etc...

### Role Management:
	We will manage roles and access permissions of users from EHR.

## Security and Compliance
	To ensure HIPAA compliance, the following measures are implemented:

### Data Encryption
	- At Rest: All sensitive data is encrypted in the database using AES-256 encryption.
	- In Transit: Ensure your web server is configured to use HTTPS to encrypt data transmission.

### Access Controls
	- Role-Based Access Control (RBAC): Users are assigned roles to limit access to sensitive information.
	- Authentication: Strong password policies are recommended.

### Auditing
	- Audit Logs: All access and modifications to patient data are logged. Logs are stored securely and are tamper-evident.

### Regular Updates and Patching
	- Keep the system and its dependencies up to date to mitigate vulnerabilities.

### Backup and Disaster Recovery
	- Regular backups are performed to ensure data integrity and availability in case of system failure.

## Contributing
	- Contributions not required as we have own product.

## License
	- This project is licensed under the MIT License.