Enable verbose molar units (mmol/l instead of mM).
- Verbessert: Benutzeroption für die Ausgabe von "mmol/l" anstatt "mM" (einstellbar pro Stil).
This commit is contained in:
@ -47,6 +47,11 @@ namespace zaaReloaded2.Formatter
|
||||
/// </summary>
|
||||
public AbnormalStyle AbnormalStyle { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether to prefer the more verbose "mmol/l" over "mM".
|
||||
/// </summary>
|
||||
public bool PreferVerboseMolar { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a flag that indicates whether this ItemFormatter
|
||||
/// has been used, i.e. whether the LabItem was written to a
|
||||
@ -86,12 +91,14 @@ namespace zaaReloaded2.Formatter
|
||||
/// <param name="labItem">LabItem to wrap in this ItemFormatter.</param>
|
||||
public ItemFormatter(LabItem labItem,
|
||||
ReferenceStyle referenceStyle,
|
||||
AbnormalStyle abnormalStyle)
|
||||
AbnormalStyle abnormalStyle,
|
||||
bool preferVerboseMolar)
|
||||
{
|
||||
IncludeMaterial = true;
|
||||
LabItem = labItem;
|
||||
ReferenceStyle = referenceStyle;
|
||||
AbnormalStyle = abnormalStyle;
|
||||
PreferVerboseMolar = preferVerboseMolar;
|
||||
}
|
||||
|
||||
#endregion
|
||||
@ -147,7 +154,12 @@ namespace zaaReloaded2.Formatter
|
||||
if (LabItem.HasUnit)
|
||||
{
|
||||
string space = LabItem.Unit.StartsWith("/") ? String.Empty : " ";
|
||||
unit = String.Format("{0}{1}", space, LabItem.Unit);
|
||||
unit = LabItem.Unit;
|
||||
if (PreferVerboseMolar)
|
||||
{
|
||||
unit = LabItem.Unit.Replace("mM", "mmol/l");
|
||||
}
|
||||
unit = String.Format("{0}{1}", space, unit);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Reference in New Issue
Block a user