From 8873fe076e81c31e46ed3aba690b740ebf61ec69 Mon Sep 17 00:00:00 2001 From: Ashley Wilson Date: Wed, 24 Jul 2024 08:19:06 -0400 Subject: [PATCH 01/24] Structure for persisting submission attempts --- src/UDS.Net.API/Entities/PacketStatus.cs | 13 +++++++++ src/UDS.Net.API/Entities/PacketSubmission.cs | 25 +++++++++++++++++ .../Entities/PacketSubmissionError.cs | 27 +++++++++++++++++++ .../Entities/PacketSubmissionErrorLevel.cs | 12 +++++++++ src/UDS.Net.API/Entities/Visit.cs | 4 +++ 5 files changed, 81 insertions(+) create mode 100644 src/UDS.Net.API/Entities/PacketStatus.cs create mode 100644 src/UDS.Net.API/Entities/PacketSubmission.cs create mode 100644 src/UDS.Net.API/Entities/PacketSubmissionError.cs create mode 100644 src/UDS.Net.API/Entities/PacketSubmissionErrorLevel.cs diff --git a/src/UDS.Net.API/Entities/PacketStatus.cs b/src/UDS.Net.API/Entities/PacketStatus.cs new file mode 100644 index 0000000..a5d53d6 --- /dev/null +++ b/src/UDS.Net.API/Entities/PacketStatus.cs @@ -0,0 +1,13 @@ +using System; +namespace UDS.Net.API.Entities +{ + public enum PacketStatus + { + Unsubmitted, // no attempts made to submit + Submitted, // submitted at least once, pending error checks from the latest submission + FailedErrorChecks, // submitted at least once and failed error checks + PassedErrorChecks, // submitted at least once and passed error checks + Frozen // data freeze + } +} + diff --git a/src/UDS.Net.API/Entities/PacketSubmission.cs b/src/UDS.Net.API/Entities/PacketSubmission.cs new file mode 100644 index 0000000..2b4d310 --- /dev/null +++ b/src/UDS.Net.API/Entities/PacketSubmission.cs @@ -0,0 +1,25 @@ +using System; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +using System.Net.Sockets; + +namespace UDS.Net.API.Entities +{ + /// + /// Visit's data bundled and submitted to NACC is called "packet" + /// + public class PacketSubmission : BaseEntity + { + [Key] + [DatabaseGenerated(DatabaseGeneratedOption.Identity)] + [Column("PacketSubmissionId", Order = 0)] + public int Id { get; set; } + + public DateTime SubmissionDate { get; set; } + + public Visit Visit { get; set; } = default!; + + public int VisitId { get; set; } + } +} + diff --git a/src/UDS.Net.API/Entities/PacketSubmissionError.cs b/src/UDS.Net.API/Entities/PacketSubmissionError.cs new file mode 100644 index 0000000..998126b --- /dev/null +++ b/src/UDS.Net.API/Entities/PacketSubmissionError.cs @@ -0,0 +1,27 @@ +using System; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace UDS.Net.API.Entities +{ + public class PacketSubmissionError : BaseEntity + { + [Key] + [DatabaseGenerated(DatabaseGeneratedOption.Identity)] + [Column("PacketSubmissionErrorId", Order = 0)] + public int Id { get; set; } + + [MaxLength(10)] + public string FormKind { get; set; } + + [MaxLength(500)] + public string Message { get; set; } + + public string AssignedTo { get; set; } + + public PacketSubmissionErrorLevel Level { get; set; } + + public string ResolvedBy { get; set; } + } +} + diff --git a/src/UDS.Net.API/Entities/PacketSubmissionErrorLevel.cs b/src/UDS.Net.API/Entities/PacketSubmissionErrorLevel.cs new file mode 100644 index 0000000..6405123 --- /dev/null +++ b/src/UDS.Net.API/Entities/PacketSubmissionErrorLevel.cs @@ -0,0 +1,12 @@ +using System; +namespace UDS.Net.API.Entities +{ + public enum PacketSubmissionErrorLevel + { + Information, + Warning, + Error, + Critical + } +} + diff --git a/src/UDS.Net.API/Entities/Visit.cs b/src/UDS.Net.API/Entities/Visit.cs index 0c4b3b3..3a11798 100644 --- a/src/UDS.Net.API/Entities/Visit.cs +++ b/src/UDS.Net.API/Entities/Visit.cs @@ -38,6 +38,8 @@ public class Visit : BaseEntity [MaxLength(3)] public string INITIALS { get; set; } = default!; + public PacketStatus Status { get; set; } + public virtual List FormStatuses { get; set; } = default!; public virtual A1 A1 { get; set; } = default!; // A1 required for all visit kinds @@ -79,6 +81,8 @@ public class Visit : BaseEntity public virtual D1b D1b { get; set; } = default!; // D1b required at least for IVP public virtual T1? T1 { get; set; } // T1 only required for TIP, TFP visits + + public List PacketSubmissions { get; set; } = new List(); } } From 65d93a14ecbfdcdacffcea66236bda4c250edece Mon Sep 17 00:00:00 2001 From: Ashley Wilson Date: Wed, 24 Jul 2024 12:49:17 -0400 Subject: [PATCH 02/24] In-progress updates for persisting submission logs --- src/UDS.Net.API.Client/ApiClient.cs | 11 +- src/UDS.Net.API.Client/IApiClient.cs | 4 +- src/UDS.Net.API.Client/IBaseClient.cs | 5 +- .../IPacketSubmissionClient.cs | 33 ++++ src/UDS.Net.API.Client/IVisitClient.cs | 3 +- .../PacketSubmissionClient.cs | 91 +++++++++++ .../UDS.Net.API.Client.csproj | 4 +- src/UDS.Net.API.Client/VisitClient.cs | 6 +- .../PacketSubmissionsController.cs | 145 ++++++++++++++++++ .../Controllers/VisitsController.cs | 6 +- src/UDS.Net.API/Entities/PacketStatus.cs | 3 +- src/UDS.Net.API/Entities/PacketSubmission.cs | 6 +- .../Entities/PacketSubmissionError.cs | 3 +- .../Entities/PacketSubmissionErrorLevel.cs | 3 +- src/UDS.Net.API/Entities/Visit.cs | 3 +- .../Extensions/DtoToEntityMapper.cs | 26 ++-- .../Extensions/EntityToDtoMapper.cs | 75 ++++++++- src/UDS.Net.API/UDS.Net.API.csproj | 2 +- src/UDS.Net.Dto/PacketSubmissionDto.cs | 15 ++ src/UDS.Net.Dto/PacketSubmissionErrorDto.cs | 18 +++ src/UDS.Net.Dto/UDS.Net.Dto.csproj | 4 +- src/UDS.Net.Dto/VisitDto.cs | 8 +- src/UDS.Net.sln | 12 +- 23 files changed, 426 insertions(+), 60 deletions(-) create mode 100644 src/UDS.Net.API.Client/IPacketSubmissionClient.cs create mode 100644 src/UDS.Net.API.Client/PacketSubmissionClient.cs create mode 100644 src/UDS.Net.API/Controllers/PacketSubmissionsController.cs create mode 100644 src/UDS.Net.Dto/PacketSubmissionDto.cs create mode 100644 src/UDS.Net.Dto/PacketSubmissionErrorDto.cs diff --git a/src/UDS.Net.API.Client/ApiClient.cs b/src/UDS.Net.API.Client/ApiClient.cs index decdcb8..64c59d1 100644 --- a/src/UDS.Net.API.Client/ApiClient.cs +++ b/src/UDS.Net.API.Client/ApiClient.cs @@ -1,7 +1,5 @@ using System; -using System.Net.Http; using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Configuration; namespace UDS.Net.API.Client { @@ -29,6 +27,11 @@ public static void AddUDSApiClient(this IServiceCollection services, string base options.BaseAddress = new Uri(baseAddress); }); + services.AddHttpClient(options => + { + options.BaseAddress = new Uri(baseAddress); + }); + // API client registered last services.AddSingleton(); } @@ -43,12 +46,14 @@ public class ApiClient : IApiClient public IVisitClient VisitClient { get; } public IParticipationClient ParticipationClient { get; } public ILookupClient LookupClient { get; } + public IPacketSubmissionClient PacketSubmissionClient { get; } - public ApiClient(IVisitClient visitClient, IParticipationClient participationClient, ILookupClient lookupClient) + public ApiClient(IVisitClient visitClient, IParticipationClient participationClient, ILookupClient lookupClient, IPacketSubmissionClient packetSubmissionClient) { VisitClient = visitClient; ParticipationClient = participationClient; LookupClient = lookupClient; + PacketSubmissionClient = packetSubmissionClient; } diff --git a/src/UDS.Net.API.Client/IApiClient.cs b/src/UDS.Net.API.Client/IApiClient.cs index 00cbfd8..f0c7a8a 100644 --- a/src/UDS.Net.API.Client/IApiClient.cs +++ b/src/UDS.Net.API.Client/IApiClient.cs @@ -1,11 +1,11 @@ -using System; -namespace UDS.Net.API.Client +namespace UDS.Net.API.Client { public interface IApiClient { IVisitClient VisitClient { get; } IParticipationClient ParticipationClient { get; } ILookupClient LookupClient { get; } + IPacketSubmissionClient PacketSubmissionClient { get; } } } diff --git a/src/UDS.Net.API.Client/IBaseClient.cs b/src/UDS.Net.API.Client/IBaseClient.cs index 791f2fa..18bff2d 100644 --- a/src/UDS.Net.API.Client/IBaseClient.cs +++ b/src/UDS.Net.API.Client/IBaseClient.cs @@ -1,8 +1,5 @@ - -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.Threading.Tasks; -using UDS.Net.Dto; namespace UDS.Net.API.Client { diff --git a/src/UDS.Net.API.Client/IPacketSubmissionClient.cs b/src/UDS.Net.API.Client/IPacketSubmissionClient.cs new file mode 100644 index 0000000..03cc924 --- /dev/null +++ b/src/UDS.Net.API.Client/IPacketSubmissionClient.cs @@ -0,0 +1,33 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using UDS.Net.Dto; + +namespace UDS.Net.API.Client +{ + public interface IPacketSubmissionClient : IBaseClient + { + Task PacketSubmissionsCountByVisit(int visitId); + + Task PacketSubmissionsCountByStatus(string packetStatus); + + Task> GetPacketSubmissionsByVisit(int visitId, int pageSize = 10, int pageIndex = 1); + + Task> GetPacketSubmissionsByStatus(string packetStatus, int pageSize = 10, int pageIndex = 1); + + Task PacketSubmissionErrorsCount(bool includeResolved = false); + + Task PacketSubmissionsErrorsCountByVisit(int visitId); + + Task PacketSubmissionsErrorsCountyByAssignee(string assignedTo); + + Task> GetPacketSubmissionErrors(bool includeResolved = false, int pageSize = 10, int pageIndex = 1); + + Task> GetPacketSubmissionErrorsByVisit(int visitId, int pageSize = 10, int pageIndex = 1); + + Task> GetPacketSubmissionErrorsByAssignee(string assignedTo, int pageSize = 10, int pageIndex = 1); + + Task PostPacketSubmissionError(int packetSubmissionId, PacketSubmissionErrorDto dto); + + Task PutPacketSubmissionError(int packetSubmissionId, PacketSubmissionErrorDto dto); + } +} diff --git a/src/UDS.Net.API.Client/IVisitClient.cs b/src/UDS.Net.API.Client/IVisitClient.cs index ed0c2bb..79283ae 100644 --- a/src/UDS.Net.API.Client/IVisitClient.cs +++ b/src/UDS.Net.API.Client/IVisitClient.cs @@ -1,5 +1,4 @@ -using System; -using System.Threading.Tasks; +using System.Threading.Tasks; using UDS.Net.Dto; namespace UDS.Net.API.Client diff --git a/src/UDS.Net.API.Client/PacketSubmissionClient.cs b/src/UDS.Net.API.Client/PacketSubmissionClient.cs new file mode 100644 index 0000000..cfdbf57 --- /dev/null +++ b/src/UDS.Net.API.Client/PacketSubmissionClient.cs @@ -0,0 +1,91 @@ +using System.Collections.Generic; +using System.Net.Http; +using System.Text.Json; +using System.Threading.Tasks; +using UDS.Net.Dto; + +namespace UDS.Net.API.Client +{ + public class PacketSubmissionClient : AuthenticatedClient, IPacketSubmissionClient + { + const string BASEPATH = "PacketSubmissions"; + + public PacketSubmissionClient(HttpClient httpClient) : base(httpClient, BASEPATH) + { + } + + public async Task PacketSubmissionsCountByVisit(int visitId) + { + var response = await GetRequest($"{_BasePath}/Count/ByVisit/{visitId}"); + + int count = JsonSerializer.Deserialize(response, options); + + return count; + } + + public async Task PacketSubmissionsCountByStatus(string packetStatus) + { + var response = await GetRequest($"{_BasePath}/Count/ByStatus/{packetStatus}"); + + int count = JsonSerializer.Deserialize(response, options); + + return count; + } + + public Task> GetPacketSubmissionsByVisit(int visitId, int pageSize = 10, int pageIndex = 1) + { + throw new System.NotImplementedException(); + } + + public Task> GetPacketSubmissionsByStatus(string packetStatus, int pageSize = 10, int pageIndex = 1) + { + throw new System.NotImplementedException(); + } + + public Task PacketSubmissionErrorsCount(bool includeResolved = false) + { + throw new System.NotImplementedException(); + } + + public Task PacketSubmissionsErrorsCountByVisit(int visitId) + { + throw new System.NotImplementedException(); + } + + public Task PacketSubmissionsErrorsCountyByAssignee(string assignedTo) + { + throw new System.NotImplementedException(); + } + + public Task> GetPacketSubmissionErrors(bool includeResolved = false, int pageSize = 10, int pageIndex = 1) + { + throw new System.NotImplementedException(); + } + + public Task> GetPacketSubmissionErrorsByVisit(int visitId, int pageSize = 10, int pageIndex = 1) + { + throw new System.NotImplementedException(); + } + + public Task> GetPacketSubmissionErrorsByAssignee(string assignedTo, int pageSize = 10, int pageIndex = 1) + { + throw new System.NotImplementedException(); + } + + public async Task PostPacketSubmissionError(int packetSubmissionId, PacketSubmissionErrorDto dto) + { + + //string json = JsonSerializer.Serialize(dto); + + //var response = await PostRequest($"{_BasePath}/{id}/Forms/{formKind}", json); + throw new System.NotImplementedException(); + } + + public async Task PutPacketSubmissionError(int packetSubmissionId, PacketSubmissionErrorDto dto) + { + throw new System.NotImplementedException(); + } + + } +} + diff --git a/src/UDS.Net.API.Client/UDS.Net.API.Client.csproj b/src/UDS.Net.API.Client/UDS.Net.API.Client.csproj index 1ee1548..dd954a6 100644 --- a/src/UDS.Net.API.Client/UDS.Net.API.Client.csproj +++ b/src/UDS.Net.API.Client/UDS.Net.API.Client.csproj @@ -4,13 +4,13 @@ netstandard2.1 Library UDS.Net.API.Client - 3.0.1 + 3.1.0-preview.1 Sanders-Brown Center on Aging UDS client library for using UDS.Net.API UK-SBCoA Client library for API https://github.com/UK-SBCoA/uniform-data-set-dotnet-api - 3.0.1 + 3.1.0-preview.1 diff --git a/src/UDS.Net.API.Client/VisitClient.cs b/src/UDS.Net.API.Client/VisitClient.cs index fcb786d..3fdbb8a 100644 --- a/src/UDS.Net.API.Client/VisitClient.cs +++ b/src/UDS.Net.API.Client/VisitClient.cs @@ -1,10 +1,6 @@ -using System; -using System.Collections.Generic; -using System.Net.Http; +using System.Net.Http; using System.Text.Json; -using System.Text.Json.Serialization; using System.Threading.Tasks; -using Microsoft.Extensions.Configuration; using UDS.Net.Dto; namespace UDS.Net.API.Client diff --git a/src/UDS.Net.API/Controllers/PacketSubmissionsController.cs b/src/UDS.Net.API/Controllers/PacketSubmissionsController.cs new file mode 100644 index 0000000..130b7ff --- /dev/null +++ b/src/UDS.Net.API/Controllers/PacketSubmissionsController.cs @@ -0,0 +1,145 @@ +using Microsoft.AspNetCore.Mvc; +using UDS.Net.API.Client; +using UDS.Net.API.Data; +using UDS.Net.Dto; + +namespace UDS.Net.API.Controllers +{ + public class PacketSubmissionsController : Controller, IPacketSubmissionClient + { + private readonly ApiDbContext _context; + + public PacketSubmissionsController(ApiDbContext context) + { + _context = context; + } + + [HttpGet("Count", Name = "PacketSubmissionsCount")] + public async Task Count() + { + throw new NotImplementedException(); + } + + [HttpGet("Count/ByVisit/{visitId}", Name = "PacketSubmissionsCountByVisit")] + public async Task PacketSubmissionsCountByVisit(int visitId) + { + throw new NotImplementedException(); + } + + [HttpGet("Count/ByStatus/{packetStatus}", Name = "PacketSubmissionsCountByStatus")] + public async Task PacketSubmissionsCountByStatus(string packetStatus) + { + throw new NotImplementedException(); + } + + + + + [HttpDelete("{id}")] + public async Task Delete(int id) + { + throw new NotImplementedException(); + } + + [HttpGet] + public async Task> Get(int pageSize = 10, int pageIndex = 1) + { + throw new NotImplementedException(); + } + + [HttpGet("ByVisit/{visitId}", Name = "GetPacketSubmissionByVisit")] + public async Task> GetPacketSubmissionsByVisit(int visitId, int pageSize = 10, int pageIndex = 1) + { + throw new NotImplementedException(); + } + + [HttpGet("{id}")] + public async Task Get(int id) + { + throw new NotImplementedException(); + } + + [HttpPost] + public async Task Post(PacketSubmissionDto dto) + { + throw new NotImplementedException(); + } + + [HttpPut("{id}")] + public async Task Put(int id, PacketSubmissionDto dto) + { + throw new NotImplementedException(); + } + + [HttpGet("Errors/ByAssigned/{assignedTo}", Name = "GetPacketSubmissionErrorsByAssigned")] + public async Task> GetPacketSubmissionErrorsByAssignee(string assignedTo) + { + throw new NotImplementedException(); + } + + [HttpGet("Errors/ByVisit/{visitId}", Name = "GetPacketSubmissionErrorsByVisit")] + public async Task> GetPacketSubmissionErrorsByVisit(int visitId) + { + throw new NotImplementedException(); + } + + [HttpGet("Errors/ByStatus/{packetStatus}", Name = "GetPacketSubmissionErrorsByStatus")] + public async Task> GetPacketSubmissionsByStatus(string packetStatus) + { + throw new NotImplementedException(); + } + + + public async Task> GetPacketSubmissionErrors(bool includeResolved = false) + { + throw new NotImplementedException(); + } + + public async Task PostPacketSubmissionError(int packetSubmissionId, PacketSubmissionErrorDto dto) + { + throw new NotImplementedException(); + } + + public async Task PutPacketSubmissionError(int packetSubmissionId, PacketSubmissionErrorDto dto) + { + throw new NotImplementedException(); + } + + + public Task> GetPacketSubmissionsByStatus(string packetStatus, int pageSize = 10, int pageIndex = 1) + { + throw new NotImplementedException(); + } + + public Task PacketSubmissionErrorsCount(bool includeResolved = false) + { + throw new NotImplementedException(); + } + + public Task PacketSubmissionsErrorsCountByVisit(int visitId) + { + throw new NotImplementedException(); + } + + public Task PacketSubmissionsErrorsCountyByAssignee(string assignedTo) + { + throw new NotImplementedException(); + } + + public Task> GetPacketSubmissionErrors(bool includeResolved = false, int pageSize = 10, int pageIndex = 1) + { + throw new NotImplementedException(); + } + + public Task> GetPacketSubmissionErrorsByVisit(int visitId, int pageSize = 10, int pageIndex = 1) + { + throw new NotImplementedException(); + } + + public Task> GetPacketSubmissionErrorsByAssignee(string assignedTo, int pageSize = 10, int pageIndex = 1) + { + throw new NotImplementedException(); + } + } +} + diff --git a/src/UDS.Net.API/Controllers/VisitsController.cs b/src/UDS.Net.API/Controllers/VisitsController.cs index f5c69c2..e417878 100644 --- a/src/UDS.Net.API/Controllers/VisitsController.cs +++ b/src/UDS.Net.API/Controllers/VisitsController.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; using UDS.Net.API.Client; using UDS.Net.API.Data; diff --git a/src/UDS.Net.API/Entities/PacketStatus.cs b/src/UDS.Net.API/Entities/PacketStatus.cs index a5d53d6..52588e1 100644 --- a/src/UDS.Net.API/Entities/PacketStatus.cs +++ b/src/UDS.Net.API/Entities/PacketStatus.cs @@ -1,5 +1,4 @@ -using System; -namespace UDS.Net.API.Entities +namespace UDS.Net.API.Entities { public enum PacketStatus { diff --git a/src/UDS.Net.API/Entities/PacketSubmission.cs b/src/UDS.Net.API/Entities/PacketSubmission.cs index 2b4d310..889fe6d 100644 --- a/src/UDS.Net.API/Entities/PacketSubmission.cs +++ b/src/UDS.Net.API/Entities/PacketSubmission.cs @@ -1,7 +1,5 @@ -using System; -using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -using System.Net.Sockets; namespace UDS.Net.API.Entities { @@ -20,6 +18,8 @@ public class PacketSubmission : BaseEntity public Visit Visit { get; set; } = default!; public int VisitId { get; set; } + + public List PacketSubmissionErrors { get; set; } = new List(); } } diff --git a/src/UDS.Net.API/Entities/PacketSubmissionError.cs b/src/UDS.Net.API/Entities/PacketSubmissionError.cs index 998126b..b4e3795 100644 --- a/src/UDS.Net.API/Entities/PacketSubmissionError.cs +++ b/src/UDS.Net.API/Entities/PacketSubmissionError.cs @@ -1,5 +1,4 @@ -using System; -using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; namespace UDS.Net.API.Entities diff --git a/src/UDS.Net.API/Entities/PacketSubmissionErrorLevel.cs b/src/UDS.Net.API/Entities/PacketSubmissionErrorLevel.cs index 6405123..016a042 100644 --- a/src/UDS.Net.API/Entities/PacketSubmissionErrorLevel.cs +++ b/src/UDS.Net.API/Entities/PacketSubmissionErrorLevel.cs @@ -1,5 +1,4 @@ -using System; -namespace UDS.Net.API.Entities +namespace UDS.Net.API.Entities { public enum PacketSubmissionErrorLevel { diff --git a/src/UDS.Net.API/Entities/Visit.cs b/src/UDS.Net.API/Entities/Visit.cs index 3a11798..fd06a06 100644 --- a/src/UDS.Net.API/Entities/Visit.cs +++ b/src/UDS.Net.API/Entities/Visit.cs @@ -1,5 +1,4 @@ -using System; -using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using Microsoft.EntityFrameworkCore; diff --git a/src/UDS.Net.API/Extensions/DtoToEntityMapper.cs b/src/UDS.Net.API/Extensions/DtoToEntityMapper.cs index 21e3f71..c800a8b 100644 --- a/src/UDS.Net.API/Extensions/DtoToEntityMapper.cs +++ b/src/UDS.Net.API/Extensions/DtoToEntityMapper.cs @@ -1,6 +1,4 @@ -using System; -using System.Net; -using UDS.Net.API.Entities; +using UDS.Net.API.Entities; using UDS.Net.Dto; namespace UDS.Net.API.Extensions @@ -69,7 +67,7 @@ private static void SetBaseProperties(this Form entity, FormDto dto) public static Visit Convert(this VisitDto dto) { - return new Visit + var visit = new Visit { PACKET = dto.PACKET, VISITNUM = dto.VISITNUM, @@ -83,6 +81,14 @@ public static Visit Convert(this VisitDto dto) DeletedBy = dto.DeletedBy, ParticipationId = dto.ParticipationId }; + + if (!string.IsNullOrWhiteSpace(dto.Status)) + { + if (Enum.TryParse(dto.Status, true, out PacketStatus status)) + visit.Status = status; + } + + return visit; } public static bool Update(this Visit entity, VisitDto dto) @@ -90,13 +96,13 @@ public static bool Update(this Visit entity, VisitDto dto) if (entity != null) { // Only some properties are allowed to be updated - //entity.ParticipationId = dto.ParticipationId; - //entity.VISITNUM = dto.VISITNUM; - //entity.PACKET = dto.PACKET; - //entity.FORMVER = dto.FORMVER; + if (!string.IsNullOrWhiteSpace(dto.Status)) + { + if (Enum.TryParse(dto.Status, true, out PacketStatus status)) + entity.Status = status; + } + entity.VISIT_DATE = dto.VISIT_DATE; - //entity.CreatedAt = dto.CreatedAt; - //entity.CreatedBy = dto.CreatedBy; entity.INITIALS = dto.INITIALS; entity.ModifiedBy = dto.ModifiedBy; entity.DeletedBy = dto.DeletedBy; diff --git a/src/UDS.Net.API/Extensions/EntityToDtoMapper.cs b/src/UDS.Net.API/Extensions/EntityToDtoMapper.cs index 7559c3b..68d70e3 100644 --- a/src/UDS.Net.API/Extensions/EntityToDtoMapper.cs +++ b/src/UDS.Net.API/Extensions/EntityToDtoMapper.cs @@ -1,8 +1,4 @@ -using System; -using System.Net; -using System.Net.NetworkInformation; -using System.Security.Claims; -using UDS.Net.API.Entities; +using UDS.Net.API.Entities; using UDS.Net.Dto; namespace UDS.Net.API.Extensions @@ -25,9 +21,17 @@ private static VisitDto ConvertVisitToDto(Visit visit) FORMVER = visit.FORMVER, VISIT_DATE = visit.VISIT_DATE, INITIALS = visit.INITIALS, - Forms = new List() + Status = visit.Status.ToString(), + //Forms = new List(), + //PacketSubmissions = new List() }; + if (visit.PacketSubmissions != null && visit.PacketSubmissions.Count() > 0) + { + dto.PacketSubmissionCount = visit.PacketSubmissions.Count(); + dto.PacketSubmissions = visit.PacketSubmissions.ToDto(); + } + return dto; } @@ -1603,6 +1607,65 @@ public static DrugCodeDto ToDto(this DrugCodeLookup drugCode) IsPopular = drugCode.IsPopular }; } + + public static List ToDto(this List packetSubmissions) + { + List dto = new List(); + + if (packetSubmissions != null && packetSubmissions.Count() > 0) + { + dto = packetSubmissions.Select(p => p.ToDto()).ToList(); + } + + return dto; + } + + public static PacketSubmissionDto ToDto(this PacketSubmission packetSubmission) + { + var dto = new PacketSubmissionDto + { + Id = packetSubmission.Id, + SubmissionDate = packetSubmission.SubmissionDate, + CreatedAt = packetSubmission.CreatedAt, + CreatedBy = packetSubmission.CreatedBy, + ModifiedBy = packetSubmission.ModifiedBy, + IsDeleted = packetSubmission.IsDeleted, + DeletedBy = packetSubmission.DeletedBy + }; + + if (packetSubmission.PacketSubmissionErrors != null && packetSubmission.PacketSubmissionErrors.Count() > 0) + { + dto.ErrorCount = packetSubmission.PacketSubmissionErrors.Count(); + dto.PacketSubmissionErrors = packetSubmission.PacketSubmissionErrors.ToDto(); + } + + return dto; + } + + public static List ToDto(this List packetSubmissionErrors) + { + List dto = new List(); + + if (packetSubmissionErrors != null && packetSubmissionErrors.Count() > 0) + { + dto = packetSubmissionErrors.Select(e => e.ToDto()).ToList(); + } + + return dto; + } + + public static PacketSubmissionErrorDto ToDto(this PacketSubmissionError packetSubmissionError) + { + return new PacketSubmissionErrorDto() + { + Id = packetSubmissionError.Id, + CreatedAt = packetSubmissionError.CreatedAt, + CreatedBy = packetSubmissionError.CreatedBy, + ModifiedBy = packetSubmissionError.ModifiedBy, + IsDeleted = packetSubmissionError.IsDeleted, + DeletedBy = packetSubmissionError.DeletedBy + }; + } } } diff --git a/src/UDS.Net.API/UDS.Net.API.csproj b/src/UDS.Net.API/UDS.Net.API.csproj index 781f95b..f93bff9 100644 --- a/src/UDS.Net.API/UDS.Net.API.csproj +++ b/src/UDS.Net.API/UDS.Net.API.csproj @@ -4,7 +4,7 @@ net6.0 enable enable - 3.0.1 + 3.1.0-preview.1 ../docker-compose.dcproj c1dd1715-6fa0-4515-bcf2-6a7f6a0c11a5 Release;Debug diff --git a/src/UDS.Net.Dto/PacketSubmissionDto.cs b/src/UDS.Net.Dto/PacketSubmissionDto.cs new file mode 100644 index 0000000..25f2649 --- /dev/null +++ b/src/UDS.Net.Dto/PacketSubmissionDto.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; + +namespace UDS.Net.Dto +{ + public class PacketSubmissionDto : BaseDto + { + public DateTime SubmissionDate { get; set; } + + public int ErrorCount { get; set; } = 0; + + public List PacketSubmissionErrors { get; set; } = new List(); + } +} + diff --git a/src/UDS.Net.Dto/PacketSubmissionErrorDto.cs b/src/UDS.Net.Dto/PacketSubmissionErrorDto.cs new file mode 100644 index 0000000..9494275 --- /dev/null +++ b/src/UDS.Net.Dto/PacketSubmissionErrorDto.cs @@ -0,0 +1,18 @@ +namespace UDS.Net.Dto +{ + public class PacketSubmissionErrorDto : BaseDto + { + public int Id { get; set; } + + public string FormKind { get; set; } + + public string Message { get; set; } + + public string AssignedTo { get; set; } + + public string Level { get; set; } + + public string ResolvedBy { get; set; } + } +} + diff --git a/src/UDS.Net.Dto/UDS.Net.Dto.csproj b/src/UDS.Net.Dto/UDS.Net.Dto.csproj index c9b7a26..b7f91f0 100644 --- a/src/UDS.Net.Dto/UDS.Net.Dto.csproj +++ b/src/UDS.Net.Dto/UDS.Net.Dto.csproj @@ -4,13 +4,13 @@ netstandard2.1 Library UDS.Net.Dto - 3.0.1 + 3.1.0-preview.1 Sanders-Brown Center on Aging UDS data transfer objects for use with API UK-SBCoA Dtos for API https://github.com/UK-SBCoA/uniform-data-set-dotnet-api - 3.0.1 + 3.1.0-preview.1 diff --git a/src/UDS.Net.Dto/VisitDto.cs b/src/UDS.Net.Dto/VisitDto.cs index 44660e8..6d026dc 100644 --- a/src/UDS.Net.Dto/VisitDto.cs +++ b/src/UDS.Net.Dto/VisitDto.cs @@ -17,7 +17,13 @@ public class VisitDto : BaseDto public string INITIALS { get; set; } = ""; - public List Forms { get; set; } + public string Status { get; set; } + + public List Forms { get; set; } = new List(); + + public int PacketSubmissionCount { get; set; } = 0; + + public List PacketSubmissions { get; set; } = new List(); } } diff --git a/src/UDS.Net.sln b/src/UDS.Net.sln index c14c61a..be7fe3e 100644 --- a/src/UDS.Net.sln +++ b/src/UDS.Net.sln @@ -9,7 +9,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UDS.Net.API.Client", "UDS.N EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UDS.Net.Dto", "UDS.Net.Dto\UDS.Net.Dto.csproj", "{E620B892-269C-423B-9AEF-375131FA6B0C}" EndProject -Project("{9344BDBB-3E7F-41FC-A0DD-8665D75EE146}") = "docker-compose", "docker-compose.dcproj", "{76A7139D-B89B-4FCC-91C2-E916420CAF29}" +Project("{9344BDBB-3E7F-41FC-A0DD-8665D75EE146}") = "docker-compose", "docker-compose.dcproj", "{31CCF647-A7BC-443B-8726-A6076E832177}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -29,10 +29,10 @@ Global {E620B892-269C-423B-9AEF-375131FA6B0C}.Debug|Any CPU.Build.0 = Debug|Any CPU {E620B892-269C-423B-9AEF-375131FA6B0C}.Release|Any CPU.ActiveCfg = Release|Any CPU {E620B892-269C-423B-9AEF-375131FA6B0C}.Release|Any CPU.Build.0 = Release|Any CPU - {76A7139D-B89B-4FCC-91C2-E916420CAF29}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {76A7139D-B89B-4FCC-91C2-E916420CAF29}.Debug|Any CPU.Build.0 = Debug|Any CPU - {76A7139D-B89B-4FCC-91C2-E916420CAF29}.Release|Any CPU.ActiveCfg = Release|Any CPU - {76A7139D-B89B-4FCC-91C2-E916420CAF29}.Release|Any CPU.Build.0 = Release|Any CPU + {31CCF647-A7BC-443B-8726-A6076E832177}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {31CCF647-A7BC-443B-8726-A6076E832177}.Debug|Any CPU.Build.0 = Debug|Any CPU + {31CCF647-A7BC-443B-8726-A6076E832177}.Release|Any CPU.ActiveCfg = Release|Any CPU + {31CCF647-A7BC-443B-8726-A6076E832177}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -41,6 +41,6 @@ Global SolutionGuid = {D39D5BFF-1FB6-4543-9752-418308400A84} EndGlobalSection GlobalSection(MonoDevelopProperties) = preSolution - version = 3.0.1 + version = 3.1.0-preview.1 EndGlobalSection EndGlobal From 7e9134bf761005282d55c43886be34340b976d2a Mon Sep 17 00:00:00 2001 From: Ashley Wilson Date: Fri, 26 Jul 2024 08:18:26 -0400 Subject: [PATCH 03/24] Add methods and endpoints for managing submissions --- .../IPacketSubmissionClient.cs | 4 +- .../PacketSubmissionClient.cs | 76 +++++++++++++------ .../PacketSubmissionsController.cs | 64 ++++++++-------- 3 files changed, 87 insertions(+), 57 deletions(-) diff --git a/src/UDS.Net.API.Client/IPacketSubmissionClient.cs b/src/UDS.Net.API.Client/IPacketSubmissionClient.cs index 03cc924..45156ea 100644 --- a/src/UDS.Net.API.Client/IPacketSubmissionClient.cs +++ b/src/UDS.Net.API.Client/IPacketSubmissionClient.cs @@ -18,7 +18,7 @@ public interface IPacketSubmissionClient : IBaseClient Task PacketSubmissionsErrorsCountByVisit(int visitId); - Task PacketSubmissionsErrorsCountyByAssignee(string assignedTo); + Task PacketSubmissionsErrorsCountByAssignee(string assignedTo); Task> GetPacketSubmissionErrors(bool includeResolved = false, int pageSize = 10, int pageIndex = 1); @@ -28,6 +28,6 @@ public interface IPacketSubmissionClient : IBaseClient Task PostPacketSubmissionError(int packetSubmissionId, PacketSubmissionErrorDto dto); - Task PutPacketSubmissionError(int packetSubmissionId, PacketSubmissionErrorDto dto); + Task PutPacketSubmissionError(int packetSubmissionId, int id, PacketSubmissionErrorDto dto); } } diff --git a/src/UDS.Net.API.Client/PacketSubmissionClient.cs b/src/UDS.Net.API.Client/PacketSubmissionClient.cs index cfdbf57..126bf65 100644 --- a/src/UDS.Net.API.Client/PacketSubmissionClient.cs +++ b/src/UDS.Net.API.Client/PacketSubmissionClient.cs @@ -32,58 +32,90 @@ public async Task PacketSubmissionsCountByStatus(string packetStatus) return count; } - public Task> GetPacketSubmissionsByVisit(int visitId, int pageSize = 10, int pageIndex = 1) + public async Task> GetPacketSubmissionsByVisit(int visitId, int pageSize = 10, int pageIndex = 1) { - throw new System.NotImplementedException(); + var response = await GetRequest($"{_BasePath}/ByVisit/{visitId}?pageSize={pageSize}&pageIndex={pageIndex}"); + + List dto = JsonSerializer.Deserialize>(response, options); + + return dto; } - public Task> GetPacketSubmissionsByStatus(string packetStatus, int pageSize = 10, int pageIndex = 1) + public async Task> GetPacketSubmissionsByStatus(string packetStatus, int pageSize = 10, int pageIndex = 1) { - throw new System.NotImplementedException(); + var response = await GetRequest($"{_BasePath}/ByStatus/{packetStatus}?pageSize={pageSize}&pageIndex={pageIndex}"); + + List dto = JsonSerializer.Deserialize>(response, options); + + return dto; } - public Task PacketSubmissionErrorsCount(bool includeResolved = false) + public async Task PacketSubmissionErrorsCount(bool includeResolved = false) { - throw new System.NotImplementedException(); + var response = await GetRequest($"{_BasePath}/Errors/Count?includeResolved={includeResolved}"); + + int count = JsonSerializer.Deserialize(response, options); + + return count; } - public Task PacketSubmissionsErrorsCountByVisit(int visitId) + public async Task PacketSubmissionsErrorsCountByVisit(int visitId) { - throw new System.NotImplementedException(); + var response = await GetRequest($"{_BasePath}/Errors/Count/ByVisit/{visitId}"); + + int count = JsonSerializer.Deserialize(response, options); + + return count; } - public Task PacketSubmissionsErrorsCountyByAssignee(string assignedTo) + public async Task PacketSubmissionsErrorsCountByAssignee(string assignedTo) { - throw new System.NotImplementedException(); + var response = await GetRequest($"{_BasePath}/Errors/Count/ByAssignee/{assignedTo}"); + + int count = JsonSerializer.Deserialize(response, options); + + return count; } - public Task> GetPacketSubmissionErrors(bool includeResolved = false, int pageSize = 10, int pageIndex = 1) + public async Task> GetPacketSubmissionErrors(bool includeResolved = false, int pageSize = 10, int pageIndex = 1) { - throw new System.NotImplementedException(); + var response = await GetRequest($"{_BasePath}/Errors?includeResolved={includeResolved}&pageSize={pageSize}&pageIndex={pageIndex}"); + + List dto = JsonSerializer.Deserialize>(response, options); + + return dto; } - public Task> GetPacketSubmissionErrorsByVisit(int visitId, int pageSize = 10, int pageIndex = 1) + public async Task> GetPacketSubmissionErrorsByVisit(int visitId, int pageSize = 10, int pageIndex = 1) { - throw new System.NotImplementedException(); + var response = await GetRequest($"{_BasePath}/Errors/ByVisit/{visitId}?pageSize={pageSize}&pageIndex={pageIndex}"); + + List dto = JsonSerializer.Deserialize>(response, options); + + return dto; } - public Task> GetPacketSubmissionErrorsByAssignee(string assignedTo, int pageSize = 10, int pageIndex = 1) + public async Task> GetPacketSubmissionErrorsByAssignee(string assignedTo, int pageSize = 10, int pageIndex = 1) { - throw new System.NotImplementedException(); + var response = await GetRequest($"{_BasePath}/Errors/ByAssignee/{assignedTo}?pageSize={pageSize}&pageIndex={pageIndex}"); + + List dto = JsonSerializer.Deserialize>(response, options); + + return dto; } public async Task PostPacketSubmissionError(int packetSubmissionId, PacketSubmissionErrorDto dto) { + string json = JsonSerializer.Serialize(dto); - //string json = JsonSerializer.Serialize(dto); - - //var response = await PostRequest($"{_BasePath}/{id}/Forms/{formKind}", json); - throw new System.NotImplementedException(); + var response = await PostRequest($"{_BasePath}/{packetSubmissionId}/Errors", json); } - public async Task PutPacketSubmissionError(int packetSubmissionId, PacketSubmissionErrorDto dto) + public async Task PutPacketSubmissionError(int packetSubmissionId, int id, PacketSubmissionErrorDto dto) { - throw new System.NotImplementedException(); + string json = JsonSerializer.Serialize(dto); + + var response = await PutRequest($"{_BasePath}/{packetSubmissionId}/Errors/{id}", json); } } diff --git a/src/UDS.Net.API/Controllers/PacketSubmissionsController.cs b/src/UDS.Net.API/Controllers/PacketSubmissionsController.cs index 130b7ff..3d35865 100644 --- a/src/UDS.Net.API/Controllers/PacketSubmissionsController.cs +++ b/src/UDS.Net.API/Controllers/PacketSubmissionsController.cs @@ -32,15 +32,6 @@ public async Task PacketSubmissionsCountByStatus(string packetStatus) throw new NotImplementedException(); } - - - - [HttpDelete("{id}")] - public async Task Delete(int id) - { - throw new NotImplementedException(); - } - [HttpGet] public async Task> Get(int pageSize = 10, int pageIndex = 1) { @@ -53,6 +44,13 @@ public async Task> GetPacketSubmissionsByVisit(int vis throw new NotImplementedException(); } + [HttpGet("ByStatus/{packetStatus}", Name = "GetPacketSubmissionByStatus")] + public Task> GetPacketSubmissionsByStatus(string packetStatus, int pageSize = 10, int pageIndex = 1) + { + throw new NotImplementedException(); + } + + [HttpGet("{id}")] public async Task Get(int id) { @@ -71,75 +69,75 @@ public async Task Put(int id, PacketSubmissionDto dto) throw new NotImplementedException(); } - [HttpGet("Errors/ByAssigned/{assignedTo}", Name = "GetPacketSubmissionErrorsByAssigned")] - public async Task> GetPacketSubmissionErrorsByAssignee(string assignedTo) + [HttpDelete("{id}")] + public async Task Delete(int id) { throw new NotImplementedException(); } - [HttpGet("Errors/ByVisit/{visitId}", Name = "GetPacketSubmissionErrorsByVisit")] - public async Task> GetPacketSubmissionErrorsByVisit(int visitId) + [HttpGet("Errors/Count", Name = "PacketSubmissionErrorsCount")] + public async Task PacketSubmissionErrorsCount(bool includeResolved = false) { throw new NotImplementedException(); } - [HttpGet("Errors/ByStatus/{packetStatus}", Name = "GetPacketSubmissionErrorsByStatus")] - public async Task> GetPacketSubmissionsByStatus(string packetStatus) + [HttpGet("Errors/Count/ByVisit/{visitId}", Name = "PacketSubmissionErrorsCountByVisit")] + public Task PacketSubmissionsErrorsCountByVisit(int visitId) { throw new NotImplementedException(); } - - public async Task> GetPacketSubmissionErrors(bool includeResolved = false) + [HttpGet("Errors/Count/ByAssignee/{assignedTo}", Name = "PacketSubmissionErrorsCountByAssignee")] + public Task PacketSubmissionsErrorsCountByAssignee(string assignedTo) { + // order by unresolved then modifiedat throw new NotImplementedException(); } - public async Task PostPacketSubmissionError(int packetSubmissionId, PacketSubmissionErrorDto dto) - { - throw new NotImplementedException(); - } - public async Task PutPacketSubmissionError(int packetSubmissionId, PacketSubmissionErrorDto dto) + [HttpGet("Errors/ByAssigned/{assignedTo}", Name = "GetPacketSubmissionErrorsByAssigned")] + public async Task> GetPacketSubmissionErrorsByAssignee(string assignedTo) { throw new NotImplementedException(); } - - public Task> GetPacketSubmissionsByStatus(string packetStatus, int pageSize = 10, int pageIndex = 1) + [HttpGet("Errors/ByVisit/{visitId}", Name = "GetPacketSubmissionErrorsByVisit")] + public async Task> GetPacketSubmissionErrorsByVisit(int visitId) { throw new NotImplementedException(); } - public Task PacketSubmissionErrorsCount(bool includeResolved = false) + [HttpGet("Errors", Name = "GetPacketSubmissionErrors")] + public async Task> GetPacketSubmissionErrors(bool includeResolved = false, int pageSize = 10, int pageIndex = 1) { throw new NotImplementedException(); } - public Task PacketSubmissionsErrorsCountByVisit(int visitId) + [HttpGet("Errors/ByVisit/{visitId}", Name = "GetPacketSubmissionErrorsByVisit")] + public Task> GetPacketSubmissionErrorsByVisit(int visitId, int pageSize = 10, int pageIndex = 1) { throw new NotImplementedException(); } - public Task PacketSubmissionsErrorsCountyByAssignee(string assignedTo) + [HttpGet("Errors/ByAssignee/{assignedTo}", Name = "GetPacketSubmissionErrorsByAssignee")] + public Task> GetPacketSubmissionErrorsByAssignee(string assignedTo, int pageSize = 10, int pageIndex = 1) { throw new NotImplementedException(); } - public Task> GetPacketSubmissionErrors(bool includeResolved = false, int pageSize = 10, int pageIndex = 1) + [HttpPost("{packetSubmissionId}/Errors", Name = "PostPacketSubmissionError")] + public async Task PostPacketSubmissionError(int packetSubmissionId, PacketSubmissionErrorDto dto) { throw new NotImplementedException(); } - public Task> GetPacketSubmissionErrorsByVisit(int visitId, int pageSize = 10, int pageIndex = 1) + [HttpPut("{packetSubmissionId}/Errors/{id}", Name = "PutPacketSubmissionError")] + public async Task PutPacketSubmissionError(int packetSubmissionId, int id, PacketSubmissionErrorDto dto) { throw new NotImplementedException(); } - public Task> GetPacketSubmissionErrorsByAssignee(string assignedTo, int pageSize = 10, int pageIndex = 1) - { - throw new NotImplementedException(); - } + } } From 2600ef9c7624410f38efccac3f3268a6639355b0 Mon Sep 17 00:00:00 2001 From: Ashley Wilson Date: Fri, 26 Jul 2024 10:57:56 -0400 Subject: [PATCH 04/24] Add packet submission to dbcontext --- src/UDS.Net.API/Data/ApiDbContext.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/UDS.Net.API/Data/ApiDbContext.cs b/src/UDS.Net.API/Data/ApiDbContext.cs index 9f8a164..0bb0f57 100644 --- a/src/UDS.Net.API/Data/ApiDbContext.cs +++ b/src/UDS.Net.API/Data/ApiDbContext.cs @@ -9,7 +9,10 @@ public class ApiDbContext : DbContext public DbSet Participations { get; set; } public DbSet M1s { get; set; } public DbSet Visits { get; set; } + public DbSet PacketSubmissions { get; set; } + public DbSet PacketSubmissionErrors { get; set; } + /* Forms and instruments */ public DbSet A1s { get; set; } public DbSet A1as { get; set; } public DbSet A2s { get; set; } @@ -25,13 +28,13 @@ public class ApiDbContext : DbContext public DbSet B7s { get; set; } public DbSet B8s { get; set; } public DbSet B9s { get; set; } - public DbSet C1s { get; set; } + public DbSet C1s { get; set; } // TODO remove public DbSet C2s { get; set; } public DbSet D1as { get; set; } public DbSet D1bs { get; set; } - public DbSet T1s { get; set; } + public DbSet T1s { get; set; } // TODO remove - /* Lookup/reference tables */ + /* Lookup or reference tables */ public DbSet DrugCodesLookup { get; set; } /* SQL Views */ From cbd697b492469d0699493fbe3de207c68ef608bc Mon Sep 17 00:00:00 2001 From: Ashley Wilson Date: Fri, 26 Jul 2024 11:39:46 -0400 Subject: [PATCH 05/24] Add parent id properties --- src/UDS.Net.API.Client/UDS.Net.API.Client.csproj | 4 ++-- src/UDS.Net.API/Entities/PacketSubmissionError.cs | 4 ++++ src/UDS.Net.API/Extensions/DtoToEntityMapper.cs | 14 ++++++++++++++ src/UDS.Net.API/Extensions/EntityToDtoMapper.cs | 8 ++++++-- src/UDS.Net.API/UDS.Net.API.csproj | 2 +- src/UDS.Net.Dto/PacketSubmissionDto.cs | 2 ++ src/UDS.Net.Dto/PacketSubmissionErrorDto.cs | 2 ++ src/UDS.Net.Dto/UDS.Net.Dto.csproj | 4 ++-- src/UDS.Net.sln | 12 ++++++------ 9 files changed, 39 insertions(+), 13 deletions(-) diff --git a/src/UDS.Net.API.Client/UDS.Net.API.Client.csproj b/src/UDS.Net.API.Client/UDS.Net.API.Client.csproj index dd954a6..d670965 100644 --- a/src/UDS.Net.API.Client/UDS.Net.API.Client.csproj +++ b/src/UDS.Net.API.Client/UDS.Net.API.Client.csproj @@ -4,13 +4,13 @@ netstandard2.1 Library UDS.Net.API.Client - 3.1.0-preview.1 + 3.1.0-preview.2 Sanders-Brown Center on Aging UDS client library for using UDS.Net.API UK-SBCoA Client library for API https://github.com/UK-SBCoA/uniform-data-set-dotnet-api - 3.1.0-preview.1 + 3.1.0-preview.2 diff --git a/src/UDS.Net.API/Entities/PacketSubmissionError.cs b/src/UDS.Net.API/Entities/PacketSubmissionError.cs index b4e3795..c9a0be4 100644 --- a/src/UDS.Net.API/Entities/PacketSubmissionError.cs +++ b/src/UDS.Net.API/Entities/PacketSubmissionError.cs @@ -21,6 +21,10 @@ public class PacketSubmissionError : BaseEntity public PacketSubmissionErrorLevel Level { get; set; } public string ResolvedBy { get; set; } + + public PacketSubmission PacketSubmission { get; set; } + + public int PacketSubmissionId { get; set; } } } diff --git a/src/UDS.Net.API/Extensions/DtoToEntityMapper.cs b/src/UDS.Net.API/Extensions/DtoToEntityMapper.cs index c800a8b..69273e9 100644 --- a/src/UDS.Net.API/Extensions/DtoToEntityMapper.cs +++ b/src/UDS.Net.API/Extensions/DtoToEntityMapper.cs @@ -112,6 +112,18 @@ public static bool Update(this Visit entity, VisitDto dto) return false; } + // TODO + public static bool Convert(this PacketSubmissionDto dto) + { + return true; + } + + // TODO + public static bool Convert(this PacketSubmissionErrorDto dto) + { + return true; + } + public static M1 ToEntity(this M1Dto dto) { return new M1 @@ -1080,6 +1092,7 @@ public static bool Update(this B9 entity, B9Dto dto) return false; } + [Obsolete] public static bool Update(this C1 entity, C1Dto dto) { if (entity.Id == dto.Id) @@ -1500,6 +1513,7 @@ public static bool Update(this D1b entity, D1bDto dto) } + [Obsolete] public static bool Update(this T1 entity, T1Dto dto) { if (entity.Id == dto.Id) diff --git a/src/UDS.Net.API/Extensions/EntityToDtoMapper.cs b/src/UDS.Net.API/Extensions/EntityToDtoMapper.cs index 68d70e3..cfb100c 100644 --- a/src/UDS.Net.API/Extensions/EntityToDtoMapper.cs +++ b/src/UDS.Net.API/Extensions/EntityToDtoMapper.cs @@ -22,8 +22,8 @@ private static VisitDto ConvertVisitToDto(Visit visit) VISIT_DATE = visit.VISIT_DATE, INITIALS = visit.INITIALS, Status = visit.Status.ToString(), - //Forms = new List(), - //PacketSubmissions = new List() + //Forms = new List(), // TODO remove + //PacketSubmissions = new List() // TODO remove }; if (visit.PacketSubmissions != null && visit.PacketSubmissions.Count() > 0) @@ -1111,6 +1111,7 @@ public static B9Dto ToFullDto(this B9 b9) return dto; } + [Obsolete] public static C1Dto ToFullDto(this C1 c1) { C1Dto dto = new C1Dto @@ -1515,6 +1516,7 @@ public static D1bDto ToFullDto(this D1b d1b) return dto; } + [Obsolete] public static T1Dto ToFullDto(this T1 t1) { T1Dto dto = new T1Dto @@ -1625,6 +1627,7 @@ public static PacketSubmissionDto ToDto(this PacketSubmission packetSubmission) var dto = new PacketSubmissionDto { Id = packetSubmission.Id, + VisitId = packetSubmission.VisitId, SubmissionDate = packetSubmission.SubmissionDate, CreatedAt = packetSubmission.CreatedAt, CreatedBy = packetSubmission.CreatedBy, @@ -1659,6 +1662,7 @@ public static PacketSubmissionErrorDto ToDto(this PacketSubmissionError packetSu return new PacketSubmissionErrorDto() { Id = packetSubmissionError.Id, + PacketSubmissionId = packetSubmissionError.PacketSubmissionId, CreatedAt = packetSubmissionError.CreatedAt, CreatedBy = packetSubmissionError.CreatedBy, ModifiedBy = packetSubmissionError.ModifiedBy, diff --git a/src/UDS.Net.API/UDS.Net.API.csproj b/src/UDS.Net.API/UDS.Net.API.csproj index f93bff9..bffa62e 100644 --- a/src/UDS.Net.API/UDS.Net.API.csproj +++ b/src/UDS.Net.API/UDS.Net.API.csproj @@ -4,7 +4,7 @@ net6.0 enable enable - 3.1.0-preview.1 + 3.1.0-preview.2 ../docker-compose.dcproj c1dd1715-6fa0-4515-bcf2-6a7f6a0c11a5 Release;Debug diff --git a/src/UDS.Net.Dto/PacketSubmissionDto.cs b/src/UDS.Net.Dto/PacketSubmissionDto.cs index 25f2649..ed748af 100644 --- a/src/UDS.Net.Dto/PacketSubmissionDto.cs +++ b/src/UDS.Net.Dto/PacketSubmissionDto.cs @@ -5,6 +5,8 @@ namespace UDS.Net.Dto { public class PacketSubmissionDto : BaseDto { + public int VisitId { get; set; } + public DateTime SubmissionDate { get; set; } public int ErrorCount { get; set; } = 0; diff --git a/src/UDS.Net.Dto/PacketSubmissionErrorDto.cs b/src/UDS.Net.Dto/PacketSubmissionErrorDto.cs index 9494275..7eca2c0 100644 --- a/src/UDS.Net.Dto/PacketSubmissionErrorDto.cs +++ b/src/UDS.Net.Dto/PacketSubmissionErrorDto.cs @@ -4,6 +4,8 @@ public class PacketSubmissionErrorDto : BaseDto { public int Id { get; set; } + public int PacketSubmissionId { get; set; } + public string FormKind { get; set; } public string Message { get; set; } diff --git a/src/UDS.Net.Dto/UDS.Net.Dto.csproj b/src/UDS.Net.Dto/UDS.Net.Dto.csproj index b7f91f0..949b564 100644 --- a/src/UDS.Net.Dto/UDS.Net.Dto.csproj +++ b/src/UDS.Net.Dto/UDS.Net.Dto.csproj @@ -4,13 +4,13 @@ netstandard2.1 Library UDS.Net.Dto - 3.1.0-preview.1 + 3.1.0-preview.2 Sanders-Brown Center on Aging UDS data transfer objects for use with API UK-SBCoA Dtos for API https://github.com/UK-SBCoA/uniform-data-set-dotnet-api - 3.1.0-preview.1 + 3.1.0-preview.2 diff --git a/src/UDS.Net.sln b/src/UDS.Net.sln index be7fe3e..ac83d8a 100644 --- a/src/UDS.Net.sln +++ b/src/UDS.Net.sln @@ -9,7 +9,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UDS.Net.API.Client", "UDS.N EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UDS.Net.Dto", "UDS.Net.Dto\UDS.Net.Dto.csproj", "{E620B892-269C-423B-9AEF-375131FA6B0C}" EndProject -Project("{9344BDBB-3E7F-41FC-A0DD-8665D75EE146}") = "docker-compose", "docker-compose.dcproj", "{31CCF647-A7BC-443B-8726-A6076E832177}" +Project("{9344BDBB-3E7F-41FC-A0DD-8665D75EE146}") = "docker-compose", "docker-compose.dcproj", "{7310BEC5-2263-4999-AE9F-5E2942BEB2E4}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -29,10 +29,10 @@ Global {E620B892-269C-423B-9AEF-375131FA6B0C}.Debug|Any CPU.Build.0 = Debug|Any CPU {E620B892-269C-423B-9AEF-375131FA6B0C}.Release|Any CPU.ActiveCfg = Release|Any CPU {E620B892-269C-423B-9AEF-375131FA6B0C}.Release|Any CPU.Build.0 = Release|Any CPU - {31CCF647-A7BC-443B-8726-A6076E832177}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {31CCF647-A7BC-443B-8726-A6076E832177}.Debug|Any CPU.Build.0 = Debug|Any CPU - {31CCF647-A7BC-443B-8726-A6076E832177}.Release|Any CPU.ActiveCfg = Release|Any CPU - {31CCF647-A7BC-443B-8726-A6076E832177}.Release|Any CPU.Build.0 = Release|Any CPU + {7310BEC5-2263-4999-AE9F-5E2942BEB2E4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7310BEC5-2263-4999-AE9F-5E2942BEB2E4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7310BEC5-2263-4999-AE9F-5E2942BEB2E4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7310BEC5-2263-4999-AE9F-5E2942BEB2E4}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -41,6 +41,6 @@ Global SolutionGuid = {D39D5BFF-1FB6-4543-9752-418308400A84} EndGlobalSection GlobalSection(MonoDevelopProperties) = preSolution - version = 3.1.0-preview.1 + version = 3.1.0-preview.2 EndGlobalSection EndGlobal From 074b7ef45d8bef94fd8799b734d5bb07ccc15a1d Mon Sep 17 00:00:00 2001 From: Ashley Wilson Date: Fri, 26 Jul 2024 15:55:07 -0400 Subject: [PATCH 06/24] Remove duplication --- .../Controllers/PacketSubmissionsController.cs | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/src/UDS.Net.API/Controllers/PacketSubmissionsController.cs b/src/UDS.Net.API/Controllers/PacketSubmissionsController.cs index 3d35865..6a0490e 100644 --- a/src/UDS.Net.API/Controllers/PacketSubmissionsController.cs +++ b/src/UDS.Net.API/Controllers/PacketSubmissionsController.cs @@ -94,19 +94,6 @@ public Task PacketSubmissionsErrorsCountByAssignee(string assignedTo) throw new NotImplementedException(); } - - [HttpGet("Errors/ByAssigned/{assignedTo}", Name = "GetPacketSubmissionErrorsByAssigned")] - public async Task> GetPacketSubmissionErrorsByAssignee(string assignedTo) - { - throw new NotImplementedException(); - } - - [HttpGet("Errors/ByVisit/{visitId}", Name = "GetPacketSubmissionErrorsByVisit")] - public async Task> GetPacketSubmissionErrorsByVisit(int visitId) - { - throw new NotImplementedException(); - } - [HttpGet("Errors", Name = "GetPacketSubmissionErrors")] public async Task> GetPacketSubmissionErrors(bool includeResolved = false, int pageSize = 10, int pageIndex = 1) { From e33f95f999add9278992b3ab99cc80541a0b09c6 Mon Sep 17 00:00:00 2001 From: Ashley Wilson Date: Mon, 26 Aug 2024 14:47:00 -0400 Subject: [PATCH 07/24] Fix route to packet submissions --- src/UDS.Net.API.Client/UDS.Net.API.Client.csproj | 4 ++-- .../Controllers/PacketSubmissionsController.cs | 1 + src/UDS.Net.API/UDS.Net.API.csproj | 2 +- src/UDS.Net.Dto/UDS.Net.Dto.csproj | 4 ++-- src/UDS.Net.sln | 12 ++++++------ 5 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/UDS.Net.API.Client/UDS.Net.API.Client.csproj b/src/UDS.Net.API.Client/UDS.Net.API.Client.csproj index 4903c59..8f6f4ec 100644 --- a/src/UDS.Net.API.Client/UDS.Net.API.Client.csproj +++ b/src/UDS.Net.API.Client/UDS.Net.API.Client.csproj @@ -4,13 +4,13 @@ netstandard2.1 Library UDS.Net.API.Client - 4.1.0-preview.1 + 4.1.0-preview.2 Sanders-Brown Center on Aging UDS client library for using UDS.Net.API UK-SBCoA Client library for API https://github.com/UK-SBCoA/uniform-data-set-dotnet-api - 4.1.0-preview.1 + 4.1.0-preview.2 diff --git a/src/UDS.Net.API/Controllers/PacketSubmissionsController.cs b/src/UDS.Net.API/Controllers/PacketSubmissionsController.cs index 6a0490e..4edb867 100644 --- a/src/UDS.Net.API/Controllers/PacketSubmissionsController.cs +++ b/src/UDS.Net.API/Controllers/PacketSubmissionsController.cs @@ -5,6 +5,7 @@ namespace UDS.Net.API.Controllers { + [Route("api/[controller]")] public class PacketSubmissionsController : Controller, IPacketSubmissionClient { private readonly ApiDbContext _context; diff --git a/src/UDS.Net.API/UDS.Net.API.csproj b/src/UDS.Net.API/UDS.Net.API.csproj index dec5de4..cf01721 100644 --- a/src/UDS.Net.API/UDS.Net.API.csproj +++ b/src/UDS.Net.API/UDS.Net.API.csproj @@ -4,7 +4,7 @@ net6.0 enable enable - 4.1.0-preview.1 + 4.1.0-preview.2 ../docker-compose.dcproj c1dd1715-6fa0-4515-bcf2-6a7f6a0c11a5 Release;Debug diff --git a/src/UDS.Net.Dto/UDS.Net.Dto.csproj b/src/UDS.Net.Dto/UDS.Net.Dto.csproj index 5558fc8..aaa7978 100644 --- a/src/UDS.Net.Dto/UDS.Net.Dto.csproj +++ b/src/UDS.Net.Dto/UDS.Net.Dto.csproj @@ -4,13 +4,13 @@ netstandard2.1 Library UDS.Net.Dto - 4.1.0-preview.1 + 4.1.0-preview.2 Sanders-Brown Center on Aging UDS data transfer objects for use with API UK-SBCoA Dtos for API https://github.com/UK-SBCoA/uniform-data-set-dotnet-api - 4.1.0-preview.1 + 4.1.0-preview.2 diff --git a/src/UDS.Net.sln b/src/UDS.Net.sln index 40e5e2e..91ce000 100644 --- a/src/UDS.Net.sln +++ b/src/UDS.Net.sln @@ -9,7 +9,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UDS.Net.API.Client", "UDS.N EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UDS.Net.Dto", "UDS.Net.Dto\UDS.Net.Dto.csproj", "{E620B892-269C-423B-9AEF-375131FA6B0C}" EndProject -Project("{9344BDBB-3E7F-41FC-A0DD-8665D75EE146}") = "docker-compose", "docker-compose.dcproj", "{7310BEC5-2263-4999-AE9F-5E2942BEB2E4}" +Project("{9344BDBB-3E7F-41FC-A0DD-8665D75EE146}") = "docker-compose", "docker-compose.dcproj", "{39E8C306-DFC2-47D2-9AC0-7B4463A81DB0}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -29,10 +29,10 @@ Global {E620B892-269C-423B-9AEF-375131FA6B0C}.Debug|Any CPU.Build.0 = Debug|Any CPU {E620B892-269C-423B-9AEF-375131FA6B0C}.Release|Any CPU.ActiveCfg = Release|Any CPU {E620B892-269C-423B-9AEF-375131FA6B0C}.Release|Any CPU.Build.0 = Release|Any CPU - {7310BEC5-2263-4999-AE9F-5E2942BEB2E4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7310BEC5-2263-4999-AE9F-5E2942BEB2E4}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7310BEC5-2263-4999-AE9F-5E2942BEB2E4}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7310BEC5-2263-4999-AE9F-5E2942BEB2E4}.Release|Any CPU.Build.0 = Release|Any CPU + {39E8C306-DFC2-47D2-9AC0-7B4463A81DB0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {39E8C306-DFC2-47D2-9AC0-7B4463A81DB0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {39E8C306-DFC2-47D2-9AC0-7B4463A81DB0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {39E8C306-DFC2-47D2-9AC0-7B4463A81DB0}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -41,6 +41,6 @@ Global SolutionGuid = {D39D5BFF-1FB6-4543-9752-418308400A84} EndGlobalSection GlobalSection(MonoDevelopProperties) = preSolution - version = 4.1.0-preview.1 + version = 4.1.0-preview.2 EndGlobalSection EndGlobal From 97930a87640f59e60109f10dc94a2f0951ccb70d Mon Sep 17 00:00:00 2001 From: Ashley Wilson Date: Tue, 27 Aug 2024 07:52:22 -0400 Subject: [PATCH 08/24] Implements functionality for packet submissions and errors --- .../UDS.Net.API.Client.csproj | 4 +- .../PacketSubmissionsController.cs | 201 +++++++++++++++--- .../Extensions/DtoToEntityMapper.cs | 45 +++- .../Extensions/EntityToDtoMapper.cs | 33 ++- src/UDS.Net.API/UDS.Net.API.csproj | 2 +- src/UDS.Net.Dto/UDS.Net.Dto.csproj | 4 +- src/UDS.Net.sln | 2 +- 7 files changed, 250 insertions(+), 41 deletions(-) diff --git a/src/UDS.Net.API.Client/UDS.Net.API.Client.csproj b/src/UDS.Net.API.Client/UDS.Net.API.Client.csproj index 8f6f4ec..f481329 100644 --- a/src/UDS.Net.API.Client/UDS.Net.API.Client.csproj +++ b/src/UDS.Net.API.Client/UDS.Net.API.Client.csproj @@ -4,13 +4,13 @@ netstandard2.1 Library UDS.Net.API.Client - 4.1.0-preview.2 + 4.1.0-preview.3 Sanders-Brown Center on Aging UDS client library for using UDS.Net.API UK-SBCoA Client library for API https://github.com/UK-SBCoA/uniform-data-set-dotnet-api - 4.1.0-preview.2 + 4.1.0-preview.3 diff --git a/src/UDS.Net.API/Controllers/PacketSubmissionsController.cs b/src/UDS.Net.API/Controllers/PacketSubmissionsController.cs index 4edb867..363c5c8 100644 --- a/src/UDS.Net.API/Controllers/PacketSubmissionsController.cs +++ b/src/UDS.Net.API/Controllers/PacketSubmissionsController.cs @@ -1,6 +1,9 @@ using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; using UDS.Net.API.Client; using UDS.Net.API.Data; +using UDS.Net.API.Entities; +using UDS.Net.API.Extensions; using UDS.Net.Dto; namespace UDS.Net.API.Controllers @@ -18,111 +21,259 @@ public PacketSubmissionsController(ApiDbContext context) [HttpGet("Count", Name = "PacketSubmissionsCount")] public async Task Count() { - throw new NotImplementedException(); + return await _context.PacketSubmissions + .CountAsync(); } [HttpGet("Count/ByVisit/{visitId}", Name = "PacketSubmissionsCountByVisit")] public async Task PacketSubmissionsCountByVisit(int visitId) { - throw new NotImplementedException(); + return await _context.PacketSubmissions + .Where(p => p.VisitId == visitId) + .CountAsync(); } [HttpGet("Count/ByStatus/{packetStatus}", Name = "PacketSubmissionsCountByStatus")] public async Task PacketSubmissionsCountByStatus(string packetStatus) { - throw new NotImplementedException(); + return await _context.PacketSubmissions + .Include(p => p.Visit) + .Where(p => p.Visit.Status.ToString() == packetStatus) + .CountAsync(); } [HttpGet] public async Task> Get(int pageSize = 10, int pageIndex = 1) { - throw new NotImplementedException(); + return await _context.PacketSubmissions + .Include(p => p.Visit) + .AsNoTracking() + .Skip((pageIndex - 1) * pageSize) + .Take(pageSize) + .Select(p => p.ToDto()) + .ToListAsync(); } [HttpGet("ByVisit/{visitId}", Name = "GetPacketSubmissionByVisit")] public async Task> GetPacketSubmissionsByVisit(int visitId, int pageSize = 10, int pageIndex = 1) { - throw new NotImplementedException(); + var dto = await _context.PacketSubmissions + .Include(p => p.Visit) + .Include(p => p.PacketSubmissionErrors) + .Where(p => p.VisitId == visitId) + .AsNoTracking() + .Skip((pageIndex - 1) * pageSize) + .Take(pageSize) + .Select(p => p.ToDto(p.PacketSubmissionErrors.Count())) + .ToListAsync(); + + return dto; } [HttpGet("ByStatus/{packetStatus}", Name = "GetPacketSubmissionByStatus")] - public Task> GetPacketSubmissionsByStatus(string packetStatus, int pageSize = 10, int pageIndex = 1) + public async Task> GetPacketSubmissionsByStatus(string packetStatus, int pageSize = 10, int pageIndex = 1) { - throw new NotImplementedException(); + var dto = await _context.PacketSubmissions + .Include(p => p.Visit) + .Where(p => p.Visit.Status.ToString() == packetStatus) + .AsNoTracking() + .Skip((pageIndex - 1) * pageSize) + .Take(pageSize) + .Select(p => p.ToDto()) + .ToListAsync(); + + return dto; } [HttpGet("{id}")] public async Task Get(int id) { - throw new NotImplementedException(); + var dto = await _context.PacketSubmissions + .Include(p => p.PacketSubmissionErrors) + .Where(p => p.Id == id) + .Select(p => p.ToDto()) + .FirstOrDefaultAsync(); + + return dto; } [HttpPost] public async Task Post(PacketSubmissionDto dto) { - throw new NotImplementedException(); + var packetSubmission = dto.Convert(); + + _context.PacketSubmissions.Add(packetSubmission); + + await _context.SaveChangesAsync(); } [HttpPut("{id}")] - public async Task Put(int id, PacketSubmissionDto dto) + public async Task Put(int id, [FromBody] PacketSubmissionDto dto) { - throw new NotImplementedException(); + if (dto != null) + { + var existingSubmission = await _context.PacketSubmissions + .Include(p => p.PacketSubmissionErrors) + .Where(p => p.Id == id) + .FirstOrDefaultAsync(); + + if (existingSubmission != null) + { + existingSubmission.SubmissionDate = dto.SubmissionDate; + existingSubmission.ModifiedBy = dto.ModifiedBy; + + _context.PacketSubmissions.Update(existingSubmission); + await _context.SaveChangesAsync(); + } + } } [HttpDelete("{id}")] public async Task Delete(int id) { - throw new NotImplementedException(); + var existingSubmission = await _context.PacketSubmissions + .Include(p => p.PacketSubmissionErrors) + .Where(p => p.Id == id) + .FirstOrDefaultAsync(); + + if (existingSubmission != null) + { + _context.PacketSubmissions.Remove(existingSubmission); + await _context.SaveChangesAsync(); + } } [HttpGet("Errors/Count", Name = "PacketSubmissionErrorsCount")] public async Task PacketSubmissionErrorsCount(bool includeResolved = false) { - throw new NotImplementedException(); + if (includeResolved) + { + return await _context.PacketSubmissionErrors + .Where(e => String.IsNullOrWhiteSpace(e.ResolvedBy) == false) + .CountAsync(); + } + else + { + return await _context.PacketSubmissionErrors + .CountAsync(); + } } [HttpGet("Errors/Count/ByVisit/{visitId}", Name = "PacketSubmissionErrorsCountByVisit")] - public Task PacketSubmissionsErrorsCountByVisit(int visitId) + public async Task PacketSubmissionsErrorsCountByVisit(int visitId) { - throw new NotImplementedException(); + return await _context.PacketSubmissionErrors + .Include(e => e.PacketSubmission) + .Where(e => e.PacketSubmission.VisitId == visitId) + .CountAsync(); } [HttpGet("Errors/Count/ByAssignee/{assignedTo}", Name = "PacketSubmissionErrorsCountByAssignee")] - public Task PacketSubmissionsErrorsCountByAssignee(string assignedTo) + public async Task PacketSubmissionsErrorsCountByAssignee(string assignedTo) { - // order by unresolved then modifiedat - throw new NotImplementedException(); + return await _context.PacketSubmissionErrors + .Where(e => e.AssignedTo.ToLower().Trim() == assignedTo.ToLower().Trim()) + .CountAsync(); } [HttpGet("Errors", Name = "GetPacketSubmissionErrors")] public async Task> GetPacketSubmissionErrors(bool includeResolved = false, int pageSize = 10, int pageIndex = 1) { - throw new NotImplementedException(); + if (includeResolved) + { + return await _context.PacketSubmissionErrors + .Where(e => String.IsNullOrWhiteSpace(e.ResolvedBy) == false) + .AsNoTracking() + .Skip((pageIndex - 1) * pageSize) + .Take(pageSize) + .Select(p => p.ToDto()) + .ToListAsync(); + } + else + { + return await _context.PacketSubmissionErrors + .AsNoTracking() + .Skip((pageIndex - 1) * pageSize) + .Take(pageSize) + .Select(p => p.ToDto()) + .ToListAsync(); + } } [HttpGet("Errors/ByVisit/{visitId}", Name = "GetPacketSubmissionErrorsByVisit")] - public Task> GetPacketSubmissionErrorsByVisit(int visitId, int pageSize = 10, int pageIndex = 1) + public async Task> GetPacketSubmissionErrorsByVisit(int visitId, int pageSize = 10, int pageIndex = 1) { - throw new NotImplementedException(); + return await _context.PacketSubmissionErrors + .Include(e => e.PacketSubmission) + .Where(e => e.PacketSubmission.VisitId == visitId) + .AsNoTracking() + .Skip((pageIndex - 1) * pageSize) + .Take(pageSize) + .Select(p => p.ToDto()) + .ToListAsync(); } [HttpGet("Errors/ByAssignee/{assignedTo}", Name = "GetPacketSubmissionErrorsByAssignee")] - public Task> GetPacketSubmissionErrorsByAssignee(string assignedTo, int pageSize = 10, int pageIndex = 1) + public async Task> GetPacketSubmissionErrorsByAssignee(string assignedTo, int pageSize = 10, int pageIndex = 1) { - throw new NotImplementedException(); + return await _context.PacketSubmissionErrors + .Where(e => e.AssignedTo.ToLower().Trim() == assignedTo.ToLower().Trim()) + .AsNoTracking() + .Skip((pageIndex - 1) * pageSize) + .Take(pageSize) + .Select(p => p.ToDto()) + .ToListAsync(); } [HttpPost("{packetSubmissionId}/Errors", Name = "PostPacketSubmissionError")] public async Task PostPacketSubmissionError(int packetSubmissionId, PacketSubmissionErrorDto dto) { - throw new NotImplementedException(); + var packetSubmission = await _context.PacketSubmissions + .Include(p => p.PacketSubmissionErrors) + .Where(p => p.Id == packetSubmissionId) + .FirstOrDefaultAsync(); + + if (packetSubmission != null) + { + var error = dto.Convert(); + + packetSubmission.PacketSubmissionErrors.Add(error); + + _context.PacketSubmissions.Update(packetSubmission); + await _context.SaveChangesAsync(); + } } [HttpPut("{packetSubmissionId}/Errors/{id}", Name = "PutPacketSubmissionError")] public async Task PutPacketSubmissionError(int packetSubmissionId, int id, PacketSubmissionErrorDto dto) { - throw new NotImplementedException(); + var packetSubmission = await _context.PacketSubmissions + .Include(p => p.PacketSubmissionErrors) + .Where(p => p.Id == packetSubmissionId) + .FirstOrDefaultAsync(); + + if (packetSubmission != null) + { + var existingError = packetSubmission.PacketSubmissionErrors.Where(e => e.Id == id).FirstOrDefault(); + + if (existingError != null) + { + if (!string.IsNullOrWhiteSpace(dto.Level)) + { + if (Enum.TryParse(dto.Level, true, out PacketSubmissionErrorLevel level)) + existingError.Level = level; + } + + existingError.FormKind = dto.FormKind; + existingError.AssignedTo = dto.AssignedTo; + existingError.ResolvedBy = dto.ResolvedBy; + existingError.Message = dto.Message; + existingError.ModifiedBy = dto.ModifiedBy; + existingError.IsDeleted = dto.IsDeleted; + existingError.DeletedBy = dto.DeletedBy; + } + } } diff --git a/src/UDS.Net.API/Extensions/DtoToEntityMapper.cs b/src/UDS.Net.API/Extensions/DtoToEntityMapper.cs index 7d9ab8f..23b0c62 100644 --- a/src/UDS.Net.API/Extensions/DtoToEntityMapper.cs +++ b/src/UDS.Net.API/Extensions/DtoToEntityMapper.cs @@ -1,4 +1,5 @@ -using UDS.Net.API.Entities; +using System.Net.NetworkInformation; +using UDS.Net.API.Entities; using UDS.Net.Dto; namespace UDS.Net.API.Extensions @@ -112,16 +113,46 @@ public static bool Update(this Visit entity, VisitDto dto) return false; } - // TODO - public static bool Convert(this PacketSubmissionDto dto) + public static PacketSubmission Convert(this PacketSubmissionDto dto) { - return true; + return new PacketSubmission + { + Id = dto.Id, + VisitId = dto.VisitId, + SubmissionDate = dto.SubmissionDate, + CreatedAt = dto.CreatedAt, + CreatedBy = dto.CreatedBy, + ModifiedBy = dto.ModifiedBy, + IsDeleted = dto.IsDeleted, + DeletedBy = dto.DeletedBy, + PacketSubmissionErrors = dto.PacketSubmissionErrors.Select(e => e.Convert()).ToList() + }; } - // TODO - public static bool Convert(this PacketSubmissionErrorDto dto) + public static PacketSubmissionError Convert(this PacketSubmissionErrorDto dto) { - return true; + var entity = new PacketSubmissionError + { + Id = dto.Id, + PacketSubmissionId = dto.PacketSubmissionId, + FormKind = dto.FormKind, + Message = dto.Message, + AssignedTo = dto.AssignedTo, + ResolvedBy = dto.ResolvedBy, + CreatedAt = dto.CreatedAt, + CreatedBy = dto.CreatedBy, + ModifiedBy = dto.ModifiedBy, + IsDeleted = dto.IsDeleted, + DeletedBy = dto.DeletedBy + }; + + if (!string.IsNullOrWhiteSpace(dto.Level)) + { + if (Enum.TryParse(dto.Level, true, out PacketSubmissionErrorLevel level)) + entity.Level = level; + } + + return entity; } public static M1 ToEntity(this M1Dto dto) diff --git a/src/UDS.Net.API/Extensions/EntityToDtoMapper.cs b/src/UDS.Net.API/Extensions/EntityToDtoMapper.cs index 746e4ce..4c377a0 100644 --- a/src/UDS.Net.API/Extensions/EntityToDtoMapper.cs +++ b/src/UDS.Net.API/Extensions/EntityToDtoMapper.cs @@ -21,9 +21,7 @@ private static VisitDto ConvertVisitToDto(Visit visit) FORMVER = visit.FORMVER, VISIT_DATE = visit.VISIT_DATE, INITIALS = visit.INITIALS, - Status = visit.Status.ToString(), - //Forms = new List(), // TODO remove - //PacketSubmissions = new List() // TODO remove + Status = visit.Status.ToString() }; if (visit.PacketSubmissions != null && visit.PacketSubmissions.Count() > 0) @@ -1646,6 +1644,30 @@ public static PacketSubmissionDto ToDto(this PacketSubmission packetSubmission) return dto; } + public static PacketSubmissionDto ToDto(this PacketSubmission packetSubmission, int errorCount) + { + var dto = new PacketSubmissionDto + { + Id = packetSubmission.Id, + VisitId = packetSubmission.VisitId, + SubmissionDate = packetSubmission.SubmissionDate, + CreatedAt = packetSubmission.CreatedAt, + CreatedBy = packetSubmission.CreatedBy, + ModifiedBy = packetSubmission.ModifiedBy, + IsDeleted = packetSubmission.IsDeleted, + DeletedBy = packetSubmission.DeletedBy, + ErrorCount = errorCount + }; + + if (packetSubmission.PacketSubmissionErrors != null && packetSubmission.PacketSubmissionErrors.Count() > 0) + { + dto.PacketSubmissionErrors = packetSubmission.PacketSubmissionErrors.ToDto(); + } + + return dto; + } + + public static List ToDto(this List packetSubmissionErrors) { List dto = new List(); @@ -1664,6 +1686,11 @@ public static PacketSubmissionErrorDto ToDto(this PacketSubmissionError packetSu { Id = packetSubmissionError.Id, PacketSubmissionId = packetSubmissionError.PacketSubmissionId, + FormKind = packetSubmissionError.FormKind, + Level = packetSubmissionError.Level.ToString(), + Message = packetSubmissionError.Message, + AssignedTo = packetSubmissionError.AssignedTo, + ResolvedBy = packetSubmissionError.ResolvedBy, CreatedAt = packetSubmissionError.CreatedAt, CreatedBy = packetSubmissionError.CreatedBy, ModifiedBy = packetSubmissionError.ModifiedBy, diff --git a/src/UDS.Net.API/UDS.Net.API.csproj b/src/UDS.Net.API/UDS.Net.API.csproj index cf01721..4b965db 100644 --- a/src/UDS.Net.API/UDS.Net.API.csproj +++ b/src/UDS.Net.API/UDS.Net.API.csproj @@ -4,7 +4,7 @@ net6.0 enable enable - 4.1.0-preview.2 + 4.1.0-preview.3 ../docker-compose.dcproj c1dd1715-6fa0-4515-bcf2-6a7f6a0c11a5 Release;Debug diff --git a/src/UDS.Net.Dto/UDS.Net.Dto.csproj b/src/UDS.Net.Dto/UDS.Net.Dto.csproj index aaa7978..3c61277 100644 --- a/src/UDS.Net.Dto/UDS.Net.Dto.csproj +++ b/src/UDS.Net.Dto/UDS.Net.Dto.csproj @@ -4,13 +4,13 @@ netstandard2.1 Library UDS.Net.Dto - 4.1.0-preview.2 + 4.1.0-preview.3 Sanders-Brown Center on Aging UDS data transfer objects for use with API UK-SBCoA Dtos for API https://github.com/UK-SBCoA/uniform-data-set-dotnet-api - 4.1.0-preview.2 + 4.1.0-preview.3 diff --git a/src/UDS.Net.sln b/src/UDS.Net.sln index 91ce000..dbf0ed0 100644 --- a/src/UDS.Net.sln +++ b/src/UDS.Net.sln @@ -41,6 +41,6 @@ Global SolutionGuid = {D39D5BFF-1FB6-4543-9752-418308400A84} EndGlobalSection GlobalSection(MonoDevelopProperties) = preSolution - version = 4.1.0-preview.2 + version = 4.1.0-preview.3 EndGlobalSection EndGlobal From 70847747da54443252fc3f3addc2d987ea6cfbe5 Mon Sep 17 00:00:00 2001 From: Ashley Wilson Date: Thu, 29 Aug 2024 08:01:26 -0400 Subject: [PATCH 09/24] Add get visit with packet submissions paginated --- src/UDS.Net.API.Client/IVisitClient.cs | 2 ++ .../UDS.Net.API.Client.csproj | 4 +-- src/UDS.Net.API.Client/VisitClient.cs | 9 ++++++ .../Controllers/VisitsController.cs | 30 +++++++++++++++++++ src/UDS.Net.API/UDS.Net.API.csproj | 2 +- src/UDS.Net.Dto/UDS.Net.Dto.csproj | 4 +-- src/UDS.Net.sln | 12 ++++---- 7 files changed, 52 insertions(+), 11 deletions(-) diff --git a/src/UDS.Net.API.Client/IVisitClient.cs b/src/UDS.Net.API.Client/IVisitClient.cs index 79283ae..ca99712 100644 --- a/src/UDS.Net.API.Client/IVisitClient.cs +++ b/src/UDS.Net.API.Client/IVisitClient.cs @@ -5,6 +5,8 @@ namespace UDS.Net.API.Client { public interface IVisitClient : IBaseClient { + Task GetWithPacketSubmissions(int id, int pageSize = 10, int pageIndex = 1); + Task GetWithForm(int id, string formKind); Task PostWithForm(int id, string formKind, VisitDto dto); diff --git a/src/UDS.Net.API.Client/UDS.Net.API.Client.csproj b/src/UDS.Net.API.Client/UDS.Net.API.Client.csproj index f481329..51c15d8 100644 --- a/src/UDS.Net.API.Client/UDS.Net.API.Client.csproj +++ b/src/UDS.Net.API.Client/UDS.Net.API.Client.csproj @@ -4,13 +4,13 @@ netstandard2.1 Library UDS.Net.API.Client - 4.1.0-preview.3 + 4.1.0-preview.4 Sanders-Brown Center on Aging UDS client library for using UDS.Net.API UK-SBCoA Client library for API https://github.com/UK-SBCoA/uniform-data-set-dotnet-api - 4.1.0-preview.3 + 4.1.0-preview.4 diff --git a/src/UDS.Net.API.Client/VisitClient.cs b/src/UDS.Net.API.Client/VisitClient.cs index 3fdbb8a..8aad8de 100644 --- a/src/UDS.Net.API.Client/VisitClient.cs +++ b/src/UDS.Net.API.Client/VisitClient.cs @@ -13,6 +13,15 @@ public VisitClient(HttpClient httpClient) : base(httpClient, BASEPATH) { } + public async Task GetWithPacketSubmissions(int id, int pageSize = 10, int pageIndex = 1) + { + var response = await GetRequest($"{_BasePath}/{id}/WithPacketSubmissions?pageSize={pageSize}&pageIndex={pageIndex}"); + + VisitDto? dto = JsonSerializer.Deserialize(response, options); + + return dto; + } + public async Task GetWithForm(int id, string formKind) { var response = await GetRequest($"{_BasePath}/{id}/Forms/{formKind}"); diff --git a/src/UDS.Net.API/Controllers/VisitsController.cs b/src/UDS.Net.API/Controllers/VisitsController.cs index e417878..86d0700 100644 --- a/src/UDS.Net.API/Controllers/VisitsController.cs +++ b/src/UDS.Net.API/Controllers/VisitsController.cs @@ -244,6 +244,36 @@ public async Task Get(int id) .Select(v => v.ToDto()) .FirstOrDefaultAsync(); + dto.PacketSubmissionCount = await _context.PacketSubmissions + .Where(p => p.VisitId == id) + .CountAsync(); + + return dto; + } + + [HttpGet("{id}/WithPacketSubmissions", Name = "GetWithPacketSubmissions")] + public async Task GetWithPacketSubmissions(int id, int pageSize = 10, int pageIndex = 1) + { + var dto = await _context.Visits + .Include(v => v.FormStatuses) + .AsNoTracking() + .Where(v => v.Id == id) + .Select(v => v.ToDto()) + .FirstOrDefaultAsync(); + + var packetSubmissions = await _context.PacketSubmissions + .Include(p => p.PacketSubmissionErrors) + .AsNoTracking() + .Skip((pageIndex - 1) * pageSize) + .Take(pageSize) + .Select(v => v.ToDto()) + .ToListAsync(); + + dto.PacketSubmissions = packetSubmissions; + dto.PacketSubmissionCount = await _context.PacketSubmissions + .Where(p => p.VisitId == id) + .CountAsync(); + return dto; } diff --git a/src/UDS.Net.API/UDS.Net.API.csproj b/src/UDS.Net.API/UDS.Net.API.csproj index 4b965db..381ae72 100644 --- a/src/UDS.Net.API/UDS.Net.API.csproj +++ b/src/UDS.Net.API/UDS.Net.API.csproj @@ -4,7 +4,7 @@ net6.0 enable enable - 4.1.0-preview.3 + 4.1.0-preview.4 ../docker-compose.dcproj c1dd1715-6fa0-4515-bcf2-6a7f6a0c11a5 Release;Debug diff --git a/src/UDS.Net.Dto/UDS.Net.Dto.csproj b/src/UDS.Net.Dto/UDS.Net.Dto.csproj index 3c61277..740cc32 100644 --- a/src/UDS.Net.Dto/UDS.Net.Dto.csproj +++ b/src/UDS.Net.Dto/UDS.Net.Dto.csproj @@ -4,13 +4,13 @@ netstandard2.1 Library UDS.Net.Dto - 4.1.0-preview.3 + 4.1.0-preview.4 Sanders-Brown Center on Aging UDS data transfer objects for use with API UK-SBCoA Dtos for API https://github.com/UK-SBCoA/uniform-data-set-dotnet-api - 4.1.0-preview.3 + 4.1.0-preview.4 diff --git a/src/UDS.Net.sln b/src/UDS.Net.sln index dbf0ed0..39215e6 100644 --- a/src/UDS.Net.sln +++ b/src/UDS.Net.sln @@ -9,7 +9,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UDS.Net.API.Client", "UDS.N EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UDS.Net.Dto", "UDS.Net.Dto\UDS.Net.Dto.csproj", "{E620B892-269C-423B-9AEF-375131FA6B0C}" EndProject -Project("{9344BDBB-3E7F-41FC-A0DD-8665D75EE146}") = "docker-compose", "docker-compose.dcproj", "{39E8C306-DFC2-47D2-9AC0-7B4463A81DB0}" +Project("{9344BDBB-3E7F-41FC-A0DD-8665D75EE146}") = "docker-compose", "docker-compose.dcproj", "{843F811C-348F-4B76-96EA-BF6C4618300C}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -29,10 +29,10 @@ Global {E620B892-269C-423B-9AEF-375131FA6B0C}.Debug|Any CPU.Build.0 = Debug|Any CPU {E620B892-269C-423B-9AEF-375131FA6B0C}.Release|Any CPU.ActiveCfg = Release|Any CPU {E620B892-269C-423B-9AEF-375131FA6B0C}.Release|Any CPU.Build.0 = Release|Any CPU - {39E8C306-DFC2-47D2-9AC0-7B4463A81DB0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {39E8C306-DFC2-47D2-9AC0-7B4463A81DB0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {39E8C306-DFC2-47D2-9AC0-7B4463A81DB0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {39E8C306-DFC2-47D2-9AC0-7B4463A81DB0}.Release|Any CPU.Build.0 = Release|Any CPU + {843F811C-348F-4B76-96EA-BF6C4618300C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {843F811C-348F-4B76-96EA-BF6C4618300C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {843F811C-348F-4B76-96EA-BF6C4618300C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {843F811C-348F-4B76-96EA-BF6C4618300C}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -41,6 +41,6 @@ Global SolutionGuid = {D39D5BFF-1FB6-4543-9752-418308400A84} EndGlobalSection GlobalSection(MonoDevelopProperties) = preSolution - version = 4.1.0-preview.3 + version = 4.1.0-preview.4 EndGlobalSection EndGlobal From c47bbecafe749055693442f4ea5d9cfb0f758e80 Mon Sep 17 00:00:00 2001 From: Ashley Wilson Date: Wed, 4 Sep 2024 13:05:17 -0400 Subject: [PATCH 10/24] Add ability to gather all forms for packet submission --- .../IPacketSubmissionClient.cs | 2 + .../PacketSubmissionClient.cs | 10 ++- .../UDS.Net.API.Client.csproj | 4 +- .../PacketSubmissionsController.cs | 62 ++++++++++++++++++- src/UDS.Net.API/UDS.Net.API.csproj | 2 +- src/UDS.Net.Dto/PacketSubmissionDto.cs | 36 +++++++++++ src/UDS.Net.Dto/UDS.Net.Dto.csproj | 4 +- src/UDS.Net.sln | 2 +- 8 files changed, 113 insertions(+), 9 deletions(-) diff --git a/src/UDS.Net.API.Client/IPacketSubmissionClient.cs b/src/UDS.Net.API.Client/IPacketSubmissionClient.cs index 45156ea..cd4498e 100644 --- a/src/UDS.Net.API.Client/IPacketSubmissionClient.cs +++ b/src/UDS.Net.API.Client/IPacketSubmissionClient.cs @@ -6,6 +6,8 @@ namespace UDS.Net.API.Client { public interface IPacketSubmissionClient : IBaseClient { + Task GetPacketSubmissionWithForms(int id); + Task PacketSubmissionsCountByVisit(int visitId); Task PacketSubmissionsCountByStatus(string packetStatus); diff --git a/src/UDS.Net.API.Client/PacketSubmissionClient.cs b/src/UDS.Net.API.Client/PacketSubmissionClient.cs index 126bf65..4aa7649 100644 --- a/src/UDS.Net.API.Client/PacketSubmissionClient.cs +++ b/src/UDS.Net.API.Client/PacketSubmissionClient.cs @@ -14,6 +14,15 @@ public PacketSubmissionClient(HttpClient httpClient) : base(httpClient, BASEPATH { } + public async Task GetPacketSubmissionWithForms(int id) + { + var response = await GetRequest($"{_BasePath}/{id}/IncludeForms"); + + PacketSubmissionDto dto = JsonSerializer.Deserialize(response, options); + + return dto; + } + public async Task PacketSubmissionsCountByVisit(int visitId) { var response = await GetRequest($"{_BasePath}/Count/ByVisit/{visitId}"); @@ -117,7 +126,6 @@ public async Task PutPacketSubmissionError(int packetSubmissionId, int id, Packe var response = await PutRequest($"{_BasePath}/{packetSubmissionId}/Errors/{id}", json); } - } } diff --git a/src/UDS.Net.API.Client/UDS.Net.API.Client.csproj b/src/UDS.Net.API.Client/UDS.Net.API.Client.csproj index 51c15d8..52922fb 100644 --- a/src/UDS.Net.API.Client/UDS.Net.API.Client.csproj +++ b/src/UDS.Net.API.Client/UDS.Net.API.Client.csproj @@ -4,13 +4,13 @@ netstandard2.1 Library UDS.Net.API.Client - 4.1.0-preview.4 + 4.1.0-preview.5 Sanders-Brown Center on Aging UDS client library for using UDS.Net.API UK-SBCoA Client library for API https://github.com/UK-SBCoA/uniform-data-set-dotnet-api - 4.1.0-preview.4 + 4.1.0-preview.5 diff --git a/src/UDS.Net.API/Controllers/PacketSubmissionsController.cs b/src/UDS.Net.API/Controllers/PacketSubmissionsController.cs index 363c5c8..fa971c4 100644 --- a/src/UDS.Net.API/Controllers/PacketSubmissionsController.cs +++ b/src/UDS.Net.API/Controllers/PacketSubmissionsController.cs @@ -85,7 +85,6 @@ public async Task> GetPacketSubmissionsByStatus(string return dto; } - [HttpGet("{id}")] public async Task Get(int id) { @@ -98,6 +97,66 @@ public async Task Get(int id) return dto; } + [HttpGet("{id}/IncludeForms")] + public async Task GetPacketSubmissionWithForms(int id) + { + var dto = await _context.PacketSubmissions + .Where(p => p.Id == id) + .AsNoTracking() + .Select(p => p.ToDto()) + .FirstOrDefaultAsync(); + + if (dto != null) + { + var visit = await _context.Visits + .Include(v => v.A1) + .Include(v => v.A1a) + .Include(v => v.A2) + .Include(v => v.A3) + .Include(v => v.A4) + .Include(v => v.A4a) + .Include(v => v.A5D2) + .Include(v => v.B1) + .Include(v => v.B3) + .Include(v => v.B4) + .Include(v => v.B5) + .Include(v => v.B6) + .Include(v => v.B7) + .Include(v => v.B8) + .Include(v => v.B9) + .Include(v => v.C2) + .Include(v => v.D1a) + .Include(v => v.D1b) + .Where(v => v.Id == dto.VisitId) + .AsNoTracking() + .FirstOrDefaultAsync(); + + if (visit != null) + { + dto.A1 = visit.A1.ToFullDto(); + dto.A1a = visit.A1a.ToFullDto(); + dto.A2 = visit.A2.ToFullDto(); + dto.A3 = visit.A3.ToFullDto(); + dto.A4 = visit.A4.ToFullDto(); + dto.A4a = visit.A4a.ToFullDto(); + dto.A5D2 = visit.A5D2.ToFullDto(); + dto.B1 = visit.B1.ToFullDto(); + dto.B3 = visit.B3.ToFullDto(); + dto.B4 = visit.B4.ToFullDto(); + dto.B5 = visit.B5.ToFullDto(); + dto.B6 = visit.B6.ToFullDto(); + dto.B7 = visit.B7.ToFullDto(); + dto.B8 = visit.B8.ToFullDto(); + dto.B9 = visit.B9.ToFullDto(); + dto.C2 = visit.C2.ToFullDto(); + dto.D1a = visit.D1a.ToFullDto(); + dto.D1b = visit.D1b.ToFullDto(); + } + } + + return dto; + } + [HttpPost] public async Task Post(PacketSubmissionDto dto) { @@ -276,7 +335,6 @@ public async Task PutPacketSubmissionError(int packetSubmissionId, int id, Packe } } - } } diff --git a/src/UDS.Net.API/UDS.Net.API.csproj b/src/UDS.Net.API/UDS.Net.API.csproj index 381ae72..4a9c5be 100644 --- a/src/UDS.Net.API/UDS.Net.API.csproj +++ b/src/UDS.Net.API/UDS.Net.API.csproj @@ -4,7 +4,7 @@ net6.0 enable enable - 4.1.0-preview.4 + 4.1.0-preview.5 ../docker-compose.dcproj c1dd1715-6fa0-4515-bcf2-6a7f6a0c11a5 Release;Debug diff --git a/src/UDS.Net.Dto/PacketSubmissionDto.cs b/src/UDS.Net.Dto/PacketSubmissionDto.cs index ed748af..7e6de26 100644 --- a/src/UDS.Net.Dto/PacketSubmissionDto.cs +++ b/src/UDS.Net.Dto/PacketSubmissionDto.cs @@ -12,6 +12,42 @@ public class PacketSubmissionDto : BaseDto public int ErrorCount { get; set; } = 0; public List PacketSubmissionErrors { get; set; } = new List(); + + public A1Dto A1 { get; set; } + + public A1aDto A1a { get; set; } + + public A2Dto A2 { get; set; } + + public A3Dto A3 { get; set; } + + public A4Dto A4 { get; set; } + + public A4aDto A4a { get; set; } + + public A5D2Dto A5D2 { get; set; } + + public B1Dto B1 { get; set; } + + public B3Dto B3 { get; set; } + + public B4Dto B4 { get; set; } + + public B5Dto B5 { get; set; } + + public B6Dto B6 { get; set; } + + public B7Dto B7 { get; set; } + + public B8Dto B8 { get; set; } + + public B9Dto B9 { get; set; } + + public C2Dto C2 { get; set; } + + public D1aDto D1a { get; set; } + + public D1bDto D1b { get; set; } } } diff --git a/src/UDS.Net.Dto/UDS.Net.Dto.csproj b/src/UDS.Net.Dto/UDS.Net.Dto.csproj index 740cc32..585b394 100644 --- a/src/UDS.Net.Dto/UDS.Net.Dto.csproj +++ b/src/UDS.Net.Dto/UDS.Net.Dto.csproj @@ -4,13 +4,13 @@ netstandard2.1 Library UDS.Net.Dto - 4.1.0-preview.4 + 4.1.0-preview.5 Sanders-Brown Center on Aging UDS data transfer objects for use with API UK-SBCoA Dtos for API https://github.com/UK-SBCoA/uniform-data-set-dotnet-api - 4.1.0-preview.4 + 4.1.0-preview.5 diff --git a/src/UDS.Net.sln b/src/UDS.Net.sln index 39215e6..50ba2a0 100644 --- a/src/UDS.Net.sln +++ b/src/UDS.Net.sln @@ -41,6 +41,6 @@ Global SolutionGuid = {D39D5BFF-1FB6-4543-9752-418308400A84} EndGlobalSection GlobalSection(MonoDevelopProperties) = preSolution - version = 4.1.0-preview.4 + version = 4.1.0-preview.5 EndGlobalSection EndGlobal From 4072564a268b3c5a23f6eb577b8923bddee0f6d6 Mon Sep 17 00:00:00 2001 From: Ashley Wilson Date: Wed, 4 Sep 2024 14:12:31 -0400 Subject: [PATCH 11/24] Adjust to a collection of forms in packet submission --- .../UDS.Net.API.Client.csproj | 4 +- .../PacketSubmissionsController.cs | 39 ++++++++++--------- src/UDS.Net.API/UDS.Net.API.csproj | 2 +- src/UDS.Net.Dto/FormDto.cs | 2 - src/UDS.Net.Dto/PacketSubmissionDto.cs | 36 +---------------- src/UDS.Net.Dto/PacketSubmissionFormsDto.cs | 13 +++++++ src/UDS.Net.Dto/UDS.Net.Dto.csproj | 4 +- src/UDS.Net.sln | 2 +- 8 files changed, 41 insertions(+), 61 deletions(-) create mode 100644 src/UDS.Net.Dto/PacketSubmissionFormsDto.cs diff --git a/src/UDS.Net.API.Client/UDS.Net.API.Client.csproj b/src/UDS.Net.API.Client/UDS.Net.API.Client.csproj index 52922fb..007f138 100644 --- a/src/UDS.Net.API.Client/UDS.Net.API.Client.csproj +++ b/src/UDS.Net.API.Client/UDS.Net.API.Client.csproj @@ -4,13 +4,13 @@ netstandard2.1 Library UDS.Net.API.Client - 4.1.0-preview.5 + 4.1.0-preview.6 Sanders-Brown Center on Aging UDS client library for using UDS.Net.API UK-SBCoA Client library for API https://github.com/UK-SBCoA/uniform-data-set-dotnet-api - 4.1.0-preview.5 + 4.1.0-preview.6 diff --git a/src/UDS.Net.API/Controllers/PacketSubmissionsController.cs b/src/UDS.Net.API/Controllers/PacketSubmissionsController.cs index fa971c4..188a7b1 100644 --- a/src/UDS.Net.API/Controllers/PacketSubmissionsController.cs +++ b/src/UDS.Net.API/Controllers/PacketSubmissionsController.cs @@ -133,24 +133,27 @@ public async Task GetPacketSubmissionWithForms(int id) if (visit != null) { - dto.A1 = visit.A1.ToFullDto(); - dto.A1a = visit.A1a.ToFullDto(); - dto.A2 = visit.A2.ToFullDto(); - dto.A3 = visit.A3.ToFullDto(); - dto.A4 = visit.A4.ToFullDto(); - dto.A4a = visit.A4a.ToFullDto(); - dto.A5D2 = visit.A5D2.ToFullDto(); - dto.B1 = visit.B1.ToFullDto(); - dto.B3 = visit.B3.ToFullDto(); - dto.B4 = visit.B4.ToFullDto(); - dto.B5 = visit.B5.ToFullDto(); - dto.B6 = visit.B6.ToFullDto(); - dto.B7 = visit.B7.ToFullDto(); - dto.B8 = visit.B8.ToFullDto(); - dto.B9 = visit.B9.ToFullDto(); - dto.C2 = visit.C2.ToFullDto(); - dto.D1a = visit.D1a.ToFullDto(); - dto.D1b = visit.D1b.ToFullDto(); + dto.Forms = new PacketSubmissionFormsDto(); + dto.Forms.Period = DateTime.Now; // TODO implement temporality with dto.CreatedAt + + dto.Forms.Add(visit.A1.ToFullDto()); + dto.Forms.Add(visit.A1a.ToFullDto()); + dto.Forms.Add(visit.A2.ToFullDto()); + dto.Forms.Add(visit.A3.ToFullDto()); + dto.Forms.Add(visit.A4.ToFullDto()); + dto.Forms.Add(visit.A4a.ToFullDto()); + dto.Forms.Add(visit.A5D2.ToFullDto()); + dto.Forms.Add(visit.B1.ToFullDto()); + dto.Forms.Add(visit.B3.ToFullDto()); + dto.Forms.Add(visit.B4.ToFullDto()); + dto.Forms.Add(visit.B5.ToFullDto()); + dto.Forms.Add(visit.B6.ToFullDto()); + dto.Forms.Add(visit.B7.ToFullDto()); + dto.Forms.Add(visit.B8.ToFullDto()); + dto.Forms.Add(visit.B9.ToFullDto()); + dto.Forms.Add(visit.C2.ToFullDto()); + dto.Forms.Add(visit.D1a.ToFullDto()); + dto.Forms.Add(visit.D1b.ToFullDto()); } } diff --git a/src/UDS.Net.API/UDS.Net.API.csproj b/src/UDS.Net.API/UDS.Net.API.csproj index 4a9c5be..a63a71a 100644 --- a/src/UDS.Net.API/UDS.Net.API.csproj +++ b/src/UDS.Net.API/UDS.Net.API.csproj @@ -4,7 +4,7 @@ net6.0 enable enable - 4.1.0-preview.5 + 4.1.0-preview.6 ../docker-compose.dcproj c1dd1715-6fa0-4515-bcf2-6a7f6a0c11a5 Release;Debug diff --git a/src/UDS.Net.Dto/FormDto.cs b/src/UDS.Net.Dto/FormDto.cs index e1a8640..c43e6f5 100644 --- a/src/UDS.Net.Dto/FormDto.cs +++ b/src/UDS.Net.Dto/FormDto.cs @@ -19,11 +19,9 @@ namespace UDS.Net.Dto [JsonDerivedType(typeof(B7Dto), "B7Dto")] [JsonDerivedType(typeof(B8Dto), "B8Dto")] [JsonDerivedType(typeof(B9Dto), "B9Dto")] - [JsonDerivedType(typeof(C1Dto), "C1Dto")] [JsonDerivedType(typeof(C2Dto), "C2Dto")] [JsonDerivedType(typeof(D1aDto), "D1aDto")] [JsonDerivedType(typeof(D1bDto), "D1bDto")] - [JsonDerivedType(typeof(T1Dto), "T1Dto")] public class FormDto : BaseDto { public int VisitId { get; set; } diff --git a/src/UDS.Net.Dto/PacketSubmissionDto.cs b/src/UDS.Net.Dto/PacketSubmissionDto.cs index 7e6de26..0624a9b 100644 --- a/src/UDS.Net.Dto/PacketSubmissionDto.cs +++ b/src/UDS.Net.Dto/PacketSubmissionDto.cs @@ -13,41 +13,7 @@ public class PacketSubmissionDto : BaseDto public List PacketSubmissionErrors { get; set; } = new List(); - public A1Dto A1 { get; set; } - - public A1aDto A1a { get; set; } - - public A2Dto A2 { get; set; } - - public A3Dto A3 { get; set; } - - public A4Dto A4 { get; set; } - - public A4aDto A4a { get; set; } - - public A5D2Dto A5D2 { get; set; } - - public B1Dto B1 { get; set; } - - public B3Dto B3 { get; set; } - - public B4Dto B4 { get; set; } - - public B5Dto B5 { get; set; } - - public B6Dto B6 { get; set; } - - public B7Dto B7 { get; set; } - - public B8Dto B8 { get; set; } - - public B9Dto B9 { get; set; } - - public C2Dto C2 { get; set; } - - public D1aDto D1a { get; set; } - - public D1bDto D1b { get; set; } + public PacketSubmissionFormsDto Forms { get; set; } } } diff --git a/src/UDS.Net.Dto/PacketSubmissionFormsDto.cs b/src/UDS.Net.Dto/PacketSubmissionFormsDto.cs new file mode 100644 index 0000000..3c8be0c --- /dev/null +++ b/src/UDS.Net.Dto/PacketSubmissionFormsDto.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; + +namespace UDS.Net.Dto +{ + public class PacketSubmissionFormsDto : List + { + // The time period when the data was submitted + public DateTime Period { get; set; } + + } +} + diff --git a/src/UDS.Net.Dto/UDS.Net.Dto.csproj b/src/UDS.Net.Dto/UDS.Net.Dto.csproj index 585b394..f47c44e 100644 --- a/src/UDS.Net.Dto/UDS.Net.Dto.csproj +++ b/src/UDS.Net.Dto/UDS.Net.Dto.csproj @@ -4,13 +4,13 @@ netstandard2.1 Library UDS.Net.Dto - 4.1.0-preview.5 + 4.1.0-preview.6 Sanders-Brown Center on Aging UDS data transfer objects for use with API UK-SBCoA Dtos for API https://github.com/UK-SBCoA/uniform-data-set-dotnet-api - 4.1.0-preview.5 + 4.1.0-preview.6 diff --git a/src/UDS.Net.sln b/src/UDS.Net.sln index 50ba2a0..8de505d 100644 --- a/src/UDS.Net.sln +++ b/src/UDS.Net.sln @@ -41,6 +41,6 @@ Global SolutionGuid = {D39D5BFF-1FB6-4543-9752-418308400A84} EndGlobalSection GlobalSection(MonoDevelopProperties) = preSolution - version = 4.1.0-preview.5 + version = 4.1.0-preview.6 EndGlobalSection EndGlobal From f63f3f02041635870664634434416b7db8b6aa0a Mon Sep 17 00:00:00 2001 From: Ashley Wilson Date: Mon, 14 Oct 2024 15:53:18 -0400 Subject: [PATCH 12/24] Upgrade to .NET 8 --- src/UDS.Net.API.Client/UDS.Net.API.Client.csproj | 8 ++++---- src/UDS.Net.API/UDS.Net.API.csproj | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/UDS.Net.API.Client/UDS.Net.API.Client.csproj b/src/UDS.Net.API.Client/UDS.Net.API.Client.csproj index 007f138..14ca913 100644 --- a/src/UDS.Net.API.Client/UDS.Net.API.Client.csproj +++ b/src/UDS.Net.API.Client/UDS.Net.API.Client.csproj @@ -13,10 +13,10 @@ 4.1.0-preview.6 - - - - + + + + diff --git a/src/UDS.Net.API/UDS.Net.API.csproj b/src/UDS.Net.API/UDS.Net.API.csproj index a63a71a..7191302 100644 --- a/src/UDS.Net.API/UDS.Net.API.csproj +++ b/src/UDS.Net.API/UDS.Net.API.csproj @@ -1,7 +1,7 @@ - net6.0 + net8.0 enable enable 4.1.0-preview.6 @@ -22,15 +22,15 @@ - - + + runtime; build; native; contentfiles; analyzers; buildtransitive all - + runtime; build; native; contentfiles; analyzers; buildtransitive all - + \ No newline at end of file From 746981fecde1b69748afd602b0df61850c139622 Mon Sep 17 00:00:00 2001 From: Ashley Wilson Date: Wed, 16 Oct 2024 09:33:43 -0400 Subject: [PATCH 13/24] In-progress --- ...181754_SupportPacketSubmission.Designer.cs | 8920 +++++++++++++++++ .../20240814181754_SupportPacketSubmission.cs | 100 + .../Migrations/ApiDbContextModelSnapshot.cs | 128 + src/UDS.Net.API/Entities/PacketStatus.cs | 3 +- 4 files changed, 9150 insertions(+), 1 deletion(-) create mode 100644 src/UDS.Net.API/Data/Migrations/20240814181754_SupportPacketSubmission.Designer.cs create mode 100644 src/UDS.Net.API/Data/Migrations/20240814181754_SupportPacketSubmission.cs diff --git a/src/UDS.Net.API/Data/Migrations/20240814181754_SupportPacketSubmission.Designer.cs b/src/UDS.Net.API/Data/Migrations/20240814181754_SupportPacketSubmission.Designer.cs new file mode 100644 index 0000000..58d1bf7 --- /dev/null +++ b/src/UDS.Net.API/Data/Migrations/20240814181754_SupportPacketSubmission.Designer.cs @@ -0,0 +1,8920 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using UDS.Net.API.Data; + +#nullable disable + +namespace UDS.Net.API.Data.Migrations +{ + [DbContext(typeof(ApiDbContext))] + [Migration("20240814181754_SupportPacketSubmission")] + partial class SupportPacketSubmission + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "7.0.5") + .HasAnnotation("Relational:MaxIdentifierLength", 128); + + SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); + + modelBuilder.Entity("UDS.Net.API.Entities.A1", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("FormId") + .HasColumnOrder(0); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("ADINAT") + .HasColumnType("int"); + + b.Property("ADISTATE") + .HasColumnType("int"); + + b.Property("BIRTHMO") + .HasColumnType("int"); + + b.Property("BIRTHSEX") + .HasColumnType("int"); + + b.Property("BIRTHYR") + .HasColumnType("int"); + + b.Property("CHLDHDCTRY") + .HasMaxLength(3) + .HasColumnType("nvarchar(3)"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DeletedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("EDUC") + .HasColumnType("int"); + + b.Property("ETHAFAMER") + .HasColumnType("int"); + + b.Property("ETHASNOTH") + .HasColumnType("int"); + + b.Property("ETHASNOTHX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("ETHBLKOTH") + .HasColumnType("int"); + + b.Property("ETHBLKOTHX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("ETHCHAMOR") + .HasColumnType("int"); + + b.Property("ETHCHINESE") + .HasColumnType("int"); + + b.Property("ETHCUBAN") + .HasColumnType("int"); + + b.Property("ETHDOMIN") + .HasColumnType("int"); + + b.Property("ETHEGYPT") + .HasColumnType("int"); + + b.Property("ETHENGLISH") + .HasColumnType("int"); + + b.Property("ETHETHIOP") + .HasColumnType("int"); + + b.Property("ETHFIJIAN") + .HasColumnType("int"); + + b.Property("ETHFILIP") + .HasColumnType("int"); + + b.Property("ETHGERMAN") + .HasColumnType("int"); + + b.Property("ETHGUATEM") + .HasColumnType("int"); + + b.Property("ETHHAITIAN") + .HasColumnType("int"); + + b.Property("ETHHAWAII") + .HasColumnType("int"); + + b.Property("ETHHISOTH") + .HasColumnType("int"); + + b.Property("ETHHISOTHX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("ETHINDIA") + .HasColumnType("int"); + + b.Property("ETHIRAN") + .HasColumnType("int"); + + b.Property("ETHIRAQI") + .HasColumnType("int"); + + b.Property("ETHIRISH") + .HasColumnType("int"); + + b.Property("ETHISPANIC") + .HasColumnType("int"); + + b.Property("ETHISRAEL") + .HasColumnType("int"); + + b.Property("ETHITALIAN") + .HasColumnType("int"); + + b.Property("ETHJAMAICA") + .HasColumnType("int"); + + b.Property("ETHJAPAN") + .HasColumnType("int"); + + b.Property("ETHKOREAN") + .HasColumnType("int"); + + b.Property("ETHLEBANON") + .HasColumnType("int"); + + b.Property("ETHMARSHAL") + .HasColumnType("int"); + + b.Property("ETHMENAOTH") + .HasColumnType("int"); + + b.Property("ETHMENAOTX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("ETHMEXICAN") + .HasColumnType("int"); + + b.Property("ETHNHPIOTH") + .HasColumnType("int"); + + b.Property("ETHNHPIOTX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("ETHNIGERIA") + .HasColumnType("int"); + + b.Property("ETHPOLISH") + .HasColumnType("int"); + + b.Property("ETHPUERTO") + .HasColumnType("int"); + + b.Property("ETHSALVA") + .HasColumnType("int"); + + b.Property("ETHSAMOAN") + .HasColumnType("int"); + + b.Property("ETHSCOTT") + .HasColumnType("int"); + + b.Property("ETHSOMALI") + .HasColumnType("int"); + + b.Property("ETHSYRIA") + .HasColumnType("int"); + + b.Property("ETHTONGAN") + .HasColumnType("int"); + + b.Property("ETHVIETNAM") + .HasColumnType("int"); + + b.Property("ETHWHIOTH") + .HasColumnType("int"); + + b.Property("ETHWHIOTHX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("EXRTIME") + .HasColumnType("int"); + + b.Property("FRMDATE") + .HasColumnType("datetime2") + .HasColumnName("FRMDATE") + .HasColumnOrder(3); + + b.Property("GENDKN") + .HasColumnType("int"); + + b.Property("GENMAN") + .HasColumnType("int"); + + b.Property("GENNOANS") + .HasColumnType("int"); + + b.Property("GENNONBI") + .HasColumnType("int"); + + b.Property("GENOTH") + .HasColumnType("int"); + + b.Property("GENOTHX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("GENTRMAN") + .HasColumnType("int"); + + b.Property("GENTRWOMAN") + .HasColumnType("int"); + + b.Property("GENTWOSPIR") + .HasColumnType("int"); + + b.Property("GENWOMAN") + .HasColumnType("int"); + + b.Property("HANDED") + .HasColumnType("int"); + + b.Property("INITIALS") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("nvarchar(3)") + .HasColumnName("INITIALS") + .HasColumnOrder(4); + + b.Property("INTERSEX") + .HasColumnType("int"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LANG") + .HasColumnType("int") + .HasColumnName("LANG") + .HasColumnOrder(5); + + b.Property("LIVSITUA") + .HasColumnType("int"); + + b.Property("LVLEDUC") + .HasColumnType("int"); + + b.Property("MARISTAT") + .HasColumnType("int"); + + b.Property("MEDVA") + .HasColumnType("int"); + + b.Property("MEMTEN") + .HasColumnType("int"); + + b.Property("MEMTROUB") + .HasColumnType("int"); + + b.Property("MEMWORS") + .HasColumnType("int"); + + b.Property("MODE") + .HasColumnType("int") + .HasColumnName("MODE") + .HasColumnOrder(6); + + b.Property("ModifiedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("NOT") + .HasColumnType("int") + .HasColumnName("NOT") + .HasColumnOrder(9); + + b.Property("PREDOMLAN") + .HasColumnType("int"); + + b.Property("PREDOMLANX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("PRIOCC") + .HasColumnType("int"); + + b.Property("RACEAIAN") + .HasColumnType("int"); + + b.Property("RACEAIANX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("RACEASIAN") + .HasColumnType("int"); + + b.Property("RACEBLACK") + .HasColumnType("int"); + + b.Property("RACEMENA") + .HasColumnType("int"); + + b.Property("RACENHPI") + .HasColumnType("int"); + + b.Property("RACEUNKN") + .HasColumnType("int"); + + b.Property("RACEWHITE") + .HasColumnType("int"); + + b.Property("REFCTRREGX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("REFCTRSOCX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("REFERSC") + .HasColumnType("int"); + + b.Property("REFERSCX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("REFLEARNED") + .HasColumnType("int"); + + b.Property("REFOTHMEDX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("REFOTHREGX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("REFOTHWEBX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("REFOTHX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("RESIDENC") + .HasColumnType("int"); + + b.Property("RMMODE") + .HasColumnType("int") + .HasColumnName("RMMODE") + .HasColumnOrder(8); + + b.Property("RMREAS") + .HasColumnType("int") + .HasColumnName("RMREASON") + .HasColumnOrder(7); + + b.Property("SERVED") + .HasColumnType("int"); + + b.Property("SEXORNBI") + .HasColumnType("int"); + + b.Property("SEXORNDNK") + .HasColumnType("int"); + + b.Property("SEXORNGAY") + .HasColumnType("int"); + + b.Property("SEXORNHET") + .HasColumnType("int"); + + b.Property("SEXORNNOAN") + .HasColumnType("int"); + + b.Property("SEXORNOTH") + .HasColumnType("int"); + + b.Property("SEXORNOTHX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("SEXORNTWOS") + .HasColumnType("int"); + + b.Property("SOURCENW") + .HasColumnType("int"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("nvarchar(20)") + .HasColumnOrder(2); + + b.Property("VisitId") + .HasColumnType("int") + .HasColumnOrder(1); + + b.Property("ZIP") + .HasMaxLength(3) + .HasColumnType("nvarchar(3)"); + + b.HasKey("Id"); + + b.HasIndex("VisitId") + .IsUnique(); + + b.ToTable("tbl_A1s"); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.A1a", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("FormId") + .HasColumnOrder(0); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("ABANDONED") + .HasColumnType("int") + .HasComment("21. I often feel abandoned"); + + b.Property("ACTAFRAID") + .HasColumnType("int") + .HasComment("36. In your day-to-day life how often do people act as if they are afraid of you?"); + + b.Property("BILLPAY") + .HasColumnType("int") + .HasComment("9. How difficult is it for you to meet monthly payments on your bills?"); + + b.Property("CHILDCOMM") + .HasColumnType("int") + .HasComment("24. If you have children, how often do you have contact with your children (including child[ren]-in-law and stepchild[ren]) either in person, by phone, mail, or email (e.g., any online interaction)?"); + + b.Property("CLOSEFRND") + .HasColumnType("int") + .HasComment("22. I miss having a really good friend"); + + b.Property("COMPCOMM") + .HasColumnType("int") + .HasComment("15a. Where would you place yourself on this ladder compared to others in your community (or neighborhood)? Please mark the number where you would place yourself."); + + b.Property("COMPUSA") + .HasColumnType("int") + .HasComment("15b. Where would you place yourself on this ladder compared to others in the U.S.?"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DELAYMED") + .HasColumnType("int") + .HasComment("28. In the past year, how often did you delay seeking medical attention for a problem that was bothering you?"); + + b.Property("DOCADVICE") + .HasColumnType("int") + .HasComment("31. In the past year, how often did you follow a doctor's advice or treatment plan when it was given?"); + + b.Property("DeletedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("EATLESS") + .HasColumnType("int") + .HasComment("11. At any time, did you ever eat less than you felt you should because there wasn't enough money to buy food?"); + + b.Property("EATLESSYR") + .HasColumnType("int") + .HasComment("12. In the last 12 months, did you ever eat less than you felt you should because there wasn't enough money to buy food?"); + + b.Property("EMPTINESS") + .HasColumnType("int") + .HasComment("18. I experience a general sense of emptiness"); + + b.Property("EXPAGE") + .HasColumnType("bit") + .HasComment("39a4. Main reason--Your age"); + + b.Property("EXPANCEST") + .HasColumnType("bit") + .HasComment("39a1. Main reason--Your Ancestry or National Origins"); + + b.Property("EXPAPPEAR") + .HasColumnType("bit") + .HasComment("39a8. Main reason--Some other aspect of your physical appearance"); + + b.Property("EXPDISAB") + .HasColumnType("bit") + .HasComment("39a11. Main reason--A physical disability"); + + b.Property("EXPEDUCINC") + .HasColumnType("bit") + .HasComment("39a10. Main reason--Your education or income level"); + + b.Property("EXPGENDER") + .HasColumnType("bit") + .HasComment("39a2. Main reason--Your gender"); + + b.Property("EXPHEIGHT") + .HasColumnType("bit") + .HasComment("39a6. Main reason--Your height"); + + b.Property("EXPNOANS") + .HasColumnType("bit") + .HasComment("39a15. Main reason--Prefer not to answer"); + + b.Property("EXPNOTAPP") + .HasColumnType("bit") + .HasComment("39a14. Main reason -- not applicable - I do not have these experiences in my day to day life"); + + b.Property("EXPOTHER") + .HasColumnType("bit") + .HasComment("39a13. Main reason -- Other"); + + b.Property("EXPRACE") + .HasColumnType("bit") + .HasComment("39a3. Main reason--Your race"); + + b.Property("EXPRELIG") + .HasColumnType("bit") + .HasComment("39a5. Main reason--Your religion"); + + b.Property("EXPSEXORN") + .HasColumnType("bit") + .HasComment("39a9. Main reason--Your sexual orientation"); + + b.Property("EXPSKIN") + .HasColumnType("bit") + .HasComment("39a12. Main reason--Your shade of skin color"); + + b.Property("EXPSTRS") + .HasColumnType("int") + .HasComment("40. When you have had day-to-day experiences like those in questions 33 to 38, would you say they have been very stressful, moderately stressful, or not stressful?"); + + b.Property("EXPWEIGHT") + .HasColumnType("bit") + .HasComment("39a7. Main reason--Your weight"); + + b.Property("FAMCOMP") + .HasColumnType("int") + .HasComment("15c. Thinking of your childhood, where would your family have been placed on this ladder compared to others in your community (or neighborhood)?"); + + b.Property("FINSATIS") + .HasColumnType("int") + .HasComment("8. How satisfied are you with your current personal financial condition?"); + + b.Property("FINUPSET") + .HasColumnType("int") + .HasComment("10. If you have had financial problems that lasted twelve months or longer, how upsetting has it been to you?"); + + b.Property("FRIENDCOMM") + .HasColumnType("int") + .HasComment("25. How often do you have contact with close friends either in person, by phone, mail, or email (e.g., any online interaction)?"); + + b.Property("FRIENDS") + .HasColumnType("int") + .HasComment("20. I feel like I don't have enough friends"); + + b.Property("FRMDATE") + .HasColumnType("datetime2") + .HasColumnName("FRMDATE") + .HasColumnOrder(3); + + b.Property("GUARD2EDU") + .HasColumnType("int") + .HasComment("17. If there was a second person who raised you (e.g., your mother, father, grandmother, etc.?), what was that person's highest level of education completed?"); + + b.Property("GUARD2REL") + .HasColumnType("int") + .HasComment("17a. What was this second person's relationship to you (if applicable)?"); + + b.Property("GUARD2RELX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasComment("17a1. Specify other relationship"); + + b.Property("GUARDEDU") + .HasColumnType("int") + .HasComment("16. Thinking of the person who raised you, what was their highest level of education completed?"); + + b.Property("GUARDREL") + .HasColumnType("int") + .HasComment("16a. What was this person's relationship to you?"); + + b.Property("GUARDRELX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasComment("16a1. Specify other relationship"); + + b.Property("HEALTHACC") + .HasColumnType("int") + .HasComment("32. Overall, which of these describes your health insurance, access to healthcare services, and access to medications?"); + + b.Property("INCOMEYR") + .HasColumnType("int") + .HasComment("7. Which of these income groups represents your household income for the past year? Include income from all sources such as wages, salaries, social security or retirement benefits, help from relatives, rent from property, and so forth."); + + b.Property("INITIALS") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("nvarchar(3)") + .HasColumnName("INITIALS") + .HasColumnOrder(4); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LANG") + .HasColumnType("int") + .HasColumnName("LANG") + .HasColumnOrder(5); + + b.Property("LESSCOURT") + .HasColumnType("int") + .HasComment("33. In your day-to-day life how often are you treated with less courtesy or respect than other people?"); + + b.Property("LESSMEDS") + .HasColumnType("int") + .HasComment("13. At any time, have you ended up taking less medication than was prescribed for you because of the cost?"); + + b.Property("LESSMEDSYR") + .HasColumnType("int") + .HasComment("14. In the last 12 months, have you ended up taking less medication than was prescribed for you because of the cost?"); + + b.Property("MISSEDFUP") + .HasColumnType("int") + .HasComment("30. In the past year, how often did you miss a follow-up medical appointment that was scheduled?"); + + b.Property("MISSPEOPLE") + .HasColumnType("int") + .HasComment("19. I miss having people around"); + + b.Property("MODE") + .HasColumnType("int") + .HasColumnName("MODE") + .HasColumnOrder(6); + + b.Property("ModifiedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("NOT") + .HasColumnType("int") + .HasColumnName("NOT") + .HasColumnOrder(9); + + b.Property("NOTSMART") + .HasColumnType("int") + .HasComment("35. In your day-to-day life how often do people act as if they think you are not smart?"); + + b.Property("OWNSCAR") + .HasColumnType("int") + .HasComment("1. Do you or someone in your household currently own a car?"); + + b.Property("PARENTCOMM") + .HasColumnType("int") + .HasComment("23. If your parents are still alive, how often do you have contact with them (including mother, father, mother-in-law, and father-in-law) either in person, by phone, mail, or email (e.g., any online interaction)?"); + + b.Property("PARTICIPATE") + .HasColumnType("int") + .HasComment("26. How often do you participate in activities outside the home (e.g., religious activities, educational activities, volunteer work, paid work, or activities with groups or organizations)?"); + + b.Property("POORMEDTRT") + .HasColumnType("int") + .HasComment("38. How frequently did you receive poorer service or treatment from doctors or in hospitals compared to other people?"); + + b.Property("POORSERV") + .HasColumnType("int") + .HasComment("34. In your day-to-day life how often do you receive poorer service than other people at restaurants or stores?"); + + b.Property("RMMODE") + .HasColumnType("int") + .HasColumnName("RMMODE") + .HasColumnOrder(8); + + b.Property("RMREAS") + .HasColumnType("int") + .HasColumnName("RMREASON") + .HasColumnOrder(7); + + b.Property("SAFECOMM") + .HasColumnType("int") + .HasComment("27b. How safe do you feel in your community (or neighborhood)?"); + + b.Property("SAFEHOME") + .HasColumnType("int") + .HasComment("27a. How safe do you feel in your home?"); + + b.Property("SCRIPTPROB") + .HasColumnType("int") + .HasComment("29. In the past year, how often did you experience challenges in filling a prescription?"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("nvarchar(20)") + .HasColumnOrder(2); + + b.Property("THREATENED") + .HasColumnType("int") + .HasComment("37. In your day-to-day life how often are you threatened or harassed?"); + + b.Property("TRANSPROB") + .HasColumnType("int") + .HasComment("3. In the past 30 days, how often were you not able to leave the house when you wanted to because of a problem with transportation?"); + + b.Property("TRANSWORRY") + .HasColumnType("int") + .HasComment("4. In the past 30 days, how often did you worry about whether or not you would be able to get somewhere because of a problem with transportation?"); + + b.Property("TRSPACCESS") + .HasColumnType("int") + .HasComment("2. Do you have consistent access to transportation?"); + + b.Property("TRSPLONGER") + .HasColumnType("int") + .HasComment("5. In the past 30 days, how often did it take you longer to get somewhere than it would have taken you if you had different transportation?"); + + b.Property("TRSPMED") + .HasColumnType("int") + .HasComment("6. In the past 30 days, how often has a lack of transportation kept you from medical appointments or from doing things needed for daily living?"); + + b.Property("VisitId") + .HasColumnType("int") + .HasColumnOrder(1); + + b.HasKey("Id"); + + b.HasIndex("VisitId") + .IsUnique(); + + b.ToTable("tbl_A1as"); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.A2", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("FormId") + .HasColumnOrder(0); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DeletedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("FRMDATE") + .HasColumnType("datetime2") + .HasColumnName("FRMDATE") + .HasColumnOrder(3); + + b.Property("INCNTFRQ") + .HasColumnType("int"); + + b.Property("INCNTMDX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("INCNTMOD") + .HasColumnType("int"); + + b.Property("INCNTTIM") + .HasColumnType("int"); + + b.Property("INITIALS") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("nvarchar(3)") + .HasColumnName("INITIALS") + .HasColumnOrder(4); + + b.Property("INKNOWN") + .HasColumnType("int"); + + b.Property("INLIVWTH") + .HasColumnType("int"); + + b.Property("INMEMTEN") + .HasColumnType("int"); + + b.Property("INMEMTROUB") + .HasColumnType("int"); + + b.Property("INMEMWORS") + .HasColumnType("int"); + + b.Property("INRELTO") + .HasColumnType("int"); + + b.Property("INRELY") + .HasColumnType("int"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LANG") + .HasColumnType("int") + .HasColumnName("LANG") + .HasColumnOrder(5); + + b.Property("MODE") + .HasColumnType("int") + .HasColumnName("MODE") + .HasColumnOrder(6); + + b.Property("ModifiedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("NEWINF") + .HasColumnType("int"); + + b.Property("NOT") + .HasColumnType("int") + .HasColumnName("NOT") + .HasColumnOrder(9); + + b.Property("RMMODE") + .HasColumnType("int") + .HasColumnName("RMMODE") + .HasColumnOrder(8); + + b.Property("RMREAS") + .HasColumnType("int") + .HasColumnName("RMREASON") + .HasColumnOrder(7); + + b.Property("Status") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("nvarchar(20)") + .HasColumnOrder(2); + + b.Property("VisitId") + .HasColumnType("int") + .HasColumnOrder(1); + + b.HasKey("Id"); + + b.HasIndex("VisitId") + .IsUnique(); + + b.ToTable("tbl_A2s"); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.A3", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("FormId") + .HasColumnOrder(0); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("AFFFAMM") + .HasColumnType("int"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DADAGEO") + .HasColumnType("int"); + + b.Property("DADDAGE") + .HasColumnType("int"); + + b.Property("DADETPR") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b.Property("DADETSEC") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b.Property("DADMEVAL") + .HasColumnType("int"); + + b.Property("DADYOB") + .HasColumnType("int"); + + b.Property("DeletedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("FRMDATE") + .HasColumnType("datetime2") + .HasColumnName("FRMDATE") + .HasColumnOrder(3); + + b.Property("INITIALS") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("nvarchar(3)") + .HasColumnName("INITIALS") + .HasColumnOrder(4); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("KIDS") + .HasColumnType("int"); + + b.Property("LANG") + .HasColumnType("int") + .HasColumnName("LANG") + .HasColumnOrder(5); + + b.Property("MODE") + .HasColumnType("int") + .HasColumnName("MODE") + .HasColumnOrder(6); + + b.Property("MOMAGEO") + .HasColumnType("int"); + + b.Property("MOMDAGE") + .HasColumnType("int"); + + b.Property("MOMETPR") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b.Property("MOMETSEC") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b.Property("MOMMEVAL") + .HasColumnType("int"); + + b.Property("MOMYOB") + .HasColumnType("int"); + + b.Property("ModifiedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("NOT") + .HasColumnType("int") + .HasColumnName("NOT") + .HasColumnOrder(9); + + b.Property("NWINFKID") + .HasColumnType("int"); + + b.Property("NWINFMUT") + .HasColumnType("int"); + + b.Property("NWINFSIB") + .HasColumnType("int"); + + b.Property("RMMODE") + .HasColumnType("int") + .HasColumnName("RMMODE") + .HasColumnOrder(8); + + b.Property("RMREAS") + .HasColumnType("int") + .HasColumnName("RMREASON") + .HasColumnOrder(7); + + b.Property("SIBS") + .HasColumnType("int"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("nvarchar(20)") + .HasColumnOrder(2); + + b.Property("VisitId") + .HasColumnType("int") + .HasColumnOrder(1); + + b.HasKey("Id"); + + b.HasIndex("VisitId") + .IsUnique(); + + b.ToTable("tbl_A3s"); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.A4", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("FormId") + .HasColumnOrder(0); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("ANYMEDS") + .HasColumnType("int"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DeletedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("FRMDATE") + .HasColumnType("datetime2") + .HasColumnName("FRMDATE") + .HasColumnOrder(3); + + b.Property("INITIALS") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("nvarchar(3)") + .HasColumnName("INITIALS") + .HasColumnOrder(4); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LANG") + .HasColumnType("int") + .HasColumnName("LANG") + .HasColumnOrder(5); + + b.Property("MODE") + .HasColumnType("int") + .HasColumnName("MODE") + .HasColumnOrder(6); + + b.Property("ModifiedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("NOT") + .HasColumnType("int") + .HasColumnName("NOT") + .HasColumnOrder(9); + + b.Property("RMMODE") + .HasColumnType("int") + .HasColumnName("RMMODE") + .HasColumnOrder(8); + + b.Property("RMREAS") + .HasColumnType("int") + .HasColumnName("RMREASON") + .HasColumnOrder(7); + + b.Property("Status") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("nvarchar(20)") + .HasColumnOrder(2); + + b.Property("VisitId") + .HasColumnType("int") + .HasColumnOrder(1); + + b.HasKey("Id"); + + b.HasIndex("VisitId") + .IsUnique(); + + b.ToTable("tbl_A4s"); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.A4a", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("FormId") + .HasColumnOrder(0); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("ADVERSEOTH") + .HasColumnType("bit"); + + b.Property("ADVERSEOTX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("ADVEVENT") + .HasColumnType("int"); + + b.Property("ARIAE") + .HasColumnType("bit"); + + b.Property("ARIAH") + .HasColumnType("bit"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DeletedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("FRMDATE") + .HasColumnType("datetime2") + .HasColumnName("FRMDATE") + .HasColumnOrder(3); + + b.Property("INITIALS") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("nvarchar(3)") + .HasColumnName("INITIALS") + .HasColumnOrder(4); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LANG") + .HasColumnType("int") + .HasColumnName("LANG") + .HasColumnOrder(5); + + b.Property("MODE") + .HasColumnType("int") + .HasColumnName("MODE") + .HasColumnOrder(6); + + b.Property("ModifiedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("NOT") + .HasColumnType("int") + .HasColumnName("NOT") + .HasColumnOrder(9); + + b.Property("RMMODE") + .HasColumnType("int") + .HasColumnName("RMMODE") + .HasColumnOrder(8); + + b.Property("RMREAS") + .HasColumnType("int") + .HasColumnName("RMREASON") + .HasColumnOrder(7); + + b.Property("Status") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("nvarchar(20)") + .HasColumnOrder(2); + + b.Property("TRTBIOMARK") + .HasColumnType("int"); + + b.Property("VisitId") + .HasColumnType("int") + .HasColumnOrder(1); + + b.HasKey("Id"); + + b.HasIndex("VisitId") + .IsUnique(); + + b.ToTable("tbl_A4as"); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.A5D2", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("FormId") + .HasColumnOrder(0); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("ALCBINGE") + .HasColumnType("int") + .HasComment("In the past 12 months, how often did the participant have six or more drinks containing alcohol in one day?"); + + b.Property("ALCDRINKS") + .HasColumnType("int") + .HasComment("On a day when the participant drinks alcoholic beverages, how many standard drinks does the participant typically consume?"); + + b.Property("ALCFREQYR") + .HasColumnType("int") + .HasComment("In the past 12 months, how often has the participant had a drink containing alcohol?"); + + b.Property("ANGIOCP") + .HasColumnType("int") + .HasComment("Carotid artery surgery or stenting?"); + + b.Property("ANXIETY") + .HasColumnType("int") + .HasComment("Anxiety disorder (DSM-5-TR criteria)"); + + b.Property("APNEA") + .HasColumnType("int") + .HasComment("Sleep apnea"); + + b.Property("APNEAORAL") + .HasColumnType("int") + .HasComment("Typical use of an oral device for sleep apnea at night over the past 12 months?"); + + b.Property("ARTHLOEX") + .HasColumnType("bit") + .HasComment("Lower extremity affected by arthritis"); + + b.Property("ARTHRIT") + .HasColumnType("int") + .HasComment("Arthritis"); + + b.Property("ARTHROSTEO") + .HasColumnType("bit") + .HasComment("Type of arthritis: Osteoarthritis"); + + b.Property("ARTHROTHR") + .HasColumnType("bit") + .HasComment("Type of arthritis: Other"); + + b.Property("ARTHRRHEUM") + .HasColumnType("bit") + .HasComment("Type of arthritis: Rheumatoid"); + + b.Property("ARTHSPIN") + .HasColumnType("bit") + .HasComment("Spine affected by arthritis"); + + b.Property("ARTHTYPUNK") + .HasColumnType("bit") + .HasComment("Type of arthritis: Unknown"); + + b.Property("ARTHTYPX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasComment("Specify other type of arthritis"); + + b.Property("ARTHUNK") + .HasColumnType("bit") + .HasComment("Region affected by arthritis unknown"); + + b.Property("ARTHUPEX") + .HasColumnType("bit") + .HasComment("Upper extremity affected by arthritis"); + + b.Property("B12DEF") + .HasColumnType("int") + .HasComment("B12 deficiency"); + + b.Property("BCENDAGE") + .HasColumnType("int") + .HasComment("Age at last use of birth control pills"); + + b.Property("BCPILLS") + .HasColumnType("int") + .HasComment("Has the participant ever taken birth control pills?"); + + b.Property("BCPILLSYR") + .HasColumnType("int") + .HasComment("Total number of years participant has taken birth control pills"); + + b.Property("BCSTARTAGE") + .HasColumnType("int") + .HasComment("Age at first use of birth control pills"); + + b.Property("BIPOLAR") + .HasColumnType("int") + .HasComment("Bipolar disorder(DSM - 5 - TR criteria)"); + + b.Property("BYPASSAGE") + .HasColumnType("int") + .HasComment("Age at most recent coronary artery bypass surgery"); + + b.Property("CANCBLOOD") + .HasColumnType("bit") + .HasComment("Primary site of cancer: Blood"); + + b.Property("CANCBONE") + .HasColumnType("bit") + .HasComment("Type of cancer treatment: Bone marrow transplant"); + + b.Property("CANCBREAST") + .HasColumnType("bit") + .HasComment("Primary site of cancer: Breast"); + + b.Property("CANCCHEMO") + .HasColumnType("bit") + .HasComment("Type of cancer treatment: Chemotherapy"); + + b.Property("CANCCOLON") + .HasColumnType("bit") + .HasComment("Primary site of cancer: Colon"); + + b.Property("CANCERACTV") + .HasColumnType("int") + .HasComment("Cancer, primary or metastatic (Report all known diagnoses. Exclude non-melanoma skin cancer.)"); + + b.Property("CANCERAGE") + .HasColumnType("int") + .HasComment("Age at most recent cancer diagnosis"); + + b.Property("CANCERMETA") + .HasColumnType("bit") + .HasComment("Type of cancer: Metastatic"); + + b.Property("CANCERPRIM") + .HasColumnType("bit") + .HasComment("Type of cancer: Primary/non-metastatic"); + + b.Property("CANCERUNK") + .HasColumnType("bit") + .HasComment("Type of cancer: Unknown"); + + b.Property("CANCHORM") + .HasColumnType("bit") + .HasComment("Type of cancer treatment: Hormone therapy"); + + b.Property("CANCIMMUNO") + .HasColumnType("bit") + .HasComment("Type of cancer treatment: Immunotherapy"); + + b.Property("CANCLUNG") + .HasColumnType("bit") + .HasComment("Primary site of cancer: Lung"); + + b.Property("CANCMETBR") + .HasColumnType("bit") + .HasComment("Type of metastatic cancer: Metatstic to brain"); + + b.Property("CANCMETOTH") + .HasColumnType("bit") + .HasComment("Type of metastatic cancer: Metastatic to sites other than brain"); + + b.Property("CANCOTHER") + .HasColumnType("bit") + .HasComment("Primary site of cancer: Other"); + + b.Property("CANCOTHERX") + .HasColumnType("nvarchar(max)") + .HasComment("Specify other primary site of cancer"); + + b.Property("CANCPROST") + .HasColumnType("bit") + .HasComment("Primary site of cancer: Prostate"); + + b.Property("CANCRAD") + .HasColumnType("bit") + .HasComment("Type of cancer treatment: Radiation"); + + b.Property("CANCRESECT") + .HasColumnType("bit") + .HasComment("Type of cancer treatment: Surgical resection"); + + b.Property("CANCTROTH") + .HasColumnType("bit") + .HasComment("Type of cancer treatment: Other"); + + b.Property("CANCTROTHX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasComment("Specify other type of cancer treatment"); + + b.Property("CANNABIS") + .HasColumnType("int") + .HasComment("In the past 12 months, how often has the participant consumed cannabis (edibles, smoked, or vaporized)?"); + + b.Property("CARDARRAGE") + .HasColumnType("int") + .HasComment("Age at most recent cardiac arrest"); + + b.Property("CARDARREST") + .HasColumnType("int") + .HasComment("Cardiac arrest (heart stopped)"); + + b.Property("CAROTIDAGE") + .HasColumnType("int") + .HasComment("Age at most recent carotid artery surgery or stenting"); + + b.Property("CBSTROKE") + .HasColumnType("int") + .HasComment("Stroke by history, not exam (imaging is not required)"); + + b.Property("CBTIA") + .HasColumnType("int") + .HasComment("Transient ischemic attack (TIA)"); + + b.Property("COVID19") + .HasColumnType("int") + .HasComment("COVID-19 infection"); + + b.Property("COVIDHOSP") + .HasColumnType("int") + .HasComment("COVID-19 infection requiring hospitalization?"); + + b.Property("CPAP") + .HasColumnType("int") + .HasComment("Typical use of breathing machine (e.g. CPAP) at night over the past 12 months"); + + b.Property("CVAFIB") + .HasColumnType("int") + .HasComment("Atrial fibrillation"); + + b.Property("CVANGIO") + .HasColumnType("int") + .HasComment("Coronary artery angioplasty / endarterectomy / stenting"); + + b.Property("CVBYPASS") + .HasColumnType("int") + .HasComment("Coronary artery bypass procedure"); + + b.Property("CVCHF") + .HasColumnType("int") + .HasComment("Congestive heart failure (including pulmonary edema)"); + + b.Property("CVHVALVE") + .HasColumnType("int") + .HasComment("Heart valve replacement or repair"); + + b.Property("CVOTHR") + .HasColumnType("int") + .HasComment("Other cardiovascular disease"); + + b.Property("CVOTHRX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasComment("Specify other cardiovascular disease"); + + b.Property("CVPACDEF") + .HasColumnType("int") + .HasComment("Pacemaker and/or defibrillator implantation"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DEPRTREAT") + .HasColumnType("bit") + .HasComment("Choose if treated or untreated"); + + b.Property("DIABAGE") + .HasColumnType("int") + .HasComment("Age at diabetes diagnosis"); + + b.Property("DIABDIET") + .HasColumnType("bit") + .HasComment("Diabetes treated with: Diet"); + + b.Property("DIABETES") + .HasColumnType("int") + .HasComment("Diabetes"); + + b.Property("DIABGLP1") + .HasColumnType("bit") + .HasComment("GLP-1 receptor activators"); + + b.Property("DIABINS") + .HasColumnType("bit") + .HasComment("Diabetes treated with: Insulin"); + + b.Property("DIABMEDS") + .HasColumnType("bit") + .HasComment("Diabetes treated with: Oral medications"); + + b.Property("DIABRECACT") + .HasColumnType("bit") + .HasComment("Other non-insulin, non-GLP-1 receptor activator injection medication"); + + b.Property("DIABTYPE") + .HasColumnType("int") + .HasComment("Diabetes type"); + + b.Property("DIABUNK") + .HasColumnType("bit") + .HasComment("Diabetes treated with: Unknown"); + + b.Property("DeletedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("FIRSTTBI") + .HasColumnType("int") + .HasComment("Age of first head injury"); + + b.Property("FRMDATE") + .HasColumnType("datetime2") + .HasColumnName("FRMDATE") + .HasColumnOrder(3); + + b.Property("GENERALANX") + .HasColumnType("int") + .HasComment("Generalized Anxiety Disorder"); + + b.Property("HEADACHE") + .HasColumnType("int") + .HasComment("Chronic headaches"); + + b.Property("HEADIMP") + .HasColumnType("int") + .HasComment("epetitive head impacts (e.g. from contact sports, intimate partner violence, or military duty), regardless of whether it caused symptoms."); + + b.Property("HEADINJCON") + .HasColumnType("int") + .HasComment("After a head injury, what was the longest period..."); + + b.Property("HEADINJNUM") + .HasColumnType("int") + .HasComment("Total number of head injuries"); + + b.Property("HEADINJUNC") + .HasColumnType("int") + .HasComment("After a head injury, what was the longest period of time that the participant was unconscious?"); + + b.Property("HEADINJURY") + .HasColumnType("int") + .HasComment("Head injury (e.g. in a vehicle accident, being hit by an object...)"); + + b.Property("HIVAGE") + .HasColumnType("int") + .HasComment("Age at HIV diagnosis"); + + b.Property("HIVDIAG") + .HasColumnType("int") + .HasComment("Human Immunodeficiency Virus"); + + b.Property("HRT") + .HasColumnType("int") + .HasComment("Has the participant taken female hormone replacement pills or patches (e.g. estrogen)?"); + + b.Property("HRTATTACK") + .HasColumnType("int") + .HasComment("Heart attack (heart artery blockage)"); + + b.Property("HRTATTAGE") + .HasColumnType("int") + .HasComment("Age at most recent heart attack"); + + b.Property("HRTATTMULT") + .HasColumnType("int") + .HasComment("More than one heart attack?"); + + b.Property("HRTENDAGE") + .HasColumnType("int") + .HasComment("Age at last use of female hormone replacement pills"); + + b.Property("HRTSTRTAGE") + .HasColumnType("int") + .HasComment("Age at first use of female hormone replacement pills"); + + b.Property("HRTYEARS") + .HasColumnType("int") + .HasComment("Total number of years participant has taken female hormone replacement pills"); + + b.Property("HYDROCEPH") + .HasColumnType("int") + .HasComment("Normal-pressure hydrocephalus"); + + b.Property("HYPERCHAGE") + .HasColumnType("int") + .HasComment("Age at hypercholesterolemia diagnosis"); + + b.Property("HYPERCHO") + .HasColumnType("int") + .HasComment("Hypercholesterolemia (or taking medication for high cholesterol)"); + + b.Property("HYPERTAGE") + .HasColumnType("int") + .HasComment("Age at hypertension diagnosis"); + + b.Property("HYPERTEN") + .HasColumnType("int") + .HasComment("Hypertension (or taking medication for hypertension)"); + + b.Property("IMPAMFOOT") + .HasColumnType("bit") + .HasComment("Source of exposure for repeated hits to the head: American football"); + + b.Property("IMPASSAULT") + .HasColumnType("bit") + .HasComment("Source of exposure for repeated hits to the head: Physical assault"); + + b.Property("IMPBOXING") + .HasColumnType("bit") + .HasComment("Source of exposure for repeated hits to the head: Boxing or mixed martial arts"); + + b.Property("IMPHOCKEY") + .HasColumnType("bit") + .HasComment("Source of exposure for repeated hits to the head: Ice hockey"); + + b.Property("IMPIPV") + .HasColumnType("bit") + .HasComment("Source of exposure for repeated hits to the head: Intimate partner violence"); + + b.Property("IMPMILIT") + .HasColumnType("bit") + .HasComment("Source of exposure for repeated hits to the head: Military service"); + + b.Property("IMPOTHER") + .HasColumnType("bit") + .HasComment("Source of exposure for repeated hits to the head: Other cause"); + + b.Property("IMPOTHERX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasComment("Specify other source of exposure for repeated hits to the head"); + + b.Property("IMPSOCCER") + .HasColumnType("bit") + .HasComment("Source of exposure for repeated hits to the head: Soccer"); + + b.Property("IMPSPORT") + .HasColumnType("bit") + .HasComment("Source of exposure for repeated hits to the head: Other contact sport"); + + b.Property("IMPYEARS") + .HasColumnType("int") + .HasComment("The total length of time in years that the participant was exposed to repeated hits to the head (e.g. playing American football for 7 years)"); + + b.Property("INCONTF") + .HasColumnType("int") + .HasComment("Incontinence—bowel (occurring at least weekly)"); + + b.Property("INCONTU") + .HasColumnType("int") + .HasComment("Incontinence—urinary (occurring at least weekly)"); + + b.Property("INITIALS") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("nvarchar(3)") + .HasColumnName("INITIALS") + .HasColumnOrder(4); + + b.Property("INSOMN") + .HasColumnType("int") + .HasComment("Hyposomnia/Insomnia (occurring at least weekly or requiring medication)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("KIDNEY") + .HasColumnType("int") + .HasComment("Chronic kidney disease"); + + b.Property("KIDNEYAGE") + .HasColumnType("int") + .HasComment("Age at chronic kidney disease diagnosis"); + + b.Property("LANG") + .HasColumnType("int") + .HasColumnName("LANG") + .HasColumnOrder(5); + + b.Property("LASTTBI") + .HasColumnType("int") + .HasComment("Age of most recent head injury"); + + b.Property("LIVER") + .HasColumnType("int") + .HasComment("Liver disease"); + + b.Property("LIVERAGE") + .HasColumnType("int") + .HasComment("Age at liver disease diagnosis"); + + b.Property("MAJORDEP") + .HasColumnType("int") + .HasComment("Major depressive disorder (DSM-5-TR criteria)"); + + b.Property("MENARCHE") + .HasColumnType("int") + .HasComment("How old was the participant when they had their first menstrual period?"); + + b.Property("MODE") + .HasColumnType("int") + .HasColumnName("MODE") + .HasColumnOrder(6); + + b.Property("MS") + .HasColumnType("int") + .HasComment("Multiple sclerosis"); + + b.Property("ModifiedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("NOMENSAGE") + .HasColumnType("int") + .HasComment("How old was the participant when they had their last menstrual period?"); + + b.Property("NOMENSCHEM") + .HasColumnType("bit") + .HasComment("Participant has stopped having menstrual periods due to chemotherapy for cancer or another condition"); + + b.Property("NOMENSESTR") + .HasColumnType("bit") + .HasComment("Participant has stopped having menstrual periods due to anti-estrogen medication"); + + b.Property("NOMENSHORM") + .HasColumnType("bit") + .HasComment("Participant has stopped having menstrual periods due to hormonal supplements (e.g. the Pill, injections, Mirena, HRT)"); + + b.Property("NOMENSHYST") + .HasColumnType("bit") + .HasComment("Participant has stopped having menstrual periods due to hysterectomy (surgical removal of uterus)"); + + b.Property("NOMENSNAT") + .HasColumnType("bit") + .HasComment("Participant has stopped having menstrual periods due to natural menopause"); + + b.Property("NOMENSOTH") + .HasColumnType("bit") + .HasComment("Other reason participant has stopped having menstrual periods"); + + b.Property("NOMENSOTHX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasComment("Specify other reason participant has stopped having menstrual periods"); + + b.Property("NOMENSRAD") + .HasColumnType("bit") + .HasComment("Participant has stopped having menstrual periods due to radiation treatment or other damage/injury to reproductive organs"); + + b.Property("NOMENSSURG") + .HasColumnType("bit") + .HasComment("Participant has stopped having menstrual periods due to surgical removal of both ovaries"); + + b.Property("NOMENSUNK") + .HasColumnType("bit") + .HasComment("Unsure of reason participant has stopped having menstrual periods"); + + b.Property("NOT") + .HasColumnType("int") + .HasColumnName("NOT") + .HasColumnOrder(9); + + b.Property("NPSYDEV") + .HasColumnType("int") + .HasComment("Developmental neuropsychiatric disorders"); + + b.Property("OCD") + .HasColumnType("int") + .HasComment("Obsessive-compulsive disorder (OCD)"); + + b.Property("OTHANXDIS") + .HasColumnType("int") + .HasComment("Other anxiety disorder"); + + b.Property("OTHANXDISX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasComment("Specify other anxiety disorder"); + + b.Property("OTHCONDX") + .HasColumnType("nvarchar(max)") + .HasComment("Specify other medical conditions or procedures"); + + b.Property("OTHERCOND") + .HasColumnType("int") + .HasComment("Other medical conditions or procedures"); + + b.Property("OTHERDEP") + .HasColumnType("int") + .HasComment("Other specified depressive disorder (DSm-5-TR criteria)"); + + b.Property("OTHSLEEP") + .HasColumnType("int") + .HasComment("Other sleep disorder"); + + b.Property("OTHSLEEX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasComment("Specify other sleep disorder"); + + b.Property("PACDEFAGE") + .HasColumnType("int") + .HasComment("Age at first pacemaker and/or defibrillator implantation"); + + b.Property("PACKSPER") + .HasColumnType("int") + .HasComment("Average number of packs smoked per day"); + + b.Property("PANICDIS") + .HasColumnType("int") + .HasComment("Panic Disorder"); + + b.Property("PD") + .HasColumnType("int") + .HasComment("Parkinson’s disease (PD)"); + + b.Property("PDAGE") + .HasColumnType("int") + .HasComment("Age at estimated PD symptom onset"); + + b.Property("PDOTHR") + .HasColumnType("int") + .HasComment("Other parkinsonism disorder (e.g., DLB)"); + + b.Property("PDOTHRAGE") + .HasColumnType("int") + .HasComment("Age at parkinsonism disorder diagnosis"); + + b.Property("PSYCDIS") + .HasColumnType("int") + .HasComment("Other psychiatric disorders"); + + b.Property("PSYCDISX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasComment("Specify other psychiatric disorders"); + + b.Property("PTSD") + .HasColumnType("int") + .HasComment("Post-traumatic stress disorder (PTSD) (DSM-5-TR criteria)"); + + b.Property("PULMONARY") + .HasColumnType("int") + .HasComment("Asthma/COPD/pulmonary disease"); + + b.Property("PVD") + .HasColumnType("int") + .HasComment("Peripheral vascular disease"); + + b.Property("PVDAGE") + .HasColumnType("int") + .HasComment("Age at peripheral vascular disease diagnosis"); + + b.Property("QUITSMOK") + .HasColumnType("int") + .HasComment("If the participant quit smoking, specify the age at which they last smoked (i.e., quit)"); + + b.Property("RBD") + .HasColumnType("int") + .HasComment("REM sleep behavior disorder"); + + b.Property("RMMODE") + .HasColumnType("int") + .HasColumnName("RMMODE") + .HasColumnOrder(8); + + b.Property("RMREAS") + .HasColumnType("int") + .HasColumnName("RMREASON") + .HasColumnOrder(7); + + b.Property("SCHIZ") + .HasColumnType("int") + .HasComment("Schizophrenia or other psychosis disorder (DSM-5-TR criteria)"); + + b.Property("SEIZAGE") + .HasColumnType("int") + .HasComment("Age at first seizure (excluding childhood febrile seizures)"); + + b.Property("SEIZNUM") + .HasColumnType("int") + .HasComment("How many seizures has the participant had in the past 12 months?"); + + b.Property("SEIZURES") + .HasColumnType("int") + .HasComment("Epilepsy and/or history of seizures (excluding childhood febrile seizures)"); + + b.Property("SMOKYRS") + .HasColumnType("int") + .HasComment("Total years smoked"); + + b.Property("STROKAGE") + .HasColumnType("int") + .HasComment("Age at most recent stroke"); + + b.Property("STROKMUL") + .HasColumnType("int") + .HasComment("More than one stroke?"); + + b.Property("STROKSTAT") + .HasColumnType("int") + .HasComment("What is status of stroke symptoms?"); + + b.Property("SUBSTPAST") + .HasColumnType("int") + .HasComment("Participant used substances including prescription or recreational drugs that caused significant impairment in work, legal, driving, or social areas prior to 12 months ago"); + + b.Property("SUBSTYEAR") + .HasColumnType("int") + .HasComment("Participant used substances including prescription or recreational drugs that caused significant impairment in work, legal, driving, or social areas within the past 12 months"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("nvarchar(20)") + .HasColumnOrder(2); + + b.Property("THYROID") + .HasColumnType("int") + .HasComment("Thyroid disease"); + + b.Property("TIAAGE") + .HasColumnType("int") + .HasComment("Age at most recent TIA"); + + b.Property("TOBAC100") + .HasColumnType("int") + .HasComment("Has participant smoked more than 100 cigarettes in their life?"); + + b.Property("TOBAC30") + .HasColumnType("int") + .HasComment("Has participant smoked within the last 30 days?"); + + b.Property("VALVEAGE") + .HasColumnType("int") + .HasComment("Age at most recent heart valve replacement or repair procedure"); + + b.Property("VisitId") + .HasColumnType("int") + .HasColumnOrder(1); + + b.HasKey("Id"); + + b.HasIndex("VisitId") + .IsUnique(); + + b.ToTable("tbl_A5D2s"); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.B1", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("FormId") + .HasColumnOrder(0); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("BPDIASL1") + .HasColumnType("int") + .HasComment(" Participant blood pressure - Left arm: Diastolic Reading 1"); + + b.Property("BPDIASL2") + .HasColumnType("int") + .HasComment(" Participant blood pressure - Left arm: Diastolic Reading 2"); + + b.Property("BPDIASR1") + .HasColumnType("int") + .HasComment("Participant blood pressure - Right arm: Diastolic Reading 1"); + + b.Property("BPDIASR2") + .HasColumnType("int") + .HasComment("Participant blood pressure - Right arm: Diastolic Reading 2"); + + b.Property("BPSYSL1") + .HasColumnType("int") + .HasComment("Participant blood pressure - Left arm: Systolic Reading 1"); + + b.Property("BPSYSL2") + .HasColumnType("int") + .HasComment("Participant blood pressure - Left arm: Systolic Reading 2"); + + b.Property("BPSYSR1") + .HasColumnType("int") + .HasComment("Participant blood pressure - Right arm: Systolic Reading 1"); + + b.Property("BPSYSR2") + .HasColumnType("int") + .HasComment("Participant blood pressure - Right arm: Systolic Reading 2"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DeletedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("FRMDATE") + .HasColumnType("datetime2") + .HasColumnName("FRMDATE") + .HasColumnOrder(3); + + b.Property("HEIGHT") + .HasColumnType("decimal(3,1)") + .HasComment("Participant height (inches)"); + + b.Property("HIP1") + .HasColumnType("int") + .HasComment("Hip circumference measurements (inches): Measurement 1"); + + b.Property("HIP2") + .HasColumnType("int") + .HasComment("Hip circumference measurements (inches): Measurement 2"); + + b.Property("HRATE") + .HasColumnType("int") + .HasComment("Participant resting heart rate (pulse)"); + + b.Property("INITIALS") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("nvarchar(3)") + .HasColumnName("INITIALS") + .HasColumnOrder(4); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LANG") + .HasColumnType("int") + .HasColumnName("LANG") + .HasColumnOrder(5); + + b.Property("MODE") + .HasColumnType("int") + .HasColumnName("MODE") + .HasColumnOrder(6); + + b.Property("ModifiedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("NOT") + .HasColumnType("int") + .HasColumnName("NOT") + .HasColumnOrder(9); + + b.Property("RMMODE") + .HasColumnType("int") + .HasColumnName("RMMODE") + .HasColumnOrder(8); + + b.Property("RMREAS") + .HasColumnType("int") + .HasColumnName("RMREASON") + .HasColumnOrder(7); + + b.Property("Status") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("nvarchar(20)") + .HasColumnOrder(2); + + b.Property("VisitId") + .HasColumnType("int") + .HasColumnOrder(1); + + b.Property("WAIST1") + .HasColumnType("int") + .HasComment("Waist circumference measurements (inches): Measurement 1"); + + b.Property("WAIST2") + .HasColumnType("int") + .HasComment("Waist circumference measurements (inches): Measurement 2"); + + b.Property("WEIGHT") + .HasColumnType("int") + .HasComment("Participant weight (lbs.)"); + + b.HasKey("Id"); + + b.HasIndex("VisitId") + .IsUnique(); + + b.ToTable("tbl_B1s"); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.B3", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("FormId") + .HasColumnOrder(0); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("ARISING") + .HasColumnType("int"); + + b.Property("ARISINGX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("BRADYKIN") + .HasColumnType("int"); + + b.Property("BRADYKIX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DeletedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("FACEXP") + .HasColumnType("int"); + + b.Property("FACEXPX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("FRMDATE") + .HasColumnType("datetime2") + .HasColumnName("FRMDATE") + .HasColumnOrder(3); + + b.Property("GAIT") + .HasColumnType("int"); + + b.Property("GAITX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("HANDALTL") + .HasColumnType("int"); + + b.Property("HANDALTR") + .HasColumnType("int"); + + b.Property("HANDATLX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("HANDATRX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("HANDMOVL") + .HasColumnType("int"); + + b.Property("HANDMOVR") + .HasColumnType("int"); + + b.Property("HANDMVLX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("HANDMVRX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("INITIALS") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("nvarchar(3)") + .HasColumnName("INITIALS") + .HasColumnOrder(4); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LANG") + .HasColumnType("int") + .HasColumnName("LANG") + .HasColumnOrder(5); + + b.Property("LEGLF") + .HasColumnType("int"); + + b.Property("LEGLFX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("LEGRT") + .HasColumnType("int"); + + b.Property("LEGRTX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("MODE") + .HasColumnType("int") + .HasColumnName("MODE") + .HasColumnOrder(6); + + b.Property("ModifiedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("NOT") + .HasColumnType("int") + .HasColumnName("NOT") + .HasColumnOrder(9); + + b.Property("PDNORMAL") + .HasColumnType("bit"); + + b.Property("POSSTAB") + .HasColumnType("int"); + + b.Property("POSSTABX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("POSTURE") + .HasColumnType("int"); + + b.Property("POSTUREX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("RIGDLOLF") + .HasColumnType("int"); + + b.Property("RIGDLOLX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("RIGDLORT") + .HasColumnType("int"); + + b.Property("RIGDLORX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("RIGDNECK") + .HasColumnType("int"); + + b.Property("RIGDNEX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("RIGDUPLF") + .HasColumnType("int"); + + b.Property("RIGDUPLX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("RIGDUPRT") + .HasColumnType("int"); + + b.Property("RIGDUPRX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("RMMODE") + .HasColumnType("int") + .HasColumnName("RMMODE") + .HasColumnOrder(8); + + b.Property("RMREAS") + .HasColumnType("int") + .HasColumnName("RMREASON") + .HasColumnOrder(7); + + b.Property("SPEECH") + .HasColumnType("int"); + + b.Property("SPEECHX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("nvarchar(20)") + .HasColumnOrder(2); + + b.Property("TAPSLF") + .HasColumnType("int"); + + b.Property("TAPSLFX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("TAPSRT") + .HasColumnType("int"); + + b.Property("TAPSRTX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("TOTALUPDRS") + .HasColumnType("int"); + + b.Property("TRACTLHD") + .HasColumnType("int"); + + b.Property("TRACTLHX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("TRACTRHD") + .HasColumnType("int"); + + b.Property("TRACTRHX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("TRESTFAC") + .HasColumnType("int"); + + b.Property("TRESTFAX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("TRESTLFT") + .HasColumnType("int"); + + b.Property("TRESTLFX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("TRESTLHD") + .HasColumnType("int"); + + b.Property("TRESTLHX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("TRESTRFT") + .HasColumnType("int"); + + b.Property("TRESTRFX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("TRESTRHD") + .HasColumnType("int"); + + b.Property("TRESTRHX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("VisitId") + .HasColumnType("int") + .HasColumnOrder(1); + + b.HasKey("Id"); + + b.HasIndex("VisitId") + .IsUnique(); + + b.ToTable("tbl_B3s"); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.B4", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("FormId") + .HasColumnOrder(0); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CDRGLOB") + .HasColumnType("decimal(2,1)"); + + b.Property("CDRLANG") + .HasColumnType("decimal(2,1)"); + + b.Property("CDRSUM") + .HasColumnType("decimal(3,1)"); + + b.Property("COMMUN") + .HasColumnType("decimal(2,1)"); + + b.Property("COMPORT") + .HasColumnType("decimal(2,1)"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DeletedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("FRMDATE") + .HasColumnType("datetime2") + .HasColumnName("FRMDATE") + .HasColumnOrder(3); + + b.Property("HOMEHOBB") + .HasColumnType("decimal(2,1)"); + + b.Property("INITIALS") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("nvarchar(3)") + .HasColumnName("INITIALS") + .HasColumnOrder(4); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("JUDGMENT") + .HasColumnType("decimal(2,1)"); + + b.Property("LANG") + .HasColumnType("int") + .HasColumnName("LANG") + .HasColumnOrder(5); + + b.Property("MEMORY") + .HasColumnType("decimal(2,1)"); + + b.Property("MODE") + .HasColumnType("int") + .HasColumnName("MODE") + .HasColumnOrder(6); + + b.Property("ModifiedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("NOT") + .HasColumnType("int") + .HasColumnName("NOT") + .HasColumnOrder(9); + + b.Property("ORIENT") + .HasColumnType("decimal(2,1)"); + + b.Property("PERSCARE") + .HasColumnType("decimal(2,1)"); + + b.Property("RMMODE") + .HasColumnType("int") + .HasColumnName("RMMODE") + .HasColumnOrder(8); + + b.Property("RMREAS") + .HasColumnType("int") + .HasColumnName("RMREASON") + .HasColumnOrder(7); + + b.Property("Status") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("nvarchar(20)") + .HasColumnOrder(2); + + b.Property("VisitId") + .HasColumnType("int") + .HasColumnOrder(1); + + b.HasKey("Id"); + + b.HasIndex("VisitId") + .IsUnique(); + + b.ToTable("tbl_B4s"); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.B5", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("FormId") + .HasColumnOrder(0); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("AGIT") + .HasColumnType("int"); + + b.Property("AGITSEV") + .HasColumnType("int"); + + b.Property("ANX") + .HasColumnType("int"); + + b.Property("ANXSEV") + .HasColumnType("int"); + + b.Property("APA") + .HasColumnType("int"); + + b.Property("APASEV") + .HasColumnType("int"); + + b.Property("APP") + .HasColumnType("int"); + + b.Property("APPSEV") + .HasColumnType("int"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DEL") + .HasColumnType("int"); + + b.Property("DELSEV") + .HasColumnType("int"); + + b.Property("DEPD") + .HasColumnType("int"); + + b.Property("DEPDSEV") + .HasColumnType("int"); + + b.Property("DISN") + .HasColumnType("int"); + + b.Property("DISNSEV") + .HasColumnType("int"); + + b.Property("DeletedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("ELAT") + .HasColumnType("int"); + + b.Property("ELATSEV") + .HasColumnType("int"); + + b.Property("FRMDATE") + .HasColumnType("datetime2") + .HasColumnName("FRMDATE") + .HasColumnOrder(3); + + b.Property("HALL") + .HasColumnType("int"); + + b.Property("HALLSEV") + .HasColumnType("int"); + + b.Property("INITIALS") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("nvarchar(3)") + .HasColumnName("INITIALS") + .HasColumnOrder(4); + + b.Property("IRR") + .HasColumnType("int"); + + b.Property("IRRSEV") + .HasColumnType("int"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LANG") + .HasColumnType("int") + .HasColumnName("LANG") + .HasColumnOrder(5); + + b.Property("MODE") + .HasColumnType("int") + .HasColumnName("MODE") + .HasColumnOrder(6); + + b.Property("MOT") + .HasColumnType("int"); + + b.Property("MOTSEV") + .HasColumnType("int"); + + b.Property("ModifiedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("NITE") + .HasColumnType("int"); + + b.Property("NITESEV") + .HasColumnType("int"); + + b.Property("NOT") + .HasColumnType("int") + .HasColumnName("NOT") + .HasColumnOrder(9); + + b.Property("NPIQINF") + .HasColumnType("int"); + + b.Property("NPIQINFX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("RMMODE") + .HasColumnType("int") + .HasColumnName("RMMODE") + .HasColumnOrder(8); + + b.Property("RMREAS") + .HasColumnType("int") + .HasColumnName("RMREASON") + .HasColumnOrder(7); + + b.Property("Status") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("nvarchar(20)") + .HasColumnOrder(2); + + b.Property("VisitId") + .HasColumnType("int") + .HasColumnOrder(1); + + b.HasKey("Id"); + + b.HasIndex("VisitId") + .IsUnique(); + + b.ToTable("tbl_B5s"); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.B6", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("FormId") + .HasColumnOrder(0); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("AFRAID") + .HasColumnType("int"); + + b.Property("BETTER") + .HasColumnType("int"); + + b.Property("BORED") + .HasColumnType("int"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DROPACT") + .HasColumnType("int"); + + b.Property("DeletedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("EMPTY") + .HasColumnType("int"); + + b.Property("ENERGY") + .HasColumnType("int"); + + b.Property("FRMDATE") + .HasColumnType("datetime2") + .HasColumnName("FRMDATE") + .HasColumnOrder(3); + + b.Property("GDS") + .HasColumnType("int"); + + b.Property("HAPPY") + .HasColumnType("int"); + + b.Property("HELPLESS") + .HasColumnType("int"); + + b.Property("HOPELESS") + .HasColumnType("int"); + + b.Property("INITIALS") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("nvarchar(3)") + .HasColumnName("INITIALS") + .HasColumnOrder(4); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LANG") + .HasColumnType("int") + .HasColumnName("LANG") + .HasColumnOrder(5); + + b.Property("MEMPROB") + .HasColumnType("int"); + + b.Property("MODE") + .HasColumnType("int") + .HasColumnName("MODE") + .HasColumnOrder(6); + + b.Property("ModifiedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("NOGDS") + .HasColumnType("int"); + + b.Property("NOT") + .HasColumnType("int") + .HasColumnName("NOT") + .HasColumnOrder(9); + + b.Property("RMMODE") + .HasColumnType("int") + .HasColumnName("RMMODE") + .HasColumnOrder(8); + + b.Property("RMREAS") + .HasColumnType("int") + .HasColumnName("RMREASON") + .HasColumnOrder(7); + + b.Property("SATIS") + .HasColumnType("int"); + + b.Property("SPIRITS") + .HasColumnType("int"); + + b.Property("STAYHOME") + .HasColumnType("int"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("nvarchar(20)") + .HasColumnOrder(2); + + b.Property("VisitId") + .HasColumnType("int") + .HasColumnOrder(1); + + b.Property("WONDRFUL") + .HasColumnType("int"); + + b.Property("WRTHLESS") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("VisitId") + .IsUnique(); + + b.ToTable("tbl_B6s"); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.B7", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("FormId") + .HasColumnOrder(0); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("BILLS") + .HasColumnType("int"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DeletedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("EVENTS") + .HasColumnType("int"); + + b.Property("FRMDATE") + .HasColumnType("datetime2") + .HasColumnName("FRMDATE") + .HasColumnOrder(3); + + b.Property("GAMES") + .HasColumnType("int"); + + b.Property("INITIALS") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("nvarchar(3)") + .HasColumnName("INITIALS") + .HasColumnOrder(4); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LANG") + .HasColumnType("int") + .HasColumnName("LANG") + .HasColumnOrder(5); + + b.Property("MEALPREP") + .HasColumnType("int"); + + b.Property("MODE") + .HasColumnType("int") + .HasColumnName("MODE") + .HasColumnOrder(6); + + b.Property("ModifiedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("NOT") + .HasColumnType("int") + .HasColumnName("NOT") + .HasColumnOrder(9); + + b.Property("PAYATTN") + .HasColumnType("int"); + + b.Property("REMDATES") + .HasColumnType("int"); + + b.Property("RMMODE") + .HasColumnType("int") + .HasColumnName("RMMODE") + .HasColumnOrder(8); + + b.Property("RMREAS") + .HasColumnType("int") + .HasColumnName("RMREASON") + .HasColumnOrder(7); + + b.Property("SHOPPING") + .HasColumnType("int"); + + b.Property("STOVE") + .HasColumnType("int"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("nvarchar(20)") + .HasColumnOrder(2); + + b.Property("TAXES") + .HasColumnType("int"); + + b.Property("TRAVEL") + .HasColumnType("int"); + + b.Property("VisitId") + .HasColumnType("int") + .HasColumnOrder(1); + + b.HasKey("Id"); + + b.HasIndex("VisitId") + .IsUnique(); + + b.ToTable("tbl_B7s"); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.B8", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("FormId") + .HasColumnOrder(0); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("ALIENLIMB") + .HasColumnType("int"); + + b.Property("AMPMOTOR") + .HasColumnType("int"); + + b.Property("APHASIA") + .HasColumnType("int"); + + b.Property("APRAXGAZE") + .HasColumnType("int"); + + b.Property("APRAXSP") + .HasColumnType("int"); + + b.Property("AXIALRIG") + .HasColumnType("int"); + + b.Property("CHOREA") + .HasColumnType("int"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DYSARTH") + .HasColumnType("int"); + + b.Property("DYSTARM") + .HasColumnType("int"); + + b.Property("DYSTLEG") + .HasColumnType("int"); + + b.Property("DeletedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("FRMDATE") + .HasColumnType("datetime2") + .HasColumnName("FRMDATE") + .HasColumnOrder(3); + + b.Property("GAITABN") + .HasColumnType("int"); + + b.Property("GAITFIND") + .HasColumnType("int"); + + b.Property("GAITOTHRX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("HSPATNEG") + .HasColumnType("int"); + + b.Property("INITIALS") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("nvarchar(3)") + .HasColumnName("INITIALS") + .HasColumnOrder(4); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LANG") + .HasColumnType("int") + .HasColumnName("LANG") + .HasColumnOrder(5); + + b.Property("LIMBAPRAX") + .HasColumnType("int"); + + b.Property("LIMBATAX") + .HasColumnType("int"); + + b.Property("LMNDIST") + .HasColumnType("int"); + + b.Property("MASKING") + .HasColumnType("int"); + + b.Property("MODE") + .HasColumnType("int") + .HasColumnName("MODE") + .HasColumnOrder(6); + + b.Property("MYOCLON") + .HasColumnType("int"); + + b.Property("ModifiedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("NEUREXAM") + .HasColumnType("int"); + + b.Property("NORMNREXAM") + .HasColumnType("bit"); + + b.Property("NOT") + .HasColumnType("int") + .HasColumnName("NOT") + .HasColumnOrder(9); + + b.Property("OPTICATAX") + .HasColumnType("int"); + + b.Property("OTHERSIGN") + .HasColumnType("int"); + + b.Property("PARKSIGN") + .HasColumnType("int"); + + b.Property("POSTINST") + .HasColumnType("int"); + + b.Property("PSPOAGNO") + .HasColumnType("int"); + + b.Property("RIGIDARM") + .HasColumnType("int"); + + b.Property("RIGIDLEG") + .HasColumnType("int"); + + b.Property("RMMODE") + .HasColumnType("int") + .HasColumnName("RMMODE") + .HasColumnOrder(8); + + b.Property("RMREAS") + .HasColumnType("int") + .HasColumnName("RMREASON") + .HasColumnOrder(7); + + b.Property("SLOWINGFM") + .HasColumnType("int"); + + b.Property("SMTAGNO") + .HasColumnType("int"); + + b.Property("STOOPED") + .HasColumnType("int"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("nvarchar(20)") + .HasColumnOrder(2); + + b.Property("TREMKINE") + .HasColumnType("int"); + + b.Property("TREMPOST") + .HasColumnType("int"); + + b.Property("TREMREST") + .HasColumnType("int"); + + b.Property("UMNDIST") + .HasColumnType("int"); + + b.Property("UNISOMATO") + .HasColumnType("int"); + + b.Property("VFIELDCUT") + .HasColumnType("int"); + + b.Property("VHGAZEPAL") + .HasColumnType("int"); + + b.Property("VisitId") + .HasColumnType("int") + .HasColumnOrder(1); + + b.HasKey("Id"); + + b.HasIndex("VisitId") + .IsUnique(); + + b.ToTable("tbl_B8s"); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.B9", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("FormId") + .HasColumnOrder(0); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("ALCUSE") + .HasColumnType("bit") + .HasComment("Alcohol use"); + + b.Property("BEAGGRS") + .HasColumnType("int") + .HasComment("Participant currently manifests meaningful change in behavior — Aggression"); + + b.Property("BEAGIT") + .HasColumnType("int") + .HasComment("Participant currently manifests meaningful change in behavior — Agitation"); + + b.Property("BEAHALL") + .HasColumnType("int") + .HasComment("Participant currently manifests meaningful change in behavior — Psychosis — Auditory hallucinations"); + + b.Property("BEAHCOMP") + .HasColumnType("int") + .HasComment("IF YES, do the auditory hallucinations include complex sounds like voices speaking words, or music?"); + + b.Property("BEAHSIMP") + .HasColumnType("int") + .HasComment("IF YES, do the auditory hallucinations include simple sounds like knocks or other simple sounds?"); + + b.Property("BEANGER") + .HasColumnType("int") + .HasComment("Participant currently manifests meaningful change in behavior — Explosive anger"); + + b.Property("BEANX") + .HasColumnType("int") + .HasComment("Participant currently manifests meaningful change in behavior — Anxiety"); + + b.Property("BEAPATHY") + .HasColumnType("int") + .HasComment("Participant currently manifests meaningful change in behavior — Apathy, withdrawal"); + + b.Property("BEDEL") + .HasColumnType("int") + .HasComment("Participant currently manifests meaningful change in behavior — Psychosis — Abnormal, false, or delusional beliefs"); + + b.Property("BEDEP") + .HasColumnType("int") + .HasComment("Participant currently manifests meaningful change in behavior — Depressed mood"); + + b.Property("BEDISIN") + .HasColumnType("int") + .HasComment("Participant currently manifests meaningful change in behavior — Disinhibition"); + + b.Property("BEEMPATH") + .HasColumnType("int") + .HasComment("Participant currently manifests meaningful change in behavior — Loss of empathy"); + + b.Property("BEEUPH") + .HasColumnType("int") + .HasComment("Participant currently manifests meaningful change in behavior - Euphoria"); + + b.Property("BEHAGE") + .HasColumnType("int") + .HasComment("If any of the mood-related behavioral symptoms in 12a-12f are present, at what age did they begin?"); + + b.Property("BEIRRIT") + .HasColumnType("int") + .HasComment("Participant currently manifests meaningful change in behavior — Irritability"); + + b.Property("BEMODE") + .HasColumnType("int") + .HasComment("Overall mode of onset for behavioral symptoms"); + + b.Property("BEMODEX") + .HasColumnType("nvarchar(max)") + .HasComment("Other mode of onset - specify"); + + b.Property("BEOBCOM") + .HasColumnType("int") + .HasComment("Participant currently manifests meaningful change in behavior — Obsessions/compulsions"); + + b.Property("BEOTHR") + .HasColumnType("int") + .HasComment("Other behavioral symptom"); + + b.Property("BEOTHRX") + .HasColumnType("nvarchar(max)") + .HasComment("Participant currently manifests meaningful change in behavior - Other, specify"); + + b.Property("BEPERCH") + .HasColumnType("int") + .HasComment("Participant currently manifests meaningful change in behavior — Personality change"); + + b.Property("BEREM") + .HasColumnType("int") + .HasComment("Participant currently manifests meaningful change in behavior — REM sleep behavior disorder"); + + b.Property("BEREMAGO") + .HasColumnType("int") + .HasComment("IF YES, at what age did the dream enactment behavior begin?"); + + b.Property("BEREMCONF") + .HasColumnType("int") + .HasComment("Was REM sleep behavior disorder confirmed by polysomnography?"); + + b.Property("BESUBAB") + .HasColumnType("int") + .HasComment("Participant currently manifests meaningful change in behavior - Substance use"); + + b.Property("BEVHALL") + .HasColumnType("int") + .HasComment("Participant currently manifests meaningful change in behavior — Psychosis — Visual hallucinations"); + + b.Property("BEVPATT") + .HasColumnType("int") + .HasComment("IF YES, do their hallucinations include patterns that are not definite objects, such as pixelation of flat uniform surfaces?"); + + b.Property("BEVWELL") + .HasColumnType("int") + .HasComment("IF YES, do their hallucinations include well formed and detailed images of objects or people, either as independent images or as part of other objects?"); + + b.Property("CANNABUSE") + .HasColumnType("bit") + .HasComment("Cannabis use"); + + b.Property("COCAINEUSE") + .HasColumnType("bit") + .HasComment("Cocaine use"); + + b.Property("COGAGE") + .HasColumnType("int") + .HasComment("If any of the cognitive-related behavioral symptoms in 9a-9h are present, at what age did they begin?"); + + b.Property("COGATTN") + .HasColumnType("int") + .HasComment("Indicate whether the participant currently is meaningfully impaired in attention/concentration"); + + b.Property("COGFLUC") + .HasColumnType("int") + .HasComment("Indicate whether the participant currently has fluctuating cognition"); + + b.Property("COGJUDG") + .HasColumnType("int") + .HasComment("Indicate whether the participant currently is meaningfully impaired in executive function (judgment, planning, and problem-solving)"); + + b.Property("COGLANG") + .HasColumnType("int") + .HasComment("Indicate whether the participant currently is meaningfully impaired in language"); + + b.Property("COGMEM") + .HasColumnType("int") + .HasComment("Indicate whether the participant currently is meaningfully impaired in memory."); + + b.Property("COGMODE") + .HasColumnType("int") + .HasComment("Indicate the mode of onset for the most prominent cognitive problem that is causing the participant's complaints and/or affecting the participant's function."); + + b.Property("COGMODEX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasComment("Specify other mode of onset of cognitive symptoms"); + + b.Property("COGORI") + .HasColumnType("int") + .HasComment("Indicate whether the participant currently is meaningfully impaired in orientation."); + + b.Property("COGOTHR") + .HasColumnType("int") + .HasComment("Other cognitive impairment"); + + b.Property("COGOTHRX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasComment("Specify other cognitive domains"); + + b.Property("COGVIS") + .HasColumnType("int") + .HasComment("Indicate whether the participant currently is meaningfully impaired in visuospatial function"); + + b.Property("COURSE") + .HasColumnType("int") + .HasComment("Overall course of decline of cognitive / behavorial / motor syndrome"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DECCLBE") + .HasColumnType("int") + .HasComment("Based on the clinician’s judgment, is the participant currently experiencing any kind of behavioral symptoms?"); + + b.Property("DECCLCOG") + .HasColumnType("bit") + .HasComment("Based on the clinician’s judgment, is the participant currently experiencing meaningful impairment in cognition?"); + + b.Property("DECCLIN") + .HasColumnType("bit") + .HasComment("Does the participant have any neuropsychiatric/behavioral symptoms or declines in any cognitive or motor domain?"); + + b.Property("DECCLMOT") + .HasColumnType("bit") + .HasComment("Based on the clinician’s judgment, is the participant currently experiencing any motor symptoms?"); + + b.Property("DECCOG") + .HasColumnType("int") + .HasComment("Does the participant report a decline in any cognitive domain (relative to stable baseline prior to onset of current syndrome)?"); + + b.Property("DECCOGIN") + .HasColumnType("int") + .HasComment("Does the co-participant report a decline in any cognitive domain (relative to stable baseline prior to onset of current syndrome)?"); + + b.Property("DECMOT") + .HasColumnType("int") + .HasComment("Does the participant report a decline in any motor domain (relative to stable baseline prior to onset of current syndrome)?"); + + b.Property("DECMOTIN") + .HasColumnType("int") + .HasComment("Does the co-participant report a change in any motor domain (relative to stable baseline prior to onset of current syndrome)?"); + + b.Property("DeletedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("FRMDATE") + .HasColumnType("datetime2") + .HasColumnName("FRMDATE") + .HasColumnOrder(3); + + b.Property("FRSTCHG") + .HasColumnType("int") + .HasComment("Indicate the predominant domain that was first recognized as changed in the participant"); + + b.Property("INITIALS") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("nvarchar(3)") + .HasColumnName("INITIALS") + .HasColumnOrder(4); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LANG") + .HasColumnType("int") + .HasColumnName("LANG") + .HasColumnOrder(5); + + b.Property("MODE") + .HasColumnType("int") + .HasColumnName("MODE") + .HasColumnOrder(6); + + b.Property("MOFACE") + .HasColumnType("int") + .HasComment("Indicate whether the participant currently has meaningful changes in motor function — Change in facial expression"); + + b.Property("MOFALLS") + .HasColumnType("int") + .HasComment("Indicate whether the participant currently has meaningful changes in motor function — Falls"); + + b.Property("MOGAIT") + .HasColumnType("int") + .HasComment("Indicate whether the participant currently has meaningful changes in motor function — Gait disorder"); + + b.Property("MOLIMB") + .HasColumnType("int") + .HasComment("Indicate whether the participant currently has meaningful changes in motor function — Limb weakness"); + + b.Property("MOMOALS") + .HasColumnType("int") + .HasComment("Were changes in motor function suggestive of amyotrophic lateral sclerosis?"); + + b.Property("MOMODE") + .HasColumnType("int") + .HasComment("Indicate the mode of onset for the most prominent motor problem that is causing the participant's complaints and/or affecting the participant's function."); + + b.Property("MOMODEX") + .HasColumnType("nvarchar(max)") + .HasComment("Indicate mode of onset for the most prominent motor problem that is causing the participant's complains and or affecting the participant's function - Other, specify"); + + b.Property("MOMOPARK") + .HasColumnType("int") + .HasComment("Were changes in motor function suggestive of parkinsonism?"); + + b.Property("MOSLOW") + .HasColumnType("int") + .HasComment("Indicate whether the participant currently has meaningful changes in motor function — Slowness"); + + b.Property("MOSPEECH") + .HasColumnType("int") + .HasComment("Indicate whether the participant currently has meaningful changes in motor function — Change in speech"); + + b.Property("MOTORAGE") + .HasColumnType("int") + .HasComment("If changes in motor function are present in 15a-15g, at what age did they begin?"); + + b.Property("MOTREM") + .HasColumnType("int") + .HasComment("Indicate whether the participant currently has meaningful changes in motor function — Tremor"); + + b.Property("ModifiedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("NOT") + .HasColumnType("int") + .HasColumnName("NOT") + .HasColumnOrder(9); + + b.Property("OPIATEUSE") + .HasColumnType("bit") + .HasComment("Opiate use"); + + b.Property("OTHSUBUSE") + .HasColumnType("bit") + .HasComment("Other substance use"); + + b.Property("OTHSUBUSEX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasComment("Specify other substance use"); + + b.Property("PERCHAGE") + .HasColumnType("int") + .HasComment("If any of the personality-related behavioral symptoms in 12m-12r are present, at what age did they begin?"); + + b.Property("PSYCHAGE") + .HasColumnType("int") + .HasComment("If any of the psychosis and impulse control-related behavioral symptoms in 12h-12k are present, at what age did they begin?"); + + b.Property("PSYCHSYM") + .HasColumnType("int") + .HasComment("Does the participant report the development of any significant neuropsychiatric/behavioral symptoms (relative to stable baseline prior to onset of current syndrome)?"); + + b.Property("PSYCHSYMIN") + .HasColumnType("int") + .HasComment("Does the co-participant report the development of any significant neuropsychiatric/behavioral symptoms (relative to stable baseline prior to onset of current syndrome)?"); + + b.Property("RMMODE") + .HasColumnType("int") + .HasColumnName("RMMODE") + .HasColumnOrder(8); + + b.Property("RMREAS") + .HasColumnType("int") + .HasColumnName("RMREASON") + .HasColumnOrder(7); + + b.Property("SEDUSE") + .HasColumnType("bit") + .HasComment("Sedative/hypnotic use"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("nvarchar(20)") + .HasColumnOrder(2); + + b.Property("VisitId") + .HasColumnType("int") + .HasColumnOrder(1); + + b.HasKey("Id"); + + b.HasIndex("VisitId") + .IsUnique(); + + b.ToTable("tbl_B9s"); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.C1", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("FormId") + .HasColumnOrder(0); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("ANIMALS") + .HasColumnType("int"); + + b.Property("BOSTON") + .HasColumnType("int"); + + b.Property("COGSTAT") + .HasColumnType("int"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DIGIB") + .HasColumnType("int"); + + b.Property("DIGIBLEN") + .HasColumnType("int"); + + b.Property("DIGIF") + .HasColumnType("int"); + + b.Property("DIGIFLEN") + .HasColumnType("int"); + + b.Property("DeletedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("FRMDATE") + .HasColumnType("datetime2") + .HasColumnName("FRMDATE") + .HasColumnOrder(3); + + b.Property("INITIALS") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("nvarchar(3)") + .HasColumnName("INITIALS") + .HasColumnOrder(4); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LANG") + .HasColumnType("int") + .HasColumnName("LANG") + .HasColumnOrder(5); + + b.Property("LOGIDAY") + .HasColumnType("int"); + + b.Property("LOGIMEM") + .HasColumnType("int"); + + b.Property("LOGIMO") + .HasColumnType("int"); + + b.Property("LOGIPREV") + .HasColumnType("int"); + + b.Property("LOGIYR") + .HasColumnType("int"); + + b.Property("MEMTIME") + .HasColumnType("int"); + + b.Property("MEMUNITS") + .HasColumnType("int"); + + b.Property("MMSE") + .HasColumnType("int"); + + b.Property("MMSECOMP") + .HasColumnType("int"); + + b.Property("MMSEHEAR") + .HasColumnType("int"); + + b.Property("MMSELAN") + .HasColumnType("int"); + + b.Property("MMSELANX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("MMSELOC") + .HasColumnType("int"); + + b.Property("MMSEORDA") + .HasColumnType("int"); + + b.Property("MMSEORLO") + .HasColumnType("int"); + + b.Property("MMSEREAS") + .HasColumnType("int"); + + b.Property("MMSEVIS") + .HasColumnType("int"); + + b.Property("MODE") + .HasColumnType("int") + .HasColumnName("MODE") + .HasColumnOrder(6); + + b.Property("ModifiedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("NOT") + .HasColumnType("int") + .HasColumnName("NOT") + .HasColumnOrder(9); + + b.Property("NPSYCLOC") + .HasColumnType("int"); + + b.Property("NPSYLAN") + .HasColumnType("int"); + + b.Property("NPSYLANX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("PENTAGON") + .HasColumnType("int"); + + b.Property("RMMODE") + .HasColumnType("int") + .HasColumnName("RMMODE") + .HasColumnOrder(8); + + b.Property("RMREAS") + .HasColumnType("int") + .HasColumnName("RMREASON") + .HasColumnOrder(7); + + b.Property("Status") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("nvarchar(20)") + .HasColumnOrder(2); + + b.Property("TRAILA") + .HasColumnType("int"); + + b.Property("TRAILALI") + .HasColumnType("int"); + + b.Property("TRAILARR") + .HasColumnType("int"); + + b.Property("TRAILB") + .HasColumnType("int"); + + b.Property("TRAILBLI") + .HasColumnType("int"); + + b.Property("TRAILBRR") + .HasColumnType("int"); + + b.Property("UDSBENRS") + .HasColumnType("int"); + + b.Property("UDSBENTC") + .HasColumnType("int"); + + b.Property("UDSBENTD") + .HasColumnType("int"); + + b.Property("UDSVERFC") + .HasColumnType("int"); + + b.Property("UDSVERFN") + .HasColumnType("int"); + + b.Property("UDSVERLC") + .HasColumnType("int"); + + b.Property("UDSVERLN") + .HasColumnType("int"); + + b.Property("UDSVERLR") + .HasColumnType("int"); + + b.Property("UDSVERNF") + .HasColumnType("int"); + + b.Property("UDSVERTE") + .HasColumnType("int"); + + b.Property("UDSVERTI") + .HasColumnType("int"); + + b.Property("UDSVERTN") + .HasColumnType("int"); + + b.Property("VEG") + .HasColumnType("int"); + + b.Property("VisitId") + .HasColumnType("int") + .HasColumnOrder(1); + + b.HasKey("Id"); + + b.HasIndex("VisitId") + .IsUnique(); + + b.ToTable("tbl_C1s"); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.C2", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("FormId") + .HasColumnOrder(0); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("ANIMALS") + .HasColumnType("int"); + + b.Property("CERAD1INT") + .HasColumnType("int"); + + b.Property("CERAD1READ") + .HasColumnType("int"); + + b.Property("CERAD1REC") + .HasColumnType("int"); + + b.Property("CERAD2INT") + .HasColumnType("int"); + + b.Property("CERAD2READ") + .HasColumnType("int"); + + b.Property("CERAD2REC") + .HasColumnType("int"); + + b.Property("CERAD3INT") + .HasColumnType("int"); + + b.Property("CERAD3READ") + .HasColumnType("int"); + + b.Property("CERAD3REC") + .HasColumnType("int"); + + b.Property("CERADDTI") + .HasColumnType("int"); + + b.Property("CERADJ6INT") + .HasColumnType("int"); + + b.Property("CERADJ6REC") + .HasColumnType("int"); + + b.Property("CERADJ7NO") + .HasColumnType("int"); + + b.Property("CERADJ7YES") + .HasColumnType("int"); + + b.Property("COGSTAT") + .HasColumnType("int"); + + b.Property("CRAFTCUE") + .HasColumnType("int"); + + b.Property("CRAFTDRE") + .HasColumnType("int"); + + b.Property("CRAFTDTI") + .HasColumnType("int"); + + b.Property("CRAFTDVR") + .HasColumnType("int"); + + b.Property("CRAFTURS") + .HasColumnType("int"); + + b.Property("CRAFTVRS") + .HasColumnType("int"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DIGBACCT") + .HasColumnType("int"); + + b.Property("DIGBACLS") + .HasColumnType("int"); + + b.Property("DIGFORCT") + .HasColumnType("int"); + + b.Property("DIGFORSL") + .HasColumnType("int"); + + b.Property("DeletedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("FRMDATE") + .HasColumnType("datetime2") + .HasColumnName("FRMDATE") + .HasColumnOrder(3); + + b.Property("INITIALS") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("nvarchar(3)") + .HasColumnName("INITIALS") + .HasColumnOrder(4); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LANG") + .HasColumnType("int") + .HasColumnName("LANG") + .HasColumnOrder(5); + + b.Property("MINTPCNC") + .HasColumnType("int"); + + b.Property("MINTPCNG") + .HasColumnType("int"); + + b.Property("MINTSCNC") + .HasColumnType("int"); + + b.Property("MINTSCNG") + .HasColumnType("int"); + + b.Property("MINTTOTS") + .HasColumnType("int"); + + b.Property("MINTTOTW") + .HasColumnType("int"); + + b.Property("MOCAABST") + .HasColumnType("int"); + + b.Property("MOCACLOC") + .HasColumnType("int"); + + b.Property("MOCACLOH") + .HasColumnType("int"); + + b.Property("MOCACLON") + .HasColumnType("int"); + + b.Property("MOCACOMP") + .HasColumnType("int"); + + b.Property("MOCACUBE") + .HasColumnType("int"); + + b.Property("MOCADIGI") + .HasColumnType("int"); + + b.Property("MOCAFLUE") + .HasColumnType("int"); + + b.Property("MOCAHEAR") + .HasColumnType("int"); + + b.Property("MOCALAN") + .HasColumnType("int"); + + b.Property("MOCALANX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("MOCALETT") + .HasColumnType("int"); + + b.Property("MOCALOC") + .HasColumnType("int"); + + b.Property("MOCANAMI") + .HasColumnType("int"); + + b.Property("MOCAORCT") + .HasColumnType("int"); + + b.Property("MOCAORDT") + .HasColumnType("int"); + + b.Property("MOCAORDY") + .HasColumnType("int"); + + b.Property("MOCAORMO") + .HasColumnType("int"); + + b.Property("MOCAORPL") + .HasColumnType("int"); + + b.Property("MOCAORYR") + .HasColumnType("int"); + + b.Property("MOCAREAS") + .HasColumnType("int"); + + b.Property("MOCARECC") + .HasColumnType("int"); + + b.Property("MOCARECN") + .HasColumnType("int"); + + b.Property("MOCARECR") + .HasColumnType("int"); + + b.Property("MOCAREGI") + .HasColumnType("int"); + + b.Property("MOCAREPE") + .HasColumnType("int"); + + b.Property("MOCASER7") + .HasColumnType("int"); + + b.Property("MOCATOTS") + .HasColumnType("int"); + + b.Property("MOCATRAI") + .HasColumnType("int"); + + b.Property("MOCAVIS") + .HasColumnType("int"); + + b.Property("MODE") + .HasColumnType("int") + .HasColumnName("MODE") + .HasColumnOrder(6); + + b.Property("ModifiedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("NOT") + .HasColumnType("int") + .HasColumnName("NOT") + .HasColumnOrder(9); + + b.Property("NPSYCLOC") + .HasColumnType("int"); + + b.Property("NPSYLAN") + .HasColumnType("int"); + + b.Property("NPSYLANX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("RESPASST") + .HasColumnType("int"); + + b.Property("RESPDISN") + .HasColumnType("int"); + + b.Property("RESPDIST") + .HasColumnType("int"); + + b.Property("RESPEMOT") + .HasColumnType("int"); + + b.Property("RESPFATG") + .HasColumnType("int"); + + b.Property("RESPHEAR") + .HasColumnType("int"); + + b.Property("RESPINTR") + .HasColumnType("int"); + + b.Property("RESPOTH") + .HasColumnType("int"); + + b.Property("RESPOTHX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("RESPVAL") + .HasColumnType("int"); + + b.Property("REY1INT") + .HasColumnType("int"); + + b.Property("REY1REC") + .HasColumnType("int"); + + b.Property("REY2INT") + .HasColumnType("int"); + + b.Property("REY2REC") + .HasColumnType("int"); + + b.Property("REY3INT") + .HasColumnType("int"); + + b.Property("REY3REC") + .HasColumnType("int"); + + b.Property("REY4INT") + .HasColumnType("int"); + + b.Property("REY4REC") + .HasColumnType("int"); + + b.Property("REY5INT") + .HasColumnType("int"); + + b.Property("REY5REC") + .HasColumnType("int"); + + b.Property("REY6INT") + .HasColumnType("int"); + + b.Property("REY6REC") + .HasColumnType("int"); + + b.Property("REYBINT") + .HasColumnType("int"); + + b.Property("REYBREC") + .HasColumnType("int"); + + b.Property("REYDINT") + .HasColumnType("int"); + + b.Property("REYDREC") + .HasColumnType("int"); + + b.Property("REYDTI") + .HasColumnType("int"); + + b.Property("REYFPOS") + .HasColumnType("int"); + + b.Property("REYMETHOD") + .HasColumnType("int"); + + b.Property("REYTCOR") + .HasColumnType("int"); + + b.Property("RMMODE") + .HasColumnType("int") + .HasColumnName("RMMODE") + .HasColumnOrder(8); + + b.Property("RMREAS") + .HasColumnType("int") + .HasColumnName("RMREASON") + .HasColumnOrder(7); + + b.Property("Status") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("nvarchar(20)") + .HasColumnOrder(2); + + b.Property("TRAILA") + .HasColumnType("int"); + + b.Property("TRAILALI") + .HasColumnType("int"); + + b.Property("TRAILARR") + .HasColumnType("int"); + + b.Property("TRAILB") + .HasColumnType("int"); + + b.Property("TRAILBLI") + .HasColumnType("int"); + + b.Property("TRAILBRR") + .HasColumnType("int"); + + b.Property("UDSBENRS") + .HasColumnType("int"); + + b.Property("UDSBENTC") + .HasColumnType("int"); + + b.Property("UDSBENTD") + .HasColumnType("int"); + + b.Property("UDSVERFC") + .HasColumnType("int"); + + b.Property("UDSVERFN") + .HasColumnType("int"); + + b.Property("UDSVERLC") + .HasColumnType("int"); + + b.Property("UDSVERLN") + .HasColumnType("int"); + + b.Property("UDSVERLR") + .HasColumnType("int"); + + b.Property("UDSVERNF") + .HasColumnType("int"); + + b.Property("UDSVERTE") + .HasColumnType("int"); + + b.Property("UDSVERTI") + .HasColumnType("int"); + + b.Property("UDSVERTN") + .HasColumnType("int"); + + b.Property("VEG") + .HasColumnType("int"); + + b.Property("VERBALTEST") + .HasColumnType("int"); + + b.Property("VisitId") + .HasColumnType("int") + .HasColumnOrder(1); + + b.HasKey("Id"); + + b.HasIndex("VisitId") + .IsUnique(); + + b.ToTable("tbl_C2s"); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.D1a", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("FormId") + .HasColumnOrder(0); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("ALCDEM") + .HasColumnType("bit") + .HasComment("27. Cognitive impairment due to alcohol abuse (present)"); + + b.Property("ALCDEMIF") + .HasColumnType("int") + .HasComment("27a. Cognitive impairment due to alcohol abuse (primary/contributing/non-contributing)"); + + b.Property("AMNDEM") + .HasColumnType("bit") + .HasComment("8a. Amnestic predominant syndrome"); + + b.Property("ANXIET") + .HasColumnType("bit") + .HasComment("14. Anxiety disorder (present)"); + + b.Property("ANXIETIF") + .HasColumnType("int") + .HasComment("14a. Anxiety disorder (primary/contributing/non-contributing)"); + + b.Property("APNEADX") + .HasColumnType("bit") + .HasComment("25. Sleep apnea (i.e., obstructive, central, mixed or complex sleep apnea) (present)"); + + b.Property("APNEADXIF") + .HasColumnType("int") + .HasComment("25a. Sleep apnea (i.e., obstructive, central, mixed or complex sleep apnea) (primary/contributing/non-contributing)"); + + b.Property("BDOMAFREG") + .HasColumnType("int") + .HasComment("7b. MBI affected domains - Affective regulation"); + + b.Property("BDOMIMP") + .HasColumnType("int") + .HasComment("7c. MBI affected domains - Impulse control"); + + b.Property("BDOMMOT") + .HasColumnType("int") + .HasComment("7a. MBI affected domains - Motivation"); + + b.Property("BDOMSOCIAL") + .HasColumnType("int") + .HasComment("7d. MBI affected domains - Social appropriateness"); + + b.Property("BDOMTHTS") + .HasColumnType("int") + .HasComment("7e. MBI affected domains - Thought content/perception"); + + b.Property("BIPOLDIF") + .HasColumnType("int") + .HasComment("12a. Bipolar disorder (primary/contributing/non-contributing)"); + + b.Property("BIPOLDX") + .HasColumnType("bit") + .HasComment("12. Bipolar disorder (present)"); + + b.Property("CBSSYN") + .HasColumnType("bit") + .HasComment("8j. Corticobasal syndrome (CBS)"); + + b.Property("CDOMAPRAX") + .HasColumnType("bit") + .HasComment("6g. Dementia and MCI affected domains - Apraxia"); + + b.Property("CDOMATTN") + .HasColumnType("bit") + .HasComment("6c. Dementia and MCI affected domains - Attention"); + + b.Property("CDOMBEH") + .HasColumnType("bit") + .HasComment("6f. Dementia and MCI affected domains - Behavioral"); + + b.Property("CDOMEXEC") + .HasColumnType("bit") + .HasComment("6d. Dementia and MCI affected domains - Executive"); + + b.Property("CDOMLANG") + .HasColumnType("bit") + .HasComment("6b. Dementia and MCI affected domains - Language"); + + b.Property("CDOMMEM") + .HasColumnType("bit") + .HasComment("6a. Dementia and MCI affected domains - Memory"); + + b.Property("CDOMVISU") + .HasColumnType("bit") + .HasComment("6e. Dementia and MCI affected domains - Visuospatial"); + + b.Property("COGOTH") + .HasColumnType("bit") + .HasComment("30. Cognitive impairment not otherwise specified (NOS) (present)"); + + b.Property("COGOTH2") + .HasColumnType("bit") + .HasComment("31. Cognitive impairment not otherwise specified (NOS) (present)"); + + b.Property("COGOTH2F") + .HasColumnType("int") + .HasComment("31a. Cognitive impairment NOS (primary/contributing/non-contributing)"); + + b.Property("COGOTH2X") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasComment("31b. Cognitive impairment NOS (specify)"); + + b.Property("COGOTH3") + .HasColumnType("bit") + .HasComment("32. Cognitive impairment not otherwise specified (NOS) (present)"); + + b.Property("COGOTH3F") + .HasColumnType("int") + .HasComment("32a. Cognitive impairment NOS (primary/contributing/non-contributing)"); + + b.Property("COGOTH3X") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasComment("32b. Cognitive impairment NOS (specify)"); + + b.Property("COGOTHIF") + .HasColumnType("int") + .HasComment("30a. Cognitive impairment NOS (primary/contributing/non-contributing)"); + + b.Property("COGOTHX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasComment("30b. Cognitive impairment NOS (specify)"); + + b.Property("CTESYN") + .HasColumnType("bit") + .HasComment("8i. Traumatic encephalopathy syndrome"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DELIR") + .HasColumnType("bit") + .HasComment("17. Delirium (present)"); + + b.Property("DELIRIF") + .HasColumnType("int") + .HasComment("17a. Delirium (primary/contributing/non-contributing)"); + + b.Property("DEMENTED") + .HasColumnType("int") + .HasComment("3. Does the participant meet criteria for dementia?"); + + b.Property("DXMETHOD") + .HasColumnType("int") + .HasComment("1. Diagnosis method—responses in this form are based on diagnosis by a:"); + + b.Property("DYEXECSYN") + .HasColumnType("bit") + .HasComment("8b. Dysexecutive predominant syndrome"); + + b.Property("DeletedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("EPILEP") + .HasColumnType("bit") + .HasComment("20. Epilepsy (present)"); + + b.Property("EPILEPIF") + .HasColumnType("int") + .HasComment("20a. Epilepsy (primary/contributing/non-contributing)"); + + b.Property("FRMDATE") + .HasColumnType("datetime2") + .HasColumnName("FRMDATE") + .HasColumnOrder(3); + + b.Property("FTDSYN") + .HasColumnType("bit") + .HasComment("8e. Behavioral variant frontotemporal (bvFTD) syndrome"); + + b.Property("GENANX") + .HasColumnType("bit") + .HasComment("14b. Generalized Anxiety Disorder"); + + b.Property("HIV") + .HasColumnType("bit") + .HasComment("23. Human Immunodeficiency Virus (HIV) infection (present)"); + + b.Property("HIVIF") + .HasColumnType("int") + .HasComment("23a. Human Immunodeficiency Virus (HIV) infection (primary/contributing/non-contributing)"); + + b.Property("HYCEPH") + .HasColumnType("bit") + .HasComment("21. Normal-pressure hydrocephalus (present)"); + + b.Property("HYCEPHIF") + .HasColumnType("int") + .HasComment("21a. Normal-pressure hydrocephalus (primary/contributing/non-contributing)"); + + b.Property("IMPNOMCI") + .HasColumnType("bit") + .HasComment("5b. Cognitively impaired, not MCI"); + + b.Property("IMPNOMCICG") + .HasColumnType("bit") + .HasComment("5a2. Cognitively impaired, not MCI reason - Cognitive testing is abnormal but no clinical concern or functional decline (e.g., CDR SB=0 and FAS=0)"); + + b.Property("IMPNOMCIFU") + .HasColumnType("bit") + .HasComment("5a1. Cognitively impaired, not MCI reason - Evidence of functional impairment (e.g., CDR SB>0 and/or FAS>0), but available cognitive testing is judged to be normal"); + + b.Property("IMPNOMCIO") + .HasColumnType("bit") + .HasComment("5a4. Cognitively impaired, not MCI reason - Other"); + + b.Property("IMPNOMCIOX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasComment("5a4a. Cognitively impaired, not MCI reason - Other (specify)"); + + b.Property("IMPNOMCLCD") + .HasColumnType("bit") + .HasComment("5a3. Cognitively impaired, not MCI reason - Longstanding cognitive difficulties, not representing a change from their usual function"); + + b.Property("IMPSUB") + .HasColumnType("bit") + .HasComment("28. Cognitive impairment due to substance use or abuse (present)"); + + b.Property("IMPSUBIF") + .HasColumnType("int") + .HasComment("28a. Cognitive impairment due to substance use or abuse (primary/contributing/non-contributing)"); + + b.Property("INITIALS") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("nvarchar(3)") + .HasColumnName("INITIALS") + .HasColumnOrder(4); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LANG") + .HasColumnType("int") + .HasColumnName("LANG") + .HasColumnOrder(5); + + b.Property("LBDSYN") + .HasColumnType("bit") + .HasComment("8f. Lewy body syndrome"); + + b.Property("LBDSYNT") + .HasColumnType("int") + .HasComment("8f1. Lewy body syndrome - type"); + + b.Property("MAJDEPDIF") + .HasColumnType("int") + .HasComment("10a. Major depressive disorder (primary/contributing/non-contributing)"); + + b.Property("MAJDEPDX") + .HasColumnType("bit") + .HasComment("10. Major depressive disorder (present)"); + + b.Property("MBI") + .HasColumnType("int") + .HasComment("7. Does the participant meet criteria for MBI"); + + b.Property("MCI") + .HasColumnType("int") + .HasComment("4b. Does the participant meet criteria for MCI (amnestic or non-amnestic)?"); + + b.Property("MCICRITCLN") + .HasColumnType("bit") + .HasComment("4a1. MCI criteria - Clinical concern about decline in cognition compared to participant’s prior level of lifelong or usual cognitive function"); + + b.Property("MCICRITFUN") + .HasColumnType("bit") + .HasComment("4a3. MCI criteria - Largely preserved functional independence OR functional dependence that is not related to cognitive decline"); + + b.Property("MCICRITIMP") + .HasColumnType("bit") + .HasComment("4a2. MCI criteria - Impairment in one or more cognitive domains, compared to participant’s estimated prior level of lifelong or usual cognitive function, or supported by objective longitudinal neuropsychological evidence of decline"); + + b.Property("MEDS") + .HasColumnType("bit") + .HasComment("29. Cognitive impairment due to medications (present)"); + + b.Property("MEDSIF") + .HasColumnType("int") + .HasComment("29a. Cognitive impairment due to medications (primary/contributing/non-contributing)"); + + b.Property("MODE") + .HasColumnType("int") + .HasColumnName("MODE") + .HasColumnOrder(6); + + b.Property("MSASYN") + .HasColumnType("bit") + .HasComment("8k. Multiple system atrophy (MSA) syndrome"); + + b.Property("MSASYNT") + .HasColumnType("int") + .HasComment("8k1. Multiple system atrophy (MSA) syndrome - type"); + + b.Property("ModifiedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("NAMNDEM") + .HasColumnType("bit") + .HasComment("8g. Non-amnestic multidomain syndrome, not PCA, PPA, bvFT, or DLB syndrome"); + + b.Property("NDEVDIS") + .HasColumnType("bit") + .HasComment("16. Developmental neuropsychiatric disorders (e.g., autism spectrum disorder (ASD), attention-deficit hyperactivity disorder (ADHD), dyslexia) (present)"); + + b.Property("NDEVDISIF") + .HasColumnType("int") + .HasComment("16a. Developmental neuropsychiatric disorders (e.g., autism spectrum disorder (ASD), attention-deficit hyperactivity disorder (primary/contributing/non-contributing)"); + + b.Property("NEOP") + .HasColumnType("bit") + .HasComment("22. CNS Neoplasm (present)"); + + b.Property("NEOPIF") + .HasColumnType("int") + .HasComment("22a. CNS Neoplasm (primary/contributing/non-contributing)"); + + b.Property("NEOPSTAT") + .HasColumnType("int") + .HasComment("22b. CNS Neoplasm - benign or malignant"); + + b.Property("NORMCOG") + .HasColumnType("int") + .HasComment("2. Does the participant have unimpaired cognition & behavior"); + + b.Property("NOT") + .HasColumnType("int") + .HasColumnName("NOT") + .HasColumnOrder(9); + + b.Property("OCDDX") + .HasColumnType("bit") + .HasComment("14d. Obsessive-compulsive disorder (OCD)"); + + b.Property("OTHANXD") + .HasColumnType("bit") + .HasComment("14e. Other anxiety disorder"); + + b.Property("OTHANXDX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasComment("14e1. Other anxiety disorder (specify)"); + + b.Property("OTHCILLIF") + .HasColumnType("int") + .HasComment("26a. Cognitive impairment due to other neurologic, genetic, infectious conditions (not listed above), or systemic disease/medical illness (as indicated on Form A5/D2) (primary/contributing/non-contributing)"); + + b.Property("OTHCOGILL") + .HasColumnType("bit") + .HasComment("26. Cognitive impairment due to other neurologic, genetic, infectious conditions (not listed above), or systemic disease/medical illness (as indicated on Form A5/D2) (present)"); + + b.Property("OTHCOGILLX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasComment("26b. Specify cognitive impairment due to other neurologic, genetic, infection conditions or systemic disease"); + + b.Property("OTHDEPDIF") + .HasColumnType("int") + .HasComment("11a. Other specified depressive disorder (primary/contributing/non-contributing)"); + + b.Property("OTHDEPDX") + .HasColumnType("bit") + .HasComment("11. Other specified depressive disorder (present)"); + + b.Property("OTHPSY") + .HasColumnType("bit") + .HasComment("18. Other psychiatric disorder (present)"); + + b.Property("OTHPSYIF") + .HasColumnType("int") + .HasComment("18a. Other psychiatric disorder (primary/contributing/non-contributing)"); + + b.Property("OTHPSYX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasComment("18b. Other psychiatric disorder (specify)"); + + b.Property("OTHSYN") + .HasColumnType("bit") + .HasComment("8l. Other syndrome"); + + b.Property("OTHSYNX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasComment("8l1. Other syndrome (specify)"); + + b.Property("PANICDISDX") + .HasColumnType("bit") + .HasComment("14c. Panic Disorder"); + + b.Property("PCA") + .HasColumnType("bit") + .HasComment("8c. Primary visual presentation (such as posterior cortical atrophy (PCA) syndrome)"); + + b.Property("POSTC19") + .HasColumnType("bit") + .HasComment("24. Post COVID-19 cognitive impairment (present)"); + + b.Property("POSTC19IF") + .HasColumnType("int") + .HasComment("24a. Post COVID-19 cognitive impairment (primary/contributing/non-contributing)"); + + b.Property("PPASYN") + .HasColumnType("bit") + .HasComment("8d. Primary progressive aphasia (PPA) syndrome"); + + b.Property("PPASYNT") + .HasColumnType("int") + .HasComment("8d1. Primary progressive aphasia (PPA) syndrome - type"); + + b.Property("PREDOMSYN") + .HasColumnType("int") + .HasComment("8. Is there a predominant clinical syndrome?"); + + b.Property("PSPSYN") + .HasColumnType("bit") + .HasComment("8h. Primary supranuclear palsy (PSP) syndrome"); + + b.Property("PSPSYNT") + .HasColumnType("int") + .HasComment("8h1. Primary supranuclear palsy (PSP) syndrome - type"); + + b.Property("PTSDDX") + .HasColumnType("bit") + .HasComment("15. Post-traumatic stress disorder (PTSD) (present)"); + + b.Property("PTSDDXIF") + .HasColumnType("int") + .HasComment("15a. Post-traumatic stress disorder (PTSD) (primary/contributing/non-contributing)"); + + b.Property("RMMODE") + .HasColumnType("int") + .HasColumnName("RMMODE") + .HasColumnOrder(8); + + b.Property("RMREAS") + .HasColumnType("int") + .HasColumnName("RMREASON") + .HasColumnOrder(7); + + b.Property("SCD") + .HasColumnType("int") + .HasComment("2a. Does the participant report 1) significant concerns about changes in cognition AND 2) no neuropsychological evidence of decline AND 3) no functional decline?"); + + b.Property("SCDDXCONF") + .HasColumnType("int") + .HasComment("2b. As a clinician, are you confident that the subjective cognitive decline is clinically meaningful?"); + + b.Property("SCHIZOIF") + .HasColumnType("int") + .HasComment("13a. Schizophrenia or other psychotic disorder (primary/contributing/non-contributing)"); + + b.Property("SCHIZOP") + .HasColumnType("bit") + .HasComment("13. Schizophrenia or other psychotic disorder (present)"); + + b.Property("SYNINFBIOM") + .HasColumnType("bit") + .HasComment("9c. Indicate the source(s) of information used to assign the clinical syndrome - Biomarkers (MRI, PET, CSF, plasma)"); + + b.Property("SYNINFCLIN") + .HasColumnType("bit") + .HasComment("9a. Indicate the source(s) of information used to assign the clinical syndrome - Clinical information (history, CDR)"); + + b.Property("SYNINFCTST") + .HasColumnType("bit") + .HasComment("9b. Indicate the source(s) of information used to assign the clinical syndrome - Cognitive testing"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("nvarchar(20)") + .HasColumnOrder(2); + + b.Property("TBIDX") + .HasColumnType("bit") + .HasComment("19. Traumatic brain injury (present)"); + + b.Property("TBIDXIF") + .HasColumnType("int") + .HasComment("19a. Traumatic brain injury (primary/contributing/non-contributing)"); + + b.Property("VisitId") + .HasColumnType("int") + .HasColumnOrder(1); + + b.HasKey("Id"); + + b.HasIndex("VisitId") + .IsUnique(); + + b.ToTable("tbl_D1as"); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.D1b", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("FormId") + .HasColumnOrder(0); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("ALZDIS") + .HasColumnType("bit") + .HasComment("12. Alzheimer's disease"); + + b.Property("ALZDISIF") + .HasColumnType("int") + .HasComment("12a. Primary, contributing, or non-contributing - Alzheimer's disease"); + + b.Property("AMYLPET") + .HasColumnType("int") + .HasComment("6a1. Elevated amyloid"); + + b.Property("AUTDOMMUT") + .HasColumnType("int") + .HasComment("11. Is there an autosomal dominant pathogenic variant to support an etiological diagnosis?"); + + b.Property("BIOMAD1") + .HasColumnType("int") + .HasComment("8a. Other biomarker modality - Consistent with AD"); + + b.Property("BIOMAD2") + .HasColumnType("int") + .HasComment("9a. Other biomarker modality - Consistent with AD"); + + b.Property("BIOMAD3") + .HasColumnType("int") + .HasComment("10a. Other biomarker modality - Consistent with AD"); + + b.Property("BIOMARKDX") + .HasColumnType("int") + .HasComment("1. Were any biomarker results used to support the current etiological diagnosis?"); + + b.Property("BIOMFTLD1") + .HasColumnType("int") + .HasComment("8b. Other biomarker modality - Consistent with FTLD"); + + b.Property("BIOMFTLD2") + .HasColumnType("int") + .HasComment("9b. Other biomarker modality - Consistent with FTLD"); + + b.Property("BIOMFTLD3") + .HasColumnType("int") + .HasComment("10b. Other biomarker modality - Consistent with FTLD"); + + b.Property("BIOMLBD1") + .HasColumnType("int") + .HasComment("8c. Other biomarker modality - Consistent with LBD"); + + b.Property("BIOMLBD2") + .HasColumnType("int") + .HasComment("9c. Other biomarker modality - Consistent with LBD"); + + b.Property("BIOMLBD3") + .HasColumnType("int") + .HasComment("10c. Other biomarker modality - Consistent with LBD"); + + b.Property("BIOMOTH1") + .HasColumnType("int") + .HasComment("8d. Other biomarker modality - Consistent with other etiology"); + + b.Property("BIOMOTH2") + .HasColumnType("int") + .HasComment("9d. Other biomarker modality - Consistent with other etiology"); + + b.Property("BIOMOTH3") + .HasColumnType("int") + .HasComment("10d. Other biomarker modality - Consistent with other etiology"); + + b.Property("BIOMOTHX1") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasComment("8d1. Other biomarker modality - Consistent with other etiology (specify)"); + + b.Property("BIOMOTHX2") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasComment("9d1. Other biomarker modality - Consistent with other etiology (specify)"); + + b.Property("BIOMOTHX3") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasComment("10d1. Other biomarker modality - Consistent with other etiology (specify)"); + + b.Property("BLOODAD") + .HasColumnType("int") + .HasComment("3a. Blood-based biomarkers - Consistent with AD"); + + b.Property("BLOODFTLD") + .HasColumnType("int") + .HasComment("3b. Blood-based biomarkers - Consistent with FTLD"); + + b.Property("BLOODLBD") + .HasColumnType("int") + .HasComment("3c. Blood-based biomarkers - Consistent with LBD"); + + b.Property("BLOODOTH") + .HasColumnType("int") + .HasComment("3d. Blood-based biomarkers - Consistent with other etiology"); + + b.Property("BLOODOTHX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasComment("3d1. Blood-based biomarkers - Consistent with other etiology (specify)"); + + b.Property("CAA") + .HasColumnType("bit") + .HasComment("21. Cerebral amyloid angiopathy"); + + b.Property("CAAIF") + .HasColumnType("int") + .HasComment("21a. Primary, contributing, or non-contributing - Cerebral amyloid angiopathy"); + + b.Property("CORT") + .HasColumnType("bit") + .HasComment("14b2. Corticobasal degeneration (CBD)"); + + b.Property("CORTIF") + .HasColumnType("int") + .HasComment("14b2a. Primary, contributing, or non-contributing - Corticobasal degeneration (CBD)"); + + b.Property("CSFAD") + .HasColumnType("int") + .HasComment("4a. CSF-based biomarkers - Consistent with AD"); + + b.Property("CSFFTLD") + .HasColumnType("int") + .HasComment("4b. CSF-based biomarkers - Consistent with FTLD"); + + b.Property("CSFLBD") + .HasColumnType("int") + .HasComment("4c. CSF-based biomarkers - Consistent with LBD"); + + b.Property("CSFOTH") + .HasColumnType("int") + .HasComment("4d. CSF-based biomarkers - Consistent with other etiology"); + + b.Property("CSFOTHX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasComment("4d1. CSF-based biomarkers - Consistent with other etiology (specify)"); + + b.Property("CTE") + .HasColumnType("bit") + .HasComment("17. Chronic traumatic encephalopathy"); + + b.Property("CTEIF") + .HasColumnType("int") + .HasComment("17a. Primary, contributing, or non-contributing - Chronic traumatic encephalopathy"); + + b.Property("CVD") + .HasColumnType("bit") + .HasComment("15. Vascular brain injury (based on clinical and imaging evidence according to your Center's standards)"); + + b.Property("CVDIF") + .HasColumnType("int") + .HasComment("15a. Primary, contributing, or non-contributing - Vascular brain injury"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DATSCANDX") + .HasColumnType("int") + .HasComment("6c. Dopamine Transporter (DAT) Scan - Was DAT Scan data or information used to support an etiological diagnosis?"); + + b.Property("DOWNS") + .HasColumnType("bit") + .HasComment("18. Down syndrome"); + + b.Property("DOWNSIF") + .HasColumnType("int") + .HasComment("18a. Primary, contributing, or non-contributing - Down syndrome"); + + b.Property("DeletedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("FDGAD") + .HasColumnType("int") + .HasComment("6b1. FDG PET - Consistent with AD"); + + b.Property("FDGFTLD") + .HasColumnType("int") + .HasComment("6b2. FDG PET - Consistent with FTLD"); + + b.Property("FDGLBD") + .HasColumnType("int") + .HasComment("6b3. FDG PET - Consistent with LBD"); + + b.Property("FDGOTH") + .HasColumnType("int") + .HasComment("6b4. FDG PET - Consistent with other etiology"); + + b.Property("FDGOTHX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasComment("6b4a. FDG PET - Consistent with other etiology (specify)"); + + b.Property("FDGPETDX") + .HasColumnType("int") + .HasComment("6b. FDG PET - Was FDG PET data or information used to support an etiological diagnosis?"); + + b.Property("FLUIDBIOM") + .HasColumnType("int") + .HasComment("2. Fluid Biomarkers - Were fluid biomarkers used for assessing the etiological diagnosis?"); + + b.Property("FRMDATE") + .HasColumnType("datetime2") + .HasColumnName("FRMDATE") + .HasColumnOrder(3); + + b.Property("FTLD") + .HasColumnType("bit") + .HasComment("14. Frontotemporal lobar degeneration"); + + b.Property("FTLDIF") + .HasColumnType("int") + .HasComment("14a. Primary, contributing, or non-contributing - Frontotemporal lobar degeneration"); + + b.Property("FTLDMO") + .HasColumnType("bit") + .HasComment("14b3. FTLD with motor neuron disease"); + + b.Property("FTLDMOIF") + .HasColumnType("int") + .HasComment("14b3a. Primary, contributing, or non-contributing - FTLD with motor neuron disease"); + + b.Property("FTLDNOIF") + .HasColumnType("int") + .HasComment("14b4a. Primary, contributing, or non-contributing - FTLD not otherwise specified (NOS)"); + + b.Property("FTLDNOS") + .HasColumnType("bit") + .HasComment("14b4. FTLD not otherwise specified (NOS)"); + + b.Property("FTLDSUBT") + .HasColumnType("int") + .HasComment("14c. FTLD subtype"); + + b.Property("FTLDSUBX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasComment("14c1. Other FTLD subtype (specify)"); + + b.Property("HUNT") + .HasColumnType("bit") + .HasComment("19. Huntington's disease"); + + b.Property("HUNTIF") + .HasColumnType("int") + .HasComment("19a. Primary, contributing, or non-contributing - Huntington's disease"); + + b.Property("IMAGEWMH") + .HasColumnType("int") + .HasComment("7a3f. Extensive white-matter hyperintensity (CHS score 7-8+)"); + + b.Property("IMAGINGDX") + .HasColumnType("int") + .HasComment("5. Imaging - Was imaging used for assessing etiological diagnosis?"); + + b.Property("IMAGLAC") + .HasColumnType("int") + .HasComment("7a3b. Lacunar infarct(s)"); + + b.Property("IMAGLINF") + .HasColumnType("int") + .HasComment("7a3a. Large vessel infarct(s)"); + + b.Property("IMAGMACH") + .HasColumnType("int") + .HasComment("7a3c. Macrohemorrhage(s)"); + + b.Property("IMAGMICH") + .HasColumnType("int") + .HasComment("7a3d. Microhemorrhage(s)"); + + b.Property("IMAGMWMH") + .HasColumnType("int") + .HasComment("7a3e. Moderate white-matter hyperintensity (CHS score 5-6)"); + + b.Property("INITIALS") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("nvarchar(3)") + .HasColumnName("INITIALS") + .HasColumnOrder(4); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LANG") + .HasColumnType("int") + .HasColumnName("LANG") + .HasColumnOrder(5); + + b.Property("LATE") + .HasColumnType("bit") + .HasComment("22. LATE: Limbic-predominant age-related TDP-43 encephalopathy"); + + b.Property("LATEIF") + .HasColumnType("int") + .HasComment("22a. Primary, contributing, or non-contributing - LATE"); + + b.Property("LBDIF") + .HasColumnType("int") + .HasComment("13a. Primary, contributing, or non-contributing - Lewy body disease"); + + b.Property("LBDIS") + .HasColumnType("bit") + .HasComment("13. Lewy body disease"); + + b.Property("MODE") + .HasColumnType("int") + .HasColumnName("MODE") + .HasColumnOrder(6); + + b.Property("MSA") + .HasColumnType("bit") + .HasComment("16. Multiple system atrophy"); + + b.Property("MSAIF") + .HasColumnType("int") + .HasComment("16a. Primary, contributing, or non-contributing - Multiple system atrophy"); + + b.Property("ModifiedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("NOT") + .HasColumnType("int") + .HasColumnName("NOT") + .HasColumnOrder(9); + + b.Property("OTHBIOM1") + .HasColumnType("int") + .HasComment("8. Other biomarker modality - Was another biomarker modality used to support an etiological diagnosis?"); + + b.Property("OTHBIOM2") + .HasColumnType("int") + .HasComment("9. Other biomarker modality - Was another biomarker modality used to support an etiological diagnosis?"); + + b.Property("OTHBIOM3") + .HasColumnType("int") + .HasComment("10. Other biomarker modality - Was another biomarker modality used to support an etiological diagnosis?"); + + b.Property("OTHBIOMX1") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasComment("8a1. Other biomarker modality - Was another biomarker modality used to support an etiological diagnosis? (specify) OTHBI"); + + b.Property("OTHBIOMX2") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasComment("9a1. Other biomarker modality - Was another biomarker modality used to support an etiological diagnosis? (specify)"); + + b.Property("OTHBIOMX3") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasComment("10a1. Other biomarker modality - Was another biomarker modality used to support an etiological diagnosis? (specify)"); + + b.Property("OTHCOG") + .HasColumnType("bit") + .HasComment("23. Other"); + + b.Property("OTHCOGIF") + .HasColumnType("int") + .HasComment("23a. Primary, contributing, or non-contributing - Other"); + + b.Property("OTHCOGX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasComment("23b. Other (specify)"); + + b.Property("PETDX") + .HasColumnType("int") + .HasComment("6a. Tracer-based PET - Were tracer-based PET measures used in assessing an etiological diagnosis?"); + + b.Property("PRION") + .HasColumnType("bit") + .HasComment("20. Prion disease (CJD, other)"); + + b.Property("PRIONIF") + .HasColumnType("int") + .HasComment("20a. Primary, contributing, or non-contributing - Prion disease (CJD, other)"); + + b.Property("PSP") + .HasColumnType("bit") + .HasComment("14ba. Primary supranuclear palsy (PSP)"); + + b.Property("PSPIF") + .HasColumnType("int") + .HasComment("14b1a. Primary, contributing, or non-contributing - Primary supranuclear palsy (PSP)"); + + b.Property("RMMODE") + .HasColumnType("int") + .HasColumnName("RMMODE") + .HasColumnOrder(8); + + b.Property("RMREAS") + .HasColumnType("int") + .HasColumnName("RMREASON") + .HasColumnOrder(7); + + b.Property("STRUCTAD") + .HasColumnType("int") + .HasComment("7a1. Atrophy pattern consistent with AD"); + + b.Property("STRUCTCVD") + .HasColumnType("int") + .HasComment("7a3. Consistent with cerebrovascular disease (CVD)"); + + b.Property("STRUCTDX") + .HasColumnType("int") + .HasComment("7a. Structural Imaging (i.e., MRI or CT) - Was structural imaging data or information used to support an etiological diagnosis?"); + + b.Property("STRUCTFTLD") + .HasColumnType("int") + .HasComment("7a2. Atrophy pattern consistent with FTLD"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("nvarchar(20)") + .HasColumnOrder(2); + + b.Property("TAUPET") + .HasColumnType("int") + .HasComment("6a2. Elevated tau pathology"); + + b.Property("TRACERAD") + .HasColumnType("int") + .HasComment("6d1. Other tracer-based imaging - Consistent with AD"); + + b.Property("TRACERFTLD") + .HasColumnType("int") + .HasComment("6d2. Other tracer-based imaging - Consistent with FTLD"); + + b.Property("TRACERLBD") + .HasColumnType("int") + .HasComment("6d3. Other tracer-based imaging - Consistent with LBD"); + + b.Property("TRACEROTH") + .HasColumnType("int") + .HasComment("6d4. Other tracer-based imaging - Consistent with other etiology"); + + b.Property("TRACEROTHX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasComment("6d4a. Other tracer-based imaging - Consistent with other etiology (specify)"); + + b.Property("TRACOTHDX") + .HasColumnType("int") + .HasComment("6d. Other tracer-based imaging - Were other tracer-based imaging used to support an etiological diagnosis?"); + + b.Property("TRACOTHDXX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasComment("6d1a. Other tracer-based imaging - Were other tracer-based imaging used to support an etiological diagnosis? (specify)"); + + b.Property("VisitId") + .HasColumnType("int") + .HasColumnOrder(1); + + b.HasKey("Id"); + + b.HasIndex("VisitId") + .IsUnique(); + + b.ToTable("tbl_D1bs"); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.DrugCodeLookup", b => + { + b.Property("RxNormId") + .HasColumnType("int"); + + b.Property("BrandNames") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("DrugName") + .IsRequired() + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("IsOverTheCounter") + .HasColumnType("bit"); + + b.Property("IsPopular") + .HasColumnType("bit"); + + b.HasKey("RxNormId"); + + b.ToTable("DrugCodesLookup"); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.FormStatus", b => + { + b.Property("VisitId") + .HasColumnType("int") + .HasColumnOrder(1); + + b.Property("Kind") + .HasMaxLength(3) + .HasColumnType("nvarchar(3)"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DeletedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("FRMDATE") + .HasColumnType("datetime2") + .HasColumnName("FRMDATE") + .HasColumnOrder(3); + + b.Property("INITIALS") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("nvarchar(3)") + .HasColumnName("INITIALS") + .HasColumnOrder(4); + + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("FormId") + .HasColumnOrder(0); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LANG") + .HasColumnType("int") + .HasColumnName("LANG") + .HasColumnOrder(5); + + b.Property("MODE") + .HasColumnType("int") + .HasColumnName("MODE") + .HasColumnOrder(6); + + b.Property("ModifiedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("NOT") + .HasColumnType("int") + .HasColumnName("NOT") + .HasColumnOrder(9); + + b.Property("RMMODE") + .HasColumnType("int") + .HasColumnName("RMMODE") + .HasColumnOrder(8); + + b.Property("RMREAS") + .HasColumnType("int") + .HasColumnName("RMREASON") + .HasColumnOrder(7); + + b.Property("Status") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("nvarchar(20)") + .HasColumnOrder(2); + + b.HasKey("VisitId", "Kind"); + + b.ToTable((string)null); + + b.ToView("vw_FormStatuses", (string)null); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.M1", b => + { + b.Property("FormId") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("FormId")); + + b.Property("ACONSENT") + .HasColumnType("int"); + + b.Property("AUTOPSY") + .HasColumnType("int"); + + b.Property("CHANGEDY") + .HasColumnType("int"); + + b.Property("CHANGEMO") + .HasColumnType("int"); + + b.Property("CHANGEYR") + .HasColumnType("int"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DEATHDY") + .HasColumnType("int"); + + b.Property("DEATHMO") + .HasColumnType("int"); + + b.Property("DEATHYR") + .HasColumnType("int"); + + b.Property("DECEASED") + .HasColumnType("int"); + + b.Property("DISCDAY") + .HasColumnType("int"); + + b.Property("DISCMO") + .HasColumnType("int"); + + b.Property("DISCONT") + .HasColumnType("int"); + + b.Property("DISCYR") + .HasColumnType("int"); + + b.Property("DROPREAS") + .HasColumnType("int"); + + b.Property("DeletedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("FTLDDISC") + .HasColumnType("int"); + + b.Property("FTLDREAS") + .HasColumnType("int"); + + b.Property("FTLDREAX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("MILESTONETYPE") + .HasColumnType("int"); + + b.Property("ModifiedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("NURSEDY") + .HasColumnType("int"); + + b.Property("NURSEMO") + .HasColumnType("int"); + + b.Property("NURSEYR") + .HasColumnType("int"); + + b.Property("PROTOCOL") + .HasColumnType("int"); + + b.Property("ParticipationId") + .HasColumnType("int"); + + b.Property("RECOGIM") + .HasColumnType("int"); + + b.Property("REJOIN") + .HasColumnType("int"); + + b.Property("RENAVAIL") + .HasColumnType("int"); + + b.Property("RENURSE") + .HasColumnType("int"); + + b.Property("REPHYILL") + .HasColumnType("int"); + + b.Property("REREFUSE") + .HasColumnType("int"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b.HasKey("FormId"); + + b.HasIndex("ParticipationId"); + + b.ToTable("tbl_M1s"); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.PacketSubmission", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("PacketSubmissionId") + .HasColumnOrder(0); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DeletedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("ModifiedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("SubmissionDate") + .HasColumnType("datetime2"); + + b.Property("VisitId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("VisitId"); + + b.ToTable("PacketSubmissions"); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.PacketSubmissionError", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("PacketSubmissionErrorId") + .HasColumnOrder(0); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("AssignedTo") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DeletedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("FormKind") + .IsRequired() + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("Message") + .IsRequired() + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("ModifiedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("PacketSubmissionId") + .HasColumnType("int"); + + b.Property("ResolvedBy") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("PacketSubmissionId"); + + b.ToTable("PacketSubmissionErrors"); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.Participation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("ParticipationId"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DeletedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LegacyId") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("ModifiedBy") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("Participation"); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.T1", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("FormId") + .HasColumnOrder(0); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DeletedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("FRMDATE") + .HasColumnType("datetime2") + .HasColumnName("FRMDATE") + .HasColumnOrder(3); + + b.Property("INITIALS") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("nvarchar(3)") + .HasColumnName("INITIALS") + .HasColumnOrder(4); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LANG") + .HasColumnType("int") + .HasColumnName("LANG") + .HasColumnOrder(5); + + b.Property("MODE") + .HasColumnType("int") + .HasColumnName("MODE") + .HasColumnOrder(6); + + b.Property("ModifiedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("NOT") + .HasColumnType("int") + .HasColumnName("NOT") + .HasColumnOrder(9); + + b.Property("RMMODE") + .HasColumnType("int") + .HasColumnName("RMMODE") + .HasColumnOrder(8); + + b.Property("RMREAS") + .HasColumnType("int") + .HasColumnName("RMREASON") + .HasColumnOrder(7); + + b.Property("Status") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("nvarchar(20)") + .HasColumnOrder(2); + + b.Property("TELCOG") + .HasColumnType("int"); + + b.Property("TELCOV") + .HasColumnType("int"); + + b.Property("TELHOME") + .HasColumnType("int"); + + b.Property("TELILL") + .HasColumnType("int"); + + b.Property("TELINPER") + .HasColumnType("int"); + + b.Property("TELMILE") + .HasColumnType("int"); + + b.Property("TELMOD") + .HasColumnType("int"); + + b.Property("TELOTHR") + .HasColumnType("int"); + + b.Property("TELOTHRX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("TELREFU") + .HasColumnType("int"); + + b.Property("VisitId") + .HasColumnType("int") + .HasColumnOrder(1); + + b.HasKey("Id"); + + b.HasIndex("VisitId") + .IsUnique(); + + b.ToTable("tbl_T1s"); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.Visit", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("VisitId"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DSSDUB") + .HasColumnType("int"); + + b.Property("DeletedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("FORMVER") + .IsRequired() + .HasMaxLength(1) + .HasColumnType("nvarchar(1)") + .HasColumnName("FORMVER"); + + b.Property("INITIALS") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("nvarchar(3)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("ModifiedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("PACKET") + .IsRequired() + .HasMaxLength(1) + .HasColumnType("nvarchar(1)") + .HasColumnName("PACKET"); + + b.Property("ParticipationId") + .HasColumnType("int"); + + b.Property("Status") + .HasColumnType("int"); + + b.Property("VISITNUM") + .HasColumnType("int") + .HasColumnName("VISITNUM"); + + b.Property("VISIT_DATE") + .HasColumnType("datetime2"); + + b.HasKey("Id"); + + b.HasIndex("ParticipationId", "VISITNUM") + .IsUnique(); + + b.ToTable("tbl_Visits"); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.A1", b => + { + b.HasOne("UDS.Net.API.Entities.Visit", null) + .WithOne("A1") + .HasForeignKey("UDS.Net.API.Entities.A1", "VisitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.A1a", b => + { + b.HasOne("UDS.Net.API.Entities.Visit", null) + .WithOne("A1a") + .HasForeignKey("UDS.Net.API.Entities.A1a", "VisitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.A2", b => + { + b.HasOne("UDS.Net.API.Entities.Visit", null) + .WithOne("A2") + .HasForeignKey("UDS.Net.API.Entities.A2", "VisitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.A3", b => + { + b.HasOne("UDS.Net.API.Entities.Visit", null) + .WithOne("A3") + .HasForeignKey("UDS.Net.API.Entities.A3", "VisitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "KID1", b1 => + { + b1.Property("A3Id") + .HasColumnType("int"); + + b1.Property("AGD") + .HasColumnType("int"); + + b1.Property("AGO") + .HasColumnType("int"); + + b1.Property("ETPR") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("ETSEC") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("MEVAL") + .HasColumnType("int"); + + b1.Property("YOB") + .HasColumnType("int"); + + b1.HasKey("A3Id"); + + b1.ToTable("tbl_A3s"); + + b1.WithOwner() + .HasForeignKey("A3Id"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "KID10", b1 => + { + b1.Property("A3Id") + .HasColumnType("int"); + + b1.Property("AGD") + .HasColumnType("int"); + + b1.Property("AGO") + .HasColumnType("int"); + + b1.Property("ETPR") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("ETSEC") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("MEVAL") + .HasColumnType("int"); + + b1.Property("YOB") + .HasColumnType("int"); + + b1.HasKey("A3Id"); + + b1.ToTable("tbl_A3s"); + + b1.WithOwner() + .HasForeignKey("A3Id"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "KID11", b1 => + { + b1.Property("A3Id") + .HasColumnType("int"); + + b1.Property("AGD") + .HasColumnType("int"); + + b1.Property("AGO") + .HasColumnType("int"); + + b1.Property("ETPR") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("ETSEC") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("MEVAL") + .HasColumnType("int"); + + b1.Property("YOB") + .HasColumnType("int"); + + b1.HasKey("A3Id"); + + b1.ToTable("tbl_A3s"); + + b1.WithOwner() + .HasForeignKey("A3Id"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "KID12", b1 => + { + b1.Property("A3Id") + .HasColumnType("int"); + + b1.Property("AGD") + .HasColumnType("int"); + + b1.Property("AGO") + .HasColumnType("int"); + + b1.Property("ETPR") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("ETSEC") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("MEVAL") + .HasColumnType("int"); + + b1.Property("YOB") + .HasColumnType("int"); + + b1.HasKey("A3Id"); + + b1.ToTable("tbl_A3s"); + + b1.WithOwner() + .HasForeignKey("A3Id"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "KID13", b1 => + { + b1.Property("A3Id") + .HasColumnType("int"); + + b1.Property("AGD") + .HasColumnType("int"); + + b1.Property("AGO") + .HasColumnType("int"); + + b1.Property("ETPR") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("ETSEC") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("MEVAL") + .HasColumnType("int"); + + b1.Property("YOB") + .HasColumnType("int"); + + b1.HasKey("A3Id"); + + b1.ToTable("tbl_A3s"); + + b1.WithOwner() + .HasForeignKey("A3Id"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "KID14", b1 => + { + b1.Property("A3Id") + .HasColumnType("int"); + + b1.Property("AGD") + .HasColumnType("int"); + + b1.Property("AGO") + .HasColumnType("int"); + + b1.Property("ETPR") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("ETSEC") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("MEVAL") + .HasColumnType("int"); + + b1.Property("YOB") + .HasColumnType("int"); + + b1.HasKey("A3Id"); + + b1.ToTable("tbl_A3s"); + + b1.WithOwner() + .HasForeignKey("A3Id"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "KID15", b1 => + { + b1.Property("A3Id") + .HasColumnType("int"); + + b1.Property("AGD") + .HasColumnType("int"); + + b1.Property("AGO") + .HasColumnType("int"); + + b1.Property("ETPR") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("ETSEC") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("MEVAL") + .HasColumnType("int"); + + b1.Property("YOB") + .HasColumnType("int"); + + b1.HasKey("A3Id"); + + b1.ToTable("tbl_A3s"); + + b1.WithOwner() + .HasForeignKey("A3Id"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "KID2", b1 => + { + b1.Property("A3Id") + .HasColumnType("int"); + + b1.Property("AGD") + .HasColumnType("int"); + + b1.Property("AGO") + .HasColumnType("int"); + + b1.Property("ETPR") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("ETSEC") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("MEVAL") + .HasColumnType("int"); + + b1.Property("YOB") + .HasColumnType("int"); + + b1.HasKey("A3Id"); + + b1.ToTable("tbl_A3s"); + + b1.WithOwner() + .HasForeignKey("A3Id"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "KID3", b1 => + { + b1.Property("A3Id") + .HasColumnType("int"); + + b1.Property("AGD") + .HasColumnType("int"); + + b1.Property("AGO") + .HasColumnType("int"); + + b1.Property("ETPR") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("ETSEC") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("MEVAL") + .HasColumnType("int"); + + b1.Property("YOB") + .HasColumnType("int"); + + b1.HasKey("A3Id"); + + b1.ToTable("tbl_A3s"); + + b1.WithOwner() + .HasForeignKey("A3Id"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "KID4", b1 => + { + b1.Property("A3Id") + .HasColumnType("int"); + + b1.Property("AGD") + .HasColumnType("int"); + + b1.Property("AGO") + .HasColumnType("int"); + + b1.Property("ETPR") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("ETSEC") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("MEVAL") + .HasColumnType("int"); + + b1.Property("YOB") + .HasColumnType("int"); + + b1.HasKey("A3Id"); + + b1.ToTable("tbl_A3s"); + + b1.WithOwner() + .HasForeignKey("A3Id"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "KID5", b1 => + { + b1.Property("A3Id") + .HasColumnType("int"); + + b1.Property("AGD") + .HasColumnType("int"); + + b1.Property("AGO") + .HasColumnType("int"); + + b1.Property("ETPR") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("ETSEC") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("MEVAL") + .HasColumnType("int"); + + b1.Property("YOB") + .HasColumnType("int"); + + b1.HasKey("A3Id"); + + b1.ToTable("tbl_A3s"); + + b1.WithOwner() + .HasForeignKey("A3Id"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "KID6", b1 => + { + b1.Property("A3Id") + .HasColumnType("int"); + + b1.Property("AGD") + .HasColumnType("int"); + + b1.Property("AGO") + .HasColumnType("int"); + + b1.Property("ETPR") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("ETSEC") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("MEVAL") + .HasColumnType("int"); + + b1.Property("YOB") + .HasColumnType("int"); + + b1.HasKey("A3Id"); + + b1.ToTable("tbl_A3s"); + + b1.WithOwner() + .HasForeignKey("A3Id"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "KID7", b1 => + { + b1.Property("A3Id") + .HasColumnType("int"); + + b1.Property("AGD") + .HasColumnType("int"); + + b1.Property("AGO") + .HasColumnType("int"); + + b1.Property("ETPR") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("ETSEC") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("MEVAL") + .HasColumnType("int"); + + b1.Property("YOB") + .HasColumnType("int"); + + b1.HasKey("A3Id"); + + b1.ToTable("tbl_A3s"); + + b1.WithOwner() + .HasForeignKey("A3Id"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "KID8", b1 => + { + b1.Property("A3Id") + .HasColumnType("int"); + + b1.Property("AGD") + .HasColumnType("int"); + + b1.Property("AGO") + .HasColumnType("int"); + + b1.Property("ETPR") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("ETSEC") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("MEVAL") + .HasColumnType("int"); + + b1.Property("YOB") + .HasColumnType("int"); + + b1.HasKey("A3Id"); + + b1.ToTable("tbl_A3s"); + + b1.WithOwner() + .HasForeignKey("A3Id"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "KID9", b1 => + { + b1.Property("A3Id") + .HasColumnType("int"); + + b1.Property("AGD") + .HasColumnType("int"); + + b1.Property("AGO") + .HasColumnType("int"); + + b1.Property("ETPR") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("ETSEC") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("MEVAL") + .HasColumnType("int"); + + b1.Property("YOB") + .HasColumnType("int"); + + b1.HasKey("A3Id"); + + b1.ToTable("tbl_A3s"); + + b1.WithOwner() + .HasForeignKey("A3Id"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB1", b1 => + { + b1.Property("A3Id") + .HasColumnType("int"); + + b1.Property("AGD") + .HasColumnType("int"); + + b1.Property("AGO") + .HasColumnType("int"); + + b1.Property("ETPR") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("ETSEC") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("MEVAL") + .HasColumnType("int"); + + b1.Property("YOB") + .HasColumnType("int"); + + b1.HasKey("A3Id"); + + b1.ToTable("tbl_A3s"); + + b1.WithOwner() + .HasForeignKey("A3Id"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB10", b1 => + { + b1.Property("A3Id") + .HasColumnType("int"); + + b1.Property("AGD") + .HasColumnType("int"); + + b1.Property("AGO") + .HasColumnType("int"); + + b1.Property("ETPR") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("ETSEC") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("MEVAL") + .HasColumnType("int"); + + b1.Property("YOB") + .HasColumnType("int"); + + b1.HasKey("A3Id"); + + b1.ToTable("tbl_A3s"); + + b1.WithOwner() + .HasForeignKey("A3Id"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB11", b1 => + { + b1.Property("A3Id") + .HasColumnType("int"); + + b1.Property("AGD") + .HasColumnType("int"); + + b1.Property("AGO") + .HasColumnType("int"); + + b1.Property("ETPR") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("ETSEC") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("MEVAL") + .HasColumnType("int"); + + b1.Property("YOB") + .HasColumnType("int"); + + b1.HasKey("A3Id"); + + b1.ToTable("tbl_A3s"); + + b1.WithOwner() + .HasForeignKey("A3Id"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB12", b1 => + { + b1.Property("A3Id") + .HasColumnType("int"); + + b1.Property("AGD") + .HasColumnType("int"); + + b1.Property("AGO") + .HasColumnType("int"); + + b1.Property("ETPR") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("ETSEC") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("MEVAL") + .HasColumnType("int"); + + b1.Property("YOB") + .HasColumnType("int"); + + b1.HasKey("A3Id"); + + b1.ToTable("tbl_A3s"); + + b1.WithOwner() + .HasForeignKey("A3Id"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB13", b1 => + { + b1.Property("A3Id") + .HasColumnType("int"); + + b1.Property("AGD") + .HasColumnType("int"); + + b1.Property("AGO") + .HasColumnType("int"); + + b1.Property("ETPR") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("ETSEC") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("MEVAL") + .HasColumnType("int"); + + b1.Property("YOB") + .HasColumnType("int"); + + b1.HasKey("A3Id"); + + b1.ToTable("tbl_A3s"); + + b1.WithOwner() + .HasForeignKey("A3Id"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB14", b1 => + { + b1.Property("A3Id") + .HasColumnType("int"); + + b1.Property("AGD") + .HasColumnType("int"); + + b1.Property("AGO") + .HasColumnType("int"); + + b1.Property("ETPR") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("ETSEC") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("MEVAL") + .HasColumnType("int"); + + b1.Property("YOB") + .HasColumnType("int"); + + b1.HasKey("A3Id"); + + b1.ToTable("tbl_A3s"); + + b1.WithOwner() + .HasForeignKey("A3Id"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB15", b1 => + { + b1.Property("A3Id") + .HasColumnType("int"); + + b1.Property("AGD") + .HasColumnType("int"); + + b1.Property("AGO") + .HasColumnType("int"); + + b1.Property("ETPR") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("ETSEC") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("MEVAL") + .HasColumnType("int"); + + b1.Property("YOB") + .HasColumnType("int"); + + b1.HasKey("A3Id"); + + b1.ToTable("tbl_A3s"); + + b1.WithOwner() + .HasForeignKey("A3Id"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB16", b1 => + { + b1.Property("A3Id") + .HasColumnType("int"); + + b1.Property("AGD") + .HasColumnType("int"); + + b1.Property("AGO") + .HasColumnType("int"); + + b1.Property("ETPR") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("ETSEC") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("MEVAL") + .HasColumnType("int"); + + b1.Property("YOB") + .HasColumnType("int"); + + b1.HasKey("A3Id"); + + b1.ToTable("tbl_A3s"); + + b1.WithOwner() + .HasForeignKey("A3Id"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB17", b1 => + { + b1.Property("A3Id") + .HasColumnType("int"); + + b1.Property("AGD") + .HasColumnType("int"); + + b1.Property("AGO") + .HasColumnType("int"); + + b1.Property("ETPR") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("ETSEC") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("MEVAL") + .HasColumnType("int"); + + b1.Property("YOB") + .HasColumnType("int"); + + b1.HasKey("A3Id"); + + b1.ToTable("tbl_A3s"); + + b1.WithOwner() + .HasForeignKey("A3Id"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB18", b1 => + { + b1.Property("A3Id") + .HasColumnType("int"); + + b1.Property("AGD") + .HasColumnType("int"); + + b1.Property("AGO") + .HasColumnType("int"); + + b1.Property("ETPR") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("ETSEC") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("MEVAL") + .HasColumnType("int"); + + b1.Property("YOB") + .HasColumnType("int"); + + b1.HasKey("A3Id"); + + b1.ToTable("tbl_A3s"); + + b1.WithOwner() + .HasForeignKey("A3Id"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB19", b1 => + { + b1.Property("A3Id") + .HasColumnType("int"); + + b1.Property("AGD") + .HasColumnType("int"); + + b1.Property("AGO") + .HasColumnType("int"); + + b1.Property("ETPR") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("ETSEC") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("MEVAL") + .HasColumnType("int"); + + b1.Property("YOB") + .HasColumnType("int"); + + b1.HasKey("A3Id"); + + b1.ToTable("tbl_A3s"); + + b1.WithOwner() + .HasForeignKey("A3Id"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB2", b1 => + { + b1.Property("A3Id") + .HasColumnType("int"); + + b1.Property("AGD") + .HasColumnType("int"); + + b1.Property("AGO") + .HasColumnType("int"); + + b1.Property("ETPR") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("ETSEC") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("MEVAL") + .HasColumnType("int"); + + b1.Property("YOB") + .HasColumnType("int"); + + b1.HasKey("A3Id"); + + b1.ToTable("tbl_A3s"); + + b1.WithOwner() + .HasForeignKey("A3Id"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB20", b1 => + { + b1.Property("A3Id") + .HasColumnType("int"); + + b1.Property("AGD") + .HasColumnType("int"); + + b1.Property("AGO") + .HasColumnType("int"); + + b1.Property("ETPR") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("ETSEC") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("MEVAL") + .HasColumnType("int"); + + b1.Property("YOB") + .HasColumnType("int"); + + b1.HasKey("A3Id"); + + b1.ToTable("tbl_A3s"); + + b1.WithOwner() + .HasForeignKey("A3Id"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB3", b1 => + { + b1.Property("A3Id") + .HasColumnType("int"); + + b1.Property("AGD") + .HasColumnType("int"); + + b1.Property("AGO") + .HasColumnType("int"); + + b1.Property("ETPR") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("ETSEC") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("MEVAL") + .HasColumnType("int"); + + b1.Property("YOB") + .HasColumnType("int"); + + b1.HasKey("A3Id"); + + b1.ToTable("tbl_A3s"); + + b1.WithOwner() + .HasForeignKey("A3Id"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB4", b1 => + { + b1.Property("A3Id") + .HasColumnType("int"); + + b1.Property("AGD") + .HasColumnType("int"); + + b1.Property("AGO") + .HasColumnType("int"); + + b1.Property("ETPR") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("ETSEC") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("MEVAL") + .HasColumnType("int"); + + b1.Property("YOB") + .HasColumnType("int"); + + b1.HasKey("A3Id"); + + b1.ToTable("tbl_A3s"); + + b1.WithOwner() + .HasForeignKey("A3Id"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB5", b1 => + { + b1.Property("A3Id") + .HasColumnType("int"); + + b1.Property("AGD") + .HasColumnType("int"); + + b1.Property("AGO") + .HasColumnType("int"); + + b1.Property("ETPR") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("ETSEC") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("MEVAL") + .HasColumnType("int"); + + b1.Property("YOB") + .HasColumnType("int"); + + b1.HasKey("A3Id"); + + b1.ToTable("tbl_A3s"); + + b1.WithOwner() + .HasForeignKey("A3Id"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB6", b1 => + { + b1.Property("A3Id") + .HasColumnType("int"); + + b1.Property("AGD") + .HasColumnType("int"); + + b1.Property("AGO") + .HasColumnType("int"); + + b1.Property("ETPR") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("ETSEC") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("MEVAL") + .HasColumnType("int"); + + b1.Property("YOB") + .HasColumnType("int"); + + b1.HasKey("A3Id"); + + b1.ToTable("tbl_A3s"); + + b1.WithOwner() + .HasForeignKey("A3Id"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB7", b1 => + { + b1.Property("A3Id") + .HasColumnType("int"); + + b1.Property("AGD") + .HasColumnType("int"); + + b1.Property("AGO") + .HasColumnType("int"); + + b1.Property("ETPR") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("ETSEC") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("MEVAL") + .HasColumnType("int"); + + b1.Property("YOB") + .HasColumnType("int"); + + b1.HasKey("A3Id"); + + b1.ToTable("tbl_A3s"); + + b1.WithOwner() + .HasForeignKey("A3Id"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB8", b1 => + { + b1.Property("A3Id") + .HasColumnType("int"); + + b1.Property("AGD") + .HasColumnType("int"); + + b1.Property("AGO") + .HasColumnType("int"); + + b1.Property("ETPR") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("ETSEC") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("MEVAL") + .HasColumnType("int"); + + b1.Property("YOB") + .HasColumnType("int"); + + b1.HasKey("A3Id"); + + b1.ToTable("tbl_A3s"); + + b1.WithOwner() + .HasForeignKey("A3Id"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB9", b1 => + { + b1.Property("A3Id") + .HasColumnType("int"); + + b1.Property("AGD") + .HasColumnType("int"); + + b1.Property("AGO") + .HasColumnType("int"); + + b1.Property("ETPR") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("ETSEC") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("MEVAL") + .HasColumnType("int"); + + b1.Property("YOB") + .HasColumnType("int"); + + b1.HasKey("A3Id"); + + b1.ToTable("tbl_A3s"); + + b1.WithOwner() + .HasForeignKey("A3Id"); + }); + + b.Navigation("KID1") + .IsRequired(); + + b.Navigation("KID10") + .IsRequired(); + + b.Navigation("KID11") + .IsRequired(); + + b.Navigation("KID12") + .IsRequired(); + + b.Navigation("KID13") + .IsRequired(); + + b.Navigation("KID14") + .IsRequired(); + + b.Navigation("KID15") + .IsRequired(); + + b.Navigation("KID2") + .IsRequired(); + + b.Navigation("KID3") + .IsRequired(); + + b.Navigation("KID4") + .IsRequired(); + + b.Navigation("KID5") + .IsRequired(); + + b.Navigation("KID6") + .IsRequired(); + + b.Navigation("KID7") + .IsRequired(); + + b.Navigation("KID8") + .IsRequired(); + + b.Navigation("KID9") + .IsRequired(); + + b.Navigation("SIB1") + .IsRequired(); + + b.Navigation("SIB10") + .IsRequired(); + + b.Navigation("SIB11") + .IsRequired(); + + b.Navigation("SIB12") + .IsRequired(); + + b.Navigation("SIB13") + .IsRequired(); + + b.Navigation("SIB14") + .IsRequired(); + + b.Navigation("SIB15") + .IsRequired(); + + b.Navigation("SIB16") + .IsRequired(); + + b.Navigation("SIB17") + .IsRequired(); + + b.Navigation("SIB18") + .IsRequired(); + + b.Navigation("SIB19") + .IsRequired(); + + b.Navigation("SIB2") + .IsRequired(); + + b.Navigation("SIB20") + .IsRequired(); + + b.Navigation("SIB3") + .IsRequired(); + + b.Navigation("SIB4") + .IsRequired(); + + b.Navigation("SIB5") + .IsRequired(); + + b.Navigation("SIB6") + .IsRequired(); + + b.Navigation("SIB7") + .IsRequired(); + + b.Navigation("SIB8") + .IsRequired(); + + b.Navigation("SIB9") + .IsRequired(); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.A4", b => + { + b.HasOne("UDS.Net.API.Entities.Visit", null) + .WithOne("A4") + .HasForeignKey("UDS.Net.API.Entities.A4", "VisitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID1", b1 => + { + b1.Property("A4Id") + .HasColumnType("int"); + + b1.Property("RxNormId") + .HasColumnType("int"); + + b1.HasKey("A4Id"); + + b1.HasIndex("RxNormId"); + + b1.ToTable("tbl_A4s"); + + b1.WithOwner() + .HasForeignKey("A4Id"); + + b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") + .WithMany() + .HasForeignKey("RxNormId"); + + b1.Navigation("DrugCode"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID10", b1 => + { + b1.Property("A4Id") + .HasColumnType("int"); + + b1.Property("RxNormId") + .HasColumnType("int"); + + b1.HasKey("A4Id"); + + b1.HasIndex("RxNormId"); + + b1.ToTable("tbl_A4s"); + + b1.WithOwner() + .HasForeignKey("A4Id"); + + b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") + .WithMany() + .HasForeignKey("RxNormId"); + + b1.Navigation("DrugCode"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID11", b1 => + { + b1.Property("A4Id") + .HasColumnType("int"); + + b1.Property("RxNormId") + .HasColumnType("int"); + + b1.HasKey("A4Id"); + + b1.HasIndex("RxNormId"); + + b1.ToTable("tbl_A4s"); + + b1.WithOwner() + .HasForeignKey("A4Id"); + + b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") + .WithMany() + .HasForeignKey("RxNormId"); + + b1.Navigation("DrugCode"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID12", b1 => + { + b1.Property("A4Id") + .HasColumnType("int"); + + b1.Property("RxNormId") + .HasColumnType("int"); + + b1.HasKey("A4Id"); + + b1.HasIndex("RxNormId"); + + b1.ToTable("tbl_A4s"); + + b1.WithOwner() + .HasForeignKey("A4Id"); + + b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") + .WithMany() + .HasForeignKey("RxNormId"); + + b1.Navigation("DrugCode"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID13", b1 => + { + b1.Property("A4Id") + .HasColumnType("int"); + + b1.Property("RxNormId") + .HasColumnType("int"); + + b1.HasKey("A4Id"); + + b1.HasIndex("RxNormId"); + + b1.ToTable("tbl_A4s"); + + b1.WithOwner() + .HasForeignKey("A4Id"); + + b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") + .WithMany() + .HasForeignKey("RxNormId"); + + b1.Navigation("DrugCode"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID14", b1 => + { + b1.Property("A4Id") + .HasColumnType("int"); + + b1.Property("RxNormId") + .HasColumnType("int"); + + b1.HasKey("A4Id"); + + b1.HasIndex("RxNormId"); + + b1.ToTable("tbl_A4s"); + + b1.WithOwner() + .HasForeignKey("A4Id"); + + b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") + .WithMany() + .HasForeignKey("RxNormId"); + + b1.Navigation("DrugCode"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID15", b1 => + { + b1.Property("A4Id") + .HasColumnType("int"); + + b1.Property("RxNormId") + .HasColumnType("int"); + + b1.HasKey("A4Id"); + + b1.HasIndex("RxNormId"); + + b1.ToTable("tbl_A4s"); + + b1.WithOwner() + .HasForeignKey("A4Id"); + + b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") + .WithMany() + .HasForeignKey("RxNormId"); + + b1.Navigation("DrugCode"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID16", b1 => + { + b1.Property("A4Id") + .HasColumnType("int"); + + b1.Property("RxNormId") + .HasColumnType("int"); + + b1.HasKey("A4Id"); + + b1.HasIndex("RxNormId"); + + b1.ToTable("tbl_A4s"); + + b1.WithOwner() + .HasForeignKey("A4Id"); + + b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") + .WithMany() + .HasForeignKey("RxNormId"); + + b1.Navigation("DrugCode"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID17", b1 => + { + b1.Property("A4Id") + .HasColumnType("int"); + + b1.Property("RxNormId") + .HasColumnType("int"); + + b1.HasKey("A4Id"); + + b1.HasIndex("RxNormId"); + + b1.ToTable("tbl_A4s"); + + b1.WithOwner() + .HasForeignKey("A4Id"); + + b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") + .WithMany() + .HasForeignKey("RxNormId"); + + b1.Navigation("DrugCode"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID18", b1 => + { + b1.Property("A4Id") + .HasColumnType("int"); + + b1.Property("RxNormId") + .HasColumnType("int"); + + b1.HasKey("A4Id"); + + b1.HasIndex("RxNormId"); + + b1.ToTable("tbl_A4s"); + + b1.WithOwner() + .HasForeignKey("A4Id"); + + b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") + .WithMany() + .HasForeignKey("RxNormId"); + + b1.Navigation("DrugCode"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID19", b1 => + { + b1.Property("A4Id") + .HasColumnType("int"); + + b1.Property("RxNormId") + .HasColumnType("int"); + + b1.HasKey("A4Id"); + + b1.HasIndex("RxNormId"); + + b1.ToTable("tbl_A4s"); + + b1.WithOwner() + .HasForeignKey("A4Id"); + + b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") + .WithMany() + .HasForeignKey("RxNormId"); + + b1.Navigation("DrugCode"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID2", b1 => + { + b1.Property("A4Id") + .HasColumnType("int"); + + b1.Property("RxNormId") + .HasColumnType("int"); + + b1.HasKey("A4Id"); + + b1.HasIndex("RxNormId"); + + b1.ToTable("tbl_A4s"); + + b1.WithOwner() + .HasForeignKey("A4Id"); + + b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") + .WithMany() + .HasForeignKey("RxNormId"); + + b1.Navigation("DrugCode"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID20", b1 => + { + b1.Property("A4Id") + .HasColumnType("int"); + + b1.Property("RxNormId") + .HasColumnType("int"); + + b1.HasKey("A4Id"); + + b1.HasIndex("RxNormId"); + + b1.ToTable("tbl_A4s"); + + b1.WithOwner() + .HasForeignKey("A4Id"); + + b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") + .WithMany() + .HasForeignKey("RxNormId"); + + b1.Navigation("DrugCode"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID21", b1 => + { + b1.Property("A4Id") + .HasColumnType("int"); + + b1.Property("RxNormId") + .HasColumnType("int"); + + b1.HasKey("A4Id"); + + b1.HasIndex("RxNormId"); + + b1.ToTable("tbl_A4s"); + + b1.WithOwner() + .HasForeignKey("A4Id"); + + b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") + .WithMany() + .HasForeignKey("RxNormId"); + + b1.Navigation("DrugCode"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID22", b1 => + { + b1.Property("A4Id") + .HasColumnType("int"); + + b1.Property("RxNormId") + .HasColumnType("int"); + + b1.HasKey("A4Id"); + + b1.HasIndex("RxNormId"); + + b1.ToTable("tbl_A4s"); + + b1.WithOwner() + .HasForeignKey("A4Id"); + + b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") + .WithMany() + .HasForeignKey("RxNormId"); + + b1.Navigation("DrugCode"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID23", b1 => + { + b1.Property("A4Id") + .HasColumnType("int"); + + b1.Property("RxNormId") + .HasColumnType("int"); + + b1.HasKey("A4Id"); + + b1.HasIndex("RxNormId"); + + b1.ToTable("tbl_A4s"); + + b1.WithOwner() + .HasForeignKey("A4Id"); + + b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") + .WithMany() + .HasForeignKey("RxNormId"); + + b1.Navigation("DrugCode"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID24", b1 => + { + b1.Property("A4Id") + .HasColumnType("int"); + + b1.Property("RxNormId") + .HasColumnType("int"); + + b1.HasKey("A4Id"); + + b1.HasIndex("RxNormId"); + + b1.ToTable("tbl_A4s"); + + b1.WithOwner() + .HasForeignKey("A4Id"); + + b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") + .WithMany() + .HasForeignKey("RxNormId"); + + b1.Navigation("DrugCode"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID25", b1 => + { + b1.Property("A4Id") + .HasColumnType("int"); + + b1.Property("RxNormId") + .HasColumnType("int"); + + b1.HasKey("A4Id"); + + b1.HasIndex("RxNormId"); + + b1.ToTable("tbl_A4s"); + + b1.WithOwner() + .HasForeignKey("A4Id"); + + b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") + .WithMany() + .HasForeignKey("RxNormId"); + + b1.Navigation("DrugCode"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID26", b1 => + { + b1.Property("A4Id") + .HasColumnType("int"); + + b1.Property("RxNormId") + .HasColumnType("int"); + + b1.HasKey("A4Id"); + + b1.HasIndex("RxNormId"); + + b1.ToTable("tbl_A4s"); + + b1.WithOwner() + .HasForeignKey("A4Id"); + + b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") + .WithMany() + .HasForeignKey("RxNormId"); + + b1.Navigation("DrugCode"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID27", b1 => + { + b1.Property("A4Id") + .HasColumnType("int"); + + b1.Property("RxNormId") + .HasColumnType("int"); + + b1.HasKey("A4Id"); + + b1.HasIndex("RxNormId"); + + b1.ToTable("tbl_A4s"); + + b1.WithOwner() + .HasForeignKey("A4Id"); + + b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") + .WithMany() + .HasForeignKey("RxNormId"); + + b1.Navigation("DrugCode"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID28", b1 => + { + b1.Property("A4Id") + .HasColumnType("int"); + + b1.Property("RxNormId") + .HasColumnType("int"); + + b1.HasKey("A4Id"); + + b1.HasIndex("RxNormId"); + + b1.ToTable("tbl_A4s"); + + b1.WithOwner() + .HasForeignKey("A4Id"); + + b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") + .WithMany() + .HasForeignKey("RxNormId"); + + b1.Navigation("DrugCode"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID29", b1 => + { + b1.Property("A4Id") + .HasColumnType("int"); + + b1.Property("RxNormId") + .HasColumnType("int"); + + b1.HasKey("A4Id"); + + b1.HasIndex("RxNormId"); + + b1.ToTable("tbl_A4s"); + + b1.WithOwner() + .HasForeignKey("A4Id"); + + b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") + .WithMany() + .HasForeignKey("RxNormId"); + + b1.Navigation("DrugCode"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID3", b1 => + { + b1.Property("A4Id") + .HasColumnType("int"); + + b1.Property("RxNormId") + .HasColumnType("int"); + + b1.HasKey("A4Id"); + + b1.HasIndex("RxNormId"); + + b1.ToTable("tbl_A4s"); + + b1.WithOwner() + .HasForeignKey("A4Id"); + + b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") + .WithMany() + .HasForeignKey("RxNormId"); + + b1.Navigation("DrugCode"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID30", b1 => + { + b1.Property("A4Id") + .HasColumnType("int"); + + b1.Property("RxNormId") + .HasColumnType("int"); + + b1.HasKey("A4Id"); + + b1.HasIndex("RxNormId"); + + b1.ToTable("tbl_A4s"); + + b1.WithOwner() + .HasForeignKey("A4Id"); + + b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") + .WithMany() + .HasForeignKey("RxNormId"); + + b1.Navigation("DrugCode"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID31", b1 => + { + b1.Property("A4Id") + .HasColumnType("int"); + + b1.Property("RxNormId") + .HasColumnType("int"); + + b1.HasKey("A4Id"); + + b1.HasIndex("RxNormId"); + + b1.ToTable("tbl_A4s"); + + b1.WithOwner() + .HasForeignKey("A4Id"); + + b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") + .WithMany() + .HasForeignKey("RxNormId"); + + b1.Navigation("DrugCode"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID32", b1 => + { + b1.Property("A4Id") + .HasColumnType("int"); + + b1.Property("RxNormId") + .HasColumnType("int"); + + b1.HasKey("A4Id"); + + b1.HasIndex("RxNormId"); + + b1.ToTable("tbl_A4s"); + + b1.WithOwner() + .HasForeignKey("A4Id"); + + b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") + .WithMany() + .HasForeignKey("RxNormId"); + + b1.Navigation("DrugCode"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID33", b1 => + { + b1.Property("A4Id") + .HasColumnType("int"); + + b1.Property("RxNormId") + .HasColumnType("int"); + + b1.HasKey("A4Id"); + + b1.HasIndex("RxNormId"); + + b1.ToTable("tbl_A4s"); + + b1.WithOwner() + .HasForeignKey("A4Id"); + + b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") + .WithMany() + .HasForeignKey("RxNormId"); + + b1.Navigation("DrugCode"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID34", b1 => + { + b1.Property("A4Id") + .HasColumnType("int"); + + b1.Property("RxNormId") + .HasColumnType("int"); + + b1.HasKey("A4Id"); + + b1.HasIndex("RxNormId"); + + b1.ToTable("tbl_A4s"); + + b1.WithOwner() + .HasForeignKey("A4Id"); + + b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") + .WithMany() + .HasForeignKey("RxNormId"); + + b1.Navigation("DrugCode"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID35", b1 => + { + b1.Property("A4Id") + .HasColumnType("int"); + + b1.Property("RxNormId") + .HasColumnType("int"); + + b1.HasKey("A4Id"); + + b1.HasIndex("RxNormId"); + + b1.ToTable("tbl_A4s"); + + b1.WithOwner() + .HasForeignKey("A4Id"); + + b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") + .WithMany() + .HasForeignKey("RxNormId"); + + b1.Navigation("DrugCode"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID36", b1 => + { + b1.Property("A4Id") + .HasColumnType("int"); + + b1.Property("RxNormId") + .HasColumnType("int"); + + b1.HasKey("A4Id"); + + b1.HasIndex("RxNormId"); + + b1.ToTable("tbl_A4s"); + + b1.WithOwner() + .HasForeignKey("A4Id"); + + b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") + .WithMany() + .HasForeignKey("RxNormId"); + + b1.Navigation("DrugCode"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID37", b1 => + { + b1.Property("A4Id") + .HasColumnType("int"); + + b1.Property("RxNormId") + .HasColumnType("int"); + + b1.HasKey("A4Id"); + + b1.HasIndex("RxNormId"); + + b1.ToTable("tbl_A4s"); + + b1.WithOwner() + .HasForeignKey("A4Id"); + + b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") + .WithMany() + .HasForeignKey("RxNormId"); + + b1.Navigation("DrugCode"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID38", b1 => + { + b1.Property("A4Id") + .HasColumnType("int"); + + b1.Property("RxNormId") + .HasColumnType("int"); + + b1.HasKey("A4Id"); + + b1.HasIndex("RxNormId"); + + b1.ToTable("tbl_A4s"); + + b1.WithOwner() + .HasForeignKey("A4Id"); + + b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") + .WithMany() + .HasForeignKey("RxNormId"); + + b1.Navigation("DrugCode"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID39", b1 => + { + b1.Property("A4Id") + .HasColumnType("int"); + + b1.Property("RxNormId") + .HasColumnType("int"); + + b1.HasKey("A4Id"); + + b1.HasIndex("RxNormId"); + + b1.ToTable("tbl_A4s"); + + b1.WithOwner() + .HasForeignKey("A4Id"); + + b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") + .WithMany() + .HasForeignKey("RxNormId"); + + b1.Navigation("DrugCode"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID4", b1 => + { + b1.Property("A4Id") + .HasColumnType("int"); + + b1.Property("RxNormId") + .HasColumnType("int"); + + b1.HasKey("A4Id"); + + b1.HasIndex("RxNormId"); + + b1.ToTable("tbl_A4s"); + + b1.WithOwner() + .HasForeignKey("A4Id"); + + b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") + .WithMany() + .HasForeignKey("RxNormId"); + + b1.Navigation("DrugCode"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID40", b1 => + { + b1.Property("A4Id") + .HasColumnType("int"); + + b1.Property("RxNormId") + .HasColumnType("int"); + + b1.HasKey("A4Id"); + + b1.HasIndex("RxNormId"); + + b1.ToTable("tbl_A4s"); + + b1.WithOwner() + .HasForeignKey("A4Id"); + + b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") + .WithMany() + .HasForeignKey("RxNormId"); + + b1.Navigation("DrugCode"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID5", b1 => + { + b1.Property("A4Id") + .HasColumnType("int"); + + b1.Property("RxNormId") + .HasColumnType("int"); + + b1.HasKey("A4Id"); + + b1.HasIndex("RxNormId"); + + b1.ToTable("tbl_A4s"); + + b1.WithOwner() + .HasForeignKey("A4Id"); + + b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") + .WithMany() + .HasForeignKey("RxNormId"); + + b1.Navigation("DrugCode"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID6", b1 => + { + b1.Property("A4Id") + .HasColumnType("int"); + + b1.Property("RxNormId") + .HasColumnType("int"); + + b1.HasKey("A4Id"); + + b1.HasIndex("RxNormId"); + + b1.ToTable("tbl_A4s"); + + b1.WithOwner() + .HasForeignKey("A4Id"); + + b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") + .WithMany() + .HasForeignKey("RxNormId"); + + b1.Navigation("DrugCode"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID7", b1 => + { + b1.Property("A4Id") + .HasColumnType("int"); + + b1.Property("RxNormId") + .HasColumnType("int"); + + b1.HasKey("A4Id"); + + b1.HasIndex("RxNormId"); + + b1.ToTable("tbl_A4s"); + + b1.WithOwner() + .HasForeignKey("A4Id"); + + b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") + .WithMany() + .HasForeignKey("RxNormId"); + + b1.Navigation("DrugCode"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID8", b1 => + { + b1.Property("A4Id") + .HasColumnType("int"); + + b1.Property("RxNormId") + .HasColumnType("int"); + + b1.HasKey("A4Id"); + + b1.HasIndex("RxNormId"); + + b1.ToTable("tbl_A4s"); + + b1.WithOwner() + .HasForeignKey("A4Id"); + + b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") + .WithMany() + .HasForeignKey("RxNormId"); + + b1.Navigation("DrugCode"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID9", b1 => + { + b1.Property("A4Id") + .HasColumnType("int"); + + b1.Property("RxNormId") + .HasColumnType("int"); + + b1.HasKey("A4Id"); + + b1.HasIndex("RxNormId"); + + b1.ToTable("tbl_A4s"); + + b1.WithOwner() + .HasForeignKey("A4Id"); + + b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") + .WithMany() + .HasForeignKey("RxNormId"); + + b1.Navigation("DrugCode"); + }); + + b.Navigation("RXNORMID1") + .IsRequired(); + + b.Navigation("RXNORMID10") + .IsRequired(); + + b.Navigation("RXNORMID11") + .IsRequired(); + + b.Navigation("RXNORMID12") + .IsRequired(); + + b.Navigation("RXNORMID13") + .IsRequired(); + + b.Navigation("RXNORMID14") + .IsRequired(); + + b.Navigation("RXNORMID15") + .IsRequired(); + + b.Navigation("RXNORMID16") + .IsRequired(); + + b.Navigation("RXNORMID17") + .IsRequired(); + + b.Navigation("RXNORMID18") + .IsRequired(); + + b.Navigation("RXNORMID19") + .IsRequired(); + + b.Navigation("RXNORMID2") + .IsRequired(); + + b.Navigation("RXNORMID20") + .IsRequired(); + + b.Navigation("RXNORMID21") + .IsRequired(); + + b.Navigation("RXNORMID22") + .IsRequired(); + + b.Navigation("RXNORMID23") + .IsRequired(); + + b.Navigation("RXNORMID24") + .IsRequired(); + + b.Navigation("RXNORMID25") + .IsRequired(); + + b.Navigation("RXNORMID26") + .IsRequired(); + + b.Navigation("RXNORMID27") + .IsRequired(); + + b.Navigation("RXNORMID28") + .IsRequired(); + + b.Navigation("RXNORMID29") + .IsRequired(); + + b.Navigation("RXNORMID3") + .IsRequired(); + + b.Navigation("RXNORMID30") + .IsRequired(); + + b.Navigation("RXNORMID31") + .IsRequired(); + + b.Navigation("RXNORMID32") + .IsRequired(); + + b.Navigation("RXNORMID33") + .IsRequired(); + + b.Navigation("RXNORMID34") + .IsRequired(); + + b.Navigation("RXNORMID35") + .IsRequired(); + + b.Navigation("RXNORMID36") + .IsRequired(); + + b.Navigation("RXNORMID37") + .IsRequired(); + + b.Navigation("RXNORMID38") + .IsRequired(); + + b.Navigation("RXNORMID39") + .IsRequired(); + + b.Navigation("RXNORMID4") + .IsRequired(); + + b.Navigation("RXNORMID40") + .IsRequired(); + + b.Navigation("RXNORMID5") + .IsRequired(); + + b.Navigation("RXNORMID6") + .IsRequired(); + + b.Navigation("RXNORMID7") + .IsRequired(); + + b.Navigation("RXNORMID8") + .IsRequired(); + + b.Navigation("RXNORMID9") + .IsRequired(); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.A4a", b => + { + b.HasOne("UDS.Net.API.Entities.Visit", null) + .WithOne("A4a") + .HasForeignKey("UDS.Net.API.Entities.A4a", "VisitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.OwnsOne("UDS.Net.API.Entities.A4aTreatment", "Treatment1", b1 => + { + b1.Property("A4aId") + .HasColumnType("int"); + + b1.Property("CARETRIAL") + .HasColumnType("int") + .HasColumnName("CARETRIAL1"); + + b1.Property("ENDMO") + .HasColumnType("int") + .HasColumnName("ENDMO1"); + + b1.Property("ENDYEAR") + .HasColumnType("int") + .HasColumnName("ENDYEAR1"); + + b1.Property("NCTNUM") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasColumnName("NCTNUM1"); + + b1.Property("STARTMO") + .HasColumnType("int") + .HasColumnName("STARTMO1"); + + b1.Property("STARTYEAR") + .HasColumnType("int") + .HasColumnName("STARTYEAR1"); + + b1.Property("TARGETAB") + .HasColumnType("bit") + .HasColumnName("TARGETAB1"); + + b1.Property("TARGETINF") + .HasColumnType("bit") + .HasColumnName("TARGETINF1"); + + b1.Property("TARGETOTH") + .HasColumnType("bit") + .HasColumnName("TARGETOTH1"); + + b1.Property("TARGETOTX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasColumnName("TARGETOTX1"); + + b1.Property("TARGETSYN") + .HasColumnType("bit") + .HasColumnName("TARGETSYN1"); + + b1.Property("TARGETTAU") + .HasColumnType("bit") + .HasColumnName("TARGETTAU1"); + + b1.Property("TRIALGRP") + .HasColumnType("int") + .HasColumnName("TRIALGRP1"); + + b1.Property("TRTTRIAL") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasColumnName("TRTTRIAL1"); + + b1.HasKey("A4aId"); + + b1.ToTable("tbl_A4as"); + + b1.WithOwner() + .HasForeignKey("A4aId"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4aTreatment", "Treatment2", b1 => + { + b1.Property("A4aId") + .HasColumnType("int"); + + b1.Property("CARETRIAL") + .HasColumnType("int") + .HasColumnName("CARETRIAL2"); + + b1.Property("ENDMO") + .HasColumnType("int") + .HasColumnName("ENDMO2"); + + b1.Property("ENDYEAR") + .HasColumnType("int") + .HasColumnName("ENDYEAR2"); + + b1.Property("NCTNUM") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasColumnName("NCTNUM2"); + + b1.Property("STARTMO") + .HasColumnType("int") + .HasColumnName("STARTMO2"); + + b1.Property("STARTYEAR") + .HasColumnType("int") + .HasColumnName("STARTYEAR2"); + + b1.Property("TARGETAB") + .HasColumnType("bit") + .HasColumnName("TARGETAB2"); + + b1.Property("TARGETINF") + .HasColumnType("bit") + .HasColumnName("TARGETINF2"); + + b1.Property("TARGETOTH") + .HasColumnType("bit") + .HasColumnName("TARGETOTH2"); + + b1.Property("TARGETOTX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasColumnName("TARGETOTX2"); + + b1.Property("TARGETSYN") + .HasColumnType("bit") + .HasColumnName("TARGETSYN2"); + + b1.Property("TARGETTAU") + .HasColumnType("bit") + .HasColumnName("TARGETTAU2"); + + b1.Property("TRIALGRP") + .HasColumnType("int") + .HasColumnName("TRIALGRP2"); + + b1.Property("TRTTRIAL") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasColumnName("TRTTRIAL2"); + + b1.HasKey("A4aId"); + + b1.ToTable("tbl_A4as"); + + b1.WithOwner() + .HasForeignKey("A4aId"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4aTreatment", "Treatment3", b1 => + { + b1.Property("A4aId") + .HasColumnType("int"); + + b1.Property("CARETRIAL") + .HasColumnType("int") + .HasColumnName("CARETRIAL3"); + + b1.Property("ENDMO") + .HasColumnType("int") + .HasColumnName("ENDMO3"); + + b1.Property("ENDYEAR") + .HasColumnType("int") + .HasColumnName("ENDYEAR3"); + + b1.Property("NCTNUM") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasColumnName("NCTNUM3"); + + b1.Property("STARTMO") + .HasColumnType("int") + .HasColumnName("STARTMO3"); + + b1.Property("STARTYEAR") + .HasColumnType("int") + .HasColumnName("STARTYEAR3"); + + b1.Property("TARGETAB") + .HasColumnType("bit") + .HasColumnName("TARGETAB3"); + + b1.Property("TARGETINF") + .HasColumnType("bit") + .HasColumnName("TARGETINF3"); + + b1.Property("TARGETOTH") + .HasColumnType("bit") + .HasColumnName("TARGETOTH3"); + + b1.Property("TARGETOTX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasColumnName("TARGETOTX3"); + + b1.Property("TARGETSYN") + .HasColumnType("bit") + .HasColumnName("TARGETSYN3"); + + b1.Property("TARGETTAU") + .HasColumnType("bit") + .HasColumnName("TARGETTAU3"); + + b1.Property("TRIALGRP") + .HasColumnType("int") + .HasColumnName("TRIALGRP3"); + + b1.Property("TRTTRIAL") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasColumnName("TRTTRIAL3"); + + b1.HasKey("A4aId"); + + b1.ToTable("tbl_A4as"); + + b1.WithOwner() + .HasForeignKey("A4aId"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4aTreatment", "Treatment4", b1 => + { + b1.Property("A4aId") + .HasColumnType("int"); + + b1.Property("CARETRIAL") + .HasColumnType("int") + .HasColumnName("CARETRIAL4"); + + b1.Property("ENDMO") + .HasColumnType("int") + .HasColumnName("ENDMO4"); + + b1.Property("ENDYEAR") + .HasColumnType("int") + .HasColumnName("ENDYEAR4"); + + b1.Property("NCTNUM") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasColumnName("NCTNUM4"); + + b1.Property("STARTMO") + .HasColumnType("int") + .HasColumnName("STARTMO4"); + + b1.Property("STARTYEAR") + .HasColumnType("int") + .HasColumnName("STARTYEAR4"); + + b1.Property("TARGETAB") + .HasColumnType("bit") + .HasColumnName("TARGETAB4"); + + b1.Property("TARGETINF") + .HasColumnType("bit") + .HasColumnName("TARGETINF4"); + + b1.Property("TARGETOTH") + .HasColumnType("bit") + .HasColumnName("TARGETOTH4"); + + b1.Property("TARGETOTX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasColumnName("TARGETOTX4"); + + b1.Property("TARGETSYN") + .HasColumnType("bit") + .HasColumnName("TARGETSYN4"); + + b1.Property("TARGETTAU") + .HasColumnType("bit") + .HasColumnName("TARGETTAU4"); + + b1.Property("TRIALGRP") + .HasColumnType("int") + .HasColumnName("TRIALGRP4"); + + b1.Property("TRTTRIAL") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasColumnName("TRTTRIAL4"); + + b1.HasKey("A4aId"); + + b1.ToTable("tbl_A4as"); + + b1.WithOwner() + .HasForeignKey("A4aId"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4aTreatment", "Treatment5", b1 => + { + b1.Property("A4aId") + .HasColumnType("int"); + + b1.Property("CARETRIAL") + .HasColumnType("int") + .HasColumnName("CARETRIAL5"); + + b1.Property("ENDMO") + .HasColumnType("int") + .HasColumnName("ENDMO5"); + + b1.Property("ENDYEAR") + .HasColumnType("int") + .HasColumnName("ENDYEAR5"); + + b1.Property("NCTNUM") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasColumnName("NCTNUM5"); + + b1.Property("STARTMO") + .HasColumnType("int") + .HasColumnName("STARTMO5"); + + b1.Property("STARTYEAR") + .HasColumnType("int") + .HasColumnName("STARTYEAR5"); + + b1.Property("TARGETAB") + .HasColumnType("bit") + .HasColumnName("TARGETAB5"); + + b1.Property("TARGETINF") + .HasColumnType("bit") + .HasColumnName("TARGETINF5"); + + b1.Property("TARGETOTH") + .HasColumnType("bit") + .HasColumnName("TARGETOTH5"); + + b1.Property("TARGETOTX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasColumnName("TARGETOTX5"); + + b1.Property("TARGETSYN") + .HasColumnType("bit") + .HasColumnName("TARGETSYN5"); + + b1.Property("TARGETTAU") + .HasColumnType("bit") + .HasColumnName("TARGETTAU5"); + + b1.Property("TRIALGRP") + .HasColumnType("int") + .HasColumnName("TRIALGRP5"); + + b1.Property("TRTTRIAL") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasColumnName("TRTTRIAL5"); + + b1.HasKey("A4aId"); + + b1.ToTable("tbl_A4as"); + + b1.WithOwner() + .HasForeignKey("A4aId"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4aTreatment", "Treatment6", b1 => + { + b1.Property("A4aId") + .HasColumnType("int"); + + b1.Property("CARETRIAL") + .HasColumnType("int") + .HasColumnName("CARETRIAL6"); + + b1.Property("ENDMO") + .HasColumnType("int") + .HasColumnName("ENDMO6"); + + b1.Property("ENDYEAR") + .HasColumnType("int") + .HasColumnName("ENDYEAR6"); + + b1.Property("NCTNUM") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasColumnName("NCTNUM6"); + + b1.Property("STARTMO") + .HasColumnType("int") + .HasColumnName("STARTMO6"); + + b1.Property("STARTYEAR") + .HasColumnType("int") + .HasColumnName("STARTYEAR6"); + + b1.Property("TARGETAB") + .HasColumnType("bit") + .HasColumnName("TARGETAB6"); + + b1.Property("TARGETINF") + .HasColumnType("bit") + .HasColumnName("TARGETINF6"); + + b1.Property("TARGETOTH") + .HasColumnType("bit") + .HasColumnName("TARGETOTH6"); + + b1.Property("TARGETOTX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasColumnName("TARGETOTX6"); + + b1.Property("TARGETSYN") + .HasColumnType("bit") + .HasColumnName("TARGETSYN6"); + + b1.Property("TARGETTAU") + .HasColumnType("bit") + .HasColumnName("TARGETTAU6"); + + b1.Property("TRIALGRP") + .HasColumnType("int") + .HasColumnName("TRIALGRP6"); + + b1.Property("TRTTRIAL") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasColumnName("TRTTRIAL6"); + + b1.HasKey("A4aId"); + + b1.ToTable("tbl_A4as"); + + b1.WithOwner() + .HasForeignKey("A4aId"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4aTreatment", "Treatment7", b1 => + { + b1.Property("A4aId") + .HasColumnType("int"); + + b1.Property("CARETRIAL") + .HasColumnType("int") + .HasColumnName("CARETRIAL7"); + + b1.Property("ENDMO") + .HasColumnType("int") + .HasColumnName("ENDMO7"); + + b1.Property("ENDYEAR") + .HasColumnType("int") + .HasColumnName("ENDYEAR7"); + + b1.Property("NCTNUM") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasColumnName("NCTNUM7"); + + b1.Property("STARTMO") + .HasColumnType("int") + .HasColumnName("STARTMO7"); + + b1.Property("STARTYEAR") + .HasColumnType("int") + .HasColumnName("STARTYEAR7"); + + b1.Property("TARGETAB") + .HasColumnType("bit") + .HasColumnName("TARGETAB7"); + + b1.Property("TARGETINF") + .HasColumnType("bit") + .HasColumnName("TARGETINF7"); + + b1.Property("TARGETOTH") + .HasColumnType("bit") + .HasColumnName("TARGETOTH7"); + + b1.Property("TARGETOTX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasColumnName("TARGETOTX7"); + + b1.Property("TARGETSYN") + .HasColumnType("bit") + .HasColumnName("TARGETSYN7"); + + b1.Property("TARGETTAU") + .HasColumnType("bit") + .HasColumnName("TARGETTAU7"); + + b1.Property("TRIALGRP") + .HasColumnType("int") + .HasColumnName("TRIALGRP7"); + + b1.Property("TRTTRIAL") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasColumnName("TRTTRIAL7"); + + b1.HasKey("A4aId"); + + b1.ToTable("tbl_A4as"); + + b1.WithOwner() + .HasForeignKey("A4aId"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4aTreatment", "Treatment8", b1 => + { + b1.Property("A4aId") + .HasColumnType("int"); + + b1.Property("CARETRIAL") + .HasColumnType("int") + .HasColumnName("CARETRIAL8"); + + b1.Property("ENDMO") + .HasColumnType("int") + .HasColumnName("ENDMO8"); + + b1.Property("ENDYEAR") + .HasColumnType("int") + .HasColumnName("ENDYEAR8"); + + b1.Property("NCTNUM") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasColumnName("NCTNUM8"); + + b1.Property("STARTMO") + .HasColumnType("int") + .HasColumnName("STARTMO8"); + + b1.Property("STARTYEAR") + .HasColumnType("int") + .HasColumnName("STARTYEAR8"); + + b1.Property("TARGETAB") + .HasColumnType("bit") + .HasColumnName("TARGETAB8"); + + b1.Property("TARGETINF") + .HasColumnType("bit") + .HasColumnName("TARGETINF8"); + + b1.Property("TARGETOTH") + .HasColumnType("bit") + .HasColumnName("TARGETOTH8"); + + b1.Property("TARGETOTX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasColumnName("TARGETOTX8"); + + b1.Property("TARGETSYN") + .HasColumnType("bit") + .HasColumnName("TARGETSYN8"); + + b1.Property("TARGETTAU") + .HasColumnType("bit") + .HasColumnName("TARGETTAU8"); + + b1.Property("TRIALGRP") + .HasColumnType("int") + .HasColumnName("TRIALGRP8"); + + b1.Property("TRTTRIAL") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasColumnName("TRTTRIAL8"); + + b1.HasKey("A4aId"); + + b1.ToTable("tbl_A4as"); + + b1.WithOwner() + .HasForeignKey("A4aId"); + }); + + b.Navigation("Treatment1") + .IsRequired(); + + b.Navigation("Treatment2") + .IsRequired(); + + b.Navigation("Treatment3") + .IsRequired(); + + b.Navigation("Treatment4") + .IsRequired(); + + b.Navigation("Treatment5") + .IsRequired(); + + b.Navigation("Treatment6") + .IsRequired(); + + b.Navigation("Treatment7") + .IsRequired(); + + b.Navigation("Treatment8") + .IsRequired(); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.A5D2", b => + { + b.HasOne("UDS.Net.API.Entities.Visit", null) + .WithOne("A5D2") + .HasForeignKey("UDS.Net.API.Entities.A5D2", "VisitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.B1", b => + { + b.HasOne("UDS.Net.API.Entities.Visit", null) + .WithOne("B1") + .HasForeignKey("UDS.Net.API.Entities.B1", "VisitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.B3", b => + { + b.HasOne("UDS.Net.API.Entities.Visit", null) + .WithOne("B3") + .HasForeignKey("UDS.Net.API.Entities.B3", "VisitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.B4", b => + { + b.HasOne("UDS.Net.API.Entities.Visit", null) + .WithOne("B4") + .HasForeignKey("UDS.Net.API.Entities.B4", "VisitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.B5", b => + { + b.HasOne("UDS.Net.API.Entities.Visit", null) + .WithOne("B5") + .HasForeignKey("UDS.Net.API.Entities.B5", "VisitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.B6", b => + { + b.HasOne("UDS.Net.API.Entities.Visit", null) + .WithOne("B6") + .HasForeignKey("UDS.Net.API.Entities.B6", "VisitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.B7", b => + { + b.HasOne("UDS.Net.API.Entities.Visit", null) + .WithOne("B7") + .HasForeignKey("UDS.Net.API.Entities.B7", "VisitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.B8", b => + { + b.HasOne("UDS.Net.API.Entities.Visit", null) + .WithOne("B8") + .HasForeignKey("UDS.Net.API.Entities.B8", "VisitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.B9", b => + { + b.HasOne("UDS.Net.API.Entities.Visit", null) + .WithOne("B9") + .HasForeignKey("UDS.Net.API.Entities.B9", "VisitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.C1", b => + { + b.HasOne("UDS.Net.API.Entities.Visit", null) + .WithOne("C1") + .HasForeignKey("UDS.Net.API.Entities.C1", "VisitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.C2", b => + { + b.HasOne("UDS.Net.API.Entities.Visit", null) + .WithOne("C2") + .HasForeignKey("UDS.Net.API.Entities.C2", "VisitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.D1a", b => + { + b.HasOne("UDS.Net.API.Entities.Visit", null) + .WithOne("D1a") + .HasForeignKey("UDS.Net.API.Entities.D1a", "VisitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.D1b", b => + { + b.HasOne("UDS.Net.API.Entities.Visit", null) + .WithOne("D1b") + .HasForeignKey("UDS.Net.API.Entities.D1b", "VisitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.FormStatus", b => + { + b.HasOne("UDS.Net.API.Entities.Visit", null) + .WithMany("FormStatuses") + .HasForeignKey("VisitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.M1", b => + { + b.HasOne("UDS.Net.API.Entities.Participation", "Participation") + .WithMany("M1s") + .HasForeignKey("ParticipationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Participation"); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.PacketSubmission", b => + { + b.HasOne("UDS.Net.API.Entities.Visit", "Visit") + .WithMany("PacketSubmissions") + .HasForeignKey("VisitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Visit"); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.PacketSubmissionError", b => + { + b.HasOne("UDS.Net.API.Entities.PacketSubmission", "PacketSubmission") + .WithMany("PacketSubmissionErrors") + .HasForeignKey("PacketSubmissionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("PacketSubmission"); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.T1", b => + { + b.HasOne("UDS.Net.API.Entities.Visit", null) + .WithOne("T1") + .HasForeignKey("UDS.Net.API.Entities.T1", "VisitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.Visit", b => + { + b.HasOne("UDS.Net.API.Entities.Participation", "Participation") + .WithMany("Visits") + .HasForeignKey("ParticipationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Participation"); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.PacketSubmission", b => + { + b.Navigation("PacketSubmissionErrors"); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.Participation", b => + { + b.Navigation("M1s"); + + b.Navigation("Visits"); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.Visit", b => + { + b.Navigation("A1") + .IsRequired(); + + b.Navigation("A1a") + .IsRequired(); + + b.Navigation("A2") + .IsRequired(); + + b.Navigation("A3") + .IsRequired(); + + b.Navigation("A4") + .IsRequired(); + + b.Navigation("A4a") + .IsRequired(); + + b.Navigation("A5D2") + .IsRequired(); + + b.Navigation("B1") + .IsRequired(); + + b.Navigation("B3") + .IsRequired(); + + b.Navigation("B4") + .IsRequired(); + + b.Navigation("B5") + .IsRequired(); + + b.Navigation("B6") + .IsRequired(); + + b.Navigation("B7") + .IsRequired(); + + b.Navigation("B8") + .IsRequired(); + + b.Navigation("B9") + .IsRequired(); + + b.Navigation("C1") + .IsRequired(); + + b.Navigation("C2") + .IsRequired(); + + b.Navigation("D1a") + .IsRequired(); + + b.Navigation("D1b") + .IsRequired(); + + b.Navigation("FormStatuses"); + + b.Navigation("PacketSubmissions"); + + b.Navigation("T1"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/UDS.Net.API/Data/Migrations/20240814181754_SupportPacketSubmission.cs b/src/UDS.Net.API/Data/Migrations/20240814181754_SupportPacketSubmission.cs new file mode 100644 index 0000000..edadbb7 --- /dev/null +++ b/src/UDS.Net.API/Data/Migrations/20240814181754_SupportPacketSubmission.cs @@ -0,0 +1,100 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace UDS.Net.API.Data.Migrations +{ + /// + public partial class SupportPacketSubmission : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "Status", + table: "tbl_Visits", + type: "int", + nullable: false, + defaultValue: 0); + + migrationBuilder.CreateTable( + name: "PacketSubmissions", + columns: table => new + { + PacketSubmissionId = table.Column(type: "int", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + SubmissionDate = table.Column(type: "datetime2", nullable: false), + VisitId = table.Column(type: "int", nullable: false), + CreatedAt = table.Column(type: "datetime2", nullable: false), + CreatedBy = table.Column(type: "nvarchar(max)", nullable: false), + ModifiedBy = table.Column(type: "nvarchar(max)", nullable: true), + DeletedBy = table.Column(type: "nvarchar(max)", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_PacketSubmissions", x => x.PacketSubmissionId); + table.ForeignKey( + name: "FK_PacketSubmissions_tbl_Visits_VisitId", + column: x => x.VisitId, + principalTable: "tbl_Visits", + principalColumn: "VisitId", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "PacketSubmissionErrors", + columns: table => new + { + PacketSubmissionErrorId = table.Column(type: "int", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + FormKind = table.Column(type: "nvarchar(10)", maxLength: 10, nullable: false), + Message = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: false), + AssignedTo = table.Column(type: "nvarchar(max)", nullable: false), + Level = table.Column(type: "int", nullable: false), + ResolvedBy = table.Column(type: "nvarchar(max)", nullable: false), + PacketSubmissionId = table.Column(type: "int", nullable: false), + CreatedAt = table.Column(type: "datetime2", nullable: false), + CreatedBy = table.Column(type: "nvarchar(max)", nullable: false), + ModifiedBy = table.Column(type: "nvarchar(max)", nullable: true), + DeletedBy = table.Column(type: "nvarchar(max)", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_PacketSubmissionErrors", x => x.PacketSubmissionErrorId); + table.ForeignKey( + name: "FK_PacketSubmissionErrors_PacketSubmissions_PacketSubmissionId", + column: x => x.PacketSubmissionId, + principalTable: "PacketSubmissions", + principalColumn: "PacketSubmissionId", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateIndex( + name: "IX_PacketSubmissionErrors_PacketSubmissionId", + table: "PacketSubmissionErrors", + column: "PacketSubmissionId"); + + migrationBuilder.CreateIndex( + name: "IX_PacketSubmissions_VisitId", + table: "PacketSubmissions", + column: "VisitId"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "PacketSubmissionErrors"); + + migrationBuilder.DropTable( + name: "PacketSubmissions"); + + migrationBuilder.DropColumn( + name: "Status", + table: "tbl_Visits"); + } + } +} diff --git a/src/UDS.Net.API/Data/Migrations/ApiDbContextModelSnapshot.cs b/src/UDS.Net.API/Data/Migrations/ApiDbContextModelSnapshot.cs index 9f91ccc..bfb16d3 100644 --- a/src/UDS.Net.API/Data/Migrations/ApiDbContextModelSnapshot.cs +++ b/src/UDS.Net.API/Data/Migrations/ApiDbContextModelSnapshot.cs @@ -5353,6 +5353,102 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.ToTable("tbl_M1s"); }); + modelBuilder.Entity("UDS.Net.API.Entities.PacketSubmission", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("PacketSubmissionId") + .HasColumnOrder(0); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DeletedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("ModifiedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("SubmissionDate") + .HasColumnType("datetime2"); + + b.Property("VisitId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("VisitId"); + + b.ToTable("PacketSubmissions"); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.PacketSubmissionError", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("PacketSubmissionErrorId") + .HasColumnOrder(0); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("AssignedTo") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DeletedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("FormKind") + .IsRequired() + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("Message") + .IsRequired() + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("ModifiedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("PacketSubmissionId") + .HasColumnType("int"); + + b.Property("ResolvedBy") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("PacketSubmissionId"); + + b.ToTable("PacketSubmissionErrors"); + }); + modelBuilder.Entity("UDS.Net.API.Entities.Participation", b => { b.Property("Id") @@ -5547,6 +5643,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("ParticipationId") .HasColumnType("int"); + b.Property("Status") + .HasColumnType("int"); + b.Property("VISITNUM") .HasColumnType("int") .HasColumnName("VISITNUM"); @@ -8693,6 +8792,28 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Navigation("Participation"); }); + modelBuilder.Entity("UDS.Net.API.Entities.PacketSubmission", b => + { + b.HasOne("UDS.Net.API.Entities.Visit", "Visit") + .WithMany("PacketSubmissions") + .HasForeignKey("VisitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Visit"); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.PacketSubmissionError", b => + { + b.HasOne("UDS.Net.API.Entities.PacketSubmission", "PacketSubmission") + .WithMany("PacketSubmissionErrors") + .HasForeignKey("PacketSubmissionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("PacketSubmission"); + }); + modelBuilder.Entity("UDS.Net.API.Entities.T1", b => { b.HasOne("UDS.Net.API.Entities.Visit", null) @@ -8713,6 +8834,11 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Navigation("Participation"); }); + modelBuilder.Entity("UDS.Net.API.Entities.PacketSubmission", b => + { + b.Navigation("PacketSubmissionErrors"); + }); + modelBuilder.Entity("UDS.Net.API.Entities.Participation", b => { b.Navigation("M1s"); @@ -8781,6 +8907,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Navigation("FormStatuses"); + b.Navigation("PacketSubmissions"); + b.Navigation("T1"); }); #pragma warning restore 612, 618 diff --git a/src/UDS.Net.API/Entities/PacketStatus.cs b/src/UDS.Net.API/Entities/PacketStatus.cs index 52588e1..7b83b42 100644 --- a/src/UDS.Net.API/Entities/PacketStatus.cs +++ b/src/UDS.Net.API/Entities/PacketStatus.cs @@ -2,7 +2,8 @@ { public enum PacketStatus { - Unsubmitted, // no attempts made to submit + Pending, // no attempts made to finalize or submit + Finalized, // finalized entire packet since last form change Submitted, // submitted at least once, pending error checks from the latest submission FailedErrorChecks, // submitted at least once and failed error checks PassedErrorChecks, // submitted at least once and passed error checks From 2f6a32b6985da8948c3fd0ab232a707d8d9e5dd1 Mon Sep 17 00:00:00 2001 From: Ashley Wilson Date: Wed, 23 Oct 2024 13:15:32 -0400 Subject: [PATCH 14/24] In-progress --- src/UDS.Net.API.Client/ApiClient.cs | 8 +- src/UDS.Net.API.Client/IApiClient.cs | 2 +- src/UDS.Net.API.Client/IPacketClient.cs | 27 + .../IPacketSubmissionClient.cs | 35 - src/UDS.Net.API.Client/IVisitClient.cs | 7 +- src/UDS.Net.API.Client/PacketClient.cs | 134 + .../PacketSubmissionClient.cs | 131 - .../UDS.Net.API.Client.csproj | 4 +- src/UDS.Net.API.Client/VisitClient.cs | 15 +- .../PacketSubmissionsController.cs | 343 - .../Controllers/PacketsController.cs | 431 + .../Controllers/VisitsController.cs | 97 +- ...181754_SupportPacketSubmission.Designer.cs | 8920 ----------------- .../20240814181754_SupportPacketSubmission.cs | 100 - .../Migrations/ApiDbContextModelSnapshot.cs | 508 +- src/UDS.Net.API/Entities/PacketStatus.cs | 2 +- src/UDS.Net.API/Entities/PacketSubmission.cs | 2 + .../Extensions/DtoToEntityMapper.cs | 21 +- .../Extensions/EntityToDtoMapper.cs | 38 +- src/UDS.Net.API/UDS.Net.API.csproj | 3 +- src/UDS.Net.Dto/FormDto.cs | 5 + src/UDS.Net.Dto/PacketDto.cs | 13 + src/UDS.Net.Dto/PacketSubmissionDto.cs | 4 +- src/UDS.Net.Dto/PacketSubmissionFormsDto.cs | 13 - src/UDS.Net.Dto/UDS.Net.Dto.csproj | 6 +- src/UDS.Net.Dto/VisitDto.cs | 4 +- src/UDS.Net.sln | 12 +- 27 files changed, 935 insertions(+), 9950 deletions(-) create mode 100644 src/UDS.Net.API.Client/IPacketClient.cs delete mode 100644 src/UDS.Net.API.Client/IPacketSubmissionClient.cs create mode 100644 src/UDS.Net.API.Client/PacketClient.cs delete mode 100644 src/UDS.Net.API.Client/PacketSubmissionClient.cs delete mode 100644 src/UDS.Net.API/Controllers/PacketSubmissionsController.cs create mode 100644 src/UDS.Net.API/Controllers/PacketsController.cs delete mode 100644 src/UDS.Net.API/Data/Migrations/20240814181754_SupportPacketSubmission.Designer.cs delete mode 100644 src/UDS.Net.API/Data/Migrations/20240814181754_SupportPacketSubmission.cs create mode 100644 src/UDS.Net.Dto/PacketDto.cs delete mode 100644 src/UDS.Net.Dto/PacketSubmissionFormsDto.cs diff --git a/src/UDS.Net.API.Client/ApiClient.cs b/src/UDS.Net.API.Client/ApiClient.cs index 64c59d1..1cdee66 100644 --- a/src/UDS.Net.API.Client/ApiClient.cs +++ b/src/UDS.Net.API.Client/ApiClient.cs @@ -27,7 +27,7 @@ public static void AddUDSApiClient(this IServiceCollection services, string base options.BaseAddress = new Uri(baseAddress); }); - services.AddHttpClient(options => + services.AddHttpClient(options => { options.BaseAddress = new Uri(baseAddress); }); @@ -46,14 +46,14 @@ public class ApiClient : IApiClient public IVisitClient VisitClient { get; } public IParticipationClient ParticipationClient { get; } public ILookupClient LookupClient { get; } - public IPacketSubmissionClient PacketSubmissionClient { get; } + public IPacketClient PacketClient { get; } - public ApiClient(IVisitClient visitClient, IParticipationClient participationClient, ILookupClient lookupClient, IPacketSubmissionClient packetSubmissionClient) + public ApiClient(IVisitClient visitClient, IParticipationClient participationClient, ILookupClient lookupClient, IPacketClient packetClient) { VisitClient = visitClient; ParticipationClient = participationClient; LookupClient = lookupClient; - PacketSubmissionClient = packetSubmissionClient; + PacketClient = packetClient; } diff --git a/src/UDS.Net.API.Client/IApiClient.cs b/src/UDS.Net.API.Client/IApiClient.cs index f0c7a8a..4bc918d 100644 --- a/src/UDS.Net.API.Client/IApiClient.cs +++ b/src/UDS.Net.API.Client/IApiClient.cs @@ -5,7 +5,7 @@ public interface IApiClient IVisitClient VisitClient { get; } IParticipationClient ParticipationClient { get; } ILookupClient LookupClient { get; } - IPacketSubmissionClient PacketSubmissionClient { get; } + IPacketClient PacketClient { get; } } } diff --git a/src/UDS.Net.API.Client/IPacketClient.cs b/src/UDS.Net.API.Client/IPacketClient.cs new file mode 100644 index 0000000..5986d63 --- /dev/null +++ b/src/UDS.Net.API.Client/IPacketClient.cs @@ -0,0 +1,27 @@ +using System.Collections.Generic; +using System.Threading.Tasks; +using UDS.Net.Dto; + +namespace UDS.Net.API.Client +{ + public interface IPacketClient : IBaseClient + { + Task GetPacketWithForms(int id); + + Task CountByStatusAndAssignee(string[] statuses, string assignedTo); + + Task> GetPacketsByStatusAndAssignee(string[] statuses, string assignedTo, int pageSize = 10, int pageIndex = 1); + + //Task ErrorCountByForm(int visitId, string formKind, bool includeResolved = false); + + //Task> GetErrorsByForm(int visitId, string formKind, bool includeResolved = false, int pageSize = 10, int pageIndex = 1); + + + + //Task> GetPacketSubmissionErrorsByVisit(int visitId, int pageSize = 10, int pageIndex = 1); + + //Task PostPacketSubmissionError(int packetSubmissionId, PacketSubmissionErrorDto dto); + + //Task PutPacketSubmissionError(int packetSubmissionId, int id, PacketSubmissionErrorDto dto); + } +} diff --git a/src/UDS.Net.API.Client/IPacketSubmissionClient.cs b/src/UDS.Net.API.Client/IPacketSubmissionClient.cs deleted file mode 100644 index cd4498e..0000000 --- a/src/UDS.Net.API.Client/IPacketSubmissionClient.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Collections.Generic; -using System.Threading.Tasks; -using UDS.Net.Dto; - -namespace UDS.Net.API.Client -{ - public interface IPacketSubmissionClient : IBaseClient - { - Task GetPacketSubmissionWithForms(int id); - - Task PacketSubmissionsCountByVisit(int visitId); - - Task PacketSubmissionsCountByStatus(string packetStatus); - - Task> GetPacketSubmissionsByVisit(int visitId, int pageSize = 10, int pageIndex = 1); - - Task> GetPacketSubmissionsByStatus(string packetStatus, int pageSize = 10, int pageIndex = 1); - - Task PacketSubmissionErrorsCount(bool includeResolved = false); - - Task PacketSubmissionsErrorsCountByVisit(int visitId); - - Task PacketSubmissionsErrorsCountByAssignee(string assignedTo); - - Task> GetPacketSubmissionErrors(bool includeResolved = false, int pageSize = 10, int pageIndex = 1); - - Task> GetPacketSubmissionErrorsByVisit(int visitId, int pageSize = 10, int pageIndex = 1); - - Task> GetPacketSubmissionErrorsByAssignee(string assignedTo, int pageSize = 10, int pageIndex = 1); - - Task PostPacketSubmissionError(int packetSubmissionId, PacketSubmissionErrorDto dto); - - Task PutPacketSubmissionError(int packetSubmissionId, int id, PacketSubmissionErrorDto dto); - } -} diff --git a/src/UDS.Net.API.Client/IVisitClient.cs b/src/UDS.Net.API.Client/IVisitClient.cs index ca99712..df0fa15 100644 --- a/src/UDS.Net.API.Client/IVisitClient.cs +++ b/src/UDS.Net.API.Client/IVisitClient.cs @@ -1,11 +1,14 @@ -using System.Threading.Tasks; +using System.Collections.Generic; +using System.Threading.Tasks; using UDS.Net.Dto; namespace UDS.Net.API.Client { public interface IVisitClient : IBaseClient { - Task GetWithPacketSubmissions(int id, int pageSize = 10, int pageIndex = 1); + Task> GetVisitsAtStatus(string[] statuses, int pageSize = 10, int pageIndex = 1); + + Task GetCountOfVisitsAtStatus(string[] statuses); Task GetWithForm(int id, string formKind); diff --git a/src/UDS.Net.API.Client/PacketClient.cs b/src/UDS.Net.API.Client/PacketClient.cs new file mode 100644 index 0000000..2b729c3 --- /dev/null +++ b/src/UDS.Net.API.Client/PacketClient.cs @@ -0,0 +1,134 @@ +using System.Collections.Generic; +using System.Net.Http; +using System.Text.Json; +using System.Threading.Tasks; +using UDS.Net.Dto; + +namespace UDS.Net.API.Client +{ + public class PacketClient : AuthenticatedClient, IPacketClient + { + const string BASEPATH = "Packets"; + + public PacketClient(HttpClient httpClient) : base(httpClient, BASEPATH) + { + } + + public async Task GetPacketWithForms(int id) + { + var response = await GetRequest($"{_BasePath}/{id}/IncludeForms"); + + PacketDto dto = JsonSerializer.Deserialize(response, options); + + return dto; + } + + public async Task CountByStatusAndAssignee(string[] statuses, string assignedTo) + { + var response = await GetRequest($"{_BasePath}/Count/ByStatus/{statuses}"); + + int count = JsonSerializer.Deserialize(response, options); + + return count; + } + + public async Task> GetPacketsByStatusAndAssignee(string[] statuses, string assignedTo, int pageSize = 10, int pageIndex = 1) + { + var response = await GetRequest($"{_BasePath}/ByStatus/{statuses}?pageSize={pageSize}&pageIndex={pageIndex}"); + + List dto = JsonSerializer.Deserialize>(response, options); + + return dto; + } + + + //public async Task PacketSubmissionsCountByVisit(int visitId) + //{ + // var response = await GetRequest($"{_BasePath}/Count/ByVisit/{visitId}"); + + // int count = JsonSerializer.Deserialize(response, options); + + // return count; + //} + + + //public async Task> GetPacketSubmissionsByVisit(int visitId, int pageSize = 10, int pageIndex = 1) + //{ + // var response = await GetRequest($"{_BasePath}/ByVisit/{visitId}?pageSize={pageSize}&pageIndex={pageIndex}"); + + // List dto = JsonSerializer.Deserialize>(response, options); + + // return dto; + //} + + + //public async Task PacketSubmissionErrorsCount(bool includeResolved = false) + //{ + // var response = await GetRequest($"{_BasePath}/Errors/Count?includeResolved={includeResolved}"); + + // int count = JsonSerializer.Deserialize(response, options); + + // return count; + //} + + //public async Task PacketSubmissionsErrorsCountByVisit(int visitId) + //{ + // var response = await GetRequest($"{_BasePath}/Errors/Count/ByVisit/{visitId}"); + + // int count = JsonSerializer.Deserialize(response, options); + + // return count; + //} + + //public async Task PacketSubmissionsErrorsCountByAssignee(string assignedTo) + //{ + // var response = await GetRequest($"{_BasePath}/Errors/Count/ByAssignee/{assignedTo}"); + + // int count = JsonSerializer.Deserialize(response, options); + + // return count; + //} + + //public async Task> GetPacketSubmissionErrors(bool includeResolved = false, int pageSize = 10, int pageIndex = 1) + //{ + // var response = await GetRequest($"{_BasePath}/Errors?includeResolved={includeResolved}&pageSize={pageSize}&pageIndex={pageIndex}"); + + // List dto = JsonSerializer.Deserialize>(response, options); + + // return dto; + //} + + //public async Task> GetPacketSubmissionErrorsByVisit(int visitId, int pageSize = 10, int pageIndex = 1) + //{ + // var response = await GetRequest($"{_BasePath}/Errors/ByVisit/{visitId}?pageSize={pageSize}&pageIndex={pageIndex}"); + + // List dto = JsonSerializer.Deserialize>(response, options); + + // return dto; + //} + + //public async Task> GetPacketSubmissionErrorsByAssignee(string assignedTo, int pageSize = 10, int pageIndex = 1) + //{ + // var response = await GetRequest($"{_BasePath}/Errors/ByAssignee/{assignedTo}?pageSize={pageSize}&pageIndex={pageIndex}"); + + // List dto = JsonSerializer.Deserialize>(response, options); + + // return dto; + //} + + //public async Task PostPacketSubmissionError(int packetSubmissionId, PacketSubmissionErrorDto dto) + //{ + // string json = JsonSerializer.Serialize(dto); + + // var response = await PostRequest($"{_BasePath}/{packetSubmissionId}/Errors", json); + //} + + //public async Task PutPacketSubmissionError(int packetSubmissionId, int id, PacketSubmissionErrorDto dto) + //{ + // string json = JsonSerializer.Serialize(dto); + + // var response = await PutRequest($"{_BasePath}/{packetSubmissionId}/Errors/{id}", json); + //} + } +} + diff --git a/src/UDS.Net.API.Client/PacketSubmissionClient.cs b/src/UDS.Net.API.Client/PacketSubmissionClient.cs deleted file mode 100644 index 4aa7649..0000000 --- a/src/UDS.Net.API.Client/PacketSubmissionClient.cs +++ /dev/null @@ -1,131 +0,0 @@ -using System.Collections.Generic; -using System.Net.Http; -using System.Text.Json; -using System.Threading.Tasks; -using UDS.Net.Dto; - -namespace UDS.Net.API.Client -{ - public class PacketSubmissionClient : AuthenticatedClient, IPacketSubmissionClient - { - const string BASEPATH = "PacketSubmissions"; - - public PacketSubmissionClient(HttpClient httpClient) : base(httpClient, BASEPATH) - { - } - - public async Task GetPacketSubmissionWithForms(int id) - { - var response = await GetRequest($"{_BasePath}/{id}/IncludeForms"); - - PacketSubmissionDto dto = JsonSerializer.Deserialize(response, options); - - return dto; - } - - public async Task PacketSubmissionsCountByVisit(int visitId) - { - var response = await GetRequest($"{_BasePath}/Count/ByVisit/{visitId}"); - - int count = JsonSerializer.Deserialize(response, options); - - return count; - } - - public async Task PacketSubmissionsCountByStatus(string packetStatus) - { - var response = await GetRequest($"{_BasePath}/Count/ByStatus/{packetStatus}"); - - int count = JsonSerializer.Deserialize(response, options); - - return count; - } - - public async Task> GetPacketSubmissionsByVisit(int visitId, int pageSize = 10, int pageIndex = 1) - { - var response = await GetRequest($"{_BasePath}/ByVisit/{visitId}?pageSize={pageSize}&pageIndex={pageIndex}"); - - List dto = JsonSerializer.Deserialize>(response, options); - - return dto; - } - - public async Task> GetPacketSubmissionsByStatus(string packetStatus, int pageSize = 10, int pageIndex = 1) - { - var response = await GetRequest($"{_BasePath}/ByStatus/{packetStatus}?pageSize={pageSize}&pageIndex={pageIndex}"); - - List dto = JsonSerializer.Deserialize>(response, options); - - return dto; - } - - public async Task PacketSubmissionErrorsCount(bool includeResolved = false) - { - var response = await GetRequest($"{_BasePath}/Errors/Count?includeResolved={includeResolved}"); - - int count = JsonSerializer.Deserialize(response, options); - - return count; - } - - public async Task PacketSubmissionsErrorsCountByVisit(int visitId) - { - var response = await GetRequest($"{_BasePath}/Errors/Count/ByVisit/{visitId}"); - - int count = JsonSerializer.Deserialize(response, options); - - return count; - } - - public async Task PacketSubmissionsErrorsCountByAssignee(string assignedTo) - { - var response = await GetRequest($"{_BasePath}/Errors/Count/ByAssignee/{assignedTo}"); - - int count = JsonSerializer.Deserialize(response, options); - - return count; - } - - public async Task> GetPacketSubmissionErrors(bool includeResolved = false, int pageSize = 10, int pageIndex = 1) - { - var response = await GetRequest($"{_BasePath}/Errors?includeResolved={includeResolved}&pageSize={pageSize}&pageIndex={pageIndex}"); - - List dto = JsonSerializer.Deserialize>(response, options); - - return dto; - } - - public async Task> GetPacketSubmissionErrorsByVisit(int visitId, int pageSize = 10, int pageIndex = 1) - { - var response = await GetRequest($"{_BasePath}/Errors/ByVisit/{visitId}?pageSize={pageSize}&pageIndex={pageIndex}"); - - List dto = JsonSerializer.Deserialize>(response, options); - - return dto; - } - - public async Task> GetPacketSubmissionErrorsByAssignee(string assignedTo, int pageSize = 10, int pageIndex = 1) - { - var response = await GetRequest($"{_BasePath}/Errors/ByAssignee/{assignedTo}?pageSize={pageSize}&pageIndex={pageIndex}"); - - List dto = JsonSerializer.Deserialize>(response, options); - - return dto; - } - - public async Task PostPacketSubmissionError(int packetSubmissionId, PacketSubmissionErrorDto dto) - { - string json = JsonSerializer.Serialize(dto); - - var response = await PostRequest($"{_BasePath}/{packetSubmissionId}/Errors", json); - } - - public async Task PutPacketSubmissionError(int packetSubmissionId, int id, PacketSubmissionErrorDto dto) - { - string json = JsonSerializer.Serialize(dto); - - var response = await PutRequest($"{_BasePath}/{packetSubmissionId}/Errors/{id}", json); - } - } -} - diff --git a/src/UDS.Net.API.Client/UDS.Net.API.Client.csproj b/src/UDS.Net.API.Client/UDS.Net.API.Client.csproj index 14ca913..4f8cab6 100644 --- a/src/UDS.Net.API.Client/UDS.Net.API.Client.csproj +++ b/src/UDS.Net.API.Client/UDS.Net.API.Client.csproj @@ -4,13 +4,13 @@ netstandard2.1 Library UDS.Net.API.Client - 4.1.0-preview.6 + 4.1.0-preview.8 Sanders-Brown Center on Aging UDS client library for using UDS.Net.API UK-SBCoA Client library for API https://github.com/UK-SBCoA/uniform-data-set-dotnet-api - 4.1.0-preview.6 + 4.1.0-preview.8 diff --git a/src/UDS.Net.API.Client/VisitClient.cs b/src/UDS.Net.API.Client/VisitClient.cs index 8aad8de..a1cccc1 100644 --- a/src/UDS.Net.API.Client/VisitClient.cs +++ b/src/UDS.Net.API.Client/VisitClient.cs @@ -1,4 +1,5 @@ -using System.Net.Http; +using System.Collections.Generic; +using System.Net.Http; using System.Text.Json; using System.Threading.Tasks; using UDS.Net.Dto; @@ -13,13 +14,14 @@ public VisitClient(HttpClient httpClient) : base(httpClient, BASEPATH) { } - public async Task GetWithPacketSubmissions(int id, int pageSize = 10, int pageIndex = 1) + public async Task> GetVisitsAtStatus(string[] statuses, int pageSize = 10, int pageIndex = 1) { - var response = await GetRequest($"{_BasePath}/{id}/WithPacketSubmissions?pageSize={pageSize}&pageIndex={pageIndex}"); - - VisitDto? dto = JsonSerializer.Deserialize(response, options); + throw new System.NotImplementedException(); + } - return dto; + public async Task GetCountOfVisitsAtStatus(string[] statuses) + { + throw new System.NotImplementedException(); } public async Task GetWithForm(int id, string formKind) @@ -37,6 +39,7 @@ public async Task PostWithForm(int id, string formKind, VisitDto dto) var response = await PostRequest($"{_BasePath}/{id}/Forms/{formKind}", json); } + } } diff --git a/src/UDS.Net.API/Controllers/PacketSubmissionsController.cs b/src/UDS.Net.API/Controllers/PacketSubmissionsController.cs deleted file mode 100644 index 188a7b1..0000000 --- a/src/UDS.Net.API/Controllers/PacketSubmissionsController.cs +++ /dev/null @@ -1,343 +0,0 @@ -using Microsoft.AspNetCore.Mvc; -using Microsoft.EntityFrameworkCore; -using UDS.Net.API.Client; -using UDS.Net.API.Data; -using UDS.Net.API.Entities; -using UDS.Net.API.Extensions; -using UDS.Net.Dto; - -namespace UDS.Net.API.Controllers -{ - [Route("api/[controller]")] - public class PacketSubmissionsController : Controller, IPacketSubmissionClient - { - private readonly ApiDbContext _context; - - public PacketSubmissionsController(ApiDbContext context) - { - _context = context; - } - - [HttpGet("Count", Name = "PacketSubmissionsCount")] - public async Task Count() - { - return await _context.PacketSubmissions - .CountAsync(); - } - - [HttpGet("Count/ByVisit/{visitId}", Name = "PacketSubmissionsCountByVisit")] - public async Task PacketSubmissionsCountByVisit(int visitId) - { - return await _context.PacketSubmissions - .Where(p => p.VisitId == visitId) - .CountAsync(); - } - - [HttpGet("Count/ByStatus/{packetStatus}", Name = "PacketSubmissionsCountByStatus")] - public async Task PacketSubmissionsCountByStatus(string packetStatus) - { - return await _context.PacketSubmissions - .Include(p => p.Visit) - .Where(p => p.Visit.Status.ToString() == packetStatus) - .CountAsync(); - } - - [HttpGet] - public async Task> Get(int pageSize = 10, int pageIndex = 1) - { - return await _context.PacketSubmissions - .Include(p => p.Visit) - .AsNoTracking() - .Skip((pageIndex - 1) * pageSize) - .Take(pageSize) - .Select(p => p.ToDto()) - .ToListAsync(); - } - - [HttpGet("ByVisit/{visitId}", Name = "GetPacketSubmissionByVisit")] - public async Task> GetPacketSubmissionsByVisit(int visitId, int pageSize = 10, int pageIndex = 1) - { - var dto = await _context.PacketSubmissions - .Include(p => p.Visit) - .Include(p => p.PacketSubmissionErrors) - .Where(p => p.VisitId == visitId) - .AsNoTracking() - .Skip((pageIndex - 1) * pageSize) - .Take(pageSize) - .Select(p => p.ToDto(p.PacketSubmissionErrors.Count())) - .ToListAsync(); - - return dto; - } - - [HttpGet("ByStatus/{packetStatus}", Name = "GetPacketSubmissionByStatus")] - public async Task> GetPacketSubmissionsByStatus(string packetStatus, int pageSize = 10, int pageIndex = 1) - { - var dto = await _context.PacketSubmissions - .Include(p => p.Visit) - .Where(p => p.Visit.Status.ToString() == packetStatus) - .AsNoTracking() - .Skip((pageIndex - 1) * pageSize) - .Take(pageSize) - .Select(p => p.ToDto()) - .ToListAsync(); - - return dto; - } - - [HttpGet("{id}")] - public async Task Get(int id) - { - var dto = await _context.PacketSubmissions - .Include(p => p.PacketSubmissionErrors) - .Where(p => p.Id == id) - .Select(p => p.ToDto()) - .FirstOrDefaultAsync(); - - return dto; - } - - [HttpGet("{id}/IncludeForms")] - public async Task GetPacketSubmissionWithForms(int id) - { - var dto = await _context.PacketSubmissions - .Where(p => p.Id == id) - .AsNoTracking() - .Select(p => p.ToDto()) - .FirstOrDefaultAsync(); - - if (dto != null) - { - var visit = await _context.Visits - .Include(v => v.A1) - .Include(v => v.A1a) - .Include(v => v.A2) - .Include(v => v.A3) - .Include(v => v.A4) - .Include(v => v.A4a) - .Include(v => v.A5D2) - .Include(v => v.B1) - .Include(v => v.B3) - .Include(v => v.B4) - .Include(v => v.B5) - .Include(v => v.B6) - .Include(v => v.B7) - .Include(v => v.B8) - .Include(v => v.B9) - .Include(v => v.C2) - .Include(v => v.D1a) - .Include(v => v.D1b) - .Where(v => v.Id == dto.VisitId) - .AsNoTracking() - .FirstOrDefaultAsync(); - - if (visit != null) - { - dto.Forms = new PacketSubmissionFormsDto(); - dto.Forms.Period = DateTime.Now; // TODO implement temporality with dto.CreatedAt - - dto.Forms.Add(visit.A1.ToFullDto()); - dto.Forms.Add(visit.A1a.ToFullDto()); - dto.Forms.Add(visit.A2.ToFullDto()); - dto.Forms.Add(visit.A3.ToFullDto()); - dto.Forms.Add(visit.A4.ToFullDto()); - dto.Forms.Add(visit.A4a.ToFullDto()); - dto.Forms.Add(visit.A5D2.ToFullDto()); - dto.Forms.Add(visit.B1.ToFullDto()); - dto.Forms.Add(visit.B3.ToFullDto()); - dto.Forms.Add(visit.B4.ToFullDto()); - dto.Forms.Add(visit.B5.ToFullDto()); - dto.Forms.Add(visit.B6.ToFullDto()); - dto.Forms.Add(visit.B7.ToFullDto()); - dto.Forms.Add(visit.B8.ToFullDto()); - dto.Forms.Add(visit.B9.ToFullDto()); - dto.Forms.Add(visit.C2.ToFullDto()); - dto.Forms.Add(visit.D1a.ToFullDto()); - dto.Forms.Add(visit.D1b.ToFullDto()); - } - } - - return dto; - } - - [HttpPost] - public async Task Post(PacketSubmissionDto dto) - { - var packetSubmission = dto.Convert(); - - _context.PacketSubmissions.Add(packetSubmission); - - await _context.SaveChangesAsync(); - } - - [HttpPut("{id}")] - public async Task Put(int id, [FromBody] PacketSubmissionDto dto) - { - if (dto != null) - { - var existingSubmission = await _context.PacketSubmissions - .Include(p => p.PacketSubmissionErrors) - .Where(p => p.Id == id) - .FirstOrDefaultAsync(); - - if (existingSubmission != null) - { - existingSubmission.SubmissionDate = dto.SubmissionDate; - existingSubmission.ModifiedBy = dto.ModifiedBy; - - _context.PacketSubmissions.Update(existingSubmission); - await _context.SaveChangesAsync(); - } - } - } - - [HttpDelete("{id}")] - public async Task Delete(int id) - { - var existingSubmission = await _context.PacketSubmissions - .Include(p => p.PacketSubmissionErrors) - .Where(p => p.Id == id) - .FirstOrDefaultAsync(); - - if (existingSubmission != null) - { - _context.PacketSubmissions.Remove(existingSubmission); - await _context.SaveChangesAsync(); - } - } - - [HttpGet("Errors/Count", Name = "PacketSubmissionErrorsCount")] - public async Task PacketSubmissionErrorsCount(bool includeResolved = false) - { - if (includeResolved) - { - return await _context.PacketSubmissionErrors - .Where(e => String.IsNullOrWhiteSpace(e.ResolvedBy) == false) - .CountAsync(); - } - else - { - return await _context.PacketSubmissionErrors - .CountAsync(); - } - } - - [HttpGet("Errors/Count/ByVisit/{visitId}", Name = "PacketSubmissionErrorsCountByVisit")] - public async Task PacketSubmissionsErrorsCountByVisit(int visitId) - { - return await _context.PacketSubmissionErrors - .Include(e => e.PacketSubmission) - .Where(e => e.PacketSubmission.VisitId == visitId) - .CountAsync(); - } - - [HttpGet("Errors/Count/ByAssignee/{assignedTo}", Name = "PacketSubmissionErrorsCountByAssignee")] - public async Task PacketSubmissionsErrorsCountByAssignee(string assignedTo) - { - return await _context.PacketSubmissionErrors - .Where(e => e.AssignedTo.ToLower().Trim() == assignedTo.ToLower().Trim()) - .CountAsync(); - } - - [HttpGet("Errors", Name = "GetPacketSubmissionErrors")] - public async Task> GetPacketSubmissionErrors(bool includeResolved = false, int pageSize = 10, int pageIndex = 1) - { - if (includeResolved) - { - return await _context.PacketSubmissionErrors - .Where(e => String.IsNullOrWhiteSpace(e.ResolvedBy) == false) - .AsNoTracking() - .Skip((pageIndex - 1) * pageSize) - .Take(pageSize) - .Select(p => p.ToDto()) - .ToListAsync(); - } - else - { - return await _context.PacketSubmissionErrors - .AsNoTracking() - .Skip((pageIndex - 1) * pageSize) - .Take(pageSize) - .Select(p => p.ToDto()) - .ToListAsync(); - } - } - - [HttpGet("Errors/ByVisit/{visitId}", Name = "GetPacketSubmissionErrorsByVisit")] - public async Task> GetPacketSubmissionErrorsByVisit(int visitId, int pageSize = 10, int pageIndex = 1) - { - return await _context.PacketSubmissionErrors - .Include(e => e.PacketSubmission) - .Where(e => e.PacketSubmission.VisitId == visitId) - .AsNoTracking() - .Skip((pageIndex - 1) * pageSize) - .Take(pageSize) - .Select(p => p.ToDto()) - .ToListAsync(); - } - - [HttpGet("Errors/ByAssignee/{assignedTo}", Name = "GetPacketSubmissionErrorsByAssignee")] - public async Task> GetPacketSubmissionErrorsByAssignee(string assignedTo, int pageSize = 10, int pageIndex = 1) - { - return await _context.PacketSubmissionErrors - .Where(e => e.AssignedTo.ToLower().Trim() == assignedTo.ToLower().Trim()) - .AsNoTracking() - .Skip((pageIndex - 1) * pageSize) - .Take(pageSize) - .Select(p => p.ToDto()) - .ToListAsync(); - } - - [HttpPost("{packetSubmissionId}/Errors", Name = "PostPacketSubmissionError")] - public async Task PostPacketSubmissionError(int packetSubmissionId, PacketSubmissionErrorDto dto) - { - var packetSubmission = await _context.PacketSubmissions - .Include(p => p.PacketSubmissionErrors) - .Where(p => p.Id == packetSubmissionId) - .FirstOrDefaultAsync(); - - if (packetSubmission != null) - { - var error = dto.Convert(); - - packetSubmission.PacketSubmissionErrors.Add(error); - - _context.PacketSubmissions.Update(packetSubmission); - await _context.SaveChangesAsync(); - } - } - - [HttpPut("{packetSubmissionId}/Errors/{id}", Name = "PutPacketSubmissionError")] - public async Task PutPacketSubmissionError(int packetSubmissionId, int id, PacketSubmissionErrorDto dto) - { - var packetSubmission = await _context.PacketSubmissions - .Include(p => p.PacketSubmissionErrors) - .Where(p => p.Id == packetSubmissionId) - .FirstOrDefaultAsync(); - - if (packetSubmission != null) - { - var existingError = packetSubmission.PacketSubmissionErrors.Where(e => e.Id == id).FirstOrDefault(); - - if (existingError != null) - { - if (!string.IsNullOrWhiteSpace(dto.Level)) - { - if (Enum.TryParse(dto.Level, true, out PacketSubmissionErrorLevel level)) - existingError.Level = level; - } - - existingError.FormKind = dto.FormKind; - existingError.AssignedTo = dto.AssignedTo; - existingError.ResolvedBy = dto.ResolvedBy; - existingError.Message = dto.Message; - existingError.ModifiedBy = dto.ModifiedBy; - existingError.IsDeleted = dto.IsDeleted; - existingError.DeletedBy = dto.DeletedBy; - } - } - } - - } -} - diff --git a/src/UDS.Net.API/Controllers/PacketsController.cs b/src/UDS.Net.API/Controllers/PacketsController.cs new file mode 100644 index 0000000..102fb3f --- /dev/null +++ b/src/UDS.Net.API/Controllers/PacketsController.cs @@ -0,0 +1,431 @@ +using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; +using UDS.Net.API.Client; +using UDS.Net.API.Data; +using UDS.Net.API.Entities; +using UDS.Net.API.Extensions; +using UDS.Net.Dto; + +namespace UDS.Net.API.Controllers +{ + /// + /// A packet is a visit that is not pending (finalized or after) + /// + [Route("api/[controller]")] + public class PacketsController : Controller, IPacketClient + { + private readonly ApiDbContext _context; + + public PacketsController(ApiDbContext context) + { + _context = context; + } + + [HttpGet("Count", Name = "PacketsCount")] + public async Task Count() + { + return await _context.Visits + .Where(v => v.Status != PacketStatus.Pending) + .CountAsync(); + } + + /// + /// Returns visits that are finalized or after + /// + /// + /// + /// + [HttpGet] + public async Task> Get(int pageSize = 10, int pageIndex = 1) + { + return await _context.Visits + .Include(v => v.PacketSubmissions) + .ThenInclude(p => p.PacketSubmissionErrors) + .AsNoTracking() + .Where(v => v.Status != PacketStatus.Pending) + .Skip((pageIndex - 1) * pageSize) + .Take(pageSize) + .Select(p => p.ToPacketDto()) + .ToListAsync(); + + } + + [HttpGet("{id}")] + public async Task Get(int id) + { + var dto = await _context.Visits + .Include(v => v.PacketSubmissions) + .ThenInclude(p => p.PacketSubmissionErrors) + .Where(v => v.Id == id) + .Select(v => v.ToPacketDto()) + .FirstOrDefaultAsync(); + + return dto; + } + + [HttpGet("{id}/IncludeForms")] + public async Task GetPacketWithForms(int id) + { + var dto = await _context.Visits + .Include(v => v.PacketSubmissions) + .ThenInclude(p => p.PacketSubmissionErrors) + .Where(v => v.Id == id) + .AsNoTracking() + .Select(v => v.ToPacketDto()) + .FirstOrDefaultAsync(); + + if (dto != null) + { + var visit = await _context.Visits + .Include(v => v.A1) + .Include(v => v.A1a) + .Include(v => v.A2) + .Include(v => v.A3) + .Include(v => v.A4) + .Include(v => v.A4a) + .Include(v => v.A5D2) + .Include(v => v.B1) + .Include(v => v.B3) + .Include(v => v.B4) + .Include(v => v.B5) + .Include(v => v.B6) + .Include(v => v.B7) + .Include(v => v.B8) + .Include(v => v.B9) + .Include(v => v.C2) + .Include(v => v.D1a) + .Include(v => v.D1b) + .Where(v => v.Id == id) + .AsNoTracking() + .FirstOrDefaultAsync(); + + if (dto.PacketSubmissions != null && dto.PacketSubmissions.Count() > 0) + { + // TODO implement temporality so that older versions can be pulled + foreach (var submission in dto.PacketSubmissions) + { + submission.Forms.Add(visit.A1.ToFullDto()); + submission.Forms.Add(visit.A1a.ToFullDto()); + submission.Forms.Add(visit.A2.ToFullDto()); + submission.Forms.Add(visit.A3.ToFullDto()); + submission.Forms.Add(visit.A4.ToFullDto()); + submission.Forms.Add(visit.A4a.ToFullDto()); + submission.Forms.Add(visit.A5D2.ToFullDto()); + submission.Forms.Add(visit.B1.ToFullDto()); + submission.Forms.Add(visit.B3.ToFullDto()); + submission.Forms.Add(visit.B4.ToFullDto()); + submission.Forms.Add(visit.B5.ToFullDto()); + submission.Forms.Add(visit.B6.ToFullDto()); + submission.Forms.Add(visit.B7.ToFullDto()); + submission.Forms.Add(visit.B8.ToFullDto()); + submission.Forms.Add(visit.B9.ToFullDto()); + submission.Forms.Add(visit.C2.ToFullDto()); + submission.Forms.Add(visit.D1a.ToFullDto()); + submission.Forms.Add(visit.D1b.ToFullDto()); + } + } + } + + return dto; + } + + /// + /// Packets are not created, visits are the initial object + /// + /// + /// + /// + [HttpPost] + public async Task Post(PacketDto dto) + { + throw new NotImplementedException("Packets are not created, use Visits."); + } + + /// + /// Put updates the status of the visit, packet submissions, and errors + /// + /// + /// + /// + [HttpPut("{id}")] + public async Task Put(int id, [FromBody] PacketDto dto) + { + if (dto != null) + { + var existingPacket = await _context.Visits + .Include(v => v.PacketSubmissions) + .ThenInclude(p => p.PacketSubmissionErrors) + .Where(p => p.Id == id) + .FirstOrDefaultAsync(); + + if (existingPacket != null) + { + existingPacket.Status = dto.Status.Convert(); + existingPacket.ModifiedBy = dto.ModifiedBy; + + // iterate dto submissions, see if there are any new + + // see if there are any updates to existing + + // iterate dto errors, see if there are any new + + _context.Visits.Update(existingPacket); + await _context.SaveChangesAsync(); + } + } + } + + [HttpDelete("{id}")] + public async Task Delete(int id) + { + throw new NotImplementedException(); + } + + [HttpGet("Count/ByStatus/{status}", Name = "PacketsCountByStatusAndAssignee")] + public async Task CountByStatusAndAssignee(string[] statuses, string assignedTo) + { + if (string.IsNullOrWhiteSpace(assignedTo)) + { + return await _context.Visits + .Where(v => EF.Constant(statuses).Contains(v.Status.ToString())) + .CountAsync(); + } + else + { + var visitsAtStatus = await _context.Visits + .Include(v => v.PacketSubmissions) + .ThenInclude(p => p.PacketSubmissionErrors) + .Where(v => EF.Constant(statuses).Contains(v.Status.ToString())) + .ToListAsync(); + + int count = 0; + + foreach (var visit in visitsAtStatus) + { + bool assigneeAssignedToThisVisit = false; + foreach (var submission in visit.PacketSubmissions) + { + if (submission.PacketSubmissionErrors.Any(p => String.IsNullOrWhiteSpace(p.ResolvedBy) == true && p.AssignedTo == assignedTo)) + assigneeAssignedToThisVisit = true; + } + if (assigneeAssignedToThisVisit) + count++; + } + + return count; + } + } + + [HttpGet("ByStatus/{status}", Name = "GetPacketsByStatusAndAssignee")] + public async Task> GetPacketsByStatusAndAssignee(string[] statuses, string assignedTo, int pageSize = 10, int pageIndex = 1) + { + var dto = new List(); + if (string.IsNullOrWhiteSpace(assignedTo)) + { + dto = await _context.Visits + .Include(v => v.PacketSubmissions) + .ThenInclude(p => p.PacketSubmissionErrors) + .Where(v => EF.Constant(statuses).Contains(v.Status.ToString())) + .AsNoTracking() + .Skip((pageIndex - 1) * pageSize) + .Take(pageSize) + .Select(p => p.ToPacketDto()) + .ToListAsync(); + } + else + { + var visitsAtStatus = await _context.Visits + .Include(v => v.PacketSubmissions) + .ThenInclude(p => p.PacketSubmissionErrors) + .Where(v => EF.Constant(statuses).Contains(v.Status.ToString())) + .ToListAsync(); + + foreach (var visit in visitsAtStatus) + { + bool assigneeAssignedToThisVisit = false; + foreach (var submission in visit.PacketSubmissions) + { + if (submission.PacketSubmissionErrors.Any(p => String.IsNullOrWhiteSpace(p.ResolvedBy) == true && p.AssignedTo == assignedTo)) + assigneeAssignedToThisVisit = true; + } + + if (assigneeAssignedToThisVisit) + { + dto.Add(visit.ToPacketDto()); + } + } + } + + return dto; + } + + + + + + + + + //[HttpGet("ByVisit/{visitId}", Name = "GetPacketSubmissionByVisit")] + //public async Task> GetPacketSubmissionsByVisit(int visitId, int pageSize = 10, int pageIndex = 1) + //{ + // var dto = await _context.PacketSubmissions + // .Include(p => p.Visit) + // .Include(p => p.PacketSubmissionErrors) + // .Where(p => p.VisitId == visitId) + // .AsNoTracking() + // .Skip((pageIndex - 1) * pageSize) + // .Take(pageSize) + // .Select(p => p.ToDto(p.PacketSubmissionErrors.Count())) + // .ToListAsync(); + + // return dto; + //} + + + //[HttpGet("Errors/Count", Name = "PacketSubmissionErrorsCount")] + //public async Task PacketSubmissionErrorsCount(bool includeResolved = false) + //{ + // if (includeResolved) + // { + // return await _context.PacketSubmissionErrors + // .Where(e => String.IsNullOrWhiteSpace(e.ResolvedBy) == false) + // .CountAsync(); + // } + // else + // { + // return await _context.PacketSubmissionErrors + // .CountAsync(); + // } + //} + + //[HttpGet("Errors/Count/ByVisit/{visitId}", Name = "PacketSubmissionErrorsCountByVisit")] + //public async Task PacketSubmissionsErrorsCountByVisit(int visitId) + //{ + // return await _context.PacketSubmissions + // .Where(e => e.VisitId == visitId) + // .Select(p => p.ErrorCount) + // .FirstOrDefaultAsync(); + //} + + //[HttpGet("Errors/Count/ByAssignee/{assignedTo}", Name = "PacketSubmissionErrorsCountByAssignee")] + //public async Task PacketSubmissionsErrorsCountByAssignee(string assignedTo) + //{ + // return await _context.PacketSubmissionErrors + // .Where(e => e.AssignedTo.ToLower().Trim() == assignedTo.ToLower().Trim()) + // .CountAsync(); + //} + + //[HttpGet("Errors", Name = "GetPacketSubmissionErrors")] + //public async Task> GetPacketSubmissionErrors(bool includeResolved = false, int pageSize = 10, int pageIndex = 1) + //{ + // if (includeResolved) + // { + // return await _context.PacketSubmissionErrors + // .Where(e => String.IsNullOrWhiteSpace(e.ResolvedBy) == false) + // .AsNoTracking() + // .Skip((pageIndex - 1) * pageSize) + // .Take(pageSize) + // .Select(p => p.ToDto()) + // .ToListAsync(); + // } + // else + // { + // return await _context.PacketSubmissionErrors + // .AsNoTracking() + // .Skip((pageIndex - 1) * pageSize) + // .Take(pageSize) + // .Select(p => p.ToDto()) + // .ToListAsync(); + // } + //} + + //[HttpGet("Errors/ByVisit/{visitId}", Name = "GetPacketSubmissionErrorsByVisit")] + //public async Task> GetPacketSubmissionErrorsByVisit(int visitId, int pageSize = 10, int pageIndex = 1) + //{ + // return await _context.PacketSubmissionErrors + // .Include(e => e.PacketSubmission) + // .Where(e => e.PacketSubmission.VisitId == visitId) + // .AsNoTracking() + // .Skip((pageIndex - 1) * pageSize) + // .Take(pageSize) + // .Select(p => p.ToDto()) + // .ToListAsync(); + //} + + //[HttpGet("Errors/ByAssignee/{assignedTo}", Name = "GetPacketSubmissionErrorsByAssignee")] + //public async Task> GetPacketSubmissionErrorsByAssignee(string assignedTo, int pageSize = 10, int pageIndex = 1) + //{ + // return await _context.PacketSubmissionErrors + // .Where(e => e.AssignedTo.ToLower().Trim() == assignedTo.ToLower().Trim()) + // .AsNoTracking() + // .Skip((pageIndex - 1) * pageSize) + // .Take(pageSize) + // .Select(p => p.ToDto()) + // .ToListAsync(); + //} + + //[HttpPost("{packetSubmissionId}/Errors", Name = "PostPacketSubmissionError")] + //public async Task PostPacketSubmissionError(int packetSubmissionId, PacketSubmissionErrorDto dto) + //{ + // var packetSubmission = await _context.PacketSubmissions + // .Include(p => p.PacketSubmissionErrors) + // .Where(p => p.Id == packetSubmissionId) + // .FirstOrDefaultAsync(); + + // if (packetSubmission != null) + // { + // var error = dto.Convert(); + + // packetSubmission.PacketSubmissionErrors.Add(error); + // packetSubmission.ErrorCount += 1; + + // _context.PacketSubmissions.Update(packetSubmission); + // await _context.SaveChangesAsync(); + // } + //} + + //[HttpPut("{packetSubmissionId}/Errors/{id}", Name = "PutPacketSubmissionError")] + //public async Task PutPacketSubmissionError(int packetSubmissionId, int id, PacketSubmissionErrorDto dto) + //{ + // var packetSubmission = await _context.PacketSubmissions + // .Include(p => p.PacketSubmissionErrors) + // .Where(p => p.Id == packetSubmissionId) + // .FirstOrDefaultAsync(); + + // if (packetSubmission != null) + // { + // var existingError = packetSubmission.PacketSubmissionErrors.Where(e => e.Id == id).FirstOrDefault(); + + // if (existingError != null) + // { + // if (!string.IsNullOrWhiteSpace(dto.Level)) + // { + // if (Enum.TryParse(dto.Level, true, out PacketSubmissionErrorLevel level)) + // existingError.Level = level; + // } + + // existingError.FormKind = dto.FormKind; + // existingError.AssignedTo = dto.AssignedTo; + // existingError.ResolvedBy = dto.ResolvedBy; + // existingError.Message = dto.Message; + // existingError.ModifiedBy = dto.ModifiedBy; + + // if (dto.IsDeleted) + // { + // existingError.IsDeleted = dto.IsDeleted; + // existingError.DeletedBy = dto.DeletedBy; + // if (packetSubmission.ErrorCount > 1) + // packetSubmission.ErrorCount -= 1; + // } + // } + // } + //} + + //Task IPacketSubmissionClient.PacketSubmissionsErrorsCountByVisit(int visitId) + //{ + // throw new NotImplementedException(); + //} + } +} + diff --git a/src/UDS.Net.API/Controllers/VisitsController.cs b/src/UDS.Net.API/Controllers/VisitsController.cs index 86d0700..cd450c9 100644 --- a/src/UDS.Net.API/Controllers/VisitsController.cs +++ b/src/UDS.Net.API/Controllers/VisitsController.cs @@ -218,6 +218,31 @@ private async Task Get(int id, string formKind) return null; } + private async Task> Get(string[] statuses, int pageSize = 10, int pageIndex = 1) + { + var dto = new List(); + if (statuses == null || statuses.Count() == 0) + { + + } + else + { + dto = await _context.Visits + .Include(v => v.PacketSubmissions) + .ThenInclude(p => p.PacketSubmissionErrors) + .AsNoTracking() + .Where(v => EF.Constant(statuses).Contains(v.Status.ToString())) + .Skip((pageIndex - 1) * pageSize) + .Take(pageSize) + .Select(v => v.ToDto()) + .ToListAsync(); + + + } + + return dto; + } + [HttpGet] public async Task> Get(int pageSize = 10, int pageIndex = 1) { @@ -235,48 +260,68 @@ public async Task Count() return await _context.Visits.CountAsync(); } - [HttpGet("{id}")] - public async Task Get(int id) + [HttpGet("ByStatus/{status}")] + public async Task> GetVisitsAtStatus(string[] statuses, int pageSize = 10, int pageIndex = 1) { - var dto = await _context.Visits - .Include(v => v.FormStatuses) - .Where(v => v.Id == id) - .Select(v => v.ToDto()) - .FirstOrDefaultAsync(); + if (statuses == null || statuses.Count() == 0) + return new List(); - dto.PacketSubmissionCount = await _context.PacketSubmissions - .Where(p => p.VisitId == id) - .CountAsync(); + var dto = new List(); return dto; } - [HttpGet("{id}/WithPacketSubmissions", Name = "GetWithPacketSubmissions")] - public async Task GetWithPacketSubmissions(int id, int pageSize = 10, int pageIndex = 1) + [HttpGet("Count/ByStatus/{status}")] + public async Task GetCountOfVisitsAtStatus(string[] statuses) + { + if (statuses == null || statuses.Count() == 0) + return 0; + + return await _context.Visits + .Where(v => statuses.Contains(v.Status.ToString())) + .CountAsync(); + } + + + + [HttpGet("{id}")] + public async Task Get(int id) { var dto = await _context.Visits .Include(v => v.FormStatuses) - .AsNoTracking() .Where(v => v.Id == id) .Select(v => v.ToDto()) .FirstOrDefaultAsync(); - var packetSubmissions = await _context.PacketSubmissions - .Include(p => p.PacketSubmissionErrors) - .AsNoTracking() - .Skip((pageIndex - 1) * pageSize) - .Take(pageSize) - .Select(v => v.ToDto()) - .ToListAsync(); - - dto.PacketSubmissions = packetSubmissions; - dto.PacketSubmissionCount = await _context.PacketSubmissions - .Where(p => p.VisitId == id) - .CountAsync(); - return dto; } + //[HttpGet("{id}/WithPacketSubmissions", Name = "GetWithPacketSubmissions")] + //public async Task GetWithPacketSubmissions(int id, int pageSize = 10, int pageIndex = 1) + //{ + // var dto = await _context.Visits + // .Include(v => v.FormStatuses) + // .AsNoTracking() + // .Where(v => v.Id == id) + // .Select(v => v.ToDto()) + // .FirstOrDefaultAsync(); + + // var packetSubmissions = await _context.PacketSubmissions + // .Include(p => p.PacketSubmissionErrors) + // .AsNoTracking() + // .Skip((pageIndex - 1) * pageSize) + // .Take(pageSize) + // .Select(v => v.ToDto()) + // .ToListAsync(); + + // dto.PacketSubmissions = packetSubmissions; + // dto.PacketSubmissionCount = await _context.PacketSubmissions + // .Where(p => p.VisitId == id) + // .CountAsync(); + + // return dto; + //} + [HttpGet("{id}/Forms/{formKind}", Name = "GetWithForm")] public async Task GetWithForm(int id, string formKind) { diff --git a/src/UDS.Net.API/Data/Migrations/20240814181754_SupportPacketSubmission.Designer.cs b/src/UDS.Net.API/Data/Migrations/20240814181754_SupportPacketSubmission.Designer.cs deleted file mode 100644 index 58d1bf7..0000000 --- a/src/UDS.Net.API/Data/Migrations/20240814181754_SupportPacketSubmission.Designer.cs +++ /dev/null @@ -1,8920 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using UDS.Net.API.Data; - -#nullable disable - -namespace UDS.Net.API.Data.Migrations -{ - [DbContext(typeof(ApiDbContext))] - [Migration("20240814181754_SupportPacketSubmission")] - partial class SupportPacketSubmission - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "7.0.5") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); - - modelBuilder.Entity("UDS.Net.API.Entities.A1", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasColumnName("FormId") - .HasColumnOrder(0); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("ADINAT") - .HasColumnType("int"); - - b.Property("ADISTATE") - .HasColumnType("int"); - - b.Property("BIRTHMO") - .HasColumnType("int"); - - b.Property("BIRTHSEX") - .HasColumnType("int"); - - b.Property("BIRTHYR") - .HasColumnType("int"); - - b.Property("CHLDHDCTRY") - .HasMaxLength(3) - .HasColumnType("nvarchar(3)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("DeletedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("EDUC") - .HasColumnType("int"); - - b.Property("ETHAFAMER") - .HasColumnType("int"); - - b.Property("ETHASNOTH") - .HasColumnType("int"); - - b.Property("ETHASNOTHX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.Property("ETHBLKOTH") - .HasColumnType("int"); - - b.Property("ETHBLKOTHX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.Property("ETHCHAMOR") - .HasColumnType("int"); - - b.Property("ETHCHINESE") - .HasColumnType("int"); - - b.Property("ETHCUBAN") - .HasColumnType("int"); - - b.Property("ETHDOMIN") - .HasColumnType("int"); - - b.Property("ETHEGYPT") - .HasColumnType("int"); - - b.Property("ETHENGLISH") - .HasColumnType("int"); - - b.Property("ETHETHIOP") - .HasColumnType("int"); - - b.Property("ETHFIJIAN") - .HasColumnType("int"); - - b.Property("ETHFILIP") - .HasColumnType("int"); - - b.Property("ETHGERMAN") - .HasColumnType("int"); - - b.Property("ETHGUATEM") - .HasColumnType("int"); - - b.Property("ETHHAITIAN") - .HasColumnType("int"); - - b.Property("ETHHAWAII") - .HasColumnType("int"); - - b.Property("ETHHISOTH") - .HasColumnType("int"); - - b.Property("ETHHISOTHX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.Property("ETHINDIA") - .HasColumnType("int"); - - b.Property("ETHIRAN") - .HasColumnType("int"); - - b.Property("ETHIRAQI") - .HasColumnType("int"); - - b.Property("ETHIRISH") - .HasColumnType("int"); - - b.Property("ETHISPANIC") - .HasColumnType("int"); - - b.Property("ETHISRAEL") - .HasColumnType("int"); - - b.Property("ETHITALIAN") - .HasColumnType("int"); - - b.Property("ETHJAMAICA") - .HasColumnType("int"); - - b.Property("ETHJAPAN") - .HasColumnType("int"); - - b.Property("ETHKOREAN") - .HasColumnType("int"); - - b.Property("ETHLEBANON") - .HasColumnType("int"); - - b.Property("ETHMARSHAL") - .HasColumnType("int"); - - b.Property("ETHMENAOTH") - .HasColumnType("int"); - - b.Property("ETHMENAOTX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.Property("ETHMEXICAN") - .HasColumnType("int"); - - b.Property("ETHNHPIOTH") - .HasColumnType("int"); - - b.Property("ETHNHPIOTX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.Property("ETHNIGERIA") - .HasColumnType("int"); - - b.Property("ETHPOLISH") - .HasColumnType("int"); - - b.Property("ETHPUERTO") - .HasColumnType("int"); - - b.Property("ETHSALVA") - .HasColumnType("int"); - - b.Property("ETHSAMOAN") - .HasColumnType("int"); - - b.Property("ETHSCOTT") - .HasColumnType("int"); - - b.Property("ETHSOMALI") - .HasColumnType("int"); - - b.Property("ETHSYRIA") - .HasColumnType("int"); - - b.Property("ETHTONGAN") - .HasColumnType("int"); - - b.Property("ETHVIETNAM") - .HasColumnType("int"); - - b.Property("ETHWHIOTH") - .HasColumnType("int"); - - b.Property("ETHWHIOTHX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.Property("EXRTIME") - .HasColumnType("int"); - - b.Property("FRMDATE") - .HasColumnType("datetime2") - .HasColumnName("FRMDATE") - .HasColumnOrder(3); - - b.Property("GENDKN") - .HasColumnType("int"); - - b.Property("GENMAN") - .HasColumnType("int"); - - b.Property("GENNOANS") - .HasColumnType("int"); - - b.Property("GENNONBI") - .HasColumnType("int"); - - b.Property("GENOTH") - .HasColumnType("int"); - - b.Property("GENOTHX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.Property("GENTRMAN") - .HasColumnType("int"); - - b.Property("GENTRWOMAN") - .HasColumnType("int"); - - b.Property("GENTWOSPIR") - .HasColumnType("int"); - - b.Property("GENWOMAN") - .HasColumnType("int"); - - b.Property("HANDED") - .HasColumnType("int"); - - b.Property("INITIALS") - .IsRequired() - .HasMaxLength(3) - .HasColumnType("nvarchar(3)") - .HasColumnName("INITIALS") - .HasColumnOrder(4); - - b.Property("INTERSEX") - .HasColumnType("int"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("LANG") - .HasColumnType("int") - .HasColumnName("LANG") - .HasColumnOrder(5); - - b.Property("LIVSITUA") - .HasColumnType("int"); - - b.Property("LVLEDUC") - .HasColumnType("int"); - - b.Property("MARISTAT") - .HasColumnType("int"); - - b.Property("MEDVA") - .HasColumnType("int"); - - b.Property("MEMTEN") - .HasColumnType("int"); - - b.Property("MEMTROUB") - .HasColumnType("int"); - - b.Property("MEMWORS") - .HasColumnType("int"); - - b.Property("MODE") - .HasColumnType("int") - .HasColumnName("MODE") - .HasColumnOrder(6); - - b.Property("ModifiedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("NOT") - .HasColumnType("int") - .HasColumnName("NOT") - .HasColumnOrder(9); - - b.Property("PREDOMLAN") - .HasColumnType("int"); - - b.Property("PREDOMLANX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.Property("PRIOCC") - .HasColumnType("int"); - - b.Property("RACEAIAN") - .HasColumnType("int"); - - b.Property("RACEAIANX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.Property("RACEASIAN") - .HasColumnType("int"); - - b.Property("RACEBLACK") - .HasColumnType("int"); - - b.Property("RACEMENA") - .HasColumnType("int"); - - b.Property("RACENHPI") - .HasColumnType("int"); - - b.Property("RACEUNKN") - .HasColumnType("int"); - - b.Property("RACEWHITE") - .HasColumnType("int"); - - b.Property("REFCTRREGX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.Property("REFCTRSOCX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.Property("REFERSC") - .HasColumnType("int"); - - b.Property("REFERSCX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.Property("REFLEARNED") - .HasColumnType("int"); - - b.Property("REFOTHMEDX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.Property("REFOTHREGX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.Property("REFOTHWEBX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.Property("REFOTHX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.Property("RESIDENC") - .HasColumnType("int"); - - b.Property("RMMODE") - .HasColumnType("int") - .HasColumnName("RMMODE") - .HasColumnOrder(8); - - b.Property("RMREAS") - .HasColumnType("int") - .HasColumnName("RMREASON") - .HasColumnOrder(7); - - b.Property("SERVED") - .HasColumnType("int"); - - b.Property("SEXORNBI") - .HasColumnType("int"); - - b.Property("SEXORNDNK") - .HasColumnType("int"); - - b.Property("SEXORNGAY") - .HasColumnType("int"); - - b.Property("SEXORNHET") - .HasColumnType("int"); - - b.Property("SEXORNNOAN") - .HasColumnType("int"); - - b.Property("SEXORNOTH") - .HasColumnType("int"); - - b.Property("SEXORNOTHX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.Property("SEXORNTWOS") - .HasColumnType("int"); - - b.Property("SOURCENW") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("nvarchar(20)") - .HasColumnOrder(2); - - b.Property("VisitId") - .HasColumnType("int") - .HasColumnOrder(1); - - b.Property("ZIP") - .HasMaxLength(3) - .HasColumnType("nvarchar(3)"); - - b.HasKey("Id"); - - b.HasIndex("VisitId") - .IsUnique(); - - b.ToTable("tbl_A1s"); - }); - - modelBuilder.Entity("UDS.Net.API.Entities.A1a", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasColumnName("FormId") - .HasColumnOrder(0); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("ABANDONED") - .HasColumnType("int") - .HasComment("21. I often feel abandoned"); - - b.Property("ACTAFRAID") - .HasColumnType("int") - .HasComment("36. In your day-to-day life how often do people act as if they are afraid of you?"); - - b.Property("BILLPAY") - .HasColumnType("int") - .HasComment("9. How difficult is it for you to meet monthly payments on your bills?"); - - b.Property("CHILDCOMM") - .HasColumnType("int") - .HasComment("24. If you have children, how often do you have contact with your children (including child[ren]-in-law and stepchild[ren]) either in person, by phone, mail, or email (e.g., any online interaction)?"); - - b.Property("CLOSEFRND") - .HasColumnType("int") - .HasComment("22. I miss having a really good friend"); - - b.Property("COMPCOMM") - .HasColumnType("int") - .HasComment("15a. Where would you place yourself on this ladder compared to others in your community (or neighborhood)? Please mark the number where you would place yourself."); - - b.Property("COMPUSA") - .HasColumnType("int") - .HasComment("15b. Where would you place yourself on this ladder compared to others in the U.S.?"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("DELAYMED") - .HasColumnType("int") - .HasComment("28. In the past year, how often did you delay seeking medical attention for a problem that was bothering you?"); - - b.Property("DOCADVICE") - .HasColumnType("int") - .HasComment("31. In the past year, how often did you follow a doctor's advice or treatment plan when it was given?"); - - b.Property("DeletedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("EATLESS") - .HasColumnType("int") - .HasComment("11. At any time, did you ever eat less than you felt you should because there wasn't enough money to buy food?"); - - b.Property("EATLESSYR") - .HasColumnType("int") - .HasComment("12. In the last 12 months, did you ever eat less than you felt you should because there wasn't enough money to buy food?"); - - b.Property("EMPTINESS") - .HasColumnType("int") - .HasComment("18. I experience a general sense of emptiness"); - - b.Property("EXPAGE") - .HasColumnType("bit") - .HasComment("39a4. Main reason--Your age"); - - b.Property("EXPANCEST") - .HasColumnType("bit") - .HasComment("39a1. Main reason--Your Ancestry or National Origins"); - - b.Property("EXPAPPEAR") - .HasColumnType("bit") - .HasComment("39a8. Main reason--Some other aspect of your physical appearance"); - - b.Property("EXPDISAB") - .HasColumnType("bit") - .HasComment("39a11. Main reason--A physical disability"); - - b.Property("EXPEDUCINC") - .HasColumnType("bit") - .HasComment("39a10. Main reason--Your education or income level"); - - b.Property("EXPGENDER") - .HasColumnType("bit") - .HasComment("39a2. Main reason--Your gender"); - - b.Property("EXPHEIGHT") - .HasColumnType("bit") - .HasComment("39a6. Main reason--Your height"); - - b.Property("EXPNOANS") - .HasColumnType("bit") - .HasComment("39a15. Main reason--Prefer not to answer"); - - b.Property("EXPNOTAPP") - .HasColumnType("bit") - .HasComment("39a14. Main reason -- not applicable - I do not have these experiences in my day to day life"); - - b.Property("EXPOTHER") - .HasColumnType("bit") - .HasComment("39a13. Main reason -- Other"); - - b.Property("EXPRACE") - .HasColumnType("bit") - .HasComment("39a3. Main reason--Your race"); - - b.Property("EXPRELIG") - .HasColumnType("bit") - .HasComment("39a5. Main reason--Your religion"); - - b.Property("EXPSEXORN") - .HasColumnType("bit") - .HasComment("39a9. Main reason--Your sexual orientation"); - - b.Property("EXPSKIN") - .HasColumnType("bit") - .HasComment("39a12. Main reason--Your shade of skin color"); - - b.Property("EXPSTRS") - .HasColumnType("int") - .HasComment("40. When you have had day-to-day experiences like those in questions 33 to 38, would you say they have been very stressful, moderately stressful, or not stressful?"); - - b.Property("EXPWEIGHT") - .HasColumnType("bit") - .HasComment("39a7. Main reason--Your weight"); - - b.Property("FAMCOMP") - .HasColumnType("int") - .HasComment("15c. Thinking of your childhood, where would your family have been placed on this ladder compared to others in your community (or neighborhood)?"); - - b.Property("FINSATIS") - .HasColumnType("int") - .HasComment("8. How satisfied are you with your current personal financial condition?"); - - b.Property("FINUPSET") - .HasColumnType("int") - .HasComment("10. If you have had financial problems that lasted twelve months or longer, how upsetting has it been to you?"); - - b.Property("FRIENDCOMM") - .HasColumnType("int") - .HasComment("25. How often do you have contact with close friends either in person, by phone, mail, or email (e.g., any online interaction)?"); - - b.Property("FRIENDS") - .HasColumnType("int") - .HasComment("20. I feel like I don't have enough friends"); - - b.Property("FRMDATE") - .HasColumnType("datetime2") - .HasColumnName("FRMDATE") - .HasColumnOrder(3); - - b.Property("GUARD2EDU") - .HasColumnType("int") - .HasComment("17. If there was a second person who raised you (e.g., your mother, father, grandmother, etc.?), what was that person's highest level of education completed?"); - - b.Property("GUARD2REL") - .HasColumnType("int") - .HasComment("17a. What was this second person's relationship to you (if applicable)?"); - - b.Property("GUARD2RELX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)") - .HasComment("17a1. Specify other relationship"); - - b.Property("GUARDEDU") - .HasColumnType("int") - .HasComment("16. Thinking of the person who raised you, what was their highest level of education completed?"); - - b.Property("GUARDREL") - .HasColumnType("int") - .HasComment("16a. What was this person's relationship to you?"); - - b.Property("GUARDRELX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)") - .HasComment("16a1. Specify other relationship"); - - b.Property("HEALTHACC") - .HasColumnType("int") - .HasComment("32. Overall, which of these describes your health insurance, access to healthcare services, and access to medications?"); - - b.Property("INCOMEYR") - .HasColumnType("int") - .HasComment("7. Which of these income groups represents your household income for the past year? Include income from all sources such as wages, salaries, social security or retirement benefits, help from relatives, rent from property, and so forth."); - - b.Property("INITIALS") - .IsRequired() - .HasMaxLength(3) - .HasColumnType("nvarchar(3)") - .HasColumnName("INITIALS") - .HasColumnOrder(4); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("LANG") - .HasColumnType("int") - .HasColumnName("LANG") - .HasColumnOrder(5); - - b.Property("LESSCOURT") - .HasColumnType("int") - .HasComment("33. In your day-to-day life how often are you treated with less courtesy or respect than other people?"); - - b.Property("LESSMEDS") - .HasColumnType("int") - .HasComment("13. At any time, have you ended up taking less medication than was prescribed for you because of the cost?"); - - b.Property("LESSMEDSYR") - .HasColumnType("int") - .HasComment("14. In the last 12 months, have you ended up taking less medication than was prescribed for you because of the cost?"); - - b.Property("MISSEDFUP") - .HasColumnType("int") - .HasComment("30. In the past year, how often did you miss a follow-up medical appointment that was scheduled?"); - - b.Property("MISSPEOPLE") - .HasColumnType("int") - .HasComment("19. I miss having people around"); - - b.Property("MODE") - .HasColumnType("int") - .HasColumnName("MODE") - .HasColumnOrder(6); - - b.Property("ModifiedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("NOT") - .HasColumnType("int") - .HasColumnName("NOT") - .HasColumnOrder(9); - - b.Property("NOTSMART") - .HasColumnType("int") - .HasComment("35. In your day-to-day life how often do people act as if they think you are not smart?"); - - b.Property("OWNSCAR") - .HasColumnType("int") - .HasComment("1. Do you or someone in your household currently own a car?"); - - b.Property("PARENTCOMM") - .HasColumnType("int") - .HasComment("23. If your parents are still alive, how often do you have contact with them (including mother, father, mother-in-law, and father-in-law) either in person, by phone, mail, or email (e.g., any online interaction)?"); - - b.Property("PARTICIPATE") - .HasColumnType("int") - .HasComment("26. How often do you participate in activities outside the home (e.g., religious activities, educational activities, volunteer work, paid work, or activities with groups or organizations)?"); - - b.Property("POORMEDTRT") - .HasColumnType("int") - .HasComment("38. How frequently did you receive poorer service or treatment from doctors or in hospitals compared to other people?"); - - b.Property("POORSERV") - .HasColumnType("int") - .HasComment("34. In your day-to-day life how often do you receive poorer service than other people at restaurants or stores?"); - - b.Property("RMMODE") - .HasColumnType("int") - .HasColumnName("RMMODE") - .HasColumnOrder(8); - - b.Property("RMREAS") - .HasColumnType("int") - .HasColumnName("RMREASON") - .HasColumnOrder(7); - - b.Property("SAFECOMM") - .HasColumnType("int") - .HasComment("27b. How safe do you feel in your community (or neighborhood)?"); - - b.Property("SAFEHOME") - .HasColumnType("int") - .HasComment("27a. How safe do you feel in your home?"); - - b.Property("SCRIPTPROB") - .HasColumnType("int") - .HasComment("29. In the past year, how often did you experience challenges in filling a prescription?"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("nvarchar(20)") - .HasColumnOrder(2); - - b.Property("THREATENED") - .HasColumnType("int") - .HasComment("37. In your day-to-day life how often are you threatened or harassed?"); - - b.Property("TRANSPROB") - .HasColumnType("int") - .HasComment("3. In the past 30 days, how often were you not able to leave the house when you wanted to because of a problem with transportation?"); - - b.Property("TRANSWORRY") - .HasColumnType("int") - .HasComment("4. In the past 30 days, how often did you worry about whether or not you would be able to get somewhere because of a problem with transportation?"); - - b.Property("TRSPACCESS") - .HasColumnType("int") - .HasComment("2. Do you have consistent access to transportation?"); - - b.Property("TRSPLONGER") - .HasColumnType("int") - .HasComment("5. In the past 30 days, how often did it take you longer to get somewhere than it would have taken you if you had different transportation?"); - - b.Property("TRSPMED") - .HasColumnType("int") - .HasComment("6. In the past 30 days, how often has a lack of transportation kept you from medical appointments or from doing things needed for daily living?"); - - b.Property("VisitId") - .HasColumnType("int") - .HasColumnOrder(1); - - b.HasKey("Id"); - - b.HasIndex("VisitId") - .IsUnique(); - - b.ToTable("tbl_A1as"); - }); - - modelBuilder.Entity("UDS.Net.API.Entities.A2", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasColumnName("FormId") - .HasColumnOrder(0); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("DeletedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("FRMDATE") - .HasColumnType("datetime2") - .HasColumnName("FRMDATE") - .HasColumnOrder(3); - - b.Property("INCNTFRQ") - .HasColumnType("int"); - - b.Property("INCNTMDX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.Property("INCNTMOD") - .HasColumnType("int"); - - b.Property("INCNTTIM") - .HasColumnType("int"); - - b.Property("INITIALS") - .IsRequired() - .HasMaxLength(3) - .HasColumnType("nvarchar(3)") - .HasColumnName("INITIALS") - .HasColumnOrder(4); - - b.Property("INKNOWN") - .HasColumnType("int"); - - b.Property("INLIVWTH") - .HasColumnType("int"); - - b.Property("INMEMTEN") - .HasColumnType("int"); - - b.Property("INMEMTROUB") - .HasColumnType("int"); - - b.Property("INMEMWORS") - .HasColumnType("int"); - - b.Property("INRELTO") - .HasColumnType("int"); - - b.Property("INRELY") - .HasColumnType("int"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("LANG") - .HasColumnType("int") - .HasColumnName("LANG") - .HasColumnOrder(5); - - b.Property("MODE") - .HasColumnType("int") - .HasColumnName("MODE") - .HasColumnOrder(6); - - b.Property("ModifiedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("NEWINF") - .HasColumnType("int"); - - b.Property("NOT") - .HasColumnType("int") - .HasColumnName("NOT") - .HasColumnOrder(9); - - b.Property("RMMODE") - .HasColumnType("int") - .HasColumnName("RMMODE") - .HasColumnOrder(8); - - b.Property("RMREAS") - .HasColumnType("int") - .HasColumnName("RMREASON") - .HasColumnOrder(7); - - b.Property("Status") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("nvarchar(20)") - .HasColumnOrder(2); - - b.Property("VisitId") - .HasColumnType("int") - .HasColumnOrder(1); - - b.HasKey("Id"); - - b.HasIndex("VisitId") - .IsUnique(); - - b.ToTable("tbl_A2s"); - }); - - modelBuilder.Entity("UDS.Net.API.Entities.A3", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasColumnName("FormId") - .HasColumnOrder(0); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("AFFFAMM") - .HasColumnType("int"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("DADAGEO") - .HasColumnType("int"); - - b.Property("DADDAGE") - .HasColumnType("int"); - - b.Property("DADETPR") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b.Property("DADETSEC") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b.Property("DADMEVAL") - .HasColumnType("int"); - - b.Property("DADYOB") - .HasColumnType("int"); - - b.Property("DeletedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("FRMDATE") - .HasColumnType("datetime2") - .HasColumnName("FRMDATE") - .HasColumnOrder(3); - - b.Property("INITIALS") - .IsRequired() - .HasMaxLength(3) - .HasColumnType("nvarchar(3)") - .HasColumnName("INITIALS") - .HasColumnOrder(4); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("KIDS") - .HasColumnType("int"); - - b.Property("LANG") - .HasColumnType("int") - .HasColumnName("LANG") - .HasColumnOrder(5); - - b.Property("MODE") - .HasColumnType("int") - .HasColumnName("MODE") - .HasColumnOrder(6); - - b.Property("MOMAGEO") - .HasColumnType("int"); - - b.Property("MOMDAGE") - .HasColumnType("int"); - - b.Property("MOMETPR") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b.Property("MOMETSEC") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b.Property("MOMMEVAL") - .HasColumnType("int"); - - b.Property("MOMYOB") - .HasColumnType("int"); - - b.Property("ModifiedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("NOT") - .HasColumnType("int") - .HasColumnName("NOT") - .HasColumnOrder(9); - - b.Property("NWINFKID") - .HasColumnType("int"); - - b.Property("NWINFMUT") - .HasColumnType("int"); - - b.Property("NWINFSIB") - .HasColumnType("int"); - - b.Property("RMMODE") - .HasColumnType("int") - .HasColumnName("RMMODE") - .HasColumnOrder(8); - - b.Property("RMREAS") - .HasColumnType("int") - .HasColumnName("RMREASON") - .HasColumnOrder(7); - - b.Property("SIBS") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("nvarchar(20)") - .HasColumnOrder(2); - - b.Property("VisitId") - .HasColumnType("int") - .HasColumnOrder(1); - - b.HasKey("Id"); - - b.HasIndex("VisitId") - .IsUnique(); - - b.ToTable("tbl_A3s"); - }); - - modelBuilder.Entity("UDS.Net.API.Entities.A4", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasColumnName("FormId") - .HasColumnOrder(0); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("ANYMEDS") - .HasColumnType("int"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("DeletedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("FRMDATE") - .HasColumnType("datetime2") - .HasColumnName("FRMDATE") - .HasColumnOrder(3); - - b.Property("INITIALS") - .IsRequired() - .HasMaxLength(3) - .HasColumnType("nvarchar(3)") - .HasColumnName("INITIALS") - .HasColumnOrder(4); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("LANG") - .HasColumnType("int") - .HasColumnName("LANG") - .HasColumnOrder(5); - - b.Property("MODE") - .HasColumnType("int") - .HasColumnName("MODE") - .HasColumnOrder(6); - - b.Property("ModifiedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("NOT") - .HasColumnType("int") - .HasColumnName("NOT") - .HasColumnOrder(9); - - b.Property("RMMODE") - .HasColumnType("int") - .HasColumnName("RMMODE") - .HasColumnOrder(8); - - b.Property("RMREAS") - .HasColumnType("int") - .HasColumnName("RMREASON") - .HasColumnOrder(7); - - b.Property("Status") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("nvarchar(20)") - .HasColumnOrder(2); - - b.Property("VisitId") - .HasColumnType("int") - .HasColumnOrder(1); - - b.HasKey("Id"); - - b.HasIndex("VisitId") - .IsUnique(); - - b.ToTable("tbl_A4s"); - }); - - modelBuilder.Entity("UDS.Net.API.Entities.A4a", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasColumnName("FormId") - .HasColumnOrder(0); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("ADVERSEOTH") - .HasColumnType("bit"); - - b.Property("ADVERSEOTX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.Property("ADVEVENT") - .HasColumnType("int"); - - b.Property("ARIAE") - .HasColumnType("bit"); - - b.Property("ARIAH") - .HasColumnType("bit"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("DeletedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("FRMDATE") - .HasColumnType("datetime2") - .HasColumnName("FRMDATE") - .HasColumnOrder(3); - - b.Property("INITIALS") - .IsRequired() - .HasMaxLength(3) - .HasColumnType("nvarchar(3)") - .HasColumnName("INITIALS") - .HasColumnOrder(4); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("LANG") - .HasColumnType("int") - .HasColumnName("LANG") - .HasColumnOrder(5); - - b.Property("MODE") - .HasColumnType("int") - .HasColumnName("MODE") - .HasColumnOrder(6); - - b.Property("ModifiedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("NOT") - .HasColumnType("int") - .HasColumnName("NOT") - .HasColumnOrder(9); - - b.Property("RMMODE") - .HasColumnType("int") - .HasColumnName("RMMODE") - .HasColumnOrder(8); - - b.Property("RMREAS") - .HasColumnType("int") - .HasColumnName("RMREASON") - .HasColumnOrder(7); - - b.Property("Status") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("nvarchar(20)") - .HasColumnOrder(2); - - b.Property("TRTBIOMARK") - .HasColumnType("int"); - - b.Property("VisitId") - .HasColumnType("int") - .HasColumnOrder(1); - - b.HasKey("Id"); - - b.HasIndex("VisitId") - .IsUnique(); - - b.ToTable("tbl_A4as"); - }); - - modelBuilder.Entity("UDS.Net.API.Entities.A5D2", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasColumnName("FormId") - .HasColumnOrder(0); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("ALCBINGE") - .HasColumnType("int") - .HasComment("In the past 12 months, how often did the participant have six or more drinks containing alcohol in one day?"); - - b.Property("ALCDRINKS") - .HasColumnType("int") - .HasComment("On a day when the participant drinks alcoholic beverages, how many standard drinks does the participant typically consume?"); - - b.Property("ALCFREQYR") - .HasColumnType("int") - .HasComment("In the past 12 months, how often has the participant had a drink containing alcohol?"); - - b.Property("ANGIOCP") - .HasColumnType("int") - .HasComment("Carotid artery surgery or stenting?"); - - b.Property("ANXIETY") - .HasColumnType("int") - .HasComment("Anxiety disorder (DSM-5-TR criteria)"); - - b.Property("APNEA") - .HasColumnType("int") - .HasComment("Sleep apnea"); - - b.Property("APNEAORAL") - .HasColumnType("int") - .HasComment("Typical use of an oral device for sleep apnea at night over the past 12 months?"); - - b.Property("ARTHLOEX") - .HasColumnType("bit") - .HasComment("Lower extremity affected by arthritis"); - - b.Property("ARTHRIT") - .HasColumnType("int") - .HasComment("Arthritis"); - - b.Property("ARTHROSTEO") - .HasColumnType("bit") - .HasComment("Type of arthritis: Osteoarthritis"); - - b.Property("ARTHROTHR") - .HasColumnType("bit") - .HasComment("Type of arthritis: Other"); - - b.Property("ARTHRRHEUM") - .HasColumnType("bit") - .HasComment("Type of arthritis: Rheumatoid"); - - b.Property("ARTHSPIN") - .HasColumnType("bit") - .HasComment("Spine affected by arthritis"); - - b.Property("ARTHTYPUNK") - .HasColumnType("bit") - .HasComment("Type of arthritis: Unknown"); - - b.Property("ARTHTYPX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)") - .HasComment("Specify other type of arthritis"); - - b.Property("ARTHUNK") - .HasColumnType("bit") - .HasComment("Region affected by arthritis unknown"); - - b.Property("ARTHUPEX") - .HasColumnType("bit") - .HasComment("Upper extremity affected by arthritis"); - - b.Property("B12DEF") - .HasColumnType("int") - .HasComment("B12 deficiency"); - - b.Property("BCENDAGE") - .HasColumnType("int") - .HasComment("Age at last use of birth control pills"); - - b.Property("BCPILLS") - .HasColumnType("int") - .HasComment("Has the participant ever taken birth control pills?"); - - b.Property("BCPILLSYR") - .HasColumnType("int") - .HasComment("Total number of years participant has taken birth control pills"); - - b.Property("BCSTARTAGE") - .HasColumnType("int") - .HasComment("Age at first use of birth control pills"); - - b.Property("BIPOLAR") - .HasColumnType("int") - .HasComment("Bipolar disorder(DSM - 5 - TR criteria)"); - - b.Property("BYPASSAGE") - .HasColumnType("int") - .HasComment("Age at most recent coronary artery bypass surgery"); - - b.Property("CANCBLOOD") - .HasColumnType("bit") - .HasComment("Primary site of cancer: Blood"); - - b.Property("CANCBONE") - .HasColumnType("bit") - .HasComment("Type of cancer treatment: Bone marrow transplant"); - - b.Property("CANCBREAST") - .HasColumnType("bit") - .HasComment("Primary site of cancer: Breast"); - - b.Property("CANCCHEMO") - .HasColumnType("bit") - .HasComment("Type of cancer treatment: Chemotherapy"); - - b.Property("CANCCOLON") - .HasColumnType("bit") - .HasComment("Primary site of cancer: Colon"); - - b.Property("CANCERACTV") - .HasColumnType("int") - .HasComment("Cancer, primary or metastatic (Report all known diagnoses. Exclude non-melanoma skin cancer.)"); - - b.Property("CANCERAGE") - .HasColumnType("int") - .HasComment("Age at most recent cancer diagnosis"); - - b.Property("CANCERMETA") - .HasColumnType("bit") - .HasComment("Type of cancer: Metastatic"); - - b.Property("CANCERPRIM") - .HasColumnType("bit") - .HasComment("Type of cancer: Primary/non-metastatic"); - - b.Property("CANCERUNK") - .HasColumnType("bit") - .HasComment("Type of cancer: Unknown"); - - b.Property("CANCHORM") - .HasColumnType("bit") - .HasComment("Type of cancer treatment: Hormone therapy"); - - b.Property("CANCIMMUNO") - .HasColumnType("bit") - .HasComment("Type of cancer treatment: Immunotherapy"); - - b.Property("CANCLUNG") - .HasColumnType("bit") - .HasComment("Primary site of cancer: Lung"); - - b.Property("CANCMETBR") - .HasColumnType("bit") - .HasComment("Type of metastatic cancer: Metatstic to brain"); - - b.Property("CANCMETOTH") - .HasColumnType("bit") - .HasComment("Type of metastatic cancer: Metastatic to sites other than brain"); - - b.Property("CANCOTHER") - .HasColumnType("bit") - .HasComment("Primary site of cancer: Other"); - - b.Property("CANCOTHERX") - .HasColumnType("nvarchar(max)") - .HasComment("Specify other primary site of cancer"); - - b.Property("CANCPROST") - .HasColumnType("bit") - .HasComment("Primary site of cancer: Prostate"); - - b.Property("CANCRAD") - .HasColumnType("bit") - .HasComment("Type of cancer treatment: Radiation"); - - b.Property("CANCRESECT") - .HasColumnType("bit") - .HasComment("Type of cancer treatment: Surgical resection"); - - b.Property("CANCTROTH") - .HasColumnType("bit") - .HasComment("Type of cancer treatment: Other"); - - b.Property("CANCTROTHX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)") - .HasComment("Specify other type of cancer treatment"); - - b.Property("CANNABIS") - .HasColumnType("int") - .HasComment("In the past 12 months, how often has the participant consumed cannabis (edibles, smoked, or vaporized)?"); - - b.Property("CARDARRAGE") - .HasColumnType("int") - .HasComment("Age at most recent cardiac arrest"); - - b.Property("CARDARREST") - .HasColumnType("int") - .HasComment("Cardiac arrest (heart stopped)"); - - b.Property("CAROTIDAGE") - .HasColumnType("int") - .HasComment("Age at most recent carotid artery surgery or stenting"); - - b.Property("CBSTROKE") - .HasColumnType("int") - .HasComment("Stroke by history, not exam (imaging is not required)"); - - b.Property("CBTIA") - .HasColumnType("int") - .HasComment("Transient ischemic attack (TIA)"); - - b.Property("COVID19") - .HasColumnType("int") - .HasComment("COVID-19 infection"); - - b.Property("COVIDHOSP") - .HasColumnType("int") - .HasComment("COVID-19 infection requiring hospitalization?"); - - b.Property("CPAP") - .HasColumnType("int") - .HasComment("Typical use of breathing machine (e.g. CPAP) at night over the past 12 months"); - - b.Property("CVAFIB") - .HasColumnType("int") - .HasComment("Atrial fibrillation"); - - b.Property("CVANGIO") - .HasColumnType("int") - .HasComment("Coronary artery angioplasty / endarterectomy / stenting"); - - b.Property("CVBYPASS") - .HasColumnType("int") - .HasComment("Coronary artery bypass procedure"); - - b.Property("CVCHF") - .HasColumnType("int") - .HasComment("Congestive heart failure (including pulmonary edema)"); - - b.Property("CVHVALVE") - .HasColumnType("int") - .HasComment("Heart valve replacement or repair"); - - b.Property("CVOTHR") - .HasColumnType("int") - .HasComment("Other cardiovascular disease"); - - b.Property("CVOTHRX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)") - .HasComment("Specify other cardiovascular disease"); - - b.Property("CVPACDEF") - .HasColumnType("int") - .HasComment("Pacemaker and/or defibrillator implantation"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("DEPRTREAT") - .HasColumnType("bit") - .HasComment("Choose if treated or untreated"); - - b.Property("DIABAGE") - .HasColumnType("int") - .HasComment("Age at diabetes diagnosis"); - - b.Property("DIABDIET") - .HasColumnType("bit") - .HasComment("Diabetes treated with: Diet"); - - b.Property("DIABETES") - .HasColumnType("int") - .HasComment("Diabetes"); - - b.Property("DIABGLP1") - .HasColumnType("bit") - .HasComment("GLP-1 receptor activators"); - - b.Property("DIABINS") - .HasColumnType("bit") - .HasComment("Diabetes treated with: Insulin"); - - b.Property("DIABMEDS") - .HasColumnType("bit") - .HasComment("Diabetes treated with: Oral medications"); - - b.Property("DIABRECACT") - .HasColumnType("bit") - .HasComment("Other non-insulin, non-GLP-1 receptor activator injection medication"); - - b.Property("DIABTYPE") - .HasColumnType("int") - .HasComment("Diabetes type"); - - b.Property("DIABUNK") - .HasColumnType("bit") - .HasComment("Diabetes treated with: Unknown"); - - b.Property("DeletedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("FIRSTTBI") - .HasColumnType("int") - .HasComment("Age of first head injury"); - - b.Property("FRMDATE") - .HasColumnType("datetime2") - .HasColumnName("FRMDATE") - .HasColumnOrder(3); - - b.Property("GENERALANX") - .HasColumnType("int") - .HasComment("Generalized Anxiety Disorder"); - - b.Property("HEADACHE") - .HasColumnType("int") - .HasComment("Chronic headaches"); - - b.Property("HEADIMP") - .HasColumnType("int") - .HasComment("epetitive head impacts (e.g. from contact sports, intimate partner violence, or military duty), regardless of whether it caused symptoms."); - - b.Property("HEADINJCON") - .HasColumnType("int") - .HasComment("After a head injury, what was the longest period..."); - - b.Property("HEADINJNUM") - .HasColumnType("int") - .HasComment("Total number of head injuries"); - - b.Property("HEADINJUNC") - .HasColumnType("int") - .HasComment("After a head injury, what was the longest period of time that the participant was unconscious?"); - - b.Property("HEADINJURY") - .HasColumnType("int") - .HasComment("Head injury (e.g. in a vehicle accident, being hit by an object...)"); - - b.Property("HIVAGE") - .HasColumnType("int") - .HasComment("Age at HIV diagnosis"); - - b.Property("HIVDIAG") - .HasColumnType("int") - .HasComment("Human Immunodeficiency Virus"); - - b.Property("HRT") - .HasColumnType("int") - .HasComment("Has the participant taken female hormone replacement pills or patches (e.g. estrogen)?"); - - b.Property("HRTATTACK") - .HasColumnType("int") - .HasComment("Heart attack (heart artery blockage)"); - - b.Property("HRTATTAGE") - .HasColumnType("int") - .HasComment("Age at most recent heart attack"); - - b.Property("HRTATTMULT") - .HasColumnType("int") - .HasComment("More than one heart attack?"); - - b.Property("HRTENDAGE") - .HasColumnType("int") - .HasComment("Age at last use of female hormone replacement pills"); - - b.Property("HRTSTRTAGE") - .HasColumnType("int") - .HasComment("Age at first use of female hormone replacement pills"); - - b.Property("HRTYEARS") - .HasColumnType("int") - .HasComment("Total number of years participant has taken female hormone replacement pills"); - - b.Property("HYDROCEPH") - .HasColumnType("int") - .HasComment("Normal-pressure hydrocephalus"); - - b.Property("HYPERCHAGE") - .HasColumnType("int") - .HasComment("Age at hypercholesterolemia diagnosis"); - - b.Property("HYPERCHO") - .HasColumnType("int") - .HasComment("Hypercholesterolemia (or taking medication for high cholesterol)"); - - b.Property("HYPERTAGE") - .HasColumnType("int") - .HasComment("Age at hypertension diagnosis"); - - b.Property("HYPERTEN") - .HasColumnType("int") - .HasComment("Hypertension (or taking medication for hypertension)"); - - b.Property("IMPAMFOOT") - .HasColumnType("bit") - .HasComment("Source of exposure for repeated hits to the head: American football"); - - b.Property("IMPASSAULT") - .HasColumnType("bit") - .HasComment("Source of exposure for repeated hits to the head: Physical assault"); - - b.Property("IMPBOXING") - .HasColumnType("bit") - .HasComment("Source of exposure for repeated hits to the head: Boxing or mixed martial arts"); - - b.Property("IMPHOCKEY") - .HasColumnType("bit") - .HasComment("Source of exposure for repeated hits to the head: Ice hockey"); - - b.Property("IMPIPV") - .HasColumnType("bit") - .HasComment("Source of exposure for repeated hits to the head: Intimate partner violence"); - - b.Property("IMPMILIT") - .HasColumnType("bit") - .HasComment("Source of exposure for repeated hits to the head: Military service"); - - b.Property("IMPOTHER") - .HasColumnType("bit") - .HasComment("Source of exposure for repeated hits to the head: Other cause"); - - b.Property("IMPOTHERX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)") - .HasComment("Specify other source of exposure for repeated hits to the head"); - - b.Property("IMPSOCCER") - .HasColumnType("bit") - .HasComment("Source of exposure for repeated hits to the head: Soccer"); - - b.Property("IMPSPORT") - .HasColumnType("bit") - .HasComment("Source of exposure for repeated hits to the head: Other contact sport"); - - b.Property("IMPYEARS") - .HasColumnType("int") - .HasComment("The total length of time in years that the participant was exposed to repeated hits to the head (e.g. playing American football for 7 years)"); - - b.Property("INCONTF") - .HasColumnType("int") - .HasComment("Incontinence—bowel (occurring at least weekly)"); - - b.Property("INCONTU") - .HasColumnType("int") - .HasComment("Incontinence—urinary (occurring at least weekly)"); - - b.Property("INITIALS") - .IsRequired() - .HasMaxLength(3) - .HasColumnType("nvarchar(3)") - .HasColumnName("INITIALS") - .HasColumnOrder(4); - - b.Property("INSOMN") - .HasColumnType("int") - .HasComment("Hyposomnia/Insomnia (occurring at least weekly or requiring medication)"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("KIDNEY") - .HasColumnType("int") - .HasComment("Chronic kidney disease"); - - b.Property("KIDNEYAGE") - .HasColumnType("int") - .HasComment("Age at chronic kidney disease diagnosis"); - - b.Property("LANG") - .HasColumnType("int") - .HasColumnName("LANG") - .HasColumnOrder(5); - - b.Property("LASTTBI") - .HasColumnType("int") - .HasComment("Age of most recent head injury"); - - b.Property("LIVER") - .HasColumnType("int") - .HasComment("Liver disease"); - - b.Property("LIVERAGE") - .HasColumnType("int") - .HasComment("Age at liver disease diagnosis"); - - b.Property("MAJORDEP") - .HasColumnType("int") - .HasComment("Major depressive disorder (DSM-5-TR criteria)"); - - b.Property("MENARCHE") - .HasColumnType("int") - .HasComment("How old was the participant when they had their first menstrual period?"); - - b.Property("MODE") - .HasColumnType("int") - .HasColumnName("MODE") - .HasColumnOrder(6); - - b.Property("MS") - .HasColumnType("int") - .HasComment("Multiple sclerosis"); - - b.Property("ModifiedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("NOMENSAGE") - .HasColumnType("int") - .HasComment("How old was the participant when they had their last menstrual period?"); - - b.Property("NOMENSCHEM") - .HasColumnType("bit") - .HasComment("Participant has stopped having menstrual periods due to chemotherapy for cancer or another condition"); - - b.Property("NOMENSESTR") - .HasColumnType("bit") - .HasComment("Participant has stopped having menstrual periods due to anti-estrogen medication"); - - b.Property("NOMENSHORM") - .HasColumnType("bit") - .HasComment("Participant has stopped having menstrual periods due to hormonal supplements (e.g. the Pill, injections, Mirena, HRT)"); - - b.Property("NOMENSHYST") - .HasColumnType("bit") - .HasComment("Participant has stopped having menstrual periods due to hysterectomy (surgical removal of uterus)"); - - b.Property("NOMENSNAT") - .HasColumnType("bit") - .HasComment("Participant has stopped having menstrual periods due to natural menopause"); - - b.Property("NOMENSOTH") - .HasColumnType("bit") - .HasComment("Other reason participant has stopped having menstrual periods"); - - b.Property("NOMENSOTHX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)") - .HasComment("Specify other reason participant has stopped having menstrual periods"); - - b.Property("NOMENSRAD") - .HasColumnType("bit") - .HasComment("Participant has stopped having menstrual periods due to radiation treatment or other damage/injury to reproductive organs"); - - b.Property("NOMENSSURG") - .HasColumnType("bit") - .HasComment("Participant has stopped having menstrual periods due to surgical removal of both ovaries"); - - b.Property("NOMENSUNK") - .HasColumnType("bit") - .HasComment("Unsure of reason participant has stopped having menstrual periods"); - - b.Property("NOT") - .HasColumnType("int") - .HasColumnName("NOT") - .HasColumnOrder(9); - - b.Property("NPSYDEV") - .HasColumnType("int") - .HasComment("Developmental neuropsychiatric disorders"); - - b.Property("OCD") - .HasColumnType("int") - .HasComment("Obsessive-compulsive disorder (OCD)"); - - b.Property("OTHANXDIS") - .HasColumnType("int") - .HasComment("Other anxiety disorder"); - - b.Property("OTHANXDISX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)") - .HasComment("Specify other anxiety disorder"); - - b.Property("OTHCONDX") - .HasColumnType("nvarchar(max)") - .HasComment("Specify other medical conditions or procedures"); - - b.Property("OTHERCOND") - .HasColumnType("int") - .HasComment("Other medical conditions or procedures"); - - b.Property("OTHERDEP") - .HasColumnType("int") - .HasComment("Other specified depressive disorder (DSm-5-TR criteria)"); - - b.Property("OTHSLEEP") - .HasColumnType("int") - .HasComment("Other sleep disorder"); - - b.Property("OTHSLEEX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)") - .HasComment("Specify other sleep disorder"); - - b.Property("PACDEFAGE") - .HasColumnType("int") - .HasComment("Age at first pacemaker and/or defibrillator implantation"); - - b.Property("PACKSPER") - .HasColumnType("int") - .HasComment("Average number of packs smoked per day"); - - b.Property("PANICDIS") - .HasColumnType("int") - .HasComment("Panic Disorder"); - - b.Property("PD") - .HasColumnType("int") - .HasComment("Parkinson’s disease (PD)"); - - b.Property("PDAGE") - .HasColumnType("int") - .HasComment("Age at estimated PD symptom onset"); - - b.Property("PDOTHR") - .HasColumnType("int") - .HasComment("Other parkinsonism disorder (e.g., DLB)"); - - b.Property("PDOTHRAGE") - .HasColumnType("int") - .HasComment("Age at parkinsonism disorder diagnosis"); - - b.Property("PSYCDIS") - .HasColumnType("int") - .HasComment("Other psychiatric disorders"); - - b.Property("PSYCDISX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)") - .HasComment("Specify other psychiatric disorders"); - - b.Property("PTSD") - .HasColumnType("int") - .HasComment("Post-traumatic stress disorder (PTSD) (DSM-5-TR criteria)"); - - b.Property("PULMONARY") - .HasColumnType("int") - .HasComment("Asthma/COPD/pulmonary disease"); - - b.Property("PVD") - .HasColumnType("int") - .HasComment("Peripheral vascular disease"); - - b.Property("PVDAGE") - .HasColumnType("int") - .HasComment("Age at peripheral vascular disease diagnosis"); - - b.Property("QUITSMOK") - .HasColumnType("int") - .HasComment("If the participant quit smoking, specify the age at which they last smoked (i.e., quit)"); - - b.Property("RBD") - .HasColumnType("int") - .HasComment("REM sleep behavior disorder"); - - b.Property("RMMODE") - .HasColumnType("int") - .HasColumnName("RMMODE") - .HasColumnOrder(8); - - b.Property("RMREAS") - .HasColumnType("int") - .HasColumnName("RMREASON") - .HasColumnOrder(7); - - b.Property("SCHIZ") - .HasColumnType("int") - .HasComment("Schizophrenia or other psychosis disorder (DSM-5-TR criteria)"); - - b.Property("SEIZAGE") - .HasColumnType("int") - .HasComment("Age at first seizure (excluding childhood febrile seizures)"); - - b.Property("SEIZNUM") - .HasColumnType("int") - .HasComment("How many seizures has the participant had in the past 12 months?"); - - b.Property("SEIZURES") - .HasColumnType("int") - .HasComment("Epilepsy and/or history of seizures (excluding childhood febrile seizures)"); - - b.Property("SMOKYRS") - .HasColumnType("int") - .HasComment("Total years smoked"); - - b.Property("STROKAGE") - .HasColumnType("int") - .HasComment("Age at most recent stroke"); - - b.Property("STROKMUL") - .HasColumnType("int") - .HasComment("More than one stroke?"); - - b.Property("STROKSTAT") - .HasColumnType("int") - .HasComment("What is status of stroke symptoms?"); - - b.Property("SUBSTPAST") - .HasColumnType("int") - .HasComment("Participant used substances including prescription or recreational drugs that caused significant impairment in work, legal, driving, or social areas prior to 12 months ago"); - - b.Property("SUBSTYEAR") - .HasColumnType("int") - .HasComment("Participant used substances including prescription or recreational drugs that caused significant impairment in work, legal, driving, or social areas within the past 12 months"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("nvarchar(20)") - .HasColumnOrder(2); - - b.Property("THYROID") - .HasColumnType("int") - .HasComment("Thyroid disease"); - - b.Property("TIAAGE") - .HasColumnType("int") - .HasComment("Age at most recent TIA"); - - b.Property("TOBAC100") - .HasColumnType("int") - .HasComment("Has participant smoked more than 100 cigarettes in their life?"); - - b.Property("TOBAC30") - .HasColumnType("int") - .HasComment("Has participant smoked within the last 30 days?"); - - b.Property("VALVEAGE") - .HasColumnType("int") - .HasComment("Age at most recent heart valve replacement or repair procedure"); - - b.Property("VisitId") - .HasColumnType("int") - .HasColumnOrder(1); - - b.HasKey("Id"); - - b.HasIndex("VisitId") - .IsUnique(); - - b.ToTable("tbl_A5D2s"); - }); - - modelBuilder.Entity("UDS.Net.API.Entities.B1", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasColumnName("FormId") - .HasColumnOrder(0); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("BPDIASL1") - .HasColumnType("int") - .HasComment(" Participant blood pressure - Left arm: Diastolic Reading 1"); - - b.Property("BPDIASL2") - .HasColumnType("int") - .HasComment(" Participant blood pressure - Left arm: Diastolic Reading 2"); - - b.Property("BPDIASR1") - .HasColumnType("int") - .HasComment("Participant blood pressure - Right arm: Diastolic Reading 1"); - - b.Property("BPDIASR2") - .HasColumnType("int") - .HasComment("Participant blood pressure - Right arm: Diastolic Reading 2"); - - b.Property("BPSYSL1") - .HasColumnType("int") - .HasComment("Participant blood pressure - Left arm: Systolic Reading 1"); - - b.Property("BPSYSL2") - .HasColumnType("int") - .HasComment("Participant blood pressure - Left arm: Systolic Reading 2"); - - b.Property("BPSYSR1") - .HasColumnType("int") - .HasComment("Participant blood pressure - Right arm: Systolic Reading 1"); - - b.Property("BPSYSR2") - .HasColumnType("int") - .HasComment("Participant blood pressure - Right arm: Systolic Reading 2"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("DeletedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("FRMDATE") - .HasColumnType("datetime2") - .HasColumnName("FRMDATE") - .HasColumnOrder(3); - - b.Property("HEIGHT") - .HasColumnType("decimal(3,1)") - .HasComment("Participant height (inches)"); - - b.Property("HIP1") - .HasColumnType("int") - .HasComment("Hip circumference measurements (inches): Measurement 1"); - - b.Property("HIP2") - .HasColumnType("int") - .HasComment("Hip circumference measurements (inches): Measurement 2"); - - b.Property("HRATE") - .HasColumnType("int") - .HasComment("Participant resting heart rate (pulse)"); - - b.Property("INITIALS") - .IsRequired() - .HasMaxLength(3) - .HasColumnType("nvarchar(3)") - .HasColumnName("INITIALS") - .HasColumnOrder(4); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("LANG") - .HasColumnType("int") - .HasColumnName("LANG") - .HasColumnOrder(5); - - b.Property("MODE") - .HasColumnType("int") - .HasColumnName("MODE") - .HasColumnOrder(6); - - b.Property("ModifiedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("NOT") - .HasColumnType("int") - .HasColumnName("NOT") - .HasColumnOrder(9); - - b.Property("RMMODE") - .HasColumnType("int") - .HasColumnName("RMMODE") - .HasColumnOrder(8); - - b.Property("RMREAS") - .HasColumnType("int") - .HasColumnName("RMREASON") - .HasColumnOrder(7); - - b.Property("Status") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("nvarchar(20)") - .HasColumnOrder(2); - - b.Property("VisitId") - .HasColumnType("int") - .HasColumnOrder(1); - - b.Property("WAIST1") - .HasColumnType("int") - .HasComment("Waist circumference measurements (inches): Measurement 1"); - - b.Property("WAIST2") - .HasColumnType("int") - .HasComment("Waist circumference measurements (inches): Measurement 2"); - - b.Property("WEIGHT") - .HasColumnType("int") - .HasComment("Participant weight (lbs.)"); - - b.HasKey("Id"); - - b.HasIndex("VisitId") - .IsUnique(); - - b.ToTable("tbl_B1s"); - }); - - modelBuilder.Entity("UDS.Net.API.Entities.B3", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasColumnName("FormId") - .HasColumnOrder(0); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("ARISING") - .HasColumnType("int"); - - b.Property("ARISINGX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.Property("BRADYKIN") - .HasColumnType("int"); - - b.Property("BRADYKIX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("DeletedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("FACEXP") - .HasColumnType("int"); - - b.Property("FACEXPX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.Property("FRMDATE") - .HasColumnType("datetime2") - .HasColumnName("FRMDATE") - .HasColumnOrder(3); - - b.Property("GAIT") - .HasColumnType("int"); - - b.Property("GAITX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.Property("HANDALTL") - .HasColumnType("int"); - - b.Property("HANDALTR") - .HasColumnType("int"); - - b.Property("HANDATLX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.Property("HANDATRX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.Property("HANDMOVL") - .HasColumnType("int"); - - b.Property("HANDMOVR") - .HasColumnType("int"); - - b.Property("HANDMVLX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.Property("HANDMVRX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.Property("INITIALS") - .IsRequired() - .HasMaxLength(3) - .HasColumnType("nvarchar(3)") - .HasColumnName("INITIALS") - .HasColumnOrder(4); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("LANG") - .HasColumnType("int") - .HasColumnName("LANG") - .HasColumnOrder(5); - - b.Property("LEGLF") - .HasColumnType("int"); - - b.Property("LEGLFX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.Property("LEGRT") - .HasColumnType("int"); - - b.Property("LEGRTX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.Property("MODE") - .HasColumnType("int") - .HasColumnName("MODE") - .HasColumnOrder(6); - - b.Property("ModifiedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("NOT") - .HasColumnType("int") - .HasColumnName("NOT") - .HasColumnOrder(9); - - b.Property("PDNORMAL") - .HasColumnType("bit"); - - b.Property("POSSTAB") - .HasColumnType("int"); - - b.Property("POSSTABX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.Property("POSTURE") - .HasColumnType("int"); - - b.Property("POSTUREX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.Property("RIGDLOLF") - .HasColumnType("int"); - - b.Property("RIGDLOLX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.Property("RIGDLORT") - .HasColumnType("int"); - - b.Property("RIGDLORX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.Property("RIGDNECK") - .HasColumnType("int"); - - b.Property("RIGDNEX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.Property("RIGDUPLF") - .HasColumnType("int"); - - b.Property("RIGDUPLX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.Property("RIGDUPRT") - .HasColumnType("int"); - - b.Property("RIGDUPRX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.Property("RMMODE") - .HasColumnType("int") - .HasColumnName("RMMODE") - .HasColumnOrder(8); - - b.Property("RMREAS") - .HasColumnType("int") - .HasColumnName("RMREASON") - .HasColumnOrder(7); - - b.Property("SPEECH") - .HasColumnType("int"); - - b.Property("SPEECHX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("nvarchar(20)") - .HasColumnOrder(2); - - b.Property("TAPSLF") - .HasColumnType("int"); - - b.Property("TAPSLFX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.Property("TAPSRT") - .HasColumnType("int"); - - b.Property("TAPSRTX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.Property("TOTALUPDRS") - .HasColumnType("int"); - - b.Property("TRACTLHD") - .HasColumnType("int"); - - b.Property("TRACTLHX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.Property("TRACTRHD") - .HasColumnType("int"); - - b.Property("TRACTRHX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.Property("TRESTFAC") - .HasColumnType("int"); - - b.Property("TRESTFAX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.Property("TRESTLFT") - .HasColumnType("int"); - - b.Property("TRESTLFX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.Property("TRESTLHD") - .HasColumnType("int"); - - b.Property("TRESTLHX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.Property("TRESTRFT") - .HasColumnType("int"); - - b.Property("TRESTRFX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.Property("TRESTRHD") - .HasColumnType("int"); - - b.Property("TRESTRHX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.Property("VisitId") - .HasColumnType("int") - .HasColumnOrder(1); - - b.HasKey("Id"); - - b.HasIndex("VisitId") - .IsUnique(); - - b.ToTable("tbl_B3s"); - }); - - modelBuilder.Entity("UDS.Net.API.Entities.B4", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasColumnName("FormId") - .HasColumnOrder(0); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("CDRGLOB") - .HasColumnType("decimal(2,1)"); - - b.Property("CDRLANG") - .HasColumnType("decimal(2,1)"); - - b.Property("CDRSUM") - .HasColumnType("decimal(3,1)"); - - b.Property("COMMUN") - .HasColumnType("decimal(2,1)"); - - b.Property("COMPORT") - .HasColumnType("decimal(2,1)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("DeletedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("FRMDATE") - .HasColumnType("datetime2") - .HasColumnName("FRMDATE") - .HasColumnOrder(3); - - b.Property("HOMEHOBB") - .HasColumnType("decimal(2,1)"); - - b.Property("INITIALS") - .IsRequired() - .HasMaxLength(3) - .HasColumnType("nvarchar(3)") - .HasColumnName("INITIALS") - .HasColumnOrder(4); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("JUDGMENT") - .HasColumnType("decimal(2,1)"); - - b.Property("LANG") - .HasColumnType("int") - .HasColumnName("LANG") - .HasColumnOrder(5); - - b.Property("MEMORY") - .HasColumnType("decimal(2,1)"); - - b.Property("MODE") - .HasColumnType("int") - .HasColumnName("MODE") - .HasColumnOrder(6); - - b.Property("ModifiedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("NOT") - .HasColumnType("int") - .HasColumnName("NOT") - .HasColumnOrder(9); - - b.Property("ORIENT") - .HasColumnType("decimal(2,1)"); - - b.Property("PERSCARE") - .HasColumnType("decimal(2,1)"); - - b.Property("RMMODE") - .HasColumnType("int") - .HasColumnName("RMMODE") - .HasColumnOrder(8); - - b.Property("RMREAS") - .HasColumnType("int") - .HasColumnName("RMREASON") - .HasColumnOrder(7); - - b.Property("Status") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("nvarchar(20)") - .HasColumnOrder(2); - - b.Property("VisitId") - .HasColumnType("int") - .HasColumnOrder(1); - - b.HasKey("Id"); - - b.HasIndex("VisitId") - .IsUnique(); - - b.ToTable("tbl_B4s"); - }); - - modelBuilder.Entity("UDS.Net.API.Entities.B5", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasColumnName("FormId") - .HasColumnOrder(0); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("AGIT") - .HasColumnType("int"); - - b.Property("AGITSEV") - .HasColumnType("int"); - - b.Property("ANX") - .HasColumnType("int"); - - b.Property("ANXSEV") - .HasColumnType("int"); - - b.Property("APA") - .HasColumnType("int"); - - b.Property("APASEV") - .HasColumnType("int"); - - b.Property("APP") - .HasColumnType("int"); - - b.Property("APPSEV") - .HasColumnType("int"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("DEL") - .HasColumnType("int"); - - b.Property("DELSEV") - .HasColumnType("int"); - - b.Property("DEPD") - .HasColumnType("int"); - - b.Property("DEPDSEV") - .HasColumnType("int"); - - b.Property("DISN") - .HasColumnType("int"); - - b.Property("DISNSEV") - .HasColumnType("int"); - - b.Property("DeletedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("ELAT") - .HasColumnType("int"); - - b.Property("ELATSEV") - .HasColumnType("int"); - - b.Property("FRMDATE") - .HasColumnType("datetime2") - .HasColumnName("FRMDATE") - .HasColumnOrder(3); - - b.Property("HALL") - .HasColumnType("int"); - - b.Property("HALLSEV") - .HasColumnType("int"); - - b.Property("INITIALS") - .IsRequired() - .HasMaxLength(3) - .HasColumnType("nvarchar(3)") - .HasColumnName("INITIALS") - .HasColumnOrder(4); - - b.Property("IRR") - .HasColumnType("int"); - - b.Property("IRRSEV") - .HasColumnType("int"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("LANG") - .HasColumnType("int") - .HasColumnName("LANG") - .HasColumnOrder(5); - - b.Property("MODE") - .HasColumnType("int") - .HasColumnName("MODE") - .HasColumnOrder(6); - - b.Property("MOT") - .HasColumnType("int"); - - b.Property("MOTSEV") - .HasColumnType("int"); - - b.Property("ModifiedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("NITE") - .HasColumnType("int"); - - b.Property("NITESEV") - .HasColumnType("int"); - - b.Property("NOT") - .HasColumnType("int") - .HasColumnName("NOT") - .HasColumnOrder(9); - - b.Property("NPIQINF") - .HasColumnType("int"); - - b.Property("NPIQINFX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.Property("RMMODE") - .HasColumnType("int") - .HasColumnName("RMMODE") - .HasColumnOrder(8); - - b.Property("RMREAS") - .HasColumnType("int") - .HasColumnName("RMREASON") - .HasColumnOrder(7); - - b.Property("Status") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("nvarchar(20)") - .HasColumnOrder(2); - - b.Property("VisitId") - .HasColumnType("int") - .HasColumnOrder(1); - - b.HasKey("Id"); - - b.HasIndex("VisitId") - .IsUnique(); - - b.ToTable("tbl_B5s"); - }); - - modelBuilder.Entity("UDS.Net.API.Entities.B6", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasColumnName("FormId") - .HasColumnOrder(0); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("AFRAID") - .HasColumnType("int"); - - b.Property("BETTER") - .HasColumnType("int"); - - b.Property("BORED") - .HasColumnType("int"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("DROPACT") - .HasColumnType("int"); - - b.Property("DeletedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("EMPTY") - .HasColumnType("int"); - - b.Property("ENERGY") - .HasColumnType("int"); - - b.Property("FRMDATE") - .HasColumnType("datetime2") - .HasColumnName("FRMDATE") - .HasColumnOrder(3); - - b.Property("GDS") - .HasColumnType("int"); - - b.Property("HAPPY") - .HasColumnType("int"); - - b.Property("HELPLESS") - .HasColumnType("int"); - - b.Property("HOPELESS") - .HasColumnType("int"); - - b.Property("INITIALS") - .IsRequired() - .HasMaxLength(3) - .HasColumnType("nvarchar(3)") - .HasColumnName("INITIALS") - .HasColumnOrder(4); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("LANG") - .HasColumnType("int") - .HasColumnName("LANG") - .HasColumnOrder(5); - - b.Property("MEMPROB") - .HasColumnType("int"); - - b.Property("MODE") - .HasColumnType("int") - .HasColumnName("MODE") - .HasColumnOrder(6); - - b.Property("ModifiedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("NOGDS") - .HasColumnType("int"); - - b.Property("NOT") - .HasColumnType("int") - .HasColumnName("NOT") - .HasColumnOrder(9); - - b.Property("RMMODE") - .HasColumnType("int") - .HasColumnName("RMMODE") - .HasColumnOrder(8); - - b.Property("RMREAS") - .HasColumnType("int") - .HasColumnName("RMREASON") - .HasColumnOrder(7); - - b.Property("SATIS") - .HasColumnType("int"); - - b.Property("SPIRITS") - .HasColumnType("int"); - - b.Property("STAYHOME") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("nvarchar(20)") - .HasColumnOrder(2); - - b.Property("VisitId") - .HasColumnType("int") - .HasColumnOrder(1); - - b.Property("WONDRFUL") - .HasColumnType("int"); - - b.Property("WRTHLESS") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("VisitId") - .IsUnique(); - - b.ToTable("tbl_B6s"); - }); - - modelBuilder.Entity("UDS.Net.API.Entities.B7", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasColumnName("FormId") - .HasColumnOrder(0); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("BILLS") - .HasColumnType("int"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("DeletedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("EVENTS") - .HasColumnType("int"); - - b.Property("FRMDATE") - .HasColumnType("datetime2") - .HasColumnName("FRMDATE") - .HasColumnOrder(3); - - b.Property("GAMES") - .HasColumnType("int"); - - b.Property("INITIALS") - .IsRequired() - .HasMaxLength(3) - .HasColumnType("nvarchar(3)") - .HasColumnName("INITIALS") - .HasColumnOrder(4); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("LANG") - .HasColumnType("int") - .HasColumnName("LANG") - .HasColumnOrder(5); - - b.Property("MEALPREP") - .HasColumnType("int"); - - b.Property("MODE") - .HasColumnType("int") - .HasColumnName("MODE") - .HasColumnOrder(6); - - b.Property("ModifiedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("NOT") - .HasColumnType("int") - .HasColumnName("NOT") - .HasColumnOrder(9); - - b.Property("PAYATTN") - .HasColumnType("int"); - - b.Property("REMDATES") - .HasColumnType("int"); - - b.Property("RMMODE") - .HasColumnType("int") - .HasColumnName("RMMODE") - .HasColumnOrder(8); - - b.Property("RMREAS") - .HasColumnType("int") - .HasColumnName("RMREASON") - .HasColumnOrder(7); - - b.Property("SHOPPING") - .HasColumnType("int"); - - b.Property("STOVE") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("nvarchar(20)") - .HasColumnOrder(2); - - b.Property("TAXES") - .HasColumnType("int"); - - b.Property("TRAVEL") - .HasColumnType("int"); - - b.Property("VisitId") - .HasColumnType("int") - .HasColumnOrder(1); - - b.HasKey("Id"); - - b.HasIndex("VisitId") - .IsUnique(); - - b.ToTable("tbl_B7s"); - }); - - modelBuilder.Entity("UDS.Net.API.Entities.B8", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasColumnName("FormId") - .HasColumnOrder(0); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("ALIENLIMB") - .HasColumnType("int"); - - b.Property("AMPMOTOR") - .HasColumnType("int"); - - b.Property("APHASIA") - .HasColumnType("int"); - - b.Property("APRAXGAZE") - .HasColumnType("int"); - - b.Property("APRAXSP") - .HasColumnType("int"); - - b.Property("AXIALRIG") - .HasColumnType("int"); - - b.Property("CHOREA") - .HasColumnType("int"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("DYSARTH") - .HasColumnType("int"); - - b.Property("DYSTARM") - .HasColumnType("int"); - - b.Property("DYSTLEG") - .HasColumnType("int"); - - b.Property("DeletedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("FRMDATE") - .HasColumnType("datetime2") - .HasColumnName("FRMDATE") - .HasColumnOrder(3); - - b.Property("GAITABN") - .HasColumnType("int"); - - b.Property("GAITFIND") - .HasColumnType("int"); - - b.Property("GAITOTHRX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.Property("HSPATNEG") - .HasColumnType("int"); - - b.Property("INITIALS") - .IsRequired() - .HasMaxLength(3) - .HasColumnType("nvarchar(3)") - .HasColumnName("INITIALS") - .HasColumnOrder(4); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("LANG") - .HasColumnType("int") - .HasColumnName("LANG") - .HasColumnOrder(5); - - b.Property("LIMBAPRAX") - .HasColumnType("int"); - - b.Property("LIMBATAX") - .HasColumnType("int"); - - b.Property("LMNDIST") - .HasColumnType("int"); - - b.Property("MASKING") - .HasColumnType("int"); - - b.Property("MODE") - .HasColumnType("int") - .HasColumnName("MODE") - .HasColumnOrder(6); - - b.Property("MYOCLON") - .HasColumnType("int"); - - b.Property("ModifiedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("NEUREXAM") - .HasColumnType("int"); - - b.Property("NORMNREXAM") - .HasColumnType("bit"); - - b.Property("NOT") - .HasColumnType("int") - .HasColumnName("NOT") - .HasColumnOrder(9); - - b.Property("OPTICATAX") - .HasColumnType("int"); - - b.Property("OTHERSIGN") - .HasColumnType("int"); - - b.Property("PARKSIGN") - .HasColumnType("int"); - - b.Property("POSTINST") - .HasColumnType("int"); - - b.Property("PSPOAGNO") - .HasColumnType("int"); - - b.Property("RIGIDARM") - .HasColumnType("int"); - - b.Property("RIGIDLEG") - .HasColumnType("int"); - - b.Property("RMMODE") - .HasColumnType("int") - .HasColumnName("RMMODE") - .HasColumnOrder(8); - - b.Property("RMREAS") - .HasColumnType("int") - .HasColumnName("RMREASON") - .HasColumnOrder(7); - - b.Property("SLOWINGFM") - .HasColumnType("int"); - - b.Property("SMTAGNO") - .HasColumnType("int"); - - b.Property("STOOPED") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("nvarchar(20)") - .HasColumnOrder(2); - - b.Property("TREMKINE") - .HasColumnType("int"); - - b.Property("TREMPOST") - .HasColumnType("int"); - - b.Property("TREMREST") - .HasColumnType("int"); - - b.Property("UMNDIST") - .HasColumnType("int"); - - b.Property("UNISOMATO") - .HasColumnType("int"); - - b.Property("VFIELDCUT") - .HasColumnType("int"); - - b.Property("VHGAZEPAL") - .HasColumnType("int"); - - b.Property("VisitId") - .HasColumnType("int") - .HasColumnOrder(1); - - b.HasKey("Id"); - - b.HasIndex("VisitId") - .IsUnique(); - - b.ToTable("tbl_B8s"); - }); - - modelBuilder.Entity("UDS.Net.API.Entities.B9", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasColumnName("FormId") - .HasColumnOrder(0); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("ALCUSE") - .HasColumnType("bit") - .HasComment("Alcohol use"); - - b.Property("BEAGGRS") - .HasColumnType("int") - .HasComment("Participant currently manifests meaningful change in behavior — Aggression"); - - b.Property("BEAGIT") - .HasColumnType("int") - .HasComment("Participant currently manifests meaningful change in behavior — Agitation"); - - b.Property("BEAHALL") - .HasColumnType("int") - .HasComment("Participant currently manifests meaningful change in behavior — Psychosis — Auditory hallucinations"); - - b.Property("BEAHCOMP") - .HasColumnType("int") - .HasComment("IF YES, do the auditory hallucinations include complex sounds like voices speaking words, or music?"); - - b.Property("BEAHSIMP") - .HasColumnType("int") - .HasComment("IF YES, do the auditory hallucinations include simple sounds like knocks or other simple sounds?"); - - b.Property("BEANGER") - .HasColumnType("int") - .HasComment("Participant currently manifests meaningful change in behavior — Explosive anger"); - - b.Property("BEANX") - .HasColumnType("int") - .HasComment("Participant currently manifests meaningful change in behavior — Anxiety"); - - b.Property("BEAPATHY") - .HasColumnType("int") - .HasComment("Participant currently manifests meaningful change in behavior — Apathy, withdrawal"); - - b.Property("BEDEL") - .HasColumnType("int") - .HasComment("Participant currently manifests meaningful change in behavior — Psychosis — Abnormal, false, or delusional beliefs"); - - b.Property("BEDEP") - .HasColumnType("int") - .HasComment("Participant currently manifests meaningful change in behavior — Depressed mood"); - - b.Property("BEDISIN") - .HasColumnType("int") - .HasComment("Participant currently manifests meaningful change in behavior — Disinhibition"); - - b.Property("BEEMPATH") - .HasColumnType("int") - .HasComment("Participant currently manifests meaningful change in behavior — Loss of empathy"); - - b.Property("BEEUPH") - .HasColumnType("int") - .HasComment("Participant currently manifests meaningful change in behavior - Euphoria"); - - b.Property("BEHAGE") - .HasColumnType("int") - .HasComment("If any of the mood-related behavioral symptoms in 12a-12f are present, at what age did they begin?"); - - b.Property("BEIRRIT") - .HasColumnType("int") - .HasComment("Participant currently manifests meaningful change in behavior — Irritability"); - - b.Property("BEMODE") - .HasColumnType("int") - .HasComment("Overall mode of onset for behavioral symptoms"); - - b.Property("BEMODEX") - .HasColumnType("nvarchar(max)") - .HasComment("Other mode of onset - specify"); - - b.Property("BEOBCOM") - .HasColumnType("int") - .HasComment("Participant currently manifests meaningful change in behavior — Obsessions/compulsions"); - - b.Property("BEOTHR") - .HasColumnType("int") - .HasComment("Other behavioral symptom"); - - b.Property("BEOTHRX") - .HasColumnType("nvarchar(max)") - .HasComment("Participant currently manifests meaningful change in behavior - Other, specify"); - - b.Property("BEPERCH") - .HasColumnType("int") - .HasComment("Participant currently manifests meaningful change in behavior — Personality change"); - - b.Property("BEREM") - .HasColumnType("int") - .HasComment("Participant currently manifests meaningful change in behavior — REM sleep behavior disorder"); - - b.Property("BEREMAGO") - .HasColumnType("int") - .HasComment("IF YES, at what age did the dream enactment behavior begin?"); - - b.Property("BEREMCONF") - .HasColumnType("int") - .HasComment("Was REM sleep behavior disorder confirmed by polysomnography?"); - - b.Property("BESUBAB") - .HasColumnType("int") - .HasComment("Participant currently manifests meaningful change in behavior - Substance use"); - - b.Property("BEVHALL") - .HasColumnType("int") - .HasComment("Participant currently manifests meaningful change in behavior — Psychosis — Visual hallucinations"); - - b.Property("BEVPATT") - .HasColumnType("int") - .HasComment("IF YES, do their hallucinations include patterns that are not definite objects, such as pixelation of flat uniform surfaces?"); - - b.Property("BEVWELL") - .HasColumnType("int") - .HasComment("IF YES, do their hallucinations include well formed and detailed images of objects or people, either as independent images or as part of other objects?"); - - b.Property("CANNABUSE") - .HasColumnType("bit") - .HasComment("Cannabis use"); - - b.Property("COCAINEUSE") - .HasColumnType("bit") - .HasComment("Cocaine use"); - - b.Property("COGAGE") - .HasColumnType("int") - .HasComment("If any of the cognitive-related behavioral symptoms in 9a-9h are present, at what age did they begin?"); - - b.Property("COGATTN") - .HasColumnType("int") - .HasComment("Indicate whether the participant currently is meaningfully impaired in attention/concentration"); - - b.Property("COGFLUC") - .HasColumnType("int") - .HasComment("Indicate whether the participant currently has fluctuating cognition"); - - b.Property("COGJUDG") - .HasColumnType("int") - .HasComment("Indicate whether the participant currently is meaningfully impaired in executive function (judgment, planning, and problem-solving)"); - - b.Property("COGLANG") - .HasColumnType("int") - .HasComment("Indicate whether the participant currently is meaningfully impaired in language"); - - b.Property("COGMEM") - .HasColumnType("int") - .HasComment("Indicate whether the participant currently is meaningfully impaired in memory."); - - b.Property("COGMODE") - .HasColumnType("int") - .HasComment("Indicate the mode of onset for the most prominent cognitive problem that is causing the participant's complaints and/or affecting the participant's function."); - - b.Property("COGMODEX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)") - .HasComment("Specify other mode of onset of cognitive symptoms"); - - b.Property("COGORI") - .HasColumnType("int") - .HasComment("Indicate whether the participant currently is meaningfully impaired in orientation."); - - b.Property("COGOTHR") - .HasColumnType("int") - .HasComment("Other cognitive impairment"); - - b.Property("COGOTHRX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)") - .HasComment("Specify other cognitive domains"); - - b.Property("COGVIS") - .HasColumnType("int") - .HasComment("Indicate whether the participant currently is meaningfully impaired in visuospatial function"); - - b.Property("COURSE") - .HasColumnType("int") - .HasComment("Overall course of decline of cognitive / behavorial / motor syndrome"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("DECCLBE") - .HasColumnType("int") - .HasComment("Based on the clinician’s judgment, is the participant currently experiencing any kind of behavioral symptoms?"); - - b.Property("DECCLCOG") - .HasColumnType("bit") - .HasComment("Based on the clinician’s judgment, is the participant currently experiencing meaningful impairment in cognition?"); - - b.Property("DECCLIN") - .HasColumnType("bit") - .HasComment("Does the participant have any neuropsychiatric/behavioral symptoms or declines in any cognitive or motor domain?"); - - b.Property("DECCLMOT") - .HasColumnType("bit") - .HasComment("Based on the clinician’s judgment, is the participant currently experiencing any motor symptoms?"); - - b.Property("DECCOG") - .HasColumnType("int") - .HasComment("Does the participant report a decline in any cognitive domain (relative to stable baseline prior to onset of current syndrome)?"); - - b.Property("DECCOGIN") - .HasColumnType("int") - .HasComment("Does the co-participant report a decline in any cognitive domain (relative to stable baseline prior to onset of current syndrome)?"); - - b.Property("DECMOT") - .HasColumnType("int") - .HasComment("Does the participant report a decline in any motor domain (relative to stable baseline prior to onset of current syndrome)?"); - - b.Property("DECMOTIN") - .HasColumnType("int") - .HasComment("Does the co-participant report a change in any motor domain (relative to stable baseline prior to onset of current syndrome)?"); - - b.Property("DeletedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("FRMDATE") - .HasColumnType("datetime2") - .HasColumnName("FRMDATE") - .HasColumnOrder(3); - - b.Property("FRSTCHG") - .HasColumnType("int") - .HasComment("Indicate the predominant domain that was first recognized as changed in the participant"); - - b.Property("INITIALS") - .IsRequired() - .HasMaxLength(3) - .HasColumnType("nvarchar(3)") - .HasColumnName("INITIALS") - .HasColumnOrder(4); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("LANG") - .HasColumnType("int") - .HasColumnName("LANG") - .HasColumnOrder(5); - - b.Property("MODE") - .HasColumnType("int") - .HasColumnName("MODE") - .HasColumnOrder(6); - - b.Property("MOFACE") - .HasColumnType("int") - .HasComment("Indicate whether the participant currently has meaningful changes in motor function — Change in facial expression"); - - b.Property("MOFALLS") - .HasColumnType("int") - .HasComment("Indicate whether the participant currently has meaningful changes in motor function — Falls"); - - b.Property("MOGAIT") - .HasColumnType("int") - .HasComment("Indicate whether the participant currently has meaningful changes in motor function — Gait disorder"); - - b.Property("MOLIMB") - .HasColumnType("int") - .HasComment("Indicate whether the participant currently has meaningful changes in motor function — Limb weakness"); - - b.Property("MOMOALS") - .HasColumnType("int") - .HasComment("Were changes in motor function suggestive of amyotrophic lateral sclerosis?"); - - b.Property("MOMODE") - .HasColumnType("int") - .HasComment("Indicate the mode of onset for the most prominent motor problem that is causing the participant's complaints and/or affecting the participant's function."); - - b.Property("MOMODEX") - .HasColumnType("nvarchar(max)") - .HasComment("Indicate mode of onset for the most prominent motor problem that is causing the participant's complains and or affecting the participant's function - Other, specify"); - - b.Property("MOMOPARK") - .HasColumnType("int") - .HasComment("Were changes in motor function suggestive of parkinsonism?"); - - b.Property("MOSLOW") - .HasColumnType("int") - .HasComment("Indicate whether the participant currently has meaningful changes in motor function — Slowness"); - - b.Property("MOSPEECH") - .HasColumnType("int") - .HasComment("Indicate whether the participant currently has meaningful changes in motor function — Change in speech"); - - b.Property("MOTORAGE") - .HasColumnType("int") - .HasComment("If changes in motor function are present in 15a-15g, at what age did they begin?"); - - b.Property("MOTREM") - .HasColumnType("int") - .HasComment("Indicate whether the participant currently has meaningful changes in motor function — Tremor"); - - b.Property("ModifiedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("NOT") - .HasColumnType("int") - .HasColumnName("NOT") - .HasColumnOrder(9); - - b.Property("OPIATEUSE") - .HasColumnType("bit") - .HasComment("Opiate use"); - - b.Property("OTHSUBUSE") - .HasColumnType("bit") - .HasComment("Other substance use"); - - b.Property("OTHSUBUSEX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)") - .HasComment("Specify other substance use"); - - b.Property("PERCHAGE") - .HasColumnType("int") - .HasComment("If any of the personality-related behavioral symptoms in 12m-12r are present, at what age did they begin?"); - - b.Property("PSYCHAGE") - .HasColumnType("int") - .HasComment("If any of the psychosis and impulse control-related behavioral symptoms in 12h-12k are present, at what age did they begin?"); - - b.Property("PSYCHSYM") - .HasColumnType("int") - .HasComment("Does the participant report the development of any significant neuropsychiatric/behavioral symptoms (relative to stable baseline prior to onset of current syndrome)?"); - - b.Property("PSYCHSYMIN") - .HasColumnType("int") - .HasComment("Does the co-participant report the development of any significant neuropsychiatric/behavioral symptoms (relative to stable baseline prior to onset of current syndrome)?"); - - b.Property("RMMODE") - .HasColumnType("int") - .HasColumnName("RMMODE") - .HasColumnOrder(8); - - b.Property("RMREAS") - .HasColumnType("int") - .HasColumnName("RMREASON") - .HasColumnOrder(7); - - b.Property("SEDUSE") - .HasColumnType("bit") - .HasComment("Sedative/hypnotic use"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("nvarchar(20)") - .HasColumnOrder(2); - - b.Property("VisitId") - .HasColumnType("int") - .HasColumnOrder(1); - - b.HasKey("Id"); - - b.HasIndex("VisitId") - .IsUnique(); - - b.ToTable("tbl_B9s"); - }); - - modelBuilder.Entity("UDS.Net.API.Entities.C1", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasColumnName("FormId") - .HasColumnOrder(0); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("ANIMALS") - .HasColumnType("int"); - - b.Property("BOSTON") - .HasColumnType("int"); - - b.Property("COGSTAT") - .HasColumnType("int"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("DIGIB") - .HasColumnType("int"); - - b.Property("DIGIBLEN") - .HasColumnType("int"); - - b.Property("DIGIF") - .HasColumnType("int"); - - b.Property("DIGIFLEN") - .HasColumnType("int"); - - b.Property("DeletedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("FRMDATE") - .HasColumnType("datetime2") - .HasColumnName("FRMDATE") - .HasColumnOrder(3); - - b.Property("INITIALS") - .IsRequired() - .HasMaxLength(3) - .HasColumnType("nvarchar(3)") - .HasColumnName("INITIALS") - .HasColumnOrder(4); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("LANG") - .HasColumnType("int") - .HasColumnName("LANG") - .HasColumnOrder(5); - - b.Property("LOGIDAY") - .HasColumnType("int"); - - b.Property("LOGIMEM") - .HasColumnType("int"); - - b.Property("LOGIMO") - .HasColumnType("int"); - - b.Property("LOGIPREV") - .HasColumnType("int"); - - b.Property("LOGIYR") - .HasColumnType("int"); - - b.Property("MEMTIME") - .HasColumnType("int"); - - b.Property("MEMUNITS") - .HasColumnType("int"); - - b.Property("MMSE") - .HasColumnType("int"); - - b.Property("MMSECOMP") - .HasColumnType("int"); - - b.Property("MMSEHEAR") - .HasColumnType("int"); - - b.Property("MMSELAN") - .HasColumnType("int"); - - b.Property("MMSELANX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.Property("MMSELOC") - .HasColumnType("int"); - - b.Property("MMSEORDA") - .HasColumnType("int"); - - b.Property("MMSEORLO") - .HasColumnType("int"); - - b.Property("MMSEREAS") - .HasColumnType("int"); - - b.Property("MMSEVIS") - .HasColumnType("int"); - - b.Property("MODE") - .HasColumnType("int") - .HasColumnName("MODE") - .HasColumnOrder(6); - - b.Property("ModifiedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("NOT") - .HasColumnType("int") - .HasColumnName("NOT") - .HasColumnOrder(9); - - b.Property("NPSYCLOC") - .HasColumnType("int"); - - b.Property("NPSYLAN") - .HasColumnType("int"); - - b.Property("NPSYLANX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.Property("PENTAGON") - .HasColumnType("int"); - - b.Property("RMMODE") - .HasColumnType("int") - .HasColumnName("RMMODE") - .HasColumnOrder(8); - - b.Property("RMREAS") - .HasColumnType("int") - .HasColumnName("RMREASON") - .HasColumnOrder(7); - - b.Property("Status") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("nvarchar(20)") - .HasColumnOrder(2); - - b.Property("TRAILA") - .HasColumnType("int"); - - b.Property("TRAILALI") - .HasColumnType("int"); - - b.Property("TRAILARR") - .HasColumnType("int"); - - b.Property("TRAILB") - .HasColumnType("int"); - - b.Property("TRAILBLI") - .HasColumnType("int"); - - b.Property("TRAILBRR") - .HasColumnType("int"); - - b.Property("UDSBENRS") - .HasColumnType("int"); - - b.Property("UDSBENTC") - .HasColumnType("int"); - - b.Property("UDSBENTD") - .HasColumnType("int"); - - b.Property("UDSVERFC") - .HasColumnType("int"); - - b.Property("UDSVERFN") - .HasColumnType("int"); - - b.Property("UDSVERLC") - .HasColumnType("int"); - - b.Property("UDSVERLN") - .HasColumnType("int"); - - b.Property("UDSVERLR") - .HasColumnType("int"); - - b.Property("UDSVERNF") - .HasColumnType("int"); - - b.Property("UDSVERTE") - .HasColumnType("int"); - - b.Property("UDSVERTI") - .HasColumnType("int"); - - b.Property("UDSVERTN") - .HasColumnType("int"); - - b.Property("VEG") - .HasColumnType("int"); - - b.Property("VisitId") - .HasColumnType("int") - .HasColumnOrder(1); - - b.HasKey("Id"); - - b.HasIndex("VisitId") - .IsUnique(); - - b.ToTable("tbl_C1s"); - }); - - modelBuilder.Entity("UDS.Net.API.Entities.C2", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasColumnName("FormId") - .HasColumnOrder(0); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("ANIMALS") - .HasColumnType("int"); - - b.Property("CERAD1INT") - .HasColumnType("int"); - - b.Property("CERAD1READ") - .HasColumnType("int"); - - b.Property("CERAD1REC") - .HasColumnType("int"); - - b.Property("CERAD2INT") - .HasColumnType("int"); - - b.Property("CERAD2READ") - .HasColumnType("int"); - - b.Property("CERAD2REC") - .HasColumnType("int"); - - b.Property("CERAD3INT") - .HasColumnType("int"); - - b.Property("CERAD3READ") - .HasColumnType("int"); - - b.Property("CERAD3REC") - .HasColumnType("int"); - - b.Property("CERADDTI") - .HasColumnType("int"); - - b.Property("CERADJ6INT") - .HasColumnType("int"); - - b.Property("CERADJ6REC") - .HasColumnType("int"); - - b.Property("CERADJ7NO") - .HasColumnType("int"); - - b.Property("CERADJ7YES") - .HasColumnType("int"); - - b.Property("COGSTAT") - .HasColumnType("int"); - - b.Property("CRAFTCUE") - .HasColumnType("int"); - - b.Property("CRAFTDRE") - .HasColumnType("int"); - - b.Property("CRAFTDTI") - .HasColumnType("int"); - - b.Property("CRAFTDVR") - .HasColumnType("int"); - - b.Property("CRAFTURS") - .HasColumnType("int"); - - b.Property("CRAFTVRS") - .HasColumnType("int"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("DIGBACCT") - .HasColumnType("int"); - - b.Property("DIGBACLS") - .HasColumnType("int"); - - b.Property("DIGFORCT") - .HasColumnType("int"); - - b.Property("DIGFORSL") - .HasColumnType("int"); - - b.Property("DeletedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("FRMDATE") - .HasColumnType("datetime2") - .HasColumnName("FRMDATE") - .HasColumnOrder(3); - - b.Property("INITIALS") - .IsRequired() - .HasMaxLength(3) - .HasColumnType("nvarchar(3)") - .HasColumnName("INITIALS") - .HasColumnOrder(4); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("LANG") - .HasColumnType("int") - .HasColumnName("LANG") - .HasColumnOrder(5); - - b.Property("MINTPCNC") - .HasColumnType("int"); - - b.Property("MINTPCNG") - .HasColumnType("int"); - - b.Property("MINTSCNC") - .HasColumnType("int"); - - b.Property("MINTSCNG") - .HasColumnType("int"); - - b.Property("MINTTOTS") - .HasColumnType("int"); - - b.Property("MINTTOTW") - .HasColumnType("int"); - - b.Property("MOCAABST") - .HasColumnType("int"); - - b.Property("MOCACLOC") - .HasColumnType("int"); - - b.Property("MOCACLOH") - .HasColumnType("int"); - - b.Property("MOCACLON") - .HasColumnType("int"); - - b.Property("MOCACOMP") - .HasColumnType("int"); - - b.Property("MOCACUBE") - .HasColumnType("int"); - - b.Property("MOCADIGI") - .HasColumnType("int"); - - b.Property("MOCAFLUE") - .HasColumnType("int"); - - b.Property("MOCAHEAR") - .HasColumnType("int"); - - b.Property("MOCALAN") - .HasColumnType("int"); - - b.Property("MOCALANX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.Property("MOCALETT") - .HasColumnType("int"); - - b.Property("MOCALOC") - .HasColumnType("int"); - - b.Property("MOCANAMI") - .HasColumnType("int"); - - b.Property("MOCAORCT") - .HasColumnType("int"); - - b.Property("MOCAORDT") - .HasColumnType("int"); - - b.Property("MOCAORDY") - .HasColumnType("int"); - - b.Property("MOCAORMO") - .HasColumnType("int"); - - b.Property("MOCAORPL") - .HasColumnType("int"); - - b.Property("MOCAORYR") - .HasColumnType("int"); - - b.Property("MOCAREAS") - .HasColumnType("int"); - - b.Property("MOCARECC") - .HasColumnType("int"); - - b.Property("MOCARECN") - .HasColumnType("int"); - - b.Property("MOCARECR") - .HasColumnType("int"); - - b.Property("MOCAREGI") - .HasColumnType("int"); - - b.Property("MOCAREPE") - .HasColumnType("int"); - - b.Property("MOCASER7") - .HasColumnType("int"); - - b.Property("MOCATOTS") - .HasColumnType("int"); - - b.Property("MOCATRAI") - .HasColumnType("int"); - - b.Property("MOCAVIS") - .HasColumnType("int"); - - b.Property("MODE") - .HasColumnType("int") - .HasColumnName("MODE") - .HasColumnOrder(6); - - b.Property("ModifiedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("NOT") - .HasColumnType("int") - .HasColumnName("NOT") - .HasColumnOrder(9); - - b.Property("NPSYCLOC") - .HasColumnType("int"); - - b.Property("NPSYLAN") - .HasColumnType("int"); - - b.Property("NPSYLANX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.Property("RESPASST") - .HasColumnType("int"); - - b.Property("RESPDISN") - .HasColumnType("int"); - - b.Property("RESPDIST") - .HasColumnType("int"); - - b.Property("RESPEMOT") - .HasColumnType("int"); - - b.Property("RESPFATG") - .HasColumnType("int"); - - b.Property("RESPHEAR") - .HasColumnType("int"); - - b.Property("RESPINTR") - .HasColumnType("int"); - - b.Property("RESPOTH") - .HasColumnType("int"); - - b.Property("RESPOTHX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.Property("RESPVAL") - .HasColumnType("int"); - - b.Property("REY1INT") - .HasColumnType("int"); - - b.Property("REY1REC") - .HasColumnType("int"); - - b.Property("REY2INT") - .HasColumnType("int"); - - b.Property("REY2REC") - .HasColumnType("int"); - - b.Property("REY3INT") - .HasColumnType("int"); - - b.Property("REY3REC") - .HasColumnType("int"); - - b.Property("REY4INT") - .HasColumnType("int"); - - b.Property("REY4REC") - .HasColumnType("int"); - - b.Property("REY5INT") - .HasColumnType("int"); - - b.Property("REY5REC") - .HasColumnType("int"); - - b.Property("REY6INT") - .HasColumnType("int"); - - b.Property("REY6REC") - .HasColumnType("int"); - - b.Property("REYBINT") - .HasColumnType("int"); - - b.Property("REYBREC") - .HasColumnType("int"); - - b.Property("REYDINT") - .HasColumnType("int"); - - b.Property("REYDREC") - .HasColumnType("int"); - - b.Property("REYDTI") - .HasColumnType("int"); - - b.Property("REYFPOS") - .HasColumnType("int"); - - b.Property("REYMETHOD") - .HasColumnType("int"); - - b.Property("REYTCOR") - .HasColumnType("int"); - - b.Property("RMMODE") - .HasColumnType("int") - .HasColumnName("RMMODE") - .HasColumnOrder(8); - - b.Property("RMREAS") - .HasColumnType("int") - .HasColumnName("RMREASON") - .HasColumnOrder(7); - - b.Property("Status") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("nvarchar(20)") - .HasColumnOrder(2); - - b.Property("TRAILA") - .HasColumnType("int"); - - b.Property("TRAILALI") - .HasColumnType("int"); - - b.Property("TRAILARR") - .HasColumnType("int"); - - b.Property("TRAILB") - .HasColumnType("int"); - - b.Property("TRAILBLI") - .HasColumnType("int"); - - b.Property("TRAILBRR") - .HasColumnType("int"); - - b.Property("UDSBENRS") - .HasColumnType("int"); - - b.Property("UDSBENTC") - .HasColumnType("int"); - - b.Property("UDSBENTD") - .HasColumnType("int"); - - b.Property("UDSVERFC") - .HasColumnType("int"); - - b.Property("UDSVERFN") - .HasColumnType("int"); - - b.Property("UDSVERLC") - .HasColumnType("int"); - - b.Property("UDSVERLN") - .HasColumnType("int"); - - b.Property("UDSVERLR") - .HasColumnType("int"); - - b.Property("UDSVERNF") - .HasColumnType("int"); - - b.Property("UDSVERTE") - .HasColumnType("int"); - - b.Property("UDSVERTI") - .HasColumnType("int"); - - b.Property("UDSVERTN") - .HasColumnType("int"); - - b.Property("VEG") - .HasColumnType("int"); - - b.Property("VERBALTEST") - .HasColumnType("int"); - - b.Property("VisitId") - .HasColumnType("int") - .HasColumnOrder(1); - - b.HasKey("Id"); - - b.HasIndex("VisitId") - .IsUnique(); - - b.ToTable("tbl_C2s"); - }); - - modelBuilder.Entity("UDS.Net.API.Entities.D1a", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasColumnName("FormId") - .HasColumnOrder(0); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("ALCDEM") - .HasColumnType("bit") - .HasComment("27. Cognitive impairment due to alcohol abuse (present)"); - - b.Property("ALCDEMIF") - .HasColumnType("int") - .HasComment("27a. Cognitive impairment due to alcohol abuse (primary/contributing/non-contributing)"); - - b.Property("AMNDEM") - .HasColumnType("bit") - .HasComment("8a. Amnestic predominant syndrome"); - - b.Property("ANXIET") - .HasColumnType("bit") - .HasComment("14. Anxiety disorder (present)"); - - b.Property("ANXIETIF") - .HasColumnType("int") - .HasComment("14a. Anxiety disorder (primary/contributing/non-contributing)"); - - b.Property("APNEADX") - .HasColumnType("bit") - .HasComment("25. Sleep apnea (i.e., obstructive, central, mixed or complex sleep apnea) (present)"); - - b.Property("APNEADXIF") - .HasColumnType("int") - .HasComment("25a. Sleep apnea (i.e., obstructive, central, mixed or complex sleep apnea) (primary/contributing/non-contributing)"); - - b.Property("BDOMAFREG") - .HasColumnType("int") - .HasComment("7b. MBI affected domains - Affective regulation"); - - b.Property("BDOMIMP") - .HasColumnType("int") - .HasComment("7c. MBI affected domains - Impulse control"); - - b.Property("BDOMMOT") - .HasColumnType("int") - .HasComment("7a. MBI affected domains - Motivation"); - - b.Property("BDOMSOCIAL") - .HasColumnType("int") - .HasComment("7d. MBI affected domains - Social appropriateness"); - - b.Property("BDOMTHTS") - .HasColumnType("int") - .HasComment("7e. MBI affected domains - Thought content/perception"); - - b.Property("BIPOLDIF") - .HasColumnType("int") - .HasComment("12a. Bipolar disorder (primary/contributing/non-contributing)"); - - b.Property("BIPOLDX") - .HasColumnType("bit") - .HasComment("12. Bipolar disorder (present)"); - - b.Property("CBSSYN") - .HasColumnType("bit") - .HasComment("8j. Corticobasal syndrome (CBS)"); - - b.Property("CDOMAPRAX") - .HasColumnType("bit") - .HasComment("6g. Dementia and MCI affected domains - Apraxia"); - - b.Property("CDOMATTN") - .HasColumnType("bit") - .HasComment("6c. Dementia and MCI affected domains - Attention"); - - b.Property("CDOMBEH") - .HasColumnType("bit") - .HasComment("6f. Dementia and MCI affected domains - Behavioral"); - - b.Property("CDOMEXEC") - .HasColumnType("bit") - .HasComment("6d. Dementia and MCI affected domains - Executive"); - - b.Property("CDOMLANG") - .HasColumnType("bit") - .HasComment("6b. Dementia and MCI affected domains - Language"); - - b.Property("CDOMMEM") - .HasColumnType("bit") - .HasComment("6a. Dementia and MCI affected domains - Memory"); - - b.Property("CDOMVISU") - .HasColumnType("bit") - .HasComment("6e. Dementia and MCI affected domains - Visuospatial"); - - b.Property("COGOTH") - .HasColumnType("bit") - .HasComment("30. Cognitive impairment not otherwise specified (NOS) (present)"); - - b.Property("COGOTH2") - .HasColumnType("bit") - .HasComment("31. Cognitive impairment not otherwise specified (NOS) (present)"); - - b.Property("COGOTH2F") - .HasColumnType("int") - .HasComment("31a. Cognitive impairment NOS (primary/contributing/non-contributing)"); - - b.Property("COGOTH2X") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)") - .HasComment("31b. Cognitive impairment NOS (specify)"); - - b.Property("COGOTH3") - .HasColumnType("bit") - .HasComment("32. Cognitive impairment not otherwise specified (NOS) (present)"); - - b.Property("COGOTH3F") - .HasColumnType("int") - .HasComment("32a. Cognitive impairment NOS (primary/contributing/non-contributing)"); - - b.Property("COGOTH3X") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)") - .HasComment("32b. Cognitive impairment NOS (specify)"); - - b.Property("COGOTHIF") - .HasColumnType("int") - .HasComment("30a. Cognitive impairment NOS (primary/contributing/non-contributing)"); - - b.Property("COGOTHX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)") - .HasComment("30b. Cognitive impairment NOS (specify)"); - - b.Property("CTESYN") - .HasColumnType("bit") - .HasComment("8i. Traumatic encephalopathy syndrome"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("DELIR") - .HasColumnType("bit") - .HasComment("17. Delirium (present)"); - - b.Property("DELIRIF") - .HasColumnType("int") - .HasComment("17a. Delirium (primary/contributing/non-contributing)"); - - b.Property("DEMENTED") - .HasColumnType("int") - .HasComment("3. Does the participant meet criteria for dementia?"); - - b.Property("DXMETHOD") - .HasColumnType("int") - .HasComment("1. Diagnosis method—responses in this form are based on diagnosis by a:"); - - b.Property("DYEXECSYN") - .HasColumnType("bit") - .HasComment("8b. Dysexecutive predominant syndrome"); - - b.Property("DeletedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("EPILEP") - .HasColumnType("bit") - .HasComment("20. Epilepsy (present)"); - - b.Property("EPILEPIF") - .HasColumnType("int") - .HasComment("20a. Epilepsy (primary/contributing/non-contributing)"); - - b.Property("FRMDATE") - .HasColumnType("datetime2") - .HasColumnName("FRMDATE") - .HasColumnOrder(3); - - b.Property("FTDSYN") - .HasColumnType("bit") - .HasComment("8e. Behavioral variant frontotemporal (bvFTD) syndrome"); - - b.Property("GENANX") - .HasColumnType("bit") - .HasComment("14b. Generalized Anxiety Disorder"); - - b.Property("HIV") - .HasColumnType("bit") - .HasComment("23. Human Immunodeficiency Virus (HIV) infection (present)"); - - b.Property("HIVIF") - .HasColumnType("int") - .HasComment("23a. Human Immunodeficiency Virus (HIV) infection (primary/contributing/non-contributing)"); - - b.Property("HYCEPH") - .HasColumnType("bit") - .HasComment("21. Normal-pressure hydrocephalus (present)"); - - b.Property("HYCEPHIF") - .HasColumnType("int") - .HasComment("21a. Normal-pressure hydrocephalus (primary/contributing/non-contributing)"); - - b.Property("IMPNOMCI") - .HasColumnType("bit") - .HasComment("5b. Cognitively impaired, not MCI"); - - b.Property("IMPNOMCICG") - .HasColumnType("bit") - .HasComment("5a2. Cognitively impaired, not MCI reason - Cognitive testing is abnormal but no clinical concern or functional decline (e.g., CDR SB=0 and FAS=0)"); - - b.Property("IMPNOMCIFU") - .HasColumnType("bit") - .HasComment("5a1. Cognitively impaired, not MCI reason - Evidence of functional impairment (e.g., CDR SB>0 and/or FAS>0), but available cognitive testing is judged to be normal"); - - b.Property("IMPNOMCIO") - .HasColumnType("bit") - .HasComment("5a4. Cognitively impaired, not MCI reason - Other"); - - b.Property("IMPNOMCIOX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)") - .HasComment("5a4a. Cognitively impaired, not MCI reason - Other (specify)"); - - b.Property("IMPNOMCLCD") - .HasColumnType("bit") - .HasComment("5a3. Cognitively impaired, not MCI reason - Longstanding cognitive difficulties, not representing a change from their usual function"); - - b.Property("IMPSUB") - .HasColumnType("bit") - .HasComment("28. Cognitive impairment due to substance use or abuse (present)"); - - b.Property("IMPSUBIF") - .HasColumnType("int") - .HasComment("28a. Cognitive impairment due to substance use or abuse (primary/contributing/non-contributing)"); - - b.Property("INITIALS") - .IsRequired() - .HasMaxLength(3) - .HasColumnType("nvarchar(3)") - .HasColumnName("INITIALS") - .HasColumnOrder(4); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("LANG") - .HasColumnType("int") - .HasColumnName("LANG") - .HasColumnOrder(5); - - b.Property("LBDSYN") - .HasColumnType("bit") - .HasComment("8f. Lewy body syndrome"); - - b.Property("LBDSYNT") - .HasColumnType("int") - .HasComment("8f1. Lewy body syndrome - type"); - - b.Property("MAJDEPDIF") - .HasColumnType("int") - .HasComment("10a. Major depressive disorder (primary/contributing/non-contributing)"); - - b.Property("MAJDEPDX") - .HasColumnType("bit") - .HasComment("10. Major depressive disorder (present)"); - - b.Property("MBI") - .HasColumnType("int") - .HasComment("7. Does the participant meet criteria for MBI"); - - b.Property("MCI") - .HasColumnType("int") - .HasComment("4b. Does the participant meet criteria for MCI (amnestic or non-amnestic)?"); - - b.Property("MCICRITCLN") - .HasColumnType("bit") - .HasComment("4a1. MCI criteria - Clinical concern about decline in cognition compared to participant’s prior level of lifelong or usual cognitive function"); - - b.Property("MCICRITFUN") - .HasColumnType("bit") - .HasComment("4a3. MCI criteria - Largely preserved functional independence OR functional dependence that is not related to cognitive decline"); - - b.Property("MCICRITIMP") - .HasColumnType("bit") - .HasComment("4a2. MCI criteria - Impairment in one or more cognitive domains, compared to participant’s estimated prior level of lifelong or usual cognitive function, or supported by objective longitudinal neuropsychological evidence of decline"); - - b.Property("MEDS") - .HasColumnType("bit") - .HasComment("29. Cognitive impairment due to medications (present)"); - - b.Property("MEDSIF") - .HasColumnType("int") - .HasComment("29a. Cognitive impairment due to medications (primary/contributing/non-contributing)"); - - b.Property("MODE") - .HasColumnType("int") - .HasColumnName("MODE") - .HasColumnOrder(6); - - b.Property("MSASYN") - .HasColumnType("bit") - .HasComment("8k. Multiple system atrophy (MSA) syndrome"); - - b.Property("MSASYNT") - .HasColumnType("int") - .HasComment("8k1. Multiple system atrophy (MSA) syndrome - type"); - - b.Property("ModifiedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("NAMNDEM") - .HasColumnType("bit") - .HasComment("8g. Non-amnestic multidomain syndrome, not PCA, PPA, bvFT, or DLB syndrome"); - - b.Property("NDEVDIS") - .HasColumnType("bit") - .HasComment("16. Developmental neuropsychiatric disorders (e.g., autism spectrum disorder (ASD), attention-deficit hyperactivity disorder (ADHD), dyslexia) (present)"); - - b.Property("NDEVDISIF") - .HasColumnType("int") - .HasComment("16a. Developmental neuropsychiatric disorders (e.g., autism spectrum disorder (ASD), attention-deficit hyperactivity disorder (primary/contributing/non-contributing)"); - - b.Property("NEOP") - .HasColumnType("bit") - .HasComment("22. CNS Neoplasm (present)"); - - b.Property("NEOPIF") - .HasColumnType("int") - .HasComment("22a. CNS Neoplasm (primary/contributing/non-contributing)"); - - b.Property("NEOPSTAT") - .HasColumnType("int") - .HasComment("22b. CNS Neoplasm - benign or malignant"); - - b.Property("NORMCOG") - .HasColumnType("int") - .HasComment("2. Does the participant have unimpaired cognition & behavior"); - - b.Property("NOT") - .HasColumnType("int") - .HasColumnName("NOT") - .HasColumnOrder(9); - - b.Property("OCDDX") - .HasColumnType("bit") - .HasComment("14d. Obsessive-compulsive disorder (OCD)"); - - b.Property("OTHANXD") - .HasColumnType("bit") - .HasComment("14e. Other anxiety disorder"); - - b.Property("OTHANXDX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)") - .HasComment("14e1. Other anxiety disorder (specify)"); - - b.Property("OTHCILLIF") - .HasColumnType("int") - .HasComment("26a. Cognitive impairment due to other neurologic, genetic, infectious conditions (not listed above), or systemic disease/medical illness (as indicated on Form A5/D2) (primary/contributing/non-contributing)"); - - b.Property("OTHCOGILL") - .HasColumnType("bit") - .HasComment("26. Cognitive impairment due to other neurologic, genetic, infectious conditions (not listed above), or systemic disease/medical illness (as indicated on Form A5/D2) (present)"); - - b.Property("OTHCOGILLX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)") - .HasComment("26b. Specify cognitive impairment due to other neurologic, genetic, infection conditions or systemic disease"); - - b.Property("OTHDEPDIF") - .HasColumnType("int") - .HasComment("11a. Other specified depressive disorder (primary/contributing/non-contributing)"); - - b.Property("OTHDEPDX") - .HasColumnType("bit") - .HasComment("11. Other specified depressive disorder (present)"); - - b.Property("OTHPSY") - .HasColumnType("bit") - .HasComment("18. Other psychiatric disorder (present)"); - - b.Property("OTHPSYIF") - .HasColumnType("int") - .HasComment("18a. Other psychiatric disorder (primary/contributing/non-contributing)"); - - b.Property("OTHPSYX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)") - .HasComment("18b. Other psychiatric disorder (specify)"); - - b.Property("OTHSYN") - .HasColumnType("bit") - .HasComment("8l. Other syndrome"); - - b.Property("OTHSYNX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)") - .HasComment("8l1. Other syndrome (specify)"); - - b.Property("PANICDISDX") - .HasColumnType("bit") - .HasComment("14c. Panic Disorder"); - - b.Property("PCA") - .HasColumnType("bit") - .HasComment("8c. Primary visual presentation (such as posterior cortical atrophy (PCA) syndrome)"); - - b.Property("POSTC19") - .HasColumnType("bit") - .HasComment("24. Post COVID-19 cognitive impairment (present)"); - - b.Property("POSTC19IF") - .HasColumnType("int") - .HasComment("24a. Post COVID-19 cognitive impairment (primary/contributing/non-contributing)"); - - b.Property("PPASYN") - .HasColumnType("bit") - .HasComment("8d. Primary progressive aphasia (PPA) syndrome"); - - b.Property("PPASYNT") - .HasColumnType("int") - .HasComment("8d1. Primary progressive aphasia (PPA) syndrome - type"); - - b.Property("PREDOMSYN") - .HasColumnType("int") - .HasComment("8. Is there a predominant clinical syndrome?"); - - b.Property("PSPSYN") - .HasColumnType("bit") - .HasComment("8h. Primary supranuclear palsy (PSP) syndrome"); - - b.Property("PSPSYNT") - .HasColumnType("int") - .HasComment("8h1. Primary supranuclear palsy (PSP) syndrome - type"); - - b.Property("PTSDDX") - .HasColumnType("bit") - .HasComment("15. Post-traumatic stress disorder (PTSD) (present)"); - - b.Property("PTSDDXIF") - .HasColumnType("int") - .HasComment("15a. Post-traumatic stress disorder (PTSD) (primary/contributing/non-contributing)"); - - b.Property("RMMODE") - .HasColumnType("int") - .HasColumnName("RMMODE") - .HasColumnOrder(8); - - b.Property("RMREAS") - .HasColumnType("int") - .HasColumnName("RMREASON") - .HasColumnOrder(7); - - b.Property("SCD") - .HasColumnType("int") - .HasComment("2a. Does the participant report 1) significant concerns about changes in cognition AND 2) no neuropsychological evidence of decline AND 3) no functional decline?"); - - b.Property("SCDDXCONF") - .HasColumnType("int") - .HasComment("2b. As a clinician, are you confident that the subjective cognitive decline is clinically meaningful?"); - - b.Property("SCHIZOIF") - .HasColumnType("int") - .HasComment("13a. Schizophrenia or other psychotic disorder (primary/contributing/non-contributing)"); - - b.Property("SCHIZOP") - .HasColumnType("bit") - .HasComment("13. Schizophrenia or other psychotic disorder (present)"); - - b.Property("SYNINFBIOM") - .HasColumnType("bit") - .HasComment("9c. Indicate the source(s) of information used to assign the clinical syndrome - Biomarkers (MRI, PET, CSF, plasma)"); - - b.Property("SYNINFCLIN") - .HasColumnType("bit") - .HasComment("9a. Indicate the source(s) of information used to assign the clinical syndrome - Clinical information (history, CDR)"); - - b.Property("SYNINFCTST") - .HasColumnType("bit") - .HasComment("9b. Indicate the source(s) of information used to assign the clinical syndrome - Cognitive testing"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("nvarchar(20)") - .HasColumnOrder(2); - - b.Property("TBIDX") - .HasColumnType("bit") - .HasComment("19. Traumatic brain injury (present)"); - - b.Property("TBIDXIF") - .HasColumnType("int") - .HasComment("19a. Traumatic brain injury (primary/contributing/non-contributing)"); - - b.Property("VisitId") - .HasColumnType("int") - .HasColumnOrder(1); - - b.HasKey("Id"); - - b.HasIndex("VisitId") - .IsUnique(); - - b.ToTable("tbl_D1as"); - }); - - modelBuilder.Entity("UDS.Net.API.Entities.D1b", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasColumnName("FormId") - .HasColumnOrder(0); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("ALZDIS") - .HasColumnType("bit") - .HasComment("12. Alzheimer's disease"); - - b.Property("ALZDISIF") - .HasColumnType("int") - .HasComment("12a. Primary, contributing, or non-contributing - Alzheimer's disease"); - - b.Property("AMYLPET") - .HasColumnType("int") - .HasComment("6a1. Elevated amyloid"); - - b.Property("AUTDOMMUT") - .HasColumnType("int") - .HasComment("11. Is there an autosomal dominant pathogenic variant to support an etiological diagnosis?"); - - b.Property("BIOMAD1") - .HasColumnType("int") - .HasComment("8a. Other biomarker modality - Consistent with AD"); - - b.Property("BIOMAD2") - .HasColumnType("int") - .HasComment("9a. Other biomarker modality - Consistent with AD"); - - b.Property("BIOMAD3") - .HasColumnType("int") - .HasComment("10a. Other biomarker modality - Consistent with AD"); - - b.Property("BIOMARKDX") - .HasColumnType("int") - .HasComment("1. Were any biomarker results used to support the current etiological diagnosis?"); - - b.Property("BIOMFTLD1") - .HasColumnType("int") - .HasComment("8b. Other biomarker modality - Consistent with FTLD"); - - b.Property("BIOMFTLD2") - .HasColumnType("int") - .HasComment("9b. Other biomarker modality - Consistent with FTLD"); - - b.Property("BIOMFTLD3") - .HasColumnType("int") - .HasComment("10b. Other biomarker modality - Consistent with FTLD"); - - b.Property("BIOMLBD1") - .HasColumnType("int") - .HasComment("8c. Other biomarker modality - Consistent with LBD"); - - b.Property("BIOMLBD2") - .HasColumnType("int") - .HasComment("9c. Other biomarker modality - Consistent with LBD"); - - b.Property("BIOMLBD3") - .HasColumnType("int") - .HasComment("10c. Other biomarker modality - Consistent with LBD"); - - b.Property("BIOMOTH1") - .HasColumnType("int") - .HasComment("8d. Other biomarker modality - Consistent with other etiology"); - - b.Property("BIOMOTH2") - .HasColumnType("int") - .HasComment("9d. Other biomarker modality - Consistent with other etiology"); - - b.Property("BIOMOTH3") - .HasColumnType("int") - .HasComment("10d. Other biomarker modality - Consistent with other etiology"); - - b.Property("BIOMOTHX1") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)") - .HasComment("8d1. Other biomarker modality - Consistent with other etiology (specify)"); - - b.Property("BIOMOTHX2") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)") - .HasComment("9d1. Other biomarker modality - Consistent with other etiology (specify)"); - - b.Property("BIOMOTHX3") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)") - .HasComment("10d1. Other biomarker modality - Consistent with other etiology (specify)"); - - b.Property("BLOODAD") - .HasColumnType("int") - .HasComment("3a. Blood-based biomarkers - Consistent with AD"); - - b.Property("BLOODFTLD") - .HasColumnType("int") - .HasComment("3b. Blood-based biomarkers - Consistent with FTLD"); - - b.Property("BLOODLBD") - .HasColumnType("int") - .HasComment("3c. Blood-based biomarkers - Consistent with LBD"); - - b.Property("BLOODOTH") - .HasColumnType("int") - .HasComment("3d. Blood-based biomarkers - Consistent with other etiology"); - - b.Property("BLOODOTHX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)") - .HasComment("3d1. Blood-based biomarkers - Consistent with other etiology (specify)"); - - b.Property("CAA") - .HasColumnType("bit") - .HasComment("21. Cerebral amyloid angiopathy"); - - b.Property("CAAIF") - .HasColumnType("int") - .HasComment("21a. Primary, contributing, or non-contributing - Cerebral amyloid angiopathy"); - - b.Property("CORT") - .HasColumnType("bit") - .HasComment("14b2. Corticobasal degeneration (CBD)"); - - b.Property("CORTIF") - .HasColumnType("int") - .HasComment("14b2a. Primary, contributing, or non-contributing - Corticobasal degeneration (CBD)"); - - b.Property("CSFAD") - .HasColumnType("int") - .HasComment("4a. CSF-based biomarkers - Consistent with AD"); - - b.Property("CSFFTLD") - .HasColumnType("int") - .HasComment("4b. CSF-based biomarkers - Consistent with FTLD"); - - b.Property("CSFLBD") - .HasColumnType("int") - .HasComment("4c. CSF-based biomarkers - Consistent with LBD"); - - b.Property("CSFOTH") - .HasColumnType("int") - .HasComment("4d. CSF-based biomarkers - Consistent with other etiology"); - - b.Property("CSFOTHX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)") - .HasComment("4d1. CSF-based biomarkers - Consistent with other etiology (specify)"); - - b.Property("CTE") - .HasColumnType("bit") - .HasComment("17. Chronic traumatic encephalopathy"); - - b.Property("CTEIF") - .HasColumnType("int") - .HasComment("17a. Primary, contributing, or non-contributing - Chronic traumatic encephalopathy"); - - b.Property("CVD") - .HasColumnType("bit") - .HasComment("15. Vascular brain injury (based on clinical and imaging evidence according to your Center's standards)"); - - b.Property("CVDIF") - .HasColumnType("int") - .HasComment("15a. Primary, contributing, or non-contributing - Vascular brain injury"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("DATSCANDX") - .HasColumnType("int") - .HasComment("6c. Dopamine Transporter (DAT) Scan - Was DAT Scan data or information used to support an etiological diagnosis?"); - - b.Property("DOWNS") - .HasColumnType("bit") - .HasComment("18. Down syndrome"); - - b.Property("DOWNSIF") - .HasColumnType("int") - .HasComment("18a. Primary, contributing, or non-contributing - Down syndrome"); - - b.Property("DeletedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("FDGAD") - .HasColumnType("int") - .HasComment("6b1. FDG PET - Consistent with AD"); - - b.Property("FDGFTLD") - .HasColumnType("int") - .HasComment("6b2. FDG PET - Consistent with FTLD"); - - b.Property("FDGLBD") - .HasColumnType("int") - .HasComment("6b3. FDG PET - Consistent with LBD"); - - b.Property("FDGOTH") - .HasColumnType("int") - .HasComment("6b4. FDG PET - Consistent with other etiology"); - - b.Property("FDGOTHX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)") - .HasComment("6b4a. FDG PET - Consistent with other etiology (specify)"); - - b.Property("FDGPETDX") - .HasColumnType("int") - .HasComment("6b. FDG PET - Was FDG PET data or information used to support an etiological diagnosis?"); - - b.Property("FLUIDBIOM") - .HasColumnType("int") - .HasComment("2. Fluid Biomarkers - Were fluid biomarkers used for assessing the etiological diagnosis?"); - - b.Property("FRMDATE") - .HasColumnType("datetime2") - .HasColumnName("FRMDATE") - .HasColumnOrder(3); - - b.Property("FTLD") - .HasColumnType("bit") - .HasComment("14. Frontotemporal lobar degeneration"); - - b.Property("FTLDIF") - .HasColumnType("int") - .HasComment("14a. Primary, contributing, or non-contributing - Frontotemporal lobar degeneration"); - - b.Property("FTLDMO") - .HasColumnType("bit") - .HasComment("14b3. FTLD with motor neuron disease"); - - b.Property("FTLDMOIF") - .HasColumnType("int") - .HasComment("14b3a. Primary, contributing, or non-contributing - FTLD with motor neuron disease"); - - b.Property("FTLDNOIF") - .HasColumnType("int") - .HasComment("14b4a. Primary, contributing, or non-contributing - FTLD not otherwise specified (NOS)"); - - b.Property("FTLDNOS") - .HasColumnType("bit") - .HasComment("14b4. FTLD not otherwise specified (NOS)"); - - b.Property("FTLDSUBT") - .HasColumnType("int") - .HasComment("14c. FTLD subtype"); - - b.Property("FTLDSUBX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)") - .HasComment("14c1. Other FTLD subtype (specify)"); - - b.Property("HUNT") - .HasColumnType("bit") - .HasComment("19. Huntington's disease"); - - b.Property("HUNTIF") - .HasColumnType("int") - .HasComment("19a. Primary, contributing, or non-contributing - Huntington's disease"); - - b.Property("IMAGEWMH") - .HasColumnType("int") - .HasComment("7a3f. Extensive white-matter hyperintensity (CHS score 7-8+)"); - - b.Property("IMAGINGDX") - .HasColumnType("int") - .HasComment("5. Imaging - Was imaging used for assessing etiological diagnosis?"); - - b.Property("IMAGLAC") - .HasColumnType("int") - .HasComment("7a3b. Lacunar infarct(s)"); - - b.Property("IMAGLINF") - .HasColumnType("int") - .HasComment("7a3a. Large vessel infarct(s)"); - - b.Property("IMAGMACH") - .HasColumnType("int") - .HasComment("7a3c. Macrohemorrhage(s)"); - - b.Property("IMAGMICH") - .HasColumnType("int") - .HasComment("7a3d. Microhemorrhage(s)"); - - b.Property("IMAGMWMH") - .HasColumnType("int") - .HasComment("7a3e. Moderate white-matter hyperintensity (CHS score 5-6)"); - - b.Property("INITIALS") - .IsRequired() - .HasMaxLength(3) - .HasColumnType("nvarchar(3)") - .HasColumnName("INITIALS") - .HasColumnOrder(4); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("LANG") - .HasColumnType("int") - .HasColumnName("LANG") - .HasColumnOrder(5); - - b.Property("LATE") - .HasColumnType("bit") - .HasComment("22. LATE: Limbic-predominant age-related TDP-43 encephalopathy"); - - b.Property("LATEIF") - .HasColumnType("int") - .HasComment("22a. Primary, contributing, or non-contributing - LATE"); - - b.Property("LBDIF") - .HasColumnType("int") - .HasComment("13a. Primary, contributing, or non-contributing - Lewy body disease"); - - b.Property("LBDIS") - .HasColumnType("bit") - .HasComment("13. Lewy body disease"); - - b.Property("MODE") - .HasColumnType("int") - .HasColumnName("MODE") - .HasColumnOrder(6); - - b.Property("MSA") - .HasColumnType("bit") - .HasComment("16. Multiple system atrophy"); - - b.Property("MSAIF") - .HasColumnType("int") - .HasComment("16a. Primary, contributing, or non-contributing - Multiple system atrophy"); - - b.Property("ModifiedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("NOT") - .HasColumnType("int") - .HasColumnName("NOT") - .HasColumnOrder(9); - - b.Property("OTHBIOM1") - .HasColumnType("int") - .HasComment("8. Other biomarker modality - Was another biomarker modality used to support an etiological diagnosis?"); - - b.Property("OTHBIOM2") - .HasColumnType("int") - .HasComment("9. Other biomarker modality - Was another biomarker modality used to support an etiological diagnosis?"); - - b.Property("OTHBIOM3") - .HasColumnType("int") - .HasComment("10. Other biomarker modality - Was another biomarker modality used to support an etiological diagnosis?"); - - b.Property("OTHBIOMX1") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)") - .HasComment("8a1. Other biomarker modality - Was another biomarker modality used to support an etiological diagnosis? (specify) OTHBI"); - - b.Property("OTHBIOMX2") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)") - .HasComment("9a1. Other biomarker modality - Was another biomarker modality used to support an etiological diagnosis? (specify)"); - - b.Property("OTHBIOMX3") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)") - .HasComment("10a1. Other biomarker modality - Was another biomarker modality used to support an etiological diagnosis? (specify)"); - - b.Property("OTHCOG") - .HasColumnType("bit") - .HasComment("23. Other"); - - b.Property("OTHCOGIF") - .HasColumnType("int") - .HasComment("23a. Primary, contributing, or non-contributing - Other"); - - b.Property("OTHCOGX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)") - .HasComment("23b. Other (specify)"); - - b.Property("PETDX") - .HasColumnType("int") - .HasComment("6a. Tracer-based PET - Were tracer-based PET measures used in assessing an etiological diagnosis?"); - - b.Property("PRION") - .HasColumnType("bit") - .HasComment("20. Prion disease (CJD, other)"); - - b.Property("PRIONIF") - .HasColumnType("int") - .HasComment("20a. Primary, contributing, or non-contributing - Prion disease (CJD, other)"); - - b.Property("PSP") - .HasColumnType("bit") - .HasComment("14ba. Primary supranuclear palsy (PSP)"); - - b.Property("PSPIF") - .HasColumnType("int") - .HasComment("14b1a. Primary, contributing, or non-contributing - Primary supranuclear palsy (PSP)"); - - b.Property("RMMODE") - .HasColumnType("int") - .HasColumnName("RMMODE") - .HasColumnOrder(8); - - b.Property("RMREAS") - .HasColumnType("int") - .HasColumnName("RMREASON") - .HasColumnOrder(7); - - b.Property("STRUCTAD") - .HasColumnType("int") - .HasComment("7a1. Atrophy pattern consistent with AD"); - - b.Property("STRUCTCVD") - .HasColumnType("int") - .HasComment("7a3. Consistent with cerebrovascular disease (CVD)"); - - b.Property("STRUCTDX") - .HasColumnType("int") - .HasComment("7a. Structural Imaging (i.e., MRI or CT) - Was structural imaging data or information used to support an etiological diagnosis?"); - - b.Property("STRUCTFTLD") - .HasColumnType("int") - .HasComment("7a2. Atrophy pattern consistent with FTLD"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("nvarchar(20)") - .HasColumnOrder(2); - - b.Property("TAUPET") - .HasColumnType("int") - .HasComment("6a2. Elevated tau pathology"); - - b.Property("TRACERAD") - .HasColumnType("int") - .HasComment("6d1. Other tracer-based imaging - Consistent with AD"); - - b.Property("TRACERFTLD") - .HasColumnType("int") - .HasComment("6d2. Other tracer-based imaging - Consistent with FTLD"); - - b.Property("TRACERLBD") - .HasColumnType("int") - .HasComment("6d3. Other tracer-based imaging - Consistent with LBD"); - - b.Property("TRACEROTH") - .HasColumnType("int") - .HasComment("6d4. Other tracer-based imaging - Consistent with other etiology"); - - b.Property("TRACEROTHX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)") - .HasComment("6d4a. Other tracer-based imaging - Consistent with other etiology (specify)"); - - b.Property("TRACOTHDX") - .HasColumnType("int") - .HasComment("6d. Other tracer-based imaging - Were other tracer-based imaging used to support an etiological diagnosis?"); - - b.Property("TRACOTHDXX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)") - .HasComment("6d1a. Other tracer-based imaging - Were other tracer-based imaging used to support an etiological diagnosis? (specify)"); - - b.Property("VisitId") - .HasColumnType("int") - .HasColumnOrder(1); - - b.HasKey("Id"); - - b.HasIndex("VisitId") - .IsUnique(); - - b.ToTable("tbl_D1bs"); - }); - - modelBuilder.Entity("UDS.Net.API.Entities.DrugCodeLookup", b => - { - b.Property("RxNormId") - .HasColumnType("int"); - - b.Property("BrandNames") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("DrugName") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("IsOverTheCounter") - .HasColumnType("bit"); - - b.Property("IsPopular") - .HasColumnType("bit"); - - b.HasKey("RxNormId"); - - b.ToTable("DrugCodesLookup"); - }); - - modelBuilder.Entity("UDS.Net.API.Entities.FormStatus", b => - { - b.Property("VisitId") - .HasColumnType("int") - .HasColumnOrder(1); - - b.Property("Kind") - .HasMaxLength(3) - .HasColumnType("nvarchar(3)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("DeletedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("FRMDATE") - .HasColumnType("datetime2") - .HasColumnName("FRMDATE") - .HasColumnOrder(3); - - b.Property("INITIALS") - .IsRequired() - .HasMaxLength(3) - .HasColumnType("nvarchar(3)") - .HasColumnName("INITIALS") - .HasColumnOrder(4); - - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasColumnName("FormId") - .HasColumnOrder(0); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("LANG") - .HasColumnType("int") - .HasColumnName("LANG") - .HasColumnOrder(5); - - b.Property("MODE") - .HasColumnType("int") - .HasColumnName("MODE") - .HasColumnOrder(6); - - b.Property("ModifiedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("NOT") - .HasColumnType("int") - .HasColumnName("NOT") - .HasColumnOrder(9); - - b.Property("RMMODE") - .HasColumnType("int") - .HasColumnName("RMMODE") - .HasColumnOrder(8); - - b.Property("RMREAS") - .HasColumnType("int") - .HasColumnName("RMREASON") - .HasColumnOrder(7); - - b.Property("Status") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("nvarchar(20)") - .HasColumnOrder(2); - - b.HasKey("VisitId", "Kind"); - - b.ToTable((string)null); - - b.ToView("vw_FormStatuses", (string)null); - }); - - modelBuilder.Entity("UDS.Net.API.Entities.M1", b => - { - b.Property("FormId") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("FormId")); - - b.Property("ACONSENT") - .HasColumnType("int"); - - b.Property("AUTOPSY") - .HasColumnType("int"); - - b.Property("CHANGEDY") - .HasColumnType("int"); - - b.Property("CHANGEMO") - .HasColumnType("int"); - - b.Property("CHANGEYR") - .HasColumnType("int"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("DEATHDY") - .HasColumnType("int"); - - b.Property("DEATHMO") - .HasColumnType("int"); - - b.Property("DEATHYR") - .HasColumnType("int"); - - b.Property("DECEASED") - .HasColumnType("int"); - - b.Property("DISCDAY") - .HasColumnType("int"); - - b.Property("DISCMO") - .HasColumnType("int"); - - b.Property("DISCONT") - .HasColumnType("int"); - - b.Property("DISCYR") - .HasColumnType("int"); - - b.Property("DROPREAS") - .HasColumnType("int"); - - b.Property("DeletedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("FTLDDISC") - .HasColumnType("int"); - - b.Property("FTLDREAS") - .HasColumnType("int"); - - b.Property("FTLDREAX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("MILESTONETYPE") - .HasColumnType("int"); - - b.Property("ModifiedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("NURSEDY") - .HasColumnType("int"); - - b.Property("NURSEMO") - .HasColumnType("int"); - - b.Property("NURSEYR") - .HasColumnType("int"); - - b.Property("PROTOCOL") - .HasColumnType("int"); - - b.Property("ParticipationId") - .HasColumnType("int"); - - b.Property("RECOGIM") - .HasColumnType("int"); - - b.Property("REJOIN") - .HasColumnType("int"); - - b.Property("RENAVAIL") - .HasColumnType("int"); - - b.Property("RENURSE") - .HasColumnType("int"); - - b.Property("REPHYILL") - .HasColumnType("int"); - - b.Property("REREFUSE") - .HasColumnType("int"); - - b.Property("Status") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b.HasKey("FormId"); - - b.HasIndex("ParticipationId"); - - b.ToTable("tbl_M1s"); - }); - - modelBuilder.Entity("UDS.Net.API.Entities.PacketSubmission", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasColumnName("PacketSubmissionId") - .HasColumnOrder(0); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("DeletedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModifiedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("SubmissionDate") - .HasColumnType("datetime2"); - - b.Property("VisitId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("VisitId"); - - b.ToTable("PacketSubmissions"); - }); - - modelBuilder.Entity("UDS.Net.API.Entities.PacketSubmissionError", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasColumnName("PacketSubmissionErrorId") - .HasColumnOrder(0); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("AssignedTo") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("DeletedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("FormKind") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("nvarchar(10)"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("Level") - .HasColumnType("int"); - - b.Property("Message") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("ModifiedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("PacketSubmissionId") - .HasColumnType("int"); - - b.Property("ResolvedBy") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("PacketSubmissionId"); - - b.ToTable("PacketSubmissionErrors"); - }); - - modelBuilder.Entity("UDS.Net.API.Entities.Participation", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasColumnName("ParticipationId"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("DeletedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("LegacyId") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("ModifiedBy") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Participation"); - }); - - modelBuilder.Entity("UDS.Net.API.Entities.T1", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasColumnName("FormId") - .HasColumnOrder(0); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("DeletedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("FRMDATE") - .HasColumnType("datetime2") - .HasColumnName("FRMDATE") - .HasColumnOrder(3); - - b.Property("INITIALS") - .IsRequired() - .HasMaxLength(3) - .HasColumnType("nvarchar(3)") - .HasColumnName("INITIALS") - .HasColumnOrder(4); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("LANG") - .HasColumnType("int") - .HasColumnName("LANG") - .HasColumnOrder(5); - - b.Property("MODE") - .HasColumnType("int") - .HasColumnName("MODE") - .HasColumnOrder(6); - - b.Property("ModifiedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("NOT") - .HasColumnType("int") - .HasColumnName("NOT") - .HasColumnOrder(9); - - b.Property("RMMODE") - .HasColumnType("int") - .HasColumnName("RMMODE") - .HasColumnOrder(8); - - b.Property("RMREAS") - .HasColumnType("int") - .HasColumnName("RMREASON") - .HasColumnOrder(7); - - b.Property("Status") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("nvarchar(20)") - .HasColumnOrder(2); - - b.Property("TELCOG") - .HasColumnType("int"); - - b.Property("TELCOV") - .HasColumnType("int"); - - b.Property("TELHOME") - .HasColumnType("int"); - - b.Property("TELILL") - .HasColumnType("int"); - - b.Property("TELINPER") - .HasColumnType("int"); - - b.Property("TELMILE") - .HasColumnType("int"); - - b.Property("TELMOD") - .HasColumnType("int"); - - b.Property("TELOTHR") - .HasColumnType("int"); - - b.Property("TELOTHRX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)"); - - b.Property("TELREFU") - .HasColumnType("int"); - - b.Property("VisitId") - .HasColumnType("int") - .HasColumnOrder(1); - - b.HasKey("Id"); - - b.HasIndex("VisitId") - .IsUnique(); - - b.ToTable("tbl_T1s"); - }); - - modelBuilder.Entity("UDS.Net.API.Entities.Visit", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasColumnName("VisitId"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("DSSDUB") - .HasColumnType("int"); - - b.Property("DeletedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("FORMVER") - .IsRequired() - .HasMaxLength(1) - .HasColumnType("nvarchar(1)") - .HasColumnName("FORMVER"); - - b.Property("INITIALS") - .IsRequired() - .HasMaxLength(3) - .HasColumnType("nvarchar(3)"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModifiedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("PACKET") - .IsRequired() - .HasMaxLength(1) - .HasColumnType("nvarchar(1)") - .HasColumnName("PACKET"); - - b.Property("ParticipationId") - .HasColumnType("int"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("VISITNUM") - .HasColumnType("int") - .HasColumnName("VISITNUM"); - - b.Property("VISIT_DATE") - .HasColumnType("datetime2"); - - b.HasKey("Id"); - - b.HasIndex("ParticipationId", "VISITNUM") - .IsUnique(); - - b.ToTable("tbl_Visits"); - }); - - modelBuilder.Entity("UDS.Net.API.Entities.A1", b => - { - b.HasOne("UDS.Net.API.Entities.Visit", null) - .WithOne("A1") - .HasForeignKey("UDS.Net.API.Entities.A1", "VisitId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("UDS.Net.API.Entities.A1a", b => - { - b.HasOne("UDS.Net.API.Entities.Visit", null) - .WithOne("A1a") - .HasForeignKey("UDS.Net.API.Entities.A1a", "VisitId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("UDS.Net.API.Entities.A2", b => - { - b.HasOne("UDS.Net.API.Entities.Visit", null) - .WithOne("A2") - .HasForeignKey("UDS.Net.API.Entities.A2", "VisitId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("UDS.Net.API.Entities.A3", b => - { - b.HasOne("UDS.Net.API.Entities.Visit", null) - .WithOne("A3") - .HasForeignKey("UDS.Net.API.Entities.A3", "VisitId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "KID1", b1 => - { - b1.Property("A3Id") - .HasColumnType("int"); - - b1.Property("AGD") - .HasColumnType("int"); - - b1.Property("AGO") - .HasColumnType("int"); - - b1.Property("ETPR") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b1.Property("ETSEC") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b1.Property("MEVAL") - .HasColumnType("int"); - - b1.Property("YOB") - .HasColumnType("int"); - - b1.HasKey("A3Id"); - - b1.ToTable("tbl_A3s"); - - b1.WithOwner() - .HasForeignKey("A3Id"); - }); - - b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "KID10", b1 => - { - b1.Property("A3Id") - .HasColumnType("int"); - - b1.Property("AGD") - .HasColumnType("int"); - - b1.Property("AGO") - .HasColumnType("int"); - - b1.Property("ETPR") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b1.Property("ETSEC") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b1.Property("MEVAL") - .HasColumnType("int"); - - b1.Property("YOB") - .HasColumnType("int"); - - b1.HasKey("A3Id"); - - b1.ToTable("tbl_A3s"); - - b1.WithOwner() - .HasForeignKey("A3Id"); - }); - - b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "KID11", b1 => - { - b1.Property("A3Id") - .HasColumnType("int"); - - b1.Property("AGD") - .HasColumnType("int"); - - b1.Property("AGO") - .HasColumnType("int"); - - b1.Property("ETPR") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b1.Property("ETSEC") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b1.Property("MEVAL") - .HasColumnType("int"); - - b1.Property("YOB") - .HasColumnType("int"); - - b1.HasKey("A3Id"); - - b1.ToTable("tbl_A3s"); - - b1.WithOwner() - .HasForeignKey("A3Id"); - }); - - b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "KID12", b1 => - { - b1.Property("A3Id") - .HasColumnType("int"); - - b1.Property("AGD") - .HasColumnType("int"); - - b1.Property("AGO") - .HasColumnType("int"); - - b1.Property("ETPR") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b1.Property("ETSEC") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b1.Property("MEVAL") - .HasColumnType("int"); - - b1.Property("YOB") - .HasColumnType("int"); - - b1.HasKey("A3Id"); - - b1.ToTable("tbl_A3s"); - - b1.WithOwner() - .HasForeignKey("A3Id"); - }); - - b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "KID13", b1 => - { - b1.Property("A3Id") - .HasColumnType("int"); - - b1.Property("AGD") - .HasColumnType("int"); - - b1.Property("AGO") - .HasColumnType("int"); - - b1.Property("ETPR") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b1.Property("ETSEC") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b1.Property("MEVAL") - .HasColumnType("int"); - - b1.Property("YOB") - .HasColumnType("int"); - - b1.HasKey("A3Id"); - - b1.ToTable("tbl_A3s"); - - b1.WithOwner() - .HasForeignKey("A3Id"); - }); - - b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "KID14", b1 => - { - b1.Property("A3Id") - .HasColumnType("int"); - - b1.Property("AGD") - .HasColumnType("int"); - - b1.Property("AGO") - .HasColumnType("int"); - - b1.Property("ETPR") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b1.Property("ETSEC") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b1.Property("MEVAL") - .HasColumnType("int"); - - b1.Property("YOB") - .HasColumnType("int"); - - b1.HasKey("A3Id"); - - b1.ToTable("tbl_A3s"); - - b1.WithOwner() - .HasForeignKey("A3Id"); - }); - - b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "KID15", b1 => - { - b1.Property("A3Id") - .HasColumnType("int"); - - b1.Property("AGD") - .HasColumnType("int"); - - b1.Property("AGO") - .HasColumnType("int"); - - b1.Property("ETPR") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b1.Property("ETSEC") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b1.Property("MEVAL") - .HasColumnType("int"); - - b1.Property("YOB") - .HasColumnType("int"); - - b1.HasKey("A3Id"); - - b1.ToTable("tbl_A3s"); - - b1.WithOwner() - .HasForeignKey("A3Id"); - }); - - b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "KID2", b1 => - { - b1.Property("A3Id") - .HasColumnType("int"); - - b1.Property("AGD") - .HasColumnType("int"); - - b1.Property("AGO") - .HasColumnType("int"); - - b1.Property("ETPR") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b1.Property("ETSEC") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b1.Property("MEVAL") - .HasColumnType("int"); - - b1.Property("YOB") - .HasColumnType("int"); - - b1.HasKey("A3Id"); - - b1.ToTable("tbl_A3s"); - - b1.WithOwner() - .HasForeignKey("A3Id"); - }); - - b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "KID3", b1 => - { - b1.Property("A3Id") - .HasColumnType("int"); - - b1.Property("AGD") - .HasColumnType("int"); - - b1.Property("AGO") - .HasColumnType("int"); - - b1.Property("ETPR") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b1.Property("ETSEC") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b1.Property("MEVAL") - .HasColumnType("int"); - - b1.Property("YOB") - .HasColumnType("int"); - - b1.HasKey("A3Id"); - - b1.ToTable("tbl_A3s"); - - b1.WithOwner() - .HasForeignKey("A3Id"); - }); - - b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "KID4", b1 => - { - b1.Property("A3Id") - .HasColumnType("int"); - - b1.Property("AGD") - .HasColumnType("int"); - - b1.Property("AGO") - .HasColumnType("int"); - - b1.Property("ETPR") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b1.Property("ETSEC") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b1.Property("MEVAL") - .HasColumnType("int"); - - b1.Property("YOB") - .HasColumnType("int"); - - b1.HasKey("A3Id"); - - b1.ToTable("tbl_A3s"); - - b1.WithOwner() - .HasForeignKey("A3Id"); - }); - - b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "KID5", b1 => - { - b1.Property("A3Id") - .HasColumnType("int"); - - b1.Property("AGD") - .HasColumnType("int"); - - b1.Property("AGO") - .HasColumnType("int"); - - b1.Property("ETPR") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b1.Property("ETSEC") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b1.Property("MEVAL") - .HasColumnType("int"); - - b1.Property("YOB") - .HasColumnType("int"); - - b1.HasKey("A3Id"); - - b1.ToTable("tbl_A3s"); - - b1.WithOwner() - .HasForeignKey("A3Id"); - }); - - b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "KID6", b1 => - { - b1.Property("A3Id") - .HasColumnType("int"); - - b1.Property("AGD") - .HasColumnType("int"); - - b1.Property("AGO") - .HasColumnType("int"); - - b1.Property("ETPR") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b1.Property("ETSEC") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b1.Property("MEVAL") - .HasColumnType("int"); - - b1.Property("YOB") - .HasColumnType("int"); - - b1.HasKey("A3Id"); - - b1.ToTable("tbl_A3s"); - - b1.WithOwner() - .HasForeignKey("A3Id"); - }); - - b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "KID7", b1 => - { - b1.Property("A3Id") - .HasColumnType("int"); - - b1.Property("AGD") - .HasColumnType("int"); - - b1.Property("AGO") - .HasColumnType("int"); - - b1.Property("ETPR") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b1.Property("ETSEC") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b1.Property("MEVAL") - .HasColumnType("int"); - - b1.Property("YOB") - .HasColumnType("int"); - - b1.HasKey("A3Id"); - - b1.ToTable("tbl_A3s"); - - b1.WithOwner() - .HasForeignKey("A3Id"); - }); - - b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "KID8", b1 => - { - b1.Property("A3Id") - .HasColumnType("int"); - - b1.Property("AGD") - .HasColumnType("int"); - - b1.Property("AGO") - .HasColumnType("int"); - - b1.Property("ETPR") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b1.Property("ETSEC") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b1.Property("MEVAL") - .HasColumnType("int"); - - b1.Property("YOB") - .HasColumnType("int"); - - b1.HasKey("A3Id"); - - b1.ToTable("tbl_A3s"); - - b1.WithOwner() - .HasForeignKey("A3Id"); - }); - - b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "KID9", b1 => - { - b1.Property("A3Id") - .HasColumnType("int"); - - b1.Property("AGD") - .HasColumnType("int"); - - b1.Property("AGO") - .HasColumnType("int"); - - b1.Property("ETPR") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b1.Property("ETSEC") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b1.Property("MEVAL") - .HasColumnType("int"); - - b1.Property("YOB") - .HasColumnType("int"); - - b1.HasKey("A3Id"); - - b1.ToTable("tbl_A3s"); - - b1.WithOwner() - .HasForeignKey("A3Id"); - }); - - b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB1", b1 => - { - b1.Property("A3Id") - .HasColumnType("int"); - - b1.Property("AGD") - .HasColumnType("int"); - - b1.Property("AGO") - .HasColumnType("int"); - - b1.Property("ETPR") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b1.Property("ETSEC") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b1.Property("MEVAL") - .HasColumnType("int"); - - b1.Property("YOB") - .HasColumnType("int"); - - b1.HasKey("A3Id"); - - b1.ToTable("tbl_A3s"); - - b1.WithOwner() - .HasForeignKey("A3Id"); - }); - - b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB10", b1 => - { - b1.Property("A3Id") - .HasColumnType("int"); - - b1.Property("AGD") - .HasColumnType("int"); - - b1.Property("AGO") - .HasColumnType("int"); - - b1.Property("ETPR") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b1.Property("ETSEC") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b1.Property("MEVAL") - .HasColumnType("int"); - - b1.Property("YOB") - .HasColumnType("int"); - - b1.HasKey("A3Id"); - - b1.ToTable("tbl_A3s"); - - b1.WithOwner() - .HasForeignKey("A3Id"); - }); - - b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB11", b1 => - { - b1.Property("A3Id") - .HasColumnType("int"); - - b1.Property("AGD") - .HasColumnType("int"); - - b1.Property("AGO") - .HasColumnType("int"); - - b1.Property("ETPR") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b1.Property("ETSEC") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b1.Property("MEVAL") - .HasColumnType("int"); - - b1.Property("YOB") - .HasColumnType("int"); - - b1.HasKey("A3Id"); - - b1.ToTable("tbl_A3s"); - - b1.WithOwner() - .HasForeignKey("A3Id"); - }); - - b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB12", b1 => - { - b1.Property("A3Id") - .HasColumnType("int"); - - b1.Property("AGD") - .HasColumnType("int"); - - b1.Property("AGO") - .HasColumnType("int"); - - b1.Property("ETPR") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b1.Property("ETSEC") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b1.Property("MEVAL") - .HasColumnType("int"); - - b1.Property("YOB") - .HasColumnType("int"); - - b1.HasKey("A3Id"); - - b1.ToTable("tbl_A3s"); - - b1.WithOwner() - .HasForeignKey("A3Id"); - }); - - b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB13", b1 => - { - b1.Property("A3Id") - .HasColumnType("int"); - - b1.Property("AGD") - .HasColumnType("int"); - - b1.Property("AGO") - .HasColumnType("int"); - - b1.Property("ETPR") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b1.Property("ETSEC") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b1.Property("MEVAL") - .HasColumnType("int"); - - b1.Property("YOB") - .HasColumnType("int"); - - b1.HasKey("A3Id"); - - b1.ToTable("tbl_A3s"); - - b1.WithOwner() - .HasForeignKey("A3Id"); - }); - - b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB14", b1 => - { - b1.Property("A3Id") - .HasColumnType("int"); - - b1.Property("AGD") - .HasColumnType("int"); - - b1.Property("AGO") - .HasColumnType("int"); - - b1.Property("ETPR") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b1.Property("ETSEC") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b1.Property("MEVAL") - .HasColumnType("int"); - - b1.Property("YOB") - .HasColumnType("int"); - - b1.HasKey("A3Id"); - - b1.ToTable("tbl_A3s"); - - b1.WithOwner() - .HasForeignKey("A3Id"); - }); - - b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB15", b1 => - { - b1.Property("A3Id") - .HasColumnType("int"); - - b1.Property("AGD") - .HasColumnType("int"); - - b1.Property("AGO") - .HasColumnType("int"); - - b1.Property("ETPR") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b1.Property("ETSEC") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b1.Property("MEVAL") - .HasColumnType("int"); - - b1.Property("YOB") - .HasColumnType("int"); - - b1.HasKey("A3Id"); - - b1.ToTable("tbl_A3s"); - - b1.WithOwner() - .HasForeignKey("A3Id"); - }); - - b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB16", b1 => - { - b1.Property("A3Id") - .HasColumnType("int"); - - b1.Property("AGD") - .HasColumnType("int"); - - b1.Property("AGO") - .HasColumnType("int"); - - b1.Property("ETPR") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b1.Property("ETSEC") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b1.Property("MEVAL") - .HasColumnType("int"); - - b1.Property("YOB") - .HasColumnType("int"); - - b1.HasKey("A3Id"); - - b1.ToTable("tbl_A3s"); - - b1.WithOwner() - .HasForeignKey("A3Id"); - }); - - b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB17", b1 => - { - b1.Property("A3Id") - .HasColumnType("int"); - - b1.Property("AGD") - .HasColumnType("int"); - - b1.Property("AGO") - .HasColumnType("int"); - - b1.Property("ETPR") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b1.Property("ETSEC") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b1.Property("MEVAL") - .HasColumnType("int"); - - b1.Property("YOB") - .HasColumnType("int"); - - b1.HasKey("A3Id"); - - b1.ToTable("tbl_A3s"); - - b1.WithOwner() - .HasForeignKey("A3Id"); - }); - - b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB18", b1 => - { - b1.Property("A3Id") - .HasColumnType("int"); - - b1.Property("AGD") - .HasColumnType("int"); - - b1.Property("AGO") - .HasColumnType("int"); - - b1.Property("ETPR") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b1.Property("ETSEC") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b1.Property("MEVAL") - .HasColumnType("int"); - - b1.Property("YOB") - .HasColumnType("int"); - - b1.HasKey("A3Id"); - - b1.ToTable("tbl_A3s"); - - b1.WithOwner() - .HasForeignKey("A3Id"); - }); - - b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB19", b1 => - { - b1.Property("A3Id") - .HasColumnType("int"); - - b1.Property("AGD") - .HasColumnType("int"); - - b1.Property("AGO") - .HasColumnType("int"); - - b1.Property("ETPR") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b1.Property("ETSEC") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b1.Property("MEVAL") - .HasColumnType("int"); - - b1.Property("YOB") - .HasColumnType("int"); - - b1.HasKey("A3Id"); - - b1.ToTable("tbl_A3s"); - - b1.WithOwner() - .HasForeignKey("A3Id"); - }); - - b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB2", b1 => - { - b1.Property("A3Id") - .HasColumnType("int"); - - b1.Property("AGD") - .HasColumnType("int"); - - b1.Property("AGO") - .HasColumnType("int"); - - b1.Property("ETPR") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b1.Property("ETSEC") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b1.Property("MEVAL") - .HasColumnType("int"); - - b1.Property("YOB") - .HasColumnType("int"); - - b1.HasKey("A3Id"); - - b1.ToTable("tbl_A3s"); - - b1.WithOwner() - .HasForeignKey("A3Id"); - }); - - b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB20", b1 => - { - b1.Property("A3Id") - .HasColumnType("int"); - - b1.Property("AGD") - .HasColumnType("int"); - - b1.Property("AGO") - .HasColumnType("int"); - - b1.Property("ETPR") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b1.Property("ETSEC") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b1.Property("MEVAL") - .HasColumnType("int"); - - b1.Property("YOB") - .HasColumnType("int"); - - b1.HasKey("A3Id"); - - b1.ToTable("tbl_A3s"); - - b1.WithOwner() - .HasForeignKey("A3Id"); - }); - - b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB3", b1 => - { - b1.Property("A3Id") - .HasColumnType("int"); - - b1.Property("AGD") - .HasColumnType("int"); - - b1.Property("AGO") - .HasColumnType("int"); - - b1.Property("ETPR") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b1.Property("ETSEC") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b1.Property("MEVAL") - .HasColumnType("int"); - - b1.Property("YOB") - .HasColumnType("int"); - - b1.HasKey("A3Id"); - - b1.ToTable("tbl_A3s"); - - b1.WithOwner() - .HasForeignKey("A3Id"); - }); - - b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB4", b1 => - { - b1.Property("A3Id") - .HasColumnType("int"); - - b1.Property("AGD") - .HasColumnType("int"); - - b1.Property("AGO") - .HasColumnType("int"); - - b1.Property("ETPR") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b1.Property("ETSEC") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b1.Property("MEVAL") - .HasColumnType("int"); - - b1.Property("YOB") - .HasColumnType("int"); - - b1.HasKey("A3Id"); - - b1.ToTable("tbl_A3s"); - - b1.WithOwner() - .HasForeignKey("A3Id"); - }); - - b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB5", b1 => - { - b1.Property("A3Id") - .HasColumnType("int"); - - b1.Property("AGD") - .HasColumnType("int"); - - b1.Property("AGO") - .HasColumnType("int"); - - b1.Property("ETPR") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b1.Property("ETSEC") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b1.Property("MEVAL") - .HasColumnType("int"); - - b1.Property("YOB") - .HasColumnType("int"); - - b1.HasKey("A3Id"); - - b1.ToTable("tbl_A3s"); - - b1.WithOwner() - .HasForeignKey("A3Id"); - }); - - b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB6", b1 => - { - b1.Property("A3Id") - .HasColumnType("int"); - - b1.Property("AGD") - .HasColumnType("int"); - - b1.Property("AGO") - .HasColumnType("int"); - - b1.Property("ETPR") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b1.Property("ETSEC") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b1.Property("MEVAL") - .HasColumnType("int"); - - b1.Property("YOB") - .HasColumnType("int"); - - b1.HasKey("A3Id"); - - b1.ToTable("tbl_A3s"); - - b1.WithOwner() - .HasForeignKey("A3Id"); - }); - - b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB7", b1 => - { - b1.Property("A3Id") - .HasColumnType("int"); - - b1.Property("AGD") - .HasColumnType("int"); - - b1.Property("AGO") - .HasColumnType("int"); - - b1.Property("ETPR") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b1.Property("ETSEC") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b1.Property("MEVAL") - .HasColumnType("int"); - - b1.Property("YOB") - .HasColumnType("int"); - - b1.HasKey("A3Id"); - - b1.ToTable("tbl_A3s"); - - b1.WithOwner() - .HasForeignKey("A3Id"); - }); - - b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB8", b1 => - { - b1.Property("A3Id") - .HasColumnType("int"); - - b1.Property("AGD") - .HasColumnType("int"); - - b1.Property("AGO") - .HasColumnType("int"); - - b1.Property("ETPR") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b1.Property("ETSEC") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b1.Property("MEVAL") - .HasColumnType("int"); - - b1.Property("YOB") - .HasColumnType("int"); - - b1.HasKey("A3Id"); - - b1.ToTable("tbl_A3s"); - - b1.WithOwner() - .HasForeignKey("A3Id"); - }); - - b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB9", b1 => - { - b1.Property("A3Id") - .HasColumnType("int"); - - b1.Property("AGD") - .HasColumnType("int"); - - b1.Property("AGO") - .HasColumnType("int"); - - b1.Property("ETPR") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b1.Property("ETSEC") - .HasMaxLength(2) - .HasColumnType("nvarchar(2)"); - - b1.Property("MEVAL") - .HasColumnType("int"); - - b1.Property("YOB") - .HasColumnType("int"); - - b1.HasKey("A3Id"); - - b1.ToTable("tbl_A3s"); - - b1.WithOwner() - .HasForeignKey("A3Id"); - }); - - b.Navigation("KID1") - .IsRequired(); - - b.Navigation("KID10") - .IsRequired(); - - b.Navigation("KID11") - .IsRequired(); - - b.Navigation("KID12") - .IsRequired(); - - b.Navigation("KID13") - .IsRequired(); - - b.Navigation("KID14") - .IsRequired(); - - b.Navigation("KID15") - .IsRequired(); - - b.Navigation("KID2") - .IsRequired(); - - b.Navigation("KID3") - .IsRequired(); - - b.Navigation("KID4") - .IsRequired(); - - b.Navigation("KID5") - .IsRequired(); - - b.Navigation("KID6") - .IsRequired(); - - b.Navigation("KID7") - .IsRequired(); - - b.Navigation("KID8") - .IsRequired(); - - b.Navigation("KID9") - .IsRequired(); - - b.Navigation("SIB1") - .IsRequired(); - - b.Navigation("SIB10") - .IsRequired(); - - b.Navigation("SIB11") - .IsRequired(); - - b.Navigation("SIB12") - .IsRequired(); - - b.Navigation("SIB13") - .IsRequired(); - - b.Navigation("SIB14") - .IsRequired(); - - b.Navigation("SIB15") - .IsRequired(); - - b.Navigation("SIB16") - .IsRequired(); - - b.Navigation("SIB17") - .IsRequired(); - - b.Navigation("SIB18") - .IsRequired(); - - b.Navigation("SIB19") - .IsRequired(); - - b.Navigation("SIB2") - .IsRequired(); - - b.Navigation("SIB20") - .IsRequired(); - - b.Navigation("SIB3") - .IsRequired(); - - b.Navigation("SIB4") - .IsRequired(); - - b.Navigation("SIB5") - .IsRequired(); - - b.Navigation("SIB6") - .IsRequired(); - - b.Navigation("SIB7") - .IsRequired(); - - b.Navigation("SIB8") - .IsRequired(); - - b.Navigation("SIB9") - .IsRequired(); - }); - - modelBuilder.Entity("UDS.Net.API.Entities.A4", b => - { - b.HasOne("UDS.Net.API.Entities.Visit", null) - .WithOne("A4") - .HasForeignKey("UDS.Net.API.Entities.A4", "VisitId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID1", b1 => - { - b1.Property("A4Id") - .HasColumnType("int"); - - b1.Property("RxNormId") - .HasColumnType("int"); - - b1.HasKey("A4Id"); - - b1.HasIndex("RxNormId"); - - b1.ToTable("tbl_A4s"); - - b1.WithOwner() - .HasForeignKey("A4Id"); - - b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") - .WithMany() - .HasForeignKey("RxNormId"); - - b1.Navigation("DrugCode"); - }); - - b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID10", b1 => - { - b1.Property("A4Id") - .HasColumnType("int"); - - b1.Property("RxNormId") - .HasColumnType("int"); - - b1.HasKey("A4Id"); - - b1.HasIndex("RxNormId"); - - b1.ToTable("tbl_A4s"); - - b1.WithOwner() - .HasForeignKey("A4Id"); - - b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") - .WithMany() - .HasForeignKey("RxNormId"); - - b1.Navigation("DrugCode"); - }); - - b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID11", b1 => - { - b1.Property("A4Id") - .HasColumnType("int"); - - b1.Property("RxNormId") - .HasColumnType("int"); - - b1.HasKey("A4Id"); - - b1.HasIndex("RxNormId"); - - b1.ToTable("tbl_A4s"); - - b1.WithOwner() - .HasForeignKey("A4Id"); - - b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") - .WithMany() - .HasForeignKey("RxNormId"); - - b1.Navigation("DrugCode"); - }); - - b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID12", b1 => - { - b1.Property("A4Id") - .HasColumnType("int"); - - b1.Property("RxNormId") - .HasColumnType("int"); - - b1.HasKey("A4Id"); - - b1.HasIndex("RxNormId"); - - b1.ToTable("tbl_A4s"); - - b1.WithOwner() - .HasForeignKey("A4Id"); - - b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") - .WithMany() - .HasForeignKey("RxNormId"); - - b1.Navigation("DrugCode"); - }); - - b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID13", b1 => - { - b1.Property("A4Id") - .HasColumnType("int"); - - b1.Property("RxNormId") - .HasColumnType("int"); - - b1.HasKey("A4Id"); - - b1.HasIndex("RxNormId"); - - b1.ToTable("tbl_A4s"); - - b1.WithOwner() - .HasForeignKey("A4Id"); - - b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") - .WithMany() - .HasForeignKey("RxNormId"); - - b1.Navigation("DrugCode"); - }); - - b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID14", b1 => - { - b1.Property("A4Id") - .HasColumnType("int"); - - b1.Property("RxNormId") - .HasColumnType("int"); - - b1.HasKey("A4Id"); - - b1.HasIndex("RxNormId"); - - b1.ToTable("tbl_A4s"); - - b1.WithOwner() - .HasForeignKey("A4Id"); - - b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") - .WithMany() - .HasForeignKey("RxNormId"); - - b1.Navigation("DrugCode"); - }); - - b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID15", b1 => - { - b1.Property("A4Id") - .HasColumnType("int"); - - b1.Property("RxNormId") - .HasColumnType("int"); - - b1.HasKey("A4Id"); - - b1.HasIndex("RxNormId"); - - b1.ToTable("tbl_A4s"); - - b1.WithOwner() - .HasForeignKey("A4Id"); - - b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") - .WithMany() - .HasForeignKey("RxNormId"); - - b1.Navigation("DrugCode"); - }); - - b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID16", b1 => - { - b1.Property("A4Id") - .HasColumnType("int"); - - b1.Property("RxNormId") - .HasColumnType("int"); - - b1.HasKey("A4Id"); - - b1.HasIndex("RxNormId"); - - b1.ToTable("tbl_A4s"); - - b1.WithOwner() - .HasForeignKey("A4Id"); - - b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") - .WithMany() - .HasForeignKey("RxNormId"); - - b1.Navigation("DrugCode"); - }); - - b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID17", b1 => - { - b1.Property("A4Id") - .HasColumnType("int"); - - b1.Property("RxNormId") - .HasColumnType("int"); - - b1.HasKey("A4Id"); - - b1.HasIndex("RxNormId"); - - b1.ToTable("tbl_A4s"); - - b1.WithOwner() - .HasForeignKey("A4Id"); - - b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") - .WithMany() - .HasForeignKey("RxNormId"); - - b1.Navigation("DrugCode"); - }); - - b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID18", b1 => - { - b1.Property("A4Id") - .HasColumnType("int"); - - b1.Property("RxNormId") - .HasColumnType("int"); - - b1.HasKey("A4Id"); - - b1.HasIndex("RxNormId"); - - b1.ToTable("tbl_A4s"); - - b1.WithOwner() - .HasForeignKey("A4Id"); - - b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") - .WithMany() - .HasForeignKey("RxNormId"); - - b1.Navigation("DrugCode"); - }); - - b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID19", b1 => - { - b1.Property("A4Id") - .HasColumnType("int"); - - b1.Property("RxNormId") - .HasColumnType("int"); - - b1.HasKey("A4Id"); - - b1.HasIndex("RxNormId"); - - b1.ToTable("tbl_A4s"); - - b1.WithOwner() - .HasForeignKey("A4Id"); - - b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") - .WithMany() - .HasForeignKey("RxNormId"); - - b1.Navigation("DrugCode"); - }); - - b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID2", b1 => - { - b1.Property("A4Id") - .HasColumnType("int"); - - b1.Property("RxNormId") - .HasColumnType("int"); - - b1.HasKey("A4Id"); - - b1.HasIndex("RxNormId"); - - b1.ToTable("tbl_A4s"); - - b1.WithOwner() - .HasForeignKey("A4Id"); - - b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") - .WithMany() - .HasForeignKey("RxNormId"); - - b1.Navigation("DrugCode"); - }); - - b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID20", b1 => - { - b1.Property("A4Id") - .HasColumnType("int"); - - b1.Property("RxNormId") - .HasColumnType("int"); - - b1.HasKey("A4Id"); - - b1.HasIndex("RxNormId"); - - b1.ToTable("tbl_A4s"); - - b1.WithOwner() - .HasForeignKey("A4Id"); - - b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") - .WithMany() - .HasForeignKey("RxNormId"); - - b1.Navigation("DrugCode"); - }); - - b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID21", b1 => - { - b1.Property("A4Id") - .HasColumnType("int"); - - b1.Property("RxNormId") - .HasColumnType("int"); - - b1.HasKey("A4Id"); - - b1.HasIndex("RxNormId"); - - b1.ToTable("tbl_A4s"); - - b1.WithOwner() - .HasForeignKey("A4Id"); - - b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") - .WithMany() - .HasForeignKey("RxNormId"); - - b1.Navigation("DrugCode"); - }); - - b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID22", b1 => - { - b1.Property("A4Id") - .HasColumnType("int"); - - b1.Property("RxNormId") - .HasColumnType("int"); - - b1.HasKey("A4Id"); - - b1.HasIndex("RxNormId"); - - b1.ToTable("tbl_A4s"); - - b1.WithOwner() - .HasForeignKey("A4Id"); - - b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") - .WithMany() - .HasForeignKey("RxNormId"); - - b1.Navigation("DrugCode"); - }); - - b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID23", b1 => - { - b1.Property("A4Id") - .HasColumnType("int"); - - b1.Property("RxNormId") - .HasColumnType("int"); - - b1.HasKey("A4Id"); - - b1.HasIndex("RxNormId"); - - b1.ToTable("tbl_A4s"); - - b1.WithOwner() - .HasForeignKey("A4Id"); - - b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") - .WithMany() - .HasForeignKey("RxNormId"); - - b1.Navigation("DrugCode"); - }); - - b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID24", b1 => - { - b1.Property("A4Id") - .HasColumnType("int"); - - b1.Property("RxNormId") - .HasColumnType("int"); - - b1.HasKey("A4Id"); - - b1.HasIndex("RxNormId"); - - b1.ToTable("tbl_A4s"); - - b1.WithOwner() - .HasForeignKey("A4Id"); - - b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") - .WithMany() - .HasForeignKey("RxNormId"); - - b1.Navigation("DrugCode"); - }); - - b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID25", b1 => - { - b1.Property("A4Id") - .HasColumnType("int"); - - b1.Property("RxNormId") - .HasColumnType("int"); - - b1.HasKey("A4Id"); - - b1.HasIndex("RxNormId"); - - b1.ToTable("tbl_A4s"); - - b1.WithOwner() - .HasForeignKey("A4Id"); - - b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") - .WithMany() - .HasForeignKey("RxNormId"); - - b1.Navigation("DrugCode"); - }); - - b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID26", b1 => - { - b1.Property("A4Id") - .HasColumnType("int"); - - b1.Property("RxNormId") - .HasColumnType("int"); - - b1.HasKey("A4Id"); - - b1.HasIndex("RxNormId"); - - b1.ToTable("tbl_A4s"); - - b1.WithOwner() - .HasForeignKey("A4Id"); - - b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") - .WithMany() - .HasForeignKey("RxNormId"); - - b1.Navigation("DrugCode"); - }); - - b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID27", b1 => - { - b1.Property("A4Id") - .HasColumnType("int"); - - b1.Property("RxNormId") - .HasColumnType("int"); - - b1.HasKey("A4Id"); - - b1.HasIndex("RxNormId"); - - b1.ToTable("tbl_A4s"); - - b1.WithOwner() - .HasForeignKey("A4Id"); - - b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") - .WithMany() - .HasForeignKey("RxNormId"); - - b1.Navigation("DrugCode"); - }); - - b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID28", b1 => - { - b1.Property("A4Id") - .HasColumnType("int"); - - b1.Property("RxNormId") - .HasColumnType("int"); - - b1.HasKey("A4Id"); - - b1.HasIndex("RxNormId"); - - b1.ToTable("tbl_A4s"); - - b1.WithOwner() - .HasForeignKey("A4Id"); - - b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") - .WithMany() - .HasForeignKey("RxNormId"); - - b1.Navigation("DrugCode"); - }); - - b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID29", b1 => - { - b1.Property("A4Id") - .HasColumnType("int"); - - b1.Property("RxNormId") - .HasColumnType("int"); - - b1.HasKey("A4Id"); - - b1.HasIndex("RxNormId"); - - b1.ToTable("tbl_A4s"); - - b1.WithOwner() - .HasForeignKey("A4Id"); - - b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") - .WithMany() - .HasForeignKey("RxNormId"); - - b1.Navigation("DrugCode"); - }); - - b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID3", b1 => - { - b1.Property("A4Id") - .HasColumnType("int"); - - b1.Property("RxNormId") - .HasColumnType("int"); - - b1.HasKey("A4Id"); - - b1.HasIndex("RxNormId"); - - b1.ToTable("tbl_A4s"); - - b1.WithOwner() - .HasForeignKey("A4Id"); - - b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") - .WithMany() - .HasForeignKey("RxNormId"); - - b1.Navigation("DrugCode"); - }); - - b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID30", b1 => - { - b1.Property("A4Id") - .HasColumnType("int"); - - b1.Property("RxNormId") - .HasColumnType("int"); - - b1.HasKey("A4Id"); - - b1.HasIndex("RxNormId"); - - b1.ToTable("tbl_A4s"); - - b1.WithOwner() - .HasForeignKey("A4Id"); - - b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") - .WithMany() - .HasForeignKey("RxNormId"); - - b1.Navigation("DrugCode"); - }); - - b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID31", b1 => - { - b1.Property("A4Id") - .HasColumnType("int"); - - b1.Property("RxNormId") - .HasColumnType("int"); - - b1.HasKey("A4Id"); - - b1.HasIndex("RxNormId"); - - b1.ToTable("tbl_A4s"); - - b1.WithOwner() - .HasForeignKey("A4Id"); - - b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") - .WithMany() - .HasForeignKey("RxNormId"); - - b1.Navigation("DrugCode"); - }); - - b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID32", b1 => - { - b1.Property("A4Id") - .HasColumnType("int"); - - b1.Property("RxNormId") - .HasColumnType("int"); - - b1.HasKey("A4Id"); - - b1.HasIndex("RxNormId"); - - b1.ToTable("tbl_A4s"); - - b1.WithOwner() - .HasForeignKey("A4Id"); - - b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") - .WithMany() - .HasForeignKey("RxNormId"); - - b1.Navigation("DrugCode"); - }); - - b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID33", b1 => - { - b1.Property("A4Id") - .HasColumnType("int"); - - b1.Property("RxNormId") - .HasColumnType("int"); - - b1.HasKey("A4Id"); - - b1.HasIndex("RxNormId"); - - b1.ToTable("tbl_A4s"); - - b1.WithOwner() - .HasForeignKey("A4Id"); - - b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") - .WithMany() - .HasForeignKey("RxNormId"); - - b1.Navigation("DrugCode"); - }); - - b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID34", b1 => - { - b1.Property("A4Id") - .HasColumnType("int"); - - b1.Property("RxNormId") - .HasColumnType("int"); - - b1.HasKey("A4Id"); - - b1.HasIndex("RxNormId"); - - b1.ToTable("tbl_A4s"); - - b1.WithOwner() - .HasForeignKey("A4Id"); - - b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") - .WithMany() - .HasForeignKey("RxNormId"); - - b1.Navigation("DrugCode"); - }); - - b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID35", b1 => - { - b1.Property("A4Id") - .HasColumnType("int"); - - b1.Property("RxNormId") - .HasColumnType("int"); - - b1.HasKey("A4Id"); - - b1.HasIndex("RxNormId"); - - b1.ToTable("tbl_A4s"); - - b1.WithOwner() - .HasForeignKey("A4Id"); - - b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") - .WithMany() - .HasForeignKey("RxNormId"); - - b1.Navigation("DrugCode"); - }); - - b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID36", b1 => - { - b1.Property("A4Id") - .HasColumnType("int"); - - b1.Property("RxNormId") - .HasColumnType("int"); - - b1.HasKey("A4Id"); - - b1.HasIndex("RxNormId"); - - b1.ToTable("tbl_A4s"); - - b1.WithOwner() - .HasForeignKey("A4Id"); - - b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") - .WithMany() - .HasForeignKey("RxNormId"); - - b1.Navigation("DrugCode"); - }); - - b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID37", b1 => - { - b1.Property("A4Id") - .HasColumnType("int"); - - b1.Property("RxNormId") - .HasColumnType("int"); - - b1.HasKey("A4Id"); - - b1.HasIndex("RxNormId"); - - b1.ToTable("tbl_A4s"); - - b1.WithOwner() - .HasForeignKey("A4Id"); - - b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") - .WithMany() - .HasForeignKey("RxNormId"); - - b1.Navigation("DrugCode"); - }); - - b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID38", b1 => - { - b1.Property("A4Id") - .HasColumnType("int"); - - b1.Property("RxNormId") - .HasColumnType("int"); - - b1.HasKey("A4Id"); - - b1.HasIndex("RxNormId"); - - b1.ToTable("tbl_A4s"); - - b1.WithOwner() - .HasForeignKey("A4Id"); - - b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") - .WithMany() - .HasForeignKey("RxNormId"); - - b1.Navigation("DrugCode"); - }); - - b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID39", b1 => - { - b1.Property("A4Id") - .HasColumnType("int"); - - b1.Property("RxNormId") - .HasColumnType("int"); - - b1.HasKey("A4Id"); - - b1.HasIndex("RxNormId"); - - b1.ToTable("tbl_A4s"); - - b1.WithOwner() - .HasForeignKey("A4Id"); - - b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") - .WithMany() - .HasForeignKey("RxNormId"); - - b1.Navigation("DrugCode"); - }); - - b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID4", b1 => - { - b1.Property("A4Id") - .HasColumnType("int"); - - b1.Property("RxNormId") - .HasColumnType("int"); - - b1.HasKey("A4Id"); - - b1.HasIndex("RxNormId"); - - b1.ToTable("tbl_A4s"); - - b1.WithOwner() - .HasForeignKey("A4Id"); - - b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") - .WithMany() - .HasForeignKey("RxNormId"); - - b1.Navigation("DrugCode"); - }); - - b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID40", b1 => - { - b1.Property("A4Id") - .HasColumnType("int"); - - b1.Property("RxNormId") - .HasColumnType("int"); - - b1.HasKey("A4Id"); - - b1.HasIndex("RxNormId"); - - b1.ToTable("tbl_A4s"); - - b1.WithOwner() - .HasForeignKey("A4Id"); - - b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") - .WithMany() - .HasForeignKey("RxNormId"); - - b1.Navigation("DrugCode"); - }); - - b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID5", b1 => - { - b1.Property("A4Id") - .HasColumnType("int"); - - b1.Property("RxNormId") - .HasColumnType("int"); - - b1.HasKey("A4Id"); - - b1.HasIndex("RxNormId"); - - b1.ToTable("tbl_A4s"); - - b1.WithOwner() - .HasForeignKey("A4Id"); - - b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") - .WithMany() - .HasForeignKey("RxNormId"); - - b1.Navigation("DrugCode"); - }); - - b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID6", b1 => - { - b1.Property("A4Id") - .HasColumnType("int"); - - b1.Property("RxNormId") - .HasColumnType("int"); - - b1.HasKey("A4Id"); - - b1.HasIndex("RxNormId"); - - b1.ToTable("tbl_A4s"); - - b1.WithOwner() - .HasForeignKey("A4Id"); - - b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") - .WithMany() - .HasForeignKey("RxNormId"); - - b1.Navigation("DrugCode"); - }); - - b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID7", b1 => - { - b1.Property("A4Id") - .HasColumnType("int"); - - b1.Property("RxNormId") - .HasColumnType("int"); - - b1.HasKey("A4Id"); - - b1.HasIndex("RxNormId"); - - b1.ToTable("tbl_A4s"); - - b1.WithOwner() - .HasForeignKey("A4Id"); - - b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") - .WithMany() - .HasForeignKey("RxNormId"); - - b1.Navigation("DrugCode"); - }); - - b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID8", b1 => - { - b1.Property("A4Id") - .HasColumnType("int"); - - b1.Property("RxNormId") - .HasColumnType("int"); - - b1.HasKey("A4Id"); - - b1.HasIndex("RxNormId"); - - b1.ToTable("tbl_A4s"); - - b1.WithOwner() - .HasForeignKey("A4Id"); - - b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") - .WithMany() - .HasForeignKey("RxNormId"); - - b1.Navigation("DrugCode"); - }); - - b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID9", b1 => - { - b1.Property("A4Id") - .HasColumnType("int"); - - b1.Property("RxNormId") - .HasColumnType("int"); - - b1.HasKey("A4Id"); - - b1.HasIndex("RxNormId"); - - b1.ToTable("tbl_A4s"); - - b1.WithOwner() - .HasForeignKey("A4Id"); - - b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") - .WithMany() - .HasForeignKey("RxNormId"); - - b1.Navigation("DrugCode"); - }); - - b.Navigation("RXNORMID1") - .IsRequired(); - - b.Navigation("RXNORMID10") - .IsRequired(); - - b.Navigation("RXNORMID11") - .IsRequired(); - - b.Navigation("RXNORMID12") - .IsRequired(); - - b.Navigation("RXNORMID13") - .IsRequired(); - - b.Navigation("RXNORMID14") - .IsRequired(); - - b.Navigation("RXNORMID15") - .IsRequired(); - - b.Navigation("RXNORMID16") - .IsRequired(); - - b.Navigation("RXNORMID17") - .IsRequired(); - - b.Navigation("RXNORMID18") - .IsRequired(); - - b.Navigation("RXNORMID19") - .IsRequired(); - - b.Navigation("RXNORMID2") - .IsRequired(); - - b.Navigation("RXNORMID20") - .IsRequired(); - - b.Navigation("RXNORMID21") - .IsRequired(); - - b.Navigation("RXNORMID22") - .IsRequired(); - - b.Navigation("RXNORMID23") - .IsRequired(); - - b.Navigation("RXNORMID24") - .IsRequired(); - - b.Navigation("RXNORMID25") - .IsRequired(); - - b.Navigation("RXNORMID26") - .IsRequired(); - - b.Navigation("RXNORMID27") - .IsRequired(); - - b.Navigation("RXNORMID28") - .IsRequired(); - - b.Navigation("RXNORMID29") - .IsRequired(); - - b.Navigation("RXNORMID3") - .IsRequired(); - - b.Navigation("RXNORMID30") - .IsRequired(); - - b.Navigation("RXNORMID31") - .IsRequired(); - - b.Navigation("RXNORMID32") - .IsRequired(); - - b.Navigation("RXNORMID33") - .IsRequired(); - - b.Navigation("RXNORMID34") - .IsRequired(); - - b.Navigation("RXNORMID35") - .IsRequired(); - - b.Navigation("RXNORMID36") - .IsRequired(); - - b.Navigation("RXNORMID37") - .IsRequired(); - - b.Navigation("RXNORMID38") - .IsRequired(); - - b.Navigation("RXNORMID39") - .IsRequired(); - - b.Navigation("RXNORMID4") - .IsRequired(); - - b.Navigation("RXNORMID40") - .IsRequired(); - - b.Navigation("RXNORMID5") - .IsRequired(); - - b.Navigation("RXNORMID6") - .IsRequired(); - - b.Navigation("RXNORMID7") - .IsRequired(); - - b.Navigation("RXNORMID8") - .IsRequired(); - - b.Navigation("RXNORMID9") - .IsRequired(); - }); - - modelBuilder.Entity("UDS.Net.API.Entities.A4a", b => - { - b.HasOne("UDS.Net.API.Entities.Visit", null) - .WithOne("A4a") - .HasForeignKey("UDS.Net.API.Entities.A4a", "VisitId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsOne("UDS.Net.API.Entities.A4aTreatment", "Treatment1", b1 => - { - b1.Property("A4aId") - .HasColumnType("int"); - - b1.Property("CARETRIAL") - .HasColumnType("int") - .HasColumnName("CARETRIAL1"); - - b1.Property("ENDMO") - .HasColumnType("int") - .HasColumnName("ENDMO1"); - - b1.Property("ENDYEAR") - .HasColumnType("int") - .HasColumnName("ENDYEAR1"); - - b1.Property("NCTNUM") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)") - .HasColumnName("NCTNUM1"); - - b1.Property("STARTMO") - .HasColumnType("int") - .HasColumnName("STARTMO1"); - - b1.Property("STARTYEAR") - .HasColumnType("int") - .HasColumnName("STARTYEAR1"); - - b1.Property("TARGETAB") - .HasColumnType("bit") - .HasColumnName("TARGETAB1"); - - b1.Property("TARGETINF") - .HasColumnType("bit") - .HasColumnName("TARGETINF1"); - - b1.Property("TARGETOTH") - .HasColumnType("bit") - .HasColumnName("TARGETOTH1"); - - b1.Property("TARGETOTX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)") - .HasColumnName("TARGETOTX1"); - - b1.Property("TARGETSYN") - .HasColumnType("bit") - .HasColumnName("TARGETSYN1"); - - b1.Property("TARGETTAU") - .HasColumnType("bit") - .HasColumnName("TARGETTAU1"); - - b1.Property("TRIALGRP") - .HasColumnType("int") - .HasColumnName("TRIALGRP1"); - - b1.Property("TRTTRIAL") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)") - .HasColumnName("TRTTRIAL1"); - - b1.HasKey("A4aId"); - - b1.ToTable("tbl_A4as"); - - b1.WithOwner() - .HasForeignKey("A4aId"); - }); - - b.OwnsOne("UDS.Net.API.Entities.A4aTreatment", "Treatment2", b1 => - { - b1.Property("A4aId") - .HasColumnType("int"); - - b1.Property("CARETRIAL") - .HasColumnType("int") - .HasColumnName("CARETRIAL2"); - - b1.Property("ENDMO") - .HasColumnType("int") - .HasColumnName("ENDMO2"); - - b1.Property("ENDYEAR") - .HasColumnType("int") - .HasColumnName("ENDYEAR2"); - - b1.Property("NCTNUM") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)") - .HasColumnName("NCTNUM2"); - - b1.Property("STARTMO") - .HasColumnType("int") - .HasColumnName("STARTMO2"); - - b1.Property("STARTYEAR") - .HasColumnType("int") - .HasColumnName("STARTYEAR2"); - - b1.Property("TARGETAB") - .HasColumnType("bit") - .HasColumnName("TARGETAB2"); - - b1.Property("TARGETINF") - .HasColumnType("bit") - .HasColumnName("TARGETINF2"); - - b1.Property("TARGETOTH") - .HasColumnType("bit") - .HasColumnName("TARGETOTH2"); - - b1.Property("TARGETOTX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)") - .HasColumnName("TARGETOTX2"); - - b1.Property("TARGETSYN") - .HasColumnType("bit") - .HasColumnName("TARGETSYN2"); - - b1.Property("TARGETTAU") - .HasColumnType("bit") - .HasColumnName("TARGETTAU2"); - - b1.Property("TRIALGRP") - .HasColumnType("int") - .HasColumnName("TRIALGRP2"); - - b1.Property("TRTTRIAL") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)") - .HasColumnName("TRTTRIAL2"); - - b1.HasKey("A4aId"); - - b1.ToTable("tbl_A4as"); - - b1.WithOwner() - .HasForeignKey("A4aId"); - }); - - b.OwnsOne("UDS.Net.API.Entities.A4aTreatment", "Treatment3", b1 => - { - b1.Property("A4aId") - .HasColumnType("int"); - - b1.Property("CARETRIAL") - .HasColumnType("int") - .HasColumnName("CARETRIAL3"); - - b1.Property("ENDMO") - .HasColumnType("int") - .HasColumnName("ENDMO3"); - - b1.Property("ENDYEAR") - .HasColumnType("int") - .HasColumnName("ENDYEAR3"); - - b1.Property("NCTNUM") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)") - .HasColumnName("NCTNUM3"); - - b1.Property("STARTMO") - .HasColumnType("int") - .HasColumnName("STARTMO3"); - - b1.Property("STARTYEAR") - .HasColumnType("int") - .HasColumnName("STARTYEAR3"); - - b1.Property("TARGETAB") - .HasColumnType("bit") - .HasColumnName("TARGETAB3"); - - b1.Property("TARGETINF") - .HasColumnType("bit") - .HasColumnName("TARGETINF3"); - - b1.Property("TARGETOTH") - .HasColumnType("bit") - .HasColumnName("TARGETOTH3"); - - b1.Property("TARGETOTX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)") - .HasColumnName("TARGETOTX3"); - - b1.Property("TARGETSYN") - .HasColumnType("bit") - .HasColumnName("TARGETSYN3"); - - b1.Property("TARGETTAU") - .HasColumnType("bit") - .HasColumnName("TARGETTAU3"); - - b1.Property("TRIALGRP") - .HasColumnType("int") - .HasColumnName("TRIALGRP3"); - - b1.Property("TRTTRIAL") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)") - .HasColumnName("TRTTRIAL3"); - - b1.HasKey("A4aId"); - - b1.ToTable("tbl_A4as"); - - b1.WithOwner() - .HasForeignKey("A4aId"); - }); - - b.OwnsOne("UDS.Net.API.Entities.A4aTreatment", "Treatment4", b1 => - { - b1.Property("A4aId") - .HasColumnType("int"); - - b1.Property("CARETRIAL") - .HasColumnType("int") - .HasColumnName("CARETRIAL4"); - - b1.Property("ENDMO") - .HasColumnType("int") - .HasColumnName("ENDMO4"); - - b1.Property("ENDYEAR") - .HasColumnType("int") - .HasColumnName("ENDYEAR4"); - - b1.Property("NCTNUM") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)") - .HasColumnName("NCTNUM4"); - - b1.Property("STARTMO") - .HasColumnType("int") - .HasColumnName("STARTMO4"); - - b1.Property("STARTYEAR") - .HasColumnType("int") - .HasColumnName("STARTYEAR4"); - - b1.Property("TARGETAB") - .HasColumnType("bit") - .HasColumnName("TARGETAB4"); - - b1.Property("TARGETINF") - .HasColumnType("bit") - .HasColumnName("TARGETINF4"); - - b1.Property("TARGETOTH") - .HasColumnType("bit") - .HasColumnName("TARGETOTH4"); - - b1.Property("TARGETOTX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)") - .HasColumnName("TARGETOTX4"); - - b1.Property("TARGETSYN") - .HasColumnType("bit") - .HasColumnName("TARGETSYN4"); - - b1.Property("TARGETTAU") - .HasColumnType("bit") - .HasColumnName("TARGETTAU4"); - - b1.Property("TRIALGRP") - .HasColumnType("int") - .HasColumnName("TRIALGRP4"); - - b1.Property("TRTTRIAL") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)") - .HasColumnName("TRTTRIAL4"); - - b1.HasKey("A4aId"); - - b1.ToTable("tbl_A4as"); - - b1.WithOwner() - .HasForeignKey("A4aId"); - }); - - b.OwnsOne("UDS.Net.API.Entities.A4aTreatment", "Treatment5", b1 => - { - b1.Property("A4aId") - .HasColumnType("int"); - - b1.Property("CARETRIAL") - .HasColumnType("int") - .HasColumnName("CARETRIAL5"); - - b1.Property("ENDMO") - .HasColumnType("int") - .HasColumnName("ENDMO5"); - - b1.Property("ENDYEAR") - .HasColumnType("int") - .HasColumnName("ENDYEAR5"); - - b1.Property("NCTNUM") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)") - .HasColumnName("NCTNUM5"); - - b1.Property("STARTMO") - .HasColumnType("int") - .HasColumnName("STARTMO5"); - - b1.Property("STARTYEAR") - .HasColumnType("int") - .HasColumnName("STARTYEAR5"); - - b1.Property("TARGETAB") - .HasColumnType("bit") - .HasColumnName("TARGETAB5"); - - b1.Property("TARGETINF") - .HasColumnType("bit") - .HasColumnName("TARGETINF5"); - - b1.Property("TARGETOTH") - .HasColumnType("bit") - .HasColumnName("TARGETOTH5"); - - b1.Property("TARGETOTX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)") - .HasColumnName("TARGETOTX5"); - - b1.Property("TARGETSYN") - .HasColumnType("bit") - .HasColumnName("TARGETSYN5"); - - b1.Property("TARGETTAU") - .HasColumnType("bit") - .HasColumnName("TARGETTAU5"); - - b1.Property("TRIALGRP") - .HasColumnType("int") - .HasColumnName("TRIALGRP5"); - - b1.Property("TRTTRIAL") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)") - .HasColumnName("TRTTRIAL5"); - - b1.HasKey("A4aId"); - - b1.ToTable("tbl_A4as"); - - b1.WithOwner() - .HasForeignKey("A4aId"); - }); - - b.OwnsOne("UDS.Net.API.Entities.A4aTreatment", "Treatment6", b1 => - { - b1.Property("A4aId") - .HasColumnType("int"); - - b1.Property("CARETRIAL") - .HasColumnType("int") - .HasColumnName("CARETRIAL6"); - - b1.Property("ENDMO") - .HasColumnType("int") - .HasColumnName("ENDMO6"); - - b1.Property("ENDYEAR") - .HasColumnType("int") - .HasColumnName("ENDYEAR6"); - - b1.Property("NCTNUM") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)") - .HasColumnName("NCTNUM6"); - - b1.Property("STARTMO") - .HasColumnType("int") - .HasColumnName("STARTMO6"); - - b1.Property("STARTYEAR") - .HasColumnType("int") - .HasColumnName("STARTYEAR6"); - - b1.Property("TARGETAB") - .HasColumnType("bit") - .HasColumnName("TARGETAB6"); - - b1.Property("TARGETINF") - .HasColumnType("bit") - .HasColumnName("TARGETINF6"); - - b1.Property("TARGETOTH") - .HasColumnType("bit") - .HasColumnName("TARGETOTH6"); - - b1.Property("TARGETOTX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)") - .HasColumnName("TARGETOTX6"); - - b1.Property("TARGETSYN") - .HasColumnType("bit") - .HasColumnName("TARGETSYN6"); - - b1.Property("TARGETTAU") - .HasColumnType("bit") - .HasColumnName("TARGETTAU6"); - - b1.Property("TRIALGRP") - .HasColumnType("int") - .HasColumnName("TRIALGRP6"); - - b1.Property("TRTTRIAL") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)") - .HasColumnName("TRTTRIAL6"); - - b1.HasKey("A4aId"); - - b1.ToTable("tbl_A4as"); - - b1.WithOwner() - .HasForeignKey("A4aId"); - }); - - b.OwnsOne("UDS.Net.API.Entities.A4aTreatment", "Treatment7", b1 => - { - b1.Property("A4aId") - .HasColumnType("int"); - - b1.Property("CARETRIAL") - .HasColumnType("int") - .HasColumnName("CARETRIAL7"); - - b1.Property("ENDMO") - .HasColumnType("int") - .HasColumnName("ENDMO7"); - - b1.Property("ENDYEAR") - .HasColumnType("int") - .HasColumnName("ENDYEAR7"); - - b1.Property("NCTNUM") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)") - .HasColumnName("NCTNUM7"); - - b1.Property("STARTMO") - .HasColumnType("int") - .HasColumnName("STARTMO7"); - - b1.Property("STARTYEAR") - .HasColumnType("int") - .HasColumnName("STARTYEAR7"); - - b1.Property("TARGETAB") - .HasColumnType("bit") - .HasColumnName("TARGETAB7"); - - b1.Property("TARGETINF") - .HasColumnType("bit") - .HasColumnName("TARGETINF7"); - - b1.Property("TARGETOTH") - .HasColumnType("bit") - .HasColumnName("TARGETOTH7"); - - b1.Property("TARGETOTX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)") - .HasColumnName("TARGETOTX7"); - - b1.Property("TARGETSYN") - .HasColumnType("bit") - .HasColumnName("TARGETSYN7"); - - b1.Property("TARGETTAU") - .HasColumnType("bit") - .HasColumnName("TARGETTAU7"); - - b1.Property("TRIALGRP") - .HasColumnType("int") - .HasColumnName("TRIALGRP7"); - - b1.Property("TRTTRIAL") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)") - .HasColumnName("TRTTRIAL7"); - - b1.HasKey("A4aId"); - - b1.ToTable("tbl_A4as"); - - b1.WithOwner() - .HasForeignKey("A4aId"); - }); - - b.OwnsOne("UDS.Net.API.Entities.A4aTreatment", "Treatment8", b1 => - { - b1.Property("A4aId") - .HasColumnType("int"); - - b1.Property("CARETRIAL") - .HasColumnType("int") - .HasColumnName("CARETRIAL8"); - - b1.Property("ENDMO") - .HasColumnType("int") - .HasColumnName("ENDMO8"); - - b1.Property("ENDYEAR") - .HasColumnType("int") - .HasColumnName("ENDYEAR8"); - - b1.Property("NCTNUM") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)") - .HasColumnName("NCTNUM8"); - - b1.Property("STARTMO") - .HasColumnType("int") - .HasColumnName("STARTMO8"); - - b1.Property("STARTYEAR") - .HasColumnType("int") - .HasColumnName("STARTYEAR8"); - - b1.Property("TARGETAB") - .HasColumnType("bit") - .HasColumnName("TARGETAB8"); - - b1.Property("TARGETINF") - .HasColumnType("bit") - .HasColumnName("TARGETINF8"); - - b1.Property("TARGETOTH") - .HasColumnType("bit") - .HasColumnName("TARGETOTH8"); - - b1.Property("TARGETOTX") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)") - .HasColumnName("TARGETOTX8"); - - b1.Property("TARGETSYN") - .HasColumnType("bit") - .HasColumnName("TARGETSYN8"); - - b1.Property("TARGETTAU") - .HasColumnType("bit") - .HasColumnName("TARGETTAU8"); - - b1.Property("TRIALGRP") - .HasColumnType("int") - .HasColumnName("TRIALGRP8"); - - b1.Property("TRTTRIAL") - .HasMaxLength(60) - .HasColumnType("nvarchar(60)") - .HasColumnName("TRTTRIAL8"); - - b1.HasKey("A4aId"); - - b1.ToTable("tbl_A4as"); - - b1.WithOwner() - .HasForeignKey("A4aId"); - }); - - b.Navigation("Treatment1") - .IsRequired(); - - b.Navigation("Treatment2") - .IsRequired(); - - b.Navigation("Treatment3") - .IsRequired(); - - b.Navigation("Treatment4") - .IsRequired(); - - b.Navigation("Treatment5") - .IsRequired(); - - b.Navigation("Treatment6") - .IsRequired(); - - b.Navigation("Treatment7") - .IsRequired(); - - b.Navigation("Treatment8") - .IsRequired(); - }); - - modelBuilder.Entity("UDS.Net.API.Entities.A5D2", b => - { - b.HasOne("UDS.Net.API.Entities.Visit", null) - .WithOne("A5D2") - .HasForeignKey("UDS.Net.API.Entities.A5D2", "VisitId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("UDS.Net.API.Entities.B1", b => - { - b.HasOne("UDS.Net.API.Entities.Visit", null) - .WithOne("B1") - .HasForeignKey("UDS.Net.API.Entities.B1", "VisitId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("UDS.Net.API.Entities.B3", b => - { - b.HasOne("UDS.Net.API.Entities.Visit", null) - .WithOne("B3") - .HasForeignKey("UDS.Net.API.Entities.B3", "VisitId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("UDS.Net.API.Entities.B4", b => - { - b.HasOne("UDS.Net.API.Entities.Visit", null) - .WithOne("B4") - .HasForeignKey("UDS.Net.API.Entities.B4", "VisitId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("UDS.Net.API.Entities.B5", b => - { - b.HasOne("UDS.Net.API.Entities.Visit", null) - .WithOne("B5") - .HasForeignKey("UDS.Net.API.Entities.B5", "VisitId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("UDS.Net.API.Entities.B6", b => - { - b.HasOne("UDS.Net.API.Entities.Visit", null) - .WithOne("B6") - .HasForeignKey("UDS.Net.API.Entities.B6", "VisitId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("UDS.Net.API.Entities.B7", b => - { - b.HasOne("UDS.Net.API.Entities.Visit", null) - .WithOne("B7") - .HasForeignKey("UDS.Net.API.Entities.B7", "VisitId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("UDS.Net.API.Entities.B8", b => - { - b.HasOne("UDS.Net.API.Entities.Visit", null) - .WithOne("B8") - .HasForeignKey("UDS.Net.API.Entities.B8", "VisitId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("UDS.Net.API.Entities.B9", b => - { - b.HasOne("UDS.Net.API.Entities.Visit", null) - .WithOne("B9") - .HasForeignKey("UDS.Net.API.Entities.B9", "VisitId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("UDS.Net.API.Entities.C1", b => - { - b.HasOne("UDS.Net.API.Entities.Visit", null) - .WithOne("C1") - .HasForeignKey("UDS.Net.API.Entities.C1", "VisitId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("UDS.Net.API.Entities.C2", b => - { - b.HasOne("UDS.Net.API.Entities.Visit", null) - .WithOne("C2") - .HasForeignKey("UDS.Net.API.Entities.C2", "VisitId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("UDS.Net.API.Entities.D1a", b => - { - b.HasOne("UDS.Net.API.Entities.Visit", null) - .WithOne("D1a") - .HasForeignKey("UDS.Net.API.Entities.D1a", "VisitId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("UDS.Net.API.Entities.D1b", b => - { - b.HasOne("UDS.Net.API.Entities.Visit", null) - .WithOne("D1b") - .HasForeignKey("UDS.Net.API.Entities.D1b", "VisitId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("UDS.Net.API.Entities.FormStatus", b => - { - b.HasOne("UDS.Net.API.Entities.Visit", null) - .WithMany("FormStatuses") - .HasForeignKey("VisitId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("UDS.Net.API.Entities.M1", b => - { - b.HasOne("UDS.Net.API.Entities.Participation", "Participation") - .WithMany("M1s") - .HasForeignKey("ParticipationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Participation"); - }); - - modelBuilder.Entity("UDS.Net.API.Entities.PacketSubmission", b => - { - b.HasOne("UDS.Net.API.Entities.Visit", "Visit") - .WithMany("PacketSubmissions") - .HasForeignKey("VisitId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Visit"); - }); - - modelBuilder.Entity("UDS.Net.API.Entities.PacketSubmissionError", b => - { - b.HasOne("UDS.Net.API.Entities.PacketSubmission", "PacketSubmission") - .WithMany("PacketSubmissionErrors") - .HasForeignKey("PacketSubmissionId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("PacketSubmission"); - }); - - modelBuilder.Entity("UDS.Net.API.Entities.T1", b => - { - b.HasOne("UDS.Net.API.Entities.Visit", null) - .WithOne("T1") - .HasForeignKey("UDS.Net.API.Entities.T1", "VisitId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("UDS.Net.API.Entities.Visit", b => - { - b.HasOne("UDS.Net.API.Entities.Participation", "Participation") - .WithMany("Visits") - .HasForeignKey("ParticipationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Participation"); - }); - - modelBuilder.Entity("UDS.Net.API.Entities.PacketSubmission", b => - { - b.Navigation("PacketSubmissionErrors"); - }); - - modelBuilder.Entity("UDS.Net.API.Entities.Participation", b => - { - b.Navigation("M1s"); - - b.Navigation("Visits"); - }); - - modelBuilder.Entity("UDS.Net.API.Entities.Visit", b => - { - b.Navigation("A1") - .IsRequired(); - - b.Navigation("A1a") - .IsRequired(); - - b.Navigation("A2") - .IsRequired(); - - b.Navigation("A3") - .IsRequired(); - - b.Navigation("A4") - .IsRequired(); - - b.Navigation("A4a") - .IsRequired(); - - b.Navigation("A5D2") - .IsRequired(); - - b.Navigation("B1") - .IsRequired(); - - b.Navigation("B3") - .IsRequired(); - - b.Navigation("B4") - .IsRequired(); - - b.Navigation("B5") - .IsRequired(); - - b.Navigation("B6") - .IsRequired(); - - b.Navigation("B7") - .IsRequired(); - - b.Navigation("B8") - .IsRequired(); - - b.Navigation("B9") - .IsRequired(); - - b.Navigation("C1") - .IsRequired(); - - b.Navigation("C2") - .IsRequired(); - - b.Navigation("D1a") - .IsRequired(); - - b.Navigation("D1b") - .IsRequired(); - - b.Navigation("FormStatuses"); - - b.Navigation("PacketSubmissions"); - - b.Navigation("T1"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/UDS.Net.API/Data/Migrations/20240814181754_SupportPacketSubmission.cs b/src/UDS.Net.API/Data/Migrations/20240814181754_SupportPacketSubmission.cs deleted file mode 100644 index edadbb7..0000000 --- a/src/UDS.Net.API/Data/Migrations/20240814181754_SupportPacketSubmission.cs +++ /dev/null @@ -1,100 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace UDS.Net.API.Data.Migrations -{ - /// - public partial class SupportPacketSubmission : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "Status", - table: "tbl_Visits", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.CreateTable( - name: "PacketSubmissions", - columns: table => new - { - PacketSubmissionId = table.Column(type: "int", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - SubmissionDate = table.Column(type: "datetime2", nullable: false), - VisitId = table.Column(type: "int", nullable: false), - CreatedAt = table.Column(type: "datetime2", nullable: false), - CreatedBy = table.Column(type: "nvarchar(max)", nullable: false), - ModifiedBy = table.Column(type: "nvarchar(max)", nullable: true), - DeletedBy = table.Column(type: "nvarchar(max)", nullable: true), - IsDeleted = table.Column(type: "bit", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_PacketSubmissions", x => x.PacketSubmissionId); - table.ForeignKey( - name: "FK_PacketSubmissions_tbl_Visits_VisitId", - column: x => x.VisitId, - principalTable: "tbl_Visits", - principalColumn: "VisitId", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "PacketSubmissionErrors", - columns: table => new - { - PacketSubmissionErrorId = table.Column(type: "int", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - FormKind = table.Column(type: "nvarchar(10)", maxLength: 10, nullable: false), - Message = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: false), - AssignedTo = table.Column(type: "nvarchar(max)", nullable: false), - Level = table.Column(type: "int", nullable: false), - ResolvedBy = table.Column(type: "nvarchar(max)", nullable: false), - PacketSubmissionId = table.Column(type: "int", nullable: false), - CreatedAt = table.Column(type: "datetime2", nullable: false), - CreatedBy = table.Column(type: "nvarchar(max)", nullable: false), - ModifiedBy = table.Column(type: "nvarchar(max)", nullable: true), - DeletedBy = table.Column(type: "nvarchar(max)", nullable: true), - IsDeleted = table.Column(type: "bit", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_PacketSubmissionErrors", x => x.PacketSubmissionErrorId); - table.ForeignKey( - name: "FK_PacketSubmissionErrors_PacketSubmissions_PacketSubmissionId", - column: x => x.PacketSubmissionId, - principalTable: "PacketSubmissions", - principalColumn: "PacketSubmissionId", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateIndex( - name: "IX_PacketSubmissionErrors_PacketSubmissionId", - table: "PacketSubmissionErrors", - column: "PacketSubmissionId"); - - migrationBuilder.CreateIndex( - name: "IX_PacketSubmissions_VisitId", - table: "PacketSubmissions", - column: "VisitId"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "PacketSubmissionErrors"); - - migrationBuilder.DropTable( - name: "PacketSubmissions"); - - migrationBuilder.DropColumn( - name: "Status", - table: "tbl_Visits"); - } - } -} diff --git a/src/UDS.Net.API/Data/Migrations/ApiDbContextModelSnapshot.cs b/src/UDS.Net.API/Data/Migrations/ApiDbContextModelSnapshot.cs index bfb16d3..81e199d 100644 --- a/src/UDS.Net.API/Data/Migrations/ApiDbContextModelSnapshot.cs +++ b/src/UDS.Net.API/Data/Migrations/ApiDbContextModelSnapshot.cs @@ -443,7 +443,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("VisitId") .IsUnique(); - b.ToTable("tbl_A1s"); + b.ToTable("tbl_A1s", (string)null); }); modelBuilder.Entity("UDS.Net.API.Entities.A1a", b => @@ -770,7 +770,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("VisitId") .IsUnique(); - b.ToTable("tbl_A1as"); + b.ToTable("tbl_A1as", (string)null); }); modelBuilder.Entity("UDS.Net.API.Entities.A2", b => @@ -888,7 +888,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("VisitId") .IsUnique(); - b.ToTable("tbl_A2s"); + b.ToTable("tbl_A2s", (string)null); }); modelBuilder.Entity("UDS.Net.API.Entities.A3", b => @@ -1027,7 +1027,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("VisitId") .IsUnique(); - b.ToTable("tbl_A3s"); + b.ToTable("tbl_A3s", (string)null); }); modelBuilder.Entity("UDS.Net.API.Entities.A4", b => @@ -1111,7 +1111,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("VisitId") .IsUnique(); - b.ToTable("tbl_A4s"); + b.ToTable("tbl_A4s", (string)null); }); modelBuilder.Entity("UDS.Net.API.Entities.A4a", b => @@ -1211,7 +1211,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("VisitId") .IsUnique(); - b.ToTable("tbl_A4as"); + b.ToTable("tbl_A4as", (string)null); }); modelBuilder.Entity("UDS.Net.API.Entities.A5D2", b => @@ -1968,7 +1968,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("VisitId") .IsUnique(); - b.ToTable("tbl_A5D2s"); + b.ToTable("tbl_A5D2s", (string)null); }); modelBuilder.Entity("UDS.Net.API.Entities.B1", b => @@ -2109,7 +2109,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("VisitId") .IsUnique(); - b.ToTable("tbl_B1s"); + b.ToTable("tbl_B1s", (string)null); }); modelBuilder.Entity("UDS.Net.API.Entities.B3", b => @@ -2385,7 +2385,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("VisitId") .IsUnique(); - b.ToTable("tbl_B3s"); + b.ToTable("tbl_B3s", (string)null); }); modelBuilder.Entity("UDS.Net.API.Entities.B4", b => @@ -2496,7 +2496,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("VisitId") .IsUnique(); - b.ToTable("tbl_B4s"); + b.ToTable("tbl_B4s", (string)null); }); modelBuilder.Entity("UDS.Net.API.Entities.B5", b => @@ -2656,7 +2656,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("VisitId") .IsUnique(); - b.ToTable("tbl_B5s"); + b.ToTable("tbl_B5s", (string)null); }); modelBuilder.Entity("UDS.Net.API.Entities.B6", b => @@ -2788,7 +2788,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("VisitId") .IsUnique(); - b.ToTable("tbl_B6s"); + b.ToTable("tbl_B6s", (string)null); }); modelBuilder.Entity("UDS.Net.API.Entities.B7", b => @@ -2899,7 +2899,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("VisitId") .IsUnique(); - b.ToTable("tbl_B7s"); + b.ToTable("tbl_B7s", (string)null); }); modelBuilder.Entity("UDS.Net.API.Entities.B8", b => @@ -3095,7 +3095,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("VisitId") .IsUnique(); - b.ToTable("tbl_B8s"); + b.ToTable("tbl_B8s", (string)null); }); modelBuilder.Entity("UDS.Net.API.Entities.B9", b => @@ -3471,7 +3471,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("VisitId") .IsUnique(); - b.ToTable("tbl_B9s"); + b.ToTable("tbl_B9s", (string)null); }); modelBuilder.Entity("UDS.Net.API.Entities.C1", b => @@ -3695,7 +3695,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("VisitId") .IsUnique(); - b.ToTable("tbl_C1s"); + b.ToTable("tbl_C1s", (string)null); }); modelBuilder.Entity("UDS.Net.API.Entities.C2", b => @@ -4124,7 +4124,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("VisitId") .IsUnique(); - b.ToTable("tbl_C2s"); + b.ToTable("tbl_C2s", (string)null); }); modelBuilder.Entity("UDS.Net.API.Entities.D1a", b => @@ -4637,7 +4637,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("VisitId") .IsUnique(); - b.ToTable("tbl_D1as"); + b.ToTable("tbl_D1as", (string)null); }); modelBuilder.Entity("UDS.Net.API.Entities.D1b", b => @@ -5119,7 +5119,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("VisitId") .IsUnique(); - b.ToTable("tbl_D1bs"); + b.ToTable("tbl_D1bs", (string)null); }); modelBuilder.Entity("UDS.Net.API.Entities.DrugCodeLookup", b => @@ -5144,7 +5144,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("RxNormId"); - b.ToTable("DrugCodesLookup"); + b.ToTable("DrugCodesLookup", (string)null); }); modelBuilder.Entity("UDS.Net.API.Entities.FormStatus", b => @@ -5350,103 +5350,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("ParticipationId"); - b.ToTable("tbl_M1s"); - }); - - modelBuilder.Entity("UDS.Net.API.Entities.PacketSubmission", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasColumnName("PacketSubmissionId") - .HasColumnOrder(0); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("DeletedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("ModifiedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("SubmissionDate") - .HasColumnType("datetime2"); - - b.Property("VisitId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("VisitId"); - - b.ToTable("PacketSubmissions"); - }); - - modelBuilder.Entity("UDS.Net.API.Entities.PacketSubmissionError", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasColumnName("PacketSubmissionErrorId") - .HasColumnOrder(0); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("AssignedTo") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("DeletedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("FormKind") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("nvarchar(10)"); - - b.Property("IsDeleted") - .HasColumnType("bit"); - - b.Property("Level") - .HasColumnType("int"); - - b.Property("Message") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("ModifiedBy") - .HasColumnType("nvarchar(max)"); - - b.Property("PacketSubmissionId") - .HasColumnType("int"); - - b.Property("ResolvedBy") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("PacketSubmissionId"); - - b.ToTable("PacketSubmissionErrors"); + b.ToTable("tbl_M1s", (string)null); }); modelBuilder.Entity("UDS.Net.API.Entities.Participation", b => @@ -5480,7 +5384,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("Participation"); + b.ToTable("Participation", (string)null); }); modelBuilder.Entity("UDS.Net.API.Entities.T1", b => @@ -5592,7 +5496,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("VisitId") .IsUnique(); - b.ToTable("tbl_T1s"); + b.ToTable("tbl_T1s", (string)null); }); modelBuilder.Entity("UDS.Net.API.Entities.Visit", b => @@ -5643,9 +5547,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("ParticipationId") .HasColumnType("int"); - b.Property("Status") - .HasColumnType("int"); - b.Property("VISITNUM") .HasColumnType("int") .HasColumnName("VISITNUM"); @@ -5658,7 +5559,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("ParticipationId", "VISITNUM") .IsUnique(); - b.ToTable("tbl_Visits"); + b.ToTable("tbl_Visits", (string)null); }); modelBuilder.Entity("UDS.Net.API.Entities.A1", b => @@ -5696,7 +5597,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "KID1", b1 => + b.OwnsOne("UDS.Net.API.Entities.A3.KID1#UDS.Net.API.Entities.A3FamilyMember", "KID1", b1 => { b1.Property("A3Id") .HasColumnType("int"); @@ -5723,13 +5624,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A3Id"); - b1.ToTable("tbl_A3s"); + b1.ToTable("tbl_A3s", (string)null); b1.WithOwner() .HasForeignKey("A3Id"); }); - b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "KID10", b1 => + b.OwnsOne("UDS.Net.API.Entities.A3.KID10#UDS.Net.API.Entities.A3FamilyMember", "KID10", b1 => { b1.Property("A3Id") .HasColumnType("int"); @@ -5756,13 +5657,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A3Id"); - b1.ToTable("tbl_A3s"); + b1.ToTable("tbl_A3s", (string)null); b1.WithOwner() .HasForeignKey("A3Id"); }); - b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "KID11", b1 => + b.OwnsOne("UDS.Net.API.Entities.A3.KID11#UDS.Net.API.Entities.A3FamilyMember", "KID11", b1 => { b1.Property("A3Id") .HasColumnType("int"); @@ -5789,13 +5690,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A3Id"); - b1.ToTable("tbl_A3s"); + b1.ToTable("tbl_A3s", (string)null); b1.WithOwner() .HasForeignKey("A3Id"); }); - b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "KID12", b1 => + b.OwnsOne("UDS.Net.API.Entities.A3.KID12#UDS.Net.API.Entities.A3FamilyMember", "KID12", b1 => { b1.Property("A3Id") .HasColumnType("int"); @@ -5822,13 +5723,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A3Id"); - b1.ToTable("tbl_A3s"); + b1.ToTable("tbl_A3s", (string)null); b1.WithOwner() .HasForeignKey("A3Id"); }); - b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "KID13", b1 => + b.OwnsOne("UDS.Net.API.Entities.A3.KID13#UDS.Net.API.Entities.A3FamilyMember", "KID13", b1 => { b1.Property("A3Id") .HasColumnType("int"); @@ -5855,13 +5756,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A3Id"); - b1.ToTable("tbl_A3s"); + b1.ToTable("tbl_A3s", (string)null); b1.WithOwner() .HasForeignKey("A3Id"); }); - b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "KID14", b1 => + b.OwnsOne("UDS.Net.API.Entities.A3.KID14#UDS.Net.API.Entities.A3FamilyMember", "KID14", b1 => { b1.Property("A3Id") .HasColumnType("int"); @@ -5888,13 +5789,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A3Id"); - b1.ToTable("tbl_A3s"); + b1.ToTable("tbl_A3s", (string)null); b1.WithOwner() .HasForeignKey("A3Id"); }); - b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "KID15", b1 => + b.OwnsOne("UDS.Net.API.Entities.A3.KID15#UDS.Net.API.Entities.A3FamilyMember", "KID15", b1 => { b1.Property("A3Id") .HasColumnType("int"); @@ -5921,13 +5822,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A3Id"); - b1.ToTable("tbl_A3s"); + b1.ToTable("tbl_A3s", (string)null); b1.WithOwner() .HasForeignKey("A3Id"); }); - b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "KID2", b1 => + b.OwnsOne("UDS.Net.API.Entities.A3.KID2#UDS.Net.API.Entities.A3FamilyMember", "KID2", b1 => { b1.Property("A3Id") .HasColumnType("int"); @@ -5954,13 +5855,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A3Id"); - b1.ToTable("tbl_A3s"); + b1.ToTable("tbl_A3s", (string)null); b1.WithOwner() .HasForeignKey("A3Id"); }); - b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "KID3", b1 => + b.OwnsOne("UDS.Net.API.Entities.A3.KID3#UDS.Net.API.Entities.A3FamilyMember", "KID3", b1 => { b1.Property("A3Id") .HasColumnType("int"); @@ -5987,13 +5888,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A3Id"); - b1.ToTable("tbl_A3s"); + b1.ToTable("tbl_A3s", (string)null); b1.WithOwner() .HasForeignKey("A3Id"); }); - b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "KID4", b1 => + b.OwnsOne("UDS.Net.API.Entities.A3.KID4#UDS.Net.API.Entities.A3FamilyMember", "KID4", b1 => { b1.Property("A3Id") .HasColumnType("int"); @@ -6020,13 +5921,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A3Id"); - b1.ToTable("tbl_A3s"); + b1.ToTable("tbl_A3s", (string)null); b1.WithOwner() .HasForeignKey("A3Id"); }); - b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "KID5", b1 => + b.OwnsOne("UDS.Net.API.Entities.A3.KID5#UDS.Net.API.Entities.A3FamilyMember", "KID5", b1 => { b1.Property("A3Id") .HasColumnType("int"); @@ -6053,13 +5954,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A3Id"); - b1.ToTable("tbl_A3s"); + b1.ToTable("tbl_A3s", (string)null); b1.WithOwner() .HasForeignKey("A3Id"); }); - b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "KID6", b1 => + b.OwnsOne("UDS.Net.API.Entities.A3.KID6#UDS.Net.API.Entities.A3FamilyMember", "KID6", b1 => { b1.Property("A3Id") .HasColumnType("int"); @@ -6086,13 +5987,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A3Id"); - b1.ToTable("tbl_A3s"); + b1.ToTable("tbl_A3s", (string)null); b1.WithOwner() .HasForeignKey("A3Id"); }); - b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "KID7", b1 => + b.OwnsOne("UDS.Net.API.Entities.A3.KID7#UDS.Net.API.Entities.A3FamilyMember", "KID7", b1 => { b1.Property("A3Id") .HasColumnType("int"); @@ -6119,13 +6020,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A3Id"); - b1.ToTable("tbl_A3s"); + b1.ToTable("tbl_A3s", (string)null); b1.WithOwner() .HasForeignKey("A3Id"); }); - b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "KID8", b1 => + b.OwnsOne("UDS.Net.API.Entities.A3.KID8#UDS.Net.API.Entities.A3FamilyMember", "KID8", b1 => { b1.Property("A3Id") .HasColumnType("int"); @@ -6152,13 +6053,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A3Id"); - b1.ToTable("tbl_A3s"); + b1.ToTable("tbl_A3s", (string)null); b1.WithOwner() .HasForeignKey("A3Id"); }); - b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "KID9", b1 => + b.OwnsOne("UDS.Net.API.Entities.A3.KID9#UDS.Net.API.Entities.A3FamilyMember", "KID9", b1 => { b1.Property("A3Id") .HasColumnType("int"); @@ -6185,13 +6086,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A3Id"); - b1.ToTable("tbl_A3s"); + b1.ToTable("tbl_A3s", (string)null); b1.WithOwner() .HasForeignKey("A3Id"); }); - b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB1", b1 => + b.OwnsOne("UDS.Net.API.Entities.A3.SIB1#UDS.Net.API.Entities.A3FamilyMember", "SIB1", b1 => { b1.Property("A3Id") .HasColumnType("int"); @@ -6218,13 +6119,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A3Id"); - b1.ToTable("tbl_A3s"); + b1.ToTable("tbl_A3s", (string)null); b1.WithOwner() .HasForeignKey("A3Id"); }); - b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB10", b1 => + b.OwnsOne("UDS.Net.API.Entities.A3.SIB10#UDS.Net.API.Entities.A3FamilyMember", "SIB10", b1 => { b1.Property("A3Id") .HasColumnType("int"); @@ -6251,13 +6152,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A3Id"); - b1.ToTable("tbl_A3s"); + b1.ToTable("tbl_A3s", (string)null); b1.WithOwner() .HasForeignKey("A3Id"); }); - b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB11", b1 => + b.OwnsOne("UDS.Net.API.Entities.A3.SIB11#UDS.Net.API.Entities.A3FamilyMember", "SIB11", b1 => { b1.Property("A3Id") .HasColumnType("int"); @@ -6284,13 +6185,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A3Id"); - b1.ToTable("tbl_A3s"); + b1.ToTable("tbl_A3s", (string)null); b1.WithOwner() .HasForeignKey("A3Id"); }); - b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB12", b1 => + b.OwnsOne("UDS.Net.API.Entities.A3.SIB12#UDS.Net.API.Entities.A3FamilyMember", "SIB12", b1 => { b1.Property("A3Id") .HasColumnType("int"); @@ -6317,13 +6218,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A3Id"); - b1.ToTable("tbl_A3s"); + b1.ToTable("tbl_A3s", (string)null); b1.WithOwner() .HasForeignKey("A3Id"); }); - b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB13", b1 => + b.OwnsOne("UDS.Net.API.Entities.A3.SIB13#UDS.Net.API.Entities.A3FamilyMember", "SIB13", b1 => { b1.Property("A3Id") .HasColumnType("int"); @@ -6350,13 +6251,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A3Id"); - b1.ToTable("tbl_A3s"); + b1.ToTable("tbl_A3s", (string)null); b1.WithOwner() .HasForeignKey("A3Id"); }); - b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB14", b1 => + b.OwnsOne("UDS.Net.API.Entities.A3.SIB14#UDS.Net.API.Entities.A3FamilyMember", "SIB14", b1 => { b1.Property("A3Id") .HasColumnType("int"); @@ -6383,13 +6284,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A3Id"); - b1.ToTable("tbl_A3s"); + b1.ToTable("tbl_A3s", (string)null); b1.WithOwner() .HasForeignKey("A3Id"); }); - b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB15", b1 => + b.OwnsOne("UDS.Net.API.Entities.A3.SIB15#UDS.Net.API.Entities.A3FamilyMember", "SIB15", b1 => { b1.Property("A3Id") .HasColumnType("int"); @@ -6416,13 +6317,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A3Id"); - b1.ToTable("tbl_A3s"); + b1.ToTable("tbl_A3s", (string)null); b1.WithOwner() .HasForeignKey("A3Id"); }); - b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB16", b1 => + b.OwnsOne("UDS.Net.API.Entities.A3.SIB16#UDS.Net.API.Entities.A3FamilyMember", "SIB16", b1 => { b1.Property("A3Id") .HasColumnType("int"); @@ -6449,13 +6350,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A3Id"); - b1.ToTable("tbl_A3s"); + b1.ToTable("tbl_A3s", (string)null); b1.WithOwner() .HasForeignKey("A3Id"); }); - b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB17", b1 => + b.OwnsOne("UDS.Net.API.Entities.A3.SIB17#UDS.Net.API.Entities.A3FamilyMember", "SIB17", b1 => { b1.Property("A3Id") .HasColumnType("int"); @@ -6482,13 +6383,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A3Id"); - b1.ToTable("tbl_A3s"); + b1.ToTable("tbl_A3s", (string)null); b1.WithOwner() .HasForeignKey("A3Id"); }); - b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB18", b1 => + b.OwnsOne("UDS.Net.API.Entities.A3.SIB18#UDS.Net.API.Entities.A3FamilyMember", "SIB18", b1 => { b1.Property("A3Id") .HasColumnType("int"); @@ -6515,13 +6416,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A3Id"); - b1.ToTable("tbl_A3s"); + b1.ToTable("tbl_A3s", (string)null); b1.WithOwner() .HasForeignKey("A3Id"); }); - b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB19", b1 => + b.OwnsOne("UDS.Net.API.Entities.A3.SIB19#UDS.Net.API.Entities.A3FamilyMember", "SIB19", b1 => { b1.Property("A3Id") .HasColumnType("int"); @@ -6548,13 +6449,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A3Id"); - b1.ToTable("tbl_A3s"); + b1.ToTable("tbl_A3s", (string)null); b1.WithOwner() .HasForeignKey("A3Id"); }); - b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB2", b1 => + b.OwnsOne("UDS.Net.API.Entities.A3.SIB2#UDS.Net.API.Entities.A3FamilyMember", "SIB2", b1 => { b1.Property("A3Id") .HasColumnType("int"); @@ -6581,13 +6482,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A3Id"); - b1.ToTable("tbl_A3s"); + b1.ToTable("tbl_A3s", (string)null); b1.WithOwner() .HasForeignKey("A3Id"); }); - b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB20", b1 => + b.OwnsOne("UDS.Net.API.Entities.A3.SIB20#UDS.Net.API.Entities.A3FamilyMember", "SIB20", b1 => { b1.Property("A3Id") .HasColumnType("int"); @@ -6614,13 +6515,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A3Id"); - b1.ToTable("tbl_A3s"); + b1.ToTable("tbl_A3s", (string)null); b1.WithOwner() .HasForeignKey("A3Id"); }); - b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB3", b1 => + b.OwnsOne("UDS.Net.API.Entities.A3.SIB3#UDS.Net.API.Entities.A3FamilyMember", "SIB3", b1 => { b1.Property("A3Id") .HasColumnType("int"); @@ -6647,13 +6548,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A3Id"); - b1.ToTable("tbl_A3s"); + b1.ToTable("tbl_A3s", (string)null); b1.WithOwner() .HasForeignKey("A3Id"); }); - b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB4", b1 => + b.OwnsOne("UDS.Net.API.Entities.A3.SIB4#UDS.Net.API.Entities.A3FamilyMember", "SIB4", b1 => { b1.Property("A3Id") .HasColumnType("int"); @@ -6680,13 +6581,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A3Id"); - b1.ToTable("tbl_A3s"); + b1.ToTable("tbl_A3s", (string)null); b1.WithOwner() .HasForeignKey("A3Id"); }); - b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB5", b1 => + b.OwnsOne("UDS.Net.API.Entities.A3.SIB5#UDS.Net.API.Entities.A3FamilyMember", "SIB5", b1 => { b1.Property("A3Id") .HasColumnType("int"); @@ -6713,13 +6614,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A3Id"); - b1.ToTable("tbl_A3s"); + b1.ToTable("tbl_A3s", (string)null); b1.WithOwner() .HasForeignKey("A3Id"); }); - b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB6", b1 => + b.OwnsOne("UDS.Net.API.Entities.A3.SIB6#UDS.Net.API.Entities.A3FamilyMember", "SIB6", b1 => { b1.Property("A3Id") .HasColumnType("int"); @@ -6746,13 +6647,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A3Id"); - b1.ToTable("tbl_A3s"); + b1.ToTable("tbl_A3s", (string)null); b1.WithOwner() .HasForeignKey("A3Id"); }); - b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB7", b1 => + b.OwnsOne("UDS.Net.API.Entities.A3.SIB7#UDS.Net.API.Entities.A3FamilyMember", "SIB7", b1 => { b1.Property("A3Id") .HasColumnType("int"); @@ -6779,13 +6680,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A3Id"); - b1.ToTable("tbl_A3s"); + b1.ToTable("tbl_A3s", (string)null); b1.WithOwner() .HasForeignKey("A3Id"); }); - b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB8", b1 => + b.OwnsOne("UDS.Net.API.Entities.A3.SIB8#UDS.Net.API.Entities.A3FamilyMember", "SIB8", b1 => { b1.Property("A3Id") .HasColumnType("int"); @@ -6812,13 +6713,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A3Id"); - b1.ToTable("tbl_A3s"); + b1.ToTable("tbl_A3s", (string)null); b1.WithOwner() .HasForeignKey("A3Id"); }); - b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB9", b1 => + b.OwnsOne("UDS.Net.API.Entities.A3.SIB9#UDS.Net.API.Entities.A3FamilyMember", "SIB9", b1 => { b1.Property("A3Id") .HasColumnType("int"); @@ -6845,7 +6746,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A3Id"); - b1.ToTable("tbl_A3s"); + b1.ToTable("tbl_A3s", (string)null); b1.WithOwner() .HasForeignKey("A3Id"); @@ -6965,7 +6866,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID1", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4.RXNORMID1#UDS.Net.API.Entities.A4D", "RXNORMID1", b1 => { b1.Property("A4Id") .HasColumnType("int"); @@ -6977,7 +6878,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasIndex("RxNormId"); - b1.ToTable("tbl_A4s"); + b1.ToTable("tbl_A4s", (string)null); b1.WithOwner() .HasForeignKey("A4Id"); @@ -6989,7 +6890,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.Navigation("DrugCode"); }); - b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID10", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4.RXNORMID10#UDS.Net.API.Entities.A4D", "RXNORMID10", b1 => { b1.Property("A4Id") .HasColumnType("int"); @@ -7001,7 +6902,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasIndex("RxNormId"); - b1.ToTable("tbl_A4s"); + b1.ToTable("tbl_A4s", (string)null); b1.WithOwner() .HasForeignKey("A4Id"); @@ -7013,7 +6914,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.Navigation("DrugCode"); }); - b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID11", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4.RXNORMID11#UDS.Net.API.Entities.A4D", "RXNORMID11", b1 => { b1.Property("A4Id") .HasColumnType("int"); @@ -7025,7 +6926,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasIndex("RxNormId"); - b1.ToTable("tbl_A4s"); + b1.ToTable("tbl_A4s", (string)null); b1.WithOwner() .HasForeignKey("A4Id"); @@ -7037,7 +6938,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.Navigation("DrugCode"); }); - b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID12", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4.RXNORMID12#UDS.Net.API.Entities.A4D", "RXNORMID12", b1 => { b1.Property("A4Id") .HasColumnType("int"); @@ -7049,7 +6950,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasIndex("RxNormId"); - b1.ToTable("tbl_A4s"); + b1.ToTable("tbl_A4s", (string)null); b1.WithOwner() .HasForeignKey("A4Id"); @@ -7061,7 +6962,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.Navigation("DrugCode"); }); - b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID13", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4.RXNORMID13#UDS.Net.API.Entities.A4D", "RXNORMID13", b1 => { b1.Property("A4Id") .HasColumnType("int"); @@ -7073,7 +6974,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasIndex("RxNormId"); - b1.ToTable("tbl_A4s"); + b1.ToTable("tbl_A4s", (string)null); b1.WithOwner() .HasForeignKey("A4Id"); @@ -7085,7 +6986,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.Navigation("DrugCode"); }); - b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID14", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4.RXNORMID14#UDS.Net.API.Entities.A4D", "RXNORMID14", b1 => { b1.Property("A4Id") .HasColumnType("int"); @@ -7097,7 +6998,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasIndex("RxNormId"); - b1.ToTable("tbl_A4s"); + b1.ToTable("tbl_A4s", (string)null); b1.WithOwner() .HasForeignKey("A4Id"); @@ -7109,7 +7010,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.Navigation("DrugCode"); }); - b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID15", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4.RXNORMID15#UDS.Net.API.Entities.A4D", "RXNORMID15", b1 => { b1.Property("A4Id") .HasColumnType("int"); @@ -7121,7 +7022,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasIndex("RxNormId"); - b1.ToTable("tbl_A4s"); + b1.ToTable("tbl_A4s", (string)null); b1.WithOwner() .HasForeignKey("A4Id"); @@ -7133,7 +7034,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.Navigation("DrugCode"); }); - b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID16", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4.RXNORMID16#UDS.Net.API.Entities.A4D", "RXNORMID16", b1 => { b1.Property("A4Id") .HasColumnType("int"); @@ -7145,7 +7046,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasIndex("RxNormId"); - b1.ToTable("tbl_A4s"); + b1.ToTable("tbl_A4s", (string)null); b1.WithOwner() .HasForeignKey("A4Id"); @@ -7157,7 +7058,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.Navigation("DrugCode"); }); - b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID17", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4.RXNORMID17#UDS.Net.API.Entities.A4D", "RXNORMID17", b1 => { b1.Property("A4Id") .HasColumnType("int"); @@ -7169,7 +7070,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasIndex("RxNormId"); - b1.ToTable("tbl_A4s"); + b1.ToTable("tbl_A4s", (string)null); b1.WithOwner() .HasForeignKey("A4Id"); @@ -7181,7 +7082,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.Navigation("DrugCode"); }); - b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID18", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4.RXNORMID18#UDS.Net.API.Entities.A4D", "RXNORMID18", b1 => { b1.Property("A4Id") .HasColumnType("int"); @@ -7193,7 +7094,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasIndex("RxNormId"); - b1.ToTable("tbl_A4s"); + b1.ToTable("tbl_A4s", (string)null); b1.WithOwner() .HasForeignKey("A4Id"); @@ -7205,7 +7106,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.Navigation("DrugCode"); }); - b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID19", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4.RXNORMID19#UDS.Net.API.Entities.A4D", "RXNORMID19", b1 => { b1.Property("A4Id") .HasColumnType("int"); @@ -7217,7 +7118,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasIndex("RxNormId"); - b1.ToTable("tbl_A4s"); + b1.ToTable("tbl_A4s", (string)null); b1.WithOwner() .HasForeignKey("A4Id"); @@ -7229,7 +7130,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.Navigation("DrugCode"); }); - b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID2", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4.RXNORMID2#UDS.Net.API.Entities.A4D", "RXNORMID2", b1 => { b1.Property("A4Id") .HasColumnType("int"); @@ -7241,7 +7142,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasIndex("RxNormId"); - b1.ToTable("tbl_A4s"); + b1.ToTable("tbl_A4s", (string)null); b1.WithOwner() .HasForeignKey("A4Id"); @@ -7253,7 +7154,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.Navigation("DrugCode"); }); - b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID20", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4.RXNORMID20#UDS.Net.API.Entities.A4D", "RXNORMID20", b1 => { b1.Property("A4Id") .HasColumnType("int"); @@ -7265,7 +7166,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasIndex("RxNormId"); - b1.ToTable("tbl_A4s"); + b1.ToTable("tbl_A4s", (string)null); b1.WithOwner() .HasForeignKey("A4Id"); @@ -7277,7 +7178,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.Navigation("DrugCode"); }); - b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID21", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4.RXNORMID21#UDS.Net.API.Entities.A4D", "RXNORMID21", b1 => { b1.Property("A4Id") .HasColumnType("int"); @@ -7289,7 +7190,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasIndex("RxNormId"); - b1.ToTable("tbl_A4s"); + b1.ToTable("tbl_A4s", (string)null); b1.WithOwner() .HasForeignKey("A4Id"); @@ -7301,7 +7202,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.Navigation("DrugCode"); }); - b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID22", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4.RXNORMID22#UDS.Net.API.Entities.A4D", "RXNORMID22", b1 => { b1.Property("A4Id") .HasColumnType("int"); @@ -7313,7 +7214,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasIndex("RxNormId"); - b1.ToTable("tbl_A4s"); + b1.ToTable("tbl_A4s", (string)null); b1.WithOwner() .HasForeignKey("A4Id"); @@ -7325,7 +7226,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.Navigation("DrugCode"); }); - b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID23", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4.RXNORMID23#UDS.Net.API.Entities.A4D", "RXNORMID23", b1 => { b1.Property("A4Id") .HasColumnType("int"); @@ -7337,7 +7238,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasIndex("RxNormId"); - b1.ToTable("tbl_A4s"); + b1.ToTable("tbl_A4s", (string)null); b1.WithOwner() .HasForeignKey("A4Id"); @@ -7349,7 +7250,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.Navigation("DrugCode"); }); - b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID24", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4.RXNORMID24#UDS.Net.API.Entities.A4D", "RXNORMID24", b1 => { b1.Property("A4Id") .HasColumnType("int"); @@ -7361,7 +7262,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasIndex("RxNormId"); - b1.ToTable("tbl_A4s"); + b1.ToTable("tbl_A4s", (string)null); b1.WithOwner() .HasForeignKey("A4Id"); @@ -7373,7 +7274,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.Navigation("DrugCode"); }); - b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID25", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4.RXNORMID25#UDS.Net.API.Entities.A4D", "RXNORMID25", b1 => { b1.Property("A4Id") .HasColumnType("int"); @@ -7385,7 +7286,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasIndex("RxNormId"); - b1.ToTable("tbl_A4s"); + b1.ToTable("tbl_A4s", (string)null); b1.WithOwner() .HasForeignKey("A4Id"); @@ -7397,7 +7298,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.Navigation("DrugCode"); }); - b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID26", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4.RXNORMID26#UDS.Net.API.Entities.A4D", "RXNORMID26", b1 => { b1.Property("A4Id") .HasColumnType("int"); @@ -7409,7 +7310,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasIndex("RxNormId"); - b1.ToTable("tbl_A4s"); + b1.ToTable("tbl_A4s", (string)null); b1.WithOwner() .HasForeignKey("A4Id"); @@ -7421,7 +7322,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.Navigation("DrugCode"); }); - b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID27", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4.RXNORMID27#UDS.Net.API.Entities.A4D", "RXNORMID27", b1 => { b1.Property("A4Id") .HasColumnType("int"); @@ -7433,7 +7334,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasIndex("RxNormId"); - b1.ToTable("tbl_A4s"); + b1.ToTable("tbl_A4s", (string)null); b1.WithOwner() .HasForeignKey("A4Id"); @@ -7445,7 +7346,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.Navigation("DrugCode"); }); - b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID28", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4.RXNORMID28#UDS.Net.API.Entities.A4D", "RXNORMID28", b1 => { b1.Property("A4Id") .HasColumnType("int"); @@ -7457,7 +7358,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasIndex("RxNormId"); - b1.ToTable("tbl_A4s"); + b1.ToTable("tbl_A4s", (string)null); b1.WithOwner() .HasForeignKey("A4Id"); @@ -7469,7 +7370,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.Navigation("DrugCode"); }); - b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID29", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4.RXNORMID29#UDS.Net.API.Entities.A4D", "RXNORMID29", b1 => { b1.Property("A4Id") .HasColumnType("int"); @@ -7481,7 +7382,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasIndex("RxNormId"); - b1.ToTable("tbl_A4s"); + b1.ToTable("tbl_A4s", (string)null); b1.WithOwner() .HasForeignKey("A4Id"); @@ -7493,7 +7394,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.Navigation("DrugCode"); }); - b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID3", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4.RXNORMID3#UDS.Net.API.Entities.A4D", "RXNORMID3", b1 => { b1.Property("A4Id") .HasColumnType("int"); @@ -7505,7 +7406,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasIndex("RxNormId"); - b1.ToTable("tbl_A4s"); + b1.ToTable("tbl_A4s", (string)null); b1.WithOwner() .HasForeignKey("A4Id"); @@ -7517,7 +7418,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.Navigation("DrugCode"); }); - b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID30", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4.RXNORMID30#UDS.Net.API.Entities.A4D", "RXNORMID30", b1 => { b1.Property("A4Id") .HasColumnType("int"); @@ -7529,7 +7430,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasIndex("RxNormId"); - b1.ToTable("tbl_A4s"); + b1.ToTable("tbl_A4s", (string)null); b1.WithOwner() .HasForeignKey("A4Id"); @@ -7541,7 +7442,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.Navigation("DrugCode"); }); - b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID31", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4.RXNORMID31#UDS.Net.API.Entities.A4D", "RXNORMID31", b1 => { b1.Property("A4Id") .HasColumnType("int"); @@ -7553,7 +7454,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasIndex("RxNormId"); - b1.ToTable("tbl_A4s"); + b1.ToTable("tbl_A4s", (string)null); b1.WithOwner() .HasForeignKey("A4Id"); @@ -7565,7 +7466,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.Navigation("DrugCode"); }); - b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID32", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4.RXNORMID32#UDS.Net.API.Entities.A4D", "RXNORMID32", b1 => { b1.Property("A4Id") .HasColumnType("int"); @@ -7577,7 +7478,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasIndex("RxNormId"); - b1.ToTable("tbl_A4s"); + b1.ToTable("tbl_A4s", (string)null); b1.WithOwner() .HasForeignKey("A4Id"); @@ -7589,7 +7490,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.Navigation("DrugCode"); }); - b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID33", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4.RXNORMID33#UDS.Net.API.Entities.A4D", "RXNORMID33", b1 => { b1.Property("A4Id") .HasColumnType("int"); @@ -7601,7 +7502,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasIndex("RxNormId"); - b1.ToTable("tbl_A4s"); + b1.ToTable("tbl_A4s", (string)null); b1.WithOwner() .HasForeignKey("A4Id"); @@ -7613,7 +7514,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.Navigation("DrugCode"); }); - b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID34", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4.RXNORMID34#UDS.Net.API.Entities.A4D", "RXNORMID34", b1 => { b1.Property("A4Id") .HasColumnType("int"); @@ -7625,7 +7526,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasIndex("RxNormId"); - b1.ToTable("tbl_A4s"); + b1.ToTable("tbl_A4s", (string)null); b1.WithOwner() .HasForeignKey("A4Id"); @@ -7637,7 +7538,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.Navigation("DrugCode"); }); - b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID35", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4.RXNORMID35#UDS.Net.API.Entities.A4D", "RXNORMID35", b1 => { b1.Property("A4Id") .HasColumnType("int"); @@ -7649,7 +7550,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasIndex("RxNormId"); - b1.ToTable("tbl_A4s"); + b1.ToTable("tbl_A4s", (string)null); b1.WithOwner() .HasForeignKey("A4Id"); @@ -7661,7 +7562,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.Navigation("DrugCode"); }); - b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID36", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4.RXNORMID36#UDS.Net.API.Entities.A4D", "RXNORMID36", b1 => { b1.Property("A4Id") .HasColumnType("int"); @@ -7673,7 +7574,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasIndex("RxNormId"); - b1.ToTable("tbl_A4s"); + b1.ToTable("tbl_A4s", (string)null); b1.WithOwner() .HasForeignKey("A4Id"); @@ -7685,7 +7586,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.Navigation("DrugCode"); }); - b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID37", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4.RXNORMID37#UDS.Net.API.Entities.A4D", "RXNORMID37", b1 => { b1.Property("A4Id") .HasColumnType("int"); @@ -7697,7 +7598,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasIndex("RxNormId"); - b1.ToTable("tbl_A4s"); + b1.ToTable("tbl_A4s", (string)null); b1.WithOwner() .HasForeignKey("A4Id"); @@ -7709,7 +7610,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.Navigation("DrugCode"); }); - b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID38", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4.RXNORMID38#UDS.Net.API.Entities.A4D", "RXNORMID38", b1 => { b1.Property("A4Id") .HasColumnType("int"); @@ -7721,7 +7622,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasIndex("RxNormId"); - b1.ToTable("tbl_A4s"); + b1.ToTable("tbl_A4s", (string)null); b1.WithOwner() .HasForeignKey("A4Id"); @@ -7733,7 +7634,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.Navigation("DrugCode"); }); - b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID39", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4.RXNORMID39#UDS.Net.API.Entities.A4D", "RXNORMID39", b1 => { b1.Property("A4Id") .HasColumnType("int"); @@ -7745,7 +7646,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasIndex("RxNormId"); - b1.ToTable("tbl_A4s"); + b1.ToTable("tbl_A4s", (string)null); b1.WithOwner() .HasForeignKey("A4Id"); @@ -7757,7 +7658,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.Navigation("DrugCode"); }); - b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID4", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4.RXNORMID4#UDS.Net.API.Entities.A4D", "RXNORMID4", b1 => { b1.Property("A4Id") .HasColumnType("int"); @@ -7769,7 +7670,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasIndex("RxNormId"); - b1.ToTable("tbl_A4s"); + b1.ToTable("tbl_A4s", (string)null); b1.WithOwner() .HasForeignKey("A4Id"); @@ -7781,7 +7682,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.Navigation("DrugCode"); }); - b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID40", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4.RXNORMID40#UDS.Net.API.Entities.A4D", "RXNORMID40", b1 => { b1.Property("A4Id") .HasColumnType("int"); @@ -7793,7 +7694,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasIndex("RxNormId"); - b1.ToTable("tbl_A4s"); + b1.ToTable("tbl_A4s", (string)null); b1.WithOwner() .HasForeignKey("A4Id"); @@ -7805,7 +7706,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.Navigation("DrugCode"); }); - b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID5", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4.RXNORMID5#UDS.Net.API.Entities.A4D", "RXNORMID5", b1 => { b1.Property("A4Id") .HasColumnType("int"); @@ -7817,7 +7718,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasIndex("RxNormId"); - b1.ToTable("tbl_A4s"); + b1.ToTable("tbl_A4s", (string)null); b1.WithOwner() .HasForeignKey("A4Id"); @@ -7829,7 +7730,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.Navigation("DrugCode"); }); - b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID6", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4.RXNORMID6#UDS.Net.API.Entities.A4D", "RXNORMID6", b1 => { b1.Property("A4Id") .HasColumnType("int"); @@ -7841,7 +7742,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasIndex("RxNormId"); - b1.ToTable("tbl_A4s"); + b1.ToTable("tbl_A4s", (string)null); b1.WithOwner() .HasForeignKey("A4Id"); @@ -7853,7 +7754,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.Navigation("DrugCode"); }); - b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID7", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4.RXNORMID7#UDS.Net.API.Entities.A4D", "RXNORMID7", b1 => { b1.Property("A4Id") .HasColumnType("int"); @@ -7865,7 +7766,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasIndex("RxNormId"); - b1.ToTable("tbl_A4s"); + b1.ToTable("tbl_A4s", (string)null); b1.WithOwner() .HasForeignKey("A4Id"); @@ -7877,7 +7778,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.Navigation("DrugCode"); }); - b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID8", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4.RXNORMID8#UDS.Net.API.Entities.A4D", "RXNORMID8", b1 => { b1.Property("A4Id") .HasColumnType("int"); @@ -7889,7 +7790,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasIndex("RxNormId"); - b1.ToTable("tbl_A4s"); + b1.ToTable("tbl_A4s", (string)null); b1.WithOwner() .HasForeignKey("A4Id"); @@ -7901,7 +7802,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.Navigation("DrugCode"); }); - b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID9", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4.RXNORMID9#UDS.Net.API.Entities.A4D", "RXNORMID9", b1 => { b1.Property("A4Id") .HasColumnType("int"); @@ -7913,7 +7814,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasIndex("RxNormId"); - b1.ToTable("tbl_A4s"); + b1.ToTable("tbl_A4s", (string)null); b1.WithOwner() .HasForeignKey("A4Id"); @@ -8054,7 +7955,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.OwnsOne("UDS.Net.API.Entities.A4aTreatment", "Treatment1", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4a.Treatment1#UDS.Net.API.Entities.A4aTreatment", "Treatment1", b1 => { b1.Property("A4aId") .HasColumnType("int"); @@ -8120,13 +8021,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A4aId"); - b1.ToTable("tbl_A4as"); + b1.ToTable("tbl_A4as", (string)null); b1.WithOwner() .HasForeignKey("A4aId"); }); - b.OwnsOne("UDS.Net.API.Entities.A4aTreatment", "Treatment2", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4a.Treatment2#UDS.Net.API.Entities.A4aTreatment", "Treatment2", b1 => { b1.Property("A4aId") .HasColumnType("int"); @@ -8192,13 +8093,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A4aId"); - b1.ToTable("tbl_A4as"); + b1.ToTable("tbl_A4as", (string)null); b1.WithOwner() .HasForeignKey("A4aId"); }); - b.OwnsOne("UDS.Net.API.Entities.A4aTreatment", "Treatment3", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4a.Treatment3#UDS.Net.API.Entities.A4aTreatment", "Treatment3", b1 => { b1.Property("A4aId") .HasColumnType("int"); @@ -8264,13 +8165,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A4aId"); - b1.ToTable("tbl_A4as"); + b1.ToTable("tbl_A4as", (string)null); b1.WithOwner() .HasForeignKey("A4aId"); }); - b.OwnsOne("UDS.Net.API.Entities.A4aTreatment", "Treatment4", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4a.Treatment4#UDS.Net.API.Entities.A4aTreatment", "Treatment4", b1 => { b1.Property("A4aId") .HasColumnType("int"); @@ -8336,13 +8237,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A4aId"); - b1.ToTable("tbl_A4as"); + b1.ToTable("tbl_A4as", (string)null); b1.WithOwner() .HasForeignKey("A4aId"); }); - b.OwnsOne("UDS.Net.API.Entities.A4aTreatment", "Treatment5", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4a.Treatment5#UDS.Net.API.Entities.A4aTreatment", "Treatment5", b1 => { b1.Property("A4aId") .HasColumnType("int"); @@ -8408,13 +8309,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A4aId"); - b1.ToTable("tbl_A4as"); + b1.ToTable("tbl_A4as", (string)null); b1.WithOwner() .HasForeignKey("A4aId"); }); - b.OwnsOne("UDS.Net.API.Entities.A4aTreatment", "Treatment6", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4a.Treatment6#UDS.Net.API.Entities.A4aTreatment", "Treatment6", b1 => { b1.Property("A4aId") .HasColumnType("int"); @@ -8480,13 +8381,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A4aId"); - b1.ToTable("tbl_A4as"); + b1.ToTable("tbl_A4as", (string)null); b1.WithOwner() .HasForeignKey("A4aId"); }); - b.OwnsOne("UDS.Net.API.Entities.A4aTreatment", "Treatment7", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4a.Treatment7#UDS.Net.API.Entities.A4aTreatment", "Treatment7", b1 => { b1.Property("A4aId") .HasColumnType("int"); @@ -8552,13 +8453,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A4aId"); - b1.ToTable("tbl_A4as"); + b1.ToTable("tbl_A4as", (string)null); b1.WithOwner() .HasForeignKey("A4aId"); }); - b.OwnsOne("UDS.Net.API.Entities.A4aTreatment", "Treatment8", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4a.Treatment8#UDS.Net.API.Entities.A4aTreatment", "Treatment8", b1 => { b1.Property("A4aId") .HasColumnType("int"); @@ -8624,7 +8525,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A4aId"); - b1.ToTable("tbl_A4as"); + b1.ToTable("tbl_A4as", (string)null); b1.WithOwner() .HasForeignKey("A4aId"); @@ -8792,28 +8693,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Navigation("Participation"); }); - modelBuilder.Entity("UDS.Net.API.Entities.PacketSubmission", b => - { - b.HasOne("UDS.Net.API.Entities.Visit", "Visit") - .WithMany("PacketSubmissions") - .HasForeignKey("VisitId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Visit"); - }); - - modelBuilder.Entity("UDS.Net.API.Entities.PacketSubmissionError", b => - { - b.HasOne("UDS.Net.API.Entities.PacketSubmission", "PacketSubmission") - .WithMany("PacketSubmissionErrors") - .HasForeignKey("PacketSubmissionId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("PacketSubmission"); - }); - modelBuilder.Entity("UDS.Net.API.Entities.T1", b => { b.HasOne("UDS.Net.API.Entities.Visit", null) @@ -8834,11 +8713,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Navigation("Participation"); }); - modelBuilder.Entity("UDS.Net.API.Entities.PacketSubmission", b => - { - b.Navigation("PacketSubmissionErrors"); - }); - modelBuilder.Entity("UDS.Net.API.Entities.Participation", b => { b.Navigation("M1s"); @@ -8907,8 +8781,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Navigation("FormStatuses"); - b.Navigation("PacketSubmissions"); - b.Navigation("T1"); }); #pragma warning restore 612, 618 diff --git a/src/UDS.Net.API/Entities/PacketStatus.cs b/src/UDS.Net.API/Entities/PacketStatus.cs index 7b83b42..453d580 100644 --- a/src/UDS.Net.API/Entities/PacketStatus.cs +++ b/src/UDS.Net.API/Entities/PacketStatus.cs @@ -2,7 +2,7 @@ { public enum PacketStatus { - Pending, // no attempts made to finalize or submit + Pending, // since last form change, no attempts made to finalize Finalized, // finalized entire packet since last form change Submitted, // submitted at least once, pending error checks from the latest submission FailedErrorChecks, // submitted at least once and failed error checks diff --git a/src/UDS.Net.API/Entities/PacketSubmission.cs b/src/UDS.Net.API/Entities/PacketSubmission.cs index 889fe6d..ea5cc3d 100644 --- a/src/UDS.Net.API/Entities/PacketSubmission.cs +++ b/src/UDS.Net.API/Entities/PacketSubmission.cs @@ -19,6 +19,8 @@ public class PacketSubmission : BaseEntity public int VisitId { get; set; } + public int? UnresolvedErrorCount { get; set; } // null means no results yet, 0 means no errors + public List PacketSubmissionErrors { get; set; } = new List(); } } diff --git a/src/UDS.Net.API/Extensions/DtoToEntityMapper.cs b/src/UDS.Net.API/Extensions/DtoToEntityMapper.cs index 23b0c62..938a3b7 100644 --- a/src/UDS.Net.API/Extensions/DtoToEntityMapper.cs +++ b/src/UDS.Net.API/Extensions/DtoToEntityMapper.cs @@ -66,6 +66,16 @@ private static void SetBaseProperties(this Form entity, FormDto dto) } } + public static PacketStatus Convert(this string status) + { + if (!string.IsNullOrWhiteSpace(status)) + { + if (Enum.TryParse(status, true, out PacketStatus packetStatus)) + return packetStatus; + } + return PacketStatus.Pending; + } + public static Visit Convert(this VisitDto dto) { var visit = new Visit @@ -84,10 +94,7 @@ public static Visit Convert(this VisitDto dto) }; if (!string.IsNullOrWhiteSpace(dto.Status)) - { - if (Enum.TryParse(dto.Status, true, out PacketStatus status)) - visit.Status = status; - } + visit.Status = dto.Status.Convert(); return visit; } @@ -98,10 +105,7 @@ public static bool Update(this Visit entity, VisitDto dto) { // Only some properties are allowed to be updated if (!string.IsNullOrWhiteSpace(dto.Status)) - { - if (Enum.TryParse(dto.Status, true, out PacketStatus status)) - entity.Status = status; - } + entity.Status = dto.Status.Convert(); entity.VISIT_DATE = dto.VISIT_DATE; entity.INITIALS = dto.INITIALS; @@ -125,6 +129,7 @@ public static PacketSubmission Convert(this PacketSubmissionDto dto) ModifiedBy = dto.ModifiedBy, IsDeleted = dto.IsDeleted, DeletedBy = dto.DeletedBy, + UnresolvedErrorCount = dto.UnresolvedErrorCount, PacketSubmissionErrors = dto.PacketSubmissionErrors.Select(e => e.Convert()).ToList() }; } diff --git a/src/UDS.Net.API/Extensions/EntityToDtoMapper.cs b/src/UDS.Net.API/Extensions/EntityToDtoMapper.cs index 4c377a0..50cab18 100644 --- a/src/UDS.Net.API/Extensions/EntityToDtoMapper.cs +++ b/src/UDS.Net.API/Extensions/EntityToDtoMapper.cs @@ -24,6 +24,13 @@ private static VisitDto ConvertVisitToDto(Visit visit) Status = visit.Status.ToString() }; + return dto; + } + + public static PacketDto ToPacketDto(this Visit visit) + { + var dto = (PacketDto)ConvertVisitToDto(visit); + if (visit.PacketSubmissions != null && visit.PacketSubmissions.Count() > 0) { dto.PacketSubmissionCount = visit.PacketSubmissions.Count(); @@ -48,6 +55,11 @@ public static VisitDto ToDto(this Visit visit) } } + if (visit.PacketSubmissions != null) + { + // since this + } + return dto; } @@ -1637,37 +1649,13 @@ public static PacketSubmissionDto ToDto(this PacketSubmission packetSubmission) if (packetSubmission.PacketSubmissionErrors != null && packetSubmission.PacketSubmissionErrors.Count() > 0) { - dto.ErrorCount = packetSubmission.PacketSubmissionErrors.Count(); + dto.UnresolvedErrorCount = packetSubmission.UnresolvedErrorCount; dto.PacketSubmissionErrors = packetSubmission.PacketSubmissionErrors.ToDto(); } return dto; } - public static PacketSubmissionDto ToDto(this PacketSubmission packetSubmission, int errorCount) - { - var dto = new PacketSubmissionDto - { - Id = packetSubmission.Id, - VisitId = packetSubmission.VisitId, - SubmissionDate = packetSubmission.SubmissionDate, - CreatedAt = packetSubmission.CreatedAt, - CreatedBy = packetSubmission.CreatedBy, - ModifiedBy = packetSubmission.ModifiedBy, - IsDeleted = packetSubmission.IsDeleted, - DeletedBy = packetSubmission.DeletedBy, - ErrorCount = errorCount - }; - - if (packetSubmission.PacketSubmissionErrors != null && packetSubmission.PacketSubmissionErrors.Count() > 0) - { - dto.PacketSubmissionErrors = packetSubmission.PacketSubmissionErrors.ToDto(); - } - - return dto; - } - - public static List ToDto(this List packetSubmissionErrors) { List dto = new List(); diff --git a/src/UDS.Net.API/UDS.Net.API.csproj b/src/UDS.Net.API/UDS.Net.API.csproj index 7191302..b67eef3 100644 --- a/src/UDS.Net.API/UDS.Net.API.csproj +++ b/src/UDS.Net.API/UDS.Net.API.csproj @@ -4,7 +4,7 @@ net8.0 enable enable - 4.1.0-preview.6 + 4.1.0-preview.8 ../docker-compose.dcproj c1dd1715-6fa0-4515-bcf2-6a7f6a0c11a5 Release;Debug @@ -32,5 +32,6 @@ all + \ No newline at end of file diff --git a/src/UDS.Net.Dto/FormDto.cs b/src/UDS.Net.Dto/FormDto.cs index c43e6f5..0058889 100644 --- a/src/UDS.Net.Dto/FormDto.cs +++ b/src/UDS.Net.Dto/FormDto.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.Text.Json.Serialization; namespace UDS.Net.Dto @@ -43,6 +44,10 @@ public class FormDto : BaseDto public string RMMODE { get; set; } public string NOT { get; set; } + + public int? UnresolvedErrorCount { get; set; } + + public List Errors { get; set; } = new List(); } } diff --git a/src/UDS.Net.Dto/PacketDto.cs b/src/UDS.Net.Dto/PacketDto.cs new file mode 100644 index 0000000..0fcc53c --- /dev/null +++ b/src/UDS.Net.Dto/PacketDto.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; + +namespace UDS.Net.Dto +{ + public class PacketDto : VisitDto + { + public int PacketSubmissionCount { get; set; } = 0; + + public List PacketSubmissions { get; set; } = new List(); + } +} + diff --git a/src/UDS.Net.Dto/PacketSubmissionDto.cs b/src/UDS.Net.Dto/PacketSubmissionDto.cs index 0624a9b..a8c0661 100644 --- a/src/UDS.Net.Dto/PacketSubmissionDto.cs +++ b/src/UDS.Net.Dto/PacketSubmissionDto.cs @@ -9,11 +9,11 @@ public class PacketSubmissionDto : BaseDto public DateTime SubmissionDate { get; set; } - public int ErrorCount { get; set; } = 0; + public int? UnresolvedErrorCount { get; set; } // if the results haven't been returned then the error count will be null public List PacketSubmissionErrors { get; set; } = new List(); - public PacketSubmissionFormsDto Forms { get; set; } + public List Forms { get; set; } = new List(); } } diff --git a/src/UDS.Net.Dto/PacketSubmissionFormsDto.cs b/src/UDS.Net.Dto/PacketSubmissionFormsDto.cs deleted file mode 100644 index 3c8be0c..0000000 --- a/src/UDS.Net.Dto/PacketSubmissionFormsDto.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace UDS.Net.Dto -{ - public class PacketSubmissionFormsDto : List - { - // The time period when the data was submitted - public DateTime Period { get; set; } - - } -} - diff --git a/src/UDS.Net.Dto/UDS.Net.Dto.csproj b/src/UDS.Net.Dto/UDS.Net.Dto.csproj index f47c44e..6b3341d 100644 --- a/src/UDS.Net.Dto/UDS.Net.Dto.csproj +++ b/src/UDS.Net.Dto/UDS.Net.Dto.csproj @@ -4,15 +4,15 @@ netstandard2.1 Library UDS.Net.Dto - 4.1.0-preview.6 + 4.1.0-preview.8 Sanders-Brown Center on Aging UDS data transfer objects for use with API UK-SBCoA Dtos for API https://github.com/UK-SBCoA/uniform-data-set-dotnet-api - 4.1.0-preview.6 + 4.1.0-preview.8 - + \ No newline at end of file diff --git a/src/UDS.Net.Dto/VisitDto.cs b/src/UDS.Net.Dto/VisitDto.cs index 6d026dc..d3ffabd 100644 --- a/src/UDS.Net.Dto/VisitDto.cs +++ b/src/UDS.Net.Dto/VisitDto.cs @@ -21,9 +21,7 @@ public class VisitDto : BaseDto public List Forms { get; set; } = new List(); - public int PacketSubmissionCount { get; set; } = 0; - - public List PacketSubmissions { get; set; } = new List(); + public int? UnresolvedErrorCount { get; set; } } } diff --git a/src/UDS.Net.sln b/src/UDS.Net.sln index 8de505d..939e477 100644 --- a/src/UDS.Net.sln +++ b/src/UDS.Net.sln @@ -9,7 +9,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UDS.Net.API.Client", "UDS.N EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UDS.Net.Dto", "UDS.Net.Dto\UDS.Net.Dto.csproj", "{E620B892-269C-423B-9AEF-375131FA6B0C}" EndProject -Project("{9344BDBB-3E7F-41FC-A0DD-8665D75EE146}") = "docker-compose", "docker-compose.dcproj", "{843F811C-348F-4B76-96EA-BF6C4618300C}" +Project("{9344BDBB-3E7F-41FC-A0DD-8665D75EE146}") = "docker-compose", "docker-compose.dcproj", "{D8C3DF59-2AF7-4DEC-86DD-2765DA71C8D6}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -29,10 +29,10 @@ Global {E620B892-269C-423B-9AEF-375131FA6B0C}.Debug|Any CPU.Build.0 = Debug|Any CPU {E620B892-269C-423B-9AEF-375131FA6B0C}.Release|Any CPU.ActiveCfg = Release|Any CPU {E620B892-269C-423B-9AEF-375131FA6B0C}.Release|Any CPU.Build.0 = Release|Any CPU - {843F811C-348F-4B76-96EA-BF6C4618300C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {843F811C-348F-4B76-96EA-BF6C4618300C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {843F811C-348F-4B76-96EA-BF6C4618300C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {843F811C-348F-4B76-96EA-BF6C4618300C}.Release|Any CPU.Build.0 = Release|Any CPU + {D8C3DF59-2AF7-4DEC-86DD-2765DA71C8D6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D8C3DF59-2AF7-4DEC-86DD-2765DA71C8D6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D8C3DF59-2AF7-4DEC-86DD-2765DA71C8D6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D8C3DF59-2AF7-4DEC-86DD-2765DA71C8D6}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -41,6 +41,6 @@ Global SolutionGuid = {D39D5BFF-1FB6-4543-9752-418308400A84} EndGlobalSection GlobalSection(MonoDevelopProperties) = preSolution - version = 4.1.0-preview.6 + version = 4.1.0-preview.8 EndGlobalSection EndGlobal From a48b69aa2e62a315b1972f8d2c95e7d3673eff1a Mon Sep 17 00:00:00 2001 From: Ashley Wilson Date: Wed, 23 Oct 2024 15:37:00 -0400 Subject: [PATCH 15/24] In-progress --- src/UDS.Net.API.Client/IPacketClient.cs | 14 +- src/UDS.Net.API.Client/PacketClient.cs | 89 -------- .../Controllers/PacketsController.cs | 203 +++--------------- src/UDS.Net.API/Entities/PacketSubmission.cs | 2 +- .../Extensions/DtoToEntityMapper.cs | 2 +- .../Extensions/EntityToDtoMapper.cs | 2 +- src/UDS.Net.Dto/FormDto.cs | 2 +- src/UDS.Net.Dto/PacketSubmissionDto.cs | 4 +- src/UDS.Net.Dto/VisitDto.cs | 2 +- 9 files changed, 35 insertions(+), 285 deletions(-) diff --git a/src/UDS.Net.API.Client/IPacketClient.cs b/src/UDS.Net.API.Client/IPacketClient.cs index 5986d63..3cace5b 100644 --- a/src/UDS.Net.API.Client/IPacketClient.cs +++ b/src/UDS.Net.API.Client/IPacketClient.cs @@ -11,17 +11,5 @@ public interface IPacketClient : IBaseClient Task CountByStatusAndAssignee(string[] statuses, string assignedTo); Task> GetPacketsByStatusAndAssignee(string[] statuses, string assignedTo, int pageSize = 10, int pageIndex = 1); - - //Task ErrorCountByForm(int visitId, string formKind, bool includeResolved = false); - - //Task> GetErrorsByForm(int visitId, string formKind, bool includeResolved = false, int pageSize = 10, int pageIndex = 1); - - - - //Task> GetPacketSubmissionErrorsByVisit(int visitId, int pageSize = 10, int pageIndex = 1); - - //Task PostPacketSubmissionError(int packetSubmissionId, PacketSubmissionErrorDto dto); - - //Task PutPacketSubmissionError(int packetSubmissionId, int id, PacketSubmissionErrorDto dto); } -} +} \ No newline at end of file diff --git a/src/UDS.Net.API.Client/PacketClient.cs b/src/UDS.Net.API.Client/PacketClient.cs index 2b729c3..57a2991 100644 --- a/src/UDS.Net.API.Client/PacketClient.cs +++ b/src/UDS.Net.API.Client/PacketClient.cs @@ -40,95 +40,6 @@ public async Task> GetPacketsByStatusAndAssignee(string[] status return dto; } - - - //public async Task PacketSubmissionsCountByVisit(int visitId) - //{ - // var response = await GetRequest($"{_BasePath}/Count/ByVisit/{visitId}"); - - // int count = JsonSerializer.Deserialize(response, options); - - // return count; - //} - - - //public async Task> GetPacketSubmissionsByVisit(int visitId, int pageSize = 10, int pageIndex = 1) - //{ - // var response = await GetRequest($"{_BasePath}/ByVisit/{visitId}?pageSize={pageSize}&pageIndex={pageIndex}"); - - // List dto = JsonSerializer.Deserialize>(response, options); - - // return dto; - //} - - - //public async Task PacketSubmissionErrorsCount(bool includeResolved = false) - //{ - // var response = await GetRequest($"{_BasePath}/Errors/Count?includeResolved={includeResolved}"); - - // int count = JsonSerializer.Deserialize(response, options); - - // return count; - //} - - //public async Task PacketSubmissionsErrorsCountByVisit(int visitId) - //{ - // var response = await GetRequest($"{_BasePath}/Errors/Count/ByVisit/{visitId}"); - - // int count = JsonSerializer.Deserialize(response, options); - - // return count; - //} - - //public async Task PacketSubmissionsErrorsCountByAssignee(string assignedTo) - //{ - // var response = await GetRequest($"{_BasePath}/Errors/Count/ByAssignee/{assignedTo}"); - - // int count = JsonSerializer.Deserialize(response, options); - - // return count; - //} - - //public async Task> GetPacketSubmissionErrors(bool includeResolved = false, int pageSize = 10, int pageIndex = 1) - //{ - // var response = await GetRequest($"{_BasePath}/Errors?includeResolved={includeResolved}&pageSize={pageSize}&pageIndex={pageIndex}"); - - // List dto = JsonSerializer.Deserialize>(response, options); - - // return dto; - //} - - //public async Task> GetPacketSubmissionErrorsByVisit(int visitId, int pageSize = 10, int pageIndex = 1) - //{ - // var response = await GetRequest($"{_BasePath}/Errors/ByVisit/{visitId}?pageSize={pageSize}&pageIndex={pageIndex}"); - - // List dto = JsonSerializer.Deserialize>(response, options); - - // return dto; - //} - - //public async Task> GetPacketSubmissionErrorsByAssignee(string assignedTo, int pageSize = 10, int pageIndex = 1) - //{ - // var response = await GetRequest($"{_BasePath}/Errors/ByAssignee/{assignedTo}?pageSize={pageSize}&pageIndex={pageIndex}"); - - // List dto = JsonSerializer.Deserialize>(response, options); - - // return dto; - //} - - //public async Task PostPacketSubmissionError(int packetSubmissionId, PacketSubmissionErrorDto dto) - //{ - // string json = JsonSerializer.Serialize(dto); - - // var response = await PostRequest($"{_BasePath}/{packetSubmissionId}/Errors", json); - //} - - //public async Task PutPacketSubmissionError(int packetSubmissionId, int id, PacketSubmissionErrorDto dto) - //{ - // string json = JsonSerializer.Serialize(dto); - - // var response = await PutRequest($"{_BasePath}/{packetSubmissionId}/Errors/{id}", json); - //} } } diff --git a/src/UDS.Net.API/Controllers/PacketsController.cs b/src/UDS.Net.API/Controllers/PacketsController.cs index 102fb3f..14a07da 100644 --- a/src/UDS.Net.API/Controllers/PacketsController.cs +++ b/src/UDS.Net.API/Controllers/PacketsController.cs @@ -142,7 +142,7 @@ public async Task Post(PacketDto dto) } /// - /// Put updates the status of the visit, packet submissions, and errors + /// Put updates the status of the visit, submissions errors /// /// /// @@ -163,11 +163,31 @@ public async Task Put(int id, [FromBody] PacketDto dto) existingPacket.Status = dto.Status.Convert(); existingPacket.ModifiedBy = dto.ModifiedBy; - // iterate dto submissions, see if there are any new - - // see if there are any updates to existing - - // iterate dto errors, see if there are any new + foreach (var submissionDto in dto.PacketSubmissions) + { + if (submissionDto.Id == 0) + { + // new submission needs to be created + } + else + { + // existing submission needs to be updated and could affect visit status + + + // iterate errors + foreach (var errorDto in submissionDto.PacketSubmissionErrors) + { + if (errorDto.Id == 0) + { + // new error needs to be created and could affect + } + else + { + // existing error needs to be updated + } + } + } + } _context.Visits.Update(existingPacket); await _context.SaveChangesAsync(); @@ -258,174 +278,5 @@ public async Task> GetPacketsByStatusAndAssignee(string[] status return dto; } - - - - - - - - - //[HttpGet("ByVisit/{visitId}", Name = "GetPacketSubmissionByVisit")] - //public async Task> GetPacketSubmissionsByVisit(int visitId, int pageSize = 10, int pageIndex = 1) - //{ - // var dto = await _context.PacketSubmissions - // .Include(p => p.Visit) - // .Include(p => p.PacketSubmissionErrors) - // .Where(p => p.VisitId == visitId) - // .AsNoTracking() - // .Skip((pageIndex - 1) * pageSize) - // .Take(pageSize) - // .Select(p => p.ToDto(p.PacketSubmissionErrors.Count())) - // .ToListAsync(); - - // return dto; - //} - - - //[HttpGet("Errors/Count", Name = "PacketSubmissionErrorsCount")] - //public async Task PacketSubmissionErrorsCount(bool includeResolved = false) - //{ - // if (includeResolved) - // { - // return await _context.PacketSubmissionErrors - // .Where(e => String.IsNullOrWhiteSpace(e.ResolvedBy) == false) - // .CountAsync(); - // } - // else - // { - // return await _context.PacketSubmissionErrors - // .CountAsync(); - // } - //} - - //[HttpGet("Errors/Count/ByVisit/{visitId}", Name = "PacketSubmissionErrorsCountByVisit")] - //public async Task PacketSubmissionsErrorsCountByVisit(int visitId) - //{ - // return await _context.PacketSubmissions - // .Where(e => e.VisitId == visitId) - // .Select(p => p.ErrorCount) - // .FirstOrDefaultAsync(); - //} - - //[HttpGet("Errors/Count/ByAssignee/{assignedTo}", Name = "PacketSubmissionErrorsCountByAssignee")] - //public async Task PacketSubmissionsErrorsCountByAssignee(string assignedTo) - //{ - // return await _context.PacketSubmissionErrors - // .Where(e => e.AssignedTo.ToLower().Trim() == assignedTo.ToLower().Trim()) - // .CountAsync(); - //} - - //[HttpGet("Errors", Name = "GetPacketSubmissionErrors")] - //public async Task> GetPacketSubmissionErrors(bool includeResolved = false, int pageSize = 10, int pageIndex = 1) - //{ - // if (includeResolved) - // { - // return await _context.PacketSubmissionErrors - // .Where(e => String.IsNullOrWhiteSpace(e.ResolvedBy) == false) - // .AsNoTracking() - // .Skip((pageIndex - 1) * pageSize) - // .Take(pageSize) - // .Select(p => p.ToDto()) - // .ToListAsync(); - // } - // else - // { - // return await _context.PacketSubmissionErrors - // .AsNoTracking() - // .Skip((pageIndex - 1) * pageSize) - // .Take(pageSize) - // .Select(p => p.ToDto()) - // .ToListAsync(); - // } - //} - - //[HttpGet("Errors/ByVisit/{visitId}", Name = "GetPacketSubmissionErrorsByVisit")] - //public async Task> GetPacketSubmissionErrorsByVisit(int visitId, int pageSize = 10, int pageIndex = 1) - //{ - // return await _context.PacketSubmissionErrors - // .Include(e => e.PacketSubmission) - // .Where(e => e.PacketSubmission.VisitId == visitId) - // .AsNoTracking() - // .Skip((pageIndex - 1) * pageSize) - // .Take(pageSize) - // .Select(p => p.ToDto()) - // .ToListAsync(); - //} - - //[HttpGet("Errors/ByAssignee/{assignedTo}", Name = "GetPacketSubmissionErrorsByAssignee")] - //public async Task> GetPacketSubmissionErrorsByAssignee(string assignedTo, int pageSize = 10, int pageIndex = 1) - //{ - // return await _context.PacketSubmissionErrors - // .Where(e => e.AssignedTo.ToLower().Trim() == assignedTo.ToLower().Trim()) - // .AsNoTracking() - // .Skip((pageIndex - 1) * pageSize) - // .Take(pageSize) - // .Select(p => p.ToDto()) - // .ToListAsync(); - //} - - //[HttpPost("{packetSubmissionId}/Errors", Name = "PostPacketSubmissionError")] - //public async Task PostPacketSubmissionError(int packetSubmissionId, PacketSubmissionErrorDto dto) - //{ - // var packetSubmission = await _context.PacketSubmissions - // .Include(p => p.PacketSubmissionErrors) - // .Where(p => p.Id == packetSubmissionId) - // .FirstOrDefaultAsync(); - - // if (packetSubmission != null) - // { - // var error = dto.Convert(); - - // packetSubmission.PacketSubmissionErrors.Add(error); - // packetSubmission.ErrorCount += 1; - - // _context.PacketSubmissions.Update(packetSubmission); - // await _context.SaveChangesAsync(); - // } - //} - - //[HttpPut("{packetSubmissionId}/Errors/{id}", Name = "PutPacketSubmissionError")] - //public async Task PutPacketSubmissionError(int packetSubmissionId, int id, PacketSubmissionErrorDto dto) - //{ - // var packetSubmission = await _context.PacketSubmissions - // .Include(p => p.PacketSubmissionErrors) - // .Where(p => p.Id == packetSubmissionId) - // .FirstOrDefaultAsync(); - - // if (packetSubmission != null) - // { - // var existingError = packetSubmission.PacketSubmissionErrors.Where(e => e.Id == id).FirstOrDefault(); - - // if (existingError != null) - // { - // if (!string.IsNullOrWhiteSpace(dto.Level)) - // { - // if (Enum.TryParse(dto.Level, true, out PacketSubmissionErrorLevel level)) - // existingError.Level = level; - // } - - // existingError.FormKind = dto.FormKind; - // existingError.AssignedTo = dto.AssignedTo; - // existingError.ResolvedBy = dto.ResolvedBy; - // existingError.Message = dto.Message; - // existingError.ModifiedBy = dto.ModifiedBy; - - // if (dto.IsDeleted) - // { - // existingError.IsDeleted = dto.IsDeleted; - // existingError.DeletedBy = dto.DeletedBy; - // if (packetSubmission.ErrorCount > 1) - // packetSubmission.ErrorCount -= 1; - // } - // } - // } - //} - - //Task IPacketSubmissionClient.PacketSubmissionsErrorsCountByVisit(int visitId) - //{ - // throw new NotImplementedException(); - //} } -} - +} \ No newline at end of file diff --git a/src/UDS.Net.API/Entities/PacketSubmission.cs b/src/UDS.Net.API/Entities/PacketSubmission.cs index ea5cc3d..c3b7966 100644 --- a/src/UDS.Net.API/Entities/PacketSubmission.cs +++ b/src/UDS.Net.API/Entities/PacketSubmission.cs @@ -19,7 +19,7 @@ public class PacketSubmission : BaseEntity public int VisitId { get; set; } - public int? UnresolvedErrorCount { get; set; } // null means no results yet, 0 means no errors + public int? ErrorCount { get; set; } // null means no results yet, 0 means no errors public List PacketSubmissionErrors { get; set; } = new List(); } diff --git a/src/UDS.Net.API/Extensions/DtoToEntityMapper.cs b/src/UDS.Net.API/Extensions/DtoToEntityMapper.cs index 938a3b7..7edacb1 100644 --- a/src/UDS.Net.API/Extensions/DtoToEntityMapper.cs +++ b/src/UDS.Net.API/Extensions/DtoToEntityMapper.cs @@ -129,7 +129,7 @@ public static PacketSubmission Convert(this PacketSubmissionDto dto) ModifiedBy = dto.ModifiedBy, IsDeleted = dto.IsDeleted, DeletedBy = dto.DeletedBy, - UnresolvedErrorCount = dto.UnresolvedErrorCount, + ErrorCount = dto.ErrorCount, PacketSubmissionErrors = dto.PacketSubmissionErrors.Select(e => e.Convert()).ToList() }; } diff --git a/src/UDS.Net.API/Extensions/EntityToDtoMapper.cs b/src/UDS.Net.API/Extensions/EntityToDtoMapper.cs index 50cab18..5d9a5fa 100644 --- a/src/UDS.Net.API/Extensions/EntityToDtoMapper.cs +++ b/src/UDS.Net.API/Extensions/EntityToDtoMapper.cs @@ -1649,7 +1649,7 @@ public static PacketSubmissionDto ToDto(this PacketSubmission packetSubmission) if (packetSubmission.PacketSubmissionErrors != null && packetSubmission.PacketSubmissionErrors.Count() > 0) { - dto.UnresolvedErrorCount = packetSubmission.UnresolvedErrorCount; + dto.ErrorCount = packetSubmission.ErrorCount; dto.PacketSubmissionErrors = packetSubmission.PacketSubmissionErrors.ToDto(); } diff --git a/src/UDS.Net.Dto/FormDto.cs b/src/UDS.Net.Dto/FormDto.cs index 0058889..acb101d 100644 --- a/src/UDS.Net.Dto/FormDto.cs +++ b/src/UDS.Net.Dto/FormDto.cs @@ -47,7 +47,7 @@ public class FormDto : BaseDto public int? UnresolvedErrorCount { get; set; } - public List Errors { get; set; } = new List(); + public List UnresolvedErrors { get; set; } = new List(); } } diff --git a/src/UDS.Net.Dto/PacketSubmissionDto.cs b/src/UDS.Net.Dto/PacketSubmissionDto.cs index a8c0661..f69ee7e 100644 --- a/src/UDS.Net.Dto/PacketSubmissionDto.cs +++ b/src/UDS.Net.Dto/PacketSubmissionDto.cs @@ -9,11 +9,11 @@ public class PacketSubmissionDto : BaseDto public DateTime SubmissionDate { get; set; } - public int? UnresolvedErrorCount { get; set; } // if the results haven't been returned then the error count will be null + public int? ErrorCount { get; set; } // if the results haven't been returned then the error count will be null public List PacketSubmissionErrors { get; set; } = new List(); - public List Forms { get; set; } = new List(); + public List Forms { get; set; } = new List(); // temporal state of forms at time of submission } } diff --git a/src/UDS.Net.Dto/VisitDto.cs b/src/UDS.Net.Dto/VisitDto.cs index d3ffabd..94615ea 100644 --- a/src/UDS.Net.Dto/VisitDto.cs +++ b/src/UDS.Net.Dto/VisitDto.cs @@ -21,7 +21,7 @@ public class VisitDto : BaseDto public List Forms { get; set; } = new List(); - public int? UnresolvedErrorCount { get; set; } + public int? TotalUnresolvedErrorCount { get; set; } } } From 16f5beb410f8019b4a25d10443c74d36d38d533d Mon Sep 17 00:00:00 2001 From: Ashley Wilson Date: Thu, 24 Oct 2024 08:10:39 -0400 Subject: [PATCH 16/24] Cleanup and regenerate migration --- .../UDS.Net.API.Client.csproj | 4 +- .../Controllers/PacketsController.cs | 168 +- .../Controllers/VisitsController.cs | 87 +- ...113252_SupportPacketSubmission.Designer.cs | 8923 +++++++++++++++++ .../20241024113252_SupportPacketSubmission.cs | 101 + .../Migrations/ApiDbContextModelSnapshot.cs | 513 +- .../Extensions/DtoToEntityMapper.cs | 15 + .../Extensions/EntityToDtoMapper.cs | 56 +- src/UDS.Net.API/UDS.Net.API.csproj | 2 +- src/UDS.Net.Dto/UDS.Net.Dto.csproj | 4 +- src/UDS.Net.Dto/VisitDto.cs | 2 + src/UDS.Net.sln | 12 +- 12 files changed, 9559 insertions(+), 328 deletions(-) create mode 100644 src/UDS.Net.API/Data/Migrations/20241024113252_SupportPacketSubmission.Designer.cs create mode 100644 src/UDS.Net.API/Data/Migrations/20241024113252_SupportPacketSubmission.cs diff --git a/src/UDS.Net.API.Client/UDS.Net.API.Client.csproj b/src/UDS.Net.API.Client/UDS.Net.API.Client.csproj index 4f8cab6..31cea19 100644 --- a/src/UDS.Net.API.Client/UDS.Net.API.Client.csproj +++ b/src/UDS.Net.API.Client/UDS.Net.API.Client.csproj @@ -4,13 +4,13 @@ netstandard2.1 Library UDS.Net.API.Client - 4.1.0-preview.8 + 4.1.0-preview.7 Sanders-Brown Center on Aging UDS client library for using UDS.Net.API UK-SBCoA Client library for API https://github.com/UK-SBCoA/uniform-data-set-dotnet-api - 4.1.0-preview.8 + 4.1.0-preview.7 diff --git a/src/UDS.Net.API/Controllers/PacketsController.cs b/src/UDS.Net.API/Controllers/PacketsController.cs index 14a07da..27f7532 100644 --- a/src/UDS.Net.API/Controllers/PacketsController.cs +++ b/src/UDS.Net.API/Controllers/PacketsController.cs @@ -9,7 +9,7 @@ namespace UDS.Net.API.Controllers { /// - /// A packet is a visit that is not pending (finalized or after) + /// A packet is a visit that is ready to be submitted or has been submitted at least once /// [Route("api/[controller]")] public class PacketsController : Controller, IPacketClient @@ -25,12 +25,11 @@ public PacketsController(ApiDbContext context) public async Task Count() { return await _context.Visits - .Where(v => v.Status != PacketStatus.Pending) .CountAsync(); } /// - /// Returns visits that are finalized or after + /// Returns visits as packets /// /// /// @@ -42,7 +41,6 @@ public async Task> Get(int pageSize = 10, int pageIndex = .Include(v => v.PacketSubmissions) .ThenInclude(p => p.PacketSubmissionErrors) .AsNoTracking() - .Where(v => v.Status != PacketStatus.Pending) .Skip((pageIndex - 1) * pageSize) .Take(pageSize) .Select(p => p.ToPacketDto()) @@ -168,22 +166,44 @@ public async Task Put(int id, [FromBody] PacketDto dto) if (submissionDto.Id == 0) { // new submission needs to be created + var newSubmission = submissionDto.Convert(); + existingPacket.PacketSubmissions.Add(newSubmission); } else { // existing submission needs to be updated and could affect visit status - - - // iterate errors - foreach (var errorDto in submissionDto.PacketSubmissionErrors) + var existingSubmission = existingPacket.PacketSubmissions.Where(p => p.Id == submissionDto.Id).FirstOrDefault(); + if (existingSubmission != null) { - if (errorDto.Id == 0) - { - // new error needs to be created and could affect - } - else + existingSubmission.ErrorCount = submissionDto.ErrorCount; + existingSubmission.ModifiedBy = submissionDto.ModifiedBy; + existingSubmission.IsDeleted = submissionDto.IsDeleted; + existingSubmission.DeletedBy = submissionDto.DeletedBy; + + // iterate errors + foreach (var errorDto in submissionDto.PacketSubmissionErrors) { - // existing error needs to be updated + if (errorDto.Id == 0) + { + // new error needs to be created and could affect + var newError = errorDto.Convert(); + existingSubmission.PacketSubmissionErrors.Add(newError); + } + else + { + // existing error needs to be updated + var existingError = existingSubmission.PacketSubmissionErrors.Where(e => e.Id == errorDto.Id).FirstOrDefault(); + if (existingError != null) + { + existingError.AssignedTo = errorDto.AssignedTo; + existingError.ResolvedBy = errorDto.ResolvedBy; + existingError.FormKind = errorDto.FormKind; + existingError.Message = errorDto.Message; + existingError.ModifiedBy = errorDto.ModifiedBy; + existingError.IsDeleted = errorDto.IsDeleted; + existingError.DeletedBy = errorDto.DeletedBy; + } + } } } } @@ -201,77 +221,87 @@ public async Task Delete(int id) throw new NotImplementedException(); } - [HttpGet("Count/ByStatus/{status}", Name = "PacketsCountByStatusAndAssignee")] - public async Task CountByStatusAndAssignee(string[] statuses, string assignedTo) + [HttpGet("Count/ByStatus", Name = "PacketsCountByStatusAndAssignee")] + public async Task CountByStatusAndAssignee([FromQuery] string[] statuses, string assignedTo) { - if (string.IsNullOrWhiteSpace(assignedTo)) - { - return await _context.Visits - .Where(v => EF.Constant(statuses).Contains(v.Status.ToString())) - .CountAsync(); - } - else + var enumStatuses = statuses.Convert(); + + if (enumStatuses != null && enumStatuses.Count() > 0) { - var visitsAtStatus = await _context.Visits - .Include(v => v.PacketSubmissions) - .ThenInclude(p => p.PacketSubmissionErrors) - .Where(v => EF.Constant(statuses).Contains(v.Status.ToString())) - .ToListAsync(); + if (string.IsNullOrWhiteSpace(assignedTo)) + { + return await _context.Visits + .Where(v => enumStatuses.Contains(v.Status)) + .CountAsync(); + } + else + { + var visitsAtStatus = await _context.Visits + .Include(v => v.PacketSubmissions) + .ThenInclude(p => p.PacketSubmissionErrors) + .Where(v => enumStatuses.Contains(v.Status)) + .ToListAsync(); - int count = 0; + int count = 0; - foreach (var visit in visitsAtStatus) - { - bool assigneeAssignedToThisVisit = false; - foreach (var submission in visit.PacketSubmissions) + foreach (var visit in visitsAtStatus) { - if (submission.PacketSubmissionErrors.Any(p => String.IsNullOrWhiteSpace(p.ResolvedBy) == true && p.AssignedTo == assignedTo)) - assigneeAssignedToThisVisit = true; + bool assigneeAssignedToThisVisit = false; + foreach (var submission in visit.PacketSubmissions) + { + if (submission.PacketSubmissionErrors.Any(p => String.IsNullOrWhiteSpace(p.ResolvedBy) == true && p.AssignedTo == assignedTo)) + assigneeAssignedToThisVisit = true; + } + if (assigneeAssignedToThisVisit) + count++; } - if (assigneeAssignedToThisVisit) - count++; - } - return count; + return count; + } } + return 0; } - [HttpGet("ByStatus/{status}", Name = "GetPacketsByStatusAndAssignee")] - public async Task> GetPacketsByStatusAndAssignee(string[] statuses, string assignedTo, int pageSize = 10, int pageIndex = 1) + [HttpGet("ByStatus", Name = "GetPacketsByStatusAndAssignee")] + public async Task> GetPacketsByStatusAndAssignee([FromQuery] string[] statuses, string assignedTo, int pageSize = 10, int pageIndex = 1) { var dto = new List(); - if (string.IsNullOrWhiteSpace(assignedTo)) + var enumStatuses = statuses.Convert(); + if (enumStatuses != null && enumStatuses.Count() > 0) { - dto = await _context.Visits - .Include(v => v.PacketSubmissions) - .ThenInclude(p => p.PacketSubmissionErrors) - .Where(v => EF.Constant(statuses).Contains(v.Status.ToString())) - .AsNoTracking() - .Skip((pageIndex - 1) * pageSize) - .Take(pageSize) - .Select(p => p.ToPacketDto()) - .ToListAsync(); - } - else - { - var visitsAtStatus = await _context.Visits - .Include(v => v.PacketSubmissions) - .ThenInclude(p => p.PacketSubmissionErrors) - .Where(v => EF.Constant(statuses).Contains(v.Status.ToString())) - .ToListAsync(); - - foreach (var visit in visitsAtStatus) + if (string.IsNullOrWhiteSpace(assignedTo)) { - bool assigneeAssignedToThisVisit = false; - foreach (var submission in visit.PacketSubmissions) - { - if (submission.PacketSubmissionErrors.Any(p => String.IsNullOrWhiteSpace(p.ResolvedBy) == true && p.AssignedTo == assignedTo)) - assigneeAssignedToThisVisit = true; - } + dto = await _context.Visits + .Include(v => v.PacketSubmissions) + .ThenInclude(p => p.PacketSubmissionErrors) + .Where(v => enumStatuses.Contains(v.Status)) + .AsNoTracking() + .Skip((pageIndex - 1) * pageSize) + .Take(pageSize) + .Select(p => p.ToPacketDto()) + .ToListAsync(); + } + else + { + var visitsAtStatus = await _context.Visits + .Include(v => v.PacketSubmissions) + .ThenInclude(p => p.PacketSubmissionErrors) + .Where(v => enumStatuses.Contains(v.Status)) + .ToListAsync(); - if (assigneeAssignedToThisVisit) + foreach (var visit in visitsAtStatus) { - dto.Add(visit.ToPacketDto()); + bool assigneeAssignedToThisVisit = false; + foreach (var submission in visit.PacketSubmissions) + { + if (submission.PacketSubmissionErrors.Any(p => String.IsNullOrWhiteSpace(p.ResolvedBy) == true && p.AssignedTo == assignedTo)) + assigneeAssignedToThisVisit = true; + } + + if (assigneeAssignedToThisVisit) + { + dto.Add(visit.ToPacketDto()); + } } } } diff --git a/src/UDS.Net.API/Controllers/VisitsController.cs b/src/UDS.Net.API/Controllers/VisitsController.cs index cd450c9..4e401fe 100644 --- a/src/UDS.Net.API/Controllers/VisitsController.cs +++ b/src/UDS.Net.API/Controllers/VisitsController.cs @@ -27,6 +27,8 @@ private async Task Get(int id, string formKind) { var visit = await _context.Visits .Include(v => v.FormStatuses) + .Include(v => v.PacketSubmissions) + .ThenInclude(p => p.PacketSubmissionErrors) .Where(v => v.Id == id) .FirstOrDefaultAsync(); @@ -222,22 +224,32 @@ private async Task> Get(string[] statuses, int pageSize = 10, int { var dto = new List(); if (statuses == null || statuses.Count() == 0) - { - - } - else { dto = await _context.Visits .Include(v => v.PacketSubmissions) .ThenInclude(p => p.PacketSubmissionErrors) .AsNoTracking() - .Where(v => EF.Constant(statuses).Contains(v.Status.ToString())) .Skip((pageIndex - 1) * pageSize) .Take(pageSize) .Select(v => v.ToDto()) .ToListAsync(); + } + else + { + var enumStatuses = statuses.Convert(); - + if (enumStatuses != null && enumStatuses.Count() > 0) + { + dto = await _context.Visits + .Include(v => v.PacketSubmissions) + .ThenInclude(p => p.PacketSubmissionErrors) + .AsNoTracking() + .Where(v => enumStatuses.Contains(v.Status)) + .Skip((pageIndex - 1) * pageSize) + .Take(pageSize) + .Select(v => v.ToDto()) + .ToListAsync(); + } } return dto; @@ -246,12 +258,7 @@ private async Task> Get(string[] statuses, int pageSize = 10, int [HttpGet] public async Task> Get(int pageSize = 10, int pageIndex = 1) { - return await _context.Visits - .AsNoTracking() - .Skip((pageIndex - 1) * pageSize) - .Take(pageSize) - .Select(v => v.ToDto()) - .ToListAsync(); + return await Get(null, pageSize, pageIndex); } [HttpGet("Count", Name = "VisitsCount")] @@ -260,35 +267,37 @@ public async Task Count() return await _context.Visits.CountAsync(); } - [HttpGet("ByStatus/{status}")] - public async Task> GetVisitsAtStatus(string[] statuses, int pageSize = 10, int pageIndex = 1) + [HttpGet("ByStatus")] + public async Task> GetVisitsAtStatus([FromQuery] string[] statuses, int pageSize = 10, int pageIndex = 1) { - if (statuses == null || statuses.Count() == 0) - return new List(); - - var dto = new List(); - - return dto; + return await Get(statuses, pageSize, pageIndex); } - [HttpGet("Count/ByStatus/{status}")] - public async Task GetCountOfVisitsAtStatus(string[] statuses) + [HttpGet("Count/ByStatus")] + public async Task GetCountOfVisitsAtStatus([FromQuery] string[] statuses) { if (statuses == null || statuses.Count() == 0) return 0; - return await _context.Visits - .Where(v => statuses.Contains(v.Status.ToString())) - .CountAsync(); - } + var enumStatuses = statuses.Convert(); + if (enumStatuses != null && enumStatuses.Count() > 0) + { + return await _context.Visits + .Where(v => enumStatuses.Contains(v.Status)) + .CountAsync(); + } + return 0; + } [HttpGet("{id}")] public async Task Get(int id) { var dto = await _context.Visits .Include(v => v.FormStatuses) + .Include(v => v.PacketSubmissions) + .ThenInclude(p => p.PacketSubmissionErrors) .Where(v => v.Id == id) .Select(v => v.ToDto()) .FirstOrDefaultAsync(); @@ -296,32 +305,6 @@ public async Task Get(int id) return dto; } - //[HttpGet("{id}/WithPacketSubmissions", Name = "GetWithPacketSubmissions")] - //public async Task GetWithPacketSubmissions(int id, int pageSize = 10, int pageIndex = 1) - //{ - // var dto = await _context.Visits - // .Include(v => v.FormStatuses) - // .AsNoTracking() - // .Where(v => v.Id == id) - // .Select(v => v.ToDto()) - // .FirstOrDefaultAsync(); - - // var packetSubmissions = await _context.PacketSubmissions - // .Include(p => p.PacketSubmissionErrors) - // .AsNoTracking() - // .Skip((pageIndex - 1) * pageSize) - // .Take(pageSize) - // .Select(v => v.ToDto()) - // .ToListAsync(); - - // dto.PacketSubmissions = packetSubmissions; - // dto.PacketSubmissionCount = await _context.PacketSubmissions - // .Where(p => p.VisitId == id) - // .CountAsync(); - - // return dto; - //} - [HttpGet("{id}/Forms/{formKind}", Name = "GetWithForm")] public async Task GetWithForm(int id, string formKind) { diff --git a/src/UDS.Net.API/Data/Migrations/20241024113252_SupportPacketSubmission.Designer.cs b/src/UDS.Net.API/Data/Migrations/20241024113252_SupportPacketSubmission.Designer.cs new file mode 100644 index 0000000..29c4341 --- /dev/null +++ b/src/UDS.Net.API/Data/Migrations/20241024113252_SupportPacketSubmission.Designer.cs @@ -0,0 +1,8923 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using UDS.Net.API.Data; + +#nullable disable + +namespace UDS.Net.API.Data.Migrations +{ + [DbContext(typeof(ApiDbContext))] + [Migration("20241024113252_SupportPacketSubmission")] + partial class SupportPacketSubmission + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "8.0.10") + .HasAnnotation("Relational:MaxIdentifierLength", 128); + + SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); + + modelBuilder.Entity("UDS.Net.API.Entities.A1", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("FormId") + .HasColumnOrder(0); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("ADINAT") + .HasColumnType("int"); + + b.Property("ADISTATE") + .HasColumnType("int"); + + b.Property("BIRTHMO") + .HasColumnType("int"); + + b.Property("BIRTHSEX") + .HasColumnType("int"); + + b.Property("BIRTHYR") + .HasColumnType("int"); + + b.Property("CHLDHDCTRY") + .HasMaxLength(3) + .HasColumnType("nvarchar(3)"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DeletedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("EDUC") + .HasColumnType("int"); + + b.Property("ETHAFAMER") + .HasColumnType("int"); + + b.Property("ETHASNOTH") + .HasColumnType("int"); + + b.Property("ETHASNOTHX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("ETHBLKOTH") + .HasColumnType("int"); + + b.Property("ETHBLKOTHX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("ETHCHAMOR") + .HasColumnType("int"); + + b.Property("ETHCHINESE") + .HasColumnType("int"); + + b.Property("ETHCUBAN") + .HasColumnType("int"); + + b.Property("ETHDOMIN") + .HasColumnType("int"); + + b.Property("ETHEGYPT") + .HasColumnType("int"); + + b.Property("ETHENGLISH") + .HasColumnType("int"); + + b.Property("ETHETHIOP") + .HasColumnType("int"); + + b.Property("ETHFIJIAN") + .HasColumnType("int"); + + b.Property("ETHFILIP") + .HasColumnType("int"); + + b.Property("ETHGERMAN") + .HasColumnType("int"); + + b.Property("ETHGUATEM") + .HasColumnType("int"); + + b.Property("ETHHAITIAN") + .HasColumnType("int"); + + b.Property("ETHHAWAII") + .HasColumnType("int"); + + b.Property("ETHHISOTH") + .HasColumnType("int"); + + b.Property("ETHHISOTHX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("ETHINDIA") + .HasColumnType("int"); + + b.Property("ETHIRAN") + .HasColumnType("int"); + + b.Property("ETHIRAQI") + .HasColumnType("int"); + + b.Property("ETHIRISH") + .HasColumnType("int"); + + b.Property("ETHISPANIC") + .HasColumnType("int"); + + b.Property("ETHISRAEL") + .HasColumnType("int"); + + b.Property("ETHITALIAN") + .HasColumnType("int"); + + b.Property("ETHJAMAICA") + .HasColumnType("int"); + + b.Property("ETHJAPAN") + .HasColumnType("int"); + + b.Property("ETHKOREAN") + .HasColumnType("int"); + + b.Property("ETHLEBANON") + .HasColumnType("int"); + + b.Property("ETHMARSHAL") + .HasColumnType("int"); + + b.Property("ETHMENAOTH") + .HasColumnType("int"); + + b.Property("ETHMENAOTX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("ETHMEXICAN") + .HasColumnType("int"); + + b.Property("ETHNHPIOTH") + .HasColumnType("int"); + + b.Property("ETHNHPIOTX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("ETHNIGERIA") + .HasColumnType("int"); + + b.Property("ETHPOLISH") + .HasColumnType("int"); + + b.Property("ETHPUERTO") + .HasColumnType("int"); + + b.Property("ETHSALVA") + .HasColumnType("int"); + + b.Property("ETHSAMOAN") + .HasColumnType("int"); + + b.Property("ETHSCOTT") + .HasColumnType("int"); + + b.Property("ETHSOMALI") + .HasColumnType("int"); + + b.Property("ETHSYRIA") + .HasColumnType("int"); + + b.Property("ETHTONGAN") + .HasColumnType("int"); + + b.Property("ETHVIETNAM") + .HasColumnType("int"); + + b.Property("ETHWHIOTH") + .HasColumnType("int"); + + b.Property("ETHWHIOTHX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("EXRTIME") + .HasColumnType("int"); + + b.Property("FRMDATE") + .HasColumnType("datetime2") + .HasColumnName("FRMDATE") + .HasColumnOrder(3); + + b.Property("GENDKN") + .HasColumnType("int"); + + b.Property("GENMAN") + .HasColumnType("int"); + + b.Property("GENNOANS") + .HasColumnType("int"); + + b.Property("GENNONBI") + .HasColumnType("int"); + + b.Property("GENOTH") + .HasColumnType("int"); + + b.Property("GENOTHX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("GENTRMAN") + .HasColumnType("int"); + + b.Property("GENTRWOMAN") + .HasColumnType("int"); + + b.Property("GENTWOSPIR") + .HasColumnType("int"); + + b.Property("GENWOMAN") + .HasColumnType("int"); + + b.Property("HANDED") + .HasColumnType("int"); + + b.Property("INITIALS") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("nvarchar(3)") + .HasColumnName("INITIALS") + .HasColumnOrder(4); + + b.Property("INTERSEX") + .HasColumnType("int"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LANG") + .HasColumnType("int") + .HasColumnName("LANG") + .HasColumnOrder(5); + + b.Property("LIVSITUA") + .HasColumnType("int"); + + b.Property("LVLEDUC") + .HasColumnType("int"); + + b.Property("MARISTAT") + .HasColumnType("int"); + + b.Property("MEDVA") + .HasColumnType("int"); + + b.Property("MEMTEN") + .HasColumnType("int"); + + b.Property("MEMTROUB") + .HasColumnType("int"); + + b.Property("MEMWORS") + .HasColumnType("int"); + + b.Property("MODE") + .HasColumnType("int") + .HasColumnName("MODE") + .HasColumnOrder(6); + + b.Property("ModifiedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("NOT") + .HasColumnType("int") + .HasColumnName("NOT") + .HasColumnOrder(9); + + b.Property("PREDOMLAN") + .HasColumnType("int"); + + b.Property("PREDOMLANX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("PRIOCC") + .HasColumnType("int"); + + b.Property("RACEAIAN") + .HasColumnType("int"); + + b.Property("RACEAIANX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("RACEASIAN") + .HasColumnType("int"); + + b.Property("RACEBLACK") + .HasColumnType("int"); + + b.Property("RACEMENA") + .HasColumnType("int"); + + b.Property("RACENHPI") + .HasColumnType("int"); + + b.Property("RACEUNKN") + .HasColumnType("int"); + + b.Property("RACEWHITE") + .HasColumnType("int"); + + b.Property("REFCTRREGX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("REFCTRSOCX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("REFERSC") + .HasColumnType("int"); + + b.Property("REFERSCX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("REFLEARNED") + .HasColumnType("int"); + + b.Property("REFOTHMEDX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("REFOTHREGX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("REFOTHWEBX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("REFOTHX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("RESIDENC") + .HasColumnType("int"); + + b.Property("RMMODE") + .HasColumnType("int") + .HasColumnName("RMMODE") + .HasColumnOrder(8); + + b.Property("RMREAS") + .HasColumnType("int") + .HasColumnName("RMREASON") + .HasColumnOrder(7); + + b.Property("SERVED") + .HasColumnType("int"); + + b.Property("SEXORNBI") + .HasColumnType("int"); + + b.Property("SEXORNDNK") + .HasColumnType("int"); + + b.Property("SEXORNGAY") + .HasColumnType("int"); + + b.Property("SEXORNHET") + .HasColumnType("int"); + + b.Property("SEXORNNOAN") + .HasColumnType("int"); + + b.Property("SEXORNOTH") + .HasColumnType("int"); + + b.Property("SEXORNOTHX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("SEXORNTWOS") + .HasColumnType("int"); + + b.Property("SOURCENW") + .HasColumnType("int"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("nvarchar(20)") + .HasColumnOrder(2); + + b.Property("VisitId") + .HasColumnType("int") + .HasColumnOrder(1); + + b.Property("ZIP") + .HasMaxLength(3) + .HasColumnType("nvarchar(3)"); + + b.HasKey("Id"); + + b.HasIndex("VisitId") + .IsUnique(); + + b.ToTable("tbl_A1s"); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.A1a", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("FormId") + .HasColumnOrder(0); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("ABANDONED") + .HasColumnType("int") + .HasComment("21. I often feel abandoned"); + + b.Property("ACTAFRAID") + .HasColumnType("int") + .HasComment("36. In your day-to-day life how often do people act as if they are afraid of you?"); + + b.Property("BILLPAY") + .HasColumnType("int") + .HasComment("9. How difficult is it for you to meet monthly payments on your bills?"); + + b.Property("CHILDCOMM") + .HasColumnType("int") + .HasComment("24. If you have children, how often do you have contact with your children (including child[ren]-in-law and stepchild[ren]) either in person, by phone, mail, or email (e.g., any online interaction)?"); + + b.Property("CLOSEFRND") + .HasColumnType("int") + .HasComment("22. I miss having a really good friend"); + + b.Property("COMPCOMM") + .HasColumnType("int") + .HasComment("15a. Where would you place yourself on this ladder compared to others in your community (or neighborhood)? Please mark the number where you would place yourself."); + + b.Property("COMPUSA") + .HasColumnType("int") + .HasComment("15b. Where would you place yourself on this ladder compared to others in the U.S.?"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DELAYMED") + .HasColumnType("int") + .HasComment("28. In the past year, how often did you delay seeking medical attention for a problem that was bothering you?"); + + b.Property("DOCADVICE") + .HasColumnType("int") + .HasComment("31. In the past year, how often did you follow a doctor's advice or treatment plan when it was given?"); + + b.Property("DeletedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("EATLESS") + .HasColumnType("int") + .HasComment("11. At any time, did you ever eat less than you felt you should because there wasn't enough money to buy food?"); + + b.Property("EATLESSYR") + .HasColumnType("int") + .HasComment("12. In the last 12 months, did you ever eat less than you felt you should because there wasn't enough money to buy food?"); + + b.Property("EMPTINESS") + .HasColumnType("int") + .HasComment("18. I experience a general sense of emptiness"); + + b.Property("EXPAGE") + .HasColumnType("bit") + .HasComment("39a4. Main reason--Your age"); + + b.Property("EXPANCEST") + .HasColumnType("bit") + .HasComment("39a1. Main reason--Your Ancestry or National Origins"); + + b.Property("EXPAPPEAR") + .HasColumnType("bit") + .HasComment("39a8. Main reason--Some other aspect of your physical appearance"); + + b.Property("EXPDISAB") + .HasColumnType("bit") + .HasComment("39a11. Main reason--A physical disability"); + + b.Property("EXPEDUCINC") + .HasColumnType("bit") + .HasComment("39a10. Main reason--Your education or income level"); + + b.Property("EXPGENDER") + .HasColumnType("bit") + .HasComment("39a2. Main reason--Your gender"); + + b.Property("EXPHEIGHT") + .HasColumnType("bit") + .HasComment("39a6. Main reason--Your height"); + + b.Property("EXPNOANS") + .HasColumnType("bit") + .HasComment("39a15. Main reason--Prefer not to answer"); + + b.Property("EXPNOTAPP") + .HasColumnType("bit") + .HasComment("39a14. Main reason -- not applicable - I do not have these experiences in my day to day life"); + + b.Property("EXPOTHER") + .HasColumnType("bit") + .HasComment("39a13. Main reason -- Other"); + + b.Property("EXPRACE") + .HasColumnType("bit") + .HasComment("39a3. Main reason--Your race"); + + b.Property("EXPRELIG") + .HasColumnType("bit") + .HasComment("39a5. Main reason--Your religion"); + + b.Property("EXPSEXORN") + .HasColumnType("bit") + .HasComment("39a9. Main reason--Your sexual orientation"); + + b.Property("EXPSKIN") + .HasColumnType("bit") + .HasComment("39a12. Main reason--Your shade of skin color"); + + b.Property("EXPSTRS") + .HasColumnType("int") + .HasComment("40. When you have had day-to-day experiences like those in questions 33 to 38, would you say they have been very stressful, moderately stressful, or not stressful?"); + + b.Property("EXPWEIGHT") + .HasColumnType("bit") + .HasComment("39a7. Main reason--Your weight"); + + b.Property("FAMCOMP") + .HasColumnType("int") + .HasComment("15c. Thinking of your childhood, where would your family have been placed on this ladder compared to others in your community (or neighborhood)?"); + + b.Property("FINSATIS") + .HasColumnType("int") + .HasComment("8. How satisfied are you with your current personal financial condition?"); + + b.Property("FINUPSET") + .HasColumnType("int") + .HasComment("10. If you have had financial problems that lasted twelve months or longer, how upsetting has it been to you?"); + + b.Property("FRIENDCOMM") + .HasColumnType("int") + .HasComment("25. How often do you have contact with close friends either in person, by phone, mail, or email (e.g., any online interaction)?"); + + b.Property("FRIENDS") + .HasColumnType("int") + .HasComment("20. I feel like I don't have enough friends"); + + b.Property("FRMDATE") + .HasColumnType("datetime2") + .HasColumnName("FRMDATE") + .HasColumnOrder(3); + + b.Property("GUARD2EDU") + .HasColumnType("int") + .HasComment("17. If there was a second person who raised you (e.g., your mother, father, grandmother, etc.?), what was that person's highest level of education completed?"); + + b.Property("GUARD2REL") + .HasColumnType("int") + .HasComment("17a. What was this second person's relationship to you (if applicable)?"); + + b.Property("GUARD2RELX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasComment("17a1. Specify other relationship"); + + b.Property("GUARDEDU") + .HasColumnType("int") + .HasComment("16. Thinking of the person who raised you, what was their highest level of education completed?"); + + b.Property("GUARDREL") + .HasColumnType("int") + .HasComment("16a. What was this person's relationship to you?"); + + b.Property("GUARDRELX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasComment("16a1. Specify other relationship"); + + b.Property("HEALTHACC") + .HasColumnType("int") + .HasComment("32. Overall, which of these describes your health insurance, access to healthcare services, and access to medications?"); + + b.Property("INCOMEYR") + .HasColumnType("int") + .HasComment("7. Which of these income groups represents your household income for the past year? Include income from all sources such as wages, salaries, social security or retirement benefits, help from relatives, rent from property, and so forth."); + + b.Property("INITIALS") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("nvarchar(3)") + .HasColumnName("INITIALS") + .HasColumnOrder(4); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LANG") + .HasColumnType("int") + .HasColumnName("LANG") + .HasColumnOrder(5); + + b.Property("LESSCOURT") + .HasColumnType("int") + .HasComment("33. In your day-to-day life how often are you treated with less courtesy or respect than other people?"); + + b.Property("LESSMEDS") + .HasColumnType("int") + .HasComment("13. At any time, have you ended up taking less medication than was prescribed for you because of the cost?"); + + b.Property("LESSMEDSYR") + .HasColumnType("int") + .HasComment("14. In the last 12 months, have you ended up taking less medication than was prescribed for you because of the cost?"); + + b.Property("MISSEDFUP") + .HasColumnType("int") + .HasComment("30. In the past year, how often did you miss a follow-up medical appointment that was scheduled?"); + + b.Property("MISSPEOPLE") + .HasColumnType("int") + .HasComment("19. I miss having people around"); + + b.Property("MODE") + .HasColumnType("int") + .HasColumnName("MODE") + .HasColumnOrder(6); + + b.Property("ModifiedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("NOT") + .HasColumnType("int") + .HasColumnName("NOT") + .HasColumnOrder(9); + + b.Property("NOTSMART") + .HasColumnType("int") + .HasComment("35. In your day-to-day life how often do people act as if they think you are not smart?"); + + b.Property("OWNSCAR") + .HasColumnType("int") + .HasComment("1. Do you or someone in your household currently own a car?"); + + b.Property("PARENTCOMM") + .HasColumnType("int") + .HasComment("23. If your parents are still alive, how often do you have contact with them (including mother, father, mother-in-law, and father-in-law) either in person, by phone, mail, or email (e.g., any online interaction)?"); + + b.Property("PARTICIPATE") + .HasColumnType("int") + .HasComment("26. How often do you participate in activities outside the home (e.g., religious activities, educational activities, volunteer work, paid work, or activities with groups or organizations)?"); + + b.Property("POORMEDTRT") + .HasColumnType("int") + .HasComment("38. How frequently did you receive poorer service or treatment from doctors or in hospitals compared to other people?"); + + b.Property("POORSERV") + .HasColumnType("int") + .HasComment("34. In your day-to-day life how often do you receive poorer service than other people at restaurants or stores?"); + + b.Property("RMMODE") + .HasColumnType("int") + .HasColumnName("RMMODE") + .HasColumnOrder(8); + + b.Property("RMREAS") + .HasColumnType("int") + .HasColumnName("RMREASON") + .HasColumnOrder(7); + + b.Property("SAFECOMM") + .HasColumnType("int") + .HasComment("27b. How safe do you feel in your community (or neighborhood)?"); + + b.Property("SAFEHOME") + .HasColumnType("int") + .HasComment("27a. How safe do you feel in your home?"); + + b.Property("SCRIPTPROB") + .HasColumnType("int") + .HasComment("29. In the past year, how often did you experience challenges in filling a prescription?"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("nvarchar(20)") + .HasColumnOrder(2); + + b.Property("THREATENED") + .HasColumnType("int") + .HasComment("37. In your day-to-day life how often are you threatened or harassed?"); + + b.Property("TRANSPROB") + .HasColumnType("int") + .HasComment("3. In the past 30 days, how often were you not able to leave the house when you wanted to because of a problem with transportation?"); + + b.Property("TRANSWORRY") + .HasColumnType("int") + .HasComment("4. In the past 30 days, how often did you worry about whether or not you would be able to get somewhere because of a problem with transportation?"); + + b.Property("TRSPACCESS") + .HasColumnType("int") + .HasComment("2. Do you have consistent access to transportation?"); + + b.Property("TRSPLONGER") + .HasColumnType("int") + .HasComment("5. In the past 30 days, how often did it take you longer to get somewhere than it would have taken you if you had different transportation?"); + + b.Property("TRSPMED") + .HasColumnType("int") + .HasComment("6. In the past 30 days, how often has a lack of transportation kept you from medical appointments or from doing things needed for daily living?"); + + b.Property("VisitId") + .HasColumnType("int") + .HasColumnOrder(1); + + b.HasKey("Id"); + + b.HasIndex("VisitId") + .IsUnique(); + + b.ToTable("tbl_A1as"); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.A2", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("FormId") + .HasColumnOrder(0); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DeletedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("FRMDATE") + .HasColumnType("datetime2") + .HasColumnName("FRMDATE") + .HasColumnOrder(3); + + b.Property("INCNTFRQ") + .HasColumnType("int"); + + b.Property("INCNTMDX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("INCNTMOD") + .HasColumnType("int"); + + b.Property("INCNTTIM") + .HasColumnType("int"); + + b.Property("INITIALS") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("nvarchar(3)") + .HasColumnName("INITIALS") + .HasColumnOrder(4); + + b.Property("INKNOWN") + .HasColumnType("int"); + + b.Property("INLIVWTH") + .HasColumnType("int"); + + b.Property("INMEMTEN") + .HasColumnType("int"); + + b.Property("INMEMTROUB") + .HasColumnType("int"); + + b.Property("INMEMWORS") + .HasColumnType("int"); + + b.Property("INRELTO") + .HasColumnType("int"); + + b.Property("INRELY") + .HasColumnType("int"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LANG") + .HasColumnType("int") + .HasColumnName("LANG") + .HasColumnOrder(5); + + b.Property("MODE") + .HasColumnType("int") + .HasColumnName("MODE") + .HasColumnOrder(6); + + b.Property("ModifiedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("NEWINF") + .HasColumnType("int"); + + b.Property("NOT") + .HasColumnType("int") + .HasColumnName("NOT") + .HasColumnOrder(9); + + b.Property("RMMODE") + .HasColumnType("int") + .HasColumnName("RMMODE") + .HasColumnOrder(8); + + b.Property("RMREAS") + .HasColumnType("int") + .HasColumnName("RMREASON") + .HasColumnOrder(7); + + b.Property("Status") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("nvarchar(20)") + .HasColumnOrder(2); + + b.Property("VisitId") + .HasColumnType("int") + .HasColumnOrder(1); + + b.HasKey("Id"); + + b.HasIndex("VisitId") + .IsUnique(); + + b.ToTable("tbl_A2s"); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.A3", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("FormId") + .HasColumnOrder(0); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("AFFFAMM") + .HasColumnType("int"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DADAGEO") + .HasColumnType("int"); + + b.Property("DADDAGE") + .HasColumnType("int"); + + b.Property("DADETPR") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b.Property("DADETSEC") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b.Property("DADMEVAL") + .HasColumnType("int"); + + b.Property("DADYOB") + .HasColumnType("int"); + + b.Property("DeletedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("FRMDATE") + .HasColumnType("datetime2") + .HasColumnName("FRMDATE") + .HasColumnOrder(3); + + b.Property("INITIALS") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("nvarchar(3)") + .HasColumnName("INITIALS") + .HasColumnOrder(4); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("KIDS") + .HasColumnType("int"); + + b.Property("LANG") + .HasColumnType("int") + .HasColumnName("LANG") + .HasColumnOrder(5); + + b.Property("MODE") + .HasColumnType("int") + .HasColumnName("MODE") + .HasColumnOrder(6); + + b.Property("MOMAGEO") + .HasColumnType("int"); + + b.Property("MOMDAGE") + .HasColumnType("int"); + + b.Property("MOMETPR") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b.Property("MOMETSEC") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b.Property("MOMMEVAL") + .HasColumnType("int"); + + b.Property("MOMYOB") + .HasColumnType("int"); + + b.Property("ModifiedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("NOT") + .HasColumnType("int") + .HasColumnName("NOT") + .HasColumnOrder(9); + + b.Property("NWINFKID") + .HasColumnType("int"); + + b.Property("NWINFMUT") + .HasColumnType("int"); + + b.Property("NWINFSIB") + .HasColumnType("int"); + + b.Property("RMMODE") + .HasColumnType("int") + .HasColumnName("RMMODE") + .HasColumnOrder(8); + + b.Property("RMREAS") + .HasColumnType("int") + .HasColumnName("RMREASON") + .HasColumnOrder(7); + + b.Property("SIBS") + .HasColumnType("int"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("nvarchar(20)") + .HasColumnOrder(2); + + b.Property("VisitId") + .HasColumnType("int") + .HasColumnOrder(1); + + b.HasKey("Id"); + + b.HasIndex("VisitId") + .IsUnique(); + + b.ToTable("tbl_A3s"); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.A4", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("FormId") + .HasColumnOrder(0); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("ANYMEDS") + .HasColumnType("int"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DeletedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("FRMDATE") + .HasColumnType("datetime2") + .HasColumnName("FRMDATE") + .HasColumnOrder(3); + + b.Property("INITIALS") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("nvarchar(3)") + .HasColumnName("INITIALS") + .HasColumnOrder(4); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LANG") + .HasColumnType("int") + .HasColumnName("LANG") + .HasColumnOrder(5); + + b.Property("MODE") + .HasColumnType("int") + .HasColumnName("MODE") + .HasColumnOrder(6); + + b.Property("ModifiedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("NOT") + .HasColumnType("int") + .HasColumnName("NOT") + .HasColumnOrder(9); + + b.Property("RMMODE") + .HasColumnType("int") + .HasColumnName("RMMODE") + .HasColumnOrder(8); + + b.Property("RMREAS") + .HasColumnType("int") + .HasColumnName("RMREASON") + .HasColumnOrder(7); + + b.Property("Status") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("nvarchar(20)") + .HasColumnOrder(2); + + b.Property("VisitId") + .HasColumnType("int") + .HasColumnOrder(1); + + b.HasKey("Id"); + + b.HasIndex("VisitId") + .IsUnique(); + + b.ToTable("tbl_A4s"); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.A4a", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("FormId") + .HasColumnOrder(0); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("ADVERSEOTH") + .HasColumnType("bit"); + + b.Property("ADVERSEOTX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("ADVEVENT") + .HasColumnType("int"); + + b.Property("ARIAE") + .HasColumnType("bit"); + + b.Property("ARIAH") + .HasColumnType("bit"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DeletedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("FRMDATE") + .HasColumnType("datetime2") + .HasColumnName("FRMDATE") + .HasColumnOrder(3); + + b.Property("INITIALS") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("nvarchar(3)") + .HasColumnName("INITIALS") + .HasColumnOrder(4); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LANG") + .HasColumnType("int") + .HasColumnName("LANG") + .HasColumnOrder(5); + + b.Property("MODE") + .HasColumnType("int") + .HasColumnName("MODE") + .HasColumnOrder(6); + + b.Property("ModifiedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("NOT") + .HasColumnType("int") + .HasColumnName("NOT") + .HasColumnOrder(9); + + b.Property("RMMODE") + .HasColumnType("int") + .HasColumnName("RMMODE") + .HasColumnOrder(8); + + b.Property("RMREAS") + .HasColumnType("int") + .HasColumnName("RMREASON") + .HasColumnOrder(7); + + b.Property("Status") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("nvarchar(20)") + .HasColumnOrder(2); + + b.Property("TRTBIOMARK") + .HasColumnType("int"); + + b.Property("VisitId") + .HasColumnType("int") + .HasColumnOrder(1); + + b.HasKey("Id"); + + b.HasIndex("VisitId") + .IsUnique(); + + b.ToTable("tbl_A4as"); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.A5D2", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("FormId") + .HasColumnOrder(0); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("ALCBINGE") + .HasColumnType("int") + .HasComment("In the past 12 months, how often did the participant have six or more drinks containing alcohol in one day?"); + + b.Property("ALCDRINKS") + .HasColumnType("int") + .HasComment("On a day when the participant drinks alcoholic beverages, how many standard drinks does the participant typically consume?"); + + b.Property("ALCFREQYR") + .HasColumnType("int") + .HasComment("In the past 12 months, how often has the participant had a drink containing alcohol?"); + + b.Property("ANGIOCP") + .HasColumnType("int") + .HasComment("Carotid artery surgery or stenting?"); + + b.Property("ANXIETY") + .HasColumnType("int") + .HasComment("Anxiety disorder (DSM-5-TR criteria)"); + + b.Property("APNEA") + .HasColumnType("int") + .HasComment("Sleep apnea"); + + b.Property("APNEAORAL") + .HasColumnType("int") + .HasComment("Typical use of an oral device for sleep apnea at night over the past 12 months?"); + + b.Property("ARTHLOEX") + .HasColumnType("bit") + .HasComment("Lower extremity affected by arthritis"); + + b.Property("ARTHRIT") + .HasColumnType("int") + .HasComment("Arthritis"); + + b.Property("ARTHROSTEO") + .HasColumnType("bit") + .HasComment("Type of arthritis: Osteoarthritis"); + + b.Property("ARTHROTHR") + .HasColumnType("bit") + .HasComment("Type of arthritis: Other"); + + b.Property("ARTHRRHEUM") + .HasColumnType("bit") + .HasComment("Type of arthritis: Rheumatoid"); + + b.Property("ARTHSPIN") + .HasColumnType("bit") + .HasComment("Spine affected by arthritis"); + + b.Property("ARTHTYPUNK") + .HasColumnType("bit") + .HasComment("Type of arthritis: Unknown"); + + b.Property("ARTHTYPX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasComment("Specify other type of arthritis"); + + b.Property("ARTHUNK") + .HasColumnType("bit") + .HasComment("Region affected by arthritis unknown"); + + b.Property("ARTHUPEX") + .HasColumnType("bit") + .HasComment("Upper extremity affected by arthritis"); + + b.Property("B12DEF") + .HasColumnType("int") + .HasComment("B12 deficiency"); + + b.Property("BCENDAGE") + .HasColumnType("int") + .HasComment("Age at last use of birth control pills"); + + b.Property("BCPILLS") + .HasColumnType("int") + .HasComment("Has the participant ever taken birth control pills?"); + + b.Property("BCPILLSYR") + .HasColumnType("int") + .HasComment("Total number of years participant has taken birth control pills"); + + b.Property("BCSTARTAGE") + .HasColumnType("int") + .HasComment("Age at first use of birth control pills"); + + b.Property("BIPOLAR") + .HasColumnType("int") + .HasComment("Bipolar disorder(DSM - 5 - TR criteria)"); + + b.Property("BYPASSAGE") + .HasColumnType("int") + .HasComment("Age at most recent coronary artery bypass surgery"); + + b.Property("CANCBLOOD") + .HasColumnType("bit") + .HasComment("Primary site of cancer: Blood"); + + b.Property("CANCBONE") + .HasColumnType("bit") + .HasComment("Type of cancer treatment: Bone marrow transplant"); + + b.Property("CANCBREAST") + .HasColumnType("bit") + .HasComment("Primary site of cancer: Breast"); + + b.Property("CANCCHEMO") + .HasColumnType("bit") + .HasComment("Type of cancer treatment: Chemotherapy"); + + b.Property("CANCCOLON") + .HasColumnType("bit") + .HasComment("Primary site of cancer: Colon"); + + b.Property("CANCERACTV") + .HasColumnType("int") + .HasComment("Cancer, primary or metastatic (Report all known diagnoses. Exclude non-melanoma skin cancer.)"); + + b.Property("CANCERAGE") + .HasColumnType("int") + .HasComment("Age at most recent cancer diagnosis"); + + b.Property("CANCERMETA") + .HasColumnType("bit") + .HasComment("Type of cancer: Metastatic"); + + b.Property("CANCERPRIM") + .HasColumnType("bit") + .HasComment("Type of cancer: Primary/non-metastatic"); + + b.Property("CANCERUNK") + .HasColumnType("bit") + .HasComment("Type of cancer: Unknown"); + + b.Property("CANCHORM") + .HasColumnType("bit") + .HasComment("Type of cancer treatment: Hormone therapy"); + + b.Property("CANCIMMUNO") + .HasColumnType("bit") + .HasComment("Type of cancer treatment: Immunotherapy"); + + b.Property("CANCLUNG") + .HasColumnType("bit") + .HasComment("Primary site of cancer: Lung"); + + b.Property("CANCMETBR") + .HasColumnType("bit") + .HasComment("Type of metastatic cancer: Metatstic to brain"); + + b.Property("CANCMETOTH") + .HasColumnType("bit") + .HasComment("Type of metastatic cancer: Metastatic to sites other than brain"); + + b.Property("CANCOTHER") + .HasColumnType("bit") + .HasComment("Primary site of cancer: Other"); + + b.Property("CANCOTHERX") + .HasColumnType("nvarchar(max)") + .HasComment("Specify other primary site of cancer"); + + b.Property("CANCPROST") + .HasColumnType("bit") + .HasComment("Primary site of cancer: Prostate"); + + b.Property("CANCRAD") + .HasColumnType("bit") + .HasComment("Type of cancer treatment: Radiation"); + + b.Property("CANCRESECT") + .HasColumnType("bit") + .HasComment("Type of cancer treatment: Surgical resection"); + + b.Property("CANCTROTH") + .HasColumnType("bit") + .HasComment("Type of cancer treatment: Other"); + + b.Property("CANCTROTHX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasComment("Specify other type of cancer treatment"); + + b.Property("CANNABIS") + .HasColumnType("int") + .HasComment("In the past 12 months, how often has the participant consumed cannabis (edibles, smoked, or vaporized)?"); + + b.Property("CARDARRAGE") + .HasColumnType("int") + .HasComment("Age at most recent cardiac arrest"); + + b.Property("CARDARREST") + .HasColumnType("int") + .HasComment("Cardiac arrest (heart stopped)"); + + b.Property("CAROTIDAGE") + .HasColumnType("int") + .HasComment("Age at most recent carotid artery surgery or stenting"); + + b.Property("CBSTROKE") + .HasColumnType("int") + .HasComment("Stroke by history, not exam (imaging is not required)"); + + b.Property("CBTIA") + .HasColumnType("int") + .HasComment("Transient ischemic attack (TIA)"); + + b.Property("COVID19") + .HasColumnType("int") + .HasComment("COVID-19 infection"); + + b.Property("COVIDHOSP") + .HasColumnType("int") + .HasComment("COVID-19 infection requiring hospitalization?"); + + b.Property("CPAP") + .HasColumnType("int") + .HasComment("Typical use of breathing machine (e.g. CPAP) at night over the past 12 months"); + + b.Property("CVAFIB") + .HasColumnType("int") + .HasComment("Atrial fibrillation"); + + b.Property("CVANGIO") + .HasColumnType("int") + .HasComment("Coronary artery angioplasty / endarterectomy / stenting"); + + b.Property("CVBYPASS") + .HasColumnType("int") + .HasComment("Coronary artery bypass procedure"); + + b.Property("CVCHF") + .HasColumnType("int") + .HasComment("Congestive heart failure (including pulmonary edema)"); + + b.Property("CVHVALVE") + .HasColumnType("int") + .HasComment("Heart valve replacement or repair"); + + b.Property("CVOTHR") + .HasColumnType("int") + .HasComment("Other cardiovascular disease"); + + b.Property("CVOTHRX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasComment("Specify other cardiovascular disease"); + + b.Property("CVPACDEF") + .HasColumnType("int") + .HasComment("Pacemaker and/or defibrillator implantation"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DEPRTREAT") + .HasColumnType("bit") + .HasComment("Choose if treated or untreated"); + + b.Property("DIABAGE") + .HasColumnType("int") + .HasComment("Age at diabetes diagnosis"); + + b.Property("DIABDIET") + .HasColumnType("bit") + .HasComment("Diabetes treated with: Diet"); + + b.Property("DIABETES") + .HasColumnType("int") + .HasComment("Diabetes"); + + b.Property("DIABGLP1") + .HasColumnType("bit") + .HasComment("GLP-1 receptor activators"); + + b.Property("DIABINS") + .HasColumnType("bit") + .HasComment("Diabetes treated with: Insulin"); + + b.Property("DIABMEDS") + .HasColumnType("bit") + .HasComment("Diabetes treated with: Oral medications"); + + b.Property("DIABRECACT") + .HasColumnType("bit") + .HasComment("Other non-insulin, non-GLP-1 receptor activator injection medication"); + + b.Property("DIABTYPE") + .HasColumnType("int") + .HasComment("Diabetes type"); + + b.Property("DIABUNK") + .HasColumnType("bit") + .HasComment("Diabetes treated with: Unknown"); + + b.Property("DeletedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("FIRSTTBI") + .HasColumnType("int") + .HasComment("Age of first head injury"); + + b.Property("FRMDATE") + .HasColumnType("datetime2") + .HasColumnName("FRMDATE") + .HasColumnOrder(3); + + b.Property("GENERALANX") + .HasColumnType("int") + .HasComment("Generalized Anxiety Disorder"); + + b.Property("HEADACHE") + .HasColumnType("int") + .HasComment("Chronic headaches"); + + b.Property("HEADIMP") + .HasColumnType("int") + .HasComment("epetitive head impacts (e.g. from contact sports, intimate partner violence, or military duty), regardless of whether it caused symptoms."); + + b.Property("HEADINJCON") + .HasColumnType("int") + .HasComment("After a head injury, what was the longest period..."); + + b.Property("HEADINJNUM") + .HasColumnType("int") + .HasComment("Total number of head injuries"); + + b.Property("HEADINJUNC") + .HasColumnType("int") + .HasComment("After a head injury, what was the longest period of time that the participant was unconscious?"); + + b.Property("HEADINJURY") + .HasColumnType("int") + .HasComment("Head injury (e.g. in a vehicle accident, being hit by an object...)"); + + b.Property("HIVAGE") + .HasColumnType("int") + .HasComment("Age at HIV diagnosis"); + + b.Property("HIVDIAG") + .HasColumnType("int") + .HasComment("Human Immunodeficiency Virus"); + + b.Property("HRT") + .HasColumnType("int") + .HasComment("Has the participant taken female hormone replacement pills or patches (e.g. estrogen)?"); + + b.Property("HRTATTACK") + .HasColumnType("int") + .HasComment("Heart attack (heart artery blockage)"); + + b.Property("HRTATTAGE") + .HasColumnType("int") + .HasComment("Age at most recent heart attack"); + + b.Property("HRTATTMULT") + .HasColumnType("int") + .HasComment("More than one heart attack?"); + + b.Property("HRTENDAGE") + .HasColumnType("int") + .HasComment("Age at last use of female hormone replacement pills"); + + b.Property("HRTSTRTAGE") + .HasColumnType("int") + .HasComment("Age at first use of female hormone replacement pills"); + + b.Property("HRTYEARS") + .HasColumnType("int") + .HasComment("Total number of years participant has taken female hormone replacement pills"); + + b.Property("HYDROCEPH") + .HasColumnType("int") + .HasComment("Normal-pressure hydrocephalus"); + + b.Property("HYPERCHAGE") + .HasColumnType("int") + .HasComment("Age at hypercholesterolemia diagnosis"); + + b.Property("HYPERCHO") + .HasColumnType("int") + .HasComment("Hypercholesterolemia (or taking medication for high cholesterol)"); + + b.Property("HYPERTAGE") + .HasColumnType("int") + .HasComment("Age at hypertension diagnosis"); + + b.Property("HYPERTEN") + .HasColumnType("int") + .HasComment("Hypertension (or taking medication for hypertension)"); + + b.Property("IMPAMFOOT") + .HasColumnType("bit") + .HasComment("Source of exposure for repeated hits to the head: American football"); + + b.Property("IMPASSAULT") + .HasColumnType("bit") + .HasComment("Source of exposure for repeated hits to the head: Physical assault"); + + b.Property("IMPBOXING") + .HasColumnType("bit") + .HasComment("Source of exposure for repeated hits to the head: Boxing or mixed martial arts"); + + b.Property("IMPHOCKEY") + .HasColumnType("bit") + .HasComment("Source of exposure for repeated hits to the head: Ice hockey"); + + b.Property("IMPIPV") + .HasColumnType("bit") + .HasComment("Source of exposure for repeated hits to the head: Intimate partner violence"); + + b.Property("IMPMILIT") + .HasColumnType("bit") + .HasComment("Source of exposure for repeated hits to the head: Military service"); + + b.Property("IMPOTHER") + .HasColumnType("bit") + .HasComment("Source of exposure for repeated hits to the head: Other cause"); + + b.Property("IMPOTHERX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasComment("Specify other source of exposure for repeated hits to the head"); + + b.Property("IMPSOCCER") + .HasColumnType("bit") + .HasComment("Source of exposure for repeated hits to the head: Soccer"); + + b.Property("IMPSPORT") + .HasColumnType("bit") + .HasComment("Source of exposure for repeated hits to the head: Other contact sport"); + + b.Property("IMPYEARS") + .HasColumnType("int") + .HasComment("The total length of time in years that the participant was exposed to repeated hits to the head (e.g. playing American football for 7 years)"); + + b.Property("INCONTF") + .HasColumnType("int") + .HasComment("Incontinence—bowel (occurring at least weekly)"); + + b.Property("INCONTU") + .HasColumnType("int") + .HasComment("Incontinence—urinary (occurring at least weekly)"); + + b.Property("INITIALS") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("nvarchar(3)") + .HasColumnName("INITIALS") + .HasColumnOrder(4); + + b.Property("INSOMN") + .HasColumnType("int") + .HasComment("Hyposomnia/Insomnia (occurring at least weekly or requiring medication)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("KIDNEY") + .HasColumnType("int") + .HasComment("Chronic kidney disease"); + + b.Property("KIDNEYAGE") + .HasColumnType("int") + .HasComment("Age at chronic kidney disease diagnosis"); + + b.Property("LANG") + .HasColumnType("int") + .HasColumnName("LANG") + .HasColumnOrder(5); + + b.Property("LASTTBI") + .HasColumnType("int") + .HasComment("Age of most recent head injury"); + + b.Property("LIVER") + .HasColumnType("int") + .HasComment("Liver disease"); + + b.Property("LIVERAGE") + .HasColumnType("int") + .HasComment("Age at liver disease diagnosis"); + + b.Property("MAJORDEP") + .HasColumnType("int") + .HasComment("Major depressive disorder (DSM-5-TR criteria)"); + + b.Property("MENARCHE") + .HasColumnType("int") + .HasComment("How old was the participant when they had their first menstrual period?"); + + b.Property("MODE") + .HasColumnType("int") + .HasColumnName("MODE") + .HasColumnOrder(6); + + b.Property("MS") + .HasColumnType("int") + .HasComment("Multiple sclerosis"); + + b.Property("ModifiedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("NOMENSAGE") + .HasColumnType("int") + .HasComment("How old was the participant when they had their last menstrual period?"); + + b.Property("NOMENSCHEM") + .HasColumnType("bit") + .HasComment("Participant has stopped having menstrual periods due to chemotherapy for cancer or another condition"); + + b.Property("NOMENSESTR") + .HasColumnType("bit") + .HasComment("Participant has stopped having menstrual periods due to anti-estrogen medication"); + + b.Property("NOMENSHORM") + .HasColumnType("bit") + .HasComment("Participant has stopped having menstrual periods due to hormonal supplements (e.g. the Pill, injections, Mirena, HRT)"); + + b.Property("NOMENSHYST") + .HasColumnType("bit") + .HasComment("Participant has stopped having menstrual periods due to hysterectomy (surgical removal of uterus)"); + + b.Property("NOMENSNAT") + .HasColumnType("bit") + .HasComment("Participant has stopped having menstrual periods due to natural menopause"); + + b.Property("NOMENSOTH") + .HasColumnType("bit") + .HasComment("Other reason participant has stopped having menstrual periods"); + + b.Property("NOMENSOTHX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasComment("Specify other reason participant has stopped having menstrual periods"); + + b.Property("NOMENSRAD") + .HasColumnType("bit") + .HasComment("Participant has stopped having menstrual periods due to radiation treatment or other damage/injury to reproductive organs"); + + b.Property("NOMENSSURG") + .HasColumnType("bit") + .HasComment("Participant has stopped having menstrual periods due to surgical removal of both ovaries"); + + b.Property("NOMENSUNK") + .HasColumnType("bit") + .HasComment("Unsure of reason participant has stopped having menstrual periods"); + + b.Property("NOT") + .HasColumnType("int") + .HasColumnName("NOT") + .HasColumnOrder(9); + + b.Property("NPSYDEV") + .HasColumnType("int") + .HasComment("Developmental neuropsychiatric disorders"); + + b.Property("OCD") + .HasColumnType("int") + .HasComment("Obsessive-compulsive disorder (OCD)"); + + b.Property("OTHANXDIS") + .HasColumnType("int") + .HasComment("Other anxiety disorder"); + + b.Property("OTHANXDISX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasComment("Specify other anxiety disorder"); + + b.Property("OTHCONDX") + .HasColumnType("nvarchar(max)") + .HasComment("Specify other medical conditions or procedures"); + + b.Property("OTHERCOND") + .HasColumnType("int") + .HasComment("Other medical conditions or procedures"); + + b.Property("OTHERDEP") + .HasColumnType("int") + .HasComment("Other specified depressive disorder (DSm-5-TR criteria)"); + + b.Property("OTHSLEEP") + .HasColumnType("int") + .HasComment("Other sleep disorder"); + + b.Property("OTHSLEEX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasComment("Specify other sleep disorder"); + + b.Property("PACDEFAGE") + .HasColumnType("int") + .HasComment("Age at first pacemaker and/or defibrillator implantation"); + + b.Property("PACKSPER") + .HasColumnType("int") + .HasComment("Average number of packs smoked per day"); + + b.Property("PANICDIS") + .HasColumnType("int") + .HasComment("Panic Disorder"); + + b.Property("PD") + .HasColumnType("int") + .HasComment("Parkinson’s disease (PD)"); + + b.Property("PDAGE") + .HasColumnType("int") + .HasComment("Age at estimated PD symptom onset"); + + b.Property("PDOTHR") + .HasColumnType("int") + .HasComment("Other parkinsonism disorder (e.g., DLB)"); + + b.Property("PDOTHRAGE") + .HasColumnType("int") + .HasComment("Age at parkinsonism disorder diagnosis"); + + b.Property("PSYCDIS") + .HasColumnType("int") + .HasComment("Other psychiatric disorders"); + + b.Property("PSYCDISX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasComment("Specify other psychiatric disorders"); + + b.Property("PTSD") + .HasColumnType("int") + .HasComment("Post-traumatic stress disorder (PTSD) (DSM-5-TR criteria)"); + + b.Property("PULMONARY") + .HasColumnType("int") + .HasComment("Asthma/COPD/pulmonary disease"); + + b.Property("PVD") + .HasColumnType("int") + .HasComment("Peripheral vascular disease"); + + b.Property("PVDAGE") + .HasColumnType("int") + .HasComment("Age at peripheral vascular disease diagnosis"); + + b.Property("QUITSMOK") + .HasColumnType("int") + .HasComment("If the participant quit smoking, specify the age at which they last smoked (i.e., quit)"); + + b.Property("RBD") + .HasColumnType("int") + .HasComment("REM sleep behavior disorder"); + + b.Property("RMMODE") + .HasColumnType("int") + .HasColumnName("RMMODE") + .HasColumnOrder(8); + + b.Property("RMREAS") + .HasColumnType("int") + .HasColumnName("RMREASON") + .HasColumnOrder(7); + + b.Property("SCHIZ") + .HasColumnType("int") + .HasComment("Schizophrenia or other psychosis disorder (DSM-5-TR criteria)"); + + b.Property("SEIZAGE") + .HasColumnType("int") + .HasComment("Age at first seizure (excluding childhood febrile seizures)"); + + b.Property("SEIZNUM") + .HasColumnType("int") + .HasComment("How many seizures has the participant had in the past 12 months?"); + + b.Property("SEIZURES") + .HasColumnType("int") + .HasComment("Epilepsy and/or history of seizures (excluding childhood febrile seizures)"); + + b.Property("SMOKYRS") + .HasColumnType("int") + .HasComment("Total years smoked"); + + b.Property("STROKAGE") + .HasColumnType("int") + .HasComment("Age at most recent stroke"); + + b.Property("STROKMUL") + .HasColumnType("int") + .HasComment("More than one stroke?"); + + b.Property("STROKSTAT") + .HasColumnType("int") + .HasComment("What is status of stroke symptoms?"); + + b.Property("SUBSTPAST") + .HasColumnType("int") + .HasComment("Participant used substances including prescription or recreational drugs that caused significant impairment in work, legal, driving, or social areas prior to 12 months ago"); + + b.Property("SUBSTYEAR") + .HasColumnType("int") + .HasComment("Participant used substances including prescription or recreational drugs that caused significant impairment in work, legal, driving, or social areas within the past 12 months"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("nvarchar(20)") + .HasColumnOrder(2); + + b.Property("THYROID") + .HasColumnType("int") + .HasComment("Thyroid disease"); + + b.Property("TIAAGE") + .HasColumnType("int") + .HasComment("Age at most recent TIA"); + + b.Property("TOBAC100") + .HasColumnType("int") + .HasComment("Has participant smoked more than 100 cigarettes in their life?"); + + b.Property("TOBAC30") + .HasColumnType("int") + .HasComment("Has participant smoked within the last 30 days?"); + + b.Property("VALVEAGE") + .HasColumnType("int") + .HasComment("Age at most recent heart valve replacement or repair procedure"); + + b.Property("VisitId") + .HasColumnType("int") + .HasColumnOrder(1); + + b.HasKey("Id"); + + b.HasIndex("VisitId") + .IsUnique(); + + b.ToTable("tbl_A5D2s"); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.B1", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("FormId") + .HasColumnOrder(0); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("BPDIASL1") + .HasColumnType("int") + .HasComment(" Participant blood pressure - Left arm: Diastolic Reading 1"); + + b.Property("BPDIASL2") + .HasColumnType("int") + .HasComment(" Participant blood pressure - Left arm: Diastolic Reading 2"); + + b.Property("BPDIASR1") + .HasColumnType("int") + .HasComment("Participant blood pressure - Right arm: Diastolic Reading 1"); + + b.Property("BPDIASR2") + .HasColumnType("int") + .HasComment("Participant blood pressure - Right arm: Diastolic Reading 2"); + + b.Property("BPSYSL1") + .HasColumnType("int") + .HasComment("Participant blood pressure - Left arm: Systolic Reading 1"); + + b.Property("BPSYSL2") + .HasColumnType("int") + .HasComment("Participant blood pressure - Left arm: Systolic Reading 2"); + + b.Property("BPSYSR1") + .HasColumnType("int") + .HasComment("Participant blood pressure - Right arm: Systolic Reading 1"); + + b.Property("BPSYSR2") + .HasColumnType("int") + .HasComment("Participant blood pressure - Right arm: Systolic Reading 2"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DeletedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("FRMDATE") + .HasColumnType("datetime2") + .HasColumnName("FRMDATE") + .HasColumnOrder(3); + + b.Property("HEIGHT") + .HasColumnType("decimal(3,1)") + .HasComment("Participant height (inches)"); + + b.Property("HIP1") + .HasColumnType("int") + .HasComment("Hip circumference measurements (inches): Measurement 1"); + + b.Property("HIP2") + .HasColumnType("int") + .HasComment("Hip circumference measurements (inches): Measurement 2"); + + b.Property("HRATE") + .HasColumnType("int") + .HasComment("Participant resting heart rate (pulse)"); + + b.Property("INITIALS") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("nvarchar(3)") + .HasColumnName("INITIALS") + .HasColumnOrder(4); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LANG") + .HasColumnType("int") + .HasColumnName("LANG") + .HasColumnOrder(5); + + b.Property("MODE") + .HasColumnType("int") + .HasColumnName("MODE") + .HasColumnOrder(6); + + b.Property("ModifiedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("NOT") + .HasColumnType("int") + .HasColumnName("NOT") + .HasColumnOrder(9); + + b.Property("RMMODE") + .HasColumnType("int") + .HasColumnName("RMMODE") + .HasColumnOrder(8); + + b.Property("RMREAS") + .HasColumnType("int") + .HasColumnName("RMREASON") + .HasColumnOrder(7); + + b.Property("Status") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("nvarchar(20)") + .HasColumnOrder(2); + + b.Property("VisitId") + .HasColumnType("int") + .HasColumnOrder(1); + + b.Property("WAIST1") + .HasColumnType("int") + .HasComment("Waist circumference measurements (inches): Measurement 1"); + + b.Property("WAIST2") + .HasColumnType("int") + .HasComment("Waist circumference measurements (inches): Measurement 2"); + + b.Property("WEIGHT") + .HasColumnType("int") + .HasComment("Participant weight (lbs.)"); + + b.HasKey("Id"); + + b.HasIndex("VisitId") + .IsUnique(); + + b.ToTable("tbl_B1s"); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.B3", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("FormId") + .HasColumnOrder(0); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("ARISING") + .HasColumnType("int"); + + b.Property("ARISINGX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("BRADYKIN") + .HasColumnType("int"); + + b.Property("BRADYKIX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DeletedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("FACEXP") + .HasColumnType("int"); + + b.Property("FACEXPX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("FRMDATE") + .HasColumnType("datetime2") + .HasColumnName("FRMDATE") + .HasColumnOrder(3); + + b.Property("GAIT") + .HasColumnType("int"); + + b.Property("GAITX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("HANDALTL") + .HasColumnType("int"); + + b.Property("HANDALTR") + .HasColumnType("int"); + + b.Property("HANDATLX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("HANDATRX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("HANDMOVL") + .HasColumnType("int"); + + b.Property("HANDMOVR") + .HasColumnType("int"); + + b.Property("HANDMVLX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("HANDMVRX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("INITIALS") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("nvarchar(3)") + .HasColumnName("INITIALS") + .HasColumnOrder(4); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LANG") + .HasColumnType("int") + .HasColumnName("LANG") + .HasColumnOrder(5); + + b.Property("LEGLF") + .HasColumnType("int"); + + b.Property("LEGLFX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("LEGRT") + .HasColumnType("int"); + + b.Property("LEGRTX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("MODE") + .HasColumnType("int") + .HasColumnName("MODE") + .HasColumnOrder(6); + + b.Property("ModifiedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("NOT") + .HasColumnType("int") + .HasColumnName("NOT") + .HasColumnOrder(9); + + b.Property("PDNORMAL") + .HasColumnType("bit"); + + b.Property("POSSTAB") + .HasColumnType("int"); + + b.Property("POSSTABX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("POSTURE") + .HasColumnType("int"); + + b.Property("POSTUREX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("RIGDLOLF") + .HasColumnType("int"); + + b.Property("RIGDLOLX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("RIGDLORT") + .HasColumnType("int"); + + b.Property("RIGDLORX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("RIGDNECK") + .HasColumnType("int"); + + b.Property("RIGDNEX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("RIGDUPLF") + .HasColumnType("int"); + + b.Property("RIGDUPLX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("RIGDUPRT") + .HasColumnType("int"); + + b.Property("RIGDUPRX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("RMMODE") + .HasColumnType("int") + .HasColumnName("RMMODE") + .HasColumnOrder(8); + + b.Property("RMREAS") + .HasColumnType("int") + .HasColumnName("RMREASON") + .HasColumnOrder(7); + + b.Property("SPEECH") + .HasColumnType("int"); + + b.Property("SPEECHX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("nvarchar(20)") + .HasColumnOrder(2); + + b.Property("TAPSLF") + .HasColumnType("int"); + + b.Property("TAPSLFX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("TAPSRT") + .HasColumnType("int"); + + b.Property("TAPSRTX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("TOTALUPDRS") + .HasColumnType("int"); + + b.Property("TRACTLHD") + .HasColumnType("int"); + + b.Property("TRACTLHX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("TRACTRHD") + .HasColumnType("int"); + + b.Property("TRACTRHX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("TRESTFAC") + .HasColumnType("int"); + + b.Property("TRESTFAX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("TRESTLFT") + .HasColumnType("int"); + + b.Property("TRESTLFX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("TRESTLHD") + .HasColumnType("int"); + + b.Property("TRESTLHX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("TRESTRFT") + .HasColumnType("int"); + + b.Property("TRESTRFX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("TRESTRHD") + .HasColumnType("int"); + + b.Property("TRESTRHX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("VisitId") + .HasColumnType("int") + .HasColumnOrder(1); + + b.HasKey("Id"); + + b.HasIndex("VisitId") + .IsUnique(); + + b.ToTable("tbl_B3s"); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.B4", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("FormId") + .HasColumnOrder(0); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CDRGLOB") + .HasColumnType("decimal(2,1)"); + + b.Property("CDRLANG") + .HasColumnType("decimal(2,1)"); + + b.Property("CDRSUM") + .HasColumnType("decimal(3,1)"); + + b.Property("COMMUN") + .HasColumnType("decimal(2,1)"); + + b.Property("COMPORT") + .HasColumnType("decimal(2,1)"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DeletedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("FRMDATE") + .HasColumnType("datetime2") + .HasColumnName("FRMDATE") + .HasColumnOrder(3); + + b.Property("HOMEHOBB") + .HasColumnType("decimal(2,1)"); + + b.Property("INITIALS") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("nvarchar(3)") + .HasColumnName("INITIALS") + .HasColumnOrder(4); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("JUDGMENT") + .HasColumnType("decimal(2,1)"); + + b.Property("LANG") + .HasColumnType("int") + .HasColumnName("LANG") + .HasColumnOrder(5); + + b.Property("MEMORY") + .HasColumnType("decimal(2,1)"); + + b.Property("MODE") + .HasColumnType("int") + .HasColumnName("MODE") + .HasColumnOrder(6); + + b.Property("ModifiedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("NOT") + .HasColumnType("int") + .HasColumnName("NOT") + .HasColumnOrder(9); + + b.Property("ORIENT") + .HasColumnType("decimal(2,1)"); + + b.Property("PERSCARE") + .HasColumnType("decimal(2,1)"); + + b.Property("RMMODE") + .HasColumnType("int") + .HasColumnName("RMMODE") + .HasColumnOrder(8); + + b.Property("RMREAS") + .HasColumnType("int") + .HasColumnName("RMREASON") + .HasColumnOrder(7); + + b.Property("Status") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("nvarchar(20)") + .HasColumnOrder(2); + + b.Property("VisitId") + .HasColumnType("int") + .HasColumnOrder(1); + + b.HasKey("Id"); + + b.HasIndex("VisitId") + .IsUnique(); + + b.ToTable("tbl_B4s"); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.B5", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("FormId") + .HasColumnOrder(0); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("AGIT") + .HasColumnType("int"); + + b.Property("AGITSEV") + .HasColumnType("int"); + + b.Property("ANX") + .HasColumnType("int"); + + b.Property("ANXSEV") + .HasColumnType("int"); + + b.Property("APA") + .HasColumnType("int"); + + b.Property("APASEV") + .HasColumnType("int"); + + b.Property("APP") + .HasColumnType("int"); + + b.Property("APPSEV") + .HasColumnType("int"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DEL") + .HasColumnType("int"); + + b.Property("DELSEV") + .HasColumnType("int"); + + b.Property("DEPD") + .HasColumnType("int"); + + b.Property("DEPDSEV") + .HasColumnType("int"); + + b.Property("DISN") + .HasColumnType("int"); + + b.Property("DISNSEV") + .HasColumnType("int"); + + b.Property("DeletedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("ELAT") + .HasColumnType("int"); + + b.Property("ELATSEV") + .HasColumnType("int"); + + b.Property("FRMDATE") + .HasColumnType("datetime2") + .HasColumnName("FRMDATE") + .HasColumnOrder(3); + + b.Property("HALL") + .HasColumnType("int"); + + b.Property("HALLSEV") + .HasColumnType("int"); + + b.Property("INITIALS") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("nvarchar(3)") + .HasColumnName("INITIALS") + .HasColumnOrder(4); + + b.Property("IRR") + .HasColumnType("int"); + + b.Property("IRRSEV") + .HasColumnType("int"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LANG") + .HasColumnType("int") + .HasColumnName("LANG") + .HasColumnOrder(5); + + b.Property("MODE") + .HasColumnType("int") + .HasColumnName("MODE") + .HasColumnOrder(6); + + b.Property("MOT") + .HasColumnType("int"); + + b.Property("MOTSEV") + .HasColumnType("int"); + + b.Property("ModifiedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("NITE") + .HasColumnType("int"); + + b.Property("NITESEV") + .HasColumnType("int"); + + b.Property("NOT") + .HasColumnType("int") + .HasColumnName("NOT") + .HasColumnOrder(9); + + b.Property("NPIQINF") + .HasColumnType("int"); + + b.Property("NPIQINFX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("RMMODE") + .HasColumnType("int") + .HasColumnName("RMMODE") + .HasColumnOrder(8); + + b.Property("RMREAS") + .HasColumnType("int") + .HasColumnName("RMREASON") + .HasColumnOrder(7); + + b.Property("Status") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("nvarchar(20)") + .HasColumnOrder(2); + + b.Property("VisitId") + .HasColumnType("int") + .HasColumnOrder(1); + + b.HasKey("Id"); + + b.HasIndex("VisitId") + .IsUnique(); + + b.ToTable("tbl_B5s"); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.B6", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("FormId") + .HasColumnOrder(0); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("AFRAID") + .HasColumnType("int"); + + b.Property("BETTER") + .HasColumnType("int"); + + b.Property("BORED") + .HasColumnType("int"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DROPACT") + .HasColumnType("int"); + + b.Property("DeletedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("EMPTY") + .HasColumnType("int"); + + b.Property("ENERGY") + .HasColumnType("int"); + + b.Property("FRMDATE") + .HasColumnType("datetime2") + .HasColumnName("FRMDATE") + .HasColumnOrder(3); + + b.Property("GDS") + .HasColumnType("int"); + + b.Property("HAPPY") + .HasColumnType("int"); + + b.Property("HELPLESS") + .HasColumnType("int"); + + b.Property("HOPELESS") + .HasColumnType("int"); + + b.Property("INITIALS") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("nvarchar(3)") + .HasColumnName("INITIALS") + .HasColumnOrder(4); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LANG") + .HasColumnType("int") + .HasColumnName("LANG") + .HasColumnOrder(5); + + b.Property("MEMPROB") + .HasColumnType("int"); + + b.Property("MODE") + .HasColumnType("int") + .HasColumnName("MODE") + .HasColumnOrder(6); + + b.Property("ModifiedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("NOGDS") + .HasColumnType("int"); + + b.Property("NOT") + .HasColumnType("int") + .HasColumnName("NOT") + .HasColumnOrder(9); + + b.Property("RMMODE") + .HasColumnType("int") + .HasColumnName("RMMODE") + .HasColumnOrder(8); + + b.Property("RMREAS") + .HasColumnType("int") + .HasColumnName("RMREASON") + .HasColumnOrder(7); + + b.Property("SATIS") + .HasColumnType("int"); + + b.Property("SPIRITS") + .HasColumnType("int"); + + b.Property("STAYHOME") + .HasColumnType("int"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("nvarchar(20)") + .HasColumnOrder(2); + + b.Property("VisitId") + .HasColumnType("int") + .HasColumnOrder(1); + + b.Property("WONDRFUL") + .HasColumnType("int"); + + b.Property("WRTHLESS") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("VisitId") + .IsUnique(); + + b.ToTable("tbl_B6s"); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.B7", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("FormId") + .HasColumnOrder(0); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("BILLS") + .HasColumnType("int"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DeletedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("EVENTS") + .HasColumnType("int"); + + b.Property("FRMDATE") + .HasColumnType("datetime2") + .HasColumnName("FRMDATE") + .HasColumnOrder(3); + + b.Property("GAMES") + .HasColumnType("int"); + + b.Property("INITIALS") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("nvarchar(3)") + .HasColumnName("INITIALS") + .HasColumnOrder(4); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LANG") + .HasColumnType("int") + .HasColumnName("LANG") + .HasColumnOrder(5); + + b.Property("MEALPREP") + .HasColumnType("int"); + + b.Property("MODE") + .HasColumnType("int") + .HasColumnName("MODE") + .HasColumnOrder(6); + + b.Property("ModifiedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("NOT") + .HasColumnType("int") + .HasColumnName("NOT") + .HasColumnOrder(9); + + b.Property("PAYATTN") + .HasColumnType("int"); + + b.Property("REMDATES") + .HasColumnType("int"); + + b.Property("RMMODE") + .HasColumnType("int") + .HasColumnName("RMMODE") + .HasColumnOrder(8); + + b.Property("RMREAS") + .HasColumnType("int") + .HasColumnName("RMREASON") + .HasColumnOrder(7); + + b.Property("SHOPPING") + .HasColumnType("int"); + + b.Property("STOVE") + .HasColumnType("int"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("nvarchar(20)") + .HasColumnOrder(2); + + b.Property("TAXES") + .HasColumnType("int"); + + b.Property("TRAVEL") + .HasColumnType("int"); + + b.Property("VisitId") + .HasColumnType("int") + .HasColumnOrder(1); + + b.HasKey("Id"); + + b.HasIndex("VisitId") + .IsUnique(); + + b.ToTable("tbl_B7s"); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.B8", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("FormId") + .HasColumnOrder(0); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("ALIENLIMB") + .HasColumnType("int"); + + b.Property("AMPMOTOR") + .HasColumnType("int"); + + b.Property("APHASIA") + .HasColumnType("int"); + + b.Property("APRAXGAZE") + .HasColumnType("int"); + + b.Property("APRAXSP") + .HasColumnType("int"); + + b.Property("AXIALRIG") + .HasColumnType("int"); + + b.Property("CHOREA") + .HasColumnType("int"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DYSARTH") + .HasColumnType("int"); + + b.Property("DYSTARM") + .HasColumnType("int"); + + b.Property("DYSTLEG") + .HasColumnType("int"); + + b.Property("DeletedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("FRMDATE") + .HasColumnType("datetime2") + .HasColumnName("FRMDATE") + .HasColumnOrder(3); + + b.Property("GAITABN") + .HasColumnType("int"); + + b.Property("GAITFIND") + .HasColumnType("int"); + + b.Property("GAITOTHRX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("HSPATNEG") + .HasColumnType("int"); + + b.Property("INITIALS") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("nvarchar(3)") + .HasColumnName("INITIALS") + .HasColumnOrder(4); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LANG") + .HasColumnType("int") + .HasColumnName("LANG") + .HasColumnOrder(5); + + b.Property("LIMBAPRAX") + .HasColumnType("int"); + + b.Property("LIMBATAX") + .HasColumnType("int"); + + b.Property("LMNDIST") + .HasColumnType("int"); + + b.Property("MASKING") + .HasColumnType("int"); + + b.Property("MODE") + .HasColumnType("int") + .HasColumnName("MODE") + .HasColumnOrder(6); + + b.Property("MYOCLON") + .HasColumnType("int"); + + b.Property("ModifiedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("NEUREXAM") + .HasColumnType("int"); + + b.Property("NORMNREXAM") + .HasColumnType("bit"); + + b.Property("NOT") + .HasColumnType("int") + .HasColumnName("NOT") + .HasColumnOrder(9); + + b.Property("OPTICATAX") + .HasColumnType("int"); + + b.Property("OTHERSIGN") + .HasColumnType("int"); + + b.Property("PARKSIGN") + .HasColumnType("int"); + + b.Property("POSTINST") + .HasColumnType("int"); + + b.Property("PSPOAGNO") + .HasColumnType("int"); + + b.Property("RIGIDARM") + .HasColumnType("int"); + + b.Property("RIGIDLEG") + .HasColumnType("int"); + + b.Property("RMMODE") + .HasColumnType("int") + .HasColumnName("RMMODE") + .HasColumnOrder(8); + + b.Property("RMREAS") + .HasColumnType("int") + .HasColumnName("RMREASON") + .HasColumnOrder(7); + + b.Property("SLOWINGFM") + .HasColumnType("int"); + + b.Property("SMTAGNO") + .HasColumnType("int"); + + b.Property("STOOPED") + .HasColumnType("int"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("nvarchar(20)") + .HasColumnOrder(2); + + b.Property("TREMKINE") + .HasColumnType("int"); + + b.Property("TREMPOST") + .HasColumnType("int"); + + b.Property("TREMREST") + .HasColumnType("int"); + + b.Property("UMNDIST") + .HasColumnType("int"); + + b.Property("UNISOMATO") + .HasColumnType("int"); + + b.Property("VFIELDCUT") + .HasColumnType("int"); + + b.Property("VHGAZEPAL") + .HasColumnType("int"); + + b.Property("VisitId") + .HasColumnType("int") + .HasColumnOrder(1); + + b.HasKey("Id"); + + b.HasIndex("VisitId") + .IsUnique(); + + b.ToTable("tbl_B8s"); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.B9", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("FormId") + .HasColumnOrder(0); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("ALCUSE") + .HasColumnType("bit") + .HasComment("Alcohol use"); + + b.Property("BEAGGRS") + .HasColumnType("int") + .HasComment("Participant currently manifests meaningful change in behavior — Aggression"); + + b.Property("BEAGIT") + .HasColumnType("int") + .HasComment("Participant currently manifests meaningful change in behavior — Agitation"); + + b.Property("BEAHALL") + .HasColumnType("int") + .HasComment("Participant currently manifests meaningful change in behavior — Psychosis — Auditory hallucinations"); + + b.Property("BEAHCOMP") + .HasColumnType("int") + .HasComment("IF YES, do the auditory hallucinations include complex sounds like voices speaking words, or music?"); + + b.Property("BEAHSIMP") + .HasColumnType("int") + .HasComment("IF YES, do the auditory hallucinations include simple sounds like knocks or other simple sounds?"); + + b.Property("BEANGER") + .HasColumnType("int") + .HasComment("Participant currently manifests meaningful change in behavior — Explosive anger"); + + b.Property("BEANX") + .HasColumnType("int") + .HasComment("Participant currently manifests meaningful change in behavior — Anxiety"); + + b.Property("BEAPATHY") + .HasColumnType("int") + .HasComment("Participant currently manifests meaningful change in behavior — Apathy, withdrawal"); + + b.Property("BEDEL") + .HasColumnType("int") + .HasComment("Participant currently manifests meaningful change in behavior — Psychosis — Abnormal, false, or delusional beliefs"); + + b.Property("BEDEP") + .HasColumnType("int") + .HasComment("Participant currently manifests meaningful change in behavior — Depressed mood"); + + b.Property("BEDISIN") + .HasColumnType("int") + .HasComment("Participant currently manifests meaningful change in behavior — Disinhibition"); + + b.Property("BEEMPATH") + .HasColumnType("int") + .HasComment("Participant currently manifests meaningful change in behavior — Loss of empathy"); + + b.Property("BEEUPH") + .HasColumnType("int") + .HasComment("Participant currently manifests meaningful change in behavior - Euphoria"); + + b.Property("BEHAGE") + .HasColumnType("int") + .HasComment("If any of the mood-related behavioral symptoms in 12a-12f are present, at what age did they begin?"); + + b.Property("BEIRRIT") + .HasColumnType("int") + .HasComment("Participant currently manifests meaningful change in behavior — Irritability"); + + b.Property("BEMODE") + .HasColumnType("int") + .HasComment("Overall mode of onset for behavioral symptoms"); + + b.Property("BEMODEX") + .HasColumnType("nvarchar(max)") + .HasComment("Other mode of onset - specify"); + + b.Property("BEOBCOM") + .HasColumnType("int") + .HasComment("Participant currently manifests meaningful change in behavior — Obsessions/compulsions"); + + b.Property("BEOTHR") + .HasColumnType("int") + .HasComment("Other behavioral symptom"); + + b.Property("BEOTHRX") + .HasColumnType("nvarchar(max)") + .HasComment("Participant currently manifests meaningful change in behavior - Other, specify"); + + b.Property("BEPERCH") + .HasColumnType("int") + .HasComment("Participant currently manifests meaningful change in behavior — Personality change"); + + b.Property("BEREM") + .HasColumnType("int") + .HasComment("Participant currently manifests meaningful change in behavior — REM sleep behavior disorder"); + + b.Property("BEREMAGO") + .HasColumnType("int") + .HasComment("IF YES, at what age did the dream enactment behavior begin?"); + + b.Property("BEREMCONF") + .HasColumnType("int") + .HasComment("Was REM sleep behavior disorder confirmed by polysomnography?"); + + b.Property("BESUBAB") + .HasColumnType("int") + .HasComment("Participant currently manifests meaningful change in behavior - Substance use"); + + b.Property("BEVHALL") + .HasColumnType("int") + .HasComment("Participant currently manifests meaningful change in behavior — Psychosis — Visual hallucinations"); + + b.Property("BEVPATT") + .HasColumnType("int") + .HasComment("IF YES, do their hallucinations include patterns that are not definite objects, such as pixelation of flat uniform surfaces?"); + + b.Property("BEVWELL") + .HasColumnType("int") + .HasComment("IF YES, do their hallucinations include well formed and detailed images of objects or people, either as independent images or as part of other objects?"); + + b.Property("CANNABUSE") + .HasColumnType("bit") + .HasComment("Cannabis use"); + + b.Property("COCAINEUSE") + .HasColumnType("bit") + .HasComment("Cocaine use"); + + b.Property("COGAGE") + .HasColumnType("int") + .HasComment("If any of the cognitive-related behavioral symptoms in 9a-9h are present, at what age did they begin?"); + + b.Property("COGATTN") + .HasColumnType("int") + .HasComment("Indicate whether the participant currently is meaningfully impaired in attention/concentration"); + + b.Property("COGFLUC") + .HasColumnType("int") + .HasComment("Indicate whether the participant currently has fluctuating cognition"); + + b.Property("COGJUDG") + .HasColumnType("int") + .HasComment("Indicate whether the participant currently is meaningfully impaired in executive function (judgment, planning, and problem-solving)"); + + b.Property("COGLANG") + .HasColumnType("int") + .HasComment("Indicate whether the participant currently is meaningfully impaired in language"); + + b.Property("COGMEM") + .HasColumnType("int") + .HasComment("Indicate whether the participant currently is meaningfully impaired in memory."); + + b.Property("COGMODE") + .HasColumnType("int") + .HasComment("Indicate the mode of onset for the most prominent cognitive problem that is causing the participant's complaints and/or affecting the participant's function."); + + b.Property("COGMODEX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasComment("Specify other mode of onset of cognitive symptoms"); + + b.Property("COGORI") + .HasColumnType("int") + .HasComment("Indicate whether the participant currently is meaningfully impaired in orientation."); + + b.Property("COGOTHR") + .HasColumnType("int") + .HasComment("Other cognitive impairment"); + + b.Property("COGOTHRX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasComment("Specify other cognitive domains"); + + b.Property("COGVIS") + .HasColumnType("int") + .HasComment("Indicate whether the participant currently is meaningfully impaired in visuospatial function"); + + b.Property("COURSE") + .HasColumnType("int") + .HasComment("Overall course of decline of cognitive / behavorial / motor syndrome"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DECCLBE") + .HasColumnType("int") + .HasComment("Based on the clinician’s judgment, is the participant currently experiencing any kind of behavioral symptoms?"); + + b.Property("DECCLCOG") + .HasColumnType("bit") + .HasComment("Based on the clinician’s judgment, is the participant currently experiencing meaningful impairment in cognition?"); + + b.Property("DECCLIN") + .HasColumnType("bit") + .HasComment("Does the participant have any neuropsychiatric/behavioral symptoms or declines in any cognitive or motor domain?"); + + b.Property("DECCLMOT") + .HasColumnType("bit") + .HasComment("Based on the clinician’s judgment, is the participant currently experiencing any motor symptoms?"); + + b.Property("DECCOG") + .HasColumnType("int") + .HasComment("Does the participant report a decline in any cognitive domain (relative to stable baseline prior to onset of current syndrome)?"); + + b.Property("DECCOGIN") + .HasColumnType("int") + .HasComment("Does the co-participant report a decline in any cognitive domain (relative to stable baseline prior to onset of current syndrome)?"); + + b.Property("DECMOT") + .HasColumnType("int") + .HasComment("Does the participant report a decline in any motor domain (relative to stable baseline prior to onset of current syndrome)?"); + + b.Property("DECMOTIN") + .HasColumnType("int") + .HasComment("Does the co-participant report a change in any motor domain (relative to stable baseline prior to onset of current syndrome)?"); + + b.Property("DeletedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("FRMDATE") + .HasColumnType("datetime2") + .HasColumnName("FRMDATE") + .HasColumnOrder(3); + + b.Property("FRSTCHG") + .HasColumnType("int") + .HasComment("Indicate the predominant domain that was first recognized as changed in the participant"); + + b.Property("INITIALS") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("nvarchar(3)") + .HasColumnName("INITIALS") + .HasColumnOrder(4); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LANG") + .HasColumnType("int") + .HasColumnName("LANG") + .HasColumnOrder(5); + + b.Property("MODE") + .HasColumnType("int") + .HasColumnName("MODE") + .HasColumnOrder(6); + + b.Property("MOFACE") + .HasColumnType("int") + .HasComment("Indicate whether the participant currently has meaningful changes in motor function — Change in facial expression"); + + b.Property("MOFALLS") + .HasColumnType("int") + .HasComment("Indicate whether the participant currently has meaningful changes in motor function — Falls"); + + b.Property("MOGAIT") + .HasColumnType("int") + .HasComment("Indicate whether the participant currently has meaningful changes in motor function — Gait disorder"); + + b.Property("MOLIMB") + .HasColumnType("int") + .HasComment("Indicate whether the participant currently has meaningful changes in motor function — Limb weakness"); + + b.Property("MOMOALS") + .HasColumnType("int") + .HasComment("Were changes in motor function suggestive of amyotrophic lateral sclerosis?"); + + b.Property("MOMODE") + .HasColumnType("int") + .HasComment("Indicate the mode of onset for the most prominent motor problem that is causing the participant's complaints and/or affecting the participant's function."); + + b.Property("MOMODEX") + .HasColumnType("nvarchar(max)") + .HasComment("Indicate mode of onset for the most prominent motor problem that is causing the participant's complains and or affecting the participant's function - Other, specify"); + + b.Property("MOMOPARK") + .HasColumnType("int") + .HasComment("Were changes in motor function suggestive of parkinsonism?"); + + b.Property("MOSLOW") + .HasColumnType("int") + .HasComment("Indicate whether the participant currently has meaningful changes in motor function — Slowness"); + + b.Property("MOSPEECH") + .HasColumnType("int") + .HasComment("Indicate whether the participant currently has meaningful changes in motor function — Change in speech"); + + b.Property("MOTORAGE") + .HasColumnType("int") + .HasComment("If changes in motor function are present in 15a-15g, at what age did they begin?"); + + b.Property("MOTREM") + .HasColumnType("int") + .HasComment("Indicate whether the participant currently has meaningful changes in motor function — Tremor"); + + b.Property("ModifiedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("NOT") + .HasColumnType("int") + .HasColumnName("NOT") + .HasColumnOrder(9); + + b.Property("OPIATEUSE") + .HasColumnType("bit") + .HasComment("Opiate use"); + + b.Property("OTHSUBUSE") + .HasColumnType("bit") + .HasComment("Other substance use"); + + b.Property("OTHSUBUSEX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasComment("Specify other substance use"); + + b.Property("PERCHAGE") + .HasColumnType("int") + .HasComment("If any of the personality-related behavioral symptoms in 12m-12r are present, at what age did they begin?"); + + b.Property("PSYCHAGE") + .HasColumnType("int") + .HasComment("If any of the psychosis and impulse control-related behavioral symptoms in 12h-12k are present, at what age did they begin?"); + + b.Property("PSYCHSYM") + .HasColumnType("int") + .HasComment("Does the participant report the development of any significant neuropsychiatric/behavioral symptoms (relative to stable baseline prior to onset of current syndrome)?"); + + b.Property("PSYCHSYMIN") + .HasColumnType("int") + .HasComment("Does the co-participant report the development of any significant neuropsychiatric/behavioral symptoms (relative to stable baseline prior to onset of current syndrome)?"); + + b.Property("RMMODE") + .HasColumnType("int") + .HasColumnName("RMMODE") + .HasColumnOrder(8); + + b.Property("RMREAS") + .HasColumnType("int") + .HasColumnName("RMREASON") + .HasColumnOrder(7); + + b.Property("SEDUSE") + .HasColumnType("bit") + .HasComment("Sedative/hypnotic use"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("nvarchar(20)") + .HasColumnOrder(2); + + b.Property("VisitId") + .HasColumnType("int") + .HasColumnOrder(1); + + b.HasKey("Id"); + + b.HasIndex("VisitId") + .IsUnique(); + + b.ToTable("tbl_B9s"); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.C1", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("FormId") + .HasColumnOrder(0); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("ANIMALS") + .HasColumnType("int"); + + b.Property("BOSTON") + .HasColumnType("int"); + + b.Property("COGSTAT") + .HasColumnType("int"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DIGIB") + .HasColumnType("int"); + + b.Property("DIGIBLEN") + .HasColumnType("int"); + + b.Property("DIGIF") + .HasColumnType("int"); + + b.Property("DIGIFLEN") + .HasColumnType("int"); + + b.Property("DeletedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("FRMDATE") + .HasColumnType("datetime2") + .HasColumnName("FRMDATE") + .HasColumnOrder(3); + + b.Property("INITIALS") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("nvarchar(3)") + .HasColumnName("INITIALS") + .HasColumnOrder(4); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LANG") + .HasColumnType("int") + .HasColumnName("LANG") + .HasColumnOrder(5); + + b.Property("LOGIDAY") + .HasColumnType("int"); + + b.Property("LOGIMEM") + .HasColumnType("int"); + + b.Property("LOGIMO") + .HasColumnType("int"); + + b.Property("LOGIPREV") + .HasColumnType("int"); + + b.Property("LOGIYR") + .HasColumnType("int"); + + b.Property("MEMTIME") + .HasColumnType("int"); + + b.Property("MEMUNITS") + .HasColumnType("int"); + + b.Property("MMSE") + .HasColumnType("int"); + + b.Property("MMSECOMP") + .HasColumnType("int"); + + b.Property("MMSEHEAR") + .HasColumnType("int"); + + b.Property("MMSELAN") + .HasColumnType("int"); + + b.Property("MMSELANX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("MMSELOC") + .HasColumnType("int"); + + b.Property("MMSEORDA") + .HasColumnType("int"); + + b.Property("MMSEORLO") + .HasColumnType("int"); + + b.Property("MMSEREAS") + .HasColumnType("int"); + + b.Property("MMSEVIS") + .HasColumnType("int"); + + b.Property("MODE") + .HasColumnType("int") + .HasColumnName("MODE") + .HasColumnOrder(6); + + b.Property("ModifiedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("NOT") + .HasColumnType("int") + .HasColumnName("NOT") + .HasColumnOrder(9); + + b.Property("NPSYCLOC") + .HasColumnType("int"); + + b.Property("NPSYLAN") + .HasColumnType("int"); + + b.Property("NPSYLANX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("PENTAGON") + .HasColumnType("int"); + + b.Property("RMMODE") + .HasColumnType("int") + .HasColumnName("RMMODE") + .HasColumnOrder(8); + + b.Property("RMREAS") + .HasColumnType("int") + .HasColumnName("RMREASON") + .HasColumnOrder(7); + + b.Property("Status") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("nvarchar(20)") + .HasColumnOrder(2); + + b.Property("TRAILA") + .HasColumnType("int"); + + b.Property("TRAILALI") + .HasColumnType("int"); + + b.Property("TRAILARR") + .HasColumnType("int"); + + b.Property("TRAILB") + .HasColumnType("int"); + + b.Property("TRAILBLI") + .HasColumnType("int"); + + b.Property("TRAILBRR") + .HasColumnType("int"); + + b.Property("UDSBENRS") + .HasColumnType("int"); + + b.Property("UDSBENTC") + .HasColumnType("int"); + + b.Property("UDSBENTD") + .HasColumnType("int"); + + b.Property("UDSVERFC") + .HasColumnType("int"); + + b.Property("UDSVERFN") + .HasColumnType("int"); + + b.Property("UDSVERLC") + .HasColumnType("int"); + + b.Property("UDSVERLN") + .HasColumnType("int"); + + b.Property("UDSVERLR") + .HasColumnType("int"); + + b.Property("UDSVERNF") + .HasColumnType("int"); + + b.Property("UDSVERTE") + .HasColumnType("int"); + + b.Property("UDSVERTI") + .HasColumnType("int"); + + b.Property("UDSVERTN") + .HasColumnType("int"); + + b.Property("VEG") + .HasColumnType("int"); + + b.Property("VisitId") + .HasColumnType("int") + .HasColumnOrder(1); + + b.HasKey("Id"); + + b.HasIndex("VisitId") + .IsUnique(); + + b.ToTable("tbl_C1s"); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.C2", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("FormId") + .HasColumnOrder(0); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("ANIMALS") + .HasColumnType("int"); + + b.Property("CERAD1INT") + .HasColumnType("int"); + + b.Property("CERAD1READ") + .HasColumnType("int"); + + b.Property("CERAD1REC") + .HasColumnType("int"); + + b.Property("CERAD2INT") + .HasColumnType("int"); + + b.Property("CERAD2READ") + .HasColumnType("int"); + + b.Property("CERAD2REC") + .HasColumnType("int"); + + b.Property("CERAD3INT") + .HasColumnType("int"); + + b.Property("CERAD3READ") + .HasColumnType("int"); + + b.Property("CERAD3REC") + .HasColumnType("int"); + + b.Property("CERADDTI") + .HasColumnType("int"); + + b.Property("CERADJ6INT") + .HasColumnType("int"); + + b.Property("CERADJ6REC") + .HasColumnType("int"); + + b.Property("CERADJ7NO") + .HasColumnType("int"); + + b.Property("CERADJ7YES") + .HasColumnType("int"); + + b.Property("COGSTAT") + .HasColumnType("int"); + + b.Property("CRAFTCUE") + .HasColumnType("int"); + + b.Property("CRAFTDRE") + .HasColumnType("int"); + + b.Property("CRAFTDTI") + .HasColumnType("int"); + + b.Property("CRAFTDVR") + .HasColumnType("int"); + + b.Property("CRAFTURS") + .HasColumnType("int"); + + b.Property("CRAFTVRS") + .HasColumnType("int"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DIGBACCT") + .HasColumnType("int"); + + b.Property("DIGBACLS") + .HasColumnType("int"); + + b.Property("DIGFORCT") + .HasColumnType("int"); + + b.Property("DIGFORSL") + .HasColumnType("int"); + + b.Property("DeletedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("FRMDATE") + .HasColumnType("datetime2") + .HasColumnName("FRMDATE") + .HasColumnOrder(3); + + b.Property("INITIALS") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("nvarchar(3)") + .HasColumnName("INITIALS") + .HasColumnOrder(4); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LANG") + .HasColumnType("int") + .HasColumnName("LANG") + .HasColumnOrder(5); + + b.Property("MINTPCNC") + .HasColumnType("int"); + + b.Property("MINTPCNG") + .HasColumnType("int"); + + b.Property("MINTSCNC") + .HasColumnType("int"); + + b.Property("MINTSCNG") + .HasColumnType("int"); + + b.Property("MINTTOTS") + .HasColumnType("int"); + + b.Property("MINTTOTW") + .HasColumnType("int"); + + b.Property("MOCAABST") + .HasColumnType("int"); + + b.Property("MOCACLOC") + .HasColumnType("int"); + + b.Property("MOCACLOH") + .HasColumnType("int"); + + b.Property("MOCACLON") + .HasColumnType("int"); + + b.Property("MOCACOMP") + .HasColumnType("int"); + + b.Property("MOCACUBE") + .HasColumnType("int"); + + b.Property("MOCADIGI") + .HasColumnType("int"); + + b.Property("MOCAFLUE") + .HasColumnType("int"); + + b.Property("MOCAHEAR") + .HasColumnType("int"); + + b.Property("MOCALAN") + .HasColumnType("int"); + + b.Property("MOCALANX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("MOCALETT") + .HasColumnType("int"); + + b.Property("MOCALOC") + .HasColumnType("int"); + + b.Property("MOCANAMI") + .HasColumnType("int"); + + b.Property("MOCAORCT") + .HasColumnType("int"); + + b.Property("MOCAORDT") + .HasColumnType("int"); + + b.Property("MOCAORDY") + .HasColumnType("int"); + + b.Property("MOCAORMO") + .HasColumnType("int"); + + b.Property("MOCAORPL") + .HasColumnType("int"); + + b.Property("MOCAORYR") + .HasColumnType("int"); + + b.Property("MOCAREAS") + .HasColumnType("int"); + + b.Property("MOCARECC") + .HasColumnType("int"); + + b.Property("MOCARECN") + .HasColumnType("int"); + + b.Property("MOCARECR") + .HasColumnType("int"); + + b.Property("MOCAREGI") + .HasColumnType("int"); + + b.Property("MOCAREPE") + .HasColumnType("int"); + + b.Property("MOCASER7") + .HasColumnType("int"); + + b.Property("MOCATOTS") + .HasColumnType("int"); + + b.Property("MOCATRAI") + .HasColumnType("int"); + + b.Property("MOCAVIS") + .HasColumnType("int"); + + b.Property("MODE") + .HasColumnType("int") + .HasColumnName("MODE") + .HasColumnOrder(6); + + b.Property("ModifiedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("NOT") + .HasColumnType("int") + .HasColumnName("NOT") + .HasColumnOrder(9); + + b.Property("NPSYCLOC") + .HasColumnType("int"); + + b.Property("NPSYLAN") + .HasColumnType("int"); + + b.Property("NPSYLANX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("RESPASST") + .HasColumnType("int"); + + b.Property("RESPDISN") + .HasColumnType("int"); + + b.Property("RESPDIST") + .HasColumnType("int"); + + b.Property("RESPEMOT") + .HasColumnType("int"); + + b.Property("RESPFATG") + .HasColumnType("int"); + + b.Property("RESPHEAR") + .HasColumnType("int"); + + b.Property("RESPINTR") + .HasColumnType("int"); + + b.Property("RESPOTH") + .HasColumnType("int"); + + b.Property("RESPOTHX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("RESPVAL") + .HasColumnType("int"); + + b.Property("REY1INT") + .HasColumnType("int"); + + b.Property("REY1REC") + .HasColumnType("int"); + + b.Property("REY2INT") + .HasColumnType("int"); + + b.Property("REY2REC") + .HasColumnType("int"); + + b.Property("REY3INT") + .HasColumnType("int"); + + b.Property("REY3REC") + .HasColumnType("int"); + + b.Property("REY4INT") + .HasColumnType("int"); + + b.Property("REY4REC") + .HasColumnType("int"); + + b.Property("REY5INT") + .HasColumnType("int"); + + b.Property("REY5REC") + .HasColumnType("int"); + + b.Property("REY6INT") + .HasColumnType("int"); + + b.Property("REY6REC") + .HasColumnType("int"); + + b.Property("REYBINT") + .HasColumnType("int"); + + b.Property("REYBREC") + .HasColumnType("int"); + + b.Property("REYDINT") + .HasColumnType("int"); + + b.Property("REYDREC") + .HasColumnType("int"); + + b.Property("REYDTI") + .HasColumnType("int"); + + b.Property("REYFPOS") + .HasColumnType("int"); + + b.Property("REYMETHOD") + .HasColumnType("int"); + + b.Property("REYTCOR") + .HasColumnType("int"); + + b.Property("RMMODE") + .HasColumnType("int") + .HasColumnName("RMMODE") + .HasColumnOrder(8); + + b.Property("RMREAS") + .HasColumnType("int") + .HasColumnName("RMREASON") + .HasColumnOrder(7); + + b.Property("Status") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("nvarchar(20)") + .HasColumnOrder(2); + + b.Property("TRAILA") + .HasColumnType("int"); + + b.Property("TRAILALI") + .HasColumnType("int"); + + b.Property("TRAILARR") + .HasColumnType("int"); + + b.Property("TRAILB") + .HasColumnType("int"); + + b.Property("TRAILBLI") + .HasColumnType("int"); + + b.Property("TRAILBRR") + .HasColumnType("int"); + + b.Property("UDSBENRS") + .HasColumnType("int"); + + b.Property("UDSBENTC") + .HasColumnType("int"); + + b.Property("UDSBENTD") + .HasColumnType("int"); + + b.Property("UDSVERFC") + .HasColumnType("int"); + + b.Property("UDSVERFN") + .HasColumnType("int"); + + b.Property("UDSVERLC") + .HasColumnType("int"); + + b.Property("UDSVERLN") + .HasColumnType("int"); + + b.Property("UDSVERLR") + .HasColumnType("int"); + + b.Property("UDSVERNF") + .HasColumnType("int"); + + b.Property("UDSVERTE") + .HasColumnType("int"); + + b.Property("UDSVERTI") + .HasColumnType("int"); + + b.Property("UDSVERTN") + .HasColumnType("int"); + + b.Property("VEG") + .HasColumnType("int"); + + b.Property("VERBALTEST") + .HasColumnType("int"); + + b.Property("VisitId") + .HasColumnType("int") + .HasColumnOrder(1); + + b.HasKey("Id"); + + b.HasIndex("VisitId") + .IsUnique(); + + b.ToTable("tbl_C2s"); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.D1a", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("FormId") + .HasColumnOrder(0); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("ALCDEM") + .HasColumnType("bit") + .HasComment("27. Cognitive impairment due to alcohol abuse (present)"); + + b.Property("ALCDEMIF") + .HasColumnType("int") + .HasComment("27a. Cognitive impairment due to alcohol abuse (primary/contributing/non-contributing)"); + + b.Property("AMNDEM") + .HasColumnType("bit") + .HasComment("8a. Amnestic predominant syndrome"); + + b.Property("ANXIET") + .HasColumnType("bit") + .HasComment("14. Anxiety disorder (present)"); + + b.Property("ANXIETIF") + .HasColumnType("int") + .HasComment("14a. Anxiety disorder (primary/contributing/non-contributing)"); + + b.Property("APNEADX") + .HasColumnType("bit") + .HasComment("25. Sleep apnea (i.e., obstructive, central, mixed or complex sleep apnea) (present)"); + + b.Property("APNEADXIF") + .HasColumnType("int") + .HasComment("25a. Sleep apnea (i.e., obstructive, central, mixed or complex sleep apnea) (primary/contributing/non-contributing)"); + + b.Property("BDOMAFREG") + .HasColumnType("int") + .HasComment("7b. MBI affected domains - Affective regulation"); + + b.Property("BDOMIMP") + .HasColumnType("int") + .HasComment("7c. MBI affected domains - Impulse control"); + + b.Property("BDOMMOT") + .HasColumnType("int") + .HasComment("7a. MBI affected domains - Motivation"); + + b.Property("BDOMSOCIAL") + .HasColumnType("int") + .HasComment("7d. MBI affected domains - Social appropriateness"); + + b.Property("BDOMTHTS") + .HasColumnType("int") + .HasComment("7e. MBI affected domains - Thought content/perception"); + + b.Property("BIPOLDIF") + .HasColumnType("int") + .HasComment("12a. Bipolar disorder (primary/contributing/non-contributing)"); + + b.Property("BIPOLDX") + .HasColumnType("bit") + .HasComment("12. Bipolar disorder (present)"); + + b.Property("CBSSYN") + .HasColumnType("bit") + .HasComment("8j. Corticobasal syndrome (CBS)"); + + b.Property("CDOMAPRAX") + .HasColumnType("bit") + .HasComment("6g. Dementia and MCI affected domains - Apraxia"); + + b.Property("CDOMATTN") + .HasColumnType("bit") + .HasComment("6c. Dementia and MCI affected domains - Attention"); + + b.Property("CDOMBEH") + .HasColumnType("bit") + .HasComment("6f. Dementia and MCI affected domains - Behavioral"); + + b.Property("CDOMEXEC") + .HasColumnType("bit") + .HasComment("6d. Dementia and MCI affected domains - Executive"); + + b.Property("CDOMLANG") + .HasColumnType("bit") + .HasComment("6b. Dementia and MCI affected domains - Language"); + + b.Property("CDOMMEM") + .HasColumnType("bit") + .HasComment("6a. Dementia and MCI affected domains - Memory"); + + b.Property("CDOMVISU") + .HasColumnType("bit") + .HasComment("6e. Dementia and MCI affected domains - Visuospatial"); + + b.Property("COGOTH") + .HasColumnType("bit") + .HasComment("30. Cognitive impairment not otherwise specified (NOS) (present)"); + + b.Property("COGOTH2") + .HasColumnType("bit") + .HasComment("31. Cognitive impairment not otherwise specified (NOS) (present)"); + + b.Property("COGOTH2F") + .HasColumnType("int") + .HasComment("31a. Cognitive impairment NOS (primary/contributing/non-contributing)"); + + b.Property("COGOTH2X") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasComment("31b. Cognitive impairment NOS (specify)"); + + b.Property("COGOTH3") + .HasColumnType("bit") + .HasComment("32. Cognitive impairment not otherwise specified (NOS) (present)"); + + b.Property("COGOTH3F") + .HasColumnType("int") + .HasComment("32a. Cognitive impairment NOS (primary/contributing/non-contributing)"); + + b.Property("COGOTH3X") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasComment("32b. Cognitive impairment NOS (specify)"); + + b.Property("COGOTHIF") + .HasColumnType("int") + .HasComment("30a. Cognitive impairment NOS (primary/contributing/non-contributing)"); + + b.Property("COGOTHX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasComment("30b. Cognitive impairment NOS (specify)"); + + b.Property("CTESYN") + .HasColumnType("bit") + .HasComment("8i. Traumatic encephalopathy syndrome"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DELIR") + .HasColumnType("bit") + .HasComment("17. Delirium (present)"); + + b.Property("DELIRIF") + .HasColumnType("int") + .HasComment("17a. Delirium (primary/contributing/non-contributing)"); + + b.Property("DEMENTED") + .HasColumnType("int") + .HasComment("3. Does the participant meet criteria for dementia?"); + + b.Property("DXMETHOD") + .HasColumnType("int") + .HasComment("1. Diagnosis method—responses in this form are based on diagnosis by a:"); + + b.Property("DYEXECSYN") + .HasColumnType("bit") + .HasComment("8b. Dysexecutive predominant syndrome"); + + b.Property("DeletedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("EPILEP") + .HasColumnType("bit") + .HasComment("20. Epilepsy (present)"); + + b.Property("EPILEPIF") + .HasColumnType("int") + .HasComment("20a. Epilepsy (primary/contributing/non-contributing)"); + + b.Property("FRMDATE") + .HasColumnType("datetime2") + .HasColumnName("FRMDATE") + .HasColumnOrder(3); + + b.Property("FTDSYN") + .HasColumnType("bit") + .HasComment("8e. Behavioral variant frontotemporal (bvFTD) syndrome"); + + b.Property("GENANX") + .HasColumnType("bit") + .HasComment("14b. Generalized Anxiety Disorder"); + + b.Property("HIV") + .HasColumnType("bit") + .HasComment("23. Human Immunodeficiency Virus (HIV) infection (present)"); + + b.Property("HIVIF") + .HasColumnType("int") + .HasComment("23a. Human Immunodeficiency Virus (HIV) infection (primary/contributing/non-contributing)"); + + b.Property("HYCEPH") + .HasColumnType("bit") + .HasComment("21. Normal-pressure hydrocephalus (present)"); + + b.Property("HYCEPHIF") + .HasColumnType("int") + .HasComment("21a. Normal-pressure hydrocephalus (primary/contributing/non-contributing)"); + + b.Property("IMPNOMCI") + .HasColumnType("bit") + .HasComment("5b. Cognitively impaired, not MCI"); + + b.Property("IMPNOMCICG") + .HasColumnType("bit") + .HasComment("5a2. Cognitively impaired, not MCI reason - Cognitive testing is abnormal but no clinical concern or functional decline (e.g., CDR SB=0 and FAS=0)"); + + b.Property("IMPNOMCIFU") + .HasColumnType("bit") + .HasComment("5a1. Cognitively impaired, not MCI reason - Evidence of functional impairment (e.g., CDR SB>0 and/or FAS>0), but available cognitive testing is judged to be normal"); + + b.Property("IMPNOMCIO") + .HasColumnType("bit") + .HasComment("5a4. Cognitively impaired, not MCI reason - Other"); + + b.Property("IMPNOMCIOX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasComment("5a4a. Cognitively impaired, not MCI reason - Other (specify)"); + + b.Property("IMPNOMCLCD") + .HasColumnType("bit") + .HasComment("5a3. Cognitively impaired, not MCI reason - Longstanding cognitive difficulties, not representing a change from their usual function"); + + b.Property("IMPSUB") + .HasColumnType("bit") + .HasComment("28. Cognitive impairment due to substance use or abuse (present)"); + + b.Property("IMPSUBIF") + .HasColumnType("int") + .HasComment("28a. Cognitive impairment due to substance use or abuse (primary/contributing/non-contributing)"); + + b.Property("INITIALS") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("nvarchar(3)") + .HasColumnName("INITIALS") + .HasColumnOrder(4); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LANG") + .HasColumnType("int") + .HasColumnName("LANG") + .HasColumnOrder(5); + + b.Property("LBDSYN") + .HasColumnType("bit") + .HasComment("8f. Lewy body syndrome"); + + b.Property("LBDSYNT") + .HasColumnType("int") + .HasComment("8f1. Lewy body syndrome - type"); + + b.Property("MAJDEPDIF") + .HasColumnType("int") + .HasComment("10a. Major depressive disorder (primary/contributing/non-contributing)"); + + b.Property("MAJDEPDX") + .HasColumnType("bit") + .HasComment("10. Major depressive disorder (present)"); + + b.Property("MBI") + .HasColumnType("int") + .HasComment("7. Does the participant meet criteria for MBI"); + + b.Property("MCI") + .HasColumnType("int") + .HasComment("4b. Does the participant meet criteria for MCI (amnestic or non-amnestic)?"); + + b.Property("MCICRITCLN") + .HasColumnType("bit") + .HasComment("4a1. MCI criteria - Clinical concern about decline in cognition compared to participant’s prior level of lifelong or usual cognitive function"); + + b.Property("MCICRITFUN") + .HasColumnType("bit") + .HasComment("4a3. MCI criteria - Largely preserved functional independence OR functional dependence that is not related to cognitive decline"); + + b.Property("MCICRITIMP") + .HasColumnType("bit") + .HasComment("4a2. MCI criteria - Impairment in one or more cognitive domains, compared to participant’s estimated prior level of lifelong or usual cognitive function, or supported by objective longitudinal neuropsychological evidence of decline"); + + b.Property("MEDS") + .HasColumnType("bit") + .HasComment("29. Cognitive impairment due to medications (present)"); + + b.Property("MEDSIF") + .HasColumnType("int") + .HasComment("29a. Cognitive impairment due to medications (primary/contributing/non-contributing)"); + + b.Property("MODE") + .HasColumnType("int") + .HasColumnName("MODE") + .HasColumnOrder(6); + + b.Property("MSASYN") + .HasColumnType("bit") + .HasComment("8k. Multiple system atrophy (MSA) syndrome"); + + b.Property("MSASYNT") + .HasColumnType("int") + .HasComment("8k1. Multiple system atrophy (MSA) syndrome - type"); + + b.Property("ModifiedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("NAMNDEM") + .HasColumnType("bit") + .HasComment("8g. Non-amnestic multidomain syndrome, not PCA, PPA, bvFT, or DLB syndrome"); + + b.Property("NDEVDIS") + .HasColumnType("bit") + .HasComment("16. Developmental neuropsychiatric disorders (e.g., autism spectrum disorder (ASD), attention-deficit hyperactivity disorder (ADHD), dyslexia) (present)"); + + b.Property("NDEVDISIF") + .HasColumnType("int") + .HasComment("16a. Developmental neuropsychiatric disorders (e.g., autism spectrum disorder (ASD), attention-deficit hyperactivity disorder (primary/contributing/non-contributing)"); + + b.Property("NEOP") + .HasColumnType("bit") + .HasComment("22. CNS Neoplasm (present)"); + + b.Property("NEOPIF") + .HasColumnType("int") + .HasComment("22a. CNS Neoplasm (primary/contributing/non-contributing)"); + + b.Property("NEOPSTAT") + .HasColumnType("int") + .HasComment("22b. CNS Neoplasm - benign or malignant"); + + b.Property("NORMCOG") + .HasColumnType("int") + .HasComment("2. Does the participant have unimpaired cognition & behavior"); + + b.Property("NOT") + .HasColumnType("int") + .HasColumnName("NOT") + .HasColumnOrder(9); + + b.Property("OCDDX") + .HasColumnType("bit") + .HasComment("14d. Obsessive-compulsive disorder (OCD)"); + + b.Property("OTHANXD") + .HasColumnType("bit") + .HasComment("14e. Other anxiety disorder"); + + b.Property("OTHANXDX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasComment("14e1. Other anxiety disorder (specify)"); + + b.Property("OTHCILLIF") + .HasColumnType("int") + .HasComment("26a. Cognitive impairment due to other neurologic, genetic, infectious conditions (not listed above), or systemic disease/medical illness (as indicated on Form A5/D2) (primary/contributing/non-contributing)"); + + b.Property("OTHCOGILL") + .HasColumnType("bit") + .HasComment("26. Cognitive impairment due to other neurologic, genetic, infectious conditions (not listed above), or systemic disease/medical illness (as indicated on Form A5/D2) (present)"); + + b.Property("OTHCOGILLX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasComment("26b. Specify cognitive impairment due to other neurologic, genetic, infection conditions or systemic disease"); + + b.Property("OTHDEPDIF") + .HasColumnType("int") + .HasComment("11a. Other specified depressive disorder (primary/contributing/non-contributing)"); + + b.Property("OTHDEPDX") + .HasColumnType("bit") + .HasComment("11. Other specified depressive disorder (present)"); + + b.Property("OTHPSY") + .HasColumnType("bit") + .HasComment("18. Other psychiatric disorder (present)"); + + b.Property("OTHPSYIF") + .HasColumnType("int") + .HasComment("18a. Other psychiatric disorder (primary/contributing/non-contributing)"); + + b.Property("OTHPSYX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasComment("18b. Other psychiatric disorder (specify)"); + + b.Property("OTHSYN") + .HasColumnType("bit") + .HasComment("8l. Other syndrome"); + + b.Property("OTHSYNX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasComment("8l1. Other syndrome (specify)"); + + b.Property("PANICDISDX") + .HasColumnType("bit") + .HasComment("14c. Panic Disorder"); + + b.Property("PCA") + .HasColumnType("bit") + .HasComment("8c. Primary visual presentation (such as posterior cortical atrophy (PCA) syndrome)"); + + b.Property("POSTC19") + .HasColumnType("bit") + .HasComment("24. Post COVID-19 cognitive impairment (present)"); + + b.Property("POSTC19IF") + .HasColumnType("int") + .HasComment("24a. Post COVID-19 cognitive impairment (primary/contributing/non-contributing)"); + + b.Property("PPASYN") + .HasColumnType("bit") + .HasComment("8d. Primary progressive aphasia (PPA) syndrome"); + + b.Property("PPASYNT") + .HasColumnType("int") + .HasComment("8d1. Primary progressive aphasia (PPA) syndrome - type"); + + b.Property("PREDOMSYN") + .HasColumnType("int") + .HasComment("8. Is there a predominant clinical syndrome?"); + + b.Property("PSPSYN") + .HasColumnType("bit") + .HasComment("8h. Primary supranuclear palsy (PSP) syndrome"); + + b.Property("PSPSYNT") + .HasColumnType("int") + .HasComment("8h1. Primary supranuclear palsy (PSP) syndrome - type"); + + b.Property("PTSDDX") + .HasColumnType("bit") + .HasComment("15. Post-traumatic stress disorder (PTSD) (present)"); + + b.Property("PTSDDXIF") + .HasColumnType("int") + .HasComment("15a. Post-traumatic stress disorder (PTSD) (primary/contributing/non-contributing)"); + + b.Property("RMMODE") + .HasColumnType("int") + .HasColumnName("RMMODE") + .HasColumnOrder(8); + + b.Property("RMREAS") + .HasColumnType("int") + .HasColumnName("RMREASON") + .HasColumnOrder(7); + + b.Property("SCD") + .HasColumnType("int") + .HasComment("2a. Does the participant report 1) significant concerns about changes in cognition AND 2) no neuropsychological evidence of decline AND 3) no functional decline?"); + + b.Property("SCDDXCONF") + .HasColumnType("int") + .HasComment("2b. As a clinician, are you confident that the subjective cognitive decline is clinically meaningful?"); + + b.Property("SCHIZOIF") + .HasColumnType("int") + .HasComment("13a. Schizophrenia or other psychotic disorder (primary/contributing/non-contributing)"); + + b.Property("SCHIZOP") + .HasColumnType("bit") + .HasComment("13. Schizophrenia or other psychotic disorder (present)"); + + b.Property("SYNINFBIOM") + .HasColumnType("bit") + .HasComment("9c. Indicate the source(s) of information used to assign the clinical syndrome - Biomarkers (MRI, PET, CSF, plasma)"); + + b.Property("SYNINFCLIN") + .HasColumnType("bit") + .HasComment("9a. Indicate the source(s) of information used to assign the clinical syndrome - Clinical information (history, CDR)"); + + b.Property("SYNINFCTST") + .HasColumnType("bit") + .HasComment("9b. Indicate the source(s) of information used to assign the clinical syndrome - Cognitive testing"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("nvarchar(20)") + .HasColumnOrder(2); + + b.Property("TBIDX") + .HasColumnType("bit") + .HasComment("19. Traumatic brain injury (present)"); + + b.Property("TBIDXIF") + .HasColumnType("int") + .HasComment("19a. Traumatic brain injury (primary/contributing/non-contributing)"); + + b.Property("VisitId") + .HasColumnType("int") + .HasColumnOrder(1); + + b.HasKey("Id"); + + b.HasIndex("VisitId") + .IsUnique(); + + b.ToTable("tbl_D1as"); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.D1b", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("FormId") + .HasColumnOrder(0); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("ALZDIS") + .HasColumnType("bit") + .HasComment("12. Alzheimer's disease"); + + b.Property("ALZDISIF") + .HasColumnType("int") + .HasComment("12a. Primary, contributing, or non-contributing - Alzheimer's disease"); + + b.Property("AMYLPET") + .HasColumnType("int") + .HasComment("6a1. Elevated amyloid"); + + b.Property("AUTDOMMUT") + .HasColumnType("int") + .HasComment("11. Is there an autosomal dominant pathogenic variant to support an etiological diagnosis?"); + + b.Property("BIOMAD1") + .HasColumnType("int") + .HasComment("8a. Other biomarker modality - Consistent with AD"); + + b.Property("BIOMAD2") + .HasColumnType("int") + .HasComment("9a. Other biomarker modality - Consistent with AD"); + + b.Property("BIOMAD3") + .HasColumnType("int") + .HasComment("10a. Other biomarker modality - Consistent with AD"); + + b.Property("BIOMARKDX") + .HasColumnType("int") + .HasComment("1. Were any biomarker results used to support the current etiological diagnosis?"); + + b.Property("BIOMFTLD1") + .HasColumnType("int") + .HasComment("8b. Other biomarker modality - Consistent with FTLD"); + + b.Property("BIOMFTLD2") + .HasColumnType("int") + .HasComment("9b. Other biomarker modality - Consistent with FTLD"); + + b.Property("BIOMFTLD3") + .HasColumnType("int") + .HasComment("10b. Other biomarker modality - Consistent with FTLD"); + + b.Property("BIOMLBD1") + .HasColumnType("int") + .HasComment("8c. Other biomarker modality - Consistent with LBD"); + + b.Property("BIOMLBD2") + .HasColumnType("int") + .HasComment("9c. Other biomarker modality - Consistent with LBD"); + + b.Property("BIOMLBD3") + .HasColumnType("int") + .HasComment("10c. Other biomarker modality - Consistent with LBD"); + + b.Property("BIOMOTH1") + .HasColumnType("int") + .HasComment("8d. Other biomarker modality - Consistent with other etiology"); + + b.Property("BIOMOTH2") + .HasColumnType("int") + .HasComment("9d. Other biomarker modality - Consistent with other etiology"); + + b.Property("BIOMOTH3") + .HasColumnType("int") + .HasComment("10d. Other biomarker modality - Consistent with other etiology"); + + b.Property("BIOMOTHX1") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasComment("8d1. Other biomarker modality - Consistent with other etiology (specify)"); + + b.Property("BIOMOTHX2") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasComment("9d1. Other biomarker modality - Consistent with other etiology (specify)"); + + b.Property("BIOMOTHX3") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasComment("10d1. Other biomarker modality - Consistent with other etiology (specify)"); + + b.Property("BLOODAD") + .HasColumnType("int") + .HasComment("3a. Blood-based biomarkers - Consistent with AD"); + + b.Property("BLOODFTLD") + .HasColumnType("int") + .HasComment("3b. Blood-based biomarkers - Consistent with FTLD"); + + b.Property("BLOODLBD") + .HasColumnType("int") + .HasComment("3c. Blood-based biomarkers - Consistent with LBD"); + + b.Property("BLOODOTH") + .HasColumnType("int") + .HasComment("3d. Blood-based biomarkers - Consistent with other etiology"); + + b.Property("BLOODOTHX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasComment("3d1. Blood-based biomarkers - Consistent with other etiology (specify)"); + + b.Property("CAA") + .HasColumnType("bit") + .HasComment("21. Cerebral amyloid angiopathy"); + + b.Property("CAAIF") + .HasColumnType("int") + .HasComment("21a. Primary, contributing, or non-contributing - Cerebral amyloid angiopathy"); + + b.Property("CORT") + .HasColumnType("bit") + .HasComment("14b2. Corticobasal degeneration (CBD)"); + + b.Property("CORTIF") + .HasColumnType("int") + .HasComment("14b2a. Primary, contributing, or non-contributing - Corticobasal degeneration (CBD)"); + + b.Property("CSFAD") + .HasColumnType("int") + .HasComment("4a. CSF-based biomarkers - Consistent with AD"); + + b.Property("CSFFTLD") + .HasColumnType("int") + .HasComment("4b. CSF-based biomarkers - Consistent with FTLD"); + + b.Property("CSFLBD") + .HasColumnType("int") + .HasComment("4c. CSF-based biomarkers - Consistent with LBD"); + + b.Property("CSFOTH") + .HasColumnType("int") + .HasComment("4d. CSF-based biomarkers - Consistent with other etiology"); + + b.Property("CSFOTHX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasComment("4d1. CSF-based biomarkers - Consistent with other etiology (specify)"); + + b.Property("CTE") + .HasColumnType("bit") + .HasComment("17. Chronic traumatic encephalopathy"); + + b.Property("CTEIF") + .HasColumnType("int") + .HasComment("17a. Primary, contributing, or non-contributing - Chronic traumatic encephalopathy"); + + b.Property("CVD") + .HasColumnType("bit") + .HasComment("15. Vascular brain injury (based on clinical and imaging evidence according to your Center's standards)"); + + b.Property("CVDIF") + .HasColumnType("int") + .HasComment("15a. Primary, contributing, or non-contributing - Vascular brain injury"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DATSCANDX") + .HasColumnType("int") + .HasComment("6c. Dopamine Transporter (DAT) Scan - Was DAT Scan data or information used to support an etiological diagnosis?"); + + b.Property("DOWNS") + .HasColumnType("bit") + .HasComment("18. Down syndrome"); + + b.Property("DOWNSIF") + .HasColumnType("int") + .HasComment("18a. Primary, contributing, or non-contributing - Down syndrome"); + + b.Property("DeletedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("FDGAD") + .HasColumnType("int") + .HasComment("6b1. FDG PET - Consistent with AD"); + + b.Property("FDGFTLD") + .HasColumnType("int") + .HasComment("6b2. FDG PET - Consistent with FTLD"); + + b.Property("FDGLBD") + .HasColumnType("int") + .HasComment("6b3. FDG PET - Consistent with LBD"); + + b.Property("FDGOTH") + .HasColumnType("int") + .HasComment("6b4. FDG PET - Consistent with other etiology"); + + b.Property("FDGOTHX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasComment("6b4a. FDG PET - Consistent with other etiology (specify)"); + + b.Property("FDGPETDX") + .HasColumnType("int") + .HasComment("6b. FDG PET - Was FDG PET data or information used to support an etiological diagnosis?"); + + b.Property("FLUIDBIOM") + .HasColumnType("int") + .HasComment("2. Fluid Biomarkers - Were fluid biomarkers used for assessing the etiological diagnosis?"); + + b.Property("FRMDATE") + .HasColumnType("datetime2") + .HasColumnName("FRMDATE") + .HasColumnOrder(3); + + b.Property("FTLD") + .HasColumnType("bit") + .HasComment("14. Frontotemporal lobar degeneration"); + + b.Property("FTLDIF") + .HasColumnType("int") + .HasComment("14a. Primary, contributing, or non-contributing - Frontotemporal lobar degeneration"); + + b.Property("FTLDMO") + .HasColumnType("bit") + .HasComment("14b3. FTLD with motor neuron disease"); + + b.Property("FTLDMOIF") + .HasColumnType("int") + .HasComment("14b3a. Primary, contributing, or non-contributing - FTLD with motor neuron disease"); + + b.Property("FTLDNOIF") + .HasColumnType("int") + .HasComment("14b4a. Primary, contributing, or non-contributing - FTLD not otherwise specified (NOS)"); + + b.Property("FTLDNOS") + .HasColumnType("bit") + .HasComment("14b4. FTLD not otherwise specified (NOS)"); + + b.Property("FTLDSUBT") + .HasColumnType("int") + .HasComment("14c. FTLD subtype"); + + b.Property("FTLDSUBX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasComment("14c1. Other FTLD subtype (specify)"); + + b.Property("HUNT") + .HasColumnType("bit") + .HasComment("19. Huntington's disease"); + + b.Property("HUNTIF") + .HasColumnType("int") + .HasComment("19a. Primary, contributing, or non-contributing - Huntington's disease"); + + b.Property("IMAGEWMH") + .HasColumnType("int") + .HasComment("7a3f. Extensive white-matter hyperintensity (CHS score 7-8+)"); + + b.Property("IMAGINGDX") + .HasColumnType("int") + .HasComment("5. Imaging - Was imaging used for assessing etiological diagnosis?"); + + b.Property("IMAGLAC") + .HasColumnType("int") + .HasComment("7a3b. Lacunar infarct(s)"); + + b.Property("IMAGLINF") + .HasColumnType("int") + .HasComment("7a3a. Large vessel infarct(s)"); + + b.Property("IMAGMACH") + .HasColumnType("int") + .HasComment("7a3c. Macrohemorrhage(s)"); + + b.Property("IMAGMICH") + .HasColumnType("int") + .HasComment("7a3d. Microhemorrhage(s)"); + + b.Property("IMAGMWMH") + .HasColumnType("int") + .HasComment("7a3e. Moderate white-matter hyperintensity (CHS score 5-6)"); + + b.Property("INITIALS") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("nvarchar(3)") + .HasColumnName("INITIALS") + .HasColumnOrder(4); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LANG") + .HasColumnType("int") + .HasColumnName("LANG") + .HasColumnOrder(5); + + b.Property("LATE") + .HasColumnType("bit") + .HasComment("22. LATE: Limbic-predominant age-related TDP-43 encephalopathy"); + + b.Property("LATEIF") + .HasColumnType("int") + .HasComment("22a. Primary, contributing, or non-contributing - LATE"); + + b.Property("LBDIF") + .HasColumnType("int") + .HasComment("13a. Primary, contributing, or non-contributing - Lewy body disease"); + + b.Property("LBDIS") + .HasColumnType("bit") + .HasComment("13. Lewy body disease"); + + b.Property("MODE") + .HasColumnType("int") + .HasColumnName("MODE") + .HasColumnOrder(6); + + b.Property("MSA") + .HasColumnType("bit") + .HasComment("16. Multiple system atrophy"); + + b.Property("MSAIF") + .HasColumnType("int") + .HasComment("16a. Primary, contributing, or non-contributing - Multiple system atrophy"); + + b.Property("ModifiedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("NOT") + .HasColumnType("int") + .HasColumnName("NOT") + .HasColumnOrder(9); + + b.Property("OTHBIOM1") + .HasColumnType("int") + .HasComment("8. Other biomarker modality - Was another biomarker modality used to support an etiological diagnosis?"); + + b.Property("OTHBIOM2") + .HasColumnType("int") + .HasComment("9. Other biomarker modality - Was another biomarker modality used to support an etiological diagnosis?"); + + b.Property("OTHBIOM3") + .HasColumnType("int") + .HasComment("10. Other biomarker modality - Was another biomarker modality used to support an etiological diagnosis?"); + + b.Property("OTHBIOMX1") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasComment("8a1. Other biomarker modality - Was another biomarker modality used to support an etiological diagnosis? (specify) OTHBI"); + + b.Property("OTHBIOMX2") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasComment("9a1. Other biomarker modality - Was another biomarker modality used to support an etiological diagnosis? (specify)"); + + b.Property("OTHBIOMX3") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasComment("10a1. Other biomarker modality - Was another biomarker modality used to support an etiological diagnosis? (specify)"); + + b.Property("OTHCOG") + .HasColumnType("bit") + .HasComment("23. Other"); + + b.Property("OTHCOGIF") + .HasColumnType("int") + .HasComment("23a. Primary, contributing, or non-contributing - Other"); + + b.Property("OTHCOGX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasComment("23b. Other (specify)"); + + b.Property("PETDX") + .HasColumnType("int") + .HasComment("6a. Tracer-based PET - Were tracer-based PET measures used in assessing an etiological diagnosis?"); + + b.Property("PRION") + .HasColumnType("bit") + .HasComment("20. Prion disease (CJD, other)"); + + b.Property("PRIONIF") + .HasColumnType("int") + .HasComment("20a. Primary, contributing, or non-contributing - Prion disease (CJD, other)"); + + b.Property("PSP") + .HasColumnType("bit") + .HasComment("14ba. Primary supranuclear palsy (PSP)"); + + b.Property("PSPIF") + .HasColumnType("int") + .HasComment("14b1a. Primary, contributing, or non-contributing - Primary supranuclear palsy (PSP)"); + + b.Property("RMMODE") + .HasColumnType("int") + .HasColumnName("RMMODE") + .HasColumnOrder(8); + + b.Property("RMREAS") + .HasColumnType("int") + .HasColumnName("RMREASON") + .HasColumnOrder(7); + + b.Property("STRUCTAD") + .HasColumnType("int") + .HasComment("7a1. Atrophy pattern consistent with AD"); + + b.Property("STRUCTCVD") + .HasColumnType("int") + .HasComment("7a3. Consistent with cerebrovascular disease (CVD)"); + + b.Property("STRUCTDX") + .HasColumnType("int") + .HasComment("7a. Structural Imaging (i.e., MRI or CT) - Was structural imaging data or information used to support an etiological diagnosis?"); + + b.Property("STRUCTFTLD") + .HasColumnType("int") + .HasComment("7a2. Atrophy pattern consistent with FTLD"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("nvarchar(20)") + .HasColumnOrder(2); + + b.Property("TAUPET") + .HasColumnType("int") + .HasComment("6a2. Elevated tau pathology"); + + b.Property("TRACERAD") + .HasColumnType("int") + .HasComment("6d1. Other tracer-based imaging - Consistent with AD"); + + b.Property("TRACERFTLD") + .HasColumnType("int") + .HasComment("6d2. Other tracer-based imaging - Consistent with FTLD"); + + b.Property("TRACERLBD") + .HasColumnType("int") + .HasComment("6d3. Other tracer-based imaging - Consistent with LBD"); + + b.Property("TRACEROTH") + .HasColumnType("int") + .HasComment("6d4. Other tracer-based imaging - Consistent with other etiology"); + + b.Property("TRACEROTHX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasComment("6d4a. Other tracer-based imaging - Consistent with other etiology (specify)"); + + b.Property("TRACOTHDX") + .HasColumnType("int") + .HasComment("6d. Other tracer-based imaging - Were other tracer-based imaging used to support an etiological diagnosis?"); + + b.Property("TRACOTHDXX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasComment("6d1a. Other tracer-based imaging - Were other tracer-based imaging used to support an etiological diagnosis? (specify)"); + + b.Property("VisitId") + .HasColumnType("int") + .HasColumnOrder(1); + + b.HasKey("Id"); + + b.HasIndex("VisitId") + .IsUnique(); + + b.ToTable("tbl_D1bs"); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.DrugCodeLookup", b => + { + b.Property("RxNormId") + .HasColumnType("int"); + + b.Property("BrandNames") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("DrugName") + .IsRequired() + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("IsOverTheCounter") + .HasColumnType("bit"); + + b.Property("IsPopular") + .HasColumnType("bit"); + + b.HasKey("RxNormId"); + + b.ToTable("DrugCodesLookup"); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.FormStatus", b => + { + b.Property("VisitId") + .HasColumnType("int") + .HasColumnOrder(1); + + b.Property("Kind") + .HasMaxLength(3) + .HasColumnType("nvarchar(3)"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DeletedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("FRMDATE") + .HasColumnType("datetime2") + .HasColumnName("FRMDATE") + .HasColumnOrder(3); + + b.Property("INITIALS") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("nvarchar(3)") + .HasColumnName("INITIALS") + .HasColumnOrder(4); + + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("FormId") + .HasColumnOrder(0); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LANG") + .HasColumnType("int") + .HasColumnName("LANG") + .HasColumnOrder(5); + + b.Property("MODE") + .HasColumnType("int") + .HasColumnName("MODE") + .HasColumnOrder(6); + + b.Property("ModifiedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("NOT") + .HasColumnType("int") + .HasColumnName("NOT") + .HasColumnOrder(9); + + b.Property("RMMODE") + .HasColumnType("int") + .HasColumnName("RMMODE") + .HasColumnOrder(8); + + b.Property("RMREAS") + .HasColumnType("int") + .HasColumnName("RMREASON") + .HasColumnOrder(7); + + b.Property("Status") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("nvarchar(20)") + .HasColumnOrder(2); + + b.HasKey("VisitId", "Kind"); + + b.ToTable((string)null); + + b.ToView("vw_FormStatuses", (string)null); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.M1", b => + { + b.Property("FormId") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("FormId")); + + b.Property("ACONSENT") + .HasColumnType("int"); + + b.Property("AUTOPSY") + .HasColumnType("int"); + + b.Property("CHANGEDY") + .HasColumnType("int"); + + b.Property("CHANGEMO") + .HasColumnType("int"); + + b.Property("CHANGEYR") + .HasColumnType("int"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DEATHDY") + .HasColumnType("int"); + + b.Property("DEATHMO") + .HasColumnType("int"); + + b.Property("DEATHYR") + .HasColumnType("int"); + + b.Property("DECEASED") + .HasColumnType("int"); + + b.Property("DISCDAY") + .HasColumnType("int"); + + b.Property("DISCMO") + .HasColumnType("int"); + + b.Property("DISCONT") + .HasColumnType("int"); + + b.Property("DISCYR") + .HasColumnType("int"); + + b.Property("DROPREAS") + .HasColumnType("int"); + + b.Property("DeletedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("FTLDDISC") + .HasColumnType("int"); + + b.Property("FTLDREAS") + .HasColumnType("int"); + + b.Property("FTLDREAX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("MILESTONETYPE") + .HasColumnType("int"); + + b.Property("ModifiedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("NURSEDY") + .HasColumnType("int"); + + b.Property("NURSEMO") + .HasColumnType("int"); + + b.Property("NURSEYR") + .HasColumnType("int"); + + b.Property("PROTOCOL") + .HasColumnType("int"); + + b.Property("ParticipationId") + .HasColumnType("int"); + + b.Property("RECOGIM") + .HasColumnType("int"); + + b.Property("REJOIN") + .HasColumnType("int"); + + b.Property("RENAVAIL") + .HasColumnType("int"); + + b.Property("RENURSE") + .HasColumnType("int"); + + b.Property("REPHYILL") + .HasColumnType("int"); + + b.Property("REREFUSE") + .HasColumnType("int"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b.HasKey("FormId"); + + b.HasIndex("ParticipationId"); + + b.ToTable("tbl_M1s"); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.PacketSubmission", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("PacketSubmissionId") + .HasColumnOrder(0); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DeletedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("ErrorCount") + .HasColumnType("int"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("ModifiedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("SubmissionDate") + .HasColumnType("datetime2"); + + b.Property("VisitId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("VisitId"); + + b.ToTable("PacketSubmissions"); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.PacketSubmissionError", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("PacketSubmissionErrorId") + .HasColumnOrder(0); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("AssignedTo") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DeletedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("FormKind") + .IsRequired() + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("Message") + .IsRequired() + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("ModifiedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("PacketSubmissionId") + .HasColumnType("int"); + + b.Property("ResolvedBy") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("PacketSubmissionId"); + + b.ToTable("PacketSubmissionErrors"); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.Participation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("ParticipationId"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DeletedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LegacyId") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("ModifiedBy") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("Participation"); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.T1", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("FormId") + .HasColumnOrder(0); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DeletedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("FRMDATE") + .HasColumnType("datetime2") + .HasColumnName("FRMDATE") + .HasColumnOrder(3); + + b.Property("INITIALS") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("nvarchar(3)") + .HasColumnName("INITIALS") + .HasColumnOrder(4); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("LANG") + .HasColumnType("int") + .HasColumnName("LANG") + .HasColumnOrder(5); + + b.Property("MODE") + .HasColumnType("int") + .HasColumnName("MODE") + .HasColumnOrder(6); + + b.Property("ModifiedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("NOT") + .HasColumnType("int") + .HasColumnName("NOT") + .HasColumnOrder(9); + + b.Property("RMMODE") + .HasColumnType("int") + .HasColumnName("RMMODE") + .HasColumnOrder(8); + + b.Property("RMREAS") + .HasColumnType("int") + .HasColumnName("RMREASON") + .HasColumnOrder(7); + + b.Property("Status") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("nvarchar(20)") + .HasColumnOrder(2); + + b.Property("TELCOG") + .HasColumnType("int"); + + b.Property("TELCOV") + .HasColumnType("int"); + + b.Property("TELHOME") + .HasColumnType("int"); + + b.Property("TELILL") + .HasColumnType("int"); + + b.Property("TELINPER") + .HasColumnType("int"); + + b.Property("TELMILE") + .HasColumnType("int"); + + b.Property("TELMOD") + .HasColumnType("int"); + + b.Property("TELOTHR") + .HasColumnType("int"); + + b.Property("TELOTHRX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)"); + + b.Property("TELREFU") + .HasColumnType("int"); + + b.Property("VisitId") + .HasColumnType("int") + .HasColumnOrder(1); + + b.HasKey("Id"); + + b.HasIndex("VisitId") + .IsUnique(); + + b.ToTable("tbl_T1s"); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.Visit", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("VisitId"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DSSDUB") + .HasColumnType("int"); + + b.Property("DeletedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("FORMVER") + .IsRequired() + .HasMaxLength(1) + .HasColumnType("nvarchar(1)") + .HasColumnName("FORMVER"); + + b.Property("INITIALS") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("nvarchar(3)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("ModifiedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("PACKET") + .IsRequired() + .HasMaxLength(1) + .HasColumnType("nvarchar(1)") + .HasColumnName("PACKET"); + + b.Property("ParticipationId") + .HasColumnType("int"); + + b.Property("Status") + .HasColumnType("int"); + + b.Property("VISITNUM") + .HasColumnType("int") + .HasColumnName("VISITNUM"); + + b.Property("VISIT_DATE") + .HasColumnType("datetime2"); + + b.HasKey("Id"); + + b.HasIndex("ParticipationId", "VISITNUM") + .IsUnique(); + + b.ToTable("tbl_Visits"); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.A1", b => + { + b.HasOne("UDS.Net.API.Entities.Visit", null) + .WithOne("A1") + .HasForeignKey("UDS.Net.API.Entities.A1", "VisitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.A1a", b => + { + b.HasOne("UDS.Net.API.Entities.Visit", null) + .WithOne("A1a") + .HasForeignKey("UDS.Net.API.Entities.A1a", "VisitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.A2", b => + { + b.HasOne("UDS.Net.API.Entities.Visit", null) + .WithOne("A2") + .HasForeignKey("UDS.Net.API.Entities.A2", "VisitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.A3", b => + { + b.HasOne("UDS.Net.API.Entities.Visit", null) + .WithOne("A3") + .HasForeignKey("UDS.Net.API.Entities.A3", "VisitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "KID1", b1 => + { + b1.Property("A3Id") + .HasColumnType("int"); + + b1.Property("AGD") + .HasColumnType("int"); + + b1.Property("AGO") + .HasColumnType("int"); + + b1.Property("ETPR") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("ETSEC") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("MEVAL") + .HasColumnType("int"); + + b1.Property("YOB") + .HasColumnType("int"); + + b1.HasKey("A3Id"); + + b1.ToTable("tbl_A3s"); + + b1.WithOwner() + .HasForeignKey("A3Id"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "KID10", b1 => + { + b1.Property("A3Id") + .HasColumnType("int"); + + b1.Property("AGD") + .HasColumnType("int"); + + b1.Property("AGO") + .HasColumnType("int"); + + b1.Property("ETPR") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("ETSEC") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("MEVAL") + .HasColumnType("int"); + + b1.Property("YOB") + .HasColumnType("int"); + + b1.HasKey("A3Id"); + + b1.ToTable("tbl_A3s"); + + b1.WithOwner() + .HasForeignKey("A3Id"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "KID11", b1 => + { + b1.Property("A3Id") + .HasColumnType("int"); + + b1.Property("AGD") + .HasColumnType("int"); + + b1.Property("AGO") + .HasColumnType("int"); + + b1.Property("ETPR") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("ETSEC") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("MEVAL") + .HasColumnType("int"); + + b1.Property("YOB") + .HasColumnType("int"); + + b1.HasKey("A3Id"); + + b1.ToTable("tbl_A3s"); + + b1.WithOwner() + .HasForeignKey("A3Id"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "KID12", b1 => + { + b1.Property("A3Id") + .HasColumnType("int"); + + b1.Property("AGD") + .HasColumnType("int"); + + b1.Property("AGO") + .HasColumnType("int"); + + b1.Property("ETPR") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("ETSEC") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("MEVAL") + .HasColumnType("int"); + + b1.Property("YOB") + .HasColumnType("int"); + + b1.HasKey("A3Id"); + + b1.ToTable("tbl_A3s"); + + b1.WithOwner() + .HasForeignKey("A3Id"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "KID13", b1 => + { + b1.Property("A3Id") + .HasColumnType("int"); + + b1.Property("AGD") + .HasColumnType("int"); + + b1.Property("AGO") + .HasColumnType("int"); + + b1.Property("ETPR") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("ETSEC") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("MEVAL") + .HasColumnType("int"); + + b1.Property("YOB") + .HasColumnType("int"); + + b1.HasKey("A3Id"); + + b1.ToTable("tbl_A3s"); + + b1.WithOwner() + .HasForeignKey("A3Id"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "KID14", b1 => + { + b1.Property("A3Id") + .HasColumnType("int"); + + b1.Property("AGD") + .HasColumnType("int"); + + b1.Property("AGO") + .HasColumnType("int"); + + b1.Property("ETPR") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("ETSEC") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("MEVAL") + .HasColumnType("int"); + + b1.Property("YOB") + .HasColumnType("int"); + + b1.HasKey("A3Id"); + + b1.ToTable("tbl_A3s"); + + b1.WithOwner() + .HasForeignKey("A3Id"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "KID15", b1 => + { + b1.Property("A3Id") + .HasColumnType("int"); + + b1.Property("AGD") + .HasColumnType("int"); + + b1.Property("AGO") + .HasColumnType("int"); + + b1.Property("ETPR") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("ETSEC") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("MEVAL") + .HasColumnType("int"); + + b1.Property("YOB") + .HasColumnType("int"); + + b1.HasKey("A3Id"); + + b1.ToTable("tbl_A3s"); + + b1.WithOwner() + .HasForeignKey("A3Id"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "KID2", b1 => + { + b1.Property("A3Id") + .HasColumnType("int"); + + b1.Property("AGD") + .HasColumnType("int"); + + b1.Property("AGO") + .HasColumnType("int"); + + b1.Property("ETPR") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("ETSEC") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("MEVAL") + .HasColumnType("int"); + + b1.Property("YOB") + .HasColumnType("int"); + + b1.HasKey("A3Id"); + + b1.ToTable("tbl_A3s"); + + b1.WithOwner() + .HasForeignKey("A3Id"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "KID3", b1 => + { + b1.Property("A3Id") + .HasColumnType("int"); + + b1.Property("AGD") + .HasColumnType("int"); + + b1.Property("AGO") + .HasColumnType("int"); + + b1.Property("ETPR") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("ETSEC") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("MEVAL") + .HasColumnType("int"); + + b1.Property("YOB") + .HasColumnType("int"); + + b1.HasKey("A3Id"); + + b1.ToTable("tbl_A3s"); + + b1.WithOwner() + .HasForeignKey("A3Id"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "KID4", b1 => + { + b1.Property("A3Id") + .HasColumnType("int"); + + b1.Property("AGD") + .HasColumnType("int"); + + b1.Property("AGO") + .HasColumnType("int"); + + b1.Property("ETPR") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("ETSEC") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("MEVAL") + .HasColumnType("int"); + + b1.Property("YOB") + .HasColumnType("int"); + + b1.HasKey("A3Id"); + + b1.ToTable("tbl_A3s"); + + b1.WithOwner() + .HasForeignKey("A3Id"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "KID5", b1 => + { + b1.Property("A3Id") + .HasColumnType("int"); + + b1.Property("AGD") + .HasColumnType("int"); + + b1.Property("AGO") + .HasColumnType("int"); + + b1.Property("ETPR") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("ETSEC") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("MEVAL") + .HasColumnType("int"); + + b1.Property("YOB") + .HasColumnType("int"); + + b1.HasKey("A3Id"); + + b1.ToTable("tbl_A3s"); + + b1.WithOwner() + .HasForeignKey("A3Id"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "KID6", b1 => + { + b1.Property("A3Id") + .HasColumnType("int"); + + b1.Property("AGD") + .HasColumnType("int"); + + b1.Property("AGO") + .HasColumnType("int"); + + b1.Property("ETPR") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("ETSEC") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("MEVAL") + .HasColumnType("int"); + + b1.Property("YOB") + .HasColumnType("int"); + + b1.HasKey("A3Id"); + + b1.ToTable("tbl_A3s"); + + b1.WithOwner() + .HasForeignKey("A3Id"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "KID7", b1 => + { + b1.Property("A3Id") + .HasColumnType("int"); + + b1.Property("AGD") + .HasColumnType("int"); + + b1.Property("AGO") + .HasColumnType("int"); + + b1.Property("ETPR") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("ETSEC") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("MEVAL") + .HasColumnType("int"); + + b1.Property("YOB") + .HasColumnType("int"); + + b1.HasKey("A3Id"); + + b1.ToTable("tbl_A3s"); + + b1.WithOwner() + .HasForeignKey("A3Id"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "KID8", b1 => + { + b1.Property("A3Id") + .HasColumnType("int"); + + b1.Property("AGD") + .HasColumnType("int"); + + b1.Property("AGO") + .HasColumnType("int"); + + b1.Property("ETPR") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("ETSEC") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("MEVAL") + .HasColumnType("int"); + + b1.Property("YOB") + .HasColumnType("int"); + + b1.HasKey("A3Id"); + + b1.ToTable("tbl_A3s"); + + b1.WithOwner() + .HasForeignKey("A3Id"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "KID9", b1 => + { + b1.Property("A3Id") + .HasColumnType("int"); + + b1.Property("AGD") + .HasColumnType("int"); + + b1.Property("AGO") + .HasColumnType("int"); + + b1.Property("ETPR") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("ETSEC") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("MEVAL") + .HasColumnType("int"); + + b1.Property("YOB") + .HasColumnType("int"); + + b1.HasKey("A3Id"); + + b1.ToTable("tbl_A3s"); + + b1.WithOwner() + .HasForeignKey("A3Id"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB1", b1 => + { + b1.Property("A3Id") + .HasColumnType("int"); + + b1.Property("AGD") + .HasColumnType("int"); + + b1.Property("AGO") + .HasColumnType("int"); + + b1.Property("ETPR") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("ETSEC") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("MEVAL") + .HasColumnType("int"); + + b1.Property("YOB") + .HasColumnType("int"); + + b1.HasKey("A3Id"); + + b1.ToTable("tbl_A3s"); + + b1.WithOwner() + .HasForeignKey("A3Id"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB10", b1 => + { + b1.Property("A3Id") + .HasColumnType("int"); + + b1.Property("AGD") + .HasColumnType("int"); + + b1.Property("AGO") + .HasColumnType("int"); + + b1.Property("ETPR") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("ETSEC") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("MEVAL") + .HasColumnType("int"); + + b1.Property("YOB") + .HasColumnType("int"); + + b1.HasKey("A3Id"); + + b1.ToTable("tbl_A3s"); + + b1.WithOwner() + .HasForeignKey("A3Id"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB11", b1 => + { + b1.Property("A3Id") + .HasColumnType("int"); + + b1.Property("AGD") + .HasColumnType("int"); + + b1.Property("AGO") + .HasColumnType("int"); + + b1.Property("ETPR") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("ETSEC") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("MEVAL") + .HasColumnType("int"); + + b1.Property("YOB") + .HasColumnType("int"); + + b1.HasKey("A3Id"); + + b1.ToTable("tbl_A3s"); + + b1.WithOwner() + .HasForeignKey("A3Id"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB12", b1 => + { + b1.Property("A3Id") + .HasColumnType("int"); + + b1.Property("AGD") + .HasColumnType("int"); + + b1.Property("AGO") + .HasColumnType("int"); + + b1.Property("ETPR") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("ETSEC") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("MEVAL") + .HasColumnType("int"); + + b1.Property("YOB") + .HasColumnType("int"); + + b1.HasKey("A3Id"); + + b1.ToTable("tbl_A3s"); + + b1.WithOwner() + .HasForeignKey("A3Id"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB13", b1 => + { + b1.Property("A3Id") + .HasColumnType("int"); + + b1.Property("AGD") + .HasColumnType("int"); + + b1.Property("AGO") + .HasColumnType("int"); + + b1.Property("ETPR") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("ETSEC") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("MEVAL") + .HasColumnType("int"); + + b1.Property("YOB") + .HasColumnType("int"); + + b1.HasKey("A3Id"); + + b1.ToTable("tbl_A3s"); + + b1.WithOwner() + .HasForeignKey("A3Id"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB14", b1 => + { + b1.Property("A3Id") + .HasColumnType("int"); + + b1.Property("AGD") + .HasColumnType("int"); + + b1.Property("AGO") + .HasColumnType("int"); + + b1.Property("ETPR") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("ETSEC") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("MEVAL") + .HasColumnType("int"); + + b1.Property("YOB") + .HasColumnType("int"); + + b1.HasKey("A3Id"); + + b1.ToTable("tbl_A3s"); + + b1.WithOwner() + .HasForeignKey("A3Id"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB15", b1 => + { + b1.Property("A3Id") + .HasColumnType("int"); + + b1.Property("AGD") + .HasColumnType("int"); + + b1.Property("AGO") + .HasColumnType("int"); + + b1.Property("ETPR") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("ETSEC") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("MEVAL") + .HasColumnType("int"); + + b1.Property("YOB") + .HasColumnType("int"); + + b1.HasKey("A3Id"); + + b1.ToTable("tbl_A3s"); + + b1.WithOwner() + .HasForeignKey("A3Id"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB16", b1 => + { + b1.Property("A3Id") + .HasColumnType("int"); + + b1.Property("AGD") + .HasColumnType("int"); + + b1.Property("AGO") + .HasColumnType("int"); + + b1.Property("ETPR") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("ETSEC") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("MEVAL") + .HasColumnType("int"); + + b1.Property("YOB") + .HasColumnType("int"); + + b1.HasKey("A3Id"); + + b1.ToTable("tbl_A3s"); + + b1.WithOwner() + .HasForeignKey("A3Id"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB17", b1 => + { + b1.Property("A3Id") + .HasColumnType("int"); + + b1.Property("AGD") + .HasColumnType("int"); + + b1.Property("AGO") + .HasColumnType("int"); + + b1.Property("ETPR") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("ETSEC") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("MEVAL") + .HasColumnType("int"); + + b1.Property("YOB") + .HasColumnType("int"); + + b1.HasKey("A3Id"); + + b1.ToTable("tbl_A3s"); + + b1.WithOwner() + .HasForeignKey("A3Id"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB18", b1 => + { + b1.Property("A3Id") + .HasColumnType("int"); + + b1.Property("AGD") + .HasColumnType("int"); + + b1.Property("AGO") + .HasColumnType("int"); + + b1.Property("ETPR") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("ETSEC") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("MEVAL") + .HasColumnType("int"); + + b1.Property("YOB") + .HasColumnType("int"); + + b1.HasKey("A3Id"); + + b1.ToTable("tbl_A3s"); + + b1.WithOwner() + .HasForeignKey("A3Id"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB19", b1 => + { + b1.Property("A3Id") + .HasColumnType("int"); + + b1.Property("AGD") + .HasColumnType("int"); + + b1.Property("AGO") + .HasColumnType("int"); + + b1.Property("ETPR") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("ETSEC") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("MEVAL") + .HasColumnType("int"); + + b1.Property("YOB") + .HasColumnType("int"); + + b1.HasKey("A3Id"); + + b1.ToTable("tbl_A3s"); + + b1.WithOwner() + .HasForeignKey("A3Id"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB2", b1 => + { + b1.Property("A3Id") + .HasColumnType("int"); + + b1.Property("AGD") + .HasColumnType("int"); + + b1.Property("AGO") + .HasColumnType("int"); + + b1.Property("ETPR") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("ETSEC") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("MEVAL") + .HasColumnType("int"); + + b1.Property("YOB") + .HasColumnType("int"); + + b1.HasKey("A3Id"); + + b1.ToTable("tbl_A3s"); + + b1.WithOwner() + .HasForeignKey("A3Id"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB20", b1 => + { + b1.Property("A3Id") + .HasColumnType("int"); + + b1.Property("AGD") + .HasColumnType("int"); + + b1.Property("AGO") + .HasColumnType("int"); + + b1.Property("ETPR") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("ETSEC") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("MEVAL") + .HasColumnType("int"); + + b1.Property("YOB") + .HasColumnType("int"); + + b1.HasKey("A3Id"); + + b1.ToTable("tbl_A3s"); + + b1.WithOwner() + .HasForeignKey("A3Id"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB3", b1 => + { + b1.Property("A3Id") + .HasColumnType("int"); + + b1.Property("AGD") + .HasColumnType("int"); + + b1.Property("AGO") + .HasColumnType("int"); + + b1.Property("ETPR") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("ETSEC") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("MEVAL") + .HasColumnType("int"); + + b1.Property("YOB") + .HasColumnType("int"); + + b1.HasKey("A3Id"); + + b1.ToTable("tbl_A3s"); + + b1.WithOwner() + .HasForeignKey("A3Id"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB4", b1 => + { + b1.Property("A3Id") + .HasColumnType("int"); + + b1.Property("AGD") + .HasColumnType("int"); + + b1.Property("AGO") + .HasColumnType("int"); + + b1.Property("ETPR") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("ETSEC") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("MEVAL") + .HasColumnType("int"); + + b1.Property("YOB") + .HasColumnType("int"); + + b1.HasKey("A3Id"); + + b1.ToTable("tbl_A3s"); + + b1.WithOwner() + .HasForeignKey("A3Id"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB5", b1 => + { + b1.Property("A3Id") + .HasColumnType("int"); + + b1.Property("AGD") + .HasColumnType("int"); + + b1.Property("AGO") + .HasColumnType("int"); + + b1.Property("ETPR") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("ETSEC") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("MEVAL") + .HasColumnType("int"); + + b1.Property("YOB") + .HasColumnType("int"); + + b1.HasKey("A3Id"); + + b1.ToTable("tbl_A3s"); + + b1.WithOwner() + .HasForeignKey("A3Id"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB6", b1 => + { + b1.Property("A3Id") + .HasColumnType("int"); + + b1.Property("AGD") + .HasColumnType("int"); + + b1.Property("AGO") + .HasColumnType("int"); + + b1.Property("ETPR") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("ETSEC") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("MEVAL") + .HasColumnType("int"); + + b1.Property("YOB") + .HasColumnType("int"); + + b1.HasKey("A3Id"); + + b1.ToTable("tbl_A3s"); + + b1.WithOwner() + .HasForeignKey("A3Id"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB7", b1 => + { + b1.Property("A3Id") + .HasColumnType("int"); + + b1.Property("AGD") + .HasColumnType("int"); + + b1.Property("AGO") + .HasColumnType("int"); + + b1.Property("ETPR") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("ETSEC") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("MEVAL") + .HasColumnType("int"); + + b1.Property("YOB") + .HasColumnType("int"); + + b1.HasKey("A3Id"); + + b1.ToTable("tbl_A3s"); + + b1.WithOwner() + .HasForeignKey("A3Id"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB8", b1 => + { + b1.Property("A3Id") + .HasColumnType("int"); + + b1.Property("AGD") + .HasColumnType("int"); + + b1.Property("AGO") + .HasColumnType("int"); + + b1.Property("ETPR") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("ETSEC") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("MEVAL") + .HasColumnType("int"); + + b1.Property("YOB") + .HasColumnType("int"); + + b1.HasKey("A3Id"); + + b1.ToTable("tbl_A3s"); + + b1.WithOwner() + .HasForeignKey("A3Id"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB9", b1 => + { + b1.Property("A3Id") + .HasColumnType("int"); + + b1.Property("AGD") + .HasColumnType("int"); + + b1.Property("AGO") + .HasColumnType("int"); + + b1.Property("ETPR") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("ETSEC") + .HasMaxLength(2) + .HasColumnType("nvarchar(2)"); + + b1.Property("MEVAL") + .HasColumnType("int"); + + b1.Property("YOB") + .HasColumnType("int"); + + b1.HasKey("A3Id"); + + b1.ToTable("tbl_A3s"); + + b1.WithOwner() + .HasForeignKey("A3Id"); + }); + + b.Navigation("KID1") + .IsRequired(); + + b.Navigation("KID10") + .IsRequired(); + + b.Navigation("KID11") + .IsRequired(); + + b.Navigation("KID12") + .IsRequired(); + + b.Navigation("KID13") + .IsRequired(); + + b.Navigation("KID14") + .IsRequired(); + + b.Navigation("KID15") + .IsRequired(); + + b.Navigation("KID2") + .IsRequired(); + + b.Navigation("KID3") + .IsRequired(); + + b.Navigation("KID4") + .IsRequired(); + + b.Navigation("KID5") + .IsRequired(); + + b.Navigation("KID6") + .IsRequired(); + + b.Navigation("KID7") + .IsRequired(); + + b.Navigation("KID8") + .IsRequired(); + + b.Navigation("KID9") + .IsRequired(); + + b.Navigation("SIB1") + .IsRequired(); + + b.Navigation("SIB10") + .IsRequired(); + + b.Navigation("SIB11") + .IsRequired(); + + b.Navigation("SIB12") + .IsRequired(); + + b.Navigation("SIB13") + .IsRequired(); + + b.Navigation("SIB14") + .IsRequired(); + + b.Navigation("SIB15") + .IsRequired(); + + b.Navigation("SIB16") + .IsRequired(); + + b.Navigation("SIB17") + .IsRequired(); + + b.Navigation("SIB18") + .IsRequired(); + + b.Navigation("SIB19") + .IsRequired(); + + b.Navigation("SIB2") + .IsRequired(); + + b.Navigation("SIB20") + .IsRequired(); + + b.Navigation("SIB3") + .IsRequired(); + + b.Navigation("SIB4") + .IsRequired(); + + b.Navigation("SIB5") + .IsRequired(); + + b.Navigation("SIB6") + .IsRequired(); + + b.Navigation("SIB7") + .IsRequired(); + + b.Navigation("SIB8") + .IsRequired(); + + b.Navigation("SIB9") + .IsRequired(); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.A4", b => + { + b.HasOne("UDS.Net.API.Entities.Visit", null) + .WithOne("A4") + .HasForeignKey("UDS.Net.API.Entities.A4", "VisitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID1", b1 => + { + b1.Property("A4Id") + .HasColumnType("int"); + + b1.Property("RxNormId") + .HasColumnType("int"); + + b1.HasKey("A4Id"); + + b1.HasIndex("RxNormId"); + + b1.ToTable("tbl_A4s"); + + b1.WithOwner() + .HasForeignKey("A4Id"); + + b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") + .WithMany() + .HasForeignKey("RxNormId"); + + b1.Navigation("DrugCode"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID10", b1 => + { + b1.Property("A4Id") + .HasColumnType("int"); + + b1.Property("RxNormId") + .HasColumnType("int"); + + b1.HasKey("A4Id"); + + b1.HasIndex("RxNormId"); + + b1.ToTable("tbl_A4s"); + + b1.WithOwner() + .HasForeignKey("A4Id"); + + b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") + .WithMany() + .HasForeignKey("RxNormId"); + + b1.Navigation("DrugCode"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID11", b1 => + { + b1.Property("A4Id") + .HasColumnType("int"); + + b1.Property("RxNormId") + .HasColumnType("int"); + + b1.HasKey("A4Id"); + + b1.HasIndex("RxNormId"); + + b1.ToTable("tbl_A4s"); + + b1.WithOwner() + .HasForeignKey("A4Id"); + + b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") + .WithMany() + .HasForeignKey("RxNormId"); + + b1.Navigation("DrugCode"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID12", b1 => + { + b1.Property("A4Id") + .HasColumnType("int"); + + b1.Property("RxNormId") + .HasColumnType("int"); + + b1.HasKey("A4Id"); + + b1.HasIndex("RxNormId"); + + b1.ToTable("tbl_A4s"); + + b1.WithOwner() + .HasForeignKey("A4Id"); + + b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") + .WithMany() + .HasForeignKey("RxNormId"); + + b1.Navigation("DrugCode"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID13", b1 => + { + b1.Property("A4Id") + .HasColumnType("int"); + + b1.Property("RxNormId") + .HasColumnType("int"); + + b1.HasKey("A4Id"); + + b1.HasIndex("RxNormId"); + + b1.ToTable("tbl_A4s"); + + b1.WithOwner() + .HasForeignKey("A4Id"); + + b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") + .WithMany() + .HasForeignKey("RxNormId"); + + b1.Navigation("DrugCode"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID14", b1 => + { + b1.Property("A4Id") + .HasColumnType("int"); + + b1.Property("RxNormId") + .HasColumnType("int"); + + b1.HasKey("A4Id"); + + b1.HasIndex("RxNormId"); + + b1.ToTable("tbl_A4s"); + + b1.WithOwner() + .HasForeignKey("A4Id"); + + b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") + .WithMany() + .HasForeignKey("RxNormId"); + + b1.Navigation("DrugCode"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID15", b1 => + { + b1.Property("A4Id") + .HasColumnType("int"); + + b1.Property("RxNormId") + .HasColumnType("int"); + + b1.HasKey("A4Id"); + + b1.HasIndex("RxNormId"); + + b1.ToTable("tbl_A4s"); + + b1.WithOwner() + .HasForeignKey("A4Id"); + + b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") + .WithMany() + .HasForeignKey("RxNormId"); + + b1.Navigation("DrugCode"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID16", b1 => + { + b1.Property("A4Id") + .HasColumnType("int"); + + b1.Property("RxNormId") + .HasColumnType("int"); + + b1.HasKey("A4Id"); + + b1.HasIndex("RxNormId"); + + b1.ToTable("tbl_A4s"); + + b1.WithOwner() + .HasForeignKey("A4Id"); + + b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") + .WithMany() + .HasForeignKey("RxNormId"); + + b1.Navigation("DrugCode"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID17", b1 => + { + b1.Property("A4Id") + .HasColumnType("int"); + + b1.Property("RxNormId") + .HasColumnType("int"); + + b1.HasKey("A4Id"); + + b1.HasIndex("RxNormId"); + + b1.ToTable("tbl_A4s"); + + b1.WithOwner() + .HasForeignKey("A4Id"); + + b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") + .WithMany() + .HasForeignKey("RxNormId"); + + b1.Navigation("DrugCode"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID18", b1 => + { + b1.Property("A4Id") + .HasColumnType("int"); + + b1.Property("RxNormId") + .HasColumnType("int"); + + b1.HasKey("A4Id"); + + b1.HasIndex("RxNormId"); + + b1.ToTable("tbl_A4s"); + + b1.WithOwner() + .HasForeignKey("A4Id"); + + b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") + .WithMany() + .HasForeignKey("RxNormId"); + + b1.Navigation("DrugCode"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID19", b1 => + { + b1.Property("A4Id") + .HasColumnType("int"); + + b1.Property("RxNormId") + .HasColumnType("int"); + + b1.HasKey("A4Id"); + + b1.HasIndex("RxNormId"); + + b1.ToTable("tbl_A4s"); + + b1.WithOwner() + .HasForeignKey("A4Id"); + + b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") + .WithMany() + .HasForeignKey("RxNormId"); + + b1.Navigation("DrugCode"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID2", b1 => + { + b1.Property("A4Id") + .HasColumnType("int"); + + b1.Property("RxNormId") + .HasColumnType("int"); + + b1.HasKey("A4Id"); + + b1.HasIndex("RxNormId"); + + b1.ToTable("tbl_A4s"); + + b1.WithOwner() + .HasForeignKey("A4Id"); + + b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") + .WithMany() + .HasForeignKey("RxNormId"); + + b1.Navigation("DrugCode"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID20", b1 => + { + b1.Property("A4Id") + .HasColumnType("int"); + + b1.Property("RxNormId") + .HasColumnType("int"); + + b1.HasKey("A4Id"); + + b1.HasIndex("RxNormId"); + + b1.ToTable("tbl_A4s"); + + b1.WithOwner() + .HasForeignKey("A4Id"); + + b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") + .WithMany() + .HasForeignKey("RxNormId"); + + b1.Navigation("DrugCode"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID21", b1 => + { + b1.Property("A4Id") + .HasColumnType("int"); + + b1.Property("RxNormId") + .HasColumnType("int"); + + b1.HasKey("A4Id"); + + b1.HasIndex("RxNormId"); + + b1.ToTable("tbl_A4s"); + + b1.WithOwner() + .HasForeignKey("A4Id"); + + b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") + .WithMany() + .HasForeignKey("RxNormId"); + + b1.Navigation("DrugCode"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID22", b1 => + { + b1.Property("A4Id") + .HasColumnType("int"); + + b1.Property("RxNormId") + .HasColumnType("int"); + + b1.HasKey("A4Id"); + + b1.HasIndex("RxNormId"); + + b1.ToTable("tbl_A4s"); + + b1.WithOwner() + .HasForeignKey("A4Id"); + + b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") + .WithMany() + .HasForeignKey("RxNormId"); + + b1.Navigation("DrugCode"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID23", b1 => + { + b1.Property("A4Id") + .HasColumnType("int"); + + b1.Property("RxNormId") + .HasColumnType("int"); + + b1.HasKey("A4Id"); + + b1.HasIndex("RxNormId"); + + b1.ToTable("tbl_A4s"); + + b1.WithOwner() + .HasForeignKey("A4Id"); + + b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") + .WithMany() + .HasForeignKey("RxNormId"); + + b1.Navigation("DrugCode"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID24", b1 => + { + b1.Property("A4Id") + .HasColumnType("int"); + + b1.Property("RxNormId") + .HasColumnType("int"); + + b1.HasKey("A4Id"); + + b1.HasIndex("RxNormId"); + + b1.ToTable("tbl_A4s"); + + b1.WithOwner() + .HasForeignKey("A4Id"); + + b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") + .WithMany() + .HasForeignKey("RxNormId"); + + b1.Navigation("DrugCode"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID25", b1 => + { + b1.Property("A4Id") + .HasColumnType("int"); + + b1.Property("RxNormId") + .HasColumnType("int"); + + b1.HasKey("A4Id"); + + b1.HasIndex("RxNormId"); + + b1.ToTable("tbl_A4s"); + + b1.WithOwner() + .HasForeignKey("A4Id"); + + b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") + .WithMany() + .HasForeignKey("RxNormId"); + + b1.Navigation("DrugCode"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID26", b1 => + { + b1.Property("A4Id") + .HasColumnType("int"); + + b1.Property("RxNormId") + .HasColumnType("int"); + + b1.HasKey("A4Id"); + + b1.HasIndex("RxNormId"); + + b1.ToTable("tbl_A4s"); + + b1.WithOwner() + .HasForeignKey("A4Id"); + + b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") + .WithMany() + .HasForeignKey("RxNormId"); + + b1.Navigation("DrugCode"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID27", b1 => + { + b1.Property("A4Id") + .HasColumnType("int"); + + b1.Property("RxNormId") + .HasColumnType("int"); + + b1.HasKey("A4Id"); + + b1.HasIndex("RxNormId"); + + b1.ToTable("tbl_A4s"); + + b1.WithOwner() + .HasForeignKey("A4Id"); + + b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") + .WithMany() + .HasForeignKey("RxNormId"); + + b1.Navigation("DrugCode"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID28", b1 => + { + b1.Property("A4Id") + .HasColumnType("int"); + + b1.Property("RxNormId") + .HasColumnType("int"); + + b1.HasKey("A4Id"); + + b1.HasIndex("RxNormId"); + + b1.ToTable("tbl_A4s"); + + b1.WithOwner() + .HasForeignKey("A4Id"); + + b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") + .WithMany() + .HasForeignKey("RxNormId"); + + b1.Navigation("DrugCode"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID29", b1 => + { + b1.Property("A4Id") + .HasColumnType("int"); + + b1.Property("RxNormId") + .HasColumnType("int"); + + b1.HasKey("A4Id"); + + b1.HasIndex("RxNormId"); + + b1.ToTable("tbl_A4s"); + + b1.WithOwner() + .HasForeignKey("A4Id"); + + b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") + .WithMany() + .HasForeignKey("RxNormId"); + + b1.Navigation("DrugCode"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID3", b1 => + { + b1.Property("A4Id") + .HasColumnType("int"); + + b1.Property("RxNormId") + .HasColumnType("int"); + + b1.HasKey("A4Id"); + + b1.HasIndex("RxNormId"); + + b1.ToTable("tbl_A4s"); + + b1.WithOwner() + .HasForeignKey("A4Id"); + + b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") + .WithMany() + .HasForeignKey("RxNormId"); + + b1.Navigation("DrugCode"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID30", b1 => + { + b1.Property("A4Id") + .HasColumnType("int"); + + b1.Property("RxNormId") + .HasColumnType("int"); + + b1.HasKey("A4Id"); + + b1.HasIndex("RxNormId"); + + b1.ToTable("tbl_A4s"); + + b1.WithOwner() + .HasForeignKey("A4Id"); + + b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") + .WithMany() + .HasForeignKey("RxNormId"); + + b1.Navigation("DrugCode"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID31", b1 => + { + b1.Property("A4Id") + .HasColumnType("int"); + + b1.Property("RxNormId") + .HasColumnType("int"); + + b1.HasKey("A4Id"); + + b1.HasIndex("RxNormId"); + + b1.ToTable("tbl_A4s"); + + b1.WithOwner() + .HasForeignKey("A4Id"); + + b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") + .WithMany() + .HasForeignKey("RxNormId"); + + b1.Navigation("DrugCode"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID32", b1 => + { + b1.Property("A4Id") + .HasColumnType("int"); + + b1.Property("RxNormId") + .HasColumnType("int"); + + b1.HasKey("A4Id"); + + b1.HasIndex("RxNormId"); + + b1.ToTable("tbl_A4s"); + + b1.WithOwner() + .HasForeignKey("A4Id"); + + b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") + .WithMany() + .HasForeignKey("RxNormId"); + + b1.Navigation("DrugCode"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID33", b1 => + { + b1.Property("A4Id") + .HasColumnType("int"); + + b1.Property("RxNormId") + .HasColumnType("int"); + + b1.HasKey("A4Id"); + + b1.HasIndex("RxNormId"); + + b1.ToTable("tbl_A4s"); + + b1.WithOwner() + .HasForeignKey("A4Id"); + + b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") + .WithMany() + .HasForeignKey("RxNormId"); + + b1.Navigation("DrugCode"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID34", b1 => + { + b1.Property("A4Id") + .HasColumnType("int"); + + b1.Property("RxNormId") + .HasColumnType("int"); + + b1.HasKey("A4Id"); + + b1.HasIndex("RxNormId"); + + b1.ToTable("tbl_A4s"); + + b1.WithOwner() + .HasForeignKey("A4Id"); + + b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") + .WithMany() + .HasForeignKey("RxNormId"); + + b1.Navigation("DrugCode"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID35", b1 => + { + b1.Property("A4Id") + .HasColumnType("int"); + + b1.Property("RxNormId") + .HasColumnType("int"); + + b1.HasKey("A4Id"); + + b1.HasIndex("RxNormId"); + + b1.ToTable("tbl_A4s"); + + b1.WithOwner() + .HasForeignKey("A4Id"); + + b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") + .WithMany() + .HasForeignKey("RxNormId"); + + b1.Navigation("DrugCode"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID36", b1 => + { + b1.Property("A4Id") + .HasColumnType("int"); + + b1.Property("RxNormId") + .HasColumnType("int"); + + b1.HasKey("A4Id"); + + b1.HasIndex("RxNormId"); + + b1.ToTable("tbl_A4s"); + + b1.WithOwner() + .HasForeignKey("A4Id"); + + b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") + .WithMany() + .HasForeignKey("RxNormId"); + + b1.Navigation("DrugCode"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID37", b1 => + { + b1.Property("A4Id") + .HasColumnType("int"); + + b1.Property("RxNormId") + .HasColumnType("int"); + + b1.HasKey("A4Id"); + + b1.HasIndex("RxNormId"); + + b1.ToTable("tbl_A4s"); + + b1.WithOwner() + .HasForeignKey("A4Id"); + + b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") + .WithMany() + .HasForeignKey("RxNormId"); + + b1.Navigation("DrugCode"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID38", b1 => + { + b1.Property("A4Id") + .HasColumnType("int"); + + b1.Property("RxNormId") + .HasColumnType("int"); + + b1.HasKey("A4Id"); + + b1.HasIndex("RxNormId"); + + b1.ToTable("tbl_A4s"); + + b1.WithOwner() + .HasForeignKey("A4Id"); + + b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") + .WithMany() + .HasForeignKey("RxNormId"); + + b1.Navigation("DrugCode"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID39", b1 => + { + b1.Property("A4Id") + .HasColumnType("int"); + + b1.Property("RxNormId") + .HasColumnType("int"); + + b1.HasKey("A4Id"); + + b1.HasIndex("RxNormId"); + + b1.ToTable("tbl_A4s"); + + b1.WithOwner() + .HasForeignKey("A4Id"); + + b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") + .WithMany() + .HasForeignKey("RxNormId"); + + b1.Navigation("DrugCode"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID4", b1 => + { + b1.Property("A4Id") + .HasColumnType("int"); + + b1.Property("RxNormId") + .HasColumnType("int"); + + b1.HasKey("A4Id"); + + b1.HasIndex("RxNormId"); + + b1.ToTable("tbl_A4s"); + + b1.WithOwner() + .HasForeignKey("A4Id"); + + b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") + .WithMany() + .HasForeignKey("RxNormId"); + + b1.Navigation("DrugCode"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID40", b1 => + { + b1.Property("A4Id") + .HasColumnType("int"); + + b1.Property("RxNormId") + .HasColumnType("int"); + + b1.HasKey("A4Id"); + + b1.HasIndex("RxNormId"); + + b1.ToTable("tbl_A4s"); + + b1.WithOwner() + .HasForeignKey("A4Id"); + + b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") + .WithMany() + .HasForeignKey("RxNormId"); + + b1.Navigation("DrugCode"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID5", b1 => + { + b1.Property("A4Id") + .HasColumnType("int"); + + b1.Property("RxNormId") + .HasColumnType("int"); + + b1.HasKey("A4Id"); + + b1.HasIndex("RxNormId"); + + b1.ToTable("tbl_A4s"); + + b1.WithOwner() + .HasForeignKey("A4Id"); + + b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") + .WithMany() + .HasForeignKey("RxNormId"); + + b1.Navigation("DrugCode"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID6", b1 => + { + b1.Property("A4Id") + .HasColumnType("int"); + + b1.Property("RxNormId") + .HasColumnType("int"); + + b1.HasKey("A4Id"); + + b1.HasIndex("RxNormId"); + + b1.ToTable("tbl_A4s"); + + b1.WithOwner() + .HasForeignKey("A4Id"); + + b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") + .WithMany() + .HasForeignKey("RxNormId"); + + b1.Navigation("DrugCode"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID7", b1 => + { + b1.Property("A4Id") + .HasColumnType("int"); + + b1.Property("RxNormId") + .HasColumnType("int"); + + b1.HasKey("A4Id"); + + b1.HasIndex("RxNormId"); + + b1.ToTable("tbl_A4s"); + + b1.WithOwner() + .HasForeignKey("A4Id"); + + b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") + .WithMany() + .HasForeignKey("RxNormId"); + + b1.Navigation("DrugCode"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID8", b1 => + { + b1.Property("A4Id") + .HasColumnType("int"); + + b1.Property("RxNormId") + .HasColumnType("int"); + + b1.HasKey("A4Id"); + + b1.HasIndex("RxNormId"); + + b1.ToTable("tbl_A4s"); + + b1.WithOwner() + .HasForeignKey("A4Id"); + + b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") + .WithMany() + .HasForeignKey("RxNormId"); + + b1.Navigation("DrugCode"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID9", b1 => + { + b1.Property("A4Id") + .HasColumnType("int"); + + b1.Property("RxNormId") + .HasColumnType("int"); + + b1.HasKey("A4Id"); + + b1.HasIndex("RxNormId"); + + b1.ToTable("tbl_A4s"); + + b1.WithOwner() + .HasForeignKey("A4Id"); + + b1.HasOne("UDS.Net.API.Entities.DrugCodeLookup", "DrugCode") + .WithMany() + .HasForeignKey("RxNormId"); + + b1.Navigation("DrugCode"); + }); + + b.Navigation("RXNORMID1") + .IsRequired(); + + b.Navigation("RXNORMID10") + .IsRequired(); + + b.Navigation("RXNORMID11") + .IsRequired(); + + b.Navigation("RXNORMID12") + .IsRequired(); + + b.Navigation("RXNORMID13") + .IsRequired(); + + b.Navigation("RXNORMID14") + .IsRequired(); + + b.Navigation("RXNORMID15") + .IsRequired(); + + b.Navigation("RXNORMID16") + .IsRequired(); + + b.Navigation("RXNORMID17") + .IsRequired(); + + b.Navigation("RXNORMID18") + .IsRequired(); + + b.Navigation("RXNORMID19") + .IsRequired(); + + b.Navigation("RXNORMID2") + .IsRequired(); + + b.Navigation("RXNORMID20") + .IsRequired(); + + b.Navigation("RXNORMID21") + .IsRequired(); + + b.Navigation("RXNORMID22") + .IsRequired(); + + b.Navigation("RXNORMID23") + .IsRequired(); + + b.Navigation("RXNORMID24") + .IsRequired(); + + b.Navigation("RXNORMID25") + .IsRequired(); + + b.Navigation("RXNORMID26") + .IsRequired(); + + b.Navigation("RXNORMID27") + .IsRequired(); + + b.Navigation("RXNORMID28") + .IsRequired(); + + b.Navigation("RXNORMID29") + .IsRequired(); + + b.Navigation("RXNORMID3") + .IsRequired(); + + b.Navigation("RXNORMID30") + .IsRequired(); + + b.Navigation("RXNORMID31") + .IsRequired(); + + b.Navigation("RXNORMID32") + .IsRequired(); + + b.Navigation("RXNORMID33") + .IsRequired(); + + b.Navigation("RXNORMID34") + .IsRequired(); + + b.Navigation("RXNORMID35") + .IsRequired(); + + b.Navigation("RXNORMID36") + .IsRequired(); + + b.Navigation("RXNORMID37") + .IsRequired(); + + b.Navigation("RXNORMID38") + .IsRequired(); + + b.Navigation("RXNORMID39") + .IsRequired(); + + b.Navigation("RXNORMID4") + .IsRequired(); + + b.Navigation("RXNORMID40") + .IsRequired(); + + b.Navigation("RXNORMID5") + .IsRequired(); + + b.Navigation("RXNORMID6") + .IsRequired(); + + b.Navigation("RXNORMID7") + .IsRequired(); + + b.Navigation("RXNORMID8") + .IsRequired(); + + b.Navigation("RXNORMID9") + .IsRequired(); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.A4a", b => + { + b.HasOne("UDS.Net.API.Entities.Visit", null) + .WithOne("A4a") + .HasForeignKey("UDS.Net.API.Entities.A4a", "VisitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.OwnsOne("UDS.Net.API.Entities.A4aTreatment", "Treatment1", b1 => + { + b1.Property("A4aId") + .HasColumnType("int"); + + b1.Property("CARETRIAL") + .HasColumnType("int") + .HasColumnName("CARETRIAL1"); + + b1.Property("ENDMO") + .HasColumnType("int") + .HasColumnName("ENDMO1"); + + b1.Property("ENDYEAR") + .HasColumnType("int") + .HasColumnName("ENDYEAR1"); + + b1.Property("NCTNUM") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasColumnName("NCTNUM1"); + + b1.Property("STARTMO") + .HasColumnType("int") + .HasColumnName("STARTMO1"); + + b1.Property("STARTYEAR") + .HasColumnType("int") + .HasColumnName("STARTYEAR1"); + + b1.Property("TARGETAB") + .HasColumnType("bit") + .HasColumnName("TARGETAB1"); + + b1.Property("TARGETINF") + .HasColumnType("bit") + .HasColumnName("TARGETINF1"); + + b1.Property("TARGETOTH") + .HasColumnType("bit") + .HasColumnName("TARGETOTH1"); + + b1.Property("TARGETOTX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasColumnName("TARGETOTX1"); + + b1.Property("TARGETSYN") + .HasColumnType("bit") + .HasColumnName("TARGETSYN1"); + + b1.Property("TARGETTAU") + .HasColumnType("bit") + .HasColumnName("TARGETTAU1"); + + b1.Property("TRIALGRP") + .HasColumnType("int") + .HasColumnName("TRIALGRP1"); + + b1.Property("TRTTRIAL") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasColumnName("TRTTRIAL1"); + + b1.HasKey("A4aId"); + + b1.ToTable("tbl_A4as"); + + b1.WithOwner() + .HasForeignKey("A4aId"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4aTreatment", "Treatment2", b1 => + { + b1.Property("A4aId") + .HasColumnType("int"); + + b1.Property("CARETRIAL") + .HasColumnType("int") + .HasColumnName("CARETRIAL2"); + + b1.Property("ENDMO") + .HasColumnType("int") + .HasColumnName("ENDMO2"); + + b1.Property("ENDYEAR") + .HasColumnType("int") + .HasColumnName("ENDYEAR2"); + + b1.Property("NCTNUM") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasColumnName("NCTNUM2"); + + b1.Property("STARTMO") + .HasColumnType("int") + .HasColumnName("STARTMO2"); + + b1.Property("STARTYEAR") + .HasColumnType("int") + .HasColumnName("STARTYEAR2"); + + b1.Property("TARGETAB") + .HasColumnType("bit") + .HasColumnName("TARGETAB2"); + + b1.Property("TARGETINF") + .HasColumnType("bit") + .HasColumnName("TARGETINF2"); + + b1.Property("TARGETOTH") + .HasColumnType("bit") + .HasColumnName("TARGETOTH2"); + + b1.Property("TARGETOTX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasColumnName("TARGETOTX2"); + + b1.Property("TARGETSYN") + .HasColumnType("bit") + .HasColumnName("TARGETSYN2"); + + b1.Property("TARGETTAU") + .HasColumnType("bit") + .HasColumnName("TARGETTAU2"); + + b1.Property("TRIALGRP") + .HasColumnType("int") + .HasColumnName("TRIALGRP2"); + + b1.Property("TRTTRIAL") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasColumnName("TRTTRIAL2"); + + b1.HasKey("A4aId"); + + b1.ToTable("tbl_A4as"); + + b1.WithOwner() + .HasForeignKey("A4aId"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4aTreatment", "Treatment3", b1 => + { + b1.Property("A4aId") + .HasColumnType("int"); + + b1.Property("CARETRIAL") + .HasColumnType("int") + .HasColumnName("CARETRIAL3"); + + b1.Property("ENDMO") + .HasColumnType("int") + .HasColumnName("ENDMO3"); + + b1.Property("ENDYEAR") + .HasColumnType("int") + .HasColumnName("ENDYEAR3"); + + b1.Property("NCTNUM") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasColumnName("NCTNUM3"); + + b1.Property("STARTMO") + .HasColumnType("int") + .HasColumnName("STARTMO3"); + + b1.Property("STARTYEAR") + .HasColumnType("int") + .HasColumnName("STARTYEAR3"); + + b1.Property("TARGETAB") + .HasColumnType("bit") + .HasColumnName("TARGETAB3"); + + b1.Property("TARGETINF") + .HasColumnType("bit") + .HasColumnName("TARGETINF3"); + + b1.Property("TARGETOTH") + .HasColumnType("bit") + .HasColumnName("TARGETOTH3"); + + b1.Property("TARGETOTX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasColumnName("TARGETOTX3"); + + b1.Property("TARGETSYN") + .HasColumnType("bit") + .HasColumnName("TARGETSYN3"); + + b1.Property("TARGETTAU") + .HasColumnType("bit") + .HasColumnName("TARGETTAU3"); + + b1.Property("TRIALGRP") + .HasColumnType("int") + .HasColumnName("TRIALGRP3"); + + b1.Property("TRTTRIAL") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasColumnName("TRTTRIAL3"); + + b1.HasKey("A4aId"); + + b1.ToTable("tbl_A4as"); + + b1.WithOwner() + .HasForeignKey("A4aId"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4aTreatment", "Treatment4", b1 => + { + b1.Property("A4aId") + .HasColumnType("int"); + + b1.Property("CARETRIAL") + .HasColumnType("int") + .HasColumnName("CARETRIAL4"); + + b1.Property("ENDMO") + .HasColumnType("int") + .HasColumnName("ENDMO4"); + + b1.Property("ENDYEAR") + .HasColumnType("int") + .HasColumnName("ENDYEAR4"); + + b1.Property("NCTNUM") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasColumnName("NCTNUM4"); + + b1.Property("STARTMO") + .HasColumnType("int") + .HasColumnName("STARTMO4"); + + b1.Property("STARTYEAR") + .HasColumnType("int") + .HasColumnName("STARTYEAR4"); + + b1.Property("TARGETAB") + .HasColumnType("bit") + .HasColumnName("TARGETAB4"); + + b1.Property("TARGETINF") + .HasColumnType("bit") + .HasColumnName("TARGETINF4"); + + b1.Property("TARGETOTH") + .HasColumnType("bit") + .HasColumnName("TARGETOTH4"); + + b1.Property("TARGETOTX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasColumnName("TARGETOTX4"); + + b1.Property("TARGETSYN") + .HasColumnType("bit") + .HasColumnName("TARGETSYN4"); + + b1.Property("TARGETTAU") + .HasColumnType("bit") + .HasColumnName("TARGETTAU4"); + + b1.Property("TRIALGRP") + .HasColumnType("int") + .HasColumnName("TRIALGRP4"); + + b1.Property("TRTTRIAL") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasColumnName("TRTTRIAL4"); + + b1.HasKey("A4aId"); + + b1.ToTable("tbl_A4as"); + + b1.WithOwner() + .HasForeignKey("A4aId"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4aTreatment", "Treatment5", b1 => + { + b1.Property("A4aId") + .HasColumnType("int"); + + b1.Property("CARETRIAL") + .HasColumnType("int") + .HasColumnName("CARETRIAL5"); + + b1.Property("ENDMO") + .HasColumnType("int") + .HasColumnName("ENDMO5"); + + b1.Property("ENDYEAR") + .HasColumnType("int") + .HasColumnName("ENDYEAR5"); + + b1.Property("NCTNUM") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasColumnName("NCTNUM5"); + + b1.Property("STARTMO") + .HasColumnType("int") + .HasColumnName("STARTMO5"); + + b1.Property("STARTYEAR") + .HasColumnType("int") + .HasColumnName("STARTYEAR5"); + + b1.Property("TARGETAB") + .HasColumnType("bit") + .HasColumnName("TARGETAB5"); + + b1.Property("TARGETINF") + .HasColumnType("bit") + .HasColumnName("TARGETINF5"); + + b1.Property("TARGETOTH") + .HasColumnType("bit") + .HasColumnName("TARGETOTH5"); + + b1.Property("TARGETOTX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasColumnName("TARGETOTX5"); + + b1.Property("TARGETSYN") + .HasColumnType("bit") + .HasColumnName("TARGETSYN5"); + + b1.Property("TARGETTAU") + .HasColumnType("bit") + .HasColumnName("TARGETTAU5"); + + b1.Property("TRIALGRP") + .HasColumnType("int") + .HasColumnName("TRIALGRP5"); + + b1.Property("TRTTRIAL") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasColumnName("TRTTRIAL5"); + + b1.HasKey("A4aId"); + + b1.ToTable("tbl_A4as"); + + b1.WithOwner() + .HasForeignKey("A4aId"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4aTreatment", "Treatment6", b1 => + { + b1.Property("A4aId") + .HasColumnType("int"); + + b1.Property("CARETRIAL") + .HasColumnType("int") + .HasColumnName("CARETRIAL6"); + + b1.Property("ENDMO") + .HasColumnType("int") + .HasColumnName("ENDMO6"); + + b1.Property("ENDYEAR") + .HasColumnType("int") + .HasColumnName("ENDYEAR6"); + + b1.Property("NCTNUM") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasColumnName("NCTNUM6"); + + b1.Property("STARTMO") + .HasColumnType("int") + .HasColumnName("STARTMO6"); + + b1.Property("STARTYEAR") + .HasColumnType("int") + .HasColumnName("STARTYEAR6"); + + b1.Property("TARGETAB") + .HasColumnType("bit") + .HasColumnName("TARGETAB6"); + + b1.Property("TARGETINF") + .HasColumnType("bit") + .HasColumnName("TARGETINF6"); + + b1.Property("TARGETOTH") + .HasColumnType("bit") + .HasColumnName("TARGETOTH6"); + + b1.Property("TARGETOTX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasColumnName("TARGETOTX6"); + + b1.Property("TARGETSYN") + .HasColumnType("bit") + .HasColumnName("TARGETSYN6"); + + b1.Property("TARGETTAU") + .HasColumnType("bit") + .HasColumnName("TARGETTAU6"); + + b1.Property("TRIALGRP") + .HasColumnType("int") + .HasColumnName("TRIALGRP6"); + + b1.Property("TRTTRIAL") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasColumnName("TRTTRIAL6"); + + b1.HasKey("A4aId"); + + b1.ToTable("tbl_A4as"); + + b1.WithOwner() + .HasForeignKey("A4aId"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4aTreatment", "Treatment7", b1 => + { + b1.Property("A4aId") + .HasColumnType("int"); + + b1.Property("CARETRIAL") + .HasColumnType("int") + .HasColumnName("CARETRIAL7"); + + b1.Property("ENDMO") + .HasColumnType("int") + .HasColumnName("ENDMO7"); + + b1.Property("ENDYEAR") + .HasColumnType("int") + .HasColumnName("ENDYEAR7"); + + b1.Property("NCTNUM") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasColumnName("NCTNUM7"); + + b1.Property("STARTMO") + .HasColumnType("int") + .HasColumnName("STARTMO7"); + + b1.Property("STARTYEAR") + .HasColumnType("int") + .HasColumnName("STARTYEAR7"); + + b1.Property("TARGETAB") + .HasColumnType("bit") + .HasColumnName("TARGETAB7"); + + b1.Property("TARGETINF") + .HasColumnType("bit") + .HasColumnName("TARGETINF7"); + + b1.Property("TARGETOTH") + .HasColumnType("bit") + .HasColumnName("TARGETOTH7"); + + b1.Property("TARGETOTX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasColumnName("TARGETOTX7"); + + b1.Property("TARGETSYN") + .HasColumnType("bit") + .HasColumnName("TARGETSYN7"); + + b1.Property("TARGETTAU") + .HasColumnType("bit") + .HasColumnName("TARGETTAU7"); + + b1.Property("TRIALGRP") + .HasColumnType("int") + .HasColumnName("TRIALGRP7"); + + b1.Property("TRTTRIAL") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasColumnName("TRTTRIAL7"); + + b1.HasKey("A4aId"); + + b1.ToTable("tbl_A4as"); + + b1.WithOwner() + .HasForeignKey("A4aId"); + }); + + b.OwnsOne("UDS.Net.API.Entities.A4aTreatment", "Treatment8", b1 => + { + b1.Property("A4aId") + .HasColumnType("int"); + + b1.Property("CARETRIAL") + .HasColumnType("int") + .HasColumnName("CARETRIAL8"); + + b1.Property("ENDMO") + .HasColumnType("int") + .HasColumnName("ENDMO8"); + + b1.Property("ENDYEAR") + .HasColumnType("int") + .HasColumnName("ENDYEAR8"); + + b1.Property("NCTNUM") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasColumnName("NCTNUM8"); + + b1.Property("STARTMO") + .HasColumnType("int") + .HasColumnName("STARTMO8"); + + b1.Property("STARTYEAR") + .HasColumnType("int") + .HasColumnName("STARTYEAR8"); + + b1.Property("TARGETAB") + .HasColumnType("bit") + .HasColumnName("TARGETAB8"); + + b1.Property("TARGETINF") + .HasColumnType("bit") + .HasColumnName("TARGETINF8"); + + b1.Property("TARGETOTH") + .HasColumnType("bit") + .HasColumnName("TARGETOTH8"); + + b1.Property("TARGETOTX") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasColumnName("TARGETOTX8"); + + b1.Property("TARGETSYN") + .HasColumnType("bit") + .HasColumnName("TARGETSYN8"); + + b1.Property("TARGETTAU") + .HasColumnType("bit") + .HasColumnName("TARGETTAU8"); + + b1.Property("TRIALGRP") + .HasColumnType("int") + .HasColumnName("TRIALGRP8"); + + b1.Property("TRTTRIAL") + .HasMaxLength(60) + .HasColumnType("nvarchar(60)") + .HasColumnName("TRTTRIAL8"); + + b1.HasKey("A4aId"); + + b1.ToTable("tbl_A4as"); + + b1.WithOwner() + .HasForeignKey("A4aId"); + }); + + b.Navigation("Treatment1") + .IsRequired(); + + b.Navigation("Treatment2") + .IsRequired(); + + b.Navigation("Treatment3") + .IsRequired(); + + b.Navigation("Treatment4") + .IsRequired(); + + b.Navigation("Treatment5") + .IsRequired(); + + b.Navigation("Treatment6") + .IsRequired(); + + b.Navigation("Treatment7") + .IsRequired(); + + b.Navigation("Treatment8") + .IsRequired(); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.A5D2", b => + { + b.HasOne("UDS.Net.API.Entities.Visit", null) + .WithOne("A5D2") + .HasForeignKey("UDS.Net.API.Entities.A5D2", "VisitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.B1", b => + { + b.HasOne("UDS.Net.API.Entities.Visit", null) + .WithOne("B1") + .HasForeignKey("UDS.Net.API.Entities.B1", "VisitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.B3", b => + { + b.HasOne("UDS.Net.API.Entities.Visit", null) + .WithOne("B3") + .HasForeignKey("UDS.Net.API.Entities.B3", "VisitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.B4", b => + { + b.HasOne("UDS.Net.API.Entities.Visit", null) + .WithOne("B4") + .HasForeignKey("UDS.Net.API.Entities.B4", "VisitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.B5", b => + { + b.HasOne("UDS.Net.API.Entities.Visit", null) + .WithOne("B5") + .HasForeignKey("UDS.Net.API.Entities.B5", "VisitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.B6", b => + { + b.HasOne("UDS.Net.API.Entities.Visit", null) + .WithOne("B6") + .HasForeignKey("UDS.Net.API.Entities.B6", "VisitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.B7", b => + { + b.HasOne("UDS.Net.API.Entities.Visit", null) + .WithOne("B7") + .HasForeignKey("UDS.Net.API.Entities.B7", "VisitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.B8", b => + { + b.HasOne("UDS.Net.API.Entities.Visit", null) + .WithOne("B8") + .HasForeignKey("UDS.Net.API.Entities.B8", "VisitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.B9", b => + { + b.HasOne("UDS.Net.API.Entities.Visit", null) + .WithOne("B9") + .HasForeignKey("UDS.Net.API.Entities.B9", "VisitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.C1", b => + { + b.HasOne("UDS.Net.API.Entities.Visit", null) + .WithOne("C1") + .HasForeignKey("UDS.Net.API.Entities.C1", "VisitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.C2", b => + { + b.HasOne("UDS.Net.API.Entities.Visit", null) + .WithOne("C2") + .HasForeignKey("UDS.Net.API.Entities.C2", "VisitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.D1a", b => + { + b.HasOne("UDS.Net.API.Entities.Visit", null) + .WithOne("D1a") + .HasForeignKey("UDS.Net.API.Entities.D1a", "VisitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.D1b", b => + { + b.HasOne("UDS.Net.API.Entities.Visit", null) + .WithOne("D1b") + .HasForeignKey("UDS.Net.API.Entities.D1b", "VisitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.FormStatus", b => + { + b.HasOne("UDS.Net.API.Entities.Visit", null) + .WithMany("FormStatuses") + .HasForeignKey("VisitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.M1", b => + { + b.HasOne("UDS.Net.API.Entities.Participation", "Participation") + .WithMany("M1s") + .HasForeignKey("ParticipationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Participation"); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.PacketSubmission", b => + { + b.HasOne("UDS.Net.API.Entities.Visit", "Visit") + .WithMany("PacketSubmissions") + .HasForeignKey("VisitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Visit"); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.PacketSubmissionError", b => + { + b.HasOne("UDS.Net.API.Entities.PacketSubmission", "PacketSubmission") + .WithMany("PacketSubmissionErrors") + .HasForeignKey("PacketSubmissionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("PacketSubmission"); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.T1", b => + { + b.HasOne("UDS.Net.API.Entities.Visit", null) + .WithOne("T1") + .HasForeignKey("UDS.Net.API.Entities.T1", "VisitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.Visit", b => + { + b.HasOne("UDS.Net.API.Entities.Participation", "Participation") + .WithMany("Visits") + .HasForeignKey("ParticipationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Participation"); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.PacketSubmission", b => + { + b.Navigation("PacketSubmissionErrors"); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.Participation", b => + { + b.Navigation("M1s"); + + b.Navigation("Visits"); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.Visit", b => + { + b.Navigation("A1") + .IsRequired(); + + b.Navigation("A1a") + .IsRequired(); + + b.Navigation("A2") + .IsRequired(); + + b.Navigation("A3") + .IsRequired(); + + b.Navigation("A4") + .IsRequired(); + + b.Navigation("A4a") + .IsRequired(); + + b.Navigation("A5D2") + .IsRequired(); + + b.Navigation("B1") + .IsRequired(); + + b.Navigation("B3") + .IsRequired(); + + b.Navigation("B4") + .IsRequired(); + + b.Navigation("B5") + .IsRequired(); + + b.Navigation("B6") + .IsRequired(); + + b.Navigation("B7") + .IsRequired(); + + b.Navigation("B8") + .IsRequired(); + + b.Navigation("B9") + .IsRequired(); + + b.Navigation("C1") + .IsRequired(); + + b.Navigation("C2") + .IsRequired(); + + b.Navigation("D1a") + .IsRequired(); + + b.Navigation("D1b") + .IsRequired(); + + b.Navigation("FormStatuses"); + + b.Navigation("PacketSubmissions"); + + b.Navigation("T1"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/UDS.Net.API/Data/Migrations/20241024113252_SupportPacketSubmission.cs b/src/UDS.Net.API/Data/Migrations/20241024113252_SupportPacketSubmission.cs new file mode 100644 index 0000000..1217078 --- /dev/null +++ b/src/UDS.Net.API/Data/Migrations/20241024113252_SupportPacketSubmission.cs @@ -0,0 +1,101 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace UDS.Net.API.Data.Migrations +{ + /// + public partial class SupportPacketSubmission : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "Status", + table: "tbl_Visits", + type: "int", + nullable: false, + defaultValue: 0); + + migrationBuilder.CreateTable( + name: "PacketSubmissions", + columns: table => new + { + PacketSubmissionId = table.Column(type: "int", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + SubmissionDate = table.Column(type: "datetime2", nullable: false), + VisitId = table.Column(type: "int", nullable: false), + ErrorCount = table.Column(type: "int", nullable: true), + CreatedAt = table.Column(type: "datetime2", nullable: false), + CreatedBy = table.Column(type: "nvarchar(max)", nullable: false), + ModifiedBy = table.Column(type: "nvarchar(max)", nullable: true), + DeletedBy = table.Column(type: "nvarchar(max)", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_PacketSubmissions", x => x.PacketSubmissionId); + table.ForeignKey( + name: "FK_PacketSubmissions_tbl_Visits_VisitId", + column: x => x.VisitId, + principalTable: "tbl_Visits", + principalColumn: "VisitId", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "PacketSubmissionErrors", + columns: table => new + { + PacketSubmissionErrorId = table.Column(type: "int", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + FormKind = table.Column(type: "nvarchar(10)", maxLength: 10, nullable: false), + Message = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: false), + AssignedTo = table.Column(type: "nvarchar(max)", nullable: false), + Level = table.Column(type: "int", nullable: false), + ResolvedBy = table.Column(type: "nvarchar(max)", nullable: false), + PacketSubmissionId = table.Column(type: "int", nullable: false), + CreatedAt = table.Column(type: "datetime2", nullable: false), + CreatedBy = table.Column(type: "nvarchar(max)", nullable: false), + ModifiedBy = table.Column(type: "nvarchar(max)", nullable: true), + DeletedBy = table.Column(type: "nvarchar(max)", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_PacketSubmissionErrors", x => x.PacketSubmissionErrorId); + table.ForeignKey( + name: "FK_PacketSubmissionErrors_PacketSubmissions_PacketSubmissionId", + column: x => x.PacketSubmissionId, + principalTable: "PacketSubmissions", + principalColumn: "PacketSubmissionId", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateIndex( + name: "IX_PacketSubmissionErrors_PacketSubmissionId", + table: "PacketSubmissionErrors", + column: "PacketSubmissionId"); + + migrationBuilder.CreateIndex( + name: "IX_PacketSubmissions_VisitId", + table: "PacketSubmissions", + column: "VisitId"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "PacketSubmissionErrors"); + + migrationBuilder.DropTable( + name: "PacketSubmissions"); + + migrationBuilder.DropColumn( + name: "Status", + table: "tbl_Visits"); + } + } +} diff --git a/src/UDS.Net.API/Data/Migrations/ApiDbContextModelSnapshot.cs b/src/UDS.Net.API/Data/Migrations/ApiDbContextModelSnapshot.cs index 81e199d..6131018 100644 --- a/src/UDS.Net.API/Data/Migrations/ApiDbContextModelSnapshot.cs +++ b/src/UDS.Net.API/Data/Migrations/ApiDbContextModelSnapshot.cs @@ -17,7 +17,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "7.0.5") + .HasAnnotation("ProductVersion", "8.0.10") .HasAnnotation("Relational:MaxIdentifierLength", 128); SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); @@ -443,7 +443,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("VisitId") .IsUnique(); - b.ToTable("tbl_A1s", (string)null); + b.ToTable("tbl_A1s"); }); modelBuilder.Entity("UDS.Net.API.Entities.A1a", b => @@ -770,7 +770,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("VisitId") .IsUnique(); - b.ToTable("tbl_A1as", (string)null); + b.ToTable("tbl_A1as"); }); modelBuilder.Entity("UDS.Net.API.Entities.A2", b => @@ -888,7 +888,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("VisitId") .IsUnique(); - b.ToTable("tbl_A2s", (string)null); + b.ToTable("tbl_A2s"); }); modelBuilder.Entity("UDS.Net.API.Entities.A3", b => @@ -1027,7 +1027,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("VisitId") .IsUnique(); - b.ToTable("tbl_A3s", (string)null); + b.ToTable("tbl_A3s"); }); modelBuilder.Entity("UDS.Net.API.Entities.A4", b => @@ -1111,7 +1111,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("VisitId") .IsUnique(); - b.ToTable("tbl_A4s", (string)null); + b.ToTable("tbl_A4s"); }); modelBuilder.Entity("UDS.Net.API.Entities.A4a", b => @@ -1211,7 +1211,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("VisitId") .IsUnique(); - b.ToTable("tbl_A4as", (string)null); + b.ToTable("tbl_A4as"); }); modelBuilder.Entity("UDS.Net.API.Entities.A5D2", b => @@ -1968,7 +1968,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("VisitId") .IsUnique(); - b.ToTable("tbl_A5D2s", (string)null); + b.ToTable("tbl_A5D2s"); }); modelBuilder.Entity("UDS.Net.API.Entities.B1", b => @@ -2109,7 +2109,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("VisitId") .IsUnique(); - b.ToTable("tbl_B1s", (string)null); + b.ToTable("tbl_B1s"); }); modelBuilder.Entity("UDS.Net.API.Entities.B3", b => @@ -2385,7 +2385,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("VisitId") .IsUnique(); - b.ToTable("tbl_B3s", (string)null); + b.ToTable("tbl_B3s"); }); modelBuilder.Entity("UDS.Net.API.Entities.B4", b => @@ -2496,7 +2496,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("VisitId") .IsUnique(); - b.ToTable("tbl_B4s", (string)null); + b.ToTable("tbl_B4s"); }); modelBuilder.Entity("UDS.Net.API.Entities.B5", b => @@ -2656,7 +2656,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("VisitId") .IsUnique(); - b.ToTable("tbl_B5s", (string)null); + b.ToTable("tbl_B5s"); }); modelBuilder.Entity("UDS.Net.API.Entities.B6", b => @@ -2788,7 +2788,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("VisitId") .IsUnique(); - b.ToTable("tbl_B6s", (string)null); + b.ToTable("tbl_B6s"); }); modelBuilder.Entity("UDS.Net.API.Entities.B7", b => @@ -2899,7 +2899,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("VisitId") .IsUnique(); - b.ToTable("tbl_B7s", (string)null); + b.ToTable("tbl_B7s"); }); modelBuilder.Entity("UDS.Net.API.Entities.B8", b => @@ -3095,7 +3095,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("VisitId") .IsUnique(); - b.ToTable("tbl_B8s", (string)null); + b.ToTable("tbl_B8s"); }); modelBuilder.Entity("UDS.Net.API.Entities.B9", b => @@ -3471,7 +3471,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("VisitId") .IsUnique(); - b.ToTable("tbl_B9s", (string)null); + b.ToTable("tbl_B9s"); }); modelBuilder.Entity("UDS.Net.API.Entities.C1", b => @@ -3695,7 +3695,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("VisitId") .IsUnique(); - b.ToTable("tbl_C1s", (string)null); + b.ToTable("tbl_C1s"); }); modelBuilder.Entity("UDS.Net.API.Entities.C2", b => @@ -4124,7 +4124,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("VisitId") .IsUnique(); - b.ToTable("tbl_C2s", (string)null); + b.ToTable("tbl_C2s"); }); modelBuilder.Entity("UDS.Net.API.Entities.D1a", b => @@ -4637,7 +4637,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("VisitId") .IsUnique(); - b.ToTable("tbl_D1as", (string)null); + b.ToTable("tbl_D1as"); }); modelBuilder.Entity("UDS.Net.API.Entities.D1b", b => @@ -5119,7 +5119,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("VisitId") .IsUnique(); - b.ToTable("tbl_D1bs", (string)null); + b.ToTable("tbl_D1bs"); }); modelBuilder.Entity("UDS.Net.API.Entities.DrugCodeLookup", b => @@ -5144,7 +5144,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("RxNormId"); - b.ToTable("DrugCodesLookup", (string)null); + b.ToTable("DrugCodesLookup"); }); modelBuilder.Entity("UDS.Net.API.Entities.FormStatus", b => @@ -5350,7 +5350,106 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("ParticipationId"); - b.ToTable("tbl_M1s", (string)null); + b.ToTable("tbl_M1s"); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.PacketSubmission", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("PacketSubmissionId") + .HasColumnOrder(0); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DeletedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("ErrorCount") + .HasColumnType("int"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("ModifiedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("SubmissionDate") + .HasColumnType("datetime2"); + + b.Property("VisitId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("VisitId"); + + b.ToTable("PacketSubmissions"); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.PacketSubmissionError", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasColumnName("PacketSubmissionErrorId") + .HasColumnOrder(0); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("AssignedTo") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("CreatedAt") + .HasColumnType("datetime2"); + + b.Property("CreatedBy") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DeletedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("FormKind") + .IsRequired() + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("IsDeleted") + .HasColumnType("bit"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("Message") + .IsRequired() + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("ModifiedBy") + .HasColumnType("nvarchar(max)"); + + b.Property("PacketSubmissionId") + .HasColumnType("int"); + + b.Property("ResolvedBy") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("PacketSubmissionId"); + + b.ToTable("PacketSubmissionErrors"); }); modelBuilder.Entity("UDS.Net.API.Entities.Participation", b => @@ -5384,7 +5483,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasKey("Id"); - b.ToTable("Participation", (string)null); + b.ToTable("Participation"); }); modelBuilder.Entity("UDS.Net.API.Entities.T1", b => @@ -5496,7 +5595,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("VisitId") .IsUnique(); - b.ToTable("tbl_T1s", (string)null); + b.ToTable("tbl_T1s"); }); modelBuilder.Entity("UDS.Net.API.Entities.Visit", b => @@ -5547,6 +5646,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("ParticipationId") .HasColumnType("int"); + b.Property("Status") + .HasColumnType("int"); + b.Property("VISITNUM") .HasColumnType("int") .HasColumnName("VISITNUM"); @@ -5559,7 +5661,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("ParticipationId", "VISITNUM") .IsUnique(); - b.ToTable("tbl_Visits", (string)null); + b.ToTable("tbl_Visits"); }); modelBuilder.Entity("UDS.Net.API.Entities.A1", b => @@ -5597,7 +5699,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.OwnsOne("UDS.Net.API.Entities.A3.KID1#UDS.Net.API.Entities.A3FamilyMember", "KID1", b1 => + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "KID1", b1 => { b1.Property("A3Id") .HasColumnType("int"); @@ -5624,13 +5726,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A3Id"); - b1.ToTable("tbl_A3s", (string)null); + b1.ToTable("tbl_A3s"); b1.WithOwner() .HasForeignKey("A3Id"); }); - b.OwnsOne("UDS.Net.API.Entities.A3.KID10#UDS.Net.API.Entities.A3FamilyMember", "KID10", b1 => + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "KID10", b1 => { b1.Property("A3Id") .HasColumnType("int"); @@ -5657,13 +5759,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A3Id"); - b1.ToTable("tbl_A3s", (string)null); + b1.ToTable("tbl_A3s"); b1.WithOwner() .HasForeignKey("A3Id"); }); - b.OwnsOne("UDS.Net.API.Entities.A3.KID11#UDS.Net.API.Entities.A3FamilyMember", "KID11", b1 => + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "KID11", b1 => { b1.Property("A3Id") .HasColumnType("int"); @@ -5690,13 +5792,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A3Id"); - b1.ToTable("tbl_A3s", (string)null); + b1.ToTable("tbl_A3s"); b1.WithOwner() .HasForeignKey("A3Id"); }); - b.OwnsOne("UDS.Net.API.Entities.A3.KID12#UDS.Net.API.Entities.A3FamilyMember", "KID12", b1 => + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "KID12", b1 => { b1.Property("A3Id") .HasColumnType("int"); @@ -5723,13 +5825,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A3Id"); - b1.ToTable("tbl_A3s", (string)null); + b1.ToTable("tbl_A3s"); b1.WithOwner() .HasForeignKey("A3Id"); }); - b.OwnsOne("UDS.Net.API.Entities.A3.KID13#UDS.Net.API.Entities.A3FamilyMember", "KID13", b1 => + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "KID13", b1 => { b1.Property("A3Id") .HasColumnType("int"); @@ -5756,13 +5858,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A3Id"); - b1.ToTable("tbl_A3s", (string)null); + b1.ToTable("tbl_A3s"); b1.WithOwner() .HasForeignKey("A3Id"); }); - b.OwnsOne("UDS.Net.API.Entities.A3.KID14#UDS.Net.API.Entities.A3FamilyMember", "KID14", b1 => + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "KID14", b1 => { b1.Property("A3Id") .HasColumnType("int"); @@ -5789,13 +5891,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A3Id"); - b1.ToTable("tbl_A3s", (string)null); + b1.ToTable("tbl_A3s"); b1.WithOwner() .HasForeignKey("A3Id"); }); - b.OwnsOne("UDS.Net.API.Entities.A3.KID15#UDS.Net.API.Entities.A3FamilyMember", "KID15", b1 => + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "KID15", b1 => { b1.Property("A3Id") .HasColumnType("int"); @@ -5822,13 +5924,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A3Id"); - b1.ToTable("tbl_A3s", (string)null); + b1.ToTable("tbl_A3s"); b1.WithOwner() .HasForeignKey("A3Id"); }); - b.OwnsOne("UDS.Net.API.Entities.A3.KID2#UDS.Net.API.Entities.A3FamilyMember", "KID2", b1 => + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "KID2", b1 => { b1.Property("A3Id") .HasColumnType("int"); @@ -5855,13 +5957,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A3Id"); - b1.ToTable("tbl_A3s", (string)null); + b1.ToTable("tbl_A3s"); b1.WithOwner() .HasForeignKey("A3Id"); }); - b.OwnsOne("UDS.Net.API.Entities.A3.KID3#UDS.Net.API.Entities.A3FamilyMember", "KID3", b1 => + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "KID3", b1 => { b1.Property("A3Id") .HasColumnType("int"); @@ -5888,13 +5990,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A3Id"); - b1.ToTable("tbl_A3s", (string)null); + b1.ToTable("tbl_A3s"); b1.WithOwner() .HasForeignKey("A3Id"); }); - b.OwnsOne("UDS.Net.API.Entities.A3.KID4#UDS.Net.API.Entities.A3FamilyMember", "KID4", b1 => + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "KID4", b1 => { b1.Property("A3Id") .HasColumnType("int"); @@ -5921,13 +6023,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A3Id"); - b1.ToTable("tbl_A3s", (string)null); + b1.ToTable("tbl_A3s"); b1.WithOwner() .HasForeignKey("A3Id"); }); - b.OwnsOne("UDS.Net.API.Entities.A3.KID5#UDS.Net.API.Entities.A3FamilyMember", "KID5", b1 => + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "KID5", b1 => { b1.Property("A3Id") .HasColumnType("int"); @@ -5954,13 +6056,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A3Id"); - b1.ToTable("tbl_A3s", (string)null); + b1.ToTable("tbl_A3s"); b1.WithOwner() .HasForeignKey("A3Id"); }); - b.OwnsOne("UDS.Net.API.Entities.A3.KID6#UDS.Net.API.Entities.A3FamilyMember", "KID6", b1 => + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "KID6", b1 => { b1.Property("A3Id") .HasColumnType("int"); @@ -5987,13 +6089,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A3Id"); - b1.ToTable("tbl_A3s", (string)null); + b1.ToTable("tbl_A3s"); b1.WithOwner() .HasForeignKey("A3Id"); }); - b.OwnsOne("UDS.Net.API.Entities.A3.KID7#UDS.Net.API.Entities.A3FamilyMember", "KID7", b1 => + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "KID7", b1 => { b1.Property("A3Id") .HasColumnType("int"); @@ -6020,13 +6122,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A3Id"); - b1.ToTable("tbl_A3s", (string)null); + b1.ToTable("tbl_A3s"); b1.WithOwner() .HasForeignKey("A3Id"); }); - b.OwnsOne("UDS.Net.API.Entities.A3.KID8#UDS.Net.API.Entities.A3FamilyMember", "KID8", b1 => + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "KID8", b1 => { b1.Property("A3Id") .HasColumnType("int"); @@ -6053,13 +6155,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A3Id"); - b1.ToTable("tbl_A3s", (string)null); + b1.ToTable("tbl_A3s"); b1.WithOwner() .HasForeignKey("A3Id"); }); - b.OwnsOne("UDS.Net.API.Entities.A3.KID9#UDS.Net.API.Entities.A3FamilyMember", "KID9", b1 => + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "KID9", b1 => { b1.Property("A3Id") .HasColumnType("int"); @@ -6086,13 +6188,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A3Id"); - b1.ToTable("tbl_A3s", (string)null); + b1.ToTable("tbl_A3s"); b1.WithOwner() .HasForeignKey("A3Id"); }); - b.OwnsOne("UDS.Net.API.Entities.A3.SIB1#UDS.Net.API.Entities.A3FamilyMember", "SIB1", b1 => + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB1", b1 => { b1.Property("A3Id") .HasColumnType("int"); @@ -6119,13 +6221,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A3Id"); - b1.ToTable("tbl_A3s", (string)null); + b1.ToTable("tbl_A3s"); b1.WithOwner() .HasForeignKey("A3Id"); }); - b.OwnsOne("UDS.Net.API.Entities.A3.SIB10#UDS.Net.API.Entities.A3FamilyMember", "SIB10", b1 => + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB10", b1 => { b1.Property("A3Id") .HasColumnType("int"); @@ -6152,13 +6254,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A3Id"); - b1.ToTable("tbl_A3s", (string)null); + b1.ToTable("tbl_A3s"); b1.WithOwner() .HasForeignKey("A3Id"); }); - b.OwnsOne("UDS.Net.API.Entities.A3.SIB11#UDS.Net.API.Entities.A3FamilyMember", "SIB11", b1 => + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB11", b1 => { b1.Property("A3Id") .HasColumnType("int"); @@ -6185,13 +6287,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A3Id"); - b1.ToTable("tbl_A3s", (string)null); + b1.ToTable("tbl_A3s"); b1.WithOwner() .HasForeignKey("A3Id"); }); - b.OwnsOne("UDS.Net.API.Entities.A3.SIB12#UDS.Net.API.Entities.A3FamilyMember", "SIB12", b1 => + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB12", b1 => { b1.Property("A3Id") .HasColumnType("int"); @@ -6218,13 +6320,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A3Id"); - b1.ToTable("tbl_A3s", (string)null); + b1.ToTable("tbl_A3s"); b1.WithOwner() .HasForeignKey("A3Id"); }); - b.OwnsOne("UDS.Net.API.Entities.A3.SIB13#UDS.Net.API.Entities.A3FamilyMember", "SIB13", b1 => + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB13", b1 => { b1.Property("A3Id") .HasColumnType("int"); @@ -6251,13 +6353,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A3Id"); - b1.ToTable("tbl_A3s", (string)null); + b1.ToTable("tbl_A3s"); b1.WithOwner() .HasForeignKey("A3Id"); }); - b.OwnsOne("UDS.Net.API.Entities.A3.SIB14#UDS.Net.API.Entities.A3FamilyMember", "SIB14", b1 => + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB14", b1 => { b1.Property("A3Id") .HasColumnType("int"); @@ -6284,13 +6386,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A3Id"); - b1.ToTable("tbl_A3s", (string)null); + b1.ToTable("tbl_A3s"); b1.WithOwner() .HasForeignKey("A3Id"); }); - b.OwnsOne("UDS.Net.API.Entities.A3.SIB15#UDS.Net.API.Entities.A3FamilyMember", "SIB15", b1 => + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB15", b1 => { b1.Property("A3Id") .HasColumnType("int"); @@ -6317,13 +6419,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A3Id"); - b1.ToTable("tbl_A3s", (string)null); + b1.ToTable("tbl_A3s"); b1.WithOwner() .HasForeignKey("A3Id"); }); - b.OwnsOne("UDS.Net.API.Entities.A3.SIB16#UDS.Net.API.Entities.A3FamilyMember", "SIB16", b1 => + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB16", b1 => { b1.Property("A3Id") .HasColumnType("int"); @@ -6350,13 +6452,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A3Id"); - b1.ToTable("tbl_A3s", (string)null); + b1.ToTable("tbl_A3s"); b1.WithOwner() .HasForeignKey("A3Id"); }); - b.OwnsOne("UDS.Net.API.Entities.A3.SIB17#UDS.Net.API.Entities.A3FamilyMember", "SIB17", b1 => + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB17", b1 => { b1.Property("A3Id") .HasColumnType("int"); @@ -6383,13 +6485,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A3Id"); - b1.ToTable("tbl_A3s", (string)null); + b1.ToTable("tbl_A3s"); b1.WithOwner() .HasForeignKey("A3Id"); }); - b.OwnsOne("UDS.Net.API.Entities.A3.SIB18#UDS.Net.API.Entities.A3FamilyMember", "SIB18", b1 => + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB18", b1 => { b1.Property("A3Id") .HasColumnType("int"); @@ -6416,13 +6518,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A3Id"); - b1.ToTable("tbl_A3s", (string)null); + b1.ToTable("tbl_A3s"); b1.WithOwner() .HasForeignKey("A3Id"); }); - b.OwnsOne("UDS.Net.API.Entities.A3.SIB19#UDS.Net.API.Entities.A3FamilyMember", "SIB19", b1 => + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB19", b1 => { b1.Property("A3Id") .HasColumnType("int"); @@ -6449,13 +6551,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A3Id"); - b1.ToTable("tbl_A3s", (string)null); + b1.ToTable("tbl_A3s"); b1.WithOwner() .HasForeignKey("A3Id"); }); - b.OwnsOne("UDS.Net.API.Entities.A3.SIB2#UDS.Net.API.Entities.A3FamilyMember", "SIB2", b1 => + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB2", b1 => { b1.Property("A3Id") .HasColumnType("int"); @@ -6482,13 +6584,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A3Id"); - b1.ToTable("tbl_A3s", (string)null); + b1.ToTable("tbl_A3s"); b1.WithOwner() .HasForeignKey("A3Id"); }); - b.OwnsOne("UDS.Net.API.Entities.A3.SIB20#UDS.Net.API.Entities.A3FamilyMember", "SIB20", b1 => + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB20", b1 => { b1.Property("A3Id") .HasColumnType("int"); @@ -6515,13 +6617,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A3Id"); - b1.ToTable("tbl_A3s", (string)null); + b1.ToTable("tbl_A3s"); b1.WithOwner() .HasForeignKey("A3Id"); }); - b.OwnsOne("UDS.Net.API.Entities.A3.SIB3#UDS.Net.API.Entities.A3FamilyMember", "SIB3", b1 => + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB3", b1 => { b1.Property("A3Id") .HasColumnType("int"); @@ -6548,13 +6650,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A3Id"); - b1.ToTable("tbl_A3s", (string)null); + b1.ToTable("tbl_A3s"); b1.WithOwner() .HasForeignKey("A3Id"); }); - b.OwnsOne("UDS.Net.API.Entities.A3.SIB4#UDS.Net.API.Entities.A3FamilyMember", "SIB4", b1 => + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB4", b1 => { b1.Property("A3Id") .HasColumnType("int"); @@ -6581,13 +6683,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A3Id"); - b1.ToTable("tbl_A3s", (string)null); + b1.ToTable("tbl_A3s"); b1.WithOwner() .HasForeignKey("A3Id"); }); - b.OwnsOne("UDS.Net.API.Entities.A3.SIB5#UDS.Net.API.Entities.A3FamilyMember", "SIB5", b1 => + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB5", b1 => { b1.Property("A3Id") .HasColumnType("int"); @@ -6614,13 +6716,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A3Id"); - b1.ToTable("tbl_A3s", (string)null); + b1.ToTable("tbl_A3s"); b1.WithOwner() .HasForeignKey("A3Id"); }); - b.OwnsOne("UDS.Net.API.Entities.A3.SIB6#UDS.Net.API.Entities.A3FamilyMember", "SIB6", b1 => + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB6", b1 => { b1.Property("A3Id") .HasColumnType("int"); @@ -6647,13 +6749,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A3Id"); - b1.ToTable("tbl_A3s", (string)null); + b1.ToTable("tbl_A3s"); b1.WithOwner() .HasForeignKey("A3Id"); }); - b.OwnsOne("UDS.Net.API.Entities.A3.SIB7#UDS.Net.API.Entities.A3FamilyMember", "SIB7", b1 => + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB7", b1 => { b1.Property("A3Id") .HasColumnType("int"); @@ -6680,13 +6782,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A3Id"); - b1.ToTable("tbl_A3s", (string)null); + b1.ToTable("tbl_A3s"); b1.WithOwner() .HasForeignKey("A3Id"); }); - b.OwnsOne("UDS.Net.API.Entities.A3.SIB8#UDS.Net.API.Entities.A3FamilyMember", "SIB8", b1 => + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB8", b1 => { b1.Property("A3Id") .HasColumnType("int"); @@ -6713,13 +6815,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A3Id"); - b1.ToTable("tbl_A3s", (string)null); + b1.ToTable("tbl_A3s"); b1.WithOwner() .HasForeignKey("A3Id"); }); - b.OwnsOne("UDS.Net.API.Entities.A3.SIB9#UDS.Net.API.Entities.A3FamilyMember", "SIB9", b1 => + b.OwnsOne("UDS.Net.API.Entities.A3FamilyMember", "SIB9", b1 => { b1.Property("A3Id") .HasColumnType("int"); @@ -6746,7 +6848,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A3Id"); - b1.ToTable("tbl_A3s", (string)null); + b1.ToTable("tbl_A3s"); b1.WithOwner() .HasForeignKey("A3Id"); @@ -6866,7 +6968,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.OwnsOne("UDS.Net.API.Entities.A4.RXNORMID1#UDS.Net.API.Entities.A4D", "RXNORMID1", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID1", b1 => { b1.Property("A4Id") .HasColumnType("int"); @@ -6878,7 +6980,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasIndex("RxNormId"); - b1.ToTable("tbl_A4s", (string)null); + b1.ToTable("tbl_A4s"); b1.WithOwner() .HasForeignKey("A4Id"); @@ -6890,7 +6992,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.Navigation("DrugCode"); }); - b.OwnsOne("UDS.Net.API.Entities.A4.RXNORMID10#UDS.Net.API.Entities.A4D", "RXNORMID10", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID10", b1 => { b1.Property("A4Id") .HasColumnType("int"); @@ -6902,7 +7004,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasIndex("RxNormId"); - b1.ToTable("tbl_A4s", (string)null); + b1.ToTable("tbl_A4s"); b1.WithOwner() .HasForeignKey("A4Id"); @@ -6914,7 +7016,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.Navigation("DrugCode"); }); - b.OwnsOne("UDS.Net.API.Entities.A4.RXNORMID11#UDS.Net.API.Entities.A4D", "RXNORMID11", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID11", b1 => { b1.Property("A4Id") .HasColumnType("int"); @@ -6926,7 +7028,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasIndex("RxNormId"); - b1.ToTable("tbl_A4s", (string)null); + b1.ToTable("tbl_A4s"); b1.WithOwner() .HasForeignKey("A4Id"); @@ -6938,7 +7040,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.Navigation("DrugCode"); }); - b.OwnsOne("UDS.Net.API.Entities.A4.RXNORMID12#UDS.Net.API.Entities.A4D", "RXNORMID12", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID12", b1 => { b1.Property("A4Id") .HasColumnType("int"); @@ -6950,7 +7052,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasIndex("RxNormId"); - b1.ToTable("tbl_A4s", (string)null); + b1.ToTable("tbl_A4s"); b1.WithOwner() .HasForeignKey("A4Id"); @@ -6962,7 +7064,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.Navigation("DrugCode"); }); - b.OwnsOne("UDS.Net.API.Entities.A4.RXNORMID13#UDS.Net.API.Entities.A4D", "RXNORMID13", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID13", b1 => { b1.Property("A4Id") .HasColumnType("int"); @@ -6974,7 +7076,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasIndex("RxNormId"); - b1.ToTable("tbl_A4s", (string)null); + b1.ToTable("tbl_A4s"); b1.WithOwner() .HasForeignKey("A4Id"); @@ -6986,7 +7088,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.Navigation("DrugCode"); }); - b.OwnsOne("UDS.Net.API.Entities.A4.RXNORMID14#UDS.Net.API.Entities.A4D", "RXNORMID14", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID14", b1 => { b1.Property("A4Id") .HasColumnType("int"); @@ -6998,7 +7100,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasIndex("RxNormId"); - b1.ToTable("tbl_A4s", (string)null); + b1.ToTable("tbl_A4s"); b1.WithOwner() .HasForeignKey("A4Id"); @@ -7010,7 +7112,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.Navigation("DrugCode"); }); - b.OwnsOne("UDS.Net.API.Entities.A4.RXNORMID15#UDS.Net.API.Entities.A4D", "RXNORMID15", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID15", b1 => { b1.Property("A4Id") .HasColumnType("int"); @@ -7022,7 +7124,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasIndex("RxNormId"); - b1.ToTable("tbl_A4s", (string)null); + b1.ToTable("tbl_A4s"); b1.WithOwner() .HasForeignKey("A4Id"); @@ -7034,7 +7136,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.Navigation("DrugCode"); }); - b.OwnsOne("UDS.Net.API.Entities.A4.RXNORMID16#UDS.Net.API.Entities.A4D", "RXNORMID16", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID16", b1 => { b1.Property("A4Id") .HasColumnType("int"); @@ -7046,7 +7148,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasIndex("RxNormId"); - b1.ToTable("tbl_A4s", (string)null); + b1.ToTable("tbl_A4s"); b1.WithOwner() .HasForeignKey("A4Id"); @@ -7058,7 +7160,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.Navigation("DrugCode"); }); - b.OwnsOne("UDS.Net.API.Entities.A4.RXNORMID17#UDS.Net.API.Entities.A4D", "RXNORMID17", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID17", b1 => { b1.Property("A4Id") .HasColumnType("int"); @@ -7070,7 +7172,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasIndex("RxNormId"); - b1.ToTable("tbl_A4s", (string)null); + b1.ToTable("tbl_A4s"); b1.WithOwner() .HasForeignKey("A4Id"); @@ -7082,7 +7184,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.Navigation("DrugCode"); }); - b.OwnsOne("UDS.Net.API.Entities.A4.RXNORMID18#UDS.Net.API.Entities.A4D", "RXNORMID18", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID18", b1 => { b1.Property("A4Id") .HasColumnType("int"); @@ -7094,7 +7196,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasIndex("RxNormId"); - b1.ToTable("tbl_A4s", (string)null); + b1.ToTable("tbl_A4s"); b1.WithOwner() .HasForeignKey("A4Id"); @@ -7106,7 +7208,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.Navigation("DrugCode"); }); - b.OwnsOne("UDS.Net.API.Entities.A4.RXNORMID19#UDS.Net.API.Entities.A4D", "RXNORMID19", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID19", b1 => { b1.Property("A4Id") .HasColumnType("int"); @@ -7118,7 +7220,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasIndex("RxNormId"); - b1.ToTable("tbl_A4s", (string)null); + b1.ToTable("tbl_A4s"); b1.WithOwner() .HasForeignKey("A4Id"); @@ -7130,7 +7232,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.Navigation("DrugCode"); }); - b.OwnsOne("UDS.Net.API.Entities.A4.RXNORMID2#UDS.Net.API.Entities.A4D", "RXNORMID2", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID2", b1 => { b1.Property("A4Id") .HasColumnType("int"); @@ -7142,7 +7244,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasIndex("RxNormId"); - b1.ToTable("tbl_A4s", (string)null); + b1.ToTable("tbl_A4s"); b1.WithOwner() .HasForeignKey("A4Id"); @@ -7154,7 +7256,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.Navigation("DrugCode"); }); - b.OwnsOne("UDS.Net.API.Entities.A4.RXNORMID20#UDS.Net.API.Entities.A4D", "RXNORMID20", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID20", b1 => { b1.Property("A4Id") .HasColumnType("int"); @@ -7166,7 +7268,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasIndex("RxNormId"); - b1.ToTable("tbl_A4s", (string)null); + b1.ToTable("tbl_A4s"); b1.WithOwner() .HasForeignKey("A4Id"); @@ -7178,7 +7280,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.Navigation("DrugCode"); }); - b.OwnsOne("UDS.Net.API.Entities.A4.RXNORMID21#UDS.Net.API.Entities.A4D", "RXNORMID21", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID21", b1 => { b1.Property("A4Id") .HasColumnType("int"); @@ -7190,7 +7292,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasIndex("RxNormId"); - b1.ToTable("tbl_A4s", (string)null); + b1.ToTable("tbl_A4s"); b1.WithOwner() .HasForeignKey("A4Id"); @@ -7202,7 +7304,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.Navigation("DrugCode"); }); - b.OwnsOne("UDS.Net.API.Entities.A4.RXNORMID22#UDS.Net.API.Entities.A4D", "RXNORMID22", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID22", b1 => { b1.Property("A4Id") .HasColumnType("int"); @@ -7214,7 +7316,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasIndex("RxNormId"); - b1.ToTable("tbl_A4s", (string)null); + b1.ToTable("tbl_A4s"); b1.WithOwner() .HasForeignKey("A4Id"); @@ -7226,7 +7328,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.Navigation("DrugCode"); }); - b.OwnsOne("UDS.Net.API.Entities.A4.RXNORMID23#UDS.Net.API.Entities.A4D", "RXNORMID23", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID23", b1 => { b1.Property("A4Id") .HasColumnType("int"); @@ -7238,7 +7340,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasIndex("RxNormId"); - b1.ToTable("tbl_A4s", (string)null); + b1.ToTable("tbl_A4s"); b1.WithOwner() .HasForeignKey("A4Id"); @@ -7250,7 +7352,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.Navigation("DrugCode"); }); - b.OwnsOne("UDS.Net.API.Entities.A4.RXNORMID24#UDS.Net.API.Entities.A4D", "RXNORMID24", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID24", b1 => { b1.Property("A4Id") .HasColumnType("int"); @@ -7262,7 +7364,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasIndex("RxNormId"); - b1.ToTable("tbl_A4s", (string)null); + b1.ToTable("tbl_A4s"); b1.WithOwner() .HasForeignKey("A4Id"); @@ -7274,7 +7376,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.Navigation("DrugCode"); }); - b.OwnsOne("UDS.Net.API.Entities.A4.RXNORMID25#UDS.Net.API.Entities.A4D", "RXNORMID25", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID25", b1 => { b1.Property("A4Id") .HasColumnType("int"); @@ -7286,7 +7388,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasIndex("RxNormId"); - b1.ToTable("tbl_A4s", (string)null); + b1.ToTable("tbl_A4s"); b1.WithOwner() .HasForeignKey("A4Id"); @@ -7298,7 +7400,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.Navigation("DrugCode"); }); - b.OwnsOne("UDS.Net.API.Entities.A4.RXNORMID26#UDS.Net.API.Entities.A4D", "RXNORMID26", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID26", b1 => { b1.Property("A4Id") .HasColumnType("int"); @@ -7310,7 +7412,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasIndex("RxNormId"); - b1.ToTable("tbl_A4s", (string)null); + b1.ToTable("tbl_A4s"); b1.WithOwner() .HasForeignKey("A4Id"); @@ -7322,7 +7424,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.Navigation("DrugCode"); }); - b.OwnsOne("UDS.Net.API.Entities.A4.RXNORMID27#UDS.Net.API.Entities.A4D", "RXNORMID27", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID27", b1 => { b1.Property("A4Id") .HasColumnType("int"); @@ -7334,7 +7436,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasIndex("RxNormId"); - b1.ToTable("tbl_A4s", (string)null); + b1.ToTable("tbl_A4s"); b1.WithOwner() .HasForeignKey("A4Id"); @@ -7346,7 +7448,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.Navigation("DrugCode"); }); - b.OwnsOne("UDS.Net.API.Entities.A4.RXNORMID28#UDS.Net.API.Entities.A4D", "RXNORMID28", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID28", b1 => { b1.Property("A4Id") .HasColumnType("int"); @@ -7358,7 +7460,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasIndex("RxNormId"); - b1.ToTable("tbl_A4s", (string)null); + b1.ToTable("tbl_A4s"); b1.WithOwner() .HasForeignKey("A4Id"); @@ -7370,7 +7472,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.Navigation("DrugCode"); }); - b.OwnsOne("UDS.Net.API.Entities.A4.RXNORMID29#UDS.Net.API.Entities.A4D", "RXNORMID29", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID29", b1 => { b1.Property("A4Id") .HasColumnType("int"); @@ -7382,7 +7484,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasIndex("RxNormId"); - b1.ToTable("tbl_A4s", (string)null); + b1.ToTable("tbl_A4s"); b1.WithOwner() .HasForeignKey("A4Id"); @@ -7394,7 +7496,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.Navigation("DrugCode"); }); - b.OwnsOne("UDS.Net.API.Entities.A4.RXNORMID3#UDS.Net.API.Entities.A4D", "RXNORMID3", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID3", b1 => { b1.Property("A4Id") .HasColumnType("int"); @@ -7406,7 +7508,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasIndex("RxNormId"); - b1.ToTable("tbl_A4s", (string)null); + b1.ToTable("tbl_A4s"); b1.WithOwner() .HasForeignKey("A4Id"); @@ -7418,7 +7520,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.Navigation("DrugCode"); }); - b.OwnsOne("UDS.Net.API.Entities.A4.RXNORMID30#UDS.Net.API.Entities.A4D", "RXNORMID30", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID30", b1 => { b1.Property("A4Id") .HasColumnType("int"); @@ -7430,7 +7532,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasIndex("RxNormId"); - b1.ToTable("tbl_A4s", (string)null); + b1.ToTable("tbl_A4s"); b1.WithOwner() .HasForeignKey("A4Id"); @@ -7442,7 +7544,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.Navigation("DrugCode"); }); - b.OwnsOne("UDS.Net.API.Entities.A4.RXNORMID31#UDS.Net.API.Entities.A4D", "RXNORMID31", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID31", b1 => { b1.Property("A4Id") .HasColumnType("int"); @@ -7454,7 +7556,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasIndex("RxNormId"); - b1.ToTable("tbl_A4s", (string)null); + b1.ToTable("tbl_A4s"); b1.WithOwner() .HasForeignKey("A4Id"); @@ -7466,7 +7568,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.Navigation("DrugCode"); }); - b.OwnsOne("UDS.Net.API.Entities.A4.RXNORMID32#UDS.Net.API.Entities.A4D", "RXNORMID32", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID32", b1 => { b1.Property("A4Id") .HasColumnType("int"); @@ -7478,7 +7580,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasIndex("RxNormId"); - b1.ToTable("tbl_A4s", (string)null); + b1.ToTable("tbl_A4s"); b1.WithOwner() .HasForeignKey("A4Id"); @@ -7490,7 +7592,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.Navigation("DrugCode"); }); - b.OwnsOne("UDS.Net.API.Entities.A4.RXNORMID33#UDS.Net.API.Entities.A4D", "RXNORMID33", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID33", b1 => { b1.Property("A4Id") .HasColumnType("int"); @@ -7502,7 +7604,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasIndex("RxNormId"); - b1.ToTable("tbl_A4s", (string)null); + b1.ToTable("tbl_A4s"); b1.WithOwner() .HasForeignKey("A4Id"); @@ -7514,7 +7616,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.Navigation("DrugCode"); }); - b.OwnsOne("UDS.Net.API.Entities.A4.RXNORMID34#UDS.Net.API.Entities.A4D", "RXNORMID34", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID34", b1 => { b1.Property("A4Id") .HasColumnType("int"); @@ -7526,7 +7628,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasIndex("RxNormId"); - b1.ToTable("tbl_A4s", (string)null); + b1.ToTable("tbl_A4s"); b1.WithOwner() .HasForeignKey("A4Id"); @@ -7538,7 +7640,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.Navigation("DrugCode"); }); - b.OwnsOne("UDS.Net.API.Entities.A4.RXNORMID35#UDS.Net.API.Entities.A4D", "RXNORMID35", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID35", b1 => { b1.Property("A4Id") .HasColumnType("int"); @@ -7550,7 +7652,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasIndex("RxNormId"); - b1.ToTable("tbl_A4s", (string)null); + b1.ToTable("tbl_A4s"); b1.WithOwner() .HasForeignKey("A4Id"); @@ -7562,7 +7664,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.Navigation("DrugCode"); }); - b.OwnsOne("UDS.Net.API.Entities.A4.RXNORMID36#UDS.Net.API.Entities.A4D", "RXNORMID36", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID36", b1 => { b1.Property("A4Id") .HasColumnType("int"); @@ -7574,7 +7676,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasIndex("RxNormId"); - b1.ToTable("tbl_A4s", (string)null); + b1.ToTable("tbl_A4s"); b1.WithOwner() .HasForeignKey("A4Id"); @@ -7586,7 +7688,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.Navigation("DrugCode"); }); - b.OwnsOne("UDS.Net.API.Entities.A4.RXNORMID37#UDS.Net.API.Entities.A4D", "RXNORMID37", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID37", b1 => { b1.Property("A4Id") .HasColumnType("int"); @@ -7598,7 +7700,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasIndex("RxNormId"); - b1.ToTable("tbl_A4s", (string)null); + b1.ToTable("tbl_A4s"); b1.WithOwner() .HasForeignKey("A4Id"); @@ -7610,7 +7712,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.Navigation("DrugCode"); }); - b.OwnsOne("UDS.Net.API.Entities.A4.RXNORMID38#UDS.Net.API.Entities.A4D", "RXNORMID38", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID38", b1 => { b1.Property("A4Id") .HasColumnType("int"); @@ -7622,7 +7724,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasIndex("RxNormId"); - b1.ToTable("tbl_A4s", (string)null); + b1.ToTable("tbl_A4s"); b1.WithOwner() .HasForeignKey("A4Id"); @@ -7634,7 +7736,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.Navigation("DrugCode"); }); - b.OwnsOne("UDS.Net.API.Entities.A4.RXNORMID39#UDS.Net.API.Entities.A4D", "RXNORMID39", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID39", b1 => { b1.Property("A4Id") .HasColumnType("int"); @@ -7646,7 +7748,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasIndex("RxNormId"); - b1.ToTable("tbl_A4s", (string)null); + b1.ToTable("tbl_A4s"); b1.WithOwner() .HasForeignKey("A4Id"); @@ -7658,7 +7760,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.Navigation("DrugCode"); }); - b.OwnsOne("UDS.Net.API.Entities.A4.RXNORMID4#UDS.Net.API.Entities.A4D", "RXNORMID4", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID4", b1 => { b1.Property("A4Id") .HasColumnType("int"); @@ -7670,7 +7772,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasIndex("RxNormId"); - b1.ToTable("tbl_A4s", (string)null); + b1.ToTable("tbl_A4s"); b1.WithOwner() .HasForeignKey("A4Id"); @@ -7682,7 +7784,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.Navigation("DrugCode"); }); - b.OwnsOne("UDS.Net.API.Entities.A4.RXNORMID40#UDS.Net.API.Entities.A4D", "RXNORMID40", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID40", b1 => { b1.Property("A4Id") .HasColumnType("int"); @@ -7694,7 +7796,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasIndex("RxNormId"); - b1.ToTable("tbl_A4s", (string)null); + b1.ToTable("tbl_A4s"); b1.WithOwner() .HasForeignKey("A4Id"); @@ -7706,7 +7808,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.Navigation("DrugCode"); }); - b.OwnsOne("UDS.Net.API.Entities.A4.RXNORMID5#UDS.Net.API.Entities.A4D", "RXNORMID5", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID5", b1 => { b1.Property("A4Id") .HasColumnType("int"); @@ -7718,7 +7820,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasIndex("RxNormId"); - b1.ToTable("tbl_A4s", (string)null); + b1.ToTable("tbl_A4s"); b1.WithOwner() .HasForeignKey("A4Id"); @@ -7730,7 +7832,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.Navigation("DrugCode"); }); - b.OwnsOne("UDS.Net.API.Entities.A4.RXNORMID6#UDS.Net.API.Entities.A4D", "RXNORMID6", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID6", b1 => { b1.Property("A4Id") .HasColumnType("int"); @@ -7742,7 +7844,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasIndex("RxNormId"); - b1.ToTable("tbl_A4s", (string)null); + b1.ToTable("tbl_A4s"); b1.WithOwner() .HasForeignKey("A4Id"); @@ -7754,7 +7856,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.Navigation("DrugCode"); }); - b.OwnsOne("UDS.Net.API.Entities.A4.RXNORMID7#UDS.Net.API.Entities.A4D", "RXNORMID7", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID7", b1 => { b1.Property("A4Id") .HasColumnType("int"); @@ -7766,7 +7868,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasIndex("RxNormId"); - b1.ToTable("tbl_A4s", (string)null); + b1.ToTable("tbl_A4s"); b1.WithOwner() .HasForeignKey("A4Id"); @@ -7778,7 +7880,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.Navigation("DrugCode"); }); - b.OwnsOne("UDS.Net.API.Entities.A4.RXNORMID8#UDS.Net.API.Entities.A4D", "RXNORMID8", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID8", b1 => { b1.Property("A4Id") .HasColumnType("int"); @@ -7790,7 +7892,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasIndex("RxNormId"); - b1.ToTable("tbl_A4s", (string)null); + b1.ToTable("tbl_A4s"); b1.WithOwner() .HasForeignKey("A4Id"); @@ -7802,7 +7904,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.Navigation("DrugCode"); }); - b.OwnsOne("UDS.Net.API.Entities.A4.RXNORMID9#UDS.Net.API.Entities.A4D", "RXNORMID9", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4D", "RXNORMID9", b1 => { b1.Property("A4Id") .HasColumnType("int"); @@ -7814,7 +7916,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasIndex("RxNormId"); - b1.ToTable("tbl_A4s", (string)null); + b1.ToTable("tbl_A4s"); b1.WithOwner() .HasForeignKey("A4Id"); @@ -7955,7 +8057,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) .OnDelete(DeleteBehavior.Cascade) .IsRequired(); - b.OwnsOne("UDS.Net.API.Entities.A4a.Treatment1#UDS.Net.API.Entities.A4aTreatment", "Treatment1", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4aTreatment", "Treatment1", b1 => { b1.Property("A4aId") .HasColumnType("int"); @@ -8021,13 +8123,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A4aId"); - b1.ToTable("tbl_A4as", (string)null); + b1.ToTable("tbl_A4as"); b1.WithOwner() .HasForeignKey("A4aId"); }); - b.OwnsOne("UDS.Net.API.Entities.A4a.Treatment2#UDS.Net.API.Entities.A4aTreatment", "Treatment2", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4aTreatment", "Treatment2", b1 => { b1.Property("A4aId") .HasColumnType("int"); @@ -8093,13 +8195,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A4aId"); - b1.ToTable("tbl_A4as", (string)null); + b1.ToTable("tbl_A4as"); b1.WithOwner() .HasForeignKey("A4aId"); }); - b.OwnsOne("UDS.Net.API.Entities.A4a.Treatment3#UDS.Net.API.Entities.A4aTreatment", "Treatment3", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4aTreatment", "Treatment3", b1 => { b1.Property("A4aId") .HasColumnType("int"); @@ -8165,13 +8267,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A4aId"); - b1.ToTable("tbl_A4as", (string)null); + b1.ToTable("tbl_A4as"); b1.WithOwner() .HasForeignKey("A4aId"); }); - b.OwnsOne("UDS.Net.API.Entities.A4a.Treatment4#UDS.Net.API.Entities.A4aTreatment", "Treatment4", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4aTreatment", "Treatment4", b1 => { b1.Property("A4aId") .HasColumnType("int"); @@ -8237,13 +8339,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A4aId"); - b1.ToTable("tbl_A4as", (string)null); + b1.ToTable("tbl_A4as"); b1.WithOwner() .HasForeignKey("A4aId"); }); - b.OwnsOne("UDS.Net.API.Entities.A4a.Treatment5#UDS.Net.API.Entities.A4aTreatment", "Treatment5", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4aTreatment", "Treatment5", b1 => { b1.Property("A4aId") .HasColumnType("int"); @@ -8309,13 +8411,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A4aId"); - b1.ToTable("tbl_A4as", (string)null); + b1.ToTable("tbl_A4as"); b1.WithOwner() .HasForeignKey("A4aId"); }); - b.OwnsOne("UDS.Net.API.Entities.A4a.Treatment6#UDS.Net.API.Entities.A4aTreatment", "Treatment6", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4aTreatment", "Treatment6", b1 => { b1.Property("A4aId") .HasColumnType("int"); @@ -8381,13 +8483,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A4aId"); - b1.ToTable("tbl_A4as", (string)null); + b1.ToTable("tbl_A4as"); b1.WithOwner() .HasForeignKey("A4aId"); }); - b.OwnsOne("UDS.Net.API.Entities.A4a.Treatment7#UDS.Net.API.Entities.A4aTreatment", "Treatment7", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4aTreatment", "Treatment7", b1 => { b1.Property("A4aId") .HasColumnType("int"); @@ -8453,13 +8555,13 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A4aId"); - b1.ToTable("tbl_A4as", (string)null); + b1.ToTable("tbl_A4as"); b1.WithOwner() .HasForeignKey("A4aId"); }); - b.OwnsOne("UDS.Net.API.Entities.A4a.Treatment8#UDS.Net.API.Entities.A4aTreatment", "Treatment8", b1 => + b.OwnsOne("UDS.Net.API.Entities.A4aTreatment", "Treatment8", b1 => { b1.Property("A4aId") .HasColumnType("int"); @@ -8525,7 +8627,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b1.HasKey("A4aId"); - b1.ToTable("tbl_A4as", (string)null); + b1.ToTable("tbl_A4as"); b1.WithOwner() .HasForeignKey("A4aId"); @@ -8693,6 +8795,28 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Navigation("Participation"); }); + modelBuilder.Entity("UDS.Net.API.Entities.PacketSubmission", b => + { + b.HasOne("UDS.Net.API.Entities.Visit", "Visit") + .WithMany("PacketSubmissions") + .HasForeignKey("VisitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Visit"); + }); + + modelBuilder.Entity("UDS.Net.API.Entities.PacketSubmissionError", b => + { + b.HasOne("UDS.Net.API.Entities.PacketSubmission", "PacketSubmission") + .WithMany("PacketSubmissionErrors") + .HasForeignKey("PacketSubmissionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("PacketSubmission"); + }); + modelBuilder.Entity("UDS.Net.API.Entities.T1", b => { b.HasOne("UDS.Net.API.Entities.Visit", null) @@ -8713,6 +8837,11 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Navigation("Participation"); }); + modelBuilder.Entity("UDS.Net.API.Entities.PacketSubmission", b => + { + b.Navigation("PacketSubmissionErrors"); + }); + modelBuilder.Entity("UDS.Net.API.Entities.Participation", b => { b.Navigation("M1s"); @@ -8781,6 +8910,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Navigation("FormStatuses"); + b.Navigation("PacketSubmissions"); + b.Navigation("T1"); }); #pragma warning restore 612, 618 diff --git a/src/UDS.Net.API/Extensions/DtoToEntityMapper.cs b/src/UDS.Net.API/Extensions/DtoToEntityMapper.cs index 7edacb1..6105d74 100644 --- a/src/UDS.Net.API/Extensions/DtoToEntityMapper.cs +++ b/src/UDS.Net.API/Extensions/DtoToEntityMapper.cs @@ -66,6 +66,21 @@ private static void SetBaseProperties(this Form entity, FormDto dto) } } + public static List Convert(this string[] statuses) + { + List packetStatuses = new List(); + + if (statuses != null && statuses.Count() > 0) + { + foreach (var status in statuses) + { + packetStatuses.Add(status.Convert()); + } + } + + return packetStatuses; + } + public static PacketStatus Convert(this string status) { if (!string.IsNullOrWhiteSpace(status)) diff --git a/src/UDS.Net.API/Extensions/EntityToDtoMapper.cs b/src/UDS.Net.API/Extensions/EntityToDtoMapper.cs index 5d9a5fa..fa55b21 100644 --- a/src/UDS.Net.API/Extensions/EntityToDtoMapper.cs +++ b/src/UDS.Net.API/Extensions/EntityToDtoMapper.cs @@ -7,7 +7,7 @@ public static class EntityToDtoMapper { private static VisitDto ConvertVisitToDto(Visit visit) { - var dto = new VisitDto() + return new VisitDto() { Id = visit.Id, ParticipationId = visit.ParticipationId, @@ -23,18 +23,38 @@ private static VisitDto ConvertVisitToDto(Visit visit) INITIALS = visit.INITIALS, Status = visit.Status.ToString() }; - - return dto; } public static PacketDto ToPacketDto(this Visit visit) { - var dto = (PacketDto)ConvertVisitToDto(visit); + PacketDto dto = new PacketDto() + { + Id = visit.Id, + ParticipationId = visit.ParticipationId, + CreatedAt = visit.CreatedAt, + CreatedBy = visit.CreatedBy, + ModifiedBy = visit.ModifiedBy, + DeletedBy = visit.DeletedBy, + IsDeleted = visit.IsDeleted, + VISITNUM = visit.VISITNUM, + PACKET = visit.PACKET, + FORMVER = visit.FORMVER, + VISIT_DATE = visit.VISIT_DATE, + INITIALS = visit.INITIALS, + Status = visit.Status.ToString() + }; if (visit.PacketSubmissions != null && visit.PacketSubmissions.Count() > 0) { dto.PacketSubmissionCount = visit.PacketSubmissions.Count(); dto.PacketSubmissions = visit.PacketSubmissions.ToDto(); + int? unresolvedErrorsCount = null; + foreach (var submission in dto.PacketSubmissions) + { + int? unresolvedCountPerSubmission = submission.PacketSubmissionErrors.Where(e => String.IsNullOrWhiteSpace(e.ResolvedBy)).Count(); + unresolvedErrorsCount += unresolvedCountPerSubmission; + } + dto.TotalUnresolvedErrorCount = unresolvedErrorsCount; } return dto; @@ -57,7 +77,33 @@ public static VisitDto ToDto(this Visit visit) if (visit.PacketSubmissions != null) { - // since this + int? unresolvedErrorsCount = null; + var unresolvedErrors = new List(); + foreach (var submission in visit.PacketSubmissions) + { + if (submission != null && submission.ErrorCount.HasValue && submission.PacketSubmissionErrors != null) + { + foreach (var error in submission.PacketSubmissionErrors) + { + if (error != null && String.IsNullOrWhiteSpace(error.ResolvedBy)) + { + unresolvedErrorsCount += 1; + unresolvedErrors.Add(error.ToDto()); + if (dto.Forms != null) + { + // if there are forms, also update the number of unresolved errors and errors list per form + var formDto = dto.Forms.Where(f => f.Kind == error.FormKind).FirstOrDefault(); + if (formDto != null) + { + formDto.UnresolvedErrorCount += 1; + formDto.UnresolvedErrors.Add(error.ToDto()); + } + } + } + } + } + } + dto.TotalUnresolvedErrorCount = unresolvedErrorsCount; } return dto; diff --git a/src/UDS.Net.API/UDS.Net.API.csproj b/src/UDS.Net.API/UDS.Net.API.csproj index b67eef3..55939f7 100644 --- a/src/UDS.Net.API/UDS.Net.API.csproj +++ b/src/UDS.Net.API/UDS.Net.API.csproj @@ -4,7 +4,7 @@ net8.0 enable enable - 4.1.0-preview.8 + 4.1.0-preview.7 ../docker-compose.dcproj c1dd1715-6fa0-4515-bcf2-6a7f6a0c11a5 Release;Debug diff --git a/src/UDS.Net.Dto/UDS.Net.Dto.csproj b/src/UDS.Net.Dto/UDS.Net.Dto.csproj index 6b3341d..fd44e92 100644 --- a/src/UDS.Net.Dto/UDS.Net.Dto.csproj +++ b/src/UDS.Net.Dto/UDS.Net.Dto.csproj @@ -4,13 +4,13 @@ netstandard2.1 Library UDS.Net.Dto - 4.1.0-preview.8 + 4.1.0-preview.7 Sanders-Brown Center on Aging UDS data transfer objects for use with API UK-SBCoA Dtos for API https://github.com/UK-SBCoA/uniform-data-set-dotnet-api - 4.1.0-preview.8 + 4.1.0-preview.7 diff --git a/src/UDS.Net.Dto/VisitDto.cs b/src/UDS.Net.Dto/VisitDto.cs index 94615ea..764cba6 100644 --- a/src/UDS.Net.Dto/VisitDto.cs +++ b/src/UDS.Net.Dto/VisitDto.cs @@ -22,6 +22,8 @@ public class VisitDto : BaseDto public List Forms { get; set; } = new List(); public int? TotalUnresolvedErrorCount { get; set; } + + public List UnresolvedErrors { get; set; } = new List(); } } diff --git a/src/UDS.Net.sln b/src/UDS.Net.sln index 939e477..48f245f 100644 --- a/src/UDS.Net.sln +++ b/src/UDS.Net.sln @@ -9,7 +9,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UDS.Net.API.Client", "UDS.N EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UDS.Net.Dto", "UDS.Net.Dto\UDS.Net.Dto.csproj", "{E620B892-269C-423B-9AEF-375131FA6B0C}" EndProject -Project("{9344BDBB-3E7F-41FC-A0DD-8665D75EE146}") = "docker-compose", "docker-compose.dcproj", "{D8C3DF59-2AF7-4DEC-86DD-2765DA71C8D6}" +Project("{9344BDBB-3E7F-41FC-A0DD-8665D75EE146}") = "docker-compose", "docker-compose.dcproj", "{979A8E74-AE20-49B6-B5CD-007A6C7614C4}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -29,10 +29,10 @@ Global {E620B892-269C-423B-9AEF-375131FA6B0C}.Debug|Any CPU.Build.0 = Debug|Any CPU {E620B892-269C-423B-9AEF-375131FA6B0C}.Release|Any CPU.ActiveCfg = Release|Any CPU {E620B892-269C-423B-9AEF-375131FA6B0C}.Release|Any CPU.Build.0 = Release|Any CPU - {D8C3DF59-2AF7-4DEC-86DD-2765DA71C8D6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D8C3DF59-2AF7-4DEC-86DD-2765DA71C8D6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D8C3DF59-2AF7-4DEC-86DD-2765DA71C8D6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D8C3DF59-2AF7-4DEC-86DD-2765DA71C8D6}.Release|Any CPU.Build.0 = Release|Any CPU + {979A8E74-AE20-49B6-B5CD-007A6C7614C4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {979A8E74-AE20-49B6-B5CD-007A6C7614C4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {979A8E74-AE20-49B6-B5CD-007A6C7614C4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {979A8E74-AE20-49B6-B5CD-007A6C7614C4}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -41,6 +41,6 @@ Global SolutionGuid = {D39D5BFF-1FB6-4543-9752-418308400A84} EndGlobalSection GlobalSection(MonoDevelopProperties) = preSolution - version = 4.1.0-preview.8 + version = 4.1.0-preview.7 EndGlobalSection EndGlobal From f5f28d958cbb251efd76d44b6c8d9011ca8ca517 Mon Sep 17 00:00:00 2001 From: Ashley Wilson Date: Thu, 24 Oct 2024 08:41:18 -0400 Subject: [PATCH 17/24] Bump package build to .NET 8 --- .github/workflows/package-release.yml | 2 +- src/UDS.Net.API.Client/UDS.Net.API.Client.csproj | 4 ++-- src/UDS.Net.API/UDS.Net.API.csproj | 2 +- src/UDS.Net.Dto/UDS.Net.Dto.csproj | 4 ++-- src/UDS.Net.sln | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/package-release.yml b/.github/workflows/package-release.yml index a3fe4b4..3e331e0 100644 --- a/.github/workflows/package-release.yml +++ b/.github/workflows/package-release.yml @@ -23,7 +23,7 @@ jobs: - name: Setup .NET Core uses: actions/setup-dotnet@v2 with: - dotnet-version: 6.0.x + dotnet-version: 8.0.x source-url: https://nuget.pkg.github.com/UK-SBCoA/index.json env: NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/src/UDS.Net.API.Client/UDS.Net.API.Client.csproj b/src/UDS.Net.API.Client/UDS.Net.API.Client.csproj index 31cea19..4f8cab6 100644 --- a/src/UDS.Net.API.Client/UDS.Net.API.Client.csproj +++ b/src/UDS.Net.API.Client/UDS.Net.API.Client.csproj @@ -4,13 +4,13 @@ netstandard2.1 Library UDS.Net.API.Client - 4.1.0-preview.7 + 4.1.0-preview.8 Sanders-Brown Center on Aging UDS client library for using UDS.Net.API UK-SBCoA Client library for API https://github.com/UK-SBCoA/uniform-data-set-dotnet-api - 4.1.0-preview.7 + 4.1.0-preview.8 diff --git a/src/UDS.Net.API/UDS.Net.API.csproj b/src/UDS.Net.API/UDS.Net.API.csproj index 55939f7..b67eef3 100644 --- a/src/UDS.Net.API/UDS.Net.API.csproj +++ b/src/UDS.Net.API/UDS.Net.API.csproj @@ -4,7 +4,7 @@ net8.0 enable enable - 4.1.0-preview.7 + 4.1.0-preview.8 ../docker-compose.dcproj c1dd1715-6fa0-4515-bcf2-6a7f6a0c11a5 Release;Debug diff --git a/src/UDS.Net.Dto/UDS.Net.Dto.csproj b/src/UDS.Net.Dto/UDS.Net.Dto.csproj index fd44e92..6b3341d 100644 --- a/src/UDS.Net.Dto/UDS.Net.Dto.csproj +++ b/src/UDS.Net.Dto/UDS.Net.Dto.csproj @@ -4,13 +4,13 @@ netstandard2.1 Library UDS.Net.Dto - 4.1.0-preview.7 + 4.1.0-preview.8 Sanders-Brown Center on Aging UDS data transfer objects for use with API UK-SBCoA Dtos for API https://github.com/UK-SBCoA/uniform-data-set-dotnet-api - 4.1.0-preview.7 + 4.1.0-preview.8 diff --git a/src/UDS.Net.sln b/src/UDS.Net.sln index 48f245f..5a4b11e 100644 --- a/src/UDS.Net.sln +++ b/src/UDS.Net.sln @@ -41,6 +41,6 @@ Global SolutionGuid = {D39D5BFF-1FB6-4543-9752-418308400A84} EndGlobalSection GlobalSection(MonoDevelopProperties) = preSolution - version = 4.1.0-preview.7 + version = 4.1.0-preview.8 EndGlobalSection EndGlobal From 8363e869f3d1f5e9bc8b2eb5435bba42f3d6c88f Mon Sep 17 00:00:00 2001 From: Ashley Wilson Date: Thu, 24 Oct 2024 10:44:40 -0400 Subject: [PATCH 18/24] Get visits and packets by status --- src/UDS.Net.API.Client/PacketClient.cs | 46 +++++++++++++++++-- .../UDS.Net.API.Client.csproj | 4 +- src/UDS.Net.API.Client/VisitClient.cs | 29 +++++++++++- src/UDS.Net.API/UDS.Net.API.csproj | 2 +- src/UDS.Net.Dto/UDS.Net.Dto.csproj | 4 +- src/UDS.Net.sln | 2 +- 6 files changed, 74 insertions(+), 13 deletions(-) diff --git a/src/UDS.Net.API.Client/PacketClient.cs b/src/UDS.Net.API.Client/PacketClient.cs index 57a2991..7dbef14 100644 --- a/src/UDS.Net.API.Client/PacketClient.cs +++ b/src/UDS.Net.API.Client/PacketClient.cs @@ -25,18 +25,54 @@ public async Task GetPacketWithForms(int id) public async Task CountByStatusAndAssignee(string[] statuses, string assignedTo) { - var response = await GetRequest($"{_BasePath}/Count/ByStatus/{statuses}"); + if (statuses != null) + { + var stringStatuses = string.Join(",", statuses); - int count = JsonSerializer.Deserialize(response, options); + if (string.IsNullOrWhiteSpace(stringStatuses)) + return 0; - return count; + if (string.IsNullOrWhiteSpace(assignedTo)) + { + var response = await GetRequest($"{_BasePath}/Count/ByStatus/{stringStatuses}"); + + return JsonSerializer.Deserialize(response, options); + } + else + { + var response = await GetRequest($"{_BasePath}/Count/ByStatus/{stringStatuses}?assignedTo={assignedTo}"); + + return JsonSerializer.Deserialize(response, options); + } + } + return 0; } public async Task> GetPacketsByStatusAndAssignee(string[] statuses, string assignedTo, int pageSize = 10, int pageIndex = 1) { - var response = await GetRequest($"{_BasePath}/ByStatus/{statuses}?pageSize={pageSize}&pageIndex={pageIndex}"); + List dto = new List(); + + + if (statuses != null) + { + var stringStatuses = string.Join(",", statuses); + + if (!string.IsNullOrWhiteSpace(stringStatuses)) + { + if (string.IsNullOrWhiteSpace(assignedTo)) + { + var response = await GetRequest($"{_BasePath}/ByStatus/{stringStatuses}?pageSize={pageSize}&pageIndex={pageIndex}"); + + dto = JsonSerializer.Deserialize>(response, options); + } + else + { + var response = await GetRequest($"{_BasePath}/ByStatus/{stringStatuses}?assignedTo={assignedTo}&pageSize={pageSize}&pageIndex={pageIndex}"); - List dto = JsonSerializer.Deserialize>(response, options); + dto = JsonSerializer.Deserialize>(response, options); + } + } + } return dto; } diff --git a/src/UDS.Net.API.Client/UDS.Net.API.Client.csproj b/src/UDS.Net.API.Client/UDS.Net.API.Client.csproj index 4f8cab6..2ef45e5 100644 --- a/src/UDS.Net.API.Client/UDS.Net.API.Client.csproj +++ b/src/UDS.Net.API.Client/UDS.Net.API.Client.csproj @@ -4,13 +4,13 @@ netstandard2.1 Library UDS.Net.API.Client - 4.1.0-preview.8 + 4.1.0-preview.9 Sanders-Brown Center on Aging UDS client library for using UDS.Net.API UK-SBCoA Client library for API https://github.com/UK-SBCoA/uniform-data-set-dotnet-api - 4.1.0-preview.8 + 4.1.0-preview.9 diff --git a/src/UDS.Net.API.Client/VisitClient.cs b/src/UDS.Net.API.Client/VisitClient.cs index a1cccc1..f6ac4cd 100644 --- a/src/UDS.Net.API.Client/VisitClient.cs +++ b/src/UDS.Net.API.Client/VisitClient.cs @@ -16,12 +16,37 @@ public VisitClient(HttpClient httpClient) : base(httpClient, BASEPATH) public async Task> GetVisitsAtStatus(string[] statuses, int pageSize = 10, int pageIndex = 1) { - throw new System.NotImplementedException(); + List dto = new List(); + + if (statuses != null) + { + var stringStatuses = string.Join(",", statuses); + + if (!string.IsNullOrWhiteSpace(stringStatuses)) + { + var response = await GetRequest($"{_BasePath}/ByStatus/{stringStatuses}?pageSize={pageSize}&pageIndex={pageIndex}"); + + dto = JsonSerializer.Deserialize>(response, options); + } + } + + return dto; } public async Task GetCountOfVisitsAtStatus(string[] statuses) { - throw new System.NotImplementedException(); + if (statuses != null) + { + var stringStatuses = string.Join(",", statuses); + + if (string.IsNullOrWhiteSpace(stringStatuses)) + return 0; + + var response = await GetRequest($"{_BasePath}/Count/ByStatus/{stringStatuses}"); + + return JsonSerializer.Deserialize(response, options); + } + return 0; } public async Task GetWithForm(int id, string formKind) diff --git a/src/UDS.Net.API/UDS.Net.API.csproj b/src/UDS.Net.API/UDS.Net.API.csproj index b67eef3..6fc5733 100644 --- a/src/UDS.Net.API/UDS.Net.API.csproj +++ b/src/UDS.Net.API/UDS.Net.API.csproj @@ -4,7 +4,7 @@ net8.0 enable enable - 4.1.0-preview.8 + 4.1.0-preview.9 ../docker-compose.dcproj c1dd1715-6fa0-4515-bcf2-6a7f6a0c11a5 Release;Debug diff --git a/src/UDS.Net.Dto/UDS.Net.Dto.csproj b/src/UDS.Net.Dto/UDS.Net.Dto.csproj index 6b3341d..d77b43d 100644 --- a/src/UDS.Net.Dto/UDS.Net.Dto.csproj +++ b/src/UDS.Net.Dto/UDS.Net.Dto.csproj @@ -4,13 +4,13 @@ netstandard2.1 Library UDS.Net.Dto - 4.1.0-preview.8 + 4.1.0-preview.9 Sanders-Brown Center on Aging UDS data transfer objects for use with API UK-SBCoA Dtos for API https://github.com/UK-SBCoA/uniform-data-set-dotnet-api - 4.1.0-preview.8 + 4.1.0-preview.9 diff --git a/src/UDS.Net.sln b/src/UDS.Net.sln index 5a4b11e..6985108 100644 --- a/src/UDS.Net.sln +++ b/src/UDS.Net.sln @@ -41,6 +41,6 @@ Global SolutionGuid = {D39D5BFF-1FB6-4543-9752-418308400A84} EndGlobalSection GlobalSection(MonoDevelopProperties) = preSolution - version = 4.1.0-preview.8 + version = 4.1.0-preview.9 EndGlobalSection EndGlobal From a0eba43f39e69c70e41bc91c3a8c42d7f905b1aa Mon Sep 17 00:00:00 2001 From: Ashley Wilson Date: Thu, 24 Oct 2024 10:54:13 -0400 Subject: [PATCH 19/24] Fix query string --- src/UDS.Net.API.Client/PacketClient.cs | 8 ++++---- src/UDS.Net.API.Client/UDS.Net.API.Client.csproj | 4 ++-- src/UDS.Net.API.Client/VisitClient.cs | 4 ++-- src/UDS.Net.API/UDS.Net.API.csproj | 2 +- src/UDS.Net.Dto/UDS.Net.Dto.csproj | 4 ++-- src/UDS.Net.sln | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/UDS.Net.API.Client/PacketClient.cs b/src/UDS.Net.API.Client/PacketClient.cs index 7dbef14..fa158c6 100644 --- a/src/UDS.Net.API.Client/PacketClient.cs +++ b/src/UDS.Net.API.Client/PacketClient.cs @@ -34,13 +34,13 @@ public async Task CountByStatusAndAssignee(string[] statuses, string assign if (string.IsNullOrWhiteSpace(assignedTo)) { - var response = await GetRequest($"{_BasePath}/Count/ByStatus/{stringStatuses}"); + var response = await GetRequest($"{_BasePath}/Count/ByStatus?statuses={stringStatuses}"); return JsonSerializer.Deserialize(response, options); } else { - var response = await GetRequest($"{_BasePath}/Count/ByStatus/{stringStatuses}?assignedTo={assignedTo}"); + var response = await GetRequest($"{_BasePath}/Count/ByStatus?statuses={stringStatuses}&assignedTo={assignedTo}"); return JsonSerializer.Deserialize(response, options); } @@ -61,13 +61,13 @@ public async Task> GetPacketsByStatusAndAssignee(string[] status { if (string.IsNullOrWhiteSpace(assignedTo)) { - var response = await GetRequest($"{_BasePath}/ByStatus/{stringStatuses}?pageSize={pageSize}&pageIndex={pageIndex}"); + var response = await GetRequest($"{_BasePath}/ByStatus?statuses={stringStatuses}&pageSize={pageSize}&pageIndex={pageIndex}"); dto = JsonSerializer.Deserialize>(response, options); } else { - var response = await GetRequest($"{_BasePath}/ByStatus/{stringStatuses}?assignedTo={assignedTo}&pageSize={pageSize}&pageIndex={pageIndex}"); + var response = await GetRequest($"{_BasePath}/ByStatus?statuses={stringStatuses}&assignedTo={assignedTo}&pageSize={pageSize}&pageIndex={pageIndex}"); dto = JsonSerializer.Deserialize>(response, options); } diff --git a/src/UDS.Net.API.Client/UDS.Net.API.Client.csproj b/src/UDS.Net.API.Client/UDS.Net.API.Client.csproj index 2ef45e5..7c37eb2 100644 --- a/src/UDS.Net.API.Client/UDS.Net.API.Client.csproj +++ b/src/UDS.Net.API.Client/UDS.Net.API.Client.csproj @@ -4,13 +4,13 @@ netstandard2.1 Library UDS.Net.API.Client - 4.1.0-preview.9 + 4.1.0-preview.10 Sanders-Brown Center on Aging UDS client library for using UDS.Net.API UK-SBCoA Client library for API https://github.com/UK-SBCoA/uniform-data-set-dotnet-api - 4.1.0-preview.9 + 4.1.0-preview.10 diff --git a/src/UDS.Net.API.Client/VisitClient.cs b/src/UDS.Net.API.Client/VisitClient.cs index f6ac4cd..38f2f3b 100644 --- a/src/UDS.Net.API.Client/VisitClient.cs +++ b/src/UDS.Net.API.Client/VisitClient.cs @@ -24,7 +24,7 @@ public async Task> GetVisitsAtStatus(string[] statuses, int pageS if (!string.IsNullOrWhiteSpace(stringStatuses)) { - var response = await GetRequest($"{_BasePath}/ByStatus/{stringStatuses}?pageSize={pageSize}&pageIndex={pageIndex}"); + var response = await GetRequest($"{_BasePath}/ByStatus?statuses={stringStatuses}&pageSize={pageSize}&pageIndex={pageIndex}"); dto = JsonSerializer.Deserialize>(response, options); } @@ -42,7 +42,7 @@ public async Task GetCountOfVisitsAtStatus(string[] statuses) if (string.IsNullOrWhiteSpace(stringStatuses)) return 0; - var response = await GetRequest($"{_BasePath}/Count/ByStatus/{stringStatuses}"); + var response = await GetRequest($"{_BasePath}/Count/ByStatus?statuses={stringStatuses}"); return JsonSerializer.Deserialize(response, options); } diff --git a/src/UDS.Net.API/UDS.Net.API.csproj b/src/UDS.Net.API/UDS.Net.API.csproj index 6fc5733..f10e8ef 100644 --- a/src/UDS.Net.API/UDS.Net.API.csproj +++ b/src/UDS.Net.API/UDS.Net.API.csproj @@ -4,7 +4,7 @@ net8.0 enable enable - 4.1.0-preview.9 + 4.1.0-preview.10 ../docker-compose.dcproj c1dd1715-6fa0-4515-bcf2-6a7f6a0c11a5 Release;Debug diff --git a/src/UDS.Net.Dto/UDS.Net.Dto.csproj b/src/UDS.Net.Dto/UDS.Net.Dto.csproj index d77b43d..896615e 100644 --- a/src/UDS.Net.Dto/UDS.Net.Dto.csproj +++ b/src/UDS.Net.Dto/UDS.Net.Dto.csproj @@ -4,13 +4,13 @@ netstandard2.1 Library UDS.Net.Dto - 4.1.0-preview.9 + 4.1.0-preview.10 Sanders-Brown Center on Aging UDS data transfer objects for use with API UK-SBCoA Dtos for API https://github.com/UK-SBCoA/uniform-data-set-dotnet-api - 4.1.0-preview.9 + 4.1.0-preview.10 diff --git a/src/UDS.Net.sln b/src/UDS.Net.sln index 6985108..02f5f25 100644 --- a/src/UDS.Net.sln +++ b/src/UDS.Net.sln @@ -41,6 +41,6 @@ Global SolutionGuid = {D39D5BFF-1FB6-4543-9752-418308400A84} EndGlobalSection GlobalSection(MonoDevelopProperties) = preSolution - version = 4.1.0-preview.9 + version = 4.1.0-preview.10 EndGlobalSection EndGlobal From b4be22e7f9cd988c6c28e5c50e270f4dde2d9670 Mon Sep 17 00:00:00 2001 From: Ashley Wilson Date: Thu, 24 Oct 2024 15:54:51 -0400 Subject: [PATCH 20/24] Fix statuses in query --- src/UDS.Net.API.Client/PacketClient.cs | 48 ++++++++++--------- .../UDS.Net.API.Client.csproj | 4 +- src/UDS.Net.API.Client/VisitClient.cs | 27 ++++++----- src/UDS.Net.API/UDS.Net.API.csproj | 2 +- src/UDS.Net.Dto/UDS.Net.Dto.csproj | 4 +- src/UDS.Net.sln | 2 +- 6 files changed, 48 insertions(+), 39 deletions(-) diff --git a/src/UDS.Net.API.Client/PacketClient.cs b/src/UDS.Net.API.Client/PacketClient.cs index fa158c6..1dd9a1d 100644 --- a/src/UDS.Net.API.Client/PacketClient.cs +++ b/src/UDS.Net.API.Client/PacketClient.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using System.Collections.Specialized; using System.Net.Http; using System.Text.Json; using System.Threading.Tasks; @@ -25,22 +26,24 @@ public async Task GetPacketWithForms(int id) public async Task CountByStatusAndAssignee(string[] statuses, string assignedTo) { - if (statuses != null) + if (statuses != null && statuses.Length > 0) { - var stringStatuses = string.Join(",", statuses); + NameValueCollection query = System.Web.HttpUtility.ParseQueryString(string.Empty); - if (string.IsNullOrWhiteSpace(stringStatuses)) - return 0; + foreach (var status in statuses) + { + query.Add("statuses", status); + } if (string.IsNullOrWhiteSpace(assignedTo)) { - var response = await GetRequest($"{_BasePath}/Count/ByStatus?statuses={stringStatuses}"); + var response = await GetRequest($"{_BasePath}/Count/ByStatus?{query.ToString()}"); return JsonSerializer.Deserialize(response, options); } else { - var response = await GetRequest($"{_BasePath}/Count/ByStatus?statuses={stringStatuses}&assignedTo={assignedTo}"); + var response = await GetRequest($"{_BasePath}/Count/ByStatus?{query.ToString()}&assignedTo={assignedTo}"); return JsonSerializer.Deserialize(response, options); } @@ -52,25 +55,26 @@ public async Task> GetPacketsByStatusAndAssignee(string[] status { List dto = new List(); - - if (statuses != null) + if (statuses != null && statuses.Length > 0) { - var stringStatuses = string.Join(",", statuses); + NameValueCollection query = System.Web.HttpUtility.ParseQueryString(string.Empty); + + foreach (var status in statuses) + { + query.Add("statuses", status); + } - if (!string.IsNullOrWhiteSpace(stringStatuses)) + if (string.IsNullOrWhiteSpace(assignedTo)) + { + var response = await GetRequest($"{_BasePath}/ByStatus?{query.ToString()}&pageSize={pageSize}&pageIndex={pageIndex}"); + + dto = JsonSerializer.Deserialize>(response, options); + } + else { - if (string.IsNullOrWhiteSpace(assignedTo)) - { - var response = await GetRequest($"{_BasePath}/ByStatus?statuses={stringStatuses}&pageSize={pageSize}&pageIndex={pageIndex}"); - - dto = JsonSerializer.Deserialize>(response, options); - } - else - { - var response = await GetRequest($"{_BasePath}/ByStatus?statuses={stringStatuses}&assignedTo={assignedTo}&pageSize={pageSize}&pageIndex={pageIndex}"); - - dto = JsonSerializer.Deserialize>(response, options); - } + var response = await GetRequest($"{_BasePath}/ByStatus?{query.ToString()}&assignedTo={assignedTo}&pageSize={pageSize}&pageIndex={pageIndex}"); + + dto = JsonSerializer.Deserialize>(response, options); } } diff --git a/src/UDS.Net.API.Client/UDS.Net.API.Client.csproj b/src/UDS.Net.API.Client/UDS.Net.API.Client.csproj index 7c37eb2..f831e14 100644 --- a/src/UDS.Net.API.Client/UDS.Net.API.Client.csproj +++ b/src/UDS.Net.API.Client/UDS.Net.API.Client.csproj @@ -4,13 +4,13 @@ netstandard2.1 Library UDS.Net.API.Client - 4.1.0-preview.10 + 4.1.0-preview.11 Sanders-Brown Center on Aging UDS client library for using UDS.Net.API UK-SBCoA Client library for API https://github.com/UK-SBCoA/uniform-data-set-dotnet-api - 4.1.0-preview.10 + 4.1.0-preview.11 diff --git a/src/UDS.Net.API.Client/VisitClient.cs b/src/UDS.Net.API.Client/VisitClient.cs index 38f2f3b..b393a74 100644 --- a/src/UDS.Net.API.Client/VisitClient.cs +++ b/src/UDS.Net.API.Client/VisitClient.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using System.Collections.Specialized; using System.Net.Http; using System.Text.Json; using System.Threading.Tasks; @@ -18,16 +19,18 @@ public async Task> GetVisitsAtStatus(string[] statuses, int pageS { List dto = new List(); - if (statuses != null) + if (statuses != null && statuses.Length > 0) { - var stringStatuses = string.Join(",", statuses); + NameValueCollection query = System.Web.HttpUtility.ParseQueryString(string.Empty); - if (!string.IsNullOrWhiteSpace(stringStatuses)) + foreach (var status in statuses) { - var response = await GetRequest($"{_BasePath}/ByStatus?statuses={stringStatuses}&pageSize={pageSize}&pageIndex={pageIndex}"); - - dto = JsonSerializer.Deserialize>(response, options); + query.Add("statuses", status); } + + var response = await GetRequest($"{_BasePath}/ByStatus?{query.ToString()}&pageSize={pageSize}&pageIndex={pageIndex}"); + + dto = JsonSerializer.Deserialize>(response, options); } return dto; @@ -35,14 +38,16 @@ public async Task> GetVisitsAtStatus(string[] statuses, int pageS public async Task GetCountOfVisitsAtStatus(string[] statuses) { - if (statuses != null) + if (statuses != null && statuses.Length > 0) { - var stringStatuses = string.Join(",", statuses); + NameValueCollection query = System.Web.HttpUtility.ParseQueryString(string.Empty); - if (string.IsNullOrWhiteSpace(stringStatuses)) - return 0; + foreach (var status in statuses) + { + query.Add("statuses", status); + } - var response = await GetRequest($"{_BasePath}/Count/ByStatus?statuses={stringStatuses}"); + var response = await GetRequest($"{_BasePath}/Count/ByStatus?{query.ToString()}"); return JsonSerializer.Deserialize(response, options); } diff --git a/src/UDS.Net.API/UDS.Net.API.csproj b/src/UDS.Net.API/UDS.Net.API.csproj index f10e8ef..667b84a 100644 --- a/src/UDS.Net.API/UDS.Net.API.csproj +++ b/src/UDS.Net.API/UDS.Net.API.csproj @@ -4,7 +4,7 @@ net8.0 enable enable - 4.1.0-preview.10 + 4.1.0-preview.11 ../docker-compose.dcproj c1dd1715-6fa0-4515-bcf2-6a7f6a0c11a5 Release;Debug diff --git a/src/UDS.Net.Dto/UDS.Net.Dto.csproj b/src/UDS.Net.Dto/UDS.Net.Dto.csproj index 896615e..d9b1c0d 100644 --- a/src/UDS.Net.Dto/UDS.Net.Dto.csproj +++ b/src/UDS.Net.Dto/UDS.Net.Dto.csproj @@ -4,13 +4,13 @@ netstandard2.1 Library UDS.Net.Dto - 4.1.0-preview.10 + 4.1.0-preview.11 Sanders-Brown Center on Aging UDS data transfer objects for use with API UK-SBCoA Dtos for API https://github.com/UK-SBCoA/uniform-data-set-dotnet-api - 4.1.0-preview.10 + 4.1.0-preview.11 diff --git a/src/UDS.Net.sln b/src/UDS.Net.sln index 02f5f25..6d1a086 100644 --- a/src/UDS.Net.sln +++ b/src/UDS.Net.sln @@ -41,6 +41,6 @@ Global SolutionGuid = {D39D5BFF-1FB6-4543-9752-418308400A84} EndGlobalSection GlobalSection(MonoDevelopProperties) = preSolution - version = 4.1.0-preview.10 + version = 4.1.0-preview.11 EndGlobalSection EndGlobal From ed6d33f454efb8e7623118c8e76dc880c61c7e67 Mon Sep 17 00:00:00 2001 From: Ashley Wilson Date: Fri, 25 Oct 2024 14:09:26 -0400 Subject: [PATCH 21/24] Ignore .github dir with linter --- .github/linters/.jscpd.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/linters/.jscpd.json b/.github/linters/.jscpd.json index bb91d46..8983df0 100644 --- a/.github/linters/.jscpd.json +++ b/.github/linters/.jscpd.json @@ -6,7 +6,8 @@ "ignore": [ "**/__snapshots__/**", "**/Properties/**", - "**/UDS.Net.API/Data/**" + "**/UDS.Net.API/Data/**", + "**/.github/**" ], "absolute": true - } \ No newline at end of file + } From 24589631b3fff544764d84330756747576b931bd Mon Sep 17 00:00:00 2001 From: Ashley Wilson Date: Mon, 28 Oct 2024 07:21:37 -0400 Subject: [PATCH 22/24] Exclude gitignore directory from linting --- .github/linters/.jscpd.json | 3 +-- .github/workflows/super-linter.yml | 3 ++- src/UDS.Net.API.Client/UDS.Net.API.Client.csproj | 4 ++-- src/UDS.Net.API/UDS.Net.API.csproj | 2 +- src/UDS.Net.Dto/UDS.Net.Dto.csproj | 4 ++-- src/UDS.Net.sln | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/linters/.jscpd.json b/.github/linters/.jscpd.json index 8983df0..940f292 100644 --- a/.github/linters/.jscpd.json +++ b/.github/linters/.jscpd.json @@ -6,8 +6,7 @@ "ignore": [ "**/__snapshots__/**", "**/Properties/**", - "**/UDS.Net.API/Data/**", - "**/.github/**" + "**/UDS.Net.API/Data/**" ], "absolute": true } diff --git a/.github/workflows/super-linter.yml b/.github/workflows/super-linter.yml index 60ba539..cb38dd6 100644 --- a/.github/workflows/super-linter.yml +++ b/.github/workflows/super-linter.yml @@ -27,4 +27,5 @@ jobs: VALIDATE_ALL_CODEBASE: false DEFAULT_BRANCH: "main" GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - VALIDATE_MARKDOWN: false \ No newline at end of file + VALIDATE_MARKDOWN: false + FILTER_REGEX_EXCLUDE: .*.gitignore/.* \ No newline at end of file diff --git a/src/UDS.Net.API.Client/UDS.Net.API.Client.csproj b/src/UDS.Net.API.Client/UDS.Net.API.Client.csproj index f831e14..64d3e7f 100644 --- a/src/UDS.Net.API.Client/UDS.Net.API.Client.csproj +++ b/src/UDS.Net.API.Client/UDS.Net.API.Client.csproj @@ -4,13 +4,13 @@ netstandard2.1 Library UDS.Net.API.Client - 4.1.0-preview.11 + 4.1.0 Sanders-Brown Center on Aging UDS client library for using UDS.Net.API UK-SBCoA Client library for API https://github.com/UK-SBCoA/uniform-data-set-dotnet-api - 4.1.0-preview.11 + 4.1.0 diff --git a/src/UDS.Net.API/UDS.Net.API.csproj b/src/UDS.Net.API/UDS.Net.API.csproj index 667b84a..81180b0 100644 --- a/src/UDS.Net.API/UDS.Net.API.csproj +++ b/src/UDS.Net.API/UDS.Net.API.csproj @@ -4,7 +4,7 @@ net8.0 enable enable - 4.1.0-preview.11 + 4.1.0 ../docker-compose.dcproj c1dd1715-6fa0-4515-bcf2-6a7f6a0c11a5 Release;Debug diff --git a/src/UDS.Net.Dto/UDS.Net.Dto.csproj b/src/UDS.Net.Dto/UDS.Net.Dto.csproj index d9b1c0d..3d36dca 100644 --- a/src/UDS.Net.Dto/UDS.Net.Dto.csproj +++ b/src/UDS.Net.Dto/UDS.Net.Dto.csproj @@ -4,13 +4,13 @@ netstandard2.1 Library UDS.Net.Dto - 4.1.0-preview.11 + 4.1.0 Sanders-Brown Center on Aging UDS data transfer objects for use with API UK-SBCoA Dtos for API https://github.com/UK-SBCoA/uniform-data-set-dotnet-api - 4.1.0-preview.11 + 4.1.0 diff --git a/src/UDS.Net.sln b/src/UDS.Net.sln index 6d1a086..b176b43 100644 --- a/src/UDS.Net.sln +++ b/src/UDS.Net.sln @@ -41,6 +41,6 @@ Global SolutionGuid = {D39D5BFF-1FB6-4543-9752-418308400A84} EndGlobalSection GlobalSection(MonoDevelopProperties) = preSolution - version = 4.1.0-preview.11 + version = 4.1.0 EndGlobalSection EndGlobal From c27e87873392365aee668c2e1397bcadffad3e65 Mon Sep 17 00:00:00 2001 From: Ashley Wilson Date: Mon, 28 Oct 2024 09:03:11 -0400 Subject: [PATCH 23/24] Format exclude statement to known formatting --- .github/workflows/super-linter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/super-linter.yml b/.github/workflows/super-linter.yml index cb38dd6..836f909 100644 --- a/.github/workflows/super-linter.yml +++ b/.github/workflows/super-linter.yml @@ -28,4 +28,4 @@ jobs: DEFAULT_BRANCH: "main" GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} VALIDATE_MARKDOWN: false - FILTER_REGEX_EXCLUDE: .*.gitignore/.* \ No newline at end of file + FILTER_REGEX_EXCLUDE: (.*.github/.*|.*Properties/.*) \ No newline at end of file From 02b42cf65d664d1e52ead0772b1901d0db0e9d60 Mon Sep 17 00:00:00 2001 From: Ashley Wilson Date: Mon, 28 Oct 2024 11:49:58 -0400 Subject: [PATCH 24/24] Regenerate migration so assigned and resolved can be null. Ensure unresolved errors are always returned --- ...35707_SupportPacketSubmission.Designer.cs} | 5 +- ...20241028135707_SupportPacketSubmission.cs} | 6 +- .../Migrations/ApiDbContextModelSnapshot.cs | 3 - .../Entities/PacketSubmissionError.cs | 10 +-- .../Extensions/EntityToDtoMapper.cs | 76 +++++++++++-------- 5 files changed, 55 insertions(+), 45 deletions(-) rename src/UDS.Net.API/Data/Migrations/{20241024113252_SupportPacketSubmission.Designer.cs => 20241028135707_SupportPacketSubmission.Designer.cs} (99%) rename src/UDS.Net.API/Data/Migrations/{20241024113252_SupportPacketSubmission.cs => 20241028135707_SupportPacketSubmission.cs} (97%) diff --git a/src/UDS.Net.API/Data/Migrations/20241024113252_SupportPacketSubmission.Designer.cs b/src/UDS.Net.API/Data/Migrations/20241028135707_SupportPacketSubmission.Designer.cs similarity index 99% rename from src/UDS.Net.API/Data/Migrations/20241024113252_SupportPacketSubmission.Designer.cs rename to src/UDS.Net.API/Data/Migrations/20241028135707_SupportPacketSubmission.Designer.cs index 29c4341..03abbcd 100644 --- a/src/UDS.Net.API/Data/Migrations/20241024113252_SupportPacketSubmission.Designer.cs +++ b/src/UDS.Net.API/Data/Migrations/20241028135707_SupportPacketSubmission.Designer.cs @@ -12,7 +12,7 @@ namespace UDS.Net.API.Data.Migrations { [DbContext(typeof(ApiDbContext))] - [Migration("20241024113252_SupportPacketSubmission")] + [Migration("20241028135707_SupportPacketSubmission")] partial class SupportPacketSubmission { /// @@ -5409,7 +5409,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); b.Property("AssignedTo") - .IsRequired() .HasColumnType("nvarchar(max)"); b.Property("CreatedAt") @@ -5423,7 +5422,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .HasColumnType("nvarchar(max)"); b.Property("FormKind") - .IsRequired() .HasMaxLength(10) .HasColumnType("nvarchar(10)"); @@ -5445,7 +5443,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .HasColumnType("int"); b.Property("ResolvedBy") - .IsRequired() .HasColumnType("nvarchar(max)"); b.HasKey("Id"); diff --git a/src/UDS.Net.API/Data/Migrations/20241024113252_SupportPacketSubmission.cs b/src/UDS.Net.API/Data/Migrations/20241028135707_SupportPacketSubmission.cs similarity index 97% rename from src/UDS.Net.API/Data/Migrations/20241024113252_SupportPacketSubmission.cs rename to src/UDS.Net.API/Data/Migrations/20241028135707_SupportPacketSubmission.cs index 1217078..23e8e02 100644 --- a/src/UDS.Net.API/Data/Migrations/20241024113252_SupportPacketSubmission.cs +++ b/src/UDS.Net.API/Data/Migrations/20241028135707_SupportPacketSubmission.cs @@ -50,11 +50,11 @@ protected override void Up(MigrationBuilder migrationBuilder) { PacketSubmissionErrorId = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), - FormKind = table.Column(type: "nvarchar(10)", maxLength: 10, nullable: false), + FormKind = table.Column(type: "nvarchar(10)", maxLength: 10, nullable: true), Message = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: false), - AssignedTo = table.Column(type: "nvarchar(max)", nullable: false), + AssignedTo = table.Column(type: "nvarchar(max)", nullable: true), Level = table.Column(type: "int", nullable: false), - ResolvedBy = table.Column(type: "nvarchar(max)", nullable: false), + ResolvedBy = table.Column(type: "nvarchar(max)", nullable: true), PacketSubmissionId = table.Column(type: "int", nullable: false), CreatedAt = table.Column(type: "datetime2", nullable: false), CreatedBy = table.Column(type: "nvarchar(max)", nullable: false), diff --git a/src/UDS.Net.API/Data/Migrations/ApiDbContextModelSnapshot.cs b/src/UDS.Net.API/Data/Migrations/ApiDbContextModelSnapshot.cs index 6131018..e636b32 100644 --- a/src/UDS.Net.API/Data/Migrations/ApiDbContextModelSnapshot.cs +++ b/src/UDS.Net.API/Data/Migrations/ApiDbContextModelSnapshot.cs @@ -5406,7 +5406,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); b.Property("AssignedTo") - .IsRequired() .HasColumnType("nvarchar(max)"); b.Property("CreatedAt") @@ -5420,7 +5419,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasColumnType("nvarchar(max)"); b.Property("FormKind") - .IsRequired() .HasMaxLength(10) .HasColumnType("nvarchar(10)"); @@ -5442,7 +5440,6 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasColumnType("int"); b.Property("ResolvedBy") - .IsRequired() .HasColumnType("nvarchar(max)"); b.HasKey("Id"); diff --git a/src/UDS.Net.API/Entities/PacketSubmissionError.cs b/src/UDS.Net.API/Entities/PacketSubmissionError.cs index c9a0be4..a483c9e 100644 --- a/src/UDS.Net.API/Entities/PacketSubmissionError.cs +++ b/src/UDS.Net.API/Entities/PacketSubmissionError.cs @@ -11,18 +11,18 @@ public class PacketSubmissionError : BaseEntity public int Id { get; set; } [MaxLength(10)] - public string FormKind { get; set; } + public string? FormKind { get; set; } // it might be possible for an error to be at the visit and not a specific form [MaxLength(500)] - public string Message { get; set; } + public required string Message { get; set; } - public string AssignedTo { get; set; } + public string? AssignedTo { get; set; } public PacketSubmissionErrorLevel Level { get; set; } - public string ResolvedBy { get; set; } + public string? ResolvedBy { get; set; } - public PacketSubmission PacketSubmission { get; set; } + public PacketSubmission PacketSubmission { get; set; } = default!; public int PacketSubmissionId { get; set; } } diff --git a/src/UDS.Net.API/Extensions/EntityToDtoMapper.cs b/src/UDS.Net.API/Extensions/EntityToDtoMapper.cs index fa55b21..154f2ac 100644 --- a/src/UDS.Net.API/Extensions/EntityToDtoMapper.cs +++ b/src/UDS.Net.API/Extensions/EntityToDtoMapper.cs @@ -25,6 +25,49 @@ private static VisitDto ConvertVisitToDto(Visit visit) }; } + private static VisitDto UpdateWithSubmissions(this VisitDto dto, Visit visit) + { + if (visit.PacketSubmissions != null) + { + int? unresolvedErrorsCount = null; + var unresolvedErrors = new List(); + foreach (var submission in visit.PacketSubmissions) + { + if (submission != null && submission.ErrorCount.HasValue && submission.PacketSubmissionErrors != null) + { + foreach (var error in submission.PacketSubmissionErrors) + { + if (error != null && String.IsNullOrWhiteSpace(error.ResolvedBy)) + { + if (!unresolvedErrorsCount.HasValue) + unresolvedErrorsCount = 1; + else + unresolvedErrorsCount += 1; + unresolvedErrors.Add(error.ToDto()); + if (dto.Forms != null) + { + // if there are forms, also update the number of unresolved errors and errors list per form + var formDto = dto.Forms.Where(f => f.Kind == error.FormKind).FirstOrDefault(); + if (formDto != null) + { + if (!formDto.UnresolvedErrorCount.HasValue) + formDto.UnresolvedErrorCount = 1; + else + formDto.UnresolvedErrorCount += 1; + formDto.UnresolvedErrors.Add(error.ToDto()); + } + } + } + } + } + } + dto.TotalUnresolvedErrorCount = unresolvedErrorsCount; + dto.UnresolvedErrors = unresolvedErrors; + } + + return dto; + } + public static PacketDto ToPacketDto(this Visit visit) { PacketDto dto = new PacketDto() @@ -75,36 +118,7 @@ public static VisitDto ToDto(this Visit visit) } } - if (visit.PacketSubmissions != null) - { - int? unresolvedErrorsCount = null; - var unresolvedErrors = new List(); - foreach (var submission in visit.PacketSubmissions) - { - if (submission != null && submission.ErrorCount.HasValue && submission.PacketSubmissionErrors != null) - { - foreach (var error in submission.PacketSubmissionErrors) - { - if (error != null && String.IsNullOrWhiteSpace(error.ResolvedBy)) - { - unresolvedErrorsCount += 1; - unresolvedErrors.Add(error.ToDto()); - if (dto.Forms != null) - { - // if there are forms, also update the number of unresolved errors and errors list per form - var formDto = dto.Forms.Where(f => f.Kind == error.FormKind).FirstOrDefault(); - if (formDto != null) - { - formDto.UnresolvedErrorCount += 1; - formDto.UnresolvedErrors.Add(error.ToDto()); - } - } - } - } - } - } - dto.TotalUnresolvedErrorCount = unresolvedErrorsCount; - } + dto.UpdateWithSubmissions(visit); return dto; } @@ -191,6 +205,8 @@ public static VisitDto ToDto(this Visit visit, string formKind) } + dto.UpdateWithSubmissions(visit); + return dto; }