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

fix: Added Validation for Insurance input fields in patient registration issue (#8672) #8681

Closed
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
d1c1cd5
fix: Add Validation for Insurance input fields in patient registratio…
syedfardeenjeelani Oct 1, 2024
96b810f
fix: Add Validation for Insurance input fields in patient registratio…
syedfardeenjeelani Oct 1, 2024
90dcac7
fix: fixed the validation logic of the insurance form
syedfardeenjeelani Oct 4, 2024
6bc35c4
fix: fixed the validation logic of the insurance form
syedfardeenjeelani Oct 4, 2024
8768f3b
fix: fixed the validator.ts
syedfardeenjeelani Oct 4, 2024
8941616
Update fireRequest.tsx
syedfardeenjeelani Oct 4, 2024
64963bf
fix: Move validation messages to i18n locale files and refactor HCXPo…
syedfardeenjeelani Oct 6, 2024
0ce16b3
Merge branch 'issues/8672/fix-issue' of https://github.com/syedfardee…
syedfardeenjeelani Oct 6, 2024
795d4de
fix: Add Validation for Insurance input fields in patient registratio…
syedfardeenjeelani Oct 1, 2024
7eebafc
fix: Add Validation for Insurance input fields in patient registratio…
syedfardeenjeelani Oct 1, 2024
983b154
fix: fixed the validation logic of the insurance form
syedfardeenjeelani Oct 4, 2024
3059959
fix: fixed the validation logic of the insurance form
syedfardeenjeelani Oct 4, 2024
1085cbd
fix: fixed the validator.ts
syedfardeenjeelani Oct 4, 2024
0c39cc6
fix: Move validation messages to i18n locale files and refactor HCXPo…
syedfardeenjeelani Oct 6, 2024
27fb884
Update fireRequest.tsx
syedfardeenjeelani Oct 4, 2024
be234ea
fix: moved i18 files to en.json
syedfardeenjeelani Oct 12, 2024
482075a
deleted common.json
syedfardeenjeelani Oct 12, 2024
ff32463
Merge branch 'develop' into issues/8672/fix-issue
syedfardeenjeelani Oct 14, 2024
72e89b0
Merge branch 'develop' into issues/8672/fix-issue
rithviknishad Oct 15, 2024
ea0291d
avoid passing `t` as param
rithviknishad Oct 15, 2024
10f9aba
Merge branch 'develop' into issues/8672/fix-issue
nihal467 Oct 16, 2024
a33a94a
Merge branch 'develop' into issues/8672/fix-issue
nihal467 Oct 16, 2024
f5a2651
fixed validation
syedfardeenjeelani Oct 17, 2024
9bdfdc6
sorted en.json alphabetically
syedfardeenjeelani Oct 17, 2024
2f75935
Merge branch 'develop' into issues/8672/fix-issue
syedfardeenjeelani Oct 17, 2024
d7da9f8
Merge branch 'develop' into issues/8672/fix-issue
syedfardeenjeelani Oct 19, 2024
d39b125
wip
syedfardeenjeelani Oct 19, 2024
a06d0f7
Merge branch 'issues/8672/fix-issue' of https://github.com/syedfardee…
syedfardeenjeelani Oct 19, 2024
2b5dd16
wip
syedfardeenjeelani Oct 19, 2024
54c08f1
Merge branch 'develop' into issues/8672/fix-issue
syedfardeenjeelani Oct 19, 2024
d903c88
fix: sorted the json files and fixed the validation error
syedfardeenjeelani Oct 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions src/Components/HCX/validators.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
import { t } from "i18next";
import { FieldValidator } from "../Form/FieldValidators";
import { HCXPolicyModel } from "./models";

const HCXPolicyValidator: FieldValidator<HCXPolicyModel> = (
value,
enable_hcx,
) => {
if (
!value.policy_id.trim() ||
!value.subscriber_id.trim() ||
(enable_hcx && (!value.insurer_id?.trim() || !value.insurer_name?.trim()))
)
return "All fields are mandatory";
if (!value.subscriber_id.trim()) {
return t("member_id_required");
} else if (!value.policy_id.trim()) {
return t("policy_id_required");
}
if (enable_hcx) {
if (!value.insurer_id?.trim() || !value.insurer_name?.trim()) {
return t("insurer_name_required");
}
}
};

export default HCXPolicyValidator;
2 changes: 2 additions & 0 deletions src/Components/Patient/PatientRegister.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,8 @@ export const PatientRegister = (props: PatientRegisterProps) => {
.find((error) => !!error);
setInsuranceDetailsError(insuranceDetailsError);

errors["insurance_details"] = insuranceDetailsError;

Object.keys(form).forEach((field) => {
let phoneNumber, emergency_phone_number;
switch (field) {
Expand Down
Loading
Loading