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

OH2-222 | Align with they latest api spec file and add ward in visit form and table #507

Merged
merged 7 commits into from
Sep 22, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update: Align with they latest api spec file and add ward in visit fi…
…lter form
SteveGT96 committed Aug 8, 2023
commit 37178bdc1cccd0ec06593055e4914cd33b7cb5d4
6 changes: 3 additions & 3 deletions src/components/accessories/laboratory/Exams.tsx
Original file line number Diff line number Diff line change
@@ -100,7 +100,7 @@ export const Exams: FC = () => {
};

const onEdit = (row: LaboratoryDTO) => {
if (row.status === LaboratoryDTOStatusEnum.DRAFT) {
if (row.status === LaboratoryDTOStatusEnum.Draft) {
setSelectedExamRow(row);
setShowStatusChangeModal(true);
} else {
@@ -111,7 +111,7 @@ export const Exams: FC = () => {
const onExamStatusChangeClick = () => {
if (selectedExamRow?.code) {
dispatch(
updateLabStatus(selectedExamRow?.code, LaboratoryDTOStatusEnum.OPEN)
updateLabStatus(selectedExamRow?.code, LaboratoryDTOStatusEnum.Open)
);
}
};
@@ -261,7 +261,7 @@ export const Exams: FC = () => {
<ChangeLabStatus
onClick={onExamStatusChangeClick}
onClose={onExamStatusChangeClose}
status={LaboratoryDTOStatusEnum.OPEN}
status={LaboratoryDTOStatusEnum.Open}
isOpen={true}
labCode={`${selectedExamRow.code}`}
/>
4 changes: 2 additions & 2 deletions src/components/accessories/laboratory/examForm/ExamForm.tsx
Original file line number Diff line number Diff line change
@@ -126,9 +126,9 @@ const ExamForm: FC<ExamProps> = ({
};

if (rowsData.length > 0 || (lab.result && lab.result.length > 0)) {
lab.status = LaboratoryDTOStatusEnum.DONE;
lab.status = LaboratoryDTOStatusEnum.Done;
} else {
lab.status = LaboratoryDTOStatusEnum.OPEN;
lab.status = LaboratoryDTOStatusEnum.Open;
}

if (!creationMode && labToEdit.code) {
Original file line number Diff line number Diff line change
@@ -128,7 +128,7 @@ const ExamRequestForm: FC<ExamRequestProps> = ({
: LaboratoryDTOInOutPatientEnum.O;
lab.material = ""; // material needs to be removed from backend env
lab.result = "";
lab.status = LaboratoryDTOStatusEnum.DRAFT;
lab.status = LaboratoryDTOStatusEnum.Draft;

dispatch(createLabRequest(lab));
};
24 changes: 12 additions & 12 deletions src/components/accessories/laboratory/table/ExamTable.tsx
Original file line number Diff line number Diff line change
@@ -17,15 +17,15 @@ import { TActions } from "../../table/types";

export const statusLabel = (status: LaboratoryDTOStatusEnum) => {
switch (status) {
case LaboratoryDTOStatusEnum.DELETED:
case LaboratoryDTOStatusEnum.Deleted:
return <LabelBadge color="danger" label={status} />;
case LaboratoryDTOStatusEnum.INVALID:
case LaboratoryDTOStatusEnum.Invalid:
return <LabelBadge color="warning" label={status} />;

case LaboratoryDTOStatusEnum.OPEN:
case LaboratoryDTOStatusEnum.Open:
return <LabelBadge color="info" label={status} />;

case LaboratoryDTOStatusEnum.DONE:
case LaboratoryDTOStatusEnum.Done:
return <LabelBadge color="success" label={status} />;

default:
@@ -90,24 +90,24 @@ export const ExamTable: FC<IExamTableProps> = ({

const shouldDisplayAction = (row: any, action: TActions): boolean => {
if (
(row.statusText === LaboratoryDTOStatusEnum.DELETED ||
row.statusText === LaboratoryDTOStatusEnum.INVALID) &&
(row.statusText === LaboratoryDTOStatusEnum.Deleted ||
row.statusText === LaboratoryDTOStatusEnum.Invalid) &&
(action === "delete" || action === "edit")
) {
return false;
}

if (
row.statusText !== LaboratoryDTOStatusEnum.DRAFT &&
row.statusText !== LaboratoryDTOStatusEnum.OPEN &&
row.statusText !== LaboratoryDTOStatusEnum.Draft &&
row.statusText !== LaboratoryDTOStatusEnum.Open &&
action === "cancel"
) {
return false;
}

if (
(row.statusText === LaboratoryDTOStatusEnum.DRAFT ||
row.statusText === LaboratoryDTOStatusEnum.OPEN) &&
(row.statusText === LaboratoryDTOStatusEnum.Draft ||
row.statusText === LaboratoryDTOStatusEnum.Open) &&
action === "delete"
) {
return false;
@@ -151,8 +151,8 @@ export const ExamTable: FC<IExamTableProps> = ({

if (labExam) {
if (
labExam.status === LaboratoryDTOStatusEnum.DRAFT ||
labExam.status === LaboratoryDTOStatusEnum.OPEN
labExam.status === LaboratoryDTOStatusEnum.Draft ||
labExam.status === LaboratoryDTOStatusEnum.Open
) {
if (handleCancel !== undefined) handleCancel(labExam.code);
} else {
2 changes: 1 addition & 1 deletion src/components/accessories/opds/filter/OpdFilterForm.tsx
Original file line number Diff line number Diff line change
@@ -198,7 +198,7 @@ export const OpdFilterForm: FC<IOpdFilterProps> = ({ fields, onSubmit }) => {
});

const wards = useSelector<IState, WardDTO[]>((state: IState) => {
return state.wards.allWards.data ?? [];
return state.wards.allWards.data?.filter((e) => e.opd) ?? [];
});

const wardOptions = useMemo(() => {
4 changes: 2 additions & 2 deletions src/components/accessories/patientExams/PatientExams.tsx
Original file line number Diff line number Diff line change
@@ -139,8 +139,8 @@ const PatientExams: FC = () => {
// Fix status according to results
lab.status =
(lab.result && lab.result.length > 0) || rows.length > 0
? LaboratoryDTOStatusEnum.DONE
: LaboratoryDTOStatusEnum.OPEN;
? LaboratoryDTOStatusEnum.Done
: LaboratoryDTOStatusEnum.Open;

if (!creationMode && labToEdit.code) {
dispatch(updateLab(labToEdit.code, labWithRowsDTO));
549 changes: 0 additions & 549 deletions src/generated/apis/AdmissionControllerApi.ts

This file was deleted.

115 changes: 0 additions & 115 deletions src/generated/apis/AdmissionTypeControllerApi.ts

This file was deleted.

119 changes: 0 additions & 119 deletions src/generated/apis/AgeTypeControllerApi.ts

This file was deleted.

61 changes: 0 additions & 61 deletions src/generated/apis/AuthApi.ts

This file was deleted.

373 changes: 0 additions & 373 deletions src/generated/apis/BillControllerApi.ts

This file was deleted.

115 changes: 0 additions & 115 deletions src/generated/apis/DeliveryResultTypeControllerApi.ts

This file was deleted.

115 changes: 0 additions & 115 deletions src/generated/apis/DeliveryTypeControllerApi.ts

This file was deleted.

115 changes: 0 additions & 115 deletions src/generated/apis/DischargeTypeControllerApi.ts

This file was deleted.

298 changes: 0 additions & 298 deletions src/generated/apis/DiseaseControllerApi.ts

This file was deleted.

115 changes: 0 additions & 115 deletions src/generated/apis/DiseaseTypeControllerApi.ts

This file was deleted.

140 changes: 0 additions & 140 deletions src/generated/apis/ExamControllerApi.ts

This file was deleted.

167 changes: 0 additions & 167 deletions src/generated/apis/ExamRowControllerApi.ts

This file was deleted.

117 changes: 0 additions & 117 deletions src/generated/apis/ExamTypeControllerApi.ts

This file was deleted.

369 changes: 0 additions & 369 deletions src/generated/apis/ExaminationControllerApi.ts

This file was deleted.

86 changes: 0 additions & 86 deletions src/generated/apis/HospitalControllerApi.ts

This file was deleted.

699 changes: 0 additions & 699 deletions src/generated/apis/LaboratoryControllerApi.ts

This file was deleted.

40 changes: 0 additions & 40 deletions src/generated/apis/LoginApiApi.ts
mwithi marked this conversation as resolved.
Show resolved Hide resolved

This file was deleted.

50 changes: 0 additions & 50 deletions src/generated/apis/LoginControllerApi.ts

This file was deleted.

146 changes: 0 additions & 146 deletions src/generated/apis/MalnutritionControllerApi.ts

This file was deleted.

Loading