From 5297c24b56761d592aa803b20f75709a991038b1 Mon Sep 17 00:00:00 2001 From: Joe Batt <37874527+JoeBatt1989@users.noreply.github.com> Date: Mon, 17 Apr 2023 14:12:55 +0100 Subject: [PATCH] Notifications bug (#751) * Updated CR boolean logic Signed-off-by: Joe Batt * Added notification CR logic fix Signed-off-by: Joe Batt --------- Signed-off-by: Joe Batt --- .../AideClinicalReview/AideClinicalReviewPlugin.cs | 8 ++++++-- .../TaskManager.IntegrationTests/Support/Assertions.cs | 8 ++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/TaskManager/Plug-ins/AideClinicalReview/AideClinicalReviewPlugin.cs b/src/TaskManager/Plug-ins/AideClinicalReview/AideClinicalReviewPlugin.cs index 46273179a..838ec0c20 100644 --- a/src/TaskManager/Plug-ins/AideClinicalReview/AideClinicalReviewPlugin.cs +++ b/src/TaskManager/Plug-ins/AideClinicalReview/AideClinicalReviewPlugin.cs @@ -88,9 +88,13 @@ private void Initialize() _workflowName = Event.TaskPluginArguments[Keys.WorkflowName]; } - if (Event.TaskPluginArguments.ContainsKey(Keys.Notifications)) + if (Event.TaskPluginArguments.ContainsKey(Keys.Notifications) && Boolean.TryParse(Event.TaskPluginArguments[Keys.Notifications], out var result)) { - _notifications = Boolean.TryParse(Event.TaskPluginArguments[Keys.Notifications], out bool result); + _notifications = result; + } + else + { + _notifications = true; } if (Event.TaskPluginArguments.ContainsKey(Keys.ReviewedExecutionId)) diff --git a/tests/IntegrationTests/TaskManager.IntegrationTests/Support/Assertions.cs b/tests/IntegrationTests/TaskManager.IntegrationTests/Support/Assertions.cs index 9ab70b518..c68ff8cdd 100644 --- a/tests/IntegrationTests/TaskManager.IntegrationTests/Support/Assertions.cs +++ b/tests/IntegrationTests/TaskManager.IntegrationTests/Support/Assertions.cs @@ -40,12 +40,12 @@ public void AssertClinicalReviewEvent(ClinicalReviewRequestEvent clinicalReviewR clinicalReviewRequestEvent.PatientMetadata.PatientName.Should().Be(GetTaskPluginArguments(taskDispatchEvent, "patient_name")); clinicalReviewRequestEvent.PatientMetadata.PatientSex.Should().Be(GetTaskPluginArguments(taskDispatchEvent, "patient_sex")); clinicalReviewRequestEvent.PatientMetadata.PatientDob.Should().Be(GetTaskPluginArguments(taskDispatchEvent, "patient_dob")); - try - { - var notifications = GetTaskPluginArguments(taskDispatchEvent, "notifications"); + if (Boolean.TryParse(GetTaskPluginArguments(taskDispatchEvent, "notifications"), out bool result)) + { + clinicalReviewRequestEvent.Notifications.Should().Be(result); } - catch (Exception ex) + else { clinicalReviewRequestEvent.Notifications.Should().Be(true); }