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

HCX Plug #8420

Merged
merged 55 commits into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from 43 commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
4f5ca89
added support for hcx communication
khavinshankar May 11, 2023
6c8c618
update proxy to carehcx-preview
rithviknishad Jun 15, 2023
e949378
Update netlify.toml
khavinshankar Jul 10, 2023
0a7b437
Merge branch 'develop' into hcx-communication
khavinshankar Jul 10, 2023
5840899
Merge branch 'develop' into hcx-communication
khavinshankar Jul 10, 2023
1bde1f4
Update netlify.toml
khavinshankar Feb 6, 2024
9a90aaa
Merge branch 'develop' into hcx-communication
khavinshankar Feb 18, 2024
8a4256d
Merge branch 'develop' into hcx-communication
khavinshankar Jul 19, 2024
0970413
revert netlify backend proxy
khavinshankar Jul 19, 2024
2d85b15
fixed build errors
khavinshankar Jul 19, 2024
6a346ec
migrated from useDispatch to useQuery
khavinshankar Jul 19, 2024
7ca6865
enable hcx
khavinshankar Jul 31, 2024
f82e428
Merge branch 'develop' into hcx-communication
khavinshankar Jul 31, 2024
92b567e
fixed build errors
khavinshankar Jul 31, 2024
446ea83
fixed hcx routes
khavinshankar Jul 31, 2024
769c483
added multiple file support in useFileUpload hook
khavinshankar Aug 4, 2024
b45ec9a
altered the hcx communication flow, add text message and upload files…
khavinshankar Aug 4, 2024
36bbd31
added view attachments feature in hcx communications
khavinshankar Aug 4, 2024
dd50a05
minor styling: fixed upload button width in hcx communication card
khavinshankar Aug 5, 2024
2c87961
Merge branch 'develop' into hcx-communication
khavinshankar Aug 5, 2024
51b8bf5
fixed cypress fails
khavinshankar Aug 5, 2024
4ce25d2
Merge branch 'hcx-communication' of github.com:coronasafe/care_fe int…
khavinshankar Aug 5, 2024
7924eb7
fixed typo in name field
khavinshankar Aug 5, 2024
ee2c9c5
added name attribute to autocomplete's input
khavinshankar Aug 5, 2024
3d8e1b9
added an overlay behind file preview in hcx communication card
khavinshankar Aug 5, 2024
9dfcf40
temp: updated backend url in netlify
khavinshankar Aug 6, 2024
ee56241
Merge branch 'develop' into hcx-communication
khavinshankar Aug 23, 2024
5bef902
fixed linting issue
khavinshankar Aug 23, 2024
b0ad0ba
Merge branch 'develop' into hcx-communication
khavinshankar Aug 23, 2024
2e106d1
updated hcx apis
khavinshankar Aug 25, 2024
ae5ecdf
refactored hcx api calls to use use query or request
khavinshankar Aug 25, 2024
1193d4c
added i18n and responsiveness support to hcx components
khavinshankar Aug 26, 2024
3e1e482
removed auto eligibility check and fixed policy select dropdown
khavinshankar Aug 27, 2024
7a543f5
update choice labels as per backend
khavinshankar Aug 28, 2024
399dbdf
Merge branch 'develop' into hcx-plug
khavinshankar Aug 28, 2024
d21f379
Merge branch 'develop' into hcx-plug
khavinshankar Sep 17, 2024
90ba5b9
Merge branch 'develop' into hcx-plug
khavinshankar Sep 17, 2024
3d0892f
get enable hcx from env in cypress
khavinshankar Sep 17, 2024
8ab7e47
removed unused files
khavinshankar Sep 17, 2024
2aa0acc
use useQuery + mergeQueryOptions instead of useAsyncOptions
khavinshankar Sep 17, 2024
77bc09f
added i18n and improved readability
khavinshankar Sep 17, 2024
aa3c318
improved readability
khavinshankar Sep 17, 2024
4a08b8b
Merge branch 'develop' into hcx-plug
khavinshankar Sep 19, 2024
866230b
removed duplicate cypress tests
khavinshankar Sep 18, 2024
d44d891
Adds new set of nursing care procedures (#8568)
rithviknishad Sep 19, 2024
92acdc9
Patient Registration: Adds social profile section (#8570)
rithviknishad Sep 19, 2024
2cb28de
Convert supported browsers command to a script (#8564)
sainak Sep 19, 2024
c6d3cf2
Remove supported browsers instruction from README (#8574)
rithviknishad Sep 19, 2024
1f5cc63
Rename procedure `Tracheostomy Tube Change` and fix oral issue not ge…
rithviknishad Sep 20, 2024
a8a4b67
Updated blood pressure range and remove hyphen for infusion "nor-adre…
rithviknishad Sep 21, 2024
d77b225
Removed hacks for loading investigations in Consultation Form, update…
Nithin9585 Sep 21, 2024
6d9750f
add JWKS_BASE64 for cypress workflow (#8589)
sainak Sep 23, 2024
c8e97d4
fix cypress workflow on forked prs (#8591)
sainak Sep 23, 2024
b5e37b8
Merge branch 'develop' into hcx-plug
khavinshankar Sep 23, 2024
b8ed928
fixed cypress tests
khavinshankar Sep 23, 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
1 change: 1 addition & 0 deletions cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,6 @@ export default defineConfig({
},
env: {
API_URL: process.env.REACT_CARE_API_URL ?? "http://localhost:9000",
ENABLE_HCX: process.env.REACT_ENABLE_HCX ?? false,
rithviknishad marked this conversation as resolved.
Show resolved Hide resolved
},
});
55 changes: 35 additions & 20 deletions cypress/e2e/patient_spec/PatientRegistration.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import PatientInsurance from "../../pageobject/Patient/PatientInsurance";
import PatientMedicalHistory from "../../pageobject/Patient/PatientMedicalHistory";

const yearOfBirth = "2001";
const isHCXEnabled = Cypress.env("ENABLE_HCX");

const calculateAge = () => {
const currentYear = new Date().getFullYear();
Expand Down Expand Up @@ -176,16 +177,21 @@ describe("Patient Creation with consultation", () => {
"policy_id",
patientOneFirstPolicyId,
);
patientInsurance.typePatientInsuranceDetail(
patientOneFirstInsuranceId,
"insurer_id",
patientOneFirstInsurerId,
);
patientInsurance.typePatientInsuranceDetail(
patientOneFirstInsuranceId,
"insurer_name",
patientOneFirstInsurerName,
);
if (isHCXEnabled) {
patientInsurance.selectInsurer("test");
} else {
patientInsurance.typePatientInsuranceDetail(
patientOneFirstInsuranceId,
"insurer_id",
patientOneFirstInsurerId,
);
patientInsurance.typePatientInsuranceDetail(
patientOneFirstInsuranceId,
"insurer_name",
patientOneFirstInsurerName,
);
}

patientInsurance.clickAddInsruanceDetails();
patientInsurance.typePatientInsuranceDetail(
patientOneSecondInsuranceId,
Expand All @@ -197,16 +203,21 @@ describe("Patient Creation with consultation", () => {
"policy_id",
patientOneSecondPolicyId,
);
patientInsurance.typePatientInsuranceDetail(
patientOneSecondInsuranceId,
"insurer_id",
patientOneSecondInsurerId,
);
patientInsurance.typePatientInsuranceDetail(
patientOneSecondInsuranceId,
"insurer_name",
patientOneSecondInsurerName,
);
if (isHCXEnabled) {
patientInsurance.selectInsurer("Care");
} else {
patientInsurance.typePatientInsuranceDetail(
patientOneSecondInsuranceId,
"insurer_id",
patientOneSecondInsurerId,
);
patientInsurance.typePatientInsuranceDetail(
patientOneSecondInsuranceId,
"insurer_name",
patientOneSecondInsurerName,
);
}

patientPage.clickUpdatePatient();
cy.wait(3000);
patientPage.verifyPatientUpdated();
Expand Down Expand Up @@ -235,20 +246,24 @@ describe("Patient Creation with consultation", () => {
patientOneFirstPolicyId,
patientOneFirstInsurerId,
patientOneFirstInsurerName,
isHCXEnabled,
);

patientInsurance.clickPatientInsuranceViewDetail();
cy.wait(3000);
patientInsurance.verifyPatientPolicyDetails(
patientOneFirstSubscriberId,
patientOneFirstPolicyId,
patientOneFirstInsurerId,
patientOneFirstInsurerName,
isHCXEnabled,
);
patientInsurance.verifyPatientPolicyDetails(
patientOneSecondSubscriberId,
patientOneSecondPolicyId,
patientOneSecondInsurerId,
patientOneSecondInsurerName,
isHCXEnabled,
);
});

Expand Down
42 changes: 39 additions & 3 deletions cypress/pageobject/Patient/PatientInsurance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,34 @@ class PatientInsurance {
});
}

selectInsurer(insurer: string) {
cy.intercept("GET", "**/api/v1/hcx/payors/**", {
statusCode: 200,
body: [
{
name: "test payor 2",
code: "testpayor2.swasthmock@swasth-hcx-staging",
},
{
name: "Care Payor",
code: "khavinshankar.gmail@swasth-hcx-staging",
},
{
name: "Alliance",
code: "hcxdemo.yopmail@swasth-hcx-staging",
},
],
}).as("getInsurer");
cy.get("[name='insurer']")
.last()
.click()
.type(insurer)
.then(() => {
cy.wait("@getInsurer");
cy.get("[role='option']").contains(insurer).click();
});
}

clickPatientInsuranceViewDetail() {
cy.get("#insurance-view-details").scrollIntoView();
cy.get("#insurance-view-details").click();
Expand All @@ -18,13 +46,21 @@ class PatientInsurance {
cy.get("[data-testid=add-insurance-button]").click();
}

verifyPatientPolicyDetails(subscriberId, policyId, insurerId, insurerName) {
verifyPatientPolicyDetails(
subscriberId,
policyId,
insurerId,
insurerName,
isHcxEnabled,
) {
cy.get("[data-testid=patient-details]").then(($dashboard) => {
cy.url().should("include", "/facility/");
expect($dashboard).to.contain(subscriberId);
expect($dashboard).to.contain(policyId);
expect($dashboard).to.contain(insurerId);
expect($dashboard).to.contain(insurerName);
if (!isHcxEnabled) {
expect($dashboard).to.contain(insurerId);
expect($dashboard).to.contain(insurerName);
}
});
}
}
Expand Down
28 changes: 0 additions & 28 deletions public/config.json

This file was deleted.

Empty file removed public/env.json
Empty file.
3 changes: 1 addition & 2 deletions src/CAREUI/icons/CareIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import iconData from "./UniconPaths.json";
import { transformIcons } from "./icon";
import { useEffect } from "react";

import iconData from "./UniconPaths.json";

export type IconName = keyof typeof iconData;

export interface CareIconProps {
Expand Down
114 changes: 0 additions & 114 deletions src/Common/hooks/useAsyncOptions.ts
khavinshankar marked this conversation as resolved.
Outdated
Show resolved Hide resolved

This file was deleted.

35 changes: 21 additions & 14 deletions src/Components/Common/PMJAYProcedurePackageAutocomplete.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
import { useAsyncOptions } from "../../Common/hooks/useAsyncOptions";
import { listPMJYPackages } from "../../Redux/actions";
import { Autocomplete } from "../Form/FormFields/Autocomplete";
import FormField from "../Form/FormFields/FormField";
import {
FormFieldBaseProps,
useFormFieldPropsResolver,
} from "../Form/FormFields/Utils";

type PMJAYPackageItem = {
import { Autocomplete } from "../Form/FormFields/Autocomplete";
import FormField from "../Form/FormFields/FormField";
import routes from "../../Redux/api";
import { useState } from "react";
import useQuery from "../../Utils/request/useQuery";
import { mergeQueryOptions } from "../../Utils/utils";

export type PMJAYPackageItem = {
name?: string;
code?: string;
price?: number;
Expand All @@ -19,8 +22,11 @@ type Props = FormFieldBaseProps<PMJAYPackageItem>;
export default function PMJAYProcedurePackageAutocomplete(props: Props) {
const field = useFormFieldPropsResolver(props);

const { fetchOptions, isLoading, options } =
useAsyncOptions<PMJAYPackageItem>("code");
const [query, setQuery] = useState("");

const { data, loading } = useQuery(routes.hcx.claims.listPMJYPackages, {
query: { query, limit: 10 },
});

return (
<FormField field={field}>
Expand All @@ -30,19 +36,20 @@ export default function PMJAYProcedurePackageAutocomplete(props: Props) {
disabled={field.disabled}
value={field.value}
onChange={field.handleChange}
options={options(field.value ? [field.value] : []).map((o) => {
// TODO: update backend to return price as number instead
return {
options={mergeQueryOptions(
(field.value ? [field.value] : []).map((o) => ({
...o,
price:
o.price && parseFloat(o.price?.toString().replaceAll(",", "")),
};
})}
})),
data ?? [],
(obj) => obj.code,
)}
optionLabel={optionLabel}
optionDescription={optionDescription}
optionValue={(option) => option}
onQuery={(query) => fetchOptions(listPMJYPackages(query))}
isLoading={isLoading}
onQuery={setQuery}
isLoading={loading}
/>
</FormField>
);
Expand Down
Loading
Loading