-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
QA Screen changes to add external identifiers, and display informatio…
…n in a much better format.
- Loading branch information
1 parent
8d473d4
commit caf48bb
Showing
15 changed files
with
491 additions
and
535 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
src/Application/Features/Participants/DTOs/ExternalIdentifierDto.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using Cfo.Cats.Domain.Entities.Participants; | ||
|
||
namespace Cfo.Cats.Application.Features.Participants.DTOs; | ||
|
||
public class ExternalIdentifierDto | ||
{ | ||
public string Type {get; set;} = default!; | ||
public string Value {get;set;} = default!; | ||
|
||
private class Mapping : Profile | ||
{ | ||
public Mapping() | ||
{ | ||
CreateMap<ExternalIdentifier, ExternalIdentifierDto>(MemberList.None) | ||
.ForMember(x => x.Value, o => o.MapFrom(s => s.Value)) | ||
.ForMember(x => x.Type, o => o.MapFrom(s => s.Type.Name)); | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
src/Server.UI/Pages/QA/Enrolments/Components/AssessmentTabPanel.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
@using Cfo.Cats.Application.Features.Participants.DTOs | ||
@using Cfo.Cats.Server.UI.Pages.Participants.Components | ||
<MudGrid> | ||
<MudItem xs="12"> | ||
<RagBar ParticipantId="@ParticipantDto.Id"/> | ||
</MudItem> | ||
|
||
@if (ParticipantDto.AssessmentJustification is not null) | ||
{ | ||
<MudItem xs="12"> | ||
<MudText Typo="Typo.body1">Justification</MudText> | ||
<MudText Typo="Typo.body2"> | ||
@ParticipantDto.AssessmentJustification | ||
</MudText> | ||
</MudItem> | ||
} | ||
<MudItem xs="12"> | ||
<CaseAssessment ParticipantId="@ParticipantDto.Id"/> | ||
</MudItem> | ||
</MudGrid> | ||
|
||
@code { | ||
|
||
[Parameter, EditorRequired] | ||
public ParticipantDto ParticipantDto { get; set; } = default!; | ||
|
||
|
||
} |
44 changes: 44 additions & 0 deletions
44
src/Server.UI/Pages/QA/Enrolments/Components/ConsentTabPanel.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
@using Cfo.Cats.Application.Features.Documents.Queries | ||
@using Cfo.Cats.Application.Features.Participants.DTOs | ||
|
||
|
||
<MudRadioGroup T="Guid" @bind-Value="_selectedDocument"> | ||
|
||
@foreach (var consent in ParticipantDto.Consents.OrderByDescending(c => c.ConsentDate)) | ||
{ | ||
<MudRadio T="Guid" Color="Color.Primary" Value="@consent.DocumentId!.Value"> | ||
@consent.FileName (@consent.ConsentDate.ToShortDateString()) | ||
</MudRadio> | ||
} | ||
</MudRadioGroup> | ||
|
||
@if (_selectedDocument != Guid.Empty) | ||
{ | ||
<DocumentDisplay DocumentId="_selectedDocument" /> | ||
|
||
} | ||
|
||
|
||
|
||
|
||
@code { | ||
|
||
private Guid _selectedDocument = Guid.Empty; | ||
|
||
[Parameter] [EditorRequired] | ||
public ParticipantDto ParticipantDto { get; set; } = default!; | ||
|
||
protected override void OnInitialized() | ||
{ | ||
if (_selectedDocument == Guid.Empty) | ||
{ | ||
var latest = ParticipantDto.Consents.MaxBy(c => c.ConsentDate); | ||
if (latest is not null) | ||
{ | ||
_selectedDocument = latest.DocumentId.GetValueOrDefault(); | ||
} | ||
} | ||
} | ||
|
||
|
||
} |
68 changes: 68 additions & 0 deletions
68
src/Server.UI/Pages/QA/Enrolments/Components/DocumentDisplay.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
@using Cfo.Cats.Application.Features.Documents.Queries | ||
@inherits CatsComponentBase | ||
|
||
<MudPaper Class="document-container"> | ||
@if (fileBase64 != null && extension!.Equals("pdf", StringComparison.CurrentCultureIgnoreCase)) | ||
{ | ||
<object data="data:application/pdf;base64,@fileBase64" type="application/pdf" class="full-size-object"> | ||
<p>PDF cannot be displayed.</p> | ||
</object> | ||
} | ||
else if (IsFileRejected) | ||
{ | ||
<MudText Typo="Typo.caption"> | ||
File cannot be displayed. Please contact support. | ||
</MudText> | ||
} | ||
else | ||
{ | ||
<MudText Typo="Typo.caption"> | ||
Please select a file to display | ||
</MudText> | ||
} | ||
</MudPaper> | ||
|
||
@code { | ||
|
||
private string? fileBase64; | ||
private string? extension; | ||
|
||
private bool IsFileRejected { get; set; } | ||
|
||
[Parameter] | ||
public Guid DocumentId { get; set; } | ||
|
||
private Guid _previous = Guid.Empty; | ||
|
||
protected override async Task OnParametersSetAsync() | ||
{ | ||
if (_previous != DocumentId) | ||
{ | ||
var query = new GetDocumentById.Query | ||
{ | ||
Id = DocumentId | ||
}; | ||
|
||
var result = await GetNewMediator().Send(query); | ||
if (result.Succeeded) | ||
{ | ||
_previous = DocumentId; | ||
IsFileRejected = false; | ||
using (var memoryStream = new MemoryStream()) | ||
{ | ||
await result.Data!.FileStream.CopyToAsync(memoryStream); | ||
var bytes = memoryStream.ToArray(); | ||
fileBase64 = Convert.ToBase64String(bytes); | ||
} | ||
extension = result.Data!.FileExtension; | ||
} | ||
else | ||
{ | ||
IsFileRejected = true; | ||
} | ||
} | ||
} | ||
|
||
|
||
|
||
} |
73 changes: 73 additions & 0 deletions
73
src/Server.UI/Pages/QA/Enrolments/Components/ParticipantQaDetails.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
@using Cfo.Cats.Application.Features.Participants.DTOs | ||
<MudForm> | ||
<MudList T="string"> | ||
<MudListSubheader> | ||
<ChildContent> | ||
<MudText Typo="Typo.h5">Participant Confirmation</MudText> | ||
</ChildContent> | ||
</MudListSubheader> | ||
<MudDivider /> | ||
@foreach (var item in Participant.ExternalIdentifiers) | ||
{ | ||
<MudListItem> | ||
<MudText Typo="Typo.body1">@item.Type</MudText> | ||
<MudText Typo="Typo.body2">@item.Value</MudText> | ||
</MudListItem> | ||
} | ||
<MudListItem> | ||
<MudText Typo="Typo.body1">First Name</MudText> | ||
<MudText Typo="Typo.body2">@Participant.FirstName</MudText> | ||
</MudListItem> | ||
<MudListItem> | ||
<MudText Typo="Typo.body1">Last Name</MudText> | ||
<MudText Typo="Typo.body2">@Participant.LastName</MudText> | ||
</MudListItem> | ||
<MudListItem> | ||
<MudText Typo="Typo.body1"> | ||
Date Of Birth | ||
</MudText> | ||
<MudText Typo="Typo.body2"> | ||
@Participant.DateOfBirth | ||
</MudText> | ||
|
||
</MudListItem> | ||
<MudListItem> | ||
<MudText Typo="Typo.body1">Delivery Location</MudText> | ||
<MudText Typo="Typo.body2">@Participant.EnrolmentLocation?.Name</MudText> | ||
</MudListItem> | ||
@if (Participant.EnrolmentLocationJustification is not null) | ||
{ | ||
<MudListItem> | ||
<MudText Typo="Typo.body1">System Location</MudText> | ||
<MudText Typo="Typo.body2"> @Participant.CurrentLocation?.Name</MudText> | ||
</MudListItem> | ||
<MudListItem> | ||
<MudText Typo="Typo.body1">Justification</MudText> | ||
<MudText Typo="Typo.body2"> @Participant.EnrolmentLocationJustification</MudText> | ||
</MudListItem> | ||
} | ||
<MudListSubheader> | ||
<ChildContent> | ||
<MudText Typo="Typo.h5">Staff Member Confirmation</MudText> | ||
</ChildContent> | ||
</MudListSubheader> | ||
<MudDivider /> | ||
<MudListItem> | ||
<MudText Typo="Typo.body1">Staff Member</MudText> | ||
<MudText Typo="Typo.body2"> @Participant.SupportWorker</MudText> | ||
</MudListItem> | ||
<MudListItem> | ||
<MudText Typo="Typo.body1">Consent Date</MudText> | ||
<MudText Typo="Typo.body2">@Participant.Consents.Max(c => c.ConsentDate).ToShortDateString()</MudText> | ||
</MudListItem> | ||
|
||
</MudList> | ||
|
||
</MudForm> | ||
|
||
@code{ | ||
|
||
[Parameter, EditorRequired] | ||
public ParticipantDto Participant { get; set; } = default!; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.