chore: deploy initial code base

This commit is contained in:
Thom Lamb
2026-05-12 10:34:30 -05:00
parent cce2961782
commit a81300a571
1829 changed files with 248331 additions and 1 deletions
@@ -0,0 +1,151 @@
using FluentAssertions;
using RichardSzalay.MockHttp;
using Strata.DecisionSupport.Models.Encounters;
using Strata.DecisionSupport.Models.Jazz;
using Strata.DecisionSupport.Models.Queries;
using System;
using System.Collections.Generic;
using System.Net;
using System.Net.Http;
using System.Net.Http.Json;
using System.Text.Json;
using System.Threading;
using System.Threading.Tasks;
namespace Strata.ContinuousImprovement.Client.Test.Unit
{
[TestFixture, Category("Unit"), Category("Client"), Ignore("needs attention")]
public class ClientTests
{
public Uri HtpUrl { get; set; }
public Uri Url { get; set; }
[SetUp]
public void TestSetup()
{
HtpUrl = new Uri("https://continuousimprovement/");
Url = new Uri(HtpUrl, "api/v1/encounters");
}
[TestCaseSource(nameof(TestClientCases))]
public async Task TestClient(EncounterQueryInfo queryInfo, List<IJazzEncounterInfo> response)
{
var httpHandler = new MockHttpMessageHandler();
httpHandler.When(HttpMethod.Post, Url.ToString())
.WithContent(JsonSerializer.Serialize(queryInfo,
options: new JsonSerializerOptions { PropertyNamingPolicy = JsonNamingPolicy.CamelCase }))
.Respond(HttpStatusCode.OK, JsonContent.Create(response));
var httpClient = new HttpClient(httpHandler)
{
BaseAddress = HtpUrl
};
var ciService = new ContinuousImprovementService(httpClient);
var result = await ciService.DecisionSupportMsdrgEncounterInfo(queryInfo, CancellationToken.None);
Assert.That(result, Is.Not.Null.And.Not.Empty);
}
public static IEnumerable<TestCaseData> TestClientCases()
{
yield return new TestCaseData(
new EncounterQueryInfo(Strata.DecisionSupport.Models.Queries.CaseTypeCategory.MSDRG, 207, DateTime.Now, DateTime.Now, "", Guid.NewGuid(), 24, new List<int> { 2 }),
new List<IJazzEncounterInfo> { new MSDRGEncounterInfo() })
.SetName("TestClient - EncounterQueryInfo constructor Request");
yield return new TestCaseData(new EncounterQueryInfo
{
CaseTypeCategory = CaseTypeCategory.MSDRG,
CaseTypeFamilyId = 207,
DepartmentRollupGlobalId = "",
ServiceLineGuid = Guid.NewGuid(),
StartDate = DateTime.Now,
EndDate = DateTime.Now,
EntityIDs = new List<int> { 2 }
},
new List<IJazzEncounterInfo> { new MSDRGEncounterInfo() })
.SetName("TestClient - MSDRG Request");
yield return new TestCaseData(new EncounterQueryInfo
{
CaseTypeCategory = CaseTypeCategory.MSDRG,
CaseTypeFamilyId = 207,
DepartmentRollupGlobalId = "Location",
ServiceLineGuid = Guid.NewGuid(),
StartDate = DateTime.Now,
EndDate = DateTime.Now,
EntityIDs = new List<int> { 2 }
},
new List<IJazzEncounterInfo> { new MSDRGEncounterInfo() })
.SetName("TestClient - MSDRG Location Request");
yield return new TestCaseData(new EncounterQueryInfo
{
CaseTypeCategory = CaseTypeCategory.MSDRG,
CaseTypeFamilyId = 207,
DepartmentRollupGlobalId = "Department Rollup 1",
ServiceLineGuid = Guid.NewGuid(),
StartDate = DateTime.Now,
EndDate = DateTime.Now,
EntityIDs = new List<int> { 2 }
},
new List<IJazzEncounterInfo> { new MSDRGEncounterInfo() })
.SetName("TestClient - MSDRG Department Request");
yield return new TestCaseData(new EncounterQueryInfo
{
CaseTypeCategory = CaseTypeCategory.APRDRG,
CaseTypeFamilyId = 207,
DepartmentRollupGlobalId = "",
ServiceLineGuid = Guid.NewGuid(),
StartDate = DateTime.Now,
EndDate = DateTime.Now,
EntityIDs = new List<int> { 2 }
},
new List<IJazzEncounterInfo> { new APRDRGEncounterInfo() })
.SetName("TestClient - APRDRG Request");
yield return new TestCaseData(new EncounterQueryInfo
{
CaseTypeCategory = CaseTypeCategory.CPTCode,
CaseTypeFamilyId = 207,
DepartmentRollupGlobalId = "",
ServiceLineGuid = Guid.NewGuid(),
StartDate = DateTime.Now,
EndDate = DateTime.Now,
EntityIDs = new List<int> { 2 }
},
new List<IJazzEncounterInfo> { new CPTCodeEncounterInfo() })
.SetName("TestClient - CPTCode Request");
yield return new TestCaseData(new EncounterQueryInfo
{
CaseTypeCategory = CaseTypeCategory.PatientPopulation,
CaseTypeFamilyId = 207,
DepartmentRollupGlobalId = "",
ServiceLineGuid = Guid.NewGuid(),
StartDate = DateTime.Now,
EndDate = DateTime.Now,
EntityIDs = new List<int> { 2 }
},
new List<IJazzEncounterInfo> { new PatientPopulationEncounterInfo() })
.SetName("TestClient - Patient Population Request");
}
[Test]
public async Task TestClientError()
{
var httpHandler = new MockHttpMessageHandler();
var queryInfo = new Strata.DecisionSupport.Biz.Parameters.EncounterQueryInfo(Strata.DecisionSupport.Models.Queries.CaseTypeCategory.MSDRG, 207, DateTime.Now, DateTime.Now, "", Guid.NewGuid(), 24, new List<int>());
httpHandler.When(HttpMethod.Post, Url.ToString())
.WithContent(JsonSerializer.Serialize(queryInfo,
options: new JsonSerializerOptions { PropertyNamingPolicy = JsonNamingPolicy.CamelCase }))
.Respond(HttpStatusCode.InternalServerError);
var httpClient = new HttpClient(httpHandler)
{
BaseAddress = HtpUrl
};
var ciService = new ContinuousImprovementService(httpClient);
Func<Task> action = ciService.Awaiting(x => x.DecisionSupportMsdrgEncounterInfo(queryInfo, CancellationToken.None));
await action.Should()
.ThrowAsync<ArgumentNullException>()
.WithMessage("Value cannot be null. (Parameter 'encounterInfo')");
}
}
}
@@ -0,0 +1,36 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<IsTestProject>true</IsTestProject>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="coverlet.msbuild" Version="6.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="Moq" Version="4.20.72" />
<PackageReference Include="NUnit" Version="4.2.2" />
<PackageReference Include="NUnit.Analyzers" Version="4.7.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="NUnit3TestAdapter" Version="5.0.0" />
<PackageReference Include="RichardSzalay.MockHttp" Version="7.0.0" />
</ItemGroup>
<ItemGroup>
<Using Include="NUnit.Framework" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="FluentAssertions" Version="6.12.1" />
<ProjectReference Include="..\..\src\Strata.ContinuousImprovement.Client\Strata.ContinuousImprovement.Client.csproj" />
<ProjectReference Include="..\..\src\Strata.DecisionSupport.Biz\Strata.DecisionSupport.Biz.csproj" />
<ProjectReference Include="..\..\src\Strata.DecisionSupport.Models\Strata.DecisionSupport.Models.csproj" />
</ItemGroup>
</Project>