Skip to content

Commit

Permalink
Patient Registration form refactor (#9854)
Browse files Browse the repository at this point in the history
* added patient home actions plugin hook

* expose core app env in global scope

* enable heatmap and fix appointments column size (#9713)

* Fix: Forgot password error should be handled properly  (#9707)

* forgot password mutation

* updated

* Added no user assingned message (#9666)

Co-authored-by: Rithvik Nishad <[email protected]>

* Remove facility name from facility users page (#9746)

* Enhance organization management by adding new organization types and updating related components. Refactor organization level retrieval to use metadata for improved localization. Remove deprecated organization levels constant and clean up unused code in various components.

* Cancel button fix in Book Appointment screen (#9757)

* Add public flag to facility (#9759)

* Auto-Hide Sidebar on mobile (#9758)

* Implement Permission Context and Update User Permissions Handling

- Introduced a new PermissionContext to manage user permissions and super admin status across the application.
- Updated AppRouter to utilize PermissionProvider for managing permissions.
- Changed UserModel to store permissions as strings instead of objects.
- Refactored OrganizationFacilities and OrganizationPatients components to use updated permission checks and organization identifiers.
- Enhanced OrganizationLayout to conditionally render navigation items based on user permissions.

This commit improves the permission management system and ensures consistent handling of user permissions throughout the application.

* Replaced ButtonV2's with Button in entire codebase (#9736)

* fixes overlapping text (#9767)

* Care Loading icon in organization and facility users (#9723)

* Clean up facility search in index

* Add searchPostFix prop to ValueSetSelect and related components

- Introduced a new `searchPostFix` prop in `ValueSetSelect` to allow appending a suffix to the search query.
- Updated `MedicationRequestQuestion` and `MedicationStatementQuestion` components to utilize the `searchPostFix` prop with a default value of " clinical drug".
- This change enhances search functionality by providing more context in search queries.

* Clean up patient login

* Fix cancel button in update encounter form (#9772)

* disabled image build and deploy for care stagin (#9779)

* Bump @tanstack/react-query-devtools from 5.62.11 to 5.62.15 (#9785)

Bumps [@tanstack/react-query-devtools](https://github.com/TanStack/query/tree/HEAD/packages/react-query-devtools) from 5.62.11 to 5.62.15.
- [Release notes](https://github.com/TanStack/query/releases)
- [Commits](https://github.com/TanStack/query/commits/HEAD/packages/react-query-devtools)

---
updated-dependencies:
- dependency-name: "@tanstack/react-query-devtools"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Patient encounter notes (#9617)

Co-authored-by: Bodhisha Thomas <[email protected]>
Co-authored-by: Bodhish Thomas <[email protected]>

* Fix Auto hide without hook (#9780)

* Enhance encounter data handling by adding encounterId prop across multiple components (#9793)

* Disable encounter create during save (#9795)

* Enhance encounter data handling by adding encounterId prop across multiple components

- Added `encounterId` prop to `ObservationChart`, `ObservationHistoryTable`, `ObservationsList`, `QuestionnaireResponsesList`, and `StructuredResponseView` components to improve data fetching and display related to specific encounters.
- Updated query parameters in API calls to include `encounterId` for better data context.
- Refactored `EncounterPlotsTab` and `EncounterUpdatesTab` to pass the new `encounterId` prop, ensuring consistent data handling across the application.

This change improves the overall functionality and user experience by ensuring that encounter-specific data is accurately retrieved and displayed.

* fix: disable encounter create button during save to prevent multiple submissions #9794

* Refactor PatientHome and EncounterShow components; update FacilityOrganizationSelector labels

- Removed unused state and commented-out code in PatientHome for improved readability.
- Enhanced patient data display by updating the last updated and created by fields to use `updated_by` instead of `modified_by`.
- Updated date formatting functions to ensure consistent display of patient and encounter dates.
- Changed labels in FacilityOrganizationSelector from "Organization" to "Select Department" and adjusted related text for clarity.

These changes streamline the codebase and improve user interface clarity.

* Partial Cleanup Public Router | Public Pages Header

* Rewire enableWhen

* Remove localStorage watch from AuthUserProvider

* Implement immediate redirection after successful login

* Fix: Update the value to Home Health in Create Encounter Form (#9806)

* Update Questionnaire Styling

* Update Questionnaire Styling

* Update Auth Handling

* Cleanup Patient Auth State

* Handle Null created_by

* Types for null patient.created_by

* Bump i18next from 24.2.0 to 24.2.1 (#9818)

Bumps [i18next](https://github.com/i18next/i18next) from 24.2.0 to 24.2.1.
- [Release notes](https://github.com/i18next/i18next/releases)
- [Changelog](https://github.com/i18next/i18next/blob/master/CHANGELOG.md)
- [Commits](i18next/i18next@v24.2.0...v24.2.1)

---
updated-dependencies:
- dependency-name: i18next
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump input-otp from 1.4.1 to 1.4.2 (#9819)

Bumps [input-otp](https://github.com/guilhermerodz/input-otp/tree/HEAD/packages/input-otp) from 1.4.1 to 1.4.2.
- [Changelog](https://github.com/guilhermerodz/input-otp/blob/master/CHANGELOG.md)
- [Commits](https://github.com/guilhermerodz/input-otp/commits/HEAD/packages/input-otp)

---
updated-dependencies:
- dependency-name: input-otp
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Rename dosage field to frequency in ongoing medication form (#9811)

* feat: Add new fields to Question interface (#9824)

* Cleanup Labels in Questionnaire

* Allergy intolerance Cleanup (#9812)

* cleanup CarePatientTokenKey (#9827)

* changed the facility name (#9829)

* Cleanup localStorage Management in Patient Login; Fix Time in Confirmation

* Use PatientContext from Router when required

* Cleanup Navbars

* AllergyList: Add i18n; map key

* Add Actions in Encounter

* Remove Shortcut for Nursing Care

* Update Crowdin configuration file

* Update Crowdin configuration file

* Fix: Replace InputWithError and InputErrors components with ShadCN’s components directly. (#9847)

* fixed eslint errors caused while creating plugin map

* refactored the patient registration form using react hook form

* added patient registration form plugin hook

* updated validations

* added patient info card actions plugin hook

* set same_phone_number to true by default in patient registration

* set same_address to true and same_phone_number to false by default in patient registration

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Mohammed Nihal <[email protected]>
  • Loading branch information
khavinshankar and nihal467 authored Jan 13, 2025
1 parent 554054b commit b8c1ed2
Show file tree
Hide file tree
Showing 8 changed files with 665 additions and 733 deletions.
18 changes: 18 additions & 0 deletions public/locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,7 @@
"additional_information": "Additional Information",
"additional_instructions": "Additional Instructions",
"address": "Address",
"address_is_required": "Address is required",
"administer": "Administer",
"administer_medicine": "Administer Medicine",
"administer_medicines": "Administer Medicines",
Expand All @@ -364,6 +365,9 @@
"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_less_than_0": "Age cannot be less than 0",
"age_must_be_below_120": "Age must be below 120",
"age_must_be_positive": "Age must be greater than 0",
"age_must_be_present": "Age must be present",
"age_notice": "Only year of birth will be stored for age.",
"ago": "ago",
"all": "All",
Expand Down Expand Up @@ -477,6 +481,7 @@
"beta": "beta",
"bladder": "Bladder",
"blood_group": "Blood Group",
"blood_group_is_required": "Blood group is required",
"blood_pressure_error": {
"missing": "Field is required. Either specify both or clear both.",
"exceed": "Value cannot exceed 250 mmHg.",
Expand Down Expand Up @@ -696,6 +701,8 @@
"date_of_admission": "Date of Admission",
"date_of_birth": "Date of Birth",
"date_of_birth_age": "Date of Birth/Age",
"date_of_birth_format": "Date of birth must be in YYYY-MM-DD format",
"date_of_birth_must_be_present": "Date of birth must be present",
"date_of_birth_or_age": "Date of Birth or Age",
"date_of_positive_covid_19_swab": "Date of Positive Covid 19 Swab",
"date_of_result": "Covid confirmation date",
Expand Down Expand Up @@ -1024,12 +1031,15 @@
"full_name": "Full Name",
"full_screen": "Full Screen",
"gender": "Gender",
"gender_is_required": "Gender is required",
"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.",
"generating": "Generating",
"generating_discharge_summary": "Generating discharge summary",
"geo_organization_is_required": "Geo organization is required when nationality is India",
"geo_organization_required": "Geo organization is required",
"geolocation_is_not_supported_by_this_browser": "Geolocation is not supported by this browser",
"get_auth_methods": "Get Available Authentication Methods",
"get_auth_mode_error": "Could not find any supported authentication methods, Please try again with a different authentication method",
Expand Down Expand Up @@ -1277,9 +1287,11 @@
"my_profile": "My Profile",
"my_schedules": "My Schedules",
"name": "Name",
"name_is_required": "Name is required",
"name_of_hospital": "Name of Hospital",
"name_of_shifting_approving_facility": "Name of shifting approving facility",
"nationality": "Nationality",
"nationality_is_required": "Nationality is required",
"nearby_facilities": "Nearby Facilities",
"network_failure": "Network Failure. Please check your internet connectivity.",
"never": "never",
Expand Down Expand Up @@ -1489,6 +1501,7 @@
"patients": "Patients",
"patients_per_slot": "Patients per Slot",
"pending": "Pending",
"permanant_address_is_required": "Permanant address is required",
"permanent_address": "Permanent Address",
"permission_denied": "You do not have permission to perform this action",
"personal_information": "Personal Information",
Expand All @@ -1500,11 +1513,13 @@
"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",
"phone_number_must_be_10_digits": "Phone number must be a 10-digit mobile number",
"phone_number_not_found": "Phone number not found",
"phone_number_validation": "Phone number must start with +91 followed by 10 digits",
"phone_number_verified": "Phone Number Verified",
"pincode": "Pincode",
"pincode_autofill": "State and District auto-filled from Pincode",
"pincode_must_be_6_digits": "Pincode must be a 6-digit number",
"play": "Play",
"play_audio": "Play Audio",
"please_assign_bed_to_patient": "Please assign a bed to this patient",
Expand All @@ -1517,6 +1532,7 @@
"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_blood_group": "Please select the blood group",
"please_select_breathlessness_level": "Please select Breathlessness Level",
"please_select_district": "Please select the district",
"please_select_facility_type": "Please select Facility Type",
Expand Down Expand Up @@ -2114,6 +2130,8 @@
"working_status": "Working Status",
"year": "Year",
"year_of_birth": "Year of Birth",
"year_of_birth_format": "Year of birth must be in YYYY format",
"year_of_birth_must_be_present": "Year of birth must be present",
"years": "years",
"years_of_experience": "Years of Experience",
"years_of_experience_of_the_doctor": "Years of Experience of the Doctor",
Expand Down
1 change: 1 addition & 0 deletions scripts/setup-care-apps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ const pluginMapContent = `// Use type assertion for the static import\n${plugins
`// @ts-expect-error Remote module will be available at runtime\nimport ${plugin.camelCaseName}Manifest from "${plugin.repo}/manifest";`,
)
.join("\n")}
import type { PluginManifest } from "./pluginTypes";
const pluginMap: PluginManifest[] = [${plugins.map((plugin) => `${plugin.camelCaseName}Manifest as PluginManifest`).join(",\n ")}];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { ReactNode, createContext, useContext, useState } from "react";

import { PLUGIN_Component } from "@/PluginEngine";
import { Encounter } from "@/types/emr/encounter";
import { Patient } from "@/types/emr/newPatient";

Expand Down Expand Up @@ -65,7 +64,6 @@ export const EncounterProvider = <T extends object = object>({
} as EncounterContextType<T>
}
>
<PLUGIN_Component __name="EncounterContextEnabler" />
{children}
</EncounterContext.Provider>
);
Expand Down
11 changes: 9 additions & 2 deletions src/components/Patient/PatientHome.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import Loading from "@/components/Common/Loading";
import Page from "@/components/Common/Page";
import { patientTabs } from "@/components/Patient/PatientDetailsTab";

import { PLUGIN_Component } from "@/PluginEngine";
import routes from "@/Utils/request/api";
import query from "@/Utils/request/query";
import { formatDateTime, formatPatientAge, relativeDate } from "@/Utils/utils";
Expand Down Expand Up @@ -134,8 +135,8 @@ export const PatientHome = (props: {
{t("actions")}
</div>
<div className="mt-2 h-full space-y-2">
<div className="space-y-3 border-b border-dashed text-left text-lg font-semibold text-secondary-900">
<div>
<div className="space-y-3 text-left text-lg font-semibold text-secondary-900">
<div className="space-y-2">
<Button
className="w-full bg-white font-semibold text-green-800 hover:bg-secondary-200"
id="upload-patient-files"
Expand All @@ -150,6 +151,12 @@ export const PatientHome = (props: {
{t("view_update_patient_files")}
</span>
</Button>

<PLUGIN_Component
__name="PatientHomeActions"
patient={patientData}
className="w-full bg-white font-semibold text-green-800 hover:bg-secondary-200"
/>
</div>
</div>
</div>
Expand Down
5 changes: 5 additions & 0 deletions src/components/Patient/PatientInfoCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import {

import { Avatar } from "@/components/Common/Avatar";

import { PLUGIN_Component } from "@/PluginEngine";
import routes from "@/Utils/request/api";
import mutate from "@/Utils/request/mutate";
import { formatDateTime, formatPatientAge } from "@/Utils/utils";
Expand Down Expand Up @@ -342,6 +343,10 @@ export default function PatientInfoCard(props: PatientInfoCardProps) {
<DropdownMenuItem onClick={handleMarkAsComplete}>
{t("mark_as_complete")}
</DropdownMenuItem>
<PLUGIN_Component
__name="PatientInfoCardActions"
encounter={encounter}
/>
</DropdownMenuContent>
</DropdownMenu>
</div>
Expand Down
Loading

0 comments on commit b8c1ed2

Please sign in to comment.