Skip to content

Commit

Permalink
Merge branch 'issue/9984/comment-newline' of https://github.com/rajku…
Browse files Browse the repository at this point in the history
…-dev/care_fe into issue/9984/comment-newline
  • Loading branch information
rajku-dev committed Jan 17, 2025
2 parents 282df83 + 9a5c2d8 commit 28e79a0
Show file tree
Hide file tree
Showing 12 changed files with 383 additions and 468 deletions.
7 changes: 7 additions & 0 deletions public/locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,7 @@
"comments": "Comments",
"communication__sent_to_hcx": "Sent communication to HCX",
"completed": "Completed",
"computer_generated_prescription": "This is a computer generated prescription.",
"configure": "Configure",
"configure_facility": "Configure Facility",
"confirm": "Confirm",
Expand Down Expand Up @@ -865,6 +866,7 @@
"encounter_class__obsenc": "Observation",
"encounter_class__planned": "Planned",
"encounter_class__vr": "Virtual",
"encounter_date": "Encounter Date",
"encounter_date_field_label__A": "Date & Time of Admission to the Facility",
"encounter_date_field_label__DC": "Date & Time of Domiciliary Care commencement",
"encounter_date_field_label__DD": "Date & Time of Consultation",
Expand Down Expand Up @@ -1064,6 +1066,7 @@
"general_info_detail": "Provide the patient's personal details, including name, date of birth, gender, and contact information for accurate identification and communication.",
"generate_link_abha": "Generate/Link ABHA Number",
"generate_report": "Generate Report",
"generated_on": "Generated on:",
"generated_summary_caution": "This is a computer generated summary using the information captured in the CARE system.",
"generating": "Generating",
"generating_discharge_summary": "Generating discharge summary",
Expand Down Expand Up @@ -1288,6 +1291,7 @@
"medication_taken_between": "Medication Taken Between",
"medicine": "Medicine",
"medicine_administration_history": "Medicine Administration History",
"medicine_prescription": "Medicine Prescription",
"medicines_administered": "Medicine(s) administered",
"medicines_administered_error": "Error administering medicine(s)",
"member_id_required": "Member Id is required",
Expand Down Expand Up @@ -1370,6 +1374,7 @@
"no_log_update_delta": "No changes since previous log update",
"no_log_updates": "No log updates found",
"no_medical_history_available": "No Medical History Available",
"no_medications_found_for_this_encounter": "No medications found for this encounter.",
"no_notices_for_you": "No notices for you.",
"no_observations": "No Observations",
"no_ongoing_medications": "No Ongoing Medications",
Expand Down Expand Up @@ -1613,6 +1618,7 @@
"prescription_logs": "Prescription Logs",
"prescription_medication": "Prescription Medication",
"prescription_medications": "Prescription Medications",
"prescriptions": "Prescriptions",
"prescriptions__dosage_frequency": "Dosage & Frequency",
"prescriptions__medicine": "Medicine",
"prescriptions__route": "Route",
Expand All @@ -1627,6 +1633,7 @@
"principal": "Principal",
"principal_diagnosis": "Principal diagnosis",
"print": "Print",
"print_prescriptions": "Print Prescriptions",
"print_referral_letter": "Print Referral Letter",
"priority": "Priority",
"prn_prescription": "PRN Prescription",
Expand Down
5 changes: 1 addition & 4 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import PluginEngine from "@/PluginEngine";
import AuthUserProvider from "@/Providers/AuthUserProvider";
import HistoryAPIProvider from "@/Providers/HistoryAPIProvider";
import Routers from "@/Routers";
import { FeatureFlagsProvider } from "@/Utils/featureFlags";
import { handleHttpError } from "@/Utils/request/errorHandler";

import { PubSubProvider } from "./Utils/pubsubContext";
Expand Down Expand Up @@ -48,9 +47,7 @@ const App = () => {
unauthorized={<Routers.PublicRouter />}
otpAuthorized={<Routers.PatientRouter />}
>
<FeatureFlagsProvider>
<Routers.AppRouter />
</FeatureFlagsProvider>
<Routers.AppRouter />
</AuthUserProvider>

{/* Integrations */}
Expand Down
2 changes: 1 addition & 1 deletion src/CAREUI/misc/PrintPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default function PrintPreview(props: Props) {

return (
<Page title={props.title}>
<div className="mx-auto my-8 w-[50rem]">
<div className="mx-auto my-8 w-[50rem] border rounded-xl border-gray-200 shadow-2xl overflow-hidden">
<div className="top-0 z-20 flex gap-2 bg-secondary-100 px-2 py-4 xl:absolute xl:right-6 xl:top-8 xl:justify-end">
<Button variant="primary" disabled={props.disabled} onClick={print}>
<CareIcon icon="l-print" className="text-lg" />
Expand Down
81 changes: 0 additions & 81 deletions src/Utils/featureFlags.tsx

This file was deleted.

5 changes: 3 additions & 2 deletions src/Utils/request/api.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
AppointmentPatientRegister,
} from "@/pages/Patient/Utils";
import { Encounter, EncounterEditRequest } from "@/types/emr/encounter";
import { MedicationRequest } from "@/types/emr/medicationRequest";
import { MedicationRequestRead } from "@/types/emr/medicationRequest";
import { MedicationStatement } from "@/types/emr/medicationStatement";
import { PartialPatientModel, Patient } from "@/types/emr/newPatient";
import {
Expand Down Expand Up @@ -417,6 +417,7 @@ const routes = {
path: "/api/v1/plug_config/{slug}/",
method: "DELETE",
TRes: Type<Record<string, never>>(),
TBody: Type<void>(),
},
},
getQuestionnaireResponses: {
Expand Down Expand Up @@ -650,7 +651,7 @@ const routes = {
list: {
path: "/api/v1/patient/{patientId}/medication/request/",
method: "GET",
TRes: Type<PaginatedResponse<MedicationRequest>>(),
TRes: Type<PaginatedResponse<MedicationRequestRead>>(),
},
},

Expand Down
125 changes: 64 additions & 61 deletions src/components/Common/Breadcrumbs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
Breadcrumb,
BreadcrumbItem,
BreadcrumbList,
BreadcrumbSeparator,
} from "@/components/ui/breadcrumb";
import { Button } from "@/components/ui/button";
import {
Expand Down Expand Up @@ -82,88 +81,92 @@ export default function Breadcrumbs({
const renderCrumb = (crumb: any, index: number) => {
const isLastItem = index === crumbs!.length - 1;
return (
<li
<BreadcrumbItem
key={crumb.name}
className={classNames("text-sm font-normal", crumb.style)}
>
<div className="flex items-center">
<BreadcrumbSeparator className="text-gray-400" />
{isLastItem && <span className="text-gray-600">{crumb.name}</span>}
{!isLastItem ? (
<Button
asChild
variant="link"
className="p-1 font-normal text-gray-800 hover:text-gray-700"
>
<Link href={crumb.uri}>{crumb.name}</Link>
</Button>
) : (
<span className="text-gray-600">{crumb.name}</span>
)}
</div>
</li>
</BreadcrumbItem>
);
};

return (
<Breadcrumb>
<nav className={classNames("w-full", className)} aria-label="Breadcrumb">
<BreadcrumbList>
<ol className="flex flex-wrap items-center">
{!hideBack && (
<li className="mr-3 flex items-center">
<Button
variant="link"
type="button"
className="rounded bg-gray-200/50 px-1 text-sm font-normal text-gray-800 transition hover:bg-gray-200/75 hover:no-underline"
size="xs"
onClick={() => {
if (onBackClick && onBackClick() === false) return;
goBack(backUrl);
}}
>
<CareIcon icon="l-arrow-left" className="h-5 text-gray-700" />
<span className="pr-2">Back</span>
</Button>
</li>
)}
{!hideBack && (
<BreadcrumbItem>
<Button
asChild
variant="link"
className="p-1 font-normal text-gray-800 hover:text-gray-700"
type="button"
className="rounded bg-gray-200/50 px-1 text-sm font-normal text-gray-800 transition hover:bg-gray-200/75 hover:no-underline"
size="xs"
onClick={() => {
if (onBackClick && onBackClick() === false) return;
goBack(backUrl);
}}
>
<Link href="/">Home</Link>
<CareIcon icon="l-arrow-left" className="h-5 text-gray-700" />
<span className="pr-2">Back</span>
</Button>
</BreadcrumbItem>
{crumbs && crumbs.length > 1 && (
<>
{!showFullPath && (
<li>
<div className="flex items-center ml-[-2px]">
<BreadcrumbSeparator className="text-gray-400" />
<DropdownMenu>
<DropdownMenuTrigger asChild>
)}
<BreadcrumbItem>
<Button
asChild
variant="link"
className="p-1 font-normal text-gray-800 hover:text-gray-700"
>
<Link href="/">Home</Link>
</Button>
</BreadcrumbItem>
{crumbs && crumbs.length > 1 && (
<>
{!showFullPath && (
<BreadcrumbItem>
<DropdownMenu>
<DropdownMenuTrigger asChild>
<Button
variant="link"
className="h-auto p-0 font-light text-gray-500 hover:text-gray-700"
onClick={() => setShowFullPath(true)}
>
•••
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent align="start">
{crumbs.slice(0, -1).map((crumb, index) => (
<DropdownMenuItem key={index}>
<Button
asChild
variant="link"
className="h-auto p-0 font-light text-gray-500 hover:text-gray-700"
onClick={() => setShowFullPath(true)}
className="p-1 font-normal text-gray-800 underline underline-offset-2 hover:text-gray-700"
>
•••
<Link href={crumb.uri}>{crumb.name}</Link>
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent align="start">
{crumbs.slice(0, -1).map((crumb, index) => (
<DropdownMenuItem key={index}>
<Button
asChild
variant="link"
className="p-1 font-normal text-gray-800 underline underline-offset-2 hover:text-gray-700"
>
<Link href={crumb.uri}>{crumb.name}</Link>
</Button>
</DropdownMenuItem>
))}
</DropdownMenuContent>
</DropdownMenu>
</div>
</li>
)}
{showFullPath && crumbs.slice(0, -1).map(renderCrumb)}
</>
)}
{crumbs?.length &&
renderCrumb(crumbs[crumbs.length - 1], crumbs.length - 1)}
</ol>
</DropdownMenuItem>
))}
</DropdownMenuContent>
</DropdownMenu>
</BreadcrumbItem>
)}
{showFullPath && crumbs.slice(0, -1).map(renderCrumb)}
</>
)}
{crumbs?.length &&
renderCrumb(crumbs[crumbs.length - 1], crumbs.length - 1)}
</BreadcrumbList>
</nav>
</Breadcrumb>
Expand Down
3 changes: 0 additions & 3 deletions src/components/Facility/models.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { UserBareMinimum } from "@/components/Users/models";

import { FeatureFlag } from "@/Utils/featureFlags";

export interface FacilityModel {
id?: string;
name?: string;
Expand All @@ -20,7 +18,6 @@ export interface FacilityModel {
created_date?: string;
geo_organization?: string;
pincode?: string;
facility_flags?: FeatureFlag[];
latitude?: string;
longitude?: string;
is_public?: boolean;
Expand Down
2 changes: 0 additions & 2 deletions src/components/Users/models.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { Gender, UserType } from "@/components/Users/UserFormValidations";

import { GENDER_TYPES } from "@/common/constants";

import { FeatureFlag } from "@/Utils/featureFlags";
import { Organization } from "@/types/organization/organization";

export type UpdatePasswordForm = {
Expand Down Expand Up @@ -46,7 +45,6 @@ export type UserModel = UserBareMinimum & {
doctor_experience_commenced_on?: string;
doctor_medical_council_registration?: string;
weekly_working_hours?: string | null;
user_flags?: FeatureFlag[];
facilities?: UserFacilityModel[];
organizations?: Organization[];
permissions: string[];
Expand Down
Loading

0 comments on commit 28e79a0

Please sign in to comment.