diff --git a/HISTORY.md b/HISTORY.md index 5f25193..d8eec87 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,3 +1,15 @@ +Version 2.1.0 (2015-09-06) +======================================================================== + +- NEU: Optionale Kommentare zu Laborwerten. +- NEU: Sekretariatsmodus (siehe 'Einstellungen'), um die Nachfrage nach Zusatz-Kommentaren zu unterdrücken. +- NEU: Wenn kein Text markiert ist, wird ein Versuch unternommen, die Labordaten im Arztbrief automatisch zu erkennen; dabei wird der erste erkannte Lauris-Laborblock formatiert. +- VERBESSERT: Bug in der Markierung von speziellen Parametern, um immer Referenzbereiche auszugeben. +- VERBESSERT: Kein Absturz mehr, wenn Labordaten NT-proBNP enthalten. + +* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + + Version 2.0.1 (2015-09-02) ======================================================================== diff --git a/README.md b/README.md index e754da3..8924919 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,28 @@ typischerweise so aussieht: Und so weiter, es gibt noch mehr Variationen. +## Quellcode + +zaaReloaded2 ist in C# mit VSTO geschrieben, unter Zuhilfenahme von +Visual Studio Professional 2013. Der Quellcode liegt in einem öffentlich +zugänglichen Git-Repository: + + + +Clonen: + + git clone http://git.bovender.de/zaaReloaded2.git + +Schreibzugriff auf git.bovender.de gibt es nur per SSH... + +Die Visual-Studio-Lösung läßt sich direkt nach dem Clonen nicht bauen, +weil die Strong-Key-Datei `./zaaReloaded2/zaaReloaded2.pfx` nur ein +symbolischer Link ist auf eine Datei außerhalb des Repositoriums, damit +der Schüssel nicht öffentlich preisgegeben wird. Also einfach selber +eine PFX-Datei generieren, oder in den Projekteinstellungen das +Signieren ausschalten. + + ## Programmteile Im Sinne einer _separation of concerns_ ist die Programmlogik in diff --git a/Tests/Controller/Comments/CommentPoolTest.cs b/Tests/Controller/Comments/CommentPoolTest.cs new file mode 100755 index 0000000..e29fd52 --- /dev/null +++ b/Tests/Controller/Comments/CommentPoolTest.cs @@ -0,0 +1,60 @@ +/* CommentPoolTest.cs + * part of zaaReloaded2 + * + * Copyright 2015 Daniel Kraus + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using NUnit.Framework; +using zaaReloaded2.Controller.Comments; + +namespace Tests.Controller.Comments +{ + [TestFixture] + class CommentPoolTest + { + [Test] + public void CreateCommentIfDoesNotExist() + { + int n = CommentPool.Default.Count; + ItemComment i = CommentPool.Default.GetCommentFor("item \"<>\""); + Assert.AreEqual(n + 1, CommentPool.Default.Count); + } + + [Test] + public void ReturnExistingComment() + { + ItemComment i = CommentPool.Default.GetCommentFor("item \"<>\""); + int n = CommentPool.Default.Count; + i = CommentPool.Default.GetCommentFor("item \"<>\""); + Assert.AreEqual(n, CommentPool.Default.Count); + } + + [Test] + public void BuildingCommentRaisesEvent() + { + ItemComment i = CommentPool.Default.GetCommentFor("item \"<>\""); + int eventRaised = 0; + CommentPool.Default.FillInComment += (sender, args) => + { + eventRaised += 1; + }; + string comment = i.BuildComment(); + Assert.AreEqual(1, eventRaised); + } + } +} diff --git a/Tests/Controller/Comments/ItemCommentTest.cs b/Tests/Controller/Comments/ItemCommentTest.cs new file mode 100755 index 0000000..bb1aaa2 --- /dev/null +++ b/Tests/Controller/Comments/ItemCommentTest.cs @@ -0,0 +1,58 @@ +/* ItemCommentTest.cs + * part of zaaReloaded2 + * + * Copyright 2015 Daniel Kraus + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using NUnit.Framework; +using zaaReloaded2.Formatter; +using zaaReloaded2.Controller.Comments; + +namespace Tests.Controller.Comments +{ + [TestFixture] + class ItemCommentTest + { + [Test] + public void FactoryWithGoodDefinition() + { + ItemComment i = ItemComment.FromDefinitionString("TAC \"(Zielbereich: <4-7> µg/l)\""); + Assert.IsNotNull(i); + Assert.AreEqual("(Zielbereich: ", i.Prefix); + Assert.AreEqual("4-7", i.Value); + Assert.AreEqual(" µg/l)", i.Suffix); + Assert.AreEqual("TAC", i.Item); + Assert.AreEqual("(Zielbereich: 4-7 µg/l)", i.BuildComment()); + } + + [Test] + public void FactoryWithBadDefinition() + { + ItemComment i = ItemComment.FromDefinitionString("some bogus definition"); + Assert.IsNull(i); + } + + [Test] + public void EmptyValueProducesEmptyComment() + { + ItemComment i = ItemComment.FromDefinitionString("TAC \"(Zielbereich: µg/l)\""); + i.Value = String.Empty; + Assert.AreEqual(String.Empty, i.BuildComment()); + } + } +} diff --git a/Tests/Controller/Elements/ItemsTest.cs b/Tests/Controller/Elements/ItemsTest.cs index 8bfc489..4c602b4 100755 --- a/Tests/Controller/Elements/ItemsTest.cs +++ b/Tests/Controller/Elements/ItemsTest.cs @@ -16,14 +16,12 @@ * limitations under the License. */ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; using NUnit.Framework; using Microsoft.Office.Interop.Word; using zaaReloaded2.LabModel; using zaaReloaded2.Formatter; using zaa = zaaReloaded2.Controller.Elements; +using zaaReloaded2.Controller.Comments; using System.Text.RegularExpressions; namespace Tests.Controller.Elements @@ -152,7 +150,7 @@ namespace Tests.Controller.Elements StripMarkup( TimePointFormatter.DateAndTimeHeader(new DateTime(2015, 07, 13, 13, 31, 00)) )+ - "Klinische Chemie: Na 133, SU-Protein 2,8\r\r").Replace(Environment.NewLine, "\r"); + "Klinische Chemie: Na 133, SU-Protein 3\r\r").Replace(Environment.NewLine, "\r"); Assert.AreEqual(expected, _document.Range().Text); } @@ -176,11 +174,63 @@ namespace Tests.Controller.Elements StripMarkup( TimePointFormatter.DateAndTimeHeader(new DateTime(2015, 07, 13, 13, 31, 00)) ) + - "Klinische Chemie: Na 133, SU-Protein 2,8, Cl 110, U-Na 99\r\r") + "Klinische Chemie: Na 133, SU-Protein 3, Cl 110, U-Na 99\r\r") .Replace(Environment.NewLine, "\r"); Assert.AreEqual(expected, _document.Range().Text); } + [Test] + public void ItemCommentWithoutHandler() + { + CommentPool.Default.Reset(); + Laboratory lab = new Laboratory(); + TimePoint tp = new TimePoint(); + tp.TimeStamp = new DateTime(2015, 7, 13, 13, 31, 00); + tp.AddItem(new LabItem("Na", "133", "133")); + tp.AddItem(new LabItem("K", "6", "5")); + lab.AddTimePoint(tp); + + _formatter.Laboratory = lab; + _formatter.Settings.Elements.Add( + new zaa.Items("Na \"(Zielbereich: <> mmol/l)\"")); + _formatter.Run(); + string expected = ( + StripMarkup( + TimePointFormatter.DateAndTimeHeader(new DateTime(2015, 07, 13, 13, 31, 00)) + + "Na 133\r\r").Replace(Environment.NewLine, "\r") + ); + Assert.AreEqual(expected, _document.Range().Text); + } + + [Test] + public void ItemCommentWithHandler() + { + Laboratory lab = new Laboratory(); + TimePoint tp = new TimePoint(); + tp.TimeStamp = new DateTime(2015, 7, 13, 13, 31, 00); + tp.AddItem(new LabItem("Na", "133", "133")); + tp.AddItem(new LabItem("K", "6", "5")); + lab.AddTimePoint(tp); + + _formatter.Laboratory = lab; + _formatter.Settings.Elements.Add( + new zaa.Items("Na \"(Zielbereich: µg/l)\"")); + bool messageSent = false; + CommentPool.Default.FillInComment += (sender, args) => + { + messageSent = true; + args.Comment.Value = "4-7"; + }; + _formatter.Run(); + Assert.IsTrue(messageSent, "FillInComment message was not sent"); + string expected = ( + StripMarkup( + TimePointFormatter.DateAndTimeHeader(new DateTime(2015, 07, 13, 13, 31, 00)) + + "Na 133 (Zielbereich: 4-7 µg/l)\r\r").Replace(Environment.NewLine, "\r") + ); + Assert.AreEqual(expected, _document.Range().Text); + } + static string StripMarkup(string s) { return _markupStripper.Replace(s, string.Empty); diff --git a/Tests/Formatter/FormatterTest-all.txt b/Tests/Formatter/FormatterTest-all.txt index e112ed6..85419f7 100755 --- a/Tests/Formatter/FormatterTest-all.txt +++ b/Tests/Formatter/FormatterTest-all.txt @@ -1,7 +1,5 @@ - -Laborwerte vom 04.07.2015 12:31:00: +Laborwerte vom 04.07.2015 12:31:00: Klinische Chemie: Na 144 mM, K 4,3 mM - Laborwerte vom 06.07.2015 10:28:00: Klinische Chemie: Na 138 mM, K 4,6 mM diff --git a/Tests/Formatter/FormatterTest-eachday.txt b/Tests/Formatter/FormatterTest-eachday.txt index 2bad5e3..1974aa1 100755 --- a/Tests/Formatter/FormatterTest-eachday.txt +++ b/Tests/Formatter/FormatterTest-eachday.txt @@ -1,7 +1,5 @@ - -Laborwerte vom 04.07.2015: +Laborwerte vom 04.07.2015: Klinische Chemie: Na 144 mM, K 4,3 mM - Laborwerte vom 06.07.2015: Klinische Chemie: Na 138 mM, K 4,6 mM diff --git a/Tests/Formatter/FormatterTest-firstday.txt b/Tests/Formatter/FormatterTest-firstday.txt index 0aa36d1..0ca8c07 100755 --- a/Tests/Formatter/FormatterTest-firstday.txt +++ b/Tests/Formatter/FormatterTest-firstday.txt @@ -1,4 +1,3 @@ - -Laborwerte vom 04.07.2015: +Laborwerte vom 04.07.2015: Klinische Chemie: Na 144 mM, K 4,3 mM diff --git a/Tests/Formatter/FormatterTest-lastday.txt b/Tests/Formatter/FormatterTest-lastday.txt index b95373f..9b6ba3d 100755 --- a/Tests/Formatter/FormatterTest-lastday.txt +++ b/Tests/Formatter/FormatterTest-lastday.txt @@ -1,4 +1,3 @@ - -Laborwerte vom 06.07.2015: +Laborwerte vom 06.07.2015: Klinische Chemie: Na 138 mM, K 4,6 mM diff --git a/Tests/Importer/ZaaImporter/LaurisItemTest.cs b/Tests/Importer/ZaaImporter/LaurisItemTest.cs index 5dd19ca..3f58977 100755 --- a/Tests/Importer/ZaaImporter/LaurisItemTest.cs +++ b/Tests/Importer/ZaaImporter/LaurisItemTest.cs @@ -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("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( string laurisString, string name, double value, string unit) diff --git a/Tests/Tests.csproj b/Tests/Tests.csproj index 644547a..98b96b9 100755 --- a/Tests/Tests.csproj +++ b/Tests/Tests.csproj @@ -80,10 +80,13 @@ + + + @@ -96,6 +99,7 @@ + diff --git a/Tests/Thesaurus/ParametersTest.cs b/Tests/Thesaurus/ParametersTest.cs new file mode 100755 index 0000000..7bc01f8 --- /dev/null +++ b/Tests/Thesaurus/ParametersTest.cs @@ -0,0 +1,56 @@ +/* ParametersTest.cs + * part of zaaReloaded2 + * + * Copyright 2015 Daniel Kraus + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using NUnit.Framework; +using zaaReloaded2.Thesaurus; + +namespace Tests.Thesaurus +{ + [TestFixture] + class ParametersTest + { + [Test] + public void GetCanonicalName() + { + Assert.AreEqual("CRP", + Parameters.Default.GetCanonicalName("C-reaktives Protein")); + } + + [Test] + public void GetPrecision() + { + Assert.AreEqual(1, + Parameters.Default.GetPrecision("Creatinin")); + } + + [Test] + public void GetForceReferenceDisplay() + { + Assert.IsTrue(Parameters.Default.GetForceReferenceDisplay("Magnesium")); + } + + [Test] + public void GetIsBlacklisted() + { + Assert.IsTrue(Parameters.Default.GetIsBlacklisted("glomerul. Filtrationsr. (MDRD)")); + } + } +} diff --git a/Tests/ViewModels/ItemCommentViewModelTest.cs b/Tests/ViewModels/ItemCommentViewModelTest.cs new file mode 100755 index 0000000..5d3b3bd --- /dev/null +++ b/Tests/ViewModels/ItemCommentViewModelTest.cs @@ -0,0 +1,42 @@ +/* ItemCommentViewModelTest.cs + * part of zaaReloaded2 + * + * Copyright 2015 Daniel Kraus + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using NUnit.Framework; +using zaaReloaded2.Controller.Comments; +using zaaReloaded2.ViewModels; + +namespace Tests.ViewModels +{ + [TestFixture] + class ItemCommentViewModelTest + { + [Test] + public void Properties() + { + ItemComment comment = new ItemComment("item", "pre", "val", "suf"); + ItemCommentViewModel vm = new ItemCommentViewModel(comment); + Assert.AreEqual(comment.Item, vm.Item); + Assert.AreEqual(comment.Prefix, vm.Prefix); + Assert.AreEqual(comment.Suffix, vm.Suffix); + Assert.AreEqual(comment.Value, vm.Value); + } + } +} diff --git a/www/img/firstrun.png b/www/img/firstrun.png new file mode 100755 index 0000000..f12b975 Binary files /dev/null and b/www/img/firstrun.png differ diff --git a/www/img/itemcomment.png b/www/img/itemcomment.png new file mode 100755 index 0000000..2c745e2 Binary files /dev/null and b/www/img/itemcomment.png differ diff --git a/www/img/itemcommentresult.png b/www/img/itemcommentresult.png new file mode 100755 index 0000000..800e257 Binary files /dev/null and b/www/img/itemcommentresult.png differ diff --git a/www/img/itemcommentview.png b/www/img/itemcommentview.png new file mode 100755 index 0000000..5b3c77d Binary files /dev/null and b/www/img/itemcommentview.png differ diff --git a/www/img/preferences.png b/www/img/preferences.png new file mode 100755 index 0000000..159b16d Binary files /dev/null and b/www/img/preferences.png differ diff --git a/www/img/ribbon.png b/www/img/ribbon.png old mode 100644 new mode 100755 index a7aae9b..7fc2df0 Binary files a/www/img/ribbon.png and b/www/img/ribbon.png differ diff --git a/www/index.html b/www/index.html index a0d402b..c2a643f 100644 --- a/www/index.html +++ b/www/index.html @@ -10,6 +10,10 @@ + + + + + + + + + + Willkommen bei zaaReloaded + + + + Bitte den Arbeitsmodus auswählen: + + +