-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Platform/angela/14116/read hl7 #16859
Conversation
…erter.getBundles which calls HL7Reader.parseHL7Message but still sorting through the tests
…re about the loss of logging?
…adding a check for the messages being empty and logging an error, and added a test to the FHIRConverterIntegrationTests to ensure that it handles a message that isn't empty but doesn't contain HL7
…() into the companion object in HL7Reader.
…lt parsing to get the message type instead of RS specific parsing
…s deprecated because they are only being used in the CLI and should probably not be used elsewhere. Removing useages from CLI was out of scope for this ticket.
…d added some HL7Reader tests back in with modifications
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.OpenSSF Scorecard
Scanned Manifest Files |
Test Results1 265 tests - 4 1 261 ✅ - 4 8m 4s ⏱️ +33s Results for commit e44d58d. ± Comparison against base commit e0509fe. This pull request removes 4 tests.
♻️ This comment has been updated with latest results. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple quick comments that stood out to me on a quick look, but overall looks good to me!
prime-router/src/main/kotlin/azure/service/SubmissionResponseBuilder.kt
Outdated
Show resolved
Hide resolved
prime-router/src/test/kotlin/fhirengine/azure/FHIRConverterIntegrationTests.kt
Outdated
Show resolved
Hide resolved
…e only otherwise part of the getMessages() saga
Made changes that were previously logged as other tickets, still waiting for code owner approval. |
val messages = HL7Reader(actionLogs).getMessages(content) | ||
val isBatch = HL7Reader(actionLogs).isBatch(content, messages.size) | ||
// create a Report for this incoming HL7 message to use for tracking in the database | ||
val messageCount = HL7MessageHelpers.messageCount(content) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes in this file look good. However, Long-term, we don't want to be doing this type of validation in the receive step (the submission microservice doesn't, see submissions/src/main/kotlin/gov/cdc/prime/reportstream/submissions/controllers/SubmissionController.kt). I think its fine to leave this as is for now and if we find we are not as close to moving to the microservice as we think we are we can prioritize tickets to align this function with the microservice.
if (!isBatch && messages.size == 1) { | ||
val message = messages.first() | ||
if (!isBatch && messageCount == 1) { | ||
val message = HL7Reader.parseHL7Message(requestBody) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to be careful here. parseHL7Message can return exceptions, so what does that mean for the submission api in general? If there is a failure here, it will except out of the main processRequest
function and an HTTP error will be returned in from the caller submitToWaters
. The DB state will be updated I think by this point, but the queueMessage for the convert step will not be populated.
I poked around a bit and I think this is fine. This submission method is slated to be deprecated and we should take this issue into consideration when implementing this HL7v2 ACK functionality into the submission microservice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated the DevNotes section of this ticket linking to this comment: #15731
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be okay because we're checking the message count with the iterator and it would have gotten angry there and returned with 0 messages if it was bad HL7.
Quality Gate failedFailed conditions |
This PR ...
Removes HL7Reader.getMessages() in favor of HL7Reader.parseHL7Message()
Test Steps:
Changes
Checklist
Testing
./prime test
or./gradlew testSmoke
against local Docker ReportStream container?npm run lint:write
?Linked Issues