Improve Daniel's style.

This commit is contained in:
Daniel Kraus 2015-08-02 22:01:51 +02:00
parent 1e4c3681f2
commit 23acb13019

View File

@ -20,6 +20,7 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using Microsoft.Office.Interop.Word; using Microsoft.Office.Interop.Word;
using System.Text.RegularExpressions;
namespace zaaReloaded2.Formatter namespace zaaReloaded2.Formatter
{ {
@ -32,6 +33,7 @@ namespace zaaReloaded2.Formatter
{ {
FixWords(document); FixWords(document);
FormatDiagnoses(selection); FormatDiagnoses(selection);
FixSalutation(document);
} }
static void FormatDiagnoses(Selection selection) static void FormatDiagnoses(Selection selection)
@ -59,6 +61,7 @@ namespace zaaReloaded2.Formatter
static void FixWords(Document document) static void FixWords(Document document)
{ {
Find find = document.Range().Find; Find find = document.Range().Find;
find.Execute2007(FindText: "Körperlicher Untersuchungsbefund", ReplaceWith: "Körperl. Untersuchung", Replace: WdReplace.wdReplaceAll);
find.Execute2007(FindText: "Dr.D.Kraus", ReplaceWith: "Dr. D. Kraus", Replace: WdReplace.wdReplaceAll); find.Execute2007(FindText: "Dr.D.Kraus", ReplaceWith: "Dr. D. Kraus", Replace: WdReplace.wdReplaceAll);
find.Execute2007(FindText: "Z. n.", ReplaceWith: "Z.n.", Replace: WdReplace.wdReplaceAll); find.Execute2007(FindText: "Z. n.", ReplaceWith: "Z.n.", Replace: WdReplace.wdReplaceAll);
find.Execute2007(FindText: "Zust. n.", ReplaceWith: "Z.n.", Replace: WdReplace.wdReplaceAll); find.Execute2007(FindText: "Zust. n.", ReplaceWith: "Z.n.", Replace: WdReplace.wdReplaceAll);
@ -66,6 +69,23 @@ namespace zaaReloaded2.Formatter
find.Execute2007(FindText: "Assistent der Klinik", ReplaceWith: "Internist/Nephrologe", Replace: WdReplace.wdReplaceAll); find.Execute2007(FindText: "Assistent der Klinik", ReplaceWith: "Internist/Nephrologe", Replace: WdReplace.wdReplaceAll);
find.Execute2007(FindText: "Professor Dr.", ReplaceWith: "Prof. Dr.", Replace: WdReplace.wdReplaceAll); find.Execute2007(FindText: "Professor Dr.", ReplaceWith: "Prof. Dr.", Replace: WdReplace.wdReplaceAll);
find.Execute2007(FindText: "mmHg", ReplaceWith: "mm Hg", Replace: WdReplace.wdReplaceAll); find.Execute2007(FindText: "mmHg", ReplaceWith: "mm Hg", Replace: WdReplace.wdReplaceAll);
find.Execute2007(FindText: "RR ", ReplaceWith: "", Replace: WdReplace.wdReplaceAll);
find.Execute2007(FindText: "HF ", ReplaceWith: "", Replace: WdReplace.wdReplaceAll);
find.Execute2007(FindText: "TAC-Spiegel", ReplaceWith: "Tacrolimus-Talspiegel", Replace: WdReplace.wdReplaceAll);
find.Execute2007(FindText: "4-7", ReplaceWith: "4 bis 7", Replace: WdReplace.wdReplaceAll);
find.Execute2007(FindText: "5-8", ReplaceWith: "5 bis 8", Replace: WdReplace.wdReplaceAll);
find.Execute2007(FindText: "8-10", ReplaceWith: "8 bis 10", Replace: WdReplace.wdReplaceAll);
}
static void FixSalutation(Document document)
{
Regex sal = new Regex(@"^Mit.*(freundl|kolleg)");
Regex med = new Regex(@"^((Häusl|Empf).*Medikat)|Therapieempf");
foreach (Paragraph p in document.Paragraphs)
{
if (sal.IsMatch(p.Range.Text)) p.Range.Text = "Mit freundlichen, kollegialen Grüßen,";
if (med.IsMatch(p.Range.Text)) p.Range.Text = "Aktuelle Medikation:";
}
} }
} }
} }