Skip to content
9 changes: 8 additions & 1 deletion 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 @@ -2537,13 +2538,15 @@
"failed_to_add_service_request": "Failed to add service request",
"failed_to_add_to_template": "Failed to add medication to template",
"failed_to_apply_template": "Failed to apply template",
"failed_to_approve_diagnostic_report": "Failed to approve diagnostic report: {{error}}",
"failed_to_archive_child_tag": "Failed to archive child tag",
"failed_to_cancel_invoice": "Failed to cancel invoice",
"failed_to_cancel_payment": "Failed to cancel payment",
"failed_to_capture_image": "Failed to capture image",
"failed_to_check_appointments": "Failed to check appointments",
"failed_to_create_appointment": "Failed to create an appointment",
"failed_to_create_category": "Failed to create category",
"failed_to_create_diagnostic_report": "Failed to create diagnostic report: {{error}}",
"failed_to_create_invoice": "Failed to create invoice",
Comment thread
NikhilA8606 marked this conversation as resolved.
"failed_to_create_questionnaire": "Failed to create Questionnaire",
"failed_to_create_queue": "Failed to create queue",
Expand All @@ -2566,6 +2569,7 @@
"failed_to_remove_tags": "Failed to remove the tag",
"failed_to_restart_encounter": "Failed to restart encounter",
"failed_to_revoke_token": "Failed to revoke token",
"failed_to_save_test_results": "Failed to save test results: {{error}}",
"failed_to_send_message": "Failed to send message",
Comment thread
NikhilA8606 marked this conversation as resolved.
"failed_to_stop_camera": "Failed to stop camera",
"failed_to_unlock_invoice": "Failed to unlock invoice",
Expand Down Expand Up @@ -5030,7 +5034,7 @@
"result_date": "Result Date",
"result_details": "Result details",
"result_on": "Result on",
"result_review": "Result Review",
"result_review": "Result Review of {{name}}",
"result_value": "Result value",
"resume": "Resume",
"retake": "Retake",
Expand Down Expand Up @@ -5062,6 +5066,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 Result",
Comment thread
NikhilA8606 marked this conversation as resolved.
"revisit_days_non_negative": "Re-visit allowed days cannot be negative",
"revoke": "Revoke",
"revoke_token": "Revoke Token",
Expand Down Expand Up @@ -5527,6 +5532,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 @@ -6062,6 +6068,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
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
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,10 @@ export default function ServiceRequestShow({
activityDefinition.observation_result_requirements ?? [];
const diagnosticReports = request.diagnostic_reports || [];

const activeDiagnosticReports = diagnosticReports.filter(
(report) => report.status !== DiagnosticReportStatus.final,
);

const assignedSpecimenIds = new Set<string>();

const preparePrintAllQRCodes = async () => {
Expand Down Expand Up @@ -596,22 +600,18 @@ export default function ServiceRequestShow({
</DropdownMenu>
</div>
)}
{(!diagnosticReports.length ||
diagnosticReports[0]?.status !==
DiagnosticReportStatus.final) && (
<DiagnosticReportForm
patientId={request.encounter.patient.id}
facilityId={facilityId}
serviceRequestId={serviceRequestId}
observationDefinitions={observationRequirements}
diagnosticReports={diagnosticReports}
activityDefinition={activityDefinition}
specimens={request.specimens || []}
disableEdit={disableEdit}
/>
)}
</div>

<DiagnosticReportForm
patientId={request.encounter.patient.id}
facilityId={facilityId}
serviceRequestId={serviceRequestId}
observationDefinitions={observationRequirements}
diagnosticReports={activeDiagnosticReports}
activityDefinition={activityDefinition}
specimens={request.specimens || []}
disableEdit={disableEdit}
/>
</div>
{diagnosticReports.length > 0 && (
<DiagnosticReportReview
facilityId={facilityId}
Expand Down
Loading
Loading