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

ABDM M3 #7193

Merged
merged 74 commits into from
May 14, 2024
Merged

ABDM M3 #7193

Show file tree
Hide file tree
Changes from 73 commits
Commits
Show all changes
74 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
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
3382e20
use request instead of dispatch
khavinshankar May 14, 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: 2 additions & 0 deletions cypress/e2e/facility_spec/facility_manage.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ describe("Facility Manage Functions", () => {
facilityManage.clickButtonWithText(facilityHfridUpdateButton);
facilityManage.verifySuccessMessageVisibilityAndContent(
facilityHfridToastNotificationText,
true,
);
// update the existing middleware
facilityPage.clickManageFacilityDropdown();
Expand All @@ -98,6 +99,7 @@ describe("Facility Manage Functions", () => {
facilityManage.clickButtonWithText(facilityHfridUpdateButton);
facilityManage.verifySuccessMessageVisibilityAndContent(
facilityHfridToastNotificationText,
true,
);
// verify its reflection
facilityPage.clickManageFacilityDropdown();
Expand Down
8 changes: 6 additions & 2 deletions cypress/pageobject/Facility/FacilityManage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,12 @@ class FacilityManage {
cy.get("#hf_id").click().clear().click().type(address);
}

verifySuccessMessageVisibilityAndContent(text) {
cy.get(".pnotify-text").should("be.visible").contains(text);
verifySuccessMessageVisibilityAndContent(text, isRegex = false) {
if (isRegex) {
cy.get(".pnotify-text").should("be.visible").contains(text);
} else {
cy.get(".pnotify-text").should("be.visible").and("contain.text", text);
}
}

verifyMiddlewareAddressValue(expectedValue) {
Expand Down
458 changes: 241 additions & 217 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
"echarts-for-react": "^3.0.2",
"eslint-mdx": "^3.1.5",
"events": "^3.3.0",
"hi-profiles": "^1.0.6",
"i18next": "^23.2.7",
"i18next-browser-languagedetector": "^7.1.0",
"lodash-es": "^4.17.21",
Expand Down
21 changes: 21 additions & 0 deletions src/Common/constants.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -697,6 +697,7 @@ export const CONSULTATION_TABS = [
{ text: "PRESSURE_SORE", desc: "Pressure Sore" },
{ text: "NURSING", desc: "Nursing" },
{ text: "DIALYSIS", desc: "Dialysis" },
{ text: "ABDM", desc: "ABDM Records" },
];

export const RHYTHM_CHOICES: Array<OptionsType> = [
Expand Down Expand Up @@ -1097,6 +1098,26 @@ export const ExternalResultImportSchema: SchemaType = {
Result: { prop: "result", type: "string" },
};

// ABDM
export const ABDM_CONSENT_PURPOSE = [
{ value: "CAREMGT", label: "Care Management" },
{ value: "BTG", label: "Break The Glass" },
{ value: "PUBHLTH", label: "Public Health" },
{ value: "HPAYMT", label: "Healthcare Payment" },
{ value: "DSRCH", label: "Disease Specific Healthcare Research" },
{ value: "PATRQT", label: "Self Requested" },
];

export const ABDM_HI_TYPE = [
{ value: "Prescription", label: "Prescription" },
{ value: "DiagnosticReport", label: "Diagnostic Report" },
{ value: "OPConsultation", label: "Op Consultation" },
{ value: "DischargeSummary", label: "Discharge Summary" },
{ value: "ImmunizationRecord", label: "Immunization Record" },
{ value: "HealthDocumentRecord", label: "Record Artifact" },
{ value: "WellnessRecord", label: "Wellness Record" },
];

export const USER_TYPES_MAP = {
Pharmacist: "Pharmacist",
Volunteer: "Volunteer",
Expand Down
166 changes: 166 additions & 0 deletions src/Components/ABDM/ABDMFacilityRecords.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
import { Link } from "raviger";
import routes from "../../Redux/api";
import useQuery from "../../Utils/request/useQuery";
import { formatDateTime } from "../../Utils/utils";
import Loading from "../Common/Loading";
import Page from "../Common/components/Page";

interface IProps {
facilityId: string;
}

const TableHeads = [
"Patient",
"Status",
"Created On",
"Consent Granted On",
// "Requested By",
"Health Information Range",
"Expires On",
"HI Profiles",
];

export default function ABDMFacilityRecords({ facilityId }: IProps) {
const { data: consentsResult, loading } = useQuery(routes.abha.listConsents, {
query: { facility: facilityId, ordering: "-created_date" },
});

if (loading) {
return <Loading />;
}

return (
<Page title="Patient Consent List">
<div className="px-4 sm:px-6 lg:px-8">
<div className="sm:flex sm:items-center"></div>
<div className="mt-8 flow-root">
<div className="-mx-4 -my-2 overflow-x-auto sm:-mx-6 lg:-mx-8">
<div className="inline-block min-w-full py-2 align-middle sm:px-6 lg:px-8">
{/* eslint-disable-next-line tailwindcss/migration-from-tailwind-2 */}
<div className="overflow-hidden shadow ring-1 ring-black ring-opacity-5 sm:rounded-lg">
<table className="min-w-full table-fixed divide-y divide-gray-300">
<thead className="bg-gray-50">
<tr>
{TableHeads.map((head) => (
<th
scope="col"
className="px-3 py-3.5 text-center text-sm font-semibold text-gray-900"
>
{head}
</th>
))}
<th
scope="col"
className="sticky right-0 top-0 py-3.5 pl-3 pr-4 sm:pr-6"
>
<span className="sr-only">View</span>
</th>
</tr>
</thead>
<tbody className="divide-y divide-gray-200 bg-white">
{consentsResult?.results.map((consent) => (
<tr key={consent.id}>
<td className="px-3 py-4 text-center text-sm">
{consent.patient_abha_object?.name}
<p className="text-gray-600">
({consent.patient_abha})
</p>
</td>

<td className="px-3 py-4 text-center text-sm capitalize">
{new Date(
consent.consent_artefacts?.[0]?.expiry ??
consent.expiry,
) < new Date()
? "EXPIRED"
: consent.consent_artefacts?.[0]?.status ??
consent.status}
</td>

<td className="px-3 py-4 text-center text-sm">
{formatDateTime(consent.created_date)}
</td>

<td className="px-3 py-4 text-center text-sm">
{consent.consent_artefacts.length
? formatDateTime(
consent.consent_artefacts[0].created_date,
)
: "-"}
</td>

{/* <td className="px-3 py-4 text-center text-sm">
{`${consent.requester?.first_name} ${consent.requester?.last_name}`.trim()}
<p className="text-gray-600">
({consent.requester.username})
</p>
</td> */}

<td className="px-3 py-4 text-center text-sm">
{formatDateTime(
consent.consent_artefacts?.[0]?.from_time ??
consent.from_time,
)}{" "}
<br />
{formatDateTime(
consent.consent_artefacts?.[0]?.to_time ??
consent.to_time,
)}
</td>

<td className="px-3 py-4 text-center text-sm">
{formatDateTime(
consent.consent_artefacts?.[0]?.expiry ??
consent.expiry,
)}
</td>

<td className="px-3 py-4 text-center text-sm">
<div className="flex flex-wrap items-center justify-center">
{(
consent.consent_artefacts?.[0]?.hi_types ??
consent.hi_types
)?.map((hiType) => (
<span className="mb-2 mr-2 rounded-full bg-gray-100 px-2 py-1 text-xs font-medium text-gray-600">
{hiType}
</span>
))}
</div>
</td>

<td className="sticky right-0 whitespace-nowrap bg-white py-4 pl-3 pr-4 text-right text-sm font-medium sm:pr-6">
<div className="flex flex-col items-center justify-center gap-2">
{(consent.consent_artefacts?.[0]?.status ??
consent.status) === "GRANTED" &&
new Date(
consent.consent_artefacts?.[0]?.expiry ??
consent.expiry,
) > new Date() ? (
<Link
key={consent.id}
href={`/abdm/health-information/${consent.id}`}
className={
"cursor-pointer text-primary-600 hover:text-primary-900"
}
>
View
</Link>
) : (
<p className="cursor-not-allowed text-gray-600 opacity-70 ">
View
</p>
)}
</div>
</td>
</tr>
))}
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</Page>
);
}
Loading
Loading