88 lines
2.7 KiB
C#
88 lines
2.7 KiB
C#
using System.ComponentModel.DataAnnotations;
|
|
using System.Text.Json.Serialization;
|
|
|
|
namespace HealthApp.Contracts;
|
|
|
|
[JsonUnmappedMemberHandling(JsonUnmappedMemberHandling.Disallow)]
|
|
public sealed record MeasurementContextPatch
|
|
{
|
|
private string? setting;
|
|
[AllowedValues("Home", "Clinic", "Other", "Unknown", null)]
|
|
public string? Setting
|
|
{
|
|
get => setting;
|
|
init { setting = value; SettingSpecified = true; }
|
|
}
|
|
[JsonIgnore]
|
|
public bool SettingSpecified { get; private set; }
|
|
|
|
private string? activityCondition;
|
|
[AllowedValues("AtRest", "DuringActivity", "AfterActivity", "Unknown", null)]
|
|
public string? ActivityCondition
|
|
{
|
|
get => activityCondition;
|
|
init { activityCondition = value; ActivityConditionSpecified = true; }
|
|
}
|
|
[JsonIgnore]
|
|
public bool ActivityConditionSpecified { get; private set; }
|
|
|
|
private decimal? restDurationMinutes;
|
|
[Range(0, double.MaxValue)]
|
|
public decimal? RestDurationMinutes
|
|
{
|
|
get => restDurationMinutes;
|
|
init { restDurationMinutes = value; RestDurationMinutesSpecified = true; }
|
|
}
|
|
[JsonIgnore]
|
|
public bool RestDurationMinutesSpecified { get; private set; }
|
|
|
|
private string? bodyPosition;
|
|
public string? BodyPosition
|
|
{
|
|
get => bodyPosition;
|
|
init { bodyPosition = value; BodyPositionSpecified = true; }
|
|
}
|
|
[JsonIgnore]
|
|
public bool BodyPositionSpecified { get; private set; }
|
|
|
|
private string? measuredArm;
|
|
public string? MeasuredArm
|
|
{
|
|
get => measuredArm;
|
|
init { measuredArm = value; MeasuredArmSpecified = true; }
|
|
}
|
|
[JsonIgnore]
|
|
public bool MeasuredArmSpecified { get; private set; }
|
|
|
|
private string? deviceDetails;
|
|
public string? DeviceDetails
|
|
{
|
|
get => deviceDetails;
|
|
init { deviceDetails = value; DeviceDetailsSpecified = true; }
|
|
}
|
|
[JsonIgnore]
|
|
public bool DeviceDetailsSpecified { get; private set; }
|
|
|
|
private string? cuffDetails;
|
|
public string? CuffDetails
|
|
{
|
|
get => cuffDetails;
|
|
init { cuffDetails = value; CuffDetailsSpecified = true; }
|
|
}
|
|
[JsonIgnore]
|
|
public bool CuffDetailsSpecified { get; private set; }
|
|
|
|
private string? additionalCircumstances;
|
|
public string? AdditionalCircumstances
|
|
{
|
|
get => additionalCircumstances;
|
|
init { additionalCircumstances = value; AdditionalCircumstancesSpecified = true; }
|
|
}
|
|
[JsonIgnore]
|
|
public bool AdditionalCircumstancesSpecified { get; private set; }
|
|
|
|
[JsonIgnore]
|
|
public bool HasChanges => SettingSpecified || ActivityConditionSpecified || RestDurationMinutesSpecified ||
|
|
BodyPositionSpecified || MeasuredArmSpecified || DeviceDetailsSpecified || CuffDetailsSpecified || AdditionalCircumstancesSpecified;
|
|
}
|