From c098db23b08710abadd97f1b1d65d04b558c1e60 Mon Sep 17 00:00:00 2001
From: Khavin Shankar
Date: Mon, 20 Jan 2025 09:04:43 +0530
Subject: [PATCH 1/4] added facility home actions plugin hook (#10058)
---
src/components/Facility/FacilityHome.tsx | 5 +++++
src/pluginTypes.ts | 7 +++++++
2 files changed, 12 insertions(+)
diff --git a/src/components/Facility/FacilityHome.tsx b/src/components/Facility/FacilityHome.tsx
index 3f985baf5dc..5173d6c1a27 100644
--- a/src/components/Facility/FacilityHome.tsx
+++ b/src/components/Facility/FacilityHome.tsx
@@ -25,6 +25,7 @@ import Loading from "@/components/Common/Loading";
import { FACILITY_FEATURE_TYPES } from "@/common/constants";
+import { PLUGIN_Component } from "@/PluginEngine";
import routes from "@/Utils/request/api";
import query from "@/Utils/request/query";
import request from "@/Utils/request/request";
@@ -267,6 +268,10 @@ export const FacilityHome = ({ facilityId }: Props) => {
{t("delete_facility")}
)} */}
+
diff --git a/src/pluginTypes.ts b/src/pluginTypes.ts
index 59d1d6f314d..36d2bbb0467 100644
--- a/src/pluginTypes.ts
+++ b/src/pluginTypes.ts
@@ -10,6 +10,7 @@ import { Patient } from "@/types/emr/newPatient";
import { AppRoutes } from "./Routers/AppRouter";
import { QuestionnaireFormState } from "./components/Questionnaire/QuestionnaireForm";
import { pluginMap } from "./pluginMap";
+import { FacilityData } from "./types/facility/facility";
export type DoctorConnectButtonComponentType = React.FC<{
user: UserAssignedModel;
@@ -30,6 +31,11 @@ export type PatientInfoCardActionsComponentType = React.FC<{
className?: string;
}>;
+export type FacilityHomeActionsComponentType = React.FC<{
+ facility: FacilityData;
+ className?: string;
+}>;
+
export type PatientRegistrationFormComponentType = React.FC<{
form: UseFormReturn; // eslint-disable-line @typescript-eslint/no-explicit-any
patientId?: string;
@@ -41,6 +47,7 @@ export type SupportedPluginComponents = {
Scribe: ScribeComponentType;
PatientHomeActions: PatientHomeActionsComponentType;
PatientInfoCardActions: PatientInfoCardActionsComponentType;
+ FacilityHomeActions: FacilityHomeActionsComponentType;
PatientRegistrationForm: PatientRegistrationFormComponentType;
};
From e83dbc46f75ec8fc84de3206a71b2ad4d3f0f892 Mon Sep 17 00:00:00 2001
From: Kamishetty Rishith <119791436+Rishith25@users.noreply.github.com>
Date: Mon, 20 Jan 2025 11:11:46 +0530
Subject: [PATCH 2/4] DOB Values Limit in patient registration form (#9735)
---
src/components/Patient/PatientRegistration.tsx | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/src/components/Patient/PatientRegistration.tsx b/src/components/Patient/PatientRegistration.tsx
index 43151e7e366..c2176851242 100644
--- a/src/components/Patient/PatientRegistration.tsx
+++ b/src/components/Patient/PatientRegistration.tsx
@@ -48,6 +48,7 @@ import {
import countryList from "@/common/static/countries.json";
import { PLUGIN_Component } from "@/PluginEngine";
+import dayjs from "@/Utils/dayjs";
import routes from "@/Utils/request/api";
import mutate from "@/Utils/request/mutate";
import query from "@/Utils/request/query";
@@ -104,6 +105,10 @@ export default function PatientRegistration(
date_of_birth: z
.string()
.regex(/^\d{4}-\d{2}-\d{2}$/, t("date_of_birth_format"))
+ .refine((date) => {
+ const parsedDate = dayjs(date);
+ return parsedDate.isValid() && !parsedDate.isAfter(dayjs());
+ }, t("enter_valid_dob"))
.optional(),
age: z
.number()
@@ -520,6 +525,8 @@ export default function PatientRegistration(
type="number"
placeholder="DD"
{...field}
+ min={1}
+ max={31}
value={
form.watch("date_of_birth")?.split("-")[2]
}
@@ -554,6 +561,8 @@ export default function PatientRegistration(
value={
form.watch("date_of_birth")?.split("-")[1]
}
+ min={1}
+ max={12}
onChange={(e) => {
form.setValue(
"date_of_birth",
@@ -585,6 +594,8 @@ export default function PatientRegistration(
value={
form.watch("date_of_birth")?.split("-")[0]
}
+ min={1900}
+ max={new Date().getFullYear()}
onChange={(e) =>
form.setValue(
"date_of_birth",
From 2ac78dd76546b621b9221e8c04a97b06baf894cd Mon Sep 17 00:00:00 2001
From: Abhimanyu Rajeesh <63541653+abhimanyurajeesh@users.noreply.github.com>
Date: Mon, 20 Jan 2025 11:37:14 +0530
Subject: [PATCH 3/4] FIX: Facility Issues: Cover Not Functioning Properly and
Minor Suggestions for the Facility Page (#10021)
---
public/locale/en.json | 6 +++---
public/locale/hi.json | 3 ---
public/locale/kn.json | 3 ---
public/locale/ml.json | 3 ---
public/locale/ta.json | 3 ---
src/components/Common/AvatarEditModal.tsx | 16 ++++++++++------
src/components/Facility/FacilityHome.tsx | 16 +++++++++++++---
7 files changed, 26 insertions(+), 24 deletions(-)
diff --git a/public/locale/en.json b/public/locale/en.json
index 10486c83b99..1390570659a 100644
--- a/public/locale/en.json
+++ b/public/locale/en.json
@@ -380,7 +380,7 @@
"allergen": "Allergen",
"allergies": "Allergies",
"allow_transfer": "Allow Transfer",
- "allowed_formats_are": "Allowed formats are",
+ "allowed_formats_are": "Allowed formats are {{formats}}.",
"already_a_member": "Already a member?",
"alternate_phone_number": "Alternate Phone Number",
"ambulance_driver_name": "Name of ambulance driver",
@@ -1293,7 +1293,7 @@
"markdown_supported": "You can use markdown to format your facility description",
"max_dosage_24_hrs": "Max. dosage in 24 hrs.",
"max_dosage_in_24hrs_gte_base_dosage_error": "Max. dosage in 24 hours must be greater than or equal to base dosage",
- "max_size_for_image_uploaded_should_be": "Max size for image uploaded should be",
+ "max_size_for_image_uploaded_should_be": "Max size for image uploaded should be {{maxSize}}.",
"measured_after": "Measured after",
"measured_before": "Measured before",
"medical": "Medical",
@@ -1691,7 +1691,7 @@
"reason_for_shift": "Reason for shift",
"reason_for_visit": "Reason for visit",
"reason_for_visit_placeholder": "Type the reason for booking appointment",
- "recommended_aspect_ratio_for": "Recommended aspect ratio for",
+ "recommended_aspect_ratio_for": "Recommended aspect ratio for the image is {{aspectRatio}}.",
"record": "Record Audio",
"record_delete_confirm": "Are you sure you want to delete this record?",
"record_has_been_deleted_successfully": "Record has been deleted successfully.",
diff --git a/public/locale/hi.json b/public/locale/hi.json
index af909237150..70704e2cee6 100644
--- a/public/locale/hi.json
+++ b/public/locale/hi.json
@@ -144,7 +144,6 @@
"all_changes_have_been_saved": "सभी परिवर्तन सहेज लिए गए हैं",
"all_details": "सभी विवरण",
"allergies": "एलर्जी",
- "allowed_formats_are": "स्वीकृत प्रारूप हैं",
"already_a_member": "क्या पहले से ही सदस्य हैं?",
"ambulance_driver_name": "एम्बुलेंस चालक का नाम",
"ambulance_number": "एम्बुलेंस नं.",
@@ -475,7 +474,6 @@
"mark_transfer_complete_confirmation": "क्या आप वाकई इस स्थानांतरण को पूर्ण के रूप में चिह्नित करना चाहते हैं? ओरिजिन सुविधा अब इस रोगी तक पहुँच नहीं पाएगी",
"max_dosage_24_hrs": "अधिकतम खुराक 24 घंटे में.",
"max_dosage_in_24hrs_gte_base_dosage_error": "24 घंटे में अधिकतम खुराक आधार खुराक से अधिक या उसके बराबर होनी चाहिए",
- "max_size_for_image_uploaded_should_be": "अपलोड की गई छवि का अधिकतम आकार होना चाहिए",
"medical_worker": "चिकित्साकर्मी",
"medicine": "दवा",
"medicine_administration_history": "औषधि प्रशासन इतिहास",
@@ -621,7 +619,6 @@
"reason_for_edit": "संपादन का कारण",
"reason_for_referral": "निर्दिष्ट करने की वजह",
"reason_for_shift": "बदलाव का कारण",
- "recommended_aspect_ratio_for": "इसके लिए अनुशंसित पहलू अनुपात",
"record": "ऑडियो रिकॉर्ड करें",
"record_delete_confirm": "क्या आप वाकई इस रिकॉर्ड को हटाना चाहते हैं?",
"record_has_been_deleted_successfully": "रिकार्ड सफलतापूर्वक हटा दिया गया है.",
diff --git a/public/locale/kn.json b/public/locale/kn.json
index c605b382597..0ef06eea43c 100644
--- a/public/locale/kn.json
+++ b/public/locale/kn.json
@@ -146,7 +146,6 @@
"all_changes_have_been_saved": "ಎಲ್ಲಾ ಬದಲಾವಣೆಗಳನ್ನು ಉಳಿಸಲಾಗಿದೆ",
"all_details": "ಎಲ್ಲಾ ವಿವರಗಳು",
"allergies": "ಅಲರ್ಜಿಗಳು",
- "allowed_formats_are": "ಅನುಮತಿಸಲಾದ ಸ್ವರೂಪಗಳು",
"already_a_member": "ಈಗಾಗಲೇ ಸದಸ್ಯರೇ?",
"ambulance_driver_name": "ಆಂಬ್ಯುಲೆನ್ಸ್ ಚಾಲಕನ ಹೆಸರು",
"ambulance_number": "ಆಂಬ್ಯುಲೆನ್ಸ್ ನಂ",
@@ -477,7 +476,6 @@
"mark_transfer_complete_confirmation": "ಈ ವರ್ಗಾವಣೆ ಪೂರ್ಣಗೊಂಡಿದೆ ಎಂದು ಗುರುತಿಸಲು ನೀವು ಖಚಿತವಾಗಿ ಬಯಸುವಿರಾ? ಮೂಲ ಸೌಲಭ್ಯವು ಇನ್ನು ಮುಂದೆ ಈ ರೋಗಿಗೆ ಪ್ರವೇಶವನ್ನು ಹೊಂದಿರುವುದಿಲ್ಲ",
"max_dosage_24_hrs": "ಗರಿಷ್ಠ 24 ಗಂಟೆಗಳಲ್ಲಿ ಡೋಸೇಜ್",
"max_dosage_in_24hrs_gte_base_dosage_error": "ಗರಿಷ್ಠ 24 ಗಂಟೆಗಳಲ್ಲಿ ಡೋಸೇಜ್ ಬೇಸ್ ಡೋಸೇಜ್ಗಿಂತ ಹೆಚ್ಚಾಗಿರಬೇಕು ಅಥವಾ ಸಮನಾಗಿರಬೇಕು",
- "max_size_for_image_uploaded_should_be": "ಅಪ್ಲೋಡ್ ಮಾಡಿದ ಚಿತ್ರಕ್ಕೆ ಗರಿಷ್ಠ ಗಾತ್ರ ಇರಬೇಕು",
"medical_worker": "ವೈದ್ಯಕೀಯ ಕೆಲಸಗಾರ",
"medicine": "ಔಷಧಿ",
"medicine_administration_history": "ಮೆಡಿಸಿನ್ ಅಡ್ಮಿನಿಸ್ಟ್ರೇಷನ್ ಇತಿಹಾಸ",
@@ -623,7 +621,6 @@
"reason_for_edit": "ಸಂಪಾದನೆಗೆ ಕಾರಣ",
"reason_for_referral": "ಉಲ್ಲೇಖಕ್ಕೆ ಕಾರಣ",
"reason_for_shift": "ಸ್ಥಳಾಂತರಕ್ಕೆ ಕಾರಣ",
- "recommended_aspect_ratio_for": "ಇದಕ್ಕಾಗಿ ಶಿಫಾರಸು ಮಾಡಲಾದ ಆಕಾರ ಅನುಪಾತ",
"record": "ರೆಕಾರ್ಡ್ ಆಡಿಯೋ",
"record_delete_confirm": "ಈ ದಾಖಲೆಯನ್ನು ಅಳಿಸಲು ನೀವು ಖಚಿತವಾಗಿ ಬಯಸುವಿರಾ?",
"record_has_been_deleted_successfully": "ದಾಖಲೆಯನ್ನು ಯಶಸ್ವಿಯಾಗಿ ಅಳಿಸಲಾಗಿದೆ.",
diff --git a/public/locale/ml.json b/public/locale/ml.json
index 377262f180f..189017c78a3 100644
--- a/public/locale/ml.json
+++ b/public/locale/ml.json
@@ -362,7 +362,6 @@
"allergen": "അലർജി",
"allergies": "അലർജികൾ",
"allow_transfer": "കൈമാറ്റം അനുവദിക്കുക",
- "allowed_formats_are": "അനുവദനീയമായ ഫോർമാറ്റുകളാണ്",
"already_a_member": "ഇതിനകം തന്നെ ഒരു അംഗമാണോ?",
"alternate_phone_number": "ഇതര ഫോൺ നമ്പർ",
"ambulance_driver_name": "ആംബുലൻസ് ഡ്രൈവറുടെ പേര്",
@@ -1185,7 +1184,6 @@
"markdown_supported": "നിങ്ങളുടെ സൗകര്യ വിവരണം ഫോർമാറ്റ് ചെയ്യാൻ നിങ്ങൾക്ക് മാർക്ക്ഡൗൺ ഉപയോഗിക്കാം",
"max_dosage_24_hrs": "പരമാവധി. 24 മണിക്കൂറിനുള്ളിൽ ഡോസ്.",
"max_dosage_in_24hrs_gte_base_dosage_error": "പരമാവധി. 24 മണിക്കൂറിനുള്ളിലെ ഡോസ് അടിസ്ഥാന ഡോസേജിനേക്കാൾ കൂടുതലോ തുല്യമോ ആയിരിക്കണം",
- "max_size_for_image_uploaded_should_be": "അപ്ലോഡ് ചെയ്ത ചിത്രത്തിനുള്ള പരമാവധി വലുപ്പം ആയിരിക്കണം",
"measured_after": "ശേഷം അളന്നു",
"measured_before": "മുമ്പ് അളന്നു",
"medical": "മെഡിക്കൽ",
@@ -1529,7 +1527,6 @@
"reason_for_shift": "ഷിഫ്റ്റിനുള്ള കാരണം",
"reason_for_visit": "സന്ദർശനത്തിനുള്ള കാരണം",
"reason_for_visit_placeholder": "അപ്പോയിൻ്റ്മെൻ്റ് ബുക്ക് ചെയ്യാനുള്ള കാരണം ടൈപ്പ് ചെയ്യുക",
- "recommended_aspect_ratio_for": "ഇതിനായി ശുപാർശ ചെയ്യുന്ന വീക്ഷണ അനുപാതം",
"record": "റെക്കോർഡ് ഓഡിയോ",
"record_delete_confirm": "ഈ റെക്കോർഡ് ഇല്ലാതാക്കണമെന്ന് തീർച്ചയാണോ?",
"record_has_been_deleted_successfully": "റെക്കോർഡ് വിജയകരമായി ഇല്ലാതാക്കി.",
diff --git a/public/locale/ta.json b/public/locale/ta.json
index cead86d1e54..cfe2c19b91e 100644
--- a/public/locale/ta.json
+++ b/public/locale/ta.json
@@ -145,7 +145,6 @@
"all_changes_have_been_saved": "அனைத்து மாற்றங்களும் சேமிக்கப்பட்டன",
"all_details": "அனைத்து விவரங்களும்",
"allergies": "ஒவ்வாமை",
- "allowed_formats_are": "அனுமதிக்கப்பட்ட வடிவங்கள்",
"already_a_member": "ஏற்கனவே உறுப்பினரா?",
"ambulance_driver_name": "ஆம்புலன்ஸ் ஓட்டுநரின் பெயர்",
"ambulance_number": "ஆம்புலன்ஸ் எண்",
@@ -476,7 +475,6 @@
"mark_transfer_complete_confirmation": "இந்தப் பரிமாற்றம் முடிந்ததாக நிச்சயமாகக் குறிக்க விரும்புகிறீர்களா? இந்த நோயாளியை ஆரிஜின் வசதி இனி அணுகாது",
"max_dosage_24_hrs": "அதிகபட்சம். 24 மணி நேரத்தில் மருந்தளவு",
"max_dosage_in_24hrs_gte_base_dosage_error": "அதிகபட்சம். 24 மணிநேரத்தில் மருந்தளவு அடிப்படை அளவை விட அதிகமாகவோ அல்லது சமமாகவோ இருக்க வேண்டும்",
- "max_size_for_image_uploaded_should_be": "பதிவேற்றப்பட்ட படத்திற்கான அதிகபட்ச அளவு இருக்க வேண்டும்",
"medical_worker": "மருத்துவ பணியாளர்",
"medicine": "மருந்து",
"medicine_administration_history": "மருத்துவ நிர்வாக வரலாறு",
@@ -621,7 +619,6 @@
"reason_for_edit": "திருத்தத்திற்கான காரணம்",
"reason_for_referral": "பரிந்துரைக்கான காரணம்",
"reason_for_shift": "மாற்றத்திற்கான காரணம்",
- "recommended_aspect_ratio_for": "பரிந்துரைக்கப்பட்ட தோற்ற விகிதம்",
"record": "ஆடியோ பதிவு",
"record_delete_confirm": "இந்தப் பதிவை நிச்சயமாக நீக்க விரும்புகிறீர்களா?",
"record_has_been_deleted_successfully": "பதிவு வெற்றிகரமாக நீக்கப்பட்டது.",
diff --git a/src/components/Common/AvatarEditModal.tsx b/src/components/Common/AvatarEditModal.tsx
index d5044c66533..09b37df17db 100644
--- a/src/components/Common/AvatarEditModal.tsx
+++ b/src/components/Common/AvatarEditModal.tsx
@@ -24,6 +24,7 @@ interface Props {
handleUpload: (file: File, onError: () => void) => Promise;
handleDelete: (onError: () => void) => Promise;
onClose?: () => void;
+ hint?: React.ReactNode;
}
const VideoConstraints = {
@@ -51,6 +52,7 @@ const AvatarEditModal = ({
handleUpload,
handleDelete,
onClose,
+ hint,
}: Props) => {
const [isProcessing, setIsProcessing] = useState(false);
const [selectedFile, setSelectedFile] = useState();
@@ -165,15 +167,17 @@ const AvatarEditModal = ({
setIsDragging(false);
};
- const commonHint = (
+ const defaultHint = (
<>
- {t("max_size_for_image_uploaded_should_be")} 1mb.
+ {t("max_size_for_image_uploaded_should_be", { maxSize: "1MB" })}
- {t("allowed_formats_are")} jpg,png,jpeg.{" "}
- {t("recommended_aspect_ratio_for")} the image is 1:1
+ {t("allowed_formats_are", { formats: "jpg, png, jpeg" })}{" "}
+ {t("recommended_aspect_ratio_for", { aspectRatio: "1:1" })}
>
);
+ const hintMessage = hint || defaultHint;
+
return (
- {commonHint}
+ {hintMessage}
>
) : (
@@ -246,7 +250,7 @@ const AvatarEditModal = ({
: `${t("drag_drop_image_to_upload")}`}
- {t("no_image_found")}. {commonHint}
+ {t("no_image_found")}. {hintMessage}
)}
diff --git a/src/components/Facility/FacilityHome.tsx b/src/components/Facility/FacilityHome.tsx
index 5173d6c1a27..672ec1a99c1 100644
--- a/src/components/Facility/FacilityHome.tsx
+++ b/src/components/Facility/FacilityHome.tsx
@@ -167,6 +167,15 @@ export const FacilityHome = ({ facilityId }: Props) => {
const hasPermissionToEditCoverImage = true;
+ const coverImageHint = (
+ <>
+ {t("max_size_for_image_uploaded_should_be", { maxSize: "1MB" })}
+
+ {t("allowed_formats_are", { formats: "jpg, png, jpeg" })}{" "}
+ {t("recommended_aspect_ratio_for", { aspectRatio: "16:9" })}
+ >
+ );
+
return (
{
handleUpload={handleCoverImageUpload}
handleDelete={handleCoverImageDelete}
onClose={() => setEditCoverImage(false)}
+ hint={coverImageHint}
/>
@@ -196,12 +206,12 @@ export const FacilityHome = ({ facilityId }: Props) => {
{facilityData?.read_cover_image_url ? (
<>
-

+
>
) : (
@@ -228,7 +238,7 @@ export const FacilityHome = ({ facilityId }: Props) => {
@@ -284,7 +294,7 @@ export const FacilityHome = ({ facilityId }: Props) => {
-
+
{facilityData?.geo_organization && (
From e5f2ce714dcc03351e3ca7651b93b2ade32c00fe Mon Sep 17 00:00:00 2001
From: Rithvik Nishad
Date: Mon, 20 Jan 2025 06:12:49 +0000
Subject: [PATCH 4/4] Hide reschedule button for public appointments (#9990)
---
.../Patient/components/AppointmentDialog.tsx | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/src/pages/Patient/components/AppointmentDialog.tsx b/src/pages/Patient/components/AppointmentDialog.tsx
index 1c3e432c4a9..a3b6014acff 100644
--- a/src/pages/Patient/components/AppointmentDialog.tsx
+++ b/src/pages/Patient/components/AppointmentDialog.tsx
@@ -20,7 +20,12 @@ import { formatAppointmentSlotTime } from "@/pages/Appointments/utils";
import PublicAppointmentApi from "@/types/scheduling/PublicAppointmentApi";
import { Appointment } from "@/types/scheduling/schedule";
-function AppointmentDialog(props: {
+function AppointmentDialog({
+ appointment,
+ open,
+ onOpenChange,
+ setAppointmentDialogOpen,
+}: {
appointment: Appointment | undefined;
open: boolean;
onOpenChange: (open: boolean) => void;
@@ -40,10 +45,9 @@ function AppointmentDialog(props: {
queryClient.invalidateQueries({
queryKey: ["appointment", tokenData?.phoneNumber],
});
- props.setAppointmentDialogOpen(false);
+ setAppointmentDialogOpen(false);
},
});
- const { appointment, open, onOpenChange } = props;
if (!appointment) return <>>;
@@ -91,11 +95,12 @@ function AppointmentDialog(props: {
});
}}
>
- {t("Cancel")}
+ {t("cancel")}
- */}