Skip to main content
Glama
nbrain-dicom-sr-ihe-air

nbrain-dicom-sr-ihe-air

README.md
# `nbrain-dicom-sr-ihe-air` — Radiology AI `DICOM PS3.16 TID 1500`, `IHE AI Results (AIR)` & `HL7 FHIR R4` Bidirectional Engine + MCP Server

[![License: MIT](https://img.shields.io/badge/License-MIT-emerald.svg)](./LICENSE)
[![Python 3.10+](https://img.shields.io/badge/Python-3.10%2B%20Zero--Dep-blue.svg)](./pyproject.toml)
[![MCP Registry](https://img.shields.io/badge/MCP-io.github.NBrain--Studio%2Fnbrain--dicom--sr--ihe--air-purple.svg)](./server.json)

Engineered by **[Eng. Nadeem Mohamed Badr El-Din](https://nadeembadr.com)** at **[NBrain (`منظومة إن برين` — nbra.in)](https://nbra.in)** to bridge clinical deep-learning models (such as **Nabd Masr** 14-pathology Thoracic CXR and **MedCore CephTrace** 29-landmark cephalometrics) into hospital PACS and EHR systems without clinical coding drift.

## Standards Implemented
1. **DICOM PS3.5 Section B.2 (`2.25.<UUID-int>`)**: Deterministic UUIDv5-backed DICOM UID generation (`<= 64` chars, strict no-leading-zero component enforcement).
2. **DICOM PS3.16 Template `TID 1500` (`Measurement Report`) & `PS3.18` DICOMweb JSON (`application/dicom+json`)**: Encodes AI algorithm provenance (`TID 1001` Device Observer), 2D `SCOORD` bounding boxes / landmarks, calibrated `Decimal` probabilities, and quantitative angular/linear measurements (`SNA`, `SNB`, `ANB`, `FMA`, `IMPA`).
3. **IHE AI Results (`AIR`) Safety Profile**: Enforces `CompletionFlag = "COMPLETE"` and `VerificationFlag = "UNVERIFIED"` on autonomous AI outputs so unreviewed machine inferences never masquerade as radiologist-signed reports.
4. **HL7 DICOM-SR to FHIR R4 Implementation Guide**: Deterministically translates `TID 1500` reports into FHIR R4 transaction `Bundle`s (`ImagingStudy` + `Device` + coded `Observation`s with SNOMED-CT / RadLex / LOINC / UCUM + `preliminary` `DiagnosticReport`).

## Quick Verification
```bash
PYTHONPATH=src python -m unittest discover -s tests -v
```

TDQS

A3.5/5.0

Scored across 4 tools

Disambiguation5/5

Each tool occupies a distinct slot in the pipeline: build (findings→SR), validate (audit SR), translate (SR→FHIR), and UID minting/validation. The descriptors clearly disambiguate direction and object of each operation, so misselection is unlikely.

Naming Consistency4/5

All names are snake_case with a leading verb (translate_, validate_or_mint_, build_, validate_), which is a predictable pattern. Minor deviations: the compound 'validate_or_mint' verb and varying suffix phrasing (target format spelled out only in some names) make lengths inconsistent.

Tool Count4/5

Four tools is a lean but sensible scope for a narrow build-validate-translate pipeline plus a UID helper. The UID utility is somewhat tangential, but nothing feels redundant.

Completeness4/5

The build→validate→translate lifecycle is fully covered, with UID handling as a supporting operation. Gaps remain on the output side: there is no validation for the produced FHIR R4 Bundle and no way to fetch or extract measurements back out of an existing SR.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues