rama creada apartir de master en j
This commit is contained in:
@@ -1,16 +1,25 @@
|
||||
namespace adas_core.Domain.Models.Observations;
|
||||
|
||||
/// <summary>
|
||||
/// Represents an observation that conveys a boolean value, extending the base <see cref="Observation"/> type.
|
||||
/// </summary>
|
||||
public class BoolObservation : Observation
|
||||
{
|
||||
public bool Value { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Creates a <see cref="BoolObservation"/> from the first item in the provided list of patient observations.
|
||||
/// Returns <see langword="null"/> when the list is empty.
|
||||
/// </summary>
|
||||
/// <param name="obs">The list of patient observations from which the first entry is converted.</param>
|
||||
/// <returns>A <see cref="BoolObservation"/> containing the boolean value of the first observation, or <see langword="null"/> if the list contains no observations.</returns>
|
||||
internal static BoolObservation? From(List<PatientObservation> obs)
|
||||
{
|
||||
if (obs.Count > 0)
|
||||
return new BoolObservation
|
||||
{
|
||||
Value = (bool)obs[0].Value
|
||||
};
|
||||
return null;
|
||||
}
|
||||
{
|
||||
if (obs.Count > 0)
|
||||
return new BoolObservation
|
||||
{
|
||||
Value = (bool)obs[0].Value
|
||||
};
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user