feature: Sepsis Early Warning Engine
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
using FluentAssertions;
|
||||
|
||||
public class SirsEvaluatorTests
|
||||
{
|
||||
[Theory]
|
||||
[InlineData("TEMP_C", 38.4, true)] // fever
|
||||
[InlineData("TEMP_C", 35.9, true)] // hypothermia
|
||||
[InlineData("TEMP_C", 37.0, false)] // normal
|
||||
[InlineData("HEART_RATE", 91, true)]
|
||||
[InlineData("HEART_RATE", 90, false)] // boundary: 90 is NOT tachycardia (> not >=)
|
||||
[InlineData("RESP_RATE", 21, true)]
|
||||
[InlineData("RESP_RATE", 20, false)] // boundary
|
||||
[InlineData("WBC_K_UL", 12.1, true)] // leukocytosis
|
||||
[InlineData("WBC_K_UL", 3.9, true)] // leukopenia
|
||||
[InlineData("WBC_K_UL", 8.0, false)] // normal
|
||||
[InlineData("POTASSIUM_MEQ_L", 4.0, false)] // not a SIRS code
|
||||
public void MeetsCriterion_ReturnsExpected(string code, double value, bool expected)
|
||||
{
|
||||
SirsEvaluator.MeetsCriterion(code, (decimal)value).Should().Be(expected);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void AllCriterionKeys_ReturnsFourKeys_AllDistinct()
|
||||
{
|
||||
var id = Guid.NewGuid();
|
||||
var keys = SirsEvaluator.AllCriterionKeys(id);
|
||||
keys.Should().HaveCount(4);
|
||||
keys.Select(k => k.ToString()).Should().OnlyHaveUniqueItems();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user