Skip to content

Commit

Permalink
Merge branch 'develop' into appointment-reschedule
Browse files Browse the repository at this point in the history
  • Loading branch information
rithviknishad committed Jan 21, 2025
2 parents 90c2072 + 46faa4b commit fb71bee
Show file tree
Hide file tree
Showing 59 changed files with 675 additions and 611 deletions.
36 changes: 13 additions & 23 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -40,10 +35,7 @@
"ecmaVersion": 12,
"sourceType": "module"
},
"plugins": [
"@typescript-eslint",
"i18next"
],
"plugins": ["@typescript-eslint", "i18next", "no-relative-import-paths"],
"rules": {
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": [
Expand All @@ -61,22 +53,20 @@
{
"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": "@"
}
]
},
"ignorePatterns": [
Expand Down
67 changes: 16 additions & 51 deletions package-lock.json

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

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
"echarts-for-react": "^3.0.2",
"events": "^3.3.0",
"hi-profiles": "^1.1.0",
"html2canvas": "^1.4.1",
"html-to-image": "^1.11.11",
"i18next": "^24.2.1",
"i18next-browser-languagedetector": "^8.0.2",
"i18next-http-backend": "^3.0.1",
Expand Down Expand Up @@ -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",
Expand Down
20 changes: 18 additions & 2 deletions public/locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,7 @@
"administered_on": "Administered on",
"administration_dosage_range_error": "Dosage should be between start and target dosage",
"administration_notes": "Administration Notes",
"admit_source": "Admit Source",
"admitted": "Admitted",
"admitted_on": "Admitted On",
"advanced_filters": "Advanced Filters",
Expand Down Expand Up @@ -548,6 +549,7 @@
"choose_file": "Upload From Device",
"choose_localbody": "Choose Local Body",
"choose_location": "Choose Location",
"choose_other_search_type": "Choose other search types",
"choose_state": "Choose State",
"claim__add_item": "Add Item",
"claim__create_claim": "Create Claim",
Expand Down Expand Up @@ -765,11 +767,13 @@
"diagnosis_at_discharge": "Diagnosis at Discharge",
"diastolic": "Diastolic",
"didnt_receive_a_message": "Didn't receive a message?",
"diet_preference": "Diet Preference",
"differential": "Differential",
"differential_diagnosis": "Differential diagnosis",
"disable_transfer": "Disable Transfer",
"discard": "Discard",
"discharge": "Discharge",
"discharge_disposition": "Discharge Disposition",
"discharge_from_care": "Discharge from CARE",
"discharge_prescription": "Discharge Prescription",
"discharge_summary": "Discharge Summary",
Expand Down Expand Up @@ -933,6 +937,7 @@
"encounter_priority__timing_critical": "Timing critical",
"encounter_priority__urgent": "Urgent",
"encounter_priority__use_as_directed": "Use as directed",
"encounter_status": "Encounter Status",
"encounter_status__cancelled": "Cancelled",
"encounter_status__completed": "Completed",
"encounter_status__discharged": "Discharged",
Expand Down Expand Up @@ -1132,6 +1137,8 @@
"home_facility_cleared_success": "Home Facility cleared successfully",
"home_facility_updated_error": "Error while updating Home Facility",
"home_facility_updated_success": "Home Facility updated successfully",
"hospital_identifier": "Hospital Identifier",
"hospitalization_details": "Hospitalization Details",
"hubs": "Hub Facilities",
"i_declare": "I hereby declare that:",
"icd11_as_recommended": "As per ICD-11 recommended by WHO",
Expand Down Expand Up @@ -1193,6 +1200,7 @@
"investigations_suggested": "Investigations Suggested",
"investigations_summary": "Investigations Summary",
"ip_encounter": "IP Encounter",
"ip_op_obs_emr_number": "Ip/op/obs/emr number",
"is": "Is",
"is_antenatal": "Is Antenatal",
"is_atypical_presentation": "Is Atypical presentation",
Expand Down Expand Up @@ -1255,6 +1263,7 @@
"live_patients_total_beds": "Live Patients / Total beds",
"load_more": "Load More",
"loading": "Loading...",
"loading_encounter": "Loading encounter...",
"local_body": "Local body",
"local_ip_address": "Local IP Address",
"local_ip_address_example": "e.g. 192.168.0.123",
Expand Down Expand Up @@ -1395,8 +1404,7 @@
"no_notices_for_you": "No notices for you.",
"no_observations": "No Observations",
"no_ongoing_medications": "No Ongoing Medications",
"no_organizations_found": "No organizations found",
"no_organizations_found_matching": "No organizations found matching {{searchQuery}}",
"no_organizations_found": "No Organizations Found",
"no_organizations_selected": "No organizations selected",
"no_patient_record_found": "No Patient Records Found",
"no_patient_record_text": "No existing records found with this phone number. Would you like to register a new patient?",
Expand Down Expand Up @@ -1685,6 +1693,7 @@
"ration_card__BPL": "BPL",
"ration_card__NO_CARD": "Non-card holder",
"ration_card_category": "Ration Card Category",
"readmission": "Re-admission",
"reason": "Reason",
"reason_for_discontinuation": "Reason for discontinuation",
"reason_for_edit": "Reason for edit",
Expand Down Expand Up @@ -1830,6 +1839,7 @@
"scribe__reviewing_field": "Reviewing field {{currentField}} / {{totalFields}}",
"scribe_error": "Could not autofill fields",
"search": "Search",
"search_by": "Search by",
"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",
Expand All @@ -1852,11 +1862,15 @@
"see_attachments": "See Attachments",
"select": "Select",
"select_additional_instructions": "Select additional instructions",
"select_admit_source": "Select Admit Source",
"select_all": "Select All",
"select_category": "Select a category",
"select_class": "Select Class",
"select_date": "Select date",
"select_department": "Select Department",
"select_diff_role": "Please select a different role",
"select_diet_preference": "Select diet preference",
"select_discharge_disposition": "Select discharge disposition",
"select_eligible_policy": "Select an Eligible Insurance Policy",
"select_facility": "Select Facility",
"select_facility_description": "Select the healthcare facility that will provide the requested resource.",
Expand All @@ -1881,12 +1895,14 @@
"select_practitioner": "Select Practitioner",
"select_previous": "Select Previous Fields",
"select_prn_reason": "Select reason for PRN",
"select_priority": "Select Priority",
"select_register_patient": "Select/Register Patient",
"select_role": "Select Role",
"select_route": "Select route",
"select_seven_day_period": "Select a seven day period",
"select_site": "Select site",
"select_skills": "Select and add some skills",
"select_status": "Select Status",
"select_time": "Select time",
"select_time_slot": "Select time slot",
"select_user": "Select user",
Expand Down
4 changes: 2 additions & 2 deletions src/Routers/AppRouter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ const PATHS_WITHOUT_SIDEBAR = ["/", "/session-expired"];

export type RouteParams<T extends string> =
T extends `${string}:${infer Param}/${infer Rest}`
? { [K in Param | keyof RouteParams<Rest>]: string }
? { [_ in Param | keyof RouteParams<Rest>]: string }
: T extends `${string}:${infer Param}`
? { [K in Param]: string }
? { [_ in Param]: string }
: Record<string, never>;

export type RouteFunction<T extends string> = (
Expand Down
2 changes: 1 addition & 1 deletion src/Routers/routes/questionnaireRoutes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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": () => <QuestionnaireList />,
Expand Down
2 changes: 1 addition & 1 deletion src/Utils/request/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ type ExtractRouteParams<T extends string> =
: never;

type PathParams<T extends string> = {
[K in ExtractRouteParams<T>]: string;
[_ in ExtractRouteParams<T>]: string;
};

export interface ApiCallOptions<Route extends ApiRoute<unknown, unknown>> {
Expand Down
12 changes: 6 additions & 6 deletions src/Utils/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ export interface BaseModel {
export type Writable<T> = T extends object
? {
[P in keyof T as IfEquals<
{ [Q in P]: T[P] },
{ -readonly [Q in P]: T[P] },
{ [_ in P]: T[P] },
{ -readonly [_ in P]: T[P] },
never,
P
>]?: undefined;
} & {
[P in keyof T as IfEquals<
{ [Q in P]: T[P] },
{ -readonly [Q in P]: T[P] },
{ [_ in P]: T[P] },
{ -readonly [_ in P]: T[P] },
P,
never
>]: T[P] extends object ? Writable<T[P]> : T[P];
Expand All @@ -38,8 +38,8 @@ export type Writable<T> = T extends object
export type WritableOnly<T> = T extends object
? {
[P in keyof T as IfEquals<
{ [Q in P]: T[P] },
{ -readonly [Q in P]: T[P] },
{ [_ in P]: T[P] },
{ -readonly [_ in P]: T[P] },
P
>]: T[P] extends object ? WritableOnly<T[P]> : T[P];
}
Expand Down
Loading

0 comments on commit fb71bee

Please sign in to comment.