92 Commits

Author SHA1 Message Date
4390d7ce52 Merge branch 'release-2.0.0-beta.3' 2015-08-20 22:03:37 +02:00
4c818010a7 Prepare release 2.0.0-beta.3. 2015-08-20 22:02:13 +02:00
f6e5087e3c More fixes to clinic defaults. 2015-08-20 21:59:51 +02:00
3fcb6c1af5 Always load default settings when deserializing SettingsRepository.
- VERBESSERT: Bei Updates werden neue eingebaute Stile jetzt immer berücksichtigt.
2015-08-20 21:51:31 +02:00
7eaabb7f13 Amend Lauris timepoint parsing to accept "Labor:" prefix.
- VERBESSERUNG: Datumseilen, die mit "Labor:" beginnen, werden nicht länger ignoriert.
2015-08-20 21:04:25 +02:00
058de8e8cf Fix parsing of negative limits in Lauris parameters.
- VERBESSERUNG: Keine Fehlermeldung mehr, falls Referenzbereiche negative Werte enthalten (wie z.B. Base Excess) [#650db4d2]
2015-08-20 16:54:18 +02:00
6d62e619eb Fix parameters and units for TPCR/ACR.
- VERBESSERUNG: Alias ACR für Albumin-Krea-Quotient; mg/g statt mg/g Crea.
2015-08-20 16:45:42 +02:00
b7d413c412 Change file name of downloaded update installer. 2015-08-20 16:45:06 +02:00
0d94d77483 Update clinic defaults. 2015-08-20 14:30:05 +02:00
a51d771dbe Fix bitmap files which caused div/0 errors on Win32. 2015-08-20 12:56:39 +02:00
ac486bbcee Add add-in name and version to application caption. 2015-08-18 09:00:26 +02:00
94ebf5508b Use UndoRecord.
- VERBESSERT: Formatierung erscheint nur noch als 1 Undo-Schritt.
2015-08-17 19:41:07 +02:00
8d24a669ac Merge branch 'release-2.0.0-beta.2' into develop 2015-08-16 16:37:11 +02:00
b9f35c8b11 Merge branch 'release-2.0.0-beta.2' 2015-08-16 16:36:46 +02:00
6c99224814 Prepare release 2.0.0-beta.2 2015-08-16 16:36:36 +02:00
b360d5b640 Merge branch 'text-formatting' into develop 2015-08-16 16:34:10 +02:00
fbcb060f12 Omit space before units starting with a slash.
- VERBESSERUNG: Einheiten, die mit einem Schrägstrich beginnen, werden nicht mehr mit Leerzeichen vom Wert getrennt.
2015-08-16 16:33:18 +02:00
221509520d Fix markup detection DocumentWriter. 2015-08-16 16:25:53 +02:00
392de61b74 Omit superfluous newline in output. 2015-08-16 05:17:24 +02:00
2745ab819c Do not create character style (currently not used). 2015-08-16 05:17:06 +02:00
2e8c881e1f Clean up assembly settings. 2015-08-15 20:15:52 +02:00
92a8faa972 Implement text styles.
- NEU: Überschriften und pathologische Werte werden jetzt besonders ausgezeichnet (fett).
2015-08-15 20:14:24 +02:00
4cb2999297 Create icons. 2015-08-14 20:00:21 +02:00
a609c7f93c Fix paragraph replacements in Daniel's style.
- VERBESSERT: Floskel-Ersetzungen in Daniels Spezial.
2015-08-14 19:27:29 +02:00
d5340d1b3a Fix ElementView.
- VERBESSERT: Element-Bearbeitungsfenster.
2015-08-14 18:12:34 +02:00
91b7aa70e9 Update ward style.
- GEÄNDERT: Diff.-BB-Werte im Stations-Stil in Hämatologie-Zeile integriert.
2015-08-14 18:11:58 +02:00
863dfa071a Prevent running the formatter without appropriate selection.
- VERBESSERT: Formatieren läßt sich nicht mehr starten, ohne daß Labor-Text markiert ist.
2015-08-14 17:04:50 +02:00
7a105d7aad Do not include material for explicitly selected items.
- VERÄNDERUNG: Laborwerte, die explizit (also nicht mit "*") ausgewählt werden, werden jetzt ohne vorangestelltes Material-Kürzel eingefügt (z.B. jetzt "Sammelurin: Volumen" anstatt "Sammelurin: SU-Volumen").
2015-08-14 16:01:52 +02:00
32d4e8d955 Implement bold font; make tests pass again.
- NEU: Überschriften und pathologische Werte werden fett gedruckt.
- FIX: Kleinere Bugfixes.
2015-08-14 11:22:11 +02:00
39e8b1f81d Add pre/post images to webpage. 2015-08-14 06:46:25 +02:00
de6dab5fb4 Fix link to version history. 2015-08-13 21:02:36 +02:00
5d2acb6233 Merge branch 'release-2.0.0-beta.1' into develop 2015-08-13 20:51:46 +02:00
bb67a993fb Merge branch 'release-2.0.0-beta.1' 2015-08-13 20:51:04 +02:00
193a83a769 Prepare release 2.0.0-beta.1 2015-08-13 20:50:53 +02:00
65e34cdf1d Write homepage. 2015-08-13 20:46:03 +02:00
8f9eb83e9d Use 'PTT' rather than 'aPTT'. 2015-08-13 19:57:53 +02:00
65ac72fb50 Use serialized Settings as defaults; fixes. 2015-08-13 19:20:20 +02:00
0461dfd66e Add more information to README.md. 2015-08-13 18:12:18 +02:00
63447def9b Multiple fixes for Views and ViewModels. 2015-08-13 17:59:23 +02:00
3a615eda8b Fix demoting elements while moving up. 2015-08-12 22:54:29 +02:00
a9d0e8ee7e Add IsExpanded property to ElementViewModel. 2015-08-12 22:29:31 +02:00
2bb0452a87 Implement moving of elements.
- NEU: Elemente können verschoben werden.
2015-08-12 22:03:25 +02:00
12c2412e38 Adjust size of SettingsView window. 2015-08-12 17:55:19 +02:00
e0b749382e Use buttons in SettingsView. 2015-08-12 17:54:23 +02:00
6f65340ca5 Use icons in SettingsRepositoryView. 2015-08-12 15:50:01 +02:00
f2cb30fabb Fix FormatElement labels if no content. 2015-08-12 10:05:50 +02:00
1afa9bb14f Fix views.
Needed to set all WindowStyles to ToolWindow and make the windows
topmost because Word and WPF do not play together all too well.
2015-08-12 10:04:59 +02:00
03a62ddf5a Fix SettingsRepositoryView layout. 2015-08-11 22:00:34 +02:00
5a0923e8e8 Implement reset settings feature.
- NEU: Auf Werkseinstellungen zurücksetzen.
2015-08-11 21:39:21 +02:00
0708f2a2b3 Implement import and export of Settings.
- NEU: Stile können importiert und exportiert werden.
2015-08-11 21:22:34 +02:00
00c60ba0ad Comment on serialization. 2015-08-11 19:51:23 +02:00
6af2243660 Do not return Null from SettingsRepository.Load(). 2015-08-11 16:16:26 +02:00
c9fc4a5fae Implement serialization of Settings and SettingsRepository.
- FIX: Stile werden jetzt gespeichert.
2015-08-11 16:12:39 +02:00
53d13b394e Do not expand elements tree by default. 2015-08-10 09:18:36 +02:00
947b53cf97 Fix material convertsion and units detection. 2015-08-10 06:55:57 +02:00
6c9f003134 Do not build headers from empty time stamps. 2015-08-09 21:21:56 +02:00
51bfdc760e Remove superfluous field from FormatElementViewModel. 2015-08-09 21:12:07 +02:00
a009c1ab39 Add control elements for columns.
- NEU: Steuer-Elemente für Spalten.
2015-08-09 20:54:43 +02:00
5833e0fcb7 Fix dev path in ExceptionViewModel. 2015-08-09 20:52:35 +02:00
750fb093b1 Show Word version and build number in exceptions. 2015-08-09 20:48:17 +02:00
11b9b9df54 Make formatter tests pass. 2015-08-09 19:54:48 +02:00
b59c9f2898 Wire up the views. 2015-08-09 13:24:44 +02:00
257e3e8568 Fix deleting settings. 2015-08-08 06:33:01 +02:00
c6121353e4 Make SettingsTest pass. 2015-08-07 21:40:12 +02:00
bde85e5651 Fix views and view models. 2015-08-07 21:37:14 +02:00
edaf88c4cd Implement blacklisting feature.
- NEU: Parameter können im Thesaurus als "blacklisted" markiert werden und werden dann bei Verwendung einer Wildcard ("*") nicht berücksichtigt.
2015-08-06 07:47:44 +02:00
b6c33971bd Fix thesaurus.
- FIX: Mehrere Thesaurus-Fehler behoben.
2015-08-06 06:42:08 +02:00
476f2d69be Improve date and time header (some tests failing now).
- NEU: Datumsangaben werden in eine Zeile "Laborwerte vom ..." eingebettet.
2015-08-05 22:04:07 +02:00
2cefede3c0 Output formatting.
- NEU: Formatierung der Ausgabe mit Absatzvorlage.
2015-08-05 21:52:06 +02:00
d0bd7dd2a5 Make sure to remember last used setting. 2015-08-05 21:43:08 +02:00
ed43497179 Implement copying of elements. 2015-08-05 21:22:03 +02:00
1205958eb1 Implement test to delete child element and make it pass. 2015-08-05 20:36:31 +02:00
60296602a9 Implement DeleteElementCommand. 2015-08-05 20:28:09 +02:00
742a588083 Make tests pass again (except not implemented ones). 2015-08-05 20:02:02 +02:00
b7fdf87ea5 Close view after sending UseSettingsMessage. 2015-08-05 06:47:30 +02:00
880e8b0bdc Fix importing of actual Word text.
- FIX: Datenimport funktioniert jetzt auch mit Word-Text und nicht nur in den Tests.
2015-08-05 06:46:52 +02:00
06a74992ef Make tests pass with refactored ZaaImporter. 2015-08-05 06:15:07 +02:00
285c6a2555 Add CanRun property to Formatter. 2015-08-04 23:26:21 +02:00
75c9c984c6 Refactor and harden ZaaImporter. 2015-08-04 23:21:38 +02:00
ae9cf7fa2e Improve demo document. 2015-08-04 20:17:36 +02:00
33d453cf73 Use ViewModelListBox dynamic resource. 2015-08-04 06:25:13 +02:00
8d6ed32a84 Fix LastSelected and LastSelectedElement properties. 2015-08-04 06:21:48 +02:00
5fe7250b53 Merge branch 'release-2.0.0-alpha.5' into develop 2015-08-04 02:46:46 +02:00
34006ba1e9 Merge branch 'release-2.0.0-alpha.5' 2015-08-04 02:46:21 +02:00
204139d16b Prepare release 2.0.0-alpha.5. 2015-08-04 02:46:12 +02:00
41b155e8be Begin implemenation of format and choose style commands. 2015-08-04 02:43:17 +02:00
b6209731ec Fix salutation regex in DanielsStyle.
- FIX: Daniels Spezial löscht nicht mehr die Unterschriften.
2015-08-04 01:19:19 +02:00
a128b76522 Implement tests for SettingsViewModel add and add child commands. 2015-08-04 01:17:14 +02:00
805da69d47 Implement passing test for ElementPickerViewModel. 2015-08-03 14:31:35 +02:00
8437f0907c Implement Demo feature.
- NEU: Eingebautes Demo-Dokument zum Ausprobieren.
2015-08-03 12:11:30 +02:00
db8f88c563 Fix SettingsViewModelTest.CannotAddChildElementToFormatElement. 2015-08-03 06:32:05 +02:00
14b09f89c5 Merge branch 'release-2.0.0-alpha.4' into develop 2015-08-02 22:05:39 +02:00
132 changed files with 4450 additions and 604 deletions

View File

@ -1,3 +1,57 @@
Version 2.0.0-beta.3 (2015-08-20)
========================================================================
- VERBESSERT: Bei Updates werden neue eingebaute Stile jetzt immer berücksichtigt.
- VERBESSERT: Formatierung erscheint nur noch als 1 Undo-Schritt.
- VERBESSERUNG: Alias ACR für Albumin-Krea-Quotient; mg/g statt mg/g Crea.
- VERBESSERUNG: Datumseilen, die mit "Labor:" beginnen, werden nicht länger ignoriert.
- VERBESSERUNG: Keine Fehlermeldung mehr, falls Referenzbereiche negative Werte enthalten (wie z.B. Base Excess) [#650db4d2]
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Version 2.0.0-beta.2 (2015-08-16)
========================================================================
- FIX: Kleinere Bugfixes.
- GEÄNDERT: Diff.-BB-Werte im Stations-Stil in Hämatologie-Zeile integriert.
- NEU: Überschriften und pathologische Werte werden fett gedruckt.
- NEU: Überschriften und pathologische Werte werden jetzt besonders ausgezeichnet (fett).
- VERBESSERT: Element-Bearbeitungsfenster.
- VERBESSERT: Floskel-Ersetzungen in Daniels Spezial.
- VERBESSERT: Formatieren läßt sich nicht mehr starten, ohne daß Labor-Text markiert ist.
- VERBESSERUNG: Einheiten, die mit einem Schrägstrich beginnen, werden nicht mehr mit Leerzeichen vom Wert getrennt.
- VERÄNDERUNG: Laborwerte, die explizit (also nicht mit "*") ausgewählt werden, werden jetzt ohne vorangestelltes Material-Kürzel eingefügt (z.B. jetzt "Sammelurin: Volumen" anstatt "Sammelurin: SU-Volumen").
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Version 2.0.0-beta.1 (2015-08-13)
========================================================================
- FIX: Datenimport funktioniert jetzt auch mit Word-Text und nicht nur in den Tests.
- FIX: Mehrere Thesaurus-Fehler behoben.
- FIX: Stile werden jetzt gespeichert.
- NEU: Auf Werkseinstellungen zurücksetzen.
- NEU: Datumsangaben werden in eine Zeile "Laborwerte vom ..." eingebettet.
- NEU: Elemente können verschoben werden.
- NEU: Formatierung der Ausgabe mit Absatzvorlage.
- NEU: Parameter können im Thesaurus als "blacklisted" markiert werden und werden dann bei Verwendung einer Wildcard ("*") nicht berücksichtigt.
- NEU: Steuer-Elemente für Spalten.
- NEU: Stile können importiert und exportiert werden.
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Version 2.0.0-alpha.5. (2015-08-04)
========================================================================
- FIX: Daniels Spezial löscht nicht mehr die Unterschriften.
- NEU: Eingebautes Demo-Dokument zum Ausprobieren.
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Version 2.0.0-alpha.3 (2015-07-31)
========================================================================

View File

@ -52,6 +52,11 @@ folgende Teile aufgeteilt:
existieren verschiedene Klassen, die die Klassen des Labor-Modells
(`zaaReloaded2.LabModel`) umschließen und um entsprechende
Funktionalitäten erweitern.
- __Kontrolle der Formatierung:__ Der Namensraum
`zaaReloaded2.Controller` umfaßt Klassen, mit denen ein
`zaaReloaded2.Formatter.Formatter` gesteuert werden kann. Diese
Klassen spielen eine große Rolle bei den benutzerdefinierten
Anpassungen von Stilen.
## Parsen der Lauris-Ausgabe
@ -174,4 +179,49 @@ oder nicht-normalen Parametern oder immer mit ausgegeben werden:
Die Markierung besonderer Parameter erfolgt in der Textdatei, aus der
das `zaaReloaded2.Thesaurus.Parameters` generiert wird (s.o.).
## User Interface
Das User Interface wurde mit der Windows Presentation Foundation nach
dem [MVVM][]-Muster implementiert. Dabei wurde auf das Hilfs-Framework
[Bovender][bovender-framework] zurückgegriffen.
## Updates
Das Add-in sucht täglich nach einem Update; dabei wird die Datei
<http://zaa.nephrowiki.de/versioninfo.txt> heruntergeladen. Updates
werden automatisch im Hintergrund geladen und beim Schließen von Word
(bzw. der Zentralen Arztbriefablage) installiert und stehen dann beim
nächsten Starten der Anwendung zur Verfügung.
## Serialisierung
Um das Stil-Repositorium (`zaaReloaded2.Controller.SettingsRepository`)
in den Assembly-Properties speichern zu können und für den Im- und
Export von Stilen werden die in .NET eingebauten
Serialisierungs-Strukturen genutzt. Weil es mit der Verwendung eines
`XmlSerializer`s Probleme gab, weil der `XmlSerializer` nicht mit
Interface-Eigenschaften umgehen kann, wurde zunächst für alle Klassen,
die serialisiert werden müssen (`SettingsRepository`,
`zaaReloaded2.Controller.Settings` und die von
`zaaReloaded2.Controller.Elements.ElementBase` abgeleiteten Klassen) das
Interface `ISerializable` implementiert. Das hat aber auch nicht dazu
geführt, daß der `XmlSerializer` die Klassen serialisierte, so daß
jetzt der `SoapFormatter` verwendet wird. Der stört sich nicht an
Interface-Eigenschaften und produziert auch XML, wenngleich im etwas
komplizierten [SOAP][]-Format.
Um das `SettingsRepository` in den Assembly-Properties zu persistieren,
muß das serialisierte XML noch in einen Base64-kodierten String
umgewandelt werden, damit das SOAP-XML nicht mit dem XML der
Assembly-Properties ins Gehege kommt (siehe
`zaaReloaded2.Controller.SettingsRepository.Load()` und
`zaaReloaded2.Controller.SettingsRepository.Store()`).
[SOAP]: http://de.wikipedia.org/wiki/SOAP
[MVVM]: http://de.wikipedia.org/wiki/MVVM
[bovender-framework]: https://github.com/bovender/bovender
<!-- vim: set tw=72 sw=2 ts=2 sts=-1 : -->

View File

@ -24,6 +24,7 @@ using Microsoft.Office.Interop.Word;
using zaaReloaded2.LabModel;
using zaaReloaded2.Formatter;
using zaa = zaaReloaded2.Controller.Elements;
using System.Text.RegularExpressions;
namespace Tests.Controller.Elements
{
@ -61,7 +62,12 @@ namespace Tests.Controller.Elements
_formatter.Laboratory = lab;
_formatter.Settings.Elements.Add(new zaa.Items("Na, K, Cl"));
_formatter.Run();
Assert.AreEqual("Na 133, K 6 (5)\r", _document.Range().Text);
string expected = (
StripMarkup(
TimePointFormatter.DateAndTimeHeader(new DateTime(2015, 07, 13, 13, 31, 00)) +
"Na 133, K 6 (5)\r\r").Replace(Environment.NewLine, "\r")
);
Assert.AreEqual(expected, _document.Range().Text);
}
[Test]
@ -78,7 +84,12 @@ namespace Tests.Controller.Elements
_formatter.Laboratory = lab;
_formatter.Settings.Elements.Add(new zaa.Items("Klinische Chemie: Na, K, Cl"));
_formatter.Run();
Assert.AreEqual("Klinische Chemie: Na 133, K 6 (5)\r", _document.Range().Text);
string expected = (
StripMarkup(
TimePointFormatter.DateAndTimeHeader(new DateTime(2015, 07, 13, 13, 31, 00)) +
"Klinische Chemie: Na 133, K 6 (5)\r\r").Replace(Environment.NewLine, "\r")
);
Assert.AreEqual(expected, _document.Range().Text);
}
[Test]
@ -113,8 +124,12 @@ namespace Tests.Controller.Elements
_formatter.Laboratory = lab;
_formatter.Settings.Elements.Add(new zaa.Items("Klinische Chemie: Na, *"));
_formatter.Run();
Assert.AreEqual("Klinische Chemie: Na 133, Cl 110, K 6\r",
_document.Range().Text);
string expected = (
StripMarkup(
TimePointFormatter.DateAndTimeHeader(new DateTime(2015, 07, 13, 13, 31, 00))
) +
"Klinische Chemie: Na 133, Cl 110, K 6\r\r").Replace(Environment.NewLine, "\r");
Assert.AreEqual(expected, _document.Range().Text);
}
[Test]
@ -133,8 +148,12 @@ namespace Tests.Controller.Elements
_formatter.Laboratory = lab;
_formatter.Settings.Elements.Add(new zaa.Items("Klinische Chemie: Na, SU-*"));
_formatter.Run();
Assert.AreEqual("Klinische Chemie: Na 133, SU-Protein 2,8\r",
_document.Range().Text);
string expected = (
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");
Assert.AreEqual(expected, _document.Range().Text);
}
[Test]
@ -153,8 +172,20 @@ namespace Tests.Controller.Elements
_formatter.Laboratory = lab;
_formatter.Settings.Elements.Add(new zaa.Items("Klinische Chemie: Na, SU-*, *"));
_formatter.Run();
Assert.AreEqual("Klinische Chemie: Na 133, SU-Protein 2,8, Cl 110, U-Na 99\r",
_document.Range().Text);
}
string expected = (
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")
.Replace(Environment.NewLine, "\r");
Assert.AreEqual(expected, _document.Range().Text);
}
static string StripMarkup(string s)
{
return _markupStripper.Replace(s, string.Empty);
}
static readonly Regex _markupStripper = new Regex(@"<[^>]+>");
}
}

View File

@ -27,7 +27,7 @@ namespace Tests.Controller
[TestFixture]
class SettingsRepositoryTest
{
SettingsRepository _savedSettings;
string _savedSettings;
[SetUp]
public void SetUp()
@ -50,11 +50,13 @@ namespace Tests.Controller
string testName = "test";
s.Name = testName;
sr.SettingsList.Add(s);
int expected = sr.SettingsList.Count;
int index = sr.SettingsList.IndexOf(s);
sr.Store();
sr = null;
sr = SettingsRepository.Load();
Assert.AreEqual(1, sr.SettingsList.Count);
Assert.AreEqual(testName, sr.SettingsList[0].Name);
Assert.AreEqual(expected, sr.SettingsList.Count);
Assert.AreEqual(testName, sr.SettingsList[index].Name);
}
}
}

View File

@ -0,0 +1,54 @@
/* SettingsTest.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;
using zaaReloaded2.Controller.Elements;
using System.IO;
namespace Tests.Controller
{
[TestFixture]
class SettingsTest
{
[Test]
public void CloneSettings()
{
SelectEachDay selectEachDay = new SelectEachDay();
Items items = new Items("some text");
Settings source = new Settings(
"hello world",
new List<ElementBase>() { selectEachDay, items });
source.ReferenceStyle = zaaReloaded2.Formatter.ReferenceStyle.IfSpecialOrAbnormal;
Settings clone = source.Clone() as Settings;
Assert.AreNotSame(source, clone);
Assert.AreEqual("Kopie von " + source.Name, clone.Name,
"Name");
Assert.AreNotSame(source.Elements, clone.Elements);
Assert.AreEqual(source.ReferenceStyle, clone.ReferenceStyle,
"ReferenceStyle");
Assert.AreEqual(
((Items)source.Elements[1]).Content,
((Items)clone.Elements[1]).Content,
"Items content");
}
}
}

View File

@ -21,6 +21,7 @@ using System.Linq;
using System.Text;
using NUnit.Framework;
using zaaReloaded2.Formatter;
using Microsoft.Office.Interop.Word;
namespace Tests.Formatter
{
@ -95,5 +96,15 @@ namespace Tests.Formatter
Assert.IsFalse(_docWriter.HasBufferedText);
Assert.AreEqual(String.Empty, _docWriter.ToString());
}
[Test]
public void TextMarkup()
{
DocumentWriter output = new DocumentWriter();
_docWriter.Parent = output;
_docWriter.Write("This is not bold. <b>This is bold!</b>\rThis not.");
_docWriter.Flush();
Assert.AreEqual("This is not bold. This is bold!\rThis not.", output.Text);
}
}
}

View File

@ -1,7 +1,7 @@

04.07.2015 12:31:00:
Laborwerte vom 04.07.2015 12:31:00:
Klinische Chemie: Na 144 mM, K 4,3 mM
06.07.2015 10:28:00:
Laborwerte vom 06.07.2015 10:28:00:
Klinische Chemie: Na 138 mM, K 4,6 mM

View File

@ -1,7 +1,7 @@

04.07.2015:
Laborwerte vom 04.07.2015:
Klinische Chemie: Na 144 mM, K 4,3 mM
06.07.2015:
Laborwerte vom 06.07.2015:
Klinische Chemie: Na 138 mM, K 4,6 mM

View File

@ -1,4 +1,4 @@

04.07.2015:
Laborwerte vom 04.07.2015:
Klinische Chemie: Na 144 mM, K 4,3 mM

View File

@ -1,4 +1,4 @@

06.07.2015:
Laborwerte vom 06.07.2015:
Klinische Chemie: Na 138 mM, K 4,6 mM

View File

@ -99,6 +99,25 @@ namespace Tests.Formatter
_document.Range().Text);
}
[Test]
public void FormatSpecialItems()
{
ZaaImporter importer = new ZaaImporter();
importer.Import(
"Klinische Chemie: glomerul. Filtrationsr. CKD-EP: 36 ml/min /1,73qm; " +
"Sammelmenge (U): 12300 ml; "
);
Document document = new Document();
f.Formatter formatter = new f.Formatter(document);
formatter.Laboratory = importer.Laboratory;
formatter.Settings = new zaaReloaded2.Controller.Settings(
new List<ElementBase>() { new Items("*") } );
formatter.Run();
Assert.AreEqual(
"eGFR (CKD-EPI) 36 ml/min/1,73 m², SU-Volumen 12300 ml\r\r",
document.Range().Text);
}
string GetResourceText(string resource)
{
try

View File

@ -29,6 +29,7 @@ namespace Tests.Importer.ZaaImporter
class LaurisItemTest
{
[Test]
[TestCase("BE: 5.2 [-2 - 2] mmol/l", "BE", 5.2, "mmol/l", -2, 2, false)]
[TestCase("Natrium: 139 [135 - 145] mmol/l", "Natrium", 139, "mmol/l", 135, 145, true)]
[TestCase("Kalium: 5.2 [3.5 - 5] mmol/l", "Kalium", 5.2, "mmol/l", 3.5, 5, false)]
public void ParseLaurisWithBothLimits(

View File

@ -40,7 +40,7 @@ namespace Tests.Importer.ZaaImporter
[Test]
public void ParseInvalidLaurisTimePoints()
{
LaurisTimePoint tp = new LaurisTimePoint("Aerobe Kultur: Enterokokken ;  Wachstum: 10 ;");
LaurisTimePoint tp = new LaurisTimePoint("Mit freundlichen Grüßen");
Assert.IsFalse(tp.IsValidTimePoint,
"Bogus paragraph should be invalid LaurisTimePoint");

View File

@ -41,5 +41,15 @@ namespace Tests.Importer.ZaaImporter
// Only 6 distinct time points (see method documentation above).
Assert.AreEqual(6, importer.Laboratory.TimePoints.Count);
}
[Test]
public void ParseInvalidInput()
{
zaa.ZaaImporter importer = new zaa.ZaaImporter();
importer.Import("some arbitrary text\r\nthat does not represent\r\na valid lab");
Assert.IsFalse(importer.Success);
importer.Import("(03.03.1930 13:30:00)\r\nKlinische Chemie: Natrium 135 [135 - 145] mmol/l;");
Assert.IsTrue(importer.Success);
}
}
}

169
Tests/SerializationTest.cs Executable file
View File

@ -0,0 +1,169 @@
/* SelectFirstDayTest.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.IO;
using System.Linq;
using System.Text;
using System.Xml.Serialization;
using zaaReloaded2.Controller.Elements;
using NUnit.Framework;
using System.Runtime.Serialization.Formatters.Binary;
using System.Runtime.Serialization.Formatters.Soap;
using zaaReloaded2.Controller;
namespace Tests.Controller
{
[TestFixture]
class SerializationTest
{
[Test]
public void SerializeControlElement()
{
SelectFirstDay element = new SelectFirstDay(
new List<FormatElementBase>()
{
new Items("hello"),
new Items("world")
}
);
MemoryStream stream = new MemoryStream();
// XmlSerializer does not work with interface properties...
// XmlSerializer serializer = new XmlSerializer(typeof(SelectFirstDay));
// BinaryFormatter serializer = new BinaryFormatter();
SoapFormatter serializer = new SoapFormatter();
serializer.Serialize(stream, element);
stream.Position = 0;
StreamReader sr = new StreamReader(stream);
Console.WriteLine(sr.ReadToEnd());
stream.Position = 0;
SelectFirstDay deserialized = serializer.Deserialize(stream) as SelectFirstDay;
Assert.IsNotNull(deserialized);
Assert.AreEqual(element.Children.Count, deserialized.Children.Count);
Assert.AreEqual(element.Children[0].Content, deserialized.Children[0].Content);
Assert.AreEqual(element.Children[1].Content, deserialized.Children[1].Content);
}
[Test]
public void SerializeFormatElement()
{
string testString = "Hello World";
CustomText element = new CustomText();
element.Content = testString;
MemoryStream stream = new MemoryStream();
SoapFormatter serializer = new SoapFormatter();
serializer.Serialize(stream, element);
stream.Position = 0;
CustomText deserialized = serializer.Deserialize(stream) as CustomText;
Assert.IsNotNull(deserialized);
Assert.AreEqual(element.Content, deserialized.Content);
}
[Test]
public void SerializeSettings()
{
Settings settings = CreateTestSettings1();
MemoryStream stream = new MemoryStream();
SoapFormatter serializer = new SoapFormatter();
serializer.Serialize(stream, settings);
stream.Position = 0;
Settings deserialized = serializer.Deserialize(stream) as Settings;
Assert.IsNotNull(deserialized);
Assert.AreEqual(settings.Name, deserialized.Name);
Assert.AreEqual(settings.ReferenceStyle, deserialized.ReferenceStyle);
Assert.AreEqual(settings.Elements.Count, deserialized.Elements.Count);
Assert.AreEqual(settings.Elements[0].GetType(), deserialized.Elements[0].GetType());
Assert.AreEqual(settings.Elements[1].GetType(), deserialized.Elements[1].GetType());
}
[Test]
public void SerializeSettingsRepository()
{
SettingsRepository repository = new SettingsRepository();
repository.SettingsList.Add(CreateTestSettings1());
repository.SettingsList.Add(CreateTestSettings2());
MemoryStream stream = new MemoryStream();
SoapFormatter serializer = new SoapFormatter();
serializer.Serialize(stream, repository);
stream.Position = 0;
SettingsRepository deserialized = serializer.Deserialize(stream) as SettingsRepository;
Assert.IsNotNull(deserialized);
Assert.AreEqual(repository.SettingsList.Count, deserialized.SettingsList.Count);
Assert.AreEqual(
repository.SettingsList[1].Elements.Count,
deserialized.SettingsList[1].Elements.Count
);
Assert.AreEqual(
repository.SettingsList[0].Name,
deserialized.SettingsList[0].Name
);
Assert.AreEqual(
repository.SettingsList[0].ReferenceStyle,
deserialized.SettingsList[0].ReferenceStyle
);
}
Settings CreateTestSettings1()
{
string testName = "test name...";
string testString = "Hello World";
SelectFirstDay controlElement = new SelectFirstDay(
new List<FormatElementBase>()
{
new Items("hello"),
new Items("world")
}
);
CustomText formatElement = new CustomText();
formatElement.Content = testString;
Settings settings = new Settings(testName, new List<ElementBase>()
{
controlElement,
formatElement
}
);
settings.ReferenceStyle = zaaReloaded2.Formatter.ReferenceStyle.IfSpecialItem;
return settings;
}
Settings CreateTestSettings2()
{
string testName = "another test name";
SelectFirstDay controlElement1 = new SelectFirstDay(
new List<FormatElementBase>()
{
new CustomText(),
}
);
SelectLastDay controlElement2 = new SelectLastDay(
new List<FormatElementBase>()
{
new Items("Items content"),
}
);
Settings settings = new Settings(testName, new List<ElementBase>()
{
controlElement1,
controlElement2
}
);
settings.ReferenceStyle = zaaReloaded2.Formatter.ReferenceStyle.IfSpecialOrAbnormal;
return settings;
}
}
}

View File

@ -58,11 +58,13 @@
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Runtime.Serialization.Formatters.Soap" />
<Reference Include="System.Windows.Interactivity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Expression.Blend.Sdk.1.0.2\lib\net40-client\System.Windows.Interactivity.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Xaml" />
<Reference Include="System.XML" />
<Reference Include="WindowsBase" />
</ItemGroup>
<Choose>
@ -78,7 +80,9 @@
</Otherwise>
</Choose>
<ItemGroup>
<Compile Include="SerializationTest.cs" />
<Compile Include="Controller\SettingsRepositoryTest.cs" />
<Compile Include="Controller\SettingsTest.cs" />
<Compile Include="Formatter\DocumentWriterTest.cs" />
<Compile Include="Thesaurus\ThesaurusTest.cs" />
<Compile Include="Controller\Elements\ItemsTest.cs" />
@ -91,6 +95,7 @@
<Compile Include="Thesaurus\TestThesaurus.cs" />
<Compile Include="Importer\ZaaImporter\TimePointTest.cs" />
<Compile Include="TestHelpers.cs" />
<Compile Include="ViewModels\ElementPickerViewModelTest.cs" />
<Compile Include="ViewModels\SettingsRepositoryViewModelTest.cs" />
<Compile Include="ViewModels\SettingsViewModelTest.cs" />
</ItemGroup>

View File

@ -0,0 +1,54 @@
/* ElementPickerViewModelTest.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 Bovender.Mvvm.ViewModels;
using zaaReloaded2.ViewModels;
namespace Tests.ViewModels
{
[TestFixture]
class ElementPickerViewModelTest
{
[Test]
public void ChooseElement()
{
ElementPickerViewModel vm = new ElementPickerViewModel(true);
ViewModelBase elementVM = vm.Categories.First().Children.First();
elementVM.IsSelected = true;
string expectedLabel = elementVM.DisplayString;
Assert.IsTrue(vm.ChooseElementCommand.CanExecute(null),
"Cannot execute ChooseElementCommand");
bool messageSent = false;
vm.ElementChosenMessage.Sent += (sender, args) =>
{
messageSent = true;
ViewModelBase messageContentVM = args.Content.ViewModel as ViewModelBase;
Assert.AreEqual(expectedLabel, messageContentVM.DisplayString);
};
vm.ChooseElementCommand.Execute(null);
Assert.IsTrue(messageSent, "No message was sent when element was chosen");
}
}
}

View File

@ -65,7 +65,12 @@ namespace Tests.ViewModels
Assert.AreNotSame(orig, copy);
Assert.AreNotSame(orig.RevealModelObject(), copy.RevealModelObject());
Assert.AreEqual(String.Format("Kopie von {0}", orig.Name), copy.Name);
Assert.AreEqual(
String.Format(
"Kopie von {0}",
orig.Name.Replace(" (eingebaut)", String.Empty)
),
copy.Name);
Assert.IsTrue(copy.IsSelected);
}
}

View File

@ -40,13 +40,52 @@ namespace Tests.ViewModels
[Test]
public void AddElement()
{
bool messageSent = false;
Settings model = _settingsVM.RevealModelObject() as Settings;
int oldViewModelElementCount = _settingsVM.Elements.Count;
int oldModelElementCount = model.Elements.Count;
_settingsVM.AddElementMessage.Sent += (sender, args) =>
{
messageSent = true;
ElementPickerViewModel picker = args.Content.ViewModel as ElementPickerViewModel;
Assert.IsNotNull(picker, "ViewModel in MessageContent is not an ElementPickerViewModel");
picker.Categories.First().Children.First().IsSelected = true;
picker.ChooseElementCommand.Execute(null);
};
_settingsVM.AddElementCommand.Execute(null);
Assert.IsTrue(messageSent, "Message was not sent");
Assert.AreEqual(oldViewModelElementCount + 1, _settingsVM.Elements.Count,
"Count of elements in ViewModel was not increased by 1");
Assert.AreEqual(oldModelElementCount + 1, model.Elements.Count,
"Count of elements in settings Model was not increased by 1");
}
[Test]
public void AddChildElement()
{
bool messageSent = false;
SelectEachDay model = new SelectEachDay();
ControlElementViewModel viewModel = new ControlElementViewModel(model);
_settingsVM.AddElementViewModel(viewModel);
viewModel.IsSelected = true;
int oldViewModelChildrenCount = viewModel.Elements.Count;
int oldModelChildrenCount = model.Children.Count;
_settingsVM.AddChildElementMessage.Sent += (sender, args) =>
{
messageSent = true;
ElementPickerViewModel picker = args.Content.ViewModel as ElementPickerViewModel;
Assert.IsNotNull(picker, "ViewModel in MessageContent is not an ElementPickerViewModel");
picker.Categories.First().Children.First().IsSelected = true;
Assert.IsTrue(picker.ChooseElementCommand.CanExecute(null),
"Cannot execute element picker's ChooseElementCommand.");
picker.ChooseElementCommand.Execute(null);
};
_settingsVM.AddChildElementCommand.Execute(null);
Assert.IsTrue(messageSent, "Message was not sent");
Assert.AreEqual(oldViewModelChildrenCount + 1, viewModel.Elements.Count,
"Count of children in ViewModel was not increased by 1");
Assert.AreEqual(oldModelChildrenCount + 1, model.Children.Count,
"Count of children in Model was not increased by 1");
}
[Test]
@ -58,7 +97,7 @@ namespace Tests.ViewModels
parent.IsSelected = true;
Assert.IsTrue(_settingsVM.AddChildElementCommand.CanExecute(null));
FormatElementViewModel child = new FormatElementViewModel(new Items());
parent.AddChildElement(child);
_settingsVM.AddChildElementViewModel(parent, child);
parent.IsSelected = false;
child.IsSelected = true;
Assert.IsFalse(_settingsVM.AddChildElementCommand.CanExecute(null));
@ -67,13 +106,83 @@ namespace Tests.ViewModels
[Test]
public void DeleteElement()
{
Settings settings = new Settings();
settings.AddElement(new SelectFirstDay());
settings.AddElement(new SelectEachDay());
settings.AddElement(new SelectLastDay());
SettingsViewModel settingsVM = new SettingsViewModel(settings);
int oldCount = settingsVM.Elements.Count;
ElementViewModel elementVM = settingsVM.Elements.First();
ElementBase element = elementVM.RevealModelObject() as ElementBase;
Assert.IsTrue(settings.Elements.Contains(element),
"Settings object does not contain the model that the VM revealed?!");
elementVM.IsSelected = true;
Assert.IsTrue(settingsVM.DeleteElementCommand.CanExecute(null),
"DeleteElementCommand should be enabled.");
settingsVM.DeleteElementCommand.Execute(null);
Assert.AreEqual(oldCount - 1, settingsVM.Elements.Count);
Assert.IsFalse(settingsVM.Elements.Contains(elementVM),
"Elements collection still contains the deleted element view model.");
Assert.IsFalse(settings.Elements.Contains(element),
"Settings' Element collection still contains the element model.");
}
[Test]
public void DeleteChildElement()
{
Settings settings = new Settings();
settings.AddElement(new SelectFirstDay(new Items()));
settings.AddElement(new SelectEachDay());
settings.AddElement(new SelectLastDay());
SettingsViewModel settingsVM = new SettingsViewModel(settings);
ControlElementViewModel parent = ((ControlElementViewModel)settingsVM.Elements.First());
int oldCount = parent.Elements.Count;
ElementViewModel elementVM = ((ControlElementViewModel)settingsVM.Elements.First())
.Elements.First();
ElementBase element = elementVM.RevealModelObject() as ElementBase;
Assert.IsTrue(((ControlElementBase)settings.Elements[0]).Children.Contains(element),
"Settings object does not contain the model that the VM revealed?!");
elementVM.IsSelected = true;
Assert.IsTrue(settingsVM.DeleteElementCommand.CanExecute(null),
"DeleteElementCommand should be enabled.");
settingsVM.DeleteElementCommand.Execute(null);
Assert.AreEqual(oldCount - 1, parent.Elements.Count);
Assert.IsFalse(parent.Elements.Contains(elementVM),
"Elements collection still contains the deleted element view model.");
Assert.IsFalse(((ControlElementBase)settings.Elements[0]).Children.Contains(element),
"Settings' collection of FormatElement children still contains the element model.");
}
[Test]
public void CopyElement()
{
string testString = "this text should be duplicated";
_settingsVM.AddElementViewModel(
new ControlElementViewModel(new SelectEachDay(new Items(testString))));
int oldCount = _settingsVM.Elements.Count;
_settingsVM.Elements.First().IsSelected = true;
Assert.IsTrue(_settingsVM.CopyElementCommand.CanExecute(null),
"CopyElementCommand should be enabled.");
_settingsVM.CopyElementCommand.Execute(null);
Assert.AreEqual(oldCount + 1, _settingsVM.Elements.Count);
// Access the first element
ControlElementViewModel controlVM = _settingsVM.Elements.First() as ControlElementViewModel;
FormatElementViewModel formatVM = controlVM.Elements.First() as FormatElementViewModel;
Items items = formatVM.RevealModelObject() as Items;
Assert.IsNotNull(items,
"Child ViewModel of first ControlElementViewModel does not wrap Items object.");
Assert.AreEqual(testString, items.Content,
"First control element's child element has incorrect Content string.");
// Access the second element
controlVM = _settingsVM.Elements.Last() as ControlElementViewModel;
formatVM = controlVM.Elements.First() as FormatElementViewModel;
items = formatVM.RevealModelObject() as Items;
Assert.IsNotNull(items,
"Child ViewModel of last ControlElementViewModel does not wrap Items object.");
Assert.AreEqual(testString, items.Content,
"First control element's child element has incorrect Content string.");
}
}
}

BIN
gimp/d.xcf Normal file

Binary file not shown.

BIN
gimp/down.xcf Normal file

Binary file not shown.

BIN
gimp/duplicate.xcf Normal file

Binary file not shown.

BIN
gimp/exit.xcf Normal file

Binary file not shown.

BIN
gimp/export.xcf Normal file

Binary file not shown.

BIN
gimp/gear.xcf Normal file

Binary file not shown.

BIN
gimp/icon.xcf Normal file

Binary file not shown.

BIN
gimp/import.xcf Normal file

Binary file not shown.

Binary file not shown.

BIN
gimp/installbanner.xcf Normal file

Binary file not shown.

BIN
gimp/minus.xcf Normal file

Binary file not shown.

BIN
gimp/pen.xcf Normal file

Binary file not shown.

BIN
gimp/plus-child.xcf Normal file

Binary file not shown.

BIN
gimp/plus.xcf Normal file

Binary file not shown.

BIN
gimp/reset.xcf Normal file

Binary file not shown.

BIN
gimp/up.xcf Normal file

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 204 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 153 KiB

View File

@ -67,9 +67,9 @@ AppSupportURL=http://zaa.nephrowiki.de
AppUpdatesURL=http://zaa.nephrowiki.de
; Setup wizard
;SetupIconFile=setup-files\xltoolbox.ico
;WizardImageFile=setup-files\installbanner.bmp
;WizardSmallImageFile=setup-files\icon-48.bmp
SetupIconFile=setup-files\icon.ico
WizardImageFile=setup-files\installbanner.bmp
WizardSmallImageFile=setup-files\installbanner-small.bmp
ArchitecturesAllowed=x86 x64
ArchitecturesInstallIn64BitMode=x64
DisableProgramGroupPage=true

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
www/img/elementpicker.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
www/img/nachher.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

BIN
www/img/ribbon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

BIN
www/img/stilauswahl.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

BIN
www/img/stilbearbeiten.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

BIN
www/img/vorher.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

View File

@ -1,20 +1,186 @@
<html>
<head>
<title>zaaReloaded2 by Daniel Kraus</title>
<meta charset="utf-8">
<meta name="author" content="Daniel Kraus">
<style type="text/css"><!--
* {
font-family: Arial; font-size: 16px; line-height: 125%;
color: #333;
}
body { margin: 16px 24px; max-width: 800px; }
h1, h2 { color: #5e2750; }
h1 { font-size: 300%; margin: 48px 0 24px 0; }
h2 { font-size: 200%; margin: 32px 0 16px 0; }
p { text-align: justify; }
img {
box-shadow: 2px 2px 8px #444;
}
.download {
width: 500px; margin: 16px auto;
padding: 8px; border: 1px solid #888;
box-shadow: 2px 2px 8px #444;
background-color: #eef;
}
.float-right {
float: right;
margin: 8px 0 8px 16px;
}
.center {
text-align: center;
}
.clear {
clear: both;
}
--></style>
</head>
<body>
<h1>zaaReloaded2</h1>
<p>
<p style="font-weight: bold;">
Erweiterung für Microsoft&reg; Word 2010-2013, das die <a
href="http://www.smi.ukw.de/sap-klinische-verfahren/archivsysteme/zentrale-arztbriefablage.html">
Zentrale Arztbriefablage (ZAA)</a> um Funktionen für das Formatieren
von Laborwerten erweitert.
</p>
<div class="download">
<h2 style="margin-top:0">Download</h2>
<p><a href="downloads/">zaa.nephrowiki.de/downloads</a></p>
</div>
<h2>Vorher</h2>
<p class="center"><img src="img/vorher.png" alt="Vorher" /></p>
<h2>Nachher</h2>
<p>Am Beispiel des Ambulanz-Stils:</p>
<p class="center"><img src="img/nachher.png" alt="Nachher" /></p>
<h2>Anleitung</h2>
<p class="center">
<img src="img/ribbon.png" alt="zaaReloaded2-Ribbon" />
</p>
<ol>
<li>Laborwerte auf üblichem Wege in einen Arztbrief einfügen
(alternativ kann der Befehl "Demo" ausgeführt werden, dann wird
ein Beispieldokument mit Laborwerten geöffnet).</li>
<li>Im zaaReloaded-Tab (s.o.) den linken Knopf "Formatieren"
klicken.</li>
<p class="center">
<img src="img/stilauswahl.png" alt="Stil auswählen" />
</p>
<li>
Beim ersten Mal erscheint eine Liste mit Stilen, aus der man den
gewünschten Stil auswählt (siehe Abbildung). Beim nächsten Mal,
wenn man auf diesen Knopf drückt, wird der zuletzt verwendete Stil
genommen.</li>
<li>Einen Moment warten... Voilà.</li>
</ol>
<h2 class="clear">Anpassen</h2>
<p>
Das Addin enthält einen Stil-Editor, mit dem die eingebauten Stile
bearbeitet und neue Stile entworfen werden können:
</p>
<p class="center">
<img src="img/stilbearbeiten.png" alt="Stil bearbeiten" />
</p>
<p class="clear">
<img src="img/elementpicker.png" alt="Elemente" class="float-right" />
Jeder Stil setzt sich aus sog. <i>Elementen</i> zusammen. Es gibt
<i>Steuerelemente</i>, die zum Beispiel für die Auswahl eines Tages
(erster Tag/letzter Tag) zuständig sind, und es gibt
<i>Ausgabeelemente</i>, die die eigentliche Formatierung und Ausgabe
der Laborwerte übernehmen.
</p>
<p>
Steuerelemente:
</p>
<ul>
<li>Ersten Tag auswählen</li>
<li>Letzten Tag auswählen</li>
<li>Jeden Tag nacheinander auswählen</li>
<li>Zwei Spalten einfügen/zur nächsten Spalte wechseln</li>
</ul>
<p>
Ausgabeelemente:
</p>
<ul>
<li>Laborparameter</li>
<li>Beliebiger Text</li>
</ul>
<p>
"Beliebiger Text" kann, wie der Name schon sagt, beliebigen Text
enthalten, der nicht weiter bearbeitet wird. Auf diese Weise kann
man z.B. Platzhalter für Urinsedimente ausgeben lassen, die dann
noch händisch vervollständigt werden.
</p>
<p>
"Laborparameter" enthalten eine durch Kommata getrennte Auflistung
von Parametern, die ausgegeben werden sollen. Jedes Element
"Laborparameter" kann optional einen Titel enthalten:
</p>
<p>
Beispiel:
</p>
<blockquote>
<p>
<img src="img/elementbearbeiten.png" alt="Element bearbeiten" />
</p>
<p>
Klinische Chemie: Na, K, Cl, (usw.)
</p>
</blockquote>
<p>
In diesem Fall ist "Klinische Chemie:" der optionale Titel.
</p>
<p>
Die Bezeichnungen der einzelnen Parameter sind fest einprogrammiert.
Teils decken sie sich mit den Bezeichnungen, wie sie in der
Zentralen Arztbriefablage erscheinen; teils sind sie aber auch
Surrogate (z.B. "eGFR (CKD-EPI)" anstatt "glomerul. Filtrationsr.
CKD-EP").
</p>
<p>
Die Platzhalter "SU-*", "U-*" und "*" geben die noch nicht
verwendeten Werte für Sammelurin, Spontanurin und alles weitere aus.
"*" sollte daher als letztes verwendet werden.
<p>
Die Liste der möglichen Parameternamen ist momentan fest
einprogrammiert und kann auch noch nicht angezeigt werden. Man kann
beim Entwickeln eines Stils aber probehalber den Platzhalter "*"
verwenden und sieht dann, welche Parameternamen noch verwendet
werden könnten.
</p>
<h2>Updates</h2>
<p>
Das Addin sucht täglich nach Updates und lädt und installiert diese
bei Bedarf im Hintergrund.
</p>
<h2>Weitere Informationen</h2>
<p><a href="doc/md_history.html">Versionsgeschichte</a></p>
<p><a href="doc/md_HISTORY.html">Versionsgeschichte</a></p>
<p><a href="doc/index.html">Quellcode-Dokumentation</a></p>
<hr />
<p>&copy; 2015 Daniel Kraus</p>
<p>&copy; 2015 <a href="http://www.bovender.de">Daniel Kraus</a></p>
</body>
<!-- vim: set tw=72 ai sts=2 ts=2 sw=2 : -->
</html>

View File

@ -1,4 +1,4 @@
2.0.0-alpha.4
http://zaa.nephrowiki.de/downloads/zaaReloaded-2.0.0-alpha.4.exe
3f511ac90dbfbb14318948a3be1d1f9d2eb059d1 publish/release/zaaReloaded-2.0.0-alpha.4.exe
2.0.0-beta.3
http://zaa.nephrowiki.de/downloads/zaaReloaded-2.0.0-beta.3.exe
7453cdb91221fe4d9dabd8259be2dc7703274706 publish/release/zaaReloaded-2.0.0-beta.3.exe

View File

@ -1,4 +1,5 @@
/* ControlElementBase.cs
using System;
/* ControlElementBase.cs
* part of zaaReloaded2
*
* Copyright 2015 Daniel Kraus
@ -16,6 +17,8 @@
* limitations under the License.
*/
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
namespace zaaReloaded2.Controller.Elements
{
@ -23,23 +26,90 @@ namespace zaaReloaded2.Controller.Elements
/// Base class for control elements that control e.g. the working
/// set of time points in a Formatter object.
/// </summary>
public abstract class ControlElementBase : ElementBase
[Serializable]
public abstract class ControlElementBase : ElementBase, ISerializable
{
#region Properties
/// <summary>
/// Gets a list of child elements, all of which must be derived
/// from FormatElementBase.
/// </summary>
public IList<FormatElementBase> FormatElements { get; private set; }
public IList<FormatElementBase> Children { get; internal set; }
public ControlElementBase() { }
/// <summary>
/// Informs whether this control element can have child elements.
/// </summary>
public virtual bool CanHaveChildren { get { return true; } }
public ControlElementBase(IList<FormatElementBase> formatElements)
{
FormatElements = formatElements;
}
#endregion
public ControlElementBase(FormatElementBase formatElement)
: this(new List<FormatElementBase>() { formatElement })
#region Constructors
public ControlElementBase()
: this(new List<FormatElementBase>())
{ }
public ControlElementBase(IList<FormatElementBase> children)
{
Children = children;
}
public ControlElementBase(FormatElementBase children)
: this(new List<FormatElementBase>() { children })
{ }
#endregion
#region Serialization
/// <summary>
/// Deserialization constructor.
/// </summary>
protected ControlElementBase(SerializationInfo info, StreamingContext context)
{
int version = info.GetInt32("Version");
int childrenCount = info.GetInt32("ChildrenCount");
Children = new List<FormatElementBase>();
for (int i = 0; i < childrenCount; i++)
{
Type typeOfChild = info.GetValue(SerializedChildName(i, "Type"), typeof(Type)) as Type;
Children.Add(info.GetValue(SerializedChildName(i, "Object"), typeOfChild) as FormatElementBase);
}
}
public void GetObjectData(SerializationInfo info, StreamingContext context)
{
info.AddValue("Version", Properties.Settings.Default.SerializationVersion);
info.AddValue("ChildrenCount", Children.Count);
int i = 0;
foreach (FormatElementBase child in Children)
{
info.AddValue(SerializedChildName(i, "Type"), child.GetType());
info.AddValue(SerializedChildName(i, "Object"), child);
i++;
}
}
private string SerializedChildName(int index, string info)
{
return String.Format("Child{0}{1}", index, info);
}
#endregion
#region Protected methods
/// <summary>
/// Creates a clone of the Children list (for use in cloning
/// derived classes).
/// </summary>
/// <returns>Clone of the Children list.</returns>
protected IList<FormatElementBase> CloneChildren()
{
return Children.Select(child => child.Clone() as FormatElementBase).ToList();
}
#endregion
}
}

View File

@ -18,6 +18,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
namespace zaaReloaded2.Controller.Elements
@ -25,11 +26,22 @@ namespace zaaReloaded2.Controller.Elements
/// <summary>
/// Controller element that writes arbitrary text to the document.
/// </summary>
class CustomText : FormatElementBase
[Serializable]
public class CustomText : FormatElementBase, ISerializable
{
public override string Label
{
get { return String.Format("\"{0}\"", Content); }
get
{
if (String.IsNullOrEmpty(Content))
{
return "Beliebiger Text";
}
else
{
return String.Format("\"{0}\"", Content);
}
}
}
public override void Run(Formatter.Formatter formatter)
@ -43,5 +55,20 @@ namespace zaaReloaded2.Controller.Elements
clone.Content = Content;
return clone;
}
#region Constructors
public CustomText () { }
/// <summary>
/// Deserialization constructor.
/// </summary>
protected CustomText(SerializationInfo info, StreamingContext context)
{
int version = info.GetInt32("Version");
Content = info.GetString("Content");
}
#endregion
}
}

View File

@ -21,13 +21,13 @@ using System.Linq;
using System.Text;
using Microsoft.Office.Interop.Word;
using zaaReloaded2.LabModel;
using System.Runtime.Serialization;
namespace zaaReloaded2.Controller.Elements
{
/// <summary>
/// Base class for formatting elements.
/// </summary>
[Serializable]
public abstract class ElementBase : ICloneable
{
/// <summary>

View File

@ -16,12 +16,14 @@
* limitations under the License.
*/
using System;
using System.Runtime.Serialization;
namespace zaaReloaded2.Controller.Elements
{
/// <summary>
/// Base class for elements that perform actual formatting.
/// </summary>
public abstract class FormatElementBase : ElementBase
public abstract class FormatElementBase : ElementBase, ISerializable
{
/// <summary>
/// Gets or sets the content of this format element.
@ -32,7 +34,6 @@ namespace zaaReloaded2.Controller.Elements
set
{
_content = value;
}
}
@ -42,5 +43,15 @@ namespace zaaReloaded2.Controller.Elements
protected virtual void OnContentChanged() {}
private string _content;
#region Serialization
public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
{
info.AddValue("Version", Properties.Settings.Default.SerializationVersion);
info.AddValue("Content", Content);
}
#endregion
}
}

View File

@ -23,6 +23,7 @@ using System.Diagnostics;
using Microsoft.Office.Interop.Word;
using zaaReloaded2.LabModel;
using zaaReloaded2.Formatter;
using System.Runtime.Serialization;
namespace zaaReloaded2.Controller.Elements
{
@ -31,13 +32,23 @@ namespace zaaReloaded2.Controller.Elements
/// to a Word document.
/// </summary>
[Serializable]
class Items : CustomText
public class Items : CustomText
{
#region ElementBase implementation
public override string Label
{
get { return Content; }
get
{
if (String.IsNullOrEmpty(Content))
{
return "Laborparameter";
}
else
{
return Content;
}
}
}
public override void Run(zaaReloaded2.Formatter.Formatter formatter)
@ -74,6 +85,13 @@ namespace zaaReloaded2.Controller.Elements
}
}
protected override ElementBase CreateInstance()
{
Items clone = new Items();
clone.Content = Content;
return clone;
}
#endregion
#region Constructors
@ -86,6 +104,13 @@ namespace zaaReloaded2.Controller.Elements
Content = content;
}
/// <summary>
/// Deserialization constructor.
/// </summary>
protected Items(SerializationInfo info, StreamingContext context)
: base(info, context)
{ }
#endregion
#region Private methods
@ -132,7 +157,6 @@ namespace zaaReloaded2.Controller.Elements
{
items.AddRange(CollectByName(formatter, itemName));
}
}
return items;
}
@ -148,9 +172,12 @@ namespace zaaReloaded2.Controller.Elements
foreach (TimePointFormatter tpf in formatter.WorkingTimePoints.Values)
{
List<ItemFormatter> newItems = tpf.ItemFormatters.Values
.Where(i => !i.HasBeenUsed && i.LabItem.QualifiedName.StartsWith(material))
.Where(i => !i.HasBeenUsed && !i.IsBlacklisted && i.LabItem.QualifiedName.StartsWith(material))
.ToList();
newItems.ForEach(i => i.HasBeenUsed = true);
// Include the material prefix only if this item was collected by a
// general wildcard ("*" rather than "SU-*" etc.).
newItems.ForEach(i => i.IncludeMaterial = String.IsNullOrEmpty(material));
items.AddRange(newItems);
}
return items;
@ -172,6 +199,7 @@ namespace zaaReloaded2.Controller.Elements
// item with itemName.
ItemFormatter i = tpf.ItemFormatters[name];
i.HasBeenUsed = true;
i.IncludeMaterial = false;
items.Add(i);
}
return items;

View File

@ -0,0 +1,69 @@
/* NextColumn.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.Runtime.Serialization;
using System.Text;
namespace zaaReloaded2.Controller.Elements
{
/// <summary>
/// Format element that causes a Formatter object to move the
/// insertion point to the next colum in a layout table.
/// </summary>
[Serializable]
public class NextColumn : ControlElementBase, ISerializable
{
public override string Label
{
get { return "Nächste Spalte"; }
}
public override bool CanHaveChildren
{
get
{
return false;
}
}
public override void Run(Formatter.Formatter formatter)
{
formatter.NextColumn();
}
protected override ElementBase CreateInstance()
{
return new NextColumn();
}
#region Constructors
public NextColumn() : base() { }
/// <summary>
/// Deserialization constructor.
/// </summary>
protected NextColumn(SerializationInfo info, StreamingContext context)
: base(info, context)
{ }
#endregion
}
}

View File

@ -18,15 +18,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
namespace zaaReloaded2.Controller.Elements
{
class SelectEachDay : ControlElementBase
[Serializable]
public class SelectEachDay : ControlElementBase
{
public override string Label
{
get { return "Jeden Tag auswählen"; }
get { return "Jeder Tag"; }
}
public override void Run(Formatter.Formatter formatter)
@ -34,6 +36,13 @@ namespace zaaReloaded2.Controller.Elements
formatter.ProcessEachDay(this);
}
protected override ElementBase CreateInstance()
{
return new SelectEachDay(CloneChildren());
}
#region Constructors
public SelectEachDay() : base() { }
public SelectEachDay(FormatElementBase formatElement)
@ -44,9 +53,13 @@ namespace zaaReloaded2.Controller.Elements
: base(formatElements)
{ }
protected override ElementBase CreateInstance()
{
return new SelectEachDay();
}
/// <summary>
/// Deserialization constructor.
/// </summary>
protected SelectEachDay(SerializationInfo info, StreamingContext context)
: base(info, context)
{ }
#endregion
}
}

View File

@ -18,6 +18,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
namespace zaaReloaded2.Controller.Elements
@ -26,11 +27,12 @@ namespace zaaReloaded2.Controller.Elements
/// Selects the time points of the first day in a given Formatter
/// object.
/// </summary>
class SelectFirstDay : ControlElementBase
[Serializable]
public class SelectFirstDay : ControlElementBase, ISerializable
{
public override string Label
{
get { return "Ersten Tag auswählen"; }
get { return "Erster Tag"; }
}
public override void Run(Formatter.Formatter formatter)
@ -38,6 +40,13 @@ namespace zaaReloaded2.Controller.Elements
formatter.ProcessFirstDay(this);
}
protected override ElementBase CreateInstance()
{
return new SelectFirstDay(CloneChildren());
}
#region Constructors
public SelectFirstDay() : base() { }
public SelectFirstDay(FormatElementBase formatElement)
@ -48,9 +57,13 @@ namespace zaaReloaded2.Controller.Elements
: base(formatElements)
{ }
protected override ElementBase CreateInstance()
{
return new SelectFirstDay();
}
/// <summary>
/// Deserialization constructor.
/// </summary>
protected SelectFirstDay(SerializationInfo info, StreamingContext context)
: base(info, context)
{ }
#endregion
}
}

View File

@ -19,6 +19,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
namespace zaaReloaded2.Controller.Elements
@ -27,11 +28,12 @@ namespace zaaReloaded2.Controller.Elements
/// Selects the time points of the last day in a given Formatter
/// object.
/// </summary>
class SelectLastDay : ControlElementBase
[Serializable]
public class SelectLastDay : ControlElementBase, ISerializable
{
public override string Label
{
get { return "Letzten Tag auswählen"; }
get { return "Letzter Tag"; }
}
public override void Run(Formatter.Formatter formatter)
@ -39,6 +41,13 @@ namespace zaaReloaded2.Controller.Elements
formatter.ProcessLastDay(this);
}
protected override ElementBase CreateInstance()
{
return new SelectLastDay(CloneChildren());
}
#region Constructors
public SelectLastDay() : base() { }
public SelectLastDay(FormatElementBase formatElement)
@ -49,9 +58,13 @@ namespace zaaReloaded2.Controller.Elements
: base(formatElements)
{ }
protected override ElementBase CreateInstance()
{
return new SelectLastDay();
}
/// <summary>
/// Deserialization constructor.
/// </summary>
protected SelectLastDay(SerializationInfo info, StreamingContext context)
: base(info, context)
{ }
#endregion
}
}

View File

@ -0,0 +1,69 @@
/* TwoColumns.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.Runtime.Serialization;
using System.Text;
namespace zaaReloaded2.Controller.Elements
{
/// <summary>
/// Format element that causes a Formatter object to insert a table with
/// two columns and one row into the documents.
/// </summary>
[Serializable]
public class TwoColumns : ControlElementBase, ISerializable
{
public override string Label
{
get { return "Zwei Spalten einfügen"; }
}
public override bool CanHaveChildren
{
get
{
return false;
}
}
public override void Run(Formatter.Formatter formatter)
{
formatter.InsertTwoColumns();
}
protected override ElementBase CreateInstance()
{
return new TwoColumns();
}
#region Constructors
public TwoColumns() : base() { }
/// <summary>
/// Deserialization constructor.
/// </summary>
protected TwoColumns(SerializationInfo info, StreamingContext context)
: base(info, context)
{ }
#endregion
}
}

View File

@ -21,6 +21,10 @@ using System.Linq;
using System.Text;
using zaaReloaded2.Formatter;
using zaaReloaded2.Controller.Elements;
using System.IO;
using System.Text.RegularExpressions;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters.Soap;
namespace zaaReloaded2.Controller
{
@ -28,8 +32,43 @@ namespace zaaReloaded2.Controller
/// Holds settings related to controlling laboratory output.
/// </summary>
[Serializable]
public class Settings : ICloneable
public class Settings : ICloneable, ISerializable
{
#region Persistence
/// <summary>
/// Deserializes a Settings object from SOAP XML that is read from a file.
/// </summary>
/// <param name="fileName">File to read.</param>
/// <returns>Deserialized Settings object with new unique ID.</returns>
/// <exception cref="InvalidDataException">if the file does not contain
/// SOAP XML that can be deserialized to a Settings object.</exception>
public static Settings LoadFromFile(string fileName)
{
StreamReader reader = new StreamReader(fileName);
SoapFormatter formatter = new SoapFormatter();
Settings settings = formatter.Deserialize(reader.BaseStream) as Settings;
if (settings == null)
{
throw new InvalidDataException("Datei enthält keine Stil-Daten oder ist beschädigt.");
}
settings.Uid = Guid.NewGuid();
return settings;
}
/// <summary>
/// Serializes a Settings object to SOAP XML that is written to a file.
/// </summary>
/// <param name="fileName">File to write to.</param>
public void SaveToFile(string fileName)
{
StreamWriter writer = new StreamWriter(fileName);
SoapFormatter formatter = new SoapFormatter();
formatter.Serialize(writer.BaseStream, this);
}
#endregion
#region Properties
/// <summary>
@ -51,23 +90,19 @@ namespace zaaReloaded2.Controller
/// Gets the unique ID of this Settings object. The unique
/// ID is not included in deep-copying (cloning).
/// </summary>
public Guid Uid { get; private set; }
public Guid Uid { get; internal set; }
#endregion
#region Constructors
public Settings()
{
Elements = new List<ElementBase>();
Uid = Guid.NewGuid();
}
: this(string.Empty, null)
{ }
public Settings(string name)
: this()
{
Name = name;
}
: this(name, null)
{ }
/// <summary>
/// Creates a new Settings object with an initial
@ -76,9 +111,8 @@ namespace zaaReloaded2.Controller
/// <param name="initialElements">Set of ElementBase
/// object (or derived ones).</param>
public Settings(IList<ElementBase> initialElements)
{
Elements = initialElements;
}
: this(String.Empty, initialElements)
{ }
/// <summary>
/// Creates a new Settings object with an initial
@ -88,9 +122,48 @@ namespace zaaReloaded2.Controller
/// object (or derived ones).</param>
/// <param name="name">Name of these settings.</param>
public Settings(string name, IList<ElementBase> initialElements)
: this(initialElements)
{
Uid = Guid.NewGuid();
Name = name;
Elements = initialElements;
ReferenceStyle = Properties.Settings.Default.ReferenceStyle;
if (Elements == null)
{
Elements = new List<ElementBase>();
}
}
/// <summary>
/// Creates a new Settings object with an initial
/// set of elements, a name, and a unique ID.
/// </summary>
/// <param name="initialElements">Set of ElementBase
/// object (or derived ones).</param>
/// <param name="name">Name of these settings.</param>
/// <param name="Uid">Unique ID for this Settings object.</param>
public Settings(string name, IList<ElementBase> initialElements, Guid uid)
: this(name, initialElements)
{
Uid = uid;
}
/// <summary>
/// Deserialization constructor.
/// </summary>
protected Settings(SerializationInfo info, StreamingContext context)
{
int version = info.GetInt32("Version");
Uid = (Guid)info.GetValue("Uid", typeof(Guid));
Name = info.GetString("Name");
ReferenceStyle = (ReferenceStyle)info.GetValue("ReferenceStyle", typeof(ReferenceStyle));
int elementsCount = info.GetInt32("ElementsCount");
Elements = new List<ElementBase>();
for (int i = 0; i < elementsCount; i++)
{
Type type = info.GetValue(SerializationElementName(i, "Type"), typeof(Type)) as Type;
ElementBase element = info.GetValue(SerializationElementName(i, "Object"), type) as ElementBase;
Elements.Add(element);
}
}
#endregion
@ -121,5 +194,37 @@ namespace zaaReloaded2.Controller
}
#endregion
#region Implementation of ISerializable
public void GetObjectData(SerializationInfo info, StreamingContext context)
{
info.AddValue("Version", Properties.Settings.Default.SerializationVersion);
info.AddValue("Uid", Uid);
info.AddValue("Name", Name);
info.AddValue("ReferenceStyle", ReferenceStyle);
info.AddValue("ElementsCount", Elements.Count);
int i = 0;
foreach (ElementBase e in Elements)
{
info.AddValue(SerializationElementName(i, "Type"), e.GetType());
info.AddValue(SerializationElementName(i, "Object"), e);
i++;
}
}
string SerializationElementName(int index, string info)
{
return String.Format("Element{0}{1}", index, info);
}
#endregion
#region Fields
// Defines header lines for the persistence file: "[My name]" and so on.
static readonly Regex _persistenceHeaderRegex = new Regex(@"^\[(?<name>.+?)]$");
#endregion
}
}

View File

@ -18,10 +18,15 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Configuration;
using System.IO;
using System.Linq;
using System.Text;
using System.Xml.Serialization;
using System.Reflection;
using zaaReloaded2.Controller.Elements;
using System.Runtime.Serialization.Formatters.Soap;
using System.Web;
using System.Runtime.Serialization;
namespace zaaReloaded2.Controller
{
@ -35,30 +40,69 @@ namespace zaaReloaded2.Controller
/// different from zaaReloaded's Settings.
/// </remarks>
[Serializable]
public class SettingsRepository : ApplicationSettingsBase
public class SettingsRepository : ISerializable
{
#region Persistence
#region Properties persistence
/// <summary>
/// Loads the SettingsRepository instance that was persisted in
/// the assembly properties.
/// </summary>
/// <returns>SettingsRepository that was last stored in the
/// assembly properties, or a newly created SettingsRepository
/// if no previously stored exists.</returns>
/// <remarks>
/// The SettingsRepository is serialized using a SoapFormatter, which
/// creates SOAP XML. Since the assembly properties are stored as
/// XML as well, the serialized SettingsRepository is converted to
/// a base-64 string, which does not mess with the properties XML.
/// </remarks>
public static SettingsRepository Load()
{
return
zaaReloaded2.Properties.Settings.Default.SettingsRepository ??
new SettingsRepository();
string s = Properties.Settings.Default.SettingsRepository;
if (String.IsNullOrEmpty(s))
{
return new SettingsRepository();
}
else
{
MemoryStream stream = new MemoryStream();
string encoded = Properties.Settings.Default.SettingsRepository;
byte[] bytes = Convert.FromBase64String(encoded);
stream.Write(bytes, 0, bytes.Length);
stream.Position = 0;
SoapFormatter serializer = new SoapFormatter();
SettingsRepository repo = serializer.Deserialize(stream) as SettingsRepository;
repo.LoadDefaults();
return repo;
}
}
/// <summary>
/// Stores the SettingsRepository in the assembly properties.
/// </summary>
/// <remarks>
/// The SettingsRepository is serialized using a SoapFormatter, which
/// creates SOAP XML. Since the assembly properties are stored as
/// XML as well, the serialized SettingsRepository is converted to
/// a base-64 string, which does not mess with the properties XML.
/// </remarks>
public void Store()
{
zaaReloaded2.Properties.Settings.Default.SettingsRepository = this;
zaaReloaded2.Properties.Settings.Default.Save();
MemoryStream stream = new MemoryStream();
SoapFormatter serializer = new SoapFormatter();
serializer.Serialize(stream, this);
stream.Position = 0;
string encoded = Convert.ToBase64String(stream.ToArray());
Properties.Settings.Default.SettingsRepository = encoded;
Properties.Settings.Default.Save();
}
#endregion
#region Properties
[UserScopedSetting()]
[SettingsSerializeAs(SettingsSerializeAs.Xml)]
public IList<Settings> SettingsList { get; private set; }
public IList<Settings> SettingsList { get; protected set; }
#endregion
@ -71,7 +115,42 @@ namespace zaaReloaded2.Controller
public SettingsRepository()
{
SettingsList = new List<Settings>();
CreateDefault();
Reset();
}
#endregion
#region Serialization
protected SettingsRepository(SerializationInfo info, StreamingContext context)
{
int version = info.GetInt32("Version");
int settingsCount = info.GetInt32("SettingsCount");
SettingsList = new List<Settings>();
for (int i = 0; i < settingsCount; i++)
{
Type type = info.GetValue(SerializationSettingsName(i, "Type"), typeof(Type)) as Type;
Settings s = info.GetValue(SerializationSettingsName(i, "Object"), typeof(Settings)) as Settings;
SettingsList.Add(s);
}
}
public void GetObjectData(SerializationInfo info, StreamingContext context)
{
info.AddValue("Version", Properties.Settings.Default.SerializationVersion);
info.AddValue("SettingsCount", SettingsList.Count);
int i = 0;
foreach (Settings s in SettingsList)
{
info.AddValue(SerializationSettingsName(i, "Type"), s.GetType());
info.AddValue(SerializationSettingsName(i, "Object"), s);
i++;
}
}
string SerializationSettingsName(int index, string info)
{
return String.Format("Settings{0}{1}", index, info);
}
#endregion
@ -89,6 +168,13 @@ namespace zaaReloaded2.Controller
{
return SettingsList.FirstOrDefault(s => s.Uid == uid);
}
public static bool IsDefaultSettings(Settings settings)
{
return (settings.Name == Properties.Settings.Default.SettingsNameClinic + BUILTIN_LABEL ||
settings.Name == Properties.Settings.Default.SettingsNameWard + BUILTIN_LABEL);
}
#endregion
#region Private methods
@ -97,53 +183,66 @@ namespace zaaReloaded2.Controller
/// Resets the Settings contained in this SettingsRepository
/// to the default set of settings.
/// </summary>
private void CreateDefault()
private void Reset()
{
SettingsList.Clear();
// Shortcut to assembly properties
zaaReloaded2.Properties.Settings def = zaaReloaded2.Properties.Settings.Default;
// TODO: May want to create deep copies of this list below
List<FormatElementBase> defaultItems = new List<FormatElementBase>()
{
new Items(def.DefaultItemsClinicalChem),
new Items(def.DefaultItemsInflammation),
new Items(def.DefaultItemsCardio),
new Items(def.DefaultItemsKidney),
new Items(def.DefaultItemsLiver),
new Items(def.DefaultItemsLipids),
new Items(def.DefaultItemsHematology),
new Items(def.DefaultItemsCoagulation),
new Items(def.DefaultItemsDrugs),
new Items(def.DefaultItemsCollectedUrine),
new Items(def.DefaultItemsSpotUrine),
new Items(def.DefaultItemsOther),
};
// Configure the settings for the ward
SettingsList.Add(
new Settings(
def.SettingsNameWard,
new List<ElementBase>()
{
new SelectFirstDay(defaultItems),
new SelectLastDay(defaultItems)
LoadDefaults();
}
)
);
// Configure the settings for the outpatient clinic
SettingsList.Add(
new Settings(
def.SettingsNameClinic,
new List<ElementBase>()
/// <summary>
/// Loads default, built-in settings, replacing existing default
/// settings that might have been persisted.
/// </summary>
private void LoadDefaults()
{
new SelectEachDay(defaultItems),
Assembly myAssembly = this.GetType().Assembly;
SoapFormatter deserializer = new SoapFormatter();
Stream stream = myAssembly.GetManifestResourceStream("zaaReloaded2.Defaults.ward.zaaReloaded");
Settings settings = deserializer.Deserialize(stream) as Settings;
settings.Name = Properties.Settings.Default.SettingsNameWard + BUILTIN_LABEL;
settings.Uid = Guid.Parse(DEFAULT_SETTINGS_1_UID);
ReplaceOrAdd(settings);
stream = myAssembly.GetManifestResourceStream("zaaReloaded2.Defaults.clinic.zaaReloaded");
settings = deserializer.Deserialize(stream) as Settings;
settings.Name = Properties.Settings.Default.SettingsNameClinic + BUILTIN_LABEL;
settings.Uid = Guid.Parse(DEFAULT_SETTINGS_2_UID);
ReplaceOrAdd(settings);
}
)
);
private void ReplaceOrAdd(Settings settings)
{
Settings existing = SettingsList.FirstOrDefault(s => s.Uid == settings.Uid);
if (existing == null)
{
SettingsList.Add(settings);
}
else
{
int index = SettingsList.IndexOf(existing);
SettingsList.RemoveAt(index);
SettingsList.Insert(index, settings);
}
}
#endregion
#region Constants
/// <summary>
/// Label that is appended to the default Settings' names.
/// </summary>
public const string BUILTIN_LABEL = " (eingebaut)";
/// <summary>
/// Constant GUID for the first default Settings.
/// </summary>
const string DEFAULT_SETTINGS_1_UID = "EA79DE6C-E999-44F1-9122-929A8AA404CB";
/// <summary>
/// Constant GUID for the second default Settings.
/// </summary>
const string DEFAULT_SETTINGS_2_UID = "783C63B5-A964-4368-B2D0-D4595DCCB952";
#endregion
}

View File

@ -0,0 +1,158 @@
<SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:clr="http://schemas.microsoft.com/soap/encoding/clr/1.0" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<a1:Settings id="ref-1" xmlns:a1="http://schemas.microsoft.com/clr/nsassem/zaaReloaded2.Controller/zaaReloaded2%2C%20Version%3D1.0.0.0%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3D6ec8d075a1ab1383">
<Version>1</Version>
<Uid xsi:type="a2:Guid" xmlns:a2="http://schemas.microsoft.com/clr/ns/System">
<_a>82184435</_a>
<_b>11851</_b>
<_c>19443</_c>
<_d>139</_d>
<_e>251</_e>
<_f>157</_f>
<_g>33</_g>
<_h>11</_h>
<_i>13</_i>
<_j>118</_j>
<_k>225</_k>
</Uid>
<Name id="ref-3">Kopie von Standard für NepA</Name>
<ReferenceStyle xsi:type="a3:ReferenceStyle" xmlns:a3="http://schemas.microsoft.com/clr/nsassem/zaaReloaded2.Formatter/zaaReloaded2%2C%20Version%3D1.0.0.0%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3D6ec8d075a1ab1383">IfSpecialOrAbnormal</ReferenceStyle>
<ElementsCount>1</ElementsCount>
<Element0Type href="#ref-4"/>
<Element0Object href="#ref-5"/>
</a1:Settings>
<a2:UnitySerializationHolder id="ref-4" xmlns:a2="http://schemas.microsoft.com/clr/ns/System">
<Data id="ref-6">zaaReloaded2.Controller.Elements.SelectEachDay</Data>
<UnityType>4</UnityType>
<AssemblyName id="ref-7">zaaReloaded2, Version=1.0.0.0, Culture=neutral, PublicKeyToken=6ec8d075a1ab1383</AssemblyName>
</a2:UnitySerializationHolder>
<a4:SelectEachDay id="ref-5" xmlns:a4="http://schemas.microsoft.com/clr/nsassem/zaaReloaded2.Controller.Elements/zaaReloaded2%2C%20Version%3D1.0.0.0%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3D6ec8d075a1ab1383">
<Version>1</Version>
<ChildrenCount>19</ChildrenCount>
<Child0Type href="#ref-8"/>
<Child0Object href="#ref-9"/>
<Child1Type href="#ref-8"/>
<Child1Object href="#ref-10"/>
<Child2Type href="#ref-8"/>
<Child2Object href="#ref-11"/>
<Child3Type href="#ref-8"/>
<Child3Object href="#ref-12"/>
<Child4Type href="#ref-8"/>
<Child4Object href="#ref-13"/>
<Child5Type href="#ref-8"/>
<Child5Object href="#ref-14"/>
<Child6Type href="#ref-8"/>
<Child6Object href="#ref-15"/>
<Child7Type href="#ref-8"/>
<Child7Object href="#ref-16"/>
<Child8Type href="#ref-8"/>
<Child8Object href="#ref-17"/>
<Child9Type href="#ref-8"/>
<Child9Object href="#ref-18"/>
<Child10Type href="#ref-8"/>
<Child10Object href="#ref-19"/>
<Child11Type href="#ref-8"/>
<Child11Object href="#ref-20"/>
<Child12Type href="#ref-8"/>
<Child12Object href="#ref-21"/>
<Child13Type href="#ref-8"/>
<Child13Object href="#ref-22"/>
<Child14Type href="#ref-8"/>
<Child14Object href="#ref-23"/>
<Child15Type href="#ref-8"/>
<Child15Object href="#ref-24"/>
<Child16Type href="#ref-25"/>
<Child16Object href="#ref-26"/>
<Child17Type href="#ref-25"/>
<Child17Object href="#ref-27"/>
<Child18Type href="#ref-25"/>
<Child18Object href="#ref-28"/>
</a4:SelectEachDay>
<a2:UnitySerializationHolder id="ref-8" xmlns:a2="http://schemas.microsoft.com/clr/ns/System">
<Data id="ref-29">zaaReloaded2.Controller.Elements.Items</Data>
<UnityType>4</UnityType>
<AssemblyName href="#ref-7"/>
</a2:UnitySerializationHolder>
<a4:Items id="ref-9" xmlns:a4="http://schemas.microsoft.com/clr/nsassem/zaaReloaded2.Controller.Elements/zaaReloaded2%2C%20Version%3D1.0.0.0%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3D6ec8d075a1ab1383">
<Version>1</Version>
<Content id="ref-30">Klinische Chemie: Na, K, Cl, Mg, Ca, P, CaxP, Alb, Prot, Haptoglobin, LDH, Glukose, Harnsäure</Content>
</a4:Items>
<a4:Items id="ref-10" xmlns:a4="http://schemas.microsoft.com/clr/nsassem/zaaReloaded2.Controller.Elements/zaaReloaded2%2C%20Version%3D1.0.0.0%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3D6ec8d075a1ab1383">
<Version>1</Version>
<Content id="ref-31">Entzündung/Immunsystem: CRP, Pct, C3c, C4, Anti-DNAse B, ASL</Content>
</a4:Items>
<a4:Items id="ref-11" xmlns:a4="http://schemas.microsoft.com/clr/nsassem/zaaReloaded2.Controller.Elements/zaaReloaded2%2C%20Version%3D1.0.0.0%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3D6ec8d075a1ab1383">
<Version>1</Version>
<Content id="ref-32">Kardiale Marker: CK, CKMB, Trop, NTproBNP</Content>
</a4:Items>
<a4:Items id="ref-12" xmlns:a4="http://schemas.microsoft.com/clr/nsassem/zaaReloaded2.Controller.Elements/zaaReloaded2%2C%20Version%3D1.0.0.0%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3D6ec8d075a1ab1383">
<Version>1</Version>
<Content id="ref-33">Niere: Krea, Hst, eGFR (CKD-EPI)</Content>
</a4:Items>
<a4:Items id="ref-13" xmlns:a4="http://schemas.microsoft.com/clr/nsassem/zaaReloaded2.Controller.Elements/zaaReloaded2%2C%20Version%3D1.0.0.0%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3D6ec8d075a1ab1383">
<Version>1</Version>
<Content id="ref-34">Sammelurin: SU-Proteinurie, SU-Alb, SU-CrCl, SU-HstCl, SU-GFR, SU-Natrium, SU-Zeit, SU-Volumen</Content>
</a4:Items>
<a4:Items id="ref-14" xmlns:a4="http://schemas.microsoft.com/clr/nsassem/zaaReloaded2.Controller.Elements/zaaReloaded2%2C%20Version%3D1.0.0.0%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3D6ec8d075a1ab1383">
<Version>1</Version>
<Content id="ref-35">Spot-Urin: TPCR, ACR, U-Ery, U-Leu, U-Bakt</Content>
</a4:Items>
<a4:Items id="ref-15" xmlns:a4="http://schemas.microsoft.com/clr/nsassem/zaaReloaded2.Controller.Elements/zaaReloaded2%2C%20Version%3D1.0.0.0%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3D6ec8d075a1ab1383">
<Version>1</Version>
<Content id="ref-36">Leber: GOT, GGT, GPT, AP, Bilirubin, CHE</Content>
</a4:Items>
<a4:Items id="ref-16" xmlns:a4="http://schemas.microsoft.com/clr/nsassem/zaaReloaded2.Controller.Elements/zaaReloaded2%2C%20Version%3D1.0.0.0%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3D6ec8d075a1ab1383">
<Version>1</Version>
<Content id="ref-37">Blutfette: TG, Chol, LDL, HDL, Lp(a)</Content>
</a4:Items>
<a4:Items id="ref-17" xmlns:a4="http://schemas.microsoft.com/clr/nsassem/zaaReloaded2.Controller.Elements/zaaReloaded2%2C%20Version%3D1.0.0.0%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3D6ec8d075a1ab1383">
<Version>1</Version>
<Content id="ref-38">Hämatologie: Hb, Hkt, Reti, Leu, Thr, MCV, HbA1c, Retikulozyten, Fragmentozyten</Content>
</a4:Items>
<a4:Items id="ref-18" xmlns:a4="http://schemas.microsoft.com/clr/nsassem/zaaReloaded2.Controller.Elements/zaaReloaded2%2C%20Version%3D1.0.0.0%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3D6ec8d075a1ab1383">
<Version>1</Version>
<Content id="ref-39">Gerinnung: Quick, INR, PTT, Fibrinogen, ATIII, Anti-Xa</Content>
</a4:Items>
<a4:Items id="ref-19" xmlns:a4="http://schemas.microsoft.com/clr/nsassem/zaaReloaded2.Controller.Elements/zaaReloaded2%2C%20Version%3D1.0.0.0%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3D6ec8d075a1ab1383">
<Version>1</Version>
<Content id="ref-40">Diff.-BB: Neu, Lym, Mon, Baso, Eos</Content>
</a4:Items>
<a4:Items id="ref-20" xmlns:a4="http://schemas.microsoft.com/clr/nsassem/zaaReloaded2.Controller.Elements/zaaReloaded2%2C%20Version%3D1.0.0.0%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3D6ec8d075a1ab1383">
<Version>1</Version>
<Content id="ref-41">Hormone: iPTH, TSH</Content>
</a4:Items>
<a4:Items id="ref-21" xmlns:a4="http://schemas.microsoft.com/clr/nsassem/zaaReloaded2.Controller.Elements/zaaReloaded2%2C%20Version%3D1.0.0.0%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3D6ec8d075a1ab1383">
<Version>1</Version>
<Content id="ref-42">Eisenhaushalt: Eisen, Ferritin, Transferrin, Tf.-Sätt.</Content>
</a4:Items>
<a4:Items id="ref-22" xmlns:a4="http://schemas.microsoft.com/clr/nsassem/zaaReloaded2.Controller.Elements/zaaReloaded2%2C%20Version%3D1.0.0.0%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3D6ec8d075a1ab1383">
<Version>1</Version>
<Content id="ref-43">BGA: pH, Std.-Bic., BE</Content>
</a4:Items>
<a4:Items id="ref-23" xmlns:a4="http://schemas.microsoft.com/clr/nsassem/zaaReloaded2.Controller.Elements/zaaReloaded2%2C%20Version%3D1.0.0.0%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3D6ec8d075a1ab1383">
<Version>1</Version>
<Content id="ref-44">Hepatitis-Serologie: Anti-HBs, Anti-HBc</Content>
</a4:Items>
<a4:Items id="ref-24" xmlns:a4="http://schemas.microsoft.com/clr/nsassem/zaaReloaded2.Controller.Elements/zaaReloaded2%2C%20Version%3D1.0.0.0%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3D6ec8d075a1ab1383">
<Version>1</Version>
<Content id="ref-45">Medikamente: TAC, CSA, SIR, Vancomycin, Gentamicin, Tobramicin</Content>
</a4:Items>
<a2:UnitySerializationHolder id="ref-25" xmlns:a2="http://schemas.microsoft.com/clr/ns/System">
<Data id="ref-46">zaaReloaded2.Controller.Elements.CustomText</Data>
<UnityType>4</UnityType>
<AssemblyName href="#ref-7"/>
</a2:UnitySerializationHolder>
<a4:CustomText id="ref-26" xmlns:a4="http://schemas.microsoft.com/clr/nsassem/zaaReloaded2.Controller.Elements/zaaReloaded2%2C%20Version%3D1.0.0.0%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3D6ec8d075a1ab1383">
<Version>1</Version>
<Content id="ref-47">Virologie (EDTA-Blut): CMV-PCR, BKV-PCR</Content>
</a4:CustomText>
<a4:CustomText id="ref-27" xmlns:a4="http://schemas.microsoft.com/clr/nsassem/zaaReloaded2.Controller.Elements/zaaReloaded2%2C%20Version%3D1.0.0.0%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3D6ec8d075a1ab1383">
<Version>1</Version>
<Content id="ref-48">Nephrolog. Sediment: pH, Proteinurie, Ery /µl, Leu /µl, Plattenep. /µl, Bakt., Schleimfäden</Content>
</a4:CustomText>
<a4:CustomText id="ref-28" xmlns:a4="http://schemas.microsoft.com/clr/nsassem/zaaReloaded2.Controller.Elements/zaaReloaded2%2C%20Version%3D1.0.0.0%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3D6ec8d075a1ab1383">
<Version>1</Version>
<Content id="ref-49">Autoantikörper: ANCA (IF), MPO-ANCA (ELISA), PR3-ANCA (ELISA), ANA (IF), AnDNA (ELISA), AnDNA (RIA)</Content>
</a4:CustomText>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

View File

@ -0,0 +1,117 @@
# LAURIS-NAME "KANONISCHER NAME" MATERIAL "IMMER REFERENZBEREICH" "BLACKLIST"
# =========== ================== ======== ======================= ===========
"Übergangsepithelien (U)" Übergangsep. U
"a1-Microglobulin (SU)" a1-Microglobulin SU
"a1-Microglobulin (SU)/die" a1-Microglobulin SU
"aktuelles Bicarbonat" Bic BGA
"Albumin (PU)" Alb U
"Albumin (SU)" Alb SU
"Albumin (SU)/die" Alb SU
Albumin Alb S
"Albumin/Creatinin (PU)" ACR U
"Alk. Phosphatase" AP S
Amylase Amylase S
"anorg. Phosphat" P S
"Bakterien (U)" Bakt U
Basenabweichung BE BGA
Basophile Baso E
"Bilirubin (U)" Bilirubin U
"C-reaktives Protein" CRP S
"Calcium (SU)" Ca SU
"Calcium (SU)/die" Ca SU
Calcium Ca S
Calcium-Phosphat-Produkt CaxP S
Cholesterin Chol S
CK gesamt" CK S
"CK MB" CK-MB S
"Creatinin (PU)" Krea U
"Creatinin (SU)" Krea SU
Creatinin Krea S
"Creatinin-Clearance (SU)/min" CrCl SU
"Cyclosporin-A vor Gabe" "CsA (C0)" S X
"Cystatin C (N Latex)" "Cystatin C" S X
Eisen Fe S
Eosinophile Eos E
"Erythrozyten (U)" Ery U
Erythrozyten Ery E
Ferritin Ferr S
Gesamt-Bilirubin Bilirubin S
"Gesamt-Eiweiss (PU)" Protein U
"Gesamt-Eiweiss (SU)" Protein SU
"Gesamt-Eiweiss (SU)/die" Proteinurie SU
Gesamt-Eiweiss Protein S
"Gesamt-Eiweiss/Creatinin (PU)" TPCR U
GGT GGT S
"glomeruläre Filtrationsrate" GFR SU
"glomerul. Filtrationsr. (MDRD)" "eGFR (MDRD)" S --- X
"glomerul. Filtrationsr. CKD-EP" "eGFR (CKD-EPI)" S
"Glucose (U)" Glukose U
Glucose Glukose S
"GOT (ASAT)" GOT S
"GPT (ALAT)" GPT S
Hämatokrit Hkt E
Hämoglobin Hb E
Haptoglobin Haptoglobin S X
Harnsäure Harnsäure S
"Harnstoff (SU)" Hst SU
"Harnstoff (SU)/die" Hst/Tag SU
Harnstoff" Hst S
"Harnstoff-Clearance (SU)/min" HstCl SU
"HbA1c (NGSP)" HbA1c E
"HDL - Cholesterin" HDL S
"hyaline Zylinder (U)" "hyal. Zyl." U
"Kalium (SU)" K U
"Kalium (SU)/die" K SU
Kalium K S
"Ketonkörper (U)" KK U
"Lactat Dehydrogenase" LDH S
"LDL - Cholesterin" LDL S
"Leukozyten (U)" Leu U
Leukozyten Leu E
Lymphozyten Lym E
Magnesium Mg S X
"MCH (HbE)" MCH E
MCHC MCHC E
MCV MCV E
"Mittleres Plättchenvolumen" MPV E
Monozyten Mon E
"Natrium (SU)" Na SU
"Natrium (SU)/die" Na SU
Natrium Na S
Neutrophile Neu E
"Nitrit (U)" Nitrit U
NT-proBNP NT-proBNP S
"PCO2 (art.)" pCO2 BGA
"pH (U)" pH U
pH pH BGA
"Plattenepithelien (U)" Plattenep U
"PO2 (art.)" pO2 BGA
"Protein (U)" Protein U
"Sammelmenge (U)" Volumen SU
"Sammelzeit (U)" Zeit SU
"Sauerstoffsättigung (art.)" SO2 BGA
Sirolimus SIR S
"spezifisches Gewicht (U)" "spez. Gew." U
"Standard Bicarbonat" "Std.-Bic." BGA
"Tacrolimus (FK506)" TAC S
Thrombozyten Thr E
Transferrin Transferrin S
"Transferrinsättigung" Tf.-Sätt. S
"Triglyceride" TG S
"Troponin T (high sensitive)" hsTnT S
Unreife Granulozyten" Gran E
"Urobilinogen (U)" Urobilinogen U
"Niedermol. Heparin (Anti-Xa)" Anti-Xa Z
"Thromboplastinzeit n. Quick" Quick Z
PTT PTT Z
"Ratio int. norm." INR Z
"Komplementfaktor C3c" C3c S X
"Komplementfaktor C4" C4 S X
"Anti-DNAse B" "Anti-DNAse B" S
Anti-Streptolysin ASL S
"PTH intakt" iPTH S
TSH TSH S
HAPTOGLOBIN Haptoglobin S
FRAGMENTOZYTEN Fragmentozyten E
"HBc-Antikörper (gesamt)" Anti-HBc S
HBs-Antikörper Anti-HBs S

View File

@ -5,3 +5,7 @@
"ml/min /1,73qm" "ml/min/1,73 m²"
ng/ml µg/l
mmol/l mM
n*1000/µl /nl
n*10E6/µl /fl
Bak/µl /µl
"mg/g Crea" mg/g

View File

@ -0,0 +1,200 @@
<SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:clr="http://schemas.microsoft.com/soap/encoding/clr/1.0" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<a1:Settings id="ref-1" xmlns:a1="http://schemas.microsoft.com/clr/nsassem/zaaReloaded2.Controller/zaaReloaded2%2C%20Version%3D1.0.0.0%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3D6ec8d075a1ab1383">
<Version>1</Version>
<Uid xsi:type="a2:Guid" xmlns:a2="http://schemas.microsoft.com/clr/ns/System">
<_a>1443045381</_a>
<_b>29162</_b>
<_c>17774</_c>
<_d>182</_d>
<_e>243</_e>
<_f>111</_f>
<_g>227</_g>
<_h>16</_h>
<_i>47</_i>
<_j>142</_j>
<_k>57</_k>
</Uid>
<Name id="ref-3">Kopie von Standard für Station</Name>
<ReferenceStyle xsi:type="a3:ReferenceStyle" xmlns:a3="http://schemas.microsoft.com/clr/nsassem/zaaReloaded2.Formatter/zaaReloaded2%2C%20Version%3D1.0.0.0%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3D6ec8d075a1ab1383">IfSpecialOrAbnormal</ReferenceStyle>
<ElementsCount>4</ElementsCount>
<Element0Type href="#ref-4"/>
<Element0Object href="#ref-5"/>
<Element1Type href="#ref-6"/>
<Element1Object href="#ref-7"/>
<Element2Type href="#ref-8"/>
<Element2Object href="#ref-9"/>
<Element3Type href="#ref-10"/>
<Element3Object href="#ref-11"/>
</a1:Settings>
<a2:UnitySerializationHolder id="ref-4" xmlns:a2="http://schemas.microsoft.com/clr/ns/System">
<Data id="ref-12">zaaReloaded2.Controller.Elements.TwoColumns</Data>
<UnityType>4</UnityType>
<AssemblyName id="ref-13">zaaReloaded2, Version=1.0.0.0, Culture=neutral, PublicKeyToken=6ec8d075a1ab1383</AssemblyName>
</a2:UnitySerializationHolder>
<a4:TwoColumns id="ref-5" xmlns:a4="http://schemas.microsoft.com/clr/nsassem/zaaReloaded2.Controller.Elements/zaaReloaded2%2C%20Version%3D1.0.0.0%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3D6ec8d075a1ab1383">
<Version>1</Version>
<ChildrenCount>0</ChildrenCount>
</a4:TwoColumns>
<a2:UnitySerializationHolder id="ref-6" xmlns:a2="http://schemas.microsoft.com/clr/ns/System">
<Data id="ref-14">zaaReloaded2.Controller.Elements.SelectFirstDay</Data>
<UnityType>4</UnityType>
<AssemblyName href="#ref-13"/>
</a2:UnitySerializationHolder>
<a4:SelectFirstDay id="ref-7" xmlns:a4="http://schemas.microsoft.com/clr/nsassem/zaaReloaded2.Controller.Elements/zaaReloaded2%2C%20Version%3D1.0.0.0%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3D6ec8d075a1ab1383">
<Version>1</Version>
<ChildrenCount>16</ChildrenCount>
<Child0Type href="#ref-15"/>
<Child0Object href="#ref-16"/>
<Child1Type href="#ref-15"/>
<Child1Object href="#ref-17"/>
<Child2Type href="#ref-15"/>
<Child2Object href="#ref-18"/>
<Child3Type href="#ref-15"/>
<Child3Object href="#ref-19"/>
<Child4Type href="#ref-15"/>
<Child4Object href="#ref-20"/>
<Child5Type href="#ref-15"/>
<Child5Object href="#ref-21"/>
<Child6Type href="#ref-15"/>
<Child6Object href="#ref-22"/>
<Child7Type href="#ref-15"/>
<Child7Object href="#ref-23"/>
<Child8Type href="#ref-15"/>
<Child8Object href="#ref-24"/>
<Child9Type href="#ref-15"/>
<Child9Object href="#ref-25"/>
<Child10Type href="#ref-15"/>
<Child10Object href="#ref-26"/>
<Child11Type href="#ref-15"/>
<Child11Object href="#ref-27"/>
<Child12Type href="#ref-15"/>
<Child12Object href="#ref-28"/>
<Child13Type href="#ref-15"/>
<Child13Object href="#ref-29"/>
<Child14Type href="#ref-15"/>
<Child14Object href="#ref-30"/>
<Child15Type href="#ref-15"/>
<Child15Object href="#ref-31"/>
</a4:SelectFirstDay>
<a2:UnitySerializationHolder id="ref-8" xmlns:a2="http://schemas.microsoft.com/clr/ns/System">
<Data id="ref-32">zaaReloaded2.Controller.Elements.NextColumn</Data>
<UnityType>4</UnityType>
<AssemblyName href="#ref-13"/>
</a2:UnitySerializationHolder>
<a4:NextColumn id="ref-9" xmlns:a4="http://schemas.microsoft.com/clr/nsassem/zaaReloaded2.Controller.Elements/zaaReloaded2%2C%20Version%3D1.0.0.0%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3D6ec8d075a1ab1383">
<Version>1</Version>
<ChildrenCount>0</ChildrenCount>
</a4:NextColumn>
<a2:UnitySerializationHolder id="ref-10" xmlns:a2="http://schemas.microsoft.com/clr/ns/System">
<Data id="ref-33">zaaReloaded2.Controller.Elements.SelectLastDay</Data>
<UnityType>4</UnityType>
<AssemblyName href="#ref-13"/>
</a2:UnitySerializationHolder>
<a4:SelectLastDay id="ref-11" xmlns:a4="http://schemas.microsoft.com/clr/nsassem/zaaReloaded2.Controller.Elements/zaaReloaded2%2C%20Version%3D1.0.0.0%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3D6ec8d075a1ab1383">
<Version>1</Version>
<ChildrenCount>16</ChildrenCount>
<Child0Type href="#ref-15"/>
<Child0Object href="#ref-16"/>
<Child1Type href="#ref-15"/>
<Child1Object href="#ref-17"/>
<Child2Type href="#ref-15"/>
<Child2Object href="#ref-18"/>
<Child3Type href="#ref-15"/>
<Child3Object href="#ref-19"/>
<Child4Type href="#ref-15"/>
<Child4Object href="#ref-20"/>
<Child5Type href="#ref-15"/>
<Child5Object href="#ref-21"/>
<Child6Type href="#ref-15"/>
<Child6Object href="#ref-22"/>
<Child7Type href="#ref-15"/>
<Child7Object href="#ref-23"/>
<Child8Type href="#ref-15"/>
<Child8Object href="#ref-24"/>
<Child9Type href="#ref-15"/>
<Child9Object href="#ref-25"/>
<Child10Type href="#ref-15"/>
<Child10Object href="#ref-26"/>
<Child11Type href="#ref-15"/>
<Child11Object href="#ref-27"/>
<Child12Type href="#ref-15"/>
<Child12Object href="#ref-28"/>
<Child13Type href="#ref-15"/>
<Child13Object href="#ref-29"/>
<Child14Type href="#ref-15"/>
<Child14Object href="#ref-30"/>
<Child15Type href="#ref-15"/>
<Child15Object href="#ref-31"/>
</a4:SelectLastDay>
<a2:UnitySerializationHolder id="ref-15" xmlns:a2="http://schemas.microsoft.com/clr/ns/System">
<Data id="ref-34">zaaReloaded2.Controller.Elements.Items</Data>
<UnityType>4</UnityType>
<AssemblyName href="#ref-13"/>
</a2:UnitySerializationHolder>
<a4:Items id="ref-16" xmlns:a4="http://schemas.microsoft.com/clr/nsassem/zaaReloaded2.Controller.Elements/zaaReloaded2%2C%20Version%3D1.0.0.0%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3D6ec8d075a1ab1383">
<Version>1</Version>
<Content id="ref-35">Klinische Chemie: Na, K, Cl, Mg, Ca, P, CaxP, Alb, Prot, Haptoglobin, LDH, Glukose, Harnsäure</Content>
</a4:Items>
<a4:Items id="ref-17" xmlns:a4="http://schemas.microsoft.com/clr/nsassem/zaaReloaded2.Controller.Elements/zaaReloaded2%2C%20Version%3D1.0.0.0%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3D6ec8d075a1ab1383">
<Version>1</Version>
<Content id="ref-36">Entzündung/Immunsystem: CRP, Pct, C3c, C4, Anti-DNAse B, ASL</Content>
</a4:Items>
<a4:Items id="ref-18" xmlns:a4="http://schemas.microsoft.com/clr/nsassem/zaaReloaded2.Controller.Elements/zaaReloaded2%2C%20Version%3D1.0.0.0%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3D6ec8d075a1ab1383">
<Version>1</Version>
<Content id="ref-37">Kardiale Marker: CK, CKMB, Trop, NTproBNP</Content>
</a4:Items>
<a4:Items id="ref-19" xmlns:a4="http://schemas.microsoft.com/clr/nsassem/zaaReloaded2.Controller.Elements/zaaReloaded2%2C%20Version%3D1.0.0.0%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3D6ec8d075a1ab1383">
<Version>1</Version>
<Content id="ref-38">Niere: Krea, Hst, eGFR (CKD-EPI)</Content>
</a4:Items>
<a4:Items id="ref-20" xmlns:a4="http://schemas.microsoft.com/clr/nsassem/zaaReloaded2.Controller.Elements/zaaReloaded2%2C%20Version%3D1.0.0.0%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3D6ec8d075a1ab1383">
<Version>1</Version>
<Content id="ref-39">Sammelurin: SU-Proteinurie, SU-Alb, SU-CrCl, SU-HstCl, SU-GFR, SU-Natrium, SU-Zeit, SU-Volumen</Content>
</a4:Items>
<a4:Items id="ref-21" xmlns:a4="http://schemas.microsoft.com/clr/nsassem/zaaReloaded2.Controller.Elements/zaaReloaded2%2C%20Version%3D1.0.0.0%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3D6ec8d075a1ab1383">
<Version>1</Version>
<Content id="ref-40">Spot-Urin: U-*</Content>
</a4:Items>
<a4:Items id="ref-22" xmlns:a4="http://schemas.microsoft.com/clr/nsassem/zaaReloaded2.Controller.Elements/zaaReloaded2%2C%20Version%3D1.0.0.0%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3D6ec8d075a1ab1383">
<Version>1</Version>
<Content id="ref-41">Leber: GOT, GGT, GPT, AP, Bilirubin, CHE</Content>
</a4:Items>
<a4:Items id="ref-23" xmlns:a4="http://schemas.microsoft.com/clr/nsassem/zaaReloaded2.Controller.Elements/zaaReloaded2%2C%20Version%3D1.0.0.0%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3D6ec8d075a1ab1383">
<Version>1</Version>
<Content id="ref-42">Blutfette: TG, Chol, LDL, HDL, Lp(a)</Content>
</a4:Items>
<a4:Items id="ref-24" xmlns:a4="http://schemas.microsoft.com/clr/nsassem/zaaReloaded2.Controller.Elements/zaaReloaded2%2C%20Version%3D1.0.0.0%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3D6ec8d075a1ab1383">
<Version>1</Version>
<Content id="ref-43">Hämatologie: Hb, Hkt, Reti, Leu, Thr, Ery, Neu, Lym, Mon, Baso, Eos, MCV, HbA1c, Retikulozyten, Fragmentozyten</Content>
</a4:Items>
<a4:Items id="ref-25" xmlns:a4="http://schemas.microsoft.com/clr/nsassem/zaaReloaded2.Controller.Elements/zaaReloaded2%2C%20Version%3D1.0.0.0%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3D6ec8d075a1ab1383">
<Version>1</Version>
<Content id="ref-44">Gerinnung: Quick, INR, PTT, Fibrinogen, ATIII, Anti-Xa</Content>
</a4:Items>
<a4:Items id="ref-26" xmlns:a4="http://schemas.microsoft.com/clr/nsassem/zaaReloaded2.Controller.Elements/zaaReloaded2%2C%20Version%3D1.0.0.0%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3D6ec8d075a1ab1383">
<Version>1</Version>
<Content id="ref-45">Hormone: iPTH, TSH</Content>
</a4:Items>
<a4:Items id="ref-27" xmlns:a4="http://schemas.microsoft.com/clr/nsassem/zaaReloaded2.Controller.Elements/zaaReloaded2%2C%20Version%3D1.0.0.0%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3D6ec8d075a1ab1383">
<Version>1</Version>
<Content id="ref-46">Medikamente: TAC, CSA, SIR, Vancomycin, Gentamicin, Tobramicin</Content>
</a4:Items>
<a4:Items id="ref-28" xmlns:a4="http://schemas.microsoft.com/clr/nsassem/zaaReloaded2.Controller.Elements/zaaReloaded2%2C%20Version%3D1.0.0.0%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3D6ec8d075a1ab1383">
<Version>1</Version>
<Content id="ref-47">Eisenhaushalt: Eisen, Ferritin, Transferrin, Tf.-Sätt.</Content>
</a4:Items>
<a4:Items id="ref-29" xmlns:a4="http://schemas.microsoft.com/clr/nsassem/zaaReloaded2.Controller.Elements/zaaReloaded2%2C%20Version%3D1.0.0.0%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3D6ec8d075a1ab1383">
<Version>1</Version>
<Content id="ref-48">BGA: pH, Std.-Bic., BE</Content>
</a4:Items>
<a4:Items id="ref-30" xmlns:a4="http://schemas.microsoft.com/clr/nsassem/zaaReloaded2.Controller.Elements/zaaReloaded2%2C%20Version%3D1.0.0.0%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3D6ec8d075a1ab1383">
<Version>1</Version>
<Content id="ref-49">Hepatitis-Serologie: Anti-HBs, Anti-HBc</Content>
</a4:Items>
<a4:Items id="ref-31" xmlns:a4="http://schemas.microsoft.com/clr/nsassem/zaaReloaded2.Controller.Elements/zaaReloaded2%2C%20Version%3D1.0.0.0%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3D6ec8d075a1ab1383">
<Version>1</Version>
<Content id="ref-50">Weitere Werte: *</Content>
</a4:Items>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

75
zaaReloaded2/Demo/Demo.cs Executable file
View File

@ -0,0 +1,75 @@
/* Demo.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.IO;
using System.Linq;
using System.Text;
using Microsoft.Office.Interop.Word;
namespace zaaReloaded2.Demo
{
/// <summary>
/// Static class that serves to load an embedded Word document
/// into a temporary file and open that temporary file in Word.
/// </summary>
static class Demo
{
#region Public methods
/// <summary>
/// Opens a demo document. The document's Saved property is set to
/// false so that a user who wants to save changes will be prompted
/// for a file name.
/// </summary>
public static void OpenDemoDocument()
{
string tempFile = CreateTempFileFromResource();
Document demoDoc = Globals.ThisAddIn.Application.Documents
.Add(Template: tempFile);
File.Delete(tempFile);
}
#endregion
#region Private methods
/// <summary>
/// Copies the built-in demo file from a resource stream to a
/// temporary file and returns the path to that file.
/// </summary>
/// <returns>Path to the newly created temporary file.</returns>
static string CreateTempFileFromResource()
{
string resourceName = "zaaReloaded2.Demo.Demo.docx";
Stream resourceStream = typeof(Demo).Assembly
.GetManifestResourceStream(resourceName);
if (resourceStream == null)
{
throw new IOException("Unable to open stream " + resourceName);
}
string fileName = Path.GetTempFileName() + ".docx";
Stream tempStream = File.Create(fileName);
resourceStream.CopyTo(tempStream);
tempStream.Close();
return fileName;
}
#endregion
}
}

BIN
zaaReloaded2/Demo/Demo.docx Executable file

Binary file not shown.

View File

@ -25,7 +25,8 @@
xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions"
xmlns:settings="clr-namespace:Bovender.Mvvm.Views.Settings;assembly=Bovender"
xmlns:converter="clr-namespace:Bovender.Mvvm.Converters;assembly=Bovender"
SizeToContent="Height" Width="700"
SizeToContent="Height" Width="700" ShowInTaskbar="False"
WindowStyle="ToolWindow" Topmost="True" ResizeMode="CanResizeWithGrip"
x:Name="exceptionDetailView"
Title="Technische Fehlerdetails"
settings:WindowState.Save="True"

View File

@ -27,6 +27,7 @@
xmlns:actions="clr-namespace:Bovender.Mvvm.Actions;assembly=Bovender"
xmlns:settings="clr-namespace:Bovender.Mvvm.Views.Settings;assembly=Bovender"
SizeToContent="WidthAndHeight" ResizeMode="CanResizeWithGrip"
WindowStyle="ToolWindow" ShowInTaskbar="False" Topmost="True"
WindowStartupLocation="CenterScreen"
Title="zaaReloaded2: Fehler!"
settings:WindowState.Save="True"

View File

@ -32,8 +32,7 @@ namespace zaaReloaded2.ExceptionHandler
{
get
{
// TODO: Get Word version
return "n/a";
return Globals.ThisAddIn.Application.Build;
}
}
@ -84,7 +83,7 @@ namespace zaaReloaded2.ExceptionHandler
protected override string DevPath()
{
return @"x:\Code\zaaReloaded2\";
return @"x:\Code\zaaReloaded2\zaaReloaded2\";
}
#endregion

View File

@ -79,12 +79,12 @@ namespace zaaReloaded2.Formatter
static void FixSalutation(Document document)
{
Regex sal = new Regex(@"^Mit.*(freundl|kolleg)");
Regex med = new Regex(@"^((Häusl|Empf).*Medikat)|Therapieempf");
Regex sal = new Regex(@"^Mit.*?Grüßen\r");
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:";
if (sal.IsMatch(p.Range.Text)) p.Range.Text = "Mit freundlichen, kollegialen Grüßen,\r";
if (med.IsMatch(p.Range.Text)) p.Range.Text = "Aktuelle Medikation:\r";
}
}
}

View File

@ -20,6 +20,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Office.Interop.Word;
using System.Text.RegularExpressions;
namespace zaaReloaded2.Formatter
{
@ -30,8 +31,19 @@ namespace zaaReloaded2.Formatter
/// depending on whether there is text in the buffer or not.
/// </summary>
/// <remarks>
/// <para>
/// Linking several DocumentWriters permits a cascading work flow
/// with several buffers.
/// </para>
/// <para>
/// Markup support: The DocumentWriter supports basic markup to control
/// the text styles in the Word document.
/// </para>
/// <list type="unordered">
/// <item>&lt;b&gt; and &lt;/b&gt; - bold/unbold</item>
/// <item>&lt;style:NAME&gt; - set the paragraph or character style</item>
/// <item>&lt;/style&gt; - remove *character* style</item>
/// </list>
/// </remarks>
class DocumentWriter
{
@ -53,6 +65,20 @@ namespace zaaReloaded2.Formatter
/// </summary>
public bool HasBufferedText { get { return _buffer.Length > 0; } }
/// <summary>
/// Returns text without markup from the buffer.
/// </summary>
public string Text
{
get
{
if (!HasBufferedText)
throw new InvalidOperationException("This DocumentWriter does not have any text.");
return _markupRegex.Replace(_buffer.ToString(), String.Empty);
}
}
#endregion
#region Constructors
@ -113,7 +139,10 @@ namespace zaaReloaded2.Formatter
if (Document != null)
{
Document.Range().Text = _buffer.ToString();
Selection s = Document.ActiveWindow.Selection;
s.ClearCharacterDirectFormatting();
s.ClearParagraphDirectFormatting();
MarkupToDocument(_buffer.ToString());
}
if (Parent != null)
{
@ -153,9 +182,54 @@ namespace zaaReloaded2.Formatter
#endregion
#region Private methods
/// <summary>
/// Parses a string containing markup (e.g., "&lt;b&gt;", "&lt;/b&gt;")
/// and writes formatted text to the current Document.
/// </summary>
void MarkupToDocument(string text)
{
string[] substrings = _markupRegex.Split(text);
Selection sel = Document.ActiveWindow.Selection;
foreach (string substring in substrings)
{
switch (substring)
{
case "<b>":
sel.Font.Bold = 1;
break;
case "</b>":
sel.Font.Bold = 0;
break;
case "</style>":
sel.ClearCharacterStyle();
break;
default:
Match styleMatch = _styleRegex.Match(substring);
if (styleMatch.Success)
{
sel.set_Style(styleMatch.Groups["style"].Value);
}
else
{
sel.TypeText(substring);
}
break;
}
}
}
#endregion
#region Fields
StringBuilder _buffer;
// Put pattern in parentheses so they will not be discarded by Regex.Split
// The splitting pattern must not contain subgroups!
static readonly Regex _markupRegex = new Regex(@"(<[^ >]+>)");
static readonly Regex _styleRegex = new Regex(@"<style:(?<style>[^>]+)>");
#endregion
}

View File

@ -64,6 +64,12 @@ namespace zaaReloaded2.Formatter
/// </summary>
public Dictionary<DateTime, TimePointFormatter> WorkingTimePoints { get; private set; }
/// <summary>
/// Is true if this Formatter object carries a Laboratory with
/// at least one time point.
/// </summary>
public bool CanRun { get { return Laboratory.TimePoints.Count > 0; } }
#endregion
#region Constructors
@ -113,6 +119,8 @@ namespace zaaReloaded2.Formatter
/// current position of the cursor).</param>
public void Run()
{
if (!CanRun) throw new NoLaboratoryDataException("No laboratory data to format.");
int current = 0;
while (current < Settings.Elements.Count)
{
@ -137,7 +145,14 @@ namespace zaaReloaded2.Formatter
current++;
}
}
// Write everything to the Word document
Globals.ThisAddIn.Application.UndoRecord.StartCustomRecord(
String.Format("Laborformatierung ({0})", Properties.Settings.Default.AddinName)
);
CreateStyles();
_secondaryBuffer.Flush();
Globals.ThisAddIn.Application.UndoRecord.EndCustomRecord();
}
/// <summary>
@ -195,7 +210,106 @@ namespace zaaReloaded2.Formatter
/// FormatElementBase children to process.</param>
public void ProcessAllTimePoints(ControlElementBase controlElement)
{
ProcessAllTimePoints(controlElement.FormatElements);
ProcessAllTimePoints(controlElement.Children);
}
/// <summary>
/// Inserts a table with two columns into the document.
/// </summary>
public void InsertTwoColumns()
{
_secondaryBuffer.Flush();
if (Document != null)
{
Range r = Document.ActiveWindow.Selection.Range;
_table = Document.Tables.Add(r, NumRows: 1, NumColumns: 2);
_table.AllowAutoFit = true;
_table.AutoFitBehavior(WdAutoFitBehavior.wdAutoFitWindow);
_table.PreferredWidthType = WdPreferredWidthType.wdPreferredWidthPercent;
_table.PreferredWidth = 100;
_table.Borders.Enable = 0;
}
}
/// <summary>
/// Moves the insertion point to the next column in a layout
/// table.
/// </summary>
public void NextColumn()
{
if (_table == null)
{
throw new InvalidOperationException(
"Kann nicht zur nächsten Spalte wechseln, da bislang keine Tabelle eingefügt wurde.");
}
_secondaryBuffer.Flush();
Document.ActiveWindow.Selection.MoveRight(WdUnits.wdCell);
}
/// <summary>
/// Creates a paragraph and character styles in the document.
/// </summary>
public void CreateStyles()
{
if (Document != null)
{
Style style;
// Don't see a better way to check for the existence of a particular
// paragraph style than by using a try...catch construction.
try
{
style = Document.Styles[Properties.Settings.Default.StyleParagraph];
}
catch
{
// Add default paragraph style for laboratory
style = Document.Styles.Add(Properties.Settings.Default.StyleParagraph);
style.Font.Size = 10; // pt
style.Font.Bold = 0;
style.Font.Italic = 0;
style.Font.Underline = 0;
style.ParagraphFormat.SpaceAfter = 0;
style.ParagraphFormat.SpaceBefore = 0;
style.ParagraphFormat.LeftIndent = 36; // pt
style.ParagraphFormat.FirstLineIndent = -36; // pt
style.ParagraphFormat.Alignment = WdParagraphAlignment.wdAlignParagraphJustify;
}
try
{
style = Document.Styles[Properties.Settings.Default.StyleHeader];
}
catch
{
// Add header paragraph style for laboratory
style = Document.Styles.Add(Properties.Settings.Default.StyleHeader);
style.Font.Size = 10; // pt
style.Font.Bold = 1;
style.Font.Italic = 0;
style.Font.Underline = WdUnderline.wdUnderlineSingle;
style.ParagraphFormat.SpaceAfter = 0;
style.ParagraphFormat.SpaceBefore = 12;
style.ParagraphFormat.LeftIndent = 36; // pt
style.ParagraphFormat.FirstLineIndent = -36; // pt
style.ParagraphFormat.Alignment = WdParagraphAlignment.wdAlignParagraphJustify;
style.set_NextParagraphStyle(Document.Styles[Properties.Settings.Default.StyleParagraph]);
}
/*
try
{
style = Document.Styles[Properties.Settings.Default.StyleAbnormal];
}
catch
{
// Add character style for abnormal parameters
style = Document.Styles.Add(
Properties.Settings.Default.StyleAbnormal,
WdStyleType.wdStyleTypeCharacter);
style.Font.Bold = 1;
}
*/
}
}
#endregion
@ -259,7 +373,7 @@ namespace zaaReloaded2.Formatter
throw new ArgumentNullException("workingTimePoints");
WorkingTimePoints = workingTimePoints;
ProcessElements(controlElement.FormatElements);
ProcessElements(controlElement.Children);
if (_primaryBuffer.HasBufferedText)
{
_primaryBuffer.Prepend(
@ -286,6 +400,7 @@ namespace zaaReloaded2.Formatter
Laboratory _laboratory;
DocumentWriter _primaryBuffer;
DocumentWriter _secondaryBuffer;
Table _table;
#endregion
}

View File

@ -48,6 +48,23 @@ namespace zaaReloaded2.Formatter
/// </summary>
public bool HasBeenUsed { get; set; }
/// <summary>
/// Gets or sets a flag that tells the formatter to include or
/// not include the material indicator in the formatted output.
/// Default is true.
/// </summary>
/// <remarks>
/// For example, items that are selected with a wildcard may
/// contain the material info, while expressly chosen items
/// may not.
/// </remarks>
public bool IncludeMaterial { get; set; }
/// <summary>
/// Gets whether the Item is marked as blacklisted in the thesaurus.
/// </summary>
public bool IsBlacklisted { get { return LabItem.IsBlacklisted; } }
#endregion
#region Constructor
@ -58,6 +75,7 @@ namespace zaaReloaded2.Formatter
/// <param name="labItem">LabItem to wrap in this ItemFormatter.</param>
public ItemFormatter(LabItem labItem, ReferenceStyle referenceStyle)
{
IncludeMaterial = true;
LabItem = labItem;
ReferenceStyle = referenceStyle;
}
@ -114,7 +132,8 @@ namespace zaaReloaded2.Formatter
string unit;
if (LabItem.HasUnit)
{
unit = String.Format(" {0}", LabItem.Unit);
string space = LabItem.Unit.StartsWith("/") ? String.Empty : " ";
unit = String.Format("{0}{1}", space, LabItem.Unit);
}
else
{
@ -133,15 +152,24 @@ namespace zaaReloaded2.Formatter
value = LabItem.Value;
}
// Insert the formatted text into the document.
formatter.Write(
string name = IncludeMaterial ? LabItem.QualifiedName : LabItem.Name;
string output =
String.Format(
"{0} {1}{2}{3}",
LabItem.QualifiedName,
name,
value,
unit,
reference
));
);
if (!LabItem.IsNormal)
{
output = String.Format(
"<b>{0}</b>",
output);
}
formatter.Write(output);
HasBeenUsed = true;
}

View File

@ -0,0 +1,35 @@
/* NoLaboratoryDataException.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.Runtime.Serialization;
namespace zaaReloaded2.Formatter
{
[Serializable]
class NoLaboratoryDataException : Exception
{
public NoLaboratoryDataException() { }
public NoLaboratoryDataException(string message) : base(message) { }
public NoLaboratoryDataException(string message,
Exception innerException)
: base(message, innerException) { }
public NoLaboratoryDataException(SerializationInfo info,
StreamingContext context)
: base(info, context) { }
}
}

View File

@ -26,37 +26,36 @@ namespace zaaReloaded2.Formatter
/// <summary>
/// Describes the style of normal range references.
/// </summary>
[Serializable]
public enum ReferenceStyle
{
/// <summary>
/// Never write normal ranges
/// </summary>
[Description("Referenzbereich nie ausgeben")]
[Description("Niemals")]
Never,
/// <summary>
/// Write normal range if item is marked in dictionary
/// </summary>
[Description("Referenzbereich ausgeben, falls Parameter so markiert ist")]
[Description("Bei speziellen Parametern immer")]
IfSpecialItem,
/// <summary>
/// Write normal range if value is abnormal
/// </summary>
[Description("Referenzbereich ausgeben, falls Wert nicht normal ist")]
[Description("Bei pathologischem Wert")]
IfAbnormal,
/// <summary>
/// Write normal range if item is marked in dictionary, or if value is abnormal
/// </summary>
[Description("Referenzbereich ausgeben, falls Parameter so markiert ist oder falls Wert nicht normal ist")]
[Description("Bei pathologischem Wert oder speziellem Parameter")]
IfSpecialOrAbnormal,
/// <summary>
/// Always write normal range reference
/// </summary>
[Description("Referenzbereich immer ausgeben")]
[Description("Immer")]
Always
}
}

View File

@ -28,6 +28,57 @@ namespace zaaReloaded2.Formatter
/// </summary>
public class TimePointFormatter
{
#region Static methods
/// <summary>
/// Builds a header paragraph from a Date,
/// but only if the Date structure has a value.
/// </summary>
public static string DateHeader(DateTime date)
{
if (date != _nullTimeStamp.Date)
{
return FormatHeader(date.ToShortDateString());
}
else
{
return String.Empty;
}
}
/// <summary>
/// Builds a header paragraph from a DateTime structure,
/// but only if the DateTime structure has a value.
/// </summary>
public static string DateAndTimeHeader(DateTime dateTime)
{
if (dateTime != _nullTimeStamp)
{
return FormatHeader(dateTime.ToString());
}
else
{
return String.Empty;
}
}
#endregion
#region Private static methods
static string FormatHeader(string text)
{
return String.Format("<style:{0}>Laborwerte vom {1}:{2}<style:{3}>",
// Environment.NewLine,
Properties.Settings.Default.StyleHeader,
text,
Environment.NewLine,
Properties.Settings.Default.StyleParagraph
);
}
#endregion
#region Properties
/// <summary>
@ -77,7 +128,7 @@ namespace zaaReloaded2.Formatter
/// <returns></returns>
public string GetDateHeader()
{
return FormatHeader(TimeStamp.ToShortDateString());
return DateHeader(TimeStamp);
}
@ -88,21 +139,14 @@ namespace zaaReloaded2.Formatter
/// <returns></returns>
public string GetDateAndTimeHeader()
{
return FormatHeader(TimeStamp.ToString());
return DateAndTimeHeader(TimeStamp);
}
#endregion
#region Private methods
#region Fields
string FormatHeader(string text)
{
return String.Format("{0}{1}:{2}",
Environment.NewLine,
text,
Environment.NewLine
);
}
static readonly DateTime _nullTimeStamp = new DateTime();
#endregion
}

BIN
zaaReloaded2/Icons/d.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1012 B

BIN
zaaReloaded2/Icons/down.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 545 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 337 B

BIN
zaaReloaded2/Icons/exit.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 751 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 365 B

BIN
zaaReloaded2/Icons/gear.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
zaaReloaded2/Icons/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 470 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 280 B

BIN
zaaReloaded2/Icons/pen.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 739 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 557 B

BIN
zaaReloaded2/Icons/plus.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 393 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 743 B

BIN
zaaReloaded2/Icons/up.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 537 B

View File

@ -30,6 +30,11 @@ namespace zaaReloaded2.Importer
/// </summary>
Laboratory Laboratory { get; set; }
/// <summary>
/// Indicates whether the import was successful.
/// </summary>
bool Success { get; }
/// <summary>
/// Imports laboratory data contained in a string.
/// </summary>

View File

@ -74,7 +74,9 @@ namespace zaaReloaded2.Importer.ZaaImporter
if (parameterDictionary != null)
{
Name = parameterDictionary.GetCanonicalName(OriginalName);
AlwaysPrintLimits = parameterDictionary.GetForceReferenceDisplay(Name);
AlwaysPrintLimits = parameterDictionary.GetForceReferenceDisplay(OriginalName);
IsBlacklisted = parameterDictionary.GetIsBlacklisted(OriginalName);
Material = parameterDictionary.GetMaterial(OriginalName, Material);
}
if (unitDictionary != null)
{
@ -132,7 +134,7 @@ namespace zaaReloaded2.Importer.ZaaImporter
{
if (match.Groups["limits"].Success)
{
Regex limitRegex = new Regex(@"\[(?<limit1>[\d.]+)?\s*(?<operator>\S+)\s*(?<limit2>[\d.]+)?]");
Regex limitRegex = new Regex(@"\[(?<limit1>[-\d.]+)?\s*(?<operator>\S+)\s*(?<limit2>[-\d.]+)?]");
Match limitMatch = limitRegex.Match(match.Groups["limits"].Value);
if (limitMatch.Groups["limit1"].Success && limitMatch.Groups["limit2"].Success)
{
@ -164,10 +166,12 @@ namespace zaaReloaded2.Importer.ZaaImporter
}
/// <summary>
/// Analyses the Lauris name for a material abbreviation.
/// If the parameter does not refer to blood (serum, whole
/// blood, etc.), Lauris appends an abbreviation in parentheses
/// to the parameter name.
/// Parses the original Lauris name for a material abbreviation.
/// This may be misleading in certain cases, e.g. "Sammelmenge (U)"
/// appears to be spot urine ("U"), but is collected urine instead
/// ("SU"). Therefore, in the constructor that takes the thesaurus
/// parameters, the material is looked up in the Parameters thesaurus.
/// ("Sammelmenge (U)" is contained in the Parameters thesaurus.)
/// </summary>
/// <example>
/// Gesamt-Eiweiss (SU), Albumin (SU)/die, Gesamt-Eiweiss (PU)

View File

@ -32,6 +32,19 @@ namespace zaaReloaded2.Importer.ZaaImporter
/// </summary>
public class LaurisParagraph
{
#region Static methods
/// <summary>
/// Investigates a paragraph and determines whether it looks
/// like a Lauris laboratory items paragraph.
/// </summary>
public static bool ResemblesLaurisParagraph(string paragraph)
{
return _expectedFormat.IsMatch(paragraph);
}
#endregion
#region Public properties
/// <summary>
@ -122,7 +135,7 @@ namespace zaaReloaded2.Importer.ZaaImporter
#region Fields
static readonly Regex _expectedFormat = new Regex(@"(?<caption>[^:]+:\s*)?(?<items>[^:]+:\s*[^;]+;)*");
static readonly Regex _expectedFormat = new Regex(@"(?<caption>[^:]+:\s*)?(?<items>[^:]+:\s*[^;]+;)+");
Thesaurus.Parameters _parameterDictionary;
Thesaurus.Units _unitDictionary;

View File

@ -65,11 +65,15 @@ namespace zaaReloaded2.Importer.ZaaImporter
/// <summary>
/// Gets an array of paragraphs in this LaurisText.
/// </summary>
public string[] Paragraphs
public IList<String> Paragraphs
{
[DebuggerStepThrough]
get
{
if (_paragraphs == null)
{
_paragraphs = new List<String>();
}
return _paragraphs;
}
set
@ -83,7 +87,13 @@ namespace zaaReloaded2.Importer.ZaaImporter
/// Is true if the LaurisText has time stamp in the first
/// paragraph and <see cref="LabItem"/>s in the others.
/// </summary>
public bool IsValidTimePoint { get; private set; }
public bool IsValidTimePoint
{
get
{
return Items.Count > 0;
}
}
/// <summary>
/// Gets or sets the original Lauris text for this timepoint.
@ -101,7 +111,7 @@ namespace zaaReloaded2.Importer.ZaaImporter
{
Paragraphs = value.Split(
new string[] { Environment.NewLine },
StringSplitOptions.None);
StringSplitOptions.None).ToList();
}
}
}
@ -128,19 +138,41 @@ namespace zaaReloaded2.Importer.ZaaImporter
{ }
public LaurisTimePoint(
string[] paragraphs,
IList<String> paragraphs,
Parameters parameterDictionary,
Units unitDictionary)
: this(parameterDictionary, unitDictionary)
{
Paragraphs = paragraphs;
}
public LaurisTimePoint(IList<String> paragraphs)
: this(paragraphs, null, null)
{
}
public LaurisTimePoint(
Parameters parameterDictionary,
Units unitDictionary)
: this()
{
_parameterDictionary = parameterDictionary;
_unitDictionary = unitDictionary;
Paragraphs = paragraphs;
}
public LaurisTimePoint(string[] paragraphs)
: this(paragraphs, null, null)
#endregion
#region Public methods
/// <summary>
/// Adds a new paragraph to this time point by parsing
/// the paragraph for laboratory items.
/// </summary>
/// <param name="paragraph">Paragraph to add.</param>
public void AddParagraph(string paragraph)
{
Paragraphs.Add(paragraph);
ParseParagraph(paragraph);
}
#endregion
@ -151,20 +183,36 @@ namespace zaaReloaded2.Importer.ZaaImporter
/// Analyzes each Lauris paragraph in this time point, sets the date
/// and time, and collects LabItem data.
/// </summary>
/// <returns>True if the LaurisText has time stamp in the first paragraphs
/// and contains <see cref="LabItem"/>s in the others.</returns>
bool ParseParagraphs()
void ParseParagraphs()
{
if (Paragraphs.Length > 0)
if (Paragraphs != null)
{
if (!ParseTimeStamp()) return false;
LaurisParagraph lp;
if (IsValidTimePoint)
foreach (string paragraph in Paragraphs)
{
for (int i = 1; i < Paragraphs.Length; i++)
ParseParagraph(paragraph);
}
}
}
void ParseParagraph(string paragraph)
{
lp = new LaurisParagraph(
Paragraphs[i],
if (_timeStampRegex.IsMatch(paragraph))
{
DateTime dt;
if (DateTime.TryParseExact(
_timeStampRegex.Match(paragraph).Groups["datetime"].Value,
"dd.MM.yyyy HH:mm",
CultureInfo.InvariantCulture,
DateTimeStyles.AllowWhiteSpaces,
out dt))
{
TimeStamp = dt;
}
}
else
{
LaurisParagraph lp = new LaurisParagraph(
paragraph,
_parameterDictionary,
_unitDictionary);
if (lp.IsLaurisParagraph)
@ -173,38 +221,6 @@ namespace zaaReloaded2.Importer.ZaaImporter
}
}
}
IsValidTimePoint = Items.Count > 0;
}
return true;
}
/// <summary>
/// Analyzes the date and time information that is expected to be
/// in the first paragraph.
/// </summary>
/// <returns>True if the LaurisText contains a time stamp in the
/// first paragraph.</returns>
bool ParseTimeStamp()
{
if (Paragraphs.Length == 0)
throw new InvalidOperationException("The time point has no paragraphs.");
Match m = _timeStampRegex.Match(Paragraphs[0]);
bool success = false;
if (m.Success)
{
DateTime dt;
success = DateTime.TryParseExact(
m.Groups["datetime"].Value,
"dd.MM.yyyy HH:mm",
CultureInfo.InvariantCulture,
DateTimeStyles.AllowWhiteSpaces,
out dt);
TimeStamp = dt;
}
IsValidTimePoint = success;
return success;
}
void AddItems(IItemDictionary items)
{
@ -220,8 +236,8 @@ namespace zaaReloaded2.Importer.ZaaImporter
/// paragraph of a LaurisText.
/// </summary>
static readonly Regex _timeStampRegex = new Regex(
@"^\s*\(?\s*(?<datetime>\d\d\.\d\d\.\d\d\d\d\s+\d\d:\d\d)");
string[] _paragraphs;
@"^(Labor:)?\s*\(?\s*(?<datetime>\d\d\.\d\d\.\d\d\d\d\s+\d\d:\d\d)");
IList<String> _paragraphs;
Parameters _parameterDictionary;
Units _unitDictionary;

View File

@ -52,6 +52,14 @@ namespace zaaReloaded2.Importer.ZaaImporter
}
}
public bool Success
{
get
{
return Laboratory.TimePoints.Count > 0;
}
}
/// <summary>
/// Splits the <paramref name="text"/> into individual time points
/// and creates <see cref="LaurisTimePoint"/> objects from them.
@ -59,45 +67,45 @@ namespace zaaReloaded2.Importer.ZaaImporter
/// <param name="text">ZAA-formatted Lauris output to import.</param>
public void Import(string text)
{
// Split the text into parargraphs. This implementation relies on the fact
// that the order or splitting strings in C#'s String.Split() method is
// important; see http://stackoverflow.com/a/8664639/270712
string[] paragraphs = text.Split(
new string[] { Environment.NewLine },
new string[] { "\r\n", "\n\r", "\r", "\n" },
StringSplitOptions.RemoveEmptyEntries);
int i = 0;
int start = 0;
int numParagraphs = paragraphs.Length;
LaurisTimePoint timePoint = null;
while (i < numParagraphs)
foreach (string paragraph in paragraphs)
{
// Search for the next occurrence of a time stamp line
while (i < numParagraphs
&& !LaurisTimePoint.IsTimeStampLine(paragraphs[i]))
// If the current paragraph looks like a Lauris time stamp,
// create a new time point.
if (LaurisTimePoint.IsTimeStampLine(paragraph))
{
i++;
timePoint = new LaurisTimePoint(paragraph, _parameters, _units);
// Add the time point to the laboratory only if none
// with the same time stamp exists yet.
TimePoint existing = null;
if (Laboratory.TryGetTimePoint(timePoint.TimeStamp, ref existing))
{
timePoint = existing as LaurisTimePoint;
}
// TODO: Find an alternative to returning in the middle of the method.
if (i >= numParagraphs) return;
if (LaurisTimePoint.IsTimeStampLine(paragraphs[i]))
else
{
// Remember the time stamp line's index
start = i;
// Seek the next time stamp line
while (i + 1 < numParagraphs
&& !LaurisTimePoint.IsTimeStampLine(paragraphs[i + 1]))
{
i++;
Laboratory.AddTimePoint(timePoint);
}
}
Laboratory.AddTimePoint(
new LaurisTimePoint(
paragraphs.Slice(start, i - start + 1),
_parameters,
_units
)
);
// If the current paragraph looks like a paragraph with
// laboratory items, add it to the current time point;
// if no time point exists yet, create one.
else if (LaurisParagraph.ResemblesLaurisParagraph(paragraph))
{
if (timePoint == null)
{
timePoint = new LaurisTimePoint(_parameters, _units);
Laboratory.AddTimePoint(timePoint);
}
timePoint.AddParagraph(paragraph);
}
}
}

View File

@ -123,7 +123,8 @@ namespace zaaReloaded2.LabModel
public bool HasUpperLimit { get; protected set; }
/// <summary>
/// Is true if <see cref="Value"/> is normal.
/// Is true if <see cref="Value"/> is normal. Returns true
/// if no limits and no normal value are known.
/// </summary>
public bool IsNormal
{
@ -147,7 +148,7 @@ namespace zaaReloaded2.LabModel
}
else
{
return (Value == Normal);
return String.IsNullOrEmpty(Normal) || (Value == Normal);
}
}
}
@ -205,6 +206,12 @@ namespace zaaReloaded2.LabModel
public Material Material { get; protected set; }
/// <summary>
/// Gets whether the LabItem is marked as blacklisted
/// in the thesaurus.
/// </summary>
public bool IsBlacklisted { get; protected set; }
#endregion
#region Constructors

View File

@ -66,6 +66,30 @@ namespace zaaReloaded2.LabModel
}
}
/// <summary>
/// Checks if the Laboratory contains a TimePoint with an identical
/// time stamp to the one being queried.
/// </summary>
/// <param name="timePoint">TimePoint whose time stamp to look for.</param>
/// <returns>True if a TimePoint with identical time stamp exists.</returns>
public bool HasTimePoint(TimePoint timePoint)
{
return TimePoints.ContainsKey(timePoint.TimeStamp);
}
/// <summary>
/// Looks for a TimePoint with a given timeStamp and returns
/// it as a reference parameter.
/// </summary>
/// <param name="timeStamp">Time stamp to look for.</param>
/// <param name="timePoint">Resulting TimePoint (if any).</param>
/// <returns>True if TimePoints contains a TimePoint with
/// the requested timeStamp.</returns>
public bool TryGetTimePoint(DateTime timeStamp, ref TimePoint timePoint)
{
return TimePoints.TryGetValue(timeStamp, out timePoint);
}
#endregion
}
}

View File

@ -9,9 +9,9 @@ using System.Security;
[assembly: AssemblyTitle("zaaReloaded2")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyCompany("Daniel Kraus")]
[assembly: AssemblyProduct("zaaReloaded2")]
[assembly: AssemblyCopyright("Copyright © Microsoft 2015")]
[assembly: AssemblyCopyright("Copyright © Daniel Kraus 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: InternalsVisibleTo("Tests, PublicKey=002400000480000094000000060200000024000052534131000400000100010061ecc0718277dee13e7dae2dad33787a981c9883ba80a659bebbdbec76563e201a7a3a6a5852e01bb5eb328d24d5889244b4626da9af9f93db663565441a3120e3985789e6f2a39289f4eed063725b84152cbef472d9dd2f7495f51dad6c91f4dc6fb7c72cb6bd9381335ac9878ec0a6369e880f35b8eca3063e16468d7704eb")]

View File

@ -25,9 +25,10 @@ namespace zaaReloaded2.Properties {
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public global::zaaReloaded2.Controller.SettingsRepository SettingsRepository {
[global::System.Configuration.DefaultSettingValueAttribute("")]
public string SettingsRepository {
get {
return ((global::zaaReloaded2.Controller.SettingsRepository)(this["SettingsRepository"]));
return ((string)(this["SettingsRepository"]));
}
set {
this["SettingsRepository"] = value;
@ -126,111 +127,90 @@ namespace zaaReloaded2.Properties {
}
}
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("Klinische Chemie: Na, K, Cl, Mg, Pi, Alb, Prot, LDH, Hsre")]
public string DefaultItemsClinicalChem {
[global::System.Configuration.DefaultSettingValueAttribute("00000000-0000-0000-0000-000000000000")]
public global::System.Guid LastSettings {
get {
return ((string)(this["DefaultItemsClinicalChem"]));
return ((global::System.Guid)(this["LastSettings"]));
}
set {
this["LastSettings"] = value;
}
}
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("Hämatologie: Hb, Hkt, Reti, Leu, Thr, Neu, HbA1c")]
public string DefaultItemsHematology {
[global::System.Configuration.DefaultSettingValueAttribute("zaaReloaded2-Laborwerte")]
public string StyleParagraph {
get {
return ((string)(this["DefaultItemsHematology"]));
return ((string)(this["StyleParagraph"]));
}
}
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("Gerinnung: Quick, INR, PTT, Fibrinogen, ATIII, Anti-Xa")]
public string DefaultItemsCoagulation {
[global::System.Configuration.DefaultSettingValueAttribute("IfSpecialOrAbnormal")]
public global::zaaReloaded2.Formatter.ReferenceStyle ReferenceStyle {
get {
return ((string)(this["DefaultItemsCoagulation"]));
return ((global::zaaReloaded2.Formatter.ReferenceStyle)(this["ReferenceStyle"]));
}
}
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("Spot-Urin: U-*")]
public string DefaultItemsSpotUrine {
[global::System.Configuration.DefaultSettingValueAttribute("Ausgabe-Elemente")]
public string FormatElementLabel {
get {
return ((string)(this["DefaultItemsSpotUrine"]));
return ((string)(this["FormatElementLabel"]));
}
}
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("Sammelurin: SU-*")]
public string DefaultItemsCollectedUrine {
[global::System.Configuration.DefaultSettingValueAttribute("Steuerungs-Elemente")]
public string ControlElementLabel {
get {
return ((string)(this["DefaultItemsCollectedUrine"]));
return ((string)(this["ControlElementLabel"]));
}
}
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("Weitere Werte: *")]
public string DefaultItemsOther {
[global::System.Configuration.DefaultSettingValueAttribute("1")]
public int SerializationVersion {
get {
return ((string)(this["DefaultItemsOther"]));
return ((int)(this["SerializationVersion"]));
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("")]
public string ImportExportPath {
get {
return ((string)(this["ImportExportPath"]));
}
set {
this["ImportExportPath"] = value;
}
}
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("Kardiale Marker: CK, CKMB, Trop, NTproBNP")]
public string DefaultItemsCardio {
[global::System.Configuration.DefaultSettingValueAttribute("zaaReloaded2-Überschrift")]
public string StyleHeader {
get {
return ((string)(this["DefaultItemsCardio"]));
return ((string)(this["StyleHeader"]));
}
}
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("Blutfette: TG, Chol, LDL, HDL, Lp(a)")]
public string DefaultItemsLipids {
[global::System.Configuration.DefaultSettingValueAttribute("zaaReloaded2-Pathologisch")]
public string StyleAbnormal {
get {
return ((string)(this["DefaultItemsLipids"]));
}
}
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("Leber: GOT, GGT, GPT, AP, Bili, CHE")]
public string DefaultItemsLiver {
get {
return ((string)(this["DefaultItemsLiver"]));
}
}
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("Niere: Krea, Hst, eGFR")]
public string DefaultItemsKidney {
get {
return ((string)(this["DefaultItemsKidney"]));
}
}
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("Entzündung/Immunsystem: CRP, Pct, C3, C4")]
public string DefaultItemsInflammation {
get {
return ((string)(this["DefaultItemsInflammation"]));
}
}
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("Medikamente: TAC, CSA, SIR, Vancomycin, Gentamicin, Tobramicin")]
public string DefaultItemsDrugs {
get {
return ((string)(this["DefaultItemsDrugs"]));
return ((string)(this["StyleAbnormal"]));
}
}
}

Some files were not shown because too many files have changed in this diff Show More