Skip to content

Commit 5297c24

Browse files
authored
Notifications bug (#751)
* Updated CR boolean logic Signed-off-by: Joe Batt <[email protected]> * Added notification CR logic fix Signed-off-by: Joe Batt <[email protected]> --------- Signed-off-by: Joe Batt <[email protected]>
1 parent e972799 commit 5297c24

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

src/TaskManager/Plug-ins/AideClinicalReview/AideClinicalReviewPlugin.cs

+6-2
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,13 @@ private void Initialize()
8888
_workflowName = Event.TaskPluginArguments[Keys.WorkflowName];
8989
}
9090

91-
if (Event.TaskPluginArguments.ContainsKey(Keys.Notifications))
91+
if (Event.TaskPluginArguments.ContainsKey(Keys.Notifications) && Boolean.TryParse(Event.TaskPluginArguments[Keys.Notifications], out var result))
9292
{
93-
_notifications = Boolean.TryParse(Event.TaskPluginArguments[Keys.Notifications], out bool result);
93+
_notifications = result;
94+
}
95+
else
96+
{
97+
_notifications = true;
9498
}
9599

96100
if (Event.TaskPluginArguments.ContainsKey(Keys.ReviewedExecutionId))

tests/IntegrationTests/TaskManager.IntegrationTests/Support/Assertions.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ public void AssertClinicalReviewEvent(ClinicalReviewRequestEvent clinicalReviewR
4040
clinicalReviewRequestEvent.PatientMetadata.PatientName.Should().Be(GetTaskPluginArguments(taskDispatchEvent, "patient_name"));
4141
clinicalReviewRequestEvent.PatientMetadata.PatientSex.Should().Be(GetTaskPluginArguments(taskDispatchEvent, "patient_sex"));
4242
clinicalReviewRequestEvent.PatientMetadata.PatientDob.Should().Be(GetTaskPluginArguments(taskDispatchEvent, "patient_dob"));
43-
try
44-
{
45-
var notifications = GetTaskPluginArguments(taskDispatchEvent, "notifications");
4643

44+
if (Boolean.TryParse(GetTaskPluginArguments(taskDispatchEvent, "notifications"), out bool result))
45+
{
46+
clinicalReviewRequestEvent.Notifications.Should().Be(result);
4747
}
48-
catch (Exception ex)
48+
else
4949
{
5050
clinicalReviewRequestEvent.Notifications.Should().Be(true);
5151
}

0 commit comments

Comments
 (0)