# Athena Workflow Graphic — For Image Generation

## Instructions for AI Image Generator

Create a clean, professional workflow diagram for an athenahealth API Technical Specification. Use a box-and-arrow format with rounded rectangles, clear labels, and a light color scheme (blues, greens, grays). No code — this is for a business/compliance audience.

## Mermaid Diagram (render this or use as reference)

```mermaid
flowchart LR
    subgraph Mobile["Kinometric Mobile App (Flutter)"]
        A1[Conduct Balance Test<br/>4 test types, 10 sec each]
        A2[Score Locally<br/>BalanceScorer engine]
        A3[Generate PDF Report<br/>in-memory, no temp files]
        A1 --> A2 --> A3
    end

    subgraph Server["Kinometric Server (PHP + PostgreSQL)"]
        B1[Authenticate User<br/>user_id + encryption_key]
        B2[Store Test Data<br/>CSV + scores in database]
        B3[AI Analysis<br/>Claude API, cached]
        B4[Proxy Upload to athenaOne<br/>OAuth2 client_credentials]
        B1 --> B2 --> B3
        B1 --> B4
    end

    subgraph Athena["athenaOne (athenahealth)"]
        C1[OAuth2 Token Endpoint<br/>client_credentials grant]
        C2[Clinical Document API<br/>POST PDF to patient chart]
        C3[Patient API<br/>Verification lookup]
        C4[Department API<br/>Browse departments]
    end

    subgraph Web["Kinometric Web Dashboard"]
        D1[Verify Patient Match<br/>Side-by-side comparison]
        D2[Upload PDF to athenaOne<br/>Select department]
        D3[View Uploaded Documents]
    end

    A3 -->|"CSV + Scores<br/>(HTTPS)"| B1
    A3 -->|"PDF + athena_patient_id<br/>(HTTPS)"| B4
    B4 -->|"OAuth2 Token Request"| C1
    C1 -->|"Access Token"| B4
    B4 -->|"POST PDF<br/>(multipart)"| C2
    C2 -->|"Document ID"| B4

    D1 -->|"Verify Patient"| B1
    B1 -->|"GET /patients/{id}"| C3
    D2 -->|"Upload Request"| B4
    D3 -->|"List Documents"| B1
    B1 -->|"GET /documents"| C2

    style Mobile fill:#e3f2fd,stroke:#1565c0,color:#000
    style Server fill:#e8f5e9,stroke:#2e7d32,color:#000
    style Athena fill:#fff3e0,stroke:#e65100,color:#000
    style Web fill:#f3e5f5,stroke:#6a1b9a,color:#000
```

## Key Points the Graphic Should Show

1. **Mobile App** (blue) — conducts test, scores locally, generates PDF in memory
2. **Server** (green) — authenticates, stores data, proxies ALL athenaOne calls
3. **athenaOne** (orange) — receives PDF uploads, provides patient verification
4. **Web Dashboard** (purple) — admin verification and upload interface
5. **All arrows to athenaOne go through the Server** — mobile app NEVER talks directly to athenaOne
6. **HTTPS on all connections**
7. **OAuth2 client_credentials** label on the Server-to-athenaOne connection

## Alternative Prompt for ChatGPT/DALL-E or Similar

"Create a professional integration architecture diagram showing four components: (1) Kinometric Mobile App in blue — conducts balance tests and generates PDF reports, (2) Kinometric Server in green — PHP backend that authenticates users, stores data, and proxies API calls, (3) athenaOne API in orange — athenahealth's platform that receives uploaded clinical documents, (4) Web Dashboard in purple — admin interface for patient verification and uploads. Show arrows: Mobile sends CSV data and PDF upload requests to Server over HTTPS. Server authenticates with athenaOne using OAuth2 client_credentials and uploads PDF clinical documents. Web Dashboard connects to Server for patient verification and document management. Important: the mobile app never connects directly to athenaOne — all communication is proxied through the server. Clean, minimal style suitable for a compliance document."
