Skip to content

Feature/dicom addition - #208

Merged
vishwab1 merged 3 commits into
PSMRI:release-3.13.0from
sehjotsinghunthinkable:feature/dicom-addition
Nov 17, 2026
Merged

vishwab1 merged 3 commits into
PSMRI:release-3.13.0from
sehjotsinghunthinkable:feature/dicom-addition

Conversation

@sehjotsinghunthinkable

@sehjotsinghunthinkable sehjotsinghunthinkable commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

📋 Description

JIRA ID: STOP-749

Please provide a summary of the change and the motivation behind it. Include relevant context and details.


✅ Type of Change

  • 🐞 Bug fix (non-breaking change which resolves an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 🔥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 🛠 Refactor (change that is neither a fix nor a new feature)
  • ⚙️ Config change (configuration file or build script updates)
  • 📚 Documentation (updates to docs or readme)
  • 🧪 Tests (adding new or updating existing tests)
  • 🎨 UI/UX (changes that affect the user interface)
  • 🚀 Performance (improves performance)
  • 🧹 Chore (miscellaneous changes that don't modify src or test files)

ℹ️ Additional Information

Please describe how the changes were tested, and include any relevant screenshots, logs, or other information that provides additional context.

Summary by CodeRabbit

  • New Features
    • Diagnostic documents with gzip encoding are now decompressed during ingestion and retain their encoding when sent onward.
    • DICOM documents are now recognized with the .dcm file extension.
    • Gzip-encoded filenames are cleaned up to avoid including encoding suffixes in the resulting filename.
  • Bug Fixes
    • Gzip content exceeding the supported size limit is rejected, and checksum validation applies to the decompressed content.

…compression

- Map application/dicom to .dcm (was falling back to .dicom)
- Strip ".gz.enc" from stored file name when building the S3 key, since the
  object is decompressed before upload (XRAY.gz.enc -> XRAY.dcm, not XRAY.gz.dcm)
- Cap decompressed size at 256 MB to avoid heap exhaustion on large/malformed payloads
- Add unit tests for ingest (gzip + plain + hash mismatch) and extension mapping

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Explain Change →

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: fdc6f1c2-a155-4dec-b148-ddbd0b39b943

No actionable comments were generated in the recent review.

Walkthrough

The document push service now marks .gz.enc payloads as gzip-encoded and maps DICOM content to the dcm extension. The ingest service decompresses gzip payloads before checksum validation and S3 upload, with a 256 MiB decompressed-size limit.

Changes: Diagnostic document gzip synchronization

Layer / File(s) Summary
Mark outbound document payloads
src/main/java/com/iemr/mmu/service/dataSyncLayerCentral/DiagnosticDocumentPushServiceImpl.java, src/test/java/com/iemr/mmu/service/dataSyncLayerCentral/DiagnosticDocumentPushServiceImplTest.java
The push service adds contentEncoding: "gzip" for stored paths ending in .gz.enc and maps application/dicom to dcm. Tests cover the DICOM mapping and existing extension mappings.
Decode and ingest document payloads
src/main/java/com/iemr/mmu/service/dataSyncLayerCentral/DiagnosticDocumentIngestService.java, src/test/java/com/iemr/mmu/service/dataSyncLayerCentral/DiagnosticDocumentIngestServiceTest.java
The ingest service decompresses payloads marked with contentEncoding: "gzip" before checksum validation and upload. It rejects decompressed content over 256 MiB and removes .gz.enc or .enc from filenames. Tests cover gzip and plain ingestion, filename cleanup, upload behavior, and checksum mismatch handling.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Merge Risk: Low · previous review c0b83

The change adds DICOM handling to document sync. Gzip payloads are decompressed before checksum validation and upload, and DICOM files get the .dcm extension. No runtime defect was established. The commit message lint check currently fails and needs a reworded or squashed commit before merge. Confirm with the producing team that sha256_hash covers the original document, not the gzip bytes.

Pre-merge checks: Passed 3 · Inconclusive 1

Failed Failed checks: 1 inconclusive

Check name Status Explanation Resolution
Title check Inconclusive The title "Feature/dicom addition" is vague. It names DICOM, which is a real part of the change (DICOM mapping to .dcm, DICOM upload and ingestion). However, it does not say what the feature does. It … Rewrite the title to state the primary change. For example: "Add DICOM document ingestion with gzip support". Keep it short, single sentence, and specific.
Passed Passed checks: 3 passed

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "Feature/dicom addition" is vague. It names DICOM, which is a real part of the change (DICOM mapping to .dcm, DICOM upload and ingestion). However, it does not say what the feature does. It omits the gzip handling, the .gz.enc filename cleanup, and the 256 MiB decompression limit. The title is therefore partially related: it refers to a real aspect of the change but not the main point. It also uses a generic 'addition' form.

Resolution

Rewrite the title to state the primary change. For example: "Add DICOM document ingestion with gzip support". Keep it short, single sentence, and specific.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 771f6fd0-3813-457d-83f0-c8b3dd6c3e82
Commits

Reviewing files that changed from the base of the PR and between 034e9eb and c0b831f.

Files selected for processing: 4

  • src/main/java/com/iemr/mmu/service/dataSyncLayerCentral/DiagnosticDocumentIngestService.java
  • src/main/java/com/iemr/mmu/service/dataSyncLayerCentral/DiagnosticDocumentPushServiceImpl.java
  • src/test/java/com/iemr/mmu/service/dataSyncLayerCentral/DiagnosticDocumentIngestServiceTest.java
  • src/test/java/com/iemr/mmu/service/dataSyncLayerCentral/DiagnosticDocumentPushServiceImplTest.java

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@sehjotsinghunthinkable

Copy link
Copy Markdown
Contributor Author

@coderabbitai code review

@coderabbitai

coderabbitai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

@sehjotsinghunthinkable I’ll start a review of this PR.

Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

…compression

- Map application/dicom to .dcm (was falling back to .dicom)
- Strip ".gz.enc" from stored file name when building the S3 key, since the
  object is decompressed before upload (XRAY.gz.enc -> XRAY.dcm, not XRAY.gz.dcm)
- Cap decompressed size at 256 MB to avoid heap exhaustion on large/malformed payloads

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

# Conflicts:
#	src/main/java/com/iemr/mmu/service/dataSyncLayerCentral/DiagnosticDocumentIngestService.java
@sonarqubecloud

Copy link
Copy Markdown

@vishwab1
vishwab1 merged commit 15ebd72 into PSMRI:release-3.13.0 Nov 17, 2026
4 of 5 checks passed
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.

2 participants