complete create medical history template
parent
867b7be19d
commit
24b92acd4b
|
@ -4,8 +4,7 @@ public class CityController : ICarterModule
|
|||
|
||||
public virtual void AddRoutes(IEndpointRouteBuilder app)
|
||||
{
|
||||
var group = app.NewVersionedApi("City").MapGroup($"api/city")
|
||||
.RequireAuthorization(builder => builder.AddAuthenticationSchemes("Bearer").RequireAuthenticatedUser());
|
||||
var group = app.NewVersionedApi("City").MapGroup($"api/city");
|
||||
|
||||
group.MapGet("", GetAllAsync)
|
||||
.WithDisplayName("GetAll")
|
||||
|
|
|
@ -0,0 +1,86 @@
|
|||
using DocuMed.Api.Services;
|
||||
using DocuMed.Domain.Dtos.LargDtos;
|
||||
|
||||
namespace DocuMed.Api.Controllers;
|
||||
|
||||
public class MedicalHistoryTemplateController : ICarterModule
|
||||
{
|
||||
public virtual void AddRoutes(IEndpointRouteBuilder app)
|
||||
{
|
||||
var group = app.NewVersionedApi("MedicalHistoryTemplate").MapGroup($"api/medicalhistory/template")
|
||||
.RequireAuthorization(builder => builder.AddAuthenticationSchemes("Bearer").RequireAuthenticatedUser());
|
||||
|
||||
group.MapGet("", GetAllAsync)
|
||||
.WithDisplayName("GetAll")
|
||||
.HasApiVersion(1.0);
|
||||
|
||||
group.MapGet("{id}", GetAsync)
|
||||
.WithDisplayName("GetOne")
|
||||
.HasApiVersion(1.0);
|
||||
|
||||
group.MapPost("", Post)
|
||||
.HasApiVersion(1.0);
|
||||
|
||||
group.MapPut("", Put)
|
||||
.HasApiVersion(1.0);
|
||||
|
||||
group.MapDelete("", Delete)
|
||||
.HasApiVersion(1.0);
|
||||
}
|
||||
|
||||
|
||||
// GET:Get All Entity
|
||||
public virtual async Task<IResult> GetAllAsync([FromQuery] int page, IRepositoryWrapper repositoryWrapper,ICurrentUserService currentUserService, CancellationToken cancellationToken)
|
||||
{
|
||||
if (!Guid.TryParse(currentUserService.UserId, out Guid userId))
|
||||
throw new AppException("توکن غیرمجاز", ApiResultStatusCode.UnAuthorized);
|
||||
var list = await repositoryWrapper.SetRepository<MedicalHistoryTemplate>().TableNoTracking
|
||||
.Where(t=>t.ApplicationUserId== userId)
|
||||
.OrderByDescending(t=>t.CreatedAt)
|
||||
.Skip(page*15)
|
||||
.Take(15)
|
||||
.Select(MedicalHistoryTemplateMapper.ProjectToSDto)
|
||||
.ToListAsync(cancellationToken);
|
||||
return TypedResults.Ok(list);
|
||||
}
|
||||
|
||||
// GET:Get An Entity By Id
|
||||
public async Task<IResult> GetAsync(Guid id, IRepositoryWrapper repositoryWrapper,
|
||||
CancellationToken cancellationToken)
|
||||
=> TypedResults.Ok(await repositoryWrapper.SetRepository<MedicalHistoryTemplate>()
|
||||
.GetByIdAsync(cancellationToken, id));
|
||||
|
||||
// POST:Add New Entity
|
||||
public virtual async Task<IResult> Post([FromBody] MedicalHistoryTemplateLDto dto, IRepositoryWrapper repositoryWrapper,ICurrentUserService currentUserService, CancellationToken cancellationToken)
|
||||
{
|
||||
if (!Guid.TryParse(currentUserService.UserId, out Guid userId))
|
||||
throw new AppException("توکن غیرمجاز", ApiResultStatusCode.UnAuthorized);
|
||||
var ent = MedicalHistoryTemplate.Create(dto.ChiefComplaint,dto.SectionId, userId);
|
||||
foreach (var question in dto.Questions)
|
||||
ent.AddQuestion(question.Question, question.Part, question.QuestionType);
|
||||
repositoryWrapper.SetRepository<MedicalHistoryTemplate>().Add(ent);
|
||||
await repositoryWrapper.SaveChangesAsync(cancellationToken);
|
||||
return TypedResults.Ok();
|
||||
}
|
||||
|
||||
// PUT:Update Entity
|
||||
public virtual async Task<IResult> Put([FromBody] MedicalHistoryTemplateLDto dto, IRepositoryWrapper repositoryWrapper,ICurrentUserService currentUserService, CancellationToken cancellationToken)
|
||||
{
|
||||
if (!Guid.TryParse(currentUserService.UserId, out Guid userId))
|
||||
throw new AppException("توکن غیرمجاز", ApiResultStatusCode.UnAuthorized);
|
||||
var ent = MedicalHistoryTemplate.Create(dto.ChiefComplaint, dto.SectionId, userId);
|
||||
ent.Id = dto.Id;
|
||||
repositoryWrapper.SetRepository<MedicalHistoryTemplate>().Update(ent);
|
||||
await repositoryWrapper.SaveChangesAsync(cancellationToken);
|
||||
return TypedResults.Ok();
|
||||
}
|
||||
|
||||
// DELETE:Delete Entity
|
||||
public virtual async Task<IResult> Delete(int id, IRepositoryWrapper repositoryWrapper, CancellationToken cancellationToken)
|
||||
{
|
||||
var ent = await repositoryWrapper.SetRepository<MedicalHistoryTemplate>().GetByIdAsync(cancellationToken, id);
|
||||
repositoryWrapper.SetRepository<MedicalHistoryTemplate>().Delete(ent);
|
||||
await repositoryWrapper.SaveChangesAsync(cancellationToken);
|
||||
return TypedResults.Ok();
|
||||
}
|
||||
}
|
|
@ -5,8 +5,7 @@ public class SectionController : ICarterModule
|
|||
{
|
||||
public virtual void AddRoutes(IEndpointRouteBuilder app)
|
||||
{
|
||||
var group = app.NewVersionedApi("Section").MapGroup($"api/section")
|
||||
.RequireAuthorization(builder => builder.AddAuthenticationSchemes("Bearer").RequireAuthenticatedUser());
|
||||
var group = app.NewVersionedApi("Section").MapGroup($"api/section");
|
||||
|
||||
group.MapGet("", GetAllAsync)
|
||||
.WithDisplayName("GetAll")
|
||||
|
|
|
@ -6,8 +6,7 @@ public class UniversityController : ICarterModule
|
|||
public virtual void AddRoutes(IEndpointRouteBuilder app)
|
||||
{
|
||||
var group = app.NewVersionedApi("University")
|
||||
.MapGroup($"api/university")
|
||||
.RequireAuthorization(builder => builder.AddAuthenticationSchemes("Bearer").RequireAuthenticatedUser());
|
||||
.MapGroup($"api/university");
|
||||
|
||||
group.MapGet("", GetAllAsync)
|
||||
.WithDisplayName("GetAll")
|
||||
|
|
|
@ -74,6 +74,7 @@
|
|||
<Using Include="DocuMed.Domain.Dtos.RequestDtos" />
|
||||
<Using Include="DocuMed.Domain.Dtos.SmallDtos" />
|
||||
<Using Include="DocuMed.Domain.Entities.City" />
|
||||
<Using Include="DocuMed.Domain.Entities.MedicalHistoryTemplate" />
|
||||
<Using Include="DocuMed.Domain.Entities.User" />
|
||||
<Using Include="DocuMed.Domain.Mappers" />
|
||||
<Using Include="DocuMed.Domain.Models.Settings" />
|
||||
|
|
|
@ -28,6 +28,7 @@ public class MedicalHistoryLDto : BaseDto<MedicalHistoryLDto,MedicalHistory>
|
|||
public int PulseRate { get; set; }
|
||||
public int SPO2 { get; set; }
|
||||
public int Temperature { get; set; }
|
||||
public Guid ApplicationUserId { get; set; }
|
||||
|
||||
public List<MedicalHistoryAnswerSDto> Answers { get; set; } = new();
|
||||
}
|
|
@ -5,5 +5,6 @@ public class MedicalHistoryTemplateLDto : BaseDto<MedicalHistoryTemplateLDto,Med
|
|||
|
||||
public string ChiefComplaint { get; set; } = string.Empty;
|
||||
public Guid SectionId { get; set; }
|
||||
public Guid ApplicationUserId { get; set; }
|
||||
public List<MedicalHistoryQuestionSDto> Questions { get; set; } = new();
|
||||
}
|
|
@ -29,4 +29,5 @@ public class MedicalHistorySDto : BaseDto<MedicalHistorySDto,MedicalHistory>
|
|||
public int SPO2 { get; set; }
|
||||
public int Temperature { get; set; }
|
||||
public string FullName => FirstName + " " + LastName;
|
||||
public Guid ApplicationUserId { get; set; }
|
||||
}
|
|
@ -4,4 +4,5 @@ public class MedicalHistoryTemplateSDto : BaseDto<MedicalHistoryTemplateSDto,Med
|
|||
{
|
||||
public string ChiefComplaint { get; set; } = string.Empty;
|
||||
public Guid SectionId { get; set; }
|
||||
public Guid ApplicationUserId { get; set; }
|
||||
}
|
|
@ -43,7 +43,8 @@ public partial class MedicalHistory
|
|||
int diastolicBloodPressure,
|
||||
int pulseRate,
|
||||
int sPO2,
|
||||
int temperature)
|
||||
int temperature,
|
||||
Guid applicationUserId)
|
||||
{
|
||||
return new MedicalHistory(presentIllnessDetail,
|
||||
pastDiseasesHistoryDetail,
|
||||
|
@ -55,7 +56,7 @@ public partial class MedicalHistory
|
|||
systemReviewDetail,
|
||||
vitalSignDetail,
|
||||
chiefComplaint, section, firstName, lastName, fatherName, nationalId, age, birthDate, systolicBloodPressure,
|
||||
diastolicBloodPressure, pulseRate, sPO2, temperature);
|
||||
diastolicBloodPressure, pulseRate, sPO2, temperature, applicationUserId);
|
||||
}
|
||||
|
||||
}
|
|
@ -32,7 +32,8 @@ public partial class MedicalHistory : ApiEntity
|
|||
int diastolicBloodPressure,
|
||||
int pulseRate,
|
||||
int spo2,
|
||||
int temperature)
|
||||
int temperature,
|
||||
Guid applicationUserId)
|
||||
{
|
||||
PresentIllnessDetail = presentIllnessDetail;
|
||||
PastDiseasesHistoryDetail = pastDiseasesHistoryDetail;
|
||||
|
@ -56,6 +57,7 @@ public partial class MedicalHistory : ApiEntity
|
|||
PulseRate = pulseRate;
|
||||
SPO2 = spo2;
|
||||
Temperature = temperature;
|
||||
ApplicationUserId = applicationUserId;
|
||||
}
|
||||
public string ChiefComplaint { get; internal set; } = string.Empty;
|
||||
public string Section { get; internal set; } = string.Empty;
|
||||
|
@ -84,5 +86,8 @@ public partial class MedicalHistory : ApiEntity
|
|||
public int SPO2 { get; internal set; }
|
||||
public int Temperature { get; internal set; }
|
||||
|
||||
public Guid ApplicationUserId { get; internal set; }
|
||||
public ApplicationUser? ApplicationUser { get; internal set; }
|
||||
|
||||
public List<MedicalHistoryAnswer> Answers { get; internal set; } = new();
|
||||
}
|
|
@ -24,8 +24,8 @@ public partial class MedicalHistoryTemplate
|
|||
return mhQuestion;
|
||||
}
|
||||
|
||||
public static MedicalHistoryTemplate Create(string chiefComplaint)
|
||||
public static MedicalHistoryTemplate Create(string chiefComplaint,Guid sectionId,Guid applicationUserId)
|
||||
{
|
||||
return new MedicalHistoryTemplate(chiefComplaint);
|
||||
return new MedicalHistoryTemplate(chiefComplaint, sectionId, applicationUserId);
|
||||
}
|
||||
}
|
|
@ -12,12 +12,16 @@ public partial class MedicalHistoryTemplate : ApiEntity
|
|||
{
|
||||
|
||||
}
|
||||
public MedicalHistoryTemplate(string chiefComplaint)
|
||||
public MedicalHistoryTemplate(string chiefComplaint,Guid sectionId,Guid applicationUserId)
|
||||
{
|
||||
ChiefComplaint = chiefComplaint;
|
||||
SectionId = sectionId;
|
||||
ApplicationUserId = applicationUserId;
|
||||
}
|
||||
|
||||
public string ChiefComplaint { get; internal set; } = string.Empty;
|
||||
public Guid SectionId { get; set; }
|
||||
public Guid ApplicationUserId { get; internal set; }
|
||||
public ApplicationUser? ApplicationUser { get; set; }
|
||||
public List<MedicalHistoryQuestion> Questions { get; internal set; } = new();
|
||||
}
|
|
@ -7,5 +7,7 @@ public enum MedicalHistoryQuestionType
|
|||
[Display(Name = "پرسش و پاسخ")]
|
||||
Interrogatively,
|
||||
[Display(Name = "بله و خیر")]
|
||||
YesOrNo
|
||||
YesOrNo,
|
||||
[Display(Name = "انتخابی")]
|
||||
Selective
|
||||
}
|
|
@ -31,7 +31,7 @@ namespace DocuMed.Domain.Mappers
|
|||
return result;
|
||||
|
||||
}
|
||||
public static Expression<Func<CitySDto, City>> ProjectToCity => p4 => new City()
|
||||
public static Expression<Func<CitySDto, City>> ProjectLDtoToCity => p4 => new City()
|
||||
{
|
||||
Name = p4.Name,
|
||||
Id = p4.Id
|
||||
|
@ -85,7 +85,7 @@ namespace DocuMed.Domain.Mappers
|
|||
return result;
|
||||
|
||||
}
|
||||
public static Expression<Func<CityLDto, City>> ProjectLDtoToCity => p15 => new City()
|
||||
public static Expression<Func<CityLDto, City>> ProjectToCity => p15 => new City()
|
||||
{
|
||||
Name = p15.Name,
|
||||
Universities = p15.Universities.Select<UniversitySDto, University>(p16 => new University()
|
||||
|
|
|
@ -36,6 +36,7 @@ namespace DocuMed.Domain.Mappers
|
|||
PulseRate = p1.PulseRate,
|
||||
SPO2 = p1.SPO2,
|
||||
Temperature = p1.Temperature,
|
||||
ApplicationUserId = p1.ApplicationUserId,
|
||||
Id = p1.Id
|
||||
};
|
||||
}
|
||||
|
@ -69,6 +70,7 @@ namespace DocuMed.Domain.Mappers
|
|||
result.PulseRate = p2.PulseRate;
|
||||
result.SPO2 = p2.SPO2;
|
||||
result.Temperature = p2.Temperature;
|
||||
result.ApplicationUserId = p2.ApplicationUserId;
|
||||
result.Id = p2.Id;
|
||||
return result;
|
||||
|
||||
|
@ -97,6 +99,7 @@ namespace DocuMed.Domain.Mappers
|
|||
PulseRate = p4.PulseRate,
|
||||
SPO2 = p4.SPO2,
|
||||
Temperature = p4.Temperature,
|
||||
ApplicationUserId = p4.ApplicationUserId,
|
||||
Id = p4.Id
|
||||
};
|
||||
public static MedicalHistorySDto AdaptToSDto(this MedicalHistory p5)
|
||||
|
@ -125,6 +128,7 @@ namespace DocuMed.Domain.Mappers
|
|||
PulseRate = p5.PulseRate,
|
||||
SPO2 = p5.SPO2,
|
||||
Temperature = p5.Temperature,
|
||||
ApplicationUserId = p5.ApplicationUserId,
|
||||
Id = p5.Id
|
||||
};
|
||||
}
|
||||
|
@ -158,6 +162,7 @@ namespace DocuMed.Domain.Mappers
|
|||
result.PulseRate = p6.PulseRate;
|
||||
result.SPO2 = p6.SPO2;
|
||||
result.Temperature = p6.Temperature;
|
||||
result.ApplicationUserId = p6.ApplicationUserId;
|
||||
result.Id = p6.Id;
|
||||
return result;
|
||||
|
||||
|
@ -186,6 +191,7 @@ namespace DocuMed.Domain.Mappers
|
|||
PulseRate = p8.PulseRate,
|
||||
SPO2 = p8.SPO2,
|
||||
Temperature = p8.Temperature,
|
||||
ApplicationUserId = p8.ApplicationUserId,
|
||||
Id = p8.Id
|
||||
};
|
||||
public static MedicalHistory AdaptToMedicalHistory(this MedicalHistoryLDto p9)
|
||||
|
@ -214,6 +220,7 @@ namespace DocuMed.Domain.Mappers
|
|||
PulseRate = p9.PulseRate,
|
||||
SPO2 = p9.SPO2,
|
||||
Temperature = p9.Temperature,
|
||||
ApplicationUserId = p9.ApplicationUserId,
|
||||
Answers = funcMain1(p9.Answers),
|
||||
Id = p9.Id
|
||||
};
|
||||
|
@ -248,6 +255,7 @@ namespace DocuMed.Domain.Mappers
|
|||
result.PulseRate = p11.PulseRate;
|
||||
result.SPO2 = p11.SPO2;
|
||||
result.Temperature = p11.Temperature;
|
||||
result.ApplicationUserId = p11.ApplicationUserId;
|
||||
result.Answers = funcMain2(p11.Answers, result.Answers);
|
||||
result.Id = p11.Id;
|
||||
return result;
|
||||
|
@ -277,6 +285,7 @@ namespace DocuMed.Domain.Mappers
|
|||
PulseRate = p15.PulseRate,
|
||||
SPO2 = p15.SPO2,
|
||||
Temperature = p15.Temperature,
|
||||
ApplicationUserId = p15.ApplicationUserId,
|
||||
Answers = p15.Answers.Select<MedicalHistoryAnswerSDto, MedicalHistoryAnswer>(p16 => new MedicalHistoryAnswer()
|
||||
{
|
||||
Answer = p16.Answer,
|
||||
|
@ -314,6 +323,7 @@ namespace DocuMed.Domain.Mappers
|
|||
PulseRate = p17.PulseRate,
|
||||
SPO2 = p17.SPO2,
|
||||
Temperature = p17.Temperature,
|
||||
ApplicationUserId = p17.ApplicationUserId,
|
||||
Answers = funcMain3(p17.Answers),
|
||||
Id = p17.Id
|
||||
};
|
||||
|
@ -348,6 +358,7 @@ namespace DocuMed.Domain.Mappers
|
|||
result.PulseRate = p19.PulseRate;
|
||||
result.SPO2 = p19.SPO2;
|
||||
result.Temperature = p19.Temperature;
|
||||
result.ApplicationUserId = p19.ApplicationUserId;
|
||||
result.Answers = funcMain4(p19.Answers, result.Answers);
|
||||
result.Id = p19.Id;
|
||||
return result;
|
||||
|
@ -377,6 +388,7 @@ namespace DocuMed.Domain.Mappers
|
|||
PulseRate = p23.PulseRate,
|
||||
SPO2 = p23.SPO2,
|
||||
Temperature = p23.Temperature,
|
||||
ApplicationUserId = p23.ApplicationUserId,
|
||||
Answers = p23.Answers.Select<MedicalHistoryAnswer, MedicalHistoryAnswerSDto>(p24 => new MedicalHistoryAnswerSDto()
|
||||
{
|
||||
Answer = p24.Answer,
|
||||
|
|
|
@ -16,6 +16,7 @@ namespace DocuMed.Domain.Mappers
|
|||
{
|
||||
ChiefComplaint = p1.ChiefComplaint,
|
||||
SectionId = p1.SectionId,
|
||||
ApplicationUserId = p1.ApplicationUserId,
|
||||
Id = p1.Id
|
||||
};
|
||||
}
|
||||
|
@ -29,6 +30,7 @@ namespace DocuMed.Domain.Mappers
|
|||
|
||||
result.ChiefComplaint = p2.ChiefComplaint;
|
||||
result.SectionId = p2.SectionId;
|
||||
result.ApplicationUserId = p2.ApplicationUserId;
|
||||
result.Id = p2.Id;
|
||||
return result;
|
||||
|
||||
|
@ -37,6 +39,7 @@ namespace DocuMed.Domain.Mappers
|
|||
{
|
||||
ChiefComplaint = p4.ChiefComplaint,
|
||||
SectionId = p4.SectionId,
|
||||
ApplicationUserId = p4.ApplicationUserId,
|
||||
Id = p4.Id
|
||||
};
|
||||
public static MedicalHistoryTemplateSDto AdaptToSDto(this MedicalHistoryTemplate p5)
|
||||
|
@ -45,6 +48,7 @@ namespace DocuMed.Domain.Mappers
|
|||
{
|
||||
ChiefComplaint = p5.ChiefComplaint,
|
||||
SectionId = p5.SectionId,
|
||||
ApplicationUserId = p5.ApplicationUserId,
|
||||
Id = p5.Id
|
||||
};
|
||||
}
|
||||
|
@ -58,6 +62,7 @@ namespace DocuMed.Domain.Mappers
|
|||
|
||||
result.ChiefComplaint = p6.ChiefComplaint;
|
||||
result.SectionId = p6.SectionId;
|
||||
result.ApplicationUserId = p6.ApplicationUserId;
|
||||
result.Id = p6.Id;
|
||||
return result;
|
||||
|
||||
|
@ -66,6 +71,7 @@ namespace DocuMed.Domain.Mappers
|
|||
{
|
||||
ChiefComplaint = p8.ChiefComplaint,
|
||||
SectionId = p8.SectionId,
|
||||
ApplicationUserId = p8.ApplicationUserId,
|
||||
Id = p8.Id
|
||||
};
|
||||
public static MedicalHistoryTemplate AdaptToMedicalHistoryTemplate(this MedicalHistoryTemplateLDto p9)
|
||||
|
@ -74,6 +80,7 @@ namespace DocuMed.Domain.Mappers
|
|||
{
|
||||
ChiefComplaint = p9.ChiefComplaint,
|
||||
SectionId = p9.SectionId,
|
||||
ApplicationUserId = p9.ApplicationUserId,
|
||||
Questions = funcMain1(p9.Questions),
|
||||
Id = p9.Id
|
||||
};
|
||||
|
@ -88,6 +95,7 @@ namespace DocuMed.Domain.Mappers
|
|||
|
||||
result.ChiefComplaint = p11.ChiefComplaint;
|
||||
result.SectionId = p11.SectionId;
|
||||
result.ApplicationUserId = p11.ApplicationUserId;
|
||||
result.Questions = funcMain2(p11.Questions, result.Questions);
|
||||
result.Id = p11.Id;
|
||||
return result;
|
||||
|
@ -97,6 +105,7 @@ namespace DocuMed.Domain.Mappers
|
|||
{
|
||||
ChiefComplaint = p15.ChiefComplaint,
|
||||
SectionId = p15.SectionId,
|
||||
ApplicationUserId = p15.ApplicationUserId,
|
||||
Questions = p15.Questions.Select<MedicalHistoryQuestionSDto, MedicalHistoryQuestion>(p16 => new MedicalHistoryQuestion()
|
||||
{
|
||||
Question = p16.Question,
|
||||
|
@ -113,6 +122,7 @@ namespace DocuMed.Domain.Mappers
|
|||
{
|
||||
ChiefComplaint = p17.ChiefComplaint,
|
||||
SectionId = p17.SectionId,
|
||||
ApplicationUserId = p17.ApplicationUserId,
|
||||
Questions = funcMain3(p17.Questions),
|
||||
Id = p17.Id
|
||||
};
|
||||
|
@ -127,6 +137,7 @@ namespace DocuMed.Domain.Mappers
|
|||
|
||||
result.ChiefComplaint = p19.ChiefComplaint;
|
||||
result.SectionId = p19.SectionId;
|
||||
result.ApplicationUserId = p19.ApplicationUserId;
|
||||
result.Questions = funcMain4(p19.Questions, result.Questions);
|
||||
result.Id = p19.Id;
|
||||
return result;
|
||||
|
@ -136,6 +147,7 @@ namespace DocuMed.Domain.Mappers
|
|||
{
|
||||
ChiefComplaint = p23.ChiefComplaint,
|
||||
SectionId = p23.SectionId,
|
||||
ApplicationUserId = p23.ApplicationUserId,
|
||||
Questions = p23.Questions.Select<MedicalHistoryQuestion, MedicalHistoryQuestionSDto>(p24 => new MedicalHistoryQuestionSDto()
|
||||
{
|
||||
Question = p24.Question,
|
||||
|
|
|
@ -42,6 +42,7 @@
|
|||
<Using Include="Blazored.LocalStorage" />
|
||||
<Using Include="DocuMed.Common.Extensions" />
|
||||
<Using Include="DocuMed.Common.Models.Api" />
|
||||
<Using Include="DocuMed.Domain.Dtos.LargDtos" />
|
||||
<Using Include="DocuMed.Domain.Dtos.RequestDtos" />
|
||||
<Using Include="DocuMed.Domain.Dtos.SmallDtos" />
|
||||
<Using Include="DocuMed.Domain.Entities.City" />
|
||||
|
@ -54,6 +55,7 @@
|
|||
<Using Include="DocuMed.PWA.Models.Api" />
|
||||
<Using Include="DocuMed.PWA.Services.RestServices" />
|
||||
<Using Include="DocuMed.PWA.Utilities" />
|
||||
<Using Include="Microsoft.AspNetCore.Components" />
|
||||
<Using Include="Microsoft.AspNetCore.Components.Web" />
|
||||
<Using Include="Microsoft.AspNetCore.Components.WebAssembly.Hosting" />
|
||||
<Using Include="Microsoft.IdentityModel.Tokens" />
|
||||
|
|
|
@ -8,4 +8,5 @@ public static class Address
|
|||
public const string UniversityController = $"{BaseAddress}/university";
|
||||
public const string SectionController = $"{BaseAddress}/section";
|
||||
public const string UserController = $"{BaseAddress}/user";
|
||||
public const string MedicalHistoryTemplateController = $"{BaseAddress}/medicalhistory/template";
|
||||
}
|
|
@ -7,6 +7,24 @@ public class BaseViewModel
|
|||
public virtual void Initialize()
|
||||
{
|
||||
|
||||
}
|
||||
public virtual Task InitializeAsync()
|
||||
{
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
}
|
||||
|
||||
public class BaseViewModel<TPageDto>
|
||||
{
|
||||
public bool IsProcessing { get; set; } = false;
|
||||
public TPageDto PageDto { get; set; }
|
||||
public BaseViewModel()
|
||||
{
|
||||
PageDto = Activator.CreateInstance<TPageDto>();
|
||||
}
|
||||
public virtual void Initialize()
|
||||
{
|
||||
|
||||
}
|
||||
public virtual Task InitializeAsync()
|
||||
{
|
||||
|
|
|
@ -11,9 +11,9 @@
|
|||
}
|
||||
|
||||
/* .secondary-border>.mud-input-control-input-container>.mud-input.mud-input-outlined>input:focus~.mud-input-outlined-border {
|
||||
border-color: #FD5523;
|
||||
color: white;
|
||||
} */
|
||||
border-color: #FD5523;
|
||||
color: white;
|
||||
} */
|
||||
</style>
|
||||
<div class="flex flex-col w-screen h-screen">
|
||||
<div class="w-full overflow-hidden basis-2/4">
|
||||
|
@ -150,12 +150,12 @@
|
|||
</p>
|
||||
|
||||
<MudForm @ref="_confirmSignUpForm">
|
||||
<MudTextField Required="true" RequiredError="نام خود را وارد کنید" @bind-Value="@_signUpRequest.FirstName" class="text-sm" T="string" Label="نام" Variant="Variant.Outlined" />
|
||||
<MudTextField Required="true" RequiredError="نام خانوادگی خود را وارد کنید" @bind-Value="@_signUpRequest.LastName" class="text-sm" T="string" Label="نام خانوادگی" Variant="Variant.Outlined" />
|
||||
<MudTextField class="text-sm" T="string" @bind-Value="@_phoneNumber" Label="شماره تلفن همراه"
|
||||
<MudTextField Required="true" RequiredError="نام خود را وارد کنید" @bind-Value="@_signUpRequest.FirstName" class="text-sm my-5" T="string" Label="نام" Variant="Variant.Outlined" />
|
||||
<MudTextField Required="true" RequiredError="نام خانوادگی خود را وارد کنید" @bind-Value="@_signUpRequest.LastName" class="text-sm my-5" T="string" Label="نام خانوادگی" Variant="Variant.Outlined" />
|
||||
<MudTextField class="text-sm my-5" T="string" @bind-Value="@_phoneNumber" Label="شماره تلفن همراه"
|
||||
Variant="Variant.Outlined" />
|
||||
|
||||
<MudAutocomplete @bind-Value="@_selectedCity"
|
||||
<MudAutocomplete ToStringFunc="dto => dto.Name" class="my-5" @bind-Value="@_selectedCity"
|
||||
SearchFunc="SearchCity"
|
||||
T="CitySDto"
|
||||
Label="شهر شما"
|
||||
|
@ -175,7 +175,7 @@
|
|||
</ItemTemplate>
|
||||
</MudAutocomplete>
|
||||
|
||||
<MudAutocomplete @bind-Value="@_selectedUni" SearchFunc="SearchUniversity" T="UniversitySDto" Label="دانشگاه" Variant="Variant.Outlined">
|
||||
<MudAutocomplete ToStringFunc="dto => dto.Name" class="my-5" @bind-Value="@_selectedUni" SearchFunc="SearchUniversity" T="UniversitySDto" Label="دانشگاه" Variant="Variant.Outlined">
|
||||
<ProgressIndicatorInPopoverTemplate>
|
||||
<MudList Clickable="false">
|
||||
<MudListItem>
|
||||
|
@ -218,13 +218,30 @@
|
|||
private bool _isProcessing = false;
|
||||
private SignUpStatus _signUpStatus;
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
var token = await UserUtility.GetBearerTokenAsync();
|
||||
if (!token.IsNullOrEmpty())
|
||||
{
|
||||
var user = await UserUtility.GetUserAsync();
|
||||
if (user.SignUpStatus == SignUpStatus.SignUpCompleted)
|
||||
NavigationManager.NavigateTo("HomePage");
|
||||
if(user.SignUpStatus==SignUpStatus.PhoneNumberVerified)
|
||||
{
|
||||
_phoneNumber = user.PhoneNumber;
|
||||
_currentSignOnStep = 2;
|
||||
_carousel?.MoveTo(_currentSignOnStep);
|
||||
}
|
||||
}
|
||||
await base.OnInitializedAsync();
|
||||
}
|
||||
|
||||
private async Task ConfirmPhoneNumber()
|
||||
{
|
||||
try
|
||||
{
|
||||
_confirmPhoneNumberForm?.Validate();
|
||||
if (_confirmPhoneNumberForm is {IsValid: true })
|
||||
if (_confirmPhoneNumberForm is { IsValid: true })
|
||||
{
|
||||
_isProcessing = true;
|
||||
_signUpStatus = await RestWrapper.AuthRestApi.GetVerifyCodeAsync(_phoneNumber);
|
||||
|
@ -247,7 +264,7 @@
|
|||
_isProcessing = false;
|
||||
}
|
||||
}
|
||||
private async Task ConfirmVerifyCode()
|
||||
private async Task ConfirmVerifyCode()
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -281,14 +298,13 @@
|
|||
{
|
||||
_carousel?.MoveTo(--_currentSignOnStep);
|
||||
}
|
||||
|
||||
private async Task ConfirmSignUp()
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
_confirmSignUpForm?.Validate();
|
||||
if (_confirmSignUpForm is {IsValid:true})
|
||||
if (_confirmSignUpForm is { IsValid: true })
|
||||
{
|
||||
_isProcessing = true;
|
||||
_signUpRequest.CityId = _selectedCity.Id;
|
||||
|
@ -345,7 +361,6 @@
|
|||
return _cities;
|
||||
}
|
||||
}
|
||||
|
||||
private async Task<IEnumerable<UniversitySDto>> SearchUniversity(string uni)
|
||||
{
|
||||
try
|
||||
|
|
|
@ -1,88 +1,96 @@
|
|||
@page "/MedicalHistoryTemplateActionPage"
|
||||
@page "/MedicalHistoryTemplateActionPage/{TemplateId:string}"
|
||||
@inject NavigationManager NavigationManager
|
||||
@inject IRestWrapper RestWrapper
|
||||
@inject IUserUtility UserUtility
|
||||
@inject ISnackbar Snackbar
|
||||
|
||||
<BasePageUi Title="افزودن یک شرحال جدید" Description="لطفا اطلاعات بیمار را با دقت کامل وارد کنید">
|
||||
|
||||
<div class="flex flex-col w-full h-full rounded-t-xl">
|
||||
|
||||
<MudCarousel class="w-full h-full overflow-x-hidden overflow-y-scroll" @ref="_carousel" ShowArrows="false"
|
||||
ShowBullets="false" EnableSwipeGesture="false" AutoCycle="false" TData="object">
|
||||
<MudCarousel class="w-full h-full overflow-x-hidden overflow-y-scroll" @ref="@ViewModel.Carousel" ShowArrows="false"
|
||||
ShowBullets="false" EnableSwipeGesture="false" AutoCycle="false" TData="object">
|
||||
|
||||
<MudCarouselItem>
|
||||
<div class="flex flex-col w-full h-full">
|
||||
<MedicalHistoryTemplateActionStep1 />
|
||||
<MedicalHistoryTemplateActionStep1 @bind-ChiefComplaint="@ViewModel.PageDto.ChiefComplaint" @bind-SelectedSection="@ViewModel.SelectedSelection" />
|
||||
</div>
|
||||
</MudCarouselItem>
|
||||
<MudCarouselItem>
|
||||
<div class="flex flex-col h-full">
|
||||
<MedicalHistoryTemplateActionStep2 />
|
||||
<MedicalHistoryTemplateActionStep2 PiQuestions="@ViewModel.PiQuestions" />
|
||||
</div>
|
||||
</MudCarouselItem>
|
||||
<MudCarouselItem>
|
||||
<div class="flex flex-col h-full">
|
||||
<MedicalHistoryTemplateActionStep3 />
|
||||
<MedicalHistoryTemplateActionStep3 PdhQuestions="@ViewModel.PdhQuestions" PshQuestions="@ViewModel.PshQuestions" />
|
||||
</div>
|
||||
</MudCarouselItem>
|
||||
<MudCarouselItem>
|
||||
<div class="flex flex-col h-full">
|
||||
<MedicalHistoryTemplateActionStep4 />
|
||||
<MedicalHistoryTemplateActionStep4 FamilyHistories="@ViewModel.FhQuestions" DrugHistories="@ViewModel.DhQuestions" AhMedicines="@ViewModel.AhQuestions" />
|
||||
</div>
|
||||
</MudCarouselItem>
|
||||
<MudCarouselItem>
|
||||
<div class="flex flex-col h-full">
|
||||
<MedicalHistoryTemplateActionStep5 />
|
||||
<MedicalHistoryTemplateActionStep5 VitalSigns="@ViewModel.VsQuestions" />
|
||||
</div>
|
||||
</MudCarouselItem>
|
||||
<MudCarouselItem>
|
||||
<div class="flex flex-col h-full">
|
||||
<MedicalHistoryTemplateActionStep6 SubmittedOnClick="CompleteCreateMedicalHistory" />
|
||||
<MedicalHistoryTemplateActionStep6 SubmittedOnClick="@ViewModel.SubmitCreateTemplateAsync" />
|
||||
</div>
|
||||
</MudCarouselItem>
|
||||
</MudCarousel>
|
||||
|
||||
@if(!medicalHistorySubmited){
|
||||
<MudPaper class="bottom-0 left-0 fixed w-full bg-gray-700 px-3 pt-4 pb-3 rounded-t-xl flex flex-row">
|
||||
|
||||
@if (_currentStep == 4)
|
||||
@if (!@ViewModel.MedicalHistorySubmitted)
|
||||
{
|
||||
if (@ViewModel.IsProcessing)
|
||||
{
|
||||
<MudButton @onclick="CompleteStepClicked" Variant="Variant.Filled" IconSize="Size.Large" StartIcon="@Icons.Material.Filled.ChevronRight" class="font-extrabold rounded-full bg-[--color-medicalhistory]">تـــکمیل</MudButton>
|
||||
<MudPaper class="bottom-0 left-0 fixed w-full bg-gray-700 px-3 pt-4 pb-3 rou nded-t-xl flex flex-row">
|
||||
|
||||
<div class="flex flex-row w-full mx-auto">
|
||||
<MudProgressCircular class="my-auto mr-1 -ml-4" Size="Size.Small" Color="Color.Warning" Indeterminate="true" />
|
||||
<p class="font-extrabold my-0 mr-7 text-lg text-[--color-medicalhistory]">منتظر بمانید</p>
|
||||
</div>
|
||||
|
||||
</MudPaper>
|
||||
}
|
||||
else
|
||||
{
|
||||
<MudButton @onclick="CompleteStepClicked" Variant="Variant.Outlined" IconSize="Size.Large"
|
||||
StartIcon="@Icons.Material.Filled.ChevronRight" class="font-extrabold rounded-full border-[--color-medicalhistory] text-[--color-medicalhistory]">
|
||||
مرحله بعد
|
||||
</MudButton>
|
||||
}
|
||||
<MudPaper class="bottom-0 left-0 fixed w-full bg-gray-700 px-3 pt-4 pb-3 rounded-t-xl flex flex-row">
|
||||
|
||||
<p class="my-auto text-lg text-[--color-medicalhistory] font-extrabold text-center grow">@_stepCounter</p>
|
||||
<MudButton @onclick="RollBackStepClicked" IconSize="Size.Large" EndIcon="@Icons.Material.Filled.ChevronLeft"
|
||||
class="font-extrabold text-[--color-medicalhistory] rounded-full">مرحله قبل</MudButton>
|
||||
</MudPaper>
|
||||
@if (@ViewModel.CurrentStep == 4)
|
||||
{
|
||||
<MudButton @onclick="@ViewModel.CompleteStepClicked" Variant="Variant.Filled" IconSize="Size.Large" StartIcon="@Icons.Material.Filled.ChevronRight" class="font-extrabold rounded-full bg-[--color-medicalhistory]">تـــکمیل</MudButton>
|
||||
}
|
||||
else
|
||||
{
|
||||
<MudButton @onclick="@ViewModel.CompleteStepClicked" Variant="Variant.Outlined" IconSize="Size.Large"
|
||||
StartIcon="@Icons.Material.Filled.ChevronRight" class="font-extrabold rounded-full border-[--color-medicalhistory] text-[--color-medicalhistory]">
|
||||
مرحله بعد
|
||||
</MudButton>
|
||||
}
|
||||
|
||||
<p class="my-auto text-lg text-[--color-medicalhistory] font-extrabold text-center grow">@ViewModel.StepCounter</p>
|
||||
<MudButton @onclick="@ViewModel.RollBackStepClicked" IconSize="Size.Large" EndIcon="@Icons.Material.Filled.ChevronLeft"
|
||||
class="font-extrabold text-[--color-medicalhistory] rounded-full">مرحله قبل</MudButton>
|
||||
</MudPaper>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
</BasePageUi>
|
||||
|
||||
@code {
|
||||
private MudCarousel<object>? _carousel;
|
||||
private int _currentStep = 0;
|
||||
private string _stepCounter = "1 / 5";
|
||||
private bool medicalHistorySubmited = false;
|
||||
private void CompleteStepClicked()
|
||||
[Parameter]
|
||||
public string TemplateId { get; set; }
|
||||
public MedicalHistoryTemplateActionPageViewModel ViewModel { get; set; }
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
_carousel?.MoveTo(++_currentStep);
|
||||
_stepCounter = string.Format("{0} / 5", _currentStep + 1);
|
||||
if (_currentStep == 5)
|
||||
medicalHistorySubmited = true;
|
||||
}
|
||||
private void RollBackStepClicked()
|
||||
{
|
||||
_carousel?.MoveTo(--_currentStep);
|
||||
_stepCounter = string.Format("{0} / 5", _currentStep + 1);
|
||||
ViewModel = new MedicalHistoryTemplateActionPageViewModel(NavigationManager,Snackbar,RestWrapper,UserUtility);
|
||||
await ViewModel.InitializeAsync();
|
||||
await base.OnInitializedAsync();
|
||||
}
|
||||
|
||||
private void CompleteCreateMedicalHistory()
|
||||
{
|
||||
NavigationManager.NavigateTo("HomePage");
|
||||
}
|
||||
}
|
|
@ -1,6 +1,118 @@
|
|||
namespace DocuMed.PWA.Pages;
|
||||
|
||||
public class MedicalHistoryTemplateActionPageViewModel : BaseViewModel
|
||||
public class MedicalHistoryTemplateActionPageViewModel : BaseViewModel<MedicalHistoryTemplateLDto>
|
||||
{
|
||||
private readonly NavigationManager _navigationManager;
|
||||
private readonly ISnackbar _snackbar;
|
||||
private readonly IRestWrapper _restWrapper;
|
||||
private readonly IUserUtility _userUtility;
|
||||
private readonly Guid _templateId;
|
||||
public MudCarousel<object>? Carousel { get; set; }
|
||||
public bool MedicalHistorySubmitted { get; set; }
|
||||
public int CurrentStep { get; set; } = 0;
|
||||
public string StepCounter { get; set; } = "1 / 5";
|
||||
public bool IsEditing { get; set; } = false;
|
||||
|
||||
public List<MedicalHistoryQuestionSDto> PiQuestions { get; set; } = new();
|
||||
public List<MedicalHistoryQuestionSDto> PdhQuestions { get; set; } = new();
|
||||
public List<MedicalHistoryQuestionSDto> PshQuestions { get; set; } = new();
|
||||
public List<MedicalHistoryQuestionSDto> FhQuestions { get; set; } = new();
|
||||
public List<MedicalHistoryQuestionSDto> DhQuestions { get; set; } = new();
|
||||
public List<MedicalHistoryQuestionSDto> AhQuestions { get; set; } = new();
|
||||
public List<MedicalHistoryQuestionSDto> VsQuestions { get; set; } = new();
|
||||
public SectionSDto? SelectedSelection { get; set; }
|
||||
|
||||
|
||||
|
||||
|
||||
public MedicalHistoryTemplateActionPageViewModel(
|
||||
NavigationManager navigationManager,
|
||||
ISnackbar snackbar,
|
||||
IRestWrapper restWrapper,
|
||||
IUserUtility userUtility)
|
||||
{
|
||||
_navigationManager = navigationManager;
|
||||
_snackbar = snackbar;
|
||||
_restWrapper = restWrapper;
|
||||
_userUtility = userUtility;
|
||||
}
|
||||
|
||||
public MedicalHistoryTemplateActionPageViewModel(
|
||||
NavigationManager navigationManager,
|
||||
ISnackbar snackbar,
|
||||
IRestWrapper restWrapper,
|
||||
IUserUtility userUtility,
|
||||
Guid templateId)
|
||||
{
|
||||
_navigationManager = navigationManager;
|
||||
_snackbar = snackbar;
|
||||
_restWrapper = restWrapper;
|
||||
_userUtility = userUtility;
|
||||
_templateId = templateId;
|
||||
IsEditing = true;
|
||||
}
|
||||
|
||||
public override Task InitializeAsync()
|
||||
{
|
||||
return base.InitializeAsync();
|
||||
}
|
||||
|
||||
public async Task CompleteStepClicked()
|
||||
{
|
||||
Carousel?.MoveTo(++CurrentStep);
|
||||
StepCounter = $"{CurrentStep + 1} / 5";
|
||||
if (CurrentStep == 5)
|
||||
{
|
||||
MedicalHistorySubmitted = true;
|
||||
await SubmitTemplateAsync();
|
||||
}
|
||||
}
|
||||
|
||||
public async Task SubmitTemplateAsync()
|
||||
{
|
||||
try
|
||||
{
|
||||
IsProcessing = true;
|
||||
if (SelectedSelection == null)
|
||||
throw new Exception("لطفا بخش مورد نظر را انتخاب نمایید");
|
||||
PageDto.SectionId = SelectedSelection.Id;
|
||||
var token = await _userUtility.GetBearerTokenAsync();
|
||||
PageDto.SectionId = SelectedSelection.Id;
|
||||
PageDto.Questions.AddRange(PiQuestions);
|
||||
PageDto.Questions.AddRange(PdhQuestions);
|
||||
PageDto.Questions.AddRange(PiQuestions);
|
||||
PageDto.Questions.AddRange(PshQuestions);
|
||||
PageDto.Questions.AddRange(FhQuestions);
|
||||
PageDto.Questions.AddRange(DhQuestions);
|
||||
PageDto.Questions.AddRange(AhQuestions);
|
||||
PageDto.Questions.AddRange(VsQuestions);
|
||||
await _restWrapper.CrudDtoApiRest<MedicalHistoryTemplateLDto, MedicalHistoryTemplateSDto, Guid>(Address.MedicalHistoryTemplateController)
|
||||
.Create(PageDto, token);
|
||||
|
||||
}
|
||||
catch (ApiException ex)
|
||||
{
|
||||
var exe = await ex.GetContentAsAsync<ApiResult>();
|
||||
_snackbar.Add(exe != null ? exe.Message : ex.Content, Severity.Error);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
_snackbar.Add(e.Message, Severity.Error);
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
||||
IsProcessing = false;
|
||||
}
|
||||
}
|
||||
public void RollBackStepClicked()
|
||||
{
|
||||
Carousel?.MoveTo(--CurrentStep);
|
||||
StepCounter = $"{CurrentStep + 1} / 5";
|
||||
}
|
||||
|
||||
public void SubmitCreateTemplateAsync()
|
||||
{
|
||||
_navigationManager.NavigateTo("HomePage");
|
||||
}
|
||||
}
|
|
@ -1,13 +1,70 @@
|
|||
@inject IRestWrapper RestWrapper
|
||||
@inject IUserUtility UserUtility
|
||||
<MudStack class="my-auto text-center font-iranyekan">
|
||||
<p class="text-lg font-extrabold">افزودن پیش نویس شرح حال جدید</p>
|
||||
<p class="text-center text-md">لورم ایپسوم متن ساختگی با تولید سادگی نامفهوم از صنعت چاپ و با استفاده از
|
||||
<p class="text-center text-md">
|
||||
لورم ایپسوم متن ساختگی با تولید سادگی نامفهوم از صنعت چاپ و با استفاده از
|
||||
طراحان گرافیک است چاپگرها و متون بلکه روزنامه و مجله در ستون و سطرآنچنان که لازم است و برای شرایط فعلی تکنولوژی
|
||||
مورد ده</p>
|
||||
مورد ده
|
||||
</p>
|
||||
<BasePartDivider Index="1" Title="شکایت اصلی بیمار" />
|
||||
<MudAutocomplete T="string" Label="شکایت اصلی بیمار ( CC )" Variant="Variant.Outlined" Margin="Margin.Normal" />
|
||||
<MudAutocomplete T="string" Label="بخش بیمار" Variant="Variant.Outlined" />
|
||||
<MudTextField T="string" ValueChanged="async cc => {ChiefComplaint=cc; await ChiefComplaintChanged.InvokeAsync(ChiefComplaint); }" Label="شکایت اصلی بیمار ( CC )" Variant="Variant.Outlined" Margin="Margin.Normal" />
|
||||
<MudAutocomplete T="SectionSDto" Label="بخش بیمار" Variant="Variant.Outlined"
|
||||
ToStringFunc="dto => dto.Name"
|
||||
SearchFunc="@SearchSection"
|
||||
ValueChanged="async dto => { SelectedSection=dto; await SelectedSectionChanged.InvokeAsync(SelectedSection); }">
|
||||
|
||||
<ProgressIndicatorInPopoverTemplate>
|
||||
<MudList Clickable="false">
|
||||
<MudListItem>
|
||||
<div class="flex flex-row w-full mx-auto">
|
||||
<MudProgressCircular class="my-auto mr-1 -ml-4" Size="Size.Small" Indeterminate="true" />
|
||||
<p class="font-bold my-1 mx-auto text-md">منتظر بمانید</p>
|
||||
</div>
|
||||
</MudListItem>
|
||||
</MudList>
|
||||
</ProgressIndicatorInPopoverTemplate>
|
||||
<ItemTemplate Context="e">
|
||||
<p>@e.Name</p>
|
||||
</ItemTemplate>
|
||||
</MudAutocomplete>
|
||||
</MudStack>
|
||||
|
||||
@code {
|
||||
|
||||
[Parameter]
|
||||
public string ChiefComplaint { get; set; } = string.Empty;
|
||||
[Parameter]
|
||||
public EventCallback<string> ChiefComplaintChanged { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public SectionSDto SelectedSection { get; set; } = new();
|
||||
[Parameter]
|
||||
public EventCallback<SectionSDto> SelectedSectionChanged { get; set; }
|
||||
|
||||
public List<SectionSDto> Sections { get; private set; } = new List<SectionSDto>();
|
||||
|
||||
public async Task<IEnumerable<SectionSDto>> SearchSection(string section)
|
||||
{
|
||||
try
|
||||
{
|
||||
var token = await UserUtility.GetBearerTokenAsync();
|
||||
var user = await UserUtility.GetUserAsync();
|
||||
Sections = await RestWrapper.SectionRestApi.GetByUniversityAsync(user.UniversityId, token);
|
||||
|
||||
if (section.IsNullOrEmpty())
|
||||
return Sections;
|
||||
return Sections.Where(c => c.Name.Contains(section));
|
||||
}
|
||||
catch (ApiException ex)
|
||||
{
|
||||
var exe = await ex.GetContentAsAsync<ApiResult>();
|
||||
return Sections;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
return Sections;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
<MudAlert Severity="Severity.Info">شما میتوانید سوال های هر بخش ها را به صورت کامل تنظیم نمایید</MudAlert>
|
||||
|
||||
@foreach (var item in Questions)
|
||||
@foreach (var item in PiQuestions)
|
||||
{
|
||||
<MedicalHistoryQuestionTemplateItemTemplate Question="@item" QuestionRemoved="RemoveQuestion" />
|
||||
}
|
||||
|
@ -34,15 +34,21 @@
|
|||
private string _questionTitle = string.Empty;
|
||||
private MedicalHistoryPart _questionPart = MedicalHistoryPart.PresentIllness;
|
||||
|
||||
[Parameter]
|
||||
public List<MedicalHistoryQuestionSDto> PiQuestions { get; set; } = new();
|
||||
|
||||
public List<MedicalHistoryQuestion> Questions { get; set; } = new();
|
||||
|
||||
private void RemoveQuestion(MedicalHistoryQuestion question)
|
||||
private void RemoveQuestion(MedicalHistoryQuestionSDto question)
|
||||
{
|
||||
Questions.Remove(question);
|
||||
PiQuestions.Remove(question);
|
||||
}
|
||||
private void AddQuestion()
|
||||
{
|
||||
Questions.Add(MedicalHistoryQuestion.Create(_questionTitle,_questionPart,_questionType,Guid.Empty));
|
||||
PiQuestions.Add(new MedicalHistoryQuestionSDto
|
||||
{
|
||||
Part = _questionPart,
|
||||
Question = _questionTitle,
|
||||
QuestionType = _questionType
|
||||
});
|
||||
_questionTitle = string.Empty;
|
||||
}
|
||||
}
|
|
@ -3,48 +3,49 @@
|
|||
<MudStack class="pb-20 font-iranyekan">
|
||||
<BasePartDivider Index="3" Title="تاریخچه بیماری قبلی ( PI )" />
|
||||
|
||||
@foreach (var item in PIQuestions)
|
||||
@foreach (var item in PdhQuestions)
|
||||
{
|
||||
<MedicalHistoryQuestionTemplateItemTemplate Question="item" QuestionRemoved="RemovePIQuestion" />
|
||||
<MedicalHistoryQuestionTemplateItemTemplate Question="item" QuestionRemoved="RemovePiQuestion" />
|
||||
}
|
||||
|
||||
<MudSelect @bind-Value="@_piQuestionType" T="MedicalHistoryQuestionType" Label="نوع سوال" Variant="Variant.Outlined">
|
||||
<MudSelect @bind-Value="@_pdhQuestionType" T="MedicalHistoryQuestionType" ToStringFunc="(e=>e.ToDisplay())" Label="نوع سوال" Variant="Variant.Outlined">
|
||||
|
||||
<MudSelectItem Value="@MedicalHistoryQuestionType.Hourly" />
|
||||
<MudSelectItem Value="@MedicalHistoryQuestionType.Interrogatively" />
|
||||
<MudSelectItem Value="@MedicalHistoryQuestionType.YesOrNo" />
|
||||
</MudSelect>
|
||||
<MudTextField @bind-Value="@_piQuestionTitle" Margin="Margin.None" T="string" Label="عنوان سوال" Lines="1"
|
||||
<MudTextField @bind-Value="@_pdhQuestionTitle" Margin="Margin.None" T="string" Label="عنوان سوال" Lines="1"
|
||||
Variant="Variant.Outlined" />
|
||||
|
||||
<MudButton @onclick="AddPIQuestion" Variant="Variant.Filled" IconSize="Size.Large" DisableElevation="true"
|
||||
<MudButton @onclick="AddPiQuestion" Variant="Variant.Filled" IconSize="Size.Large" DisableElevation="true"
|
||||
class="font-extrabold text-lg rounded-md py-4 bg-[--color-medicalhistory] text-gray-800">
|
||||
+ افزودن
|
||||
</MudButton>
|
||||
|
||||
<BasePartDivider Index="4" class="mt-9" Title="تاریخچه جراحی های قبلی ( PSH )" />
|
||||
|
||||
@foreach (var item in PIQuestions)
|
||||
@foreach (var item in PshQuestions)
|
||||
{
|
||||
<MedicalHistoryQuestionTemplateItemTemplate Question="item" QuestionRemoved="RemovePSHQuestion" />
|
||||
<MedicalHistoryQuestionTemplateItemTemplate Question="item" QuestionRemoved="RemovePshQuestion" />
|
||||
}
|
||||
|
||||
<MudSelect @bind-Value="@_pshQuestionType"
|
||||
T="MedicalHistoryQuestionType"
|
||||
Label="نوع سوال"
|
||||
<MudSelect @bind-Value="@_pshQuestionType"
|
||||
ToStringFunc="(e=>e.ToDisplay())"
|
||||
T="MedicalHistoryQuestionType"
|
||||
Label="نوع سوال"
|
||||
Variant="Variant.Outlined">
|
||||
|
||||
<MudSelectItem Value="@MedicalHistoryQuestionType.Hourly" />
|
||||
<MudSelectItem Value="@MedicalHistoryQuestionType.Interrogatively" />
|
||||
<MudSelectItem Value="@MedicalHistoryQuestionType.YesOrNo" />
|
||||
</MudSelect>
|
||||
<MudTextField @bind-Value="@_pshQuestionTitle"
|
||||
Margin="Margin.None"
|
||||
T="string"
|
||||
<MudTextField @bind-Value="@_pshQuestionTitle"
|
||||
Margin="Margin.None"
|
||||
T="string"
|
||||
Label="عنوان سوال" Lines="1"
|
||||
Variant="Variant.Outlined" />
|
||||
|
||||
<MudButton @onclick="AddPSHQuestion" Variant="Variant.Filled" IconSize="Size.Large" DisableElevation="true"
|
||||
<MudButton @onclick="AddPshQuestion" Variant="Variant.Filled" IconSize="Size.Large" DisableElevation="true"
|
||||
class="font-extrabold text-lg rounded-md py-4 bg-[--color-medicalhistory] text-gray-800">
|
||||
+ افزودن
|
||||
</MudButton>
|
||||
|
@ -54,37 +55,45 @@
|
|||
|
||||
@code
|
||||
{
|
||||
private string _piQuestionTitle = string.Empty;
|
||||
private MedicalHistoryQuestionType _piQuestionType;
|
||||
[Parameter]
|
||||
public List<MedicalHistoryQuestionSDto> PdhQuestions { get; set; } = new();
|
||||
[Parameter]
|
||||
public List<MedicalHistoryQuestionSDto> PshQuestions { get; set; } = new();
|
||||
|
||||
|
||||
private string _pdhQuestionTitle = string.Empty;
|
||||
private MedicalHistoryQuestionType _pdhQuestionType;
|
||||
private string _pshQuestionTitle = string.Empty;
|
||||
private MedicalHistoryQuestionType _pshQuestionType;
|
||||
public List<MedicalHistoryQuestion> PIQuestions { get; set; } = new();
|
||||
public List<MedicalHistoryQuestion> PSHQuestions { get; set; } = new();
|
||||
|
||||
private void RemovePIQuestion(MedicalHistoryQuestion question)
|
||||
private void RemovePiQuestion(MedicalHistoryQuestionSDto question)
|
||||
{
|
||||
PIQuestions.Remove(question);
|
||||
PdhQuestions.Remove(question);
|
||||
}
|
||||
private void AddPIQuestion()
|
||||
private void AddPiQuestion()
|
||||
{
|
||||
// PIQuestions.Add(new MedicalHistoryQuestion
|
||||
// {
|
||||
// Title = _piQuestionTitle,
|
||||
// Type = _piQuestionType
|
||||
// });
|
||||
PdhQuestions.Add(new MedicalHistoryQuestionSDto
|
||||
{
|
||||
QuestionType = _pdhQuestionType,
|
||||
Part = MedicalHistoryPart.PastDiseasesHistory,
|
||||
Question = _pdhQuestionTitle
|
||||
});
|
||||
_pdhQuestionTitle = string.Empty;
|
||||
}
|
||||
|
||||
private void RemovePSHQuestion(MedicalHistoryQuestion question)
|
||||
private void RemovePshQuestion(MedicalHistoryQuestionSDto question)
|
||||
{
|
||||
PSHQuestions.Remove(question);
|
||||
PshQuestions.Remove(question);
|
||||
}
|
||||
private void AddPSHQuestion()
|
||||
private void AddPshQuestion()
|
||||
{
|
||||
// PSHQuestions.Add(new MedicalHistoryQuestion
|
||||
// {
|
||||
// Title = _pshQuestionTitle,
|
||||
// Type = _pshQuestionType
|
||||
// });
|
||||
PshQuestions.Add(new MedicalHistoryQuestionSDto
|
||||
{
|
||||
Part = MedicalHistoryPart.PastSurgeryHistory,
|
||||
QuestionType = _pshQuestionType,
|
||||
Question = _pshQuestionTitle
|
||||
});
|
||||
_pshQuestionTitle = string.Empty;
|
||||
}
|
||||
|
||||
}
|
|
@ -7,7 +7,8 @@
|
|||
<MedicalHistoryQuestionTemplateItemTemplate Question="item" QuestionRemoved="RemoveFamilyHistory" />
|
||||
}
|
||||
|
||||
<MudSelect @bind-Value="@_familyHistoryQuestionType" T="MedicalHistoryQuestionType" Label="نوع سوال" Variant="Variant.Outlined">
|
||||
<MudSelect @bind-Value="@_familyHistoryQuestionType"
|
||||
ToStringFunc="(e=>e.ToDisplay())" T="MedicalHistoryQuestionType" Label="نوع سوال" Variant="Variant.Outlined">
|
||||
|
||||
<MudSelectItem Value="@MedicalHistoryQuestionType.Hourly" />
|
||||
<MudSelectItem Value="@MedicalHistoryQuestionType.Interrogatively" />
|
||||
|
@ -29,7 +30,7 @@
|
|||
{
|
||||
<MudCard @onclick="()=>RemoveDrugHistory(item)" class="text-center">
|
||||
<MudCardContent>
|
||||
<p class="font-extrabold text-gray-600 text-md">@item</p>
|
||||
<p class="font-extrabold text-gray-600 text-md">@item.Question</p>
|
||||
</MudCardContent>
|
||||
</MudCard>
|
||||
}
|
||||
|
@ -46,11 +47,11 @@
|
|||
<BasePartDivider Index="7" class="mt-9" Title="مواد مصرفی ( HH )" />
|
||||
|
||||
<div class="grid mx-1 gap-2 grid-cols-2 md:grid-cols-4">
|
||||
@foreach (var item in HHMedicines)
|
||||
@foreach (var item in AhMedicines)
|
||||
{
|
||||
<MudCard @onclick="()=>RemoveHHMedicine(item)" class="text-center">
|
||||
<MudCard @onclick="()=>RemoveHhMedicine(item)" class="text-center">
|
||||
<MudCardContent>
|
||||
<p class="font-extrabold text-gray-600 text-md">@item</p>
|
||||
<p class="font-extrabold text-gray-600 text-md">@item.Question</p>
|
||||
</MudCardContent>
|
||||
</MudCard>
|
||||
}
|
||||
|
@ -59,7 +60,7 @@
|
|||
<div class="flex flex-row">
|
||||
<MudTextField @bind-Value="@_hhName" class="grow" T="string" Label="نام دارو مورد نظر" Variant="Variant.Outlined" />
|
||||
|
||||
<MudButton Variant="Variant.Outlined" @onclick="AddHHMedicine" Color="Color.Info" IconSize="Size.Large" DisableElevation="false" class="mx-2 mt-1.5 mb-0.5 pt-2 text-4xl rounded-md">
|
||||
<MudButton Variant="Variant.Outlined" @onclick="AddHhMedicine" Color="Color.Info" IconSize="Size.Large" DisableElevation="false" class="mx-2 mt-1.5 mb-0.5 pt-2 text-4xl rounded-md">
|
||||
+
|
||||
</MudButton>
|
||||
</div>
|
||||
|
@ -70,45 +71,58 @@
|
|||
@code {
|
||||
private string _familyHistoryQuestionTitle = string.Empty;
|
||||
private MedicalHistoryQuestionType _familyHistoryQuestionType;
|
||||
|
||||
public List<MedicalHistoryQuestion> FamilyHistories { get; set; } = new();
|
||||
|
||||
private void RemoveFamilyHistory(MedicalHistoryQuestion question)
|
||||
[Parameter]
|
||||
public List<MedicalHistoryQuestionSDto> FamilyHistories { get; set; } = new();
|
||||
private void RemoveFamilyHistory(MedicalHistoryQuestionSDto question)
|
||||
{
|
||||
FamilyHistories.Remove(question);
|
||||
}
|
||||
private void AddFamilyHistory()
|
||||
{
|
||||
// FamilyHistories.Add(new MedicalHistoryQuestion
|
||||
// {
|
||||
// Title = _familyHistoryQuestionTitle,
|
||||
// Type = _familyHistoryQuestionType
|
||||
// });
|
||||
FamilyHistories.Add(new MedicalHistoryQuestionSDto
|
||||
{
|
||||
Question = _familyHistoryQuestionTitle,
|
||||
QuestionType = _familyHistoryQuestionType,
|
||||
Part = MedicalHistoryPart.FamilyHistory
|
||||
});
|
||||
_familyHistoryQuestionTitle = String.Empty;
|
||||
}
|
||||
|
||||
|
||||
private string _drugHistoryName = string.Empty;
|
||||
public List<string> DrugHistories { get; set; } = new();
|
||||
private void RemoveDrugHistory(string medicine)
|
||||
[Parameter]
|
||||
public List<MedicalHistoryQuestionSDto> DrugHistories { get; set; } = new();
|
||||
private void RemoveDrugHistory(MedicalHistoryQuestionSDto medicine)
|
||||
{
|
||||
DrugHistories.Remove(medicine);
|
||||
}
|
||||
private void AddDrugHistory()
|
||||
{
|
||||
DrugHistories.Add(_drugHistoryName);
|
||||
DrugHistories.Add(new MedicalHistoryQuestionSDto
|
||||
{
|
||||
Question = _drugHistoryName,
|
||||
QuestionType = MedicalHistoryQuestionType.Selective,
|
||||
Part = MedicalHistoryPart.DrugHistory
|
||||
});
|
||||
_drugHistoryName = string.Empty;
|
||||
}
|
||||
|
||||
|
||||
private string _hhName = string.Empty;
|
||||
public List<string> HHMedicines { get; set; } = new();
|
||||
private void RemoveHHMedicine(string medicine)
|
||||
[Parameter]
|
||||
public List<MedicalHistoryQuestionSDto> AhMedicines { get; set; } = new();
|
||||
private void RemoveHhMedicine(MedicalHistoryQuestionSDto medicine)
|
||||
{
|
||||
HHMedicines.Remove(medicine);
|
||||
AhMedicines.Remove(medicine);
|
||||
}
|
||||
private void AddHHMedicine()
|
||||
private void AddHhMedicine()
|
||||
{
|
||||
HHMedicines.Add(_hhName);
|
||||
AhMedicines.Add(new MedicalHistoryQuestionSDto
|
||||
{
|
||||
Part = MedicalHistoryPart.AddictionHistory,
|
||||
Question = _hhName,
|
||||
QuestionType = MedicalHistoryQuestionType.Selective
|
||||
});
|
||||
_hhName = string.Empty;
|
||||
}
|
||||
}
|
|
@ -1,18 +1,18 @@
|
|||
<MudStack class="pb-20 font-iranyekan">
|
||||
<BasePartDivider Index="8" Title="ظاهر کلی بیمار ( GA )" />
|
||||
<div class="grid mx-1 gap-2 grid-cols-1 md:grid-cols-2">
|
||||
@foreach (var item in GeneralAppearances)
|
||||
@foreach (var item in VitalSigns)
|
||||
{
|
||||
<MudCard @onclick="()=>RemoveGeneralAppearance(item)" class="text-center">
|
||||
<MudCardContent>
|
||||
<p class="font-extrabold text-gray-600 text-md">@item</p>
|
||||
<p class="font-extrabold text-gray-600 text-md">@item.Question</p>
|
||||
</MudCardContent>
|
||||
</MudCard>
|
||||
}
|
||||
</div>
|
||||
|
||||
<div class="flex flex-row">
|
||||
<MudTextField @bind-Value="@_generalAppearance" class="grow" T="string" Label="نام دارو مورد نظر" Variant="Variant.Outlined" />
|
||||
<MudTextField @bind-Value="@_vitalSign" class="grow" T="string" Label="نام دارو مورد نظر" Variant="Variant.Outlined" />
|
||||
|
||||
<MudButton Variant="Variant.Outlined" @onclick="AddGeneralAppearance" Color="Color.Info" IconSize="Size.Large" DisableElevation="false" class="mx-2 mt-1.5 mb-0.5 pt-2 text-4xl rounded-md">
|
||||
+
|
||||
|
@ -71,24 +71,30 @@
|
|||
</MudStack>
|
||||
@code {
|
||||
|
||||
private string _generalAppearance = string.Empty;
|
||||
public List<string> GeneralAppearances { get; set; } = new();
|
||||
private void RemoveGeneralAppearance(string medicine)
|
||||
private string _vitalSign = string.Empty;
|
||||
[Parameter]
|
||||
public List<MedicalHistoryQuestionSDto> VitalSigns { get; set; } = new();
|
||||
private void RemoveGeneralAppearance(MedicalHistoryQuestionSDto generalAppearance)
|
||||
{
|
||||
GeneralAppearances.Remove(medicine);
|
||||
VitalSigns.Remove(generalAppearance);
|
||||
}
|
||||
private void AddGeneralAppearance()
|
||||
{
|
||||
GeneralAppearances.Add(_generalAppearance);
|
||||
_generalAppearance = string.Empty;
|
||||
VitalSigns.Add(new MedicalHistoryQuestionSDto
|
||||
{
|
||||
Question = _vitalSign,
|
||||
QuestionType = MedicalHistoryQuestionType.Selective,
|
||||
Part = MedicalHistoryPart.VitalSign
|
||||
});
|
||||
_vitalSign = string.Empty;
|
||||
}
|
||||
|
||||
private string _reviewOfSystemTitle = string.Empty;
|
||||
private string _reviewOfSystemSystem = string.Empty;
|
||||
private bool _reviewOfSystemIsSign;
|
||||
private bool _reviewOfSystemIsSymptom;
|
||||
public List<MedicalHistoryQuestion> ReviewOfSystems { get; set; } = new();
|
||||
private void RemoveReviewOfSystems(MedicalHistoryQuestion review)
|
||||
public List<MedicalHistoryQuestionSDto> ReviewOfSystems { get; set; } = new();
|
||||
private void RemoveReviewOfSystems(MedicalHistoryQuestionSDto review)
|
||||
{
|
||||
ReviewOfSystems.Remove(review);
|
||||
}
|
||||
|
|
|
@ -1,37 +1,50 @@
|
|||
@page "/MedicalHistoryTemplatesPage"
|
||||
@inject NavigationManager NavigationManager
|
||||
@inject ISnackbar Snackbar
|
||||
@inject IRestWrapper RestWrapper
|
||||
@inject IUserUtility UserUtility
|
||||
|
||||
<BasePageUi Title="پیش نویس های شرح حال نویسی" Description="پیش نویس های شرح های سرعت و دقت شما را افزایش میدهد">
|
||||
<BasePageUi Title="پیش نویس های" Description="پیش نویس های شرح های سرعت و دقت شما را افزایش میدهد">
|
||||
<MudStack>
|
||||
<div class="flex flex-row mr-1 mt-5">
|
||||
<div>
|
||||
<p class="font-extrabold text-[#356859]">تمامی پیش نویس های شما</p>
|
||||
<p class="text-xs font-light ">شما میتوانید پیش نویس جدید اضافه کنید</p>
|
||||
</div>
|
||||
<MudButton @onclick="CreateMedicalHistoryTemplateClicked" DisableElevation="false" class="text-[#356859] my-auto mr-auto font-extrabold bg-white rounded-lg drop-shadow-md">+ افزودن</MudButton>
|
||||
<MudButton @onclick="ViewModel.CreateMedicalHistoryTemplateClicked" DisableElevation="false" class="text-[#356859] my-auto mr-auto font-extrabold bg-white rounded-lg drop-shadow-md">+ افزودن</MudButton>
|
||||
</div>
|
||||
<MudTextField class="text-sm" InputType="InputType.Search" T="string" Label="جست جو پیش نویس" Variant="Variant.Outlined" />
|
||||
<div class="grid grid-cols-2 gap-3 sm:grid-cols-3 md:grid-cols-4">
|
||||
|
||||
@foreach (var item in _medicalHistoryTemplates)
|
||||
<div class="grid grid-cols-2 gap-3 w-full sm:grid-cols-3 md:grid-cols-4">
|
||||
@if (@ViewModel.IsProcessing)
|
||||
{
|
||||
<MedicalHistoryTemplateItemTemplate Clicked="MedicalHistoryTemplateClicked" MedicalHistoryTemplate="@item" />
|
||||
@for (int i = 0; i < 4; i++)
|
||||
{
|
||||
<MudCard class="bg-transparent p-4 rounded-lg" Elevation="0">
|
||||
<MudSkeleton class="mb-4 mx-10 h-10" SkeletonType="SkeletonType.Rectangle" Animation="Animation.Wave" />
|
||||
<MudSkeleton Animation="Animation.Wave" />
|
||||
</MudCard>
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@foreach (var item in ViewModel.PageDto)
|
||||
{
|
||||
<MedicalHistoryTemplateItemTemplate Clicked="ViewModel.MedicalHistoryTemplateClicked" MedicalHistoryTemplate="@item" />
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
</div>
|
||||
</MudStack>
|
||||
</BasePageUi>
|
||||
@code
|
||||
{
|
||||
private void CreateMedicalHistoryTemplateClicked() => NavigationManager.NavigateTo("MedicalHistoryTemplateActionPage");
|
||||
private void MedicalHistoryTemplateClicked() => NavigationManager.NavigateTo("MedicalHistoryTemplateActionPage");
|
||||
private List<MedicalHistoryTemplateSDto> _medicalHistoryTemplates = new();
|
||||
protected override void OnInitialized()
|
||||
public MedicalHistoryTemplatesPageViewModel ViewModel { get; set; }
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
_medicalHistoryTemplates.Add(new MedicalHistoryTemplateSDto()
|
||||
{
|
||||
ChiefComplaint = "سردرد",
|
||||
});
|
||||
base.OnInitialized();
|
||||
ViewModel = new MedicalHistoryTemplatesPageViewModel(NavigationManager, UserUtility, RestWrapper, Snackbar);
|
||||
await ViewModel.InitializeAsync();
|
||||
await base.OnInitializedAsync();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,49 @@
|
|||
namespace DocuMed.PWA.Pages;
|
||||
|
||||
public class MedicalHistoryTemplatesPageViewModel : BaseViewModel<List<MedicalHistoryTemplateSDto>>
|
||||
{
|
||||
private readonly NavigationManager _navigationManager;
|
||||
private readonly IUserUtility _userUtility;
|
||||
private readonly IRestWrapper _restWrapper;
|
||||
private readonly ISnackbar _snackbar;
|
||||
|
||||
public MedicalHistoryTemplatesPageViewModel(NavigationManager navigationManager,IUserUtility userUtility , IRestWrapper restWrapper,ISnackbar snackbar)
|
||||
{
|
||||
_navigationManager = navigationManager;
|
||||
_userUtility = userUtility;
|
||||
_restWrapper = restWrapper;
|
||||
_snackbar = snackbar;
|
||||
}
|
||||
public void CreateMedicalHistoryTemplateClicked() => _navigationManager.NavigateTo("MedicalHistoryTemplateActionPage");
|
||||
public void MedicalHistoryTemplateClicked(MedicalHistoryTemplateSDto template) => _navigationManager.NavigateTo($"MedicalHistoryTemplateActionPage/{template.Id.ToString()}");
|
||||
|
||||
public override async Task InitializeAsync()
|
||||
{
|
||||
try
|
||||
{
|
||||
IsProcessing = true;
|
||||
await Task.Delay(500);
|
||||
var token = await _userUtility.GetBearerTokenAsync();
|
||||
var list = await _restWrapper
|
||||
.CrudDtoApiRest<MedicalHistoryTemplateLDto, MedicalHistoryTemplateSDto, Guid>( Address.MedicalHistoryTemplateController)
|
||||
.ReadAll(0, token);
|
||||
PageDto = list;
|
||||
|
||||
}
|
||||
catch (ApiException ex)
|
||||
{
|
||||
var exe = await ex.GetContentAsAsync<ApiResult>();
|
||||
_snackbar.Add(exe != null ? exe.Message : ex.Content, Severity.Error);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
_snackbar.Add(e.Message, Severity.Error);
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
||||
IsProcessing = false;
|
||||
}
|
||||
await base.InitializeAsync();
|
||||
}
|
||||
}
|
|
@ -2,6 +2,7 @@
|
|||
@inject IRestWrapper RestWrapper
|
||||
@inject ISnackbar Snackbar
|
||||
@inject IUserUtility UserUtility
|
||||
@inject NavigationManager NavigationManager
|
||||
|
||||
|
||||
<BasePageUi Title="پروفایل شما" Description="اطلاعات پروفایل شما باید دقیق و کامل باشد">
|
||||
|
@ -78,7 +79,8 @@
|
|||
Variant="Variant.Filled"
|
||||
Color="Color.Primary" />
|
||||
|
||||
<BaseButtonUi Icon="@Icons.Material.TwoTone.Close" Content="خروج از حساب کاربری" Variant="Variant.Outlined" Color="Color.Error" />
|
||||
<BaseButtonUi Icon="@Icons.Material.TwoTone.Close"
|
||||
@onclick="@ViewModel.LogoutAsync" Content="خروج از حساب کاربری" Variant="Variant.Outlined" Color="Color.Error" />
|
||||
|
||||
</MudStack>
|
||||
<div class="bg-gray-300 rounded-md mt-auto py-4 px-6 flex flex-row">
|
||||
|
@ -93,7 +95,7 @@
|
|||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
ViewModel = new ProfilePageViewModel(UserUtility, RestWrapper, Snackbar);
|
||||
ViewModel = new ProfilePageViewModel(UserUtility, RestWrapper, Snackbar, NavigationManager);
|
||||
await ViewModel.InitializeAsync();
|
||||
await base.OnInitializedAsync();
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@ namespace DocuMed.PWA.Pages;
|
|||
|
||||
public class ProfilePageViewModel : BaseViewModel
|
||||
{
|
||||
private readonly NavigationManager _navigationManager;
|
||||
public IUserUtility UserUtility { get; }
|
||||
public IRestWrapper RestWrapper { get; }
|
||||
public ISnackbar Snackbar { get; }
|
||||
|
@ -14,14 +15,15 @@ public class ProfilePageViewModel : BaseViewModel
|
|||
public List<CitySDto> Cities { get; private set; } = new List<CitySDto>();
|
||||
public List<UniversitySDto> Universities { get; private set; } = new List<UniversitySDto>();
|
||||
public List<SectionSDto> Sections { get; private set; } = new List<SectionSDto>();
|
||||
public SectionSDto? SelectedSection { get; set; }
|
||||
public CitySDto? SelectedCity { get; set; }
|
||||
public UniversitySDto? SelectedUni { get; set; }
|
||||
public SectionSDto? SelectedSection { get; set; }
|
||||
|
||||
public readonly string Version = Assembly.GetAssembly(typeof(Program))?.GetName()?.Version?.ToString() ?? string.Empty;
|
||||
|
||||
public ProfilePageViewModel(IUserUtility userUtility, IRestWrapper restWrapper, ISnackbar snackbar)
|
||||
public ProfilePageViewModel(IUserUtility userUtility, IRestWrapper restWrapper, ISnackbar snackbar,NavigationManager navigationManager)
|
||||
{
|
||||
_navigationManager = navigationManager;
|
||||
UserUtility = userUtility;
|
||||
RestWrapper = restWrapper;
|
||||
Snackbar = snackbar;
|
||||
|
@ -87,6 +89,12 @@ public class ProfilePageViewModel : BaseViewModel
|
|||
}
|
||||
}
|
||||
|
||||
public async Task LogoutAsync()
|
||||
{
|
||||
await UserUtility.LogoutAsync();
|
||||
_navigationManager.NavigateTo("");
|
||||
}
|
||||
|
||||
|
||||
|
||||
public async Task<IEnumerable<CitySDto>> SearchCity(string city)
|
||||
|
|
|
@ -15,9 +15,9 @@
|
|||
@code {
|
||||
|
||||
[Parameter]
|
||||
public MedicalHistoryQuestion Question { get; set; } = new MedicalHistoryQuestion();
|
||||
public MedicalHistoryQuestionSDto Question { get; set; } = new MedicalHistoryQuestionSDto();
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<MedicalHistoryQuestion> QuestionRemoved { get; set; }
|
||||
public EventCallback<MedicalHistoryQuestionSDto> QuestionRemoved { get; set; }
|
||||
|
||||
}
|
||||
|
|
|
@ -6,5 +6,6 @@ public interface IUserUtility
|
|||
public Task SetBearerTokenAsync(string token);
|
||||
public Task<ApplicationUserSDto> GetUserAsync();
|
||||
public Task SetUserAsync(ApplicationUserSDto user);
|
||||
public Task LogoutAsync();
|
||||
|
||||
}
|
|
@ -12,10 +12,15 @@ public class UserUtility : IUserUtility
|
|||
}
|
||||
|
||||
public async Task<string> GetBearerTokenAsync() => await _localStorageService.GetItemAsStringAsync(LocalStorageKeys.Token);
|
||||
public async Task SetBearerTokenAsync(string token) => await _localStorageService.SetItemAsStringAsync(LocalStorageKeys.Token,token);
|
||||
public async Task SetBearerTokenAsync(string token) => await _localStorageService.SetItemAsStringAsync(LocalStorageKeys.Token, token);
|
||||
|
||||
public async Task<ApplicationUserSDto> GetUserAsync() => await _localStorageService.GetItemAsync<ApplicationUserSDto>(LocalStorageKeys.UserInfo);
|
||||
public async Task SetUserAsync(ApplicationUserSDto user) => await _localStorageService.SetItemAsync<ApplicationUserSDto>(LocalStorageKeys.UserInfo,user);
|
||||
public async Task SetUserAsync(ApplicationUserSDto user) => await _localStorageService.SetItemAsync<ApplicationUserSDto>(LocalStorageKeys.UserInfo, user);
|
||||
public async Task LogoutAsync()
|
||||
{
|
||||
await _localStorageService.RemoveItemAsync(LocalStorageKeys.Token);
|
||||
await _localStorageService.RemoveItemAsync(LocalStorageKeys.UserInfo);
|
||||
}
|
||||
|
||||
//public AccessToken<ApplicationUserSDto>? AccessToken { get; set; }
|
||||
//public List<string> UserClaims => AccessToken == null ? new List<string>() : AccessToken.Permissions;
|
||||
|
|
|
@ -517,6 +517,10 @@ video {
|
|||
margin-left: 0.25rem;
|
||||
margin-right: 0.25rem;
|
||||
}
|
||||
.mx-10 {
|
||||
margin-left: 2.5rem;
|
||||
margin-right: 2.5rem;
|
||||
}
|
||||
.mx-2 {
|
||||
margin-left: 0.5rem;
|
||||
margin-right: 0.5rem;
|
||||
|
@ -541,6 +545,10 @@ video {
|
|||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
.my-0 {
|
||||
margin-top: 0px;
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
.my-1 {
|
||||
margin-top: 0.25rem;
|
||||
margin-bottom: 0.25rem;
|
||||
|
@ -553,6 +561,10 @@ video {
|
|||
margin-top: 1rem;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
.my-5 {
|
||||
margin-top: 1.25rem;
|
||||
margin-bottom: 1.25rem;
|
||||
}
|
||||
.my-auto {
|
||||
margin-top: auto;
|
||||
margin-bottom: auto;
|
||||
|
@ -605,6 +617,9 @@ video {
|
|||
.mb-3 {
|
||||
margin-bottom: 0.75rem;
|
||||
}
|
||||
.mb-4 {
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
.mb-8 {
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
@ -632,6 +647,9 @@ video {
|
|||
.mr-5 {
|
||||
margin-right: 1.25rem;
|
||||
}
|
||||
.mr-7 {
|
||||
margin-right: 1.75rem;
|
||||
}
|
||||
.mr-auto {
|
||||
margin-right: auto;
|
||||
}
|
||||
|
@ -867,6 +885,9 @@ video {
|
|||
--tw-bg-opacity: 1;
|
||||
background-color: rgb(55 65 81 / var(--tw-bg-opacity));
|
||||
}
|
||||
.bg-transparent {
|
||||
background-color: transparent;
|
||||
}
|
||||
.bg-white {
|
||||
--tw-bg-opacity: 1;
|
||||
background-color: rgb(255 255 255 / var(--tw-bg-opacity));
|
||||
|
@ -877,6 +898,9 @@ video {
|
|||
.bg-opacity-70 {
|
||||
--tw-bg-opacity: 0.7;
|
||||
}
|
||||
.p-4 {
|
||||
padding: 1rem;
|
||||
}
|
||||
.p-5 {
|
||||
padding: 1.25rem;
|
||||
}
|
||||
|
|
|
@ -574,6 +574,11 @@ video {
|
|||
margin-right: 0.25rem;
|
||||
}
|
||||
|
||||
.mx-10 {
|
||||
margin-left: 2.5rem;
|
||||
margin-right: 2.5rem;
|
||||
}
|
||||
|
||||
.mx-2 {
|
||||
margin-left: 0.5rem;
|
||||
margin-right: 0.5rem;
|
||||
|
@ -604,6 +609,11 @@ video {
|
|||
margin-right: auto;
|
||||
}
|
||||
|
||||
.my-0 {
|
||||
margin-top: 0px;
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
|
||||
.my-1 {
|
||||
margin-top: 0.25rem;
|
||||
margin-bottom: 0.25rem;
|
||||
|
@ -619,6 +629,11 @@ video {
|
|||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.my-5 {
|
||||
margin-top: 1.25rem;
|
||||
margin-bottom: 1.25rem;
|
||||
}
|
||||
|
||||
.my-auto {
|
||||
margin-top: auto;
|
||||
margin-bottom: auto;
|
||||
|
@ -688,6 +703,10 @@ video {
|
|||
margin-bottom: 0.75rem;
|
||||
}
|
||||
|
||||
.mb-4 {
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.mb-8 {
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
@ -724,6 +743,10 @@ video {
|
|||
margin-right: 1.25rem;
|
||||
}
|
||||
|
||||
.mr-7 {
|
||||
margin-right: 1.75rem;
|
||||
}
|
||||
|
||||
.mr-auto {
|
||||
margin-right: auto;
|
||||
}
|
||||
|
@ -1033,6 +1056,10 @@ video {
|
|||
background-color: rgb(55 65 81 / var(--tw-bg-opacity));
|
||||
}
|
||||
|
||||
.bg-transparent {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.bg-white {
|
||||
--tw-bg-opacity: 1;
|
||||
background-color: rgb(255 255 255 / var(--tw-bg-opacity));
|
||||
|
@ -1046,6 +1073,10 @@ video {
|
|||
--tw-bg-opacity: 0.7;
|
||||
}
|
||||
|
||||
.p-4 {
|
||||
padding: 1rem;
|
||||
}
|
||||
|
||||
.p-5 {
|
||||
padding: 1.25rem;
|
||||
}
|
||||
|
@ -1085,16 +1116,16 @@ video {
|
|||
padding-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
.py-4 {
|
||||
padding-top: 1rem;
|
||||
padding-bottom: 1rem;
|
||||
}
|
||||
|
||||
.py-3 {
|
||||
padding-top: 0.75rem;
|
||||
padding-bottom: 0.75rem;
|
||||
}
|
||||
|
||||
.py-4 {
|
||||
padding-top: 1rem;
|
||||
padding-bottom: 1rem;
|
||||
}
|
||||
|
||||
.pb-10 {
|
||||
padding-bottom: 2.5rem;
|
||||
}
|
||||
|
|
|
@ -1,722 +0,0 @@
|
|||
// <auto-generated />
|
||||
using System;
|
||||
using DocuMed.Repository.Models;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace DocuMed.Repository.Migrations
|
||||
{
|
||||
[DbContext(typeof(ApplicationContext))]
|
||||
[Migration("20231019180057_init")]
|
||||
partial class init
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasDefaultSchema("public")
|
||||
.HasAnnotation("ProductVersion", "7.0.11")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
||||
|
||||
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.City.City", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("CreatedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<bool>("IsRemoved")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<DateTime>("ModifiedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("ModifiedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<DateTime>("RemovedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("RemovedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Cities", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.City.University", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("Address")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<Guid>("CityId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("CreatedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<bool>("IsRemoved")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<DateTime>("ModifiedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("ModifiedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<DateTime>("RemovedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("RemovedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("CityId");
|
||||
|
||||
b.ToTable("Universities", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.MedicalHistory.MedicalHistory", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("AddictionHistoryDetail")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("Age")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("AllergyDetail")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<DateTime>("BirthDate")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("ChiefComplaint")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("CreatedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("DiastolicBloodPressure")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("DrugHistoryDetail")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("FamilyHistoryDetail")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("FatherName")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("FirstName")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<bool>("IsRemoved")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<string>("LastName")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<DateTime>("ModifiedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("ModifiedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("NationalId")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("PastDiseasesHistoryDetail")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("PastSurgeryHistoryDetail")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("PresentIllnessDetail")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("PulseRate")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<DateTime>("RemovedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("RemovedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("SPO2")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Section")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("SystemReviewDetail")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("SystolicBloodPressure")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int>("Temperature")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("VitalSignDetail")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("MedicalHistories", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.MedicalHistory.MedicalHistoryAnswer", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("Answer")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("CreatedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<bool>("IsRemoved")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<Guid>("MedicalHistoryId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<DateTime>("ModifiedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("ModifiedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("Part")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Question")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("QuestionType")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<DateTime>("RemovedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("RemovedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("MedicalHistoryId");
|
||||
|
||||
b.ToTable("MedicalHistoryAnswers", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.MedicalHistoryTemplate.MedicalHistoryQuestion", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("CreatedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<bool>("IsRemoved")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<Guid>("MedicalHistoryTemplateId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<DateTime>("ModifiedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("ModifiedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("Part")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Question")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("QuestionType")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<DateTime>("RemovedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("RemovedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("MedicalHistoryTemplateId");
|
||||
|
||||
b.ToTable("MedicalHistoryQuestions", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.MedicalHistoryTemplate.MedicalHistoryTemplate", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("ChiefComplaint")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("CreatedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<bool>("IsRemoved")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<DateTime>("ModifiedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("ModifiedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<DateTime>("RemovedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("RemovedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("MedicalHistoryTemplates", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.User.ApplicationRole", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("ConcurrencyStamp")
|
||||
.IsConcurrencyToken()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("EnglishName")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("character varying(256)");
|
||||
|
||||
b.Property<string>("NormalizedName")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("character varying(256)");
|
||||
|
||||
b.Property<string>("PersianName")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("NormalizedName")
|
||||
.IsUnique()
|
||||
.HasDatabaseName("RoleNameIndex");
|
||||
|
||||
b.ToTable("Roles", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.User.ApplicationUser", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<int>("AccessFailedCount")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<DateTime>("BirthDate")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("ConcurrencyStamp")
|
||||
.IsConcurrencyToken()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("character varying(256)");
|
||||
|
||||
b.Property<bool>("EmailConfirmed")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<string>("FirstName")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("Gender")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("LastName")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<bool>("LockoutEnabled")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<DateTimeOffset?>("LockoutEnd")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<string>("NationalId")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("NormalizedEmail")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("character varying(256)");
|
||||
|
||||
b.Property<string>("NormalizedUserName")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("character varying(256)");
|
||||
|
||||
b.Property<string>("PasswordHash")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("PhoneNumber")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<bool>("PhoneNumberConfirmed")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<string>("Section")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("SecurityStamp")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("SignUpStatus")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<bool>("TwoFactorEnabled")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<Guid?>("UniversityId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("UserName")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("character varying(256)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("NormalizedEmail")
|
||||
.HasDatabaseName("EmailIndex");
|
||||
|
||||
b.HasIndex("NormalizedUserName")
|
||||
.IsUnique()
|
||||
.HasDatabaseName("UserNameIndex");
|
||||
|
||||
b.HasIndex("UniversityId");
|
||||
|
||||
b.ToTable("Users", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<System.Guid>", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("ClaimType")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("ClaimValue")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<Guid>("RoleId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("RoleId");
|
||||
|
||||
b.ToTable("RoleClaims", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<System.Guid>", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("ClaimType")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("ClaimValue")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<Guid>("UserId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.ToTable("Claims", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<System.Guid>", b =>
|
||||
{
|
||||
b.Property<string>("LoginProvider")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("ProviderKey")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("ProviderDisplayName")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<Guid>("UserId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.HasKey("LoginProvider", "ProviderKey");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.ToTable("Logins", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<System.Guid>", b =>
|
||||
{
|
||||
b.Property<Guid>("UserId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<Guid>("RoleId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.HasKey("UserId", "RoleId");
|
||||
|
||||
b.HasIndex("RoleId");
|
||||
|
||||
b.ToTable("UserRoles", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<System.Guid>", b =>
|
||||
{
|
||||
b.Property<Guid>("UserId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("LoginProvider")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Value")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("UserId", "LoginProvider", "Name");
|
||||
|
||||
b.ToTable("Tokens", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.City.University", b =>
|
||||
{
|
||||
b.HasOne("DocuMed.Domain.Entities.City.City", "City")
|
||||
.WithMany("Universities")
|
||||
.HasForeignKey("CityId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("City");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.MedicalHistory.MedicalHistoryAnswer", b =>
|
||||
{
|
||||
b.HasOne("DocuMed.Domain.Entities.MedicalHistory.MedicalHistory", "MedicalHistory")
|
||||
.WithMany("Answers")
|
||||
.HasForeignKey("MedicalHistoryId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("MedicalHistory");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.MedicalHistoryTemplate.MedicalHistoryQuestion", b =>
|
||||
{
|
||||
b.HasOne("DocuMed.Domain.Entities.MedicalHistoryTemplate.MedicalHistoryTemplate", "MedicalHistoryTemplate")
|
||||
.WithMany("Questions")
|
||||
.HasForeignKey("MedicalHistoryTemplateId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("MedicalHistoryTemplate");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.User.ApplicationUser", b =>
|
||||
{
|
||||
b.HasOne("DocuMed.Domain.Entities.City.University", "University")
|
||||
.WithMany()
|
||||
.HasForeignKey("UniversityId");
|
||||
|
||||
b.Navigation("University");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<System.Guid>", b =>
|
||||
{
|
||||
b.HasOne("DocuMed.Domain.Entities.User.ApplicationRole", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("RoleId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<System.Guid>", b =>
|
||||
{
|
||||
b.HasOne("DocuMed.Domain.Entities.User.ApplicationUser", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<System.Guid>", b =>
|
||||
{
|
||||
b.HasOne("DocuMed.Domain.Entities.User.ApplicationUser", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<System.Guid>", b =>
|
||||
{
|
||||
b.HasOne("DocuMed.Domain.Entities.User.ApplicationRole", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("RoleId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("DocuMed.Domain.Entities.User.ApplicationUser", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<System.Guid>", b =>
|
||||
{
|
||||
b.HasOne("DocuMed.Domain.Entities.User.ApplicationUser", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.City.City", b =>
|
||||
{
|
||||
b.Navigation("Universities");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.MedicalHistory.MedicalHistory", b =>
|
||||
{
|
||||
b.Navigation("Answers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.MedicalHistoryTemplate.MedicalHistoryTemplate", b =>
|
||||
{
|
||||
b.Navigation("Questions");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,786 +0,0 @@
|
|||
// <auto-generated />
|
||||
using System;
|
||||
using DocuMed.Repository.Models;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace DocuMed.Repository.Migrations
|
||||
{
|
||||
[DbContext(typeof(ApplicationContext))]
|
||||
[Migration("20231021121504_addSections")]
|
||||
partial class addSections
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasDefaultSchema("public")
|
||||
.HasAnnotation("ProductVersion", "7.0.11")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
||||
|
||||
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.City.City", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("CreatedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<bool>("IsRemoved")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<DateTime>("ModifiedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("ModifiedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<DateTime>("RemovedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("RemovedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Cities", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.City.Section", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("CreatedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Detail")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<bool>("IsRemoved")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<DateTime>("ModifiedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("ModifiedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<DateTime>("RemovedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("RemovedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<Guid>("UniversityId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("UniversityId");
|
||||
|
||||
b.ToTable("Sections", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.City.University", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("Address")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<Guid>("CityId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("CreatedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<bool>("IsRemoved")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<DateTime>("ModifiedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("ModifiedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<DateTime>("RemovedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("RemovedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("CityId");
|
||||
|
||||
b.ToTable("Universities", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.MedicalHistory.MedicalHistory", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("AddictionHistoryDetail")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("Age")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("AllergyDetail")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<DateTime>("BirthDate")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("ChiefComplaint")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("CreatedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("DiastolicBloodPressure")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("DrugHistoryDetail")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("FamilyHistoryDetail")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("FatherName")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("FirstName")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<bool>("IsRemoved")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<string>("LastName")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<DateTime>("ModifiedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("ModifiedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("NationalId")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("PastDiseasesHistoryDetail")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("PastSurgeryHistoryDetail")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("PresentIllnessDetail")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("PulseRate")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<DateTime>("RemovedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("RemovedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("SPO2")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Section")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("SystemReviewDetail")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("SystolicBloodPressure")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int>("Temperature")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("VitalSignDetail")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("MedicalHistories", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.MedicalHistory.MedicalHistoryAnswer", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("Answer")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("CreatedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<bool>("IsRemoved")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<Guid>("MedicalHistoryId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<DateTime>("ModifiedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("ModifiedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("Part")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Question")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("QuestionType")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<DateTime>("RemovedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("RemovedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("MedicalHistoryId");
|
||||
|
||||
b.ToTable("MedicalHistoryAnswers", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.MedicalHistoryTemplate.MedicalHistoryQuestion", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("CreatedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<bool>("IsRemoved")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<Guid>("MedicalHistoryTemplateId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<DateTime>("ModifiedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("ModifiedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("Part")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Question")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("QuestionType")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<DateTime>("RemovedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("RemovedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("MedicalHistoryTemplateId");
|
||||
|
||||
b.ToTable("MedicalHistoryQuestions", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.MedicalHistoryTemplate.MedicalHistoryTemplate", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("ChiefComplaint")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("CreatedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<bool>("IsRemoved")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<DateTime>("ModifiedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("ModifiedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<DateTime>("RemovedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("RemovedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("MedicalHistoryTemplates", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.User.ApplicationRole", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("ConcurrencyStamp")
|
||||
.IsConcurrencyToken()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("EnglishName")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("character varying(256)");
|
||||
|
||||
b.Property<string>("NormalizedName")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("character varying(256)");
|
||||
|
||||
b.Property<string>("PersianName")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("NormalizedName")
|
||||
.IsUnique()
|
||||
.HasDatabaseName("RoleNameIndex");
|
||||
|
||||
b.ToTable("Roles", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.User.ApplicationUser", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<int>("AccessFailedCount")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<DateTime>("BirthDate")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("ConcurrencyStamp")
|
||||
.IsConcurrencyToken()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("character varying(256)");
|
||||
|
||||
b.Property<bool>("EmailConfirmed")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<string>("FirstName")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("Gender")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("LastName")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<bool>("LockoutEnabled")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<DateTimeOffset?>("LockoutEnd")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<string>("NationalId")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("NormalizedEmail")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("character varying(256)");
|
||||
|
||||
b.Property<string>("NormalizedUserName")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("character varying(256)");
|
||||
|
||||
b.Property<string>("PasswordHash")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("PhoneNumber")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<bool>("PhoneNumberConfirmed")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<string>("Section")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("SecurityStamp")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("SignUpStatus")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<bool>("TwoFactorEnabled")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<Guid?>("UniversityId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("UserName")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("character varying(256)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("NormalizedEmail")
|
||||
.HasDatabaseName("EmailIndex");
|
||||
|
||||
b.HasIndex("NormalizedUserName")
|
||||
.IsUnique()
|
||||
.HasDatabaseName("UserNameIndex");
|
||||
|
||||
b.HasIndex("UniversityId");
|
||||
|
||||
b.ToTable("Users", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<System.Guid>", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("ClaimType")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("ClaimValue")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<Guid>("RoleId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("RoleId");
|
||||
|
||||
b.ToTable("RoleClaims", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<System.Guid>", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("ClaimType")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("ClaimValue")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<Guid>("UserId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.ToTable("Claims", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<System.Guid>", b =>
|
||||
{
|
||||
b.Property<string>("LoginProvider")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("ProviderKey")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("ProviderDisplayName")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<Guid>("UserId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.HasKey("LoginProvider", "ProviderKey");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.ToTable("Logins", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<System.Guid>", b =>
|
||||
{
|
||||
b.Property<Guid>("UserId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<Guid>("RoleId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.HasKey("UserId", "RoleId");
|
||||
|
||||
b.HasIndex("RoleId");
|
||||
|
||||
b.ToTable("UserRoles", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<System.Guid>", b =>
|
||||
{
|
||||
b.Property<Guid>("UserId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("LoginProvider")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Value")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("UserId", "LoginProvider", "Name");
|
||||
|
||||
b.ToTable("Tokens", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.City.Section", b =>
|
||||
{
|
||||
b.HasOne("DocuMed.Domain.Entities.City.University", "University")
|
||||
.WithMany("Sections")
|
||||
.HasForeignKey("UniversityId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("University");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.City.University", b =>
|
||||
{
|
||||
b.HasOne("DocuMed.Domain.Entities.City.City", "City")
|
||||
.WithMany("Universities")
|
||||
.HasForeignKey("CityId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("City");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.MedicalHistory.MedicalHistoryAnswer", b =>
|
||||
{
|
||||
b.HasOne("DocuMed.Domain.Entities.MedicalHistory.MedicalHistory", "MedicalHistory")
|
||||
.WithMany("Answers")
|
||||
.HasForeignKey("MedicalHistoryId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("MedicalHistory");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.MedicalHistoryTemplate.MedicalHistoryQuestion", b =>
|
||||
{
|
||||
b.HasOne("DocuMed.Domain.Entities.MedicalHistoryTemplate.MedicalHistoryTemplate", "MedicalHistoryTemplate")
|
||||
.WithMany("Questions")
|
||||
.HasForeignKey("MedicalHistoryTemplateId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("MedicalHistoryTemplate");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.User.ApplicationUser", b =>
|
||||
{
|
||||
b.HasOne("DocuMed.Domain.Entities.City.University", "University")
|
||||
.WithMany()
|
||||
.HasForeignKey("UniversityId");
|
||||
|
||||
b.Navigation("University");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<System.Guid>", b =>
|
||||
{
|
||||
b.HasOne("DocuMed.Domain.Entities.User.ApplicationRole", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("RoleId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<System.Guid>", b =>
|
||||
{
|
||||
b.HasOne("DocuMed.Domain.Entities.User.ApplicationUser", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<System.Guid>", b =>
|
||||
{
|
||||
b.HasOne("DocuMed.Domain.Entities.User.ApplicationUser", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<System.Guid>", b =>
|
||||
{
|
||||
b.HasOne("DocuMed.Domain.Entities.User.ApplicationRole", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("RoleId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("DocuMed.Domain.Entities.User.ApplicationUser", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<System.Guid>", b =>
|
||||
{
|
||||
b.HasOne("DocuMed.Domain.Entities.User.ApplicationUser", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.City.City", b =>
|
||||
{
|
||||
b.Navigation("Universities");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.City.University", b =>
|
||||
{
|
||||
b.Navigation("Sections");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.MedicalHistory.MedicalHistory", b =>
|
||||
{
|
||||
b.Navigation("Answers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.MedicalHistoryTemplate.MedicalHistoryTemplate", b =>
|
||||
{
|
||||
b.Navigation("Questions");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,58 +0,0 @@
|
|||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace DocuMed.Repository.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class addSections : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Sections",
|
||||
schema: "public",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
Name = table.Column<string>(type: "text", nullable: false),
|
||||
Detail = table.Column<string>(type: "text", nullable: false),
|
||||
UniversityId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
RemovedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
||||
CreatedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
||||
CreatedBy = table.Column<string>(type: "text", nullable: false),
|
||||
IsRemoved = table.Column<bool>(type: "boolean", nullable: false),
|
||||
RemovedBy = table.Column<string>(type: "text", nullable: false),
|
||||
ModifiedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
||||
ModifiedBy = table.Column<string>(type: "text", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Sections", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Sections_Universities_UniversityId",
|
||||
column: x => x.UniversityId,
|
||||
principalSchema: "public",
|
||||
principalTable: "Universities",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Sections_UniversityId",
|
||||
schema: "public",
|
||||
table: "Sections",
|
||||
column: "UniversityId");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "Sections",
|
||||
schema: "public");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,797 +0,0 @@
|
|||
// <auto-generated />
|
||||
using System;
|
||||
using DocuMed.Repository.Models;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace DocuMed.Repository.Migrations
|
||||
{
|
||||
[DbContext(typeof(ApplicationContext))]
|
||||
[Migration("20231021122606_editUser")]
|
||||
partial class editUser
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasDefaultSchema("public")
|
||||
.HasAnnotation("ProductVersion", "7.0.11")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
||||
|
||||
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.City.City", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("CreatedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<bool>("IsRemoved")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<DateTime>("ModifiedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("ModifiedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<DateTime>("RemovedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("RemovedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Cities", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.City.Section", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("CreatedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Detail")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<bool>("IsRemoved")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<DateTime>("ModifiedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("ModifiedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<DateTime>("RemovedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("RemovedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<Guid>("UniversityId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("UniversityId");
|
||||
|
||||
b.ToTable("Sections", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.City.University", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("Address")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<Guid>("CityId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("CreatedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<bool>("IsRemoved")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<DateTime>("ModifiedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("ModifiedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<DateTime>("RemovedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("RemovedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("CityId");
|
||||
|
||||
b.ToTable("Universities", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.MedicalHistory.MedicalHistory", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("AddictionHistoryDetail")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("Age")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("AllergyDetail")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<DateTime>("BirthDate")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("ChiefComplaint")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("CreatedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("DiastolicBloodPressure")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("DrugHistoryDetail")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("FamilyHistoryDetail")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("FatherName")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("FirstName")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<bool>("IsRemoved")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<string>("LastName")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<DateTime>("ModifiedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("ModifiedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("NationalId")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("PastDiseasesHistoryDetail")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("PastSurgeryHistoryDetail")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("PresentIllnessDetail")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("PulseRate")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<DateTime>("RemovedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("RemovedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("SPO2")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Section")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("SystemReviewDetail")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("SystolicBloodPressure")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int>("Temperature")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("VitalSignDetail")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("MedicalHistories", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.MedicalHistory.MedicalHistoryAnswer", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("Answer")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("CreatedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<bool>("IsRemoved")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<Guid>("MedicalHistoryId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<DateTime>("ModifiedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("ModifiedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("Part")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Question")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("QuestionType")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<DateTime>("RemovedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("RemovedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("MedicalHistoryId");
|
||||
|
||||
b.ToTable("MedicalHistoryAnswers", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.MedicalHistoryTemplate.MedicalHistoryQuestion", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("CreatedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<bool>("IsRemoved")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<Guid>("MedicalHistoryTemplateId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<DateTime>("ModifiedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("ModifiedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("Part")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Question")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("QuestionType")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<DateTime>("RemovedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("RemovedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("MedicalHistoryTemplateId");
|
||||
|
||||
b.ToTable("MedicalHistoryQuestions", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.MedicalHistoryTemplate.MedicalHistoryTemplate", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("ChiefComplaint")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("CreatedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<bool>("IsRemoved")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<DateTime>("ModifiedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("ModifiedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<DateTime>("RemovedAt")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("RemovedBy")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("MedicalHistoryTemplates", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.User.ApplicationRole", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("ConcurrencyStamp")
|
||||
.IsConcurrencyToken()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("EnglishName")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("character varying(256)");
|
||||
|
||||
b.Property<string>("NormalizedName")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("character varying(256)");
|
||||
|
||||
b.Property<string>("PersianName")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("NormalizedName")
|
||||
.IsUnique()
|
||||
.HasDatabaseName("RoleNameIndex");
|
||||
|
||||
b.ToTable("Roles", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.User.ApplicationUser", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<int>("AccessFailedCount")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<DateTime>("BirthDate")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<string>("ConcurrencyStamp")
|
||||
.IsConcurrencyToken()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("character varying(256)");
|
||||
|
||||
b.Property<bool>("EmailConfirmed")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<string>("FirstName")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("Gender")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("LastName")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<bool>("LockoutEnabled")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<DateTimeOffset?>("LockoutEnd")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.Property<string>("NationalId")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("NormalizedEmail")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("character varying(256)");
|
||||
|
||||
b.Property<string>("NormalizedUserName")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("character varying(256)");
|
||||
|
||||
b.Property<string>("PasswordHash")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("PhoneNumber")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<bool>("PhoneNumberConfirmed")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<Guid?>("SectionId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("SecurityStamp")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("SignUpStatus")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("StudentId")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<bool>("TwoFactorEnabled")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<Guid?>("UniversityId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("UserName")
|
||||
.HasMaxLength(256)
|
||||
.HasColumnType("character varying(256)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("NormalizedEmail")
|
||||
.HasDatabaseName("EmailIndex");
|
||||
|
||||
b.HasIndex("NormalizedUserName")
|
||||
.IsUnique()
|
||||
.HasDatabaseName("UserNameIndex");
|
||||
|
||||
b.HasIndex("SectionId");
|
||||
|
||||
b.HasIndex("UniversityId");
|
||||
|
||||
b.ToTable("Users", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<System.Guid>", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("ClaimType")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("ClaimValue")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<Guid>("RoleId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("RoleId");
|
||||
|
||||
b.ToTable("RoleClaims", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<System.Guid>", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("ClaimType")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("ClaimValue")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<Guid>("UserId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.ToTable("Claims", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<System.Guid>", b =>
|
||||
{
|
||||
b.Property<string>("LoginProvider")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("ProviderKey")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("ProviderDisplayName")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<Guid>("UserId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.HasKey("LoginProvider", "ProviderKey");
|
||||
|
||||
b.HasIndex("UserId");
|
||||
|
||||
b.ToTable("Logins", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<System.Guid>", b =>
|
||||
{
|
||||
b.Property<Guid>("UserId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<Guid>("RoleId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.HasKey("UserId", "RoleId");
|
||||
|
||||
b.HasIndex("RoleId");
|
||||
|
||||
b.ToTable("UserRoles", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<System.Guid>", b =>
|
||||
{
|
||||
b.Property<Guid>("UserId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("LoginProvider")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Value")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("UserId", "LoginProvider", "Name");
|
||||
|
||||
b.ToTable("Tokens", "public");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.City.Section", b =>
|
||||
{
|
||||
b.HasOne("DocuMed.Domain.Entities.City.University", "University")
|
||||
.WithMany("Sections")
|
||||
.HasForeignKey("UniversityId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("University");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.City.University", b =>
|
||||
{
|
||||
b.HasOne("DocuMed.Domain.Entities.City.City", "City")
|
||||
.WithMany("Universities")
|
||||
.HasForeignKey("CityId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("City");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.MedicalHistory.MedicalHistoryAnswer", b =>
|
||||
{
|
||||
b.HasOne("DocuMed.Domain.Entities.MedicalHistory.MedicalHistory", "MedicalHistory")
|
||||
.WithMany("Answers")
|
||||
.HasForeignKey("MedicalHistoryId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("MedicalHistory");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.MedicalHistoryTemplate.MedicalHistoryQuestion", b =>
|
||||
{
|
||||
b.HasOne("DocuMed.Domain.Entities.MedicalHistoryTemplate.MedicalHistoryTemplate", "MedicalHistoryTemplate")
|
||||
.WithMany("Questions")
|
||||
.HasForeignKey("MedicalHistoryTemplateId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("MedicalHistoryTemplate");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.User.ApplicationUser", b =>
|
||||
{
|
||||
b.HasOne("DocuMed.Domain.Entities.City.Section", "Section")
|
||||
.WithMany()
|
||||
.HasForeignKey("SectionId");
|
||||
|
||||
b.HasOne("DocuMed.Domain.Entities.City.University", "University")
|
||||
.WithMany()
|
||||
.HasForeignKey("UniversityId");
|
||||
|
||||
b.Navigation("Section");
|
||||
|
||||
b.Navigation("University");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<System.Guid>", b =>
|
||||
{
|
||||
b.HasOne("DocuMed.Domain.Entities.User.ApplicationRole", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("RoleId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<System.Guid>", b =>
|
||||
{
|
||||
b.HasOne("DocuMed.Domain.Entities.User.ApplicationUser", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<System.Guid>", b =>
|
||||
{
|
||||
b.HasOne("DocuMed.Domain.Entities.User.ApplicationUser", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<System.Guid>", b =>
|
||||
{
|
||||
b.HasOne("DocuMed.Domain.Entities.User.ApplicationRole", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("RoleId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("DocuMed.Domain.Entities.User.ApplicationUser", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<System.Guid>", b =>
|
||||
{
|
||||
b.HasOne("DocuMed.Domain.Entities.User.ApplicationUser", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.City.City", b =>
|
||||
{
|
||||
b.Navigation("Universities");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.City.University", b =>
|
||||
{
|
||||
b.Navigation("Sections");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.MedicalHistory.MedicalHistory", b =>
|
||||
{
|
||||
b.Navigation("Answers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.MedicalHistoryTemplate.MedicalHistoryTemplate", b =>
|
||||
{
|
||||
b.Navigation("Questions");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,68 +0,0 @@
|
|||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace DocuMed.Repository.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class editUser : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "Section",
|
||||
schema: "public",
|
||||
table: "Users",
|
||||
newName: "StudentId");
|
||||
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "SectionId",
|
||||
schema: "public",
|
||||
table: "Users",
|
||||
type: "uuid",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Users_SectionId",
|
||||
schema: "public",
|
||||
table: "Users",
|
||||
column: "SectionId");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_Users_Sections_SectionId",
|
||||
schema: "public",
|
||||
table: "Users",
|
||||
column: "SectionId",
|
||||
principalSchema: "public",
|
||||
principalTable: "Sections",
|
||||
principalColumn: "Id");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_Users_Sections_SectionId",
|
||||
schema: "public",
|
||||
table: "Users");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_Users_SectionId",
|
||||
schema: "public",
|
||||
table: "Users");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "SectionId",
|
||||
schema: "public",
|
||||
table: "Users");
|
||||
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "StudentId",
|
||||
schema: "public",
|
||||
table: "Users",
|
||||
newName: "Section");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,32 +0,0 @@
|
|||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace DocuMed.Repository.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class editTemplate : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "SectionId",
|
||||
schema: "public",
|
||||
table: "MedicalHistoryTemplates",
|
||||
type: "uuid",
|
||||
nullable: false,
|
||||
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"));
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "SectionId",
|
||||
schema: "public",
|
||||
table: "MedicalHistoryTemplates");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -12,8 +12,8 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|||
namespace DocuMed.Repository.Migrations
|
||||
{
|
||||
[DbContext(typeof(ApplicationContext))]
|
||||
[Migration("20231022121751_editTemplate")]
|
||||
partial class editTemplate
|
||||
[Migration("20231022193344_init")]
|
||||
partial class init
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
|
@ -178,6 +178,9 @@ namespace DocuMed.Repository.Migrations
|
|||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<Guid>("ApplicationUserId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<DateTime>("BirthDate")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
|
@ -274,6 +277,8 @@ namespace DocuMed.Repository.Migrations
|
|||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ApplicationUserId");
|
||||
|
||||
b.ToTable("MedicalHistories", "public");
|
||||
});
|
||||
|
||||
|
@ -387,6 +392,9 @@ namespace DocuMed.Repository.Migrations
|
|||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<Guid>("ApplicationUserId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("ChiefComplaint")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
@ -420,6 +428,8 @@ namespace DocuMed.Repository.Migrations
|
|||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ApplicationUserId");
|
||||
|
||||
b.ToTable("MedicalHistoryTemplates", "public");
|
||||
});
|
||||
|
||||
|
@ -687,6 +697,17 @@ namespace DocuMed.Repository.Migrations
|
|||
b.Navigation("City");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.MedicalHistory.MedicalHistory", b =>
|
||||
{
|
||||
b.HasOne("DocuMed.Domain.Entities.User.ApplicationUser", "ApplicationUser")
|
||||
.WithMany()
|
||||
.HasForeignKey("ApplicationUserId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("ApplicationUser");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.MedicalHistory.MedicalHistoryAnswer", b =>
|
||||
{
|
||||
b.HasOne("DocuMed.Domain.Entities.MedicalHistory.MedicalHistory", "MedicalHistory")
|
||||
|
@ -709,6 +730,17 @@ namespace DocuMed.Repository.Migrations
|
|||
b.Navigation("MedicalHistoryTemplate");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.MedicalHistoryTemplate.MedicalHistoryTemplate", b =>
|
||||
{
|
||||
b.HasOne("DocuMed.Domain.Entities.User.ApplicationUser", "ApplicationUser")
|
||||
.WithMany()
|
||||
.HasForeignKey("ApplicationUserId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("ApplicationUser");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.User.ApplicationUser", b =>
|
||||
{
|
||||
b.HasOne("DocuMed.Domain.Entities.City.Section", "Section")
|
|
@ -35,67 +35,6 @@ namespace DocuMed.Repository.Migrations
|
|||
table.PrimaryKey("PK_Cities", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "MedicalHistories",
|
||||
schema: "public",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
ChiefComplaint = table.Column<string>(type: "text", nullable: false),
|
||||
Section = table.Column<string>(type: "text", nullable: false),
|
||||
FirstName = table.Column<string>(type: "text", nullable: false),
|
||||
LastName = table.Column<string>(type: "text", nullable: false),
|
||||
FatherName = table.Column<string>(type: "text", nullable: false),
|
||||
NationalId = table.Column<string>(type: "text", nullable: false),
|
||||
Age = table.Column<int>(type: "integer", nullable: false),
|
||||
BirthDate = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
||||
PresentIllnessDetail = table.Column<string>(type: "text", nullable: false),
|
||||
PastDiseasesHistoryDetail = table.Column<string>(type: "text", nullable: false),
|
||||
PastSurgeryHistoryDetail = table.Column<string>(type: "text", nullable: false),
|
||||
FamilyHistoryDetail = table.Column<string>(type: "text", nullable: false),
|
||||
AllergyDetail = table.Column<string>(type: "text", nullable: false),
|
||||
DrugHistoryDetail = table.Column<string>(type: "text", nullable: false),
|
||||
AddictionHistoryDetail = table.Column<string>(type: "text", nullable: false),
|
||||
SystemReviewDetail = table.Column<string>(type: "text", nullable: false),
|
||||
VitalSignDetail = table.Column<string>(type: "text", nullable: false),
|
||||
SystolicBloodPressure = table.Column<int>(type: "integer", nullable: false),
|
||||
DiastolicBloodPressure = table.Column<int>(type: "integer", nullable: false),
|
||||
PulseRate = table.Column<int>(type: "integer", nullable: false),
|
||||
SPO2 = table.Column<int>(type: "integer", nullable: false),
|
||||
Temperature = table.Column<int>(type: "integer", nullable: false),
|
||||
RemovedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
||||
CreatedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
||||
CreatedBy = table.Column<string>(type: "text", nullable: false),
|
||||
IsRemoved = table.Column<bool>(type: "boolean", nullable: false),
|
||||
RemovedBy = table.Column<string>(type: "text", nullable: false),
|
||||
ModifiedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
||||
ModifiedBy = table.Column<string>(type: "text", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_MedicalHistories", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "MedicalHistoryTemplates",
|
||||
schema: "public",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
ChiefComplaint = table.Column<string>(type: "text", nullable: false),
|
||||
RemovedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
||||
CreatedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
||||
CreatedBy = table.Column<string>(type: "text", nullable: false),
|
||||
IsRemoved = table.Column<bool>(type: "boolean", nullable: false),
|
||||
RemovedBy = table.Column<string>(type: "text", nullable: false),
|
||||
ModifiedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
||||
ModifiedBy = table.Column<string>(type: "text", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_MedicalHistoryTemplates", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Roles",
|
||||
schema: "public",
|
||||
|
@ -143,6 +82,277 @@ namespace DocuMed.Repository.Migrations
|
|||
onDelete: ReferentialAction.Restrict);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "RoleClaims",
|
||||
schema: "public",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
RoleId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
ClaimType = table.Column<string>(type: "text", nullable: true),
|
||||
ClaimValue = table.Column<string>(type: "text", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_RoleClaims", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_RoleClaims_Roles_RoleId",
|
||||
column: x => x.RoleId,
|
||||
principalSchema: "public",
|
||||
principalTable: "Roles",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Sections",
|
||||
schema: "public",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
Name = table.Column<string>(type: "text", nullable: false),
|
||||
Detail = table.Column<string>(type: "text", nullable: false),
|
||||
UniversityId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
RemovedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
||||
CreatedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
||||
CreatedBy = table.Column<string>(type: "text", nullable: false),
|
||||
IsRemoved = table.Column<bool>(type: "boolean", nullable: false),
|
||||
RemovedBy = table.Column<string>(type: "text", nullable: false),
|
||||
ModifiedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
||||
ModifiedBy = table.Column<string>(type: "text", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Sections", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Sections_Universities_UniversityId",
|
||||
column: x => x.UniversityId,
|
||||
principalSchema: "public",
|
||||
principalTable: "Universities",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Users",
|
||||
schema: "public",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
FirstName = table.Column<string>(type: "text", nullable: false),
|
||||
LastName = table.Column<string>(type: "text", nullable: false),
|
||||
NationalId = table.Column<string>(type: "text", nullable: false),
|
||||
StudentId = table.Column<string>(type: "text", nullable: false),
|
||||
BirthDate = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
||||
Gender = table.Column<int>(type: "integer", nullable: false),
|
||||
SignUpStatus = table.Column<int>(type: "integer", nullable: false),
|
||||
UniversityId = table.Column<Guid>(type: "uuid", nullable: true),
|
||||
SectionId = table.Column<Guid>(type: "uuid", nullable: true),
|
||||
UserName = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
|
||||
NormalizedUserName = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
|
||||
Email = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
|
||||
NormalizedEmail = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
|
||||
EmailConfirmed = table.Column<bool>(type: "boolean", nullable: false),
|
||||
PasswordHash = table.Column<string>(type: "text", nullable: true),
|
||||
SecurityStamp = table.Column<string>(type: "text", nullable: true),
|
||||
ConcurrencyStamp = table.Column<string>(type: "text", nullable: true),
|
||||
PhoneNumber = table.Column<string>(type: "text", nullable: true),
|
||||
PhoneNumberConfirmed = table.Column<bool>(type: "boolean", nullable: false),
|
||||
TwoFactorEnabled = table.Column<bool>(type: "boolean", nullable: false),
|
||||
LockoutEnd = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: true),
|
||||
LockoutEnabled = table.Column<bool>(type: "boolean", nullable: false),
|
||||
AccessFailedCount = table.Column<int>(type: "integer", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Users", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Users_Sections_SectionId",
|
||||
column: x => x.SectionId,
|
||||
principalSchema: "public",
|
||||
principalTable: "Sections",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_Users_Universities_UniversityId",
|
||||
column: x => x.UniversityId,
|
||||
principalSchema: "public",
|
||||
principalTable: "Universities",
|
||||
principalColumn: "Id");
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Claims",
|
||||
schema: "public",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
UserId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
ClaimType = table.Column<string>(type: "text", nullable: true),
|
||||
ClaimValue = table.Column<string>(type: "text", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Claims", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Claims_Users_UserId",
|
||||
column: x => x.UserId,
|
||||
principalSchema: "public",
|
||||
principalTable: "Users",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Logins",
|
||||
schema: "public",
|
||||
columns: table => new
|
||||
{
|
||||
LoginProvider = table.Column<string>(type: "text", nullable: false),
|
||||
ProviderKey = table.Column<string>(type: "text", nullable: false),
|
||||
ProviderDisplayName = table.Column<string>(type: "text", nullable: true),
|
||||
UserId = table.Column<Guid>(type: "uuid", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Logins", x => new { x.LoginProvider, x.ProviderKey });
|
||||
table.ForeignKey(
|
||||
name: "FK_Logins_Users_UserId",
|
||||
column: x => x.UserId,
|
||||
principalSchema: "public",
|
||||
principalTable: "Users",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "MedicalHistories",
|
||||
schema: "public",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
ChiefComplaint = table.Column<string>(type: "text", nullable: false),
|
||||
Section = table.Column<string>(type: "text", nullable: false),
|
||||
FirstName = table.Column<string>(type: "text", nullable: false),
|
||||
LastName = table.Column<string>(type: "text", nullable: false),
|
||||
FatherName = table.Column<string>(type: "text", nullable: false),
|
||||
NationalId = table.Column<string>(type: "text", nullable: false),
|
||||
Age = table.Column<int>(type: "integer", nullable: false),
|
||||
BirthDate = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
||||
PresentIllnessDetail = table.Column<string>(type: "text", nullable: false),
|
||||
PastDiseasesHistoryDetail = table.Column<string>(type: "text", nullable: false),
|
||||
PastSurgeryHistoryDetail = table.Column<string>(type: "text", nullable: false),
|
||||
FamilyHistoryDetail = table.Column<string>(type: "text", nullable: false),
|
||||
AllergyDetail = table.Column<string>(type: "text", nullable: false),
|
||||
DrugHistoryDetail = table.Column<string>(type: "text", nullable: false),
|
||||
AddictionHistoryDetail = table.Column<string>(type: "text", nullable: false),
|
||||
SystemReviewDetail = table.Column<string>(type: "text", nullable: false),
|
||||
VitalSignDetail = table.Column<string>(type: "text", nullable: false),
|
||||
SystolicBloodPressure = table.Column<int>(type: "integer", nullable: false),
|
||||
DiastolicBloodPressure = table.Column<int>(type: "integer", nullable: false),
|
||||
PulseRate = table.Column<int>(type: "integer", nullable: false),
|
||||
SPO2 = table.Column<int>(type: "integer", nullable: false),
|
||||
Temperature = table.Column<int>(type: "integer", nullable: false),
|
||||
ApplicationUserId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
RemovedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
||||
CreatedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
||||
CreatedBy = table.Column<string>(type: "text", nullable: false),
|
||||
IsRemoved = table.Column<bool>(type: "boolean", nullable: false),
|
||||
RemovedBy = table.Column<string>(type: "text", nullable: false),
|
||||
ModifiedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
||||
ModifiedBy = table.Column<string>(type: "text", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_MedicalHistories", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_MedicalHistories_Users_ApplicationUserId",
|
||||
column: x => x.ApplicationUserId,
|
||||
principalSchema: "public",
|
||||
principalTable: "Users",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "MedicalHistoryTemplates",
|
||||
schema: "public",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
ChiefComplaint = table.Column<string>(type: "text", nullable: false),
|
||||
SectionId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
ApplicationUserId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
RemovedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
||||
CreatedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
||||
CreatedBy = table.Column<string>(type: "text", nullable: false),
|
||||
IsRemoved = table.Column<bool>(type: "boolean", nullable: false),
|
||||
RemovedBy = table.Column<string>(type: "text", nullable: false),
|
||||
ModifiedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
||||
ModifiedBy = table.Column<string>(type: "text", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_MedicalHistoryTemplates", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_MedicalHistoryTemplates_Users_ApplicationUserId",
|
||||
column: x => x.ApplicationUserId,
|
||||
principalSchema: "public",
|
||||
principalTable: "Users",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Tokens",
|
||||
schema: "public",
|
||||
columns: table => new
|
||||
{
|
||||
UserId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
LoginProvider = table.Column<string>(type: "text", nullable: false),
|
||||
Name = table.Column<string>(type: "text", nullable: false),
|
||||
Value = table.Column<string>(type: "text", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Tokens", x => new { x.UserId, x.LoginProvider, x.Name });
|
||||
table.ForeignKey(
|
||||
name: "FK_Tokens_Users_UserId",
|
||||
column: x => x.UserId,
|
||||
principalSchema: "public",
|
||||
principalTable: "Users",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "UserRoles",
|
||||
schema: "public",
|
||||
columns: table => new
|
||||
{
|
||||
UserId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
RoleId = table.Column<Guid>(type: "uuid", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_UserRoles", x => new { x.UserId, x.RoleId });
|
||||
table.ForeignKey(
|
||||
name: "FK_UserRoles_Roles_RoleId",
|
||||
column: x => x.RoleId,
|
||||
principalSchema: "public",
|
||||
principalTable: "Roles",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
table.ForeignKey(
|
||||
name: "FK_UserRoles_Users_UserId",
|
||||
column: x => x.UserId,
|
||||
principalSchema: "public",
|
||||
principalTable: "Users",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "MedicalHistoryAnswers",
|
||||
schema: "public",
|
||||
|
@ -204,163 +414,6 @@ namespace DocuMed.Repository.Migrations
|
|||
onDelete: ReferentialAction.Restrict);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "RoleClaims",
|
||||
schema: "public",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
RoleId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
ClaimType = table.Column<string>(type: "text", nullable: true),
|
||||
ClaimValue = table.Column<string>(type: "text", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_RoleClaims", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_RoleClaims_Roles_RoleId",
|
||||
column: x => x.RoleId,
|
||||
principalSchema: "public",
|
||||
principalTable: "Roles",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Users",
|
||||
schema: "public",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
FirstName = table.Column<string>(type: "text", nullable: false),
|
||||
LastName = table.Column<string>(type: "text", nullable: false),
|
||||
NationalId = table.Column<string>(type: "text", nullable: false),
|
||||
Section = table.Column<string>(type: "text", nullable: false),
|
||||
BirthDate = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
||||
Gender = table.Column<int>(type: "integer", nullable: false),
|
||||
SignUpStatus = table.Column<int>(type: "integer", nullable: false),
|
||||
UniversityId = table.Column<Guid>(type: "uuid", nullable: true),
|
||||
UserName = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
|
||||
NormalizedUserName = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
|
||||
Email = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
|
||||
NormalizedEmail = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
|
||||
EmailConfirmed = table.Column<bool>(type: "boolean", nullable: false),
|
||||
PasswordHash = table.Column<string>(type: "text", nullable: true),
|
||||
SecurityStamp = table.Column<string>(type: "text", nullable: true),
|
||||
ConcurrencyStamp = table.Column<string>(type: "text", nullable: true),
|
||||
PhoneNumber = table.Column<string>(type: "text", nullable: true),
|
||||
PhoneNumberConfirmed = table.Column<bool>(type: "boolean", nullable: false),
|
||||
TwoFactorEnabled = table.Column<bool>(type: "boolean", nullable: false),
|
||||
LockoutEnd = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: true),
|
||||
LockoutEnabled = table.Column<bool>(type: "boolean", nullable: false),
|
||||
AccessFailedCount = table.Column<int>(type: "integer", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Users", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Users_Universities_UniversityId",
|
||||
column: x => x.UniversityId,
|
||||
principalSchema: "public",
|
||||
principalTable: "Universities",
|
||||
principalColumn: "Id");
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Claims",
|
||||
schema: "public",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
UserId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
ClaimType = table.Column<string>(type: "text", nullable: true),
|
||||
ClaimValue = table.Column<string>(type: "text", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Claims", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Claims_Users_UserId",
|
||||
column: x => x.UserId,
|
||||
principalSchema: "public",
|
||||
principalTable: "Users",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Logins",
|
||||
schema: "public",
|
||||
columns: table => new
|
||||
{
|
||||
LoginProvider = table.Column<string>(type: "text", nullable: false),
|
||||
ProviderKey = table.Column<string>(type: "text", nullable: false),
|
||||
ProviderDisplayName = table.Column<string>(type: "text", nullable: true),
|
||||
UserId = table.Column<Guid>(type: "uuid", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Logins", x => new { x.LoginProvider, x.ProviderKey });
|
||||
table.ForeignKey(
|
||||
name: "FK_Logins_Users_UserId",
|
||||
column: x => x.UserId,
|
||||
principalSchema: "public",
|
||||
principalTable: "Users",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Tokens",
|
||||
schema: "public",
|
||||
columns: table => new
|
||||
{
|
||||
UserId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
LoginProvider = table.Column<string>(type: "text", nullable: false),
|
||||
Name = table.Column<string>(type: "text", nullable: false),
|
||||
Value = table.Column<string>(type: "text", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Tokens", x => new { x.UserId, x.LoginProvider, x.Name });
|
||||
table.ForeignKey(
|
||||
name: "FK_Tokens_Users_UserId",
|
||||
column: x => x.UserId,
|
||||
principalSchema: "public",
|
||||
principalTable: "Users",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "UserRoles",
|
||||
schema: "public",
|
||||
columns: table => new
|
||||
{
|
||||
UserId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
RoleId = table.Column<Guid>(type: "uuid", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_UserRoles", x => new { x.UserId, x.RoleId });
|
||||
table.ForeignKey(
|
||||
name: "FK_UserRoles_Roles_RoleId",
|
||||
column: x => x.RoleId,
|
||||
principalSchema: "public",
|
||||
principalTable: "Roles",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
table.ForeignKey(
|
||||
name: "FK_UserRoles_Users_UserId",
|
||||
column: x => x.UserId,
|
||||
principalSchema: "public",
|
||||
principalTable: "Users",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Claims_UserId",
|
||||
schema: "public",
|
||||
|
@ -373,6 +426,12 @@ namespace DocuMed.Repository.Migrations
|
|||
table: "Logins",
|
||||
column: "UserId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_MedicalHistories_ApplicationUserId",
|
||||
schema: "public",
|
||||
table: "MedicalHistories",
|
||||
column: "ApplicationUserId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_MedicalHistoryAnswers_MedicalHistoryId",
|
||||
schema: "public",
|
||||
|
@ -385,6 +444,12 @@ namespace DocuMed.Repository.Migrations
|
|||
table: "MedicalHistoryQuestions",
|
||||
column: "MedicalHistoryTemplateId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_MedicalHistoryTemplates_ApplicationUserId",
|
||||
schema: "public",
|
||||
table: "MedicalHistoryTemplates",
|
||||
column: "ApplicationUserId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_RoleClaims_RoleId",
|
||||
schema: "public",
|
||||
|
@ -398,6 +463,12 @@ namespace DocuMed.Repository.Migrations
|
|||
column: "NormalizedName",
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Sections_UniversityId",
|
||||
schema: "public",
|
||||
table: "Sections",
|
||||
column: "UniversityId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Universities_CityId",
|
||||
schema: "public",
|
||||
|
@ -416,6 +487,12 @@ namespace DocuMed.Repository.Migrations
|
|||
table: "Users",
|
||||
column: "NormalizedEmail");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Users_SectionId",
|
||||
schema: "public",
|
||||
table: "Users",
|
||||
column: "SectionId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Users_UniversityId",
|
||||
schema: "public",
|
||||
|
@ -477,6 +554,10 @@ namespace DocuMed.Repository.Migrations
|
|||
name: "Users",
|
||||
schema: "public");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Sections",
|
||||
schema: "public");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Universities",
|
||||
schema: "public");
|
|
@ -175,6 +175,9 @@ namespace DocuMed.Repository.Migrations
|
|||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<Guid>("ApplicationUserId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<DateTime>("BirthDate")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
|
@ -271,6 +274,8 @@ namespace DocuMed.Repository.Migrations
|
|||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ApplicationUserId");
|
||||
|
||||
b.ToTable("MedicalHistories", "public");
|
||||
});
|
||||
|
||||
|
@ -384,6 +389,9 @@ namespace DocuMed.Repository.Migrations
|
|||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<Guid>("ApplicationUserId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("ChiefComplaint")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
@ -417,6 +425,8 @@ namespace DocuMed.Repository.Migrations
|
|||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ApplicationUserId");
|
||||
|
||||
b.ToTable("MedicalHistoryTemplates", "public");
|
||||
});
|
||||
|
||||
|
@ -684,6 +694,17 @@ namespace DocuMed.Repository.Migrations
|
|||
b.Navigation("City");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.MedicalHistory.MedicalHistory", b =>
|
||||
{
|
||||
b.HasOne("DocuMed.Domain.Entities.User.ApplicationUser", "ApplicationUser")
|
||||
.WithMany()
|
||||
.HasForeignKey("ApplicationUserId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("ApplicationUser");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.MedicalHistory.MedicalHistoryAnswer", b =>
|
||||
{
|
||||
b.HasOne("DocuMed.Domain.Entities.MedicalHistory.MedicalHistory", "MedicalHistory")
|
||||
|
@ -706,6 +727,17 @@ namespace DocuMed.Repository.Migrations
|
|||
b.Navigation("MedicalHistoryTemplate");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.MedicalHistoryTemplate.MedicalHistoryTemplate", b =>
|
||||
{
|
||||
b.HasOne("DocuMed.Domain.Entities.User.ApplicationUser", "ApplicationUser")
|
||||
.WithMany()
|
||||
.HasForeignKey("ApplicationUserId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("ApplicationUser");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("DocuMed.Domain.Entities.User.ApplicationUser", b =>
|
||||
{
|
||||
b.HasOne("DocuMed.Domain.Entities.City.Section", "Section")
|
||||
|
|
Loading…
Reference in New Issue