Showing 10 of 10 total issues
Function PrintPrescription
has 152 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const PrintPrescription = (props: { facilityId: string; encounterId: string; patientId: string;}) => {
- Create a ticketCreate a ticket
Function PrintPrescription
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const PrintPrescription = (props: { facilityId: string; encounterId: string; patientId: string;}) => {
- Read upRead up
- Create a ticketCreate a ticket
Similar blocks of code found in 2 locations. Consider refactoring. Open
rows={activeMedications?.results.map((medication) => { const instruction = medication.dosage_instruction[0]; const frequency = getFrequencyDisplay(instruction?.timing); const dosage = formatDosage(instruction); const duration = instruction?.timing?.repeat?.bounds_duration;
- Read upRead up
- Create a ticketCreate a ticket
Identical blocks of code found in 2 locations. Consider refactoring. Open
<div className="grid grid-cols-1 md:grid-cols-2 gap-x-12 gap-y-6 mb-8"> <div className="space-y-3"> <DetailRow label={t("patient")} value={encounter?.patient.name}
- Read upRead up
- Create a ticketCreate a ticket
Similar blocks of code found in 3 locations. Consider refactoring. Open
const DetailRow = ({ label, value, isStrong = false,}: {
- Read upRead up
- Create a ticketCreate a ticket
Similar blocks of code found in 2 locations. Consider refactoring. Open
<div className="flex flex-col sm:flex-row justify-between items-center sm:items-start mb-4 pb-2 border-b border-gray-200"> <img src={careConfig.mainLogo?.dark} alt="Care Logo" className="h-10 w-auto object-contain mb-2 sm:mb-0 sm:order-2"
- Read upRead up
- Create a ticketCreate a ticket
Similar blocks of code found in 2 locations. Consider refactoring. Open
const medicationsByPrescriber = activeMedications.results.reduce< Record<string, MedicationRequestRead[]> >((acc, med) => { const prescriberId = med.created_by.id.toString(); if (!acc[prescriberId]) {
- Read upRead up
- Create a ticketCreate a ticket
Similar blocks of code found in 2 locations. Consider refactoring. Open
const { data: encounter } = useQuery<Encounter>({ queryKey: ["encounter", encounterId], queryFn: query(api.encounter.get, { pathParams: { id: encounterId }, queryParams: { facility: facilityId },
- Read upRead up
- Create a ticketCreate a ticket
Similar blocks of code found in 2 locations. Consider refactoring. Open
<div className="mt-8 pt-2 text-[10px] text-gray-500 flex justify-between flex-wrap"> <p> {t("generated_on")} {format(new Date(), "PPP 'at' p")} </p> <p>{t("computer_generated_prescription")}</p>
- Read upRead up
- Create a ticketCreate a ticket
Similar blocks of code found in 2 locations. Consider refactoring. Open
<PrintPreview title={`${t("prescriptions")} - ${encounter?.patient.name}`} disabled={!activeMedications?.results?.length} > <div className="min-h-screen md:p-2 max-w-4xl mx-auto">
- Read upRead up
- Create a ticketCreate a ticket