Implement blacklisting feature.
- NEU: Parameter können im Thesaurus als "blacklisted" markiert werden und werden dann bei Verwendung einer Wildcard ("*") nicht berücksichtigt.
			
			
This commit is contained in:
		@@ -148,7 +148,7 @@ 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);
 | 
			
		||||
                items.AddRange(newItems);
 | 
			
		||||
 
 | 
			
		||||
@@ -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;
 | 
			
		||||
        }
 | 
			
		||||
@@ -133,11 +151,13 @@ namespace zaaReloaded2.Formatter
 | 
			
		||||
                value = LabItem.Value;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            string name = IncludeMaterial ? LabItem.QualifiedName : LabItem.Name;
 | 
			
		||||
 | 
			
		||||
            // Insert the formatted text into the document.
 | 
			
		||||
            formatter.Write(
 | 
			
		||||
                String.Format(
 | 
			
		||||
                    "{0} {1}{2}{3}",
 | 
			
		||||
                    LabItem.QualifiedName,
 | 
			
		||||
                    name,
 | 
			
		||||
                    value,
 | 
			
		||||
                    unit,
 | 
			
		||||
                    reference
 | 
			
		||||
 
 | 
			
		||||
@@ -74,7 +74,8 @@ namespace zaaReloaded2.Importer.ZaaImporter
 | 
			
		||||
            if (parameterDictionary != null)
 | 
			
		||||
            {
 | 
			
		||||
                Name = parameterDictionary.GetCanonicalName(OriginalName);
 | 
			
		||||
                AlwaysPrintLimits = parameterDictionary.GetForceReferenceDisplay(Name);
 | 
			
		||||
                AlwaysPrintLimits = parameterDictionary.GetForceReferenceDisplay(OriginalName);
 | 
			
		||||
                IsBlacklisted = parameterDictionary.GetIsBlacklisted(OriginalName);
 | 
			
		||||
            }
 | 
			
		||||
            if (unitDictionary != null)
 | 
			
		||||
            {
 | 
			
		||||
 
 | 
			
		||||
@@ -205,6 +205,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
 | 
			
		||||
 
 | 
			
		||||
@@ -1,5 +1,5 @@
 | 
			
		||||
# LAURIS-NAME                      "KANONISCHER NAME"   MATERIAL   "IMMER REFERENZBEREICH"
 | 
			
		||||
# ===========                      ==================   ========   =======================
 | 
			
		||||
# 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
 | 
			
		||||
@@ -28,8 +28,8 @@ CK gesamt"                         CK                   S
 | 
			
		||||
"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
 | 
			
		||||
"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
 | 
			
		||||
@@ -43,7 +43,7 @@ Gesamt-Eiweiss                     Protein              S
 | 
			
		||||
"Gesamt-Eiweiss/Creatinin (PU)"    TPCR                 U
 | 
			
		||||
GGT                                GGT                  S
 | 
			
		||||
"glomeruläre Filtrationsrate"      GFR                  SU
 | 
			
		||||
"glomerul. Filtrationsr. (MDRD)"   "eGFR (MDRD)"        S
 | 
			
		||||
"glomerul. Filtrationsr. (MDRD)"   "eGFR (MDRD)"        S                   ---         X
 | 
			
		||||
"glomerul. Filtrationsr. CKD-EP"   "eGFR (CKD-EPI)"     S
 | 
			
		||||
"Glucose (U)"                      Glukose              U
 | 
			
		||||
Glucose                            Glukose              S
 | 
			
		||||
@@ -51,7 +51,7 @@ Glucose                            Glukose              S
 | 
			
		||||
"GPT (ALAT)"                       GPT                  S
 | 
			
		||||
Hämatokrit                         Hkt                  E
 | 
			
		||||
Hämoglobin                         Hb                   E
 | 
			
		||||
Haptoglobin                        Haptoglobin          S      X
 | 
			
		||||
Haptoglobin                        Haptoglobin          S                   X
 | 
			
		||||
Harnsäure                          Harnsäure            S
 | 
			
		||||
"Harnstoff (SU)"                   Hst                  SU
 | 
			
		||||
"Harnstoff (SU)/die"               Hst/Tag              SU
 | 
			
		||||
@@ -104,8 +104,8 @@ Unreife Granulozyten"              Gran                 E
 | 
			
		||||
"Thromboplastinzeit n. Quick"      Quick                Z
 | 
			
		||||
PTT                                aPTT                 Z
 | 
			
		||||
"Ratio int. norm."                 INR                  Z
 | 
			
		||||
"Komplementfaktor C3c"             C3c                  S     X
 | 
			
		||||
"Komplementfaktor C4"              C4                   S     X
 | 
			
		||||
"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
 | 
			
		||||
 
 | 
			
		||||
@@ -95,6 +95,18 @@ namespace zaaReloaded2.Thesaurus
 | 
			
		||||
            return LookUpValue(laurisName, 3, false);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        /// <summary>
 | 
			
		||||
        /// Checks whether an item is marked as blacklisted in the
 | 
			
		||||
        /// thesaurus.
 | 
			
		||||
        /// </summary>
 | 
			
		||||
        /// <param name="laurisName">Laboratory item to lok up;
 | 
			
		||||
        /// this must be an original Lauris string.</param>
 | 
			
		||||
        /// <returns>True if the item is marked as blacklisted,
 | 
			
		||||
        /// false if not. Default is false.</returns>
 | 
			
		||||
        public bool GetIsBlacklisted(string laurisName)
 | 
			
		||||
        {
 | 
			
		||||
            return LookUpValue(laurisName, 4, false);
 | 
			
		||||
        }
 | 
			
		||||
        #endregion
 | 
			
		||||
 | 
			
		||||
        #region Overrides
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user