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

Open
wants to merge 26 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
26 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
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
8 changes: 8 additions & 0 deletions src/Components/HCX/InsuranceDetailsBuilder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import request from "../../Utils/request/request";
import routes from "../../Redux/api";
import { useTranslation } from "react-i18next";
import careConfig from "@careConfig";
import { FieldError } from "../Form/FieldValidators";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import { FieldError } from "../Form/FieldValidators";


type Props = FormFieldBaseProps<HCXPolicyModel[]> & { gridView?: boolean };

Expand Down Expand Up @@ -73,6 +74,7 @@ export default function InsuranceDetailsBuilder(props: Props) {
>
<InsuranceDetailEditCard
policy={policy}
error={props.error}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
error={props.error}

handleUpdate={handleUpdate(index)}
handleUpdates={handleUpdates(index)}
handleRemove={handleRemove(index)}
Expand All @@ -91,12 +93,14 @@ const InsuranceDetailEditCard = ({
handleUpdates,
handleRemove,
gridView,
error,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
error,

}: {
policy: HCXPolicyModel;
handleUpdate: (event: FieldChangeEvent<unknown>) => void;
handleUpdates: (diffs: object) => void;
handleRemove: () => void;
gridView?: boolean;
error: FieldError;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
error: FieldError;

}) => {
const { t } = useTranslation();
const seletedInsurer =
Expand Down Expand Up @@ -125,6 +129,7 @@ const InsuranceDetailEditCard = ({
<TextFormField
required
name="subscriber_id"
error={error}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
error={error}

label={t("policy__subscriber_id")}
placeholder={t("policy__subscriber_id__example")}
value={policy.subscriber_id}
Expand All @@ -133,6 +138,7 @@ const InsuranceDetailEditCard = ({
<TextFormField
required
name="policy_id"
error={error}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
error={error}

label={t("policy__policy_id")}
placeholder={t("policy__policy_id__example")}
value={policy.policy_id}
Expand Down Expand Up @@ -163,7 +169,9 @@ const InsuranceDetailEditCard = ({
/>
<TextFormField
name="insurer_name"
required
label={t("policy__insurer_name")}
error={error}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
error={error}

placeholder={t("policy__insurer_name__example")}
value={policy.insurer_name}
onChange={handleUpdate}
Expand Down
9 changes: 5 additions & 4 deletions src/Redux/fireRequest.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,11 @@ export const fireRequest = (

// 400 Bad Request Error
if (error.response.status === 400 || error.response.status === 406) {
Notification.BadRequest({
errs: error.response.data,
});
return error.response;
console.log(error.response.data.detaillocal_ip_address);
// Notification.BadRequest({
// errs: error.response.data,
// });
// return error.response;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this changed?

}

// 4xx Errors
Expand Down
Loading