From 18af78df86d09a5a5fcf0ad93815423204901efb Mon Sep 17 00:00:00 2001 From: AdityaJ2305 Date: Thu, 16 Jan 2025 14:14:59 +0530 Subject: [PATCH 01/13] package added --- package-lock.json | 8 ++++++++ package.json | 1 + 2 files changed, 9 insertions(+) diff --git a/package-lock.json b/package-lock.json index 3605a282009..7e419a53f81 100644 --- a/package-lock.json +++ b/package-lock.json @@ -117,6 +117,7 @@ "eslint-config-prettier": "^9.1.0", "eslint-plugin-i18next": "^6.1.0", "eslint-plugin-mdx": "^3.1.5", + "eslint-plugin-no-relative-import-paths": "^1.6.1", "eslint-plugin-prettier": "^5.2.1", "eslint-plugin-react": "^7.37.2", "eslint-plugin-react-hooks": "^5.0.0", @@ -10178,6 +10179,13 @@ "eslint": ">=8.0.0" } }, + "node_modules/eslint-plugin-no-relative-import-paths": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-no-relative-import-paths/-/eslint-plugin-no-relative-import-paths-1.6.1.tgz", + "integrity": "sha512-YZNeOnsOrJcwhFw0X29MXjIzu2P/f5X2BZDPWw1R3VUYBRFxNIh77lyoL/XrMU9ewZNQPcEvAgL/cBOT1P330A==", + "dev": true, + "license": "ISC" + }, "node_modules/eslint-plugin-prettier": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.2.1.tgz", diff --git a/package.json b/package.json index 6ce2c52f0b3..6c132facabf 100644 --- a/package.json +++ b/package.json @@ -155,6 +155,7 @@ "eslint-config-prettier": "^9.1.0", "eslint-plugin-i18next": "^6.1.0", "eslint-plugin-mdx": "^3.1.5", + "eslint-plugin-no-relative-import-paths": "^1.6.1", "eslint-plugin-prettier": "^5.2.1", "eslint-plugin-react": "^7.37.2", "eslint-plugin-react-hooks": "^5.0.0", From 4deec781388cea114ddae4a67db7d1c63aeaf34d Mon Sep 17 00:00:00 2001 From: AdityaJ2305 Date: Thu, 16 Jan 2025 14:29:55 +0530 Subject: [PATCH 02/13] update the address --- .eslintrc.json | 12 ++++++++++-- src/components/Resource/ResourceDetails.tsx | 3 +-- src/components/Users/UserSummary.tsx | 4 ++-- src/components/ui/sidebar/patient-switcher.tsx | 3 +-- src/pages/Facility/FacilitiesPage.tsx | 2 +- src/pages/Facility/components/FacilityCard.tsx | 3 +-- src/pages/PublicAppointments/PatientRegistration.tsx | 3 +-- .../emr/allergyIntolerance/allergyIntolerance.ts | 4 ++-- src/types/emr/diagnosis/diagnosis.ts | 4 ++-- src/types/emr/encounter.ts | 3 +-- src/types/emr/newPatient.ts | 2 +- src/types/emr/observation.ts | 4 ++-- src/types/emr/symptom/symptom.ts | 4 ++-- src/types/facility/facility.ts | 2 +- .../facilityOrganization/facilityOrganization.ts | 3 +-- src/types/organization/organization.ts | 3 +-- src/types/organization/organizationApi.ts | 2 +- src/types/questionnaire/questionnaireApi.ts | 2 +- src/types/questionnaire/questionnaireResponse.ts | 3 ++- src/types/resourceRequest/resourceRequest.ts | 2 +- 20 files changed, 35 insertions(+), 33 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index ec5e9b8bb7d..5c79f7ee457 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -42,7 +42,8 @@ }, "plugins": [ "@typescript-eslint", - "i18next" + "i18next", + "no-relative-import-paths" ], "rules": { "no-unused-vars": "off", @@ -77,6 +78,13 @@ ] } } + ], + "no-relative-import-paths/no-relative-import-paths": [ + "error", + { + "allowSameFolder": true, + "prefix": "@" + } ] }, "ignorePatterns": [ @@ -91,4 +99,4 @@ "*.csv", "Dockerfile" ] -} +} \ No newline at end of file diff --git a/src/components/Resource/ResourceDetails.tsx b/src/components/Resource/ResourceDetails.tsx index 1c9e7e6cd3a..ec4c617d532 100644 --- a/src/components/Resource/ResourceDetails.tsx +++ b/src/components/Resource/ResourceDetails.tsx @@ -11,6 +11,7 @@ import { Separator } from "@/components/ui/separator"; import Loading from "@/components/Common/Loading"; import Page from "@/components/Common/Page"; +import { FacilityModel } from "@/components/Facility/models"; import CommentSection from "@/components/Resource/ResourceCommentSection"; import { RESOURCE_CATEGORY_CHOICES } from "@/common/constants"; @@ -21,8 +22,6 @@ import { formatDateTime, formatName } from "@/Utils/utils"; import { PatientModel } from "@/types/emr/patient"; import { ResourceRequest } from "@/types/resourceRequest/resourceRequest"; -import { FacilityModel } from "../Facility/models"; - function PatientCard({ patient }: { patient: PatientModel }) { const { t } = useTranslation(); return ( diff --git a/src/components/Users/UserSummary.tsx b/src/components/Users/UserSummary.tsx index 6c0e8fb0073..38ee413cc23 100644 --- a/src/components/Users/UserSummary.tsx +++ b/src/components/Users/UserSummary.tsx @@ -5,6 +5,8 @@ import { toast } from "sonner"; import CareIcon from "@/CAREUI/icons/CareIcon"; +import { Button } from "@/components/ui/button"; + import LanguageSelector from "@/components/Common/LanguageSelector"; import UserColumns from "@/components/Common/UserColumns"; import UserAvatar from "@/components/Users/UserAvatar"; @@ -28,8 +30,6 @@ import routes from "@/Utils/request/api"; import request from "@/Utils/request/request"; import { UserBase } from "@/types/user/user"; -import { Button } from "../ui/button"; - export default function UserSummaryTab({ userData, refetchUserData, diff --git a/src/components/ui/sidebar/patient-switcher.tsx b/src/components/ui/sidebar/patient-switcher.tsx index 370cafad43c..189eafa6bf9 100644 --- a/src/components/ui/sidebar/patient-switcher.tsx +++ b/src/components/ui/sidebar/patient-switcher.tsx @@ -7,6 +7,7 @@ import { SelectTrigger, SelectValue, } from "@/components/ui/select"; +import { useSidebar } from "@/components/ui/sidebar"; import { Avatar } from "@/components/Common/Avatar"; @@ -14,8 +15,6 @@ import { usePatientContext } from "@/hooks/usePatientUser"; import { classNames } from "@/Utils/utils"; -import { useSidebar } from "../sidebar"; - interface PatientSwitcherProps { className?: string; } diff --git a/src/pages/Facility/FacilitiesPage.tsx b/src/pages/Facility/FacilitiesPage.tsx index 0e1830c3d29..2540cd82e5a 100644 --- a/src/pages/Facility/FacilitiesPage.tsx +++ b/src/pages/Facility/FacilitiesPage.tsx @@ -16,10 +16,10 @@ import { RESULTS_PER_PAGE_LIMIT } from "@/common/constants"; import query from "@/Utils/request/query"; import { PaginatedResponse } from "@/Utils/request/types"; +import OrganizationFilter from "@/pages/Organization/components/OrganizationFilter"; import { FacilityData } from "@/types/facility/facility"; import facilityApi from "@/types/facility/facilityApi"; -import OrganizationFilter from "../Organization/components/OrganizationFilter"; import { FacilityCard } from "./components/FacilityCard"; export function FacilitiesPage() { diff --git a/src/pages/Facility/components/FacilityCard.tsx b/src/pages/Facility/components/FacilityCard.tsx index 5ffe42b1050..3b4634061cf 100644 --- a/src/pages/Facility/components/FacilityCard.tsx +++ b/src/pages/Facility/components/FacilityCard.tsx @@ -7,10 +7,9 @@ import { Card } from "@/components/ui/card"; import { Avatar } from "@/components/Common/Avatar"; +import { FeatureBadge } from "@/pages/Facility/Utils"; import { FacilityData } from "@/types/facility/facility"; -import { FeatureBadge } from "../Utils"; - interface Props { facility: FacilityData; className?: string; diff --git a/src/pages/PublicAppointments/PatientRegistration.tsx b/src/pages/PublicAppointments/PatientRegistration.tsx index e12780b2133..0b6ca9fab09 100644 --- a/src/pages/PublicAppointments/PatientRegistration.tsx +++ b/src/pages/PublicAppointments/PatientRegistration.tsx @@ -33,6 +33,7 @@ import routes from "@/Utils/request/api"; import mutate from "@/Utils/request/mutate"; import { HTTPError } from "@/Utils/request/types"; import { dateQueryString } from "@/Utils/utils"; +import OrganizationSelector from "@/pages/Organization/components/OrganizationSelector"; import { AppointmentPatient, AppointmentPatientRegister, @@ -44,8 +45,6 @@ import { TokenSlot, } from "@/types/scheduling/schedule"; -import OrganizationSelector from "../Organization/components/OrganizationSelector"; - const initialForm: AppointmentPatientRegister & { ageInputType: "age" | "date_of_birth"; } = { diff --git a/src/types/emr/allergyIntolerance/allergyIntolerance.ts b/src/types/emr/allergyIntolerance/allergyIntolerance.ts index 860cfe14243..f87b09e1d82 100644 --- a/src/types/emr/allergyIntolerance/allergyIntolerance.ts +++ b/src/types/emr/allergyIntolerance/allergyIntolerance.ts @@ -1,5 +1,5 @@ -import { Code } from "../../questionnaire/code"; -import { UserBase } from "../../user/user"; +import { Code } from "@/types/questionnaire/code"; +import { UserBase } from "@/types/user/user"; // Base type for allergy data export interface AllergyIntolerance { diff --git a/src/types/emr/diagnosis/diagnosis.ts b/src/types/emr/diagnosis/diagnosis.ts index 62e5a92c946..b16634373be 100644 --- a/src/types/emr/diagnosis/diagnosis.ts +++ b/src/types/emr/diagnosis/diagnosis.ts @@ -1,5 +1,5 @@ -import { Code } from "../../questionnaire/code"; -import { UserBase } from "../../user/user"; +import { Code } from "@/types/questionnaire/code"; +import { UserBase } from "@/types/user/user"; export const DIAGNOSIS_CLINICAL_STATUS = [ "active", diff --git a/src/types/emr/encounter.ts b/src/types/emr/encounter.ts index 7b6fdb5bed6..40d0d089b1e 100644 --- a/src/types/emr/encounter.ts +++ b/src/types/emr/encounter.ts @@ -1,8 +1,7 @@ import { Patient } from "@/types/emr/newPatient"; +import { FacilityOrganization } from "@/types/facilityOrganization/facilityOrganization"; import { UserBase } from "@/types/user/user"; -import { FacilityOrganization } from "../facilityOrganization/facilityOrganization"; - export type EncounterStatus = | "planned" | "in_progress" diff --git a/src/types/emr/newPatient.ts b/src/types/emr/newPatient.ts index 02946da9ea9..853564b6be7 100644 --- a/src/types/emr/newPatient.ts +++ b/src/types/emr/newPatient.ts @@ -1,6 +1,6 @@ import { UserBareMinimum } from "@/components/Users/models"; -import { Organization } from "../organization/organization"; +import { Organization } from "@/types/organization/organization"; export type BloodGroupChoices = | "A_negative" diff --git a/src/types/emr/observation.ts b/src/types/emr/observation.ts index 3d6dfeb7295..b100c2a2f78 100644 --- a/src/types/emr/observation.ts +++ b/src/types/emr/observation.ts @@ -1,5 +1,5 @@ -import { Code } from "../questionnaire/code"; -import { UserBase } from "../user/user"; +import { Code } from "@/types/questionnaire/code"; +import { UserBase } from "@/types/user/user"; export interface ObservationValue { value?: string; diff --git a/src/types/emr/symptom/symptom.ts b/src/types/emr/symptom/symptom.ts index 3d55cfbad3e..38a7d75c781 100644 --- a/src/types/emr/symptom/symptom.ts +++ b/src/types/emr/symptom/symptom.ts @@ -1,5 +1,5 @@ -import { Code } from "../../questionnaire/code"; -import { UserBase } from "../../user/user"; +import { Code } from "@/types/questionnaire/code"; +import { UserBase } from "@/types/user/user"; export const SYMPTOM_CLINICAL_STATUS = [ "active", diff --git a/src/types/facility/facility.ts b/src/types/facility/facility.ts index 4a14964e34a..82e99a97248 100644 --- a/src/types/facility/facility.ts +++ b/src/types/facility/facility.ts @@ -1,4 +1,4 @@ -import { Organization } from "../organization/organization"; +import { Organization } from "@/types/organization/organization"; export interface BaseFacility { id: string; diff --git a/src/types/facilityOrganization/facilityOrganization.ts b/src/types/facilityOrganization/facilityOrganization.ts index e76b96adbcb..8f5122610bf 100644 --- a/src/types/facilityOrganization/facilityOrganization.ts +++ b/src/types/facilityOrganization/facilityOrganization.ts @@ -1,6 +1,5 @@ import { PaginatedResponse } from "@/Utils/request/types"; - -import { UserBase } from "../user/user"; +import { UserBase } from "@/types/user/user"; type org_type = "root" | "dept" | "team"; diff --git a/src/types/organization/organization.ts b/src/types/organization/organization.ts index 5b36828ed09..26f2bd2e1c5 100644 --- a/src/types/organization/organization.ts +++ b/src/types/organization/organization.ts @@ -1,8 +1,7 @@ import { t } from "i18next"; import { PaginatedResponse } from "@/Utils/request/types"; - -import { UserBase } from "../user/user"; +import { UserBase } from "@/types/user/user"; type org_type = "team" | "govt" | "role" | "other"; diff --git a/src/types/organization/organizationApi.ts b/src/types/organization/organizationApi.ts index 5e90f0b26b5..5181827622a 100644 --- a/src/types/organization/organizationApi.ts +++ b/src/types/organization/organizationApi.ts @@ -1,7 +1,7 @@ import { HttpMethod, Type } from "@/Utils/request/api"; import { PaginatedResponse } from "@/Utils/request/types"; +import { Patient } from "@/types/emr/newPatient"; -import { Patient } from "../emr/newPatient"; import { Organization, OrganizationUserRole } from "./organization"; export default { diff --git a/src/types/questionnaire/questionnaireApi.ts b/src/types/questionnaire/questionnaireApi.ts index 415bf9fa8ef..b475cbd2ce9 100644 --- a/src/types/questionnaire/questionnaireApi.ts +++ b/src/types/questionnaire/questionnaireApi.ts @@ -1,7 +1,7 @@ import { HttpMethod, Type } from "@/Utils/request/api"; import { PaginatedResponse } from "@/Utils/request/types"; +import { Organization } from "@/types/organization/organization"; -import { Organization } from "../organization/organization"; import { QuestionnaireCreate, QuestionnaireDetail } from "./questionnaire"; import { QuestionnaireTagModel, QuestionnaireTagSet } from "./tags"; diff --git a/src/types/questionnaire/questionnaireResponse.ts b/src/types/questionnaire/questionnaireResponse.ts index da8e8e16c83..a956e55062c 100644 --- a/src/types/questionnaire/questionnaireResponse.ts +++ b/src/types/questionnaire/questionnaireResponse.ts @@ -1,4 +1,5 @@ -import { UserBase } from "../user/user"; +import { UserBase } from "@/types/user/user"; + import { QuestionnaireResponse as Response } from "./form"; import { StructuredQuestionType } from "./question"; import { QuestionnaireDetail } from "./questionnaire"; diff --git a/src/types/resourceRequest/resourceRequest.ts b/src/types/resourceRequest/resourceRequest.ts index a97b4eaeccd..7594766017c 100644 --- a/src/types/resourceRequest/resourceRequest.ts +++ b/src/types/resourceRequest/resourceRequest.ts @@ -1,7 +1,7 @@ import { FacilityModel } from "@/components/Facility/models"; import { UserBareMinimum } from "@/components/Users/models"; -import { PatientModel } from "../emr/patient"; +import { PatientModel } from "@/types/emr/patient"; export interface ResourceRequest { approving_facility: FacilityModel | null; From af35804925d7f4be077a50dd4455756d66a97bb3 Mon Sep 17 00:00:00 2001 From: AdityaJ2305 Date: Thu, 16 Jan 2025 14:40:03 +0530 Subject: [PATCH 03/13] Empty-Commit From 943a9993dd303bad591b514f5cc8c7a61bd8cf6a Mon Sep 17 00:00:00 2001 From: AdityaJ2305 Date: Thu, 16 Jan 2025 15:20:32 +0530 Subject: [PATCH 04/13] fixed import in codebase --- src/Routers/routes/questionnaireRoutes.tsx | 2 +- src/components/Common/Charts/ObservationChart.tsx | 3 ++- .../Common/Charts/ObservationHistoryTable.tsx | 4 ++-- src/components/Facility/DuplicatePatientDialog.tsx | 12 ++++++------ src/components/Facility/EncounterCard.tsx | 3 +-- src/components/Files/AudioCaptureDialog.tsx | 2 +- src/components/Patient/MedicationStatementList.tsx | 7 +++++-- .../PatientDetailsTab/HealthProfileSummary.tsx | 4 ++-- src/components/Patient/PatientRegistration.tsx | 3 +-- .../QuestionTypes/EncounterQuestion.tsx | 3 +-- src/components/Questionnaire/QuestionnaireEditor.tsx | 3 ++- src/components/Questionnaire/index.tsx | 4 ++-- src/components/Questionnaire/show.tsx | 3 ++- src/components/Resource/ResourceCommentSection.tsx | 3 +-- 14 files changed, 29 insertions(+), 27 deletions(-) diff --git a/src/Routers/routes/questionnaireRoutes.tsx b/src/Routers/routes/questionnaireRoutes.tsx index 044f9fcc1d4..ccc89f17f90 100644 --- a/src/Routers/routes/questionnaireRoutes.tsx +++ b/src/Routers/routes/questionnaireRoutes.tsx @@ -2,7 +2,7 @@ import { QuestionnaireList } from "@/components/Questionnaire"; import QuestionnaireEditor from "@/components/Questionnaire/QuestionnaireEditor"; import { QuestionnaireShow } from "@/components/Questionnaire/show"; -import { AppRoutes } from "../AppRouter"; +import { AppRoutes } from "@/Routers/AppRouter"; const QuestionnaireRoutes: AppRoutes = { "/questionnaire": () => , diff --git a/src/components/Common/Charts/ObservationChart.tsx b/src/components/Common/Charts/ObservationChart.tsx index f79d529abb4..d210255a181 100644 --- a/src/components/Common/Charts/ObservationChart.tsx +++ b/src/components/Common/Charts/ObservationChart.tsx @@ -22,12 +22,13 @@ import { } from "@/components/ui/table"; import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"; +import { Avatar } from "@/components/Common/Avatar"; + import routes from "@/Utils/request/api"; import query from "@/Utils/request/query"; import { ObservationAnalyzeResponse } from "@/types/emr/observation"; import { Code } from "@/types/questionnaire/code"; -import { Avatar } from "../Avatar"; import { ObservationHistoryTable } from "./ObservationHistoryTable"; export type ObservationPlotConfig = { diff --git a/src/components/Common/Charts/ObservationHistoryTable.tsx b/src/components/Common/Charts/ObservationHistoryTable.tsx index 9e3940bff17..240bfea2790 100644 --- a/src/components/Common/Charts/ObservationHistoryTable.tsx +++ b/src/components/Common/Charts/ObservationHistoryTable.tsx @@ -12,13 +12,13 @@ import { TableRow, } from "@/components/ui/table"; +import { Avatar } from "@/components/Common/Avatar"; + import routes from "@/Utils/request/api"; import query from "@/Utils/request/query"; import { ObservationWithUser } from "@/types/emr/observation"; import { Code } from "@/types/questionnaire/code"; -import { Avatar } from "../Avatar"; - interface PaginatedResponse { count: number; next: string | null; diff --git a/src/components/Facility/DuplicatePatientDialog.tsx b/src/components/Facility/DuplicatePatientDialog.tsx index ea12f1d06c4..2e795092042 100644 --- a/src/components/Facility/DuplicatePatientDialog.tsx +++ b/src/components/Facility/DuplicatePatientDialog.tsx @@ -3,11 +3,7 @@ import { useTranslation } from "react-i18next"; import CareIcon from "@/CAREUI/icons/CareIcon"; -import DialogModal from "@/components/Common/Dialog"; - -import { PartialPatientModel } from "@/types/emr/newPatient"; - -import { Button } from "../ui/button"; +import { Button } from "@/components/ui/button"; import { Table, TableBody, @@ -15,7 +11,11 @@ import { TableHead, TableHeader, TableRow, -} from "../ui/table"; +} from "@/components/ui/table"; + +import DialogModal from "@/components/Common/Dialog"; + +import { PartialPatientModel } from "@/types/emr/newPatient"; interface Props { patientList: Array; diff --git a/src/components/Facility/EncounterCard.tsx b/src/components/Facility/EncounterCard.tsx index bfa2ab67363..10c408a7bee 100644 --- a/src/components/Facility/EncounterCard.tsx +++ b/src/components/Facility/EncounterCard.tsx @@ -7,12 +7,11 @@ import { cn } from "@/lib/utils"; import CareIcon from "@/CAREUI/icons/CareIcon"; import { Badge } from "@/components/ui/badge"; +import { buttonVariants } from "@/components/ui/button"; import { formatDateTime } from "@/Utils/utils"; import { Encounter, completedEncounterStatus } from "@/types/emr/encounter"; -import { buttonVariants } from "../ui/button"; - interface EncounterCardProps { encounter: Encounter; } diff --git a/src/components/Files/AudioCaptureDialog.tsx b/src/components/Files/AudioCaptureDialog.tsx index 05488d305e0..d50c9b4acde 100644 --- a/src/components/Files/AudioCaptureDialog.tsx +++ b/src/components/Files/AudioCaptureDialog.tsx @@ -7,7 +7,7 @@ import CareIcon from "@/CAREUI/icons/CareIcon"; import { useTimer } from "@/hooks/useTimer"; -import useVoiceRecorder from "../../Utils/useVoiceRecorder"; +import useVoiceRecorder from "@/Utils/useVoiceRecorder"; export interface AudioCaptureDialogProps { show: boolean; diff --git a/src/components/Patient/MedicationStatementList.tsx b/src/components/Patient/MedicationStatementList.tsx index 89b1ffaf244..87ac973a021 100644 --- a/src/components/Patient/MedicationStatementList.tsx +++ b/src/components/Patient/MedicationStatementList.tsx @@ -14,13 +14,16 @@ import { TableHeader, TableRow, } from "@/components/ui/table"; +import { + Tooltip, + TooltipContent, + TooltipTrigger, +} from "@/components/ui/tooltip"; import routes from "@/Utils/request/api"; import query from "@/Utils/request/query"; import { formatDateTime } from "@/Utils/utils"; -import { Tooltip, TooltipContent, TooltipTrigger } from "../ui/tooltip"; - interface MedicationStatementListProps { patientId: string; } diff --git a/src/components/Patient/PatientDetailsTab/HealthProfileSummary.tsx b/src/components/Patient/PatientDetailsTab/HealthProfileSummary.tsx index d503cb7efdc..30cd2529952 100644 --- a/src/components/Patient/PatientDetailsTab/HealthProfileSummary.tsx +++ b/src/components/Patient/PatientDetailsTab/HealthProfileSummary.tsx @@ -1,9 +1,9 @@ +import { MedicationStatementList } from "@/components/Patient/MedicationStatementList"; +import { AllergyList } from "@/components/Patient/allergy/list"; import { DiagnosisList } from "@/components/Patient/diagnosis/list"; import { SymptomsList } from "@/components/Patient/symptoms/list"; import { PatientProps } from "."; -import { MedicationStatementList } from "../MedicationStatementList"; -import { AllergyList } from "../allergy/list"; export const HealthProfileSummary = (props: PatientProps) => { const { id } = props; diff --git a/src/components/Patient/PatientRegistration.tsx b/src/components/Patient/PatientRegistration.tsx index ba851ff36c2..f90a8fe064e 100644 --- a/src/components/Patient/PatientRegistration.tsx +++ b/src/components/Patient/PatientRegistration.tsx @@ -9,6 +9,7 @@ import { z } from "zod"; import SectionNavigator from "@/CAREUI/misc/SectionNavigator"; +import Autocomplete from "@/components/ui/autocomplete"; import { Button } from "@/components/ui/button"; import { Checkbox } from "@/components/ui/checkbox"; import { @@ -54,8 +55,6 @@ import OrganizationSelector from "@/pages/Organization/components/OrganizationSe import { PatientModel } from "@/types/emr/patient"; import { Organization } from "@/types/organization/organization"; -import Autocomplete from "../ui/autocomplete"; - interface PatientRegistrationPageProps { facilityId: string; patientId?: string; diff --git a/src/components/Questionnaire/QuestionTypes/EncounterQuestion.tsx b/src/components/Questionnaire/QuestionTypes/EncounterQuestion.tsx index 696793b290a..00b26cb0c5f 100644 --- a/src/components/Questionnaire/QuestionTypes/EncounterQuestion.tsx +++ b/src/components/Questionnaire/QuestionTypes/EncounterQuestion.tsx @@ -10,6 +10,7 @@ import { SelectTrigger, SelectValue, } from "@/components/ui/select"; +import { Switch } from "@/components/ui/switch"; import routes from "@/Utils/request/api"; import query from "@/Utils/request/query"; @@ -28,8 +29,6 @@ import type { } from "@/types/questionnaire/form"; import type { Question } from "@/types/questionnaire/question"; -import { Switch } from "../../../components/ui/switch"; - interface EncounterQuestionProps { question: Question; encounterId: string; diff --git a/src/components/Questionnaire/QuestionnaireEditor.tsx b/src/components/Questionnaire/QuestionnaireEditor.tsx index 5e49cca2579..842a0add3dc 100644 --- a/src/components/Questionnaire/QuestionnaireEditor.tsx +++ b/src/components/Questionnaire/QuestionnaireEditor.tsx @@ -28,6 +28,8 @@ import { Switch } from "@/components/ui/switch"; import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"; import { Textarea } from "@/components/ui/textarea"; +import Loading from "@/components/Common/Loading"; + import mutate from "@/Utils/request/mutate"; import useQuery from "@/Utils/request/useQuery"; import { @@ -44,7 +46,6 @@ import { } from "@/types/questionnaire/questionnaire"; import questionnaireApi from "@/types/questionnaire/questionnaireApi"; -import Loading from "../Common/Loading"; import { QuestionnaireForm } from "./QuestionnaireForm"; interface QuestionnaireEditorProps { diff --git a/src/components/Questionnaire/index.tsx b/src/components/Questionnaire/index.tsx index 8a1f0dea4f5..ac0a1929200 100644 --- a/src/components/Questionnaire/index.tsx +++ b/src/components/Questionnaire/index.tsx @@ -3,12 +3,12 @@ import { useNavigate } from "raviger"; import { Badge } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; +import Loading from "@/components/Common/Loading"; + import useQuery from "@/Utils/request/useQuery"; import { QuestionnaireDetail } from "@/types/questionnaire/questionnaire"; import questionnaireApi from "@/types/questionnaire/questionnaireApi"; -import Loading from "../Common/Loading"; - export function QuestionnaireList() { const navigate = useNavigate(); const { data: response, loading } = useQuery(questionnaireApi.list); diff --git a/src/components/Questionnaire/show.tsx b/src/components/Questionnaire/show.tsx index 83b178bacc3..a10c24aa2d3 100644 --- a/src/components/Questionnaire/show.tsx +++ b/src/components/Questionnaire/show.tsx @@ -27,12 +27,13 @@ import { } from "@/components/ui/dropdown-menu"; import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"; +import Loading from "@/components/Common/Loading"; + import mutate from "@/Utils/request/mutate"; import query from "@/Utils/request/query"; import type { Question } from "@/types/questionnaire/question"; import questionnaireApi from "@/types/questionnaire/questionnaireApi"; -import Loading from "../Common/Loading"; import CloneQuestionnaireSheet from "./CloneQuestionnaireSheet"; import ManageQuestionnaireOrganizationsSheet from "./ManageQuestionnaireOrganizationsSheet"; import ManageQuestionnaireTagsSheet from "./ManageQuestionnaireTagsSheet"; diff --git a/src/components/Resource/ResourceCommentSection.tsx b/src/components/Resource/ResourceCommentSection.tsx index a556f33a186..04d1eb94deb 100644 --- a/src/components/Resource/ResourceCommentSection.tsx +++ b/src/components/Resource/ResourceCommentSection.tsx @@ -6,6 +6,7 @@ import PaginatedList from "@/CAREUI/misc/PaginatedList"; import { Button } from "@/components/ui/button"; +import { Avatar } from "@/components/Common/Avatar"; import CircularProgress from "@/components/Common/CircularProgress"; import TextAreaFormField from "@/components/Form/FormFields/TextAreaFormField"; @@ -14,8 +15,6 @@ import request from "@/Utils/request/request"; import { formatName } from "@/Utils/utils"; import { CommentModel } from "@/types/resourceRequest/resourceRequest"; -import { Avatar } from "../Common/Avatar"; - const CommentSection = (props: { id: string }) => { const [commentBox, setCommentBox] = useState(""); From c6157818d11931cf565fc5243932170393644475 Mon Sep 17 00:00:00 2001 From: AdityaJ2305 Date: Fri, 17 Jan 2025 12:04:42 +0530 Subject: [PATCH 05/13] fix import lint fail --- src/components/ErrorPages/DefaultErrorPage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/ErrorPages/DefaultErrorPage.tsx b/src/components/ErrorPages/DefaultErrorPage.tsx index bb0efed1580..421fc0a0fd0 100644 --- a/src/components/ErrorPages/DefaultErrorPage.tsx +++ b/src/components/ErrorPages/DefaultErrorPage.tsx @@ -2,7 +2,7 @@ import { useEffect } from "react"; import { useTranslation } from "react-i18next"; import { toast } from "sonner"; -import { Button } from "../ui/button"; +import { Button } from "@/components/ui/button"; type ErrorType = "PAGE_NOT_FOUND" | "PAGE_LOAD_ERROR" | "CUSTOM_ERROR"; From b52df97bf0acca6dac8d47ad220534136abb36fa Mon Sep 17 00:00:00 2001 From: AdityaJ2305 Date: Fri, 17 Jan 2025 17:06:32 +0530 Subject: [PATCH 06/13] resolved conflicts --- src/components/ErrorPages/DefaultErrorPage.tsx | 1 + src/components/Questionnaire/index.tsx | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/ErrorPages/DefaultErrorPage.tsx b/src/components/ErrorPages/DefaultErrorPage.tsx index af432a81f90..37d3f0509db 100644 --- a/src/components/ErrorPages/DefaultErrorPage.tsx +++ b/src/components/ErrorPages/DefaultErrorPage.tsx @@ -3,6 +3,7 @@ import { useTranslation } from "react-i18next"; import { toast } from "sonner"; import { Button } from "@/components/ui/button"; + import useAppHistory from "@/hooks/useAppHistory"; type ErrorType = "PAGE_NOT_FOUND" | "PAGE_LOAD_ERROR" | "CUSTOM_ERROR"; diff --git a/src/components/Questionnaire/index.tsx b/src/components/Questionnaire/index.tsx index bc62905f6f9..b7f9105ce16 100644 --- a/src/components/Questionnaire/index.tsx +++ b/src/components/Questionnaire/index.tsx @@ -6,7 +6,6 @@ import { Button } from "@/components/ui/button"; import Loading from "@/components/Common/Loading"; -import useQuery from "@/Utils/request/useQuery"; import query from "@/Utils/request/query"; import { QuestionnaireDetail } from "@/types/questionnaire/questionnaire"; import questionnaireApi from "@/types/questionnaire/questionnaireApi"; From e6da4e3e3017e0461d29f26d2a4557c08e16785b Mon Sep 17 00:00:00 2001 From: AdityaJ2305 Date: Fri, 17 Jan 2025 17:31:40 +0530 Subject: [PATCH 07/13] rm samefileimport --- .eslintrc.json | 35 ++++++++--------------------------- 1 file changed, 8 insertions(+), 27 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 5c79f7ee457..14db3815778 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -19,13 +19,8 @@ ], "overrides": [ { - "files": [ - "**/*.mdx" - ], - "extends": [ - "plugin:react/recommended", - "plugin:mdx/recommended" - ], + "files": ["**/*.mdx"], + "extends": ["plugin:react/recommended", "plugin:mdx/recommended"], "rules": { "react/jsx-no-target-blank": "off", "i18next/no-literal-string": "off" @@ -40,11 +35,7 @@ "ecmaVersion": 12, "sourceType": "module" }, - "plugins": [ - "@typescript-eslint", - "i18next", - "no-relative-import-paths" - ], + "plugins": ["@typescript-eslint", "i18next", "no-relative-import-paths"], "rules": { "no-unused-vars": "off", "@typescript-eslint/no-unused-vars": [ @@ -62,28 +53,18 @@ { "mode": "jsx-only", "jsx-attributes": { - "include": [ - "label", - "placeholder", - "error", - "title" - ], - "exclude": [ - ".*" - ] + "include": ["label", "placeholder", "error", "title"], + "exclude": [".*"] }, "callees": { - "exclude": [ - ".*" - ] + "exclude": [".*"] } } ], "no-relative-import-paths/no-relative-import-paths": [ "error", { - "allowSameFolder": true, - "prefix": "@" + "prefix": "@" } ] }, @@ -99,4 +80,4 @@ "*.csv", "Dockerfile" ] -} \ No newline at end of file +} From 437c7326e4d2cb6301fd18f7637aec10461e27d1 Mon Sep 17 00:00:00 2001 From: AdityaJ2305 Date: Fri, 17 Jan 2025 18:03:25 +0530 Subject: [PATCH 08/13] file fix after rm samefileimport --- src/App.tsx | 3 +-- src/Routers/AppRouter.tsx | 5 ++-- src/Routers/PatientRouter.tsx | 3 +-- src/Utils/request/useQuery.ts | 3 +-- .../Common/Charts/ObservationChart.tsx | 3 +-- .../Common/UserAutocompleteFormField.tsx | 3 +-- .../Patient/PatientDetailsTab/index.tsx | 9 +++---- src/components/Patient/PatientInfoCard.tsx | 3 +-- .../QuestionTypes/QuestionGroup.tsx | 3 +-- .../QuestionTypes/QuestionInput.tsx | 25 +++++++++---------- .../Questionnaire/QuestionnaireEditor.tsx | 3 +-- .../Questionnaire/QuestionnaireForm.tsx | 9 +++---- src/components/Questionnaire/show.tsx | 9 +++---- src/components/Users/UserBanner.tsx | 3 +-- src/pages/Encounters/EncounterShow.tsx | 3 +-- src/pages/Facility/FacilitiesPage.tsx | 3 +-- src/pages/Facility/FacilityDetailsPage.tsx | 5 ++-- .../FacilityOrganizationIndex.tsx | 3 +-- .../FacilityOrganizationUsers.tsx | 7 +++--- .../FacilityOrganizationView.tsx | 5 ++-- .../Organization/OrganizationFacilities.tsx | 7 +++--- .../Organization/OrganizationPatients.tsx | 3 +-- src/pages/Organization/OrganizationUsers.tsx | 9 +++---- src/pages/Organization/OrganizationView.tsx | 3 +-- src/pages/Patient/index.tsx | 3 +-- src/pluginTypes.ts | 7 +++--- .../allergyIntoleranceApi.ts | 3 +-- src/types/emr/diagnosis/diagnosisApi.ts | 3 +-- src/types/emr/symptom/symptomApi.ts | 3 +-- src/types/facility/facilityApi.ts | 3 +-- src/types/organization/organizationApi.ts | 6 +++-- src/types/questionnaire/question.ts | 2 +- src/types/questionnaire/questionnaire.ts | 6 ++--- src/types/questionnaire/questionnaireApi.ts | 11 +++++--- .../questionnaire/questionnaireResponse.ts | 7 +++--- 35 files changed, 81 insertions(+), 105 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 51e33c2209d..2ee77f62df2 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -17,10 +17,9 @@ import PluginEngine from "@/PluginEngine"; import AuthUserProvider from "@/Providers/AuthUserProvider"; import HistoryAPIProvider from "@/Providers/HistoryAPIProvider"; import Routers from "@/Routers"; +import { PubSubProvider } from "@/Utils/pubsubContext"; import { handleHttpError } from "@/Utils/request/errorHandler"; -import { PubSubProvider } from "./Utils/pubsubContext"; - const queryClient = new QueryClient({ defaultOptions: { queries: { diff --git a/src/Routers/AppRouter.tsx b/src/Routers/AppRouter.tsx index ed8ed8a8aa0..0b0ad6be251 100644 --- a/src/Routers/AppRouter.tsx +++ b/src/Routers/AppRouter.tsx @@ -15,18 +15,17 @@ import { usePluginRoutes } from "@/hooks/useCareApps"; import ConsultationRoutes from "@/Routers/routes/ConsultationRoutes"; import FacilityRoutes from "@/Routers/routes/FacilityRoutes"; +import OrganizationRoutes from "@/Routers/routes/OrganizationRoutes"; import PatientRoutes from "@/Routers/routes/PatientRoutes"; import ResourceRoutes from "@/Routers/routes/ResourceRoutes"; import ScheduleRoutes from "@/Routers/routes/ScheduleRoutes"; import UserRoutes from "@/Routers/routes/UserRoutes"; +import QuestionnaireRoutes from "@/Routers/routes/questionnaireRoutes"; import { PermissionProvider } from "@/context/PermissionContext"; import { PlugConfigEdit } from "@/pages/Apps/PlugConfigEdit"; import { PlugConfigList } from "@/pages/Apps/PlugConfigList"; import UserDashboard from "@/pages/UserDashboard"; -import OrganizationRoutes from "./routes/OrganizationRoutes"; -import QuestionnaireRoutes from "./routes/questionnaireRoutes"; - // List of paths where the sidebar should be hidden const PATHS_WITHOUT_SIDEBAR = ["/", "/session-expired"]; diff --git a/src/Routers/PatientRouter.tsx b/src/Routers/PatientRouter.tsx index cc07a27d887..ee989644ad1 100644 --- a/src/Routers/PatientRouter.tsx +++ b/src/Routers/PatientRouter.tsx @@ -10,6 +10,7 @@ import { patientTabs } from "@/components/Patient/PatientDetailsTab"; import { PatientHome } from "@/components/Patient/PatientHome"; import PatientUserProvider from "@/Providers/PatientUserProvider"; +import PublicRouter from "@/Routers/PublicRouter"; import { FacilitiesPage } from "@/pages/Facility/FacilitiesPage"; import PatientIndex from "@/pages/Patient/index"; import { PatientRegistration } from "@/pages/PublicAppointments/PatientRegistration"; @@ -17,8 +18,6 @@ import PatientSelect from "@/pages/PublicAppointments/PatientSelect"; import { ScheduleAppointment } from "@/pages/PublicAppointments/Schedule"; import { AppointmentSuccess } from "@/pages/PublicAppointments/Success"; -import PublicRouter from "./PublicRouter"; - const DashboardRoutes = { "/nearby_facilities": () => , "/facility/:facilityId/appointments/:appointmentId/success": ({ diff --git a/src/Utils/request/useQuery.ts b/src/Utils/request/useQuery.ts index 422e5f96868..b32129e46ee 100644 --- a/src/Utils/request/useQuery.ts +++ b/src/Utils/request/useQuery.ts @@ -3,8 +3,7 @@ import { useMemo, useRef } from "react"; import request from "@/Utils/request/request"; import { ApiRoute, RequestOptions } from "@/Utils/request/types"; - -import { mergeRequestOptions } from "./utils"; +import { mergeRequestOptions } from "@/Utils/request/utils"; export interface QueryOptions extends RequestOptions { prefetch?: boolean; diff --git a/src/components/Common/Charts/ObservationChart.tsx b/src/components/Common/Charts/ObservationChart.tsx index d210255a181..48a75093150 100644 --- a/src/components/Common/Charts/ObservationChart.tsx +++ b/src/components/Common/Charts/ObservationChart.tsx @@ -23,14 +23,13 @@ import { import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"; import { Avatar } from "@/components/Common/Avatar"; +import { ObservationHistoryTable } from "@/components/Common/Charts/ObservationHistoryTable"; import routes from "@/Utils/request/api"; import query from "@/Utils/request/query"; import { ObservationAnalyzeResponse } from "@/types/emr/observation"; import { Code } from "@/types/questionnaire/code"; -import { ObservationHistoryTable } from "./ObservationHistoryTable"; - export type ObservationPlotConfig = { id: string; name: string; diff --git a/src/components/Common/UserAutocompleteFormField.tsx b/src/components/Common/UserAutocompleteFormField.tsx index 90addafb702..d2bb2c5d056 100644 --- a/src/components/Common/UserAutocompleteFormField.tsx +++ b/src/components/Common/UserAutocompleteFormField.tsx @@ -1,5 +1,6 @@ import { useEffect, useState } from "react"; +import { Avatar } from "@/components/Common/Avatar"; import { Autocomplete } from "@/components/Form/FormFields/Autocomplete"; import FormField from "@/components/Form/FormFields/FormField"; import { @@ -18,8 +19,6 @@ import { mergeQueryOptions, } from "@/Utils/utils"; -import { Avatar } from "./Avatar"; - type BaseProps = FormFieldBaseProps & { placeholder?: string; userType?: UserType; diff --git a/src/components/Patient/PatientDetailsTab/index.tsx b/src/components/Patient/PatientDetailsTab/index.tsx index 38d01b06870..1e39a7b3444 100644 --- a/src/components/Patient/PatientDetailsTab/index.tsx +++ b/src/components/Patient/PatientDetailsTab/index.tsx @@ -1,15 +1,14 @@ import EncounterHistory from "@/components/Patient/PatientDetailsTab//EncounterHistory"; import { HealthProfileSummary } from "@/components/Patient/PatientDetailsTab//HealthProfileSummary"; +import { Appointments } from "@/components/Patient/PatientDetailsTab/Appointments"; import { Demography } from "@/components/Patient/PatientDetailsTab/Demography"; +import { PatientFilesTab } from "@/components/Patient/PatientDetailsTab/PatientFiles"; +import { PatientUsers } from "@/components/Patient/PatientDetailsTab/PatientUsers"; +import { ResourceRequests } from "@/components/Patient/PatientDetailsTab/ResourceRequests"; import { Updates } from "@/components/Patient/PatientDetailsTab/patientUpdates"; import { Patient } from "@/types/emr/newPatient"; -import { Appointments } from "./Appointments"; -import { PatientFilesTab } from "./PatientFiles"; -import { PatientUsers } from "./PatientUsers"; -import { ResourceRequests } from "./ResourceRequests"; - export interface PatientProps { facilityId: string; id: string; diff --git a/src/components/Patient/PatientInfoCard.tsx b/src/components/Patient/PatientInfoCard.tsx index 2eb63488c25..405b388ec86 100644 --- a/src/components/Patient/PatientInfoCard.tsx +++ b/src/components/Patient/PatientInfoCard.tsx @@ -29,6 +29,7 @@ import { } from "@/components/ui/popover"; import { Avatar } from "@/components/Common/Avatar"; +import ManageEncounterOrganizations from "@/components/Patient/ManageEncounterOrganizations"; import useQuestionnaireOptions from "@/hooks/useQuestionnaireOptions"; @@ -39,8 +40,6 @@ import { formatDateTime, formatPatientAge } from "@/Utils/utils"; import { Encounter, completedEncounterStatus } from "@/types/emr/encounter"; import { Patient } from "@/types/emr/newPatient"; -import ManageEncounterOrganizations from "./ManageEncounterOrganizations"; - export interface PatientInfoCardProps { patient: Patient; encounter: Encounter; diff --git a/src/components/Questionnaire/QuestionTypes/QuestionGroup.tsx b/src/components/Questionnaire/QuestionTypes/QuestionGroup.tsx index f615964eeec..ea97c23dc6d 100644 --- a/src/components/Questionnaire/QuestionTypes/QuestionGroup.tsx +++ b/src/components/Questionnaire/QuestionTypes/QuestionGroup.tsx @@ -3,13 +3,12 @@ import { memo } from "react"; import { cn } from "@/lib/utils"; import { QuestionLabel } from "@/components/Questionnaire/QuestionLabel"; +import { QuestionInput } from "@/components/Questionnaire/QuestionTypes/QuestionInput"; import { QuestionValidationError } from "@/types/questionnaire/batch"; import type { QuestionnaireResponse } from "@/types/questionnaire/form"; import type { EnableWhen, Question } from "@/types/questionnaire/question"; -import { QuestionInput } from "./QuestionInput"; - interface QuestionGroupProps { question: Question; encounterId?: string; diff --git a/src/components/Questionnaire/QuestionTypes/QuestionInput.tsx b/src/components/Questionnaire/QuestionTypes/QuestionInput.tsx index 87c913dbee7..9cfe2397cd0 100644 --- a/src/components/Questionnaire/QuestionTypes/QuestionInput.tsx +++ b/src/components/Questionnaire/QuestionTypes/QuestionInput.tsx @@ -5,7 +5,19 @@ import CareIcon from "@/CAREUI/icons/CareIcon"; import { Button } from "@/components/ui/button"; import { QuestionLabel } from "@/components/Questionnaire/QuestionLabel"; +import { AllergyQuestion } from "@/components/Questionnaire/QuestionTypes/AllergyQuestion"; import { AppointmentQuestion } from "@/components/Questionnaire/QuestionTypes/AppointmentQuestion"; +import { BooleanQuestion } from "@/components/Questionnaire/QuestionTypes/BooleanQuestion"; +import { ChoiceQuestion } from "@/components/Questionnaire/QuestionTypes/ChoiceQuestion"; +import { DateTimeQuestion } from "@/components/Questionnaire/QuestionTypes/DateTimeQuestion"; +import { DiagnosisQuestion } from "@/components/Questionnaire/QuestionTypes/DiagnosisQuestion"; +import { EncounterQuestion } from "@/components/Questionnaire/QuestionTypes/EncounterQuestion"; +import { MedicationRequestQuestion } from "@/components/Questionnaire/QuestionTypes/MedicationRequestQuestion"; +import { MedicationStatementQuestion } from "@/components/Questionnaire/QuestionTypes/MedicationStatementQuestion"; +import { NotesInput } from "@/components/Questionnaire/QuestionTypes/NotesInput"; +import { NumberQuestion } from "@/components/Questionnaire/QuestionTypes/NumberQuestion"; +import { SymptomQuestion } from "@/components/Questionnaire/QuestionTypes/SymptomQuestion"; +import { TextQuestion } from "@/components/Questionnaire/QuestionTypes/TextQuestion"; import { QuestionValidationError } from "@/types/questionnaire/batch"; import type { @@ -14,19 +26,6 @@ import type { } from "@/types/questionnaire/form"; import type { Question } from "@/types/questionnaire/question"; -import { AllergyQuestion } from "./AllergyQuestion"; -import { BooleanQuestion } from "./BooleanQuestion"; -import { ChoiceQuestion } from "./ChoiceQuestion"; -import { DateTimeQuestion } from "./DateTimeQuestion"; -import { DiagnosisQuestion } from "./DiagnosisQuestion"; -import { EncounterQuestion } from "./EncounterQuestion"; -import { MedicationRequestQuestion } from "./MedicationRequestQuestion"; -import { MedicationStatementQuestion } from "./MedicationStatementQuestion"; -import { NotesInput } from "./NotesInput"; -import { NumberQuestion } from "./NumberQuestion"; -import { SymptomQuestion } from "./SymptomQuestion"; -import { TextQuestion } from "./TextQuestion"; - interface QuestionInputProps { question: Question; questionnaireResponses: QuestionnaireResponse[]; diff --git a/src/components/Questionnaire/QuestionnaireEditor.tsx b/src/components/Questionnaire/QuestionnaireEditor.tsx index 459fa74455a..e343fff211d 100644 --- a/src/components/Questionnaire/QuestionnaireEditor.tsx +++ b/src/components/Questionnaire/QuestionnaireEditor.tsx @@ -29,6 +29,7 @@ import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"; import { Textarea } from "@/components/ui/textarea"; import Loading from "@/components/Common/Loading"; +import { QuestionnaireForm } from "@/components/Questionnaire/QuestionnaireForm"; import mutate from "@/Utils/request/mutate"; import query from "@/Utils/request/query"; @@ -46,8 +47,6 @@ import { } from "@/types/questionnaire/questionnaire"; import questionnaireApi from "@/types/questionnaire/questionnaireApi"; -import { QuestionnaireForm } from "./QuestionnaireForm"; - interface QuestionnaireEditorProps { id: string; } diff --git a/src/components/Questionnaire/QuestionnaireForm.tsx b/src/components/Questionnaire/QuestionnaireForm.tsx index a5b89383b8e..323da5d8345 100644 --- a/src/components/Questionnaire/QuestionnaireForm.tsx +++ b/src/components/Questionnaire/QuestionnaireForm.tsx @@ -12,6 +12,10 @@ import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert"; import { Button } from "@/components/ui/button"; import Loading from "@/components/Common/Loading"; +import { QuestionRenderer } from "@/components/Questionnaire/QuestionRenderer"; +import { QuestionnaireSearch } from "@/components/Questionnaire/QuestionnaireSearch"; +import { FIXED_QUESTIONNAIRES } from "@/components/Questionnaire/data/StructuredFormData"; +import { getStructuredRequests } from "@/components/Questionnaire/structured/handlers"; import { PLUGIN_Component } from "@/PluginEngine"; import routes from "@/Utils/request/api"; @@ -27,11 +31,6 @@ import type { Question } from "@/types/questionnaire/question"; import { QuestionnaireDetail } from "@/types/questionnaire/questionnaire"; import questionnaireApi from "@/types/questionnaire/questionnaireApi"; -import { QuestionRenderer } from "./QuestionRenderer"; -import { QuestionnaireSearch } from "./QuestionnaireSearch"; -import { FIXED_QUESTIONNAIRES } from "./data/StructuredFormData"; -import { getStructuredRequests } from "./structured/handlers"; - export interface QuestionnaireFormState { questionnaire: QuestionnaireDetail; responses: QuestionnaireResponse[]; diff --git a/src/components/Questionnaire/show.tsx b/src/components/Questionnaire/show.tsx index a10c24aa2d3..249d19e0cf2 100644 --- a/src/components/Questionnaire/show.tsx +++ b/src/components/Questionnaire/show.tsx @@ -28,17 +28,16 @@ import { import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"; import Loading from "@/components/Common/Loading"; +import CloneQuestionnaireSheet from "@/components/Questionnaire/CloneQuestionnaireSheet"; +import ManageQuestionnaireOrganizationsSheet from "@/components/Questionnaire/ManageQuestionnaireOrganizationsSheet"; +import ManageQuestionnaireTagsSheet from "@/components/Questionnaire/ManageQuestionnaireTagsSheet"; +import { QuestionnaireForm } from "@/components/Questionnaire/QuestionnaireForm"; import mutate from "@/Utils/request/mutate"; import query from "@/Utils/request/query"; import type { Question } from "@/types/questionnaire/question"; import questionnaireApi from "@/types/questionnaire/questionnaireApi"; -import CloneQuestionnaireSheet from "./CloneQuestionnaireSheet"; -import ManageQuestionnaireOrganizationsSheet from "./ManageQuestionnaireOrganizationsSheet"; -import ManageQuestionnaireTagsSheet from "./ManageQuestionnaireTagsSheet"; -import { QuestionnaireForm } from "./QuestionnaireForm"; - interface QuestionnaireShowProps { id: string; } diff --git a/src/components/Users/UserBanner.tsx b/src/components/Users/UserBanner.tsx index f48388f8540..c30d234357c 100644 --- a/src/components/Users/UserBanner.tsx +++ b/src/components/Users/UserBanner.tsx @@ -1,10 +1,9 @@ import { Avatar } from "@/components/Common/Avatar"; +import { UserStatusIndicator } from "@/components/Users/UserListAndCard"; import { formatDisplayName, formatName } from "@/Utils/utils"; import { UserBase } from "@/types/user/user"; -import { UserStatusIndicator } from "./UserListAndCard"; - export default function UserBanner({ userData }: { userData: UserBase }) { if (!userData) { return; diff --git a/src/pages/Encounters/EncounterShow.tsx b/src/pages/Encounters/EncounterShow.tsx index 0440aa49aae..31ebb2fdfce 100644 --- a/src/pages/Encounters/EncounterShow.tsx +++ b/src/pages/Encounters/EncounterShow.tsx @@ -16,13 +16,12 @@ import query from "@/Utils/request/query"; import { formatDateTime, keysOf } from "@/Utils/utils"; import { EncounterFilesTab } from "@/pages/Encounters/tabs/EncounterFilesTab"; import { EncounterMedicinesTab } from "@/pages/Encounters/tabs/EncounterMedicinesTab"; +import { EncounterNotesTab } from "@/pages/Encounters/tabs/EncounterNotesTab"; import { EncounterPlotsTab } from "@/pages/Encounters/tabs/EncounterPlotsTab"; import { EncounterUpdatesTab } from "@/pages/Encounters/tabs/EncounterUpdatesTab"; import { Encounter } from "@/types/emr/encounter"; import { Patient } from "@/types/emr/newPatient"; -import { EncounterNotesTab } from "./tabs/EncounterNotesTab"; - export interface EncounterTabProps { facilityId: string; encounter: Encounter; diff --git a/src/pages/Facility/FacilitiesPage.tsx b/src/pages/Facility/FacilitiesPage.tsx index 2540cd82e5a..df27bcf4928 100644 --- a/src/pages/Facility/FacilitiesPage.tsx +++ b/src/pages/Facility/FacilitiesPage.tsx @@ -16,12 +16,11 @@ import { RESULTS_PER_PAGE_LIMIT } from "@/common/constants"; import query from "@/Utils/request/query"; import { PaginatedResponse } from "@/Utils/request/types"; +import { FacilityCard } from "@/pages/Facility/components/FacilityCard"; import OrganizationFilter from "@/pages/Organization/components/OrganizationFilter"; import { FacilityData } from "@/types/facility/facility"; import facilityApi from "@/types/facility/facilityApi"; -import { FacilityCard } from "./components/FacilityCard"; - export function FacilitiesPage() { const { mainLogo } = careConfig; const { qParams, updateQuery, advancedFilter, clearSearch, Pagination } = diff --git a/src/pages/Facility/FacilityDetailsPage.tsx b/src/pages/Facility/FacilityDetailsPage.tsx index c652748bd7f..768c6bcb534 100644 --- a/src/pages/Facility/FacilityDetailsPage.tsx +++ b/src/pages/Facility/FacilityDetailsPage.tsx @@ -19,9 +19,8 @@ import useFilters from "@/hooks/useFilters"; import routes from "@/Utils/request/api"; import query from "@/Utils/request/query"; import { PaginatedResponse } from "@/Utils/request/types"; - -import { FeatureBadge } from "./Utils"; -import { UserCard } from "./components/UserCard"; +import { FeatureBadge } from "@/pages/Facility/Utils"; +import { UserCard } from "@/pages/Facility/components/UserCard"; interface Props { id: string; diff --git a/src/pages/FacilityOrganization/FacilityOrganizationIndex.tsx b/src/pages/FacilityOrganization/FacilityOrganizationIndex.tsx index 81a3dc4042a..cc0094704f6 100644 --- a/src/pages/FacilityOrganization/FacilityOrganizationIndex.tsx +++ b/src/pages/FacilityOrganization/FacilityOrganizationIndex.tsx @@ -19,10 +19,9 @@ import Page from "@/components/Common/Page"; import routes from "@/Utils/request/api"; import query from "@/Utils/request/query"; +import CreateFacilityOrganizationSheet from "@/pages/FacilityOrganization/components/CreateFacilityOrganizationSheet"; import { FacilityOrganization } from "@/types/facilityOrganization/facilityOrganization"; -import CreateFacilityOrganizationSheet from "./components/CreateFacilityOrganizationSheet"; - export default function FacilityOrganizationIndex({ facilityId, }: { diff --git a/src/pages/FacilityOrganization/FacilityOrganizationUsers.tsx b/src/pages/FacilityOrganization/FacilityOrganizationUsers.tsx index f467018fe08..aa4a6742f44 100644 --- a/src/pages/FacilityOrganization/FacilityOrganizationUsers.tsx +++ b/src/pages/FacilityOrganization/FacilityOrganizationUsers.tsx @@ -12,13 +12,12 @@ import { UserStatusIndicator } from "@/components/Users/UserListAndCard"; import routes from "@/Utils/request/api"; import query from "@/Utils/request/query"; +import EditFacilityUserRoleSheet from "@/pages/FacilityOrganization/components/EditFacilityUserRoleSheet"; +import FacilityOrganizationLayout from "@/pages/FacilityOrganization/components/FacilityOrganizationLayout"; +import LinkFacilityUserSheet from "@/pages/FacilityOrganization/components/LinkFacilityUserSheet"; import AddUserSheet from "@/pages/Organization/components/AddUserSheet"; import { OrganizationUserRole } from "@/types/organization/organization"; -import EditFacilityUserRoleSheet from "./components/EditFacilityUserRoleSheet"; -import FacilityOrganizationLayout from "./components/FacilityOrganizationLayout"; -import LinkFacilityUserSheet from "./components/LinkFacilityUserSheet"; - interface Props { id: string; facilityId: string; diff --git a/src/pages/FacilityOrganization/FacilityOrganizationView.tsx b/src/pages/FacilityOrganization/FacilityOrganizationView.tsx index 2859d6ec99e..6c41378ad6c 100644 --- a/src/pages/FacilityOrganization/FacilityOrganizationView.tsx +++ b/src/pages/FacilityOrganization/FacilityOrganizationView.tsx @@ -14,9 +14,8 @@ import Pagination from "@/components/Common/Pagination"; import routes from "@/Utils/request/api"; import query from "@/Utils/request/query"; - -import CreateFacilityOrganizationSheet from "./components/CreateFacilityOrganizationSheet"; -import FacilityOrganizationLayout from "./components/FacilityOrganizationLayout"; +import CreateFacilityOrganizationSheet from "@/pages/FacilityOrganization/components/CreateFacilityOrganizationSheet"; +import FacilityOrganizationLayout from "@/pages/FacilityOrganization/components/FacilityOrganizationLayout"; interface Props { id: string; diff --git a/src/pages/Organization/OrganizationFacilities.tsx b/src/pages/Organization/OrganizationFacilities.tsx index c19afd71f49..d73833f6924 100644 --- a/src/pages/Organization/OrganizationFacilities.tsx +++ b/src/pages/Organization/OrganizationFacilities.tsx @@ -14,12 +14,11 @@ import useFilters from "@/hooks/useFilters"; import routes from "@/Utils/request/api"; import query from "@/Utils/request/query"; +import AddFacilitySheet from "@/pages/Organization/components/AddFacilitySheet"; +import EditFacilitySheet from "@/pages/Organization/components/EditFacilitySheet"; +import OrganizationLayout from "@/pages/Organization/components/OrganizationLayout"; import { BaseFacility } from "@/types/facility/facility"; -import AddFacilitySheet from "./components/AddFacilitySheet"; -import EditFacilitySheet from "./components/EditFacilitySheet"; -import OrganizationLayout from "./components/OrganizationLayout"; - interface Props { id: string; navOrganizationId?: string; diff --git a/src/pages/Organization/OrganizationPatients.tsx b/src/pages/Organization/OrganizationPatients.tsx index cae267c6085..df35cb1364f 100644 --- a/src/pages/Organization/OrganizationPatients.tsx +++ b/src/pages/Organization/OrganizationPatients.tsx @@ -15,12 +15,11 @@ import SearchByMultipleFields from "@/components/Common/SearchByMultipleFields"; import useFilters from "@/hooks/useFilters"; import query from "@/Utils/request/query"; +import OrganizationLayout from "@/pages/Organization/components/OrganizationLayout"; import { Patient } from "@/types/emr/newPatient"; import { Organization } from "@/types/organization/organization"; import organizationApi from "@/types/organization/organizationApi"; -import OrganizationLayout from "./components/OrganizationLayout"; - interface Props { id: string; navOrganizationId?: string; diff --git a/src/pages/Organization/OrganizationUsers.tsx b/src/pages/Organization/OrganizationUsers.tsx index 96a03e780d7..1ec284dbcc4 100644 --- a/src/pages/Organization/OrganizationUsers.tsx +++ b/src/pages/Organization/OrganizationUsers.tsx @@ -13,13 +13,12 @@ import { UserStatusIndicator } from "@/components/Users/UserListAndCard"; import useFilters from "@/hooks/useFilters"; import query from "@/Utils/request/query"; +import AddUserSheet from "@/pages/Organization/components/AddUserSheet"; +import EditUserRoleSheet from "@/pages/Organization/components/EditUserRoleSheet"; +import LinkUserSheet from "@/pages/Organization/components/LinkUserSheet"; +import OrganizationLayout from "@/pages/Organization/components/OrganizationLayout"; import organizationApi from "@/types/organization/organizationApi"; -import AddUserSheet from "./components/AddUserSheet"; -import EditUserRoleSheet from "./components/EditUserRoleSheet"; -import LinkUserSheet from "./components/LinkUserSheet"; -import OrganizationLayout from "./components/OrganizationLayout"; - interface Props { id: string; navOrganizationId?: string; diff --git a/src/pages/Organization/OrganizationView.tsx b/src/pages/Organization/OrganizationView.tsx index 3a0f140f250..73cf597f778 100644 --- a/src/pages/Organization/OrganizationView.tsx +++ b/src/pages/Organization/OrganizationView.tsx @@ -13,11 +13,10 @@ import { Input } from "@/components/ui/input"; import Pagination from "@/components/Common/Pagination"; import query from "@/Utils/request/query"; +import OrganizationLayout from "@/pages/Organization/components/OrganizationLayout"; import { Organization, getOrgLabel } from "@/types/organization/organization"; import organizationApi from "@/types/organization/organizationApi"; -import OrganizationLayout from "./components/OrganizationLayout"; - interface Props { id: string; navOrganizationId?: string; diff --git a/src/pages/Patient/index.tsx b/src/pages/Patient/index.tsx index ea1e8115b9d..e697c86cbee 100644 --- a/src/pages/Patient/index.tsx +++ b/src/pages/Patient/index.tsx @@ -15,11 +15,10 @@ import { usePatientContext } from "@/hooks/usePatientUser"; import query from "@/Utils/request/query"; import { formatName } from "@/Utils/utils"; +import AppointmentDialog from "@/pages/Patient/components/AppointmentDialog"; import PublicAppointmentApi from "@/types/scheduling/PublicAppointmentApi"; import { Appointment } from "@/types/scheduling/schedule"; -import AppointmentDialog from "./components/AppointmentDialog"; - function PatientIndex() { const { t } = useTranslation(); diff --git a/src/pluginTypes.ts b/src/pluginTypes.ts index 59d1d6f314d..09b1cd89c63 100644 --- a/src/pluginTypes.ts +++ b/src/pluginTypes.ts @@ -1,16 +1,15 @@ import { LazyExoticComponent } from "react"; import { UseFormReturn } from "react-hook-form"; +import { QuestionnaireFormState } from "@/components/Questionnaire/QuestionnaireForm"; import { UserAssignedModel } from "@/components/Users/models"; +import { AppRoutes } from "@/Routers/AppRouter"; import { EncounterTabProps } from "@/pages/Encounters/EncounterShow"; +import { pluginMap } from "@/pluginMap"; import { Encounter } from "@/types/emr/encounter"; import { Patient } from "@/types/emr/newPatient"; -import { AppRoutes } from "./Routers/AppRouter"; -import { QuestionnaireFormState } from "./components/Questionnaire/QuestionnaireForm"; -import { pluginMap } from "./pluginMap"; - export type DoctorConnectButtonComponentType = React.FC<{ user: UserAssignedModel; }>; diff --git a/src/types/emr/allergyIntolerance/allergyIntoleranceApi.ts b/src/types/emr/allergyIntolerance/allergyIntoleranceApi.ts index 2c2026d1d30..9ed4e996f01 100644 --- a/src/types/emr/allergyIntolerance/allergyIntoleranceApi.ts +++ b/src/types/emr/allergyIntolerance/allergyIntoleranceApi.ts @@ -1,7 +1,6 @@ import { HttpMethod, Type } from "@/Utils/request/api"; import { PaginatedResponse } from "@/Utils/request/types"; - -import { AllergyIntolerance } from "./allergyIntolerance"; +import { AllergyIntolerance } from "@/types/emr/allergyIntolerance/allergyIntolerance"; export default { getAllergy: { diff --git a/src/types/emr/diagnosis/diagnosisApi.ts b/src/types/emr/diagnosis/diagnosisApi.ts index b6e57f6cf1e..fef6107704b 100644 --- a/src/types/emr/diagnosis/diagnosisApi.ts +++ b/src/types/emr/diagnosis/diagnosisApi.ts @@ -1,7 +1,6 @@ import { HttpMethod, Type } from "@/Utils/request/api"; import { PaginatedResponse } from "@/Utils/request/types"; - -import { Diagnosis } from "./diagnosis"; +import { Diagnosis } from "@/types/emr/diagnosis/diagnosis"; export default { listDiagnosis: { diff --git a/src/types/emr/symptom/symptomApi.ts b/src/types/emr/symptom/symptomApi.ts index 4ddaeead93f..95a6f569347 100644 --- a/src/types/emr/symptom/symptomApi.ts +++ b/src/types/emr/symptom/symptomApi.ts @@ -1,7 +1,6 @@ import { HttpMethod, Type } from "@/Utils/request/api"; import { PaginatedResponse } from "@/Utils/request/types"; - -import { Symptom } from "./symptom"; +import { Symptom } from "@/types/emr/symptom/symptom"; export default { listSymptoms: { diff --git a/src/types/facility/facilityApi.ts b/src/types/facility/facilityApi.ts index 50a2f2772a9..9b57553de56 100644 --- a/src/types/facility/facilityApi.ts +++ b/src/types/facility/facilityApi.ts @@ -1,7 +1,6 @@ import { HttpMethod, Type } from "@/Utils/request/api"; import { PaginatedResponse } from "@/Utils/request/types"; - -import { FacilityData } from "./facility"; +import { FacilityData } from "@/types/facility/facility"; export default { getAllFacilities: { diff --git a/src/types/organization/organizationApi.ts b/src/types/organization/organizationApi.ts index 5181827622a..15b52d19a8e 100644 --- a/src/types/organization/organizationApi.ts +++ b/src/types/organization/organizationApi.ts @@ -1,8 +1,10 @@ import { HttpMethod, Type } from "@/Utils/request/api"; import { PaginatedResponse } from "@/Utils/request/types"; import { Patient } from "@/types/emr/newPatient"; - -import { Organization, OrganizationUserRole } from "./organization"; +import { + Organization, + OrganizationUserRole, +} from "@/types/organization/organization"; export default { listMine: { diff --git a/src/types/questionnaire/question.ts b/src/types/questionnaire/question.ts index 1297033349f..fae609e6294 100644 --- a/src/types/questionnaire/question.ts +++ b/src/types/questionnaire/question.ts @@ -1,4 +1,4 @@ -import { Code } from "./code"; +import { Code } from "@/types/questionnaire/code"; export type QuestionType = | "group" diff --git a/src/types/questionnaire/questionnaire.ts b/src/types/questionnaire/questionnaire.ts index abe632fd31a..ac66bdba2cd 100644 --- a/src/types/questionnaire/questionnaire.ts +++ b/src/types/questionnaire/questionnaire.ts @@ -1,6 +1,6 @@ -import { Code } from "./code"; -import { Question } from "./question"; -import { QuestionnaireTagModel } from "./tags"; +import { Code } from "@/types/questionnaire/code"; +import { Question } from "@/types/questionnaire/question"; +import { QuestionnaireTagModel } from "@/types/questionnaire/tags"; export type SubjectType = "patient" | "encounter"; diff --git a/src/types/questionnaire/questionnaireApi.ts b/src/types/questionnaire/questionnaireApi.ts index b475cbd2ce9..574ea36c043 100644 --- a/src/types/questionnaire/questionnaireApi.ts +++ b/src/types/questionnaire/questionnaireApi.ts @@ -1,9 +1,14 @@ import { HttpMethod, Type } from "@/Utils/request/api"; import { PaginatedResponse } from "@/Utils/request/types"; import { Organization } from "@/types/organization/organization"; - -import { QuestionnaireCreate, QuestionnaireDetail } from "./questionnaire"; -import { QuestionnaireTagModel, QuestionnaireTagSet } from "./tags"; +import { + QuestionnaireCreate, + QuestionnaireDetail, +} from "@/types/questionnaire/questionnaire"; +import { + QuestionnaireTagModel, + QuestionnaireTagSet, +} from "@/types/questionnaire/tags"; export default { list: { diff --git a/src/types/questionnaire/questionnaireResponse.ts b/src/types/questionnaire/questionnaireResponse.ts index a956e55062c..f8de9df08c7 100644 --- a/src/types/questionnaire/questionnaireResponse.ts +++ b/src/types/questionnaire/questionnaireResponse.ts @@ -1,9 +1,8 @@ +import { QuestionnaireResponse as Response } from "@/types/questionnaire/form"; +import { StructuredQuestionType } from "@/types/questionnaire/question"; +import { QuestionnaireDetail } from "@/types/questionnaire/questionnaire"; import { UserBase } from "@/types/user/user"; -import { QuestionnaireResponse as Response } from "./form"; -import { StructuredQuestionType } from "./question"; -import { QuestionnaireDetail } from "./questionnaire"; - export type StructuredResponseValue = { id: string; submit_type: "CREATE" | "UPDATE"; From 8b38470ce5f6fd4a636b7b80e659345c7bb7b5b0 Mon Sep 17 00:00:00 2001 From: AdityaJ2305 Date: Fri, 17 Jan 2025 18:06:56 +0530 Subject: [PATCH 09/13] file fix after rm samefileimport 2.0 --- src/components/Patient/diagnosis/list.tsx | 4 ++-- src/components/Patient/symptoms/list.tsx | 4 ++-- src/components/Questionnaire/QuestionRenderer.tsx | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/Patient/diagnosis/list.tsx b/src/components/Patient/diagnosis/list.tsx index 0df139f098f..f7c7ffeb65b 100644 --- a/src/components/Patient/diagnosis/list.tsx +++ b/src/components/Patient/diagnosis/list.tsx @@ -3,11 +3,11 @@ import { useQuery } from "@tanstack/react-query"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import { Skeleton } from "@/components/ui/skeleton"; +import { DiagnosisTable } from "@/components/Patient/diagnosis/DiagnosisTable"; + import query from "@/Utils/request/query"; import diagnosisApi from "@/types/emr/diagnosis/diagnosisApi"; -import { DiagnosisTable } from "./DiagnosisTable"; - interface DiagnosisListProps { patientId: string; encounterId?: string; diff --git a/src/components/Patient/symptoms/list.tsx b/src/components/Patient/symptoms/list.tsx index 20914788f00..f4320fc4238 100644 --- a/src/components/Patient/symptoms/list.tsx +++ b/src/components/Patient/symptoms/list.tsx @@ -3,11 +3,11 @@ import { useQuery } from "@tanstack/react-query"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import { Skeleton } from "@/components/ui/skeleton"; +import { SymptomTable } from "@/components/Patient/symptoms/SymptomTable"; + import query from "@/Utils/request/query"; import symptomApi from "@/types/emr/symptom/symptomApi"; -import { SymptomTable } from "./SymptomTable"; - interface SymptomsListProps { patientId: string; encounterId?: string; diff --git a/src/components/Questionnaire/QuestionRenderer.tsx b/src/components/Questionnaire/QuestionRenderer.tsx index 0b01894b9cf..cc118609bb9 100644 --- a/src/components/Questionnaire/QuestionRenderer.tsx +++ b/src/components/Questionnaire/QuestionRenderer.tsx @@ -2,6 +2,8 @@ import { useEffect, useRef } from "react"; import { cn } from "@/lib/utils"; +import { QuestionGroup } from "@/components/Questionnaire/QuestionTypes/QuestionGroup"; + import { QuestionValidationError } from "@/types/questionnaire/batch"; import { QuestionnaireResponse } from "@/types/questionnaire/form"; import { @@ -9,8 +11,6 @@ import { StructuredQuestionType, } from "@/types/questionnaire/question"; -import { QuestionGroup } from "./QuestionTypes/QuestionGroup"; - // Questions that should be rendered full width const FULL_WIDTH_QUESTION_TYPES: StructuredQuestionType[] = [ "medication_request", From 1c6c718ecc2d7ccf7f641cbcf14ff3b57e77b2b5 Mon Sep 17 00:00:00 2001 From: AdityaJ2305 Date: Fri, 17 Jan 2025 18:24:32 +0530 Subject: [PATCH 10/13] file fix after rm samefileimport 2.0 --- src/components/Patient/PatientDetailsTab/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/Patient/PatientDetailsTab/index.tsx b/src/components/Patient/PatientDetailsTab/index.tsx index 1e39a7b3444..e835e25961c 100644 --- a/src/components/Patient/PatientDetailsTab/index.tsx +++ b/src/components/Patient/PatientDetailsTab/index.tsx @@ -1,7 +1,7 @@ -import EncounterHistory from "@/components/Patient/PatientDetailsTab//EncounterHistory"; -import { HealthProfileSummary } from "@/components/Patient/PatientDetailsTab//HealthProfileSummary"; import { Appointments } from "@/components/Patient/PatientDetailsTab/Appointments"; import { Demography } from "@/components/Patient/PatientDetailsTab/Demography"; +import EncounterHistory from "@/components/Patient/PatientDetailsTab/EncounterHistory"; +import { HealthProfileSummary } from "@/components/Patient/PatientDetailsTab/HealthProfileSummary"; import { PatientFilesTab } from "@/components/Patient/PatientDetailsTab/PatientFiles"; import { PatientUsers } from "@/components/Patient/PatientDetailsTab/PatientUsers"; import { ResourceRequests } from "@/components/Patient/PatientDetailsTab/ResourceRequests"; From 293b09ffe260ca45d210a511519253d0675e5fb6 Mon Sep 17 00:00:00 2001 From: AdityaJ2305 Date: Sat, 18 Jan 2025 13:22:04 +0530 Subject: [PATCH 11/13] fix unused errors on some file --- src/Routers/AppRouter.tsx | 1 + src/Utils/request/types.ts | 1 + src/Utils/types.ts | 1 + src/components/ui/chart.tsx | 2 +- 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Routers/AppRouter.tsx b/src/Routers/AppRouter.tsx index 0b0ad6be251..7d910f60029 100644 --- a/src/Routers/AppRouter.tsx +++ b/src/Routers/AppRouter.tsx @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-unused-vars */ import careConfig from "@careConfig"; import { Redirect, useRedirect, useRoutes } from "raviger"; diff --git a/src/Utils/request/types.ts b/src/Utils/request/types.ts index 591b4404968..c2c95562e2e 100644 --- a/src/Utils/request/types.ts +++ b/src/Utils/request/types.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-unused-vars */ type QueryParamValue = | string | number diff --git a/src/Utils/types.ts b/src/Utils/types.ts index cdee60e1f2f..ff265d27e90 100644 --- a/src/Utils/types.ts +++ b/src/Utils/types.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-unused-vars */ import { UserBareMinimum } from "@/components/Users/models"; export interface BaseModel { diff --git a/src/components/ui/chart.tsx b/src/components/ui/chart.tsx index 5887b4d3acb..c4f15694133 100644 --- a/src/components/ui/chart.tsx +++ b/src/components/ui/chart.tsx @@ -7,7 +7,7 @@ import { cn } from "@/lib/utils"; const THEMES = { light: "", dark: ".dark" } as const; export type ChartConfig = { - [k in string]: { + [key: string]: { label?: React.ReactNode; icon?: React.ComponentType; } & ( From e7126189ea38000fe4bb20ac860bba60b211d8e2 Mon Sep 17 00:00:00 2001 From: AdityaJ2305 Date: Sun, 19 Jan 2025 10:47:44 +0530 Subject: [PATCH 12/13] eslint ignore specific lines --- src/Utils/request/types.ts | 2 +- src/Utils/types.ts | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Utils/request/types.ts b/src/Utils/request/types.ts index c2c95562e2e..756b33952fe 100644 --- a/src/Utils/request/types.ts +++ b/src/Utils/request/types.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-unused-vars */ type QueryParamValue = | string | number @@ -43,6 +42,7 @@ type ExtractRouteParams = : never; type PathParams = { + // eslint-disable-next-line @typescript-eslint/no-unused-vars [K in ExtractRouteParams]: string; }; diff --git a/src/Utils/types.ts b/src/Utils/types.ts index ff265d27e90..f34aac0a0fa 100644 --- a/src/Utils/types.ts +++ b/src/Utils/types.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-unused-vars */ import { UserBareMinimum } from "@/components/Users/models"; export interface BaseModel { @@ -14,6 +13,7 @@ export interface BaseModel { * If a property was originally `readonly`, it becomes optional. * Otherwise, it remains required. */ +/* eslint-disable @typescript-eslint/no-unused-vars */ export type Writable = T extends object ? { [P in keyof T as IfEquals< @@ -31,11 +31,13 @@ export type Writable = T extends object >]: T[P] extends object ? Writable : T[P]; } : T; +/* eslint-enable @typescript-eslint/no-unused-vars */ /** * A utility type that includes only the non-readonly properties of `T` recursively. * Or in other words, excludes all `readonly` properties. */ +/* eslint-disable @typescript-eslint/no-unused-vars */ export type WritableOnly = T extends object ? { [P in keyof T as IfEquals< @@ -45,6 +47,7 @@ export type WritableOnly = T extends object >]: T[P] extends object ? WritableOnly : T[P]; } : T; +/* eslint-enable @typescript-eslint/no-unused-vars */ type IfEquals = (() => T extends X ? 1 : 2) extends () => T extends Y ? 1 : 2 ? A : B; From 18572d9d18ad522b16b2bcec210f47a9bec3fb65 Mon Sep 17 00:00:00 2001 From: AdityaJ2305 Date: Sun, 19 Jan 2025 12:11:39 +0530 Subject: [PATCH 13/13] eslint ignore specific lines --- vite.config.mts | 1 + 1 file changed, 1 insertion(+) diff --git a/vite.config.mts b/vite.config.mts index 2cadc9f2e8b..47d631e7c4c 100644 --- a/vite.config.mts +++ b/vite.config.mts @@ -13,6 +13,7 @@ import { VitePWA } from "vite-plugin-pwa"; import { viteStaticCopy } from "vite-plugin-static-copy"; import { z } from "zod"; +// eslint-disable-next-line no-relative-import-paths/no-relative-import-paths import { treeShakeCareIcons } from "./plugins/treeShakeCareIcons"; const pdfWorkerPath = path.join(