Skip to content

BAH-4661 - Update Imaging Study Completion DateTime with Study Acquisition DateTime#65

Merged
subhashydv merged 6 commits into
masterfrom
BAH-4661
Apr 24, 2026
Merged

BAH-4661 - Update Imaging Study Completion DateTime with Study Acquisition DateTime#65
subhashydv merged 6 commits into
masterfrom
BAH-4661

Conversation

@subhashydv

@subhashydv subhashydv commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

Overview : BAH-4661

This PR enhances the PACS integration by updating the ImagingStudy completion datetime with the actual study acquisition datetime fetched from DCM4CHEE DICOM metadata, including proper handling of timezone offsets.

Changes Made

🆕 New Components

Configuration:

  • Added DCM4CHEE configuration properties:

    • dcm4chee.base.url (DCM4CHEE_BASE_URL env variable)
    • dcm4chee.aet (default: DCM4CHEE)
    • dcm4chee.connection.timeout (default: 10000ms)
    • dcm4chee.read.timeout (default: 10000ms)

🔄 Modified Components

ImagingStudyServiceImpl:

  • Enhanced updateImagingStudyAsAvailable() to:

    • Fetch DICOM metadata from DCM4CHEE
    • Extract acquisition datetime from metadata (with fallback logic)
    • Add FHIR extension for completion date
    • Update ImagingStudy with both status and completion datetime

🔑 Key Features

  1. Timezone Support: Properly handles DICOM datetime with timezone offsets (e.g., +0530, -0500)

  2. Fallback Logic: Tries multiple DICOM tags to extract acquisition datetime:

    • Primary: Acquisition DateTime with Offset (0008002A)
    • Fallback 1: Acquisition Date + Time + Timezone Offset
    • Fallback 2: Acquisition Date + Time (local time)
  3. FHIR Compliance: Adds completion date as FHIR extension following the URL pattern: http://fhir.bahmni.org/ext/imaging-study/completion-date

  4. Error Handling: Gracefully handles missing or invalid metadata

🎯 Technical Details

  • Uses JSON PATCH operations to update ImagingStudy resource
  • Converts DICOM datetime formats to FHIR-compliant ISO 8601 format
  • Supports fractional seconds in DICOM time values
  • Thread-safe date parsing using SimpleDateFormat with proper synchronization

@subhashydv subhashydv requested a review from Samridhi-98 April 23, 2026 09:44
Comment thread package/docker/pacs-integration/templates/application.properties.template Outdated

@Samridhi-98 Samridhi-98 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@subhashydv subhashydv merged commit 3292008 into master Apr 24, 2026
1 check passed
@subhashydv subhashydv deleted the BAH-4661 branch April 24, 2026 09:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants