From 7022fa597d1a3fbe415eea110eb205b2701493ed Mon Sep 17 00:00:00 2001
From: Smith Thay <77938144+smiththay@users.noreply.github.com>
Date: Tue, 25 Jul 2023 17:14:05 -0400
Subject: [PATCH 1/6] progress commit
---
src/UDS.Net.Forms/Pages/Visits/Details.cshtml | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/src/UDS.Net.Forms/Pages/Visits/Details.cshtml b/src/UDS.Net.Forms/Pages/Visits/Details.cshtml
index 25e9b41a..ea08d89d 100644
--- a/src/UDS.Net.Forms/Pages/Visits/Details.cshtml
+++ b/src/UDS.Net.Forms/Pages/Visits/Details.cshtml
@@ -66,7 +66,7 @@
@foreach (var form in Model.Visit.Forms)
- {
+ {
-
@@ -76,6 +76,14 @@
{
Required
}
+ @if (form.Language == FormLanguage.English)
+ {
+ English
+ }
+ else if (form.Language == FormLanguage.Spanish)
+ {
+ Spanish
+ }
@form.Title
From e0d358d01e9676166c1ec93569797cd3a625e8bd Mon Sep 17 00:00:00 2001
From: Smith Thay <77938144+smiththay@users.noreply.github.com>
Date: Fri, 28 Jul 2023 16:53:08 -0400
Subject: [PATCH 2/6] progress commit
---
src/UDS.Net.Forms/Pages/Visits/Details.cshtml | 39 +++++++++++++++----
.../Extensions/DtoToDomainMapper.cs | 4 +-
2 files changed, 33 insertions(+), 10 deletions(-)
diff --git a/src/UDS.Net.Forms/Pages/Visits/Details.cshtml b/src/UDS.Net.Forms/Pages/Visits/Details.cshtml
index ea08d89d..ffc7acc2 100644
--- a/src/UDS.Net.Forms/Pages/Visits/Details.cshtml
+++ b/src/UDS.Net.Forms/Pages/Visits/Details.cshtml
@@ -66,7 +66,7 @@
@foreach (var form in Model.Visit.Forms)
- {
+ {
-
@@ -76,14 +76,16 @@
{
Required
}
- @if (form.Language == FormLanguage.English)
- {
- English
- }
- else if (form.Language == FormLanguage.Spanish)
- {
- Spanish
+ @{
+ var cssClassFormLanguage = "bg-green-50";
+ if (form.Language == FormLanguage.English)
+ cssClassFormLanguage = "bg-green-75";
+ else if (form.Language == FormLanguage.Spanish)
+ cssClassFormLanguage = "bg-green-100";
}
+
+ @form.Language
+
@form.Title
@@ -96,6 +98,7 @@
@{
var cssClassFormState = "text-gray-900";
+
if (form.Status == FormStatus.NotStarted)
cssClassFormState = "text-red-500 border-transparent";
else if (form.Status == FormStatus.InProgress)
@@ -104,10 +107,30 @@
cssClassFormState = "text-teal-500 bg-teal-50 border-teal";
else if (form.Status == FormStatus.NotIncluded)
cssClassFormState = "text-teal-500 border-transparent";
+
}
@form.Status
+
+ @{
+ var cssClassReason = "text-gray-900";
+
+ if (form.ReasonCodeNotIncluded == ReasonCode.CognitiveOrBehavioralProblem)
+ cssClassReason = "text-red-500 border-transparent";
+ else if (form.ReasonCodeNotIncluded == ReasonCode.OtherProblem)
+ cssClassReason = "text-indigo-500 border-transparent";
+ else if (form.ReasonCodeNotIncluded == ReasonCode.PhysicalProblem)
+ cssClassReason = "text-teal-500 bg-teal-50 border-teal";
+ else if (form.ReasonCodeNotIncluded == ReasonCode.UnknownOrInadequateInformation)
+ cssClassReason = "text-teal-500 border-transparent";
+ else if (form.ReasonCodeNotIncluded == ReasonCode.VerbalRefusal)
+ cssClassReason = "text-teal-500 border-transparent";
+
+ }
+
+ @form.ReasonCodeNotIncluded
+
diff --git a/src/UDS.Net.Services/Extensions/DtoToDomainMapper.cs b/src/UDS.Net.Services/Extensions/DtoToDomainMapper.cs
index c2d2f0c6..83afdd8a 100644
--- a/src/UDS.Net.Services/Extensions/DtoToDomainMapper.cs
+++ b/src/UDS.Net.Services/Extensions/DtoToDomainMapper.cs
@@ -175,9 +175,9 @@ public static Form ToDomain(this FormDto dto, int visitId, string username)
if (!string.IsNullOrWhiteSpace(dto.Language) && Int32.TryParse(dto.Language, out int languageValue))
{
formLanguage = (FormLanguage)languageValue;
- }
+ }
ReasonCode? reasonCode = null;
- if (formStatus == FormStatus.NotIncluded && string.IsNullOrWhiteSpace(dto.ReasonCode) && Int32.TryParse(dto.ReasonCode, out int reasonCodeValue))
+ if (formStatus == FormStatus.NotIncluded && !string.IsNullOrWhiteSpace(dto.ReasonCode) && Int32.TryParse(dto.ReasonCode, out int reasonCodeValue))
{
reasonCode = (ReasonCode)reasonCodeValue;
}
From b7e974c4ff3d44dfc2b7c5d325ff9e2d7d47d977 Mon Sep 17 00:00:00 2001
From: Smith Thay <77938144+smiththay@users.noreply.github.com>
Date: Mon, 31 Jul 2023 16:44:26 -0400
Subject: [PATCH 3/6] adds language to domain to vm mapper
---
src/UDS.Net.Forms/Extensions/DomainToViewModelMapper.cs | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/UDS.Net.Forms/Extensions/DomainToViewModelMapper.cs b/src/UDS.Net.Forms/Extensions/DomainToViewModelMapper.cs
index 8ad411a5..2155cb87 100644
--- a/src/UDS.Net.Forms/Extensions/DomainToViewModelMapper.cs
+++ b/src/UDS.Net.Forms/Extensions/DomainToViewModelMapper.cs
@@ -105,7 +105,8 @@ public static FormModel ToVM(this Form form)
CreatedBy = form.CreatedBy,
ModifiedBy = form.ModifiedBy,
DeletedBy = form.DeletedBy,
- IsDeleted = form.IsDeleted
+ IsDeleted = form.IsDeleted,
+ Language = form.Language
};
if (form.Fields != null)
From 56e0bcacd4b0a16b5e3f4f16475ee409195c3782 Mon Sep 17 00:00:00 2001
From: Smith Thay <77938144+smiththay@users.noreply.github.com>
Date: Mon, 31 Jul 2023 17:12:15 -0400
Subject: [PATCH 4/6] adds reasoncode to domain to viewmodel mapper
---
src/UDS.Net.Forms/Extensions/DomainToViewModelMapper.cs | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/UDS.Net.Forms/Extensions/DomainToViewModelMapper.cs b/src/UDS.Net.Forms/Extensions/DomainToViewModelMapper.cs
index 2155cb87..1f74f37d 100644
--- a/src/UDS.Net.Forms/Extensions/DomainToViewModelMapper.cs
+++ b/src/UDS.Net.Forms/Extensions/DomainToViewModelMapper.cs
@@ -12,6 +12,7 @@
using UDS.Net.Forms.Models.UDS3;
using UDS.Net.Services.DomainModels;
using UDS.Net.Services.DomainModels.Forms;
+using UDS.Net.Services.Enums;
using UDS.Net.Services.LookupModels;
namespace UDS.Net.Forms.Extensions
@@ -106,7 +107,8 @@ public static FormModel ToVM(this Form form)
ModifiedBy = form.ModifiedBy,
DeletedBy = form.DeletedBy,
IsDeleted = form.IsDeleted,
- Language = form.Language
+ Language = form.Language,
+ ReasonCodeNotIncluded = form.ReasonCode
};
if (form.Fields != null)
From 7adde554d07b8d5490426c60be3fd7825af90582 Mon Sep 17 00:00:00 2001
From: Smith Thay <77938144+smiththay@users.noreply.github.com>
Date: Mon, 31 Jul 2023 17:13:00 -0400
Subject: [PATCH 5/6] edits visits details view to display properly
---
src/UDS.Net.Forms/Pages/Visits/Details.cshtml | 41 ++++++++-----------
1 file changed, 18 insertions(+), 23 deletions(-)
diff --git a/src/UDS.Net.Forms/Pages/Visits/Details.cshtml b/src/UDS.Net.Forms/Pages/Visits/Details.cshtml
index ffc7acc2..38071a30 100644
--- a/src/UDS.Net.Forms/Pages/Visits/Details.cshtml
+++ b/src/UDS.Net.Forms/Pages/Visits/Details.cshtml
@@ -83,9 +83,16 @@
else if (form.Language == FormLanguage.Spanish)
cssClassFormLanguage = "bg-green-100";
}
-
- @form.Language
-
+ @if (form.Language != FormLanguage.English && form.Language != FormLanguage.Spanish)
+ {
+
+ }
+ else
+ {
+
+ @form.Language
+
+ }
@form.Title
@@ -110,26 +117,14 @@
}
- @form.Status
-
-
- @{
- var cssClassReason = "text-gray-900";
-
- if (form.ReasonCodeNotIncluded == ReasonCode.CognitiveOrBehavioralProblem)
- cssClassReason = "text-red-500 border-transparent";
- else if (form.ReasonCodeNotIncluded == ReasonCode.OtherProblem)
- cssClassReason = "text-indigo-500 border-transparent";
- else if (form.ReasonCodeNotIncluded == ReasonCode.PhysicalProblem)
- cssClassReason = "text-teal-500 bg-teal-50 border-teal";
- else if (form.ReasonCodeNotIncluded == ReasonCode.UnknownOrInadequateInformation)
- cssClassReason = "text-teal-500 border-transparent";
- else if (form.ReasonCodeNotIncluded == ReasonCode.VerbalRefusal)
- cssClassReason = "text-teal-500 border-transparent";
-
- }
-
- @form.ReasonCodeNotIncluded
+ @if (form.Status == FormStatus.NotIncluded)
+ {
+ @form.ReasonCodeNotIncluded
+ }
+ else
+ {
+ @form.Status
+ }
From 51c7cc3c7978674cab072f7e4adf3f50131d94da Mon Sep 17 00:00:00 2001
From: Smith Thay <77938144+smiththay@users.noreply.github.com>
Date: Mon, 31 Jul 2023 17:13:45 -0400
Subject: [PATCH 6/6] removes whitespace
---
src/UDS.Net.Services/Extensions/DtoToDomainMapper.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/UDS.Net.Services/Extensions/DtoToDomainMapper.cs b/src/UDS.Net.Services/Extensions/DtoToDomainMapper.cs
index 83afdd8a..9980477b 100644
--- a/src/UDS.Net.Services/Extensions/DtoToDomainMapper.cs
+++ b/src/UDS.Net.Services/Extensions/DtoToDomainMapper.cs
@@ -175,7 +175,7 @@ public static Form ToDomain(this FormDto dto, int visitId, string username)
if (!string.IsNullOrWhiteSpace(dto.Language) && Int32.TryParse(dto.Language, out int languageValue))
{
formLanguage = (FormLanguage)languageValue;
- }
+ }
ReasonCode? reasonCode = null;
if (formStatus == FormStatus.NotIncluded && !string.IsNullOrWhiteSpace(dto.ReasonCode) && Int32.TryParse(dto.ReasonCode, out int reasonCodeValue))
{