Skip to content

Commit

Permalink
Add field "NHS Real-Time-PCR" for Haemophilus (#168)
Browse files Browse the repository at this point in the history
Addionally
- Removed duplication on Isolate/Edit
- Fixed minor bug where third field for FtsiEvaluation was not cleared on deselection
  • Loading branch information
markusrt authored Oct 22, 2024
1 parent fb40a9d commit 9c9164a
Show file tree
Hide file tree
Showing 13 changed files with 266 additions and 101 deletions.
2 changes: 2 additions & 0 deletions HaemophilusWeb/Controllers/HomeController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ public ActionResult Index()
},
new List<Change>
{
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),
new Change(new DateTime(2024, 08, 8), "Maske zum Zusammenfügen von Patienten", ChangeType.Feature, DatabaseType.None),
new Change(new DateTime(2024, 06, 30), "Stämme: Update Regel 43", ChangeType.Feature, DatabaseType.Meningococci),
Expand Down
7 changes: 7 additions & 0 deletions HaemophilusWeb/HaemophilusWeb.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,10 @@
<Compile Include="Migrations\202404280859485_SendingBase_DemisId_To_String.designer.cs">
<DependentUpon>202404280859485_SendingBase_DemisId_To_String.cs</DependentUpon>
</Compile>
<Compile Include="Migrations\202410201042173_Isolate_RealTimePcr.cs" />
<Compile Include="Migrations\202410201042173_Isolate_RealTimePcr.Designer.cs">
<DependentUpon>202410201042173_Isolate_RealTimePcr.cs</DependentUpon>
</Compile>
<Compile Include="Models\Country.cs" />
<Compile Include="Models\PubMlstMatchInfo.cs" />
<Compile Include="Models\VaccinationStatus.cs" />
Expand Down Expand Up @@ -883,6 +887,9 @@
<EmbeddedResource Include="Migrations\202404280859485_SendingBase_DemisId_To_String.resx">
<DependentUpon>202404280859485_SendingBase_DemisId_To_String.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Migrations\202410201042173_Isolate_RealTimePcr.resx">
<DependentUpon>202410201042173_Isolate_RealTimePcr.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.

20 changes: 20 additions & 0 deletions HaemophilusWeb/Migrations/202410201042173_Isolate_RealTimePcr.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
namespace HaemophilusWeb.Migrations
{
using System;
using System.Data.Entity.Migrations;

public partial class Isolate_RealTimePcr : DbMigration
{
public override void Up()
{
AddColumn("dbo.Isolates", "RealTimePcr", c => c.Int(nullable: false));
AddColumn("dbo.Isolates", "RealTimePcrResult", c => c.Int(nullable: false));
}

public override void Down()
{
DropColumn("dbo.Isolates", "RealTimePcrResult");
DropColumn("dbo.Isolates", "RealTimePcr");
}
}
}
126 changes: 126 additions & 0 deletions HaemophilusWeb/Migrations/202410201042173_Isolate_RealTimePcr.resx

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions HaemophilusWeb/Models/IsolateCommon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Web.Script.Serialization;
using HaemophilusWeb.Models.Meningo;
using HaemophilusWeb.Utils;

namespace HaemophilusWeb.Models
Expand All @@ -27,6 +28,12 @@ public IsolateCommon(DatabaseType databaseType)
public string StemNumberWithPrefix => StemNumber.ToStemNumberWithPrefix(DatabaseType);

public TestResult Oxidase { get; set; }

[Display(Name = "NHS Real-Time-PCR")]
public NativeMaterialTestResult RealTimePcr { get; set; }

[Display(Name = "NHS Real-Time-PCR Auswertung (RIDOM)")]
public RealTimePcrResult RealTimePcrResult { get; set; }

[Display(Name = "16S rRNA Übereinstimmung")]
public double? RibosomalRna16SMatchInPercent { get; set; }
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 @@ -65,12 +65,6 @@ public MeningoIsolateBase() : base(DatabaseType.Meningococci)
[Display(Name = "cswy-Allel")]
public CswyAllel CswyAllele { get; set; }

[Display(Name = "NHS Real-Time-PCR")]
public NativeMaterialTestResult RealTimePcr { get; set; }

[Display(Name = "NHS Real-Time-PCR Auswertung (RIDOM)")]
public RealTimePcrResult RealTimePcrResult { get; set; }

[Display(Name = "siaA")]
public TestResult SiaAGene { get; set; }

Expand Down
28 changes: 17 additions & 11 deletions HaemophilusWeb/Scripts/site.js

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

2 changes: 2 additions & 0 deletions HaemophilusWeb/Tools/HaemophilusSendingLaboratoryExport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ public HaemophilusSendingLaboratoryExport()
AddField(s => ExportToString(s.Isolate.SerotypePcr));
AddField(s => ExportToString(s.Isolate.FuculoKinase));
AddField(s => ExportToString(s.Isolate.OuterMembraneProteinP6));
AddField(s => ExportToString(s.Isolate.RealTimePcr));
AddField(s => ExportToString(s.Isolate.RealTimePcrResult));
AddField(s => ExportToString(s.Isolate.RibosomalRna16S));
AddField(s => ExportToString(s.Isolate.RibosomalRna16SBestMatch));
AddField(s => ExportToString(s.Isolate.RibosomalRna16SMatchInPercent));
Expand Down
3 changes: 2 additions & 1 deletion HaemophilusWeb/Tools/HaemophilusSendingRkiExport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ public HaemophilusSendingRkiExport(List<County> counties)
AddEpsilometerTestFields(this, Antibiotic.Ampicillin, false, col.AmxMic, col.AmxSir);
AddEpsilometerTestFields(this, Antibiotic.AmoxicillinClavulanate, false, col.AmcMic, col.AmcSir);
AddField(s => ExportToString(s.DemisId), col.DemisId);

AddField(s => ExportToString(s.Isolate.RealTimePcr));
AddField(s => ExportToString(s.Isolate.RealTimePcrResult));
}

private static string ExportSamplingLocation(SamplingLocation location, Sending sending)
Expand Down
98 changes: 21 additions & 77 deletions HaemophilusWeb/Views/Isolate/Edit.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@

@Html.EnumRadioEditorFor(model => model.OuterMembraneProteinP6, "col-sm-10")

@Html.EnumRadioEditorFor(model => model.RealTimePcr, "col-sm-6")
@Html.EnumRadioEditorFor(m => m.RealTimePcrResult, "col-sm-7", "RealTimePcrForm")

@Html.EnumRadioEditorFor(model => model.RibosomalRna16S)
<div id="RibosomalRna16SMatchInPercentForm" class="form-group">
@Html.LabelFor(m => m.RibosomalRna16SMatchInPercent, new { @class = "col-sm-2 control-label" })
Expand Down Expand Up @@ -137,33 +140,31 @@
var clinicalBreakpoints = @(Html.Raw(Json.Encode(ViewBag.ClinicalBreakpoints)));
var serogroups = ["A", "B", "C", "D", "E", "F"];
$(document)
.ready(function() {
$(document).ready(
function() {
$("select[id$=_EucastClinicalBreakpointId]").change(ETestChange);
$("select[id$=_Measurement]").change(ETestChange);
$("select[id$=_Antibiotic]").change(ETestChange);
$("input:radio[name$='Agglutination']").change(AgglutinationChange);
$("select[id$=Evaluation]").change(EvaluationChange);
//TODO refactor all ShowXXXIfYYY methods to use ShowOnSpecificRadioValue
ShowGrowthTypeIfGrowthIsSelectedWithYes();
ShowRibosomalRna16SMatchInPercentIfDeterminedIsSelected();
ShowApiNhMatchInPercentIfDeterminedIsSelected();
ShowMaldiTofMatchConfidenceIfDeterminedIsSelected();
ShowFtsiEvaluationIfDeterminedIsSelected();
ShowMlstSequenceTypeIfDeterminedIsSelected();
});
function ShowGrowthTypeIfGrowthIsSelectedWithYes() {
ShowDivIfInputHasSpecificSelectedValueOrClearInputOtherwise(
"#GrowthTypeForm",
"input:radio[name$='Growth']",
"input:radio[name$='Growth']:checked",
"Yes",
"input:checkbox[name$='TypeOfGrowth']"
);
ConfigureConditionalFields();
}
);
function ConfigureConditionalFields() {
ShowOnSpecificRadioValue("RibosomalRna16SMatchInPercentForm", "RibosomalRna16S", "Determined", 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"));
ShowOnSpecificRadioValue("MlstSequenceTypeForm", "Mlst", "Determined", GeneralInput("MlstSequenceType"));
ShowOnSpecificRadioValue("GrowthTypeForm", "Growth", "Yes", CheckInput("TypeOfGrowth"));
AutoSelectGrowthIfEmpty();
}
function AutoSelectGrowthIfEmpty() {
$("input:radio[name$='Growth']")
.change(function() {
if ($("input:radio[name$='Growth']:checked").val() == "Yes") {
if ($("input:radio[name$='Growth']:checked").val() === "Yes") {
var checkedTypeOfGrowth = $("input:checkbox[name$='TypeOfGrowth']:checked");
if (!checkedTypeOfGrowth.val()) {
$("#TypeOfGrowth_TypicalGrowthOnKb").prop("checked", true);
Expand All @@ -173,61 +174,6 @@
});
}
function ShowRibosomalRna16SMatchInPercentIfDeterminedIsSelected() {
ShowDivIfInputHasSpecificSelectedValueOrClearInputOtherwise(
"#RibosomalRna16SMatchInPercentForm",
"input:radio[name$='RibosomalRna16S']",
"input:radio[name$='RibosomalRna16S']:checked",
"Determined",
"[id$='RibosomalRna16SBestMatch']",
"[id$='RibosomalRna16SMatchInPercent']"
);
}
function ShowApiNhMatchInPercentIfDeterminedIsSelected() {
ShowDivIfInputHasSpecificSelectedValueOrClearInputOtherwise(
"#ApiNhMatchInPercentForm",
"input:radio[name$='ApiNh']",
"input:radio[name$='ApiNh']:checked",
"Determined",
"[id$='ApiNhBestMatch']",
"[id$='ApiNhMatchInPercent']"
);
}
function ShowMaldiTofMatchConfidenceIfDeterminedIsSelected() {
ShowDivIfInputHasSpecificSelectedValueOrClearInputOtherwise(
"#MaldiTofMatchConfidenceForm",
"input:radio[name$='MaldiTof']",
"input:radio[name$='MaldiTof']:checked",
"Determined",
"[id$='MaldiTofBestMatch']",
"[id$='MaldiTofMatchConfidence']"
);
}
function ShowFtsiEvaluationIfDeterminedIsSelected() {
ShowDivIfInputHasSpecificSelectedValueOrClearInputOtherwise(
"#FtsiEvaluationForm",
"input:radio[name$='Ftsi']",
"input:radio[name$='Ftsi']:checked",
"Determined",
"[id$='FtsiEvaluation1']",
"[id$='FtsiEvaluation2']"
);
}
function ShowMlstSequenceTypeIfDeterminedIsSelected() {
ShowDivIfInputHasSpecificSelectedValueOrClearInputOtherwise(
"#MlstSequenceTypeForm",
"input:radio[name$='Mlst']",
"input:radio[name$='Mlst']:checked",
"Determined",
"[id$='MlstSequenceType']"
);
}
function AgglutinationChange() {
var agglutination = $("input:radio[name$='Agglutination']:checked").val();
if (serogroups.includes(agglutination)) {
Expand All @@ -236,7 +182,6 @@
else {
$("select[id$=Evaluation]").val("HaemophilusNonEncapsulated");
}
}
function EvaluationChange() {
Expand All @@ -252,7 +197,6 @@
}
}
$("#EvaluationMisMatchWarning").text(warning);
}
function ETestChange() {
Expand Down
Loading

0 comments on commit 9c9164a

Please sign in to comment.