From c141fcff5802f9843a8d33b066ecb1c1ef1cbf39 Mon Sep 17 00:00:00 2001 From: Daniel Kraus Date: Fri, 4 Sep 2015 21:12:50 +0200 Subject: [PATCH] Fix crash if reference string is in fact not a reference. E.g. NT-proBNP has a remark "[s. Bem.]" which represents neither reference limits nor a categorical normal value. - VERBESSERT: Kein Absturz mehr, wenn Labordaten NT-proBNP enthalten. --- Tests/Importer/ZaaImporter/LaurisItemTest.cs | 1 + zaaReloaded2/Importer/ZaaImporter/LaurisItem.cs | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/Tests/Importer/ZaaImporter/LaurisItemTest.cs b/Tests/Importer/ZaaImporter/LaurisItemTest.cs index 5dd19ca..3f58977 100755 --- a/Tests/Importer/ZaaImporter/LaurisItemTest.cs +++ b/Tests/Importer/ZaaImporter/LaurisItemTest.cs @@ -86,6 +86,7 @@ namespace Tests.Importer.ZaaImporter [TestCase("Niedermol. Heparin (Anti-Xa): 0.99 U/ml;", "Niedermol. Heparin (Anti-Xa)", 0.99, "U/ml")] [TestCase("glomerul. Filtrationsr. CKD-EP: 42 ml/min /1,73qm;", "glomerul. Filtrationsr. CKD-EP", 42, "ml/min /1,73qm")] + [TestCase("NT-proBNP: 598 [s. Bem.] pg/ml;", "NT-proBNP", 598, "pg/ml")] public void ParseLaurisWithoutLimits( string laurisString, string name, double value, string unit) diff --git a/zaaReloaded2/Importer/ZaaImporter/LaurisItem.cs b/zaaReloaded2/Importer/ZaaImporter/LaurisItem.cs index 2996795..efda5b4 100755 --- a/zaaReloaded2/Importer/ZaaImporter/LaurisItem.cs +++ b/zaaReloaded2/Importer/ZaaImporter/LaurisItem.cs @@ -154,6 +154,10 @@ namespace zaaReloaded2.Importer.ZaaImporter LowerLimit = Double.Parse(limitMatch.Groups["limit2"].Value.Replace(',', '.'), CultureInfo.InvariantCulture); break; + case "": + // NOOP for special cases such as "[s. Bem.]" which occurs in NT-proBNP + // Fixes exception ID 65ca8575. + break; default: throw new InvalidOperationException( String.Format("Unknown operator in {0}",