From 189e9b8beb60fac5ce2208032772d238c7e80ab6 Mon Sep 17 00:00:00 2001 From: Ashley Wilson Date: Wed, 18 May 2022 08:48:32 -0400 Subject: [PATCH 01/30] Updates version --- src/UDS.Net.Web/UDS.Net.Web.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/UDS.Net.Web/UDS.Net.Web.csproj b/src/UDS.Net.Web/UDS.Net.Web.csproj index 5f276fe..e903677 100644 --- a/src/UDS.Net.Web/UDS.Net.Web.csproj +++ b/src/UDS.Net.Web/UDS.Net.Web.csproj @@ -1,7 +1,7 @@ - 3.0.0-beta.3 + 3.0.0-beta.4 Sanders-Brown Center on Aging UDS for .NET MVC UK-SBCoA From 49d3e7e42f2deb5a47356c118dace33d0ece11d8 Mon Sep 17 00:00:00 2001 From: mlan225 <17088502+mlan225@users.noreply.github.com> Date: Tue, 24 May 2022 14:25:19 -0400 Subject: [PATCH 02/30] Add value 9 check to the subjectfamilyhistory form --- src/UDS.Net.Web/Controllers/SubjectFamilyHistoryController.cs | 2 +- src/UDS.Net.Web/wwwroot/js/SubjectFamilyHistory/Edit.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/UDS.Net.Web/Controllers/SubjectFamilyHistoryController.cs b/src/UDS.Net.Web/Controllers/SubjectFamilyHistoryController.cs index f34ad28..3352c10 100644 --- a/src/UDS.Net.Web/Controllers/SubjectFamilyHistoryController.cs +++ b/src/UDS.Net.Web/Controllers/SubjectFamilyHistoryController.cs @@ -231,7 +231,7 @@ public async Task Edit(int id, SubjectFamilyHistory subjectFamily } } - bool hasNeurologicalProblemPsycyiatricCondition = relative.PrimaryNeurologicalProblemPsychiatricCondition.HasValue && relative.PrimaryNeurologicalProblemPsychiatricCondition.Value != 8; + bool hasNeurologicalProblemPsycyiatricCondition = relative.PrimaryNeurologicalProblemPsychiatricCondition.HasValue && relative.PrimaryNeurologicalProblemPsychiatricCondition.Value != 8 && relative.PrimaryNeurologicalProblemPsychiatricCondition.Value != 9; if (!relative.PrimaryDx.HasValue && hasNeurologicalProblemPsycyiatricCondition) { diff --git a/src/UDS.Net.Web/wwwroot/js/SubjectFamilyHistory/Edit.js b/src/UDS.Net.Web/wwwroot/js/SubjectFamilyHistory/Edit.js index 9036b54..b5f75d0 100644 --- a/src/UDS.Net.Web/wwwroot/js/SubjectFamilyHistory/Edit.js +++ b/src/UDS.Net.Web/wwwroot/js/SubjectFamilyHistory/Edit.js @@ -35,7 +35,7 @@ } for(let i = 1; i <= totalRowCount; i++) { const neruoHasValue = this.GetRow(i).find('input[name$=PrimaryNeurologicalProblemPsychiatricCondition]').first().val(); - if(neruoHasValue && neruoHasValue != 8) { + if(neruoHasValue && neruoHasValue != 8 && neruoHasValue != 9) { this.EnableNeuroControls(i); } else { @@ -115,7 +115,7 @@ const jRow = this.GetRow(relationshipIndex); const neuroWatch = jRow.find('input[name$="PrimaryNeurologicalProblemPsychiatricCondition"]').first(); neuroWatch.on('keydown keyup', (events) => { - if ($(events.target).val() == '' || $(events.target).val() == 8) + if ($(events.target).val() == '' || $(events.target).val() == 8 || $(events.target).val() == 9) { this.DisableNeuroControls(relationshipIndex); } else { From c71df98176975db3116dc5ee48e793504253b206 Mon Sep 17 00:00:00 2001 From: mlan225 <17088502+mlan225@users.noreply.github.com> Date: Thu, 2 Jun 2022 23:52:39 -0400 Subject: [PATCH 03/30] Merge in D1 details view This merge includes changes to variable codes, controller, and edit files as well --- .../ClinicianDiagnosisVariableCodes.json | 29 +- .../ClinicianDiagnosisController.cs | 58 + .../Views/ClinicianDiagnosis/Details.cshtml | 2419 +++++++++++------ .../Views/ClinicianDiagnosis/Edit.cshtml | 15 +- 4 files changed, 1706 insertions(+), 815 deletions(-) diff --git a/src/UDS.Net.Web/App_Data/ClinicianDiagnosisVariableCodes.json b/src/UDS.Net.Web/App_Data/ClinicianDiagnosisVariableCodes.json index 6707b2d..2483bb0 100644 --- a/src/UDS.Net.Web/App_Data/ClinicianDiagnosisVariableCodes.json +++ b/src/UDS.Net.Web/App_Data/ClinicianDiagnosisVariableCodes.json @@ -18,6 +18,16 @@ "4": "PPA other/ not otherwise specified" } }, + { + "Name": "FTLDSUBTYPE", + "Description": "Sub types for 14e", + "Codes": { + "1": "Tauopathy", + "2": "TDP-43 proteinopathy", + "3": "Other (SPECIFY)", + "9": "Unknown" + } + }, { "Name": "FINDINGS", "Description": "Codes for findings", @@ -53,5 +63,22 @@ "1": "Yes", "9": "Unknown; no relevant imaging data available" } - } + }, + { + "Name": "CNSNEOPLASMTYPE", + "Description": "Codes for cns neoplasm types", + "Codes": { + "1": "Benign", + "2": "Malignant" + } + }, + { + "Name": "GENERALTHREEGROUP", + "Description" : "Codes for general 'No', 'Yes', 'Unknown' questions", + "Codes" : { + "0": "No", + "1": "Yes", + "9": "Unknown" + } + } ] \ No newline at end of file diff --git a/src/UDS.Net.Web/Controllers/ClinicianDiagnosisController.cs b/src/UDS.Net.Web/Controllers/ClinicianDiagnosisController.cs index 6d730b3..fb6c336 100644 --- a/src/UDS.Net.Web/Controllers/ClinicianDiagnosisController.cs +++ b/src/UDS.Net.Web/Controllers/ClinicianDiagnosisController.cs @@ -17,6 +17,12 @@ public class ClinicianDiagnosisController : PacketFormController private ProtocolVariable _findings; private ProtocolVariable _findingsSubs; private ProtocolVariable _etiologic; + private ProtocolVariable _etiologicsubs; + private ProtocolVariable _generalThreeGroup; + private ProtocolVariable _cnsneoplasmtype; + private ProtocolVariable _dxmethod; + private ProtocolVariable _ppasynt; + private ProtocolVariable _ftldSubtype; private ProtocolVariable[] _protocolVariables; public ClinicianDiagnosisController(UdsContext context, IParticipantsService participantsService, IChecklistService checklistService) : base(context, participantsService, checklistService) @@ -28,6 +34,10 @@ private async void GetVariablesCodes() { string jsonString = await System.IO.File.ReadAllTextAsync("App_Data/ClinicianDiagnosisVariableCodes.json"); _protocolVariables = JsonSerializer.Deserialize(jsonString); + + _ftldSubtype = _protocolVariables + .Where(item => item.Name == "FTLDSUBTYPE") + .FirstOrDefault(); _findings = _protocolVariables .Where(item => item.Name == "FINDINGS") @@ -40,6 +50,26 @@ private async void GetVariablesCodes() _etiologic = _protocolVariables .Where(item => item.Name == "ETIOLOGIC") .FirstOrDefault(); + + _etiologicsubs = _protocolVariables + .Where(item => item.Name == "ETIOLOGICSUBS") + .FirstOrDefault(); + + _cnsneoplasmtype = _protocolVariables + .Where(item => item.Name == "CNSNEOPLASMTYPE") + .FirstOrDefault(); + + _dxmethod = _protocolVariables + .Where(item => item.Name == "DXMETHOD") + .FirstOrDefault(); + + _ppasynt = _protocolVariables + .Where(item => item.Name == "PPASYNT") + .FirstOrDefault(); + + _generalThreeGroup = _protocolVariables + .Where(item => item.Name == "GENERALTHREEGROUP") + .FirstOrDefault(); } // GET: ClinicianDiagnosis @@ -59,12 +89,28 @@ public async Task Details(int? id) var clinicianDiagnosis = await _context.ClinicianDiagnoses .Include(c => c.Visit) + .ThenInclude(c => c.Participant) + .AsNoTracking() .FirstOrDefaultAsync(m => m.Id == id); + if (clinicianDiagnosis == null) { return NotFound(); } + var participantIdentity = await _participantsService.GetParticipantAsync(clinicianDiagnosis.Visit.Participant.Id); + clinicianDiagnosis.Visit.Participant.Profile = participantIdentity; + + ViewBag.Dxmethod = _dxmethod; + ViewBag.FTLDSubtype = _ftldSubtype; + ViewBag.Findings = _findings; + ViewBag.FindingsSubs = _findingsSubs; + ViewBag.Etiologic = _etiologic; + ViewBag.Etiologicsubs = _etiologicsubs; + ViewBag.Cnsneoplasmtype = _cnsneoplasmtype; + ViewBag.Ppasynt = _ppasynt; + ViewBag.GeneralThreeGroup = _generalThreeGroup; + return View(clinicianDiagnosis); } @@ -127,9 +173,15 @@ public async Task Edit(int? id) var participantIdentity = await _participantsService.GetParticipantAsync(clinicianDiagnosis.Visit.Participant.Id); clinicianDiagnosis.Visit.Participant.Profile = participantIdentity; + ViewBag.Dxmethod = _dxmethod; + ViewBag.FTLDSubtype = _ftldSubtype; ViewBag.Findings = _findings; ViewBag.FindingsSubs = _findingsSubs; ViewBag.Etiologic = _etiologic; + ViewBag.Etiologicsubs = _etiologicsubs; + ViewBag.Cnsneoplasmtype = _cnsneoplasmtype; + ViewBag.Ppasynt = _ppasynt; + ViewBag.GeneralThreeGroup = _generalThreeGroup; return View(clinicianDiagnosis); } @@ -162,9 +214,15 @@ public async Task Edit(int id, [Bind("DiagnosisMethod,HasNormalCo var participantIdentity = await _participantsService.GetParticipantAsync(clinicianDiagnosis.Visit.Participant.Id); clinicianDiagnosis.Visit.Participant.Profile = participantIdentity; + ViewBag.Dxmethod = _dxmethod; + ViewBag.FTLDSubtype = _ftldSubtype; ViewBag.Findings = _findings; ViewBag.FindingsSubs = _findingsSubs; ViewBag.Etiologic = _etiologic; + ViewBag.Etiologicsubs = _etiologicsubs; + ViewBag.Cnsneoplasmtype = _cnsneoplasmtype; + ViewBag.Ppasynt = _ppasynt; + ViewBag.GeneralThreeGroup = _generalThreeGroup; if (!String.IsNullOrEmpty(save)) { diff --git a/src/UDS.Net.Web/Views/ClinicianDiagnosis/Details.cshtml b/src/UDS.Net.Web/Views/ClinicianDiagnosis/Details.cshtml index 8cee9a0..4af2ba3 100644 --- a/src/UDS.Net.Web/Views/ClinicianDiagnosis/Details.cshtml +++ b/src/UDS.Net.Web/Views/ClinicianDiagnosis/Details.cshtml @@ -1,815 +1,1622 @@ -@model ClinicianDiagnosis +@model ClinicianDiagnosis @{ - ViewData["Title"] = "Details"; + var title = "D1 Clinician Diagnosis"; + var visitInfo = ""; + if (visitInfo == null) + { + visitInfo = " - " + Model.Visit.Participant.Id + " - Visit " + Model.Visit.VisitNumber; + } + ViewData["Title"] = title + visitInfo; } -

Details

+@await Component.InvokeAsync("VisitHeader", new { visitId = Model.Visit.Id, participationId = +Model.Visit.Participant.Id, participantProfile = Model.Visit.Participant.Profile }) +@await Component.InvokeAsync("FormHeader", new { currentVisit = Model.Visit, currentForm = Model, formTitle = title }) -
-

ClinicianDiagnosis

-
-
-
- @Html.DisplayNameFor(model => model.DiagnosisMethod) -
-
- @Html.DisplayFor(model => model.DiagnosisMethod) -
-
- @Html.DisplayNameFor(model => model.HasNormalCognition) -
-
- @Html.DisplayFor(model => model.HasNormalCognition) -
-
- @Html.DisplayNameFor(model => model.MeetsCriteriaForDementia) -
-
- @Html.DisplayFor(model => model.MeetsCriteriaForDementia) -
-
- @Html.DisplayNameFor(model => model.AmnesticMultiDomainPresent) -
-
- @Html.DisplayFor(model => model.AmnesticMultiDomainPresent) -
-
- @Html.DisplayNameFor(model => model.PosteriorCorticalAtrophyPresent) -
-
- @Html.DisplayFor(model => model.PosteriorCorticalAtrophyPresent) -
-
- @Html.DisplayNameFor(model => model.PrimaryProgressiveAphasiaPresent) -
-
- @Html.DisplayFor(model => model.PrimaryProgressiveAphasiaPresent) -
-
- @Html.DisplayNameFor(model => model.PrimaryProgressiveAphasiaType) -
-
- @Html.DisplayFor(model => model.PrimaryProgressiveAphasiaType) -
-
- @Html.DisplayNameFor(model => model.BehavioralVariantFTDPresent) -
-
- @Html.DisplayFor(model => model.BehavioralVariantFTDPresent) -
-
- @Html.DisplayNameFor(model => model.LewyBodyPresent) -
-
- @Html.DisplayFor(model => model.LewyBodyPresent) -
-
- @Html.DisplayNameFor(model => model.NonAmnesticMultiDomainPresent) -
-
- @Html.DisplayFor(model => model.NonAmnesticMultiDomainPresent) -
-
- @Html.DisplayNameFor(model => model.AmnesticMCISingleDomainPresent) -
-
- @Html.DisplayFor(model => model.AmnesticMCISingleDomainPresent) -
-
- @Html.DisplayNameFor(model => model.AmnesticMCIMultipleDomains) -
-
- @Html.DisplayFor(model => model.AmnesticMCIMultipleDomains) -
-
- @Html.DisplayNameFor(model => model.AmnesticMCIMultipleDomainsLanguage) -
-
- @Html.DisplayFor(model => model.AmnesticMCIMultipleDomainsLanguage) -
-
- @Html.DisplayNameFor(model => model.AmnesticMCIMultipleDomainsAttention) -
-
- @Html.DisplayFor(model => model.AmnesticMCIMultipleDomainsAttention) -
-
- @Html.DisplayNameFor(model => model.AmnesticMCIMultipleDomainsExecutive) -
-
- @Html.DisplayFor(model => model.AmnesticMCIMultipleDomainsExecutive) -
-
- @Html.DisplayNameFor(model => model.AmnesticMCIMultipleDomainsVisuospatial) -
-
- @Html.DisplayFor(model => model.AmnesticMCIMultipleDomainsVisuospatial) -
-
- @Html.DisplayNameFor(model => model.NonAmnesticMCISingleDomain) -
-
- @Html.DisplayFor(model => model.NonAmnesticMCISingleDomain) -
-
- @Html.DisplayNameFor(model => model.NonAmnesticMCISingleDomainLanguage) -
-
- @Html.DisplayFor(model => model.NonAmnesticMCISingleDomainLanguage) -
-
- @Html.DisplayNameFor(model => model.NonAmnesticMCISingleDomainAttention) -
-
- @Html.DisplayFor(model => model.NonAmnesticMCISingleDomainAttention) -
-
- @Html.DisplayNameFor(model => model.NonAmnesticMCISingleDomainExecutive) -
-
- @Html.DisplayFor(model => model.NonAmnesticMCISingleDomainExecutive) -
-
- @Html.DisplayNameFor(model => model.NonAmnesticMCISingleDomainVisuospatial) -
-
- @Html.DisplayFor(model => model.NonAmnesticMCISingleDomainVisuospatial) -
-
- @Html.DisplayNameFor(model => model.NonAmnesticMCIMultipleDomains) -
-
- @Html.DisplayFor(model => model.NonAmnesticMCIMultipleDomains) -
-
- @Html.DisplayNameFor(model => model.NonAmnesticMCIMultipleDomainsLanguage) -
-
- @Html.DisplayFor(model => model.NonAmnesticMCIMultipleDomainsLanguage) -
-
- @Html.DisplayNameFor(model => model.NonAmnesticMCIMultipleDomainsAttention) -
-
- @Html.DisplayFor(model => model.NonAmnesticMCIMultipleDomainsAttention) -
-
- @Html.DisplayNameFor(model => model.NonAmnesticMCIMultipleDomainsExecutive) -
-
- @Html.DisplayFor(model => model.NonAmnesticMCIMultipleDomainsExecutive) -
-
- @Html.DisplayNameFor(model => model.NonAmnesticMCIMultipleDomainsVisuospatial) -
-
- @Html.DisplayFor(model => model.NonAmnesticMCIMultipleDomainsVisuospatial) -
-
- @Html.DisplayNameFor(model => model.CognitivelyImpairedNotMCIPresent) -
-
- @Html.DisplayFor(model => model.CognitivelyImpairedNotMCIPresent) -
-
- @Html.DisplayNameFor(model => model.AbnormallyElevatedAmyloidInPET) -
-
- @Html.DisplayFor(model => model.AbnormallyElevatedAmyloidInPET) -
-
- @Html.DisplayNameFor(model => model.AbnormallyLowAmyloidInCSF) -
-
- @Html.DisplayFor(model => model.AbnormallyLowAmyloidInCSF) -
-
- @Html.DisplayNameFor(model => model.FDGPETPattern) -
-
- @Html.DisplayFor(model => model.FDGPETPattern) -
-
- @Html.DisplayNameFor(model => model.HippocampalAtrophy) -
-
- @Html.DisplayFor(model => model.HippocampalAtrophy) -
-
- @Html.DisplayNameFor(model => model.TauPETEvidenceForAD) -
-
- @Html.DisplayFor(model => model.TauPETEvidenceForAD) -
-
- @Html.DisplayNameFor(model => model.AbnormallyElevatedCSFTauOrPtau) -
-
- @Html.DisplayFor(model => model.AbnormallyElevatedCSFTauOrPtau) -
-
- @Html.DisplayNameFor(model => model.FDGPETEvidenceForFrontalOrAnteriorTemporalHypometabolism) -
-
- @Html.DisplayFor(model => model.FDGPETEvidenceForFrontalOrAnteriorTemporalHypometabolism) -
-
- @Html.DisplayNameFor(model => model.TauPETEvidence) -
-
- @Html.DisplayFor(model => model.TauPETEvidence) -
-
- @Html.DisplayNameFor(model => model.StructuralMREvidence) -
-
- @Html.DisplayFor(model => model.StructuralMREvidence) -
-
- @Html.DisplayNameFor(model => model.DopamineTransporterScanEvidence) -
-
- @Html.DisplayFor(model => model.DopamineTransporterScanEvidence) -
-
- @Html.DisplayNameFor(model => model.OtherEvidenceExists) -
-
- @Html.DisplayFor(model => model.OtherEvidenceExists) -
-
- @Html.DisplayNameFor(model => model.OtherEvidenceSpecified) -
-
- @Html.DisplayFor(model => model.OtherEvidenceSpecified) -
-
- @Html.DisplayNameFor(model => model.LargeVesselInfarcts) -
-
- @Html.DisplayFor(model => model.LargeVesselInfarcts) -
-
- @Html.DisplayNameFor(model => model.LacunarInfarcts) -
-
- @Html.DisplayFor(model => model.LacunarInfarcts) -
-
- @Html.DisplayNameFor(model => model.Macrohemorrhages) -
-
- @Html.DisplayFor(model => model.Macrohemorrhages) -
-
- @Html.DisplayNameFor(model => model.Microhemorrhages) -
-
- @Html.DisplayFor(model => model.Microhemorrhages) -
-
- @Html.DisplayNameFor(model => model.ModerateWhiteMatterHyperintensity) -
-
- @Html.DisplayFor(model => model.ModerateWhiteMatterHyperintensity) -
-
- @Html.DisplayNameFor(model => model.ExtensiveWhiteMatterHyperintensity) -
-
- @Html.DisplayFor(model => model.ExtensiveWhiteMatterHyperintensity) -
-
- @Html.DisplayNameFor(model => model.DominantlyInheritedADMutation) -
-
- @Html.DisplayFor(model => model.DominantlyInheritedADMutation) -
-
- @Html.DisplayNameFor(model => model.HereditaryFTLDMutation) -
-
- @Html.DisplayFor(model => model.HereditaryFTLDMutation) -
-
- @Html.DisplayNameFor(model => model.HereditaryMutationOther) -
-
- @Html.DisplayFor(model => model.HereditaryMutationOther) -
-
- @Html.DisplayNameFor(model => model.HereditaryMutationOtherSpecified) -
-
- @Html.DisplayFor(model => model.HereditaryMutationOtherSpecified) -
-
- @Html.DisplayNameFor(model => model.AlzheimersDiseasePresent) -
-
- @Html.DisplayFor(model => model.AlzheimersDiseasePresent) -
-
- @Html.DisplayNameFor(model => model.AlzheimersDiseaseDiagnosis) -
-
- @Html.DisplayFor(model => model.AlzheimersDiseaseDiagnosis) -
-
- @Html.DisplayNameFor(model => model.LewyBodyDiseasePresent) -
-
- @Html.DisplayFor(model => model.LewyBodyDiseasePresent) -
-
- @Html.DisplayNameFor(model => model.LewyBodyDiseaseDiagnosis) -
-
- @Html.DisplayFor(model => model.LewyBodyDiseaseDiagnosis) -
-
- @Html.DisplayNameFor(model => model.ParkinsonsDiseasePresent) -
-
- @Html.DisplayFor(model => model.ParkinsonsDiseasePresent) -
-
- @Html.DisplayNameFor(model => model.MultipleSystemAtrophyPresent) -
-
- @Html.DisplayFor(model => model.MultipleSystemAtrophyPresent) -
-
- @Html.DisplayNameFor(model => model.MultipleSystemAtrophyDiagnosis) -
-
- @Html.DisplayFor(model => model.MultipleSystemAtrophyDiagnosis) -
-
- @Html.DisplayNameFor(model => model.ProgressiveSupranuclearPaslyPresent) -
-
- @Html.DisplayFor(model => model.ProgressiveSupranuclearPaslyPresent) -
-
- @Html.DisplayNameFor(model => model.ProgressiveSupranuclearPaslyDiagnosis) -
-
- @Html.DisplayFor(model => model.ProgressiveSupranuclearPaslyDiagnosis) -
-
- @Html.DisplayNameFor(model => model.CorticobasalDegenerationPresent) -
-
- @Html.DisplayFor(model => model.CorticobasalDegenerationPresent) -
-
- @Html.DisplayNameFor(model => model.CorticobasalDegenerationDiagnosis) -
-
- @Html.DisplayFor(model => model.CorticobasalDegenerationDiagnosis) -
-
- @Html.DisplayNameFor(model => model.FTLDWithMotorNeuronDiseasePresent) -
-
- @Html.DisplayFor(model => model.FTLDWithMotorNeuronDiseasePresent) -
-
- @Html.DisplayNameFor(model => model.FTLDWithMotorNeuronDiseaseDiagnosis) -
-
- @Html.DisplayFor(model => model.FTLDWithMotorNeuronDiseaseDiagnosis) -
-
- @Html.DisplayNameFor(model => model.FTLDNOSPresent) -
-
- @Html.DisplayFor(model => model.FTLDNOSPresent) -
-
- @Html.DisplayNameFor(model => model.FTLDNOSDiagnosis) -
-
- @Html.DisplayFor(model => model.FTLDNOSDiagnosis) -
-
- @Html.DisplayNameFor(model => model.FTLDSubtype) -
-
- @Html.DisplayFor(model => model.FTLDSubtype) -
-
- @Html.DisplayNameFor(model => model.FTLDSubtypeOtherSpecified) -
-
- @Html.DisplayFor(model => model.FTLDSubtypeOtherSpecified) -
-
- @Html.DisplayNameFor(model => model.VascularBrainInjuryPresent) -
-
- @Html.DisplayFor(model => model.VascularBrainInjuryPresent) -
-
- @Html.DisplayNameFor(model => model.VascularBrainInjuryDiagnosis) -
-
- @Html.DisplayFor(model => model.VascularBrainInjuryDiagnosis) -
-
- @Html.DisplayNameFor(model => model.PreviousSymptomaticStroke) -
-
- @Html.DisplayFor(model => model.PreviousSymptomaticStroke) -
-
- @Html.DisplayNameFor(model => model.TemporalRelationshipBetweenStrokeAndCognitive) -
-
- @Html.DisplayFor(model => model.TemporalRelationshipBetweenStrokeAndCognitive) -
-
- @Html.DisplayNameFor(model => model.ConfirmationOfStrokeByNeuroImaging) -
-
- @Html.DisplayFor(model => model.ConfirmationOfStrokeByNeuroImaging) -
-
- @Html.DisplayNameFor(model => model.ImagingEvidenceOfCysticInfarctionInCognitiveNetwork) -
-
- @Html.DisplayFor(model => model.ImagingEvidenceOfCysticInfarctionInCognitiveNetwork) -
-
- @Html.DisplayNameFor(model => model.ImagingEvidenceOfCysticInfarctionExtensiveWhiteMatterHyperintensistyAndExecutiveImpairment) -
-
- @Html.DisplayFor(model => model.ImagingEvidenceOfCysticInfarctionExtensiveWhiteMatterHyperintensistyAndExecutiveImpairment) -
-
- @Html.DisplayNameFor(model => model.EssentialTremorPresent) -
-
- @Html.DisplayFor(model => model.EssentialTremorPresent) -
-
- @Html.DisplayNameFor(model => model.EssentialTremorDiagnosis) -
-
- @Html.DisplayFor(model => model.EssentialTremorDiagnosis) -
-
- @Html.DisplayNameFor(model => model.DownSyndromePresent) -
-
- @Html.DisplayFor(model => model.DownSyndromePresent) -
-
- @Html.DisplayNameFor(model => model.DownSyndromeDiagnosis) -
-
- @Html.DisplayFor(model => model.DownSyndromeDiagnosis) -
-
- @Html.DisplayNameFor(model => model.HuntingtonsDiseasePresent) -
-
- @Html.DisplayFor(model => model.HuntingtonsDiseasePresent) -
-
- @Html.DisplayNameFor(model => model.HuntingtonsDiseaseDiagnosis) -
-
- @Html.DisplayFor(model => model.HuntingtonsDiseaseDiagnosis) -
-
- @Html.DisplayNameFor(model => model.PrionDiseasePresent) -
-
- @Html.DisplayFor(model => model.PrionDiseasePresent) -
-
- @Html.DisplayNameFor(model => model.PrionDiseaseDiagnosis) -
-
- @Html.DisplayFor(model => model.PrionDiseaseDiagnosis) -
-
- @Html.DisplayNameFor(model => model.TraumaticBrainInjuryPresent) -
-
- @Html.DisplayFor(model => model.TraumaticBrainInjuryPresent) -
-
- @Html.DisplayNameFor(model => model.TraumaticBrainInjuryDiagnosis) -
-
- @Html.DisplayFor(model => model.TraumaticBrainInjuryDiagnosis) -
-
- @Html.DisplayNameFor(model => model.ChronicTraumaticEncephalopathySymptom) -
-
- @Html.DisplayFor(model => model.ChronicTraumaticEncephalopathySymptom) -
-
- @Html.DisplayNameFor(model => model.NormalPressureHydrocephalusPresent) -
-
- @Html.DisplayFor(model => model.NormalPressureHydrocephalusPresent) -
-
- @Html.DisplayNameFor(model => model.NormalPressureHydropcephalusDiagnosis) -
-
- @Html.DisplayFor(model => model.NormalPressureHydropcephalusDiagnosis) -
-
- @Html.DisplayNameFor(model => model.EpilepsyPresent) -
-
- @Html.DisplayFor(model => model.EpilepsyPresent) -
-
- @Html.DisplayNameFor(model => model.EpilepsyDiagnosis) -
-
- @Html.DisplayFor(model => model.EpilepsyDiagnosis) -
-
- @Html.DisplayNameFor(model => model.CNSNeoplasmPresent) -
-
- @Html.DisplayFor(model => model.CNSNeoplasmPresent) -
-
- @Html.DisplayNameFor(model => model.CNSNeoplasmDiagnosis) -
-
- @Html.DisplayFor(model => model.CNSNeoplasmDiagnosis) -
-
- @Html.DisplayNameFor(model => model.CNSNeoplasmType) -
-
- @Html.DisplayFor(model => model.CNSNeoplasmType) -
-
- @Html.DisplayNameFor(model => model.HumanImmunodeficiencyVirusPresent) -
-
- @Html.DisplayFor(model => model.HumanImmunodeficiencyVirusPresent) -
-
- @Html.DisplayNameFor(model => model.HumanImmunodeficiencyVirusDiagnosis) -
-
- @Html.DisplayFor(model => model.HumanImmunodeficiencyVirusDiagnosis) -
-
- @Html.DisplayNameFor(model => model.OtherCognitiveImpairmentPresent) -
-
- @Html.DisplayFor(model => model.OtherCognitiveImpairmentPresent) -
-
- @Html.DisplayNameFor(model => model.OtherCognitiveImpairmentDiagnosis) -
-
- @Html.DisplayFor(model => model.OtherCognitiveImpairmentDiagnosis) -
-
- @Html.DisplayNameFor(model => model.OtherCognitiveImpairmentSpecified) -
-
- @Html.DisplayFor(model => model.OtherCognitiveImpairmentSpecified) -
-
- @Html.DisplayNameFor(model => model.ActiveDepressionPresent) -
-
- @Html.DisplayFor(model => model.ActiveDepressionPresent) -
-
- @Html.DisplayNameFor(model => model.ActiveDepressionDiagnosis) -
-
- @Html.DisplayFor(model => model.ActiveDepressionDiagnosis) -
-
- @Html.DisplayNameFor(model => model.ActiveDepressionTreatment) -
-
- @Html.DisplayFor(model => model.ActiveDepressionTreatment) -
-
- @Html.DisplayNameFor(model => model.BipolarDisorderPresent) -
-
- @Html.DisplayFor(model => model.BipolarDisorderPresent) -
-
- @Html.DisplayNameFor(model => model.BipolarDisorderDiagnosis) -
-
- @Html.DisplayFor(model => model.BipolarDisorderDiagnosis) -
-
- @Html.DisplayNameFor(model => model.SchizophreniaPresent) -
-
- @Html.DisplayFor(model => model.SchizophreniaPresent) -
-
- @Html.DisplayNameFor(model => model.SchizophreniaDiagnosis) -
-
- @Html.DisplayFor(model => model.SchizophreniaDiagnosis) -
-
- @Html.DisplayNameFor(model => model.AnxietyDisorderPresent) -
-
- @Html.DisplayFor(model => model.AnxietyDisorderPresent) -
-
- @Html.DisplayNameFor(model => model.AnxietyDiagnosis) -
-
- @Html.DisplayFor(model => model.AnxietyDiagnosis) -
-
- @Html.DisplayNameFor(model => model.DeliriumPresent) -
-
- @Html.DisplayFor(model => model.DeliriumPresent) -
-
- @Html.DisplayNameFor(model => model.DeliriumDiagnosis) -
-
- @Html.DisplayFor(model => model.DeliriumDiagnosis) -
-
- @Html.DisplayNameFor(model => model.PostTraumaticStressDisorderPresent) -
-
- @Html.DisplayFor(model => model.PostTraumaticStressDisorderPresent) -
-
- @Html.DisplayNameFor(model => model.PostTraumaticStressDisorderDiagnosis) -
-
- @Html.DisplayFor(model => model.PostTraumaticStressDisorderDiagnosis) -
-
- @Html.DisplayNameFor(model => model.OtherPsychiatricDiseasePresent) -
-
- @Html.DisplayFor(model => model.OtherPsychiatricDiseasePresent) -
-
- @Html.DisplayNameFor(model => model.OtherPsychiatricDiseaseDiagnosis) -
-
- @Html.DisplayFor(model => model.OtherPsychiatricDiseaseDiagnosis) -
-
- @Html.DisplayNameFor(model => model.OtherPsychiatricDiseaseSpecified) -
-
- @Html.DisplayFor(model => model.OtherPsychiatricDiseaseSpecified) -
-
- @Html.DisplayNameFor(model => model.AlcoholAbuse) -
-
- @Html.DisplayFor(model => model.AlcoholAbuse) -
-
- @Html.DisplayNameFor(model => model.AlcoholAbuseDiagnosis) -
-
- @Html.DisplayFor(model => model.AlcoholAbuseDiagnosis) -
-
- @Html.DisplayNameFor(model => model.CurrentAlcoholAbuse) -
-
- @Html.DisplayFor(model => model.CurrentAlcoholAbuse) -
-
- @Html.DisplayNameFor(model => model.SubstanceAbuse) -
-
- @Html.DisplayFor(model => model.SubstanceAbuse) -
-
- @Html.DisplayNameFor(model => model.SubstanceAbuseDiagnosis) -
-
- @Html.DisplayFor(model => model.SubstanceAbuseDiagnosis) -
-
- @Html.DisplayNameFor(model => model.SystemicDisease) -
-
- @Html.DisplayFor(model => model.SystemicDisease) -
-
- @Html.DisplayNameFor(model => model.SystemicDiseaseDiagnosis) -
-
- @Html.DisplayFor(model => model.SystemicDiseaseDiagnosis) -
-
- @Html.DisplayNameFor(model => model.Medications) -
-
- @Html.DisplayFor(model => model.Medications) -
-
- @Html.DisplayNameFor(model => model.MedicationsDiagnosis) -
-
- @Html.DisplayFor(model => model.MedicationsDiagnosis) -
-
- @Html.DisplayNameFor(model => model.NOS1) -
-
- @Html.DisplayFor(model => model.NOS1) -
-
- @Html.DisplayNameFor(model => model.NOS1Diagnosis) -
-
- @Html.DisplayFor(model => model.NOS1Diagnosis) -
-
- @Html.DisplayNameFor(model => model.NOS1Specified) -
-
- @Html.DisplayFor(model => model.NOS1Specified) -
-
- @Html.DisplayNameFor(model => model.NOS2) -
-
- @Html.DisplayFor(model => model.NOS2) -
-
- @Html.DisplayNameFor(model => model.NOS2Diagnosis) -
-
- @Html.DisplayFor(model => model.NOS2Diagnosis) -
-
- @Html.DisplayNameFor(model => model.NOS2Specified) -
-
- @Html.DisplayFor(model => model.NOS2Specified) -
-
- @Html.DisplayNameFor(model => model.NOS3) -
-
- @Html.DisplayFor(model => model.NOS3) -
-
- @Html.DisplayNameFor(model => model.NOS3Diagnosis) -
-
- @Html.DisplayFor(model => model.NOS3Diagnosis) -
-
- @Html.DisplayNameFor(model => model.NOS3Specified) -
-
- @Html.DisplayFor(model => model.NOS3Specified) -
-
- @Html.DisplayNameFor(model => model.Visit) -
-
- @Html.DisplayFor(model => model.Visit.Id) -
-
- @Html.DisplayNameFor(model => model.ExaminerInitials) -
-
- @Html.DisplayFor(model => model.ExaminerInitials) -
-
- @Html.DisplayNameFor(model => model.FormStatus) -
-
- @Html.DisplayFor(model => model.FormStatus) -
-
+
+
+

INSTRUCTIONS: This form is to be completed by the clinician. For additional clarification and + examples, see UDS Coding Guidebook for @Html.DisplayTextFor(v => v.Visit.VisitType) Visit Packet, Form D1. Check + only one box per question.

+
+
+
+
+
+
+

This form is divided into three main sections

+
+
Section 1
+
+
+ Cognitive and behavioral status +
+
+ Normal cognition / MCI / dementia and dementia syndrome +
+
Section 2
+
+
+ Biomarkers, imaging, and genetics +
+
+ Neurodegenerative imaging and CSF biomarkers, imaging evidence for CVD, and known genetic mutations for AD + and FTLD +
+
Section 3
+
+
+ Etiological diagnoses +
+
+ Presumed etiological diagnoses for the cognitive disorder +
+
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ @Html.DisplayNameFor(model => model.DiagnosisMethod) + + @{ + var diagnosisMethodDisplay = ""; + if(Model.DiagnosisMethod.HasValue) { + ViewBag.Dxmethod.Codes.TryGetValue(Model.DiagnosisMethod.ToString(), out diagnosisMethodDisplay); + } +
@Model.DiagnosisMethod @diagnosisMethodDisplay
+ } +
+ +

Section 1: Cognitive and behavioral status

+
+ @Html.DisplayNameFor(model => model.HasNormalCognition) + + @Html.Raw(Model.HasNormalCognition == true ? "1 Yes (SKIP TO QUESTION 6)" : (Model.HasNormalCognition == false ? "0 No (CONTINUE TO QUESTION 3)" : "")) +
+
+ @Html.DisplayNameFor(model => model.MeetsCriteriaForDementia) +
+
+ @Html.Raw(Model.MeetsCriteriaForDementia == true ? "1 Yes (CONTINUE TO QUESTION 4)" : (Model.MeetsCriteriaForDementia == false ? "0 No (SKIP TO QUESTION 5)" : "")) +
+
+
+ All-cause dementia +

+ The subject has cognitive or behavioral (neuropsychiatric) symptoms that meet all of the following criteria: +

+
    +
  • Interfere with ability to function as before at work or at usual activities?
  • +
  • Represent a decline from previous levels of functioning?
  • +
  • Are not explained by delirium or major psychiatric disorder?
  • +
  • + Include cognitive impairment detected and diagnosed through a + combination of 1) history-taking and 2) objective cognitive + assessment (bedside or neuropsychological testing)? +
  • +
+
+
+

AND

+ Impairment in one* or more of the following domains. +
    +
  • Impaired ability to acquire and remember new information
  • +
  • Impaired reasoning and handling of complex tasks, poor judgment
  • +
  • Impaired visuospatial abilities
  • +
  • Impaired language functions
  • +
  • Changes in personality, behavior, or comportment
  • +
+

+ * In the event of single-domain impairment (e.g., language in PPA, behavior in bvFTD, posterior cortical atrophy), the subject must not fulfill criteria for MCI. +

+
+
+ If the subject meets criteria for dementia, answer Questions 4a–4f below and then SKIP TO QUESTION 6. +
+

+ Based entirely on the history and examination (including neuropsychological testing), what is the cognitive/behavioral syndrome? Select one or more as Present; all others will default to Absent in the NACC database. +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Dementia syndromePresent
+ @Html.DisplayNameFor(model => model.AmnesticMultiDomainPresent) + +
+ @Html.DisplayFor(model => model.AmnesticMultiDomainPresent) + +
+
+ @Html.DisplayNameFor(model => model.PosteriorCorticalAtrophyPresent) + +
+ @Html.DisplayFor(model => model.PosteriorCorticalAtrophyPresent) + +
+
+ @Html.DisplayNameFor(model => model.PrimaryProgressiveAphasiaPresent) + +
+ @Html.DisplayFor(model => model.PrimaryProgressiveAphasiaPresent) + +
+
+ @Html.DisplayNameFor(model => model.PrimaryProgressiveAphasiaType) + + @{ + var primaryProgressiveAphasiaTypeDisplay = ""; + if(Model.PrimaryProgressiveAphasiaType.HasValue) { + ViewBag.Ppasynt.Codes.TryGetValue(Model.PrimaryProgressiveAphasiaType.ToString(), out primaryProgressiveAphasiaTypeDisplay); + } +
@Model.PrimaryProgressiveAphasiaType @primaryProgressiveAphasiaTypeDisplay
+ } +
+ @Html.DisplayNameFor(model => model.BehavioralVariantFTDPresent) + +
+ @Html.DisplayFor(model => model.BehavioralVariantFTDPresent) + +
+
+ @Html.DisplayNameFor(model => model.LewyBodyPresent) + +
+ @Html.DisplayFor(model => model.LewyBodyPresent) + +
+
+ @Html.DisplayNameFor(model => model.NonAmnesticMultiDomainPresent) + +
+ @Html.DisplayFor(model => model.NonAmnesticMultiDomainPresent) + +
+
+
+
+ If the subject does not have normal cognition or behavior and is not clinically demented, indicate the type of cognitive impairment below +
+
+
+ MCI CORE CLINICAL CRITERIA +
    +
  • + Is the subject, the co-participant, or a clinician concerned about a change in cognition compared to the subject's previous level? +
  • +
  • + Is there impairment in one or more cognitive domains (memory, language, executive function, attention, and visuospatial skills)? +
  • +
  • + Is there largely preserved independence in functional abilities (no change from prior manner of functioning or uses minimal aids or assistance)? +
  • +
+
+
+

Select one syndrome from 5a-5e as being Present (all others will default to Absent in the NACC database), and then CONTINUE TO QUESTION 6. If you select MCI below, it should meet the MCI core clinical criteria outlined above.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Type + + Present + + Affected domains + + No / Yes +
+ @Html.DisplayNameFor(model => model.AmnesticMCISingleDomainPresent) + + @Html.DisplayFor(model => model.AmnesticMCISingleDomainPresent) 1 +
+ @Html.DisplayNameFor(model => model.AmnesticMCIMultipleDomains) + + @Html.DisplayFor(model => model.AmnesticMCIMultipleDomains) 1 + CHECK YES for at least one additional domain (besides memory)
+ @Html.DisplayNameFor(model => model.AmnesticMCIMultipleDomainsLanguage) + + @Html.Raw(Model.AmnesticMCIMultipleDomainsLanguage == true ? "1 Yes" : (Model.AmnesticMCIMultipleDomainsLanguage == false ? "0 No" : "")) +
+ @Html.DisplayNameFor(model => model.AmnesticMCIMultipleDomainsAttention) + + @Html.Raw(Model.AmnesticMCIMultipleDomainsAttention == true ? "1 Yes" : (Model.AmnesticMCIMultipleDomainsAttention == false ? "0 No" : "")) +
+ @Html.DisplayNameFor(model => model.AmnesticMCIMultipleDomainsExecutive) + + @Html.Raw(Model.AmnesticMCIMultipleDomainsExecutive == true ? "1 Yes" : (Model.AmnesticMCIMultipleDomainsExecutive == false ? "0 No" : "")) +
+ @Html.DisplayNameFor(model => model.AmnesticMCIMultipleDomainsVisuospatial) + + @Html.Raw(Model.AmnesticMCIMultipleDomainsVisuospatial == true ? "1 Yes" : (Model.AmnesticMCIMultipleDomainsVisuospatial == false ? "0 No" : "")) +
+ @Html.DisplayNameFor(model => model.NonAmnesticMCISingleDomain) + + @Html.DisplayFor(model => model.NonAmnesticMCISingleDomain) 1 + CHECK YES to indicate the affected domain
+ @Html.DisplayNameFor(model => model.NonAmnesticMCISingleDomainLanguage) + + @Html.Raw(Model.NonAmnesticMCISingleDomainLanguage == true ? "1 Yes" : (Model.NonAmnesticMCISingleDomainLanguage == false ? "0 No" : "")) +
+ @Html.DisplayNameFor(model => model.NonAmnesticMCISingleDomainAttention) + + @Html.Raw(Model.NonAmnesticMCISingleDomainAttention == true ? "1 Yes" : (Model.NonAmnesticMCISingleDomainAttention == false ? "0 No" : "")) +
+ @Html.DisplayNameFor(model => model.NonAmnesticMCISingleDomainExecutive) + + @Html.Raw(Model.NonAmnesticMCISingleDomainExecutive == true ? "1 Yes" : (Model.NonAmnesticMCISingleDomainExecutive == false ? "0 No" : "")) +
+ @Html.DisplayNameFor(model => model.NonAmnesticMCISingleDomainVisuospatial) + + @Html.Raw(Model.NonAmnesticMCISingleDomainVisuospatial == true ? "1 Yes" : (Model.NonAmnesticMCISingleDomainVisuospatial == false ? "0 No" : "")) +
+ @Html.DisplayNameFor(model => model.NonAmnesticMCIMultipleDomains) + + @Html.DisplayFor(model => model.NonAmnesticMCIMultipleDomains) 1 + CHECK YES for at least two domains
+ @Html.DisplayNameFor(model => model.NonAmnesticMCIMultipleDomainsLanguage) + + @Html.Raw(Model.NonAmnesticMCIMultipleDomainsLanguage == true ? "1 Yes" : (Model.NonAmnesticMCIMultipleDomainsLanguage == false ? "0 No" : "")) +
+ @Html.DisplayNameFor(model => model.NonAmnesticMCIMultipleDomainsAttention) + + @Html.Raw(Model.NonAmnesticMCIMultipleDomainsAttention == true ? "1 Yes" : (Model.NonAmnesticMCIMultipleDomainsAttention == false ? "0 No" : "")) +
+ @Html.DisplayNameFor(model => model.NonAmnesticMCIMultipleDomainsExecutive) + + @Html.Raw(Model.NonAmnesticMCIMultipleDomainsExecutive == true ? "1 Yes" : (Model.NonAmnesticMCIMultipleDomainsExecutive == false ? "0 No" : "")) +
+ @Html.DisplayNameFor(model => model.NonAmnesticMCIMultipleDomainsVisuospatial) + + @Html.Raw(Model.NonAmnesticMCIMultipleDomainsVisuospatial == true ? "1 Yes" : (Model.NonAmnesticMCIMultipleDomainsVisuospatial == false ? "0 No" : "")) +
+ @Html.DisplayNameFor(model => model.CognitivelyImpairedNotMCIPresent) + + @Html.DisplayFor(model => model.CognitivelyImpairedNotMCIPresent) 1 +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +

+ Section 2: Biomarkers, imaging, and genetics +

+
Section 2 must be completed for all subjects.
Indicate neurodegenerative biomarker status, using local standards for positivity.
+ Biomarker findings + + No / Yes / Unknown / not assessed +
+ @Html.DisplayNameFor(model => model.AbnormallyElevatedAmyloidInPET) + + @{ + var abnormallyElevatedAmyloidInPETDisplay = ""; + if(Model.AbnormallyElevatedAmyloidInPET.HasValue) { + ViewBag.Findings.Codes.TryGetValue(Model.AbnormallyElevatedAmyloidInPET.Value.ToString(), out abnormallyElevatedAmyloidInPETDisplay); + } + } +

@Model.AbnormallyElevatedAmyloidInPET @abnormallyElevatedAmyloidInPETDisplay

+
+ @Html.DisplayNameFor(model => model.AbnormallyLowAmyloidInCSF) + + @{ + var abnormallyLowAmyloidInCSFDisplay = ""; + if(Model.AbnormallyLowAmyloidInCSF.HasValue) { + ViewBag.Findings.Codes.TryGetValue(Model.AbnormallyLowAmyloidInCSF.Value.ToString(), out abnormallyLowAmyloidInCSFDisplay); + } + } +

@Model.AbnormallyLowAmyloidInCSF @abnormallyLowAmyloidInCSFDisplay

+
+ @Html.DisplayNameFor(model => model.FDGPETPattern) + + @{ + var fDGPETPatternDisplay = ""; + if(Model.FDGPETPattern.HasValue) { + ViewBag.Findings.Codes.TryGetValue(Model.FDGPETPattern.Value.ToString(), out fDGPETPatternDisplay); + } + } +

@Model.FDGPETPattern @fDGPETPatternDisplay

+
+ @Html.DisplayNameFor(model => model.HippocampalAtrophy) + + @{ + var hippocampalAtrophyDisplay = ""; + if(Model.HippocampalAtrophy.HasValue) { + ViewBag.Findings.Codes.TryGetValue(Model.HippocampalAtrophy.Value.ToString(), out hippocampalAtrophyDisplay); + } + } +

@Model.HippocampalAtrophy @hippocampalAtrophyDisplay

+
+ @Html.DisplayNameFor(model => model.TauPETEvidenceForAD) + + @{ + var tauPETEvidenceForADDisplay = ""; + if(Model.TauPETEvidenceForAD.HasValue) { + ViewBag.Findings.Codes.TryGetValue(Model.TauPETEvidenceForAD.Value.ToString(), out tauPETEvidenceForADDisplay); + } + } +

@Model.TauPETEvidenceForAD @tauPETEvidenceForADDisplay

+
+ @Html.DisplayNameFor(model => model.AbnormallyElevatedCSFTauOrPtau) + + @{ + var abnormallyElevatedCSFTauOrPtauDisplay = ""; + if(Model.AbnormallyElevatedCSFTauOrPtau.HasValue) { + ViewBag.Findings.Codes.TryGetValue(Model.AbnormallyElevatedCSFTauOrPtau.Value.ToString(), out abnormallyElevatedCSFTauOrPtauDisplay); + } + } +

@Model.AbnormallyElevatedCSFTauOrPtau @abnormallyElevatedCSFTauOrPtauDisplay

+
+ @Html.DisplayNameFor(model => model.FDGPETEvidenceForFrontalOrAnteriorTemporalHypometabolism) + + @{ + var fDGPETEvidenceForFrontalOrAnteriorTemporalHypometabolismDisplay = ""; + if(Model.FDGPETEvidenceForFrontalOrAnteriorTemporalHypometabolism.HasValue) { + ViewBag.Findings.Codes.TryGetValue(Model.FDGPETEvidenceForFrontalOrAnteriorTemporalHypometabolism.Value.ToString(), out fDGPETEvidenceForFrontalOrAnteriorTemporalHypometabolismDisplay); + } + } +

@Model.FDGPETEvidenceForFrontalOrAnteriorTemporalHypometabolism @fDGPETEvidenceForFrontalOrAnteriorTemporalHypometabolismDisplay

+
+ @Html.DisplayNameFor(model => model.TauPETEvidence) + + @{ + var tauPETEvidenceDisplay = ""; + if(Model.TauPETEvidence.HasValue) { + ViewBag.Findings.Codes.TryGetValue(Model.TauPETEvidence.Value.ToString(), out tauPETEvidenceDisplay); + } + } +

@Model.TauPETEvidence @tauPETEvidenceDisplay

+
+ @Html.DisplayNameFor(model => model.StructuralMREvidence) + + @{ var structuralMREvidenceDisplay = ""; + if(Model.StructuralMREvidence.HasValue) { + ViewBag.Findings.Codes.TryGetValue(Model.StructuralMREvidence.Value.ToString(), out structuralMREvidenceDisplay); + } + } +

@Model.StructuralMREvidence @structuralMREvidenceDisplay

+
+ @Html.DisplayNameFor(model => model.DopamineTransporterScanEvidence) + + @{ var dopamineTransporterScanEvidenceDisplay = ""; + if(Model.DopamineTransporterScanEvidence.HasValue) { + ViewBag.Findings.Codes.TryGetValue(Model.DopamineTransporterScanEvidence.Value.ToString(), out dopamineTransporterScanEvidenceDisplay); + } + } +

@Model.DopamineTransporterScanEvidence @dopamineTransporterScanEvidenceDisplay

+
+
+ @Html.DisplayNameFor(model => model.OtherEvidenceExists) +
+
+
+ @Html.TextBoxFor(model => model.OtherEvidenceSpecified, new { @disabled = "true" }) +
+
+
+ @{ + var otherEvidenceExistsDisplay = ""; + if(Model.OtherEvidenceExists.HasValue) { + int otherEvidenceExists = Convert.ToInt32(Model.OtherEvidenceExists.Value); + ViewBag.Findings.Codes.TryGetValue(otherEvidenceExists.ToString(), out otherEvidenceExistsDisplay); + +

@otherEvidenceExists @otherEvidenceExistsDisplay

+ } + } +
Is there evidence for cerebrovascular disease (CVD) on imaging?
Imaging findingsNo / Yes / Unknown / not assessed
+ @Html.DisplayNameFor(model => model.LargeVesselInfarcts) + + @{ + var largeVesselInfarctsDisplay = ""; + if(Model.LargeVesselInfarcts.HasValue) { + ViewBag.Findings.Codes.TryGetValue(Model.LargeVesselInfarcts.Value.ToString(), out largeVesselInfarctsDisplay); + } + } +

@Model.LargeVesselInfarcts @largeVesselInfarctsDisplay

+
+ @Html.DisplayNameFor(model => model.LacunarInfarcts) + + @{ + var lacunarInfarctsDisplay = ""; + if(Model.LacunarInfarcts.HasValue) { + ViewBag.Findings.Codes.TryGetValue(Model.LacunarInfarcts.Value.ToString(), out lacunarInfarctsDisplay); + } + } +

@Model.LacunarInfarcts @lacunarInfarctsDisplay

+
+ @Html.DisplayNameFor(model => model.Macrohemorrhages) + + @{ + var macrohemorrhagesDisplay = ""; + if(Model.Macrohemorrhages.HasValue) { + ViewBag.Findings.Codes.TryGetValue(Model.Macrohemorrhages.Value.ToString(), out macrohemorrhagesDisplay); + } + } +

@Model.Macrohemorrhages @macrohemorrhagesDisplay

+
+ @Html.DisplayNameFor(model => model.Microhemorrhages) + + @{ + var microhemorrhagesDisplay = ""; + if(Model.Microhemorrhages.HasValue) { + ViewBag.Findings.Codes.TryGetValue(Model.Microhemorrhages.Value.ToString(), out microhemorrhagesDisplay); + } + } +

@Model.Microhemorrhages @microhemorrhagesDisplay

+
+ @Html.DisplayNameFor(model => model.ModerateWhiteMatterHyperintensity) + + @{ + var moderateWhiteMatterHyperintensityDisplay = ""; + if(Model.ModerateWhiteMatterHyperintensity.HasValue) { + ViewBag.Findings.Codes.TryGetValue(Model.ModerateWhiteMatterHyperintensity.Value.ToString(), out moderateWhiteMatterHyperintensityDisplay); + } + } +

@Model.ModerateWhiteMatterHyperintensity @moderateWhiteMatterHyperintensityDisplay

+
+ @Html.DisplayNameFor(model => model.ExtensiveWhiteMatterHyperintensity) + + @{ + var extensiveWhiteMatterHyperintensityDisplay = ""; + if(Model.ExtensiveWhiteMatterHyperintensity.HasValue) { + ViewBag.Findings.Codes.TryGetValue(Model.ExtensiveWhiteMatterHyperintensity.Value.ToString(), out extensiveWhiteMatterHyperintensityDisplay); + } + } +

@Model.ExtensiveWhiteMatterHyperintensity @extensiveWhiteMatterHyperintensityDisplay

+
+ @Html.DisplayNameFor(model => model.DominantlyInheritedADMutation) + + @{ + var dominantlyInheritedADMutationDisplay = ""; + if(Model.DominantlyInheritedADMutation.HasValue) { + ViewBag.FindingsSubs.Codes.TryGetValue(Model.DominantlyInheritedADMutation.Value.ToString(), out dominantlyInheritedADMutationDisplay); + } + } +

@Model.DominantlyInheritedADMutation @dominantlyInheritedADMutationDisplay

+
+ @Html.DisplayNameFor(model => model.HereditaryFTLDMutation) + + @{ + var hereditaryFTLDMutationDisplay = ""; + if(Model.HereditaryFTLDMutation.HasValue) { + ViewBag.FindingsSubs.Codes.TryGetValue(Model.HereditaryFTLDMutation.Value.ToString(), out hereditaryFTLDMutationDisplay); + } + } +

@Model.HereditaryFTLDMutation @hereditaryFTLDMutationDisplay

+
+
+ @Html.DisplayNameFor(model => model.HereditaryMutationOther) +
+
+ @Html.TextBoxFor(model => model.HereditaryMutationOtherSpecified, new { @disabled = "true" }) +
+
+ @{ + var hereditaryMutationOtherDisplay = ""; + if(Model.HereditaryMutationOther.HasValue) { + int hereditaryMutationOther = Convert.ToInt32(Model.HereditaryMutationOther.Value); + ViewBag.FindingsSubs.Codes.TryGetValue(hereditaryMutationOther.ToString(), out hereditaryMutationOtherDisplay); + +

@hereditaryMutationOther @hereditaryMutationOtherDisplay

+ } + } +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +

Section 3: Etiologic diagnoses

+
+

Section 3 must be completed for all subjects.

+
+

Indicate presumptive etiologic diagnoses of the cognitive disorder and whether a given diagnosis is a primary, contributing, or non-contributing cause of the observed impairment, based on the clinician's best judgment. Select one or more diagnoses as Present; all others will default to Absent in the NACC database. Only one diagnosis should be selected as 1=Primary.

+

For subjects with normal cognition: Indicate the presence of any diagnoses by marking Present, and leave the questions on whether the diagnosis was primary, contributing, or non-contributing blank. Subjects with positive biomarkers but no clinical symptoms of Alzheimer's disease, Lewy body disease, or frontotemporal lobar degeneration should not have these diagnoses marked as Present. Instead, the biomarker data from Section 2 can be used to identify the presence of preclinical disease.

+

+ +

+
Etiologic diagnosesPresentPrimary / Contributing / Non-contributing
+ @Html.DisplayNameFor(model => model.AlzheimersDiseasePresent) + + @Html.DisplayFor(model => model.AlzheimersDiseasePresent) 1 + + @{ var alzheimersDiseaseDiagnosisDisplay = ""; + if (Model.AlzheimersDiseaseDiagnosis.HasValue) + { + ViewBag.Etiologic.Codes.TryGetValue(Model.AlzheimersDiseaseDiagnosis.Value.ToString(), out alzheimersDiseaseDiagnosisDisplay); + } + } +
@Model.AlzheimersDiseaseDiagnosis @alzheimersDiseaseDiagnosisDisplay
+
+ @Html.DisplayNameFor(model => model.LewyBodyDiseasePresent) + @Html.DisplayFor(model => model.LewyBodyDiseasePresent) 1 + @{ var lewyBodyDiseaseDiagnosisDisplay = ""; + if (Model.LewyBodyDiseaseDiagnosis.HasValue) + { + ViewBag.Etiologic.Codes.TryGetValue(Model.LewyBodyDiseaseDiagnosis.Value.ToString(), out lewyBodyDiseaseDiagnosisDisplay); + } + } +
@Model.LewyBodyDiseaseDiagnosis @lewyBodyDiseaseDiagnosisDisplay
+
+
@Html.DisplayNameFor(model => model.ParkinsonsDiseasePresent)
+
+ @Html.DisplayFor(model => model.ParkinsonsDiseasePresent) 1 +
+ @Html.DisplayNameFor(model => model.MultipleSystemAtrophyPresent) + + @Html.DisplayFor(model => model.MultipleSystemAtrophyPresent) 1 + + @{ var multipleSystemAtrophyDiagnosisDisplay = ""; + if (Model.MultipleSystemAtrophyDiagnosis.HasValue) + { + ViewBag.Etiologic.Codes.TryGetValue(Model.MultipleSystemAtrophyDiagnosis.Value.ToString(), out multipleSystemAtrophyDiagnosisDisplay); + } + } +
@Model.MultipleSystemAtrophyDiagnosis @multipleSystemAtrophyDiagnosisDisplay
+
Frontotemporal lobar degeneration
+
@Html.DisplayNameFor(model => model.ProgressiveSupranuclearPaslyPresent)
+
+ @Html.DisplayFor(model => model.ProgressiveSupranuclearPaslyPresent) 1 + + @{ + var progressiveSupranuclearPaslyDiagnosisDisplay = ""; + if (Model.ProgressiveSupranuclearPaslyDiagnosis.HasValue) + { + ViewBag.Etiologic.Codes.TryGetValue(Model.ProgressiveSupranuclearPaslyDiagnosis.Value.ToString(), out progressiveSupranuclearPaslyDiagnosisDisplay); + } + } +
@Model.ProgressiveSupranuclearPaslyDiagnosis @progressiveSupranuclearPaslyDiagnosisDisplay
+
+
@Html.DisplayNameFor(model => model.CorticobasalDegenerationPresent)
+
+ @Html.DisplayFor(model => model.CorticobasalDegenerationPresent) 1 + + @{ + var corticobasalDegenerationDiagnosisDisplay = ""; + if (Model.CorticobasalDegenerationDiagnosis.HasValue) + { + ViewBag.Etiologic.Codes.TryGetValue(Model.CorticobasalDegenerationDiagnosis.Value.ToString(), out corticobasalDegenerationDiagnosisDisplay); + } + } +
@Model.CorticobasalDegenerationDiagnosis @corticobasalDegenerationDiagnosisDisplay
+
+
@Html.DisplayNameFor(model => model.FTLDWithMotorNeuronDiseasePresent)
+
+ @Html.DisplayFor(model => model.FTLDWithMotorNeuronDiseasePresent) 1 + + @{ + var fTLDWithMotorNeuronDiseaseDiagnosisDisplay = ""; + if (Model.FTLDWithMotorNeuronDiseaseDiagnosis.HasValue) + { + ViewBag.Etiologic.Codes.TryGetValue(Model.FTLDWithMotorNeuronDiseaseDiagnosis.Value.ToString(), out fTLDWithMotorNeuronDiseaseDiagnosisDisplay); + } + } +
@Model.FTLDWithMotorNeuronDiseaseDiagnosis @fTLDWithMotorNeuronDiseaseDiagnosisDisplay
+
+
@Html.DisplayNameFor(model => model.FTLDNOSPresent)
+
+ @Html.DisplayFor(model => model.FTLDNOSPresent) 1 + + @{ + var fTLDNOSDiagnosisDisplay = ""; + if (Model.FTLDNOSDiagnosis.HasValue) + { + ViewBag.Etiologic.Codes.TryGetValue(Model.FTLDNOSDiagnosis.Value.ToString(), out fTLDNOSDiagnosisDisplay); + } + } +
@Model.FTLDNOSDiagnosis @fTLDNOSDiagnosisDisplay
+
+ @Html.DisplayNameFor(model => model.FTLDSubtype) + + @{ + var fTLDSubtypeDisplay = ""; + if(Model.FTLDSubtype.HasValue) { + ViewBag.FTLDSubtype.Codes.TryGetValue(Model.FTLDSubtype.ToString(), out fTLDSubtypeDisplay); + } +
@Model.FTLDSubtype@fTLDSubtypeDisplay
+ @if(Model.FTLDSubtype == 3) { + @Html.TextBoxFor(model => model.FTLDSubtypeOtherSpecified, new { @disabled = "true" }) + } + } +
+ @Html.DisplayNameFor(model => model.VascularBrainInjuryPresent) + + @Html.DisplayFor(model => model.VascularBrainInjuryPresent) 1 + + @{ + var vascularBrainInjuryDiagnosisDisplay = ""; + if (Model.VascularBrainInjuryDiagnosis.HasValue) + { + ViewBag.Etiologic.Codes.TryGetValue(Model.VascularBrainInjuryDiagnosis.Value.ToString(), out vascularBrainInjuryDiagnosisDisplay); + } + } +
@Model.VascularBrainInjuryDiagnosis @vascularBrainInjuryDiagnosisDisplay
+
+ + + + + + + + + + + + + + + + +
+ @Html.DisplayNameFor(model => model.PreviousSymptomaticStroke) + + @{ var PreviousSymptomaticStrokeDisplay = Model.PreviousSymptomaticStroke; } + @Html.Raw(PreviousSymptomaticStrokeDisplay == true ? "1 Yes" : (PreviousSymptomaticStrokeDisplay == false ? "0 No (SKIP TO QUESTION 15c)" : "")) +
+ + + + + + + + + +
+ @Html.DisplayNameFor(model => model.TemporalRelationshipBetweenStrokeAndCognitive) + + @{ var temporalRelationshipBetweenStrokeAndCognitiveDisplay = Model.TemporalRelationshipBetweenStrokeAndCognitive; } + @Html.Raw(temporalRelationshipBetweenStrokeAndCognitiveDisplay == true ? "1 Yes" : (temporalRelationshipBetweenStrokeAndCognitiveDisplay == false ? "0 No" : "")) +
+ @Html.DisplayNameFor(model => model.ConfirmationOfStrokeByNeuroImaging) + + @{ + var confirmationOfStrokeByNeuroImagingDisplay = ""; + if (Model.ConfirmationOfStrokeByNeuroImaging.HasValue) + { + ViewBag.Etiologicsubs.Codes.TryGetValue(Model.ConfirmationOfStrokeByNeuroImaging.Value.ToString(), out confirmationOfStrokeByNeuroImagingDisplay); + } +
@Model.ConfirmationOfStrokeByNeuroImaging @confirmationOfStrokeByNeuroImagingDisplay
+ } +
+
+ @Html.DisplayNameFor(model => model.ImagingEvidenceOfCysticInfarctionInCognitiveNetwork) + + @{ + var imagingEvidenceOfCysticInfarctionInCognitiveNetworkDisplay = ""; + if(Model.ImagingEvidenceOfCysticInfarctionInCognitiveNetwork.HasValue) { + ViewBag.Etiologicsubs.Codes.TryGetValue(Model.ImagingEvidenceOfCysticInfarctionInCognitiveNetwork.Value.ToString(), out imagingEvidenceOfCysticInfarctionInCognitiveNetworkDisplay); + } +
@Model.ImagingEvidenceOfCysticInfarctionInCognitiveNetwork @imagingEvidenceOfCysticInfarctionInCognitiveNetworkDisplay
+ } +
+ @Html.DisplayNameFor(model => model.ImagingEvidenceOfCysticInfarctionExtensiveWhiteMatterHyperintensistyAndExecutiveImpairment) + + @{ + var imagingEvidenceOfCysticInfarctionExtensiveWhiteMatterHyperintensistyAndExecutiveImpairmentDisplay = ""; + if(Model.ImagingEvidenceOfCysticInfarctionExtensiveWhiteMatterHyperintensistyAndExecutiveImpairment.HasValue) { + ViewBag.Etiologicsubs.Codes.TryGetValue(Model.ImagingEvidenceOfCysticInfarctionExtensiveWhiteMatterHyperintensistyAndExecutiveImpairment.ToString(), out imagingEvidenceOfCysticInfarctionExtensiveWhiteMatterHyperintensistyAndExecutiveImpairmentDisplay); + } +
@Model.ImagingEvidenceOfCysticInfarctionExtensiveWhiteMatterHyperintensistyAndExecutiveImpairment @imagingEvidenceOfCysticInfarctionExtensiveWhiteMatterHyperintensistyAndExecutiveImpairmentDisplay
+ } +
+
+ @Html.DisplayNameFor(model => model.EssentialTremorPresent) + + @Html.DisplayFor(model => model.EssentialTremorPresent) 1 + + @{ + var essentialTremorDiagnosisDisplay = ""; + if(Model.EssentialTremorDiagnosis.HasValue) { + ViewBag.Etiologic.Codes.TryGetValue(Model.EssentialTremorDiagnosis.ToString(), out essentialTremorDiagnosisDisplay); + } +
@Model.EssentialTremorDiagnosis @essentialTremorDiagnosisDisplay
+ } +
+ @Html.DisplayNameFor(model => model.DownSyndromePresent) + + @Html.DisplayFor(model => model.DownSyndromePresent) 1 + + @{ + var downSyndromeDiagnosisDisplay = ""; + if(Model.DownSyndromeDiagnosis.HasValue) { + ViewBag.Etiologic.Codes.TryGetValue(Model.DownSyndromeDiagnosis.ToString(), out downSyndromeDiagnosisDisplay); + } +
@Model.DownSyndromeDiagnosis @downSyndromeDiagnosisDisplay
+ } +
+ @Html.DisplayNameFor(model => model.HuntingtonsDiseasePresent) + + @Html.DisplayFor(model => model.HuntingtonsDiseasePresent) 1 + + @{ + var huntingtonsDiseaseDiagnosisDisplay = ""; + if(Model.HuntingtonsDiseaseDiagnosis.HasValue) { + ViewBag.Etiologic.Codes.TryGetValue(Model.HuntingtonsDiseaseDiagnosis.ToString(), out huntingtonsDiseaseDiagnosisDisplay); + } +
@Model.HuntingtonsDiseaseDiagnosis @huntingtonsDiseaseDiagnosisDisplay
+ } +
+ @Html.DisplayNameFor(model => model.PrionDiseasePresent) + + @Html.DisplayFor(model => model.PrionDiseasePresent) 1 + + @{ + var prionDiseaseDiagnosisDisplay = ""; + if(Model.PrionDiseaseDiagnosis.HasValue) { + ViewBag.Etiologic.Codes.TryGetValue(Model.PrionDiseaseDiagnosis.ToString(), out prionDiseaseDiagnosisDisplay); + } +
@Model.PrionDiseaseDiagnosis @prionDiseaseDiagnosisDisplay
+ } +
+ @Html.DisplayNameFor(model => model.TraumaticBrainInjuryPresent) + + @Html.DisplayFor(model => model.TraumaticBrainInjuryPresent) 1 + + @{ + var traumaticBrainInjuryDiagnosisDisplay = ""; + if(Model.TraumaticBrainInjuryDiagnosis.HasValue) { + ViewBag.Etiologic.Codes.TryGetValue(Model.TraumaticBrainInjuryDiagnosis.ToString(), out traumaticBrainInjuryDiagnosisDisplay); + } +
@Model.TraumaticBrainInjuryDiagnosis @traumaticBrainInjuryDiagnosisDisplay
+ } +
+ + + + + + + +
+ @Html.DisplayNameFor(model => model.ChronicTraumaticEncephalopathySymptom) + + @{ + var chronicTraumaticEncephalopathySymptomDisplay = ""; + if(Model.ChronicTraumaticEncephalopathySymptom.HasValue) { + ViewBag.GeneralThreeGroup.Codes.TryGetValue(Model.ChronicTraumaticEncephalopathySymptom.ToString(), out chronicTraumaticEncephalopathySymptomDisplay); + } +
@Model.ChronicTraumaticEncephalopathySymptom @chronicTraumaticEncephalopathySymptomDisplay
+ } +
+
+ @Html.DisplayNameFor(model => model.NormalPressureHydrocephalusPresent) + + @Html.DisplayFor(model => model.NormalPressureHydrocephalusPresent) 1 + + @{ + var normalPressureHydropcephalusDiagnosisDisplay = ""; + if(Model.NormalPressureHydropcephalusDiagnosis.HasValue) { + ViewBag.Etiologic.Codes.TryGetValue(Model.NormalPressureHydropcephalusDiagnosis.ToString(), out normalPressureHydropcephalusDiagnosisDisplay); + } +
@Model.NormalPressureHydropcephalusDiagnosis @normalPressureHydropcephalusDiagnosisDisplay
+ } +
+ @Html.DisplayNameFor(model => model.EpilepsyPresent) + + @Html.DisplayFor(model => model.EpilepsyPresent) 1 + + @{ + var epilepsyDiagnosisDisplay = ""; + if(Model.EpilepsyDiagnosis.HasValue) { + ViewBag.Etiologic.Codes.TryGetValue(Model.EpilepsyDiagnosis.ToString(), out epilepsyDiagnosisDisplay); + } +
@Model.EpilepsyDiagnosis @epilepsyDiagnosisDisplay
+ } +
+ @Html.DisplayNameFor(model => model.CNSNeoplasmPresent) + + @Html.DisplayFor(model => model.CNSNeoplasmPresent) 1 + + @{ + var cNSNeoplasmDiagnosisDisplay = ""; + if(Model.CNSNeoplasmDiagnosis.HasValue) { + ViewBag.Etiologic.Codes.TryGetValue(Model.CNSNeoplasmDiagnosis.ToString(), out cNSNeoplasmDiagnosisDisplay); + } +
@Model.CNSNeoplasmDiagnosis @cNSNeoplasmDiagnosisDisplay
+ } +
+ + + + + + + +
+ + + @{ + var cNSNeoplasmTypeDisplay = ""; + if(Model.CNSNeoplasmType.HasValue) { + ViewBag.Cnsneoplasmtype.Codes.TryGetValue(Model.CNSNeoplasmType.ToString(), out cNSNeoplasmTypeDisplay); +
@Model.CNSNeoplasmType @cNSNeoplasmTypeDisplay
+ } + } +
+
+ @Html.DisplayNameFor(model => model.HumanImmunodeficiencyVirusPresent) + + @Html.DisplayFor(model => model.HumanImmunodeficiencyVirusPresent) 1 + + @{ + var humanImmunodeficiencyVirusDiagnosisDisplay = ""; + if(Model.HumanImmunodeficiencyVirusDiagnosis.HasValue) { + ViewBag.Etiologic.Codes.TryGetValue(Model.HumanImmunodeficiencyVirusDiagnosis.ToString(), out humanImmunodeficiencyVirusDiagnosisDisplay); + } +
@Model.HumanImmunodeficiencyVirusDiagnosis @humanImmunodeficiencyVirusDiagnosisDisplay
+ } +
+ @Html.DisplayNameFor(model => model.OtherCognitiveImpairmentPresent) + + @Html.DisplayFor(model => model.OtherCognitiveImpairmentPresent) 1 + + @{ + var otherCognitiveImpairmentDiagnosisDisplay = ""; + if(Model.OtherCognitiveImpairmentDiagnosis.HasValue) { + ViewBag.Etiologic.Codes.TryGetValue(Model.OtherCognitiveImpairmentDiagnosis.ToString(), out otherCognitiveImpairmentDiagnosisDisplay); + } +
@Model.OtherCognitiveImpairmentDiagnosis @otherCognitiveImpairmentDiagnosisDisplay
+ } +
+ + + + + + + +
+ @Html.DisplayNameFor(model => model.OtherCognitiveImpairmentSpecified) + + @Html.TextBoxFor(model => model.OtherCognitiveImpairmentSpecified, new { @disabled = "true" }) +
+
+ @Html.DisplayNameFor(model => model.ActiveDepressionPresent) + + @Html.DisplayFor(model => model.ActiveDepressionPresent) 1 + + @{ + var activeDepressionDiagnosisDisplay = ""; + if(Model.ActiveDepressionDiagnosis.HasValue) { + ViewBag.Etiologic.Codes.TryGetValue(Model.ActiveDepressionDiagnosis.ToString(), out activeDepressionDiagnosisDisplay); + } +
@Model.ActiveDepressionDiagnosis @activeDepressionDiagnosisDisplay
+ } +
+ + + + + +
+ @Html.DisplayNameFor(model => model.ActiveDepressionTreatment) + + @{ + var activeDepressionTreatmentDisplay = ""; + if(Model.ActiveDepressionTreatment.HasValue) { + if(Model.ActiveDepressionTreatment == true) { + activeDepressionTreatmentDisplay = "1 Treated with medication and/or counseling"; + } else { + activeDepressionTreatmentDisplay = "0 Untreated"; + } + } + } + @Html.Raw(activeDepressionTreatmentDisplay) +
+
+ @Html.DisplayNameFor(model => model.BipolarDisorderPresent) + + @Html.DisplayFor(model => model.BipolarDisorderPresent) 1 + + @{ + var bipolarDisorderDiagnosisDisplay = ""; + if(Model.BipolarDisorderDiagnosis.HasValue) { + ViewBag.Etiologic.Codes.TryGetValue(Model.BipolarDisorderDiagnosis.ToString(), out bipolarDisorderDiagnosisDisplay); + } +
@Model.BipolarDisorderDiagnosis @bipolarDisorderDiagnosisDisplay
+ } +
+ @Html.DisplayNameFor(model => model.SchizophreniaPresent) + + @Html.DisplayFor(model => model.SchizophreniaPresent) 1 + + @{ + var schizophreniaDiagnosisDisplay = ""; + if(Model.SchizophreniaDiagnosis.HasValue) { + ViewBag.Etiologic.Codes.TryGetValue(Model.SchizophreniaDiagnosis.ToString(), out schizophreniaDiagnosisDisplay); + } +
@Model.SchizophreniaDiagnosis @schizophreniaDiagnosisDisplay
+ } +
+ @Html.DisplayNameFor(model => model.AnxietyDisorderPresent) + + @Html.DisplayFor(model => model.AnxietyDisorderPresent) 1 + + @{ + var anxietyDiagnosisDisplay = ""; + if(Model.AnxietyDiagnosis.HasValue) { + ViewBag.Etiologic.Codes.TryGetValue(Model.AnxietyDiagnosis.ToString(), out anxietyDiagnosisDisplay); + } +
@Model.AnxietyDiagnosis @anxietyDiagnosisDisplay
+ } +
+ @Html.DisplayNameFor(model => model.DeliriumPresent) + + @Html.DisplayFor(model => model.DeliriumPresent) 1 + + @{ + var deliriumDiagnosisDisplay = ""; + if(Model.DeliriumDiagnosis.HasValue) { + ViewBag.Etiologic.Codes.TryGetValue(Model.DeliriumDiagnosis.ToString(), out deliriumDiagnosisDisplay); + } +
@Model.DeliriumDiagnosis @deliriumDiagnosisDisplay
+ } +
+ @Html.DisplayNameFor(model => model.PostTraumaticStressDisorderPresent) + + @Html.DisplayFor(model => model.PostTraumaticStressDisorderPresent) 1 + + @{ + var postTraumaticStressDisorderDiagnosisDisplay = ""; + if(Model.PostTraumaticStressDisorderDiagnosis.HasValue) { + ViewBag.Etiologic.Codes.TryGetValue(Model.PostTraumaticStressDisorderDiagnosis.ToString(), out postTraumaticStressDisorderDiagnosisDisplay); + } +
@Model.PostTraumaticStressDisorderDiagnosis @postTraumaticStressDisorderDiagnosisDisplay
+ } +
+ @Html.DisplayNameFor(model => model.OtherPsychiatricDiseasePresent) + + @Html.DisplayFor(model => model.OtherPsychiatricDiseasePresent) 1 + + @{ + var otherPsychiatricDiseaseDiagnosisDisplay = ""; + if(Model.OtherPsychiatricDiseaseDiagnosis.HasValue) { + ViewBag.Etiologic.Codes.TryGetValue(Model.OtherPsychiatricDiseaseDiagnosis.ToString(), out otherPsychiatricDiseaseDiagnosisDisplay); + } +
@Model.OtherPsychiatricDiseaseDiagnosis @otherPsychiatricDiseaseDiagnosisDisplay
+ } +
+ + + + + + + +
+ @Html.DisplayNameFor(model => model.OtherPsychiatricDiseaseSpecified) + + @Html.DisplayFor(model => model.OtherPsychiatricDiseaseSpecified) +
+
+ @Html.DisplayNameFor(model => model.AlcoholAbuse) + + @Html.DisplayFor(model => model.AlcoholAbuse) 1 + + @{ + var alcoholAbuseDiagnosisDisplay = ""; + if(Model.AlcoholAbuseDiagnosis.HasValue) { + ViewBag.Etiologic.Codes.TryGetValue(Model.AlcoholAbuseDiagnosis.ToString(), out alcoholAbuseDiagnosisDisplay); + } +
@Model.AlcoholAbuseDiagnosis @alcoholAbuseDiagnosisDisplay
+ } +
+ + + + + + + +
+ @Html.DisplayNameFor(model => model.CurrentAlcoholAbuse) + + @{ + var currentAlcoholAbuseDisplay = ""; + if(Model.CurrentAlcoholAbuse.HasValue) { + ViewBag.GeneralThreeGroup.Codes.TryGetValue(Model.CurrentAlcoholAbuse.ToString(), out currentAlcoholAbuseDisplay); + } +
@Model.CurrentAlcoholAbuse @currentAlcoholAbuseDisplay
+ } +
+
+ @Html.DisplayNameFor(model => model.SubstanceAbuse) + + @Html.DisplayFor(model => model.SubstanceAbuse) 1 + + @{ + var substanceAbuseDiagnosisDislpay = ""; + if(Model.SubstanceAbuseDiagnosis.HasValue) { + ViewBag.Etiologic.Codes.TryGetValue(Model.SubstanceAbuseDiagnosis.ToString(), out substanceAbuseDiagnosisDislpay); + } +
@Model.SubstanceAbuseDiagnosis @substanceAbuseDiagnosisDislpay
+ } +
+ @Html.DisplayNameFor(model => model.SystemicDisease) + + @Html.DisplayFor(model => model.SystemicDisease) 1 + + @{ + var systemicDiseaseDiagnosisDisplay = ""; + if(Model.SystemicDiseaseDiagnosis.HasValue) { + ViewBag.Etiologic.Codes.TryGetValue(Model.SystemicDiseaseDiagnosis.ToString(), out systemicDiseaseDiagnosisDisplay); + } +
@Model.SystemicDiseaseDiagnosis @systemicDiseaseDiagnosisDisplay
+ } +
+ @Html.DisplayNameFor(model => model.Medications) + + @Html.DisplayFor(model => model.Medications) 1 + + @{ + var medicationsDiagnosisDisplay = ""; + if(Model.MedicationsDiagnosis.HasValue) { + ViewBag.Etiologic.Codes.TryGetValue(Model.MedicationsDiagnosis.ToString(), out medicationsDiagnosisDisplay); + } +
@Model.MedicationsDiagnosis @medicationsDiagnosisDisplay
+ } +
+ @Html.DisplayNameFor(model => model.NOS1) + + @Html.DisplayFor(model => model.NOS1) 1 + + @{ + var nOS1DiagnosisDisplay = ""; + if(Model.NOS1Diagnosis.HasValue) { + ViewBag.Etiologic.Codes.TryGetValue(Model.NOS1Diagnosis.ToString(), out nOS1DiagnosisDisplay); + } +
@Model.NOS1Diagnosis @nOS1DiagnosisDisplay
+ } +
+ + + + + + + +
+ @Html.DisplayNameFor(model => model.NOS1Specified) + + @Html.DisplayFor(model => model.NOS1Specified) +
+
+ @Html.DisplayNameFor(model => model.NOS2) + + @Html.DisplayFor(model => model.NOS2) 1 + + @{ + var nOS2DiagnosisDisplay = ""; + if(Model.NOS2Diagnosis.HasValue) { + ViewBag.Etiologic.Codes.TryGetValue(Model.NOS2Diagnosis.ToString(), out nOS2DiagnosisDisplay); + } +
@Model.NOS2Diagnosis @nOS2DiagnosisDisplay
+ } +
+ + + + + + + +
+ @Html.DisplayNameFor(model => model.NOS2Specified) + + @Html.DisplayFor(model => model.NOS2Specified) +
+
+ @Html.DisplayNameFor(model => model.NOS3) + + @Html.DisplayFor(model => model.NOS3) 1 + + @{ + var nOS3DiagnosisDisplay = ""; + if(Model.NOS3Diagnosis.HasValue) { + ViewBag.Etiologic.Codes.TryGetValue(Model.NOS3Diagnosis.ToString(), out nOS3DiagnosisDisplay); + } +
@Model.NOS3Diagnosis @nOS3DiagnosisDisplay
+ } +
+ + + + + + + +
+ @Html.DisplayNameFor(model => model.NOS3Specified) + + @Html.DisplayFor(model => model.NOS3Specified) +
+
+
+
Edit | Back to List diff --git a/src/UDS.Net.Web/Views/ClinicianDiagnosis/Edit.cshtml b/src/UDS.Net.Web/Views/ClinicianDiagnosis/Edit.cshtml index 99f01ef..ed3e715 100644 --- a/src/UDS.Net.Web/Views/ClinicianDiagnosis/Edit.cshtml +++ b/src/UDS.Net.Web/Views/ClinicianDiagnosis/Edit.cshtml @@ -1,12 +1,12 @@ @model ClinicianDiagnosis @{ - var title = "D1 Clinician Diagnosis"; - var visitInfo = ""; - if (visitInfo == null) - { - visitInfo = " - " + Model.Visit.Participant.Id + " - Visit " + Model.Visit.VisitNumber; - } + var title = "D1 Clinician Diagnosis"; + var visitInfo = ""; + if (visitInfo == null) + { + visitInfo = " - " + Model.Visit.Participant.Id + " - Visit " + Model.Visit.VisitNumber; + } ViewData["Title"] = title + visitInfo; } @@ -1776,7 +1776,6 @@
-
@@ -2132,7 +2131,7 @@
- 38b. + 39b.
From 121498a3c059cee028e3a1080126d0dceed8bf88 Mon Sep 17 00:00:00 2001 From: mlan225 <17088502+mlan225@users.noreply.github.com> Date: Fri, 17 Jun 2022 15:36:39 -0400 Subject: [PATCH 04/30] Apply an additional validation check to primaryDx value of 999 When primary dx is 999 then method of evaluation cannot be 1, 2, or 3 --- .../Controllers/SubjectFamilyHistoryController.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/UDS.Net.Web/Controllers/SubjectFamilyHistoryController.cs b/src/UDS.Net.Web/Controllers/SubjectFamilyHistoryController.cs index 3352c10..75b9b55 100644 --- a/src/UDS.Net.Web/Controllers/SubjectFamilyHistoryController.cs +++ b/src/UDS.Net.Web/Controllers/SubjectFamilyHistoryController.cs @@ -229,6 +229,14 @@ public async Task Edit(int id, SubjectFamilyHistory subjectFamily { ModelState.AddModelError(String.Format("Relatives[{0}].MethodOfEvaluation", relativeIndex), "Please enter a valid code"); } + + if(relative.PrimaryDx.HasValue && relative.PrimaryDx.Value == 999) { + int[] invalidMethodsOfEvaluation = {1,2,3}; + + if(Array.Exists(invalidMethodsOfEvaluation, method => method == relative.MethodOfEvaluation.Value)) { + ModelState.AddModelError(String.Format("Relatives[{0}].MethodOfEvaluation", relativeIndex), "If Primary Dx is 999, the method of evaluation cannot be 1, 2, or 3"); + } + } } bool hasNeurologicalProblemPsycyiatricCondition = relative.PrimaryNeurologicalProblemPsychiatricCondition.HasValue && relative.PrimaryNeurologicalProblemPsychiatricCondition.Value != 8 && relative.PrimaryNeurologicalProblemPsychiatricCondition.Value != 9; From e8b0892646e7543cc1d3fe005a0bb5c6a13de0b0 Mon Sep 17 00:00:00 2001 From: Ashley Wilson Date: Tue, 19 Jul 2022 23:38:29 -0400 Subject: [PATCH 05/30] Fixes conditional logic and validation for sub-questions in section 3 when normal cognitive state --- .../Entities/D1_ClinicianDiagnosis.cs | 32 +++++++++--------- .../Views/ClinicianDiagnosis/Edit.cshtml | 22 ++++++------- .../wwwroot/js/ClinicianDiagnosis/Edit.js | 33 +++++++++++++++++-- 3 files changed, 57 insertions(+), 30 deletions(-) diff --git a/src/UDS.Net.Data/Entities/D1_ClinicianDiagnosis.cs b/src/UDS.Net.Data/Entities/D1_ClinicianDiagnosis.cs index 14998aa..be78e29 100644 --- a/src/UDS.Net.Data/Entities/D1_ClinicianDiagnosis.cs +++ b/src/UDS.Net.Data/Entities/D1_ClinicianDiagnosis.cs @@ -637,10 +637,10 @@ public bool? OnlyOnePrimaryDiagnosisAllowed { public int? FTLDNOSDiagnosis { get; set; } [Display(Name = "If FTLD (Questions 14a – 14d) is Present, specify FTLD subtype")] - [RequiredIf(nameof(ProgressiveSupranuclearPaslyPresent), "1", ErrorMessage = "Please indicate FTLD subtype")] - [RequiredIf(nameof(CorticobasalDegenerationPresent), "1", ErrorMessage = "Please indicate FTLD subtype")] - [RequiredIf(nameof(FTLDWithMotorNeuronDiseasePresent), "1", ErrorMessage = "Please indicate FTLD subtype")] - [RequiredIf(nameof(FTLDNOSPresent), "1", ErrorMessage = "Please indicate FTLD subtype")] + [RequiredIf(nameof(ProgressiveSupranuclearPaslyPresent), true, ErrorMessage = "Please indicate FTLD subtype")] + [RequiredIf(nameof(CorticobasalDegenerationPresent), true, ErrorMessage = "Please indicate FTLD subtype")] + [RequiredIf(nameof(FTLDWithMotorNeuronDiseasePresent), true, ErrorMessage = "Please indicate FTLD subtype")] + [RequiredIf(nameof(FTLDNOSPresent), true, ErrorMessage = "Please indicate FTLD subtype")] [Column("FTLDSUBT")] public int? FTLDSubtype { get; set; } @@ -658,7 +658,7 @@ public bool? OnlyOnePrimaryDiagnosisAllowed { [Column("CVDIF")] public int? VascularBrainInjuryDiagnosis { get; set; } - [RequiredIf(nameof(VascularBrainInjuryPresent), "1", ErrorMessage = "Please indicate")] + [RequiredIf(nameof(VascularBrainInjuryPresent), true, ErrorMessage = "Please indicate")] [Display(Name = "Previous symptomatic stroke?")] [Column("PREVSTK")] public bool? PreviousSymptomaticStroke { get; set; } @@ -673,12 +673,12 @@ public bool? OnlyOnePrimaryDiagnosisAllowed { [Column("STKIMAG")] public int? ConfirmationOfStrokeByNeuroImaging { get; set; } - [RequiredIf(nameof(VascularBrainInjuryPresent), "1", ErrorMessage = "Please indicate")] + [RequiredIf(nameof(VascularBrainInjuryPresent), true, ErrorMessage = "Please indicate")] [Display(Name = "Is there imaging evidence of cystic infarction in cognitive network(s)?")] [Column("INFNETW")] public int? ImagingEvidenceOfCysticInfarctionInCognitiveNetwork { get; set; } - [RequiredIf(nameof(VascularBrainInjuryPresent), "1", ErrorMessage = "Please indicate")] + [RequiredIf(nameof(VascularBrainInjuryPresent), true, ErrorMessage = "Please indicate")] [Display(Name = "Is there imaging evidence of cystic infarction, imaging evidence of extensive white matter hyperintensity (CHS grade 7–8+), and impairment in executive function?")] [Column("INFWMH")] public int? ImagingEvidenceOfCysticInfarctionExtensiveWhiteMatterHyperintensistyAndExecutiveImpairment { get; set; } @@ -723,7 +723,7 @@ public bool? OnlyOnePrimaryDiagnosisAllowed { [Column("BRNINJIF")] public int? TraumaticBrainInjuryDiagnosis { get; set; } - [RequiredIf(nameof(TraumaticBrainInjuryPresent), "1", ErrorMessage = "Please indicate")] + [RequiredIf(nameof(TraumaticBrainInjuryPresent), true, ErrorMessage = "Please indicate")] [Display(Name = "If Present, does the subject have symptoms consistent with chronic traumatic encephalopathy?")] [Column("BRNINCTE")] public int? ChronicTraumaticEncephalopathySymptom { get; set; } @@ -752,7 +752,7 @@ public bool? OnlyOnePrimaryDiagnosisAllowed { [Column("NEOPIF")] public int? CNSNeoplasmDiagnosis { get; set; } - [RequiredIf(nameof(CNSNeoplasmPresent), "1", ErrorMessage = "Please indicate")] + [RequiredIf(nameof(CNSNeoplasmPresent), true, ErrorMessage = "Please indicate")] [Column("NEOPSTAT")] public int? CNSNeoplasmType { get; set; } @@ -776,7 +776,7 @@ public bool? OnlyOnePrimaryDiagnosisAllowed { /// Any text or numbers with the exception of single quotes (‘), double quotes (“), ampersands (&), and percentage signs(%). /// [Display(Name = "If Present, specify")] - [RequiredIf(nameof(OtherCognitiveImpairmentPresent), "1", ErrorMessage = "Please indicate")] + [RequiredIf(nameof(OtherCognitiveImpairmentPresent), true, ErrorMessage = "Please indicate")] [Column("OTHCOGX")] [MaxLength(60)] public string OtherCognitiveImpairmentSpecified { get; set; } @@ -797,7 +797,7 @@ public bool? OnlyOnePrimaryDiagnosisAllowed { /// 0 Untreated /// 1 Treated with medication and/or counseling /// - [RequiredIf(nameof(ActiveDepressionPresent), "1", ErrorMessage = "Please indicate")] + [RequiredIf(nameof(ActiveDepressionPresent), true, ErrorMessage = "Please indicate")] [Display(Name = "If Present, select one")] [Column("DEPTREAT")] public bool? ActiveDepressionTreatment { get; set; } @@ -850,7 +850,7 @@ public bool? OnlyOnePrimaryDiagnosisAllowed { [Column("OTHPSYIF")] public int? OtherPsychiatricDiseaseDiagnosis { get; set; } - [RequiredIf(nameof(OtherPsychiatricDiseasePresent), "1", ErrorMessage = "Please indicate")] + [RequiredIf(nameof(OtherPsychiatricDiseasePresent), true, ErrorMessage = "Please indicate")] [Display(Name = "If Present, specify")] [Column("OTHPSYX")] [MaxLength(60)] @@ -864,7 +864,7 @@ public bool? OnlyOnePrimaryDiagnosisAllowed { [Column("ALCDEMIF")] public int? AlcoholAbuseDiagnosis { get; set; } - [RequiredIf(nameof(AlcoholAbuse), "1", ErrorMessage = "Please indicate")] + [RequiredIf(nameof(AlcoholAbuse), true, ErrorMessage = "Please indicate")] [Column("ALCABUSE")] public int? CurrentAlcoholAbuse { get; set; } @@ -900,7 +900,7 @@ public bool? OnlyOnePrimaryDiagnosisAllowed { [Column("COGOTHIF")] public int? NOS1Diagnosis { get; set; } - [RequiredIf(nameof(NOS1), "1", ErrorMessage = "Please indicate")] + [RequiredIf(nameof(NOS1), true, ErrorMessage = "Please indicate")] [Display(Name = "If Present, specify")] [Column("COGOTHX")] [MaxLength(60)] @@ -914,7 +914,7 @@ public bool? OnlyOnePrimaryDiagnosisAllowed { [Column("COGOTH2F")] public int? NOS2Diagnosis { get; set; } - [RequiredIf(nameof(NOS2), "1", ErrorMessage = "Please indicate")] + [RequiredIf(nameof(NOS2), true, ErrorMessage = "Please indicate")] [Display(Name = "If Present, specify")] [Column("COGOTH2X")] [MaxLength(60)] @@ -928,7 +928,7 @@ public bool? OnlyOnePrimaryDiagnosisAllowed { [Column("COGOTH3F")] public int? NOS3Diagnosis { get; set; } - [RequiredIf(nameof(NOS3), "1", ErrorMessage = "Please indicate")] + [RequiredIf(nameof(NOS3), true, ErrorMessage = "Please indicate")] [Display(Name = "If Present, specify")] [Column("COGOTH3X")] [MaxLength(60)] diff --git a/src/UDS.Net.Web/Views/ClinicianDiagnosis/Edit.cshtml b/src/UDS.Net.Web/Views/ClinicianDiagnosis/Edit.cshtml index ed3e715..9f3c5a2 100644 --- a/src/UDS.Net.Web/Views/ClinicianDiagnosis/Edit.cshtml +++ b/src/UDS.Net.Web/Views/ClinicianDiagnosis/Edit.cshtml @@ -1164,7 +1164,7 @@
- +
@@ -1334,7 +1334,7 @@
- +
@@ -1590,7 +1590,7 @@
- +
@@ -1677,7 +1677,7 @@
- +
@@ -1735,7 +1735,7 @@
- +
@@ -1779,7 +1779,7 @@
- +
@@ -1925,7 +1925,7 @@
- +
@@ -1973,7 +1973,7 @@
- +
@@ -2074,7 +2074,7 @@
- +
@@ -2109,7 +2109,7 @@
- +
@@ -2144,7 +2144,7 @@
- +
diff --git a/src/UDS.Net.Web/wwwroot/js/ClinicianDiagnosis/Edit.js b/src/UDS.Net.Web/wwwroot/js/ClinicianDiagnosis/Edit.js index e0d4596..d792aad 100644 --- a/src/UDS.Net.Web/wwwroot/js/ClinicianDiagnosis/Edit.js +++ b/src/UDS.Net.Web/wwwroot/js/ClinicianDiagnosis/Edit.js @@ -36,7 +36,22 @@ $(document).ready(function () { $('input[name="' + value + '"]').prop("disabled", disabled); if (!present || uncheck) { - console.log("unchecking " + value); + console.log("unchecking " + value); // TODO remove debug + $('input[name="' + value + '"]').prop('checked', false); // only unselect on not checked + } + }); + } + + function etiologyStateForNorm(present, normalChildElements) { + // this needs to run after the etiologyState when normal + + var disabled = !present; + + $.each(normalChildElements, function (index, value) { + $('input[name="' + value + '"]').prop("disabled", disabled); + + if (!present) { + console.log("unchecking " + value); // TODO remove debu $('input[name="' + value + '"]').prop('checked', false); // only unselect on not checked } }); @@ -181,6 +196,13 @@ $(document).ready(function () { etiologyState(present, childElements); + if (hasNormalCognition === "true") { + var normalChildElements = $(this).data("normal"); + if (normalChildElements) { + etiologyStateForNorm(present, normalChildElements); + } + } + }); } @@ -277,10 +299,15 @@ $(document).ready(function () { // only toggle if cognition is not marked as normal var hasNormalCognition = $("input[name=HasNormalCognition]:checked"); - if (typeof hasNormalCognition !== "undefined" && hasNormalCognition.val() != 'true') - { + if (typeof hasNormalCognition !== "undefined" && hasNormalCognition.val() != 'true') { etiologyState(present, childElements); } + else { + var normalChildElements = $(this).data("normal"); + // TODO remove debug + console.log(normalChildElements); + etiologyStateForNorm(present, normalChildElements); + } }); From e25ad8ab45bec69286f00ba3cef89f9a1650e855 Mon Sep 17 00:00:00 2001 From: Ashley Wilson Date: Wed, 20 Jul 2022 10:19:15 -0400 Subject: [PATCH 06/30] Fixes validation for C2 question 12 --- .../Entities/C2_NeuropsychologicalBatteryScores.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/UDS.Net.Data/Entities/C2_NeuropsychologicalBatteryScores.cs b/src/UDS.Net.Data/Entities/C2_NeuropsychologicalBatteryScores.cs index 41a4255..fe46b0e 100644 --- a/src/UDS.Net.Data/Entities/C2_NeuropsychologicalBatteryScores.cs +++ b/src/UDS.Net.Data/Entities/C2_NeuropsychologicalBatteryScores.cs @@ -431,31 +431,31 @@ public class NeuropsychologicalBatteryScores : FormBase [Display(Name = "Number of correct L-words repeated in 1 minute")] [Range(0, 15, ErrorMessage = "Value outside of required range")] [Column("UDSVERLR")] - [RequiredIfRange(nameof(VerbalFluencyPhonemicTestGeneratedFWords), 0, 40, ErrorMessage = "Value Required")] + [RequiredIfRange(nameof(VerbalFluencyPhonemicTestGeneratedLWords), 0, 40, ErrorMessage = "Value Required")] public int? VerbalFluencyPhonemicTestRepeatedLWords { get; set; } - [Display(Name = "Number of non-Lwords and rule violation errors in 1 minute")] + [Display(Name = "Number of non-L-words and rule violation errors in 1 minute")] [Range(0, 15, ErrorMessage = "Value outside of required range")] [Column("UDSVERLN")] - [RequiredIfRange(nameof(VerbalFluencyPhonemicTestGeneratedFWords), 0, 40, ErrorMessage = "Value Required")] + [RequiredIfRange(nameof(VerbalFluencyPhonemicTestGeneratedLWords), 0, 40, ErrorMessage = "Value Required")] public int? VerbalFluencyPhonemicTestLWordErrors { get; set; } [Display(Name = "Total number of correct F-words and L-words")] [Range(0, 80, ErrorMessage = "Value outside of required range")] [Column("UDSVERTN")] - [RequiredIfRange(nameof(VerbalFluencyPhonemicTestGeneratedFWords), 0, 40, ErrorMessage = "Value Required")] + [RequiredIfRange(nameof(VerbalFluencyPhonemicTestGeneratedLWords), 0, 40, ErrorMessage = "Value Required")] public int? VerbalFluencyPhonemicTestTotalCorrectFAndLWords { get; set; } [Display(Name = " Total number of F-word and L-words repetition errors")] [Range(0, 30, ErrorMessage = "Value outside of required range")] [Column("UDSVERTE")] - [RequiredIfRange(nameof(VerbalFluencyPhonemicTestGeneratedFWords), 0, 40, ErrorMessage = "Value Required")] + [RequiredIfRange(nameof(VerbalFluencyPhonemicTestGeneratedLWords), 0, 40, ErrorMessage = "Value Required")] public int? VerbalFluencyPhonemicTestTotalFAndLRepetitionErrors { get; set; } [Display(Name = "Number of non-F/L-words and rule violation errors")] [Range(0, 30, ErrorMessage = "Value outside of required range")] [Column("UDSVERTI")] - [RequiredIfRange(nameof(VerbalFluencyPhonemicTestGeneratedFWords), 0, 40, ErrorMessage = "Value Required")] + [RequiredIfRange(nameof(VerbalFluencyPhonemicTestGeneratedLWords), 0, 40, ErrorMessage = "Value Required")] public int? VerbalFluencyPhonemicTestTotalFAndLViolationErrors { get; set; } [Display(Name = "Per the clinician (e.g., neuropsychologist, behavioral neurologist, or other suitably qualified clinician), based on the UDS neuropsychological examination, the subjects cognitive status is deemed")] From 851e069da5868b7376c517cba3b5fcc67db5c38e Mon Sep 17 00:00:00 2001 From: mlan225 <17088502+mlan225@users.noreply.github.com> Date: Wed, 20 Jul 2022 11:18:33 -0400 Subject: [PATCH 07/30] update question 11 "unknown" value from 5 to 99 --- src/UDS.Net.Web/Views/Symptoms/Edit.cshtml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/UDS.Net.Web/Views/Symptoms/Edit.cshtml b/src/UDS.Net.Web/Views/Symptoms/Edit.cshtml index b046362..3221b20 100644 --- a/src/UDS.Net.Web/Views/Symptoms/Edit.cshtml +++ b/src/UDS.Net.Web/Views/Symptoms/Edit.cshtml @@ -738,27 +738,27 @@
- +
- +
- +
- +
- - + +
From adb2ca8eed5b8d21fc642090262c08790b7688e5 Mon Sep 17 00:00:00 2001 From: Ashley Wilson Date: Fri, 22 Jul 2022 11:16:39 -0400 Subject: [PATCH 08/30] Clearly delineates section 3 behavior for normal vs impaired cognitive states --- .../Views/ClinicianDiagnosis/Edit.cshtml | 64 +++++++------- .../wwwroot/js/ClinicianDiagnosis/Edit.js | 87 ++++++++----------- 2 files changed, 67 insertions(+), 84 deletions(-) diff --git a/src/UDS.Net.Web/Views/ClinicianDiagnosis/Edit.cshtml b/src/UDS.Net.Web/Views/ClinicianDiagnosis/Edit.cshtml index 9f3c5a2..a9f3622 100644 --- a/src/UDS.Net.Web/Views/ClinicianDiagnosis/Edit.cshtml +++ b/src/UDS.Net.Web/Views/ClinicianDiagnosis/Edit.cshtml @@ -1131,7 +1131,7 @@
- +
@@ -1164,7 +1164,7 @@
- +
@@ -1184,7 +1184,7 @@ @Html.DisplayNameFor(model => model.MultipleSystemAtrophyPresent)
- +
@@ -1209,7 +1209,7 @@ @Html.DisplayNameFor(model => model.ProgressiveSupranuclearPaslyPresent)
- +
@@ -1230,7 +1230,7 @@ @Html.DisplayNameFor(model => model.CorticobasalDegenerationPresent)
- +
@@ -1251,7 +1251,7 @@ @Html.DisplayNameFor(model => model.FTLDWithMotorNeuronDiseasePresent)
- +
@@ -1272,7 +1272,7 @@ @Html.DisplayNameFor(model => model.FTLDNOSPresent)
- +
@@ -1334,7 +1334,7 @@
- +
@@ -1477,7 +1477,7 @@
- +
@@ -1499,7 +1499,7 @@
- +
@@ -1521,7 +1521,7 @@
- +
@@ -1543,7 +1543,7 @@
- +
@@ -1590,7 +1590,7 @@
- +
@@ -1612,7 +1612,7 @@
- +
@@ -1634,7 +1634,7 @@
- +
@@ -1677,7 +1677,7 @@
- +
@@ -1699,7 +1699,7 @@
- +
@@ -1735,7 +1735,7 @@
- +
@@ -1779,7 +1779,7 @@
- +
@@ -1801,7 +1801,7 @@
- +
@@ -1823,7 +1823,7 @@
- +
@@ -1845,7 +1845,7 @@
- +
@@ -1867,7 +1867,7 @@
- +
@@ -1889,7 +1889,7 @@
- +
@@ -1925,7 +1925,7 @@
- +
@@ -1973,7 +1973,7 @@
- +
@@ -1995,7 +1995,7 @@
- +
@@ -2017,7 +2017,7 @@
- +
@@ -2039,7 +2039,7 @@
- +
@@ -2074,7 +2074,7 @@
- +
@@ -2109,7 +2109,7 @@
- +
@@ -2144,7 +2144,7 @@
- +
diff --git a/src/UDS.Net.Web/wwwroot/js/ClinicianDiagnosis/Edit.js b/src/UDS.Net.Web/wwwroot/js/ClinicianDiagnosis/Edit.js index d792aad..c0288aa 100644 --- a/src/UDS.Net.Web/wwwroot/js/ClinicianDiagnosis/Edit.js +++ b/src/UDS.Net.Web/wwwroot/js/ClinicianDiagnosis/Edit.js @@ -10,7 +10,7 @@ $(document).ready(function () { $.each(childElements, function (index, value) { $('input[name="' + value + '"]').prop("disabled", disabled); - console.log(value + " disabled to " + disabled); + if (!isChecked) { $('input[name="' + value + '"]').prop('checked', false); // only unselect on not checked } @@ -19,40 +19,30 @@ $(document).ready(function () { // Section 3: Etiologic diagnoses - function etiologyState(present, childElements) { - // indicate all present + function etiologyState(isNormal, etiologyPresent, childElements, diagnosisRadioButtons) { + + console.log("normal cog = " + isNormal + ", etiology present " + etiologyPresent); + // if present, enable child elements + // if present and impaired, enable diagnosis radio buttons + // UDS spec: // for subjects with normal cognition, indicate presence, but leave diagnosis blank // for subjects with impaired cognition, only indicate one primary + + var diagnosisEnabled = etiologyPresent; - var disabled = !present; // toggle - var uncheck = false; - - if ($("input[name=HasNormalCognition]:checked").val() === "true") { - disabled = true; - uncheck = true; + if (isNormal === 'true') { + diagnosisEnabled = false; // if is normal then diagnosis is always disabled } $.each(childElements, function (index, value) { - $('input[name="' + value + '"]').prop("disabled", disabled); - - if (!present || uncheck) { - console.log("unchecking " + value); // TODO remove debug - $('input[name="' + value + '"]').prop('checked', false); // only unselect on not checked - } + $('input[name="' + value + '"]').prop("disabled", !etiologyPresent); }); - } - - function etiologyStateForNorm(present, normalChildElements) { - // this needs to run after the etiologyState when normal - - var disabled = !present; - $.each(normalChildElements, function (index, value) { - $('input[name="' + value + '"]').prop("disabled", disabled); - - if (!present) { - console.log("unchecking " + value); // TODO remove debu - $('input[name="' + value + '"]').prop('checked', false); // only unselect on not checked + $.each(diagnosisRadioButtons, function (index, value) { + console.log("changing disabled state " + value + " to " + !diagnosisEnabled); + $('input[name="' + value + '"]').prop("disabled", !diagnosisEnabled); + if (!etiologyPresent) { + $('input[name="' + value + '"]').prop('checked', false); } }); } @@ -163,7 +153,6 @@ $(document).ready(function () { // if false then impaired function hasNormalCognitionState(hasNormalCognition) { - var disabled = true; if (hasNormalCognition === "false") { disabled = false; // if false then enable #3 @@ -179,6 +168,7 @@ $(document).ready(function () { hasDementiaState(null); } else if (hasNormalCognition === "false") { // Question 3 Dementia State, children: #4 and #5 + var meetsCriteriaForDementia = $("input[name=MeetsCriteriaForDementia]:checked"); if (typeof meetsCriteriaForDementia !== "undefined") { hasDementiaState(meetsCriteriaForDementia.val()); @@ -189,21 +179,19 @@ $(document).ready(function () { // Section 3 diagnoses requirement is affected by hasNormalCognition - $(".etiology").each(function () { - var etiology = $(this).prop("name"); - var present = $(this).is(":checked"); - var childElements = $(this).data("children"); - - etiologyState(present, childElements); - - if (hasNormalCognition === "true") { - var normalChildElements = $(this).data("normal"); - if (normalChildElements) { - etiologyStateForNorm(present, normalChildElements); - } - } + if (hasNormalCognition != null) { + console.log("------------------------------------------- has normal cognition = " + hasNormalCognition); + + $(".etiology").each(function () { + var etiology = $(this).prop("name"); + var present = $(this).is(":checked"); + var childElements = $(this).data("children"); + var diagnosisRadioButtons = $(this).data("diagnosis"); + + etiologyState(hasNormalCognition, present, childElements, diagnosisRadioButtons); - }); + }); + } } @@ -296,17 +284,12 @@ $(document).ready(function () { var etiology = $(this).prop("name"); var present = $(this).is(":checked"); var childElements = $(this).data("children"); + var diagnosisRadioButtons = $(this).data("diagnosis"); - // only toggle if cognition is not marked as normal - var hasNormalCognition = $("input[name=HasNormalCognition]:checked"); - if (typeof hasNormalCognition !== "undefined" && hasNormalCognition.val() != 'true') { - etiologyState(present, childElements); - } - else { - var normalChildElements = $(this).data("normal"); - // TODO remove debug - console.log(normalChildElements); - etiologyStateForNorm(present, normalChildElements); + var cognitionStateDefined = $('input[name="HasNormalCognition"]:checked'); + if (cognitionStateDefined !== 'undefined') { + + etiologyState(cognitionStateDefined.val(), present, childElements, diagnosisRadioButtons); } }); From c7b2933907cffa89cdf8afc160ce1af1b9428306 Mon Sep 17 00:00:00 2001 From: Ashley Wilson Date: Tue, 26 Jul 2022 11:41:56 -0400 Subject: [PATCH 09/30] Fixes bug with validation on question 6k and specification details --- src/UDS.Net.Data/Entities/D1_ClinicianDiagnosis.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/UDS.Net.Data/Entities/D1_ClinicianDiagnosis.cs b/src/UDS.Net.Data/Entities/D1_ClinicianDiagnosis.cs index be78e29..9e3190b 100644 --- a/src/UDS.Net.Data/Entities/D1_ClinicianDiagnosis.cs +++ b/src/UDS.Net.Data/Entities/D1_ClinicianDiagnosis.cs @@ -340,11 +340,12 @@ public bool? MCIIndicated /// 0 = No /// 1 = Yes /// + [RequiredIf(nameof(FormStatus), FormStatus.Complete, ErrorMessage = "Please indicate biomarker findings.")] [Display(Name = "Other (SPECIFY)")] [Column("OTHBIOM")] public bool? OtherEvidenceExists { get; set; } - [RequiredIf(nameof(OtherEvidenceExists), "1", ErrorMessage = "Please specify other biomarker findings.")] + [RequiredIf(nameof(OtherEvidenceExists), true, ErrorMessage = "Please specify other biomarker findings.")] [Display(Name = "Other (SPECIFY)")] [Column("OTHBIOMX")] [MaxLength(60)] From 65cad04699b6416d30d354aff97fcd1bb19917b1 Mon Sep 17 00:00:00 2001 From: Casey D Spires <11319139+casey-spires@users.noreply.github.com> Date: Wed, 27 Jul 2022 11:07:02 -0400 Subject: [PATCH 10/30] Updates to NACC variables and adjusts spelling Updates A5 SmokingYears use NACC coding requirement of age 8-110, 888 and 999 also fixes erroneous spelling in display messages and error messages. --- src/UDS.Net.Data/Entities/A5_SubjectHealthHistory.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/UDS.Net.Data/Entities/A5_SubjectHealthHistory.cs b/src/UDS.Net.Data/Entities/A5_SubjectHealthHistory.cs index bda67ea..d1deb01 100644 --- a/src/UDS.Net.Data/Entities/A5_SubjectHealthHistory.cs +++ b/src/UDS.Net.Data/Entities/A5_SubjectHealthHistory.cs @@ -30,6 +30,9 @@ public class SubjectHealthHistory: FormBase [Display(Name = "1e. If the subject quit smoking, specify the age at which he/she last smoked (i.e., quit)   (888=N/A, 999=unknown)", GroupName = "Cigarette Smoking")] [Column("QUITSMOK")] [RequiredIf(nameof(Tobac100), "1", ErrorMessage = "A value is required for this question")] + [Range(8,999, ErrorMessage = "Please indicate a valid age between 8 and 110 at which the participant quit smoking")] + [InvalidRange(nameof(QuitSmoking), 110, 887, ErrorMessage = "Please indicate a valid age between 8 and 110 at which the participant quit smoking")] + [InvalidRange(nameof(QuitSmoking), 889, 998, ErrorMessage = "Please indicate a valid age between 8 and 110 at which the participant quit smoking")] public int? QuitSmoking { get; set; } [Display(Name = "1f. In the past three months, has the subject consumed any alcohol? (If No or Unknown, SKIP TO QUESTION 2a)", GroupName = "Alcohol Use")] [Column("ALCOCCAS")] @@ -37,7 +40,7 @@ public class SubjectHealthHistory: FormBase public int? AlcoholConsumption { get; set; } [Display(Name = "1g. During the past three months, how often did the subject have at least one drink of any alcoholic beverage such as wine, beer, malt liquor, or spirits?", GroupName = "Alcohol Use")] [Column("ALCFREQ")] - [RequiredIf(nameof(AlcoholConsumption), "1", ErrorMessage = "Please indicate the frequency of alchohol consuption over the last 3 months")] + [RequiredIf(nameof(AlcoholConsumption), "1", ErrorMessage = "Please indicate the frequency of alcohol consumption over the last 3 months")] public int? AlcoholFrequency { get; set; } [Display(Name = "2a. Heart attack / cardiac arrest (If absent or unknown, SKIP TO QUESTION 2b)", GroupName = "Cardiovascular disease")] [Column("CVHATT")] @@ -251,11 +254,11 @@ public class SubjectHealthHistory: FormBase [RequiredIf(nameof(OtherSleepDisorder), "2", ErrorMessage = "A value is required for this question")] [StringLength(60)] public string OtherSleepDisorderSpecify { get; set; } - [Display(Name = "6a. Alcohol abuse: Clinically significant impairment occuring over a 12-month period manifested in one of the following areas: work, driving, legal, or social", GroupName = "Medical conditions")] + [Display(Name = "6a. Alcohol abuse: Clinically significant impairment occurring over a 12-month period manifested in one of the following areas: work, driving, legal, or social", GroupName = "Medical conditions")] [Column("ALCOHOL")] [RequiredIf(nameof(FormStatus), FormStatus.Complete, "A value is required for this field")] public int? AlcoholAbuse { get; set; } - [Display(Name = "6b. Other abused substances: clinically significant impairment occuring over a 12-month period manifested in one of the following areas: work, driving, legal, or social. (If absent or unknown, SKIP TO QUESTION 7a)", GroupName = "Medical conditions")] + [Display(Name = "6b. Other abused substances: clinically significant impairment occurring over a 12-month period manifested in one of the following areas: work, driving, legal, or social. (If absent or unknown, SKIP TO QUESTION 7a)", GroupName = "Medical conditions")] [Column("ABUSOTHR")] [RequiredIf(nameof(FormStatus), FormStatus.Complete, "A value is required for this field")] public int? AbuseOther { get; set; } From 19ee89373a2e62ce14037eec9f3ee8eb2d7c35e1 Mon Sep 17 00:00:00 2001 From: mlan225 <17088502+mlan225@users.noreply.github.com> Date: Wed, 27 Jul 2022 11:45:06 -0400 Subject: [PATCH 11/30] Add logic for null check for property on a3 Added some code to check for null values on PrimaryNeurologicalProblemPsychiatricCondition when either of the previous 3 inputs have a value. --- .../Controllers/SubjectFamilyHistoryController.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/UDS.Net.Web/Controllers/SubjectFamilyHistoryController.cs b/src/UDS.Net.Web/Controllers/SubjectFamilyHistoryController.cs index 75b9b55..3be85cd 100644 --- a/src/UDS.Net.Web/Controllers/SubjectFamilyHistoryController.cs +++ b/src/UDS.Net.Web/Controllers/SubjectFamilyHistoryController.cs @@ -207,6 +207,13 @@ public async Task Edit(int id, SubjectFamilyHistory subjectFamily { ModelState.AddModelError(String.Format("Relatives[{0}].AgeAtDeath", relativeIndex), "Please provide an age at death or indicate otherwise"); } + if(relative.BirthMonth.HasValue || relative.BirthYear.HasValue || relative.AgeAtDeath.HasValue) + { + if(!relative.PrimaryNeurologicalProblemPsychiatricCondition.HasValue) + { + ModelState.AddModelError(String.Format("Relatives[{0}].PrimaryNeurologicalProblemPsychiatricCondition", relativeIndex), "Please provide a value for Primary neurological problem/psychiatric condition"); + } + } if (relative.PrimaryNeurologicalProblemPsychiatricCondition.HasValue) { var codeExists = _neurologicalProblems.Codes.Where(x => int.Parse(x.Key) == relative.PrimaryNeurologicalProblemPsychiatricCondition).Any(); From 1e2fe81df6e1f765724bc156195505decb615d30 Mon Sep 17 00:00:00 2001 From: Ashley Wilson Date: Wed, 27 Jul 2022 13:19:01 -0400 Subject: [PATCH 12/30] Fixes validation Co-Authored-By: mlan225 <17088502+mlan225@users.noreply.github.com> Co-Authored-By: Casey D Spires <11319139+casey-spires@users.noreply.github.com> --- src/UDS.Net.Data/Entities/A5_SubjectHealthHistory.cs | 9 +++------ .../Controllers/SubjectFamilyHistoryController.cs | 7 ------- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/src/UDS.Net.Data/Entities/A5_SubjectHealthHistory.cs b/src/UDS.Net.Data/Entities/A5_SubjectHealthHistory.cs index d1deb01..bda67ea 100644 --- a/src/UDS.Net.Data/Entities/A5_SubjectHealthHistory.cs +++ b/src/UDS.Net.Data/Entities/A5_SubjectHealthHistory.cs @@ -30,9 +30,6 @@ public class SubjectHealthHistory: FormBase [Display(Name = "1e. If the subject quit smoking, specify the age at which he/she last smoked (i.e., quit)   (888=N/A, 999=unknown)", GroupName = "Cigarette Smoking")] [Column("QUITSMOK")] [RequiredIf(nameof(Tobac100), "1", ErrorMessage = "A value is required for this question")] - [Range(8,999, ErrorMessage = "Please indicate a valid age between 8 and 110 at which the participant quit smoking")] - [InvalidRange(nameof(QuitSmoking), 110, 887, ErrorMessage = "Please indicate a valid age between 8 and 110 at which the participant quit smoking")] - [InvalidRange(nameof(QuitSmoking), 889, 998, ErrorMessage = "Please indicate a valid age between 8 and 110 at which the participant quit smoking")] public int? QuitSmoking { get; set; } [Display(Name = "1f. In the past three months, has the subject consumed any alcohol? (If No or Unknown, SKIP TO QUESTION 2a)", GroupName = "Alcohol Use")] [Column("ALCOCCAS")] @@ -40,7 +37,7 @@ public class SubjectHealthHistory: FormBase public int? AlcoholConsumption { get; set; } [Display(Name = "1g. During the past three months, how often did the subject have at least one drink of any alcoholic beverage such as wine, beer, malt liquor, or spirits?", GroupName = "Alcohol Use")] [Column("ALCFREQ")] - [RequiredIf(nameof(AlcoholConsumption), "1", ErrorMessage = "Please indicate the frequency of alcohol consumption over the last 3 months")] + [RequiredIf(nameof(AlcoholConsumption), "1", ErrorMessage = "Please indicate the frequency of alchohol consuption over the last 3 months")] public int? AlcoholFrequency { get; set; } [Display(Name = "2a. Heart attack / cardiac arrest (If absent or unknown, SKIP TO QUESTION 2b)", GroupName = "Cardiovascular disease")] [Column("CVHATT")] @@ -254,11 +251,11 @@ public class SubjectHealthHistory: FormBase [RequiredIf(nameof(OtherSleepDisorder), "2", ErrorMessage = "A value is required for this question")] [StringLength(60)] public string OtherSleepDisorderSpecify { get; set; } - [Display(Name = "6a. Alcohol abuse: Clinically significant impairment occurring over a 12-month period manifested in one of the following areas: work, driving, legal, or social", GroupName = "Medical conditions")] + [Display(Name = "6a. Alcohol abuse: Clinically significant impairment occuring over a 12-month period manifested in one of the following areas: work, driving, legal, or social", GroupName = "Medical conditions")] [Column("ALCOHOL")] [RequiredIf(nameof(FormStatus), FormStatus.Complete, "A value is required for this field")] public int? AlcoholAbuse { get; set; } - [Display(Name = "6b. Other abused substances: clinically significant impairment occurring over a 12-month period manifested in one of the following areas: work, driving, legal, or social. (If absent or unknown, SKIP TO QUESTION 7a)", GroupName = "Medical conditions")] + [Display(Name = "6b. Other abused substances: clinically significant impairment occuring over a 12-month period manifested in one of the following areas: work, driving, legal, or social. (If absent or unknown, SKIP TO QUESTION 7a)", GroupName = "Medical conditions")] [Column("ABUSOTHR")] [RequiredIf(nameof(FormStatus), FormStatus.Complete, "A value is required for this field")] public int? AbuseOther { get; set; } diff --git a/src/UDS.Net.Web/Controllers/SubjectFamilyHistoryController.cs b/src/UDS.Net.Web/Controllers/SubjectFamilyHistoryController.cs index 3be85cd..75b9b55 100644 --- a/src/UDS.Net.Web/Controllers/SubjectFamilyHistoryController.cs +++ b/src/UDS.Net.Web/Controllers/SubjectFamilyHistoryController.cs @@ -207,13 +207,6 @@ public async Task Edit(int id, SubjectFamilyHistory subjectFamily { ModelState.AddModelError(String.Format("Relatives[{0}].AgeAtDeath", relativeIndex), "Please provide an age at death or indicate otherwise"); } - if(relative.BirthMonth.HasValue || relative.BirthYear.HasValue || relative.AgeAtDeath.HasValue) - { - if(!relative.PrimaryNeurologicalProblemPsychiatricCondition.HasValue) - { - ModelState.AddModelError(String.Format("Relatives[{0}].PrimaryNeurologicalProblemPsychiatricCondition", relativeIndex), "Please provide a value for Primary neurological problem/psychiatric condition"); - } - } if (relative.PrimaryNeurologicalProblemPsychiatricCondition.HasValue) { var codeExists = _neurologicalProblems.Codes.Where(x => int.Parse(x.Key) == relative.PrimaryNeurologicalProblemPsychiatricCondition).Any(); From e4b33262681b4c5bf10fbc17e09ddb310b9d53f2 Mon Sep 17 00:00:00 2001 From: Ashley Wilson Date: Wed, 27 Jul 2022 13:20:10 -0400 Subject: [PATCH 13/30] Fixes validaiton --- src/UDS.Net.Data/Entities/B9_Symptoms.cs | 63 +++++++++++ src/UDS.Net.Web/Views/Symptoms/Edit.cshtml | 125 +++++++++++++-------- 2 files changed, 141 insertions(+), 47 deletions(-) diff --git a/src/UDS.Net.Data/Entities/B9_Symptoms.cs b/src/UDS.Net.Data/Entities/B9_Symptoms.cs index 69361ad..20823c1 100644 --- a/src/UDS.Net.Data/Entities/B9_Symptoms.cs +++ b/src/UDS.Net.Data/Entities/B9_Symptoms.cs @@ -129,6 +129,69 @@ public class Symptoms: FormBase [Range(0, 1, ErrorMessage = "Value outside of required range")] public int? BehavioralSymptoms { get; set; } + [NotMapped] + [RequiredIf(nameof(FormStatus), FormStatus.Complete, ErrorMessage = "Please indicate at least one behavioral symptom (9a-j)")] + public bool? AtLeastOneIndicatedIfHasBehavioralSymptom + { + get + { + if (BehavioralSymptoms.HasValue) + { + if (BehavioralSymptoms.Value == 0) + return true; + else + { + int count = 0; + + if (ApathyWithdrawal.HasValue && ApathyWithdrawal.Value == 1) + count++; + + if (DepressedMood.HasValue && DepressedMood.Value == 1) + count++; + + if (VisualHallucinations.HasValue && VisualHallucinations.Value == 1) + count++; + + if (AuditoryHallucinations.HasValue && AuditoryHallucinations.Value == 1) + count++; + + if (AbnormalBeliefs.HasValue && AbnormalBeliefs.Value == 1) + count++; + + if (Disinhibition.HasValue && Disinhibition.Value == 1) + count++; + + if (Irritability.HasValue && Irritability.Value == 1) + count++; + + if (Agitation.HasValue && Agitation.Value == 1) + count++; + + if (PersonalityChange.HasValue && PersonalityChange.Value == 1) + count++; + + if (RemDisorder.HasValue && RemDisorder.Value == 1) + count++; + + if (Anxiety.HasValue && Anxiety.Value == 1) + count++; + + if (ChangeInBehavior.HasValue && ChangeInBehavior.Value == 1) + count++; + + if (count > 0) + return true; + + return null; + } + } + else + { + return true; + } + } + } + [Column("BEAPATHY")] [RequiredIf(nameof(BehavioralSymptoms), 1, ErrorMessage = "Please provide a value")] [Display(Name = "Has the subject lost interest in or displayed a reduced ability to initiate usual activities and social interaction, such as conversing with family and/or friends?")] diff --git a/src/UDS.Net.Web/Views/Symptoms/Edit.cshtml b/src/UDS.Net.Web/Views/Symptoms/Edit.cshtml index 3221b20..fe58649 100644 --- a/src/UDS.Net.Web/Views/Symptoms/Edit.cshtml +++ b/src/UDS.Net.Web/Views/Symptoms/Edit.cshtml @@ -30,7 +30,7 @@ - Declines in memory reported by subject and co-participant + Declines in memory reported by participant and co-participant @@ -104,8 +104,7 @@ - 4. Indicate whether the subject currently is meaningfully impaired, relative to previously attained abilities, - in the following cognitive domains, or has fluctuating cognition + 4. Indicate whether the participant currently is meaningfully impaired, relative to previously attained abilities, in the following cognitive domains, or has fluctuating cognition @@ -367,16 +366,17 @@
+
- + - - - - - - - + + + + + + - + + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + - + + + - - - - - @@ -128,33 +128,33 @@ @@ -166,36 +166,36 @@ @@ -208,36 +208,36 @@ @@ -457,5 +457,6 @@ @section Scripts { @{await Html.RenderPartialAsync("_ValidationScriptsPartial");} + } diff --git a/src/UDS.Net.Web/Views/CoParticipantDemographics/EditFVP.cshtml b/src/UDS.Net.Web/Views/CoParticipantDemographics/EditFVP.cshtml index ae078bd..befe7c2 100644 --- a/src/UDS.Net.Web/Views/CoParticipantDemographics/EditFVP.cshtml +++ b/src/UDS.Net.Web/Views/CoParticipantDemographics/EditFVP.cshtml @@ -96,7 +96,7 @@
9 - +
@@ -150,33 +150,33 @@ @@ -188,36 +188,36 @@ @@ -230,36 +230,36 @@ @@ -480,5 +480,6 @@ @section Scripts { @{await Html.RenderPartialAsync("_ValidationScriptsPartial");} + } diff --git a/src/UDS.Net.Web/Views/ParticipantDemographics/Edit.cshtml b/src/UDS.Net.Web/Views/ParticipantDemographics/Edit.cshtml index b697078..da1c8de 100644 --- a/src/UDS.Net.Web/Views/ParticipantDemographics/Edit.cshtml +++ b/src/UDS.Net.Web/Views/ParticipantDemographics/Edit.cshtml @@ -332,4 +332,6 @@ @section Scripts { @{await Html.RenderPartialAsync("_ValidationScriptsPartial");} + + } diff --git a/src/UDS.Net.Web/Views/ParticipantDemographics/_InitialVisitEthnicity.cshtml b/src/UDS.Net.Web/Views/ParticipantDemographics/_InitialVisitEthnicity.cshtml index 553047a..c6e3e90 100644 --- a/src/UDS.Net.Web/Views/ParticipantDemographics/_InitialVisitEthnicity.cshtml +++ b/src/UDS.Net.Web/Views/ParticipantDemographics/_InitialVisitEthnicity.cshtml @@ -100,34 +100,34 @@ From 757695b6d45cc3e47a0d3b81572708ffff1cf419 Mon Sep 17 00:00:00 2001 From: Casey D Spires <11319139+casey-spires@users.noreply.github.com> Date: Tue, 9 Aug 2022 16:13:38 -0400 Subject: [PATCH 22/30] Updates the A5 QuitSmoking field to include 110 In the previous update the A5 was excluding 110 out of it's range, this will update the range to include 110 --- src/UDS.Net.Data/Entities/A5_SubjectHealthHistory.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/UDS.Net.Data/Entities/A5_SubjectHealthHistory.cs b/src/UDS.Net.Data/Entities/A5_SubjectHealthHistory.cs index 3fc8435..7c42b0e 100644 --- a/src/UDS.Net.Data/Entities/A5_SubjectHealthHistory.cs +++ b/src/UDS.Net.Data/Entities/A5_SubjectHealthHistory.cs @@ -31,7 +31,7 @@ public class SubjectHealthHistory: FormBase [Column("QUITSMOK")] [RequiredIf(nameof(Tobac100), "1", ErrorMessage = "A value is required for this question")] [Range(8,999, ErrorMessage = "Please indicate a valid age between 8 and 110 at which the participant quit smoking")] - [InvalidRange(nameof(QuitSmoking), 110, 887, ErrorMessage = "Please indicate a valid age between 8 and 110 at which the participant quit smoking")] + [InvalidRange(nameof(QuitSmoking), 111, 887, ErrorMessage = "Please indicate a valid age between 8 and 110 at which the participant quit smoking")] [InvalidRange(nameof(QuitSmoking), 889, 998, ErrorMessage = "Please indicate a valid age between 8 and 110 at which the participant quit smoking")] public int? QuitSmoking { get; set; } [Display(Name = "1f. In the past three months, has the subject consumed any alcohol? (If No or Unknown, SKIP TO QUESTION 2a)", GroupName = "Alcohol Use")] From 41790a0b453dc1a3762c3c2aa804569e63e42b15 Mon Sep 17 00:00:00 2001 From: mlan225 <17088502+mlan225@users.noreply.github.com> Date: Tue, 9 Aug 2022 17:01:27 -0400 Subject: [PATCH 23/30] Adjust the range of PredominantSymptoms to include 0 --- src/UDS.Net.Data/Entities/B9_Symptoms.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/UDS.Net.Data/Entities/B9_Symptoms.cs b/src/UDS.Net.Data/Entities/B9_Symptoms.cs index f4d2d38..a2c5af9 100644 --- a/src/UDS.Net.Data/Entities/B9_Symptoms.cs +++ b/src/UDS.Net.Data/Entities/B9_Symptoms.cs @@ -93,7 +93,7 @@ public class Symptoms: FormBase [Column("COGFPRED")] [RequiredIf(nameof(CognitionImpairment), 1, ErrorMessage = "Please provide a value")] [Display(Name = "Indicate the predominant symptom that was first recognized as a decline in the subject’s cognition")] - [Range(1, 99, ErrorMessage = "Value outside of required range")] + [Range(0, 99, ErrorMessage = "Value outside of required range")] [InvalidRange(nameof(PredominantSymptom), 9, 98, ErrorMessage = "Value outside of required range")] public int? PredominantSymptom { get; set; } From 82ae49f51527f1313a4f2c85b8e03a8b4f19b60e Mon Sep 17 00:00:00 2001 From: Casey D Spires <11319139+casey-spires@users.noreply.github.com> Date: Mon, 15 Aug 2022 15:26:36 -0400 Subject: [PATCH 24/30] Fixes A1 and A2 radio disables for race, and adds valid classes and formatting for radio groups Fixes the logic for the A1 and A2 radio disable logic for A1 and A2 questions, updates HTML for radio buttons and adds classes for disables to affect the entire radio button --- .../CoParticipantDemographics/Edit.cshtml | 497 +++++++++------- .../CoParticipantDemographics/EditFVP.cshtml | 534 ++++++++++-------- .../Views/ParticipantDemographics/Edit.cshtml | 5 +- .../_InitialVisitEthnicity.cshtml | 49 +- src/UDS.Net.Web/wwwroot/js/RacialQuestions.js | 180 ++++++ .../js/SubsequentRadioControlDisable.js | 24 +- 6 files changed, 810 insertions(+), 479 deletions(-) create mode 100644 src/UDS.Net.Web/wwwroot/js/RacialQuestions.js diff --git a/src/UDS.Net.Web/Views/CoParticipantDemographics/Edit.cshtml b/src/UDS.Net.Web/Views/CoParticipantDemographics/Edit.cshtml index 189d3fe..9f5e75a 100644 --- a/src/UDS.Net.Web/Views/CoParticipantDemographics/Edit.cshtml +++ b/src/UDS.Net.Web/Views/CoParticipantDemographics/Edit.cshtml @@ -48,13 +48,17 @@
@@ -64,17 +68,23 @@
@@ -85,38 +95,54 @@
@@ -127,34 +153,48 @@
@@ -165,38 +205,54 @@
@@ -207,38 +263,54 @@
@@ -264,53 +336,41 @@
@@ -336,13 +396,17 @@
@@ -352,29 +416,41 @@
@@ -384,29 +460,41 @@
@@ -416,15 +504,17 @@
@@ -456,7 +546,6 @@ @section Scripts { @{await Html.RenderPartialAsync("_ValidationScriptsPartial");} - - - + + } diff --git a/src/UDS.Net.Web/Views/CoParticipantDemographics/EditFVP.cshtml b/src/UDS.Net.Web/Views/CoParticipantDemographics/EditFVP.cshtml index befe7c2..9289453 100644 --- a/src/UDS.Net.Web/Views/CoParticipantDemographics/EditFVP.cshtml +++ b/src/UDS.Net.Web/Views/CoParticipantDemographics/EditFVP.cshtml @@ -17,14 +17,7 @@
-
Behavioral symptomsBehavioral symptoms
+ 8.
(If No, SKIP TO QUESTION 13)
@@ -391,27 +391,28 @@
- 9. Indicate whether the subject currently manifests meaningful change in behavior in any - of the following ways - - No - - Yes - - Unknown -
+ 9. Indicate whether the participant currently manifests meaningful change in behavior in any of the following ways +
+
+ No + + Yes + + Unknown +
9a. - 9a. Apathy, withdrawal + Apathy, withdrawal
@@ -425,8 +426,9 @@
9b. - 9b. Depressed mood + Depressed mood
@@ -440,15 +442,18 @@
9c. Psychosis
9c. Psychosis
+ 9c1. + - 9c1. +
@@ -462,6 +467,8 @@
9c1a.
@@ -477,6 +484,8 @@
9c1b. @@ -506,8 +515,10 @@
9c2. - 9c2. +
@@ -521,8 +532,10 @@
9c3. - 9c3. +
@@ -535,9 +548,13 @@
9d. - 9d. Disinhibition + Disinhibition +
@@ -551,8 +568,10 @@
9e. - 9e. Irritability + Irritability
+
@@ -566,8 +585,10 @@
9f. - 9f. Agitation + Agitation +
@@ -581,8 +602,10 @@
9g. - 9g. Personality change + Personality change +
@@ -596,8 +619,10 @@
9h. - 9h. REM sleep behavior disorder + REM sleep behavior disorder +
@@ -611,9 +636,11 @@
9h1.
- 9h1. +
@@ -627,8 +654,10 @@
9i. - 9i. Anxiety + Anxiety +
@@ -642,9 +671,10 @@
+ 9j.
- 9j. Other (Specify) + Other (Specify)
@@ -659,8 +689,10 @@
+ 10. @if (!isIVP) { @@ -677,7 +709,7 @@
+
@@ -731,12 +763,12 @@
+ 11.
+
@@ -763,7 +795,7 @@
+
12.
@@ -820,8 +852,7 @@
- 14. Indicate whether the subject currently has meaningful change in motor - function in any of the following areas + 14. Indicate whether the participant currently has meaningful change in motor function in any of the following areas No From 7bb6a94532bed0546653c09258cdcccf2e695ca7 Mon Sep 17 00:00:00 2001 From: Ashley Wilson Date: Thu, 28 Jul 2022 09:17:56 -0400 Subject: [PATCH 14/30] Includes custom data annotations and fixes bug in D1 Section 3 validation --- .../DataAnnotations/InvalidRangeAttribute.cs | 68 ++++++++++++++++ .../DataAnnotations/RequiredIfAttribute.cs | 60 ++++++++++++++ .../RequiredIfImpairedAttribute.cs | 77 ++++++++++++++++++ .../RequiredIfRangeAttribute.cs | 70 ++++++++++++++++ .../Entities/A1_ParticipantDemographics.cs | 2 +- .../Entities/A2_CoParticipantDemographics.cs | 2 +- .../Entities/A3_SubjectFamilyHistory.cs | 2 +- .../Entities/A4G_MedicationsReview.cs | 2 +- .../Entities/A5_SubjectHealthHistory.cs | 11 ++- .../Entities/B1_PhysicalEvaluation.cs | 2 +- src/UDS.Net.Data/Entities/B2_Hachinski.cs | 2 +- .../B3_UnifiedParkinsonsDiseaseRatingScale.cs | 2 +- .../Entities/B4_CDRPlusNACCFTLD.cs | 2 +- src/UDS.Net.Data/Entities/B5_NPIQ.cs | 2 +- .../Entities/B6_GeriatricDepressionScale.cs | 2 +- .../B7_FunctionalActivitiesQuestionnaire.cs | 2 +- .../B8_NeurologicalExaminationFindings.cs | 2 +- src/UDS.Net.Data/Entities/B9_Symptoms.cs | 2 +- .../C2_NeuropsychologicalBatteryScores.cs | 2 +- .../Entities/D1_ClinicianDiagnosis.cs | 81 ++++++++++--------- .../Entities/D2_MedicalConditions.cs | 2 +- src/UDS.Net.Data/Entities/M1_Milestone.cs | 2 +- .../Entities/MedicationReference.cs | 2 +- src/UDS.Net.Data/Entities/T1_TFP_Inclusion.cs | 2 +- src/UDS.Net.Data/Entities/Z1_Checklist.cs | 2 +- src/UDS.Net.Data/UDS.Net.Data.csproj | 5 +- .../SubjectFamilyHistoryController.cs | 7 ++ 27 files changed, 352 insertions(+), 65 deletions(-) create mode 100644 src/UDS.Net.Data/DataAnnotations/InvalidRangeAttribute.cs create mode 100644 src/UDS.Net.Data/DataAnnotations/RequiredIfAttribute.cs create mode 100644 src/UDS.Net.Data/DataAnnotations/RequiredIfImpairedAttribute.cs create mode 100644 src/UDS.Net.Data/DataAnnotations/RequiredIfRangeAttribute.cs diff --git a/src/UDS.Net.Data/DataAnnotations/InvalidRangeAttribute.cs b/src/UDS.Net.Data/DataAnnotations/InvalidRangeAttribute.cs new file mode 100644 index 0000000..56f8ee6 --- /dev/null +++ b/src/UDS.Net.Data/DataAnnotations/InvalidRangeAttribute.cs @@ -0,0 +1,68 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; + +namespace UDS.Net.Data.DataAnnotations +{ + [AttributeUsage(AttributeTargets.Property, AllowMultiple = true)] + public class InvalidRangeAttribute : ValidationAttribute + { + private string PropertyName { get; set; } + private int InvalidRangeMin; + private int InvalidRangeMax; + + /// + /// Property when condition asserts true. + /// + /// + /// + public InvalidRangeAttribute(string propertyName, int invalidRangeMin, int invalidRangeMax, string errorMessage = "") + { + PropertyName = propertyName; + InvalidRangeMax = invalidRangeMax; + InvalidRangeMin = invalidRangeMin; + } + + public InvalidRangeAttribute(string ErrorMessage) + { + this.ErrorMessage = ErrorMessage; + } + + protected override ValidationResult IsValid(object value, ValidationContext context) + { + var instance = context.ObjectInstance; + var type = instance.GetType(); + + var propertyValue = type.GetProperty(PropertyName).GetValue(instance); + + var formStatus = type.GetProperty("FormStatus"); + if (formStatus != null) + { + var formStatusValue = formStatus.GetValue(instance, null); + if (formStatusValue.ToString() != "Complete") + { + return ValidationResult.Success; // if the annotation is on a form and it is not being completed, don't run validation + } + } + + var invalidMinValue = InvalidRangeMin; + var invalidMaxValue = InvalidRangeMax; + + if (propertyValue != null) // we're allowing nulls in some cases, so the watched property won't always have a value + { + while (invalidMinValue <= invalidMaxValue) + { + if (propertyValue.ToString() == invalidMinValue.ToString() || value == null) + { + return new ValidationResult(ErrorMessage); + } + + invalidMinValue++; + } + } + + return ValidationResult.Success; + } + } +} + diff --git a/src/UDS.Net.Data/DataAnnotations/RequiredIfAttribute.cs b/src/UDS.Net.Data/DataAnnotations/RequiredIfAttribute.cs new file mode 100644 index 0000000..4e8d66c --- /dev/null +++ b/src/UDS.Net.Data/DataAnnotations/RequiredIfAttribute.cs @@ -0,0 +1,60 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; + +namespace UDS.Net.Data.DataAnnotations +{ + [AttributeUsage(AttributeTargets.Property, AllowMultiple = true)] + public class RequiredIfAttribute : ValidationAttribute + { + private string PropertyName { get; set; } + private object AssertionValue { get; set; } + + /// + /// Property when condition asserts true. + /// + /// + /// + public RequiredIfAttribute(string propertyName, object assertion, string errorMessage = "") + { + PropertyName = propertyName; + AssertionValue = assertion; + ErrorMessage = errorMessage; + } + + public RequiredIfAttribute(string ErrorMessage) + { + this.ErrorMessage = ErrorMessage; + } + + protected override ValidationResult IsValid(object value, ValidationContext context) + { + var instance = context.ObjectInstance; + var type = instance.GetType(); + + var propertyValue = type.GetProperty(PropertyName).GetValue(instance, null); + + var formStatus = type.GetProperty("FormStatus"); + if (formStatus != null) + { + var formStatusValue = formStatus.GetValue(instance, null); + if (formStatusValue.ToString() != "Complete") + { + return ValidationResult.Success; // if the annotation is on a form and it is not being completed, don't run validation + } + } + + if (propertyValue != null) // we're allowing nulls in some cases, so the watched property won't always have a value + { + if (propertyValue.ToString() == AssertionValue.ToString() && value == null) + { + return new ValidationResult(ErrorMessage); + } + } + + return ValidationResult.Success; + } + + } +} + diff --git a/src/UDS.Net.Data/DataAnnotations/RequiredIfImpairedAttribute.cs b/src/UDS.Net.Data/DataAnnotations/RequiredIfImpairedAttribute.cs new file mode 100644 index 0000000..1eb406e --- /dev/null +++ b/src/UDS.Net.Data/DataAnnotations/RequiredIfImpairedAttribute.cs @@ -0,0 +1,77 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; + +namespace UDS.Net.Data.DataAnnotations +{ + /// + /// This annotation was made specifically for handling special cases in + /// ClinicianDiagnosis. + /// + [AttributeUsage(AttributeTargets.Property, AllowMultiple = true)] + public class RequiredIfImpairedAttribute : ValidationAttribute + { + private string PropertyName { get; set; } + private object AssertionValue { get; set; } + + /// + /// Property when condition asserts true. + /// + /// + /// + public RequiredIfImpairedAttribute(string propertyName, object assertion, string errorMessage = "") + { + PropertyName = propertyName; + AssertionValue = assertion; + ErrorMessage = errorMessage; + } + + public RequiredIfImpairedAttribute(string ErrorMessage) + { + this.ErrorMessage = ErrorMessage; + } + + protected override ValidationResult IsValid(object value, ValidationContext context) + { + var instance = context.ObjectInstance; + var type = instance.GetType(); + + var propertyValue = type.GetProperty(PropertyName).GetValue(instance, null); + + var formStatus = type.GetProperty("FormStatus"); + var hasNormalCognition = type.GetProperty("HasNormalCognition"); + if (formStatus != null && hasNormalCognition != null) + { + var formStatusValue = formStatus.GetValue(instance, null); + var hasNormalCognitionValue = hasNormalCognition.GetValue(instance, null); + if (formStatusValue.ToString() != "Complete") + { + return ValidationResult.Success; // if the annotation is on a form and it is not being completed, don't run validation + } + else + { + // form status is complete + string test = hasNormalCognitionValue.ToString(); + if (hasNormalCognitionValue.ToString() == "True") + { + // cognition is normal (not impaired), so don't require + return ValidationResult.Success; + } + } + } + + if (propertyValue != null) // we're allowing nulls in some cases, so the watched property won't always have a value + { + if (propertyValue.ToString() == AssertionValue.ToString() && value == null) + { + return new ValidationResult(ErrorMessage); + } + } + + return ValidationResult.Success; + } + + } +} + + diff --git a/src/UDS.Net.Data/DataAnnotations/RequiredIfRangeAttribute.cs b/src/UDS.Net.Data/DataAnnotations/RequiredIfRangeAttribute.cs new file mode 100644 index 0000000..9affd30 --- /dev/null +++ b/src/UDS.Net.Data/DataAnnotations/RequiredIfRangeAttribute.cs @@ -0,0 +1,70 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; + +namespace UDS.Net.Data.DataAnnotations +{ + [AttributeUsage(AttributeTargets.Property, AllowMultiple = true)] + public class RequiredIfRangeAttribute : ValidationAttribute + { + private string PropertyName { get; set; } + private int StartAssertionValue; + private int EndAssertionValue; + + /// + /// Property when condition asserts true. + /// + /// + /// + public RequiredIfRangeAttribute(string propertyName, int startAssertionValue, int endAssertionValue, string errorMessage = "") + { + PropertyName = propertyName; + StartAssertionValue = startAssertionValue; + EndAssertionValue = endAssertionValue; + ErrorMessage = errorMessage; + } + + public RequiredIfRangeAttribute(string ErrorMessage) + { + this.ErrorMessage = ErrorMessage; + } + + protected override ValidationResult IsValid(object value, ValidationContext context) + { + var instance = context.ObjectInstance; + var type = instance.GetType(); + + var propertyValue = type.GetProperty(PropertyName).GetValue(instance, null); + + var formStatus = type.GetProperty("FormStatus"); + if (formStatus != null) + { + var formStatusValue = formStatus.GetValue(instance, null); + if (formStatusValue.ToString() != "Complete") + { + return ValidationResult.Success; // if the annotation is on a form and it is not being completed, don't run validation + } + } + + var startValue = StartAssertionValue; + var endValue = EndAssertionValue; + + if (propertyValue != null) // we're allowing nulls in some cases, so the watched property won't always have a value + { + while (startValue <= endValue) + { + if (propertyValue.ToString() == startValue.ToString() && value == null) + { + return new ValidationResult(ErrorMessage); + } + + startValue++; + } + } + + return ValidationResult.Success; + } + + } +} + diff --git a/src/UDS.Net.Data/Entities/A1_ParticipantDemographics.cs b/src/UDS.Net.Data/Entities/A1_ParticipantDemographics.cs index fd5f976..e8a5259 100644 --- a/src/UDS.Net.Data/Entities/A1_ParticipantDemographics.cs +++ b/src/UDS.Net.Data/Entities/A1_ParticipantDemographics.cs @@ -1,7 +1,7 @@ using System; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -using COA.Components.Web.DataAnnotations; +using UDS.Net.Data.DataAnnotations; using Microsoft.EntityFrameworkCore; using UDS.Net.Data.Enums; diff --git a/src/UDS.Net.Data/Entities/A2_CoParticipantDemographics.cs b/src/UDS.Net.Data/Entities/A2_CoParticipantDemographics.cs index df7aab7..8899600 100644 --- a/src/UDS.Net.Data/Entities/A2_CoParticipantDemographics.cs +++ b/src/UDS.Net.Data/Entities/A2_CoParticipantDemographics.cs @@ -1,7 +1,7 @@ using System; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -using COA.Components.Web.DataAnnotations; +using UDS.Net.Data.DataAnnotations; using Microsoft.EntityFrameworkCore; using UDS.Net.Data.Enums; diff --git a/src/UDS.Net.Data/Entities/A3_SubjectFamilyHistory.cs b/src/UDS.Net.Data/Entities/A3_SubjectFamilyHistory.cs index fe7fc16..fe296da 100644 --- a/src/UDS.Net.Data/Entities/A3_SubjectFamilyHistory.cs +++ b/src/UDS.Net.Data/Entities/A3_SubjectFamilyHistory.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations.Schema; -using COA.Components.Web.DataAnnotations; +using UDS.Net.Data.DataAnnotations; using UDS.Net.Data.Enums; namespace UDS.Net.Data.Entities diff --git a/src/UDS.Net.Data/Entities/A4G_MedicationsReview.cs b/src/UDS.Net.Data/Entities/A4G_MedicationsReview.cs index 016dcd6..168f013 100644 --- a/src/UDS.Net.Data/Entities/A4G_MedicationsReview.cs +++ b/src/UDS.Net.Data/Entities/A4G_MedicationsReview.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -using COA.Components.Web.DataAnnotations; +using UDS.Net.Data.DataAnnotations; using UDS.Net.Data.Enums; namespace UDS.Net.Data.Entities diff --git a/src/UDS.Net.Data/Entities/A5_SubjectHealthHistory.cs b/src/UDS.Net.Data/Entities/A5_SubjectHealthHistory.cs index bda67ea..3fc8435 100644 --- a/src/UDS.Net.Data/Entities/A5_SubjectHealthHistory.cs +++ b/src/UDS.Net.Data/Entities/A5_SubjectHealthHistory.cs @@ -1,7 +1,7 @@ using System; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -using COA.Components.Web.DataAnnotations; +using UDS.Net.Data.DataAnnotations; using UDS.Net.Data.Enums; namespace UDS.Net.Data.Entities @@ -30,6 +30,9 @@ public class SubjectHealthHistory: FormBase [Display(Name = "1e. If the subject quit smoking, specify the age at which he/she last smoked (i.e., quit)   (888=N/A, 999=unknown)", GroupName = "Cigarette Smoking")] [Column("QUITSMOK")] [RequiredIf(nameof(Tobac100), "1", ErrorMessage = "A value is required for this question")] + [Range(8,999, ErrorMessage = "Please indicate a valid age between 8 and 110 at which the participant quit smoking")] + [InvalidRange(nameof(QuitSmoking), 110, 887, ErrorMessage = "Please indicate a valid age between 8 and 110 at which the participant quit smoking")] + [InvalidRange(nameof(QuitSmoking), 889, 998, ErrorMessage = "Please indicate a valid age between 8 and 110 at which the participant quit smoking")] public int? QuitSmoking { get; set; } [Display(Name = "1f. In the past three months, has the subject consumed any alcohol? (If No or Unknown, SKIP TO QUESTION 2a)", GroupName = "Alcohol Use")] [Column("ALCOCCAS")] @@ -37,7 +40,7 @@ public class SubjectHealthHistory: FormBase public int? AlcoholConsumption { get; set; } [Display(Name = "1g. During the past three months, how often did the subject have at least one drink of any alcoholic beverage such as wine, beer, malt liquor, or spirits?", GroupName = "Alcohol Use")] [Column("ALCFREQ")] - [RequiredIf(nameof(AlcoholConsumption), "1", ErrorMessage = "Please indicate the frequency of alchohol consuption over the last 3 months")] + [RequiredIf(nameof(AlcoholConsumption), "1", ErrorMessage = "Please indicate the frequency of alcohol consumption over the last 3 months")] public int? AlcoholFrequency { get; set; } [Display(Name = "2a. Heart attack / cardiac arrest (If absent or unknown, SKIP TO QUESTION 2b)", GroupName = "Cardiovascular disease")] [Column("CVHATT")] @@ -251,11 +254,11 @@ public class SubjectHealthHistory: FormBase [RequiredIf(nameof(OtherSleepDisorder), "2", ErrorMessage = "A value is required for this question")] [StringLength(60)] public string OtherSleepDisorderSpecify { get; set; } - [Display(Name = "6a. Alcohol abuse: Clinically significant impairment occuring over a 12-month period manifested in one of the following areas: work, driving, legal, or social", GroupName = "Medical conditions")] + [Display(Name = "6a. Alcohol abuse: Clinically significant impairment occurring over a 12-month period manifested in one of the following areas: work, driving, legal, or social", GroupName = "Medical conditions")] [Column("ALCOHOL")] [RequiredIf(nameof(FormStatus), FormStatus.Complete, "A value is required for this field")] public int? AlcoholAbuse { get; set; } - [Display(Name = "6b. Other abused substances: clinically significant impairment occuring over a 12-month period manifested in one of the following areas: work, driving, legal, or social. (If absent or unknown, SKIP TO QUESTION 7a)", GroupName = "Medical conditions")] + [Display(Name = "6b. Other abused substances: clinically significant impairment occurring over a 12-month period manifested in one of the following areas: work, driving, legal, or social. (If absent or unknown, SKIP TO QUESTION 7a)", GroupName = "Medical conditions")] [Column("ABUSOTHR")] [RequiredIf(nameof(FormStatus), FormStatus.Complete, "A value is required for this field")] public int? AbuseOther { get; set; } diff --git a/src/UDS.Net.Data/Entities/B1_PhysicalEvaluation.cs b/src/UDS.Net.Data/Entities/B1_PhysicalEvaluation.cs index 8579369..91cad17 100644 --- a/src/UDS.Net.Data/Entities/B1_PhysicalEvaluation.cs +++ b/src/UDS.Net.Data/Entities/B1_PhysicalEvaluation.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -using COA.Components.Web.DataAnnotations; +using UDS.Net.Data.DataAnnotations; using UDS.Net.Data.Enums; namespace UDS.Net.Data.Entities diff --git a/src/UDS.Net.Data/Entities/B2_Hachinski.cs b/src/UDS.Net.Data/Entities/B2_Hachinski.cs index f4b0df4..75ac8a5 100644 --- a/src/UDS.Net.Data/Entities/B2_Hachinski.cs +++ b/src/UDS.Net.Data/Entities/B2_Hachinski.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -using COA.Components.Web.DataAnnotations; +using UDS.Net.Data.DataAnnotations; using UDS.Net.Data.Enums; namespace UDS.Net.Data.Entities diff --git a/src/UDS.Net.Data/Entities/B3_UnifiedParkinsonsDiseaseRatingScale.cs b/src/UDS.Net.Data/Entities/B3_UnifiedParkinsonsDiseaseRatingScale.cs index 8c407e4..d949bbb 100644 --- a/src/UDS.Net.Data/Entities/B3_UnifiedParkinsonsDiseaseRatingScale.cs +++ b/src/UDS.Net.Data/Entities/B3_UnifiedParkinsonsDiseaseRatingScale.cs @@ -1,7 +1,7 @@ using System.ComponentModel; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -using COA.Components.Web.DataAnnotations; +using UDS.Net.Data.DataAnnotations; using UDS.Net.Data.Enums; namespace UDS.Net.Data.Entities diff --git a/src/UDS.Net.Data/Entities/B4_CDRPlusNACCFTLD.cs b/src/UDS.Net.Data/Entities/B4_CDRPlusNACCFTLD.cs index 054310d..58a8195 100644 --- a/src/UDS.Net.Data/Entities/B4_CDRPlusNACCFTLD.cs +++ b/src/UDS.Net.Data/Entities/B4_CDRPlusNACCFTLD.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -using COA.Components.Web.DataAnnotations; +using UDS.Net.Data.DataAnnotations; using UDS.Net.Data.Enums; namespace UDS.Net.Data.Entities diff --git a/src/UDS.Net.Data/Entities/B5_NPIQ.cs b/src/UDS.Net.Data/Entities/B5_NPIQ.cs index d7b40bb..04f0202 100644 --- a/src/UDS.Net.Data/Entities/B5_NPIQ.cs +++ b/src/UDS.Net.Data/Entities/B5_NPIQ.cs @@ -1,7 +1,7 @@ using System; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -using COA.Components.Web.DataAnnotations; +using UDS.Net.Data.DataAnnotations; using UDS.Net.Data.Enums; namespace UDS.Net.Data.Entities diff --git a/src/UDS.Net.Data/Entities/B6_GeriatricDepressionScale.cs b/src/UDS.Net.Data/Entities/B6_GeriatricDepressionScale.cs index b4736d7..441185b 100644 --- a/src/UDS.Net.Data/Entities/B6_GeriatricDepressionScale.cs +++ b/src/UDS.Net.Data/Entities/B6_GeriatricDepressionScale.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -using COA.Components.Web.DataAnnotations; +using UDS.Net.Data.DataAnnotations; using UDS.Net.Data.Enums; namespace UDS.Net.Data.Entities diff --git a/src/UDS.Net.Data/Entities/B7_FunctionalActivitiesQuestionnaire.cs b/src/UDS.Net.Data/Entities/B7_FunctionalActivitiesQuestionnaire.cs index 973bac8..0f43001 100644 --- a/src/UDS.Net.Data/Entities/B7_FunctionalActivitiesQuestionnaire.cs +++ b/src/UDS.Net.Data/Entities/B7_FunctionalActivitiesQuestionnaire.cs @@ -1,7 +1,7 @@ using System.ComponentModel; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -using COA.Components.Web.DataAnnotations; +using UDS.Net.Data.DataAnnotations; using UDS.Net.Data.Enums; namespace UDS.Net.Data.Entities diff --git a/src/UDS.Net.Data/Entities/B8_NeurologicalExaminationFindings.cs b/src/UDS.Net.Data/Entities/B8_NeurologicalExaminationFindings.cs index e988837..726b590 100644 --- a/src/UDS.Net.Data/Entities/B8_NeurologicalExaminationFindings.cs +++ b/src/UDS.Net.Data/Entities/B8_NeurologicalExaminationFindings.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -using COA.Components.Web.DataAnnotations; +using UDS.Net.Data.DataAnnotations; using UDS.Net.Data.Enums; namespace UDS.Net.Data.Entities diff --git a/src/UDS.Net.Data/Entities/B9_Symptoms.cs b/src/UDS.Net.Data/Entities/B9_Symptoms.cs index 20823c1..f4d2d38 100644 --- a/src/UDS.Net.Data/Entities/B9_Symptoms.cs +++ b/src/UDS.Net.Data/Entities/B9_Symptoms.cs @@ -1,7 +1,7 @@ using System; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -using COA.Components.Web.DataAnnotations; +using UDS.Net.Data.DataAnnotations; using Microsoft.EntityFrameworkCore; using UDS.Net.Data.Enums; diff --git a/src/UDS.Net.Data/Entities/C2_NeuropsychologicalBatteryScores.cs b/src/UDS.Net.Data/Entities/C2_NeuropsychologicalBatteryScores.cs index fe46b0e..d4c54c1 100644 --- a/src/UDS.Net.Data/Entities/C2_NeuropsychologicalBatteryScores.cs +++ b/src/UDS.Net.Data/Entities/C2_NeuropsychologicalBatteryScores.cs @@ -1,7 +1,7 @@ using System; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -using COA.Components.Web.DataAnnotations; +using UDS.Net.Data.DataAnnotations; using UDS.Net.Data.Enums; namespace UDS.Net.Data.Entities diff --git a/src/UDS.Net.Data/Entities/D1_ClinicianDiagnosis.cs b/src/UDS.Net.Data/Entities/D1_ClinicianDiagnosis.cs index 9e3190b..c11fcd0 100644 --- a/src/UDS.Net.Data/Entities/D1_ClinicianDiagnosis.cs +++ b/src/UDS.Net.Data/Entities/D1_ClinicianDiagnosis.cs @@ -1,7 +1,7 @@ using System; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -using COA.Components.Web.DataAnnotations; +using UDS.Net.Data.DataAnnotations; using UDS.Net.Data.Enums; namespace UDS.Net.Data.Entities @@ -277,7 +277,8 @@ public bool? MCIIndicated if (AmnesticMCISingleDomainPresent || AmnesticMCIMultipleDomains || NonAmnesticMCISingleDomain || NonAmnesticMCIMultipleDomains || CognitivelyImpairedNotMCIPresent) { return true; - } else return null; + } + else return null; } } @@ -289,7 +290,7 @@ public bool? MCIIndicated [RequiredIf(nameof(FormStatus), FormStatus.Complete, ErrorMessage = "Please indicate biomarker findings.")] [Display(Name = "Abnormally elevated amyloid on PET")] [Column("AMYLPET")] - public int? AbnormallyElevatedAmyloidInPET{ get; set; } + public int? AbnormallyElevatedAmyloidInPET { get; set; } [RequiredIf(nameof(FormStatus), FormStatus.Complete, ErrorMessage = "Please indicate biomarker findings.")] [Display(Name = "Abnormally low amyloid in CSF")] @@ -358,7 +359,7 @@ public bool? MCIIndicated [RequiredIf(nameof(FormStatus), FormStatus.Complete, ErrorMessage = "Please indicate imaging findings.")] [Display(Name = "Large vessel infarct(s)")] [Column("IMAGLINF")] - public int? LargeVesselInfarcts{ get; set; } + public int? LargeVesselInfarcts { get; set; } [RequiredIf(nameof(FormStatus), FormStatus.Complete, ErrorMessage = "Please indicate imaging findings.")] [Display(Name = "Lacunar infarct(s)")] @@ -418,11 +419,12 @@ public bool? MCIIndicated /// [RequiredIf(nameof(FormStatus), FormStatus.Complete, ErrorMessage = "In Section 3, ONE diagnosis should be indicated as primary.")] [NotMapped] - public bool? OnlyOnePrimaryDiagnosisAllowed { + public bool? OnlyOnePrimaryDiagnosisAllowed + { get { int counter = 0; - + if (AlzheimersDiseaseDiagnosis.HasValue && AlzheimersDiseaseDiagnosis.Value == 1) { counter++; @@ -551,7 +553,7 @@ public bool? OnlyOnePrimaryDiagnosisAllowed { { counter++; } - + if (counter == 1) { return true; @@ -579,7 +581,7 @@ public bool? OnlyOnePrimaryDiagnosisAllowed { /// 2 = Contributing /// 3 = Non-contributing /// - [RequiredIfImpaired(nameof(AlzheimersDiseasePresent), true, ErrorMessage = "Please indicate diagnosis. Only one should be selected as 1=Primary.")] + [RequiredIfImpaired(nameof(AlzheimersDiseasePresent), true, ErrorMessage = "Indicate diagnosis for Alzheimer's disease.")] [Column("ALZDISIF")] public int? AlzheimersDiseaseDiagnosis { get; set; } @@ -589,7 +591,7 @@ public bool? OnlyOnePrimaryDiagnosisAllowed { [Column("LBDIS")] public bool LewyBodyDiseasePresent { get; set; } - [RequiredIfImpaired(nameof(LewyBodyDiseasePresent), true, ErrorMessage = "Please indicate diagnosis. Only one should be selected as 1=Primary.")] + [RequiredIfImpaired(nameof(LewyBodyDiseasePresent), true, ErrorMessage = "Indicate diagnosis for Lewy body disease.")] [Column("LBDIF")] public int? LewyBodyDiseaseDiagnosis { get; set; } @@ -601,7 +603,7 @@ public bool? OnlyOnePrimaryDiagnosisAllowed { [Column("MSA")] public bool MultipleSystemAtrophyPresent { get; set; } - [RequiredIfImpaired(nameof(MultipleSystemAtrophyPresent), true, ErrorMessage = "Please indicate diagnosis. Only one should be selected as 1=Primary.")] + [RequiredIfImpaired(nameof(MultipleSystemAtrophyPresent), true, ErrorMessage = "Indicate diagnosis for Multiple system atrophy.")] [Column("MSAIF")] public int? MultipleSystemAtrophyDiagnosis { get; set; } @@ -609,7 +611,7 @@ public bool? OnlyOnePrimaryDiagnosisAllowed { [Column("PSP")] public bool ProgressiveSupranuclearPaslyPresent { get; set; } - [RequiredIfImpaired(nameof(ProgressiveSupranuclearPaslyPresent), true, ErrorMessage = "Please indicate diagnosis. Only one should be selected as 1=Primary.")] + [RequiredIfImpaired(nameof(ProgressiveSupranuclearPaslyPresent), true, ErrorMessage = "Indicate diagnosis for Progressive supranuclear palsy (PSP).")] [Column("PSPIF")] public int? ProgressiveSupranuclearPaslyDiagnosis { get; set; } @@ -617,7 +619,7 @@ public bool? OnlyOnePrimaryDiagnosisAllowed { [Column("CORT")] public bool CorticobasalDegenerationPresent { get; set; } - [RequiredIfImpaired(nameof(CorticobasalDegenerationPresent), true, ErrorMessage = "Please indicate diagnosis. Only one should be selected as 1=Primary.")] + [RequiredIfImpaired(nameof(CorticobasalDegenerationPresent), true, ErrorMessage = "Indicate diagnosis for Corticobasal degeneration (CBD).")] [Column("CORTIF")] public int? CorticobasalDegenerationDiagnosis { get; set; } @@ -625,7 +627,7 @@ public bool? OnlyOnePrimaryDiagnosisAllowed { [Column("FTLDMO")] public bool FTLDWithMotorNeuronDiseasePresent { get; set; } - [RequiredIfImpaired(nameof(FTLDWithMotorNeuronDiseasePresent), true, ErrorMessage = "Please indicate diagnosis. Only one should be selected as 1=Primary.")] + [RequiredIfImpaired(nameof(FTLDWithMotorNeuronDiseasePresent), true, ErrorMessage = "Indicate diagnosis for FTLD with motor neuron disease.")] [Column("FTLDMOIF")] public int? FTLDWithMotorNeuronDiseaseDiagnosis { get; set; } @@ -633,7 +635,7 @@ public bool? OnlyOnePrimaryDiagnosisAllowed { [Column("FTLDNOS")] public bool FTLDNOSPresent { get; set; } - [RequiredIfImpaired(nameof(FTLDNOSPresent), true, ErrorMessage = "Please indicate diagnosis. Only one should be selected as 1=Primary.")] + [RequiredIfImpaired(nameof(FTLDNOSPresent), true, ErrorMessage = "Indicate diagnosis for FTLD NOS.")] [Column("FTLDNOIF")] public int? FTLDNOSDiagnosis { get; set; } @@ -655,7 +657,7 @@ public bool? OnlyOnePrimaryDiagnosisAllowed { [Column("CVD")] public bool VascularBrainInjuryPresent { get; set; } - [RequiredIfImpaired(nameof(VascularBrainInjuryPresent), "1", ErrorMessage = "Please indicate")] + [RequiredIfImpaired(nameof(VascularBrainInjuryPresent), true, ErrorMessage = "Indicate diagnosis for Vascular brain injury.")] [Column("CVDIF")] public int? VascularBrainInjuryDiagnosis { get; set; } @@ -688,7 +690,7 @@ public bool? OnlyOnePrimaryDiagnosisAllowed { [Column("ESSTREM")] public bool EssentialTremorPresent { get; set; } - [RequiredIfImpaired(nameof(EssentialTremorPresent), "1", ErrorMessage = "Please indicate")] + [RequiredIfImpaired(nameof(EssentialTremorPresent), true, ErrorMessage = "Indicate diagnosis for Essential tremor.")] [Column("ESSTREIF")] public int? EssentialTremorDiagnosis { get; set; } @@ -696,7 +698,7 @@ public bool? OnlyOnePrimaryDiagnosisAllowed { [Column("DOWNS")] public bool DownSyndromePresent { get; set; } - [RequiredIfImpaired(nameof(DownSyndromePresent), "1", ErrorMessage = "Please indicate")] + [RequiredIfImpaired(nameof(DownSyndromePresent), true, ErrorMessage = "Indicate diagnosis for Down syndrome.")] [Column("DOWNSIF")] public int? DownSyndromeDiagnosis { get; set; } @@ -704,7 +706,7 @@ public bool? OnlyOnePrimaryDiagnosisAllowed { [Column("HUNT")] public bool HuntingtonsDiseasePresent { get; set; } - [RequiredIfImpaired(nameof(HuntingtonsDiseasePresent), "1", ErrorMessage = "Please indicate")] + [RequiredIfImpaired(nameof(HuntingtonsDiseasePresent), true, ErrorMessage = "Indicate diagnosis for Huntington's disease.")] [Column("HUNTIF")] public int? HuntingtonsDiseaseDiagnosis { get; set; } @@ -712,7 +714,7 @@ public bool? OnlyOnePrimaryDiagnosisAllowed { [Column("PRION")] public bool PrionDiseasePresent { get; set; } - [RequiredIfImpaired(nameof(PrionDiseasePresent), "1", ErrorMessage = "Please indicate")] + [RequiredIfImpaired(nameof(PrionDiseasePresent), true, ErrorMessage = "Indicate diagnosis for Prion disease (CJD, other).")] [Column("PRIONIF")] public int? PrionDiseaseDiagnosis { get; set; } @@ -720,7 +722,7 @@ public bool? OnlyOnePrimaryDiagnosisAllowed { [Column("BRNINJ")] public bool TraumaticBrainInjuryPresent { get; set; } - [RequiredIfImpaired(nameof(TraumaticBrainInjuryPresent), "1", ErrorMessage = "Please indicate")] + [RequiredIfImpaired(nameof(TraumaticBrainInjuryPresent), true, ErrorMessage = "Indicate diagnosis for Traumatic brain injury.")] [Column("BRNINJIF")] public int? TraumaticBrainInjuryDiagnosis { get; set; } @@ -733,7 +735,7 @@ public bool? OnlyOnePrimaryDiagnosisAllowed { [Column("HYCEPH")] public bool NormalPressureHydrocephalusPresent { get; set; } - [RequiredIfImpaired(nameof(NormalPressureHydrocephalusPresent), "1", ErrorMessage = "Please indicate")] + [RequiredIfImpaired(nameof(NormalPressureHydrocephalusPresent), true, ErrorMessage = "Indicate diagnosis for Normal-pressure hydrocephalus.")] [Column("HYCEPHIF")] public int? NormalPressureHydropcephalusDiagnosis { get; set; } @@ -741,7 +743,7 @@ public bool? OnlyOnePrimaryDiagnosisAllowed { [Column("EPILEP")] public bool EpilepsyPresent { get; set; } - [RequiredIfImpaired(nameof(EpilepsyPresent), "1", ErrorMessage = "Please indicate")] + [RequiredIfImpaired(nameof(EpilepsyPresent), true, ErrorMessage = "Indicate diagnosis for Epilepsy.")] [Column("EPILEPIF")] public int? EpilepsyDiagnosis { get; set; } @@ -749,7 +751,7 @@ public bool? OnlyOnePrimaryDiagnosisAllowed { [Column("NEOP")] public bool CNSNeoplasmPresent { get; set; } - [RequiredIfImpaired(nameof(CNSNeoplasmPresent), "1", ErrorMessage = "Please indicate")] + [RequiredIfImpaired(nameof(CNSNeoplasmPresent), true, ErrorMessage = "Indicate diagnosis for CNS neoplasm.")] [Column("NEOPIF")] public int? CNSNeoplasmDiagnosis { get; set; } @@ -761,7 +763,7 @@ public bool? OnlyOnePrimaryDiagnosisAllowed { [Column("HIV")] public bool HumanImmunodeficiencyVirusPresent { get; set; } - [RequiredIfImpaired(nameof(HumanImmunodeficiencyVirusPresent), "1", ErrorMessage = "Please indicate")] + [RequiredIfImpaired(nameof(HumanImmunodeficiencyVirusPresent), true, ErrorMessage = "Indicate diagnosis for Human immunodeficiency virus (HIV).")] [Column("HIVIF")] public int? HumanImmunodeficiencyVirusDiagnosis { get; set; } @@ -769,7 +771,7 @@ public bool? OnlyOnePrimaryDiagnosisAllowed { [Column("OTHCOG")] public bool OtherCognitiveImpairmentPresent { get; set; } - [RequiredIfImpaired(nameof(OtherCognitiveImpairmentPresent), "1", ErrorMessage = "Please indicate")] + [RequiredIfImpaired(nameof(OtherCognitiveImpairmentPresent), true, ErrorMessage = "Indicate diagnosis for Other cognitive impairment.")] [Column("OTHCOGIF")] public int? OtherCognitiveImpairmentDiagnosis { get; set; } @@ -790,7 +792,7 @@ public bool? OnlyOnePrimaryDiagnosisAllowed { [Column("DEP")] public bool ActiveDepressionPresent { get; set; } - [RequiredIfImpaired(nameof(ActiveDepressionPresent), "1", ErrorMessage = "Please indicate")] + [RequiredIfImpaired(nameof(ActiveDepressionPresent), true, ErrorMessage = "Indicate diagnosis for Active depression.")] [Column("DEPIF")] public int? ActiveDepressionDiagnosis { get; set; } @@ -807,7 +809,7 @@ public bool? OnlyOnePrimaryDiagnosisAllowed { [Column("BIPOLDX")] public bool BipolarDisorderPresent { get; set; } - [RequiredIfImpaired(nameof(BipolarDisorderPresent), "1", ErrorMessage = "Please indicate")] + [RequiredIfImpaired(nameof(BipolarDisorderPresent), true, ErrorMessage = "Indicate diagnosis for Bipolar disorder.")] [Column("BIPOLDIF")] public int? BipolarDisorderDiagnosis { get; set; } @@ -815,7 +817,7 @@ public bool? OnlyOnePrimaryDiagnosisAllowed { [Column("SCHIZOP")] public bool SchizophreniaPresent { get; set; } - [RequiredIfImpaired(nameof(SchizophreniaPresent), "1", ErrorMessage = "Please indicate")] + [RequiredIfImpaired(nameof(SchizophreniaPresent), true, ErrorMessage = "Indicate diagnosis for Schizophrenia or other psychosis.")] [Column("SCHIZOIF")] public int? SchizophreniaDiagnosis { get; set; } @@ -823,7 +825,7 @@ public bool? OnlyOnePrimaryDiagnosisAllowed { [Column("ANXIET")] public bool AnxietyDisorderPresent { get; set; } - [RequiredIfImpaired(nameof(AnxietyDisorderPresent), "1", ErrorMessage = "Please indicate")] + [RequiredIfImpaired(nameof(AnxietyDisorderPresent), true, ErrorMessage = "Indicate diagnosis for Anxiety disorder.")] [Column("ANXIETIF")] public int? AnxietyDiagnosis { get; set; } @@ -831,7 +833,7 @@ public bool? OnlyOnePrimaryDiagnosisAllowed { [Column("DELIR")] public bool DeliriumPresent { get; set; } - [RequiredIfImpaired(nameof(DeliriumPresent), "1", ErrorMessage = "Please indicate")] + [RequiredIfImpaired(nameof(DeliriumPresent), true, ErrorMessage = "Indicate diagnosis for Delirium.")] [Column("DELIRIF")] public int? DeliriumDiagnosis { get; set; } @@ -839,7 +841,7 @@ public bool? OnlyOnePrimaryDiagnosisAllowed { [Column("PTSDDX")] public bool PostTraumaticStressDisorderPresent { get; set; } - [RequiredIfImpaired(nameof(PostTraumaticStressDisorderPresent), "1", ErrorMessage = "Please indicate")] + [RequiredIfImpaired(nameof(PostTraumaticStressDisorderPresent), true, ErrorMessage = "Indicate diagnosis for Post-traumatic stress disorder (PTSD).")] [Column("PTSDDXIF")] public int? PostTraumaticStressDisorderDiagnosis { get; set; } @@ -847,7 +849,7 @@ public bool? OnlyOnePrimaryDiagnosisAllowed { [Column("OTHPSY")] public bool OtherPsychiatricDiseasePresent { get; set; } - [RequiredIfImpaired(nameof(OtherPsychiatricDiseasePresent), "1", ErrorMessage = "Please indicate")] + [RequiredIfImpaired(nameof(OtherPsychiatricDiseasePresent), true, ErrorMessage = "Indicate diagnosis for Other psychiatric disease.")] [Column("OTHPSYIF")] public int? OtherPsychiatricDiseaseDiagnosis { get; set; } @@ -861,10 +863,11 @@ public bool? OnlyOnePrimaryDiagnosisAllowed { [Column("ALCDEM")] public bool AlcoholAbuse { get; set; } - [RequiredIfImpaired(nameof(AlcoholAbuse), "1", ErrorMessage = "Please indicate")] + [RequiredIfImpaired(nameof(AlcoholAbuse), true, ErrorMessage = "Indicate diagnosis for Cognitive impairment due to alcohol abuse.")] [Column("ALCDEMIF")] public int? AlcoholAbuseDiagnosis { get; set; } + [Display(Name = "Current alcohol abuse")] [RequiredIf(nameof(AlcoholAbuse), true, ErrorMessage = "Please indicate")] [Column("ALCABUSE")] public int? CurrentAlcoholAbuse { get; set; } @@ -873,7 +876,7 @@ public bool? OnlyOnePrimaryDiagnosisAllowed { [Column("IMPSUB")] public bool SubstanceAbuse { get; set; } - [RequiredIfImpaired(nameof(SubstanceAbuse), "1", ErrorMessage = "Please indicate")] + [RequiredIfImpaired(nameof(SubstanceAbuse), true, ErrorMessage = "Indicate diagnosis for Cognitive impairment due to other substance abuse.")] [Column("IMPSUBIF")] public int? SubstanceAbuseDiagnosis { get; set; } @@ -881,7 +884,7 @@ public bool? OnlyOnePrimaryDiagnosisAllowed { [Column("DYSILL")] public bool SystemicDisease { get; set; } - [RequiredIfImpaired(nameof(SystemicDisease), "1", ErrorMessage = "Please indicate")] + [RequiredIfImpaired(nameof(SystemicDisease), true, ErrorMessage = "Indicate diagnosis for Cognitive impairment due to systemic disease/medical illness (as indicated on Form D2).")] [Column("DYSILLIF")] public int? SystemicDiseaseDiagnosis { get; set; } @@ -889,7 +892,7 @@ public bool? OnlyOnePrimaryDiagnosisAllowed { [Column("MEDS")] public bool Medications { get; set; } - [RequiredIfImpaired(nameof(Medications), "1", ErrorMessage = "Please indicate")] + [RequiredIfImpaired(nameof(Medications), true, ErrorMessage = "Indicate diagnosis for Cognitive impairment due to medications.")] [Column("MEDSIF")] public int? MedicationsDiagnosis { get; set; } @@ -897,7 +900,7 @@ public bool? OnlyOnePrimaryDiagnosisAllowed { [Column("COGOTH")] public bool NOS1 { get; set; } - [RequiredIfImpaired(nameof(NOS1), "1", ErrorMessage = "Please indicate")] + [RequiredIfImpaired(nameof(NOS1), true, ErrorMessage = "Indicate diagnosis for Cognitive impairment NOS.")] [Column("COGOTHIF")] public int? NOS1Diagnosis { get; set; } @@ -911,7 +914,7 @@ public bool? OnlyOnePrimaryDiagnosisAllowed { [Column("COGOTH2")] public bool NOS2 { get; set; } - [RequiredIfImpaired(nameof(NOS2), "1", ErrorMessage = "Please indicate")] + [RequiredIfImpaired(nameof(NOS2), true, ErrorMessage = "Indicate diagnosis for Cognitive impairment NOS.")] [Column("COGOTH2F")] public int? NOS2Diagnosis { get; set; } @@ -925,7 +928,7 @@ public bool? OnlyOnePrimaryDiagnosisAllowed { [Column("COGOTH3")] public bool NOS3 { get; set; } - [RequiredIfImpaired(nameof(NOS3), "1", ErrorMessage = "Please indicate")] + [RequiredIfImpaired(nameof(NOS3), true, ErrorMessage = "Indicate diagnosis for Cognitive impairment NOS.")] [Column("COGOTH3F")] public int? NOS3Diagnosis { get; set; } diff --git a/src/UDS.Net.Data/Entities/D2_MedicalConditions.cs b/src/UDS.Net.Data/Entities/D2_MedicalConditions.cs index 6708238..f4663a4 100644 --- a/src/UDS.Net.Data/Entities/D2_MedicalConditions.cs +++ b/src/UDS.Net.Data/Entities/D2_MedicalConditions.cs @@ -1,7 +1,7 @@ using System; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -using COA.Components.Web.DataAnnotations; +using UDS.Net.Data.DataAnnotations; using UDS.Net.Data.Enums; namespace UDS.Net.Data.Entities diff --git a/src/UDS.Net.Data/Entities/M1_Milestone.cs b/src/UDS.Net.Data/Entities/M1_Milestone.cs index ccdf88a..99d2e8a 100644 --- a/src/UDS.Net.Data/Entities/M1_Milestone.cs +++ b/src/UDS.Net.Data/Entities/M1_Milestone.cs @@ -1,7 +1,7 @@ using System; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -using COA.Components.Web.DataAnnotations; +using UDS.Net.Data.DataAnnotations; using UDS.Net.Data.Enums; namespace UDS.Net.Data.Entities diff --git a/src/UDS.Net.Data/Entities/MedicationReference.cs b/src/UDS.Net.Data/Entities/MedicationReference.cs index 8e50a9b..e94ec1a 100644 --- a/src/UDS.Net.Data/Entities/MedicationReference.cs +++ b/src/UDS.Net.Data/Entities/MedicationReference.cs @@ -1,7 +1,7 @@ using System; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -using COA.Components.Web.DataAnnotations; +using UDS.Net.Data.DataAnnotations; namespace UDS.Net.Data.Entities { diff --git a/src/UDS.Net.Data/Entities/T1_TFP_Inclusion.cs b/src/UDS.Net.Data/Entities/T1_TFP_Inclusion.cs index 772e288..5ee3e1f 100644 --- a/src/UDS.Net.Data/Entities/T1_TFP_Inclusion.cs +++ b/src/UDS.Net.Data/Entities/T1_TFP_Inclusion.cs @@ -1,7 +1,7 @@ using System; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -using COA.Components.Web.DataAnnotations; +using UDS.Net.Data.DataAnnotations; using UDS.Net.Data.Enums; namespace UDS.Net.Data.Entities diff --git a/src/UDS.Net.Data/Entities/Z1_Checklist.cs b/src/UDS.Net.Data/Entities/Z1_Checklist.cs index 8ff23cd..adf6d5a 100644 --- a/src/UDS.Net.Data/Entities/Z1_Checklist.cs +++ b/src/UDS.Net.Data/Entities/Z1_Checklist.cs @@ -1,7 +1,7 @@ using System; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -using COA.Components.Web.DataAnnotations; +using UDS.Net.Data.DataAnnotations; using UDS.Net.Data.Enums; namespace UDS.Net.Data.Entities diff --git a/src/UDS.Net.Data/UDS.Net.Data.csproj b/src/UDS.Net.Data/UDS.Net.Data.csproj index 9894081..bc13a2e 100644 --- a/src/UDS.Net.Data/UDS.Net.Data.csproj +++ b/src/UDS.Net.Data/UDS.Net.Data.csproj @@ -8,14 +8,12 @@ ..\Assemblies\COA.Studies.Domain.dll - - ..\Assemblies\COA.Components.Web.dll - + @@ -24,6 +22,7 @@ + diff --git a/src/UDS.Net.Web/Controllers/SubjectFamilyHistoryController.cs b/src/UDS.Net.Web/Controllers/SubjectFamilyHistoryController.cs index 75b9b55..3be85cd 100644 --- a/src/UDS.Net.Web/Controllers/SubjectFamilyHistoryController.cs +++ b/src/UDS.Net.Web/Controllers/SubjectFamilyHistoryController.cs @@ -207,6 +207,13 @@ public async Task Edit(int id, SubjectFamilyHistory subjectFamily { ModelState.AddModelError(String.Format("Relatives[{0}].AgeAtDeath", relativeIndex), "Please provide an age at death or indicate otherwise"); } + if(relative.BirthMonth.HasValue || relative.BirthYear.HasValue || relative.AgeAtDeath.HasValue) + { + if(!relative.PrimaryNeurologicalProblemPsychiatricCondition.HasValue) + { + ModelState.AddModelError(String.Format("Relatives[{0}].PrimaryNeurologicalProblemPsychiatricCondition", relativeIndex), "Please provide a value for Primary neurological problem/psychiatric condition"); + } + } if (relative.PrimaryNeurologicalProblemPsychiatricCondition.HasValue) { var codeExists = _neurologicalProblems.Codes.Where(x => int.Parse(x.Key) == relative.PrimaryNeurologicalProblemPsychiatricCondition).Any(); From 1cf8434faee0af19b15bfddbcd0766f559e2aedf Mon Sep 17 00:00:00 2001 From: Casey D Spires <11319139+casey-spires@users.noreply.github.com> Date: Wed, 3 Aug 2022 15:48:00 -0400 Subject: [PATCH 15/30] Adds cascading disable for A1 and A2 forms Adds cascading disable for A1 and A2 forms for race related questions. If one option is selected then subsequent options will be disabled to prevent form submission errors. --- .../CoParticipantDemographics/Edit.cshtml | 51 +++++------ .../CoParticipantDemographics/EditFVP.cshtml | 51 +++++------ .../Views/ParticipantDemographics/Edit.cshtml | 2 + .../_InitialVisitEthnicity.cshtml | 44 +++++----- .../js/CoParticipantDemographics/Edit.js | 64 +++++++++++++- .../wwwroot/js/ManualValueAssign.js | 2 +- .../js/ParticipantDemographics/Edit.js | 59 +++++++++++++ .../js/SubsequentRadioControlDisable.js | 87 +++++++++++++++++++ 8 files changed, 284 insertions(+), 76 deletions(-) create mode 100644 src/UDS.Net.Web/wwwroot/js/ParticipantDemographics/Edit.js create mode 100644 src/UDS.Net.Web/wwwroot/js/SubsequentRadioControlDisable.js diff --git a/src/UDS.Net.Web/Views/CoParticipantDemographics/Edit.cshtml b/src/UDS.Net.Web/Views/CoParticipantDemographics/Edit.cshtml index f1443b5..189d3fe 100644 --- a/src/UDS.Net.Web/Views/CoParticipantDemographics/Edit.cshtml +++ b/src/UDS.Net.Web/Views/CoParticipantDemographics/Edit.cshtml @@ -74,7 +74,7 @@
9 - +
- 1 + 1
- 2 + 2
- 3 + 3
- 4 + 4
- 5 + 5
- 50 + 50
- 99 - + 99 +
- 1 + 1
- 2 + 2
- 3 + 3
- 4 + 4
- 5 + 5
- 50 + 50
- 88 + 88
- 99 + 99
- 1 + 1
- 2 + 2
- 3 + 3
- 4 + 4
- 5 + 5
- 50 + 50
- 88 + 88
- 99 + 99
- 1 + 1
- 2 + 2
- 3 + 3
- 4 + 4
- 5 + 5
- 50 + 50
- 99 - + 99 +
- 1 + 1
- 2 + 2
- 3 + 3
- 4 + 4
- 5 + 5
- 50 + 50
- 88 + 88
- 99 + 99
- 1 + 1
- 2 + 2
- 3 + 3
- 4 + 4
- 5 + 5
- 50 + 50
- 88 + 88
- 99 + 99
- +
- +
- +
- +
- +
- +
@@ -137,7 +137,7 @@
- +
@@ -155,34 +155,34 @@
- +
- +
- +
- +
- +
- +
@@ -192,7 +192,7 @@
- +
@@ -215,34 +215,34 @@
- +
- +
- +
- +
- +
- +
@@ -253,12 +253,12 @@
- +
- +
diff --git a/src/UDS.Net.Web/wwwroot/js/CoParticipantDemographics/Edit.js b/src/UDS.Net.Web/wwwroot/js/CoParticipantDemographics/Edit.js index 75bb675..5240394 100644 --- a/src/UDS.Net.Web/wwwroot/js/CoParticipantDemographics/Edit.js +++ b/src/UDS.Net.Web/wwwroot/js/CoParticipantDemographics/Edit.js @@ -1,7 +1,65 @@ // With the FVP, if #3 is false, then force disable 4a even if 4 was previously 1 -$(function() { +/// +$(() => { + const radioConfig = [ + { + 'weight': 0, + 'name': 'Race', + 'hasOther': true, + 'otherEnableValue': 50, + 'disableExceptions': [50, 88, 99] + }, + { + 'weight': 1, + 'name': 'SecondaryRace', + 'hasOther': true, + 'otherEnableValue': 50, + 'disableExceptions': [50, 88, 99] + }, + { + 'weight': 2, + 'name': 'AdditionalRace', + 'hasOther': true, + 'otherEnableValue': 50, + 'disableExceptions': [50, 88, 99] + } + ]; + const subsequentRadioControl = new SubsequentRadioControlDisable(radioConfig); $('input[name="IsNewCoParticipant"]').on('change', () => { $('input[name="EthnicOrigins"]').prop('disabled', true) $('input[name="HispanicLatinoEthnicity"]').prop('checked', false) - }) -}) + }); + function disableAllRadioControlsExceptOne(controlNameToDisable, controlValueToEnable) { + $(`input[name=${controlNameToDisable}]`).toArray().forEach(currentControl => { + console.log(`Disabling control ${currentControl}`); + const currentRadioControl = $(currentControl) + const shouldDisableControl = currentRadioControl.val() != controlValueToEnable; + if(shouldDisableControl) { + currentRadioControl.prop('disabled', true); + } + }); + } + const race = $('input[name=Race]') + const secondaryRace = $('input[name=SecondaryRace]') + const secondaryRaceNotReported = $('input[name=SecondaryRace][value=88]'); + const additionalRaceNotReported = $('input[name=AdditionalRace][value=88]'); + race.on('change', (event) => { + const selectedRace = $(event.target); + if(selectedRace.val() == 99) { + secondaryRaceNotReported.prop('checked', true); + disableAllRadioControlsExceptOne(secondaryRaceNotReported.prop('name'), 88); + additionalRaceNotReported.prop('checked', true); + disableAllRadioControlsExceptOne(additionalRaceNotReported.prop('name'), 88); + } + }).trigger('change'); + secondaryRace.on('change', (event) => { + const selectedRace = $(event.target); + if(selectedRace.val() == 99) { + additionalRaceNotReported.prop('checked', true); + disableAllRadioControlsExceptOne(additionalRaceNotReported.prop('name'), 88); + }if(selectedRace.val() == 88) { + additionalRaceNotReported.prop('checked', true); + disableAllRadioControlsExceptOne(additionalRaceNotReported.prop('name'), 88); + } + }).trigger('change'); +}); diff --git a/src/UDS.Net.Web/wwwroot/js/ManualValueAssign.js b/src/UDS.Net.Web/wwwroot/js/ManualValueAssign.js index ce4260d..9c1f4de 100644 --- a/src/UDS.Net.Web/wwwroot/js/ManualValueAssign.js +++ b/src/UDS.Net.Web/wwwroot/js/ManualValueAssign.js @@ -1,5 +1,5 @@ /* -Docuementation +Documentation Step 1: Apply "data-assign-parent" to the input element you wish to use as the group parent (as of now, checkbox type inputs are only supported) diff --git a/src/UDS.Net.Web/wwwroot/js/ParticipantDemographics/Edit.js b/src/UDS.Net.Web/wwwroot/js/ParticipantDemographics/Edit.js new file mode 100644 index 0000000..9ddcf32 --- /dev/null +++ b/src/UDS.Net.Web/wwwroot/js/ParticipantDemographics/Edit.js @@ -0,0 +1,59 @@ +$(() => { + const radioConfig = [ + { + 'weight': 0, + 'name': 'Race', + 'hasOther': true, + 'otherEnableValue': 50, + 'disableExceptions': [50, 88, 99] + }, + { + 'weight': 1, + 'name': 'SecondaryRace', + 'hasOther': true, + 'otherEnableValue': 50, + 'disableExceptions': [50, 88, 99] + }, + { + 'weight': 2, + 'name': 'AdditionalRace', + 'hasOther': true, + 'otherEnableValue': 50, + 'disableExceptions': [50, 88, 99] + } + ] + new SubsequentRadioControlDisable(radioConfig); + const race = $('input[name=Race]') + const secondaryRace = $('input[name=SecondaryRace]') + const secondaryRaceNotReported = $('input[name=SecondaryRace][value=88]'); + const additionalRaceNotReported = $('input[name=AdditionalRace][value=88]'); + function disableAllRadioControlsExceptOne(controlNameToDisable, controlValueToEnable) { + $(`input[name=${controlNameToDisable}]`).toArray().forEach(currentControl => { + console.log(`Disabling control ${currentControl}`); + const currentRadioControl = $(currentControl) + const shouldDisableControl = currentRadioControl.val() != controlValueToEnable; + if(shouldDisableControl) { + currentRadioControl.prop('disabled', true); + } + }); + } + race.on('change', (event) => { + const selectedRace = $(event.target); + if(selectedRace.val() == 99) { + secondaryRaceNotReported.prop('checked', true); + disableAllRadioControlsExceptOne(secondaryRaceNotReported.prop('name'), 88); + additionalRaceNotReported.prop('checked', true); + disableAllRadioControlsExceptOne(additionalRaceNotReported.prop('name'), 88); + } + }).trigger('change'); + secondaryRace.on('change', (event) => { + const selectedRace = $(event.target); + if(selectedRace.val() == 99) { + additionalRaceNotReported.prop('checked', true); + disableAllRadioControlsExceptOne(additionalRaceNotReported.prop('name'), 88); + }if(selectedRace.val() == 88) { + additionalRaceNotReported.prop('checked', true); + disableAllRadioControlsExceptOne(additionalRaceNotReported.prop('name'), 88); + } + }).trigger('change'); +}); \ No newline at end of file diff --git a/src/UDS.Net.Web/wwwroot/js/SubsequentRadioControlDisable.js b/src/UDS.Net.Web/wwwroot/js/SubsequentRadioControlDisable.js new file mode 100644 index 0000000..c05b113 --- /dev/null +++ b/src/UDS.Net.Web/wwwroot/js/SubsequentRadioControlDisable.js @@ -0,0 +1,87 @@ +class SubsequentRadioControlDisable { + _radioControlConfiguration = []; + _numberOfControls; + constructor(radioConfiguration) { + this._radioControlConfiguration = radioConfiguration; + this._numberOfControls = radioConfiguration.length; + this.runRadioDisable(); + this.setupWatchForRadioButtons(); + + } + getRadioConfig(controlName) { + return this._radioControlConfiguration.filter(x => x.name == controlName)[0]; + } + disableRadioOption(controlName, value) { + const controlToDisable = $(`input[name=${controlName}][type='radio'][value=${value}]`); + controlToDisable.prop('disabled', true); + } + resetPreviouslyDisabledRadioGroup(controlName) { + const radioGroupEnable = $(`input[name=${controlName}][type='radio']:disabled`).toArray(); + radioGroupEnable.forEach(x => $(x).prop('disabled', false)); + } + getCheckedRadioValue(controlName) { + return $(`input[name=${controlName}]:checked`).val() + } + setOtherTextDisableState(controlName, disabled) { + const textBox = $(`input[name=${controlName}Other]`); + textBox.prop('disabled', disabled); + } + getCurrentlyCheckedValue(controlName) { + const checkedControls = $(`input[name=${controlName}][type='radio']:checked`); + if(checkedControls.length > 0) { + return checkedControls[0].val(); + } + return -1; + } + runRadioDisable() { + const previouslyCheckedValues = []; + this._radioControlConfiguration.forEach(radioConfiguration => { + if(radioConfiguration.hasOther) { + const currentValue = this.getCheckedRadioValue(radioConfiguration.name); + const radioGroupHasACheckedValue = currentValue >= 0 + if(radioGroupHasACheckedValue) { + const otherTextBoxShouldBeEnabled = currentValue == radioConfiguration.otherEnableValue + if(otherTextBoxShouldBeEnabled) { + this.setOtherTextDisableState(radioConfiguration.name, false); + } else { + this.setOtherTextDisableState(radioConfiguration.name, true); + } + } + } + const isSubsequent = 0 < radioConfiguration.weight; + if(isSubsequent) { + this.resetPreviouslyDisabledRadioGroup(radioConfiguration.name); + previouslyCheckedValues.forEach(previouslyCheckedValue => { + const isOtherValue = radioConfiguration.hasOther && previouslyCheckedValue == radioConfiguration.otherEnableValue; + const isExceptionValue = radioConfiguration.disableExceptions.indexOf(+previouslyCheckedValue) > -1; + if(!isOtherValue && !isExceptionValue) { + this.disableRadioOption(radioConfiguration.name, previouslyCheckedValue); + } + }); + } + previouslyCheckedValues.push(this.getCheckedRadioValue(radioConfiguration.name)); + }); + } + setupWatchForRadioButtons() { + this._radioControlConfiguration.forEach(radioConfiguration => { + const radioControls = $(`input[name=${radioConfiguration.name}][type='radio']`).toArray(); + radioControls.forEach(control => { + $(control).on('change', (event) => { + const changedRadio = $(event.target) + if(changedRadio.is(':checked')) { + const changedRadioName = changedRadio.attr('name'); + const changedRadioConfig = this.getRadioConfig(changedRadioName); + const isNotTheLastControl = changedRadioConfig.weight < this._numberOfControls - 1; + const otherTextBoxShouldEnable = radioConfiguration.hasOther && changedRadio.val() == radioConfiguration.otherEnableValue + if(otherTextBoxShouldEnable) { + this.setOtherTextDisableState(changedRadioName, false); + } + if(isNotTheLastControl) { + this.runRadioDisable(); + } + } + }); + }); + }); + } +} \ No newline at end of file From bfb00619333140449f075c30d97c588665b10954 Mon Sep 17 00:00:00 2001 From: Casey D Spires <11319139+casey-spires@users.noreply.github.com> Date: Wed, 3 Aug 2022 16:13:40 -0400 Subject: [PATCH 16/30] Update standard global cdr to be required, also auto-calculates cdr Updates standard global cdr on the b4 to be required upon form completion. Also automatically calculates CDR for user based on NACC calculator for global cdr. --- .../Entities/B4_CDRPlusNACCFTLD.cs | 5 +- .../wwwroot/js/CDRPlusNACCFTLD/Edit.js | 63 +++++++++++++++---- 2 files changed, 55 insertions(+), 13 deletions(-) diff --git a/src/UDS.Net.Data/Entities/B4_CDRPlusNACCFTLD.cs b/src/UDS.Net.Data/Entities/B4_CDRPlusNACCFTLD.cs index 58a8195..dfb6a60 100644 --- a/src/UDS.Net.Data/Entities/B4_CDRPlusNACCFTLD.cs +++ b/src/UDS.Net.Data/Entities/B4_CDRPlusNACCFTLD.cs @@ -47,13 +47,14 @@ public class CDRPlusNACCFTLD: FormBase [Display(Name = "Standard Global CDR", GroupName ="Standard CDR")] [Range(0, 3, ErrorMessage = "Please provide a valid score")] [Column("CDRGLOB")] + [RequiredIf(nameof(FormStatus), FormStatus.Complete, ErrorMessage = "Please provide a score")] public double? StandardGlobalCDR {get;set;} - [Display(Name = "9. Behavior comportment and personality", GroupName ="Supplimental CDR")] + [Display(Name = "9. Behavior comportment and personality", GroupName ="Supplemental CDR")] [Range(0, 3, ErrorMessage = "Please provide a valid score")] [Column("COMPORT")] [RequiredIf(nameof(FormStatus), FormStatus.Complete, ErrorMessage="Please provide a score")] public double? BehaviorComportmentAndPersonality {get;set;} - [Display(Name = "10. Language", GroupName ="Supplimental CDR")] + [Display(Name = "10. Language", GroupName ="Supplemental CDR")] [Range(0, 3, ErrorMessage = "Please provide a valid score")] [Column("CDRLANG")] [RequiredIf(nameof(FormStatus), FormStatus.Complete, ErrorMessage="Please provide a score")] diff --git a/src/UDS.Net.Web/wwwroot/js/CDRPlusNACCFTLD/Edit.js b/src/UDS.Net.Web/wwwroot/js/CDRPlusNACCFTLD/Edit.js index e63b3be..f75f610 100644 --- a/src/UDS.Net.Web/wwwroot/js/CDRPlusNACCFTLD/Edit.js +++ b/src/UDS.Net.Web/wwwroot/js/CDRPlusNACCFTLD/Edit.js @@ -1,20 +1,61 @@ +/// $(function () { + const disableCDR = $(`input[name='StandardGlobalCDR']:unchecked`).prop('disabled', true); + function calculateGlobalCDR(memory, orientation, judgmentAndProblemSolving, communityAffairs, homeAndHobbies, personalCare) { + for (var l = [memory, orientation, judgmentAndProblemSolving, communityAffairs, homeAndHobbies, personalCare], s = 0, o = 0, c = 0, m = 0, u = 0, d = 0, k = 0, h = 0, p = 0, v = 0, g = 0, f = 0, E = 1; E < l.length; E++) + l[E] > memory && c++, + l[E] === memory && o++, + l[E] < memory && m++, + 0 === l[E] && u++, + .5 === l[E] && d++, + 1 === l[E] && k++, + 2 === l[E] && h++, + 3 === l[E] && p++; + if (o >= 3 ? s = memory : c + m >= 3 && Math.abs(c - m) > 1 && (u >= (v = 0) && 0 !== memory && (s = 0, v = u), d >= v && .5 !== memory && (s = .5, v = d), k >= v && 1 !== memory && (s = 1, v = k), h >= v && 2 !== memory && (s = 2, v = h), p >= v && 3 !== memory && (s = 3, v = p)), (3 === c && 2 === m || 2 === c && 3 === m) && (s = memory), .5 === memory) { + g = 0; + for (var N = 0; N < l.length; N++) + l[N] >= 1 && g++; + s = g >= 3 ? 1 : .5 + } + if (0 === memory) { + f = 0; + for (var b = 0; b < l.length; b++) + l[b] >= .5 && f++; + s = f >= 2 ? .5 : 0 + } + return 4 !== c && 4 !== m || !(2 === u && 2 === d || 2 === u && 2 === k || 2 === u && 2 === h || 2 === u && 2 === p || 2 === d && 2 === k || 2 === d && 2 === h || 2 === d && 2 === p || 2 === k && 2 === h || 2 === k && 2 === p || 2 === h && 2 === p) || (0 === memory && 2 === d ? s = .5 : 0 !== memory || 2 !== k || 2 !== h && 2 !== p ? 0 === memory && 2 === h && 2 === p ? s = 2 : .5 !== memory || 2 !== k || 2 !== h && 2 !== p ? .5 === memory && 2 === h && 2 === p || 1 === memory && 2 === h && 2 === p ? s = 2 : 1 === memory && 2 === u && 2 === d ? s = .5 : 2 !== memory || 2 !== k || 2 !== d && 2 !== u ? 2 === memory && 2 === k && 2 === d ? s = 1 : 3 !== memory || 2 !== h || 2 !== k && 2 !== d && 2 !== u ? 3 !== memory || 2 !== k || 2 !== d && 2 !== u ? 3 === memory && 2 === d && 2 === u && (s = .5) : s = 1 : s = 2 : s = 1 : s = 1 : s = 1), + 1 !== o && 2 !== o || c <= 2 && m <= 2 && (s = memory), + memory >= 1 && 0 === s && (s = .5), + s + } + function getRadioDoubleValue(controlName) { + const value = $(`input[name='${controlName}']:checked`).val() || 0; + return parseFloat(value); + }; $("input[type='radio']").on('change', () => { - var standardSum = 0; - var supplementalSum = 0; - + let standardSum = 0; + let supplementalSum = 0; $("input.standardSum[type='radio']:checked").each((index, element) => { standardSum += parseFloat($(element).val()); - }) - + }); $("input.supplementalSum[type='radio']:checked").each((index, element) => { supplementalSum += parseFloat($(element).val()); - }) + }); + $("input[name='StandardCDRSumOfBoxes']").val(standardSum); + $("input[name='SupplementalGlobalCDR']").val(standardSum + supplementalSum); + $("input[name='SupplementalCDRSumOfBoxes']").val(supplementalSum); + const memory = getRadioDoubleValue('Memory'); + const orientation = getRadioDoubleValue('Orientation'); + const judgmentAndProblemSolving = getRadioDoubleValue('JudgmentAndProblemSolving'); + const communityAffairs = getRadioDoubleValue('CommunityAffairs'); + const homeAndHobbies = getRadioDoubleValue('HomesAndHobbies'); + const personalCare = getRadioDoubleValue('PersonalCare'); + const globalCDR = calculateGlobalCDR(memory,orientation,judgmentAndProblemSolving, communityAffairs, homeAndHobbies, personalCare); + const calculatedCDROption = $(`input[name='StandardGlobalCDR'][value='${globalCDR}']`); + calculatedCDROption.prop('disabled', false); + calculatedCDROption.prop('checked', true); + $(`input[name='StandardGlobalCDR']:unchecked`).prop('disabled', true); - - $("input[name='StandardCDRSumOfBoxes']").val(standardSum) - $("input[name='SupplementalGlobalCDR']").val(standardSum + supplementalSum) - $("input[name='SupplementalCDRSumOfBoxes']").val(supplementalSum) }); -}) +}); From 837f7b739fca04b4e8c23ac373913c6344599eb5 Mon Sep 17 00:00:00 2001 From: mlan225 <17088502+mlan225@users.noreply.github.com> Date: Wed, 3 Aug 2022 16:49:55 -0400 Subject: [PATCH 17/30] Add additional conditions to b8 and fix front end bug The b8 requires at least one question to be answered in questions 2 - 8 if question 1 is recorded as (1). There was a small front end bug with a radio button that also got fixed up. --- .../B8_NeurologicalExaminationFindings.cs | 61 +++++++++++++++++++ .../Edit.cshtml | 4 +- 2 files changed, 63 insertions(+), 2 deletions(-) diff --git a/src/UDS.Net.Data/Entities/B8_NeurologicalExaminationFindings.cs b/src/UDS.Net.Data/Entities/B8_NeurologicalExaminationFindings.cs index 726b590..c91f8f8 100644 --- a/src/UDS.Net.Data/Entities/B8_NeurologicalExaminationFindings.cs +++ b/src/UDS.Net.Data/Entities/B8_NeurologicalExaminationFindings.cs @@ -153,5 +153,66 @@ public class NeurologicalExaminationFindings: FormBase [MaxLength(60)] public string OtherFindingsSpeicify {get;set;} + [NotMapped] + [RequiredIf(nameof(FormStatus), FormStatus.Complete, ErrorMessage = "Questions 2 - 8 should have at least 1 recorded sign if abnormal neurological exam findings were recorded to be consitent with questions 2 - 8 in question #1")] + public bool? GroupHasValue + { + get + { + if(AbnormalNeurologicalExamFindings == 1) + { + var valueCount = 0; + + if (ParkinsonianSigns.HasValue && ParkinsonianSigns.Value == true) + { + valueCount++; + } + + if(CerebrovascularDiseaseSigns.HasValue && CerebrovascularDiseaseSigns.Value == true) + { + valueCount++; + } + + if (CerebrovascularDiseaseSigns.HasValue && CerebrovascularDiseaseSigns.Value == true) + { + valueCount++; + } + + if (HigherCorticalVisual.HasValue && HigherCorticalVisual.Value == true) + { + valueCount++; + } + + if (GaitApraxia.HasValue && GaitApraxia.Value == true) + { + valueCount++; + } + + if (PSP.HasValue && PSP.Value == true) + { + valueCount++; + } + + if (ALS_Findings.HasValue && ALS_Findings.Value == true) + { + valueCount++; + } + + if (OtherFindings.HasValue && OtherFindings.Value == true) + { + valueCount++; + } + + if (valueCount > 0) + { + return true; + } + + return null; + } + + return true; + } + } } } \ No newline at end of file diff --git a/src/UDS.Net.Web/Views/NeurologicalExaminationFindings/Edit.cshtml b/src/UDS.Net.Web/Views/NeurologicalExaminationFindings/Edit.cshtml index 73f936e..311ad96 100644 --- a/src/UDS.Net.Web/Views/NeurologicalExaminationFindings/Edit.cshtml +++ b/src/UDS.Net.Web/Views/NeurologicalExaminationFindings/Edit.cshtml @@ -458,8 +458,8 @@
- - + +
From a11563c2933cd4fcdcc669d83802affbbc3caafb Mon Sep 17 00:00:00 2001 From: mlan225 <17088502+mlan225@users.noreply.github.com> Date: Thu, 4 Aug 2022 10:22:16 -0400 Subject: [PATCH 18/30] Create custom attribute and add additional attributes to props --- .../CurrentYearRangeAttribute.cs | 71 +++++++++++++++++++ .../Entities/A3_SubjectFamilyHistory.cs | 3 + src/UDS.Net.Data/Entities/Relative.cs | 9 ++- 3 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 src/UDS.Net.Data/DataAnnotations/CurrentYearRangeAttribute.cs diff --git a/src/UDS.Net.Data/DataAnnotations/CurrentYearRangeAttribute.cs b/src/UDS.Net.Data/DataAnnotations/CurrentYearRangeAttribute.cs new file mode 100644 index 0000000..ee31a03 --- /dev/null +++ b/src/UDS.Net.Data/DataAnnotations/CurrentYearRangeAttribute.cs @@ -0,0 +1,71 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; + +namespace UDS.Net.Data.DataAnnotations +{ + [AttributeUsage(AttributeTargets.Property, AllowMultiple = true)] + public class CurrentYearRangeAttribute : ValidationAttribute + { + private string PropertyName { get; set; } + private int YearMin; + private int YearMax; + private int YearUnknown; + + /// + /// Property when condition asserts true. + /// + /// + /// + public CurrentYearRangeAttribute(string propertyName, int yearMin, int yearUnknown) + { + PropertyName = propertyName; + YearMin = yearMin; + YearMax = DateTime.Now.Year; + YearUnknown = yearUnknown; + } + + public CurrentYearRangeAttribute(string ErrorMessage) + { + this.ErrorMessage = ErrorMessage; + } + + protected override ValidationResult IsValid(object propertyValue, ValidationContext propertyToValidate) + { + var instance = propertyToValidate.ObjectInstance; + var instanceType = instance.GetType(); + if(propertyValue is null) + { + return ValidationResult.Success; + } + + int? value = (int)propertyValue; + + + var formStatus = instanceType.GetProperty("FormStatus"); + if (formStatus != null) + { + var formStatusValue = formStatus.GetValue(instance, null); + if (formStatusValue.ToString() != "Complete") + { + return ValidationResult.Success; + } + } + + if (value >= 0) + { + if(value >= YearMin && value <= YearMax) return ValidationResult.Success; + + if(value == YearUnknown) return ValidationResult.Success; + + } else { + //the value was null, but the a3 form must allow null valid date inputs + return ValidationResult.Success; + } + + //Year was not matched with conditions and is not valid + return new ValidationResult(ErrorMessage); + } + } +} + diff --git a/src/UDS.Net.Data/Entities/A3_SubjectFamilyHistory.cs b/src/UDS.Net.Data/Entities/A3_SubjectFamilyHistory.cs index fe296da..cd51520 100644 --- a/src/UDS.Net.Data/Entities/A3_SubjectFamilyHistory.cs +++ b/src/UDS.Net.Data/Entities/A3_SubjectFamilyHistory.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using UDS.Net.Data.DataAnnotations; using UDS.Net.Data.Enums; @@ -67,12 +68,14 @@ public class SubjectFamilyHistory: FormBase [RequiredIf(nameof(FvpComplete), true, "Please indicate if there has been a change in mother or father information")] public int? ParentChange { get; set; } [Column("SIBS")] + [Range(0, 20, ErrorMessage = "Value must be within the valid range of 0 - 20")] [RequiredIf(nameof(IvpComplete), true, "Please indicate number of siblings 0 - 20")] public int? SiblingNumber { get; set; } [Column("NWINFSIB")] [RequiredIf(nameof(FvpComplete), true, "Please indicate if there has been a change in sibling information")] public int? SiblingChange { get; set; } [Column("KIDS")] + [Range(0, 15, ErrorMessage = "Value must be within the valid range of 0 - 15")] [RequiredIf(nameof(IvpComplete), true, "Please indicate number of children 0 - 15")] public int? ChildrenNumber { get; set; } [Column("NWINFKID")] diff --git a/src/UDS.Net.Data/Entities/Relative.cs b/src/UDS.Net.Data/Entities/Relative.cs index 161b829..f4290fe 100644 --- a/src/UDS.Net.Data/Entities/Relative.cs +++ b/src/UDS.Net.Data/Entities/Relative.cs @@ -1,6 +1,7 @@ using System; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using UDS.Net.Data.DataAnnotations; using UDS.Net.Data.Enums; namespace UDS.Net.Data.Entities @@ -14,12 +15,18 @@ public class Relative public int SubjectFamilyHistoryId { get; set; } public int RelationshipNumber { get; set; } public FamilyRelationship Relation { get; set; } - public int? BirthMonth { get; set; } + [Range(1, 99, ErrorMessage = "Value must be within the valid range of 1 - 12 or 99")] + [InvalidRange(nameof(BirthMonth), 13, 98, ErrorMessage = "Value must be within the valid range of 1 - 12 or 99")] + public int? BirthMonth { get; set; } [CurrentYearRange(nameof(BirthYear), 1875, 9999, ErrorMessage = "Value must be within the valid range of 1875 - current year or 9999")] public int? BirthYear { get; set; } + [Range(0, 999, ErrorMessage = "Value must be within the valid range of 0 - 110, 888, or 999")] + [InvalidRange(nameof(AgeAtDeath), 111, 887, ErrorMessage = "Value must be within the valid range of 0 - 110, 888, or 999")] + [InvalidRange(nameof(AgeAtDeath), 889, 998, ErrorMessage = "Value must be within the valid range of 0 - 110, 888, or 999")] public int? AgeAtDeath { get; set; } public int? PrimaryNeurologicalProblemPsychiatricCondition { get; set; } public int? PrimaryDx { get; set; } public int? MethodOfEvaluation { get; set; } + [InvalidRange(nameof(AgeOfOnSet), 111, 998, ErrorMessage = "Value must be within the valid range of 0 - 110 or 999")] public int? AgeOfOnSet { get; set; } public SubjectFamilyHistory SubjectFamilyHistory { get; set; } } From 51f3c2bfa06c8fe8087bdee4b662bff9c2b01bd4 Mon Sep 17 00:00:00 2001 From: mlan225 <17088502+mlan225@users.noreply.github.com> Date: Thu, 4 Aug 2022 10:58:23 -0400 Subject: [PATCH 19/30] Add radio options and additional previous value check Add option for "assessed at a previous visit" to some questions in follow up visits and add PredominantSymptom as an additional value to check the previous value of. --- .../Controllers/SymptomsController.cs | 1 + src/UDS.Net.Web/Views/Symptoms/Edit.cshtml | 68 +++++++++++++------ 2 files changed, 49 insertions(+), 20 deletions(-) diff --git a/src/UDS.Net.Web/Controllers/SymptomsController.cs b/src/UDS.Net.Web/Controllers/SymptomsController.cs index 218e158..e049342 100644 --- a/src/UDS.Net.Web/Controllers/SymptomsController.cs +++ b/src/UDS.Net.Web/Controllers/SymptomsController.cs @@ -118,6 +118,7 @@ public async Task Edit(int? id) CheckValue(previousForm, symptoms, "SuggestiveOfSclerosisAge", 777); CheckValue(previousForm, symptoms, "AssessmentOfSclerosisAge", 777); CheckValue(previousForm, symptoms, "PredominantDomain", 0); + CheckValue(previousForm, symptoms, "PredominantSymptom", 0); ViewBag.NonmatchingValues = _nonMatchingValues; ViewBag.VisitType = symptoms.Visit.VisitType; diff --git a/src/UDS.Net.Web/Views/Symptoms/Edit.cshtml b/src/UDS.Net.Web/Views/Symptoms/Edit.cshtml index fe58649..228ccc2 100644 --- a/src/UDS.Net.Web/Views/Symptoms/Edit.cshtml +++ b/src/UDS.Net.Web/Views/Symptoms/Edit.cshtml @@ -261,40 +261,59 @@
5. + @if (!isIVP) + { +
+

NOTE: Enter 0 if this information was provided on a previously submitted Form B9

+
+ } + @if (((ViewBag.NonmatchingValues as List).Where(x => x.Name == "PredominantSymptom").Any())) + { + @await Html.PartialAsync("_PreviousValueNotification", (ViewBag.NonmatchingValues as List).Where(x => x.Name == "PredominantSymptom").FirstOrDefault()); + } +
+
+ @if (!isIVP) + { +
+ + +
+ }
- +
- +
- +
- +
- +
- +
- +
- +
@@ -710,10 +729,13 @@
-
- - -
+ @if (!isIVP) + { +
+ + +
+ }
@@ -942,10 +964,13 @@
-
- - -
+ @if (!isIVP) + { +
+ + +
+ }
@@ -1182,10 +1207,13 @@
-
- - -
+ @if (!isIVP) + { +
+ + +
+ }
From f2d27be3f00ca3d85b82b8c6fca8f0d716c791da Mon Sep 17 00:00:00 2001 From: mlan225 <17088502+mlan225@users.noreply.github.com> Date: Thu, 4 Aug 2022 11:20:38 -0400 Subject: [PATCH 20/30] Add option for unknown for number of siblings and additional validation - Add option for "unknwon/adopted" to number of siblings. The value for this is 77 - text has been added to display this available option. - values 21 - 76 are invalid inputs --- .../Entities/A3_SubjectFamilyHistory.cs | 5 +- src/UDS.Net.Data/Entities/Relative.cs | 3 +- .../SubjectFamilyHistoryController.cs | 115 ++++++++++-------- .../Views/SubjectFamilyHistory/Edit.cshtml | 4 +- .../wwwroot/js/SubjectFamilyHistory/Edit.js | 22 +++- 5 files changed, 90 insertions(+), 59 deletions(-) diff --git a/src/UDS.Net.Data/Entities/A3_SubjectFamilyHistory.cs b/src/UDS.Net.Data/Entities/A3_SubjectFamilyHistory.cs index cd51520..5bbf71f 100644 --- a/src/UDS.Net.Data/Entities/A3_SubjectFamilyHistory.cs +++ b/src/UDS.Net.Data/Entities/A3_SubjectFamilyHistory.cs @@ -68,8 +68,9 @@ public class SubjectFamilyHistory: FormBase [RequiredIf(nameof(FvpComplete), true, "Please indicate if there has been a change in mother or father information")] public int? ParentChange { get; set; } [Column("SIBS")] - [Range(0, 20, ErrorMessage = "Value must be within the valid range of 0 - 20")] - [RequiredIf(nameof(IvpComplete), true, "Please indicate number of siblings 0 - 20")] + [Range(0, 77, ErrorMessage = "Value must be within the valid range of 0 - 20 or 77")] + [RequiredIf(nameof(IvpComplete), true, "Please indicate number of siblings 0 - 20 or 77")] + [InvalidRange(nameof(SiblingNumber), 21, 76, ErrorMessage = "Please indicate a valid number of siblings within range of 0 - 20 or 77")] public int? SiblingNumber { get; set; } [Column("NWINFSIB")] [RequiredIf(nameof(FvpComplete), true, "Please indicate if there has been a change in sibling information")] diff --git a/src/UDS.Net.Data/Entities/Relative.cs b/src/UDS.Net.Data/Entities/Relative.cs index f4290fe..4bb5d02 100644 --- a/src/UDS.Net.Data/Entities/Relative.cs +++ b/src/UDS.Net.Data/Entities/Relative.cs @@ -17,7 +17,8 @@ public class Relative public FamilyRelationship Relation { get; set; } [Range(1, 99, ErrorMessage = "Value must be within the valid range of 1 - 12 or 99")] [InvalidRange(nameof(BirthMonth), 13, 98, ErrorMessage = "Value must be within the valid range of 1 - 12 or 99")] - public int? BirthMonth { get; set; } [CurrentYearRange(nameof(BirthYear), 1875, 9999, ErrorMessage = "Value must be within the valid range of 1875 - current year or 9999")] + public int? BirthMonth { get; set; } + [CurrentYearRange(nameof(BirthYear), 1875, 9999, ErrorMessage = "Value must be within the valid range of 1875 - current year or 9999")] public int? BirthYear { get; set; } [Range(0, 999, ErrorMessage = "Value must be within the valid range of 0 - 110, 888, or 999")] [InvalidRange(nameof(AgeAtDeath), 111, 887, ErrorMessage = "Value must be within the valid range of 0 - 110, 888, or 999")] diff --git a/src/UDS.Net.Web/Controllers/SubjectFamilyHistoryController.cs b/src/UDS.Net.Web/Controllers/SubjectFamilyHistoryController.cs index 3be85cd..84c0e7e 100644 --- a/src/UDS.Net.Web/Controllers/SubjectFamilyHistoryController.cs +++ b/src/UDS.Net.Web/Controllers/SubjectFamilyHistoryController.cs @@ -195,72 +195,83 @@ public async Task Edit(int id, SubjectFamilyHistory subjectFamily if ((relative.Relation == FamilyRelationship.Father && subjectFamilyHistory.ParentChange == 1) || (relative.Relation == FamilyRelationship.Mother && subjectFamilyHistory.ParentChange == 1) || (relative.Relation == FamilyRelationship.Father && subjectFamilyHistory.ParentChange == 1) || (relative.Relation == FamilyRelationship.Child && subjectFamilyHistory.ChildrenChange == 1) || (relative.Relation == FamilyRelationship.Sibling && subjectFamilyHistory.SiblingChange == 1) || subjectFamilyHistory.Visit.VisitType == VisitType.IVP) { int relativeIndex = relatives.IndexOf(relative); - if (!relative.BirthMonth.HasValue) - { - ModelState.AddModelError(String.Format("Relatives[{0}].BirthMonth", relativeIndex), "Please provide a Birth Month or indicate otherwise"); - } - if (!relative.BirthYear.HasValue) - { - ModelState.AddModelError(String.Format("Relatives[{0}].BirthYear", relativeIndex), "Please provide a Birth Year indicate otherwise"); - } - if (!relative.AgeAtDeath.HasValue) - { - ModelState.AddModelError(String.Format("Relatives[{0}].AgeAtDeath", relativeIndex), "Please provide an age at death or indicate otherwise"); - } - if(relative.BirthMonth.HasValue || relative.BirthYear.HasValue || relative.AgeAtDeath.HasValue) + + var isAdoptedOrUnknown = subjectFamilyHistory.SiblingNumber == 77 && relative.Relation == FamilyRelationship.Sibling; + + if (isAdoptedOrUnknown) { - if(!relative.PrimaryNeurologicalProblemPsychiatricCondition.HasValue) + relativeIndex++; + } else { + if (!relative.BirthMonth.HasValue) { - ModelState.AddModelError(String.Format("Relatives[{0}].PrimaryNeurologicalProblemPsychiatricCondition", relativeIndex), "Please provide a value for Primary neurological problem/psychiatric condition"); + ModelState.AddModelError(String.Format("Relatives[{0}].BirthMonth", relativeIndex), "Please provide a Birth Month or indicate otherwise"); } - } - if (relative.PrimaryNeurologicalProblemPsychiatricCondition.HasValue) - { - var codeExists = _neurologicalProblems.Codes.Where(x => int.Parse(x.Key) == relative.PrimaryNeurologicalProblemPsychiatricCondition).Any(); - if(!codeExists) { - ModelState.AddModelError(String.Format("Relatives[{0}].PrimaryNeurologicalProblemPsychiatricCondition", relativeIndex), "Please enter a valid code"); - } - } - if (relative.PrimaryDx.HasValue) - { - var codeExists = _primaryDiagnosis.Codes.Where(x => int.Parse(x.Key) == relative.PrimaryDx).Any(); - if (!codeExists) + if (!relative.BirthYear.HasValue) { - ModelState.AddModelError(String.Format("Relatives[{0}].PrimaryDx", relativeIndex), "Please enter a valid code, refer to APPENDIX 1"); + ModelState.AddModelError(String.Format("Relatives[{0}].BirthYear", relativeIndex), "Please provide a Birth Year indicate otherwise"); } - } - if (relative.MethodOfEvaluation.HasValue) - { - var codeExists = _methodOfEvaluation.Codes.Where(x => int.Parse(x.Key) == relative.MethodOfEvaluation).Any(); - if (!codeExists) + if (!relative.AgeAtDeath.HasValue) { - ModelState.AddModelError(String.Format("Relatives[{0}].MethodOfEvaluation", relativeIndex), "Please enter a valid code"); + ModelState.AddModelError(String.Format("Relatives[{0}].AgeAtDeath", relativeIndex), "Please provide an age at death or indicate otherwise"); } + if (relative.BirthMonth.HasValue || relative.BirthYear.HasValue || relative.AgeAtDeath.HasValue) + { + if (!relative.PrimaryNeurologicalProblemPsychiatricCondition.HasValue) + { + ModelState.AddModelError(String.Format("Relatives[{0}].PrimaryNeurologicalProblemPsychiatricCondition", relativeIndex), "Please provide a value for Primary neurological problem/psychiatric condition"); + } + } + if (relative.PrimaryNeurologicalProblemPsychiatricCondition.HasValue) + { + var codeExists = _neurologicalProblems.Codes.Where(x => int.Parse(x.Key) == relative.PrimaryNeurologicalProblemPsychiatricCondition).Any(); + if (!codeExists) + { + ModelState.AddModelError(String.Format("Relatives[{0}].PrimaryNeurologicalProblemPsychiatricCondition", relativeIndex), "Please enter a valid code"); + } + } + if (relative.PrimaryDx.HasValue) + { + var codeExists = _primaryDiagnosis.Codes.Where(x => int.Parse(x.Key) == relative.PrimaryDx).Any(); + if (!codeExists) + { + ModelState.AddModelError(String.Format("Relatives[{0}].PrimaryDx", relativeIndex), "Please enter a valid code, refer to APPENDIX 1"); + } + } + if (relative.MethodOfEvaluation.HasValue) + { + var codeExists = _methodOfEvaluation.Codes.Where(x => int.Parse(x.Key) == relative.MethodOfEvaluation).Any(); + if (!codeExists) + { + ModelState.AddModelError(String.Format("Relatives[{0}].MethodOfEvaluation", relativeIndex), "Please enter a valid code"); + } - if(relative.PrimaryDx.HasValue && relative.PrimaryDx.Value == 999) { - int[] invalidMethodsOfEvaluation = {1,2,3}; + if (relative.PrimaryDx.HasValue && relative.PrimaryDx.Value == 999) + { + int[] invalidMethodsOfEvaluation = { 1, 2, 3 }; - if(Array.Exists(invalidMethodsOfEvaluation, method => method == relative.MethodOfEvaluation.Value)) { - ModelState.AddModelError(String.Format("Relatives[{0}].MethodOfEvaluation", relativeIndex), "If Primary Dx is 999, the method of evaluation cannot be 1, 2, or 3"); + if (Array.Exists(invalidMethodsOfEvaluation, method => method == relative.MethodOfEvaluation.Value)) + { + ModelState.AddModelError(String.Format("Relatives[{0}].MethodOfEvaluation", relativeIndex), "If Primary Dx is 999, the method of evaluation cannot be 1, 2, or 3"); + } } } - } - bool hasNeurologicalProblemPsycyiatricCondition = relative.PrimaryNeurologicalProblemPsychiatricCondition.HasValue && relative.PrimaryNeurologicalProblemPsychiatricCondition.Value != 8 && relative.PrimaryNeurologicalProblemPsychiatricCondition.Value != 9; + bool hasNeurologicalProblemPsycyiatricCondition = relative.PrimaryNeurologicalProblemPsychiatricCondition.HasValue && relative.PrimaryNeurologicalProblemPsychiatricCondition.Value != 8 && relative.PrimaryNeurologicalProblemPsychiatricCondition.Value != 9; - if (!relative.PrimaryDx.HasValue && hasNeurologicalProblemPsycyiatricCondition) - { - ModelState.AddModelError(String.Format("Relatives[{0}].PrimaryDx", relativeIndex), "Please provide a Primary Dx, refer to the codes in APPENDIX 1"); - } - if (!relative.MethodOfEvaluation.HasValue && hasNeurologicalProblemPsycyiatricCondition) - { - ModelState.AddModelError(String.Format("Relatives[{0}].MethodOfEvaluation", relativeIndex), "Please provide a method of evaluation, refer to the codes below"); - } - if (!relative.AgeOfOnSet.HasValue && hasNeurologicalProblemPsycyiatricCondition) - { - ModelState.AddModelError(String.Format("Relatives[{0}].AgeOfOnSet", relativeIndex), "Please provide the age of onset"); + if (!relative.PrimaryDx.HasValue && hasNeurologicalProblemPsycyiatricCondition) + { + ModelState.AddModelError(String.Format("Relatives[{0}].PrimaryDx", relativeIndex), "Please provide a Primary Dx, refer to the codes in APPENDIX 1"); + } + if (!relative.MethodOfEvaluation.HasValue && hasNeurologicalProblemPsycyiatricCondition) + { + ModelState.AddModelError(String.Format("Relatives[{0}].MethodOfEvaluation", relativeIndex), "Please provide a method of evaluation, refer to the codes below"); + } + if (!relative.AgeOfOnSet.HasValue && hasNeurologicalProblemPsycyiatricCondition) + { + ModelState.AddModelError(String.Format("Relatives[{0}].AgeOfOnSet", relativeIndex), "Please provide the age of onset"); + } + relativeIndex++; } - relativeIndex++; } } } diff --git a/src/UDS.Net.Web/Views/SubjectFamilyHistory/Edit.cshtml b/src/UDS.Net.Web/Views/SubjectFamilyHistory/Edit.cshtml index 54dc216..27ade90 100644 --- a/src/UDS.Net.Web/Views/SubjectFamilyHistory/Edit.cshtml +++ b/src/UDS.Net.Web/Views/SubjectFamilyHistory/Edit.cshtml @@ -544,8 +544,8 @@ Model.Visit.Participant.Id,
@if (Model.Visit.VisitType == VisitType.IVP) diff --git a/src/UDS.Net.Web/wwwroot/js/SubjectFamilyHistory/Edit.js b/src/UDS.Net.Web/wwwroot/js/SubjectFamilyHistory/Edit.js index b5f75d0..69700be 100644 --- a/src/UDS.Net.Web/wwwroot/js/SubjectFamilyHistory/Edit.js +++ b/src/UDS.Net.Web/wwwroot/js/SubjectFamilyHistory/Edit.js @@ -11,14 +11,20 @@ Initialize() { const totalRowCount = this.GetRowCount(); if(this._tablePrefix != 'Parent') { - const disableStart = parseInt(this._enabledRows) + 1; + var disableStart = parseInt(this._enabledRows) + 1; + + disableStart = this.CheckForUnknownOrAdopted(this._enabledRows, this._tablePrefix); + for(let i = disableStart; i <= totalRowCount; i++) { this.ReadOnlyRow(i); } // Setup Relationship Watch let disableTask; $(`input[name=${this._tablePrefix}Number`).on('keyup', (event) => { - const newStart = $(event.target).val() ? (parseInt($(event.target).val()) + 1) : 0; + var newStart = $(event.target).val() ? (parseInt($(event.target).val()) + 1) : 0; + + newStart = this.CheckForUnknownOrAdopted($(event.target).val(), this._tablePrefix); + clearTimeout(disableTask); disableTask = setTimeout(() => { if(newStart >= 0) { @@ -123,6 +129,18 @@ } }); } + + CheckForUnknownOrAdopted(inputValue, tablePrefix) { + if (tablePrefix == "Sibling") { + if (inputValue == 77) { + return 0; + } + } + + //Needs to return + 1 to value to match value to row + return parseInt(inputValue) + 1; + } + } class SubjectFamilyHistory { Initialize() { From 496a67e3b6a18f6cbc1fbf947256dd3371093f81 Mon Sep 17 00:00:00 2001 From: mlan225 <17088502+mlan225@users.noreply.github.com> Date: Tue, 9 Aug 2022 11:54:13 -0400 Subject: [PATCH 21/30] Add range validation to a3 and include b8 adjustments --- .../B8_NeurologicalExaminationFindings.cs | 24 +++++++++---------- src/UDS.Net.Data/Entities/Relative.cs | 1 + .../Edit.cshtml | 3 +++ 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/src/UDS.Net.Data/Entities/B8_NeurologicalExaminationFindings.cs b/src/UDS.Net.Data/Entities/B8_NeurologicalExaminationFindings.cs index c91f8f8..9bb353b 100644 --- a/src/UDS.Net.Data/Entities/B8_NeurologicalExaminationFindings.cs +++ b/src/UDS.Net.Data/Entities/B8_NeurologicalExaminationFindings.cs @@ -154,56 +154,56 @@ public class NeurologicalExaminationFindings: FormBase public string OtherFindingsSpeicify {get;set;} [NotMapped] - [RequiredIf(nameof(FormStatus), FormStatus.Complete, ErrorMessage = "Questions 2 - 8 should have at least 1 recorded sign if abnormal neurological exam findings were recorded to be consitent with questions 2 - 8 in question #1")] - public bool? GroupHasValue + [RequiredIf(nameof(FormStatus), FormStatus.Complete, ErrorMessage = "Indicate at least one finding/syndrome that were consistent with the abnormal neurological exam (Yes to at least one in Questions 2-8)")] + public bool? AtLeastOneFindingSyndromeIndicated { get { if(AbnormalNeurologicalExamFindings == 1) { - var valueCount = 0; + int count = 0; if (ParkinsonianSigns.HasValue && ParkinsonianSigns.Value == true) { - valueCount++; + count++; } if(CerebrovascularDiseaseSigns.HasValue && CerebrovascularDiseaseSigns.Value == true) { - valueCount++; + count++; } if (CerebrovascularDiseaseSigns.HasValue && CerebrovascularDiseaseSigns.Value == true) { - valueCount++; + count++; } if (HigherCorticalVisual.HasValue && HigherCorticalVisual.Value == true) { - valueCount++; + count++; } if (GaitApraxia.HasValue && GaitApraxia.Value == true) { - valueCount++; + count++; } if (PSP.HasValue && PSP.Value == true) { - valueCount++; + count++; } if (ALS_Findings.HasValue && ALS_Findings.Value == true) { - valueCount++; + count++; } if (OtherFindings.HasValue && OtherFindings.Value == true) { - valueCount++; + count++; } - if (valueCount > 0) + if (count > 0) { return true; } diff --git a/src/UDS.Net.Data/Entities/Relative.cs b/src/UDS.Net.Data/Entities/Relative.cs index 4bb5d02..b9644a9 100644 --- a/src/UDS.Net.Data/Entities/Relative.cs +++ b/src/UDS.Net.Data/Entities/Relative.cs @@ -28,6 +28,7 @@ public class Relative public int? PrimaryDx { get; set; } public int? MethodOfEvaluation { get; set; } [InvalidRange(nameof(AgeOfOnSet), 111, 998, ErrorMessage = "Value must be within the valid range of 0 - 110 or 999")] + [Range(0, 999, ErrorMessage = "Value must be within the valid range of 0 - 110 or 999")] public int? AgeOfOnSet { get; set; } public SubjectFamilyHistory SubjectFamilyHistory { get; set; } } diff --git a/src/UDS.Net.Web/Views/NeurologicalExaminationFindings/Edit.cshtml b/src/UDS.Net.Web/Views/NeurologicalExaminationFindings/Edit.cshtml index 311ad96..9a263a4 100644 --- a/src/UDS.Net.Web/Views/NeurologicalExaminationFindings/Edit.cshtml +++ b/src/UDS.Net.Web/Views/NeurologicalExaminationFindings/Edit.cshtml @@ -58,6 +58,9 @@
Please complete the appropriate sections below, using your best clinical judgment in selecting findings that indicate the likely syndrome(s) that is/are present. +
+ +
-
- 1 - +
+ +
-
- 2 - +
+ +
-
- 0 - +
+ +
-
- 1 - +
+ +
-
- 9 - +
+ +
-
- 1 - +
+ +
-
- 2 - +
+ +
-
- 3 - +
+ +
-
- 4 - +
+ +
-
- 5 - +
+ +
-
- 6 - +
+ +
-
- 50 - +
+ +
-
- 99 - +
+ +
-
- 1 - +
+ +
-
- 2 - +
+ +
-
- 3 - +
+ +
-
- 4 - +
+ +
-
- 5 - +
+ +
-
- 50 - +
+ +
-
- 99 - +
+ +
-
- 1 - +
+ +
-
- 2 - +
+ +
-
- 3 - +
+ +
-
- 4 - +
+ +
-
- 5 - +
+ +
-
- 50 - +
+ +
-
- 88 - +
+ +
-
- 99 - +
+ +
-
- 1 - +
+ +
-
- 2 - +
+ +
-
- 3 - +
+ +
-
- 4 - +
+ +
-
- 5 - +
+ +
-
- 50 - +
+ +
-
- 88 - +
+ +
-
- 99 - +
+ +
-
-
- 1 -
-
- -
+
+ +
-
-
- 2 -
-
- -
+
+ +
-
-
- 3 -
-
- -
+
+ +
-
-
- 4 -
-
- -
+
+ +
-
-
- 5 -
-
- -
+
+ +
-
-
- 6 -
-
- -
+
+ +
-
- 0 - +
+ +
-
- 1 - +
+ +
-
- 1 - +
+ +
-
- 2 - +
+ +
-
- 3 - +
+ +
-
- 4 - +
+ +
-
- 5 - +
+ +
-
- 6 - +
+ +
-
- 1 - +
+ +
-
- 2 - +
+ +
-
- 3 - +
+ +
-
- 4 - +
+ +
-
- 5 - +
+ +
-
- 6 - +
+ +
-
-
- 0 - -
-
- 1 - -
+
+ + +
+
+ +
- - - - - - - - @@ -53,14 +46,18 @@
- @@ -70,13 +67,17 @@
@@ -86,17 +87,23 @@
@@ -107,38 +114,54 @@
@@ -149,34 +172,48 @@
@@ -187,38 +224,54 @@
@@ -229,38 +282,54 @@
@@ -286,53 +355,41 @@
@@ -358,13 +415,17 @@
@@ -374,29 +435,41 @@
@@ -406,29 +479,41 @@
@@ -438,15 +523,17 @@
@@ -479,7 +566,6 @@ @section Scripts { @{await Html.RenderPartialAsync("_ValidationScriptsPartial");} - - - + + } diff --git a/src/UDS.Net.Web/Views/ParticipantDemographics/Edit.cshtml b/src/UDS.Net.Web/Views/ParticipantDemographics/Edit.cshtml index da1c8de..111be2d 100644 --- a/src/UDS.Net.Web/Views/ParticipantDemographics/Edit.cshtml +++ b/src/UDS.Net.Web/Views/ParticipantDemographics/Edit.cshtml @@ -331,7 +331,6 @@ @section Scripts { @{await Html.RenderPartialAsync("_ValidationScriptsPartial");} - - - + + } diff --git a/src/UDS.Net.Web/Views/ParticipantDemographics/_InitialVisitEthnicity.cshtml b/src/UDS.Net.Web/Views/ParticipantDemographics/_InitialVisitEthnicity.cshtml index c6e3e90..a64835d 100644 --- a/src/UDS.Net.Web/Views/ParticipantDemographics/_InitialVisitEthnicity.cshtml +++ b/src/UDS.Net.Web/Views/ParticipantDemographics/_InitialVisitEthnicity.cshtml @@ -100,34 +100,34 @@ \ No newline at end of file diff --git a/src/UDS.Net.Web/wwwroot/js/RacialQuestions.js b/src/UDS.Net.Web/wwwroot/js/RacialQuestions.js new file mode 100644 index 0000000..e5abd8a --- /dev/null +++ b/src/UDS.Net.Web/wwwroot/js/RacialQuestions.js @@ -0,0 +1,180 @@ +/// +$(() => { + const radioConfig = [ + { + 'weight': 0, + 'name': 'Race', + 'disableExceptions': [50, 88, 99] + }, + { + 'weight': 1, + 'name': 'SecondaryRace', + 'disableExceptions': [50, 88, 99] + }, + { + 'weight': 2, + 'name': 'AdditionalRace', + 'disableExceptions': [50, 88, 99] + } + ] + const isNewCoParticipant = $('input[name=IsNewCoParticipant]'); + const isFollowUpVisit = isNewCoParticipant.length > 0; + const race = $('input[name=Race]'); + const raceChecked = $('input[name=Race]:checked'); + const secondaryRace = $('input[name=SecondaryRace]'); + const additionalRace = $('input[name=AdditionalRace]'); + const secondaryRaceChecked = $('input[name=SecondaryRace]:checked'); + const secondaryRaceNotReported = $('input[name=SecondaryRace][value=88]'); + const additionalRaceNotReported = $('input[name=AdditionalRace][value=88]'); + const subsequentRadioControl = new SubsequentRadioControlDisable(radioConfig); + function disableAllRadioControlsExceptOne(controlNameToDisable, controlValueToEnable) { + $(`input[name=${controlNameToDisable}]`).toArray().forEach(currentControl => { + const currentRadioControl = $(currentControl); + const shouldDisableControl = currentRadioControl.val() != controlValueToEnable; + if (shouldDisableControl) { + currentRadioControl.prop('disabled', true); + } + }); + } + function setUnknownOrNotReportedStates() { + if (race.is(':checked')) { + if (raceChecked.val() == 99) { + secondaryRaceNotReported.prop('checked', true); + disableAllRadioControlsExceptOne(secondaryRaceNotReported.prop('name'), 88); + additionalRaceNotReported.prop('checked', true); + disableAllRadioControlsExceptOne(additionalRaceNotReported.prop('name'), 88); + } + } + if (secondaryRace.is(':checked')) { + if (secondaryRaceChecked.val() == 99) { + additionalRaceNotReported.prop('checked', true); + disableAllRadioControlsExceptOne(additionalRaceNotReported.prop('name'), 88); + } + if (secondaryRaceChecked.val() == 88) { + additionalRaceNotReported.prop('checked', true); + disableAllRadioControlsExceptOne(additionalRaceNotReported.prop('name'), 88); + } + } + } + if (isFollowUpVisit) { + isNewCoParticipant.on('change', (event) => { + const isNewCoParticipantControl = $(event.target); + if (isNewCoParticipantControl.is(':checked')) { + if (isNewCoParticipantControl.val() == 'true') { + race.each((_index, control) => $(control).prop('disabled', false)); + subsequentRadioControl.runRadioDisable(); + setUnknownOrNotReportedStates(); + } + else { + race.each((_index, control) => $(control).prop('disabled', true)); + secondaryRace.each((_index, control) => $(control).prop('disabled', true)); + additionalRace.each((_index, control) => $(control).prop('disabled', true)); + } + } + }).trigger('change'); + } + setUnknownOrNotReportedStates(); + race.on('change', (event) => { + const selectedRace = $(event.target); + if (selectedRace.is(':checked')) { + if (selectedRace.val() == 99) { + secondaryRaceNotReported.prop('checked', true); + disableAllRadioControlsExceptOne(secondaryRaceNotReported.prop('name'), 88); + additionalRaceNotReported.prop('checked', true); + disableAllRadioControlsExceptOne(additionalRaceNotReported.prop('name'), 88); + } + } + if (secondaryRaceChecked != null) { + if (secondaryRaceChecked.val() == 99) { + additionalRaceNotReported.prop('checked', true); + disableAllRadioControlsExceptOne(additionalRaceNotReported.prop('name'), 88); + } + if (secondaryRaceChecked.val() == 88) { + additionalRaceNotReported.prop('checked', true); + disableAllRadioControlsExceptOne(additionalRaceNotReported.prop('name'), 88); + } + } + }); + secondaryRace.on('change', (event) => { + const selectedRace = $(event.target); + if (selectedRace.is(':checked')) { + if (selectedRace.val() == 99) { + additionalRaceNotReported.prop('checked', true); + disableAllRadioControlsExceptOne(additionalRaceNotReported.prop('name'), 88); + } + if (selectedRace.val() == 88) { + additionalRaceNotReported.prop('checked', true); + disableAllRadioControlsExceptOne(additionalRaceNotReported.prop('name'), 88); + } + } + }); + /* + INSTRUCTIONS: + 1. on the html provide the necessary data-attributes on the radio button inputs: + + * data-toggle-values = the values that will disable the data-toggle-target fields + + 2. if you have to target more than one element to disable, then seperate by a comma (,) + + + 3. in order for "other" text input fields to be disabled on load, add "disabled" attribute to all text inputs with the desired functionality + NOTE: This is a refactor of the original radio toggle library, with a modification to check for partially disabled radio button groups + */ + function disableRadioGroup(target, willDisable) { + $(`input[name="${target}"]`).prop('disabled', willDisable); + $(`input[name="${target}Other"]`).prop('disabled', willDisable); + } + function hasToggleValue(element) { + return element.data('toggle-values').includes(parseInt(element.attr('value'))); + } + function isDisabledRadioGroup(groupName) { + const radioGroupArray = $(`input[name=${groupName}]`); + const disabledButtons = radioGroupArray.filter(x => $(x).attr('disabled')); + return disabledButtons == radioGroupArray.length; + } + function SectionToggle(element) { + let shouldDisable = false; + if (element.data('toggle-values')) { + let toggleTargetArray = element.data('toggle-targets').split(','); + if (toggleTargetArray.length > 0) { + shouldDisable = hasToggleValue(element); + toggleTargetArray.forEach(target => disableRadioGroup(target, shouldDisable)); + } else { + console.error(`There we're no toggle targets provided for ${element.attr('name')}`); + } + } + if (element.data('toggle-bool')) { + let toggleTargetArray = element.data('toggle-targets').split(','); + shouldDisable = element.data('toggle-bool').toString() == element.attr('value'); + toggleTargetArray.forEach(target => disableRadioGroup(target, shouldDisable)); + } + } + //get all checked values and disable/enable related fields + $(`input[type="radio"]:checked`).map((_index, currentlyCheckedRadio) => { + const checkedRadio = $(currentlyCheckedRadio); + SectionToggle(checkedRadio); + }); + $(`input[type="radio"]`).on("change", (event) => { + const changedRadio = $(event.target); + SectionToggle(changedRadio); + // loop through check fields after sectionToggle for any related fields effected by toggle + $(`input[type="radio"]:checked`).map((_index, currentlyCheckedRadio) => { + const checkedRadio = $(currentlyCheckedRadio); + SectionToggle(checkedRadio); + }); + // loop through disabled fields and disable any fields with valid values, but within disabled groups + $(`input[type="radio"]:disabled`).map((_index, disabledRadio) => { + // checks if entire radio group is disabled, prevents partially disabled groups from having their other text field disabled automatically + if (isDisabledRadioGroup(disableRadioGroup.name)) { + $(`input[name="${disabledRadio.name}Other"]`).prop('disabled', true); + } + }); + }); + + //run code on checkbox changes + $(`input[type="checkbox"]`).on("change", (event) => { + $(`input[type="radio"]:checked`).map(function () { + SectionToggle($(event.target)) + }) + }); +}); \ No newline at end of file diff --git a/src/UDS.Net.Web/wwwroot/js/SubsequentRadioControlDisable.js b/src/UDS.Net.Web/wwwroot/js/SubsequentRadioControlDisable.js index c05b113..2ad59e6 100644 --- a/src/UDS.Net.Web/wwwroot/js/SubsequentRadioControlDisable.js +++ b/src/UDS.Net.Web/wwwroot/js/SubsequentRadioControlDisable.js @@ -1,3 +1,4 @@ +/// class SubsequentRadioControlDisable { _radioControlConfiguration = []; _numberOfControls; @@ -22,10 +23,6 @@ class SubsequentRadioControlDisable { getCheckedRadioValue(controlName) { return $(`input[name=${controlName}]:checked`).val() } - setOtherTextDisableState(controlName, disabled) { - const textBox = $(`input[name=${controlName}Other]`); - textBox.prop('disabled', disabled); - } getCurrentlyCheckedValue(controlName) { const checkedControls = $(`input[name=${controlName}][type='radio']:checked`); if(checkedControls.length > 0) { @@ -36,25 +33,12 @@ class SubsequentRadioControlDisable { runRadioDisable() { const previouslyCheckedValues = []; this._radioControlConfiguration.forEach(radioConfiguration => { - if(radioConfiguration.hasOther) { - const currentValue = this.getCheckedRadioValue(radioConfiguration.name); - const radioGroupHasACheckedValue = currentValue >= 0 - if(radioGroupHasACheckedValue) { - const otherTextBoxShouldBeEnabled = currentValue == radioConfiguration.otherEnableValue - if(otherTextBoxShouldBeEnabled) { - this.setOtherTextDisableState(radioConfiguration.name, false); - } else { - this.setOtherTextDisableState(radioConfiguration.name, true); - } - } - } const isSubsequent = 0 < radioConfiguration.weight; if(isSubsequent) { this.resetPreviouslyDisabledRadioGroup(radioConfiguration.name); previouslyCheckedValues.forEach(previouslyCheckedValue => { - const isOtherValue = radioConfiguration.hasOther && previouslyCheckedValue == radioConfiguration.otherEnableValue; const isExceptionValue = radioConfiguration.disableExceptions.indexOf(+previouslyCheckedValue) > -1; - if(!isOtherValue && !isExceptionValue) { + if(!isExceptionValue) { this.disableRadioOption(radioConfiguration.name, previouslyCheckedValue); } }); @@ -72,10 +56,6 @@ class SubsequentRadioControlDisable { const changedRadioName = changedRadio.attr('name'); const changedRadioConfig = this.getRadioConfig(changedRadioName); const isNotTheLastControl = changedRadioConfig.weight < this._numberOfControls - 1; - const otherTextBoxShouldEnable = radioConfiguration.hasOther && changedRadio.val() == radioConfiguration.otherEnableValue - if(otherTextBoxShouldEnable) { - this.setOtherTextDisableState(changedRadioName, false); - } if(isNotTheLastControl) { this.runRadioDisable(); } From c370ec2503952130db8fa60003196de2d7f7d793 Mon Sep 17 00:00:00 2001 From: mlan225 <17088502+mlan225@users.noreply.github.com> Date: Fri, 19 Aug 2022 11:31:36 -0400 Subject: [PATCH 25/30] Remove duplicated code in b8 check --- .../Entities/B8_NeurologicalExaminationFindings.cs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/UDS.Net.Data/Entities/B8_NeurologicalExaminationFindings.cs b/src/UDS.Net.Data/Entities/B8_NeurologicalExaminationFindings.cs index 9bb353b..5e16687 100644 --- a/src/UDS.Net.Data/Entities/B8_NeurologicalExaminationFindings.cs +++ b/src/UDS.Net.Data/Entities/B8_NeurologicalExaminationFindings.cs @@ -168,11 +168,6 @@ public bool? AtLeastOneFindingSyndromeIndicated count++; } - if(CerebrovascularDiseaseSigns.HasValue && CerebrovascularDiseaseSigns.Value == true) - { - count++; - } - if (CerebrovascularDiseaseSigns.HasValue && CerebrovascularDiseaseSigns.Value == true) { count++; From 8bfd162b838b1a6899f28f830a18af8bd9f4fa51 Mon Sep 17 00:00:00 2001 From: mlan225 <17088502+mlan225@users.noreply.github.com> Date: Fri, 19 Aug 2022 14:49:35 -0400 Subject: [PATCH 26/30] Adjust previous value logic on b9 b9 previous value logic was adjusted to reflect new functionality: - always show the previous value message - only show "please input ___" when the desired value is not input - change from showing all visits to only showing previous visit and before. No longer show current visit and above in the previous value list --- src/UDS.Net.Data/Dtos/PreviousValueDto.cs | 10 +++ .../Controllers/SymptomsController.cs | 66 +++++++++++-------- src/UDS.Net.Web/Views/Symptoms/Edit.cshtml | 40 +++++------ 3 files changed, 67 insertions(+), 49 deletions(-) create mode 100644 src/UDS.Net.Data/Dtos/PreviousValueDto.cs diff --git a/src/UDS.Net.Data/Dtos/PreviousValueDto.cs b/src/UDS.Net.Data/Dtos/PreviousValueDto.cs new file mode 100644 index 0000000..a574749 --- /dev/null +++ b/src/UDS.Net.Data/Dtos/PreviousValueDto.cs @@ -0,0 +1,10 @@ +using System; + +namespace UDS.Net.Data.Dtos +{ + public class PreviousValueDto + { + public string Name { get; set; } + public string Text { get; set; } + } +} \ No newline at end of file diff --git a/src/UDS.Net.Web/Controllers/SymptomsController.cs b/src/UDS.Net.Web/Controllers/SymptomsController.cs index e049342..50df08c 100644 --- a/src/UDS.Net.Web/Controllers/SymptomsController.cs +++ b/src/UDS.Net.Web/Controllers/SymptomsController.cs @@ -15,7 +15,7 @@ namespace UDS.Net.Web.Controllers { public class SymptomsController : PacketFormController { - private List _nonMatchingValues = new List(); + private List _previousValues = new List(); public SymptomsController(UdsContext context, IParticipantsService participantsService, IChecklistService checklistService) : base(context, participantsService, checklistService) { @@ -120,7 +120,7 @@ public async Task Edit(int? id) CheckValue(previousForm, symptoms, "PredominantDomain", 0); CheckValue(previousForm, symptoms, "PredominantSymptom", 0); - ViewBag.NonmatchingValues = _nonMatchingValues; + ViewBag.previousValues = _previousValues; ViewBag.VisitType = symptoms.Visit.VisitType; return View(symptoms); @@ -138,7 +138,7 @@ public async Task Edit(int id, Symptoms symptoms, string save, st return NotFound(); } - ViewBag.NonmatchingValues = _nonMatchingValues; + ViewBag.previousValues = _previousValues; var visit = await _context.Visits .AsNoTracking() @@ -230,7 +230,7 @@ private bool SymptomsExists(int id) private Symptoms GetPreviousForm(int visitNumber, int currentParticipantId) { - var previousForms = GetAllPreviousForms(currentParticipantId); + var previousForms = GetCurrentAndPrevForms(currentParticipantId, visitNumber); var currentFormIndex = previousForms.FindIndex(c => c.Visit.VisitNumber == visitNumber); var previousFormIndex = currentFormIndex - 1; @@ -244,12 +244,13 @@ private Symptoms GetPreviousForm(int visitNumber, int currentParticipantId) return null; } - private List GetAllPreviousForms(int currentParticipantId) + //current form is included here for use in comparing with previous values + private List GetCurrentAndPrevForms(int currentParticipantId, int currentVisitNumber) { var previousForms = _context.Symptoms .Include(c => c.Visit) .ThenInclude(c => c.Participant) - .Where(c => c.Visit.Participant.Id == currentParticipantId) + .Where(c => c.Visit.Participant.Id == currentParticipantId && c.Visit.VisitNumber <= currentVisitNumber) .OrderBy(c => c.Visit.VisitNumber) .AsNoTracking() .ToList(); @@ -257,24 +258,21 @@ private List GetAllPreviousForms(int currentParticipantId) return previousForms; } - private string GetPreviousValueText(string target, int currentVisitId, int currentParticipantId) + private string GetPreviousValueText(string target, int currentVisitNumber, int currentParticipantId) { string previousValuesText = null; - var previousForms = GetAllPreviousForms(currentParticipantId); + var previousForms = GetCurrentAndPrevForms(currentParticipantId, currentVisitNumber); foreach (Symptoms form in previousForms) { if(form != null) { - var previousValue = form.GetType().GetProperty(target).GetValue(form, null); - var previousVisitNumber = form.Visit.VisitNumber; + if(form.Visit.VisitNumber != currentVisitNumber) { + var previousValue = form.GetType().GetProperty(target).GetValue(form, null); + var previousVisitNumber = form.Visit.VisitNumber; - previousValuesText += $"\nvist #{previousVisitNumber}: {previousValue}"; - - if(currentVisitId == form.Visit.VisitNumber) - { - previousValuesText += " (current)"; + previousValuesText += $"\nvisit #{previousVisitNumber}: {(previousValue == null ? "N/A" : previousValue)}"; } } } @@ -286,19 +284,25 @@ private void CheckValue(Symptoms previousForm, Symptoms currentForm, string targ { if (previousForm != null) { - var currentValue = GetCurrentValue(currentForm, target); - var previousValue = GetPreviousValue(previousForm, target); + if(previousForm.Visit.VisitNumber != currentForm.Visit.VisitNumber) { + var currentValue = GetCurrentValue(currentForm, target); + var previousValue = GetPreviousValue(previousForm, target); + var showSuggestionText = false; - if (currentValue == null && previousValue != null) - { - SetCurrentValue(currentForm, target, autoFillValue); - } - if (currentValue != previousValue && previousValue != null && currentValue != null) - { - if (!Equals(currentValue, autoFillValue)) + if (currentValue == null && previousValue != null) { - CreateNonMatchMsg(target, autoFillValue, currentForm.Visit.VisitNumber, currentForm.Visit.Participant.Id); + SetCurrentValue(currentForm, target, autoFillValue); } + + if (currentValue != null) + { + if (!Equals(currentValue, autoFillValue) && previousValue != null) + { + showSuggestionText = true; + } + } + + CreatePreviousValueMsg(target, autoFillValue, currentForm.Visit.VisitNumber, currentForm.Visit.Participant.Id, showSuggestionText); } } } @@ -318,17 +322,21 @@ private static void SetCurrentValue(Symptoms currentForm, string target, int aut currentForm.GetType().GetProperty(target).SetValue(currentForm, autoFillvalue); } - private void CreateNonMatchMsg(string target, int autoFillValue, int currentVisitId, int currentParticipantId) + private void CreatePreviousValueMsg(string target, int autoFillValue, int currentVisitNumber, int currentParticipantId, bool showSuggestionText) { - var previousValuesText = "The previously recorded values are:\n" + GetPreviousValueText(target, currentVisitId, currentParticipantId) + "\n\nplease input " + autoFillValue; + var previousValuesText = "The previously recorded values are:\n" + GetPreviousValueText(target, currentVisitNumber, currentParticipantId); + + if(showSuggestionText) { + previousValuesText += "\n\nplease input " + autoFillValue; + } - var message = new NonMatchingValueDto + var message = new PreviousValueDto { Name = target, Text = previousValuesText }; - _nonMatchingValues.Add(message); + _previousValues.Add(message); } } } \ No newline at end of file diff --git a/src/UDS.Net.Web/Views/Symptoms/Edit.cshtml b/src/UDS.Net.Web/Views/Symptoms/Edit.cshtml index 228ccc2..eb154f0 100644 --- a/src/UDS.Net.Web/Views/Symptoms/Edit.cshtml +++ b/src/UDS.Net.Web/Views/Symptoms/Edit.cshtml @@ -267,9 +267,9 @@

NOTE: Enter 0 if this information was provided on a previously submitted Form B9

} - @if (((ViewBag.NonmatchingValues as List).Where(x => x.Name == "PredominantSymptom").Any())) + @if (((ViewBag.previousValues as List).Where(x => x.Name == "PredominantSymptom").Any())) { - @await Html.PartialAsync("_PreviousValueNotification", (ViewBag.NonmatchingValues as List).Where(x => x.Name == "PredominantSymptom").FirstOrDefault()); + @await Html.PartialAsync("_PreviousValueNotification", (ViewBag.previousValues as List).Where(x => x.Name == "PredominantSymptom").FirstOrDefault()); }
@@ -376,9 +376,9 @@

(777 = Age of onset entered at a previous UDS visit)

} - @if (((ViewBag.NonmatchingValues as List).Where(x => x.Name == "AgeOfDecline").Any())) + @if (((ViewBag.previousValues as List).Where(x => x.Name == "AgeOfDecline").Any())) { - @await Html.PartialAsync("_PreviousValueNotification", (ViewBag.NonmatchingValues as List).Where(x => x.Name == "AgeOfDecline").FirstOrDefault()); + @await Html.PartialAsync("_PreviousValueNotification", (ViewBag.previousValues as List).Where(x => x.Name == "AgeOfDecline").FirstOrDefault()); } @@ -527,9 +527,9 @@ (777 = Age of onset provided at a previous UDS visit) } - @if (((ViewBag.NonmatchingValues as List).Where(x => x.Name == "HallucinationsAge").Any())) + @if (((ViewBag.previousValues as List).Where(x => x.Name == "HallucinationsAge").Any())) { - @await Html.PartialAsync("_PreviousValueNotification", (ViewBag.NonmatchingValues as List).Where(x => x.Name == "HallucinationsAge").FirstOrDefault()); + @await Html.PartialAsync("_PreviousValueNotification", (ViewBag.previousValues as List).Where(x => x.Name == "HallucinationsAge").FirstOrDefault()); } @@ -719,9 +719,9 @@

NOTE: Enter 0 if this information was provided on a previously submitted Form B9

} - @if (((ViewBag.NonmatchingValues as List).Where(x => x.Name == "BehaviorDecline").Any())) + @if (((ViewBag.previousValues as List).Where(x => x.Name == "BehaviorDecline").Any())) { - @await Html.PartialAsync("_PreviousValueNotification", (ViewBag.NonmatchingValues as List).Where(x => x.Name == "BehaviorDecline").FirstOrDefault()); + @await Html.PartialAsync("_PreviousValueNotification", (ViewBag.previousValues as List).Where(x => x.Name == "BehaviorDecline").FirstOrDefault()); }
@@ -837,9 +837,9 @@

(777 = Age of onset entered at a previous UDS visit)

} - @if (((ViewBag.NonmatchingValues as List).Where(x => x.Name == "BehaviorSymptomsAge").Any())) + @if (((ViewBag.previousValues as List).Where(x => x.Name == "BehaviorSymptomsAge").Any())) { - @await Html.PartialAsync("_PreviousValueNotification", (ViewBag.NonmatchingValues as List).Where(x => x.Name == "BehaviorSymptomsAge").FirstOrDefault()); + @await Html.PartialAsync("_PreviousValueNotification", (ViewBag.previousValues as List).Where(x => x.Name == "BehaviorSymptomsAge").FirstOrDefault()); } @@ -957,9 +957,9 @@

NOTE: Enter 0 if this information was provided on a previously submitted Form B9

} - @if (((ViewBag.NonmatchingValues as List).Where(x => x.Name == "PredominantMotorDecline").Any())) + @if (((ViewBag.previousValues as List).Where(x => x.Name == "PredominantMotorDecline").Any())) { - @await Html.PartialAsync("_PreviousValueNotification", (ViewBag.NonmatchingValues as List).Where(x => x.Name == "PredominantMotorDecline").FirstOrDefault()); + @await Html.PartialAsync("_PreviousValueNotification", (ViewBag.previousValues as List).Where(x => x.Name == "PredominantMotorDecline").FirstOrDefault()); }
@@ -1064,9 +1064,9 @@

(777 = Age of onset entered at a previous UDS visit)

} - @if (((ViewBag.NonmatchingValues as List).Where(x => x.Name == "SuggestiveOfParkinsonismAge").Any())) + @if (((ViewBag.previousValues as List).Where(x => x.Name == "SuggestiveOfParkinsonismAge").Any())) { - @await Html.PartialAsync("_PreviousValueNotification", (ViewBag.NonmatchingValues as List).Where(x => x.Name == "SuggestiveOfParkinsonismAge").FirstOrDefault()); + @await Html.PartialAsync("_PreviousValueNotification", (ViewBag.previousValues as List).Where(x => x.Name == "SuggestiveOfParkinsonismAge").FirstOrDefault()); } @@ -1109,9 +1109,9 @@

(777 = Age of onset entered at a previous UDS visit)

} - @if (((ViewBag.NonmatchingValues as List).Where(x => x.Name == "SuggestiveOfSclerosisAge").Any())) + @if (((ViewBag.previousValues as List).Where(x => x.Name == "SuggestiveOfSclerosisAge").Any())) { - @await Html.PartialAsync("_PreviousValueNotification", (ViewBag.NonmatchingValues as List).Where(x => x.Name == "SuggestiveOfSclerosisAge").FirstOrDefault()); + @await Html.PartialAsync("_PreviousValueNotification", (ViewBag.previousValues as List).Where(x => x.Name == "SuggestiveOfSclerosisAge").FirstOrDefault()); } @@ -1136,9 +1136,9 @@

(777 = Age of onset entered at a previous UDS visit)

} - @if (((ViewBag.NonmatchingValues as List).Where(x => x.Name == "AssessmentOfSclerosisAge").Any())) + @if (((ViewBag.previousValues as List).Where(x => x.Name == "AssessmentOfSclerosisAge").Any())) { - @await Html.PartialAsync("_PreviousValueNotification", (ViewBag.NonmatchingValues as List).Where(x => x.Name == "AssessmentOfSclerosisAge").FirstOrDefault()); + @await Html.PartialAsync("_PreviousValueNotification", (ViewBag.previousValues as List).Where(x => x.Name == "AssessmentOfSclerosisAge").FirstOrDefault()); } @@ -1200,9 +1200,9 @@

NOTE: Enter 0 if this information was provided on a previously submitted Form B9

} - @if (((ViewBag.NonmatchingValues as List).Where(x => x.Name == "PredominantDomain").Any())) + @if (((ViewBag.previousValues as List).Where(x => x.Name == "PredominantDomain").Any())) { - @await Html.PartialAsync("_PreviousValueNotification", (ViewBag.NonmatchingValues as List).Where(x => x.Name == "PredominantDomain").FirstOrDefault()); + @await Html.PartialAsync("_PreviousValueNotification", (ViewBag.previousValues as List).Where(x => x.Name == "PredominantDomain").FirstOrDefault()); }
From 211313308a8c8017bf1fc3c07b7b67ccf9b7ef7c Mon Sep 17 00:00:00 2001 From: Casey D Spires <11319139+casey-spires@users.noreply.github.com> Date: Mon, 22 Aug 2022 15:28:57 -0400 Subject: [PATCH 27/30] Adds trail making test score validation Checks scores for trail making at the server to ensure they fall within the correct range --- .../C2_NeuropsychologicalBatteryScores.cs | 2 +- ...uropsychologicalBatteryScoresController.cs | 49 +++- .../Edit.cshtml | 179 +-------------- .../NeuropsychologicalBatteryScores/Edit.js | 211 ++++++++++++++++++ 4 files changed, 270 insertions(+), 171 deletions(-) create mode 100644 src/UDS.Net.Web/wwwroot/js/NeuropsychologicalBatteryScores/Edit.js diff --git a/src/UDS.Net.Data/Entities/C2_NeuropsychologicalBatteryScores.cs b/src/UDS.Net.Data/Entities/C2_NeuropsychologicalBatteryScores.cs index d4c54c1..b23afb1 100644 --- a/src/UDS.Net.Data/Entities/C2_NeuropsychologicalBatteryScores.cs +++ b/src/UDS.Net.Data/Entities/C2_NeuropsychologicalBatteryScores.cs @@ -256,7 +256,7 @@ public class NeuropsychologicalBatteryScores : FormBase [Display(Name = "Longest span forward")] [Range(0, 9, ErrorMessage = "Value outside of required range")] - [InvalidRange(nameof(NumberSpanTestForwardLongestSpanForward), 1, 4, ErrorMessage = "Value outside of required range")] + [InvalidRange(nameof(NumberSpanTestForwardLongestSpanForward), 1, 2, ErrorMessage = "Value outside of required range")] [Column("DIGFORSL")] public int? NumberSpanTestForwardLongestSpanForward { get; set; } diff --git a/src/UDS.Net.Web/Controllers/NeuropsychologicalBatteryScoresController.cs b/src/UDS.Net.Web/Controllers/NeuropsychologicalBatteryScoresController.cs index 923e372..01628b3 100644 --- a/src/UDS.Net.Web/Controllers/NeuropsychologicalBatteryScoresController.cs +++ b/src/UDS.Net.Web/Controllers/NeuropsychologicalBatteryScoresController.cs @@ -114,8 +114,8 @@ public async Task Edit(int? id) return View("Details", neuropsychologicalBatteryScores); } - ViewData["Id"] = new SelectList(_context.Visits, "Id", "Id", neuropsychologicalBatteryScores.Id); - + ViewData["Id"] = new SelectList(_context.Visits, "Id", "Id", neuropsychologicalBatteryScores.Id); + var participantIdentity = await _participantsService.GetParticipantAsync(neuropsychologicalBatteryScores.Visit.Participant.Id); neuropsychologicalBatteryScores.Visit.Participant.Profile = participantIdentity; @@ -140,7 +140,7 @@ public async Task Edit(int id, NeuropsychologicalBatteryScores ne if (!FormCanBeEdited(visit.Status)) { - ModelState.AddModelError("FormStatus", "Form cannot be modified because packet is complete."); + ModelState.AddModelError("FormStatus", "Form cannot be modified because packet is complete."); return View(neuropsychologicalBatteryScores); } @@ -225,6 +225,49 @@ public async Task DeleteConfirmed(int id) await _context.SaveChangesAsync(); return RedirectToAction(nameof(Index)); } + public IActionResult TrailMakingTestASecondsToCompleteValidateRange(int seconds) + { + var result = true; + if((seconds > 150) && (seconds < 995)) + { + result = false; + } + return Json(result); + } + public IActionResult TrailMakingTestBSecondsToCompleteValidateRange(int seconds) + { + var result = true; + if ((seconds > 300 && seconds < 995)) + { + result = false; + } + return Json(result); + } + public IActionResult TrailMakingTestANumberOfCorrectValidateRange(int seconds, int correctLines) + { + var result = true; + if(seconds == 150) + { + if (correctLines == 24) + { + result = false; + } + } + + return Json(result); + } + public IActionResult TrailMakingTestBNumberOfCorrectValidateRange(int seconds, int correctLines) + { + var result = true; + if(seconds == 300) + { + if (correctLines == 24) + { + result = false; + } + } + return Json(result); + } private bool neuropsychologicalBatteryScoresExists(int id) { diff --git a/src/UDS.Net.Web/Views/NeuropsychologicalBatteryScores/Edit.cshtml b/src/UDS.Net.Web/Views/NeuropsychologicalBatteryScores/Edit.cshtml index 6f4fc89..88442b0 100644 --- a/src/UDS.Net.Web/Views/NeuropsychologicalBatteryScores/Edit.cshtml +++ b/src/UDS.Net.Web/Views/NeuropsychologicalBatteryScores/Edit.cshtml @@ -1,18 +1,18 @@ @model NeuropsychologicalBatteryScores @{ - var title = "C2 Neuropsychological Battery Scores"; - var visitInfo = ""; - var isIVP = Equals(ViewBag.VisitType, VisitType.IVP); - if (visitInfo == null) - { - visitInfo = " - " + Model.Visit.Participant.Id + " - Visit " + Model.Visit.VisitNumber; - } + var title = "C2 Neuropsychological Battery Scores"; + var visitInfo = ""; + var isIVP = Equals(ViewBag.VisitType, VisitType.IVP); + if (visitInfo == null) + { + visitInfo = " - " + Model.Visit.Participant.Id + " - Visit " + Model.Visit.VisitNumber; + } ViewData["Title"] = title + visitInfo; } -@await Component.InvokeAsync("VisitHeader", new { visitId = Model.Visit.Id, participationId = Model.Visit.Participant.Id, participantProfile = Model.Visit.Participant.Profile }) -@await Component.InvokeAsync("FormHeader", new { currentVisit = Model.Visit, currentForm = Model, formTitle = title }) +@await Component.InvokeAsync("VisitHeader", new { visitId = Model.Visit.Id, participationId = Model.Visit.Participant.Id, participantProfile = Model.Visit.Participant.Profile }) +@await Component.InvokeAsync("FormHeader", new { currentVisit = Model.Visit, currentForm = Model, formTitle = title })
@@ -858,6 +858,7 @@ (If not finished by 150 seconds, enter 150)
(If test not completed, enter reason code, 995–998, and SKIP TO QUESTION 8b.)
+
8a should be between (1-150), (995-998)
-
@@ -38,13 +31,13 @@
+ + +
-
- 1 - +
+
+ +
-
- 2 - +
+ +
-
- 0 - +
+ +
-
- 1 - +
+ +
-
- 0 - +
+ +
-
- 1 - +
+ +
-
- 9 - +
+ +
-
- 1 - +
+ +
-
- 2 - +
+ +
-
- 3 - +
+ +
-
- 4 - +
+ +
-
- 5 - +
+ +
-
- 6 - +
+ +
-
- 50 - +
+ +
-
- 99 - +
+ +
-
- 1 - +
+ +
-
- 2 - +
+ +
-
- 3 - +
+ +
-
- 4 - +
+ +
-
- 5 - +
+ +
-
- 50 - - +
+ + +
-
- 99 - +
+ +
-
- 1 - +
+ +
-
- 2 - +
+ +
-
- 3 - +
+ +
-
- 4 - +
+ +
-
- 5 - +
+ +
-
- 50 - - +
+ + +
-
- 88 - +
+ +
-
- 99 - +
+ +
-
- 1 - +
+ +
-
- 2 - +
+ +
-
- 3 - +
+ +
-
- 4 - +
+ +
-
- 5 - +
+ +
-
- 50 - - +
+ + +
-
- 88 - +
+ +
-
- 99 - +
+ +
-
-
- 1 -
-
- -
+
+ +
-
-
- 2 -
-
- -
+
+ +
-
-
- 3 -
-
- -
+
+ +
-
-
- 4 -
-
- -
+
+ +
-
-
- 5 -
-
- -
+
+ +
-
-
- 6 -
-
- -
+
+ +
-
- 0 - +
+ +
-
- 1 - +
+ +
-
- 1 - +
+ +
-
- 2 - +
+ +
-
- 3 - +
+ +
-
- 4 - +
+ +
-
- 5 - +
+ +
-
- 6 - +
+ +
-
- 1 - +
+ +
-
- 2 - +
+ +
-
- 3 - +
+ +
-
- 4 - +
+ +
-
- 5 - +
+ +
-
- 6 - +
+ +
-
-
- 0 - -
-
- 1 - -
+
+ + +
+
+ +
- +
- +
- +
- +
- +
- +
@@ -137,7 +137,7 @@
- +
@@ -155,34 +155,34 @@
- +
- +
- +
- +
- +
- +
@@ -192,12 +192,12 @@
- +
- +
@@ -215,34 +215,34 @@
- +
- +
- +
- +
- +
- +
@@ -250,17 +250,14 @@
- -
- +
- +
-
@@ -912,6 +913,7 @@ (If not finished by 300 seconds, enter 300)
(If test not completed, enter reason code, 995–998, and SKIP TO QUESTION 9a.)
+
8a should be between (0-300, 995-998)
@@ -1456,162 +1458,5 @@ @{await Html.RenderPartialAsync("_ValidationScriptsPartial");} - - + } diff --git a/src/UDS.Net.Web/wwwroot/js/NeuropsychologicalBatteryScores/Edit.js b/src/UDS.Net.Web/wwwroot/js/NeuropsychologicalBatteryScores/Edit.js new file mode 100644 index 0000000..8f5dbb1 --- /dev/null +++ b/src/UDS.Net.Web/wwwroot/js/NeuropsychologicalBatteryScores/Edit.js @@ -0,0 +1,211 @@ +$(() => { + class FormValidation { + constructor() { + this.eightA = $('input[name="TrailMakingTestASecondsToComplete"]'); + this.eightATwo = $('input[name="TrailMakingTestANumberOfCorrect"]'); + this.eightB = $('input[name="TrailMakingTestBSecondsToComplete"]'); + this.eightBTwo = $('input[name="TrailMakingTestBNumberOfCorrect"]'); + this.trailMakingErrorA = $('input.trailMakingErrorA'); + this.trailMakingErrorB = $('input.trailMakingErrorB'); + this.moCAPartAdministered = $('input[name="MoCAPartAdministered"]'); + + this.scoreList = + [ + "MoCATrials", + "MoCACube", + "MoCAClockContour", + "MoCAClockNumbers", + "MoCAHands", + "MoCANaming", + "MoCADigits", + "MoCALetter", + "MoCASerial", + "MoCARepetition", + "MoCAFluency", + "MoCAAbstraction", + "MoCANoCue", + "MoCADate", + "MoCAMonth", + "MoCAYear", + "MoCADay", + "MoCAPlace", + "MoCACity" + ] + } + TrailMakingSecondsCompleteCheck(inputName) { + const inputControl = $(`input[name=${inputName}]`); + $.ajax({ + url:`${window.location.origin}/NeuropsychologicalBatteryScores/${inputName}ValidateRange`, + data: { + seconds: inputControl.val() + }, + success: (result) => { + let errorSpanElement = $(`.${inputName}`) + // Not Valid set message; + console.log(`${inputName}:${result}`) + if(!result) { + console.log('enable error'); + if(errorSpanElement.hasClass('errorHidden')) + { + console.log('remove class, show error') + errorSpanElement.removeClass('errorHidden'); + } + } + if(result) { + if(!errorSpanElement.hasClass('errorHidden')) + { + errorSpanElement.addClass('errorHidden'); + } + } + } + }); + } + TrailMakingSecondsNumberCompleteCheck(parentInputName, childInputName) { + const parentInputControl = $(`input[name=${parentInputName}]`); + const childInputControl = $(`input[name=${childInputName}]`); + $.ajax({ + url:`${window.location.origin}/NeuropsychologicalBatteryScores/${childInputName}ValidateRange`, + data: { + seconds: parentInputControl.val(), + correctLines: childInputControl.val() + }, + success: (result) => { + let errorSpanElement = $(`.${childInputName}`) + // Not Valid set message; + console.log(`${childInputName}:${result}`) + if(!result) { + console.log('enable error'); + if(errorSpanElement.hasClass('errorHidden')) + { + console.log('remove class, show error') + errorSpanElement.removeClass('errorHidden'); + } + } + if(result) { + if(!errorSpanElement.hasClass('errorHidden')) + { + errorSpanElement.addClass('errorHidden'); + } + } + } + }); + } + /*show/hide error text for value conflict*/ + TrailMakingErrorCheck = (errorElement, expectedValue, parentElement, parentElementMax) => { + var inputField = $(`input[name="${errorElement}"`) + var parentElementValue = $(`input[name="${parentElement}"`).val() + var isZeroOrGreaterAndLessThanMax = (0 <= parentElementValue) && (parentElementValue < parentElementMax); + if(isZeroOrGreaterAndLessThanMax) { + inputField.val(expectedValue); + } + this.TrailMakingSecondsCompleteCheck(parentElement, parentElement); + this.TrailMakingSecondsNumberCompleteCheck(parentElement, errorElement); + } + //add all of the values for 1f - 1aa and compare to total raw score + TotalRawScoreSum = (sumChange) => { + var scoreSum = 0; + var totalRawScore = parseInt($('input[name="TotalRawScore"').val()); + + this.scoreList.forEach((elem) => { + var elemValue = parseInt($(`input[name="${elem}"]`).val()) + if (isNaN(elemValue)) { + elemValue = 0; + } + + //if elem value is 88 or an error code, don't caclulate to total + if (elemValue >= 88) { + elemValue = 0; + } else { + scoreSum += elemValue; + } + }) + + if (sumChange && totalRawScore != 88) { + totalRawScore = scoreSum; + $('input[name="TotalRawScore"]').val(totalRawScore); + } + + //run function here + this.ApplyTotalScoreErrorField(scoreSum, totalRawScore); + } + + SetMoCAPartAdministeredCode = (elem) => { + + let moCAValue = elem.val(); + let disabled; + + if (moCAValue == "true") { + disabled = true + } else { + disabled = false + } + + $('input[name="MoCAPartAdministeredCode"]').prop('disabled', disabled); + } + + ApplyTotalScoreErrorField = (scoreSum, totalRawScore) => { + if (scoreSum != totalRawScore && totalRawScore != 88 && !isNaN(totalRawScore)) { + $('.TotalRawScoreError').text(`The MoCA Item Scores you have entered equal ${scoreSum} and do not add up to the Total Raw Score of ${totalRawScore}. Please check both the Item Scores and/or the Total Raw Score and make corrections.`) + + if ($('.TotalRawScoreError').hasClass("errorHidden")) { + $('.TotalRawScoreError').removeClass("errorHidden") + } + if (!$('input[name="TotalRawScore"]').hasClass("errorField")) { + $('input[name="TotalRawScore"]').addClass("errorField") + } + + $('input[name="TotalRawScore"]').val(null); + } else { + if (!$('.TotalRawScoreError').hasClass("errorHidden")) { + $('.TotalRawScoreError').addClass("errorHidden") + $('input[name="TotalRawScore"]').removeClass("errorField") + } + if ($('input[name="TotalRawScore"]').hasClass("errorField")) { + $('input[name="TotalRawScore"]').removeClass("errorField") + } + } + } + } + + var formValidation = new FormValidation; + + //onload run functions + /*on change functions + on change, if 8a is null or < 150, 8a2 NEEDS to be 24. If 8a is null, 8a2 is disabled. Same with 8b and 8b2 */ + $(formValidation.eightA).on('change', (elem) => { + formValidation.TrailMakingErrorCheck('TrailMakingTestANumberOfCorrect', 24, 'TrailMakingTestASecondsToComplete', 150) + }); + + $(formValidation.eightB).on('change', (elem) => { + formValidation.TrailMakingErrorCheck('TrailMakingTestBNumberOfCorrect', 24, 'TrailMakingTestBSecondsToComplete', 300) + }); + + $(formValidation.eightATwo).on('change', () => { + formValidation.TrailMakingErrorCheck('TrailMakingTestANumberOfCorrect', 24, 'TrailMakingTestASecondsToComplete', 150) + }) + + $(formValidation.eightBTwo).on('change',() => { + formValidation.TrailMakingErrorCheck('TrailMakingTestBNumberOfCorrect', 24, 'TrailMakingTestBSecondsToComplete', 300) + }) + + $('.totalScoreSum').on('change',() => { + formValidation.TotalRawScoreSum(true); + }); + + $('input[name="TotalRawScore"]').on('change', (elem) => { + formValidation.totalRawScore = $(elem.target).val(); + formValidation.TotalRawScoreSum(); + }); + + $('input[name="VerbalFluencyPhonemicTestGeneratedFWords"]').on('change', (elem) => { + $('input[name="MoCALanguageFluencyNumberCorrect"]').val($(elem.target).val()) + }) + + $(formValidation.moCAPartAdministered).change((elem) => { + formValidation.SetMoCAPartAdministeredCode($(elem.target)) + }) + + //onload count the scoreSum + formValidation.TotalRawScoreSum(); + formValidation.SetMoCAPartAdministeredCode($('input[name="MoCAPartAdministered"]:checked')) +}); \ No newline at end of file From 61bc5b293634ca24d815c5d4093a260757056f81 Mon Sep 17 00:00:00 2001 From: mlan225 <17088502+mlan225@users.noreply.github.com> Date: Wed, 24 Aug 2022 00:33:43 -0400 Subject: [PATCH 28/30] Add c2 delayed recall validation --- .../C2_NeuropsychologicalBatteryScores.cs | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/UDS.Net.Data/Entities/C2_NeuropsychologicalBatteryScores.cs b/src/UDS.Net.Data/Entities/C2_NeuropsychologicalBatteryScores.cs index b23afb1..2d7473d 100644 --- a/src/UDS.Net.Data/Entities/C2_NeuropsychologicalBatteryScores.cs +++ b/src/UDS.Net.Data/Entities/C2_NeuropsychologicalBatteryScores.cs @@ -167,6 +167,26 @@ public class NeuropsychologicalBatteryScores : FormBase [RequiredIf(nameof(MoCAPartAdministered), true, ErrorMessage = "Value Required")] public int? MoCARecognition { get; set; } + // Rules for MoCANoCue, MoCACategoryCue, MoCARecognition + // if no reason codes or N/As then MoCANoCue + MoCACategoryCue + MoCARecognition <= 5. + [NotMapped] + [RequiredIf(nameof(FormStatus), FormStatus.Complete, ErrorMessage = "The sum of the Delayed recall questions, excluding reason variable codes, must be equal to or less than 5")] + public bool? DelayedRecallIsValid { + get { + int delayedRecallTotal = 0; + + if(MoCANoCue.HasValue && MoCACategoryCue.HasValue && MoCARecognition.HasValue) { + int moCANoCueValue = MoCANoCue.Value >= 95 && MoCANoCue.Value <= 98 ? 0 : MoCANoCue.Value; + int moCACategoryCueValue = MoCACategoryCue.Value != 88 ? MoCACategoryCue.Value : 0; + int moCARecognitionValue = MoCARecognition.Value != 88 ? MoCARecognition.Value : 0; + + delayedRecallTotal += moCANoCueValue + moCACategoryCueValue + moCARecognitionValue; + } + + return delayedRecallTotal <= 5 ? true : null; + } + } + [Display(Name = "Orientation — Date")] [Range(0, 98, ErrorMessage = "Value outside of required range")] [InvalidRange(nameof(MoCADate), 2, 94, ErrorMessage = "Value outside of required range")] From fac928c9b2a05402fd0a85470a3f5f846007008a Mon Sep 17 00:00:00 2001 From: Casey D Spires <11319139+casey-spires@users.noreply.github.com> Date: Mon, 12 Sep 2022 14:18:59 -0400 Subject: [PATCH 29/30] Auto calculate B6 geriatric depression score Automatically calculate geriatric depression score --- .../GeriatricDepressionScale/Edit.cshtml | 27 +-------- .../js/GeriatricDepressionScale/Edit.js | 56 +++++++++++++++++++ 2 files changed, 58 insertions(+), 25 deletions(-) create mode 100644 src/UDS.Net.Web/wwwroot/js/GeriatricDepressionScale/Edit.js diff --git a/src/UDS.Net.Web/Views/GeriatricDepressionScale/Edit.cshtml b/src/UDS.Net.Web/Views/GeriatricDepressionScale/Edit.cshtml index a1db150..e8e1995 100644 --- a/src/UDS.Net.Web/Views/GeriatricDepressionScale/Edit.cshtml +++ b/src/UDS.Net.Web/Views/GeriatricDepressionScale/Edit.cshtml @@ -499,7 +499,7 @@
- +
@@ -522,28 +522,5 @@ @section Scripts { @{await Html.RenderPartialAsync("_ValidationScriptsPartial");} - + } diff --git a/src/UDS.Net.Web/wwwroot/js/GeriatricDepressionScale/Edit.js b/src/UDS.Net.Web/wwwroot/js/GeriatricDepressionScale/Edit.js new file mode 100644 index 0000000..9aeb1c9 --- /dev/null +++ b/src/UDS.Net.Web/wwwroot/js/GeriatricDepressionScale/Edit.js @@ -0,0 +1,56 @@ +/// +$(() => { + const DID_NOT_ANSWER = 9; + const geriatricDepressionScoreInput = $('input[name=GDS]'); + const skipInput = $('input[name=NoGDS]'); + if (skipInput.is(':checked')) { + $('input[type=radio]').prop('disabled', true); + } + skipInput.on('change', (event) => { + let isChecked = $(event.target).is(':checked'); + if (isChecked) { + $('input[type=radio]').prop('disabled', true); + geriatricDepressionScoreInput.val(88); + } else { + $('input[type=radio]').prop('disabled', false); + geriatricDepressionScoreInput.val(null); + } + }); + $('input[type=radio]').on('change', (event) => { + geriatricDepressionScoreInput.val(calculateTotalDepressionScore(...getDepressionScoreData())); + }); + function getDepressionScoreData() { + let completedRadios = $('input[type=radio]:checked'); + let answeredQuestions = 0; + let unansweredQuestions = 0; + let totalScore = 0; + completedRadios.each((_index, radio) => { + let answer = parseInt($(radio).val()); + if (answer != DID_NOT_ANSWER) { + totalScore += answer; + answeredQuestions += 1; + } else if (answer == DID_NOT_ANSWER) { + unansweredQuestions += 1; + } + }); + return [totalScore, answeredQuestions, unansweredQuestions]; + } + // Total score of completed items + [(Total score of completed items / #of completed items) * (# of unanswered items)] + function calculateTotalDepressionScore(totalScore, answeredQuestions, unansweredQuestions) { + if (answeredQuestions + unansweredQuestions == 0) { + return 88; + } + if (answeredQuestions + unansweredQuestions < 15) { + return null; + } + if (unansweredQuestions > 3) { + return 88; + } + let score = totalScore + ((totalScore / answeredQuestions) * unansweredQuestions); + let isWholeNumber = Number.isInteger(score); + if (isWholeNumber) { + return score; + } + return Math.round(score); + } +}); \ No newline at end of file From 5df9713f51ae8e58609817f5cb7c9a3395cbd6c4 Mon Sep 17 00:00:00 2001 From: mlan225 <17088502+mlan225@users.noreply.github.com> Date: Thu, 10 Nov 2022 17:01:34 -0500 Subject: [PATCH 30/30] Update the b8 form to allow No (0) input in subquestions --- .../Edit.cshtml | 292 ++++++++++++++++-- 1 file changed, 262 insertions(+), 30 deletions(-) diff --git a/src/UDS.Net.Web/Views/NeurologicalExaminationFindings/Edit.cshtml b/src/UDS.Net.Web/Views/NeurologicalExaminationFindings/Edit.cshtml index 9a263a4..93115e9 100644 --- a/src/UDS.Net.Web/Views/NeurologicalExaminationFindings/Edit.cshtml +++ b/src/UDS.Net.Web/Views/NeurologicalExaminationFindings/Edit.cshtml @@ -23,7 +23,7 @@ - @@ -31,7 +31,7 @@ - - + - - - @@ -79,7 +79,7 @@ - - - @@ -111,12 +111,18 @@ + + @@ -134,6 +140,12 @@ + + + + + + + @@ -237,6 +282,12 @@ + + + - @@ -291,7 +354,7 @@ - - @@ -315,6 +378,9 @@ + @@ -330,6 +396,12 @@ + + - - @@ -368,12 +446,18 @@ + + @@ -390,6 +474,12 @@ + + + + + + - @@ -483,7 +603,7 @@ - - @@ -505,7 +625,7 @@ - - @@ -531,6 +651,9 @@ + @@ -546,6 +669,12 @@ + + + + + - - @@ -638,12 +791,18 @@ + + @@ -660,6 +819,12 @@ + + + + + + + + + + + + - @@ -848,7 +1079,7 @@ - - @@ -870,7 +1101,7 @@ - - @@ -892,7 +1123,7 @@ -
+
+
@@ -51,12 +51,12 @@
INSTRUCTIONS FOR QUESTIONS 2 – 8INSTRUCTIONS FOR QUESTIONS 2 – 8
+ Please complete the appropriate sections below, using your best clinical judgment in selecting findings that indicate the likely syndrome(s) that is/are present.
@@ -66,12 +66,12 @@
+ CHECK ALL OF THE GROUPS OF FINDINGS / SYNDROMES THAT WERE PRESENT:
+
+
- Findings not marked Yes or Not assessed will default to No in the NACC database + Findings should be marked as Yes, No, or Not assessed. + LEFT + RIGHT
Yes + No + Not assessed Yes + No + Not assessed +
+ + +
+
@@ -146,6 +158,12 @@
+
+ + +
+
@@ -166,6 +184,12 @@
+
+ + +
+
@@ -178,6 +202,12 @@
+
+ + +
+
@@ -198,6 +228,12 @@
+
+ + +
+
@@ -210,6 +246,12 @@
+
+ + +
+
@@ -222,6 +264,9 @@
Yes + No + Not assessed +
+ + +
+
@@ -255,6 +306,12 @@
+
+ + +
+
@@ -273,6 +330,12 @@
+
+ + +
+
@@ -283,7 +346,7 @@
+
+
@@ -304,9 +367,9 @@
- Findings not marked Yes or Not assessed will default to No in the NACC database. + Findings should be marked as Yes, No, or Not assessed. + PRESENT
Yes + No + Not assessed +
+ + +
+
@@ -348,6 +420,12 @@
+
+ + +
+
@@ -357,10 +435,10 @@
+ LEFT + RIGHT
Yes + No + Not assessed Yes + No + Not assessed +
+ + +
+
@@ -402,6 +492,12 @@
+
+ + +
+
@@ -422,6 +518,12 @@
+
+ + +
+
@@ -434,6 +536,12 @@
+
+ + +
+
@@ -453,6 +561,12 @@
+
+ + +
+
@@ -465,6 +579,12 @@
+
+ + +
+
@@ -475,7 +595,7 @@
+
+
@@ -497,7 +617,7 @@
+
+
@@ -518,9 +638,9 @@
- Findings not marked Yes or Not assessed will default to No in the NACC database. + Findings should be marked as Yes, No, or Not assessed. + PRESENT
Yes + No + Not assessed +
+ + +
+
@@ -564,6 +693,12 @@
+
+ + +
+
@@ -582,6 +717,12 @@
+
+ + +
+
@@ -600,6 +741,12 @@
+
+ + +
+
@@ -618,6 +765,12 @@
+
+ + +
+
@@ -627,10 +780,10 @@
+ LEFT + RIGHT
Yes + No + Not assessed Yes + No + Not assessed +
+ + +
+
@@ -672,6 +837,12 @@
+
+ + +
+
@@ -691,6 +862,12 @@
+
+ + +
+
@@ -703,6 +880,12 @@
+
+ + +
+
@@ -723,6 +906,12 @@
+
+ + +
+
@@ -735,6 +924,12 @@
+
+ + +
+
@@ -755,6 +950,12 @@
+
+ + +
+
@@ -767,6 +968,12 @@
+
+ + +
+
@@ -787,6 +994,12 @@
+
+ + +
+
@@ -799,6 +1012,12 @@
+
+ + +
+
@@ -818,6 +1037,12 @@
+
+ + +
+
@@ -830,6 +1055,12 @@
+
+ + +
+
@@ -840,7 +1071,7 @@
+
+
@@ -862,7 +1093,7 @@
+
+
@@ -884,7 +1115,7 @@
+
+
@@ -916,6 +1147,7 @@
+