Fix material convertsion and units detection.
This commit is contained in:
parent
6c9f003134
commit
947b53cf97
@ -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
|
||||
|
@ -139,7 +139,6 @@ namespace zaaReloaded2.Controller.Elements
|
||||
{
|
||||
items.AddRange(CollectByName(formatter, itemName));
|
||||
}
|
||||
|
||||
}
|
||||
return items;
|
||||
}
|
||||
@ -158,6 +157,9 @@ namespace zaaReloaded2.Controller.Elements
|
||||
.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;
|
||||
|
@ -76,6 +76,7 @@ namespace zaaReloaded2.Importer.ZaaImporter
|
||||
Name = parameterDictionary.GetCanonicalName(OriginalName);
|
||||
AlwaysPrintLimits = parameterDictionary.GetForceReferenceDisplay(OriginalName);
|
||||
IsBlacklisted = parameterDictionary.GetIsBlacklisted(OriginalName);
|
||||
Material = parameterDictionary.GetMaterial(OriginalName, Material);
|
||||
}
|
||||
if (unitDictionary != null)
|
||||
{
|
||||
@ -165,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)
|
||||
|
@ -2,7 +2,8 @@
|
||||
# ============== ====================
|
||||
# WICHTIG: Nur direkt austauschbare Einheiten verwenden,
|
||||
# weil (bislang) keine Umrechnung der Werte vorgesehen ist!
|
||||
"ml/min/ 1,73qm" "ml/min/1,73 m²"
|
||||
"ml/min /1,73qm" "ml/min/1,73 m²"
|
||||
ng/ml µg/l
|
||||
mmol/l mM
|
||||
n*1000/µl /nl
|
||||
n*1000/µl /nl
|
||||
Bak/µl /µl
|
||||
|
@ -69,16 +69,23 @@ namespace zaaReloaded2.Thesaurus
|
||||
/// <param name="laurisName">Lauris item name to look up.</param>
|
||||
/// <returns><see cref="zaaReloaded2.LabModel.Material"/> enum; if no material is
|
||||
/// found in the dictionary, the default material "S" (serum) is returned.</returns>
|
||||
public Material GetMaterial(string laurisName)
|
||||
public Material GetMaterial(string laurisName, Material def)
|
||||
{
|
||||
string textValue = LookUpValue(laurisName, 2);
|
||||
try
|
||||
if (String.IsNullOrEmpty(textValue))
|
||||
{
|
||||
return MaterialFactory.FromAbbreviation(textValue);
|
||||
return def;
|
||||
}
|
||||
catch
|
||||
else
|
||||
{
|
||||
return Material.B;
|
||||
try
|
||||
{
|
||||
return MaterialFactory.FromAbbreviation(textValue);
|
||||
}
|
||||
catch
|
||||
{
|
||||
return Material.B;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user