From 23c5b094512640d64ee5477179e65a4861edc7ab Mon Sep 17 00:00:00 2001 From: "Amir.H Khademi" Date: Sun, 26 Nov 2023 12:32:58 +0330 Subject: [PATCH] add version 1.3.1.0 fix new bugs , add question dialog , add remove for mh and mht --- .version | 2 +- DocuMed.Api/Controllers/HomeController.cs | 1 + .../Controllers/MedicalHistoryController.cs | 4 +- .../MedicalHistoryTemplateController.cs | 4 +- DocuMed.Api/DocuMed.Api.csproj | 4 +- DocuMed.Api/Properties/launchSettings.json | 4 +- DocuMed.PWA/DocuMed.PWA.csproj | 4 +- .../Pages/MedicalHistoryActionPage.razor | 9 ++- .../Pages/MedicalHistoryActionPage.razor.cs | 67 +++++++++++++------ .../MedicalHistoryActionStep1.razor | 19 +++--- .../MedicalHistoryActionStep5.razor | 3 +- .../MedicalHistoryTemplateActionPage.razor | 15 +++-- .../MedicalHistoryTemplateActionPage.razor.cs | 57 +++++++++++++++- .../MedicalHistoryTemplateActionStep1.razor | 35 +++++++--- .../Shared/Dialogs/QuestionDialog.razor | 26 +++++++ DocuMed.PWA/Shared/MainLayout.razor | 7 ++ DocuMed.PWA/wwwroot/css/app.css | 5 +- DocuMed.PWA/wwwroot/css/app.min.css | 17 ++++- DocuMed.PWA/wwwroot/css/app.output.css | 20 ++++++ 19 files changed, 240 insertions(+), 63 deletions(-) create mode 100644 DocuMed.PWA/Shared/Dialogs/QuestionDialog.razor diff --git a/.version b/.version index cb36e65..9534a76 100644 --- a/.version +++ b/.version @@ -1 +1 @@ -1.2.1.0 \ No newline at end of file +1.3.1.0 \ No newline at end of file diff --git a/DocuMed.Api/Controllers/HomeController.cs b/DocuMed.Api/Controllers/HomeController.cs index 75abe46..9383fa4 100644 --- a/DocuMed.Api/Controllers/HomeController.cs +++ b/DocuMed.Api/Controllers/HomeController.cs @@ -7,6 +7,7 @@ namespace DocuMed.Api.Controllers; [AllowAnonymous] public class HomeController : Controller { + [HttpGet] public IActionResult Index() { return View("Index", new IndexModel()); diff --git a/DocuMed.Api/Controllers/MedicalHistoryController.cs b/DocuMed.Api/Controllers/MedicalHistoryController.cs index a9ec8c8..a1a9036 100644 --- a/DocuMed.Api/Controllers/MedicalHistoryController.cs +++ b/DocuMed.Api/Controllers/MedicalHistoryController.cs @@ -26,7 +26,7 @@ public class MedicalHistoryController : ICarterModule group.MapPut("", Put) .HasApiVersion(1.0); - group.MapDelete("", Delete) + group.MapDelete("{id}", Delete) .HasApiVersion(1.0); } @@ -64,7 +64,7 @@ public class MedicalHistoryController : ICarterModule } // DELETE:Delete Entity - public virtual async Task Delete(int id, IRepositoryWrapper repositoryWrapper, CancellationToken cancellationToken) + public virtual async Task Delete(Guid id, IRepositoryWrapper repositoryWrapper, CancellationToken cancellationToken) { var ent = await repositoryWrapper.SetRepository().GetByIdAsync(cancellationToken, id); repositoryWrapper.SetRepository().Delete(ent); diff --git a/DocuMed.Api/Controllers/MedicalHistoryTemplateController.cs b/DocuMed.Api/Controllers/MedicalHistoryTemplateController.cs index d1b56e3..0085e39 100644 --- a/DocuMed.Api/Controllers/MedicalHistoryTemplateController.cs +++ b/DocuMed.Api/Controllers/MedicalHistoryTemplateController.cs @@ -23,7 +23,7 @@ public class MedicalHistoryTemplateController : ICarterModule group.MapPut("", Put) .HasApiVersion(1.0); - group.MapDelete("", Delete) + group.MapDelete("{id}", Delete) .HasApiVersion(1.0); } @@ -54,7 +54,7 @@ public class MedicalHistoryTemplateController : ICarterModule } // DELETE:Delete Entity - public virtual async Task Delete(int id, IRepositoryWrapper repositoryWrapper, CancellationToken cancellationToken) + public virtual async Task Delete(Guid id, IRepositoryWrapper repositoryWrapper, CancellationToken cancellationToken) { var ent = await repositoryWrapper.SetRepository().GetByIdAsync(cancellationToken, id); repositoryWrapper.SetRepository().Delete(ent); diff --git a/DocuMed.Api/DocuMed.Api.csproj b/DocuMed.Api/DocuMed.Api.csproj index 6cb7c20..8a88a37 100644 --- a/DocuMed.Api/DocuMed.Api.csproj +++ b/DocuMed.Api/DocuMed.Api.csproj @@ -6,8 +6,8 @@ enable Linux ..\docker-compose.dcproj - 1.2.1.0 - 1.2.1.0 + 1.3.1.0 + 1.3.1.0 diff --git a/DocuMed.Api/Properties/launchSettings.json b/DocuMed.Api/Properties/launchSettings.json index 5acce48..4aa8988 100644 --- a/DocuMed.Api/Properties/launchSettings.json +++ b/DocuMed.Api/Properties/launchSettings.json @@ -13,7 +13,7 @@ "IIS Express": { "commandName": "IISExpress", "launchBrowser": true, - "launchUrl": "swagger", + "launchUrl": "", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } @@ -21,7 +21,7 @@ "Docker": { "commandName": "Docker", "launchBrowser": true, - "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}/swagger", + "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}", "environmentVariables": { "ASPNETCORE_URLS": "http://+:80" }, diff --git a/DocuMed.PWA/DocuMed.PWA.csproj b/DocuMed.PWA/DocuMed.PWA.csproj index 288c53d..268c393 100644 --- a/DocuMed.PWA/DocuMed.PWA.csproj +++ b/DocuMed.PWA/DocuMed.PWA.csproj @@ -7,8 +7,8 @@ enable enable service-worker-assets.js - 1.2.1.0 - 1.2.1.0 + 1.3.1.0 + 1.3.1.0 diff --git a/DocuMed.PWA/Pages/MedicalHistoryActionPage.razor b/DocuMed.PWA/Pages/MedicalHistoryActionPage.razor index d01beae..6b3b94a 100644 --- a/DocuMed.PWA/Pages/MedicalHistoryActionPage.razor +++ b/DocuMed.PWA/Pages/MedicalHistoryActionPage.razor @@ -4,10 +4,12 @@ @inject IRestWrapper RestWrapper @inject ISnackbar Snackbar @inject IUserUtility UserUtility +@inject IDialogService DialogService +@inject IJSRuntime JsRuntime -
+
@@ -16,6 +18,7 @@
@ViewModel.StepCounter

- مرحله قبل } @@ -118,7 +121,7 @@ protected override async Task OnInitializedAsync() { ViewModel = Guid.TryParse(MedicalHistoryId, out Guid medicalHistoryId) ? - new MedicalHistoryActionPageViewModel(RestWrapper, NavigationManager, Snackbar, UserUtility, medicalHistoryId) + new MedicalHistoryActionPageViewModel(RestWrapper, NavigationManager, Snackbar, UserUtility, DialogService,JsRuntime, medicalHistoryId) : new MedicalHistoryActionPageViewModel(RestWrapper, NavigationManager, Snackbar, UserUtility); await ViewModel.InitializeAsync(); diff --git a/DocuMed.PWA/Pages/MedicalHistoryActionPage.razor.cs b/DocuMed.PWA/Pages/MedicalHistoryActionPage.razor.cs index db278b7..354fd12 100644 --- a/DocuMed.PWA/Pages/MedicalHistoryActionPage.razor.cs +++ b/DocuMed.PWA/Pages/MedicalHistoryActionPage.razor.cs @@ -1,4 +1,6 @@ -using Mapster; +using DocuMed.PWA.Shared.Dialogs; +using Mapster; +using Microsoft.JSInterop; namespace DocuMed.PWA.Pages; @@ -9,6 +11,9 @@ public class MedicalHistoryActionPageViewModel : BaseViewModel(Address.MedicalHistoryController) - .Delete(PageDto.Id, token); - - } - catch (ApiException ex) - { - var exe = await ex.GetContentAsAsync(); - _snackbar.Add(exe != null ? exe.Message : ex.Content, Severity.Error); - } - catch (Exception e) - { - _snackbar.Add(e.Message, Severity.Error); - } - finally + if(_dialogService==null) + return; + var options = new DialogOptions { CloseOnEscapeKey = true }; + var parameters = new DialogParameters(); + parameters.Add(x => x.ContentText, "آیا از حذف شرح حال اطمینان دارید ?"); + var dialogReference = await _dialogService.ShowAsync("حذف شرح حال", parameters, options); + var result = await dialogReference.Result; + if (!result.Canceled) { - IsProcessing = false; + try + { + + IsProcessing = true; + var token = await _userUtility.GetBearerTokenAsync(); + await _restWrapper.CrudDtoApiRest(Address.MedicalHistoryController) + .Delete(PageDto.Id, token); + _snackbar.Add("حذف شرح حال با موفقیت انجام شد", Severity.Success); + if (_jsRuntime != null) + await _jsRuntime.InvokeVoidAsync("history.back"); + + } + catch (ApiException ex) + { + var exe = await ex.GetContentAsAsync(); + _snackbar.Add(exe != null ? exe.Message : ex.Content, Severity.Error); + } + catch (Exception e) + { + _snackbar.Add(e.Message, Severity.Error); + } + finally + { + + IsProcessing = false; + } } } @@ -299,6 +324,8 @@ public class MedicalHistoryActionPageViewModel : BaseViewModel +

افزودن شرح حال جدید

-

- لورم ایپسوم متن ساختگی با تولید سادگی نامفهوم از صنعت چاپ و با استفاده از - طراحان گرافیک است چاپگرها و متون بلکه روزنامه و مجله در ستون و سطرآنچنان که لازم است و برای شرایط فعلی تکنولوژی - مورد ده +

شرح حال بیمار را در مراحل مختلف و اطلاعات را با دقت وارد نمایید ، در مرحله اخر میتوانید شرحال کامل را مشاهده کنید

@@ -17,6 +14,7 @@ T="string" Label="نام خانوادگی بیمار" Variant="Variant.Outlined" class="text-sm my-5" /> @@ -68,13 +66,14 @@ - @if (IsEditing) - { - - } + + @if (IsEditing) + { + + }
@code diff --git a/DocuMed.PWA/Pages/MedicalHistoryActionParts/MedicalHistoryActionStep5.razor b/DocuMed.PWA/Pages/MedicalHistoryActionParts/MedicalHistoryActionStep5.razor index 30458b0..93c5d3e 100644 --- a/DocuMed.PWA/Pages/MedicalHistoryActionParts/MedicalHistoryActionStep5.razor +++ b/DocuMed.PWA/Pages/MedicalHistoryActionParts/MedicalHistoryActionStep5.razor @@ -41,9 +41,10 @@ + class="mx-2 my-3" Margin="Margin.Dense" Max="100" Label="اکسیژن" T="double" Variant="Variant.Outlined" />
diff --git a/DocuMed.PWA/Pages/MedicalHistoryTemplateActionPage.razor b/DocuMed.PWA/Pages/MedicalHistoryTemplateActionPage.razor index f5f4dd6..e61b57a 100644 --- a/DocuMed.PWA/Pages/MedicalHistoryTemplateActionPage.razor +++ b/DocuMed.PWA/Pages/MedicalHistoryTemplateActionPage.razor @@ -4,17 +4,24 @@ @inject IRestWrapper RestWrapper @inject IUserUtility UserUtility @inject ISnackbar Snackbar +@inject IDialogService DialogService +@inject IJSRuntime JsRuntime
-
- +
@@ -86,7 +93,7 @@ }

@ViewModel.StepCounter

- مرحله قبل } @@ -102,7 +109,7 @@ protected override async Task OnInitializedAsync() { ViewModel = Guid.TryParse(TemplateId, out Guid templateId) ? - new MedicalHistoryTemplateActionPageViewModel(NavigationManager, Snackbar, RestWrapper, UserUtility, templateId) + new MedicalHistoryTemplateActionPageViewModel(NavigationManager, Snackbar, RestWrapper, UserUtility, DialogService,JsRuntime, templateId) : new MedicalHistoryTemplateActionPageViewModel(NavigationManager, Snackbar, RestWrapper, UserUtility); await ViewModel.InitializeAsync(); await base.OnInitializedAsync(); diff --git a/DocuMed.PWA/Pages/MedicalHistoryTemplateActionPage.razor.cs b/DocuMed.PWA/Pages/MedicalHistoryTemplateActionPage.razor.cs index 87eaae2..307f997 100644 --- a/DocuMed.PWA/Pages/MedicalHistoryTemplateActionPage.razor.cs +++ b/DocuMed.PWA/Pages/MedicalHistoryTemplateActionPage.razor.cs @@ -1,4 +1,7 @@ -namespace DocuMed.PWA.Pages; +using DocuMed.PWA.Shared.Dialogs; +using Microsoft.JSInterop; + +namespace DocuMed.PWA.Pages; public class MedicalHistoryTemplateActionPageViewModel : BaseViewModel { @@ -6,12 +9,15 @@ public class MedicalHistoryTemplateActionPageViewModel : BaseViewModel? 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 bool DisableBackButton { get; set; } = true; public List PiQuestions { get; set; } = new(); public List PdhQuestions { get; set; } = new(); @@ -43,12 +49,16 @@ public class MedicalHistoryTemplateActionPageViewModel : BaseViewModel(); + parameters.Add(x => x.ContentText, "آیا از حذف پیش نویس شرح حال اطمینان دارید ?"); + var dialogReference = await _dialogService.ShowAsync("حذف پیش نویس", parameters, options); + var result = await dialogReference.Result; + if (!result.Canceled) + { + + try + { + + IsProcessing = true; + var token = await _userUtility.GetBearerTokenAsync(); + await _restWrapper.CrudDtoApiRest(Address.MedicalHistoryTemplateController) + .Delete(PageDto.Id, token); + _snackbar.Add("حذف پیش نویس با موفقیت انجام شد", Severity.Success); + if (_jsRuntime != null) + await _jsRuntime.InvokeVoidAsync("history.back"); + } + catch (ApiException ex) + { + var exe = await ex.GetContentAsAsync(); + _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 CompleteStepClicked() { ++CurrentStep; @@ -108,6 +158,7 @@ public class MedicalHistoryTemplateActionPageViewModel : BaseViewModel + + +
+ +

افزودن پیش نویس شرح حال جدید

-

- لورم ایپسوم متن ساختگی با تولید سادگی نامفهوم از صنعت چاپ و با استفاده از - طراحان گرافیک است چاپگرها و متون بلکه روزنامه و مجله در ستون و سطرآنچنان که لازم است و برای شرایط فعلی تکنولوژی - مورد ده +

اطلاعات هر بخش شرح حال را میتوانید به صورت پیش نویس وارد کنید و در شرح حال نویسی خود را سریع و کارامد کنید

- - + + + ValueChanged="async dto => { SelectedSection = dto; await SelectedSectionChanged.InvokeAsync(SelectedSection); }">
- +

منتظر بمانید

@@ -29,9 +31,22 @@

@e.Name

+ @if (IsEditing) + { + + }
@code { + + + [Parameter] + public EventCallback DeleteClicked { get; set; } + + [Parameter] + public bool IsEditing { get; set; } + [Parameter] public string ChiefComplaint { get; set; } = string.Empty; [Parameter] diff --git a/DocuMed.PWA/Shared/Dialogs/QuestionDialog.razor b/DocuMed.PWA/Shared/Dialogs/QuestionDialog.razor new file mode 100644 index 0000000..9315952 --- /dev/null +++ b/DocuMed.PWA/Shared/Dialogs/QuestionDialog.razor @@ -0,0 +1,26 @@ + + + +

@ContentText

+
+ +
+ تایید + + انصراف +
+
+
+@code +{ + + [CascadingParameter] + MudDialogInstance? MudDialog { get; set; } + + [Parameter] + public string ContentText { get; set; } = string.Empty; + + void Submit() => MudDialog?.Close(DialogResult.Ok(true)); + void Cancel() => MudDialog?.Cancel(); +} \ No newline at end of file diff --git a/DocuMed.PWA/Shared/MainLayout.razor b/DocuMed.PWA/Shared/MainLayout.razor index 312741c..ef7a9e6 100644 --- a/DocuMed.PWA/Shared/MainLayout.razor +++ b/DocuMed.PWA/Shared/MainLayout.razor @@ -42,6 +42,13 @@ { MudTheme MyCustomTheme = new MudTheme() { + Typography = new Typography() + { + Default = new Default() + { + FontFamily = new[] { "iranyekan" } + } + }, Palette = new PaletteLight() { Primary = "#356859", diff --git a/DocuMed.PWA/wwwroot/css/app.css b/DocuMed.PWA/wwwroot/css/app.css index e0f6a99..c4c2a75 100644 --- a/DocuMed.PWA/wwwroot/css/app.css +++ b/DocuMed.PWA/wwwroot/css/app.css @@ -97,9 +97,12 @@ } +.mud-dialog-title { + font-family: iranyekan !important; +} h1:focus { - outline: none; + outline: none; } a, .btn-link { diff --git a/DocuMed.PWA/wwwroot/css/app.min.css b/DocuMed.PWA/wwwroot/css/app.min.css index 7fd32a8..e88ab08 100644 --- a/DocuMed.PWA/wwwroot/css/app.min.css +++ b/DocuMed.PWA/wwwroot/css/app.min.css @@ -583,6 +583,9 @@ video { .-mb-3 { margin-bottom: -0.75rem; } +.-mb-5 { + margin-bottom: -1.25rem; +} .-mb-8 { margin-bottom: -2rem; } @@ -709,6 +712,9 @@ video { .h-60 { height: 15rem; } +.h-64 { + height: 16rem; +} .h-7 { height: 1.75rem; } @@ -745,6 +751,9 @@ video { .w-60 { width: 15rem; } +.w-64 { + width: 16rem; +} .w-7 { width: 1.75rem; } @@ -921,6 +930,9 @@ video { .p-1 { padding: 0.25rem; } +.p-2 { + padding: 0.5rem; +} .p-4 { padding: 1rem; } @@ -1155,9 +1167,12 @@ video { } +.mud-dialog-title { + font-family: iranyekan !important; +} h1:focus { - outline: none; + outline: none; } a, .btn-link { diff --git a/DocuMed.PWA/wwwroot/css/app.output.css b/DocuMed.PWA/wwwroot/css/app.output.css index a533be3..28aacbf 100644 --- a/DocuMed.PWA/wwwroot/css/app.output.css +++ b/DocuMed.PWA/wwwroot/css/app.output.css @@ -657,6 +657,10 @@ video { margin-bottom: -0.75rem; } +.-mb-5 { + margin-bottom: -1.25rem; +} + .-mb-8 { margin-bottom: -2rem; } @@ -825,6 +829,10 @@ video { height: 15rem; } +.h-64 { + height: 16rem; +} + .h-7 { height: 1.75rem; } @@ -873,6 +881,10 @@ video { width: 15rem; } +.w-64 { + width: 16rem; +} + .w-7 { width: 1.75rem; } @@ -1103,6 +1115,10 @@ video { padding: 0.25rem; } +.p-2 { + padding: 0.5rem; +} + .p-4 { padding: 1rem; } @@ -1411,6 +1427,10 @@ video { url('../assets/fonts/ttf/iranyekanwebextrablackfanum.ttf') format('truetype'); } +.mud-dialog-title { + font-family: iranyekan !important; +} + h1:focus { outline: none; }