-
Notifications
You must be signed in to change notification settings - Fork 144
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
Feature 12573 automatic lab message processing #12688
Feature 12573 automatic lab message processing #12688
Conversation
…e not needed file
…automatic_lab_message_processing # Conflicts: # sormas-api/src/main/java/de/symeda/sormas/api/externalmessage/processing/AbstractProcessingFlow.java
…ed FacadeProvide usage in api code
SonarCloud analysis: https://sonarcloud.io/dashboard?id=SORMAS-Project&pullRequest=12688 |
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.
As far as I can see, the new saveAndProcess method is nowhere actually called, so outside of unit tests, the automatic processing isn't working at all
@@ -20,6 +20,8 @@ public interface ExternalMessageFacade extends PermanentlyDeletableFacade { | |||
|
|||
ExternalMessageDto save(@Valid ExternalMessageDto dto); | |||
|
|||
ExternalMessageDto saveAndProcessLabmessage(@Valid ExternalMessageDto dto); |
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.
ExternalMessageDto saveAndProcessLabmessage(@Valid ExternalMessageDto dto); | |
ExternalMessageDto saveAndProcessExternalMessage(@Valid ExternalMessageDto dto); |
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.
It processes an external message of type LAB_MESSAGE so I wouldn't add the general name you suggested but instead let's add a safety check inside the method and throw an exception if the external message type is not LAB_MESSAGE
Note that Physician reports are processed in another flow
|
||
private static boolean isLastSample(ExternalMessageDto labMessage, int sampleReportIndex) { | ||
if (sampleReportIndex >= labMessage.getSampleReportsNullSafe().size()) { | ||
throw new IllegalArgumentException("The sample report index is out of bounds."); |
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'd throw an actual IndexOutOfBoundsException here
|
||
if (StringUtils.isBlank(reportId) || StringUtils.isBlank(labSampleId)) | ||
|
||
{ |
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.
Formatting seems off here
@@ -2079,7 +2072,7 @@ public List<CaseMergeIndexDto[]> getCasesForDuplicateMerging( | |||
cq.multiselect(root.get(Case.ID), root2.get(Case.ID), root.get(Case.CREATION_DATE)); | |||
cq.orderBy(cb.desc(root.get(Case.CREATION_DATE))); | |||
|
|||
TypedQuery<Object[]> typedQuery = em.createQuery(cq).setParameter("date_type", "epoch"); | |||
TypedQuery<Object[]> typedQuery = em.createQuery(cq); |
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 remember that this was necessary at some point - what made you remove it?
ProcessingResult<ExternalMessageProcessingResult> result = automaticLabMessageProcessor.processLabMessage(savedMessage); | ||
|
||
if (result.getStatus().isCanceled()) { | ||
logger.error("Processing of lab message with UUID {} has benn canceled", savedMessage.getUuid()); |
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.
logger.error("Processing of lab message with UUID {} has benn canceled", savedMessage.getUuid()); | |
logger.error("Processing of lab message with UUID {} has been canceled", savedMessage.getUuid()); |
@Override | ||
protected void handlePickOrCreatePerson(PersonDto person, HandlerCallback<EntitySelection<PersonDto>> callback) { | ||
String nationalHealthId = person.getNationalHealthId(); | ||
if (nationalHealthId != null) { |
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.
Do a blank check here instead
similarCases.get(0).getDisease()); | ||
|
||
if (caseUuid != null) { | ||
CaseSelectionDto caseToAsiignTo = |
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.
CaseSelectionDto caseToAsiignTo = | |
CaseSelectionDto caseToAssignTo = |
As I've put in the PR description: |
Sending this external message leads to an error that does not happen when I use the normal
Stack trace:
The ReST endpoint returns a 500 internal server error with the following message: "Client'stransactionaborted" |
…stions and fixed save issue after cancel
…automatic_lab_message_processing # Conflicts: # sormas-backend/src/main/resources/sql/sormas_schema.sql
SonarCloud analysis: https://sonarcloud.io/dashboard?id=SORMAS-Project&pullRequest=12688 |
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.
Lab messages aren't automatically processed for me at all; I've set up my system to use the Luxembourg locale and have submitted an external message with a unique person that should be automatically processable, but that doesn't happen and I still have to do it manually. Anything else I'm missing to make this work outside of unit tests? I'm of course calling the saveAndProcessLabmessage method in the ReST endpoint.
Can you please post the labmessage you're pushing to the adapter? |
…ian Report with option "Share reports" - initial commit
…ian Report with option "Share reports" - initial commit 2
…ian Report with option "Share reports" - initial commit 3
…ian Report with option "Share reports" - initial commit 4
…ian Report with option "Share reports" - added handling for discard popup button
…ian Report with option "Share reports" - refactor 5
…ian Report with option "Share reports" - refactor 6
…ian Report with option "Share reports" - refactor 7
…ian Report with option "Share reports" - refactor 8
#12689) * #12666 Prevent district level users in the web app from editing sending information of environment samples that they have not created * #12666 Prevent district level users in the web app from editing sending information of environment samples that they have not created - disable weather conditions when dispatch fields are disabled --------- Co-authored-by: Levente Gal <[email protected]>
…ian Report with option "Share reports" - dates converted to the same format
…ian Report with option "Share reports" - dates converted to the same format 2
…ian Report with option "Share reports" - added step that close popup
…ian Report with option "Share reports" - added close handling for check step
…d if assigned towards an user" - changed test user role name
…d if assigned towards an user" - -add Tag
…e events of a group" - increased time for waitForPageLoadingSpinnerToDisappear
…athogen test in a sample" - added waiting for element EDIT_REPORT_BUTTON
This reverts commit 5130ac2.
… default infrastructure logic + removed hardcoded sample material and test type
… default infrastructure logic + fixed sample assignment threshold query issue and tests
… default infrastructure logic + fixed failing test
SonarCloud analysis: https://sonarcloud.io/dashboard?id=SORMAS-Project&pullRequest=12688 |
Fixes #12573
Will need an eSante ticket for changing the push endpoint to call the
saveAndProcessLabmessage
facade methodThe automaticProcessingPossible seems to be useless in this case