Injury Summary Generator
This project automates the process of creating a demand letter for a client based on medical records in PDF format. It extracts relevant information from medical records and generates a "Summary of Injuries" section in a table format.
Data Source
The ICD-10 codes used in this project are sourced from the Centers for Medicare & Medicaid Services (CMS) website. You can find the official ICD-10 code lists at:
https://www.cms.gov/medicare/coordination-benefits-recovery/overview/icd-code-lists
This authoritative source ensures that our project uses up-to-date and accurate ICD-10 codes for classifying diagnoses.
Features
- PDF Processing: Reads multiple PDF files containing medical records and extracts text.
- Information Extraction: Extracts key information such as visit dates, diagnoses, and page numbers.
- ICD-10 Code Determination: Determines appropriate ICD-10 codes for extracted diagnoses.
- PDF Generation: Creates a summary PDF with a formatted table of extracted information.
Installation
You can install the Injury Summary Generator using pip:
pip install injury-summary-generator
Usage
After installation, you can run the Injury Summary Generator using the following command:
injury-summary-generator <input_folder> <output_folder>
Where:
<input_folder>is the path to the folder containing the medical record PDF files.<output_folder>is the path where the output summary PDF will be saved.
To check the version of the installed package, use:
injury-summary-generator --version
Project Structure
generate_summary_of_injuries/: Main package directory.__init__.py: Package initialization file._metadata.py: Package metadata.main.py: Entry point for the command-line interface.processor.py: Main processing logic.pdf_reader.py: Handles reading PDF files and extracting text.date_extractor.py: Extracts dates from text.diagnosis_extractor.py: Extracts diagnoses from text.icd_code_determiner.py: Determines ICD-10 codes based on diagnoses.pdf_creator.py: Creates the final summary PDF.data/: Contains data files used by the project.icd10_codes.csv: CSV file containing ICD-10 codes and descriptions.
tests/: Contains unit tests for the project.setup.pyandsetup.cfg: Configuration files for packaging and distribution.requirements.inandrequirements.txt: Lists Python dependencies for the project.MANIFEST.in: Specifies additional files to include in the package.README.md: Provides information about the project and how to use it..gitignore: Specifies files and directories to be ignored by Git.
Development
To set up the development environment:
- Clone the repository:
git clone https://github.com/yourusername/injury-summary-generator.git - Create a virtual environment:
python -m venv venv - Activate the virtual environment:
- On Windows:
venv\Scripts\activate - On macOS and Linux:
source venv/bin/activate
- On Windows:
- Install dependencies:
pip install -r requirements.txt - Install the package in editable mode:
pip install -e .
Testing
To run the tests, use the following command:
pytest
Contributing
Contributions to this project are welcome. Please follow these steps:
- Fork the repository.
- Create a new branch (
git checkout -b feature/your-feature-name). - Make your changes and commit them (
git commit -am 'Add some feature'). - Push to the branch (
git push origin feature/your-feature-name). - Create a new Pull Request.
Releasing
To create a new release:
- Update the version number in
setup.py. - Create a new tag with the version number:
git tag v1.0.0 - Push the tag to GitHub:
git push origin v1.0.0 - Create a new release on GitHub, describing the changes and new features.
- Build and upload the package to PyPI:
python setup.py sdist bdist_wheel twine upload dist/*
License
This project is licensed under the MIT License - see the LICENSE file for details.
Metadata
Release files for injury-summary-generator 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| injury_summary_generator-1.1.0.tar.gz | 859.9 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| injury_summary_generator-1.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 2.3 MB
Release files / injury_summary_generator-1.1.0.tar.gz
| Download URL | injury_summary_generator-1.1.0.tar.gz |
|---|---|
| Size | 859.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
de1d62ac5161eb45911327d90dd4c13d867d4b89e47b9df4edadea2f4219d2ac
|
|
BLAKE2b-256 checksum How to use checksums |
0b9d2d5af31d6d1e0f860d7cdcf497de0028b56d91f68428108a2d27da0fa059
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.6
|
Release files / injury_summary_generator-1.1.0-py3-none-any.whl
| Download URL | injury_summary_generator-1.1.0-py3-none-any.whl |
|---|---|
| Size | 1.4 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
019bef6f84f84dcd7eb71424efa0e493d84ce2496bcc08302762e8ddf3823ac7
|
|
BLAKE2b-256 checksum How to use checksums |
301c8344e2c51e7d859795f886b219f57bbec8cde5ca982ec23acc7f5f55479c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.6
|
Security for injury-summary-generator 1.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.