From 64f9e7c5ff6998f51b4226aecb358d0b490d14e4 Mon Sep 17 00:00:00 2001 From: SilverD3 Date: Tue, 19 Sep 2023 15:02:09 +0100 Subject: [PATCH 1/7] Remove material field form lab form --- .../accessories/laboratory/examForm/ExamForm.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/components/accessories/laboratory/examForm/ExamForm.tsx b/src/components/accessories/laboratory/examForm/ExamForm.tsx index 4220c11dc..e478cfd2e 100644 --- a/src/components/accessories/laboratory/examForm/ExamForm.tsx +++ b/src/components/accessories/laboratory/examForm/ExamForm.tsx @@ -130,6 +130,7 @@ const ExamForm: FC = ({ } else { lab.status = LaboratoryDTOStatusEnum.OPEN; } + lab.material = "Undefined"; if (!creationMode && labToEdit.code) { dispatch(updateLab(labToEdit.code, labWithRowsDTO)); @@ -165,7 +166,7 @@ const ExamForm: FC = ({ }, }), exam: string().required(t("common.required")), - material: string().required(t("common.required")), + ///material: string().required(t("common.required")), result: string(), note: string().test({ name: "maxLength", @@ -392,7 +393,7 @@ const ExamForm: FC = ({ disabled={false} /> -
+ {/*
= ({ options={materialsOptionsSelector(materialsList)} disabled={isLoading} /> -
-
+
*/} +
Date: Wed, 20 Sep 2023 10:02:30 +0100 Subject: [PATCH 2/7] Fix the year field in visits filter form --- src/components/accessories/opds/filter/OpdFilterForm.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/accessories/opds/filter/OpdFilterForm.tsx b/src/components/accessories/opds/filter/OpdFilterForm.tsx index 832d382b6..a520d8f3f 100644 --- a/src/components/accessories/opds/filter/OpdFilterForm.tsx +++ b/src/components/accessories/opds/filter/OpdFilterForm.tsx @@ -221,7 +221,9 @@ export const OpdFilterForm: FC = ({ fields, onSubmit }) => { } if (fieldName === "year") { - const year = val?.getUTCFullYear() ?? new Date().getUTCFullYear(); + // Use getUTCFullYear() can result to wrong year as timezone can + // differ from one user to another, get the year as input instead + const year = val?.getFullYear() ?? new Date().getFullYear(); let startMonth = 0; let endMonth = 11; From 229df7c40309d5a214a64a4e684952f5fd3ed900 Mon Sep 17 00:00:00 2001 From: SilverD3 Date: Wed, 20 Sep 2023 10:18:43 +0100 Subject: [PATCH 3/7] Remove material in the entire app --- .../laboratory/examRequestForm/ExamRequestForm.tsx | 2 +- .../accessories/patientExams/ExamForm/ExamForm.tsx | 4 ++-- src/components/accessories/patientExams/PatientExams.tsx | 2 +- .../patientExamRequestsTable/PatientExamRequestsTable.tsx | 4 ++-- .../patientExams/patientExamsTable/PatientExamsTable.tsx | 8 ++++---- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/components/accessories/laboratory/examRequestForm/ExamRequestForm.tsx b/src/components/accessories/laboratory/examRequestForm/ExamRequestForm.tsx index e2e0b2cf7..3beadc380 100644 --- a/src/components/accessories/laboratory/examRequestForm/ExamRequestForm.tsx +++ b/src/components/accessories/laboratory/examRequestForm/ExamRequestForm.tsx @@ -126,7 +126,7 @@ const ExamRequestForm: FC = ({ ? LaboratoryDTOInOutPatientEnum.O : LaboratoryDTOInOutPatientEnum.I : LaboratoryDTOInOutPatientEnum.O; - lab.material = ""; // material needs to be removed from backend env + lab.material = "Undefined"; lab.result = ""; lab.status = LaboratoryDTOStatusEnum.DRAFT; diff --git a/src/components/accessories/patientExams/ExamForm/ExamForm.tsx b/src/components/accessories/patientExams/ExamForm/ExamForm.tsx index f164dedec..35113be7e 100644 --- a/src/components/accessories/patientExams/ExamForm/ExamForm.tsx +++ b/src/components/accessories/patientExams/ExamForm/ExamForm.tsx @@ -263,7 +263,7 @@ const ExamForm: FC = ({ disabled={isLoading} />
-
+ {/*
= ({ options={materialsOptionsSelector(materialsList)} disabled={isLoading} /> -
+
*/}
{ ? LaboratoryDTOInOutPatientEnum.O : LaboratoryDTOInOutPatientEnum.I : LaboratoryDTOInOutPatientEnum.O; - lab.material = "angal.lab.urine"; + lab.material = "Undefined"; if (!creationMode && labToEdit.code) { lab.code = labToEdit.code; lab.lock = labToEdit.lock; diff --git a/src/components/accessories/patientExams/patientExamRequestsTable/PatientExamRequestsTable.tsx b/src/components/accessories/patientExams/patientExamRequestsTable/PatientExamRequestsTable.tsx index 1428b694e..d5d0c92f8 100644 --- a/src/components/accessories/patientExams/patientExamRequestsTable/PatientExamRequestsTable.tsx +++ b/src/components/accessories/patientExams/patientExamRequestsTable/PatientExamRequestsTable.tsx @@ -36,7 +36,7 @@ const PatientExamRequestsTable: FunctionComponent = ({ exam: t("lab.exam"), status: t("lab.status"), note: t("lab.note"), - material: t("lab.material"), + //material: t("lab.material"), }; const order = ["date", "exam", "status"]; @@ -63,7 +63,7 @@ const PatientExamRequestsTable: FunctionComponent = ({ date: item.labDate ? renderDate(item.labDate) : "", status: item.status ? statusLabel(item.status) : "", exam: item.exam?.description ?? "", - material: item.material ? t(item.material) : "", + //material: item.material ? t(item.material) : "", note: item.note ?? "", }; }); diff --git a/src/components/accessories/patientExams/patientExamsTable/PatientExamsTable.tsx b/src/components/accessories/patientExams/patientExamsTable/PatientExamsTable.tsx index 5d046883d..ce02b26f8 100644 --- a/src/components/accessories/patientExams/patientExamsTable/PatientExamsTable.tsx +++ b/src/components/accessories/patientExams/patientExamsTable/PatientExamsTable.tsx @@ -37,7 +37,7 @@ const PatientExamsTable: FunctionComponent = ({ result: t("lab.result"), note: t("lab.note"), status: t("lab.status"), - material: t("lab.material"), + //material: t("lab.material"), }; const order = ["date", "exam", "status"]; @@ -74,9 +74,9 @@ const PatientExamsTable: FunctionComponent = ({ status: item.laboratoryDTO?.status ? statusLabel(item.laboratoryDTO.status) : "", - material: item.laboratoryDTO?.material - ? t(item.laboratoryDTO.material) - : "", + // material: item.laboratoryDTO?.material + // ? t(item.laboratoryDTO.material) + // : "", }; }); // .sort(dateComparator("desc", "date")); From 980a1158b7905eb05ab1506ac82632ea635edab5 Mon Sep 17 00:00:00 2001 From: SilverD3 Date: Thu, 21 Sep 2023 09:01:14 +0100 Subject: [PATCH 4/7] Remove material field from patient summary --- .../accessories/patientSummary/useSummaryMetaData.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/accessories/patientSummary/useSummaryMetaData.tsx b/src/components/accessories/patientSummary/useSummaryMetaData.tsx index e5c9b3fca..d58e6f48d 100644 --- a/src/components/accessories/patientSummary/useSummaryMetaData.tsx +++ b/src/components/accessories/patientSummary/useSummaryMetaData.tsx @@ -39,7 +39,7 @@ const useSummaryMetaData = () => { pex_auscultation: t("examination.auscultation"), pex_note: t("examination.note"), exam: t("lab.exam"), - material: t("lab.material"), + //material: t("lab.material"), labDate: t("lab.date"), startDate: t("therapy.startDate"), endDate: t("therapy.endDate"), From 3f02640a566d1946caf04846475a8ab7c7524b1d Mon Sep 17 00:00:00 2001 From: SilverD3 Date: Thu, 21 Sep 2023 09:57:03 +0100 Subject: [PATCH 5/7] Fix patient blob photo to null if not provided --- .../accessories/patientDataForm/PatientDataForm.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/accessories/patientDataForm/PatientDataForm.tsx b/src/components/accessories/patientDataForm/PatientDataForm.tsx index c37cd61ac..3d4725b91 100644 --- a/src/components/accessories/patientDataForm/PatientDataForm.tsx +++ b/src/components/accessories/patientDataForm/PatientDataForm.tsx @@ -1,6 +1,7 @@ import { useFormik } from "formik"; import get from "lodash.get"; import has from "lodash.has"; +import isEmpty from "lodash.isempty"; import React, { FunctionComponent, useCallback, @@ -127,6 +128,9 @@ const PatientDataForm: FunctionComponent = ({ onSubmit({ ...formattedValues, + blobPhoto: isEmpty(formattedValues.blobPhoto) + ? null + : formattedValues.blobPhoto, birthDate: birthDate, age: age, agetype: "", From 24f78130301c487f3d7a2304b16030616df88889 Mon Sep 17 00:00:00 2001 From: SilverD3 Date: Thu, 21 Sep 2023 11:43:17 +0100 Subject: [PATCH 6/7] Fix error being displayed in patient visit even if nothing has been submitted --- .../editPatientActivity/EditPatientActivity.tsx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/components/activities/editPatientActivity/EditPatientActivity.tsx b/src/components/activities/editPatientActivity/EditPatientActivity.tsx index 3d9c691b8..a3e4e4115 100644 --- a/src/components/activities/editPatientActivity/EditPatientActivity.tsx +++ b/src/components/activities/editPatientActivity/EditPatientActivity.tsx @@ -42,6 +42,15 @@ const EditPatientActivity: FunctionComponent = ({ const { id } = useParams<{ id: string }>(); const { t } = useTranslation(); + // Reset patient update state to avoid error displaying + // in patient details activity. + // See issue [OHCS-107](https://openhospital.atlassian.net/browse/OHCS-107) + useEffect(() => { + return () => { + updatePatientReset(); + }; + }, []); + useEffect(() => { if (isEmpty(patient.data) && patient.status === "IDLE" && id) { getPatientThunk(id); From 6f222f840b66c67af8ba1ecd883866099898efa8 Mon Sep 17 00:00:00 2001 From: SilverD3 Date: Thu, 21 Sep 2023 16:35:19 +0100 Subject: [PATCH 7/7] Fix CSS issues in patient activities, admission and summary --- src/components/accessories/currentAdmission/styles.scss | 4 ++++ src/components/accessories/table/styles.scss | 3 +++ 2 files changed, 7 insertions(+) diff --git a/src/components/accessories/currentAdmission/styles.scss b/src/components/accessories/currentAdmission/styles.scss index ddd65ea28..dde59bf36 100644 --- a/src/components/accessories/currentAdmission/styles.scss +++ b/src/components/accessories/currentAdmission/styles.scss @@ -36,6 +36,10 @@ &.fullWidth { width: 100%; } + + .item_content { + word-break: break-word; + } } .item_label { font-size: 0.85em; diff --git a/src/components/accessories/table/styles.scss b/src/components/accessories/table/styles.scss index 62062175f..928a491f2 100644 --- a/src/components/accessories/table/styles.scss +++ b/src/components/accessories/table/styles.scss @@ -43,5 +43,8 @@ } } } + .collapseItem_row { + word-break: break-all; + } } }