From 7fb4185297f98f4c0ee2ecf588c5be26bb4dce2c Mon Sep 17 00:00:00 2001 From: Ashraf Mohammed <98876115+AshrafMd-1@users.noreply.github.com> Date: Wed, 17 Apr 2024 15:08:38 +0530 Subject: [PATCH 01/11] Fix Domiciliary Care discrepancy. (#7568) * Fix bug * remove extra space Co-authored-by: Ashesh <3626859+Ashesh3@users.noreply.github.com> --------- Co-authored-by: Khavin Shankar Co-authored-by: Ashesh <3626859+Ashesh3@users.noreply.github.com> --- src/Components/Facility/TreatmentSummary.tsx | 8 ++++++-- src/Components/Patient/PatientInfoCard.tsx | 4 +++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/Components/Facility/TreatmentSummary.tsx b/src/Components/Facility/TreatmentSummary.tsx index d0d1658cd61..a83cb64ec66 100644 --- a/src/Components/Facility/TreatmentSummary.tsx +++ b/src/Components/Facility/TreatmentSummary.tsx @@ -78,9 +78,13 @@ const TreatmentSummary = (props: any) => {
- Date of admission : + {consultationData?.suggestion === "DC" ? ( + Date of domiciliary care commenced : + ) : ( + Date of admission : + )} - {consultationData?.admitted + {consultationData?.encounter_date ? formatDateTime(consultationData.encounter_date) : " --/--/----"} diff --git a/src/Components/Patient/PatientInfoCard.tsx b/src/Components/Patient/PatientInfoCard.tsx index b2f00dd1cc3..cb73739b3ba 100644 --- a/src/Components/Patient/PatientInfoCard.tsx +++ b/src/Components/Patient/PatientInfoCard.tsx @@ -401,7 +401,9 @@ export default function PatientInfoCard(props: { {consultation?.encounter_date && (
- Admission on:{" "} + {consultation.suggestion === "DC" + ? "Commenced on: " + : "Admitted on: "} {formatDateTime(consultation?.encounter_date)}
)} From 214e45f8d0377ef01b4d8a950c352b3f49942314 Mon Sep 17 00:00:00 2001 From: Ashesh <3626859+Ashesh3@users.noreply.github.com> Date: Wed, 17 Apr 2024 15:09:23 +0530 Subject: [PATCH 02/11] Remove recording indicator when recorder is stopped (#7640) --- src/Utils/useRecorder.js | 7 +++++++ src/Utils/useSegmentedRecorder.ts | 12 +++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/Utils/useRecorder.js b/src/Utils/useRecorder.js index 5c9dc324ce1..585e557d787 100644 --- a/src/Utils/useRecorder.js +++ b/src/Utils/useRecorder.js @@ -7,6 +7,12 @@ const useRecorder = (handleMicPermission) => { const [recorder, setRecorder] = useState(null); const [newBlob, setNewBlob] = useState(null); + useEffect(() => { + if (!isRecording && recorder && audioURL) { + setRecorder(null); + } + }, [isRecording, recorder, audioURL]); + useEffect(() => { // Lazily obtain recorder first time we're recording. if (recorder === null) { @@ -32,6 +38,7 @@ const useRecorder = (handleMicPermission) => { if (isRecording) { recorder.start(); } else { + recorder.stream.getTracks().forEach((i) => i.stop()); recorder.stop(); } diff --git a/src/Utils/useSegmentedRecorder.ts b/src/Utils/useSegmentedRecorder.ts index d58ca67bc7c..9434ea8383c 100644 --- a/src/Utils/useSegmentedRecorder.ts +++ b/src/Utils/useSegmentedRecorder.ts @@ -2,7 +2,6 @@ import { useState, useEffect } from "react"; import * as Notify from "./Notifications"; const useSegmentedRecording = () => { - const [audioURL, setAudioURL] = useState(""); const [isRecording, setIsRecording] = useState(false); const [recorder, setRecorder] = useState(null); const [audioBlobs, setAudioBlobs] = useState([]); @@ -11,6 +10,12 @@ const useSegmentedRecording = () => { const bufferInterval = 1 * 1000; const splitSizeLimit = 20 * 1000000; // 20MB + useEffect(() => { + if (!isRecording && recorder && audioBlobs.length > 0) { + setRecorder(null); + } + }, [isRecording, recorder, audioBlobs]); + useEffect(() => { if (recorder === null) { if (isRecording || restart) { @@ -37,6 +42,9 @@ const useSegmentedRecording = () => { } else { if (restart) { setIsRecording(true); + } else { + recorder?.stream?.getTracks()?.forEach((i) => i?.stop()); + recorder.stop(); } recorder.state === "recording" && recorder.stop(); } @@ -96,12 +104,10 @@ const useSegmentedRecording = () => { }; const resetRecording = () => { - setAudioURL(""); setAudioBlobs([]); }; return { - audioURL, isRecording, startRecording, stopRecording, From 5326da36946e88f391a22fd3834c0959522c12ec Mon Sep 17 00:00:00 2001 From: Pranshu Aggarwal <70687348+Pranshu1902@users.noreply.github.com> Date: Wed, 17 Apr 2024 15:10:13 +0530 Subject: [PATCH 03/11] Add Restriction to redirect to facility page if user can't Create Facility (#7633) --- src/Components/Facility/FacilityCreate.tsx | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/Components/Facility/FacilityCreate.tsx b/src/Components/Facility/FacilityCreate.tsx index 8aec0861d62..3138f374e4b 100644 --- a/src/Components/Facility/FacilityCreate.tsx +++ b/src/Components/Facility/FacilityCreate.tsx @@ -18,7 +18,7 @@ import { SelectFormField, } from "../Form/FormFields/SelectFormField"; import { Popover, Transition } from "@headlessui/react"; -import { Fragment, lazy, useState } from "react"; +import { Fragment, lazy, useEffect, useState } from "react"; import Steps, { Step } from "../Common/Steps"; import { getPincodeDetails, @@ -57,6 +57,7 @@ import request from "../../Utils/request/request.js"; import routes from "../../Redux/api.js"; import useQuery from "../../Utils/request/useQuery.js"; import { RequestResult } from "../../Utils/request/types.js"; +import useAuthUser from "../../Common/hooks/useAuthUser"; const Loading = lazy(() => import("../Common/Loading")); @@ -159,6 +160,21 @@ export const FacilityCreate = (props: FacilityProps) => { const headerText = !facilityId ? "Create Facility" : "Update Facility"; const buttonText = !facilityId ? "Save Facility" : "Update Facility"; + const authUser = useAuthUser(); + useEffect(() => { + if ( + authUser && + authUser.user_type !== "StateAdmin" && + authUser.user_type !== "DistrictAdmin" && + authUser.user_type !== "DistrictLabAdmin" + ) { + navigate("/facility"); + Notification.Error({ + msg: "You don't have permission to perform this action. Contact the admin", + }); + } + }, [authUser]); + const { data: districtData, refetch: districtFetch, From 5e641e446f4a5379de185241799965eb62590919 Mon Sep 17 00:00:00 2001 From: Bodhish Thomas Date: Wed, 17 Apr 2024 15:10:54 +0530 Subject: [PATCH 04/11] Add combine action to merge dependabot prs (#7614) Co-authored-by: Mohammed Nihal <57055998+nihal467@users.noreply.github.com> --- .github/workflows/combine.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/workflows/combine.yml diff --git a/.github/workflows/combine.yml b/.github/workflows/combine.yml new file mode 100644 index 00000000000..d44461ff5a7 --- /dev/null +++ b/.github/workflows/combine.yml @@ -0,0 +1,23 @@ +name: Combine Dependencies + +on: workflow_dispatch + +# The minimum permissions required to run this Action +permissions: + contents: write + pull-requests: write + checks: read + +jobs: + combine-prs: + runs-on: ubuntu-latest + + steps: + - name: Combine dependencies + id: combine-dependencies + uses: github/combine-prs@v5.0.0 + with: + pr_title: Combined dependencies # The title of the pull request to create + select_label: dependencies # The label which marks PRs that should be combined. + labels: combined-dependencies # Add a label to the combined PR + ci_required: "false" # Whether or not CI should be passing to combine the PR From 821cf2a8f0e63e0af6728a31340cdb17561cfc94 Mon Sep 17 00:00:00 2001 From: Vedant Jain <129421822+jainvedant392@users.noreply.github.com> Date: Wed, 17 Apr 2024 15:20:34 +0530 Subject: [PATCH 05/11] Add Patient Filter for Review Missed (#7328) * Add Patient Filter for Review Missed * removed dotenv * modified vite.config.mts --- src/Components/Patient/ManagePatients.tsx | 2 ++ src/Components/Patient/PatientFilter.tsx | 15 +++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/src/Components/Patient/ManagePatients.tsx b/src/Components/Patient/ManagePatients.tsx index 09d5a06fa32..e2890f0cc79 100644 --- a/src/Components/Patient/ManagePatients.tsx +++ b/src/Components/Patient/ManagePatients.tsx @@ -225,6 +225,7 @@ export const PatientManager = () => { diagnoses_provisional: qParams.diagnoses_provisional || undefined, diagnoses_unconfirmed: qParams.diagnoses_unconfirmed || undefined, diagnoses_differential: qParams.diagnoses_differential || undefined, + review_missed: qParams.review_missed || undefined, }; useEffect(() => { @@ -944,6 +945,7 @@ export const PatientManager = () => { kasp(), badge("COWIN ID", "covin_id"), badge("Is Antenatal", "is_antenatal"), + badge("Review Missed", "review_missed"), badge( "Is Medico-Legal Case", "last_consultation_medico_legal_case", diff --git a/src/Components/Patient/PatientFilter.tsx b/src/Components/Patient/PatientFilter.tsx index 0c0087e6d66..79a04242170 100644 --- a/src/Components/Patient/PatientFilter.tsx +++ b/src/Components/Patient/PatientFilter.tsx @@ -100,6 +100,7 @@ export default function PatientFilter(props: any) { diagnoses_provisional: filter.diagnoses_provisional || null, diagnoses_unconfirmed: filter.diagnoses_unconfirmed || null, diagnoses_differential: filter.diagnoses_differential || null, + review_missed: filter.review_missed || null, }); useQuery(routes.getAnyFacility, { @@ -203,6 +204,7 @@ export default function PatientFilter(props: any) { diagnoses_provisional, diagnoses_unconfirmed, diagnoses_differential, + review_missed, } = filterState; const data = { district: district || "", @@ -270,6 +272,7 @@ export default function PatientFilter(props: any) { diagnoses_provisional: diagnoses_provisional || "", diagnoses_unconfirmed: diagnoses_unconfirmed || "", diagnoses_differential: diagnoses_differential || "", + review_missed: review_missed || "", }; onChange(data); }; @@ -437,6 +440,18 @@ export default function PatientFilter(props: any) { } />
+
+ Review Missed + (o === "true" ? "Yes" : "No")} + value={filterState.review_missed} + onChange={(v) => + setFilterState({ ...filterState, review_missed: v }) + } + /> +
Is Medico-Legal Case Date: Wed, 17 Apr 2024 15:27:35 +0530 Subject: [PATCH 06/11] Fix: #7536 (#7549) --- src/Components/Form/FormFields/TextFormField.tsx | 2 +- src/Components/Patient/PatientRegister.tsx | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Components/Form/FormFields/TextFormField.tsx b/src/Components/Form/FormFields/TextFormField.tsx index 8f1ee341e34..b2a84e51595 100644 --- a/src/Components/Form/FormFields/TextFormField.tsx +++ b/src/Components/Form/FormFields/TextFormField.tsx @@ -100,7 +100,7 @@ const TextFormField = forwardRef((props: TextFormFieldProps, ref) => { ); const _trailing = trailing === trailingFocused ? ( -
+
{trailing}
) : ( diff --git a/src/Components/Patient/PatientRegister.tsx b/src/Components/Patient/PatientRegister.tsx index 3be6b985dda..dbc5b869e3e 100644 --- a/src/Components/Patient/PatientRegister.tsx +++ b/src/Components/Patient/PatientRegister.tsx @@ -1382,10 +1382,10 @@ export const PatientRegister = (props: PatientRegisterProps) => { {...field("age")} errorClassName="hidden" trailing={ -

-

+

+

{field("age").value !== "" && - "Year_of_Birth:"} + "Year of Birth:"}

{field("age").value !== "" && From 997a7147f329e33eb11ff77db0af59534c97f1cc Mon Sep 17 00:00:00 2001 From: Aryan <92309448+Aryanshu919@users.noreply.github.com> Date: Wed, 17 Apr 2024 15:28:14 +0530 Subject: [PATCH 07/11] Fix: HL7 Vital Monitor error message is clipping out #7534 (#7550) --- src/Components/VitalsMonitor/HL7PatientVitalsMonitor.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Components/VitalsMonitor/HL7PatientVitalsMonitor.tsx b/src/Components/VitalsMonitor/HL7PatientVitalsMonitor.tsx index 0d5a137becc..61c62f80c70 100644 --- a/src/Components/VitalsMonitor/HL7PatientVitalsMonitor.tsx +++ b/src/Components/VitalsMonitor/HL7PatientVitalsMonitor.tsx @@ -151,9 +151,11 @@ export default function HL7PatientVitalsMonitor(props: IVitalsComponentProps) { > - No incoming data from HL7 Monitor + + No incoming data from HL7 Monitor +
Date: Thu, 18 Apr 2024 15:22:19 +0530 Subject: [PATCH 08/11] fix loading (#7643) --- src/Components/Patient/SampleDetails.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Components/Patient/SampleDetails.tsx b/src/Components/Patient/SampleDetails.tsx index f66805a3ded..a3d3df95c21 100644 --- a/src/Components/Patient/SampleDetails.tsx +++ b/src/Components/Patient/SampleDetails.tsx @@ -265,7 +265,7 @@ export const SampleDetails = ({ id }: DetailRoute) => { ); }; - if (isLoading) { + if (isLoading || !sampleDetails) { return ; } From c331b845a57b64b1466ea327ae712e625300e20f Mon Sep 17 00:00:00 2001 From: Pranshu Aggarwal <70687348+Pranshu1902@users.noreply.github.com> Date: Thu, 18 Apr 2024 15:33:39 +0530 Subject: [PATCH 09/11] Add option to mark notification as unread (#7553) * add option to mark notification as unread * Update src/Locale/en/Notifications.json Co-authored-by: Mohammed Nihal <57055998+nihal467@users.noreply.github.com> * fix lint errrors * fix lint with updated prettier --------- Co-authored-by: Mohammed Nihal <57055998+nihal467@users.noreply.github.com> --- .../Notifications/NotificationsList.tsx | 33 +++++++++++++++---- src/Locale/en/Notifications.json | 1 + src/Redux/api.tsx | 5 +++ 3 files changed, 32 insertions(+), 7 deletions(-) diff --git a/src/Components/Notifications/NotificationsList.tsx b/src/Components/Notifications/NotificationsList.tsx index 02cb1f4fa8b..c9e6720e6ad 100644 --- a/src/Components/Notifications/NotificationsList.tsx +++ b/src/Components/Notifications/NotificationsList.tsx @@ -46,6 +46,16 @@ const NotificationTile = ({ setIsMarkingAsRead(false); }; + const handleMarkAsUnRead = async () => { + setIsMarkingAsRead(true); + await request(routes.markNotificationAsUnRead, { + pathParams: { id: result.id }, + body: { read_at: null }, + }); + setResult({ ...result, read_at: null }); + setIsMarkingAsRead(false); + }; + const resultUrl = (event: string, data: any) => { switch (event) { case "PATIENT_CREATED": @@ -107,24 +117,33 @@ const NotificationTile = ({
{ event.stopPropagation(); - handleMarkAsRead(); + if (result.read_at) { + handleMarkAsUnRead(); + } else { + handleMarkAsRead(); + } }} > - {t("mark_as_read")} + + {result.read_at ? t("mark_as_unread") : t("mark_as_read")} + (), }, + markNotificationAsUnRead: { + path: "/api/v1/notification/{id}/", + method: "PATCH", + TRes: Type(), + }, getPublicKey: { path: "/api/v1/notification/public_key/", method: "GET", From 48db450d15e66789d0e8a33f02d3e4c0c359bc93 Mon Sep 17 00:00:00 2001 From: Khavin Shankar Date: Thu, 18 Apr 2024 16:22:26 +0530 Subject: [PATCH 10/11] added support for various abha qr in scan and pull (#7565) --- src/Components/ABDM/LinkABHANumberModal.tsx | 4 ++-- src/Components/ABDM/models.ts | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/Components/ABDM/LinkABHANumberModal.tsx b/src/Components/ABDM/LinkABHANumberModal.tsx index fe789e6c909..d7dfc9f60c1 100644 --- a/src/Components/ABDM/LinkABHANumberModal.tsx +++ b/src/Components/ABDM/LinkABHANumberModal.tsx @@ -194,12 +194,12 @@ const ScanABHAQRSection = ({ body: { patientId, hidn: abha?.hidn, - phr: abha?.hid, + phr: (abha?.phr ?? abha?.hid) as string, name: abha?.name, gender: abha?.gender, dob: abha?.dob.replace(/\//g, "-"), address: abha?.address, - "dist name": abha?.district_name, + "dist name": abha?.["dist name"] ?? abha?.district_name, "state name": abha?.["state name"], }, }); diff --git a/src/Components/ABDM/models.ts b/src/Components/ABDM/models.ts index 957dc9c2d17..9dc362f5cac 100644 --- a/src/Components/ABDM/models.ts +++ b/src/Components/ABDM/models.ts @@ -123,10 +123,12 @@ export interface ILinkViaQRBody { export interface ABHAQRContent { address: string; distlgd: string; - district_name: string; + district_name?: string; dob: string; - gender: "M"; - hid: string; + gender: "M" | "F" | "O"; + hid?: string; + phr?: string; + "dist name"?: string; hidn: string; mobile: string; name: string; From 78bdc551587c095dabed92b07a115c07f7f41331 Mon Sep 17 00:00:00 2001 From: Mohammed Nihal <57055998+nihal467@users.noreply.github.com> Date: Thu, 18 Apr 2024 17:57:13 +0530 Subject: [PATCH 11/11] flaky test (#7657) --- cypress/e2e/assets_spec/assets_creation.cy.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/cypress/e2e/assets_spec/assets_creation.cy.ts b/cypress/e2e/assets_spec/assets_creation.cy.ts index f8edc2bb172..cd3489a14d8 100644 --- a/cypress/e2e/assets_spec/assets_creation.cy.ts +++ b/cypress/e2e/assets_spec/assets_creation.cy.ts @@ -160,12 +160,10 @@ describe("Asset", () => { assetPage.interceptAssetCreation(); assetPage.clickCreateAsset(); assetPage.verifyAssetCreation(); - assetSearchPage.typeSearchKeyword("New Test Asset Vital"); assetSearchPage.pressEnter(); - assetPage.openCreatedAsset(); - assetPage.configureVitalAsset("Host name", "192.168.1.64"); + assetPage.configureVitalAsset("Host name", "192.168.1.20"); assetPage.clickConfigureVital(); });