From 573cd743d1a6a8fa3a75741335d29583b5e9946d Mon Sep 17 00:00:00 2001 From: Daniel Kraus Date: Thu, 3 Dec 2015 16:13:53 +0100 Subject: [PATCH] Fix parsing of single-prescription lines. - VERBESSERT: 'Alternative' Verordnungen wurden nicht erkannt, wenn in der selben Zeile nicht auch eine 'kanonische' Verordnung stand. --- zaaReloaded2/Medication/Importer.cs | 2 +- zaaReloaded2/Medication/Prescription.cs | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/zaaReloaded2/Medication/Importer.cs b/zaaReloaded2/Medication/Importer.cs index 393ac34..c3f1c8b 100755 --- a/zaaReloaded2/Medication/Importer.cs +++ b/zaaReloaded2/Medication/Importer.cs @@ -180,7 +180,7 @@ namespace zaaReloaded2.Medication string[] lines = Helpers.SplitParagraphs(text); foreach (string line in lines) { - if (Prescription.IsCanonicalPrescriptionLine(line)) + if (Prescription.IsPotentialPrescriptionLine(line)) { addition = Prescription.ManyFromLine(line); columns = System.Math.Max(columns, addition.Count); diff --git a/zaaReloaded2/Medication/Prescription.cs b/zaaReloaded2/Medication/Prescription.cs index adbe5c7..f549804 100755 --- a/zaaReloaded2/Medication/Prescription.cs +++ b/zaaReloaded2/Medication/Prescription.cs @@ -40,9 +40,15 @@ namespace zaaReloaded2.Medication return canonicalRegex.IsMatch(line); } + /// + /// Determines if a line contains prescriptions, either canonical + /// ones or alternative ones (in the form "Ramipril 5 mg \t alle 2 Tage"). + /// + /// Line to examine. + /// True if the line potentially contains prescriptions. public static bool IsPotentialPrescriptionLine(string line) { - return alternativeRegex.IsMatch(line); + return unifiedRegex.IsMatch(line); } #endregion