File TreatmentSummary.tsx
has 511 lines of code (exceeds 250 allowed). Consider refactoring.
import careConfig from "@careConfig";
import { useQuery } from "@tanstack/react-query";
import { format } from "date-fns";
import { Loader } from "lucide-react";
import { useEffect } from "react";
Function TreatmentSummary
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
export default function TreatmentSummary({
facilityId,
encounterId,
patientId,
}: TreatmentSummaryProps) {
Similar blocks of code found in 2 locations. Consider refactoring.
rows={medications?.results.map((medication) => {
const instruction = medication.dosage_instruction[0];
const frequency = getFrequencyDisplay(instruction?.timing);
const dosage = formatDosage(instruction);
const duration =
Similar blocks of code found in 2 locations. Consider refactoring.
{encounter.hospitalization?.diet_preference && (
<div className="grid grid-cols-[10rem_auto_1fr] md:grid-cols-[8rem_auto_1fr] items-center">
<span className="text-gray-600">{t("diet_preference")}</span>
<span className="text-gray-600">:</span>
<span className="font-semibold">
Similar blocks of code found in 2 locations. Consider refactoring.
{encounter.hospitalization?.admit_source && (
<div className="grid grid-cols-[10rem_auto_1fr] md:grid-cols-[8rem_auto_1fr] items-center">
<span className="text-gray-600">{t("admission_source")}</span>
<span className="text-gray-600">:</span>
<span className="font-semibold">
Similar blocks of code found in 3 locations. Consider refactoring.
<div className="grid grid-cols-[10rem_auto_1fr] md:grid-cols-[8rem_auto_1fr] items-center">
<span className="text-gray-600">{t("status")}</span>
<span className="text-gray-600">:</span>
<span className="font-semibold">
{t(`encounter_status__${encounter.status}`)}
Similar blocks of code found in 3 locations. Consider refactoring.
<div className="grid grid-cols-[10rem_auto_1fr] md:grid-cols-[8rem_auto_1fr] items-center">
<span className="text-gray-600">{t("encounter_class")}</span>
<span className="text-gray-600">:</span>
<span className="font-semibold">
{t(`encounter_class__${encounter.encounter_class}`)}
Similar blocks of code found in 3 locations. Consider refactoring.
<div className="grid grid-cols-[10rem_auto_1fr] md:grid-cols-[8rem_auto_1fr] items-center">
<span className="text-gray-600">{t("priority")}</span>
<span className="text-gray-600">:</span>
<span className="font-semibold">
{t(`encounter_priority__${encounter.priority}`)}
Similar blocks of code found in 2 locations. Consider refactoring.
medication_taken_between: [
medication.effective_period?.start,
medication.effective_period?.end,
]
.map((date, ind) =>
src/components/Patient/MedicationStatementList.tsx on lines 70..74 Similar blocks of code found in 2 locations. Consider refactoring.
<div>
<h1 className="text-3xl font-semibold">
{encounter.facility?.name}
</h1>
<h2 className="text-gray-500 uppercase text-sm tracking-wide font-semibold mt-1">
src/components/ui/sidebar/patient-switcher.tsx on lines 75..82 Similar blocks of code found in 2 locations. Consider refactoring.
headers={[
{ key: "symptom" },
{ key: "severity" },
{ key: "status" },
{ key: "verification" },
Similar blocks of code found in 2 locations. Consider refactoring.
headers={[
{ key: "medication" },
{ key: "dosage" },
{ key: "status" },
{
Similar blocks of code found in 3 locations. Consider refactoring.
headers={[
{ key: "allergen" },
{ key: "status" },
{ key: "criticality" },
{ key: "verification" },
Similar blocks of code found in 3 locations. Consider refactoring.
headers={[
{ key: "diagnosis" },
{ key: "status" },
{ key: "verification" },
{ key: "onset" },
Similar blocks of code found in 3 locations. Consider refactoring.
headers={[
{ key: "medicine" },
{ key: "status" },
{ key: "dosage" },
{ key: "frequency" },
Similar blocks of code found in 3 locations. Consider refactoring.
queryFn: query.paginated(medicationRequestApi.list, {
pathParams: { patientId },
queryParams: { encounter: encounterId },
pageSize: 100,
}),
src/components/Medicine/MedicationAdministration/PrintMedicationAdministration.tsx on lines 52..58 Similar blocks of code found in 3 locations. Consider refactoring.
queryFn: query.paginated(symptomApi.listSymptoms, {
pathParams: { patientId },
queryParams: { encounter: encounterId },
pageSize: 100,
}),
src/components/Medicine/MedicationAdministration/PrintMedicationAdministration.tsx on lines 52..58 There are no issues that match your filters.