Fix parsing of single-prescription lines.

- VERBESSERT: 'Alternative' Verordnungen wurden nicht erkannt, wenn in der selben Zeile nicht auch eine 'kanonische' Verordnung stand.
This commit is contained in:
daniel 2015-12-03 16:13:53 +01:00
parent 0d4b60096a
commit 573cd743d1
2 changed files with 8 additions and 2 deletions

View File

@ -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);

View File

@ -40,9 +40,15 @@ namespace zaaReloaded2.Medication
return canonicalRegex.IsMatch(line);
}
/// <summary>
/// Determines if a line contains prescriptions, either canonical
/// ones or alternative ones (in the form "Ramipril 5 mg \t alle 2 Tage").
/// </summary>
/// <param name="line">Line to examine.</param>
/// <returns>True if the line potentially contains prescriptions.</returns>
public static bool IsPotentialPrescriptionLine(string line)
{
return alternativeRegex.IsMatch(line);
return unifiedRegex.IsMatch(line);
}
#endregion