From dabf8cce27e7b21b24dea0aea9bdcbe04314c20b Mon Sep 17 00:00:00 2001 From: Gigin George Date: Mon, 5 Aug 2024 07:16:27 +0530 Subject: [PATCH 01/10] Update stale, to ignore backlog Issues & PRs (#8249) --- .github/workflows/stale.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 8964b0c8e57..736ce33d87d 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -16,8 +16,8 @@ jobs: stale-issue-message: "Hi, @coronasafe/care-frontend-maintainers, This issue has been automatically marked as stale because it has not had any recent activity." stale-pr-message: "Hi, This pr has been automatically marked as stale because it has not had any recent activity. It will be automatically closed if no further activity occurs for 7 more days. Thank you for your contributions." close-pr-message: "Hi, @coronasafe/care-frontend-maintainers, This PR has been automatically closed due to inactivity. Thank you for your contributions. Feel free to re-open the PR." - exempt-issue-labels: "blocked,waiting for related PR,waiting for back end,help wanted,work-in-progress,In Progress,wishlist,EPIC" - exempt-pr-labels: "tested,needs testing,need Review,waiting for related PR,waiting for back end,help wanted,blocked,work-in-progress,In Progress" + exempt-issue-labels: "blocked,waiting for related PR,waiting for back end,help wanted,work-in-progress,In Progress,wishlist,EPIC,backlog" + exempt-pr-labels: "tested,needs testing,need Review,waiting for related PR,waiting for back end,help wanted,blocked,work-in-progress,In Progress,backlog" days-before-issue-stale: 14 days-before-pr-stale: 7 days-before-issue-close: -1 From 8096a3c14f5955517f2dea956638baf811abe327 Mon Sep 17 00:00:00 2001 From: Kushal Bhana <68599557+kushalbhana@users.noreply.github.com> Date: Wed, 7 Aug 2024 12:02:09 +0530 Subject: [PATCH 02/10] scroll to mandatory empty fields (#8263) * scroll to mandatory empty fields * fixing the issue of auto scroll --- src/Components/Patient/DailyRounds.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Components/Patient/DailyRounds.tsx b/src/Components/Patient/DailyRounds.tsx index 321536e80f5..d451513c9bc 100644 --- a/src/Components/Patient/DailyRounds.tsx +++ b/src/Components/Patient/DailyRounds.tsx @@ -45,6 +45,7 @@ import { EncounterSymptomsBuilder } from "../Symptoms/SymptomsBuilder"; import { FieldLabel } from "../Form/FormFields/FormField"; import useAuthUser from "../../Common/hooks/useAuthUser"; import CheckBoxFormField from "../Form/FormFields/CheckBoxFormField"; +import { scrollTo } from "../../Utils/utils"; const Loading = lazy(() => import("../Common/Loading")); @@ -231,6 +232,7 @@ export const DailyRounds = (props: any) => { if (!state.form[field]) { errors[field] = "Please select a category"; invalidForm = true; + scrollTo("patientCategory"); } return; case "bp": { @@ -238,6 +240,7 @@ export const DailyRounds = (props: any) => { if (error) { errors.bp = error; invalidForm = true; + scrollTo("bloodPressure"); } return; } @@ -524,6 +527,7 @@ export const DailyRounds = (props: any) => { {...field("patient_category")} required label="Category" + id="patientCategory" /> @@ -589,7 +593,7 @@ export const DailyRounds = (props: any) => { <>

Vitals

- + Date: Wed, 7 Aug 2024 12:02:32 +0530 Subject: [PATCH 03/10] Fix: Added online status to Doctor Connect (#8261) * Added online status * Added utility fn --- src/Components/Facility/DoctorVideoSlideover.tsx | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/Components/Facility/DoctorVideoSlideover.tsx b/src/Components/Facility/DoctorVideoSlideover.tsx index aacf441be6f..53a197734dc 100644 --- a/src/Components/Facility/DoctorVideoSlideover.tsx +++ b/src/Components/Facility/DoctorVideoSlideover.tsx @@ -3,7 +3,7 @@ import SlideOver from "../../CAREUI/interactive/SlideOver"; import { UserAssignedModel } from "../Users/models"; import { SkillObjectModel } from "../Users/models"; import CareIcon, { IconName } from "../../CAREUI/icons/CareIcon"; -import { classNames, relativeTime } from "../../Utils/utils"; +import { classNames, isUserOnline, relativeTime } from "../../Utils/utils"; import useAuthUser from "../../Common/hooks/useAuthUser"; import { triggerGoal } from "../../Integrations/Plausible"; import { Warn } from "../../Utils/Notifications"; @@ -241,9 +241,14 @@ function UserListItem({ user }: { user: UserAnnotatedWithGroup }) {
{ // Show online icon based on last_login - user.last_login && - Number(new Date()) - Number(new Date(user.last_login)) < 60000 ? ( - + user.last_login && isUserOnline(user) ? ( + <> + + + ) : ( ) From a169f02e8e2bccfea9f70167aacb01f8d3242afa Mon Sep 17 00:00:00 2001 From: Rithvik Nishad Date: Wed, 7 Aug 2024 12:55:35 +0530 Subject: [PATCH 04/10] Camera Feed: Ensure camera moves everytime the preset is clicked (#8254) --- .../Facility/ConsultationDetails/ConsultationFeedTab.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Components/Facility/ConsultationDetails/ConsultationFeedTab.tsx b/src/Components/Facility/ConsultationDetails/ConsultationFeedTab.tsx index 34931b303f8..7b266e91639 100644 --- a/src/Components/Facility/ConsultationDetails/ConsultationFeedTab.tsx +++ b/src/Components/Facility/ConsultationDetails/ConsultationFeedTab.tsx @@ -167,7 +167,14 @@ export const ConsultationFeedTab = (props: ConsultationTabProps) => { result: "success", }); setHasMoved(false); - setPreset(value); + // Voluntarily copying to trigger change of reference of the position attribute, so that the useEffect of CameraFeed that handles the moves gets triggered. + setPreset({ + ...value, + meta: { + ...value.meta, + position: { ...value.meta.position }, + }, + }); }} /> {isUpdatingPreset ? ( From 4c882b41b1073b8c629eafae44b5db302d167bf9 Mon Sep 17 00:00:00 2001 From: Rithvik Nishad Date: Wed, 7 Aug 2024 12:55:58 +0530 Subject: [PATCH 05/10] Live Feed: Move to last accessed preset instead of last created (#8255) --- .../ConsultationFeedTab.tsx | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/Components/Facility/ConsultationDetails/ConsultationFeedTab.tsx b/src/Components/Facility/ConsultationDetails/ConsultationFeedTab.tsx index 7b266e91639..d8d4f8b3d28 100644 --- a/src/Components/Facility/ConsultationDetails/ConsultationFeedTab.tsx +++ b/src/Components/Facility/ConsultationDetails/ConsultationFeedTab.tsx @@ -59,12 +59,18 @@ export const ConsultationFeedTab = (props: ConsultationTabProps) => { return; } - const preset = data.results.find( + const presets = data.results.filter( (obj) => obj.asset_object.meta?.asset_type === "CAMERA" && obj.meta.type !== "boundary", ); + const lastPresetId = sessionStorage.getItem( + getFeedPresetKey(props.consultationId), + ); + const preset = + presets.find((obj) => obj.id === lastPresetId) ?? presets[0]; + if (preset) { setPreset(preset); setAsset(preset.asset_object); @@ -105,6 +111,13 @@ export const ConsultationFeedTab = (props: ConsultationTabProps) => { } }, [!!bed, loading, !!asset, divRef.current]); + useEffect(() => { + const feedPresetKey = getFeedPresetKey(props.consultationId); + if (preset) { + sessionStorage.setItem(feedPresetKey, preset.id); + } + }, [preset, props.consultationId]); + if (loading) { return ; } @@ -212,3 +225,7 @@ export const ConsultationFeedTab = (props: ConsultationTabProps) => { ); }; + +const getFeedPresetKey = (consultationId: string) => { + return `encounterFeedPreset[${consultationId}]`; +}; From eb5e6ebfe32887e04d42f1ac1fef2293bbc3694a Mon Sep 17 00:00:00 2001 From: Harsh Renose <70405311+renoseHarsh@users.noreply.github.com> Date: Wed, 7 Aug 2024 12:57:08 +0530 Subject: [PATCH 06/10] Increased Form Size & Updated Indicator Field (#8244) --- src/Components/Medicine/ManagePrescriptions.tsx | 2 +- src/Components/Medicine/PrescriptionDetailCard.tsx | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Components/Medicine/ManagePrescriptions.tsx b/src/Components/Medicine/ManagePrescriptions.tsx index fd335ce19fb..a5ae50813a2 100644 --- a/src/Components/Medicine/ManagePrescriptions.tsx +++ b/src/Components/Medicine/ManagePrescriptions.tsx @@ -12,7 +12,7 @@ export default function ManagePrescriptions() { return (
diff --git a/src/Components/Medicine/PrescriptionDetailCard.tsx b/src/Components/Medicine/PrescriptionDetailCard.tsx index 0bc75d66a72..83e320730a4 100644 --- a/src/Components/Medicine/PrescriptionDetailCard.tsx +++ b/src/Components/Medicine/PrescriptionDetailCard.tsx @@ -178,19 +178,19 @@ export default function PrescriptionDetailCard({ {prescription.dosage_type === "PRN" ? ( <> {prescription.indicator} {prescription.max_dosage} {prescription.min_hours_between_doses && From 91ef1cf112aba379fb4eb86f09ef8f9919a0d799 Mon Sep 17 00:00:00 2001 From: Vishvam Moliya <96417040+thevishvammoliya@users.noreply.github.com> Date: Wed, 7 Aug 2024 12:57:34 +0530 Subject: [PATCH 07/10] =?UTF-8?q?Fixed:=20Misalignment=20of=20placeholder?= =?UTF-8?q?=20text=20inside=20date=20component=20in=20the=20=E2=80=A6=20(#?= =?UTF-8?q?8240)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fixed: Misalignment of placeholder text inside date component in the add user page #8239 * Update src/Components/Common/DateInputV2.tsx Co-authored-by: Rithvik Nishad --------- Co-authored-by: Rithvik Nishad --- src/Components/Common/DateInputV2.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Components/Common/DateInputV2.tsx b/src/Components/Common/DateInputV2.tsx index 9bb10b1951b..2e9f99de9bc 100644 --- a/src/Components/Common/DateInputV2.tsx +++ b/src/Components/Common/DateInputV2.tsx @@ -256,7 +256,7 @@ const DateInputV2: React.FC = ({ type="text" readOnly disabled={disabled} - className={`cui-input-base cursor-pointer !px-2 disabled:cursor-not-allowed ${className}`} + className={`cui-input-base cursor-pointer disabled:cursor-not-allowed ${className}`} placeholder={placeholder ?? t("select_date")} value={value && dayjs(value).format("DD/MM/YYYY")} /> From 203afd204a473c389c6b4d2d26b8e88600abc5e2 Mon Sep 17 00:00:00 2001 From: Harsh Renose <70405311+renoseHarsh@users.noreply.github.com> Date: Wed, 7 Aug 2024 12:57:57 +0530 Subject: [PATCH 08/10] Fixed: Transfer patient pop-up behavior (#8245) * Updated Pop Close * Updaed Pop-up Close for Transfer --- .../Facility/DuplicatePatientDialog.tsx | 5 ++-- src/Components/Patient/PatientRegister.tsx | 24 +++++++++++++++---- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/src/Components/Facility/DuplicatePatientDialog.tsx b/src/Components/Facility/DuplicatePatientDialog.tsx index 7450d9fd8f1..b948ad91fa3 100644 --- a/src/Components/Facility/DuplicatePatientDialog.tsx +++ b/src/Components/Facility/DuplicatePatientDialog.tsx @@ -7,13 +7,12 @@ interface Props { patientList: Array; handleOk: (action: string) => void; handleCancel: () => void; - isNew: boolean; } const tdClass = "border border-secondary-400 p-2 text-left"; const DuplicatePatientDialog = (props: Props) => { - const { patientList, handleOk, handleCancel, isNew } = props; + const { patientList, handleOk, handleCancel } = props; const [action, setAction] = useState(""); return ( @@ -118,7 +117,7 @@ const DuplicatePatientDialog = (props: Props) => { { }); const [careExtId, setCareExtId] = useState(""); const [formField, setFormField] = useState(); + const [resetNum, setResetNum] = useState(false); const [isDistrictLoading, setIsDistrictLoading] = useState(false); const [isLocalbodyLoading, setIsLocalbodyLoading] = useState(false); const [isWardLoading, setIsWardLoading] = useState(false); @@ -1003,21 +1004,29 @@ export const PatientRegister = (props: PatientRegisterProps) => { { + handleDialogClose("close"); + setResetNum(true); + }} /> )} {statusDialog.transfer && ( handleDialogClose("back")} + onClose={() => { + setResetNum(true); + handleDialogClose("close"); + }} title="Patient Transfer Form" className="max-w-md md:min-w-[600px]" > handleDialogClose("close")} - handleCancel={() => handleDialogClose("back")} + handleCancel={() => { + setResetNum(true); + handleDialogClose("close"); + }} facilityId={facilityId} /> @@ -1134,6 +1143,13 @@ export const PatientRegister = (props: PatientRegisterProps) => { > {(field) => { if (!formField) setFormField(field); + if (resetNum) { + field("phone_number").onChange({ + name: "phone_number", + value: "+91", + }); + setResetNum(false); + } return ( <>
From f3dd93dab3a65765c3cd1868f3cc900af5ab3874 Mon Sep 17 00:00:00 2001 From: Shivank Kacker Date: Wed, 7 Aug 2024 12:58:09 +0530 Subject: [PATCH 09/10] Show weight and height as unspecified rather than 0 (#8248) --- .../ConsultationUpdatesTab.tsx | 29 +++++++++++++------ src/Components/Facility/ConsultationForm.tsx | 22 +++++++++----- 2 files changed, 34 insertions(+), 17 deletions(-) diff --git a/src/Components/Facility/ConsultationDetails/ConsultationUpdatesTab.tsx b/src/Components/Facility/ConsultationDetails/ConsultationUpdatesTab.tsx index 22194b410b7..d00b77d9bca 100644 --- a/src/Components/Facility/ConsultationDetails/ConsultationUpdatesTab.tsx +++ b/src/Components/Facility/ConsultationDetails/ConsultationUpdatesTab.tsx @@ -555,24 +555,35 @@ export const ConsultationUpdatesTab = (props: ConsultationTabProps) => {
Weight {" - "} - {props.consultationData.weight ?? "-"} Kg + {props.consultationData.weight + ? `${props.consultationData.weight} kg` + : "Unspecified"}
Height {" - "} - {props.consultationData.height ?? "-"} cm + {props.consultationData.height + ? `${props.consultationData.height} cm` + : "Unspecified"}
Body Surface Area {" - "} - - {Math.sqrt( - (Number(props.consultationData.weight) * - Number(props.consultationData.height)) / - 3600, - ).toFixed(2)}{" "} - m2 + + {props.consultationData.weight && + props.consultationData.height ? ( + <> + {Math.sqrt( + (Number(props.consultationData.weight) * + Number(props.consultationData.height)) / + 3600, + ).toFixed(2)} + m2 + + ) : ( + "Unspecified" + )}
diff --git a/src/Components/Facility/ConsultationForm.tsx b/src/Components/Facility/ConsultationForm.tsx index dc496d599f7..40d9741d712 100644 --- a/src/Components/Facility/ConsultationForm.tsx +++ b/src/Components/Facility/ConsultationForm.tsx @@ -386,8 +386,8 @@ export const ConsultationForm = ({ facilityId, patientId, id }: Props) => { admitted: data.admitted ? String(data.admitted) : "false", admitted_to: data.admitted_to ? data.admitted_to : "", category: data.category - ? (PATIENT_CATEGORIES.find((i) => i.text === data.category)?.id ?? - "") + ? PATIENT_CATEGORIES.find((i) => i.text === data.category)?.id ?? + "" : "", patient_no: data.patient_no ?? "", OPconsultation: data.consultation_notes, @@ -1084,12 +1084,18 @@ export const ConsultationForm = ({ facilityId, patientId, id }: Props) => {
Body Surface Area - {Math.sqrt( - (Number(state.form.weight) * - Number(state.form.height)) / - 3600, - ).toFixed(2)} - m2 + {state.form.weight && state.form.height ? ( + <> + {Math.sqrt( + (Number(state.form.weight) * + Number(state.form.height)) / + 3600, + ).toFixed(2)} + m2 + + ) : ( + "Not specified" + )}
From caa411dcf93ee1ceb419ff7aa5b00183b07809e8 Mon Sep 17 00:00:00 2001 From: Rithvik Nishad Date: Wed, 7 Aug 2024 20:13:12 +0530 Subject: [PATCH 10/10] Cypress: fix incorrect patient category select's id (#8267) --- cypress/pageobject/Patient/PatientLogupdate.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/pageobject/Patient/PatientLogupdate.ts b/cypress/pageobject/Patient/PatientLogupdate.ts index bc141c04984..ac1bd6a4991 100644 --- a/cypress/pageobject/Patient/PatientLogupdate.ts +++ b/cypress/pageobject/Patient/PatientLogupdate.ts @@ -16,7 +16,7 @@ class PatientLogupdate { } selectPatientCategory(category: string) { - cy.clickAndSelectOption("#patient_category", category); + cy.clickAndSelectOption("#patientCategory", category); } typePhysicalExamination(examination: string) {