Skip to content

Me/dpc 5790 update attribution to r4 - #3175

Merged
MEspositoE14s merged 11 commits into
mainfrom
me/dpc-5790-update-attribution-to-r4
Oct 22, 2026
Merged

MEspositoE14s merged 11 commits into
mainfrom
me/dpc-5790-update-attribution-to-r4

Conversation

@MEspositoE14s

Copy link
Copy Markdown
Contributor

🎫 Ticket

https://jira.cms.gov/browse/DPC-5790

🛠 Changes

Prepares dpc-attribution for new R4 endpoints, including:

  • Splits DB entities, profiles and FHIR converters into STU3 and R4 versions.
  • Updating DB tables to use String values instead of ordinals for enumerated types that come from HAPI FHIR.

There will be other PRs as part of this ticket to build the R4 based endpoints.

Note:

From the user's perspective, there are no functionality changes and this should be safe to deploy. This is basically a plumbing update.

ℹ️ Context

We're getting ready to support BFDv3 and dpc-attribution needs to be able to handle R4 resources. Unfortunately, many of our classes were coupled tightly to STU3, so a lot of this PR is making new R4 versions with the occasional tweak where something changed between versions.

There are places where we could've updated our existing classes to handle both STU3 and R4, but it usually made the code a lot uglier, and since the STU3 code will be going away when BFDv1 is deprecated in a few months, I didn't think it was worth the effort to make it work. Also, keeping everything separate means we can just Ctrl-F "STU3" and delete everything we find when it's time to get rid of v1.

The DB changes are necessary because a handful of values like address_use and name_use come from enumerated types in HAPI FHIR. address_use specifically changed between versions. In STU3, address_use=4 is NULL, in R4 address_use=4 is BILLING. That means rows created in STU3 may not convert to R4 correctly and vice versa.

To deal with this, we'll store these values as string representations from now on. More values may be added from version to version, but existing string values should never change (i.e., HOME will always be HOME and BILLING will always be BILLING) and we won't have to deal with this again.

🧪 Validation

All tests passing.
Deployed to dev here.

@MEspositoE14s
MEspositoE14s requested a review from a team as a code owner October 21, 2026 14:54

@ashley-weaver ashley-weaver 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! Changes in data models between versions are handled properly.

@MEspositoE14s
MEspositoE14s requested a review from a team October 22, 2026 16:36
run: |
find . -name dpc-api-jacoco.xml
# SonarQube flags us for duplicate code in the stu3 and r4 versions of classes. This is by design. Once we remove
# v1 and stu3 delete the "sonar.cpd.exclusions" parameter

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.

👍

@lukey-luke lukey-luke 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.

Resource tests are passing (test/java/gov/cms/dpc/api/resources/v1/{}.java) ✅
K6 smoketests are passing ✅

LGTM

@MEspositoE14s
MEspositoE14s merged commit e3b3f28 into main Oct 22, 2026
19 of 20 checks passed
@MEspositoE14s
MEspositoE14s deleted the me/dpc-5790-update-attribution-to-r4 branch October 22, 2026 20:42
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