Skip to content

Commit

Permalink
Notifications bug (#751)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
JoeBatt1989 authored Apr 17, 2023
1 parent e972799 commit 5297c24
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 5297c24

Please sign in to comment.