Skip to content

Commit

Permalink
update: Update data fields display order and fix some lint warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveGT96 committed Feb 1, 2024
1 parent c7b0ff2 commit 0ec3376
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 18 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React, { FunctionComponent, useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
import { useDispatch, useSelector } from "react-redux";
import { AdmissionDTO, OpdDTO, PatientDTO } from "../../../generated";
import { AdmissionDTO, OpdDTO } from "../../../generated";
import { updateAdmission } from "../../../state/admissions/actions";
import { IState } from "../../../types";
import { useFields } from "../admission/useFields";
Expand Down Expand Up @@ -52,7 +51,7 @@ export const CurrentAdmission: FunctionComponent<IOwnProps> = ({
if (onEditChange) {
onEditChange(editionMode);
}
}, [editionMode]);
}, [editionMode, onEditChange]);

return (
<div className="currentAdmission">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ export const CurrentAdmissionData: FunctionComponent<IOwnProps> = ({
)}
</div>
<div className="currentAdmissionData__content">
{!isEmpty(admission?.admDate) && (
<div className="currentAdmissionData__item">
<span className="item_label">{t("admission.admDate")}</span>
<p className="item_content">{renderDate(admission?.admDate)}</p>
</div>
)}
{!isEmpty(admission?.ward?.description) && (
<div className="currentAdmissionData__item">
<span className="item_label">{t("admission.ward")}</span>
Expand All @@ -40,12 +46,6 @@ export const CurrentAdmissionData: FunctionComponent<IOwnProps> = ({
<p className="item_content">{admission?.fhu}</p>
</div>
)}
{!isEmpty(admission?.admDate) && (
<div className="currentAdmissionData__item">
<span className="item_label">{t("admission.admDate")}</span>
<p className="item_content">{renderDate(admission?.admDate)}</p>
</div>
)}
{!isEmpty(admission?.admType?.description) && (
<div className="currentAdmissionData__item">
<span className="item_label">{t("admission.admType")}</span>
Expand Down
6 changes: 1 addition & 5 deletions src/components/accessories/opds/table/OpdTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export const OpdTable: FC<IOpdTableProps> = ({ data }) => {
const label = {
id: t("opd.code"),
date: t("opd.date"),
nextVisitDate: t("opd.nextvisitdate"),
patientCode: t("opd.patientcode"),
patientName: t("opd.patient"),
sex: t("opd.sex"),
Expand All @@ -36,7 +37,6 @@ export const OpdTable: FC<IOpdTableProps> = ({ data }) => {
note: t("opd.note"),
referralFrom: t("opd.referralfrom"),
referralTo: t("opd.referralto"),
nextVisitDate: t("opd.nextvisitdate"),
age: t("opd.age"),
ward: t("opd.ward"),
};
Expand All @@ -49,7 +49,6 @@ export const OpdTable: FC<IOpdTableProps> = ({ data }) => {
"age",
"disease",
];
const [opd, setOpd] = useState({} as OpdDTO);

const formatDataToDisplay = (data: OpdDTO[]) => {
let results: any = [];
Expand Down Expand Up @@ -82,9 +81,6 @@ export const OpdTable: FC<IOpdTableProps> = ({ data }) => {
const formattedData: any[] = formatDataToDisplay(data);

const [open, setOpen] = useState(false);
const handleOpen = () => {
setOpen(true);
};

const handleClose = () => {
setOpen(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ const useSummaryMetaData = () => {
const labels = {
date: t("common.date"),
visitDate: t("opd.date"),
labDate: t("lab.date"),
opdDate: t("opd.date"),
startDate: t("therapy.startDate"),
endDate: t("therapy.endDate"),
type: t("common.type"),
opDate: t("operation.opDate"),
ward: t("admission.ward"),
Expand Down Expand Up @@ -40,10 +44,6 @@ const useSummaryMetaData = () => {
pex_note: t("examination.note"),
exam: t("lab.exam"),
//material: t("lab.material"),
labDate: t("lab.date"),
opdDate: t("opd.date"),
startDate: t("therapy.startDate"),
endDate: t("therapy.endDate"),
qty: t("therapy.quantity"),
freqInDay: t("therapy.frequencyInDay"),
freqInPeriod: t("therapy.frequencyInPeriod"),
Expand Down

0 comments on commit 0ec3376

Please sign in to comment.