File size: 5,575 Bytes
3872518
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
# 🀝 Contributing to Healthcare AI Platform

Thank you for your interest in contributing! This document provides guidelines for contributing to the project.

---

## πŸš€ Quick Start

1. **Fork the repository**
2. **Clone your fork**
   ```bash
   git clone https://github.com/YOUR_USERNAME/healthcare-rag-agent.git
   cd healthcare-rag-agent
   ```
3. **Create a branch**
   ```bash
   git checkout -b feature/your-feature-name
   ```
4. **Install dependencies**
   ```bash
   pip install -r requirements-local.txt
   ```
5. **Make your changes**
6. **Test your changes**
   ```bash
   pytest tests/
   ```
7. **Commit and push**
   ```bash
   git add .
   git commit -m "feat: your feature description"
   git push origin feature/your-feature-name
   ```
8. **Create a Pull Request**

---

## πŸ“‹ Development Guidelines

### Code Style

- **Python**: Follow PEP 8
- **Formatting**: Use `black` for code formatting
- **Linting**: Use `flake8` for linting
- **Type hints**: Use type hints where possible
- **Docstrings**: Use Google-style docstrings

### Commit Messages

Follow conventional commits:

- `feat:` - New feature
- `fix:` - Bug fix
- `docs:` - Documentation changes
- `refactor:` - Code refactoring
- `test:` - Adding tests
- `chore:` - Maintenance tasks

Examples:
```
feat: add multimodal image analysis
fix: resolve timeout in report analyzer
docs: update API documentation
```

---

## πŸ§ͺ Testing

### Running Tests

```bash
# All tests
pytest tests/

# Specific test file
pytest tests/test_intelligence.py

# With coverage
pytest --cov=. tests/
```

### Writing Tests

- Place tests in `tests/` directory
- Name test files `test_*.py`
- Use descriptive test names
- Include docstrings

Example:
```python
def test_query_routing():
    """Test that router correctly classifies query types."""
    router = RouterAgent()
    result = router.route("What are diabetes symptoms?")
    assert result["type"] == "symptom_check"
```

---

## πŸ—οΈ Architecture Guidelines

### Adding New Features

1. **Services** (`services/`) - Business logic
2. **Agents** (`agents/`) - AI agents
3. **API** (`api/`) - REST endpoints
4. **UI** (`streamlit_app/`) - Frontend

### File Organization

- Keep files focused and single-purpose
- Use clear, descriptive names
- Add docstrings to all modules
- Import from `utils/config.py` for configuration

---

## πŸ” Security

### Important Rules

- **Never commit API keys** - Use environment variables
- **Never commit `.env` files** - Use `.env.example` as template
- **Hash passwords** - Use bcrypt
- **Validate inputs** - Sanitize all user inputs
- **Log security events** - Use audit service

### Pre-commit Hooks

The project uses pre-commit hooks to prevent secrets from being committed:

```bash
# Install pre-commit
pip install pre-commit
pre-commit install

# Run manually
pre-commit run --all-files
```

---

## πŸ“š Documentation

### When to Update Docs

- **New features** - Update README and feature docs
- **API changes** - Update API documentation
- **Breaking changes** - Update CHANGELOG
- **Configuration** - Update `.env.example`

### Documentation Files

- `README.md` - Main project documentation
- `USER_GUIDE.md` - User manual
- `ARCHITECTURE.md` - System design
- `docs/features/` - Feature-specific docs

---

## πŸ› Reporting Bugs

### Before Reporting

1. Check existing issues
2. Try latest version
3. Reproduce the bug
4. Gather logs and error messages

### Bug Report Template

```markdown
**Description**
Clear description of the bug

**Steps to Reproduce**
1. Go to...
2. Click on...
3. See error

**Expected Behavior**
What should happen

**Actual Behavior**
What actually happens

**Environment**
- OS: [e.g., macOS 14]
- Python: [e.g., 3.11]
- Version: [e.g., 1.0.0]

**Logs**
```
Paste relevant logs here
```
```

---

## πŸ’‘ Feature Requests

### Suggesting Features

1. Check existing issues and roadmap
2. Describe the problem it solves
3. Explain the proposed solution
4. Consider alternatives

### Feature Request Template

```markdown
**Problem**
What problem does this solve?

**Proposed Solution**
How should it work?

**Alternatives**
What other approaches did you consider?

**Additional Context**
Any other information
```

---

## 🎯 Areas for Contribution

### High Priority

- [ ] Additional medical knowledge sources
- [ ] More comprehensive tests
- [ ] Performance optimizations
- [ ] UI/UX improvements
- [ ] Documentation improvements

### Medium Priority

- [ ] Additional language support
- [ ] Mobile-friendly UI
- [ ] Export functionality
- [ ] Advanced visualizations

### Advanced

- [ ] Real-time monitoring dashboard
- [ ] A/B testing framework
- [ ] Advanced analytics
- [ ] Integration with EHR systems

---

## πŸ”„ Pull Request Process

1. **Update documentation** if needed
2. **Add tests** for new features
3. **Ensure all tests pass**
4. **Update CHANGELOG** if applicable
5. **Request review** from maintainers

### PR Checklist

- [ ] Code follows style guidelines
- [ ] Tests added and passing
- [ ] Documentation updated
- [ ] Commit messages follow convention
- [ ] No secrets in code
- [ ] Branch is up to date with main

---

## πŸ€” Questions?

- **GitHub Issues**: [Open an issue](https://github.com/Santhakumarramesh/healthcare-rag-agent/issues)
- **Discussions**: [GitHub Discussions](https://github.com/Santhakumarramesh/healthcare-rag-agent/discussions)

---

## πŸ“„ License

By contributing, you agree that your contributions will be licensed under the MIT License.

---

**Thank you for contributing to better healthcare AI!** πŸ™