Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
5fcab8e
ENG-500 Support for creating multiple diagnostic reports in a service…
NikhilA8606 Jun 16, 2026
a8f3809
Merge branch 'develop' into ENG-500-support-for-creating-multiple-dia…
NikhilA8606 Jun 19, 2026
7df41e2
applied grayish to notReviewable tests
NikhilA8606 Jun 19, 2026
0d1dc49
Merge branch 'ENG-500-support-for-creating-multiple-diagnostic-report…
NikhilA8606 Jun 19, 2026
f28b7f1
copilot and greptile suggestions
NikhilA8606 Jun 23, 2026
29314ad
Merge branch 'develop' into ENG-500-support-for-creating-multiple-dia…
NikhilA8606 Jun 23, 2026
13acde3
ai suggestions
NikhilA8606 Jun 25, 2026
af5db1b
test fix
NikhilA8606 Jun 25, 2026
41bb2fa
cleanups
NikhilA8606 Jun 25, 2026
af05e7b
corrected toast
NikhilA8606 Jun 26, 2026
db602f2
requested changes
NikhilA8606 Jun 27, 2026
e2537fc
removed onError handler
NikhilA8606 Jun 29, 2026
8614e10
Copilot suggestions
NikhilA8606 Jul 1, 2026
76861d6
added view all report
NikhilA8606 Jul 5, 2026
0e5afd5
cleanups
NikhilA8606 Jul 6, 2026
f011c4e
removed org routes
NikhilA8606 Jul 6, 2026
d55cc57
revert the facility route
NikhilA8606 Jul 7, 2026
88ef689
revert the facility route
NikhilA8606 Jul 7, 2026
f15ef2e
minor cleanups
NikhilA8606 Jul 8, 2026
257deb5
Copilot suggestions
NikhilA8606 Jul 8, 2026
8cc6d10
resolved merge conflicts
NikhilA8606 Jul 9, 2026
ac46a03
review and product suggestions
NikhilA8606 Jul 12, 2026
24b2c55
Resolved merge conflicts
NikhilA8606 Jul 12, 2026
8fb53bf
resolved copilot suggestions
NikhilA8606 Jul 12, 2026
53d39eb
fix print page error
NikhilA8606 Jul 12, 2026
3cea86c
cleanup observation history
NikhilA8606 Jul 13, 2026
cca7592
Merge branch 'develop' into ENG-500-support-for-creating-multiple-dia…
NikhilA8606 Jul 13, 2026
79ff661
Copilot suggestions
NikhilA8606 Jul 13, 2026
30a1517
added translation
NikhilA8606 Jul 14, 2026
ef3e185
requested changes
NikhilA8606 Jul 23, 2026
ae41da7
used DR api instead of getting it from SR
NikhilA8606 Jul 28, 2026
0256a28
added DR name in right pannel of DR list in encounter
NikhilA8606 Jul 29, 2026
cfcaa11
useQueries to retrieve all report in detail
NikhilA8606 Aug 1, 2026
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
21 changes: 19 additions & 2 deletions public/locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -693,6 +693,7 @@
"and_more_medications": "+{{count}} more medication(s)",
"and_more_service_requests": "+{{count}} more service request(s)",
"and_the_status_of_request_is": "and the status of request is",
"another_diagnostic_report": "Another Diagnostic Report",
"answer": "Answer",
"answer_options": "Answer options",
"answer_options_description": "Define possible answers for this question",
Expand Down Expand Up @@ -1854,12 +1855,19 @@
"diagnosis_history": "Diagnosis History",
"diagnosis_status_placeholder": "Select diagnosis status",
"diagnosis_verification_placeholder": "Select verification status",
"diagnostic": "Diagnostic",
"diagnostic_report": "Diagnostic Report",
"diagnostic_report_approved": "Diagnostic Report Approved",
"diagnostic_report_approved_description": "{{name}} report approved and finalized",
"diagnostic_report_approved_successfully": "Diagnostic report approved successfully",
"diagnostic_report_codes": "Diagnostic Report Codes",
"diagnostic_report_codes_description": "Diagnostic Reports that will be generated.",
"diagnostic_report_created": "Diagnostic Report Created",
"diagnostic_report_created_description": "{{name}} report created",
"diagnostic_report_created_successfully": "Diagnostic report created successfully",
"diagnostic_report_image": "Diagnostic Report Image",
"diagnostic_report_in_progress": "Diagnostic Report In Progress",
"diagnostic_report_in_progress_description": "{{name}} report created and pending approval",
"diagnostic_report_not_found": "Diagnostic Report Not Found",
"diagnostic_report_one": "Diagnostic Report",
"diagnostic_report_other": "Diagnostic Reports",
Expand Down Expand Up @@ -2579,7 +2587,6 @@
"failed_to_stop_camera": "Failed to stop camera",
"failed_to_unlock_invoice": "Failed to unlock invoice",
"failed_to_update_category": "Failed to update category",
"failed_to_update_conclusion": "Failed to update conclusion",
"failed_to_update_invoice": "Failed to update invoice",
"failed_to_update_order": "Failed to update location order",
"failed_to_update_questionnaire": "Failed to update Questionnaire",
Expand Down Expand Up @@ -4568,6 +4575,7 @@
"print_prescriptions": "Print Prescriptions",
"print_qr_codes": "Print QR Codes",
"print_receipt": "Print Receipt",
"print_report": "Print Report",
"print_selected": "Print Selected",
"print_setup": "Print Setup",
"print_templates": "Print Templates",
Expand Down Expand Up @@ -4933,6 +4941,7 @@
"report_type": "Report Type",
"reported_by": "Reported by",
"reports": "Reports",
"reports_pending_final_review": "{{pending}} of {{total}} reports pending final review",
"repository": "Repository",
"req_atleast_one_digit": "Require at least one digit",
"req_atleast_one_lowercase": "Require at least one lower case letter",
Expand All @@ -4945,6 +4954,7 @@
"request_details": "Request Details",
"request_for": "Request for",
"request_id": "Request ID",
"request_initiated_by": "Request initiated by {{name}}",
"request_letter": "Request Letter",
"request_order": "Request Order",
"request_order_details": "Request Order Details",
Expand Down Expand Up @@ -5051,7 +5061,6 @@
"result_date": "Result Date",
"result_details": "Result details",
"result_on": "Result on",
"result_review": "Result Review",
"result_value": "Result value",
"resume": "Resume",
"retake": "Retake",
Expand Down Expand Up @@ -5083,6 +5092,7 @@
"review_and_finalise_request_description": "Add more items if needed, or approve to mark this delivery as requested.",
"review_before": "Review Before",
"review_missed": "Review Missed",
"review_test_results": "Review Test Results",
"revisit_days_non_negative": "Re-visit allowed days cannot be negative",
"revoke": "Revoke",
"revoke_token": "Revoke Token",
Expand Down Expand Up @@ -5549,6 +5559,7 @@
"select_register_patient": "Select/Register Patient",
"select_report": "Select Report",
"select_report_type": "Select Report Type",
"select_report_type_to_create": "Select a diagnostic report type to create a new report",
"select_requester": "Select requester",
"select_resource": "Select the resource",
"select_resource_category": "Select resource category",
Expand Down Expand Up @@ -5685,6 +5696,7 @@
"service_request_completed": "Service request marked as completed",
"service_request_completion_confirmation": "Are you sure you want to mark this service request as complete? This action cannot be undone.",
"service_request_completion_note_description": "Document key findings or remarks before completing this request.",
"service_request_created": "Service Request Created",
"service_request_detail_page_description_prefix": "{{count}} deliveries have been received",
"service_request_details": "Service Request Details",
"service_request_invoice_alert": "Back to Service Request",
Expand Down Expand Up @@ -5817,6 +5829,7 @@
"specimen_collect_error": "Failed to collect specimen",
"specimen_collect_success": "Specimen collected successfully",
"specimen_collected": "Specimen Collected",
"specimen_collected_description": "{{specimen}} collected",
"specimen_collection": "Specimen Collection",
"specimen_collection_info": "Collection Information",
"specimen_collection_instructions": "Specimen Collection Instructions",
Expand All @@ -5840,6 +5853,8 @@
"specimen_id": "Specimen ID",
"specimen_identification": "Sample Identification",
"specimen_not_found": "Specimen not found",
"specimen_processed": "Specimen Processed",
"specimen_processed_description": "{{specimen}} processed",
"specimen_qrcode_scan_info": "QR code scanning to be implemented",
"specimen_requirements": "Specimen Requirements",
"specimen_requirements_description": "Specimen that are the requird to be collected.",
Expand Down Expand Up @@ -6088,6 +6103,7 @@
"test_results": "Test Results",
"test_results_actions": "Test Results actions",
"test_results_entry": "Test Results Entry",
"test_results_saved_successfully": "Test results saved successfully",
"test_type": "Type of test done",
"tested_on": "Tested on",
"tests": "Tests",
Expand Down Expand Up @@ -6569,6 +6585,7 @@
"view_facility": "View Facility",
"view_facility_details": "View facility details",
"view_files": "View Files",
"view_full_report": "View Full Report",
"view_history": "View History",
"view_intake_chart": "View Intake Chart",
"view_inventory": "View Inventory",
Expand Down
25 changes: 21 additions & 4 deletions src/Routers/routes/FacilityRoutes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ const FacilityRoutes: AppRoutes = {

...[
"/facility/:facilityId/patient/:patientId/diagnostic_reports/:diagnosticReportId",
"/organization/organizationId/patient/:patientId/diagnostic_reports/:diagnosticReportId",
].reduce((acc: AppRoutes, path) => {
acc[path] = ({ facilityId, patientId, diagnosticReportId }) => (
<DiagnosticReportView
Expand All @@ -80,13 +79,31 @@ const FacilityRoutes: AppRoutes = {
return acc;
}, {}),
...[
"/facility/:facilityId/patient/:patientId/diagnostic_reports/:diagnosticReportId/print",
"/organization/organizationId/patient/:patientId/diagnostic_reports/:diagnosticReportId/print",
"/facility/:facilityId/patient/:patientId/service_request/:serviceRequestId/diagnostic_report/:diagnosticReportId/print",
].reduce((acc: AppRoutes, path) => {
Comment thread
NikhilA8606 marked this conversation as resolved.
acc[path] = ({ patientId, diagnosticReportId }) => (
acc[path] = ({
Comment thread
NikhilA8606 marked this conversation as resolved.
patientId,
diagnosticReportId,
serviceRequestId,
facilityId,
}) => (
<DiagnosticReportPrint
patientId={patientId}
diagnosticReportId={diagnosticReportId}
serviceRequestId={serviceRequestId}
facilityId={facilityId}
/>
);
return acc;
}, {}),
...[
"/facility/:facilityId/patient/:patientId/service_request/:serviceRequestId/diagnostic_reports/print",
].reduce((acc: AppRoutes, path) => {
acc[path] = ({ patientId, serviceRequestId, facilityId }) => (
<DiagnosticReportPrint
patientId={patientId}
serviceRequestId={serviceRequestId}
facilityId={facilityId}
/>
);
return acc;
Expand Down
18 changes: 12 additions & 6 deletions src/components/Files/FileUploadDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export default function FileUploadDialog({
fileUpload,
associatingId,
type,
instanceId,
}: {
open: boolean;
onOpenChange: (open: boolean) => void;
Expand All @@ -34,9 +35,11 @@ export default function FileUploadDialog({
| "encounter"
| "diagnostic_report"
| "service_request";
instanceId?: string;
}) {
const { t } = useTranslation();
const [isPdf, setIsPdf] = useState(false);
const idPrefix = instanceId ? `${instanceId}-` : "";

const handleDialogClose = (open: boolean) => {
if (!open) {
Expand Down Expand Up @@ -108,15 +111,15 @@ export default function FileUploadDialog({
))}
<div>
<Label
htmlFor="upload-file-name-0"
htmlFor={`${idPrefix}upload-file-name-0`}
className="block text-sm font-medium text-gray-700"
>
{t("enter_file_name")}
</Label>
<Input
name="file_name_0"
type="text"
id="upload-file-name-0"
id={`${idPrefix}upload-file-name-0`}
required
value={fileUpload.fileNames[0] || ""}
disabled={fileUpload.uploading}
Expand Down Expand Up @@ -186,7 +189,7 @@ export default function FileUploadDialog({
<Input
name={`file_name_${index}`}
type="text"
id={`upload-file-name-${index}`}
id={`${idPrefix}upload-file-name-${index}`}
required
value={fileUpload.fileNames[index] || ""}
disabled={fileUpload.uploading}
Expand All @@ -212,13 +215,16 @@ export default function FileUploadDialog({
{fileUpload.files.length > 1 && (
<div className="flex items-center gap-2 mt-4">
<Checkbox
id={`file_upload_${type}`}
id={`${idPrefix}combine_files_pdf_${type}`}
checked={isPdf}
onCheckedChange={(checked: boolean) => setIsPdf(checked)}
disabled={fileUpload.uploading}
className="cursor-pointer"
/>
<Label htmlFor={`file_upload_${type}`} className="cursor-pointer">
<Label
htmlFor={`${idPrefix}combine_files_pdf_${type}`}
className="cursor-pointer"
Comment thread
NikhilA8606 marked this conversation as resolved.
>
{t("combine_files_pdf")}
</Label>
</div>
Expand All @@ -237,7 +243,7 @@ export default function FileUploadDialog({
variant="outline_primary"
onClick={() => fileUpload.handleFileUpload(associatingId, isPdf)}
disabled={fileUpload.uploading}
id="upload_file_button"
id={`${idPrefix}upload_file_button`}
>
<CareIcon icon="l-check" className="mr-1" />
{t("upload")}
Expand Down
4 changes: 3 additions & 1 deletion src/hooks/useFileUpload.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import fileApi from "@/types/files/fileApi";
export type FileUploadOptions = {
multiple?: boolean;
type: FileType;
inputId?: string;
category?: FileCategory;
onUpload?: (file: FileReadMinimal) => void;
// if allowed, will fallback to the name of the file if a seperate filename is not defined.
Expand Down Expand Up @@ -80,6 +81,7 @@ export default function useFileUpload(
category = FileCategory.UNSPECIFIED,
multiple,
allowNameFallback = true,
inputId,
} = options;

const { t } = useTranslation();
Expand Down Expand Up @@ -355,7 +357,7 @@ export default function useFileUpload(
const Input = (props: FileInputProps) => (
<input
{...props}
id={`file_upload_${fileType}`}
id={inputId ?? `file_upload_${fileType}`}
title={t("change_file")}
onChange={onFileChange}
type="file"
Expand Down
15 changes: 9 additions & 6 deletions src/pages/Encounters/tabs/diagnostic-reports.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,12 @@ function DiagnosticReportDetailCard({
return (
<Card className="shadow-sm border rounded-lg">
<CardHeader className="flex flex-row items-center justify-between py-3 px-4">
<CardTitle className="text-base font-medium">
{report.service_request?.title ||
report.code?.display ||
t("diagnostic_report", { count: 1 })}
<CardTitle className="flex items-center gap-2 text-gray-700 text-lg">
<span>
{report.service_request?.title ||
t("diagnostic_report", { count: 1 })}
</span>
{report.code?.display && <span> - {report.code.display}</span>}
</CardTitle>
<div className="flex items-center gap-2">
<Badge variant={DIAGNOSTIC_REPORT_STATUS_COLORS[report.status]}>
Expand All @@ -170,12 +172,13 @@ function DiagnosticReportDetailCard({
navigate(
buildEncounterUrl(
patientId,
`/diagnostic_reports/${report.id}/print`,
`/service_request/${report.service_request?.id}/diagnostic_report/${report.id}/print`,
facilityId,
),
)
}
data-shortcut-id="print-button"
disabled={!report.service_request?.id}
Comment thread
NikhilA8606 marked this conversation as resolved.
>
<Printer className="size-4" />
</Button>
Expand Down Expand Up @@ -218,7 +221,7 @@ function DiagnosticReportDetailCard({
{/* Report Details Grid */}
<div className="grid grid-cols-1 md:grid-cols-2 gap-4 text-sm">
{report.service_request?.code?.display && (
<div className="col-span-full">
<div>
<div className="text-gray-500">{t("procedure")}</div>
<div className="font-medium">
{report.service_request.code.display}
Expand Down
Loading
Loading