Creado apartir del commit b888de6c92056de294456f581a56e25e734d4ab7 de develop
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
using MongoDB.Bson;
|
||||
|
||||
namespace adas_core.Domain.Models.Responses;
|
||||
|
||||
public class BeaconResponse(string color, ObjectId poc, ObjectId unitId) : IEquatable<BeaconResponse>
|
||||
{
|
||||
private string Color { get; } = color;
|
||||
private ObjectId PointOfCareId { get; } = poc;
|
||||
|
||||
private ObjectId UnitId { get; } = unitId;
|
||||
|
||||
public bool Equals(BeaconResponse? other)
|
||||
{
|
||||
return PointOfCareId == other?.PointOfCareId && UnitId == other.UnitId;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return "BeaconResponse[pointOfCare: " + PointOfCareId + ", bed: " + UnitId + ", color: " + Color + "]";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using adas_core.Domain.Models.Observations;
|
||||
|
||||
namespace adas_core.Domain.Models.Responses;
|
||||
|
||||
public class BoxObservationsResponse
|
||||
{
|
||||
public List<Medication> Medication = [];
|
||||
|
||||
public Dictionary<string, Observation> Observations = new();
|
||||
public string? Id { get; set; }
|
||||
|
||||
public string? Stream { get; set; }
|
||||
|
||||
public bool? IsVisible { get; set; }
|
||||
|
||||
public bool? HasPatient { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
using adas_core.Domain.Enums;
|
||||
using adas_core.Domain.Models.DTO.Display;
|
||||
using MongoDB.Bson;
|
||||
|
||||
namespace adas_core.Domain.Models.Responses;
|
||||
|
||||
public class DisplayConfigMinimalResponse
|
||||
{
|
||||
public DisplayConfigMinimalResponse()
|
||||
{
|
||||
}
|
||||
|
||||
public DisplayConfigMinimalResponse(DisplayConfigSummary displayConfig, bool? isInUse = false)
|
||||
{
|
||||
Id = displayConfig.Id;
|
||||
Type = displayConfig.Type;
|
||||
Hospital = displayConfig.Name;
|
||||
IsInUse = isInUse;
|
||||
}
|
||||
|
||||
public ObjectId Id { get; set; }
|
||||
public DisplayConfigEnums.DisplayType Type { get; set; } = DisplayConfigEnums.DisplayType.Unknown;
|
||||
public string? Hospital { get; set; }
|
||||
|
||||
public bool? IsInUse { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
namespace adas_core.Domain.Models.Responses;
|
||||
|
||||
public class LoginResponse
|
||||
{
|
||||
public string Token { get; set; } = "";
|
||||
public string RefreshToken { get; set; } = "";
|
||||
public DateTime Expiration { get; set; } = DateTime.MinValue;
|
||||
|
||||
public bool IsExpired()
|
||||
{
|
||||
if (Expiration != DateTime.MinValue)
|
||||
{
|
||||
if (Expiration < DateTime.UtcNow) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
namespace adas_core.Domain.Models.Responses;
|
||||
|
||||
public class PaginationResponse<T>
|
||||
{
|
||||
public PaginationResponse(List<T> data, int pageNumber, int pageSize, long totalRecords)
|
||||
{
|
||||
PageNumber = pageNumber;
|
||||
PageSize = pageSize;
|
||||
Data = data;
|
||||
TotalRecords = totalRecords;
|
||||
var totalPages = TotalRecords / (double)PageSize;
|
||||
var roundedTotalPages = Convert.ToInt64(Math.Ceiling(totalPages));
|
||||
TotalPages = roundedTotalPages;
|
||||
}
|
||||
|
||||
public int PageNumber { get; set; }
|
||||
public int PageSize { get; set; }
|
||||
|
||||
public long TotalPages { get; set; }
|
||||
public long TotalRecords { get; set; }
|
||||
public List<T> Data { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using adas_core.Domain.Models.MongoModels;
|
||||
|
||||
namespace adas_core.Domain.Models.Responses;
|
||||
|
||||
public class PatientSearch(
|
||||
Patient? patient,
|
||||
Patient? archivePatient,
|
||||
Admission? admission,
|
||||
bool isArchived,
|
||||
bool hasResult)
|
||||
{
|
||||
public Patient? Patient { get; set; } = patient;
|
||||
public Patient? ArchivedPatient { get; set; } = archivePatient;
|
||||
public Admission? Admission { get; set; } = admission;
|
||||
public bool IsArchived { get; set; } = isArchived;
|
||||
public bool HasResult { get; set; } = hasResult;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
namespace adas_core.Domain.Models.Responses;
|
||||
|
||||
public class Response<T>
|
||||
{
|
||||
public Response()
|
||||
{
|
||||
}
|
||||
|
||||
public Response(T data)
|
||||
{
|
||||
Succeeded = true;
|
||||
Message = string.Empty;
|
||||
Errors = null;
|
||||
Data = data;
|
||||
}
|
||||
|
||||
public T? Data { get; set; }
|
||||
public bool? Succeeded { get; set; }
|
||||
|
||||
public string[]? Errors { get; set; }
|
||||
public string? Message { get; set; }
|
||||
}
|
||||
|
||||
public record UpdateResponse<T>(long Changes, T? Data);
|
||||
Reference in New Issue
Block a user