Skip to content

BCDA-9089: Add IOTA file pattern to cclf parser#1319

Merged
michaeljvaldes merged 6 commits intomainfrom
mvaldes/BCDA-9089
Feb 24, 2026
Merged

BCDA-9089: Add IOTA file pattern to cclf parser#1319
michaeljvaldes merged 6 commits intomainfrom
mvaldes/BCDA-9089

Conversation

@michaeljvaldes
Copy link
Contributor

🎫 Ticket

https://jira.cms.gov/browse/BCDA-6101

🛠 Changes

  • add IOTA file pattern to cclf file parser
  • add tests

ℹ️ Context

🧪 Validation

Unit tests for a straightforward change

@michaeljvaldes michaeljvaldes marked this pull request as ready for review February 23, 2026 21:04
@michaeljvaldes michaeljvaldes requested a review from a team as a code owner February 23, 2026 21:04
assert.NoError(t, err)
sspProdFile, sspTestFile, sspRunoutFile := gen(sspProd, validTime), gen(sspTest, validTime),
strings.Replace(gen(sspProd, validTime), "ZC8Y", "ZC8R", 1)
iotaProdFile, iotaTestFile, iotaRunoutFile := gen(iotaProd, validTime), gen(iotaTest, validTime), strings.Replace(gen(iotaProd, validTime), "ZC8Y", "ZC8R", 1)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe Im misreading but IOTAs middle section should be ZC(Y|R), as opposed to some of the others which tracks the CCLF file number (eg ZC8Y). If so, then I would expect this to fail?

Copy link
Contributor

Choose a reason for hiding this comment

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

also, it looks like the naming convention doesn't support a performance year. It looks like it's missing?

P.BCD.IOTA***.ZC(Y|R).Dyymmdd.Thhmmsst

Copy link
Collaborator

Choose a reason for hiding this comment

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

Good catch! I cant load jira right now but it looks like the example was P.BCD.IOTA123.ZCY26.D260206.T1125000. I might have missed that in the regex I put in the ticket.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated the PR and the ticket to match new requirements -- both zip archive name and contained files should track with other cclf file conventions, with an extra "PRT" section in the latter
zip archive: P.BCD.IOTA123.ZCY26.D260206.T1125000
contained file: P.IOTA123.PRT.ZC0Y26.D260201.T0737324

ssp = `A\d{4}`
// CCLF filename convention for NGACO: P.V***.ACO.ZC[0|8][Y|R].Dyymmdd.Thhmmsst
// CCLF file name convention for IOTA with BCD identifier: P.BCD.IOTA***.ZC(Y|R).Dyymmdd.Thhmmsst
iotaPattern = `IOTA\d{3}`
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: could we rename the other names to follow this convention or could we just call this variable iota?

Copy link
Contributor

@bhagatparwinder bhagatparwinder Feb 23, 2026

Choose a reason for hiding this comment

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

Adding to this, isn't the suffix the same as others, too? ZC[0|8](Y|R)(\d{2})

Edit: I am referring to the comment.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

"iota" is actually a keyword in golang 😓
I updated it to "iotaPrt" since it contains an additional "PRT" section

"github.com/stretchr/testify/assert"
)

func TestGetCMSID(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we add a test case here? for example:

path/T.BCD.IOTA965.ZCY18.D181120.T1000000 → IOTA965

Copy link
Contributor

Choose a reason for hiding this comment

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

and maybe a negative test case

P.BCD.IOTA12.ZC8Y24 only 2 digits confirming that IOTA\d{3} is enforced. Totally optional.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added a test case here to validate that it parses the cms id correctly.
The service that is responsible for validating that the id is correct is actually the /bcda/service.go --> I added tests there too for positive and negative cases.

@carlpartridge
Copy link
Collaborator

Im wondering if we should consider tests for things could fail or be mistakenly matched? Eg:

  • IOTA1234 (might match on A\d{4}?)
  • IOTA12 (should fail) (just checking for a failure is tricky because we cant test for every wrong possibility)

@michaeljvaldes michaeljvaldes merged commit c321738 into main Feb 24, 2026
8 checks passed
@michaeljvaldes michaeljvaldes deleted the mvaldes/BCDA-9089 branch February 24, 2026 20:55
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