using adas_core.Domain.Models.Masters;
using adas_core.Domain.Models.MongoModels;
using adas_core.Domain.Models.Pumps;
using adas_core.Domain.Models.Recording;
using Newtonsoft.Json;
namespace adas_core.Domain.Models;
///
/// Represents an API request, encapsulating the data and configuration needed to invoke a remote or web service endpoint.
///
public class ApiRequest
{
// SIU
public PatientAppointment? Appointment;
// SIU
public List? Appointments;
// OMP
public PatientTreatment? Treatment;
public List? Treatments;
public string? TraceId { get; set; }
public string? TraceMessageId { get; set; }
public string? Type { get; set; }
public string? PatientNumber { get; set; }
public Person? Patient { get; set; }
public string? PatientId { get; set; }
public DateTime? AdmTime { get; set; }
public DateTime? DisTime { get; set; }
public PatientLocation? Location { get; set; }
//Chat
public ChatMessage? ChatMessage { get; set; }
//Recording
public RecordingData? Recording { get; set; }
//SurgeryRoomAlert
public PatientLocation? AlertLocationFrom { get; set; }
public PatientLocation? AlertLocationTo { get; set; }
// ADT
public PatientLocation? OldLocation { get; set; }
public Person? AttendingDoctor { get; set; }
public string? OldPatientNumber { get; set; }
// ORU
public ObservationData? ObservationData { get; set; }
public ObservationData? ObsertationData
{
get => ObservationData;
set => ObservationData = value;
}
public List? Observations { get; set; }
public PatientObservation? Observation { get; set; }
public List? Alarms { get; set; }
public List? PumpObservations { get; set; }
public PumpObservation? PumpObservation { get; set; }
//DG1
public List? Diagnosis { get; set; }
// ALERTS
public List? RecordingAlerts { get; set; }
public PatientRecordingAlert? RecordingAlert { get; set; }
public DateTime MessageTime { get; set; }
public bool WaitResult { get; set; }
//ICCA db sync
public List? IccaPatients { get; set; }
public string? Facility { get; set; }
//NursePlan
public Admission? Admission { get; set; }
public Discharge? Discharge { get; set; }
public MasterList? MasterList { get; set; }
public Notice? Notice { get; set; }
public bool RequestFromPanel { get; set; }
///
/// Returns a JSON string representation of the current object using with no formatting.
/// If serialization fails, falls back to the result of .
///
/// A JSON string representation of the object, or the base result if serialization throws an exception.
public override string? ToString()
{
try
{
return JsonConvert.SerializeObject(this, Formatting.None);
}
catch
{
return base.ToString();
}
}
}