complete authentication
parent
b27d2c56da
commit
378e4c19c0
|
@ -2,7 +2,7 @@
|
|||
"ConnectionStrings": {
|
||||
"PostgresServer": "User ID=postgres;Password=root;Host=localhost;Port=5432;Database=iGarsonDB;",
|
||||
"PostgresCompose": "Host=postgres_image;Username=brizcouser;Password=brizco;Database=BrizCoDB;",
|
||||
"Postgres": "Host=pg-0,pg-1;Username=igarsonAgent;Password=xHTpBf4wC+bBeNg2pL6Ga7VEWKFJx7VPEUpqxwPFfOc2YYTVwFQuHfsiqoVeT9+6;Database=BrizcoDB;Load Balance Hosts=true;Target Session Attributes=primary;Application Name=iGLS"
|
||||
"Postgres": "Host=pg-0,pg-1;Username=igarsonAgent;Password=xHTpBf4wC+bBeNg2pL6Ga7VEWKFJx7VPEUpqxwPFfOc2YYTVwFQuHfsiqoVeT9+6;Database=DocuMedDB;Load Balance Hosts=true;Target Session Attributes=primary;Application Name=iGLS"
|
||||
},
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
|
@ -14,7 +14,7 @@
|
|||
}
|
||||
},
|
||||
"SiteSettings": {
|
||||
"BaseUrl": "http://localhost:32769",
|
||||
"BaseUrl": "http://localhost:32770",
|
||||
"UserSetting": {
|
||||
"Username": "root",
|
||||
"Email": "info@documed.ir",
|
||||
|
|
|
@ -0,0 +1,65 @@
|
|||
namespace DocuMed.Api.Controllers;
|
||||
public class CityController : ICarterModule
|
||||
{
|
||||
|
||||
public virtual void AddRoutes(IEndpointRouteBuilder app)
|
||||
{
|
||||
var group = app.NewVersionedApi("City").MapGroup($"api/city")
|
||||
.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, CancellationToken cancellationToken)
|
||||
=> TypedResults.Ok(await repositoryWrapper.SetRepository<City>().TableNoTracking
|
||||
.Select(CityMapper.ProjectToSDto).ToListAsync(cancellationToken));
|
||||
|
||||
// GET:Get An Entity By Id
|
||||
public async Task<IResult> GetAsync(int id, IRepositoryWrapper repositoryWrapper, CancellationToken cancellationToken)
|
||||
=> TypedResults.Ok(await repositoryWrapper.SetRepository<City>().GetByIdAsync(cancellationToken, id));
|
||||
|
||||
// POST:Add New Entity
|
||||
public virtual async Task<IResult> Post([FromBody] CitySDto dto, IRepositoryWrapper repositoryWrapper, CancellationToken cancellationToken)
|
||||
{
|
||||
var ent = City.Create(dto.Name);
|
||||
repositoryWrapper.SetRepository<City>().Add(ent);
|
||||
await repositoryWrapper.SaveChangesAsync(cancellationToken);
|
||||
return TypedResults.Ok(ent);
|
||||
}
|
||||
|
||||
// PUT:Update Entity
|
||||
public virtual async Task<IResult> Put([FromBody] CitySDto dto, IRepositoryWrapper repositoryWrapper, CancellationToken cancellationToken)
|
||||
{
|
||||
var ent = City.Create(dto.Name);
|
||||
ent.Id = dto.Id;
|
||||
repositoryWrapper.SetRepository<City>().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<City>().GetByIdAsync(cancellationToken, id);
|
||||
repositoryWrapper.SetRepository<City>().Delete(ent);
|
||||
await repositoryWrapper.SaveChangesAsync(cancellationToken);
|
||||
return TypedResults.Ok();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,67 @@
|
|||
namespace DocuMed.Api.Controllers;
|
||||
|
||||
public class UniversityController : ICarterModule
|
||||
{
|
||||
|
||||
public virtual void AddRoutes(IEndpointRouteBuilder app)
|
||||
{
|
||||
var group = app.NewVersionedApi("University")
|
||||
.MapGroup($"api/university")
|
||||
.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, CancellationToken cancellationToken)
|
||||
=> TypedResults.Ok(await repositoryWrapper.SetRepository<University>().TableNoTracking
|
||||
.Select(UniversityMapper.ProjectToSDto).ToListAsync(cancellationToken));
|
||||
|
||||
// GET:Get An Entity By Id
|
||||
public async Task<IResult> GetAsync(int id, IRepositoryWrapper repositoryWrapper, CancellationToken cancellationToken)
|
||||
=> TypedResults.Ok(await repositoryWrapper.SetRepository<University>().GetByIdAsync(cancellationToken, id));
|
||||
|
||||
// POST:Add New Entity
|
||||
public virtual async Task<IResult> Post([FromBody] UniversitySDto dto, IRepositoryWrapper repositoryWrapper, CancellationToken cancellationToken)
|
||||
{
|
||||
var ent = University.Create(dto.Name,dto.Address,dto.CityId);
|
||||
repositoryWrapper.SetRepository<University>().Add(ent);
|
||||
await repositoryWrapper.SaveChangesAsync(cancellationToken);
|
||||
return TypedResults.Ok(ent);
|
||||
}
|
||||
|
||||
// PUT:Update Entity
|
||||
public virtual async Task<IResult> Put([FromBody] UniversitySDto dto, IRepositoryWrapper repositoryWrapper, CancellationToken cancellationToken)
|
||||
{
|
||||
var ent = University.Create(dto.Name,dto.Address,dto.CityId);
|
||||
ent.Id = dto.Id;
|
||||
repositoryWrapper.SetRepository<University>().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<University>().GetByIdAsync(cancellationToken, id);
|
||||
repositoryWrapper.SetRepository<University>().Delete(ent);
|
||||
await repositoryWrapper.SaveChangesAsync(cancellationToken);
|
||||
return TypedResults.Ok();
|
||||
}
|
||||
}
|
|
@ -57,6 +57,7 @@
|
|||
<Using Include="Autofac" />
|
||||
<Using Include="Autofac.Extensions.DependencyInjection" />
|
||||
<Using Include="Carter" />
|
||||
<Using Include="DocuMed.Api.WebFramework.Bases" />
|
||||
<Using Include="DocuMed.Api.WebFramework.Configurations" />
|
||||
<Using Include="DocuMed.Api.WebFramework.Swagger" />
|
||||
<Using Include="DocuMed.Common.Extensions" />
|
||||
|
@ -70,7 +71,10 @@
|
|||
<Using Include="DocuMed.Core.Models.Api" />
|
||||
<Using Include="DocuMed.Domain" />
|
||||
<Using Include="DocuMed.Domain.Dtos.RequestDtos" />
|
||||
<Using Include="DocuMed.Domain.Dtos.SmallDtos" />
|
||||
<Using Include="DocuMed.Domain.Entities.City" />
|
||||
<Using Include="DocuMed.Domain.Entities.User" />
|
||||
<Using Include="DocuMed.Domain.Mappers" />
|
||||
<Using Include="DocuMed.Domain.Models.Settings" />
|
||||
<Using Include="DocuMed.Infrastructure" />
|
||||
<Using Include="DocuMed.Infrastructure.Models" />
|
||||
|
@ -83,6 +87,7 @@
|
|||
<Using Include="Microsoft.AspNetCore.Identity" />
|
||||
<Using Include="Microsoft.AspNetCore.Mvc" />
|
||||
<Using Include="Microsoft.AspNetCore.Mvc.Filters" />
|
||||
<Using Include="Microsoft.EntityFrameworkCore" />
|
||||
<Using Include="Microsoft.Extensions.Options" />
|
||||
<Using Include="Serilog" />
|
||||
<Using Include="Serilog.Events" />
|
||||
|
|
|
@ -25,7 +25,8 @@
|
|||
"environmentVariables": {
|
||||
"ASPNETCORE_URLS": "http://+:80"
|
||||
},
|
||||
"publishAllPorts": true
|
||||
"publishAllPorts": true,
|
||||
"DockerfileRunArguments": " --network=mother -p 32770:80"
|
||||
}
|
||||
},
|
||||
"$schema": "https://json.schemastore.org/launchsettings.json",
|
||||
|
|
|
@ -73,6 +73,73 @@ public class CrudEndpoint<TEntity,TGetAllQuery,TGetOneQuery,TCreateCommand,TUpda
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
public class CrudEndpoint<TEntity> where TEntity : ApiEntity, new()
|
||||
{
|
||||
private readonly string _endpointName;
|
||||
|
||||
public CrudEndpoint(string endpointName)
|
||||
{
|
||||
_endpointName = endpointName;
|
||||
}
|
||||
|
||||
public virtual void AddRoutes(IEndpointRouteBuilder app)
|
||||
{
|
||||
var group = app.NewVersionedApi(_endpointName).MapGroup($"api/{_endpointName.ToLower()}");
|
||||
|
||||
group.MapGet("", GetAllAsync)
|
||||
.WithDisplayName("GetAll")
|
||||
.HasApiVersion(1.0);
|
||||
|
||||
group.MapGet("{id}", GetAsync)
|
||||
.WithName("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, CancellationToken cancellationToken)
|
||||
=> TypedResults.Ok(await repositoryWrapper.SetRepository<TEntity>().TableNoTracking.ToListAsync(cancellationToken));
|
||||
|
||||
// GET:Get An Entity By Id
|
||||
public async Task<IResult> GetAsync(int id, IRepositoryWrapper repositoryWrapper, CancellationToken cancellationToken)
|
||||
=> TypedResults.Ok(await repositoryWrapper.SetRepository<TEntity>().GetByIdAsync(cancellationToken, id));
|
||||
|
||||
// POST:Add New Entity
|
||||
public virtual async Task<IResult> Post([FromBody] TEntity ent, IRepositoryWrapper repositoryWrapper, CancellationToken cancellationToken)
|
||||
{
|
||||
repositoryWrapper.SetRepository<TEntity>().Add(ent);
|
||||
await repositoryWrapper.SaveChangesAsync(cancellationToken);
|
||||
return TypedResults.Ok(ent);
|
||||
}
|
||||
|
||||
// PUT:Update Entity
|
||||
public virtual async Task<IResult> Put([FromBody] TEntity ent,IRepositoryWrapper repositoryWrapper, CancellationToken cancellationToken)
|
||||
{
|
||||
repositoryWrapper.SetRepository<TEntity>().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<TEntity>().GetByIdAsync(cancellationToken, id);
|
||||
repositoryWrapper.SetRepository<TEntity>().Delete(ent);
|
||||
await repositoryWrapper.SaveChangesAsync(cancellationToken);
|
||||
return TypedResults.Ok();
|
||||
}
|
||||
}
|
||||
|
||||
[ApiController]
|
||||
//[AllowAnonymous]
|
||||
[ApiResultFilter]
|
||||
|
|
|
@ -65,7 +65,7 @@ public static class ServiceExtensions
|
|||
serviceCollection.AddDbContextFactory<ApplicationContext>(options =>
|
||||
{
|
||||
options.UseQueryTrackingBehavior(QueryTrackingBehavior.NoTracking);
|
||||
options.UseNpgsql(Configuration.GetConnectionString("PostgresCompose"), b => b.MigrationsAssembly("DocuMed.Repository"))
|
||||
options.UseNpgsql(Configuration.GetConnectionString("Postgres"), b => b.MigrationsAssembly("DocuMed.Repository"))
|
||||
.UseProjectAssembly(typeof(ApplicationUser).Assembly);
|
||||
//options.EnableServiceProviderCaching(true);
|
||||
}).BuildServiceProvider();
|
||||
|
|
|
@ -46,6 +46,6 @@ namespace DocuMed.Common.Models.Api
|
|||
public TUser User { get; set; }
|
||||
|
||||
public string BearerToken => $"Bearer {access_token}";
|
||||
public List<string> Permissions { get; set; }
|
||||
public List<string> Permissions { get; set; } = new();
|
||||
}
|
||||
}
|
|
@ -69,7 +69,7 @@ public class AccountService : IAccountService
|
|||
user = await _userService.CreateUserAsync(phoneNumber);
|
||||
|
||||
var token = await _userManager.GenerateTwoFactorTokenAsync(user, "Phone");
|
||||
await _smsService.SendVerifyCodeAsync(newPhoneNumber, token);
|
||||
//await _smsService.SendVerifyCodeAsync(newPhoneNumber, token);
|
||||
return user.SignUpStatus;
|
||||
}
|
||||
|
||||
|
|
|
@ -28,4 +28,5 @@ public class MedicalHistorySDto : BaseDto<MedicalHistorySDto,MedicalHistory>
|
|||
public int PulseRate { get; set; }
|
||||
public int SPO2 { get; set; }
|
||||
public int Temperature { get; set; }
|
||||
public string FullName => FirstName + " " + LastName;
|
||||
}
|
|
@ -4,4 +4,5 @@ public class UniversitySDto : BaseDto<UniversitySDto,University>
|
|||
{
|
||||
public string Name { get; set; } = string.Empty;
|
||||
public string Address { get; set; } = string.Empty;
|
||||
public Guid CityId { get; set; }
|
||||
}
|
|
@ -1,5 +1,8 @@
|
|||
namespace DocuMed.Domain.Entities.City;
|
||||
|
||||
[AdaptTwoWays("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)]
|
||||
[AdaptTwoWays("[name]LDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)]
|
||||
[GenerateMapper]
|
||||
public partial class City : ApiEntity
|
||||
{
|
||||
public City()
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
namespace DocuMed.Domain.Entities.City;
|
||||
|
||||
[AdaptTwoWays("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)]
|
||||
[GenerateMapper]
|
||||
public partial class University : ApiEntity
|
||||
{
|
||||
public University()
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
namespace DocuMed.Domain.Entities.MedicalHistory;
|
||||
|
||||
[AdaptTwoWays("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) },
|
||||
MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)]
|
||||
[AdaptTwoWays("[name]LDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) },
|
||||
MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)]
|
||||
[AdaptTwoWays("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)]
|
||||
[AdaptTwoWays("[name]LDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)]
|
||||
[GenerateMapper]
|
||||
|
||||
public partial class MedicalHistory : ApiEntity
|
||||
|
|
|
@ -18,7 +18,7 @@ namespace DocuMed.Domain.Mappers
|
|||
BirthDate = p1.BirthDate,
|
||||
Gender = p1.Gender,
|
||||
SignUpStatus = p1.SignUpStatus,
|
||||
UniversityId = p1.UniversityId,
|
||||
UniversityId = (Guid?)p1.UniversityId,
|
||||
Id = p1.Id,
|
||||
UserName = p1.UserName,
|
||||
Email = p1.Email,
|
||||
|
@ -41,7 +41,7 @@ namespace DocuMed.Domain.Mappers
|
|||
result.BirthDate = p2.BirthDate;
|
||||
result.Gender = p2.Gender;
|
||||
result.SignUpStatus = p2.SignUpStatus;
|
||||
result.UniversityId = p2.UniversityId;
|
||||
result.UniversityId = (Guid?)p2.UniversityId;
|
||||
result.Id = p2.Id;
|
||||
result.UserName = p2.UserName;
|
||||
result.Email = p2.Email;
|
||||
|
@ -59,7 +59,7 @@ namespace DocuMed.Domain.Mappers
|
|||
BirthDate = p4.BirthDate,
|
||||
Gender = p4.Gender,
|
||||
SignUpStatus = p4.SignUpStatus,
|
||||
UniversityId = p4.UniversityId,
|
||||
UniversityId = (Guid?)p4.UniversityId,
|
||||
Id = p4.Id,
|
||||
UserName = p4.UserName,
|
||||
Email = p4.Email,
|
||||
|
@ -81,7 +81,7 @@ namespace DocuMed.Domain.Mappers
|
|||
BirthDate = p5.BirthDate,
|
||||
Gender = p5.Gender,
|
||||
SignUpStatus = p5.SignUpStatus,
|
||||
UniversityId = p5.UniversityId,
|
||||
UniversityId = p5.UniversityId == null ? default(Guid) : (Guid)p5.UniversityId,
|
||||
Id = p5.Id
|
||||
};
|
||||
}
|
||||
|
@ -104,7 +104,7 @@ namespace DocuMed.Domain.Mappers
|
|||
result.BirthDate = p6.BirthDate;
|
||||
result.Gender = p6.Gender;
|
||||
result.SignUpStatus = p6.SignUpStatus;
|
||||
result.UniversityId = p6.UniversityId;
|
||||
result.UniversityId = p6.UniversityId == null ? default(Guid) : (Guid)p6.UniversityId;
|
||||
result.Id = p6.Id;
|
||||
return result;
|
||||
|
||||
|
@ -122,7 +122,7 @@ namespace DocuMed.Domain.Mappers
|
|||
BirthDate = p8.BirthDate,
|
||||
Gender = p8.Gender,
|
||||
SignUpStatus = p8.SignUpStatus,
|
||||
UniversityId = p8.UniversityId,
|
||||
UniversityId = p8.UniversityId == null ? default(Guid) : (Guid)p8.UniversityId,
|
||||
Id = p8.Id
|
||||
};
|
||||
}
|
||||
|
|
|
@ -0,0 +1,244 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Linq.Expressions;
|
||||
using DocuMed.Domain.Dtos.LargDtos;
|
||||
using DocuMed.Domain.Dtos.SmallDtos;
|
||||
using DocuMed.Domain.Entities.City;
|
||||
|
||||
namespace DocuMed.Domain.Mappers
|
||||
{
|
||||
public static partial class CityMapper
|
||||
{
|
||||
public static City AdaptToCity(this CitySDto p1)
|
||||
{
|
||||
return p1 == null ? null : new City()
|
||||
{
|
||||
Name = p1.Name,
|
||||
Id = p1.Id
|
||||
};
|
||||
}
|
||||
public static City AdaptTo(this CitySDto p2, City p3)
|
||||
{
|
||||
if (p2 == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
City result = p3 ?? new City();
|
||||
|
||||
result.Name = p2.Name;
|
||||
result.Id = p2.Id;
|
||||
return result;
|
||||
|
||||
}
|
||||
public static Expression<Func<CitySDto, City>> ProjectToCity => p4 => new City()
|
||||
{
|
||||
Name = p4.Name,
|
||||
Id = p4.Id
|
||||
};
|
||||
public static CitySDto AdaptToSDto(this City p5)
|
||||
{
|
||||
return p5 == null ? null : new CitySDto()
|
||||
{
|
||||
Name = p5.Name,
|
||||
Id = p5.Id
|
||||
};
|
||||
}
|
||||
public static CitySDto AdaptTo(this City p6, CitySDto p7)
|
||||
{
|
||||
if (p6 == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
CitySDto result = p7 ?? new CitySDto();
|
||||
|
||||
result.Name = p6.Name;
|
||||
result.Id = p6.Id;
|
||||
return result;
|
||||
|
||||
}
|
||||
public static Expression<Func<City, CitySDto>> ProjectToSDto => p8 => new CitySDto()
|
||||
{
|
||||
Name = p8.Name,
|
||||
Id = p8.Id
|
||||
};
|
||||
public static City AdaptToCity(this CityLDto p9)
|
||||
{
|
||||
return p9 == null ? null : new City()
|
||||
{
|
||||
Name = p9.Name,
|
||||
Universities = funcMain1(p9.Universities),
|
||||
Id = p9.Id
|
||||
};
|
||||
}
|
||||
public static City AdaptTo(this CityLDto p11, City p12)
|
||||
{
|
||||
if (p11 == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
City result = p12 ?? new City();
|
||||
|
||||
result.Name = p11.Name;
|
||||
result.Universities = funcMain2(p11.Universities, result.Universities);
|
||||
result.Id = p11.Id;
|
||||
return result;
|
||||
|
||||
}
|
||||
public static Expression<Func<CityLDto, City>> ProjectLDtoToCity => p15 => new City()
|
||||
{
|
||||
Name = p15.Name,
|
||||
Universities = p15.Universities.Select<UniversitySDto, University>(p16 => new University()
|
||||
{
|
||||
Name = p16.Name,
|
||||
Address = p16.Address,
|
||||
CityId = p16.CityId,
|
||||
Id = p16.Id
|
||||
}).ToList<University>(),
|
||||
Id = p15.Id
|
||||
};
|
||||
public static CityLDto AdaptToLDto(this City p17)
|
||||
{
|
||||
return p17 == null ? null : new CityLDto()
|
||||
{
|
||||
Name = p17.Name,
|
||||
Universities = funcMain3(p17.Universities),
|
||||
Id = p17.Id
|
||||
};
|
||||
}
|
||||
public static CityLDto AdaptTo(this City p19, CityLDto p20)
|
||||
{
|
||||
if (p19 == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
CityLDto result = p20 ?? new CityLDto();
|
||||
|
||||
result.Name = p19.Name;
|
||||
result.Universities = funcMain4(p19.Universities, result.Universities);
|
||||
result.Id = p19.Id;
|
||||
return result;
|
||||
|
||||
}
|
||||
public static Expression<Func<City, CityLDto>> ProjectToLDto => p23 => new CityLDto()
|
||||
{
|
||||
Name = p23.Name,
|
||||
Universities = p23.Universities.Select<University, UniversitySDto>(p24 => new UniversitySDto()
|
||||
{
|
||||
Name = p24.Name,
|
||||
Address = p24.Address,
|
||||
CityId = p24.CityId,
|
||||
Id = p24.Id
|
||||
}).ToList<UniversitySDto>(),
|
||||
Id = p23.Id
|
||||
};
|
||||
|
||||
private static List<University> funcMain1(List<UniversitySDto> p10)
|
||||
{
|
||||
if (p10 == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
List<University> result = new List<University>(p10.Count);
|
||||
|
||||
int i = 0;
|
||||
int len = p10.Count;
|
||||
|
||||
while (i < len)
|
||||
{
|
||||
UniversitySDto item = p10[i];
|
||||
result.Add(item == null ? null : new University()
|
||||
{
|
||||
Name = item.Name,
|
||||
Address = item.Address,
|
||||
CityId = item.CityId,
|
||||
Id = item.Id
|
||||
});
|
||||
i++;
|
||||
}
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
private static List<University> funcMain2(List<UniversitySDto> p13, List<University> p14)
|
||||
{
|
||||
if (p13 == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
List<University> result = new List<University>(p13.Count);
|
||||
|
||||
int i = 0;
|
||||
int len = p13.Count;
|
||||
|
||||
while (i < len)
|
||||
{
|
||||
UniversitySDto item = p13[i];
|
||||
result.Add(item == null ? null : new University()
|
||||
{
|
||||
Name = item.Name,
|
||||
Address = item.Address,
|
||||
CityId = item.CityId,
|
||||
Id = item.Id
|
||||
});
|
||||
i++;
|
||||
}
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
private static List<UniversitySDto> funcMain3(List<University> p18)
|
||||
{
|
||||
if (p18 == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
List<UniversitySDto> result = new List<UniversitySDto>(p18.Count);
|
||||
|
||||
int i = 0;
|
||||
int len = p18.Count;
|
||||
|
||||
while (i < len)
|
||||
{
|
||||
University item = p18[i];
|
||||
result.Add(item == null ? null : new UniversitySDto()
|
||||
{
|
||||
Name = item.Name,
|
||||
Address = item.Address,
|
||||
CityId = item.CityId,
|
||||
Id = item.Id
|
||||
});
|
||||
i++;
|
||||
}
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
private static List<UniversitySDto> funcMain4(List<University> p21, List<UniversitySDto> p22)
|
||||
{
|
||||
if (p21 == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
List<UniversitySDto> result = new List<UniversitySDto>(p21.Count);
|
||||
|
||||
int i = 0;
|
||||
int len = p21.Count;
|
||||
|
||||
while (i < len)
|
||||
{
|
||||
University item = p21[i];
|
||||
result.Add(item == null ? null : new UniversitySDto()
|
||||
{
|
||||
Name = item.Name,
|
||||
Address = item.Address,
|
||||
CityId = item.CityId,
|
||||
Id = item.Id
|
||||
});
|
||||
i++;
|
||||
}
|
||||
return result;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,75 @@
|
|||
using System;
|
||||
using System.Linq.Expressions;
|
||||
using DocuMed.Domain.Dtos.SmallDtos;
|
||||
using DocuMed.Domain.Entities.City;
|
||||
|
||||
namespace DocuMed.Domain.Mappers
|
||||
{
|
||||
public static partial class UniversityMapper
|
||||
{
|
||||
public static University AdaptToUniversity(this UniversitySDto p1)
|
||||
{
|
||||
return p1 == null ? null : new University()
|
||||
{
|
||||
Name = p1.Name,
|
||||
Address = p1.Address,
|
||||
CityId = p1.CityId,
|
||||
Id = p1.Id
|
||||
};
|
||||
}
|
||||
public static University AdaptTo(this UniversitySDto p2, University p3)
|
||||
{
|
||||
if (p2 == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
University result = p3 ?? new University();
|
||||
|
||||
result.Name = p2.Name;
|
||||
result.Address = p2.Address;
|
||||
result.CityId = p2.CityId;
|
||||
result.Id = p2.Id;
|
||||
return result;
|
||||
|
||||
}
|
||||
public static Expression<Func<UniversitySDto, University>> ProjectToUniversity => p4 => new University()
|
||||
{
|
||||
Name = p4.Name,
|
||||
Address = p4.Address,
|
||||
CityId = p4.CityId,
|
||||
Id = p4.Id
|
||||
};
|
||||
public static UniversitySDto AdaptToSDto(this University p5)
|
||||
{
|
||||
return p5 == null ? null : new UniversitySDto()
|
||||
{
|
||||
Name = p5.Name,
|
||||
Address = p5.Address,
|
||||
CityId = p5.CityId,
|
||||
Id = p5.Id
|
||||
};
|
||||
}
|
||||
public static UniversitySDto AdaptTo(this University p6, UniversitySDto p7)
|
||||
{
|
||||
if (p6 == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
UniversitySDto result = p7 ?? new UniversitySDto();
|
||||
|
||||
result.Name = p6.Name;
|
||||
result.Address = p6.Address;
|
||||
result.CityId = p6.CityId;
|
||||
result.Id = p6.Id;
|
||||
return result;
|
||||
|
||||
}
|
||||
public static Expression<Func<University, UniversitySDto>> ProjectToSDto => p8 => new UniversitySDto()
|
||||
{
|
||||
Name = p8.Name,
|
||||
Address = p8.Address,
|
||||
CityId = p8.CityId,
|
||||
Id = p8.Id
|
||||
};
|
||||
}
|
||||
}
|
|
@ -12,10 +12,15 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Blazored.LocalStorage" Version="4.4.0" />
|
||||
<PackageReference Include="Blazorise.LottieAnimation" Version="1.3.1" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.0.10" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="7.0.10" PrivateAssets="all" />
|
||||
<PackageReference Include="MudBlazor" Version="6.10.0" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
<PackageReference Include="Refit" Version="7.0.0" />
|
||||
<PackageReference Include="Refit.HttpClientFactory" Version="7.0.0" />
|
||||
<PackageReference Include="Refit.Newtonsoft.Json" Version="7.0.0" />
|
||||
<PackageReference Include="Toolbelt.Blazor.PWA.Updater" Version="2.1.0.1" />
|
||||
</ItemGroup>
|
||||
|
||||
|
@ -33,9 +38,28 @@
|
|||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Using Include="Blazored.LocalStorage" />
|
||||
<Using Include="DocuMed.Common.Extensions" />
|
||||
<Using Include="DocuMed.Common.Models.Api" />
|
||||
<Using Include="DocuMed.Domain.Dtos.RequestDtos" />
|
||||
<Using Include="DocuMed.Domain.Dtos.SmallDtos" />
|
||||
<Using Include="DocuMed.Domain.Entities.City" />
|
||||
<Using Include="DocuMed.Domain.Entities.MedicalHistory" />
|
||||
<Using Include="DocuMed.Domain.Entities.MedicalHistoryTemplate" />
|
||||
<Using Include="DocuMed.Domain.Enums" />
|
||||
<Using Include="DocuMed.Domain.Models" />
|
||||
<Using Include="DocuMed.PWA" />
|
||||
<Using Include="DocuMed.PWA.Models" />
|
||||
<Using Include="DocuMed.PWA.Models.Entities" />
|
||||
<Using Include="DocuMed.PWA.Models.Enums" />
|
||||
<Using Include="DocuMed.PWA.Models.Api" />
|
||||
<Using Include="DocuMed.PWA.Services.RestServices" />
|
||||
<Using Include="DocuMed.PWA.Utilities" />
|
||||
<Using Include="Microsoft.AspNetCore.Components.Web" />
|
||||
<Using Include="Microsoft.AspNetCore.Components.WebAssembly.Hosting" />
|
||||
<Using Include="Microsoft.IdentityModel.Tokens" />
|
||||
<Using Include="MudBlazor" />
|
||||
<Using Include="MudBlazor.Services" />
|
||||
<Using Include="Refit" />
|
||||
<Using Include="Toolbelt.Blazor.Extensions.DependencyInjection" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
namespace DocuMed.PWA.Models;
|
||||
|
||||
public static class Address
|
||||
{
|
||||
public const string BaseAddress = "http://localhost:32770/api";
|
||||
public const string AuthController = $"{BaseAddress}/auth";
|
||||
public const string CityController = $"{BaseAddress}/city";
|
||||
public const string UniversityController = $"{BaseAddress}/university";
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
namespace DocuMed.PWA.Models.Api;
|
||||
|
||||
public class ApiResult
|
||||
{
|
||||
public ApiResult(bool isSuccess, ApiResultStatusCode statusCode, string message = null)
|
||||
{
|
||||
IsSuccess = isSuccess;
|
||||
StatusCode = statusCode;
|
||||
Message = message ?? statusCode.ToDisplay();
|
||||
}
|
||||
|
||||
public bool IsSuccess { get; set; }
|
||||
public ApiResultStatusCode StatusCode { get; set; }
|
||||
|
||||
public string Message { get; set; }
|
||||
}
|
||||
|
||||
public class ApiResult<TData> : ApiResult where TData : class
|
||||
{
|
||||
public ApiResult(bool isSuccess, ApiResultStatusCode statusCode, TData data, string message = null) : base(isSuccess, statusCode, message)
|
||||
{
|
||||
Data = data;
|
||||
}
|
||||
public TData Data { get; set; }
|
||||
}
|
|
@ -1,11 +0,0 @@
|
|||
namespace DocuMed.PWA.Models.Entities;
|
||||
|
||||
public class MedicalHistory
|
||||
{
|
||||
public string Name { get; set; } = string.Empty;
|
||||
public string Section { get; set; } = string.Empty;
|
||||
public int Aag { get; set; }
|
||||
public string CC { get; set; } = string.Empty;
|
||||
public Gender Gender { get; set; }
|
||||
|
||||
}
|
|
@ -1,7 +0,0 @@
|
|||
namespace DocuMed.PWA.Models.Entities;
|
||||
|
||||
public class MedicalHistoryQuestion
|
||||
{
|
||||
public string Title { get; set; } = string.Empty;
|
||||
public MedicalHistoryQuestionType Type { get; set; }
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
namespace DocuMed.PWA.Models.Entities
|
||||
{
|
||||
public class MedicalHistorySystemReview
|
||||
{
|
||||
public string Title { get; set; } = string.Empty;
|
||||
public string System { get; set; } = string.Empty;
|
||||
public bool IsSign { get; set; }
|
||||
public bool IsSymptom { get; set; }
|
||||
}
|
||||
}
|
|
@ -1,7 +0,0 @@
|
|||
namespace DocuMed.PWA.Models.Entities;
|
||||
|
||||
public class MedicalHistoryTemplate
|
||||
{
|
||||
public string CC { get; set; } = string.Empty;
|
||||
public string Section { get; set; } = string.Empty;
|
||||
}
|
|
@ -1,11 +0,0 @@
|
|||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace DocuMed.PWA.Models.Enums;
|
||||
|
||||
public enum Gender
|
||||
{
|
||||
[Display(Name = "مرد")]
|
||||
Male,
|
||||
[Display(Name = "زن")]
|
||||
Female
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
namespace DocuMed.PWA.Models.Enums;
|
||||
|
||||
public enum MedicalHistoryQuestionType
|
||||
{
|
||||
Hourly,
|
||||
Interrogatively,
|
||||
YesOrNo
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
namespace DocuMed.PWA.Models;
|
||||
|
||||
public static class LocalStorageKeys
|
||||
{
|
||||
public const string Token = nameof(Token);
|
||||
}
|
|
@ -1,4 +1,5 @@
|
|||
@page "/HomePage"
|
||||
@using DocuMed.Domain.Dtos.SmallDtos
|
||||
@inject NavigationManager NavigationManager
|
||||
|
||||
|
||||
|
@ -81,56 +82,48 @@
|
|||
public void MedicalHistoryTemplatesClicked() => NavigationManager.NavigateTo("MedicalHistoryTemplatesPage");
|
||||
public void MedicalOrdersClicked() => NavigationManager.NavigateTo("MedicalOrdersPage");
|
||||
|
||||
private List<MedicalHistory> _medicalHistories = new List<MedicalHistory>();
|
||||
private List<MedicalHistorySDto> _medicalHistories = new List<MedicalHistorySDto>();
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
_medicalHistories.Add(new MedicalHistory
|
||||
_medicalHistories.Add(new MedicalHistorySDto
|
||||
{
|
||||
Name = "امیرحسین معتمدی",
|
||||
Aag = 35,
|
||||
CC = "سردرد",
|
||||
FirstName = "امیرحسین ",
|
||||
LastName = "معتمدی",
|
||||
Age = 35,
|
||||
ChiefComplaint = "سردرد",
|
||||
Section = "داخلی",
|
||||
Gender = Gender.Male
|
||||
});
|
||||
_medicalHistories.Add(new MedicalHistory
|
||||
{
|
||||
Name = "محمد امینی",
|
||||
Aag = 40,
|
||||
CC = "معده درد",
|
||||
Section = "داخلی",
|
||||
Gender = Gender.Male
|
||||
});
|
||||
_medicalHistories.Add(new MedicalHistory
|
||||
{
|
||||
Name = "زیبا بروفه",
|
||||
Aag = 20,
|
||||
CC = "سوختگی",
|
||||
Section = "سوختگی",
|
||||
Gender = Gender.Female
|
||||
});
|
||||
_medicalHistories.Add(new MedicalHistory
|
||||
{
|
||||
Name = "روشنک فدایی",
|
||||
Aag = 18,
|
||||
CC = "دردسینه",
|
||||
Section = "داخلی",
|
||||
Gender = Gender.Female
|
||||
});
|
||||
_medicalHistories.Add(new MedicalHistory
|
||||
{
|
||||
Name = "سطلان محمدی",
|
||||
Aag = 28,
|
||||
CC = "روانی",
|
||||
Section = "روان",
|
||||
Gender = Gender.Male
|
||||
});
|
||||
_medicalHistories.Add(new MedicalHistory
|
||||
});
|
||||
_medicalHistories.Add(new MedicalHistorySDto
|
||||
{
|
||||
Name = "سعید سعیدی",
|
||||
Aag = 60,
|
||||
CC = "بی هوشی",
|
||||
FirstName = "امیرحسین ",
|
||||
LastName = "معتمدی",
|
||||
Age = 35,
|
||||
ChiefComplaint = "سردرد",
|
||||
Section = "داخلی",
|
||||
});
|
||||
_medicalHistories.Add(new MedicalHistorySDto
|
||||
{
|
||||
FirstName = "امیرحسین ",
|
||||
LastName = "معتمدی",
|
||||
Age = 35,
|
||||
ChiefComplaint = "سردرد",
|
||||
Section = "داخلی",
|
||||
});
|
||||
_medicalHistories.Add(new MedicalHistorySDto
|
||||
{
|
||||
FirstName = "امیرحسین ",
|
||||
LastName = "معتمدی",
|
||||
Age = 35,
|
||||
ChiefComplaint = "سردرد",
|
||||
Section = "داخلی",
|
||||
});
|
||||
_medicalHistories.Add(new MedicalHistorySDto
|
||||
{
|
||||
FirstName = "امیرحسین ",
|
||||
LastName = "معتمدی",
|
||||
Age = 35,
|
||||
ChiefComplaint = "سردرد",
|
||||
Section = "داخلی",
|
||||
Gender = Gender.Male
|
||||
});
|
||||
base.OnInitialized();
|
||||
}
|
||||
|
|
|
@ -1,34 +1,42 @@
|
|||
@page "/"
|
||||
@inject NavigationManager NavigationManager
|
||||
@inject IRestWrapper RestWrapper
|
||||
@inject ISnackbar Snackbar
|
||||
@inject ILocalStorageService LocalStorage
|
||||
@inject IUserUtility UserUtility
|
||||
|
||||
<style>
|
||||
.mud-input-label {
|
||||
background-color: #FFFBE6;
|
||||
}
|
||||
|
||||
/* .secondary-border>.mud-input-control-input-container>.mud-input.mud-input-outlined>input:focus~.mud-input-outlined-border {
|
||||
border-color: #FD5523;
|
||||
color: white;
|
||||
} */
|
||||
/* .secondary-border>.mud-input-control-input-container>.mud-input.mud-input-outlined>input:focus~.mud-input-outlined-border {
|
||||
border-color: #FD5523;
|
||||
color: white;
|
||||
} */
|
||||
</style>
|
||||
<div class="flex flex-col w-screen h-screen">
|
||||
<div class="w-full overflow-hidden basis-2/4">
|
||||
|
||||
<MudCarousel class="w-full h-full" ShowArrows="false" ShowBullets="false" EnableSwipeGesture="true"
|
||||
AutoCycle="true" TData="object">
|
||||
AutoCycle="true" TData="object">
|
||||
<MudCarouselItem>
|
||||
<div class="flex flex-col h-full mx-5">
|
||||
<div class="my-auto">
|
||||
<div class="-mt-8">
|
||||
<dotlottie-player
|
||||
src="https://lottie.host/752358b3-21b0-4448-b8f4-0f2a2acc998b/DZAZuyYyol.json"
|
||||
background="transparent" speed="1" class="m-auto w-60 h-60" loop autoplay />
|
||||
<dotlottie-player src="https://lottie.host/752358b3-21b0-4448-b8f4-0f2a2acc998b/DZAZuyYyol.json"
|
||||
background="transparent" speed="1" class="m-auto w-60 h-60" loop autoplay />
|
||||
</div>
|
||||
<p class="mx-auto text-lg font-extrabold text-center font-iranyekan">شرح حال نویسی بیمار راحت تر
|
||||
<p class="mx-auto text-lg font-extrabold text-center font-iranyekan">
|
||||
شرح حال نویسی بیمار راحت تر
|
||||
از
|
||||
همیشه</p>
|
||||
<p class="mx-auto text-xs text-center font-iranyekan">نرم افزار داکیومد با امکانات بسیار زیاد
|
||||
همیشه
|
||||
</p>
|
||||
<p class="mx-auto text-xs text-center font-iranyekan">
|
||||
نرم افزار داکیومد با امکانات بسیار زیاد
|
||||
خود
|
||||
مثل شرح حال نویسی همراه و همیار همیشگی پزشکان محترم</p>
|
||||
مثل شرح حال نویسی همراه و همیار همیشگی پزشکان محترم
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</MudCarouselItem>
|
||||
|
@ -36,15 +44,18 @@
|
|||
<div class="flex flex-col h-full mx-5">
|
||||
<div class="my-auto">
|
||||
<div class="-mt-8 -mb-3">
|
||||
<dotlottie-player
|
||||
src="https://lottie.host/9ca6089d-388f-4eef-8050-8181c1d945a1/B7oM9NN9O4.json"
|
||||
background="transparent" speed="1" class="m-auto w-60 h-60" loop autoplay />
|
||||
<dotlottie-player src="https://lottie.host/9ca6089d-388f-4eef-8050-8181c1d945a1/B7oM9NN9O4.json"
|
||||
background="transparent" speed="1" class="m-auto w-60 h-60" loop autoplay />
|
||||
</div>
|
||||
<p class="mx-auto text-lg font-extrabold text-center font-iranyekan">اوردر های شما همه در یک
|
||||
اپلیکیشن</p>
|
||||
<p class="mx-auto text-xs text-center font-iranyekan">نرم افزار داکیومد با امکانات بسیار زیاد
|
||||
<p class="mx-auto text-lg font-extrabold text-center font-iranyekan">
|
||||
اوردر های شما همه در یک
|
||||
اپلیکیشن
|
||||
</p>
|
||||
<p class="mx-auto text-xs text-center font-iranyekan">
|
||||
نرم افزار داکیومد با امکانات بسیار زیاد
|
||||
خود
|
||||
مثل شرح حال نویسی همیار همیشگی پزشکان محترم</p>
|
||||
مثل شرح حال نویسی همیار همیشگی پزشکان محترم
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</MudCarouselItem>
|
||||
|
@ -52,15 +63,17 @@
|
|||
<div class="flex flex-col h-full mx-5">
|
||||
<div class="my-auto">
|
||||
<div class="-mt-8 -mb-10">
|
||||
<dotlottie-player
|
||||
src="https://lottie.host/87dfb50f-e91f-45c6-b8dc-d3a2436c533c/5DPvXG0W1t.json"
|
||||
background="transparent" speed="1" class="m-auto w-72 h-72" loop autoplay />
|
||||
<dotlottie-player src="https://lottie.host/87dfb50f-e91f-45c6-b8dc-d3a2436c533c/5DPvXG0W1t.json"
|
||||
background="transparent" speed="1" class="m-auto w-72 h-72" loop autoplay />
|
||||
</div>
|
||||
<p class="mx-auto text-lg font-extrabold text-center font-iranyekan">نرم افزار جامع داکیـــــومد
|
||||
<p class="mx-auto text-lg font-extrabold text-center font-iranyekan">
|
||||
نرم افزار جامع داکیـــــومد
|
||||
</p>
|
||||
<p class="mx-auto text-xs text-center font-iranyekan">نرم افزار داکیومد با امکانات بسیار زیاد
|
||||
<p class="mx-auto text-xs text-center font-iranyekan">
|
||||
نرم افزار داکیومد با امکانات بسیار زیاد
|
||||
خود
|
||||
مثل تهیه پیشنویس شرح حال همراه همیشگی پزشکان محترم</p>
|
||||
مثل تهیه پیشنویس شرح حال همراه همیشگی پزشکان محترم
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</MudCarouselItem>
|
||||
|
@ -68,7 +81,7 @@
|
|||
</div>
|
||||
<MudPaper Elevation="10" class="w-full rounded-t-2xl bg-[#FFFBE6] basis-2/4">
|
||||
<MudCarousel class="w-full h-full overflow-x-hidden overflow-y-scroll" @ref="_carousel" ShowArrows="false"
|
||||
ShowBullets="false" EnableSwipeGesture="false" AutoCycle="false" TData="object">
|
||||
ShowBullets="false" EnableSwipeGesture="false" AutoCycle="false" TData="object">
|
||||
<MudCarouselItem>
|
||||
<div class="flex flex-col h-full p-5 font-iranyekan">
|
||||
<MudStack class="my-auto">
|
||||
|
@ -78,13 +91,13 @@
|
|||
وارد کنید
|
||||
</p>
|
||||
|
||||
<MudForm @ref="confirmPhoneNumberForm">
|
||||
<MudForm @ref="_confirmPhoneNumberForm">
|
||||
<MudTextField Required="true" RequiredError="لطفا شماره تلفن را وارد کنید"
|
||||
@bind-Value="@phoneNumber" InputType="InputType.Telephone" T="string" Label="شماره تلفن همراه"
|
||||
Variant="Variant.Outlined" />
|
||||
@bind-Value="@_phoneNumber" InputType="InputType.Telephone" T="string" Label="شماره تلفن همراه"
|
||||
Variant="Variant.Outlined" />
|
||||
</MudForm>
|
||||
<BaseButtonUi OnClickCallback="ConfirmPhoneNumber" Content="ثبت شماره تلفن"
|
||||
Icon="@Icons.Material.TwoTone.Phone" Color="Color.Secondary" Variant="Variant.Filled">
|
||||
<BaseButtonUi IsProcessing="_isProcessing" OnClickCallback="ConfirmPhoneNumber" Content="ثبت شماره تلفن"
|
||||
Icon="@Icons.Material.TwoTone.Phone" Color="Color.Secondary" Variant="Variant.Filled">
|
||||
</BaseButtonUi>
|
||||
<p class="mx-3 text-justify">
|
||||
با تایید شماره تلفن همراه با همه شرایط <a class="text-blue-500">
|
||||
|
@ -105,11 +118,11 @@
|
|||
وارد کنید
|
||||
</p>
|
||||
|
||||
<MudTextField class="text-sm" T="string" Label="کد ارسال شده را وارد کنید"
|
||||
Variant="Variant.Outlined" />
|
||||
<MudTextField class="text-sm" T="string" InputType="InputType.Number" @bind-Value="@_verifyCode" Label="کد ارسال شده را وارد کنید"
|
||||
Variant="Variant.Outlined" />
|
||||
|
||||
<BaseButtonUi OnClickCallback="ConfirmVerifyCode" Content="تایید کد"
|
||||
Icon="@Icons.Material.TwoTone.Verified" Color="Color.Secondary" Variant="Variant.Filled">
|
||||
<BaseButtonUi IsProcessing="_isProcessing" OnClickCallback="ConfirmVerifyCode" Content="تایید کد"
|
||||
Icon="@Icons.Material.TwoTone.Verified" Color="Color.Secondary" Variant="Variant.Filled">
|
||||
</BaseButtonUi>
|
||||
|
||||
<div class="flex flex-row mr-5">
|
||||
|
@ -118,8 +131,8 @@
|
|||
<a class="-mt-5 font-bold text-blue-600">ارسال مجدد پیامک</a>
|
||||
</MudStack>
|
||||
<MudButton class="mr-auto rounded-full" EndIcon="@Icons.Material.Filled.ChevronLeft"
|
||||
Variant="Variant.Outlined" @onclick="PhoneNumberRollBack" Color="Color.Primary"
|
||||
Size="Size.Medium">
|
||||
Variant="Variant.Outlined" @onclick="PhoneNumberRollBack" Color="Color.Primary"
|
||||
Size="Size.Medium">
|
||||
بازگشت
|
||||
</MudButton>
|
||||
|
||||
|
@ -131,19 +144,51 @@
|
|||
<div class="flex flex-col h-full">
|
||||
<MudStack class="w-screen p-5 my-auto font-iranyekan">
|
||||
<p class="text-lg font-extrabold font-iranyekan">ثبت نام</p>
|
||||
<p class="text-xs text-justify">برای ثبت نام به اپلیکیشن داکیومد باید اطلاعات کامل خود را وارد
|
||||
<p class="text-xs text-justify">
|
||||
برای ثبت نام به اپلیکیشن داکیومد باید اطلاعات کامل خود را وارد
|
||||
کنید
|
||||
</p>
|
||||
|
||||
<MudTextField class="text-sm" T="string" Label="نام" Variant="Variant.Outlined" />
|
||||
<MudTextField class="text-sm" T="string" Label="نام خانوادگی" Variant="Variant.Outlined" />
|
||||
<MudTextField class="text-sm" T="string" @bind-Value="@phoneNumber" Label="شماره تلفن همراه"
|
||||
Variant="Variant.Outlined" />
|
||||
<MudAutocomplete T="string" Label="شهر شما" Variant="Variant.Outlined" />
|
||||
<MudAutocomplete T="string" Label="دانشگاه" Variant="Variant.Outlined" />
|
||||
<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="شماره تلفن همراه"
|
||||
Variant="Variant.Outlined" />
|
||||
<MudAutocomplete @bind-Value="@_selectedCity" SearchFunc="SearchCity" T="CitySDto" Label="شهر شما" Variant="Variant.Outlined">
|
||||
<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>
|
||||
|
||||
<BaseButtonUi OnClickCallback="ConfirmSignUp" Content="تکمیل ثبت نام"
|
||||
Icon="@Icons.Material.TwoTone.Login" Color="Color.Primary" Variant="Variant.Filled">
|
||||
<MudAutocomplete @bind-Value="@_selectedUni" SearchFunc="SearchUniversity" T="UniversitySDto" Label="دانشگاه" Variant="Variant.Outlined">
|
||||
<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>
|
||||
</MudForm>
|
||||
|
||||
<BaseButtonUi IsProcessing="_isProcessing" OnClickCallback="ConfirmSignUp" Content="تکمیل ثبت نام"
|
||||
Icon="@Icons.Material.TwoTone.Login" Color="Color.Primary" Variant="Variant.Filled">
|
||||
</BaseButtonUi>
|
||||
</MudStack>
|
||||
</div>
|
||||
|
@ -154,29 +199,172 @@
|
|||
|
||||
@code
|
||||
{
|
||||
private List<CitySDto> _cities = new List<CitySDto>();
|
||||
private List<UniversitySDto> _universities = new List<UniversitySDto>();
|
||||
private SignUpRequestDto _signUpRequest = new SignUpRequestDto();
|
||||
private MudCarousel<object>? _carousel;
|
||||
private int _currentSignOnStep = 0;
|
||||
MudForm? confirmPhoneNumberForm;
|
||||
private MudForm? _confirmPhoneNumberForm;
|
||||
private MudForm? _confirmSignUpForm;
|
||||
private CitySDto _selectedCity;
|
||||
private UniversitySDto _selectedUni;
|
||||
private string _phoneNumber = string.Empty;
|
||||
private string _verifyCode = string.Empty;
|
||||
private bool _isProcessing = false;
|
||||
private SignUpStatus _signUpStatus;
|
||||
|
||||
private string phoneNumber = string.Empty;
|
||||
|
||||
private void ConfirmPhoneNumber()
|
||||
private async Task ConfirmPhoneNumber()
|
||||
{
|
||||
confirmPhoneNumberForm?.Validate();
|
||||
if (confirmPhoneNumberForm != null && confirmPhoneNumberForm.IsValid)
|
||||
_carousel?.MoveTo(++_currentSignOnStep);
|
||||
try
|
||||
{
|
||||
_confirmPhoneNumberForm?.Validate();
|
||||
if (_confirmPhoneNumberForm is {IsValid: true })
|
||||
{
|
||||
_isProcessing = true;
|
||||
_signUpStatus = await RestWrapper.AuthRestApi.GetVerifyCodeAsync(_phoneNumber);
|
||||
_carousel?.MoveTo(++_currentSignOnStep);
|
||||
}
|
||||
}
|
||||
catch (ApiException ex)
|
||||
{
|
||||
var exe = await ex.GetContentAsAsync<ApiResult>();
|
||||
if (exe != null)
|
||||
Snackbar.Add(exe.Message, Severity.Error);
|
||||
Snackbar.Add(ex.Content, Severity.Error);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Snackbar.Add(e.Message, Severity.Error);
|
||||
}
|
||||
finally
|
||||
{
|
||||
_isProcessing = false;
|
||||
}
|
||||
}
|
||||
private void ConfirmVerifyCode()
|
||||
private async Task ConfirmVerifyCode()
|
||||
{
|
||||
_carousel?.MoveTo(++_currentSignOnStep);
|
||||
try
|
||||
{
|
||||
_isProcessing = true;
|
||||
var rest = await RestWrapper.AuthRestApi.LoginWithVerifyCodeAsync(new LoginRequestDto { UserName = _phoneNumber, VerifyCode = _verifyCode });
|
||||
await UserUtility.SetBearerTokenAsync(rest.BearerToken);
|
||||
if (_signUpStatus == SignUpStatus.SignUpCompleted)
|
||||
NavigationManager.NavigateTo("HomePage");
|
||||
else
|
||||
_carousel?.MoveTo(++_currentSignOnStep);
|
||||
}
|
||||
catch (ApiException ex)
|
||||
{
|
||||
var exe = await ex.GetContentAsAsync<ApiResult>();
|
||||
if (exe != null)
|
||||
Snackbar.Add(exe.Message, Severity.Error);
|
||||
Snackbar.Add(ex.Content, Severity.Error);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Snackbar.Add(e.Message, Severity.Error);
|
||||
}
|
||||
finally
|
||||
{
|
||||
_isProcessing = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void PhoneNumberRollBack()
|
||||
{
|
||||
_carousel?.MoveTo(--_currentSignOnStep);
|
||||
}
|
||||
private void ConfirmSignUp()
|
||||
|
||||
private async Task ConfirmSignUp()
|
||||
{
|
||||
NavigationManager.NavigateTo("HomePage");
|
||||
try
|
||||
{
|
||||
|
||||
_confirmSignUpForm?.Validate();
|
||||
if (_confirmSignUpForm is {IsValid:true})
|
||||
{
|
||||
_isProcessing = true;
|
||||
_signUpRequest.CityId = _selectedCity.Id;
|
||||
_signUpRequest.UniversityId = _selectedUni.Id;
|
||||
|
||||
var token = await UserUtility.GetBearerTokenAsync();
|
||||
var rest = await RestWrapper.AuthRestApi.CompleteSignUpAsync(_signUpRequest, token);
|
||||
await UserUtility.SetBearerTokenAsync(rest.BearerToken);
|
||||
NavigationManager.NavigateTo("HomePage");
|
||||
}
|
||||
}
|
||||
catch (ApiException ex)
|
||||
{
|
||||
var exe = await ex.GetContentAsAsync<ApiResult>();
|
||||
if (exe != null)
|
||||
Snackbar.Add(exe.Message, Severity.Error);
|
||||
Snackbar.Add(ex.Content, Severity.Error);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Snackbar.Add(e.Message, Severity.Error);
|
||||
}
|
||||
finally
|
||||
{
|
||||
_isProcessing = false;
|
||||
}
|
||||
}
|
||||
|
||||
private async Task<IEnumerable<CitySDto>> SearchCity(string city)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (_cities.Count == 0)
|
||||
{
|
||||
var token = await UserUtility.GetBearerTokenAsync();
|
||||
_cities = await RestWrapper.CrudDtoApiRest<City, CitySDto, Guid>(Address.CityController).ReadAll(0, token);
|
||||
}
|
||||
if (city.IsNullOrEmpty())
|
||||
return _cities;
|
||||
return _cities.Where(c => c.Name.Contains(city));
|
||||
}
|
||||
catch (ApiException ex)
|
||||
{
|
||||
var exe = await ex.GetContentAsAsync<ApiResult>();
|
||||
if (exe != null)
|
||||
Snackbar.Add(exe.Message, Severity.Error);
|
||||
Snackbar.Add(ex.Content, Severity.Error);
|
||||
return _cities;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Snackbar.Add(e.Message, Severity.Error);
|
||||
return _cities;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private async Task<IEnumerable<UniversitySDto>> SearchUniversity(string uni)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (_universities.Count == 0)
|
||||
{
|
||||
var token = await UserUtility.GetBearerTokenAsync();
|
||||
_universities = await RestWrapper.CrudDtoApiRest<University, UniversitySDto, Guid>(Address.UniversityController).ReadAll(0, token);
|
||||
}
|
||||
if (uni.IsNullOrEmpty())
|
||||
return _universities;
|
||||
return _universities.Where(c => c.Name.Contains(uni));
|
||||
}
|
||||
catch (ApiException ex)
|
||||
{
|
||||
var exe = await ex.GetContentAsAsync<ApiResult>();
|
||||
if (exe != null)
|
||||
Snackbar.Add(exe.Message, Severity.Error);
|
||||
Snackbar.Add(ex.Content, Severity.Error);
|
||||
return _universities;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Snackbar.Add(e.Message, Severity.Error);
|
||||
return _universities;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,3 +1,4 @@
|
|||
@using DocuMed.Domain.Entities.MedicalHistoryTemplate
|
||||
<MudStack class="pb-20 font-iranyekan">
|
||||
<BasePartDivider Index="2" Title="تاریخچه بیماری فعلی ( PI )" />
|
||||
|
||||
|
@ -41,10 +42,5 @@
|
|||
}
|
||||
private void AddQuestion()
|
||||
{
|
||||
Questions.Add(new MedicalHistoryQuestion
|
||||
{
|
||||
Title = _questionTitle,
|
||||
Type = _questionType
|
||||
});
|
||||
}
|
||||
}
|
|
@ -1,3 +1,4 @@
|
|||
@using DocuMed.Domain.Entities.MedicalHistoryTemplate
|
||||
|
||||
<MudStack class="pb-20 font-iranyekan">
|
||||
<BasePartDivider Index="3" Title="تاریخچه بیماری قبلی ( PI )" />
|
||||
|
@ -66,11 +67,11 @@
|
|||
}
|
||||
private void AddPIQuestion()
|
||||
{
|
||||
PIQuestions.Add(new MedicalHistoryQuestion
|
||||
{
|
||||
Title = _piQuestionTitle,
|
||||
Type = _piQuestionType
|
||||
});
|
||||
// PIQuestions.Add(new MedicalHistoryQuestion
|
||||
// {
|
||||
// Title = _piQuestionTitle,
|
||||
// Type = _piQuestionType
|
||||
// });
|
||||
}
|
||||
|
||||
private void RemovePSHQuestion(MedicalHistoryQuestion question)
|
||||
|
@ -79,11 +80,11 @@
|
|||
}
|
||||
private void AddPSHQuestion()
|
||||
{
|
||||
PSHQuestions.Add(new MedicalHistoryQuestion
|
||||
{
|
||||
Title = _pshQuestionTitle,
|
||||
Type = _pshQuestionType
|
||||
});
|
||||
// PSHQuestions.Add(new MedicalHistoryQuestion
|
||||
// {
|
||||
// Title = _pshQuestionTitle,
|
||||
// Type = _pshQuestionType
|
||||
// });
|
||||
}
|
||||
|
||||
}
|
|
@ -1,3 +1,4 @@
|
|||
@using DocuMed.Domain.Entities.MedicalHistoryTemplate
|
||||
<MudStack class="pb-20 font-iranyekan">
|
||||
<BasePartDivider Index="5" Title="تاریخچه بیماری های خانوادگی ( FH )" />
|
||||
|
||||
|
@ -78,11 +79,11 @@
|
|||
}
|
||||
private void AddFamilyHistory()
|
||||
{
|
||||
FamilyHistories.Add(new MedicalHistoryQuestion
|
||||
{
|
||||
Title = _familyHistoryQuestionTitle,
|
||||
Type = _familyHistoryQuestionType
|
||||
});
|
||||
// FamilyHistories.Add(new MedicalHistoryQuestion
|
||||
// {
|
||||
// Title = _familyHistoryQuestionTitle,
|
||||
// Type = _familyHistoryQuestionType
|
||||
// });
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -27,18 +27,18 @@
|
|||
|
||||
<div class="flex flex-row">
|
||||
<div>
|
||||
<p>@item.Title</p>
|
||||
<p>@item.Question</p>
|
||||
<div class="flex flex-row">
|
||||
<MudPaper Elevation="0" Class="mx-1 mt-1 bg-gray-200 w-fit text-center rounded-full py-0.5 px-3 text-gray-800 text-xs">
|
||||
@item.System
|
||||
معده
|
||||
</MudPaper>
|
||||
@if(@item.IsSign)
|
||||
@if(true)
|
||||
{
|
||||
<MudPaper Elevation="0" Class="mx-1 mt-1 bg-gray-200 w-fit text-center rounded-full py-0.5 px-3 text-gray-800 text-xs">
|
||||
Sign
|
||||
</MudPaper>
|
||||
}
|
||||
@if (@item.IsSymptom)
|
||||
@if (true)
|
||||
{
|
||||
<MudPaper Elevation="0" Class="mx-1 mt-1 bg-gray-200 w-fit text-center rounded-full py-0.5 px-3 text-gray-800 text-xs">
|
||||
Symptom
|
||||
|
@ -87,20 +87,20 @@
|
|||
private string _reviewOfSystemSystem = string.Empty;
|
||||
private bool _reviewOfSystemIsSign;
|
||||
private bool _reviewOfSystemIsSymptom;
|
||||
public List<MedicalHistorySystemReview> ReviewOfSystems { get; set; } = new();
|
||||
private void RemoveReviewOfSystems(MedicalHistorySystemReview review)
|
||||
public List<MedicalHistoryQuestion> ReviewOfSystems { get; set; } = new();
|
||||
private void RemoveReviewOfSystems(MedicalHistoryQuestion review)
|
||||
{
|
||||
ReviewOfSystems.Remove(review);
|
||||
}
|
||||
private void AddReviewOfSystems()
|
||||
{
|
||||
ReviewOfSystems.Add(new MedicalHistorySystemReview
|
||||
{
|
||||
Title = _reviewOfSystemTitle,
|
||||
IsSign = _reviewOfSystemIsSign,
|
||||
IsSymptom = _reviewOfSystemIsSymptom,
|
||||
System = _reviewOfSystemSystem
|
||||
});
|
||||
// ReviewOfSystems.Add(new MedicalHistorySystemReview
|
||||
// {
|
||||
// Title = _reviewOfSystemTitle,
|
||||
// IsSign = _reviewOfSystemIsSign,
|
||||
// IsSymptom = _reviewOfSystemIsSymptom,
|
||||
// System = _reviewOfSystemSystem
|
||||
// });
|
||||
_reviewOfSystemTitle = string.Empty;
|
||||
}
|
||||
}
|
|
@ -10,54 +10,28 @@
|
|||
</div>
|
||||
<MudButton @onclick="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"/>
|
||||
<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)
|
||||
{
|
||||
@foreach (var item in _medicalHistoryTemplates)
|
||||
{
|
||||
<MedicalHistoryTemplateItemTemplate Clicked="MedicalHistoryTemplateClicked" MedicalHistoryTemplate="@item" />
|
||||
}
|
||||
}
|
||||
|
||||
</div>
|
||||
</MudStack>
|
||||
</BasePageUi>
|
||||
@code
|
||||
@code
|
||||
{
|
||||
private void CreateMedicalHistoryTemplateClicked() => NavigationManager.NavigateTo("MedicalHistoryTemplateActionPage");
|
||||
private void MedicalHistoryTemplateClicked() => NavigationManager.NavigateTo("MedicalHistoryTemplateActionPage");
|
||||
private List<MedicalHistoryTemplate> _medicalHistoryTemplates = new();
|
||||
private List<MedicalHistoryTemplateSDto> _medicalHistoryTemplates = new();
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
_medicalHistoryTemplates.Add(new MedicalHistoryTemplate
|
||||
{
|
||||
CC = "سردرد",
|
||||
Section = "داخلی"
|
||||
});
|
||||
_medicalHistoryTemplates.Add(new MedicalHistoryTemplate
|
||||
{
|
||||
CC = "بدن درد",
|
||||
Section = "فیزیو"
|
||||
});
|
||||
_medicalHistoryTemplates.Add(new MedicalHistoryTemplate
|
||||
{
|
||||
CC = "بی خوابی",
|
||||
Section = "داخلی"
|
||||
});
|
||||
_medicalHistoryTemplates.Add(new MedicalHistoryTemplate
|
||||
_medicalHistoryTemplates.Add(new MedicalHistoryTemplateSDto()
|
||||
{
|
||||
CC = "دردپهلو",
|
||||
Section = "داخلی"
|
||||
ChiefComplaint = "سردرد",
|
||||
});
|
||||
_medicalHistoryTemplates.Add(new MedicalHistoryTemplate
|
||||
{
|
||||
CC = "سوختگی",
|
||||
Section = "سوختگی"
|
||||
});
|
||||
_medicalHistoryTemplates.Add(new MedicalHistoryTemplate
|
||||
{
|
||||
CC = "شکستگی",
|
||||
Section = "فیزیو"
|
||||
});
|
||||
base.OnInitialized();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,14 +1,17 @@
|
|||
using DocuMed.PWA;
|
||||
using Microsoft.AspNetCore.Components.Web;
|
||||
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
|
||||
using MudBlazor.Services;
|
||||
using Toolbelt.Blazor.Extensions.DependencyInjection;
|
||||
|
||||
var builder = WebAssemblyHostBuilder.CreateDefault(args);
|
||||
builder.RootComponents.Add<App>("#app");
|
||||
builder.RootComponents.Add<HeadOutlet>("head::after");
|
||||
builder.Services.AddMudServices();
|
||||
builder.Services.AddMudServices(config =>
|
||||
{
|
||||
config.SnackbarConfiguration.VisibleStateDuration = 3500;
|
||||
config.SnackbarConfiguration.HideTransitionDuration = 200;
|
||||
config.SnackbarConfiguration.ShowTransitionDuration = 200;
|
||||
config.SnackbarConfiguration.SnackbarVariant = Variant.Filled;
|
||||
config.SnackbarConfiguration.PositionClass = Defaults.Classes.Position.BottomRight;
|
||||
});
|
||||
|
||||
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
|
||||
builder.Services.AddScoped<IRestWrapper, RestWrapper>();
|
||||
builder.Services.AddScoped<IUserUtility, UserUtility>();
|
||||
builder.Services.AddBlazoredLocalStorage();
|
||||
builder.Services.AddPWAUpdater();
|
||||
await builder.Build().RunAsync();
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
namespace DocuMed.PWA.Services.RestServices;
|
||||
|
||||
public interface IAuthRestApi
|
||||
{
|
||||
[Get("/verifycode")]
|
||||
public Task<SignUpStatus> GetVerifyCodeAsync([Query] string phoneNumber);
|
||||
|
||||
[Post("/login/code")]
|
||||
public Task<AccessToken<ApplicationUserSDto>> LoginWithVerifyCodeAsync([Body] LoginRequestDto request);
|
||||
|
||||
[Post("/signup")]
|
||||
public Task<AccessToken<ApplicationUserSDto>> CompleteSignUpAsync([Body] SignUpRequestDto request, [Header("Authorization")] string authorization);
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
namespace DocuMed.PWA.Services.RestServices;
|
||||
|
||||
public interface ICrudApiRest<T, in TKey> where T : class
|
||||
{
|
||||
[Post("")]
|
||||
Task<T> Create([Body] T payload, [Header("Authorization")] string authorization);
|
||||
|
||||
[Get("")]
|
||||
Task<List<T>> ReadAll([Query] int page,[Header("Authorization")] string authorization);
|
||||
|
||||
[Get("/{key}")]
|
||||
Task<T> ReadOne(TKey key, [Header("Authorization")] string authorization);
|
||||
|
||||
[Put("")]
|
||||
Task Update([Body] T payload, [Header("Authorization")] string authorization);
|
||||
|
||||
[Delete("/{key}")]
|
||||
Task Delete(TKey key, [Header("Authorization")] string authorization);
|
||||
|
||||
}
|
||||
public interface ICrudDtoApiRest<T, TDto, in TKey> where T : class where TDto : class
|
||||
{
|
||||
[Post("")]
|
||||
Task<T> Create([Body] T payload, [Header("Authorization")] string authorization);
|
||||
[Post("")]
|
||||
Task<T> Create([Body] TDto payload, [Header("Authorization")] string authorization);
|
||||
|
||||
[Get("")]
|
||||
Task<List<TDto>> ReadAll([Query]int page,[Header("Authorization")] string authorization);
|
||||
|
||||
[Get("/{key}")]
|
||||
Task<TDto> ReadOne(TKey key, [Header("Authorization")] string authorization);
|
||||
|
||||
[Put("")]
|
||||
Task Update([Body] T payload, [Header("Authorization")] string authorization);
|
||||
[Put("")]
|
||||
Task Update([Body] TDto payload, [Header("Authorization")] string authorization);
|
||||
|
||||
[Delete("/{key}")]
|
||||
Task Delete(TKey key, [Header("Authorization")] string authorization);
|
||||
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
namespace DocuMed.PWA.Services.RestServices;
|
||||
|
||||
public interface IRestWrapper
|
||||
{
|
||||
public ICrudApiRest<T, TKey> CrudApiRest<T, TKey>(string address) where T : class;
|
||||
public ICrudDtoApiRest<T, TDto, TKey> CrudDtoApiRest<T, TDto, TKey>(string address) where T : class where TDto : class;
|
||||
|
||||
|
||||
public IAuthRestApi AuthRestApi { get; }
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
using Newtonsoft.Json;
|
||||
|
||||
namespace DocuMed.PWA.Services.RestServices;
|
||||
|
||||
public class RestWrapper : IRestWrapper
|
||||
{
|
||||
|
||||
private static RefitSettings setting = new RefitSettings(new NewtonsoftJsonContentSerializer(new JsonSerializerSettings
|
||||
{
|
||||
Formatting = Newtonsoft.Json.Formatting.Indented,
|
||||
ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore,
|
||||
|
||||
}));
|
||||
|
||||
public ICrudApiRest<T, TKey> CrudApiRest<T, TKey>(string address) where T : class
|
||||
{
|
||||
return RestService.For<ICrudApiRest<T, TKey>>(address, setting);
|
||||
}
|
||||
public ICrudDtoApiRest<T, TDto, TKey> CrudDtoApiRest<T, TDto, TKey>(string address) where T : class where TDto : class
|
||||
{
|
||||
return RestService.For<ICrudDtoApiRest<T, TDto, TKey>>(address, setting);
|
||||
}
|
||||
public IAuthRestApi AuthRestApi => RestService.For<IAuthRestApi>(Address.AuthController, setting);
|
||||
}
|
|
@ -1,25 +1,26 @@
|
|||
@using DocuMed.Domain.Dtos.SmallDtos
|
||||
<MudCard Class="mx-3 my-1 rounded-md" Elevation="2">
|
||||
<div class="flex flex-row">
|
||||
<div class="bg-[--color-primary] rounded-r-lg w-2"></div>
|
||||
<MudStack class="grow mx-3.5 my-4">
|
||||
<div class="flex flex-row">
|
||||
<p class="font-extrabold font-iranyekan text-base my-auto text-[#37966F]">@MedicalHistory.Name</p>
|
||||
<p class="font-extrabold font-iranyekan text-base my-auto text-[#37966F]">@MedicalHistory.FullName</p>
|
||||
|
||||
<MudPaper Elevation="0"
|
||||
class="bg-[#FFDACF] text-[#D03405] rounded-full py-0.5 px-3 my-auto mr-auto text-xs font-iranyekan">
|
||||
<p>@MedicalHistory.CC در بخش @MedicalHistory.Section</p>
|
||||
<p>@MedicalHistory.ChiefComplaint در بخش @MedicalHistory.Section</p>
|
||||
</MudPaper>
|
||||
</div>
|
||||
<MudGrid Row="true" Class="items-center justify-stretch">
|
||||
|
||||
<MudItem xs="4">
|
||||
<MudPaper Elevation="0" Class="bg-gray-200 text-center rounded-full py-0.5 px-3 text-gray-700 text-xs">
|
||||
@MedicalHistory.Aag ساله
|
||||
@MedicalHistory.Age ساله
|
||||
</MudPaper>
|
||||
</MudItem>
|
||||
<MudItem xs="4">
|
||||
<MudPaper Elevation="0" Class="bg-gray-200 text-center rounded-full py-0.5 px-3 text-gray-700 text-xs">
|
||||
@MedicalHistory.Gender.ToString()
|
||||
مرد
|
||||
</MudPaper>
|
||||
</MudItem>
|
||||
<MudItem xs="4">
|
||||
|
@ -38,6 +39,6 @@
|
|||
@code {
|
||||
|
||||
[Parameter]
|
||||
public MedicalHistory MedicalHistory { get; set; } = new();
|
||||
public MedicalHistorySDto MedicalHistory { get; set; } = new();
|
||||
|
||||
}
|
|
@ -2,10 +2,10 @@
|
|||
|
||||
<div class="flex flex-row">
|
||||
<div>
|
||||
<p>@Question.Title</p>
|
||||
<p>@Question.Question</p>
|
||||
<MudPaper Elevation="0"
|
||||
Class="mt-1 bg-gray-200 w-fit text-center rounded-full py-0.5 px-3 text-gray-800 text-xs">
|
||||
@Question.Type.ToString();
|
||||
@Question.QuestionType.ToDisplay()
|
||||
</MudPaper>
|
||||
</div>
|
||||
<MudIconButton @onclick="async ()=> await QuestionRemoved.InvokeAsync(Question)" class="mr-auto" Color="Color.Error" Icon="@Icons.Material.Filled.Close" />
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
<MudCard @onclick="(async () => { await Clicked.InvokeAsync(MedicalHistoryTemplate); })" Elevation="2" class="rounded-lg">
|
||||
<MudCardContent>
|
||||
<p class="text-center font-extrabold mt-1 text-gray-600 text-lg">@MedicalHistoryTemplate.CC</p>
|
||||
<p class="text-center font-extrabold mt-1 text-gray-600 text-lg">@MedicalHistoryTemplate.ChiefComplaint</p>
|
||||
|
||||
<MudPaper Elevation="0"
|
||||
class="bg-[#FFDACF] text-center text-[#D03405] rounded-full py-0.5 mt-3 mr-auto text-xs font-iranyekan">
|
||||
<p>بخش @MedicalHistoryTemplate.Section</p>
|
||||
<p>بخش @MedicalHistoryTemplate.ChiefComplaint</p>
|
||||
</MudPaper>
|
||||
</MudCardContent>
|
||||
</MudCard>
|
||||
|
@ -12,8 +12,8 @@
|
|||
@code {
|
||||
|
||||
[Parameter]
|
||||
public MedicalHistoryTemplate MedicalHistoryTemplate { get; set; } = new();
|
||||
public MedicalHistoryTemplateSDto MedicalHistoryTemplate { get; set; } = new();
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<MedicalHistoryTemplate> Clicked { get; set; }
|
||||
public EventCallback<MedicalHistoryTemplateSDto> Clicked { get; set; }
|
||||
}
|
||||
|
|
|
@ -2,23 +2,34 @@
|
|||
Color="@Color"
|
||||
@onclick="OnClickCallback"
|
||||
@attributes="CapturedAttributes"
|
||||
Disabled="IsProcessing"
|
||||
DisableElevation="true"
|
||||
class="rounded-md">
|
||||
<div class="flex flex-row w-full">
|
||||
@if (Variant == Variant.Filled)
|
||||
{
|
||||
<div class="-mr-2 -ml-6 w-10 h-10 items-center bg-[#000000] bg-opacity-20 rounded-md">
|
||||
<MudIcon Icon="@Icon" class="w-5 h-5 mt-2.5"></MudIcon>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="-mr-2 -ml-6 w-12 h-12 items-center rounded-md">
|
||||
<MudIcon Icon="@Icon" class="w-7 h-7 mt-2"></MudIcon>
|
||||
</div>
|
||||
}
|
||||
<p class="my-auto mx-auto font-extrabold">@Content</p>
|
||||
</div>
|
||||
@if (IsProcessing)
|
||||
{
|
||||
<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-extrabold my-1 mx-auto text-lg">منتظر بمانید</p>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="flex flex-row w-full">
|
||||
@if (Variant == Variant.Filled)
|
||||
{
|
||||
<div class="-mr-2 -ml-6 w-10 h-10 items-center bg-[#000000] bg-opacity-20 rounded-md">
|
||||
<MudIcon Icon="@Icon" class="w-5 h-5 mt-2.5"></MudIcon>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="-mr-2 -ml-6 w-12 h-12 items-center rounded-md">
|
||||
<MudIcon Icon="@Icon" class="w-7 h-7 mt-2"></MudIcon>
|
||||
</div>
|
||||
}
|
||||
<p class="my-auto mx-auto font-extrabold">@Content</p>
|
||||
</div>
|
||||
}
|
||||
</MudButton>
|
||||
@code
|
||||
{
|
||||
|
@ -33,6 +44,9 @@
|
|||
[Parameter]
|
||||
public string Icon { get; set; } = string.Empty;
|
||||
|
||||
[Parameter]
|
||||
public bool IsProcessing { get; set; } = false;
|
||||
|
||||
[Parameter]
|
||||
public EventCallback OnClickCallback { get; set; }
|
||||
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
namespace DocuMed.PWA.Utilities;
|
||||
|
||||
public interface IUserUtility
|
||||
{
|
||||
public Task<string> GetBearerTokenAsync();
|
||||
public Task SetBearerTokenAsync(string token);
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
using DocuMed.Common.Models.Claims;
|
||||
|
||||
namespace DocuMed.PWA.Utilities;
|
||||
|
||||
public class UserUtility : IUserUtility
|
||||
{
|
||||
private readonly ILocalStorageService _localStorageService;
|
||||
|
||||
public UserUtility(ILocalStorageService localStorageService)
|
||||
{
|
||||
_localStorageService = localStorageService;
|
||||
}
|
||||
|
||||
public async Task<string> GetBearerTokenAsync() => await _localStorageService.GetItemAsStringAsync(LocalStorageKeys.Token);
|
||||
public async Task SetBearerTokenAsync(string token) => await _localStorageService.SetItemAsStringAsync(LocalStorageKeys.Token,token);
|
||||
|
||||
//public AccessToken<ApplicationUserSDto>? AccessToken { get; set; }
|
||||
//public List<string> UserClaims => AccessToken == null ? new List<string>() : AccessToken.Permissions;
|
||||
//public bool HasPermissionTo(string permission) => UserClaims.Any(c => c == permission);
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
namespace DocuMed.PWA.Utilities;
|
||||
|
||||
public class UtilityWrapper
|
||||
{
|
||||
private static UtilityWrapper? _instance;
|
||||
public static UtilityWrapper Instance
|
||||
{
|
||||
get { return _instance ??= new UtilityWrapper(); }
|
||||
}
|
||||
|
||||
}
|
|
@ -563,6 +563,9 @@ video {
|
|||
.-mb-8 {
|
||||
margin-bottom: -2rem;
|
||||
}
|
||||
.-ml-4 {
|
||||
margin-left: -1rem;
|
||||
}
|
||||
.-ml-6 {
|
||||
margin-left: -1.5rem;
|
||||
}
|
||||
|
|
|
@ -632,6 +632,10 @@ video {
|
|||
margin-bottom: -2rem;
|
||||
}
|
||||
|
||||
.-ml-4 {
|
||||
margin-left: -1rem;
|
||||
}
|
||||
|
||||
.-ml-6 {
|
||||
margin-left: -1.5rem;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,722 @@
|
|||
// <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
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,489 @@
|
|||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace DocuMed.Repository.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class init : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.EnsureSchema(
|
||||
name: "public");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Cities",
|
||||
schema: "public",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
Name = 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_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",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
Description = table.Column<string>(type: "text", nullable: false),
|
||||
EnglishName = table.Column<string>(type: "text", nullable: false),
|
||||
PersianName = table.Column<string>(type: "text", nullable: false),
|
||||
Name = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
|
||||
NormalizedName = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
|
||||
ConcurrencyStamp = table.Column<string>(type: "text", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Roles", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Universities",
|
||||
schema: "public",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
Name = table.Column<string>(type: "text", nullable: false),
|
||||
Address = table.Column<string>(type: "text", nullable: false),
|
||||
CityId = 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_Universities", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Universities_Cities_CityId",
|
||||
column: x => x.CityId,
|
||||
principalSchema: "public",
|
||||
principalTable: "Cities",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "MedicalHistoryAnswers",
|
||||
schema: "public",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
Answer = table.Column<string>(type: "text", nullable: false),
|
||||
Question = table.Column<string>(type: "text", nullable: false),
|
||||
Part = table.Column<int>(type: "integer", nullable: false),
|
||||
QuestionType = table.Column<int>(type: "integer", nullable: false),
|
||||
MedicalHistoryId = 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_MedicalHistoryAnswers", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_MedicalHistoryAnswers_MedicalHistories_MedicalHistoryId",
|
||||
column: x => x.MedicalHistoryId,
|
||||
principalSchema: "public",
|
||||
principalTable: "MedicalHistories",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "MedicalHistoryQuestions",
|
||||
schema: "public",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
Question = table.Column<string>(type: "text", nullable: false),
|
||||
Part = table.Column<int>(type: "integer", nullable: false),
|
||||
QuestionType = table.Column<int>(type: "integer", nullable: false),
|
||||
MedicalHistoryTemplateId = 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_MedicalHistoryQuestions", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_MedicalHistoryQuestions_MedicalHistoryTemplates_MedicalHist~",
|
||||
column: x => x.MedicalHistoryTemplateId,
|
||||
principalSchema: "public",
|
||||
principalTable: "MedicalHistoryTemplates",
|
||||
principalColumn: "Id",
|
||||
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",
|
||||
table: "Claims",
|
||||
column: "UserId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Logins_UserId",
|
||||
schema: "public",
|
||||
table: "Logins",
|
||||
column: "UserId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_MedicalHistoryAnswers_MedicalHistoryId",
|
||||
schema: "public",
|
||||
table: "MedicalHistoryAnswers",
|
||||
column: "MedicalHistoryId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_MedicalHistoryQuestions_MedicalHistoryTemplateId",
|
||||
schema: "public",
|
||||
table: "MedicalHistoryQuestions",
|
||||
column: "MedicalHistoryTemplateId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_RoleClaims_RoleId",
|
||||
schema: "public",
|
||||
table: "RoleClaims",
|
||||
column: "RoleId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "RoleNameIndex",
|
||||
schema: "public",
|
||||
table: "Roles",
|
||||
column: "NormalizedName",
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Universities_CityId",
|
||||
schema: "public",
|
||||
table: "Universities",
|
||||
column: "CityId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_UserRoles_RoleId",
|
||||
schema: "public",
|
||||
table: "UserRoles",
|
||||
column: "RoleId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "EmailIndex",
|
||||
schema: "public",
|
||||
table: "Users",
|
||||
column: "NormalizedEmail");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Users_UniversityId",
|
||||
schema: "public",
|
||||
table: "Users",
|
||||
column: "UniversityId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "UserNameIndex",
|
||||
schema: "public",
|
||||
table: "Users",
|
||||
column: "NormalizedUserName",
|
||||
unique: true);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "Claims",
|
||||
schema: "public");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Logins",
|
||||
schema: "public");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "MedicalHistoryAnswers",
|
||||
schema: "public");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "MedicalHistoryQuestions",
|
||||
schema: "public");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "RoleClaims",
|
||||
schema: "public");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Tokens",
|
||||
schema: "public");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "UserRoles",
|
||||
schema: "public");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "MedicalHistories",
|
||||
schema: "public");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "MedicalHistoryTemplates",
|
||||
schema: "public");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Roles",
|
||||
schema: "public");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Users",
|
||||
schema: "public");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Universities",
|
||||
schema: "public");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "Cities",
|
||||
schema: "public");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,719 @@
|
|||
// <auto-generated />
|
||||
using System;
|
||||
using DocuMed.Repository.Models;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace DocuMed.Repository.Migrations
|
||||
{
|
||||
[DbContext(typeof(ApplicationContext))]
|
||||
partial class ApplicationContextModelSnapshot : ModelSnapshot
|
||||
{
|
||||
protected override void BuildModel(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
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue