- {t("local_ipaddress")}:
+ {t("local_ip_address")}:
{asset?.meta?.local_ip_address}
diff --git a/src/Components/Common/Sidebar/SidebarUserCard.tsx b/src/Components/Common/Sidebar/SidebarUserCard.tsx
index 825507ffb25..70a64917224 100644
--- a/src/Components/Common/Sidebar/SidebarUserCard.tsx
+++ b/src/Components/Common/Sidebar/SidebarUserCard.tsx
@@ -26,7 +26,7 @@ const SidebarUserCard: React.FC = ({ shrinked }) => {
-
+
= ({ shrinked }) => {
diff --git a/src/Components/Common/components/ButtonV2.tsx b/src/Components/Common/components/ButtonV2.tsx
index bc67e150fdc..b7eab5f29d7 100644
--- a/src/Components/Common/components/ButtonV2.tsx
+++ b/src/Components/Common/components/ButtonV2.tsx
@@ -4,6 +4,8 @@ import CareIcon from "../../../CAREUI/icons/CareIcon";
import { Link } from "raviger";
import { classNames } from "../../../Utils/utils";
import { useTranslation } from "react-i18next";
+import { useEffect, useState } from "react";
+import Spinner from "../Spinner";
export type ButtonSize = "small" | "default" | "large";
export type ButtonShape = "square" | "circle";
@@ -22,36 +24,40 @@ export type RawButtonProps = Omit<
"style"
>;
+export type ButtonStyleProps = {
+ /**
+ * - `"small"` has small text and minimal padding.
+ * - `"default"` has small text with normal padding.
+ * - `"large"` has base text size with large padding.
+ */
+ size?: ButtonSize;
+ /**
+ * - `"square"` gives a button with minimally rounded corners.
+ * - `"circle"` gives a button with fully rounded corners. Ideal when only
+ * icons are present.
+ */
+ circle?: boolean | undefined;
+ /**
+ * - `"primary"` is ideal for form submissions, etc.
+ * - `"secondary"` is ideal for things that have secondary importance.
+ * - `"danger"` is ideal for destructive or dangerous actions, such as delete.
+ * - `"warning"` is ideal for actions that require caution such as archive.
+ * - `"alert"` is ideal for actions that require alert.
+ */
+ variant?: ButtonVariant;
+ /** If set, gives an elevated button with hover effects. */
+ shadow?: boolean | undefined;
+ /** If set, removes the background to give a simple text button. */
+ ghost?: boolean | undefined;
+ /**
+ * If set, applies border to the button.
+ */
+ border?: boolean | undefined;
+};
+
export type ButtonProps = RawButtonProps &
- AuthorizedElementProps & {
- /**
- * - `"small"` has small text and minimal padding.
- * - `"default"` has small text with normal padding.
- * - `"large"` has base text size with large padding.
- */
- size?: ButtonSize;
- /**
- * - `"square"` gives a button with minimally rounded corners.
- * - `"circle"` gives a button with fully rounded corners. Ideal when only
- * icons are present.
- */
- circle?: boolean | undefined;
- /**
- * - `"primary"` is ideal for form submissions, etc.
- * - `"secondary"` is ideal for things that have secondary importance.
- * - `"danger"` is ideal for destructive or dangerous actions, such as delete.
- * - `"warning"` is ideal for actions that require caution such as archive.
- * - `"alert"` is ideal for actions that require alert.
- */
- variant?: ButtonVariant;
- /** If set, gives an elevated button with hover effects. */
- shadow?: boolean | undefined;
- /** If set, removes the background to give a simple text button. */
- ghost?: boolean | undefined;
- /**
- * If set, applies border to the button.
- */
- border?: boolean | undefined;
+ AuthorizedElementProps &
+ ButtonStyleProps & {
/**
* Whether the button is disabled or not.
* This is overriden to `true` if `loading` is `true`.
@@ -83,10 +89,28 @@ export type ButtonProps = RawButtonProps &
tooltipClassName?: string;
};
-const ButtonV2 = ({
- authorizeFor,
+export const buttonStyles = ({
size = "default",
+ circle = false,
variant = "primary",
+ ghost = false,
+ border = false,
+ shadow = !ghost,
+}: ButtonStyleProps) => {
+ return classNames(
+ "inline-flex h-min cursor-pointer items-center justify-center gap-2 whitespace-pre font-medium outline-offset-1 transition-all duration-200 ease-in-out disabled:cursor-not-allowed disabled:bg-secondary-200 disabled:text-secondary-500",
+ `button-size-${size}`,
+ `button-shape-${circle ? "circle" : "square"}`,
+ ghost ? `button-${variant}-ghost` : `button-${variant}-default`,
+ border && `button-${variant}-border`,
+ shadow && "shadow enabled:hover:shadow-md",
+ );
+};
+
+const ButtonV2 = ({
+ authorizeFor,
+ size,
+ variant,
circle,
shadow,
ghost,
@@ -103,14 +127,9 @@ const ButtonV2 = ({
shadow ??= !ghost;
const className = classNames(
- props.className,
- "inline-flex h-min cursor-pointer items-center justify-center gap-2 whitespace-pre font-medium outline-offset-1 transition-all duration-200 ease-in-out disabled:cursor-not-allowed disabled:bg-secondary-200 disabled:text-secondary-500",
- `button-size-${size}`,
- `button-shape-${circle ? "circle" : "square"}`,
- ghost ? `button-${variant}-ghost` : `button-${variant}-default`,
- border && `button-${variant}-border`,
- shadow && "shadow enabled:hover:shadow-md",
+ buttonStyles({ size, circle, variant, ghost, border, shadow }),
tooltip && "tooltip",
+ props.className,
);
if (tooltip) {
@@ -202,3 +221,53 @@ export const Cancel = ({ label = "Cancel", ...props }: CommonButtonProps) => {
/>
);
};
+
+export type ButtonWithTimerProps = CommonButtonProps & {
+ initialInverval?: number;
+ interval?: number;
+};
+
+export const ButtonWithTimer = ({
+ initialInverval,
+ interval = 60,
+ ...buttonProps
+}: ButtonWithTimerProps) => {
+ const [seconds, setSeconds] = useState(initialInverval ?? interval);
+ const [isButtonDisabled, setIsButtonDisabled] = useState(true);
+
+ useEffect(() => {
+ let interval = undefined;
+ if (seconds > 0) {
+ interval = setInterval(() => {
+ setSeconds((prevSeconds) => prevSeconds - 1);
+ }, 1000);
+ } else {
+ setIsButtonDisabled(false);
+ clearInterval(interval);
+ }
+ return () => clearInterval(interval);
+ }, [seconds]);
+
+ return (
+
+
{
+ await buttonProps.onClick?.(e);
+ setSeconds(interval);
+ setIsButtonDisabled(true);
+ }}
+ >
+ {!!(seconds && isButtonDisabled) && (
+
+
+ {seconds}
+
+ )}
+
+ {buttonProps.children ?? buttonProps.label}
+
+
+ );
+};
diff --git a/src/Components/Facility/ConsultationDetails/ConsultationFeedTab.tsx b/src/Components/Facility/ConsultationDetails/ConsultationFeedTab.tsx
index 2e999d1956e..91922c99205 100644
--- a/src/Components/Facility/ConsultationDetails/ConsultationFeedTab.tsx
+++ b/src/Components/Facility/ConsultationDetails/ConsultationFeedTab.tsx
@@ -1,14 +1,11 @@
import { useEffect, useRef, useState } from "react";
import { ConsultationTabProps } from "./index";
-import { AssetBedModel, AssetData } from "../../Assets/AssetTypes";
-import routes from "../../../Redux/api";
import useQuery from "../../../Utils/request/useQuery";
import CameraFeed from "../../CameraFeed/CameraFeed";
import Loading from "../../Common/Loading";
-import AssetBedSelect from "../../CameraFeed/AssetBedSelect";
+import CameraPresetSelect from "../../CameraFeed/CameraPresetSelect";
import { triggerGoal } from "../../../Integrations/Plausible";
import useAuthUser from "../../../Common/hooks/useAuthUser";
-import useSlug from "../../../Common/hooks/useSlug";
import CareIcon from "../../../CAREUI/icons/CareIcon";
import ButtonV2 from "../../Common/components/ButtonV2";
import useOperateCamera, {
@@ -20,18 +17,19 @@ import ConfirmDialog from "../../Common/ConfirmDialog";
import useBreakpoints from "../../../Common/hooks/useBreakpoints";
import { Warn } from "../../../Utils/Notifications";
import { useTranslation } from "react-i18next";
-import { GetStatusResponse } from "../../CameraFeed/routes";
+import {
+ CameraPreset,
+ FeedRoutes,
+ GetStatusResponse,
+} from "../../CameraFeed/routes";
import StillWatching from "../../CameraFeed/StillWatching";
export const ConsultationFeedTab = (props: ConsultationTabProps) => {
const { t } = useTranslation();
const authUser = useAuthUser();
- const facility = useSlug("facility");
const bed = props.consultationData.current_bed?.bed_object;
const feedStateSessionKey = `encounterFeedState[${props.consultationId}]`;
-
- const [asset, setAsset] = useState
();
- const [preset, setPreset] = useState();
+ const [preset, setPreset] = useState();
const [showPresetSaveConfirmation, setShowPresetSaveConfirmation] =
useState(false);
const [isUpdatingPreset, setIsUpdatingPreset] = useState(false);
@@ -52,23 +50,22 @@ export const ConsultationFeedTab = (props: ConsultationTabProps) => {
}
}, []);
- const { key, operate } = useOperateCamera(asset?.id ?? "", true);
+ const asset = preset?.asset_bed.asset_object;
+
+ const { key, operate } = useOperateCamera(asset?.id ?? "");
- const { data, loading, refetch } = useQuery(routes.listAssetBeds, {
- query: { limit: 100, facility, bed: bed?.id, asset: asset?.id },
+ const presetsQuery = useQuery(FeedRoutes.listBedPresets, {
+ pathParams: { bed_id: bed?.id ?? "" },
+ query: { limit: 100 },
prefetch: !!bed,
onResponse: ({ data }) => {
if (!data) {
return;
}
- const presets = data.results.filter(
- (obj) =>
- obj.asset_object.meta?.asset_type === "CAMERA" &&
- obj.meta.type !== "boundary",
- );
-
+ const presets = data.results;
const lastStateJSON = sessionStorage.getItem(feedStateSessionKey);
+
const preset =
(() => {
if (lastStateJSON) {
@@ -77,23 +74,33 @@ export const ConsultationFeedTab = (props: ConsultationTabProps) => {
return presets.find((obj) => obj.id === lastState.value);
}
if (lastState.type === "position") {
+ const assetBedObj = presets.find(
+ (p) => p.asset_bed.id === lastState.assetBed,
+ )?.asset_bed;
+
+ if (!assetBedObj) {
+ return;
+ }
+
return {
...presets[0],
id: "",
- meta: { ...presets[0].meta, position: lastState.value },
- };
+ asset_bed: assetBedObj,
+ position: lastState.value,
+ } satisfies CameraPreset;
}
}
})() ?? presets[0];
+ console.log({ preset, presets });
+
if (preset) {
setPreset(preset);
- setAsset(preset.asset_object);
}
},
});
- const presets = data?.results;
+ const presets = presetsQuery.data?.results;
const handleUpdatePreset = async () => {
if (!preset) return;
@@ -102,17 +109,17 @@ export const ConsultationFeedTab = (props: ConsultationTabProps) => {
const { data } = await operate({ type: "get_status" });
const { position } = (data as { result: { position: PTZPayload } }).result;
-
- const { data: updated } = await request(routes.partialUpdateAssetBed, {
- pathParams: { external_id: preset.id },
+ const { data: updated } = await request(FeedRoutes.updatePreset, {
+ pathParams: {
+ assetbed_id: preset.asset_bed.id,
+ id: preset.id,
+ },
body: {
- asset: preset.asset_object.id,
- bed: preset.bed_object.id,
- meta: { ...preset.meta, position },
+ position,
},
});
- await refetch();
+ await presetsQuery.refetch();
setPreset(updated);
setHasMoved(false);
@@ -124,7 +131,7 @@ export const ConsultationFeedTab = (props: ConsultationTabProps) => {
if (divRef.current) {
divRef.current.scrollIntoView({ behavior: "smooth" });
}
- }, [!!bed, loading, !!asset, divRef.current]);
+ }, [!!bed, presetsQuery.loading, !!asset, divRef.current]);
useEffect(() => {
if (preset?.id) {
@@ -138,7 +145,7 @@ export const ConsultationFeedTab = (props: ConsultationTabProps) => {
}
}, [feedStateSessionKey, preset]);
- if (loading) {
+ if (presetsQuery.loading) {
return ;
}
@@ -169,8 +176,11 @@ export const ConsultationFeedTab = (props: ConsultationTabProps) => {
{
+ if (!preset) {
+ return;
+ }
setHasMoved(true);
setTimeout(async () => {
const { data } = await operate({ type: "get_status" });
@@ -179,6 +189,7 @@ export const ConsultationFeedTab = (props: ConsultationTabProps) => {
feedStateSessionKey,
JSON.stringify({
type: "position",
+ assetBed: preset.asset_bed.id,
value: (data as GetStatusResponse).result.position,
} satisfies LastAccessedPosition),
);
@@ -204,26 +215,19 @@ export const ConsultationFeedTab = (props: ConsultationTabProps) => {
{presets ? (
<>
-
obj.meta.preset_name}
+ label={(obj) => obj.name}
value={preset}
onChange={(value) => {
triggerGoal("Camera Preset Clicked", {
- presetName: preset?.meta?.preset_name,
+ presetName: preset?.name,
consultationId: props.consultationId,
userId: authUser.id,
result: "success",
});
setHasMoved(false);
- // Voluntarily copying to trigger change of reference of the position attribute, so that the useEffect of CameraFeed that handles the moves gets triggered.
- setPreset({
- ...value,
- meta: {
- ...value.meta,
- position: { ...value.meta.position },
- },
- });
+ setPreset(value);
}}
/>
{isUpdatingPreset ? (
@@ -269,6 +273,7 @@ type LastAccessedPreset = {
type LastAccessedPosition = {
type: "position";
+ assetBed: string;
value: PTZPayload;
};
diff --git a/src/Components/Facility/ConsultationDetails/index.tsx b/src/Components/Facility/ConsultationDetails/index.tsx
index 6970898a158..639c6dd9e40 100644
--- a/src/Components/Facility/ConsultationDetails/index.tsx
+++ b/src/Components/Facility/ConsultationDetails/index.tsx
@@ -1,10 +1,6 @@
import { GENDER_TYPES } from "../../../Common/constants";
import { ConsultationModel } from "../models";
-import {
- getConsultation,
- getPatient,
- listAssetBeds,
-} from "../../../Redux/actions";
+import { getConsultation, getPatient } from "../../../Redux/actions";
import { statusType, useAbortableEffect } from "../../../Common/utils";
import { useCallback, useState } from "react";
import DoctorVideoSlideover from "../DoctorVideoSlideover";
@@ -35,7 +31,6 @@ import { ConsultationNeurologicalMonitoringTab } from "./ConsultationNeurologica
import ABDMRecordsTab from "../../ABDM/ABDMRecordsTab";
import { ConsultationNutritionTab } from "./ConsultationNutritionTab";
import PatientNotesSlideover from "../PatientNotesSlideover";
-import { AssetBedModel } from "../../Assets/AssetTypes";
import PatientInfoCard from "../../Patient/PatientInfoCard";
import RelativeDateUserMention from "../../Common/RelativeDateUserMention";
import DiagnosesListAccordion from "../../Diagnosis/DiagnosesListAccordion";
@@ -129,20 +124,24 @@ export const ConsultationDetails = (props: any) => {
);
}
setConsultationData(data);
- const assetRes = data?.current_bed?.bed_object?.id
- ? await dispatch(
- listAssetBeds({
- bed: data?.current_bed?.bed_object?.id,
- }),
- )
- : null;
- const isCameraAttachedRes =
- assetRes != null
- ? assetRes.data.results.some((asset: AssetBedModel) => {
- return asset?.asset_object?.asset_class === "ONVIF";
- })
- : false;
- setIsCameraAttached(isCameraAttachedRes);
+
+ setIsCameraAttached(
+ await (async () => {
+ const bedId = data?.current_bed?.bed_object?.id;
+ if (!bedId) {
+ return false;
+ }
+ const { data: assetBeds } = await request(routes.listAssetBeds, {
+ query: { bed: bedId },
+ });
+ if (!assetBeds) {
+ return false;
+ }
+ return assetBeds.results.some(
+ (a) => a.asset_object.asset_class === "ONVIF",
+ );
+ })(),
+ );
// Get patient data
const id = res.data.patient;
@@ -169,7 +168,7 @@ export const ConsultationDetails = (props: any) => {
// Get abha number data
const { data: abhaNumberData } = await request(
- routes.abha.getAbhaNumber,
+ routes.abdm.abhaNumber.get,
{
pathParams: { abhaNumberId: id ?? "" },
silent: true,
diff --git a/src/Components/Facility/FacilityBlock.tsx b/src/Components/Facility/FacilityBlock.tsx
index 3232321637f..0ad87b050c5 100644
--- a/src/Components/Facility/FacilityBlock.tsx
+++ b/src/Components/Facility/FacilityBlock.tsx
@@ -24,15 +24,11 @@ export default function FacilityBlock(props: {
return (
-
- {facility.read_cover_image_url ? (
-
- ) : (
-
- )}
+
{facility.name}
diff --git a/src/Components/Facility/FacilityCard.tsx b/src/Components/Facility/FacilityCard.tsx
index 69b5b9d421e..e874a0f85c0 100644
--- a/src/Components/Facility/FacilityCard.tsx
+++ b/src/Components/Facility/FacilityCard.tsx
@@ -9,7 +9,6 @@ import CareIcon from "../../CAREUI/icons/CareIcon";
import { formatPhoneNumber, parsePhoneNumber } from "../../Utils/utils";
import DialogModal from "../Common/Dialog";
import TextAreaFormField from "../Form/FormFields/TextAreaFormField";
-import { classNames } from "../../Utils/utils";
import request from "../../Utils/request/request";
import routes from "../../Redux/api";
import careConfig from "@careConfig";
@@ -52,20 +51,18 @@ export const FacilityCard = (props: {
return (
-
+
- {(facility.read_cover_image_url && (
-
- )) ||
}
+
@@ -73,21 +70,12 @@ export const FacilityCard = (props: {
- {(facility.read_cover_image_url && (
-
- )) || (
-
- )}
+
{facility.kasp_empanelled && (
@@ -99,12 +87,27 @@ export const FacilityCard = (props: {
className="flex flex-wrap items-center justify-between"
id="facility-name-card"
>
-
- {facility.name}
-
+
+
+ {facility.name}
+
+
0.85 ? "justify-center rounded-md border border-red-600 bg-red-500 p-1 font-bold text-white" : "text-secondary-700"}`}
+ >
+
+ {t("live_patients_total_beds")}
+ {" "}
+
+
+ {t("occupancy")}: {facility.patient_count} /{" "}
+ {facility.bed_count}{" "}
+
+
+
-
View CNS
+
{t("view_cns")}
+
-
+
{/*
*/}
-
- 0.85
- ? "button-danger-border bg-red-500"
- : "button-primary-border bg-primary-100"
- }`}
- >
-
- Live Patients / Total beds
- {" "}
-
- 0.85
- ? "text-white"
- : "text-primary-600",
- )}
- />{" "}
-
- 0.85
- ? "text-white"
- : "text-secondary-700"
- }`}
- >
- Occupancy: {facility.patient_count} /{" "}
- {facility.bed_count}{" "}
- {" "}
-
{
);
- const CoverImage = () => (
-
- );
-
return (
{
onDelete={() => facilityFetch()}
facility={facilityData ?? ({} as FacilityModel)}
/>
- {hasCoverImage ? (
-
-
- {editCoverImageTooltip}
-
- ) : (
-
- hasPermissionToEditCoverImage && setEditCoverImage(true)
- }
- >
-
- {editCoverImageTooltip}
-
- )}
+
+ hasPermissionToEditCoverImage && setEditCoverImage(true)}
+ >
+
+ {editCoverImageTooltip}
+
{
hasPermissionToEditCoverImage && setEditCoverImage(true)
}
>
- {hasCoverImage ? (
-
- ) : (
-
- )}
+
+
{editCoverImageTooltip}
diff --git a/src/Components/Facility/FacilityUsers.tsx b/src/Components/Facility/FacilityUsers.tsx
index 92cc4b35d10..f7fe62810fc 100644
--- a/src/Components/Facility/FacilityUsers.tsx
+++ b/src/Components/Facility/FacilityUsers.tsx
@@ -4,7 +4,7 @@ import CareIcon from "../../CAREUI/icons/CareIcon";
import { RESULTS_PER_PAGE_LIMIT } from "../../Common/constants";
import * as Notification from "../../Utils/Notifications.js";
import { formatName, isUserOnline, relativeTime } from "../../Utils/utils";
-import SlideOverCustom from "../../CAREUI/interactive/SlideOver";
+import SlideOver from "../../CAREUI/interactive/SlideOver";
import Pagination from "../Common/Pagination";
import UserDetails from "../Common/UserDetails";
import ButtonV2 from "../Common/components/ButtonV2";
@@ -279,7 +279,7 @@ export default function FacilityUsers(props: any) {
/>
)}
-
-
+
diff --git a/src/Components/Form/FormFields/TextFormField.tsx b/src/Components/Form/FormFields/TextFormField.tsx
index 0593dc9a2d3..a3663358a56 100644
--- a/src/Components/Form/FormFields/TextFormField.tsx
+++ b/src/Components/Form/FormFields/TextFormField.tsx
@@ -1,31 +1,30 @@
import { FormFieldBaseProps, useFormFieldPropsResolver } from "./Utils";
-import { HTMLInputTypeAttribute, forwardRef, useState } from "react";
+import {
+ DetailedHTMLProps,
+ InputHTMLAttributes,
+ forwardRef,
+ useState,
+} from "react";
import CareIcon from "../../../CAREUI/icons/CareIcon";
import FormField from "./FormField";
import { classNames } from "../../../Utils/utils";
-export type TextFormFieldProps = FormFieldBaseProps & {
- placeholder?: string;
- value?: string | number;
- autoComplete?: string;
- type?: HTMLInputTypeAttribute;
- className?: string | undefined;
- inputClassName?: string | undefined;
- removeDefaultClasses?: true | undefined;
- leading?: React.ReactNode | undefined;
- trailing?: React.ReactNode | undefined;
- leadingFocused?: React.ReactNode | undefined;
- trailingFocused?: React.ReactNode | undefined;
- trailingPadding?: string | undefined;
- leadingPadding?: string | undefined;
- min?: string | number;
- max?: string | number;
- step?: string | number;
- onKeyDown?: (event: React.KeyboardEvent) => void;
- onFocus?: (event: React.FocusEvent) => void;
- onBlur?: (event: React.FocusEvent) => void;
-};
+export type TextFormFieldProps = FormFieldBaseProps &
+ Omit<
+ DetailedHTMLProps, HTMLInputElement>,
+ "onChange"
+ > & {
+ inputClassName?: string | undefined;
+ removeDefaultClasses?: true | undefined;
+ leading?: React.ReactNode | undefined;
+ trailing?: React.ReactNode | undefined;
+ leadingFocused?: React.ReactNode | undefined;
+ trailingFocused?: React.ReactNode | undefined;
+ trailingPadding?: string | undefined;
+ leadingPadding?: string | undefined;
+ suggestions?: string[];
+ };
const TextFormField = forwardRef((props: TextFormFieldProps, ref) => {
const field = useFormFieldPropsResolver(props);
@@ -43,7 +42,8 @@ const TextFormField = forwardRef((props: TextFormFieldProps, ref) => {
let child = (
}
id={field.id}
className={classNames(
"cui-input-base peer",
@@ -54,18 +54,10 @@ const TextFormField = forwardRef((props: TextFormFieldProps, ref) => {
)}
disabled={field.disabled}
type={props.type === "password" ? getPasswordFieldType() : props.type}
- placeholder={props.placeholder}
name={field.name}
value={field.value}
- min={props.min}
- max={props.max}
- autoComplete={props.autoComplete}
required={field.required}
- onFocus={props.onFocus}
- onBlur={props.onBlur}
onChange={(e) => field.handleChange(e.target.value)}
- onKeyDown={props.onKeyDown}
- step={props.step}
/>
);
@@ -125,6 +117,28 @@ const TextFormField = forwardRef((props: TextFormFieldProps, ref) => {
);
}
+ if (
+ props.suggestions?.length &&
+ !props.suggestions.includes(`${field.value}`)
+ ) {
+ child = (
+
+ {child}
+
+ {props.suggestions.map((suggestion) => (
+ field.handleChange(suggestion)}
+ >
+ {suggestion}
+
+ ))}
+
+
+ );
+ }
+
return {child} ;
});
diff --git a/src/Components/Patient/ManagePatients.tsx b/src/Components/Patient/ManagePatients.tsx
index 5259909bebe..758d948864d 100644
--- a/src/Components/Patient/ManagePatients.tsx
+++ b/src/Components/Patient/ManagePatients.tsx
@@ -52,6 +52,7 @@ import {
import { ICD11DiagnosisModel } from "../Diagnosis/types.js";
import { getDiagnosesByIds } from "../Diagnosis/utils.js";
import Tabs from "../Common/components/Tabs.js";
+import { isPatientMandatoryDataFilled } from "./Utils.js";
import request from "../../Utils/request/request.js";
import { Avatar } from "../Common/Avatar.js";
@@ -473,7 +474,9 @@ export const PatientManager = () => {
if (data?.count) {
patientList = data.results.map((patient) => {
let patientUrl = "";
- if (
+ if (!isPatientMandatoryDataFilled(patient)) {
+ patientUrl = `/facility/${patient.facility}/patient/${patient.id}`;
+ } else if (
patient.last_consultation &&
patient.last_consultation?.facility === patient.facility &&
!(patient.last_consultation?.discharge_date && patient.is_active)
@@ -494,7 +497,7 @@ export const PatientManager = () => {
const children = (
{
) : (
)}
@@ -593,10 +595,26 @@ export const PatientManager = () => {
)}
- {!patient.last_consultation ||
- patient.last_consultation?.facility !== patient.facility ||
- (patient.last_consultation?.discharge_date &&
- patient.is_active) ? (
+ {!isPatientMandatoryDataFilled(patient) && (
+
+
+
+
+
+
+
+ )}
+
+ {isPatientMandatoryDataFilled(patient) &&
+ (!patient.last_consultation ||
+ patient.last_consultation?.facility !== patient.facility ||
+ (patient.last_consultation?.discharge_date &&
+ patient.is_active)) ? (
{
return OCCUPATION_TYPES.find((i) => i.value === occupation)?.text;
};
@@ -341,6 +342,40 @@ export const PatientHome = (props: any) => {
)}
+
+ {isPatientMandatoryDataFilled(patientData) &&
+ (patientData?.facility != patientData?.last_consultation?.facility ||
+ (patientData.is_active &&
+ patientData?.last_consultation?.discharge_date)) && (
+
+
+
+
+
+
+ {t("consultation_missing_warning")}{" "}
+
+ {patientData.facility_object?.name || "-"}{" "}
+
+
+
+
+
+
+
+ {t("create_consultation")}
+
+
+
+ )}
diff --git a/src/Components/Patient/PatientInfoCard.tsx b/src/Components/Patient/PatientInfoCard.tsx
index 1f581b9b0e7..7e3a9563799 100644
--- a/src/Components/Patient/PatientInfoCard.tsx
+++ b/src/Components/Patient/PatientInfoCard.tsx
@@ -22,8 +22,6 @@ import {
humanizeStrings,
} from "../../Utils/utils.js";
import ABHAProfileModal from "../ABDM/ABHAProfileModal.js";
-import LinkABHANumberModal from "../ABDM/LinkABHANumberModal.js";
-import LinkCareContextModal from "../ABDM/LinkCareContextModal.js";
import DialogModal from "../Common/Dialog.js";
import ButtonV2 from "../Common/components/ButtonV2.js";
import Beds from "../Facility/Consultations/Beds.js";
@@ -43,6 +41,7 @@ import FetchRecordsModal from "../ABDM/FetchRecordsModal.js";
import { AbhaNumberModel } from "../ABDM/types/abha.js";
import { SkillModel } from "../Users/models.js";
import { AuthorizedForConsultationRelatedActions } from "../../CAREUI/misc/AuthorizedChild.js";
+import LinkAbhaNumber from "../ABDM/LinkAbhaNumber";
import careConfig from "@careConfig";
const formatSkills = (arr: SkillModel[]) => {
@@ -75,7 +74,6 @@ export default function PatientInfoCard(props: {
const [openDischargeSummaryDialog, setOpenDischargeSummaryDialog] =
useState(false);
const [openDischargeDialog, setOpenDischargeDialog] = useState(false);
- const [showLinkCareContext, setShowLinkCareContext] = useState(false);
const patient = props.patient;
const consultation = props.consultation;
@@ -748,7 +746,7 @@ export default function PatientInfoCard(props: {
close();
setShowABHAProfile(true);
triggerGoal("Patient Card Button Clicked", {
- buttonName: "Show ABHA Profile",
+ buttonName: t("show_abha_profile"),
consultationId: consultation?.id,
userId: authUser?.id,
});
@@ -758,25 +756,7 @@ export default function PatientInfoCard(props: {
icon="l-user-square"
className="text-lg text-primary-500"
/>
- Show ABHA Profile
-
-
{
- triggerGoal("Patient Card Button Clicked", {
- buttonName: "Link Care Context",
- consultationId: consultation?.id,
- userId: authUser?.id,
- });
- close();
- setShowLinkCareContext(true);
- }}
- >
-
- Link Care Context
+ {t("show_abha_profile")}
- Fetch Records over ABDM
+ {t("hi__fetch_records")}
>
)}
@@ -815,7 +795,7 @@ export default function PatientInfoCard(props: {
icon="l-link"
className="text-lg text-primary-500"
/>
-
Link ABHA Number
+
{t("link_abha_profile")}
)}
@@ -957,12 +937,33 @@ export default function PatientInfoCard(props: {
-
setShowLinkABHANumber(false)}
- patientId={patient.id as any}
- onSuccess={(_) => {
- window.location.href += "?show-abha-profile=true";
+ onSuccess={async (abhaProfile) => {
+ const { res, data } = await request(
+ routes.abdm.healthId.linkAbhaNumberAndPatient,
+ {
+ body: {
+ patient: patient.id,
+ abha_number: abhaProfile.external_id,
+ },
+ },
+ );
+
+ if (res?.status === 200 && data) {
+ Notification.Success({
+ msg: t("abha_number_linked_successfully"),
+ });
+
+ props.fetchPatientData?.({ aborted: false });
+ setShowLinkABHANumber(false);
+ setShowABHAProfile(true);
+ } else {
+ Notification.Error({
+ msg: t("failed_to_link_abha_number"),
+ });
+ }
}}
/>
setShowABHAProfile(false)}
/>
- setShowLinkCareContext(false)}
- />
{
pathParams: { id: id ? id : 0 },
});
const { data: abhaNumberData } = await request(
- routes.abha.getAbhaNumber,
+ routes.abdm.abhaNumber.get,
{
pathParams: { abhaNumberId: id ?? "" },
silent: true,
@@ -589,7 +591,6 @@ export const PatientRegister = (props: PatientRegisterProps) => {
}
});
const data = {
- abha_number: state.form.abha_number,
phone_number: parsePhoneNumber(formData.phone_number),
emergency_phone_number: parsePhoneNumber(formData.emergency_phone_number),
date_of_birth:
@@ -681,12 +682,15 @@ export const PatientRegister = (props: PatientRegisterProps) => {
});
if (res?.ok && requestData) {
if (state.form.abha_number) {
- const { res, data } = await request(routes.abha.linkPatient, {
- body: {
- patient: requestData.id,
- abha_number: state.form.abha_number,
+ const { res, data } = await request(
+ routes.abdm.healthId.linkAbhaNumberAndPatient,
+ {
+ body: {
+ patient: requestData.id,
+ abha_number: state.form.abha_number,
+ },
},
- });
+ );
if (res?.status === 200 && data) {
Notification.Success({
@@ -738,64 +742,64 @@ export const PatientRegister = (props: PatientRegisterProps) => {
setIsLoading(false);
};
- const handleAbhaLinking = (
- {
- id,
- abha_profile: {
- healthIdNumber,
- healthId,
- name,
- mobile,
- gender,
- monthOfBirth,
- dayOfBirth,
- yearOfBirth,
- pincode,
- },
- }: any,
- field: any,
+ const populateAbhaValues = (
+ abhaProfile: AbhaNumberModel,
+ field: FormContextValue,
) => {
- const values: any = {};
- if (id) values["abha_number"] = id;
- if (healthIdNumber) values["health_id_number"] = healthIdNumber;
- if (healthId) values["health_id"] = healthId;
+ const values = {
+ abha_number: abhaProfile.external_id,
+ health_id_number: abhaProfile.abha_number,
+ health_id: abhaProfile.health_id,
+ };
- if (name)
+ if (abhaProfile.name)
field("name").onChange({
name: "name",
- value: name,
+ value: abhaProfile.name,
});
- if (mobile) {
+ if (abhaProfile.mobile) {
field("phone_number").onChange({
name: "phone_number",
- value: parsePhoneNumber(mobile, "IN"),
+ value: parsePhoneNumber(abhaProfile.mobile, "IN"),
});
field("emergency_phone_number").onChange({
name: "emergency_phone_number",
- value: parsePhoneNumber(mobile, "IN"),
+ value: parsePhoneNumber(abhaProfile.mobile, "IN"),
});
}
- if (gender)
+ if (abhaProfile.gender)
field("gender").onChange({
name: "gender",
- value: gender === "M" ? "1" : gender === "F" ? "2" : "3",
+ value: { M: "1", F: "2", O: "3" }[abhaProfile.gender],
});
- if (monthOfBirth && dayOfBirth && yearOfBirth)
+ if (abhaProfile.date_of_birth)
field("date_of_birth").onChange({
name: "date_of_birth",
- value: new Date(`${monthOfBirth}-${dayOfBirth}-${yearOfBirth}`),
+ value: new Date(abhaProfile.date_of_birth),
});
- if (pincode)
+ if (abhaProfile.pincode)
field("pincode").onChange({
name: "pincode",
- value: pincode,
+ value: abhaProfile.pincode,
});
+ if (abhaProfile.address) {
+ field("address").onChange({
+ name: "address",
+ value: abhaProfile.address,
+ });
+
+ field("permanent_address").onChange({
+ name: "permanent_address",
+ value: abhaProfile.address,
+ });
+ }
+
dispatch({ type: "set_form", form: { ...state.form, ...values } });
setShowLinkAbhaNumberModal(false);
};
@@ -922,7 +926,7 @@ export const PatientRegister = (props: PatientRegisterProps) => {
validate={validateForm}
onSubmit={handleSubmit}
submitLabel={buttonText}
- onCancel={() => navigate("/facility")}
+ onCancel={() => goBack()}
className="bg-transparent px-1 py-2 md:px-2"
onDraftRestore={(newState) => {
dispatch({ type: "set_state", state: newState });
@@ -1035,16 +1039,17 @@ export const PatientRegister = (props: PatientRegisterProps) => {
{careConfig.abdm.enabled && (
{showLinkAbhaNumberModal && (
-
setShowLinkAbhaNumberModal(false)}
- onSuccess={(data: any) => {
+ onSuccess={(data) => {
if (id) {
- navigate(`/facility/${facilityId}/patient/${id}`);
- return;
+ Notification.Warn({
+ msg: "To link Abha Number, please save the patient details",
+ });
}
- handleAbhaLinking(data, field);
+ populateAbhaValues(data, field);
}}
/>
)}
diff --git a/src/Components/Patient/Utils.ts b/src/Components/Patient/Utils.ts
new file mode 100644
index 00000000000..96e05e63232
--- /dev/null
+++ b/src/Components/Patient/Utils.ts
@@ -0,0 +1,19 @@
+import { PatientModel } from "./models";
+
+export function isPatientMandatoryDataFilled(patient: PatientModel) {
+ return (
+ patient.phone_number &&
+ patient.emergency_phone_number &&
+ patient.name &&
+ patient.gender &&
+ (patient.date_of_birth || patient.year_of_birth) &&
+ patient.address &&
+ patient.permanent_address &&
+ patient.pincode &&
+ patient.state &&
+ patient.district &&
+ patient.local_body &&
+ ("medical_history" in patient ? patient.medical_history : true) &&
+ patient.blood_group
+ );
+}
diff --git a/src/Components/Patient/models.tsx b/src/Components/Patient/models.tsx
index d9e275fdc4a..9843b867a5b 100644
--- a/src/Components/Patient/models.tsx
+++ b/src/Components/Patient/models.tsx
@@ -134,6 +134,7 @@ export interface PatientModel {
created_by?: PerformedByModel;
assigned_to?: { first_name?: string; username?: string; last_name?: string };
assigned_to_object?: AssignedToObjectModel;
+ occupation?: Occupation;
meta_info?: PatientMeta;
age?: string;
}
diff --git a/src/Components/Shifting/BoardView.tsx b/src/Components/Shifting/BoardView.tsx
index f83e0a4974e..c071cc4d934 100644
--- a/src/Components/Shifting/BoardView.tsx
+++ b/src/Components/Shifting/BoardView.tsx
@@ -143,7 +143,10 @@ export default function BoardView() {
{
const { data } = await request(routes.downloadShiftRequests, {
- query: { ...formatFilter(qParams), csv: true },
+ query: {
+ ...formatFilter({ ...qParams, status: board.text }),
+ csv: true,
+ },
});
return data ?? null;
}}
diff --git a/src/Locale/en.json b/src/Locale/en.json
index a7c2d1a0c21..e516ec61733 100644
--- a/src/Locale/en.json
+++ b/src/Locale/en.json
@@ -213,7 +213,43 @@
"VENTILATOR_MODE__VCV": "Volume Control Ventilation (VCV)",
"VENTILATOR_MODE__VC_SIMV": "Volume Controlled SIMV (VC-SIMV)",
"View Facility": "View Facility",
- "abha_number_linked_successfully": "ABHA number linked successfully",
+ "aadhaar_number": "Aadhaar Number",
+ "aadhaar_number_will_not_be_stored": "Aadhaar number will not be stored by CARE",
+ "aadhaar_otp_send_error": "Failed to send OTP. Please try again later.",
+ "aadhaar_otp_send_success": "OTP has been sent to the mobile number registered with the Aadhar number.",
+ "aadhaar_validation_length_error": "Should be a 12-digit aadhaar number or 16-digit virtual ID",
+ "aadhaar_validation_space_error": "Aadhaar number should not contain spaces",
+ "abha__auth_method__AADHAAR_OTP": "Aadhaar OTP",
+ "abha__auth_method__MOBILE_OTP": "Mobile OTP",
+ "abha__disclaimer_1": "I am voluntarily sharing my Aadhaar Number / Virtual ID issued by the Unique Identification Authority of India (\"UIDAI\"), and my demographic information for the purpose of creating an Ayushman Bharat Health Account number (\"ABHA number\") and Ayushman Bharat Health Account address (\"ABHA Address\"). I authorize NHA to use my Aadhaar number / Virtual ID for performing Aadhaar based authentication with UIDAI as per the provisions of the Aadhaar (Targeted Delivery of Financial and other Subsidies, Benefits and Services) Act, 2016 for the aforesaid purpose. I understand that UIDAI will share my e-KYC details, or response of \"Yes\" with NHA upon successful authentication.",
+ "abha__disclaimer_2": "I consent to usage of my ABHA address and ABHA number for linking of my legacy (past) health records and those which will be generated during this encounter.",
+ "abha__disclaimer_3": "I authorize the sharing of all my health records with healthcare provider(s) for the purpose of providing healthcare services to me during this encounter.",
+ "abha__disclaimer_4": "I consent to the anonymization and subsequent use of my health records for public health purposes.",
+ "abha__qr_scanning_error": "Error scanning QR code, Invalid QR code",
+ "abha_address": "ABHA Address",
+ "abha_address_created_error": "Failed to create Abha Address. Please try again later.",
+ "abha_address_created_success": "Abha Address has been created successfully.",
+ "abha_address_suggestions": "Here are some suggestions:",
+ "abha_address_validation_character_error": "Should only contain letters, numbers, underscore(_) or dot(.)",
+ "abha_address_validation_end_error": "Shouldn't end with a dot (.)",
+ "abha_address_validation_length_error": "Should be atleast 4 character long",
+ "abha_address_validation_start_error": "Shouldn't start with a number or dot (.)",
+ "abha_details": "ABHA Details",
+ "abha_link_options__create_with_aadhaar__description": "Create New ABHA Number Using Aadhaar Number",
+ "abha_link_options__create_with_aadhaar__title": "Create with Aadhaar",
+ "abha_link_options__create_with_driving_license__description": "Create New ABHA Number Using Driving License",
+ "abha_link_options__create_with_driving_license__title": "Create with Driving License",
+ "abha_link_options__disabled_tooltip": "We are currently working on this feature",
+ "abha_link_options__link_with_demographics__description": "Link Existing ABHA Number Using Demographic details",
+ "abha_link_options__link_with_demographics__title": "Link with Demographics",
+ "abha_link_options__link_with_otp__description": "Link Existing ABHA Number Using Mobile or Aadhaar OTP",
+ "abha_link_options__link_with_otp__title": "Link with OTP",
+ "abha_link_options__link_with_qr__title": "Link with ABHA QR",
+ "abha_number": "ABHA Number",
+ "abha_number_exists": "ABHA Number already exists",
+ "abha_number_exists_description": "There is an ABHA Number already linked with the given Aadhaar Number, Do you want to create a new ABHA Address?",
+ "abha_number_linked_successfully": "ABHA Number has been linked successfully.",
+ "abha_profile": "ABHA Profile",
"access_level": "Access Level",
"action_irreversible": "This action is irreversible",
"active": "Active",
@@ -222,6 +258,7 @@
"add_as": "Add as",
"add_attachments": "Add Attachments",
"add_beds": "Add Bed(s)",
+ "add_beds_to_configure_presets": "Add beds to this location to configure presets for them.",
"add_details_of_patient": "Add Details of Patient",
"add_location": "Add Location",
"add_new_user": "Add New User",
@@ -229,6 +266,7 @@
"add_policy": "Add Insurance Policy",
"add_prescription_medication": "Add Prescription Medication",
"add_prescription_to_consultation_note": "Add a new prescription to this consultation.",
+ "add_preset": "Add preset",
"add_prn_prescription": "Add PRN Prescription",
"add_remarks": "Add remarks",
"add_spoke": "Add Spoke Facility",
@@ -251,6 +289,8 @@
"ambulance_number": "Ambulance No",
"ambulance_phone_number": "Phone number of Ambulance",
"antenatal": "Antenatal",
+ "any_id": "Enter any ID linked with your ABHA number",
+ "any_id_description": "Currently we support: Aadhaar Number / Mobile Number",
"any_other_comments": "Any other comments",
"apply": "Apply",
"approved_by_district_covid_control_room": "Approved by District COVID Control Room",
@@ -270,6 +310,7 @@
"assets": "Assets",
"assigned_facility": "Facility assigned",
"assigned_to": "Assigned to",
+ "async_operation_warning": "This operation may take some time. Please check back later.",
"audio__allow_permission": "Please allow microphone permission in site settings",
"audio__allow_permission_button": "Click here to know how to allow",
"audio__allow_permission_helper": "You might have denied microphone access in the past.",
@@ -282,6 +323,7 @@
"audio__start_again": "Start Again",
"audit_log": "Audit Log",
"auth_login_title": "Authorized Login",
+ "auth_method_unsupported": "This authentication method is not supported, please try a different method",
"authorize_shift_delete": "Authorize shift delete",
"auto_generated_for_care": "Auto Generated for Care",
"available_features": "Available Features",
@@ -296,6 +338,7 @@
"bed_capacity": "Bed Capacity",
"bed_created_notification_one": "{{count}} Bed created successfully",
"bed_created_notification_other": "{{count}} Beds created successfully",
+ "bed_not_linked_to_camera": "This bed has not been linked to this camera.",
"bed_search_placeholder": "Search by beds name",
"bed_type": "Bed Type",
"bed_type__100": "ICU Bed",
@@ -314,7 +357,9 @@
"bradycardia": "Bradycardia",
"breathlessness_level": "Breathlessness level",
"camera": "Camera",
+ "camera_bed_link_success": "Camera linked to bed successfully.",
"camera_permission_denied": "Camera Permission denied",
+ "camera_was_linked_to_bed": "This camera was linked to this bed",
"cancel": "Cancel",
"capture": "Capture",
"capture_cover_photo": "Capture Cover Photo",
@@ -328,6 +373,8 @@
"check_for_available_update": "Check for available update",
"check_for_update": "Check for Update",
"check_policy_eligibility": "Check Policy Eligibility",
+ "check_status": "Check Status",
+ "checking_consent_status": "Consent request status is being checked!",
"checking_eligibility": "Checking Eligibility",
"checking_for_update": "Checking for update",
"checking_policy_eligibility": "Checking Policy Eligibility",
@@ -385,7 +432,40 @@
"confirm_password": "Confirm Password",
"confirm_transfer_complete": "Confirm Transfer Complete!",
"confirmed": "Confirmed",
- "consultation_not_filed": "You have not filed any consultation for this patient yet.",
+ "consent__hi_range": "Health Information Range",
+ "consent__hi_type__DiagnosticReport": "Diagnostic Report",
+ "consent__hi_type__DischargeSummary": "Discharge Summary",
+ "consent__hi_type__HealthDocumentRecord": "Health Document Record",
+ "consent__hi_type__ImmunizationRecord": "Immunization Record",
+ "consent__hi_type__OPConsultation": "OP Consultation",
+ "consent__hi_type__Prescription": "Prescription",
+ "consent__hi_type__WellnessRecord": "Wellness Record",
+ "consent__hi_types": "HI Profiles",
+ "consent__patient": "Patient",
+ "consent__purpose": "Purpose",
+ "consent__purpose__BTG": "Break The Glass",
+ "consent__purpose__CAREMGT": "Care Management",
+ "consent__purpose__DSRCH": "Disease Specific Healthcare Research",
+ "consent__purpose__HPAYMT": "Healthcare Payment",
+ "consent__purpose__PATRQT": "Self Requested",
+ "consent__purpose__PUBHLTH": "Public Health",
+ "consent__status": "Status",
+ "consent__status__DENIED": "Denied",
+ "consent__status__EXPIRED": "Expired",
+ "consent__status__GRANTED": "Granted",
+ "consent__status__REQUESTED": "Requested",
+ "consent__status__REVOKED": "Revoked",
+ "consent_request__date_range": "Health Records Date Range",
+ "consent_request__expiry": "Consent Expiry Date",
+ "consent_request__hi_types": "Health Information Types",
+ "consent_request__hi_types_placeholder": "Select One or More HI Types",
+ "consent_request__patient_identifier": "Patient Identifier",
+ "consent_request__purpose": "Purpose of Request",
+ "consent_request_rejected": "Patient has rejected the consent request",
+ "consent_request_waiting_approval": "Waiting for the Patient to approve the consent request",
+ "consent_requested_successfully": "Consent requested successfully!",
+ "consultation_missing_warning": "You have not created a consultation for the patient in",
+ "consultation_not_filed": "You have not filed a consultation for this patient yet.",
"consultation_not_filed_description": "Please file a consultation for this patient to continue.",
"consultation_notes": "General Instructions (Advice)",
"consultation_updates": "Consultation updates",
@@ -403,11 +483,17 @@
"covid_19_cat_gov": "Covid_19 Clinical Category as per Govt. of Kerala guideline (A/B/C)",
"covid_19_death_reporting_form_1": "Covid-19 Death Reporting : Form 1",
"create": "Create",
+ "create_abha_address": "Create ABHA Address",
"create_add_more": "Create & Add More",
"create_asset": "Create Asset",
"create_consultation": "Create Consultation",
"create_facility": "Create a new 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_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",
+ "create_preset_prerequisite": "To create presets for this bed, you'll need to link the camera to the bed first.",
"create_resource_request": "Create Resource Request",
"created": "Created",
"created_date": "Created Date",
@@ -432,6 +518,7 @@
"delete_item": "Delete {{name}}",
"delete_record": "Delete Record",
"deleted_successfully": "{{name}} deleted successfully",
+ "denied_on": "Denied On",
"describe_why_the_asset_is_not_working": "Describe why the asset is not working",
"description": "Description",
"details_about_the_equipment": "Details about the equipment",
@@ -475,6 +562,7 @@
"download_discharge_summary": "Download discharge summary",
"download_type": "Download Type",
"downloading": "Downloading",
+ "downloading_abha_card": "Generating ABHA Card, Please hold on",
"downloads": "Downloads",
"drag_drop_image_to_upload": "Drag & drop image to upload",
"duplicate_patient_record_birth_unknown": "Please contact your district care coordinator, the shifting facility or the patient themselves if you are not sure about the patient's year of birth.",
@@ -516,8 +604,15 @@
"encounter_suggestion__OP": "Out-patient visit",
"encounter_suggestion__R": "Consultation",
"encounter_suggestion_edit_disallowed": "Not allowed to switch to this option in edit consultation",
+ "enter_aadhaar_number": "Enter a 12-digit Aadhaar ID",
+ "enter_aadhaar_otp": "Enter OTP sent to the registered mobile with Aadhaar",
+ "enter_abha_address": "Enter ABHA Address",
+ "enter_any_id": "Enter any ID linked with your ABHA number",
"enter_file_name": "Enter File Name",
"enter_message": "Start typing...",
+ "enter_mobile_number": "Enter Mobile Number",
+ "enter_mobile_otp": "Enter OTP sent to the given mobile number",
+ "enter_otp": "Enter OTP sent to the registered mobile with the respective ID",
"enter_valid_age": "Please Enter Valid Age",
"entered-in-error": "Entered in error",
"error_404": "Error 404",
@@ -527,14 +622,18 @@
"estimated_contact_date": "Estimated contact date",
"expand_sidebar": "Expand Sidebar",
"expected_burn_rate": "Expected Burn Rate",
+ "expired_on": "Expired On",
+ "expires_on": "Expires On",
"facilities": "Facilities",
"facility": "Facility",
+ "facility_consent_requests_page_title": "Patient Consent List",
"facility_name": "Facility Name",
"facility_preference": "Facility preference",
"facility_search_placeholder": "Search by Facility / District Name",
"facility_type": "Facility Type",
- "failed_to_link_abha_number": "Failed to link ABHA number",
+ "failed_to_link_abha_number": "Failed to link ABHA Number. Please try again later.",
"features": "Features",
+ "feed_configurations": "Feed Configurations",
"feed_is_currently_not_live": "Feed is currently not live",
"feed_optimal_experience_for_apple_phones": "For optimal viewing experience, consider rotating your device. Ensure auto-rotate is enabled in your device settings.",
"feed_optimal_experience_for_phones": "For optimal viewing experience, consider rotating your device.",
@@ -564,25 +663,53 @@
"forget_password": "Forgot password?",
"forget_password_instruction": "Enter your username, and if it exists, we will send you a link to reset your password.",
"frequency": "Frequency",
+ "full_name": "Full Name",
"full_screen": "Full Screen",
"gender": "Gender",
"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",
+ "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_tests": "Get Tests",
"goal": "Our goal is to continuously improve the quality and accessibility of public healthcare services using digital tools.",
+ "granted_on": "Granted On",
"has_domestic_healthcare_support": "Has domestic healthcare support?",
+ "health_facility__config_registration_error": "Health ID registration failed",
+ "health_facility__config_update_error": "Health Facility config update failed",
+ "health_facility__config_update_success": "Health Facility config updated successfully",
+ "health_facility__hf_id": "Health Facility Id",
+ "health_facility__link": "Link Health Facility",
+ "health_facility__not_registered_1.1": "The ABDM health facility is successfully linked with care",
+ "health_facility__not_registered_1.2": "but not registered as a service in bridge",
+ "health_facility__not_registered_2": "Click on Link Health Facility to register the service",
+ "health_facility__not_registered_3": "Not Registered",
+ "health_facility__registered_1.1": "The ABDM health facility is successfully linked with care",
+ "health_facility__registered_1.2": "and registered as a service in bridge",
+ "health_facility__registered_2": "No Action Required",
+ "health_facility__registered_3": "Registered",
+ "health_facility__validation__hf_id_required": "Health Facility Id is required",
"help_confirmed": "There is sufficient diagnostic and/or clinical evidence to treat this as a confirmed condition.",
"help_differential": "One of a set of potential (and typically mutually exclusive) diagnoses asserted to further guide the diagnostic process and preliminary treatment.",
"help_entered-in-error": "The statement was entered in error and is not valid.",
"help_provisional": "This is a tentative diagnosis - still a candidate that is under consideration.",
"help_refuted": "This condition has been ruled out by subsequent diagnostic and clinical evidence.",
"help_unconfirmed": "There is not sufficient diagnostic and/or clinical evidence to treat this as a confirmed condition.",
+ "hi__fetch_records": "Fetch Records over ABDM",
+ "hi__page_title": "Health Information",
+ "hi__record_archived__title": "This record has been archived",
+ "hi__record_archived_description": "This record has been archived and is no longer available for viewing.",
+ "hi__record_archived_on": " This record was archived on",
+ "hi__record_not_fetched_description": "This record hasn't been fetched yet. Please check back after some time.",
+ "hi__record_not_fetched_title": "This record hasn't been fetched yet",
+ "hi__waiting_for_record": "Waiting for the Host HIP to send the record.",
"hide": "Hide",
"home_facility": "Home Facility",
"hubs": "Hub Facilities",
+ "i_declare": "I hereby declare that:",
"icd11_as_recommended": "As per ICD-11 recommended by WHO",
+ "incomplete_patient_details_warning": "Patient details are incomplete. Please update the details before proceeding.",
"inconsistent_dosage_units_error": "Dosage units must be same",
"indian_mobile": "Indian Mobile",
"indicator": "Indicator",
@@ -591,6 +718,7 @@
"international_mobile": "International Mobile",
"invalid_asset_id_msg": "Oops! The asset ID you entered does not appear to be valid.",
"invalid_email": "Please Enter a Valid Email Address",
+ "invalid_ip_address": "Invalid IP Address",
"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_password": "Password doesn't meet the requirements",
"invalid_password_reset_link": "Invalid password reset link",
@@ -634,6 +762,10 @@
"latitude_invalid": "Latitude must be between -90 and 90",
"left": "Left",
"length": "Length ({{unit}})",
+ "link_abha_number": "Link ABHA Number",
+ "link_abha_profile": "Link ABHA Profile",
+ "link_camera_and_bed": "Link bed to Camera",
+ "link_existing_abha_profile": "Already have an ABHA number",
"linked_facilities": "Linked Facilities",
"linked_skills": "Linked Skills",
"liquid_oxygen_capacity": "Liquid Oxygen Capacity",
@@ -642,11 +774,14 @@
"litres_per_day": "Litres/day",
"live": "Live",
"live_monitoring": "Live Monitoring",
+ "live_patients_total_beds": "Live Patients / Total beds",
"load_more": "Load More",
"loading": "Loading...",
"local_body": "Local body",
- "local_ipaddress": "Local IP Address",
+ "local_ip_address": "Local IP Address",
+ "local_ip_address_example": "e.g. 192.168.0.123",
"location": "Location",
+ "location_beds_empty": "No beds available in this location",
"location_management": "Location Management",
"log_lab_results": "Log Lab Results",
"log_report": "Log Report",
@@ -654,7 +789,9 @@
"longitude_invalid": "Longitude must be between -180 and 180",
"lsg": "Lsg",
"make_multiple_beds_label": "Do you want to make multiple beds?",
+ "manage_bed_presets": "Manage Presets of Bed",
"manage_prescriptions": "Manage Prescriptions",
+ "manage_preset": "Manage preset {{ name }}",
"manufacturer": "Manufacturer",
"map_acronym": "M.A.P.",
"mark_all_as_read": "Mark all as Read",
@@ -672,15 +809,25 @@
"medicines_administered": "Medicine(s) administered",
"medicines_administered_error": "Error administering medicine(s)",
"middleware_hostname": "Middleware Hostname",
+ "middleware_hostname_example": "e.g. example.ohc.network",
+ "middleware_hostname_sourced_from": "Middleware hostname sourced from {{ source }}",
"min_password_len_8": "Minimum password length 8",
"min_time_bw_doses": "Min. time b/w doses",
"mobile": "Mobile",
"mobile_number": "Mobile Number",
+ "mobile_number_different_from_aadhaar_mobile_number": "We have noticed that you have entered a mobile number that is different from the one linked to your Aadhaar. We will send an OTP to this number to link it with your Abha number.",
+ "mobile_number_validation_error": "Enter a valid mobile number",
+ "mobile_otp_send_error": "Failed to send OTP. Please try again later.",
+ "mobile_otp_send_success": "OTP has been sent to the given mobile number.",
+ "mobile_otp_verify_error": "Failed to verify mobile number. Please try again later.",
+ "mobile_otp_verify_success": "Mobile number has been verified successfully.",
"modification_caution_note": "No modifications possible once added",
"modified": "Modified",
"modified_date": "Modified Date",
+ "modified_on": "Modified On",
"monitor": "Monitor",
"more_info": "More Info",
+ "move_to_onvif_preset": "Move to an ONVIF Preset",
"moving_camera": "Moving Camera",
"name": "Name",
"name_of_hospital": "Name of Hospital",
@@ -710,6 +857,8 @@
"no_patients_to_show": "No patients to show.",
"no_policy_added": "No Insurance Policy Added",
"no_policy_found": "No Insurance Policy Found for this Patient",
+ "no_presets": "No Presets",
+ "no_records_found": "No records found",
"no_remarks": "No remarks",
"no_results_found": "No Results Found",
"no_staff": "No staff found",
@@ -732,9 +881,11 @@
"nursing_care": "Nursing Care",
"nursing_information": "Nursing Information",
"nutrition": "Nutrition",
+ "occupancy": "Occupancy",
"occupation": "Occupation",
"on": "On",
"ongoing_medications": "Ongoing Medications",
+ "only_indian_mobile_numbers_supported": "Currently only Indian numbers are supported",
"open": "Open",
"open_camera": "Open Camera",
"open_live_monitoring": "Open Live Monitoring",
@@ -743,6 +894,8 @@
"ordering": "Ordering",
"origin_facility": "Current facility",
"other_details": "Other details",
+ "otp_verification_error": "Failed to verify OTP. Please try again later.",
+ "otp_verification_success": "OTP has been verified successfully.",
"out_of_range_error": "Value must be between {{ start }} and {{ end }}.",
"oxygen_information": "Oxygen Information",
"page_not_found": "Page Not Found",
@@ -755,6 +908,7 @@
"password_reset_success": "Password Reset successfully",
"password_sent": "Password Reset Email Sent",
"patient_address": "Patient Address",
+ "patient_body": "Patient Body",
"patient_category": "Patient Category",
"patient_consultation__admission": "Date of admission",
"patient_consultation__consultation_notes": "General Instructions",
@@ -769,6 +923,8 @@
"patient_consultation__treatment__summary__temperature": "Temperature",
"patient_created": "Patient Created",
"patient_details": "Patient Details",
+ "patient_details_incomplete": "Patient Details Incomplete",
+ "patient_face": "Patient Face",
"patient_name": "Patient name",
"patient_no": "OP/IP No",
"patient_notes_thread__Doctors": "Doctor's Discussions",
@@ -811,6 +967,7 @@
"policy__policy_id__example": "POL001",
"policy__subscriber_id": "Member ID",
"policy__subscriber_id__example": "SUB001",
+ "position": "Position",
"post_your_comment": "Post Your Comment",
"powered_by": "Powered By",
"preferred_facility_type": "Preferred Facility Type",
@@ -825,6 +982,9 @@
"prescriptions__medicine": "Medicine",
"prescriptions__route": "Route",
"prescriptions__start_date": "Prescribed On",
+ "preset_deleted": "Preset deleted",
+ "preset_name_placeholder": "Specify an identifiable name for the new preset",
+ "preset_updated": "Preset updated",
"prev_sessions": "Prev Sessions",
"principal": "Principal",
"principal_diagnosis": "Principal diagnosis",
@@ -837,6 +997,7 @@
"profile": "Profile",
"provisional": "Provisional",
"qualification": "Qualification",
+ "raise_consent_request": "Raise a consent request to fetch patient records over ABDM",
"ration_card__APL": "APL",
"ration_card__BPL": "BPL",
"ration_card__NO_CARD": "Non-card holder",
@@ -855,6 +1016,7 @@
"redirected_to_create_consultation": "Note: You will be redirected to create consultation form. Please complete the form to finish the transfer process",
"referral_letter": "Referral Letter",
"referred_to": "Referred to",
+ "refresh": "Refresh",
"refresh_list": "Refresh List",
"refuted": "Refuted",
"register_hospital": "Register Hospital",
@@ -867,12 +1029,14 @@
"req_atleast_one_lowercase": "Require at least one lower case letter",
"req_atleast_one_symbol": "Require at least one symbol",
"req_atleast_one_uppercase": "Require at least one upper case",
+ "request_consent": "Request Consent",
"request_description": "Description of Request",
"request_description_placeholder": "Type your description here",
"request_title": "Request Title",
"request_title_placeholder": "Type your title here",
"required": "Required",
"required_quantity": "Required Quantity",
+ "resend_otp": "Resend OTP",
"reset": "Reset",
"reset_password": "Reset Password",
"resource": "Resource",
@@ -888,6 +1052,7 @@
"return_to_login": "Return to Login",
"return_to_password_reset": "Return to Password Reset",
"return_to_patient_dashboard": "Return to Patient Dashboard",
+ "revoked_on": "Revoked On",
"right": "Right",
"route": "Route",
"routine": "Routine",
@@ -907,6 +1072,7 @@
"search_resource": "Search Resource",
"see_attachments": "See Attachments",
"select": "Select",
+ "select_all": "Select All",
"select_date": "Select date",
"select_eligible_policy": "Select an Eligible Insurance Policy",
"select_facility_for_discharged_patients_warning": "Facility needs to be selected to view discharged patients.",
@@ -922,6 +1088,9 @@
"select_wards": "Select wards",
"send_email": "Send Email",
"send_message": "Send Message",
+ "send_otp": "Send OTP",
+ "send_otp_error": "Failed to send OTP. Please try again later.",
+ "send_otp_success": "OTP has been sent to the respective mobile number",
"send_reset_link": "Send Reset Link",
"serial_number": "Serial Number",
"serviced_on": "Serviced on",
@@ -939,6 +1108,7 @@
"shifting_deleted": "Shifting record has been deleted successfully.",
"shifting_details": "Shifting details",
"shifting_status": "Shifting status",
+ "show_abha_profile": "Show ABHA Profile",
"show_all": "Show all",
"show_all_notifications": "Show All",
"show_default_presets": "Show Default Presets",
@@ -961,6 +1131,7 @@
"stop": "Stop",
"stream_stop_due_to_inativity": "The live feed will stop streaming due to inactivity",
"stream_stopped_due_to_inativity": "The live feed has stopped streaming due to inactivity",
+ "stream_uuid": "Stream UUID",
"sub_category": "Sub Category",
"submit": "Submit",
"submitting": "Submitting",
@@ -989,6 +1160,7 @@
"treatment_summary__heading": "INTERIM TREATMENT SUMMARY",
"treatment_summary__print": "Print Treatment Summary",
"try_again_later": "Try again later!",
+ "try_different_abha_linking_option": "Want to try a different linking option, here are some more:",
"type_any_extra_comments_here": "type any extra comments here",
"type_b_cylinders": "B Type Cylinders",
"type_c_cylinders": "C Type Cylinders",
@@ -996,9 +1168,13 @@
"type_to_search": "Type to search",
"type_your_comment": "Type your comment",
"type_your_reason_here": "Type your reason here",
+ "unable_to_get_current_position": "Unable to get current position.",
"unconfirmed": "Unconfirmed",
"unique_id": "Unique Id",
"unknown": "Unknown",
+ "unlink_asset_bed_and_presets": "Delete linked presets and unlink bed",
+ "unlink_asset_bed_caution": "This action will also delete all presets that are associated to this camera and bed.",
+ "unlink_camera_and_bed": "Unlink this bed from this camera",
"unsubscribe": "Unsubscribe",
"unsubscribe_failed": "Unsubscribe failed.",
"unsupported_browser": "Unsupported Browser",
@@ -1013,11 +1189,14 @@
"update_facility": "Update Facility",
"update_facility_middleware_success": "Facility middleware updated successfully",
"update_log": "Update Log",
+ "update_patient_details": "Update Patient Details",
+ "update_preset_position_to_current": "Update preset's position to camera's current position",
"update_record": "Update Record",
"update_record_for_asset": "Update record for asset",
"update_shift_request": "Update Shift Request",
"update_status_details": "Update Status/Details",
"updated": "Updated",
+ "updated_on": "Updated On",
"updating": "Updating",
"upload": "Upload",
"upload_an_image": "Upload an image",
@@ -1026,22 +1205,31 @@
"upload_headings__sample_report": "Upload Sample Report",
"upload_headings__supporting_info": "Upload Supporting Info",
"uploading": "Uploading",
+ "use_existing_abha_address": "Use Existing ABHA Address",
"user_deleted_successfuly": "User Deleted Successfuly",
"user_management": "User Management",
"username": "Username",
"users": "Users",
"vehicle_preference": "Vehicle preference",
"vendor_name": "Vendor Name",
+ "verify_and_link": "Verify and Link",
+ "verify_otp": "Verify OTP",
+ "verify_otp_error": "Failed to verify OTP. Please try again later.",
+ "verify_otp_success": "OTP has been verified successfully.",
+ "verify_patient_identifier": "Please verify the patient identifier",
+ "verify_using": "Verify Using",
"video_conference_link": "Video Conference Link",
"view": "View",
"view_abdm_records": "View ABDM Records",
"view_asset": "View Assets",
+ "view_cns": "View CNS",
"view_details": "View Details",
"view_faciliy": "View Facility",
"view_patients": "View Patients",
"view_users": "View Users",
"virtual_nursing_assistant": "Virtual Nursing Assistant",
"vitals": "Vitals",
+ "vitals_monitor": "Vitals Monitor",
"ward": "Ward",
"warranty_amc_expiry": "Warranty / AMC Expiry",
"what_facility_assign_the_patient_to": "What facility would you like to assign the patient to",
diff --git a/src/Locale/hi.json b/src/Locale/hi.json
index 93d9ef32f34..e235c558978 100644
--- a/src/Locale/hi.json
+++ b/src/Locale/hi.json
@@ -458,7 +458,7 @@
"load_more": "और लोड करें",
"loading": "लोड हो रहा है...",
"local_body": "स्थानीय निकाय",
- "local_ipaddress": "स्थानीय आईपी पता",
+ "local_ip_address": "स्थानीय आईपी पता",
"location": "जगह",
"location_management": "स्थान प्रबंधन",
"log_lab_results": "लॉग लैब परिणाम",
@@ -810,4 +810,4 @@
"you_need_at_least_a_location_to_create_an_assest": "संपत्ति बनाने के लिए आपको कम से कम एक स्थान की आवश्यकता होगी।",
"zoom_in": "ज़ूम इन",
"zoom_out": "ज़ूम आउट"
-}
+}
\ No newline at end of file
diff --git a/src/Locale/kn.json b/src/Locale/kn.json
index acaebe8e421..dc46e49394f 100644
--- a/src/Locale/kn.json
+++ b/src/Locale/kn.json
@@ -459,7 +459,7 @@
"load_more": "ಇನ್ನಷ್ಟು ಲೋಡ್ ಮಾಡಿ",
"loading": "ಲೋಡ್ ಆಗುತ್ತಿದೆ...",
"local_body": "ಸ್ಥಳೀಯ ಸಂಸ್ಥೆ",
- "local_ipaddress": "ಸ್ಥಳೀಯ IP ವಿಳಾಸ",
+ "local_ip_address": "ಸ್ಥಳೀಯ IP ವಿಳಾಸ",
"location": "ಸ್ಥಳ",
"location_management": "ಸ್ಥಳ ನಿರ್ವಹಣೆ",
"log_lab_results": "ಲಾಗ್ ಲ್ಯಾಬ್ ಫಲಿತಾಂಶಗಳು",
@@ -810,4 +810,4 @@
"you_need_at_least_a_location_to_create_an_assest": "ಆಸ್ತಿಯನ್ನು ರಚಿಸಲು ನಿಮಗೆ ಕನಿಷ್ಠ ಸ್ಥಳದ ಅಗತ್ಯವಿದೆ.",
"zoom_in": "ಜೂಮ್ ಇನ್",
"zoom_out": "ಜೂಮ್ ಔಟ್"
-}
+}
\ No newline at end of file
diff --git a/src/Locale/ml.json b/src/Locale/ml.json
index 8460b6f8b7c..d830d3a46ec 100644
--- a/src/Locale/ml.json
+++ b/src/Locale/ml.json
@@ -458,7 +458,7 @@
"load_more": "കൂടുതൽ ലോഡ് ചെയ്യുക",
"loading": "ലോഡ് ചെയ്യുന്നു...",
"local_body": "തദ്ദേശ സ്ഥാപനം",
- "local_ipaddress": "പ്രാദേശിക ഐപി വിലാസം",
+ "local_ip_address": "പ്രാദേശിക ഐപി വിലാസം",
"location": "സ്ഥാനം",
"location_management": "ലൊക്കേഷൻ മാനേജ്മെൻ്റ്",
"log_lab_results": "ലോഗ് ലാബ് ഫലങ്ങൾ",
@@ -810,4 +810,4 @@
"you_need_at_least_a_location_to_create_an_assest": "ഒരു അസസ്റ്റ് സൃഷ്ടിക്കാൻ നിങ്ങൾക്ക് ഒരു ലൊക്കേഷനെങ്കിലും ആവശ്യമാണ്.",
"zoom_in": "സൂം ഇൻ ചെയ്യുക",
"zoom_out": "സൂം ഔട്ട്"
-}
+}
\ No newline at end of file
diff --git a/src/Locale/ta.json b/src/Locale/ta.json
index 1fbf82c29aa..042f5a068c4 100644
--- a/src/Locale/ta.json
+++ b/src/Locale/ta.json
@@ -458,7 +458,7 @@
"load_more": "மேலும் ஏற்றவும்",
"loading": "ஏற்றுகிறது...",
"local_body": "உள்ளூர் அமைப்பு",
- "local_ipaddress": "உள்ளூர் ஐபி முகவரி",
+ "local_ip_address": "உள்ளூர் ஐபி முகவரி",
"location": "இடம்",
"location_management": "இருப்பிட மேலாண்மை",
"log_lab_results": "பதிவு ஆய்வக முடிவுகள்",
@@ -810,4 +810,4 @@
"you_need_at_least_a_location_to_create_an_assest": "ஒரு அசெஸ்ட்டை உருவாக்க குறைந்தபட்சம் ஒரு இருப்பிடமாவது தேவை.",
"zoom_in": "பெரிதாக்கவும்",
"zoom_out": "பெரிதாக்கவும்"
-}
+}
\ No newline at end of file
diff --git a/src/Redux/actions.tsx b/src/Redux/actions.tsx
index 47d3530d065..29fe2fed2ef 100644
--- a/src/Redux/actions.tsx
+++ b/src/Redux/actions.tsx
@@ -1,29 +1,5 @@
import { fireRequest } from "./fireRequest";
-// asset bed
-export const listAssetBeds = (params: object, altKey?: string) =>
- fireRequest("listAssetBeds", [], params, {}, altKey);
-
-export const partialUpdateAssetBed = (params: object, asset_id: string) =>
- fireRequest(
- "partialUpdateAssetBed",
- [],
- { ...params },
- {
- external_id: asset_id,
- },
- );
-
-export const deleteAssetBed = (asset_id: string) =>
- fireRequest(
- "deleteAssetBed",
- [],
- {},
- {
- external_id: asset_id,
- },
- );
-
export const getPatient = (pathParam: object) => {
return fireRequest("getPatient", [], {}, pathParam);
};
@@ -41,6 +17,3 @@ export const getConsultation = (id: string) => {
export const dischargePatient = (params: object, pathParams: object) => {
return fireRequest("dischargePatient", [], params, pathParams);
};
-
-export const operateAsset = (id: string, params: object) =>
- fireRequest("operateAsset", [], params, { external_id: id });
diff --git a/src/Redux/api.tsx b/src/Redux/api.tsx
index ea728d7f53c..d562908a140 100644
--- a/src/Redux/api.tsx
+++ b/src/Redux/api.tsx
@@ -50,25 +50,6 @@ import {
SampleReportModel,
SampleTestModel,
} from "../Components/Patient/models";
-import {
- IAadhaarOtp,
- IAadhaarOtpTBody,
- ICheckAndGenerateMobileOtp,
- IConfirmMobileOtp,
- ICreateHealthIdRequest,
- ICreateHealthIdResponse,
- IGenerateMobileOtpTBody,
- IHealthFacility,
- IHealthId,
- ILinkABHANumber,
- ILinkViaQRBody,
- ISearchByHealthIdTBody,
- IVerifyAadhaarOtpTBody,
- IcreateHealthFacilityTBody,
- IgetAbhaCardTBody,
- IinitiateAbdmAuthenticationTBody,
- IpartialUpdateHealthFacilityTBody,
-} from "../Components/ABDM/models";
import { IComment, IResource } from "../Components/Resource/models";
import {
IDeleteBedCapacity,
@@ -117,8 +98,13 @@ import {
import { InvestigationSessionType } from "../Components/Facility/Investigations/investigationsTab";
import { AbhaNumberModel } from "../Components/ABDM/types/abha";
import { ScribeModel } from "../Components/Scribe/Scribe";
-import { InsurerOptionModel } from "../Components/HCX/InsurerAutocomplete";
-import { PMJAYPackageItem } from "../Components/Common/PMJAYProcedurePackageAutocomplete";
+import {
+ IcreateHealthFacilityTBody,
+ IHealthFacility,
+ IpartialUpdateHealthFacilityTBody,
+} from "../Components/ABDM/types/health-facility";
+import { PMJAYPackageItem } from "@/Components/Common/PMJAYProcedurePackageAutocomplete";
+import { InsurerOptionModel } from "@/Components/HCX/InsurerAutocomplete";
/**
* A fake function that returns an empty object casted to type T
@@ -1361,196 +1347,243 @@ const routes = {
TBody: Type(),
},
- abha: {
- getAbhaNumber: {
- path: "/api/v1/abdm/abha_numbers/{abhaNumberId}/",
- method: "GET",
- TRes: Type(),
- },
-
- // ABDM HealthID endpoints
- generateAadhaarOtp: {
- path: "/api/v1/abdm/healthid/generate_aadhaar_otp/",
- method: "POST",
- TRes: Type(),
- TBody: Type(),
- },
-
- resendAadhaarOtp: {
- path: "/api/v1/abdm/healthid/resend_aadhaar_otp/",
- method: "POST",
- TRes: Type(),
- TBody: Type(),
- },
-
- verifyAadhaarOtp: {
- path: "/api/v1/abdm/healthid/verify_aadhaar_otp/",
- method: "POST",
- TRes: Type(),
- TBody: Type(),
- },
-
- generateMobileOtp: {
- path: "/api/v1/abdm/healthid/generate_mobile_otp/",
- method: "POST",
- TRes: Type(),
- TBody: Type(),
- },
-
- checkAndGenerateMobileOtp: {
- path: "/api/v1/abdm/healthid/check_and_generate_mobile_otp/",
- method: "POST",
- TRes: Type(),
- TBody: Type(),
- },
+ abdm: {
+ consent: {
+ list: {
+ path: "/api/abdm/consent/",
+ method: "GET",
+ TRes: Type>(),
+ },
- // TODO: resend mobile otp
- verifyMobileOtp: {
- path: "/api/v1/abdm/healthid/verify_mobile_otp/",
- method: "POST",
- TRes: Type(),
- TBody: Type(),
- },
+ create: {
+ path: "/api/abdm/consent/",
+ method: "POST",
+ TRes: Type(),
+ TBody: Type(),
+ },
- createHealthId: {
- path: "/api/v1/abdm/healthid/create_health_id/",
- method: "POST",
- TRes: Type(),
- TBody: Type(),
- },
+ get: {
+ path: "/api/abdm/consent/{id}/",
+ method: "GET",
+ },
- linkPatient: {
- path: "/api/v1/abdm/healthid/link_patient/",
- method: "POST",
- TBody: Type<{ abha_number: string; patient: string }>(),
- TRes: Type(),
+ checkStatus: {
+ path: "/api/abdm/v3/hiu/consent_request_status/",
+ method: "POST",
+ TBody: Type<{
+ consent_request: string;
+ }>(),
+ TRes: Type<{
+ detail: string;
+ }>(),
+ },
},
- searchByHealthId: {
- path: "/api/v1/abdm/healthid/search_by_health_id/",
- method: "POST",
- TRes: Type(),
- TBody: Type(),
+ healthInformation: {
+ get: {
+ path: "/api/abdm/health_information/{artefactId}",
+ method: "GET",
+ TRes: Type(),
+ },
},
- initiateAbdmAuthentication: {
- path: "/api/v1/abdm/healthid/auth_init/",
- method: "POST",
- TRes: Type(),
- TBody: Type(),
- },
+ healthFacility: {
+ list: {
+ path: "/api/abdm/health_facility/",
+ method: "GET",
+ },
- confirmWithAadhaarOtp: {
- path: "/api/v1/abdm/healthid/confirm_with_aadhaar_otp/",
- method: "POST",
- TRes: Type(),
- TBody: Type(),
- },
+ create: {
+ path: "/api/abdm/health_facility/",
+ method: "POST",
+ TRes: Type(),
+ TBody: Type(),
+ },
- confirmWithMobileOtp: {
- path: "/api/v1/abdm/healthid/confirm_with_mobile_otp/",
- method: "POST",
- TRes: Type(),
- TBody: Type(),
- },
+ get: {
+ path: "/api/abdm/health_facility/{facility_id}/",
+ method: "GET",
+ TRes: Type(),
+ },
- linkViaQR: {
- path: "/api/v1/abdm/healthid/link_via_qr/",
- method: "POST",
- TRes: Type(),
- TBody: Type(),
- },
+ update: {
+ path: "/api/abdm/health_facility/{facility_id}/",
+ method: "PUT",
+ TRes: Type(),
+ TBody: Type(),
+ },
- linkCareContext: {
- path: "/api/v1/abdm/healthid/add_care_context/",
- method: "POST",
- TRes: Type(),
- TBody: Type(),
- },
+ partialUpdate: {
+ path: "/api/abdm/health_facility/{facility_id}/",
+ method: "PATCH",
+ TRes: Type(),
+ TBody: Type(),
+ },
- getAbhaCard: {
- path: "/api/v1/abdm/healthid/get_abha_card/",
- method: "POST",
- TRes: Type(),
- TBody: Type(),
+ registerAsService: {
+ path: "/api/abdm/health_facility/{facility_id}/register_service/",
+ method: "POST",
+ TRes: Type(),
+ TBody: Type(),
+ },
},
- // ABDM Health Facility
-
- listHealthFacility: {
- path: "/api/v1/abdm/health_facility/",
- method: "GET",
+ abhaNumber: {
+ get: {
+ path: "/api/abdm/abha_number/{abhaNumberId}/",
+ method: "GET",
+ TRes: Type(),
+ },
+ create: {
+ path: "/api/abdm/abha_number/",
+ method: "POST",
+ TBody: Type>(),
+ TRes: Type(),
+ },
},
- createHealthFacility: {
- path: "/api/v1/abdm/health_facility/",
- method: "POST",
- TRes: Type(),
- TBody: Type(),
- },
+ healthId: {
+ abhaCreateSendAadhaarOtp: {
+ path: "/api/abdm/v3/health_id/create/send_aadhaar_otp/",
+ method: "POST",
+ TBody: Type<{
+ aadhaar: string;
+ transaction_id?: string;
+ }>(),
+ TRes: Type<{
+ transaction_id: string;
+ detail: string;
+ }>(),
+ },
- getHealthFacility: {
- path: "/api/v1/abdm/health_facility/{facility_id}/",
- method: "GET",
- TRes: Type(),
- },
+ abhaCreateVerifyAadhaarOtp: {
+ path: "/api/abdm/v3/health_id/create/verify_aadhaar_otp/",
+ method: "POST",
+ TBody: Type<{
+ transaction_id: string;
+ otp: string;
+ mobile: string;
+ }>(),
+ TRes: Type<{
+ transaction_id: string;
+ detail: string;
+ is_new: boolean;
+ abha_number: AbhaNumberModel;
+ }>(),
+ },
- updateHealthFacility: {
- path: "/api/v1/abdm/health_facility/{facility_id}/",
- method: "PUT",
- TRes: Type(),
- TBody: Type(),
- },
+ abhaCreateLinkMobileNumber: {
+ path: "/api/abdm/v3/health_id/create/link_mobile_number/",
+ method: "POST",
+ TBody: Type<{
+ transaction_id: string;
+ mobile: string;
+ }>(),
+ TRes: Type<{
+ transaction_id: string;
+ detail: string;
+ }>(),
+ },
- partialUpdateHealthFacility: {
- path: "/api/v1/abdm/health_facility/{facility_id}/",
- method: "PATCH",
- TRes: Type(),
- TBody: Type(),
- },
+ abhaCreateVerifyMobileNumber: {
+ path: "/api/abdm/v3/health_id/create/verify_mobile_otp/",
+ method: "POST",
+ TBody: Type<{
+ transaction_id: string;
+ otp: string;
+ }>(),
+ TRes: Type<{
+ transaction_id: string;
+ detail: string;
+ }>(),
+ },
- registerHealthFacilityAsService: {
- path: "/api/v1/abdm/health_facility/{facility_id}/register_service/",
- method: "POST",
- TRes: Type(),
- TBody: Type(),
- },
+ abhaCreateAbhaAddressSuggestion: {
+ path: "/api/abdm/v3/health_id/create/abha_address_suggestion/",
+ method: "POST",
+ TBody: Type<{
+ transaction_id: string;
+ }>(),
+ TRes: Type<{
+ transaction_id: string;
+ abha_addresses: string[];
+ }>(),
+ },
- listConsents: {
- path: "/api/v1/abdm/consent/",
- method: "GET",
- TRes: Type>(),
- },
+ abhaCreateEnrolAbhaAddress: {
+ path: "/api/abdm/v3/health_id/create/enrol_abha_address/",
+ method: "POST",
+ TBody: Type<{
+ transaction_id: string;
+ abha_address: string;
+ }>(),
+ TRes: Type<{
+ detail?: string;
+ transaction_id: string;
+ health_id: string;
+ preferred_abha_address: string;
+ abha_number: AbhaNumberModel;
+ }>(),
+ },
- createConsent: {
- path: "/api/v1/abdm/consent/",
- method: "POST",
- TRes: Type(),
- TBody: Type(),
- },
+ linkAbhaNumberAndPatient: {
+ path: "/api/abdm/v3/health_id/link_patient/",
+ method: "POST",
+ TBody: Type<{
+ abha_number: string;
+ patient: string;
+ }>(),
+ TRes: Type<{
+ detail: string;
+ }>(),
+ },
- getConsent: {
- path: "/api/v1/abdm/consent/{id}/",
- method: "GET",
- },
+ abhaLoginCheckAuthMethods: {
+ path: "/api/abdm/v3/health_id/login/check_auth_methods/",
+ method: "POST",
+ TBody: Type<{
+ abha_address: string;
+ }>(),
+ TRes: Type<{
+ abha_number: string;
+ auth_methods: string[];
+ }>(),
+ },
- checkConsentStatus: {
- path: "/api/v1/abdm/consent/{id}/status/",
- method: "GET",
- TRes: Type(),
- },
+ abhaLoginSendOtp: {
+ path: "/api/abdm/v3/health_id/login/send_otp/",
+ method: "POST",
+ TBody: Type<{
+ type: "abha-number" | "abha-address" | "mobile" | "aadhaar";
+ value: string;
+ otp_system: "abdm" | "aadhaar";
+ }>(),
+ TRes: Type<{
+ transaction_id: string;
+ detail: string;
+ }>(),
+ },
- getHealthInformation: {
- path: "/api/v1/abdm/health_information/{artefactId}",
- method: "GET",
- TRes: Type(),
- },
+ abhaLoginVerifyOtp: {
+ path: "/api/abdm/v3/health_id/login/verify_otp/",
+ method: "POST",
+ TBody: Type<{
+ type: "abha-number" | "abha-address" | "mobile" | "aadhaar";
+ otp: string;
+ transaction_id: string;
+ otp_system: "abdm" | "aadhaar";
+ }>(),
+ TRes: Type<{
+ abha_number: AbhaNumberModel;
+ created: boolean;
+ }>(),
+ },
- findPatient: {
- path: "/api/v1/abdm/patients/find/",
- method: "POST",
- TRes: Type(),
- TBody: Type<{ id: string }>(),
+ getAbhaCard: {
+ path: "/api/abdm/v3/health_id/abha_card",
+ method: "GET",
+ TRes: Type(),
+ },
},
},
diff --git a/src/Utils/request/request.ts b/src/Utils/request/request.ts
index 151cc30c460..3fa648316af 100644
--- a/src/Utils/request/request.ts
+++ b/src/Utils/request/request.ts
@@ -85,6 +85,11 @@ async function getResponseBody(res: Response): Promise {
}
const isJson = res.headers.get("content-type")?.includes("application/json");
+ const isImage = res.headers.get("content-type")?.includes("image");
+
+ if (isImage) {
+ return (await res.blob()) as TData;
+ }
if (!isJson) {
return (await res.text()) as TData;
diff --git a/src/Utils/transformUtils.ts b/src/Utils/transformUtils.ts
index 0050a0bcbb6..4aa63da734c 100644
--- a/src/Utils/transformUtils.ts
+++ b/src/Utils/transformUtils.ts
@@ -1,16 +1,23 @@
import { AssetData } from "../Components/Assets/AssetTypes";
-export const getCameraConfig = (asset: AssetData) => {
- const { meta } = asset;
+export const getCameraConfig = (meta: AssetData["meta"]) => {
return {
middleware_hostname: meta?.middleware_hostname,
- id: asset?.id,
hostname: meta?.local_ip_address,
username: meta?.camera_access_key?.split(":")[0],
password: meta?.camera_access_key?.split(":")[1],
accessKey: meta?.camera_access_key?.split(":")[2],
port: 80,
- location_id: asset?.location_object?.id,
- facility_id: asset?.location_object?.facility?.id,
};
};
+
+export const makeAccessKey = (
+ attrs: Pick<
+ ReturnType,
+ "username" | "password" | "accessKey"
+ >,
+) => {
+ return [attrs.username, attrs.password, attrs.accessKey]
+ .map((a) => a ?? "")
+ .join(":");
+};