Api-PWA/DocuMed.PWA/Pages/MedicalHistoryTemplateActio.../MedicalHistoryTemplateActio...

99 lines
3.6 KiB
Plaintext
Raw Normal View History

2023-10-20 19:40:23 +03:30
@using DocuMed.Domain.Entities.MedicalHistoryTemplate
2023-10-10 17:02:38 +03:30
<MudStack class="pb-20 font-iranyekan">
<BasePartDivider Index="3" Title="تاریخچه بیماری قبلی ( PMH )" />
2023-10-10 17:02:38 +03:30
@foreach (var item in PdhQuestions)
2023-10-10 17:02:38 +03:30
{
<MedicalHistoryQuestionTemplateItemTemplate Question="item" QuestionRemoved="RemovePiQuestion" />
2023-10-10 17:02:38 +03:30
}
<MudSelect @bind-Value="@_pdhQuestionType" T="MedicalHistoryQuestionType" ToStringFunc="(e=>e.ToDisplay())" Label="نوع سوال" Variant="Variant.Outlined">
2023-10-10 17:02:38 +03:30
<MudSelectItem Value="@MedicalHistoryQuestionType.Hourly" />
<MudSelectItem Value="@MedicalHistoryQuestionType.Interrogatively" />
<MudSelectItem Value="@MedicalHistoryQuestionType.YesOrNo" />
</MudSelect>
<MudTextField @bind-Value="@_pdhQuestionTitle" Margin="Margin.None" T="string" Label="عنوان سوال" Lines="1"
2023-10-10 17:02:38 +03:30
Variant="Variant.Outlined" />
<MudButton @onclick="AddPiQuestion" Variant="Variant.Filled" IconSize="Size.Large" DisableElevation="true"
2023-10-10 17:02:38 +03:30
class="font-extrabold text-lg rounded-md py-4 bg-[--color-medicalhistory] text-gray-800">
+ افزودن
</MudButton>
<BasePartDivider Index="4" class="mt-9" Title="تاریخچه جراحی های قبلی ( PSH )" />
@foreach (var item in PshQuestions)
2023-10-10 17:02:38 +03:30
{
<MedicalHistoryQuestionTemplateItemTemplate Question="item" QuestionRemoved="RemovePshQuestion" />
2023-10-10 17:02:38 +03:30
}
<MudSelect @bind-Value="@_pshQuestionType"
ToStringFunc="(e=>e.ToDisplay())"
T="MedicalHistoryQuestionType"
Label="نوع سوال"
2023-10-10 17:02:38 +03:30
Variant="Variant.Outlined">
<MudSelectItem Value="@MedicalHistoryQuestionType.Hourly" />
<MudSelectItem Value="@MedicalHistoryQuestionType.Interrogatively" />
<MudSelectItem Value="@MedicalHistoryQuestionType.YesOrNo" />
</MudSelect>
<MudTextField @bind-Value="@_pshQuestionTitle"
Margin="Margin.None"
T="string"
2023-10-10 17:02:38 +03:30
Label="عنوان سوال" Lines="1"
Variant="Variant.Outlined" />
<MudButton @onclick="AddPshQuestion" Variant="Variant.Filled" IconSize="Size.Large" DisableElevation="true"
2023-10-10 17:02:38 +03:30
class="font-extrabold text-lg rounded-md py-4 bg-[--color-medicalhistory] text-gray-800">
+ افزودن
</MudButton>
</MudStack>
@code
{
[Parameter]
public List<MedicalHistoryQuestionSDto> PdhQuestions { get; set; } = new();
[Parameter]
public List<MedicalHistoryQuestionSDto> PshQuestions { get; set; } = new();
private string _pdhQuestionTitle = string.Empty;
private MedicalHistoryQuestionType _pdhQuestionType;
2023-10-10 17:02:38 +03:30
private string _pshQuestionTitle = string.Empty;
private MedicalHistoryQuestionType _pshQuestionType;
private void RemovePiQuestion(MedicalHistoryQuestionSDto question)
2023-10-10 17:02:38 +03:30
{
PdhQuestions.Remove(question);
2023-10-10 17:02:38 +03:30
}
private void AddPiQuestion()
2023-10-10 17:02:38 +03:30
{
PdhQuestions.Add(new MedicalHistoryQuestionSDto
{
QuestionType = _pdhQuestionType,
Part = MedicalHistoryPart.PastDiseasesHistory,
Question = _pdhQuestionTitle
});
_pdhQuestionTitle = string.Empty;
2023-10-10 17:02:38 +03:30
}
private void RemovePshQuestion(MedicalHistoryQuestionSDto question)
2023-10-10 17:02:38 +03:30
{
PshQuestions.Remove(question);
2023-10-10 17:02:38 +03:30
}
private void AddPshQuestion()
2023-10-10 17:02:38 +03:30
{
PshQuestions.Add(new MedicalHistoryQuestionSDto
{
Part = MedicalHistoryPart.PastSurgeryHistory,
QuestionType = _pshQuestionType,
Question = _pshQuestionTitle
});
_pshQuestionTitle = string.Empty;
2023-10-10 17:02:38 +03:30
}
}