diff --git a/public/locale/en.json b/public/locale/en.json index ab0afc7ca3c..148fa0bb3cc 100644 --- a/public/locale/en.json +++ b/public/locale/en.json @@ -346,6 +346,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", @@ -709,11 +710,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", @@ -803,6 +806,7 @@ "encounter_admit_sources__outp": "From outpatient department", "encounter_admit_sources__psych": "From psychiatric hospital", "encounter_admit_sources__rehab": "From rehabilitation facility", + "encounter_class": "Encounter Class", "encounter_class__amb": "Ambulatory", "encounter_class__completed": "Completed", "encounter_class__emer": "Emergency", @@ -870,6 +874,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", @@ -1036,6 +1041,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", @@ -1093,6 +1100,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", @@ -1151,6 +1159,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", @@ -1495,6 +1504,7 @@ "principal_diagnosis": "Principal diagnosis", "print": "Print", "print_referral_letter": "Print Referral Letter", + "priority": "Priority", "prn_prescription": "PRN Prescription", "prn_prescriptions": "PRN Prescriptions", "procedure_suggestions": "Procedure Suggestions", @@ -1520,6 +1530,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", @@ -1646,10 +1657,14 @@ "searching": "Searching...", "see_attachments": "See Attachments", "select": "Select", + "select_admit_source": "Select Admit Source", "select_all": "Select All", + "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_for_discharged_patients_warning": "Facility needs to be selected to view discharged patients.", @@ -1664,10 +1679,12 @@ "select_policy": "Select an Insurance Policy", "select_policy_to_add_items": "Select a Policy to Add Items", "select_practitioner": "Select Practicioner", + "select_priority": "Select Priority", "select_register_patient": "Select/Register Patient", "select_role": "Select Role", "select_seven_day_period": "Select a seven day period", "select_skills": "Select and add some skills", + "select_status": "Select Status", "select_time": "Select time", "select_time_slot": "Select time slot", "select_wards": "Select wards", diff --git a/src/common/constants.tsx b/src/common/constants.tsx index 64af8d373ac..20449c65a29 100644 --- a/src/common/constants.tsx +++ b/src/common/constants.tsx @@ -1757,3 +1757,78 @@ export const HEADER_CONTENT_TYPES = { } as const; export const ADMIN_USER_TYPES = ["DistrictAdmin", "StateAdmin"] as const; + +export const ENCOUNTER_DIET_PREFERENCE = { + encounter_diet_preference__vegetarian: "vegetarian", + encounter_diet_preference__diary_free: "diary_free", + encounter_diet_preference__nut_free: "nut_free", + encounter_diet_preference__gluten_free: "gluten_free", + encounter_diet_preference__vegan: "vegan", + encounter_diet_preference__halal: "halal", + encounter_diet_preference__kosher: "kosher", + encounter_diet_preference__none: "none", +} as const; + +export const ENCOUNTER_STATUS = { + encounter_status__planned: "planned", + encounter_status__in_progress: "in_progress", + encounter_status__on_hold: "on_hold", + encounter_status__discharged: "discharged", + encounter_status__completed: "completed", + encounter_status__cancelled: "cancelled", + encounter_status__discontinued: "discontinued", + encounter_status__entered_in_error: "entered_in_error", + encounter_status__unknown: "unknown", +} as const; + +export const ENCOUNTER_CLASS = { + encounter_class__imp: "imp", + encounter_class__amb: "amb", + encounter_class__obsenc: "obsenc", + encounter_class__emer: "emer", + encounter_class__vr: "vr", + encounter_class__hh: "hh", +} as const; + +export const ENCOUNTER_PRIORITY = { + encounter_priority__asap: "ASAP", + encounter_priority__callback_results: "callback_results", + encounter_priority__callback_for_scheduling: "callback_for_scheduling", + encounter_priority__elective: "elective", + encounter_priority__emergency: "emergency", + encounter_priority__preop: "preop", + encounter_priority__as_needed: "as_needed", + encounter_priority__routine: "routine", + encounter_priority__rush_reporting: "rush_reporting", + encounter_priority__stat: "stat", + encounter_priority__timing_critical: "timing_critical", + encounter_priority__use_as_directed: "use_as_directed", + encounter_priority__urgent: "urgent", +} as const; + +export const ENCOUNTER_ADMIT_SOURCE = { + encounter_admit_sources__hosp_trans: "hosp_trans", + encounter_admit_sources__emd: "emd", + encounter_admit_sources__outp: "outp", + encounter_admit_sources__born: "born", + encounter_admit_sources__gp: "gp", + encounter_admit_sources__mp: "mp", + encounter_admit_sources__nursing: "nursing", + encounter_admit_sources__psych: "psych", + encounter_admit_sources__rehab: "rehab", + encounter_admit_sources__other: "other", +} as const; + +export const ENCOUNTER_DISCHARGE_DISPOSITION = { + encounter_discharge_disposition__home: "home", + encounter_discharge_disposition__alt_home: "alt_home", + encounter_discharge_disposition__other_hcf: "other_hcf", + encounter_discharge_disposition__hosp: "hosp", + encounter_discharge_disposition__long: "long", + encounter_discharge_disposition__aadvice: "aadvice", + encounter_discharge_disposition__exp: "exp", + encounter_discharge_disposition__psy: "psy", + encounter_discharge_disposition__rehab: "rehab", + encounter_discharge_disposition__snf: "snf", + encounter_discharge_disposition__oth: "oth", +} as const; diff --git a/src/components/Questionnaire/QuestionTypes/EncounterQuestion.tsx b/src/components/Questionnaire/QuestionTypes/EncounterQuestion.tsx index 00ba6ce0536..1c15b63c15e 100644 --- a/src/components/Questionnaire/QuestionTypes/EncounterQuestion.tsx +++ b/src/components/Questionnaire/QuestionTypes/EncounterQuestion.tsx @@ -1,5 +1,6 @@ import { useQuery } from "@tanstack/react-query"; import { useEffect, useState } from "react"; +import { useTranslation } from "react-i18next"; import { Input } from "@/components/ui/input"; import { Label } from "@/components/ui/label"; @@ -11,6 +12,15 @@ import { SelectValue, } from "@/components/ui/select"; +import { + ENCOUNTER_ADMIT_SOURCE, + ENCOUNTER_CLASS, + ENCOUNTER_DIET_PREFERENCE, + ENCOUNTER_DISCHARGE_DISPOSITION, + ENCOUNTER_PRIORITY, + ENCOUNTER_STATUS, +} from "@/common/constants"; + import routes from "@/Utils/request/api"; import query from "@/Utils/request/query"; import { @@ -61,6 +71,7 @@ export function EncounterQuestion({ }), enabled: !!encounterId, }); + const { t } = useTranslation(); const [encounter, setEncounter] = useState(() => { if (!encounterData) { @@ -141,7 +152,7 @@ export function EncounterQuestion({ }; if (isLoading) { - return
Loading encounter...
; + return
{t("loading_encounter")}
; } return ( @@ -149,7 +160,7 @@ export function EncounterQuestion({
{/* Basic Details */}
- +
- +
- +
- + handleUpdateEncounter({ external_identifier: e.target.value }) } disabled={disabled} - placeholder="Ip/op/obs/emr number" + placeholder={t("ip_op_obs_emr_number")} />
@@ -253,7 +249,7 @@ export function EncounterQuestion({ encounter.encounter_class === "emer") && (

- Hospitalization Details + {t("hospitalization_details")}

@@ -277,11 +273,11 @@ export function EncounterQuestion({ } disabled={disabled} /> - +
- +
@@ -322,7 +315,7 @@ export function EncounterQuestion({ {/* Show discharge disposition only when status is completed */} {encounter.status === "completed" && (
- +
)}
- +