diff --git a/.version b/.version index b8e6ed9..cb36e65 100644 --- a/.version +++ b/.version @@ -1 +1 @@ -0.1.0.3 \ No newline at end of file +1.2.1.0 \ No newline at end of file diff --git a/DocuMed.Api/Controllers/CityController.cs b/DocuMed.Api/Controllers/CityController.cs index 87cf33e..8374d24 100644 --- a/DocuMed.Api/Controllers/CityController.cs +++ b/DocuMed.Api/Controllers/CityController.cs @@ -6,6 +6,10 @@ public class CityController : ICarterModule { var group = app.NewVersionedApi("City").MapGroup($"api/city"); + group.MapGet("university/{cityId}", GetAllCityUniversityAsync) + .WithDisplayName("GetAllCityUniversity") + .HasApiVersion(1.0); + group.MapGet("", GetAllAsync) .WithDisplayName("GetAll") .HasApiVersion(1.0); @@ -24,6 +28,11 @@ public class CityController : ICarterModule .HasApiVersion(1.0); } + public virtual async Task GetAllCityUniversityAsync(Guid cityId, IRepositoryWrapper repositoryWrapper, CancellationToken cancellationToken) + => TypedResults.Ok(await repositoryWrapper.SetRepository().TableNoTracking + .Where(c=>c.CityId==cityId) + .Select(UniversityMapper.ProjectToSDto) + .ToListAsync(cancellationToken)); // GET:Get All Entity public virtual async Task GetAllAsync([FromQuery] int page, IRepositoryWrapper repositoryWrapper, CancellationToken cancellationToken) diff --git a/DocuMed.Api/Controllers/HealthController.cs b/DocuMed.Api/Controllers/HealthController.cs new file mode 100644 index 0000000..9de5cdd --- /dev/null +++ b/DocuMed.Api/Controllers/HealthController.cs @@ -0,0 +1,33 @@ +using MD.PersianDateTime.Standard; +using System.Diagnostics; + +namespace DocuMed.Api.Controllers; + +public class HealthController : ICarterModule +{ + public void AddRoutes(IEndpointRouteBuilder app) + { + var group = app.NewVersionedApi("Health") + .MapGroup($"health"); + + group.MapGet("", GetHealth) + .WithDisplayName("CheckHealth") + .HasApiVersion(1.0); + } + public IResult GetHealth() + { + var version = typeof(Program)?.Assembly.GetName()?.Version?.ToString(); + var check = new HealthCheck + { + Health = true, + Version = version ?? string.Empty, + StartAt = System.Diagnostics.Process.GetCurrentProcess().StartTime.ToString("F"), + StartAtPersian = new PersianDateTime(System.Diagnostics.Process.GetCurrentProcess().StartTime).ToLongDateTimeString(), + MachineName = Environment.MachineName + }; + var process = Process.GetCurrentProcess(); + check.TotalMemory = process.PrivateMemorySize64.ToString(); + + return TypedResults.Ok(check); + } +} \ No newline at end of file diff --git a/DocuMed.Api/Controllers/MedicalHistoryController.cs b/DocuMed.Api/Controllers/MedicalHistoryController.cs index 12f8c54..a9ec8c8 100644 --- a/DocuMed.Api/Controllers/MedicalHistoryController.cs +++ b/DocuMed.Api/Controllers/MedicalHistoryController.cs @@ -12,6 +12,10 @@ public class MedicalHistoryController : ICarterModule .WithDisplayName("GetAll") .HasApiVersion(1.0); + group.MapGet("/filter", GetAllByFilterAsync) + .WithDisplayName("GetAllByFilter") + .HasApiVersion(1.0); + group.MapGet("{id}", GetAsync) .WithDisplayName("GetOne") .HasApiVersion(1.0); @@ -27,6 +31,13 @@ public class MedicalHistoryController : ICarterModule } + + // GET:Get All Entity + public virtual async Task GetAllByFilterAsync([FromQuery]DayQueryFilter dayQuery,[FromQuery] int page, IMedicalHistoryRepository repository, CancellationToken cancellationToken) + { + return TypedResults.Ok(await repository.GetMedicalHistoriesByFilterAsync(dayQuery , page, cancellationToken)); + } + // GET:Get All Entity public virtual async Task GetAllAsync([FromQuery] int page, IMedicalHistoryRepository repository, CancellationToken cancellationToken) { diff --git a/DocuMed.Api/Controllers/UniversityController.cs b/DocuMed.Api/Controllers/UniversityController.cs index 38381eb..123c21b 100644 --- a/DocuMed.Api/Controllers/UniversityController.cs +++ b/DocuMed.Api/Controllers/UniversityController.cs @@ -29,7 +29,8 @@ public class UniversityController : ICarterModule // GET:Get All Entity public virtual async Task GetAllAsync([FromQuery] int page, IRepositoryWrapper repositoryWrapper, CancellationToken cancellationToken) - => TypedResults.Ok(await repositoryWrapper.SetRepository().TableNoTracking + => TypedResults.Ok(await repositoryWrapper.SetRepository() + .TableNoTracking .Select(UniversityMapper.ProjectToSDto).ToListAsync(cancellationToken)); // GET:Get An Entity By Id diff --git a/DocuMed.Api/DocuMed.Api.csproj b/DocuMed.Api/DocuMed.Api.csproj index 8a1c44d..f57b1c5 100644 --- a/DocuMed.Api/DocuMed.Api.csproj +++ b/DocuMed.Api/DocuMed.Api.csproj @@ -6,8 +6,8 @@ enable Linux ..\docker-compose.dcproj - 0.1.0.3 - 0.1.0.3 + 1.2.1.0 + 1.2.1.0 @@ -79,6 +79,7 @@ + diff --git a/DocuMed.Common/Models/Api/HealthCheck.cs b/DocuMed.Common/Models/Api/HealthCheck.cs index 409410d..f699af3 100644 --- a/DocuMed.Common/Models/Api/HealthCheck.cs +++ b/DocuMed.Common/Models/Api/HealthCheck.cs @@ -3,7 +3,10 @@ public class HealthCheck { public bool Health { get; set; } - public string Version { get; set; } - public string TotalMemory { get; set; } + public string Version { get; set; } = string.Empty; + public string TotalMemory { get; set; } = string.Empty; + public string StartAt { get; set; } = string.Empty; + public string StartAtPersian { get; set; } = string.Empty; + public string MachineName { get; set; } = string.Empty; } } \ No newline at end of file diff --git a/DocuMed.Core/EntityServices/MedicalHistoryService.cs b/DocuMed.Core/EntityServices/MedicalHistoryService.cs index a519f1b..8ae0ab8 100644 --- a/DocuMed.Core/EntityServices/MedicalHistoryService.cs +++ b/DocuMed.Core/EntityServices/MedicalHistoryService.cs @@ -28,6 +28,7 @@ public class MedicalHistoryService : IMedicalHistoryService template.SystolicBloodPressure, template.DiastolicBloodPressure, template.PulseRate, template.SPO2, template.Temperature, template.ApplicationUserId, template.MedicalHistoryTemplateId); ent.Id = template.Id; + ent.CreatedAt = template.CreatedAt; foreach (var answer in template.Answers.Where(a=>a.Id == Guid.Empty)) @@ -38,7 +39,7 @@ public class MedicalHistoryService : IMedicalHistoryService { var dbAnswer = await _repositoryWrapper.SetRepository().TableNoTracking .FirstOrDefaultAsync(a => a.Id == answer.Id, cancellationToken); - if (dbAnswer != null && dbAnswer.Answer != answer.Answer) + if (dbAnswer != null && dbAnswer.Answer != answer.Answer && answer.Answer != null) { dbAnswer = MedicalHistoryAnswer.Create(answer.Answer, answer.Question, answer.Part, answer.QuestionType, dbAnswer.MedicalHistoryId); diff --git a/DocuMed.Domain/DocuMed.Domain.csproj b/DocuMed.Domain/DocuMed.Domain.csproj index d7ac189..fd6620d 100644 --- a/DocuMed.Domain/DocuMed.Domain.csproj +++ b/DocuMed.Domain/DocuMed.Domain.csproj @@ -60,7 +60,9 @@ + + diff --git a/DocuMed.Domain/Dtos/LargDtos/MedicalHistoryLDto.cs b/DocuMed.Domain/Dtos/LargDtos/MedicalHistoryLDto.cs index 21c44a6..099379b 100644 --- a/DocuMed.Domain/Dtos/LargDtos/MedicalHistoryLDto.cs +++ b/DocuMed.Domain/Dtos/LargDtos/MedicalHistoryLDto.cs @@ -9,7 +9,7 @@ public class MedicalHistoryLDto : BaseDto public string LastName { get; set; } = string.Empty; public string FatherName { get; set; } = string.Empty; public string NationalId { get; set; } = string.Empty; - public int Age { get; set; } + public int Age { get; set; } = 30; public DateTime BirthDate { get; set; } public SectionSDto Section { get; set; } = new(); @@ -26,12 +26,13 @@ public class MedicalHistoryLDto : BaseDto public string GeneralAppearanceDetail { get; set; } = string.Empty; public Guid MedicalHistoryTemplateId { get; set; } - public int SystolicBloodPressure { get; set; } - public int DiastolicBloodPressure { get; set; } - public int PulseRate { get; set; } - public int SPO2 { get; set; } - public int Temperature { get; set; } + public double SystolicBloodPressure { get; set; } = 120; + public double DiastolicBloodPressure { get; set; } = 80; + public double PulseRate { get; set; } = 70; + public double SPO2 { get; set; } = 99; + public double Temperature { get; set; } = 37; public Guid ApplicationUserId { get; set; } + public DateTime CreatedAt { get; set; } public List Answers { get; set; } = new(); } \ No newline at end of file diff --git a/DocuMed.Domain/Dtos/LargDtos/MedicalHistoryTemplateLDto.cs b/DocuMed.Domain/Dtos/LargDtos/MedicalHistoryTemplateLDto.cs index 77582c7..85be626 100644 --- a/DocuMed.Domain/Dtos/LargDtos/MedicalHistoryTemplateLDto.cs +++ b/DocuMed.Domain/Dtos/LargDtos/MedicalHistoryTemplateLDto.cs @@ -7,5 +7,6 @@ public class MedicalHistoryTemplateLDto : BaseDto Questions { get; set; } = new(); } \ No newline at end of file diff --git a/DocuMed.Domain/Dtos/SmallDtos/MedicalHistorySDto.cs b/DocuMed.Domain/Dtos/SmallDtos/MedicalHistorySDto.cs index 614b6f1..7b8e232 100644 --- a/DocuMed.Domain/Dtos/SmallDtos/MedicalHistorySDto.cs +++ b/DocuMed.Domain/Dtos/SmallDtos/MedicalHistorySDto.cs @@ -26,11 +26,12 @@ public class MedicalHistorySDto : BaseDto public string GeneralAppearanceDetail { get; set; } = string.Empty; - public int SystolicBloodPressure { get; set; } - public int DiastolicBloodPressure { get; set; } - public int PulseRate { get; set; } - public int SPO2 { get; set; } - public int Temperature { get; set; } + public double SystolicBloodPressure { get; set; } + public double DiastolicBloodPressure { get; set; } + public double PulseRate { get; set; } + public double SPO2 { get; set; } + public double Temperature { get; set; } public string FullName => FirstName + " " + LastName; public Guid ApplicationUserId { get; set; } + public DateTime CreatedAt { get; set; } } \ No newline at end of file diff --git a/DocuMed.Domain/Dtos/SmallDtos/MedicalHistoryTemplateSDto.cs b/DocuMed.Domain/Dtos/SmallDtos/MedicalHistoryTemplateSDto.cs index 15b292a..bc5df1f 100644 --- a/DocuMed.Domain/Dtos/SmallDtos/MedicalHistoryTemplateSDto.cs +++ b/DocuMed.Domain/Dtos/SmallDtos/MedicalHistoryTemplateSDto.cs @@ -6,4 +6,5 @@ public class MedicalHistoryTemplateSDto : BaseDto(), - Id = p21.Id + Id = p21.Id, + CreatedAt = p21.CreatedAt }; public static MedicalHistoryLDto AdaptToLDto(this MedicalHistory p23) { @@ -386,6 +395,7 @@ namespace DocuMed.Domain.Mappers SPO2 = p23.SPO2, Temperature = p23.Temperature, ApplicationUserId = p23.ApplicationUserId, + CreatedAt = p23.CreatedAt, Answers = funcMain6(p23.Answers), Id = p23.Id }; @@ -424,6 +434,7 @@ namespace DocuMed.Domain.Mappers result.SPO2 = p25.SPO2; result.Temperature = p25.Temperature; result.ApplicationUserId = p25.ApplicationUserId; + result.CreatedAt = p25.CreatedAt; result.Answers = funcMain8(p25.Answers, result.Answers); result.Id = p25.Id; return result; @@ -463,6 +474,7 @@ namespace DocuMed.Domain.Mappers SPO2 = p31.SPO2, Temperature = p31.Temperature, ApplicationUserId = p31.ApplicationUserId, + CreatedAt = p31.CreatedAt, Answers = p31.Answers.Select(p32 => new MedicalHistoryAnswerSDto() { Answer = p32.Answer, diff --git a/DocuMed.Domain/Mappers/MedicalHistoryTemplateMapper.g.cs b/DocuMed.Domain/Mappers/MedicalHistoryTemplateMapper.g.cs index cf9061c..5268a79 100644 --- a/DocuMed.Domain/Mappers/MedicalHistoryTemplateMapper.g.cs +++ b/DocuMed.Domain/Mappers/MedicalHistoryTemplateMapper.g.cs @@ -18,7 +18,8 @@ namespace DocuMed.Domain.Mappers ChiefComplaint = p1.ChiefComplaint, SectionId = p1.SectionId, ApplicationUserId = p1.ApplicationUserId, - Id = p1.Id + Id = p1.Id, + CreatedAt = p1.CreatedAt }; } public static MedicalHistoryTemplate AdaptTo(this MedicalHistoryTemplateSDto p2, MedicalHistoryTemplate p3) @@ -33,6 +34,7 @@ namespace DocuMed.Domain.Mappers result.SectionId = p2.SectionId; result.ApplicationUserId = p2.ApplicationUserId; result.Id = p2.Id; + result.CreatedAt = p2.CreatedAt; return result; } @@ -41,7 +43,8 @@ namespace DocuMed.Domain.Mappers ChiefComplaint = p4.ChiefComplaint, SectionId = p4.SectionId, ApplicationUserId = p4.ApplicationUserId, - Id = p4.Id + Id = p4.Id, + CreatedAt = p4.CreatedAt }; public static MedicalHistoryTemplateSDto AdaptToSDto(this MedicalHistoryTemplate p5) { @@ -51,6 +54,7 @@ namespace DocuMed.Domain.Mappers SectionName = p5.Section == null ? null : p5.Section.Name, SectionId = p5.SectionId, ApplicationUserId = p5.ApplicationUserId, + CreatedAt = p5.CreatedAt, Id = p5.Id }; } @@ -66,6 +70,7 @@ namespace DocuMed.Domain.Mappers result.SectionName = p6.Section == null ? null : p6.Section.Name; result.SectionId = p6.SectionId; result.ApplicationUserId = p6.ApplicationUserId; + result.CreatedAt = p6.CreatedAt; result.Id = p6.Id; return result; @@ -76,6 +81,7 @@ namespace DocuMed.Domain.Mappers SectionName = p8.Section.Name, SectionId = p8.SectionId, ApplicationUserId = p8.ApplicationUserId, + CreatedAt = p8.CreatedAt, Id = p8.Id }; public static MedicalHistoryTemplate AdaptToMedicalHistoryTemplate(this MedicalHistoryTemplateLDto p9) @@ -93,7 +99,8 @@ namespace DocuMed.Domain.Mappers }, ApplicationUserId = p9.ApplicationUserId, Questions = funcMain1(p9.Questions), - Id = p9.Id + Id = p9.Id, + CreatedAt = p9.CreatedAt }; } public static MedicalHistoryTemplate AdaptTo(this MedicalHistoryTemplateLDto p11, MedicalHistoryTemplate p12) @@ -110,6 +117,7 @@ namespace DocuMed.Domain.Mappers result.ApplicationUserId = p11.ApplicationUserId; result.Questions = funcMain3(p11.Questions, result.Questions); result.Id = p11.Id; + result.CreatedAt = p11.CreatedAt; return result; } @@ -136,7 +144,8 @@ namespace DocuMed.Domain.Mappers MedicalHistoryTemplateId = p18.MedicalHistoryTemplateId, Id = p18.Id }).ToList(), - Id = p17.Id + Id = p17.Id, + CreatedAt = p17.CreatedAt }; public static MedicalHistoryTemplateLDto AdaptToLDto(this MedicalHistoryTemplate p19) { @@ -152,6 +161,7 @@ namespace DocuMed.Domain.Mappers Id = p19.Section.Id }, ApplicationUserId = p19.ApplicationUserId, + CreatedAt = p19.CreatedAt, Questions = funcMain4(p19.Questions), Id = p19.Id }; @@ -168,6 +178,7 @@ namespace DocuMed.Domain.Mappers result.SectionId = p21.SectionId; result.Section = funcMain5(p21.Section, result.Section); result.ApplicationUserId = p21.ApplicationUserId; + result.CreatedAt = p21.CreatedAt; result.Questions = funcMain6(p21.Questions, result.Questions); result.Id = p21.Id; return result; @@ -185,6 +196,7 @@ namespace DocuMed.Domain.Mappers Id = p27.Section.Id }, ApplicationUserId = p27.ApplicationUserId, + CreatedAt = p27.CreatedAt, Questions = p27.Questions.Select(p28 => new MedicalHistoryQuestionSDto() { Question = p28.Question, diff --git a/DocuMed.PWA/DocuMed.PWA.csproj b/DocuMed.PWA/DocuMed.PWA.csproj index 1812b8d..288c53d 100644 --- a/DocuMed.PWA/DocuMed.PWA.csproj +++ b/DocuMed.PWA/DocuMed.PWA.csproj @@ -7,8 +7,8 @@ enable enable service-worker-assets.js - 1.0.0.3 - 1.0.0.3 + 1.2.1.0 + 1.2.1.0 @@ -49,6 +49,7 @@ + diff --git a/DocuMed.PWA/Models/Address.cs b/DocuMed.PWA/Models/Address.cs index 0c2f4af..bcbba83 100644 --- a/DocuMed.PWA/Models/Address.cs +++ b/DocuMed.PWA/Models/Address.cs @@ -4,6 +4,7 @@ public static class Address { #if DEBUG public static string BaseAddress = "http://localhost:32770/api"; + //public static string BaseAddress = "https://api.documed.ir/api"; #else public static string BaseAddress = "https://api.documed.ir/api"; #endif diff --git a/DocuMed.PWA/Pages/HomePage.razor b/DocuMed.PWA/Pages/HomePage.razor index c383541..21b5461 100644 --- a/DocuMed.PWA/Pages/HomePage.razor +++ b/DocuMed.PWA/Pages/HomePage.razor @@ -24,11 +24,24 @@
-

شرح حال های امروز شما

-

لیست شرح حال های انجام شده در امروز

+

شرح حال های شما

+

لیست شرح حال های

- + افزودن + + + افزودن
+ +

امروز

+

دیروز

+

یک هفته اخیر

+
+ @if (@ViewModel.IsProcessing) {
diff --git a/DocuMed.PWA/Pages/HomePage.razor.cs b/DocuMed.PWA/Pages/HomePage.razor.cs index 4a20b97..3a96518 100644 --- a/DocuMed.PWA/Pages/HomePage.razor.cs +++ b/DocuMed.PWA/Pages/HomePage.razor.cs @@ -1,4 +1,5 @@ using DocuMed.Common.Models.Mapper; +using DocuMed.Domain.Enums.QueryFilters; namespace DocuMed.PWA.Pages; @@ -7,6 +8,7 @@ public class HomePageViewModel : BaseViewModel> private readonly IUserUtility _userUtility; private readonly IRestWrapper _restWrapper; private readonly ISnackbar _snackbar; + public DayQueryFilter SelectedDayFilter { get; set; } = DayQueryFilter.Today; public HomePageViewModel(IUserUtility userUtility,IRestWrapper restWrapper,ISnackbar snackbar) { @@ -28,8 +30,8 @@ public class HomePageViewModel : BaseViewModel> User = await _userUtility.GetUserAsync(); var token = await _userUtility.GetBearerTokenAsync(); var list = await _restWrapper - .CrudDtoApiRest(Address.MedicalHistoryController) - .ReadAll(0, token); + .MedicalHistoryRestApi + .GetAllByFilterAsync(SelectedDayFilter, 0, token); PageDto = list; } @@ -51,4 +53,10 @@ public class HomePageViewModel : BaseViewModel> await base.InitializeAsync(); } + + public async Task SelectDayFilter(DayQueryFilter day) + { + SelectedDayFilter = day; + await InitializeAsync(); + } } \ No newline at end of file diff --git a/DocuMed.PWA/Pages/Index.razor b/DocuMed.PWA/Pages/Index.razor index 281df96..f2f0cee 100644 --- a/DocuMed.PWA/Pages/Index.razor +++ b/DocuMed.PWA/Pages/Index.razor @@ -11,9 +11,9 @@ } /* .secondary-border>.mud-input-control-input-container>.mud-input.mud-input-outlined>input:focus~.mud-input-outlined-border { - border-color: #FD5523; - color: white; - } */ + border-color: #FD5523; + color: white; + } */
@@ -150,46 +150,48 @@

- - - + + + + - - - - -
- -

منتظر بمانید

-
-
-
-
- -

@e.Name

-
-
+ + + + +
+ +

منتظر بمانید

+
+
+
+
+ +

@e.Name

+
+
- - - - -
- -

منتظر بمانید

-
-
-
-
- -

@e.Name

-
-
+ + + + +
+ +

منتظر بمانید

+
+
+
+
+ +

@e.Name

+
+
+
(Address.UniversityController).ReadAll(0, token); - } - if (uni.IsNullOrEmpty()) + await _confirmSignUpForm!.Validate(); return _universities; + } + var token = await UserUtility.GetBearerTokenAsync(); + _universities = await RestWrapper.CityRestApi.GetUniversitiesAsync(_selectedCity.Id, token); return _universities.Where(c => c.Name.Contains(uni)); } catch (ApiException ex) diff --git a/DocuMed.PWA/Pages/MedicalHistoryActionPage.razor b/DocuMed.PWA/Pages/MedicalHistoryActionPage.razor index ea9cce1..d9f1997 100644 --- a/DocuMed.PWA/Pages/MedicalHistoryActionPage.razor +++ b/DocuMed.PWA/Pages/MedicalHistoryActionPage.razor @@ -68,7 +68,7 @@
-
+
@@ -84,7 +84,7 @@ { ویرایش + class="font-extrabold rounded-full text-white bg-[--color-primary]">ویرایش } else { diff --git a/DocuMed.PWA/Pages/MedicalHistoryActionPage.razor.cs b/DocuMed.PWA/Pages/MedicalHistoryActionPage.razor.cs index d1dadf8..2e9e449 100644 --- a/DocuMed.PWA/Pages/MedicalHistoryActionPage.razor.cs +++ b/DocuMed.PWA/Pages/MedicalHistoryActionPage.razor.cs @@ -36,7 +36,17 @@ public class MedicalHistoryActionPageViewModel : BaseViewModel _selectedTemplate; + set + { + _selectedTemplate = value; + PageDto.ChiefComplaint = _selectedTemplate.ChiefComplaint; + } + } public MedicalHistoryTemplateLDto SelectedTemplateLDto { get; set; } = new(); public bool IsEditing { get; set; } = false; @@ -97,6 +107,18 @@ public class MedicalHistoryActionPageViewModel : BaseViewModel(Address.SectionController) + .ReadOne(user.SectionId, token); + SelectedSelection = section; + } + } await base.InitializeAsync(); } @@ -105,7 +127,26 @@ public class MedicalHistoryActionPageViewModel : BaseViewModel(); + PageDto.ChiefComplaint = dto.ChiefComplaint; } catch (ApiException ex) { @@ -157,6 +199,7 @@ public class MedicalHistoryActionPageViewModel : BaseViewModel - - - - - - - -
- -

منتظر بمانید

-
-
-
-
- -

@e.ChiefComplaint

-
-
+ + + + + - - - - -
- -

منتظر بمانید

-
-
-
-
- -

@e.Name

-
-
+ + + + + + +
+ +

منتظر بمانید

+
+
+
+
+ +

@e.Name

+
+
+ + + + + + + +
+ +

منتظر بمانید

+
+
+
+
+ +

@e.ChiefComplaint

+
+
+
+ +
@code diff --git a/DocuMed.PWA/Pages/MedicalHistoryActionParts/MedicalHistoryActionStep2.razor b/DocuMed.PWA/Pages/MedicalHistoryActionParts/MedicalHistoryActionStep2.razor index 7bb79d2..9f744ed 100644 --- a/DocuMed.PWA/Pages/MedicalHistoryActionParts/MedicalHistoryActionStep2.razor +++ b/DocuMed.PWA/Pages/MedicalHistoryActionParts/MedicalHistoryActionStep2.razor @@ -5,7 +5,7 @@ @foreach (var question in PiQuestions) { - + } diff --git a/DocuMed.PWA/Pages/MedicalHistoryActionParts/MedicalHistoryActionStep3.razor b/DocuMed.PWA/Pages/MedicalHistoryActionParts/MedicalHistoryActionStep3.razor index 2ca236c..79fe541 100644 --- a/DocuMed.PWA/Pages/MedicalHistoryActionParts/MedicalHistoryActionStep3.razor +++ b/DocuMed.PWA/Pages/MedicalHistoryActionParts/MedicalHistoryActionStep3.razor @@ -4,7 +4,7 @@ @foreach (var question in PdhQuestions) { - + } @@ -17,7 +17,7 @@ @foreach (var question in PshQuestions) { - + } pi.Question == dto.Question && pi.Part == dto.Part); + var findAnswer = PshAnswers.FirstOrDefault(pi => pi.Question == dto.Question && pi.Part == dto.Part); if (findAnswer != null) findAnswer.Answer = dto.Answer; else - PdhAnswers.Add(dto); + PshAnswers.Add(dto); } } \ No newline at end of file diff --git a/DocuMed.PWA/Pages/MedicalHistoryActionParts/MedicalHistoryActionStep4.razor b/DocuMed.PWA/Pages/MedicalHistoryActionParts/MedicalHistoryActionStep4.razor index 526817a..11d0c71 100644 --- a/DocuMed.PWA/Pages/MedicalHistoryActionParts/MedicalHistoryActionStep4.razor +++ b/DocuMed.PWA/Pages/MedicalHistoryActionParts/MedicalHistoryActionStep4.razor @@ -13,7 +13,7 @@
@foreach (var question in DhQuestions) { - + }
@@ -25,7 +25,7 @@
@foreach (var question in HhQuestions) { - + }
diff --git a/DocuMed.PWA/Pages/MedicalHistoryActionParts/MedicalHistoryActionStep5.razor b/DocuMed.PWA/Pages/MedicalHistoryActionParts/MedicalHistoryActionStep5.razor index 288cbb2..30458b0 100644 --- a/DocuMed.PWA/Pages/MedicalHistoryActionParts/MedicalHistoryActionStep5.razor +++ b/DocuMed.PWA/Pages/MedicalHistoryActionParts/MedicalHistoryActionStep5.razor @@ -4,7 +4,7 @@
@foreach (var question in GaQuestions) { - + }
@@ -14,40 +14,47 @@ -
-

فشــــار خون

- - + +
+

فشــــار خون

+ + - -
-
- - - - - - -
+
+
+ + + + + + + +
+ -
+
@foreach (var question in RosQuestions) { - + }
@@ -122,38 +129,38 @@ RosAnswers.Add(dto); } - - [Parameter] - public int SystolicBloodPressure { get; set; } [Parameter] - public EventCallback SystolicBloodPressureChanged { get; set; } - - - [Parameter] - public int DiastolicBloodPressure { get; set; } + public double SystolicBloodPressure { get; set; } [Parameter] - public EventCallback DiastolicBloodPressureChanged { get; set; } - - - [Parameter] - public int PulseRate { get; set; } - - [Parameter] - public EventCallback PulseRateChanged { get; set; } + public EventCallback SystolicBloodPressureChanged { get; set; } [Parameter] - public int SPO2 { get; set; } + public double DiastolicBloodPressure { get; set; } [Parameter] - public EventCallback SPO2Changed { get; set; } + public EventCallback DiastolicBloodPressureChanged { get; set; } [Parameter] - public int Temperature { get; set; } + public double PulseRate { get; set; } [Parameter] - public EventCallback TemperatureChanged { get; set; } + public EventCallback PulseRateChanged { get; set; } + + + [Parameter] + public double SPO2 { get; set; } + + [Parameter] + public EventCallback SPO2Changed { get; set; } + + + [Parameter] + public double Temperature { get; set; } + + [Parameter] + public EventCallback TemperatureChanged { get; set; } } \ No newline at end of file diff --git a/DocuMed.PWA/Pages/MedicalHistoryTemplateActionPage.razor b/DocuMed.PWA/Pages/MedicalHistoryTemplateActionPage.razor index 3e2fe7e..b25c8c8 100644 --- a/DocuMed.PWA/Pages/MedicalHistoryTemplateActionPage.razor +++ b/DocuMed.PWA/Pages/MedicalHistoryTemplateActionPage.razor @@ -5,41 +5,41 @@ @inject IUserUtility UserUtility @inject ISnackbar Snackbar - + -
+
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/DocuMed.PWA/Pages/MedicalHistoryTemplateActionPage.razor.cs b/DocuMed.PWA/Pages/MedicalHistoryTemplateActionPage.razor.cs index 52189fa..87eaae2 100644 --- a/DocuMed.PWA/Pages/MedicalHistoryTemplateActionPage.razor.cs +++ b/DocuMed.PWA/Pages/MedicalHistoryTemplateActionPage.razor.cs @@ -187,6 +187,8 @@ public class MedicalHistoryTemplateActionPageViewModel : BaseViewModel - + @foreach (var item in PdhQuestions) { diff --git a/DocuMed.PWA/Pages/MedicalHistoryTemplateActionParts/MedicalHistoryTemplateActionStep4.razor b/DocuMed.PWA/Pages/MedicalHistoryTemplateActionParts/MedicalHistoryTemplateActionStep4.razor index 1db9548..a829250 100644 --- a/DocuMed.PWA/Pages/MedicalHistoryTemplateActionParts/MedicalHistoryTemplateActionStep4.razor +++ b/DocuMed.PWA/Pages/MedicalHistoryTemplateActionParts/MedicalHistoryTemplateActionStep4.razor @@ -58,7 +58,7 @@
- + + diff --git a/DocuMed.PWA/Pages/MedicalHistoryTemplateActionParts/MedicalHistoryTemplateActionStep5.razor b/DocuMed.PWA/Pages/MedicalHistoryTemplateActionParts/MedicalHistoryTemplateActionStep5.razor index 252bc41..80ff258 100644 --- a/DocuMed.PWA/Pages/MedicalHistoryTemplateActionParts/MedicalHistoryTemplateActionStep5.razor +++ b/DocuMed.PWA/Pages/MedicalHistoryTemplateActionParts/MedicalHistoryTemplateActionStep5.razor @@ -12,7 +12,7 @@
- + + diff --git a/DocuMed.PWA/Pages/MedicalHistoryTemplatesPage.razor b/DocuMed.PWA/Pages/MedicalHistoryTemplatesPage.razor index d845910..54d08b4 100644 --- a/DocuMed.PWA/Pages/MedicalHistoryTemplatesPage.razor +++ b/DocuMed.PWA/Pages/MedicalHistoryTemplatesPage.razor @@ -5,7 +5,7 @@ @inject IUserUtility UserUtility - +

تمامی پیش نویس های شما

diff --git a/DocuMed.PWA/Pages/ProfilePage.razor.cs b/DocuMed.PWA/Pages/ProfilePage.razor.cs index 4ccdadd..be7561d 100644 --- a/DocuMed.PWA/Pages/ProfilePage.razor.cs +++ b/DocuMed.PWA/Pages/ProfilePage.razor.cs @@ -68,6 +68,7 @@ public class ProfilePageViewModel : BaseViewModel { request.SectionId = SelectedSection.Id; User.SectionId = SelectedSection.Id; + User.SectionName = SelectedSection.Name; } await RestWrapper.UserRestApi.UpdateUserAsync(request, token); await UserUtility.SetUserAsync(User); diff --git a/DocuMed.PWA/Program.cs b/DocuMed.PWA/Program.cs index acfb30c..c119745 100644 --- a/DocuMed.PWA/Program.cs +++ b/DocuMed.PWA/Program.cs @@ -7,7 +7,7 @@ builder.Services.AddMudServices(config => config.SnackbarConfiguration.HideTransitionDuration = 200; config.SnackbarConfiguration.ShowTransitionDuration = 200; config.SnackbarConfiguration.SnackbarVariant = Variant.Filled; - config.SnackbarConfiguration.PositionClass = Defaults.Classes.Position.BottomRight; + config.SnackbarConfiguration.PositionClass = Defaults.Classes.Position.BottomCenter; }); builder.Services.AddScoped(); builder.Services.AddScoped(); diff --git a/DocuMed.PWA/Services/RestServices/ICityRestApi.cs b/DocuMed.PWA/Services/RestServices/ICityRestApi.cs new file mode 100644 index 0000000..3d1c83e --- /dev/null +++ b/DocuMed.PWA/Services/RestServices/ICityRestApi.cs @@ -0,0 +1,8 @@ +namespace DocuMed.PWA.Services.RestServices; + +public interface ICityRestApi +{ + + [Get("/university/{cityId}")] + Task> GetUniversitiesAsync(Guid cityId, [Header("Authorization")] string authorization); +} \ No newline at end of file diff --git a/DocuMed.PWA/Services/RestServices/IMedicalHistoryRestApi.cs b/DocuMed.PWA/Services/RestServices/IMedicalHistoryRestApi.cs new file mode 100644 index 0000000..3af9732 --- /dev/null +++ b/DocuMed.PWA/Services/RestServices/IMedicalHistoryRestApi.cs @@ -0,0 +1,8 @@ +namespace DocuMed.PWA.Services.RestServices; + +public interface IMedicalHistoryRestApi +{ + + [Get("/filter")] + Task> GetAllByFilterAsync([Query] DayQueryFilter dayQuery, [Query] int page, [Header("Authorization")] string authorization); +} \ No newline at end of file diff --git a/DocuMed.PWA/Services/RestServices/IRestWrapper.cs b/DocuMed.PWA/Services/RestServices/IRestWrapper.cs index ea9fdaf..e0b36c9 100644 --- a/DocuMed.PWA/Services/RestServices/IRestWrapper.cs +++ b/DocuMed.PWA/Services/RestServices/IRestWrapper.cs @@ -8,5 +8,7 @@ public interface IRestWrapper public IAuthRestApi AuthRestApi { get; } public ISectionRestApi SectionRestApi { get; } + public ICityRestApi CityRestApi { get; } public IUserRestApi UserRestApi { get; } + public IMedicalHistoryRestApi MedicalHistoryRestApi { get; } } \ No newline at end of file diff --git a/DocuMed.PWA/Services/RestServices/RestWrapper.cs b/DocuMed.PWA/Services/RestServices/RestWrapper.cs index 76826dd..23f7237 100644 --- a/DocuMed.PWA/Services/RestServices/RestWrapper.cs +++ b/DocuMed.PWA/Services/RestServices/RestWrapper.cs @@ -22,5 +22,7 @@ public class RestWrapper : IRestWrapper } public IAuthRestApi AuthRestApi => RestService.For(Address.AuthController, setting); public ISectionRestApi SectionRestApi => RestService.For(Address.SectionController, setting); + public ICityRestApi CityRestApi => RestService.For(Address.CityController, setting); public IUserRestApi UserRestApi => RestService.For(Address.UserController, setting); + public IMedicalHistoryRestApi MedicalHistoryRestApi => RestService.For(Address.MedicalHistoryController); } \ No newline at end of file diff --git a/DocuMed.PWA/Shared/ItemTemplates/MedicalHistoryItemTemplate.razor b/DocuMed.PWA/Shared/ItemTemplates/MedicalHistoryItemTemplate.razor index 267787c..07d3d7c 100644 --- a/DocuMed.PWA/Shared/ItemTemplates/MedicalHistoryItemTemplate.razor +++ b/DocuMed.PWA/Shared/ItemTemplates/MedicalHistoryItemTemplate.razor @@ -1,4 +1,5 @@ @using DocuMed.Domain.Dtos.SmallDtos +@using MD.PersianDateTime.Standard
@@ -11,17 +12,22 @@
- + -

شکایت اصلی : @MedicalHistory.ChiefComplaint

+

@MedicalHistory.ChiefComplaint

- + بخش @MedicalHistory.SectionName + + + @MedicalHistory.CreatedAt.ToPersianDateTime().ToShortDateString() + +
diff --git a/DocuMed.PWA/Shared/MainLayout.razor b/DocuMed.PWA/Shared/MainLayout.razor index 244b577..312741c 100644 --- a/DocuMed.PWA/Shared/MainLayout.razor +++ b/DocuMed.PWA/Shared/MainLayout.razor @@ -1,6 +1,29 @@ @using Toolbelt.Blazor.PWA.Updater +@using Toolbelt.Blazor.PWA.Updater.Service @inherits LayoutComponentBase +@inject IPWAUpdaterService PwaUpdaterService + @@ -9,7 +32,9 @@
@Body - +
+ +
@@ -28,8 +53,14 @@ Secondary = "#FD5523", } }; + + private string _updateText = "! نسخه جدید داکیومد رسید"; protected override void OnInitialized() { + string? version = typeof(Program)?.Assembly.GetName()?.Version?.ToString(); + if (version != null) + _updateText = $"نسخه جدید داکیومد رسید - {version}"; + base.OnInitialized(); } diff --git a/DocuMed.PWA/Shared/MedicalTemplates/BaseMedicalQuestionTemplate.razor b/DocuMed.PWA/Shared/MedicalTemplates/BaseMedicalQuestionTemplate.razor index 7177001..8760c7a 100644 --- a/DocuMed.PWA/Shared/MedicalTemplates/BaseMedicalQuestionTemplate.razor +++ b/DocuMed.PWA/Shared/MedicalTemplates/BaseMedicalQuestionTemplate.razor @@ -1,29 +1,33 @@ @switch (Question.QuestionType) { case MedicalHistoryQuestionType.Selective: - + break; case MedicalHistoryQuestionType.Hourly: - + break; case MedicalHistoryQuestionType.Interrogatively: - + break; case MedicalHistoryQuestionType.YesOrNo: - + break; case MedicalHistoryQuestionType.RosSelective: - + break; default: - + break; } @code { + [Parameter] public MedicalHistoryQuestionSDto Question { get; set; } = new(); + [Parameter] + public MedicalHistoryAnswerSDto OldAnswer { get; set; } = new(); + [Parameter] public MedicalHistoryAnswerSDto Answer { get; set; } = new(); @@ -39,6 +43,8 @@ Answer = answer, Part = Question.Part }; + if (OldAnswer.Id != Guid.Empty) + Answer.Id = OldAnswer.Id; await AnswerChanged.InvokeAsync(Answer); } diff --git a/DocuMed.PWA/Shared/MedicalTemplates/HourMedicalQuestionTemplate.razor b/DocuMed.PWA/Shared/MedicalTemplates/HourMedicalQuestionTemplate.razor index 5dedd2c..fdbd940 100644 --- a/DocuMed.PWA/Shared/MedicalTemplates/HourMedicalQuestionTemplate.razor +++ b/DocuMed.PWA/Shared/MedicalTemplates/HourMedicalQuestionTemplate.razor @@ -14,12 +14,16 @@ @code { - protected override void OnParametersSet() + public override async Task SetParametersAsync(ParameterView parameters) { - base.OnParametersSet(); - if (!Answer.IsNullOrEmpty() && int.TryParse(Answer, out int hCounter)) + await base.SetParametersAsync(parameters); + if (!OldAnswer.IsNullOrEmpty() && int.TryParse(OldAnswer, out int hCounter)) { + if (_hourCounter == hCounter) + return; _hourCounter = hCounter; + Answer = _hourCounter.ToString(); + await AnswerChanged.InvokeAsync(Answer); } } @@ -28,6 +32,9 @@ [Parameter] public string Answer { get; set; } = string.Empty; + [Parameter] + public string OldAnswer { get; set; } = string.Empty; + [Parameter] public EventCallback AnswerChanged { get; set; } @@ -43,6 +50,8 @@ private async Task DecreaseHour() { + if(_hourCounter==0) + return; _hourCounter--; Answer = _hourCounter.ToString(); await AnswerChanged.InvokeAsync(Answer); diff --git a/DocuMed.PWA/Shared/MedicalTemplates/InterrogativelyMedicalQuestionTemplate.razor b/DocuMed.PWA/Shared/MedicalTemplates/InterrogativelyMedicalQuestionTemplate.razor index 7196d32..d800d4b 100644 --- a/DocuMed.PWA/Shared/MedicalTemplates/InterrogativelyMedicalQuestionTemplate.razor +++ b/DocuMed.PWA/Shared/MedicalTemplates/InterrogativelyMedicalQuestionTemplate.razor @@ -7,6 +7,23 @@ Variant="Variant.Outlined" /> @code { + + public override async Task SetParametersAsync(ParameterView parameters) + { + + await base.SetParametersAsync(parameters); + if (!OldAnswer.IsNullOrEmpty()) + { + if(Answer==OldAnswer) + return; + Answer = OldAnswer; + await AnswerChanged.InvokeAsync(); + } + } + + [Parameter] + public string OldAnswer { get; set; } = string.Empty; + [Parameter] public string Answer { get; set; } = string.Empty; diff --git a/DocuMed.PWA/Shared/MedicalTemplates/RosSelectiveMedicalQuestionTemplate.razor b/DocuMed.PWA/Shared/MedicalTemplates/RosSelectiveMedicalQuestionTemplate.razor index c26684a..6db3b8d 100644 --- a/DocuMed.PWA/Shared/MedicalTemplates/RosSelectiveMedicalQuestionTemplate.razor +++ b/DocuMed.PWA/Shared/MedicalTemplates/RosSelectiveMedicalQuestionTemplate.razor @@ -51,15 +51,22 @@ else @code { - protected override void OnParametersSet() + + public override async Task SetParametersAsync(ParameterView parameters) { - base.OnParametersSet(); - if (!Answer.IsNullOrEmpty()) + await base.SetParametersAsync(parameters); + if (!OldAnswer.IsNullOrEmpty()) { - _isSelected = Answer == Question; + if(Answer == OldAnswer) + return; + _isSelected = OldAnswer != Question; + await SelectChanged(); } } + [Parameter] + public string OldAnswer { get; set; } = string.Empty; + [Parameter] public string Answer { get; set; } = string.Empty; diff --git a/DocuMed.PWA/Shared/MedicalTemplates/SelectiveMedicalQuestionTemplate.razor b/DocuMed.PWA/Shared/MedicalTemplates/SelectiveMedicalQuestionTemplate.razor index e35d79e..2aca4df 100644 --- a/DocuMed.PWA/Shared/MedicalTemplates/SelectiveMedicalQuestionTemplate.razor +++ b/DocuMed.PWA/Shared/MedicalTemplates/SelectiveMedicalQuestionTemplate.razor @@ -17,18 +17,26 @@ else @code { - protected override void OnParametersSet() + public override async Task SetParametersAsync(ParameterView parameters) { - base.OnParametersSet(); - if (!Answer.IsNullOrEmpty()) + await base.SetParametersAsync(parameters); + + if (!OldAnswer.IsNullOrEmpty()) { - _isSelected = Answer == Question; + if(Answer == OldAnswer) + return; + _isSelected = OldAnswer != Question; + await SelectChanged(); } } + [Parameter] public string Answer { get; set; } = string.Empty; + [Parameter] + public string OldAnswer { get; set; } = string.Empty; + [Parameter] public EventCallback AnswerChanged { get; set; } diff --git a/DocuMed.PWA/Shared/MedicalTemplates/YesOrNoMedicalQuestionTemplate.razor b/DocuMed.PWA/Shared/MedicalTemplates/YesOrNoMedicalQuestionTemplate.razor index 26bf458..1410822 100644 --- a/DocuMed.PWA/Shared/MedicalTemplates/YesOrNoMedicalQuestionTemplate.razor +++ b/DocuMed.PWA/Shared/MedicalTemplates/YesOrNoMedicalQuestionTemplate.razor @@ -42,23 +42,34 @@ @code { - protected override void OnParametersSet() + + public override async Task SetParametersAsync(ParameterView parameters) { - base.OnParametersSet(); - if (!Answer.IsNullOrEmpty()) + await base.SetParametersAsync(parameters); + + if (!OldAnswer.IsNullOrEmpty()) { - if (Answer == "بله") + if(Answer == OldAnswer) + return; + if (OldAnswer == "بله") { + Answer = "بله"; _isNoSelected = false; _isYesSelected = true; } - else if (Answer == "خیر") + else if (OldAnswer == "خیر") { + Answer = "خیر"; _isNoSelected = true; _isYesSelected = false; } + await AnswerChanged.InvokeAsync(Answer); } } + + [Parameter] + public string OldAnswer { get; set; } = string.Empty; + [Parameter] public string Answer { get; set; } = string.Empty; diff --git a/DocuMed.PWA/package-lock.json b/DocuMed.PWA/package-lock.json index ad3c29c..c2b34ce 100644 --- a/DocuMed.PWA/package-lock.json +++ b/DocuMed.PWA/package-lock.json @@ -12,9 +12,8 @@ "autoprefixer": "^10.4.16", "postcss": "^8.4.30", "postcss-cli": "^10.1.0", - "tailwindcss": "^3.3.3" - }, - "devDependencies": {} + "tailwindcss": "^3.3.5" + } }, "node_modules/@alloc/quick-lru": { "version": "5.2.0", @@ -1212,19 +1211,19 @@ } }, "node_modules/tailwindcss": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.3.3.tgz", - "integrity": "sha512-A0KgSkef7eE4Mf+nKJ83i75TMyq8HqY3qmFIJSWy8bNt0v1lG7jUcpGpoTFxAwYcWOphcTBLPPJg+bDfhDf52w==", + "version": "3.3.5", + "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.3.5.tgz", + "integrity": "sha512-5SEZU4J7pxZgSkv7FP1zY8i2TIAOooNZ1e/OGtxIEv6GltpoiXUqWvLy89+a10qYTB1N5Ifkuw9lqQkN9sscvA==", "dependencies": { "@alloc/quick-lru": "^5.2.0", "arg": "^5.0.2", "chokidar": "^3.5.3", "didyoumean": "^1.2.2", "dlv": "^1.1.3", - "fast-glob": "^3.2.12", + "fast-glob": "^3.3.0", "glob-parent": "^6.0.2", "is-glob": "^4.0.3", - "jiti": "^1.18.2", + "jiti": "^1.19.1", "lilconfig": "^2.1.0", "micromatch": "^4.0.5", "normalize-path": "^3.0.0", diff --git a/DocuMed.PWA/package.json b/DocuMed.PWA/package.json index 9794cfc..5af5506 100644 --- a/DocuMed.PWA/package.json +++ b/DocuMed.PWA/package.json @@ -3,7 +3,7 @@ "autoprefixer": "^10.4.16", "postcss": "^8.4.30", "postcss-cli": "^10.1.0", - "tailwindcss": "^3.3.3" + "tailwindcss": "^3.3.5" }, "name": "documed.pwa", "version": "1.0.0", diff --git a/DocuMed.PWA/tailwind.extension.json b/DocuMed.PWA/tailwind.extension.json new file mode 100644 index 0000000..e93022f --- /dev/null +++ b/DocuMed.PWA/tailwind.extension.json @@ -0,0 +1 @@ +{"ConfigurationFile":"tailwind.config.js","InputCssFile":null,"OutputCssFile":null} \ No newline at end of file diff --git a/DocuMed.PWA/wwwroot/css/app.css b/DocuMed.PWA/wwwroot/css/app.css index 679ab34..e0f6a99 100644 --- a/DocuMed.PWA/wwwroot/css/app.css +++ b/DocuMed.PWA/wwwroot/css/app.css @@ -93,8 +93,11 @@ --color-medicalhistory: rgba(253, 216, 53, 1); --color-medicalhistory-template: rgba(41, 187, 189, 1); } + } + + h1:focus { outline: none; } diff --git a/DocuMed.PWA/wwwroot/css/app.min.css b/DocuMed.PWA/wwwroot/css/app.min.css index 4b7f4ba..7fd32a8 100644 --- a/DocuMed.PWA/wwwroot/css/app.min.css +++ b/DocuMed.PWA/wwwroot/css/app.min.css @@ -1,5 +1,5 @@ /* -! tailwindcss v3.3.3 | MIT License | https://tailwindcss.com +! tailwindcss v3.3.5 | MIT License | https://tailwindcss.com *//* 1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4) 2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116) @@ -561,6 +561,10 @@ video { margin-top: 0.5rem; margin-bottom: 0.5rem; } +.my-3 { + margin-top: 0.75rem; + margin-bottom: 0.75rem; +} .my-4 { margin-top: 1rem; margin-bottom: 1rem; @@ -856,6 +860,9 @@ video { border-top-left-radius: 0.75rem; border-top-right-radius: 0.75rem; } +.border { + border-width: 1px; +} .border-\[--color-medicalhistory\] { border-color: var(--color-medicalhistory); } @@ -1062,6 +1069,9 @@ video { .drop-shadow-md { --tw-drop-shadow: drop-shadow(0 4px 3px rgb(0 0 0 / 0.07)) drop-shadow(0 2px 2px rgb(0 0 0 / 0.06)); filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow); +} +.filter { + filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow); } @font-face { @@ -1144,6 +1154,8 @@ video { url('../assets/fonts/ttf/iranyekanwebextrablackfanum.ttf') format('truetype'); } + + h1:focus { outline: none; } diff --git a/DocuMed.PWA/wwwroot/css/app.output.css b/DocuMed.PWA/wwwroot/css/app.output.css index 1cb6181..a533be3 100644 --- a/DocuMed.PWA/wwwroot/css/app.output.css +++ b/DocuMed.PWA/wwwroot/css/app.output.css @@ -1,5 +1,5 @@ /* -! tailwindcss v3.3.3 | MIT License | https://tailwindcss.com +! tailwindcss v3.3.5 | MIT License | https://tailwindcss.com */ /* @@ -629,6 +629,11 @@ video { margin-bottom: 0.5rem; } +.my-3 { + margin-top: 0.75rem; + margin-bottom: 0.75rem; +} + .my-4 { margin-top: 1rem; margin-bottom: 1rem; @@ -1020,6 +1025,10 @@ video { border-top-right-radius: 0.75rem; } +.border { + border-width: 1px; +} + .border-\[--color-medicalhistory\] { border-color: var(--color-medicalhistory); } @@ -1286,6 +1295,10 @@ video { filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow); } +.filter { + filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow); +} + @font-face { font-family: iranyekan; diff --git a/DocuMed.Repository/DocuMed.Repository.csproj b/DocuMed.Repository/DocuMed.Repository.csproj index 8486973..33b8e77 100644 --- a/DocuMed.Repository/DocuMed.Repository.csproj +++ b/DocuMed.Repository/DocuMed.Repository.csproj @@ -41,6 +41,7 @@ + diff --git a/DocuMed.Repository/Migrations/20231112120230_editMHAddDouble.Designer.cs b/DocuMed.Repository/Migrations/20231112120230_editMHAddDouble.Designer.cs new file mode 100644 index 0000000..6b0db50 --- /dev/null +++ b/DocuMed.Repository/Migrations/20231112120230_editMHAddDouble.Designer.cs @@ -0,0 +1,867 @@ +// +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("20231112120230_editMHAddDouble")] + partial class editMHAddDouble + { + /// + 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("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("CreatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("CreatedBy") + .IsRequired() + .HasColumnType("text"); + + b.Property("IsRemoved") + .HasColumnType("boolean"); + + b.Property("ModifiedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("ModifiedBy") + .IsRequired() + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("RemovedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("RemovedBy") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("Cities", "public"); + }); + + modelBuilder.Entity("DocuMed.Domain.Entities.City.Section", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("CreatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("CreatedBy") + .IsRequired() + .HasColumnType("text"); + + b.Property("Detail") + .IsRequired() + .HasColumnType("text"); + + b.Property("IsRemoved") + .HasColumnType("boolean"); + + b.Property("ModifiedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("ModifiedBy") + .IsRequired() + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("RemovedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("RemovedBy") + .IsRequired() + .HasColumnType("text"); + + b.Property("UniversityId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("UniversityId"); + + b.ToTable("Sections", "public"); + }); + + modelBuilder.Entity("DocuMed.Domain.Entities.City.University", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Address") + .IsRequired() + .HasColumnType("text"); + + b.Property("CityId") + .HasColumnType("uuid"); + + b.Property("CreatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("CreatedBy") + .IsRequired() + .HasColumnType("text"); + + b.Property("IsRemoved") + .HasColumnType("boolean"); + + b.Property("ModifiedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("ModifiedBy") + .IsRequired() + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("RemovedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("RemovedBy") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("CityId"); + + b.ToTable("Universities", "public"); + }); + + modelBuilder.Entity("DocuMed.Domain.Entities.MedicalHistory.MedicalHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AddictionHistoryDetail") + .IsRequired() + .HasColumnType("text"); + + b.Property("Age") + .HasColumnType("integer"); + + b.Property("AllergyDetail") + .IsRequired() + .HasColumnType("text"); + + b.Property("ApplicationUserId") + .HasColumnType("uuid"); + + b.Property("BirthDate") + .HasColumnType("timestamp without time zone"); + + b.Property("ChiefComplaint") + .IsRequired() + .HasColumnType("text"); + + b.Property("CreatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("CreatedBy") + .IsRequired() + .HasColumnType("text"); + + b.Property("DiastolicBloodPressure") + .HasColumnType("double precision"); + + b.Property("DrugHistoryDetail") + .IsRequired() + .HasColumnType("text"); + + b.Property("FamilyHistoryDetail") + .IsRequired() + .HasColumnType("text"); + + b.Property("FatherName") + .IsRequired() + .HasColumnType("text"); + + b.Property("FirstName") + .IsRequired() + .HasColumnType("text"); + + b.Property("GeneralAppearanceDetail") + .IsRequired() + .HasColumnType("text"); + + b.Property("IsRemoved") + .HasColumnType("boolean"); + + b.Property("LastName") + .IsRequired() + .HasColumnType("text"); + + b.Property("MedicalHistoryTemplateId") + .HasColumnType("uuid"); + + b.Property("ModifiedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("ModifiedBy") + .IsRequired() + .HasColumnType("text"); + + b.Property("NationalId") + .IsRequired() + .HasColumnType("text"); + + b.Property("PastDiseasesHistoryDetail") + .IsRequired() + .HasColumnType("text"); + + b.Property("PastSurgeryHistoryDetail") + .IsRequired() + .HasColumnType("text"); + + b.Property("PresentIllnessDetail") + .IsRequired() + .HasColumnType("text"); + + b.Property("PulseRate") + .HasColumnType("double precision"); + + b.Property("RemovedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("RemovedBy") + .IsRequired() + .HasColumnType("text"); + + b.Property("SPO2") + .HasColumnType("double precision"); + + b.Property("SectionId") + .HasColumnType("uuid"); + + b.Property("SystemReviewDetail") + .IsRequired() + .HasColumnType("text"); + + b.Property("SystolicBloodPressure") + .HasColumnType("double precision"); + + b.Property("Temperature") + .HasColumnType("double precision"); + + b.Property("VitalSignDetail") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("ApplicationUserId"); + + b.HasIndex("SectionId"); + + b.ToTable("MedicalHistories", "public"); + }); + + modelBuilder.Entity("DocuMed.Domain.Entities.MedicalHistory.MedicalHistoryAnswer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Answer") + .IsRequired() + .HasColumnType("text"); + + b.Property("CreatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("CreatedBy") + .IsRequired() + .HasColumnType("text"); + + b.Property("IsRemoved") + .HasColumnType("boolean"); + + b.Property("MedicalHistoryId") + .HasColumnType("uuid"); + + b.Property("ModifiedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("ModifiedBy") + .IsRequired() + .HasColumnType("text"); + + b.Property("Part") + .HasColumnType("integer"); + + b.Property("Question") + .IsRequired() + .HasColumnType("text"); + + b.Property("QuestionType") + .HasColumnType("integer"); + + b.Property("RemovedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("RemovedBy") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("MedicalHistoryId"); + + b.ToTable("MedicalHistoryAnswers", "public"); + }); + + modelBuilder.Entity("DocuMed.Domain.Entities.MedicalHistoryTemplate.MedicalHistoryQuestion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("BodySystem") + .HasColumnType("integer"); + + b.Property("CreatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("CreatedBy") + .IsRequired() + .HasColumnType("text"); + + b.Property("IsRemoved") + .HasColumnType("boolean"); + + b.Property("IsSign") + .HasColumnType("boolean"); + + b.Property("IsSymptom") + .HasColumnType("boolean"); + + b.Property("MedicalHistoryTemplateId") + .HasColumnType("uuid"); + + b.Property("ModifiedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("ModifiedBy") + .IsRequired() + .HasColumnType("text"); + + b.Property("Part") + .HasColumnType("integer"); + + b.Property("Question") + .IsRequired() + .HasColumnType("text"); + + b.Property("QuestionType") + .HasColumnType("integer"); + + b.Property("RemovedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("RemovedBy") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("MedicalHistoryTemplateId"); + + b.ToTable("MedicalHistoryQuestions", "public"); + }); + + modelBuilder.Entity("DocuMed.Domain.Entities.MedicalHistoryTemplate.MedicalHistoryTemplate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("ApplicationUserId") + .HasColumnType("uuid"); + + b.Property("ChiefComplaint") + .IsRequired() + .HasColumnType("text"); + + b.Property("CreatedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("CreatedBy") + .IsRequired() + .HasColumnType("text"); + + b.Property("IsRemoved") + .HasColumnType("boolean"); + + b.Property("ModifiedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("ModifiedBy") + .IsRequired() + .HasColumnType("text"); + + b.Property("RemovedAt") + .HasColumnType("timestamp without time zone"); + + b.Property("RemovedBy") + .IsRequired() + .HasColumnType("text"); + + b.Property("SectionId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("ApplicationUserId"); + + b.HasIndex("SectionId"); + + b.ToTable("MedicalHistoryTemplates", "public"); + }); + + modelBuilder.Entity("DocuMed.Domain.Entities.User.ApplicationRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("text"); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("EnglishName") + .IsRequired() + .HasColumnType("text"); + + b.Property("Name") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("NormalizedName") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("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("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AccessFailedCount") + .HasColumnType("integer"); + + b.Property("BirthDate") + .HasColumnType("timestamp without time zone"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("text"); + + b.Property("Email") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("EmailConfirmed") + .HasColumnType("boolean"); + + b.Property("FirstName") + .IsRequired() + .HasColumnType("text"); + + b.Property("Gender") + .HasColumnType("integer"); + + b.Property("LastName") + .IsRequired() + .HasColumnType("text"); + + b.Property("LockoutEnabled") + .HasColumnType("boolean"); + + b.Property("LockoutEnd") + .HasColumnType("timestamp with time zone"); + + b.Property("NationalId") + .IsRequired() + .HasColumnType("text"); + + b.Property("NormalizedEmail") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("NormalizedUserName") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("PasswordHash") + .HasColumnType("text"); + + b.Property("PhoneNumber") + .HasColumnType("text"); + + b.Property("PhoneNumberConfirmed") + .HasColumnType("boolean"); + + b.Property("SectionId") + .HasColumnType("uuid"); + + b.Property("SecurityStamp") + .HasColumnType("text"); + + b.Property("SignUpStatus") + .HasColumnType("integer"); + + b.Property("StudentId") + .IsRequired() + .HasColumnType("text"); + + b.Property("TwoFactorEnabled") + .HasColumnType("boolean"); + + b.Property("UniversityId") + .HasColumnType("uuid"); + + b.Property("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", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ClaimType") + .HasColumnType("text"); + + b.Property("ClaimValue") + .HasColumnType("text"); + + b.Property("RoleId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("RoleClaims", "public"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ClaimType") + .HasColumnType("text"); + + b.Property("ClaimValue") + .HasColumnType("text"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("Claims", "public"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.Property("LoginProvider") + .HasColumnType("text"); + + b.Property("ProviderKey") + .HasColumnType("text"); + + b.Property("ProviderDisplayName") + .HasColumnType("text"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.HasKey("LoginProvider", "ProviderKey"); + + b.HasIndex("UserId"); + + b.ToTable("Logins", "public"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("uuid"); + + b.Property("RoleId") + .HasColumnType("uuid"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId"); + + b.ToTable("UserRoles", "public"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("uuid"); + + b.Property("LoginProvider") + .HasColumnType("text"); + + b.Property("Name") + .HasColumnType("text"); + + b.Property("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.HasOne("DocuMed.Domain.Entities.City.Section", "Section") + .WithMany() + .HasForeignKey("SectionId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("ApplicationUser"); + + b.Navigation("Section"); + }); + + 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.HasOne("DocuMed.Domain.Entities.City.Section", "Section") + .WithMany() + .HasForeignKey("SectionId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("ApplicationUser"); + + b.Navigation("Section"); + }); + + 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", b => + { + b.HasOne("DocuMed.Domain.Entities.User.ApplicationRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.HasOne("DocuMed.Domain.Entities.User.ApplicationUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.HasOne("DocuMed.Domain.Entities.User.ApplicationUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", 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", 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 + } + } +} diff --git a/DocuMed.Repository/Migrations/20231112120230_editMHAddDouble.cs b/DocuMed.Repository/Migrations/20231112120230_editMHAddDouble.cs new file mode 100644 index 0000000..f890253 --- /dev/null +++ b/DocuMed.Repository/Migrations/20231112120230_editMHAddDouble.cs @@ -0,0 +1,108 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace DocuMed.Repository.Migrations +{ + /// + public partial class editMHAddDouble : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AlterColumn( + name: "Temperature", + schema: "public", + table: "MedicalHistories", + type: "double precision", + nullable: false, + oldClrType: typeof(int), + oldType: "integer"); + + migrationBuilder.AlterColumn( + name: "SystolicBloodPressure", + schema: "public", + table: "MedicalHistories", + type: "double precision", + nullable: false, + oldClrType: typeof(int), + oldType: "integer"); + + migrationBuilder.AlterColumn( + name: "SPO2", + schema: "public", + table: "MedicalHistories", + type: "double precision", + nullable: false, + oldClrType: typeof(int), + oldType: "integer"); + + migrationBuilder.AlterColumn( + name: "PulseRate", + schema: "public", + table: "MedicalHistories", + type: "double precision", + nullable: false, + oldClrType: typeof(int), + oldType: "integer"); + + migrationBuilder.AlterColumn( + name: "DiastolicBloodPressure", + schema: "public", + table: "MedicalHistories", + type: "double precision", + nullable: false, + oldClrType: typeof(int), + oldType: "integer"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.AlterColumn( + name: "Temperature", + schema: "public", + table: "MedicalHistories", + type: "integer", + nullable: false, + oldClrType: typeof(double), + oldType: "double precision"); + + migrationBuilder.AlterColumn( + name: "SystolicBloodPressure", + schema: "public", + table: "MedicalHistories", + type: "integer", + nullable: false, + oldClrType: typeof(double), + oldType: "double precision"); + + migrationBuilder.AlterColumn( + name: "SPO2", + schema: "public", + table: "MedicalHistories", + type: "integer", + nullable: false, + oldClrType: typeof(double), + oldType: "double precision"); + + migrationBuilder.AlterColumn( + name: "PulseRate", + schema: "public", + table: "MedicalHistories", + type: "integer", + nullable: false, + oldClrType: typeof(double), + oldType: "double precision"); + + migrationBuilder.AlterColumn( + name: "DiastolicBloodPressure", + schema: "public", + table: "MedicalHistories", + type: "integer", + nullable: false, + oldClrType: typeof(double), + oldType: "double precision"); + } + } +} diff --git a/DocuMed.Repository/Migrations/ApplicationContextModelSnapshot.cs b/DocuMed.Repository/Migrations/ApplicationContextModelSnapshot.cs index 29eefdd..d98a2e0 100644 --- a/DocuMed.Repository/Migrations/ApplicationContextModelSnapshot.cs +++ b/DocuMed.Repository/Migrations/ApplicationContextModelSnapshot.cs @@ -192,8 +192,8 @@ namespace DocuMed.Repository.Migrations .IsRequired() .HasColumnType("text"); - b.Property("DiastolicBloodPressure") - .HasColumnType("integer"); + b.Property("DiastolicBloodPressure") + .HasColumnType("double precision"); b.Property("DrugHistoryDetail") .IsRequired() @@ -248,8 +248,8 @@ namespace DocuMed.Repository.Migrations .IsRequired() .HasColumnType("text"); - b.Property("PulseRate") - .HasColumnType("integer"); + b.Property("PulseRate") + .HasColumnType("double precision"); b.Property("RemovedAt") .HasColumnType("timestamp without time zone"); @@ -258,8 +258,8 @@ namespace DocuMed.Repository.Migrations .IsRequired() .HasColumnType("text"); - b.Property("SPO2") - .HasColumnType("integer"); + b.Property("SPO2") + .HasColumnType("double precision"); b.Property("SectionId") .HasColumnType("uuid"); @@ -268,11 +268,11 @@ namespace DocuMed.Repository.Migrations .IsRequired() .HasColumnType("text"); - b.Property("SystolicBloodPressure") - .HasColumnType("integer"); + b.Property("SystolicBloodPressure") + .HasColumnType("double precision"); - b.Property("Temperature") - .HasColumnType("integer"); + b.Property("Temperature") + .HasColumnType("double precision"); b.Property("VitalSignDetail") .IsRequired() diff --git a/DocuMed.Repository/Repositories/Entities/Abstracts/IMedicalHistoryRepository.cs b/DocuMed.Repository/Repositories/Entities/Abstracts/IMedicalHistoryRepository.cs index 7aa1d37..0683c92 100644 --- a/DocuMed.Repository/Repositories/Entities/Abstracts/IMedicalHistoryRepository.cs +++ b/DocuMed.Repository/Repositories/Entities/Abstracts/IMedicalHistoryRepository.cs @@ -3,5 +3,6 @@ public interface IMedicalHistoryRepository : IBaseRepository, IScopedDependency { public Task> GetMedicalHistoriesAsync(int page = 0, CancellationToken cancellationToken = default); + public Task> GetMedicalHistoriesByFilterAsync(DayQueryFilter dayQuery,int page = 0, CancellationToken cancellationToken = default); public Task GetMedicalHistoryAsync(Guid id, CancellationToken cancellationToken = default); } \ No newline at end of file diff --git a/DocuMed.Repository/Repositories/Entities/MedicalHistoryRepository.cs b/DocuMed.Repository/Repositories/Entities/MedicalHistoryRepository.cs index e77214f..de616c5 100644 --- a/DocuMed.Repository/Repositories/Entities/MedicalHistoryRepository.cs +++ b/DocuMed.Repository/Repositories/Entities/MedicalHistoryRepository.cs @@ -20,6 +20,46 @@ public class MedicalHistoryRepository : BaseRepository,IMedicalH return list; } + public async Task> GetMedicalHistoriesByFilterAsync(DayQueryFilter dayQuery, int page = 0, CancellationToken cancellationToken = default) + { + if (!Guid.TryParse(CurrentUserService.UserId, out Guid userId)) + throw new AppException("توکن غیرمجاز", ApiResultStatusCode.UnAuthorized); + var list = new List(); + switch (dayQuery) + { + case DayQueryFilter.Today: + list = await TableNoTracking + .Where(t => t.ApplicationUserId == userId && t.CreatedAt.Date == DateTime.Today) + .OrderByDescending(t => t.CreatedAt) + .Skip(page * 15) + .Take(15) + .Select(MedicalHistoryMapper.ProjectToSDto) + .ToListAsync(cancellationToken); + break; + case DayQueryFilter.Yesterday: + list = await TableNoTracking + .Where(t => t.ApplicationUserId == userId && t.CreatedAt.Date == DateTime.Today.AddDays(-1)) + .OrderByDescending(t => t.CreatedAt) + .Skip(page * 15) + .Take(15) + .Select(MedicalHistoryMapper.ProjectToSDto) + .ToListAsync(cancellationToken); + break; + case DayQueryFilter.Week: + list = await TableNoTracking + .Where(t => t.ApplicationUserId == userId && t.CreatedAt.Date >= DateTime.Today.AddDays(-7) ) + .OrderByDescending(t => t.CreatedAt) + .Skip(page * 15) + .Take(15) + .Select(MedicalHistoryMapper.ProjectToSDto) + .ToListAsync(cancellationToken); + break; + default: + throw new ArgumentOutOfRangeException(nameof(dayQuery), dayQuery, null); + } + return list; + } + public async Task GetMedicalHistoryAsync(Guid id, CancellationToken cancellationToken = default) { var dto = await TableNoTracking.Where(t => t.Id == id)