From 4c3198afcee578a793c76289274118419302e188 Mon Sep 17 00:00:00 2001 From: Daniel Kraus Date: Fri, 22 Sep 2017 11:48:40 +0200 Subject: [PATCH 1/7] Add ability to suppress an item's label. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Verbessert: Für bestimmte Parameter kann die Beschriftung unterdrückt werden (derzeit implementiert im Urin-Hygienebefund, wo "Keim" und "Multiresistenz" nicht mit ausgegeben werden, sondern nur z.B. "E. coli, 3MRGN" bei entsprechender Vorlage "MSU-Keim, MSU-Multiresistenz"). --- Tests/Thesaurus/ParametersTest.cs | 6 ++++++ zaaReloaded2/Defaults/parameters.txt | 8 ++++---- zaaReloaded2/Formatter/ItemFormatter.cs | 19 ++++++++++++++++--- .../Importer/ZaaImporter/LaurisItem.cs | 1 + zaaReloaded2/LabModel/LabItem.cs | 5 +++++ zaaReloaded2/Thesaurus/Parameters.cs | 13 +++++++++++++ 6 files changed, 45 insertions(+), 7 deletions(-) diff --git a/Tests/Thesaurus/ParametersTest.cs b/Tests/Thesaurus/ParametersTest.cs index 10a823f..1788da2 100755 --- a/Tests/Thesaurus/ParametersTest.cs +++ b/Tests/Thesaurus/ParametersTest.cs @@ -52,5 +52,11 @@ namespace Tests.Thesaurus { Assert.IsTrue(Parameters.Default.GetIsBlacklisted("glomerul. Filtrationsr. (MDRD)")); } + + [Test] + public void GetSuppressLabel() + { + Assert.IsTrue(Parameters.Default.GetSuppressLabel("- Multiresistenz")); + } } } diff --git a/zaaReloaded2/Defaults/parameters.txt b/zaaReloaded2/Defaults/parameters.txt index 06bec8c..da6388d 100755 --- a/zaaReloaded2/Defaults/parameters.txt +++ b/zaaReloaded2/Defaults/parameters.txt @@ -1,9 +1,9 @@ -# LAURIS-NAME "KANONISCHER NAME" MATERIAL DEZIMALSTELLEN "IMMER REFERENZBEREICH" "BLACKLIST" -# =========== ================== ======== ============== ======================= =========== -"- Multiresistenz" Multiresistenz MSU +# LAURIS-NAME "KANONISCHER NAME" MATERIAL DEZIMALSTELLEN "IMMER REFERENZBEREICH" "BLACKLIST" "NO-LABEL" +# =========== ================== ======== ============== ======================= =========== ========== +"- Multiresistenz" Multiresistenz MSU --- --- --- X "a1-Microglobulin (SU)" a1-Microglobulin SU "a1-Microglobulin (SU)/die" a1-Microglobulin SU -"Aerobe Kultur" Keim MSU +"Aerobe Kultur" Keim MSU --- --- --- X "AFP (ECL, Elecsys, Roche)" AFP S --- X "aktuelles Bicarbonat" Bic BGA Albumin Alb S diff --git a/zaaReloaded2/Formatter/ItemFormatter.cs b/zaaReloaded2/Formatter/ItemFormatter.cs index baa76a9..4e992e9 100755 --- a/zaaReloaded2/Formatter/ItemFormatter.cs +++ b/zaaReloaded2/Formatter/ItemFormatter.cs @@ -76,6 +76,11 @@ namespace zaaReloaded2.Formatter /// public bool IsBlacklisted { get { return LabItem.IsBlacklisted; } } + /// + /// Gets whether the Item is marked to suppress its label in the thesaurus. + /// + public bool SuppressLabel { get { return LabItem.SuppressLabel; } } + /// /// Gets or sets the item's comment. /// @@ -194,12 +199,20 @@ namespace zaaReloaded2.Formatter if (comment != String.Empty) comment = " " + comment; } - string name = IncludeMaterial ? LabItem.QualifiedName : LabItem.Name; + string name; + if (LabItem.SuppressLabel) + { + name = String.Empty; + } + else + { + name = (IncludeMaterial ? LabItem.QualifiedName : LabItem.Name) + " "; + } - string output = + string output = String.Format( - "{0} {1}{2}{3}{4}", + "{0}{1}{2}{3}{4}", name, value, unit, diff --git a/zaaReloaded2/Importer/ZaaImporter/LaurisItem.cs b/zaaReloaded2/Importer/ZaaImporter/LaurisItem.cs index 15b9d50..8abbfe2 100755 --- a/zaaReloaded2/Importer/ZaaImporter/LaurisItem.cs +++ b/zaaReloaded2/Importer/ZaaImporter/LaurisItem.cs @@ -76,6 +76,7 @@ namespace zaaReloaded2.Importer.ZaaImporter Name = parameterDictionary.GetCanonicalName(OriginalName); AlwaysPrintLimits = parameterDictionary.GetForceReferenceDisplay(OriginalName); IsBlacklisted = parameterDictionary.GetIsBlacklisted(OriginalName); + SuppressLabel = parameterDictionary.GetSuppressLabel(OriginalName); Material = parameterDictionary.GetMaterial(OriginalName, Material); PreferredPrecision = parameterDictionary.GetPrecision(OriginalName); } diff --git a/zaaReloaded2/LabModel/LabItem.cs b/zaaReloaded2/LabModel/LabItem.cs index b8f8b67..fe80660 100755 --- a/zaaReloaded2/LabModel/LabItem.cs +++ b/zaaReloaded2/LabModel/LabItem.cs @@ -230,6 +230,11 @@ namespace zaaReloaded2.LabModel /// public bool IsBlacklisted { get; protected set; } + /// + /// Gets whether the item's label should be suppressed. + /// + public bool SuppressLabel { get; protected set; } + #endregion #region Constructors diff --git a/zaaReloaded2/Thesaurus/Parameters.cs b/zaaReloaded2/Thesaurus/Parameters.cs index f83b57e..65cf23d 100755 --- a/zaaReloaded2/Thesaurus/Parameters.cs +++ b/zaaReloaded2/Thesaurus/Parameters.cs @@ -126,6 +126,19 @@ namespace zaaReloaded2.Thesaurus { return LookUpValue(laurisName, 5, false); } + + /// + /// Checks whether an item's label should be suppressed or not. + /// + /// Laboratory item to lok up; + /// this must be an original Lauris string. + /// True if the item should *not* be labelled, + /// false if not. Default is false (i.e., labels are . + public bool GetSuppressLabel(string laurisName) + { + return LookUpValue(laurisName, 6, false); + } + #endregion #region Overrides From 253a7f24f5c52e7eb5d4a63e4397289420794754 Mon Sep 17 00:00:00 2001 From: Daniel Kraus Date: Fri, 22 Sep 2017 17:03:32 +0200 Subject: [PATCH 2/7] Fix importing of styles. - Repariert: Stile konnten nicht importiert werden. --- zaaReloaded2/Controller/Settings.cs | 7 ++-- .../ViewModels/SettingsRepositoryViewModel.cs | 35 +++++++++++++++---- 2 files changed, 33 insertions(+), 9 deletions(-) diff --git a/zaaReloaded2/Controller/Settings.cs b/zaaReloaded2/Controller/Settings.cs index c3b27c0..937935b 100755 --- a/zaaReloaded2/Controller/Settings.cs +++ b/zaaReloaded2/Controller/Settings.cs @@ -66,7 +66,9 @@ namespace zaaReloaded2.Controller { throw new InvalidDataException("Datei enthält keine Stil-Daten oder ist beschädigt."); } + Logger.Info("LoadFromFile: Successfully loaded '{0}", settings.Name); settings.Uid = Guid.NewGuid(); + Logger.Debug("LoadFromFile: new GUID is '{0}", settings.Uid); return settings; } @@ -76,14 +78,15 @@ namespace zaaReloaded2.Controller /// File to write to. public void SaveToFile(string fileName) { - Logger.Info("SaveToFile: {0}", fileName); + Logger.Info("SaveToFile: Settings name: {0}", Name); using (StreamWriter writer = new StreamWriter(fileName)) { Serializer serializer = new SerializerBuilder() - //.EnsureRoundtrip() + .EnsureRoundtrip() .Build(); serializer.Serialize(writer, this); } + Logger.Info("SaveToFile: Successfully saved to file '{0}'", fileName); // SoapFormatter formatter = new SoapFormatter(); // formatter.Serialize(writer.BaseStream, this); } diff --git a/zaaReloaded2/ViewModels/SettingsRepositoryViewModel.cs b/zaaReloaded2/ViewModels/SettingsRepositoryViewModel.cs index ac59a97..e225497 100755 --- a/zaaReloaded2/ViewModels/SettingsRepositoryViewModel.cs +++ b/zaaReloaded2/ViewModels/SettingsRepositoryViewModel.cs @@ -431,7 +431,7 @@ namespace zaaReloaded2.ViewModels if (CanExportSettings()) { ChooseExportFileNameMessage.Send( - new FileNameMessageContent(SuggestImportExportPath(), FILE_FILTER), + new FileNameMessageContent(SuggestExportPath(), FILE_FILTER), msg => ConfirmExportSettings(msg)); } } @@ -445,11 +445,11 @@ namespace zaaReloaded2.ViewModels { if (message.Confirmed) { - UserSettings.Default.ImportExportPath = message.Value; + SaveImportExportDir(message.Value); Settings settings = LastSelected.RevealModelObject() as Settings; try { - settings.SaveToFile(message.Value); + settings.SaveToFile(message.Value); } catch (Exception e) { @@ -463,7 +463,7 @@ namespace zaaReloaded2.ViewModels void DoImportSettings() { ChooseImportFileNameMessage.Send( - new FileNameMessageContent(SuggestImportExportPath(), FILE_FILTER), + new FileNameMessageContent(SuggestImportPath(), FILE_FILTER), msg => ConfirmImportSettings(msg)); } @@ -476,10 +476,19 @@ namespace zaaReloaded2.ViewModels { if (message.Confirmed) { - UserSettings.Default.ImportExportPath = message.Value; + SaveImportExportDir(message.Value); try { Settings settings = Settings.LoadFromFile(message.Value); + // Attempt to find a unique name by adding a suffix, if necessary + string suffixedName = settings.Name; + while (_repository.SettingsList.FirstOrDefault(s => s.Name == suffixedName) != null) + { + string suffix = System.DateTime.Now.ToString(); + suffixedName = String.Format("{0} ({1})", settings.Name, suffix); + } + settings.Name = suffixedName; + _repository.SettingsList.Add(settings); AddSettingsViewModel(new SettingsViewModel(settings)); } catch (Exception e) @@ -491,9 +500,9 @@ namespace zaaReloaded2.ViewModels } } - string SuggestImportExportPath() + string SuggestImportPath() { - string path = UserSettings.Default.ImportExportPath; + string path = Bovender.PathHelpers.GetDirectoryPart(UserSettings.Default.ImportExportPath); if (String.IsNullOrEmpty(path)) { return Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); @@ -504,6 +513,18 @@ namespace zaaReloaded2.ViewModels } } + string SuggestExportPath() + { + Settings settings = LastSelected.RevealModelObject() as Settings; + string fileName = settings.Name; + return System.IO.Path.Combine(SuggestImportPath(), fileName); + } + + void SaveImportExportDir(string path) + { + UserSettings.Default.ImportExportPath = Bovender.PathHelpers.GetDirectoryPart(path); + } + #endregion #region Implementation of ViewModelBase From 1a49eb18e11c654b956f3f741500ba2bbe16a0c9 Mon Sep 17 00:00:00 2001 From: Daniel Kraus Date: Fri, 22 Sep 2017 17:29:59 +0200 Subject: [PATCH 3/7] Fix settings repository UI. - Verbessert: Benutzer-Interface der Stile-Verwaltung. --- zaaReloaded2/Ribbon.xml | 2 +- zaaReloaded2/ViewModels/SettingsRepositoryViewModel.cs | 7 +++++++ zaaReloaded2/Views/SettingsRepositoryView.xaml | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/zaaReloaded2/Ribbon.xml b/zaaReloaded2/Ribbon.xml index 1021a52..eb0425a 100755 --- a/zaaReloaded2/Ribbon.xml +++ b/zaaReloaded2/Ribbon.xml @@ -27,7 +27,7 @@ From 24dc95f7a8a2a3580c10276e1789637db78b62df Mon Sep 17 00:00:00 2001 From: Daniel Kraus Date: Thu, 28 Sep 2017 11:24:11 +0200 Subject: [PATCH 4/7] Upload symlinked files into downloads dir as well. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 180cf48..f2a89b3 100644 --- a/Makefile +++ b/Makefile @@ -23,7 +23,7 @@ versioninfo: mv www/versioninfo.tmp www/versioninfo.txt upload: - rsync -ruvz --progress deploy/releases/* bovender.de:/var/www/html/zaareloaded/downloads/ + rsync -ruvzL --progress deploy/releases/* bovender.de:/var/www/html/zaareloaded/downloads/ website: rsync -ruvz www/ bovender.de:/var/www/html/zaareloaded/ From b7cda4c9a7c439d962cc822def8468483e367b1e Mon Sep 17 00:00:00 2001 From: Daniel Kraus Date: Fri, 29 Sep 2017 06:07:36 +0200 Subject: [PATCH 5/7] Accept clinic-system time stamps with lab data. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Geändert: Wenn das Laborsystem Zeitstempel ausgibt, die in derselben Zeile auch noch einen Laborwert enthalten, wird das jetzt korrekt erkannt. --- zaaReloaded2/Importer/AutoDetector.cs | 18 +++++++++--------- .../Importer/ClinicImporter/ClinicTimePoint.cs | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/zaaReloaded2/Importer/AutoDetector.cs b/zaaReloaded2/Importer/AutoDetector.cs index 17fafac..b8bc168 100755 --- a/zaaReloaded2/Importer/AutoDetector.cs +++ b/zaaReloaded2/Importer/AutoDetector.cs @@ -175,15 +175,15 @@ namespace zaaReloaded2.Importer string text = paragraph.Range.Text; bool isCinicTimePoint = ClinicTimePoint.IsTimeStampLine(text); bool isZaaTimePoint = LaurisTimePoint.IsTimeStampLine(text); - // If the line is a ZAA time point, but not a clinic timepoint, we can deduct that - // the lab mode *must* be ZAA, because it will be a line in the form - // "(17.09.2015-201710:44:00) Cyclosporin-A vor Gabe: 130 µg/l;" which does not - // occur in the clinic format. - if ((ImportMode == ImportMode.Undefined) && isZaaTimePoint && !isCinicTimePoint) - { - Logger.Info("IsTimeStampParagraph: Found ZAA time stamp, setting mode to ZAA"); - ImportMode = ImportMode.Zaa; - } + // // If the line is a ZAA time point, but not a clinic timepoint, we can deduct that + // // the lab mode *must* be ZAA, because it will be a line in the form + // // "(17.09.2015-201710:44:00) Cyclosporin-A vor Gabe: 130 µg/l;" which does not + // // occur in the clinic format. + // if ((ImportMode == ImportMode.Undefined) && isZaaTimePoint && !isCinicTimePoint) + // { + // Logger.Info("IsTimeStampParagraph: Found ZAA time stamp, setting mode to ZAA"); + // ImportMode = ImportMode.Zaa; + // } return isCinicTimePoint || isZaaTimePoint; } diff --git a/zaaReloaded2/Importer/ClinicImporter/ClinicTimePoint.cs b/zaaReloaded2/Importer/ClinicImporter/ClinicTimePoint.cs index 8ca5aeb..c508f71 100755 --- a/zaaReloaded2/Importer/ClinicImporter/ClinicTimePoint.cs +++ b/zaaReloaded2/Importer/ClinicImporter/ClinicTimePoint.cs @@ -240,7 +240,7 @@ namespace zaaReloaded2.Importer.ClinicImporter /// paragraph of a LaurisText. /// static readonly Regex _timeStampRegex = new Regex( - @"^(Labor:?)?\s*\(?\s*(?\d\d\.\d\d\.\d\d\d\d\s+\d\d:\d\d)(:00)?\)\s*$"); + @"^(Labor:?)?\s*\(?\s*(?\d\d\.\d\d\.\d\d\d\d\s+\d\d:\d\d)(:00)?\)"); IList _lines; Parameters _parameterDictionary; Units _unitDictionary; From de9d6b3095d25eafc2246b2d2ab790b3310e9bad Mon Sep 17 00:00:00 2001 From: Daniel Kraus Date: Fri, 29 Sep 2017 06:10:47 +0200 Subject: [PATCH 6/7] Upate default clinic style to include MSU. - Verbessert: Der Standard-Ambulanzstil gibt jetzt auch den MSU-Befund mit aus (sofern vorhanden). --- zaaReloaded2/Defaults/clinic.zaaReloaded2 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/zaaReloaded2/Defaults/clinic.zaaReloaded2 b/zaaReloaded2/Defaults/clinic.zaaReloaded2 index 69cdcc1..2ceb29d 100755 --- a/zaaReloaded2/Defaults/clinic.zaaReloaded2 +++ b/zaaReloaded2/Defaults/clinic.zaaReloaded2 @@ -48,4 +48,6 @@ Elements: !System.Collections.Generic.List%601[[zaaReloaded2.Controller.Elements Content: 'Virologie (EDTA-Blut): CMV-PCR, BKV-PCR' - !zaaReloaded2.Controller.Elements.CustomText,%20zaaReloaded2,%20Version=1.0.0.0,%20Culture=neutral,%20PublicKeyToken=6ec8d075a1ab1383 Content: 'Autoantikörper: ANCA (IF) 1: (Ref. < 1:40), MPO-ANCA (ELISA) IU/ml (Ref. < 9), PR3-ANCA (ELISA) IU/ml (Ref. < 3,5), ANA (IF), AnDNA (ELISA), AnDNA (RIA)' -Uid: 99b44ee9-2858-4651-84ad-eb7980832352 + - !zaaReloaded2.Controller.Elements.Items,%20zaaReloaded2,%20Version=1.0.0.0,%20Culture=neutral,%20PublicKeyToken=6ec8d075a1ab1383 + Content: 'MSU: MSU-Keim, MSU-Multiresistenz' +Uid: 581d378c-8f7a-4a1c-8490-36e257770a09 From bc041d4288b8ec83671cc9fa9b851f6c9d96ea62 Mon Sep 17 00:00:00 2001 From: Daniel Kraus Date: Fri, 29 Sep 2017 06:13:29 +0200 Subject: [PATCH 7/7] Prepare release 2.4.2. --- HISTORY.md | 12 ++++++++++++ www/versioninfo.txt | 4 ++-- zaaReloaded2/VERSION | 4 ++-- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index eff1139..5ba12a4 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,3 +1,15 @@ +Version 2.4.2 (2017-09-29) +------------------------------------------------------------------------ + +- Geändert: Wenn das Laborsystem Zeitstempel ausgibt, die in derselben Zeile auch noch einen Laborwert enthalten, wird das jetzt korrekt erkannt. +- Repariert: Stile konnten nicht importiert werden. +- Verbessert: Benutzer-Interface der Stile-Verwaltung. +- Verbessert: Der Standard-Ambulanzstil gibt jetzt auch den MSU-Befund mit aus (sofern vorhanden). +- Verbessert: Für bestimmte Parameter kann die Beschriftung unterdrückt werden (derzeit implementiert im Urin-Hygienebefund, wo "Keim" und "Multiresistenz" nicht mit ausgegeben werden, sondern nur z.B. "E. coli, 3MRGN" bei entsprechender Vorlage "MSU-Keim, MSU-Multiresistenz"). + +* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + + Version 2.4.1 (2017-09-21) ------------------------------------------------------------------------ diff --git a/www/versioninfo.txt b/www/versioninfo.txt index bca10f4..84827ef 100644 --- a/www/versioninfo.txt +++ b/www/versioninfo.txt @@ -1,4 +1,4 @@ -2.4.1 +2.4.2 https://doktorkraus.de/zaareloaded/downloads/zaaReloaded-$VERSION.exe -b98ec2c5ad39dc4d54c97599f32634f8a41636eb0b0d8bf10c6d1c520e260e8b deploy/releases/zaaReloaded-2.4.1.exe +2df8d1cd62b2a6b422099e6d59c8f2022ddd2177a649784a7cab8f7c23e734e2 deploy/releases/zaaReloaded-2.4.2.exe diff --git a/zaaReloaded2/VERSION b/zaaReloaded2/VERSION index dea618d..e221776 100755 --- a/zaaReloaded2/VERSION +++ b/zaaReloaded2/VERSION @@ -1,2 +1,2 @@ -2.4.1 -2.4.1.0 +2.4.2 +2.4.2.0