How umessen/fhir-pyrate works
Main Components
a. Core Components:
• Authentication Module (Ahoy)
• FHIR Query Engine (Pirate)
• Text Mining Module (Miner)
• DICOM Download Module (DicomDownloader)
• Utility Components (under fhir_pyrate/util)
b. External Systems:
• FHIR Server
• DICOM Web Adapter/PACS System
• Authentication Server
Component Relationships
[Authentication Server] <---> [Ahoy Module]
• ^ |
• v
[FHIR Server] <-------------> [Pirate Module] <---> [Pandas DataFrame]
• ^ ^
[DICOM Web/PACS] <------> [DicomDownloader]
[Pandas DataFrame] <---> [Miner Module]
Detailed Component Descriptions
a. Ahoy Module:
• Input: Authentication credentials (username/password/token)
• Output: Authentication token
• Supported methods: password, token, environment variables
• Connection to authentication server
b. Pirate Module:
• Input: FHIR queries, authentication token
• Output: FHIR bundles, pandas DataFrames
• Key features:
• Multiprocessing support
• Bundle caching
• FHIRPath processing
• Multiple resource handling
c. Miner Module:
• Input: DataFrame with text data
• Output: Filtered/processed DataFrame
• Features: RegEx search, SpaCy integration
• Text processing capabilities
d. DicomDownloader:
• Input: Study/Series UIDs
• Output: DICOM/NIfTI files
• Connection to DICOM Web Adapter
• Download management and error handling
Important Implementation Details
• Multiprocessing capabilities
• Caching mechanisms
• Authentication flow
• Error handling paths