Skip to content

Commit

Permalink
New Patient Search and Register UI (#9400)
Browse files Browse the repository at this point in the history
  • Loading branch information
shivankacker authored Dec 24, 2024
1 parent 2203a25 commit 35e0725
Show file tree
Hide file tree
Showing 49 changed files with 2,386 additions and 2,192 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@
"@pnotify/core": "^5.2.0",
"@pnotify/mobile": "^5.2.0",
"@radix-ui/react-alert-dialog": "^1.1.2",
"@radix-ui/react-checkbox": "^1.1.2",
"@radix-ui/react-checkbox": "^1.1.3",
"@radix-ui/react-dialog": "^1.1.2",
"@radix-ui/react-dropdown-menu": "^2.1.2",
"@radix-ui/react-icons": "^1.3.2",
"@radix-ui/react-label": "^2.1.0",
"@radix-ui/react-popover": "^1.1.2",
"@radix-ui/react-radio-group": "^1.2.1",
"@radix-ui/react-radio-group": "^1.2.2",
"@radix-ui/react-scroll-area": "^1.2.2",
"@radix-ui/react-select": "^2.1.2",
"@radix-ui/react-separator": "^1.1.0",
Expand Down
37 changes: 37 additions & 0 deletions public/locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -337,10 +337,13 @@
"admitted_on": "Admitted On",
"advanced_filters": "Advanced Filters",
"age": "Age",
"age_input_warning": "While entering a patient's age is an option, please note that only the year of birth will be captured from this information.",
"age_input_warning_bold": "Recommended only when the patient's date of birth is unknown",
"age_notice": "Only year of birth will be stored for age.",
"all": "All",
"all_changes_have_been_saved": "All changes have been saved",
"all_details": "All Details",
"all_patients": "All Patients",
"allergies": "Allergies",
"allow_transfer": "Allow Transfer",
"allowed_formats_are": "Allowed formats are",
Expand Down Expand Up @@ -635,6 +638,7 @@
"date_of_result": "Covid confirmation date",
"date_of_return": "Date of Return",
"date_of_test": "Date of sample collection for Covid testing",
"day": "Day",
"days": "Days",
"death_report": "Death Report",
"delete": "Delete",
Expand Down Expand Up @@ -685,6 +689,7 @@
"disease_status": "Disease status",
"district": "District",
"district_program_management_supporting_unit": "District Program Management Supporting Unit",
"dob": "DOB",
"dob_format": "Please enter date in DD/MM/YYYY format",
"doc_will_visit_patient": "will visit the patient at the scheduled time.",
"doctor_experience_error": "Please enter a valid number between 0 and 100.",
Expand Down Expand Up @@ -737,8 +742,10 @@
"emergency_contact": "Emergency Contact",
"emergency_contact_number": "Emergency Contact Number",
"emergency_contact_person_name": "Emergency Contact Person Name",
"emergency_contact_person_name_details": "Emergency contact person (Father, Mother, Spouse, Sibling, Friend)",
"emergency_contact_person_name_volunteer": "Emergency Contact Person Name (Volunteer)",
"emergency_contact_volunteer": "Emergency Contact (Volunteer)",
"emergency_phone_number": "Emergency Phone Number",
"empty_date_time": "--:-- --; --/--/----",
"encounter_date_field_label__A": "Date & Time of Admission to the Facility",
"encounter_date_field_label__DC": "Date & Time of Domiciliary Care commencement",
Expand Down Expand Up @@ -790,6 +797,9 @@
"expired": "Expired",
"expired_on": "Expired On",
"expires_on": "Expires On",
"export": "Export",
"export_live_patients": "Export Live Patients",
"exporting": "Exporting",
"facilities": "Facilities",
"facility": "Facility",
"facility_consent_requests_page_title": "Patient Consent List",
Expand Down Expand Up @@ -843,6 +853,7 @@
"full_name": "Full Name",
"full_screen": "Full Screen",
"gender": "Gender",
"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_summary_caution": "This is a computer generated summary using the information captured in the CARE system.",
Expand Down Expand Up @@ -909,9 +920,11 @@
"insurance__insurer_name": "Insurer Name",
"insurance__member_id": "Member ID",
"insurance__policy_name": "Policy ID / Policy Name",
"insurance_details_detail": "Include details of all the Insurance Policies held by the Patient for smooth insurance processing",
"insurer_name_required": "Insurer Name is required",
"international_mobile": "International Mobile",
"invalid_asset_id_msg": "Oops! The asset ID you entered does not appear to be valid.",
"invalid_date_format": "Invalid date format, expected {{format}}",
"invalid_email": "Please enter a valid email address",
"invalid_ip_address": "Invalid IP Address",
"invalid_link_msg": "It appears that the password reset link you have used is either invalid or expired. Please request a new password reset link.",
Expand Down Expand Up @@ -962,6 +975,7 @@
"lab_tests": "Lab Tests",
"label": "Label",
"landline": "Indian landline",
"landmark": "Landmark",
"language_selection": "Language Selection",
"languages": "Languages",
"last_administered": "Last administered",
Expand Down Expand Up @@ -1058,6 +1072,7 @@
"modified_date": "Modified Date",
"modified_on": "Modified On",
"monitor": "Monitor",
"month": "Month",
"more_details": "More details",
"more_info": "More Info",
"morning_slots": "Morning Slots",
Expand Down Expand Up @@ -1093,6 +1108,7 @@
"no_facilities": "No Facilities found",
"no_files_found": "No {{type}} files found",
"no_home_facility": "No home facility",
"no_home_facility_found": "No home facility found",
"no_image_found": "No image found",
"no_investigation": "No investigation Reports found",
"no_investigation_suggestions": "No Investigation Suggestions",
Expand Down Expand Up @@ -1210,6 +1226,8 @@
"patient_phone_number": "Patient Phone Number",
"patient_profile": "Patient Profile",
"patient_profile_created_by": "Patient profile created by",
"patient_records_found": "Patient Records Found",
"patient_records_found_description": "It appears that there are patient records that contain the same phone number as the one you just entered. ",
"patient_registration": "Patient Registration",
"patient_registration__address": "Address",
"patient_registration__age": "Age",
Expand All @@ -1219,9 +1237,13 @@
"patient_registration__contact": "Emergency Contact",
"patient_registration__gender": "Gender",
"patient_registration__name": "Name",
"patient_registration_error": "Could not register patient",
"patient_registration_success": "Patient Registered Successfully",
"patient_state": "Patient State",
"patient_status": "Patient Status",
"patient_transfer_birth_match_note": "Note: Year of birth must match the patient to process the transfer request.",
"patient_update_error": "Could not update patient",
"patient_update_success": "Patient Updated Sucessfully",
"patients": "Patients",
"pending": "Pending",
"permanent_address": "Permanent Address",
Expand All @@ -1234,14 +1256,17 @@
"phone_no": "Phone no.",
"phone_number": "Phone Number",
"phone_number_at_current_facility": "Phone Number of Contact person at current Facility",
"phone_number_min_error": "Phone number must be at least 10 characters long",
"pincode": "Pincode",
"pincode_autofill": "State and District auto-filled from Pincode",
"please_assign_bed_to_patient": "Please assign a bed to this patient",
"please_check_your_messages": "Please check your messages",
"please_confirm_password": "Please confirm your new password.",
"please_enter_a_reason_for_the_shift": "Please enter a reason for the shift.",
"please_enter_current_password": "Please enter your current password.",
"please_enter_new_password": "Please enter your new password.",
"please_enter_username": "Please enter the username",
"please_fix_errors": "Please fix the errors in the highlighted fields and try submitting again.",
"please_select_a_facility": "Please select a facility",
"please_select_breathlessness_level": "Please select Breathlessness Level",
"please_select_district": "Please select the district",
Expand Down Expand Up @@ -1289,6 +1314,7 @@
"preset_updated": "Preset updated",
"prev_sessions": "Prev Sessions",
"primary_ph_no": "Primary Ph No.",
"primary_phone_no": "Primary ph. no.",
"principal": "Principal",
"principal_diagnosis": "Principal diagnosis",
"print": "Print",
Expand Down Expand Up @@ -1405,6 +1431,7 @@
"scribe_error": "Could not autofill fields",
"search": "Search",
"search_by_emergency_contact_phone_number": "Search by Emergency Contact Phone Number",
"search_by_emergency_phone_number": "Search by Emergency Phone Number",
"search_by_patient_name": "Search by Patient Name",
"search_by_patient_no": "Search by Patient Number",
"search_by_phone_number": "Search by Phone Number",
Expand All @@ -1413,6 +1440,7 @@
"search_icd11_placeholder": "Search for ICD-11 Diagnoses",
"search_investigation_placeholder": "Search Investigation & Groups",
"search_patient": "Search Patient",
"search_patients": "Search Patients",
"search_resource": "Search Resource",
"see_attachments": "See Attachments",
"select": "Select",
Expand All @@ -1431,6 +1459,7 @@
"select_policy_to_add_items": "Select a Policy to Add Items",
"select_practitioner": "Select Practicioner",
"select_register_patient": "Select/Register Patient",
"select_seven_day_period": "Select a seven day period",
"select_skills": "Select and add some skills",
"select_wards": "Select wards",
"self_booked": "Self-booked",
Expand Down Expand Up @@ -1475,6 +1504,7 @@
"skill_added_successfully": "Skill added successfully",
"skills": "Skills",
"social_profile": "Social Profile",
"social_profile_detail": "Include occupation, ration card category, socioeconomic status, and domestic healthcare support for a complete profile.",
"socioeconomic_status": "Socioeconomic status",
"software_update": "Software Update",
"something_went_wrong": "Something went wrong..!",
Expand Down Expand Up @@ -1523,6 +1553,7 @@
"titrate_dosage": "Titrate Dosage",
"to": "to",
"to_be_conducted": "To be conducted",
"to_proceed_with_registration": "To proceed with registration, please create a new patient.",
"to_view_available_slots_select_resource_and_date": "To view available slots, select a preferred resource and date.",
"today": "Today",
"token": "Token",
Expand Down Expand Up @@ -1551,6 +1582,7 @@
"type_b_cylinders": "B Type Cylinders",
"type_c_cylinders": "C Type Cylinders",
"type_d_cylinders": "D Type Cylinders",
"type_patient_name": "Type Patient Name",
"type_to_search": "Type to search",
"type_your_comment": "Type your comment",
"type_your_reason_here": "Type your reason here",
Expand Down Expand Up @@ -1610,11 +1642,14 @@
"upload_headings__supporting_info": "Upload Supporting Info",
"upload_report": "Upload Report",
"uploading": "Uploading",
"use_address_as_permanent": "Use this address for permanent address",
"use_existing_abha_address": "Use Existing ABHA Address",
"use_phone_number_for_emergency": "Use this phone number for emergency contact",
"user_add_error": "Error while adding User",
"user_added_successfully": "User added successfully",
"user_delete_error": "Error while deleting User",
"user_deleted_successfully": "User Deleted Successfully",
"user_deleted_successfuly": "User Deleted Successfully",
"user_details": "User Details",
"user_details_update_error": "Error while updating user details",
"user_details_update_success": "User details updated successfully",
Expand Down Expand Up @@ -1674,6 +1709,7 @@
"voice_autofill": "Voice Autofill",
"volunteer_assigned": "Volunteer assigned successfully",
"volunteer_contact": "Volunteer Contact",
"volunteer_contact_detail": "Provide the name and contact details of a volunteer who can assist the patient in emergencies. This should be someone outside the family.",
"volunteer_unassigned": "Volunteer unassigned successfully",
"volunteer_update": "Volunteer updated successfully",
"waitlist": "Waitlist",
Expand All @@ -1687,6 +1723,7 @@
"width": "Width ({{unit}})",
"with": "with",
"working_status": "Working Status",
"year": "Year",
"year_of_birth": "Year of Birth",
"years": "years",
"years_of_experience": "Years of Experience",
Expand Down
15 changes: 8 additions & 7 deletions src/CAREUI/interactive/FiltersSlideover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { useTranslation } from "react-i18next";
import CareIcon from "@/CAREUI/icons/CareIcon";
import SlideOver from "@/CAREUI/interactive/SlideOver";

import { Button } from "@/components/ui/button";

import ButtonV2 from "@/components/Common/ButtonV2";

import useFilters from "@/hooks/useFilters";
Expand Down Expand Up @@ -31,7 +33,7 @@ export default function FiltersSlideover({
setOpen={advancedFilter.setShow}
title={
<div className="flex items-center justify-between">
<span className="text-lg font-bold">{t("advanced_filters")}</span>
<span className="text-lg font-bold">{t("filters")}</span>
<div className="mr-2 flex items-center justify-end gap-1">
<ButtonV2
variant="danger"
Expand All @@ -58,15 +60,14 @@ export default function FiltersSlideover({
export const AdvancedFilterButton = ({ onClick }: { onClick: () => void }) => {
const { t } = useTranslation();
return (
<ButtonV2
ghost
border
className="w-full bg-white md:w-auto"
<Button
variant={"outline_primary"}
onClick={onClick}
id="advanced-filter"
className="gap-2"
>
<CareIcon icon="l-filter" />
<span className="py-0.5">{t("advanced_filters")}</span>
</ButtonV2>
<span className="py-0.5">{t("filters")}</span>
</Button>
);
};
79 changes: 79 additions & 0 deletions src/CAREUI/misc/SectionNavigator.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
import { useEffect, useState } from "react";

import { cn } from "@/lib/utils";

import { Button } from "@/components/ui/button";

export default function SectionNavigator(props: {
sections: { label: string; id: string }[];
className?: string;
}) {
const { sections, className } = props;

const [activeSection, setActiveSection] = useState<string | null>(null);

useEffect(() => {
const updateActiveSection = () => {
sections.forEach((section) => {
const element = document.getElementById(section.id);
if (element) {
const rect = element.getBoundingClientRect();
if (rect.top >= 0 && rect.bottom <= window.innerHeight) {
setActiveSection(section.id);
}
}
});
};

const observer = new IntersectionObserver(
(entries) => {
entries.forEach((entry) => {
if (entry.isIntersecting) {
setActiveSection(entry.target.id);
}
});
},
{ rootMargin: "0px 0px -80% 0px", threshold: 0.1 },
);

sections.forEach((section) => {
const element = document.getElementById(section.id);
if (element) {
observer.observe(element);
}
});

updateActiveSection(); // Update on page load

return () => {
sections.forEach((section) => {
const element = document.getElementById(section.id);
if (element) {
observer.unobserve(element);
}
});
};
}, [sections]);

return (
<div className={cn("sticky top-4 left-0 flex flex-col w-52", className)}>
{sections.map((section) => (
<Button
key={section.id}
className={cn(
"justify-start bg-transparent shadow-none text-gray-700 hover:bg-black/5",
activeSection === section.id && "text-primary-500 font-semibold",
)}
onClick={() => {
const element = document.getElementById(section.id);
if (element) {
element.scrollIntoView({ behavior: "smooth" });
}
}}
>
{section.label}
</Button>
))}
</div>
);
}
Loading

0 comments on commit 35e0725

Please sign in to comment.