@@ -81,7 +97,7 @@ export default function ClaimDetailCard({ claim }: IProps) {
scope="col"
className="py-3.5 pl-6 pr-3 text-left text-sm font-semibold text-secondary-900 sm:pl-0"
>
- Items
+ {t("claim__items")}
|
|
@@ -89,7 +105,7 @@ export default function ClaimDetailCard({ claim }: IProps) {
scope="col"
className="py-3.5 pl-3 pr-6 text-right text-sm font-semibold text-secondary-900 sm:pr-0"
>
- Price
+ {t("claim__item__price")}
@@ -115,15 +131,9 @@ export default function ClaimDetailCard({ claim }: IProps) {
- Total Claim Amount
- |
-
- Total Claim Amount
+ {t("claim__total_claim_amount")}
|
{claim.total_claim_amount &&
@@ -135,15 +145,9 @@ export default function ClaimDetailCard({ claim }: IProps) {
|
- Total Amount Approved
- |
-
- Total Amount Approved
+ {t("claim__total_approved_amount")}
|
{claim.total_amount_approved
@@ -159,6 +163,6 @@ export default function ClaimDetailCard({ claim }: IProps) {
{claim.error_text}
)}
-
+ >
);
}
diff --git a/src/Components/HCX/ClaimCreatedModal.tsx b/src/Components/HCX/ClaimCreatedModal.tsx
index 6565c0c11be..41d58aa7df4 100644
--- a/src/Components/HCX/ClaimCreatedModal.tsx
+++ b/src/Components/HCX/ClaimCreatedModal.tsx
@@ -1,12 +1,14 @@
-import { useState } from "react";
-import { useDispatch } from "react-redux";
-import CareIcon from "../../CAREUI/icons/CareIcon";
-import { HCXActions } from "../../Redux/actions";
import * as Notification from "../../Utils/Notifications";
-import { Submit } from "../Common/components/ButtonV2";
+
+import CareIcon from "../../CAREUI/icons/CareIcon";
import DialogModal from "../Common/Dialog";
import { FileUpload } from "../Files/FileUpload";
import { HCXClaimModel } from "./models";
+import { Submit } from "../Common/components/ButtonV2";
+import request from "../../Utils/request/request";
+import routes from "../../Redux/api";
+import { useState } from "react";
+import { useTranslation } from "react-i18next";
interface Props {
claim: HCXClaimModel;
@@ -15,7 +17,8 @@ interface Props {
}
export default function ClaimCreatedModal({ claim, ...props }: Props) {
- const dispatch = useDispatch();
+ const { t } = useTranslation();
+
const [isMakingClaim, setIsMakingClaim] = useState(false);
const { use } = claim;
@@ -23,8 +26,11 @@ export default function ClaimCreatedModal({ claim, ...props }: Props) {
const handleSubmit = async () => {
setIsMakingClaim(true);
- const res = await dispatch(HCXActions.makeClaim(claim.id ?? ""));
- if (res.data) {
+ const { res } = await request(routes.hcx.claims.makeClaim, {
+ body: { claim: claim.id },
+ });
+
+ if (res?.ok) {
Notification.Success({ msg: `${use} requested` });
props.onClose();
}
@@ -35,8 +41,8 @@ export default function ClaimCreatedModal({ claim, ...props }: Props) {
@@ -44,8 +50,8 @@ export default function ClaimCreatedModal({ claim, ...props }: Props) {
)}
{isMakingClaim
- ? `Requesting ${use === "Claim" ? "Claim" : "Pre-Authorization"}...`
- : `Request ${use === "Claim" ? "Claim" : "Pre-Authorization"}`}
+ ? t("claim__requesting_claim")
+ : t("claim__request_claim")}
}
>
diff --git a/src/Components/HCX/ClaimsItemsBuilder.tsx b/src/Components/HCX/ClaimsItemsBuilder.tsx
index 73ca2305030..d636eb1a528 100644
--- a/src/Components/HCX/ClaimsItemsBuilder.tsx
+++ b/src/Components/HCX/ClaimsItemsBuilder.tsx
@@ -1,20 +1,24 @@
-import CareIcon from "../../CAREUI/icons/CareIcon";
-import ButtonV2 from "../Common/components/ButtonV2";
-import PMJAYProcedurePackageAutocomplete from "../Common/PMJAYProcedurePackageAutocomplete";
-import AutocompleteFormField from "../Form/FormFields/Autocomplete";
-import FormField, { FieldLabel } from "../Form/FormFields/FormField";
-import TextFormField from "../Form/FormFields/TextFormField";
import {
FieldChangeEvent,
FormFieldBaseProps,
useFormFieldPropsResolver,
} from "../Form/FormFields/Utils";
-import { ITEM_CATEGORIES } from "./constants";
+import FormField, { FieldLabel } from "../Form/FormFields/FormField";
+
+import AutocompleteFormField from "../Form/FormFields/Autocomplete";
+import ButtonV2 from "../Common/components/ButtonV2";
+import CareIcon from "../../CAREUI/icons/CareIcon";
import { HCXItemModel } from "./models";
+import { ITEM_CATEGORIES } from "./constants";
+import PMJAYProcedurePackageAutocomplete from "../Common/PMJAYProcedurePackageAutocomplete";
+import TextFormField from "../Form/FormFields/TextFormField";
+import { useTranslation } from "react-i18next";
type Props = FormFieldBaseProps;
export default function ClaimsItemsBuilder(props: Props) {
+ const { t } = useTranslation();
+
const field = useFormFieldPropsResolver(props);
const handleUpdate = (index: number) => {
@@ -59,7 +63,7 @@ export default function ClaimsItemsBuilder(props: Props) {
>
- Item {index + 1}
+ {t("claim__item")} {index + 1}
{!props.disabled && (
- Delete
+ {t("remove")}
)}
-
+
o.display}
optionValue={(o) => o.code}
@@ -89,71 +93,66 @@ export default function ClaimsItemsBuilder(props: Props) {
disabled={props.disabled}
errorClassName="hidden"
/>
- {obj.category === "HBP" && !obj.id ? (
- <>
-
- >
- ) : (
- <>
- o.code}
- // optionDescription={(o) => o.name || ""}
- // optionValue={(o) => o.code}
- onChange={handleUpdate(index)}
- value={obj.id}
- disabled={props.disabled}
- errorClassName="hidden"
- />
- o.name || o.code}
- // optionDescription={(o) => o.code}
- // optionValue={(o) => o.name || o.code}
- disabled={props.disabled}
- errorClassName="hidden"
- // options={PROCEDURES}
- />
-
- handleUpdate(index)({
- name: event.name,
- value: parseFloat(event.value),
- })
- }
- disabled={props.disabled}
- errorClassName="hidden"
- />
- >
- )}
+
+
+ {obj.category === "HBP" && !obj.id ? (
+ <>
+
+ >
+ ) : (
+ <>
+
+
+
+ handleUpdate(index)({
+ name: event.name,
+ value: parseFloat(event.value),
+ })
+ }
+ disabled={props.disabled}
+ errorClassName="hidden"
+ />
+ >
+ )}
+
);
diff --git a/src/Components/HCX/CreateClaimCard.tsx b/src/Components/HCX/CreateClaimCard.tsx
index 46a02cf7f86..b4701aadf7a 100644
--- a/src/Components/HCX/CreateClaimCard.tsx
+++ b/src/Components/HCX/CreateClaimCard.tsx
@@ -1,18 +1,22 @@
-import { useEffect, useState } from "react";
-import { useDispatch } from "react-redux";
-import CareIcon from "../../CAREUI/icons/CareIcon";
-import { getConsultation, HCXActions } from "../../Redux/actions";
import * as Notification from "../../Utils/Notifications";
-import { classNames, formatCurrency } from "../../Utils/utils";
+
import ButtonV2, { Submit } from "../Common/components/ButtonV2";
+import { HCXClaimModel, HCXItemModel, HCXPolicyModel } from "./models";
+import { classNames, formatCurrency } from "../../Utils/utils";
+
+import CareIcon from "../../CAREUI/icons/CareIcon";
+import ClaimCreatedModal from "./ClaimCreatedModal";
import ClaimsItemsBuilder from "./ClaimsItemsBuilder";
-import { HCXClaimModel, HCXPolicyModel, HCXItemModel } from "./models";
-import HCXPolicyEligibilityCheck from "./PolicyEligibilityCheck";
import DialogModal from "../Common/Dialog";
+import HCXPolicyEligibilityCheck from "./PolicyEligibilityCheck";
import PatientInsuranceDetailsEditor from "./PatientInsuranceDetailsEditor";
-import ClaimCreatedModal from "./ClaimCreatedModal";
import { ProcedureType } from "../Common/prescription-builder/ProcedureBuilder";
import { SelectFormField } from "../Form/FormFields/SelectFormField";
+import request from "../../Utils/request/request";
+import routes from "../../Redux/api";
+import useQuery from "../../Utils/request/useQuery";
+import { useState } from "react";
+import { useTranslation } from "react-i18next";
interface Props {
consultationId: string;
@@ -29,7 +33,8 @@ export default function CreateClaimCard({
isCreating,
use = "preauthorization",
}: Props) {
- const dispatch = useDispatch();
+ const { t } = useTranslation();
+
const [showAddPolicy, setShowAddPolicy] = useState(false);
const [policy, setPolicy] = useState();
const [items, setItems] = useState();
@@ -37,60 +42,66 @@ export default function CreateClaimCard({
const [createdClaim, setCreatedClaim] = useState();
const [use_, setUse_] = useState(use);
- useEffect(() => {
- async function autoFill() {
- const latestApprovedPreAuthsRes = await dispatch(
- HCXActions.preauths.list(consultationId),
- );
+ const { res: consultationRes, data: consultationData } = useQuery(
+ routes.getConsultation,
+ { pathParams: { id: consultationId }, prefetch: !!consultationId },
+ );
- if (latestApprovedPreAuthsRes.data?.results?.length) {
- // TODO: offload outcome filter to server side once payer server is back
- const latestApprovedPreAuth = (
- latestApprovedPreAuthsRes.data.results as HCXClaimModel[]
- ).find((o) => o.outcome === "Processing Complete");
- if (latestApprovedPreAuth) {
- setPolicy(latestApprovedPreAuth.policy_object);
- setItems(latestApprovedPreAuth.items ?? []);
- return;
- }
- }
-
- const res = await dispatch(getConsultation(consultationId as any));
-
- if (res.data && Array.isArray(res.data.procedure)) {
- setItems(
- res.data.procedure.map((obj: ProcedureType) => {
- return {
- id: obj.procedure,
- name: obj.procedure,
- price: 0.0,
- category: "900000", // provider's packages
- };
- }),
- );
- } else {
- setItems([]);
- }
+ const autoFill = async (policy?: HCXPolicyModel) => {
+ if (!policy) {
+ setItems([]);
+ return;
}
- autoFill();
- }, [consultationId, dispatch]);
+ const { res, data: latestApprovedPreAuth } = await request(
+ routes.hcx.claims.list,
+ {
+ query: {
+ consultation: consultationId,
+ policy: policy.id,
+ ordering: "-modified_date",
+ use: "preauthorization",
+ outcome: "complete",
+ limit: 1,
+ },
+ },
+ );
+
+ if (res?.ok && latestApprovedPreAuth?.results.length !== 0) {
+ setItems(latestApprovedPreAuth?.results[0].items ?? []);
+ return;
+ }
+ if (consultationRes?.ok && Array.isArray(consultationData?.procedure)) {
+ setItems(
+ consultationData.procedure.map((obj: ProcedureType) => {
+ return {
+ id: obj.procedure ?? "",
+ name: obj.procedure ?? "",
+ price: 0.0,
+ category: "900000", // provider's packages
+ };
+ }),
+ );
+ } else {
+ setItems([]);
+ }
+ };
const validate = () => {
if (!policy) {
- Notification.Error({ msg: "Please select a policy" });
+ Notification.Error({ msg: t("select_policy") });
return false;
}
- if (policy?.outcome !== "Processing Complete") {
- Notification.Error({ msg: "Please select an eligible policy" });
+ if (policy?.outcome !== "Complete") {
+ Notification.Error({ msg: t("select_eligible_policy") });
return false;
}
if (!items || items.length === 0) {
- setItemsError("Please add at least one item");
+ setItemsError(t("claim__item__add_at_least_one"));
return false;
}
if (items?.some((p) => !p.id || !p.name || p.price === 0 || !p.category)) {
- setItemsError("Please fill all the item details");
+ setItemsError(t("claim__item__fill_all_details"));
return false;
}
@@ -102,22 +113,23 @@ export default function CreateClaimCard({
setIsCreating(true);
- const res = await dispatch(
- HCXActions.claims.create({
+ const { res, data } = await request(routes.hcx.claims.create, {
+ body: {
policy: policy?.id,
items,
consultation: consultationId,
- use,
- }),
- );
+ use: use_,
+ },
+ silent: true,
+ });
- if (res.data) {
+ if (res?.ok && data) {
setItems([]);
setItemsError(undefined);
setPolicy(undefined);
- setCreatedClaim(res.data);
+ setCreatedClaim(data);
} else {
- Notification.Error({ msg: "Failed to create pre-authorization" });
+ Notification.Error({ msg: t(`claim__failed_to_create_${use_}`) });
}
setIsCreating(false);
@@ -133,10 +145,10 @@ export default function CreateClaimCard({
/>
)}
setShowAddPolicy(false)}
- description="Add or edit patient's insurance details"
+ description={t("edit_policy_description")}
className="w-full max-w-screen-md"
>
setShowAddPolicy(false)}
/>
+
{/* Check Insurance Policy Eligibility */}
-
-
- Check Insurance Policy Eligibility
-
- setShowAddPolicy(true)} ghost border>
+
+ {t("check_policy_eligibility")}
+ setShowAddPolicy(true)}
+ ghost
+ border
+ >
- Edit Patient Insurance Details
+ {t("edit_policy")}
{
+ setPolicy(policy);
+ autoFill(policy);
+ }}
/>
{/* Procedures */}
- Items
+ {t("claim__items")}
- Add Item
+ {t("claim__add_item")}
- Select a policy to add items
+ {t("select_policy_to_add_items")}
setItems(value)}
error={itemsError}
/>
-
- {"Total Amount: "}
+
+ {t("total_amount")} :{" "}
{items ? (
{formatCurrency(
@@ -208,29 +227,34 @@ export default function CreateClaimCard({
-
+
setUse_(value)}
position="below"
+ className="w-52 max-sm:w-full"
optionLabel={(value) => value.label}
optionValue={(value) => value.id as "preauthorization" | "claim"}
/>
{isCreating && }
{isCreating
- ? `Creating ${use === "claim" ? "Claim" : "Pre-Authorization"}...`
- : "Proceed"}
+ ? t(`claim__creating_${use_}`)
+ : t(`claim__create_${use_}`)}
diff --git a/src/Components/HCX/InsuranceDetailsBuilder.tsx b/src/Components/HCX/InsuranceDetailsBuilder.tsx
index 2c51d3b90d3..834e3a66953 100644
--- a/src/Components/HCX/InsuranceDetailsBuilder.tsx
+++ b/src/Components/HCX/InsuranceDetailsBuilder.tsx
@@ -4,21 +4,24 @@ import {
useFormFieldPropsResolver,
} from "../Form/FormFields/Utils";
import FormField, { FieldLabel } from "../Form/FormFields/FormField";
-import { HCXPolicyModel } from "./models";
+
import ButtonV2 from "../Common/components/ButtonV2";
import CareIcon from "../../CAREUI/icons/CareIcon";
+import { HCXPolicyModel } from "./models";
+import InsurerAutocomplete from "./InsurerAutocomplete";
import TextFormField from "../Form/FormFields/TextFormField";
-import { useDispatch } from "react-redux";
-import { HCXActions } from "../../Redux/actions";
import { classNames } from "../../Utils/utils";
-import InsurerAutocomplete from "./InsurerAutocomplete";
+import request from "../../Utils/request/request";
+import routes from "../../Redux/api";
+import { useTranslation } from "react-i18next";
import careConfig from "@careConfig";
type Props = FormFieldBaseProps & { gridView?: boolean };
export default function InsuranceDetailsBuilder(props: Props) {
+ const { t } = useTranslation();
+
const field = useFormFieldPropsResolver(props);
- const dispatch = useDispatch();
const handleUpdate = (index: number) => {
return (event: FieldChangeEvent) => {
@@ -41,15 +44,25 @@ export default function InsuranceDetailsBuilder(props: Props) {
};
const handleRemove = (index: number) => {
- return () => {
- field.handleChange(
- (props.value || [])?.filter((obj, i) => {
- if (obj.id && i === index) {
- dispatch(HCXActions.policies.delete(obj.id));
- }
- return i !== index;
- }),
- );
+ return async () => {
+ const updatedPolicies = [...(props.value || [])];
+ const policyToRemove = updatedPolicies[index];
+
+ if (policyToRemove?.id) {
+ try {
+ await request(routes.hcx.policies.delete, {
+ pathParams: { external_id: policyToRemove.id },
+ });
+
+ updatedPolicies.splice(index, 1);
+ field.handleChange(updatedPolicies);
+ } catch (error) {
+ console.error("Failed to delete the policy", error);
+ }
+ } else {
+ updatedPolicies.splice(index, 1);
+ field.handleChange(updatedPolicies);
+ }
};
};
@@ -58,7 +71,7 @@ export default function InsuranceDetailsBuilder(props: Props) {
{props.value?.length === 0 && (
- No insurance details added
+ {t("no_policy_added")}
)}
{props.value?.map((policy, index) => (
@@ -93,6 +106,7 @@ const InsuranceDetailEditCard = ({
handleRemove: () => void;
gridView?: boolean;
}) => {
+ const { t } = useTranslation();
const seletedInsurer =
policy.insurer_id && policy.insurer_name
? { code: policy.insurer_id, name: policy.insurer_name }
@@ -101,9 +115,9 @@ const InsuranceDetailEditCard = ({
return (
- Policy
+ {t("policy")}
- Delete
+ {t("remove")}
@@ -119,25 +133,25 @@ const InsuranceDetailEditCard = ({
{careConfig.hcx.enabled ? (
handleUpdates({
@@ -150,15 +164,15 @@ const InsuranceDetailEditCard = ({
<>
diff --git a/src/Components/HCX/InsurerAutocomplete.tsx b/src/Components/HCX/InsurerAutocomplete.tsx
index b673b37feab..1105642629f 100644
--- a/src/Components/HCX/InsurerAutocomplete.tsx
+++ b/src/Components/HCX/InsurerAutocomplete.tsx
@@ -1,12 +1,15 @@
-import { useAsyncOptions } from "../../Common/hooks/useAsyncOptions";
-import { HCXActions } from "../../Redux/actions";
-import { Autocomplete } from "../Form/FormFields/Autocomplete";
-import FormField from "../Form/FormFields/FormField";
import {
FormFieldBaseProps,
useFormFieldPropsResolver,
} from "../Form/FormFields/Utils";
+import { Autocomplete } from "../Form/FormFields/Autocomplete";
+import FormField from "../Form/FormFields/FormField";
+import routes from "../../Redux/api";
+import { mergeQueryOptions } from "../../Utils/utils";
+import useQuery from "../../Utils/request/useQuery";
+import { useState } from "react";
+
export type InsurerOptionModel = {
name: string;
code: string;
@@ -18,8 +21,12 @@ type Props = FormFieldBaseProps & {
export default function InsurerAutocomplete(props: Props) {
const field = useFormFieldPropsResolver(props);
- const { fetchOptions, isLoading, options } =
- useAsyncOptions("code");
+
+ const [query, setQuery] = useState("");
+
+ const { data, loading } = useQuery(routes.hcx.policies.listPayors, {
+ query: { query, limit: 10 },
+ });
return (
@@ -31,12 +38,16 @@ export default function InsurerAutocomplete(props: Props) {
placeholder={props.placeholder}
value={field.value}
onChange={field.handleChange}
- options={options(props.value && [props.value])}
+ options={mergeQueryOptions(
+ field.value ? [field.value] : [],
+ data ?? [],
+ (obj) => obj.code,
+ )}
optionLabel={(option) => option.name}
optionDescription={(option) => option.code}
optionValue={(option) => option}
- onQuery={(query) => fetchOptions(HCXActions.payors.list(query))}
- isLoading={isLoading}
+ onQuery={setQuery}
+ isLoading={loading}
/>
);
diff --git a/src/Components/HCX/PatientInsuranceDetailsEditor.tsx b/src/Components/HCX/PatientInsuranceDetailsEditor.tsx
index 2515c98c53e..78de8ef201d 100644
--- a/src/Components/HCX/PatientInsuranceDetailsEditor.tsx
+++ b/src/Components/HCX/PatientInsuranceDetailsEditor.tsx
@@ -1,12 +1,14 @@
-import { useEffect, useState } from "react";
-import { useDispatch } from "react-redux";
-import CareIcon from "../../CAREUI/icons/CareIcon";
-import { HCXActions } from "../../Redux/actions";
-import * as Notifications from "../../Utils/Notifications";
import ButtonV2, { Cancel, Submit } from "../Common/components/ButtonV2";
-import InsuranceDetailsBuilder from "./InsuranceDetailsBuilder";
+
+import CareIcon from "../../CAREUI/icons/CareIcon";
import { HCXPolicyModel } from "./models";
import HCXPolicyValidator from "./validators";
+import InsuranceDetailsBuilder from "./InsuranceDetailsBuilder";
+import request from "../../Utils/request/request";
+import routes from "../../Redux/api";
+import useQuery from "../../Utils/request/useQuery";
+import { useState } from "react";
+import { useTranslation } from "react-i18next";
interface Props {
patient: string;
@@ -19,34 +21,24 @@ export default function PatientInsuranceDetailsEditor({
onSubmitted,
onCancel,
}: Props) {
- const dispatch = useDispatch();
- const [insuranceDetails, setInsuranceDetails] = useState();
+ const { t } = useTranslation();
+
+ const [insuranceDetails, setInsuranceDetails] = useState(
+ [],
+ );
const [insuranceDetailsError, setInsuranceDetailsError] = useState();
const [isUpdating, setIsUpdating] = useState(false);
- useEffect(() => {
- const fetchPatientInsuranceDetails = async () => {
- const res = await dispatch(HCXActions.policies.list({ patient }));
- if (res && res.data) {
+ useQuery(routes.hcx.policies.list, {
+ query: { patient },
+ onResponse(res) {
+ if (res?.res?.ok && res.data) {
if (res.data.results.length) {
setInsuranceDetails(res.data.results);
- } else {
- setInsuranceDetails([
- {
- subscriber_id: "",
- policy_id: "",
- insurer_id: "",
- insurer_name: "",
- },
- ]);
}
- } else {
- Notifications.Error({ msg: "Something went wrong " });
}
- };
-
- fetchPatientInsuranceDetails();
- }, [dispatch, patient]);
+ },
+ });
const handleSubmit = async () => {
// Validate
@@ -62,22 +54,19 @@ export default function PatientInsuranceDetailsEditor({
await Promise.all(
insuranceDetails.map(async (obj) => {
const policy: HCXPolicyModel = { ...obj, patient };
- const policyRes = await (policy.id
- ? dispatch(HCXActions.policies.update(policy.id, policy))
- : dispatch(HCXActions.policies.create(policy)));
-
- const eligibilityCheckRes = await dispatch(
- HCXActions.checkEligibility(policyRes.data.id),
- );
- if (eligibilityCheckRes.status === 200) {
- Notifications.Success({ msg: "Checking Policy Eligibility..." });
- } else {
- Notifications.Error({ msg: "Something Went Wrong..." });
- }
+ policy.id
+ ? await request(routes.hcx.policies.update, {
+ pathParams: { external_id: policy.id },
+ body: policy,
+ })
+ : await request(routes.hcx.policies.create, {
+ body: policy,
+ });
}),
);
setIsUpdating(false);
onSubmitted?.();
+ onCancel?.();
};
return (
@@ -112,7 +101,7 @@ export default function PatientInsuranceDetailsEditor({
}
>
- Add Insurance Details
+ {t("add_policy")}
@@ -120,10 +109,10 @@ export default function PatientInsuranceDetailsEditor({
{isUpdating ? (
<>
- Updating...
+ {t("updating")}
>
) : (
- "Update"
+ {t("update")}
)}
diff --git a/src/Components/HCX/PolicyEligibilityCheck.tsx b/src/Components/HCX/PolicyEligibilityCheck.tsx
index 883e771ba18..1d951bd0638 100644
--- a/src/Components/HCX/PolicyEligibilityCheck.tsx
+++ b/src/Components/HCX/PolicyEligibilityCheck.tsx
@@ -1,12 +1,16 @@
-import { useCallback, useEffect, useState } from "react";
-import { useDispatch } from "react-redux";
-import CareIcon from "../../CAREUI/icons/CareIcon";
-import { HCXActions } from "../../Redux/actions";
+import * as Notification from "../../Utils/Notifications.js";
+
+import { useEffect, useState } from "react";
+
import ButtonV2 from "../Common/components/ButtonV2";
-import { SelectFormField } from "../Form/FormFields/SelectFormField";
+import CareIcon from "../../CAREUI/icons/CareIcon";
import { HCXPolicyModel } from "./models";
+import { SelectFormField } from "../Form/FormFields/SelectFormField";
+import request from "../../Utils/request/request.js";
+import routes from "../../Redux/api";
import { useMessageListener } from "../../Common/hooks/useMessageListener";
-import * as Notification from "../../Utils/Notifications.js";
+import useQuery from "../../Utils/request/useQuery";
+import { useTranslation } from "react-i18next";
interface Props {
className?: string;
@@ -19,128 +23,107 @@ export default function HCXPolicyEligibilityCheck({
patient,
onEligiblePolicySelected,
}: Props) {
- const dispatch = useDispatch();
- const [insuranceDetails, setInsuranceDetails] = useState();
- const [policy, setPolicy] = useState();
- const [eligibility, setEligibility] = useState<
- Record
- >({});
- const [isChecking, setIsChecking] = useState(false);
-
- const fetchPatientInsuranceDetails = useCallback(async () => {
- setInsuranceDetails(undefined);
- setEligibility({});
-
- const res = await dispatch(HCXActions.policies.list({ patient }));
-
- if (res.data?.results) {
- const results = res.data.results as HCXPolicyModel[];
- setInsuranceDetails(results);
- setEligibility(
- results.reduce?.((acc: any, policy: HCXPolicyModel) => {
- if (policy.outcome)
- acc[policy.id ?? ""] =
- !policy.error_text && policy.outcome === "Processing Complete";
- return acc;
- }, {}),
- );
- setIsChecking(false);
- }
- }, [patient, dispatch]);
+ const { t } = useTranslation();
- useEffect(() => {
- fetchPatientInsuranceDetails();
- }, [fetchPatientInsuranceDetails]);
+ const [selectedPolicy, setSelectedPolicy] = useState();
+ const [isCheckingEligibility, setIsCheckingEligibility] = useState(false);
+
+ const {
+ refetch,
+ data: policiesResponse,
+ loading,
+ } = useQuery(routes.hcx.policies.list, { query: { patient } });
useMessageListener((data) => {
if (
data.type === "MESSAGE" &&
data.from === "coverageelegibility/on_check"
) {
- fetchPatientInsuranceDetails();
+ refetch();
}
});
useEffect(() => {
- if (policy && eligibility[policy]) {
- const eligiblePolicy = insuranceDetails?.find((p) => p.id === policy);
- onEligiblePolicySelected(eligiblePolicy);
- } else {
- onEligiblePolicySelected(undefined);
- }
- }, [policy, insuranceDetails, eligibility, onEligiblePolicySelected]);
+ onEligiblePolicySelected(
+ isPolicyEligible(selectedPolicy) ? selectedPolicy : undefined,
+ );
+ }, [selectedPolicy]); // eslint-disable-line react-hooks/exhaustive-deps
const checkEligibility = async () => {
- if (!policy) return;
+ if (!selectedPolicy || isPolicyEligible()) return;
- // Skip checking eligibility if we already know the policy is eligible
- if (eligibility[policy]) return;
+ setIsCheckingEligibility(true);
- setIsChecking(true);
+ const { res } = await request(routes.hcx.policies.checkEligibility, {
+ body: { policy: selectedPolicy.id },
+ });
- const res = await dispatch(HCXActions.checkEligibility(policy));
- if (res.status === 200) {
- Notification.Success({ msg: "Checking Policy Eligibility..." });
- } else {
- Notification.Error({ msg: "Something Went Wrong..." });
+ if (res?.ok) {
+ Notification.Success({ msg: t("checking_policy_eligibility") });
}
+
+ setIsCheckingEligibility(false);
};
return (
-
+
option.id as string}
+ options={policiesResponse?.results ?? []}
+ optionValue={(option) => option.id}
optionLabel={(option) => option.policy_id}
optionSelectedLabel={(option) =>
- option.id && eligibility[option.id] !== undefined ? (
+ option.outcome ? (
{option.policy_id}
-
+
) : (
option.policy_id
)
}
optionIcon={(option) =>
- eligibility[option.id!] !== undefined && (
-
+ option.outcome && (
+
)
}
- onChange={({ value }) => setPolicy(value)}
- value={policy}
+ onChange={({ value }) => {
+ setSelectedPolicy(
+ policiesResponse?.results.find((policy) => policy.id === value),
+ );
+ }}
+ value={selectedPolicy?.id}
placeholder={
- insuranceDetails
- ? insuranceDetails.length
- ? "Select a policy to check eligibility"
- : "No policies for the patient"
- : "Loading..."
+ loading
+ ? t("loading")
+ : policiesResponse?.results.length
+ ? t("select_policy")
+ : t("no_policy_found")
}
- disabled={!insuranceDetails}
+ disabled={!policiesResponse?.results.length}
optionDescription={(option) => (
-
- Member ID
-
+
+ {t("policy__subscriber_id")}
+
{option.subscriber_id}
-
- Insurer ID
-
+
+ {t("policy__insurer_id")}
+
{option.insurer_id}
-
- Insurer Name
-
+
+ {t("policy__insurer_name")}
+
{option.insurer_name}
@@ -154,17 +137,21 @@ export default function HCXPolicyEligibilityCheck({
)}
/>
- {isChecking ? (
+ {isCheckingEligibility ? (
<>
- Checking ...
+ {t("checking_eligibility")}
>
) : (
- "Check Eligibility"
+ t("check_eligibility")
)}
@@ -173,6 +160,8 @@ export default function HCXPolicyEligibilityCheck({
}
const EligibilityChip = ({ eligible }: { eligible: boolean }) => {
+ const { t } = useTranslation();
+
return (
{
>
- {eligible ? "Eligible" : "Not Eligible"}
+ {eligible ? t("eligible") : t("not_eligible")}
);
};
+
+const isPolicyEligible = (policy?: HCXPolicyModel) =>
+ policy && !policy.error_text && policy.outcome === "Complete";
diff --git a/src/Components/HCX/models.ts b/src/Components/HCX/models.ts
index a8a9812d31d..e75fc28214d 100644
--- a/src/Components/HCX/models.ts
+++ b/src/Components/HCX/models.ts
@@ -8,7 +8,7 @@ export type HCXPolicyStatus =
| "Active"
| "Cancelled"
| "Draft"
- | "Entered in Error";
+ | "Entered In Error";
export type HCXPolicyPurpose =
| "Auth Requirements"
| "Benefits"
@@ -16,12 +16,12 @@ export type HCXPolicyPurpose =
| "Validation";
export type HCXPolicyOutcome =
| "Queued"
- | "Processing Complete"
+ | "Complete"
| "Error"
| "Partial Processing";
export interface HCXPolicyModel {
- id?: string;
+ id: string;
patient?: string;
patient_object?: PatientModel;
subscriber_id: string;
@@ -29,14 +29,26 @@ export interface HCXPolicyModel {
insurer_id?: string;
insurer_name?: string;
status?: HCXPolicyStatus;
- priority?: "Immediate" | "Normal" | "Deferred";
- purpose?: "Auth Requirements" | "Benefits" | "Discovery" | "Validation";
- outcome?: "Queued" | "Processing Complete" | "Error" | "Partial Processing";
+ priority?: HCXPriority;
+ purpose?: HCXPolicyPurpose;
+ outcome?: HCXPolicyOutcome;
error_text?: string;
created_date?: string;
modified_date?: string;
}
+export interface HCXCommunicationModel {
+ id?: string;
+ identifier?: string;
+ claim?: string;
+ claim_object?: HCXClaimModel;
+ content?: { type: string; data: string }[];
+ created_by?: string | null;
+ last_modified_by?: string | null;
+ created_date?: string;
+ modified_date?: string;
+}
+
export interface HCXItemModel {
id: string;
name: string;
@@ -44,7 +56,7 @@ export interface HCXItemModel {
category?: string;
}
-export type HCXClaimUse = "Claim" | "Pre-Authorization" | "Pre-Determination";
+export type HCXClaimUse = "Claim" | "Pre Authorization" | "Pre Determination";
export type HCXClaimStatus = HCXPolicyStatus;
export type HCXClaimType =
| "Institutional"
diff --git a/src/Components/LogUpdate/CriticalCarePreview.tsx b/src/Components/LogUpdate/CriticalCarePreview.tsx
index 838887decf9..a458b1e245c 100644
--- a/src/Components/LogUpdate/CriticalCarePreview.tsx
+++ b/src/Components/LogUpdate/CriticalCarePreview.tsx
@@ -16,6 +16,7 @@ import { VentilatorFields } from "./Sections/RespiratorySupport/Ventilator";
import PressureSore from "./Sections/PressureSore/PressureSore";
import { IOBalanceSections } from "./Sections/IOBalance";
import PainChart from "./components/PainChart";
+import { meanArterialPressure } from "../Common/BloodPressureFormField";
import { DailyRoundsModel } from "../Patient/models";
type Props = {
@@ -255,7 +256,7 @@ export default function CriticalCarePreview(props: Props) {
/>
)}
diff --git a/src/Components/LogUpdate/Sections/IOBalance.tsx b/src/Components/LogUpdate/Sections/IOBalance.tsx
index ca0bd4867d2..10f76581a46 100644
--- a/src/Components/LogUpdate/Sections/IOBalance.tsx
+++ b/src/Components/LogUpdate/Sections/IOBalance.tsx
@@ -14,7 +14,7 @@ export const IOBalanceSections = [
name: "Infusions",
options: [
"Adrenalin",
- "Nor-adrenalin",
+ "Noradrenalin",
"Vasopressin",
"Dopamine",
"Dobutamine",
diff --git a/src/Components/LogUpdate/Sections/Vitals.tsx b/src/Components/LogUpdate/Sections/Vitals.tsx
index 0561debc88c..2d533d529e4 100644
--- a/src/Components/LogUpdate/Sections/Vitals.tsx
+++ b/src/Components/LogUpdate/Sections/Vitals.tsx
@@ -2,64 +2,34 @@ import { useTranslation } from "react-i18next";
import {
celsiusToFahrenheit,
fahrenheitToCelsius,
- properRoundOf,
rangeValueDescription,
} from "../../../Utils/utils";
import { meanArterialPressure } from "../../Common/BloodPressureFormField";
-
import RadioFormField from "../../Form/FormFields/RadioFormField";
import RangeFormField from "../../Form/FormFields/RangeFormField";
import TextAreaFormField from "../../Form/FormFields/TextAreaFormField";
-import { FieldChangeEvent } from "../../Form/FormFields/Utils";
import PainChart from "../components/PainChart";
import { LogUpdateSectionMeta, LogUpdateSectionProps } from "../utils";
import { HEARTBEAT_RHYTHM_CHOICES } from "../../../Common/constants";
+import { BloodPressure } from "../../Patient/models";
const Vitals = ({ log, onChange }: LogUpdateSectionProps) => {
const { t } = useTranslation();
- const handleBloodPressureChange = (event: FieldChangeEvent) => {
- const bp = {
- ...(log.bp ?? {}),
- [event.name]: event.value,
- };
- bp.mean = meanArterialPressure(bp);
- onChange({ bp });
- };
return (
- {t("blood_pressure")}
+ {t("LOG_UPDATE_FIELD_LABEL__bp")}
- {t("map_acronym")}:{" "}
- {(log.bp?.mean && properRoundOf(log.bp.mean)) || "--"}
+ {t("map_acronym")}: {meanArterialPressure(log.bp)?.toFixed() ?? "--"}{" "}
+ mmHg
-
-
+
+
onChange({ ventilator_spo2: c.value })}
value={log.ventilator_spo2}
@@ -155,6 +125,41 @@ const Vitals = ({ log, onChange }: LogUpdateSectionProps) => {
);
};
+const BPAttributeEditor = ({
+ attribute,
+ log,
+ onChange,
+}: LogUpdateSectionProps & { attribute: "systolic" | "diastolic" }) => {
+ const { t } = useTranslation();
+
+ return (
+ {
+ const bp = log.bp ?? {};
+ bp[event.name as keyof BloodPressure] = event.value;
+ onChange({
+ bp: Object.values(bp).filter(Boolean).length ? bp : undefined,
+ });
+ }}
+ value={log.bp?.[attribute] ?? undefined}
+ min={0}
+ max={400}
+ sliderMin={30}
+ sliderMax={270}
+ step={1}
+ unit="mmHg"
+ valueDescriptions={rangeValueDescription(
+ attribute === "systolic"
+ ? { low: 99, high: 139 }
+ : { low: 49, high: 89 },
+ )}
+ hideUnitInLabel
+ />
+ );
+};
+
Vitals.meta = {
title: "Vitals",
icon: "l-heartbeat",
diff --git a/src/Components/Patient/DailyRoundListDetails.tsx b/src/Components/Patient/DailyRoundListDetails.tsx
index fbf001427dd..eb7eda62064 100644
--- a/src/Components/Patient/DailyRoundListDetails.tsx
+++ b/src/Components/Patient/DailyRoundListDetails.tsx
@@ -16,13 +16,9 @@ export const DailyRoundListDetails = (props: any) => {
const { loading: isLoading } = useQuery(routes.getDailyReport, {
pathParams: { consultationId, id },
- onResponse: ({ res, data }) => {
- if (res && data) {
- const tdata: DailyRoundsModel = {
- ...data,
- medication_given: data.medication_given ?? [],
- };
- setDailyRoundListDetails(tdata);
+ onResponse: ({ data }) => {
+ if (data) {
+ setDailyRoundListDetails(data);
}
},
});
diff --git a/src/Components/Patient/DailyRounds.tsx b/src/Components/Patient/DailyRounds.tsx
index 0c6e01be6f2..ef1281fb62b 100644
--- a/src/Components/Patient/DailyRounds.tsx
+++ b/src/Components/Patient/DailyRounds.tsx
@@ -92,12 +92,7 @@ export const DailyRounds = (props: any) => {
rhythm_detail: "",
ventilator_spo2: null,
consciousness_level: undefined,
- bp: {
- systolic: undefined,
- diastolic: undefined,
- mean: undefined,
- },
- // bed: null,
+ bp: undefined,
};
const initError = Object.assign(
@@ -255,7 +250,7 @@ export const DailyRounds = (props: any) => {
}
return;
case "bp": {
- const error = BloodPressureValidator(state.form.bp);
+ const error = state.form.bp && BloodPressureValidator(state.form.bp);
if (error) {
errors.bp = error;
invalidForm = true;
@@ -351,7 +346,7 @@ export const DailyRounds = (props: any) => {
if (state.form.rounds_type !== "VENTILATOR") {
data = {
...data,
- bp: state.form.bp ?? {},
+ bp: state.form.bp,
pulse: state.form.pulse ?? null,
resp: state.form.resp ?? null,
temperature: state.form.temperature ?? null,
@@ -444,6 +439,10 @@ export const DailyRounds = (props: any) => {
form["investigations_dirty"] = true;
}
+ if (event.name === "nutrition_route" && event.value !== "ORAL") {
+ form["oral_issue"] = undefined;
+ }
+
dispatch({ type: "set_form", form });
};
diff --git a/src/Components/Patient/InsuranceDetails.tsx b/src/Components/Patient/InsuranceDetails.tsx
index 41f1da11e89..9f9fe8507ae 100644
--- a/src/Components/Patient/InsuranceDetails.tsx
+++ b/src/Components/Patient/InsuranceDetails.tsx
@@ -1,11 +1,9 @@
-import { lazy } from "react";
-
-import Page from "../Common/components/Page";
-
-import useQuery from "../../Utils/request/useQuery";
-import routes from "../../Redux/api";
import { HCXPolicyModel } from "../HCX/models";
import { InsuranceDetialsCard } from "./InsuranceDetailsCard";
+import Page from "../Common/components/Page";
+import { lazy } from "react";
+import routes from "../../Redux/api";
+import useQuery from "../../Utils/request/useQuery";
const Loading = lazy(() => import("../Common/Loading"));
@@ -17,11 +15,14 @@ interface IProps {
export const InsuranceDetails = (props: IProps) => {
const { facilityId, id } = props;
- const { data: insuranceDetials, loading } = useQuery(routes.listHCXPolicies, {
- query: {
- patient: id,
+ const { data: insuranceDetials, loading } = useQuery(
+ routes.hcx.policies.list,
+ {
+ query: {
+ patient: id,
+ },
},
- });
+ );
if (loading) {
return ;
diff --git a/src/Components/Patient/ManagePatients.tsx b/src/Components/Patient/ManagePatients.tsx
index 944a5163c96..7a5b0d28a38 100644
--- a/src/Components/Patient/ManagePatients.tsx
+++ b/src/Components/Patient/ManagePatients.tsx
@@ -721,7 +721,8 @@ export const PatientManager = () => {
{patient.last_consultation?.last_daily_round
?.ventilator_interface &&
patient.last_consultation?.last_daily_round
- ?.ventilator_interface !== "UNKNOWN" && (
+ ?.ventilator_interface !== "UNKNOWN" &&
+ !patient.last_consultation?.discharge_date && (
{
RESPIRATORY_SUPPORT.find(
diff --git a/src/Components/Patient/PatientConsentRecordBlock.tsx b/src/Components/Patient/PatientConsentRecordBlock.tsx
index 6832de87679..07931380cb6 100644
--- a/src/Components/Patient/PatientConsentRecordBlock.tsx
+++ b/src/Components/Patient/PatientConsentRecordBlock.tsx
@@ -103,6 +103,7 @@ export default function PatientConsentRecordBlockGroup(props: {
file={file}
editable={hasEditPermission(file)}
associating_id={consentRecord.id}
+ archivable
/>
))}
diff --git a/src/Components/Patient/PatientConsentRecords.tsx b/src/Components/Patient/PatientConsentRecords.tsx
index e277b1d20fc..4ea9a0f294a 100644
--- a/src/Components/Patient/PatientConsentRecords.tsx
+++ b/src/Components/Patient/PatientConsentRecords.tsx
@@ -38,6 +38,7 @@ export default function PatientConsentRecords(props: {
const fileUpload = useFileUpload({
type: "CONSENT_RECORD",
allowedExtensions: ["pdf", "jpg", "jpeg", "png"],
+ allowNameFallback: false,
});
const fileManager = useFileManager({
@@ -181,11 +182,11 @@ export default function PatientConsentRecords(props: {
fileUpload.setFileName(e.value)}
/>
- {fileUpload.file ? (
+ {fileUpload.files[0] ? (
<>
{
@@ -203,7 +204,7 @@ export default function PatientConsentRecords(props: {
handleUpload();
}
}}
- loading={!!fileUpload.progress}
+ loading={fileUpload.uploading}
disabled={
newConsent.type === 2 &&
newConsent.patient_code_status === 0
@@ -215,8 +216,8 @@ export default function PatientConsentRecords(props: {
diff --git a/src/Components/Patient/PatientFilter.tsx b/src/Components/Patient/PatientFilter.tsx
index 773a3f333b7..f496a59df6d 100644
--- a/src/Components/Patient/PatientFilter.tsx
+++ b/src/Components/Patient/PatientFilter.tsx
@@ -343,27 +343,25 @@ export default function PatientFilter(props: any) {
/>
- {props.dischargePage || (
-
-
- {props.dischargePage && "Last "}Admitted to (Bed Types)
-
- o.id}
- optionLabel={(o) => o.text}
- onChange={(o) =>
- setFilterState({
- ...filterState,
- last_consultation_admitted_bed_type_list: o,
- })
- }
- />
-
- )}
+
+
+ {props.dischargePage && "Last "}Admitted to (Bed Types)
+
+ o.id}
+ optionLabel={(o) => o.text}
+ onChange={(o) =>
+ setFilterState({
+ ...filterState,
+ last_consultation_admitted_bed_type_list: o,
+ })
+ }
+ />
+
Has consent records for
import("../Common/Loading"));
@@ -87,7 +87,7 @@ export const PatientHome = (props: any) => {
);
};
- const { data: insuranceDetials } = useQuery(routes.listHCXPolicies, {
+ const { data: insuranceDetials } = useQuery(routes.hcx.policies.list, {
query: {
patient: id,
limit: 1,
diff --git a/src/Components/Patient/PatientInfoCard.tsx b/src/Components/Patient/PatientInfoCard.tsx
index 300c2190a60..1f581b9b0e7 100644
--- a/src/Components/Patient/PatientInfoCard.tsx
+++ b/src/Components/Patient/PatientInfoCard.tsx
@@ -230,6 +230,7 @@ export default function PatientInfoCard(props: {
)}
{consultation?.admitted && (
setOpen(true)}
className="mt-1 px-[10px] py-1"
diff --git a/src/Components/Patient/PatientNotes.tsx b/src/Components/Patient/PatientNotes.tsx
index 7138f4df8e5..da97e5d3f4f 100644
--- a/src/Components/Patient/PatientNotes.tsx
+++ b/src/Components/Patient/PatientNotes.tsx
@@ -6,11 +6,12 @@ import { NonReadOnlyUsers } from "../../Utils/AuthorizeFor";
import PatientNotesList from "../Facility/PatientNotesList";
import Page from "../Common/components/Page";
import { useMessageListener } from "../../Common/hooks/useMessageListener";
-import { PatientNoteStateType } from "../Facility/models";
+import { PatientNoteStateType, PatientNotesModel } from "../Facility/models";
import request from "../../Utils/request/request";
import routes from "../../Redux/api";
import { PATIENT_NOTES_THREADS } from "../../Common/constants.js";
import useAuthUser from "../../Common/hooks/useAuthUser.js";
+import DoctorNoteReplyPreviewCard from "../Facility/DoctorNoteReplyPreviewCard.js";
import { classNames, keysOf } from "../../Utils/utils.js";
import AutoExpandingTextInputFormField from "../Form/FormFields/AutoExpandingTextInputFormField.js";
import { t } from "i18next";
@@ -35,6 +36,9 @@ const PatientNotes = (props: PatientNotesProps) => {
const [reload, setReload] = useState(false);
const [facilityName, setFacilityName] = useState("");
const [patientName, setPatientName] = useState("");
+ const [reply_to, setReplyTo] = useState(
+ undefined,
+ );
const initialData: PatientNoteStateType = {
notes: [],
@@ -56,6 +60,7 @@ const PatientNotes = (props: PatientNotesProps) => {
body: {
note: noteField,
thread,
+ reply_to: reply_to?.id,
},
});
if (res?.status === 201) {
@@ -63,6 +68,7 @@ const PatientNotes = (props: PatientNotesProps) => {
setNoteField("");
setReload(!reload);
setState({ ...state, cPage: 1 });
+ setReplyTo(undefined);
}
};
@@ -130,33 +136,38 @@ const PatientNotes = (props: PatientNotesProps) => {
reload={reload}
setReload={setReload}
thread={thread}
+ setReplyTo={setReplyTo}
/>
-
-
- setNoteField(e.value)}
- className="w-full grow"
- errorClassName="hidden"
- innerClassName="pr-10"
- placeholder={t("notes_placeholder")}
- disabled={!patientActive}
- />
-
-
-
-
+ setReplyTo(undefined)}
+ >
+
+ setNoteField(e.value)}
+ className="w-full grow"
+ errorClassName="hidden"
+ innerClassName="pr-10"
+ placeholder={t("notes_placeholder")}
+ disabled={!patientActive}
+ />
+
+
+
+
+
);
diff --git a/src/Components/Patient/PatientRegister.tsx b/src/Components/Patient/PatientRegister.tsx
index 033d0187649..9a9715ba081 100644
--- a/src/Components/Patient/PatientRegister.tsx
+++ b/src/Components/Patient/PatientRegister.tsx
@@ -10,16 +10,21 @@ import {
SOCIOECONOMIC_STATUS_CHOICES,
VACCINES,
} from "../../Common/constants";
+import { DistrictModel, DupPatientModel, WardModel } from "../Facility/models";
import {
+ FieldError,
+ PhoneNumberValidator,
+ RequiredFieldValidator,
+} from "../Form/FieldValidators";
+import { FieldErrorText, FieldLabel } from "../Form/FormFields/FormField";
+import {
+ compareBy,
dateQueryString,
getPincodeDetails,
includesIgnoreCase,
parsePhoneNumber,
scrollTo,
- compareBy,
} from "../../Utils/utils";
-import { navigate, useQueryParams } from "raviger";
-import { statusType, useAbortableEffect } from "../../Common/utils";
import {
lazy,
useCallback,
@@ -28,8 +33,11 @@ import {
useRef,
useState,
} from "react";
+import { navigate, useQueryParams } from "raviger";
+import { statusType, useAbortableEffect } from "../../Common/utils";
import AccordionV2 from "../Common/components/AccordionV2";
+import AutocompleteFormField from "../Form/FormFields/Autocomplete.js";
import ButtonV2 from "../Common/components/ButtonV2";
import CareIcon from "../../CAREUI/icons/CareIcon";
import CheckBoxFormField from "../Form/FormFields/CheckBoxFormField";
@@ -37,43 +45,34 @@ import CollapseV2 from "../Common/components/CollapseV2";
import ConfirmDialog from "../Common/ConfirmDialog";
import DateFormField from "../Form/FormFields/DateFormField";
import DialogModal from "../Common/Dialog";
-import { DistrictModel, DupPatientModel, WardModel } from "../Facility/models";
import DuplicatePatientDialog from "../Facility/DuplicatePatientDialog";
-import {
- FieldError,
- PhoneNumberValidator,
- RequiredFieldValidator,
-} from "../Form/FieldValidators";
-import { FieldErrorText, FieldLabel } from "../Form/FormFields/FormField";
+import Error404 from "../ErrorPages/404";
import Form from "../Form/Form";
+import { FormContextValue } from "../Form/FormContext.js";
import { HCXPolicyModel } from "../HCX/models";
import HCXPolicyValidator from "../HCX/validators";
+import { ILocalBodies } from "../ExternalResult/models.js";
import InsuranceDetailsBuilder from "../HCX/InsuranceDetailsBuilder";
import LinkABHANumberModal from "../ABDM/LinkABHANumberModal";
import { PatientModel, Occupation, PatientMeta } from "./models";
import PhoneNumberFormField from "../Form/FormFields/PhoneNumberFormField";
import RadioFormField from "../Form/FormFields/RadioFormField";
import { SelectFormField } from "../Form/FormFields/SelectFormField";
-import AutocompleteFormField from "../Form/FormFields/Autocomplete.js";
+import SelectMenuV2 from "../Form/SelectMenuV2.js";
import Spinner from "../Common/Spinner";
import TextAreaFormField from "../Form/FormFields/TextAreaFormField";
import TextFormField from "../Form/FormFields/TextFormField";
import TransferPatientDialog from "../Facility/TransferPatientDialog";
+import _ from "lodash";
import countryList from "../../Common/static/countries.json";
import { debounce } from "lodash-es";
-
+import request from "../../Utils/request/request.js";
+import routes from "../../Redux/api.js";
import useAppHistory from "../../Common/hooks/useAppHistory";
-import { validatePincode } from "../../Common/validation";
-import { FormContextValue } from "../Form/FormContext.js";
import useAuthUser from "../../Common/hooks/useAuthUser.js";
import useQuery from "../../Utils/request/useQuery.js";
-import routes from "../../Redux/api.js";
-import request from "../../Utils/request/request.js";
-import Error404 from "../ErrorPages/404";
-import SelectMenuV2 from "../Form/SelectMenuV2.js";
-import _ from "lodash";
-import { ILocalBodies } from "../ExternalResult/models.js";
import { useTranslation } from "react-i18next";
+import { validatePincode } from "../../Common/validation";
import careConfig from "@careConfig";
const Loading = lazy(() => import("../Common/Loading"));
@@ -481,7 +480,7 @@ export const PatientRegister = (props: PatientRegisterProps) => {
[id],
);
- useQuery(routes.listHCXPolicies, {
+ useQuery(routes.hcx.policies.list, {
query: {
patient: id,
},
@@ -818,29 +817,14 @@ export const PatientRegister = (props: PatientRegisterProps) => {
insurer_id: obj.insurer_id || undefined,
insurer_name: obj.insurer_name || undefined,
};
- const { data: policyData } = policy.id
- ? await request(routes.updateHCXPolicy, {
+ policy.id
+ ? await request(routes.hcx.policies.update, {
pathParams: { external_id: policy.id },
body: policy,
})
- : await request(routes.createHCXPolicy, {
+ : await request(routes.hcx.policies.create, {
body: policy,
});
-
- if (careConfig.hcx.enabled && policyData?.id) {
- await request(routes.hcxCheckEligibility, {
- body: { policy: policyData?.id },
- onResponse: ({ res }) => {
- if (res?.ok) {
- Notification.Success({
- msg: "Checking Policy Eligibility...",
- });
- } else {
- Notification.Error({ msg: "Something Went Wrong..." });
- }
- },
- });
- }
}),
);
diff --git a/src/Components/Patient/models.tsx b/src/Components/Patient/models.tsx
index b1098dcbbc0..cf35680de11 100644
--- a/src/Components/Patient/models.tsx
+++ b/src/Components/Patient/models.tsx
@@ -277,11 +277,10 @@ export const DailyRoundTypes = [
"TELEMEDICINE",
] as const;
-export interface BloodPressure {
- diastolic?: number;
- mean?: number;
+export type BloodPressure = {
systolic?: number;
-}
+ diastolic?: number;
+};
export interface IPainScale {
description: string;
@@ -311,7 +310,6 @@ export interface DailyRoundsModel {
physical_examination_info?: string;
other_details?: string;
consultation?: number;
- medication_given?: Array;
action?: string;
review_interval?: number;
id?: string;
diff --git a/src/Components/Scribe/formDetails.ts b/src/Components/Scribe/formDetails.ts
index 6300ac7e3c2..c889dcf2558 100644
--- a/src/Components/Scribe/formDetails.ts
+++ b/src/Components/Scribe/formDetails.ts
@@ -129,9 +129,9 @@ const DAILY_ROUND_FORM_SCRIBE_DATA: Field[] = [
{
friendlyName: "bp",
id: "bp",
- default: { systolic: null, diastolic: null, mean: null },
+ default: { systolic: null, diastolic: null },
type: "{ systolic?: number, diastolic?: number }",
- example: "{ systolic: 120 }",
+ example: "{ systolic: 120, diastolic: 90 }",
description:
"An object to store the blood pressure of the patient. It may contain two integers, systolic and diastolic.",
validator: (value) => {
diff --git a/src/Components/Users/UserAdd.tsx b/src/Components/Users/UserAdd.tsx
index 86d27bc84d7..9ee1e722ee1 100644
--- a/src/Components/Users/UserAdd.tsx
+++ b/src/Components/Users/UserAdd.tsx
@@ -325,7 +325,12 @@ export const UserAdd = (props: UserProps) => {
}, [state.form.phone_number_is_whatsapp, state.form.phone_number]);
const setFacility = (selected: FacilityModel | FacilityModel[] | null) => {
- setSelectedFacility(selected as FacilityModel[]);
+ const newSelectedFacilities = selected
+ ? Array.isArray(selected)
+ ? selected
+ : [selected]
+ : [];
+ setSelectedFacility(newSelectedFacilities as FacilityModel[]);
const form = { ...state.form };
form.facilities = selected
? (selected as FacilityModel[]).map((i) => i.id!)
diff --git a/src/Locale/en/Common.json b/src/Locale/en/Common.json
index b0316e4d98c..7f0b9f51802 100644
--- a/src/Locale/en/Common.json
+++ b/src/Locale/en/Common.json
@@ -71,7 +71,6 @@
"date_of_positive_covid_19_swab": "Date of Positive Covid 19 Swab",
"patient_no": "OP/IP No",
"date_of_admission": "Date of Admission",
- "india_1": "India",
"unique_id": "Unique Id",
"date_and_time": "Date and Time",
"facility_type": "Facility type",
@@ -176,6 +175,9 @@
"summary": "Summary",
"report": "Report",
"treating_doctor": "Treating Doctor",
+ "hubs": "Hub Facilities",
+ "spokes": "Spoke Facilities",
+ "add_spoke" : "Add Spoke Facility",
"ration_card__NO_CARD": "Non-card holder",
"ration_card__BPL": "BPL",
"ration_card__APL": "APL",
@@ -184,6 +186,11 @@
"feed_optimal_experience_for_phones": "For optimal viewing experience, consider rotating your device.",
"feed_optimal_experience_for_apple_phones": "For optimal viewing experience, consider rotating your device. Ensure auto-rotate is enabled in your device settings.",
"action_irreversible": "This action is irreversible",
+ "send_message": "Send Message",
+ "enter_message": "Start typing...",
+ "see_attachments": "See Attachments",
+ "no_attachments_found": "This communication has no attachments.",
+ "fetching": "Fetching",
"GENDER__1": "Male",
"GENDER__2": "Female",
"GENDER__3": "Non-binary",
@@ -197,6 +204,7 @@
"live": "Live",
"discharged": "Discharged",
"archived": "Archived",
+ "created_on": "Created On",
"no_changes_made": "No changes made",
"user_deleted_successfuly": "User Deleted Successfuly",
"users": "Users",
@@ -206,5 +214,21 @@
"delete_item": "Delete {{name}}",
"unsupported_browser": "Unsupported Browser",
"unsupported_browser_description": "Your browser ({{name}} version {{version}}) is not supported. Please update your browser to the latest version or switch to a supported browser for the best experience.",
- "add_remarks": "Add remarks"
+ "add_remarks": "Add remarks",
+ "SORT_OPTIONS__-created_date": "Latest created date first",
+ "SORT_OPTIONS__created_date": "Oldest created date first",
+ "SORT_OPTIONS__-category_severity": "Highest Severity category first",
+ "SORT_OPTIONS__category_severity": "Lowest Severity category first",
+ "SORT_OPTIONS__-modified_date": "Latest updated date first",
+ "SORT_OPTIONS__modified_date": "Oldest updated date first",
+ "SORT_OPTIONS__facility__name,last_consultation__current_bed__bed__name": "Bed No. 1-N",
+ "SORT_OPTIONS__facility__name,-last_consultation__current_bed__bed__name": "Bed No. N-1",
+ "SORT_OPTIONS__-review_time": "Latest review date first",
+ "SORT_OPTIONS__review_time": "Oldest review date first",
+ "SORT_OPTIONS__taken_at": "Oldest taken date first",
+ "SORT_OPTIONS__-taken_at": "Latest taken date first",
+ "SORT_OPTIONS__name": "Patient name A-Z",
+ "SORT_OPTIONS__-name": "Patient name Z-A",
+ "SORT_OPTIONS__bed__name": "Bed No. 1-N",
+ "SORT_OPTIONS__-bed__name": "Bed No. N-1"
}
\ No newline at end of file
diff --git a/src/Locale/en/Facility.json b/src/Locale/en/Facility.json
index e061dee620e..4e835bec675 100644
--- a/src/Locale/en/Facility.json
+++ b/src/Locale/en/Facility.json
@@ -101,6 +101,11 @@
"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.",
"patient_transfer_birth_match_note": "Note: Year of birth must match the patient to process the transfer request.",
"cover_image_updated_note": "It could take a while to see the updated cover image",
+ "bed_type__100": "ICU Bed",
+ "bed_type__200": "Ordinary Bed",
+ "bed_type__300": "Oxygen Supported Bed",
+ "bed_type__400": "Isolation Bed",
+ "bed_type__500": "Others",
"available_features": "Available Features",
"update_facility": "Update Facility",
"configure_facility": "Configure Facility",
diff --git a/src/Locale/en/FileUpload.json b/src/Locale/en/FileUpload.json
index 93b61943944..4b3097eb9d3 100644
--- a/src/Locale/en/FileUpload.json
+++ b/src/Locale/en/FileUpload.json
@@ -20,7 +20,9 @@
"file_list_headings__sample_report": "Sample Report",
"file_list_headings__supporting_info": "Supporting Info",
"file_error__choose_file": "Please choose a file to upload",
- "file_error__file_name": "Please enter file name",
+ "file_error__file_name": "Please give a name for all files!",
+ "file_error__single_file_name": "Please give a name for the file",
+ "change_file": "Change File",
"file_error__file_size": "Maximum size of files is 100 MB",
"file_error__file_type": "Invalid file type \".{{extension}}\" Allowed types: {{allowedExtensions}}",
"file_uploaded": "File Uploaded Successfully",
diff --git a/src/Locale/en/HCX.json b/src/Locale/en/HCX.json
new file mode 100644
index 00000000000..8c5d60c642d
--- /dev/null
+++ b/src/Locale/en/HCX.json
@@ -0,0 +1,63 @@
+{
+ "checking_policy_eligibility": "Checking Policy Eligibility",
+ "check_policy_eligibility": "Check Policy Eligibility",
+ "add_policy": "Add Insurance Policy",
+ "edit_policy": "Edit Insurance Policy",
+ "edit_policy_description": "Add or edit patient's insurance details",
+ "select_policy": "Select an Insurance Policy",
+ "select_eligible_policy": "Select an Eligible Insurance Policy",
+ "no_policy_found": "No Insurance Policy Found for this Patient",
+ "no_policy_added": "No Insurance Policy Added",
+ "checking_eligibility": "Checking Eligibility",
+ "check_eligibility": "Check Eligibility",
+ "eligible": "Eligible",
+ "not_eligible": "Not Eligible",
+ "policy": "Policy",
+ "policy__subscriber_id": "Member ID",
+ "policy__subscriber_id__example": "SUB001",
+ "policy__policy_id": "Policy ID / Policy Name",
+ "policy__policy_id__example": "POL001",
+ "policy__insurer": "Insurer",
+ "policy__insurer__example": "GICOFINDIA",
+ "policy__insurer_id": "Insurer ID",
+ "policy__insurer_id__example": "GICOFINDIA",
+ "policy__insurer_name": "Insurer Name",
+ "policy__insurer_name__example": "GIC OF INDIA",
+ "claims": "Claims",
+ "claim__item": "Item",
+ "claim__items": "Items",
+ "claim__add_item": "Add Item",
+ "claim__item__add_at_least_one": "Add at least one item",
+ "claim__item__fill_all_details": "Fill all the item details",
+ "claim__item__category": "Category",
+ "claim__item__procedure": "Procedure",
+ "claim__item__id": "ID",
+ "claim__item__id__example": "PROC001",
+ "claim__item__name": "Name",
+ "claim__item__name__example": "Knee Replacement",
+ "claim__item__price": "Price",
+ "claim__item__price__example": "100.00",
+ "claim__failed_to_create_preauthorization": "Failed to create Pre Authorization",
+ "claim__failed_to_create_claim": "Failed to create Claim",
+ "claim__creating_preauthorization": "Creating Pre Authorization",
+ "claim__creating_claim": "Creating Claim",
+ "claim__create_preauthorization": "Create Pre Authorization",
+ "claim__create_claim": "Create Claim",
+ "claim__use": "Use",
+ "claim__use__preauthorization": "Pre Authorization",
+ "claim__use__claim": "Claim",
+ "select_policy_to_add_items": "Select a Policy to Add Items",
+ "total_amount": "Total Amount",
+ "claim__status__rejected": "Rejected",
+ "claim__status__approved": "Approved",
+ "claim__status__pending": "Pending",
+ "claim__total_claim_amount": "Total Claim Amount",
+ "claim__total_approved_amount": "Total Approved Amount",
+ "communication__sent_to_hcx": "Sent communication to HCX",
+ "fetched_attachments_successfully": "Fetched attachments successfully",
+ "add_attachments": "Add Attachments",
+ "claim__request_claim": "Request Claim",
+ "claim__requesting_claim": "Requesting Claim",
+ "claim__fetched_claim_approval_results": "Fetched Claim Approval Results",
+ "claim__error_fetching_claim_approval_results": "Error Fetching Claim Approval Results"
+}
diff --git a/src/Locale/en/LogUpdate.json b/src/Locale/en/LogUpdate.json
index ec5dfe8521e..386415d173e 100644
--- a/src/Locale/en/LogUpdate.json
+++ b/src/Locale/en/LogUpdate.json
@@ -32,7 +32,7 @@
"ROUNDS_TYPE__AUTOMATED": "Virtual Nursing Assistant",
"ROUNDS_TYPE__TELEMEDICINE": "Tele-medicine Log",
"RESPIRATORY_SUPPORT_SHORT__UNKNOWN": "None",
- "RESPIRATORY_SUPPORT_SHORT__OXYGEN_SUPPORT": "O2 Support",
+ "RESPIRATORY_SUPPORT_SHORT__OXYGEN_SUPPORT": "O₂ Support",
"RESPIRATORY_SUPPORT_SHORT__NON_INVASIVE": "NIV",
"RESPIRATORY_SUPPORT_SHORT__INVASIVE": "IV",
"RESPIRATORY_SUPPORT__UNKNOWN": "None",
@@ -131,14 +131,13 @@
"NURSING_CARE_PROCEDURE__restrain": "Restrain",
"NURSING_CARE_PROCEDURE__chest_tube_care": "Chest Tube Care",
"NURSING_CARE_PROCEDURE__tracheostomy_care": "Tracheostomy Care",
- "NURSING_CARE_PROCEDURE__tracheostomy_change": "Tracheostomy change ",
+ "NURSING_CARE_PROCEDURE__tracheostomy_tube_change": "Tracheostomy Tube Change",
"NURSING_CARE_PROCEDURE__stoma_care": "Stoma Care",
"NURSING_CARE_PROCEDURE__catheter_care": "Catheter Care",
"NURSING_CARE_PROCEDURE__catheter_change": "Catheter Change",
"HEARTBEAT_RHYTHM__REGULAR": "Regular",
"HEARTBEAT_RHYTHM__IRREGULAR": "Irregular",
"HEARTBEAT_RHYTHM__UNKNOWN": "Unknown",
- "blood_pressure": "Blood Pressure",
"map_acronym": "M.A.P.",
"systolic": "Systolic",
"diastolic": "Diastolic",
@@ -146,11 +145,11 @@
"pain_chart_description": "Mark region and intensity of pain",
"bradycardia": "Bradycardia",
"tachycardia": "Tachycardia",
+ "vitals": "Vitals",
"procedures_select_placeholder": "Select procedures to add details",
"oral_issue_for_non_oral_nutrition_route_error": "Can be specified only if nutrition route is set to Oral",
"routine": "Routine",
"bladder": "Bladder",
"nutrition": "Nutrition",
- "vitals": "Vitals",
"nursing_care": "Nursing Care"
}
\ No newline at end of file
diff --git a/src/Locale/en/SortOptions.json b/src/Locale/en/SortOptions.json
deleted file mode 100644
index 29a8d1e8f4d..00000000000
--- a/src/Locale/en/SortOptions.json
+++ /dev/null
@@ -1,18 +0,0 @@
-{
- "-created_date": "Latest created date first",
- "created_date": "Oldest created date first",
- "-category_severity": "Highest Severity category first",
- "category_severity": "Lowest Severity category first",
- "-modified_date": "Latest updated date first",
- "modified_date": "Oldest updated date first",
- "facility__name,last_consultation__current_bed__bed__name": "Bed No. 1-N",
- "facility__name,-last_consultation__current_bed__bed__name": "Bed No. N-1",
- "-review_time": "Latest review date first",
- "review_time": "Oldest review date first",
- "taken_at": "Oldest taken date first",
- "-taken_at": "Latest taken date first",
- "name": "Patient name A-Z",
- "-name": "Patient name Z-A",
- "bed__name": "Bed No. 1-N",
- "-bed__name": "Bed No. N-1"
-}
diff --git a/src/Locale/en/index.js b/src/Locale/en/index.js
index 0ad729cadbe..808520605ed 100644
--- a/src/Locale/en/index.js
+++ b/src/Locale/en/index.js
@@ -9,6 +9,8 @@ import Entities from "./Entities.json";
import ErrorPages from "./ErrorPages.json";
import ExternalResult from "./ExternalResult.json";
import Facility from "./Facility.json";
+import FileUpload from "./FileUpload.json";
+import HCX from "./HCX.json";
import Hub from "./Hub.json";
import LogUpdate from "./LogUpdate.json";
import Medicine from "./Medicine.json";
@@ -16,9 +18,7 @@ import Notifications from "./Notifications.json";
import Patient from "./Patient.json";
import Resource from "./Resource.json";
import Shifting from "./Shifting.json";
-import SortOptions from "./SortOptions.json";
import Users from "./Users.json";
-import FileUpload from "./FileUpload.json";
export default {
...Auth,
@@ -41,5 +41,5 @@ export default {
...Users,
...LogUpdate,
...FileUpload,
- SortOptions,
+ ...HCX,
};
diff --git a/src/Locale/hi/Common.json b/src/Locale/hi/Common.json
index e881bb29d75..4cd3bbe3e36 100644
--- a/src/Locale/hi/Common.json
+++ b/src/Locale/hi/Common.json
@@ -203,5 +203,21 @@
"deleted_successfully": "{{name}} सफलतापूर्वक हटा दिया गया",
"delete_item": "{{name}}मिटाएँ",
"unsupported_browser": "असमर्थित ब्राउज़र",
- "unsupported_browser_description": "आपका ब्राउज़र ({{name}} संस्करण {{version}}) समर्थित नहीं है। कृपया अपने ब्राउज़र को नवीनतम संस्करण में अपडेट करें या सर्वोत्तम अनुभव के लिए समर्थित ब्राउज़र पर स्विच करें।"
+ "unsupported_browser_description": "आपका ब्राउज़र ({{name}} संस्करण {{version}}) समर्थित नहीं है। कृपया अपने ब्राउज़र को नवीनतम संस्करण में अपडेट करें या सर्वोत्तम अनुभव के लिए समर्थित ब्राउज़र पर स्विच करें।",
+ "SORT_OPTIONS__-created_date": "नवीनतम निर्माण तिथि पहले",
+ "SORT_OPTIONS__created_date": "सबसे पुरानी निर्माण तिथि पहले",
+ "SORT_OPTIONS__-category_severity": "सर्वोच्च गंभीरता श्रेणी पहले",
+ "SORT_OPTIONS__category_severity": "सबसे कम गंभीरता वाली श्रेणी पहले",
+ "SORT_OPTIONS__-modified_date": "नवीनतम अद्यतन तिथि पहले",
+ "SORT_OPTIONS__modified_date": "सबसे पुरानी अद्यतन तिथि पहले",
+ "SORT_OPTIONS__facility__name,last_consultation__current_bed__bed__name": "बिस्तर नं. 1-एन",
+ "SORT_OPTIONS__facility__name,-last_consultation__current_bed__bed__name": "बिस्तर संख्या एन-1",
+ "SORT_OPTIONS__-review_time": "नवीनतम समीक्षा तिथि पहले",
+ "SORT_OPTIONS__review_time": "सबसे पुरानी समीक्षा तिथि पहले",
+ "SORT_OPTIONS__taken_at": "सबसे पुरानी ली गई तारीख पहले",
+ "SORT_OPTIONS__-taken_at": "नवीनतम ली गई तिथि पहले",
+ "SORT_OPTIONS__name": "मरीज़ का नाम AZ",
+ "SORT_OPTIONS__-name": "मरीज का नाम ZA",
+ "SORT_OPTIONS__bed__name": "बिस्तर नं. 1-एन",
+ "SORT_OPTIONS__-bed__name": "बिस्तर संख्या एन-1"
}
\ No newline at end of file
diff --git a/src/Locale/hi/LogUpdate.json b/src/Locale/hi/LogUpdate.json
index 176886c855b..9adc6a1e093 100644
--- a/src/Locale/hi/LogUpdate.json
+++ b/src/Locale/hi/LogUpdate.json
@@ -56,7 +56,6 @@
"HEARTBEAT_RHYTHM__REGULAR": "नियमित",
"HEARTBEAT_RHYTHM__IRREGULAR": "अनियमित",
"HEARTBEAT_RHYTHM__UNKNOWN": "अज्ञात",
- "blood_pressure": "रक्तचाप",
"map_acronym": "मानचित्र",
"systolic": "सिस्टोलिक",
"diastolic": "डायस्टोलिक",
diff --git a/src/Locale/hi/SortOptions.json b/src/Locale/hi/SortOptions.json
deleted file mode 100644
index 46b319fac69..00000000000
--- a/src/Locale/hi/SortOptions.json
+++ /dev/null
@@ -1,18 +0,0 @@
-{
- "-created_date": "नवीनतम निर्माण तिथि पहले",
- "created_date": "सबसे पुरानी निर्माण तिथि पहले",
- "-category_severity": "सर्वोच्च गंभीरता श्रेणी पहले",
- "category_severity": "सबसे कम गंभीरता वाली श्रेणी पहले",
- "-modified_date": "नवीनतम अद्यतन तिथि पहले",
- "modified_date": "सबसे पुरानी अद्यतन तिथि पहले",
- "facility__name,last_consultation__current_bed__bed__name": "बिस्तर नं. 1-एन",
- "facility__name,-last_consultation__current_bed__bed__name": "बिस्तर संख्या एन-1",
- "-review_time": "नवीनतम समीक्षा तिथि पहले",
- "review_time": "सबसे पुरानी समीक्षा तिथि पहले",
- "taken_at": "सबसे पुरानी ली गई तारीख पहले",
- "-taken_at": "नवीनतम ली गई तिथि पहले",
- "name": "मरीज़ का नाम AZ",
- "-name": "मरीज का नाम ZA",
- "bed__name": "बिस्तर नं. 1-एन",
- "-bed__name": "बिस्तर संख्या एन-1"
-}
diff --git a/src/Locale/kn/Common.json b/src/Locale/kn/Common.json
index 6e136b1e906..6eeaa71ea48 100644
--- a/src/Locale/kn/Common.json
+++ b/src/Locale/kn/Common.json
@@ -203,5 +203,21 @@
"deleted_successfully": "{{name}} ಅನ್ನು ಯಶಸ್ವಿಯಾಗಿ ಅಳಿಸಲಾಗಿದೆ",
"delete_item": "{{name}}ಅಳಿಸಿ",
"unsupported_browser": "ಬೆಂಬಲಿತವಲ್ಲದ ಬ್ರೌಸರ್",
- "unsupported_browser_description": "ನಿಮ್ಮ ಬ್ರೌಸರ್ ({{name}} ಆವೃತ್ತಿ {{version}}) ಬೆಂಬಲಿತವಾಗಿಲ್ಲ. ದಯವಿಟ್ಟು ನಿಮ್ಮ ಬ್ರೌಸರ್ ಅನ್ನು ಇತ್ತೀಚಿನ ಆವೃತ್ತಿಗೆ ನವೀಕರಿಸಿ ಅಥವಾ ಉತ್ತಮ ಅನುಭವಕ್ಕಾಗಿ ಬೆಂಬಲಿತ ಬ್ರೌಸರ್ಗೆ ಬದಲಿಸಿ."
+ "SORT_OPTIONS__unsupported_browser_description": "ನಿಮ್ಮ ಬ್ರೌಸರ್ ({{name}} ಆವೃತ್ತಿ {{version}}) ಬೆಂಬಲಿತವಾಗಿಲ್ಲ. ದಯವಿಟ್ಟು ನಿಮ್ಮ ಬ್ರೌಸರ್ ಅನ್ನು ಇತ್ತೀಚಿನ ಆವೃತ್ತಿಗೆ ನವೀಕರಿಸಿ ಅಥವಾ ಉತ್ತಮ ಅನುಭವಕ್ಕಾಗಿ ಬೆಂಬಲಿತ ಬ್ರೌಸರ್ಗೆ ಬದಲಿಸಿ.",
+ "SORT_OPTIONS__-created_date": "ಇತ್ತೀಚಿಗೆ ರಚಿಸಿದ ದಿನಾಂಕ ಮೊದಲು",
+ "SORT_OPTIONS__created_date": "ಮೊದಲು ರಚಿಸಿದ ಹಳೆಯ ದಿನಾಂಕ",
+ "SORT_OPTIONS__-category_severity": "ಅತ್ಯಧಿಕ ತೀವ್ರತೆಯ ವಿಭಾಗ ಮೊದಲು",
+ "SORT_OPTIONS__category_severity": "ಕಡಿಮೆ ತೀವ್ರತೆಯ ವರ್ಗ ಮೊದಲು",
+ "SORT_OPTIONS__-modified_date": "ಮೊದಲು ಇತ್ತೀಚಿನ ನವೀಕರಿಸಿದ ದಿನಾಂಕ",
+ "SORT_OPTIONS__modified_date": "ಹಳೆಯ ನವೀಕರಿಸಿದ ದಿನಾಂಕ ಮೊದಲು",
+ "SORT_OPTIONS__facility__name,last_consultation__current_bed__bed__name": "ಹಾಸಿಗೆ ಸಂಖ್ಯೆ 1-N",
+ "SORT_OPTIONS__facility__name,-last_consultation__current_bed__bed__name": "ಹಾಸಿಗೆ ಸಂಖ್ಯೆ N-1",
+ "SORT_OPTIONS__-review_time": "ಇತ್ತೀಚಿನ ವಿಮರ್ಶೆ ದಿನಾಂಕ ಮೊದಲು",
+ "SORT_OPTIONS__review_time": "ಹಳೆಯ ವಿಮರ್ಶೆ ದಿನಾಂಕ ಮೊದಲು",
+ "SORT_OPTIONS__taken_at": "ಹಳೆಯ ತೆಗೆದ ದಿನಾಂಕ ಮೊದಲು",
+ "SORT_OPTIONS__-taken_at": "ಇತ್ತೀಚೆಗೆ ತೆಗೆದುಕೊಂಡ ದಿನಾಂಕ ಮೊದಲು",
+ "SORT_OPTIONS__name": "ರೋಗಿಯ ಹೆಸರು AZ",
+ "SORT_OPTIONS__-name": "ರೋಗಿಯ ಹೆಸರು ZA",
+ "SORT_OPTIONS__bed__name": "ಹಾಸಿಗೆ ಸಂಖ್ಯೆ 1-N",
+ "SORT_OPTIONS__-bed__name": "ಹಾಸಿಗೆ ಸಂಖ್ಯೆ N-1"
}
\ No newline at end of file
diff --git a/src/Locale/kn/LogUpdate.json b/src/Locale/kn/LogUpdate.json
index 25e4ee4623e..188b02c3925 100644
--- a/src/Locale/kn/LogUpdate.json
+++ b/src/Locale/kn/LogUpdate.json
@@ -56,7 +56,6 @@
"HEARTBEAT_RHYTHM__REGULAR": "ನಿಯಮಿತ",
"HEARTBEAT_RHYTHM__IRREGULAR": "ಅನಿಯಮಿತ",
"HEARTBEAT_RHYTHM__UNKNOWN": "ಅಜ್ಞಾತ",
- "blood_pressure": "ರಕ್ತದೊತ್ತಡ",
"map_acronym": "ನಕ್ಷೆ",
"systolic": "ಸಿಸ್ಟೊಲಿಕ್",
"diastolic": "ಡಯಾಸ್ಟೊಲಿಕ್",
diff --git a/src/Locale/kn/SortOptions.json b/src/Locale/kn/SortOptions.json
deleted file mode 100644
index 1fb870664f2..00000000000
--- a/src/Locale/kn/SortOptions.json
+++ /dev/null
@@ -1,18 +0,0 @@
-{
- "-created_date": "ಇತ್ತೀಚಿಗೆ ರಚಿಸಿದ ದಿನಾಂಕ ಮೊದಲು",
- "created_date": "ಮೊದಲು ರಚಿಸಿದ ಹಳೆಯ ದಿನಾಂಕ",
- "-category_severity": "ಅತ್ಯಧಿಕ ತೀವ್ರತೆಯ ವಿಭಾಗ ಮೊದಲು",
- "category_severity": "ಕಡಿಮೆ ತೀವ್ರತೆಯ ವರ್ಗ ಮೊದಲು",
- "-modified_date": "ಮೊದಲು ಇತ್ತೀಚಿನ ನವೀಕರಿಸಿದ ದಿನಾಂಕ",
- "modified_date": "ಹಳೆಯ ನವೀಕರಿಸಿದ ದಿನಾಂಕ ಮೊದಲು",
- "facility__name,last_consultation__current_bed__bed__name": "ಹಾಸಿಗೆ ಸಂಖ್ಯೆ 1-N",
- "facility__name,-last_consultation__current_bed__bed__name": "ಹಾಸಿಗೆ ಸಂಖ್ಯೆ N-1",
- "-review_time": "ಇತ್ತೀಚಿನ ವಿಮರ್ಶೆ ದಿನಾಂಕ ಮೊದಲು",
- "review_time": "ಹಳೆಯ ವಿಮರ್ಶೆ ದಿನಾಂಕ ಮೊದಲು",
- "taken_at": "ಹಳೆಯ ತೆಗೆದ ದಿನಾಂಕ ಮೊದಲು",
- "-taken_at": "ಇತ್ತೀಚೆಗೆ ತೆಗೆದುಕೊಂಡ ದಿನಾಂಕ ಮೊದಲು",
- "name": "ರೋಗಿಯ ಹೆಸರು AZ",
- "-name": "ರೋಗಿಯ ಹೆಸರು ZA",
- "bed__name": "ಹಾಸಿಗೆ ಸಂಖ್ಯೆ 1-N",
- "-bed__name": "ಹಾಸಿಗೆ ಸಂಖ್ಯೆ N-1"
-}
diff --git a/src/Locale/kn/index.js b/src/Locale/kn/index.js
index cbf1d10c3b9..5c2b9219ced 100644
--- a/src/Locale/kn/index.js
+++ b/src/Locale/kn/index.js
@@ -1,11 +1,37 @@
+import Asset from "./Asset.json";
import Auth from "./Auth.json";
+import Bed from "./Bed.json";
import Common from "./Common.json";
+import Consultation from "./Consultation.json";
+import CoverImageEdit from "./CoverImageEdit.json";
+import Diagnosis from "./Diagnosis.json";
import Entities from "./Entities.json";
+import ErrorPages from "./ErrorPages.json";
+import ExternalResult from "./ExternalResult.json";
import Facility from "./Facility.json";
+import FileUpload from "./FileUpload.json";
+import Hub from "./Hub.json";
+import Medicine from "./Medicine.json";
+import Notifications from "./Notifications.json";
+import Shifting from "./Shifting.json";
+import Users from "./Users.json";
export default {
...Auth,
+ ...Asset,
...Common,
+ ...Consultation,
+ ...CoverImageEdit,
...Entities,
+ ...ErrorPages,
+ ...ExternalResult,
...Facility,
+ ...Hub,
+ ...Medicine,
+ ...Diagnosis,
+ ...Notifications,
+ ...Shifting,
+ ...Bed,
+ ...Users,
+ ...FileUpload,
};
diff --git a/src/Locale/ml/Common.json b/src/Locale/ml/Common.json
index 7e77900e2cb..ab1e0db6feb 100644
--- a/src/Locale/ml/Common.json
+++ b/src/Locale/ml/Common.json
@@ -203,5 +203,21 @@
"deleted_successfully": "{{name}} വിജയകരമായി ഇല്ലാതാക്കി",
"delete_item": "{{name}}ഇല്ലാതാക്കുക",
"unsupported_browser": "പിന്തുണയ്ക്കാത്ത ബ്രൗസർ",
- "unsupported_browser_description": "നിങ്ങളുടെ ബ്രൗസർ ({{name}} പതിപ്പ് {{version}}) പിന്തുണയ്ക്കുന്നില്ല. ഏറ്റവും പുതിയ പതിപ്പിലേക്ക് നിങ്ങളുടെ ബ്രൗസർ അപ്ഡേറ്റ് ചെയ്യുക അല്ലെങ്കിൽ മികച്ച അനുഭവത്തിനായി പിന്തുണയ്ക്കുന്ന ബ്രൗസറിലേക്ക് മാറുക."
+ "unsupported_browser_description": "നിങ്ങളുടെ ബ്രൗസർ ({{name}} പതിപ്പ് {{version}}) പിന്തുണയ്ക്കുന്നില്ല. ഏറ്റവും പുതിയ പതിപ്പിലേക്ക് നിങ്ങളുടെ ബ്രൗസർ അപ്ഡേറ്റ് ചെയ്യുക അല്ലെങ്കിൽ മികച്ച അനുഭവത്തിനായി പിന്തുണയ്ക്കുന്ന ബ്രൗസറിലേക്ക് മാറുക.",
+ "SORT_OPTIONS__-created_date": "ആദ്യം സൃഷ്ടിച്ച ഏറ്റവും പുതിയ തീയതി",
+ "SORT_OPTIONS__created_date": "ഏറ്റവും പഴയ സൃഷ്ടിച്ച തീയതി ആദ്യം",
+ "SORT_OPTIONS__-category_severity": "ഏറ്റവും ഉയർന്ന തീവ്രത വിഭാഗം ആദ്യം",
+ "SORT_OPTIONS__category_severity": "ഏറ്റവും കുറഞ്ഞ തീവ്രത വിഭാഗം ആദ്യം",
+ "SORT_OPTIONS__-modified_date": "ഏറ്റവും പുതിയ അപ്ഡേറ്റ് തീയതി ആദ്യം",
+ "SORT_OPTIONS__modified_date": "ഏറ്റവും പഴയ പുതുക്കിയ തീയതി ആദ്യം",
+ "SORT_OPTIONS__facility__name,last_consultation__current_bed__bed__name": "ബെഡ് നമ്പർ 1-N",
+ "SORT_OPTIONS__facility__name,-last_consultation__current_bed__bed__name": "കിടക്ക നമ്പർ N-1",
+ "SORT_OPTIONS__-review_time": "ഏറ്റവും പുതിയ അവലോകന തീയതി ആദ്യം",
+ "SORT_OPTIONS__review_time": "ഏറ്റവും പഴയ അവലോകന തീയതി ആദ്യം",
+ "SORT_OPTIONS__taken_at": "ആദ്യം എടുത്ത ഏറ്റവും പഴയ തീയതി",
+ "SORT_OPTIONS__-taken_at": "ഏറ്റവും പുതിയ തീയതി ആദ്യം",
+ "SORT_OPTIONS__name": "രോഗിയുടെ പേര് AZ",
+ "SORT_OPTIONS__-name": "രോഗിയുടെ പേര് ZA",
+ "SORT_OPTIONS__bed__name": "ബെഡ് നമ്പർ 1-N",
+ "SORT_OPTIONS__-bed__name": "കിടക്ക നമ്പർ N-1"
}
\ No newline at end of file
diff --git a/src/Locale/ml/LogUpdate.json b/src/Locale/ml/LogUpdate.json
index d2503cd8d34..f327199d509 100644
--- a/src/Locale/ml/LogUpdate.json
+++ b/src/Locale/ml/LogUpdate.json
@@ -56,7 +56,6 @@
"HEARTBEAT_RHYTHM__REGULAR": "പതിവ്",
"HEARTBEAT_RHYTHM__IRREGULAR": "ക്രമരഹിതം",
"HEARTBEAT_RHYTHM__UNKNOWN": "അജ്ഞാതം",
- "blood_pressure": "രക്തസമ്മർദ്ദം",
"map_acronym": "മാപ്പ്",
"systolic": "സിസ്റ്റോളിക്",
"diastolic": "ഡയസ്റ്റോളിക്",
diff --git a/src/Locale/ml/SortOptions.json b/src/Locale/ml/SortOptions.json
deleted file mode 100644
index 97eb76e6160..00000000000
--- a/src/Locale/ml/SortOptions.json
+++ /dev/null
@@ -1,18 +0,0 @@
-{
- "-created_date": "ആദ്യം സൃഷ്ടിച്ച ഏറ്റവും പുതിയ തീയതി",
- "created_date": "ഏറ്റവും പഴയ സൃഷ്ടിച്ച തീയതി ആദ്യം",
- "-category_severity": "ഏറ്റവും ഉയർന്ന തീവ്രത വിഭാഗം ആദ്യം",
- "category_severity": "ഏറ്റവും കുറഞ്ഞ തീവ്രത വിഭാഗം ആദ്യം",
- "-modified_date": "ഏറ്റവും പുതിയ അപ്ഡേറ്റ് തീയതി ആദ്യം",
- "modified_date": "ഏറ്റവും പഴയ പുതുക്കിയ തീയതി ആദ്യം",
- "facility__name,last_consultation__current_bed__bed__name": "ബെഡ് നമ്പർ 1-N",
- "facility__name,-last_consultation__current_bed__bed__name": "കിടക്ക നമ്പർ N-1",
- "-review_time": "ഏറ്റവും പുതിയ അവലോകന തീയതി ആദ്യം",
- "review_time": "ഏറ്റവും പഴയ അവലോകന തീയതി ആദ്യം",
- "taken_at": "ആദ്യം എടുത്ത ഏറ്റവും പഴയ തീയതി",
- "-taken_at": "ഏറ്റവും പുതിയ തീയതി ആദ്യം",
- "name": "രോഗിയുടെ പേര് AZ",
- "-name": "രോഗിയുടെ പേര് ZA",
- "bed__name": "ബെഡ് നമ്പർ 1-N",
- "-bed__name": "കിടക്ക നമ്പർ N-1"
-}
diff --git a/src/Locale/ta/Common.json b/src/Locale/ta/Common.json
index abf6427ce9c..2a9bc4458b5 100644
--- a/src/Locale/ta/Common.json
+++ b/src/Locale/ta/Common.json
@@ -203,5 +203,21 @@
"deleted_successfully": "{{name}} வெற்றிகரமாக நீக்கப்பட்டது",
"delete_item": "{{name}}ஐ நீக்கவும்",
"unsupported_browser": "ஆதரிக்கப்படாத உலாவி",
- "unsupported_browser_description": "உங்கள் உலாவி ({{name}} பதிப்பு {{version}}) ஆதரிக்கப்படவில்லை. உங்கள் உலாவியை சமீபத்திய பதிப்பிற்கு புதுப்பிக்கவும் அல்லது சிறந்த அனுபவத்திற்காக ஆதரிக்கப்படும் உலாவிக்கு மாறவும்."
+ "unsupported_browser_description": "உங்கள் உலாவி ({{name}} பதிப்பு {{version}}) ஆதரிக்கப்படவில்லை. உங்கள் உலாவியை சமீபத்திய பதிப்பிற்கு புதுப்பிக்கவும் அல்லது சிறந்த அனுபவத்திற்காக ஆதரிக்கப்படும் உலாவிக்கு மாறவும்.",
+ "SORT_OPTIONS__-created_date": "புதிதாக உருவாக்கப்பட்ட தேதி முதலில்",
+ "SORT_OPTIONS__created_date": "பழைய உருவாக்கப்பட்ட தேதி முதலில்",
+ "SORT_OPTIONS__-category_severity": "அதிக தீவிரத்தன்மை பிரிவு முதலில்",
+ "SORT_OPTIONS__category_severity": "குறைந்த தீவிரத்தன்மை வகை முதலில்",
+ "SORT_OPTIONS__-modified_date": "முதலில் புதுப்பிக்கப்பட்ட தேதி",
+ "SORT_OPTIONS__modified_date": "பழைய புதுப்பிக்கப்பட்ட தேதி முதலில்",
+ "SORT_OPTIONS__facility__name,last_consultation__current_bed__bed__name": "படுக்கை எண் 1-N",
+ "SORT_OPTIONS__facility__name,-last_consultation__current_bed__bed__name": "படுக்கை எண். N-1",
+ "SORT_OPTIONS__-review_time": "சமீபத்திய மதிப்பாய்வு தேதி முதலில்",
+ "SORT_OPTIONS__review_time": "பழைய மதிப்பாய்வு தேதி முதலில்",
+ "SORT_OPTIONS__taken_at": "முதலில் எடுக்கப்பட்ட பழைய தேதி",
+ "SORT_OPTIONS__-taken_at": "சமீபத்தில் எடுக்கப்பட்ட தேதி முதலில்",
+ "SORT_OPTIONS__name": "நோயாளியின் பெயர் AZ",
+ "SORT_OPTIONS__-name": "நோயாளியின் பெயர் ZA",
+ "SORT_OPTIONS__bed__name": "படுக்கை எண் 1-N",
+ "SORT_OPTIONS__-bed__name": "படுக்கை எண். N-1"
}
\ No newline at end of file
diff --git a/src/Locale/ta/LogUpdate.json b/src/Locale/ta/LogUpdate.json
index 61a52f69d48..668dbd54a46 100644
--- a/src/Locale/ta/LogUpdate.json
+++ b/src/Locale/ta/LogUpdate.json
@@ -56,7 +56,6 @@
"HEARTBEAT_RHYTHM__REGULAR": "வழக்கமான",
"HEARTBEAT_RHYTHM__IRREGULAR": "ஒழுங்கற்ற",
"HEARTBEAT_RHYTHM__UNKNOWN": "தெரியவில்லை",
- "blood_pressure": "இரத்த அழுத்தம்",
"map_acronym": "வரைபடம்",
"systolic": "சிஸ்டாலிக்",
"diastolic": "டயஸ்டாலிக்",
diff --git a/src/Locale/ta/SortOptions.json b/src/Locale/ta/SortOptions.json
deleted file mode 100644
index a2f85b6df49..00000000000
--- a/src/Locale/ta/SortOptions.json
+++ /dev/null
@@ -1,18 +0,0 @@
-{
- "-created_date": "புதிதாக உருவாக்கப்பட்ட தேதி முதலில்",
- "created_date": "பழைய உருவாக்கப்பட்ட தேதி முதலில்",
- "-category_severity": "அதிக தீவிரத்தன்மை பிரிவு முதலில்",
- "category_severity": "குறைந்த தீவிரத்தன்மை வகை முதலில்",
- "-modified_date": "முதலில் புதுப்பிக்கப்பட்ட தேதி",
- "modified_date": "பழைய புதுப்பிக்கப்பட்ட தேதி முதலில்",
- "facility__name,last_consultation__current_bed__bed__name": "படுக்கை எண் 1-N",
- "facility__name,-last_consultation__current_bed__bed__name": "படுக்கை எண். N-1",
- "-review_time": "சமீபத்திய மதிப்பாய்வு தேதி முதலில்",
- "review_time": "பழைய மதிப்பாய்வு தேதி முதலில்",
- "taken_at": "முதலில் எடுக்கப்பட்ட பழைய தேதி",
- "-taken_at": "சமீபத்தில் எடுக்கப்பட்ட தேதி முதலில்",
- "name": "நோயாளியின் பெயர் AZ",
- "-name": "நோயாளியின் பெயர் ZA",
- "bed__name": "படுக்கை எண் 1-N",
- "-bed__name": "படுக்கை எண். N-1"
-}
diff --git a/src/Redux/actions.tsx b/src/Redux/actions.tsx
index 05a6cf18dc4..00e96e48eef 100644
--- a/src/Redux/actions.tsx
+++ b/src/Redux/actions.tsx
@@ -1,4 +1,3 @@
-import { HCXClaimModel, HCXPolicyModel } from "../Components/HCX/models";
import { fireRequest } from "./fireRequest";
// asset bed
@@ -92,85 +91,3 @@ export const listAssets = (params: object) =>
fireRequest("listAssets", [], params);
export const operateAsset = (id: string, params: object) =>
fireRequest("operateAsset", [], params, { external_id: id });
-
-export const listPMJYPackages = (query?: string) =>
- fireRequest("listPMJYPackages", [], { query });
-
-// HCX Actions
-export const HCXActions = {
- checkEligibility: (policy: string) => {
- return fireRequest("hcxCheckEligibility", [], { policy });
- },
-
- payors: {
- list(query: string) {
- return fireRequest("hcxListPayors", [], { query });
- },
- },
-
- policies: {
- list(params: object) {
- return fireRequest("listHCXPolicies", [], params);
- },
- create(obj: HCXPolicyModel) {
- return fireRequest("createHCXPolicy", [], obj);
- },
- read(id: string) {
- return fireRequest("getHCXPolicy", [], {}, { external_id: id });
- },
- update(id: string, obj: HCXPolicyModel) {
- return fireRequest("updateHCXPolicy", [], obj, { external_id: id });
- },
- partialUpdate(id: string, obj: Partial) {
- return fireRequest("partialUpdateHCXPolicy", [], obj, {
- external_id: id,
- });
- },
- delete(id: string) {
- return fireRequest("deleteHCXPolicy", [], {}, { external_id: id });
- },
- },
-
- claims: {
- list(params: object) {
- return fireRequest("listHCXClaims", [], params);
- },
- create(obj: object) {
- return fireRequest("createHCXClaim", [], obj);
- },
- read(id: string) {
- return fireRequest("getHCXClaim", [], {}, { external_id: id });
- },
- update(id: string, obj: HCXClaimModel) {
- return fireRequest("updateHCXClaim", [], obj, { external_id: id });
- },
- partialUpdate(id: string, obj: Partial) {
- return fireRequest("partialUpdateHCXClaim", [], obj, {
- external_id: id,
- });
- },
- delete(id: string) {
- return fireRequest("deleteHCXClaim", [], {}, { external_id: id });
- },
- },
-
- preauths: {
- list(consultation: string) {
- return fireRequest(
- "listHCXClaims",
- [],
- {
- consultation,
- ordering: "-modified_date",
- use: "preauthorization",
- },
- {},
- `listPreAuths-${consultation}`,
- );
- },
- },
-
- makeClaim(claim: string) {
- return fireRequest("hcxMakeClaim", [], { claim });
- },
-};
diff --git a/src/Redux/api.tsx b/src/Redux/api.tsx
index 228b24c7360..0bedb12dca5 100644
--- a/src/Redux/api.tsx
+++ b/src/Redux/api.tsx
@@ -3,25 +3,6 @@ import {
CreateConsentTBody,
} from "../Components/ABDM/types/consent";
import { HealthInformationModel } from "../Components/ABDM/types/health-information";
-import {
- IAadhaarOtp,
- IAadhaarOtpTBody,
- ICheckAndGenerateMobileOtp,
- IConfirmMobileOtp,
- IcreateHealthFacilityTBody,
- ICreateHealthIdRequest,
- ICreateHealthIdResponse,
- IGenerateMobileOtpTBody,
- IgetAbhaCardTBody,
- IHealthFacility,
- IHealthId,
- IinitiateAbdmAuthenticationTBody,
- ILinkABHANumber,
- ILinkViaQRBody,
- IpartialUpdateHealthFacilityTBody,
- ISearchByHealthIdTBody,
- IVerifyAadhaarOtpTBody,
-} from "../Components/ABDM/models";
import {
AssetBedBody,
AssetBedModel,
@@ -33,15 +14,6 @@ import {
AvailabilityRecord,
PatientAssetBed,
} from "../Components/Assets/AssetTypes";
-import {
- IDeleteBedCapacity,
- IDeleteExternalResult,
- IExternalResult,
- IExternalResultCsv,
- ILocalBodies,
- ILocalBodyByDistrict,
- IPartialUpdateExternalResult,
-} from "../Components/ExternalResult/models";
import {
BedModel,
CapacityModal,
@@ -52,40 +24,88 @@ import {
DailyRoundsRes,
DistrictModel,
DoctorModal,
- DupPatientModel,
FacilityModel,
FacilityRequest,
+ FacilitySpokeModel,
+ FacilitySpokeRequest,
IFacilityNotificationRequest,
IFacilityNotificationResponse,
+ IUserFacilityRequest,
InventoryItemsModel,
InventoryLogResponse,
InventorySummaryResponse,
- IUserFacilityRequest,
LocalBodyModel,
LocationModel,
MinimumQuantityItemResponse,
- PatientConsentModel,
PatientNotesEditModel,
PatientNotesModel,
PatientStatsModel,
- PatientTransferRequest,
PatientTransferResponse,
StateModel,
WardModel,
} from "../Components/Facility/models";
+import {
+ DailyRoundsModel,
+ PatientModel,
+ 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,
+ IDeleteExternalResult,
+ IExternalResult,
+ IExternalResultCsv,
+ ILocalBodies,
+ ILocalBodyByDistrict,
+ IPartialUpdateExternalResult,
+} from "../Components/ExternalResult/models";
+import {
+ InvestigationGroup,
+ InvestigationType,
+} from "../Components/Facility/Investigations";
+import {
+ DupPatientModel,
+ PatientConsentModel,
+ PatientTransferRequest,
+} from "../Components/Facility/models";
import { MedibaseMedicine, Prescription } from "../Components/Medicine/models";
import {
NotificationData,
PNconfigData,
} from "../Components/Notifications/models";
+import {
+ HCXClaimModel,
+ HCXCommunicationModel,
+ HCXPolicyModel,
+} from "../Components/HCX/models";
+import { ICD11DiagnosisModel } from "../Components/Diagnosis/types";
+import { IShift } from "../Components/Shifting/models";
+import { Investigation } from "../Components/Facility/Investigations/Reports/types";
+import { PaginatedResponse } from "../Utils/request/types";
import {
CreateFileRequest,
CreateFileResponse,
- DailyRoundsModel,
FileUploadModel,
- PatientModel,
- SampleReportModel,
- SampleTestModel,
} from "../Components/Patient/models";
import {
SkillModel,
@@ -94,24 +114,15 @@ import {
UserAssignedModel,
UserModel,
} from "../Components/Users/models";
-import { PaginatedResponse } from "../Utils/request/types";
-
-import { ICD11DiagnosisModel } from "../Components/Diagnosis/types";
import {
EventGeneric,
type Type,
} from "../Components/Facility/ConsultationDetails/Events/types";
-import {
- InvestigationGroup,
- InvestigationType,
-} from "../Components/Facility/Investigations";
import { InvestigationSessionType } from "../Components/Facility/Investigations/investigationsTab";
-import { Investigation } from "../Components/Facility/Investigations/Reports/types";
-import { HCXPolicyModel } from "../Components/HCX/models";
-import { IComment, IResource } from "../Components/Resource/models";
-import { IShift } from "../Components/Shifting/models";
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";
/**
* A fake function that returns an empty object casted to type T
@@ -357,7 +368,7 @@ const routes = {
getPermittedFacility: {
path: "/api/v1/facility/{id}/",
method: "GET",
- TRes: Type(),
+ TRes: Type(),
},
getAnyFacility: {
@@ -380,6 +391,38 @@ const routes = {
TBody: Type>(),
},
+ getFacilitySpokes: {
+ path: "/api/v1/facility/{id}/spokes/",
+ method: "GET",
+ TRes: Type>(),
+ },
+
+ updateFacilitySpokes: {
+ path: "/api/v1/facility/{id}/spokes/{spoke_id}/",
+ method: "PATCH",
+ TRes: Type(),
+ TBody: Type(),
+ },
+
+ getFacilitySpoke: {
+ path: "/api/v1/facility/{id}/spokes/{spoke_id}/",
+ method: "GET",
+ TRes: Type(),
+ },
+
+ createFacilitySpoke: {
+ path: "/api/v1/facility/{id}/spokes/",
+ method: "POST",
+ TRes: Type(),
+ TBody: Type>(),
+ },
+
+ deleteFacilitySpoke: {
+ path: "/api/v1/facility/{id}/spokes/{spoke_id}/",
+ method: "DELETE",
+ TRes: Type>(),
+ },
+
deleteFacilityCoverImage: {
path: "/api/v1/facility/{id}/cover_image/",
method: "DELETE",
@@ -765,7 +808,10 @@ const routes = {
method: "POST",
TRes: Type(),
TBody: Type<
- Pick & { consultation?: string }
+ Pick & {
+ consultation?: string;
+ reply_to?: string;
+ }
>(),
},
updatePatientNote: {
@@ -1579,89 +1625,166 @@ const routes = {
},
// HCX Endpoints
+ hcx: {
+ policies: {
+ list: {
+ path: "/api/hcx/policy/",
+ method: "GET",
+ TRes: Type>(),
+ },
+
+ create: {
+ path: "/api/hcx/policy/",
+ method: "POST",
+ TRes: Type(),
+ },
+
+ get: {
+ path: "/api/hcx/policy/{external_id}/",
+ method: "GET",
+ },
+
+ update: {
+ path: "/api/hcx/policy/{external_id}/",
+ method: "PUT",
+ TRes: Type(),
+ },
+
+ partialUpdate: {
+ path: "/api/hcx/policy/{external_id}/",
+ method: "PATCH",
+ },
+
+ delete: {
+ path: "/api/hcx/policy/{external_id}/",
+ method: "DELETE",
+ TRes: Type>(),
+ },
+
+ listPayors: {
+ path: "/api/hcx/payors/",
+ method: "GET",
+ TRes: Type(),
+ },
+
+ checkEligibility: {
+ path: "/api/hcx/check_eligibility/",
+ method: "POST",
+ TBody: Type<{ policy: string }>(),
+ TRes: Type(),
+ },
+ },
- listPMJYPackages: {
- path: "/api/v1/hcx/pmjy_packages/",
- method: "GET",
- },
-
- hcxListPayors: {
- path: "/api/v1/hcx/payors/",
- method: "GET",
- },
-
- hcxCheckEligibility: {
- path: "/api/v1/hcx/check_eligibility/",
- method: "POST",
- TRes: Type(),
- },
-
- listHCXPolicies: {
- path: "/api/v1/hcx/policy/",
- method: "GET",
- TRes: Type>(),
- },
-
- createHCXPolicy: {
- path: "/api/v1/hcx/policy/",
- method: "POST",
- TRes: Type(),
- },
-
- getHCXPolicy: {
- path: "/api/v1/hcx/policy/{external_id}/",
- method: "GET",
- },
-
- updateHCXPolicy: {
- path: "/api/v1/hcx/policy/{external_id}/",
- method: "PUT",
- TRes: Type(),
- },
-
- partialUpdateHCXPolicy: {
- path: "/api/v1/hcx/policy/{external_id}/",
- method: "PATCH",
- },
-
- deleteHCXPolicy: {
- path: "/api/v1/hcx/policy/{external_id}/",
- method: "DELETE",
- },
-
- listHCXClaims: {
- path: "/api/v1/hcx/claim/",
- method: "GET",
- },
-
- createHCXClaim: {
- path: "/api/v1/hcx/claim/",
- method: "POST",
- },
-
- getHCXClaim: {
- path: "/api/v1/hcx/claim/{external_id}/",
- method: "GET",
- },
-
- updateHCXClaim: {
- path: "/api/v1/hcx/claim/{external_id}/",
- method: "PUT",
- },
-
- partialUpdateHCXClaim: {
- path: "/api/v1/hcx/claim/{external_id}/",
- method: "PATCH",
- },
-
- deleteHCXClaim: {
- path: "/api/v1/hcx/claim/{external_id}/",
- method: "DELETE",
- },
+ claims: {
+ list: {
+ path: "/api/hcx/claim/",
+ method: "GET",
+ TRes: Type>(),
+ },
+
+ create: {
+ path: "/api/hcx/claim/",
+ method: "POST",
+ TBody: Type<{
+ policy: string;
+ items: {
+ id: string;
+ price: number;
+ category?: string;
+ name: string;
+ }[];
+ consultation: string;
+ use: "preauthorization" | "claim";
+ }>(),
+ TRes: Type(),
+ },
+
+ get: {
+ path: "/api/hcx/claim/{external_id}/",
+ method: "GET",
+ },
+
+ update: {
+ path: "/api/hcx/claim/{external_id}/",
+ method: "PUT",
+ },
+
+ partialUpdate: {
+ path: "/api/hcx/claim/{external_id}/",
+ method: "PATCH",
+ },
+
+ delete: {
+ path: "/api/hcx/claim/{external_id}/",
+ method: "DELETE",
+ },
+
+ listPMJYPackages: {
+ path: "/api/hcx/pmjy_packages/",
+ method: "GET",
+ TRes: Type(),
+ },
+
+ makeClaim: {
+ path: "/api/hcx/make_claim/",
+ method: "POST",
+ TBody: Type<{ claim: string }>(),
+ TRes: Type(),
+ },
+ },
- hcxMakeClaim: {
- path: "/api/v1/hcx/make_claim/",
- method: "POST",
+ communications: {
+ list: {
+ path: "/api/hcx/communication/",
+ method: "GET",
+ TRes: Type>(),
+ },
+
+ create: {
+ path: "/api/hcx/communication/",
+ method: "POST",
+ TRes: Type(),
+ TBody: Type<{
+ claim: string;
+ content: {
+ type: string;
+ data: string;
+ }[];
+ }>(),
+ },
+
+ get: {
+ path: "/api/hcx/communication/{external_id}/",
+ method: "GET",
+ TRes: Type(),
+ },
+
+ update: {
+ path: "/api/hcx/communication/{external_id}/",
+ method: "PUT",
+ TRes: Type(),
+ },
+
+ partialUpdate: {
+ path: "/api/hcx/communication/{external_id}/",
+ method: "PATCH",
+ TRes: Type(),
+ },
+
+ delete: {
+ path: "/api/hcx/communication/{external_id}/",
+ method: "DELETE",
+ },
+
+ send: {
+ path: "/api/hcx/send_communication/",
+ method: "POST",
+ TRes: Type(),
+ TBody: Type<{
+ communication: string;
+ }>(),
+ },
+ },
},
} as const;
diff --git a/src/Routers/AppRouter.tsx b/src/Routers/AppRouter.tsx
index 60e0f9411d5..f5ca25f45b2 100644
--- a/src/Routers/AppRouter.tsx
+++ b/src/Routers/AppRouter.tsx
@@ -63,7 +63,7 @@ export default function AppRouter() {
let routes = Routes;
if (careConfig.hcx.enabled) {
- routes = { ...routes, ...HCXRoutes };
+ routes = { ...HCXRoutes, ...routes };
}
if (
diff --git a/src/Routers/routes/HCXRoutes.tsx b/src/Routers/routes/HCXRoutes.tsx
index 8a36e033c15..80378b24621 100644
--- a/src/Routers/routes/HCXRoutes.tsx
+++ b/src/Routers/routes/HCXRoutes.tsx
@@ -1,6 +1,10 @@
-import ConsultationClaims from "../../Components/Facility/ConsultationClaims";
+import ConsultationClaims, {
+ IConsultationClaimsProps,
+} from "../../Components/Facility/ConsultationClaims";
export default {
"/facility/:facilityId/patient/:patientId/consultation/:consultationId/claims":
- (pathParams: any) => ,
+ (pathParams: IConsultationClaimsProps) => (
+
+ ),
};
diff --git a/src/Utils/request/uploadFile.ts b/src/Utils/request/uploadFile.ts
index 506acf72e57..c527878e283 100644
--- a/src/Utils/request/uploadFile.ts
+++ b/src/Utils/request/uploadFile.ts
@@ -1,5 +1,6 @@
import { Dispatch, SetStateAction } from "react";
import { handleUploadPercentage } from "./utils";
+import * as Notification from "../../Utils/Notifications.js";
const uploadFile = (
url: string,
@@ -19,6 +20,16 @@ const uploadFile = (
xhr.onload = () => {
onLoad(xhr);
+ if (400 <= xhr.status && xhr.status <= 499) {
+ const error = JSON.parse(xhr.responseText);
+ if (typeof error === "object" && !Array.isArray(error)) {
+ Object.values(error).forEach((msg) => {
+ Notification.Error({ msg: msg || "Something went wrong!" });
+ });
+ } else {
+ Notification.Error({ msg: error || "Something went wrong!" });
+ }
+ }
};
if (setUploadPercent != null) {
@@ -28,6 +39,9 @@ const uploadFile = (
}
xhr.onerror = () => {
+ Notification.Error({
+ msg: "Network Failure. Please check your internet connectivity.",
+ });
onError();
};
xhr.send(file);
diff --git a/src/Utils/useFileUpload.tsx b/src/Utils/useFileUpload.tsx
index fdd69c45765..a0888643414 100644
--- a/src/Utils/useFileUpload.tsx
+++ b/src/Utils/useFileUpload.tsx
@@ -2,6 +2,7 @@ import {
ChangeEvent,
DetailedHTMLProps,
InputHTMLAttributes,
+ useEffect,
useState,
} from "react";
import {
@@ -20,9 +21,12 @@ import AudioCaptureDialog from "../Components/Files/AudioCaptureDialog";
import { t } from "i18next";
export type FileUploadOptions = {
+ multiple?: boolean;
type: string;
category?: FileCategory;
onUpload?: (file: FileUploadModel) => void;
+ // if allowed, will fallback to the name of the file if a seperate filename is not defined.
+ allowNameFallback?: boolean;
} & (
| {
allowedExtensions?: string[];
@@ -41,15 +45,19 @@ export interface FileInputProps
export type FileUploadReturn = {
progress: null | number;
error: null | string;
+ validateFiles: () => boolean;
handleCameraCapture: () => void;
handleAudioCapture: () => void;
handleFileUpload: (associating_id: string) => Promise;
Dialogues: JSX.Element;
Input: (_: FileInputProps) => JSX.Element;
- fileName: string;
- file: File | null;
- setFileName: (name: string) => void;
- clearFile: () => void;
+ fileNames: string[];
+ files: File[];
+ setFileName: (names: string, index?: number) => void;
+ setFileNames: (names: string[]) => void;
+ removeFile: (index: number) => void;
+ clearFiles: () => void;
+ uploading: boolean;
};
// Array of image extensions
@@ -67,73 +75,82 @@ const ExtImage: string[] = [
export default function useFileUpload(
options: FileUploadOptions,
): FileUploadReturn {
- const { type, onUpload, category = "UNSPECIFIED" } = options;
+ const {
+ type,
+ onUpload,
+ category = "UNSPECIFIED",
+ multiple,
+ allowNameFallback = true,
+ } = options;
- const [uploadFileName, setUploadFileName] = useState("");
+ const [uploadFileNames, setUploadFileNames] = useState([]);
const [error, setError] = useState(null);
const [progress, setProgress] = useState(null);
const [cameraModalOpen, setCameraModalOpen] = useState(false);
const [audioModalOpen, setAudioModalOpen] = useState(false);
+ const [uploading, setUploading] = useState(false);
- const [file, setFile] = useState(null);
+ const [files, setFiles] = useState([]);
const onFileChange = (e: ChangeEvent): any => {
if (!e.target.files?.length) {
return;
}
- const f = e.target.files[0];
- const fileName = f.name;
- setFile(e.target.files[0]);
+ const selectedFiles = Array.from(e.target.files);
+ setFiles((prev) => [...prev, ...selectedFiles]);
- // This is commented out to prompt users to input valid file names. See https://github.com/ohcnetwork/care_fe/issues/7942#issuecomment-2324391329
- //setUploadFileName(
- // uploadFileName ||
- // fileName.substring(0, fileName.lastIndexOf(".")) ||
- // fileName,
- //);
-
- const ext: string = fileName.split(".")[1];
-
- if (ExtImage.includes(ext)) {
- const options = {
- initialQuality: 0.6,
- alwaysKeepResolution: true,
- };
- imageCompression(f, options).then((compressedFile: File) => {
- setFile(compressedFile);
- });
- return;
- }
- setFile(f);
+ selectedFiles.forEach((file) => {
+ const ext: string = file.name.split(".")[1];
+ if (ExtImage.includes(ext)) {
+ const options = {
+ initialQuality: 0.6,
+ alwaysKeepResolution: true,
+ };
+ imageCompression(file, options).then((compressedFile: File) => {
+ setFiles((prev) =>
+ prev.map((f) => (f.name === file.name ? compressedFile : f)),
+ );
+ });
+ }
+ });
};
+ useEffect(() => {
+ const blanks = Array(files.length).fill("");
+ setUploadFileNames((names) => [...names, ...blanks].slice(0, files.length));
+ }, [files]);
+
const validateFileUpload = () => {
- const filenameLength = uploadFileName.trim().length;
- const f = file;
- if (f === undefined || f === null) {
+ if (files.length === 0) {
setError(t("file_error__choose_file"));
return false;
}
- if (filenameLength === 0) {
- setError(t("file_error__file_name"));
- return false;
- }
- if (f.size > 10e7) {
- setError(t("file_error__file_size"));
- return false;
- }
- const extension = f.name.split(".").pop();
- if (
- "allowedExtensions" in options &&
- !options.allowedExtensions?.includes(extension || "")
- ) {
- setError(
- t("file_error__file_type", {
- extension,
- allowedExtensions: options.allowedExtensions?.join(", "),
- }),
- );
- return false;
+
+ for (const file of files) {
+ const filenameLength = file.name.trim().length;
+ if (filenameLength === 0) {
+ setError(t("file_error__file_name"));
+ return false;
+ }
+ if (file.size > 10e7) {
+ setError(t("file_error__file_size"));
+ return false;
+ }
+ const extension = file.name.split(".").pop();
+ if (
+ "allowedExtensions" in options &&
+ !options.allowedExtensions
+ ?.map((extension) => extension.replace(".", ""))
+ ?.includes(extension || "")
+ ) {
+ setError(
+ t("file_error__file_type", {
+ extension,
+ allowedExtensions: options.allowedExtensions?.join(", "),
+ }),
+ );
+ return false;
+ }
}
return true;
};
@@ -151,23 +168,20 @@ export default function useFileUpload(
});
};
- const uploadfile = async (data: CreateFileResponse) => {
+ const uploadfile = async (data: CreateFileResponse, file: File) => {
const url = data.signed_url;
const internal_name = data.internal_name;
- const f = file;
- if (!f) return;
- const newFile = new File([f], `${internal_name}`);
+ const newFile = new File([file], `${internal_name}`);
+
return new Promise((resolve, reject) => {
uploadFile(
url,
newFile,
"PUT",
- { "Content-Type": file?.type },
+ { "Content-Type": file.type },
(xhr: XMLHttpRequest) => {
if (xhr.status >= 200 && xhr.status < 300) {
setProgress(null);
- setFile(null);
- setUploadFileName("");
Notification.Success({
msg: t("file_uploaded"),
});
@@ -196,27 +210,40 @@ export default function useFileUpload(
const handleUpload = async (associating_id: string) => {
if (!validateFileUpload()) return;
- const f = file;
- const filename = uploadFileName === "" && f ? f.name : uploadFileName;
- const name = f?.name;
setProgress(0);
- const { data } = await request(routes.createUpload, {
- body: {
- original_name: name ?? "",
- file_type: type,
- name: filename,
- associating_id,
- file_category: category,
- mime_type: f?.type ?? "",
- },
- });
+ for (const [index, file] of files.entries()) {
+ const filename =
+ allowNameFallback && uploadFileNames[index] === "" && file
+ ? file.name
+ : uploadFileNames[index];
+ if (!filename) {
+ setError(t("file_error__single_file_name"));
+ return;
+ }
+ setUploading(true);
- if (data) {
- await uploadfile(data);
- await markUploadComplete(data, associating_id);
+ const { data } = await request(routes.createUpload, {
+ body: {
+ original_name: file.name ?? "",
+ file_type: type,
+ name: filename,
+ associating_id,
+ file_category: category,
+ mime_type: file.type ?? "",
+ },
+ });
+
+ if (data) {
+ await uploadfile(data, file);
+ await markUploadComplete(data, associating_id);
+ }
}
+
+ setUploading(false);
+ setFiles([]);
+ setUploadFileNames([]);
};
const Dialogues = (
@@ -224,17 +251,15 @@ export default function useFileUpload(
setCameraModalOpen(false)}
- onCapture={(f) => {
- setFile(f);
- setUploadFileName(uploadFileName || "");
+ onCapture={(file) => {
+ setFiles((prev) => [...prev, file]);
}}
/>
setAudioModalOpen(false)}
- onCapture={(f) => {
- setFile(f);
- setUploadFileName(uploadFileName || "");
+ onCapture={(file) => {
+ setFiles((prev) => [...prev, file]);
}}
autoRecord
/>
@@ -245,9 +270,10 @@ export default function useFileUpload(
"." + e).join(",")
@@ -262,18 +288,28 @@ export default function useFileUpload(
return {
progress,
error,
+ validateFiles: validateFileUpload,
handleCameraCapture: () => setCameraModalOpen(true),
handleAudioCapture: () => setAudioModalOpen(true),
handleFileUpload: handleUpload,
Dialogues,
Input,
- fileName: uploadFileName,
- file: file,
- setFileName: setUploadFileName,
- clearFile: () => {
- setFile(null);
- setError(null);
- setUploadFileName("");
+ fileNames: uploadFileNames,
+ files: files,
+ setFileNames: setUploadFileNames,
+ setFileName: (name: string, index = 0) => {
+ setUploadFileNames((prev) =>
+ prev.map((n, i) => (i === index ? name : n)),
+ );
+ },
+ removeFile: (index = 0) => {
+ setFiles((prev) => prev.filter((_, i) => i !== index));
+ setUploadFileNames((prev) => prev.filter((_, i) => i !== index));
+ },
+ clearFiles: () => {
+ setFiles([]);
+ setUploadFileNames([]);
},
+ uploading,
};
}
|