-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat: participant management data service migration #643
base: main
Are you sure you want to change the base?
feat: participant management data service migration #643
Conversation
@@ -79,7 +80,9 @@ public async Task RunAsync([QueueTrigger("%CohortQueueName%", Connection = "Azur | |||
|
|||
var ignoreParticipantExceptions = (bool)DatabaseHelper.ConvertBoolStringToBoolByType("IgnoreParticipantExceptions", DataTypes.Boolean); | |||
|
|||
if (ParticipantHasException(basicParticipantCsvRecord.NhsNumber, participantData.ScreeningServiceId) && !ignoreParticipantExceptions) // Will only run if IgnoreParticipantExceptions is false. | |||
bool participantHasException = await ParticipantHasException(basicParticipantCsvRecord.NhsNumber, participantData.ScreeningServiceId); |
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.
Instead of calling the database here via the data services. Can you just check if the data retrieved from the retrieve Participant Data has the Exception Flag?
You will need to extend the Cohort Distribution Participant Model to add this.
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.
refactored
} | ||
|
||
try | ||
{ | ||
var participantData = _participantManagerData.GetParticipantFromIDAndScreeningService(requestBody); | ||
var participantData = await _participantManagementClient.GetSingleByFilter(p => p.NHSNumber.ToString() == requestBody.NhsNumber && |
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.
Please can you cast the request body data (Nhs Number and ScreeningId) to the relevant data types before passing to the getSingleByFilter?
This will help EF create more efficient SQL statements.
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.
done
application/CohortManager/src/Functions/Shared/Common/CreateParticipant.cs
Show resolved
Hide resolved
var exceptionFlag = Enum.TryParse(participant.ExceptionFlag, out Exists value) ? value : Exists.No; | ||
return exceptionFlag == Exists.Yes; | ||
var participant = await _participantManagementClient.GetSingleByFilter(p => p.NHSNumber.ToString() == nhsNumber && p.ScreeningId.ToString() == screeningId); | ||
System.Console.WriteLine("participant has exception:", participant.ExceptionFlag == 1); |
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.
Remove this debugging stuff or change it to a logger.
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.
removed
Quality Gate passedIssues Measures |
} | ||
|
||
try | ||
{ | ||
var participantData = await _participantManagementClient.GetSingleByFilter(p => p.NHSNumber == long.Parse(requestBody.NhsNumber) && |
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 want to double check what SQL is created from this before approving
Description
Context
DTOSS-7169
Type of changes
Checklist
Sensitive Information Declaration
To ensure the utmost confidentiality and protect your and others privacy, we kindly ask you to NOT including PII (Personal Identifiable Information) / PID (Personal Identifiable Data) or any other sensitive data in this PR (Pull Request) and the codebase changes. We will remove any PR that do contain any sensitive information. We really appreciate your cooperation in this matter.