feature: In-App Simulation Runner (Backend)
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
namespace VigilCare.Simulation;
|
||||
|
||||
public class AlertExplanation
|
||||
{
|
||||
public List<ScoreContributor> ScoreContributors { get; set; } = new();
|
||||
public TrendContext? Trend { get; set; }
|
||||
public MedicationContext? MedicationContext { get; set; }
|
||||
public string NarrativeSummary { get; set; } = string.Empty;
|
||||
}
|
||||
|
||||
public class ScoreContributor
|
||||
{
|
||||
public string Parameter { get; set; } = string.Empty;
|
||||
public int Points { get; set; }
|
||||
public string? RawValue { get; set; }
|
||||
public string? NormalRange { get; set; }
|
||||
}
|
||||
|
||||
public class TrendContext
|
||||
{
|
||||
public string Parameter { get; set; } = string.Empty;
|
||||
public double PercentChange { get; set; }
|
||||
public TimeSpan Duration { get; set; }
|
||||
public string Direction { get; set; } = string.Empty;
|
||||
}
|
||||
|
||||
public class MedicationContext
|
||||
{
|
||||
public string DrugName { get; set; } = string.Empty;
|
||||
public string Dose { get; set; } = string.Empty;
|
||||
public string Route { get; set; } = string.Empty;
|
||||
public DateTimeOffset AdministeredAt { get; set; }
|
||||
public string? RelevanceNote { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
namespace VigilCare.Simulation;
|
||||
|
||||
public record AlertResponse(
|
||||
Guid Id,
|
||||
Guid EncounterId,
|
||||
Guid PatientId,
|
||||
string AlertType,
|
||||
string Severity,
|
||||
string Details,
|
||||
string Status,
|
||||
DateTimeOffset TriggeredAt,
|
||||
DateTimeOffset? AcknowledgedAt = null,
|
||||
string? AcknowledgedBy = null,
|
||||
DateTimeOffset? ResolvedAt = null,
|
||||
AlertExplanation? Explanation = null)
|
||||
{
|
||||
public string DisplaySummary =>
|
||||
string.IsNullOrWhiteSpace(Explanation?.NarrativeSummary)
|
||||
? Details
|
||||
: Explanation!.NarrativeSummary;
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
namespace VigilCare.Simulation;
|
||||
|
||||
public record ApiResponse<T>(bool Success, int StatusCode, T? Data, ApiError? Error);
|
||||
public record ApiError(string Message, string Code);
|
||||
public record PagedResponse<T>(List<T> Items, int TotalCount, int Page, int PageSize);
|
||||
@@ -0,0 +1,3 @@
|
||||
namespace VigilCare.Simulation;
|
||||
|
||||
public record BatchIngestRequest(List<IngestObservationRequest> Observations);
|
||||
@@ -0,0 +1,5 @@
|
||||
namespace VigilCare.Simulation;
|
||||
|
||||
public record CreateMedicationAdministrationRequest(
|
||||
string DrugName, decimal Dose, string DoseUnit, string Route,
|
||||
DateTimeOffset? AdministeredAt, string AdministeredBy);
|
||||
@@ -0,0 +1,3 @@
|
||||
namespace VigilCare.Simulation;
|
||||
|
||||
public record CreateOrderRequest(string OrderType, string Description, string OrderedBy);
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace VigilCare.Simulation;
|
||||
|
||||
public record EncounterResponse(
|
||||
Guid Id, Guid PatientId, string EncounterType, string Status,
|
||||
string Department, string AttendingPhysician, string? RoomBed,
|
||||
string? AdmissionReason, DateTimeOffset AdmittedAt);
|
||||
@@ -0,0 +1,5 @@
|
||||
namespace VigilCare.Simulation;
|
||||
|
||||
public record GcsResponse(
|
||||
int EyeScore, int VerbalScore, int MotorScore,
|
||||
int TotalScore, string Classification, DateTimeOffset CalculatedAt);
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace VigilCare.Simulation;
|
||||
|
||||
|
||||
public record IngestObservationRequest(
|
||||
string ObservationCode, decimal Value, string Unit,
|
||||
string Source, DateTimeOffset RecordedAt, string? IdempotencyKey);
|
||||
@@ -0,0 +1,11 @@
|
||||
namespace VigilCare.Simulation;
|
||||
|
||||
public record SimLoginRequest(string Username, string Password);
|
||||
|
||||
public record SimLoginResponse(
|
||||
string AccessToken,
|
||||
DateTimeOffset ExpiresAt,
|
||||
Guid UserId,
|
||||
string Username,
|
||||
string DisplayName,
|
||||
string Role);
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace VigilCare.Simulation;
|
||||
|
||||
public record News2Response(
|
||||
Guid Id, int TotalScore, string RiskLevel, bool HasSingleParamThree,
|
||||
int RespRateScore, int Spo2Score, int SystolicBpScore,
|
||||
int HeartRateScore, int ConsciousnessScore, int TemperatureScore,
|
||||
int SupplementalO2Score, DateTimeOffset CalculatedAt);
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace VigilCare.Simulation;
|
||||
|
||||
|
||||
public record OpenEncounterRequest(
|
||||
string EncounterType, string Department, string AttendingPhysician,
|
||||
string? RoomBed = null, string? AdmissionReason = null);
|
||||
@@ -0,0 +1,3 @@
|
||||
namespace VigilCare.Simulation;
|
||||
|
||||
public record OrderResponse(Guid Id, string Description, string Status);
|
||||
@@ -0,0 +1,5 @@
|
||||
namespace VigilCare.Simulation;
|
||||
|
||||
public record PatientResponse(
|
||||
Guid Id, string Mrn, string FirstName, string LastName,
|
||||
DateOnly DateOfBirth, string Gender, string Status, DateTimeOffset CreatedAt);
|
||||
@@ -0,0 +1,3 @@
|
||||
namespace VigilCare.Simulation;
|
||||
|
||||
public record QsofaResponse(int ActiveCriteria);
|
||||
@@ -0,0 +1,3 @@
|
||||
namespace VigilCare.Simulation;
|
||||
|
||||
public record RecordOrderResultRequest(string? ResultSummary);
|
||||
@@ -0,0 +1,4 @@
|
||||
namespace VigilCare.Simulation;
|
||||
|
||||
public record RegisterPatientRequest(
|
||||
string FirstName, string LastName, DateOnly DateOfBirth, string Gender);
|
||||
@@ -0,0 +1,13 @@
|
||||
namespace VigilCare.Simulation;
|
||||
|
||||
public record SepsisBundleElementResponse(string Status);
|
||||
|
||||
public record SepsisBundleResponse(
|
||||
Guid Id, string TriggeringAlertType, string ComplianceStatus,
|
||||
DateTimeOffset RecognizedAt, DateTimeOffset DeadlineAt,
|
||||
DateTimeOffset? CompletedAt,
|
||||
List<SepsisBundleElementResponse>? Elements = null)
|
||||
{
|
||||
public int ElementsCompleted =>
|
||||
Elements?.Count(e => e.Status == "Completed") ?? 0;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace VigilCare.Simulation;
|
||||
|
||||
public record SofaResponse(
|
||||
int TotalScore,
|
||||
int RespiratoryScore, int CoagulationScore, int LiverScore,
|
||||
int CardiovascularScore, int CnsScore, int RenalScore,
|
||||
bool IsBaseline, int? DeltaFromBaseline,
|
||||
SofaStalenessResponse? Staleness,
|
||||
DateTimeOffset CalculatedAt);
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace VigilCare.Simulation;
|
||||
|
||||
public record SofaStalenessResponse(
|
||||
IReadOnlyList<string> StaleComponents,
|
||||
IReadOnlyList<string> MissingComponents,
|
||||
bool UsedSpO2Fallback);
|
||||
Reference in New Issue
Block a user