Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

B9 Incorrect Required Validation for MOMODE, MOMOPARK, MOMOALS, COURSE, FRSTCHG #252

Closed
2 tasks
ashleybot opened this issue Jan 23, 2025 · 1 comment · Fixed by #254
Closed
2 tasks

B9 Incorrect Required Validation for MOMODE, MOMOPARK, MOMOALS, COURSE, FRSTCHG #252

ashleybot opened this issue Jan 23, 2025 · 1 comment · Fixed by #254
Assignees

Comments

@ashleybot
Copy link
Member

ashleybot commented Jan 23, 2025

Steps to replicate:

  1. Create a new B9
  2. Answer all required questions with these specifically:
  3. Question 11 DECCLBE = 1
  4. Answer all sub-questions of Question 12
  5. Answer Question 13
  6. Answer Question 14 DECCLMOT = 0
  7. Question 15 sub-questions are correctly disabled
  8. Questions 16, 17, 18 are correctly disabled
  9. Answer the remaining required questions
  10. Save form as finalized
  11. MOMODE, MOMOPARK, MOMOALS are incorrectly requiredIf
  12. Looking at the code you can see that COURSE and FRSTCHG are also incorrectly requiredIf, but that error is not seen because those would be required on finalized no matter what.

Image

You can see the required annotations are using incorrect properties:

        [Display(Name = "Indicate the mode of onset for the most prominent motor problem that is causing the participant's complaints and/or affecting the participant's function.")]
        [RequiredIf(nameof(DECCLBE), "1", ErrorMessage = "Value required")]
        public int? MOMODE { get; set; }
        [Display(Name = "Indicate mode of onset for the most prominent motor problem that is causing the participant's complains and or affecting the participant's function - Other, specify")]
        [RequiredIf(nameof(MOMODE), "4", ErrorMessage = "Value required")]
        [MaxLength(60)]
        public string? MOMODEX { get; set; }
        [Display(Name = "Were changes in motor function suggestive of parkinsonism?")]
        [RequiredIf(nameof(DECCLBE), "1", ErrorMessage = "Value required")]
        public int? MOMOPARK { get; set; }
        [Display(Name = "Were changes in motor function suggestive of amyotrophic lateral sclerosis?")]
        [RequiredIf(nameof(DECCLBE), "1", ErrorMessage = "Value required")]
        public int? MOMOALS { get; set; }
        [Display(Name = "Overall course of decline of cognitive / behavioral / motor syndrome")]
        [RequiredIf(nameof(DECCLBE), "1", ErrorMessage = "Value required")]
        public int? COURSE { get; set; }
        [Display(Name = "Indicate the predominant domain that was first recognized as changed in the participant")]
        [RequiredIf(nameof(DECCLBE), "1", ErrorMessage = "Value required")]
        public int? FRSTCHG { get; set; }

Correct behavior

  • MOMODE, MOMOPARK, MOMOALS should only be required if DECCLMOT = 1
  • COURSE and FRSTCHG do not need RequiredIf annotations
@Oddvocado Oddvocado self-assigned this Jan 23, 2025
@Oddvocado
Copy link
Member

@ashleybot I have this one ready for review! I was looking at the documentation and it appears
COURSE and FRSTCHG should be required if DECCLIN has a value of 1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants