Compare commits
4 Commits
b27d2c56da
...
cc8aa32447
Author | SHA1 | Date |
---|---|---|
|
cc8aa32447 | |
|
24b92acd4b | |
|
867b7be19d | |
|
378e4c19c0 |
|
@ -2,7 +2,7 @@
|
||||||
"ConnectionStrings": {
|
"ConnectionStrings": {
|
||||||
"PostgresServer": "User ID=postgres;Password=root;Host=localhost;Port=5432;Database=iGarsonDB;",
|
"PostgresServer": "User ID=postgres;Password=root;Host=localhost;Port=5432;Database=iGarsonDB;",
|
||||||
"PostgresCompose": "Host=postgres_image;Username=brizcouser;Password=brizco;Database=BrizCoDB;",
|
"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": {
|
"Logging": {
|
||||||
"LogLevel": {
|
"LogLevel": {
|
||||||
|
@ -14,7 +14,7 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"SiteSettings": {
|
"SiteSettings": {
|
||||||
"BaseUrl": "http://localhost:32769",
|
"BaseUrl": "http://localhost:32770",
|
||||||
"UserSetting": {
|
"UserSetting": {
|
||||||
"Username": "root",
|
"Username": "root",
|
||||||
"Email": "info@documed.ir",
|
"Email": "info@documed.ir",
|
||||||
|
|
|
@ -0,0 +1,64 @@
|
||||||
|
namespace DocuMed.Api.Controllers;
|
||||||
|
public class CityController : ICarterModule
|
||||||
|
{
|
||||||
|
|
||||||
|
public virtual void AddRoutes(IEndpointRouteBuilder app)
|
||||||
|
{
|
||||||
|
var group = app.NewVersionedApi("City").MapGroup($"api/city");
|
||||||
|
|
||||||
|
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,64 @@
|
||||||
|
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||||
|
|
||||||
|
namespace DocuMed.Api.Controllers;
|
||||||
|
|
||||||
|
public class MedicalHistoryTemplateController : ICarterModule
|
||||||
|
{
|
||||||
|
public virtual void AddRoutes(IEndpointRouteBuilder app)
|
||||||
|
{
|
||||||
|
var group = app.NewVersionedApi("MedicalHistoryTemplate").MapGroup($"api/medicalhistory/template")
|
||||||
|
.RequireAuthorization(builder => builder.AddAuthenticationSchemes("Bearer").RequireAuthenticatedUser());
|
||||||
|
|
||||||
|
group.MapGet("", GetAllAsync)
|
||||||
|
.WithDisplayName("GetAll")
|
||||||
|
.HasApiVersion(1.0);
|
||||||
|
|
||||||
|
group.MapGet("{id}", GetAsync)
|
||||||
|
.WithDisplayName("GetOne")
|
||||||
|
.HasApiVersion(1.0);
|
||||||
|
|
||||||
|
group.MapPost("", Post)
|
||||||
|
.HasApiVersion(1.0);
|
||||||
|
|
||||||
|
group.MapPut("", Put)
|
||||||
|
.HasApiVersion(1.0);
|
||||||
|
|
||||||
|
group.MapDelete("", Delete)
|
||||||
|
.HasApiVersion(1.0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// GET:Get All Entity
|
||||||
|
public virtual async Task<IResult> GetAllAsync([FromQuery] int page, IMedicalHistoryTemplateRepository repository, CancellationToken cancellationToken)
|
||||||
|
{
|
||||||
|
return TypedResults.Ok(await repository.GetMedicalHistoryTemplatesAsync(page,cancellationToken));
|
||||||
|
}
|
||||||
|
|
||||||
|
// GET:Get An Entity By Id
|
||||||
|
public async Task<IResult> GetAsync(Guid id, IMedicalHistoryTemplateRepository repository, CancellationToken cancellationToken)
|
||||||
|
{
|
||||||
|
|
||||||
|
return TypedResults.Ok(await repository.GetMedicalHistoryTemplateAsync(id, cancellationToken));
|
||||||
|
}
|
||||||
|
|
||||||
|
// POST:Add New Entity
|
||||||
|
public virtual async Task<IResult> Post([FromBody] MedicalHistoryTemplateLDto dto, IMedicalHistoryTemplateService service, ICurrentUserService currentUserService, CancellationToken cancellationToken)
|
||||||
|
{
|
||||||
|
return TypedResults.Ok(await service.AddAsync(dto,cancellationToken));
|
||||||
|
}
|
||||||
|
|
||||||
|
// PUT:Update Entity
|
||||||
|
public virtual async Task<IResult> Put([FromBody] MedicalHistoryTemplateLDto dto, IMedicalHistoryTemplateService service,ICurrentUserService currentUserService, CancellationToken cancellationToken)
|
||||||
|
{
|
||||||
|
return TypedResults.Ok(await service.EditAsync(dto, cancellationToken));
|
||||||
|
}
|
||||||
|
|
||||||
|
// DELETE:Delete Entity
|
||||||
|
public virtual async Task<IResult> Delete(int id, IRepositoryWrapper repositoryWrapper, CancellationToken cancellationToken)
|
||||||
|
{
|
||||||
|
var ent = await repositoryWrapper.SetRepository<MedicalHistoryTemplate>().GetByIdAsync(cancellationToken, id);
|
||||||
|
repositoryWrapper.SetRepository<MedicalHistoryTemplate>().Delete(ent);
|
||||||
|
await repositoryWrapper.SaveChangesAsync(cancellationToken);
|
||||||
|
return TypedResults.Ok();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,80 @@
|
||||||
|
using Microsoft.IdentityModel.Tokens;
|
||||||
|
|
||||||
|
namespace DocuMed.Api.Controllers;
|
||||||
|
public class SectionController : ICarterModule
|
||||||
|
{
|
||||||
|
public virtual void AddRoutes(IEndpointRouteBuilder app)
|
||||||
|
{
|
||||||
|
var group = app.NewVersionedApi("Section").MapGroup($"api/section");
|
||||||
|
|
||||||
|
group.MapGet("", GetAllAsync)
|
||||||
|
.WithDisplayName("GetAll")
|
||||||
|
.HasApiVersion(1.0);
|
||||||
|
|
||||||
|
group.MapGet("University/{universityId}", GetAllByUniversityAsync)
|
||||||
|
.WithDisplayName("GetAllByUniversityId")
|
||||||
|
.HasApiVersion(1.0);
|
||||||
|
|
||||||
|
group.MapGet("{id}", GetAsync)
|
||||||
|
.WithDisplayName("GetOne")
|
||||||
|
.HasApiVersion(1.0);
|
||||||
|
|
||||||
|
group.MapPost("", Post)
|
||||||
|
.HasApiVersion(1.0);
|
||||||
|
|
||||||
|
group.MapPut("", Put)
|
||||||
|
.HasApiVersion(1.0);
|
||||||
|
|
||||||
|
group.MapDelete("", Delete)
|
||||||
|
.HasApiVersion(1.0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// GET:Get All Entity
|
||||||
|
public virtual async Task<IResult> GetAllAsync([FromQuery] int page, IRepositoryWrapper repositoryWrapper, ICurrentUserService currentUserService, CancellationToken cancellationToken)
|
||||||
|
{
|
||||||
|
return TypedResults.Ok(await repositoryWrapper.SetRepository<Section>().TableNoTracking
|
||||||
|
.Select(SectionMapper.ProjectToSDto).ToListAsync(cancellationToken));
|
||||||
|
}
|
||||||
|
|
||||||
|
// GET:Get All Entity
|
||||||
|
public virtual async Task<IResult> GetAllByUniversityAsync(Guid universityId, IRepositoryWrapper repositoryWrapper, ICurrentUserService currentUserService, CancellationToken cancellationToken)
|
||||||
|
{
|
||||||
|
return TypedResults.Ok(await repositoryWrapper.SetRepository<Section>().TableNoTracking
|
||||||
|
.Where(s => s.UniversityId == universityId)
|
||||||
|
.Select(SectionMapper.ProjectToSDto).ToListAsync(cancellationToken));
|
||||||
|
}
|
||||||
|
|
||||||
|
// GET:Get An Entity By Id
|
||||||
|
public async Task<IResult> GetAsync(Guid id, IRepositoryWrapper repositoryWrapper, CancellationToken cancellationToken)
|
||||||
|
=> TypedResults.Ok(await repositoryWrapper.SetRepository<Section>().GetByIdAsync(cancellationToken, id));
|
||||||
|
|
||||||
|
|
||||||
|
// POST:Add New Entity
|
||||||
|
public virtual async Task<IResult> Post([FromBody] SectionSDto dto, IRepositoryWrapper repositoryWrapper, CancellationToken cancellationToken)
|
||||||
|
{
|
||||||
|
var ent = Section.Create(dto.Name,dto.Detail,dto.UniversityId);
|
||||||
|
repositoryWrapper.SetRepository<Section>().Add(ent);
|
||||||
|
await repositoryWrapper.SaveChangesAsync(cancellationToken);
|
||||||
|
return TypedResults.Ok(ent);
|
||||||
|
}
|
||||||
|
|
||||||
|
// PUT:Update Entity
|
||||||
|
public virtual async Task<IResult> Put([FromBody] SectionSDto dto, IRepositoryWrapper repositoryWrapper, CancellationToken cancellationToken)
|
||||||
|
{
|
||||||
|
var ent = Section.Create(dto.Name,dto.Detail, dto.UniversityId);
|
||||||
|
ent.Id = dto.Id;
|
||||||
|
repositoryWrapper.SetRepository<Section>().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<Section>().GetByIdAsync(cancellationToken, id);
|
||||||
|
repositoryWrapper.SetRepository<Section>().Delete(ent);
|
||||||
|
await repositoryWrapper.SaveChangesAsync(cancellationToken);
|
||||||
|
return TypedResults.Ok();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,66 @@
|
||||||
|
namespace DocuMed.Api.Controllers;
|
||||||
|
|
||||||
|
public class UniversityController : ICarterModule
|
||||||
|
{
|
||||||
|
|
||||||
|
public virtual void AddRoutes(IEndpointRouteBuilder app)
|
||||||
|
{
|
||||||
|
var group = app.NewVersionedApi("University")
|
||||||
|
.MapGroup($"api/university");
|
||||||
|
|
||||||
|
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();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,23 @@
|
||||||
|
namespace DocuMed.Api.Controllers;
|
||||||
|
|
||||||
|
public class UserController : ICarterModule
|
||||||
|
{
|
||||||
|
public void AddRoutes(IEndpointRouteBuilder app)
|
||||||
|
{
|
||||||
|
|
||||||
|
var group = app.NewVersionedApi("User")
|
||||||
|
.MapGroup($"api/user")
|
||||||
|
.RequireAuthorization(builder => builder.AddAuthenticationSchemes("Bearer").RequireAuthenticatedUser());
|
||||||
|
|
||||||
|
|
||||||
|
group.MapPut("", EditUserAsync)
|
||||||
|
.WithDisplayName("EditUser")
|
||||||
|
.HasApiVersion(1.0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual async Task<IResult> EditUserAsync([FromBody]UserActionRequestDto request,IUserService userService,CancellationToken cancellationToken)
|
||||||
|
{
|
||||||
|
await userService.EditUserAsync(request, cancellationToken);
|
||||||
|
return TypedResults.Ok();
|
||||||
|
}
|
||||||
|
}
|
|
@ -57,6 +57,7 @@
|
||||||
<Using Include="Autofac" />
|
<Using Include="Autofac" />
|
||||||
<Using Include="Autofac.Extensions.DependencyInjection" />
|
<Using Include="Autofac.Extensions.DependencyInjection" />
|
||||||
<Using Include="Carter" />
|
<Using Include="Carter" />
|
||||||
|
<Using Include="DocuMed.Api.WebFramework.Bases" />
|
||||||
<Using Include="DocuMed.Api.WebFramework.Configurations" />
|
<Using Include="DocuMed.Api.WebFramework.Configurations" />
|
||||||
<Using Include="DocuMed.Api.WebFramework.Swagger" />
|
<Using Include="DocuMed.Api.WebFramework.Swagger" />
|
||||||
<Using Include="DocuMed.Common.Extensions" />
|
<Using Include="DocuMed.Common.Extensions" />
|
||||||
|
@ -67,10 +68,16 @@
|
||||||
<Using Include="DocuMed.Common.Models.Mapper" />
|
<Using Include="DocuMed.Common.Models.Mapper" />
|
||||||
<Using Include="DocuMed.Core" />
|
<Using Include="DocuMed.Core" />
|
||||||
<Using Include="DocuMed.Core.CoreServices.Abstracts" />
|
<Using Include="DocuMed.Core.CoreServices.Abstracts" />
|
||||||
|
<Using Include="DocuMed.Core.EntityServices.Abstracts" />
|
||||||
<Using Include="DocuMed.Core.Models.Api" />
|
<Using Include="DocuMed.Core.Models.Api" />
|
||||||
<Using Include="DocuMed.Domain" />
|
<Using Include="DocuMed.Domain" />
|
||||||
|
<Using Include="DocuMed.Domain.Dtos.LargDtos" />
|
||||||
<Using Include="DocuMed.Domain.Dtos.RequestDtos" />
|
<Using Include="DocuMed.Domain.Dtos.RequestDtos" />
|
||||||
|
<Using Include="DocuMed.Domain.Dtos.SmallDtos" />
|
||||||
|
<Using Include="DocuMed.Domain.Entities.City" />
|
||||||
|
<Using Include="DocuMed.Domain.Entities.MedicalHistoryTemplate" />
|
||||||
<Using Include="DocuMed.Domain.Entities.User" />
|
<Using Include="DocuMed.Domain.Entities.User" />
|
||||||
|
<Using Include="DocuMed.Domain.Mappers" />
|
||||||
<Using Include="DocuMed.Domain.Models.Settings" />
|
<Using Include="DocuMed.Domain.Models.Settings" />
|
||||||
<Using Include="DocuMed.Infrastructure" />
|
<Using Include="DocuMed.Infrastructure" />
|
||||||
<Using Include="DocuMed.Infrastructure.Models" />
|
<Using Include="DocuMed.Infrastructure.Models" />
|
||||||
|
@ -79,10 +86,12 @@
|
||||||
<Using Include="DocuMed.Repository.Extensions" />
|
<Using Include="DocuMed.Repository.Extensions" />
|
||||||
<Using Include="DocuMed.Repository.Models" />
|
<Using Include="DocuMed.Repository.Models" />
|
||||||
<Using Include="DocuMed.Repository.Repositories.Base.Contracts" />
|
<Using Include="DocuMed.Repository.Repositories.Base.Contracts" />
|
||||||
|
<Using Include="DocuMed.Repository.Repositories.Entities.Abstracts" />
|
||||||
<Using Include="Microsoft.AspNetCore.Authentication.JwtBearer" />
|
<Using Include="Microsoft.AspNetCore.Authentication.JwtBearer" />
|
||||||
<Using Include="Microsoft.AspNetCore.Identity" />
|
<Using Include="Microsoft.AspNetCore.Identity" />
|
||||||
<Using Include="Microsoft.AspNetCore.Mvc" />
|
<Using Include="Microsoft.AspNetCore.Mvc" />
|
||||||
<Using Include="Microsoft.AspNetCore.Mvc.Filters" />
|
<Using Include="Microsoft.AspNetCore.Mvc.Filters" />
|
||||||
|
<Using Include="Microsoft.EntityFrameworkCore" />
|
||||||
<Using Include="Microsoft.Extensions.Options" />
|
<Using Include="Microsoft.Extensions.Options" />
|
||||||
<Using Include="Serilog" />
|
<Using Include="Serilog" />
|
||||||
<Using Include="Serilog.Events" />
|
<Using Include="Serilog.Events" />
|
||||||
|
|
|
@ -25,7 +25,8 @@
|
||||||
"environmentVariables": {
|
"environmentVariables": {
|
||||||
"ASPNETCORE_URLS": "http://+:80"
|
"ASPNETCORE_URLS": "http://+:80"
|
||||||
},
|
},
|
||||||
"publishAllPorts": true
|
"publishAllPorts": true,
|
||||||
|
"DockerfileRunArguments": " --network=mother -p 32770:80"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"$schema": "https://json.schemastore.org/launchsettings.json",
|
"$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]
|
[ApiController]
|
||||||
//[AllowAnonymous]
|
//[AllowAnonymous]
|
||||||
[ApiResultFilter]
|
[ApiResultFilter]
|
||||||
|
|
|
@ -65,7 +65,7 @@ public static class ServiceExtensions
|
||||||
serviceCollection.AddDbContextFactory<ApplicationContext>(options =>
|
serviceCollection.AddDbContextFactory<ApplicationContext>(options =>
|
||||||
{
|
{
|
||||||
options.UseQueryTrackingBehavior(QueryTrackingBehavior.NoTracking);
|
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);
|
.UseProjectAssembly(typeof(ApplicationUser).Assembly);
|
||||||
//options.EnableServiceProviderCaching(true);
|
//options.EnableServiceProviderCaching(true);
|
||||||
}).BuildServiceProvider();
|
}).BuildServiceProvider();
|
||||||
|
|
|
@ -46,6 +46,6 @@ namespace DocuMed.Common.Models.Api
|
||||||
public TUser User { get; set; }
|
public TUser User { get; set; }
|
||||||
|
|
||||||
public string BearerToken => $"Bearer {access_token}";
|
public string BearerToken => $"Bearer {access_token}";
|
||||||
public List<string> Permissions { get; set; }
|
public List<string> Permissions { get; set; } = new();
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,16 +1,10 @@
|
||||||
using DocuMed.Core.BaseServices.Abstracts;
|
using DocuMed.Domain.Models.Settings;
|
||||||
using DocuMed.Domain.Models.Settings;
|
|
||||||
using Mapster;
|
|
||||||
using Microsoft.AspNetCore.Identity;
|
|
||||||
using Microsoft.Extensions.Options;
|
using Microsoft.Extensions.Options;
|
||||||
using Microsoft.IdentityModel.Tokens;
|
|
||||||
using System.IdentityModel.Tokens.Jwt;
|
using System.IdentityModel.Tokens.Jwt;
|
||||||
using System.Security.Claims;
|
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace DocuMed.Core.BaseServices;
|
namespace DocuMed.Core.BaseServices;
|
||||||
|
|
||||||
|
|
||||||
public class JwtService : IJwtService
|
public class JwtService : IJwtService
|
||||||
{
|
{
|
||||||
private readonly SignInManager<ApplicationUser> _signInManager;
|
private readonly SignInManager<ApplicationUser> _signInManager;
|
||||||
|
@ -95,6 +89,8 @@ public class JwtService : IJwtService
|
||||||
claims.Add(new Claim(ClaimTypes.NameIdentifier, baseUser.Id.ToString()));
|
claims.Add(new Claim(ClaimTypes.NameIdentifier, baseUser.Id.ToString()));
|
||||||
if (baseUser.Email != null)
|
if (baseUser.Email != null)
|
||||||
claims.Add(new Claim(ClaimTypes.Email, baseUser.Email));
|
claims.Add(new Claim(ClaimTypes.Email, baseUser.Email));
|
||||||
|
if(baseUser.UniversityId != null)
|
||||||
|
claims.Add(new Claim("UniversityId",baseUser.UniversityId.ToString() ?? string.Empty ));
|
||||||
claims.Add(new Claim(ClaimTypes.Gender, baseUser.Gender == 0 ? "Female" : "Mail"));
|
claims.Add(new Claim(ClaimTypes.Gender, baseUser.Gender == 0 ? "Female" : "Mail"));
|
||||||
return claims;
|
return claims;
|
||||||
|
|
||||||
|
@ -110,6 +106,8 @@ public class JwtService : IJwtService
|
||||||
claims.Add(new Claim(ClaimTypes.Role, applicationRole.EnglishName));
|
claims.Add(new Claim(ClaimTypes.Role, applicationRole.EnglishName));
|
||||||
if (baseUser.Email != null)
|
if (baseUser.Email != null)
|
||||||
claims.Add(new Claim(ClaimTypes.Email, baseUser.Email));
|
claims.Add(new Claim(ClaimTypes.Email, baseUser.Email));
|
||||||
|
if (baseUser.UniversityId != null)
|
||||||
|
claims.Add(new Claim("UniversityId", baseUser.UniversityId.ToString() ?? string.Empty));
|
||||||
claims.AddRange(roleClaims);
|
claims.AddRange(roleClaims);
|
||||||
claims.Add(new Claim("JwtID", jwtId));
|
claims.Add(new Claim("JwtID", jwtId));
|
||||||
claims.Add(new Claim(ClaimTypes.Gender, baseUser.Gender == 0 ? "Female" : "Mail"));
|
claims.Add(new Claim(ClaimTypes.Gender, baseUser.Gender == 0 ? "Female" : "Mail"));
|
||||||
|
|
|
@ -69,7 +69,7 @@ public class AccountService : IAccountService
|
||||||
user = await _userService.CreateUserAsync(phoneNumber);
|
user = await _userService.CreateUserAsync(phoneNumber);
|
||||||
|
|
||||||
var token = await _userManager.GenerateTwoFactorTokenAsync(user, "Phone");
|
var token = await _userManager.GenerateTwoFactorTokenAsync(user, "Phone");
|
||||||
await _smsService.SendVerifyCodeAsync(newPhoneNumber, token);
|
//await _smsService.SendVerifyCodeAsync(newPhoneNumber, token);
|
||||||
return user.SignUpStatus;
|
return user.SignUpStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,6 @@
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Folder Include="BaseServices\Abstracts\" />
|
<Folder Include="BaseServices\Abstracts\" />
|
||||||
<Folder Include="CoreServices\Abstracts\" />
|
<Folder Include="CoreServices\Abstracts\" />
|
||||||
<Folder Include="EntityServices\Abstracts\" />
|
|
||||||
<Folder Include="Models\Api\" />
|
<Folder Include="Models\Api\" />
|
||||||
<Folder Include="Abstracts\" />
|
<Folder Include="Abstracts\" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
@ -37,6 +36,7 @@
|
||||||
<Using Include="DocuMed.Core.BaseServices.Abstracts" />
|
<Using Include="DocuMed.Core.BaseServices.Abstracts" />
|
||||||
<Using Include="DocuMed.Core.CoreServices.Abstracts" />
|
<Using Include="DocuMed.Core.CoreServices.Abstracts" />
|
||||||
<Using Include="DocuMed.Core.EntityServices.Abstracts" />
|
<Using Include="DocuMed.Core.EntityServices.Abstracts" />
|
||||||
|
<Using Include="DocuMed.Domain.Dtos.LargDtos" />
|
||||||
<Using Include="DocuMed.Domain.Dtos.RequestDtos" />
|
<Using Include="DocuMed.Domain.Dtos.RequestDtos" />
|
||||||
<Using Include="DocuMed.Domain.Dtos.SmallDtos" />
|
<Using Include="DocuMed.Domain.Dtos.SmallDtos" />
|
||||||
<Using Include="DocuMed.Domain.Entities.User" />
|
<Using Include="DocuMed.Domain.Entities.User" />
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
namespace DocuMed.Core.EntityServices.Abstracts;
|
||||||
|
|
||||||
|
public interface IMedicalHistoryTemplateService:IScopedDependency
|
||||||
|
{
|
||||||
|
public Task<bool> EditAsync(MedicalHistoryTemplateLDto template, CancellationToken cancellationToken);
|
||||||
|
public Task<bool> AddAsync(MedicalHistoryTemplateLDto template, CancellationToken cancellationToken);
|
||||||
|
}
|
|
@ -0,0 +1,61 @@
|
||||||
|
using DocuMed.Domain.Entities.MedicalHistoryTemplate;
|
||||||
|
using DocuMed.Repository.Repositories.Entities;
|
||||||
|
using DocuMed.Repository.Repositories.Entities.Abstracts;
|
||||||
|
using System.Threading;
|
||||||
|
|
||||||
|
namespace DocuMed.Core.EntityServices;
|
||||||
|
|
||||||
|
public class MedicalHistoryTemplateService : IMedicalHistoryTemplateService
|
||||||
|
{
|
||||||
|
private readonly IRepositoryWrapper _repositoryWrapper;
|
||||||
|
private readonly ICurrentUserService _currentUserService;
|
||||||
|
private readonly IMedicalHistoryTemplateRepository _medicalHistoryTemplateRepository;
|
||||||
|
|
||||||
|
public MedicalHistoryTemplateService(IRepositoryWrapper repositoryWrapper,ICurrentUserService currentUserService,IMedicalHistoryTemplateRepository medicalHistoryTemplateRepository)
|
||||||
|
{
|
||||||
|
_repositoryWrapper = repositoryWrapper;
|
||||||
|
_currentUserService = currentUserService;
|
||||||
|
_medicalHistoryTemplateRepository = medicalHistoryTemplateRepository;
|
||||||
|
}
|
||||||
|
public async Task<bool> EditAsync(MedicalHistoryTemplateLDto template, CancellationToken cancellationToken)
|
||||||
|
{
|
||||||
|
if (!Guid.TryParse(_currentUserService.UserId, out Guid userId))
|
||||||
|
throw new AppException("توکن غیرمجاز", ApiResultStatusCode.UnAuthorized);
|
||||||
|
if (template.Id==Guid.Empty)
|
||||||
|
throw new AppException("پیش نویس پیدا نشد", ApiResultStatusCode.NotFound);
|
||||||
|
var ent = MedicalHistoryTemplate.Create(template.ChiefComplaint, template.SectionId, userId);
|
||||||
|
ent.Id = template.Id;
|
||||||
|
|
||||||
|
var questions = await _repositoryWrapper.SetRepository<MedicalHistoryQuestion>()
|
||||||
|
.TableNoTracking
|
||||||
|
.Where(q => q.MedicalHistoryTemplateId == ent.Id)
|
||||||
|
.ToListAsync(cancellationToken);
|
||||||
|
foreach (var question in questions)
|
||||||
|
{
|
||||||
|
if (template.Questions.FirstOrDefault(q => q.Id == question.Id) == null)
|
||||||
|
{
|
||||||
|
_repositoryWrapper.SetRepository<MedicalHistoryQuestion>()
|
||||||
|
.Delete(question);
|
||||||
|
await _repositoryWrapper.SaveChangesAsync(cancellationToken);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (var question in template.Questions.Where(q=>q.Id==Guid.Empty))
|
||||||
|
ent.AddQuestion(question.Question, question.Part, question.QuestionType);
|
||||||
|
_medicalHistoryTemplateRepository.Update(ent);
|
||||||
|
await _repositoryWrapper.SaveChangesAsync(cancellationToken);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<bool> AddAsync(MedicalHistoryTemplateLDto template,CancellationToken cancellationToken)
|
||||||
|
{
|
||||||
|
if (!Guid.TryParse(_currentUserService.UserId, out Guid userId))
|
||||||
|
throw new AppException("توکن غیرمجاز", ApiResultStatusCode.UnAuthorized);
|
||||||
|
var ent = MedicalHistoryTemplate.Create(template.ChiefComplaint, template.SectionId, userId);
|
||||||
|
foreach (var question in template.Questions)
|
||||||
|
ent.AddQuestion(question.Question, question.Part, question.QuestionType);
|
||||||
|
_medicalHistoryTemplateRepository.Add(ent);
|
||||||
|
await _repositoryWrapper.SaveChangesAsync(cancellationToken);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
|
@ -89,12 +89,16 @@ public class UserService : IUserService
|
||||||
user.FirstName = request.FirstName;
|
user.FirstName = request.FirstName;
|
||||||
user.UserName = request.PhoneNumber;
|
user.UserName = request.PhoneNumber;
|
||||||
user.PhoneNumber = request.PhoneNumber;
|
user.PhoneNumber = request.PhoneNumber;
|
||||||
|
user.StudentId = request.StudentId;
|
||||||
user.FirstName = request.FirstName;
|
user.FirstName = request.FirstName;
|
||||||
user.LastName = request.LastName;
|
user.LastName = request.LastName;
|
||||||
user.NationalId = request.NationalId;
|
user.NationalId = request.NationalId;
|
||||||
user.BirthDate = request.BirthDate;
|
user.BirthDate = request.BirthDate;
|
||||||
user.Gender = request.Gender;
|
user.Gender = request.Gender;
|
||||||
|
if (request.UniversityId != Guid.Empty)
|
||||||
user.UniversityId = request.UniversityId;
|
user.UniversityId = request.UniversityId;
|
||||||
|
if (request.SectionId != Guid.Empty)
|
||||||
|
user.SectionId = request.SectionId;
|
||||||
|
|
||||||
var result = await _userManager.UpdateAsync(user);
|
var result = await _userManager.UpdateAsync(user);
|
||||||
if (!result.Succeeded)
|
if (!result.Succeeded)
|
||||||
|
|
|
@ -28,6 +28,7 @@ public class MedicalHistoryLDto : BaseDto<MedicalHistoryLDto,MedicalHistory>
|
||||||
public int PulseRate { get; set; }
|
public int PulseRate { get; set; }
|
||||||
public int SPO2 { get; set; }
|
public int SPO2 { get; set; }
|
||||||
public int Temperature { get; set; }
|
public int Temperature { get; set; }
|
||||||
|
public Guid ApplicationUserId { get; set; }
|
||||||
|
|
||||||
public List<MedicalHistoryAnswerSDto> Answers { get; set; } = new();
|
public List<MedicalHistoryAnswerSDto> Answers { get; set; } = new();
|
||||||
}
|
}
|
|
@ -4,5 +4,8 @@ public class MedicalHistoryTemplateLDto : BaseDto<MedicalHistoryTemplateLDto,Med
|
||||||
{
|
{
|
||||||
|
|
||||||
public string ChiefComplaint { get; set; } = string.Empty;
|
public string ChiefComplaint { get; set; } = string.Empty;
|
||||||
|
public Guid SectionId { get; set; }
|
||||||
|
public SectionSDto Section { get; set; } = new();
|
||||||
|
public Guid ApplicationUserId { get; set; }
|
||||||
public List<MedicalHistoryQuestionSDto> Questions { get; set; } = new();
|
public List<MedicalHistoryQuestionSDto> Questions { get; set; } = new();
|
||||||
}
|
}
|
|
@ -7,8 +7,10 @@ public class UserActionRequestDto
|
||||||
public DateTime BirthDate { get; set; }
|
public DateTime BirthDate { get; set; }
|
||||||
public Gender Gender { get; set; }
|
public Gender Gender { get; set; }
|
||||||
public string NationalId { get; set; } = string.Empty;
|
public string NationalId { get; set; } = string.Empty;
|
||||||
|
public string StudentId { get; set; } = string.Empty;
|
||||||
public string Password { get; set; } = string.Empty;
|
public string Password { get; set; } = string.Empty;
|
||||||
public Guid RoleId { get; set; } = new();
|
public Guid RoleId { get; set; } = new();
|
||||||
public string RoleName { get; set; } = string.Empty;
|
public string RoleName { get; set; } = string.Empty;
|
||||||
public Guid UniversityId { get; set; }
|
public Guid UniversityId { get; set; }
|
||||||
|
public Guid SectionId { get; set; }
|
||||||
}
|
}
|
|
@ -9,9 +9,14 @@ public class ApplicationUserSDto : BaseDto<ApplicationUserSDto,ApplicationUser>
|
||||||
public string PhoneNumber { get; set; } = string.Empty;
|
public string PhoneNumber { get; set; } = string.Empty;
|
||||||
public bool PhoneNumberConfirmed { get; set; }
|
public bool PhoneNumberConfirmed { get; set; }
|
||||||
public string NationalId { get; set; } = string.Empty;
|
public string NationalId { get; set; } = string.Empty;
|
||||||
public string Section { get; set; } = string.Empty;
|
public string StudentId { get; set; } = string.Empty;
|
||||||
public DateTime BirthDate { get; set; }
|
public DateTime BirthDate { get; set; }
|
||||||
public Gender Gender { get; set; }
|
public Gender Gender { get; set; }
|
||||||
public SignUpStatus SignUpStatus { get; set; }
|
public SignUpStatus SignUpStatus { get; set; }
|
||||||
public Guid UniversityId { get; set; }
|
public Guid UniversityId { get; set; }
|
||||||
|
public Guid SectionId { get; set; }
|
||||||
|
|
||||||
|
public string FullName => FirstName + " " + LastName;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
|
@ -28,4 +28,6 @@ public class MedicalHistorySDto : BaseDto<MedicalHistorySDto,MedicalHistory>
|
||||||
public int PulseRate { get; set; }
|
public int PulseRate { get; set; }
|
||||||
public int SPO2 { get; set; }
|
public int SPO2 { get; set; }
|
||||||
public int Temperature { get; set; }
|
public int Temperature { get; set; }
|
||||||
|
public string FullName => FirstName + " " + LastName;
|
||||||
|
public Guid ApplicationUserId { get; set; }
|
||||||
}
|
}
|
|
@ -3,4 +3,6 @@
|
||||||
public class MedicalHistoryTemplateSDto : BaseDto<MedicalHistoryTemplateSDto,MedicalHistoryTemplate>
|
public class MedicalHistoryTemplateSDto : BaseDto<MedicalHistoryTemplateSDto,MedicalHistoryTemplate>
|
||||||
{
|
{
|
||||||
public string ChiefComplaint { get; set; } = string.Empty;
|
public string ChiefComplaint { get; set; } = string.Empty;
|
||||||
|
public Guid SectionId { get; set; }
|
||||||
|
public Guid ApplicationUserId { get; set; }
|
||||||
}
|
}
|
|
@ -0,0 +1,8 @@
|
||||||
|
namespace DocuMed.Domain.Dtos.SmallDtos;
|
||||||
|
|
||||||
|
public class SectionSDto : BaseDto<SectionSDto,Section>
|
||||||
|
{
|
||||||
|
public string Name { get; set; } = string.Empty;
|
||||||
|
public string Detail { get; set; } = string.Empty;
|
||||||
|
public Guid UniversityId { get; set; }
|
||||||
|
}
|
|
@ -4,4 +4,5 @@ public class UniversitySDto : BaseDto<UniversitySDto,University>
|
||||||
{
|
{
|
||||||
public string Name { get; set; } = string.Empty;
|
public string Name { get; set; } = string.Empty;
|
||||||
public string Address { get; set; } = string.Empty;
|
public string Address { get; set; } = string.Empty;
|
||||||
|
public Guid CityId { get; set; }
|
||||||
}
|
}
|
|
@ -23,3 +23,11 @@ public partial class University
|
||||||
return new University(name, address, cityId);
|
return new University(name, address, cityId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public partial class Section
|
||||||
|
{
|
||||||
|
public static Section Create(string name, string detail, Guid universityId)
|
||||||
|
{
|
||||||
|
return new Section(name, detail, universityId);
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,5 +1,8 @@
|
||||||
namespace DocuMed.Domain.Entities.City;
|
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 partial class City : ApiEntity
|
||||||
{
|
{
|
||||||
public City()
|
public City()
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
namespace DocuMed.Domain.Entities.City;
|
||||||
|
|
||||||
|
[AdaptTwoWays("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)]
|
||||||
|
[GenerateMapper]
|
||||||
|
public partial class Section : ApiEntity
|
||||||
|
{
|
||||||
|
|
||||||
|
public Section()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public Section(string name, string detail, Guid universityId)
|
||||||
|
{
|
||||||
|
Name = name;
|
||||||
|
Detail = detail;
|
||||||
|
UniversityId = universityId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public string Name { get; internal set; } = string.Empty;
|
||||||
|
public string Detail { get; internal set; } = string.Empty;
|
||||||
|
|
||||||
|
public Guid UniversityId { get; internal set; }
|
||||||
|
public University? University { get; internal set; }
|
||||||
|
}
|
|
@ -1,5 +1,7 @@
|
||||||
namespace DocuMed.Domain.Entities.City;
|
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 partial class University : ApiEntity
|
||||||
{
|
{
|
||||||
public University()
|
public University()
|
||||||
|
@ -19,4 +21,6 @@ public partial class University : ApiEntity
|
||||||
|
|
||||||
public Guid CityId { get; internal set; }
|
public Guid CityId { get; internal set; }
|
||||||
public City? City { get; internal set; }
|
public City? City { get; internal set; }
|
||||||
|
|
||||||
|
public List<Section> Sections { get; internal set; } = new();
|
||||||
}
|
}
|
|
@ -43,7 +43,8 @@ public partial class MedicalHistory
|
||||||
int diastolicBloodPressure,
|
int diastolicBloodPressure,
|
||||||
int pulseRate,
|
int pulseRate,
|
||||||
int sPO2,
|
int sPO2,
|
||||||
int temperature)
|
int temperature,
|
||||||
|
Guid applicationUserId)
|
||||||
{
|
{
|
||||||
return new MedicalHistory(presentIllnessDetail,
|
return new MedicalHistory(presentIllnessDetail,
|
||||||
pastDiseasesHistoryDetail,
|
pastDiseasesHistoryDetail,
|
||||||
|
@ -55,7 +56,7 @@ public partial class MedicalHistory
|
||||||
systemReviewDetail,
|
systemReviewDetail,
|
||||||
vitalSignDetail,
|
vitalSignDetail,
|
||||||
chiefComplaint, section, firstName, lastName, fatherName, nationalId, age, birthDate, systolicBloodPressure,
|
chiefComplaint, section, firstName, lastName, fatherName, nationalId, age, birthDate, systolicBloodPressure,
|
||||||
diastolicBloodPressure, pulseRate, sPO2, temperature);
|
diastolicBloodPressure, pulseRate, sPO2, temperature, applicationUserId);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,9 +1,7 @@
|
||||||
namespace DocuMed.Domain.Entities.MedicalHistory;
|
namespace DocuMed.Domain.Entities.MedicalHistory;
|
||||||
|
|
||||||
[AdaptTwoWays("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) },
|
[AdaptTwoWays("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)]
|
||||||
MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)]
|
[AdaptTwoWays("[name]LDto", 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]
|
[GenerateMapper]
|
||||||
|
|
||||||
public partial class MedicalHistory : ApiEntity
|
public partial class MedicalHistory : ApiEntity
|
||||||
|
@ -34,7 +32,8 @@ public partial class MedicalHistory : ApiEntity
|
||||||
int diastolicBloodPressure,
|
int diastolicBloodPressure,
|
||||||
int pulseRate,
|
int pulseRate,
|
||||||
int spo2,
|
int spo2,
|
||||||
int temperature)
|
int temperature,
|
||||||
|
Guid applicationUserId)
|
||||||
{
|
{
|
||||||
PresentIllnessDetail = presentIllnessDetail;
|
PresentIllnessDetail = presentIllnessDetail;
|
||||||
PastDiseasesHistoryDetail = pastDiseasesHistoryDetail;
|
PastDiseasesHistoryDetail = pastDiseasesHistoryDetail;
|
||||||
|
@ -58,6 +57,7 @@ public partial class MedicalHistory : ApiEntity
|
||||||
PulseRate = pulseRate;
|
PulseRate = pulseRate;
|
||||||
SPO2 = spo2;
|
SPO2 = spo2;
|
||||||
Temperature = temperature;
|
Temperature = temperature;
|
||||||
|
ApplicationUserId = applicationUserId;
|
||||||
}
|
}
|
||||||
public string ChiefComplaint { get; internal set; } = string.Empty;
|
public string ChiefComplaint { get; internal set; } = string.Empty;
|
||||||
public string Section { get; internal set; } = string.Empty;
|
public string Section { get; internal set; } = string.Empty;
|
||||||
|
@ -86,5 +86,8 @@ public partial class MedicalHistory : ApiEntity
|
||||||
public int SPO2 { get; internal set; }
|
public int SPO2 { get; internal set; }
|
||||||
public int Temperature { get; internal set; }
|
public int Temperature { get; internal set; }
|
||||||
|
|
||||||
|
public Guid ApplicationUserId { get; internal set; }
|
||||||
|
public ApplicationUser? ApplicationUser { get; internal set; }
|
||||||
|
|
||||||
public List<MedicalHistoryAnswer> Answers { get; internal set; } = new();
|
public List<MedicalHistoryAnswer> Answers { get; internal set; } = new();
|
||||||
}
|
}
|
|
@ -24,8 +24,8 @@ public partial class MedicalHistoryTemplate
|
||||||
return mhQuestion;
|
return mhQuestion;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static MedicalHistoryTemplate Create(string chiefComplaint)
|
public static MedicalHistoryTemplate Create(string chiefComplaint,Guid sectionId,Guid applicationUserId)
|
||||||
{
|
{
|
||||||
return new MedicalHistoryTemplate(chiefComplaint);
|
return new MedicalHistoryTemplate(chiefComplaint, sectionId, applicationUserId);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -12,12 +12,17 @@ public partial class MedicalHistoryTemplate : ApiEntity
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
public MedicalHistoryTemplate(string chiefComplaint)
|
public MedicalHistoryTemplate(string chiefComplaint,Guid sectionId,Guid applicationUserId)
|
||||||
{
|
{
|
||||||
ChiefComplaint = chiefComplaint;
|
ChiefComplaint = chiefComplaint;
|
||||||
|
SectionId = sectionId;
|
||||||
|
ApplicationUserId = applicationUserId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public string ChiefComplaint { get; internal set; } = string.Empty;
|
public string ChiefComplaint { get; internal set; } = string.Empty;
|
||||||
|
public Guid SectionId { get; set; }
|
||||||
|
public Section? Section { get; set; }
|
||||||
|
public Guid ApplicationUserId { get; internal set; }
|
||||||
|
public ApplicationUser? ApplicationUser { get; set; }
|
||||||
public List<MedicalHistoryQuestion> Questions { get; internal set; } = new();
|
public List<MedicalHistoryQuestion> Questions { get; internal set; } = new();
|
||||||
}
|
}
|
|
@ -7,11 +7,14 @@ public class ApplicationUser : IdentityUser<Guid>
|
||||||
public string FirstName { get; set; } = string.Empty;
|
public string FirstName { get; set; } = string.Empty;
|
||||||
public string LastName { get; set; } = string.Empty;
|
public string LastName { get; set; } = string.Empty;
|
||||||
public string NationalId { get; set; } = string.Empty;
|
public string NationalId { get; set; } = string.Empty;
|
||||||
public string Section { get; set; } = string.Empty;
|
public string StudentId { get; set; } = string.Empty;
|
||||||
public DateTime BirthDate { get; set; }
|
public DateTime BirthDate { get; set; }
|
||||||
public Gender Gender { get; set; }
|
public Gender Gender { get; set; }
|
||||||
public SignUpStatus SignUpStatus { get; set; }
|
public SignUpStatus SignUpStatus { get; set; }
|
||||||
|
|
||||||
public Guid? UniversityId { get; set; }
|
public Guid? UniversityId { get; set; }
|
||||||
public University? University { get; set; }
|
public University? University { get; set; }
|
||||||
|
|
||||||
|
public Guid? SectionId { get; set; }
|
||||||
|
public Section? Section { get; set; }
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,5 +7,7 @@ public enum MedicalHistoryQuestionType
|
||||||
[Display(Name = "پرسش و پاسخ")]
|
[Display(Name = "پرسش و پاسخ")]
|
||||||
Interrogatively,
|
Interrogatively,
|
||||||
[Display(Name = "بله و خیر")]
|
[Display(Name = "بله و خیر")]
|
||||||
YesOrNo
|
YesOrNo,
|
||||||
|
[Display(Name = "انتخابی")]
|
||||||
|
Selective
|
||||||
}
|
}
|
|
@ -14,11 +14,12 @@ namespace DocuMed.Domain.Mappers
|
||||||
FirstName = p1.FirstName,
|
FirstName = p1.FirstName,
|
||||||
LastName = p1.LastName,
|
LastName = p1.LastName,
|
||||||
NationalId = p1.NationalId,
|
NationalId = p1.NationalId,
|
||||||
Section = p1.Section,
|
StudentId = p1.StudentId,
|
||||||
BirthDate = p1.BirthDate,
|
BirthDate = p1.BirthDate,
|
||||||
Gender = p1.Gender,
|
Gender = p1.Gender,
|
||||||
SignUpStatus = p1.SignUpStatus,
|
SignUpStatus = p1.SignUpStatus,
|
||||||
UniversityId = p1.UniversityId,
|
UniversityId = (Guid?)p1.UniversityId,
|
||||||
|
SectionId = (Guid?)p1.SectionId,
|
||||||
Id = p1.Id,
|
Id = p1.Id,
|
||||||
UserName = p1.UserName,
|
UserName = p1.UserName,
|
||||||
Email = p1.Email,
|
Email = p1.Email,
|
||||||
|
@ -37,11 +38,12 @@ namespace DocuMed.Domain.Mappers
|
||||||
result.FirstName = p2.FirstName;
|
result.FirstName = p2.FirstName;
|
||||||
result.LastName = p2.LastName;
|
result.LastName = p2.LastName;
|
||||||
result.NationalId = p2.NationalId;
|
result.NationalId = p2.NationalId;
|
||||||
result.Section = p2.Section;
|
result.StudentId = p2.StudentId;
|
||||||
result.BirthDate = p2.BirthDate;
|
result.BirthDate = p2.BirthDate;
|
||||||
result.Gender = p2.Gender;
|
result.Gender = p2.Gender;
|
||||||
result.SignUpStatus = p2.SignUpStatus;
|
result.SignUpStatus = p2.SignUpStatus;
|
||||||
result.UniversityId = p2.UniversityId;
|
result.UniversityId = (Guid?)p2.UniversityId;
|
||||||
|
result.SectionId = (Guid?)p2.SectionId;
|
||||||
result.Id = p2.Id;
|
result.Id = p2.Id;
|
||||||
result.UserName = p2.UserName;
|
result.UserName = p2.UserName;
|
||||||
result.Email = p2.Email;
|
result.Email = p2.Email;
|
||||||
|
@ -55,11 +57,12 @@ namespace DocuMed.Domain.Mappers
|
||||||
FirstName = p4.FirstName,
|
FirstName = p4.FirstName,
|
||||||
LastName = p4.LastName,
|
LastName = p4.LastName,
|
||||||
NationalId = p4.NationalId,
|
NationalId = p4.NationalId,
|
||||||
Section = p4.Section,
|
StudentId = p4.StudentId,
|
||||||
BirthDate = p4.BirthDate,
|
BirthDate = p4.BirthDate,
|
||||||
Gender = p4.Gender,
|
Gender = p4.Gender,
|
||||||
SignUpStatus = p4.SignUpStatus,
|
SignUpStatus = p4.SignUpStatus,
|
||||||
UniversityId = p4.UniversityId,
|
UniversityId = (Guid?)p4.UniversityId,
|
||||||
|
SectionId = (Guid?)p4.SectionId,
|
||||||
Id = p4.Id,
|
Id = p4.Id,
|
||||||
UserName = p4.UserName,
|
UserName = p4.UserName,
|
||||||
Email = p4.Email,
|
Email = p4.Email,
|
||||||
|
@ -77,11 +80,12 @@ namespace DocuMed.Domain.Mappers
|
||||||
PhoneNumber = p5.PhoneNumber,
|
PhoneNumber = p5.PhoneNumber,
|
||||||
PhoneNumberConfirmed = p5.PhoneNumberConfirmed,
|
PhoneNumberConfirmed = p5.PhoneNumberConfirmed,
|
||||||
NationalId = p5.NationalId,
|
NationalId = p5.NationalId,
|
||||||
Section = p5.Section,
|
StudentId = p5.StudentId,
|
||||||
BirthDate = p5.BirthDate,
|
BirthDate = p5.BirthDate,
|
||||||
Gender = p5.Gender,
|
Gender = p5.Gender,
|
||||||
SignUpStatus = p5.SignUpStatus,
|
SignUpStatus = p5.SignUpStatus,
|
||||||
UniversityId = p5.UniversityId,
|
UniversityId = p5.UniversityId == null ? default(Guid) : (Guid)p5.UniversityId,
|
||||||
|
SectionId = p5.SectionId == null ? default(Guid) : (Guid)p5.SectionId,
|
||||||
Id = p5.Id
|
Id = p5.Id
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -100,11 +104,12 @@ namespace DocuMed.Domain.Mappers
|
||||||
result.PhoneNumber = p6.PhoneNumber;
|
result.PhoneNumber = p6.PhoneNumber;
|
||||||
result.PhoneNumberConfirmed = p6.PhoneNumberConfirmed;
|
result.PhoneNumberConfirmed = p6.PhoneNumberConfirmed;
|
||||||
result.NationalId = p6.NationalId;
|
result.NationalId = p6.NationalId;
|
||||||
result.Section = p6.Section;
|
result.StudentId = p6.StudentId;
|
||||||
result.BirthDate = p6.BirthDate;
|
result.BirthDate = p6.BirthDate;
|
||||||
result.Gender = p6.Gender;
|
result.Gender = p6.Gender;
|
||||||
result.SignUpStatus = p6.SignUpStatus;
|
result.SignUpStatus = p6.SignUpStatus;
|
||||||
result.UniversityId = p6.UniversityId;
|
result.UniversityId = p6.UniversityId == null ? default(Guid) : (Guid)p6.UniversityId;
|
||||||
|
result.SectionId = p6.SectionId == null ? default(Guid) : (Guid)p6.SectionId;
|
||||||
result.Id = p6.Id;
|
result.Id = p6.Id;
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
|
@ -118,11 +123,12 @@ namespace DocuMed.Domain.Mappers
|
||||||
PhoneNumber = p8.PhoneNumber,
|
PhoneNumber = p8.PhoneNumber,
|
||||||
PhoneNumberConfirmed = p8.PhoneNumberConfirmed,
|
PhoneNumberConfirmed = p8.PhoneNumberConfirmed,
|
||||||
NationalId = p8.NationalId,
|
NationalId = p8.NationalId,
|
||||||
Section = p8.Section,
|
StudentId = p8.StudentId,
|
||||||
BirthDate = p8.BirthDate,
|
BirthDate = p8.BirthDate,
|
||||||
Gender = p8.Gender,
|
Gender = p8.Gender,
|
||||||
SignUpStatus = p8.SignUpStatus,
|
SignUpStatus = p8.SignUpStatus,
|
||||||
UniversityId = p8.UniversityId,
|
UniversityId = p8.UniversityId == null ? default(Guid) : (Guid)p8.UniversityId,
|
||||||
|
SectionId = p8.SectionId == null ? default(Guid) : (Guid)p8.SectionId,
|
||||||
Id = p8.Id
|
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;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -36,6 +36,7 @@ namespace DocuMed.Domain.Mappers
|
||||||
PulseRate = p1.PulseRate,
|
PulseRate = p1.PulseRate,
|
||||||
SPO2 = p1.SPO2,
|
SPO2 = p1.SPO2,
|
||||||
Temperature = p1.Temperature,
|
Temperature = p1.Temperature,
|
||||||
|
ApplicationUserId = p1.ApplicationUserId,
|
||||||
Id = p1.Id
|
Id = p1.Id
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -69,6 +70,7 @@ namespace DocuMed.Domain.Mappers
|
||||||
result.PulseRate = p2.PulseRate;
|
result.PulseRate = p2.PulseRate;
|
||||||
result.SPO2 = p2.SPO2;
|
result.SPO2 = p2.SPO2;
|
||||||
result.Temperature = p2.Temperature;
|
result.Temperature = p2.Temperature;
|
||||||
|
result.ApplicationUserId = p2.ApplicationUserId;
|
||||||
result.Id = p2.Id;
|
result.Id = p2.Id;
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
|
@ -97,6 +99,7 @@ namespace DocuMed.Domain.Mappers
|
||||||
PulseRate = p4.PulseRate,
|
PulseRate = p4.PulseRate,
|
||||||
SPO2 = p4.SPO2,
|
SPO2 = p4.SPO2,
|
||||||
Temperature = p4.Temperature,
|
Temperature = p4.Temperature,
|
||||||
|
ApplicationUserId = p4.ApplicationUserId,
|
||||||
Id = p4.Id
|
Id = p4.Id
|
||||||
};
|
};
|
||||||
public static MedicalHistorySDto AdaptToSDto(this MedicalHistory p5)
|
public static MedicalHistorySDto AdaptToSDto(this MedicalHistory p5)
|
||||||
|
@ -125,6 +128,7 @@ namespace DocuMed.Domain.Mappers
|
||||||
PulseRate = p5.PulseRate,
|
PulseRate = p5.PulseRate,
|
||||||
SPO2 = p5.SPO2,
|
SPO2 = p5.SPO2,
|
||||||
Temperature = p5.Temperature,
|
Temperature = p5.Temperature,
|
||||||
|
ApplicationUserId = p5.ApplicationUserId,
|
||||||
Id = p5.Id
|
Id = p5.Id
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -158,6 +162,7 @@ namespace DocuMed.Domain.Mappers
|
||||||
result.PulseRate = p6.PulseRate;
|
result.PulseRate = p6.PulseRate;
|
||||||
result.SPO2 = p6.SPO2;
|
result.SPO2 = p6.SPO2;
|
||||||
result.Temperature = p6.Temperature;
|
result.Temperature = p6.Temperature;
|
||||||
|
result.ApplicationUserId = p6.ApplicationUserId;
|
||||||
result.Id = p6.Id;
|
result.Id = p6.Id;
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
|
@ -186,6 +191,7 @@ namespace DocuMed.Domain.Mappers
|
||||||
PulseRate = p8.PulseRate,
|
PulseRate = p8.PulseRate,
|
||||||
SPO2 = p8.SPO2,
|
SPO2 = p8.SPO2,
|
||||||
Temperature = p8.Temperature,
|
Temperature = p8.Temperature,
|
||||||
|
ApplicationUserId = p8.ApplicationUserId,
|
||||||
Id = p8.Id
|
Id = p8.Id
|
||||||
};
|
};
|
||||||
public static MedicalHistory AdaptToMedicalHistory(this MedicalHistoryLDto p9)
|
public static MedicalHistory AdaptToMedicalHistory(this MedicalHistoryLDto p9)
|
||||||
|
@ -214,6 +220,7 @@ namespace DocuMed.Domain.Mappers
|
||||||
PulseRate = p9.PulseRate,
|
PulseRate = p9.PulseRate,
|
||||||
SPO2 = p9.SPO2,
|
SPO2 = p9.SPO2,
|
||||||
Temperature = p9.Temperature,
|
Temperature = p9.Temperature,
|
||||||
|
ApplicationUserId = p9.ApplicationUserId,
|
||||||
Answers = funcMain1(p9.Answers),
|
Answers = funcMain1(p9.Answers),
|
||||||
Id = p9.Id
|
Id = p9.Id
|
||||||
};
|
};
|
||||||
|
@ -248,6 +255,7 @@ namespace DocuMed.Domain.Mappers
|
||||||
result.PulseRate = p11.PulseRate;
|
result.PulseRate = p11.PulseRate;
|
||||||
result.SPO2 = p11.SPO2;
|
result.SPO2 = p11.SPO2;
|
||||||
result.Temperature = p11.Temperature;
|
result.Temperature = p11.Temperature;
|
||||||
|
result.ApplicationUserId = p11.ApplicationUserId;
|
||||||
result.Answers = funcMain2(p11.Answers, result.Answers);
|
result.Answers = funcMain2(p11.Answers, result.Answers);
|
||||||
result.Id = p11.Id;
|
result.Id = p11.Id;
|
||||||
return result;
|
return result;
|
||||||
|
@ -277,6 +285,7 @@ namespace DocuMed.Domain.Mappers
|
||||||
PulseRate = p15.PulseRate,
|
PulseRate = p15.PulseRate,
|
||||||
SPO2 = p15.SPO2,
|
SPO2 = p15.SPO2,
|
||||||
Temperature = p15.Temperature,
|
Temperature = p15.Temperature,
|
||||||
|
ApplicationUserId = p15.ApplicationUserId,
|
||||||
Answers = p15.Answers.Select<MedicalHistoryAnswerSDto, MedicalHistoryAnswer>(p16 => new MedicalHistoryAnswer()
|
Answers = p15.Answers.Select<MedicalHistoryAnswerSDto, MedicalHistoryAnswer>(p16 => new MedicalHistoryAnswer()
|
||||||
{
|
{
|
||||||
Answer = p16.Answer,
|
Answer = p16.Answer,
|
||||||
|
@ -314,6 +323,7 @@ namespace DocuMed.Domain.Mappers
|
||||||
PulseRate = p17.PulseRate,
|
PulseRate = p17.PulseRate,
|
||||||
SPO2 = p17.SPO2,
|
SPO2 = p17.SPO2,
|
||||||
Temperature = p17.Temperature,
|
Temperature = p17.Temperature,
|
||||||
|
ApplicationUserId = p17.ApplicationUserId,
|
||||||
Answers = funcMain3(p17.Answers),
|
Answers = funcMain3(p17.Answers),
|
||||||
Id = p17.Id
|
Id = p17.Id
|
||||||
};
|
};
|
||||||
|
@ -348,6 +358,7 @@ namespace DocuMed.Domain.Mappers
|
||||||
result.PulseRate = p19.PulseRate;
|
result.PulseRate = p19.PulseRate;
|
||||||
result.SPO2 = p19.SPO2;
|
result.SPO2 = p19.SPO2;
|
||||||
result.Temperature = p19.Temperature;
|
result.Temperature = p19.Temperature;
|
||||||
|
result.ApplicationUserId = p19.ApplicationUserId;
|
||||||
result.Answers = funcMain4(p19.Answers, result.Answers);
|
result.Answers = funcMain4(p19.Answers, result.Answers);
|
||||||
result.Id = p19.Id;
|
result.Id = p19.Id;
|
||||||
return result;
|
return result;
|
||||||
|
@ -377,6 +388,7 @@ namespace DocuMed.Domain.Mappers
|
||||||
PulseRate = p23.PulseRate,
|
PulseRate = p23.PulseRate,
|
||||||
SPO2 = p23.SPO2,
|
SPO2 = p23.SPO2,
|
||||||
Temperature = p23.Temperature,
|
Temperature = p23.Temperature,
|
||||||
|
ApplicationUserId = p23.ApplicationUserId,
|
||||||
Answers = p23.Answers.Select<MedicalHistoryAnswer, MedicalHistoryAnswerSDto>(p24 => new MedicalHistoryAnswerSDto()
|
Answers = p23.Answers.Select<MedicalHistoryAnswer, MedicalHistoryAnswerSDto>(p24 => new MedicalHistoryAnswerSDto()
|
||||||
{
|
{
|
||||||
Answer = p24.Answer,
|
Answer = p24.Answer,
|
||||||
|
|
|
@ -4,6 +4,7 @@ using System.Linq;
|
||||||
using System.Linq.Expressions;
|
using System.Linq.Expressions;
|
||||||
using DocuMed.Domain.Dtos.LargDtos;
|
using DocuMed.Domain.Dtos.LargDtos;
|
||||||
using DocuMed.Domain.Dtos.SmallDtos;
|
using DocuMed.Domain.Dtos.SmallDtos;
|
||||||
|
using DocuMed.Domain.Entities.City;
|
||||||
using DocuMed.Domain.Entities.MedicalHistoryTemplate;
|
using DocuMed.Domain.Entities.MedicalHistoryTemplate;
|
||||||
|
|
||||||
namespace DocuMed.Domain.Mappers
|
namespace DocuMed.Domain.Mappers
|
||||||
|
@ -15,6 +16,8 @@ namespace DocuMed.Domain.Mappers
|
||||||
return p1 == null ? null : new MedicalHistoryTemplate()
|
return p1 == null ? null : new MedicalHistoryTemplate()
|
||||||
{
|
{
|
||||||
ChiefComplaint = p1.ChiefComplaint,
|
ChiefComplaint = p1.ChiefComplaint,
|
||||||
|
SectionId = p1.SectionId,
|
||||||
|
ApplicationUserId = p1.ApplicationUserId,
|
||||||
Id = p1.Id
|
Id = p1.Id
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -27,6 +30,8 @@ namespace DocuMed.Domain.Mappers
|
||||||
MedicalHistoryTemplate result = p3 ?? new MedicalHistoryTemplate();
|
MedicalHistoryTemplate result = p3 ?? new MedicalHistoryTemplate();
|
||||||
|
|
||||||
result.ChiefComplaint = p2.ChiefComplaint;
|
result.ChiefComplaint = p2.ChiefComplaint;
|
||||||
|
result.SectionId = p2.SectionId;
|
||||||
|
result.ApplicationUserId = p2.ApplicationUserId;
|
||||||
result.Id = p2.Id;
|
result.Id = p2.Id;
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
|
@ -34,6 +39,8 @@ namespace DocuMed.Domain.Mappers
|
||||||
public static Expression<Func<MedicalHistoryTemplateSDto, MedicalHistoryTemplate>> ProjectToMedicalHistoryTemplate => p4 => new MedicalHistoryTemplate()
|
public static Expression<Func<MedicalHistoryTemplateSDto, MedicalHistoryTemplate>> ProjectToMedicalHistoryTemplate => p4 => new MedicalHistoryTemplate()
|
||||||
{
|
{
|
||||||
ChiefComplaint = p4.ChiefComplaint,
|
ChiefComplaint = p4.ChiefComplaint,
|
||||||
|
SectionId = p4.SectionId,
|
||||||
|
ApplicationUserId = p4.ApplicationUserId,
|
||||||
Id = p4.Id
|
Id = p4.Id
|
||||||
};
|
};
|
||||||
public static MedicalHistoryTemplateSDto AdaptToSDto(this MedicalHistoryTemplate p5)
|
public static MedicalHistoryTemplateSDto AdaptToSDto(this MedicalHistoryTemplate p5)
|
||||||
|
@ -41,6 +48,8 @@ namespace DocuMed.Domain.Mappers
|
||||||
return p5 == null ? null : new MedicalHistoryTemplateSDto()
|
return p5 == null ? null : new MedicalHistoryTemplateSDto()
|
||||||
{
|
{
|
||||||
ChiefComplaint = p5.ChiefComplaint,
|
ChiefComplaint = p5.ChiefComplaint,
|
||||||
|
SectionId = p5.SectionId,
|
||||||
|
ApplicationUserId = p5.ApplicationUserId,
|
||||||
Id = p5.Id
|
Id = p5.Id
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -53,6 +62,8 @@ namespace DocuMed.Domain.Mappers
|
||||||
MedicalHistoryTemplateSDto result = p7 ?? new MedicalHistoryTemplateSDto();
|
MedicalHistoryTemplateSDto result = p7 ?? new MedicalHistoryTemplateSDto();
|
||||||
|
|
||||||
result.ChiefComplaint = p6.ChiefComplaint;
|
result.ChiefComplaint = p6.ChiefComplaint;
|
||||||
|
result.SectionId = p6.SectionId;
|
||||||
|
result.ApplicationUserId = p6.ApplicationUserId;
|
||||||
result.Id = p6.Id;
|
result.Id = p6.Id;
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
|
@ -60,6 +71,8 @@ namespace DocuMed.Domain.Mappers
|
||||||
public static Expression<Func<MedicalHistoryTemplate, MedicalHistoryTemplateSDto>> ProjectToSDto => p8 => new MedicalHistoryTemplateSDto()
|
public static Expression<Func<MedicalHistoryTemplate, MedicalHistoryTemplateSDto>> ProjectToSDto => p8 => new MedicalHistoryTemplateSDto()
|
||||||
{
|
{
|
||||||
ChiefComplaint = p8.ChiefComplaint,
|
ChiefComplaint = p8.ChiefComplaint,
|
||||||
|
SectionId = p8.SectionId,
|
||||||
|
ApplicationUserId = p8.ApplicationUserId,
|
||||||
Id = p8.Id
|
Id = p8.Id
|
||||||
};
|
};
|
||||||
public static MedicalHistoryTemplate AdaptToMedicalHistoryTemplate(this MedicalHistoryTemplateLDto p9)
|
public static MedicalHistoryTemplate AdaptToMedicalHistoryTemplate(this MedicalHistoryTemplateLDto p9)
|
||||||
|
@ -67,6 +80,15 @@ namespace DocuMed.Domain.Mappers
|
||||||
return p9 == null ? null : new MedicalHistoryTemplate()
|
return p9 == null ? null : new MedicalHistoryTemplate()
|
||||||
{
|
{
|
||||||
ChiefComplaint = p9.ChiefComplaint,
|
ChiefComplaint = p9.ChiefComplaint,
|
||||||
|
SectionId = p9.SectionId,
|
||||||
|
Section = p9.Section == null ? null : new Section()
|
||||||
|
{
|
||||||
|
Name = p9.Section.Name,
|
||||||
|
Detail = p9.Section.Detail,
|
||||||
|
UniversityId = p9.Section.UniversityId,
|
||||||
|
Id = p9.Section.Id
|
||||||
|
},
|
||||||
|
ApplicationUserId = p9.ApplicationUserId,
|
||||||
Questions = funcMain1(p9.Questions),
|
Questions = funcMain1(p9.Questions),
|
||||||
Id = p9.Id
|
Id = p9.Id
|
||||||
};
|
};
|
||||||
|
@ -80,59 +102,92 @@ namespace DocuMed.Domain.Mappers
|
||||||
MedicalHistoryTemplate result = p12 ?? new MedicalHistoryTemplate();
|
MedicalHistoryTemplate result = p12 ?? new MedicalHistoryTemplate();
|
||||||
|
|
||||||
result.ChiefComplaint = p11.ChiefComplaint;
|
result.ChiefComplaint = p11.ChiefComplaint;
|
||||||
result.Questions = funcMain2(p11.Questions, result.Questions);
|
result.SectionId = p11.SectionId;
|
||||||
|
result.Section = funcMain2(p11.Section, result.Section);
|
||||||
|
result.ApplicationUserId = p11.ApplicationUserId;
|
||||||
|
result.Questions = funcMain3(p11.Questions, result.Questions);
|
||||||
result.Id = p11.Id;
|
result.Id = p11.Id;
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
}
|
}
|
||||||
public static Expression<Func<MedicalHistoryTemplateLDto, MedicalHistoryTemplate>> ProjectLDtoToMedicalHistoryTemplate => p15 => new MedicalHistoryTemplate()
|
public static Expression<Func<MedicalHistoryTemplateLDto, MedicalHistoryTemplate>> ProjectLDtoToMedicalHistoryTemplate => p17 => new MedicalHistoryTemplate()
|
||||||
{
|
|
||||||
ChiefComplaint = p15.ChiefComplaint,
|
|
||||||
Questions = p15.Questions.Select<MedicalHistoryQuestionSDto, MedicalHistoryQuestion>(p16 => new MedicalHistoryQuestion()
|
|
||||||
{
|
|
||||||
Question = p16.Question,
|
|
||||||
Part = p16.Part,
|
|
||||||
QuestionType = p16.QuestionType,
|
|
||||||
MedicalHistoryTemplateId = p16.MedicalHistoryTemplateId,
|
|
||||||
Id = p16.Id
|
|
||||||
}).ToList<MedicalHistoryQuestion>(),
|
|
||||||
Id = p15.Id
|
|
||||||
};
|
|
||||||
public static MedicalHistoryTemplateLDto AdaptToLDto(this MedicalHistoryTemplate p17)
|
|
||||||
{
|
|
||||||
return p17 == null ? null : new MedicalHistoryTemplateLDto()
|
|
||||||
{
|
{
|
||||||
ChiefComplaint = p17.ChiefComplaint,
|
ChiefComplaint = p17.ChiefComplaint,
|
||||||
Questions = funcMain3(p17.Questions),
|
SectionId = p17.SectionId,
|
||||||
|
Section = p17.Section == null ? null : new Section()
|
||||||
|
{
|
||||||
|
Name = p17.Section.Name,
|
||||||
|
Detail = p17.Section.Detail,
|
||||||
|
UniversityId = p17.Section.UniversityId,
|
||||||
|
Id = p17.Section.Id
|
||||||
|
},
|
||||||
|
ApplicationUserId = p17.ApplicationUserId,
|
||||||
|
Questions = p17.Questions.Select<MedicalHistoryQuestionSDto, MedicalHistoryQuestion>(p18 => new MedicalHistoryQuestion()
|
||||||
|
{
|
||||||
|
Question = p18.Question,
|
||||||
|
Part = p18.Part,
|
||||||
|
QuestionType = p18.QuestionType,
|
||||||
|
MedicalHistoryTemplateId = p18.MedicalHistoryTemplateId,
|
||||||
|
Id = p18.Id
|
||||||
|
}).ToList<MedicalHistoryQuestion>(),
|
||||||
Id = p17.Id
|
Id = p17.Id
|
||||||
};
|
};
|
||||||
}
|
public static MedicalHistoryTemplateLDto AdaptToLDto(this MedicalHistoryTemplate p19)
|
||||||
public static MedicalHistoryTemplateLDto AdaptTo(this MedicalHistoryTemplate p19, MedicalHistoryTemplateLDto p20)
|
|
||||||
{
|
{
|
||||||
if (p19 == null)
|
return p19 == null ? null : new MedicalHistoryTemplateLDto()
|
||||||
|
{
|
||||||
|
ChiefComplaint = p19.ChiefComplaint,
|
||||||
|
SectionId = p19.SectionId,
|
||||||
|
Section = p19.Section == null ? null : new SectionSDto()
|
||||||
|
{
|
||||||
|
Name = p19.Section.Name,
|
||||||
|
Detail = p19.Section.Detail,
|
||||||
|
UniversityId = p19.Section.UniversityId,
|
||||||
|
Id = p19.Section.Id
|
||||||
|
},
|
||||||
|
ApplicationUserId = p19.ApplicationUserId,
|
||||||
|
Questions = funcMain4(p19.Questions),
|
||||||
|
Id = p19.Id
|
||||||
|
};
|
||||||
|
}
|
||||||
|
public static MedicalHistoryTemplateLDto AdaptTo(this MedicalHistoryTemplate p21, MedicalHistoryTemplateLDto p22)
|
||||||
|
{
|
||||||
|
if (p21 == null)
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
MedicalHistoryTemplateLDto result = p20 ?? new MedicalHistoryTemplateLDto();
|
MedicalHistoryTemplateLDto result = p22 ?? new MedicalHistoryTemplateLDto();
|
||||||
|
|
||||||
result.ChiefComplaint = p19.ChiefComplaint;
|
result.ChiefComplaint = p21.ChiefComplaint;
|
||||||
result.Questions = funcMain4(p19.Questions, result.Questions);
|
result.SectionId = p21.SectionId;
|
||||||
result.Id = p19.Id;
|
result.Section = funcMain5(p21.Section, result.Section);
|
||||||
|
result.ApplicationUserId = p21.ApplicationUserId;
|
||||||
|
result.Questions = funcMain6(p21.Questions, result.Questions);
|
||||||
|
result.Id = p21.Id;
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
}
|
}
|
||||||
public static Expression<Func<MedicalHistoryTemplate, MedicalHistoryTemplateLDto>> ProjectToLDto => p23 => new MedicalHistoryTemplateLDto()
|
public static Expression<Func<MedicalHistoryTemplate, MedicalHistoryTemplateLDto>> ProjectToLDto => p27 => new MedicalHistoryTemplateLDto()
|
||||||
{
|
{
|
||||||
ChiefComplaint = p23.ChiefComplaint,
|
ChiefComplaint = p27.ChiefComplaint,
|
||||||
Questions = p23.Questions.Select<MedicalHistoryQuestion, MedicalHistoryQuestionSDto>(p24 => new MedicalHistoryQuestionSDto()
|
SectionId = p27.SectionId,
|
||||||
|
Section = p27.Section == null ? null : new SectionSDto()
|
||||||
{
|
{
|
||||||
Question = p24.Question,
|
Name = p27.Section.Name,
|
||||||
Part = p24.Part,
|
Detail = p27.Section.Detail,
|
||||||
QuestionType = p24.QuestionType,
|
UniversityId = p27.Section.UniversityId,
|
||||||
MedicalHistoryTemplateId = p24.MedicalHistoryTemplateId,
|
Id = p27.Section.Id
|
||||||
Id = p24.Id
|
},
|
||||||
|
ApplicationUserId = p27.ApplicationUserId,
|
||||||
|
Questions = p27.Questions.Select<MedicalHistoryQuestion, MedicalHistoryQuestionSDto>(p28 => new MedicalHistoryQuestionSDto()
|
||||||
|
{
|
||||||
|
Question = p28.Question,
|
||||||
|
Part = p28.Part,
|
||||||
|
QuestionType = p28.QuestionType,
|
||||||
|
MedicalHistoryTemplateId = p28.MedicalHistoryTemplateId,
|
||||||
|
Id = p28.Id
|
||||||
}).ToList<MedicalHistoryQuestionSDto>(),
|
}).ToList<MedicalHistoryQuestionSDto>(),
|
||||||
Id = p23.Id
|
Id = p27.Id
|
||||||
};
|
};
|
||||||
|
|
||||||
private static List<MedicalHistoryQuestion> funcMain1(List<MedicalHistoryQuestionSDto> p10)
|
private static List<MedicalHistoryQuestion> funcMain1(List<MedicalHistoryQuestionSDto> p10)
|
||||||
|
@ -163,20 +218,36 @@ namespace DocuMed.Domain.Mappers
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static List<MedicalHistoryQuestion> funcMain2(List<MedicalHistoryQuestionSDto> p13, List<MedicalHistoryQuestion> p14)
|
private static Section funcMain2(SectionSDto p13, Section p14)
|
||||||
{
|
{
|
||||||
if (p13 == null)
|
if (p13 == null)
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
List<MedicalHistoryQuestion> result = new List<MedicalHistoryQuestion>(p13.Count);
|
Section result = p14 ?? new Section();
|
||||||
|
|
||||||
|
result.Name = p13.Name;
|
||||||
|
result.Detail = p13.Detail;
|
||||||
|
result.UniversityId = p13.UniversityId;
|
||||||
|
result.Id = p13.Id;
|
||||||
|
return result;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private static List<MedicalHistoryQuestion> funcMain3(List<MedicalHistoryQuestionSDto> p15, List<MedicalHistoryQuestion> p16)
|
||||||
|
{
|
||||||
|
if (p15 == null)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
List<MedicalHistoryQuestion> result = new List<MedicalHistoryQuestion>(p15.Count);
|
||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
int len = p13.Count;
|
int len = p15.Count;
|
||||||
|
|
||||||
while (i < len)
|
while (i < len)
|
||||||
{
|
{
|
||||||
MedicalHistoryQuestionSDto item = p13[i];
|
MedicalHistoryQuestionSDto item = p15[i];
|
||||||
result.Add(item == null ? null : new MedicalHistoryQuestion()
|
result.Add(item == null ? null : new MedicalHistoryQuestion()
|
||||||
{
|
{
|
||||||
Question = item.Question,
|
Question = item.Question,
|
||||||
|
@ -191,20 +262,20 @@ namespace DocuMed.Domain.Mappers
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static List<MedicalHistoryQuestionSDto> funcMain3(List<MedicalHistoryQuestion> p18)
|
private static List<MedicalHistoryQuestionSDto> funcMain4(List<MedicalHistoryQuestion> p20)
|
||||||
{
|
{
|
||||||
if (p18 == null)
|
if (p20 == null)
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
List<MedicalHistoryQuestionSDto> result = new List<MedicalHistoryQuestionSDto>(p18.Count);
|
List<MedicalHistoryQuestionSDto> result = new List<MedicalHistoryQuestionSDto>(p20.Count);
|
||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
int len = p18.Count;
|
int len = p20.Count;
|
||||||
|
|
||||||
while (i < len)
|
while (i < len)
|
||||||
{
|
{
|
||||||
MedicalHistoryQuestion item = p18[i];
|
MedicalHistoryQuestion item = p20[i];
|
||||||
result.Add(item == null ? null : new MedicalHistoryQuestionSDto()
|
result.Add(item == null ? null : new MedicalHistoryQuestionSDto()
|
||||||
{
|
{
|
||||||
Question = item.Question,
|
Question = item.Question,
|
||||||
|
@ -219,20 +290,36 @@ namespace DocuMed.Domain.Mappers
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static List<MedicalHistoryQuestionSDto> funcMain4(List<MedicalHistoryQuestion> p21, List<MedicalHistoryQuestionSDto> p22)
|
private static SectionSDto funcMain5(Section p23, SectionSDto p24)
|
||||||
{
|
{
|
||||||
if (p21 == null)
|
if (p23 == null)
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
List<MedicalHistoryQuestionSDto> result = new List<MedicalHistoryQuestionSDto>(p21.Count);
|
SectionSDto result = p24 ?? new SectionSDto();
|
||||||
|
|
||||||
|
result.Name = p23.Name;
|
||||||
|
result.Detail = p23.Detail;
|
||||||
|
result.UniversityId = p23.UniversityId;
|
||||||
|
result.Id = p23.Id;
|
||||||
|
return result;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private static List<MedicalHistoryQuestionSDto> funcMain6(List<MedicalHistoryQuestion> p25, List<MedicalHistoryQuestionSDto> p26)
|
||||||
|
{
|
||||||
|
if (p25 == null)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
List<MedicalHistoryQuestionSDto> result = new List<MedicalHistoryQuestionSDto>(p25.Count);
|
||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
int len = p21.Count;
|
int len = p25.Count;
|
||||||
|
|
||||||
while (i < len)
|
while (i < len)
|
||||||
{
|
{
|
||||||
MedicalHistoryQuestion item = p21[i];
|
MedicalHistoryQuestion item = p25[i];
|
||||||
result.Add(item == null ? null : new MedicalHistoryQuestionSDto()
|
result.Add(item == null ? null : new MedicalHistoryQuestionSDto()
|
||||||
{
|
{
|
||||||
Question = item.Question,
|
Question = item.Question,
|
||||||
|
|
|
@ -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 SectionMapper
|
||||||
|
{
|
||||||
|
public static Section AdaptToSection(this SectionSDto p1)
|
||||||
|
{
|
||||||
|
return p1 == null ? null : new Section()
|
||||||
|
{
|
||||||
|
Name = p1.Name,
|
||||||
|
Detail = p1.Detail,
|
||||||
|
UniversityId = p1.UniversityId,
|
||||||
|
Id = p1.Id
|
||||||
|
};
|
||||||
|
}
|
||||||
|
public static Section AdaptTo(this SectionSDto p2, Section p3)
|
||||||
|
{
|
||||||
|
if (p2 == null)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
Section result = p3 ?? new Section();
|
||||||
|
|
||||||
|
result.Name = p2.Name;
|
||||||
|
result.Detail = p2.Detail;
|
||||||
|
result.UniversityId = p2.UniversityId;
|
||||||
|
result.Id = p2.Id;
|
||||||
|
return result;
|
||||||
|
|
||||||
|
}
|
||||||
|
public static Expression<Func<SectionSDto, Section>> ProjectToSection => p4 => new Section()
|
||||||
|
{
|
||||||
|
Name = p4.Name,
|
||||||
|
Detail = p4.Detail,
|
||||||
|
UniversityId = p4.UniversityId,
|
||||||
|
Id = p4.Id
|
||||||
|
};
|
||||||
|
public static SectionSDto AdaptToSDto(this Section p5)
|
||||||
|
{
|
||||||
|
return p5 == null ? null : new SectionSDto()
|
||||||
|
{
|
||||||
|
Name = p5.Name,
|
||||||
|
Detail = p5.Detail,
|
||||||
|
UniversityId = p5.UniversityId,
|
||||||
|
Id = p5.Id
|
||||||
|
};
|
||||||
|
}
|
||||||
|
public static SectionSDto AdaptTo(this Section p6, SectionSDto p7)
|
||||||
|
{
|
||||||
|
if (p6 == null)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
SectionSDto result = p7 ?? new SectionSDto();
|
||||||
|
|
||||||
|
result.Name = p6.Name;
|
||||||
|
result.Detail = p6.Detail;
|
||||||
|
result.UniversityId = p6.UniversityId;
|
||||||
|
result.Id = p6.Id;
|
||||||
|
return result;
|
||||||
|
|
||||||
|
}
|
||||||
|
public static Expression<Func<Section, SectionSDto>> ProjectToSDto => p8 => new SectionSDto()
|
||||||
|
{
|
||||||
|
Name = p8.Name,
|
||||||
|
Detail = p8.Detail,
|
||||||
|
UniversityId = p8.UniversityId,
|
||||||
|
Id = p8.Id
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
|
@ -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>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Blazored.LocalStorage" Version="4.4.0" />
|
||||||
<PackageReference Include="Blazorise.LottieAnimation" Version="1.3.1" />
|
<PackageReference Include="Blazorise.LottieAnimation" Version="1.3.1" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.0.10" />
|
<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="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="7.0.10" PrivateAssets="all" />
|
||||||
<PackageReference Include="MudBlazor" Version="6.10.0" />
|
<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" />
|
<PackageReference Include="Toolbelt.Blazor.PWA.Updater" Version="2.1.0.1" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
@ -25,6 +30,7 @@
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Folder Include="Models\ItemModels\" />
|
<Folder Include="Models\ItemModels\" />
|
||||||
|
<Folder Include="Helpers\" />
|
||||||
<Folder Include="wwwroot\assets\lotties\" />
|
<Folder Include="wwwroot\assets\lotties\" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
@ -33,9 +39,31 @@
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Using Include="Blazored.LocalStorage" />
|
||||||
|
<Using Include="DocuMed.Common.Extensions" />
|
||||||
|
<Using Include="DocuMed.Common.Models.Api" />
|
||||||
|
<Using Include="DocuMed.Domain.Dtos.LargDtos" />
|
||||||
|
<Using Include="DocuMed.Domain.Dtos.RequestDtos" />
|
||||||
|
<Using Include="DocuMed.Domain.Dtos.SmallDtos" />
|
||||||
|
<Using Include="DocuMed.Domain.Entities.City" />
|
||||||
|
<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" />
|
||||||
<Using Include="DocuMed.PWA.Models.Entities" />
|
<Using Include="DocuMed.PWA.Models.Api" />
|
||||||
<Using Include="DocuMed.PWA.Models.Enums" />
|
<Using Include="DocuMed.PWA.Services.RestServices" />
|
||||||
|
<Using Include="DocuMed.PWA.Utilities" />
|
||||||
|
<Using Include="Microsoft.AspNetCore.Components" />
|
||||||
|
<Using Include="Microsoft.AspNetCore.Components.Web" />
|
||||||
|
<Using Include="Microsoft.AspNetCore.Components.WebAssembly.Hosting" />
|
||||||
|
<Using Include="Microsoft.IdentityModel.Tokens" />
|
||||||
|
<Using Include="MudBlazor" />
|
||||||
|
<Using Include="MudBlazor.Services" />
|
||||||
|
<Using Include="Refit" />
|
||||||
|
<Using Include="System.Reflection" />
|
||||||
|
<Using Include="Toolbelt.Blazor.Extensions.DependencyInjection" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
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";
|
||||||
|
public const string SectionController = $"{BaseAddress}/section";
|
||||||
|
public const string UserController = $"{BaseAddress}/user";
|
||||||
|
public const string MedicalHistoryTemplateController = $"{BaseAddress}/medicalhistory/template";
|
||||||
|
}
|
|
@ -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; }
|
||||||
|
}
|
|
@ -0,0 +1,33 @@
|
||||||
|
namespace DocuMed.PWA.Models;
|
||||||
|
|
||||||
|
public class BaseViewModel
|
||||||
|
{
|
||||||
|
public bool IsProcessing { get; set; } = false;
|
||||||
|
|
||||||
|
public virtual void Initialize()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
public virtual Task InitializeAsync()
|
||||||
|
{
|
||||||
|
return Task.CompletedTask;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class BaseViewModel<TPageDto>
|
||||||
|
{
|
||||||
|
public bool IsProcessing { get; set; } = false;
|
||||||
|
public TPageDto PageDto { get; set; }
|
||||||
|
public BaseViewModel()
|
||||||
|
{
|
||||||
|
PageDto = Activator.CreateInstance<TPageDto>();
|
||||||
|
}
|
||||||
|
public virtual void Initialize()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
public virtual Task InitializeAsync()
|
||||||
|
{
|
||||||
|
return Task.CompletedTask;
|
||||||
|
}
|
||||||
|
}
|
|
@ -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,7 @@
|
||||||
|
namespace DocuMed.PWA.Models;
|
||||||
|
|
||||||
|
public static class LocalStorageKeys
|
||||||
|
{
|
||||||
|
public const string Token = nameof(Token);
|
||||||
|
public const string UserInfo = nameof(UserInfo);
|
||||||
|
}
|
|
@ -1,5 +1,6 @@
|
||||||
@page "/HomePage"
|
@page "/HomePage"
|
||||||
@inject NavigationManager NavigationManager
|
@inject NavigationManager NavigationManager
|
||||||
|
@inject IUserUtility UserUtility
|
||||||
|
|
||||||
|
|
||||||
<MudStack class="w-screen h-screen bg-[#356859]">
|
<MudStack class="w-screen h-screen bg-[#356859]">
|
||||||
|
@ -11,8 +12,8 @@
|
||||||
</MudImage>
|
</MudImage>
|
||||||
</MudAvatar>
|
</MudAvatar>
|
||||||
<MudStack class="justify-center ">
|
<MudStack class="justify-center ">
|
||||||
<p class="font-bold text-lg text-white font-iranyekan">امیرحسین خادمی</p>
|
<p class="font-bold text-lg text-white font-iranyekan">@ViewModel?.User.FullName</p>
|
||||||
<p class="-mt-3 text-white font-light font-iranyekan">09214802813</p>
|
<p class="-mt-3 text-white font-light font-iranyekan">@ViewModel?.User.PhoneNumber</p>
|
||||||
</MudStack>
|
</MudStack>
|
||||||
</MudStack>
|
</MudStack>
|
||||||
<MudButton class="my-auto ml-5 mr-auto font-extrabold bg-white rounded-lg">اطفال</MudButton>
|
<MudButton class="my-auto ml-5 mr-auto font-extrabold bg-white rounded-lg">اطفال</MudButton>
|
||||||
|
@ -28,7 +29,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="grid grid-cols-1 md:grid-cols-2 xl:grid-cols-2 ">
|
<div class="grid grid-cols-1 md:grid-cols-2 xl:grid-cols-2 ">
|
||||||
@foreach(var item in _medicalHistories)
|
@foreach (var item in @ViewModel.MedicalHistories)
|
||||||
{
|
{
|
||||||
<MedicalHistoryItemTemplate MedicalHistory="@item" />
|
<MedicalHistoryItemTemplate MedicalHistory="@item" />
|
||||||
}
|
}
|
||||||
|
@ -74,65 +75,22 @@
|
||||||
</MudStack>
|
</MudStack>
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
|
|
||||||
|
private HomePageViewModel? ViewModel { get; set; }
|
||||||
|
|
||||||
public void ProfileClicked() => NavigationManager.NavigateTo("ProfilePage");
|
public void ProfileClicked() => NavigationManager.NavigateTo("ProfilePage");
|
||||||
|
|
||||||
public void CreateMedicalHistoryClicked() => NavigationManager.NavigateTo("MedicalHistoryActionPage");
|
public void CreateMedicalHistoryClicked() => NavigationManager.NavigateTo("MedicalHistoryActionPage");
|
||||||
|
|
||||||
public void MedicalHistoryTemplatesClicked() => NavigationManager.NavigateTo("MedicalHistoryTemplatesPage");
|
public void MedicalHistoryTemplatesClicked() => NavigationManager.NavigateTo("MedicalHistoryTemplatesPage");
|
||||||
|
|
||||||
public void MedicalOrdersClicked() => NavigationManager.NavigateTo("MedicalOrdersPage");
|
public void MedicalOrdersClicked() => NavigationManager.NavigateTo("MedicalOrdersPage");
|
||||||
|
|
||||||
private List<MedicalHistory> _medicalHistories = new List<MedicalHistory>();
|
protected override async Task OnInitializedAsync()
|
||||||
protected override void OnInitialized()
|
|
||||||
{
|
{
|
||||||
_medicalHistories.Add(new MedicalHistory
|
ViewModel = new HomePageViewModel(UserUtility);
|
||||||
{
|
await ViewModel.InitializeAsync();
|
||||||
Name = "امیرحسین معتمدی",
|
await base.OnInitializedAsync();
|
||||||
Aag = 35,
|
|
||||||
CC = "سردرد",
|
|
||||||
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
|
|
||||||
{
|
|
||||||
Name = "سعید سعیدی",
|
|
||||||
Aag = 60,
|
|
||||||
CC = "بی هوشی",
|
|
||||||
Section = "داخلی",
|
|
||||||
Gender = Gender.Male
|
|
||||||
});
|
|
||||||
base.OnInitialized();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -0,0 +1,62 @@
|
||||||
|
namespace DocuMed.PWA.Pages;
|
||||||
|
|
||||||
|
public class HomePageViewModel : BaseViewModel
|
||||||
|
{
|
||||||
|
private readonly IUserUtility _userUtility;
|
||||||
|
|
||||||
|
public HomePageViewModel(IUserUtility userUtility)
|
||||||
|
{
|
||||||
|
_userUtility = userUtility;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<MedicalHistorySDto> MedicalHistories { get; private set; } = new List<MedicalHistorySDto>();
|
||||||
|
public ApplicationUserSDto User { get; private set; } = new ApplicationUserSDto();
|
||||||
|
|
||||||
|
public override async Task InitializeAsync()
|
||||||
|
{
|
||||||
|
User = await _userUtility.GetUserAsync();
|
||||||
|
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 = "داخلی",
|
||||||
|
});
|
||||||
|
MedicalHistories.Add(new MedicalHistorySDto
|
||||||
|
{
|
||||||
|
FirstName = "امیرحسین ",
|
||||||
|
LastName = "معتمدی",
|
||||||
|
Age = 35,
|
||||||
|
ChiefComplaint = "سردرد",
|
||||||
|
Section = "داخلی",
|
||||||
|
});
|
||||||
|
MedicalHistories.Add(new MedicalHistorySDto
|
||||||
|
{
|
||||||
|
FirstName = "امیرحسین ",
|
||||||
|
LastName = "معتمدی",
|
||||||
|
Age = 35,
|
||||||
|
ChiefComplaint = "سردرد",
|
||||||
|
Section = "داخلی",
|
||||||
|
});
|
||||||
|
|
||||||
|
await base.InitializeAsync();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,5 +1,10 @@
|
||||||
@page "/"
|
@page "/"
|
||||||
@inject NavigationManager NavigationManager
|
@inject NavigationManager NavigationManager
|
||||||
|
@inject IRestWrapper RestWrapper
|
||||||
|
@inject ISnackbar Snackbar
|
||||||
|
@inject ILocalStorageService LocalStorage
|
||||||
|
@inject IUserUtility UserUtility
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.mud-input-label {
|
.mud-input-label {
|
||||||
background-color: #FFFBE6;
|
background-color: #FFFBE6;
|
||||||
|
@ -19,16 +24,19 @@
|
||||||
<div class="flex flex-col h-full mx-5">
|
<div class="flex flex-col h-full mx-5">
|
||||||
<div class="my-auto">
|
<div class="my-auto">
|
||||||
<div class="-mt-8">
|
<div class="-mt-8">
|
||||||
<dotlottie-player
|
<dotlottie-player src="https://lottie.host/752358b3-21b0-4448-b8f4-0f2a2acc998b/DZAZuyYyol.json"
|
||||||
src="https://lottie.host/752358b3-21b0-4448-b8f4-0f2a2acc998b/DZAZuyYyol.json"
|
|
||||||
background="transparent" speed="1" class="m-auto w-60 h-60" loop autoplay />
|
background="transparent" speed="1" class="m-auto w-60 h-60" loop autoplay />
|
||||||
</div>
|
</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>
|
||||||
</div>
|
</div>
|
||||||
</MudCarouselItem>
|
</MudCarouselItem>
|
||||||
|
@ -36,15 +44,18 @@
|
||||||
<div class="flex flex-col h-full mx-5">
|
<div class="flex flex-col h-full mx-5">
|
||||||
<div class="my-auto">
|
<div class="my-auto">
|
||||||
<div class="-mt-8 -mb-3">
|
<div class="-mt-8 -mb-3">
|
||||||
<dotlottie-player
|
<dotlottie-player src="https://lottie.host/9ca6089d-388f-4eef-8050-8181c1d945a1/B7oM9NN9O4.json"
|
||||||
src="https://lottie.host/9ca6089d-388f-4eef-8050-8181c1d945a1/B7oM9NN9O4.json"
|
|
||||||
background="transparent" speed="1" class="m-auto w-60 h-60" loop autoplay />
|
background="transparent" speed="1" class="m-auto w-60 h-60" loop autoplay />
|
||||||
</div>
|
</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>
|
||||||
</div>
|
</div>
|
||||||
</MudCarouselItem>
|
</MudCarouselItem>
|
||||||
|
@ -52,15 +63,17 @@
|
||||||
<div class="flex flex-col h-full mx-5">
|
<div class="flex flex-col h-full mx-5">
|
||||||
<div class="my-auto">
|
<div class="my-auto">
|
||||||
<div class="-mt-8 -mb-10">
|
<div class="-mt-8 -mb-10">
|
||||||
<dotlottie-player
|
<dotlottie-player src="https://lottie.host/87dfb50f-e91f-45c6-b8dc-d3a2436c533c/5DPvXG0W1t.json"
|
||||||
src="https://lottie.host/87dfb50f-e91f-45c6-b8dc-d3a2436c533c/5DPvXG0W1t.json"
|
|
||||||
background="transparent" speed="1" class="m-auto w-72 h-72" loop autoplay />
|
background="transparent" speed="1" class="m-auto w-72 h-72" loop autoplay />
|
||||||
</div>
|
</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>
|
||||||
<p class="mx-auto text-xs text-center font-iranyekan">نرم افزار داکیومد با امکانات بسیار زیاد
|
<p class="mx-auto text-xs text-center font-iranyekan">
|
||||||
|
نرم افزار داکیومد با امکانات بسیار زیاد
|
||||||
خود
|
خود
|
||||||
مثل تهیه پیشنویس شرح حال همراه همیشگی پزشکان محترم</p>
|
مثل تهیه پیشنویس شرح حال همراه همیشگی پزشکان محترم
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</MudCarouselItem>
|
</MudCarouselItem>
|
||||||
|
@ -78,12 +91,12 @@
|
||||||
وارد کنید
|
وارد کنید
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<MudForm @ref="confirmPhoneNumberForm">
|
<MudForm @ref="_confirmPhoneNumberForm">
|
||||||
<MudTextField Required="true" RequiredError="لطفا شماره تلفن را وارد کنید"
|
<MudTextField Required="true" RequiredError="لطفا شماره تلفن را وارد کنید"
|
||||||
@bind-Value="@phoneNumber" InputType="InputType.Telephone" T="string" Label="شماره تلفن همراه"
|
@bind-Value="@_phoneNumber" InputType="InputType.Telephone" T="string" Label="شماره تلفن همراه"
|
||||||
Variant="Variant.Outlined" />
|
Variant="Variant.Outlined" />
|
||||||
</MudForm>
|
</MudForm>
|
||||||
<BaseButtonUi OnClickCallback="ConfirmPhoneNumber" Content="ثبت شماره تلفن"
|
<BaseButtonUi IsProcessing="_isProcessing" OnClickCallback="ConfirmPhoneNumber" Content="ثبت شماره تلفن"
|
||||||
Icon="@Icons.Material.TwoTone.Phone" Color="Color.Secondary" Variant="Variant.Filled">
|
Icon="@Icons.Material.TwoTone.Phone" Color="Color.Secondary" Variant="Variant.Filled">
|
||||||
</BaseButtonUi>
|
</BaseButtonUi>
|
||||||
<p class="mx-3 text-justify">
|
<p class="mx-3 text-justify">
|
||||||
|
@ -105,10 +118,10 @@
|
||||||
وارد کنید
|
وارد کنید
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<MudTextField class="text-sm" T="string" Label="کد ارسال شده را وارد کنید"
|
<MudTextField class="text-sm" T="string" InputType="InputType.Telephone" @bind-Value="@_verifyCode" Label="کد ارسال شده را وارد کنید"
|
||||||
Variant="Variant.Outlined" />
|
Variant="Variant.Outlined" />
|
||||||
|
|
||||||
<BaseButtonUi OnClickCallback="ConfirmVerifyCode" Content="تایید کد"
|
<BaseButtonUi IsProcessing="_isProcessing" OnClickCallback="ConfirmVerifyCode" Content="تایید کد"
|
||||||
Icon="@Icons.Material.TwoTone.Verified" Color="Color.Secondary" Variant="Variant.Filled">
|
Icon="@Icons.Material.TwoTone.Verified" Color="Color.Secondary" Variant="Variant.Filled">
|
||||||
</BaseButtonUi>
|
</BaseButtonUi>
|
||||||
|
|
||||||
|
@ -131,18 +144,55 @@
|
||||||
<div class="flex flex-col h-full">
|
<div class="flex flex-col h-full">
|
||||||
<MudStack class="w-screen p-5 my-auto font-iranyekan">
|
<MudStack class="w-screen p-5 my-auto font-iranyekan">
|
||||||
<p class="text-lg font-extrabold font-iranyekan">ثبت نام</p>
|
<p class="text-lg font-extrabold font-iranyekan">ثبت نام</p>
|
||||||
<p class="text-xs text-justify">برای ثبت نام به اپلیکیشن داکیومد باید اطلاعات کامل خود را وارد
|
<p class="text-xs text-justify">
|
||||||
|
برای ثبت نام به اپلیکیشن داکیومد باید اطلاعات کامل خود را وارد
|
||||||
کنید
|
کنید
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<MudTextField class="text-sm" T="string" Label="نام" Variant="Variant.Outlined" />
|
<MudForm @ref="_confirmSignUpForm">
|
||||||
<MudTextField class="text-sm" T="string" Label="نام خانوادگی" Variant="Variant.Outlined" />
|
<MudTextField Required="true" RequiredError="نام خود را وارد کنید" @bind-Value="@_signUpRequest.FirstName" class="text-sm my-5" T="string" Label="نام" Variant="Variant.Outlined" />
|
||||||
<MudTextField class="text-sm" T="string" @bind-Value="@phoneNumber" Label="شماره تلفن همراه"
|
<MudTextField Required="true" RequiredError="نام خانوادگی خود را وارد کنید" @bind-Value="@_signUpRequest.LastName" class="text-sm my-5" T="string" Label="نام خانوادگی" Variant="Variant.Outlined" />
|
||||||
|
<MudTextField class="text-sm my-5" T="string" @bind-Value="@_phoneNumber" Label="شماره تلفن همراه"
|
||||||
Variant="Variant.Outlined" />
|
Variant="Variant.Outlined" />
|
||||||
<MudAutocomplete T="string" Label="شهر شما" Variant="Variant.Outlined" />
|
|
||||||
<MudAutocomplete T="string" Label="دانشگاه" Variant="Variant.Outlined" />
|
|
||||||
|
|
||||||
<BaseButtonUi OnClickCallback="ConfirmSignUp" Content="تکمیل ثبت نام"
|
<MudAutocomplete ToStringFunc="dto => dto.Name" class="my-5" @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>
|
||||||
|
|
||||||
|
<MudAutocomplete ToStringFunc="dto => dto.Name" class="my-5" @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">
|
Icon="@Icons.Material.TwoTone.Login" Color="Color.Primary" Variant="Variant.Filled">
|
||||||
</BaseButtonUi>
|
</BaseButtonUi>
|
||||||
</MudStack>
|
</MudStack>
|
||||||
|
@ -154,29 +204,188 @@
|
||||||
|
|
||||||
@code
|
@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 MudCarousel<object>? _carousel;
|
||||||
private int _currentSignOnStep = 0;
|
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;
|
protected override async Task OnInitializedAsync()
|
||||||
|
|
||||||
private void ConfirmPhoneNumber()
|
|
||||||
{
|
{
|
||||||
confirmPhoneNumberForm?.Validate();
|
var token = await UserUtility.GetBearerTokenAsync();
|
||||||
if (confirmPhoneNumberForm != null && confirmPhoneNumberForm.IsValid)
|
if (!token.IsNullOrEmpty())
|
||||||
|
{
|
||||||
|
var user = await UserUtility.GetUserAsync();
|
||||||
|
if (user.SignUpStatus == SignUpStatus.SignUpCompleted)
|
||||||
|
NavigationManager.NavigateTo("HomePage");
|
||||||
|
if(user.SignUpStatus==SignUpStatus.PhoneNumberVerified)
|
||||||
|
{
|
||||||
|
_phoneNumber = user.PhoneNumber;
|
||||||
|
_currentSignOnStep = 2;
|
||||||
|
_carousel?.MoveTo(_currentSignOnStep);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
await base.OnInitializedAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task ConfirmPhoneNumber()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
_confirmPhoneNumberForm?.Validate();
|
||||||
|
if (_confirmPhoneNumberForm is { IsValid: true })
|
||||||
|
{
|
||||||
|
_isProcessing = true;
|
||||||
|
_signUpStatus = await RestWrapper.AuthRestApi.GetVerifyCodeAsync(_phoneNumber);
|
||||||
_carousel?.MoveTo(++_currentSignOnStep);
|
_carousel?.MoveTo(++_currentSignOnStep);
|
||||||
}
|
}
|
||||||
private void ConfirmVerifyCode()
|
}
|
||||||
|
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 ConfirmVerifyCode()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
_isProcessing = true;
|
||||||
|
var rest = await RestWrapper.AuthRestApi.LoginWithVerifyCodeAsync(new LoginRequestDto { UserName = _phoneNumber, VerifyCode = _verifyCode });
|
||||||
|
await UserUtility.SetBearerTokenAsync(rest.BearerToken);
|
||||||
|
await UserUtility.SetUserAsync(rest.User);
|
||||||
|
if (_signUpStatus == SignUpStatus.SignUpCompleted)
|
||||||
|
NavigationManager.NavigateTo("HomePage");
|
||||||
|
else
|
||||||
_carousel?.MoveTo(++_currentSignOnStep);
|
_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()
|
private void PhoneNumberRollBack()
|
||||||
{
|
{
|
||||||
_carousel?.MoveTo(--_currentSignOnStep);
|
_carousel?.MoveTo(--_currentSignOnStep);
|
||||||
}
|
}
|
||||||
private void ConfirmSignUp()
|
private async Task ConfirmSignUp()
|
||||||
{
|
{
|
||||||
|
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);
|
||||||
|
await UserUtility.SetUserAsync(rest.User);
|
||||||
NavigationManager.NavigateTo("HomePage");
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
namespace DocuMed.PWA.Pages;
|
||||||
|
|
||||||
|
public class IndexViewModel
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
|
@ -1,88 +1,111 @@
|
||||||
@page "/MedicalHistoryTemplateActionPage"
|
@page "/MedicalHistoryTemplateActionPage"
|
||||||
|
@page "/MedicalHistoryTemplateActionPage/{TemplateId}"
|
||||||
@inject NavigationManager NavigationManager
|
@inject NavigationManager NavigationManager
|
||||||
|
@inject IRestWrapper RestWrapper
|
||||||
|
@inject IUserUtility UserUtility
|
||||||
|
@inject ISnackbar Snackbar
|
||||||
|
|
||||||
<BasePageUi Title="افزودن یک شرحال جدید" Description="لطفا اطلاعات بیمار را با دقت کامل وارد کنید">
|
<BasePageUi Title="افزودن یک شرحال جدید" Description="لطفا اطلاعات بیمار را با دقت کامل وارد کنید">
|
||||||
|
|
||||||
<div class="flex flex-col w-full h-full rounded-t-xl">
|
<div class="flex flex-col w-full h-full rounded-t-xl">
|
||||||
|
|
||||||
<MudCarousel class="w-full h-full overflow-x-hidden overflow-y-scroll" @ref="_carousel" ShowArrows="false"
|
<MudCarousel class="w-full h-full overflow-x-hidden overflow-y-scroll" @ref="@ViewModel.Carousel" ShowArrows="false"
|
||||||
ShowBullets="false" EnableSwipeGesture="false" AutoCycle="false" TData="object">
|
ShowBullets="false" EnableSwipeGesture="false" AutoCycle="false" TData="object">
|
||||||
|
|
||||||
<MudCarouselItem>
|
<MudCarouselItem>
|
||||||
<div class="flex flex-col w-full h-full">
|
<div class="flex flex-col w-full h-full">
|
||||||
<MedicalHistoryTemplateActionStep1 />
|
<MedicalHistoryTemplateActionStep1 @bind-ChiefComplaint="@ViewModel.PageDto.ChiefComplaint" @bind-SelectedSection="@ViewModel.SelectedSelection" />
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</MudCarouselItem>
|
</MudCarouselItem>
|
||||||
<MudCarouselItem>
|
<MudCarouselItem>
|
||||||
<div class="flex flex-col h-full">
|
<div class="flex flex-col h-full">
|
||||||
<MedicalHistoryTemplateActionStep2 />
|
<MedicalHistoryTemplateActionStep2 PiQuestions="@ViewModel.PiQuestions" />
|
||||||
</div>
|
</div>
|
||||||
</MudCarouselItem>
|
</MudCarouselItem>
|
||||||
<MudCarouselItem>
|
<MudCarouselItem>
|
||||||
<div class="flex flex-col h-full">
|
<div class="flex flex-col h-full">
|
||||||
<MedicalHistoryTemplateActionStep3 />
|
<MedicalHistoryTemplateActionStep3 PdhQuestions="@ViewModel.PdhQuestions" PshQuestions="@ViewModel.PshQuestions" />
|
||||||
</div>
|
</div>
|
||||||
</MudCarouselItem>
|
</MudCarouselItem>
|
||||||
<MudCarouselItem>
|
<MudCarouselItem>
|
||||||
<div class="flex flex-col h-full">
|
<div class="flex flex-col h-full">
|
||||||
<MedicalHistoryTemplateActionStep4 />
|
<MedicalHistoryTemplateActionStep4 FamilyHistories="@ViewModel.FhQuestions" DrugHistories="@ViewModel.DhQuestions" AhMedicines="@ViewModel.AhQuestions" />
|
||||||
</div>
|
</div>
|
||||||
</MudCarouselItem>
|
</MudCarouselItem>
|
||||||
<MudCarouselItem>
|
<MudCarouselItem>
|
||||||
<div class="flex flex-col h-full">
|
<div class="flex flex-col h-full">
|
||||||
<MedicalHistoryTemplateActionStep5 />
|
<MedicalHistoryTemplateActionStep5 VitalSigns="@ViewModel.VsQuestions" />
|
||||||
</div>
|
</div>
|
||||||
</MudCarouselItem>
|
</MudCarouselItem>
|
||||||
<MudCarouselItem>
|
<MudCarouselItem>
|
||||||
<div class="flex flex-col h-full">
|
<div class="flex flex-col h-full">
|
||||||
<MedicalHistoryTemplateActionStep6 SubmittedOnClick="CompleteCreateMedicalHistory" />
|
<MedicalHistoryTemplateActionStep6 SubmittedOnClick="@ViewModel.SubmitCreateTemplateAsync" />
|
||||||
</div>
|
</div>
|
||||||
</MudCarouselItem>
|
</MudCarouselItem>
|
||||||
</MudCarousel>
|
</MudCarousel>
|
||||||
|
|
||||||
@if(!medicalHistorySubmited){
|
@if (!@ViewModel.MedicalHistorySubmitted)
|
||||||
|
{
|
||||||
|
if (@ViewModel.IsProcessing)
|
||||||
|
{
|
||||||
<MudPaper class="bottom-0 left-0 fixed w-full bg-gray-700 px-3 pt-4 pb-3 rou nded-t-xl flex flex-row">
|
<MudPaper class="bottom-0 left-0 fixed w-full bg-gray-700 px-3 pt-4 pb-3 rou nded-t-xl flex flex-row">
|
||||||
|
|
||||||
@if (_currentStep == 4)
|
<div class="flex flex-row w-full mx-auto">
|
||||||
{
|
<MudProgressCircular class="my-auto mr-1 -ml-4" Size="Size.Small" Color="Color.Warning" Indeterminate="true" />
|
||||||
<MudButton @onclick="CompleteStepClicked" Variant="Variant.Filled" IconSize="Size.Large" StartIcon="@Icons.Material.Filled.ChevronRight" class="font-extrabold rounded-full bg-[--color-medicalhistory]">تـــکمیل</MudButton>
|
<p class="font-extrabold my-0 mr-7 text-lg text-[--color-medicalhistory]">منتظر بمانید</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</MudPaper>
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
<MudButton @onclick="CompleteStepClicked" Variant="Variant.Outlined" IconSize="Size.Large"
|
<MudPaper class="bottom-0 left-0 fixed w-full bg-gray-700 px-3 pt-4 pb-3 rounded-t-xl flex flex-row">
|
||||||
|
|
||||||
|
@if (@ViewModel.CurrentStep == 4)
|
||||||
|
{
|
||||||
|
@if (@ViewModel.IsEditing)
|
||||||
|
{
|
||||||
|
<MudButton @onclick="@ViewModel.CompleteStepClicked" Variant="Variant.Filled"
|
||||||
|
IconSize="Size.Large" StartIcon="@Icons.Material.Filled.ChevronRight"
|
||||||
|
class="font-extrabold rounded-full bg-[--color-medicalhistory]">تـــکمیل</MudButton>
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<MudButton @onclick="@ViewModel.CompleteStepClicked" Variant="Variant.Filled"
|
||||||
|
IconSize="Size.Large" StartIcon="@Icons.Material.Filled.ChevronRight"
|
||||||
|
class="font-extrabold rounded-full bg-[--color-medicalhistory]">ویرایش</MudButton>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<MudButton @onclick="@ViewModel.CompleteStepClicked" Variant="Variant.Outlined" IconSize="Size.Large"
|
||||||
StartIcon="@Icons.Material.Filled.ChevronRight" class="font-extrabold rounded-full border-[--color-medicalhistory] text-[--color-medicalhistory]">
|
StartIcon="@Icons.Material.Filled.ChevronRight" class="font-extrabold rounded-full border-[--color-medicalhistory] text-[--color-medicalhistory]">
|
||||||
مرحله بعد
|
مرحله بعد
|
||||||
</MudButton>
|
</MudButton>
|
||||||
}
|
}
|
||||||
|
|
||||||
<p class="my-auto text-lg text-[--color-medicalhistory] font-extrabold text-center grow">@_stepCounter</p>
|
<p class="my-auto text-lg text-[--color-medicalhistory] font-extrabold text-center grow">@ViewModel.StepCounter</p>
|
||||||
<MudButton @onclick="RollBackStepClicked" IconSize="Size.Large" EndIcon="@Icons.Material.Filled.ChevronLeft"
|
<MudButton @onclick="@ViewModel.RollBackStepClicked" IconSize="Size.Large" EndIcon="@Icons.Material.Filled.ChevronLeft"
|
||||||
class="font-extrabold text-[--color-medicalhistory] rounded-full">مرحله قبل</MudButton>
|
class="font-extrabold text-[--color-medicalhistory] rounded-full">مرحله قبل</MudButton>
|
||||||
</MudPaper>
|
</MudPaper>
|
||||||
}
|
}
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</BasePageUi>
|
</BasePageUi>
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
private MudCarousel<object>? _carousel;
|
|
||||||
private int _currentStep = 0;
|
[Parameter]
|
||||||
private string _stepCounter = "1 / 5";
|
public string TemplateId { get; set; } = string.Empty;
|
||||||
private bool medicalHistorySubmited = false;
|
public MedicalHistoryTemplateActionPageViewModel ViewModel { get; set; }
|
||||||
private void CompleteStepClicked()
|
protected override async Task OnInitializedAsync()
|
||||||
{
|
{
|
||||||
_carousel?.MoveTo(++_currentStep);
|
ViewModel = Guid.TryParse(TemplateId, out Guid templateId) ?
|
||||||
_stepCounter = string.Format("{0} / 5", _currentStep + 1);
|
new MedicalHistoryTemplateActionPageViewModel(NavigationManager, Snackbar, RestWrapper, UserUtility, templateId)
|
||||||
if (_currentStep == 5)
|
: new MedicalHistoryTemplateActionPageViewModel(NavigationManager, Snackbar, RestWrapper, UserUtility);
|
||||||
medicalHistorySubmited = true;
|
await ViewModel.InitializeAsync();
|
||||||
}
|
await base.OnInitializedAsync();
|
||||||
private void RollBackStepClicked()
|
|
||||||
{
|
|
||||||
_carousel?.MoveTo(--_currentStep);
|
|
||||||
_stepCounter = string.Format("{0} / 5", _currentStep + 1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CompleteCreateMedicalHistory()
|
|
||||||
{
|
|
||||||
NavigationManager.NavigateTo("HomePage");
|
|
||||||
}
|
|
||||||
}
|
}
|
|
@ -0,0 +1,196 @@
|
||||||
|
namespace DocuMed.PWA.Pages;
|
||||||
|
|
||||||
|
public class MedicalHistoryTemplateActionPageViewModel : BaseViewModel<MedicalHistoryTemplateLDto>
|
||||||
|
{
|
||||||
|
private readonly NavigationManager _navigationManager;
|
||||||
|
private readonly ISnackbar _snackbar;
|
||||||
|
private readonly IRestWrapper _restWrapper;
|
||||||
|
private readonly IUserUtility _userUtility;
|
||||||
|
private readonly Guid _templateId;
|
||||||
|
public MudCarousel<object>? Carousel { get; set; }
|
||||||
|
public bool MedicalHistorySubmitted { get; set; }
|
||||||
|
public int CurrentStep { get; set; } = 0;
|
||||||
|
public string StepCounter { get; set; } = "1 / 5";
|
||||||
|
public bool IsEditing { get; set; } = false;
|
||||||
|
|
||||||
|
public List<MedicalHistoryQuestionSDto> PiQuestions { get; set; } = new();
|
||||||
|
public List<MedicalHistoryQuestionSDto> PdhQuestions { get; set; } = new();
|
||||||
|
public List<MedicalHistoryQuestionSDto> PshQuestions { get; set; } = new();
|
||||||
|
public List<MedicalHistoryQuestionSDto> FhQuestions { get; set; } = new();
|
||||||
|
public List<MedicalHistoryQuestionSDto> DhQuestions { get; set; } = new();
|
||||||
|
public List<MedicalHistoryQuestionSDto> AhQuestions { get; set; } = new();
|
||||||
|
public List<MedicalHistoryQuestionSDto> VsQuestions { get; set; } = new();
|
||||||
|
public SectionSDto? SelectedSelection { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public MedicalHistoryTemplateActionPageViewModel(
|
||||||
|
NavigationManager navigationManager,
|
||||||
|
ISnackbar snackbar,
|
||||||
|
IRestWrapper restWrapper,
|
||||||
|
IUserUtility userUtility)
|
||||||
|
{
|
||||||
|
_navigationManager = navigationManager;
|
||||||
|
_snackbar = snackbar;
|
||||||
|
_restWrapper = restWrapper;
|
||||||
|
_userUtility = userUtility;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MedicalHistoryTemplateActionPageViewModel(
|
||||||
|
NavigationManager navigationManager,
|
||||||
|
ISnackbar snackbar,
|
||||||
|
IRestWrapper restWrapper,
|
||||||
|
IUserUtility userUtility,
|
||||||
|
Guid templateId)
|
||||||
|
{
|
||||||
|
_navigationManager = navigationManager;
|
||||||
|
_snackbar = snackbar;
|
||||||
|
_restWrapper = restWrapper;
|
||||||
|
_userUtility = userUtility;
|
||||||
|
_templateId = templateId;
|
||||||
|
IsEditing = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override async Task InitializeAsync()
|
||||||
|
{
|
||||||
|
if (_templateId != Guid.Empty && IsEditing)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
IsProcessing = true;
|
||||||
|
var token = await _userUtility.GetBearerTokenAsync();
|
||||||
|
var dto = await _restWrapper.CrudDtoApiRest<MedicalHistoryTemplateSDto, MedicalHistoryTemplateLDto, Guid>(Address.MedicalHistoryTemplateController)
|
||||||
|
.ReadOne(_templateId, token);
|
||||||
|
PageDto.ApplicationUserId = dto.ApplicationUserId;
|
||||||
|
PageDto.ChiefComplaint = dto.ChiefComplaint;
|
||||||
|
PageDto.SectionId = dto.SectionId;
|
||||||
|
PageDto.Id = dto.Id;
|
||||||
|
SelectedSelection = dto.Section;
|
||||||
|
PiQuestions.AddRange(dto.Questions.Where(q => q.Part == MedicalHistoryPart.PresentIllness));
|
||||||
|
PdhQuestions.AddRange(dto.Questions.Where(q => q.Part == MedicalHistoryPart.PastDiseasesHistory));
|
||||||
|
PshQuestions.AddRange(dto.Questions.Where(q => q.Part == MedicalHistoryPart.PastSurgeryHistory));
|
||||||
|
FhQuestions.AddRange(dto.Questions.Where(q => q.Part == MedicalHistoryPart.FamilyHistory));
|
||||||
|
DhQuestions.AddRange(dto.Questions.Where(q => q.Part == MedicalHistoryPart.DrugHistory));
|
||||||
|
AhQuestions.AddRange(dto.Questions.Where(q => q.Part == MedicalHistoryPart.AddictionHistory));
|
||||||
|
VsQuestions.AddRange(dto.Questions.Where(q => q.Part == MedicalHistoryPart.VitalSign));
|
||||||
|
}
|
||||||
|
catch (ApiException ex)
|
||||||
|
{
|
||||||
|
var exe = await ex.GetContentAsAsync<ApiResult>();
|
||||||
|
_snackbar.Add(exe != null ? exe.Message : ex.Content, Severity.Error);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
_snackbar.Add(e.Message, Severity.Error);
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
|
||||||
|
IsProcessing = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
await base.InitializeAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task CompleteStepClicked()
|
||||||
|
{
|
||||||
|
++CurrentStep;
|
||||||
|
StepCounter = $"{CurrentStep + 1} / 5";
|
||||||
|
if (CurrentStep == 5)
|
||||||
|
{
|
||||||
|
if (IsEditing)
|
||||||
|
await EditTemplateAsync();
|
||||||
|
else
|
||||||
|
await SubmitTemplateAsync();
|
||||||
|
MedicalHistorySubmitted = true;
|
||||||
|
}
|
||||||
|
Carousel?.MoveTo(CurrentStep);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task SubmitTemplateAsync()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
IsProcessing = true;
|
||||||
|
if (SelectedSelection == null)
|
||||||
|
throw new Exception("لطفا بخش مورد نظر را انتخاب نمایید");
|
||||||
|
PageDto.SectionId = SelectedSelection.Id;
|
||||||
|
var token = await _userUtility.GetBearerTokenAsync();
|
||||||
|
PageDto.SectionId = SelectedSelection.Id;
|
||||||
|
PageDto.Questions.AddRange(PiQuestions);
|
||||||
|
PageDto.Questions.AddRange(PdhQuestions);
|
||||||
|
PageDto.Questions.AddRange(PiQuestions);
|
||||||
|
PageDto.Questions.AddRange(PshQuestions);
|
||||||
|
PageDto.Questions.AddRange(FhQuestions);
|
||||||
|
PageDto.Questions.AddRange(DhQuestions);
|
||||||
|
PageDto.Questions.AddRange(AhQuestions);
|
||||||
|
PageDto.Questions.AddRange(VsQuestions);
|
||||||
|
await _restWrapper.CrudDtoApiRest<MedicalHistoryTemplateLDto, MedicalHistoryTemplateSDto, Guid>(Address.MedicalHistoryTemplateController)
|
||||||
|
.Create(PageDto, token);
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (ApiException ex)
|
||||||
|
{
|
||||||
|
var exe = await ex.GetContentAsAsync<ApiResult>();
|
||||||
|
_snackbar.Add(exe != null ? exe.Message : ex.Content, Severity.Error);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
_snackbar.Add(e.Message, Severity.Error);
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
|
||||||
|
IsProcessing = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task EditTemplateAsync()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
IsProcessing = true;
|
||||||
|
if (SelectedSelection == null)
|
||||||
|
throw new Exception("لطفا بخش مورد نظر را انتخاب نمایید");
|
||||||
|
PageDto.SectionId = SelectedSelection.Id;
|
||||||
|
var token = await _userUtility.GetBearerTokenAsync();
|
||||||
|
PageDto.SectionId = SelectedSelection.Id;
|
||||||
|
PageDto.Questions.AddRange(PiQuestions);
|
||||||
|
PageDto.Questions.AddRange(PdhQuestions);
|
||||||
|
PageDto.Questions.AddRange(PiQuestions);
|
||||||
|
PageDto.Questions.AddRange(PshQuestions);
|
||||||
|
PageDto.Questions.AddRange(FhQuestions);
|
||||||
|
PageDto.Questions.AddRange(DhQuestions);
|
||||||
|
PageDto.Questions.AddRange(AhQuestions);
|
||||||
|
PageDto.Questions.AddRange(VsQuestions);
|
||||||
|
await _restWrapper.CrudDtoApiRest<MedicalHistoryTemplateLDto, MedicalHistoryTemplateSDto, Guid>(Address.MedicalHistoryTemplateController)
|
||||||
|
.Update(PageDto, token);
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (ApiException ex)
|
||||||
|
{
|
||||||
|
var exe = await ex.GetContentAsAsync<ApiResult>();
|
||||||
|
_snackbar.Add(exe != null ? exe.Message : ex.Content, Severity.Error);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
_snackbar.Add(e.Message, Severity.Error);
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
|
||||||
|
IsProcessing = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void RollBackStepClicked()
|
||||||
|
{
|
||||||
|
Carousel?.MoveTo(--CurrentStep);
|
||||||
|
StepCounter = $"{CurrentStep + 1} / 5";
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SubmitCreateTemplateAsync()
|
||||||
|
{
|
||||||
|
_navigationManager.NavigateTo("HomePage");
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,13 +1,71 @@
|
||||||
|
@inject IRestWrapper RestWrapper
|
||||||
|
@inject IUserUtility UserUtility
|
||||||
<MudStack class="my-auto text-center font-iranyekan">
|
<MudStack class="my-auto text-center font-iranyekan">
|
||||||
<p class="text-lg font-extrabold">افزودن پیش نویس شرح حال جدید</p>
|
<p class="text-lg font-extrabold">افزودن پیش نویس شرح حال جدید</p>
|
||||||
<p class="text-center text-md">لورم ایپسوم متن ساختگی با تولید سادگی نامفهوم از صنعت چاپ و با استفاده از
|
<p class="text-center text-md">
|
||||||
|
لورم ایپسوم متن ساختگی با تولید سادگی نامفهوم از صنعت چاپ و با استفاده از
|
||||||
طراحان گرافیک است چاپگرها و متون بلکه روزنامه و مجله در ستون و سطرآنچنان که لازم است و برای شرایط فعلی تکنولوژی
|
طراحان گرافیک است چاپگرها و متون بلکه روزنامه و مجله در ستون و سطرآنچنان که لازم است و برای شرایط فعلی تکنولوژی
|
||||||
مورد ده</p>
|
مورد ده
|
||||||
|
</p>
|
||||||
<BasePartDivider Index="1" Title="شکایت اصلی بیمار" />
|
<BasePartDivider Index="1" Title="شکایت اصلی بیمار" />
|
||||||
<MudAutocomplete T="string" Label="شکایت اصلی بیمار ( CC )" Variant="Variant.Outlined" Margin="Margin.Normal" />
|
<MudTextField T="string" Value="@ChiefComplaint" ValueChanged="async cc => {ChiefComplaint=cc; await ChiefComplaintChanged.InvokeAsync(ChiefComplaint); }" Label="شکایت اصلی بیمار ( CC )" Variant="Variant.Outlined" Margin="Margin.Normal" />
|
||||||
<MudAutocomplete T="string" Label="بخش بیمار" Variant="Variant.Outlined" />
|
<MudAutocomplete Value="@SelectedSection" T="SectionSDto" Label="بخش بیمار" Variant="Variant.Outlined"
|
||||||
|
ToStringFunc="dto => dto.Name"
|
||||||
|
SearchFunc="@SearchSection"
|
||||||
|
ValueChanged="async dto => { SelectedSection=dto; await SelectedSectionChanged.InvokeAsync(SelectedSection); }">
|
||||||
|
|
||||||
|
<ProgressIndicatorInPopoverTemplate>
|
||||||
|
<MudList Clickable="false">
|
||||||
|
<MudListItem>
|
||||||
|
<div class="flex flex-row w-full mx-auto">
|
||||||
|
<MudProgressCircular class="my-auto mr-1 -ml-4" Size="Size.Small" Indeterminate="true" />
|
||||||
|
<p class="font-bold my-1 mx-auto text-md">منتظر بمانید</p>
|
||||||
|
</div>
|
||||||
|
</MudListItem>
|
||||||
|
</MudList>
|
||||||
|
</ProgressIndicatorInPopoverTemplate>
|
||||||
|
<ItemTemplate Context="e">
|
||||||
|
<p>@e.Name</p>
|
||||||
|
</ItemTemplate>
|
||||||
|
</MudAutocomplete>
|
||||||
</MudStack>
|
</MudStack>
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
|
[Parameter]
|
||||||
|
public string ChiefComplaint { get; set; } = string.Empty;
|
||||||
|
[Parameter]
|
||||||
|
public EventCallback<string> ChiefComplaintChanged { get; set; }
|
||||||
|
|
||||||
|
[Parameter]
|
||||||
|
public SectionSDto SelectedSection { get; set; } = new();
|
||||||
|
[Parameter]
|
||||||
|
public EventCallback<SectionSDto> SelectedSectionChanged { get; set; }
|
||||||
|
|
||||||
|
private MedicalHistoryTemplateLDto _editingTemplate = new();
|
||||||
|
|
||||||
|
public List<SectionSDto> Sections { get; private set; } = new List<SectionSDto>();
|
||||||
|
|
||||||
|
public async Task<IEnumerable<SectionSDto>> SearchSection(string section)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var token = await UserUtility.GetBearerTokenAsync();
|
||||||
|
var user = await UserUtility.GetUserAsync();
|
||||||
|
Sections = await RestWrapper.SectionRestApi.GetByUniversityAsync(user.UniversityId, token);
|
||||||
|
|
||||||
|
if (section.IsNullOrEmpty())
|
||||||
|
return Sections;
|
||||||
|
return Sections.Where(c => c.Name.Contains(section));
|
||||||
|
}
|
||||||
|
catch (ApiException ex)
|
||||||
|
{
|
||||||
|
var exe = await ex.GetContentAsAsync<ApiResult>();
|
||||||
|
return Sections;
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
return Sections;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,14 +1,15 @@
|
||||||
|
@using DocuMed.Domain.Entities.MedicalHistoryTemplate
|
||||||
<MudStack class="pb-20 font-iranyekan">
|
<MudStack class="pb-20 font-iranyekan">
|
||||||
<BasePartDivider Index="2" Title="تاریخچه بیماری فعلی ( PI )" />
|
<BasePartDivider Index="2" Title="تاریخچه بیماری فعلی ( PI )" />
|
||||||
|
|
||||||
<MudAlert Severity="Severity.Info">شما میتوانید سوال های هر بخش ها را به صورت کامل تنظیم نمایید</MudAlert>
|
<MudAlert Severity="Severity.Info">شما میتوانید سوال های هر بخش ها را به صورت کامل تنظیم نمایید</MudAlert>
|
||||||
|
|
||||||
@foreach (var item in Questions)
|
@foreach (var item in PiQuestions)
|
||||||
{
|
{
|
||||||
<MedicalHistoryQuestionTemplateItemTemplate QuestionRemoved="RemoveQuestion" />
|
<MedicalHistoryQuestionTemplateItemTemplate Question="@item" QuestionRemoved="RemoveQuestion" />
|
||||||
}
|
}
|
||||||
|
|
||||||
<MudSelect @bind-Value="@_questionType" T="MedicalHistoryQuestionType" Label="نوع سوال" Variant="Variant.Outlined">
|
<MudSelect @bind-Value="@_questionType" T="MedicalHistoryQuestionType" ToStringFunc="(e=>e.ToDisplay())" Label="نوع سوال" Variant="Variant.Outlined">
|
||||||
|
|
||||||
<MudSelectItem Value="@MedicalHistoryQuestionType.Hourly" />
|
<MudSelectItem Value="@MedicalHistoryQuestionType.Hourly" />
|
||||||
<MudSelectItem Value="@MedicalHistoryQuestionType.Interrogatively" />
|
<MudSelectItem Value="@MedicalHistoryQuestionType.Interrogatively" />
|
||||||
|
@ -16,10 +17,11 @@
|
||||||
</MudSelect>
|
</MudSelect>
|
||||||
<MudTextField @bind-Value="@_questionTitle" Margin="Margin.None" T="string" Label="عنوان سوال" Lines="1"
|
<MudTextField @bind-Value="@_questionTitle" Margin="Margin.None" T="string" Label="عنوان سوال" Lines="1"
|
||||||
Variant="Variant.Outlined" />
|
Variant="Variant.Outlined" />
|
||||||
<MudAutocomplete T="string" Label="وابستگی به سوال قبلی" Variant="Variant.Outlined" />
|
|
||||||
|
|
||||||
<MudButton @onclick="AddQuestion" Variant="Variant.Filled" IconSize="Size.Large" DisableElevation="true"
|
@* <MudAutocomplete T="string" Label="وابستگی به سوال قبلی" Variant="Variant.Outlined" /> *@
|
||||||
class="font-extrabold text-lg rounded-md py-4 bg-[--color-medicalhistory] text-gray-800">
|
|
||||||
|
<MudButton @onclick="AddQuestion" Variant="Variant.Filled" DisableElevation="true"
|
||||||
|
class="font-extrabold text-lg right-0 rounded-md py-3 bg-[--color-medicalhistory] text-gray-800">
|
||||||
+ افزودن
|
+ افزودن
|
||||||
</MudButton>
|
</MudButton>
|
||||||
|
|
||||||
|
@ -29,22 +31,24 @@
|
||||||
@code
|
@code
|
||||||
{
|
{
|
||||||
private MedicalHistoryQuestionType _questionType;
|
private MedicalHistoryQuestionType _questionType;
|
||||||
private string EnumConvertFunc() => string.Empty;
|
|
||||||
private string _questionTitle = string.Empty;
|
private string _questionTitle = string.Empty;
|
||||||
|
private MedicalHistoryPart _questionPart = MedicalHistoryPart.PresentIllness;
|
||||||
|
|
||||||
|
[Parameter]
|
||||||
|
public List<MedicalHistoryQuestionSDto> PiQuestions { get; set; } = new();
|
||||||
|
|
||||||
public List<MedicalHistoryQuestion> Questions { get; set; } = new();
|
private void RemoveQuestion(MedicalHistoryQuestionSDto question)
|
||||||
|
|
||||||
private void RemoveQuestion(MedicalHistoryQuestion question)
|
|
||||||
{
|
{
|
||||||
Questions.Remove(question);
|
PiQuestions.Remove(question);
|
||||||
}
|
}
|
||||||
private void AddQuestion()
|
private void AddQuestion()
|
||||||
{
|
{
|
||||||
Questions.Add(new MedicalHistoryQuestion
|
PiQuestions.Add(new MedicalHistoryQuestionSDto
|
||||||
{
|
{
|
||||||
Title = _questionTitle,
|
Part = _questionPart,
|
||||||
Type = _questionType
|
Question = _questionTitle,
|
||||||
|
QuestionType = _questionType
|
||||||
});
|
});
|
||||||
|
_questionTitle = string.Empty;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,34 +1,36 @@
|
||||||
|
@using DocuMed.Domain.Entities.MedicalHistoryTemplate
|
||||||
|
|
||||||
<MudStack class="pb-20 font-iranyekan">
|
<MudStack class="pb-20 font-iranyekan">
|
||||||
<BasePartDivider Index="3" Title="تاریخچه بیماری قبلی ( PI )" />
|
<BasePartDivider Index="3" Title="تاریخچه بیماری قبلی ( PI )" />
|
||||||
|
|
||||||
@foreach (var item in PIQuestions)
|
@foreach (var item in PdhQuestions)
|
||||||
{
|
{
|
||||||
<MedicalHistoryQuestionTemplateItemTemplate Question="item" QuestionRemoved="RemovePIQuestion" />
|
<MedicalHistoryQuestionTemplateItemTemplate Question="item" QuestionRemoved="RemovePiQuestion" />
|
||||||
}
|
}
|
||||||
|
|
||||||
<MudSelect @bind-Value="@_piQuestionType" T="MedicalHistoryQuestionType" Label="نوع سوال" Variant="Variant.Outlined">
|
<MudSelect @bind-Value="@_pdhQuestionType" T="MedicalHistoryQuestionType" ToStringFunc="(e=>e.ToDisplay())" Label="نوع سوال" Variant="Variant.Outlined">
|
||||||
|
|
||||||
<MudSelectItem Value="@MedicalHistoryQuestionType.Hourly" />
|
<MudSelectItem Value="@MedicalHistoryQuestionType.Hourly" />
|
||||||
<MudSelectItem Value="@MedicalHistoryQuestionType.Interrogatively" />
|
<MudSelectItem Value="@MedicalHistoryQuestionType.Interrogatively" />
|
||||||
<MudSelectItem Value="@MedicalHistoryQuestionType.YesOrNo" />
|
<MudSelectItem Value="@MedicalHistoryQuestionType.YesOrNo" />
|
||||||
</MudSelect>
|
</MudSelect>
|
||||||
<MudTextField @bind-Value="@_piQuestionTitle" Margin="Margin.None" T="string" Label="عنوان سوال" Lines="1"
|
<MudTextField @bind-Value="@_pdhQuestionTitle" Margin="Margin.None" T="string" Label="عنوان سوال" Lines="1"
|
||||||
Variant="Variant.Outlined" />
|
Variant="Variant.Outlined" />
|
||||||
|
|
||||||
<MudButton @onclick="AddPIQuestion" Variant="Variant.Filled" IconSize="Size.Large" DisableElevation="true"
|
<MudButton @onclick="AddPiQuestion" Variant="Variant.Filled" IconSize="Size.Large" DisableElevation="true"
|
||||||
class="font-extrabold text-lg rounded-md py-4 bg-[--color-medicalhistory] text-gray-800">
|
class="font-extrabold text-lg rounded-md py-4 bg-[--color-medicalhistory] text-gray-800">
|
||||||
+ افزودن
|
+ افزودن
|
||||||
</MudButton>
|
</MudButton>
|
||||||
|
|
||||||
<BasePartDivider Index="4" class="mt-9" Title="تاریخچه جراحی های قبلی ( PSH )" />
|
<BasePartDivider Index="4" class="mt-9" Title="تاریخچه جراحی های قبلی ( PSH )" />
|
||||||
|
|
||||||
@foreach (var item in PIQuestions)
|
@foreach (var item in PshQuestions)
|
||||||
{
|
{
|
||||||
<MedicalHistoryQuestionTemplateItemTemplate Question="item" QuestionRemoved="RemovePSHQuestion" />
|
<MedicalHistoryQuestionTemplateItemTemplate Question="item" QuestionRemoved="RemovePshQuestion" />
|
||||||
}
|
}
|
||||||
|
|
||||||
<MudSelect @bind-Value="@_pshQuestionType"
|
<MudSelect @bind-Value="@_pshQuestionType"
|
||||||
|
ToStringFunc="(e=>e.ToDisplay())"
|
||||||
T="MedicalHistoryQuestionType"
|
T="MedicalHistoryQuestionType"
|
||||||
Label="نوع سوال"
|
Label="نوع سوال"
|
||||||
Variant="Variant.Outlined">
|
Variant="Variant.Outlined">
|
||||||
|
@ -43,7 +45,7 @@
|
||||||
Label="عنوان سوال" Lines="1"
|
Label="عنوان سوال" Lines="1"
|
||||||
Variant="Variant.Outlined" />
|
Variant="Variant.Outlined" />
|
||||||
|
|
||||||
<MudButton @onclick="AddPSHQuestion" Variant="Variant.Filled" IconSize="Size.Large" DisableElevation="true"
|
<MudButton @onclick="AddPshQuestion" Variant="Variant.Filled" IconSize="Size.Large" DisableElevation="true"
|
||||||
class="font-extrabold text-lg rounded-md py-4 bg-[--color-medicalhistory] text-gray-800">
|
class="font-extrabold text-lg rounded-md py-4 bg-[--color-medicalhistory] text-gray-800">
|
||||||
+ افزودن
|
+ افزودن
|
||||||
</MudButton>
|
</MudButton>
|
||||||
|
@ -53,37 +55,45 @@
|
||||||
|
|
||||||
@code
|
@code
|
||||||
{
|
{
|
||||||
private string _piQuestionTitle = string.Empty;
|
[Parameter]
|
||||||
private MedicalHistoryQuestionType _piQuestionType;
|
public List<MedicalHistoryQuestionSDto> PdhQuestions { get; set; } = new();
|
||||||
|
[Parameter]
|
||||||
|
public List<MedicalHistoryQuestionSDto> PshQuestions { get; set; } = new();
|
||||||
|
|
||||||
|
|
||||||
|
private string _pdhQuestionTitle = string.Empty;
|
||||||
|
private MedicalHistoryQuestionType _pdhQuestionType;
|
||||||
private string _pshQuestionTitle = string.Empty;
|
private string _pshQuestionTitle = string.Empty;
|
||||||
private MedicalHistoryQuestionType _pshQuestionType;
|
private MedicalHistoryQuestionType _pshQuestionType;
|
||||||
public List<MedicalHistoryQuestion> PIQuestions { get; set; } = new();
|
|
||||||
public List<MedicalHistoryQuestion> PSHQuestions { get; set; } = new();
|
|
||||||
|
|
||||||
private void RemovePIQuestion(MedicalHistoryQuestion question)
|
private void RemovePiQuestion(MedicalHistoryQuestionSDto question)
|
||||||
{
|
{
|
||||||
PIQuestions.Remove(question);
|
PdhQuestions.Remove(question);
|
||||||
}
|
}
|
||||||
private void AddPIQuestion()
|
private void AddPiQuestion()
|
||||||
{
|
{
|
||||||
PIQuestions.Add(new MedicalHistoryQuestion
|
PdhQuestions.Add(new MedicalHistoryQuestionSDto
|
||||||
{
|
{
|
||||||
Title = _piQuestionTitle,
|
QuestionType = _pdhQuestionType,
|
||||||
Type = _piQuestionType
|
Part = MedicalHistoryPart.PastDiseasesHistory,
|
||||||
|
Question = _pdhQuestionTitle
|
||||||
});
|
});
|
||||||
|
_pdhQuestionTitle = string.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void RemovePSHQuestion(MedicalHistoryQuestion question)
|
private void RemovePshQuestion(MedicalHistoryQuestionSDto question)
|
||||||
{
|
{
|
||||||
PSHQuestions.Remove(question);
|
PshQuestions.Remove(question);
|
||||||
}
|
}
|
||||||
private void AddPSHQuestion()
|
private void AddPshQuestion()
|
||||||
{
|
{
|
||||||
PSHQuestions.Add(new MedicalHistoryQuestion
|
PshQuestions.Add(new MedicalHistoryQuestionSDto
|
||||||
{
|
{
|
||||||
Title = _pshQuestionTitle,
|
Part = MedicalHistoryPart.PastSurgeryHistory,
|
||||||
Type = _pshQuestionType
|
QuestionType = _pshQuestionType,
|
||||||
|
Question = _pshQuestionTitle
|
||||||
});
|
});
|
||||||
|
_pshQuestionTitle = string.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,3 +1,4 @@
|
||||||
|
@using DocuMed.Domain.Entities.MedicalHistoryTemplate
|
||||||
<MudStack class="pb-20 font-iranyekan">
|
<MudStack class="pb-20 font-iranyekan">
|
||||||
<BasePartDivider Index="5" Title="تاریخچه بیماری های خانوادگی ( FH )" />
|
<BasePartDivider Index="5" Title="تاریخچه بیماری های خانوادگی ( FH )" />
|
||||||
|
|
||||||
|
@ -6,7 +7,8 @@
|
||||||
<MedicalHistoryQuestionTemplateItemTemplate Question="item" QuestionRemoved="RemoveFamilyHistory" />
|
<MedicalHistoryQuestionTemplateItemTemplate Question="item" QuestionRemoved="RemoveFamilyHistory" />
|
||||||
}
|
}
|
||||||
|
|
||||||
<MudSelect @bind-Value="@_familyHistoryQuestionType" T="MedicalHistoryQuestionType" Label="نوع سوال" Variant="Variant.Outlined">
|
<MudSelect @bind-Value="@_familyHistoryQuestionType"
|
||||||
|
ToStringFunc="(e=>e.ToDisplay())" T="MedicalHistoryQuestionType" Label="نوع سوال" Variant="Variant.Outlined">
|
||||||
|
|
||||||
<MudSelectItem Value="@MedicalHistoryQuestionType.Hourly" />
|
<MudSelectItem Value="@MedicalHistoryQuestionType.Hourly" />
|
||||||
<MudSelectItem Value="@MedicalHistoryQuestionType.Interrogatively" />
|
<MudSelectItem Value="@MedicalHistoryQuestionType.Interrogatively" />
|
||||||
|
@ -28,7 +30,7 @@
|
||||||
{
|
{
|
||||||
<MudCard @onclick="()=>RemoveDrugHistory(item)" class="text-center">
|
<MudCard @onclick="()=>RemoveDrugHistory(item)" class="text-center">
|
||||||
<MudCardContent>
|
<MudCardContent>
|
||||||
<p class="font-extrabold text-gray-600 text-md">@item</p>
|
<p class="font-extrabold text-gray-600 text-md">@item.Question</p>
|
||||||
</MudCardContent>
|
</MudCardContent>
|
||||||
</MudCard>
|
</MudCard>
|
||||||
}
|
}
|
||||||
|
@ -45,11 +47,11 @@
|
||||||
<BasePartDivider Index="7" class="mt-9" Title="مواد مصرفی ( HH )" />
|
<BasePartDivider Index="7" class="mt-9" Title="مواد مصرفی ( HH )" />
|
||||||
|
|
||||||
<div class="grid mx-1 gap-2 grid-cols-2 md:grid-cols-4">
|
<div class="grid mx-1 gap-2 grid-cols-2 md:grid-cols-4">
|
||||||
@foreach (var item in HHMedicines)
|
@foreach (var item in AhMedicines)
|
||||||
{
|
{
|
||||||
<MudCard @onclick="()=>RemoveHHMedicine(item)" class="text-center">
|
<MudCard @onclick="()=>RemoveHhMedicine(item)" class="text-center">
|
||||||
<MudCardContent>
|
<MudCardContent>
|
||||||
<p class="font-extrabold text-gray-600 text-md">@item</p>
|
<p class="font-extrabold text-gray-600 text-md">@item.Question</p>
|
||||||
</MudCardContent>
|
</MudCardContent>
|
||||||
</MudCard>
|
</MudCard>
|
||||||
}
|
}
|
||||||
|
@ -58,7 +60,7 @@
|
||||||
<div class="flex flex-row">
|
<div class="flex flex-row">
|
||||||
<MudTextField @bind-Value="@_hhName" class="grow" T="string" Label="نام دارو مورد نظر" Variant="Variant.Outlined" />
|
<MudTextField @bind-Value="@_hhName" class="grow" T="string" Label="نام دارو مورد نظر" Variant="Variant.Outlined" />
|
||||||
|
|
||||||
<MudButton Variant="Variant.Outlined" @onclick="AddHHMedicine" Color="Color.Info" IconSize="Size.Large" DisableElevation="false" class="mx-2 mt-1.5 mb-0.5 pt-2 text-4xl rounded-md">
|
<MudButton Variant="Variant.Outlined" @onclick="AddHhMedicine" Color="Color.Info" IconSize="Size.Large" DisableElevation="false" class="mx-2 mt-1.5 mb-0.5 pt-2 text-4xl rounded-md">
|
||||||
+
|
+
|
||||||
</MudButton>
|
</MudButton>
|
||||||
</div>
|
</div>
|
||||||
|
@ -69,45 +71,58 @@
|
||||||
@code {
|
@code {
|
||||||
private string _familyHistoryQuestionTitle = string.Empty;
|
private string _familyHistoryQuestionTitle = string.Empty;
|
||||||
private MedicalHistoryQuestionType _familyHistoryQuestionType;
|
private MedicalHistoryQuestionType _familyHistoryQuestionType;
|
||||||
|
[Parameter]
|
||||||
public List<MedicalHistoryQuestion> FamilyHistories { get; set; } = new();
|
public List<MedicalHistoryQuestionSDto> FamilyHistories { get; set; } = new();
|
||||||
|
private void RemoveFamilyHistory(MedicalHistoryQuestionSDto question)
|
||||||
private void RemoveFamilyHistory(MedicalHistoryQuestion question)
|
|
||||||
{
|
{
|
||||||
FamilyHistories.Remove(question);
|
FamilyHistories.Remove(question);
|
||||||
}
|
}
|
||||||
private void AddFamilyHistory()
|
private void AddFamilyHistory()
|
||||||
{
|
{
|
||||||
FamilyHistories.Add(new MedicalHistoryQuestion
|
FamilyHistories.Add(new MedicalHistoryQuestionSDto
|
||||||
{
|
{
|
||||||
Title = _familyHistoryQuestionTitle,
|
Question = _familyHistoryQuestionTitle,
|
||||||
Type = _familyHistoryQuestionType
|
QuestionType = _familyHistoryQuestionType,
|
||||||
|
Part = MedicalHistoryPart.FamilyHistory
|
||||||
});
|
});
|
||||||
|
_familyHistoryQuestionTitle = String.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private string _drugHistoryName = string.Empty;
|
private string _drugHistoryName = string.Empty;
|
||||||
public List<string> DrugHistories { get; set; } = new();
|
[Parameter]
|
||||||
private void RemoveDrugHistory(string medicine)
|
public List<MedicalHistoryQuestionSDto> DrugHistories { get; set; } = new();
|
||||||
|
private void RemoveDrugHistory(MedicalHistoryQuestionSDto medicine)
|
||||||
{
|
{
|
||||||
DrugHistories.Remove(medicine);
|
DrugHistories.Remove(medicine);
|
||||||
}
|
}
|
||||||
private void AddDrugHistory()
|
private void AddDrugHistory()
|
||||||
{
|
{
|
||||||
DrugHistories.Add(_drugHistoryName);
|
DrugHistories.Add(new MedicalHistoryQuestionSDto
|
||||||
|
{
|
||||||
|
Question = _drugHistoryName,
|
||||||
|
QuestionType = MedicalHistoryQuestionType.Selective,
|
||||||
|
Part = MedicalHistoryPart.DrugHistory
|
||||||
|
});
|
||||||
_drugHistoryName = string.Empty;
|
_drugHistoryName = string.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private string _hhName = string.Empty;
|
private string _hhName = string.Empty;
|
||||||
public List<string> HHMedicines { get; set; } = new();
|
[Parameter]
|
||||||
private void RemoveHHMedicine(string medicine)
|
public List<MedicalHistoryQuestionSDto> AhMedicines { get; set; } = new();
|
||||||
|
private void RemoveHhMedicine(MedicalHistoryQuestionSDto medicine)
|
||||||
{
|
{
|
||||||
HHMedicines.Remove(medicine);
|
AhMedicines.Remove(medicine);
|
||||||
}
|
}
|
||||||
private void AddHHMedicine()
|
private void AddHhMedicine()
|
||||||
{
|
{
|
||||||
HHMedicines.Add(_hhName);
|
AhMedicines.Add(new MedicalHistoryQuestionSDto
|
||||||
|
{
|
||||||
|
Part = MedicalHistoryPart.AddictionHistory,
|
||||||
|
Question = _hhName,
|
||||||
|
QuestionType = MedicalHistoryQuestionType.Selective
|
||||||
|
});
|
||||||
_hhName = string.Empty;
|
_hhName = string.Empty;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,18 +1,18 @@
|
||||||
<MudStack class="pb-20 font-iranyekan">
|
<MudStack class="pb-20 font-iranyekan">
|
||||||
<BasePartDivider Index="8" Title="ظاهر کلی بیمار ( GA )" />
|
<BasePartDivider Index="8" Title="ظاهر کلی بیمار ( GA )" />
|
||||||
<div class="grid mx-1 gap-2 grid-cols-1 md:grid-cols-2">
|
<div class="grid mx-1 gap-2 grid-cols-1 md:grid-cols-2">
|
||||||
@foreach (var item in GeneralAppearances)
|
@foreach (var item in VitalSigns)
|
||||||
{
|
{
|
||||||
<MudCard @onclick="()=>RemoveGeneralAppearance(item)" class="text-center">
|
<MudCard @onclick="()=>RemoveGeneralAppearance(item)" class="text-center">
|
||||||
<MudCardContent>
|
<MudCardContent>
|
||||||
<p class="font-extrabold text-gray-600 text-md">@item</p>
|
<p class="font-extrabold text-gray-600 text-md">@item.Question</p>
|
||||||
</MudCardContent>
|
</MudCardContent>
|
||||||
</MudCard>
|
</MudCard>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex flex-row">
|
<div class="flex flex-row">
|
||||||
<MudTextField @bind-Value="@_generalAppearance" class="grow" T="string" Label="نام دارو مورد نظر" Variant="Variant.Outlined" />
|
<MudTextField @bind-Value="@_vitalSign" class="grow" T="string" Label="نام دارو مورد نظر" Variant="Variant.Outlined" />
|
||||||
|
|
||||||
<MudButton Variant="Variant.Outlined" @onclick="AddGeneralAppearance" Color="Color.Info" IconSize="Size.Large" DisableElevation="false" class="mx-2 mt-1.5 mb-0.5 pt-2 text-4xl rounded-md">
|
<MudButton Variant="Variant.Outlined" @onclick="AddGeneralAppearance" Color="Color.Info" IconSize="Size.Large" DisableElevation="false" class="mx-2 mt-1.5 mb-0.5 pt-2 text-4xl rounded-md">
|
||||||
+
|
+
|
||||||
|
@ -27,18 +27,18 @@
|
||||||
|
|
||||||
<div class="flex flex-row">
|
<div class="flex flex-row">
|
||||||
<div>
|
<div>
|
||||||
<p>@item.Title</p>
|
<p>@item.Question</p>
|
||||||
<div class="flex flex-row">
|
<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">
|
<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>
|
</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">
|
<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
|
Sign
|
||||||
</MudPaper>
|
</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">
|
<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
|
Symptom
|
||||||
|
@ -71,36 +71,42 @@
|
||||||
</MudStack>
|
</MudStack>
|
||||||
@code {
|
@code {
|
||||||
|
|
||||||
private string _generalAppearance = string.Empty;
|
private string _vitalSign = string.Empty;
|
||||||
public List<string> GeneralAppearances { get; set; } = new();
|
[Parameter]
|
||||||
private void RemoveGeneralAppearance(string medicine)
|
public List<MedicalHistoryQuestionSDto> VitalSigns { get; set; } = new();
|
||||||
|
private void RemoveGeneralAppearance(MedicalHistoryQuestionSDto generalAppearance)
|
||||||
{
|
{
|
||||||
GeneralAppearances.Remove(medicine);
|
VitalSigns.Remove(generalAppearance);
|
||||||
}
|
}
|
||||||
private void AddGeneralAppearance()
|
private void AddGeneralAppearance()
|
||||||
{
|
{
|
||||||
GeneralAppearances.Add(_generalAppearance);
|
VitalSigns.Add(new MedicalHistoryQuestionSDto
|
||||||
_generalAppearance = string.Empty;
|
{
|
||||||
|
Question = _vitalSign,
|
||||||
|
QuestionType = MedicalHistoryQuestionType.Selective,
|
||||||
|
Part = MedicalHistoryPart.VitalSign
|
||||||
|
});
|
||||||
|
_vitalSign = string.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
private string _reviewOfSystemTitle = string.Empty;
|
private string _reviewOfSystemTitle = string.Empty;
|
||||||
private string _reviewOfSystemSystem = string.Empty;
|
private string _reviewOfSystemSystem = string.Empty;
|
||||||
private bool _reviewOfSystemIsSign;
|
private bool _reviewOfSystemIsSign;
|
||||||
private bool _reviewOfSystemIsSymptom;
|
private bool _reviewOfSystemIsSymptom;
|
||||||
public List<MedicalHistorySystemReview> ReviewOfSystems { get; set; } = new();
|
public List<MedicalHistoryQuestionSDto> ReviewOfSystems { get; set; } = new();
|
||||||
private void RemoveReviewOfSystems(MedicalHistorySystemReview review)
|
private void RemoveReviewOfSystems(MedicalHistoryQuestionSDto review)
|
||||||
{
|
{
|
||||||
ReviewOfSystems.Remove(review);
|
ReviewOfSystems.Remove(review);
|
||||||
}
|
}
|
||||||
private void AddReviewOfSystems()
|
private void AddReviewOfSystems()
|
||||||
{
|
{
|
||||||
ReviewOfSystems.Add(new MedicalHistorySystemReview
|
// ReviewOfSystems.Add(new MedicalHistorySystemReview
|
||||||
{
|
// {
|
||||||
Title = _reviewOfSystemTitle,
|
// Title = _reviewOfSystemTitle,
|
||||||
IsSign = _reviewOfSystemIsSign,
|
// IsSign = _reviewOfSystemIsSign,
|
||||||
IsSymptom = _reviewOfSystemIsSymptom,
|
// IsSymptom = _reviewOfSystemIsSymptom,
|
||||||
System = _reviewOfSystemSystem
|
// System = _reviewOfSystemSystem
|
||||||
});
|
// });
|
||||||
_reviewOfSystemTitle = string.Empty;
|
_reviewOfSystemTitle = string.Empty;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,63 +1,50 @@
|
||||||
@page "/MedicalHistoryTemplatesPage"
|
@page "/MedicalHistoryTemplatesPage"
|
||||||
@inject NavigationManager NavigationManager
|
@inject NavigationManager NavigationManager
|
||||||
|
@inject ISnackbar Snackbar
|
||||||
|
@inject IRestWrapper RestWrapper
|
||||||
|
@inject IUserUtility UserUtility
|
||||||
|
|
||||||
<BasePageUi Title="پیش نویس های شرح حال نویسی" Description="پیش نویس های شرح های سرعت و دقت شما را افزایش میدهد">
|
<BasePageUi Title="پیش نویس های" Description="پیش نویس های شرح های سرعت و دقت شما را افزایش میدهد">
|
||||||
<MudStack>
|
<MudStack>
|
||||||
<div class="flex flex-row mr-1 mt-5">
|
<div class="flex flex-row mr-1 mt-5">
|
||||||
<div>
|
<div>
|
||||||
<p class="font-extrabold text-[#356859]">تمامی پیش نویس های شما</p>
|
<p class="font-extrabold text-[#356859]">تمامی پیش نویس های شما</p>
|
||||||
<p class="text-xs font-light ">شما میتوانید پیش نویس جدید اضافه کنید</p>
|
<p class="text-xs font-light ">شما میتوانید پیش نویس جدید اضافه کنید</p>
|
||||||
</div>
|
</div>
|
||||||
<MudButton @onclick="CreateMedicalHistoryTemplateClicked" DisableElevation="false" class="text-[#356859] my-auto mr-auto font-extrabold bg-white rounded-lg drop-shadow-md">+ افزودن</MudButton>
|
<MudButton @onclick="ViewModel.CreateMedicalHistoryTemplateClicked" DisableElevation="false" class="text-[#356859] my-auto mr-auto font-extrabold bg-white rounded-lg drop-shadow-md">+ افزودن</MudButton>
|
||||||
</div>
|
</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">
|
<div class="grid grid-cols-2 gap-3 w-full sm:grid-cols-3 md:grid-cols-4">
|
||||||
|
@if (@ViewModel.IsProcessing)
|
||||||
@foreach(var item in _medicalHistoryTemplates)
|
|
||||||
{
|
{
|
||||||
<MedicalHistoryTemplateItemTemplate Clicked="MedicalHistoryTemplateClicked" MedicalHistoryTemplate="@item" />
|
@for (int i = 0; i < 4; i++)
|
||||||
|
{
|
||||||
|
<MudCard class="bg-transparent p-4 rounded-lg" Elevation="0">
|
||||||
|
<MudSkeleton class="mb-4 mx-10 h-10" SkeletonType="SkeletonType.Rectangle" Animation="Animation.Wave" />
|
||||||
|
<MudSkeleton Animation="Animation.Wave" />
|
||||||
|
</MudCard>
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
|
@foreach (var item in ViewModel.PageDto)
|
||||||
|
{
|
||||||
|
<MedicalHistoryTemplateItemTemplate Clicked="ViewModel.MedicalHistoryTemplateClicked" MedicalHistoryTemplate="@item" />
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</MudStack>
|
</MudStack>
|
||||||
</BasePageUi>
|
</BasePageUi>
|
||||||
@code
|
@code
|
||||||
{
|
{
|
||||||
private void CreateMedicalHistoryTemplateClicked() => NavigationManager.NavigateTo("MedicalHistoryTemplateActionPage");
|
public MedicalHistoryTemplatesPageViewModel ViewModel { get; set; }
|
||||||
private void MedicalHistoryTemplateClicked() => NavigationManager.NavigateTo("MedicalHistoryTemplateActionPage");
|
protected override async Task OnInitializedAsync()
|
||||||
private List<MedicalHistoryTemplate> _medicalHistoryTemplates = new();
|
|
||||||
protected override void OnInitialized()
|
|
||||||
{
|
{
|
||||||
_medicalHistoryTemplates.Add(new MedicalHistoryTemplate
|
ViewModel = new MedicalHistoryTemplatesPageViewModel(NavigationManager, UserUtility, RestWrapper, Snackbar);
|
||||||
{
|
await ViewModel.InitializeAsync();
|
||||||
CC = "سردرد",
|
await base.OnInitializedAsync();
|
||||||
Section = "داخلی"
|
|
||||||
});
|
|
||||||
_medicalHistoryTemplates.Add(new MedicalHistoryTemplate
|
|
||||||
{
|
|
||||||
CC = "بدن درد",
|
|
||||||
Section = "فیزیو"
|
|
||||||
});
|
|
||||||
_medicalHistoryTemplates.Add(new MedicalHistoryTemplate
|
|
||||||
{
|
|
||||||
CC = "بی خوابی",
|
|
||||||
Section = "داخلی"
|
|
||||||
});
|
|
||||||
_medicalHistoryTemplates.Add(new MedicalHistoryTemplate
|
|
||||||
{
|
|
||||||
CC = "دردپهلو",
|
|
||||||
Section = "داخلی"
|
|
||||||
});
|
|
||||||
_medicalHistoryTemplates.Add(new MedicalHistoryTemplate
|
|
||||||
{
|
|
||||||
CC = "سوختگی",
|
|
||||||
Section = "سوختگی"
|
|
||||||
});
|
|
||||||
_medicalHistoryTemplates.Add(new MedicalHistoryTemplate
|
|
||||||
{
|
|
||||||
CC = "شکستگی",
|
|
||||||
Section = "فیزیو"
|
|
||||||
});
|
|
||||||
base.OnInitialized();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,49 @@
|
||||||
|
namespace DocuMed.PWA.Pages;
|
||||||
|
|
||||||
|
public class MedicalHistoryTemplatesPageViewModel : BaseViewModel<List<MedicalHistoryTemplateSDto>>
|
||||||
|
{
|
||||||
|
private readonly NavigationManager _navigationManager;
|
||||||
|
private readonly IUserUtility _userUtility;
|
||||||
|
private readonly IRestWrapper _restWrapper;
|
||||||
|
private readonly ISnackbar _snackbar;
|
||||||
|
|
||||||
|
public MedicalHistoryTemplatesPageViewModel(NavigationManager navigationManager,IUserUtility userUtility , IRestWrapper restWrapper,ISnackbar snackbar)
|
||||||
|
{
|
||||||
|
_navigationManager = navigationManager;
|
||||||
|
_userUtility = userUtility;
|
||||||
|
_restWrapper = restWrapper;
|
||||||
|
_snackbar = snackbar;
|
||||||
|
}
|
||||||
|
public void CreateMedicalHistoryTemplateClicked() => _navigationManager.NavigateTo("MedicalHistoryTemplateActionPage");
|
||||||
|
public void MedicalHistoryTemplateClicked(MedicalHistoryTemplateSDto template) => _navigationManager.NavigateTo($"MedicalHistoryTemplateActionPage/{template.Id.ToString()}");
|
||||||
|
|
||||||
|
public override async Task InitializeAsync()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
IsProcessing = true;
|
||||||
|
await Task.Delay(500);
|
||||||
|
var token = await _userUtility.GetBearerTokenAsync();
|
||||||
|
var list = await _restWrapper
|
||||||
|
.CrudDtoApiRest<MedicalHistoryTemplateLDto, MedicalHistoryTemplateSDto, Guid>( Address.MedicalHistoryTemplateController)
|
||||||
|
.ReadAll(0, token);
|
||||||
|
PageDto = list;
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (ApiException ex)
|
||||||
|
{
|
||||||
|
var exe = await ex.GetContentAsAsync<ApiResult>();
|
||||||
|
_snackbar.Add(exe != null ? exe.Message : ex.Content, Severity.Error);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
_snackbar.Add(e.Message, Severity.Error);
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
|
||||||
|
IsProcessing = false;
|
||||||
|
}
|
||||||
|
await base.InitializeAsync();
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,30 +1,104 @@
|
||||||
@page "/ProfilePage"
|
@page "/ProfilePage"
|
||||||
@using System.Reflection
|
@inject IRestWrapper RestWrapper
|
||||||
|
@inject ISnackbar Snackbar
|
||||||
|
@inject IUserUtility UserUtility
|
||||||
|
@inject NavigationManager NavigationManager
|
||||||
|
|
||||||
|
|
||||||
<BasePageUi Title="پروفایل شما" Description="اطلاعات پروفایل شما باید دقیق و کامل باشد">
|
<BasePageUi Title="پروفایل شما" Description="اطلاعات پروفایل شما باید دقیق و کامل باشد">
|
||||||
<MudStack class="pb-10">
|
<MudStack class="pb-10">
|
||||||
<MudTextField T="string" Label="نـــــــام" Variant="Variant.Outlined" />
|
<MudTextField @bind-Value="@ViewModel.User.FirstName" T="string" Label="نـــــــام" Variant="Variant.Outlined" />
|
||||||
<MudTextField T="string" Label="نام خانوادگی" Variant="Variant.Outlined" />
|
<MudTextField @bind-Value="@ViewModel.User.LastName" T="string" Label="نام خانوادگی" Variant="Variant.Outlined" />
|
||||||
<MudTextField T="string" Label="شماره تماس" Variant="Variant.Outlined" />
|
<MudTextField @bind-Value="@ViewModel.User.PhoneNumber" T="string" Label="شماره تماس" Variant="Variant.Outlined" />
|
||||||
<MudTextField T="string" Label="شماره دانشجویی" Variant="Variant.Outlined" />
|
<MudTextField @bind-Value="@ViewModel.User.StudentId" T="string" Label="شماره دانشجویی" Variant="Variant.Outlined" />
|
||||||
<MudAutocomplete T="string" Label="شهر شما" Variant="Variant.Outlined" />
|
|
||||||
<MudAutocomplete T="string" Label="دانشگاه" Variant="Variant.Outlined" />
|
|
||||||
<MudAutocomplete T="string" Label="بخش فعلی" Variant="Variant.Outlined" />
|
|
||||||
|
|
||||||
<BaseButtonUi Icon="@Icons.Material.TwoTone.Check" Content="ویرایش پروفایل" Variant="Variant.Filled" Color="Color.Primary"/>
|
<MudAutocomplete @bind-Value="@ViewModel.SelectedCity"
|
||||||
|
SearchFunc="@ViewModel.SearchCity"
|
||||||
|
T="CitySDto"
|
||||||
|
ToStringFunc="dto => dto.Name"
|
||||||
|
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 Icon="@Icons.Material.TwoTone.Close" Content="خروج از حساب کاربری" Variant="Variant.Outlined" Color="Color.Error" />
|
<MudAutocomplete @bind-Value="@ViewModel.SelectedUni"
|
||||||
|
ToStringFunc="dto => dto.Name"
|
||||||
|
SearchFunc="@ViewModel.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>
|
||||||
|
|
||||||
|
<MudAutocomplete T="SectionSDto" Label="بخش فعلی" Variant="Variant.Outlined"
|
||||||
|
ToStringFunc="dto => dto.Name"
|
||||||
|
SearchFunc="@ViewModel.SearchSection"
|
||||||
|
@bind-Value="@ViewModel.SelectedSection">
|
||||||
|
|
||||||
|
<ProgressIndicatorInPopoverTemplate>
|
||||||
|
<MudList Clickable="false">
|
||||||
|
<MudListItem>
|
||||||
|
<div class="flex flex-row w-full mx-auto">
|
||||||
|
<MudProgressCircular class="my-auto mr-1 -ml-4" Size="Size.Small" Indeterminate="true" />
|
||||||
|
<p class="font-bold my-1 mx-auto text-md">منتظر بمانید</p>
|
||||||
|
</div>
|
||||||
|
</MudListItem>
|
||||||
|
</MudList>
|
||||||
|
</ProgressIndicatorInPopoverTemplate>
|
||||||
|
<ItemTemplate Context="e">
|
||||||
|
<p>@e.Name</p>
|
||||||
|
</ItemTemplate>
|
||||||
|
</MudAutocomplete>
|
||||||
|
|
||||||
|
<BaseButtonUi IsProcessing="@ViewModel.IsProcessing"
|
||||||
|
Icon="@Icons.Material.TwoTone.Check"
|
||||||
|
@onclick="@ViewModel.SubmitEditAsync"
|
||||||
|
Content="ویرایش پروفایل"
|
||||||
|
Variant="Variant.Filled"
|
||||||
|
Color="Color.Primary" />
|
||||||
|
|
||||||
|
<BaseButtonUi Icon="@Icons.Material.TwoTone.Close"
|
||||||
|
@onclick="@ViewModel.LogoutAsync" Content="خروج از حساب کاربری" Variant="Variant.Outlined" Color="Color.Error" />
|
||||||
|
|
||||||
</MudStack>
|
</MudStack>
|
||||||
<div class="bg-gray-300 rounded-md mt-auto py-4 px-6 flex flex-row">
|
<div class="bg-gray-300 rounded-md mt-auto py-4 px-6 flex flex-row">
|
||||||
<p class="my-auto">نسخه برنامه </p>
|
<p class="my-auto">نسخه برنامه </p>
|
||||||
<p class="font-extrabold text-lg mr-auto">@_version</p>
|
<p class="font-extrabold text-lg mr-auto">@ViewModel.Version</p>
|
||||||
</div>
|
</div>
|
||||||
</BasePageUi>
|
</BasePageUi>
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
private readonly string _version = Assembly.GetAssembly(typeof(Program))?.GetName()?.Version?.ToString() ?? string.Empty;
|
|
||||||
|
|
||||||
|
private ProfilePageViewModel ViewModel { get; set; }
|
||||||
|
|
||||||
|
protected override async Task OnInitializedAsync()
|
||||||
|
{
|
||||||
|
ViewModel = new ProfilePageViewModel(UserUtility, RestWrapper, Snackbar, NavigationManager);
|
||||||
|
await ViewModel.InitializeAsync();
|
||||||
|
await base.OnInitializedAsync();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -0,0 +1,175 @@
|
||||||
|
using DocuMed.Domain.Entities.City;
|
||||||
|
using Mapster;
|
||||||
|
|
||||||
|
namespace DocuMed.PWA.Pages;
|
||||||
|
|
||||||
|
public class ProfilePageViewModel : BaseViewModel
|
||||||
|
{
|
||||||
|
private readonly NavigationManager _navigationManager;
|
||||||
|
public IUserUtility UserUtility { get; }
|
||||||
|
public IRestWrapper RestWrapper { get; }
|
||||||
|
public ISnackbar Snackbar { get; }
|
||||||
|
public ApplicationUserSDto User { get; set; } = new();
|
||||||
|
|
||||||
|
|
||||||
|
public List<CitySDto> Cities { get; private set; } = new List<CitySDto>();
|
||||||
|
public List<UniversitySDto> Universities { get; private set; } = new List<UniversitySDto>();
|
||||||
|
public List<SectionSDto> Sections { get; private set; } = new List<SectionSDto>();
|
||||||
|
public SectionSDto? SelectedSection { get; set; }
|
||||||
|
public CitySDto? SelectedCity { get; set; }
|
||||||
|
public UniversitySDto? SelectedUni { get; set; }
|
||||||
|
|
||||||
|
public readonly string Version = Assembly.GetAssembly(typeof(Program))?.GetName()?.Version?.ToString() ?? string.Empty;
|
||||||
|
|
||||||
|
public ProfilePageViewModel(IUserUtility userUtility, IRestWrapper restWrapper, ISnackbar snackbar,NavigationManager navigationManager)
|
||||||
|
{
|
||||||
|
_navigationManager = navigationManager;
|
||||||
|
UserUtility = userUtility;
|
||||||
|
RestWrapper = restWrapper;
|
||||||
|
Snackbar = snackbar;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override async Task InitializeAsync()
|
||||||
|
{
|
||||||
|
User = await UserUtility.GetUserAsync();
|
||||||
|
|
||||||
|
var token = await UserUtility.GetBearerTokenAsync();
|
||||||
|
Cities = await RestWrapper.CrudDtoApiRest<City, CitySDto, Guid>(Address.CityController).ReadAll(0, token);
|
||||||
|
Universities = await RestWrapper.CrudDtoApiRest<University, UniversitySDto, Guid>(Address.UniversityController).ReadAll(0, token);
|
||||||
|
|
||||||
|
if (User.UniversityId != Guid.Empty)
|
||||||
|
{
|
||||||
|
SelectedUni = Universities.FirstOrDefault(u => u.Id == User.UniversityId);
|
||||||
|
SelectedCity = Cities.FirstOrDefault(c => c.Id == SelectedUni?.CityId);
|
||||||
|
if (SelectedUni != null)
|
||||||
|
if (User.SectionId != Guid.Empty)
|
||||||
|
{
|
||||||
|
Sections = await RestWrapper.SectionRestApi.GetByUniversityAsync(SelectedUni.Id, token);
|
||||||
|
SelectedSection = Sections.FirstOrDefault(s => s.Id == User.SectionId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
await base.InitializeAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task SubmitEditAsync()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
IsProcessing = true;
|
||||||
|
var token = await UserUtility.GetBearerTokenAsync();
|
||||||
|
var request = User.Adapt<UserActionRequestDto>();
|
||||||
|
if (SelectedUni != null)
|
||||||
|
{
|
||||||
|
request.UniversityId = SelectedUni.Id;
|
||||||
|
User.UniversityId = SelectedUni.Id;
|
||||||
|
}
|
||||||
|
if (SelectedSection != null)
|
||||||
|
{
|
||||||
|
request.SectionId = SelectedSection.Id;
|
||||||
|
User.SectionId = SelectedSection.Id;
|
||||||
|
}
|
||||||
|
await RestWrapper.UserRestApi.UpdateUserAsync(request, token);
|
||||||
|
await UserUtility.SetUserAsync(User);
|
||||||
|
Snackbar.Add("ویرایش حساب کاربری با موفقیت انجام شد", Severity.Success);
|
||||||
|
}
|
||||||
|
catch (ApiException ex)
|
||||||
|
{
|
||||||
|
var exe = await ex.GetContentAsAsync<ApiResult>();
|
||||||
|
Snackbar.Add(exe != null ? exe.Message : ex.Content, Severity.Error);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Snackbar.Add(e.Message, Severity.Error);
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
|
||||||
|
IsProcessing = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task LogoutAsync()
|
||||||
|
{
|
||||||
|
await UserUtility.LogoutAsync();
|
||||||
|
_navigationManager.NavigateTo("");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public 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>();
|
||||||
|
Snackbar.Add(exe != null ? exe.Message : ex.Content, Severity.Error);
|
||||||
|
return Cities;
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Snackbar.Add(e.Message, Severity.Error);
|
||||||
|
return Cities;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public async Task<IEnumerable<SectionSDto>> SearchSection(string section)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (SelectedUni != null)
|
||||||
|
{
|
||||||
|
var token = await UserUtility.GetBearerTokenAsync();
|
||||||
|
Sections = await RestWrapper.SectionRestApi.GetByUniversityAsync(SelectedUni.Id, token);
|
||||||
|
}
|
||||||
|
if (section.IsNullOrEmpty())
|
||||||
|
return Sections;
|
||||||
|
return Sections.Where(c => c.Name.Contains(section));
|
||||||
|
}
|
||||||
|
catch (ApiException ex)
|
||||||
|
{
|
||||||
|
var exe = await ex.GetContentAsAsync<ApiResult>();
|
||||||
|
Snackbar.Add(exe != null ? exe.Message : ex.Content, Severity.Error);
|
||||||
|
return Sections;
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Snackbar.Add(e.Message, Severity.Error);
|
||||||
|
return Sections;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public 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>();
|
||||||
|
Snackbar.Add(exe != null ? exe.Message : ex.Content, Severity.Error);
|
||||||
|
return Universities;
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Snackbar.Add(e.Message, Severity.Error);
|
||||||
|
return Universities;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -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);
|
var builder = WebAssemblyHostBuilder.CreateDefault(args);
|
||||||
builder.RootComponents.Add<App>("#app");
|
builder.RootComponents.Add<App>("#app");
|
||||||
builder.RootComponents.Add<HeadOutlet>("head::after");
|
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();
|
builder.Services.AddPWAUpdater();
|
||||||
await builder.Build().RunAsync();
|
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,12 @@
|
||||||
|
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; }
|
||||||
|
public ISectionRestApi SectionRestApi { get; }
|
||||||
|
public IUserRestApi UserRestApi { get; }
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
namespace DocuMed.PWA.Services.RestServices;
|
||||||
|
|
||||||
|
public interface ISectionRestApi : ICrudDtoApiRest<Section,SectionSDto,Guid>
|
||||||
|
{
|
||||||
|
[Get("/university/{universityId}")]
|
||||||
|
Task<List<SectionSDto>> GetByUniversityAsync(Guid universityId, [Header("Authorization")] string authorization);
|
||||||
|
}
|
|
@ -0,0 +1,9 @@
|
||||||
|
namespace DocuMed.PWA.Services.RestServices;
|
||||||
|
|
||||||
|
public interface IUserRestApi
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
[Put("")]
|
||||||
|
Task UpdateUserAsync([Body]UserActionRequestDto request, [Header("Authorization")] string authorization);
|
||||||
|
}
|
|
@ -0,0 +1,26 @@
|
||||||
|
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);
|
||||||
|
public ISectionRestApi SectionRestApi => RestService.For<ISectionRestApi>(Address.SectionController, setting);
|
||||||
|
public IUserRestApi UserRestApi => RestService.For<IUserRestApi>(Address.UserController, setting);
|
||||||
|
}
|
|
@ -1,25 +1,26 @@
|
||||||
|
@using DocuMed.Domain.Dtos.SmallDtos
|
||||||
<MudCard Class="mx-3 my-1 rounded-md" Elevation="2">
|
<MudCard Class="mx-3 my-1 rounded-md" Elevation="2">
|
||||||
<div class="flex flex-row">
|
<div class="flex flex-row">
|
||||||
<div class="bg-[--color-primary] rounded-r-lg w-2"></div>
|
<div class="bg-[--color-primary] rounded-r-lg w-2"></div>
|
||||||
<MudStack class="grow mx-3.5 my-4">
|
<MudStack class="grow mx-3.5 my-4">
|
||||||
<div class="flex flex-row">
|
<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"
|
<MudPaper Elevation="0"
|
||||||
class="bg-[#FFDACF] text-[#D03405] rounded-full py-0.5 px-3 my-auto mr-auto text-xs font-iranyekan">
|
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>
|
</MudPaper>
|
||||||
</div>
|
</div>
|
||||||
<MudGrid Row="true" Class="items-center justify-stretch">
|
<MudGrid Row="true" Class="items-center justify-stretch">
|
||||||
|
|
||||||
<MudItem xs="4">
|
<MudItem xs="4">
|
||||||
<MudPaper Elevation="0" Class="bg-gray-200 text-center rounded-full py-0.5 px-3 text-gray-700 text-xs">
|
<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>
|
</MudPaper>
|
||||||
</MudItem>
|
</MudItem>
|
||||||
<MudItem xs="4">
|
<MudItem xs="4">
|
||||||
<MudPaper Elevation="0" Class="bg-gray-200 text-center rounded-full py-0.5 px-3 text-gray-700 text-xs">
|
<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>
|
</MudPaper>
|
||||||
</MudItem>
|
</MudItem>
|
||||||
<MudItem xs="4">
|
<MudItem xs="4">
|
||||||
|
@ -38,6 +39,6 @@
|
||||||
@code {
|
@code {
|
||||||
|
|
||||||
[Parameter]
|
[Parameter]
|
||||||
public MedicalHistory MedicalHistory { get; set; } = new();
|
public MedicalHistorySDto MedicalHistory { get; set; } = new();
|
||||||
|
|
||||||
}
|
}
|
|
@ -2,10 +2,10 @@
|
||||||
|
|
||||||
<div class="flex flex-row">
|
<div class="flex flex-row">
|
||||||
<div>
|
<div>
|
||||||
<p>@Question.Title</p>
|
<p>@Question.Question</p>
|
||||||
<MudPaper Elevation="0"
|
<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">
|
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>
|
</MudPaper>
|
||||||
</div>
|
</div>
|
||||||
<MudIconButton @onclick="async ()=> await QuestionRemoved.InvokeAsync(Question)" class="mr-auto" Color="Color.Error" Icon="@Icons.Material.Filled.Close" />
|
<MudIconButton @onclick="async ()=> await QuestionRemoved.InvokeAsync(Question)" class="mr-auto" Color="Color.Error" Icon="@Icons.Material.Filled.Close" />
|
||||||
|
@ -15,9 +15,9 @@
|
||||||
@code {
|
@code {
|
||||||
|
|
||||||
[Parameter]
|
[Parameter]
|
||||||
public MedicalHistoryQuestion Question { get; set; } = new MedicalHistoryQuestion();
|
public MedicalHistoryQuestionSDto Question { get; set; } = new MedicalHistoryQuestionSDto();
|
||||||
|
|
||||||
[Parameter]
|
[Parameter]
|
||||||
public EventCallback<MedicalHistoryQuestion> QuestionRemoved { get; set; }
|
public EventCallback<MedicalHistoryQuestionSDto> QuestionRemoved { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
<MudCard @onclick="(async () => { await Clicked.InvokeAsync(MedicalHistoryTemplate); })" Elevation="2" class="rounded-lg">
|
<MudCard @onclick="(async () => { await Clicked.InvokeAsync(MedicalHistoryTemplate); })" Elevation="2" class="rounded-lg">
|
||||||
<MudCardContent>
|
<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"
|
<MudPaper Elevation="0"
|
||||||
class="bg-[#FFDACF] text-center text-[#D03405] rounded-full py-0.5 mt-3 mr-auto text-xs font-iranyekan">
|
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>
|
</MudPaper>
|
||||||
</MudCardContent>
|
</MudCardContent>
|
||||||
</MudCard>
|
</MudCard>
|
||||||
|
@ -12,8 +12,8 @@
|
||||||
@code {
|
@code {
|
||||||
|
|
||||||
[Parameter]
|
[Parameter]
|
||||||
public MedicalHistoryTemplate MedicalHistoryTemplate { get; set; } = new();
|
public MedicalHistoryTemplateSDto MedicalHistoryTemplate { get; set; } = new();
|
||||||
|
|
||||||
[Parameter]
|
[Parameter]
|
||||||
public EventCallback<MedicalHistoryTemplate> Clicked { get; set; }
|
public EventCallback<MedicalHistoryTemplateSDto> Clicked { get; set; }
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,8 +2,18 @@
|
||||||
Color="@Color"
|
Color="@Color"
|
||||||
@onclick="OnClickCallback"
|
@onclick="OnClickCallback"
|
||||||
@attributes="CapturedAttributes"
|
@attributes="CapturedAttributes"
|
||||||
|
Disabled="IsProcessing"
|
||||||
DisableElevation="true"
|
DisableElevation="true"
|
||||||
class="rounded-md">
|
class="rounded-md">
|
||||||
|
@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">
|
<div class="flex flex-row w-full">
|
||||||
@if (Variant == Variant.Filled)
|
@if (Variant == Variant.Filled)
|
||||||
{
|
{
|
||||||
|
@ -19,6 +29,7 @@
|
||||||
}
|
}
|
||||||
<p class="my-auto mx-auto font-extrabold">@Content</p>
|
<p class="my-auto mx-auto font-extrabold">@Content</p>
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
</MudButton>
|
</MudButton>
|
||||||
@code
|
@code
|
||||||
{
|
{
|
||||||
|
@ -33,6 +44,9 @@
|
||||||
[Parameter]
|
[Parameter]
|
||||||
public string Icon { get; set; } = string.Empty;
|
public string Icon { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
[Parameter]
|
||||||
|
public bool IsProcessing { get; set; } = false;
|
||||||
|
|
||||||
[Parameter]
|
[Parameter]
|
||||||
public EventCallback OnClickCallback { get; set; }
|
public EventCallback OnClickCallback { get; set; }
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
namespace DocuMed.PWA.Utilities;
|
||||||
|
|
||||||
|
public interface IUserUtility
|
||||||
|
{
|
||||||
|
public Task<string> GetBearerTokenAsync();
|
||||||
|
public Task SetBearerTokenAsync(string token);
|
||||||
|
public Task<ApplicationUserSDto> GetUserAsync();
|
||||||
|
public Task SetUserAsync(ApplicationUserSDto user);
|
||||||
|
public Task LogoutAsync();
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,28 @@
|
||||||
|
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 async Task<ApplicationUserSDto> GetUserAsync() => await _localStorageService.GetItemAsync<ApplicationUserSDto>(LocalStorageKeys.UserInfo);
|
||||||
|
public async Task SetUserAsync(ApplicationUserSDto user) => await _localStorageService.SetItemAsync<ApplicationUserSDto>(LocalStorageKeys.UserInfo, user);
|
||||||
|
public async Task LogoutAsync()
|
||||||
|
{
|
||||||
|
await _localStorageService.RemoveItemAsync(LocalStorageKeys.Token);
|
||||||
|
await _localStorageService.RemoveItemAsync(LocalStorageKeys.UserInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
//public AccessToken<ApplicationUserSDto>? AccessToken { get; set; }
|
||||||
|
//public List<string> UserClaims => AccessToken == null ? new List<string>() : AccessToken.Permissions;
|
||||||
|
//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(); }
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -504,6 +504,9 @@ video {
|
||||||
.left-0 {
|
.left-0 {
|
||||||
left: 0px;
|
left: 0px;
|
||||||
}
|
}
|
||||||
|
.right-0 {
|
||||||
|
right: 0px;
|
||||||
|
}
|
||||||
.z-50 {
|
.z-50 {
|
||||||
z-index: 50;
|
z-index: 50;
|
||||||
}
|
}
|
||||||
|
@ -514,6 +517,10 @@ video {
|
||||||
margin-left: 0.25rem;
|
margin-left: 0.25rem;
|
||||||
margin-right: 0.25rem;
|
margin-right: 0.25rem;
|
||||||
}
|
}
|
||||||
|
.mx-10 {
|
||||||
|
margin-left: 2.5rem;
|
||||||
|
margin-right: 2.5rem;
|
||||||
|
}
|
||||||
.mx-2 {
|
.mx-2 {
|
||||||
margin-left: 0.5rem;
|
margin-left: 0.5rem;
|
||||||
margin-right: 0.5rem;
|
margin-right: 0.5rem;
|
||||||
|
@ -538,6 +545,10 @@ video {
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
margin-right: auto;
|
margin-right: auto;
|
||||||
}
|
}
|
||||||
|
.my-0 {
|
||||||
|
margin-top: 0px;
|
||||||
|
margin-bottom: 0px;
|
||||||
|
}
|
||||||
.my-1 {
|
.my-1 {
|
||||||
margin-top: 0.25rem;
|
margin-top: 0.25rem;
|
||||||
margin-bottom: 0.25rem;
|
margin-bottom: 0.25rem;
|
||||||
|
@ -550,6 +561,10 @@ video {
|
||||||
margin-top: 1rem;
|
margin-top: 1rem;
|
||||||
margin-bottom: 1rem;
|
margin-bottom: 1rem;
|
||||||
}
|
}
|
||||||
|
.my-5 {
|
||||||
|
margin-top: 1.25rem;
|
||||||
|
margin-bottom: 1.25rem;
|
||||||
|
}
|
||||||
.my-auto {
|
.my-auto {
|
||||||
margin-top: auto;
|
margin-top: auto;
|
||||||
margin-bottom: auto;
|
margin-bottom: auto;
|
||||||
|
@ -563,6 +578,9 @@ video {
|
||||||
.-mb-8 {
|
.-mb-8 {
|
||||||
margin-bottom: -2rem;
|
margin-bottom: -2rem;
|
||||||
}
|
}
|
||||||
|
.-ml-4 {
|
||||||
|
margin-left: -1rem;
|
||||||
|
}
|
||||||
.-ml-6 {
|
.-ml-6 {
|
||||||
margin-left: -1.5rem;
|
margin-left: -1.5rem;
|
||||||
}
|
}
|
||||||
|
@ -599,6 +617,9 @@ video {
|
||||||
.mb-3 {
|
.mb-3 {
|
||||||
margin-bottom: 0.75rem;
|
margin-bottom: 0.75rem;
|
||||||
}
|
}
|
||||||
|
.mb-4 {
|
||||||
|
margin-bottom: 1rem;
|
||||||
|
}
|
||||||
.mb-8 {
|
.mb-8 {
|
||||||
margin-bottom: 2rem;
|
margin-bottom: 2rem;
|
||||||
}
|
}
|
||||||
|
@ -626,6 +647,9 @@ video {
|
||||||
.mr-5 {
|
.mr-5 {
|
||||||
margin-right: 1.25rem;
|
margin-right: 1.25rem;
|
||||||
}
|
}
|
||||||
|
.mr-7 {
|
||||||
|
margin-right: 1.75rem;
|
||||||
|
}
|
||||||
.mr-auto {
|
.mr-auto {
|
||||||
margin-right: auto;
|
margin-right: auto;
|
||||||
}
|
}
|
||||||
|
@ -861,6 +885,9 @@ video {
|
||||||
--tw-bg-opacity: 1;
|
--tw-bg-opacity: 1;
|
||||||
background-color: rgb(55 65 81 / var(--tw-bg-opacity));
|
background-color: rgb(55 65 81 / var(--tw-bg-opacity));
|
||||||
}
|
}
|
||||||
|
.bg-transparent {
|
||||||
|
background-color: transparent;
|
||||||
|
}
|
||||||
.bg-white {
|
.bg-white {
|
||||||
--tw-bg-opacity: 1;
|
--tw-bg-opacity: 1;
|
||||||
background-color: rgb(255 255 255 / var(--tw-bg-opacity));
|
background-color: rgb(255 255 255 / var(--tw-bg-opacity));
|
||||||
|
@ -871,6 +898,9 @@ video {
|
||||||
.bg-opacity-70 {
|
.bg-opacity-70 {
|
||||||
--tw-bg-opacity: 0.7;
|
--tw-bg-opacity: 0.7;
|
||||||
}
|
}
|
||||||
|
.p-4 {
|
||||||
|
padding: 1rem;
|
||||||
|
}
|
||||||
.p-5 {
|
.p-5 {
|
||||||
padding: 1.25rem;
|
padding: 1.25rem;
|
||||||
}
|
}
|
||||||
|
@ -902,6 +932,10 @@ video {
|
||||||
padding-top: 0.5rem;
|
padding-top: 0.5rem;
|
||||||
padding-bottom: 0.5rem;
|
padding-bottom: 0.5rem;
|
||||||
}
|
}
|
||||||
|
.py-3 {
|
||||||
|
padding-top: 0.75rem;
|
||||||
|
padding-bottom: 0.75rem;
|
||||||
|
}
|
||||||
.py-4 {
|
.py-4 {
|
||||||
padding-top: 1rem;
|
padding-top: 1rem;
|
||||||
padding-bottom: 1rem;
|
padding-bottom: 1rem;
|
||||||
|
|
|
@ -557,6 +557,10 @@ video {
|
||||||
left: 0px;
|
left: 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.right-0 {
|
||||||
|
right: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
.z-50 {
|
.z-50 {
|
||||||
z-index: 50;
|
z-index: 50;
|
||||||
}
|
}
|
||||||
|
@ -570,6 +574,11 @@ video {
|
||||||
margin-right: 0.25rem;
|
margin-right: 0.25rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.mx-10 {
|
||||||
|
margin-left: 2.5rem;
|
||||||
|
margin-right: 2.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
.mx-2 {
|
.mx-2 {
|
||||||
margin-left: 0.5rem;
|
margin-left: 0.5rem;
|
||||||
margin-right: 0.5rem;
|
margin-right: 0.5rem;
|
||||||
|
@ -600,6 +609,11 @@ video {
|
||||||
margin-right: auto;
|
margin-right: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.my-0 {
|
||||||
|
margin-top: 0px;
|
||||||
|
margin-bottom: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
.my-1 {
|
.my-1 {
|
||||||
margin-top: 0.25rem;
|
margin-top: 0.25rem;
|
||||||
margin-bottom: 0.25rem;
|
margin-bottom: 0.25rem;
|
||||||
|
@ -615,6 +629,11 @@ video {
|
||||||
margin-bottom: 1rem;
|
margin-bottom: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.my-5 {
|
||||||
|
margin-top: 1.25rem;
|
||||||
|
margin-bottom: 1.25rem;
|
||||||
|
}
|
||||||
|
|
||||||
.my-auto {
|
.my-auto {
|
||||||
margin-top: auto;
|
margin-top: auto;
|
||||||
margin-bottom: auto;
|
margin-bottom: auto;
|
||||||
|
@ -632,6 +651,10 @@ video {
|
||||||
margin-bottom: -2rem;
|
margin-bottom: -2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.-ml-4 {
|
||||||
|
margin-left: -1rem;
|
||||||
|
}
|
||||||
|
|
||||||
.-ml-6 {
|
.-ml-6 {
|
||||||
margin-left: -1.5rem;
|
margin-left: -1.5rem;
|
||||||
}
|
}
|
||||||
|
@ -680,6 +703,10 @@ video {
|
||||||
margin-bottom: 0.75rem;
|
margin-bottom: 0.75rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.mb-4 {
|
||||||
|
margin-bottom: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
.mb-8 {
|
.mb-8 {
|
||||||
margin-bottom: 2rem;
|
margin-bottom: 2rem;
|
||||||
}
|
}
|
||||||
|
@ -716,6 +743,10 @@ video {
|
||||||
margin-right: 1.25rem;
|
margin-right: 1.25rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.mr-7 {
|
||||||
|
margin-right: 1.75rem;
|
||||||
|
}
|
||||||
|
|
||||||
.mr-auto {
|
.mr-auto {
|
||||||
margin-right: auto;
|
margin-right: auto;
|
||||||
}
|
}
|
||||||
|
@ -1025,6 +1056,10 @@ video {
|
||||||
background-color: rgb(55 65 81 / var(--tw-bg-opacity));
|
background-color: rgb(55 65 81 / var(--tw-bg-opacity));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.bg-transparent {
|
||||||
|
background-color: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
.bg-white {
|
.bg-white {
|
||||||
--tw-bg-opacity: 1;
|
--tw-bg-opacity: 1;
|
||||||
background-color: rgb(255 255 255 / var(--tw-bg-opacity));
|
background-color: rgb(255 255 255 / var(--tw-bg-opacity));
|
||||||
|
@ -1038,6 +1073,10 @@ video {
|
||||||
--tw-bg-opacity: 0.7;
|
--tw-bg-opacity: 0.7;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.p-4 {
|
||||||
|
padding: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
.p-5 {
|
.p-5 {
|
||||||
padding: 1.25rem;
|
padding: 1.25rem;
|
||||||
}
|
}
|
||||||
|
@ -1077,6 +1116,11 @@ video {
|
||||||
padding-bottom: 0.5rem;
|
padding-bottom: 0.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.py-3 {
|
||||||
|
padding-top: 0.75rem;
|
||||||
|
padding-bottom: 0.75rem;
|
||||||
|
}
|
||||||
|
|
||||||
.py-4 {
|
.py-4 {
|
||||||
padding-top: 1rem;
|
padding-top: 1rem;
|
||||||
padding-bottom: 1rem;
|
padding-bottom: 1rem;
|
||||||
|
|
|
@ -31,14 +31,23 @@
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Using Include="DocuMed.Common.Extensions" />
|
<Using Include="DocuMed.Common.Extensions" />
|
||||||
<Using Include="DocuMed.Common.Models" />
|
<Using Include="DocuMed.Common.Models" />
|
||||||
|
<Using Include="DocuMed.Common.Models.Api" />
|
||||||
<Using Include="DocuMed.Common.Models.Claims" />
|
<Using Include="DocuMed.Common.Models.Claims" />
|
||||||
<Using Include="DocuMed.Common.Models.Entity" />
|
<Using Include="DocuMed.Common.Models.Entity" />
|
||||||
|
<Using Include="DocuMed.Common.Models.Exception" />
|
||||||
|
<Using Include="DocuMed.Domain.Dtos.LargDtos" />
|
||||||
|
<Using Include="DocuMed.Domain.Dtos.SmallDtos" />
|
||||||
|
<Using Include="DocuMed.Domain.Entities.MedicalHistoryTemplate" />
|
||||||
<Using Include="DocuMed.Domain.Entities.User" />
|
<Using Include="DocuMed.Domain.Entities.User" />
|
||||||
<Using Include="DocuMed.Domain.Enums" />
|
<Using Include="DocuMed.Domain.Enums" />
|
||||||
|
<Using Include="DocuMed.Domain.Mappers" />
|
||||||
<Using Include="DocuMed.Domain.Models.Settings" />
|
<Using Include="DocuMed.Domain.Models.Settings" />
|
||||||
|
<Using Include="DocuMed.Repository.Abstracts" />
|
||||||
<Using Include="DocuMed.Repository.Extensions" />
|
<Using Include="DocuMed.Repository.Extensions" />
|
||||||
<Using Include="DocuMed.Repository.Models" />
|
<Using Include="DocuMed.Repository.Models" />
|
||||||
|
<Using Include="DocuMed.Repository.Repositories.Base" />
|
||||||
<Using Include="DocuMed.Repository.Repositories.Base.Contracts" />
|
<Using Include="DocuMed.Repository.Repositories.Base.Contracts" />
|
||||||
|
<Using Include="DocuMed.Repository.Repositories.Entities.Abstracts" />
|
||||||
<Using Include="DocuMed.Repository.Services.Contracts" />
|
<Using Include="DocuMed.Repository.Services.Contracts" />
|
||||||
<Using Include="Microsoft.AspNetCore.Identity" />
|
<Using Include="Microsoft.AspNetCore.Identity" />
|
||||||
<Using Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" />
|
<Using Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" />
|
||||||
|
|
|
@ -0,0 +1,832 @@
|
||||||
|
// <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("20231022193344_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.Section", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreatedAt")
|
||||||
|
.HasColumnType("timestamp without time zone");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedBy")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Detail")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<bool>("IsRemoved")
|
||||||
|
.HasColumnType("boolean");
|
||||||
|
|
||||||
|
b.Property<DateTime>("ModifiedAt")
|
||||||
|
.HasColumnType("timestamp without time zone");
|
||||||
|
|
||||||
|
b.Property<string>("ModifiedBy")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Name")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<DateTime>("RemovedAt")
|
||||||
|
.HasColumnType("timestamp without time zone");
|
||||||
|
|
||||||
|
b.Property<string>("RemovedBy")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<Guid>("UniversityId")
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("UniversityId");
|
||||||
|
|
||||||
|
b.ToTable("Sections", "public");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("DocuMed.Domain.Entities.City.University", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<string>("Address")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<Guid>("CityId")
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreatedAt")
|
||||||
|
.HasColumnType("timestamp without time zone");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedBy")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<bool>("IsRemoved")
|
||||||
|
.HasColumnType("boolean");
|
||||||
|
|
||||||
|
b.Property<DateTime>("ModifiedAt")
|
||||||
|
.HasColumnType("timestamp without time zone");
|
||||||
|
|
||||||
|
b.Property<string>("ModifiedBy")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Name")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<DateTime>("RemovedAt")
|
||||||
|
.HasColumnType("timestamp without time zone");
|
||||||
|
|
||||||
|
b.Property<string>("RemovedBy")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("CityId");
|
||||||
|
|
||||||
|
b.ToTable("Universities", "public");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("DocuMed.Domain.Entities.MedicalHistory.MedicalHistory", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<string>("AddictionHistoryDetail")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<int>("Age")
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
b.Property<string>("AllergyDetail")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<Guid>("ApplicationUserId")
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
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.HasIndex("ApplicationUserId");
|
||||||
|
|
||||||
|
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<Guid>("ApplicationUserId")
|
||||||
|
.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.Property<Guid>("SectionId")
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("ApplicationUserId");
|
||||||
|
|
||||||
|
b.ToTable("MedicalHistoryTemplates", "public");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("DocuMed.Domain.Entities.User.ApplicationRole", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<string>("ConcurrencyStamp")
|
||||||
|
.IsConcurrencyToken()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Description")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("EnglishName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Name")
|
||||||
|
.HasMaxLength(256)
|
||||||
|
.HasColumnType("character varying(256)");
|
||||||
|
|
||||||
|
b.Property<string>("NormalizedName")
|
||||||
|
.HasMaxLength(256)
|
||||||
|
.HasColumnType("character varying(256)");
|
||||||
|
|
||||||
|
b.Property<string>("PersianName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("NormalizedName")
|
||||||
|
.IsUnique()
|
||||||
|
.HasDatabaseName("RoleNameIndex");
|
||||||
|
|
||||||
|
b.ToTable("Roles", "public");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("DocuMed.Domain.Entities.User.ApplicationUser", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<int>("AccessFailedCount")
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
b.Property<DateTime>("BirthDate")
|
||||||
|
.HasColumnType("timestamp without time zone");
|
||||||
|
|
||||||
|
b.Property<string>("ConcurrencyStamp")
|
||||||
|
.IsConcurrencyToken()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Email")
|
||||||
|
.HasMaxLength(256)
|
||||||
|
.HasColumnType("character varying(256)");
|
||||||
|
|
||||||
|
b.Property<bool>("EmailConfirmed")
|
||||||
|
.HasColumnType("boolean");
|
||||||
|
|
||||||
|
b.Property<string>("FirstName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<int>("Gender")
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
b.Property<string>("LastName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<bool>("LockoutEnabled")
|
||||||
|
.HasColumnType("boolean");
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset?>("LockoutEnd")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.Property<string>("NationalId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("NormalizedEmail")
|
||||||
|
.HasMaxLength(256)
|
||||||
|
.HasColumnType("character varying(256)");
|
||||||
|
|
||||||
|
b.Property<string>("NormalizedUserName")
|
||||||
|
.HasMaxLength(256)
|
||||||
|
.HasColumnType("character varying(256)");
|
||||||
|
|
||||||
|
b.Property<string>("PasswordHash")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("PhoneNumber")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<bool>("PhoneNumberConfirmed")
|
||||||
|
.HasColumnType("boolean");
|
||||||
|
|
||||||
|
b.Property<Guid?>("SectionId")
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<string>("SecurityStamp")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<int>("SignUpStatus")
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
b.Property<string>("StudentId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<bool>("TwoFactorEnabled")
|
||||||
|
.HasColumnType("boolean");
|
||||||
|
|
||||||
|
b.Property<Guid?>("UniversityId")
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<string>("UserName")
|
||||||
|
.HasMaxLength(256)
|
||||||
|
.HasColumnType("character varying(256)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("NormalizedEmail")
|
||||||
|
.HasDatabaseName("EmailIndex");
|
||||||
|
|
||||||
|
b.HasIndex("NormalizedUserName")
|
||||||
|
.IsUnique()
|
||||||
|
.HasDatabaseName("UserNameIndex");
|
||||||
|
|
||||||
|
b.HasIndex("SectionId");
|
||||||
|
|
||||||
|
b.HasIndex("UniversityId");
|
||||||
|
|
||||||
|
b.ToTable("Users", "public");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<System.Guid>", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<string>("ClaimType")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("ClaimValue")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<Guid>("RoleId")
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("RoleId");
|
||||||
|
|
||||||
|
b.ToTable("RoleClaims", "public");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<System.Guid>", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<string>("ClaimType")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("ClaimValue")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<Guid>("UserId")
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("UserId");
|
||||||
|
|
||||||
|
b.ToTable("Claims", "public");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<System.Guid>", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("LoginProvider")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("ProviderKey")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("ProviderDisplayName")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<Guid>("UserId")
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.HasKey("LoginProvider", "ProviderKey");
|
||||||
|
|
||||||
|
b.HasIndex("UserId");
|
||||||
|
|
||||||
|
b.ToTable("Logins", "public");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<System.Guid>", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("UserId")
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<Guid>("RoleId")
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.HasKey("UserId", "RoleId");
|
||||||
|
|
||||||
|
b.HasIndex("RoleId");
|
||||||
|
|
||||||
|
b.ToTable("UserRoles", "public");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<System.Guid>", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("UserId")
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<string>("LoginProvider")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Name")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Value")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.HasKey("UserId", "LoginProvider", "Name");
|
||||||
|
|
||||||
|
b.ToTable("Tokens", "public");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("DocuMed.Domain.Entities.City.Section", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("DocuMed.Domain.Entities.City.University", "University")
|
||||||
|
.WithMany("Sections")
|
||||||
|
.HasForeignKey("UniversityId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("University");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("DocuMed.Domain.Entities.City.University", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("DocuMed.Domain.Entities.City.City", "City")
|
||||||
|
.WithMany("Universities")
|
||||||
|
.HasForeignKey("CityId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("City");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("DocuMed.Domain.Entities.MedicalHistory.MedicalHistory", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("DocuMed.Domain.Entities.User.ApplicationUser", "ApplicationUser")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("ApplicationUserId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("ApplicationUser");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("DocuMed.Domain.Entities.MedicalHistory.MedicalHistoryAnswer", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("DocuMed.Domain.Entities.MedicalHistory.MedicalHistory", "MedicalHistory")
|
||||||
|
.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.MedicalHistoryTemplate.MedicalHistoryTemplate", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("DocuMed.Domain.Entities.User.ApplicationUser", "ApplicationUser")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("ApplicationUserId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("ApplicationUser");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("DocuMed.Domain.Entities.User.ApplicationUser", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("DocuMed.Domain.Entities.City.Section", "Section")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("SectionId");
|
||||||
|
|
||||||
|
b.HasOne("DocuMed.Domain.Entities.City.University", "University")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("UniversityId");
|
||||||
|
|
||||||
|
b.Navigation("Section");
|
||||||
|
|
||||||
|
b.Navigation("University");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<System.Guid>", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("DocuMed.Domain.Entities.User.ApplicationRole", null)
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("RoleId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<System.Guid>", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("DocuMed.Domain.Entities.User.ApplicationUser", null)
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<System.Guid>", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("DocuMed.Domain.Entities.User.ApplicationUser", null)
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<System.Guid>", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("DocuMed.Domain.Entities.User.ApplicationRole", null)
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("RoleId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("DocuMed.Domain.Entities.User.ApplicationUser", null)
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<System.Guid>", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("DocuMed.Domain.Entities.User.ApplicationUser", null)
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("DocuMed.Domain.Entities.City.City", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Universities");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("DocuMed.Domain.Entities.City.University", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Sections");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("DocuMed.Domain.Entities.MedicalHistory.MedicalHistory", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Answers");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("DocuMed.Domain.Entities.MedicalHistoryTemplate.MedicalHistoryTemplate", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Questions");
|
||||||
|
});
|
||||||
|
#pragma warning restore 612, 618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,570 @@
|
||||||
|
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: "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: "RoleClaims",
|
||||||
|
schema: "public",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<int>(type: "integer", nullable: false)
|
||||||
|
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||||
|
RoleId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
|
ClaimType = table.Column<string>(type: "text", nullable: true),
|
||||||
|
ClaimValue = table.Column<string>(type: "text", nullable: true)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_RoleClaims", x => x.Id);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_RoleClaims_Roles_RoleId",
|
||||||
|
column: x => x.RoleId,
|
||||||
|
principalSchema: "public",
|
||||||
|
principalTable: "Roles",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "Sections",
|
||||||
|
schema: "public",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
|
Name = table.Column<string>(type: "text", nullable: false),
|
||||||
|
Detail = table.Column<string>(type: "text", nullable: false),
|
||||||
|
UniversityId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
|
RemovedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
||||||
|
CreatedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
||||||
|
CreatedBy = table.Column<string>(type: "text", nullable: false),
|
||||||
|
IsRemoved = table.Column<bool>(type: "boolean", nullable: false),
|
||||||
|
RemovedBy = table.Column<string>(type: "text", nullable: false),
|
||||||
|
ModifiedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
||||||
|
ModifiedBy = table.Column<string>(type: "text", nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_Sections", x => x.Id);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_Sections_Universities_UniversityId",
|
||||||
|
column: x => x.UniversityId,
|
||||||
|
principalSchema: "public",
|
||||||
|
principalTable: "Universities",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "Users",
|
||||||
|
schema: "public",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
|
FirstName = table.Column<string>(type: "text", nullable: false),
|
||||||
|
LastName = table.Column<string>(type: "text", nullable: false),
|
||||||
|
NationalId = table.Column<string>(type: "text", nullable: false),
|
||||||
|
StudentId = table.Column<string>(type: "text", nullable: false),
|
||||||
|
BirthDate = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
||||||
|
Gender = table.Column<int>(type: "integer", nullable: false),
|
||||||
|
SignUpStatus = table.Column<int>(type: "integer", nullable: false),
|
||||||
|
UniversityId = table.Column<Guid>(type: "uuid", nullable: true),
|
||||||
|
SectionId = table.Column<Guid>(type: "uuid", nullable: true),
|
||||||
|
UserName = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
|
||||||
|
NormalizedUserName = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
|
||||||
|
Email = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
|
||||||
|
NormalizedEmail = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
|
||||||
|
EmailConfirmed = table.Column<bool>(type: "boolean", nullable: false),
|
||||||
|
PasswordHash = table.Column<string>(type: "text", nullable: true),
|
||||||
|
SecurityStamp = table.Column<string>(type: "text", nullable: true),
|
||||||
|
ConcurrencyStamp = table.Column<string>(type: "text", nullable: true),
|
||||||
|
PhoneNumber = table.Column<string>(type: "text", nullable: true),
|
||||||
|
PhoneNumberConfirmed = table.Column<bool>(type: "boolean", nullable: false),
|
||||||
|
TwoFactorEnabled = table.Column<bool>(type: "boolean", nullable: false),
|
||||||
|
LockoutEnd = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: true),
|
||||||
|
LockoutEnabled = table.Column<bool>(type: "boolean", nullable: false),
|
||||||
|
AccessFailedCount = table.Column<int>(type: "integer", nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_Users", x => x.Id);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_Users_Sections_SectionId",
|
||||||
|
column: x => x.SectionId,
|
||||||
|
principalSchema: "public",
|
||||||
|
principalTable: "Sections",
|
||||||
|
principalColumn: "Id");
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_Users_Universities_UniversityId",
|
||||||
|
column: x => x.UniversityId,
|
||||||
|
principalSchema: "public",
|
||||||
|
principalTable: "Universities",
|
||||||
|
principalColumn: "Id");
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "Claims",
|
||||||
|
schema: "public",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<int>(type: "integer", nullable: false)
|
||||||
|
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||||
|
UserId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
|
ClaimType = table.Column<string>(type: "text", nullable: true),
|
||||||
|
ClaimValue = table.Column<string>(type: "text", nullable: true)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_Claims", x => x.Id);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_Claims_Users_UserId",
|
||||||
|
column: x => x.UserId,
|
||||||
|
principalSchema: "public",
|
||||||
|
principalTable: "Users",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "Logins",
|
||||||
|
schema: "public",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
LoginProvider = table.Column<string>(type: "text", nullable: false),
|
||||||
|
ProviderKey = table.Column<string>(type: "text", nullable: false),
|
||||||
|
ProviderDisplayName = table.Column<string>(type: "text", nullable: true),
|
||||||
|
UserId = table.Column<Guid>(type: "uuid", nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_Logins", x => new { x.LoginProvider, x.ProviderKey });
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_Logins_Users_UserId",
|
||||||
|
column: x => x.UserId,
|
||||||
|
principalSchema: "public",
|
||||||
|
principalTable: "Users",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "MedicalHistories",
|
||||||
|
schema: "public",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
|
ChiefComplaint = table.Column<string>(type: "text", nullable: false),
|
||||||
|
Section = table.Column<string>(type: "text", nullable: false),
|
||||||
|
FirstName = table.Column<string>(type: "text", nullable: false),
|
||||||
|
LastName = table.Column<string>(type: "text", nullable: false),
|
||||||
|
FatherName = table.Column<string>(type: "text", nullable: false),
|
||||||
|
NationalId = table.Column<string>(type: "text", nullable: false),
|
||||||
|
Age = table.Column<int>(type: "integer", nullable: false),
|
||||||
|
BirthDate = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
||||||
|
PresentIllnessDetail = table.Column<string>(type: "text", nullable: false),
|
||||||
|
PastDiseasesHistoryDetail = table.Column<string>(type: "text", nullable: false),
|
||||||
|
PastSurgeryHistoryDetail = table.Column<string>(type: "text", nullable: false),
|
||||||
|
FamilyHistoryDetail = table.Column<string>(type: "text", nullable: false),
|
||||||
|
AllergyDetail = table.Column<string>(type: "text", nullable: false),
|
||||||
|
DrugHistoryDetail = table.Column<string>(type: "text", nullable: false),
|
||||||
|
AddictionHistoryDetail = table.Column<string>(type: "text", nullable: false),
|
||||||
|
SystemReviewDetail = table.Column<string>(type: "text", nullable: false),
|
||||||
|
VitalSignDetail = table.Column<string>(type: "text", nullable: false),
|
||||||
|
SystolicBloodPressure = table.Column<int>(type: "integer", nullable: false),
|
||||||
|
DiastolicBloodPressure = table.Column<int>(type: "integer", nullable: false),
|
||||||
|
PulseRate = table.Column<int>(type: "integer", nullable: false),
|
||||||
|
SPO2 = table.Column<int>(type: "integer", nullable: false),
|
||||||
|
Temperature = table.Column<int>(type: "integer", nullable: false),
|
||||||
|
ApplicationUserId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
|
RemovedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
||||||
|
CreatedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
||||||
|
CreatedBy = table.Column<string>(type: "text", nullable: false),
|
||||||
|
IsRemoved = table.Column<bool>(type: "boolean", nullable: false),
|
||||||
|
RemovedBy = table.Column<string>(type: "text", nullable: false),
|
||||||
|
ModifiedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
||||||
|
ModifiedBy = table.Column<string>(type: "text", nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_MedicalHistories", x => x.Id);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_MedicalHistories_Users_ApplicationUserId",
|
||||||
|
column: x => x.ApplicationUserId,
|
||||||
|
principalSchema: "public",
|
||||||
|
principalTable: "Users",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "MedicalHistoryTemplates",
|
||||||
|
schema: "public",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
|
ChiefComplaint = table.Column<string>(type: "text", nullable: false),
|
||||||
|
SectionId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
|
ApplicationUserId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
|
RemovedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
||||||
|
CreatedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
||||||
|
CreatedBy = table.Column<string>(type: "text", nullable: false),
|
||||||
|
IsRemoved = table.Column<bool>(type: "boolean", nullable: false),
|
||||||
|
RemovedBy = table.Column<string>(type: "text", nullable: false),
|
||||||
|
ModifiedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
||||||
|
ModifiedBy = table.Column<string>(type: "text", nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_MedicalHistoryTemplates", x => x.Id);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_MedicalHistoryTemplates_Users_ApplicationUserId",
|
||||||
|
column: x => x.ApplicationUserId,
|
||||||
|
principalSchema: "public",
|
||||||
|
principalTable: "Users",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "Tokens",
|
||||||
|
schema: "public",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
UserId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
|
LoginProvider = table.Column<string>(type: "text", nullable: false),
|
||||||
|
Name = table.Column<string>(type: "text", nullable: false),
|
||||||
|
Value = table.Column<string>(type: "text", nullable: true)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_Tokens", x => new { x.UserId, x.LoginProvider, x.Name });
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_Tokens_Users_UserId",
|
||||||
|
column: x => x.UserId,
|
||||||
|
principalSchema: "public",
|
||||||
|
principalTable: "Users",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "UserRoles",
|
||||||
|
schema: "public",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
UserId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
|
RoleId = table.Column<Guid>(type: "uuid", nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_UserRoles", x => new { x.UserId, x.RoleId });
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_UserRoles_Roles_RoleId",
|
||||||
|
column: x => x.RoleId,
|
||||||
|
principalSchema: "public",
|
||||||
|
principalTable: "Roles",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_UserRoles_Users_UserId",
|
||||||
|
column: x => x.UserId,
|
||||||
|
principalSchema: "public",
|
||||||
|
principalTable: "Users",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "MedicalHistoryAnswers",
|
||||||
|
schema: "public",
|
||||||
|
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.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_MedicalHistories_ApplicationUserId",
|
||||||
|
schema: "public",
|
||||||
|
table: "MedicalHistories",
|
||||||
|
column: "ApplicationUserId");
|
||||||
|
|
||||||
|
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_MedicalHistoryTemplates_ApplicationUserId",
|
||||||
|
schema: "public",
|
||||||
|
table: "MedicalHistoryTemplates",
|
||||||
|
column: "ApplicationUserId");
|
||||||
|
|
||||||
|
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_Sections_UniversityId",
|
||||||
|
schema: "public",
|
||||||
|
table: "Sections",
|
||||||
|
column: "UniversityId");
|
||||||
|
|
||||||
|
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_SectionId",
|
||||||
|
schema: "public",
|
||||||
|
table: "Users",
|
||||||
|
column: "SectionId");
|
||||||
|
|
||||||
|
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: "Sections",
|
||||||
|
schema: "public");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "Universities",
|
||||||
|
schema: "public");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "Cities",
|
||||||
|
schema: "public");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,829 @@
|
||||||
|
// <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.Section", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreatedAt")
|
||||||
|
.HasColumnType("timestamp without time zone");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedBy")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Detail")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<bool>("IsRemoved")
|
||||||
|
.HasColumnType("boolean");
|
||||||
|
|
||||||
|
b.Property<DateTime>("ModifiedAt")
|
||||||
|
.HasColumnType("timestamp without time zone");
|
||||||
|
|
||||||
|
b.Property<string>("ModifiedBy")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Name")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<DateTime>("RemovedAt")
|
||||||
|
.HasColumnType("timestamp without time zone");
|
||||||
|
|
||||||
|
b.Property<string>("RemovedBy")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<Guid>("UniversityId")
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("UniversityId");
|
||||||
|
|
||||||
|
b.ToTable("Sections", "public");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("DocuMed.Domain.Entities.City.University", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<string>("Address")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<Guid>("CityId")
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<DateTime>("CreatedAt")
|
||||||
|
.HasColumnType("timestamp without time zone");
|
||||||
|
|
||||||
|
b.Property<string>("CreatedBy")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<bool>("IsRemoved")
|
||||||
|
.HasColumnType("boolean");
|
||||||
|
|
||||||
|
b.Property<DateTime>("ModifiedAt")
|
||||||
|
.HasColumnType("timestamp without time zone");
|
||||||
|
|
||||||
|
b.Property<string>("ModifiedBy")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Name")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<DateTime>("RemovedAt")
|
||||||
|
.HasColumnType("timestamp without time zone");
|
||||||
|
|
||||||
|
b.Property<string>("RemovedBy")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("CityId");
|
||||||
|
|
||||||
|
b.ToTable("Universities", "public");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("DocuMed.Domain.Entities.MedicalHistory.MedicalHistory", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<string>("AddictionHistoryDetail")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<int>("Age")
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
b.Property<string>("AllergyDetail")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<Guid>("ApplicationUserId")
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
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.HasIndex("ApplicationUserId");
|
||||||
|
|
||||||
|
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<Guid>("ApplicationUserId")
|
||||||
|
.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.Property<Guid>("SectionId")
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("ApplicationUserId");
|
||||||
|
|
||||||
|
b.ToTable("MedicalHistoryTemplates", "public");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("DocuMed.Domain.Entities.User.ApplicationRole", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<string>("ConcurrencyStamp")
|
||||||
|
.IsConcurrencyToken()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Description")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("EnglishName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Name")
|
||||||
|
.HasMaxLength(256)
|
||||||
|
.HasColumnType("character varying(256)");
|
||||||
|
|
||||||
|
b.Property<string>("NormalizedName")
|
||||||
|
.HasMaxLength(256)
|
||||||
|
.HasColumnType("character varying(256)");
|
||||||
|
|
||||||
|
b.Property<string>("PersianName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("NormalizedName")
|
||||||
|
.IsUnique()
|
||||||
|
.HasDatabaseName("RoleNameIndex");
|
||||||
|
|
||||||
|
b.ToTable("Roles", "public");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("DocuMed.Domain.Entities.User.ApplicationUser", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<int>("AccessFailedCount")
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
b.Property<DateTime>("BirthDate")
|
||||||
|
.HasColumnType("timestamp without time zone");
|
||||||
|
|
||||||
|
b.Property<string>("ConcurrencyStamp")
|
||||||
|
.IsConcurrencyToken()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Email")
|
||||||
|
.HasMaxLength(256)
|
||||||
|
.HasColumnType("character varying(256)");
|
||||||
|
|
||||||
|
b.Property<bool>("EmailConfirmed")
|
||||||
|
.HasColumnType("boolean");
|
||||||
|
|
||||||
|
b.Property<string>("FirstName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<int>("Gender")
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
b.Property<string>("LastName")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<bool>("LockoutEnabled")
|
||||||
|
.HasColumnType("boolean");
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset?>("LockoutEnd")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.Property<string>("NationalId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("NormalizedEmail")
|
||||||
|
.HasMaxLength(256)
|
||||||
|
.HasColumnType("character varying(256)");
|
||||||
|
|
||||||
|
b.Property<string>("NormalizedUserName")
|
||||||
|
.HasMaxLength(256)
|
||||||
|
.HasColumnType("character varying(256)");
|
||||||
|
|
||||||
|
b.Property<string>("PasswordHash")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("PhoneNumber")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<bool>("PhoneNumberConfirmed")
|
||||||
|
.HasColumnType("boolean");
|
||||||
|
|
||||||
|
b.Property<Guid?>("SectionId")
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<string>("SecurityStamp")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<int>("SignUpStatus")
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
b.Property<string>("StudentId")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<bool>("TwoFactorEnabled")
|
||||||
|
.HasColumnType("boolean");
|
||||||
|
|
||||||
|
b.Property<Guid?>("UniversityId")
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<string>("UserName")
|
||||||
|
.HasMaxLength(256)
|
||||||
|
.HasColumnType("character varying(256)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("NormalizedEmail")
|
||||||
|
.HasDatabaseName("EmailIndex");
|
||||||
|
|
||||||
|
b.HasIndex("NormalizedUserName")
|
||||||
|
.IsUnique()
|
||||||
|
.HasDatabaseName("UserNameIndex");
|
||||||
|
|
||||||
|
b.HasIndex("SectionId");
|
||||||
|
|
||||||
|
b.HasIndex("UniversityId");
|
||||||
|
|
||||||
|
b.ToTable("Users", "public");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<System.Guid>", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<string>("ClaimType")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("ClaimValue")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<Guid>("RoleId")
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("RoleId");
|
||||||
|
|
||||||
|
b.ToTable("RoleClaims", "public");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<System.Guid>", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<string>("ClaimType")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("ClaimValue")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<Guid>("UserId")
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("UserId");
|
||||||
|
|
||||||
|
b.ToTable("Claims", "public");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<System.Guid>", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("LoginProvider")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("ProviderKey")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("ProviderDisplayName")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<Guid>("UserId")
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.HasKey("LoginProvider", "ProviderKey");
|
||||||
|
|
||||||
|
b.HasIndex("UserId");
|
||||||
|
|
||||||
|
b.ToTable("Logins", "public");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<System.Guid>", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("UserId")
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<Guid>("RoleId")
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.HasKey("UserId", "RoleId");
|
||||||
|
|
||||||
|
b.HasIndex("RoleId");
|
||||||
|
|
||||||
|
b.ToTable("UserRoles", "public");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<System.Guid>", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("UserId")
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<string>("LoginProvider")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Name")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Value")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.HasKey("UserId", "LoginProvider", "Name");
|
||||||
|
|
||||||
|
b.ToTable("Tokens", "public");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("DocuMed.Domain.Entities.City.Section", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("DocuMed.Domain.Entities.City.University", "University")
|
||||||
|
.WithMany("Sections")
|
||||||
|
.HasForeignKey("UniversityId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("University");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("DocuMed.Domain.Entities.City.University", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("DocuMed.Domain.Entities.City.City", "City")
|
||||||
|
.WithMany("Universities")
|
||||||
|
.HasForeignKey("CityId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("City");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("DocuMed.Domain.Entities.MedicalHistory.MedicalHistory", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("DocuMed.Domain.Entities.User.ApplicationUser", "ApplicationUser")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("ApplicationUserId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("ApplicationUser");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("DocuMed.Domain.Entities.MedicalHistory.MedicalHistoryAnswer", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("DocuMed.Domain.Entities.MedicalHistory.MedicalHistory", "MedicalHistory")
|
||||||
|
.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.MedicalHistoryTemplate.MedicalHistoryTemplate", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("DocuMed.Domain.Entities.User.ApplicationUser", "ApplicationUser")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("ApplicationUserId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("ApplicationUser");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("DocuMed.Domain.Entities.User.ApplicationUser", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("DocuMed.Domain.Entities.City.Section", "Section")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("SectionId");
|
||||||
|
|
||||||
|
b.HasOne("DocuMed.Domain.Entities.City.University", "University")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("UniversityId");
|
||||||
|
|
||||||
|
b.Navigation("Section");
|
||||||
|
|
||||||
|
b.Navigation("University");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<System.Guid>", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("DocuMed.Domain.Entities.User.ApplicationRole", null)
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("RoleId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<System.Guid>", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("DocuMed.Domain.Entities.User.ApplicationUser", null)
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<System.Guid>", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("DocuMed.Domain.Entities.User.ApplicationUser", null)
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<System.Guid>", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("DocuMed.Domain.Entities.User.ApplicationRole", null)
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("RoleId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("DocuMed.Domain.Entities.User.ApplicationUser", null)
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<System.Guid>", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("DocuMed.Domain.Entities.User.ApplicationUser", null)
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Restrict)
|
||||||
|
.IsRequired();
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("DocuMed.Domain.Entities.City.City", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Universities");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("DocuMed.Domain.Entities.City.University", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Sections");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("DocuMed.Domain.Entities.MedicalHistory.MedicalHistory", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Answers");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("DocuMed.Domain.Entities.MedicalHistoryTemplate.MedicalHistoryTemplate", b =>
|
||||||
|
{
|
||||||
|
b.Navigation("Questions");
|
||||||
|
});
|
||||||
|
#pragma warning restore 612, 618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,10 +1,14 @@
|
||||||
namespace DocuMed.Repository.Repositories.Base
|
using DocuMed.Repository.Abstracts;
|
||||||
|
|
||||||
|
namespace DocuMed.Repository.Repositories.Base
|
||||||
{
|
{
|
||||||
public class BaseRepository<T> : Repository<T>, IBaseRepository<T> where T : class, IApiEntity
|
public class BaseRepository<T> : Repository<T>, IBaseRepository<T> where T : class, IApiEntity
|
||||||
{
|
{
|
||||||
public BaseRepository(ApplicationContext dbContext) : base(dbContext)
|
protected readonly ICurrentUserService CurrentUserService;
|
||||||
{
|
|
||||||
|
|
||||||
|
public BaseRepository(ApplicationContext dbContext,ICurrentUserService currentUserService) : base(dbContext)
|
||||||
|
{
|
||||||
|
CurrentUserService = currentUserService;
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual async ValueTask<T> GetByIdAsync(CancellationToken cancellationToken, params object[] ids)
|
public virtual async ValueTask<T> GetByIdAsync(CancellationToken cancellationToken, params object[] ids)
|
||||||
|
@ -55,13 +59,32 @@
|
||||||
public virtual void Delete(T entity)
|
public virtual void Delete(T entity)
|
||||||
{
|
{
|
||||||
AssertExtensions.NotNull(entity, nameof(entity));
|
AssertExtensions.NotNull(entity, nameof(entity));
|
||||||
Entities.Remove(entity);
|
|
||||||
|
Entities.Entry(entity).Property(e => e.RemovedAt)
|
||||||
|
.CurrentValue = DateTime.Now;
|
||||||
|
Entities.Entry(entity).Property(e => e.IsRemoved)
|
||||||
|
.CurrentValue = true;
|
||||||
|
if (CurrentUserService.UserName != null)
|
||||||
|
Entities.Entry(entity).Property(e => e.RemovedBy)
|
||||||
|
.CurrentValue = CurrentUserService.UserName;
|
||||||
|
Entities.Update(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void DeleteRange(IEnumerable<T> entities)
|
public virtual void DeleteRange(IEnumerable<T> entities)
|
||||||
{
|
{
|
||||||
AssertExtensions.NotNull(entities, nameof(entities));
|
var apiEntities = entities.ToList();
|
||||||
Entities.RemoveRange(entities);
|
AssertExtensions.NotNull(apiEntities, nameof(entities));
|
||||||
|
foreach (var entity in apiEntities)
|
||||||
|
{
|
||||||
|
Entities.Entry(entity).Property(e => e.RemovedAt)
|
||||||
|
.CurrentValue = DateTime.Now;
|
||||||
|
Entities.Entry(entity).Property(e => e.IsRemoved)
|
||||||
|
.CurrentValue = true;
|
||||||
|
if (CurrentUserService.UserName != null)
|
||||||
|
Entities.Entry(entity).Property(e => e.RemovedBy)
|
||||||
|
.CurrentValue = CurrentUserService.UserName;
|
||||||
|
Entities.Update(entity);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
|
@ -2,13 +2,15 @@
|
||||||
public class RepositoryWrapper : IRepositoryWrapper
|
public class RepositoryWrapper : IRepositoryWrapper
|
||||||
{
|
{
|
||||||
private readonly ApplicationContext _context;
|
private readonly ApplicationContext _context;
|
||||||
|
private readonly ICurrentUserService _currentUserService;
|
||||||
private IDbContextTransaction? _currentTransaction;
|
private IDbContextTransaction? _currentTransaction;
|
||||||
public RepositoryWrapper(ApplicationContext context)
|
public RepositoryWrapper(ApplicationContext context,ICurrentUserService currentUserService)
|
||||||
{
|
{
|
||||||
_context = context;
|
_context = context;
|
||||||
|
_currentUserService = currentUserService;
|
||||||
}
|
}
|
||||||
|
|
||||||
public IBaseRepository<T> SetRepository<T>() where T : ApiEntity => new BaseRepository<T>(_context);
|
public IBaseRepository<T> SetRepository<T>() where T : ApiEntity => new BaseRepository<T>(_context, _currentUserService);
|
||||||
|
|
||||||
|
|
||||||
public async Task RollBackAsync(CancellationToken cancellationToken)
|
public async Task RollBackAsync(CancellationToken cancellationToken)
|
||||||
|
@ -42,20 +44,21 @@ public class RepositoryWrapper : IRepositoryWrapper
|
||||||
{
|
{
|
||||||
entity.Property(e => e.CreatedAt)
|
entity.Property(e => e.CreatedAt)
|
||||||
.CurrentValue = DateTime.Now;
|
.CurrentValue = DateTime.Now;
|
||||||
|
if (_currentUserService.UserName != null)
|
||||||
|
entity.Property(e => e.CreatedBy)
|
||||||
|
.CurrentValue = _currentUserService.UserName;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (entity.State == EntityState.Modified)
|
if (entity.State == EntityState.Modified)
|
||||||
|
{
|
||||||
|
if (!entity.Property(e => e.IsRemoved).CurrentValue)
|
||||||
{
|
{
|
||||||
entity.Property(e => e.ModifiedAt)
|
entity.Property(e => e.ModifiedAt)
|
||||||
.CurrentValue = DateTime.Now;
|
.CurrentValue = DateTime.Now;
|
||||||
|
if (_currentUserService.UserName != null)
|
||||||
|
entity.Property(e => e.ModifiedBy)
|
||||||
|
.CurrentValue = _currentUserService.UserName;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (entity.State == EntityState.Deleted)
|
|
||||||
{
|
|
||||||
entity.Property(e => e.RemovedAt)
|
|
||||||
.CurrentValue = DateTime.Now;
|
|
||||||
entity.Property(e => e.IsRemoved)
|
|
||||||
.CurrentValue = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
namespace DocuMed.Repository.Repositories.Entities.Abstracts;
|
||||||
|
|
||||||
|
public interface IMedicalHistoryTemplateRepository : IBaseRepository<MedicalHistoryTemplate>,IScopedDependency
|
||||||
|
{
|
||||||
|
public Task<List<MedicalHistoryTemplateSDto>> GetMedicalHistoryTemplatesAsync(int page = 0, CancellationToken cancellationToken = default);
|
||||||
|
public Task<MedicalHistoryTemplateLDto> GetMedicalHistoryTemplateAsync(Guid id, CancellationToken cancellationToken = default);
|
||||||
|
}
|
|
@ -0,0 +1,32 @@
|
||||||
|
namespace DocuMed.Repository.Repositories.Entities;
|
||||||
|
|
||||||
|
public class MedicalHistoryTemplateRepository : BaseRepository<MedicalHistoryTemplate>, IMedicalHistoryTemplateRepository
|
||||||
|
{
|
||||||
|
public MedicalHistoryTemplateRepository(ApplicationContext dbContext,ICurrentUserService currentUserService) : base(dbContext,currentUserService)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<List<MedicalHistoryTemplateSDto>> GetMedicalHistoryTemplatesAsync(int page = 0, CancellationToken cancellationToken = default)
|
||||||
|
{
|
||||||
|
if (!Guid.TryParse(CurrentUserService.UserId, out Guid userId))
|
||||||
|
throw new AppException("توکن غیرمجاز", ApiResultStatusCode.UnAuthorized);
|
||||||
|
var list = await TableNoTracking
|
||||||
|
.Where(t => t.ApplicationUserId == userId)
|
||||||
|
.OrderByDescending(t => t.CreatedAt)
|
||||||
|
.Skip(page * 15)
|
||||||
|
.Take(15)
|
||||||
|
.Select(MedicalHistoryTemplateMapper.ProjectToSDto)
|
||||||
|
.ToListAsync(cancellationToken);
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<MedicalHistoryTemplateLDto> GetMedicalHistoryTemplateAsync(Guid id, CancellationToken cancellationToken = default)
|
||||||
|
{
|
||||||
|
var dto = await TableNoTracking.Where(t => t.Id == id)
|
||||||
|
.Select(MedicalHistoryTemplateMapper.ProjectToLDto)
|
||||||
|
.FirstOrDefaultAsync(cancellationToken);
|
||||||
|
if (dto == null)
|
||||||
|
throw new AppException("پیش نویس پیدا نشد", ApiResultStatusCode.NotFound);
|
||||||
|
return dto;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue