Metadata-Version: 2.4
Name: radreport
Version: 0.7.0
Summary: Parse, de-identify, structure, and export radiology free-text reports to FHIR
Author-email: Mustafa Merchant <mustafamerchant072@gmail.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/mustafamm072/radreport
Project-URL: Documentation, https://github.com/mustafamm072/radreport#readme
Project-URL: Issues, https://github.com/mustafamm072/radreport/issues
Keywords: radiology,DICOM,FHIR,medical imaging,healthcare,NLP,de-identification,PHI,HIPAA,interval change,prior comparison,structured reporting,completeness
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Healthcare Industry
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Scientific/Engineering :: Medical Science Apps.
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: pytest-cov; extra == "dev"
Dynamic: license-file

# radreport

Turn English-language radiology report text into structured data with Python or
from the command line. Radreport runs locally and has no runtime dependencies.

[![PyPI](https://img.shields.io/pypi/v/radreport)](https://pypi.org/project/radreport/)
[![Python](https://img.shields.io/badge/python-3.9+-blue.svg)](https://www.python.org/)
[![License](https://img.shields.io/badge/license-MIT-yellow.svg)](LICENSE)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.21147298.svg)](https://doi.org/10.5281/zenodo.21147298)

## Install

```bash
python -m pip install radreport
```

The examples here reflect the source checkout. To use the latest changes, run
`python -m pip install .` from the repository root.

## Try it with a synthetic report

```python
from radreport import RecommendationExtractor, ReportParser

text = """FINDINGS:
A right upper lobe nodule measures 8 x 6 mm.
IMPRESSION:
Follow-up CT in 6 months is recommended.
"""

report = ReportParser().parse(text, modality="CT")
RecommendationExtractor().extract(report)

print(report.all_measurements[0].dimensions_mm)  # [8.0, 6.0]
print(report.recommendations[0].interval)         # 6 months
```

Use `report.to_json()` for the structured report or `report.to_flat_dict()` for
one row in a research dataset.

## Command line

```bash
radreport report.txt --recommend
radreport - --recommend < report.txt
radreport reports/*.txt --deidentify --recommend --format csv -o cohort.csv
radreport current.txt --compare prior.txt --modality CT
radreport report.txt --template ct_chest
radreport --list-templates
radreport report.txt --fhir --modality CT
```

Batch JSON is an array whenever multiple inputs are supplied. If some inputs
fail, the command still writes successful results, prints diagnostics to stderr,
and exits with status `1`. See the [CLI reference](wiki/CLI-Reference.md) for flags
and output formats.

## Guides

| Task | Guide |
|------|-------|
| Extract sections, anatomy, and measurements | [Parsing](wiki/Parsing.md) |
| Pull out follow-up intervals and modalities | [Follow-up recommendations](wiki/Follow-up-Recommendations.md) |
| Surface mentions of critical findings for review | [Critical findings](wiki/Critical-Findings.md) |
| Compare measured findings across studies | [Prior-study comparison](wiki/Interval-Change.md) |
| Check report wording against a checklist | [Templates](wiki/Report-Templates.md) |
| Redact common identifiers before processing | [De-identification](wiki/De-identification.md) |
| Export a FHIR DiagnosticReport | [FHIR export](wiki/FHIR-Export.md) |

See the [Python API reference](wiki/API-Reference.md) and the runnable
[synthetic end-to-end example](examples/full_pipeline.py).

The [follow-up benchmarks](benchmarks/README.md) cover chest X-rays and multiple
other report types and include a protocol for measuring reviewer time.

## Use and limitations

Radreport accepts plain text. Rules and terminology are tuned for English, and
outputs are intended for research, integration work, and human review. Template
coverage measures textual mentions. Comparison labels reflect heuristic matching
between reports.

Review redacted text before sharing it. CLI de-identification also substitutes
numbered labels for input filenames. The Python redaction audit contains the
original matched text, and a FHIR `--patient-id` is copied into the output when
provided. See [known limitations](KNOWN_ISSUES.md) for details by feature.

## Contributing

See [CONTRIBUTING.md](CONTRIBUTING.md) for local setup and how to report a parsing
issue with a synthetic example. Changes are documented in the
[changelog](CHANGELOG.md). If you use Radreport in research, see
[CITATION.cff](CITATION.cff). The code is available under the [MIT license](LICENSE).
