Skip to content

Conversation

@subhashydv
Copy link
Contributor

📋 Summary

This PR adds support for creating FHIR ImagingStudy resources in OpenMRS when radiology orders are processed through the PACS integration service. The feature is configurable and can be enabled/disabled via configuration.

🚀 Key Features Added

1. FHIR ImagingStudy Support

  • Created FHIR data contract models for ImagingStudy resources
  • Implemented ImagingStudyService and ImagingStudyServiceImpl for managing ImagingStudy creation
  • Added ImagingStudyMapper to map PACS orders to FHIR ImagingStudy format

2. New Files Added

FHIR Contract Models:

  • FhirImagingStudy.java - Main FHIR ImagingStudy resource model
  • FhirIdentifier.java - FHIR identifier structure
  • FhirReference.java - FHIR reference structure

Services:

  • ImagingStudyService.java - Service interface for ImagingStudy operations
  • ImagingStudyServiceImpl.java - Implementation of ImagingStudy service

Mappers:

  • ImagingStudyMapper.java - Maps order data to FHIR ImagingStudy format

3. Enhanced Existing Services

PacsIntegrationService:

  • Added conditional ImagingStudy creation when processing encounters
  • Integrated with LocationResolver for determining study locations
  • Uses StudyInstanceUID for DICOM correlation

OpenMRSService:

  • Extended to support FHIR ImagingStudy resource creation via OpenMRS FHIR API

4. Configuration Support

Properties Added:

  • create.imagingstudy.enabled - Feature toggle for ImagingStudy creation
  • order.requested.location.attribute.name - Configures location attribute name

Files Updated:

  • application.properties - Added local development configuration
  • application.properties.template - Added Docker deployment configuration with environment variable support (${CREATE_IMAGING_STUDY_ENABLED})

5. Dependency Updates

  • Updated POM dependencies to support FHIR functionality

🔧 Configuration

Environment Variables

  • CREATE_IMAGING_STUDY_ENABLED - Set to true or false to enable/disable the feature (defaults to false if not set)

Docker Compose Example

environment:
  - CREATE_IMAGING_STUDY_ENABLED=true

📝 Technical Details

Integration Flow

  1. Encounter is received via AtomFeed
  2. Radiology orders are extracted
  3. HL7 message is sent to PACS modality
  4. If create.imagingstudy.enabled=true:
    • Order location is resolved
    • StudyInstanceUID is generated
    • FHIR ImagingStudy resource is created in OpenMRS

Copy link
Member

Choose a reason for hiding this comment

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

Pls update the .gitignore to not include these files

String studyInstanceUID,
String description) {

if (studyInstanceUID == null || studyInstanceUID.trim().isEmpty()) {
Copy link
Member

Choose a reason for hiding this comment

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

StringUtils.isNotBlank() can be used

order.requested.location.attribute.name=REQUESTED_LOCATION
order.requested.location.attribute.name=REQUESTED_LOCATION

create.imagingstudy.enabled=true
Copy link
Member

Choose a reason for hiding this comment

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

Default should be false, here as well

@mohan-13 mohan-13 merged commit 302a5dc into master Dec 15, 2025
2 checks passed
@mohan-13 mohan-13 deleted the BAH-4335 branch December 15, 2025 07:01
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.

4 participants