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

Fixed Abha profile linking issue #8549

Closed
wants to merge 95 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
95 commits
Select commit Hold shift + click to select a range
399e33c
added create consent functionality
khavinshankar Aug 30, 2023
d4fd2d6
renamed patient_health_id to patient_abha
khavinshankar Aug 30, 2023
33666c6
added abdm tab in consultation dashboard
khavinshankar Aug 31, 2023
2e020bd
Merge branch 'develop' into abdm-m3
khavinshankar Sep 29, 2023
6cb1bfe
fix abdm consultation tab
khavinshankar Sep 29, 2023
11cb15e
show health information
khavinshankar Oct 2, 2023
ce2432f
ui improvements
khavinshankar Oct 2, 2023
e631138
added patient id verification in fetch abdm records form
khavinshankar Oct 16, 2023
08edcac
fixed phone number parsing issue while linking abha number
khavinshankar Oct 18, 2023
deea512
change proxy url
khavinshankar Oct 25, 2023
9aba833
show deny status in the consent request
khavinshankar Dec 4, 2023
b253950
upgraded hi-profiles package
khavinshankar Dec 6, 2023
9f171d6
added consent requests table for facilities in abdm
khavinshankar Dec 19, 2023
3d83d6d
consolidated multiple view artefact buttons into one
khavinshankar Dec 19, 2023
c7d3048
added consent granted on time in abdm facility records
khavinshankar Dec 20, 2023
fda359d
temp: use artefact 1's data
khavinshankar Dec 20, 2023
a874b9b
temp: update index
khavinshankar Jan 5, 2024
b888268
fixed consent status
khavinshankar Jan 8, 2024
b3d0f5a
Trigger Build.
khavinshankar Jan 17, 2024
971d819
Merge branch 'develop' of github.com:coronasafe/care_fe into abdm-m3
khavinshankar Jan 20, 2024
b040ea0
recreated package-lock.json (#7069)
khavinshankar Jan 20, 2024
f6e0923
show notification when health id registration fails
khavinshankar Jan 29, 2024
1fe1674
Merge branch 'develop' into abdm-m3
khavinshankar Jan 29, 2024
cfe5488
Merge branch 'develop' into abdm-m3
nihal467 Jan 29, 2024
5dccc81
Merge branch 'develop' into abdm-m3
khavinshankar Feb 1, 2024
76b436f
Merge branch 'develop' into abdm-m3
nihal467 Feb 6, 2024
cd94fa7
Update netlify.toml
khavinshankar Feb 7, 2024
ed138bd
Trigger Build
khavinshankar Feb 7, 2024
bfcc535
Merge branch 'abdm-m3' of github.com:coronasafe/care_fe into abdm-m3
khavinshankar Feb 7, 2024
fe3aadc
merge develop with abdm-m3
khavinshankar Feb 8, 2024
c85eb20
revert auto formatted styles
khavinshankar Feb 8, 2024
bbf35b4
fixed a typo in styles
khavinshankar Feb 8, 2024
e4efed7
updated the proxy
khavinshankar Feb 8, 2024
5c3c156
Merge branch 'abdm-m3' of github.com:coronasafe/care_fe into abdm-m3
khavinshankar Feb 8, 2024
278a7e2
fixed cypress fails
khavinshankar Feb 8, 2024
b63b7e4
uncommented tests that were commented by mistake
khavinshankar Feb 8, 2024
c5c3c2c
Merge branch 'show-notification-hf' of github.com:coronasafe/care_fe …
khavinshankar Feb 8, 2024
02e77d4
fix cypress test for facility_manage
rithviknishad Feb 8, 2024
25acb6c
fix external results improper check
rithviknishad Feb 8, 2024
a662788
Merge branch 'develop' into abdm-m3
khavinshankar Feb 18, 2024
f7c1a2a
Merge branch 'abdm-m3' of github.com:coronasafe/care_fe into abdm-m3
khavinshankar Feb 18, 2024
87b41e3
Merge branch 'develop' of github.com:coronasafe/care_fe into abdm-m3
khavinshankar Feb 26, 2024
f78dddf
fixed build
khavinshankar Feb 26, 2024
d9a1ba6
update package lock from linux
khavinshankar Mar 1, 2024
858a33f
update package lock with right node and npm versions
khavinshankar Mar 1, 2024
8787aa0
Merge branch 'develop' of github.com:coronasafe/care_fe into abdm-m3
khavinshankar Mar 1, 2024
eacb0df
update package-lock from linux
rithviknishad Mar 4, 2024
e6ebaf9
update proxy for testing
khavinshankar Mar 8, 2024
6d21d4c
Merge branch 'develop' into abdm-m3
rithviknishad Mar 8, 2024
f40e521
update proxy
khavinshankar Mar 8, 2024
7050583
update lockfile from linux
rithviknishad Mar 8, 2024
82df22e
Merge branch 'abdm-m3' of github.com:coronasafe/care_fe into abdm-m3
rithviknishad Mar 8, 2024
d1ab635
revert proxies
khavinshankar Mar 8, 2024
211c66b
update proxy for netlify deploy previews
khavinshankar Mar 8, 2024
6386016
rewrire fetch records over abdm
khavinshankar Mar 8, 2024
e49951f
removed extra button and rewrired fetch records
khavinshankar Mar 8, 2024
2c68734
fix push message based event trigger
khavinshankar Mar 9, 2024
287c9b9
Merge branch 'develop' into abdm-m3
khavinshankar Apr 8, 2024
0f9dd99
create package lock from linux
khavinshankar Apr 8, 2024
a09c2c4
fixed type errors during build
khavinshankar Apr 8, 2024
7a9c8db
update backend link for netlify deploys
khavinshankar Apr 8, 2024
7d7cd06
fix the failing cypress test
khavinshankar Apr 8, 2024
8d78902
reverted unwanted changes and fixed linting errors
khavinshankar Apr 8, 2024
47253ed
fixed a typo
khavinshankar Apr 8, 2024
d2d9609
Merge branch 'develop' into abdm-m3
khavinshankar Apr 12, 2024
a82d0fe
added select all option for hi types
khavinshankar Apr 12, 2024
84493b6
minor ui fix
khavinshankar Apr 12, 2024
e496a1b
set default expiry date to 30 days from today
khavinshankar Apr 12, 2024
39c7345
ui enhancement: show date selector on top in abdm fetch records modal
khavinshankar Apr 12, 2024
bbd8fa4
refactored abdm wrt backend abdm plug separation
khavinshankar Apr 28, 2024
720d3d4
Merge branch 'develop' into abdm-m3
khavinshankar May 14, 2024
24aca42
change proxy
khavinshankar May 14, 2024
4a07154
remove actions and use apis directly
khavinshankar May 14, 2024
5715e54
fix date input
khavinshankar May 14, 2024
857fe8d
Merge branch 'abdm-m3' into pre-abdm-plug
khavinshankar May 14, 2024
8168812
remove unwanted console logs
khavinshankar May 14, 2024
e05183e
fix linting issues
khavinshankar May 14, 2024
95c92bb
fix linting issue in cypress files
khavinshankar May 14, 2024
18b2043
Merge branch 'develop' into pre-abdm-plug
khavinshankar May 14, 2024
ca1cc39
revert unwanted changes
khavinshankar May 14, 2024
196007b
Merge branch 'develop' into pre-abdm-plug
khavinshankar May 20, 2024
c31e63e
fix a type error
May 20, 2024
7cedfee
Merge branch 'pre-abdm-plug' of github.com:coronasafe/care_fe into pr…
May 20, 2024
6a89ff4
fix abdm records consultation tab check
May 20, 2024
cbe1714
Merge branch 'develop' into pre-abdm-plug
khavinshankar May 23, 2024
b85e2a8
disable error while fetching abha number
khavinshankar May 28, 2024
c1976e5
Merge branch 'develop' into pre-abdm-plug
khavinshankar May 28, 2024
5b71244
removed unnecessary error toast while adding care context
khavinshankar May 29, 2024
bc584c0
temp: update backend api url
khavinshankar Jun 5, 2024
35069fb
added state_name to abha qr code
khavinshankar Jul 5, 2024
9c2a352
Merge branch 'develop' into pre-abdm-plug
khavinshankar Jul 8, 2024
927f9b3
fixed cypress tests
khavinshankar Jul 8, 2024
8c4ebd9
reverted backend proxy in netlify config
khavinshankar Jul 8, 2024
e465b1e
Merge branch 'develop' into pre-abdm-plug
khavinshankar Sep 17, 2024
ebd7cfe
fixed abha number linking issue
khavinshankar Sep 17, 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
2 changes: 0 additions & 2 deletions cypress/e2e/users_spec/user_manage.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ describe("Manage User", () => {

beforeEach(() => {
cy.restoreLocalStorage();
console.log(localStorage);
cy.clearLocalStorage(/filters--.+/);
console.log(localStorage);
cy.awaitUrl("/users");
});

Expand Down
2 changes: 0 additions & 2 deletions cypress/e2e/users_spec/user_profile.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ describe("Manage User Profile", () => {

beforeEach(() => {
cy.restoreLocalStorage();
console.log(localStorage);
cy.clearLocalStorage(/filters--.+/);
console.log(localStorage);
cy.awaitUrl("/user/profile");
});

Expand Down
4 changes: 2 additions & 2 deletions src/Components/ABDM/ABHAProfileModal.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import * as Notify from "../../Utils/Notifications";

import { AbhaObject } from "../Patient/models";
import CareIcon from "../../CAREUI/icons/CareIcon";
import DialogModal from "../Common/Dialog";
import QRCode from "qrcode.react";
import { formatDateTime } from "../../Utils/utils";
import { useRef } from "react";
import request from "../../Utils/request/request";
import routes from "../../Redux/api";
import { AbhaNumberModel } from "./types/abha";

interface IProps {
patientId?: string;
abha?: AbhaObject;
abha?: AbhaNumberModel;
show: boolean;
onClose: () => void;
}
Expand Down
20 changes: 9 additions & 11 deletions src/Components/ABDM/FetchRecordsModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import * as Notification from "../../Utils/Notifications.js";

import ButtonV2 from "../Common/components/ButtonV2";
import DialogModal from "../Common/Dialog";
import { PatientModel } from "../Patient/models";
import TextFormField from "../Form/FormFields/TextFormField";
import { useState } from "react";
import {
Expand All @@ -20,19 +19,20 @@ import { useMessageListener } from "../../Common/hooks/useMessageListener.js";
import CircularProgress from "../Common/components/CircularProgress.js";
import CareIcon from "../../CAREUI/icons/CareIcon.js";
import { classNames } from "../../Utils/utils.js";
import { AbhaNumberModel } from "./types/abha.js";
import { ConsentHIType, ConsentPurpose } from "./types/consent.js";
import useNotificationSubscriptionState from "../../Common/hooks/useNotificationSubscriptionState.js";

const getDate = (value: any) =>
value && dayjs(value).isValid() && dayjs(value).toDate();

interface IProps {
patient: PatientModel;
abha?: AbhaNumberModel;
show: boolean;
onClose: () => void;
}

export default function FetchRecordsModal({ patient, show, onClose }: IProps) {
export default function FetchRecordsModal({ abha, show, onClose }: IProps) {
const [idVerificationStatus, setIdVerificationStatus] = useState<
"pending" | "in-progress" | "verified" | "failed"
>("pending");
Expand All @@ -53,9 +53,7 @@ export default function FetchRecordsModal({ patient, show, onClose }: IProps) {

useMessageListener((data) => {
if (data.type === "MESSAGE" && data.from === "patients/on_find") {
if (
data.message?.patient?.id === patient?.abha_number_object?.health_id
) {
if (data.message?.patient?.id === abha?.health_id) {
setIdVerificationStatus("verified");
setErrors({
...errors,
Expand Down Expand Up @@ -85,7 +83,7 @@ export default function FetchRecordsModal({ patient, show, onClose }: IProps) {

<div className="flex items-center gap-3">
<TextFormField
value={patient?.abha_number_object?.health_id as string}
value={abha?.health_id as string}
onChange={() => null}
disabled
label="Patient Identifier"
Expand All @@ -98,7 +96,7 @@ export default function FetchRecordsModal({ patient, show, onClose }: IProps) {
onClick={async () => {
const { res } = await request(routes.abha.findPatient, {
body: {
id: patient?.abha_number_object?.health_id,
id: abha?.health_id,
},
reattempts: 0,
});
Expand Down Expand Up @@ -214,7 +212,7 @@ export default function FetchRecordsModal({ patient, show, onClose }: IProps) {
setIsMakingConsentRequest(true);
const { res } = await request(routes.abha.createConsent, {
body: {
patient_abha: patient?.abha_number_object?.health_id as string,
patient_abha: abha?.health_id as string,
hi_types: hiTypes,
purpose,
from_time: fromDate,
Expand All @@ -229,8 +227,8 @@ export default function FetchRecordsModal({ patient, show, onClose }: IProps) {
});

navigate(
`/facility/${patient.facility}/abdm` ??
`/facility/${patient.facility}/patient/${patient.id}/consultation/${patient.last_consultation?.id}/abdm`,
`/facility/${abha?.patient_object?.facility}/abdm` ??
`/facility/${abha?.patient_object?.facility}/patient/${abha?.patient_object?.id}/consultation/${abha?.patient_object?.last_consultation?.id}/abdm`,
);
} else {
Notification.Error({
Expand Down
2 changes: 1 addition & 1 deletion src/Components/ABDM/LinkABHANumberModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ const ScanABHAQRSection = ({
dob: abha?.dob.replace(/\//g, "-"),
address: abha?.address,
"dist name": abha?.["dist name"] ?? abha?.district_name,
"state name": abha?.["state name"],
"state name": abha?.["state name"] ?? abha?.state_name,
},
});

Expand Down
26 changes: 9 additions & 17 deletions src/Components/ABDM/LinkCareContextModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@ import * as Notification from "../../Utils/Notifications.js";
import ButtonV2 from "../Common/components/ButtonV2";
import DateFormField from "../Form/FormFields/DateFormField";
import DialogModal from "../Common/Dialog";
import { PatientModel } from "../Patient/models";
import TextFormField from "../Form/FormFields/TextFormField";
import { useState } from "react";
import routes from "../../Redux/api.js";
import request from "../../Utils/request/request.js";
import { AbhaNumberModel } from "./types/abha.js";

interface IProps {
consultationId: string;
patient: PatientModel;
abha?: AbhaNumberModel;
show: boolean;
onClose: () => void;
}

const LinkCareContextModal = ({
consultationId,
patient,
abha,
show,
onClose,
}: IProps) => {
Expand All @@ -33,15 +33,15 @@ const LinkCareContextModal = ({
>
<div className="flex items-center justify-between">
<TextFormField
value={patient?.abha_number_object?.name}
value={abha?.name}
onChange={() => null}
disabled
label="Name"
name="name"
error=""
/>
<TextFormField
value={patient?.abha_number_object?.gender}
value={abha?.gender}
onChange={() => null}
disabled
label="Gender"
Expand All @@ -52,11 +52,7 @@ const LinkCareContextModal = ({
<DateFormField
name="dob"
label="Date of Birth"
value={
patient?.abha_number_object?.date_of_birth
? new Date(patient?.abha_number_object?.date_of_birth)
: undefined
}
value={abha?.date_of_birth ? new Date(abha?.date_of_birth) : undefined}
onChange={() => null}
disabled
required
Expand Down Expand Up @@ -84,20 +80,16 @@ const LinkCareContextModal = ({
const { res } = await request(routes.abha.linkCareContext, {
body: {
consultation: consultationId,
name: patient?.abha_number_object?.name,
gender: patient?.abha_number_object?.gender,
dob: patient?.abha_number_object?.date_of_birth,
name: abha?.name,
gender: abha?.gender,
dob: abha?.date_of_birth,
},
reattempts: 0,
});
if (res?.status === 202) {
Notification.Success({
msg: "Care Context sucessfully linked!",
});
} else {
Notification.Error({
msg: "Error in linking Care Context!",
});
}
setIsLinkingCareContext(false);
onClose();
Expand Down
3 changes: 2 additions & 1 deletion src/Components/ABDM/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ export interface ABHAQRContent {
address: string;
distlgd: string;
district_name?: string;
state_name?: string;
dob: string;
gender: "M" | "F" | "O";
hid?: string;
Expand All @@ -132,6 +133,6 @@ export interface ABHAQRContent {
hidn: string;
mobile: string;
name: string;
"state name": string;
"state name"?: string;
statelgd: string;
}
4 changes: 4 additions & 0 deletions src/Components/ABDM/types/abha.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { PatientModel } from "../../Patient/models";

export type AbhaNumberModel = {
id: number;
external_id: string;
Expand All @@ -18,4 +20,6 @@ export type AbhaNumberModel = {
email: string | null;
profile_photo: string | null;
new: boolean;
patient: string | null;
patient_object: PatientModel | null;
};
19 changes: 18 additions & 1 deletion src/Components/Facility/ConsultationDetails/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ import { AssetBedModel } from "../../Assets/AssetTypes";
import PatientInfoCard from "../../Patient/PatientInfoCard";
import RelativeDateUserMention from "../../Common/RelativeDateUserMention";
import DiagnosesListAccordion from "../../Diagnosis/DiagnosesListAccordion";
import { AbhaNumberModel } from "../../ABDM/types/abha";
import routes from "../../../Redux/api";
import request from "../../../Utils/request/request";
import { CameraFeedPermittedUserTypes } from "../../../Utils/permissions";
import Error404 from "../../ErrorPages/404";

Expand Down Expand Up @@ -85,6 +88,7 @@ export const ConsultationDetails = (props: any) => {
{} as ConsultationModel,
);
const [patientData, setPatientData] = useState<PatientModel>({});
const [abhaNumberData, setAbhaNumberData] = useState<AbhaNumberModel>();
const [activeShiftingData, setActiveShiftingData] = useState<Array<any>>([]);
const [isCameraAttached, setIsCameraAttached] = useState(false);

Expand Down Expand Up @@ -137,6 +141,8 @@ export const ConsultationDetails = (props: any) => {
})
: false;
setIsCameraAttached(isCameraAttachedRes);

// Get patient data
const id = res.data.patient;
const patientRes = await dispatch(getPatient({ id }));
if (patientRes?.data) {
Expand All @@ -159,6 +165,16 @@ export const ConsultationDetails = (props: any) => {
setPatientData(data);
}

// Get abha number data
const { data: abhaNumberData } = await request(
routes.abha.getAbhaNumber,
{
pathParams: { abhaNumberId: id ?? "" },
silent: true,
},
);
setAbhaNumberData(abhaNumberData);

// Get shifting data
const shiftingRes = await dispatch(
listShiftRequests({ patient: id }, "shift-list-call"),
Expand Down Expand Up @@ -290,6 +306,7 @@ export const ConsultationDetails = (props: any) => {
<div className="size-full rounded-lg border bg-white text-black shadow">
<PatientInfoCard
patient={patientData}
abhaNumber={abhaNumberData}
consultation={consultationData}
fetchPatientData={fetchData}
consultationId={consultationId}
Expand Down Expand Up @@ -382,7 +399,7 @@ export const ConsultationDetails = (props: any) => {
return null; // Hide feed tab
}

if (p.text === "ABDM" && !patientData.abha_number) {
if (p.text === "ABDM" && !abhaNumberData?.abha_number) {
return null;
}

Expand Down
1 change: 0 additions & 1 deletion src/Components/Facility/Consultations/LiveFeed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,6 @@ const LiveFeed = (props: any) => {
updatePreset: (option) => {
getCameraStatus({
onSuccess: async (data) => {
console.log({ currentPreset, data });
if (currentPreset?.asset_object?.id && data?.position) {
setLoading(option.loadingLabel);
console.log("Updating Preset");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ const DataTable = (props: any) => {

const DataDescription = (props: any) => {
const { title, data } = props;
console.log("Data Description", title, data);

return (
<div>
Expand Down
4 changes: 0 additions & 4 deletions src/Components/Facility/Consultations/VentilatorPlot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,6 @@ export const VentilatorPlot = (props: any) => {
})
.filter((p) => p.value !== null);

useEffect(() => {
console.log(bilateral);
}, [bilateral]);

return (
<div>
<div className="grid-row-1 grid gap-4 md:grid-cols-2">
Expand Down
1 change: 0 additions & 1 deletion src/Components/Facility/FacilityCreate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,6 @@ export const FacilityCreate = (props: FacilityProps) => {
const handleSubmit = async (e: any) => {
e.preventDefault();
const validated = validateForm();
console.log(state.form);
if (validated) {
setIsLoading(true);
const data: FacilityRequest = {
Expand Down
3 changes: 0 additions & 3 deletions src/Components/Facility/FacilityHome.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import RecordMeta from "../../CAREUI/display/RecordMeta";
import Table from "../Common/components/Table";

import { navigate } from "raviger";
import { useMessageListener } from "../../Common/hooks/useMessageListener";
import { useTranslation } from "react-i18next";
import useAuthUser from "../../Common/hooks/useAuthUser.js";
import request from "../../Utils/request/request.js";
Expand Down Expand Up @@ -61,8 +60,6 @@ export const FacilityHome = ({ facilityId }: Props) => {
const [coverImageEdited, setCoverImageEdited] = useState(false);
const authUser = useAuthUser();

useMessageListener((data) => console.log(data));

const {
data: facilityData,
loading: isLoading,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ export default function ViewInvestigationSuggestions(props: {
return <Loading />;
}

console.log("Investigations: ", investigations);

return (
<div className="mt-5" id="investigation-suggestions">
<h3>{t("investigations_suggested")}</h3>
Expand Down Expand Up @@ -110,11 +108,6 @@ export default function ViewInvestigationSuggestions(props: {
const investigationMissed =
nextInvestigationTime &&
dayjs().isAfter(nextInvestigationTime);
console.log(
type,
nextFurthestInvestigation,
nextInvestigationTime,
);

return (
<li
Expand Down
2 changes: 0 additions & 2 deletions src/Components/Facility/Investigations/Reports/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,6 @@ const InvestigationReports = ({ id }: any) => {
selectedInvestigations,
} = state as InitialState;

console.log("state", state);

const fetchInvestigationsData = useCallback(
async (
onSuccess: (
Expand Down
2 changes: 0 additions & 2 deletions src/Components/HCX/CreateClaimCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ export default function CreateClaimCard({
const [createdClaim, setCreatedClaim] = useState<HCXClaimModel>();
const [use_, setUse_] = useState(use);

console.log(items);

useEffect(() => {
async function autoFill() {
const latestApprovedPreAuthsRes = await dispatch(
Expand Down
Loading
Loading