@@ -222,25 +238,15 @@ let make = (~id, ~facilityId, ~patientId, ~consultationId, ~dailyRound) => {
className="bg-white px-2 md:px-6 py-5 border-b border-gray-200 sm:px-6 max-w-5xl mx-auto border mt-4 shadow rounded-lg">
{str("Record Updates")}
- {basicEditor(~facilityId, ~patientId, ~consultationId, ~id)} {Js.Array.map(editor => {
+ {basicEditor(~facilityId, ~patientId, ~consultationId, ~id)}
+ {Js.Array.map(editor => {
editorToggle(editor, state, send)
- }, [
- HemodynamicParametersEditor,
- NeurologicalMonitoringEditor,
- VentilatorParametersEditor,
- ArterialBloodGasAnalysisEditor,
- BloodSugarEditor,
- IOBalanceEditor,
- DialysisEditor,
- PressureSoreEditor,
- NursingCareEditor,
- ])->React.array}
+ }, sections)->React.array}
diff --git a/src/Components/Patient/DailyRounds.tsx b/src/Components/Patient/DailyRounds.tsx
index 2bb544327be..97ee038362b 100644
--- a/src/Components/Patient/DailyRounds.tsx
+++ b/src/Components/Patient/DailyRounds.tsx
@@ -343,11 +343,7 @@ export const DailyRounds = (props: any) => {
Notification.Success({
msg: `${t(obj.rounds_type as string)} log updated successfully`,
});
- if (
- ["NORMAL", "TELEMEDICINE", "DOCTORS_LOG"].includes(
- state.form.rounds_type,
- )
- ) {
+ if (["NORMAL", "TELEMEDICINE"].includes(state.form.rounds_type)) {
navigate(
`/facility/${facilityId}/patient/${patientId}/consultation/${consultationId}`,
);
@@ -369,11 +365,7 @@ export const DailyRounds = (props: any) => {
msg: `${t(state.form.rounds_type)} log created successfully`,
});
- if (
- ["NORMAL", "TELEMEDICINE", "DOCTORS_LOG"].includes(
- state.form.rounds_type,
- )
- ) {
+ if (["NORMAL", "TELEMEDICINE"].includes(state.form.rounds_type)) {
navigate(
`/facility/${facilityId}/patient/${patientId}/consultation/${consultationId}`,
);
From 0f5b54cab4fc29ac23568e005682afbba59375e4 Mon Sep 17 00:00:00 2001
From: Dev-Harwani <131504127+Dev-Harwani@users.noreply.github.com>
Date: Tue, 9 Jul 2024 22:55:31 +0530
Subject: [PATCH 06/11] Fix multi-select dropdown for facilities in user
creation module (#8086)
* Fix multi-select dropdown for facilities in user creation module
* if NOptions is undefined then all the facilities will be shown.If not then that particular number will be shown.
* Apply suggestions from code review
---------
Co-authored-by: Mohammed Nihal <57055998+nihal467@users.noreply.github.com>
Co-authored-by: Rithvik Nishad
---
src/Components/Common/FacilitySelect.tsx | 5 +++--
src/Components/Form/AutoCompleteAsync.tsx | 14 +++++++++-----
2 files changed, 12 insertions(+), 7 deletions(-)
diff --git a/src/Components/Common/FacilitySelect.tsx b/src/Components/Common/FacilitySelect.tsx
index 2b820b40d6a..526bf6d68ac 100644
--- a/src/Components/Common/FacilitySelect.tsx
+++ b/src/Components/Common/FacilitySelect.tsx
@@ -17,7 +17,7 @@ interface FacilitySelectProps {
district?: string;
state?: string;
showAll?: boolean;
- showNOptions?: number;
+ showNOptions?: number | undefined;
freeText?: boolean;
selected?: FacilityModel | FacilityModel[] | null;
setSelected: (selected: FacilityModel | FacilityModel[] | null) => void;
@@ -34,7 +34,7 @@ export const FacilitySelect = (props: FacilitySelectProps) => {
searchAll,
disabled = false,
showAll = true,
- showNOptions = 10,
+ showNOptions,
className = "",
facilityType,
district,
@@ -65,6 +65,7 @@ export const FacilitySelect = (props: FacilitySelectProps) => {
data?.results?.push({
name: text,
});
+
return data?.results;
},
[searchAll, showAll, facilityType, district, exclude_user, freeText],
diff --git a/src/Components/Form/AutoCompleteAsync.tsx b/src/Components/Form/AutoCompleteAsync.tsx
index b66cf16b800..b9caa512137 100644
--- a/src/Components/Form/AutoCompleteAsync.tsx
+++ b/src/Components/Form/AutoCompleteAsync.tsx
@@ -18,7 +18,7 @@ interface Props {
onChange: (selected: any) => void;
optionLabel?: (option: any) => string;
optionLabelChip?: (option: any) => string;
- showNOptions?: number;
+ showNOptions?: number | undefined;
multiple?: boolean;
compareBy?: string;
debounceTime?: number;
@@ -40,7 +40,7 @@ const AutoCompleteAsync = (props: Props) => {
onChange,
optionLabel = (option: any) => option.label,
optionLabelChip = (option: any) => option.label,
- showNOptions = 10,
+ showNOptions,
multiple = false,
compareBy,
debounceTime = 300,
@@ -62,8 +62,13 @@ const AutoCompleteAsync = (props: Props) => {
() =>
debounce(async (query: string) => {
setLoading(true);
- const data = await fetchData(query);
- setData(data?.slice(0, showNOptions) || []);
+ const data = (await fetchData(query)) || [];
+
+ if (showNOptions !== undefined) {
+ setData(data.slice(0, showNOptions));
+ } else {
+ setData(data);
+ }
setLoading(false);
}, debounceTime),
[fetchData, showNOptions, debounceTime],
@@ -102,7 +107,6 @@ const AutoCompleteAsync = (props: Props) => {
onChange={({ target }) => setQuery(target.value)}
onFocus={props.onFocus}
onBlur={() => {
- setQuery("");
props.onBlur?.();
}}
autoComplete="off"
From ff70e5f9e4d605410fd9676c2c80c74a1f77a2e5 Mon Sep 17 00:00:00 2001
From: Rithvik Nishad
Date: Thu, 11 Jul 2024 12:20:38 +0530
Subject: [PATCH 07/11] Shows encounter duration in discharge confirmation
dialog (#8124)
* Shows encounter duration in discharge confirmation dialog
* correction for IP days
* update text of "IP Days" to "IP Day No"
---
src/Components/Facility/DischargeModal.tsx | 24 ++++++++++++++++++++--
src/Components/Patient/ManagePatients.tsx | 2 +-
src/Components/Patient/PatientInfoCard.tsx | 4 ++--
src/Locale/en/Consultation.json | 3 ++-
4 files changed, 27 insertions(+), 6 deletions(-)
diff --git a/src/Components/Facility/DischargeModal.tsx b/src/Components/Facility/DischargeModal.tsx
index 0be7b4eabd8..1476e38ed03 100644
--- a/src/Components/Facility/DischargeModal.tsx
+++ b/src/Components/Facility/DischargeModal.tsx
@@ -25,6 +25,7 @@ import { FacilitySelect } from "../Common/FacilitySelect";
import { FacilityModel } from "./models";
import dayjs from "../../Utils/dayjs";
import { FieldError } from "../Form/FieldValidators";
+import { useTranslation } from "react-i18next";
interface PreDischargeFormInterface {
new_discharge_reason: number | null;
@@ -57,6 +58,7 @@ const DischargeModal = ({
discharge_date = dayjs().format("YYYY-MM-DDTHH:mm"),
death_datetime = dayjs().format("YYYY-MM-DDTHH:mm"),
}: IProps) => {
+ const { t } = useTranslation();
const { enable_hcx } = useConfig();
const dispatch: any = useDispatch();
const [preDischargeForm, setPreDischargeForm] =
@@ -205,6 +207,19 @@ const DischargeModal = ({
}));
};
+ const encounterDuration = dayjs
+ .duration(
+ dayjs(
+ preDischargeForm[
+ discharge_reason ===
+ DISCHARGE_REASONS.find((i) => i.text == "Expired")?.id
+ ? "death_datetime"
+ : "discharge_date"
+ ],
+ ).diff(consultationData.encounter_date),
+ )
+ .humanize();
+
return (
-
{discharge_reason ===
DISCHARGE_REASONS.find((i) => i.text == "Recovered")?.id && (
<>
@@ -374,7 +388,13 @@ const DischargeModal = ({
+
+
+ {t("encounter_duration_confirmation")}{" "}
+ {encounterDuration}.
+
+
+
{isSendingDischargeApi ? (
diff --git a/src/Components/Patient/ManagePatients.tsx b/src/Components/Patient/ManagePatients.tsx
index c02efc5c737..9ddcb4b379c 100644
--- a/src/Components/Patient/ManagePatients.tsx
+++ b/src/Components/Patient/ManagePatients.tsx
@@ -610,7 +610,7 @@ export const PatientManager = () => {
size="small"
variant="primary"
startIcon="l-clock-three"
- text={`IP Days: ${dayjs().diff(patient.last_consultation.encounter_date, "day")}`}
+ text={`IP Day No: ${dayjs().diff(patient.last_consultation.encounter_date, "day") + 1}`}
/>
)}
{patient.gender === 2 &&
diff --git a/src/Components/Patient/PatientInfoCard.tsx b/src/Components/Patient/PatientInfoCard.tsx
index a43d49a26ac..d3ad76bf661 100644
--- a/src/Components/Patient/PatientInfoCard.tsx
+++ b/src/Components/Patient/PatientInfoCard.tsx
@@ -559,12 +559,12 @@ export default function PatientInfoCard(props: {
{dayjs(consultation.discharge_date || undefined).diff(
consultation.encounter_date,
"day",
- )}
+ ) + 1}