{"id":27104338,"url":"https://github.com/mlengineershub/ai_action_summit_hackathon_an2i","last_synced_at":"2025-04-06T17:32:44.685Z","repository":{"id":277822050,"uuid":"933148968","full_name":"mlengineershub/ai_action_summit_hackathon_an2i","owner":"mlengineershub","description":null,"archived":false,"fork":false,"pushed_at":"2025-02-16T11:07:32.000Z","size":772,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-02-16T11:28:53.691Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mlengineershub.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-15T09:09:04.000Z","updated_at":"2025-02-16T11:07:36.000Z","dependencies_parsed_at":"2025-02-16T11:38:59.305Z","dependency_job_id":null,"html_url":"https://github.com/mlengineershub/ai_action_summit_hackathon_an2i","commit_stats":null,"previous_names":["mlengineershub/ai_action_summit_hackathon_an2i"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlengineershub%2Fai_action_summit_hackathon_an2i","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlengineershub%2Fai_action_summit_hackathon_an2i/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlengineershub%2Fai_action_summit_hackathon_an2i/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlengineershub%2Fai_action_summit_hackathon_an2i/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mlengineershub","download_url":"https://codeload.github.com/mlengineershub/ai_action_summit_hackathon_an2i/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247522745,"owners_count":20952617,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-04-06T17:32:43.664Z","updated_at":"2025-04-06T17:32:44.677Z","avatar_url":"https://github.com/mlengineershub.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ai_action_summit_hackathon_an2i\n\nA comprehensive medical prescription analysis system that leverages AI to enhance patient care and medical decision-making.\n\n## Our Approach\n\nOur system implements a multi-faceted approach to medical analysis and prescription safety:\n\n1. **Real-time Conversation Analysis**\n   - Automated extraction of medical context from doctor-patient dialogues\n   - Dynamic generation of relevant medical queries\n   - Intelligent follow-up question suggestions\n\n2. **Prescription Safety System**\n   - Automated anomaly detection in prescriptions\n   - Cross-referencing with patient medication history\n   - Real-time alerts for potential drug interactions\n   - Analysis of patient medication adherence patterns\n\n3. **Comprehensive Reporting**\n   - Side-by-side display of medical reports and prescription analysis\n   - Detailed symptom and pathology documentation\n   - Clear treatment plans with safety considerations\n   - Intelligent summarization of medical findings\n\n![Dashboard Screenshot](pictures/dashboard.png)\n\n### Generated Reports\n\nAccess our sample medical reports and analysis:\n- [Technical Report](reports/Tech_Report.pdf)\n- [Business Plan](reports/Buisness_Plan.pdf)\n\n\n## Flask API Service\n\nThe project includes a robust Flask API that provides various medical analysis endpoints:\n\n### API Endpoints\n\n- `/detect-prescription-anomalies` - Analyzes prescriptions for potential conflicts\n- `/extract-ordonnance` - Extracts structured data from medical prescriptions\n- `/summarize-ordonnances` - Generates summaries of multiple prescriptions\n- `/search-medical-articles` - Searches for relevant medical literature\n- `/fetch-article-abstract/{pmid}` - Retrieves abstracts of medical articles\n- `/generate-search-summary` - Summarizes medical research findings\n- `/generate-follow-up-questions` - Generates relevant follow-up questions\n- `/extract-pertinent-points` - Extracts key medical points from conversations\n- `/generate-search-propositions` - Suggests relevant medical search queries\n- `/generate-report` - Generates comprehensive medical reports\n\nThe API runs on port 5000 by default and accepts JSON payloads for POST requests.\n\n## Streamlit Dashboard\n\nThe project includes a user-friendly Streamlit dashboard that provides a graphical interface to interact with the API services. The dashboard offers:\n\n### Features\n\n- Interactive navigation sidebar for different functionalities\n- Form-based input for medical data\n- Real-time API response display\n- Error handling and user feedback\n- Medical article search interface with abstract viewing\n- Report generation interface\n- Prescription anomaly detection with visual alerts\n\n### Dashboard Pages\n\n1. Prescription Analysis\n   - Anomaly detection\n   - Ordonnance extraction\n   - Prescription summarization\n\n2. Medical Research\n   - Article search with configurable results\n   - Abstract viewing\n   - Search summary generation\n\n3. Medical Documentation\n   - Follow-up question generation\n   - Pertinent point extraction\n   - Report generation\n\nThe Streamlit dashboard connects to the Flask API at `http://localhost:5000`.\n\n# Development\n\n## Notes\n- commit messages should follow conventional commits spec: https://www.conventionalcommits.org/en/v1.0.0/ (see sections: Summary, Examples)\n- work must be merged from feature branches into main branch using Pull Requests. Once your code is ready to be reviewed, please mark me as a reviewer, which will notify me you're ready fir code review \n\n## How-to's \n\n### Install \n\n1. install uv: https://docs.astral.sh/uv/getting-started/installation/#standalone-installer\n2. run\n   ```shell\n   uv sync --all-extras --dev\n   ```\n3. Before running scripts add the current directory to the PythonPath:\n```\nexport PYTHONPATH=/home/azzedine/Projects/ai_action_summit_hackathon_an2i:$PYTHONPATH\n```\n\n### Running the Services Locally\n\n1. Start the Flask API:\n```shell\npython3 -m workspace.src.api\n```\n\n2. Start the Streamlit Dashboard:\n```shell\nstreamlit run workspace/app/main.py\n```\n\n### Docker Deployment\n\nThe project can be run using Docker Compose, which sets up all required services automatically.\n\n#### Prerequisites\n\n1. Install Docker and Docker Compose on your system\n2. Copy the environment variables file:\n   ```shell\n   cp .env.example .env\n   ```\n3. Update the `.env` file with your credentials:\n   - API_KEY: Your API key\n   - PROVIDER_URL: Your provider URL\n   - MongoDB credentials (if using MongoDB):\n     - USERNAME_MONGODB\n     - PASSWORD_MONGODB\n     - INSTANCE_MONGODB\n     - REGION_MONGODB\n     - PATH_TLS_CERTIFICATE_MONGODB\n\n#### Services\n\nThe Docker Compose setup includes the following services:\n\n- **API Service** (Port 5000): Flask API server\n- **Streamlit Dashboard** (Port 8501): Web interface\n- **Redis** (Port 6379): Message broker for Celery\n- **Celery Workers**:\n  - LLM Worker: Handles language model tasks\n  - API Worker: Handles API-related tasks\n- **Flower** (Port 5555): Celery monitoring interface (credentials: admin/admin)\n\n#### Running with Docker Compose\n\n1. Build and start all services:\n   ```shell\n   docker compose up --build\n   ```\n\n2. Access the services:\n   - Streamlit Dashboard: http://localhost:8501\n   - Flask API: http://localhost:5000\n   - Flower Dashboard: http://localhost:5555\n\n3. Stop all services:\n   ```shell\n   docker compose down\n   ```\n\n### Lint (check \u0026 fix)\n1. open a new terminal in the root of this repo and run:\n\n```shell\nuv run ruff check --fix\nuv run ruff format\nuv run mypy .\n```\n\n### Run tests \n1. open a new terminal in the root of this repo and run:\n```shell\nuv run pytest","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmlengineershub%2Fai_action_summit_hackathon_an2i","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmlengineershub%2Fai_action_summit_hackathon_an2i","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmlengineershub%2Fai_action_summit_hackathon_an2i/lists"}