From c5b07639531acfdd0f3d06985116cdb660147994 Mon Sep 17 00:00:00 2001 From: SilverD3 Date: Wed, 4 Oct 2023 16:21:57 +0100 Subject: [PATCH 1/5] Remove sections with zero item in patient summary --- .../PatientSummaryByType.tsx | 301 +++++++++--------- 1 file changed, 159 insertions(+), 142 deletions(-) diff --git a/src/components/accessories/patientSummary/patientSummaryByType/PatientSummaryByType.tsx b/src/components/accessories/patientSummary/patientSummaryByType/PatientSummaryByType.tsx index cdba62b67..96ec8b8d7 100644 --- a/src/components/accessories/patientSummary/patientSummaryByType/PatientSummaryByType.tsx +++ b/src/components/accessories/patientSummary/patientSummaryByType/PatientSummaryByType.tsx @@ -42,148 +42,165 @@ const PatientSummaryByType: FunctionComponent = ({ <> {!isLoading ? (
-
-

- {t("summary.opd")}({filterByType(SummaryType.OPD).length}) -

- - - -
-

- {t("summary.admission")}( - {filterByType(SummaryType.ADMISSION).length}) -

-
- -
-

- {t("summary.visits")}({filterByType(SummaryType.VISIT).length}) -

-
- -
-

- {t("summary.operation")}( - {filterByType(SummaryType.OPERATION).length}) -

-
- - -
-

- {t("summary.triage")}({filterByType(SummaryType.TRIAGE).length}) -

-
- - -
-

- {t("summary.exams")}({filterByType(SummaryType.EXAMS).length}) -

-
- - -
-

- {t("summary.therapy")}({filterByType(SummaryType.THERAPY).length}) -

-
- + {filterByType(SummaryType.OPD).length > 0 && ( +
+

+ {t("summary.opd")}({filterByType(SummaryType.OPD).length}) +

+
+ + )} + + {filterByType(SummaryType.ADMISSION).length > 0 && ( +
+

+ {t("summary.admission")}( + {filterByType(SummaryType.ADMISSION).length}) +

+
+ + )} + + {filterByType(SummaryType.VISIT).length > 0 && ( +
+

+ {t("summary.visits")}({filterByType(SummaryType.VISIT).length}) +

+
+ + )} + + {filterByType(SummaryType.OPERATION).length > 0 && ( +
+

+ {t("summary.operation")}( + {filterByType(SummaryType.OPERATION).length}) +

+
+ + )} + + {filterByType(SummaryType.TRIAGE).length > 0 && ( +
+

+ {t("summary.triage")}({filterByType(SummaryType.TRIAGE).length}) +

+
+ + )} + + {filterByType(SummaryType.EXAMS).length > 0 && ( +
+

+ {t("summary.exams")}({filterByType(SummaryType.EXAMS).length}) +

+
+ + )} + + {filterByType(SummaryType.THERAPY).length > 0 && ( +
+

+ {t("summary.therapy")}( + {filterByType(SummaryType.THERAPY).length}) +

+
+ + )} ) : ( From 1b60e66296a8629db1a9e2da6f58b88c5033b0ff Mon Sep 17 00:00:00 2001 From: SilverD3 Date: Wed, 4 Oct 2023 16:40:53 +0100 Subject: [PATCH 2/5] Internationalize 'previous entries' --- .../admissionTable/AdmissionTable.tsx | 2 +- .../patientExamsTable/PatientExamsTable.tsx | 2 +- .../patientOPDTable/PatientOPDTable.tsx | 2 +- .../operationTable/OperationRowTable.tsx | 2 +- .../PatientTherapyTable.tsx | 2 +- .../patientTriageTable/PatientTriageTable.tsx | 2 +- .../patientVisitTable/PatientVisitTable.tsx | 2 +- src/resources/i18n/en.json | 21 ++++++++++++------- 8 files changed, 21 insertions(+), 14 deletions(-) diff --git a/src/components/accessories/admission/admissionTable/AdmissionTable.tsx b/src/components/accessories/admission/admissionTable/AdmissionTable.tsx index 477e5bece..9fb49e9be 100644 --- a/src/components/accessories/admission/admissionTable/AdmissionTable.tsx +++ b/src/components/accessories/admission/admissionTable/AdmissionTable.tsx @@ -99,7 +99,7 @@ const PatientAdmissionTable: FunctionComponent = ({ return (
-
{t("common.previousentries")}
+
{t("admission.previousentries")}
{(() => { switch (status) { case "FAIL": diff --git a/src/components/accessories/patientExams/patientExamsTable/PatientExamsTable.tsx b/src/components/accessories/patientExams/patientExamsTable/PatientExamsTable.tsx index ce02b26f8..ffb963686 100644 --- a/src/components/accessories/patientExams/patientExamsTable/PatientExamsTable.tsx +++ b/src/components/accessories/patientExams/patientExamsTable/PatientExamsTable.tsx @@ -109,7 +109,7 @@ const PatientExamsTable: FunctionComponent = ({ return (
-
{t("common.previousentries")}
+
{t("lab.previousentries")}
{labStatus === "SUCCESS" && (
= ({ return (
-
{t("common.previousentries")}
+
{t("opd.previousentries")}
{opdStatus === "SUCCESS" ? (
= ({ return (
-
{t("common.previousentries")}
+
{t("operation.previousentries")}
{(() => { switch (status) { case "FAIL": diff --git a/src/components/accessories/patientTherapy/patientTherapyTable/PatientTherapyTable.tsx b/src/components/accessories/patientTherapy/patientTherapyTable/PatientTherapyTable.tsx index b8f63c406..419e0c2ca 100644 --- a/src/components/accessories/patientTherapy/patientTherapyTable/PatientTherapyTable.tsx +++ b/src/components/accessories/patientTherapy/patientTherapyTable/PatientTherapyTable.tsx @@ -112,7 +112,7 @@ const PatientTherapyTable: FunctionComponent = ({ return (
-
{t("common.previousentries")}
+
{t("therapy.previousentries")}
{(() => { switch (therapyStatus) { case "FAIL": diff --git a/src/components/accessories/patientTriage/patientTriageTable/PatientTriageTable.tsx b/src/components/accessories/patientTriage/patientTriageTable/PatientTriageTable.tsx index a0feb1858..cfa066290 100644 --- a/src/components/accessories/patientTriage/patientTriageTable/PatientTriageTable.tsx +++ b/src/components/accessories/patientTriage/patientTriageTable/PatientTriageTable.tsx @@ -103,7 +103,7 @@ const PatientTriageTable: FunctionComponent = ({ return (
-
{t("common.previousentries")}
+
{t("examination.previousentries")}
{(() => { switch (triageStatus) { case "FAIL": diff --git a/src/components/accessories/patientVisit/patientVisitTable/PatientVisitTable.tsx b/src/components/accessories/patientVisit/patientVisitTable/PatientVisitTable.tsx index 08430285b..61fcfa13f 100644 --- a/src/components/accessories/patientVisit/patientVisitTable/PatientVisitTable.tsx +++ b/src/components/accessories/patientVisit/patientVisitTable/PatientVisitTable.tsx @@ -69,7 +69,7 @@ const PatientVisitTable: FunctionComponent = ({ return (
-
{t("common.previousentries")}
+
{t("visit.previousentries")}
{(() => { switch (visitStatus) { case "FAIL": diff --git a/src/resources/i18n/en.json b/src/resources/i18n/en.json index 88733f9f3..cbc76b33f 100644 --- a/src/resources/i18n/en.json +++ b/src/resources/i18n/en.json @@ -216,7 +216,8 @@ "futuredatenotallow": "Future date not allowed", "belowminage": "Min. age is 0", "abovemaxage": "max. age is 200", - "ward": "Ward" + "ward": "Ward", + "previousentries": "Previous Visits" }, "visit": { "date": "Date (d/m/y)", @@ -238,7 +239,8 @@ "updatefail": "Visit {{code}} has not been updated!", "notdeleted": "Visit not deleted", "addoperation": "Add operation", - "addoperationdesc": "Add operation for the visit" + "addoperationdesc": "Add operation for the visit", + "previousentries": "Previous Visits" }, "examination": { "newtriage": "Create new Triage", @@ -299,7 +301,8 @@ "rhonchi": "Rhonchi", "crackles": "Crackles", "stridor": "Stridor", - "bronchial": "Bronchial" + "bronchial": "Bronchial", + "previousentries": "Previous Triages" }, "nav": { "pharmacy": "Pharmacy", @@ -364,7 +367,8 @@ "unknown": "Unknown", "success": "Success", "failure": "Failure" - } + }, + "previousentries": "Previous Operations" }, "common": { "ok": "OK", @@ -478,7 +482,8 @@ "created": "Therapy created", "updated": "Therapy updated", "createsuccess": "A therapy row has been created successfully!", - "updatesuccess": "A therapy row with code {{code}} has been updated successfully!" + "updatesuccess": "A therapy row with code {{code}} has been updated successfully!", + "previousentries": "Previous Therapies" }, "booking": { "category": "Category", @@ -555,7 +560,8 @@ "ALL": "ALL", "OPEN": "OPEN", "DONE": "DONE" - } + }, + "previousentries": "Previous Exams" }, "admission": { "admDate": "Date", @@ -598,7 +604,8 @@ "dischargebyagetype": "Discharges by age type", "dischargebywards": "Discharges by wards", "admregistered": "Admissions in the current period", - "disregistered": "Discharges in the current period" + "disregistered": "Discharges in the current period", + "previousentries": "Previous Admissions" }, "bill": { "title": "Welcome to Billing", From 8d95e52a27cb825a301a5e8b7a5ee35a2f188220 Mon Sep 17 00:00:00 2001 From: SilverD3 Date: Wed, 4 Oct 2023 16:41:31 +0100 Subject: [PATCH 3/5] Fix issue lab status color --- .../accessories/laboratory/table/ExamTable.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/components/accessories/laboratory/table/ExamTable.tsx b/src/components/accessories/laboratory/table/ExamTable.tsx index ccde75c90..c4225b57c 100644 --- a/src/components/accessories/laboratory/table/ExamTable.tsx +++ b/src/components/accessories/laboratory/table/ExamTable.tsx @@ -16,16 +16,17 @@ import { LabelBadge } from "../../labelBadge/LabelBadge"; import { TActions } from "../../table/types"; export const statusLabel = (status: LaboratoryDTOStatusEnum) => { + status = status.toUpperCase() as LaboratoryDTOStatusEnum; switch (status) { - case LaboratoryDTOStatusEnum.Deleted: + case LaboratoryDTOStatusEnum.Deleted.toUpperCase(): return ; - case LaboratoryDTOStatusEnum.Invalid: + case LaboratoryDTOStatusEnum.Invalid.toUpperCase(): return ; - case LaboratoryDTOStatusEnum.Open: + case LaboratoryDTOStatusEnum.Open.toUpperCase(): return ; - case LaboratoryDTOStatusEnum.Done: + case LaboratoryDTOStatusEnum.Done.toUpperCase(): return ; default: From 585e83572314e3e918f1cfb8ba270d8116ddfc42 Mon Sep 17 00:00:00 2001 From: SilverD3 Date: Wed, 4 Oct 2023 17:21:03 +0100 Subject: [PATCH 4/5] Display every language in its original spelling --- .../accessories/langSwitcher/LangSwitcher.tsx | 33 +++++++++---------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/src/components/accessories/langSwitcher/LangSwitcher.tsx b/src/components/accessories/langSwitcher/LangSwitcher.tsx index 9404edbbc..76ed12a13 100644 --- a/src/components/accessories/langSwitcher/LangSwitcher.tsx +++ b/src/components/accessories/langSwitcher/LangSwitcher.tsx @@ -6,34 +6,33 @@ import { useTranslation } from "react-i18next"; import availableLanguages from "../../../customization/available-languages.json"; import { isEmpty } from "lodash"; -const fallbackLanguages = [ - "en", - "it", - "de", - "fr", - "es", - "pt", - "ar", - "sw", - "am", - "cs", - "sq", - "zh", -]; +const fallbackLanguages: Record = { + en: "English", + it: "Italiano", + de: "Deutsch", + fr: "Français", + es: "Español", + pt: "Português", + ar: "عرب", + sw: "Svenska", + am: "አማርኛ", + cs: "čeština", + sq: "Shqiptar", + zh: "中国人", +}; const LangSwitcher: FunctionComponent = () => { const currentLang = i18n.language; const { changeLang } = useContext(LangContext); - const { t } = useTranslation(); const languages = isEmpty(availableLanguages.availableLanguages) - ? fallbackLanguages + ? Object.keys(fallbackLanguages) : availableLanguages.availableLanguages; const renderOptions = (): JSX.Element[] => { return languages.map((code: string) => ( )); }; From 8e6b1ee8202428cd83c1eb218bf36d39336141b4 Mon Sep 17 00:00:00 2001 From: SilverD3 Date: Wed, 4 Oct 2023 17:32:05 +0100 Subject: [PATCH 5/5] Change button labels in modal upon patient creation --- .../activities/newPatientActivity/NewPatientActivity.tsx | 6 +++--- src/resources/i18n/en.json | 7 +++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/components/activities/newPatientActivity/NewPatientActivity.tsx b/src/components/activities/newPatientActivity/NewPatientActivity.tsx index 781191b0d..778c24e6e 100644 --- a/src/components/activities/newPatientActivity/NewPatientActivity.tsx +++ b/src/components/activities/newPatientActivity/NewPatientActivity.tsx @@ -137,16 +137,16 @@ const NewPatientActivity: FunctionComponent = ({ info={t("common.patientregistrationsuccessfull")} items={[ { - label: t("common.dashboard"), + label: t("common.gohome"), onClick: () => setActivityTransitionState("TO_DASHBOARD"), }, { - label: t("common.keepediting"), + label: t("patient.createother"), onClick: () => setActivityTransitionState("TO_NEW_PATIENT_RESET"), }, { - label: t("patient.dashboard"), + label: t("common.gotopatientactivities"), onClick: () => setActivityTransitionState("TO_PATIENT_DASHBOARD"), }, diff --git a/src/resources/i18n/en.json b/src/resources/i18n/en.json index cbc76b33f..12b83f92a 100644 --- a/src/resources/i18n/en.json +++ b/src/resources/i18n/en.json @@ -154,7 +154,8 @@ "operation": "Operation", "updated": "Patient updated", "created": "Patient created", - "updatesuccessful": "The patient was edit successfully." + "updatesuccessful": "The patient was edit successfully.", + "createother": "Add Another Patient" }, "opd": { "newopd": "Create new OPD Visit", @@ -452,7 +453,9 @@ "continue": "Continue ?", "collapse_all": "Collapse All", "expand_all": "Expand All", - "remainingchars": "Remaining : {{current}} / {{max}}" + "remainingchars": "Remaining : {{current}} / {{max}}", + "gohome": "Go to home", + "gotopatientactivities": "Go to Patient Activities" }, "permission": { "denied": "Permission denied",