Skip to content

Fix: dhirSubmission.jsp compilation error after AbstractFhirMessageBuilder relocation#2481

Open
LiamStanziani wants to merge 1 commit into
developfrom
bug/dhir-submission-jsp-compilation-error
Open

Fix: dhirSubmission.jsp compilation error after AbstractFhirMessageBuilder relocation#2481
LiamStanziani wants to merge 1 commit into
developfrom
bug/dhir-submission-jsp-compilation-error

Conversation

@LiamStanziani

@LiamStanziani LiamStanziani commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

Summary

oscarPrevention/dhirSubmission.jsp fails to compile because it imports
AbstractFhirMessageBuilder from a package that no longer exists. The FHIR
libraries refactor (OpenOSP PR #224, reached develop via the upstream sync PR #2479)
split that single class into version-specific dstu3 and r4 variants and
removed the old path. This one-line fix repoints the import at the dstu3
variant — the version this JSP's import previously resolved to — restoring the
page to its prior state and unblocking compilation.

Problem

The JSP imports the builder from its old, now-deleted location:

<%@page import="ca.openosp.openo.integration.fhir.builder.AbstractFhirMessageBuilder" %>

The package ca.openosp.openo.integration.fhir.builder no longer exists. As part
of the FHIR-libraries refactor, AbstractFhirMessageBuilder was forked into two
version-pinned variants:

  • ca.openosp.openo.integration.fhir.dstu3.builder.AbstractFhirMessageBuilder
    (FhirContext.forDstu3())
  • ca.openosp.openo.integration.fhir.r4.builder.AbstractFhirMessageBuilder
    (FhirContext.forR4())

Because the import target is gone, the JSP no longer compiles. The class is used
on the page (line ~333), where it serializes the FHIR bundle:

String theString = AbstractFhirMessageBuilder.getFhirContext()
        .newJsonParser().setPrettyPrint(true).encodeResourceToString(bundle);

Solution

Repoint the import at the dstu3 sub-package — the variant this JSP's import
resolved to before the file moved (the original pre-split builder was bound to
FhirContext.forDstu3()):

-<%@page import="ca.openosp.openo.integration.fhir.builder.AbstractFhirMessageBuilder" %>
+<%@page import="ca.openosp.openo.integration.fhir.dstu3.builder.AbstractFhirMessageBuilder" %>

This is the minimal, behavior-preserving change: it restores the page to the
state it was in before the file was relocated, without altering FHIR-version
semantics. The page (and the wider DHIR feature) ships disabled by default
(dhir.enabled=false), so this is a low-risk fix to unblock JSP compilation.

Verification

  • Confirmed the old package ca.openosp.openo.integration.fhir.builder no longer
    exists on disk.
  • Confirmed the original pre-split builder was bound to FhirContext.forDstu3(),
    so the dstu3 variant is the faithful continuation of this import.
  • Confirmed getFhirContext() is a public static method on the dstu3 builder,
    so the usage resolves and compiles.
  • Confirmed no other file under src/ still references the old package path.
  • Final gate: make jspc to confirm the JSP compiles cleanly.

Note for future DHIR work

While tracing this, I noticed that other parts of the DHIR path appear to be on
r4 — e.g. the producer that fills the bundles session attribute
(prevention/pageUtil/AddPrevention2Action) and the integration/dhir/* backend
now reference org.hl7.fhir.r4.model.*, whereas this JSP is dstu3. We have not
fully traced why this page was left on dstu3, and there may be an intentional
reason we're missing, so this PR deliberately does not change it — it only
restores the page to its previous (dstu3) state to fix the build.

Flagging it so it can be looked at properly whenever DHIR is next worked on: it
would be worth confirming whether this consumer should be aligned to r4 to match
the producer, and validating an actual DHIR submission end-to-end.

For reference, the upstream OscarPro version of this page resolves these imports
to the r4 variants, which may be a useful comparison point for that future
investigation:
https://bitbucket.org/oscaremr/oscarpro/src/master/src/main/webapp/oscarPrevention/dhirSubmission.jsp

Files changed

  • src/main/webapp/oscarPrevention/dhirSubmission.jsp — 1 line (import path).

Summary by Sourcery

Bug Fixes:

  • Fix dhirSubmission.jsp failing to compile due to an outdated AbstractFhirMessageBuilder import path.

Summary by CodeRabbit

  • Refactor
    • Updated internal data processing library used for handling submissions to improve compatibility and consistency with current standards.

@LiamStanziani LiamStanziani self-assigned this Jun 22, 2026
@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c0f483e9-1581-4111-8945-b3a998349170

📥 Commits

Reviewing files that changed from the base of the PR and between 5f49a01 and 9502837.

📒 Files selected for processing (1)
  • src/main/webapp/oscarPrevention/dhirSubmission.jsp

📝 Walkthrough

Walkthrough

A single import statement in dhirSubmission.jsp is updated to reference AbstractFhirMessageBuilder from the ca.openosp.openo.integration.fhir.dstu3.builder package instead of the previous ca.openosp.openo.integration.fhir.builder package.

Changes

FHIR Builder Package Correction

Layer / File(s) Summary
DSTU3 builder import update
src/main/webapp/oscarPrevention/dhirSubmission.jsp
Import for AbstractFhirMessageBuilder is changed from the generic fhir.builder package to the DSTU3-specific fhir.dstu3.builder package, affecting which class is used when encoding the bundle to JSON.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

A bunny hopped through package trails so fine,
Found the old import on a dusty vine,
"DSTU3!" it cheered with a little kick,
Swapped the path with a single, tidy click.
Now the FHIR bundle encodes just right — slick! 🐇✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and concisely describes the main change: fixing a compilation error caused by relocating the AbstractFhirMessageBuilder import from a non-existent package to the correct dstu3 package.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch bug/dhir-submission-jsp-compilation-error

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@sourcery-ai

sourcery-ai Bot commented Jun 22, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Fixes JSP compilation by updating dhirSubmission.jsp to import the relocated DSTU3-specific AbstractFhirMessageBuilder class from its new package path, preserving previous FHIR-version behavior.

File-Level Changes

Change Details Files
Update FHIR message builder import in dhirSubmission.jsp to use the dstu3-specific AbstractFhirMessageBuilder from its new package.
  • Replace the outdated AbstractFhirMessageBuilder import pointing to the removed generic builder package with the dstu3 builder package path
  • Ensure the JSP still uses the same static getFhirContext() API on the dstu3 builder to serialize the FHIR bundle, maintaining existing behavior
src/main/webapp/oscarPrevention/dhirSubmission.jsp

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@github-actions

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Snapshot Warnings

⚠️: No snapshots were found for the head SHA 9502837.
Ensure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice.

Scanned Files

None

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request updates the import path for AbstractFhirMessageBuilder in dhirSubmission.jsp to reference the dstu3 package instead of the generic fhir.builder package. No review comments were provided, so there is no feedback to address.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@LiamStanziani LiamStanziani marked this pull request as ready for review June 22, 2026 16:59
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No issues found across 1 file

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@LiamStanziani LiamStanziani requested a review from D3V41 June 22, 2026 17:05
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