From 22e6605715311c64c41d0d6b6e8aa75ab746f210 Mon Sep 17 00:00:00 2001
From: Jabar Jeremy <24471994+jabahum@users.noreply.github.com>
Date: Mon, 15 Apr 2024 16:04:46 +0300
Subject: [PATCH] Add lab referal workflow (#1)
Add lab referal workflow (#1)
---
.github/workflows/node.js.yml | 54 +++--
package.json | 4 +-
.../completed-list.component.tsx | 3 -
src/config-schema.ts | 5 +
src/index.ts | 4 +-
src/lab-tabs/referred-tab.component.tsx | 6 +-
src/lab-tiles/referred-tile.component.tsx | 13 +-
src/lab-tiles/worklist-tile.component.tsx | 3 +-
...ry-active-test-order-results.component.tsx | 23 ++-
.../laboratory-order-referals.component.tsx | 25 +--
...tory-past-test-order-results.component.tsx | 21 +-
.../referred-orders.component.tsx | 195 ++++++++++++++++++
.../referred-orders.resource.ts | 0
src/referred-orders/referred-orders.scss | 57 +++++
src/review-list/review-list.component.tsx | 3 +-
.../add-to-worklist-dialog.component.tsx | 4 +-
.../add-to-worklist-dialog.resource.ts | 15 ++
src/utils/functions.ts | 6 +
src/work-list/work-list.component.tsx | 3 +-
src/work-list/work-list.resource.ts | 2 +-
yarn.lock | 148 ++++++-------
21 files changed, 438 insertions(+), 156 deletions(-)
create mode 100644 src/referred-orders/referred-orders.component.tsx
create mode 100644 src/referred-orders/referred-orders.resource.ts
create mode 100644 src/referred-orders/referred-orders.scss
diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml
index 2529dc40..7f1dbe99 100644
--- a/.github/workflows/node.js.yml
+++ b/.github/workflows/node.js.yml
@@ -1,4 +1,4 @@
-name: Node CI
+name: UgandaEMR CI
on:
push:
@@ -9,8 +9,8 @@ on:
types:
- created
env:
- ESM_NAME: "@openmrs/esm-laboratory-app"
- JS_NAME: "openmrs-esm-laboratory-app.js"
+ ESM_NAME: "@ugandaemr/esm-laboratory-app"
+ JS_NAME: "ugandaemr-esm-laboratory-app.js"
jobs:
build:
@@ -21,24 +21,24 @@ jobs:
TURBO_TEAM: ${{ github.repository_owner }}
steps:
- - uses: actions/checkout@v4
+ - uses: actions/checkout@v3
- name: Use Node.js
- uses: actions/setup-node@v4
+ uses: actions/setup-node@v3
with:
- node-version: "18"
+ node-version: "18.x"
registry-url: "https://registry.npmjs.org"
- name: Cache dependencies
id: cache
- uses: actions/cache@v4
+ uses: actions/cache@v3
with:
path: "**/node_modules"
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
-
+
- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: yarn install --immutable
-
+
- name: Setup local cache server for Turborepo
uses: felixmosh/turborepo-gh-artifacts@v2
with:
@@ -49,12 +49,11 @@ jobs:
- run: yarn turbo build --color --concurrency=5
- name: Upload Artifacts
- uses: actions/upload-artifact@v4
+ uses: actions/upload-artifact@v3
with:
name: dist
path: |
dist
- overwrite: true
pre_release:
runs-on: ubuntu-latest
@@ -64,17 +63,17 @@ jobs:
if: ${{ github.event_name == 'push' }}
steps:
- - uses: actions/checkout@v4
+ - uses: actions/checkout@v3
- name: Setup Node.js
- uses: actions/setup-node@v4
+ uses: actions/setup-node@v3
with:
- node-version: "18"
+ node-version: "18.x"
registry-url: "https://registry.npmjs.org"
- name: Cache dependencies
id: cache
- uses: actions/cache@v4
+ uses: actions/cache@v3
with:
path: "**/node_modules"
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
@@ -82,7 +81,7 @@ jobs:
- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: yarn install --immutable
-
+
- name: Setup local cache server for Turborepo
uses: felixmosh/turborepo-gh-artifacts@v2
with:
@@ -95,7 +94,7 @@ jobs:
- name: Build
run: yarn turbo build --color --concurrency=5
- - run: git config user.email "<>" && git config user.name "OpenMRS CI"
+ - run: git config user.email "<>" && git config user.name "UgandaEMR CI"
- run: git add . && git commit -m "Prerelease version" --no-verify
- name: Pre-release
@@ -104,12 +103,11 @@ jobs:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
- name: Upload Artifacts
- uses: actions/upload-artifact@v4
+ uses: actions/upload-artifact@v3
with:
name: dist
path: |
dist
- overwrite: true
release:
runs-on: ubuntu-latest
@@ -119,33 +117,33 @@ jobs:
if: ${{ github.event_name == 'release' }}
steps:
- - uses: actions/checkout@v4
+ - uses: actions/checkout@v3
- name: Download Artifacts
- uses: actions/download-artifact@v4
+ uses: actions/download-artifact@v3
- name: Setup Node.js
- uses: actions/setup-node@v4
+ uses: actions/setup-node@v3
with:
- node-version: "18"
+ node-version: "18.x"
registry-url: "https://registry.npmjs.org"
- name: Cache dependencies
id: cache
- uses: actions/cache@v4
+ uses: actions/cache@v3
with:
path: "**/node_modules"
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
-
+
- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: yarn install --immutable
-
+
- name: Setup local cache server for Turborepo
- uses: felixmosh/turborepo-gh-artifacts@v3
+ uses: felixmosh/turborepo-gh-artifacts@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
server-token: ${{ secrets.TURBO_SERVER_TOKEN }}
-
+
- run: yarn config set npmAuthToken "${NODE_AUTH_TOKEN}" && yarn npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
diff --git a/package.json b/package.json
index 9e054663..68d18b15 100644
--- a/package.json
+++ b/package.json
@@ -1,9 +1,9 @@
{
- "name": "@openmrs/esm-laboratory-app",
+ "name": "@ugandaemr/esm-laboratory-app",
"version": "1.0.0",
"license": "MPL-2.0",
"description": "Laboratory microfrontend for OpenMRS 3.x",
- "browser": "dist/openmrs-esm-laboratory-app.js",
+ "browser": "dist/ugandaemr-esm-laboratory-app.js",
"main": "src/index.ts",
"source": true,
"scripts": {
diff --git a/src/completed-list/completed-list.component.tsx b/src/completed-list/completed-list.component.tsx
index 4656adf2..9ad7ea57 100644
--- a/src/completed-list/completed-list.component.tsx
+++ b/src/completed-list/completed-list.component.tsx
@@ -22,10 +22,7 @@ import {
TableToolbarContent,
Layer,
TableToolbarSearch,
- DatePicker,
- DatePickerInput,
DataTableSkeleton,
- Tag,
} from "@carbon/react";
import styles from "./completed-list.scss";
import { getStatusColor } from "../utils/functions";
diff --git a/src/config-schema.ts b/src/config-schema.ts
index 9e76fb91..cf2cd7f9 100644
--- a/src/config-schema.ts
+++ b/src/config-schema.ts
@@ -21,6 +21,11 @@ export const configSchema = {
_default: "214e27a1-606a-4b1e-a96e-d736c87069d5",
_description: "Concept uuid for the laboratory tool encounter type.",
},
+ artCardEncounterTypeUuid: {
+ _type: Type.String,
+ _default: "8d5b2be0-c2cc-11de-8d13-0010c6dffd0f",
+ _description: "Concept uuid for the laboratory tool encounter type.",
+ },
laboratoryOrderTypeUuid: {
_type: Type.String,
_default: "52a447d3-a64a-11e3-9aeb-50e549534c5e",
diff --git a/src/index.ts b/src/index.ts
index 57eea711..2fee62aa 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -27,10 +27,10 @@ import {
} from "@openmrs/esm-patient-common-lib";
import rejectedTabComponent from "./lab-tabs/rejected-tab.component";
-const moduleName = "@openmrs/esm-laboratory-app";
+const moduleName = "@ugandaemr/esm-laboratory-app";
const options = {
- featureName: "openmrs-esm-laboratory",
+ featureName: "ugandaemr-esm-laboratory",
moduleName,
};
diff --git a/src/lab-tabs/referred-tab.component.tsx b/src/lab-tabs/referred-tab.component.tsx
index 92c99508..ebdc3ec9 100644
--- a/src/lab-tabs/referred-tab.component.tsx
+++ b/src/lab-tabs/referred-tab.component.tsx
@@ -1,13 +1,11 @@
import React from "react";
import { EmptyState } from "@openmrs/esm-patient-common-lib";
+import ReferredOrdersList from "../referred-orders/referred-orders.component";
const ReferredComponent = () => {
return (
-
+
);
};
diff --git a/src/lab-tiles/referred-tile.component.tsx b/src/lab-tiles/referred-tile.component.tsx
index 67fa6004..1bf90f31 100644
--- a/src/lab-tiles/referred-tile.component.tsx
+++ b/src/lab-tiles/referred-tile.component.tsx
@@ -1,14 +1,25 @@
import React from "react";
import { useTranslation } from "react-i18next";
import SummaryTile from "../summary-tiles/summary-tile.component";
+import { useLabTestsStats } from "../summary-tiles/laboratory-summary.resource";
const ReferredTileComponent = () => {
const { t } = useTranslation();
+ const { data } = useLabTestsStats("");
+
+ const filteredData = data?.filter(
+ (item) =>
+ item?.fulfillerStatus === "IN_PROGRESS" &&
+ item?.accessionNumber !== null &&
+ item?.dateStopped === null &&
+ item?.instructions === "REFER TO CPHL"
+ );
+
return (
);
diff --git a/src/lab-tiles/worklist-tile.component.tsx b/src/lab-tiles/worklist-tile.component.tsx
index 646ac3bd..68c4d868 100644
--- a/src/lab-tiles/worklist-tile.component.tsx
+++ b/src/lab-tiles/worklist-tile.component.tsx
@@ -12,7 +12,8 @@ const WorklistTileComponent = () => {
(item) =>
item?.fulfillerStatus === "IN_PROGRESS" &&
item?.accessionNumber !== null &&
- item?.dateStopped === null
+ item?.dateStopped === null &&
+ item?.instructions !== "REFER TO CPHL"
);
return (
diff --git a/src/patient-chart/laboratory-active-test-order/laboratory-active-test-order-results.component.tsx b/src/patient-chart/laboratory-active-test-order/laboratory-active-test-order-results.component.tsx
index 8d79188e..d31a34e9 100644
--- a/src/patient-chart/laboratory-active-test-order/laboratory-active-test-order-results.component.tsx
+++ b/src/patient-chart/laboratory-active-test-order/laboratory-active-test-order-results.component.tsx
@@ -79,8 +79,11 @@ const LaboratoryActiveTestOrderResults: React.FC<
> = ({ patientUuid }) => {
const { t } = useTranslation();
- const { enableSendingLabTestsByEmail, laboratoryEncounterTypeUuid } =
- useConfig();
+ const {
+ enableSendingLabTestsByEmail,
+ laboratoryEncounterTypeUuid,
+ artCardEncounterTypeUuid,
+ } = useConfig();
const displayText = t(
"activelLaboratoryTestsDisplayTextTitle",
@@ -94,20 +97,25 @@ const LaboratoryActiveTestOrderResults: React.FC<
patientUuid: patientUuid,
laboratoryEncounterTypeUuid: laboratoryEncounterTypeUuid,
});
+
+ console.info(items);
+
const pageSizes = [10, 20, 30, 40, 50];
const [currentPageSize, setPageSize] = useState(10);
const sortedLabRequests = useMemo(() => {
return [...items]
?.filter(
- (item) => item?.encounterType?.uuid === laboratoryEncounterTypeUuid
+ (item) =>
+ item?.encounterType?.uuid === laboratoryEncounterTypeUuid ||
+ item?.encounterType?.uuid === artCardEncounterTypeUuid
)
?.sort((a, b) => {
const dateA = new Date(a.encounterDatetime);
const dateB = new Date(b.encounterDatetime);
return dateB.getTime() - dateA.getTime();
});
- }, [items, laboratoryEncounterTypeUuid]);
+ }, [artCardEncounterTypeUuid, items, laboratoryEncounterTypeUuid]);
const [searchTerm, setSearchTerm] = useState("");
const [laboratoryOrders, setLaboratoryOrders] = useState(sortedLabRequests);
@@ -167,13 +175,6 @@ const LaboratoryActiveTestOrderResults: React.FC<
});
};
- const LaunchLabRequestForm: React.FC = () => {
- return (
-
-
-
- );
- };
const PrintButtonAction: React.FC = ({ encounter }) => {
const { patient } = useGetPatientByUuid(encounter.patient.uuid);
diff --git a/src/patient-chart/laboratory-order-referals/laboratory-order-referals.component.tsx b/src/patient-chart/laboratory-order-referals/laboratory-order-referals.component.tsx
index ed83b151..17dd000f 100644
--- a/src/patient-chart/laboratory-order-referals/laboratory-order-referals.component.tsx
+++ b/src/patient-chart/laboratory-order-referals/laboratory-order-referals.component.tsx
@@ -83,8 +83,11 @@ const LaboratoryOrderReferalResults: React.FC<
> = ({ patientUuid }) => {
const { t } = useTranslation();
- const { enableSendingLabTestsByEmail, laboratoryEncounterTypeUuid } =
- useConfig();
+ const {
+ enableSendingLabTestsByEmail,
+ laboratoryEncounterTypeUuid,
+ artCardEncounterTypeUuid,
+ } = useConfig();
const displayText = t(
"referralLaboratoryTestsDisplayTextTitle",
@@ -112,14 +115,17 @@ const LaboratoryOrderReferalResults: React.FC<
const sortedLabRequests = useMemo(() => {
return [...items]
?.filter(
- (item) => item?.encounterType?.uuid === laboratoryEncounterTypeUuid
+ (item) =>
+ (item?.encounterType?.uuid === laboratoryEncounterTypeUuid ||
+ item?.encounterType?.uuid === artCardEncounterTypeUuid) &&
+ item?.orders?.filter((item) => item?.instructions === "REFER TO CPHL")
)
?.sort((a, b) => {
const dateA = new Date(a.encounterDatetime);
const dateB = new Date(b.encounterDatetime);
return dateB.getTime() - dateA.getTime();
});
- }, [items, laboratoryEncounterTypeUuid]);
+ }, [artCardEncounterTypeUuid, items, laboratoryEncounterTypeUuid]);
const [searchTerm, setSearchTerm] = useState("");
const [laboratoryOrders, setLaboratoryOrders] = useState(sortedLabRequests);
@@ -193,13 +199,6 @@ const LaboratoryOrderReferalResults: React.FC<
);
};
- const LaunchLabRequestForm: React.FC = () => {
- return (
-
-
-
- );
- };
const PrintButtonAction: React.FC = ({ encounter }) => {
const { patient } = useGetPatientByUuid(encounter.patient.uuid);
@@ -256,8 +255,7 @@ const LaboratoryOrderReferalResults: React.FC<
{ id: 1, header: t("tests", "Tests"), key: "orders" },
{ id: 2, header: t("location", "Location"), key: "location" },
{ id: 3, header: t("status", "Status"), key: "status" },
- { id: 4, header: t("referral", "Referral"), key: "referral" },
- { id: 5, header: t("actions", "Action"), key: "actions" },
+ { id: 4, header: t("actions", "Action"), key: "actions" },
],
[t]
);
@@ -294,7 +292,6 @@ const LaboratoryOrderReferalResults: React.FC<
),
location: entry?.location?.display,
status: "--",
- referral: "--",
actions: (
= ({ patientUuid }) => {
const { t } = useTranslation();
- const { enableSendingLabTestsByEmail, laboratoryEncounterTypeUuid } =
- useConfig();
+ const {
+ enableSendingLabTestsByEmail,
+ laboratoryEncounterTypeUuid,
+ artCardEncounterTypeUuid,
+ } = useConfig();
const displayText = t(
"pastLaboratoryTestsDisplayTextTitle",
@@ -96,14 +98,16 @@ const LaboratoryPastTestOrderResults: React.FC<
const sortedLabRequests = useMemo(() => {
return [...items]
?.filter(
- (item) => item?.encounterType?.uuid === laboratoryEncounterTypeUuid
+ (item) =>
+ item?.encounterType?.uuid === laboratoryEncounterTypeUuid ||
+ item?.encounterType?.uuid === artCardEncounterTypeUuid
)
?.sort((a, b) => {
const dateA = new Date(a.encounterDatetime);
const dateB = new Date(b.encounterDatetime);
return dateB.getTime() - dateA.getTime();
});
- }, [items, laboratoryEncounterTypeUuid]);
+ }, [artCardEncounterTypeUuid, items, laboratoryEncounterTypeUuid]);
const [searchTerm, setSearchTerm] = useState("");
const [laboratoryOrders, setLaboratoryOrders] = useState(sortedLabRequests);
@@ -151,13 +155,6 @@ const LaboratoryPastTestOrderResults: React.FC<
);
};
- const LaunchLabRequestForm: React.FC = () => {
- return (
-
-
-
- );
- };
const PrintButtonAction: React.FC = ({ encounter }) => {
const { patient } = useGetPatientByUuid(encounter.patient.uuid);
diff --git a/src/referred-orders/referred-orders.component.tsx b/src/referred-orders/referred-orders.component.tsx
new file mode 100644
index 00000000..b3a08cf9
--- /dev/null
+++ b/src/referred-orders/referred-orders.component.tsx
@@ -0,0 +1,195 @@
+import React, { useMemo, useState } from "react";
+import { useGetOrdersWorklist } from "../work-list/work-list.resource";
+import { useTranslation } from "react-i18next";
+import {
+ ConfigurableLink,
+ formatDate,
+ parseDate,
+ usePagination,
+} from "@openmrs/esm-framework";
+import {
+ DataTable,
+ DataTableSkeleton,
+ Pagination,
+ Table,
+ TableBody,
+ TableCell,
+ TableContainer,
+ TableHead,
+ TableHeader,
+ TableRow,
+ TableToolbar,
+ TableToolbarContent,
+ TableToolbarSearch,
+ Layer,
+ Tile,
+} from "@carbon/react";
+import { getStatusColor } from "../utils/functions";
+import styles from "./referred-orders.scss";
+
+const ReferredOrdersList: React.FC = () => {
+ const { t } = useTranslation();
+
+ const { data: referredOrderList, isLoading } = useGetOrdersWorklist("");
+
+ const pageSizes = [10, 20, 30, 40, 50];
+ const [currentPageSize, setPageSize] = useState(10);
+
+ const filtered = referredOrderList.filter(
+ (item) =>
+ item?.fulfillerStatus === "IN_PROGRESS" &&
+ item?.accessionNumber !== null &&
+ item?.dateStopped === null &&
+ item?.instructions === "REFER TO CPHL"
+ );
+
+ const {
+ goTo,
+ results: paginatedReferredOrderEntries,
+ currentPage,
+ } = usePagination(filtered, currentPageSize);
+
+ // table columns
+ let columns = [
+ { id: 0, header: t("date", "Date"), key: "date" },
+
+ { id: 1, header: t("orderNumber", "Order Number"), key: "orderNumber" },
+ { id: 2, header: t("patient", "Patient"), key: "patient" },
+
+ {
+ id: 3,
+ header: t("accessionNumber", "Accession Number"),
+ key: "accessionNumber",
+ },
+ { id: 4, header: t("test", "Test"), key: "test" },
+ { id: 5, header: t("status", "Status"), key: "status" },
+ { id: 6, header: t("orderer", "Ordered By"), key: "orderer" },
+ { id: 7, header: t("urgency", "Urgency"), key: "urgency" },
+ ];
+ const tableRows = useMemo(() => {
+ return paginatedReferredOrderEntries.map((entry, index) => ({
+ ...entry,
+ id: entry?.uuid,
+ date: formatDate(parseDate(entry?.dateActivated)),
+ patient: (
+
+ {entry?.patient?.display.split("-")[1]}
+
+ ),
+ orderNumber: entry?.orderNumber,
+ accessionNumber: entry?.accessionNumber,
+ test: entry?.concept?.display,
+ action: entry?.action,
+ status: (
+
+ {entry?.fulfillerStatus}
+
+ ),
+ orderer: entry?.orderer?.display,
+ orderType: entry?.orderType?.display,
+ urgency: entry?.urgency,
+ }));
+ }, [paginatedReferredOrderEntries]);
+
+ if (isLoading) {
+ return ;
+ }
+
+ if (paginatedReferredOrderEntries?.length >= 0) {
+ return (
+
+ {({
+ rows,
+ headers,
+ getHeaderProps,
+ getTableProps,
+ getRowProps,
+ onInputChange,
+ }) => (
+
+
+
+
+
+
+
+
+
+
+
+ {headers.map((header) => (
+
+ {header.header?.content ?? header.header}
+
+ ))}
+
+
+
+ {rows.map((row, index) => {
+ return (
+
+
+ {row.cells.map((cell) => (
+
+ {cell.value?.content ?? cell.value}
+
+ ))}
+
+
+ );
+ })}
+
+
+ {rows.length === 0 ? (
+
+
+
+
+ {t(
+ "noWorklistsToDisplay",
+ "No worklists orders to display"
+ )}
+
+
+
+
+ ) : null}
+ {
+ if (pageSize !== currentPageSize) {
+ setPageSize(pageSize);
+ }
+ if (page !== currentPage) {
+ goTo(page);
+ }
+ }}
+ />
+
+ )}
+
+ );
+ }
+};
+
+export default ReferredOrdersList;
diff --git a/src/referred-orders/referred-orders.resource.ts b/src/referred-orders/referred-orders.resource.ts
new file mode 100644
index 00000000..e69de29b
diff --git a/src/referred-orders/referred-orders.scss b/src/referred-orders/referred-orders.scss
new file mode 100644
index 00000000..7d87c2d1
--- /dev/null
+++ b/src/referred-orders/referred-orders.scss
@@ -0,0 +1,57 @@
+@use '@carbon/styles/scss/spacing';
+@use '@carbon/styles/scss/type';
+@import "~@openmrs/esm-styleguide/src/vars";
+@import '../root.scss';
+
+.tableContainer {
+ background-color: $ui-01;
+ margin: 0 spacing.$spacing-05;
+ padding: 0;
+
+ a {
+ text-decoration: none;
+ }
+
+ th {
+ color: $text-02;
+ }
+
+ :global(.cds--data-table) {
+ background-color: $ui-03;
+ }
+
+ .toolbarContent {
+ height: spacing.$spacing-07;
+ margin-bottom: spacing.$spacing-02;
+ }
+}
+
+.activePatientsTable tr:last-of-type {
+ td {
+ border-bottom: none;
+ }
+}
+
+
+.tileContainer {
+ background-color: $ui-02;
+ border-top: 1px solid $ui-03;
+ padding: 5rem 0;
+}
+
+.tile {
+ margin: auto;
+ width: fit-content;
+}
+
+.tileContent {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+}
+
+.content {
+ @include type.type-style('heading-compact-02');
+ color: $text-02;
+ margin-bottom: 0.5rem;
+}
\ No newline at end of file
diff --git a/src/review-list/review-list.component.tsx b/src/review-list/review-list.component.tsx
index a16834ec..c3ecacd5 100644
--- a/src/review-list/review-list.component.tsx
+++ b/src/review-list/review-list.component.tsx
@@ -73,7 +73,8 @@ const ReviewList: React.FC = ({ fulfillerStatus }) => {
(item) =>
item?.action === "REVISE" &&
item?.fulfillerStatus === "IN_PROGRESS" &&
- item?.dateStopped !== null
+ item?.dateStopped !== null &&
+ item?.instructions !== "REFER TO CPHL"
);
const pageSizes = [10, 20, 30, 40, 50];
diff --git a/src/tests-ordered/lab-dialogs/add-to-worklist-dialog.component.tsx b/src/tests-ordered/lab-dialogs/add-to-worklist-dialog.component.tsx
index 4a54d99d..a7a052b3 100644
--- a/src/tests-ordered/lab-dialogs/add-to-worklist-dialog.component.tsx
+++ b/src/tests-ordered/lab-dialogs/add-to-worklist-dialog.component.tsx
@@ -21,6 +21,7 @@ import { Renew } from "@carbon/react/icons";
import {
GenerateSpecimenId,
UpdateOrder,
+ extractCapitalLetters,
useReferralLocations,
useSpecimenTypes,
} from "./add-to-worklist-dialog.resource";
@@ -67,6 +68,7 @@ const AddToWorklistDialog: React.FC = ({
specimenSourceId: specimenType,
unProcessedOrders: "",
patientQueueId: queueId,
+ referenceLab: extractCapitalLetters(selectedReferral),
};
UpdateOrder(order.uuid, body).then(
@@ -264,7 +266,7 @@ const AddToWorklistDialog: React.FC = ({
{referral.display}
diff --git a/src/tests-ordered/lab-dialogs/add-to-worklist-dialog.resource.ts b/src/tests-ordered/lab-dialogs/add-to-worklist-dialog.resource.ts
index f571eaa1..552d60c9 100644
--- a/src/tests-ordered/lab-dialogs/add-to-worklist-dialog.resource.ts
+++ b/src/tests-ordered/lab-dialogs/add-to-worklist-dialog.resource.ts
@@ -183,3 +183,18 @@ export async function GetOrderByUuid(uuid: string) {
signal: abortController.signal,
});
}
+
+export function extractCapitalLetters(statement: string): string {
+ const words = statement.split(" ");
+ let result = "";
+
+ for (const word of words) {
+ for (const char of word) {
+ if (char >= "A" && char <= "Z") {
+ result += char;
+ }
+ }
+ }
+
+ return result;
+}
diff --git a/src/utils/functions.ts b/src/utils/functions.ts
index 03a2383a..3b101307 100644
--- a/src/utils/functions.ts
+++ b/src/utils/functions.ts
@@ -260,6 +260,12 @@ export function OrderTagStyle(order: any) {
color: "white",
};
+ case "DECLINED" || "EXCEPTION":
+ return {
+ background: "red",
+ color: "white",
+ };
+
default:
return {
background: "gray",
diff --git a/src/work-list/work-list.component.tsx b/src/work-list/work-list.component.tsx
index 82dca021..52e1366d 100644
--- a/src/work-list/work-list.component.tsx
+++ b/src/work-list/work-list.component.tsx
@@ -63,7 +63,8 @@ const WorkList: React.FC = ({ fulfillerStatus }) => {
(item) =>
item?.fulfillerStatus === "IN_PROGRESS" &&
item?.accessionNumber !== null &&
- item?.dateStopped === null
+ item?.dateStopped === null &&
+ item?.instructions !== "REFER TO CPHL"
);
const {
diff --git a/src/work-list/work-list.resource.ts b/src/work-list/work-list.resource.ts
index bee7e767..42f3708f 100644
--- a/src/work-list/work-list.resource.ts
+++ b/src/work-list/work-list.resource.ts
@@ -21,7 +21,7 @@ export interface Result {
orderReasonNonCoded: any;
orderType: OrderType;
urgency: string;
- instructions: any;
+ instructions: string;
commentToFulfiller: any;
display: string;
auditInfo: AuditInfo;
diff --git a/yarn.lock b/yarn.lock
index c759919e..45a87a2e 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -4196,80 +4196,6 @@ __metadata:
languageName: node
linkType: hard
-"@openmrs/esm-laboratory-app@workspace:.":
- version: 0.0.0-use.local
- resolution: "@openmrs/esm-laboratory-app@workspace:."
- dependencies:
- "@carbon/react": "npm:^1.14.0"
- "@hookform/resolvers": "npm:^3.3.4"
- "@ohri/openmrs-esm-ohri-commons-lib": "npm:next"
- "@openmrs/esm-extensions": "npm:next"
- "@openmrs/esm-framework": "npm:next"
- "@openmrs/esm-patient-common-lib": "npm:next"
- "@openmrs/esm-react-utils": "npm:next"
- "@openmrs/esm-styleguide": "npm:next"
- "@swc/cli": "npm:^0.1.62"
- "@swc/core": "npm:^1.3.62"
- "@swc/jest": "npm:^0.2.26"
- "@testing-library/dom": "npm:^8.20.0"
- "@testing-library/jest-dom": "npm:^5.16.5"
- "@testing-library/react": "npm:^13.4.0"
- "@testing-library/user-event": "npm:^14.4.3"
- "@types/jest": "npm:^28.1.8"
- "@types/react": "npm:^18.2.8"
- "@types/react-dom": "npm:^18.2.4"
- "@types/react-router": "npm:^5.1.20"
- "@types/react-router-dom": "npm:^5.3.3"
- "@types/webpack-env": "npm:^1.18.1"
- "@typescript-eslint/parser": "npm:^5.59.9"
- carbon-components-react: "npm:^8.34.0"
- concurrently: "npm:^7.6.0"
- css-loader: "npm:^6.8.1"
- dayjs: "npm:^1.11.9"
- eslint: "npm:^8.42.0"
- eslint-config-prettier: "npm:^8.8.0"
- eslint-config-ts-react-important-stuff: "npm:^3.0.0"
- eslint-plugin-prettier: "npm:^4.2.1"
- file-saver: "npm:^2.0.5"
- husky: "npm:^8.0.0"
- identity-obj-proxy: "npm:^3.0.0"
- jest: "npm:^28.1.3"
- jest-cli: "npm:^28.1.3"
- jest-environment-jsdom: "npm:^28.1.3"
- lerna: "npm:^5.6.1"
- lodash-es: "npm:^4.17.21"
- openmrs: "npm:next"
- plotly.js: "npm:^2.24.3"
- prettier: "npm:^2.8.8"
- pretty-quick: "npm:^3.1.3"
- raw-loader: "npm:^4.0.2"
- react: "npm:^18.2.0"
- react-csv: "npm:^2.2.2"
- react-dom: "npm:^18.2.0"
- react-hook-form: "npm:^7.49.3"
- react-i18next: "npm:^11.18.6"
- react-pivottable: "npm:^0.11.0"
- react-plotly.js: "npm:^2.0.0"
- react-router-dom: "npm:^6.11.2"
- react-table: "npm:^7.8.0"
- react-to-print: "npm:^2.14.15"
- rxjs: "npm:^6.6.7"
- swc-loader: "npm:^0.2.3"
- turbo: "npm:^1.10.12"
- typescript: "npm:^4.9.5"
- webpack: "npm:^5.88.1"
- webpack-cli: "npm:^5.1.3"
- zod: "npm:^3.22.4"
- peerDependencies:
- "@openmrs/esm-framework": "*"
- dayjs: 1.x
- react: 18.x
- react-i18next: 11.x
- react-router-dom: 6.x
- rxjs: 6.x
- languageName: unknown
- linkType: soft
-
"@openmrs/esm-navigation@npm:5.4.1-pre.1579":
version: 5.4.1-pre.1579
resolution: "@openmrs/esm-navigation@npm:5.4.1-pre.1579"
@@ -6696,6 +6622,80 @@ __metadata:
languageName: node
linkType: hard
+"@ugandaemr/esm-laboratory-app@workspace:.":
+ version: 0.0.0-use.local
+ resolution: "@ugandaemr/esm-laboratory-app@workspace:."
+ dependencies:
+ "@carbon/react": "npm:^1.14.0"
+ "@hookform/resolvers": "npm:^3.3.4"
+ "@ohri/openmrs-esm-ohri-commons-lib": "npm:next"
+ "@openmrs/esm-extensions": "npm:next"
+ "@openmrs/esm-framework": "npm:next"
+ "@openmrs/esm-patient-common-lib": "npm:next"
+ "@openmrs/esm-react-utils": "npm:next"
+ "@openmrs/esm-styleguide": "npm:next"
+ "@swc/cli": "npm:^0.1.62"
+ "@swc/core": "npm:^1.3.62"
+ "@swc/jest": "npm:^0.2.26"
+ "@testing-library/dom": "npm:^8.20.0"
+ "@testing-library/jest-dom": "npm:^5.16.5"
+ "@testing-library/react": "npm:^13.4.0"
+ "@testing-library/user-event": "npm:^14.4.3"
+ "@types/jest": "npm:^28.1.8"
+ "@types/react": "npm:^18.2.8"
+ "@types/react-dom": "npm:^18.2.4"
+ "@types/react-router": "npm:^5.1.20"
+ "@types/react-router-dom": "npm:^5.3.3"
+ "@types/webpack-env": "npm:^1.18.1"
+ "@typescript-eslint/parser": "npm:^5.59.9"
+ carbon-components-react: "npm:^8.34.0"
+ concurrently: "npm:^7.6.0"
+ css-loader: "npm:^6.8.1"
+ dayjs: "npm:^1.11.9"
+ eslint: "npm:^8.42.0"
+ eslint-config-prettier: "npm:^8.8.0"
+ eslint-config-ts-react-important-stuff: "npm:^3.0.0"
+ eslint-plugin-prettier: "npm:^4.2.1"
+ file-saver: "npm:^2.0.5"
+ husky: "npm:^8.0.0"
+ identity-obj-proxy: "npm:^3.0.0"
+ jest: "npm:^28.1.3"
+ jest-cli: "npm:^28.1.3"
+ jest-environment-jsdom: "npm:^28.1.3"
+ lerna: "npm:^5.6.1"
+ lodash-es: "npm:^4.17.21"
+ openmrs: "npm:next"
+ plotly.js: "npm:^2.24.3"
+ prettier: "npm:^2.8.8"
+ pretty-quick: "npm:^3.1.3"
+ raw-loader: "npm:^4.0.2"
+ react: "npm:^18.2.0"
+ react-csv: "npm:^2.2.2"
+ react-dom: "npm:^18.2.0"
+ react-hook-form: "npm:^7.49.3"
+ react-i18next: "npm:^11.18.6"
+ react-pivottable: "npm:^0.11.0"
+ react-plotly.js: "npm:^2.0.0"
+ react-router-dom: "npm:^6.11.2"
+ react-table: "npm:^7.8.0"
+ react-to-print: "npm:^2.14.15"
+ rxjs: "npm:^6.6.7"
+ swc-loader: "npm:^0.2.3"
+ turbo: "npm:^1.10.12"
+ typescript: "npm:^4.9.5"
+ webpack: "npm:^5.88.1"
+ webpack-cli: "npm:^5.1.3"
+ zod: "npm:^3.22.4"
+ peerDependencies:
+ "@openmrs/esm-framework": "*"
+ dayjs: 1.x
+ react: 18.x
+ react-i18next: 11.x
+ react-router-dom: 6.x
+ rxjs: 6.x
+ languageName: unknown
+ linkType: soft
+
"@ungap/structured-clone@npm:^1.2.0":
version: 1.2.0
resolution: "@ungap/structured-clone@npm:1.2.0"