Skip to content

Add Operating Mode Configuration tab to Settings page#506

Merged
aurelianware merged 2 commits intomainfrom
claude/add-operating-mode-settings-RCnZt
Mar 17, 2026
Merged

Add Operating Mode Configuration tab to Settings page#506
aurelianware merged 2 commits intomainfrom
claude/add-operating-mode-settings-RCnZt

Conversation

@aurelianware
Copy link
Owner

Adds a read-only Operating Mode tab that displays how each CHO engine
(Benefit Calculation, Rate Resolution, NCCI Edits, etc.) interacts with
the tenant's existing core admin system — either "Augment" (parallel/
comparison mode) or "Replace" (CHO authoritative).

  • New IOperatingModeService + OperatingModeService fetching from
    GET /api/v1/tenants/{tenantId}/operating-mode via tenant-service
  • Graceful fallback to default config (all engines in Replace mode)
    when the tenant-service is unreachable
  • MudSimpleTable with color-coded MudChip status and per-engine
    descriptions, plus info boxes explaining each mode

https://claude.ai/code/session_01KrMqcqhxYjv1q1kCXN1NGS

Adds a read-only Operating Mode tab that displays how each CHO engine
(Benefit Calculation, Rate Resolution, NCCI Edits, etc.) interacts with
the tenant's existing core admin system — either "Augment" (parallel/
comparison mode) or "Replace" (CHO authoritative).

- New IOperatingModeService + OperatingModeService fetching from
  GET /api/v1/tenants/{tenantId}/operating-mode via tenant-service
- Graceful fallback to default config (all engines in Replace mode)
  when the tenant-service is unreachable
- MudSimpleTable with color-coded MudChip status and per-engine
  descriptions, plus info boxes explaining each mode

https://claude.ai/code/session_01KrMqcqhxYjv1q1kCXN1NGS
Copilot AI review requested due to automatic review settings March 17, 2026 08:58
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new read-only “Operating Mode” tab to the Cloud Health Office portal Settings page, backed by a portal service that fetches per-tenant operating-mode configuration from tenant-service and displays per-engine “Augment” vs “Replace” status.

Changes:

  • Introduces IOperatingModeService and OperatingModeService to fetch operating-mode config from tenant-service.
  • Registers the new service in the portal DI container.
  • Extends Settings.razor with an “Operating Mode” tab rendering a table of engines/modes plus explanatory copy.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.

File Description
src/portal/CloudHealthOffice.Portal/Services/ServiceImplementations.cs Adds OperatingModeService that calls tenant-service and falls back to defaults.
src/portal/CloudHealthOffice.Portal/Services/IServices.cs Adds IOperatingModeService and a portal OperatingModeConfiguration DTO.
src/portal/CloudHealthOffice.Portal/Program.cs Registers IOperatingModeService in DI.
src/portal/CloudHealthOffice.Portal/Pages/Settings.razor Adds the new “Operating Mode” tab UI and loading logic.

Comment on lines +332 to +345
isUsingDefaults = true;
operatingModeConfig = new OperatingModeConfiguration
{
TenantId = "unknown",
Engines = new Dictionary<string, string>
{
{ "benefitCalculation", "replace" },
{ "rateResolution", "replace" },
{ "ncciEdits", "replace" },
{ "eligibilityVerification", "replace" },
{ "claimsAdjudication", "replace" }
},
UpdatedAt = DateTime.UtcNow
};
Comment on lines +162 to +177
<MudText Typo="Typo.h5" GutterBottom="true">Operating Mode Configuration</MudText>
<MudText Typo="Typo.body2" Color="Color.Secondary" Class="mb-4">
Controls how CHO engines interact with your existing core admin system
</MudText>

@if (isLoadingOperatingMode)
{
<MudProgressCircular Indeterminate="true" />
}
else if (operatingModeConfig != null)
{
@if (isUsingDefaults)
{
<MudAlert Severity="Severity.Warning" Variant="Variant.Outlined" Class="mb-4" Icon="@Icons.Material.Filled.Info">
Operating mode configuration loaded from defaults. Contact the Aurelianware team to customize engine modes for your tenant.
</MudAlert>
Comment on lines +691 to +692
public Dictionary<string, string> Engines { get; set; } = new();
public DateTime UpdatedAt { get; set; }
Comment on lines +3147 to +3150
var result = await _httpClient.GetFromJsonAsync<OperatingModeConfiguration>(
$"{baseUrl}/v1/tenants/{tenantId}/operating-mode");
return result ?? GetDefaultConfiguration(tenantId);
}
Comment on lines +351 to +354
// The service returns defaults on failure; detect this by checking if the
// returned tenantId matches what we sent (defaults always set it).
// Since the default config is fine, just flag it for the info banner.
isUsingDefaults = false;
Comment on lines +358 to +359
Console.WriteLine($"Failed to load operating mode: {ex.Message}");
isUsingDefaults = true;
- Centralize default engine list in OperatingModeConfiguration.DefaultEngines
  to eliminate duplication between Settings.razor and OperatingModeService
- Make UpdatedAt nullable; use null as sentinel to detect default/fallback
  config so the "loaded from defaults" banner shows reliably
- Use StringComparer.OrdinalIgnoreCase for Engines dictionary
- Add NormalizeConfiguration() to merge API results onto defaults, filling
  missing engines with "replace" mode
- Replace "CHO" with "Cloud Health Office" and "Aurelianware team" with
  "support or your account team" in all user-facing text

https://claude.ai/code/session_01KrMqcqhxYjv1q1kCXN1NGS
@github-actions
Copy link

Code Coverage

Package Line Rate Branch Rate Health
CloudHealthOffice.Portal 3% 3%
CloudHealthOffice.Portal 3% 3%
Summary 3% (390 / 12632) 3% (96 / 2788)

@aurelianware aurelianware merged commit 0212c83 into main Mar 17, 2026
59 checks passed
@aurelianware aurelianware deleted the claude/add-operating-mode-settings-RCnZt branch March 17, 2026 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants