Skip to content

Commit

Permalink
Fix verified_by and Principal Diagnosis validation (#6247)
Browse files Browse the repository at this point in the history
* Fix verified_by and Principal Diagnosis validation

* Apply suggestions from code review

Co-authored-by: Rithvik Nishad <[email protected]>
  • Loading branch information
Ashesh3 and rithviknishad authored Sep 8, 2023
1 parent 8bcf91d commit 9b45c5e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Components/Facility/ConsultationForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ export const ConsultationForm = (props: any) => {
}

case "verified_by": {
if (!state.form[field].replace(/\s/g, "").length) {
if (!state.form[field]) {
errors[field] = "Please fill verified by";
invalidForm = true;
break;
Expand Down Expand Up @@ -570,6 +570,7 @@ export const ConsultationForm = (props: any) => {
if (
state.form[field] &&
state.form["icd11_diagnoses_object"].length &&
!state.form["icd11_provisional_diagnoses_object"] &&
!state.form["icd11_diagnoses_object"]
.map((d) => d.id)
.includes(state.form[field]!)
Expand All @@ -583,6 +584,7 @@ export const ConsultationForm = (props: any) => {
if (
state.form[field] &&
state.form["icd11_provisional_diagnoses_object"].length &&
!state.form["icd11_diagnoses_object"] &&
!state.form["icd11_provisional_diagnoses_object"]
.map((d) => d.id)
.includes(state.form[field]!)
Expand Down

0 comments on commit 9b45c5e

Please sign in to comment.