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

Labs #9260

Draft
wants to merge 151 commits into
base: develop
Choose a base branch
from
Draft

Labs #9260

Show file tree
Hide file tree
Changes from 110 commits
Commits
Show all changes
151 commits
Select commit Hold shift + click to select a range
22994f9
Add lab tests translation and sidebar navigation item
yash-learner Nov 26, 2024
e5e36d4
Add Lab Test routes and component for lab orders
yash-learner Nov 26, 2024
2f5f4d6
Get tabs working
yash-learner Nov 26, 2024
77f3368
Add @tanstack/react-table package
yash-learner Nov 27, 2024
a6868ba
Add shadcn Input and Table components
yash-learner Nov 27, 2024
8a8c6f3
WIP get table structure
yash-learner Nov 27, 2024
43b867b
WIP: get a basic structure for filtering
yash-learner Nov 28, 2024
cf8a514
Add shadcn separator
yash-learner Nov 29, 2024
a72e921
Add primary button variant styles
yash-learner Nov 29, 2024
a3a0795
Enhance TableFilter component with separators and clear filters funct…
yash-learner Nov 29, 2024
18c768e
Update OrderPlaced component layout with improved spacing
yash-learner Nov 29, 2024
60ae09c
Add shadcn Badge component
yash-learner Nov 30, 2024
d51bbff
Enhance DataTable component to support badge rendering for specific c…
yash-learner Nov 30, 2024
da56b83
Refactor OrderPlaced component to enhance filtering and add action bu…
yash-learner Nov 30, 2024
f6d6aab
Add shadcn Label and Radio Group components
yash-learner Nov 30, 2024
4c3530a
Add radio button support to TableFilter component
yash-learner Nov 30, 2024
1d08121
Add priority radio filter to OrderPlaced component and update initial…
yash-learner Nov 30, 2024
2c7b06b
WIP: support multi select
yash-learner Dec 1, 2024
9cb2081
Add shadcn Card and Collapsible components
yash-learner Dec 3, 2024
f39490c
WIP: Collect specimen page
yash-learner Dec 3, 2024
462c3ae
Add sample collection UI and refactors
yash-learner Dec 5, 2024
59e18d4
Fix layout alignment
yash-learner Dec 5, 2024
129d3fa
Add barcode SVG icon
yash-learner Dec 8, 2024
7caaa65
Add more UI elements
yash-learner Dec 8, 2024
c245b20
Add SendSpecimen route and enhance SpecimenCollected component
yash-learner Dec 8, 2024
26913b9
Rename page title from "Lab Tests" to "Lab Orders"
yash-learner Dec 8, 2024
cc466a9
Add SendSpecimen component for specimen dispatch functionality
yash-learner Dec 8, 2024
300de49
Add recieve state components
yash-learner Dec 8, 2024
6c0fecd
Remove mock labs data from ReceiveSpecimen component
yash-learner Dec 8, 2024
caf36b7
Get remote button working and move some values
yash-learner Dec 9, 2024
18653e7
Replace Cross2Icon with CrossCircledIcon
yash-learner Dec 9, 2024
8806e57
Add more UI elements in ReceiveSpecimen
yash-learner Dec 9, 2024
0bd7f74
Merge branch 'develop' into issues/8683/lab-orders
yash-learner Dec 10, 2024
4e304d6
Remove duplicate primary button variant
yash-learner Dec 10, 2024
e7ba845
Make input work with changes came from develop remote
yash-learner Dec 10, 2024
60689c9
Update sidebar icon for lab tests to use duotone microscope
yash-learner Dec 10, 2024
200c632
Add SentToLab component
yash-learner Dec 10, 2024
902cac6
Add received badge style to DataTable component
yash-learner Dec 10, 2024
af5d02d
Minor Changes
yash-learner Dec 10, 2024
b91e00e
Add basic Process speciem UI elements
yash-learner Dec 10, 2024
6a8e632
Move buttons to buttom
yash-learner Dec 10, 2024
66a6a0e
added create lab order form, lab order code select and wired them
khavinshankar Dec 10, 2024
b4eb957
Add results table
yash-learner Dec 10, 2024
5802c0a
added list service requests component
khavinshankar Dec 10, 2024
51b3484
Merge branch 'issues/8683/lab-orders' of github.com:yash-learner/care…
khavinshankar Dec 10, 2024
6b813a9
wired labs flow till results entry
khavinshankar Dec 11, 2024
f8844e7
Add static Aliquot creation component
yash-learner Dec 11, 2024
d6cc353
Add static select analyzer
yash-learner Dec 11, 2024
6da9f74
WIP: Improve the timeline styling
yash-learner Dec 13, 2024
d1b7f5b
Add clock history SVG icon
yash-learner Dec 13, 2024
2c5beff
Add static Review result page
yash-learner Dec 13, 2024
ec26c1f
Add more static UI
yash-learner Dec 13, 2024
783cf01
wired labs review flow
khavinshankar Dec 15, 2024
afcfd70
Merge branch 'develop' into issues/8683/lab-orders
yash-learner Dec 15, 2024
ec119e2
Wire note and priority
yash-learner Dec 15, 2024
a405ee4
Add utility function to map keys to Badge variants
yash-learner Dec 15, 2024
96a00f6
Implement priority badge variant mapping
yash-learner Dec 15, 2024
692ecbc
Add new badge variants
yash-learner Dec 17, 2024
13de824
Update priority variant mapping and enhance Badge styling
yash-learner Dec 17, 2024
5394951
Imrpove styling
yash-learner Dec 17, 2024
0543496
Improve styling of the specimen collection
yash-learner Dec 18, 2024
44f81b1
Add ResultTable component
yash-learner Dec 18, 2024
8df9d4b
Use extracted out ResultTable
yash-learner Dec 18, 2024
dffbb5e
Add shadcn sekeleton loading
yash-learner Dec 21, 2024
548b4cd
Add DataTableSkeleton component
yash-learner Dec 21, 2024
cb70ec5
Add table skeleton loading to all the tabs
yash-learner Dec 21, 2024
2f80f46
Add skeleton loading for ListEncounter
yash-learner Dec 22, 2024
9fec8ae
Remove @tanstack/react-table for now
yash-learner Dec 23, 2024
c14c33e
Merge branch 'develop' into issues/8683/lab-orders
yash-learner Dec 23, 2024
0c1ecef
Run npm run install-all
yash-learner Dec 23, 2024
3affc0f
Wire and UI changes
yash-learner Dec 23, 2024
65fdbb3
Wire and reduce code repetition
yash-learner Dec 24, 2024
f287897
Extract out the timeline into a component and make it dynamic
yash-learner Dec 24, 2024
229a4d0
WIP: Use extracted out timeline
yash-learner Dec 24, 2024
ad51d1d
Use dynamic ServiceRequestTimeline component in result component
yash-learner Dec 25, 2024
7087c04
WIP: Wiring remaining steps in collect
yash-learner Dec 25, 2024
64db5d3
Add empty message to DataTable component
yash-learner Dec 26, 2024
c207020
Use tanstack useQuery
yash-learner Dec 26, 2024
ba1b276
Use tanstack useMutation
yash-learner Dec 26, 2024
4eed610
Conditionally render Collapsible for consolidated report
yash-learner Dec 26, 2024
986a4fa
Extract out the Consolidated result collapsabile into a component
yash-learner Dec 27, 2024
4b74345
Refactor ReviewResult to use ConsolidatedTestResults component and re…
yash-learner Dec 27, 2024
7661154
Add note field to DiagnosticReport request type
yash-learner Dec 27, 2024
e0216e9
Fix note field rendering to handle undefined text value
yash-learner Dec 27, 2024
f4fd9d4
Slice the order id
yash-learner Dec 27, 2024
02b6195
added lab apis and lab order tabs structure
khavinshankar Jan 4, 2025
eadc061
added lab order question along with types
khavinshankar Jan 5, 2025
f44f59c
added encounter lab orders list
khavinshankar Jan 5, 2025
9a09fa2
added collect specimen page and respective components
khavinshankar Jan 6, 2025
cfdb9b6
added all the lab order tabs
khavinshankar Jan 6, 2025
88406e0
added send specimen page (partially done)
khavinshankar Jan 6, 2025
752d7a7
Merge branch 'labs-final' into issues/8683/lab-orders
yash-learner Jan 6, 2025
1e5c277
Clean up after merge of labs-final
yash-learner Jan 6, 2025
62e7781
add lab_tests link to sidebar navigation
yash-learner Jan 6, 2025
a8391e4
add localization strings for lab order tabs
yash-learner Jan 6, 2025
875d3cb
add specimen collection localization and priority color coding in lab…
yash-learner Jan 6, 2025
c32e659
Re-wire all priority badges in all tabs
yash-learner Jan 6, 2025
4c3a8a6
Re-wire the sendspecimen
yash-learner Jan 6, 2025
818c2e0
Merge branch 'develop' into issues/8683/lab-orders
yash-learner Jan 6, 2025
df85fbb
Add SpecimenInfoCard
yash-learner Jan 7, 2025
7f0bd4f
Add half circle icon
yash-learner Jan 7, 2025
f6e4e64
Make service request timeline work with multiple orders and re-wire m…
yash-learner Jan 7, 2025
9219d87
WIP: re-wiring the Receive Specimen
yash-learner Jan 7, 2025
1e0a9f8
WIP: re-wiring & re-refactoring the Process specimen
yash-learner Jan 7, 2025
06566d9
Merge branch 'develop' into issues/8683/lab-orders
yash-learner Jan 8, 2025
a0378bf
Add lab tests link to facility navigation
yash-learner Jan 8, 2025
1a0adeb
WIP: Re-wire refactor process specimen
yash-learner Jan 8, 2025
586da36
WIP: lot of re-wiring, re-factor
yash-learner Jan 10, 2025
6d3f6a0
WIP: Lot of re-wiring re-factor
yash-learner Jan 10, 2025
86575c5
WIP: refactor re-wire
yash-learner Jan 13, 2025
6928cb1
Extract out form and card
yash-learner Jan 14, 2025
fcc7f7d
Refactor specimen integrity form schema and improve barcode input han…
yash-learner Jan 14, 2025
eca77f7
Add optional note input to specimen integrity form and update display…
yash-learner Jan 14, 2025
c9e1be5
Tiny clean up
yash-learner Jan 14, 2025
3c83300
Rename LabObservationQuestion to DiagnosticReportForm and update imports
yash-learner Jan 14, 2025
1d5676f
Tiny clean up
yash-learner Jan 14, 2025
d3bbfc5
Merge branch 'develop' into issues/8683/lab-orders
yash-learner Jan 14, 2025
86a8edb
This method somehow got missed while merging develop
yash-learner Jan 15, 2025
e90ecbc
Wire the organization for lab
yash-learner Jan 15, 2025
2030406
Small clean up
yash-learner Jan 15, 2025
3232ac8
Refactor SendSpecimenForm to use translation for form validation and …
yash-learner Jan 15, 2025
35f5300
WIP: use zod & shadcn form for diagnosticreport form
yash-learner Jan 16, 2025
aff11f2
Add utility functions to display patient name and ID
yash-learner Jan 16, 2025
a0001f9
Update barcode input placeholder for clarity
yash-learner Jan 16, 2025
f607ee6
Improve UI/UX & add i18ln keys
yash-learner Jan 16, 2025
a3afded
Tiny changes
yash-learner Jan 16, 2025
95d6a7b
Add displayPriority utility function
yash-learner Jan 16, 2025
1f02c25
Wire displaying with util functions
yash-learner Jan 16, 2025
94bf3f6
Enhance specimen condition validation and improve form layout
yash-learner Jan 16, 2025
7ea4297
Use cn
yash-learner Jan 16, 2025
f3bd1f1
Add Results and wip add loading animation
yash-learner Jan 16, 2025
8e2f067
Temp fix need to replace with phase
yash-learner Jan 16, 2025
c7c7979
Extract patient Details into a component
yash-learner Jan 17, 2025
060a235
Use PatientDetails component
yash-learner Jan 17, 2025
4fb62e8
Enhance button styling in Results and ReviewResult components
yash-learner Jan 17, 2025
0d7fd02
Refactor ReviewResult component to use shadcn form & zod for conclusi…
yash-learner Jan 18, 2025
e8b63f0
Refactor Results component to use query for fetching diagnostic repor…
yash-learner Jan 18, 2025
2644385
Add loading indicators to forms and buttons in Lab components
yash-learner Jan 18, 2025
6ee8698
Fix linting errors
yash-learner Jan 19, 2025
f0b3ea3
Merge branch 'develop' into issues/8683/lab-orders
yash-learner Jan 19, 2025
5668e40
Add service request phases and corresponding display labels and colors
yash-learner Jan 20, 2025
002d239
Enhance EncounterLabOrdersList to display priority and phase with cor…
yash-learner Jan 20, 2025
73c0274
Remove some styles in badge
yash-learner Jan 20, 2025
9c02cc8
Add loading skeletons to CollectSpecimenFormCard during specimen coll…
yash-learner Jan 20, 2025
301a71b
Add loading skeletons to CollectSpecimen component
yash-learner Jan 20, 2025
97f0a01
Small cleanup
yash-learner Jan 20, 2025
8cf93fb
Enhance LabObservationItem to include tooltips for unit selection and…
yash-learner Jan 21, 2025
eae70d9
Wire units properly
yash-learner Jan 21, 2025
1d56ef1
Add loading skeleton to ResultTable for pending state
yash-learner Jan 21, 2025
1fa99f4
Improve validation to unit code in DiagnosticReportForm
yash-learner Jan 21, 2025
07a9e18
Update resulttable to handle the units and results
yash-learner Jan 21, 2025
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
41 changes: 41 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
"@sentry/browser": "^8.47.0",
"@tanstack/react-query": "^5.62.8",
"@tanstack/react-query-devtools": "^5.62.15",
"@tanstack/react-table": "^8.20.6",
"@vitejs/plugin-react": "^4.3.4",
"@yudiel/react-qr-scanner": "^2.1.0",
"bowser": "^2.11.0",
Expand Down
7 changes: 7 additions & 0 deletions public/images/barcode.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions public/images/clock_history.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions public/images/filter.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions public/images/half_circle.svg
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove these svgs, let's use library icons as much as possible,

Also, this half circle should be implemented as logic, should be dynamic

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions public/locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
"ENCOUNTER_TAB__abdm": "ABDM Records",
"ENCOUNTER_TAB__feed": "Feed",
"ENCOUNTER_TAB__files": "Files",
"ENCOUNTER_TAB__lab_orders": "Lab Orders",
"ENCOUNTER_TAB__medicines": "Medicines",
"ENCOUNTER_TAB__neurological_monitoring": "Neuro",
"ENCOUNTER_TAB__notes": "Notes",
Expand Down Expand Up @@ -555,6 +556,8 @@
"close": "Close",
"close_scanner": "Close Scanner",
"collapse_sidebar": "Collapse Sidebar",
"collect": "Collect",
"collect_specimen": "Collect Specimen",
"comment_added_successfully": "Comment added successfully",
"comment_min_length": "Comment Should Contain At Least 1 Character",
"comments": "Comments",
Expand Down Expand Up @@ -1035,6 +1038,7 @@
"icmr_specimen_referral_form": "ICMR Specimen Referral Form",
"immunisation-records": "Immunisation",
"in_consultation": "In-Consultation",
"in_process": "In Process",
"incomplete_patient_details_warning": "Patient details are incomplete. Please update the details before proceeding.",
"inconsistent_dosage_units_error": "Dosage units must be same",
"indian_mobile": "Indian Mobile",
Expand Down Expand Up @@ -1322,6 +1326,7 @@
"optional": "Optional",
"oral_issue_for_non_oral_nutrition_route_error": "Can be specified only if nutrition route is set to Oral",
"ordering": "Ordering",
"orders_placed": "Orders Placed",
"organization": "Organization",
"organization_access_help": "Organizations help you manage facilities, users, and resources efficiently. Contact your administrator to get access.",
"organization_for_care_support": "Organization for Care Support",
Expand Down Expand Up @@ -1486,6 +1491,7 @@
"prn_prescriptions": "PRN Prescriptions",
"procedure_suggestions": "Procedure Suggestions",
"procedures_select_placeholder": "Select procedures to add details",
"process": "Process",
"process_transcript": "Process Again",
"professional_info": "Professional Information",
"professional_info_note": "View or update user's professional information",
Expand Down Expand Up @@ -1516,6 +1522,8 @@
"reason_for_shift": "Reason for shift",
"reason_for_visit": "Reason for visit",
"reason_for_visit_placeholder": "Type the reason for booking appointment",
"receive_at_lab": "Receive at Lab",
"received_at_lab": "Received at Lab",
"recommended_aspect_ratio_for": "Recommended aspect ratio for",
"record": "Record Audio",
"record_delete_confirm": "Are you sure you want to delete this record?",
Expand Down Expand Up @@ -1577,6 +1585,7 @@
"result_date": "Result Date",
"result_details": "Result details",
"result_on": "Result on",
"results": "Results",
"resume": "Resume",
"retake": "Retake",
"retake_recording": "Retake Recording",
Expand All @@ -1586,6 +1595,9 @@
"return_to_patient_dashboard": "Return to Patient Dashboard",
"review_before": "Review Before",
"review_missed": "Review Missed",
"review": "Review",
"review_required": "Review Required",
"review_result": "Review Result",
"revoked_on": "Revoked On",
"right": "Right",
"role": "Role",
Expand Down Expand Up @@ -1662,6 +1674,8 @@
"send_reset_link": "Send Reset Link",
"send_sample_to_collection_centre_description": "Are you sure you want to send the sample to Collection Centre?",
"send_sample_to_collection_centre_title": "Send sample to collection centre",
"send_to_lab": "Send to Lab",
"sent_to_lab": "Sent to Lab",
"serial_number": "Serial Number",
"serviced_on": "Serviced on",
"session_expired": "Session Expired",
Expand Down Expand Up @@ -1704,12 +1718,14 @@
"something_wrong": "Something went wrong! Try again later!",
"sort_by": "Sort By",
"source": "Source",
"specimen_collected": "Specimen Collected",
"spokes": "Spoke Facilities",
"srf_id": "SRF ID",
"staff_list": "Staff List",
"start_consultation": "Start Consultation",
"start_datetime": "Start Date/Time",
"start_dosage": "Start Dosage",
"start_processing": "Start Processing",
"start_review": "Start Review",
"state": "State",
"status": "Status",
Expand Down Expand Up @@ -1789,6 +1805,7 @@
"unassign": "Unassign",
"unconfirmed": "Unconfirmed",
"unique_id": "Unique Id",
"unit": "Unit",
"unknown": "Unknown",
"unlink_asset_bed_and_presets": "Delete linked presets and unlink bed",
"unlink_asset_bed_caution": "This action will also delete all presets that are associated to this camera and bed.",
Expand Down Expand Up @@ -1879,6 +1896,7 @@
"ventilator_oxygen_modality_oxygen_rate": "Oxygen Flow Rate",
"ventilator_spo2": "SpO₂",
"verify_and_link": "Verify and Link",
"verify_diagnostic_report_success": "Result approved successfully, and result is under review",
"verify_otp": "Verify OTP",
"verify_otp_error": "Failed to verify OTP. Please try again later.",
"verify_otp_success": "OTP has been verified successfully.",
Expand Down
2 changes: 2 additions & 0 deletions src/Routers/AppRouter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { usePluginRoutes } from "@/hooks/useCareApps";

import ConsultationRoutes from "@/Routers/routes/ConsultationRoutes";
import FacilityRoutes from "@/Routers/routes/FacilityRoutes";
import LabRoutes from "@/Routers/routes/LabRoutes";
import PatientRoutes from "@/Routers/routes/PatientRoutes";
import ResourceRoutes from "@/Routers/routes/ResourceRoutes";
import UserRoutes from "@/Routers/routes/UserRoutes";
Expand Down Expand Up @@ -56,6 +57,7 @@ const Routes: AppRoutes = {
...UserRoutes,
...OrganizationRoutes,
...QuestionnaireRoutes,
...LabRoutes,

"/session-expired": () => <SessionExpired />,
"/not-found": () => <ErrorPage />,
Expand Down
33 changes: 33 additions & 0 deletions src/Routers/routes/LabRoutes.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { LABS_BASE_ROUTE } from "@/components/Lab/constants";
import { CollectSpecimen } from "@/components/Lab/pages/CollectSpecimen";
import LabOrderTabs from "@/components/Lab/pages/LabOrderTabs";
import ReviewRequired from "@/components/Lab/pages/LabOrderTabs/ReviewRequired";
import { ProcessSpecimen } from "@/components/Lab/pages/ProcessSpecimen";
import { ReceiveSpecimen } from "@/components/Lab/pages/ReceiveSpecimen";
import { ReviewResult } from "@/components/Lab/pages/ReviewResult";
import SendSpecimen from "@/components/Lab/pages/SendSpecimen";

import { AppRoutes } from "@/Routers/AppRouter";

const LabRoutes: AppRoutes = {
[`${LABS_BASE_ROUTE}/process`]: () => <ProcessSpecimen />,
[`${LABS_BASE_ROUTE}/send_to_lab`]: () => <SendSpecimen />,
[`${LABS_BASE_ROUTE}/receive_at_lab`]: () => <ReceiveSpecimen />,
[`${LABS_BASE_ROUTE}`]: () => <LabOrderTabs />,
[`${LABS_BASE_ROUTE}/:tab`]: () => <LabOrderTabs />,
[`${LABS_BASE_ROUTE}/:encounterId/collect`]: ({ encounterId }) => (
<CollectSpecimen encounterId={encounterId} />
),
[`${LABS_BASE_ROUTE}/:specimenId/process`]: ({ specimenId }) => (
<ProcessSpecimen specimenId={specimenId} />
),
[`${LABS_BASE_ROUTE}/:diagnosticReportId/review`]: ({
diagnosticReportId,
}) => <ReviewResult diagnosticReportId={diagnosticReportId} />,

[`${LABS_BASE_ROUTE}/:diagnosticReportId/result`]: ({
diagnosticReportId,
}) => <ReviewResult diagnosticReportId={diagnosticReportId} />,
};

export default LabRoutes;
16 changes: 16 additions & 0 deletions src/Utils/badgeUtils.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { BadgeProps } from "@/components/ui/badge";

/**
* Dynamically maps keys to Badge variants using a provided mapping object.
*
* @param key - The key to map (e.g., "routine", "asap").
* @param mapping - The mapping object that links keys to Badge variants.
* @param defaultVariant - A fallback variant to use if the key is not found.
*/
export const mapKeyToBadgeVariant = (
key: string | undefined,
mapping: Record<string, BadgeProps["variant"]>,
defaultVariant: BadgeProps["variant"] = "default",
): BadgeProps["variant"] => {
return mapping[key?.toLowerCase() || ""] || defaultVariant;
};
Loading