Fix parsing of negative limits in Lauris parameters.

- VERBESSERUNG: Keine Fehlermeldung mehr, falls Referenzbereiche negative Werte enthalten (wie z.B. Base Excess) [#650db4d2]
This commit is contained in:
Daniel Kraus 2015-08-20 16:54:18 +02:00
parent 6d62e619eb
commit 058de8e8cf
2 changed files with 2 additions and 1 deletions

View File

@ -29,6 +29,7 @@ namespace Tests.Importer.ZaaImporter
class LaurisItemTest
{
[Test]
[TestCase("BE: 5.2 [-2 - 2] mmol/l", "BE", 5.2, "mmol/l", -2, 2, false)]
[TestCase("Natrium: 139 [135 - 145] mmol/l", "Natrium", 139, "mmol/l", 135, 145, true)]
[TestCase("Kalium: 5.2 [3.5 - 5] mmol/l", "Kalium", 5.2, "mmol/l", 3.5, 5, false)]
public void ParseLaurisWithBothLimits(

View File

@ -134,7 +134,7 @@ namespace zaaReloaded2.Importer.ZaaImporter
{
if (match.Groups["limits"].Success)
{
Regex limitRegex = new Regex(@"\[(?<limit1>[\d.]+)?\s*(?<operator>\S+)\s*(?<limit2>[\d.]+)?]");
Regex limitRegex = new Regex(@"\[(?<limit1>[-\d.]+)?\s*(?<operator>\S+)\s*(?<limit2>[-\d.]+)?]");
Match limitMatch = limitRegex.Match(match.Groups["limits"].Value);
if (limitMatch.Groups["limit1"].Success && limitMatch.Groups["limit2"].Success)
{