Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,13 @@ public override IEnumerable<StatusReason> SeedData
new StatusReason { Code = (int)StatusReasonType.IdentityProvider, Name = "User authenticated with a method other than BC Services Card" },
new StatusReason { Code = (int)StatusReasonType.RequestingRemoteAccess, Name = "User has Requested Remote Access" },
new StatusReason { Code = (int)StatusReasonType.NoAssignedAgreement, Name = "Terms of Access to be determined by an Adjudicator" },
new StatusReason { Code = (int)StatusReasonType.NoVerifiedAddress, Name = "No address from BC Services Card. Enrollee entered address." },
new StatusReason { Code = (int)StatusReasonType.NoVerifiedAddress, Name = "No address from BC Services Card. Enrollee entered address." },
new StatusReason { Code = (int)StatusReasonType.PaperEnrollee, Name = "Manually entered paper enrolment" },
new StatusReason { Code = (int)StatusReasonType.PaperEnrolmentMismatch, Name = "PRIME enrolment does not match paper enrollee record" },
new StatusReason { Code = (int)StatusReasonType.PossiblePaperEnrolmentMatch, Name = "Possible match with paper enrolment(s)" },
new StatusReason { Code = (int)StatusReasonType.UnableToLinkToPaperEnrolment, Name = "Unable to link enrollee to paper enrolment" },
new StatusReason { Code = (int)StatusReasonType.HasUnlistedLicence, Name = "Enrollee has unlisted (typically non-BC) licences" },
new StatusReason { Code = (int)StatusReasonType.HasUnlistedLicence, Name = "Enrollee has unlisted (typically non-BC) licences" },
new StatusReason { Code = (int)StatusReasonType.MultipleHealthAuthorities, Name = "Enrollee has selected 4 health authorities or more" },
};
}
}
Expand Down
21,906 changes: 21,906 additions & 0 deletions prime-dotnet-webapi/Migrations/20260626155644_NewAdjudicationRuleMultiHA.Designer.cs

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Prime.Migrations
{
/// <inheritdoc />
public partial class NewAdjudicationRuleMultiHA : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.InsertData(
table: "StatusReasonLookup",
columns: new[] { "Code", "Name" },
values: new object[] { 23, "Enrollee has selected 4 health authorities or more" });
}

/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DeleteData(
table: "StatusReasonLookup",
keyColumn: "Code",
keyValue: 23);
}
}
}
5 changes: 5 additions & 0 deletions prime-dotnet-webapi/Migrations/ApiDbContextModelSnapshot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19853,6 +19853,11 @@ protected override void BuildModel(ModelBuilder modelBuilder)
{
Code = 22,
Name = "Enrollee has unlisted (typically non-BC) licences"
},
new
{
Code = 23,
Name = "Enrollee has selected 4 health authorities or more"
});
});

Expand Down
3 changes: 2 additions & 1 deletion prime-dotnet-webapi/Models/Statuses/StatusReasonType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public enum StatusReasonType
PaperEnrolmentMismatch = 19,
PossiblePaperEnrolmentMatch = 20,
UnableToLinkToPaperEnrolment = 21,
HasUnlistedLicence = 22
HasUnlistedLicence = 22,
MultipleHealthAuthorities = 23
}
}
16 changes: 16 additions & 0 deletions prime-dotnet-webapi/Services/Rules/AutomaticAdjudicationRules.cs
Original file line number Diff line number Diff line change
Expand Up @@ -478,4 +478,20 @@
return Task.FromResult(true);
}
}


public class MultipleHealthAuthorityRule : AutomaticAdjudicationRule
{
public override Task<bool> ProcessRule(Enrollee enrollee)
{
if (enrollee.EnrolleeHealthAuthorities.Count() >= 4 && !enrollee.AlwaysManual)

Check warning on line 487 in prime-dotnet-webapi/Services/Rules/AutomaticAdjudicationRules.cs

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Use 'Count' property here instead.

See more on https://sonarcloud.io/project/issues?id=bcgov_moh-prime&issues=AZ8ErZLHKoOQUVbN37G8&open=AZ8ErZLHKoOQUVbN37G8&pullRequest=2884
{
enrollee.AlwaysManual = true;
enrollee.AddReasonToCurrentStatus(StatusReasonType.MultipleHealthAuthorities, $"Enrollee has selected {enrollee.EnrolleeHealthAuthorities.Count()} health authorities.");

Check warning on line 490 in prime-dotnet-webapi/Services/Rules/AutomaticAdjudicationRules.cs

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Use 'Count' property here instead.

See more on https://sonarcloud.io/project/issues?id=bcgov_moh-prime&issues=AZ8ErZLHKoOQUVbN37G9&open=AZ8ErZLHKoOQUVbN37G9&pullRequest=2884
return Task.FromResult(false);
}

return Task.FromResult(true);
}
}
}
3 changes: 2 additions & 1 deletion prime-dotnet-webapi/Services/SubmissionRulesService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ public async Task<bool> QualifiesForAutomaticAdjudicationAsync(Enrollee enrollee
new IdentityProviderRule(),
new NoAssignedAgreementRule(),
new IsPotentialPaperEnrolleeReturnee(_businessEventService, _enrolleePaperSubmissionService),
new UnlistedCertificationRule()
new UnlistedCertificationRule(),
new MultipleHealthAuthorityRule()
};

return await ProcessRules(rules, enrollee);
Expand Down
1 change: 1 addition & 0 deletions prime-dotnet-webapi/Services/SubmissionService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,7 @@ private IQueryable<Enrollee> GetBaseQueryForEnrolleeApplicationRules()
.Include(e => e.Certifications)
.ThenInclude(c => c.License)
.ThenInclude(l => l.LicenseDetails)
.Include(e => e.EnrolleeHealthAuthorities)
.AsSplitQuery();
}
}
Expand Down
Loading