Skip to content

Commit

Permalink
Align 16s rDNA field for both DBs (#169)
Browse files Browse the repository at this point in the history
Also fix typo where the field was sometimes called 16s rRNA
  • Loading branch information
markusrt authored Oct 23, 2024
1 parent 9c9164a commit 2369e12
Show file tree
Hide file tree
Showing 13 changed files with 205 additions and 20 deletions.
1 change: 1 addition & 0 deletions HaemophilusWeb/Controllers/HomeController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public ActionResult Index()
},
new List<Change>
{
new Change(new DateTime(2024, 10, 23), "Angleich des Feldes 16S rDNA für beide Datenbanken", ChangeType.Feature, DatabaseType.None),
new Change(new DateTime(2024, 10, 22), "Feld für NHS-PCR mit Labor- und RKI-Export", ChangeType.Feature, DatabaseType.Haemophilus),
new Change(new DateTime(2024, 10, 1), "DEMIS Meldungs-Id QR-Code auf Befund", ChangeType.Feature, DatabaseType.None),
new Change(new DateTime(2024, 08, 10), "Update Kopfzeile Befundvorlagen", ChangeType.Feature, DatabaseType.None),
Expand Down
7 changes: 7 additions & 0 deletions HaemophilusWeb/HaemophilusWeb.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,10 @@
<Compile Include="Migrations\202410201042173_Isolate_RealTimePcr.Designer.cs">
<DependentUpon>202410201042173_Isolate_RealTimePcr.cs</DependentUpon>
</Compile>
<Compile Include="Migrations\202410231239265_Isolate_RibosomalRna16S_UnspecifiedToNativeMaterialTestResult.cs" />
<Compile Include="Migrations\202410231239265_Isolate_RibosomalRna16S_UnspecifiedToNativeMaterialTestResult.Designer.cs">
<DependentUpon>202410231239265_Isolate_RibosomalRna16S_UnspecifiedToNativeMaterialTestResult.cs</DependentUpon>
</Compile>
<Compile Include="Models\Country.cs" />
<Compile Include="Models\PubMlstMatchInfo.cs" />
<Compile Include="Models\VaccinationStatus.cs" />
Expand Down Expand Up @@ -890,6 +894,9 @@
<EmbeddedResource Include="Migrations\202410201042173_Isolate_RealTimePcr.resx">
<DependentUpon>202410201042173_Isolate_RealTimePcr.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Migrations\202410231239265_Isolate_RibosomalRna16S_UnspecifiedToNativeMaterialTestResult.resx">
<DependentUpon>202410231239265_Isolate_RibosomalRna16S_UnspecifiedToNativeMaterialTestResult.cs</DependentUpon>
</EmbeddedResource>
<None Include="NLog.xsd">
<SubType>Designer</SubType>
</None>
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
namespace HaemophilusWeb.Migrations
{
using System;
using System.Data.Entity.Migrations;

public partial class Isolate_RibosomalRna16S_UnspecifiedToNativeMaterialTestResult : DbMigration
{
public override void Up()
{
// Change enum from UnspecificTestResult to NativeMaterialTestResult
Sql("UPDATE dbo.Isolates SET RibosomalRna16S = 2 WHERE RibosomalRna16S = 1");
}

public override void Down()
{
}
}
}

Large diffs are not rendered by default.

6 changes: 0 additions & 6 deletions HaemophilusWeb/Models/IsolateBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,6 @@ public IsolateBase() : base(DatabaseType.Haemophilus)

public SerotypeAgg Agglutination { get; set; }

[Display(Name = "16S rRNA")]
public UnspecificTestResult RibosomalRna16S { get; set; }

[Display(Name = "16S rRNA beste Übereinstimmung")]
public string RibosomalRna16SBestMatch { get; set; }

[Display(Name = "ß-Laktamase")]
public TestResult BetaLactamase { get; set; }

Expand Down
8 changes: 7 additions & 1 deletion HaemophilusWeb/Models/IsolateCommon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,13 @@ public IsolateCommon(DatabaseType databaseType)
[Display(Name = "NHS Real-Time-PCR Auswertung (RIDOM)")]
public RealTimePcrResult RealTimePcrResult { get; set; }

[Display(Name = "16S rRNA Übereinstimmung")]
[Display(Name = "16S rDNA")]
public NativeMaterialTestResult RibosomalRna16S { get; set; }

[Display(Name = "16S rDNA beste Übereinstimmung")]
public string RibosomalRna16SBestMatch { get; set; }

[Display(Name = "16S rDNA Übereinstimmung")]
public double? RibosomalRna16SMatchInPercent { get; set; }

[Display(Name = "MALDI-TOF")]
Expand Down
6 changes: 0 additions & 6 deletions HaemophilusWeb/Models/Meningo/MeningoIsolateBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@ public MeningoIsolateBase() : base(DatabaseType.Meningococci)

public MeningoSerogroupAgg Agglutination { get; set; }

[Display(Name = "16S rDNA")]
public NativeMaterialTestResult RibosomalRna16S { get; set; }

[Display(Name = "16S rDNA beste Übereinstimmung")]
public string RibosomalRna16SBestMatch { get; set; }

[Display(Name = "ONPG")]
public TestResult Onpg { get; set; }

Expand Down
4 changes: 2 additions & 2 deletions HaemophilusWeb/Validators/IsolateViewModelValidator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ public IsolateViewModelValidator()
RuleFor(i => i.EpsilometerTestViewModels).SetCollectionValidator(new EpsilometerTestValidator());

RuleFor(i => i.RibosomalRna16SBestMatch).Must((model, value)
=> BeSetIfDetermined(value, model.RibosomalRna16S)).WithMessage(PropertyMustNotBeEmpty);
=> BeSetIfPositive(value, model.RibosomalRna16S)).WithMessage(PropertyMustNotBeEmpty);
RuleFor(i => i.RibosomalRna16SMatchInPercent).Must((model, value)
=> BeSetIfDetermined(value, model.RibosomalRna16S)).WithMessage(PropertyMustNotBeEmpty);
=> BeSetIfPositive(value, model.RibosomalRna16S)).WithMessage(PropertyMustNotBeEmpty);
RuleFor(i => i.MaldiTofBestMatch).Must((model, value)
=> BeSetIfDetermined(value, model.MaldiTof)).WithMessage(PropertyMustNotBeEmpty);
RuleFor(i => i.MaldiTofMatchConfidence).Must((model, value)
Expand Down
10 changes: 10 additions & 0 deletions HaemophilusWeb/Validators/IsolateViewModelValidatorBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,15 @@ protected static bool BeSetIfDetermined(string value, UnspecificOrNoTestResult t
{
return testResult != UnspecificOrNoTestResult.Determined || !string.IsNullOrWhiteSpace(value);
}

protected static bool BeSetIfPositive(double? value, NativeMaterialTestResult testResult)
{
return testResult != NativeMaterialTestResult.Positive || value.HasValue;
}

protected static bool BeSetIfPositive(string value, NativeMaterialTestResult testResult)
{
return testResult != NativeMaterialTestResult.Positive || !string.IsNullOrWhiteSpace(value);
}
}
}
4 changes: 2 additions & 2 deletions HaemophilusWeb/ViewModels/IsolateViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ var typingProperty in
yield return
new Typing {Attribute = "Kapselgenotypen", Value = EnumEditor.GetEnumDescription(SerotypePcr)};
}
if (RibosomalRna16S == UnspecificTestResult.Determined)
if (RibosomalRna16S == NativeMaterialTestResult.Positive)
{
yield return
new Typing
{
Attribute = "16S rRNA",
Attribute = "16S rDNA",
Value =
string.Format("{0}, {1}%", RibosomalRna16SBestMatch,
DoubleToString(RibosomalRna16SMatchInPercent))
Expand Down
2 changes: 1 addition & 1 deletion HaemophilusWeb/Views/Isolate/Edit.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@
);
function ConfigureConditionalFields() {
ShowOnSpecificRadioValue("RibosomalRna16SMatchInPercentForm", "RibosomalRna16S", "Determined", GeneralInput("RibosomalRna16SBestMatch"), GeneralInput("RibosomalRna16SMatchInPercent"));
ShowOnSpecificRadioValue("RibosomalRna16SMatchInPercentForm", "RibosomalRna16S", "Positive", GeneralInput("RibosomalRna16SBestMatch"), GeneralInput("RibosomalRna16SMatchInPercent"));
ShowOnSpecificRadioValue("MaldiTofMatchConfidenceForm", "MaldiTof", "Determined", GeneralInput("MaldiTofBestMatch"), GeneralInput("MaldiTofMatchConfidence"));
ShowOnSpecificRadioValue("RealTimePcrForm", "RealTimePcr", "Positive", RadioInput("RealTimePcrResult"));
ShowOnSpecificRadioValue("FtsiEvaluationForm", "Ftsi", "Determined", GeneralInput("FtsiEvaluation1"), GeneralInput("FtsiEvaluation2"), GeneralInput("FtsiEvaluation3"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ private static IsolateViewModel CreateIsolateViewModel()
LaboratoryNumber = "120/21",
Growth = YesNoOptional.Yes,
TypeOfGrowth = GrowthType.GrowthOnBlood,
Mlst = UnspecificOrNoTestResult.NoResult
Mlst = UnspecificOrNoTestResult.NoResult,
};
}

Expand All @@ -43,7 +43,7 @@ protected static IEnumerable<Tuple<IsolateViewModel, string[]>> CreateInvalidMod
yield return Tuple.Create(growthIsYesButTypeOfGrowthIsNotFilled, new[] { "TypeOfGrowth", "LaboratoryNumber" });

var noRibosomalRna16SDetails = CreateIsolateViewModel();
noRibosomalRna16SDetails.RibosomalRna16S = UnspecificTestResult.Determined;
noRibosomalRna16SDetails.RibosomalRna16S = NativeMaterialTestResult.Positive;
yield return Tuple.Create(noRibosomalRna16SDetails, new[] { "RibosomalRna16SBestMatch", "RibosomalRna16SMatchInPercent" });

var noMaldiTofDetails = CreateIsolateViewModel();
Expand Down

0 comments on commit 2369e12

Please sign in to comment.