File size: 2,396 Bytes
ff08745
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
---
title: Pdf Qa
emoji: 
colorFrom: yellow
colorTo: gray
sdk: streamlit
sdk_version: 1.40.0
app_file: app.py
pinned: false
short_description: Ask questions from your PDF!
---

Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference

# St Helier Hospital - Automatic Glaucoma Triage System

An AI-powered system for automatically triaging glaucoma referrals, developed by Dr Fernando Ly.

## Features

- Analyzes PDF and image-based referral documents
- Provides triage recommendations (Urgent/Routine)
- Suggests appointment type (Face-to-face/Virtual)
- Evaluates need for visual field tests
- Considers multiple documents per patient
- Uses Google's Gemini 2.0 AI model for analysis

## Deployment on HuggingFace Spaces

1. Fork this repository to your HuggingFace Space
2. Add your Gemini API key as a secret:
   - Go to your Space's Settings
   - Under "Repository Secrets"
   - Add a new secret with name `GEMINI_API_KEY`
   - Set its value to your Gemini API key

## Local Development Setup

1. Install system dependencies:
   ```bash
   sudo apt-get install poppler-utils  # For Ubuntu/Debian
   # OR
   brew install poppler  # For macOS
   ```

2. Install Python dependencies:
   ```bash
   pip install -r requirements.txt
   ```

3. Create a `.streamlit/secrets.toml` file with your API key:
   ```toml
   GEMINI_API_KEY = "your_api_key_here"
   ```

4. Run the application:
   ```bash
   streamlit run app.py
   ```

## Usage

1. Upload one or more referral documents (PDF or images)
2. The system will automatically:
   - Display the uploaded documents
   - Analyze clinical information
   - Provide triage recommendations
   - Suggest appointment type
   - Indicate if visual field tests are needed

## Notes

- Face-to-face appointments are mandatory for cases requiring gonioscopy
- Urgent cases should be seen within 2 weeks
- If a visual field test is present in the referral, a new one may not be needed
- The system is designed to assist clinical decision-making but does not replace professional judgment

## Security

- Never share or commit your API key
- Use HuggingFace Spaces secrets management for deployment
- For local development, use Streamlit secrets
- If you suspect your API key has been compromised, regenerate it immediately

## Credits

Developed by Dr Fernando Ly for St Helier Hospital
© 2024 All rights reserved