Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Edit feature for facilities in organization | pincode, geo_organization info auto populates #9662

Merged
merged 74 commits into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from 71 commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
03fd617
pincode updated
Mahendar0701 Jan 2, 2025
d1a6ca1
Merge branch 'develop' into facility-edit
Mahendar0701 Jan 2, 2025
7db9c3a
populated geo_organization values
Mahendar0701 Jan 3, 2025
080f442
Merge branch 'develop' into facility-edit
Mahendar0701 Jan 3, 2025
8159f13
Merge branch 'develop' into facility-edit
Mahendar0701 Jan 3, 2025
fc0413e
Merge branch 'develop' into facility-edit
Mahendar0701 Jan 3, 2025
d0daf9c
autofill of state and districts
Mahendar0701 Jan 4, 2025
f7db9bc
Merge branch 'develop' into facility-edit
Mahendar0701 Jan 4, 2025
02a4ca0
Merge branch 'facility-edit' of https://github.com/Mahendar0701/care_…
Mahendar0701 Jan 4, 2025
ab383d5
translation
Mahendar0701 Jan 4, 2025
7dff65f
commit
Mahendar0701 Jan 4, 2025
4eda986
added usequery
Mahendar0701 Jan 4, 2025
c811b60
Merge branch 'develop' into facility-edit
Mahendar0701 Jan 4, 2025
d9078ad
Merge branch 'develop' into facility-edit
Mahendar0701 Jan 5, 2025
884fc82
Merge branch 'develop' into facility-edit
Mahendar0701 Jan 5, 2025
0f49a53
Merge branch 'facility-edit' of https://github.com/Mahendar0701/care_…
Mahendar0701 Jan 5, 2025
b6b2318
Merge branch 'develop' into facility-edit
Mahendar0701 Jan 5, 2025
fd3241f
moved useFetchOrganizationByName organizationapi.ts
Mahendar0701 Jan 5, 2025
f9d4e49
Merge branch 'facility-edit' of https://github.com/Mahendar0701/care_…
Mahendar0701 Jan 5, 2025
3a9dcbf
Merge branch 'develop' into facility-edit
Mahendar0701 Jan 5, 2025
e87535d
Merge branch 'develop' into facility-edit
Mahendar0701 Jan 5, 2025
213eb95
Merge branch 'develop' into facility-edit
Mahendar0701 Jan 6, 2025
87db767
added conditions
Mahendar0701 Jan 6, 2025
4599c93
Merge branch 'facility-edit' of https://github.com/Mahendar0701/care_…
Mahendar0701 Jan 6, 2025
8df1055
Merge branch 'develop' into facility-edit
Mahendar0701 Jan 9, 2025
80dde3f
added edit option
Mahendar0701 Jan 9, 2025
f63a324
Merge branch 'develop' into facility-edit
Mahendar0701 Jan 9, 2025
dcad86a
added edit option
Mahendar0701 Jan 9, 2025
0e370c9
Merge branch 'develop' into facility-edit
Mahendar0701 Jan 10, 2025
9b57759
resolved conflicts
Mahendar0701 Jan 10, 2025
a5d9d6e
Merge branch 'develop' into facility-edit
Mahendar0701 Jan 11, 2025
a932b00
autopopulation of existing details
Mahendar0701 Jan 11, 2025
15eb9d3
added i18n and pincode limit
Mahendar0701 Jan 11, 2025
f735ac9
added i18n and pincode limit
Mahendar0701 Jan 11, 2025
a68184f
link wrap in button
Mahendar0701 Jan 11, 2025
4a9f3a6
autofill pincode
Mahendar0701 Jan 11, 2025
43caefd
Merge branch 'develop' into facility-edit
Mahendar0701 Jan 12, 2025
5ffb199
added form.watch
Mahendar0701 Jan 12, 2025
5bda95e
Merge branch 'develop' into facility-edit
Mahendar0701 Jan 12, 2025
ed06a75
Merge branch 'develop' into facility-edit
Mahendar0701 Jan 13, 2025
f763eba
facility edit sheet
Mahendar0701 Jan 13, 2025
8dbda7e
Merge branch 'facility-edit' of https://github.com/Mahendar0701/care_…
Mahendar0701 Jan 13, 2025
ec1014e
Merge branch 'develop' into facility-edit
Mahendar0701 Jan 13, 2025
763b4aa
Merge branch 'develop' into facility-edit
Mahendar0701 Jan 14, 2025
439a061
Update FacilityHome.tsx
Mahendar0701 Jan 14, 2025
0a6f616
organization error on update fixed
Mahendar0701 Jan 14, 2025
281e692
Merge branch 'facility-edit' of https://github.com/Mahendar0701/care_…
Mahendar0701 Jan 14, 2025
d1ac44c
Merge branch 'develop' into facility-edit
Mahendar0701 Jan 14, 2025
02ee915
organization selector autofill
Mahendar0701 Jan 14, 2025
ddfc48a
added i8n
Mahendar0701 Jan 14, 2025
7a197f8
autofill pincode and editsheet wrapped out
Mahendar0701 Jan 14, 2025
9f20cde
Merge branch 'develop' into facility-edit
Mahendar0701 Jan 14, 2025
5ef6fae
edit button
Mahendar0701 Jan 14, 2025
652a56a
coderabbit suggestions
Mahendar0701 Jan 14, 2025
bd099ec
test case fixed
Mahendar0701 Jan 14, 2025
7ce8dfc
remove commented code
Mahendar0701 Jan 15, 2025
4ecaac4
Merge branch 'develop' into facility-edit
Mahendar0701 Jan 15, 2025
1138110
invalidate queries
Mahendar0701 Jan 15, 2025
802e5b3
added i18n
Mahendar0701 Jan 15, 2025
75ea5ee
Trigger Build
Mahendar0701 Jan 15, 2025
048f685
Merge branch 'develop' into facility-edit
Mahendar0701 Jan 15, 2025
130fe35
removed feature flags
Mahendar0701 Jan 15, 2025
ff675f7
added changes
Mahendar0701 Jan 16, 2025
f59b850
Merge branch 'develop' into facility-edit
Mahendar0701 Jan 16, 2025
e953ed8
Trigger
Mahendar0701 Jan 16, 2025
fe992a5
Merge branch 'facility-edit' of https://github.com/Mahendar0701/care_…
Mahendar0701 Jan 16, 2025
2c80f20
Update useStateAndDistrictFromPincode.ts
Mahendar0701 Jan 16, 2025
23fb716
added changes
Mahendar0701 Jan 16, 2025
88f4110
Merge branch 'develop' into facility-edit
Mahendar0701 Jan 16, 2025
e849923
Merge branch 'develop' into facility-edit
Mahendar0701 Jan 16, 2025
d1bac5e
Merge branch 'facility-edit' of https://github.com/Mahendar0701/care_…
Mahendar0701 Jan 16, 2025
cf9b5f3
Merge branch 'develop' into facility-edit
Mahendar0701 Jan 16, 2025
15ada03
testcases
Mahendar0701 Jan 16, 2025
195b2a1
adjusted the cypress issue
nihal467 Jan 16, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion public/locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@
"add_insurance_details": "Add Insurance Details",
"add_location": "Add Location",
"add_new_beds": "Add New Bed(s)",
"add_new_facility": "Add New Facility",
"add_new_patient": "Add New Patient",
"add_new_user": "Add New User",
"add_notes": "Add notes",
Expand Down Expand Up @@ -682,11 +683,12 @@
"create_asset": "Create Asset",
"create_consultation": "Create Consultation",
"create_encounter": "Create Encounter",
"create_facility": "Create a new facility",
"create_facility": "Create Facility",
"create_new_abha_address": "Create New ABHA Address",
"create_new_abha_profile": "Don't have an ABHA Number",
"create_new_asset": "Create New Asset",
"create_new_encounter": "Create a new encounter to get started",
"create_new_facility": "Create a new facility and add it to the organization.",
"create_new_tag": "Create New Tag",
"create_position_preset": "Create a new position preset",
"create_position_preset_description": "Creates a new position preset in Care from the current position of the camera for the given name",
Expand All @@ -701,6 +703,7 @@
"created_date": "Created Date",
"created_on": "Created On",
"creating": "Creating...",
"creating_facility": "Creating Facility...",
"criticality": "Criticality",
"csv_file_in_the_specified_format": "Select a CSV file in the specified format",
"current_address": "Current Address",
Expand Down Expand Up @@ -814,6 +817,7 @@
"edit_avatar_permission_error": "You do not have permissions to edit the avatar of this user",
"edit_caution_note": "A new prescription will be added to the consultation with the edited details and the current prescription will be discontinued.",
"edit_cover_photo": "Edit Cover Photo",
"edit_facility": "Edit Facility",
"edit_history": "Edit History",
"edit_policy": "Edit Insurance Policy",
"edit_policy_description": "Add or edit patient's insurance details",
Expand Down Expand Up @@ -1008,7 +1012,9 @@
"facility_preference": "Facility preference",
"facility_search_placeholder_text": "Search by Facility name",
"facility_type": "Facility Type",
"facility_type_required": "Facility type is required",
"facility_updated_success": "Facility updated successfully",
"facility_updated_successfully": "Facility updated successfully",
"failed_to_create_appointment": "Failed to create an appointment",
"failed_to_link_abha_number": "Failed to link ABHA Number. Please try again later.",
"fast_track_testing_reason": "Fast track testing reason",
Expand Down Expand Up @@ -1076,7 +1082,9 @@
"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",
"get_current_location": "Get Current Location",
"get_tests": "Get Tests",
"getting_location": "Getting Location...",
"go_back": "Go Back",
"goal": "Our goal is to continuously improve the quality and accessibility of public healthcare services using digital tools.",
"granted_on": "Granted On",
Expand Down Expand Up @@ -1150,7 +1158,9 @@
"invalid_email": "Please enter a valid email address",
"invalid_email_address": "Invalid email address",
"invalid_ip_address": "Invalid IP Address",
"invalid_latitude": "Invalid latitude",
"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.",
"invalid_longitude": "Invalid longitude",
"invalid_otp": "Invalid OTP, Please check the OPT and try Again",
"invalid_password": "Password doesn't meet the requirements",
"invalid_password_reset_link": "Invalid password reset link",
Expand Down Expand Up @@ -1246,6 +1256,7 @@
"local_ip_address_example": "e.g. 192.168.0.123",
"location": "Location",
"location_beds_empty": "No beds available in this location",
"location_details": "Location Details",
"location_management": "Location Management",
"location_updated_successfully": "Location updated successfully",
"log_lab_results": "Log Lab Results",
Expand Down Expand Up @@ -1462,6 +1473,7 @@
"organization_forbidden": "You don't have access to any organizations yet.",
"organization_not_found": "No Organizations Found",
"organizations": "Organizations",
"organizations_fetch_error": "Error while fetching organizations",
"origin_facility": "Current facility",
"other_details": "Other details",
"otp_verification_error": "Failed to verify OTP. Please try again later.",
Expand Down Expand Up @@ -1567,7 +1579,9 @@
"phone_number_verified": "Phone Number Verified",
"pincode": "Pincode",
"pincode_autofill": "State and District auto-filled from Pincode",
"pincode_district_auto_fill_error": "Failed to auto-fill district information",
"pincode_must_be_6_digits": "Pincode must be a 6-digit number",
"pincode_state_auto_fill_error": "Failed to auto-fill state and district information",
"play": "Play",
"play_audio": "Play Audio",
"please_assign_bed_to_patient": "Please assign a bed to this patient",
Expand Down Expand Up @@ -2080,6 +2094,7 @@
"update_asset_service_record": "Update Asset Service Record",
"update_available": "Update Available",
"update_bed": "Update Bed",
"update_existing_facility": "Update the details of the existing facility.",
"update_facility": "Update Facility",
"update_facility_middleware_success": "Facility middleware updated successfully",
"update_log": "Update Log",
Expand All @@ -2099,6 +2114,7 @@
"updated_on": "Updated On",
"updates": "Updates",
"updating": "Updating...",
"updating_facility": "Updating Facility...",
"upload": "Upload",
"upload_an_image": "Upload an image",
"upload_file": "Upload File",
Expand Down Expand Up @@ -2192,6 +2208,7 @@
"view_users": "View Users",
"village": "Village",
"virtual_nursing_assistant": "Virtual Nursing Assistant",
"visibility_settings": "Visibility Settings",
"vitals": "Vitals",
"vitals_monitor": "Vitals Monitor",
"vitals_present": "Vitals Monitor present",
Expand Down
6 changes: 1 addition & 5 deletions src/Routers/routes/FacilityRoutes.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Redirect } from "raviger";

import { FacilityCreate } from "@/components/Facility/FacilityCreate";
import { FacilityHome } from "@/components/Facility/FacilityHome";
import FacilityUsers from "@/components/Facility/FacilityUsers";
import ResourceCreate from "@/components/Resource/ResourceCreate";
Expand All @@ -12,10 +11,7 @@ import FacilityOrganizationView from "@/pages/FacilityOrganization/FacilityOrgan

const FacilityRoutes: AppRoutes = {
"/facility": () => <Redirect to="/" />,
"/facility/create": () => <FacilityCreate />,
"/facility/:facilityId/update": ({ facilityId }) => (
<FacilityCreate facilityId={facilityId} />
),

"/facility/:facilityId": ({ facilityId }) => (
<FacilityHome facilityId={facilityId} />
),
Expand Down
2 changes: 1 addition & 1 deletion src/Utils/request/api.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ const routes = {
getPermittedFacility: {
path: "/api/v1/facility/{id}/",
method: "GET",
TRes: Type<FacilityModel>(),
TRes: Type<FacilityData>(),
},

getAnyFacility: {
Expand Down
5 changes: 5 additions & 0 deletions src/Utils/utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { differenceInMinutes, format } from "date-fns";
import html2canvas from "html2canvas";
import { toast } from "sonner";

import { AREACODES, IN_LANDLINE_AREA_CODES } from "@/common/constants";
import phoneCodesJson from "@/common/static/countryPhoneAndFlags.json";
Expand Down Expand Up @@ -112,6 +113,10 @@ export const getPincodeDetails = async (pincode: string, apiKey: string) => {
`https://api.data.gov.in/resource/6176ee09-3d56-4a3b-8115-21841576b2f6?api-key=${apiKey}&format=json&filters[pincode]=${pincode}&limit=1`,
);
const data = await response.json();
if (!data.records || data.records.length === 0) {
toast.error("Invalid pincode");
Mahendar0701 marked this conversation as resolved.
Show resolved Hide resolved
return null;
}
return data.records[0];
};

Expand Down
Loading
Loading