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.
This commit is contained in:
Daniel Kraus 2015-09-04 21:12:50 +02:00
parent b04dc2cb4b
commit c141fcff58
2 changed files with 5 additions and 0 deletions

View File

@ -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("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("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( public void ParseLaurisWithoutLimits(
string laurisString, string name, double value, string laurisString, string name, double value,
string unit) string unit)

View File

@ -154,6 +154,10 @@ namespace zaaReloaded2.Importer.ZaaImporter
LowerLimit = Double.Parse(limitMatch.Groups["limit2"].Value.Replace(',', '.'), LowerLimit = Double.Parse(limitMatch.Groups["limit2"].Value.Replace(',', '.'),
CultureInfo.InvariantCulture); CultureInfo.InvariantCulture);
break; break;
case "":
// NOOP for special cases such as "[s. Bem.]" which occurs in NT-proBNP
// Fixes exception ID 65ca8575.
break;
default: default:
throw new InvalidOperationException( throw new InvalidOperationException(
String.Format("Unknown operator in {0}", String.Format("Unknown operator in {0}",