//
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using SimpleLIS;
#nullable disable
namespace SimpleLIS.Migrations
{
[DbContext(typeof(HL7DbContext))]
partial class HL7DbContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "8.0.11");
modelBuilder.Entity("SimpleLIS.Models.Message", b =>
{
b.Property("MessageId")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property("ControlId")
.IsRequired()
.HasColumnType("TEXT");
b.Property("MessageType")
.IsRequired()
.HasColumnType("TEXT");
b.Property("PatientId")
.HasColumnType("INTEGER");
b.Property("ReceivingApp")
.HasColumnType("TEXT");
b.Property("ReceivingFacility")
.HasColumnType("TEXT");
b.Property("SendingApp")
.HasColumnType("TEXT");
b.Property("SendingFacility")
.HasColumnType("TEXT");
b.Property("Timestamp")
.HasColumnType("TEXT");
b.Property("Version")
.HasColumnType("TEXT");
b.HasKey("MessageId");
b.HasIndex("PatientId");
b.ToTable("Messages");
});
modelBuilder.Entity("SimpleLIS.Models.Observation", b =>
{
b.Property("ObservationId")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property("AbnormalFlag")
.HasColumnType("TEXT");
b.Property("MessageId")
.HasColumnType("INTEGER");
b.Property("ObservationCode")
.IsRequired()
.HasColumnType("TEXT");
b.Property("ObservationValue")
.IsRequired()
.HasColumnType("TEXT");
b.Property("ResultStatus")
.IsRequired()
.HasColumnType("TEXT");
b.Property("Units")
.HasColumnType("TEXT");
b.HasKey("ObservationId");
b.HasIndex("MessageId");
b.ToTable("Observations");
});
modelBuilder.Entity("SimpleLIS.Models.Patient", b =>
{
b.Property("PatientId")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property("DateOfBirth")
.HasColumnType("TEXT");
b.Property("FirstName")
.HasColumnType("TEXT");
b.Property("Gender")
.HasColumnType("TEXT");
b.Property("HL7PatientId")
.HasColumnType("TEXT");
b.Property("LastName")
.HasColumnType("TEXT");
b.HasKey("PatientId");
b.ToTable("Patients");
});
modelBuilder.Entity("SimpleLIS.Models.Message", b =>
{
b.HasOne("SimpleLIS.Models.Patient", "Patient")
.WithMany("Messages")
.HasForeignKey("PatientId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Patient");
});
modelBuilder.Entity("SimpleLIS.Models.Observation", b =>
{
b.HasOne("SimpleLIS.Models.Message", "Message")
.WithMany("Observations")
.HasForeignKey("MessageId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Message");
});
modelBuilder.Entity("SimpleLIS.Models.Message", b =>
{
b.Navigation("Observations");
});
modelBuilder.Entity("SimpleLIS.Models.Patient", b =>
{
b.Navigation("Messages");
});
#pragma warning restore 612, 618
}
}
}