diff --git a/public/locale/en.json b/public/locale/en.json index 65093b6acae..2a485441d4f 100644 --- a/public/locale/en.json +++ b/public/locale/en.json @@ -224,6 +224,19 @@ "SPO2_LEVEL_MODERATE_HYPOXEMIA": "Moderate Hypoxemia", "SPO2_LEVEL_NORMAL": "Normal", "SPO2_LEVEL_SEVERE_HYPOXEMIA": "Severe Hypoxemia", + "SYSTEM__govt_org_type__block_panchayat": "Block Panchayat", + "SYSTEM__govt_org_type__corporation": "Corporation", + "SYSTEM__govt_org_type__default": "State", + "SYSTEM__govt_org_type__district": "District", + "SYSTEM__govt_org_type__grama_panchayat": "Grama Panchayat", + "SYSTEM__govt_org_type__local_body": "Local Body", + "SYSTEM__govt_org_type__municipality": "Municipality", + "SYSTEM__govt_org_type__state": "State", + "SYSTEM__govt_org_type__ward": "Ward", + "SYSTEM__org_type__default": "Organization", + "SYSTEM__org_type__govt": "Government", + "SYSTEM__org_type__role": "Role", + "SYSTEM__org_type__team": "Team", "Submit": "Submit", "TELEMEDICINE": "Telemedicine", "TRANSPORTATION TO BE ARRANGED": "Transportation", @@ -376,6 +389,7 @@ "are_you_still_watching": "Are you still watching?", "are_you_sure_want_to_delete": "Are you sure you want to delete {{name}}?", "are_you_sure_want_to_delete_this_record": "Are you sure want to delete this record?", + "are_you_sure_want_to_remove": "Are you sure you want to remove {{name}} from the patient? This action cannot be undone", "ari": "ARI - Acute Respiratory illness", "arrived": "Arrived", "asset_class": "Asset Class", @@ -388,7 +402,10 @@ "assign": "Assign", "assign_a_volunteer_to": "Assign a volunteer to {{name}}", "assign_bed": "Assign Bed", + "assign_to_patient": "Assign to Patient", "assign_to_volunteer": "Assign to a Volunteer", + "assign_user": "Assign User", + "assign_user_to_patient": "Assign User to Patient", "assigned_doctor": "Assigned Doctor", "assigned_facility": "Facility assigned", "assigned_to": "Assigned to", @@ -1239,6 +1256,7 @@ "no_staff": "No staff found", "no_tests_taken": "No tests taken", "no_treating_physicians_available": "This facility does not have any home facility doctors. Please contact your admin.", + "no_user_assigned": "No User Assigned to this patient", "no_users_found": "No Users Found", "no_vitals_present": "No Vitals Monitor present in this location or facility", "none": "None", @@ -1482,6 +1500,7 @@ "rejected": "Rejected", "reload": "Reload", "remove": "Remove", + "remove_user": "Remove User", "rename": "Rename", "replace_home_facility": "Replace Home Facility", "replace_home_facility_confirm": "Are you sure you want to replace", @@ -1570,6 +1589,8 @@ "search_medication": "Search Medication", "search_patients": "Search Patients", "search_resource": "Search Resource", + "search_user": "Search User", + "search_user_description": "Search for a user and assign a role to add them to the patient.", "searching": "Searching...", "see_attachments": "See Attachments", "select": "Select", @@ -1588,6 +1609,7 @@ "select_policy_to_add_items": "Select a Policy to Add Items", "select_practitioner": "Select Practicioner", "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_time": "Select time", diff --git a/src/common/constants.tsx b/src/common/constants.tsx index b31691bda30..39fe769520c 100644 --- a/src/common/constants.tsx +++ b/src/common/constants.tsx @@ -1762,12 +1762,3 @@ export const ADMIN_USER_TYPES = ["DistrictAdmin", "StateAdmin"] as const; * @deprecated use `LocalStorageKeys.patientTokenKey` instead */ export const CarePatientTokenKey = LocalStorageKeys.patientTokenKey; - -// organization_levels map based of type. for govt -// thought: This might be better placed in the organization types files -export const ORGANIZATION_LEVELS = { - govt: ["State", "District", "LocalBody", "Ward"], - team: ["Team"], - role: ["Role"], - other: ["Other"], -}; diff --git a/src/components/Facility/ConsultationDetails/QuestionnaireResponsesList.tsx b/src/components/Facility/ConsultationDetails/QuestionnaireResponsesList.tsx index 5f3d62b9809..b82b37aaca5 100644 --- a/src/components/Facility/ConsultationDetails/QuestionnaireResponsesList.tsx +++ b/src/components/Facility/ConsultationDetails/QuestionnaireResponsesList.tsx @@ -258,7 +258,6 @@ export default function QuestionnaireResponsesList({ encounter }: Props) { // New structured response rendering Object.entries(item.structured_responses).map( ([type, response]) => { - console.log("LOGGG", type, response); return ( !val || validateLongitude(val), "Invalid longitude"), + is_public: z.boolean().default(false), }); type FacilityFormValues = z.infer; @@ -77,6 +80,7 @@ export default function CreateFacilityForm({ }: Props) { const { t } = useTranslation(); const queryClient = useQueryClient(); + const [isGettingLocation, setIsGettingLocation] = useState(false); const form = useForm({ resolver: zodResolver(facilityFormSchema), @@ -90,6 +94,7 @@ export default function CreateFacilityForm({ phone_number: "+91", latitude: "", longitude: "", + is_public: false, }, }); @@ -132,16 +137,23 @@ export default function CreateFacilityForm({ const handleGetCurrentLocation = () => { if (navigator.geolocation) { + setIsGettingLocation(true); navigator.geolocation.getCurrentPosition( (position) => { form.setValue("latitude", position.coords.latitude.toString()); form.setValue("longitude", position.coords.longitude.toString()); + setIsGettingLocation(false); + Notification.Success({ + msg: "Location updated successfully", + }); }, (error) => { + setIsGettingLocation(false); Notification.Error({ msg: "Unable to get location: " + error.message, }); }, + { timeout: 10000 }, // 10 second timeout ); } else { Notification.Error({ @@ -152,108 +164,138 @@ export default function CreateFacilityForm({ return (
- -
- ( - - Facility Type - + + + + + + + {FACILITY_TYPES.map((type) => ( + + {type.text} + + ))} + + + + + )} + /> + + ( + + Facility Name - - - + - - {FACILITY_TYPES.map((type) => ( - - {type.text} - - ))} - - - - - )} - /> + + + )} + /> +
( - Facility Name + Description - +