From 53c97972661bf08751210462959632c9a03c3562 Mon Sep 17 00:00:00 2001 From: Oddvocado <96854090+Oddvocado@users.noreply.github.com> Date: Fri, 6 Oct 2023 16:02:51 -0400 Subject: [PATCH 01/18] Formatting and UI behavior progress --- src/UDS.Net.Forms/Pages/UDS3/D1.cshtml | 21 ++++--- src/UDS.Net.Forms/Pages/UDS3/D1.cshtml.cs | 71 ++++++++++++++++++++++- 2 files changed, 78 insertions(+), 14 deletions(-) diff --git a/src/UDS.Net.Forms/Pages/UDS3/D1.cshtml b/src/UDS.Net.Forms/Pages/UDS3/D1.cshtml index b206eccc..66c4969b 100644 --- a/src/UDS.Net.Forms/Pages/UDS3/D1.cshtml +++ b/src/UDS.Net.Forms/Pages/UDS3/D1.cshtml @@ -69,7 +69,7 @@

- +
@@ -320,7 +320,7 @@
- @Html.CheckBox("D1.MCIAMEM", Model.D1.MCIAMEM, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600" }) + @Html.CheckBox("D1.MCIAMEM", Model.D1.MCIAMEM, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600", })
@@ -345,7 +345,7 @@
- @Html.CheckBox("D1.MCIAPLUS", Model.D1.MCIAPLUS, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600" }) + @Html.CheckBox("D1.MCIAPLUS", Model.D1.MCIAPLUS, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600", data_affects = "true", data_affects_toggle_targets = "[ \"D1.MCIAPLAN\" , \"D1.MCIAPATT\" , \"D1.MCIAPEX\" ,\"D1.MCIAPVIS\" ]" })
@@ -413,7 +413,7 @@
- @Html.CheckBox("D1.MCINON1", Model.D1.MCINON1, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600" }) + @Html.CheckBox("D1.MCINON1", Model.D1.MCINON1, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600", data_affects = "true", data_affects_toggle_targets = "[ \"D1.MCIN1LAN\" , \"D1.MCIN1ATT\" , \"D1.MCIN1EX\" ,\"D1.MCIN1VIS\" ]"})
@@ -481,7 +481,7 @@
- @Html.CheckBox("D1.MCINON2", Model.D1.MCINON2, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600" }) + @Html.CheckBox("D1.MCINON2", Model.D1.MCINON2, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600", data_affects = "true", data_affects_toggle_targets = "[ \"D1.MCIN2LAN\" , \"D1.MCIN2ATT\" , \"D1.MCIN2EX\" ,\"D1.MCIN2VIS\" ]" })
@@ -677,13 +677,12 @@ - + - - +
- +

@@ -783,12 +782,12 @@

- +

- +
diff --git a/src/UDS.Net.Forms/Pages/UDS3/D1.cshtml.cs b/src/UDS.Net.Forms/Pages/UDS3/D1.cshtml.cs index 3052f44f..06c41e4b 100644 --- a/src/UDS.Net.Forms/Pages/UDS3/D1.cshtml.cs +++ b/src/UDS.Net.Forms/Pages/UDS3/D1.cshtml.cs @@ -25,19 +25,69 @@ public class D1Model : FormPageModel new RadioListItem("Other (e.g., two or more clinicians or other informal group", "3") }; - public Dictionary NORMCOGBehavior = new Dictionary + public Dictionary NORMCOGUIBehavior = new Dictionary { { "0", new UIBehavior { PropertyAttributes = new List { - new UIEnableAttribute("A1.DEMENTED") + new UIEnableAttribute("D1.DEMENTED"), + new UIEnableAttribute("D1.AMNDEM"), + new UIEnableAttribute("D1.PCA"), + new UIEnableAttribute("D1.PPASYN"), + new UIEnableAttribute("D1.PPASYNT"), + new UIEnableAttribute("D1.FTDSYN"), + new UIEnableAttribute("D1.LBDSYN"), + new UIEnableAttribute("D1.NAMNDEM"), + new UIEnableAttribute("D1.MCIAMEM"), + new UIEnableAttribute("D1.MCIAPLUS"), + new UIEnableAttribute("D1.MCIAPLAN"), + new UIEnableAttribute("D1.MCIAPATT"), + new UIEnableAttribute("D1.MCIAPEX"), + new UIEnableAttribute("D1.MCIAPVIS"), + new UIEnableAttribute("D1.MCINON1"), + new UIEnableAttribute("D1.MCIN1LAN"), + new UIEnableAttribute("D1.MCIN1ATT"), + new UIEnableAttribute("D1.MCIN1EX"), + new UIEnableAttribute("D1.MCIN1VIS"), + new UIEnableAttribute("D1.MCINON2"), + new UIEnableAttribute("D1.MCIN2LAN"), + new UIEnableAttribute("D1.MCIN2ATT"), + new UIEnableAttribute("D1.MCIN2EX"), + new UIEnableAttribute("D1.MCIN2VIS"), + new UIEnableAttribute("D1.IMPNOMCI") + }, InstructionalMessage = "Continue to question 3" } }, { "1", new UIBehavior { PropertyAttributes = new List { - new UIDisableAttribute("A1.HISPORX") + new UIDisableAttribute("D1.DEMENTED"), + new UIDisableAttribute("D1.AMNDEM"), + new UIDisableAttribute("D1.PCA"), + new UIDisableAttribute("D1.PPASYN"), + new UIDisableAttribute("D1.FTDSYN"), + new UIDisableAttribute("D1.LBDSYN"), + new UIDisableAttribute("D1.NAMNDEM"), + new UIDisableAttribute("D1.LBDSYN"), + new UIDisableAttribute("D1.NAMNDEM"), + new UIDisableAttribute("D1.MCIAMEM"), + new UIDisableAttribute("D1.MCIAPLUS"), + new UIDisableAttribute("D1.MCIAPLAN"), + new UIDisableAttribute("D1.MCIAPATT"), + new UIDisableAttribute("D1.MCIAPEX"), + new UIDisableAttribute("D1.MCIAPVIS"), + new UIDisableAttribute("D1.MCINON1"), + new UIDisableAttribute("D1.MCIN1LAN"), + new UIDisableAttribute("D1.MCIN1ATT"), + new UIDisableAttribute("D1.MCIN1EX"), + new UIDisableAttribute("D1.MCIN1VIS"), + new UIDisableAttribute("D1.MCINON2"), + new UIDisableAttribute("D1.MCIN2LAN"), + new UIDisableAttribute("D1.MCIN2ATT"), + new UIDisableAttribute("D1.MCIN2EX"), + new UIDisableAttribute("D1.MCIN2VIS"), + new UIDisableAttribute("D1.IMPNOMCI") }, InstructionalMessage = "Skip to question 6" } }, @@ -51,6 +101,7 @@ public class D1Model : FormPageModel new UIDisableAttribute("D1.AMNDEM"), new UIDisableAttribute("D1.PCA"), new UIDisableAttribute("D1.PPASYN"), + new UIDisableAttribute("D1.PPASYNT"), new UIDisableAttribute("D1.FTDSYN"), new UIDisableAttribute("D1.LBDSYN"), new UIDisableAttribute("D1.NAMNDEM") @@ -63,6 +114,7 @@ public class D1Model : FormPageModel new UIEnableAttribute("D1.AMNDEM"), new UIEnableAttribute("D1.PCA"), new UIEnableAttribute("D1.PPASYN"), + new UIEnableAttribute("D1.PPASYNT"), new UIEnableAttribute("D1.FTDSYN"), new UIEnableAttribute("D1.LBDSYN"), new UIEnableAttribute("D1.NAMNDEM") @@ -93,6 +145,19 @@ public class D1Model : FormPageModel new RadioListItem("Yes", "1") }; + public Dictionary OTHBIOMUIBehavior = new Dictionary + { + { "0", new UIBehavior { PropertyAttribute = new UIDisableAttribute("D1.OTHBIOMX") } }, + { "1", new UIBehavior { PropertyAttribute = new UIEnableAttribute("D1.OTHBIOMX") } }, + + }; + public Dictionary OTHMUTUIBehavior = new Dictionary + { + { "0", new UIBehavior { PropertyAttribute = new UIDisableAttribute("D1.OTHMUTX") } }, + { "1", new UIBehavior { PropertyAttribute = new UIEnableAttribute("D1.OTHMUTX") } }, + { "9", new UIBehavior { PropertyAttribute = new UIDisableAttribute("D1.OTHMUTX") } }, + + }; public List FindingsListItems { get; set; } = new List { new RadioListItem("No", "0"), From c11311c88ac783cc3eea636c1000d5932a0267c2 Mon Sep 17 00:00:00 2001 From: Oddvocado <96854090+Oddvocado@users.noreply.github.com> Date: Mon, 9 Oct 2023 16:19:16 -0400 Subject: [PATCH 02/18] Continued progress of form layout and behavior --- src/UDS.Net.Forms/Pages/UDS3/D1.cshtml | 64 +++++++++++------------ src/UDS.Net.Forms/Pages/UDS3/D1.cshtml.cs | 62 +++++++++++++++++++++- 2 files changed, 93 insertions(+), 33 deletions(-) diff --git a/src/UDS.Net.Forms/Pages/UDS3/D1.cshtml b/src/UDS.Net.Forms/Pages/UDS3/D1.cshtml index 66c4969b..4a65fbe4 100644 --- a/src/UDS.Net.Forms/Pages/UDS3/D1.cshtml +++ b/src/UDS.Net.Forms/Pages/UDS3/D1.cshtml @@ -835,7 +835,7 @@
- @Html.CheckBox("D1.ALZDIS", Model.D1.ALZDIS, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600" }) + @Html.CheckBox("D1.ALZDIS", Model.D1.ALZDIS, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600" , data_affects = "true", data_affects_toggle_targets = "[ \"D1.ALZDISIF\"]"})
@@ -860,7 +860,7 @@
- @Html.CheckBox("D1.LBDIS", Model.D1.LBDIS, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600" }) + @Html.CheckBox("D1.LBDIS", Model.D1.LBDIS, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600", data_affects = "true", data_affects_toggle_targets = "[ \"D1.LBDIF\", \"D1.PARK\"]"})
@@ -906,7 +906,7 @@
- @Html.CheckBox("D1.MSA", Model.D1.MSA, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600" }) + @Html.CheckBox("D1.MSA", Model.D1.MSA, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600",data_affects = "true", data_affects_toggle_targets = "[ \"D1.MSAIF\"]" })
@@ -940,7 +940,7 @@
- @Html.CheckBox("D1.PSP", Model.D1.PSP, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600" }) + @Html.CheckBox("D1.PSP", Model.D1.PSP, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600",data_affects = "true",data_affects_toggle_targets = "[ \"D1.PSPIF\",\"D1.FTLDSUBT\"]" })
@@ -967,7 +967,7 @@
- @Html.CheckBox("D1.CORT", Model.D1.CORT, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600" }) + @Html.CheckBox("D1.CORT", Model.D1.CORT, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600",data_affects = "true",data_affects_toggle_targets = "[ \"D1.CORTIF\",\"D1.FTLDSUBT\"]" })
@@ -994,7 +994,7 @@
- @Html.CheckBox("D1.FTLDMO", Model.D1.FTLDMO, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600" }) + @Html.CheckBox("D1.FTLDMO", Model.D1.FTLDMO, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600",data_affects = "true",data_affects_toggle_targets = "[ \"D1.FTLDMOIF\",\"D1.FTLDSUBT\"]" })
@@ -1021,7 +1021,7 @@
- @Html.CheckBox("D1.FTLDNOS", Model.D1.FTLDNOS, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600" }) + @Html.CheckBox("D1.FTLDNOS", Model.D1.FTLDNOS, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600",data_affects = "true",data_affects_toggle_targets = "[ \"D1.FTLDNOIF\",\"D1.FTLDSUBT\"]" })
@@ -1041,7 +1041,7 @@

- +
@@ -1067,7 +1067,7 @@
- @Html.CheckBox("D1.CVD", Model.D1.CVD, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600" }) + @Html.CheckBox("D1.CVD", Model.D1.CVD, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600",data_affects = "true",data_affects_toggle_targets = "[ \"D1.CVDIF\",\"D1.PREVSTK\",\"D1.STROKDEC\",\"D1.STKIMAG\",\"D1.INFNETW\",\"D1.INFWMH\"]" })
@@ -1087,7 +1087,7 @@

- +
@@ -1160,7 +1160,7 @@ - + @@ -1185,7 +1185,7 @@ - + @@ -1210,7 +1210,7 @@ - + @@ -1235,7 +1235,7 @@ - + @@ -1260,7 +1260,7 @@ - + @@ -1297,7 +1297,7 @@ - + @@ -1322,7 +1322,7 @@ - + @@ -1347,7 +1347,7 @@ - + @@ -1384,7 +1384,7 @@ - + @@ -1409,7 +1409,7 @@ - + @@ -1446,7 +1446,7 @@ - + @@ -1483,7 +1483,7 @@ - + @@ -1558,7 +1558,7 @@ - + @@ -1583,7 +1583,7 @@ - + @@ -1608,7 +1608,7 @@ - + @@ -1645,7 +1645,7 @@ - + @@ -1682,7 +1682,7 @@ - + @@ -1707,7 +1707,7 @@ - + @@ -1732,7 +1732,7 @@ - + @@ -1757,7 +1757,7 @@ - + @@ -1796,7 +1796,7 @@ - + @@ -1835,7 +1835,7 @@ - + diff --git a/src/UDS.Net.Forms/Pages/UDS3/D1.cshtml.cs b/src/UDS.Net.Forms/Pages/UDS3/D1.cshtml.cs index 06c41e4b..a3966be1 100644 --- a/src/UDS.Net.Forms/Pages/UDS3/D1.cshtml.cs +++ b/src/UDS.Net.Forms/Pages/UDS3/D1.cshtml.cs @@ -87,7 +87,39 @@ public class D1Model : FormPageModel new UIDisableAttribute("D1.MCIN2ATT"), new UIDisableAttribute("D1.MCIN2EX"), new UIDisableAttribute("D1.MCIN2VIS"), - new UIDisableAttribute("D1.IMPNOMCI") + new UIDisableAttribute("D1.IMPNOMCI"), + new UIDisableAttribute("D1.ALZDISIF"), + new UIDisableAttribute("D1.LBDIF"), + new UIDisableAttribute("D1.MSAIF"), + new UIDisableAttribute("D1.PSPIF"), + new UIDisableAttribute("D1.CORTIF"), + new UIDisableAttribute("D1.FTLDMOIF"), + new UIDisableAttribute("D1.FTLDNOIF"), + new UIDisableAttribute("D1.CVDIF"), + new UIDisableAttribute("D1.ESSTREIF"), + new UIDisableAttribute("D1.DOWNSIF"), + new UIDisableAttribute("D1.HUNTIF"), + new UIDisableAttribute("D1.PRIONIF"), + new UIDisableAttribute("D1.BRNINJIF"), + new UIDisableAttribute("D1.HYCEPHIF"), + new UIDisableAttribute("D1.EPILEPIF"), + new UIDisableAttribute("D1.NEOPIF"), + new UIDisableAttribute("D1.HIVIF"), + new UIDisableAttribute("D1.OTHCOGIF"), + new UIDisableAttribute("D1.DEPIF"), + new UIDisableAttribute("D1.BIPOLDIF"), + new UIDisableAttribute("D1.SCHIZOIF"), + new UIDisableAttribute("D1.ANXIETIF"), + new UIDisableAttribute("D1.DELIRIF"), + new UIDisableAttribute("D1.PTSDDXIF"), + new UIDisableAttribute("D1.OTHPSYIF"), + new UIDisableAttribute("D1.ALCDEMIF"), + new UIDisableAttribute("D1.IMPSUBIF"), + new UIDisableAttribute("D1.DYSILLIF"), + new UIDisableAttribute("D1.MEDSIF"), + new UIDisableAttribute("D1.COGOTHIF"), + new UIDisableAttribute("D1.COGOTH2F"), + new UIDisableAttribute("D1.COGOTH3F") }, InstructionalMessage = "Skip to question 6" } }, @@ -144,6 +176,25 @@ public class D1Model : FormPageModel new RadioListItem("No", "0"), new RadioListItem("Yes", "1") }; + public Dictionary PREVSTKUIBehavior = new Dictionary + { + { "0", new UIBehavior { + PropertyAttributes = new List + { + new UIDisableAttribute("D1.STROKDEC"), + new UIDisableAttribute("D1.STKIMAG"), + }, + InstructionalMessage ="If Question 15b PREVSTK = 0 (N0), then skip to question 15c" + } }, + + { "1", new UIBehavior { + PropertyAttributes = new List + { + new UIEnableAttribute("D1.STROKDEC"), + new UIEnableAttribute("D1.STKIMAG"), + } + } } + }; public Dictionary OTHBIOMUIBehavior = new Dictionary { @@ -194,6 +245,15 @@ public class D1Model : FormPageModel new RadioListItem("Unknown", "9") }; + public Dictionary FTLDSUBTUIBehavior = new Dictionary + { + { "1", new UIBehavior { PropertyAttribute = new UIDisableAttribute("D1.FTLDSUBX") } }, + { "2", new UIBehavior { PropertyAttribute = new UIDisableAttribute("D1.FTLDSUBX") } }, + { "3", new UIBehavior { PropertyAttribute = new UIEnableAttribute("D1.FTLDSUBX") } }, + { "9", new UIBehavior { PropertyAttribute = new UIDisableAttribute("D1.FTLDSUBX") } }, + + }; + public List ImagingListItems { get; set; } = new List { new RadioListItem("No", "0"), From 8bf5c2dba3b0aee749bd87361302357324a7ddcc Mon Sep 17 00:00:00 2001 From: Oddvocado <96854090+Oddvocado@users.noreply.github.com> Date: Tue, 10 Oct 2023 11:20:57 -0400 Subject: [PATCH 03/18] Updates demented behavior --- src/UDS.Net.Forms/Pages/UDS3/D1.cshtml.cs | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/src/UDS.Net.Forms/Pages/UDS3/D1.cshtml.cs b/src/UDS.Net.Forms/Pages/UDS3/D1.cshtml.cs index a3966be1..1381467c 100644 --- a/src/UDS.Net.Forms/Pages/UDS3/D1.cshtml.cs +++ b/src/UDS.Net.Forms/Pages/UDS3/D1.cshtml.cs @@ -149,9 +149,26 @@ public class D1Model : FormPageModel new UIEnableAttribute("D1.PPASYNT"), new UIEnableAttribute("D1.FTDSYN"), new UIEnableAttribute("D1.LBDSYN"), - new UIEnableAttribute("D1.NAMNDEM") + new UIEnableAttribute("D1.NAMNDEM"), + new UIDisableAttribute("D1.MCIAMEM"), + new UIDisableAttribute("D1.MCIAPLUS"), + new UIDisableAttribute("D1.MCIAPLAN"), + new UIDisableAttribute("D1.MCIAPATT"), + new UIDisableAttribute("D1.MCIAPEX"), + new UIDisableAttribute("D1.MCIAPVIS"), + new UIDisableAttribute("D1.MCINON1"), + new UIDisableAttribute("D1.MCIN1LAN"), + new UIDisableAttribute("D1.MCIN1ATT"), + new UIDisableAttribute("D1.MCIN1EX"), + new UIDisableAttribute("D1.MCIN1VIS"), + new UIDisableAttribute("D1.MCINON2"), + new UIDisableAttribute("D1.MCIN2LAN"), + new UIDisableAttribute("D1.MCIN2ATT"), + new UIDisableAttribute("D1.MCIN2EX"), + new UIDisableAttribute("D1.MCIN2VIS"), + new UIDisableAttribute("D1.IMPNOMCI"), }, - InstructionalMessage = "Continue to question 4" + InstructionalMessage = "Continue to question 4a-4f and then SKIP TO QUESTION 6" } }, }; From ecca3eea5bda6b440f7ba3f55c0ff97b01f02908 Mon Sep 17 00:00:00 2001 From: Oddvocado <96854090+Oddvocado@users.noreply.github.com> Date: Fri, 13 Oct 2023 14:10:25 -0400 Subject: [PATCH 04/18] Adds client side validation to section 3 --- src/UDS.Net.Forms/Pages/UDS3/D1.cshtml | 48 +++++++++++++------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/src/UDS.Net.Forms/Pages/UDS3/D1.cshtml b/src/UDS.Net.Forms/Pages/UDS3/D1.cshtml index 4a65fbe4..d3629caa 100644 --- a/src/UDS.Net.Forms/Pages/UDS3/D1.cshtml +++ b/src/UDS.Net.Forms/Pages/UDS3/D1.cshtml @@ -1148,7 +1148,7 @@
- @Html.CheckBox("D1.ESSTREM", Model.D1.ESSTREM, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600" }) + @Html.CheckBox("D1.ESSTREM", Model.D1.ESSTREM, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600", data_affects = "true", data_affects_toggle_targets = "[ \"D1.ESSTREIF\"]"})
@@ -1173,7 +1173,7 @@
- @Html.CheckBox("D1.DOWNS", Model.D1.DOWNS, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600" }) + @Html.CheckBox("D1.DOWNS", Model.D1.DOWNS, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600" , data_affects = "true", data_affects_toggle_targets = "[ \"D1.DOWNSIF\"]"})
@@ -1198,7 +1198,7 @@
- @Html.CheckBox("D1.HUNT", Model.D1.HUNT, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600" }) + @Html.CheckBox("D1.HUNT", Model.D1.HUNT, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600", data_affects = "true", data_affects_toggle_targets = "[ \"D1.HUNTIF\"]" })
@@ -1223,7 +1223,7 @@
- @Html.CheckBox("D1.PRION", Model.D1.PRION, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600" }) + @Html.CheckBox("D1.PRION", Model.D1.PRION, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600", data_affects = "true", data_affects_toggle_targets = "[ \"D1.PRIONIF\"]"})
@@ -1248,7 +1248,7 @@
- @Html.CheckBox("D1.BRNINJ", Model.D1.BRNINJ, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600" }) + @Html.CheckBox("D1.BRNINJ", Model.D1.BRNINJ, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600", data_affects = "true", data_affects_toggle_targets = "[ \"D1.BRNINJIF\",\"D1.BRNINCTE\"]" })
@@ -1285,7 +1285,7 @@
- @Html.CheckBox("D1.HYCEPH", Model.D1.HYCEPH, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600" }) + @Html.CheckBox("D1.HYCEPH", Model.D1.HYCEPH, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600", data_affects = "true", data_affects_toggle_targets = "[ \"D1.HYCEPHIF\"]" })
@@ -1310,7 +1310,7 @@
- @Html.CheckBox("D1.EPILEP", Model.D1.EPILEP, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600" }) + @Html.CheckBox("D1.EPILEP", Model.D1.EPILEP, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600", data_affects = "true", data_affects_toggle_targets = "[ \"D1.EPILEPIF\"]"})
@@ -1335,7 +1335,7 @@
- @Html.CheckBox("D1.NEOP", Model.D1.NEOP, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600" }) + @Html.CheckBox("D1.NEOP", Model.D1.NEOP, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600", data_affects = "true", data_affects_toggle_targets = "[ \"D1.NEOPIF\", \"D1.NEOPSTAT\"]" })
@@ -1372,7 +1372,7 @@
- @Html.CheckBox("D1.HIV", Model.D1.HIV, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600" }) + @Html.CheckBox("D1.HIV", Model.D1.HIV, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600" , data_affects = "true", data_affects_toggle_targets = "[ \"D1.HIVIF\"]" })
@@ -1397,7 +1397,7 @@
- @Html.CheckBox("D1.OTHCOG", Model.D1.OTHCOG, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600" }) + @Html.CheckBox("D1.OTHCOG", Model.D1.OTHCOG, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600" , data_affects = "true", data_affects_toggle_targets = "[ \"D1.OTHCOGIF\",\"D1.OTHCOGX\"]" })
@@ -1434,7 +1434,7 @@
- @Html.CheckBox("D1.DEP", Model.D1.DEP, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600" }) + @Html.CheckBox("D1.DEP", Model.D1.DEP, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600", data_affects = "true", data_affects_toggle_targets = "[ \"D1.DEPIF\" , \"D1.DEPTREAT\"]" })
@@ -1471,7 +1471,7 @@
- @Html.CheckBox("D1.BIPOLDX", Model.D1.BIPOLDX, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600" }) + @Html.CheckBox("D1.BIPOLDX", Model.D1.BIPOLDX, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600", data_affects = "true", data_affects_toggle_targets = "[ \"D1.BIPOLDIF\"]" })
@@ -1496,7 +1496,7 @@
- @Html.CheckBox("D1.SCHIZOP", Model.D1.SCHIZOP, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600" }) + @Html.CheckBox("D1.SCHIZOP", Model.D1.SCHIZOP, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600" , data_affects = "true", data_affects_toggle_targets = "[ \"D1.SCHIZOIF\"]" })
@@ -1521,7 +1521,7 @@
- @Html.CheckBox("D1.ANXIET", Model.D1.ANXIET, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600" }) + @Html.CheckBox("D1.ANXIET", Model.D1.ANXIET, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600", data_affects = "true", data_affects_toggle_targets = "[ \"D1.ANXIETIF\"]" })
@@ -1546,7 +1546,7 @@
- @Html.CheckBox("D1.DELIR", Model.D1.DELIR, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600" }) + @Html.CheckBox("D1.DELIR", Model.D1.DELIR, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600", data_affects = "true", data_affects_toggle_targets = "[ \"D1.DELIRIF\"]" })
@@ -1571,7 +1571,7 @@
- @Html.CheckBox("D1.PTSDDX", Model.D1.PTSDDX, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600" }) + @Html.CheckBox("D1.PTSDDX", Model.D1.PTSDDX, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600", data_affects = "true", data_affects_toggle_targets = "[ \"D1.PTSDDXIF\"]" })
@@ -1596,7 +1596,7 @@
- @Html.CheckBox("D1.OTHPSY", Model.D1.OTHPSY, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600" }) + @Html.CheckBox("D1.OTHPSY", Model.D1.OTHPSY, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600", data_affects = "true", data_affects_toggle_targets = "[ \"D1.OTHPSYIF\" , \"D1.OTHPSYX\"]" })
@@ -1633,7 +1633,7 @@
- @Html.CheckBox("D1.ALCDEM", Model.D1.ALCDEM, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600" }) + @Html.CheckBox("D1.ALCDEM", Model.D1.ALCDEM, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600", data_affects = "true", data_affects_toggle_targets = "[ \"D1.ALCDEMIF\" , \"D1.ALCABUSE\"]" })
@@ -1670,7 +1670,7 @@
- @Html.CheckBox("D1.IMPSUB", Model.D1.IMPSUB, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600" }) + @Html.CheckBox("D1.IMPSUB", Model.D1.IMPSUB, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600", data_affects = "true", data_affects_toggle_targets = "[ \"D1.IMPSUBIF\"]" })
@@ -1695,7 +1695,7 @@
- @Html.CheckBox("D1.DYSILL", Model.D1.DYSILL, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600" }) + @Html.CheckBox("D1.DYSILL", Model.D1.DYSILL, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600", data_affects = "true", data_affects_toggle_targets = "[ \"D1.DYSILLIF\"]" })
@@ -1720,7 +1720,7 @@
- @Html.CheckBox("D1.MEDS", Model.D1.MEDS, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600" }) + @Html.CheckBox("D1.MEDS", Model.D1.MEDS, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600", data_affects = "true", data_affects_toggle_targets = "[ \"D1.MEDSIF\"]"})
@@ -1745,7 +1745,7 @@
- @Html.CheckBox("D1.COGOTH", Model.D1.COGOTH, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600" }) + @Html.CheckBox("D1.COGOTH", Model.D1.COGOTH, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600", data_affects = "true", data_affects_toggle_targets = "[ \"D1.COGOTHIF\", \"D1.COGOTHX\"]" })
@@ -1784,7 +1784,7 @@
- @Html.CheckBox("D1.COGOTH2", Model.D1.COGOTH2, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600" }) + @Html.CheckBox("D1.COGOTH2", Model.D1.COGOTH2, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600", data_affects = "true", data_affects_toggle_targets = "[ \"D1.COGOTH2F\", \"D1.COGOTH2X\"]" })
@@ -1823,7 +1823,7 @@
- @Html.CheckBox("D1.COGOTH3", Model.D1.COGOTH3, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600" }) + @Html.CheckBox("D1.COGOTH3", Model.D1.COGOTH3, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600" , data_affects = "true", data_affects_toggle_targets = "[ \"D1.COGOTH3F\", \"D1.COGOTH3X\"]"})
From c7d23f8547ab434973aa698b8467b702b9aa2bfb Mon Sep 17 00:00:00 2001 From: Oddvocado <96854090+Oddvocado@users.noreply.github.com> Date: Mon, 16 Oct 2023 09:14:34 -0400 Subject: [PATCH 05/18] Updates form layout --- src/UDS.Net.Forms/Pages/UDS3/D1.cshtml | 8 ++++---- src/UDS.Net.Forms/Pages/UDS3/D1.cshtml.cs | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/src/UDS.Net.Forms/Pages/UDS3/D1.cshtml b/src/UDS.Net.Forms/Pages/UDS3/D1.cshtml index d3629caa..f89a0e99 100644 --- a/src/UDS.Net.Forms/Pages/UDS3/D1.cshtml +++ b/src/UDS.Net.Forms/Pages/UDS3/D1.cshtml @@ -69,7 +69,7 @@

- +
@@ -110,7 +110,7 @@

- +
@@ -1058,7 +1058,7 @@ - +

@@ -1087,7 +1087,7 @@

- +
diff --git a/src/UDS.Net.Forms/Pages/UDS3/D1.cshtml.cs b/src/UDS.Net.Forms/Pages/UDS3/D1.cshtml.cs index 1381467c..9d9fb18b 100644 --- a/src/UDS.Net.Forms/Pages/UDS3/D1.cshtml.cs +++ b/src/UDS.Net.Forms/Pages/UDS3/D1.cshtml.cs @@ -193,6 +193,24 @@ public class D1Model : FormPageModel new RadioListItem("No", "0"), new RadioListItem("Yes", "1") }; + + public List NORMCOGListItems { get; set; } = new List + { + new RadioListItem("No (CONTINUE TO QUESTION 3)", "0"), + new RadioListItem("Yes (SKIP TO QUESTION 6)", "1") + }; + + public List DEMENTEDListItems { get; set; } = new List + { + new RadioListItem("No (SKIP TO QUESTION 5)", "0"), + new RadioListItem("Yes (CONTINUE TO QUESTION 4)", "1") + }; + + public List PREVSTKListItems { get; set; } = new List + { + new RadioListItem("No (SKIP TO QUESTION 15c)", "0"), + new RadioListItem("Yes", "1") + }; public Dictionary PREVSTKUIBehavior = new Dictionary { { "0", new UIBehavior { From dc23c081782dc45949985e9de31810e9d7560494 Mon Sep 17 00:00:00 2001 From: Ashley Wilson Date: Tue, 17 Oct 2023 10:51:04 -0400 Subject: [PATCH 06/18] Add structure for stimulus controller for checkboxes --- src/UDS.Net.Forms/Pages/UDS3/D1.cshtml | 44 +++++++++---------- .../fancycheckboxes_controller.js | 7 +++ .../wwwroot/js/stimulus_controllers.js | 4 +- 3 files changed, 32 insertions(+), 23 deletions(-) create mode 100644 src/UDS.Net.Forms/wwwroot/js/js_controllers/fancycheckboxes_controller.js diff --git a/src/UDS.Net.Forms/Pages/UDS3/D1.cshtml b/src/UDS.Net.Forms/Pages/UDS3/D1.cshtml index f89a0e99..23f98b97 100644 --- a/src/UDS.Net.Forms/Pages/UDS3/D1.cshtml +++ b/src/UDS.Net.Forms/Pages/UDS3/D1.cshtml @@ -115,7 +115,7 @@
-
+

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. @@ -320,7 +320,7 @@

- @Html.CheckBox("D1.MCIAMEM", Model.D1.MCIAMEM, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600", }) + @Html.CheckBox("D1.MCIAMEM", Model.D1.MCIAMEM, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600", })
@@ -345,7 +345,7 @@
- @Html.CheckBox("D1.MCIAPLUS", Model.D1.MCIAPLUS, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600", data_affects = "true", data_affects_toggle_targets = "[ \"D1.MCIAPLAN\" , \"D1.MCIAPATT\" , \"D1.MCIAPEX\" ,\"D1.MCIAPVIS\" ]" }) + @Html.CheckBox("D1.MCIAPLUS", Model.D1.MCIAPLUS, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600", data_affects = "true", data_affects_toggle_targets = "[ \"D1.MCIAPLAN\" , \"D1.MCIAPATT\" , \"D1.MCIAPEX\" ,\"D1.MCIAPVIS\" ]" })
@@ -413,7 +413,7 @@
- @Html.CheckBox("D1.MCINON1", Model.D1.MCINON1, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600", data_affects = "true", data_affects_toggle_targets = "[ \"D1.MCIN1LAN\" , \"D1.MCIN1ATT\" , \"D1.MCIN1EX\" ,\"D1.MCIN1VIS\" ]"}) + @Html.CheckBox("D1.MCINON1", Model.D1.MCINON1, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600", data_affects = "true", data_affects_toggle_targets = "[ \"D1.MCIN1LAN\" , \"D1.MCIN1ATT\" , \"D1.MCIN1EX\" ,\"D1.MCIN1VIS\" ]" })
@@ -481,7 +481,7 @@
- @Html.CheckBox("D1.MCINON2", Model.D1.MCINON2, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600", data_affects = "true", data_affects_toggle_targets = "[ \"D1.MCIN2LAN\" , \"D1.MCIN2ATT\" , \"D1.MCIN2EX\" ,\"D1.MCIN2VIS\" ]" }) + @Html.CheckBox("D1.MCINON2", Model.D1.MCINON2, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600", data_affects = "true", data_affects_toggle_targets = "[ \"D1.MCIN2LAN\" , \"D1.MCIN2ATT\" , \"D1.MCIN2EX\" ,\"D1.MCIN2VIS\" ]" })
@@ -835,7 +835,7 @@
- @Html.CheckBox("D1.ALZDIS", Model.D1.ALZDIS, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600" , data_affects = "true", data_affects_toggle_targets = "[ \"D1.ALZDISIF\"]"}) + @Html.CheckBox("D1.ALZDIS", Model.D1.ALZDIS, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600", data_affects = "true", data_affects_toggle_targets = "[ \"D1.ALZDISIF\"]" })
@@ -860,7 +860,7 @@
- @Html.CheckBox("D1.LBDIS", Model.D1.LBDIS, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600", data_affects = "true", data_affects_toggle_targets = "[ \"D1.LBDIF\", \"D1.PARK\"]"}) + @Html.CheckBox("D1.LBDIS", Model.D1.LBDIS, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600", data_affects = "true", data_affects_toggle_targets = "[ \"D1.LBDIF\", \"D1.PARK\"]" })
@@ -906,7 +906,7 @@
- @Html.CheckBox("D1.MSA", Model.D1.MSA, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600",data_affects = "true", data_affects_toggle_targets = "[ \"D1.MSAIF\"]" }) + @Html.CheckBox("D1.MSA", Model.D1.MSA, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600", data_affects = "true", data_affects_toggle_targets = "[ \"D1.MSAIF\"]" })
@@ -940,7 +940,7 @@
- @Html.CheckBox("D1.PSP", Model.D1.PSP, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600",data_affects = "true",data_affects_toggle_targets = "[ \"D1.PSPIF\",\"D1.FTLDSUBT\"]" }) + @Html.CheckBox("D1.PSP", Model.D1.PSP, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600", data_affects = "true", data_affects_toggle_targets = "[ \"D1.PSPIF\",\"D1.FTLDSUBT\"]" })
@@ -967,7 +967,7 @@
- @Html.CheckBox("D1.CORT", Model.D1.CORT, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600",data_affects = "true",data_affects_toggle_targets = "[ \"D1.CORTIF\",\"D1.FTLDSUBT\"]" }) + @Html.CheckBox("D1.CORT", Model.D1.CORT, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600", data_affects = "true", data_affects_toggle_targets = "[ \"D1.CORTIF\",\"D1.FTLDSUBT\"]" })
@@ -994,7 +994,7 @@
- @Html.CheckBox("D1.FTLDMO", Model.D1.FTLDMO, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600",data_affects = "true",data_affects_toggle_targets = "[ \"D1.FTLDMOIF\",\"D1.FTLDSUBT\"]" }) + @Html.CheckBox("D1.FTLDMO", Model.D1.FTLDMO, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600", data_affects = "true", data_affects_toggle_targets = "[ \"D1.FTLDMOIF\",\"D1.FTLDSUBT\"]" })
@@ -1021,7 +1021,7 @@
- @Html.CheckBox("D1.FTLDNOS", Model.D1.FTLDNOS, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600",data_affects = "true",data_affects_toggle_targets = "[ \"D1.FTLDNOIF\",\"D1.FTLDSUBT\"]" }) + @Html.CheckBox("D1.FTLDNOS", Model.D1.FTLDNOS, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600", data_affects = "true", data_affects_toggle_targets = "[ \"D1.FTLDNOIF\",\"D1.FTLDSUBT\"]" })
@@ -1067,7 +1067,7 @@
- @Html.CheckBox("D1.CVD", Model.D1.CVD, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600",data_affects = "true",data_affects_toggle_targets = "[ \"D1.CVDIF\",\"D1.PREVSTK\",\"D1.STROKDEC\",\"D1.STKIMAG\",\"D1.INFNETW\",\"D1.INFWMH\"]" }) + @Html.CheckBox("D1.CVD", Model.D1.CVD, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600", data_affects = "true", data_affects_toggle_targets = "[ \"D1.CVDIF\",\"D1.PREVSTK\",\"D1.STROKDEC\",\"D1.STKIMAG\",\"D1.INFNETW\",\"D1.INFWMH\"]" })
@@ -1148,7 +1148,7 @@
- @Html.CheckBox("D1.ESSTREM", Model.D1.ESSTREM, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600", data_affects = "true", data_affects_toggle_targets = "[ \"D1.ESSTREIF\"]"}) + @Html.CheckBox("D1.ESSTREM", Model.D1.ESSTREM, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600", data_affects = "true", data_affects_toggle_targets = "[ \"D1.ESSTREIF\"]" })
@@ -1173,7 +1173,7 @@
- @Html.CheckBox("D1.DOWNS", Model.D1.DOWNS, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600" , data_affects = "true", data_affects_toggle_targets = "[ \"D1.DOWNSIF\"]"}) + @Html.CheckBox("D1.DOWNS", Model.D1.DOWNS, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600", data_affects = "true", data_affects_toggle_targets = "[ \"D1.DOWNSIF\"]" })
@@ -1223,7 +1223,7 @@
- @Html.CheckBox("D1.PRION", Model.D1.PRION, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600", data_affects = "true", data_affects_toggle_targets = "[ \"D1.PRIONIF\"]"}) + @Html.CheckBox("D1.PRION", Model.D1.PRION, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600", data_affects = "true", data_affects_toggle_targets = "[ \"D1.PRIONIF\"]" })
@@ -1310,7 +1310,7 @@
- @Html.CheckBox("D1.EPILEP", Model.D1.EPILEP, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600", data_affects = "true", data_affects_toggle_targets = "[ \"D1.EPILEPIF\"]"}) + @Html.CheckBox("D1.EPILEP", Model.D1.EPILEP, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600", data_affects = "true", data_affects_toggle_targets = "[ \"D1.EPILEPIF\"]" })
@@ -1372,7 +1372,7 @@
- @Html.CheckBox("D1.HIV", Model.D1.HIV, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600" , data_affects = "true", data_affects_toggle_targets = "[ \"D1.HIVIF\"]" }) + @Html.CheckBox("D1.HIV", Model.D1.HIV, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600", data_affects = "true", data_affects_toggle_targets = "[ \"D1.HIVIF\"]" })
@@ -1397,7 +1397,7 @@
- @Html.CheckBox("D1.OTHCOG", Model.D1.OTHCOG, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600" , data_affects = "true", data_affects_toggle_targets = "[ \"D1.OTHCOGIF\",\"D1.OTHCOGX\"]" }) + @Html.CheckBox("D1.OTHCOG", Model.D1.OTHCOG, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600", data_affects = "true", data_affects_toggle_targets = "[ \"D1.OTHCOGIF\",\"D1.OTHCOGX\"]" })
@@ -1496,7 +1496,7 @@
- @Html.CheckBox("D1.SCHIZOP", Model.D1.SCHIZOP, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600" , data_affects = "true", data_affects_toggle_targets = "[ \"D1.SCHIZOIF\"]" }) + @Html.CheckBox("D1.SCHIZOP", Model.D1.SCHIZOP, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600", data_affects = "true", data_affects_toggle_targets = "[ \"D1.SCHIZOIF\"]" })
@@ -1720,7 +1720,7 @@
- @Html.CheckBox("D1.MEDS", Model.D1.MEDS, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600", data_affects = "true", data_affects_toggle_targets = "[ \"D1.MEDSIF\"]"}) + @Html.CheckBox("D1.MEDS", Model.D1.MEDS, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600", data_affects = "true", data_affects_toggle_targets = "[ \"D1.MEDSIF\"]" })
@@ -1823,7 +1823,7 @@
- @Html.CheckBox("D1.COGOTH3", Model.D1.COGOTH3, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600" , data_affects = "true", data_affects_toggle_targets = "[ \"D1.COGOTH3F\", \"D1.COGOTH3X\"]"}) + @Html.CheckBox("D1.COGOTH3", Model.D1.COGOTH3, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600", data_affects = "true", data_affects_toggle_targets = "[ \"D1.COGOTH3F\", \"D1.COGOTH3X\"]" })
diff --git a/src/UDS.Net.Forms/wwwroot/js/js_controllers/fancycheckboxes_controller.js b/src/UDS.Net.Forms/wwwroot/js/js_controllers/fancycheckboxes_controller.js new file mode 100644 index 00000000..4c3efb37 --- /dev/null +++ b/src/UDS.Net.Forms/wwwroot/js/js_controllers/fancycheckboxes_controller.js @@ -0,0 +1,7 @@ +import { Controller } from '@hotwired/stimulus'; + +export default class extends Controller { + connect() { + console.log("Hello, Stimulus!", this.element) + } +} \ No newline at end of file diff --git a/src/UDS.Net.Forms/wwwroot/js/stimulus_controllers.js b/src/UDS.Net.Forms/wwwroot/js/stimulus_controllers.js index a8611035..842dc8c2 100644 --- a/src/UDS.Net.Forms/wwwroot/js/stimulus_controllers.js +++ b/src/UDS.Net.Forms/wwwroot/js/stimulus_controllers.js @@ -2,9 +2,11 @@ /* Import custom stimulus controllers */ import Dropdown from "./js_controllers/dropdown_controller.js" import MobileMenu from "./js_controllers/mobilemenu_controller.js" +import FancyCheckboxes from "./js_controllers/fancycheckboxes_controller.js" window.Stimulus = Application.start() /* Register custom stimulus controllers*/ Stimulus.register("dropdown", Dropdown) -Stimulus.register("mobilemenu", MobileMenu) \ No newline at end of file +Stimulus.register("mobilemenu", MobileMenu) +Stimulus.register("fancycheckboxes", FancyCheckboxes) \ No newline at end of file From 1dd2c3eeb26ce5c8dbdeaaf9574b47cd16887890 Mon Sep 17 00:00:00 2001 From: Oddvocado <96854090+Oddvocado@users.noreply.github.com> Date: Tue, 17 Oct 2023 19:58:03 -0400 Subject: [PATCH 07/18] Implementing fancy checkboxes --- src/UDS.Net.Forms/Pages/UDS3/D1.cshtml | 14 +++++------ .../fancycheckboxes_controller.js | 23 ++++++++++++++++--- 2 files changed, 27 insertions(+), 10 deletions(-) diff --git a/src/UDS.Net.Forms/Pages/UDS3/D1.cshtml b/src/UDS.Net.Forms/Pages/UDS3/D1.cshtml index 23f98b97..51161e44 100644 --- a/src/UDS.Net.Forms/Pages/UDS3/D1.cshtml +++ b/src/UDS.Net.Forms/Pages/UDS3/D1.cshtml @@ -115,7 +115,7 @@
-
+

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. @@ -292,7 +292,7 @@

- +
@@ -320,7 +320,7 @@
- @Html.CheckBox("D1.MCIAMEM", Model.D1.MCIAMEM, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600", }) + @Html.CheckBox("D1.MCIAMEM", Model.D1.MCIAMEM, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600", data_target= "fancycheckboxes.checkbox" })
@@ -345,7 +345,7 @@
- @Html.CheckBox("D1.MCIAPLUS", Model.D1.MCIAPLUS, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600", data_affects = "true", data_affects_toggle_targets = "[ \"D1.MCIAPLAN\" , \"D1.MCIAPATT\" , \"D1.MCIAPEX\" ,\"D1.MCIAPVIS\" ]" }) + @Html.CheckBox("D1.MCIAPLUS", Model.D1.MCIAPLUS, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600", data_affects = "true", data_affects_toggle_targets = "[ \"D1.MCIAPLAN\" , \"D1.MCIAPATT\" , \"D1.MCIAPEX\" ,\"D1.MCIAPVIS\" ]",data_target= "fancycheckboxes.checkbox" })
@@ -413,7 +413,7 @@
- @Html.CheckBox("D1.MCINON1", Model.D1.MCINON1, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600", data_affects = "true", data_affects_toggle_targets = "[ \"D1.MCIN1LAN\" , \"D1.MCIN1ATT\" , \"D1.MCIN1EX\" ,\"D1.MCIN1VIS\" ]" }) + @Html.CheckBox("D1.MCINON1", Model.D1.MCINON1, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600", data_affects = "true", data_affects_toggle_targets = "[ \"D1.MCIN1LAN\" , \"D1.MCIN1ATT\" , \"D1.MCIN1EX\" ,\"D1.MCIN1VIS\" ]",data_target= "fancycheckboxes.checkbox" })
@@ -481,7 +481,7 @@
- @Html.CheckBox("D1.MCINON2", Model.D1.MCINON2, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600", data_affects = "true", data_affects_toggle_targets = "[ \"D1.MCIN2LAN\" , \"D1.MCIN2ATT\" , \"D1.MCIN2EX\" ,\"D1.MCIN2VIS\" ]" }) + @Html.CheckBox("D1.MCINON2", Model.D1.MCINON2, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600", data_affects = "true", data_affects_toggle_targets = "[ \"D1.MCIN2LAN\" , \"D1.MCIN2ATT\" , \"D1.MCIN2EX\" ,\"D1.MCIN2VIS\" ]", data_target= "fancycheckboxes.checkbox" })
@@ -549,7 +549,7 @@
- @Html.CheckBox("D1.IMPNOMCI", Model.D1.IMPNOMCI, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600" }) + @Html.CheckBox("D1.IMPNOMCI", Model.D1.IMPNOMCI, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600", data_target= "fancycheckboxes.checkbox" })
diff --git a/src/UDS.Net.Forms/wwwroot/js/js_controllers/fancycheckboxes_controller.js b/src/UDS.Net.Forms/wwwroot/js/js_controllers/fancycheckboxes_controller.js index 4c3efb37..457a952f 100644 --- a/src/UDS.Net.Forms/wwwroot/js/js_controllers/fancycheckboxes_controller.js +++ b/src/UDS.Net.Forms/wwwroot/js/js_controllers/fancycheckboxes_controller.js @@ -1,7 +1,24 @@ import { Controller } from '@hotwired/stimulus'; export default class extends Controller { - connect() { - console.log("Hello, Stimulus!", this.element) - } + static targets = ['checkbox'] + + connect() { + this.checkboxTargets.forEach((checkbox) => { + checkbox.addEventListener('change', () => this.checkboxChange(checkbox)) + }) + } + + checkboxChange(selectedCheckbox) { + this.checkboxTargets.forEach((checkbox) => { + if (checkbox !== selectedCheckbox) { + checkbox.checked = false; + checkbox.disabled = false; + } + }) + + if (selectedCheckbox.checked) { + selectedCheckbox.disabled = false; + } + } } \ No newline at end of file From 7285fff4e5591663d35ba16f49e21d828119e809 Mon Sep 17 00:00:00 2001 From: Oddvocado <96854090+Oddvocado@users.noreply.github.com> Date: Wed, 18 Oct 2023 08:14:58 -0400 Subject: [PATCH 08/18] Corrects etiologic radio button values --- src/UDS.Net.Forms/Pages/UDS3/D1.cshtml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/UDS.Net.Forms/Pages/UDS3/D1.cshtml b/src/UDS.Net.Forms/Pages/UDS3/D1.cshtml index 51161e44..f61b3913 100644 --- a/src/UDS.Net.Forms/Pages/UDS3/D1.cshtml +++ b/src/UDS.Net.Forms/Pages/UDS3/D1.cshtml @@ -918,7 +918,7 @@
- + @@ -952,7 +952,7 @@ - + - + - + - + - +
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.
@@ -979,7 +979,7 @@
@@ -1006,7 +1006,7 @@
@@ -1033,7 +1033,7 @@
@@ -1079,7 +1079,7 @@
From a45905205d39bb9026e67cfeb8cc624935e58999 Mon Sep 17 00:00:00 2001 From: Oddvocado <96854090+Oddvocado@users.noreply.github.com> Date: Wed, 18 Oct 2023 15:08:18 -0400 Subject: [PATCH 09/18] Fixes section 5 validation bug --- src/UDS.Net.Forms/Pages/UDS3/D1.cshtml.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/UDS.Net.Forms/Pages/UDS3/D1.cshtml.cs b/src/UDS.Net.Forms/Pages/UDS3/D1.cshtml.cs index 9d9fb18b..5eebf53d 100644 --- a/src/UDS.Net.Forms/Pages/UDS3/D1.cshtml.cs +++ b/src/UDS.Net.Forms/Pages/UDS3/D1.cshtml.cs @@ -136,7 +136,13 @@ public class D1Model : FormPageModel new UIDisableAttribute("D1.PPASYNT"), new UIDisableAttribute("D1.FTDSYN"), new UIDisableAttribute("D1.LBDSYN"), - new UIDisableAttribute("D1.NAMNDEM") + new UIDisableAttribute("D1.NAMNDEM"), + new UIEnableAttribute("D1.MCIAMEM"), + new UIEnableAttribute("D1.MCIAPLUS"), + new UIEnableAttribute("D1.MCINON1"), + new UIEnableAttribute("D1.MCINON2"), + new UIEnableAttribute("D1.IMPNOMCI"), + }, InstructionalMessage = "Skip to question 5" } }, From 4c3c6582675dbc98ae0be43b99e7b0d2976c2e18 Mon Sep 17 00:00:00 2001 From: Oddvocado <96854090+Oddvocado@users.noreply.github.com> Date: Thu, 19 Oct 2023 10:57:17 -0400 Subject: [PATCH 10/18] Adds validation for questions 11a-39a --- src/UDS.Net.Forms/Models/UDS3/D1.cs | 186 ++++++++++++++++++++++++++++ 1 file changed, 186 insertions(+) diff --git a/src/UDS.Net.Forms/Models/UDS3/D1.cs b/src/UDS.Net.Forms/Models/UDS3/D1.cs index 3b5b25a1..df526e47 100644 --- a/src/UDS.Net.Forms/Models/UDS3/D1.cs +++ b/src/UDS.Net.Forms/Models/UDS3/D1.cs @@ -11,6 +11,7 @@ namespace UDS.Net.Forms.Models.UDS3 /// public class D1 : FormModel { + #region Cognitive and behavioral status [Display(Name = "Diagnosis method — responses in this form are based on diagnosis by")] public int? DXMETHOD { get; set; } @@ -188,6 +189,8 @@ public bool? NonAmnesticMCIMultipleDomainsIndicated [Display(Name = "Cognitively impaired, not MCI")] public bool IMPNOMCI { get; set; } + #endregion + #region Biomarkers, imaging and genetics [Display(Name = "Abnormally elevated amyloid on PET")] public int? AMYLPET { get; set; } @@ -260,6 +263,189 @@ public bool? NonAmnesticMCIMultipleDomainsIndicated [ProhibitedCharacters] public string? OTHMUTX { get; set; } + #endregion + + #region One Primary Diagnosis Allowed Questions 11a-39a + [RequiredOnComplete(ErrorMessage = "In Section 3, only ONE diagnosis should be indicated as primary.")] + [NotMapped] + public bool? OnePrimaryDiagnosisAllowed + { + get + { + int counter = 0; + + if (ALZDISIF.HasValue && ALZDISIF == 1) + { + counter++; + } + if (LBDIF.HasValue && LBDIF == 1) + { + counter++; + } + + if (MSAIF.HasValue && MSAIF == 1) + { + counter++; + } + if (PSPIF.HasValue && PSPIF == 1) + { + counter++; + } + if (CORTIF.HasValue && CORTIF == 1) + { + counter++; + } + + if (FTLDMOIF.HasValue && FTLDMOIF == 1) + { + counter++; + } + if (FTLDNOIF.HasValue && FTLDNOIF == 1) + { + counter++; + } + if (CVDIF.HasValue && CVDIF == 1) + { + counter++; + } + if (ESSTREIF.HasValue && ESSTREIF == 1) + { + counter++; + } + if (DOWNSIF.HasValue && DOWNSIF == 1) + { + counter++; + } + if (HUNTIF.HasValue && HUNTIF == 1) + { + counter++; + } + + if (PRIONIF.HasValue && PRIONIF == 1) + { + counter++; + } + + { + if (BRNINJIF.HasValue && BRNINJIF == 1) + counter++; + } + + if (HYCEPHIF.HasValue && HYCEPHIF == 1) + { + counter++; + } + + if (EPILEPIF.HasValue && EPILEPIF == 1) + { + counter++; + } + + if (NEOPIF.HasValue && NEOPIF == 1) + { + counter++; + } + + if (HIVIF.HasValue && HIVIF == 1) + { + counter++; + } + + if (OTHCOGIF.HasValue && OTHCOGIF == 1) + { + counter++; + } + + if (DEPIF.HasValue && DEPIF == 1) + { + counter++; + } + + if (BIPOLDIF.HasValue && BIPOLDIF == 1) + { + counter++; + } + + if (SCHIZOIF.HasValue && SCHIZOIF == 1) + { + counter++; + } + + if (ANXIETIF.HasValue && ANXIETIF == 1) + { + counter++; + } + + if (DELIRIF.HasValue && DELIRIF == 1) + { + counter++; + } + + if (PTSDDXIF.HasValue && PTSDDXIF == 1) + { + counter++; + } + + if (OTHPSYIF.HasValue && OTHPSYIF == 1) + { + counter++; + } + + if (ALCDEMIF.HasValue && ALCDEMIF == 1) + { + counter++; + } + + + if (IMPSUBIF.HasValue && IMPSUBIF == 1) + { + counter++; + } + + if (DYSILLIF.HasValue && DYSILLIF == 1) + { + counter++; + } + + if (MEDSIF.HasValue && MEDSIF == 1) + { + counter++; + } + + if (COGOTHIF.HasValue && COGOTHIF == 1) + { + counter++; + } + + if (COGOTH2F.HasValue && COGOTH2F == 1) + { + counter++; + } + + if (COGOTH3F.HasValue && COGOTH3F == 1) + { + counter++; + } + + + if (counter == 1) + { + return true; + } + + else + { + if (NORMCOG.HasValue && NORMCOG == 1 && counter == 0) + { + return true; + } + return null; + } + } + } + + #endregion + [Display(Name = "Alzheimer's disease")] public bool ALZDIS { get; set; } From 61b3d30e42687766ab46317df2b79881bcc5fd5a Mon Sep 17 00:00:00 2001 From: Oddvocado <96854090+Oddvocado@users.noreply.github.com> Date: Fri, 20 Oct 2023 10:37:53 -0400 Subject: [PATCH 11/18] Additional validation section 2 --- src/UDS.Net.Forms/Models/UDS3/D1.cs | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/src/UDS.Net.Forms/Models/UDS3/D1.cs b/src/UDS.Net.Forms/Models/UDS3/D1.cs index df526e47..e385a366 100644 --- a/src/UDS.Net.Forms/Models/UDS3/D1.cs +++ b/src/UDS.Net.Forms/Models/UDS3/D1.cs @@ -192,36 +192,47 @@ public bool? NonAmnesticMCIMultipleDomainsIndicated #endregion #region Biomarkers, imaging and genetics [Display(Name = "Abnormally elevated amyloid on PET")] + [RequiredOnComplete] public int? AMYLPET { get; set; } [Display(Name = "Abnormally low amyloid in CSF")] + [RequiredOnComplete] public int? AMYLCSF { get; set; } [Display(Name = "FDG-PET pattern of AD")] + [RequiredOnComplete] public int? FDGAD { get; set; } [Display(Name = "Hippocampal atrophy")] + [RequiredOnComplete] public int? HIPPATR { get; set; } [Display(Name = "Tau PET evidence for AD")] + [RequiredOnComplete] public int? TAUPETAD { get; set; } [Display(Name = "Abnormally elevated CSF tau or ptau")] + [RequiredOnComplete] public int? CSFTAU { get; set; } [Display(Name = "FDG-PET evidence for frontal or anterior temporal hypometabolism for FTLD")] + [RequiredOnComplete] public int? FDGFTLD { get; set; } [Display(Name = "Tau PET evidence for FTLD")] + [RequiredOnComplete] public int? TPETFTLD { get; set; } [Display(Name = "Structural MR evidence for frontal or anterior temporal atrophy for FTLD")] + [RequiredOnComplete] public int? MRFTLD { get; set; } [Display(Name = "Dopamine transporter scan (DATscan) evidence for Lewy body disease")] + [RequiredOnComplete] public int? DATSCAN { get; set; } [Display(Name = "Other (specify)")] + [RequiredOnComplete] public int? OTHBIOM { get; set; } [Display(Name = "Other (specify)")] @@ -231,30 +242,39 @@ public bool? NonAmnesticMCIMultipleDomainsIndicated public string? OTHBIOMX { get; set; } [Display(Name = "Large vessel infarct(s)")] + [RequiredOnComplete] public int? IMAGLINF { get; set; } [Display(Name = "Lacunar infarct(s)")] + [RequiredOnComplete] public int? IMAGLAC { get; set; } [Display(Name = "Macrohemorrhage(s)")] + [RequiredOnComplete] public int? IMAGMACH { get; set; } [Display(Name = "Microhemorrhage(s)")] + [RequiredOnComplete] public int? IMAGMICH { get; set; } [Display(Name = "Moderate white-matter hyperintensity (CHS score 5–6)")] + [RequiredOnComplete] public int? IMAGMWMH { get; set; } [Display(Name = "Extensive white-matter hyperintensity (CHS score 7–8+)")] + [RequiredOnComplete] public int? IMAGEWMH { get; set; } [Display(Name = "Does the subject have a dominantly inherited AD mutation (PSEN1, PSEN2, APP)")] + [RequiredOnComplete] public int? ADMUT { get; set; } [Display(Name = "Does the subject have a hereditary FTLD mutation (e.g., GRN, VCP, TARBP, FUS, C9orf72, CHMP2B, MAPT)?")] + [RequiredOnComplete] public int? FTLDMUT { get; set; } [Display(Name = "Does the subject have a hereditary mutation other than an AD or FTLD mutation?")] + [RequiredOnComplete] public int? OTHMUT { get; set; } [Display(Name = "Other (specify)")] @@ -396,7 +416,6 @@ public bool? OnePrimaryDiagnosisAllowed counter++; } - if (IMPSUBIF.HasValue && IMPSUBIF == 1) { counter++; @@ -446,6 +465,7 @@ public bool? OnePrimaryDiagnosisAllowed #endregion + #region Etiologic Diagnoses [Display(Name = "Alzheimer's disease")] public bool ALZDIS { get; set; } @@ -752,6 +772,7 @@ public bool? OnePrimaryDiagnosisAllowed [ProhibitedCharacters] public string? COGOTH3X { get; set; } + #endregion public override IEnumerable Validate(ValidationContext validationContext) { foreach (var result in base.Validate(validationContext)) From b3828d43f132044234e344160ba7ce15d630cd5d Mon Sep 17 00:00:00 2001 From: Oddvocado <96854090+Oddvocado@users.noreply.github.com> Date: Fri, 20 Oct 2023 15:29:57 -0400 Subject: [PATCH 12/18] Adjusts section 3 validation --- src/UDS.Net.Forms/Models/UDS3/D1.cs | 32 ----------------------------- 1 file changed, 32 deletions(-) diff --git a/src/UDS.Net.Forms/Models/UDS3/D1.cs b/src/UDS.Net.Forms/Models/UDS3/D1.cs index e385a366..0662c8c6 100644 --- a/src/UDS.Net.Forms/Models/UDS3/D1.cs +++ b/src/UDS.Net.Forms/Models/UDS3/D1.cs @@ -470,14 +470,12 @@ public bool? OnePrimaryDiagnosisAllowed public bool ALZDIS { get; set; } [Display(Name = "Alzheimer’s disease, primary or contributing")] - [RequiredIf(nameof(ALZDIS), "True", ErrorMessage = "Indicate diagnosis for Alzheimer's disease.")] public int? ALZDISIF { get; set; } [Display(Name = "Lewy body disease")] public bool LBDIS { get; set; } [Display(Name = "Lewy body disease, primary or contributing")] - [RequiredIf(nameof(LBDIS), "True", ErrorMessage = "Indicate diagnosis for Lewy body disease.")] public int? LBDIF { get; set; } [Display(Name = "Parkinson's disease")] @@ -487,35 +485,30 @@ public bool? OnePrimaryDiagnosisAllowed public bool MSA { get; set; } [Display(Name = "Multiple system atrophy nprimary or contributing")] - [RequiredIf(nameof(MSA), "True", ErrorMessage = "Indicate diagnosis for Multiple system atrophy.")] public int? MSAIF { get; set; } [Display(Name = "Progressive supranuclear palsy (PSP)")] public bool PSP { get; set; } [Display(Name = "Progressive supranuclear palsy (PSP), primary or contributing")] - [RequiredIf(nameof(PSP), "True", ErrorMessage = "Indicate diagnosis for Progressive supranuclear palsy (PSP).")] public int? PSPIF { get; set; } [Display(Name = "Corticobasal degeneration (CBD)")] public bool CORT { get; set; } [Display(Name = "Corticobasal degeneration (CBD), primary or contributing")] - [RequiredIf(nameof(CORT), "True", ErrorMessage = "Indicate diagnosis for Corticobasal degeneration (CBD).")] public int? CORTIF { get; set; } [Display(Name = "FTLD with motor neuron disease")] public bool FTLDMO { get; set; } [Display(Name = "FTLD with motor neuron disease, primary or contributing")] - [RequiredIf(nameof(FTLDMO), "True", ErrorMessage = "Indicate diagnosis for FTLD with motor neuron disease.")] public int? FTLDMOIF { get; set; } [Display(Name = "FTLD NOS")] public bool FTLDNOS { get; set; } [Display(Name = "FTLD NOS, primary or contributing")] - [RequiredIf(nameof(FTLDNOS), "True", ErrorMessage = "Indicate diagnosis for FTLD NOS.")] public int? FTLDNOIF { get; set; } [Display(Name = "If FTLD (Questions 14a – 14d) is Present, specify FTLD subtype")] @@ -535,7 +528,6 @@ public bool? OnePrimaryDiagnosisAllowed public bool CVD { get; set; } [Display(Name = "Vascular brain injury, primary or contributing")] - [RequiredIf(nameof(CVD), "True", ErrorMessage = "Indicate diagnosis for Vascular brain injury.")] public int? CVDIF { get; set; } [Display(Name = "Previous symptomatic stroke?")] @@ -562,35 +554,30 @@ public bool? OnePrimaryDiagnosisAllowed public bool ESSTREM { get; set; } [Display(Name = "Essential tremor, primary or contributing")] - [RequiredIf(nameof(ESSTREM), "True", ErrorMessage = "Indicate diagnosis for Essential tremor.")] public int? ESSTREIF { get; set; } [Display(Name = "Down syndrome")] public bool DOWNS { get; set; } [Display(Name = "Down syndrome, primary or contributing")] - [RequiredIf(nameof(DOWNS), "True", ErrorMessage = "Indicate diagnosis for Down syndrome.")] public int? DOWNSIF { get; set; } [Display(Name = "Huntington's disease")] public bool HUNT { get; set; } [Display(Name = "Huntington’s disease, primary or contributing")] - [RequiredIf(nameof(HUNT), "True", ErrorMessage = "Indicate diagnosis for Huntington's disease.")] public int? HUNTIF { get; set; } [Display(Name = "Prion disease (CJD, other)")] public bool PRION { get; set; } [Display(Name = "Prion disease, primary or contributing")] - [RequiredIf(nameof(PRION), "True", ErrorMessage = "Indicate diagnosis for Prion disease (CJD, other).")] public int? PRIONIF { get; set; } [Display(Name = "Traumatic brain injury")] public bool BRNINJ { get; set; } [Display(Name = "Traumatic brain injury, primary or contributing")] - [RequiredIf(nameof(BRNINJ), "True", ErrorMessage = "Indicate diagnosis for Traumatic brain injury.")] public int? BRNINJIF { get; set; } [Display(Name = "If Present, does the subject have symptoms consistent with chronic traumatic encephalopathy?")] @@ -601,21 +588,18 @@ public bool? OnePrimaryDiagnosisAllowed public bool HYCEPH { get; set; } [Display(Name = "Normal-pressure hydrocephalus, primary or contributing")] - [RequiredIf(nameof(HYCEPH), "True", ErrorMessage = "Indicate diagnosis for Normal-pressure hydrocephalus.")] public int? HYCEPHIF { get; set; } [Display(Name = "Epilepsy")] public bool EPILEP { get; set; } [Display(Name = "Epilepsy, primary or contributing")] - [RequiredIf(nameof(EPILEP), "True", ErrorMessage = "Indicate diagnosis for Epilepsy.")] public int? EPILEPIF { get; set; } [Display(Name = "CNS neoplasm")] public bool NEOP { get; set; } [Display(Name = "CNS neoplasm, primary or contributing")] - [RequiredIf(nameof(NEOP), "True", ErrorMessage = "Indicate diagnosis for CNS neoplasm.")] public int? NEOPIF { get; set; } [Display(Name = "CNS neoplasm, benign or malignant?")] @@ -626,14 +610,12 @@ public bool? OnePrimaryDiagnosisAllowed public bool HIV { get; set; } [Display(Name = "Human immunodeficiency virus (HIV), primary or contributing")] - [RequiredIf(nameof(HIV), "True", ErrorMessage = "Indicate diagnosis for Human immunodeficiency virus (HIV).")] public int? HIVIF { get; set; } [Display(Name = "Cognitive impairment due to other neurologic, genetic, or infectious conditions not listed above")] public bool OTHCOG { get; set; } [Display(Name = "Cognitive impairment due to other neurologic, genetic, or infectious conditions not listed above, primary or contributing")] - [RequiredIf(nameof(OTHCOG), "True", ErrorMessage = "Indicate diagnosis for Other cognitive impairment.")] public int? OTHCOGIF { get; set; } [Display(Name = "If Present, specify")] @@ -646,7 +628,6 @@ public bool? OnePrimaryDiagnosisAllowed public bool DEP { get; set; } [Display(Name = "Active depression, primary or contributing")] - [RequiredIf(nameof(DEP), "True", ErrorMessage = "Indicate diagnosis for Active depression.")] public int? DEPIF { get; set; } [Display(Name = "If Present, select one")] @@ -657,42 +638,36 @@ public bool? OnePrimaryDiagnosisAllowed public bool BIPOLDX { get; set; } [Display(Name = "Bipolar disorder, primary or contributing")] - [RequiredIf(nameof(BIPOLDX), "True", ErrorMessage = "Indicate diagnosis for Bipolar disorder.")] public int? BIPOLDIF { get; set; } [Display(Name = "Schizophrenia or other psychosis")] public bool SCHIZOP { get; set; } [Display(Name = "Schizophrenia or other psychosis, primary or contributing")] - [RequiredIf(nameof(SCHIZOP), "True", ErrorMessage = "Indicate diagnosis for Schizophrenia or other psychosis.")] public int? SCHIZOIF { get; set; } [Display(Name = "Anxiety disorder")] public bool ANXIET { get; set; } [Display(Name = "Anxiety disorder, primary or contributing")] - [RequiredIf(nameof(ANXIET), "True", ErrorMessage = "Indicate diagnosis for Anxiety disorder.")] public int? ANXIETIF { get; set; } [Display(Name = "Delirium")] public bool DELIR { get; set; } [Display(Name = "Delirium, primary or contributing")] - [RequiredIf(nameof(DELIR), "True", ErrorMessage = "Indicate diagnosis for Delirium.")] public int? DELIRIF { get; set; } [Display(Name = "Post-traumatic stress disorder (PTSD)")] public bool PTSDDX { get; set; } [Display(Name = "Post-traumatic stress disorder (PTSD), primary or contributing")] - [RequiredIf(nameof(PTSDDX), "True", ErrorMessage = "Indicate diagnosis for Post-traumatic stress disorder (PTSD).")] public int? PTSDDXIF { get; set; } [Display(Name = "Other psychiatric disease")] public bool OTHPSY { get; set; } [Display(Name = "Other psychiatric disease, primary or contributing")] - [RequiredIf(nameof(OTHPSY), "True", ErrorMessage = "Indicate diagnosis for Other psychiatric disease.")] public int? OTHPSYIF { get; set; } [Display(Name = "If Present, specify")] @@ -705,7 +680,6 @@ public bool? OnePrimaryDiagnosisAllowed public bool ALCDEM { get; set; } [Display(Name = "Cognitive impairment due to alcohol abuse, primary or contributing")] - [RequiredIf(nameof(ALCDEM), "True", ErrorMessage = "Indicate diagnosis for Cognitive impairment due to alcohol abuse.")] public int? ALCDEMIF { get; set; } [Display(Name = "Current alcohol abuse")] @@ -716,28 +690,24 @@ public bool? OnePrimaryDiagnosisAllowed public bool IMPSUB { get; set; } [Display(Name = "Cognitive impairment due to other substance abuse, primary or contributing")] - [RequiredIf(nameof(IMPSUB), "True", ErrorMessage = "Indicate diagnosis for Cognitive impairment due to other substance abuse.")] public int? IMPSUBIF { get; set; } [Display(Name = "Cognitive impairment due to systemic disease/medical illness (as indicated on Form D2)")] public bool DYSILL { get; set; } [Display(Name = "Cognitive impairment due to systemic disease/nmedical illness, primary or contributing")] - [RequiredIf(nameof(DYSILL), "True", ErrorMessage = "Indicate diagnosis for Cognitive impairment due to systemic disease/medical illness (as indicated on Form D2).")] public int? DYSILLIF { get; set; } [Display(Name = "Cognitive impairment due to medications")] public bool MEDS { get; set; } [Display(Name = "Cognitive impairment due to medications, primary or contributing")] - [RequiredIf(nameof(MEDS), "True", ErrorMessage = "Indicate diagnosis for Cognitive impairment due to medications.")] public int? MEDSIF { get; set; } [Display(Name = "Cognitive impairment NOS")] public bool COGOTH { get; set; } [Display(Name = "Cognitive impairment NOS, primary or contributing")] - [RequiredIf(nameof(COGOTH), "True", ErrorMessage = "Indicate diagnosis for Cognitive impairment NOS.")] public int? COGOTHIF { get; set; } [Display(Name = "If Present, specify")] @@ -750,7 +720,6 @@ public bool? OnePrimaryDiagnosisAllowed public bool COGOTH2 { get; set; } [Display(Name = "Cognitive impairment NOS, primary or contributing")] - [RequiredIf(nameof(COGOTH2), "True", ErrorMessage = "Indicate diagnosis for Cognitive impairment NOS.")] public int? COGOTH2F { get; set; } [Display(Name = "If Present, specify")] @@ -763,7 +732,6 @@ public bool? OnePrimaryDiagnosisAllowed public bool COGOTH3 { get; set; } [Display(Name = "Cognitive impairment NOS, primary or contributing")] - [RequiredIf(nameof(COGOTH3), "True", ErrorMessage = "Indicate diagnosis for Cognitive impairment NOS.")] public int? COGOTH3F { get; set; } [Display(Name = "If Present, specify")] From 729c4b59980f996684867acbe582b5fb397fe4e4 Mon Sep 17 00:00:00 2001 From: Oddvocado <96854090+Oddvocado@users.noreply.github.com> Date: Fri, 20 Oct 2023 15:57:36 -0400 Subject: [PATCH 13/18] Adds conditional for section 3 questions 11-39 --- src/UDS.Net.Forms/Models/UDS3/D1.cs | 181 ++++++++++++++++++++++++++++ 1 file changed, 181 insertions(+) diff --git a/src/UDS.Net.Forms/Models/UDS3/D1.cs b/src/UDS.Net.Forms/Models/UDS3/D1.cs index 0662c8c6..2ec2b919 100644 --- a/src/UDS.Net.Forms/Models/UDS3/D1.cs +++ b/src/UDS.Net.Forms/Models/UDS3/D1.cs @@ -465,6 +465,187 @@ public bool? OnePrimaryDiagnosisAllowed #endregion + #region At Least One Or More Diagnoses Present + + [RequiredOnComplete(ErrorMessage = "In Section 3, if the particpant does not have normal cognition, at least ONE diagnosis should be indicated as present.")] + [NotMapped] + public bool? OneDiagnosesPresent + { + get + { + int counter = 0; + + if (ALZDIS == true) + { + counter++; + } + if (LBDIS == true) + { + counter++; + } + + if (MSA == true) + { + counter++; + } + if (PSP == true) + { + counter++; + } + if (CORT == true) + { + counter++; + } + + if (FTLDMO == true) + { + counter++; + } + if (FTLDNOS == true) + { + counter++; + } + if (CVD == true) + { + counter++; + } + if (ESSTREM == true) + { + counter++; + } + if (DOWNS == true) + { + counter++; + } + if (HUNT == true) + { + counter++; + } + + if (PRION == true) + { + counter++; + } + + if (BRNINJ == true) + { + counter++; + } + + if (HYCEPH == true) + { + counter++; + } + + if (EPILEP == true) + { + counter++; + } + + if (NEOP == true) + { + counter++; + } + + if (HIV == true) + { + counter++; + } + + if (OTHCOG == true) + { + counter++; + } + + if (DEP == true) + { + counter++; + } + + if (BIPOLDX == true) + { + counter++; + } + + if (SCHIZOP == true) + { + counter++; + } + + if (ANXIET == true) + { + counter++; + } + + if (DELIR == true) + { + counter++; + } + + if (PTSDDX == true) + { + counter++; + } + + if (OTHPSY == true) + { + counter++; + } + + if (ALCDEM == true) + { + counter++; + } + + if (IMPSUB == true) + { + counter++; + } + + if (DYSILL == true) + { + counter++; + } + + if (MEDS == true) + { + counter++; + } + + if (COGOTH == true) + { + counter++; + } + + if (COGOTH2 == true) + { + counter++; + } + + if (COGOTH3 == true) + { + counter++; + } + + if (counter >= 1) + { + return true; + } + + else + { + if (NORMCOG.HasValue && NORMCOG == 1) + { + return true; + } + return null; + } + + } + } + + #endregion + #region Etiologic Diagnoses [Display(Name = "Alzheimer's disease")] public bool ALZDIS { get; set; } From 4e61504f01d7cbd2aeb9520f5f6a7734289e0fb8 Mon Sep 17 00:00:00 2001 From: Oddvocado <96854090+Oddvocado@users.noreply.github.com> Date: Tue, 24 Oct 2023 11:48:01 -0400 Subject: [PATCH 14/18] Tidying up --- src/UDS.Net.Forms/Models/UDS3/D1.cs | 8 ++++---- src/UDS.Net.Forms/Pages/UDS3/D1.cshtml.cs | 2 -- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/UDS.Net.Forms/Models/UDS3/D1.cs b/src/UDS.Net.Forms/Models/UDS3/D1.cs index 2ec2b919..c59abfbd 100644 --- a/src/UDS.Net.Forms/Models/UDS3/D1.cs +++ b/src/UDS.Net.Forms/Models/UDS3/D1.cs @@ -11,7 +11,7 @@ namespace UDS.Net.Forms.Models.UDS3 /// public class D1 : FormModel { - #region Cognitive and behavioral status + #region Section 1 Cognitive and behavioral status [Display(Name = "Diagnosis method — responses in this form are based on diagnosis by")] public int? DXMETHOD { get; set; } @@ -190,7 +190,7 @@ public bool? NonAmnesticMCIMultipleDomainsIndicated public bool IMPNOMCI { get; set; } #endregion - #region Biomarkers, imaging and genetics + #region Section 2 Biomarkers, imaging and genetics [Display(Name = "Abnormally elevated amyloid on PET")] [RequiredOnComplete] public int? AMYLPET { get; set; } @@ -465,7 +465,7 @@ public bool? OnePrimaryDiagnosisAllowed #endregion - #region At Least One Or More Diagnoses Present + #region At Least One Or More Diagnoses Present Questions 11-39 [RequiredOnComplete(ErrorMessage = "In Section 3, if the particpant does not have normal cognition, at least ONE diagnosis should be indicated as present.")] [NotMapped] @@ -646,7 +646,7 @@ public bool? OneDiagnosesPresent #endregion - #region Etiologic Diagnoses + #region Section 3 Etiologic Diagnoses [Display(Name = "Alzheimer's disease")] public bool ALZDIS { get; set; } diff --git a/src/UDS.Net.Forms/Pages/UDS3/D1.cshtml.cs b/src/UDS.Net.Forms/Pages/UDS3/D1.cshtml.cs index 5eebf53d..8d494205 100644 --- a/src/UDS.Net.Forms/Pages/UDS3/D1.cshtml.cs +++ b/src/UDS.Net.Forms/Pages/UDS3/D1.cshtml.cs @@ -34,7 +34,6 @@ public class D1Model : FormPageModel new UIEnableAttribute("D1.AMNDEM"), new UIEnableAttribute("D1.PCA"), new UIEnableAttribute("D1.PPASYN"), - new UIEnableAttribute("D1.PPASYNT"), new UIEnableAttribute("D1.FTDSYN"), new UIEnableAttribute("D1.LBDSYN"), new UIEnableAttribute("D1.NAMNDEM"), @@ -152,7 +151,6 @@ public class D1Model : FormPageModel new UIEnableAttribute("D1.AMNDEM"), new UIEnableAttribute("D1.PCA"), new UIEnableAttribute("D1.PPASYN"), - new UIEnableAttribute("D1.PPASYNT"), new UIEnableAttribute("D1.FTDSYN"), new UIEnableAttribute("D1.LBDSYN"), new UIEnableAttribute("D1.NAMNDEM"), From 5c2f5a62c250822a9c03f8f8789bdca05b80731b Mon Sep 17 00:00:00 2001 From: Oddvocado <96854090+Oddvocado@users.noreply.github.com> Date: Tue, 24 Oct 2023 13:27:31 -0400 Subject: [PATCH 15/18] Validation questions 5a-5e --- src/UDS.Net.Forms/Models/UDS3/D1.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/UDS.Net.Forms/Models/UDS3/D1.cs b/src/UDS.Net.Forms/Models/UDS3/D1.cs index c59abfbd..caafecd8 100644 --- a/src/UDS.Net.Forms/Models/UDS3/D1.cs +++ b/src/UDS.Net.Forms/Models/UDS3/D1.cs @@ -57,6 +57,20 @@ public bool? DementiaSyndromeIndicated } } + [RequiredIf(nameof(DEMENTED), "0", ErrorMessage = "Please indicate the type of cognitive impairment (Question 5a-5e).")] + [NotMapped] + public bool? DementiaSyndromeNotIndicated + { + get + { + if (MCIAMEM || MCIAPLUS || MCINON1 || MCINON2 || IMPNOMCI) + { + return true; + } + else return null; + } + } + [Display(Name = "Amnestic MCI, single domain (aMCI SD)")] public bool MCIAMEM { get; set; } From dadf7bded5f8421ce2919baf3fb2cfb05b974345 Mon Sep 17 00:00:00 2001 From: Oddvocado <96854090+Oddvocado@users.noreply.github.com> Date: Tue, 24 Oct 2023 15:13:25 -0400 Subject: [PATCH 16/18] Adds required on complete question 1 & 2 --- src/UDS.Net.Forms/Models/UDS3/D1.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/UDS.Net.Forms/Models/UDS3/D1.cs b/src/UDS.Net.Forms/Models/UDS3/D1.cs index caafecd8..736963ba 100644 --- a/src/UDS.Net.Forms/Models/UDS3/D1.cs +++ b/src/UDS.Net.Forms/Models/UDS3/D1.cs @@ -13,9 +13,11 @@ public class D1 : FormModel { #region Section 1 Cognitive and behavioral status [Display(Name = "Diagnosis method — responses in this form are based on diagnosis by")] + [RequiredOnComplete] public int? DXMETHOD { get; set; } [Display(Name = "Does the subject have normal cognition (global CDR=0 and/or neuropsychological testing within normal range) and normal behavior (i.e., the subject does not exhibit behavior sufficient to diagnose I or dementia due to FTLD or LBD)?")] + [RequiredOnComplete] public int? NORMCOG { get; set; } [Display(Name = "Does the subject meet the criteria for dementia?")] From a028ed24f0c4a43e46da2731d36b8c96e5451164 Mon Sep 17 00:00:00 2001 From: Oddvocado <96854090+Oddvocado@users.noreply.github.com> Date: Wed, 1 Nov 2023 11:45:39 -0400 Subject: [PATCH 17/18] removes deprecated stimulus --- src/UDS.Net.Forms/Pages/UDS3/D1.cshtml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/UDS.Net.Forms/Pages/UDS3/D1.cshtml b/src/UDS.Net.Forms/Pages/UDS3/D1.cshtml index f61b3913..0b067b6e 100644 --- a/src/UDS.Net.Forms/Pages/UDS3/D1.cshtml +++ b/src/UDS.Net.Forms/Pages/UDS3/D1.cshtml @@ -320,7 +320,7 @@
- @Html.CheckBox("D1.MCIAMEM", Model.D1.MCIAMEM, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600", data_target= "fancycheckboxes.checkbox" }) + @Html.CheckBox("D1.MCIAMEM", Model.D1.MCIAMEM, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600", data_fancycheckboxes_target= "checkbox" })
@@ -345,7 +345,7 @@
- @Html.CheckBox("D1.MCIAPLUS", Model.D1.MCIAPLUS, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600", data_affects = "true", data_affects_toggle_targets = "[ \"D1.MCIAPLAN\" , \"D1.MCIAPATT\" , \"D1.MCIAPEX\" ,\"D1.MCIAPVIS\" ]",data_target= "fancycheckboxes.checkbox" }) + @Html.CheckBox("D1.MCIAPLUS", Model.D1.MCIAPLUS, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600", data_affects = "true", data_affects_toggle_targets = "[ \"D1.MCIAPLAN\" , \"D1.MCIAPATT\" , \"D1.MCIAPEX\" ,\"D1.MCIAPVIS\" ]",data_fancycheckboxes_target= "checkbox" })
@@ -413,7 +413,7 @@
- @Html.CheckBox("D1.MCINON1", Model.D1.MCINON1, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600", data_affects = "true", data_affects_toggle_targets = "[ \"D1.MCIN1LAN\" , \"D1.MCIN1ATT\" , \"D1.MCIN1EX\" ,\"D1.MCIN1VIS\" ]",data_target= "fancycheckboxes.checkbox" }) + @Html.CheckBox("D1.MCINON1", Model.D1.MCINON1, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600", data_affects = "true", data_affects_toggle_targets = "[ \"D1.MCIN1LAN\" , \"D1.MCIN1ATT\" , \"D1.MCIN1EX\" ,\"D1.MCIN1VIS\" ]",data_fancycheckboxes_target= "checkbox" })
@@ -481,7 +481,7 @@
- @Html.CheckBox("D1.MCINON2", Model.D1.MCINON2, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600", data_affects = "true", data_affects_toggle_targets = "[ \"D1.MCIN2LAN\" , \"D1.MCIN2ATT\" , \"D1.MCIN2EX\" ,\"D1.MCIN2VIS\" ]", data_target= "fancycheckboxes.checkbox" }) + @Html.CheckBox("D1.MCINON2", Model.D1.MCINON2, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600", data_affects = "true", data_affects_toggle_targets = "[ \"D1.MCIN2LAN\" , \"D1.MCIN2ATT\" , \"D1.MCIN2EX\" ,\"D1.MCIN2VIS\" ]", data_fancycheckboxes_target= "checkbox" })
@@ -549,7 +549,7 @@
- @Html.CheckBox("D1.IMPNOMCI", Model.D1.IMPNOMCI, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600", data_target= "fancycheckboxes.checkbox" }) + @Html.CheckBox("D1.IMPNOMCI", Model.D1.IMPNOMCI, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600", data_fancycheckboxes_target= "checkbox" })
From d0f5277033d323efe4cd426a5ecb612e3faec236 Mon Sep 17 00:00:00 2001 From: Oddvocado <96854090+Oddvocado@users.noreply.github.com> Date: Wed, 8 Nov 2023 11:15:18 -0500 Subject: [PATCH 18/18] Adds programmatic trigger to checkbox change --- src/UDS.Net.Forms/Pages/UDS3/D1.cshtml | 10 +++--- .../fancycheckboxes_controller.js | 31 +++++++++---------- 2 files changed, 19 insertions(+), 22 deletions(-) diff --git a/src/UDS.Net.Forms/Pages/UDS3/D1.cshtml b/src/UDS.Net.Forms/Pages/UDS3/D1.cshtml index 0b067b6e..e016d761 100644 --- a/src/UDS.Net.Forms/Pages/UDS3/D1.cshtml +++ b/src/UDS.Net.Forms/Pages/UDS3/D1.cshtml @@ -1,4 +1,4 @@ -@page "{id:int?}" +@page "{id:int?}" @model UDS.Net.Forms.Pages.UDS3.D1Model @{ Layout = "_LayoutForm"; @@ -46,7 +46,7 @@
-
+
@@ -292,7 +292,7 @@
- +
@@ -345,7 +345,7 @@
- @Html.CheckBox("D1.MCIAPLUS", Model.D1.MCIAPLUS, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600", data_affects = "true", data_affects_toggle_targets = "[ \"D1.MCIAPLAN\" , \"D1.MCIAPATT\" , \"D1.MCIAPEX\" ,\"D1.MCIAPVIS\" ]",data_fancycheckboxes_target= "checkbox" }) + @Html.CheckBox("D1.MCIAPLUS", Model.D1.MCIAPLUS, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600", data_affects = "true", data_affects_toggle_targets = "[ \"D1.MCIAPLAN\", \"D1.MCIAPATT\",\"D1.MCIAPEX\",\"D1.MCIAPVIS\"]", data_fancycheckboxes_target= "checkbox" })
@@ -413,7 +413,7 @@
- @Html.CheckBox("D1.MCINON1", Model.D1.MCINON1, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600", data_affects = "true", data_affects_toggle_targets = "[ \"D1.MCIN1LAN\" , \"D1.MCIN1ATT\" , \"D1.MCIN1EX\" ,\"D1.MCIN1VIS\" ]",data_fancycheckboxes_target= "checkbox" }) + @Html.CheckBox("D1.MCINON1", Model.D1.MCINON1, new { @class = "h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-600", data_affects = "true", data_affects_toggle_targets = "[ \"D1.MCIN1LAN\" , \"D1.MCIN1ATT\" , \"D1.MCIN1EX\" ,\"D1.MCIN1VIS\" ]", data_fancycheckboxes_target= "checkbox" })
diff --git a/src/UDS.Net.Forms/wwwroot/js/js_controllers/fancycheckboxes_controller.js b/src/UDS.Net.Forms/wwwroot/js/js_controllers/fancycheckboxes_controller.js index 457a952f..d5d30b7e 100644 --- a/src/UDS.Net.Forms/wwwroot/js/js_controllers/fancycheckboxes_controller.js +++ b/src/UDS.Net.Forms/wwwroot/js/js_controllers/fancycheckboxes_controller.js @@ -1,24 +1,21 @@ import { Controller } from '@hotwired/stimulus'; export default class extends Controller { - static targets = ['checkbox'] + static targets = ['checkbox'] - connect() { - this.checkboxTargets.forEach((checkbox) => { - checkbox.addEventListener('change', () => this.checkboxChange(checkbox)) - }) - } + connect() { + this.checkboxTargets.forEach((checkbox) => { + checkbox.addEventListener('click', () => this.checkboxChange(checkbox)) + }) + } - checkboxChange(selectedCheckbox) { - this.checkboxTargets.forEach((checkbox) => { - if (checkbox !== selectedCheckbox) { - checkbox.checked = false; - checkbox.disabled = false; - } - }) + checkboxChange(selectedCheckbox) { + this.checkboxTargets.forEach((checkbox) => { + if (checkbox !== selectedCheckbox) { + checkbox.checked = false; + checkbox.dispatchEvent(new Event('change')) + } + }) - if (selectedCheckbox.checked) { - selectedCheckbox.disabled = false; - } - } + } } \ No newline at end of file
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.