Skip to content

Commit

Permalink
Merge branch 'develop' into fix#6701
Browse files Browse the repository at this point in the history
  • Loading branch information
konavivekramakrishna authored Nov 24, 2023
2 parents 150a5ba + c37b554 commit ba4f96d
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 42 deletions.
3 changes: 2 additions & 1 deletion cypress/pageobject/Patient/PatientConsultation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,12 +203,13 @@ export class PatientConsultationPage {
}

addDoctorsNotes(notes: string) {
cy.get("#expand_doctor_notes").click();
cy.get("#doctor_notes_textarea").type(notes);
}

postDoctorNotes() {
cy.intercept("POST", "**/api/v1/patient/*/notes").as("postDoctorNotes");
cy.get("#submit").contains("Post Your Note").click();
cy.get("#add_doctor_note_button").click();
cy.wait("@postDoctorNotes").its("response.statusCode").should("eq", 201);
}

Expand Down
4 changes: 4 additions & 0 deletions src/Components/Assets/AssetsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ const AssetsList = () => {
asset_class: qParams.asset_class || "",
location: qParams.facility ? qParams.location || "" : "",
status: qParams.status || "",
warranty_amc_end_of_validity_before:
qParams.warranty_amc_end_of_validity_before || "",
warranty_amc_end_of_validity_after:
qParams.warranty_amc_end_of_validity_after || "",
};

const { loading } = useQuery(routes.listAssets, {
Expand Down
1 change: 1 addition & 0 deletions src/Components/Common/FilePreviewDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ const FilePreviewDialog = (props: FilePreviewProps) => {
/>
) : (
<iframe
sandbox
title="Source Files"
src={fileUrl}
className="mx-auto h-5/6 w-5/6 border-2 border-black bg-white md:my-6 md:w-4/6"
Expand Down
1 change: 1 addition & 0 deletions src/Components/Facility/ConsultationForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -724,6 +724,7 @@ export const ConsultationForm = (props: any) => {
: undefined,
consultation_notes: state.form.consultation_notes,
is_telemedicine: state.form.is_telemedicine,
icu_admission_date: state.form.icu_admission_date,
action: state.form.action,
review_interval: state.form.review_interval,
assigned_to:
Expand Down
8 changes: 4 additions & 4 deletions src/Components/Facility/Consultations/DailyRoundsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ export const DailyRoundsList = (props: any) => {
}}
>
{(_) => (
<div className="flex w-full flex-col gap-4">
<div className="-mt-2 flex w-full flex-col gap-4">
<div className="flex max-h-[85vh] flex-col gap-4 overflow-y-auto overflow-x-hidden px-3">
<PaginatedList.WhenEmpty className="flex w-full justify-center border-b border-gray-200 bg-white p-5 text-center text-2xl font-bold text-gray-500">
<span className="flex justify-center rounded-lg bg-white p-3 text-gray-700 shadow">
<PaginatedList.WhenEmpty className="flex w-full justify-center rounded-md border-b border-gray-200 bg-white px-5 py-1 text-center text-2xl font-bold text-gray-500">
<span className="flex justify-center rounded-lg bg-white p-3 text-gray-700">
{t("no_consultation_updates")}
</span>
</PaginatedList.WhenEmpty>
Expand All @@ -42,7 +42,7 @@ export const DailyRoundsList = (props: any) => {
))}
</>
</PaginatedList.WhenLoading>
<PaginatedList.Items<DailyRoundsModel> className="my-8 flex grow flex-col gap-3 lg:mx-8">
<PaginatedList.Items<DailyRoundsModel> className="flex grow flex-col gap-3">
{(item, items) => {
if (item.rounds_type === "AUTOMATED") {
return (
Expand Down
79 changes: 42 additions & 37 deletions src/Components/Facility/Consultations/LiveFeed.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import { useEffect, useRef, useState } from "react";
import { useEffect, useState, useRef } from "react";
import { useDispatch } from "react-redux";
import routes from "../../../Redux/api";
import request from "../../../Utils/request/request";
import useKeyboardShortcut from "use-keyboard-shortcut";
import {
listAssetBeds,
partialUpdateAssetBed,
deleteAssetBed,
} from "../../../Redux/actions";
import { getCameraPTZ } from "../../../Common/constants";
import {
StreamStatus,
Expand Down Expand Up @@ -109,30 +112,28 @@ const LiveFeed = (props: any) => {
};

const getBedPresets = async (id: any) => {
const { data } = await request(routes.listAssetBeds, {
pathParams: { asset: id },
body: {
const bedAssets = await dispatch(
listAssetBeds({
asset: id,
limit: page.limit,
offset: page.offset,
},
});
setBedPresets(data?.results);
})
);
setBedPresets(bedAssets?.data?.results);
setPage({
...page,
count: data?.count || 0,
count: bedAssets?.data?.count,
});
};

const deletePreset = async (id: any) => {
const { res, data } = await request(routes.deleteAssetBed, {
pathParams: { id },
});
const res = await dispatch(deleteAssetBed(id));
if (res?.status === 204) {
Notification.Success({ msg: "Preset deleted successfully" });
getBedPresets(cameraAsset.id);
} else {
Notification.Error({
msg: "Error while deleting Preset: " + (data?.detail || ""),
msg: "Error while deleting Preset: " + (res?.data?.detail || ""),
});
}
setToDelete(null);
Expand All @@ -143,18 +144,20 @@ const LiveFeed = (props: any) => {
bed_id: bed.id,
preset_name: preset,
};
const { res } = await request(routes.partialUpdateAssetBed, {
pathParams: { id: currentPreset.id },
body: {
asset: currentPreset.asset_object.id,
bed: bed.id,
meta: {
...currentPreset.meta,
...data,
const response = await dispatch(
partialUpdateAssetBed(
{
asset: currentPreset.asset_object.id,
bed: bed.id,
meta: {
...currentPreset.meta,
...data,
},
},
},
});
if (res && res.status === 200) {
currentPreset?.id
)
);
if (response && response.status === 200) {
Notification.Success({ msg: "Preset Updated" });
} else {
Notification.Error({ msg: "Something Went Wrong" });
Expand Down Expand Up @@ -255,19 +258,20 @@ const LiveFeed = (props: any) => {
if (currentPreset?.asset_object?.id && data?.position) {
setLoading(option.loadingLabel);
console.log("Updating Preset");
const { res } = await request(routes.partialUpdateAssetBed, {
pathParams: { id: currentPreset.id },
body: {
asset: currentPreset.asset_object.id,
bed: currentPreset.bed_object.id,
meta: {
...currentPreset.meta,
position: data?.position,
const response = await dispatch(
partialUpdateAssetBed(
{
asset: currentPreset.asset_object.id,
bed: currentPreset.bed_object.id,
meta: {
...currentPreset.meta,
position: data?.position,
},
},
},
});

if (res && res.status === 200) {
currentPreset?.id
)
);
if (response && response.status === 200) {
Notification.Success({ msg: "Preset Updated" });
getBedPresets(cameraAsset?.id);
fetchCameraPresets();
Expand Down Expand Up @@ -624,4 +628,5 @@ const LiveFeed = (props: any) => {
</Page>
);
};

export default LiveFeed;
3 changes: 3 additions & 0 deletions src/Components/Facility/PatientNotesSlideover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ export default function PatientNotesSlideover(props: PatientNotesProps) {
</Link>
)}
<div
id="expand_doctor_notes"
className={classNames(
"flex h-8 w-8 cursor-pointer items-center justify-center rounded bg-primary-800 text-gray-100 text-opacity-70 hover:bg-primary-700 hover:text-opacity-100",
show && "rotate-180"
Expand Down Expand Up @@ -129,6 +130,7 @@ export default function PatientNotesSlideover(props: PatientNotesProps) {
/>
<div className="relative mx-4 flex items-center">
<TextFormField
id="doctor_notes_textarea"
name="note"
value={noteField}
onChange={(e) => setNoteField(e.value)}
Expand All @@ -139,6 +141,7 @@ export default function PatientNotesSlideover(props: PatientNotesProps) {
disabled={!patientActive}
/>
<ButtonV2
id="add_doctor_note_button"
onClick={onAddNote}
border={false}
className="absolute right-2"
Expand Down
1 change: 1 addition & 0 deletions src/Components/Notifications/NotificationsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,7 @@ export default function NotificationsList({
manageResults = (
<>
{data
.filter((notification: any) => notification.event != "PUSH_MESSAGE")
.filter((notification: any) =>
showUnread ? notification.read_at === null : true
)
Expand Down

0 comments on commit ba4f96d

Please sign in to comment.