Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OHCS-73 OHCS-100 OH2-232 OH2-233 OHCS-107 | Remove material field all over the app and fix patient without picture #519

Merged
4 changes: 4 additions & 0 deletions src/components/accessories/currentAdmission/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@
&.fullWidth {
width: 100%;
}

.item_content {
word-break: break-word;
}
}
.item_label {
font-size: 0.85em;
Expand Down
9 changes: 5 additions & 4 deletions src/components/accessories/laboratory/examForm/ExamForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ const ExamForm: FC<ExamProps> = ({
} else {
lab.status = LaboratoryDTOStatusEnum.OPEN;
}
lab.material = "Undefined";

if (!creationMode && labToEdit.code) {
dispatch(updateLab(labToEdit.code, labWithRowsDTO));
Expand Down Expand Up @@ -165,7 +166,7 @@ const ExamForm: FC<ExamProps> = ({
},
}),
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",
Expand Down Expand Up @@ -392,7 +393,7 @@ const ExamForm: FC<ExamProps> = ({
disabled={false}
/>
</div>
<div className="patientExamForm__item">
{/* <div className="patientExamForm__item">
<AutocompleteField
fieldName="material"
fieldValue={formik.values.material}
Expand All @@ -404,8 +405,8 @@ const ExamForm: FC<ExamProps> = ({
options={materialsOptionsSelector(materialsList)}
disabled={isLoading}
/>
</div>
<div className="patientExamForm__item fullWidth">
</div> */}
<div className="patientExamForm__item">
<AutocompleteField
fieldName="exam"
fieldValue={formik.values.exam}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ const ExamRequestForm: FC<ExamRequestProps> = ({
? 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;

Expand Down
4 changes: 3 additions & 1 deletion src/components/accessories/opds/filter/OpdFilterForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,9 @@ export const OpdFilterForm: FC<IOpdFilterProps> = ({ 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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -127,6 +128,9 @@ const PatientDataForm: FunctionComponent<TProps> = ({

onSubmit({
...formattedValues,
blobPhoto: isEmpty(formattedValues.blobPhoto)
? null
: formattedValues.blobPhoto,
birthDate: birthDate,
age: age,
agetype: "",
Expand Down
4 changes: 2 additions & 2 deletions src/components/accessories/patientExams/ExamForm/ExamForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ const ExamForm: FC<ExamProps> = ({
disabled={isLoading}
/>
</div>
<div className="patientExamForm__item">
{/* <div className="patientExamForm__item">
<AutocompleteField
fieldName="material"
fieldValue={formik.values.material}
Expand All @@ -275,7 +275,7 @@ const ExamForm: FC<ExamProps> = ({
options={materialsOptionsSelector(materialsList)}
disabled={isLoading}
/>
</div>
</div> */}
<div className="patientExamForm__item fullWidth">
<AutocompleteField
fieldName="exam"
Expand Down
2 changes: 1 addition & 1 deletion src/components/accessories/patientExams/PatientExams.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ const PatientExams: FC = () => {
? 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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const PatientExamRequestsTable: FunctionComponent<IOwnProps> = ({
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"];

Expand All @@ -63,7 +63,7 @@ const PatientExamRequestsTable: FunctionComponent<IOwnProps> = ({
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 ?? "",
};
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const PatientExamsTable: FunctionComponent<IOwnProps> = ({
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"];

Expand Down Expand Up @@ -74,9 +74,9 @@ const PatientExamsTable: FunctionComponent<IOwnProps> = ({
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"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down
3 changes: 3 additions & 0 deletions src/components/accessories/table/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,8 @@
}
}
}
.collapseItem_row {
word-break: break-all;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,15 @@ const EditPatientActivity: FunctionComponent<TProps> = ({
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);
Expand Down
Loading