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

(feat) U4X-704 : Adding wait time to test ordered #14

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion src/order-actions/reject-order.component.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useCallback } from "react";
import { OverflowMenuItem, OverflowMenu } from "@carbon/react";
import { OverflowMenuItem } from "@carbon/react";
import { useTranslation } from "react-i18next";
import { showModal } from "@openmrs/esm-framework";
import { Result } from "../work-list/work-list.resource";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,8 @@ const LaboratoryActiveTestOrderResults: React.FC<
> = ({ patientUuid }) => {
const { t } = useTranslation();

const {
enableSendingLabTestsByEmail,
laboratoryEncounterTypeUuid,
artCardEncounterTypeUuid,
laboratoryOrderTypeUuid,
} = useConfig();
const { enableSendingLabTestsByEmail, laboratoryEncounterTypeUuid } =
useConfig();

const displayText = t(
"activelLaboratoryTestsDisplayTextTitle",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ import {
import {
Printer,
MailAll,
Add,
Checkmark,
SendAlt,
NotSent,
Expand Down
5 changes: 0 additions & 5 deletions src/patient-chart/patient-laboratory-results.component.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { EmptyState } from "@openmrs/esm-patient-common-lib";
import React, { useState } from "react";
import { useTranslation } from "react-i18next";
import LaboratoryActiveTestOrderResults from "./laboratory-active-test-order/laboratory-active-test-order-results.component";
Expand All @@ -13,10 +12,6 @@ const PatientLaboratoryResults: React.FC<PatientLaboratoryResultsProps> = ({
}) => {
const { t } = useTranslation();

const [hasActiveOrderResults, setHasActiveOrderResults] = useState<
boolean | null
>(null);

return (
<>
<div style={{ margin: "10px" }}>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useEffect, useMemo, useRef, useState } from "react";
import React, { useMemo } from "react";
import styles from "./print-results-summary.scss";
import { formatDate, parseDate } from "@openmrs/esm-framework";
import logoImg from "../../../assets/logo/moh_logo_without_word.png";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useMemo, useState } from "react";
import React, { useMemo } from "react";
import { useTranslation } from "react-i18next";
import {
DataTable,
Expand Down
7 changes: 1 addition & 6 deletions src/reject-order/reject-order-dialog.resource.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
import {
FetchResponse,
openmrsFetch,
restBaseUrl,
useConfig,
} from "@openmrs/esm-framework";
import { openmrsFetch, restBaseUrl } from "@openmrs/esm-framework";

export async function RejectOrder(uuid: string, body: any) {
const abortController = new AbortController();
Expand Down
1 change: 0 additions & 1 deletion src/results/result-form-field.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { TextInput, Select, SelectItem } from "@carbon/react";
import { useTranslation } from "react-i18next";
import { ConceptReference } from "./result-form.resource";
import { Controller } from "react-hook-form";
import { min } from "rxjs/operators";

interface ResultFormFieldProps {
concept: ConceptReference;
Expand Down
2 changes: 1 addition & 1 deletion src/summary-tiles/laboratory-summary.resource.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import useSWR, { mutate } from "swr";
import useSWR from "swr";
import useSWRImmutable from "swr/immutable";
import {
FetchResponse,
Expand Down
7 changes: 1 addition & 6 deletions src/tests-ordered/lab-tests/lab-tests.resource.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
import {
FetchResponse,
openmrsFetch,
restBaseUrl,
useConfig,
} from "@openmrs/esm-framework";
import { openmrsFetch, restBaseUrl } from "@openmrs/esm-framework";
import useSWR from "swr";
import { Result } from "../../patient-chart/patient-laboratory-order-results.resource";
export function useGetLabOrders(encounterUuid: string) {
Expand Down
10 changes: 8 additions & 2 deletions src/tests-ordered/tests-ordered-list.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import styles from "./laboratory-queue.scss";
import { useGetOrdersWorklist } from "../work-list/work-list.resource";
import OrderCustomOverflowMenuComponent from "../ui-components/overflow-menu.component";
import { useOrderDate } from "../utils/functions";
import { formatWaitTime, useOrderDate } from "../utils/functions";

interface LaboratoryPatientListProps {}

Expand Down Expand Up @@ -67,7 +67,8 @@
{ id: 4, header: t("test", "Test"), key: "test" },
{ id: 5, header: t("orderer", "Ordered By"), key: "orderer" },
{ id: 6, header: t("urgency", "Urgency"), key: "urgency" },
{ id: 7, header: t("actions", "Actions"), key: "actions" },
{ id: 7, header: t("waitTime", "Wait Time"), key: "waitTime" },
{ id: 8, header: t("actions", "Actions"), key: "actions" },
];

const tableRows = useMemo(() => {
Expand All @@ -94,6 +95,11 @@
action: entry?.action,
orderer: entry?.orderer?.display,
urgency: entry?.urgency,
waitTime: (
<span className={styles["single-line-display"]}>
{formatWaitTime(entry?.dateActivated, t)}
</span>
),
actions: (
<OrderCustomOverflowMenuComponent
menuTitle={
Expand All @@ -114,7 +120,7 @@
),
};
});
}, [paginatedPickedOrderQueueEntries]);

Check warning on line 123 in src/tests-ordered/tests-ordered-list.component.tsx

View workflow job for this annotation

GitHub Actions / build

React Hook useMemo has a missing dependency: 't'. Either include it or remove the dependency array

if (isLoading) {
return <DataTableSkeleton role="progressbar" />;
Expand Down
2 changes: 1 addition & 1 deletion src/utils/orders-table/orders-data-table.component.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState, useMemo } from "react";
import React, { useState } from "react";
import {
DataTable,
Pagination,
Expand Down
Loading