Skip to content

Commit

Permalink
add specimen collection localization and priority color coding in lab…
Browse files Browse the repository at this point in the history
… orders
  • Loading branch information
yash-learner committed Jan 6, 2025
1 parent a8391e4 commit 875d3cb
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
1 change: 1 addition & 0 deletions public/locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,7 @@
"close": "Close",
"close_scanner": "Close Scanner",
"collapse_sidebar": "Collapse Sidebar",
"collect_specimen": "Collect Specimen",
"comment_added_successfully": "Comment added successfully",
"comment_min_length": "Comment Should Contain At Least 1 Character",
"comments": "Comments",
Expand Down
12 changes: 10 additions & 2 deletions src/components/Lab/pages/LabOrderTabs/OrdersPlaced.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { displayCode } from "@/Utils/utils";
import { Specimen } from "@/types/emr/specimen";

import { displayServiceRequestId, displaySpecimenId } from "../../utils";
import { getPriorityColor } from "./index";

export default function OrdersPlaced() {
const { t } = useTranslation();
Expand Down Expand Up @@ -49,7 +50,14 @@ export default function OrdersPlaced() {
},
{
header: "Priority",
cell: ({ row }) => <Badge>{row.original.request.priority}</Badge>,
cell: ({ row }) => (
<Badge
className={getPriorityColor(row.original.request.priority)}
variant="outline"
>
{row.original.request.priority}
</Badge>
),
},
{
header: "Action",
Expand All @@ -58,7 +66,7 @@ export default function OrdersPlaced() {
onClick={() =>
navigate(`/lab_orders/${row.original.request.encounter.id}/collect`)
}
variant="secondary"
variant="outline_primary"
>
{t("collect_specimen")}
</Button>
Expand Down
15 changes: 15 additions & 0 deletions src/components/Lab/pages/LabOrderTabs/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,21 @@ const labOrderTabs = [
},
];

export const getPriorityColor = (priority: string | undefined) => {
switch (priority) {
case "routine":
return "bg-blue-100 text-blue-800";
case "asap":
return "bg-yellow-100 text-yellow-800";
case "urgent":
return "bg-orange-100 text-orange-800";
case "stat":
return "bg-red-100 text-red-800";
default:
return "bg-gray-100 text-gray-800";
}
};

export default function LabOrdersTab() {
const { t } = useTranslation();
const currentPath = usePath();
Expand Down

0 comments on commit 875d3cb

Please sign in to comment.